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
  • 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-schema t-feature p-high 
    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
    • [ ] Create intermediate representation for optimizations and easy transformation to schema
      • [ ] HIR
      • [x] Query system
        • [ ] Optimizations setup
        • [ ] Error checking setup
    • [ ] Make standard library
      • [x] 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

    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
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.1k Sep 21, 2022
🎄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 192 Sep 18, 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.1k Sep 26, 2022
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 1 Feb 10, 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 0 May 1, 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 1k Sep 25, 2022
Idiomatic inotify wrapper for the Rust programming language

inotify-rs Idiomatic inotify wrapper for the Rust programming language. extern crate inotify; use std::env; use inotify::{ EventMask, Watch

Hanno Braun 217 Sep 13, 2022
Object Notation Programming Language?

You may have questions ONLang - Object Notation Language (jsON) VSCode extension - OnLang 1. God, what the f**** is this ONLang is an experimental, es

Artemy Egorov 7 Aug 29, 2022
Turn static CLI commands into TUIs with ease

lazycli Turn static CLI commands into TUIs with ease Demo: Usage Pick a command that spits out either a list or table of content, like ls, docker ps,

Jesse Duffield 242 Sep 26, 2022
📜🔁🎶 A CLI which converts morse code into sound

morse2sound ?? A CLI which converts morse code to sound Big shoutout to Br1ght0ne for guiding me how to use Rust on stream

Ilya Revenko 13 May 9, 2022
parse command-line arguments into a hashmap and vec of positional args

parse command-line arguments into a hashmap and vec of positional args This library doesn't populate custom structs, format help messages, or convert types.

James Halliday 17 Aug 11, 2022
decode a byte stream of varint length-encoded messages into a stream of chunks

length-prefixed-stream decode a byte stream of varint length-encoded messages into a stream of chunks This crate is similar to and compatible with the

James Halliday 4 Feb 26, 2022
Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages.

Turbine Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages. It’s described as a to

Justin 2 Jan 21, 2022
Vim plugin to quickly parse strings into arrays.

butcher Vim plugin to quickly parse strings into arrays. It is painful to write arrays in any programming language, so butcher makes it easy for you.

null 5 Dec 31, 2021
Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and at compile-time.

rgb2ansi256 rgb2ansi256 is a small Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and const fn. Th

Linda_pp 6 May 17, 2022
A tool for transposing harmonica tabs into different positions and tunings

A tool for transposing harmonica tabs into different positions and tunings

null 12 Jun 9, 2022
🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one

❯ Cosmo Git tooling of the future New feature: Cosmo hooks! Click here for more info! ❯ ?? Features Config files (with defaults!) Fast Easy to use Fri

Jack 1 Oct 31, 2021