Hacker News new | ask | show | jobs
by nodefourtytwo 3154 days ago
What problem does it solve?
3 comments

My guess is a lighter weight (than Lua, Python, JS) embed-able language. A quick build creates a .so that is bigger than lua as reported below, but that is a naive and probably invalid comparison metric.

    make DEBUG=0 STATIC=0 USE_MALLOC=0 MODULE_OS=1 MODULE_SOCKET=1

    ls -lh liblemon.so
    -rwxrwxr-x 1 guest guest 271K Oct 25 08:21 liblemon.so

"Lua - Smaller footprint than Python. e.g. Look at the size of python22.dll, 824kb. A basic Lua engine, including parser/compiler/interpreter, but excluding standard libraries, weighs in at under 100kb."

Ref: http://lua-users.org/wiki/LuaVersusPython

Except liblemon is larger than liblua.

  $ ls -lh /usr/lib/x86_64-linux-gnu/liblua5.3.so.0.0.0
  -rw-r--r-- 1 root root 219K Apr 13  2016 /usr/lib/x86_64-linux-gnu/liblua5.3.so.0.0.0
And that's with Lua having many more bindings--basically, all of ANSI C, including math and stdio interfaces. Lemon only seems to bind a dozen or so POSIX routines--see os.c and socket.c.

There are other things that make it less suited for embedding than Lua. For example, Lua very carefully avoids touching any global process state. But one the very first things lemon_create() does it call srandom().

Those particular things, at least, could be easily remedied. Another reason why Lua is great for embedding is because of it's very carefully designed C API. With just a cursory look I can't tell how well Lemon compares on that score.

   2, What problems are you trying to solve?
   A: 1, easily integrate with C. 2, stable and modern syntax. that's all I wanted.
I have asked a few more questions about the language:

https://github.com/lemon-lang/lemon/issues/6

Looks like an attempt of a JS programmer to reinvent a lighter weight JS with aim at system programming.

If it is yet again tied to a complex, feature rich VM (a stack based one), then he went the wrong way in achieving his goal. Direct interpretation should've been the way forward for such task.

A stack based VM or direct interpretation have no real difference with regard to what you mention. Please elaborate further.
You are making very unnecessary comments..