Live data from Hacker News

Elixir v1.10

elixir-lang.org

71–80 of 141 posts

Re: Elixir v1.10

#71
post #6

Having 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?

The official Elixir guide runs you through the basics all the way to the more complicated concepts: https://elixir-lang.org/getting-started/introduction.html For a fun and complicated Elixir project, you could try building a process pipeline that uses all your CPU cores to crunch some data. Look into Elixir Flow [0], for example, which has a fun guide on counting words in a file. Elixir & Phoenix work well for web pr…

I'll second the Elixir guide and maybe go on to the Phoenix guide for web dev. I just read enough to get going and then start building, then go back, read more, fix what I built.

But people learn differently. I don't really get through books and I haven't needed courses aside from random examples of how to do some things.

Re: Elixir v1.10

#72

Earlier quoted context omitted.

I completely disagree. You don’t need to learn Erlang to learn elixir. Learn elixir use it, you can be very productive with it. If later for whatever reason you want to dive deeper into Erlang you can. I’ve used elixir for 5 years now. And I’ve never had to Erlang, the most I’ve done is use some Erlang libraries in elixir. Elixir can stand on its own

I guess is depends on what you're working on. There are a ton of things I've needed to understand about Erlang. gen_statem, gen_tcp, gen_udp, gen_event, crypto, ssl, etc.

I've happily dipped into Erlang libs when I need to. I'm also increasingly capable of reading Erlang code though I only write Elixir. I would not recommend starting with all of Erlang before doing Elixir but it may work better for some folks.

Re: Elixir v1.10

#73
anyone mind explaining the /# to me? like `Application.get_env/3`. been wanting to learn Elixir for awhile now, but didn't even know what do Google for that one.

Re: Elixir v1.10

#74

Earlier quoted context omitted.

If you really want to learn Elixir, you should learn enough Erlang prior, to get a better understanding of how Erlang/OTP all fits together. Thus, I would recommend the following structure: 1. Read Joe Armstrong's Book: Programming Erlang to learn the basics and the philosophy behind Erlang from one of its creators. [1] 2. Read Erlang and OTP in Action to learn more about the OTP (Open Telecom Platform), applications…

This makes me not want to learn elixir. Learning one language and becoming masterful at it is hard enough. There's too many "learn this language, but also this other language and platform"'s in my life (JVM-based work, and anything in the front-end JavaScript world it feels like these days). It just feels like you are telling people "Here, learn this language, but also learn the assembly instruction set for your arch…

You don't need to learn Erlang to learn Elixir. You can just use some what Erlang provides when you need it. Some people want to approach things very ground-up but I've taught people Elixir. It's fine to learn Elixir and you'll get to OTP and all the good stuff.

Re: Elixir v1.10

#75
post #73

anyone mind explaining the /# to me? like `Application.get_env/3`. been wanting to learn Elixir for awhile now, but didn't even know what do Google for that one.

This is Erlang function notation that Elixir inherited. The format is: `{ModuleName}.{function_name}/{arity}`

Re: Elixir v1.10

#77

Earlier quoted context omitted.

I completely disagree. You don’t need to learn Erlang to learn elixir. Learn elixir use it, you can be very productive with it. If later for whatever reason you want to dive deeper into Erlang you can. I’ve used elixir for 5 years now. And I’ve never had to Erlang, the most I’ve done is use some Erlang libraries in elixir. Elixir can stand on its own

I guess is depends on what you're working on. There are a ton of things I've needed to understand about Erlang. gen_statem, gen_tcp, gen_udp, gen_event, crypto, ssl, etc.

Yes I agree, depending on the project you might need to dip into some Erlang libraries. But that's a far cry from needing to learn Erlang first.

I remember reading things like "you should learn Erlang before learning Elixir to be really effective" scared me off learning Elixir for a little bit as well.

Also, I find the more familiar you get with Elixir, the easier it becomes to read Erlang code.

Re: Elixir v1.10

#78
post #63
post #38

What’s the advantage of using this language over Rust, Go, Java (or any other JVM language), or Python?

Rust: much lower-level systems language which will take quite a bit more development time. Go: Go's CMT implementation is fundamentally broken (you can't just use go channels without mutexes for complex work unless you want your application to have bugs). Elixir and Erlang Actors have much better guarantees. Java: BEAM is slower than the JVM, but much more stable. Native actors are a much better experience than Akka.…

Good comment covering the languages.

I came from Python. For me Elixir was much more approachable as a first step into a functional language. Syntax, documentation, getting started/onboarding. I believe there are efforts under way to make Erlang docs a bit easier to approach.

And then Phoenix with projects like Presence really built my excitement for the language. Had some colleague that was thrilled by Ecto changesets.

So a combination of ergonomics, easily accessible to new people and strong hype-marketing brought me in I guess. And I enjoyed it and am happy with the results it gives.

Re: Elixir v1.10

#79
post #76
post #73

anyone mind explaining the /# to me? like `Application.get_env/3`. been wanting to learn Elixir for awhile now, but didn't even know what do Google for that one.

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

#80

Earlier quoted context omitted.

Asking for "the advantage" is probably not quite the right question. Different toolbox, different tools, for different solutions to different jobs. Elixir runs on the Erlang VM, is functional, has a Ruby-like syntax.

How easy (or hard) is it to learn Elixir for someone with Python/PHP/JS background and zero knowledge of functional programming? Also, are there job opportunities for Elixir or is it a niche language?

Easy enough, for me. I have roughly the same history of languages. Functional programming as a paradigm was the biggest hurdle for me. But Elixir guide docs help yout quite a bit there.

Job opportunities are fine, not Python+ML or JS+React great but there is work out there.

Post reply on HN