Two thoughts on GNU Pascal to discuss:
Based on previous experiences with another Pascal system, one of the most useful features was run-time checking (array bounds, sub-ranges, enumerated types, etc.). This often found problems in code without much effort. It could also be selectively be turned off for efficiency. With GNU Pascal we have C-style run-time checking (i.e. essentially no run-time error checking unless a wild pointer causes some type of exeception).
I'm wondering: 1. Would people find this a useful feature for GNU Pascal? 2. Would it be feasible to implement it in the compiler?
--------------------------------------
GNU Pascal converts the case-insensitive Pascal identifiers to symbols that are lower-case with the first letter capitalized. This has two implications: - in gdb you need to use the capitalized identifier which is not intuitive to users - you cannot call C routines that do not match the capitalized naming scheme.
The first issue can presumably be fixed in the debugger, but the second is more of a problem because I'd like to be able to call C code directly. I can see several approaches to solve this: 1 Make Pascal case sensitive (probably not an option since it would presumably not match the language spec) 2. Convert Pascal symnbols to all lowercase. You could then call C routines if they were all lowercase (which is the most common). 3. Have some extension to indicate C linkage (like C++ and some C compilers do). Maybe an extension or alternative to the EXTERNAL keyword.
Note, a side effect of capitalizing all identifiers in the lexical analyzer is that currently the compiler may report an error such as
foo.pas:1: parse error before `Error'
when the source code actually used the string 'ERROR'.