Posts

Showing posts from July, 2022

Eratosthenes Sieve & Swan

  module primes         fun int n | Eratosthenes // subroutine declaration                           int primes [ n ], 1 | l int // assignment operator             0 | i int, 3 | index_square int // proc sift             int first, last, factor // proc mark sieve             for 0 | k int, k < n, k++ // fill with true                 true | primes[k]                                               whil...

Swan Programming Language

Swan        Elegant Programming Language Compiled, indented Statically typed It has different syntax for assignment operator a - b | a instead of a = a - b .swn extension module euclid     fun int a, int b | euclid int   // subroutine declaration           while b != 0                  if a > b                       a - b | a                                    else                       b - a | b         ...