Skip to content
View gnuchanos's full-sized avatar
😯
😯

Block or report gnuchanos

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
GnuchanOS/README.md

GnuchanOS

GnuChanIDE + GCL — a single language with Python and Lua embedded.

The idea is simple: I love Lua and Python, but I also want my own language. So I take them all. GCL is the main language; Python 3.14 and Lua 5.4.7 are its native parts. raylib is our shared library for games and graphics.


The Fridge Model

Think of GCL as a fridge. Inside there are tons of things: Python 3.14, Lua 5.4.7, raylib, packages installed via pip, and GCL's own standard library. You don't write Python code inside .gcsf files; GCL is not a shell that runs python script.py. Here is how it works:

  • Python and Lua are GCL's capabilities. GCL code calls them whenever it wants.
  • gcl -pyrun script.py and gcl -luarun script.lua are quick-run shortcuts.
  • The LSP scans the entire fridge: stdlib, site-packages, C extension modules, import chains. It knows everything inside the IDE.
             ┌─────────────────────────────────────────────┐
             │                 GCL (the fridge)            │
             │                                             │
             │   Python 3.14      Lua 5.4.7      raylib    │
             │   (pyLibrary)      (lua.gcDL)     (+ pyd)   │
             │   + stdlib         + stdlib                 │
             │   + site-packages  + luaLibrary             │
             │   + C extensions                            │
             │                                             │
             │   GCL language  ──  native capabilities     │
             └───────────────────┬─────────────────────────┘
                                 │
                                 ▼
                      GnuChanIDE + gcl-LSP
                      (full fridge scan: imports, stdlib,
                       site-packages, C extensions)

What Can You Do?

With GCL you can write both low-level (C-like) and high-level (Python, Lua) code. Games, graphics, tools, automation... whatever you want. Here are a few modes of use:

Mode What does it do?
gcl -run file.gcsf Runs GCL interpretively (JIT after the first 1000 calls)
gcl -pyrun script.py Python quick-run shortcut
gcl -luarun script.lua Lua quick-run shortcut
gcl -ide [file] Launches the raylib-based GnuChanIDE
gcl -lsp [workspace_dir] Starts the JSON-RPC LSP server
gcl -build <project.gcdata> -o <dir> Builds a project into a .gcbundle
gcl -new <project_name> [--lua/--python] Creates a new project skeleton
gcl build <module> Builds a standard library module (e.g. Math)

Build is a single command:

python language/makefile.py

This command, in order: downloads Lua, Raylib, Raygui, Python 3.14 and FreeFont under _temp/ if missing, embeds FreeMono.ttf as a C byte array (embed_freemono.c), compiles gcl.exe, then produces the Math, Stdio, Lua, LuaRaylib, Python modules as .gcdl and bundles the examples/Demo project. Output lands under language/build/<os>/.


Language Pipeline

GCL Source ──► .gclib/extern ──► .gcsf/extern ──► main.gcsf
     │
     ▼
SharedPipeline ──► FastIR
src/
├── FastIR/
└── SharedPipeline/
    ├── Linker/
    ├── Lexer/
    ├── Parser/
    ├── Semantic/
    ├── TypeChecker/
    ├── Memory/
    ├── GarbageCollector/
    ├── AST/
    ├── Diagnostics/
    ├── Ir/
    └── Common/

In the actual code, under language/src/ you will find:

  • shared_pipeline/ — lexer, parser, AST, IR, typecheck, runner, error
  • linker/ — include, lib, native (math, stdio, embed)
  • embed/ — Lua, Python, raylib embedding
  • lsp/ — JSON-RPC LSP server
  • ide/ — the raylib-based GnuChanIDE
  • include/ — all headers

Memory Management

              Program
                 │
    ┌────────────┼─────────────┐
    │            │             │
   Stack        Heap      Static Data
    │            │
    │      ┌─────┼─────┐
    │      │     │     │
   Local  Arena Pool Custom

Everything is checked: OOM + null + bounds + overflow.


Directory Structure

