Skip to content
Kyle Brown edited this page Apr 26, 2020 · 5 revisions

What is Ladle?

Ladle is a system for specifying grammars and other syntax related information. It does so using a set of formats for specifying lexing, parsing, styling, formatting, and related meta-data. These formats combine TOML-style meta-data and rules using/based on things like regex and BNF/EBNF/ABNF.

Goals / Principles

External Syntax Definitions

The design of the tokens, grammar, and other syntactic information should be separate from code. This decouples Ladle from any specific platform, programming language, or environment and allows tooling to be made for all of them. These new tools, and any existing tools made compatible, can be used with any language that has a Ladle specification providing a way for language designers and toolmakers to provide incredible value to each other.

Explicit Configuration

All features which are not absolutely fundamental to the operation of Ladle must be explicitly enabled/configured. This means that users of Ladle can opt-out of features that they do not need and in the future, modes of operation incompatible with existing features can be created. Additionally, explicitness has the benefit of preventing hidden default settings and strange interactions between implicit information and behaviors.

Formal Methods and Terminology

Ladle will use appropriate formal terminology for identifying components, behaviors, features, and algorithms so that the Ladle behavior is well-defined, performant, intuitive for experienced people, and consistent with existing literature to assist new-comers.

Information Preserving (losslessness)

The formats used to pass text to lexers, tokens to parsers, and trees to end consumers must not lose any important data needed by downstream consumers. Namely, this means that it must preserve the relationship between token streams/trees and the input text, and the identification of all lexical units and their place in the syntax (e.g. comments and whitespace).

This allows the ecosystem to be expanded to encompass a wide variety of future scopes and needs. It does not mean that formats cannot exist to specify things like an Abstract Syntax Tree, which disregards tokens like whitespace, and grammatical information like parenthesis. It does, however, mean that the initial lexer and parser must be capable of representing the syntax completely and that AST trimming/reduction must come after.

Full Unicode Support

TODO

Ladle Ecosystem

The Ladle ecosystem will be made up of various tools for creating, managing, and using Ladle specifications. Some of them will be made by core-team developers and others by members of our community.

Core Components

Ladle CLI

Ladle Repository

Community-Driven Components

Language Developer Tooling

When Ladle is fully specified, it will be easy to create tooling that helps users write, explore, and test Ladle based programming language specifications. This will greatly improve the user experience of language developers and students learning/practicing programming language concepts.

Language User Tooling

The development of Ladle will enable the creation of extensions to existing IDEs that are able to support any language that has been described in Ladle. These extensions can contain rich features for new or low-support languages from the get-go without writing any code.

Compiler Development

The Ladle ecosystem can provide strong tools for people developing compilers for new or existing languages. This will have limitations as custom code often comes into the picture when writing compilers, but it will, at a minimum, provide a solid foundation for new-comers and small projects.