From ffa59231b86ddf8c3ecf353e6188d6ae84aa83c9 Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 13:07:43 +0100 Subject: [PATCH 1/8] initial basic setup with readme --- .gitignore | 1 + Cargo.lock | 7 +++++ Cargo.toml | 16 ++++++++++++ Makefile | 28 ++++++++++++++++++++ README.md | 68 +++++++++++++++++++++++++++++++++++++------------ ast/.gitkeep | 0 ast/Cargo.toml | 8 ++++++ ast/src/lib.rs | 14 ++++++++++ logo.jpg | Bin 0 -> 11816 bytes 9 files changed, 126 insertions(+), 16 deletions(-) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 Makefile delete mode 100644 ast/.gitkeep create mode 100644 ast/Cargo.toml create mode 100644 ast/src/lib.rs create mode 100644 logo.jpg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..265b512 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ast" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..88cdd43 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,16 @@ +[workspace] +resolver = "2" + +members = ["ast"] + +[profile.release] +lto = true +codegen-units = 1 + +# Set the settings for build scripts and proc-macros. +[profile.dev.build-override] +opt-level = 3 + +# On dev optimize dependencies a bit so it's not as slow. +[profile.dev.package."*"] +opt-level = 1 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8210b9f --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +.PHONY: build check clean + +UNAME := $(shell uname) + +check-deps: +ifeq (, $(shell which cargo)) + $(error "The cargo command could not be found in your PATH, please install Rust: https://www.rust-lang.org/tools/install") +endif +ifndef LLVM_SYS_170_PREFIX + $(error Could not find a suitable LLVM 17 toolchain, please set LLVM_SYS_170_PREFIX env pointing to the LLVM 17 dir) +endif +ifndef MLIR_SYS_170_PREFIX + $(error Could not find a suitable LLVM 17 toolchain (mlir), please set MLIR_SYS_170_PREFIX env pointing to the LLVM 17 dir) +endif +ifndef TABLEGEN_170_PREFIX + $(error Could not find a suitable LLVM 17 toolchain (tablegen), please set TABLEGEN_170_PREFIX env pointing to the LLVM 17 dir) +endif + @echo "[make] LLVM is correctly set at $(MLIR_SYS_170_PREFIX)." + +build: check-deps + cargo build --workspace --release --all-features + +check: check-deps + cargo fmt --all -- --check + cargo clippy --workspace --all-targets --all-features -- -D warnings + +clean: + cargo clean diff --git a/README.md b/README.md index 0e027c4..46bcd89 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,54 @@ +
+ + + # The Concrete Programming Language [![Telegram Chat][tg-badge]][tg-url] +[![license](https://img.shields.io/github/license/lambdaclass/concrete)](/LICENSE) [tg-badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fconcrete_proglang%2F&logo=telegram&label=chat&color=neon [tg-url]: https://t.me/concrete_proglang Concrete is a simple programming language specifically crafted for creating highly scalable systems that are reliable, efficient, and easy to maintain. -Concrete is a programming language designed to integrate Rust's safety and speed with the concurrency model of Erlang and Go while being a small, simple language like Zig. It achieves this while avoiding Rust's verbosity and Go's limited syntax and feature set. +Designed to integrate Rust's safety and speed with the concurrency model of Erlang and Go while being a small, simple language like Zig. It achieves this while avoiding Rust's verbosity and Go's limited syntax and feature set. Writing good code should be easy. The language must be simple enough to fit in a single person’s head. Programs are about transforming data into other forms of data. Code is about expressing algorithms, not the type system. We aim to develop a simpler version of Rust that includes an optional default runtime featuring green threads and a preemptive scheduler, similar to those found in Go and Erlang. +
+ + +## Table of Contents + +- [Design](#design) +- - [Core Features](#core-features) +- - - [Second Level Features](#second-level-features) +- - [Anti Features](#anti-features) +- - [Features that are being debated](#features-that-are-being-debated) +- [Syntax](#syntax) +- [Inspirations](#inspiration) + +## Installing from Source + +Building is as simple as cloning this repository and running the `make build` command, provided you have all the needed dependencies. + +### Dependencies + +Make sure you have installed the dependencies: + +- git +- Rust +- LLVM 17 with MLIR enabled + +If building LLVM from source, you'll need additional tools: +- g++, clang++, or MSVC with versions listed on [LLVM's documentation](https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library) +- ninja, or GNU make 3.81 or later (Ninja is recommended, especially on Windows) +- cmake 3.13.4 or later +- libstdc++-static may be required on some Linux distributions such as Fedora and Ubuntu + ## Design -Programs are about transforming data into other forms of data. Code is about expressing algorithms, not the type system. +Programs are about transforming data into other forms of data. Code is about expressing algorithms, not the type system. ### Core features - C/Go/Rust-inspired, context-free small grammar, syntax: if, for, function calls, modules, pattern matching - Safe. Linear types that allow memory and other resources to be managed safely and without runtime overhead @@ -66,8 +102,8 @@ Programs are about transforming data into other forms of data. Code is about exp ``` // this is a single line comment -/* -this is a +/* +this is a multi line comment */ @@ -85,7 +121,7 @@ mod ModuleName { field1: u8 field2: bool } - + enum MyEnum{ Variant0, TupleVariant(bool), @@ -93,17 +129,17 @@ mod ModuleName { field1: u16, }, } - + pub fn main() { - const + const let v1: u8; // variable declaration v1 = 42; let v2 = my_function(); } - + fn my_function() { } - + fn my_function2() -> u8 { 42 } @@ -117,8 +153,8 @@ mod ModuleName { ### Fibonacci ``` -mod FibonacciModule { - +mod FibonacciModule { + pub fib(x: u64) -> u64 { match x { // we can match literal values @@ -137,7 +173,7 @@ let add1: (i8 -> i8) = (x: i8) -> x + 1; mod FactorialModule { // unsigned integer types: u8, u16,... // signed integer types: i8, i16, ... - pub fn factorial(x: u64) -> u64 { + pub fn factorial(x: u64) -> u64 { // match is an expression, so it returns // the value of its evaluation match x { @@ -155,7 +191,7 @@ mod Sum { /// Returns the sum of a vector of numbers. fn sum(x: [i8]) -> i8 { x.reduce(0, (x: i8, y: i8) -> x + y) - } + } } ``` @@ -167,7 +203,7 @@ mod Option { None, Some(T), } - + pub fn map(opt: Option, f: A -> B) -> Option { match opt { None -> None, @@ -178,7 +214,7 @@ mod Option { mod UsesOption { import MyOption.{Option, map}; - + pub fn headOfVectorPlus1(x: [u8]) -> Option { // head returns an option x.head().map((x: u8) -> x + 1) @@ -194,7 +230,7 @@ The design will be heavily influenced by all this programming langauges. We want - [Vale](https://vale.dev/) - [Austral](https://austral-lang.org/spec/spec.html) - [Inko](https://inko-lang.org/) -- Zig +- Zig - Standard ML - Rust - Erlang & Elixir diff --git a/ast/.gitkeep b/ast/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ast/Cargo.toml b/ast/Cargo.toml new file mode 100644 index 0000000..83fd639 --- /dev/null +++ b/ast/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "ast" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/ast/src/lib.rs b/ast/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/ast/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/logo.jpg b/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6997c1e211f18ae23283ab789f6b9031c80290ad GIT binary patch literal 11816 zcmcI~WmubA({3obi@Lm{IeBB3HYLxX>-^a6l@i1-W<2?-qu z1r_-Z!0)?}ka18bQD3sX5>fg@#bx&u4Hv|&?BE-jT2hMlzIhm*`m>?^G69DuB(3F0 z+{oB3o#r*SimGE&*~sGz0PSfgVZc3A(Em3HA;~g3yVreNX;yrsMj`CHA;RH|4 z8={ONJMB<;x15)6%gP5?n1RIdQ_l0(>UpYMju*ka;2mT+BioXwK9U~l@0_Rtq|*Yo z6O;1EzCF`*NtgMl&8?K~|3%Mw2S14qE!*Fw>lnSZ(hhDcy1#g`)M@AJ&Li|$=lB;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3CX%%7yRu`a?IUEr&AOhUp_V@))^zjT`w<94Uy_1uPZsAWysmS9cnbU zV5p;F;$r#_n*$6wWTAnJbq%3-fz;Xy}ha>dV=rA!n zq%ucPXD9BV`ir>AFwSqkIP@j?mgiEFgjo)vTnh!D5`M-=!6g z4qVWt^umf!78aY0OO8%ziz{`a!hpi>Y(PyuaGa%T@15bhf9VKL6kA+y(GZxCUzdWr z^=lQnA3etG@v>QefB2tO`uz^S%Fy=L*Ghlmks#-vYJQ7e`EQT->skLelZS)DUN0ur eb4vF^>>s22+lT0XIf+~^Ccgai_fIi+oc=$8ZoZ!Y literal 0 HcmV?d00001 From c96df23d61f30ba42be6ac5d1b11da1aa4703972 Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 13:25:34 +0100 Subject: [PATCH 2/8] add ci --- .github/workflows/ci.yml | 142 +++++++++++++++++++++++++++++++++++++++ .gitignore | 21 +++++- Makefile | 10 ++- 3 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..24da63e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,142 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + merge_group: + types: [checks_requested] + +jobs: + check: + name: clippy + runs-on: ubuntu-latest + env: + MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ + LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/ + TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@1.75.0 + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - name: add llvm deb repository + uses: myci-actions/add-deb-repo@10 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main + repo-name: llvm-repo + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Install LLVM + run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools + - name: Clippy + run: make check + + fmt: + name: rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@1.75.0 + with: + components: rustfmt + - run: cargo fmt --all -- --check + + # Check for unnecessary dependencies. + udeps: + runs-on: ubuntu-latest + env: + MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ + LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/ + TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ + RUSTUP_TOOLCHAIN: nightly # udeps needs nightly + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly # udeps needs nightly + with: + components: rustfmt + - uses: Swatinem/rust-cache@v2 + + - name: add llvm deb repository + uses: myci-actions/add-deb-repo@10 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main + repo-name: llvm-repo + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Install LLVM + run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools + - name: "Download and run cargo-udeps" + run: | + wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.42/cargo-udeps-v0.1.42-x86_64-unknown-linux-gnu.tar.gz | tar -xz + cargo-udeps-*/cargo-udeps udeps --all-targets --all-features + + test: + name: test (linux, amd64) + runs-on: ubuntu-latest + env: + MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ + LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/ + TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ + RUST_LOG: debug + steps: + - uses: actions/checkout@v3 + - name: free HDD space + run: | + # deleting space + sudo rm -rf /usr/share/dotnet/ + sudo rm -rf /usr/local/lib/android + - name: Setup rust env + uses: dtolnay/rust-toolchain@1.75.0 + - name: Retreive cached dependecies + uses: Swatinem/rust-cache@v2 + - name: add llvm deb repository + uses: myci-actions/add-deb-repo@10 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main + repo-name: llvm-repo + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Install LLVM + run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools + - name: Install deps + run: make deps + - name: test + run: make test + + coverage: + name: coverage + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ + LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/ + TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ + RUST_LOG: debug + steps: + - uses: actions/checkout@v3 + - name: free HDD space + run: | + # deleting space + sudo rm -rf /usr/share/dotnet/ + sudo rm -rf /usr/local/lib/android + - name: Setup rust env + uses: dtolnay/rust-toolchain@1.75.0 + - name: Retreive cached dependecies + uses: Swatinem/rust-cache@v2 + - name: add llvm deb repository + uses: myci-actions/add-deb-repo@10 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main + repo-name: llvm-repo + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Install LLVM + run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: test and generate coverage + run: make coverage + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: lcov.info + fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index ea8c4bf..df98689 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,20 @@ -/target +# Created by https://www.toptal.com/developers/gitignore/api/rust +# Edit at https://www.toptal.com/developers/gitignore?templates=rust + +### Rust ### +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# End of https://www.toptal.com/developers/gitignore/api/rust + +.env +.vscode/ +lcov.info diff --git a/Makefile b/Makefile index 8210b9f..172d5be 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,4 @@ -.PHONY: build check clean - -UNAME := $(shell uname) +.PHONY: build check clean test coverage check-deps: ifeq (, $(shell which cargo)) @@ -26,3 +24,9 @@ check: check-deps clean: cargo clean + +test: check-deps + cargo test --workspace --all-targets --all-features + +coverage: check-deps + cargo llvm-cov --verbose --all-features --workspace --lcov --output-path lcov.info From a4f01833de54ac1143b09db8794e6fd16af5c36d Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 15:06:25 +0100 Subject: [PATCH 3/8] skeleton --- Cargo.lock | 774 ++++++++++++++++++++- Cargo.toml | 5 +- {ast => crates/concrete}/Cargo.toml | 2 +- crates/concrete/src/main.rs | 3 + crates/concrete_ast/Cargo.toml | 9 + {ast => crates/concrete_ast}/src/lib.rs | 0 crates/concrete_codegen_mlir/Cargo.toml | 8 + crates/concrete_codegen_mlir/src/lib.rs | 14 + crates/concrete_driver/Cargo.toml | 8 + crates/concrete_driver/src/lib.rs | 14 + crates/concrete_parser/Cargo.toml | 14 + crates/concrete_parser/build.rs | 3 + crates/concrete_parser/src/grammar.lalrpop | 16 + crates/concrete_parser/src/lexer.rs | 47 ++ crates/concrete_parser/src/lib.rs | 4 + crates/concrete_parser/src/tokens.rs | 28 + 16 files changed, 946 insertions(+), 3 deletions(-) rename {ast => crates/concrete}/Cargo.toml (89%) create mode 100644 crates/concrete/src/main.rs create mode 100644 crates/concrete_ast/Cargo.toml rename {ast => crates/concrete_ast}/src/lib.rs (100%) create mode 100644 crates/concrete_codegen_mlir/Cargo.toml create mode 100644 crates/concrete_codegen_mlir/src/lib.rs create mode 100644 crates/concrete_driver/Cargo.toml create mode 100644 crates/concrete_driver/src/lib.rs create mode 100644 crates/concrete_parser/Cargo.toml create mode 100644 crates/concrete_parser/build.rs create mode 100644 crates/concrete_parser/src/grammar.lalrpop create mode 100644 crates/concrete_parser/src/lexer.rs create mode 100644 crates/concrete_parser/src/lib.rs create mode 100644 crates/concrete_parser/src/tokens.rs diff --git a/Cargo.lock b/Cargo.lock index 265b512..b14312d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,777 @@ version = 3 [[package]] -name = "ast" +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "concrete" +version = "0.1.0" + +[[package]] +name = "concrete_ast" +version = "0.1.0" +dependencies = [ + "tracing", +] + +[[package]] +name = "concrete_codegen_mlir" version = "0.1.0" + +[[package]] +name = "concrete_driver" +version = "0.1.0" + +[[package]] +name = "concrete_parser" +version = "0.1.0" +dependencies = [ + "lalrpop", + "lalrpop-util", + "logos", + "tracing", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is-terminal" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +dependencies = [ + "hermit-abi", + "rustix", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "lalrpop" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +dependencies = [ + "ascii-canvas", + "bit-set", + "diff", + "ena", + "is-terminal", + "itertools", + "lalrpop-util", + "petgraph", + "pico-args", + "regex", + "regex-syntax 0.7.5", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +dependencies = [ + "regex", +] + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "logos" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax 0.6.29", + "syn", +] + +[[package]] +name = "logos-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "syn" +version = "2.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1726efe18f42ae774cc644f330953a5e7b3c3003d3edcecf18850fe9d4dd9afb" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/Cargo.toml b/Cargo.toml index 88cdd43..3cc6eba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] resolver = "2" -members = ["ast"] +members = [ "crates/concrete","crates/concrete_ast", "crates/concrete_codegen_mlir", "crates/concrete_driver", "crates/concrete_parser"] [profile.release] lto = true @@ -14,3 +14,6 @@ opt-level = 3 # On dev optimize dependencies a bit so it's not as slow. [profile.dev.package."*"] opt-level = 1 + +[workspace.dependencies] +tracing = "0.1.40" diff --git a/ast/Cargo.toml b/crates/concrete/Cargo.toml similarity index 89% rename from ast/Cargo.toml rename to crates/concrete/Cargo.toml index 83fd639..0e85fca 100644 --- a/ast/Cargo.toml +++ b/crates/concrete/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ast" +name = "concrete" version = "0.1.0" edition = "2021" diff --git a/crates/concrete/src/main.rs b/crates/concrete/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/crates/concrete/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/crates/concrete_ast/Cargo.toml b/crates/concrete_ast/Cargo.toml new file mode 100644 index 0000000..54267ce --- /dev/null +++ b/crates/concrete_ast/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "concrete_ast" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +tracing.workspace = true diff --git a/ast/src/lib.rs b/crates/concrete_ast/src/lib.rs similarity index 100% rename from ast/src/lib.rs rename to crates/concrete_ast/src/lib.rs diff --git a/crates/concrete_codegen_mlir/Cargo.toml b/crates/concrete_codegen_mlir/Cargo.toml new file mode 100644 index 0000000..97815a3 --- /dev/null +++ b/crates/concrete_codegen_mlir/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "concrete_codegen_mlir" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/crates/concrete_codegen_mlir/src/lib.rs b/crates/concrete_codegen_mlir/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/crates/concrete_codegen_mlir/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/crates/concrete_driver/Cargo.toml b/crates/concrete_driver/Cargo.toml new file mode 100644 index 0000000..e6235e8 --- /dev/null +++ b/crates/concrete_driver/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "concrete_driver" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/crates/concrete_driver/src/lib.rs b/crates/concrete_driver/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/crates/concrete_driver/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/crates/concrete_parser/Cargo.toml b/crates/concrete_parser/Cargo.toml new file mode 100644 index 0000000..2f232e0 --- /dev/null +++ b/crates/concrete_parser/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "concrete_parser" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +lalrpop-util = { version = "0.20.0", features = ["unicode"] } +logos = "0.13.0" +tracing.workspace = true + +[build-dependencies] +lalrpop = "0.20.0" diff --git a/crates/concrete_parser/build.rs b/crates/concrete_parser/build.rs new file mode 100644 index 0000000..ca5c283 --- /dev/null +++ b/crates/concrete_parser/build.rs @@ -0,0 +1,3 @@ +fn main() { + lalrpop::process_root().unwrap(); +} diff --git a/crates/concrete_parser/src/grammar.lalrpop b/crates/concrete_parser/src/grammar.lalrpop new file mode 100644 index 0000000..9d4b0b0 --- /dev/null +++ b/crates/concrete_parser/src/grammar.lalrpop @@ -0,0 +1,16 @@ +use crate::tokens::Token; + +grammar; + +extern { + type Location = usize; + type Error = LexicalError; + + enum Token { + "ident" => Token::Identifier(), + } +} + +pub Term: () = { + "ident" => (), +} diff --git a/crates/concrete_parser/src/lexer.rs b/crates/concrete_parser/src/lexer.rs new file mode 100644 index 0000000..8d4eda6 --- /dev/null +++ b/crates/concrete_parser/src/lexer.rs @@ -0,0 +1,47 @@ +use std::{fmt::Display, ops::Range}; + +use logos::{Logos, SpannedIter}; + +use crate::tokens::{LexingError, Token}; + +pub type Spanned = Result<(Loc, Tok, Loc), Error>; + +#[derive(Debug, Clone)] +pub enum LexicalError { + InvalidToken(LexingError, Range), +} + +impl Display for LexicalError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + LexicalError::InvalidToken(err, span) => { + write!(f, "lexical error at ({:?}): {:?}", err, span) + } + } + } +} + +pub struct Lexer<'input> { + // instead of an iterator over characters, we have a token iterator + token_stream: SpannedIter<'input, Token>, +} + +impl<'input> Lexer<'input> { + pub fn new(input: &'input str) -> Self { + // the Token::lexer() method is provided by the Logos trait + Self { + token_stream: Token::lexer(input).spanned(), + } + } +} + +impl<'input> Iterator for Lexer<'input> { + type Item = Spanned; + + fn next(&mut self) -> Option { + self.token_stream.next().map(|(token, span)| match token { + Ok(token) => Ok((span.start, token, span.end)), + Err(err) => Err(LexicalError::InvalidToken(err, span)), + }) + } +} diff --git a/crates/concrete_parser/src/lib.rs b/crates/concrete_parser/src/lib.rs new file mode 100644 index 0000000..32ce3d2 --- /dev/null +++ b/crates/concrete_parser/src/lib.rs @@ -0,0 +1,4 @@ +#![allow(unused)] + +mod lexer; +pub mod tokens; diff --git a/crates/concrete_parser/src/tokens.rs b/crates/concrete_parser/src/tokens.rs new file mode 100644 index 0000000..b787487 --- /dev/null +++ b/crates/concrete_parser/src/tokens.rs @@ -0,0 +1,28 @@ +use logos::Logos; +use std::{convert::Infallible, fmt}; // to implement the Display trait + +#[derive(Debug, PartialEq, Clone, Default)] +pub enum LexingError { + NumberParseError, + #[default] + Other, +} + +impl From for LexingError { + fn from(_: std::num::ParseIntError) -> Self { + LexingError::NumberParseError + } +} + +impl From for LexingError { + fn from(_: Infallible) -> Self { + LexingError::Other + } +} + +#[derive(Logos, Debug, PartialEq, Clone)] +#[logos(error = LexingError, skip r"[ \t\n\f]+", skip r"//.*\n?", skip r"/\*(?:[^*]|\*[^/])*\*/")] +pub enum Token { + #[regex(r"[a-zA-Z][a-zA-Z\d]*", |lex| lex.slice().parse())] + Identifier(String), +} From 2a81ce1bfc52e1b321b36b3aa6cc74a2dd831b12 Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 15:10:13 +0100 Subject: [PATCH 4/8] only center title and logo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3950698..aee9c71 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ [tg-badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fconcrete_proglang%2F&logo=telegram&label=chat&color=neon [tg-url]: https://t.me/concrete_proglang + + Concrete is a simple programming language specifically crafted for creating highly scalable systems that are reliable, efficient, and easy to maintain. Designed to integrate Rust's safety and speed with the concurrency model of Erlang and Go while being a small, simple language like Zig. It achieves this while avoiding Rust's verbosity and Go's limited syntax and feature set. Writing good code should be easy. The language must be simple enough to fit in a single person’s head. Programs are about transforming data into other forms of data. Code is about expressing algorithms, not the type system. We aim to develop a simpler version of Rust that includes an optional default runtime featuring green threads and a preemptive scheduler, similar to those found in Go and Erlang. - - ## Table of Contents From e9966443365e566510d9761aa3ef9884331cc0ca Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 15:16:13 +0100 Subject: [PATCH 5/8] fix ci --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24da63e..1712e4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@1.75.0 - with: - components: clippy - uses: Swatinem/rust-cache@v2 - name: add llvm deb repository uses: myci-actions/add-deb-repo@10 @@ -97,8 +95,6 @@ jobs: keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key - name: Install LLVM run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools - - name: Install deps - run: make deps - name: test run: make test From 932458c1d18d855f9afd094e56b9b996c2d475e7 Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 15:16:46 +0100 Subject: [PATCH 6/8] no token yet --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1712e4b..e4615df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,6 +133,6 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + #token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos files: lcov.info fail_ci_if_error: true From 8b8040538e7d96345a1d0ea7b3b9188e04b35f50 Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 15:17:44 +0100 Subject: [PATCH 7/8] gitkeep --- ast/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ast/.gitkeep diff --git a/ast/.gitkeep b/ast/.gitkeep new file mode 100644 index 0000000..e69de29 From a71cb970ebec3a7963e9dd42bc26b5d8cd4a4a8f Mon Sep 17 00:00:00 2001 From: Edgar Date: Thu, 4 Jan 2024 15:34:04 +0100 Subject: [PATCH 8/8] no udeps --- .github/workflows/ci.yml | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4615df..cd63ed6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@1.75.0 + with: + components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - name: add llvm deb repository uses: myci-actions/add-deb-repo@10 @@ -40,34 +42,6 @@ jobs: components: rustfmt - run: cargo fmt --all -- --check - # Check for unnecessary dependencies. - udeps: - runs-on: ubuntu-latest - env: - MLIR_SYS_170_PREFIX: /usr/lib/llvm-17/ - LLVM_SYS_170_PREFIX: /usr/lib/llvm-17/ - TABLEGEN_170_PREFIX: /usr/lib/llvm-17/ - RUSTUP_TOOLCHAIN: nightly # udeps needs nightly - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly # udeps needs nightly - with: - components: rustfmt - - uses: Swatinem/rust-cache@v2 - - - name: add llvm deb repository - uses: myci-actions/add-deb-repo@10 - with: - repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main - repo-name: llvm-repo - keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key - - name: Install LLVM - run: sudo apt-get install llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools - - name: "Download and run cargo-udeps" - run: | - wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.42/cargo-udeps-v0.1.42-x86_64-unknown-linux-gnu.tar.gz | tar -xz - cargo-udeps-*/cargo-udeps udeps --all-targets --all-features - test: name: test (linux, amd64) runs-on: ubuntu-latest