Live data from Hacker News

Lua for Elixir

davelucia.com

71–80 of 86 posts

Re: Lua for Elixir

#72
post #57

Earlier quoted context omitted.

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?

It's harder to teach to juniors with a background in stuff like JavaScript and Python. While it has a rather nice elegance and simplicity to it Erlang is a bit more demanding from a business and organisational perspective.

A clever intern with a rather shallow two year 'bootcamp' education and no work experience picks up Elixir and Phoenix in a couple of months. People with background in enterprise algolians like Java and C# can also get productive in Elixir kind of fast since it allows similar patterns.

In my experience Lisp-like languages prepare well for Erlang, and that's a very rare background where I live.

Re: Lua for Elixir

#73
post #72

Earlier quoted context omitted.

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

It's harder to teach to juniors with a background in stuff like JavaScript and Python. While it has a rather nice elegance and simplicity to it Erlang is a bit more demanding from a business and organisational perspective. A clever intern with a rather shallow two year 'bootcamp' education and no work experience picks up Elixir and Phoenix in a couple of months. People with background in enterprise algolians like Jav…

Where do you live if you do not mind asking? Europe? Western Europe, Eastern Europe?

Re: Lua for Elixir

#74
post #57

Earlier quoted context omitted.

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?

I actually like Erlang, but I personally feel it has a lot of rough edges. I'd probably spend a lot of time polishing them to the point where I'd just reinvent Elixir, so I prefer Elixir for that reason alone.

The other reason I wouldn't use Erlang is that Elixir has a much more vibrant & active community. A lot of the Erlang libraries (as of a few years ago when I last looked) were quite old & there wasn't a lot of active development being doing on them. I like being able to track down answers to questions & documentation that is more current. And of course there are more likely to be off the shelf Elixir libraries available for download, too.

Re: Lua for Elixir

#75

If you're looking for a cool example of Lua running on the BEAM, check out the creator of Luerl (Robert Virding) space ship demo https://github.com/rvirding/ship-demo

Here is a video demo: https://www.youtube.com/watch?v=NC8Xl6tvjfk

Some instructions to install it on macOS: https://erlangforums.com/t/lt-using-luerl-to-run-spaceships-...

Re: Lua for Elixir

#76

We used Luerl, the underlying Lua engine, in production for years as a sandboxed scripting environment for FarmBot devices back in the day. Users could execute scripts directly on the device to control peripherals. It was a solid library and the community support was great. From an ergonomics perspective, developers preferred this approach over API calls. I am surprised more projects don’t provide a Lua scripting lay…

> I am surprised more projects don’t provide a Lua scripting layer. Completely agree. I've been adding Lua scripting support to pretty much everything I make now. Most recently my programmable SSE server [1]. It's extended the functionality far beyond anything that I would have had the time and patience to do myself. Lua is such a treat. [1] https://github.com/benwilber/tinysse

>Lua is such a treat.

It sure is.

I've been using Lua professionally and personally for some decades now, and I think that there is no need to be surprised that more projects don't provide a Lua scripting layer, because actually, Lua is everywhere. And the scripting aspect is one thing - but its not the only reason to use Lua.

Lua is so easily embeddable and functionally productive as a development tool, its not always necessarily necessary to have this layer exposed to the user.

Sure, engines and things provide scripting, and that is a need/want of the respective markets. Who doesn't love redis, et al.?

But Lua can be put in places where the scripting aspect is merely a development method, and in the end shipped product, things are tightly bound to bytecode as an application framework beyond scripting.

The point being, Lua is such a treat that it is, literally, in places you might least expect - or at least, will find under a lot of covers.

And after all, thats the beauty of it: as an embedded language/VM/function interface, Lua can sure scale to different territories.

Re: Lua for Elixir

#77
post #71

Earlier quoted context omitted.

I have a personal mission to never name any libraries with the -ex prefix

Curious, why?

Early in the Elixir days, every library was named Thing-ex of ex-Thing.

IMO this is really lazy in terms of naming and from a usage perspective, you get really tired of typing that out in code.

I think we can do better

Re: Lua for Elixir

#78
post #71

Earlier quoted context omitted.

Curious, why?

Early in the Elixir days, every library was named Thing-ex of ex-Thing. IMO this is really lazy in terms of naming and from a usage perspective, you get really tired of typing that out in code. I think we can do better

Suffixing a name with -ex often results in unique names, which helps filtering search results. I see a slight problem with name ending on an s though.

Also, aren't you the author of jqex? ;)

Re: Lua for Elixir

#79
post #78

Earlier quoted context omitted.

Early in the Elixir days, every library was named Thing-ex of ex-Thing. IMO this is really lazy in terms of naming and from a usage perspective, you get really tired of typing that out in code. I think we can do better

Suffixing a name with -ex often results in unique names, which helps filtering search results. I see a slight problem with name ending on an s though. Also, aren't you the author of jqex? ;)

Touche, although that is a 5 line utility.

Filtering which search results? On hex.pm that’s irrelevant. On good “library name + elixir”

Re: Lua for Elixir

#80

Earlier quoted context omitted.

Typical no one writes a large web app in a single Go-file.

Well, that is unfair, because you added "large". If we compare large web apps between Elixir and Go, I am pretty sure Go would still have fewer files overall.

If you are just doing a script in Elixir it is just one file. You have no experience with Elixir so not sure why you keep arguing when people tell you that you are wrong.
Post reply on HN