Arc Forumnew | comments | leaders | submitlogin
Version of Nulan that compiles down to raw JavaScript (github.com)
2 points by Pauan 4410 days ago | 1 comment


1 point by Pauan 4410 days ago | link

After about a week of work, I got a JS version of Nulan working well enough that I'm willing to show it off. For a taste of how it looks, check out NULAN.macros:

https://github.com/Pauan/nulan/blob/8353af71c33d63960d06579e...

Some more things you can try at the REPL:

  # function and infix syntax works
  ((-> a b c (a + b * c)) 1 2 3)
  
  # some pattern matching works, some doesn't
  ((-> 5 10) 5)
  ((-> 5 10) 1)
  ((-> @a a) 1 2 3)
  ((-> @a b {a b}) 1 2 3)
  
  # operator precedence works
  (and (or 1 2) (or 3 4))
  
  # almost anything can be used as an expression
  -> (var foo 5)

  # Arc-style "in"
  (in 1 2 3 4 5)
And some more stuff too, like namespaces and the capability to eval things at compile time. I'll keep adding in things and fixing things as I come across them.

-----