Giter Club home page Giter Club logo

basil's Introduction


The Basil Programming Language

println "Welcome to Basil!"

def greetings = ["Hello" "Nice to meet you" "Salutations"]

def greet name? greeting? =
    println greeting + ", " + name + "!"

println "What's your name?"
greet (read String) greetings[1]

For more examples, see the example/ directory located in this project's root!

Basil is a fast and flexible language for expressing complex problems in natural terms without compromising readability, simplicity, or performance.

Featuring...*

  • A novel context-sensitive parser that allows seamless manipulation of language syntax.
  • Homoiconicity, supporting Lisp-style metaprogramming via quotations and eval.
  • A "first-class everything" approach - Basil has no keywords, and almost no rigid syntax, so even primitive types and operations can be extended and manipulated.
  • A static, structural type system that permits expressive type-level programming.
  • Evaluation is compile-time by default, with the compiler capable of evaluating arbitrary Basil code.
  • Partial evaluation allows the compiler to "lower" expensive or effectful code, compiling it to efficient native code instead of evaluating it ahead-of-time.
  • Our home-grown compiler backend compiles Basil code quickly, and applies competitive optimizations.
  • Finally, the whole compiler and runtime fits in under a megabyte and depends only on libc.

*Note: Basil is highly WIP! The language is unstable, and these claims may or may not apply on all platforms or for all applications.


Installation

Currently, we only support building the Basil compiler from source. You'll need a C++17-conformant C++ compiler, a Python 2.7 or Python 3 interpreter, and maybe a bit of resourcefulness...

$ git clone https://github.com/basilTeam/basil
$ ./build.py --help             # lists all build options (compiler to use, additional flags, etc)
$ ./build.py basil-release
$ bin/basil help

Basil's language runtime can be compiled separately, as either a statically or dynamically linked library.

$ ./build.py librt-static       # to build a statically-linked library
$ ./build.py librt-dynamic      # to build a dynamically-linked library

Supported Platforms

Operating Systems:

  • Linux
  • Windows
  • MacOS

Architectures:

  • x86_64
  • AArch64
  • RISC-V
  • LLVM
  • WASM

License

Basil is distributed under the 3-Clause BSD License. See LICENSE for details.

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.