Coder Social home page Coder Social logo

zaen-archive / weasel Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 439 KB

Weasel language is a project i created to proof of concept that we can support heterogeneous internally inside a language.

License: MIT License

CMake 2.57% C++ 96.00% C 0.28% Shell 0.46% Python 0.69%
llvm language spirv weasel-lang heterogeneous-parallel-programming

weasel's Introduction

Weasel Language

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

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.

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)

ROADMAP

Function

  • Function Declaration
  • Function Definition
  • Function Call
  • Function Variable Number Arguments

Data Type

  • Integer
  • Float
  • Boolean

Variable Table Declaration

  • Variable Declaration
  • Variable Lookup
  • Function Lookup
  • Variable names and constants
  • Procedure and function names
  • Literal Constant
  • Strings Literal
  • Compiler generated temporaries
  • Labels in source languages

Error Table

  • Simple table

Identifier

  • variable declaration and definition

Binary Expression

  • Simple Binary Expression
  • Support variable re-assign

Variable Type (signed and unsigned)

  • Support variable signed and unsigned

Operator

  • Support Multiply
  • Support Division
  • Support Addition
  • Support Substract
  • Support Modulo

Unary Operator

  • Support Unary Operator

Array

  • Simple pointer type
  • Simple Address of
  • Support nil value
  • Support Array Data Sequence
  • Support Vector Data Sequence

Dynamic Allocation

  • Support Malloc and Free

IO console (input/output)

  • Support simple output through c library
  • Support simple input
  • Support IO

Heterogeneous Computing

  • Implement Simple Internal Heterogeneous Computing (for prove of concept)

If / Else Statement

  • Support if decision
  • Support else if decision
  • Support else decision

For Statement

  • Support For-loop statement
  • Support For(while) statement
  • Support For(switch) statement

Struct

  • Support Struct

Function Struct

  • Support internal function inside struct

Function Struct by reference

  • Support Function by reference

Naming Mangling

  • By default use mangling name

BUGS

  • Weird Lexeme Location(row, col, position)
  • Special character need handled
  • I implemented binaryexpression for precedence associative right to left wrongly
  • Library inside lib folder instead of inside tools folder

BUGS SOLVED

  • weird lexeme Location solved by use filemapped source

weasel's People

Contributors

zaen-archive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mozibisa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.