Rix
Efficient language with power of C and the convenience of a high level language.

Rix is an expressive and efficient language for the C ecosystem. Rix uses C libraries natively and generates easy to understand C code.

There are five core principles behind Rix:

  1. Ease of programming, inspired by Python
  2. Fast, like C code
  3. Type safety, like Scala
  4. Ability to go lower level and write C code
  5. No reserved keywords, everything is redefinable
Node :: BaseType
  value = Integer
  left = Node
  right = Node
  
  ::: Integer v
    value = v
  
  : printPreOrder
    $ == 0 if
      ->
    print value
    left printPreOrder
    right printPreOrder
    
  : printInOrder
    $ == 0 if
      ->
    left printInOrder
    print value
    right printInOrder
    
  : printPostOrder
    $ == 0 if
      ->
    left printPostOrder
    right printPostOrder
    print value
  
  : add Integer x
    x < value if
      left == 0 if
        left = Node x
      ? else
        left add x
    ? elif x > value
      right == 0 if
        right = Node x
      ? else
        right add x
    x == value if
      print "Entry already exists"


a = Node 3
a add 2
a add 7
a add 6
a add 8

a printPreOrder

print "-----"

a printInOrder

print "-----"

a printPostOrder
Information updated 06/05/17
View Comments