TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sectorforth: A 16-bit x86 Forth that fits in a boot sector

114 pointsby cblumover 4 years ago

5 comments

cblumover 4 years ago
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&#x27;m glad to finally put it out there.<p>I don&#x27;t quite remember how I fell into the Forth rabbit hole, but I think I first heard about Collapse OS. Then I read yosefk&#x27;s &quot;My history with Forth &amp; stack machines&quot; [0], which is actually very critical of Forth. But when I saw if&#x2F;then&#x2F;else being defined in Forth itself, I was hooked.<p>I&#x27;ve always been fascinated by the idea of having a minimal kernel of primitives from which &quot;everything&quot; can be built. Before Forth, I had only seen that in the form of Lisp&#x27;s &quot;Maxwell equations of software&quot;, 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&#x27;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&#x27;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:&#x2F;&#x2F;yosefk.com&#x2F;blog&#x2F;my-history-with-forth-stack-machines.html" rel="nofollow">https:&#x2F;&#x2F;yosefk.com&#x2F;blog&#x2F;my-history-with-forth-stack-machines...</a>
评论 #24604655 未加载
评论 #24615633 未加载
评论 #24611314 未加载
评论 #24613227 未加载
评论 #24612297 未加载
评论 #24613849 未加载
parkertomatoesover 4 years ago
Try it out in a browser emulator: <a href="https:&#x2F;&#x2F;parkertomatoes.github.io&#x2F;v86&#x2F;?type=mbr&amp;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:&#x2F;&#x2F;parkertomatoes.github.io&#x2F;v86&#x2F;?type=mbr&amp;content=6h54U...</a>
评论 #24613260 未加载
RodgerTheGreatover 4 years ago
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 &quot;: 3 1 2 + ;&quot;<p>Stylistically, one of the main suggestions I took to heart early in my career with Forth was to outright ignore &quot;rot&quot; and &quot;-rot&quot;; they make the stack tricky to follow. I see that helloworld.f defines &quot;rot&quot;, but it&#x27;s only used in one place.
评论 #24610740 未加载
评论 #24612472 未加载
fao_over 4 years ago
Heh, I was thinking about this idea literally last week, nice to see someone&#x27;s done it :)
scottyelichover 4 years ago
Now all we need is a networking layer and we&#x27;ll be all set. <i>evil grin</i>
评论 #24613132 未加载
评论 #24615845 未加载
评论 #24635197 未加载