4 ms·
I like the comparison to COBOL. Another IBM language of similar vintage is RPG (Report Generator) and it also uses packed decimals. The control flow is: - Run
by excitom 12y ago
I like the comparison to COBOL. Another IBM language of similar vintage is RPG (Report Generator) and it also uses packed decimals.
The control flow is:
- Run a set of zero or more statements once at the beginning
- Run a set of statements once per input record
- Run a set of zero or more statements once at the end
I was always struck by the similarity to:
BEGIN { ... }
while (<>) {
...
}
END{ ... }
- agumonkey 12y agoBecause these are two basic building blocks of 'computation', I'd say first order. It's map and reduce in disguise (or the other way around, doesn't matter). - [record] -> [derived from record] :: map - Begin and End blocks are accumulator/stateful logic :: reduce sed is also a little twisted version of awk, per line mapping, with pattern spaces for accumulations. It's first order, because it can't reuse itself on smaller pieces of data, namely recursion (grammars, trees, etc)
- cbd1984 12y agoThat's awk. That is literally the control flow style of awk, which Larry Wall copied into Perl very directly and entirely deliberately. I find it very interesting that RPG uses it, and I wonder if it's convergent evolution (relative to awk and RPG) or if one is copying the other.