Live data from Hacker News

Ask HN: Is Erlang an albatross to Elixir adoption?

news.ycombinator.com

71–80 of 109 posts

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#71
I've used Erlang and have been interested in Elixir but haven't used it. After a little getting used to, I've generally liked the Erlang docs. I have the impression that Elixir is just Erlang with different surface syntax so the main real differences are in the library culture (Elixir's are more Ruby-inspired, with Rails's inanities mostly cleaned up). From a Lisp background, all these languages are pretty much the same. Erlang/Elixir's concurrency story is far better than say Python's, but that's not really about the language per se.

I'd actually like a statically typed BEAM language. A few of these have been attempted, but I don't think any have gotten traction.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#74

As the creator of Phoenix, I've never written an Erlang program fwiw. That said, I frequent the Erlang docs and most seasoned Elixir developers will do the same because the standard library is a wealth of features, and the documentation while not 2022 polished, remains a remarkable resource. > I don't know what a solution is, but perhaps a concerted effort to create a documentation and library ecosystem that never li…

Phoenix seems quite bloated. Is there any way to make it work without JavaScript, or do I have to rely on it? I really wanted a web framework where I can have routers, templates, sessions, and the usual stuff and no JavaScript, only if I write it myself into the template. :(

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#75
Tackling a new language over BEAM and integrating with Erlang is as big as Clojure with JVM - The thing is that Elixir used to be more erlang-y than it is now and does a decent job hiding the hardcore functional/process comm/OTP plumbing. I don't see our team writing too much Erlang but we know that a full distributed Elixir production setup will incur the same operational load as in Erlang. W.r.t documentation, I found Francesco Cesare book (and the original Erlang programming book by Joe Armstrong) pretty good to help where the doc was too terse. Maybe you are looking for documentation on frameworks ? My main block was to be used to read http or database framework docs and jump straight into functional programming and pure language documentation... just an idea.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#76
My N00b take on Elixir in general (were N00B = Have my first app, an MQTT/API bridge written and deployed running on Ubuntu employing Bandit, Finch, Tortoise, OpenAPISpex, and Jason).

The immediate answer would be no. I would say 5%-15% of my questions asked on the Slack channel have ended up in Erlang land. The first time someone answered with "you want :binary.bin_to_list()", I was completely confused. "What is :binary?" It took me a minute for the lightbulbs to say "remember, you read Erlang syntax is upside down from Elixir and maybe that'a an Erlang thing?" The erlang docs are not bad, but they are structured and navigated very differently than the Elixir ones. And the notation differs. It can look almost like BNF some times.

I find it inconvenient and annoying that this is so, but never felt like it was an albatross. It's a weird split, because many common things ARE in both systems. But then, some things don't make the cut. And experienced people just "know". Hopefully, you're around one of those people either directly or virtually. I've asked why not just transcode the entire erlang library over. If the languages are nearly associative, just make a process that (mostly) automates a conversion. I asked about this in the Slack channel, but the sentiment seemed to be "decent idea, but not worth the work."

I wish I had opportunity to do more Elixir/Erlang. I have a goal to see if I can't learn some LiveView stuff. In my short journey I've worked up my list of "love this/wish this were better." This issue would be a cool thing to improve, but it wouldn't make my top 10.

My loves?

* I love the straightforward simplicity of the language, it reminds me of Smalltalk that way

* I really like pattern matching, and recursion. I realized how much time I spend in other languages writing code that describes where the code goes next. Pattern matching and recursion I really like

* The Slack community is great. Better than just about any other "open source" community I've gotten help from in the past few years.

* The key players (José, Chris, etc) are accessible and really nice guys. Submitting a documentation clarification PR was super nice because of José.

* I love piping. I'm told newbies overdo this. I'm still loving overdoing it. I wish the syntax were a little less difficult to type; I should figure out how to do some hotkey thing I guess.

* Binary. Wow. Parsing binary data streams in Elixir just rocks.

* I like OTP more and more; often the community seems at odds with it. It's not "purely functional". This may be the area the author was originally barking at.

Things that disappoint me (so far, but I am open/hopeful to coming round in some cases):

* VSCode is OK. But a language like this really wants a decent IDE. I want to work on functions, not files.

* I love/hate the formatter. I love that there is one and I get consistency. But it's not associative. A formatter should format my code, not just kind of format it. If it made a 3 lines out of one of my long lines, but then I shorten the code, so that it can now fit on one line, it should do that. It can't because it doesn't know the difference between extra new lines I put in and one's it added. The reality is, I want it to format the whole file, not just the horizontal space. The fact that newlines are part of the syntax in some cases makes this even more of a problem. IMO syntax either own newlines completely (python) or leave it as a presentation character and design the syntax so the whole program could go on one line if it needed to.

* To date, I have found the defstruct story unfulfilling. The syntax is a bit weighty to type %SomeStruct{foo: 1, bar: 13} requires me to do a lot of slow reaching shifts and it always feels like it slows me down. One defstruct per module hasn't scaled well for me. When I switch back to Python/Kotlin/Swift, the struct/dataclass just works better for "modelling" up data.

* "Namespaces are a honking good idea - we should do more of them!" Elixir looks like it has namespaces with Dotted.Module.Names. But only barely. In fact, since there are edge cases where nesting modules creates issues, I took to never nesting them, even when using Similiar.Dotted.Prefixes to "group" them. Eventually, you realize you could just use _ or pretty much any separator. The dot's have very little value. I wish the namespace story was more like Python's (but not the shadow binding nonsense).

* Macros are awesome. BUT, sometimes it can get really confusing what's going on. I don't love the quote/unquote thing. What I have sorely missed with some macro heavy libraries is the ability in the IDE to see what the code turns into. Kind of like running just the C Preprocessor on macro heavy C code to see what's really going on.

* I do not love do/end. We have punctuating characters in romanized languages for a reason. They structure and organize the words and phrases we use inside of them. When we use alphabetic words to do this, the brain has to parse more to separate the structuring elements from the content.

* I think I've come to appreciate the "batteries included" language approach more. There's a balance of course. Python has some stuff in it that just seems silly to be in the base library. But a lot of things is just there ready to be used. In Elixir, I'm left guessing what extra modules to use. It's hard to know what's being actively supported. And discovery is yuck. I wish for more ItDoesThis boring names rather than cute/clever plays on words for package names. For example, would the lay reader be able to guess what my Bandit, Tortoise, and Finch modules actually do?

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#77
post #22

Raw performance is the actual albatross. IMHO, the low raw performance of Erlang is what's holding it back from mass adoption. (Even marquee Erlang/Elixir users like Discord, still have to use Rust NIFs to overcome the slow Erlang runtime) People have a hard time understanding how Erlang can have such: high concurrency, low latency & tight standard deviations ... when people are just accustom to looking at raw perfor…

FWIW I have ported Json APIs from JS & PHP to Elixir and the Elixir ones were the fastest (on the same server). And it was before even leveraging ETS to cache DB data (which is faster than Redis by design).

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#78

As the creator of Phoenix, I've never written an Erlang program fwiw. That said, I frequent the Erlang docs and most seasoned Elixir developers will do the same because the standard library is a wealth of features, and the documentation while not 2022 polished, remains a remarkable resource. > I don't know what a solution is, but perhaps a concerted effort to create a documentation and library ecosystem that never li…

Phoenix seems quite bloated. Is there any way to make it work without JavaScript, or do I have to rely on it? I really wanted a web framework where I can have routers, templates, sessions, and the usual stuff and no JavaScript, only if I write it myself into the template. :(

There’s no JavaScript unless you write it into the template. If you want to use LiveView that needs JavaScript but plain old templates do not.

As for bloat I don’t really agree but I can see how it might appear that way. Phoenix is actually not monolithic, it is sort of just a set of conventions and macros (batteries) that make using Plug and Ecto and some other libraries together more cohesive and more like programming in Rails. If you don’t like that approach you can also just use Plug and Plug.Router directly, which is more of a microframework feel like Flask or Sinatra.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#79
post #41

As the creator of Phoenix, I've never written an Erlang program fwiw. That said, I frequent the Erlang docs and most seasoned Elixir developers will do the same because the standard library is a wealth of features, and the documentation while not 2022 polished, remains a remarkable resource. > I don't know what a solution is, but perhaps a concerted effort to create a documentation and library ecosystem that never li…

Devil's advocate: What would it take to programmatically port/transpile the core of Erlang's ecosystem to Elixir? Pick the killer app to serve as the root node (Phoenix?) and walk back to the leaves (OTP, popular libraries, etc). Do a 1-time cutover of literally everything. Fork/port ERTS (incl BEAM) to make Elixir-native and rebrand it. Etc. While I generally agree that "rewriting as bad" there is something to be sa…

I had this same thought because I think Elixir and Erlang are actually similar enough that translating between them directly may be feasible and have decent results. I don’t really think forking is a good idea though. As I understand it most BEAM maintenance is actually done by Ericsson, and I’m not sure the Elixir community has the resources to sustain a project like that. It seems like it would also create bad blood with the Erlang community and risk breaking compatibility eventually, which would be a huge loss for users of libraries like Ranch and Hackney.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#80

As the creator of Phoenix, I've never written an Erlang program fwiw. That said, I frequent the Erlang docs and most seasoned Elixir developers will do the same because the standard library is a wealth of features, and the documentation while not 2022 polished, remains a remarkable resource. > I don't know what a solution is, but perhaps a concerted effort to create a documentation and library ecosystem that never li…

Phoenix seems quite bloated. Is there any way to make it work without JavaScript, or do I have to rely on it? I really wanted a web framework where I can have routers, templates, sessions, and the usual stuff and no JavaScript, only if I write it myself into the template. :(

`mix phx.new foo --no-live` does that. LiveView is completely optional. Node/npm has been completely replaced by esbuild and even that is optional if you want to rip it out and handle assets another way.
Post reply on HN