this post was submitted on 06 Jan 2024
710 points (98.9% liked)

Programmer Humor

19551 readers
945 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 29 comments
sorted by: hot top controversial new old
[–] bjoern_tantau@swg-empire.de 132 points 10 months ago (2 children)

How about a federated link aggregator?

[–] pineapplelover@lemm.ee 96 points 10 months ago

Didn't know Lemmy was written in Rust.

Edit: yep, it is https://github.com/LemmyNet/lemmy

Yoo it uses AGPL v3 too. That's pretty cool. Love to see it

[–] ObviouslyNotBanana@lemmy.world 52 points 10 months ago (1 children)
[–] TheGreenGolem@lemmy.dbzer0.com 30 points 10 months ago (2 children)

It can be definitely done. I think it shouldn't be too hard to optimize for scale, should it?

[–] rickyrigatoni@lemm.ee 17 points 10 months ago

just add more ram

[–] ObviouslyNotBanana@lemmy.world 10 points 10 months ago (1 children)

Lets just not think about it!

[–] jcg@halubilo.social 4 points 10 months ago

It's probably only ever gonna be used by like, what, a hundred people at most at any given time?

[–] 0x4E4F@sh.itjust.works 32 points 10 months ago

Well, that escalated rather quickly.

[–] sirico@feddit.uk 30 points 10 months ago

Let me on the Linux kernel irq I can redo the whole thing!

[–] HiddenLayer5@lemmy.ml 26 points 10 months ago* (last edited 10 months ago) (2 children)

For people who don't know, there is already a fully Rust OS: https://www.redox-os.org/

Microkernel too which is pretty cool.

[–] rambling_lunatic@sh.itjust.works 11 points 10 months ago

IIRC the filesystem was literally just a text file.

[–] spez@sh.itjust.works 3 points 10 months ago (2 children)

I have heard about Redox. What's the difference between a microkernel and a kernel? Does redox use the linux kernel? Or has the guy written that in rust too?

[–] dukk@programming.dev 7 points 10 months ago* (last edited 10 months ago) (2 children)

Well, think microkernels as the bare minimum. They give you just enough to write your own OS on top of that: only the bare essentials run in kernel space, whilst everything else runs in user space and has to communicate with the kernel. Compare this to a monolithic kernel, like the Linux kernel: here, the whole operating system is run in kernel space, which means that data doesn’t need to be moved between user and kernel space: this makes the OS faster, but at the cost of modularity. Redox doesn’t use the Linux kernel, it uses its own microkernel written in Rust.

Edit: A good example would be driver. In a microkernel, these run separately from the kernel and interact with it when needed. In a monolithic kernel, these drivers would be included in the kernel itself. They both have their pros and cons: if you’re interested, feel free to look it up.

[–] jcg@halubilo.social 3 points 10 months ago (1 children)

Does that mean on a microkernel you'd essentially have double the amount of code execution for a driver (i.e. driver makes a call to the kernel, kernel verifies and then executes rather than the driver just executing the call) meaning double the latency? Seems like it would cause a lot of problems.

[–] aBundleOfFerrets@sh.itjust.works 3 points 10 months ago

Nowhere near double, the kernel can be extremely sparse on it’s side, but there is a small latency hit

[–] spez@sh.itjust.works 1 points 10 months ago (1 children)

thanks for the explanation! I was thought it had something to do with linux since the lead dev works for System76.

[–] dukk@programming.dev 1 points 10 months ago (1 children)

No problem! Actually, System76 is currently working on rewriting the COSMIC desktop in Rust (or really, just writing a new DE in Rust). It’s a pretty ambitious project that should hopefully get released some time this year. I wouldn’t be surprised if the lead redox dev was working on it too: low-level Rust knowledge is exactly what they need.

[–] spez@sh.itjust.works 1 points 10 months ago

Yeah, I am waiting for a new blog post from them of that.

[–] vrighter@discuss.tchncs.de 3 points 10 months ago

lots and lots more IPC. So lots and lots of context switches. So worse performance

[–] hypnotic_nerd@programming.dev 22 points 10 months ago

Very small projects 😂 after mastering it try building whooping to-do app in rust!

[–] AzureInfinity@leminal.space 18 points 10 months ago* (last edited 10 months ago) (3 children)

This actually wrong way to do it, here the pro way:

1.Start writing a game/app/engine/os.

2.Write dozen utility packages for it.

3.Write high-level packages for #2

4.Write a "light-weight" version of #3 when disgusted with bloat of #3.

5.repeat #2 with more modern rust code.

[–] porgamrer@programming.dev 8 points 10 months ago

you have been looking at my private github repos and are clearly a witch

[–] dejected_warp_core@lemmy.world 1 points 10 months ago

I'm in this picture and I don't like it. Also, you forgot:

1.5 Get completely wrapped around the axle by writing tooling to support said game engine art assets.

[–] Anders429@programming.dev 1 points 10 months ago

Don't forget to upload them all to crates.io. Add them to the list of useless crates that no one will ever use.

[–] rockSlayer@lemmy.world 9 points 10 months ago (1 children)

It's just the natural progression of things

[–] unrelatedkeg@lemmy.sdf.org 1 points 10 months ago

I mean you're not wrong, but it kind of skips a lot of in-between steps.

[–] UnfortunateShort@lemmy.world 3 points 10 months ago

It's a matter of perspective. If the game is Tic-Tac-Toe and the system a basic RISC SOC with open firmware this might be a fun project :P

[–] Aux@lemmy.world 1 points 10 months ago (1 children)

To be fair, a simple operating system project is not that hard to implement.

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

Point in case: Ben Eater recently uploaded a video where his "BIOS" consists of two I/O functions and compiles into less than 250 bytes. Double that if you count his port of WOZMON. We can argue later if that constitutes an operating system - I mean, it's not POSIX compliant but it does operate.

https://www.youtube.com/watch?v=0q6Ujn_zNH8

Edit: watch that space. The venerable MS BASIC is on the way after this.