Please provide the content you want me to translate to Chinese. I need the text within the ```colorForth``` tags.
colorForth

原始链接: https://colorforth.github.io/cf.htm

## colorForth:21世纪的现代Forth colorForth是对经典Forth编程语言的重新构想,针对现代微处理器进行了优化,并注重简洁和效率。它由Chuck Moore开发,是一个紧凑的系统(2KB核心),可以独立运行或在Windows下运行,目前正在移植到GreenArrays的c18核心。 与传统的Forth不同,colorForth使用颜色编码的语法(红色用于定义词,绿色用于编译,黄色用于执行),以视觉上明确代码解释并减少标点符号。它采用两个压栈——一个用于数据,一个用于返回地址——简化了子例程调用并鼓励高度模块化的代码。应用程序存储为人类可读的源代码,并按需重新编译,无需对象库。 主要特性包括文本压缩、一种独特的27键键盘布局以提高打字效率,以及一种创新的预解析词格式,实现近乎即时的编译。colorForth旨在为软件开发提供“全新开始”,提供一个强大而轻量级的替代方案,以其自身的多任务处理和设备驱动程序来替代臃肿的现代操作系统。资源和更多信息可以在在线社区和致力于Forth编程的个人那里找到。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 colorForth (colorforth.github.io) 9 分,作者 tosh 3 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 praptak 14 分钟前 [–] 相关讨论:https://news.ycombinator.com/item?id=45953001 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文
Chuck Moore's Wonderful colorForth Programming Language and Operating System Updated 2009 October
colorForth Home Page Forth has been a recognized programming language since the 1970's. ColorForth is a redesign of this classic language for the 21st century. It also draws upon a 20-year evolution of minimal instruction-set microprocessors. Now implemented to run under Windows, it can also stand-alone without an operating system. Currently being ported to GreenArrays' c18 computer core via the Haypress Creek board. Applications are recompiled from source with a simple optimizing compiler.
  • Stand-alone! Includes operating system.
  • Compact! 2K bytes for core software.
  • Fast! Optimized object code.
  • Simple! Applications stored as source. No object library.
  • Innovative! Text compressed and pre-parsed.
  • Unique! 27-key Dvorak keyboard.
The latest status of colorForth and current projects. Others have been more active than I, so search the web. Distinctive for its use of 2 push-down stacks. The Return stack is used for subroutine return addresses, as usual. The Data stack holds parameters for and results of subroutine calls. This distinction between control and data minimizes the cost of subroutine calls. As a result, Forth code is typically highly factored into many tiny subroutines, called words. Referencing a word causes its code to be executed.

These simple words are easily and thoroughly tested by typing them on the command line. The Edit/Compile/Test sequence is extremely fast, boosting programmer productivity. A philosophy of early binding helps to produce efficient, reliable code.

A new word is defined by a string of previously-defined words ending with a semicolon. The only other syntax is that IF must be matched with THEN, and FOR with NEXT.

In Forth, a new word is defined by a preceeding colon, words inside a definition are compiled, outside are executed. In colorForth a new word is red, green words are compiled, yellow executed. This use of color further reduces the syntax, or punctuation, needed. It also makes explicit how the computer will interpret each word.

colorForth does not conform to the ANS Forth Standard. It is a dialect built upon the instruction set of my Forth microprocessor chips. The Pentium version implements those instructions as macros. And adds others as needed to optimize the resulting code.

Current software is shameful. Giant operating systems linger from the 1970's. Applications are team-produced with built-in obsolescence. User interfaces feature puzzle-solving.

With the huge RAM of modern computers, an operating system is no longer necessary, if it ever was. colorForth includes multi-tasking, and drivers for essential devices. But that is hardly an operating system in the style of Windows or Linux.

Megabytes of software may be required for historical compatibility, but sometimes we need a fresh start. ColorForth provides the necessary capability with kilobytes of code. At boot, it copies disk into RAM. Then compiles the macros that emulate the stack machine that Forth expects. As applications are requested, they are compiled.

A Forth application can take 1% the code employed by the same application written in C.

Except for a small kernal, source is all there is. Object code is recompiled as needed, which takes no discernable time. This saves untold trouble in maintaining and linking object libraries.

Rather than a string of 8-bit characters, colorForth interprets pre-parsed words. A word starts with 4 bits that indicate its color and function - text, number, etc. Then 28 bits of left-justified, Shannon-coded characters, averaging 5.2 bits each. Numbers are stored in binary. Each word occupies 1 or more 32-bit memory locations.

This pre-parsed source makes instantaneous compile possible. A special text Editor is included that understands this format. The source can be un-parsed into a bit string for compression and security.

Here is a sample of source code, the guts of the IDE hard-disk driver. Yes, that's all it takes. Below the line is a 'shadow block' of comments explaining the code.

And here is a paper describing arithmetic for the GreenArrays' c18 computer. Lots of functions implemented with colorForth instructions.

Source code is organized in 256-word blocks. This helps factor code into a managable heirarchy. The code in a block is analogous to that in a C file. But considerably more compact.

Blocks are numbered, some are named. They are displayed with 16x24pixel characters, arranged in a 40x24 format on a 1024x768 display. At the bottom, the contents of the Data stack, and the current word are displayed.

This display format is also used by applications. The large characters are readable and help minimize clutter. Double-size characters are available, as are graphic shapes (triangle, box, hexagon, circle), images (JPEG, GIF), 3D shapes and anything else that's been coded.

Continuing my experiments with keyboards, I currently prefer using 27 keys to provide the 48 characters needed. These are the home keys of a standard 101-key keyboard, allowing the other 74 to be ignored.

The assignment of the keys changes, with the current one displayed on-screen at lower right. It's pleasantly easy to type while referring to the display. These keys minimize finger travel, as close to Dvorak's arrangement as 27 keys permit.

They are used as function keys (menu selects) for applications. The only text that needs to be typed is when editing source code.

Other arrangements are possible. Including, gulp, standard qwerty.

Jeff Fox has written about Forth and colorForth. He also has videos of talks given at Forth meetings.

Glen Haydon publishes literature about Forth. He has copies of Leo Brodie's best-selling book Starting Forth.

The Forth Interest Group organizes meetings and has literature and libraries of Forth code. They are on a Webring that links to other Forth sites.

Elizabeth Rather at Forth, Inc provides commercial-grade Forth systems and applications.

Greg Bailey has information about the ANS Forth Standard and its Technical Committee J14.

联系我们 contact @ memedata.com