Programming language that compiles into Scratch blocks (SB3).

Overview

Claw

Hello, and welcome to my cool project! I've spent... at least a month on this, and it's still not finished! Feel free to check it out though. :D

Description

Claw is a programming language that compiles into Scratch blocks. Yeah, that Scratch. Some benefits from this include:

  • Better support for Git and version control
  • Static type system (UNFINISHED)
  • Readable complex logic
  • Easy real-time collaboration if your text editor supports it
  • Helpful error messages (UNFINISHED)
  • And more!

The current installation process requires you to clone the repository and build it from source. Once we start releasing versions, prebuilt binaries will be available.

$ git clone https://github.com/BD103/Claw.git
$ cd Claw
$ cargo build --release
$ cargo run --release -p claw_driver -- PATH/TO/file.claw

Contributing

Thanks for wanting to take some time to contribute! I haven't yet set up a system / guide for this, but feel free to crawl through the code. (Don't shudder, it shouldn't be that bad!) I've tried my best to document all of the items in these crates, even the private ones, so people don't get lost. I've started work on the developer wiki, but that is also unfinished. :)

Also, if you do decide to submit a PR, this is the legal bit:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Claw is licensed under either:

Comments
  • New parser

    New parser

    Closes #13.

    • [x] Comments are ignored everywhere
    • [x] Enums and function arguments are parsed, if not supported
    • [x] AST contains metadata like spans
    • [ ] Parser creates AST from a list of tokens, not the raw string
    c-parse t-feature p-high 
    opened by BD103 1
  • Abstract `claw_verify`

    Abstract `claw_verify`

    The claw_verify crate is currently a binary, meaning it can only be tested with integration tests. (Hence the tests/ folder.) This is a proposal that the logic be abstracted into a library. A binary will then use that library, so the same functionality is exposed.

    Library interface

    The claw_verify crate would export both schema and definition strings, as well as some form of the Sb3Resolver.

    It would also export a two functions, whose signatures would look like this:

    // Added for readability
    type VerifyResult = Result<(), Vec<ValidationError>>;
    
    pub fn verify_string(script: &str) -> VerifyResult;
    pub fn verify_value(script: serde_json::Value) -> VerifyResult;
    

    Binary interface

    The only thing that the binary will keep is load_file, some argument parsing, and error handling.

    c-verify t-feature p-low 
    opened by BD103 1
  • Rewrite everything

    Rewrite everything

    Woooo! This is a lot of stuff. Mainly this branch is me messing around without having to worry about CI checking my... unique code.

    Basically this branch represents me going through a bunch of design changes, and ending up with Chumsky and Ariadne. I'll probably squash and merge, given how many strange commits there are.

    c-driver c-parse c-sb3 t-feature p-high 
    opened by BD103 0
  • Fuzzing and benchmarking

    Fuzzing and benchmarking

    Claw is quite early in the development process, but eventually, I want to try using benchmarks and fuzzing the code. Criterion and cargo-fuzz look promising.

    p-low 
    opened by BD103 0
  • Re-enable MacOS and Windows CI

    Re-enable MacOS and Windows CI

    Due to the current pace of development, I disabled MacOS and Windows in the CI to increase build speed. Before 0.1.0 is released, this should be turned back on to make sure it compiles. :)

    https://github.com/BD103/Claw/blob/f4f137d8f47527613858f1b409c23d00adb2aae9/.github/workflows/ci.yml#L19

    p-low 
    opened by BD103 0
  • Rewrite parser

    Rewrite parser

    There are some issues with it, including:

    • Comments not accepted outside of main text
    • Does not support enums and function arguments
    • AST does not contain metadata (like spans) necessary for #12

    A rewrite is necessary. I propose converting from text to a Token enum, and then from that to AST.

    c-parse t-feature p-high 
    opened by BD103 0
  • Global error handling with Ariadne

    Global error handling with Ariadne

    Ariadne is a really nice crate for pretty error handling. It works hand-in-hand with Chumsky, which is our parser combinator in claw_parser. I would like to use it for all steps of the generation process, but it would require a few changes.

    claw_driver abstraction

    The driver would need to abstract core logic into a separate function that returns a Result<SB3, ariadne::Report>. This would allow all functions that it call to use the ? syntax for forwarding errors.

    It may also be a good idea to convert claw_driver to a library, then create a main claw binary crate like Rustc does.

    claw_parse AST with spans

    The AST would need to be updated to include spans of all items, so that claw_ir can generate Reports with this information. Other info may also need to be included.

    claw_ir returning Report

    The claw_ir crate is still in heavy development, but the main create_ir function (or whatever name we will be using) will need to return Result<IR, Report>.

    Optional: claw_verify using Report too

    If claw_verify used Report, it would make error handling a lot nicer. This would help fix lifetime issues that ValidationError has.

    c-driver c-parse c-verify t-feature p-medium c-ir 
    opened by BD103 0
  • Track compile times

    Track compile times

    claw_driver should include the ability to track how long it takes to compile a project, as well as how long each stage takes. This will be good for profiling to ensure speeds do not decrease. The Instant struct seems like a logical choice, though there may be other solutions.

    c-driver t-feature t-good-first-issue p-low 
    opened by BD103 0
  • v0.1.0 Tracking Issue

    v0.1.0 Tracking Issue

    • [x] #3
    • [ ] New parsing system
      • [ ] Lexer
      • [ ] Parser
      • [ ] Update MSRV to 1.65.0
    • [ ] Create intermediate representation for optimizations and easy transformation to schema
      • [ ] HIR
      • [ ] Query system
        • [ ] Optimizations setup
        • [ ] Error checking setup
    • [ ] Make standard library
      • [ ] Macro for generating enum
      • [ ] Actually put in all the blocks
      • [ ] Shared types for enums, type system, etc.
    • [ ] Convert schema to zip file in claw_driver
    • [x] Website
      • [x] Book
      • [x] Rustdoc

    Optional

    • [x] #6
    • [ ] Use Clap for CLI argument parsing
    • [ ] #10
    • [ ] ~#12~
    • [ ] READMEs filled out, example folder documented, Cargo.toml finalized
    p-high t-tracking 
    opened by BD103 0
