Live data from Hacker News

Show HN: Elsa – A QuickJS wrapper written in Go

github.com

21–30 of 69 posts

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#22
post #4

It's a simple command-line application that dispatches to the quickjs runtime. The headline is somewhat misleading.

Let it go. Let it go. Misleading titles never bothered HN anyway.

I wish I could upvote you more than once!

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#24
post #20
post #5

Earlier quoted context omitted.

Ofcourse; Deno is V8-based, which is a lot more full-featured than quickjs. Perhaps this is a more informative benchmark: https://bellard.org/quickjs/bench.html

Wow,, this is seriously bad. Calling this fast is very misleading. QuickJS is about 0.5x as fast as V8 without JIT (and like 20x slower than V8+JIT).

True for these benchmarks, but other than regex, most aren't what one would typically be doing with it.

It would be nice if one of the benchmarks was more reflective of typical use.

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#25
post #20
post #5

Earlier quoted context omitted.

Ofcourse; Deno is V8-based, which is a lot more full-featured than quickjs. Perhaps this is a more informative benchmark: https://bellard.org/quickjs/bench.html

Wow,, this is seriously bad. Calling this fast is very misleading. QuickJS is about 0.5x as fast as V8 without JIT (and like 20x slower than V8+JIT).

That a rocket is two orders of magnitude faster than a jetliner doesn't make a jetliner not fast.

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#26
post #4

It's a simple command-line application that dispatches to the quickjs runtime. The headline is somewhat misleading.

I don't think so, it is clearly a Deno competitor in name and spirit. My first thought was around how languages allow us to choose our tribe and that Go folks couldn't contribute to Deno since it is in Rust, hence Elsa, maybe they were getting Frozen out? Or Deno is the Dinosaur and Elsa is the ice age that kills them? Who knows, ;)

I had forgotten that Fabrice Bellard also made one of his signature hacks around JavaScript [1]. This thing is amazing and he created a nicely written and formatted pdf, absolutely lovely.

Then I started doing a simple comparison of the two code bases

    (py38.env) zc:deno seanj$ tokei 
    -------------------------------------------------------------------------------
    Language            Files        Lines         Code     Comments       Blanks
    -------------------------------------------------------------------------------
    JavaScript            169       168797       146555        19948         2294
    Markdown               89        10716        10716            0            0
    Rust                  101        42996        36525         2272         4199
    TypeScript            668       117796        85786        20609        11401
    -------------------------------------------------------------------------------
    Total                1119       342851       281567        43027        18257
    -------------------------------------------------------------------------------
    (py38.env) zc:elsa seanj$ tokei 
    -------------------------------------------------------------------------------
    Language            Files        Lines         Code     Comments       Blanks
    -------------------------------------------------------------------------------
    Go                     26         1143          949           21          173
    JavaScript             31       146438       127418        18927           93
    TypeScript              6         4450         1080         2823          547
    -------------------------------------------------------------------------------
    Total                  72       153059       130470        21774          815
    -------------------------------------------------------------------------------
The JS portions feel similar (spoiler, same TS runtime) and that Deno has documentation and probably a lot more tests.

Here is the a breakdown of the test code in each.

    # kept top-k entries after $find . -type f -not -ipath "*test*" -exec rm -f {} \;
    (py38.env) zircon:deno_t seanj$ tokei 
    -------------------------------------------------------------------------------
    Language            Files        Lines         Code     Comments       Blanks
    -------------------------------------------------------------------------------
    JavaScript            107         2991         2564          151          276
    Rust                    6         5166         4476          141          549
    TypeScript            420        40449        34436         1872         4141
    -------------------------------------------------------------------------------
    Total                 614        50564        43246         2219         5099
    -------------------------------------------------------------------------------
    (py38.env) zircon:elsa_t seanj$ tokei 
    -------------------------------------------------------------------------------
    Language            Files        Lines         Code     Comments       Blanks
    -------------------------------------------------------------------------------
    Go                      3           76           64            0           12
    JavaScript             23          137          115            2           20
    Plain Text              1            1            1            0            0
    TypeScript              5           14           11            0            3
    -------------------------------------------------------------------------------
    Total                  32          228          191            2           35
    -------------------------------------------------------------------------------
The JavaScript foot print in both codebases is mostly dominated by the TypeScript runtime and library.

    (py38.env) zc:deno seanj$ find . -name "*typescript*js" -exec tokei {} \;
    -------------------------------------------------------------------------------
    Language            Files        Lines         Code     Comments       Blanks
    -------------------------------------------------------------------------------
    JavaScript              1       147419       128513        18894           12
    -------------------------------------------------------------------------------
    Total                   1       147419       128513        18894           12
    -------------------------------------------------------------------------------
    (py38.env) zc:elsa_js seanj$ find . -name "*typescript*js" -exec tokei {} \;
    -------------------------------------------------------------------------------
    Language            Files        Lines         Code     Comments       Blanks
    -------------------------------------------------------------------------------
    JavaScript              1       145671       126934        18725           12
    -------------------------------------------------------------------------------
    Total                   1       145671       126934        18725           12
    -------------------------------------------------------------------------------
Deno only has 18kloc of js.

[1] https://bellard.org/quickjs/quickjs.pdf

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#27
post #23
post #2

N̶i̶c̶e̶ ̶e̶x̶a̶m̶p̶l̶e̶ ̶o̶f̶ ̶a̶c̶t̶u̶a̶l̶ ̶s̶y̶s̶t̶e̶m̶s̶ ̶p̶r̶o̶g̶r̶a̶m̶i̶n̶g̶.̶

Slightly OT: how'd you type the strikethrough text? I wasn't aware HN supported that.

It doesn't, but does support unicode text, so use just another site and then copy-paste the result here. :)

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#28
post #19

So Elsas own comparison[1] says that the binary size difference is 20MB Elsa (QJS) vs 44MB Deno (V8). Looking at QuickJS benchmark[2] V8 is 28M vs 1M QJS, so Elsa adds 19M on top of the engine vs 16M for Deno. Doesn't feel that lightweight anymore [1] https://github.com/elsaland/elsa/blob/master/COMPARISON.md [2] https://bellard.org/quickjs/bench.html

It is amusing how each of us define our own _lightweight_, for me it is the size and readability of the code. Others it is the magnitude of the executable bytes. To someone else it might mean the startup time, the number of dependencies or the build/test/debug iteration time.

Re: Show HN: Elsa – A QuickJS wrapper written in Go

#29
post #4

It's a simple command-line application that dispatches to the quickjs runtime. The headline is somewhat misleading.

Let it go. Let it go. Misleading titles never bothered HN anyway.

I am quite happy that the topmost comment on a misleading post clarifies it. Clarity is good. So I guess I for one am happy someone did not let it go.
Post reply on HN