Live data from Hacker News

Rust needs a web framework

ntietz.com

111–120 of 395 posts

Re: Rust needs a web framework

#111
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…

Because performance is a thing?

Because you like the Rust ecosystem?

Because you enjoy developing in Rust?

Re: Rust needs a web framework

#112
post #90

Earlier quoted context omitted.

> 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…

> 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 someone inexperienced? I think you're reading too much into that and creating conflict where there isn't any. GP just meant that they had a bunch of interpreted language OOP developers (probably Java or C# or something like that), and they wanted them to start writ…

(Also not the point, C# can be AOT-compiled as well these days)

Re: Rust needs a web framework

#113

Earlier quoted context omitted.

This is definetly something the article should have drilled down on. Why Rust? I'm sure everyone's tired of hearing why rust is an excellent alternative to c/c++ for new projects, but as an alternative against Python it gets muddier. Rust has a clear advantage in performance and memory footprint and a much better multithreading story, but those are things that aren't high priorities for 95% of web development. That b…

The answer for why folks are so inclined towards doing high-level tasks in Rust... is the type system. Its sensibilities are in a sweet spot that makes it very easy to pull off huge refactors. It was also a lot of people's first introduction to algebraic data types being used in nearly all error handling (its usage of `Result where E implements Error` and lack of nulls or exceptions). It makes a lot of progress towar…

People who say copilot is useless.... I can only imagine they're in a dynamically typed language. Copilot + Rust makes boilerplate go fast. Strong typing is force multiplier for code gen.

Re: Rust needs a web framework

#114
post #92

Earlier quoted context omitted.

> force you to do memory management This is not my experience at all. I never think about memory management when I'm writing Rust, let alone am I "doing it" (active voice). Your second comment is a very weird sentence that is very difficult for me to grok.

> I never think about memory management when I'm writing Rust, let alone am I "doing it" (active voice). Worrying about lifetimes is memory management that is unnecessary with GC languages and directly increases cognitive load. My second paragraph is pointing out that "where I can open something like Notepad without an LSP or highlighting" is a strange qualifier. Why does it matter if you don't have semantic analysis…

> Worrying about lifetimes is memory management that is unnecessary with GC languages and directly increases cognitive load.

As soon as you start writing large enough programs to start to learn/worry about variable scoping you are kind of "worrying about lifetimes though. If you know that using global variable is often a bad idea, then you are, in some sense, worrying about lifetimes.

I first learned this in the mid/late 90s as my Perl4 cgi scripts started to grow beyond about a screens worth of lines, and it really solidified into an almost unconscious background task as I wrote code once I started writing a lot of Perl5 apache mod_perl stuff a few years later.

These days, I find myself experiencing slight cognitive dissonance writing tiny Arduino sketches with a bunch of global vars declared right up the top.

Re: Rust needs a web framework

#115

Earlier quoted context omitted.

> TypeScript has an equally powerful type system. How does TypeScript's type system prevent shared mutable state?

When did threading get added to JavaScript? And does Rust have type unions and intersections, interfaces, and mapped and conditional types?

> When did threading get added to JavaScript?

Shared mutable state is a problem even in single threaded code (for example, modifying a collection you're iterating over)

> And does Rust have type unions and intersections, interfaces, and mapped and conditional types?

You can typically accomplish the same thing with enums/proc macros/traits of course—with the additional benefit that the type system is designed to be sound. Soundness is an explicit non-goal of TypeScript[1], so once you start layering on those kinds of overly-clever types, you soon reach a point where you're just lulling yourself into a false sense of security.

[1]: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Desi...

Re: Rust needs a web framework

#116

If you want to make a silly, minimal effort hobby project simply don't use Rust. I'm gonna be honest I don't understand this entire genre of using extremely complex, highly optimized systems languages for tools that don't need them. Your flow chart should basically go like this: "Do I need zero cost abstractions because I'm writing a computationally expensive very serious project?" If the answer is no use a garbage c…

> minimal effort hobby project

Sorry, just spent 6 hours figuring setting up my python environment. Ready to start my hobby project now!

Re: Rust needs a web framework

#117

"Right tool for the right job," no? Learn multiple languages. The whole "I want to do everything in the language I already know" is why the least interesting--and straight-up pretty terrible albeit very capable--languages are dominating our field.

But surely "making silly things" in Rust counts as learning Rust?

I remember writing a 2.5D "Doom style" renderer thing that let you move around in a bunch of rooms/corridors in real time in MacPerl/Quickdraw back in the Mac OS9 and Perl4 days. Probably taught me more about Perl than I'd learn in several years doing it for a job.

Re: Rust needs a web framework

#118
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 feel like my Rust code takes 3x as long to write as my Python code, but the gpt results for rust are about 10x better, because the tooling is a backstop against hallucinations.

I really like the Rust tooling and I like exhaustive pattern matching. Python post-dev debugging time is probably 10x vs Rust. That's why I choose Rust.

Re: Rust needs a web framework

#119

Earlier quoted context omitted.

What kind of logic is this... The Rust language is quite rigorous, so web frameworks on it should also be equally laborious to work with? You have to roll your own authentication, you have to do your own routing, you have to do ad-hoc string manipulation instead of templates?... The person likes writing in Rust, and would like to have a batteries-included web framework so they can tie together a web app quickly on th…

If you find the language rigorous, a web framework can't magically do away with that. It's genuinely illogical to believe so. There are plenty of web frameworks on Rust that are quite nice to use, but they are still Rust, with all its shortcomings in the same way Django is still Python with all its shortcomings. What you're asking for is a DSL built on top of Rust for the purpose of creating web apps.

Rigorous isn’t the same thing as tedious?

Re: Rust needs a web framework

#120

Earlier quoted context omitted.

The answer for why folks are so inclined towards doing high-level tasks in Rust... is the type system. Its sensibilities are in a sweet spot that makes it very easy to pull off huge refactors. It was also a lot of people's first introduction to algebraic data types being used in nearly all error handling (its usage of `Result where E implements Error` and lack of nulls or exceptions). It makes a lot of progress towar…

>Result where E implements Error` and lack of nulls or exceptions This all goes out the window when people throw “unwrap” all over the place because “this should always succeed”.

In any program there are errors you can handle and errors you can't, errors whose vary existence suggests something has gone horribly wrong. What else should you do in that situation but panic?
Post reply on HN