Git Product home page Git Product logo

virgil's Introduction

virgil: A Fast and Lightweight Systems Programming Language

def main() {
    System.puts("Virgil is fast and lightweight!\n");
}

Virgil is a programming language designed for building lightweight high-performance systems. Its design blends functional and object-oriented programming paradigms for expressiveness and performance. Virgil's compiler produces optimized, standalone native executables, WebAssembly modules, or JARs for the JVM. For quick turnaround in testing and debugging, programs can also be run directly on a built-in interpreter. It is well-suited to writing small and fast programs with little or no dependencies, which makes it ideal for the lowest level of software systems. On native targets, it includes features that allow building systems that talk directly to kernels, dynamically generate machine code, implement garbage collection, etc. It is currently being used for virtual machine and programming language research, in particular the development of a next-generation WebAssembly virtual machine, Wizard.

This repository includes the entire compiler, runtime system, some libraries, tests, documentation and supporting code for Virgil's various compilation targets.

Language Design

Virgil focuses on balancing these main features in a statically-typed language:

  • Classes - for basic object-oriented programming
  • Functions - for small-scale reuse of functionality
  • Tuples - for efficient aggregation and uniform treatment of multi-argument functions
  • Type parameters - for powerful and clean abstraction over types
  • Algebraic data types - for easy building and matching of data structures

For more, read this paper. Or see the tutorial. Or read up on libraries.

Supported Targets

Virgil can compile to native binaries for Linux or Darwin, to jar files for the JVM, or to WebAssembly modules. Linux binaries can run successfully under Windows using Window's Linux system call layer. The compiler is naturally a cross-compiler, able to compile from any supported platform to any other supported platform, so you need only be able to run on one of these platforms in order to target any of the others.

  • x86-darwin : 32-bit Darwin kernels (MacOS)
  • x86-64-darwin : 64-bit Darwin kernels (MacOS)
  • x86-linux : 32-bit Linux kernels
  • x86-64-linux : 64-bit Linux kernels
  • jar : JAR files for the Java Virtual Machine
  • wasm : WebAssembly module for any Wasm engine

Implementation

Virgil is fully self-hosted: its entire compiler and runtime system is implemented in Virgil. It was originally designed as a language for embedded systems, particularly microcontrollers, but now supports more mainstream targets. The compiler includes sophisticated whole-program optimizations that achieve great performance and small binaries. Native binaries compiled from your programs can be as small as a few hundred bytes in size and consume just kilobytes of memory at runtime. You can learn more in the Implementation Guide.

Documentation

The most up-to-date documentation is, as always, this repository! Learn how to get started using Virgil and browse the tutorial, where many example programs exist.

Research Papers

Five research papers have been published on Virgil.

License

Licensed under the Apache License, Version 2.0. (rt/LICENSE or https://www.apache.org/licenses/LICENSE-2.0)

virgil's People

Contributors

titzer avatar k-sareen avatar s123unny avatar haoyu-zc avatar btwj avatar syrusua-t avatar srackham avatar dependabot[bot] avatar mingodad avatar markhol avatar diakopter avatar satvikg7 avatar yonahgoldberg avatar ejrgilbert 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.