Author here! This was a super fun project that consumed over a month of evenings and weekends. In the past couple of days I finished the examples, and I'm glad to finally put it out there.<p>I don't quite remember how I fell into the Forth rabbit hole, but I think I first heard about Collapse OS. Then I read yosefk's "My history with Forth & stack machines" [0], which is actually very critical of Forth. But when I saw if/then/else being defined in Forth itself, I was hooked.<p>I've always been fascinated by the idea of having a minimal kernel of primitives from which "everything" can be built. Before Forth, I had only seen that in the form of Lisp's "Maxwell equations of software", which is cool, but always left me a little disappointed because it is too abstract to build something that you can actually interact with - you can't break out of its esoteric nature. The same applies to brainf*ck and other extremely small environments.<p>With Forth, however, you can start from almost nothing, and start adding things like ifs, loops, strings, etc., things that look more like your day-to-day programming. I find that there's a lot of beauty in that.<p>Anyways, I hope the examples in the repository do not look too awful to experienced Forth programmers :D<p>[0] <a href="https://yosefk.com/blog/my-history-with-forth-stack-machines.html" rel="nofollow">https://yosefk.com/blog/my-history-with-forth-stack-machines...</a>
Try it out in a browser emulator:
<a href="https://parkertomatoes.github.io/v86/?type=mbr&content=6h54UAAAAAFAW%2F8363YFdwEhW48H620OdwNzcEBU62QXdwNycEBV61sgdwIwPViFwA%2BVwEiYUOtLKXcBK1tYAdhQ60A5dwRuYW5kW1gh2PfQUOswRHcEZXhpdIflXofl6yJUdwN0aWJqAOsYYncFc3RhdGVoABDrC2x3Az5pbmgCEOsArf%2FgeXcEaGVyZWiTd%2BvxAHmHdwZsYXRlc3Roo3fr4f53lXcDa2V5tADNFlDr0qV3BGVtaXRY6CIB68WydwE66LcAVon%2Biz6Td6Gjd4k%2Bo3eriMgMQKrzpLj%2FJqu4%2FHeriT6Td8YGABABXuuUh%2BVWh%2BWDwASJxuuI8He%2Fd4E7ix6jd4BnAr%2FGBgAQALhbd4s%2Bk3eriT6Td%2Blm%2F%2FwODg4fBxfrC7ghCbsEALkCAM0Qvf52vP7%2FsAC5BBC%2FAADzqug4AIseo3eF23Taid6trIjCqEB1DiQfOMh1CFFX86ZfWXQEix%2Fr4Inwvnt4gOKAChYAEP7KdJn%2F4EJ4iz4CELn%2F%2F7Ag865PgD0AdBC5%2F%2F%2Fyrk%2BJPgIQ99FJKc%2FDsA3oPACwCug3AL8AALQAzRY8DXQdPAh0BuglAKrr7oP%2FAHTpT%2BgZALggCrkBAM0Q69u4IACr6AgAxwYCEAAA6563ALQDzRC0DrMHzRA8CHUMhNJ1CLQCsk%2F%2Bzs0QwwAAVao%3D" rel="nofollow">https://parkertomatoes.github.io/v86/?type=mbr&content=6h54U...</a>
Leaving out numeric literals is an interesting choice to simplify your Forth kernel. Not many languages have sufficiently flexible naming rules to permit something like ": 3 1 2 + ;"<p>Stylistically, one of the main suggestions I took to heart early in my career with Forth was to outright ignore "rot" and "-rot"; they make the stack tricky to follow. I see that helloworld.f defines "rot", but it's only used in one place.