[HN Gopher] uxn: a portable 8-bit virtual computer
       ___________________________________________________________________
        
       uxn: a portable 8-bit virtual computer
        
       Author : bpierre
       Score  : 143 points
       Date   : 2021-05-17 17:35 UTC (5 hours ago)
        
 (HTM) web link (100r.co)
 (TXT) w3m dump (100r.co)
        
       | makz wrote:
       | The pico-8 of computers
        
       | fsiefken wrote:
       | nice, i like the aesthetic and the minimalist mindset. i get that
       | small is beautiful and constraints are useful to get to the
       | essence, but I was thinking that fuzix would be more versatile on
       | 8/16 bit chips while easy to virtualize - or would it be less
       | power efficient or needlessly complex? http://www.fuzix.org/
       | 
       | Someone got it running on the RPi Pico
       | http://cowlark.com/2021-02-16-fuzix-pi-pico/
       | 
       | There also is mruby, version 3 can load applications in just 100
       | Kb.
       | 
       | How would these projects compare or differ with the minimalism
       | and design goals of uxn?
       | 
       | less is more from MIT https://spectrum.mit.edu/winter-2007/less-
       | is-more/
        
         | entaloneralie wrote:
         | Uxn running on the Pi Pico:
         | https://twitter.com/hundredrabbits/status/139219273489976115...
         | 
         | Here's how fast it renders animations on a Memory Display:
         | https://merveilles.town/@alderwick/106222101764116637
         | 
         | The DVD bounce program is 317 bytes long when assembled:
         | https://git.sr.ht/~rabbits/uxn/tree/master/item/projects/exa...
        
         | retrac wrote:
         | Slightly different targets, from what I can tell. Uxn starts
         | with a virtual machine spec and builds up from there. The
         | proposed language is simple, and a self-hosted translator
         | wouldn't be too much work. Kind of reminds me of Forth. (Edit:
         | Oh! There already is a self-hosting assembler:
         | https://git.sr.ht/~rabbits/uxn/tree/master/item/projects/sof...
         | )
         | 
         | FUZIX assumes you have a machine of some kind already, and a C
         | compiler for it. I suppose if someone wrote a C compiler
         | targeting Uxn, one could port FUZIX to it in principle.
        
       | AnIdiotOnTheNet wrote:
       | > We want to produce lasting versions of our tools and games, and
       | by using simpler systems(Uxn has only 32 instructions) we can
       | build more resilient software due to their lack of dependencies,
       | and support older hardware when possible.
       | 
       | Lately I've been thinking a lot along similar lines, but have
       | come to a wildly different conclusion about how to do it. Of
       | course, they are explicitly limiting their use-cases so that's to
       | be expected. I generally agree with the idea of a VM that is
       | simple to implement, but I think the result shouldn't look like
       | real hardware with memory addresses and registers and a stack and
       | all that, it should be more abstract and leave more
       | implementation details up to the interpreter/jit.
       | 
       | Regardless, it makes me slightly less gloomy about the future of
       | computing whenever I see more people coming to similar
       | conclusions.
        
         | miloignis wrote:
         | When you said a VM that doesn't look like real hardware, I
         | thought maybe something like WebAssembly! Maybe even that's too
         | HW-y though? (stack, no registers, structured control flow,
         | interaction with outside world only through function calls)
        
         | milkey_mouse wrote:
         | > I generally agree with the idea of a VM that is simple to
         | implement, but... shouldn't look like real hardware
         | 
         | You might appreciate appreciate Urbit's Nock, a "functional
         | assembly language" based on combinator calculus which can be
         | specified in ~40 lines of text, and implemented in ~100 lines
         | of code:
         | 
         | https://urbit.org/docs/nock/definition/
         | 
         | As one might imagine, a naive implementation of this spec would
         | be extremely slow (for example, decrementing _n_ requires
         | incrementing another variable _m_ in a loop until _m+1==n_ ,
         | which is O(n)). A regular JIT can make even the braindead
         | implementation decently fast, but in practice, specific
         | implementations are recognized by the interpreter and replaced
         | with faster ones. The benefit of this approach is that the code
         | itself is rigorously specified by the combinator definition,
         | and you can point the finger at the interpreter if the output
         | from the optimized version differs from the naive
         | implementation.
        
           | AnIdiotOnTheNet wrote:
           | > As one might imagine, a naive implementation of this spec
           | would be extremely slow (for example, decrementing n requires
           | incrementing another variable m in a loop until m+1==n, which
           | is O(n)).
           | 
           | Yeah, see that seems to go way too far, but then again this
           | stood out as similar to ideas I've had:
           | 
           | > The algorithm for decrementing an atom is to count up to
           | it, an O(n) operation. But if the interpreter knows it's
           | running a decrement formula, it can use the CPU to decrement
           | directly.
           | 
           | I had basically the same idea, only since my ideas still look
           | a lot more like an instruction set it was in the form of
           | explicit annotations to identify functions that could be
           | replaced with a specialized instruction if available.
           | 
           | I'll have to look into this thing. Thanks.
        
       | Y_Y wrote:
       | > As it stands today, most software is built with extreme short-
       | sightedness, designed to be run on disposable electronics and
       | near impossible to maintain, we decided to not participate in
       | this race to the bottom.
       | 
       | This is a cool project, but it doesn't seem to me like it
       | demonstrates great foresight or maintainability. The compromises
       | that areade in commercial hardware and software aren't only made
       | just to be evil, but also to make things affordable and useful
       | and widely available.
        
         | qsort wrote:
         | I agree, the motivations are razor thin.
         | 
         | And don't get me wrong, it's awesome. It's a tiny stack machine
         | complete with its own language! And graphic capabilities!
         | 
         | If the page just said "I made it just for the heck of it" I
         | wouldn't like it any less.
        
           | rogerclark wrote:
           | The best things are made by people who make them for specific
           | reasons, even if you don't agree with or understand those
           | reasons. Good art is made by including aspects that you want
           | and rejecting those you do not want. In the case of Hundred
           | Rabbits, their entire body of work would not exist without
           | these motivations.
           | 
           | And really, I doubt that many people make things "just for
           | the heck of it". In reality, they probably have motivations
           | but don't, won't, or can't articulate them.
        
         | nameless912 wrote:
         | I would take a look at the rest of 100rabbits' site. Their
         | whole ethos is artistic, interesting, and anti-commercial.
         | Really fascinating stuff and might put this project into more
         | context.
        
         | karmakaze wrote:
         | It's certainly interesting and fulfills a purpose. I just don't
         | think the stated reasons are as solid.
         | 
         | > Uxn has only 32 instructions
         | 
         | A 6502 has about 30 mnemonics (if you consider the A/X/Y forms
         | together as register addressing modes rather than
         | instructions).
        
       | ilaksh wrote:
       | If you are interested in something really simplistic to get into
       | and slightly related, check out SUBLEQ and High Level Subleq. The
       | C code can be like a one-liner if you want. (Although if you
       | handle a few basic things with output buffering and spread it out
       | a little its more like 13 lines
       | https://github.com/runvnc/sq/blob/master/sq.c). This one might
       | work better, don't remember
       | https://github.com/runvnc/sq/blob/master/sq2.c
       | 
       | https://portal.mozz.us/gemini/biomimetic.me/subleq.gmi
       | 
       | All it does is output characters to STDOUT, but you can do really
       | interesting things with that micro VM and and an ANSI graphics
       | terminal. Also started messing with Tektronix vector graphics
       | which xterm supports.
        
       | samirsd wrote:
       | love the design
        
       | ddingus wrote:
       | This whole thing feels like the INFOCOM way of doing things.
       | 
       | Everyone probably knows, but INFOCOM did the Zork type text
       | adventure games. They chose to author to a virtual machine, which
       | could be ported to many machines once, making all their games
       | playable across a ton of machines.
       | 
       | Today, their software is very accessible. Porting a Z machine is
       | not a super heavy lift. Once done, the library of interactive
       | fiction games is available.
       | 
       | This machine might make a great target for micro controllers and
       | or other smaller scale systems. Could be fun, and a source of
       | smaller scale software for people to explore, build on.
       | 
       | Damn cool! First I've read about this.
        
       | kubb wrote:
       | This is oddly cool a hip, alternative and artistic kind of way.
       | The philosophical motivations for their projects sound dreamlike
       | to me, almost like ideological activism, enough that it'd make
       | you feel that the work that you're doing gives your life some
       | sort of unique meaning. I envy this lifestyle of adventure and
       | creative expression, an idea for a more fulfilling human
       | experience that I somehow know I can never have, but I don't
       | really understand why.
        
         | tomxor wrote:
         | Agreed, I view projects like this as important experiments and
         | inspiration for the wider community. It's good to have people
         | around that are willing to try out implementing lofty and
         | idealogical ideas - even if it ultimately fails at it's
         | intended goals directly, they occasionally spawn the most
         | uniquely valuable unintentional gifts to civilisation.
        
         | analognoise wrote:
         | Counterpoint: Dreamlike hipsterism is utility 0 navel gazing;
         | there's nothing inherently transcendent about computing. You'd
         | do more for the world at a local food bank; it's slacktivism
         | and virtue signaling of the worst kind to see electronic
         | baubles as transcendent or somehow worthy of permanence, the
         | kind of naivete the bubble of Web 1.0 popping should have
         | destroyed, or the misinformation campaigns of the last
         | election, or the latest data breach should have destroyed.
         | 
         | If you want artistic sensibility, fine. But pretending a
         | personal crusade to make permanent computers you can build as
         | an undergrad sophomore is somehow a noble cause is pretending
         | your hobby is cosmic in importance and utterly delusional.
         | 
         | It's like people who bloviate about GPL licenses: you can tell
         | they've never gone to bed hungry.
        
           | tommica wrote:
           | Sometimes naivete is what allows a person to create something
           | that no one else thought was possible.
        
             | ddingus wrote:
             | I agree, and through that dynamic, we have a rich field of
             | exploration / experimentation to draw from.
             | 
             | Just look at all the lessons to be learned from systems of
             | the past. And what can actually be done on them!
        
       | nemo1618 wrote:
       | The mascot looks like something Renee French would draw. :)
        
       | edu wrote:
       | I'm always amazed at the quality and quantity of the projects
       | that 100r are capable of building!
       | 
       | Kudos to them!
        
         | progre wrote:
         | Those two are a huge inspiration for sure! I can recommend
         | their youtube channel: https://m.youtube.com/channel/UCzdg4pZb-
         | viC3EdA1zxRl4A
        
       | nynx wrote:
       | This is beautiful in a way. It reminds me of a future long past.
       | 
       | In a similar vein, wasm has been used for archival purposes. It's
       | likely that a wasm binary compiled today will be able to run many
       | decades in the future, perhaps on architectures not even dreamt
       | of yet.
        
       | fra wrote:
       | The Hundred Rabbit folks are talented and inspiring. I've loved
       | following along their journey, and some of the software they've
       | produced is seriously impressive (check out Orca!).
       | 
       | They've got a Patreon, which I've happily supported for a while
       | https://www.patreon.com/100.
        
       ___________________________________________________________________
       (page generated 2021-05-17 23:00 UTC)