TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

1x Forth (1999)

67 点作者 pointfree将近 9 年前

8 条评论

massung将近 9 年前
Forth is awesome. Simple as that. But it&#x27;s important for people (especially those just being exposed to it) to completely understand why, and what it&#x27;s done for everyone.<p>The indirect threading model was absolutely brilliant. Almost every bytecode VM in existence today owes Forth (and Moore) a giant &quot;thank you.&quot; If you never write a lick of Forth code ever, you&#x27;ll be a better programmer just by researching how its put together.<p>Forth also pushed for simplicity before it was fashionable. Most &quot;modern&quot; languages pride themselves on their landing-page code samples:<p>sum = fold (+) 0<p>But, again, this is old hat for Forth programmers. Languages today use a lot of great, new ideas to accomplish this: FP, pattern matching, closures, etc. But Forth was pushing - back in 1970 - for all functions to &quot;do one thing&quot; succinctly. If it can&#x27;t be done in one line, you needed to factor the code some more. And, it&#x27;s not just that the result is one line, it&#x27;s that _anyone_ can look at it and know what it does instantly. Remember, this was back when BASIC and FORTRAN ruled with GOTO.<p>Finally, I feel that Forth programmers learn - early on - something I don&#x27;t see many (very good) programmers learning today: instead of constantly abstracting and obfuscating to try and &quot;simplify&quot; a solution, take a step back and try and simplify the _problem_ so the solution is obvious. For example, this is what I feel the Rust team has done with memory management. Instead of just throwing more brain cells and cycles at trying to improve old-hat solutions, turn the problem upside-down and - in essence - remove it entirely.
评论 #12121535 未加载
richard_todd将近 9 年前
I tried Forth for the first time three years ago, and it&#x27;s been a kind of guilty pleasure ever since. Even though I can write a program about 3x as quickly in a mainstream language, I sometimes reach for Forth because I think it&#x27;s so much <i>fun</i>. People don&#x27;t often mention this aspect of it. There&#x27;s something satisfying -- in the same way that proving a theorem or solving a riddle is satisfying -- about finding a minimal way to coordinate the data flow on the stack. And, no matter how well you do, it seems you can always stare at it the next day and find a tiny improvement.<p>When I read Moore&#x27;s material, I feel like he fell into that positive feedback loop in some kind of pathological way... He keeps rebuilding and rebuilding basically the same CAD hardware&#x2F;sw system, recreating it simpler and more elegant in his eyes every time. For years and years.<p>Building a forth system from scratch really is an eye-opener... Many have written about how strange and beautiful it is to take your base language and then <i>add</i> the ability to make comments and perform if-then control flow from <i>inside</i> the language. You build it up from nothing but it&#x27;s a functioning language&#x2F;interpreter the whole time. Very cool.
brandonmenc将近 9 年前
I could listen to Chuck Moore all day long.<p>Here&#x27;s my favorite - demonstrating his CPU CAD software back in the early 90s, written in Forth and running on a PC. Quite impressive for back then.<p>Part 1: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=B_cf8n58Ews" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=B_cf8n58Ews</a><p>Part 2 (the meat of the presentation): <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Dbd7Xu0ibJM" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Dbd7Xu0ibJM</a>
pointfree将近 9 年前
<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NK0NwqF8F0k" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NK0NwqF8F0k</a><p>&quot;Chuck Moore, the inventor of Forth and ColorForth programming languages, gives a presentation on writing &quot;1x software,&quot; or how to avoid common sources of bloat in software. Topics covered include: what it means to be Forth (as distinct from other languages), how ColorForth is simpler still than Forth, how common system services such as files, windows, and even local variables, complexify (complect) the software, the impact of bloat, maintenance on that bloat, etc. And, as is usual for Chuck, deeply philosophical thoughts as well.&quot;
评论 #12118311 未加载
评论 #12118729 未加载
flogic将近 9 年前
Forth&#x27;s simplicity is very beautiful. But that simplicity is also why it&#x27;s a dead end. Simplicity is not a worthwhile goal in and of itself. People use computers to get things done. Ultimately the goal is to empower people. All those complicated bits are part of what empowers people. We need things like filesystems, network stacks, operating systems and standards to tie it all together. Foregoing all of that in the modern age effectively leaves you with a computer that might as well be a cog. Which may be fine for some classes of embedded systems but that is increasingly not enough.
评论 #12119005 未加载
Lerc将近 9 年前
I have a hard time imagining how some tasks could be managed while using the disciplines that make Forth useful.<p>What are some examples of highly complex tasks that have had Forth programs written for?<p>Something like Starcraft in Forth. Or perhaps the most complicated Paint Program written in Forth.
评论 #12119490 未加载
评论 #12120626 未加载
评论 #12119362 未加载
评论 #12119248 未加载
评论 #12119519 未加载
评论 #12120464 未加载
dewster将近 9 年前
Is there some level of art in CS and processor design? Yes, because there is no one clearly &quot;right&quot; answer to larger problems. CM speaks eloquently, and presses a lot of my buttons (i.e. I agree with him) regarding what is &quot;wrong&quot; with how the industry approaches computing. But he then goes on to so strongly advocate for his own stuff that he makes it sound like a panacea for all computing ills. He comes across as an underdog with the solution to everything that the world is unjustly ignoring, which is a little weird IMO. He would make a great counter-culture guru.<p>I wanted to love Forth, but it&#x27;s a cumbersome tiny language tied to a couple of stacks that you have to micro manage. DUP, DROP, SWAP, etc. are inefficient, much like copying a value from one register to another, which is why most modern processors are 3 operand (to include the copy&#x2F;move in the operation). And running a stack-based language like Forth on a register-based processor is a poor fit and inefficient, but that isn&#x27;t necessarily a reason to build custom hardware that fits the language (we don&#x27;t really do that anymore). This Emperor has no clothes.<p>Cue the true believers.
dewster将近 9 年前
Forth is maybe one step up from an assembly language for a stack machine. Is Forth difficult to master? Yes, partly because the target hardware is alien, but mostly because you&#x27;re doing things in glorified assembly posing as a higher level language than it really is. And the syntax is screwy.<p>No wonder it&#x27;s a massive struggle to do anything more than trivial projects in Forth, writing assembly is always a huge pain in the ass.<p>We need to get past Forth&#x27;s exoticism and see it for what it really is: assembly + a huge dose of obfuscating downtrodden underdog philosophy.