
Luna Programming Language – a small, elegant VM implemented in C - alongtheflow
https://github.com/tj/luna
======
tjholowaychuk
Author here. Not sure why it was posted, but this (really old) project is
basically defunct. I gave github.com/luna/* to the people creating the visual
Luna language that was on HN recently. Moving it to my account must have
caught someone's eye.

Anyway it was just a toy project that I never had enough time/motivation to
complete. I was inspired by the size of Lua's VM, but deterred by its
obscurity (and lack of inline documentation), so my original goal was to
create a very clean and minimal VM.

~~~
munificent
> I was inspired by the size of Lua's VM, but deterred by its obscurity (and
> lack of inline documentation), so my original goal was to create a very
> clean and minimal VM.

Me too, so I created Wren:

[https://github.com/munificent/wren](https://github.com/munificent/wren)

It's about the same size as Lua, significantly faster, and _much_ more
thoroughly documented. I also like the language itself more — it's object
model is more familiar to someone coming from Java/C++/C#/etc. — but that's
personal preference.

... heh and then I scroll down and see two people have already mentioned Wren.
I guess I'm doing a good job of branding it as the "better documented Lua". :)

~~~
tjholowaychuk
Nice! Looks cool, I thought at first that it was this Wren:
[https://github.com/darius/wren](https://github.com/darius/wren), it's super
compact, but not so easy to read haha.

~~~
munificent
Oh, dang. When I first picked the name, I hunted around and didn't see if
being used for anything, but I guess I missed this one. :(

------
vortico
Luna looked great a year ago, since its syntax it ever-so-close to ideal. If
it has momentum now, I'd invest a lot of time writing bindings to popular C
libraries, an event loop, and a web framework. But it's not functional yet, or
probably ever unless someone adopts it. I'm a fan of tj's other work though. I
don't see how he can pump out so many quality npm packages and the like.

~~~
gunn
[http://crystal-lang.org/](http://crystal-lang.org/) might be a good fit for
you then. Or [http://nim-lang.org/](http://nim-lang.org/) if you're flexible
on syntax.

~~~
vortico
Those languages are too big, so I might as well use Ruby or the Node
environment when I need a full-featured language with lots of libraries. I'd
like something dead simple that I can statically link into my C programs, with
a syntax I can completely explain to someone in 15 minutes. I currently use
duktape/Coffeescript or Lua/Moonscript for that, since hosting it in C is
about ~5 lines of boilerplate code.

Edit: Does anyone know of any other languages similar to the syntax of
Coffeescript and Moonscript?

~~~
datashaman
[http://elixir-lang.org/](http://elixir-lang.org/) _looks_ quite similar,
although it is functional (and backed by the Erlang VM BEAM).

------
riscy
It doesn't look like this project has gotten past parsing, since all it
appears to do is dump an AST.

~~~
dmytrish
It has some opcodes implemented, but at a quick glance I found no signs of any
memory management and no way to actually execute opcodes.

------
Ace17
In the same vein:
[https://github.com/munificent/wren](https://github.com/munificent/wren)

------
bogomipz
Neat! Out of curiosity how long did this take you to write?

------
smilekzs
Name clash with
[https://news.ycombinator.com/item?id=11144828](https://news.ycombinator.com/item?id=11144828)

~~~
startling
Name clash with
[https://en.wikipedia.org/wiki/Luna_(goddess)](https://en.wikipedia.org/wiki/Luna_\(goddess\))

------
wmccullough
Another language that's basically Python 1.5...

~~~
wallacoloo
I never dealt with Python until the 2.x series, but hasn't Python always been
dynamically typed?

Also, the coroutine business seems a significant difference, as Python's
concurrency model has always (to my knowledge) been limited by the GIL.

~~~
kelvin0
Coroutines != Multithreading. Also as I understand it, GIL places limitations
on Python multithreading. Please correct me if I'm wrong.

