Arc Forumnew | comments | leaders | submitlogin
Rark - An Arc inspired Racket language. (github.com)
5 points by kogir 4139 days ago | 5 comments


2 points by kogir 4139 days ago | link

This is my fun little side project - the aim being to get Arc running inside of Racket with a little less friction: better performance, profiling support and source locations for errors.

It can run some Arc code unmodified. You'll likely be more comfortable with rark/load (which defines everything at the top level, and is hopeless [1]).

  [1.1]: https://www.google.com/search?q=racket+the+top+level+is+hopeless
  [1.2]: https://gist.github.com/samth/3083053

-----

1 point by akkartik 4133 days ago | link

Can you point out the most disagreeable changes? :)

-----

2 points by rocketnia 4133 days ago | link

Good error reporting is pretty disagreeable to me, lol. :-p

I think Arc's main advantages over Scheme, once all the Arc-like naming conventions and macros are in place, are setforms, defcall (not in pg's Arc), and the ssyntaxes (a:b c), a.b, and a!b. Going by the examples, Rark has setforms, and its ability to unwrap data structures using function calls indicates defcall wouldn't be hard to add if it isn't there already, but I don't see anything about ssyntax. I've been meaning to download and run Rark to see if ssyntax support is actually there after all.

The abstract "Scheme" I'm talking about might have a certain advantage over Racket, but I might just be doing it wrong: Is possible to write a macro and use it in the same file? I've had to break my utilities into three files just to have multiple layers of macros. I'm interested in seeing whether Rark makes this any easier.

-----

2 points by kogir 4132 days ago | link

It's currently missing extensible setforms, but all the standard ssyntax and brackets should work. They're detected and expanded (awkwardly right now) at the reader level.

-----

3 points by kogir 4132 days ago | link

It's hard to say since Arc doesn't have a formal spec. The end goal is for everything to just work like it would in pg's Arc. I'm slowly working toward that goal.

Right now, Arc s-exp editing macros are straight-up unsupported. In addition to pattern matching, you have to explicitly break hygiene with leak and bind:

  (mac nif (test body ...)
    #:leak (nit)
    (bind (nit test)
      (if nit body ...)))
  
  > (nif 5 (displayln (+ "yep: " nit)) (displayln (+ "nope: " nit)))
  yep: 5
  
  > (nif nil (displayln (+ "yep: " nit)) (displayln (+ "nope: " nit)))
  nope: 
There's more I'm sure.

-----