Hacker Newsnew | past | comments | ask | show | jobs | submit | josephg's commentslogin

The rust standard library is excellent. Start more or less anywhere, and click "view source". Or open up the source code files on github.

There's often a lot more comments than code, which is kind of annoying. But it really is the best way to learn how a lot of good rust is written.

Vec is a good read: https://doc.rust-lang.org/src/alloc/vec/mod.rs.html

Here's the lovely slice::binary_search_by: https://doc.rust-lang.org/src/core/slice/mod.rs.html#2967-29...


We're a new industry. So long as we keep iterating on our tools, this will continue to happen. Obsolescence is - in this case - an indicator of progress.

Rust doesn't eliminate all bugs. But anecdotally, by the time the type checker and borrow checker have humbled me, my programs really do often work the first time I run them. Its quite remarkable.

This isn't a special thing about rust. All languages are on a spectrum of "detect all bugs statically" to "detect all bugs dynamically". Rust programs run correctly "first time" more than javascript, more than typescript. But still less than haskell.

You can still write bugs in rust, obviously. I've written plenty. As you say, so has cloudflare. But strong typing does find a lot of bugs in practice.


Yeah its funny what we can get away with using different design tradeoffs on modern computers.

I've been reading through the SeL4 source code lately. SeL4 isn't a multithreaded kernel. It supports SMP - so, it can use all the cores on your computer. But the kernel itself uses a big mutex. Complex syscalls can't run concurrently.

And you know what? I think its fine. A tiny microkernel like SeL4 offloads almost everything to separate processes anyway. The only things in the core kernel are the bootloader, scheduler and thread cap tables. Device drivers are multithreaded because they all run in separate processes.

Having the kernel itself effectively single threaded reduces a whole class of bugs and complexity, at a (hopefully) negligible performance cost. Its smart.


