Live data from Hacker News

The Rust I wanted had no future

graydon2.dreamwidth.org

161–170 of 523 posts

Re: The Rust I wanted had no future

#161
post #149

Earlier quoted context omitted.

Unfortunately a lot of people will dismiss C# and F# just because it has the Microsoft label. I do think they're missing out.

Nowadays I program in a mostly Microsoft world (VSCode, Github, npm, typescript, GPT, ...) and I think its quite good, so no bias here. But the "shipping a native binary straight to the server that just works" is absolutely crucial for me

ASP.NET AOT support coming in .net 8

Re: The Rust I wanted had no future

#162
Too bad graydon didn't get his way with build times. I've come to believe that the most important feature of any development environment is to minimize the built-test-debug cycle. Of course, a real system has many different ones, ranging from "language level" to "I have to redeploy and perform a complex series of actions in an app or 3". But at the language level I've found that build performance is of paramount importance. And when a project ignores build perf, everyone suffers every time they build. Since the lower-limit is the language compiler, it should therefore be kept very fast. (And the people working on the applications must constantly resist adding features that slow the BTD loop down any further.)

A good example of this trade-off in Java is Lombok. A very handy library that legitimately avoids a ton of boilerplate, but it also absolutely tanks your build time. In a real system, a large one, your team is better off just getting good enough with their editor that they can generate the hateful boilerplate, and leave Lombok out. Because you'll be paying for Lombok all the time, and only need it a small fraction of the time. There are hundreds, thousands of these conveniences that are deeply tempting but should be avoided, in every build. The problem is that the programmers become attached to these little nicities and actively resist giving them up, even though they are so costly.

Re: The Rust I wanted had no future

#163

,,I would have traded performance and expressivity away for simplicity'' ,,A lot of people in the Rust community think "zero cost abstraction" is a core promise of the language. I would never have pitched this and still, personally, don't think it's good'' If the language makes compromises in performance, it's not a real C++ competitor anymore. Some things are not about what people ,,like'', but that we need a langua…

Yeah, I think most of this is implied in the article.

Re: The Rust I wanted had no future

#164

Too bad graydon didn't get his way with build times. I've come to believe that the most important feature of any development environment is to minimize the built-test-debug cycle. Of course, a real system has many different ones, ranging from "language level" to "I have to redeploy and perform a complex series of actions in an app or 3". But at the language level I've found that build performance is of paramount impo…

I don't understand the big issue with build times: I have always found that they are almost instant for incremental builds (assuming you use lld or mold).

Re: The Rust I wanted had no future

#165
post #27

Earlier quoted context omitted.

We build a proof-of-concept backend replacement for what is essentially “SharePoint being used as a DB with a frontend by people who don’t know how to use SharePoint” and was a nice experience. We also build it in a few other languages, C#, Go, Python and TypeScript and Rust was probably the best experience of them all. We ended up going with C# because we needed Odata, and at the time we hadn’t yet run into the many…

> I wish Rust would have someone like Facebook pick it up and build a frontend framework for it We have yew, and my personal favourite: leptos ( https://leptos.dev/ )

As someone who recently started their first web app in Rust and is using Yew for the front-end, I wish they included benchmarks against other Rust frameworks. I also wish I had more experience and had looked harder; Yew is very verbose in my experience and Leptos looks a little more sane.

Re: The Rust I wanted had no future

#166

Earlier quoted context omitted.

I would like to second F#. It seems to have a lot of what people want, so why isn't it more popular?

Can I natively build self-contained binaries? One of Go's biggest advantages is the delivery chain from code to server (build for target arch, copy to target, ./run)?

I believe you can https://learn.microsoft.com/en-us/dotnet/core/deploying/sing...

Re: The Rust I wanted had no future

#167
The key challenge of rust for me:

"Complex grammar. I've become somewhat infamous about wanting to keep the language LL(1) but the fact is that today one can't parse Rust very easily, much less pretty-print (thus auto-format) it, and this is an actual (and fairly frequent) source of problems. It's easier to work with than C++, but that's fairly faint praise. I lost almost every argument about this, from the angle brackets for type parameters to the pattern-binding ambiguity to the semicolon and brace rules to ... ugh I don't even want to get into it. The grammar is not what I wanted. Sorry."

Re: The Rust I wanted had no future

#168
post #147

Earlier quoted context omitted.

You could try C# (or Kotlin if you have a MS bias ;-)). Both really nice general purpose languages, quite performant despite having a GC and great available tooling.

I think I still would have to deal with a lot of OOP and imperative code there, C# feels like a kitchen sink of stuff - right?

C# is horribly OOP. I use it in my day job, and the frameworks wield OOP overcomplexity proudly. It has likely gone beyond Java as the posterchild for OOP: interfaces that are implemented once, classes that are instantiated once. You can't get away from it either, it is practically part of the stdlib and everyone cargocults it.

Rust is imperative too, though.

Re: The Rust I wanted had no future

#169

,,I would have traded performance and expressivity away for simplicity'' ,,A lot of people in the Rust community think "zero cost abstraction" is a core promise of the language. I would never have pitched this and still, personally, don't think it's good'' If the language makes compromises in performance, it's not a real C++ competitor anymore. Some things are not about what people ,,like'', but that we need a langua…

Rust does make compromises of performance. That is not always bad so long as the compromises are minor. Fortunately Rust can do most of the checking at compile time, but it if you read from an empty vector Rust doesn't have undefined behavior and that means there is a runtime check of some sort in at least some cases.

The trick is to find the right place to compromise so the cost is minimal overall even if it isn't zero.

Re: The Rust I wanted had no future

#170
post #22

Earlier quoted context omitted.

I disagree. You can call an async function in Rust from a regular one, that's true, but the returned value still needs to be passed through an executor to be useful. Async without function coloring means being able to call `async fn add(a, b: usize) -> usize` from anywhere and having an usize back, whether you're calling from a regular or async function. If you need slightly different logic because of async, you got…

Algebraic effects like how OCaml’s now implementing it may be possible! The ecosystem around effects in OCaml is still really young, but here’s an example of an http request being made that is asynchronous, non-blocking but looks synchronous with no special syntax. https://github.com/mirage/ocaml-cohttp/blob/16e991ec1f7e5f0c... Performing these effects is similar to throwing exceptions up the callstack where whicheve…

As someone who likes OCaml, but hasn’t touched OCaml in ~5 years, that’s a very hard example to read. I can tell it’s making a network request, but I have no clue:

- what the type of res is (is it a string? A buffer? Async string? Something else?)

- how this code does not block: what is happening in parallel? At which point will it block?

I would like to be excited about OCaml’s algebraic effects, but right now I don’t really get it.

Post reply on HN