Live data from Hacker News

Hello wasm-pack

hacks.mozilla.org

21–30 of 160 posts

Re: Hello wasm-pack

#21

> As Lin Clark emphasizes in her article about Rust and WebAssembly: the goal of WebAssembly is not to replace JavaScript, but to be an awesome tool to use with JavaScript. Please no. JavaScript's a bit cancerous - we should be erring away from it rather than encouraging it.

What makes you say so? JavaScript in itself is not a bad language at all, and many programmers genuinely like it.

What I take issue with is the lack of options in a critical domain and our complacency with that.

Maybe we won't replace Javascript, but we should definitely have more language options client-side that don't require Javascript-glue to interface with the DOM.

Re: Hello wasm-pack

#22
post #13

Earlier quoted context omitted.

If you find yourself typing something about "the type of programmers attracted to X language" just delete what you wrote and move on. JavaScript isn't going anywhere. End-users don't care about executing "non optimal code."

> If you find yourself typing something about "the type of programmers attracted to X language" just delete what you wrote and move on. I wouldn't say that's the right way to go about it or to think, especially in the case of JavaScript - more than ever, it's being taken up by people with no passion or desire to program solely so they can make what they think is going to be "The Next [WebCompany]," it's something tha…

> more than ever, it's being taken up by people with no passion or desire to program solely so they can make what they think is going to be "The Next [WebCompany],"

See, that's why you were encouraged to stop before you dug yourself deeper. Now you've doubled down on disparaging an entire class of people based on their choice of programming language because of some assumed greed you think they think they have.

Perhaps people are taking up Javascript because it is, bar none, the easiest language to play around with. Every modern computer either ships with a browser installed, and the vast majority of them, excluding mobile platforms, allow for someone to easily open a Javascript development environment not just to start something new, but to tinker around with the web page they are looking at.

Of course there will be horrible and crappy Javascript programs and libraries released to the wild. That's the same whenever there's a large influx or new people to the programming ecosystem and a language that's fairly easy to use but has some edge cases. Just look at Perl, and the CGIs of the late 1990's and early 2000's. A very large part of Perl's current reputation is because of people that weren't the best programmers (because they were new) being able to whip out little programs to do what they want, but also not entirely understanding some of the deeper intricacies of Perl or some better programming practices in general.

Re: Hello wasm-pack

#23

>> the goal of WebAssembly is not to replace JavaScript, but to be an awesome tool to use with JavaScript. Let's hope exactly the other way around will happen. I would rather like to see better interop between different languages using wasm than wasm + js.

I think that misses the point. Since WASM is a compile target you don't need JS to achieve interop between different languages if they are all compiled to WASM. The JS + WASM combo is to do things that WASM container cannot do on its own.

Re: Hello wasm-pack

#24

Earlier quoted context omitted.

What’s the binary size like? One interesting thing about wasm is the difference between libraries and apps; Rust’s small binary size here can make it useful for this infrastructure work, but for languages that need to bring along the runtime, it’s much more complex. This is one reason why we’re pursuing stuff like wasm-pack. I’m glad to see more and more languages compiling to wasm though! Exciting times.

The original Blazer was based on the DotNetAnywhere runtime and the binary size was actually very reasonable. Now that they're using the Mono runtime it's significantly larger and it seems their main task now is finding ways to remove unused code from that runtime to get it back to reasonable.

[deleted]

Re: Hello wasm-pack

#25
post #2

It's great to see WASM taking off! In this context, see also Blazor, which runs C#/.NET code on WASM. https://github.com/aspnet/blazor

It should be noted, I believe this is currently more of an interpreter than AOT-compiled like LLVM bitcode is. Mono is compiled via WASM that then interprets CIL DLLs.

Re: Hello wasm-pack

#26

I cant help but think of the post about stealing password credentials from the site you build by surreptitiously inserting extra code into the published NPM package. Except wasm packages seem like they'd be even harder to detect. https://hackernoon.com/im-harvesting-credit-card-numbers-and...

I have a package on NPM which is only partially implemented, using it in a production app is a bad idea, a quick glance at the source code or the todo section of the readme makes it pretty obvious. I still gets bug reports and npm says it has hundreds of download every month.

For anything serious, read the source code, at the very least check your dependencies.

Re: Hello wasm-pack

#27
post #2

It's great to see WASM taking off! In this context, see also Blazor, which runs C#/.NET code on WASM. https://github.com/aspnet/blazor

What’s the binary size like? One interesting thing about wasm is the difference between libraries and apps; Rust’s small binary size here can make it useful for this infrastructure work, but for languages that need to bring along the runtime, it’s much more complex. This is one reason why we’re pursuing stuff like wasm-pack. I’m glad to see more and more languages compiling to wasm though! Exciting times.

> What’s the binary size like?

I asked this same question[0]. Appears mono.js is 166kb in release mode, but it downloads/uses the DLLs directly as a system would, so those sizes are the same as they are for desktop apps (not sure off the top of my head what that is for ASP.Net stuff or the stdlib).

0 - https://github.com/mono/mono/issues/7820

Re: Hello wasm-pack

#28
I'm kind of curious how wasm is going to work out. It seems only logical that wasm interpreters will be optimizing JITs. Wasm will essentially be an intermediate language similar to JVM bytecode.

At that point why not just use the JVM stripped of the useless stuff as a base and add the remaining small pieces that might be needed. Or Graal.

I guess I don't understand what Wasm is doing that is so much different that couldn't be handled with other more advanced code bases.

Re: Hello wasm-pack

#29

I cant help but think of the post about stealing password credentials from the site you build by surreptitiously inserting extra code into the published NPM package. Except wasm packages seem like they'd be even harder to detect. https://hackernoon.com/im-harvesting-credit-card-numbers-and...

I have a package on NPM which is only partially implemented, using it in a production app is a bad idea, a quick glance at the source code or the todo section of the readme makes it pretty obvious. I still gets bug reports and npm says it has hundreds of download every month. For anything serious, read the source code, at the very least check your dependencies.

fwiw as a former npm registry engineer i can tell u that "hundreds of download every month" likely is a result of the background bot activity npm gets. but your advice is sound! definitely vet your deps before you use them! and YES! read the source.

Re: Hello wasm-pack

#30
post #22

Earlier quoted context omitted.

> If you find yourself typing something about "the type of programmers attracted to X language" just delete what you wrote and move on. I wouldn't say that's the right way to go about it or to think, especially in the case of JavaScript - more than ever, it's being taken up by people with no passion or desire to program solely so they can make what they think is going to be "The Next [WebCompany]," it's something tha…

> more than ever, it's being taken up by people with no passion or desire to program solely so they can make what they think is going to be "The Next [WebCompany]," See, that's why you were encouraged to stop before you dug yourself deeper. Now you've doubled down on disparaging an entire class of people based on their choice of programming language because of some assumed greed you think they think they have. Perhap…

A great comment, and I couldn't agree more. If the family computer in the early 90s didn't have QBasic - I wouldn't be a developer today.

> more than ever, it's being taken up by people with no passion or desire to program solely so they can make what they think is going to be "The Next [WebCompany],"

I feel like kbenson forgets that the point of programming to the vast majority of people, is typically the end result.

Post reply on HN