Live data from Hacker News

Why Rust?

rerun.io

181–190 of 294 posts

Re: Why Rust?

#181

Earlier quoted context omitted.

Quoted post unavailable.

Emil has been working in Rust for eight years. Hardly a honeymoon phase. As for your accusation of lying: I cannot imagine where you’ve pulled that from. Emil’s description of unchecked exceptions as invisible errors insofar as you can’t see where errors might occur from the source code alone is objectively an accurate and reasonable description.

Except Emil is talking about "Java exceptions", not "Java runtime exceptions".

Because Java's checked exceptions have the exact same good qualities that Rust's question mark operator offers.

Re: Why Rust?

#182
post #87
post #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.j…

Rust will never make it to the frontend at scale. There is a reason why JS was invented. People doing frontend dev don't want to bother with slow compile time or 3 strings implementation. And the fast argument is missleading at best, every modern language are "fast" enough, if Amazon and Google runs Java that mean it's fast enough for 99% of workload.

JS is the best language for web - and generally for high level systems design - and honestly I don't know why people don't want to see it. Good parts of JS are: first class functions and closures and prototypical inheritance. Find decently popular language with those things implemented well, good luck. Rest of JS features are a noise, improvements of developer work ergonomics (all those let/const, modules, async/await and what not etc) and unfortunately pile of bad decisions which cannot be undone because web has to work correctly and do not break constantly.

JavaScript really is a Scheme in disguise with a little bit of Smalltalk. Which really is good. If you don't like junk coming from {}+[] - don't use it, but I consider the lack of errors thrown to be a correct behaviour. Use TS or any other linter to control stuff.

As we can see, Clojure wasn't accepted widely despite the fact it also has first class functions and closures. In my opinion the answer is simple: people want to have syntax for stuff which we agreed is good. Using macros and ((())) is not what people want to do long term.

Re: Why Rust?

#184
post #153

Thanks for the article? You are not still hiring per chance..?

Are you propagating errors with the question marks here?

Good one!

is_hiring()?.apply()?.code_rust()?

Error handling is really nice in rust

Edit: Just realized that the first question mark in my original question was a mistake

Re: Why Rust?

#185

Earlier quoted context omitted.

I actually remember that time! C++ rode on a wave of OOP hype. It was all about that, packaged into something people were kind of familiar with. OOP WAS THE FUTURE, MAN!

C++ was C with a better interface for GUI widgets and generic templates. There was a lot of hype about OOP too, but I am not sure it was ever adopted because of it.

C++ was C with a better interface for GUI widgets and generic templates.

That came a lot later in its life, like mid to late 90's.

Re: Why Rust?

#186

Earlier quoted context omitted.

I think you've covered all the major options: - Use Rc (or Arc if you need to be thread-safe) - Use a Vec, slotmap, or a similar data-structure and store handles (indexes). This doesn't entirely prevent use-after-free bugs. But it does tend to make them panics rather than silent errors. - Use unsafe (and ideally create your own higher-level safe abstraction) In theory, there should also be 4: - Use a GC library But I…

But most of the bugs I often face and seem to struggle with are with dynamic lifetimes (in graphics / simulation / gamedev). So even as a relatively low-level systems dev I don’t really find Rust’s borrow checker that useful.

I think there are cases where borrow checking is difficult for a domain, but without a lot more detail it's hard to say. My understanding is that graphics/gamedev is one of those cases and if you aren't willing to use ECS you may have problems.

Re: Why Rust?

#187

Earlier quoted context omitted.

I'll bite - I just googled this, and am having a struggle understanding. Is an Algebraic Data Type (ADT) in rust an enum or tuple? I make heavy use of enums (along with structs) as my program foundations. Am I using ADTs? The third type the query shows are unions, which I'm not familiar with.

Enums are Sum Types, which are a type of ADT[1]. Tuples are a Product Types, which are another type of ADT[2]; Sum Types are so called because when you add one to that, you add just one more possibility (It could be A,B now it can be A,B,C). Product Types, on the other hand, give out possibilities based on their Product, so if you add a new property, you multiply it (A,B can both be two things, so you have 4 possibil…

I found https://guide.elm-lang.org/appendix/types_as_sets.html is friendly describing the what and why.

Re: Why Rust?

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

True. But there are more features out there (such as typeclasses) which are also extremely important and need to become mainstream. We are really not quite there yet.

Re: Why Rust?

#189

Earlier quoted context omitted.

We use Actix for HTTP. Works fine. I don't use ORMs, I prefer sqlx, which gives me compile time checking of queries while still just writing plain old sql. I log via the tracing library to stdout, I let other services handle what's done at that point. I don't use DI frameworks, nor do I believe that they are good, I use dependency injection via construction, which works great. I don't do any fancy configuration. I us…

Thanks for your reply. Can you disclose what web application this is you work on?

https://graplsecurity.com/

That's my company. The blog is hosted elsewhere. Our frontend is hosted via a rust service, which talks to other rust services via grpc.

Re: Why Rust?

#190
post #154
post #16

Earlier quoted context omitted.

Scala, Kotlin, Haxe, Swift, and several others. The search term you want is "Algebraic Data Types" Erlang has the superpowered version of this - binary pattern matching, that lets you pattern match on a bitstream directly.

Don't forget Java :)

It's not there yet, is it?
Post reply on HN