We’re roughly on schedule. <a href="https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript" rel="nofollow">https://www.destroyallsoftware.com/talks/the-birth-and-death...</a>
I did something similar with TCL, the basis was using an extension I wrote to handle the UNIX stuff [0]. It operated an On-Premises cloud environment appliance, and `init` was just a TCL script (at one point it was a statically linked binary with the init script embedded, but that turned out to be overkill)<p>[0] <a href="https://chiselapp.com/user/rkeene/repository/tuapi/doc/trunk/USAGE.md" rel="nofollow">https://chiselapp.com/user/rkeene/repository/tuapi/doc/trunk...</a>
Check out this:<p><a href="https://bellard.org/jslinux/vm.html?url=alpine-x86.cfg&mem=192" rel="nofollow">https://bellard.org/jslinux/vm.html?url=alpine-x86.cfg&mem=1...</a><p>and<p><a href="https://bellard.org/jslinux/" rel="nofollow">https://bellard.org/jslinux/</a><p>By the famous Fabrice Bellard who is the creator of QuickJS, QEMU, FFMPEG and many other brilliant and fascinating tools!<p><a href="https://bellard.org/" rel="nofollow">https://bellard.org/</a>
These things are essentially the opposite of one another. Bellard's project is a PC emulator in JavaScript. Compiling things to wasm is pretty trivial now, but jslinux was much more impressive when it came out. It actually still is, for reasons you can see in the technical notes: <a href="https://bellard.org/jslinux/tech.html" rel="nofollow">https://bellard.org/jslinux/tech.html</a><p>This project, on the other hand, is the opposite (and kind of a joke): a set of Linux utilities mostly written in JavaScript.
It’s never early to prepare for JavaScript complete takeover.
> tiny project for building a tiny Linux distribution<p>I am working something similar in Go, and writing an educative blog post series about it: <a href="https://serversfor.dev/linux-inside-out/" rel="nofollow">https://serversfor.dev/linux-inside-out/</a>
Reading the code, I was surprised to see that cd was implemented by calling out to the os library. I assumed that was something the shell or at least userspace handled. At what level does the concept of a “current directory” exist?
It's at the kernel level. Each process has its own current working directory. On Linux, these CWD values are exposed at `/proc/[...]/cwd`. This value affects the resolution of relative paths in filesystem operations at a syscall level.
In the kernel’s process structure. See NOTES - <a href="https://man7.org/linux/man-pages/man2/chdir.2.html" rel="nofollow">https://man7.org/linux/man-pages/man2/chdir.2.html</a>
Unix defines a Working Directory that every process has, changed with chdir(2): <a href="https://man7.org/linux/man-pages/man2/chdir.2.html" rel="nofollow">https://man7.org/linux/man-pages/man2/chdir.2.html</a>
This doesn't <i>technically</i> answer the question: POSIX doesn't concern itself with the kernel interface, only with the libc. Most POSIX systems have a kernel with a syscall interface that mirrors the libc API so that these libc functions are just syscall wrappers, but nothing technically prevents the current working directory to be a purely userspace concept maintained by the libc where all relative paths passed to filesystem functions are translated into absolute paths by the libc function before being passed to the kernel via syscall.<p>But yes, in the BSDs, Linux and Windows, the kernel has a concept of a current working directory.
A very timely endeavor indeed <a href="https://devblogs.microsoft.com/typescript/typescript-native-port/" rel="nofollow">https://devblogs.microsoft.com/typescript/typescript-native-...</a>
Very cool. Good use of quickjs, although it would have been cool if it somehow didn’t need a libc and just used the syscall interface. Makes me want to give that a try.
I remember some core Unix utilities reimplemented in Perl, mainly done for Win32 systems back in the day. OFC the performance coudn't compete with the ones written in C, but it was good enough.
You're thinking of the Perl Power Tools:<p><a href="https://github.com/briandfoy/PerlPowerTools" rel="nofollow">https://github.com/briandfoy/PerlPowerTools</a><p>I guess there are related projects such as busybox which contain a collection of utilities implemented in a single binary. There are others such as toybox, and various alternatives in different languages, or with different licenses to choose from.
Kernighan and Ritchie wept. (Tears of joy at an awesome hack, or tears of sadness at an awesome hack?)
See also this post by the author:<p><i>Making a micro Linux distro</i> [for RISC-V]<p><a href="https://popovicu.com/posts/making-a-micro-linux-distro/" rel="nofollow">https://popovicu.com/posts/making-a-micro-linux-distro/</a>
Many comments here seem to miss the point: this is not running the Linux Kernel in JavaScript<p>This is the Linux Userland reimplemented in JavaScript
[dead]
urgh
strange motivation and implementation. I mean it real. There are many existing open source projects that run Linux on JS.