Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.
/ matter Public archive

Programming language for parser/compiler/interpreter creation

License

Notifications You must be signed in to change notification settings

fabianloewe/matter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Matter Language

Join the chat at https://gitter.im/matter-lang/Lobby

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.

Features

Language

  • 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)

Management

  • Shareable and managed language definition packages
  • Shareable and managed compiler backend packages
  • Browseable package registry
  • Automatically Git versioned

Dependencies

  • git - For cloning the repository
  • sbt - For compiling Matter itself
  • scala - For running Matter apps

Installation

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.

Usage

Setup

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

Compilation

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.

Execution

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.

Examples

Checkout the src/test/matter directory where you can find multiple small examples of how Matter apps can look like.

Issue

If something didn't work, you have two options:

  1. Ask for help on Gitter. I will be happy to assist you with any problems.
  2. Check if this problem is already reported on GitHub and if not, open a new issue.

Roadmap

  • 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

Contribution

See CONTRIBUTION.md

License

Apache License V2.0

For more information see LICENSE

Authors

First name or username followed by e-mail address in parenthesis, e.g.: hyronx (hyronx@outlook.com)

See AUTHORS