Giter Site home page Giter Site logo

rwillians / rinha-de-compilers--elixir-transcompiler Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 96 KB

Source-to-Source Transcompiler from `.rinha` to Elixir. Runs on ERTS (Erlang Runtime System).

License: MIT License

Elixir 90.53% Dockerfile 1.19% Shell 8.28%
elixir rinha-de-compilers

rinha-de-compilers--elixir-transcompiler's Introduction


A Source-to-Source Transcompiler written in Elixir

Fancy names apart, the core idea here is that we take a program .rinha, parse it, transpile it to Elixir AST and then compile it as its own module.

Instructions for the competition's organizers on how to run it

You might opt for using a pre-built image:

docker pull ghcr.io/rwillians/rinha-de-compilers--elixir-transcompiler:0.2.4

Clone

git clone [email protected]:rwillians/rinha-de-compilers--elixir-transcompiler.git rwillians
cd rwillians

Build

docker build -t rwillians .

Run a program once

docker run \
  --mount type=bind,source="/absolute/path/to/source.rinha",target="/var/rinha/source.rinha" \
  --memory=2gb \
  --cpus=2 \
  rwillians
  # compile once, run the program 1 time

Run a program multiple times (for benchmarking):

docker run \
  --mount type=bind,source="/absolute/path/to/source.rinha",target="/var/rinha/source.rinha" \
  --memory=2gb \
  --cpus=2 \
  rwillians /var/rinha/source.rinha 10
  #                                 ^ compile once, run the program 10 times
time docker run \
  --mount type=bind,source="/absolute/path/to/source.rinha",target="/var/rinha/source.rinha" \
  --memory=2gb \
  --cpus=2 \
  rwillians /var/rinha/source.rinha 1000000 &>/dev/null
  #                                 ^       ^ redireciona stdout para /dev/null
  #                                 ^ compile once, run the program 1Mi times

About me

I'm here¹ in the old blue bird at @rwillians_.

rinha-de-compilers--elixir-transcompiler's People

Contributors

rwillians avatar

Stargazers

 avatar  avatar  avatar  avatar  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.