A Tensor based Programing Language.
note: due to we need latest bison, so you may need compile
from source and add soft link under /usr/bin/bison
to make
sure cmake find it.
sudo apt install cmake flex ninja-build clang
git clone git@github.com:WLFJ/T-Lang.git
cd T-Lang
git submodule update --init --depth 1
mkdir 3rdparty/llvm-project/build && cd 3rdparty/llvm-project/build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_RTTI=true
ninja
cd -
mkdir build && cd build
cmake ..
cmake --build . -j$(nproc)
- compile project.
- write your source code saved in
test.tc
. - run following command:
chmod +x build/tc && ./tcc test.tc && ./a.out
Coming Soon ...
- A simple (hello-world example) bison example.
- A flex.
- A AST dumper.
- CMake
- Migrate build system from
GNU make
toCMake
. -
Mem safer (avoid useingNo, we'll use AST from ToyLang.new
directly, instead ofunique_ptr
?). -
SimplifySeems it's already clean yet.yy
andll
file. - Freeze MLIR into
3rdparty
, and include it into CMakeLists. (Should we build it automatically ?). - Add backend support.
- Support
print
in grammar. - Add
TIR
, make them all runnable. - Add variable dec like
var a = 1;
. (partial, id bind in grammar is needed.) - Add RTTI support cmd.
-
Dumpusing JIT instead.llvm::Module
into file. - Add math calc. (for
+
*
) - Add function fully support. (arbitary argument, return value, caller, callee).
- For now sub function must have return type.
- Add advanced operator (
transpost
etc.) - grammar confict fix (binop precident).
- support redundent tensor decl.
- support none value variable declearation.
- research how ir generated.
- add
linalg
opt layer. - writing some ref ;P.
- Add
linalg.generic
like expr support. like this:
# a -> [1, 2, 3, 4] then b -> [ [1, 2], [3, 4] ]
# usage: [[ tile(a) ]]
# reshape
lin tile(a<m>) {
map {a<i> -> <m>, b<j, k> -> <i / k, i % k>}
(a) {
a;
}
} -> b<n, k>
- support more binop (
-
,.
) - FileCheck (LLVM is needed).
- Automatic Test.(Maybe
cmake test
). - Add remain supported expr.