Arc Forumnew | comments | leaders | submit | akkartik's commentslogin
3 points by akkartik 3285 days ago | link | parent | on: Hosting Arc app on Heroku?

Hmm, I'm surprised but this question seems to have never come up before over here. Google says the only mention of heroku in this forum is http://arclanguage.org/item?id=19394 which says one of the advantages of Clojure over Arc is that it can be hosted over Heroku.

Please report back if you have success doing so, or what problems you run into. Thanks!

-----

4 points by akkartik 3286 days ago | link | parent | on: Accessing Racket from anarki

Just to summarize rocketnia's and Oscar-Belletti's investigations on this thread, do this:

  arc> ($:require racket/list)
  arc> ($:first '(1 2))
  1

-----

3 points by akkartik 3286 days ago | link | parent | on: Accessing Racket from anarki

My guess is that it's because even though Arc uses Racket, it's still using its legacy MzScheme language. This works, though:

  arc> ($:car '(1 2))
  1
Though I'm not sure where we can find MzScheme-specific documentation anymore..

-----

4 points by Oscar-Belletti 3286 days ago | link

I think you are right: the file ac.scm starts with:

    (module ac mzscheme
MzScheme doesn't have first.

On the wayback machine I found the docs of 2008 for MzScheme version 372: http://web.archive.org/web/20080511203435/http://www.plt-sch...

There are still MzScheme docs here: http://www.plt-scheme.org/software/mzscheme/docs.html but the links on that page don't work for me, so I found the page on the wayback machine(2009) too: http://web.archive.org/web/20090603011739/http://www.plt-sch...

-----

4 points by rocketnia 3286 days ago | link

There should be up-to-date reference information about the mzscheme library here: https://docs.racket-lang.org/mzscheme/index.html?q=mzscheme

As described there, mzscheme exports most of the bindings of racket/base. As described at https://docs.racket-lang.org/reference/pairs.html?q=first#%2..., first is exported by racket/list and racket, but not by racket/base.

(My point isn't to say "you should have known" but to point out what the current documentation is like in case it's helpful for other reasons. XD )

-----

2 points by Oscar-Belletti 3286 days ago | link

You are right. Sorry for the outdated links.

-----

1 point by rocketnia 3285 days ago | link

Er, I upvoted your "sorry" just now because I did find it interesting that those archive links exist. :) I guess the Racket project doesn't have such tireless devotion to documentation that they maintain active versions of the docs for old software releases, but it's nice that a snapshot is up somewhere.

-----

2 points by akkartik 3286 days ago | link

Nice work!

-----

1 point by Oscar-Belletti 3286 days ago | link

Thanks!

-----

3 points by akkartik 3287 days ago | link | parent | on: How to run anarki as utility, not REPL?

Many thanks for your pull request! Support for Windows chronically lags behind Unix, and I'd love to hear about any more bugs you run into on Windows.

rlwrap is just a little program which provides some standard features of Unix shells like commandline history and keyboard shortcuts. It's nice to have but certainly not essential.

-----

3 points by zck 3283 days ago | link

Just echoing that rlwrap isn't needed. I actually added an arg (-n) to arc.sh that doesn't use rlwrap. I use it when running arc inside an emacs shell, because emacs has terminal integration that I prefer.

-----

3 points by jsgrahamus 3283 days ago | link

I started using ansi-term in emacs to launch a shell file which wrapped rlwrap around the file I wished to execute. Turns out that M-x no longer works in that buffer.

-----

4 points by akkartik 3287 days ago | link | parent | on: How to run anarki as utility, not REPL?

You're almost there. To pass in to Arc a filename argument to write to, you'd say this:

  $ cat test.arc
  (tofile (argv 1)
    (prn "hello, world!"))
(The quit is unnecessary since Arc will automatically quit after running all commands in batch mode.)

  $ ./arc.sh test.arc test.out
  $ cat test.out
  hello, world!
argv is a list containing commandline arguments, and tofile redirects prn to some given filename.

-----


I think you looked at it a lot closer than I did, and your points are great :)

-----


Finding better ways to write code that let newcomers make sense of them faster. More details: http://akkartik.name/about

The teaching fits into this in two ways:

a) It seems like a more ambitious test. If I can make codebases easier for non-programmers or inexperienced programmers to understand, then experienced ones should hopefully be easy.

b) It's a way to get feedback. It's hard to find experienced programmers willing to try out a strange new way of writing code that isn't going to be useful in real products for a very long time. Without this feedback I'd be likely to burn out long before I can fully validate or invalidate my hypothesis. But at least for me, teaching is extremely rewarding/addictive.

Oh, there's a third way: since I get paid for my teaching, there's the distant possibility that I might be able to scale up the teaching to fund my research so that I can work on it full-time.

-----

3 points by jsgrahamus 3290 days ago | link

Love teaching myself.

