[-] dukk@programming.dev 7 points 2 years ago

Honestly, this is why I’m hoping the Vsuon Pro doesn't flop. It really feels like it could open the door to a new era. Of course, that’s still years away, but you’ve got to start somewhere. Better now than never.

[-] dukk@programming.dev 6 points 2 years ago

I mean, there’s probably some workaround involving faking the microphone, right?

[-] dukk@programming.dev 7 points 2 years ago* (last edited 2 years ago)

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.

[-] dukk@programming.dev 7 points 2 years ago* (last edited 2 years ago)

I’ll point to how many functional languages handle it. You create a type Maybe a, where a can be whatever type you wish. The maybe type can either be Just x or Nothing, where x is a value of type a (usually the result). You can’t access the x value through Maybe: if you want to get the value inside the Maybe, you’ll have to handle both a case where we have a value(Just x) and don’t(Nothing). Alternatively, you could just pass this value through, “assuming” you have a value throughout, and return the result in another Maybe, where you’ll either return the result through a Just or a Nothing. These are just some ways we can use Maybe types to completely replace nulls. The biggest benefit is that it forces you to handle the case where Maybe is Nothing: with null, it’s easy to forget. Even in languages like Zig, the Maybe type is present, just hiding under a different guise.

If this explanation didn’t really make sense, that’s fine, perhaps the Rust Book can explain it better. If you’re willing to get your hands dirty with a little bit of Rust, I find this guide to also be quite nice.

TLDR: The Maybe monad is a much better alternative to nulls.

[-] dukk@programming.dev 7 points 2 years ago

Love it. Plot’s already more interesting than any recent movie I’ve watched.

[-] dukk@programming.dev 7 points 2 years ago

If there’s anything I’ve learned, some open source genius hacker will figure it out, publish an early demo with 99% of features, and then disappear off the face of the planet before they ever make it available.

[-] dukk@programming.dev 7 points 2 years ago

laughs harder in nushell

[-] dukk@programming.dev 7 points 2 years ago* (last edited 2 years ago)

Python: What if everything was indented?

Haskell: What if everything was formally proven?

Java: What if everything was stupidly verbose?

JSON: What if everything was JSON?

[-] dukk@programming.dev 6 points 2 years ago

Or just use only one layer.

[-] dukk@programming.dev 7 points 3 years ago

I mean you’re right, but I’ve never met anyone who thinks that way. C++ is everywhere (although C++ itself is just a hot mess of a language imo).

[-] dukk@programming.dev 7 points 3 years ago

Remember kids, always use protected branches.

[-] dukk@programming.dev 7 points 3 years ago

man, you need man

view more: ‹ prev next ›

dukk

0 post score
0 comment score
joined 3 years ago