by Ihor Antonov
Hi! Welcome to my page showcasing various cool information about my attempts on the way to build a dynamic retranslator to Uxn!
Uxn(Possibly pronounced "Oxen"?.. The logo seems to be a bull:)
Is a tiny bytecode virtual machine, intended to be portable, like JVM, and small and tiny, like the emulators of some old consoles. The target bytecode was devised to be programmed in a language similar to Forth, but people built compilers for other languages that compile to Uxn, such as a subset of C, the only existing modern implementation of B, various other flavours of FORTH as well as BASIC and I heard someone made a lisp!
There is a variety of apps and games developed for Uxn.
Uxn can run on old hardware, such as Nintendo DS. The author believes that, with the right optimization and compilation techniques, UXN programs can be made to run on even more constrained hardware!
Here you can see the custom-built emulator, made in Lua for testing purposes and for reference, to make sure the operation of the VM is properly understood.
If you want to take a look at a naive implementation of the Uxn -> Asm translator, which serves more like a cautionary tale, you can find it here: URDR (compiler, lua version)
After further research and consideration, a more elaborate approach was devised, utilizing the syntactic power and dynamic nature of PicoLisp to succesfully decompile and statically analyze Uxn roms, to produce control flow graphs, statically analyze types, generate an intermediate representation and compile to Assembly. You can download the source code here: link
Example control flow graph:
This project would be nothing without all the useful technologies that the author used throughout the development! It would be hard to even begin to fathom how it would be possible without all this stuff. There might have been tools, books, and things I have not added to the list because too much stuff was reviewed played, inspected and experimented with in order to get the project to its current state.
This project would not go on without the supervision of Joseph Kehoe! Shoutout to him for his encouragement!
All uxn pics courtesy of https://100r.co/site/uxn.html, the original designers of the UXN VM.
Picolisp was made by Alexander Burger, the project would suffer without this flexible and minimal dialect of Lisp, different from both Scheme and Common Lisp allowing for powerful dynamic hacks.