Implementing structural editing in #uxntal. I remember having lots of fun with THINK Pascal when the IDE was reformatting my program automatically and I've been meaning to have this as part of my workflow now.
This is really neato. 👀 Structural editing is part of why I want to use a TLV based "sourceless" representation in my PocketViewer thingy. (The other is compactness.) It's interesting that the builtin microlisp editor is also technically just a structural editor for lists, but the interface is like ed(1). Unixy software wastes so much code space and CPU cycles with parsers, so for a truly low tech solution, I think it's best to stick to a single simple grammar.
@csepp yeah, it assembles and disassembles, keeping comments and all types of labels. The source code is actually the binary file itself along with the symbols file.
Ohh so that's why Oquonie comes with a symbols file, I thought it was just for debugging. Btw does the hex editor not have an ASCII column? It's kind of hard to make sense of what's going on without any recognizable strings.
@csepp ah yes that's not a hex editor, that's just left, here's the hex editor with the ascii data, and overlapped in the step debugger, and the raw binary.
I have this crazy idea in mind that goes something like this, in a single keystroke:
- Assemble a program in the classic uxn self-modification style - Run tests that records "fitness" in the routine's literals and iterator boundaries - Save the modified image - Disassemble it and keep working
So one thing about evolutionarily evolving "programs" is that code tends to have a "rough" fitness landscape, so that the shortest-(hamming/edit)-distance path between two fit points may be mostly unfit or mostly nonfunctional. My conclusion working with this sort of thing only works well when the shape of the fitness landscape can be made smooth. Then again, if the peturbation is being done by a human mind instead of an algorithm, maybe you actually *can* find good outcomes that way
right now I'm focusing on two cases where I can raise warnings:
- Ranges that can be reduced, where the boundaries of the tests never reach the literal boundaries set in the program. - Linear logic that can be reduced.
Off-topic, but that Cream font you customized looks glorious every time I see it in one of your posts. I’m curious if there’s any existing way to convert the UFX font to something like OTF?
Thanks, will have to tinker with it! Already found your specs of course, but figured I’d ask about any existing tools before attempting to write my own.
A few missteps after slightly misunderstanding the spec but I got there! The harder part is going to be figuring out how to turn the pixel data back into a bitmap/raster font. To be continued!
I originally tried laying out all the tiles contiguously in the specified order (2x tiles tall for UF2), and then selecting slices from that offsetting by character widths, which was as wrong as it was overcomplicated.
The way it acutally works obviously makes way more sense -- pixel data is always the same size and the character widths are just bounds inside it.
This is obvious in retrospect but somehow wasn't to me at the beginning! 😅
It’s circuitous manual duct tape and bubblegum all the way down 😂 and there are some baseline alignment issues that prevent the font from being used for real, but it works in concept! Details:
Csepp 🌢
in reply to Devine Lu Linvega • • •Structural editing is part of why I want to use a TLV based "sourceless" representation in my PocketViewer thingy. (The other is compactness.)
It's interesting that the builtin microlisp editor is also technically just a structural editor for lists, but the interface is like ed(1).
Unixy software wastes so much code space and CPU cycles with parsers, so for a truly low tech solution, I think it's best to stick to a single simple grammar.
Devine Lu Linvega
in reply to Csepp 🌢 • • •It was surprisingly easy to implement, it'll change how I code a lot I suspect.
Csepp 🌢
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Csepp 🌢 • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •Csepp 🌢
in reply to Devine Lu Linvega • • •Btw does the hex editor not have an ASCII column? It's kind of hard to make sense of what's going on without any recognizable strings.
Devine Lu Linvega
in reply to Csepp 🌢 • • •Csepp 🌢
in reply to Devine Lu Linvega • • •Devine Lu Linvega
Unknown parent • • •Devine Lu Linvega
Unknown parent • • •Devine Lu Linvega
in reply to Devine Lu Linvega • • •- Assemble a program in the classic uxn self-modification style
- Run tests that records "fitness" in the routine's literals and iterator boundaries
- Save the modified image
- Disassemble it and keep working
mcc
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to mcc • • •- Ranges that can be reduced, where the boundaries of the tests never reach the literal boundaries set in the program.
- Linear logic that can be reduced.
nf
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to nf • • •Max Cahill
in reply to Devine Lu Linvega • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Josh Dick :mac: • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Josh Dick :mac: • • •You can use this to see what to expect: https://wiki.xxiivv.com/site/turye.html
XXIIVV — turye
wiki.xxiivv.comJosh Dick :mac:
in reply to Devine Lu Linvega • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Josh Dick :mac: • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to Josh Dick :mac: • • •https://github.com/XXIIVV/oscean/blob/main/src/htm/turye.htm
oscean/turye.htm at main · XXIIVV/oscean
GitHubJosh Dick :mac:
in reply to Devine Lu Linvega • • •XXIIVV — ufx format
wiki.xxiivv.comDevine Lu Linvega
in reply to Josh Dick :mac: • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •The way it acutally works obviously makes way more sense -- pixel data is always the same size and the character widths are just bounds inside it.
This is obvious in retrospect but somehow wasn't to me at the beginning! 😅
Devine Lu Linvega
in reply to Josh Dick :mac: • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •Josh Dick :mac:
in reply to Josh Dick :mac: • • •Devine Lu Linvega
in reply to Josh Dick :mac: • • •Josh Dick :mac:
in reply to Devine Lu Linvega • • •Devine Lu Linvega
Unknown parent • • •Well, I'm glad it worked out 😀