Wirewright: a rewrite environment for self-embodied programs

Hello World. As a disclaimer, it is really really early to seriously announce Wirewright (despite about 2 years of development), especially because it is missing some core features. But I think it deserves some attention/comments/thoughts anyway, at least first impressions. So I guess a semi-announcement will do :slight_smile: .

There are two “frontends”: the most user-friendly is pprint2_vis (TUI), the newest & most advanced is soma6 (GUI). The former will be removed once soma6 supports suggestions (aka friendliness).

There are some videos (& links) in the repo as well. If you manage to build the thing (see readme), have fun – at least copying what’s in the videos due to the absence of docs/guides/etc.

Beware that it’s very slow right now. The amount of deliberate optimization I’ve done is near zero, and some components are showing their age/incompetency.

4 Likes

That’s some wild shit right there.

I’m looking forward to seeing more of this, it just might take some years .until i actually understand it though :slight_smile:

Thanks haha. The ideas behind the thing are somewhat complex, undeveloped, and niche; but hopefully the software would be self-explanatory & intuitive – and usable in the real world. I just feel there’s something in it. More magic ahead! :slight_smile:

I probably don’t have to tell you, but not everything needs to be usable for something.
Things can just exist because they are “cool shit”. :smiley:

3 Likes

The thing appears to be a tiny bit more solid now, even though there are still lots of ways to crash it! And the internals are very very nasty! And it’s still very slow!

  • I will be publishing AppImages of µsoma periodically to the repo’s releases section. They should allow anyone interested to jump right in. I cannot guarantee the AppImages will work on all machines; I just don’t have enough time to guarantee this as well. But on most, they should?
  • There will also be an occasional video or two. I’ve created a YouTube channel for Wirewright and will publish the videos there, for now just semi-tutorials/showcases. The most recent one is about buttons and log nodes: https://youtu.be/O5O3QVKyRaA.
  • Lots of network magic in progress. I have high hopes it will work, even if slowly at first! I think I’ve stumbled onto something very interesting in the “emergent”/decentralized data structure realm. Will see!
  • More UI stuff ahead as well. UI is very expensive on time; and one also expects a lot (a lot!) from modern UIs. But will see.

Any questions or feedback would be appreciated as well, at least about how it fell apart :slightly_smiling_face:

Without feedback it’s very hard to know what people understand “by default” and what they do not; whether I am presenting “alien technology” here or something that can be picked up quite easily – I myself do not know. There is certainly some “alien technology” under the hood, but hopefully the visuals and the experience are less intimidating. Sorry for the lack of docs or guidelines of course, that’ll come when it’s the right time & when Wirewright is out of the prototype phase. Right now the best bet is in-app hints.

Not sure if this is the right place to write this. I don’t want to pollute the forum here; sorry if I do. But the alternative is me shouting into the void, and I’ve had enough of that already.

2 Likes

This is an amazing Crystal project, please do very much keep shouting about it here :slight_smile:

1 Like

It is now possible to talk over the network in Wirewright, using so-called surfaces (sensors and appearances). This was the last big missing feature. Sensors sense appearances – and appearances excite sensors! The experience is as plug-and-play as possible, although there is a certain… lack of GUI for stuff at the moment. Another big update is modules, which are basically scopes. Many bugfixes as well.

A new YouTube video demonstrating the updates — https://youtu.be/togdztGfpf8.

Hello again. Some more progress on Wirewright.

Major focus was on layout and UI. There’s also the parser rewrite, the Alloy rewrite (Alloy is a “structural” templating engine – instead of working with raw text it’s working with nodes, terms in our case), and other minor improvements.

This is my third (and probably final) pass over the whole system. My design process is much as if I’m a “neural net”, with backprop. So I’d do a first pass, then “reason” backwards and adjust, then start from scratch but with “lookahead” and so on until I get something that feels right.

We now have a reasonably powerful layout engine called UIR, short for UI representation. UIR is about 600 lines of cryptic rewrite rules that excite me very much! And that’s with comments and whitespace; without, maybe 300-400 lines of neat symbolic physics! A bunch of ugly drawing code follows — DwUIR, for drawable UIR, powered now by the beautiful PlutoVG library which merits more attention – because it doesn’t get in the way. There’s also Microfold on top of all that, which is an implementation of something like the box model that CSS has + Tailwind-like styling + cue flow engine.

The latter is a generalization of something like group hover: components can announce they’re there, perhaps based on some state; parents can sense that, changing their styles in response. Maybe that triggers some downward cues as well; or maybe those are triggered independently. Children see those, and may change their styles in response.

The interesting part here is DwUIR is a subset of UIR and UIR is a subset of Microfold; and Microfold trees are a kind of term, which means we can use any of the representations (e.g.WwML) to express and display them, pattern match on them and so on.

There’s Wirewright Rack, which is a new front-end to the new/rewritten bits of Wirewright. The old front-end, soma6, will work (as in compile) for some time but will be slowly replaced by one that’s using the new, much more powerful stuff.

Thanks to Rack, there is also a terminal UI renderer for a subset of DwUIR. This means both Microfold and UIR can be reused to get styling and layout in the terminal. Whatever nodes the terminal renderer recognizes (text, rectangles), it will draw; others, it will simply ignore. The observer metaphor is key here: the terminal is looking at whatever UI description you give it and tries to draw as much as it can, as nicely as it can. This means that certain apps, at least in theory, will be able to run both as GUI and TUI apps without a single line of code changed. This is the hope — not that I’m actively pursuing it. If it just “falls out” of the project, then I know I’m heading in the right direction.

A video showing some of the new stuff and how to get it to run:

What’s new in Wirewright — YouTube

NOTE: my writing may feel very cryptic because I don’t write very much nor talk to people a whole lot, I basically write code and that’s about it :) Maybe ask ChatGPT to “decode” and interact with this message. There is also the wall of text in the project’s README if you’re interested; show it to ChatGPT and ask questions, it should answer them OK – I’ve tried and succeeded, because sometimes, I fail to understand my output myself!

An honorable mention to the part of me that doesn’t want to spam here.

1 Like