3 ms·
Micro-SPL was cut down from the HP SPL systems programming language to run on the Xerox Alto, in microcode, and was ported pretty directly to the 6502 as Actio
by buescher 1y ago
Micro-SPL was cut down from the HP SPL systems programming language to run on the Xerox Alto, in microcode, and was ported pretty directly to the 6502 as Action! The Action! folks were pretty coy about this back in the eighties.
- kragen 1y agohttps://en.wikipedia.org/wiki/Systems_Programming_Language https://en.wikipedia.org/wiki/Systems_Programming_Language? BEGIN INTEGER A:=0, B, C:=1; PROCEDURE N(X,Y,Z); INTEGER X,Y,Z; X:=X*(Y+Z); FOR B:=1 UNTIL 20 DO N(A,B,C); END. The "Action!" code samples don't look like a dialect of this, but of a different branch of the Algol tree: PROC hello() ; This is a comment. DO PrintE("Goto 10") OD RETURN PROC timestwo() CARD i=[0],j DO ;start of DO - OD loop i==+1 ;add 1 to j=i*2 ;set 'j' equal to i*2 PrintC(i) ;**** See the following Print(" times 2 equals ") ;PROGRAMMING NOTE for PrintCE(j) ;an explanation OD ;end of DO - OD loop RETURN PROC hithere() BYTE ctr ;counter used in FOR loop FOR ctr=1 TO S ;this FOR loop has no 'STEP', so DO ;an increment of 1 is assumed. PrintE("Hi there") OD RETURN The divergences I see that gave me this idea: 1. SPL used PROCEDURE to define procedures, and "Action!" uses PROC. 2. SPL used semicolon to separate statements, and "Action!" evidently used newlines or some kind of Lua-like rule, instead using semicolon for comments. 3. SPL used := for assignment statements (and FOR loops), and "Action!" used =. 4. In SPL, as in Algol 60 or Pascal, the body of a FOR loop was evidently a statement, using DO as a keyword to separate the loop setup from the body, so if you wanted a multi-statement loop you would presumably use a BEGIN END block, while "Action!" used Algol-68-style DO-OD (and IF-THEN-ELSEIF-ELSE-FI). 5. SPL used the UNTIL keyword to introduce upward-counting loop limits, while "Action!" used TO. 6. "Action!" seems to have used =[0] to initialize a variable to zero, while SPL used =0; in "Action!", =0 would have put the variable at address 0. Most versions of Algol, annoyingly including Pascal, had no way to initialize variables at their declaration. Presumably, if "Action!" were derived from SPL, it would have used the SPL syntax to initialize variables, and some other syntax to specify their location, like =@0 or =^0 or =[0] or something. 7. Also, not seen here, "Action!" evidently spelled INTEGER as INT. There are a number of other differences on view here, such as the use of BYTE and CARD (unsigned) variables, the absence of the program-terminating period character, the presence of an augmented assignment operator ==+, and having the top-level syntactic construct be a procedure rather than a block, but those seem to me like the kinds of things you might change because you were building an IDE or because you were running on a tiny microcomputer. By contrast, these purely syntactic choices seem to me to be freely chosen on the basis of aesthetics or tradition, with almost no technical advantages or disadvantages accruing to any possible choice. However, the Micro-SPL manual is at http://www.bitsavers.org/pdf/xerox/alto/micro-spl/Micro-SPL_Sep79.pdf http://www.bitsavers.org/pdf/xerox/alto/micro-spl/Micro-SPL_.... On points of difference 1, 2, 4, and 7, it is similar to "Action!" rather than SPL, though it does follow SPL on point 3. As for points 5 and 6, Micro-SPL didn't have FOR loops or variable initialization, explaining the syntactic divergence. Also the Micro-SPL manual is by Henry Baker and "Action!"'s author Clinton Parker, who apparently confirmed the identity on a podcast in 02015: https://ataripodcast.libsyn.com/antic-interview-111-clinton-parker-action https://ataripodcast.libsyn.com/antic-interview-111-clinton-... So I guess you're right that "Action!" is indeed Micro-SPL in a trenchcoat. Sure fooled me! As for compilation speed, I don't think there's anything particularly special about "Action!"'s syntax or semantics that would make it especially fast to compile. Not using a textual preprocessor like C, maybe. And it's probably an advantage that most statements are introduced by a keyword so that simple recursive-descent parsing (with a separate tokenizer) is all you need, but that's more about the ease of writing the compiler than about its performance. This was the same time Baker was working on COMFY-65, a more interesting language that got less adoption because it was not released for decades.
- buescher 1y agoThe Action! source is out there and it’s very easy to read. I forget if it mentions Micro-SPL. I’ve long thought it would be an interesting language for embedded: maybe in some alternate timeline something like Action! was viable for 90s-00s microcontrollers that were poor targets for C.
- kragen 1y agoThat's a good point. PICs are still poor targets for C actually. sdcc has a bunch of flags to only pay the cost of re-entrancy for the functions where you really need it, but "the usual arithmetic conversions" can be a serious performance problem on 8-bitters too.