Loading [MathJax]/jax/output/CommonHTML/jax.js
Skip to main content


One aspect that I like of the programming language I use daily is its robustness, it'd be hard for it to become unrecoverable.

The language itself relies on a runtime that can be emulated in about 150 lines in most languages(including its own language), and a 2300 bytes self-hosted assembler. There is a bootstrapping toolchain that allows me to recover an assembler from a hex dump on an operating system without cat, or ×d, or even with an implementation of the runtime without a file system.

I've added a few notes on how it all works:
https://wiki.xxiivv.com/site/drifblim#bootstrap

#permacomputing

This entry was edited (6 days ago)
in reply to Devine Lu Linvega

I really, really need to get off my butt and get back to work on my project along these lines.

Not quite as compact, but maybe within an order of magnitude or so of complexity (the compiler is looking to end up around 2000-3000 lines of code, virtual machine around 300ish).

More of a C/Go/Rust family language and 32bit risc machine.

in reply to Devine Lu Linvega

I know the scope of tal is quite defined, I just miss better integration on a host os. I guess is mainly adding custom devices to the VM. I'll have to look into it at some point to see if I can add something that allows doing syscalls.
in reply to Istar Eldritch

Sure, for system calls I'd recommend using System/extension, that's how I do my syscalls, it's quite useful.
https://wiki.xxiivv.com/site/varvara.html#system

If you mean to spawn children process, use the Console device, like how I call mpg123.
https://git.sr.ht/~rabbits/uxn-utils/tree/main/item/gui/m291/src/m291.tal#L37

This entry was edited (5 days ago)
in reply to Devine Lu Linvega

@istar this is likely a very dumb question. How do you do syscalls using the System/expansion? Do you have an example?
in reply to Devine Lu Linvega

Let me see if I understand. This "syscall" is handled by the varbara vm as a fill operation. The vm is then doing the actual memset() to the host kernel. So my current understanding is that to add more syscalls you recommend adding more operations to the System/expansion device in whichever vm I may implement. Is that correct?
in reply to Istar Eldritch

@istar yup! That specific device port is for doing exactly that, adding the syscalls you need.
in reply to Devine Lu Linvega

Right! I was thinking on a more generic syscall operation, the vm would just forward the call directly to the kernel and this would allow things like opening sockets and other fun stuff like creating os threads or subproceses.

The downside of this approach would be that the uxntal code using this approach would be dependent of the specific underlying os, which is no good.

Maybe it is better to do this in a more thoughtful way to make an interface that can actually be ported across multiple devices.

in reply to Istar Eldritch

@istar Oh okay, so not syscalls, more like child processes, for that I use the Console, like with the m291.tal example above. It's not really portable, but it's pretty useful for using uxn as a coordination language for OS tasks.
in reply to Devine Lu Linvega

reminding me of the Bell Labs anecdote (can't remember who it was), who hand-wrote a self-hosted language implementation, and by "feeding the paper to itself", poking the resultant bytes into memory, bootstraped the language from nothing but his own mind.

in this case, considering your scope, hex glyphs etched into granite might be more appropriate than paper.

in reply to Jack Leightcap

@jleigh woah, I never heard of that anecdote, do you think you could find the source for that?
in reply to Devine Lu Linvega

"Douglas McIlroy ported TMG to an early version of Unix. According to Ken Thompson, McIlroy wrote TMG in TMG on a piece of paper and "decided to give his piece of paper his piece of paper," hand-compiling assembly language that he entered and assembled on Thompson's Unix system running on PDP-7."

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.