Better HN
topnewbestaskshowjobs
Log inSign up

codeflo

9,664 karma · joined Jun 14, 2010 (16y ago) · 1,504 submissions

Submissions

comment 4y ago · link · parent

While I agree it's probably not worth getting angry about, I would agree with the GP that the word "systems programming" traditionally has a meaning that's different from "programming things that might be called systems". What you're describing is often more simply called "backend programming".

comment 4y ago · link · parent

When the actual machine code is generated is irrelevant to the level of abstraction. There have been JIT compilers for C, and ahead-of-time compilers for C# and Java, and that changes nothing about how close to the metal any of them are.

Memory layout is a valid point though. C# with its value types gives you a lot more control than Java does, but is still often grouped with Java, and I think rightly so. Go's pointers go quite a bit further, but then on the other hand, it also has high-level data structures like map as language primitives, which makes it less close to the metal as far as I'm concerned.

I'd personally group all GC'd languages in roughly the same class here, but I think it's reasonable to disagree or make finer distinctions.

comment 4y ago · link · parent

Maybe it's a regional thing, but I don't know anyone who calls that "systems programming". I'd personally use the term "backend programming".

comment 4y ago · link · parent

Tuples are a great example that I might not have thought of -- you practically "define" your own value types all the time. Also, all enum types are value types. And there are lots and lots of very commonly used value types in the base class library: DateTime, TimeSpan, Guid, CancellationToken. Programmers have to be familiar with their semantics.

comment 4y ago · link · parent

That's about right in aggregate, though some of the specifics go either way. I have two theories why so many people are convinced that Go is much lower level than it actually is, and I'm not sure which one is true:

a) Go was really sold as a "systems programming language" early on. Maybe some adopters never really questioned what that means or if that's true?

b) Go produces actual executables, with what in Java would be the JIT executed ahead of time and any runtime bits statically linked in. That is completely orthogonal to abstraction level, of course. But maybe the fact the there's no externally visible runtime makes people group the language into a bucket with C?

comment 4y ago · link · parent

I’m confused about the “BOM” part as well. It’s clearly not a byte order mark, and explicitly states that it’s not a bill of materials.

comment 4y ago · link · parent

Good design is often subtle and easy to dismiss, especially for smart engineers. You might remember the "What's the deal? It's just mastermind with letters" comments here and elsewhere. I agree with the article that Wordle got many little things right, and I think that's a huge part of its success.

I wonder how long it will stay that way under NY Times ownership. Just today, I was greeted with a new cookie prompt that covered up the keyboard on mobile Safari and wouldn't disappear without a refresh. Not a good sign of things to come.

comment 4y ago · link · parent

Yes, I’m specifically in fear, uncertainty and doubt. To be clear, I’m fully onboard with the intent of the GDPR, but I have no idea how to follow it. And “you’ll be okay, the fines are probably small” is exactly the kind if statement that causes anxiety.

I’ve recently tried to figure out if it’s okay to use something like Cloudflare Pages to host a blog. That’s not an esoteric question, but I was unable to get an answer. They’re not based in Europe, the log retention policy is a bit unclear, regulators seem to be disagreeing on whether even their CDN is okay (and Pages is built on top of the CDN). And in Germany, the real danger isn’t a regulator fining you, it’s a private lawyer sending you an “Abmahnung”. Which they will do for any trivial infraction, often using automated platforms.

comment 4y ago · link · parent

The “old web” — the one before the rise of the trillion dollar engagement optimizing platforms — is probably completely foreign and unimaginable to those who haven’t experienced it.

comment 4y ago · link · parent

I agree with all of those. More things that are harder now:

* Finding honest product impressions/reviews.

* When looking for a configuration setting or tip to use any piece of software, find a one minute article with clear bullet points instead of an 11 minute YouTube video with a personal backstory and a VPN sponsorship.

* Finding a cooking recipe that isn’t padded with SEO nonsense.

* When finding an online discussion or blog article in a search result, being able to read it straight in the (mobile) browser without hostile prompts to make an account and/or download an app.

* (Europeans only.) Publish a simple website without worrying that the hosting provider you choose doesn’t perfectly conform to privacy laws that even lawyers won’t explain to you and you’re personally liable for ridiculous damages.

