News for hackers. Stuff that matters.
Re:Rust needs a web framework for lazy developers by Ygg2 on Monday October 07, 2024 @06:14AM (#41764495)
> But it also is so much more (and also a cult).

Way to lose readers with memeish statements like that. That said it's in good company of cultists like Smalltalk and Lisp community ;)

> * Its "oop" model is uncomfortable at first (coming from Ruby and Java)

It's OOP in the sense it has polymorphism, and "methods" . It's not OOP in almost every other conceivable way.

It doesn't fit with static OOP of Java. It doesn't fit with dynamic OOP of Smalltalk and Ruby.

> It has downsides, and I consider the borrow-checker to be one of them

I wouldn't want Rust without borrow checker, and never figured this complaint.

Yes, it's uncomfortable and will prevent you from making some legal code.

Guess what? So will a seatbelt. You move too fast to reach something and it snaps you in place.

Re:Rust needs a web framework for lazy developers by raxxorraxor on Monday October 07, 2024 @08:18AM (#41765254)
Rust to me looks a bit like Java. "One owner per resource" is Rusts "One class per file".

I am not convinced that the mental overhead justifies the memory safety guarantees yet. At least for a general purpose language.

I didn't yet write a lot of Rust, perhaps more experience trivializes Rusts ownership model.

Re:Rust needs a web framework for lazy developers by Ygg2 on Monday October 07, 2024 @10:49AM (#41766555)
> "One class per file".

Wait. What? Neither Java nor Rust limit class/struct per file. You must mean public class per file.

As a fellow Java dev, no it doesn't look like Java at all. Maybe it looks a bit like Kotlin, but only superficially.

I wrote Rust on and off for 5 years, by that time you internalize the borrow checker.

Re:Rust needs a web framework for lazy developers by raxxorraxor on Monday October 07, 2024 @11:31AM (#41767030)
I did mean one public class per file.

I didn't mean syntax or core lib to be similar, I just generally meant that both languages impose restrictions on themselves which might seem sensible at first.

Re:Rust needs a web framework for lazy developers by Ygg2 on Monday October 07, 2024 @11:36AM (#41767070)
Java isn't that restrictive. Rust's type system is much more restrictive and customizable.

That said, a good way to think about programs is a series of restrictions, i.e. invariants. Truth be told, only Ada Spark so far really embraced invariants.