9,663 karma · joined Jun 14, 2010 (16y ago) · 1,502 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
If you have multiple adversarial commercial implementers for something, a standard makes perfect sense. It's still a lot of work, but necessary because otherwise, you wouldn't get things to interoperate at all. That's true for things like HTTP, or Bluetooth, or JavaScript, or C++.
But for a community project, having one blessed implementation and iterating quickly has proven to be the most successful model, in my opinion. I can point towards Python, Rust, even PHP for examples. Even Haskell, which started out with a written specification, has at this point de facto been forked into the much richer language called "whatever GHC understands".
comment 3y ago · link · parent
comment 3y ago · link · parent
Just like it was A/B tested that the best background color to contrast the ad area against the organic results’ #ffffff is #fffffe.
comment 3y ago · link · parent
comment 3y ago · link · parent
For younger folks, the SID is the sound chip of the C64. It's infamous for being partly an analog circuit. That is, it uses transistors in states between 0 and 1, as you would in a transistor-based amplifier, or an analog radio. This gave the sound of the C64 its unique texture.
My understanding is that this behavior is impossible to reproduce with modern chip fabrication techniques, so what's the solution? Digital emulation?
comment 3y ago · link · parent
λ> let 2+2=5 in 2+2
5
This simply defines a new local function that happens to be called "+". It's no different than something like this in JavaScript: let Math = { sqrt: (x) => 42 };
console.log(Math.sqrt(16));comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
Perhaps as a reminder, the issue is that the paper’s implementation of their 2-nearest neighbor secretly uses an oracle to break ties, which obviously inflates the accuracy compared to a real-world kNN classifier that has to choose heuristically. To be fair, this could be a weird implementation accident and not malice. But I think it does invalidate the results.
But rather than admit error, the author defends this choice, and does so using (in my opinion) dubious statistical arguments. Which leads me to believe that — at least at this point — they know they made a mistake and just won’t admit it.
They claim that instead of a real-world accuracy, they wanted to find the “max” accuracy that their classifier was statistically capable of. That is, the accuracy you get if the stars happen to align and you get the luckiest possible result. Well, not only is this creative new metric not described in the paper, it’s also not applied to the other algorithms. For example, I think a neural network is capable of achieving a “max” accuracy of 100%, if all the initial weights happen to perfectly encode both the training and test sets. But of course they just use standard training to give the numbers for those algorithms.
comment 3y ago · link · parent
Your point kind of proves the opposite. Many players will benefit from tutorials, of course. But if making them unskippable helps the bottom 10%, who otherwise can’t correctly judge if they would need them, then we get unskippable tutorials.
The same bullshit applies to dynamic (cheating) difficulty levels, another bane of modern game design where you can’t get ahead by doing well.
comment 3y ago · link · parent
comment 3y ago · link · parent
Inconsistent: trivial, from falsehood follows anything.
Incomplete: Peano.
Weak: Presburger.
comment 3y ago · link · parent
template <typename T>
struct optional {
// One version of value which works for everything
template <class Self>
constexpr auto&& value(this Self&& self) {
if (self.has_value()) {
return std::forward<Self>(self).m_value;
}
throw bad_optional_access();
}
The fact that I can read this and don't even find it that terrible is proof that C++ has permanently damaged my brain.comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
This only applies to C++, but the CRT runs all constructors of global variables before main/WinMain. (Or rather, the CRT calls a special function that the compiler generates for this purpose and links into the executable.) In some codebases, that's quite a lot of stuff.
comment 3y ago · link · parent
For example, Box<T> implements Deref so that you can conveniently use T's methods. If you look at the documentation of Box, the things you can do with the Box itself, like Box::leak, are non-method functions. This means that you always have to qualify them, like Box::leak(my_box), and thus you can't get this type of conflict.
Using Deref for types like String or Vec doesn't really fall into this category. They implement something more analogous to an "is-a relationship" in OO. Even outside of those examples, I've seen people manually implement inheritance-like behavior, using Deref to delegate to a field that stores the "base class" instance.
If you do that, you're likely to have a name conflict between the two types sooner rather than later. That's fine as long as you're aware that Rust doesn't really do overload resolution -- AFAICT, the "outer" methods always wins regardless of the arguments at the call site.
comment 3y ago · link · parent
Arguments like these are often used to defend unpopular technology choices, like (insert disliked programming language here). "A true master can use any tool!" And yet, I've never seen a professional guitar player use a cheap shitty guitar.
comment 3y ago · link · parent
This means that you can run and test code that doesn't typecheck yet -- very useful during development. Also, production builds can run the typechecker in parallel with other build steps. That's how we optimized our build system at work.
But essentially, it's a design choice by the TypeScript team. They've decided that TypeScript shouldn't add runtime features on top of JavaScript, but instead should simply type JavaScript, and I think this has contributed to the success of TypeScript.