Eclipse Fastbelt
Eclipse Fastbelt is a toolkit for implementing domain-specific languages (DSLs) and other formal languages in Go. It is built for high performance on large workspaces and large files.
A DSL lets domain experts describe data, rules, or behavior in a concise text notation that software can check and process automatically. Users of such a language expect the same editor support as for programming languages: code completion, navigation, and immediate error feedback. This becomes hard to deliver when a workspace holds thousands of files or single files of several megabytes. Language tooling then tends to become slow and memory-hungry, and the responsiveness of editors starts to suffer dramatically.
Eclipse Fastbelt addresses this in its architecture: Language primitives such as tokens, AST nodes and cross-references are implemented using techniques that prevent costly memory allocations. Additionally, parsing, reference resolution, and validation run in parallel on multiple CPU cores, based on thread-safe data structures. Together, this ensures that Fastbelt is utilizing the available hardware as much as possible. In benchmarks, workspace builds are up to two orders of magnitude faster than with comparable frameworks.
The starting point of a Fastbelt project is a grammar definition, similar to Eclipse Xtext and Eclipse Langium. It describes the text syntax of the language together with the structure of the resulting abstract syntax tree (AST). From the grammar, Fastbelt generates Go code for the lexer, the parser, the AST types, and the resolution of cross-references between language elements, also across files. Language-specific behavior such as validation rules, scoping, interpreters, or code generators is added in plain Go code.
Fastbelt includes a language server based on the Language Server Protocol (LSP) with default implementations of code completion, go to definition, find references, hover, outline, workspace symbols, and folding. This makes a language available in Eclipse Theia, VS Code, and any other LSP-capable editor. The same language implementation can also be used as a library, e.g. in command-line tools and automation services.
Eclipse Fastbelt complements Eclipse Langium, which remains the first choice for most DSL projects and for web-based tools in the TypeScript ecosystem. Fastbelt is intended for cases where scale and performance are the central challenge.
- Read more about Eclipse Fastbelt
- Log in to post comments