Kreyren / orion-lang

Orion lang is a lispy programming language that is strongly and statically typed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Orion

Orion is a lisp inspired statically typed programming language written in Rust


Install

To install orion you can either:

  • Download binary from the releases.
  • Run cargo install orion-cli

Help

To run the repl

  • Run orion in a terminal

To execute a file

  • Run orion <file> in a terminal (you can add the --debug option to display AST)

Examples

Factorial

(define factorial (lambda (n) {
    (var toret 1)
    (var i 2)
    (while (<= i n) {
        (set toret (* toret i))
        (set i (+ i 1))
    })
    (return toret)
}))

More or less game

(math:initRng)
(define toGuess (math:rand 1 100))
(var guessed 0)
(var tries 0)

(while (!= guessed toGuess) {
  (set tries (+ tries 1))
  (set guessed (static_cast "int" (input "Input number: ")))
  (if (< guessed toGuess) {
    (print "More !")
  } {
    (if (> guessed toGuess) {
      (print "Less !")
    })
  })
})
(print (+ "Well done, you found the number in " (+ (static_cast "string" tries) " tries")))

Documentation

Performances

Ackermann(3, 3) - 500 runs

Language Total Average Median Amplitude
Nixt 63145ms 126ms 121ms 134ms
Orion 4398ms 8ms 8ms 13ms
Python 1.1e-4ms 2.24e-7ms 2.12e-7 3.77e-7ms

Pushing 1000 numbers to an array - 500 runs

Language Total Average Median Amplitude
Nixt 6602ms 13ms 12ms 29ms
Orion 5473ms 10ms 10ms 22ms
Python 5.44e-5ms 1.08e-7ms 9.98e-8ms 1.61e-7ms

About

Orion lang is a lispy programming language that is strongly and statically typed.

License:Mozilla Public License 2.0


Languages

Language:Rust 98.9%Language:Shell 1.1%