Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sunfish
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
sunfish
7y ago
Interface types will make it easy for two modules to interface with each other, regardless of whether both sides use GC, just one side does, or neither side does. And even within GC types, different languages have different ways of represen
32.
▲
by
sunfish
7y ago
The easiest way to get started is to file an issue in the issue tracker at https://github.com/WebAssembly/WASI/issues and we can start discussing it!
33.
▲
by
sunfish
7y ago
WASI is in very early stage right now. We already have a start of a proposal to unify reading/writing from file and network streams. Unifying filesystem paths with URLs is something that's certainly in scope beyond that.
34.
▲
by
sunfish
7y ago
Right now, a lot of it is Cranelift. We haven't yet done much optimization work on Cranelift yet, so there's a lot of room for improvement.
35.
▲
by
sunfish
8y ago
That sentence about pre-opened directory capabilities not being supported is actually outdated. They're supported now, so I've now updated the documentation. Thanks for pointing that out!
36.
▲
by
sunfish
8y ago
One fun thing about the capability model is that at the system call level, there are no absolute paths. All filesystem path references are relative to base directory handles. So even if an application thinks it wants something in C:\stuff,
37.
▲
by
sunfish
8y ago
This tutorial gives an overview of how compatibility with existing portable C code works: https://github.com/CraneStation/wasmtime-wasi/blob/wasi/docs...
38.
▲
by
sunfish
8y ago
It's a good question. WASI currently doesn't allow you to set custom access-control permissions when creating files. But we're just getting started, so if we can find a design that works, we can add it.
39.
▲
by
sunfish
8y ago
"| cat" has this effect.
40.
▲
by
sunfish
8y ago
This is arguably a limitation of C-style for loops. For example, Python: for i in range(0, 256): Rust: for i in 0..256 { and many other languages have similar things. Proper ranges also mean that the compiler never needs to
41.
▲
by
sunfish
8y ago
Indeed, pragmatism is why we don't define success in those terms.
42.
▲
by
sunfish
8y ago
Also, the [bint instruction]( https://cranelift.readthedocs.io/en/latest/ir.html#inst-bint ) converts a bool value to an integer 0 or 1.
43.
▲
by
sunfish
8y ago
Fwiw, "written in Rust" was added by whoever submitted the HN link; the project's own web page and documentation don't describe it like that.
44.
▲
by
sunfish
8y ago
Fortunately, this isn't required for the project to be successful :-).
45.
▲
by
sunfish
8y ago
A typical Rust bool would use `b1`, which doesn't have an observable representation.
46.
▲
by
sunfish
8y ago
It is something we're thinking about. You might have to limit yourself to a subset of the full Cranelift IR for this, but I think we could make that subset big enough to be interesting.
47.
▲
by
sunfish
8y ago
There's a tutorial in development, but it's not finished yet. So right now isn't the optimal time for an HN post, but HN doesn't always ask people before linking to their projects ¯\_(ツ)_/¯.
48.
▲
by
sunfish
8y ago
How did I forget: - forget to #include string.h, so strdup is implicitly declared, so its return type is int, which implicitly converts to char*, so everything still compiles -> possible UB
49.
▲
by
sunfish
8y ago
Yes, that's one of the three CVE's I posted ;). You got me thinking about ways one could get strdup wrong: - input is not a string -> possible UB - input is a string, but the character encoding wasn't what you thought ->
50.
▲
by
sunfish
8y ago
Yet, it happens: https://nvd.nist.gov/vuln/detail/CVE-2017-14064 https://nvd.nist.gov/vuln/detail/CVE-2015-3182 https://nvd.nist.gov/vuln/detail/CVE-2017-13748
51.
▲
by
sunfish
8y ago
Two's complement has the bizarre property of being asymmetric about zero. So things like `abs` can overflow, among several other oddities. It's not unambiguously better.
52.
▲
by
sunfish
9y ago
One cause of this phenomenon is both sides sometimes oversimplifying a complex situation in different directions. When people talk about "C++", they may mean: - "C++ as it theoretically could be in when C++20 or so is used pe
53.
▲
by
sunfish
10y ago
WebAssembly does not currently have an fma instruction, and implementations are not permitted to fold plain multiply+add sequences into fma because that produces different rounding.
54.
▲
by
sunfish
10y ago
IEEE 754 is a standard, and it requires a specific, bitwise-reproducible, answer for the computation in question. I'm the author of most of the floating-point tests in WebAssembly's conformance testsuite, which tests such things i
55.
▲
by
sunfish
10y ago
I think you're both right. The world of software is sufficiently diverse that there is no single answer to this question that works best for everyone in every situation.
56.
▲
by
sunfish
10y ago
It looks like the slowdown on wasm is related to the powi call in the distance function (which the benchmark page mentions as a likely suspect). Emscripten currently compiles @llvm.powi into a JS Math.pow call, however this powi call is jus
57.
▲
by
sunfish
10y ago
There is no "different implementation of IEEE 754" that could give a different result in double precision for that example. There are reasonable criticisms of IEEE 754; that's not the issue.
58.
▲
by
sunfish
10y ago
Out of curiosity, I started watching this talk, but right there in the introduction, the very first example is a dot product where supposedly IEEE 754 double precision gets the wrong answer; I stopped to check the result, and I got the corr
59.
▲
by
sunfish
10y ago
Actually, in LLVM's case it really is just explicitly checking for a few specific bswap patterns rather than doing anything fancy: https://github.com/llvm-mirror/llvm/blob/master/lib/Transfor...
60.
▲
by
sunfish
10y ago
Instead of having everything go through central trusted authorities, as Linux distros do, wasm (as the Web does in general) relies on sandboxing untrusted content on the user side. A binary encoding does not contribute significantly to obfu
More ›