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

Not being intuitive isn’t the strongest argument against specialized notation. Programming languages aren’t intuitive either, yet we learned them. The rationale is that the arrow goes into the direction the #include or import would go. So it shows logical dependencies — both caller and implementer depend on the interface — and you can quickly see if there’s a dependency in the wrong direction somewhere.

I fully agree with UML being stuck in OO land, though, and I think that’s the actual problem. Lambdas don’t exist, or have to be verbosely represented as interfaces. Type-level programming doesn’t exist. Anything higher order is unrepresentable to begin with. You don’t have to use Haskell to run into those limits, modern C++ is enough, or Kotlin, or TypeScript. UML is basically useless if you’re doing anything more interesting than cranking out Java 1.4 era EJB boilerplate.

comment 4y ago · link · parent

Just so I get this right, she made a play based on an error, and got lucky? I mean, stuff like that happens, and is usually a great story. Watching humans play games is exciting precisely because we aren’t robots.

comment 4y ago · link · parent

> Copernicus and Galileo being harangued by the Church of their time, and stifling progress of the obvious, is more popular myth than historical fact.

I’m not sure why it has suddenly become so popular to claim that every single historical fact is a myth. Galileo’s prosecution by the Church is not only well-documented, John Paul II. officially apologized for it in 1992. He might have looked into their archives before doing that.

I swear, going around smugly claiming “Only sheeple still believe that theory” about random facts doesn’t make a person seem nearly as smart as they might think it does.

comment 4y ago · link · parent

It’s obviously 129 to 127 inclusive, hoping that the implied unsigned overflow has the correct consequences. ;)

comment 4y ago · link · parent

I mean, strongly typed flag values are a solved problem. It’s not rocket science, just bothersome to do in C++.

comment 4y ago · link · parent

> Instead, let’s just say arithmetic on INT_NAN is undefined behavior; sanitizers can then insert assertions in debug mode.

I mean, if using that value is supposed to be UB anyway, then the current behavior if standard ints conforms to the spec. Doesn’t that make the proposal largely pointless?

comment 4y ago · link · parent

Was there a rationale?

comment 4y ago · link · parent

Yes, but we’re discussing the article, not the mind of the physicist. Stating “Surely they have an answer” doesn’t give the answer.

comment 4y ago · link · parent

I consider APIs that use degrees essentially broken. (And similarly, APIs that express ratios as numbers in [0, 100].)

But you have to consider that a lot of game engines and related tools are intended for an audience without a strong programming background. You wouldn’t expect a 3D modeling tool to display radians. And if the UI shows degrees, the file format would better use degrees as well to avoid rounding errors. And then maybe you want the scripting layer to use the same values that the UI does. And so on.

comment 4y ago · link · parent

In JavaScript, I’d stay with floating-point (don’t fight the language if you don’t have to) and use something like x => x - Math.floor(x) to normalize.

comment 4y ago · link · parent

Many are of the listed items are merely being deprecated. These shouldn’t really qualify as breaking changes. In fact, the ability to migrate away incrementally is precisely the point of deprecating instead of removing a feature.

What surprises me is that a lot of the deprecated functionality seems really recent — C++14 or newer. Compatibility is C++’s big thing, that’s historically why it kept almost all of C as a sublanguage. I know organizations where migrating to C++11 is still an ongoing process. It’s not great news if features become obsolete faster than many users can adopt them.

comment 4y ago · link · parent

> rasterization, i.e. painting 2D triangles

As I explained in a sister comment, there's a lot more going on with rasterization, even back then, than "painting 2D triangles" might imply. Yes, only the XY coordinates determine the screen location of a rendered pixel, but the Z coordinate even at that stage has a lot to do with its color (e.g. for perspective-correct texture lookup) and whether it is painted at all (Z buffering).

comment 4y ago · link · parent

I’m sure it can be emulated efficiently enough nowadays, but I don’t think the mapping is very direct: Glide was mostly imperative and synchronous, Vulkan is declarative and explicitly asynchronous. Both are low-level, but for hardware that works very differently.

comment 4y ago · link · parent

Being 2D rasterizers was arguably true for some cheap early graphics chips like that of the PS1. For Voodoos, there was no point in the pipeline after which rendering is “only 2D” in any relevant sense. At the time, the Z coordinate was passed to the hardware and used e.g. for important things like perspective correct texture lookup, environment maps (fake reflections), and Z buffering — that is right until the very last moment of committing the pixel to memory.

comment 4y ago · link · parent

Yes, I believe what language implementation would want to do is to use the lowest-level API that’s supported and stable. On Linux, that happens to be syscalls, on BSD and macOS, that’s libc, and on Windows, that’s the so-called “Win32” API (kernel32.dll and such).

comment 4y ago · link · parent

One interesting feature of ML-based image encoders is that it might be hard to evaluate them with standard benchmarks, because those are likely to be part of the training set, simply by virtue of being scraped from the web. How many copies of Lenna has Stable Diffusion been trained with? It’s on so many websites.

