#VerySlow

PSiReN-X :verified_paw:​PSiReN@psiren.eu
2025-01-25

#Meh... #IT was in #TheMetro; #So, #IT's #DefinitelyNotNews...

#IT's #ContinentalDrift... #IT's #VerySlow; #IT #TakesAges... #WeHaveSomeTime to #Prepare...

πŸ§™βš”οΈπŸ€–πŸΊπŸ€–βš”οΈπŸ§™ | πŸ¦β€‹πŸ¦ΉπŸ―β€‹πŸ¦„β€‹πŸ―β€‹πŸ¦ΉπŸ¦

A #NotNews #NewsAggregation about #ContinentalDrift
2020-02-24

Got `bazc-simple` #compiler working, with type tracking of arguments / stack / locals and no fancy inference algorithms. It takes 0.013s to compile `isoheptane.baz` to C, which is #FastEnough .

Next up is making #Barry engine emit the entire current state of the code to a temporary `.baz` file after each submitted input block. So it becomes a bridge between "use editor to evaluate code in blocks" and "whole program compilation".

Then maybe I'll rip out the audio part entirely, as the #interpreter is too #VerySlow to be useful. Will maybe copy/paste some of that code into #Clive engine.

The eventual aim is to hook up a filesystem watcher to automatically compile the `.baz` to `.c` (with `bazc-simple`), and then Clive can take over with its `.c` to `.so` compiler and `.so` reloader with heap preserving #HotSwap . Full stack will look like:

```
fingers
->
troop // editor
->
barry // collate to `.baz`
->
bazc-simple // compile to `.c`
->
clive-client // compile to `.so`
->
clive-server // reloads `.so`
->
ears
```

2020-02-22

I got bazc (my #Barry #compiler) working (just needed to track types of locals, which was straightforward enough) but it's #VerySlow: it takes 77 seconds to compile isoheptane.baz to C on my laptop. Not exactly useful for #LiveCoding

The full bidirectional #TypeInference is killing performance, especially with my naive implementation of "build a big Set of equations for the whole program then unify it" instead of something more incremental.

The interpreter is also #VerySlow though, on my laptop it can't even run isoheptane.baz in real time (it's about 2x slower than realtime, crudely measured with sndfile audio backend). When compiled via C to machine code, it generates an hour of WAV audio in about a minute.

So compilation makes it about 120x faster, just need to find a way to make the compiler fast enough for live use. If that means giving up bidirectional inference that would be ok I suppose, but I do want overloading, maybe argument-directed (C++-style) would be sufficient.

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst