Live data from Hacker News

Why am I interested in Elixir?

underjord.io

101–110 of 183 posts

Re: Why am I interested in Elixir?

#101
post #73

Earlier quoted context omitted.

Are there no bad parts?

- deployment is terrible like really bad - average performance ( like 10x slower than Java even worse for CPU intensive tasks ) - dynamic language ( this is the worst part ), working on large code base means problems ahead - lot of features from BEAM / OTP that are not that useful and done better on modern cloud platforms ( Kubernetes for instance does a lot of similar things but better and more flexible, apply to an…

Regarding Elixir being a dynamic language, I've programmed in Java, C#, and other strongly typed languages as well as Ruby, Python, Elixir, and other dynamic languages since the mid 90s. Throughout my entire career, I cannot think of a single time when I've thought, "It would be so much nicer if this language was statically typed." It just hasn't ever been an issue for me.

If typing is something you really want to catch at compile time, and pattern-matching and guards aren't enough for you, you can always define Dialyzer specs and run Dialyzer during your build process. I'm currently working on an Elixir codebase that does this, but I've worked on others that don't, and I haven't seen much of a difference either way. Personally, I think strong typing is overrated.

Re: Why am I interested in Elixir?

#102

Is it possible for someone to create a statically typed language that works on OTP/BEAM, or for an existing language to interface with them somehow? I tried learning Elixir a while back and just couldn't get myself to like the syntax/ergonomics. It seems like most of the benefits people list for Elixir are actually attributed to BEAM, not the language itself.

Something like https://gleam.run/?

Re: Why am I interested in Elixir?

#103

Is it possible for someone to create a statically typed language that works on OTP/BEAM, or for an existing language to interface with them somehow? I tried learning Elixir a while back and just couldn't get myself to like the syntax/ergonomics. It seems like most of the benefits people list for Elixir are actually attributed to BEAM, not the language itself.

You could look into Gleam [1] and Alpaca [2].

[1] https://gleam.run

[2] https://github.com/alpaca-lang/alpaca

Re: Why am I interested in Elixir?

#104
post #81

Earlier quoted context omitted.

Not sure about the BEAM, but Java isn't considered an interpreted language at all. First, discerning the compilation step to IR is relevant, which is why for example, Python can be compiled or interpreted. That distinction matters. Even though it is compiled to intermediate representation, it is still compiled. Now, with regards to the intermediate representation, Java Byte Code is also not interpreted. Java Byte Cod…

Java is an interpreted language because you always need a JVM to run it. I even if you distribute the runtime with your code as one package, that’s just an artificial distinction. Regardless, interpreted does not mean bad, or poor performance for your task. It’s a technical notion. Most people would say Python is interpreted, even if you are only running compile python bytecode on a JIT like PyPy. That’s exactly the…

There is nothing about Java that requires a VM. That is just how Sun decided to implement it.

GCJ, for instance, allows AOT compilation of a Java program that requires no JVM.

Re: Why am I interested in Elixir?

#105

Earlier quoted context omitted.

Came from Java. Was an adherent to static typing everything. Dialyzer via Dialyxir is imperfect but helps you bridge the gap, especially with the error message improvements available via my Erlex library. You can turn on an optional Credo rule to require @specs for every public function, and adapt the rule trivially to require on private functions. Dialyxir is notably imperfect, but it catches a surprising amount of…

> Dialyzer via Dialyxir is imperfect Imperfect is putting it lightly. I loathe it. Aside from useless errors ("here's what the success typing looks like! Ignore the any()s, and fix it! But I won't tell you what's _wrong_!"), it doesn't run against tests (which bit my ass in production last month due to some return values being ignored, and only actually matched in tests.) > especially with the error message improveme…

There is a `mix dialyzer.explain no_return` and such, which gives you at least an intuition about what the errors are looking for. Re: my library, the Erlang error messages are just wholly inappropriate so it lexes, parses and pretty prints them to give a much better user experience, due to an upstream decision to not offer the errors in AST form.

Re: Why am I interested in Elixir?

#106
post #12

I'm currently building a video course hosting platform with Elixir / Phoenix and all I can really say is this has been the nicest tech stack I've ever used in 20 years of web development. IMO it really does feel like you get the best of everything (developer productivity, developer happiness, great language for creating maintainable code, OTP and the BEAM bring a lot to the table, it's memory efficient, tracing code…

It's a great stack. I've been primarily using it for the last 5 years although for a largish .5 million unit IOT backend not web development.

Re: Why am I interested in Elixir?

#107

Is it possible for someone to create a statically typed language that works on OTP/BEAM, or for an existing language to interface with them somehow? I tried learning Elixir a while back and just couldn't get myself to like the syntax/ergonomics. It seems like most of the benefits people list for Elixir are actually attributed to BEAM, not the language itself.

Erlang is strongly typed.

In my opinion OTP/BEAM is the killer feature of Elixir; however, there are a lot of other niceties as well. Macros, pattern-matching, tooling, readability, similarity with Ruby (a plus for Ruby developers) all spring to mind.

Re: Why am I interested in Elixir?

#108
post #61

My experience with Elixir has been great but one area of improvement is debugging. Maybe it's because I'm so used to using something like Chrome's developer tools, but I wish there was something as easy to use for setting breakpoints and inspecting the environment. Would love to know how others are debugging currently!

Try IEx.pry. It's everything breakpoints and watches are and more, in my opinion.

Re: Why am I interested in Elixir?

#109

Earlier quoted context omitted.

Are there no bad parts?

Of course they are, but thé article seems to be from someone interested by elixir, rather than someone who used it long enough to discover them (although I might have misunderstood the article.) From own experience, the problematic parts are : - deployment being a bit messy if you try to follow 12 factors (might be improving in 1.9) - absence of a decent debugger - younth of the ecosystem and size of the community (a…

BEAM based languages lack "good" debuggers, because they historically depend on tracing instead of debuggers. I recently wrote a blogpost about the tracing landscape in Elixir. https://www.erlang-solutions.com/blog/a-guide-to-tracing-in-... But the main reason is that BEAM languages are mainly used for concurrent computing which is a very difficult problem to debug with classical debuggers. I know it is not a mainstream way to "debug" but a very useful one once one learns it.

Re: Why am I interested in Elixir?

#110
post #73

Earlier quoted context omitted.

- deployment is terrible like really bad - average performance ( like 10x slower than Java even worse for CPU intensive tasks ) - dynamic language ( this is the worst part ), working on large code base means problems ahead - lot of features from BEAM / OTP that are not that useful and done better on modern cloud platforms ( Kubernetes for instance does a lot of similar things but better and more flexible, apply to an…

Regarding Elixir being a dynamic language, I've programmed in Java, C#, and other strongly typed languages as well as Ruby, Python, Elixir, and other dynamic languages since the mid 90s. Throughout my entire career, I cannot think of a single time when I've thought, "It would be so much nicer if this language was statically typed." It just hasn't ever been an issue for me. If typing is something you really want to ca…

Well I mean there are a class of bugs they help to catch but with pattern matching it really don't come up very often. Just don't match the values you don't want. Sure it's a runtime error but you'll catch them pretty fast and elixir is fault tolerant.
Post reply on HN