Earlier quoted context omitted.
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...
Possibly this is why it wasn't mentioned? There are enough differences in that list that I can't imagine any existing C library would compile unchanged.
An attempt to articulate Forth's practical strengths and eternal usefulness
11–20 of 68 posts
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#12Earlier quoted context omitted.
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.
It can be hard to tell how much extra complexity would be introduced by unimplemented features.
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#13Earlier quoted context omitted.
It can be hard to tell how much extra complexity would be introduced by unimplemented features.
Indeed, and it might be why the author didn't try, but I still find it odd to not at least mention how small this C compiler is, even if it is to say that it's not apples-to-apples comparable. I mean, 8x smaller than the smallest C compiler listed is still something notable...
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#14This is a pretty good explanation. I think it maybe undersells the importance of the REPL a bit. (I'm not a Forth expert, but I did write StoneKnifeForth, a self-compiling compiler in a Forth subset, and I've frequently complained about the quality of Forth explainers.)
Howo? Or would you agree that value is perhaps a more suitable word than importance? For me I think these articles have such a tendency to fixate on the strengths of Forth to the extent that they have reduced Forth to those strengths in the eyes of many. TFA does a fair job of avoiding this and shows Forth more as a powerful and flexible general purpose language than a very niche language, but I think it still focuses a bit much on the strengths at cost of the general.
You are a Forth expert compared to me and probably most of HN, so try and keep that in mind with your response if you could.
Edit: I am probably asking for insight into your workflow with Forth, but maybe not?
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#15Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#16I 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?
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#17Earlier 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...
is shortcutting different from short circuiting?
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#18Earlier quoted context omitted.
That's a good point, thanks. How complete is it?
From what I can tell chibicc, unlike tcc, is not a complete c compiler in and of itself. Looking at its source code, it relies upon external tools for both x86_64 code gen and linking: https://github.com/rui314/chibicc/blob/90d1f7f199cc55b13c7fd...
Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#19Re: An attempt to articulate Forth's practical strengths and eternal usefulness
#20[deleted]