In my other thread about programming languages and games, I was positively surprised to hear that the Pascal programming language was often used to program games back in the day. I do not need to remember the disadvantages of using assembly, so I'd ask myself if the NES is a suitable target for the Pascal language.
The main theoretical advantages of using Pascal over it's concurrent, C, are:
It appears that the most popular one was UCSD Pascal, and it was ported on the Apple II, which also had a 6502, meaning it is probably theoretically feasible on the NES, if it is stripped from it's I/O part.
The problems are: Where can we found a cross compiler that transform Pascal sources into p-codes (not need to be compatible with the original UCSD)? The requirements are:
The most interesting solutions seems to be FreePascaland GNU-Pascal (both are GPL desipte the name). Unfortunately they seem to emit machine code directly and don't use p-codes, which means porting to 6502 would be a very complex process.
G-Pascal seems nice, but does not support cross-compilation.
The most promising seems to be this, but I cannot manage to build it on neither Cygwin or Linux.
The main theoretical advantages of using Pascal over it's concurrent, C, are:
- The language enforces a stronger disciplines when it comes to array sizes, etc..
- The language can be compiled to p-code and be interpreated, which means porting it to 6502 is much easier as it doesn't need rewriting part of a compiler
- The usage of sub-range types makes it easier to store things on 8-bits while documenting the intent clearly (i.e. don't have to use "chars" for numbers that are not chars)
- It also means that code density can be increased, you can have more code in a ROM bank, thus less ROM banks in total
- Widely used and standardized language (as opposed to, Acheron VM and PLASMA for instance)
It appears that the most popular one was UCSD Pascal, and it was ported on the Apple II, which also had a 6502, meaning it is probably theoretically feasible on the NES, if it is stripped from it's I/O part.
The problems are: Where can we found a cross compiler that transform Pascal sources into p-codes (not need to be compatible with the original UCSD)? The requirements are:
- Can run on a PC (cross-development), do NOT require a 6502 machine or an emulator for compiling the sources
- Should be on a permissive licence, should allow at least commercial but non-profit usage (i.e. selling carts that were developed with it for non-profit should be allowed)
- The p-codes should be documented (not necessary compatible with the UCSD originals), and an example of implementation on any system (not necessary 6502) should be provided
- It should be possible to call assembly from Pascal. If Pascal can be called from Assembly then it's even better
- Should use a standardized version of Pascal (or Modula, pretty much the same thing). Floating point support is not necessary. No incompatibilities with other major Pascal compilers.
The most interesting solutions seems to be FreePascaland GNU-Pascal (both are GPL desipte the name). Unfortunately they seem to emit machine code directly and don't use p-codes, which means porting to 6502 would be a very complex process.
G-Pascal seems nice, but does not support cross-compilation.
The most promising seems to be this, but I cannot manage to build it on neither Cygwin or Linux.