Skip to content

guhhammer/glossa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Here’s a cleaned + crates.io-ready README.md version of your project (with correct crate usage, consistent naming, and no broken assumptions).


# 🌿 glossa-lang

A lightweight DSL toolkit for expressive function pipelines in Rust.

`glossa-lang` provides a macro-based system that enables pipeline-style composition using `>>`, combined with a string-literal-driven DSL inside `#[glossa]` functions.

It is designed for expressive functional pipelines and lightweight scripting-style Rust.

---

## ✨ Core Idea

glossa transforms two things:

1. Function pipelines (`>>`)
2. String literal DSL inside `#[glossa]`

into a unified expressive layer.

---

## πŸš€ Installation

```toml
[dependencies]
glossa-lang = "0.1"
use glossa_lang::prelude::*;

⚑ Example

use glossa_lang::prelude::*;

fn sum(a: u8, b: u8) -> u8 { a + b }
fn double(x: u8) -> u8 { x * 2 }

#[glossa]
fn main() {
    let result = "10,20" >> sum >> double;
    println!("{result}");

    "hello world";
}

🧡 String Literal DSL (Core Feature)

Inside #[glossa], standalone string literals become output instructions.


Default print

"hello world";
hello world

n: β†’ no newline print

"n:hello";
hello

e: β†’ stderr output

"e:failure";

f: β†’ formatted output

let x = 10;
"f:value = {x}";

! β†’ escape DSL parsing

"!raw output";

➑ bypasses DSL processing


⚑ Pipeline Syntax

Basic pipeline

"10,20" >> sum >> double;

Inline execution

"10,20" >> sum >> double >> print;

Partial application

"10,20" >> sum >> add(5) >> print;
"10,20" >> sum >> add(__, 5) >> print;

Closures in pipeline

"10,20" >> sum >> (|x| x * 2) >> print;

πŸ”§ Function Tools

Composition

let f = compose!(add(5), double);
println!("{}", f(10));

Pipeline builder

let f = pipe!(|a, b, c| sum2 >> double >> print);
f(10, 20, 30);

Reusable pipelines

let f = glossa_fn!(|x, y| add >> double >> print);
f(10, 20);

🧠 Design Philosophy

glossa-lang is:

  • macro-driven
  • expressive-first
  • flexible over strict typing
  • designed for DSL experimentation

It does NOT aim to replace Rust’s type system.


πŸ“ Structure

glossa/
β”œβ”€β”€ glossa/          core library (public crate)
β”œβ”€β”€ glossa-macro/    procedural macros
β”œβ”€β”€ tests/           integration tests
β”œβ”€β”€ docs/            showcase + docs

πŸ§ͺ Status

Experimental project β€” APIs may evolve.


πŸ“œ License

MIT


MIT License

Copyright (c) 2026

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


About

A lightweight Rust DSL for function pipelines, macro-based composition, and expressive functional syntax.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages