Live data from Hacker News

10 years-ish of Elixir

dashbit.co

111–120 of 127 posts

Re: 10 years-ish of Elixir

#111
post #91

Earlier quoted context omitted.

Do you use it for server side game logic too? It's not as ambitious as an MMO, but I like to use MUDs to learn new languages. I've been (slowly) working on one to learn Elixir and I'm actually finding the concurrency model somewhat difficult to use for the MUD - especially the single world that every player connects to. I ended up writing my own kind of software transactional memory library to help me out: https://gi…

If concurrency doesn't help, you can always just not use it. You don't need to run logically separate modules in different processes. What if you put the entire state in a single GenServer? You can still delegate modifying different parts of the state to different modules, just call functions in those modules from a single server process.

[deleted]

Re: 10 years-ish of Elixir

#112
post #91

Earlier quoted context omitted.

Do you use it for server side game logic too? It's not as ambitious as an MMO, but I like to use MUDs to learn new languages. I've been (slowly) working on one to learn Elixir and I'm actually finding the concurrency model somewhat difficult to use for the MUD - especially the single world that every player connects to. I ended up writing my own kind of software transactional memory library to help me out: https://gi…

If concurrency doesn't help, you can always just not use it. You don't need to run logically separate modules in different processes. What if you put the entire state in a single GenServer? You can still delegate modifying different parts of the state to different modules, just call functions in those modules from a single server process.

It does help. Any given action will modify a fairly small part of the overall state (at most around .01% of it). But what part of the state it can modify is fairly arbitrary based upon the action. Your dependency could be dataA, dataB, then dataC. Or dataC, dataV, then dataA. Which, if you isolate into processes could create races and/or deadlocks. They would be very unlikely, but they could still happen.

This is why I went with software transactional memory. In the generally unlikely event that there's some overlap, the changes will just be rolled back and re-done.

Re: 10 years-ish of Elixir

#113

Last year, I deployed a system consisting of 4 Elixir applications, and recently added a new one built with LiveView, which took 2 days to write (1 of which was more of a learning day). I also built some helper services that are used in other projects. Phoenix nicely fits the microservice as well as the full-stack use-case. LiveView is a bit of a game-breaker for me. Most of my job is writing CRUD apps and you just c…

Wait I’m confused, it sounds like mean game ‘changer’ instead of ‘breaker’? :)

Re: 10 years-ish of Elixir

#114
post #91

Earlier quoted context omitted.

Do you use it for server side game logic too? It's not as ambitious as an MMO, but I like to use MUDs to learn new languages. I've been (slowly) working on one to learn Elixir and I'm actually finding the concurrency model somewhat difficult to use for the MUD - especially the single world that every player connects to. I ended up writing my own kind of software transactional memory library to help me out: https://gi…

You'd likely be interested in the work done by Eric Oestrich in building MUDs with Elixir. Kalevala: a world building toolkit for text based games, written in Elixir [0] ExVenture: a text based MMO server written in Elixir [1] Grapevine: a MUD chat network [2] [0] https://github.com/oestrich/kalevala [1] https://github.com/oestrich/ex_venture [2] https://github.com/oestrich/grapevine

