Live data from Hacker News

Rust Is Surprisingly Good as a Server Language

stu2b50.dev

331–340 of 352 posts

Re: Rust Is Surprisingly Good as a Server Language

#331

Earlier quoted context omitted.

The borrow checker only checks, it does not solve the problem. In other languages the problem does not even exist to begin with. It is not a trivial problem to solve (as you claim), otherwise we would have never needed the borrow checker to avoid memory bugs, nor higher level languages to speed up development by avoiding the problem altogether. If you are going to end up sprinkling clones, heap allocating and referen…

Just because you have a garbage collector doesn't mean you don't have to worry about memory management. I've see too many problems pop up because people don't understand how memory is managed in their GC'd language.

We were talking about the borrow checker and memory safety, not about memory limits, access patterns, etc.

Re: Rust Is Surprisingly Good as a Server Language

#332
post #216

Earlier quoted context omitted.

All that applies to several other very mature languages that can target WASM, like C. Nevertheless, WASM is not ideal for server work. It is intended for the frontend.

Sorry, I may not have explained my point clearly enough. I'm not suggesting that you would use WASM for server work at all. I'm suggesting that Rust would be interesting for WASM on the frontend because it doesn't depend on a runtime. Given that you might want to use Rust for WASM you may also want to use it on the backend (that's without using WASM on the backend). The assessment of Rust via small projects says noth…

Fair enough. I wanted to mention that Rust is not the only language that targets WASM since you talked about maturity.

Re: Rust Is Surprisingly Good as a Server Language

#333
post #5

I started learning Rusit and using it for hobby projects in 2014, but I have to agree: for a full-blown product development it's just not there yet. Static typing your code up to the point where you can assume it's correct if it compiles and managing memory manually without the need for a garbage collector, these two things alone just light up my inner nerd with excitement. But as an engineer who has to deliver a pro…

I think Rust is past the hiring hurdle and you would probably get the opposite effect - I suspect you would get more higher quality applicants just looking for a chance to work with it. Seen a similar story with a team choosing RoR over Clojure years back.

Higher quality, but all seniors with salary expectations to match. Using a senior developer to maintain a couple of services is both a misuse of his salary and a good way to bore him to death.

Re: Rust Is Surprisingly Good as a Server Language

#334

Earlier quoted context omitted.

Or take the ORM as an example. Doesn't even begin to compare with 2012's ActiveRecord from Rails land. Not to be surprised, as Rails used a lot of dynamic magic that is simply not doable in Rust. Granted, it's more than enough for a lot of use cases but it wouldn't seem to me like the most appropriate approach for, say, and e-commerce platform in terms of maintainability and time to market. Of course, the performance…

Conversely, active record can’t generate the SQL you can learn in a few minutes in a database class. I’d much rather have highly precise sql serialization and deserialization code and emphasis on minimal client overhead in a systems language than the ability to rapidly spike a data model and query it in the space of a PowerPoint slide.

Sure, as with any ORM.

But then you have also stated the point: systems language, which is the perfect use case for Rust. The original article talks about a "server language", as in application server, and my whole point was that for building business applications this is a weakness, not a strength.

Re: Rust Is Surprisingly Good as a Server Language

#335
post #29

Earlier quoted context omitted.

Rewriting is very expensive, and the advocate will need to make a VERY strong case for Rust if they're asking your company to invest in replacing it - and alternatives have to be suggested as well, including other languages and a good list of things wrong with Node / TS. Consider developer availability as well. I don't think a strong enough argument can be made. I'm sure you CAN write web services in Rust, and that i…

Yeah. I am being very cautious about their desires. I learned that the best way to discourage someone from taking a large project is to show how much work it would be. Just shutting down developers is not nice.

I agree too. Rewrites are a scary thing. The best is to do some test with a few new micro services and see how it feel to code from 0 to production. Learning the tool chain etc..

Re: Rust Is Surprisingly Good as a Server Language

#336

Earlier quoted context omitted.

Rewriting is very expensive, and the advocate will need to make a VERY strong case for Rust if they're asking your company to invest in replacing it - and alternatives have to be suggested as well, including other languages and a good list of things wrong with Node / TS. Consider developer availability as well. I don't think a strong enough argument can be made. I'm sure you CAN write web services in Rust, and that i…

Why not Kotlin?

Because we need the JVM to die?

Re: Rust Is Surprisingly Good as a Server Language

#337

Earlier quoted context omitted.

Having to care for memory management is by definition very low level.

But I don’t? The borrow checker takes care of that? String vs &str is trivial to get ones head around, usually it’s really easy to decide whether you’d like to pass a reference or ownership, and worst comes to worst, sprinkling some copy/clone etc to get things sorted quickly still yields a binary that’s faster and more robust than something I can whip up in Python...

But this is still using a hammer to screw in a nail. Rust is a systems language, it’s a junior dev move to force it into a web server. Use go or typescript for this, not rust. Just like I would write c++ for a backend unless i’m trying to shave off some nanoseconds.

Re: Rust Is Surprisingly Good as a Server Language

#338
post #325

Earlier quoted context omitted.

The borrow checker only checks, it does not solve the problem. In other languages the problem does not even exist to begin with. It is not a trivial problem to solve (as you claim), otherwise we would have never needed the borrow checker to avoid memory bugs, nor higher level languages to speed up development by avoiding the problem altogether. If you are going to end up sprinkling clones, heap allocating and referen…

> If you are going to end up sprinkling clones, heap allocating, and reference counting, then you could have used C#... The memory management system isn't Rust's only good feature. I and others enjoy Rust's type system and functional features, for example. Using Rust also makes it easy to get performance for when writing the parts for which you need it.

A typed language is a typed language, there are other languages that are easy to get performance out of. I’m not a rust dev and I’m highly skeptical it will be used outside of firefox and a few niche projects after this initial hype train dies off. What other features would make me pick rust over golang or one of the interpreted languages?

Re: Rust Is Surprisingly Good as a Server Language

#339

Earlier quoted context omitted.

The borrow checker only checks, it does not solve the problem. In other languages the problem does not even exist to begin with. It is not a trivial problem to solve (as you claim), otherwise we would have never needed the borrow checker to avoid memory bugs, nor higher level languages to speed up development by avoiding the problem altogether. If you are going to end up sprinkling clones, heap allocating and referen…

Just because you have a garbage collector doesn't mean you don't have to worry about memory management. I've see too many problems pop up because people don't understand how memory is managed in their GC'd language.

This isn’t true, in all languages with one you can ignore the garbage collector and still get work done. It may not be the most efficient but you still get work done. Let’s get a fresh out of code bootcamp grad in here and throw two languages in front of them if you want to test this.

Re: Rust Is Surprisingly Good as a Server Language

#340

Earlier quoted context omitted.

Conversely, active record can’t generate the SQL you can learn in a few minutes in a database class. I’d much rather have highly precise sql serialization and deserialization code and emphasis on minimal client overhead in a systems language than the ability to rapidly spike a data model and query it in the space of a PowerPoint slide.

Sure, as with any ORM. But then you have also stated the point: systems language, which is the perfect use case for Rust. The original article talks about a "server language", as in application server, and my whole point was that for building business applications this is a weakness, not a strength.

I don’t see what excludes building an application server with a systems programming language. Business applications have maintenance costs that the ORM backloads; it’s not like all businesses need to do this. There’s nothing inherently “business logic friendly” about an ORM.
Post reply on HN