Re:Porting to GCC 14: C language issues
by cpeterso on Monday February 19, 2024 @03:05PM
(#39434105)
Are there any compilers our language that parse source files in reverse order? Then you could have a one-pass compiler without forward declarations (though you would need “backward” declarations). :)
Someone shared with me their idea for a parallelized parser, where threads would parse different segments of the source file and then stitch their incomplete ASTs together.
Re:Porting to GCC 14: C language issues
by WalterBright on Monday February 19, 2024 @08:31PM
(#39437002)
> Are there any compilers our language that parse source files in reverse order?
I like the cut of your jib.
In fact, it works so well you don't even notice it working. If the C committee wants to improve C, they should make this an official feature.
P.S. Because of the lack of forward referencing, C code tends to be organized as leaves first, and the entry point at the end. This is simply backwards, the entry point should be at the beginning.