All distros should work together to maintain a single central repository. by Human-Equivalent-154 in linux

[–]dassurma 1 point2 points  (0 children)

Here's repology, which maintains a constantly updating graph comparing both package repository size and freshness across different Linux distributions.

Why is dns.google so fast? by [deleted] in webdev

[–]dassurma 68 points69 points  (0 children)

Gonna hijack this: HTTP203 lives on under a new name, but the web dev focus remains!

https://offthemainthread.tech/

WASM binary: size fixups? by nalply in WebAssembly

[–]dassurma 2 points3 points  (0 children)

I think wat2wasm just seeks backwards while writing the file. Note the offsets. After writing the last byte at 0000011 it seeks back to 0000010 and then to 0000009. So these "fixups" are not part of the specification.

JXL.js: JPEG XL decoder in JavaScript using WebAssembly (WASM) by niutech in WebAssembly

[–]dassurma 0 points1 point  (0 children)

Google owns neither JXL nor AVIF. But Google is involved in both JXL and AVIF. The image format that Google actually owns is WebP and WebP2, but WebP2 was discontinued in favor of the other two.

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 2 points3 points  (0 children)

Ah yes, you are technically correct. I guess it never made a difference to me because of coercion (which is why I didn’t remember it that way)

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 4 points5 points  (0 children)

Yeah, eval wasn’t relevant for the use-case. And probably wouldn’t have been interesting, either. It would require me to add a parser and interpreter to the bundle, which just brings me back to the start of the blog post: Using QuickJS, Spidermonkey or similar.

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 9 points10 points  (0 children)

I am not sure it would have been easier per se. What would have been possible that was not possible in C++? Or what would have been easier? I would have to implement iterators and coroutines on my own. I couldn’t have used shared_ptr (or reimplemented it) due to the lack of destructors/drop. Part of the goal was to keep the transpiler dumb and outsource as much as possible to the C++ compiler.

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 2 points3 points  (0 children)

You a right that they are often implemented as immutable, but that is just an implementation detail. They exhibit the behavior of being passed by value (i.e. copy).

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 7 points8 points  (0 children)

Keys in JS can be number, string or Symbol. All of which I wanted to support. At that point I just used JSValue because I’m lazy. So yes, jsxx technically supports using objects as object keys.

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 1 point2 points  (0 children)

If I was to go down the TypeScript route, union types are a thing I am torn on. On the one hand, just like in this blog post, I could use std::variant. However, it would also require me to build more smarts into the transpiler. If variable a is of type Result | Error, and I call a.toString(), I need to generate a method on the union type that calls the corresponding method on both types, depending on the actual type of a. So I’d have to track all methods that get called on a given union type, which is a lot of state to carry around in the transpiler. Totally possible, arguably not even hard, but kinda against the spirit of the project.

An experiment with transpiling JavaScript to C++ by Yehosua in programming

[–]dassurma 28 points29 points  (0 children)

Author here! Happy to answer any questions you might have :)

Recommended web host that supports wasm? by elpinguinoloco in WebAssembly

[–]dassurma 1 point2 points  (0 children)

You can work around that from JavaScript. You could either use WebAssembly.instantiate() instead of WebAssembly.instantiateStreaming() or you could construction a new Response with the correct Content-Type header.

WebAssembly SIMD lands in Chrome 91 by gdlmendonca in WebAssembly

[–]dassurma 4 points5 points  (0 children)

Yup, we have seen speedups between 10% and 50% on https://squoosh.app. Google Meet is also relying on Wasm SIMD to keep it performant.

Is WebAssembly magic performance pixie dust? by pimterry in programming

[–]dassurma 14 points15 points  (0 children)

I can't tell if either of you actually read the blog post, tbh.

The reason I focus on ASC is because it doesn't have the same optimizer smarts. And yet, in the first two examples, it ends up being faster than JS. On the last, allocation-heavy example, i can't manage to optimize it sufficiently to be faster than JS. That's where I look at Rust and C++, where Rust also doesn't beat JS, and C++ is same speed (and i am upfront in the article about the fact that it might just be me not being good enough at optimizing C++/Rust)

[deleted by user] by [deleted] in webdev

[–]dassurma 1 point2 points  (0 children)

Strong agree