628 karma · joined November 13, 2021
I would be remiss not to mention the following story:
There is a story that Ken Iverson, the inventor of APL, was passing a terminal at which a Fortran programmer had just typed:
I = I+1
Ken paused for a moment, muttered “no it doesn’t”, and passed on.You can, but appending some list L and an empty list, or an empty list and L yields L in either case; there's nothing to append. Subsequent appends will be more interesting, e.g.
CL-USER> (append '(x) (append '(y z) '()))
(X Y Z)
> The empty list is nil, and `(append nil foo)` seems to just yield `foo`, not `(list foo)`Right. Conceptually APPEND appends lists and not bare elements; try (append '() '(foo))
Anything with a read barrier might also be able to see which slots are hotter, and thus prioritise copying those first; there was one paper from the 90s showing profiling helped get a better layout.
> Every validator on Secret Network runs their code inside a TEE so no one—not even the nodes operating on the network—can access the information being decrypted and processed.
How could one possibly verify that a secure enclave is being used?
> Best Score for your Gender -69420
> Worst Score for your Gender 1000000000
Someone doesn't sanitize their inputs?
I'm not sure what Dijkstra would have thought the "goal" of computer science was, but in the lecture Abelson seemed to think it was about describing procedures and processes in a formal manner.
[2] https://plover.com/~mjd/misc/hbaker-archive/RealTimeGC.html
[0] https://www.usenix.net/legacy/events/vee05/full_papers/p46-c...
It is? That didn't stop Genera, Interlisp, Movitz or Mezzano to name a few. Outside Lisp there's also Smalltalk, Oberon and Singularity to name a few operating systems with GC.
In particular, the hash table apparently cannot have collisions, as "variables are necessarily unique". Sure, but there are only 64 buckets for 65,536 names, so it is further necessary for all variable names to be unique modulo 64, which can't be guaranteed. One option (which I believe CPython uses, more or less, by numbering locals and arguments) is to use De Bruijn indexes [0], but I'm not sure how to make it work with a tree-walking interpreter.
I'm also not sure how it is possible to come up with a reference-counting algorithm that performs "recursive increments", as an assignment X := Y only ever adds one incoming reference to Y from X. The example suggests the reference counts are the number of ways each value is transitively reachable, which is unnecessary and no one does that; Collin's original paper on reference counting [1] describes it as "a tally of the number of arrows pointing to [an object]" which is not transitive.
And with the exception of 3-Lisp's infinite tower of interpreters, "modifying eval in the implementation" is not how anyone extends the language, because modifying the implementation is very much the least portable thing possible to do. The usual suspects for that are macros and fexprs, but the author refers to generic arithmetic, which would best be managed by some kind of dispatch or polymorphism in the language.
The part of threading is also a head-scratcher. The author claims that you cannot run bytecoded VMs with multiple concurrent threads without a lock, only seeming to suggest it is because CPython doesn't do that. One counter-example would be BEAM. And concurrent reads to immutable data structures are entirely harmless, so copying between threads is unnecessary.
SHR R_pointer, 9
AND R_pointer, <cards>
MOV BYTE [R_cards + R_pointer], 0
where <cards> is one below an immediate power of two number of cards, each card covering 2^9 = 512 bytes of heap. This is roughly the write barrier in SBCL on x86-64; there isn't much of a reason to think it will cause a latency spike.On the other hand, "Barriers revisited" does mention a pathology about how cards can introduce false sharing, but that's still more of a smear than a spike.
moonchild's suggestion to monomorphise against GC/explicitly managed pointers might reduce that figure lower; evidently you know D programs better than I, but it doesn't seem unreasonable that the 1% can be won by a faster GC.
[0] Fast conservative garbage collection https://users.cecs.anu.edu.au/~steveb/pubs/papers/consrc-oop...
Barriers are pretty cheap; [0] claims a 0.9% time overhead for a card-marking barrier common in generational collection and 1.6% for an object-logging barrier which is also useful for concurrent collection. Apparently they're cheaper nowadays, but the results aren't published yet [1]. That's not to say that the barriers are free, but it seems feasible that collector optimisations could still cover that ground.
It can help throughput, still, by running the collector concurrently. I've felt that while working on a new parallel (but not yet concurrent) collector for SBCL; the program parallelises well, but a serial collector hurts worse than it should by stopping the program.
[0] "Barriers reconsidered, friendlier still!" https://users.cecs.anu.edu.au/~steveb/pubs/papers/barrier-is... [1] https://twitter.com/stevemblackburn/status/14942409060061102...