Skip to content

Bre4dGC/bread-crumbs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bread Crumbs

BreadCrumbs Logo

Bread Crumbs is a modern programming language designed for testing, simulations, scientific computing, AI planning, and rapid prototyping. With its unique features like declarative problem-solving (solve), scenario simulation (simulate), state management (snapshot/rollback), and execution tracing (trace), Bread Crumbs empowers developers to tackle complex problems with ease.

Features

  • Declarative Programming: Use solve to define constraints and let the language find solutions.
    solve (x: int) {
        where x * x == 16
    }
    print(x) // Outputs: 4 or -4
    
  • Simulation: Simulate scenarios with simulate and manage state with snapshot/rollback.
    snapshot state
    simulate scenarios {
        timeline test {
            x += 1
            if (error) { rollback state }
        }
    }
    
  • Build-in Testing and Fork the branches
    test find_numbers {
        solve (x, y: int) {
            where x + y == 10, x * y == 21
        }
    
        assert(x + y == 10)
        assert(x * y == 21)
    
        fork scenarios {
            branch positive {
                assert(x > 0 && y > 0)
                print("Positive solution: x = {x}, y = {y}")
            }
            branch negative {
                assert(x < 0 || y < 0)
                print(f"Negative solution: x = {x}, y = {y}")
            }
        }
    }
    
    run find_numbers
    
  • Tracing: Debug and analyze with trace for transparent execution.

Installation

  1. Clone the Repository:

    git clone https://github.com/Bre4dGC/bread-crumbs.git
    cd bread-crumbs
  2. Build from Source:

    make
    sudo make install
  3. Verify Installation:

    crumbs --version

Getting Started

Try this simple example to explore Bread Crumbs:

var numbers: list<int> = [1, 2, 3]
print(numbers) // Outputs: [1, 2, 3]

snapshot state
numbers.push(4)
print(numbers) // Outputs: [1, 2, 3, 4]
rollback state
print(numbers) // Outputs: [1, 2, 3]

For more examples, check the documentation.

Contributing

We welcome contributions! Here's how to get involved:

  1. Fork the repository.
  2. Create a branch: git checkout -b my-feature.
  3. Commit your changes: git commit -m "Add my feature".
  4. Push to the branch: git push origin my-feature.
  5. Open a pull request.

Please read our Contributing Guidelines for details.

Community

Join our community to discuss Bread Crumbs, share ideas, and get help:

License

Bread Crumbs is licensed under the MIT License.

About

Modern Programming Language [currently in development]

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published