wirewright v0.0.0-iota-randomized3

Wirewright is an experimental symbolic physics environment

Wirewright Logo

Wirewright

Wirewright is an experimental symbolic physics environment.

Gallery

MuSoma

I am excited to announce a new front-end for Wirewright (with the old name :^), MuSoma.

musoma-shot

Introduction

[!WARNING] This is a multi-year research playground and is highly experimental! It can, and will break more than it will work! I don't know if there's any point in this! I don't know what this is "for", either. Sorry.

BEWARE: Weird language ahead!

Most modern programming paradigms model computation as verbs (functions, procedures, processes, etc.) acting upon nouns (e.g. data structures). This isn't exactly a problem to solve, but it turns out you can reduce the number of verbs to just one, and the number of nouns to just one. The only remaining noun is the world. The only remaining verb is the physics.

Wirewright attempts to model computation as a transformation over an immutable world: physics(world) -> world'. The function, physics, is not necessarily pure. In Wirewright, Rack implements it purely: Rack(world) -> world'. MuSoma extends Rack with impurities for I/O; so the function becomes, conceptually, MuSoma(world, io) -> Rack(perturb(world, plan(world, io))) -> world'. In practice, musoma is a bit more intricate than this, of course.

The internals of physics are irrelevant philosophically. In practice, Wirewright uses (hyper)graph rewriting and simple scans here and there. Conceptually, you can think of physics as scanning the world, finding interesting structure in it, and rewriting the world in response (either world or the real world, for that matter).

You do not need to write physics, rack, or musoma; Wirewright provides them for you, along with many other things, so all you care about is the world, and structure in it. Moreover, Wirewright encourages you to forget about the physics function altogether, and instead asks you to situate yourself inside the world. In this sense Wirewright is very similar to a computer game: all fun is out if all you're doing is thinking about how the game is implemented, what game engine it uses and so on. This "embedded" point-of-view is important for concepts such as self-embodied programs.

Since world is ultimately a symbolic world, physics is ultimately symbolic physics. Symbolic physics is, then, roughly, the intersection of graph rewriting, symbolic pattern matching, dataflow, logic programming, and constraint satisfaction.

