Skip to content

Commit

Permalink
conflicts!
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Feb 5, 2024
2 parents e0e6185 + e8671e5 commit b2f7cd0
Show file tree
Hide file tree
Showing 22 changed files with 611 additions and 31 deletions.
17 changes: 13 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"

members = [ "crates/concrete","crates/concrete_ast", "crates/concrete_codegen_mlir", "crates/concrete_driver", "crates/concrete_parser", "crates/concrete_session", "crates/concrete_type_checker"]
members = [ "crates/concrete","crates/concrete_ast", "crates/concrete_codegen_mlir", "crates/concrete_driver", "crates/concrete_parser", "crates/concrete_session", "crates/concrete_check"]

[profile.release]
lto = true
Expand Down
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export TABLEGEN_170_PREFIX=/usr/lib/llvm-17
- - [Features that are being debated](#features-that-are-being-debated)
- [Syntax](#syntax)
- [Inspirations](#inspiration)
- [Roadmap](#roadmap)

## Design

Expand Down Expand Up @@ -185,3 +186,55 @@ The design was very heavily influenced by all these programming languages:
- [Lua](https://www.lua.org/)
- [Clojure](https://clojure.org/)
- [Nim](https://nim-lang.org/)

## Roadmap

For a full roadmap check the [project](https://github.com/orgs/lambdaclass/projects/23).


Meaning:
- ✔️ = implemented
- 🏗️ = work in progress
- :x: = work not started yet
- 🤔 = to be defined

Features:
- if/else ✔️
- while ✔️
- modules ✔️
- imports ✔️
- floats 🏗️
- structs 🏗️
- arrays :x:
- iterators :x:
- for :x:
- borrowing 🏗️
- match :x:
- option :x:
- enums :x:
- impl :x:
- linear type checker :x:
- borrow checker :x:
- generics :x:
- traits :x:
- unsafe :x:
- box :x:
- rc (for cyclical data structures like graphs) :x:
- ffi :x:
- operating system threads with move only semantics :x:
- rayon-like :x:

Post-runtime features:
- runtime with preemptive green threads :x:
- erlang like profiling :x:
- erlang like tracing :x:
- erlang like observer :x:
- standard library :x:
- gleam otp like library patterns :x:
- http server :x:
- json :x:
- sql server :x:
- serde replacement :x:
- rustler like binding generator to call rust code :x:
- embeddable concrete (no allocator, first-class support for no standard library, etc) :x:
- capabilities 🤔
8 changes: 8 additions & 0 deletions crates/concrete_ast/src/common.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::ops::Range;

#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct Span {
pub from: usize,
Expand All @@ -10,6 +12,12 @@ impl Span {
}
}

impl From<Span> for Range<usize> {
fn from(val: Span) -> Self {
val.from..val.to
}
}

#[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
pub struct DocString {
contents: String,
Expand Down
3 changes: 2 additions & 1 deletion crates/concrete_ast/src/functions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
common::{DocString, GenericParam, Ident},
common::{DocString, GenericParam, Ident, Span},
statements::Statement,
types::TypeSpec,
};
Expand All @@ -17,6 +17,7 @@ pub struct FunctionDecl {
pub struct FunctionDef {
pub decl: FunctionDecl,
pub body: Vec<Statement>,
pub span: Span,
}

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
Expand Down
3 changes: 2 additions & 1 deletion crates/concrete_ast/src/imports.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::common::Ident;
use crate::common::{Ident, Span};

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct ImportStmt {
pub module: Vec<Ident>,
pub symbols: Vec<Ident>,
pub span: Span,
}
3 changes: 2 additions & 1 deletion crates/concrete_ast/src/modules.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
common::{DocString, Ident},
common::{DocString, Ident, Span},
constants::ConstantDef,
functions::FunctionDef,
imports::ImportStmt,
Expand All @@ -13,6 +13,7 @@ pub struct Module {
pub imports: Vec<ImportStmt>,
pub name: Ident,
pub contents: Vec<ModuleDefItem>,
pub span: Span,
}

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down
8 changes: 8 additions & 0 deletions crates/concrete_ast/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ impl TypeSpec {
TypeSpec::Array { is_ref, .. } => *is_ref,
}
}

pub fn get_name(&self) -> String {
match self {
TypeSpec::Simple { name, .. } => name.name.clone(),
TypeSpec::Generic { name, .. } => name.name.clone(),
TypeSpec::Array { of_type, .. } => format!("[{}]", of_type.get_name()),
}
}
}

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
Expand Down
13 changes: 13 additions & 0 deletions crates/concrete_check/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "concrete_check"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ariadne = { version = "0.4.0", features = ["auto-color"] }
concrete_ast = { version = "0.1.0", path = "../concrete_ast" }
concrete_session = { version = "0.1.0", path = "../concrete_session" }
itertools = "0.12.0"
thiserror = "1.0.56"
File renamed without changes.
Loading

0 comments on commit b2f7cd0

Please sign in to comment.