Live data from Hacker News

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

github.com

71–80 of 98 posts

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

#71

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.

Why?

Put the category first so it makes it easy to skim and sort dependencies. You're never going to organise your dependencies based on what the individual functions, types or sub-packages are called, and sorting based on something that ends up in a more or less random place at the end of a line just seems obtuse.

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

#73
I don't understand why people still choose the syntax `import xxx from yyy` in the current year. It is a major source of complaining for languages like python or javascript, because it makes autocomplete does not work well.

make me instantly lost interest in the language.

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

#74

Run some examples, and it looks like this "High-performance, real-time optimized, super-fast" language is ~ 10 times slower than luajit ~ 3 times slower than lua 5.4

With this and https://github.com/Beariish/bolt/blob/main/doc/Bolt%20Perfor... , it is indeed confusing without testing it out myself. That said, somehow I do not believe it is faster than LuaJIT. We will see.

I used brainfuck interpreter https://github.com/Beariish/bolt/blob/main/examples/bf.bolt vs lua / luajit implementations from https://github.com/kostya/benchmarks

Just checked with nbody:

  - still 10 times slower than luajit
  - 2 times slower than luajit -joff
  - but 20% faster than lua 5.4
  - but uses 47 Mb RAM vs 2.5 Mb for lua/luajit

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

#75
Super cool! Just now I am building something where I am trying to use mlua to make it scriptable with Lua. But the biggest pain point right now is trying to generate type annotations for LuaLS based on my rust structs. I will look into whether bolt could be interesting for the project.

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

#76

Run some examples, and it looks like this "High-performance, real-time optimized, super-fast" language is ~ 10 times slower than luajit ~ 3 times slower than lua 5.4

Not bad for version 0.1.0. lua(jit) is no slowpoke and has had decades of performance improvements.

[deleted]

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

#77

Earlier quoted context omitted.

With this and https://github.com/Beariish/bolt/blob/main/doc/Bolt%20Perfor... , it is indeed confusing without testing it out myself. That said, somehow I do not believe it is faster than LuaJIT. We will see.

I used brainfuck interpreter https://github.com/Beariish/bolt/blob/main/examples/bf.bolt vs lua / luajit implementations from https://github.com/kostya/benchmarks Just checked with nbody: - still 10 times slower than luajit - 2 times slower than luajit -joff - but 20% faster than lua 5.4 - but uses 47 Mb RAM vs 2.5 Mb for lua/luajit

I appreciate the followup here. The brainfuck interpreter isn't meant to be a benchmark notably, it's a naive implementation for the sake of the example.

I did spot some poor code in the Bolt version of nbody that can be changed (the usage of `.each()` in the hot loop is creating loads of temporary iterators, that's the memory difference.)

luajit -joff does perform better even with this change, but I observe closer to 15% than a 2x difference

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

#78
post #52

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`.

Same here! It's very cool but my ideal use case would be on a limited ISA architecture like ESP32.

Bolt doesn’t support ARM or RISC. There’s some comments above re: the confusion with the term “embedded” and “real time”.

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

#79
post #73

I don't understand why people still choose the syntax `import xxx from yyy` in the current year. It is a major source of complaining for languages like python or javascript, because it makes autocomplete does not work well. make me instantly lost interest in the language.

Two potential suggestions:

1. Ask - the author is very much available, right here in this comment section they made specifically for such a prospect. 2. Contribute - Code the change you wish to see in the world. Follow the OP’s example, and do something about it.

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

#80
Very cute language ..

     match x {
        is table {
            print(indent_this + "{")
            for pair in pairs(x) {
                write(indent + "   " + to_string(pair.key) + ": ") 
                pretty_print_internal(pair.value, indent + "   ", false)
            }
            print(indent + "}")
        }
.. okay, you got my attention (long-time Lua fan) .. will have to give this some workbench time and learn it ..
Post reply on HN