this post was submitted on 16 Feb 2025
285 points (93.6% liked)

Technology

70268 readers
3772 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] adespoton@lemmy.ca 85 points 3 months ago (2 children)

JavaScript has its place as a lightweight runtime interpreter.

Rust has its place as a secure and modern way to engineer and produce dependable software.

[–] sugar_in_your_tea@sh.itjust.works 15 points 3 months ago

Eh, it's not that lightweight, Lua is much better for that.

[–] jimmy90@lemmy.world 13 points 3 months ago (1 children)

with wasm and friendly new web frameworks, the only thing keeping js alive is inertia

[–] adespoton@lemmy.ca 8 points 3 months ago

Essentially, JS is the new Flash….

[–] solrize@lemmy.world 64 points 3 months ago* (last edited 3 months ago) (7 children)

The JS tooling universe has always seemed like a Lovecraftian hellscape to me. I've managed to stay away from it so far, but if I were caught in it, of course I'd be trying to escape any way I could. It sounds like Rust's attraction here has been as a viable escape corridor rather than anything about Rust per se.

In particular, I get that everyone wants their code to be faster, and I get that certain bloaty apps (browsers) need to get their memory footprint under control, and a few niche areas (OS kernels, realtime control) can't stand GC pauses. Other than that though, what is the attraction of Rust for stuff like tooling? As opposed to a (maybe hypothetical) compiled, GC'd language with a good type system and not too much abstraction inversion (Haskell's weakness, more or less).

Has Golang fizzled? It has struck me as too primitive, but basically on the right track.

Rust seems neat from a language geek perspective, but from what I can tell, it requires considerable effort from the programmer handle a problem (manual storage reclamation) that most programs don't really have. I do want to try it sometime. So the Rust question is intended as more inquisitive/head scratching rather than argumentative.

[–] asdfasdfasdf@lemmy.world 20 points 3 months ago* (last edited 3 months ago) (1 children)
  1. Rust is the best language for writing WASM in, so you can write Rust and run it in the browser without transpiling to JS.
  2. Rust isn't just about speed or GC pauses. Its type system is amazing and allows you to encode things that you cannot in any other mainstream language.
  3. It's so incredibly well designed, it fewla like that clip from Ricky and Morty where Morty feels what standing on a truly even plane feels like then has a panic attack when he leaves. Rust rethought everything from scratch, and isn't just some new syntax or fancy compiler tricks. No null, no exceptions, no inheritance, new typing capabilities, etc.

Go made some pretty poor design choices, and now even Google is choosing Rust for a lot of stuff instead.

[–] solrize@lemmy.world 3 points 3 months ago* (last edited 3 months ago) (1 children)

Thanks, and interesting point about Wasm if that is important. You can also compile C++ to wasm but then its C++ ;). I don't know about Ada to Wasm.

I don't think Rust is quite mainstream yet either. My impression is that its type system has not caught up with Haskell's except in a few areas, but of course nobody pretends Haskell is mainstream. I haven't yet tried Idris.

Golang seems to have a decent runtime model (lightweight threads, GC) though the language itself is underpowered. There is a Golang backend for Purescript that sounded interesting to me. The thing that turned me off the most about Purescript was the JS tooling. Purescript (purescript.org) is/was a Haskell-like language that transpiles to JS, intended for use in browsers, but Typescript filled this space before Purescript got much traction. That felt unfortunate to me.

I don't think HLL (high level language) has an official definition, but informally to me it has generally meant that the language is GC'd and that the native integer type is unbounded (bignum). By that standard, Rust and Ada are low level. I've so far thought of Rust as a modernized Ada with curly braces and more control of dynamic memory reclamation. Maybe there is more going on than that. Ada is still ahead of Rust in some ways, like generic packages, but Rust is working on that.

If you have a suggestion of a no-nonsense Rust book, I'd be interested in looking at it. https://doc.rust-lang.org/book/ beat around the bush way too long before discussing the language, but I guess I should spend more time with it.

[–] asdfasdfasdf@lemmy.world 10 points 3 months ago* (last edited 3 months ago) (5 children)

I'd say Rust is definitely mainstream. Obviously not the level of JS or Python, but it's being used all over the place. All FAANG companies, the Linux kernel, JS runtimes, web browsers, Android, Signal, Mullvad...

