aglis-lab / weasel

This is still on experimental version

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weasel Language

Weasel Language named after name of animal https://en.wikipedia.org/wiki/Weasel

Run debug with GLOG Logs

GLOG_logtostderr=1 build/tools/weaselc/weaselc temp/main.we

Debug

llc temp/main.ir -filetype=obj && clang++ temp/main.ir.o -o temp/main.out && ./temp/main.out

BACKGROUND

Weasel language is a project i created to prove of concept that we can support heterogenous internally inside a language. We can use GPGPU Computing directly supported by the language. Which mean you just directly code to the language and just works.

And we can create computationally task easyly solved. Like Machine Learning and even AI, because you can switch which program or code need to run on GPU or CPU or any compute hardware without hassle.

We also can binding the library created by weasel language into another languages like python to create better environment for end user to create fast program.

Flow Code

  • FileManager -> Lexer -> Parser <- Module
  • Module -> Codegen(LLVM Module) -> Driver
  • Module -> Printer

Third-Party

  • fmt (install on system)
  • glog (install on system)

SETUP (see LLVM Documentation)

  • Add LLVM Project
  • Before build change linker to llvm lld then Build LLVM Project
  • Set LLVM DIR
  • Build Project

Installing Weasel Language

Linux Version

Windows Version

  • No binary release for windows, follow installing from source code.

Mac OS X

  • no binary release for mac os x, follow installing from source code.

Install from Source Code

1. Install Clang

Untuk linux

  • anda tinggal run
  • sudo apt update
  • sudo apt install clang-12

Untuk Windows

Untuk Mac OS X

  • Clang merupakan default compiler di Mac OS X, jadi tidak perlu menginstall lagi

2. Clone Project

3. Set LLVM DIR

Untuk Linux

  • Tidak perlu diganti

Untuk Windows

  • Buka file CMakeLists.txt
  • Ganti pathnya LLVM_DIR ke {folder clang}/lib/cmake/llvm

Untuk Mac OS X

-Set ke folder cmake llvm (not tested, limited hardware resource)

4. Set Library LLVM SPIRV

Untuk Linux

Untuk Windows

Untuk Mac OS X

5. Build Source

Untuk Linux

  • mkdir build
  • cd build
  • cmake ..
  • cmake --build .
  • tunggu process selesai dan anda bisa menggunakan file executablenya

Untuk Windows

  • mkdir build
  • cd build
  • cmake ..
  • cmake --build .
  • tunggu process selesai dan anda bisa menggunakan file executablenya

Untuk Mac OS X

  • mkdir build
  • cd build
  • cmake ..
  • cmake --build .
  • tunggu process selesai dan anda bisa menggunakan file executablenya


  • #f03c15 NOTE : On progress to automate the installation.
  • #f03c15 NOTE : Mail to github project for more information.

FOLDER STRUCTURE

  • cmake (Cmake File to avoid boilerplate of cmake file)
  • include (folder header)
  • lib (Library of the header)
  • libparallel (Library that used for creating parallel execution. This is an abstraction of OpenCL FrameWork)
  • tools (tools program)
  • runtime-rt (Source program that used for testing)
  • unittests (program for to be compiled)

About

This is still on experimental version

License:MIT License


Languages

Language:C++ 94.4%Language:CMake 2.3%Language:Shell 1.1%Language:C 0.6%Language:Python 0.6%Language:Java 0.3%Language:C# 0.2%Language:PHP 0.2%Language:JavaScript 0.2%