Email or username:

Password:

Forgot your password?
Devine Lu Linvega

I'm writing a sort-of type checker for Uxntal, where arity definitions must match the displacement of the instructions in the function's body.

This exploration is revealing various types of functions, and forcing me to explicitly define these differences for the code to validate.

My tests is a collection of different organizations of functions that people have discovered: git.sr.ht/~rabbits/uxnbal/tree

The source: git.sr.ht/~rabbits/uxnbal/tree

11 comments
nf

@neauoire I wonder at what point this becomes part of the assembler, or at least a standard part of the build process. A strict mode that requires such annotations? I know i can easily forget to update the comments when I’m ploughing ahead, but if the checker tells me (on save!?) then I’ll always do it.

Devine Lu Linvega

@nf I don't think it will become part of the assembler, but it might become part of the recommended syntax. I'll be using it like I do uxnlin, they'll be useful together :)

charlie

@neauoire holy fuck???? how

is the distinction between `--` and `-~` here to catch the case when you forget the JMP2r, or when you add an extra JMP2r but you actually mean to fall-thru? Same thing with `-:` but when you in fact mean to carry the return address to the next subroutine?

This is already fucking genius and would take care of like 99% of my debugging time in Uxntal, not even kidding

Devine Lu Linvega

@bellinitte yes,

-~ fallthrough, don't expect a tail.
-: branch, fork stack state.
-> vector, expect to BRK

max22-

@neauoire i've seen that yesterday, maybe it could be interesting for you :
"The Blissful Elegance of Typing Joy"
joypy.osdn.io/notebooks/Types.

Devine Lu Linvega

@maxime_andre oh! thanks, I hadn't seen this before. Very relevant to my current project :>

Devine Lu Linvega

@maxime_andre I feel like picking joy just makes things more complicated for nothing in this article. They could have used forth and not have to get entangled in all that array-on-stack mess, and their point would still have held. Using De Bruijn style indexes for items on the stack is the central idea here, which is a pretty good idea.

max22-

@neauoire j'avoue que j'ai pas beaucoup regardé la page sur les types... je suis toujours dans l'idée de faire mon propre langage dans le genre joy/factor/xy, et si j'arrive à faire quelque chose sans types ce sera déjà bien 😂 . c'est la n-ième fois que je recommence from scratch...

Devine Lu Linvega

@maxime_andre as tu essayez de faire un implementation de spagetti stack deja? ou les items sur le stack sont des cons cells?
du genre: git.sr.ht/~rabbits/psi-forth/t

Si tu veux je peux t'aider avec cette partie la

max22-

@neauoire en fait mon problème c'est que j'aimerais bien le faire en C, et que ça demande vachement de boulot pour parser, pour faire un garbage collector, etc... (le meilleur essai que j'avais fait c'était en Go, c'est un peu plus facile déjà). Mais hier soir je me suis dit "pourquoi pas faire un compilateur à la place d'un interpréteur", comme ça peu importe le langage, je peux générer du C à la sortie si j'ai envie, (ou du uxntal, hehe))

Go Up