* Run software developed by hobby programmers on machines you own.

* Connect devices like speakers, keyboards and mice to computers. (Edit: You mention that.)

And, completely disagreeing with the article on this one point, this is also harder:

* Writing cross-platform UIs. As someone with a lot of hate for Java from back in the day, this is painful to write, but: Java Swing might not have produced the nicest GUIs, but the stack was so much simpler than Electron+Node+Express+Webpack+React+TypeScript (substitute Svelte, Vite or whatever you want), it’s not even funny.

comment 4y ago · link · parent

Floating point is basically just scientific notation. Which means that in theory, it even might have been invented back then.

comment 4y ago · link · parent

That sounds like the fixed point representation is part of what causes the huge memory requirements. It's fascinating how obvious some ideas are in retrospect. Floating point is basically just scientific notation, which was well known AFAIK. But I can imagine that it's hard to make the transfer to use that as the representation for all calculations.

comment 4y ago · link · parent

I agree with the goal, but I have trouble imagining reaching it in a typical enterprise/government IT environment. I agree that VPN is a crutch. The alternative is that every little legacy intranet application needs a fully staffed and security-aware maintenance team. That team needs to work full time to keep the technology up to date so that everything can be patched, forever. Many little internal tools wouldn't exist in such an environment. Maybe that's not entirely a bad thing, but it's very different from today's expectations.

comment 4y ago · link · parent

Microsoft’s are the only services I use where I regularly have to delete all cookies because Teams or something gets stuck in a strange redirection loop that doesn’t happen in clean browser instances. Good times.

I think Microsoft is also responsible for an (at the time a bit embarrassing) account breach I suffered. I have no proof, but something very weird happened.

Way back when, I think my Skype account was hacked using a password that no longer should have existed. This happened some time after the forced migration to Microsoft accounts. The new password was unique and password manager-generated, and no machine of mine was ever compromised — luckily.

However, my old Skype password had been embarrassingly weak (different times), and I had only upgraded everything to strong passwords a short time before that. I remember that there was no user-visible way to change the old Skype password or even see the account anymore — I thought it was deleted during the migration.

Yet someone managed to spam all my contacts, some of which got very angry with me personally. My best guess is that they had accidentally exposed an API backend that still used the old account database. Again, I don’t really know and can’t prove it. There were hints in forums of other users with that problem, but never any official answer.

My actual point is, Microsoft isn’t that great at all of this. Whenever they buy something and force migrate all accounts, the user experience gets worse.

I have no idea why so many enterprise IT departments have such a strong preference for their stuff. It’s not like any of it is particularly easy to set up.

comment 4y ago · link · parent

40,000 decimal numbers is about 16 KB of RAM (40K * log2(10) / 8). That’s 1980s home computer territory — there’s no way that amount of memory would have been needed for anything. (Given today’s understanding of efficient algorithms.)

comment 4y ago · link · parent

And the ruling caste of crypto aristocrats will do a better job of enabling the conditions for that than an elected government, why exactly?

comment 4y ago · link · parent

Ah, the libertarian paradise. History tells us exactly what that world would look like: 1% bitcoin trillionaires, 99% indentured serfs. You’re probably imagining yourself to be in that 1%, but my guess is you’re wrong about that.

comment 4y ago · link · parent

In contrast to some sibling comments, I think using the same unit is a great idea. It’s just that long numbers with commas are a bit hard to read. At least I think 511 keV and 938 000 keV would have been another clear way to present those numbers.

comment 4y ago · link · parent

I've very recently put some research into various tools of that kind. One has to wonder what's going on at Roam. I don't know what the "well-documented community issues" are, you see a lot more posts hinting at some drama than actually telling you what it is. But "slow product velocity" is spot on -- if anything, that's a mild way to put it. Basically every complaint you see veterans make from two years ago is still unaddressed.

