An attempt to articulate Forth's practical strengths and eternal usefulness
1–10 of 68 posts
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#2What I see as the real strength of Forth is that if you write your program in source files, there is no abstraction. You stick your word definitions in those source files and let the application you are writing dictate the words you define instead of relying on the dictionary you built up on REPL and things quickly start becoming easy and the code remains readable. It might seem like a lot of work and endlessly reinventing the wheel but if you start with a featureful Forth like gforth it does not take that much time or effort once you have the basics down; you can build complex applications with gforth as easily as you can build up a full Forth with that minimal Forth that fits in your boot sector.
The main thing is learning that application development with Forth is top down design and bottom up writing. You break the application up into its major functions, break those into smaller functions, break those into words and then break those words into those simple sort words that everyone in the Forth community says you should write. Then you start writing code. I am just starting to get the hang of Forth and it is surprisingly quick and powerful once you start getting the sense of it.
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#3Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#4Fairly counting SLOC is a tricky problem, but my count is 1119 lines of code for the C compiler (written in Forth of course), that's less than 8x the count of chibicc, described as the smallest.
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#5I like the spirit of this article, but I find it strange that they open their article by quoting me, but then don't include Dusk OS's C compiler in the list. Fairly counting SLOC is a tricky problem, but my count is 1119 lines of code for the C compiler (written in Forth of course), that's less than 8x the count of chibicc, described as the smallest.
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#6I like the spirit of this article, but I find it strange that they open their article by quoting me, but then don't include Dusk OS's C compiler in the list. Fairly counting SLOC is a tricky problem, but my count is 1119 lines of code for the C compiler (written in Forth of course), that's less than 8x the count of chibicc, described as the smallest.
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#7I like the spirit of this article, but I find it strange that they open their article by quoting me, but then don't include Dusk OS's C compiler in the list. Fairly counting SLOC is a tricky problem, but my count is 1119 lines of code for the C compiler (written in Forth of course), that's less than 8x the count of chibicc, described as the smallest.
That's a good point, thanks. How complete is it?
https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/doc/co...
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#8I like the spirit of this article, but I find it strange that they open their article by quoting me, but then don't include Dusk OS's C compiler in the list. Fairly counting SLOC is a tricky problem, but my count is 1119 lines of code for the C compiler (written in Forth of course), that's less than 8x the count of chibicc, described as the smallest.
That's a good point, thanks. How complete is it?
So, Dusk's compiler is not apple-to-apple comparable to the other, but comparable enough to give a ballpark idea that its code density compares very, very favorably.
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#9Earlier quoted context omitted.
That's a good point, thanks. How complete is it?
It's complete in sofar as being capable of compiling C programs, but it has a few quirks. https://git.sr.ht/~vdupras/duskos/tree/master/item/fs/doc/co...
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#10Earlier quoted context omitted.
That's a good point, thanks. How complete is it?
By design, it's not a fully compliant ANSI C compiler, so it's never going to be complete, but it's complete enough to, for example, successfully compile Plan 9's driver for the Raspberry Pi USB controller with a minimal porting effort. So, Dusk's compiler is not apple-to-apple comparable to the other, but comparable enough to give a ballpark idea that its code density compares very, very favorably.