Live data from Hacker News

Elixir and Rust is a good mix

fly.io

61–70 of 165 posts

Re: Elixir and Rust is a good mix

#61

Earlier quoted context omitted.

I pretty much agree with this. As much as I liked the core language, I absolutely hated using anything else in the ecosystem, and in my opinion a lot of that was due to lack of static types. Using Ecto as the main way of interacting with the database was a miserable experience. Part of that was due to skill issue I'm sure.

> Using Ecto as the main way of interacting with the database was a miserable experience. Ecto is prolly one of the best ways to interact with db. Genuinely curious, what other ORMs have you used?

I usually just write the SQL, honestly. For the last 6ish years of my career I've mainly been in the Golang world, so the closest I've gotten to an ORM is a utility to scan rows into structs.

Re: Elixir and Rust is a good mix

#62
post #60

Earlier quoted context omitted.

Is any of this needed though? For some use cases yes, but for many no. It's possible the parent has no practical use for these capabilities.

[flagged]

The author gave static types and performance as examples of things that matter to them that they clearly don't feel Elixir does as well. It's probable they weren't the target demographic for Elixir, like many aren't the target demographic for Rust.

The initial response made an assumption that all these capabilities matter either way, and that's not true.

Re: Elixir and Rust is a good mix

#63
post #44

Earlier quoted context omitted.

I work on a lot of 'glue' issues, often with languages like Perl, PHP, and Erlang (and a bit of Javascript here and there). Specifying types all over the place in languages like C, C++, Java, and Rust feels like it gets in the way and limits more than it helps. (feelings more than data here, of course) Sure, at boundaries between teams, you need to specify the data in some way. That could be a type, but for me, often…

You can absolutely create a dumpster fire in any language. Putting the fire out in an untyped language is a Herculean effort.

Conway's Law means you have to fix the organization before you can fix the software. That's the real Herculean effort.

Re: Elixir and Rust is a good mix

#64
post #59

Earlier quoted context omitted.

You can absolutely create a dumpster fire in any language. Putting the fire out in an untyped language is a Herculean effort.

In my experience it is even harder in a typed one because now you have to deal with the type system nightmare they built. So the compiler fight your refactoring.

Nobody code without a type system. The distinction is build time vs runtime type checking. At build time you catch bugs that would appear later at runtime. Which is more costly to fix later.

Re: Elixir and Rust is a good mix

#65
post #59

Earlier quoted context omitted.

You can absolutely create a dumpster fire in any language. Putting the fire out in an untyped language is a Herculean effort.

In my experience it is even harder in a typed one because now you have to deal with the type system nightmare they built. So the compiler fight your refactoring.

[deleted]

Re: Elixir and Rust is a good mix

#66

Earlier quoted context omitted.

I pretty much agree with this. As much as I liked the core language, I absolutely hated using anything else in the ecosystem, and in my opinion a lot of that was due to lack of static types. Using Ecto as the main way of interacting with the database was a miserable experience. Part of that was due to skill issue I'm sure.

> Ecto as the main way of interacting with the database was a miserable experience That's very common when you don't know DBs. But DB savy developers usually claim the opposite, because the syntax is more familiar.

> That's very common when you don't know DBs.

I'm not a 20 year DBA greybeard veteran, but I'm comfortable enough to write schemas and queries by hand without any issue, and the entire time I wished I could do just that instead of using Ecto.

Re: Elixir and Rust is a good mix

#67
post #64
post #59

Earlier quoted context omitted.

In my experience it is even harder in a typed one because now you have to deal with the type system nightmare they built. So the compiler fight your refactoring.

Nobody code without a type system. The distinction is build time vs runtime type checking. At build time you catch bugs that would appear later at runtime. Which is more costly to fix later.

> Which is more costly to fix later.

This assumption is changed, IMHO, by Erlang. Hot loading makes the cost to make small changes very low. So the question becomes, do you pay the definite cost of build time type checking (usually includes coding time type annotation), or do you accept the possible future cost to making small fixes.

Of course, if you work in an organization where even a small fix requires months to release, then do all the things you can to prevent making small mistakes.

Re: Elixir and Rust is a good mix

#68

I admit for a long time this was my primary motivation to learn Rust, but, sadly, I haven't come across problems in years that were CPU bound/where I needed something like Rust... Rustler still looks like a great fit if needed, but, depending on the use case, if I were CPU bound and needed to write my own code/not just use a Rust library, I'd be as or more likely to look at using Zig and Zigler[0], for much faster le…

Efficient PLs are useful for latency sensitive applications too, not just CPU bound ones. Though, that doesn't widen the number of cases by much...

Re: Elixir and Rust is a good mix

#69
post #59

Earlier quoted context omitted.

You can absolutely create a dumpster fire in any language. Putting the fire out in an untyped language is a Herculean effort.

In my experience it is even harder in a typed one because now you have to deal with the type system nightmare they built. So the compiler fight your refactoring.

You never actually get away from types, they are a core requirement of using any data beyond raw bytes. The guarantees that a strong type system provide mean you can be certain about certain things before your program even runs. If that's a problem for you, you're likely just leaving bugs on the table to be discovered at runtime.

Re: Elixir and Rust is a good mix

#70
post #38

Earlier quoted context omitted.

It's worth noting of course that ~Github~ Dropbox was the driving force behind mypy

yes, that is exactly what I meant by "they both eventually went to type hints", but doesn't github use ruby? I think you mean sorbet? Dropbox was the driving force behind mypy (IIRC).

bleh, I meant to say Dropbox.
Post reply on HN