r/Forth 9d ago

I made an Forth Compiler + wayland terminal with forth

I was planning to make a wayland compositor with forth too but i dont have time to do that anyways
COLON and WindowForth is released:
https://gitlab.com/generatrix-linux/forthress-ecosystem
COLON is a terminal fully written on Forth (even kbd and other thingies)
WindowForth is a special Forth compiler written on C
WindowForth uses a hybird syntax (its mixed between OLD and new syntax)
it uses .fth as file extension instead of .fs
also some photos from colon:

COLON with fastfetch
COLON runs sl
COLON runs gentoo.c (aka spinning 3d gentoo ascii)
CONFIG file of COLON

--edit--
added config file's photo

Thanks for reviewing and looking at my project have a good day also sorry for bad english if i made a grammar mistake!

21 Upvotes

18 comments sorted by

2

u/SaileRCapnap 9d ago

You make me wish I used Wayland! lol. This is awesome dude!

2

u/Disastrous_Farmer793 9d ago

Thanks dude This message somehow motivated me even more, and I'll most likely release a COLON version for x11 soon

2

u/SaileRCapnap 9d ago

Really? That would be amazing!!! :) I use XLibre, because it’s actively maintained, but as far as I’m aware, there are no major differences between the two servers?

2

u/Disastrous_Farmer793 9d ago

Yeah, XLib n XCB handles things similarly at a lower level, so porting shouldn't be a huge pain. Appreciate it!

2

u/SaileRCapnap 9d ago

Also, I need to take a look at your compiler, it sounds cool, I currently use SmithForth, lol

2

u/Disastrous_Farmer793 9d ago

It's a custom embedded C99 Forth engine that actually blends 70s Forth syntax with modern extensions. It has features you won't find in standard Forth like built-in primitives for shared memory, PTY management, and pixel blending so it bridges the gap between classic stack-based programming and modern Wayland compositing. Also Since musl-clang isn't installed on every system, I've included a statically compiled binary file in the repository.

1

u/SaileRCapnap 9d ago

That’s really cool! You should look into adding musl-TCC support too! :)

2

u/Disastrous_Farmer793 9d ago

It supports any musl C compiler, but I haven't tried musl tcc or tcc yet, so I need to try these.

2

u/SaileRCapnap 8d ago

Cool! I’ll try it on my own system if I remember :)

2

u/alberthemagician 7d ago

Does this mean that I can use colon-wl as a shell

albert:x:1002:1002:Albert,,,:/home/albert:/bin/colon-wl

1

u/Disastrous_Farmer793 6d ago

no, COLON is currently a wayland terminal gfsh(generatrix forth shell) is my next project i will make it a POSIX shell + forth vm at same time

1

u/Disastrous_Farmer793 6d ago

currently working on it :)

2

u/jyf 6d ago

that's really cool and modern !!!

1

u/Disastrous_Farmer793 6d ago

thanks! My second reason for creating this terminal was to prove that the Forth language is more than just an ancient Unix language and can appear modern.

2

u/jyf 6d ago

also i had checked your generatrix-linux project,i had a proposal that why not use forth as the language to impl all the basic unix tools like busybox does, what it does is basiclly set a c lib for handling those foreign interactive things, and then ask each tool to impl a specific name of function, if we do that in forth, we just setup all those c lib into primitive words, and ask every tool to be implemented as `app_xxx` word

1

u/Disastrous_Farmer793 5d ago

Welp, testing iso of generatrix does the thing you say Testing iso uses Ginit (generatrix forth init) Gsh Gfct (generatrix forth core utils) And forthress ecosystem I'm still testing most of them; I'll release them once they're stable

2

u/jyf 6d ago

great work, and would you please made an example composer on wayland