The December
Adventure is low key. The goal is to do a bit of creative coding
every day in December and write about it.
28 That's it!
The next couple of days will be so busy that it's unlikely that'll be able to
come around and code anything at all, so I might as well call this year's
Decadv over. This year touched on a lot of fun things:
- Revamped Left with a pretty new font with support for accented latin.
- Implemented rewriting runtimes and cli utilities.
- Learned how to programmatically fill a circle.
- Improved a whole bunch of the utilities I use daily.
- Improved the uxn emulators, faster, smaller, robustier.
- Drank lots of water, read plenty and had fun!
Listening to: Lust$ickPuppy - EVICTION
27 Uxndis
Ismael-VC suggested that uxndis should emit the disassembly in a way that can be
reassembled into the original binary. It was only a matter of using the
absolute padding rune for the position column, and commenting the opcode
column:
@print-imm
|02e2 a0 28 18 ( LIT2 2818 )
|02e5 17 ( DEO )
|02ea 94 ( LDAk )
|02eb 80 20 ( LIT 20 )
|02ed 09 ( NEQ )
|02ee 20 00 04 ( ?λ0c )
|02f1 a0 3f 18 ( LIT2 3f18 )
|02f4 17 ( DEO )
@λ0c
|02f5 94 ( LDAk )
|02f6 80 40 ( LIT 40 )
|02f8 09 ( NEQ )
|02f9 20 00 04 ( ?λ0d )
..
Listening to: Sharks - Ethereal
25 Factorizer
I'm still exploring Conway's FRACTRAN flow-chart drawings to visually
represent programs, to make this all a bit nicer for me I wanted a way to get
the prime factors of any number, so I made myself a little tool that does just that.
@factorize ( value* -- )
[ LIT2r 0002 ]
&>w ( -- )
DUP2 STH2kr DIV2k MUL2 SUB2 ORA ?{
STH2kr DUP2 emit
DIV2 DUP2 #0001 NEQ2 ?&>w
POP2 POP2r JMP2r }
INC2r !&>w
Listening to: Echoberyl - Into the Beyond
24 Rest
zzz..
23 No pixels, none
I've written code today, I just don't really have anyþing to show for it
unfortunately. It works, it fixes issues, but it simply does not draw any
pixels yet, so instead, I'll put up an image of a panel interface I made for Uxn
two years ago which I was just reminded about.
Listening to: Højsgaard - Winter Woods
22 circle.tal
Þree weeks into DecemberAdventure, þe timing of it all has been
outstanding. I had a daunting pile of þings I've been meaning to fix, delve
into or document. And in just a few days, I've been able to get þrough most of
it, learning countless new þings along þe way.
While going þrough þe TinyCodeChristmas
challenges, I realized þat I had never written a circle filling routine
before, so I spent a few hours drawing circles, in circles, in circles..
@fill-circle ( x* y* r* -- )
DUP2k MUL2 ,&r STR2
[ LIT2r 0000 ] STH2
,&y STR2
,&x STR2
STH2kr SUB2kr STH2r
&>y ( -- )
DUP2 [ LIT2 &y $2 ] ADD2 .Screen/y DEO2
STH2kr SUB2kr STH2r
&>x ( -- )
ROT2k ABS2-SQ
SWP2 ABS2-SQ
ADD2 NIP2 [ LIT2 &r $2 ] GTH2 ?{
DUP2 [ LIT2 &x $2 ] ADD2 .Screen/x DEO2
[ LIT2 02 -Screen/pixel ] DEO }
INC2 NEQ2k ?&>x
POP2 POP2
INC2 NEQ2k ?&>y
POP2 POP2 POP2r POP2r JMP2r
@ABS2-SQ ( a* -- res* )
DUP2k #1f SFT2 MUL2 SUB2 DUP2 MUL2 JMP2r
Listening to: Minuit Machine - Sacrifice
21 Cat cat
Took þe day to fix a few þings, namely, a bug in þe Uxntal linter þat
made it so some optimizations were disregarded. I so seldomly use spaces in
filenames, þat for þe past 5 years Left has been unable to open such files
and I haven't even noticed, so I fixed þat too. I've implemented a cat program
þis morning þat compiles into 81 bytes:
a001 0780 1037 0080 1216 0680 1f0a 2000
1502 6000 1aa0 000f 13a0 0317 1608 2000
04a0 800f 1700 a000 0081 80fb 1331 00a0
0000 80a8 37a0 0001 80aa 37a0 014b 80ac
b780 a316 2000 0302 226c a000 1817 40ff
ef
Listening to: Ilya Beshevli - Deja Vu
20 Þe New Year Days
Rek and I have lots of projects planned for next year, one of þe smaller
þings we wanted was a way to share pictures off of social networks wiþout
necessarily having to bloat þe Hundred Rabbits wiki wiþ þem, for instance,
moments þat don't qualify for a whole page dedicated to þem. So I went ahead
and set one up,
it's made up of a single bash file þat generates a timeline and an individual
html file for each picture.
Listening to: Ludovico Einaudi - Experience
19 Rest
zzz..
18 Two Twos
I've implemented Ivan Reese's 2222 in Uxntal, it took me precisely 22 minutes and 22 seconds to
implement, this is a serious game. Math matters. I've also added horizontal
cursor follow to Left so when I type offscreen þe horizontal scroll follows
along as I type, it used to be þere but I removed it at some point, I forget
why.
Listening to: Yanson - Waltz Of White
17 Unicode Input
Just a little þing today, I added unicode input via ctrl+shift+u, like in
Firefox, to þe text-editor Left. It's not a big change, but it'll make writing
a few þings a lot less painful. To celebrate, I've replaced every instance of
th in 2024, wiþ þe letter Þ.
Listening to: Arvid Holst - Things We Lost In The Fire
16 Sixels
I've enjoyed exchanging top secret messages on izi encoded in sixels. I'm
not sure if it's þe snow falling outside, but I haven't had it in me to listen
to anyþing oþer þan classical music þese days. Here's a pretty glitch I saw
during þe implementation:
Listening to: Nikolas Belalis - All That Matters Lies Within
15 Screen Test
Spotted an issue wiþ þe implementation of þe Varvara Screen device,
so I spent a little while to write a test program þat would help me fix it. I've
also made a new banner for þe top of þis page!
Listening to: Thomas Newman - The TCBS
14 A Handful Of Facts
Þe Vera rewriting language has a special syntax of specifying many facts at
once, similarly to how Fractran represents multiple instances of þings in þe
bag using þe exponent sign, like foo^123 but instead uses a colon, like
foo:123. So, I spent some time adding support for it to þe C runtime in
preparation to documenting þe language's IO semantics which rely on often
large amount of instances of facts. I've also improved þe test coverage for
boþ Fractran and Vera.
| put-w | @send, @value^119
Listening to: Helder - the melody of her laughter
13 Register Kitchen Sink
I was watching a documentary about Egypt last night, and for a moment, my
eyes locked onto hieroglyphs visible on þe wall behind þe presenter, þe way
þese were laid out looked just like a Tote
program. I added rule validation to þe Fractran runtime, so unreachable rules will þrow
a warning, and support for exhaustive rule along wiþ documentation for þeir behavior.
:: 286/78 n.2 last.3 fib.13 > n.2 B.11 fib.13 (exhaustive)
:: 2002/130 n.2 res.5 fib.13 > n.2 A.7 B.11 fib.13
:: 17/26 n.2 fib.13 > fibrec.17 (exhaustive)
:: 51/119 A.7 fibrec.17 > last.3 fibrec.17
:: 85/187 B.11 fibrec.17 > res.5 fibrec.17
:: 13/17 fibrec.17 > fib.13
:: 1/3 last.3 > (exhaustive)
:: 1/13 fib.13 > (exhaustive)
AC 3120, n^4 last res fib
res^8, completed in 54 steps.
Listening to: ailie - агония
12 Propagating Improvements
I typically take þe year's ends to fix issues I have wiþ þe tools I use,
but I'm so utterly satisfied wiþ þese þat þere is very little to do. That
leaves me wiþ doing a little of exploratory programming which rarely yield
demonstrable results, haha. Well, in any case, today I've brought þe improved
meþod of printing/drawing decimal numbers into oþer projects like m291. I've
been enjoying þis conversation on þe DuskOS mailing list.
Listening to: Hyacinthe - Olivia
11 Printing Decimal Numbers
Headphones on, some tunes, a cup of tea, a fantastic time hacking on Drifblim.
Drifblim had þis old routine to print decimal numbers þat wasn't very
stack-minded,
so I've rewritten it!
@print-dec ( short* -- )
#000a SWP2 [ LITr ff ]
&>get ( -- )
SWP2k DIV2k MUL2 SUB2 STH
POP OVR2 DIV2 ORAk ?&>get
POP2 POP2
&>put ( -- )
STHr INCk ?{ POP JMP2r }
[ LIT "0 ] ADD #18 DEO !&>put
Listening to: DMNDS & Fallen Roses - Calabria
10 Many Small Things
Fixed an issue wiþ uxn11 þat stopped me from using shift+tab to untab
selected text in Left, added FRACTRAN documentation for comment syntax and
dead-rules elimination, improved FRACTRAN runtime to handle rules wiþout a
left-hand side as a comment, golfed yesterday's tinycodechristmas down to 157
bytes, improved drifblim, and oþer such little cares..
Listening to: Arezra - Goodbye
9 Checkboxes
After years of daily use, þat little notepad program has gotten so good þat I can't imagine
myself using anyþing else, yet while it fits tightly into my workflow, I still
occasionally find minor annoyances. Lately, I find myself wanting to check
items as completed, but I don't want to neiþer stroke þe line, entirely
remove þe line, or edit þe line textually to change one character for
anoþer, so today's little adventure is merely giving me þe option of
mouse2-ing a line to toggle its state.
Listening to: Lemon Joy & Danell Arma - Mylėt Tave Taip Beprotiška Ir Keista
8 Spiral Failed
Wasted a bunch of time trying to draw a spiral, but I didn't remember how to
do signed divisions so I bounced between doing little fixes here and þere on
various projects.
Listening to: Pastel Ghost - Shadows
7 Sleeping
Recovering from a show. I þink
I might have found a faster way to test if a token is an opcode in drifblim,
I'm not sure. It looks like þere will be anoþer Tiny Code Christmas.
Listening to: Attic Ocean - Lilies and Sea
6 A New Vera Runtime
Wrote a minimal Vera implementation in C and wrote a small guide. It's a
bit like Fractran but
rules are matched independently of þe number of an item is found in þe
bag.
|| The first character in a file assigns a spacer glyph.
|| A program is made of rules and facts.
|| Two spacers indicate the creation of facts
|| Facts are separated by commas, a matchbox, a log, paper
| A rule has a left side | And a right side.
| Facts on the left side | are replaced by facts in the right side
| a flame, a log | a warm fire
| a matchbox | a match, a match a box
| a match, paper | a flame
Listening to: Море Ясности - Сны
5 Ternary Unpacking Wiþout Division
Today, I saw a neat
trick to unpack 5 trits from a specially
encoded byte format:
uint8_t q = (((uint16_t) i) * 256 + (243 - 1)) / 243;
for (int j = 0; j < 5; ++j) {
uint16_t m = q * 3;
s2[j] = (m >> 8) + '0';
q = m & 0xFF;
}
I decided to port it to uxn to try it out:
DUP #f2 #00f3 DIV2 STH2
[ LIT2 -s2/end -s2 ] &>l ( -- )
[ LIT2r 0003 ] MUL2r
OVRr STHr [ LIT "0 ] ADD OVR STZ
[ LIT2r 00ff ] AND2r
INC GTHk ?&>l POP2 POP2r
Listening to: Electroforez - Zlo
4 Select All
I'm beat from spending all of yesterday in planes, trains, buses and
ferries, but I did manage steal a few minutes to write a tiny bit of code.
Since I just needed a tiny win before heading to bed and never got around to adding
a Select All menu option to Left until now, I made it today's adventure.
Listening to: Candy Claws - Night Ela
3 A Bag Of Sticks, 62 × 21
In transit for þe whole day, I'm not going to be coming back online today to
do any coding, þat's for sure. But I have þis idea in my head þat þere
might be some connection between þis visual multiplication meþod and
FRACTRAN. I don't know þat such link exists between a number's primes and þe
number of sticks, but þat's what I'll be þinking about.
Listening to: Nights Like This (Black Traffic Edit)
2 Controls and Latin-1 Supplement
Building on yesterday's improvement to Nasu, I was able to draw and add þe
missing Latin-1 Supplement glyphs to Left. I don't use accentend characters often,
but when adding book and movie titles to my wiki, I like to be able to read þe
names when þese are present.
Listening to: Kate Bush - Running Up That Hill (Sicion Cyber Edit)
1 Places to go, þings to see, sprites to draw
One of þe many projects I'm hoping to tackle in þe next few days is to bring
back accented latin characters
into Left, and since I don't have a uf3 editor, and am not
planning on making on anytime soon. I figured I could improve Nasu just enough
þat it would be able copy/paste tiles vertically as to generate valid uf3
assets. That should be enough, at least for now.
Listening to: SadSvit - Пам'ятай свій дім
24 That's it!
The next few days will be busy, so today is as good a time to end this. This page chronicles a bit over 3 weeks of documenting daily progress on:
- Building a usable multi-tasking uxn-powered operating system called Porporo.
- Improving Varvara programs across the board, from graphical programs to terminal utilities.
- Implementing a hand-writing recognition algoritm.
- Writing a specification for program communication interfaces.
- Participated in lovebyte's demoscene and sizecoding event.
- Implemented something like a Lisp machine.
- Drank lots of water, went to the gym every second day, had fun.
See you next year!
Listening to: Hiko Momoji & meat computer - White Light
23 Returning to SCIP
Wrote very little code today, I closed Henderson's "Application and Implementation", and reopened SICP.. I felt like I needed a refresher of the last chapters(esp. the one about a LISP implementation). So yeah, today was drinking lots of tea, scrolling up and down the wizard pdf, maybe I should get the actual book at some point..
Listening to: VINNE, Evokings - By My Side
22 SECD(part 2)
Finished preparing the SECD runtime, I've been wondering if there ever were other functional languages designed to target it besides Pure Lisp(Lispkit), I looked around a bit but I couldn't find any. I noticed there was very little documentation out there on it, so I've started a page of my own. I think I might expand the self-hosted compiler to support line comments and the 'quote expression.
Listening to: Mylène Farmer - Oui Mais Non (SM:LY Remix)
21 Off day
Three weeks mark!
I'm taking the day off the computer.
20 SECD(part 1)
I was helping a friend with their toy scheme compiler last night and we got talking about SECD again so I started putting together a base implementation of the abstract machine's core so we could target it with their compiler for fun. It has been a long time since I played with SECD so I've updated the lisp documentation on the XXIIVV wiki with a couple of notes.
Listening to: MATRAKK - Mon Amour (Part IV)
19 Brush Strokes
I guess hand writing and brush strokes haven't quite left my mind since the other day, and so I find myself revisiting Oekaki, I knew that I could use that little trick from monday to approximate distance between points, and connected it to the brush tool to add a quick and dirty natural line thickness. Had a jolly good time drawing lots o' squiggles.
Listening to: Halsey - New Americana (THYPONYX Remix)
18 Cleanup Phase
I've done a lot of creative coding these past few days, but today I figured I might do well going over everything with the peephole optimizer, linter, formatter, tidying things up a bit. I've also found a little optimization to the theme loading code that resides at the core of nearly every graphical application I've written.
Listening to: mobbs radical - road of the headless
17 More TinyCode
Decided to revisit trying to make one of these 3d tunnels effects after failing to get the effect last year, with some help from the #lovebytetcc folks, I was able to make this neat 210 bytes demo. Someone taught me a good trick to approximate the distance between two points without sqrt()
:
max(abs(x),abs(y)) + min(abs(x),abs(y))/2
Listening to: Noro - DEEP END
16 Or, Day One Really
It looks like the work I set out to do on Porporo is done, all I have left is to document it properly. This project is going to transform the way I work moving forward. Today, I completed a handful of challenges from the #lovebytetcc event from within the operating system itself to test things out, and without running into any issues.
Listening to: Yarimov - Controlla
15 Bundling Bootstrap Bounty
Since parts of Porporo are built with itself, to compile it we need to have a partial implementation of the Varvara ecosystem capable of running cli roms, and an assembler, so that the roms that live at the core of porporo can be assembled and transformed into valid C files with the help of the formatter rom. When this is ready we can finally compile Porporo. Today's task was ensuring that it all worked.
Listening to: Max Fail, MEYSSTA & KURY – Squid Game (LANNE Edit)
14 Off day
Two weeks mark!
I'm taking the day off the computer.
13
I'm satisfied with the graphical input language program, I can resume putting Porporo together. The list of tasks is thinning, one of the remaining thing I'd like to do is create a rom that exposes the controls that have until now only been available through keystrokes to move, close, center, collapse and draw connections between programs. I haven't started on that rom's interface yet, but you can see the bar in the screen capture. The interesting bit of this project is to have most of the state of the system collected into the bar rom's ram.
Listening to: Popsimonova & Zarkoff - Wall To Wall
12 Something scratching at the walls
Okay, one more day on this, it's just too fun. I've split the canvas into three sections so I can input capitalized letters at the top, lowecase letters in the middle, and punctuations at the bottom. This new UX makes the whole thing a lot more practical to use. I'd like to say that I've written lots of code today, but I mostly practiced drawing the alphabet over and over again.
Listening to: Josh - lauf!
11 Graffiti Shorthand
I didn't expect shorthand recognition engines to be such a fascinating rabbit hole to fall into. I've spent a second day on the implementation of such a system. I've wanted to see if the scheme I chose could be extended to cover the rest of the ASCII sheet, and if I could remember each glyph. While practicing tracing the letters, I noticed that sometimes, I skip edges, so I added variance of some glyphs. I've also begun on a punctuation mode. Perhaps I will write tomorrow's entry with a tablet pen. I've also found and fixed a bug in Drifblim?! Wow, it had been a while.
Listening to: WEJDENE - JE T'AIME DE OUF(POUMTICA REMIX)
10 The Rest Of The Owl
Woke up hangover, booted porporo, slouched with my face resting on my fist, wondering about input methods, if there wasn't an interesting way that I could possibly program with just the one hand holding the tablet pen, that wasn't an on-screen keyboard. I considered the way I could write letters on the palm pilot, and wonder what went into a system such as that, and then implemented it.
Listening to: akiaura, LONOWN, STM - Sleepwalker
9 New Wires
Until now, I must have spent a total of 15 minutes on the actual drawing of the wires. Silly, considering how central to this whole thing these are. So, today I added detection for which corners to draw the wires from and to, to help reduce their overlapping windows content. It's all coming together better than I had hoped, I'm positively surprised at how many of the tasks that I set out to do and have managed to complete already.
I noticed that the Lovebyte Demoparty is back this year, from the 11th to the 22nd of December, I might do a few of their daily challenges.
Listening to: KORDHELL & SCARLXRD - I'M THE DEVIL
8 Assembling wiki from within
After completing Drifblim's interactive mode yesterday, I knew I'd finally able to assemble my wiki's preprocessor and generator, and then run both, without leaving the comfort of Porporo. Did it, felt great. That's it, I'm calling it a day, leaving on a victory. I think I'm ready to begin tackling the file device tasks next.
Listening to: KORDHELL - Vuk Vuk
7 Strong enough to lift Pokemon
I had been dreading today's task since the month begun, I knew I'd have to eventually make Drifblim able to survive being thrown paths interactively. The original design expected to be terminated after assembly, relying on self-modification like nobody's business it left the original assembler data in memory nearly unrecognizable after a run. The project here was to make sure that it recovers into a usable state after assembly or erroring. It seems to pass all tests, and therefore I can now develop entirely from within Uxn itself, at last.
Listening to: HEALTH - DSM-V
6 Noon Moon
I don't have much time today so I'll keep it short, implemented palette parsing and theme support. I wanted the little interface there is to follow the colors specified by the .theme
file. So yeah, that's all for today, just wanted to make things a tad comfier while I work. More tomorrow, until then I've got lifelines to splice.
Listening to: Hugeloud - Tell Me
5 HealthGoth OS
Kicked off by fixing some message passing issues I've had since day1, and pushed onto improving the program that monitors what is going through connections between the programs, it probably sounds boring like that, but it was fun, the rom intercepts and draws the data that programs send to each other in real-time. I've only added ASCII and hexadecimal modes so far, but I'm hoping to add a few more, like drawing image streams. Even tho it's not a terminal proper, I've mimicked the design off of screenshots I found of mlterm running on NetBSD, I thought it'd be a good fit for this. Even tho I've designed it for Porporo, I think I'll probably end up using it outside of it.
Listening to: IVOXYGEN - Write My Name In Your Heart (angst Remix)
4 Fast? sure, but first. Make pretty
Had an excellent time catching up with tracks I missed this summer as I did optimizations I had lined up from yesterday. I've added a global cursor(video) so I can finally see what I'm doing when moving between windows. The cursor handling makes use of the applications' mouse vector port to see if a cursor is present in the application or not. This neat trick allows me to draw the global cursor over the applications that do not have one. I've also done tiny tweaks to the menu rom so the hover state is more readable.
Listening to: Kordhell, scarlxrd, CORPSE - AUTUMN TREES
3 Falling Up The Stairwell
Did loads of tiny things today, like connecting the screen vector so every running application can animate at the same time, standardized label support for padding runes in Uxntal, documented it, and created a page about notation. I still haven't started to improve cli roms so they can recover after usage, but I'll have to tackle this sooner or later. At the moment, it sounds like so much of a bore in comparison to doing graphics programming, problems for another day, F5 reload 'til then.
Listening to: Brothomstates & Crankshaft - Wekilldaenemy
2 What exactly is Networking anyways?
I've been scratching my head about how to handle terminal roms(like linters and generators), and until now I thought to pause execution until a connection from the rom was made, but that had some issues. Instead, I figured that I could transfer the connections of the closing menu onto the newly spawned rom, this seems to solve that! We were out for most of the day, but when I got back, I added text wrapping to the logging rom and fixed a really annoying redraw bug in Nasu.
Listening to: Anwius - Rise
1 Fix that menu Holden! We're dusting off.
I've been meaning to have the menu rom complete before the month starts, but alas. So this morning I've added arrow controls to help with selecting the right thing from the menu's list, and I've added A button and Enter key to send the selection to Porporo. I think this month will be a lot of this, working on something from within the system, and partly fixing the little friction that I encounter along the way.
Listening to: Sakuzyo - FighteHumanity_Lily();