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

Overview

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
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
The compiler for Gera, a statically typed and garbage collected programming language.

Gera The compiler for Gera, a satically typed and garbage collected programming language. Currently WIP (Work in progress). Progress This is a rough o

null 4 Oct 26, 2023
Make your IDs strongly typed!!

About TypedId introduces a single type, aptly named TypedId. This is a generic wrapper any type, often types that you would use as an identifier. Howe

Tyler Bloom 8 Sep 2, 2022
Orion is a lisp dialect.

Orion Orion is a lisp inspired statically typed programming language written in Rust Install From releases Download binary from the releases. With car

Wafelack 226 Dec 17, 2022
The Devils' Programming Language (Quantum Programming Language)

devilslang has roots in Scheme and ML-flavored languages: it's the culmination of everything I expect from a programming language, including the desire to keep everything as minimalistic and concise as possible. At its core, devilslang is lambda-calculus with pattern-matching, structural types, fiber-based concurrency, and syntactic extension.

Devils' Language 2 Aug 26, 2022
A small, nutty dependently typed language.

pistachio I want to learn about how theorem provers and dependently typed languages are implemented. This is a little repo for experimentation. elabor

McCoy R. Becker 8 Nov 11, 2022
In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.

Learn Rust What is this? In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang. This is usef

Domagoj Ratko 5 Nov 5, 2022
Open-source Autonomy Software in Rust-lang with gRPC for the Roomba series robot vacuum cleaners

CleanIt Open-source Autonomy Software in Rust-lang with gRPC for the Roomba series robot vacuum cleaners Motivation Motivation is to build a complete

Kristoffer Rakstad Solberg 216 Dec 13, 2022
A conky-like system monitor made for the sole purpose of teaching myself rust-lang.

Pomky A conky-like system monitor made for the sole purpose of teaching myself rust-lang. It is not as configurable, modular, or feature packed as con

null 3 Nov 17, 2022
A complicated eso-lang written in Rust that doesn't limit your creativity!

Documentation for mott Introduction mott (from french "mot" = word) is (maybe) the first programming language, that doesn't limit your creativity to p

Lars 1 Feb 1, 2022
A repository for showcasing my knowledge of the Rust programming language, and continuing to learn the language.

Learning Rust I started learning the Rust programming language before using GitHub, but increased its usage afterwards. I have found it to be a fast a

Sean P. Myrick V19.1.7.2 2 Nov 8, 2022
Nyah is a programming language runtime built for high performance and comes with a scripting language.

?? Nyah ( Unfinished ) Nyah is a programming language runtime built for high performance and comes with a scripting language. ??️ Status Nyah is not c

Stacker 3 Mar 6, 2022
lelang programming language is a toy language based on LLVM.

lelang leang是一门使用Rust编写,基于LLVM(inkwell llvm safe binding library)实现的编程语言,起初作为课程实验项目,现在为个人长期维护项目。 Target Features 支持8至64位的整形类型和32/64位浮点 基本的函数定义,调用,声明外部

Aya0wind 5 Sep 4, 2022
A typed map which can make sure item exist.

Certain Map A typed map which can make sure item exist. What Problem Does It Solve In Rust, we often use Service abstraction for modular structure des

ihc童鞋@提不起劲 27 Jun 26, 2023
Mote is a systems-programming language designed to be practical, performant, and simple.

Mote NOTE: this following lists the goals for what Mote is supposed to be. It does not promise that any of the features here will be accomplished or a

The Mote Programming Language 14 Jul 28, 2021
lints and suggestions for the nix programming language

statix Lints and suggestions for the Nix programming language. statix highlights antipatterns in Nix code. statix --fix can fix several such occurrenc

Akshay 311 Dec 25, 2022
A turing-complete programming language using only zero-width unicode characters, inspired by brainfuck and whitespace.

Zero-Width A turing-complete programming language using only zero-width unicode characters, inspired by brainfuck and whitespace. Currently a (possibl

Gavin M 2 Jan 14, 2022
A simple programming language for something between C and Rust.

inuc inuc is a systems programming language that is something between C and Rust. Features : [] Strong , static typing (type inference not a priority

Sagnik Chatterjee 1 Feb 7, 2022
🐱 A high-speed JIT programming language and its runtime, meow~

?? A high-speed JIT programming language and its runtime, meow~

EnabledFish 30 Dec 22, 2022
Stack-based programming language which emulates the look and feel of the 60s

Cauchemar Cauchemar is a stack-based programming language inspired by FORTH but more arcane. Emulates the look and feel of a programming language from

Yuki Langley 4 Dec 29, 2022