Re:Lemon – An embeddable, lightweight programming language i...
by nodefourtytwo on Wednesday October 25, 2017 @07:21AM
(#15549140)
What problem does it solve?
[ Parent
| on HN ]
Re:Lemon – An embeddable, lightweight programming language i...
by gvb on Wednesday October 25, 2017 @08:24AM
(#15549438)
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."
Re:Lemon – An embeddable, lightweight programming language i...
by wahern on Wednesday October 25, 2017 @10:15PM
(#15555857)
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.
Re:Lemon – An embeddable, lightweight programming language i...
by stephen82 on Wednesday October 25, 2017 @02:04PM
(#15552485)
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:
Re:Lemon – An embeddable, lightweight programming language i...
by baybal2 on Wednesday October 25, 2017 @07:30AM
(#15549188)
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.
Re:Lemon – An embeddable, lightweight programming language i...
by andrewchambers on Wednesday October 25, 2017 @08:30AM
(#15549471)
A stack based VM or direct interpretation have no real difference with regard to what you mention. Please elaborate further.
Re:Lemon – An embeddable, lightweight programming language i...
by cond289123 on Wednesday October 25, 2017 @08:52AM
(#15549604)
You are making very unnecessary comments..