All Projects → beast-lang → beast-dragon

beast-lang / beast-dragon

Licence: MPL-2.0 license
Beast language compiler & reference

Programming Languages

d
599 projects

Projects that are alternatives of or similar to beast-dragon

save
Universal test framework for cli tools [mainly for code analyzers and compilers]
Stars: ✭ 33 (+153.85%)
Mutual labels:  compilers
nmodl
Code Generation Framework For NEURON MODeling Language
Stars: ✭ 42 (+223.08%)
Mutual labels:  compilers
pymlir
Python interface for MLIR - the Multi-Level Intermediate Representation
Stars: ✭ 84 (+546.15%)
Mutual labels:  compilers
compilers-lectures
Lectures for the class on [email protected]
Stars: ✭ 67 (+415.38%)
Mutual labels:  compilers
compiler
My first attempt to create a compiler
Stars: ✭ 16 (+23.08%)
Mutual labels:  compilers
tiny-lang
tiny-lang — A different programming language. Supports a bunch of spoken languages.
Stars: ✭ 26 (+100%)
Mutual labels:  compilers
wasm-script
Compile WebAssembly in your HTML
Stars: ✭ 28 (+115.38%)
Mutual labels:  compilers
librxvm
non-backtracking NFA-based regular expression library, for C and Python
Stars: ✭ 57 (+338.46%)
Mutual labels:  compilers
open-ops
Open Optimizing Parallelizing System
Stars: ✭ 21 (+61.54%)
Mutual labels:  compilers
cppcombinator
parser combinator and AST generator in c++17
Stars: ✭ 20 (+53.85%)
Mutual labels:  compilers
comp
Disciplina de Compiladores (INF01147) - INF/UFRGS
Stars: ✭ 28 (+115.38%)
Mutual labels:  compilers
data-mediator
a data mediator framework bind callbacks for any property
Stars: ✭ 66 (+407.69%)
Mutual labels:  compile-time
Jazz
Jazz - modern and fast programming language.
Stars: ✭ 86 (+561.54%)
Mutual labels:  compile-time
lua-in-rust
The Lua programming language, implemented in Rust.
Stars: ✭ 76 (+484.62%)
Mutual labels:  compilers
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (+692.31%)
Mutual labels:  compile-time
pyCompiler
Python Compiler
Stars: ✭ 13 (+0%)
Mutual labels:  compilers
Rugby
🏈 Cache CocoaPods for faster rebuild and indexing Xcode project
Stars: ✭ 448 (+3346.15%)
Mutual labels:  compile-time
ghostwriter
Solutions for instrumenting application flow tracking API calls into an existing code base in a non-invasive way
Stars: ✭ 17 (+30.77%)
Mutual labels:  compile-time
compile-time-perf
Measures high-level timing and memory usage metrics during compilation
Stars: ✭ 64 (+392.31%)
Mutual labels:  compile-time
nimly
Lexer Generator and Parser Generator as a Library in Nim.
Stars: ✭ 113 (+769.23%)
Mutual labels:  compile-time

Beast Programming Language

Build Status

Beast is a new programming language mostly inspired by C++ and D.

This repository contains (everything is WIP):

Source file extension: .be

Notable language features

  • Importable modules (no header files like in C++)
  • C++ style multiple inheritance class system
  • Powerful compile-time engine
  • Compiled (to C so far, switch to LLVM is planned)
  • Const-by-default
  • Compile-time language reflection

Progress

!!! DEVELOPMENT CANCELLED

  • Compiler: The compiler now works as a proof-of-concept. It has some core functionality working, but not really anything you could write your programs with.
    • See test/tests for working code examples
  • Std library: Nothing at all
  • Language reference: Nothing much

Contact

Author: Daniel 'Danol' Čejchan
Email: [email protected]

Sample code

Please note that this code describes what the language should be able to do when done, not what it can do now.

For currently compilable code, ses tests in test/tests. Compiling and running the testsuite (./runTests) generates commands required for running each test (commands are in log files in the test/log directory).

Specifically, tests in the examples folder are designed as examples.

class C {

@public:
  Int! x; // Int! == mutable Int

@public:
  Int #opBinary( Operator.binPlus, Int other ) { // Operator overloading, constant-value parameters
    return x + other;
  }

}

enum Enum {
  a, b, c;

  // Enum member functions
  Enum invertedValue() {
    return c - this;
  }
}

String foo( Enum e, @ctime Type T ) { // T is a 'template' parameter
  // 'template' and normal parameters are in the same parentheses
  return e.to( String ) + T.#identifier; 
}

Void main() {
  // @ctime variables are evaluated at compile time
  @ctime Type T! = Int; // Type variables!
  T x = 3;

  T = C;
  T!? c := new auto(); // C!? - reference to a mutable object, := reference assignment operator
  c.x = 5;

  // Compile-time function execution, :XXX accessor that looks in parameter type
  @ctime String s = foo( :a, Int );
  stdout.writeln( s );

  stdout.writeln( c + x ); // Writes 8
  stdout.writeln( c.#opBinary.#parameters[1].type.#identifier ); // Compile-time reflection
}

How to build

  1. Download a D compiler
  2. Clone this repository
  3. Execute dub build in the root
  4. Folder bin is created with the Beast Dragon compiler

News

29.10.2018: Development cancelled. I was planning to continue working on Beast as my master thesis, but they rejected it. Bummer. Feel free to use anything, but I don't expect it to be of any use in the current state.

05.05.2017: Finished writing code for bachelor's thesis. Development of this project is now halted until master thesis or until excessive interest for this project is shown from a community.

27.04.2017: Static functions with @ctime parameters implemented! They generate kinda messy code ("template" instances are not joined when provided with same arguments), but still, we have them!

21.04.2017: We now should have fully working @ctime mirroring in both interpreter and cpp backends.

14.04.2017: @ctime variables now work in runtime functions and are properly mirrored! (the subsystem has to be implemented for interpreter yet). See test/ctime/t_basicmirroring.

04.04.2017: We have classes now! Constructors are not generated automatically, so you have to do Void #ctor() { mem1.#ctor(); mem2.#ctor(); }

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].