3 ms·
Headers are the huge achilles heel of the C-based languages. Pascals modules were MUCH better. Pascal always built code faster in my experience, because it was
by t43562 2y ago
Headers are the huge achilles heel of the C-based languages. Pascals modules were MUCH better. Pascal always built code faster in my experience, because it wasn't parsing megabytes of headers just to compile a hello world program. This also probably makes a pascal compile much simpler to implement as it's not 2 languages layered together.
Macros in C are an utter disaster imo. If you want to get an AST for any piece of code you have to know what's defined so you must know exactly what the build system is going to do to the code i.e. the code isn't self-contained. If you use one build system to build for production and another in your IDE for development then you might get totally different results.
C,C++ have a lot of ways to do one thing and Pascal tends to have one. The more you have to work on other people's code the more attractive Pascals' "one way" seems.
- p0w3n3d 2y agowhat I mean is that once you want to access some API, the standard is C, so the headers you will get are in C. For example: windows.h. To do anything, either you have translated windows.pas, or you need to manually rewrite the function definitions. Another example: if you would like to access HongKong Exchange, you will receive a .so object and omni_api.h file, which is damn hard to understand, easier to use. That's why I said about freedom.
- lukaslalinsky 2y agoThat was the point of my wondering, what if the standard was not C, but some modern Pascal. What if the APIs didn't involve any C headers.
- rjsw 2y agoThe standard was Pascal for the Macintosh, people still preferred to write in C.
- t43562 2y agoPascal had a different calling convention so you can "just" write all your libraries in pascal. As you say, calling out to other libraries would need a translation but ..... it's the same for python or many other languages. It would be a bump in the road but not a disaster.