Computing with JavaScript's Undefined (2020)
esoteric.codes
esoteric.codes
> HTTP Error 503. The service is unavailable.
It is not well at present.
https://archive.ph/oldest/https://esoteric.codes/blog/calcul...
>Speaking at a software conference in 2009, Tony Hoare apologized for inventing the null reference:
>"I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years." -Tony Hoare
https://news.ycombinator.com/item?id=19568378
>"My favorite is always the Billion-Dollar Mistake of having null in the language. And since JavaScript has both null and undefined, it's the Two-Billion-Dollar Mistake." -Anders Hejlsberg
>"It is by far the most problematic part of language design. And it's a single value that -- ha ha ha ha -- that if only that wasn't there, imagine all the problems we wouldn't have, right? If type systems were designed that way. And some type systems are, and some type systems are getting there, but boy, trying to retrofit that on top of a type system that has null in the first place is quite an undertaking." -Anders Hejlsberg
Two nulls, obviously.
natnum(0).
natnum(s(N)) :-
natnum(N).At one point I was faced with the fact that I only really had 2 datatypes in my interpreter, the list and the integer. So I bit the bullet and made my integer type into a list with one byte entry, thus reducing my total amount of datatypes to one. Every piece of my interpreter code always knew that it would get a list as inputs, and it was kinda beautiful. CPU-wise it was wasteful, but it reduced the interpreter size by a lot.
They seem almost giddy about having designed a computer that can perform interesting mathematical tasks like integrals and derivatives without numbers.
Sure, there might be toy examples used for teaching that did this, but that is a something different.
Both computationally and societally.