Live data from Hacker News

What I mean when I say that machine learning in Elixir is production-ready

cigrainger.com

71–80 of 108 posts

Re: What I mean when I say that machine learning in Elixir is production-ready

#71
post #2

I'm a big fan of Erlang, Elixir, OTP and the BEAM vm. However, I only have very lightweight server needs for my SaaS, so it just doesn't make sense to switch to it, especially as my code is mostly client-based/typescript. If my core value prop would be around real-time messaging or streaming data, BEAM/OTP would be my first choice. Slightly OT: I'm still in dubio about Cloudflare pages, but I'm sure that the platform…

I am really intrigued by the distributed systems capabilities that BEAM brings. I built a chat app using it and am also using Mnesia DB to store recent messages. However, my experience coding it has been terrible. I am using IntelliJ with an Elixir plugin and there is essence is no auto-complete. I used to write a ton of Ruby, but there RubyMine was really good at guessing what's available. Not so much here. On top o…

I'm glad I'm not the only one who has had awful luck with that IntelliJ Elixir plug-in. Maybe I'm doing something wrong, but it just doesn't work for me.

I've been using emacs + elixir-mode + alchemist since Elixir came out and I have zero complaints, it all works beautifully complete with autocomplete, jump to definition and documentation popups. But obviously emacs isn't for everyone.

Re: What I mean when I say that machine learning in Elixir is production-ready

#72

I see so much breathless adoration for Erlang and Elixir, how come it hasn't taken over the world in all this time?

Elixir is a combinatorics mess (circa 2020: two different string types, three different types of exception, return AND throw versions for almost every func, slow compiler without much in the way of compile-time checking, constant breakages over trivial renamings "just because", having to burrow into erlang errs half the time since many elixir funcs are just wrappers). Half the libraries we used were abandoned. I take…

We’ve had Elixir in production since 2017 and have not found any of the items you have mentioned to be issues.

