Giter Site home page Giter Site logo

album's Introduction

Album

Album is a stack-based, Turing-complete, esoteric programming language inspired by Super Stack!.

Album programs are called "playlists". Each playlist starts with a declaration saying by whom this playlist was created, followed by a list of songs, which act as instructions and branch labels. See spec.md for the language specification and the list of built-in songs.

For some example programs written in Album, see the Resources/Examples folder.

The C# Implementation

This repo implements an Album compiler that outputs CIL, written in C# 9 and .NET 5.

Testing

dotnet test

Building From Source

dotnet build

This creates an Album.dll executable at the Album/bin/Debug/net5.0 directory. For more options, see the documentation. To run it, use the dotnet command:

dotnet Album/bin/Debug/net5.0/Album.dll <INPUT SOURCE FILE> [options]

You can also choose to deploy the Album compiler using dotnet publish.

Compiler Options

-o, --output        Path to output file.

-P, --parse-only    Generates the parser output, with optimisations applied,
                    if any

-R, --run           Runs the program immediately, without generating any
                    files.

-O, --optimise      Smaller output code size, longer compile time

-w, --warn          (Default: Warning) What warnings should be output as Valid
                    values: None, Warning, Error

-s, --manifest      Path to custom song manifest file

--help              Display this help screen.

If -o is not specified, the default output file path is ./Program.exe, or ./ParserOutput.txt in the case of -P. In case an executable is generated, an additional .runtimeconfig.json file with the same name as the executable will be generated in the same directory.

Song Manifests

In case you don't like my choice of songs, you can make up your own songs, write them in a JSON file, and pass that to the compiler when compiling your code. This is known as a song manifest. The default song manifest is located in Resources/. You can use that as an example when creating your own song manifests.

Benchmarks

You can go into the Album.Benchmarks directory and run:

dotnet run -c Release

to run the benchmarks. I compare the difference in compilation time when applying optimisation versus not doing that, and the execution time of optimised vs unoptimised Album code vs C# code. On my MacBook Pro, Album runs 30 times slower than C# for the 99 bottles of beer playlist.

album's People

Contributors

sweeper777 avatar

Stargazers

 avatar

Watchers

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