Open segeljakt opened 1 year ago
Changes needed in MLIR:
Changed the following in the Rust dialect:
i32
to I32
, bool
is Bool
, etc. This is so we don't need to worry about being compatible with Rust's function signatures.1
to I32::new(1)
, bool
to Bool::new(bool)
, etc. These functions are still const
, so they can be called in const contexts.declare
. This was previously needed for passing functions as data. I removed it since it resulted in a lot of complexity inside the runtime system without too much value.task
. Instead of allowing tasks to be generated by the runtime, I think it is best to solve this problem in a different way by for example introducing a new dataflow operator that can take a task as input.async
, spawn
, receive
, send
. I think it will become easier if we only generate synchronous code. I think this code was needed for "nonpersistent tasks".#[rewrite]
to #[data]
. #[data]
is only needed on struct
and enum
declarations to derive boilerplate. The macro no longer inserts things like Rc<T>
, which caused some complexity.new!(..)
, access!(..)
, enwrap!(..)
, val!(..)
and made them use Rust's syntax directly. What these operations do is now less complicated since we now represent data as it appears without rewriting it in strange ways.is!(x::y, z)
to Rust's builtin matches!(z, x::y(_))
.a + b
can be written I32::add(a, b)
. I think it could be good to use this syntax but it is not crucial since I overloaded the operators. It is for example possible to do I32::new(1) + I32::new(2)
.Other:
arc-mlir
directory. Primarily:*_SRC_DIR
to *_DIR
ARC_MLIR_SOURCE_DIR
to ARC_MLIR_SRC_DIR
arc-lang/etc/Cargo.toml.template
into the *.in
files since it was very small.Unsolved problems:
arc.in
file is outdated. I am unsure if we should keep it or not. Personally I would prefer if you could run arc-lang
by just running the arc-lang
binary.&&
and ||
since these have special short-circuiting behaviour, so I used &
and |
instead, e.g., Bool::new(true) & Bool::new(false)
. They inline directly to &&
and ||
so it should not affect performance but we might need to update the codegen output.Thoughts:
This is a WIP PR for version 1 of Arc-Lang. It includes a rewrite of Arc-Lang's compiler and runtime system. The system architecture now looks like this:
The workflow is as follows:
Users write Arc-Lang programs on their local machine and execute them using a client program. The client communicates with a local Arc-Lang process using pipes to compile and interpret the program. During interpretation, the interpreter may construct dataflow graphs that should be executed on a distributed system. These logical dataflow graphs and their UDFs are holistically represented as Arc-MLIR code and sent to the client process using standard output. The client process forwards the code to a coordinator process using TCP. The coordinator process uses an Arc-MLIR compiler to compile the MLIR source into a Rust module, representing the UDFs, and a JSON object, representing an optimised logical dataflow graph. The coordinator then compiles the logical graph into a physical graph mapped to specific hardware threads and sockets in a cluster of workers.