Giter Club home page Giter Club logo

ploy's Introduction

Ploy

Ploy was designed as a statically-typed, systems programming language with a strong meta-programming capacity. Specificially designed to be used in video game engine development.

The current implementation is a very early one, it uses llvm as a backend, and can currentlly compile a resonable subset into llvm bitcode.

The project has been mostly orphaned with Rust aligning pretty well to many of the initial goals.

Quirks

Bootstrapping

Since we compile to llvm bytecode, and ploy uses C types and calling conventions, we can bootstrap in a pretty neat way.

The core of the compiler is written in C++, this implements a subset of the language. One that most strictly, doesn't do type inference or type checking, or any of the other fancy things that we want to do.

Then we link in bootstrap_shims.cpp, which provides no-ops for elements of the compiler which are not part of the restricted subset, this allows us to build a "bootstrap" compiler.

We then use the bootstrap compiler to compile any ploy sources, at this point, we can just link those in using the standard llvm linker instead of the bootstrap_shims.cpp to generate a final, and fully featured compiler.

Entry functions

Every module creates an entry function based on any code that is in the top-level of the source, this code gets inlined into a function specified by --entry-func which defaults to "main" that works ok when compiling a single file, but will cause conflicts with multiple compilation units, and don't get called automatically.

Running Ploy

Compiliation of ploy isn't very streamlined, and the ploy compiler only generates llvm .ll files. But in general, compilation can be tested like so:

ploy -o <intermediate.ll> <input.ply>
llc -o <outputfile> <intermediate.ll>

The jamfile used for the compiler could be used as an example of how to build projects with ploy.

ploy's People

Contributors

scatteredray avatar

Stargazers

 avatar Angus H. avatar mmm avatar Thomas Gatzweiler avatar

Watchers

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