Live data from Hacker News

Why Rust?

rerun.io

61–70 of 294 posts

Re: Why Rust?

#61
post #12

> Rust's enums and exhaustive match statement are just amazing ADTs + pattern matching are the killer feature set that makes the more popular functional languages so damn pleasant to use, and they're starting to spread to more and more languages. I suspect that, 50 years from now, we'll look back and see them as the key paradigm shift of this era.

> we'll look back and see them as the key paradigm shift of this era.

You mean the key paradigm shift of the 1970s when they were invented. Only took 50 years for it to go semi-mainstream.

Re: Why Rust?

#63
post #11
post #4

Earlier quoted context omitted.

> dynamic lifetimes What do you mean ? If you refer to heap allocations, then you can use Box, Arc, Rc. They are not a "garbage collector" nor do they incur performance hits other than a regular heap allocation.

Atomic reference counting does incur a slowdown.

yes, but that's not a JVM-like slowdown. It's fairly well amortised and _clearly_ not a matter of consideration when writing an app or a library.

If your issue is "atomics are slowing down my app", then I assume you already milked the code to the latest micro second of performances everywhere else. This is likely not the case here and not a general advice I would give to anyone.

Remember, some dev in python where concurrency is inexistent, start-up time is horrendous and performances are abysmal compared to rust. (this is exaggerated: of course you can run stuff in parallel in python)

Re: Why Rust?

#64
post #31

I've started working in Rust too and I too find it a tremendous breath of fresh air. It's the first time I've been excited about a new programming language in many years. C++ promised to be a language that was both high performance and very expressive but I always found it very difficult to work at a high level of abstraction in C++. The sharp details always stab through. Rust code, on the other hand, often doesn't l…

> Too bad most of the Rust jobs right now seem to be in crypto. What is the problem with that?

There are still other options available :) For example, Qdrant vector search engine. It's written in Rust, and it's not about crypto. And currently they are hiring Rust developer. Check job openings in LinkedIn

Re: Why Rust?

#65
post #3

> Safety and speed One thing I can't seem to find a quick answer to from the Rust crowed is how does Rust handle dynamic lifetimes? It seems like it does not; it simply prevents you from referring to objects that have a dynamic lifetime not known at compile time. You either have to use 'unsafe' or use the 'handles' pattern where you have what amounts to a custom allocator but the compiler does not know that it's an a…

Yes, your options are unsafety, garbage collection (in the broad sense, which includes Rc), and hiding lifetimes from the compiler via "handles" or similar.

Can you even imagine other options, though? If enough information about the lifetimes isn't known at compile time, how can the compiler prove it safe?

Re: Why Rust?

#66
post #58

Earlier quoted context omitted.

I don't think there are that many people with deep knowledge of crypto working in the 'crypto' scene.

Here are a few prominent cryptographers in the 'cryptocurrency' scene with 'deep knowledge': Matthew Green from John Hopkins University [0] Zhenfei Zhang of Ethereum, Mina, Algorand blockchains who co-created the NIST post-quantum cryptography standard for digital signatures called Falcon [1] Nadim Kobeissi creator of cryptocat now created Capsule Social [2] Silvio Micali, Turing Award Winner for his work on Zero-Kno…

A lot of crypto nerds swarmed to this field because the tech is undeniably fun, and the whole space is rather interesting and is fun to play in. Kinda like it's more fun writing a multiplayer game than a singleplayer game?

I don't think most of these people are into cryptocurrencies specifically.

Re: Why Rust?

#67
post #51
post #12

> Rust's enums and exhaustive match statement are just amazing ADTs + pattern matching are the killer feature set that makes the more popular functional languages so damn pleasant to use, and they're starting to spread to more and more languages. I suspect that, 50 years from now, we'll look back and see them as the key paradigm shift of this era.

Yeah, it's interesting to see them become a part of Java with records, sealed types, and pattern matching. However, I haven't seen much uptake yet.

Most Java libraries want to keep compatibility with Java 8, or at most Java 11; there will be more uptake of these kinds of features once the baseline becomes Java 17, which will probably still take a long time.

Re: Why Rust?

#68

Earlier quoted context omitted.

I imagine if you're not a cryptographer, you don't have a chance getting those jobs.

I don't think there are that many people with deep knowledge of crypto working in the 'crypto' scene.

Probably better if you are not a cryptographer. Because you have fewer inclination to write “your own cryptographic algo”.

Re: Why Rust?

#69

I've started working in Rust too and I too find it a tremendous breath of fresh air. It's the first time I've been excited about a new programming language in many years. C++ promised to be a language that was both high performance and very expressive but I always found it very difficult to work at a high level of abstraction in C++. The sharp details always stab through. Rust code, on the other hand, often doesn't l…

> Too bad most of the Rust jobs right now seem to be in crypto. It is not really surprising that the crypto bros jumped onto the bandwagon, the tech got hyped just around the same time. Just, one of them correctly. :) It's just a shame that other companies don't seem to follow suit. Except some, who always ask for "Senior Rust Developer" which I'd guess is still a limited supply market. :D

It was due to its ability to be compiled to wasm which most chains use to execute contracts.

Re: Why Rust?

#70
> By using Rust for both our frontend and backend, we have a unified stack of Rust everywhere, simplifying our hiring.

> I can write web apps in another language than JavaScript

> I can write web apps that are fast

Yeah, this is what's worrying me. If you look at rerun.io website, you will notice that it's built with Next.js, i.e. is using a React framework to build pages that have no interactivity whatsoever. Next.js is used for the blog, despite it being just a collection of simple static html pages. Meanwhile, the user has to download around 200kB of javascript for no reason whatsoever; and the only reward that they get for their trouble is an avalanche of javascript errors in the browser console [0].

Is the Rust/wasm future going to look like that?

[0] - https://i.imgur.com/TpYW0Rj.png

Post reply on HN