I'm now happy with Logseq, which is basically a clone of Roam, with an open-source business model. I really hope the business side works out for them, because for all practical purposes, they've out-engineered Roam to the point of embarrassment. It allows local storage, and will have an iOS app soon (I was able to register for the beta, it's already very solid).

comment 4y ago · link · parent

You’re right, I misremembered this completely, that’s very good to know. I’ve recently mostly used parking_lot, which guarantees prioritizing writers. That’s also the behavior where the post I replied to wondered if parking_lot was missing a check — in fact no, it has an additional feature.

comment 4y ago · link · parent

Near the end, the blog posts mentions patterns to avoid accidental deadlocks in structs that wrap a Mutex. Here's another one that I like use:

    struct FooInter {
        actual_data: HashMap<...>,
    }

    impl FooInner {
        fn do_something(&mut self) { ... }
    }

    pub struct Foo(RwLock<FooInner>);

    impl Foo {
        pub fn do_something(&self) {
            self.0.write().do_something();
        }
    }
The rule is that FooInner doesn't know about the lock (so calling other methods is safe), while Foo methods can't call other Foo methods (so you can't lock anything twice). You can even move Foo and FooInner to different modules to hide FooInner's contents from Foo, though I rarely find that necessary.

I know this is subjective, but for me, this works better than what the blog post suggests -- at least, I haven't gotten it wrong by accident yet.

comment 4y ago · link · parent

These things are often tricky to reproduce, but the deadlock should happen from the spec, right? Essentially, a pending write lock should block new read locks from being acquired -- this is a feature, if it didn't do that, the write lock would starve -- so if you try to acquire the second read lock while the write lock is pending, you get a deadlock.

comment 4y ago · link · parent

The flip side of that is that refactoring can be a surprisingly effective tool for understanding.

comment 4y ago · link · parent

I can believe that more people started to read it than actually finished it. Plot points from the latter half of the book are only referenced very rarely.

comment 4y ago · link · parent

Some people think that 1984 is mostly about surveillance, but that’s a superficial reading IMO. I think it’s a lot more about bending the truth and suppressing ideas.

A quote that haunts me: “Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.” Do we have that freedom in the west, today? Will we have it tomorrow? It’s a lot less clear than one would hope.

comment 4y ago · link · parent

The context is good error messages; what you’re saying is that DWYM (do what you mean) is even better than a good error message. That’s sometimes true and can help beginners. But it also means more special cases and magic, which can make a language hard to learn in a different way. Python and Ruby are almost at the opposite ends of that trade-off, so it shouldn’t be surprising that a Ruby person doesn’t like Python’s solution.

Also, and this is really off-topic, I also completely disagree that the names of built-in functions are off limits in a program, or should effectively be keywords. I'm not saying it's particularly wise to name a variable "print" or something. But should I learn by heart the names of all built in functions before naming any variable? Should I refactor my program whenever a new one is added? Resolving those kinds of conflicts is what scoping is for, and it works.

comment 4y ago · link · parent

There are different kinds of error messages in C++, all of them terrible, but each for different reasons.

Template error messages are often best understood as stack traces of the “metaprogramming language”, which isn’t C++, but a complicated type substitution system that beginners don’t understand when they first encounter these errors. So that’s confusing.

But I found that the hardest errors for beginners are linker errors: They look like line noise and contain no easily readable information to point at the source of the problem. It shouldn’t be necessary to explain linker hacks from the 80s when teaching someone how to find out what they forgot to implement.

comment 4y ago · link · parent

It’s not so much expectation, but being curious. When a band releases a hit album, you want to know if there’s another one that’s similarly good.

comment 4y ago · link · parent

Some anecdotes where error messages truly delighted me:

When I accidentally misresolved a conflict after a git pull, the C# compiler, upon encountering the >>>>> markers in the source code, noted that there’s an unresolved merge conflict in that line instead of complaining about bitshifts.

When I tried to bitwise invert a value in Rust with “~x”, which is wrong, instead of complaining about an unknown character, the compiler helpfully explained that the operator to use in Rust is “!x”.

When I was in the Python interpreter and entered “exit”, which doesn’t work because exit is not a keyword, I got a message that told me how to actually exit.

comment 4y ago · link · parent

Seriously wondering, has Richard Garfield designed successful games after Magic: The Gathering? It’s probably hard to follow up that insane kind of success, especially if you hit it early.
1
293031
51