Posts

CodeX

  CodeX General Purpose Language Compiled and statically typed Main difference from other computer languages is that it has tagged keywords like html: {if} ... {/if} Code Sample: {module} Euclid     {fun} int Euclid(int a, b)         {while} b != 0             {if} (a > b) a = a - b                 {else} b = b - a                 {/else}             {/if}         {/while}         {return} a {/return}     {/fun}     {main} str arg[ ]         in -> a, b         Euclid(a, b) -> out     {/main} {/module}

Syntax

Syntax Changing syntax of programming languages 1. Reversed assignment operator a + b -> a Allows assignment to flow from left to right like we write in more natural direction 2. Tagging keywords {while} ... {/while} This allows to easy introduce new keywords into language and to easy find mistakes in control flow of programs 3. Reversed object notation b@agi instead of agi.b 4. Reversed function declaration {fun} a b -> f and call a b -> f These two changes allow to combine input and output in one line which is also more natural 5. New for loop syntax {for} 0 -> i++ < n     Pseudo Code Examples Classes and Functions {module} {class} mind ! comment [p1, p2, ... , pn] -> parameters ! reversed assignment {fun} array -> algorithm ! function declaration ! processing parameters return results {/fun} ! tagged keywords {/class} {fun} ! main function agi -> mi

Rounding Transcendental Numbers

  Do you want to round e & pi because they have too many digits? Cube them instead: e ^3 = 20.0... pi ^3 = 31.00...

Tellur

  {module}     {class} mind      ! comment         [p1, p2, ... , pn] -> parameters    ! reversed assignment         {fun} array -> algorithm    ! function declaration             ! processing parameters             return results         {/fun} ! tagged keywords     {/class}     {fun}         agi -> mind    ! adding object agi to class mind         in -> parameters@agi -> algorithm@agi -> out         ! combined input and output and function call         ! with new reversed object notation using @                  {/fun} {/module}    ! nameless module and main function

Features of Camellia

Camellia keyword tagged language {while}  . . .  {/while} reversed & piped assignment operator a - b | a instead of a = a - b writing from left to right in assignment operator is like writing same way in Linux CLI using piping

Palindrome in Camelia

{module} palindrome     {fun} str | palindrome         true | p         len:str | l         {from} 0 | i to l/2 - 1 by 1             {if} str[i] != str[l - i - 1]                 false | p                 break             {/if}         {/from}         return p     {/fun}       {main}         'it is ' | out         in | string | palindrome | out         ' that word ' string ' is palindrome' | out     {/main} {/module}

Name Game

Programming Languages they can be: Interpreted     In        or Compiled        Co and Statically typed         Sta        or Dynamically typed    Dy it gives us 4 combinations: InSta         Java InDy          Python   CoSta        C++    CoDy          Common Lisp    (not popular)