Show HN: Chain – A Python-like language with native inline C++

Pilot02531 pts0 comments

Chain (Formerly Link-Lang) is a Python-syntax scripting language that was built from scratch in C++, with one feature I haven t noticed elsewhere: an extern c { } block where you can write real C++ directly inside a script. The runtime then compiles it, catches the .so, and shares variables with the surrounding script via shared memory. An example would be: set x = 30 extern c { for(int i = 0; i 5; i++) { LINK_x -= 1; } } print(x) # x is now 25, mutated by the C++ block This essentially means you get Python-like ergonomics for everyday usage, while having a direct hatch to C++ when you need raw performance or a library that isn t wrapped yet, not having to leave the file or set up a separate build step.Furthermore, Chain has dynamic typing (int/float/string/char/bool/list/dict), OOP (classes, constructor, this , new ), an ( import ) module system, and try/catch. It also ships with native modules for GUI (via raylib), audio, TCP networking, and OS/shell access. This means a script can open a window, play a sound, and/or hit a network socket without pulling in external packages.Chain is the flagship language of a hobby OS (and general technology group) a few of us are building, called Nebula OS, where it s used as the interpreted layer that integrates directly with the GUI, audio, networking, and OS layer without needing to go through separate frameworks or services. The OS also ships a small suite of native tools (a shell, file manager, text/script editor) that treat .chain scripts as first class. For example, the file manager can statically analyze a script and offer to install it as a live shell plugin. I d be happy to go into this in the comments if people are curious, but just wanted to keep this post focused on the language itself.Chain runs on Linux and Android (custom ARM kernel) so far, and precompiled binaries (x86_64/aarch64, Linux, Windows, macOS) are next on the development roadway.I would especially love feedback on the language design, specifically the extern c and shared-memory approach. Does it seem reasonable, or are there thing you d expect to hit it with?

chain quot language script python native

Related Articles