What’s the advantage of using this language over Rust, Go, Java (or any other JVM language), or Python?
Elixir v1.10
131–140 of 141 posts
Re: Elixir v1.10
#132Earlier quoted context omitted.
Definitely agree, though I respect the effort/desire to learn Erlang first given the fact the first time I saw Erlang code I was so confused/put off by it, the syntax was so foreign (not c-like, not lispy), variable names up capitalized, atoms are bare words, source files are just tons of functions, the tooling isn’t anything like modern languages (though since Elixir and hex/mix, that situation has gotten way better…
You may like this: the very odd gen_statem callback pattern exists to group different callbacks by state (which you can't do because you need to group like headers together). But in Elixir, we use modules and macros to organize our code more sanely and less ad-hoc-ey: https://hexdocs.pm/state_server/StateServer.html
However, now my biggest complaint about Elixir is that gen_statem didn't get any official wrapper. StateServer looks like almost exactly what I would want out of an official Elixir wrapper. I also like to see the addition of `handle_continue` as well, because the first thing I did before migrating any of the gen_server's to gen_statem's was create a small wrapper module to a) make the handle_* return values more in like with GenServer's (basically just making it {:(no)reply, (transition|keep), data, [actions]}) and b) add a quick and dirty handle_continue callback because I use it all the time with GenServer. And this literally just looks like a more polished version of that, so thanks!
Re: Elixir v1.10
#133Re: Elixir v1.10
#134Earlier quoted context omitted.
I guess it depends on your needs and motivation... we recently completed the transition from Ecto2 to Ecto3, and while not totally trivial in our case, I think you could do in a way that wasn't hard if you maintained compatibility with both from the start, so that only config had to change. But also, what are your requirements for using SQLite and/or MSSQL? Are you looking at porting existing projects, or new service…
In my case, MSSQL hosts our main business databases which are directly tied to revenue.. If it were being built today, it would probably be on Postgres -- but migrating it any time soon would be prohibitive, and just not profitable.. MSSQL is expensive, but is a darned good database, so there isn't much push to move. As for SQLite, we use it internally a fair bit for ETL processes, and as a starting point for most of…
Also, as a note, my first production Elixir service didn't talk to a relational DB at all, and was basically a thin API wrapper around ElasticSearch... others I know have basically used it just for realtime features connecting to browsers with WebSockets for push via Phoenix Channels (or now LiveView)... so even without any of those database adapters you may well find a use case it's a perfect fit for, and where lack of those adapters is not an impediment! Either way, good luck!
Re: Elixir v1.10
#135Earlier quoted context omitted.
It's called "arity": https://elixir-lang.org/getting-started/basic-types.html#ide...
not sure how i made it through my entire CS degree without learning this term. either that or i just don't remember it. anyways, thank you! this is really useful even outside of Elixir.
Re: Elixir v1.10
#136Earlier quoted context omitted.
not sure how i made it through my entire CS degree without learning this term. either that or i just don't remember it. anyways, thank you! this is really useful even outside of Elixir.
I've honestly never heard anyone who isn't an Elixir programmer use it. I wouldn't worry about not having heard it before.
Also, interestingly, it was available from Javascript 1.2 to 1.4: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
I think it's a useful name for a useful concept, not sure why they'd take it out, "Function.prototype.length" is a much poorer replacement semantically (but hey, Javascript isn't known for its correctness or well-thought-out design...)
Re: Elixir v1.10
#137Earlier quoted context omitted.
It's much more common than just Elixir programmers. It's a common concept in computer science, particularly in functional programming or languages which permit function overloading on arguments. https://en.wikipedia.org/wiki/Arity Edit to add: I've heard and used arity for at least 10 years, in particular in the Clojure community. I've heard of Elixir and understand it shares some common ideas with Clojure and Ruby,…
In functional programming classes at the uni you probably wouldn't hear this because if they teach Haskell which I assume most do, every function always takes just one argument. That's because functions are curried by default. I personally haven't really heard this mentioned anywhere outside of the Erlang/Elixir sphere.
Re: Elixir v1.10
#138I’ve been using elixir for about a year now. It really makes writing API code joyful. The pattern matching concept works so well for handling the variation that happens in API request handling. I also love working with Plugs. The pipeline nature of elixir translates directly into how you manage a request/response, and the plug abstraction pattern allows you to be explicit about what should happen, and hide the detail…
It is useful for implementing anything where there is a calling interface/surface with a bunch of verbs that can take parameters.
Which is pretty much everything in programming.
Which is why it's (also) useful in API dev.
Re: Elixir v1.10
#139Highly doubt that would get me anywhere but. I'm searching for elixir/js apprenticeship. It could be non-paid and re-evaluated at later point. I have been tinkering with programming as a hobby for a while. Currently located at UTC+2.
Please add your email to your profile so I can reach out to you. I'd like to chat and see if you'd be a good fit.
Re: Elixir v1.10
#140Having learnt Ruby and a bit of Erlang, I'm interested in Elixir so I fire this tangential question: How would you recommend to learn Elixir? And a follow-up: some ideas for personal Elixir-based projects?
https://pragmaticstudio.com/courses/elixir
The Elixir course is $89.00, but you'll learn a ton about the language for that price. The course is worth every penny.
NOTE: I'm not affiliated in any way with Pragmatic Studio. They just make excellent courses.