So I had this idea a few days ago, which I likely do not have the computery words to explain properly, but it goes something like this:
So, #forth has this syntax to define words which is just a comment saying what goes in, and what comes out. And I was wondering if I could use this in conjunction with the actual body of the routine while counting how many items are expected at the end of the routine, and throwing a warning when it doesn't match.
Is it arity validator?
https://en.m.wikipedia.org/wiki/Arity
So, #forth has this syntax to define words which is just a comment saying what goes in, and what comes out. And I was wondering if I could use this in conjunction with the actual body of the routine while counting how many items are expected at the end of the routine, and throwing a warning when it doesn't match.
Is it arity validator?
https://en.m.wikipedia.org/wiki/Arity
Devine Lu Linvega
Unknown parent • • •ratfactor
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to ratfactor • • •mel :ms_coyote:
Unknown parent • • •"The optimizing compiler checks the stack effect declarations of words before they can be run. This ensures that words take exactly the number of inputs and outputs that the programmer declares in source.
Words that do not pass the stack checker are rejected and cannot be run, and so essentially this defines a very simple and permissive type system that nevertheless catches some invalid programs and enables compiler optimizations. "
Devine Lu Linvega
in reply to mel :ms_coyote: • • •https://docs.factorcode.org/content/article-inference.html
Stack effect checking - Factor Documentation
docs.factorcode.orgmcc
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to mcc • • •Stack effect checking - Factor Documentation
docs.factorcode.orgDevine Lu Linvega
Unknown parent • • •Devine Lu Linvega
Unknown parent • • •You'd have to make your own input method I think, will your lisp only be dealing with numbers and arithmetic? Or will it have named functions too?
spooky blip 👻
Unknown parent • • •This transitive tagging is something I've reserved memory for in gluumy for "effects tracking" ("does anything in this call chain do IO?")
Devine Lu Linvega
in reply to spooky blip 👻 • • •Straight-line stack effects
Combinator stack effects
Recursive combinator stack effects
Branch stack effects
https://docs.factorcode.org/content/article-inference.html
Stack effect checking - Factor Documentation
docs.factorcode.orgDevine Lu Linvega
Unknown parent • • •XXIIVV — uxntal alphabet
wiki.xxiivv.comDevine Lu Linvega
Unknown parent • • •Calvin Heim
in reply to Devine Lu Linvega • • •Zorro Notorious MEB 😡
in reply to Devine Lu Linvega • • •vmgen, a sub-project of gforth, has a compiler that uses them in code generation.
https://www.complang.tuwien.ac.at/anton/vmgen/
Index of /anton/vmgen
www.complang.tuwien.ac.atDevine Lu Linvega
in reply to Zorro Notorious MEB 😡 • • •https://docs.factorcode.org/content/article-inference.html
Stack effect checking - Factor Documentation
docs.factorcode.orgmax22-
in reply to Devine Lu Linvega • • •Karsten Schmidt
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to max22- • • •max22-
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to max22- • • •max22-
in reply to Devine Lu Linvega • • •Zorro Notorious MEB 😡
Unknown parent • • •⛧ esoterik ⛧
Unknown parent • • •Devine Lu Linvega
in reply to Zorro Notorious MEB 😡 • • •Zorro Notorious MEB 😡
in reply to Devine Lu Linvega • • •https://en.wikipedia.org/wiki/Joy_(programming_language)
@d6 is right - Factor was originally on the JVM but isn't any more.
https://en.wikipedia.org/wiki/Joy_(programming_language)
But I still want a true interactive macro-assembler - a subroutine-threaded #Forth with inline CODE word capabilities.
programming language
Contributors to Wikimedia projects (Wikimedia Foundation, Inc.)Devine Lu Linvega
in reply to Zorro Notorious MEB 😡 • • •Church encoding in the concatenative language Joy
Danie Palm (DEV Community 👩💻👨💻)