build/windows/
├─ gcl.exe                    <- GCL compiler driver (hub) — runs interpreter, LSP, IDE, builds
├─ ide.gcsettings             <- IDE settings (theme, font, workspace, effects)
├─ Library/
│  ├─ Math.gcdl               <- GCL math standard library
│  ├─ Math_Ref.gclib          <- math library reference
│  ├─ Stdio.gcdl              <- GCL stdio standard library
│  ├─ Stdio_Ref.gclib         <- stdio library reference
│  └─ EmbedSystem/
│     ├─ Lua.gcdl             <- Lua 5.4.7 embed
│     ├─ LuaRaylib.gcdl       <- Lua raylib binding
│     └─ Python.gcdl          <- Python 3.14 embed
├─ Runtime/
│  └─ Python/                 <- full Python 3.14 runtime bundle
│     ├─ python314.dll
│     ├─ Lib/                 <- Python stdlib
│     │  └─ site-packages/    <- pip-installed packages (e.g. pip, requests)
│     ├─ DLLs/                <- Python extension DLLs
│     ├─ include/             <- Python headers
│     └─ Scripts/             <- Python scripts (pip, etc.)
├─ Assets/
│  └─ FreeMono.ttf            <- embedded monospace font
└─ examples/
   └─ Demo/                   <- sample project bundle
      ├─ Demo.gcbundle
      └─ Demo.exe

GnuChanIDE and GnuChanBook

GnuChanIDE

A raylib-based, self-contained development environment. You write, edit, and run code. It includes LSP integration — autocomplete, hover info, go-to-definition, and signature help. Editor + LSP + embedded Python/Lua runtime all together.

The IDE's syntax highlighter is language-aware:

  • .py files recognize Python keywords, def/class names, self/cls, __init__-style dunder methods, triple-quoted strings, and # comments.
  • .lua files recognize Lua keywords, function names, and -- comments.
  • .gcsf/.gcl files use GCL keywords.

Colors follow the dark purple theme. The Build dialog lets you choose Debug or Release — the selected mode is highlighted, and the build output is placed in a debug/ or release/ subdirectory so the two modes stay separate.

GnuChanBook

Inside book/ there is an interactive textbook written in HTML + CSS + vanilla JS. The content covers GCL, Lua and Python lessons; fully in Turkish and English. 38 lessons:

  • Introduction: Welcome
  • GCL (12): Intro, Variables/Types, Operators, Control Flow, Functions, Arrays/Pointer, Pointer-Array Relationship, Struct/Enum, Recursion, File I/O, Modules/Preprocessor, Embed, Example Project
  • Lua (11): Intro, Variables/Types, Operators, Tables, Table Library, Control Flow, Functions/Closure, String Library, Metatables, Iterators, pcall, Modules/require, Raylib
  • Python (14): Intro, Variables/Types, Operators, Control Flow, Lists, Dicts/Sets, Functions, Modules/import, OOP, File Handling, JSON, Error Handling, Decorators, Generators, Raylib

Book features: live search (Ctrl+K or /), keyboard shortcuts (/), the open/closed state of the sidebar persists in memory, syntax highlighting, code-copy buttons, and a progress bar. The design follows a purple-only palette with dark background/light text. Just open book/index.html in your browser.


Examples

Under language/examples/Demo/ there is a sample project. The main.gcsf file contains GCL code; the scripts/ folder holds main.py and main.lua. The project.gcdata file defines the project configuration. You can package this project into a single .gcbundle with gcl -build, or run it directly.


References

gnuchanos.md for the complete architectural reference.

Pinned Loading

  1. GnuChanGUI GnuChanGUI Public

    this library tk based gui library main focus is make gui more fun and easy

    Python 7

  2. GnuchanOS GnuchanOS Public

    This Is MY Kingdome COME!

    C 3

  3. gnuchanos.github.io gnuchanos.github.io Public

    JavaScript

  4. GnuChan_Engine GnuChan_Engine Public

    C++

  5. GnuChan_Editor GnuChan_Editor Public

    C

  6. Gursina-Engine Gursina-Engine Public

    parody engine

    C++