Irwin1985 / virgil

A fast and lightweight native programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

virgil: A Fast and Lightweight Programming Language

Virgil is a programming language designed for fast, dependency-free programs. Its design blends functional and object-oriented programming paradigms for expressiveness without a lot of overhead, either syntactically or at runtime. Its implementation is focused primarily on static compilation to produce native executables that are standalone. It is well-suited to writing small and fast programs. That makes it ideal for building certain kinds of programs like compilers and virtual machines. It is currently being used for virtual machine and programming language research.

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

Features

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

Supported Targets

Virgil can compile to x86 binaries for Linux or Darwin, to jar files for the JVM, or to WebAssembly. Linux binaries can run successfully under Windows using Window's Linux system call layer.

  • x86-darwin : 32-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. The compiler can bootstrap (i.e. compile itself and all runtime code) on any of the target platforms. 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.

Documentation

The most up-to-date documentation is, as always, the implementation in this repository!

A basic wiki is available, though not all new features are covered. Virgil now supports algebraic data types, enums, and floating point.

Tutorial programs

There are lots of example programs in doc/tutorial.

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)

About

A fast and lightweight native programming language


Languages

Language:Shell 36.6%Language:Java 26.3%Language:C 19.3%Language:C++ 7.0%Language:Assembly 3.4%Language:JavaScript 2.5%Language:Vim Script 1.7%Language:Makefile 1.2%Language:Emacs Lisp 1.0%Language:WebAssembly 0.8%Language:Python 0.3%Language:Io 0.1%