I took a look at ExVenture when I first started working on this. A lot seems to have changed since then, but from what I could tell at the time there were some potential races. For example, movement processing seemed like it allowed for the possibility of players to seemingly move through doors that were closed (at least, from the players' point of view). I could easily have been wrong though since I'm new to Elixir.

That said, a requirement for scripting I have is the ability to chain together arbitrary actions in an atomic fashion without any races or deadlocks. Content creators can create really complex scripts that involve arbitrary locations and actions. I wasn't sure how I would achieve this goal with ExVenture.

Re: 10 years-ish of Elixir

#115

Earlier quoted context omitted.

Ruby really isn't becoming static though. Most code used by Rubyists (e.g Rails apps) is likely to remain dynamic.

Yeah, I can't really tell if the overall community will adopt it or not, but you may well be right. Last time I commented something about ruby not having static typing I got downvoted by people claiming Sorbet is already used heavily in production. But either way if I'm switching off of ruby, I don't really want to go to something else that doesn't have static typing.

A few huge companies like Stripe use Sorbet. Thats really not a good representation of Ruby users though. I guess youre right, for dynamicism Ruby is awesome but if you need types just switch to a true typed language.

Re: 10 years-ish of Elixir

#116
post #5

Earlier quoted context omitted.

I'm going to shamelessly take advantage of your being here with a question if that's ok. Do you have any recommendations for reading material that covers Phoenix as it's used today? Back in the early 0.x days I read the Phoenix book, which was a great introduction to building an application and using Ecto, but trying to pick it up again recently I found that nothing really seems to cover using Contexts in the real wo…

Have a look at this - https://pragmaticstudio.com They have courses on Elixir, Phoenix and today have just released a LiveView course.

[deleted]

Re: 10 years-ish of Elixir

#117

Earlier quoted context omitted.

It sounds like you're recruiting from a pool of junior developers and convincing them to use Elixir instead of attracting folks who are already interested in the language. Not only is that community sizable, but it's experienced- surveys of attendees at my conference ( https://empex.co ) consistently show that 50% have >5 years and 30% have >10 years in the industry. Elixirists really are senior developers and Elixir…

The folks you're talking about are a lot more expensive (in Europe at least) than the equivalent folks for more traditional platforms. Again, and without centering ourselves in pure technical and our own careers and CVs. How does that help the business?. Regarding to libraries, there's not much to discuss. Just look at the number of available packages as right now: rubygems: 164,235 (source: https://rubygems.org/stat…

I would consider NPM's "millions of packages" with a big lump of salt.

Re: 10 years-ish of Elixir

#118

it looks really awesome! Can someone point out the negative sides (or drawbacks of any kind) ? What about finding elixir experts/freelancers? What about integration with .Net and the xamarin forms ecosystem?

I've never seen anyone complain about this, so maybe I'm alone, but the runtime error messages are absolute garbage. Especially if you get an unexpected nil that bubbles up, you'll often see cryptic erlang messages that don't really identify what went wrong. (Think type errors that don't identify the expected type nor the type passed.)

And by that same line of thought, it's frustrating as a functional language given its almost complete absence of built-in monadic types and helpful sugar to use them. Instead of `Maybe`/`Option`, for example, you pass tuples around tagged with atoms. This wouldn't be the end of the world except that...

There's no static typing. Which means that `match` blocks can't enforce completeness. This isn't a huge deal, but for a dynamically typed language, it's surprisingly cumbersome to introspect at runtime. Languages like Ruby make such things first class, such brings me to...

Elixir is nothing like Ruby. With the exception of `def`, `unless`, and `do`, there are nary a few similarities. This isn't necessarily a negative, but the whole notion that Elixir and Ruby share syntax is only barely—and completely superficially—true. In large part, this is because...

There is no method-style syntax. That's not uncommon for a functional language, but it's problematic when the standard library is hugely inconsistent. Is the function you want in the `List` module? Or the `Enum` module? Or is it part of the `kernel`? Hunting around for the right module is a pain, but not as bad as...

Inconsistent naming of functions. Sometimes they're fully spelled out; other times they're abbreviated. And if you're really unlucky, if it's in the kernel, you can expect 1970's Unix-style abbreviations that are so short to be unreadable and have no consistency in how they're formed. US state abbreviations follow more strict rules than Elixir kernel function names. At least one thing Ruby got very right were easily-guessable method names.

There's a lot of good in Elixir; don't get me wrong. But I've spent over a year in it and keep stumbling on very un-aesthetic issues. For such an otherwise wonderful developer experience, these pain points ring loudly.

Frankly, unless you need a lot of parallel things to happen behind the scenes in real-time, I just don't see much use case for Elixir. Its ability to fail and keep going (a major selling point) is great, except that I find it too easy to write code that fails, which can bubble up and create inconsistency in its state. I much prefer something that will help me avoid failure in the first place (Rust us great for that), or something that lets me code fast and loose and makes that experience really enjoyable (like Ruby).

I think I'm alone in these criticisms, however, because I never really see anyone talk about them, so take this all with a grain of salt. I have used a ton of languages in my 25 year career, and I had a lot of hope for Elixir. But, frankly, I just don't get it.

For highly parallel networked applications, it makes sense. For very small things that would otherwise need external service dependencies (Redis, sqlite, etc), it makes sense.

But if your focus is any other use case, I really struggle to justify its adoption. It's not as fast as advertised for anything non-realtime parallel. (Go, Java, Rust, et al all provide much faster alternatives.) It's not as quick to whip up for medium sized projects. (Like Rails.) And it's not as fault tolerant as something like Rust, which can help you avoid the faults in the first place.

LiveView—the latest "must have" for web development—is likewise disappointing, in case that intrigues you. Single-language back- and front-end development sounds great. But it's just back-end streamed to the front end, which is problematic for any significant latency. None of the benefits of front-end except not refreshing the page. It's a fun (and very impressive) toy, but you get almost none of the benefits of a real front-end app. (Such as UI changes while the data is loading.)

While I only have a little experience with LiveView, I have plenty experience with latency-laden server-side echoing to know that when it breaks down without the client doing its own best-guess updates, nobody will have a good time.

Maybe I'm just salty because I expected the Elixir experience to be more than it turned out to be. And I do enjoy some of the things it forces you to do, by virtue of its being a functional language. But at the end of the day, I personally find its warts to be significant and not worth dealing with outside of very specific use cases that it uniquely handles very well.

Your mileage may vary, but I would ask yourself: does my application need lots of real-time, parallel functionality? If the answer is anything short of "hell freaking yes!", then I would look elsewhere for serious development.

I appreciate all the hard work Jose and Chris (and of course all others) have put into their respective portions of the Elixir experience. But I think it was oversold. And I think the number of packages that haven't been touched (or issues responded to) in over 3 years may indicate that others struggle to find its value in many areas in which it was advertised to be a game changer.

I want to like it.

I really don't like it.

Re: 10 years-ish of Elixir

#119
Elixir is a fantastic language. I wrote an app several years ago and haven't had to update or do any maintenance on it since and it has happily served several million requests a month without errors. Actually the only reason I've touched it is to upgrade the Heroku stack it is on. The best part is I actually had a lot of fun writing the app and even writing the docs. So much of my preference for Elixir is in the developer experience and how quickly I can ship changes with high confidence; all of the amazing performance and distributed aspects I may never need for my projects.

Re: 10 years-ish of Elixir

#120
post #113

Last year, I deployed a system consisting of 4 Elixir applications, and recently added a new one built with LiveView, which took 2 days to write (1 of which was more of a learning day). I also built some helper services that are used in other projects. Phoenix nicely fits the microservice as well as the full-stack use-case. LiveView is a bit of a game-breaker for me. Most of my job is writing CRUD apps and you just c…

Wait I’m confused, it sounds like mean game ‘changer’ instead of ‘breaker’? :)

Yes, sorry for the confusion :).
Post reply on HN