The 4tH compiler
thebeez.home.xs4all.nl
thebeez.home.xs4all.nl
Take an entirely new CPU. A reasonable Forth kernel can be written in as little as 1k assembly code, obviously dependent on said CPU instruction forms and sizes.
Once that is done and one has working serial comms, upload a dictionary at it and get a full featured environment quickly.
Then, write system dependent words in assembly to complete the basic picture and get stuff done.
I have seen skilled Forth users do this kind of thing in a day.
FORTH is terrible at scaling to large systems, though. It's also terrible at hard real-time tasks (like games) or anything requiring much in the way of data structures (FORTH's memory management is about as primitive as you can get).
I can't agree with you there. In fact, Forth was originally conceived to control a telescope.
The attempts I've seen to make FORTH work in a real-time game have all ended in failure. There are technical reasons for this (high cost of inner interpreter overhead, lack of dynamic memory allocation, program structure that makes it difficult to work in large teams) as well as social ones (mostly lack of objective evaluation of quality, and other immature engineering practices).
If inner interpreter overhead is an issue, there are well known solutions to that as well. Subroutine threading removes the inner interpreter entirely, and makes it simple to implement inlining in the compiler, and then there's always the inline assembly approach.
‘Slab allocation’ is an implementation strategy for a ‘normal’ memory allocator, where each block gets freed individually (https://en.wikipedia.org/wiki/Slab_allocation)
I think none of those have much to do with real time, per se.
Inner interpreter overhead may affect performance, but a real time game need not perform well.
Lack of dynamic memory allocation can’t be an issue, as one can always implement it in Forth.
I don’t contest that difficulty to work in large teams is an issue with Forth, but that doesn’t affect ability to write real-time games; it affects ability to write large/complex games.
That guy knows how to make Forth perform real time. He has a bit different take on how to build such a Forth.
Multicore too.
It all depends on what words you want to define and whether they must operate on the stack or not.
Words do not have to always work from stack.
High complexity is entirely possible. I have seen that done too.
Why? I can't think of any reason that this would be the case.
Forth does excel at low memory usage, but the gains are only realized when you don't have a static allocation driving things. Game scenes and most real-time code are statically allocated because statics will allow you to "deliver on what you promise" - if memory is maxed out, the system still hits its deadlines.
The rest of your arguments are also similarly terrible which makes me question your familiarity with Forth.
Here is NASA using Forth:
Forth is on the contrary very opinionated. When you want to implement something in Forth, you have to take into account it's very limited ability to support complexity. Which forces you to think about the problem until you can code a simple enough solution for Forth.
It's a severe limitation, but it's one of the rare cases where a limitation is actually a feature. Forth forces its opinion about simplicity on you and that's a good thing in my opinion, because people tend to underestimate the exponential nature of complexity growth: adding a parameter to a procedure at least doubles the amount of unit tests you have to perform on it; add three parameters and that's a 8x the tests.
But it also makes Forth far less fit for task where handling nightmarish complexities is the main topic. If you can't cut the Gordian knot, you lose.
Maybe in a monolithic program. But I could see successfully tackling some very complex problems with a swarm of Forth programs that are individually very clean and simple.
That sort of approach is presumably one of the basic ideas behind Green Arrays.
You make an interesting point, but what you describe is about the only sense in which I'd respect calling Forth opinionated. In every other sense, walking into a new Forth application is potentially like walking into a new language.
As a good example of how unopinionated it is, here are the jonesforth implementations of the IF and THEN words:
: IF IMMEDIATE ' 0BRANCH , HERE @ 0 , ;
: THEN IMMEDIATE DUP HERE @ SWAP - SWAP ! ;
Don't need those words? Don't implement them and make your own branching abstraction. Feel like you spend too much time juggling the stack? Implement named parameters and local variables. Need records or structs? Do it. Need an object system? Go for it.This is how walking into an application in any language (but yes especially Forth and Lisp(s)) is supposed to be but most are doing it wrong by repeating a lot of boilerplate.
> Forth is not the language. Forth the language captures nothing, it's a moving target. Chuck Moore constantly tweaks the language and largely dismisses the ANS standard as rooted in the past and bloated. Forth is the approach to engineering aiming to produce as small, simple and optimal system as possible, by shaving off as many requirements of every imaginable kind as you can.
> That's why its metaprogramming is so amazingly compact. It's similar to Lisp's metaprogramming in much the same way bacterial genetic code is similar to that of humans – both reproduce. Humans also do many other things that bacteria can't (…No compatibility. No files. No operating system). And have a ton of useless junk in their DNA, their bodies and their habitat.
> Bacteria have no junk in their DNA. Junk slows down the copying of the DNA which creates a reproduction bottleneck so junk mutations can't compete. If it can be eliminated, it should. Bacteria are small, simple, optimal systems, with as many requirements shaved off as possible.
https://yosefk.com/blog/my-history-with-forth-stack-machines...
> "I don't hate women. I just feel better when they're not around."
I don't know who this is quoting—presumably "Beez"—or why, but this is an awful first impression.
That extra effort does not bode well.
background: url(whitenote.jpg) #fffffa;
background-repeat: repeat-y;
For the fix // sometimes when the user reloads the document Netscape 3.01 does not trigger the onLoad event
Netscape 3.01 was released in 1996The JavaScript code is also commented out, in case the browser doesn't know what JavaScript is.
Skeuomorphic spiral notebook was all the rage