Live data from Hacker News

Elixir and Rust is a good mix

fly.io

71–80 of 165 posts

Re: Elixir and Rust is a good mix

#71

Earlier quoted context omitted.

I tried Haskell for a while and switched to Common Lisp (although I still follow Haskell from a distance). My experience just doesn't match up with the claim that a project of any size written in an untyped inevitably descends into a dumpster fire. I've worked on largish systems in several dynamically-typed languages and several statically-typed and I personally haven't noticed any major difference in overall product…

The issue isn't productivity. As far as just slamming out code untyped languages are undeniably faster. The issue is working on projects once they've reached a certain size where you have no idea what the intent of the original author was and you maybe need to refactor, add-in major pieces, or change anything with the expectation that it continues to work.

I’m including maintenance costs in “productivity”. I’ve worked on large dynamically typed codebases and never experienced what you’re talking about.

I think it’s a question of understanding how to work and think without explicit types rather than something that makes statically typed codebases easier to maintain.

Re: Elixir and Rust is a good mix

#72
I remember MS reps coming to our offices in the 90s and "Teaching" us how to program and how it is cool to have one person writing GUI and the other "guru" writing high performance C++ to be used in critical parts.

I showed them a piece of software that was mighty fast, Internet enabled and GUI intensive. They liked the software but asked where did you get this particular screen control from. You've got to see their faces when told that the whole software was written by a single person in Delphi.

Re: Elixir and Rust is a good mix

#73
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.

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.

[deleted]

Re: Elixir and Rust is a good mix

#74
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]

You may not realize this, but your comment comes off as being very snide and annoying, which I'm sure you didn't intend. Try rewording things in a way that assumes good faith, and besides making better relationships you'll persuade people more effectively as well.

Re: Elixir and Rust is a good mix

#75
post #44

Earlier quoted context omitted.

>Also, some of us are as anti-typing as you are pro-typing. Assuming ample experience with both, how does one reach this conclusion? I have yet to see a project of any size that needs to be worked on by multiple teams and is written in an untyped language not descend into dumpster fire.

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…

IMO, TypeScript strikes a great balance here. I loved the way I could cast something to `any` when hacking something out, then add proper type annotations once it's ready to be productized. It also a did a good job with type inference.

Disclaimer: I work at Microsoft, but not in the Developer Division

Re: Elixir and Rust is a good mix

#76
post #25

Earlier quoted context omitted.

Rust doesn't have a lot of good runtime introspection tools (or they're very not obvious). If you're running a system with a lot of concurrency, it's nice to be able to attach a debugger and find out exactly what's going on with each of your tasks. I haven't seen hot loading for Rust (but a quick search shows there's some out there), and I'm not sure how amenable Rust is to dlopen and friends to force the issue. Erla…

>Also, some of us are as anti-typing as you are pro-typing. Assuming ample experience with both, how does one reach this conclusion? I have yet to see a project of any size that needs to be worked on by multiple teams and is written in an untyped language not descend into dumpster fire.

Untyped languages work fine if you use them with microservices.

The only thing you can't do is have both untyped and monolithic at the same time.

Re: Elixir and Rust is a good mix

#77

Earlier quoted context omitted.

> 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.

No one stops you from writing raw SQL with Ecto.

But good luck creating composable SQL with raw string interpolation, which Ecto excels at.

Re: Elixir and Rust is a good mix

#78

IO in erlang is slow, is Rustler a good candidate to improve IO intensive applications?

IO in Erlang is faster than many other managed languages, thanks to stuff like IO Lists that are dealt with very efficiently through iovec syscalls (readv, writev).

Then add efficient pattern matching for binary data, and networked servers on the BEAM are the most ergonomic than any other language.

All this stuff that the BEAM offers you out of the box can be replicated in any native language with a lot of boilerplate and ceremony.

Your "Hello, " webapp in Rust will probably need two allocations and a string concatenation, while on the BEAM, if constructed as an iolist, it's a single writev syscall, using a static "Hello, " string and a shared "" reference from the parsed HTTP data.

Re: Elixir and Rust is a good mix

#79
I made the ‘risky’ decision to learn Elixir & Phoenix for a 6 week University project that I delivered earlier this week. It could have turned out to be a terrible decision but honestly once I got my head around it, it’s probably some of the most productive coding sessions I’ve ever had. Deploying to Fly.io was also amazing, I think it was 3-5 commands from signup to deployed with a database. Very happy with it all.

Re: Elixir and Rust is a good mix

#80
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.

Well no since unit tests run faster than build time.
Post reply on HN