IMO GC has nothing to do with high or low level. It's just incidental that there's a correlation. In GC you usually don't need to think about manually allocating or deallocating memory or truly understand what pointers are (in some ways anyway). In C / C++ you do.

In Rust you almost never manually allocate or deallocate, and you have both very high and low level APIs.

I'd say Rust is both high and low level. It just depends what you use it for. If you want to build a CLI or a web server, it's great for that. If you want to do kernel stuff and choose to flip bits around you can do that too.

As for books, maybe you'd like trying Rustlings instead.

load more comments (5 replies)
[–] qaz@lemmy.world 15 points 3 months ago (1 children)

I usually pick Rust for CLI tools because:

  1. It's statically compiled and isn't dependent on system binaries and won't break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps
  2. Still produces fairly small binaries unlike languages like Java or C# (because of the VM)
  3. Is a modern language with a good build system (It's like night and day compared to CMake)
  4. And I just like how the language works (errors as values etc.)
[–] Dark_Arc@social.packetloss.gg 7 points 3 months ago (5 children)
  1. It's statically compiled and isn't dependent on system binaries and won't break if there if the system has the wrong version like C/C++, allowing you to distribute it as a single binary without any other installation steps

You can do that with C++ too.

  1. Still produces fairly small binaries unlike languages like Java or C# (because of the VM)

I mean, the jars are actually pretty small; but also I really don't get the storage argument. I mean we live in a world where people happily download a 600 MB discord client.

  1. Is a modern language with a good build system (It's like night and day compared to CMake)

Meson exists ... as do others.

  1. And I just like how the language works (errors as values etc.)

Fair enough; though why? What's wrong with exceptions?

I work in a code base where I can't use exceptions because certain customers can't use exceptions, and I regularly wish I could because errors as values is so tedious.

load more comments (5 replies)
[–] Tanoh@lemmy.world 11 points 3 months ago (6 children)

Has Golang fizzled? It has struck me as too primitive, but basically on the right track.

My biggest issue with Golang by far is the close tie to Google. They are not our friendly innovator, time and time again they make decisions that will help them earn more ad money, and nothing else. And they have a lobg history of releasing something and then never fix the issues with it, and then more or less abandon it.

Other than that there are afaik some other issues with go, I'm not an expert but from what I hear the GC is quite aggressive and you can't tell it to run when you want. Doing something time sensitive? Well, bad luck. GC time!

[–] 0x0@programming.dev 4 points 3 months ago

the close tie to Google.

Guess who's one of the rounders of the Rust Foundation...

[–] solrize@lemmy.world 3 points 3 months ago

True about Google ;). Yes, there are programs that really don't want GC. I consider those to mostly be niche applications since most of us are fine with using e.g. Python, which has automatic storage management (won't quibble about whether it is GC per se) that has occasional pauses. SImilarly, tons of important programs are written in Java, which is GC'd. Of course Java is tied up with Oracle just like Go is tied up with Google.

Go's main problem from what I can tell is that the language itself is too old fashioned. I've used it but am not expert. It feels like an improved version of C, rather than a modern, type-safe language.

load more comments (4 replies)
[–] Glitchvid@lemmy.world 10 points 3 months ago (1 children)

Maybe give it a try; it's my favorite language to write programs in now, it has an extremely good standard library, and for everything else there's a mass of high quality crates, its build system is actually competent and makes compiling on Windows or Linux trivial, plus many, many more quality of life features.

[–] solrize@lemmy.world 3 points 3 months ago (5 children)

Yes it's on my infinite todo list. I'm just being too much of a curmudgeon about the available textbooks, and had a sinking feeling when the main one didn't get "hello world" out of the way on page 1, and shift to the specifics of the language.

[–] Glitchvid@lemmy.world 5 points 3 months ago (1 children)

Rust By Example is very good for showing the ropes in a very practical way, that's how I got up and running with it.

Secondly is the O’Reilly book Programming Rust, which is probably closer to what you want, it explains the actual technical details of much of the language, and to me seems written for an audience that already knows programming. Lastly would be Rust for Rustaceans by No Starch Press, if you actually do want to pursue Rust further, as it discusses very, very in detail the systems of the language, and how they can be used to make something so powerful like Serde.

[–] solrize@lemmy.world 3 points 3 months ago

