Procfs: Processes as Files (1984) [pdf]
lucasvr.gobolinux.org
lucasvr.gobolinux.org
To me, it has always been a sort of hackish/no hassle way of exposing some kernel interface that would not fit/be too annoying to provide as syscalls (not to mention there's a limit to the number of syscalls).
I would much more prefer a sysctl-like interface (i.e. a single, generic, syscalls to get process metadata).
As a side note, most BSDs moved (or are moving) away from procfs, for this very same reason (overused, too much pressure on the VFS, loose format, etc)
At the end of the day, first one is always faster.
Structures should be used for structured data.
/proc is a very fine interface for getting realtime basic information about a process. Maybe we should leave it as it is and stop abusing well matured interfaces?
I see red when Chrome uses intentionally broken symbolic links to store information on a system for example.
Hell, in linux, the dynamic linker (ld-linux.so) depends on procfs to expands ELF variables (e.g. $ORIGIN, which requires the path to the current program being executed, which is retrieved from procfs). It's gone _way_ too far!
Now it does not mean that an other interface would be ugly/annoying to use from the shell.
`sysctl` for instance is quite convenient to use from the shell, and the hierarchical variables that it accepts could very well mirror what procfs exposes.
Something like
`$ sysctl proc.42.environ` <=> `$ cat /proc/42/environ`
https://www.usenix.org/sites/default/files/usenix_winter91_f...
Everything is a file on UNIX until it isn't, when it comes to IPC and everything that came after Bell Labs was done with it.
Unfortunately promises have utterly ruined everything about these everything-is-an-object days, in practice. Now you stack up a whole bunch of constructions options & create a Fetch promise, which exposes nothing, says nothing, reports nothing. It's safer & yeah it's better too, more explicit & intentional, but heavens, adding back progress, adding back abort, & the general complete lack of common ways to live manage your transfer progress: everyone has their own means of using & harvesting control, where-as previously the XHR had control built in.
Promises really are processes. They're not just an abstract future value, they're a thing representing the work too. Alas while once upon a time js had a design sensibility to expose pieces & control alike a process exposing itself as files, today a way more top-down non-first-class way isn't just dominating, it's totally taken over the language. Some ultra-conservative hardline mindsets made it through with promises, such as a) that they had to be accessed asynchronously, for no real reason other than great great great fear of the user (resulting in them being almost ideal, but actually alas unsuitable to work as things like AbortSignals & many other level-triggered systems that they very very closely resemble), and b) that promise handlers don't get to see their handlee/triggered. There's a whole host of design decisions that very outspoken very controlling people put into the languages reflecting their biases. I don't think the were wrong, but there's a ton of possibility space & openness & expressiveness that just got dumped, deliberately that, yes, probably would have slowed down uptake had some confusion, but which sadly really constrains how good we are at modelling & thinking about long running things very harshly.