frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

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

https://github.com/Beariish/bolt
139•beariish•7h ago
I've built many interpreters over the years, and Bolt represents my attempt at building the scripting language I always wanted. This is the first public release, 0.1.0!

I've felt like most embedded languages have been moving towards safety and typing over years, with things like Python type hints, the explosive popularity of typescript, and even typing in Luau, which powers one of the largest scripted evironments in the world.

Bolt attempts to harness this directly in the lagnauge rather than as a preprocessing step, and reap benefits in terms of both safety and performance.

I intend to be publishing toys and examples of applications embedding Bolt over the coming few weeks, but be sure to check out the examples and the programming guide in the repo if you're interested!

Comments

themonsu•7h ago
Looks cool, but please can we stop naming things ”bolt”
IAmLiterallyAB•3h ago
Yeah this is the third programming language named Bolt that I'm aware of
CyberDildonics•1h ago
Not to mention the facebook after compilation optimizer called bolt.
acron0•7h ago
If I was still writing games I would be alllllll over this
grodriguez100•7h ago
Sounds very good, and I can see many use cases in embedded systems. But that probably requires 32-bit arm support. Is that planned ?
beariish•7h ago
As of right now no - my primary target when developing this was realtime and games in particular since that's what I know best, but if there's a real target in embedded that's certainly something that could be explored.
MobiusHorizons•6h ago
FYI "the embedded scene" is likely to be interpreted as "embedded systems" rather than "embedded interpreters" even by people who know about embedded interpreters, especially since all the languages you give as an example have been attempted for use on those targets (micropython, lua, and even typescript)
beariish•6h ago
That's a good point, thank you. I've made a small edit to clarify.
thrance•6h ago
Function return type inference is funny but I don't think it's that great of a feature. It makes it harder for a library's consumer to know how to properly use a function, and it also makes it harder for the maintainer to not break backwards compatibility inadvertently. Anyway, I'm all for experimenting.
beariish•6h ago
There's nothing stopping a library author from explicitly annotating return types wherever a stable interface is important, the idea is more for smaller functions or callbacks to make use of this. Perhaps I'll make the examples clearer to reflect the intention.
jitl•3h ago
It’s great in TypeScript. In TypeScript your source can have inferred types returned, and then use a build step to produce resolved typings files (.d.ts) for distribution that have the fully specified type.
thrance•2h ago
Ah, true, now that you mention it. I feel like it's the best of both worlds, you get type inference and it gets documented automatically.
eulgro•6h ago
The question I ask myself when I see this kind of project is: how long are you willing to maintain it for?

My main concern about a new language is not performance, syntax, or features, but long term support and community.

01HNNWZ0MV43FF•6h ago
In the end, weight is a kind of strength, and popularity is a kind of quality. It looks promising but you can't expect long-term support until there's more contributors and users

At this point it is too early to know. Even JavaScript took like 20 years to catch on

brabel•5h ago
The only way to have any idea of how long a language might be still around is to look at how long it's been already around. From this perspective , you can only use older languages. The benchmarks show that Lua (and the Luau and Lua+JIT variants) is actually very competitive, so I'd stick with one of those.
cookiengineer•5h ago
If functions don't have a return signature, does that mean everything must be satisfied in the compilation step?

What about memory management/ownership? This would imply that everything must be copy by value in each function callsite, right? How to use references/pointers? Are they supported?

I like the matchers which look similar to Rust, but I dislike the error handling because it is neither implicit, and neither explicit, and therefore will be painful to debug in larger codebases I'd imagine.

Do you know about Koka? I don't like its syntax choices much but I think that an effect based error type system might integrate nicely with your design choices, especially with matchers as consumers.

[1] https://koka-lang.github.io/koka/doc/index.html

zygentoma•4h ago
Oh, not OP, but I love Koka. I should play around with it again thanks for reminding me!
driggs•3h ago
> If functions don't have a return signature, does that mean everything must be satisfied in the compilation step?

Functions do have a return signature.

It looks like the author chose to show off the feature of return type inference in the short example README code, rather than the explicit case.

