Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

milliForth needs proof #8

Open
jart opened this issue Nov 7, 2023 · 3 comments
Open

milliForth needs proof #8

jart opened this issue Nov 7, 2023 · 3 comments

Comments

@jart
Copy link

jart commented Nov 7, 2023

Hello. You know me as the author of SectorLISP and SectorLambda. You have a cool project. Congratulations on your claim to have developed the world's tiniest programming language. When I published SectorLISP, I included both an implementation of a Turing machine, as well as an example of how SectorLISP can be used to implement itself. Could you do that too?

@fuzzballcat
Copy link
Owner

Yes, definitely! I'll have to think about the second one (to be honest I'm not entirely sure what the canonical metacircular evaluator is for FORTH), but when I get time this is top of my list currently.

@ingenieroariel
Copy link

@fuzzballcat if you use Discord it would be great to have you at the Cosmopolitan Discord Server where a few people are trying to understand how milliForth works.

For example

\\ PRIMITIVES \\
\ Duplicate the top of the stack by getting its memory address and reading it
: dup sp@ @ ;

\\ NUMBER LITERALS \\
\ -1 constant.
\ s@ is a pointer to the state struct at 0x1000
\ 0x1000 NAND 0x1000 = 0xEFFF
\ 0xEFFF NAND 0x1000 = 0xFFFF
: -1 s@ s@ nand s@ nand ;
\ 0xFFFF NAND 0xFFFF = 0x0000
: 0 -1 dup nand ;
\ 0xFFFF + 0xFFFF = 0xFFFE (0x1FFFE)
\ 0xFFFE NAND 0xFFFE = 0x0001
: 1 -1 dup + dup nand ;
\ Creating further number literals is trivial
: 2 1 1 + ;
: 4 2 2 + ;
: 6 2 4 + ;

https://discord.gg/8t92w3YCsg

@fuzzballcat
Copy link
Owner

As you might have noticed, there's now a bf.FORTH file which implements a little brainf**k interpreter to show turing completeness!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants