HNHacker News
TopNewBestAskShowJobs

oecumena

185 karma · joined January 27, 2019

submissionscomments
oecumena··on The $LANG Programming Language
'The Lobster Programming Language (strlen.com)' is duplicated.
oecumena··on [dead]
Analytical series for data types.
oecumena··on Formal verification of the long division algorithm
Manual derivation of Hoare-triples for the long division algorithm verification.
oecumena··on C Is Turing Complete
Still won't work. The Standard explicitly specifies that FILE type includes all stream attributes, including position indicator:

    ISO/IEC 9899:TC3 7.19.1 
    FILE
    which is an object type capable of recording all the information needed to control a
    stream, including its file position indicator, a pointer to its associated buffer (if any), an
    error indicator that records whether a read/write error has occurred, and an end-of-file
    indicator that records whether the end of the file has been reached;

Hence no stream can be longer than 2^(sizeof(FILE)*CHAR_BIT) (6.2.6.1 guarantees that objects of any type cannot have "hidden" bits of state not accounted by sizeof()).
oecumena··on C Is Turing Complete
Sizes of stdio FILE streams are still limited, because of ftell: the standard requires that file position (as measured from the beginning of the file) is representable as long or off_t.

You can advance an argument that even though each stream is limited, you can have an infinite number of streams, but this does not work, because stream name is a string, and there is only finite number of possible strings and the standard library does not contain chdir().

oecumena··on `find` + `mkdir` is Turing complete
For any C program there is a number N, that depends on the program, compiler, architecture, etc., but does not depend on the program input, such that the program won't be able to access more than N bits of state at any moment in any of its possible executions. Hence, the program is equivalent to a finite state automaton.
oecumena··on `find` + `mkdir` is Turing complete
C is definitely not Turing complete. The standard library provides no escape, because file sizes are also limited (due to ftell (3)), and there is no chdir in the C standard library, so the total number of files is also limited. I have a recollection of an attempt to construct a possible Turing-complete interpretation of the C standard involving recursion and va_arg, but I don't think it went anywhere.
oecumena··on "Doors" in Solaris: Lightweight RPC Using File Descriptors (1996)
I did another one back in 2001: https://ldoor.sourceforge.net/ .
oecumena··on Don't lose your file (descriptors): escrow library
File descriptor escrow library: provides an interface to send process file descriptors to a separate process ("escrow daemon", "escrowd"). The descriptors can be retrieved later by the sender or another process.
oecumena··on Archaeologists Uncover 9,500-Year-Old Woven Baskets and Europe’s Oldest Sandals
So that's where I put them!
oecumena··on The End of Matter (1906)
What is really funny is that eventually our understanding circled back and now the rest mass of particles is attributed to their interaction with the Higgs field, by effectively the same basic mechanism that Poincare-Lorentz-Abraham invented.
oecumena··on How We Knew Space Was a Vacuum (2021)
Newton explicitly checks in Principia that the orbital parameters of the moons of Jupiter are consistent with the "empty space" hypothesis.
oecumena··on An Implementation of the Solaris Doors API for Linux (1998) [pdf]
I agree that the direct hand-off that Solaris shuttles provide is more efficient than general wakeup, but it is less efficient than switching MM context of the client thread. The latter results in twice fewer threads, twice fewer scheduler lock acquisitions, etc. Note that for the kernel-level door servers, Solaris does not use server threads, it directly calls the server entry point function.
oecumena··on An Implementation of the Solaris Doors API for Linux (1998) [pdf]
Original Solaris doors use server thread pools: https://github.com/illumos/illumos-gate/blob/master/usr/src/...
oecumena··on An Implementation of the Solaris Doors API for Linux (1998) [pdf]
I made a similar doors api implementation for Linux in 2001 (https://ldoor.sourceforge.net/). It eliminated the cost of having a thread pool and context switches by re-using client thread and replacing its MM context with the server context, so that the thread magically finds itself within another process.
oecumena··on [dead]
A simple experimental implementation of coroutines alternative to well-known "stackless" and "stackful" methods.
oecumena··on 3-Lisp: an infinite tower of meta-circular interpreters
A 3-lisp program is executed by an interpreter written in 3-lisp that is itself executed by an interpreter written in 3-lisp and so on ad infinitum.
oecumena··on Treadmill garbage collector by H. Baker
If there are no pointers from "old" to "new" objects, then there are no cycles and (compiler-assisted) reference counting will handle it.
oecumena··on Treadmill garbage collector by H. Baker
Variable size objects are addressed at the very end of the post: "Support for variable-sized objects requires a separate cyclic list for each size...".
oecumena··on Treadmill garbage collector by H. Baker
That's true, the worst case is bad. But if mutator locality of reference is reasonable, the scanner will preserve it. After all, Baker rejected his earlier copying design for a reason.
oecumena··on Treadmill garbage collector by H. Baker
I guess it is not more widely used, because more complex generational collectors are often more efficient.
oecumena··on Treadmill garbage collector by H. Baker
The Scheme-79 chip (https://dspace.mit.edu/handle/1721.1/6334) was doing GC in microcode. According to Steel & Sussman it typically spent 80% of time collecting. :-) RMS invented "phantom stacks" to reduce the amount of garbage due to closures, not sure this was ever implemented anywhere.
oecumena··on Treadmill garbage collector by H. Baker
Double-linked list (Baker calls it "Knuth's double-linked list") allows O(1) insertions and deletions (hence moving) without actually moving objects and without additional indirection. Each object has a header that contains pointers to the next and previous objects in the list. To remove obj from the list do { obj->next->prev, obj->prev->next = obj->prev, obj->next } (I use "parallel assignment" for simplicity), similarly for insertion, see https://en.wikipedia.org/wiki/Doubly_linked_list . So the circles in the diagram are not actual address space (in the sense that object addresses are not increasing monotonically as you go clockwise), but there is no additional indirection because the header with the forward and backward pointers is part of the object.
oecumena··on Treadmill garbage collector by H. Baker
Treadmill is a "real-time" in-place garbage collection algorithm designed by H. Baker. It is simple, elegant, efficient and surprisingly little known.
oecumena··on A curious case of stacks and queues
Did you know that you can evaluate expressions using a queue rather than a stack?