Show HN: Bolt – A super-fast, statically-typed scripting language written in C

https://news.ycombinator.com/rss Hits: 10
Summary

⚡ Bolt A lightweight, lightning-fast, type-safe embeddable language for real-time applications. import print , error , Error from core import abs , epsilon from math // The return type of safe_divide is inferred to be `Error | number` fn safe_divide ( a : number , b : number ) { if abs ( b ) < epsilon { return error ( "Cannot divide by zero!" ) } return a / b } match let result = safe_divide ( 10 , 5 ) { is Error { // The type of result is narrowed in this branch! print ( "Failed to divide:" , result . what ) } is number { print ( "The answer is" , result ) } } Features Lightning-fast performance, outperforming other languages in its class Compact implementation, leaving a minimal impact on build size while remaining consise enough to browse. Blazingly quick compilation, plow through code at over 500kloc/thread/second. That's 50'000 lines in the blink of an eye. Ease of embedding, only a handful of lines to get going Rich type system to catch errors before code is ran, with plenty of support for extending it from native code Embed-first design, prioritizing inter-language performance and agility Links Dependencies Bolt only depends on the C standard library as well as libm on Unix-based ssytems. Some standard library modules include things like file and system IO, but these can be disabled easily. By default, Bolt sets up an environment that uses malloc / realloc / free , but this is also easy to configure. Bolt also embeds my other library picomatch for regex parsing Minimal embedding example The bolt-cli program provides a very consice example of how to embed bolt an an application, see the Bolt embedding guide for more details. Language examples The examples folder contains a few short examples of ideomatically written bolt code. Check out the tests and benchmarks folders as wel for some more in-depth language overview. Building Bolt currently only builds on x64. 32-bit architectures are explicitly not supported, arm and riscv are untested. Running cmake in the r...

First seen: 2025-08-10 18:43

Last seen: 2025-08-11 03:45