News for hackers. Stuff that matters.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by artagnon on Tuesday September 29, 2020 @08:24AM (#24626833)
It's a simple command-line application that dispatches to the quickjs runtime. The headline is somewhat misleading.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by Complexicate on Tuesday September 29, 2020 @08:59AM (#24627191)
Let it go. Let it go. Misleading titles never bothered HN anyway.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by omarhaneef on Tuesday September 29, 2020 @09:47AM (#24627741)
I didn’t get the connection before your joke, but I think it is called Elsa exactly because it is written in Go!

(This happens to me Olaf the time)

Re:Show HN: Elsa – A QuickJS wrapper written in Go by cheph on Tuesday September 29, 2020 @09:16AM (#24627399)
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.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by hn_throwaway_99 on Tuesday September 29, 2020 @09:22AM (#24627470)
It was a joke based on a song from Frozen.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by codetrotter on Tuesday September 29, 2020 @09:32AM (#24627585)
Speaking of which:

https://youtu.be/LJvEIjRBSDA

Also, it’s weird how time flies. It’s been almost 6 years already since they made the version of the song in the video here linked, but it feels like just yesterday that I saw it.

Re:Show HN: Elsa – A QuickJS wrapper written in Go by cheph on Wednesday September 30, 2020 @02:55AM (#24636299)
Wow, what an amazingly effective way to make me never hear another word of golang ever again.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by gwbas1c on Tuesday September 29, 2020 @09:29AM (#24627555)
I've listened to that song so many times and I still didn't get the joke!
Re:Show HN: Elsa – A QuickJS wrapper written in Go by sigzero on Tuesday September 29, 2020 @09:00AM (#24627201)
I wish I could upvote you more than once!
Re:Show HN: Elsa – A QuickJS wrapper written in Go by jeswin on Tuesday September 29, 2020 @09:33AM (#24627595)
The headline I believe was chosen by OP. What leaves a bad taste in my mouth is that the team thought it unnecessary to credit QuickJS and Bellard anywhere in the README file - and making it seem like original work.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by DetroitThrow on Tuesday September 29, 2020 @09:36AM (#24627637)
Between this, what the "runtime" is currently capable of, and the benchmarks shown, I feel like this is a really poor example of a Show HN project and at best unintentionally misled me about several things...
Re:Show HN: Elsa – A QuickJS wrapper written in Go by qu4k on Tuesday September 29, 2020 @09:40AM (#24627663)
Thanks for pointing this out. Bellard deserves most of the credits. I updated the description accordingly.
Re:Show HN: Elsa – A QuickJS wrapper written in Go by ballenf on Tuesday September 29, 2020 @09:41AM (#24627669)
I'm really curious how this reached #1 here on HN. Not accusing anyone of foul play, just really curious why this is so popular.

As for quickJS, I've really enjoyed using it and was surprised how easy it was to get started with a brew install on a Mac.

Re:Show HN: Elsa – A QuickJS wrapper written in Go by DetroitThrow on Tuesday September 29, 2020 @09:48AM (#24627756)
>I'm really curious how this reached #1 here on HN

I was initially excited about the idea of a Go alternative to some existing js runtimes.

Re:Show HN: Elsa – A QuickJS wrapper written in Go by untog on Tuesday September 29, 2020 @09:44AM (#24627700)
> I'm really curious how this reached #1 here on HN.

Usually people submit then direct friends/contacts/Twitter followers/etc to the "new" page to upvote. "growth hacking"? :)

Re:Show HN: Elsa – A QuickJS wrapper written in Go by seg_lol on Tuesday September 29, 2020 @09:10AM (#24627335)
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 by randomdata on Tuesday September 29, 2020 @11:28AM (#24628984)
> Go folks couldn't contribute to Deno since it is in Rust

Deno was originally written in Go, until V8's GC was getting in the way of Go's GC, so they could always work on early versions of Deno, if they are willing to accept the problems with V8 that pushed the project to Rust.