9 ms·
1x Forth (1999)
- pointfree 10y agohttps://www.youtube.com/watch?v=NK0NwqF8F0k https://www.youtube.com/watch?v=NK0NwqF8F0k "Chuck Moore, the inventor of Forth and ColorForth programming languages, gives a presentation on writing "1x software," 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."
- otoburb 10y agoChuck Moore also founded GreenArrays Inc.[1], building on his work at IntellaSys (the previous chip company he founded) and the resultant lawsuits. [1] http://www.greenarraychips.com/ http://www.greenarraychips.com/
- white-flame 10y agoBasically, you can build a cathedral per project. It will be elegant, all parts will be purely sufficient and focused on getting the pieces of that particular project working. But when the project changes in certain ways, that bespoke foundation no longer suffices. Time to take the wrecking ball to it and start building a new cathedral. It is technically true that you can reduce the sheer amount of code involved with a running program, but I for one would not wish to. I would rather inherit the problem-solving, optimization insights, and compatibility tackling of others inherent in OS modules and libraries (along with their "bloat" and complexity), than carry all the weight of non-project-specific development from bare metal. This is a statement of scope and time as well of that of surface of opportunity for bugs and weaknesses.
- to3m 10y agoI think the point is more that you don't build a cathedral at all. Another article, more interesting in my view than this one, about the apparent mindset: http://yosefk.com/blog/my-history-with-forth-stack-machines.html http://yosefk.com/blog/my-history-with-forth-stack-machines....
- white-flame 10y agoI would still point out that that article focuses on bringing everything into the small. Redefine problems so you're not tackling large monstrosities, but simplified versions. Make it so that it neatly fits in little bits of code that directly computes simple things. That's all well and good, but some people are building web browsers, or distributed AI databases, or even large chip development suites that do things that certainly wouldn't fit in 500 lines of Forth. Forth is a great expression evaluator, and has actual compile-time metaprogramming features, which is nice. But it doesn't solve actual large problems for you. It asks you if you can solve a non-large problem, and if you can, you're happy with Forth. It's sort of like retro programming. You can work in a small (architecturally conceptual) scope that handles a few things elegantly, and implement some cool project within those constraints and building blocks. But it's still building a little cathedral per project.
- astrobe_ 10y agoFor "large" projects you do as every other language does: you link/FFI to the C library that does the heavy lifting for you. It's kind of unfair to say "forth can't do browsers" when all browsers are implemented in C/C++ at the core.
- white-flame 10y agoYou link to C when you need speed, and that's not even usually necessary anymore in languages like JavaScript or Lisp. Linking to C doesn't let your code somehow abstract higher, to deal with larger projects and larger architectural scopes.
- 10y ago
- flogic 10y agoForth's simplicity is very beautiful. But that simplicity is also why it'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.
- nprescott 10y agoI think I would disagree. I don't know that I had the same read on the article as you, but it didn't seem Moore was advocating simplicity for simplicity's sake, but as a means to and end (where the end is robust, maintainable software). >> If it were a lot simpler I would have a lot more confidence that the technology would endure into the indefinite future. I think he is (correctly) speaking to the byzantine systems which have been propped up (successfully!) to engineer the kinds of applications we are accustomed to (terminal emulators spanning hundreds of thousands of lines of code, web browsers spanning tens of millions etc.). It seems (from what I've read from and about Moore) his idea of empowering people is simplifying the surface area of a problem, rather than simplifying an interface to the problem (for lack of a better phrase). People can't really use the solutions he presents or advocates to solve the kinds of problems they face with computers as they are being used but the argument might be made that they're solving the wrong problem. I think that we'll eventually come around to some diluted, almost unrecognizable conclusion along these lines - see the number of people advocating a "burn it all down and start over" approach after just half a century of computing. See also the amount of work spent on maintaining compatibility with relatively ancient systems in spite of these arguments.
- microcolonel 10y agoI take this approach personally. I make it a rule to run as little software as possible. Sadly, every business seems to want an "app" for everything: I know this from being in the applications business. Even if I wanted to, I couldn't get away from the web browser, and it has to be Chromium. I dream of a future where my bank (for example) publishes API documentation which can be used to successfully implement a working first-class client. That client can then be an actually-good piece of software. The web is an awful platform for applications, and the only reason for its success in this space was ubiquitous and consistent deployment.
- Lerc 10y agoI have a hard time imagining how some tasks could be managed while using the disciplines that make Forth useful. What are some examples of highly complex tasks that have had Forth programs written for? Something like Starcraft in Forth. Or perhaps the most complicated Paint Program written in Forth.
- richard_todd 10y agoI almost said "uh, Starcraft was written in Forth" but I was thinking of Starflight. (https://en.m.wikipedia.org/wiki/Starflight https://en.m.wikipedia.org/wiki/Starflight)
- keenerd 10y agoThere is the "Workstation in a Mouse" http://www.ultratechnology.com/scope.htm http://www.ultratechnology.com/scope.htm Bit of a toy demo though since it only ran a single fake program. A chess game: http://www.ultratechnology.com/chess.html http://www.ultratechnology.com/chess.html The largest serious suite I know of is a VLSI CAD/simulator for silicon chip design: http://www.ultratechnology.com/okad.htm http://www.ultratechnology.com/okad.htm http://www.ultratechnology.com/okad2.htm http://www.ultratechnology.com/okad2.htm Pictures of it in action: http://www.ultratechnology.com/tape1-2.htm http://www.ultratechnology.com/tape1-2.htm
- polm23 10y agoPhilae, the probe that landed on a comet, used Forth. https://en.wikipedia.org/wiki/RTX2010 https://en.wikipedia.org/wiki/RTX2010 ChipWits was a programming game written in MacFORTH. https://en.wikipedia.org/wiki/ChipWits https://en.wikipedia.org/wiki/ChipWits
- netten 10y agoforth was used in the philae lander, http://www.cpushack.com/2014/11/12/here-comes-philae-powered-by-an-rtx2010/ http://www.cpushack.com/2014/11/12/here-comes-philae-powered...
- oneshot12345 10y agoLook here for a colorforth like system: https://github.com/phreda4/reda4 https://github.com/phreda4/reda4 Many programs, 2d, 3d, editors, voxels, compilers, etc .. Everything is written in that colorforth inspired language.
- richard_todd 10y agoI tried Forth for the first time three years ago, and it'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's so much fun. People don't often mention this aspect of it. There'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. When I read Moore'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/sw system, recreating it simpler and more elegant in his eyes every time. For years and years. 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 add the ability to make comments and perform if-then control flow from inside the language. You build it up from nothing but it's a functioning language/interpreter the whole time. Very cool.
- brandonmenc 10y agoI could listen to Chuck Moore all day long. Here'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. Part 1: https://www.youtube.com/watch?v=B_cf8n58Ews https://www.youtube.com/watch?v=B_cf8n58Ews Part 2 (the meat of the presentation): https://www.youtube.com/watch?v=Dbd7Xu0ibJM https://www.youtube.com/watch?v=Dbd7Xu0ibJM
- massung 10y agoForth is awesome. Simple as that. But it's important for people (especially those just being exposed to it) to completely understand why, and what it's done for everyone. The indirect threading model was absolutely brilliant. Almost every bytecode VM in existence today owes Forth (and Moore) a giant "thank you." If you never write a lick of Forth code ever, you'll be a better programmer just by researching how its put together. Forth also pushed for simplicity before it was fashionable. Most "modern" languages pride themselves on their landing-page code samples: sum = fold (+) 0 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 "do one thing" succinctly. If it can't be done in one line, you needed to factor the code some more. And, it's not just that the result is one line, it's that _anyone_ can look at it and know what it does instantly. Remember, this was back when BASIC and FORTRAN ruled with GOTO. Finally, I feel that Forth programmers learn - early on - something I don't see many (very good) programmers learning today: instead of constantly abstracting and obfuscating to try and "simplify" 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.
- dewster 10y ago>Almost every bytecode VM in existence today owes Forth (and Moore) a giant "thank you." Funny, I see bytecode VM as one of the things that's fundamentally wrong with computing. It's one more layer of unnecessary crap that doesn't even remotely resemble the underlying hardware.
- vanderZwan 10y ago> that doesn't even remotely resemble the underlying hardware. And that is what makes the code portable and re-usable. See also Rob Pike's Eulogy on Dennis Ritchie[0], where he explains the true strengths of C and Unix: > In the late 1970s, Dennis joined with Steve Johnson to port Unix to the Interdata. From this remove it's hard to see how radical the idea of a portable operating system was; back then OSes were mostly written in assembly language and were tightly coupled, both technically and by marketing, to specific computer brands. Unix, in the unusual (although not unique) position of being written in a "high-level language", could be made to run on a machine other than the PDP-11. Dennis and Steve seized the opportunity, and by the early 1980s, Unix had been ported by the not-yet-so-called open source community to essentially every mini-computer out there. That meant that if I wrote my program in C, it could run on almost every mini-computer out there. All of a sudden, the coupling between hardware and operating system was broken. Unix was the great equalizer, the driving force of the Nerd Spring that liberated programming from the grip of hardware manufacturers. > The hardware didn't matter any more, since it all ran Unix. And since it didn't matter, hardware fought with other hardware for dominance; the software was a given. [0] https://plus.google.com/u/0/+RobPikeTheHuman/posts/33mmANQZDtY https://plus.google.com/u/0/+RobPikeTheHuman/posts/33mmANQZD...
- dewster 10y agoIs there some level of art in CS and processor design? Yes, because there is no one clearly "right" answer to larger problems. CM speaks eloquently, and presses a lot of my buttons (i.e. I agree with him) regarding what is "wrong" 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. I wanted to love Forth, but it'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/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't necessarily a reason to build custom hardware that fits the language (we don't really do that anymore). This Emperor has no clothes. Cue the true believers.
- dewster 10y agoForth 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're doing things in glorified assembly posing as a higher level language than it really is. And the syntax is screwy. No wonder it's a massive struggle to do anything more than trivial projects in Forth, writing assembly is always a huge pain in the ass. We need to get past Forth's exoticism and see it for what it really is: assembly + a huge dose of obfuscating downtrodden underdog philosophy.