The world is modeled as a hypergraph (with slight inspiration from Stephen Wolfram's physics project, although the way we end up using the hypergraph, I suppose, differs somewhat).

Self-embodied programs (SEPs) are an important concept which eventually led me to symbolic physics. A SEP is simultaneously an algorithm (because of how physics "animates" it) and a structure (because it exists as such in the immutable world). In a sense, a SEP is a program for physics, as if physics was a computer that one could target. The resulting "instructions" are structure (matter) itself.

Notably, self-embodiedness vanishes unless you situate yourself inside the world, so you only see structure. If you are outside, then you can see the physics function, and so, there's no magic and no self-embodiedness; the physics is an interpreter and structure corresponding to the SEP is its state.

Wirewright is primarily for me and is a playground for some of my ideas. Other than that, Wirewright is for anyone interested in symbolic physics, including its applications to deterministic, symbolic AI.

Currently, Wirewright lets you build very simple circuits using MuSoma, with its graphical front-end. You can look at some examples in the Gallery section below. See the examples/ directory for more. We can do basic graphics and interactivity. Components other than Button remain future work as of now, although implementing them is more or less trivial based on my experience implementing the MuSoma app (which itself uses Wirewright, although in a slightly different way). The problem with buttons, input fields, and other UI widgets is that compared with the core of the project (which is more or less there), they take a very long time to make, while also being incredibly boring and unrewarding ("who cares if you made your own input field, we have input fields already").

References

Inspiration

Wirewright is inspired by various ideas from these amazing people: Francisco Varela, Humberto Maturana, Stephen Wolfram, Niklas Luhmann, Michael Levin, Bret Victor, ... (this list will grow, there are many more of them, and I keep finding more!)

Since the project is in active development right now, it is very early to attribute things precisely. Hopefully, this would be possible later.

Misc

Wirewright's Microfold is heavily inspired by Tailwind CSS

Wirewright MuSoma includes colors from the following themes.

Running Wirewright

You should hopefully be able to just download the latest release of MuSoma.

It's an archive which you will have to extract. Inside the archive are an AppImage and some miscellaneous files, in particular the examples. You should make the AppImage executable if it isn't already:

chmod +x musoma-x86_64.AppImage

Then you should be able to run one of the examples.

./musoma-x86_64.AppImage examples/calculator.wwml

If you want to start with an empty file, you'd probably want to have an editor in it. So create the file and put the editor in it:

echo '((I modify: true structural: true multiline: true compose: true) ("" * "") 0)' > /tmp/example.wwml

Then you can run MuSoma.

./musoma-x86_64.AppImage /tmp/example.wwml

If you hit Shift-R in normal mode (the app starts in it), you'll be able to edit /tmp/example.wwml and MuSoma will live-reload. Any running state will be lost on reload, however.

Hover over things to learn more about them (or, well, about things I've bothered implementing tooltips for). The main things of interest are the examples. You probably won't be able to program much in MuSoma unless you're an exploratory type of person; there are barely any docs, and I have more interesting things to do than writing them, uhmm, sorry, I guess. The whole thing is so exciting I don't want to look back and trace my steps.

[!NOTE] Wirewright doesn't yet quit when you close the window. You'll have to Ctrl-C it by hand. Sorry.

Building Wirewright

Wirewright currently only runs on Linux.

Building with Docker

This is probably the easiest way to build Wirewright. Note that I'm not an expert on Docker, so the Dockerfiles may not be the best ones on the planet.

You can use the build-mu shell script:

sh build-mu.sh

It will eventually output musoma-dist.tar.gz. The archive contains the AppImage and miscellaneous files.

[!NOTE] AppImages built this way may produce a bunch of strange OpenSSL errors on some distros, which prevent networking from working in Wirewright. I'm not sure what the errors are caused by yet, but it feels like something is getting hard-coded somewhere at build-time, in the container, that is then incompatible with the distro the AppImage is run on. In my case, it's Manjaro vs. the standard Crystal Debian Docker image. The whole point of AppImages is destroyed by this, I guess; but that's the state of software in 2026; obviously we're mere steps from "artificial superintelligence", huh?

Building without Docker

Wirewright can be built with Crystal 1.20.0 or later. If I forget to update the version number here, please remember that Wirewright more than likely depends on the newest features and bug-fixes in Crystal. So you are advised to build Wirewright with the latest version of Crystal.

Dependencies

You will need to install Crystal before building Wirewright.

Wirewright requires the following libraries. You should install them before building the project. Most Linux distributions have these in their package registry.

If you get a linker error, this probably means I forgot to include something in the list above. Let me know if that's the case so that it can be made more accurate.

Wirewright vendors the following libraries (see the vendor/ directory):

[!NOTE] Wirewright vendors .a files that I built on my machine. I didn't set anything while building them so they should run fine as long as you're on x86-64. However, this is really brittle unless you happen to have the same versions of dependencies as I have or later. So:

If the linker or something else explodes with weird errors, this probably means .as shipped with Wirewright are junk for your machine, for whatever reason -- modern tech is complicated enough, I suppose. So you may need to build them yourself.

Each package in vendor/ is structured reasonably well (... I guess?) to answer any questions you might have, such as which version of the package to build. Some packages have the patched code there (for transparency, I include a PATCHES file as well). Others don't: you'll have to find their code and clone it yourself, according to the VERSION file. Afterwards, simply replace the .as shipped with Wirewright with your ones.

An alternative route for you is to inspect Dockerfiles in build/ and see what you have to install and do.

Installing shards

shards install

Building the dev tool

Wirewright uses a custom dev tool to manage the various subprojects inside the repo. You can build the dev tool with:

crystal build src/dev.cr --progress --release -Dpreview_mt -Dexecution_context 

Using the dev tool

After running the dev tool build command you should be able to run the dev executable:

./dev

There are several presets available. You can print them with:

./dev g

Right now, the only interesting presets are tests and musoma. Switch using:

./dev g tests # or musoma

And build with:

./dev b

You should then have the testtool executable, which will run tests in the tests/ directory. Or musoma, which is, well, MuSoma.

Want to learn more?

More of my ramblings

See the ramblings/ directory to read more of my ramblings. None of those are of publishing quality and most are probably going to read like pseudo-scientific nonsense. Sorry.

Videos

Visit the YouTube channel of Wirewright for videos about Wirewright: Wirewright — YouTube.

Repository

wirewright

Owner
Statistic
  • 18
  • 0
  • 0
  • 0
  • 3
  • about 22 hours ago
  • May 26, 2024
License

MIT License

Links
Synced at

Sun, 07 Jun 2026 22:50:42 GMT

Languages