GithubHelp home page GithubHelp logo

stroxler / bolt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mukul-rathi/bolt

0.0 0.0 0.0 1.27 MB

Bolt is a language with in-built data-race freedom!

License: MIT License

Shell 0.70% C++ 10.57% Java 0.15% OCaml 82.63% Assembly 0.20% Standard ML 4.73% Makefile 0.19% Dockerfile 0.15% Starlark 0.68%

bolt's Introduction

Bolt - Data-Race Freedom Baked In

CircleCI Coverage Status

What, another programming language?

Yep, this one prevents data races! Concurrent code is hard to get right, so let the language take care of it for you! The best part is that you get more fine-grained concurrency than Rust and this language doesn't get in the way when you want to write single-threaded code. Want to write Rusty ownership-style code - yep, you can do that in Bolt too!

For a description of the theory, check out the accompanying dissertation.

Alright so what does this language do?

You can already write a lot of Java-esque code - see examples/ in this repo. Bolt already supports inheritance, method overloading and overriding, and generics. Is Bolt missing something? Comment on this issue - I'm all ears.

Two ways Bolt differs from traditional languages - the capability annotations for fields and function/method type signatures, and a structured approach to concurrency - so you know exactly how long your threads live for:

finish{
  async{ // fork a thread using the async command - you can spawn as many as you like!
    ... // execute an expression in the forked thread
  }
  ... // continue executing your code on current thread

} // all forked threads finish executing here

Wait, how did you build this?

A lot of trial-and-error and experimenting with reverse-engineering C++ code! I'll save you the trouble - step-by-step tutorials for how I built this all are incoming - I'll tweet about them when they drop so follow me on Twitter. Update: all the posts are live.

Unlike your run-of-the-mill compiler tutorials, we'll be talking about more advanced language features too, like generics, inheritance, method overloading and overriding!

Getting started

Bolt's compiler is written in OCaml and C++. You'll need OCaml and opam installed. You'll also need to install Bazel.

Note you don't need to have LLVM installed - just update llvm.bzl to use the right pre-built LLVM Binary, and Bazel will download and extract that binary for you!

Once you have these installed, the Makefile details all the main commands. To get started run these commands!

  • make install - install dependencies
  • make hook - install the git pre-commit hook
  • make build - build the project

To compile a program:

  • scripts/compile_program.sh <filename> <flag> - run a Bolt program (extension .bolt) - pass in the-help flag to see the list of possible flags you can pass in.
  • alias boltc=./scripts/compile_program.sh >> ~/.bashrc

To compile and run the program:

  • scripts/run_program.sh <filename> <flag> - run a Bolt program (extension .bolt) - pass in the-help flag to see the list of possible flags you can pass in.
  • alias bolt=./scripts/run_program.sh >> ~/.bashrc - okay this isn't strictly necessary, but running bolt <filename> to execute a Bolt program is super cool!

Okay, - the boltc and bolt aliasing isn't strictly necessary, but running boltc <filename> to compile and bolt <filename> to run a Bolt program is super cool!

Check out the REPO_OVERVIEW.md file for more details about the project structure.

bolt's People

Contributors

mukul-rathi 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.