Coder Social home page Coder Social logo

mtl_library's Introduction

Metal Library - mtl_library

Collection of various mtl (Metal) libs. My attempt to streamline most of the *.mtl files in order to join forces :)

Projects

Compilation

In order to compile the code, make use of https://github.com/rngtng/mtl_linux / https://github.com/RedoXyde/mtl_linux

Mac OSX / macOS

Simplest way on macOS is using homebrew. Find the latest formular here: https://github.com/rngtng/homebrew-mtl_linux with

brew tap rngtng/homebrew-mtl_linux
brew install mtl_linux

Test

Once compiler & simulator installed, run the test

make test

Documentation

See _docs for a collection of language grammar and command description. See to:

Understanding the Bytecode

The bytecode is written in a custom language by Sylvain Huet. It is referenced as Metal and files end with .mtl. Unfortunately documentation is very poor (and in french). Check directory bytecode/_original which contains a basic overview & documentation as well as a list of (common) commands. A good reference is the original bytecode, included in the directory as well. Major parts got extracted into seperate files, found in bytecode/lib/ directory and ready to be included in your code.

Grammar: https://docs.google.com/document/d/1KMg2wSyMKTmsilCpOByi_59uk5dD8XMfGAu20W63kZE/edit?hl=en_US

Testing

The kit includes a simple test framework to test custom bytecode. See bytecode/test/test.mtl. A typical test looks like this:

 let test "math operations" -> t in
  (
    //assertions
    assert_equalI 0 10 - (2 * 5);
  0);

The framework offers assertions similar to Ruby Test::Unit style. Mind that the variable type has to be given explicit. Convention is:

  • I = integer
  • S = string
  • L = list
  • T = table

Following assertions are available (see bytecode/test/helper.mtl)

  • assert_equalI I I
  • assert_equalI S S
  • assert_nil I
  • assert_equalIL
  • assert_equalSL
  • assert_equalTL

mtl_library's People

Contributors

rngtng avatar

Watchers

 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.