Live data from Hacker News

Lua for Elixir

davelucia.com

61–70 of 86 posts

Re: Lua for Elixir

#61
post #26

Earlier quoted context omitted.

You gotta be trolling... You're literally responding to someone pointing out you don't need multiple files in elixir. And the same is true for Java and kotlin. Heck even the official spring boots demo videos define everything in a single file nowadays. Multiple files is just a convention, because otherwise your project will become unhandy eventually. That applies to Go as well.

I am talking about the typical / usual case. In fact, you typically use "mix phx.new" for projects using Phoenix in Elixir, and it creates lots of files, as opposed to "import ..." in a single Go file. I never said that it is impossible to do in Elixir (or Java), but it is not the typical case.

Are you comparing Elixir with a framework as extensive as Phoenix to Go and "just" its standard http library? If so I'm not sure that would be a good comparison then.

Re: Lua for Elixir

#62
post #57

Earlier quoted context omitted.

I typically use specific flags to "mix phx.new" that gets rid most of the files, especially JavaScript and whatnot. I am not at my PC right now and I forgot the flags, but I am sure you know what I am referring to. I never tried starting with Elixir scripts, I will give that a try.

Someone linked the Plug docs elsewhere in this subthread, those show you how you can quickly launch a web server from a single file, including one with WebSocket capability. In my opinion Elixir scripts punch way above their weight. It's trivial to pull in the same dependencies as you would in a full project and you can easily keep a set of five or ten template scripts just laying around and copy those when you want…

Side-note: considering you like Prolog, how come you are not writing Erlang instead of Elixir?

Re: Lua for Elixir

#63
post #7

Very nice, but it is confusing to name a library for using a language the same thing as that language. I suppose this is meant to be a temporary state of affairs while Lua (the library) gets merged into Luerl, but I would have personally called it Luerl++ or such.

Author here! Luerl++ is not a valid module name :) More seriously, I considered alternate names, but settled on this because it was short, literal, and given that its in the context of Elixir, makes sense when using it. As you stated, the hope is to consolidate it into Luerl at some point

Have you considered "Luex", a nod to Luerl but with the typical Elixir suffix?

Re: Lua for Elixir

#64

This is not embedding the C Lua runtime and compiler, but rather a complete implementation of Lua 5.3. This feat is made possible by the underlying Luerl library, which implements a Lua parser, compiler, and runtime, all in Erlang. Okay, that's actually pretty cool (: Also a sign of Lua's maturity and popularity, that it's got various independent implementations (LuaJIT, this one, perhaps others I don't know about).

LuaJIT is definitely amazing.

Re: Lua for Elixir

#65
post #63

Earlier quoted context omitted.

Author here! Luerl++ is not a valid module name :) More seriously, I considered alternate names, but settled on this because it was short, literal, and given that its in the context of Elixir, makes sense when using it. As you stated, the hope is to consolidate it into Luerl at some point

Have you considered "Luex", a nod to Luerl but with the typical Elixir suffix?

[deleted]

Re: Lua for Elixir

#66

Does that mean I can now write Fennel to target BEAM?

There is a fennel channel in the discord/slack if you're interested. I'm not sure how successful it has been

Fennel compiles to Lua, so theoretically it should work.

You should be able to do anything Lua does, run on any Lua interpreter, and use any Lua library.

Re: Lua for Elixir

#67

Earlier quoted context omitted.

I am talking about the typical / usual case. In fact, you typically use "mix phx.new" for projects using Phoenix in Elixir, and it creates lots of files, as opposed to "import ..." in a single Go file. I never said that it is impossible to do in Elixir (or Java), but it is not the typical case.

Are you comparing Elixir with a framework as extensive as Phoenix to Go and "just" its standard http library? If so I'm not sure that would be a good comparison then.

No, you could import a full-blown framework and have it set up within one single file, in fact, that is how you usually start, typically... Unless you like having lots of files, of course. I have used such Go libraries / frameworks before, and it all started out as a single file, but with Phoenix, you start with lots of files. I am not saying it is a bad thing, I am just expressing my preference to fewer files. Organization and modularity are great, but in the case of Go, I create the files myself (so I am more aware of everything that is going on). In case of Phoenix ("mix phx.new"), it is done for you. Again, not saying it is a bad thing. I am fine with it by now, but it was overwhelming and demotivating in the beginning, as opposed to, say, Go.

Re: Lua for Elixir

#68
Fun fact (probably well-known fact for HN audience): Both Lua and Elixir were created by Brazilians. Lua by Roberto Ierusalimschy and team at PUC-Rio in 1993, and Elixir by José Valim in 2011

Re: Lua for Elixir

#69
post #63

Earlier quoted context omitted.

Author here! Luerl++ is not a valid module name :) More seriously, I considered alternate names, but settled on this because it was short, literal, and given that its in the context of Elixir, makes sense when using it. As you stated, the hope is to consolidate it into Luerl at some point

Have you considered "Luex", a nod to Luerl but with the typical Elixir suffix?

Humble appeal, because they'd win instantly: Please don't steal my useless project's name [0].

[0] https://luarocks.org/modules/shakna-israel/luaex

Re: Lua for Elixir

#70
post #63

Earlier quoted context omitted.

Author here! Luerl++ is not a valid module name :) More seriously, I considered alternate names, but settled on this because it was short, literal, and given that its in the context of Elixir, makes sense when using it. As you stated, the hope is to consolidate it into Luerl at some point

Have you considered "Luex", a nod to Luerl but with the typical Elixir suffix?

I have a personal mission to never name any libraries with the -ex prefix
Post reply on HN