Thanks, Rust by Example looks ok, and I'm acquainted with one of Programming Rust's authors, which is cool. I'm currently looking at "Comprehensive Rust". All these though seem to be about the Rust software ecosystem (compilers, package tools, libraries) as much as they are about the language. I had hoped to start by just reading about the language, if something like that exists. I don't particularly want to write any Rust programs until I've finished reading some kind of language overview, which means that all the stuff about build tools are just a distraction during that stage. As another commenter in this thread said though, ecosystems and languages have become pretty much inseparable, so maybe that's why the books are that way.

This also looks interesting:

https://dr-knz.net/rust-for-functional-programmers.html

This says nothing about Rust, but it's a humorous classic. I'd be interested to know how to describe Rust in these terms.

https://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html

load more comments (4 replies)
[–] sugar_in_your_tea@sh.itjust.works 9 points 3 months ago (1 children)

Go is fine, but it has its flaws. I prefer Rust because:

  • memory safety is a compiler check, not a runtime check, so you catch issues earlier
  • locks contain their values, so you can't accidentally do anything unsafe
  • no nil (() is semantically different), so no surprises with contracts
  • everything is an expression, which lends itself really well to FP concepts
  • actual dependency management at 1.0
  • pretty much no runtime, so calling from another language is super easy
  • targets WASM and microcontrollers
  • no pointers (not exactly true)

It takes longer to learn, but I'm about as productive with both now.

load more comments (1 replies)
[–] rottingleaf@lemmy.world 7 points 3 months ago

The JS tooling universe has always seemed like a Lovecraftian hellscape to me.

That's most of any programming of today for me.

If it can't be grasped in a couple of days - then na-ah.

I can patch something I need working which doesn't, written in C.

autotools ftw

[–] ICastFist@programming.dev 33 points 3 months ago (3 children)

Can we please go back to making programs for the target OS and skip the browser dependency?

[–] JackbyDev@programming.dev 28 points 3 months ago (1 children)
[–] curry@programming.dev 7 points 3 months ago

[Screams internally]

[–] terminhell@lemmy.dbzer0.com 15 points 3 months ago

Browsers have almost become the OS. At least in user land.

load more comments (1 replies)
[–] ColdWater@lemmy.ca 23 points 3 months ago (1 children)
[–] sugar_in_your_tea@sh.itjust.works 20 points 3 months ago (1 children)

Everything eventually becomes a crab.

[–] Kolanaki@pawb.social 13 points 3 months ago (2 children)

That means eventually everything tastes great when smothered in butter. 🤤

[–] msage@programming.dev 3 points 3 months ago

Eventually?

load more comments (1 replies)
[–] call_me_xale@lemmy.zip 21 points 3 months ago
[–] Diplomjodler3@lemmy.world 13 points 3 months ago

Guten Appetit!

[–] whereisk@lemmy.world 11 points 3 months ago (2 children)

Is this a 2yo write up, considering the last update was in 2023?

[–] mostlikelyaperson@lemmy.world 6 points 3 months ago

Originally 4 years old at this point it looks like, and the great shift to wasm has failed to manifest.

load more comments (1 replies)
[–] Venator@lemmy.nz 10 points 3 months ago* (last edited 3 months ago) (1 children)

Can browsers run rust in the front end instead of javascript, or is it limited to build time and backend stuff?

[–] sushibowl@feddit.nl 16 points 3 months ago (1 children)

Sort of, browsers can run rust code through webassembly. But i dont think this is a full replacement for JavaScript as of yet.

[–] sugar_in_your_tea@sh.itjust.works 5 points 3 months ago (1 children)

Yeah, you need to have some JS to manipulate graphics, so the Rust web frameworks have a JS shim to do that and communicate with the WebAssembly Rust code as necessary. It works surprisingly well tho.

load more comments (1 replies)
[–] commander@lemmings.world 6 points 3 months ago

Good!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

[–] victorz@lemmy.world 6 points 3 months ago

Can I just say how beautiful that page is? Such a delight to read the text on it. The legibility. The simplicity. 😙👌

[–] HubertManne@moist.catsweat.com 3 points 3 months ago (1 children)
[–] sugar_in_your_tea@sh.itjust.works 7 points 3 months ago (2 children)

No, Groovy is JVM, not JavaScript.

load more comments (2 replies)
[–] mesamunefire@piefed.social 3 points 3 months ago (2 children)

I thought python has kinda exploded lately...

load more comments (2 replies)
load more comments
view more: next ›