comment 4y ago · link · parent

From the outside perspective of a younger democracy, the fact that the US political system treats this ancient legal document with the same reverence that one might pay to the biblical stone tablets, where it would be sacrilegious to even change the font, let alone bring it up to speed with almost 250 years of progress in ethics, political practice and technology, seems like it might explain some problems.

comment 4y ago · link · parent

I got that e-mail too, on a decade-old test account: first an e-mail that reads like my account simply "expires" if I don't update. Then an invoice.

Here's what I don't get: After a stunt like this, any reputation/brand value that you might have had is gone. So, the obvious conclusion is they bought the company purely to pull this trick. Any other value the company might have had is deleted. Can that have been worth it? Very few people will pay voluntarily, I can't imagine them successfully collecting the money, and the acquisition price probably wasn't 0 either. I can't imagine that the math checks out, or does it?

comment 4y ago · link · parent

> Being a dificult language to work with (as in at the other end of niceness like say Ruby) it is not even justifyable as a hobby lang.

Obviously, there's a growing number of people who use Rust professionally, but that's not even the point to argue. Why would people need to "justify" their hobbies? Of course, it's perfectly fine if you don't care about the craft beyond "pay[ing] the bills". But others might, especially on a site called "Hacker News". Maybe let them discuss stuff they find personally interesting, whether those interests are "justified" according to your opinion or not.

comment 4y ago · link · parent

Of course, it would be unjust to judge academic research from a one-line summary that a journalist wrote. But at least on the surface, this is unconvincing:

> D’Huy is applying these methods to study how ancient myths can inform what we know about our connection with other animals such as sheep — their mythological link with the sun could have led to domestication. Symbolic, rather than utilitarian, reasons for domestication could explain a lot of data, he says.

Why would hunter-gatherers in a resource-constrained environment keep food around and not eat it? I would rather bet that my ancestors had exactly the same mythological connection with their flock of sheep that I have with my freezer.

comment 4y ago · link · parent

Those colors never looked great, but I remember them being a lot less jarring back then.

At least some of the colors weren't pure binary RGB values as claimed in the article. For example, "dark yellow" was closer to a brown #804000 than #808000. Maybe that depended on the graphics card? Otherwise, I'm not sure why many terminal emulators would have gone with a pure dark yellow instead.

Also, maybe the overall contrast was lower on CRTs. At least I think the blacks were less dark on early monitors, which might have helped to make the colors look less harsh.

comment 4y ago · link · parent

I don’t understand why it’s seen as a given that component names can’t be changed. All the given examples are public project names, where there’s a point to be made. For internal components though, where are your refactoring tools?

comment 4y ago · link · parent

Honest question: Why is this kind of retro programming at all attractive to younger people who didn’t grow up with that hardware?

For people like me, it’s clearly childhood nostalgia. But to be honest, 8-bit programming was so painful that people couldn’t wait to get rid of those limitations back then. (I tend to think the 16-bit era was the sweet spot in terms of capabilities vs. complexity.)

comment 4y ago · link · parent

That “traditional” site doesn’t actually load the data from disk, in practice. It does once, after a reboot, but that’s true for this solution’s executable file as well.

comment 4y ago · link · parent

The short answer is yes.

The long answer is that it’s not so clear what an “in place addition” even means at the level of CPU instructions after you consider register allocation. For example, if you have

    v = x;
    v += y;
    f(v);
and the never mention v again, then the whole operation is performed directly in the register that is specified to receive the first argument in a function call, not in whatever register might have been allocated for v.

That’s because, with some complications I don’t want to go into, compilers look at the dependency graph of values rather than at the variable names.

comment 4y ago · link · parent

Not to turn this into an evangelism subthread, but I think GP is right. The performance optimization could apply, but the bug as described should be prevented by the borrow checker. In fact you can do neither x = … nor x += … when anything else still references x, because assignment requires an exclusive reference (&mut), which is statistically checked.

comment 4y ago · link · parent

That’s true, I’d add something more. Your reasoning about hardware differences would only justify implementation-defined behavior, not undefined behavior. The distinction is important here: undefined behavior is when the compiler can make surprising optimizations in other parts of the code assuming something doesn’t happen.

comment 4y ago · link · parent

Define "machine". All kinds of microcontrollers are programmed with C.

comment 4y ago · link · parent

The ISA might force someone to extend a value to 32 bits (debatable, but let’s go with it). It never forces you to treat an unsigned int as signed. It also doesn’t require inserting UB into the process.

comment 4y ago · link · parent

I don’t find that very convincing. It’s simply ambiguous, I might want this:

    *reg &= ~(uint64_t)x;
or, and there’s no elegant way to even write this in C, I might want:

    *reg &=(uint64_t)(uint8_t)~x;
The fact that I have to write two casts here to undo the damage of the auto-promotion is evidence of how broken this is.
1
222324
51