The various parts of this project to reconstruct the functionalities of #Versu are finally coming along.

Lots of material obviously coming from the remaining material of Versu ( Emily Short, Richard Evans: https://versu.com/about/how-versu-works/ ) and the reconstruction of Praxish (James Dameris, Rosaura Hernandez Roman, and Max Kreminski: https://github.com/mkremins/praxish )

Right now I have:

- an exclusion logic db with a trie implementation and which supports copy-on-write and axioms;

- a parser with a syntax very similar to the original from the papers

- a compiler, which transforms a parsed program to an executable engine, and

- an engine, which is the part I'm currently implementing. funny enough, it's definitely not the hard part: lots of the logic is in the exclusion logic system!

I'm... *nnnggg*... almost there! At that point I'll have the full parser, compiler and engine functioning, minor surely some functionality I'll come up with later, but with enough stuff that I should actually be able to start writing some #praxis program and test it!

(three cases actually missing that I still have to write down)

I'm in that phase of the development of the #versu / #praxis reconstruction where weird things happen, like:

- "what, now I should add scopes, local routines and axioms?! Oh wait... It's just 10 lines more in the parsing code and about 50 more in the compiler"

- "uhm, i see, there's a bug where a line with just a comment breaks the parser... Let's see... *Three hours later* ok, now that I've completely rewritten the token generator I can maybe tackle the problem..."

*cone of shame*

#Versu #praxis

WELL talking about binary relationships, it's interesting that I implemented the machinery to bound variables in expressions and then - aehm - forgot to write the parser for it.

(I was indeed thinking the other day: "hey, it's strange that I didn't have to use any precedence tagging in this grammar, but it supports nested expressions... maybe it's just antlr4 being clever again...)

#versu #praxis #suetum

Ok, "let" expressions implemented almost effortlessly, until i realized there are tons of edge cases in handling whitespaces and newlines i hadn't considered.

After many attempts (thanks unit tests for saving me!), it seems the most sensible ways is to restructure the lexer and produce an easier input to the parser. Still working on it, but this will probably solve this and remove lots of weirdness of Dentlr (e.g., when it comes to line numbers...) https://github.com/obiwanjacobi/Dentlr
#versu #praxis #suetum

GitHub - obiwanjacobi/Dentlr: Indent / Dedent token lexer (base class) for Antlr4

Indent / Dedent token lexer (base class) for Antlr4 - obiwanjacobi/Dentlr

GitHub

Have been able to finally make a #suetum program output... something.

Now there's the problem of non-pure external functions, that don't work well with the minimax algorithm, and the fact I'm not performing bindings right with interpolated strings, but... I'm doing it. IT'S ALIVE *cough cough* I mean, it's outputting something.

#versu #praxis

I finally have a #Suetum program actually running to its end!!!

As the #Versu papers suggested, the actual program is insanely long for such a simple interaction (it's about 120 lines), but after all, the interesting part is that this puts the basis for multiple, interacting practices.

So, during the holidays I'll probably put up a basic support for the editor (would love that to be #JetbrainsRider, but I've only created #vscode extensions!) and debugging tools!

#praxis

Cookie monster!

And here it is, the #languageserverProtocol plugin of #suetum for #vscode is mostly done for the features I need right now! Considering this took one and a half day to put together, I'm pretty satisfied with it.

There's tons of improvement that can be done (and I think symbol resolution is something I will sooner or later add), but now I'm up to adding includes (welp, currently the program can only be in a single file!) and debugging tools.

Include instruction added to #Suetum! Which was quite some work, because I've had to adapt lots of code which thought everything was in just one file.

All in all a slow and sleepy day, but since this is free time, I'm more than happy to take things slowly.

Tomorrow it will be about the debugging tools! I already have some ideas which are quite exciting to work on, let's see how they turn out!

#Praxis #Versu

Every time I work with #Avalonia and #ReactiveUI I'm equal parts delighted and enraged. Anyway! The foundations of the debugging tool are on.

Right now I've built an (optional) server that provides the debugging tool for the data necessary to see the internal state of the game as it runs. Simple JSON/RPC over TCP connection, nothing fancy. The idea is to build two main parts: one for querying the fact list, another for the practices and actions.

#suetum #versu #praxis

Fact list initialization and propagation towards the debugging tool is ok, displaying it is still a bit uncertain ;D.

After all, I now have to add filters, which include expressions with free bindings, so that's a part I'll definitely have to rework and expand. The important thing was to have the fact list synchronized between the application and the debugger!

Note to self: making UIs is always a PAIN.

#suetum #versu #praxis

Psst... hey... could I interest you in some... *looks around in a conspiratorial way*... BINDINGS?

#suetum #praxis #versu

Although unassuming, I'm pretty excited for this (also because almost all the code for this part was right practically first try)!

Here the debugging tool is able to to see the available practice instances (and reference to the general practice), and its actions (instantiated). Each action also shows all the conditions, and most of all, whether the conditions are matched for the given Agent, including the results of the sub-conditions! This helps A LOT.

#Suetum #Versu #praxis

Today I've ironed out some bugs and uncomfortable edges, and now I'm ready to find inspiration for the scene I want to test in my next, larger #Suetum program >_>
#praxis #versu

The fact that I was able to slap the .net 8 compiled #Suetum DLL libraries in the #godot C# project, add the missing nuget dependencies, and everything just *worked* is a very much welcome surprise.

#versu #praxis

Sure thing, StreamJsonRpc, "An error occured during serialization" gives me exactly zero (0) clues about what's wrong, especially because it's *you* who's doing the serialization.

(and for some reason, Rider successfully connects in debug mode to #Godot, but doesn't hit breakpoints...? although it can read Godot's console output...? *sigh* I hate when I find a problem while debugging a problem caused by the debug of another problem caused by...) #Suetum #versu #praxis

TURNS OUT I could *sense* the error which was a missing a dependency of the project. One that actually defined a type necessary to work. So, how could it compile in the first place? And why, of all errors, a serialization error? I have a suspect that StreamJsonRpc actually has some catch-all that translates to a generic "serialization error", swallowing the actual problem. *shrugs*
I knew I would find things to correct in the #Suetum implementation as soon as I worked on another example, but I broke my record by finding a problem before the first "start" section or the first practice completed. Yay! ... I guess. #versu #praxis
Fixed some threading bugs in the debugging client - which I thought would be much harder, and instead were all decently easy to face! #Suetum #praxis #versu

*cone of shame, pt. 2*

Does it ever happen to you to completely blank out on the existence of a _whole construct_ of your language, and one which is just about as central to it as possible? No? Oh. Ok. #Suetum #Versu #Praxis

Welp, looks like "for all" and "exists" operator are indeed necessary to build logic programs like i need.

So, this afternoon will be dedicated to that... because it will be... very... simple... to add quantifiers... right? >_>

#suetum #versu #praxis

So, apparently, yes: it was a matter of an afternoon to add support for forall/exists quantification in #Suetum 😮

(also added the possibility to explore the bindings that matched the conditions, to debug problems in matching, and set an icon too)

#praxis #versu

The work on the debugging tool for #Suetum is reaching its completion, but this is the most dense part, conceptually.

Added the possibility to see the agents' heuristics, to time travel (!) between the current and past states of the simulations, and what I'm now working on is the ability of creating "alternative" world states, where you simulate a different choice from the one picked by the game purely inside the debugging tool.

#praxis #versu

I kind of, sort of forgot that axioms are parts of the system, and right now they are completely opaque to the debugger.

So! Let's expand the system the allows for notifications during the unification of logic clauses to work also on axioms, and track a "stack" of the resolution.

This was quite tricky, and revealed a bug in recursive axiom applications, but: it's done! Now, how to properly display it...

#Suetum #versu #praxis

This #Suetum program is doing like a thousand more computations than it should to check a condition, but at least the indented logger produces a very pleasing minimap on the right of the editor.

#versu #praxis