编程与软件工程skilldrick.github.io
Easy Forth:轻松学 Forth(2015)
Easy Forth (2015)
2015 — 2025,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Easy Forth 是一个交互式的 Forth 语言入门教程,通过浏览器内的输入框让读者边学边练。它用浅显的方式介绍这种极简的栈式编程语言,适合想了解 Forth 基本概念和独特语法的读者。
为什么经久不衰:Forth 以极简和高效著称,这篇教程交互友好、篇幅精炼,是理解这种经典嵌入式语言的绝佳入口,因此多年间反复被推荐。
HN 评论精选
推荐了专门介绍串联式(concatenative)语言的资源网站。
不错!如果你喜欢 Forth,可以在 concatenative.org 找到关于类似语言的信息。
richdougherty查看英文原文
Nice! If you like Forth, there's information about similar languages over at http://concatenative.org/.
赞赏教程的即时解析体验,并指出移动端焦点被输入框抢占的问题。
我经常用 dc(1),所以第一反应是在输入框里键入“1 2 3 +”而不换行。很高兴它正确理解了我的意图,而不是只取第一个整数或把整个字符串当整数解析。这类细节能鼓励读者继续读下去 :) 另外,在 Android 的 Firefox 上滚动阅读时输入框会抢焦点,导致无法继续。
vive-la-liberte查看英文原文
I often use dc(1) so my first instinct was to type "1 2 3 +" into the input without intermediate linebreaks. I was delighted to see that this was correctly understood to mean what I wanted to express instead of it doing something silly like taking just the first int of my string or trying to parse the string as a whole straight to int. These are the sort of things which encourage readers to read on :) Edit: Unfortunatelly, when I try to scroll and read the rest, the input field steals focus rendering me unable to continue. Firefox on Android.
对 Forth 中 true 为 -1 的设计原因提出疑问,引发技术讨论。
读起来很愉快!最近我越来越常看到 Forth 的提及,能大致了解它让人很满足。引起我注意的是 Forth 的布尔值:false 是 0,true 是 -1。从二进制看(00000000 和 11111111)这说得通,但有人知道背后有特定的设计决策吗?比如硬件快速检查或位掩码技巧?
danbolt查看英文原文
This is an enjoyable read! I've been coming across mentions of Forth much more often lately, so it feels satisfying being able to get a sense of it. One thing that caught my attention is that Forth's boolean value for "false" is 0, and for "true" is -1. This makes sense if you look at their binary values, being 00000000 and 11111111, respectively. Does anyone know if there was an underlying design decision for this? Fast hardware checking? Bit masking tricks?
指出 Forth 紧凑适合早期硬件,但后缀表示法可读性差、难以维护。
Forth 程序非常紧凑,解释器也很小,非常适合内存只有 8K 的 1970 年代微机。但后缀程序很难理解,一小时后你就忘了自己写了什么。
peter303查看英文原文
Forth programs are very compact. And so are Forth intepreters. Great for 1970s PCs with memories as small as 8K. But postfix programs are hard to understand. An hour later and you've forgotten what you have written.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选