To view parent comment, click here.
To read all comments associated with this story, please click here.
"But while reading 'Starting Forth' you surely noticed, where I copy the above from?
"
Yes.
"...using Forth words, instead of coding in assembly, usually overall size of your code is smaller, when programming in Forth."
We're still talking about compiled x86 code? Honestly I don't understand the logic, but no matter.
"No. Actually, programming in Forth is rather 'designing one's own problem-specific language'...instead of using ready-available high-level function"
This is fine for programming algorithms, and it's probably fine for OS work. However I'd be worried about leaving typical web developers to write their own functions. I imagine this results in a lot of duplicate code between libraries.
"Since I'm Forth-newbie (learning it about year for now), you may be interested in asking these questions on comp.lang.forth, where you'll meet several experienced Forth-programmers"
Thank you for answering my questions. The language seems to have an almost universal quality to it - I think you'll know what I mean by that.
We're still talking about compiled x86 code? Honestly I don't understand the logic, but no matter.
If I'm correct, there have been studies into that (Like can an Assembler programmer outperform an optimizing C compiler). Result: Only about 10 percent of programmers can outperform an optimizer.
Ans so I guess, that something similar to the above is behind the logic: Forth makes "dirty work" for you.
This is fine for programming algorithms, and it's probably fine for OS work. However I'd be worried about leaving typical web developers to write their own functions. I imagine this results in a lot of duplicate code between libraries.
Nobody said, that Forth is going to replace HTML. Regarding the libraries: Forth programmers often prefer to "reinvent the wheel" - and to implement the things own way - instead of relying on old, fatty, buggy, and (still more and more) bloated libraries.
You're welcome.
"..using Forth words, instead of coding in assembly, usually overall size of your code is smaller, when programming in Forth."
We're still talking about compiled x86 code? Honestly I don't understand the logic, but no matter.
It's been a while since I thought of Forth but from my long term storage...
Technically speaking Forth is a compiled language, but technically speaking Forth is not compiled like other high level languages. Forth has no real syntax, it is mostly code 'words' and data on a stack. As such it is already very compact. Forth is very close to the metal, so it is also very optimal. Forth is not for everyone. But if you like it, you love it. If it is for you, you become a Forth zealot and you try to convert all your friends. And of course they become annoyed, because they have never heard of Forth.




Member since:
2008-08-28
Something doesn't seem right about this. Either forth is emulating a more compact byte code than x86, or it's executing native x86 code. I don't understand how it can be both smaller and as efficient as assembly, can you elaborate?
But while reading "Starting Forth" you surely noticed, where I copy the above from?
I understand that statement, that using Forth words, instead of coding in assembly, usually overall size of your code is smaller, when programming in Forth. I think, it depends on quality of macroassembler you can use, quality of Forth compiler, which you're comparing to - and, of course, on your skills both as assembler- and Forth-coder.
No. Actually, programming in Forth is rather "designing one's own problem-specific language". Forth is the basis. Then instead of using ready-available high-level function (which you'll find in langs like Python), you're designing your own higher-level language using Forth words.
The question is difficult to answer (at least for me) because I don't have the time to implement the same program in a dozen different languages to compare the relative difficulty.
Of course, it's not that easy to measure it. Since I'm Forth-newbie (learning it about year for now), you may be interested in asking these questions on comp.lang.forth, where you'll meet several experienced Forth-programmers, coding in Forth more than 20 years.