RealNC wrote:C has nothing to do with Hugo string support. C gives you the tools to implement something. What you implement with it is up to you. In no way can C dictate that you use its data types in your own language implementation.
Yeah, but implementing any data structure that is not supported natively means you either have to write a lot of code or hope you find a library pre-built for the feature.
If Hugo didn't include the standard libraries (verblib.g & .h, hugolib.hug) it would take a lot of work to write an adventure because you'd have to code all of the verb processing. As it is, the standard libraries do a lot of the "heavy lifting" necessary to process a lot of commands natively.
RealNC wrote:If you write a C compiler in Pascal, you will implement C strings in Pascal. If you implement a Pascal compiler in C (most common case), you will implement Pascal strings in C.
Uh, for your information, I am a regular collector of program compilers. I have never seen a single implementation of a minimum K&R or ANSI-class C compiler done in anything except C. In fact, I can't remember
any Pascal implementation of even a toy-class C compiler. C compilers are always self-hosting.
I'm not saying there aren't any Pascal-hosted C compilers, I've just never seen one.
As for Pascal, I've seen or acquired sources for perhaps ten Pascal Compilers and I've read manuals from probably another dozen where either they admit the compiler is written in Pascal or they specifically mention it requires code to interface with C because it's not written in C. And I only know of two instances where C was used.
The Free Software Foundation's Pascal Compiler is written in C because it's a frontend to its GCC compiler collection which originally was the Gnu C Compiler. There is perhaps one other C-based Pascal Compiler, I think it was a reimplementation of the Surpas subset compiler which itself was originally written in Pascal.
Since Wirth was originally working on the CDC Cyber Mainframe, the first Pascal compiler was written in FORTRAN because the NOS operating system has very good support for Fortran, and once the compiler had been compiled, it could then compile itself. Since then, with the exception of GCC, all Pascal compilers have been self-hosting.
So, out of perhaps 30 different genres of Pascal compilers, there are perhaps 2 written in C, the rest are self-hosting, meaning that almost all Pascal compilers are themselves written in Pascal.
The Free Pascal Compiler is one of the most powerful object-oriented Pascal compilers in existence, it is 261,804 lines of code, compiles to 208 units plus a main program, and produces an executable of approximately 11 megabytes on Windows. It is written in Pascal.
[quote="RealNC"]C has nothing to do with Hugo string support. C gives you the tools to implement something. What you implement with it is up to you. In no way can C dictate that you use its data types in your own language implementation.[/quote]
Yeah, but implementing any data structure that is not supported natively means you either have to write a lot of code or hope you find a library pre-built for the feature.
If Hugo didn't include the standard libraries (verblib.g & .h, hugolib.hug) it would take a lot of work to write an adventure because you'd have to code all of the verb processing. As it is, the standard libraries do a lot of the "heavy lifting" necessary to process a lot of commands natively.
[quote="RealNC"]If you write a C compiler in Pascal, you will implement C strings in Pascal. If you implement a Pascal compiler in C (most common case), you will implement Pascal strings in C.[/quote]
Uh, for your information, I am a regular collector of program compilers. I have never seen a single implementation of a minimum K&R or ANSI-class C compiler done in anything except C. In fact, I can't remember [i]any[/i] Pascal implementation of even a toy-class C compiler. C compilers are always self-hosting.
I'm not saying there aren't any Pascal-hosted C compilers, I've just never seen one.
As for Pascal, I've seen or acquired sources for perhaps ten Pascal Compilers and I've read manuals from probably another dozen where either they admit the compiler is written in Pascal or they specifically mention it requires code to interface with C because it's not written in C. And I only know of two instances where C was used.
The Free Software Foundation's Pascal Compiler is written in C because it's a frontend to its GCC compiler collection which originally was the Gnu C Compiler. There is perhaps one other C-based Pascal Compiler, I think it was a reimplementation of the Surpas subset compiler which itself was originally written in Pascal.
Since Wirth was originally working on the CDC Cyber Mainframe, the first Pascal compiler was written in FORTRAN because the NOS operating system has very good support for Fortran, and once the compiler had been compiled, it could then compile itself. Since then, with the exception of GCC, all Pascal compilers have been self-hosting.
So, out of perhaps 30 different genres of Pascal compilers, there are perhaps 2 written in C, the rest are self-hosting, meaning that almost all Pascal compilers are themselves written in Pascal.
The Free Pascal Compiler is one of the most powerful object-oriented Pascal compilers in existence, it is 261,804 lines of code, compiles to 208 units plus a main program, and produces an executable of approximately 11 megabytes on Windows. It is written in Pascal.