Coder Social home page Coder Social logo

onyx's Introduction

this is still in a REALLY REALLY Early stage, like not even usable

If ye like this concept then PLEASE Help Out!
I cant do it all by myself... :/

Check out TUTORIAL.md for a quick crash course

General

  • .ox file extension
  • asm but with high level features, like iterators and closures
  • very hands on and 'Do it Yourself'.
  • most things are represented as just series of bits making ye have to think bout how stuff maps in mem
  • Freedom of asm, anywhere-to-anywhere data flow and execution order
  • no bs oop, just code
  • Both Curly Brackets, and Significant whitespace
  • DENSE operator oriented syntax

Done

  • Comments //
  • Parsing Markers
  • Console Logger
  • Parsing Includes

Hello World

main {
    *stdout <= "Hello, World!\n"
}

or

@std prtl
main {
    prtl<"Hello, World!">
}

std subroutine examples

// `&*` means the subroutine takes any number of arguments of any "type"
@std cat fmt
prtl<&*> {
    // `$&*` means it'll take all of the args 
    *stdout <= cat<&, "\n"> <- fmt<$&*>
}

Fibonacci

// exit with code, `$0` specifies that we want a literal number `0`
main -> <$0> {
    ;n = 9
    print_fib
}

// all returns go to the stdout channel
print_fib -> *stdout {
    // `ret<>` returns
    (n < 1) => ret<"Invalid Number of Terms!\n">
    (n = 1) => ret<"0\n">
    (n = 2) => ret<"0 1\n">
    
    *stdout <= "0 1\n"

    // # means the var will be freed at the end of the scope
    ;#prev1 = 1
    ;#prev2 = 0

    @loop
    ;fn = (prev1 + prev2)

    prev2 <= prev1
    prev1 <= fn

    // `#` here explicitly frees the value after its use
    // `fmt<>` formats the integer into ascii, `cat<>` concatinates two strings
    *stdout <- cat<&, "\n"> <- fmt<#fn>

    // decrement by 1
    dec<n>

    // jump to `@loop`
    (n > 0) => jmp(loop)

    // return nothing, (unsafe!)
    ret<#>
}

onyx's People

Contributors

slbsh avatar

Stargazers

Goren Barak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.