/twocode

Language designed for code generation. Solve difficult problems by adding new language features from within your code

Primary LanguagePythonMIT LicenseMIT

Twocode

TravisCI Build Status License: MIT

Language designed for code generation. Solve difficult problems by adding new language features from within your code. Experimental? Metaprogramming?

Demo

Check out this Jupyter Notebook demonstrating code editing in Twocode!

Prerequisites

  • Python 3

Installation

easy_install https://github.com/MrCoft/twocode/tarball/master
twocode

Starts the interpreter.

Status

Missing key features such as typing, advanced class fields, transpiler, native implementation.

Why code generation?

Conventional code has a mostly 1-to-1 correspondence between source code and runtime instructions.
All language features abstract over this, but unless they are programmable, they are limited.
Sometimes the most readable code isn't fast and the fast code isn't readable.
Such problems are best modelled by setting up configuration objects, then building code from them.

Examples of problems solved using code generation:

  • lexers, parsers
  • GPU shaders
  • symbolic math
  • dataflow graphs
  • script assets

tl;dr

think Lisp, write Python, compile Java