Skip to main content


Hey #forth people, does the stack effect spacer in word definitions have a name?
Unknown parent

Devine Lu Linvega
@vertigo but it's more than a dash.. it's two dashes!
Unknown parent

Devine Lu Linvega
@oppen yeah, I think I know which one you mean, I've seen the vertical one before, never seen an em dash with a space tho
Unknown parent

Görllewin
or was that just a vertical pipe with a gap from the BBC Micro I'm remembering? ...
Unknown parent

Devine Lu Linvega
@oppen never seen this 0_o I don't think that was in the BBC Micro tho
Unknown parent

Devine Lu Linvega
@karolbelina YES! wow, you're sharp. It's exactly that, I am type checking pure functions
in reply to Devine Lu Linvega

@karolbelina awesome! this has been on my list for a long time. some cool possibilities!
in reply to ∴ esoterik ∴

@d6 @karolbelina I was trying to find prior art for this with others concatenative languages, if you have seen this in the wild I'd love to read about it!

I was wondering if either of you have the patience/tooling to generate a balance table for each opcode? I need a 256 bytes page where each byte is hb: input, lb: output. :flonshed:
in reply to Devine Lu Linvega

@d6 @karolbelina can you describe the format of the table in more detail? I don't quite understand.

I'm interested because of the Beetlang concept: https://melanocarpa.lesarbr.es/hypha/beetlang
in reply to bouncepaw 🍄

@bouncepaw @d6 @karolbelina it would need to be a binary table made of shorts for each opcode corresponding to the opcode hex value. The high byte would be for RST effect, the low byte for WST effect, and each high nibble input, and each low nibble output.

http://wiki.xxiivv.com/site/uxntal_reference.html

For example:

ADD 0021
ADD2 0042
ADD2k 0046
ADD2r 4200
in reply to Devine Lu Linvega

@bouncepaw @d6 @karolbelina Actually, it would be better if RST was in the low-byte so I can use the flag to increment the position by one.

0xffff
[ WST input nibble ] [ WST output nibble ] [ RST input nibble ] [ RST output nibble ]
Unknown parent

tired blip
@tty I dont think Devine is likely to dive into type systems but I'd totally borrow this term for gluumy, I love it
Unknown parent

Devine Lu Linvega
@klardotsh @tty I'm just not sure if type checking is the right word for this, it's more like stack balancing.
Unknown parent

Devine Lu Linvega
@klardotsh @tty every opcode's stack effect is predictable, so a pure function without branching:

@function ( a* b -- c )
ADD ADD
JMP2r

My balancer knows that the stack should be 2 items less then when coming in, I can run through each opcode and get the expected offset, if the balance planned, and the balance actual don't match, then I throw a warning.
Unknown parent

Devine Lu Linvega
@klardotsh Oh! Arity is a good similar concept, thanks 😀
Unknown parent

Devine Lu Linvega
@wim_v12e @karolbelina @d6 Like this: https://merveilles.town/web/@neauoire/109553230734004721
Unknown parent

WimⓂ️
@karolbelina @d6 By binary you mean actual raw bytes or hex codes?
in reply to Devine Lu Linvega

@karolbelina @d6 I understand what the values are you want the generate, but what form should this take? a text file file with hex notation so you can include it into any Uxntal program, or a binary file with just the bytes?
in reply to WimⓂ️

@wim_v12e @karolbelina @d6 Either way is fine, but ultimately, it will end up as raw bytes in a tal file.
in reply to Devine Lu Linvega

@wim_v12e @karolbelina i'm at work now but i may be able to use the table i created for uxntal-mode to generate this:

https://github.com/non/uxntal-mode/blob/main/uxntal-mode.el#L225

(it's used to provide an interactive command to show the stack effect for any instruction with any combination of 2kr).
in reply to Devine Lu Linvega

:: If you are looking for prior art in statically checked stack based languages there is Kitten and Cat. Also, Factor implements stack checking for input and output effects to match, but it is dynamically typed. I've been told Joy does stack checking, but I'm not certain.
in reply to Devine Lu Linvega

@CapitalEx here is cat, in case you hadn't found it yet: https://github.com/cdiggins/cat-language

I'm pretty sure I saw another typed stack language inspired by both cat and kitten somewhere not too long ago but my bookmarks fail me.
in reply to Job

@vanderZwan @CapitalEx I had found it, but thanks, maybe someone reading this might appreciate the link too 😀
in reply to Devine Lu Linvega

:: I figured you already hear of them. I'm very much looking forward to your work in this area. Not many active projects exploring it these days.
Unknown parent

Devine Lu Linvega
@karolbelina @d6 brilliant! I'll take care of the rest 🙏 excellent timing too.
Unknown parent

in reply to Devine Lu Linvega

@d6 @karolbelina As soon as I woke up this morning I realised that wasn't quite right. Messed up the shifts. Hopefully fixed now. It's now properly sorted as well.

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.