Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
Notable Updates:

1. Semantic Analysis Framework

   - On-demand arbitrary incremental computations over syntax trees.
   - Attribute grammars with custom inference functions.
   - Document-wide indices.
   - Multi-threaded concurrent analysis.

2. Lexis and Syntax Parsing Enhancements

   - Custom recursive-descent parsers with unlimited lookahead and left recursion.
   - Trivia rules for comments and whitespaces.
   - Error-recovery customizations.
   - Negative expressions in the syntax parser: `^[$A | $B | ...]`.
   - Unicode classes in regexes: `$upper`, `$num`, etc.
   - Grammar debugging features, including a step-by-step parser debugger.
   - Significant performance improvements in Lexis and Syntax parsing.

3. Document Inspection Improvements

   - Tree traversal from nodes to children and from nodes to parents.
   - Depth-first tree traversal.
   - Syntax-independent (generic) tree queries: `node_ref.get_child(doc, "child")`.
   - Node sibling queries directly from NodeRef.
   - Document line index maintenance, allowing line content queries by line number.
   - Removal of Clusters API for simplicity.
   - Various debugging features added: functions to display syntax trees and code content.

4. Source Code Formatting.

   - Framework for implementing source code formatter programs.
   - Printing source code with annotated snippets and syntax highlighting to the terminal.

5. User Guide and Showcase Examples.

   - Comprehensive user guide and showcase examples provided.

The full history of changes is available in the "develop" branch:

https://github.com/Eliah-Lakhin/lady-deirdre/commits/develop/?before=1f71eafe70ef3913999985c352131b0739552155+35

License Agreement Updated:

The new agreement introduces a flat model for the commercial use of Lady Deirdre,
replacing the previous royalty-based model. To develop a commercial product without
revenue restrictions, you should acquire an Unrestricted Commercial License.

This license allows perpetual use of Lady Deirdre in commercial products.
To continue receiving future upgrades and updates, license renewal is required.

The rest of the terms remain largely similar to the previous version but clarify
some legal nuances more accurately.
  • Loading branch information
Eliah-Lakhin committed Jun 19, 2024
2 parents ef66348 + 1f71eaf commit 1f4ecda
Show file tree
Hide file tree
Showing 284 changed files with 52,243 additions and 25,303 deletions.
19 changes: 0 additions & 19 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/deploy-user-guide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy User Guide

