News for hackers. Stuff that matters.
Re:Candle: Torch Replacement in Rust by unshavedyak on Tuesday August 08, 2023 @11:45AM (#37050788)
It may just be for different people, not sure. I'm a Rust fanatic, i use it for everything, including web dev. We even have a shop full of similar Rust folks.

Personally it's my most productive language, and this is after years in Python, NodeJS, and ~5 years Go.

Which isn't to attempt to invalidate your experience. But i do think:

> writing Rust is a slog where you have to jump through hoops and spend a lot more time thinking about programming language abstractions than thinking about the problem you're solving.

Is quite a leap. A language you describe not speaking natively is, unsurprisingly, difficult for you. Which is a far cry to say it's always that way.

You of course shouldn't be in a rush to rewrite anything unless you see the value in it. I make no claims of that value, either. Rewrite It In Rust (RIIR) is a meme, imo a destructive meme. But i do take issue with labeling any language broadly.

Most languages are pretty good when you're very fluent in them, and while they do have tradeoffs, i don't think Rust's tradeoffs are as you put them.

Re:Candle: Torch Replacement in Rust by tracker1 on Tuesday August 08, 2023 @12:32PM (#37051624)
I'd like to make the jump to FT Rust myself, just don't have enough hands on... and as I get older, motivation to work on more stuff on the side, as well as time, becomes more limited.
Re:Candle: Torch Replacement in Rust by jahewson on Tuesday August 08, 2023 @12:27PM (#37051547)
Rust for web dev instead of Go? I want to believe. What’s the killer app?
Re:Candle: Torch Replacement in Rust by unshavedyak on Tuesday August 08, 2023 @12:40PM (#37051759)
> Rust for web dev instead of Go? I want to believe. What’s the killer app?

No killer app here. We just prefer Rust itself. Go is very capable and a great choice.

For me personally i found Go to spread logic out far too much. Some features of Rust, Iterators for example, massively simplified how i think about data flow. That was my #1 issue with Go. This has side root-causes in Go of course, like no generics to allow for Iterators, etc - but these days Go has generics so it's likely improving. Features around Enums are also huge for me.

I left Go ages ago and it's improved a lot sense then. I still prefer Rust, though.

As i said no judgement on any lang, including Go. This is merely my experience and preferences.

Re:Candle: Torch Replacement in Rust by tracker1 on Tuesday August 08, 2023 @12:43PM (#37051811)
I would say for me, the killer app would be just about anything you might reach for Electron with, but want a much smaller install footprint. Tauri in and of itself is pretty cool, kind of a lighter alternative to electron using native platform browser engine.

In general, I would probably reach for Rust if I needed to do anything wither Web-Assembly (wasm) as the path to working is much nicer than other languages imo. Along those lines, Yew is pretty nice as a rust-like framework.

I've also played with Rocket, and found it very nice and effective for api driven web-apps. Haven't done any templating engines in/with Rocket, however.

Re:Candle: Torch Replacement in Rust by yodelshady on Wednesday August 09, 2023 @07:48AM (#37061257)
Tauri might be cool in theory, but Hello World consumers TWO POINT EIGHT GIGABYTES of hard disk on my machine.

Arguing "Rust has no dev speed penalty" in that context is just... no. You are damaging your own cause there, because all advocacy becomes laughable.

Re:Candle: Torch Replacement in Rust by CryZe on Wednesday August 09, 2023 @08:12AM (#37061465)
> but Hello World consumers TWO POINT EIGHT GIGABYTES of hard disk on my machine.

While yes, that's really bad, it's just temporary build files. The actual executable should be fairly tiny.

Re:Candle: Torch Replacement in Rust by tracker1 on Wednesday August 16, 2023 @01:44PM (#37150767)
So, you built the application, created the installer... and your install on another machine is 2.8GB? I find that hard to believe.

From another response, their Windows installer is under 7mb, and much of that is MSI boilerplate.

https://github.com/lencx/ChatGPT/releases/tag/v1.1.0

Re:Candle: Torch Replacement in Rust by lencx on Friday August 11, 2023 @05:01AM (#37086590)
Tauri is indeed very cool, and also very small (the installation package is typically under 5MB). I used it to build a wrapper application for the ChatGPT official website, extending the site with many interesting features through script injection. However, the compatibility of the system webview across different platforms is a frustrating matter. https://github.com/lencx/ChatGPT
Re:Candle: Torch Replacement in Rust by boredumb on Tuesday August 08, 2023 @12:57PM (#37052075)
I use Tide with great success
Re:Candle: Torch Replacement in Rust by swlkr on Tuesday August 08, 2023 @01:17PM (#37052418)
Dioxus liveview or if you don't want websockets, dioxus fullstack, you can use warp or salvo but axum is good.

Rust embed is also great, I cross compile everything into a single dynamically linked binary and scp to my vps, deployment is a breeze.

Re:Candle: Torch Replacement in Rust by eyegor on Tuesday August 08, 2023 @01:35PM (#37052701)
Yew is pretty well loved, but I haven't had a chance to do much beyond toy projects with it.

https://yew.rs/

https://github.com/yewstack/yew

Re:Candle: Torch Replacement in Rust by nextaccountic on Tuesday August 08, 2023 @01:50PM (#37052893)
On the backend it's probably axum and tokio

https://github.com/tokio-rs/axum https://tokio.rs/tokio/tutorial

Re:Candle: Torch Replacement in Rust by adamnemecek on Tuesday August 08, 2023 @04:48PM (#37055247)
There are front end Rust frameworks that work via wasm.
Re:Candle: Torch Replacement in Rust by orangetuba on Tuesday August 08, 2023 @03:07PM (#37053977)
So if you take a Python program and you add the mental effort of having to deal with static types, lifetimes, the borrow checker and performance considerations, and this added mental effort actually allows you to write the program faster?

That is incredible. It's like being able to carve- and install a door from a slab of wood faster than installing a prefabricated door.

Re:Candle: Torch Replacement in Rust by remexre on Tuesday August 08, 2023 @03:14PM (#37054081)
Having types lets you get better editor completion and such; I'd say Rust pushes you into bottom-up design, which I find significantly more productive than top-down too; doing bottom-up design is much trickier in a dynamic language, though, because changes to one of your "bottom layers" break upper layers in a way that the compiler/interpreter can't see
Re:Candle: Torch Replacement in Rust by theLiminator on Tuesday August 08, 2023 @03:20PM (#37054151)
Depends, maybe time to first run is lower in python, but time to a robust/quality solution could be a very different story.
Re:Candle: Torch Replacement in Rust by mkehrt on Tuesday August 08, 2023 @04:18PM (#37054912)
This line of reasoning is utterly alien to me. If your types add mental overhead, you’re doing something wrong. You should be able to rely on the typechecker to check invariants for you, decreasing mental overhead. You have to think about types anyway, especially in an untyped language, where you can’t rely on the typechecker.
Re:Candle: Torch Replacement in Rust by infamouscow on Tuesday August 08, 2023 @07:47PM (#37056982)
The leap from thinking about your program with inheritance to thinking about your program with traits is large and cannot be overstated.

It's one of the reasons why Python developers don't like working in Ruby, for example.

Re:Candle: Torch Replacement in Rust by jaredklewis on Tuesday August 08, 2023 @05:18PM (#37055591)
I code faster in types languages. I find typed code easier to read and understand. A lot of writing new code is just reading and understanding existing code.

So the claim doesn’t sound so crazy to me. For me at least, types remove mental overhead, they don’t add to it. I can’t count the times I’ve been reading through untyped (or inaccurately typed) python code and have had to jump a dozen levels deep just trying to figure out if a function can or cannot return null.

Re:Candle: Torch Replacement in Rust by stouset on Tuesday August 08, 2023 @05:26PM (#37055687)
Ongoing maintenance and feature development on top of an existing code base is easily 10x the amount of time and effort of starting a new project greenfield. Even modest improvements in long-term readability and maintainability have disproportionately beneficial effects, even if the initial cost is somewhat high.

In my personal experience, once you're proficient in Rust, the initial cost is not somewhat high because those improvements in your ability to reason about your code base start snowballing quickly. And the long-term effects are enormous. I have literally picked up a project I hadn't worked on in years, made sweeping changes to the internals, and had every test pass in a pretty comprehensive suite the very first time it compiled.