Live data from Hacker News

Bakeware: Compile any Elixir application into a single binary

github.com

11–20 of 32 posts

Re: Bakeware: Compile any Elixir application into a single binary

#11
post #3

My holy grail would be to (somehow) create a release on Windows (my dev system) and deploy on Linux (our prod servers). However, I have little hope because of the Erlang binaries requirement. Still, you can always hope :)

CI/CD tools can do that for ya

Re: Bakeware: Compile any Elixir application into a single binary

#12
post #2

I don't know much about elixir but I'm interested. Are there disadvantages to this process?

I'd assume it's incompatible with LGPL code/libraries (unless it's open source), then again I have no idea how widespread said license is in the Elixir world.

IIRC LGPL says you have to "convey" the code, not "you must bundle the code with your binary", it could be anything from "email this address to request the code" or "send a SASE to this address and I'll send you a CD-ROM". I believe GPL even lets you charge for the code, I could be wrong about that.

Re: Bakeware: Compile any Elixir application into a single binary

#13

I'm glad Bakeware is applying brainpower to the entry point problem for simple scripts. I'm currently learning Elixir and the biggest initial hurdle was how to actually create an application. Most tutorials teach you through iex but rarely how to actually write a running program or library. Things like "mix run" wouldn't work until I created an app with mix new, then I had to visit the rabbit hole of genservers and s…

I remember being a reviewer for an Elixir book where the first chapter was listing the pros and cons of Elixir, and one of the cons was: it's kind of hard to manage deployment of Elixir applications.

My feedback was "hum, that's kind of a turn off for someone trying to learn the language/tech no?"

I think the community has been looking for something for a while now and is iterating (too?) quickly. There was erlang releases, there was distillery, now it's elixir releases. There are different ways of configuring in production. It goes a little too fast to keep up with to be honest.

Re: Bakeware: Compile any Elixir application into a single binary

#14
post #13

I'm glad Bakeware is applying brainpower to the entry point problem for simple scripts. I'm currently learning Elixir and the biggest initial hurdle was how to actually create an application. Most tutorials teach you through iex but rarely how to actually write a running program or library. Things like "mix run" wouldn't work until I created an app with mix new, then I had to visit the rabbit hole of genservers and s…

I remember being a reviewer for an Elixir book where the first chapter was listing the pros and cons of Elixir, and one of the cons was: it's kind of hard to manage deployment of Elixir applications. My feedback was "hum, that's kind of a turn off for someone trying to learn the language/tech no?" I think the community has been looking for something for a while now and is iterating (too?) quickly. There was erlang re…

too fast? I was using Elixir releases two jobs ago.

Re: Bakeware: Compile any Elixir application into a single binary

#15

Earlier quoted context omitted.

I'd assume it's incompatible with LGPL code/libraries (unless it's open source), then again I have no idea how widespread said license is in the Elixir world.

IIRC LGPL says you have to "convey" the code, not "you must bundle the code with your binary", it could be anything from "email this address to request the code" or "send a SASE to this address and I'll send you a CD-ROM". I believe GPL even lets you charge for the code, I could be wrong about that.

You can charge someone for gpl code but you can't expect to get paided if others give away that code.

Re: Bakeware: Compile any Elixir application into a single binary

#16
post #2

I don't know much about elixir but I'm interested. Are there disadvantages to this process?

Yes: dynamic linking allow receiving OS security updates for any library.

With static linking you become responsible for:

- tracking down the dependencies used during a build

- track where the binary is deployed

- follow publishing of vulnerabilities affecting the libraries you used

- either backport security fixes, rebuild and deploy the binary or deploy a newer version hoping it does not break anything

Re: Bakeware: Compile any Elixir application into a single binary

#17
post #2

I don't know much about elixir but I'm interested. Are there disadvantages to this process?

I'd assume it's incompatible with LGPL code/libraries (unless it's open source), then again I have no idea how widespread said license is in the Elixir world.

Static linking with LGPL is OK as long as you allow users to relink to other libraries.

You can do that by shipping the object files with the binary, or on request, or providing the sources of your application under a closed license, or under any FOSS license.

Re: Bakeware: Compile any Elixir application into a single binary

#18
post #13

I'm glad Bakeware is applying brainpower to the entry point problem for simple scripts. I'm currently learning Elixir and the biggest initial hurdle was how to actually create an application. Most tutorials teach you through iex but rarely how to actually write a running program or library. Things like "mix run" wouldn't work until I created an app with mix new, then I had to visit the rabbit hole of genservers and s…

I remember being a reviewer for an Elixir book where the first chapter was listing the pros and cons of Elixir, and one of the cons was: it's kind of hard to manage deployment of Elixir applications. My feedback was "hum, that's kind of a turn off for someone trying to learn the language/tech no?" I think the community has been looking for something for a while now and is iterating (too?) quickly. There was erlang re…

It took me 1 hour to convert a production app from Distillery to native releases when Elixir 1.9 released 2 years ago. And deployment in 2021, whatever the language, is best served with containers. Elixir is not harder to deploy than a Django or Node app.

In fact, releases and post-deploy ops are pretty well documented: https://hexdocs.pm/mix/Mix.Tasks.Release.html

Phoenix also has an example multi-stage Dockerfile which is fine for 99% use cases: https://hexdocs.pm/phoenix/releases.html

Re: Bakeware: Compile any Elixir application into a single binary

#19
post #13

I'm glad Bakeware is applying brainpower to the entry point problem for simple scripts. I'm currently learning Elixir and the biggest initial hurdle was how to actually create an application. Most tutorials teach you through iex but rarely how to actually write a running program or library. Things like "mix run" wouldn't work until I created an app with mix new, then I had to visit the rabbit hole of genservers and s…

I remember being a reviewer for an Elixir book where the first chapter was listing the pros and cons of Elixir, and one of the cons was: it's kind of hard to manage deployment of Elixir applications. My feedback was "hum, that's kind of a turn off for someone trying to learn the language/tech no?" I think the community has been looking for something for a while now and is iterating (too?) quickly. There was erlang re…

It's going fast because the original ways were (euphemism) sub optimal. Example: compiling configuration into a release was clearly wrong based on my experience with other languages. A small mistake and another run through CI/CD with production down vs edit a configuration file and restart? Ouch. Maybe inevitable with a lot of servers but very wrong for a single server application.
Post reply on HN