BTW, this HN link has some traffic: https://news.ycombinator.com/item?id=12501763

-----

2 points by akkartik 3290 days ago | link

Thanks! I remember seeing it yesterday at 1 point and assuming it was done. Didn't notice when people started upvoting it. Oh well, probably too late now.

-----

3 points by akkartik 3292 days ago | link | parent | on: Creating a maze game

It's possible I'm misunderstanding what y'all mean by "maze game". Does something in text mode like https://github.com/ryanb/ruby-warrior qualify? It's probably at the bottom of a steep hill with Dwarf Fortress at the top..

If text mode is an option, I'll plug my Basic-like http://akkartik.name/post/mu language. My students have made tic-tac-toe and a card game with it. Maybe we should try a maze game next. Here's a text-mode chessboard program, for example: http://akkartik.github.io/mu/html/chessboard.mu.html. With tests for screen and keyboard access (search for 'scenario'). I'm sure it looks like Greek, but take my word for it that 11- and 12-year olds found it pretty easy to work with. Happy to show more over a Hangout or something.

Ack, right after I typed all this out I remembered the Windows constraint. That disqualifies Mu, at least immediately. I knew there was a reason I chose to keep mum when I saw jsgrahamus's post last night.

-----

3 points by akkartik 3297 days ago | link | parent | on: Errors in anarki stable

Many thanks! I'll merge it to stable.

Edit: Done.

-----

2 points by Oscar-Belletti 3294 days ago | link

I checked now, string mutation works.

But what about the other warnings? Is the "main: not defined" warning due to my racket version?

The second warning (./arc.sh: line 40: [: too many arguments) disappears if I change (in arc.sh):

    if [ $repl = '#t' ]
To:

    if [ "$repl" = '#t' ]

-----

2 points by akkartik 3293 days ago | link

Yes, I wondered what to do about that and who if anyone cared about all those features. Then I forgot :/ I'll create a more bare-bones but working script today.

Edit 14 minutes later: Done: https://github.com/arclanguage/anarki/commit/8764126812. Do let us know if you have any other problems. (I've only tested the script on Mac at the moment.)

-----

2 points by Oscar-Belletti 3293 days ago | link

Now from the command line I don't get any warnings.

However, running arc in emacs (I use arc.el and arc-inferior.el) gives an error:

    rlwrap: error: My terminal reports width=0 (is it emacs?)  I can't handle this, sorry!
rlwrap doesn't work in emacs and this IMO is the reason the previous script had the --no-rl option.

-----

2 points by akkartik 3293 days ago | link

Ah, I see. Ok, I'll bring that back.

Thanks for explaining the reason for that flag.

Edit 15 minutes later: I've made the flag to disable rlwrap '-n' like in the master branch.

(I didn't pick the original flag, so I'm not attached to that name. I can change it if you want, I just want both branches to be consistent. I also renamed the script to 'arc' like in the master branch, just to make my life easier. I'll update the instructions at https://arclanguage.github.io next.)

-----

2 points by Oscar-Belletti 3292 days ago | link

Now it works both from the command line and from emacs.

It's ok for me that the the flag is -n.

I think that the arc script was named "arc.sh" because the folder which is used by the news server is "arc", and it would conflict. We can either take back the "arc.sh" name or change the news server's directory to something else, perhaps "www" like in the master branch.

Edit: We should also change the flag of the default program name in inferior-arc.el (line 95):

    (defvar arc-program-name "arc --no-rl"
To:

    (defvar arc-program-name "arc -n"

-----

2 points by akkartik 3292 days ago | link

Thanks for those comments!

Yeah you're right. I'm going to switch to arc.sh everywhere.

Edit 15 minutes later: all done, though the commit histories are a mess. Let me know if I missed renaming the script in any places!

-----

2 points by Oscar-Belletti 3290 days ago | link

"Thanks for those comments!"

You're welcome.

I'll certainly tell you if I find some references to the old "arc" name.

-----

2 points by akkartik 3299 days ago | link | parent | on: Errors in anarki stable

Gosh, I haven't looked at 'stable' in ages and it looks like it's mostly unmodified since 2009, before the Racket days. It's still using 'mzscheme', which isn't even in my Racket 6.3 distribution on Mac OS anymore. And I no longer remember where we hacked Racket to permit mutable strings :/ I didn't see any diffs in ac.scm that might be responsible. Maybe someone else knows?

-----

2 points by zck 3298 days ago | link

Hrm, perhaps it shouldn't be called "stable". That suggests a more-tested release cycle. Maybe something like "original" or "pure", or even "3.1-release"?

I like the idea of having something that's what was originally released, but doesn't really suggest that it's what someone should use if they're new to Arc.

-----

4 points by akkartik 3298 days ago | link

Well, we do also have 'official' which is exactly what was released.

I think the intent is that 'stable' is guaranteed to be backwards compatible with 'official'. So the real issue is that 'official' is stale.

-----

More