Freon โ€” The Language Workbench for the Web

๐Ÿ“ฆ NPM ยท ๐Ÿง  Docs ยท ๐Ÿ’ฌ Discussions

From documents to models
Freon is a language workbench that generates browser-based editors from your own domain-specific language (DSL).
It helps businesses capture knowledge in a structured way โ€” turning Word-style requirements into models that can be automated, stored, and reused.

  • โšก Easy to start: smart defaults and generators for common tasks.
  • ๐ŸŒ Runs in the browser: editors are instantly usable, no complex setup.
  • ๐Ÿงฉ Meta-languages for scope & typing: declare rules instead of hard-coding them.
  • ๐Ÿ”€ Hybrid approach: combines projectional editing with parsing for flexible, natural DSLs.

๐Ÿ“– Freon documentation
๐ŸŽฎ Sample DSLs


Which Repo Do You Need?

๐Ÿ’ก If your goal is to use Freon to build your own DSL, head over to the create-freon repository.
This repository (freon4dsl/freon4dsl) is for developing Freon itself โ€” its core framework, editor engine, and generators.


๐Ÿค Want to Contribute?

Weโ€™re always happy to welcome new contributors to the Freon project!

Whether youโ€™re fixing bugs, improving documentation, or adding new features โ€” your help makes a real difference.
If youโ€™d like to join in:

  1. Fork this repository
  2. Create a branch for your change
  3. Submit a pull request

Not sure where to start? Check our issues labeled good first issue, or reach out by opening a discussion.

๐Ÿ“˜ For full contribution guidelines, see CONTRIBUTING.md.

Letโ€™s build something great together!

Releases

  • August 1, 2025: Version 2.0.0-beta.2 released
  • May 13, 2025: Version 1.1.0-beta.3 released
    • Updated to Svelte 5 (was Svelte 4).
    • Performance improvements in generation.
    • Really fast hot reloading thanks to Vite.
  • May 13, 2025: IDE plugin version 0.0.4 released โ†’ see details here

What is Freon?

Freon is a TypeScript/JavaScript framework for creating and implementing projectional editors for DSLs that run natively in the browser.
Beyond the core framework, Freon includes generators for many parts of a DSLโ€™s working environment.


Developing Freon

If you want to work on the Freon framework itself:

Prerequisites

We typically use the latest versions, although older versions may work as well.

For more background on Freonโ€™s internal structure and build process, check out the developer-documentation folder.
It includes technical notes and guidelines for maintainers and advanced contributors.

Build and Test

git clone https://github.com/freon4dsl/freon4dsl.git
cd Freon4dsl
npm install
npm run build
npm run test

Running the Web App Editor

You can try Freon with one of the sample languages.

1. Build the language

cd packages/samples/<your-sample>
npm run build

2. Configure the web app

Edit packages/webapp-flowbite/package.json:

"dependencies": {
"@freon4dsl/<your-sample>": "2.0.0"
}

Edit packages/webapp-flowbite/src/starter.ts:

import { LanguageEnvironment } from "@freon4dsl/<your-sample>";

3. Start the server

cd packages/server
npm run start

The server runs continuously in the background, so open another terminal to start the web app.

4. Run the web app

cd packages/webapp-flowbite
npm run styles
npm run dev

โžก๏ธ Open the URL shown in your terminal (e.g. http://localhost:<port>/).
This will display the example language editor in your browser.


Source Organization

The codebase is organized into multiple packages:

  • packages/core โ€“ main framework
    • src/editor โ†’ editor framework
    • src/language/decorators โ†’ MobX decorators
  • packages/core-svelte โ€“ HTML & CSS integration
  • packages/meta โ€“ DSL definition & code generation
    • languagedef โ†’ generates code from *.ast files (abstract syntax trees)
    • editordef โ†’ generates code from *.edit files (editor definitions)
    • scoperdef โ†’ generates code from *.scope files (scoping rules)
    • typerdef โ†’ generates code from *.type files (typing rules)
    • validatordef โ†’ generates code from *.valid files (validators)
  • packages/samples โ€“ example DSLs
  • packages/server โ€“ minimal demo model server
  • packages/weblib-*` โ€“ shared web libraries
  • packages/webapp-flowbite โ€“ current demo web app using Flowbite-Svelte
  • packages/webapp-smui โ€“ older demo web app using Svelte Material UI (SMUI)
  • developer-documentation โ€“ technical information for contributors and maintainers
    • Explains architecture, build setup, generators, and API internals

We build Freon and its documentation out of curiosity, passion, and love for language engineering. We invite you to share that enthusiasm and help make something meaningful โ€” together. โค๏ธ

Top categories

Loading Svelte Themes