Better HN
topnewbestaskshowjobs
Log inSign up

oecumena

185 karma · joined Jan 27, 2019 (7y ago) · 37 submissions

Submissions

1.

A (necessarily) brief history of the remainder of mathematics(cofault.com ↗)

1 points · by oecumena · 2mo ago · discuss

comment 10mo ago · link · parent

'The Lobster Programming Language (strlen.com)' is duplicated.

3.

C++: Zero-cost static initialization(cofault.com ↗)

84 points · by oecumena · 1y ago · 58 comments

comment 1y ago · link · parent

Analytical series for data types.

comment 1y ago · link · parent

Manual derivation of Hoare-triples for the long division algorithm verification.

6.

Formal verification of the long division algorithm(cofault.com ↗)

2 points · by oecumena · 1y ago · 1 comment

comment 2y ago · link · parent

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()).

comment 2y ago · link · parent

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().

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

I did another one back in 2001: https://ldoor.sourceforge.net/ .

comment 2y ago · link · parent

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.

13.

Don't lose your file (descriptors): escrow library(github.com ↗)

1 points · by oecumena · 2y ago · 1 comment

comment 3y ago · link · parent

So that's where I put them!

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

Newton explicitly checks in Principia that the orbital parameters of the moons of Jupiter are consistent with the "empty space" hypothesis.

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

Original Solaris doors use server thread pools: https://github.com/illumos/illumos-gate/blob/master/usr/src/...

comment 3y ago · link · parent

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.

comment 4y ago · link · parent

A simple experimental implementation of coroutines alternative to well-known "stackless" and "stackful" methods.

comment 4y ago · link · parent

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.

22.

3-Lisp: an infinite tower of meta-circular interpreters(cofault.com ↗)

4 points · by oecumena · 4y ago · 1 comment

comment 4y ago · link · parent

If there are no pointers from "old" to "new" objects, then there are no cycles and (compiler-assisted) reference counting will handle it.

comment 4y ago · link · parent

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...".

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

I guess it is not more widely used, because more complex generational collectors are often more efficient.
12