Goed avond, folkje!
Recently I did a total overhaul of the Symta language, fixing most of the issues which were discovered during the game development.
In addition I've added support for the bytecode interpreter, so now I can execute Symta code during runtime as a script.
That allows to introspect and modify the game engine while it is running. I can't stress enough how useful it is for debugging.
The code itself is being lexically macroprocessed using
https://nashgold.itch.io/new-c-macroprocessorThe same macro-processor I use to preprocess my C code.
The Symta code now looks more like Haskell.
Here is an example of the function parsing `if/then/else`
There are several version of `if` syntax - one normal if A: B else C` and `if:`, which is more like Lisp's `cond`
In addition during the transition phase I have to support the older `if A then B else C` form, till I clean the code out of it.
parse_if Sym =
OCol Sym.src.1
if is_next `:`:
T expect `:` Sym
X parse_offside 0 0 Sym.value Sym.src.0 OCol
ret :: Sym X.0
Cnd Then No
Head parse_xs 1
if is_next `then`:
Cnd = Head
T expect `then` Sym
Then = parse_offside 0 0 T.value T.src.0 OCol
else
if Head.end or not Head.0^token_is(`:`) then
parser_error "missing `:` for" Sym
Cnd = Head.1
case Cnd [H [K [@L] [@R]]]: when K^token_is(`or`) or K^token_is(`and`):
Cnd =: K [H @L] R //huge kludge
Then = Head.2
Else:
if is_next `elif`:
T expect `elif` Sym
GInput =: T.retok(`else`) T.retok(`if`) @GInput
if is_next `else`:
T expect `else` Sym
Else = parse_offside 0 0 T.value T.src.0 OCol
:Sym Cnd Then Else
So I hope to continue working on the game.
I have already made it work with Windows in rather botched way.
Shadows are really buggy, since on Windows I compile with GCC and it doesn't have the proper SSE code for alpha blending.
Main menu is also slowed down to 1 frame per second. And I have no idea what causes it.
I had to disable pthreads, since the Windows version is just agonizingly slow, taking 1 second to perform the stuff that should be microsecond.
That is due to very slow switching, even when usleep gets explicitly invoked.
Moreover, I don't have access to a real Windows machine, so Virtual Box add its of quirks.
TLDR: a ton of issues to solve.