Miksilo is a language workbench, which is a tool to construct programming languages. Miksilo, whose name comes from the Esperanto word for mixer, lets you create languages quickly by mixing existing languages and building on top of them. Language construction is notoriously hard, and these days involves not just writing a compiler or interpreter, but also editor tooling to provide features such as code completion, inline errors and code navigation. Miksilo takes a declarative language definition and from that generates all the tools expected of a modern language. To learn how to use Miksilo to generate editor tooling, visit this page.
To consume the Miksilo library, add a dependency to either the ModularLanguages or the LanguageServer library. Using the ModularLanguages library allows you to re-use language definitions of existing languages, but a downside is that it uses its own datatype for representing the abstract syntax tree, which makes it harder to integrate with existing AST types you may have for your language.
Using the ModularLanguages library is recommended when:
- Your language syntactically looks like an existing language, for example it's a configuration language based on JSON or YAML.
- Your language is turing complete and has features that commonly occur in languages such as expressions or statements.
The LanguageServer library does not enable modular language definition, but it can integrate directly with an existing language definition if you already have one. Using this is recommended when:
- You already have type definitions for your language
- Your language has custom syntax and doesn't contain any typical language features, an example could be a small configuration language with very custom syntax.
- Grab the source from GitHub
- Make sure you have installed the Java 8 JDK, or a higher version.
- Install Mill
- Call 'mill playground.run' in the project root to build Miksilo and start the sandbox desktop application.
This repository is divided into the following sub-projects:
- EditorParser: Defines a parser API that can be used to create parsers suitable for use in text editors.
- LSPProtocol: Defines the communication layers of an LSP client and an LSP server.
- LanguageServer: Enables starting an LSP server from a language definition. Consume this library if you already have a codebase that defines your language and you want to create a language server for it.
- ModularLanguages: Defines various tools for defining languages in a modular way. Comes with many predefined language building blocks. Consume this library if you're writing a language from scratch.
- Playground: A desktop UI application that enables constructing languages on-the-fly by combining predefined languages blocks using drag and drop. This application is for educational purposes.
We would love your contributions. Here are some ideas for new topics to work on:
- A DSL for static semantics, such as name binding and type checking. See the paper A constraint language for static semantic analysis based on scope graphs for inspiration
- Generating syntactic code completion from a grammar, as in the paper Principled syntactic code completion using placeholders
- Incremental compilation: incremental parsing, incremental type checking, etc.
- Add a new language front-end or back-end.
If you would like to contribute then:
- Reach out on the Gitter, so other contributors can help you out where the documentation is lacking.
- Look through the open issues to see if you find something interesting
- Enjoy the work ;-)
- Once you're done, submit a pull request and make sure the build server approves it.