https://github.com/Beariish/bolt/blob/main/doc/Bolt%20Progra...

Vandash•5h ago
game dev for 15+ years here, love the first example on Github this is compiled right? cannot replace lua?
beariish•5h ago
Bolt is not compiled ahead of time, it's bytecode interpreted just like Lua
IshKebab•5h ago
It's compiled in the same way that Lua is compiled. So yes, it can replace Lua.
kiririn•5h ago
Nice, gives me Pawn vibes

(https://www.compuphase.com/pawn/pawn.htm)

haberman•5h ago
I love the concept -- I've often wished that lean languages like Lua had more support for static typing, especially given the potential performance benefits.

I also love the focus on performance. I'm curious if you've considered using a tail call design for the interpreter. I've found this to be the best way to get good code out of the compiler: https://blog.reverberate.org/2021/04/21/musttail-efficient-i... Unfortunately it's not portable to MSVC.

In that article I show that this technique was able to match Mike Pall's hand-coded assembly for one example he gave of LuaJIT's interpreter. Mike later linked to the article as a new take for how to optimize interpreters: https://github.com/LuaJIT/LuaJIT/issues/716#issuecomment-854...

Python 3.14 also added support for this style of interpreter dispatch and got a modest performance win from it: https://blog.reverberate.org/2025/02/10/tail-call-updates.ht...

beariish•5h ago
I did experiment with a few different dispatch methods before settling on the one in Bolt now, though not with tailcalls specifically. The approach I landed on was largely chosen cause it in my testing competes with computed goto solutions while also compiling on msvc, but I'm absolutely open to try other things out.
summerwant•4h ago
I see lua, do you know terralang?
debugnik•3h ago
You may be interested in Luau, which is the gradually-typed dialect of Lua maintained by Roblox. The game Alan Wake 2 also used it for level scripting.
perlgeek•5h ago
I like 99% of this, and the thing I don't like is in the very first line of the example:

> import abs, epsilon from math

IMHO it's wrong to put the imported symbols first, because the same symbol could come from two different libraries and mean different things. So the library name is pretty important, and putting it last (and burying it after a potentially long list of imported symbols) just feels wrong.

I get that it has a more natural-language vibe this way, but put there's a really good reason that most of the languages I know that put the package/module name first:

    import packageName.member; // java
    from package import symbol; # python
    use Module 'symbol'; # perl
    
With Typescript being the notable exception:

    import { pi as π } from "./maths.js";t
beariish•4h ago
Do you think approaching the way typescript does it for Bolt is a reasonable compromise here? Bolt already supports full-module renames like

    import math as not_math
So supporting something along the lines of

    import abs as absolute, sqrt as square_root from math
Would be farily simple to accomplish.
pepa65•1h ago
Or: `import math with abs as absolute, sqrt as square_root`
bbkane•4h ago
I really like the way Elm does it, from "wide" (package) to "narrow" (symbol). I suspect this also helps language server implementation.

See https://guide.elm-lang.org/webapps/modules (scroll down to "Using Modules") for examples

jasonjmcghee•4h ago
Also autocomplete.

Though I almost never manually type out imports manually anymore.

vhodges•2h ago
According to the Programming Guide, it supports aliases for imports

"In case of conflict or convenience, you can give modules an alias as well."

Fraterkes•4h ago
Really cool! Roughly how much memory does it take to include it in an engine? Also I'm really interested in the process of creating these really fast scripting languages, have you written anything about how you wrote Bolt?
beariish•4h ago
Bolt's memory usage in most cases hovers right around Lua 5.4/Luau in my own testing, but maybe I should include a few memory benchmarks to highlight that more. It does notably have a higher memory overhead during compilation than other languages in this class though.

As for writeups, I'm working on putting out some material about the creation of Bolt and my learnings now that it's out there.

Forgret•4h ago
It looks cool, I wish you luck in developing the language. I liked your language and I hope it becomes popular someday.
freeopinion•4h ago
I see your benchmarks compare against other interpreted languages "in its class".

We read here a couple days ago about Q which is compiled. Bolt claims to "plow through code at over 500kloc/thread/second". Q claims to compile in milliseconds--so fast that you can treat it like a script.

Bolt and Q are both newborns. Perhaps you could include each other in your benchmarks to give each other a little publicity.

k__•3h ago
Awesome.

Is it deterministic like Lua?

astatine•3h ago
This looks awesome. Would you have any data on the performance of large number of invocations of small scripts? I am wondering at startup overhead for every script run. which the 500kloc/s may not capture well.
beariish•2h ago
It depends on your exact usecase, I'm not 100% sure what you're asking. There is some overhead for invoking the compiler on a per-script basis. If you're parsing once but running a script many times, Bolt provides some tools (like reusing a preallocated thread object) to ammortize that cost
astatine•2h ago
We have a server which uses Lua based script plugins. They are usually a few hundred to a few thousand lines and get invoked via APIs. I was trying to figure out how Bolt will behave in such a context and whether we could replace the Lua based plugin engine with this.
memophysic•2h ago
Looks great, I'm especially a fan of the more C and Python syntax. Lua works, but its syntax has always been bugging me.

On the feature side, is there any support for breakpoints or a debugging server, and if not is it planned?

beariish•2h ago
There's nothing like that right now, but it's absolutely something I want to explore in the future.
tayistay•2h ago
Congrats! I think this could be quite useful for me.

I noticed that `let`-declared variables seem to be mutable. I'd strongly recommend against that. Add a `var` keyword.

merksoftworks•2h ago
This is really cool but it's not portable to MacOs or aarm64 yet, and that kind of portability unfortunately is what appeals to me about an embeddable scripting language.
JonChesterfield•1h ago
Outperforming languages in its class is doing some heavy lifting here. Missing comparison to wasm interpreter, any of the java or dot net interpreters, the MLs, any lisps etc.

Compile to register bytecode is legitimate as a strategy but its not the fast one, as the author knows, so probably shouldn't be branding the language as fast at this point.

It might be a fast language. Hard to tell from a superficial look, depends on how the type system, alias analysis and concurrency models interact. It's not a fast implementation at this point.

> This means functions do not need to dynamically capture their imports, avoiding closure invocations, and are able to linearly address them in the import array instead of making some kind of environment lookup.

That is suspect, could be burning function identifiers into the bytecode directly, not emitting lookups in a table.

Likewise the switch on the end of each instruction is probably the wrong thing, take a look at a function per op, forced tailcalls, with the interpreter state in the argument registers of the machine function call. There's some good notes on that from some wasm interpreters, and some context on why from luajit if you go looking.

phire•24m ago
The class is "embeddable interpreted scripting language", which is not quite the same thing as just an interpreter.

Embedded interpreters are that designed to be embedded into a c/c++ program (often a game) as a scripting language. They typically have as few dependencies as possible, try to be lightweight and focus on making it really easy to interopt between contexts.

The comparison hits many of the major languages for this usecase. Though it probably should have included mono's interpreter mode, even if nobody really uses it since mono got AoT

conaclos•1h ago
I was quite excited by the description and then I noted that Bolt heavily relies on double floating point numbers. I am quite disappointed because this doesn't allow me to use Bolt in my context: embedded systems where floating point numbers are rarely supported... So I realized that I misinterpreted `embedded`.

Compiling a Lisp: Lambda Lifting

https://bernsteinbear.com/blog/compiling-a-lisp-12/
53•azhenley•3h ago•4 comments

Show HN: Reactive: A React Book for the Reluctant – a book written by Claude

https://github.com/cloudstreet-dev/React-is-Awful
16•DavidCanHelp•55m ago•12 comments

Try and

https://ygdp.yale.edu/phenomena/try-and
415•treetalker•12h ago•218 comments

GPT-OSS vs. Qwen3 and a detailed look how things evolved since GPT-2

https://magazine.sebastianraschka.com/p/from-gpt-2-to-gpt-oss-analyzing-the
299•ModelForge•10h ago•56 comments

1910: The year the modern world lost its mind

https://www.derekthompson.org/p/1910-the-year-the-modern-world-lost
180•purgator•4h ago•136 comments

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

https://github.com/Beariish/bolt
139•beariish•7h ago•47 comments

Fight Chat Control

https://fightchatcontrol.eu/
794•tokai•8h ago•228 comments

Show HN: Engineering.fyi – Search across tech engineering blogs in one place

https://engineering.fyi/
280•indiehackerman•11h ago•73 comments

One Million Screenshots

https://onemillionscreenshots.com/?q=random
120•gaws•5h ago•45 comments

Diffusion language models are super data learners

https://jinjieni.notion.site/Diffusion-Language-Models-are-Super-Data-Learners-239d8f03a866800ab196e49928c019ac
140•babelfish•9h ago•10 comments

PHP compile time generics: yay or nay?

https://thephp.foundation/blog/2025/08/05/compile-generics/
46•moebrowne•3d ago•14 comments

Creating the Longest Possible Ski Jump in “The Games: Winter Challenge”

https://mrwint.github.io/winter/writeup/writeup2.html
100•alberto-m•3d ago•4 comments

Show HN: A Sinclair ZX81 retro web assembler+simulator

3•andromaton•56m ago•0 comments

Battery charge limiter for Apple Silicon MacBook devices

https://github.com/actuallymentor/battery
42•rahimnathwani•3d ago•30 comments

Reflections on Soviet Amateur Photography

https://www.publicbooks.org/strangers-in-the-family-album-reflections-on-soviet-amateur-photography/
21•prismatic•3d ago•2 comments

Booting 5000 Erlangs on Ampere One 192-core

https://underjord.io/booting-5000-erlangs-on-ampere-one.html
175•ingve•13h ago•29 comments

Squashing my dumb bugs and why I log build IDs

https://rachelbythebay.com/w/2025/08/03/scope/
10•wglb•3d ago•0 comments

Writing simple tab-completions for Bash and Zsh

https://mill-build.org/blog/14-bash-zsh-completion.html
217•lihaoyi•15h ago•70 comments

How I code with AI on a budget/free

https://wuu73.org/blog/aiguide1.html
563•indigodaddy•1d ago•188 comments

Abogen – Generate audiobooks from EPUBs, PDFs and text

https://github.com/denizsafak/abogen
277•mzehrer•19h ago•66 comments

Conversations remotely detected from cell phone vibrations, researchers report

https://www.psu.edu/news/engineering/story/conversations-remotely-detected-cell-phone-vibrations-researchers-report
29•giuliomagnifico•7h ago•4 comments

Type (YC W23) is hiring a founding engineer to build an AI-native doc editor

https://www.ycombinator.com/companies/type/jobs/1idOunL-founding-product-engineer
1•stewfortier•8h ago

Events

https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/Events
31•aanthonymax•5h ago•12 comments

ECScape: Understanding IAM Privilege Boundaries in Amazon ECS

https://www.sweet.security/blog/ecscape-understanding-iam-privilege-boundaries-in-amazon-ecs
12•eyberg•4d ago•4 comments

My Dream Productivity Device Is Done – and It's Becoming a Kit [video]

https://www.youtube.com/watch?v=pf3BxNq1cp4
47•surprisetalk•4d ago•38 comments

Inside OS/2 (1987)

https://gitpi.us/article-archive/inside-os2/
101•rbanffy•12h ago•47 comments

Open Lovable

https://github.com/mendableai/open-lovable
141•iamflimflam1•15h ago•42 comments

Abusing Entra OAuth for fun and access to internal Microsoft applications

https://research.eye.security/consent-and-compromise/
328•the1bernard•1d ago•98 comments

Flintlock – Create and manage the lifecycle of MicroVMs, backed by containerd

https://github.com/liquidmetal-dev/flintlock
67•Palmik•10h ago•3 comments

The Framework Desktop is a beast

https://world.hey.com/dhh/the-framework-desktop-is-a-beast-636fb4ff
413•lemonberry•2d ago•383 comments