Oxido is a dynamic interpreted programming language basing most of its syntax on Rust.

Overview

Oxido

Table of Contents:

Oxido is a dynamic interpreted programming language basing most of its syntax on Rust. Conventionally, the files may end with the o extension, however Oxido ignores the extension.

Installation

Oxup, the official installer can be used to install the latest release from GitHub.

oxup install

Uninstallation

You can use oxup to remove the current installation.

oxup uninstall

Usage

You can run an Oxido file using the oxido command. The files may end with the o extension, however Oxido ignores the extension, and runs the file as-is.

oxido <filename>

For example:

oxido ./main.o

Conventionally, base Oxido files are named main.o.

Syntax

Data types

  • String: A string is any value inside " (double quotes) passing the regex \"[A-Za-z0-9 !]+\".

  • Integer: Integers (no fractions), passing the regex [0-9]+.

Variables

Variables are declared by the let keyword, followed by a space and the identifier, which must pass the regex [A-Za-z]+, followed by an equals sign and the value which must be a single string or an integer or an expression of integers, or a variable itself.

For example:

let a = "Hi mom!";
let a = 5;
let a = 5 * 5;

Reassignments

Reassignments are done stating the identifier, which must pass the regex [A-Za-z]+, followed by an equals sign and the value which must be a single string or an integer or an expression of integers, or a variable itself.

let a = 0;
a = "Hi mom!";
a = 5;
a = 5 * 5;

Printing

The print keyword can be used to print variables, expressions and strings to stdout, the value must be inside two parentheses.

print(a);
print(5);
print(5 * 5);
print("Hello world");

If statements

If statements check whether the given condition is true or not using the == or < or > operator. The == is applicable on strings and integers both, while < or > can only be used on integers. The condition must be followed after the code to be executed in the case the condition is true in curly braces {}.

if a == 5 {
    print(a);
}

Loop statements

Loop statements repeat given conditions until break is called.The conditions to be executed in the loop must be followed after the loop keyword in {}.

let b = 0;

loop {
    b = b + 1;

    if b == 5 {
        print("Hi mom!");
        break;
    }

    print(b);
}

Functions

Funcitons store the given conditions until they are called. They are declared with the fn keyword, followed by a space and the name of the function, the name must be a valid identifier, followed by args, seperated by commas in [] and the conditions in {}.

let text = "Hi mom!";

fn message[text] {
    print(text);
}

message[text];

Exiting

The exit keyword can be used to exit the program with the specified exit code

let code = 1;

exit(code);
You might also like...
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位浮点 基本的函数定义,调用,声明外部

Grimsby is an Erlang Port written in Rust that can close its standard input while retaining standard output (and error)

Grimsby An Erlang Port provides the basic mechanism for communication from Erlang with the external world. From the Ports and Port Drivers: Erlang Ref

This blog provides detailed status updates and useful information about Theseus OS and its development

The Theseus OS Blog This blog provides detailed status updates and useful information about Theseus OS and its development. Attribution This blog was

Safe Rust bindings to the DynamoRIO dynamic binary instrumentation framework.

Introduction The dynamorio-rs crate provides safe Rust bindings to the DynamoRIO dynamic binary instrumentation framework, essentially allowing you to

A simple path traversal checker made with Rust. Useful for APIs that serve dynamic files.

Path trav A simple path traversal checker made with Rust. Useful for APIs that serve dynamic files. Note: this is a security tool. If you see somethin

A pure-rust(with zero dependencies) fenwick tree, for the efficient computation of dynamic prefix sums.

indexset A pure-rust(with zero dependencies, no-std) fenwick tree, for the efficient computation of dynamic prefix sums. Background Did you ever have

Keep a Hetzner Cloud firewall up to date with your dynamic public IP address.

hcloud-firewall-controller hcloud-firewall-controller determines the current public IP and creates or updates a Hetzner Cloud firewall with this IP. S

In this repository you can find modules with code and comments that explain rust syntax and all about Rust lang.
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

Comments
  • Parser not parsing, math not mathing

    Parser not parsing, math not mathing

    https://github.com/oxidite/oxido/blob/refactor/src/lexer/mod.rs#L353

    you shouldn't consume the token before checking whether you should stop the loop, simply peek the token and then consume right before you parse again

    opened by cheeze2000 0
  • chore(readme): add usage instructions and table of contents

    chore(readme): add usage instructions and table of contents

    Description

    I noticed there was no documented instructions to actually run an Oxido file, even though there were installation and syntax instructions, so I've added a Usage section in the README

    I've also added a Table of Contents to the top of the README for added flair

    Things added/changed:

    • Add Oxido usage instructions
    • Add table of contents

    For more details, check the commits of this pull request

    opened by savioxavier 0
Releases(v1.2.0)
Owner
Oxido
The programming language from the future
Oxido
A stack based interpreted programming language.

Nightmare Nightmare is a dynamically-typed, procedural programming language that aims to be fast & simple. let user = input() as Int; print("You were

&potato 4 Nov 12, 2021
A statically-typed, interpreted programming language, with generics and type inference

Glide A programming language. Currently, this includes: Static typing Generics, with monomorphization Type inference on function calls func identity<T

Patrick Gu 1 Apr 10, 2022
🤩 Flexible interpreted programming language

Jel Flexible, memory-safe, easy-to-use, interpreted programming language. work in progress Example Hello World: print(Hello World!) # this is valid pr

0x707 4 Sep 18, 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
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
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 query-building & utility crate for SurrealDB and its SQL querying language that aims to be simple

Surreal simple querybuilder A simple query-builder for the Surreal Query Language, for SurrealDB. Aims at being simple to use and not too verbose firs

Thibault H 11 Dec 30, 2022
A simple collection of formatters focused on speed, reliability, correctness and most importantly readability.

EFC The Enoki Formatter Collection (name inspired by the GNU Compiler Collection) is a simple to use colelction of next generation language agnostic f

Enoki 3 Nov 21, 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