
Eden: a Lua-based scripting language in Clojure - tosh
https://github.com/benzap/eden
======
sbjs
If this project relies on the GraalVM, I think it could go even further by
implementing the GraalVM Polyglot interface [1] and becoming a first class
language on the GraalVM. Then it wouldn't need to share Lisp syntax, and could
use the real Lua syntax. It would also be much faster since it would be
compiled into JVM bytecode by Graal compiler.

[1] [https://www.graalvm.org/docs/graalvm-as-a-
platform/implement...](https://www.graalvm.org/docs/graalvm-as-a-
platform/implement-language/)

------
KyleGalvin
I saw the title and thought "Hey, an old friend of mine would love this!"

Then I opened it and realized it was him who had written it. Small world.

------
scardine
Except for lisps, few languages let you name functions/variables using dashes
and other symbols but looks like any legal name in Clojure is fair game:

    
    
        function people-eq?(p1 p2)
          if p1 == p2 then
            println("Are Equal!")
          else
            println("Not Equal!")
          end
        end
    

Interesting.

~~~
lispm
Common Lisp allows arbitrary names via escaped symbols:

    
    
      CL-USER 2 > (defun |this
      is a
      multiline
      symbol with whitespace|
                         (a b)
                    (+ a b))
      |this
      is a
      multiline
      symbol with whitespace|
    
      CL-USER 3 > (|this
      is a
      multiline
      symbol with whitespace| 20 22)
      42

~~~
kovek
Then variable names can be very self-descriptive! Looks useful to me

------
zcam
Interesting project.

I think "Lua inspired" instead of "based" would be more accurate.

I have been quite happy with luaj for "end-user" scripting on a clojure app we
develop. While it requires to know a bit about lua internals it's quite easy
to use. Also just using Lua (plus some bundled fns) buys us a lot of stuff for
free (libs, docs, tutorials etc).

I guess an advantage of eden could be portability (cljs), but it's not
something that matters to me.

~~~
sbjs
It's interesting that you are using LuaJ in your clojure app! I thought Lua
was mostly used for scripting games, so I'm curious now: What is the benefit
of using it within your closure app? What do you use it for?

~~~
klibertp
Not the GP, so my guess:

> What is the benefit of using it within your closure app?

The benefit is probably it _not being Clojure_. While objectively not any
better, more people are familiar with the non-prefix syntax and imperative
semantics. If you intend the scripts to be written by some 3rd party, trying
to convince them that Lisps are great is a waste of time. I mean, they _are_
great - but there are many programmers (a majority, even) who don't care or
can't appreciate it, and it gets even worse if you consider other
professionals in the field.

If not for this, and if you don't need any particular feature the other
language provides (in Lua it would be either sandboxing or coroutines, I
think), then Clojure is perfectly capable of being used for scripting. Even
more so than most languages; for example, simple syntax and macros (and the
resulting ease of making DSLs) are desirable properties in a scripting
language.

------
zackmorris
Excited to see that finally someone has written an imperative language in a
functional runtime. Normally it's the other way around - countless Lisp
implementations running in C, because those are trivial to write.

The most important feature of Eden IMHO is the copy-on-write semantics for
collection that it inherited from Clojure. I hope this extends to nested
structures like JSON data (it should). This opens the door to not having to
distinguish between passing by value and passing by reference, although atom()
is still available for mimicking references if needed. This opens the door for
content-addressable memories and rapid application development where the user
can focus on business logic, with less time wasted on the more mundane aspects
of programming like resource management.

I've written about all this stuff countless times in previous comments so
kudus to Eden for being one of the first languages I've seen to start getting
this stuff right!

~~~
lispm
> Excited to see that finally someone has written an imperative language in a
> functional runtime.

Aren't there zillions of languages implemented on top of Lisp dialects?

    
    
        CL-USER 13 > (CLPYTHON.APP.REPL:REPL)
        Welcome to CLPython, an implementation of Python in Common Lisp.
        Running on: LispWorks 7.1.1
        REPL shortcuts: `:q' = quit, `:h' = help.
    
        ;; Consider customizing variable *CLPYTHON-MODULE-SEARCH-PATHS*
        ;; to be a list of paths that are tried when locating a module in order to import it
        ;; (in addition to the current directory and `sys.path'). Typically it should at least
        ;; contain the path to the Python 2.x standard libraries, as those are not
        ;; distributed with CLPython.
        >>> for i in range(4): print i
        ... 
        0
        1
        2
        3
        >>> 3 + 14
        17

