setsubyou

joined 2 years ago
[–] setsubyou@lemmy.world 1 points 42 minutes ago

Yeah anything not too complex will work. We had to implement a PIC simulator in university, I thought that was a great exercise too.

Although 6502 actually was my first assembly language.

[–] setsubyou@lemmy.world 10 points 2 hours ago (2 children)

Tbh I think teaching 6502 assembly would be a great idea. You can learn the basics of how computers work without having to deal with all the complexity of a computer from 2026.

[–] setsubyou@lemmy.world 46 points 22 hours ago

The interview appeared to be one of the most extensive conservations Trump has had with journalists on his health

Heh.

[–] setsubyou@lemmy.world 1 points 2 days ago

I have written code this holiday, but I was afk on vacation for a month in November. That was a good reset too. But tbh I like programming, the reset is more for the other circumstances of my work.

[–] setsubyou@lemmy.world 2 points 2 days ago

I was surprised how many of these I’ve actually done at some point in the last 35 years.

[–] setsubyou@lemmy.world 3 points 3 days ago

scopeguard would be one way to get defer in Rust

[–] setsubyou@lemmy.world 4 points 3 days ago (2 children)

In Rust you’re kind of stuck with it, but at the end of the day combined return types are just syntactic sugar for something a lot of languages can do. Even in plain old C there’s a pattern where you pass pointers to your return and/or error variables. In many languages you can return structs or similar. In some I’d argue it looks nicer than having to write Result<>, e.g. in Python or in Swift you can just return a tuple by putting things in parentheses. (Of course you can also still use something more explicit too. But if every function returned (result, error) by default and every call was like result, error = fn(), I don’t think it’d be necessary.)

However I don’t really know of any language where people prefer to use this over exceptions if exceptions are available. Even in C some people used to use setjmp/longjmp in macros to implement exceptions. Exceptions have their problems but people seem to overwhelmingly be in favor of them.

Personally I like exceptions in languages that have some kind of built-in “finally” for functions. For example defer in Swift. You can have proper error handling for a lot less typing in many cases because passing through exceptions is fine if your defer blocks handle the cleanup. And if you do want to handle an exception, Swift also has optionals, and a try? that transparently converts a return value into an optional that’s nil when an exception was thrown, and a coalescing operator ??, which means you can catch exceptions and provide a default value on one line, instead of a 4-5 line try..catch/except block or an error checking conditional for every call.

[–] setsubyou@lemmy.world 6 points 3 days ago

Well that’s true too. As humans we should generally aim to be more cylindrical than spherical.

[–] setsubyou@lemmy.world 4 points 3 days ago

It would have been crazy in the CRT age and maybe the early LCD age. But then we got screens that require significant electronics to even be able to show an image, built into smart internet-connected TV’s which sometimes also have microphones and cameras built in. At the same time we also kind of dropped actual TV, and switched to streaming, where the streaming provider automatically and necessarily knows exactly what you watch, when you’re awake, what languages you speak, and so on.

Which IMHO makes it even more crazy to say it. Like why would a sane person say any of this is secret.

[–] setsubyou@lemmy.world 19 points 3 days ago (4 children)

Well politicians doing politics isn’t getting us anywhere so I’m open to alternatives

[–] setsubyou@lemmy.world 3 points 1 week ago* (last edited 1 week ago)

The video conferencing platform my work uses works well because it’s a large well-known platform and they punched holes for it into the firewall and the vpn. Not really something a service provider can just replicate.

[–] setsubyou@lemmy.world 3 points 1 week ago

But bara roligt is Swedish

view more: next ›