#compiler #compile #bytecode #script #source #gs2 #graal

gs2compiler

Compiles GS2 source code into GS2 bytecode

3 unstable releases

new 0.2.3 Jan 20, 2025
0.2.2 Dec 18, 2024
0.1.0 Aug 14, 2024

#636 in Programming languages

Download history 6/week @ 2024-09-25 2/week @ 2024-10-02 1/week @ 2024-10-30 2/week @ 2024-11-06 4/week @ 2024-11-27 40/week @ 2024-12-04 27/week @ 2024-12-11 158/week @ 2024-12-18 7/week @ 2025-01-01 5/week @ 2025-01-08

172 downloads per month

GPL-3.0-only

4.5MB
98K SLoC

C 80K SLoC // 0.2% comments C++ 6.5K SLoC // 0.1% comments M4 3K SLoC // 0.6% comments Lex 2.5K SLoC // 0.2% comments Happy 2.5K SLoC XSL 1.5K SLoC // 0.1% comments D 856 SLoC // 0.3% comments Java 775 SLoC // 0.3% comments Rust 115 SLoC // 0.0% comments C# 50 SLoC Shell 28 SLoC // 0.2% comments Batch 20 SLoC Visual Studio Solution 16 SLoC PowerShell 6 SLoC

gs2-parser

This is a compiler for the Graal Script 2 (GS2) language.

Prerequisites

Before building, clone the repository and recursively clone the submodules:

git clone git@github.com:xtjoeytx/gs2-parser.git --recursive

Building

You can build the project using CMake:

mkdir build
cd build
cmake ..
make -j $(nproc)

Running

You can use the following command:

$ ./gs2test ../scripts/asd2.txt
Argc: 2
Args: ../scripts/asd2.txt
Compiling file ../scripts/asd2.txt
Compiled in 0.001322 seconds
 -> saved to ../scripts/asd2.gs2bc
Total length of bytecode w/ headers:   160

Dependencies