on:
push:
paths: [ "work/book/**" ]
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
run: |
mkdir book
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./book
echo `pwd`/book >> $GITHUB_PATH
- name: Deploy
run: |
cd work/book
mdbook build
git worktree add gh-pages
git config user.name "deploy-user-guide"
git config user.email ""
cd gh-pages
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../output/* .
echo "lady-deirdre.lakhin.com" > CNAME
git add .
git commit -m "Deploy User Guide $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
504 changes: 293 additions & 211 deletions EULA.md

Large diffs are not rendered by default.

213 changes: 172 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,187 @@
# Lady Deirdre.
<!------------------------------------------------------------------------------
This file is a part of the "Lady Deirdre" work,
a compiler front-end foundation technology.
[![Lady Deirdre Main Crate API Docs](https://img.shields.io/docsrs/lady-deirdre?label=Main%20Docs)](https://docs.rs/lady-deirdre)
[![Lady Deirdre Macro Crate API Docs](https://img.shields.io/docsrs/lady-deirdre-derive?label=Macro%20Docs)](https://docs.rs/lady-deirdre-derive)
[![Lady Deirdre Main Crate](https://img.shields.io/crates/v/lady-deirdre?label=Main%20Crate)](https://crates.io/crates/lady-deirdre)
[![Lady Deirdre Macro Crate](https://img.shields.io/crates/v/lady-deirdre-derive?label=Macro%20Crate)](https://crates.io/crates/lady-deirdre-derive)
This work is proprietary software with source-available code.
Compiler front-end foundation technology.
To copy, use, distribute, and contribute to this work, you must agree to
the terms of the General License Agreement:
If you want to create your own programming language with IDE support from
day one, or if you are going to develop new IDE from scratch, or a programming
language LSP plugin, this Technology is for you!
https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/EULA.md.
Lady Deirdre provides a framework to develop Lexical Scanner, Syntax Parser and
Semantic Analyzer that could work in live coding environment applying
user-input changes incrementally to all underlying data structures.
The agreement grants you a Commercial-Limited License that gives you
the right to use my work in non-commercial and limited commercial products
with a total gross revenue cap. To remove this commercial limit for one of
your products, you must acquire an Unrestricted Commercial License.
This Technology represents a set of essential instruments to develop modern
programming language compilers with seamless IDE integration.
If you contribute to the source code, documentation, or related materials
of this work, you must assign these changes to me. Contributions are
governed by the "Derivative Work" section of the General License
Agreement.
**Features**:
Copying the work in parts is strictly forbidden, except as permitted under
the terms of the General License Agreement.
- Written in Rust entirely.
- Derive-macros to define PL Grammar directly on Enum types.
- Smart error recovery system out of the box.
- Dependency-free no-std ready API.
- Works faster than Tree Sitter.
If you do not or cannot agree to the terms of this Agreement,
do not use this work.
**Links:**
- [Main Crate API Documentation](https://docs.rs/lady-deirdre).
- [Macro Crate API Documentation](https://docs.rs/lady-deirdre-derive).
- [Repository](https://github.com/Eliah-Lakhin/lady-deirdre).
- [Examples, Tests, Benchmarks](https://github.com/Eliah-Lakhin/lady-deirdre/tree/master/work/crates/examples).
- [End User License Agreement](https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/EULA.md).
This work is provided "as is" without any warranties, express or implied,
except to the extent that such disclaimers are held to be legally invalid.
**This Work is a proprietary software with source available code.**
Copyright (c) 2024 Ilya Lakhin (Илья Александрович Лахин).
All rights reserved.
------------------------------------------------------------------------------->

To copy, use, distribute, and contribute into this Work you must agree to
the terms of the [End User License Agreement](https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/EULA.md).
# Lady Deirdre

The Agreement let you use this Work in commercial and non-commercial purposes.
Commercial use of the Work is free of charge to start, but the Agreement
obligates you to pay me royalties under certain conditions.
<img style="float: left; margin-right: 10px; width: 160px" alt="Lady Deirdre Logo" src="https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/work/logo.jpg" />

If you want to contribute into the source code of this Work, the Agreement
obligates you to assign me all exclusive rights to the Derivative Work made by
you (this includes GitHub forks and pull requests to my repository).
[![Crate](https://img.shields.io/crates/v/lady-deirdre?label=Crate)](https://crates.io/crates/lady-deirdre)
[![API Docs](https://img.shields.io/docsrs/lady-deirdre?label=API%20Docs)](https://docs.rs/lady-deirdre)
[![User Guide](https://img.shields.io/badge/User_Guide-passing-default)](https://lady-deirdre.lakhin.com/)
[![Examples](https://img.shields.io/badge/Examples-passing-default)](https://github.com/Eliah-Lakhin/lady-deirdre/tree/master/work/crates/examples)

The Agreement does not limit rights of the third party software developers as
long as the third party software uses public API of this Work only, and the
third party software does not incorporate or distribute this Work directly.
Lady Deirdre is a framework for incremental programming language compilers,
interpreters, and source code analyzers.

If you do not or cannot agree to the terms of this Agreement, do not use
this Work.
This framework helps you develop a hybrid program that acts as a language
compiler or interpreter and as a language server for a code editor's language
extension. It offers the necessary components to create an in-memory
representation of language files, including the source code, their lexis and
syntax, and the semantic model of the entire codebase. These components are
specifically designed to keep the in-memory representation in sync with file
changes as the codebase continuously evolves in real time.

Copyright (c) 2022 Ilya Lakhin (Илья Александрович Лахин). All rights reserved.
Lady Deirdre is the perfect tool if you want to start a new programming language
project.

## Key Features

- **Parser Generator Using Macros**.

Lexical and syntax grammar of the language are specified using derive macros
on enum types, where the enum variants represent individual tokens and nodes
with parsing rules.

- **Hand-Written Parsers**.

The API enables the development of hand-written recursive-descent parsers with
unlimited lookahead and their seamless integration with macro-generated parsers.

- **Error Resilience**.

The resulting parser will be error-resistant and capable of building a syntax
tree from incomplete source code.

- **Semantics Analysis Framework**.

Lady Deirdre includes a built-in semantic analyzer that manages arbitrary
on-demand computations on the syntax trees in terms of referential attributes.

- **Incremental Compilation**.

These components continuously patch the in-memory representation of the
codebase structures in response to the end user's incremental edits of the
file texts. Processing of the changes is typically fast, even in large
codebases.

- **Parallel Computations**.

The API is specifically designed for both multi-threaded and single-threaded
programs, according to your discretion.

- **Web-Assembly Compatibility**.

This crate is compatible with wasm-targets and the browser environment in
particular.

- **Source Code Formatters**.

Lady Deirdre includes tools to develop code formatter programs that take into
account code comments and blank lines.

- **Annotated Snippets**.

The framework provides a configurable API to print source code snippets with
syntax highlighting and annotations to the terminal, intended to display
syntax and semantic errors in the codebase.

- **Self-Sufficient API**.

The crate offers a self-sufficient, extendable, and highly configurable API
for developing the front-end part of programming language compilers and code
editor language extensions. As a foundation technology, Lady Deirdre does not
have any third-party dependencies except for the Rust standard library and
the macros crate.

## Performance

Lady Deirdre aims to provide development infrastructure with acceptable
computational performance suitable for production use.

The crate's API demonstrates solid benchmark test results, comparing individual
features of the framework with specialized solutions from the Rust ecosystem.

For detailed information, refer to the [Benchmarks page](https://github.com/Eliah-Lakhin/lady-deirdre/tree/master/work/crates/tests).

## Links

- [Source Code](https://github.com/Eliah-Lakhin/lady-deirdre)
- [Main Crate](https://crates.io/crates/lady-deirdre)
- [API Documentation](https://docs.rs/lady-deirdre)
- [User Guide](https://lady-deirdre.lakhin.com/)
- [Examples](https://github.com/Eliah-Lakhin/lady-deirdre/tree/master/work/crates/examples)
- [License Agreement](https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/EULA.md)

## Copyright

This work is proprietary software with source-available code.

To copy, use, distribute, and contribute to this work, you must agree to the
terms and conditions of the [General License Agreement](https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/EULA.md).

Copyright (c) 2024 Ilya Lakhin (Илья Александрович Лахин). All rights reserved.

### Can I use your work in my free software project?

Yes, absolutely. I would be happy to assist with your project and hear your
feedback to improve Lady Deirdre.

The agreement automatically grants you a license to develop free software
projects based on Lady Deirdre.

### May I contribute to your project?

I welcome contributions to my project. If you find a bug or have a new feature
suggestion, you can open a pull request in my GitHub repository.

Please be aware that my work is proprietary software. The agreement requires you
to automatically assign me the changes you make to my project's source code.

However, if you want to create an extension for my crate, you can develop a
separate crate that uses my crate's public APIs through Cargo. In this case, you
don't have to assign me your work, and you can distribute your project under any
permissive free software license, such as the MIT license.

I deliberately keep my crate's APIs extendable for third-party authors who want
to create dedicated Lady Deirdre extensions.

### Can I develop commercial software products?

Yes, you can develop commercial software based on Lady Deirdre.

The agreement grants you a Commercial-Limited License, allowing you to use my
work in commercial products, both open-source and closed-source.

This license restricts the total gross revenue you can earn using software
products based on Lady Deirdre. Once your product exceeds this limitation, you
can purchase the annual Unrestricted Commercial License on my Patreon
page, which removes these restrictions.

### What happens when the Unrestricted Commercial License expires?

You should renew the license to continue using new versions and upgrades of
Lady Deirdre.

If you do not renew the license, you can keep using the version you have at the
time of expiration in your software product perpetually.
42 changes: 20 additions & 22 deletions work/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
################################################################################
# This file is a part of the "Lady Deirdre" Work, #
# This file is a part of the "Lady Deirdre" work, #
# a compiler front-end foundation technology. #
# #
# This Work is a proprietary software with source available code. #
# This work is proprietary software with source-available code. #
# #
# To copy, use, distribute, and contribute into this Work you must agree to #
# the terms of the End User License Agreement: #
# To copy, use, distribute, and contribute to this work, you must agree to #
# the terms of the General License Agreement: #
# #
# https://github.com/Eliah-Lakhin/lady-deirdre/blob/master/EULA.md. #
# #
# The Agreement let you use this Work in commercial and non-commercial #
# purposes. Commercial use of the Work is free of charge to start, #
# but the Agreement obligates you to pay me royalties #
# under certain conditions. #
# The agreement grants you a Commercial-Limited License that gives you #
# the right to use my work in non-commercial and limited commercial products #
# with a total gross revenue cap. To remove this commercial limit for one of #
# your products, you must acquire an Unrestricted Commercial License. #
# #
# If you want to contribute into the source code of this Work, #
# the Agreement obligates you to assign me all exclusive rights to #
# the Derivative Work or contribution made by you #
# (this includes GitHub forks and pull requests to my repository). #
# If you contribute to the source code, documentation, or related materials #
# of this work, you must assign these changes to me. Contributions are #
# governed by the "Derivative Work" section of the General License #
# Agreement. #
# #
# The Agreement does not limit rights of the third party software developers #
# as long as the third party software uses public API of this Work only, #
# and the third party software does not incorporate or distribute #
# this Work directly. #
# #
# AS FAR AS THE LAW ALLOWS, THIS SOFTWARE COMES AS IS, WITHOUT ANY WARRANTY #
# OR CONDITION, AND I WILL NOT BE LIABLE TO ANYONE FOR ANY DAMAGES #
# RELATED TO THIS SOFTWARE, UNDER ANY KIND OF LEGAL CLAIM. #
# Copying the work in parts is strictly forbidden, except as permitted under #
# the terms of the General License Agreement. #
# #
# If you do not or cannot agree to the terms of this Agreement, #
# do not use this Work. #
# do not use this work. #
# #
# This work is provided "as is" without any warranties, express or implied, #
# except to the extent that such disclaimers are held to be legally invalid. #
# #
# Copyright (c) 2022 Ilya Lakhin (Илья Александрович Лахин). #
# Copyright (c) 2024 Ilya Lakhin (Илья Александрович Лахин). #
# All rights reserved. #
################################################################################

[workspace]
resolver = "2"
members = ["crates/*"]
Loading

0 comments on commit 1f4ecda

Please sign in to comment.