- two different string types: You have undercounted (three types in Erlang, and Elixir adds a fourth), and suggested that something which is a non-issue for the vast majority of Elixir code. Most Elixir code deals with `String.t()` (`"string"`), which is an Erlang `binary()` type (`"string"` in Elixir, `>` in Erlang) with a UTF-8 guarantee on top. A variant of the Erlang `binary()` type is `bitstring()` which uses `binary()` to efficiently store bits in interoperable ways. Code interacting directly with Erlang often needs to use `charlist()`, which is literally a list of integer values mapping to byte values (specified as `'charlist'` in Elixir and `"charlist"` in Erlang; most Elixir code would use `String.to_charlist(stringvar)` in the cases where required.

Compare and contrast this with the py2 to py3 string changes and the proliferation of string prefix types in py3 (https://docs.python.org/3/reference/lexical_analysis.html#li...).

- three different types of exception: true, but inherited from Erlang and the difference is mostly irrelevant. The three types are exceptions (these work pretty much as people expect), throws (non-local returns, see throw/catch in Ruby; these are more structured than `goto LABEL` or `break LABEL` for the most part), and process exits. In general, you only need to worry about exceptions in most code, and process exits only if you are writing something outside of your typical genserver.

- return AND throw versions for almost every func: trivially untrue, but also irrelevant. Elixir is more sparse than Ruby, but still comes more from the TIMTOWTDI approach so most libraries that offer bang versions usually do so in terms of one as the default version. That is, `Keyword.fetch!` effectively calls `Keyword.fetch` and throws an exception if the result is `:error`. It also doesn't affect you if you don’t use it. (Compare the fact that anyone who programs C++ is choosing a 30–40% subset of C++ because the language is too big and strange.)

- slow compiler without much in the way of compile-time checking: I disagree with "slow", even from a 2020 perspective, and "compile-time checking" is something that has only improved since you decided that Elixir wasn't for you. Even there, though, different people expect different things from compilers, and not every compiler is going to be the Elm compiler where you can more or less say that if it compiles it will run as intended. (I mean, the C++ compiler is both slow and provides compile time checks that don't improve the safety of your code.)

- constant breakages over trivial renamings "just because": false‡. Elixir 1.0 code will still compile (it may have deprecation warnings). To the best of my knowledge, nothing from 1.0 has been hard deprecated. ‡If you always compile `--warnings-as-errors`, then yes you will have to deal with the renaming. But that is a choice to turn that on, even though it is good practice.

- having to burrow into erlang errs half the time since many elixir funcs are just wrappers: not an issue in my experience, and I can only think of a handful of times where I have had the Erlang functions leak out in a way where I needed to look at Erlang error messages.

Elixir isn't suitable for everything, but frankly your list of so-called shortcomings is pure sour grapes.

Re: What I mean when I say that machine learning in Elixir is production-ready

#73

Earlier quoted context omitted.

> Half the libraries we used were abandoned People really need to unwarp their brains from how they judge libraries in Elixir compared to other ecosystems. Erlang is 30 years old. Elixir sits on top of that stability. Elixir will very likely never reach 2.0 because it doesn't need to. And if a 2.0 does come it will be simply to remove deprecated functionality. Not having 12 major version releases per year means what…

If the libraries worked, we wouldn't have had to play code archaeologist and find out that half our dependencies had been abandoned since 2017. Even something as simple as a JSON encoder--which is rock-solid in every other language I've used--had a number of bugs (this was four years ago, so memory is hazy, but it had something to do with ambiguity between arrays, lists, or tuples) Erlang is stable, but Elixir sure a…

> Even something as simple as a JSON encoder--which is rock-solid in every other language I've used

JSON will be built into the next release of the BEAM: https://erlangforums.com/t/erlang-otp-27-0-rc3-released/3506...

Re: What I mean when I say that machine learning in Elixir is production-ready

#74

Earlier quoted context omitted.

TBH part of the BEAM runtime is actually pretty slow. is the problem. * Want something flexible and easy and don't care about performance? Use Python * Care about performance? Use Rust, etc. Just because it is distributed cloud native doesn't mean for single requests or functions it is fast. Almost all SaaS applications are request based and do not need P2P or real time communication. BEAM is worse here. If a company…

Out of the box, Phoenix applications respond to simple http requests in times measured in microseconds. What appreciable improvements from that do you get with Python? And considering how much of your total request time is not processing by the language (db calls, network latency, etc.), why would you decide on a language purely on the minor speed improvement of a small part of the overall picture? I’ll gladly trade…

Yeah I don't get this argument either. It's like people are still stuck in micro-benchmark-land. Sub-1ms responses are the norm in Phoenix and I tend to never get anything above 100µs for LiveView messages, sure, they're noops, but calling it slow is .. well, strange.

Sure, you don't want to do number crunching in pure Elixir, but I'm always curious as to the actual needs people have, once being one of the "performance is everything" kind of developers myself.

Re: What I mean when I say that machine learning in Elixir is production-ready

#75
post #30

I see so much breathless adoration for Erlang and Elixir, how come it hasn't taken over the world in all this time?

> how come it hasn’t taken over the world all this time? I don’t know why it has not. However, it has such a strong set of advantages that people who know what it can do for them keep describing it as a “secret weapon”. As others have mentioned, it will scale up on a single machine to make use of all the cores (unlike Nodejs, Python, or Ruby). It can already scale horizontally by clustering. Because of the way it is…

I take runtime pattern matching over TypeScript any day of the week, I work with data across boundaries, compile time checking means very little to me (and I'm sick and tired of the "await request.json() as SomeTypeThatMostDefinitelyIsNotTheRightOneButMakesForFancyAutoComplete;" that seems to riddle every TS code base). Sure, you can add runtime dependencies with the additional code bloat to have it runtime check types with TypeScript too, but you still don't get any fault tolerance, and you have to write explicit code to handle errors that according to the type shouldn't exist.

Re: What I mean when I say that machine learning in Elixir is production-ready

#76

Earlier quoted context omitted.

Elixir is a combinatorics mess (circa 2020: two different string types, three different types of exception, return AND throw versions for almost every func, slow compiler without much in the way of compile-time checking, constant breakages over trivial renamings "just because", having to burrow into erlang errs half the time since many elixir funcs are just wrappers). Half the libraries we used were abandoned. I take…

We’ve had Elixir in production since 2017 and have not found any of the items you have mentioned to be issues. - two different string types: You have undercounted (three types in Erlang, and Elixir adds a fourth), and suggested that something which is a non-issue for the vast majority of Elixir code. Most Elixir code deals with `String.t()` (`"string"`), which is an Erlang `binary()` type (`"string"` in Elixir, ` >`…

I guess I will just have to stay sour with my sub-second compile times, actual compile-time type checks, stable naming of built-ins, single-binary deployments, and uniform error handling.

Re: What I mean when I say that machine learning in Elixir is production-ready

#77
post #42

I see so much breathless adoration for Erlang and Elixir, how come it hasn't taken over the world in all this time?

As someone who was Elixir hire #1 at a company that eventually ended up with ~25 Elixir developers with a novel product that people actually used, I see people in this thread and elsewhere mentioning the unorthodox nature of the language or the supposedly poor performance, and I can tell you that none of that actually matters one way or another. The stuff that really hampers Elixir/Erlang adoption, in my own personal…

That was a super interesting write-up for someone who has a passing interest in Elixir but was curious about some of the issues you mentioned, thanks!

Re: What I mean when I say that machine learning in Elixir is production-ready

#78

Earlier quoted context omitted.

We’ve had Elixir in production since 2017 and have not found any of the items you have mentioned to be issues. - two different string types: You have undercounted (three types in Erlang, and Elixir adds a fourth), and suggested that something which is a non-issue for the vast majority of Elixir code. Most Elixir code deals with `String.t()` (`"string"`), which is an Erlang `binary()` type (`"string"` in Elixir, ` >`…

I guess I will just have to stay sour with my sub-second compile times, actual compile-time type checks, stable naming of built-ins, single-binary deployments, and uniform error handling.

[deleted]

Re: What I mean when I say that machine learning in Elixir is production-ready

#79

I see so much breathless adoration for Erlang and Elixir, how come it hasn't taken over the world in all this time?

"Best language wins" is not how programming language popularity at the top works. Java, C/C++, JavaScript all have/had various other reasons for their wide use. And of course there's huge inertia, even if a language has the requisite of other forces behind it for "taking over the world" it still takes decades.

But no need to put too much weight on this, lots of languages have more than enough users to be viable for a long time. The top stack overflow languages tend to have poor S/N in the user communities.

Re: What I mean when I say that machine learning in Elixir is production-ready

#80

Earlier quoted context omitted.

How is this different to typespecs and Dialyzer?

See the first reply to the question linked below. I have nothing more to add. https://elixirforum.com/t/how-to-make-dialyzer-more-strict/1...

OK, great, then I'll add that pattern matching on struct types is built-in and good enough for my purposes.

Haven't used the LSP-server in a while, but I think it runs the Dialyzer-checking by default too, so that layer of checking will likely be there without adding project dependencies.

Post reply on HN