Fork me on GitHub
#clojure-dev
<
2019-05-30
>
vlaaad11:05:12

is it possible to write a cljs compiler backend that emits lua code? I found an abandoned project from 7 years ago that tried to do that: https://github.com/raph-amiard/clojurescript-lua (as well as discussion with David Nolen, apparently with the same person who tried that: https://archive.clojure.org/design-wiki/display/design/Decoupling%2Bcljs.core.html) but I guess clojurescript changed a lot in last 7 years?

mpenet12:05:58

Sure. Or you could just use fennel. It's similar syntactically but otherwise it's just lua with parens (and macros, some sugar here there), which has both pros and cons

vlaaad12:05:45

I don't want lua with parens, I want clojure on another host

mpenet12:05:54

I guess you answered your question yourself earlier then: it's possible.

cfleming23:05:38

@vlaad I don’t think there is any conceptual problem with doing that, but there are some issues with the result, in particular the Lua/LuaJIT GC is not very performant, so persistent datastructures will almost certainly perform badly. IIRC Tim Baldridge had similar problems with Pixie.

cfleming23:05:00

There’s a #cljs-dev which is probably a better place to ask this. Also, you might want to check out https://fennel-lang.org/, which is somewhat clojurey but is more like lua with a skin.