5 ms·
The Forth Methodology of Charles Moore (2001)
- exe34 2y agoyou can write "UNTIL" in bold capital letters, but your boss or customer can equally write "right now" in bold capital letters. worse, they can hold on to your paycheck or give it to somebody else.
- smitty1e 2y agoThat is: there are more dimensions to real-world solutions than purely technical.
- kragen 2y agothat's jeff's main point here
- smitty1e 2y agoAnd yet we watch organizations overlook the fullness of the problem on essentially a daily basis.
- exe34 2y agomuh shareholder value
- smitty1e 2y agoSure, but that is purely tactical, getting one to the next quarterly earnings statement. The strategic question is why going long (or, a better strategic/tactical balance) seems so impossible.
- kragen 2y agoit's easy to convince yourself you're playing the long game when you're just screwing up. even in retrospect, it can be hard to tell if you were making a reasonable bet that happened not to pay off, rather than just a dumb bet—or, if you won, to what extent you were making an unreasonable bet that happened to pay off, rather than a savvy one. multiply this by the inevitable fact that, acting in a complex and unpredictable world, everyone is mostly acting out of profound ignorance finally, aside from unpredictability, rapid innovation and capital growth implies a high discount rate: any new innovation must compete with the risk-free return on capital. if we assume 5% per year, we must discount a return 20 years in the future by 64% (≈1-1/e) under these circumstances, it's sensible to focus on short-term gains with a rapid feedback loop, rather than long-term gains which might turn out to be chimerical
- kragen 2y agoin pre-c programming practice it was common to write programming language keywords and variables in all upper case, among other reasons because teletypes and computer character codes often omitted lower case. in prose this rather rebarbative convention serves to distinguish them from natural-language words, much as we often use typewriter typefaces today. it is not intended as shouting, which i think is your reading. the loop we write in c as do { x(); y(); } while (!z()); is written in forth as begin x y z until and that is what the all-caps untils in this text refer to: three nested loops the thesis of this document is that you get faster results by taking the time up front to think your problem through until you understand it, and throwing away your code and hardware designs is not something to be afraid of i'm not sure jeff and chuck's results at itv bore this out; hardware kept evolving out from under them too fast, other people's code became more useful (because of shitty hardware, because of the free software movement, because efficiency became less critical, and because of higher-level languages with better reusability), and they ran out of money but simplifying a problem is still immensely valuable when you can do it. the problem with programming continues to be overcomplicating things
- astrobe_ 2y agoIf you read the bio of Charles Moore [1], you will see for yourself that he is well aware of business constrains. Among other things he co-funded Forth, Inc. (which is still alive, as you can see) and was a Forth freelancer. I grant you in advance the point that it was 30-50 years ago and that the situation can be different today. It is however still worth following this methodology when you can afford. There's often a life after deadlines. But that's actually not something specific to Forth. Every programmer does that to some degree. Sometimes it is included in big and small so-called "refactoring" steps. Moreover, one could say at first glance that the core of this methodology is the well known "if you spend more time on design you will spend less time on code". The other thing is that, indeed, in this context it is less of a problem to throw away what you've done because of step 1-2. The phrasing is a bit too abstract; Perhaps clearer is what he said in an earlier interview: "Don't anticipate, solve the problem you've got." [2]. This piece of advice is so beneficial that it is almost a motto for me. It is also harder to do that one may think, because it is so easy to FUD oneself with "what if" and "what about" and sometimes you have to fight against your own hubris too (e.g. "I'll build something powerful"). So it requires some training; after all these years programming in Forth I still catch myself anticipating (e.g. "I think it could be useful to have that"). [1] https://www.forth.com/resources/forth-programming-language https://www.forth.com/resources/forth-programming-language [2] https://www.ultratechnology.com/1xforth.htm https://www.ultratechnology.com/1xforth.htm : Don't leave openings in which you are going to insert code at some future date when the problem changes because inevitably the problem will change in a way that you didn't anticipate. Whatever the cost it's wasted. Don't anticipate, solve the problem you've got.
- zelphirkalt 2y agoAnd yet it is wise to write code in a way that will lend itself well to additions later on. It is bad advice to forgo thinking about making ones code flexible and extensible. To simply spit out some code and without further thought accept the first barely working version of it. This will lead to obstacles, that in businesses will be interpreted as cost of changing something in the future, wgich in turn will lead to decision of simply never making this or that improvement. You will not be given the chance to revise your design later, in many cases, so you better make it work well the first time. One might not be able to anticipate future requirements, but there are situations, in which the engineer, provided they even get the right idea, can make their code reusable with little to no additional time needed, simply, because they know they they are doing and have experience with the matter. The worst that can happen to a product is, when less experienced engineers think to do well in telling the engineer with the experience, that this can be done in the future, when actually that future never materializes. Whole new directions of products die, because of this. Code might become even more, because of not anticipating things, and having to build workarounds later, because one does not get time to refactor and has feature pressure from management. It can all be pretty shortsighted and can limit the output that skilled engineers can provide. Bad management is gonna manage badly.
- coldcode 2y agoIt's a nice philosophy, but good luck doing this in a strict Scrum process.
- cjfd 2y agoWell, there is the question of how much quality we want or need. This process is by someone who created a very terse programming language. Indeed, it probably is a way to create such a thing. Most of us are not writing programming languages, let alone very terse ones. I am not entirely sure it is optimal for that use either. The triply nested loop might be a bit excessive. Of course scrum is, in theory, very flexible. One could have a 'definition of done' that includes the design of at least two alternative solutions, benchmarks for all of these and more stuff like that....
- thesuperbigfrog 2y agoMost of Moore's Forth methodology comes down to extracting the optimal solution by: 1. Iterating your understanding until you have the deep core of the problem. 2. Experimenting with possible solutions until you find the best approach. 3. Not coding the final production code until the first two steps are met. (Maybe this is a variant of Fred Brook's "Plan to Throw One Away"? see https://course.ccs.neu.edu/cs5500f14/Notes/Prototyping1/planToThrowOneAway.html) 4. Writing code and documentation that is simple, direct, and easy-to-understand.
- agumonkey 2y agosomeone online mentioned(i'll link if i find it again) a quote similar to this, something like that: - go crazy in understanding the problem - break it in small words - repeat above steps until it's easy to write in forth
- sitkack 2y agoCharles Moore definitely believes in modifying the original problem so that it fits forth while he modifies forth to fit the problem. I have used a similar approach when I needed to get a PoC out in 6 weeks, we made it, but not without drastically modifying "the spec". In one instance the PM wanted continuous queries over geospatial data, millions of points and arbitrary locations along with a time dimension. I changed the spec to use 3 buckets, near, medium and far. That feature took 2 hours, the continuous query itself would have taken weeks or longer. Successful projects have a malleability to them.
- agumonkey 2y ago> Charles Moore definitely believes in modifying the original problem so that it fits forth while he modifies forth to fit the problem. This philosophy is often described by 80s lispers. They're not top-down nor bottom-up.. they lie in the middle. Trying to make a comfy intermediate layer so they can experiment various upper layers to fit the problem and adjust if rapidly in case of changes. Similar to IR in compilers I guess.
- 2y ago
- sieste 2y ago> 3. Carefully construct a well thought out solution. I think he might be on to something here ...
- LisaST 2y ago[flagged]
- rhelz 2y agoHis methodology has a lot of planning. I'm in general, terrible at planning how long a program will take to be written. But there is one class of programs I am pretty good at: very short, very simple, programs. Good news is that every problem you'll ever face can be broken down into sub-problems which are easier to solve. Bad news is planning a software project in that much detail, down to the granularity needed for me to get accurate time estimates, takes as long as actual doing the programming would. And even at that, there will still be many problems with the plan, because all that time we were not, say, making unit tests, or proto-types large enough to expose problems. But yet, here he is, and his methodology certainly worked for him. I wonder how much Forth itself contributed to that success, or could he have used any interpreted language. Any pointers on how to better estimate programming effort would be greatly appreciated.
- hobs 2y agoMake up a number that sounds good. Check if anyone has done this before in your setting. Multiply this estimate by three. Keep people updated on your progress if you are late.
- exe34 2y ago> multiply this estimate by three https://en.wikipedia.org/wiki/Hofstadter%27s_law https://en.wikipedia.org/wiki/Hofstadter%27s_law
- deleted 2y ago[deleted]
- fractallyte 2y agoCompare it to the process of the Shuttle Software Group, detailed in the FastCompany article, "They Write the Right Stuff" (https://archive.is/HX7n4 https://archive.is/HX7n4) (Previously discussed many times on HN; the most popular post: https://news.ycombinator.com/item?id=23537530 https://news.ycombinator.com/item?id=23537530) To me, the Forth process is more rigorous and less error-prone. It may not be the 'industry standard', but for certain very specialized and intelligent teams (such as the Shuttle Software Group), I'm surprised it hasn't taken off (excuse the pun)...
- coliveira 2y agoThe main weakness of Forth is that modern programming is basically connecting pieces of APIs from different systems. This is true at the OS level, and much more so at the distributed level (web). So you're stuck with languages that help with this type of interfacing, such as Python and Java, while languages that excel in expressibility and logical development like Forth provide little benefit to the type of programming we're forced to do every day.
- 7thaccount 2y agoYou hit the nail on the head. My ideal world would involve me having an extended period of time to research a problem and then artfully craft a perfect solution to a problem that is beautifully documented. The world I live in is mostly crappy software products involving an infinite mess of APIs glued together and poor understanding of the core problem which leads to a huge mess. It's worse for the organization too, but good luck arguing that.
- runlaszlorun 2y ago> The world I live in is mostly crappy software products involving an infinite mess of APIs glued together and poor understanding of the core problem which leads to a huge mess. And now we get to add frequent supply chain attacks to the list. I recently tried NextJS even though I consider myself an ardent framework minimalist. Create app (or whatever) proudly proclaimed it had installed 666 packages. I took that as a hint and bailed…
- 7thaccount 2y agoAn infinite tower of abstractions lol.
- stephen_cagle 2y agoOne other weakness that I sometimes wonder about in relation to Forth is that modern processors are just much more complicated to reason about internally. I am not sure how much efficiency I can pull out of them at reasonable cost considering they likely have. 1) Out of order execution 2) Multiple levels of caches 3) Branch predictors Forth has several neat advantages. I think it might be a better way to reason about a complex problem. It can be bootstrapped on almost any piece of hardware. It can be made to be very memory efficient in its runtime. Those things were true in the past and they are still true now. But I do wonder whether the performance part of it is still true. Not because Forth has changed, but simply due to the fact that modern hardware (+ compilers) can take mediocre code and make it into pretty damn performant code.
- kstrauser 2y agoEverything I read about Forth, and about people's reaction to it, sounds amazing. So why don't we use Forth for everything? Does it have some ceiling that makes it not great outside things like making firmware?
- saulpw 2y agoThe Forth philosophy generates specialized and incompatible systems that are only suitable for one person or small teams. For those teams who develop the system (or are willing to put significant time into learning a bespoke system), it's amazing--a 10x effect. But if you want to share code between teams or on the Internet or if you want fungible engineers (or have rapid turnover such is common in the industry these days) it's not workable. Also, it's incredibly efficient, which is necessary when you have kilobytes of RAM. When you have gigabytes of RAM you can cobble together a Rube Goldberg machine without having to think too much, and time-to-market wins out over system coherence and quality.
- oersted 2y agoIndeed, any language that encourages you to program by building tailored DSLs for every problem domain has the same issue (Lisps, Racket…). It sounds very productive to always be able to express solutions with the perfect language for that type of problem. But you end up with a myriad bespoke languages that are very impractical to document and learn, and are a constant friction for collaboration (even with your future self).
- diffxx 2y agoIt can work if you think carefully about module boundaries so that the dsls do not leak out of their containing scope. Most of the time, dsls are not well bounded and even if they are, they are likely to confuse newcomers to the codebase. Of course, whether or not dsls are used, every program does have custom dsls in the form of functions that newcomers also aren't going to understand so it isn't as though programs written in a vanilla host language don't have many of the same comprehensibility problems as those written in a dsl. That being said, not every piece of code needs to be accessible to everyone. Dsls allow you to create a hermetic world inside of a programming environment in which certain properties always hold, even if the environment does not guarantee these things for you. Programs written in the right dsl can be more productive to write and have much lower overall operational costs. But the price is that the rules of the dsl are not necessarily the same as the rules of the host language and this leads to confusion. For the truly ambitious programmer, it can be worth sacrificing accessibility to the median coder to build systems that the median coder can't even conceive of. Of course your reward is to be derided for not expressing the solution in a language they can already understand. Wrt to Forth itself, Chuck Moore has pointed out that Forth is a multiplier: it makes good programmers better and bad programmers worse. I personally care more about the former property and frankly don't want to work with bad programmers anyway.
- gumby 2y agoMany of these aphorisms are useful in a non-programming context as well.
- coliveira 2y agoI wonder if a programming methodology could work by: (1) writing the solution in Forth and creating a prototype that will be 100% thrown away. (2) making sure that it works. (3) re-writing the solution in a language that will be accepted by the business people. In other words, using Forth as a fast prototype system.
- sitkack 2y agoI have done that with Python, coded up prototype in Python. Wrote tests against service interface. Translated the Python to Java in the second version until the tests passed. It actually did save us a bunch of time, esp since the front end devs could use the Python prototype to do their work.
- mistermann 2y ago> First consider the options that everyone else would reject first, that is where the biggest algorithmic improvement is likely to be found. This is excellent advice for humanity in general.