9,664 karma · joined Jun 14, 2010 (16y ago) · 1,504 submissions
comment 4y ago · link · parent
comment 4y ago · link · parent
I think that’s true. Expensive copies should never have been implicit. There was a story some time ago about a single keypress in the address bar of Chrome causing thousands of memory allocations. The culprit: lots of std::string arguments up and down the call stack.
Rust gets this right, with the hindsight of C++’s example: “a = b” is a move operation by default and clone() is always explicit, except for plain data types where copying is literally memcpy — and those are clearly marked as such by the type system.
comment 4y ago · link · parent
[1] Herb Sutter's C++ ABI effort was supposed to solve exactly this, but unfortunately never went anywhere. The proposal document pinpoints the problem very well in my opinion: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n40...
comment 4y ago · link · parent
I just don’t agree that this can be fairly summarized as “estimating Kolmogorov complexity”.
Kolmogorov complexity isn’t a statistical measure — it doesn’t matter how unlikely the machine that produces the output string is. And the time limit they have to impose to actually run those machines is crucial; some of the machines they have to abort would eventually produce an output and halt.
comment 4y ago · link · parent
- It might be educational to show the sum of sine waves in addition to the components.
- 55 Hz is really low as the base frequency. I think going up a tiny bit would make it easier to hear the base frequency as you add overtones.
- I think the counting you use might be nonstandard: what’s called the “1st harmonic” should actually be the second harmonic, twice the fundamental frequency. But please double check me there.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
If you look at all the PICO-8 clones/inspired platforms without such a restriction, it's hard to overestimate how prescient this was. Basically all of them had raytraced 3D games in their 200x200 pixel box in week 1, which regardless of palette limitations completely kills the 8-bit vibe for me.
Also, this restriction ensures that all the newest PICO-8 games also run on the very old PCs that children might have access to, which I think was great for the health of the platform.
comment 4y ago · link · parent
But the line between being genuinely humble and humble bragging is sometimes thin, and people have a different tolerance thresholds for the latter.
It's when he phrases this encouragement as "look, I also felt like an idiot at the start of my career, and look at all the awesome things I've done since then", it also comes across as a bit self-serving, even if unintentionally so. I think some people are simply more prone to pick up on that than others.
comment 4y ago · link · parent
But the mechanics of the sigil thing never confused me. Either because it was explained to me very well, or possibly -- Larry Wall is a linguist, after all -- because there's an analogy to grammatical cases, which English largely doesn't have anymore, but my native language does.
The sigil depends on what you want to get out of the expression, not what you put in. So @foo would name the whole array, while $foo[2] would name a single element from it.
> If you just need to go one level in you can do either $foo[2] or $foo->[2] depending on your whims. It's kind of madness.
You misremember, but I don't blame you, it's a very unorthodox rule. These are very different expressions.
$foo[2] accesses the second (third depending on how you count) element of @foo. @foo is a "value array", whenever possible, I tended to use those because I found them more convenient and intuitive.
For programmers coming from JavaScript or Python, and people building more complex data structures, using a reference array might be more intuitive. Those are stored in scalar variables, like $foo, but to disambiguate with the syntax for accessing @foo, you have to explicitly dereference it with $foo->[2].
comment 4y ago · link · parent
comment 4y ago · link · parent
In this case, Wikipedia makes it pretty clear that while surviving a nuclear attack specifically might not have been an explicit part of the design goals of the designers (which may have started the myth myth), resilience against large-scale failures was exactly the feature that made the technology interesting to its military sponsors:
> Nonetheless, according to Stephen J. Lukasik, who as deputy director (1967–1970) and Director of DARPA (1970–1975) was "the person who signed most of the checks for Arpanet's development":
>> The goal was to exploit new computer technologies to meet the needs of military command and control against nuclear threats, achieve survivable control of US nuclear forces, and improve military tactical and management decision making.
(https://en.wikipedia.org/wiki/ARPANET -- where the quote is sourced directly to an article by this Stephen Lukasik.)
My takeaway is that while the ARPANET creators might not themselves have particularly cared about surviving nuclear disasters, without the completely decentralized packet switching that made this at least a possibility, it wouldn't have ever received the funding to get off the ground.
Shortening this fact to "ARPANET was funded to survive a nuclear attack" is IMO a fair sound-bite sized summary, not a "myth" to be debunked, even though the story has obviously more nuances.
comment 4y ago · link · parent
People used to read programming books. I learned both Perl and C from books; for me Perl wasn’t any harder. Yes, the syntax is unique — but you learned to read weirder things, C++ certainly isn’t any more intuitive in a vacuum.
But of course, few people read books anymore, so where do people learn languages? I guess universities and blog posts. (And increasingly YouTube videos, which have even less content density.)
Universities only teach old versions of Java. Blog posts are limited in size. Sad conclusion: any language that has more than a blog post’s worth of differences to Java 1.x will find it hard to reach very broad adoption.
comment 4y ago · link · parent
comment 4y ago · link · parent
In theory, cars should be use mechanical legs instead of wheels for transportation, that's how animals do it. In theory, plane wings should flap around, that's the way birds do it. My point being: the way biology solved something may not always be the best way to do it with technology.
comment 4y ago · link · parent
comment 4y ago · link · parent
The authors supposedly have, and I’m no expert, but I don’t find the argument completely ridiculous. The universe isn’t that old compared to its size; I think it’s plausible for two unlikely events to have happened without their causal cones having intersected yet.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
I’ve experimented with Web Audio stuff in the past, and wasn’t happy with it. It seems to be mainly intended to play back premade music files, not seamlessly playing dynamically generated samples.
Normal audio APIs issue a callback whenever their buffer gets low. This is done in a high-priority thread and has a high chance to work seamlessly even on a very busy system — think computer games. You get called, generate a few more bytes and everything is fine.
Web Audio, unless something changed, requires you to actively, manually schedule sending little audio snippets to the playback queue. You have to use timers for that, which are nondeterministic, and you’re competing with everything else that the JavaScript thread is doing. Any tiny hiccup is an audible artifact, and I had found no completely reliable way to avoid them.
Why is Web Audio like this? Are improvements on the horizon that would make this better?