Matter is a compiler creating language (a DSL) for easily building parsers, ASTs, interpreters and, of course, compilers in one simple language. Wether you want to work on an existing programming language or create your own one, Matter helps you and saves you time.
Wether you want to work on an existing programming language or create your own one, Matter helps you and saves you time.
- Static typed and type-inferred language
- Simple syntax inspired by Ruby and Python
- Clear seperation of each part (parsing, AST generation and compilation) while still keeping all together in its type (see the documentation)
- Extendable compilation support for machine code, the JVM, etc. (through the Compiler interface)
- Shareable and managed language definition packages
- Shareable and managed compiler backend packages
- Browseable package registry
- Automatically Git versioned
Clone this repository:
git clone https://github.com/hyronx/matter
cd matter
sbt stage
Now you should be able to run the Matter cli by entering:
Linux / OS X:
./target/universal/stage/bin/matter-compiler
Windows:
.\target\universal\stage\bin\matter-compiler.bat
If you got any problems, please have a look at the issue section.
To create a new project:
matter-compiler new <project-name>
This will create a new directory in your current working directory called <project-name>
. It should have the following structure:
<project-name>
|-- build
|-- src
| |-- main
| | `--matter
| | `--<project-name>
| `-- test/
`-- config.yaml
Now you can place your source files in src/main/matter/<project-name>
and compile them by entering:
matter-compiler compile
which should result in some Java class files in the build
directory.
You can execute your compiler/parser/etc. by entering:
matter-compiler run <file-to-parse>
where <file-to-parse>
is the file to be parsed by your Matter app.
Again if you got any problems, please have a look at the next section.
To find out more about the available options for Matter have a look at the documentation.
Checkout the src/test/matter
directory where you can find multiple small examples
of how Matter apps can look like.
If something didn't work, you have two options:
- Ask for help on Gitter. I will be happy to assist you with any problems.
- Check if this problem is already reported on GitHub and if not, open a new issue.
- Implement the language parser
- Generate parsers based on Matter source code
- Generate mappings from syntax to usable data
- Define the Compiler interface
- Implement the Compiler interface for the JVM
For more information see ROADMAP.md
See CONTRIBUTION.md
Apache License V2.0
For more information see LICENSE
First name or username followed by e-mail address in parenthesis, e.g.: hyronx (hyronx@outlook.com)
See AUTHORS