this post was submitted on 28 Dec 2025
529 points (93.3% liked)

Fediverse memes

3046 readers
302 users here now

Memes about the Fediverse.

Rules

General
  1. Be respectful
  2. Post on topic
  3. No bigotry or hate speech
  4. Memes should not be personal attacks towards other users
  5. We are not YPTB. If you have a problem with the way an instance or community is run, then take it up over at !yepowertrippinbastards@lemmy.dbzer0.com.
    • Addendum: Yes we know that you think ml/hexbear/grad are tankies and or .world are a bunch of liberals but it gets old quickly. Try and come up with new material.
  6. This is not the place to start flamewars between Lemmy, Mbin and Piefed.

Elsewhere in the Fediverse

Other relevant communities:

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] TheTechnician27@lemmy.world 31 points 2 months ago* (last edited 2 months ago) (5 children)

Notice how the OP specifically said well-known and widely used.

I did notice. If Rust isn't "widely used", then I'll need to let Apple, Microsoft, Google, Amazon, Mozilla, Huawei, Meta, the Linux kernel devs, and a fuckload of open-source projects know that they actually don't exist.

It's plently widely used, and unlike ~~a scripting language~~ (edit: Python), it's performant – as server software should be. Rust is not a hard language to use or learn either, and it's great for large projects.

[–] r4venw@sh.itjust.works 14 points 2 months ago (1 children)

While I agree with the general sentiment, scripting languages are perfectly fine to use for server software. Would you call hackernews slow? Its been running on lisp (originally Arc, now common lisp) for its entire existence. Another fun example of popular interpreter is, y'know, the JVM.

[–] SlurpingPus@lemmy.world 4 points 2 months ago* (last edited 2 months ago) (1 children)

Common Lisp could be compiled, so not the best example.

Lua is a way better example, since Lua scripts often finish in the time it takes Python to get going at all. And that's with interpreted Lua, without JIT. I once straight up had to recheck if I left the dummy static output in there instead of calling my script, because the result was appearing instantly.

There's also Fennel, a Lisp compiled to Lua on the fly. Since Lua is so snappy, the compilation overhead is unnoticeable.

[–] rimu@piefed.social 7 points 2 months ago* (last edited 2 months ago) (2 children)

Performance is an attractive metric because it's something you can put a number on. It's measurable, so comparisons are easy.

But there are so many other metrics that are more important.

Still, https://leafo.net/lapis/ looks like something I'd like to try sometime. I don't know anything about the Lua web framework ecosystem, that's just the first search result I found. Do you have any recommendations?

[–] SlurpingPus@lemmy.world 2 points 2 months ago* (last edited 2 months ago)

I'm more familiar with Lua for desktop scripting — I'm using it whenever I can, if it's something that's more than like three lines in Bash and the Lua libraries aren't too bad. I'm even using it on the phone when dragging around blocks in Automate becomes too much (its minuscule footprint comes handy there). There's also the excellent automation app Hammerspoon for Mac, which uses Lua for its scripting.

I've been vaguely looking now and then into using it for web in the manner of node.js, with asynchrony being handled on the Lua side — but was offput by the fact that many popular Luarocks libraries presumed synchronous workings, and async requires installing different libs if they even exist. Node has it better since the libs were developed to be async from the start. Iirc Luvit is what I was looking at, there are both libs and some kinda frameworks for it.

OpenResty and frameworks for it like Lapis could be the better way to go. Nginx is pretty much mandatory anyway, and afaiu synchronous libs can be used then, leaving it to Nginx to chuck requests into multiple Lua threads. A drawback is that LuaJIT, used in Resty, still supports only Lua 5.1 features, which is pretty damn old.

I haven't looked into Lua for web in a few years, but since apparently nothing like Hammerspoon with its built-in http server exists for Linux, I'll need to pick it up again, just to do some custom remote control from the phone.

[–] irelephant@anarchist.nexus 1 points 2 months ago (1 children)

I'm a big fan of lapis. It's built on openresty, a fork of nginx that embeds luajit into it. This means you can make use of all the features nginx has in your application. It's really fast in my experience.

I have a medium-ish project written in lapis here: https://codeberg.org/irelephant/kittygram

There isn't really much of an ecosystem around lua, lapis is really the only "proper" framework. There is stuff like redbean and mako which are cool, but not as complete/friendly to use as lapis imo.
Luarocks can be a bit of a pain as well (make sure to install packages for lua 5.1).

Lapis is made by the same person who made itch.io too, which i think it cool.

[–] rimu@piefed.social 2 points 2 months ago

Great to see a real app built with it. It reminds me of Flask a lot, although I guess all mvc frameworks are pretty similar.

I would be surprised if you'd argue that more devs can write Rust than Python.

Web servers spent most of their time with IO, because the real work is mostly done by the DB. That's why especially Node is very fast and influential design wise. But PHP, Ruby and Python are all very popular and valid choices for web servers. In the end, if you need real performance you have to scale horizontally anyways. And the small gains you make in a compiled language matter even less.

[–] RollForInitiative@feddit.org 7 points 2 months ago (1 children)

Coming from a Python and Java background Rust is way harder to learn. Don't get me wrong, i like Rust, but it feels way harder. But i agree that its great for large projects and performance-wise!

[–] OpenStars@piefed.social 5 points 2 months ago (1 children)
[–] RollForInitiative@feddit.org 2 points 2 months ago

The author makes some good points, interesting read. Thanks for the link.

[–] davidagain@lemmy.world 4 points 2 months ago (1 children)

Rust is not a hard language to use or learn

Rust is a superb language, but it is famously not easy to learn.

[–] IMALlama@lemmy.world 1 points 2 months ago (1 children)

I dunno, my first functional programming language really through me through a loop. I am starting my first Rust project and so far it doesn't look to be that horrible.

[–] davidagain@lemmy.world 2 points 2 months ago (1 children)

Functional programming is very different in how you get stuff done.

I would recommend learning Elm first for functional programming before trying anything hairier like Haskell etc.

Elm is a small and lovely language for writing web pages/sites/user interfaces, and has a blisteringly fast compiler that is also the most genuinely helpful of all the compilers I've ever used.

It's a blissfully stable antidote to JavaScript's exhausting "that whole approach is so last month" churn.

[–] IMALlama@lemmy.world 2 points 2 months ago (1 children)

Thanks for the suggestion! I will take a look once I make some more progress on my rust project. Time is tight these days, so I need to limit the quantity of things I attempt to do in parallel.

[–] davidagain@lemmy.world 2 points 2 months ago

Good plan. One paradigm shift at time! All the best with the rust project.