Live data from Hacker News

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

github.com

21–30 of 98 posts

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

#21

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... Unfortun…

I see lua, do you know terralang?

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

#22

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…

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.

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

#24

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?

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.

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

#26
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.

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

#27

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 e…

Oh, not OP, but I love Koka. I should play around with it again thanks for reminding me!

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

#28

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…

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

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

#29

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…

Also autocomplete.

Though I almost never manually type out imports manually anymore.

Post reply on HN