> I can see some interest in Fil-C, but some will still be against it due to the overhead it imposes (1.5x-4x worse performance, less deterministic since there's a GC)

Yeah this is where I stand with it. Fil-C seems to be the worst of all worlds. It combines the performance of an immature GC language, with the primitive syntax and ecosystem of C. (Eg nullability, void*, no generics, no collection types, a bad standard library, header files, no good build system, bad cross-OS portability, BYO strings, etc).

I don't choose C for its wonderful syntax. I choose it because its small, light and performant. If I was happy to use a garbage collector, I'd much prefer to go all the way and grab Typescript, C# or Go.

The only use case I can see for Fil-C is running legacy code that you can't be bothered porting to a better language.


Don't forget the compatibility issues: Fil-C isn't really usable if you mix C with other languages in the process.

It's especially problematic to have multiple different garbage collectors; so given the desire to reuse libraries across language boundaries, there's still a strong demand for Yolo-C, C++ or Rust.


I assume this is a product of sufficiently advanced compilers. Other LLVM languages almost certainly suffer from this too, including Zig, Swift and unsafe rust.

> what's the justification of not using a memory-safe language

Use Go, Java or Fil-C, and memory safety is achieved at the expense of runtime performance. Tracing garbage collectors make your programs run slower and use more RAM.

With Rust you pay with complexity. Rust has new, weird syntax (lifetimes, HRTB, etc) and invisible borrow checker state that you've gotta understand and keep track of while programming. Rust is a painful language to learn, because lots of seemingly valid programs won't pass the borrow checker. And it takes awhile to internalise those rules.

I personally think the headache of rust is worth it. But I can totally understand why people come to the opposite conclusion.


> because lots of seemingly valid programs won't pass the borrow checker

Some straight-up valid programs as well


> Programming Rust does not mean I have to: buy into their marketing hype

> give the same smug lectures about "safety"

I'm often confused reading articles like this, which take for granted the existence of some "rust evangelism strike force" which goes after people on the internet for not liking rust enough.

The way people talk, it sounds like there's some insanely effective marketing campaign going on to promote rust everywhere. But I haven't seen it. Certainly not any more than any other technology people get excited about for awhile, like Go. Or docker when that launched.

Where are these comments? Can anyone give some actual links to these sort of comments people say online, which don't get immediately downvoted? The way people talk, these comments must be made in such large volumes that it seems very odd I don't notice them?


It's way rarer on Hacker News than people alleging an omnipresent Rust Evangelism Task Force is constantly imposing itself on people. I have seen "overly enthusiastic" comments about Rust, but I can count them on one hand. I'm not going to link them because I don't want to dogpile ob people. Note that I read many/most of the Rust threads that make it to the front page.

But I have seen thousands of comments complaining about these supposed evangelists (no exaggeration). Less often and less reliably in the past few years, the meme is petering out. But there's absolutely no comparison of the relative frequency. People complain bitterly about Rust on this forum consistently, actual Rust zealots appear very rarely.

It is simultaneously true that Rust is "just a tool" and that this is a significant fact, and that the people complaining about Rust are the bigger problem in the day to day discourse in Rust related threads on this platform and in the present day.


Yeah, I keep hearing about this toxic community from people who won't blink twice to use decade-out-of-date critiques of Java :)

It's not marketing. It's just unproductive and incessant.

For example in this PHP post 3 days ago, ofc someone commented about how they ditched PHP and Go for Rust.

https://news.ycombinator.com/item?id=47149752


This is a technical forum. People often flex on what they find better / faster / more productive.

I've seen plenty of comments of people giving up on Rust and going for Go or Typescript for their internal company's tooling needs as well. ¯\_(ツ)_/¯


In this very comments section: https://news.ycombinator.com/item?id=47193361

"all others languages are flawed, Rust is the only that stands the scrutiny" sounds pretty evangelist to me.


Sure; there's one or two unbalanced, positive comments about rust in this thread. Does that seem out of balance to you, out of 113 comments?

If there was a post about Go, Kotlin or C#, I bet there'd be a few glowing positive comments about the languages. I'd be surprised if there weren't.

Is that a problem? I don't want to move the goal posts, but this really doesn't seem like the problem its made out to be. I count far more comments complaining about rust evangelists than I see actual rust evangelism. Even in a thread about rust being a good tool.

What gives?


I think it's that the few enthusiastic fans make such hyperbolic statements, they create drama and stand out among the majority of reasonable users of the language. They attract attention of the people who are curious about the language, and give the impression that the community is hyping it up too much.

The other day I saw a developer who works on the Rust language saying, please tone it down because it's making us look like fanatics. It's healthy to acknowledge that the language is not perfect, it has room to improve, even some fundamental flaws. Oh, I recognize your user name, recently read a great article you wrote - here it is. This was really informative and interesting.

Rewriting Rust - https://josephg.com/blog/rewriting-rust/


IMO it's mostly people who, after being told that only bad programmers need memory management, don't immediately kiss the feet of the speaker.

check further down this discussion for immediately downvoted comments

https://news.ycombinator.com/item?id=47191837 https://news.ycombinator.com/item?id=47191619

Post anything negative about rust, or anything about a severe bug in some non-rust code, for examples of your own

I have nothing against rust, although the learning curve is too steep and development in rust is too slow to be a practical general purpose language for a regular company.

The culture around dependencies also means you pay for your memory safety by increased supply chain risk.

Golang or Java gets you memory safety, faster compilation, easy hiring and have better standard libraries


I completely agree with your criticisms. I've been saying many of the same things about rust for years on HN. But I'm rarely downvoted for saying so.

FWIW, I also really like rust. I personally much prefer it over Go and Java. But those are still very legitimate criticisms.


I think it's an old stereotype. When Rust started gaining popularity, I did see comments like that. Even felt compelled to post them sometimes. But now that we have real production Rust experience, we're a bit more nuanced in our views.

I started periodically asking the same question and I get 20-25 upvotes and then eat 15 downvotes some hours later. One recent example (if ~75 days is recent: https://news.ycombinator.com/item?id=46291249).

It is a very weird case of aggressors pretending to be victims.

Did I see zealous Rust comments? Sure! 4-5 on HN in the last 5 years maximum. On Reddit it could be 10-15 for the same period but the discourse there is not very civil or informative anyway so I started ignoring them and not thinking them representative.

On HN I see regular Rust hate while claiming that zealots are everywhere... and like you, I just can't see it.


Remember Axum or the reflection drama?

You're probably thinking of Actix and the unsafe/TechEmpower thing? I've never seen Axum involved in any notable drama.

Yeah that one.

Yeah; but that was 6 years ago - from way back in 2020. Was it really that traumatic for people?

That was part of Rust Evangelism Striking Force meme genesis.

And then we have the whole reflection drama with the author going back contributing to C and C++ ISO work.


I think it's just what happens when something genuinely great comes along. Some people try it and enthuse about it. Sometimes other people who haven't tried it assume that it's just like all the other average things and therefore the only explanation is irrational fanboyism.

We saw the same thing with the iPhone. It was a step change from previous phones. Loads of people were like "it's just Apple fanbois, I'll stick to my N95" without even trying it.


Exactly. More bluntly, the Linux kernel isn't an operating system.

I've been half joking lately that if I wrote an OS, I'd call it Nostalgia OS. I'd aim for a UI reminiscent of windows 98 / windows 2000 / snow leopard. With HID guidelines and a rich, clear, cohesive set of UI widgets to build applications with. I think that was the peak computing user interface - at least as I experienced it.

Of course, the kernel would be based on capabilities (probably SeL4). And applications would probably ship as WASM bundles. And I'd have a built in local first user database built around CRDTs and things instead of a file system, kinda like a modern Lotus Notes. But for the UI? That era was great.


This is sort of what SerenityOS was going for. Alas it has slowed down a bit since Andreas now handles the Ladybird browser.

To be fair Ladybird is probably needed more urgently now.


> windows 98 / windows 2000 / snow leopard

I don't know if I would group those together. Windows 98/2k were visually similar, but OSX by that point was looking quite refined.

It had toned down the blue, but still had some visual flare.

95/98/2k had a very utility appearance. Just compare the recycle bins between each to see how much more effort went into OSX look and feel.


My favourite OSX in terms of visual design was the Panther/Tiger era personally. Leopard looked good, but there was something really cheerful and friendly about Tiger. The iPods of those days were also really well thought-out in my opinion.

Definitely a world apart from the utilitarian Windows 98 UI.


And personally I preferred the XP/Vista era, having search was so much better than not.

However, that just shows how far behind Windows was. Spotlight was much better.


To some extent (not capabilities), Haiku fits the bill here (https://en.wikipedia.org/wiki/Haiku_%28operating_system%29). Applications are bundles (but not WASM of course). The UI is very clean. The whole OS is also elegant and very fast on modern hardware.

Yes because BeOS was way ahead of its time. A complete new OS, doing all system things so much more efficiently, that it could allow wasting cpu time on high level actions, like moving windows in real-time while they were playing videos. On 1993s hardware, impossible with Windows or OS/2.

Check out the Chicago95 theme for XFCE.

PTSD and my pining for OS/2 spikes once again...OMG...

Did you happen to be between 15-25 years old when ‘98 was released?

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: