5 old Programming Languages you might want to be aware of
Tags: programming, tutorial, motivation, old
Published: 2022-01-25 19:19:19


Learning from the past can help you look into the future.

As my post [5 old Programming Languages you should know about](https://dev.to/blag/5-old-programming-languages-you-should-know-about-3ofe) was successful so I decided to keep going...

This time I want to share some old programming languages that might not be so "well known" but that are still important pieces of the history of programming...

To illustrate how those programming languages work, we're to use a very basic app called "Fibonacci List" which will simply output a list of requested Fibonacci numbers, for example if we ask for 5, it should return 0, 1, 1, 2, 3, 5. 
We used before, so why not used it here again...

We're not going in order this time...

**Miranda (1985)**

![Miranda Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nu3a0zmxkpctntf2dfry.png)
 
Lazy, purely functional programming language.

```
fib :: (num, num, num) ->  [char]
fib(num,a,b) = show(a+b) ++ " " ++ 
               fib((num - 1),(a+b),a), if(a > 0 & num > 1)
             = show(a) ++ " " ++ show(b) ++         
               " " ++ show(a+b) ++ " " ++                
               fib((num - 1),(a+b),b), if(a == 0)
             = [], otherwise

showFib :: num -> [char]
showFib num = "\n" ++  fib(num, 0, 1) ++ "\n"
```

Let's see...Miranda doesn't have variables, arrays, tables or dictionaries...so lists are your best friends...doesn't have loops so recursion is a must...
It was a major inspiration for Haskell.

Compilers are available [here](http://miranda.org.uk/downloads).
To run it we do...

```
mira name_of_file.m
```

And then call the main function with its corresponding parameter

```
showFib 5
```

![Miranda Exec](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f5v5184npiafyeqwfz22.png)

You can read my Miranda introduction [here](https://blagarts.com/static/GeekyThursday/Languages/Miranda_Introduction.html#/).

**Rexx (Restructured Extended Executor - 1979)**

![Rexx Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78qf2v3xkhpoh27tpwpp.png)
 
Multiparadigm, procedural, structured and interpreted programming language, but also scripting and macro.
It is considered the very first Scripting Language.

```
say "Enter a number: "
pull number .
say ""
call fibo number, 0, 1
say
exit 0

if a = 0 then
    do
        a_b = a + b
        call charout, (a b a_b)
        call charout, " "
        call fibo num - 1, a + b, b
    end
else if a > 0 & num > 1 then
   do
        a_b = a + b
        call charout, a_b
        call charout, " "
        call fibo num - 1, a + b, a
    end
return
```

There are no arrays in Rexx...we call them compounds. We have functions and subroutines, as well as some sort of stack. It's actually pretty fun to use...

On Linux, we can get the compiler as easy as doing this...

```
sudo apt-get install -y regina-rexx
```

For other platforms, go [here](https://sourceforge.net/projects/regina-rexx/files/).

To run we simply do this

```
regina name_of_file.rexx
```

![Rexx exec](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9q92zhwtikku995j67i5.png)

You can read my Rexx introduction [here](https://blagarts.com/static/GeekyThursday/Languages/Rexx_Introduction.html).

**Icon (1977)**

![Icon Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17q98ts6z77p9e4o2tyz.png)

Very high-level programming language featuring goal-directed execution.

```
procedure fib(num, a, b)
    local result
    result := ""    
    if a > 0 & num > 1 then    
        result := result || " " || (a + b) ||         
                  fib(num - 1, a + b, a)        
    else if a = 0 then    
        result := a || " " || b || " " ||         
                  (a + b) || fib(num - 1, a + b, b)        
    return result    
end

procedure main()
    local num 
    write("Enter a number: ") 
    num := read() 
    write(" ") 
    write(fib(num, 0, 1))
end
```

There's not data type declaration...as it changes according to its value. An operations can success or fail...which prevents crashes.  Icon doesn't have arrays, but lists, records and tables and list can be composed of different data types.

You can download Icon from [here](https://www2.cs.arizona.edu/icon/current/).

And follow [these](https://www2.cs.arizona.edu/icon/current/install.htm) instructions to compile it. 

To run our app we simply need to call it like this

```
icon name_of_file.icn
```

![Icon Exec](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ufjyn7r6sfehb2madgkd.png)
 
You can read my Icon introduction [here](https://blagarts.com/static/GeekyThursday/Languages/Icon_Introduction.html).

**Prolog (Programming Logic - 1972)**

![Prolog Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbcrvu09e9kb53sya5hv.png)

General purpose logic programming language associated with artificial intelligence and computational linguistics.

```
fibo(NUM,A,B,[H|T]) :- (NUM > 1 -> H is A + B, X is NUM - 1, 
                        (A =:= 0 -> fibo(X,H,B,T); fibo(X,H,A,T))).
fibo(_,_,_,[]).

fibonacci(NUM,R) :- fibo(NUM,0,1,X), !, append([0,1], X, R).
```
 
Prolog is declarative and the program logic is expressed in terms of relations, represented as facts and rules. Recursion is a key component of Prolog.

For this I'm using [swi-prolog](http://www.swi-prolog.org/download/stable) because it's free and widely used.
 
To run this example, simply do this

```
swipl
```

And the call our filename like this...

```
[fibonacci].
```

Then, call the main function like this...

```
fibonacci(5,X).
```

![Prolog Exec](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3qfvfwmr3n2ybo5o2l4.png)

You can read my Prolog introduction [here](https://blagarts.com/static/GeekyThursday/Languages/Prolog_Introduction.html).

And least but not last...

**Forth (1970)**

Imperative stack-based programming language and programming environment.

![Forth Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zwbpt2ki8zij3ffz96tc.png)

```
: FIBO 
   1 SWAP 
   0 DUP . 
   ?DO 
      DUP . OVER OVER + ROT DROP 
   LOOP 
   DROP DEPTH 
   DEPTH 2 = IF 2DROP 0 THEN ; 
```

As we manipulate the stack, we use LIFO (Last In, First Out). There's a lot of functions to help us with the stack, like duplicate, rotate, swap and so on...

If you're using Linux, simply do this...

```
sudo apt-get install pforth
```

If you're using Windows then go [here](https://code.google.com/p/pforth/downloads/list).

In order to run this example simply call

```
pforth
```

And once inside the environment

```
INCLUDE name_of_file.fth
```

![Forth Exec](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0rc2ixgq9uqowzx6pdh.png)
 
You can read my Forth introduction [here](https://blagarts.com/static/GeekyThursday/Languages/Forth_Introduction.html).

That's it...I hope you like this post and next one coming should be **5 not well known Programming Language that are worth exploring**.

**Blag.**