Live data from Hacker News

Rust needs a web framework

ntietz.com

181–190 of 395 posts

Re: Rust needs a web framework

#181
post #10

> I like to make silly things, and I also like to put in minimal effort for those silly things. I also like to make things in Rust… I think this part is perhaps the silliest part of a very silly article. If you really like to put in a minimal effort then why on earth would you use Rust? If you want efficiency, memory management and a compiled modern language just use Go. Then you won’t even need anything but the stan…

> I also like to make things in Rust Seems like a good enough reason to use it to me, but perhaps I’m just another cult member. > we use Rust in production because we thought it would be easier (well safer) to teach to interpreted language OOP developers than c/c++ I think rust is just safer period, regardless of your level of expertise or background. Or are you saying that every memory safety bug was written in by s…

> Seems like a good enough reason to use it to me

I was trying to out that wanting to take the easiest path was rather contradictory to working with Rust.

> I think rust is just safer period, regardless of your level of expertise or background.

Yes, I’m not sure how you think I was implying something different. We (specifically) adopted it because it was easier for our (specifically) developers who weren’t familiar with low level languages to work with compared to c/c++.

> many of those libraries are written by programmers way better than me

You shouldn’t sell yourself so short in my opinion.

Re: Rust needs a web framework

#182
post #29

What make rust better than any language when the bottleneck is the network or the database?

For me, the type system and the performance without having to do any optimization. The complete lack of runtime errors when your code compiles (*if you choose to write code that way)

Re: Rust needs a web framework

#183
post #88

Earlier quoted context omitted.

> and if we pretend we can't hear the Haskell developers it's one of the best type systems out there Eh, Rust's type system isn't one of the best out there. It's lacking higher kinded types, etc. It's abilities in type level programming are frustratingly limited as well. So it's advanced aside from from Haskell, OCaml, Idris, Scala, etc. Compare to OCaml's effect system for an advanced type system feature.

I 100% agree with you (I really miss HKTs), but I don't think the GP was using "best" to mean "most fully-featured". And with that in mind, I do agree with the GP. Scala's type system, for example, is full of warts (well, Scala 2; I still haven't tried Scala 3). Rust's is cleaner and has fewer gotchas. I very rarely have to look up how to express something in Rust's type system, but I remember when I last did Scala,…

One of the major things about Scala 2 vs Scala 3 is the removal of many of the type system warts, in particular the type hierarchy now forms a lattice (if I'm getting my terminology right) rather than being rather adhoc in various places.

Lots of other small annoyances like the whole tuple situation have also been fixed.

EDIT: Plus: intersection types, sane macros/inlining, etc.

Unfortunately (for me), some of our projects still have to cross-compile to 2.x, but that's irrelevant for greenfield. I'd give it a whirl -- it's a great improvement over Scala 2.x.

Re: Rust needs a web framework

#184
post #83

Earlier quoted context omitted.

I strongly disagree on the principle that tests and types have a 100% overlap in the problems they're solving.

Why not? If you think about correctness of a program, (i.e for any combination of given input , it changes a state in a determinstic way, including no state change for invalid input). Strict typing is one way to accomplish this. The cpu does not give a shit about types. It cares about memory registers and locations. The unique code built into the compliers/transpilers is the thing that validates the correctness of th…

This is a very anti-pragmatic way of looking at things in my opinion. The program is not a snapshot that exists in a vacuum. Most programs are going to grow over time and have things added and removed in various places by many people. They're going to have many interfaces and operations.

I think you're arguing that tests and types can both be used to check a particular case for correctness. Sure, this is true. However "moving type checking code into the test suite" means nothing—that would just be type checking.

When you make a code change, there's a difference in the kinds of feedback you get from your tests and your types. Tests usually cover business logic or stories—things that you want or don't want. Types ideally cover everything. They check every operation applied to a given piece of data. Of course types are rarely precise enough that they can catch every logic bug (e.g. strings with semantics not encoded in types, like email addresses).

This is just scratching the surface. You might just have to try out both to get a better sense of how they feel to work with.

Re: Rust needs a web framework

#185
post #63
post #10

> I like to make silly things, and I also like to put in minimal effort for those silly things. I also like to make things in Rust… I think this part is perhaps the silliest part of a very silly article. If you really like to put in a minimal effort then why on earth would you use Rust? If you want efficiency, memory management and a compiled modern language just use Go. Then you won’t even need anything but the stan…

Rust has benefits besides just memory safety and being efficient, it has great language design and a great toolchain. I chose (learning) rust over golang for quite simple projects with no performance requirements, out of sheer frustration with the toolchain/design of go, golang came off to me as "let's try to be special and make bizarre design decisions" which made it confusing to learn, not only that but I very quic…

Strange - my experience was the opposite for Rust. The extreme plethora of String types, the way life time annotations made refactorings very difficult with very high cognitive overhead, no batteries included standard library, even error handling needing external support, string slicing panicking in Rust, async is a mess to debug - Go in contrast is a far more comfortable and consistent developer experience.

Re: Rust needs a web framework

#187
He’s looking for the Rust equivalent of ASP.NET Core and there’s nothing wrong with that.

Sure, some people like choices and tinkering, but in many settings it’s much more productive to have the choices curated for you.

“But what if you want a different X instead? It might be Y% better!” is the typical comment, which ignores that the integration itself provides enormous value. Discrete libraries may be best of breed individually, but may be a heap of garbage if they don’t fit together smoothly.

I love programming in ASP.NET 8 specifically because I never have to think about whether a templating system will play nice with authentication, injection, routing, or anything else.

Re: Rust needs a web framework

#189
post #87
post #10

> I like to make silly things, and I also like to put in minimal effort for those silly things. I also like to make things in Rust… I think this part is perhaps the silliest part of a very silly article. If you really like to put in a minimal effort then why on earth would you use Rust? If you want efficiency, memory management and a compiled modern language just use Go. Then you won’t even need anything but the stan…

I am a fan of Rust for systems programming, but so many people are using Rust for things that are nothing even remotely close to systems programming. So many projects you see being written (or rewritten) in Rust are projects where I just think 'wait, why can't this just have a GC'? And then you look at the code base, and it's all Arc >s, and you can't help at marvel at this, since that's just GC, so what's the benefi…

I think RC and clone are the way people begin to use Rust. While lots of criticism are against this usage for not idiomatic, it should be acceptable. Coming from Python, nodejs or Ruby, even RC and clone or stack based variables is still a magnitude faster than those languages. When it's about absolute control for performance you can drop down a notch to the borrow checker behavior.

Re: Rust needs a web framework

#190

Earlier quoted context omitted.

1. Lots of dead ends. Fetch cache limit for example. Cant replicate prod page caching behaviour in dev. Etc. Many issues with 100 thumbs get abandoned. 2. NodeJS. Not everyone likes it. 3. It is slow. Yes it is! Try to get good web metrics with Next I dare you! 4. Premature release of App Router. Will they do something like that again.

why are you fealung with cache at all in a wrb context? that's what CDNs are for.

React, like Haskell creates new problems you need sophisticated solutions for.

CDN is for content. Useless for say a Google search type problem. So I call an API endpoint for data in my component. But what if I get rendered 600 times? Well luckily I have memoized the call! As long as it was under 2Mb that is.

Post reply on HN