Bizarre

This idea — a dataless programming language — at first, sounded bizarre to me.


A programming language that had no data?


Now, I find the idea more useful than Javascript, C, or, dare-I-say Common Lisp.  I don't even bother with Python or Rust or …


I first learned the technique in 1980 in a compiler course using S/SL (Syntax / Semantic Language, not Secure Socket Layer).


The essence of S/SL goes far beyond compiler-building.

Software Design in Layers

It seem "obvious" that we want to build software in layers.


Build-and-forget.


We just can't seem to do it, though.


Dependencies trickle throughout our code when using standard software techniques.


To build layered software:


Gulp.


Function Calls, Handles, Control Flow

Use only function calls, internal and external (aka foreign, aka deferred) function calls, and use the least amount of control-flow possible.  



Handles to Data

Refer to data, but don't manipulate it directly.


This used to be called handles.


If you need to increment a variable, call a function.


For example, replace

a = b + c

with

assign (aHandle, plus (bHandle, cHandle)).


Compilers have become better.  


Compilers can do function inlining.  


Don't waste brain-power doing what compilers can do for you.

Loop

What is the simplest form of loop?


Not for.


Not while.


It's:


loop

 

  exit when …

 

end loop



Recursion is loop.  


How do you write the above recursively?


DRY

Don't waste brain-power doing DRY (Don't Repeat Yourself).


Have the computer/compiler do it for you.


Git, diff and friends know how to recognize code commonality.  It's time to lift up the game a notch, and to get git/diff/etc. to do DRY for you.[1]  The Dragon Book[2] shows how.


Software Architecture needs RY, not DRY.  Cut/Copy/Paste.


[Maintenance Engineering needs DRY.  Maintenance Engineering is not Software Architecture.]


S/SL

https://research.cs.queensu.ca/home/cordy/pub/downloads/ssl/



[1] Is Cordy and Roy's NiCad this kind of thing?  I haven't read up on it enough.  https://research.cs.queensu.ca/home/cordy/software.html#NICAD

[2] https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools