Live data from Hacker News

Lemon – An embeddable, lightweight programming language in ANSI C

github.com

21–30 of 71 posts

Re: Lemon – An embeddable, lightweight programming language in ANSI C

#21
post #5

Went to the doc directory and got this: TODO: Add Doc Could developers please stop doing that? These 'agile development' and 'release early and often' mantras have really gone overboard. Why would anybody use a programming language with zero documentation for anything? Are we supposed to guess the language and its features from a single five-line hello world program?

In all fairness: there seems to be a little bit more of documentation on http://www.lemon-lang.org So, whoever posted this to hacker news should have used that link rather than the GitHub link and of course, it seems to be way to early in development to post it at all. I have some quite unfinished projects of mine on GitHub, but I would never post a link to them until they are in a state where they would be relevant…

[deleted]

Re: Lemon – An embeddable, lightweight programming language in ANSI C

#23
post #22

i'd like to see an embedded language designed to not have OO, and for the host system/language to handle the objects. I guess Lua 5.2 kinda fulfills that.

JavaScript? The original use case was exactly that.

it's too open to abuse and shoehorning of libraries etc. also you cannot embed javascript into something built in javascript it's eval.

Re: Lemon – An embeddable, lightweight programming language in ANSI C

#26

Went to the doc directory and got this: TODO: Add Doc Could developers please stop doing that? These 'agile development' and 'release early and often' mantras have really gone overboard. Why would anybody use a programming language with zero documentation for anything? Are we supposed to guess the language and its features from a single five-line hello world program?

> Why would anybody use a programming language with zero documentation for anything? Why would you write documentation if your language implementation is still rapidly evolving?

Regardless, shouldn't you at least write documentation to isolate and identify confusing points of your rapidly evolving language? It's almost a matter of good practices; explaining something is usually the best way to learn it.

Re: Lemon – An embeddable, lightweight programming language in ANSI C

#27
The documentation [1] appears to come from a very ordered mind. There's something very appealing about simplicity.

I see more similarity with Python than either Java or C, except for the braces and semicolons.

The description says that everything is an object, even types, though there's no way to specify types in the function prototypes so far, it seems. (Whilst that is what you would expect from a dynamically typed language, it can still be useful for optional type checking, or for later optimisation (AOT or Jit), or to make it easier to efficiently add methods for existing "types".)

Actually, what I can't quite see from the documentation is how one calls methods, whether it is necessary to put methods inside the classes, whether they dispatch only on the first argument or an implicit "this", and how inheritance is handled.

So I guess this is all at a very early stage of development.

[1] http://www.lemon-lang.org/documentation

Re: Lemon – An embeddable, lightweight programming language in ANSI C

#28
post #2

Looks like a mashup of Ruby, JavaScript and tiny bit of Python.

I’m mostly seeing a lot of Python. The examples show that multiple assignment unpacks collections, functions can be called with argument name assignment, and collections can be unpacked into named arguments, as opposed to using collections to replace named arguments.

Ruby supports that too. Here's a snippet that shows named arguments, and unpacking a Hash into named arguments.

It can do multiple assignment and unpacking collections into them too, though unlike with named arguments, that will treat the collection as an Array:

    def foo bar:, baz:
        p [bar, baz]
    end
    
    h = {bar: 1, baz: 2}
    
    foo(h)

Re: Lemon – An embeddable, lightweight programming language in ANSI C

#30
post #18
post #6

Earlier quoted context omitted.

> Why would anybody use a programming language with zero documentation for anything? Are we supposed to guess the language and its features from a single five-line hello world program? As someone who has done a handful of compiler/interpreter projects: I don't think that they expect anyone at this point to be using that language. They're targetting it at language geeks like myself (who go and dig around the source, w…

It is dynamic, curly braced, garbage collected, coroutines. Some really squeaky clean C code too. One can immediately tell this is a great code base to read and learn from, at the very least.

What's so squeaky clean about hiding a goto inside a macro?
Post reply on HN