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.

A Little Bit of Forth [video]

39 pointsby owainlewisalmost 10 years ago

12 comments

owainlewisalmost 10 years ago
I found forth a pretty interesting language. Started collecting some useful links if anyone else wants to get started. <a href="https:&#x2F;&#x2F;github.com&#x2F;owainlewis&#x2F;awesome-forth" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;owainlewis&#x2F;awesome-forth</a>
评论 #9641593 未加载
rpcope1almost 10 years ago
I still write some Forth occasionally, it&#x27;s really awesome for embedded systems, as it runs on little MCUs like AVR. It&#x27;s so cool to update the program without reflashing the MCU, and have potentially have an interactive interpreter on such low resource processors.<p>I think becoming proficient with Forth has also made me a better programmer in other languages; for example stack based iterative replacements for recursion come easier, as well as other stack based algorithms. It also makes understand the CPython VM a lot easier.
评论 #9667513 未加载
schsafealmost 10 years ago
If you want to play with an online FORTH interpreter:<p><a href="http:&#x2F;&#x2F;forthfreak.net&#x2F;jsforth80x25.html" rel="nofollow">http:&#x2F;&#x2F;forthfreak.net&#x2F;jsforth80x25.html</a><p><pre><code> ok</code></pre> : fibo 1 dup 45 0 do . dup rot rot + dup loop ;<p><pre><code> ok </code></pre> fibo<p>1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 2 8657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702 887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 43 3494437 701408733 1134903170 ok..<p>The Fibonacci numbers :-)
lukegoalmost 10 years ago
Learning Forth from the OLPC XO boot prompt is one of the most fun things I have done with a computer. Great tutorial here: <a href="http:&#x2F;&#x2F;wiki.laptop.org&#x2F;go&#x2F;Forth_Lessons" rel="nofollow">http:&#x2F;&#x2F;wiki.laptop.org&#x2F;go&#x2F;Forth_Lessons</a>
评论 #9674464 未加载
coroxoutalmost 10 years ago
Nice. Been meaning to dabble more with Forth since stumbling across the Forth Haiku Salon: <a href="http:&#x2F;&#x2F;forthsalon.appspot.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;forthsalon.appspot.com&#x2F;</a>
评论 #9642853 未加载
评论 #9642854 未加载
schsafealmost 10 years ago
I created a FORTH like language some years ago. Also fun.<p>&#x2F;home&#x2F;user&#x2F;st&gt; more fibonacci<p>1#[.&quot; &quot;#@@+#a-;]10,<p>&#x2F;home&#x2F;user&#x2F;st&gt; st fibonacci 45<p>1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 701408733 1134903170<p>&#x2F;home&#x2F;user&#x2F;st&gt;
TheLoneWolflingalmost 10 years ago
I have a soft spot for stack-based languages.<p>Anyone played around with Factor?
评论 #9643258 未加载
评论 #9643449 未加载
mastaxalmost 10 years ago
I&#x27;ve been writing a Forth Interpreter over the past weeks as a way to learn Rust. It&#x27;s very motivating how quickly a working prototype can be whipped up; once the data structures are worked out it&#x27;s basically done. There&#x27;s a quiet beauty and elegance to Forth code that I can&#x27;t really find anywhere else. At the same time, it&#x27;s often frustratingly crufty.
agumonkeyalmost 10 years ago
And for stack lovers :<p>- <a href="http:&#x2F;&#x2F;csclub.uwaterloo.ca&#x2F;media&#x2F;Eric%20LaForest:%20Next%20Generation%20Stack%20Computing" rel="nofollow">http:&#x2F;&#x2F;csclub.uwaterloo.ca&#x2F;media&#x2F;Eric%20LaForest:%20Next%20G...</a><p>- <a href="http:&#x2F;&#x2F;fpgacpu.ca&#x2F;stack&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;fpgacpu.ca&#x2F;stack&#x2F;index.html</a>
schsafealmost 10 years ago
FORTH is a very old and unique language. Different from all the others. You can find it even in the space-ships.<p><a href="http:&#x2F;&#x2F;www.forth.org" rel="nofollow">http:&#x2F;&#x2F;www.forth.org</a>
timonokoalmost 10 years ago
It would be so sweet if the &quot;(&quot; and &quot;)&quot; were defined as push&#x2F;pop from a secondary stack. So &quot;(+ 1 2)&quot; would always be equal to &quot;1 2 +&quot;.<p>: ABS (IF (&lt; DUP 0)) (THEN (- 0 SWAP)) ;
GFK_of_xmaspastalmost 10 years ago
It&#x27;s kind of a shame that you don&#x27;t hear more about forth.