Thursday | 31 OCT 2024
[ previous ]
[ next ]

Uxn - Introduction

Title:
Date: 2023-01-04
Tags:  languages

This will be a light and quick intro intro into uxn. This will also be a retelling of what I think uxn is trying to be as I'm still working out what it is.

Uxn seems to be a virtual machine that is super minimal and simple to implement. The goal is to implement the uxn virtual machine on basically anything. The idea being that you should be able to pick up some random device and get uxn onto it easily. Once you have uxn, you also have the entire software suite that runs on uxn.

The idea sounds similar to java and it makes sense why. Both are languages that target a virtual machine for portability reasons.

The neat thing about uxn specifically is that it comes bundled to use SDL for graphics. I'm actually not sure how this interop works and how portable it is. Obviously very but I don't get why. I think learning how SDL works and how uxn works would help me along the path of adding GUI stuff to UniVerse which is honestly a long term goal. I would love to try and get UniVerse to the level of a proper operating system.

https://compudanzas.net/uxn_tutorial_day_1.html

This is the go to tutorial for uxn but damn is it long. I imagine it's for good reason but I am going to try and write the cliff notes for this and see how that goes. I think it would be very cool to use uxn and build things. To be honest seeing the potato OS that Devine built is so cool that I want to do something similar.

I need to still get an ergonomic setup going. I'm planning on using wsl and uxn32.exe together as I use vim to edit tal files. I still need to figure out how to run uxn code automatically though so that I don't have to keep recompiling. A simple problem with many solutions.

Installing Uxn

Getting uxn going is extremely easy. Simply get the linux tar as you will need it to get the uxnasm and uxncli tools for compiling uxn. I'm not sure why the windows link doesn't have this stuff.

wget https://rabbits.srht.site/uxn/uxn-essentials-lin64.tar.gz
tar xvf uxn-essentials-lin64.tar.gz
cd uxn

This is the link to the windows uxn. This will let you run roms on windows.

https://github.com/randrew/uxn32/releases/latest/download/uxn32-essentials.zip

Unzip this there should be a Uxn32.exe. This is what we will be using to test our roms.

Uxn and Vim

I use vim and want syntax highlighting. Luckily someone has already written a plug in for this. The following command will install this plugin. I use pathogen so I put things in the bundle directory.

git clone https://github.com/karolbelina/uxntal.vim.git ~/.vim/bundle/uxntal.vim

Now that I have my uxn environment working, time to get started on the tutorial!

Thoughts on learning and WGU in general

As a side note, I do think the reason I want to play with uxn is definitely because of the computer architecture course and seeing assembly code and thinking about clock cycles and how the registers and cpu work. I wish there were projects for that course.

I already have some ideas to use javafx for some projects especially now that I can quickly get going with graphical applications in java. There are probably similar toolkits that I never learned as I would have never touched intellij or java if I hadn't been forced to. Same thing for uxn and asm in general.