Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language S3

(An algol-based system language)

Date:08/24/05
Author:Steve Hammond
URL:n/a
Comments:5
Info:n/a
Score: (2.96 in 25 votes)
MODULE BOTTLES
 
EXT (<PREFIX "ICLCTM">) PROC (
    REF () BYTE              ,
    RESPONSE                 ) SEND_MESSAGE ;
 
GLOBAL STATIC (<STATUS 5>) PROC BOTTLES IS () :
 
BEGIN
      INT          I_RESPONSE    ;
      INT          I_COUNT := 99 ;
 
      () BYTE      S_OUTPUT :=
                   "** bottles of beer on the wall" X"15"
                   "** bottles of beer" ;
 
      REF () BYTE  PART1 IS S_OUTPUT (0 SIZE 2)  ;
      REF () BYTE  PART2 IS S_OUTPUT (31 SIZE 2) ;
 
      FOR   I_COUNT FROM 99 TO 0 BY -1
      DO
            UNPACKS (
                  S'D'I_COUNT ,
                  PART1       ,
                  0           ,
                  NIL         ) ;
 
            MOVE (
                  PART1       ,
                  PART2       ,
                  0           ,
                  0           ,
                  NIL         ,
                  NIL         ) ;
 
            SEND_MESSAGE (
                  S_OUTPUT   ,
                  I_RESPONSE )
 
      REPEAT
 
END ;
ENDMODULE

Download Source | Write Comment

Alternative Versions

Comments

>>  Karel Haidinger said on 08/25/05 23:45:00

Karel Haidinger S3 is definitely the best programming language I know (I have 12 years experience with development in S3 Language on ICL/FUJITSU VME Systems - the VME/OpenVME Operating Systems are fully written in S3). It would be really worth to port this language to other platforms (Windows, Linux). Every system programmer would have to love this language.

>>  Phil Bourne said on 08/13/06 19:50:04

Phil Bourne Couldn't agree more with the previous comment.

The ability to define structures (Modes) which can not only be viewed / written differently (Any) including references (Ref) (ie 'pointers' to structures) and that the structures can also contain variables which are actually procedure variables (GProc) makes the language incredibly powerful.

The language thus lends itself readily... to tree navigation... and to fully structured programming where each module, including the data and procedure calls can be completely isolated from all other data / procedures!

Maybe its me but S3 was the first language that I wrote.... and despite writing all sorts of other stuff... from 8086 assembler to VB and C ++ still remains by far the best!

>>  phil Bourne said on 08/13/06 20:01:28

phil Bourne Actually the middle piece doesn't take proper account of the line:

'Take one down and pass it around, 98 bottles of beer on the wall.'

but this would be easily remedied by adding an extra declaration and then inserting I_Count -1 as appropriate.

Hey... and I thought that I'd forgotten everything that I'd ever learned about code inspections!

>>  Grierson said on 09/24/07 11:56:09

Grierson I would have used PETE (is NR Pearson still alive?) and LOG_MESSAGE for this, but my memory can't extract enough detail to provide the code. PETE would have taken care of the plural/singluar cases of the message. My first language was Algol 60; I suspect this is why I liked S3 so much. S3 is 'acid clear'.

>>  Brian Parker said on 05/19/10 02:16:08

Brian Parker It also can be beautiful in source with a structural clarity which counts for a lot with me.

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: