Tom Daly wrote:
Setting aside these other issues and sticking just to the topic of the language, what would you like to see for RPG? IIRC OO is not on your hit parade.
Off the top of my head, here are a few things:
First, complete free-form syntax. Come on guys, it's 2008! The fixed-form syntax alone is sufficient to rank RPG as a relic of the 1960's, and not a modern programming tool.
Next, I'd like to see a new implementation of character strings. The current CHAR VARYING is mired in performance problems. CHAR VARYING return values, although having a nice syntax, involve the copying of way too many bytes. Likewise, other character operations like catenation require too much movement of bytes to and from temps. RPG should have a new STRING type where a pointer addresses the string data in a string pool. Returning strings from procedures would involve returning just a pointer, not thousands of bytes. The STRING type should also handle all Unicode issues, which are also currently poorly addressed.
Third, pointers should be strongly typed. Many RPG programmers seem unwilling to use a more appropriate language like C for systems programming. In C, the strong pointer typing can help programmers find potential problems at the compile stage. Without strong typing, debugging pointer type mismatches at run-time can be very difficult and time-consuming.
Fourth, there should be some syntax for parameter polymorphism on procedure calls. That is, procedure call "foo(charvar)" would call one procedure and "foo(numvar)" would call another.
After that, there are lots of easy little things that could be done, such as %LOOKUP on array DS based on subfield, or SORT of array DS keyed on a subfield. Array element initialization should be easier.
One problem with this is that for some of these things, the old functionality still needs to be supported. This can be good or bad. For example, I know from experience that if you have the ability to bypass strong pointer type checking, you will. This results in a language that offers multiple different ways to achieve some coding problem depending on release. Other languages take a much different approach to R->R compatibility. Consider
Perl 6 and
Python 3: These languages are different than their predecessors. The owners of these languages have weighed the pros and cons, and made the decision to deprecate certain older language features. (I believe Perl 6 tries to recognize the older syntax, while the less drastic Python 3 offers a conversion tool.) Doing that for RPG would be very difficult since IBM's customers have come to expect strict R->R compatibility.
Cheers!
Hans