As you may have already heard, there was a major Technology Refresh (TR) announcement yesterday - check out fellow blogger Steve Will's You and i blog for a summary of the details.
Of course what we are most interested in, apart from the arrival on IBM i of Ruby on Rails, are the major changes that this TR brings to RPG. In fact they represent the biggest changes in the language since the V5 introduction of /Free form calculations specs. That said, it is likely that they will also be among the most controversial. No, it's not Object Oriented RPG--we're on record as saying we don't think that will ever happen. "It" is completely free form H, F D and P specs. That's right--with TR7 RPG becomes a completely free format language. Well, unless you still have a desire to use I and O specs, that is.
So why do we think it will be controversial? Well first of all there are always those who think that RPG enhancements are a waste of time because:
a) Fixed format was good enough for my grandfather, it is good enough for me or ...
b) If I want to write in a modern language I'll use Java/C++/PHP/whatever ...
c) Hardly anyone uses the "new" features like BIFs anyway so why add more ...
We expect those. It happens every time.
But this time there's an additional factor at play. The syntax. As you'll see from the short sample below it more closely resembles CL than (say) C or Java. But unlike those languages, that use curly braces to delimit blocks, RPG decided to stick with a declaration (dcl) based syntax, starting and terminating definitions with markers such as dcl-ds and end-ds. There were undoubtedly many reasons for doing this, not the least being that the compiler team did not want to add another syntactic construct to the language. Plus of course had they done so they would almost certainly have had to revisit the use of braces within the calc specs.
Yes, it may mean a bit more typing for some things, and RPGers as a general rule are famous (or is that infamous?) for their disdain for typing! But in return for the arduous task of keying dcl-f in place of F, for example, you don't have to concern yourself about what column to put the F or the E in (or else copy an F spec from the quickest program you can put your hands on É--come on, admit it, you've done it, right?)
For that matter, you can make up some of those keystrokes by the fact that you don't need to specify the F or E at all. The F (Full procedural) is the only option in this syntax and the E (Externally described) is the default.
And think of the number of keystrokes you'll save from doing away with all the iterations of /Free and /End-Free around your subprocedure logic!
Of course, the end result is potentially more readable code. And a less "lame-looking" syntax for the newest crop of RPGers coming along.
Here's a very short example of the new "/Free-less" RPG, which also illustrates the new relaxed rules about the relative positions of file and data structure declarations (F and D specs in the "old" language).
ctl-opt option(*srcstmt) dftactgrp(*No);
dcl-ds employeeDS;
firstName char(16) Inz('James');
lastname char(30) Inz('Joyce');
salary packed(7:2) Inz(12500);
end-ds;
// Define printer file and associated DS
dcl-f qprint printer(80);
dcl-ds prtDs len(80) end-ds;
dsply ('Hello to our new employee');
dsply ( %TrimR(firstName) + ' ' + lastName );
// Also write out details to the printer file
prtDs = 'The name of our new employee is ' +
%TrimR(firstName) + ' ' + %TrimR(lastName) +
' his salary is $' + %Char(salary);
write qprint prtds;
*InLR = *On;
We'll be writing more about this new totally free RPG in EXTRA this month. We'll post a link to it in the comments when it's available. Until then, what do you think?
Of course what we are most interested in, apart from the arrival on IBM i of Ruby on Rails, are the major changes that this TR brings to RPG. In fact they represent the biggest changes in the language since the V5 introduction of /Free form calculations specs. That said, it is likely that they will also be among the most controversial. No, it's not Object Oriented RPG--we're on record as saying we don't think that will ever happen. "It" is completely free form H, F D and P specs. That's right--with TR7 RPG becomes a completely free format language. Well, unless you still have a desire to use I and O specs, that is.
So why do we think it will be controversial? Well first of all there are always those who think that RPG enhancements are a waste of time because:
a) Fixed format was good enough for my grandfather, it is good enough for me or ...
b) If I want to write in a modern language I'll use Java/C++/PHP/whatever ...
c) Hardly anyone uses the "new" features like BIFs anyway so why add more ...
We expect those. It happens every time.
But this time there's an additional factor at play. The syntax. As you'll see from the short sample below it more closely resembles CL than (say) C or Java. But unlike those languages, that use curly braces to delimit blocks, RPG decided to stick with a declaration (dcl) based syntax, starting and terminating definitions with markers such as dcl-ds and end-ds. There were undoubtedly many reasons for doing this, not the least being that the compiler team did not want to add another syntactic construct to the language. Plus of course had they done so they would almost certainly have had to revisit the use of braces within the calc specs.
Yes, it may mean a bit more typing for some things, and RPGers as a general rule are famous (or is that infamous?) for their disdain for typing! But in return for the arduous task of keying dcl-f in place of F, for example, you don't have to concern yourself about what column to put the F or the E in (or else copy an F spec from the quickest program you can put your hands on É--come on, admit it, you've done it, right?)
For that matter, you can make up some of those keystrokes by the fact that you don't need to specify the F or E at all. The F (Full procedural) is the only option in this syntax and the E (Externally described) is the default.
And think of the number of keystrokes you'll save from doing away with all the iterations of /Free and /End-Free around your subprocedure logic!
Of course, the end result is potentially more readable code. And a less "lame-looking" syntax for the newest crop of RPGers coming along.
Here's a very short example of the new "/Free-less" RPG, which also illustrates the new relaxed rules about the relative positions of file and data structure declarations (F and D specs in the "old" language).
ctl-opt option(*srcstmt) dftactgrp(*No);
dcl-ds employeeDS;
firstName char(16) Inz('James');
lastname char(30) Inz('Joyce');
salary packed(7:2) Inz(12500);
end-ds;
// Define printer file and associated DS
dcl-f qprint printer(80);
dcl-ds prtDs len(80) end-ds;
dsply ('Hello to our new employee');
dsply ( %TrimR(firstName) + ' ' + lastName );
// Also write out details to the printer file
prtDs = 'The name of our new employee is ' +
%TrimR(firstName) + ' ' + %TrimR(lastName) +
' his salary is $' + %Char(salary);
write qprint prtds;
*InLR = *On;
We'll be writing more about this new totally free RPG in EXTRA this month. We'll post a link to it in the comments when it's available. Until then, what do you think?
I for one am very excited to get TR7, and the PTFs that will be coming out next month, that will add the flexibility to a completely /free-form, MODERN version of RPG!
Presently, I still use Code/400 to program, and while there are irritants in syntax checking for new 7.1 BIFs & array handling, it hasn't been enough to completely justify asking the owner of the company to purchase a license or two to RDP, RSE, or whatever it is called today...
With this truly free-form RPG, making the case to INVEST in such a tool will be much more compelling.
BTW - hHas the source member length been increased by chance, or are we still limited to the current column length?
Can't wait for the PTFs to become available so I can give this a good workout... :-)
Posted by: Dan Devoe | October 08, 2013 at 02:05 PM
Do you have any informations when RDI will support this new free format syntax?
Posted by: Ralf M Petter | October 09, 2013 at 09:59 AM
@Ralf IBM have said "In the next release" - it is not clear to us at this time whether they mean in a V9.n release or in the next fix pack. But they have said it will be supported - we are hoping by the end of this year but have nothing to back that up.
Posted by: Jon Paris | October 09, 2013 at 11:49 AM
We worked with ibm to provide a converter to full rpg /free. This tool must be available too into the next release of RDi. We dont have a release date for the RDi implementation but this conversion tool called ARCAD-Transfomer RPG will be released in 2 weeks on oct. 22.
Posted by: Miche mouchon | October 09, 2013 at 03:52 PM
This is good news. Does having to use an earlier TGTRLS (target release) on your compiles restrict anything mentioned?
Posted by: Mark Duignan | October 10, 2013 at 01:45 AM
Thanks Jon for the info.
Posted by: Ralf M Petter | October 10, 2013 at 03:16 AM
Cool!
Great step forward for our favorite language!
The first question that comes to my mind is... will there be an updated version of CVTRPGSRC to update our now antiquated RPG syntax?
Posted by: Jim Mitchell | October 10, 2013 at 10:07 AM
Twenty years ago I sat in a room in Toronto and heard several IBMers (and a few well-known midrange gurus) explain all of the reasons why "free format" RPG would never fly. I'm pretty sure the debate back then sounded a lot like the Republicans and Democrats do now in the US. But, I'll never forget how impressed I was with Jim Sloan that day. He didn't agree with the "free RPG!" group but he poked and prodded and debated respectfully and was surely the wisest guy in the entire room. There was also one enlightened IBMer who did all he could. He was pretty smart, too.
Alas, time changes things and it's good to see IBM adopt at least a variant of the RPG syntax proposed back then by one of the smartest guys who ever graced the midrange community. A tip of the hat to Toronto. This is a good move. But please tighten up your agile disciplines. Twelve year iterations are a little long!
It will be interesting to see a) what this update does to encourage the embrace of curly bracers and b) to hear all of the Luddite arguments against this update. Like enjoying a really great bad informercial (Mick and Mimi selling the Magic Bullet blender come to mind), I'm looking forward to reading the outrageous reasons we'll surely hear as to why this isn't a good idea!
As a depressing anecdotal footnote, I have been presenting lots of ILE RPG examples to prospects lately. It has been really shocking to me how many RPG programmers don't recognize /free code as RPG. I've had to change examples from /free to fixed just to get prospects to nod their head in recognition!
rp
Posted by: Roger Pence | October 10, 2013 at 10:13 AM
And I personally LOVE the fact the "I" and "O" specs are NOT included in the new free-form concept.
I see it as a big "wink - wink" telling us that the use of those constructs is well beyond the "use-before" date.
Posted by: Ake H Olsson | October 11, 2013 at 07:25 AM
@Ralf, if you would like to see how the ARCAD-Transformer RPG performs, we have a Webinar coming up on October 29 at 12PM EDT. It will show a large program example and the various conversion methods - so from RDi, from a batch command, controlled conversion statement-by-statement and also bulk conversion of several sources at once. Hope you might join us. Here's the link to the Webinar description just in case: http://www.arcadsoftware.com/news-and-events/eventsn/403-events
Posted by: Olenka Van Schendel | October 11, 2013 at 12:26 PM
It's great to have language enhancements but ultimately the cosumers of the applications we write will be end-users. IMHO, the area that needs the most enhancement got the least over the years - UI, specifically display file. I know it's too much to ask but is there any way IBM can give us a better tool to design pretty screens? After all, that's what the end-users will see, not the great language features behind them.
Posted by: Mike | October 14, 2013 at 02:53 PM
Linoma's RPG Toolbox will also convert the H, F, D and P specifications to free form. It has already been used by 1000s of customers around the world to convert millions of lines of RPG source code to Free Form.
Posted by: Bob Luebbe | October 18, 2013 at 09:29 AM
@Mark As far as we know, TGTRLS is not supported. Of course if a few large ISVs were to ask for it ...
Posted by: Jon Paris | October 20, 2013 at 10:22 AM
@Roger Didn't know whether to laugh or cry at the last part of your comment - but I do indeed see folks who don't really recognize free-form RPG. Of course most times we are giving RPG skills enhancement training so even the stick-in-the-muds have been pre-warned!
As you'll have seen by now there have indeed been a number of comments out on the web. For the most part the harshest critiques have come from those who want to rewind history and change how the original /Free was done (i.e. introduce { } ) which ain't gonna happen and would cause a lot more problems than it would ever solve. Some folks just don't seem to think.
I have been happy to see my own predictions come true - albeit over a longer time-frame than I had hoped. Perhaps one day I'll seek out Paul and go "Nah nah - told you so" - but perhaps I'm too old for that sort of behaviour now.
It has been a long and interesting journey. I don't think any of us who kicked off the RPG IV efforts could have predicated being in this spot today.
Posted by: Jon Paris | October 20, 2013 at 10:36 AM
@Mike I'm not altogether sure what you mean - but if you are asking for web/mobile interfaces for the IBM i in my opinion you have seen as much from IBM as you ever will.
For many many reasons IBM have left this market to third parties - opening up RPG though Open Access is about as far as they will go I think - and we should all be grateful for that.
Why? Because IBM would almost certainly have to aim any tool (as with WebFacing and HATS) to the Java/WebSphere arena and that introduces an administration overhead that most small/medium shops are not equipped to handle. Secondly - all IBM's past efforts have been largely ignored by the IBM i community (EGL, WebFacing, VARPG, and on.) because in one way or another they missed the mark. There is ZERO reason to think that they would fare any better this time. They have learnt that lesson.
Don't waste your time waiting for IBM - the direction is plain. If you want modern tools that integrate well with RPG look at the Open Access offerings from ASNA, Look, Profound, Rocket etc. Or PHP based tools like BCD's or ... or ... or ...
Posted by: Jon Paris | October 20, 2013 at 10:48 AM
Hi Jon and Susan! I just came across this blog posting now, and of course, you know I have opinions on this subject.
First, you didn't mention the obvious reason why braces weren't used in the free-form syntax. Just like the square brackets, braces are not in the invariant portion of EBCDIC code pages. (See http://goo.gl/Tn7KRJ) Sure, you can program in C on IBM systems, but as I and others can attest, you always run into codepage issues. Other languages today have full support for unicode. Some even use unicode as the default representation for character strings. Perhaps it's time for IBM to move into the 21st Century with respect to unicode.
But to get back to the theme of this posting, I've commented elsewhere that while I'm glad the RPG compiler developers finally got around to making free-form H, D, P, and F specs, it feels rather anti-climactic. I'm not sure I see the point anymore. It's sort of like rearranging deck chairs on the Titanic.
Here's my point: Almost immediately after we developed free-form calcs, we started thinking about making other spec types free-form too. It was, of course, the obvious next step. However, when comparing the functionality with other proposed enhancements, other enhancements always were deemed more important. Sure, free-form syntax made a lot of sense for calcs. But there just didn't seem any great compelling reasons to take that next step.
So I rather wonder, Have the RPG planners at IBM run out of ideas? Are there no other possible enhancements deemed more important than just a simple change of syntax?
In a blog posting, I listed half a dozen features common to other, modern programming languages that are lacking in RPG: http://goo.gl/hw0ZYd
And in another blog posting, I commented further on free-form syntax in RPG: http://goo.gl/FMQ4gV
Cheers! Hans
Posted by: Hans Boldt | November 27, 2013 at 01:45 PM
@Hans First the reason that { braces } were not mentioned was simply that we were conducting the same discussion in about 3 spots at the same time and it had been covered elsewhere. Thought we'd done it here - but apparently we hadn't so thanks for filling that gap.
We are so completely in disagreement on your other points - and those raised in your blog that I'm not sure where to begin - or even if it is worth bothering.
I'll just bullet a couple of those I have the most disagreement with.
1) XML op-codes. RPG's support is nothing like COBOL's and is far superior. It has helped many, many customers who were struggling with the amount of code needed to parse XML using Java methods, the IBM toolkit, etc. JSON would be nice - but there are already good RPG oriented libraries out there for that - plus most people who need to parse it are doing so using one of the tools that already includes it.
2) OA - I just disagree completely. Not only is it being widely used by ISVs who are doing amazing things with it - but it is also being used by a lot of shops to simplify tasks from creating CSVs to web services to ... Also a great many people - yourself included I suspect - forget that because OA is replacing operating system function it removes many limits. For example you can quite easily use it to write a web 2.0 type application because it does not suffer from the limitation of only being able to read formats it has written. So just where are the limits?
3) Full Free-form. You're just wrong. We have trained large numbers of C++, Java, .NET, C# and other programmers in RPG over the last couple of years. A very large %age love the language and find its ability to do complex things easily very appealing. This is not just our experience but is matched by many others we have communicated with around the world who are doing similar things.
BUT we and others have found that the bits where newbies have a problem is when they have to fit in columns. They delete a character from a D-spec name only to find that they had a dozen strange errors pop up. That confuses the heck out of them. The move to completely free has been greeted with enormous enthusiasm by many people around the world.
As far as I'm concerned a far greater problem is that many North American businesses always insist on multiple years of experience in particular packages and won't give newbies a chance.
I think your major problem is that you never were your own target audience. You are completely comfortable with doing everything via function/API calls. To an RPGer having to string out multiple parms, or build an array or JSON string containing all the elements required to paint a screen is painful. They have been using READ/WRITE/EXFMT for years. Why would they want anything more complex? Because I personally had no problem with using function calls I found it mildly frustrating but could deal with it. It took me years to realize what a deal breaker it was for many people.
As to features missing from RPG - sure there are many that I and others would like to see - but as a business language it is still tough to beat. When guys like Scott Klement, with their enormous breadth of business programming experience, tell me that RPG has outlived its usefulness then maybe I'll agree that it is time to move on. But that day is not today and many of the programmers I most admire still use RPG at the core of their applications.
Posted by: Jon Paris | December 03, 2013 at 08:45 AM
Jon: I can see your point about editing fixed-form RPG using the usual program editors not intended for a fixed-format language. After all, there aren't many such languages left!
I don't disagree with the idea of more free-form syntax. In fact I do welcome it. My point is that losing additional fixed-form syntax now just emphasizes how far behind RPG is.
You mention training C++, Java, .NET, and C# programmers in RPG. Of course, they're going to be impressed with the simplicity of RPG. But I've always argued that the future of applications programming is with the interpreted OO languages, not the "bondage and discipline" compiled OO languages. If you think RPG is easier than C++, Java, .NET, and C#, I won't argue the point. But compared to languages like PHP and Python, RPG is a stone-age tool.
You're probably right that I probably never properly understood the target audience. Once I started learning Python more than a dozen years ago, I could see it's potential. I could see that it (and other similar languages) was simply more appropriate to handle the needs of modern app development. Since then Python and PHP have grown and matured even more than I could have imagined.
Sure, there's a different mind-set at play here. But I know what it takes to do app development using Python and PHP. I know the capabilities of modern frameworks, such as Zope and CakePHP. When doing an objective comparison between RPG and these modern tools, I simply can't imagine using RPG. The modern tools (languages and frameworks) have extensive functionality, aren't limited to one particular platform, have great documentation and support on-line, and are generally available for free.
Hans
Posted by: Hans Boldt | December 06, 2013 at 09:13 PM