Orion is a lisp dialect.

Overview

Orion

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


Install

From releases

  • Download binary from the releases.

With cargo

  • Run cargo install orion-cli
  • Run cp ~/.cargo/bin/orion-cli ~/.cargo/bin/orion

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
Comments
  • CI(rust): Build agains multiple rust versions

    CI(rust): Build agains multiple rust versions

    thing

    This merge request implements building agains Rust Stable, beta, nightly and minimal supported version (1.44.0) on ubuntu, windows and macos, enables colors in GitHub UI and optimized the build trigger to not waste processing resources and puts test into it's own file.

    Credit: Cargo-make's CI https://github.com/sagiegurari/cargo-make/blob/master/.github/workflows/ci.yml

    Signed-off-by: Jacob Hrbek [email protected]

    opened by Kreyren 5
  • String functions

    String functions

    Add functions for string mainuplation in the builtins and in the standard library. Here a non exhaustive list:

    • strlen
    • @
    • substr
    • strcat
    • split
    • replace Of course do not forget to add documentation for every function.
    documentation enhancement good first issue 
    opened by Wafelack 1
  • Authorize double imports

    Authorize double imports

    Currently, this kind of codes does not work:

    (load "core/math.orn")
    (load "core/bool.orn")
    

    because math.orn imports bool.orn.

    It may be good to have an "import checker" to check if it has already been imported, and if yes, skip the load call.

    enhancement 
    opened by Wafelack 0
  • Token Comments and documentation

    Token Comments and documentation

    While reading the documentation, I didn't find the comment syntax.

    Orion doesn't have token comment syntax from R7RS. It's useful to comment a block like ;#(abc def). It's also useful as REPL prompt too.

    For example, the (mock) REPL output below can be used directly.

    #;orion:001> 1
    ; => 1
    
    opened by locriacyber 0
  • Common Lisp like `restart`s

    Common Lisp like `restart`s

    A restart interface would be great, e.g.,

    (defun apply (f x)
      (if (not (eq? (type-of f) 'function))
        (restart "Not a function"
                     '(("Abort" . 'nil)
                       ("Supply another function" . `(apply (eval (read)) ,x))))
        (f x)))
    
    enhancement 
    opened by Wafelack 0
  • Youth Hacking 4 Freedom

    Youth Hacking 4 Freedom

    Consider submitting this proiect for YH4F organized by The Free Software Foundation Europe

    https://freespeech.firedragonstudios.com/@kreyren/107008739205851180

    opened by Kreyren 1
  • Self-contained documentation and maybe namespacing

    Self-contained documentation and maybe namespacing

    Hello @Wafelack, This is an interesting language written in my favorite language. I have some discussion regarding the roadmap.

    What do you think about including a documentation inside the binding? It is interesting on how bindings are separated from the value, even from the function at all times. But, I'm curious if–like other lisp–we can put the documentation into the binding, especially the standard library. We can then inspect it in the REPL and that will enable best practice enforced when making libraries.

    Do you plan to have namespace? Or even module? More roadmap? Curiously, I imagine this toy language (despite already good) will scale one day. I'm interested to see some namespace or module system. Well, currently I'm learning the source, but I'd like to hear the roadmap or plan that you may have devised.

    enhancement 
    opened by Abdillah 2
  • Webassembly Support

    Webassembly Support

    Currently orion does not compile on the wasm32-unknown-unknown target because of a few function calls in fs2.

    It would be nice to have a default feature that enables IO functionality so this project can be used from wasm.

    enhancement 
    opened by theduke 0
Releases(0.1.0)
Owner
Wafelack
I make computer beep boop beep beep boop.
Wafelack
A simplistic functional programming language based around Lisp syntax.

Orchid A simplistic functional programming language based around Lisp syntax. Short taste # function to return the larger list (fn larger-list (as bs)

rem 3 May 7, 2022
Embeddable tree-walk interpreter for a "mostly lazy" Lisp-like scripting language.

ceceio Embeddable tree-walk interpreter for a "mostly lazy" Lisp-like scripting language. Just a work-in-progress testbed for now. Sample usage us

Vinícius Miguel 7 Aug 18, 2022
Majestic Lisp book and implementation, in Brazillian Portuguese.

Majestic Lisp Criado e desenvolvido por Lucas S. Vieira <lucasvieira at protonmail dot com>. Seja bem-vindo(a) a Majestic Lisp, um dialeto de Lisp cuj

Lucas Vieira 3 Oct 26, 2022
A lisp-like language written in Rust

Lispy A lisp-like language with an implementation written in Rust. Usage Open a repl with: $ lispy repl Run a file with: $ lispy run ./examples/hello_

Lino Le Van 4 Oct 1, 2023
Lisp dialect scripting and extension language for Rust programs

Ketos Ketos is a Lisp dialect functional programming language. The primary goal of Ketos is to serve as a scripting and extension language for program

Murarth 721 Dec 12, 2022
Milho (corn in portuguese) is a toy dialect of Lisp written as a way to learn more about compilers

Milho (corn in portuguese) is a toy dialect of Lisp written as a way to learn more about compilers. There are implementations in rust and go

Celso Bonutti 27 May 4, 2022
A dialect of Lisp that designed for Minecraft bedrock command.

Command Lisp Document Command Lisp是一门为Minecraft Bedrock设计的简化语言,拥有这非常高的抽象程度。同时,它也是Lisp的一门方言。 Lisp 与众不同的部分原因是,它被设计成能够自己进化。你能用 Lisp 定义新的 Lisp 操作符。

CAIMEO 5 Jul 21, 2022
1️⃣ el lisp number uno - one lisp to rule them all 🏆

luno el lisp number uno luno is the one lisp to rule them all. Still experimental, do not use it in production yet. goals embeddable small size simple

Eva Pace 3 Apr 25, 2022
Orion lang is a lispy programming language that is strongly and statically typed.

Orion Orion is a lisp inspired statically typed programming language written in Rust Install To install orion you can either: Download binary from the

Wafelack 226 Dec 17, 2022
A collection of compilers based around compiling a high level language to a Brainfuck dialect.

tf A collection of compilers based around compiling a high level language to a Brainfuck dialect. Built at, and for, the VolHacks V hackathon during O

adam mcdaniel 6 Nov 25, 2021
Pua-lang - a dialect of The Monkey Programming Language

pua-lang PUA Programming Language written in Rust. What's pua-lang? pua-lang is a dialect of The Monkey Programming Language, intended to mirror the i

flaneur 3.2k Jan 6, 2023
Lisp but using indentations

Calcit Runner An interpreter for Calcit snapshot file. Home http://calcit-lang.org/ APIs http://apis.calcit-lang.org/ Running Calcit Editor with compa

Calcit 63 Dec 26, 2022
Create evolving artistic images with hot-code-reloaded Lisp and GLSL.

Shadergarden is a tool for building hot-code-reloadable shader pipelines. For a tutorial for how to get started, consult the introductory

Tonari, Inc 101 Dec 29, 2022
Lisp-style programming language

Bobbylisp A programming language, syntax are like mal and clojure. This project follow mal guides, Planning to add some more features after finishing

azur 36 Dec 19, 2022
Lisp and Rust in a text editor => Crispmacs

crispmacs crispmacs is a WIP implementation of Emacs from scratch in Rust. It consists of two parts: crisp and the editor. Crisp crisp is a Lisp that'

rust 3 Jul 31, 2022
Lisp interpreter that might be fast someday maybe?

ehlisp Pronunciation I'm not really sure. Maybe like an incorrect pronunciation of "ellipse", like "ellisp"? Also maybe like "a lisp". I named it this

Eddie Hatfield 3 Oct 6, 2022
Compiler from a lisp-like language to mlog

slimlog slimlog compiles a lisp-like language to mlog Architecture slimlog is divided into three distinct parts Parser Parses the source file Compiler

The Potato Chronicler 6 May 7, 2022
A simplistic functional programming language based around Lisp syntax.

Orchid A simplistic functional programming language based around Lisp syntax. Short taste # function to return the larger list (fn larger-list (as bs)

rem 3 May 7, 2022
An interpreted LISP-like language. Made in Rust.

RISP Warning: The language is a work in progress. It's lacks many features and might not be stable. RISP is an interpreted LISP-like language. It's wr

Shivram 4 Sep 24, 2022
Embeddable tree-walk interpreter for a "mostly lazy" Lisp-like scripting language.

ceceio Embeddable tree-walk interpreter for a "mostly lazy" Lisp-like scripting language. Just a work-in-progress testbed for now. Sample usage us

Vinícius Miguel 7 Aug 18, 2022