Owner
BD103
An active programmer that loves Rust, Python, and NuxtJS. Has been coding for ~6 years. Currently designing a programming language.
BD103
An Interpreter for Brainfuck programming language implemented in the Rust programming language with zero dependencies.

Brainfuck Hello, Visitor! Hey there, welcome to my project showcase website! It's great to have you here. I hope you're ready to check out some awesom

Syed Vilayat Ali Rizvi 7 Mar 31, 2023
scan markdown files and execute `console` blocks

exec-commands − scan markdown files and execute console blocks exec-commands is a utility to update command-line-tool examples embedded in markdown fi

Hajime Suzuki 3 Nov 27, 2022
Rust crate for Ok-wrapping and try blocks

tryvial A small crate for Ok-wrapping and try blocks. This is compatible with Result, Option, and any type implementing the unstable std::ops::Try tra

null 11 Jan 25, 2023
A tool for collecting rollup blocks from the Aztec Connect rollup, and exporting them to csv

Aztec Connect Data Gobbler The Aztec Connect Data gobbler is a tool made for extracting data from the Aztec Connect system using only L1 as its source

Lasse Herskind 6 Feb 17, 2023
rehype plugin to use tree-sitter to highlight code in pre code blocks

rehype-tree-sitter rehype plugin to use tree-sitter to highlight code in <pre><code> blocks Contents What is this? When should I use this? Install Use

null 5 Jul 25, 2023
Building blocks for handling potentially unsafe statics.

Grounded Building blocks for handling potentially unsafe statics. This crate aims to provide useful and sound components that serve as building blocks

James Munns 3 Nov 28, 2023
*slaps roof of [programming language]* this bad boy can fit so much [syntax sugar] into it

An attempt to give myself a new Pareto-optimal choice for quick-and-dirty scripts, particularly when I'm not on a dev computer, and to practice writin

Brian Chen 985 Apr 25, 2023
Programming language made by me to learn other people how to make programming languages :3

Spectra programming language Programming language made for my tutorial videos (my youtube channel): Syntax Declaring a variable: var a = 3; Function

Adi Salimgereyev 3 Jul 25, 2023
A version control system implemented from scratch in Rust.

Version Control An experiment to write a version control system from scratch in Rust. CLI Usage Usage: revtool <COMMAND> Commands: init initia

Samuel Schlesinger 3 May 3, 2023
The Amp programming language: a language designed for building high performance systems.

A language designed for building high performance systems. Platform Support x86_64-pc-windows ✅ x86_64-unknown-linux ⚠️ untested x86_64-unknown-darwin

The Amp Programming Language 5 Mar 17, 2023
Nexa programming language. A language for game developers by a game developer

NexaLang Nexa programming language. A language for game developers by a game developer. Features High-Level: Nexa is an easy high level language Two M

Sabe 3 Aug 21, 2023
A Text User Interface library for the Rust programming language

Cursive Cursive is a TUI (Text User Interface) library for rust. It uses ncurses by default, but other backends are available. It allows you to build

Alexandre Bury 3.3k Jan 9, 2023
🎄My Advent of Code 2021 solutions in the Rust programming language

Advent of Code 2021 in Rust My Advent of Code 2021 solutions in the Rust programming language. This repository holds a separate Rust project for each

Tim Visée 227 Dec 16, 2022
Yfin is the Official package manager for the Y-flat programming language

Yfin is the Official package manager for the Y-flat programming language. Yfin allows the user to install, upgrade, and uninstall packages. It also allows a user to initialize a package with the Y-flat package structure and files automatically generated. In future, Yfin will also allow users to publish packages.

Jake Roggenbuck 0 Mar 3, 2022
A Text User Interface library for the Rust programming language

Cursive Cursive is a TUI (Text User Interface) library for rust. It uses ncurses by default, but other backends are available. It allows you to build

Alexandre Bury 3.3k Jan 3, 2023
Notes on learning the Rust programming language syntax.

notes-on-rust Notes on learning the Rust programming language syntax. Resources https://www.rust-lang.org/learn/get-started https://doc.rust-lang.org/

Fred Snyder 1 Jan 2, 2022
A clone of linux cal command, using rust programming language

CLI Calendar command What the project does This command was inspired by Linux Cal command that shows the current month calendar as output (by default)

Mohamed Djoudi Benarfa 2 Nov 16, 2022
A simple lexer which creates over 75 various tokens based on the rust programming language.

Documentation. This complete Lexer/Lexical Scanner produces tokens for a string or a file path entry. The output is a Vector for the user to handle ac

null 1 Nov 27, 2022
An embeddable dynamic programming language for Rust.

rune Visit the site ?? - Read the book ?? An embeddable dynamic programming language for Rust. Contributing If you want to help out, there should be a

The Rune Programming Language 1.1k Dec 27, 2022