1,277 karma · joined Jun 15, 2013 (13y ago) · 309 submissions
comment 1w ago · link · parent
[1] https://github.com/scala-js/scala-js/issues?q=is%3Aissue+sta...
comment 3w ago · link · parent
I can't help but do a shameless plug for another recent result in that space: we developed fast algorithms for 64-bit integer divisions (by constants and non-constants) for JavaScript, where you don't even have 64-bit integers to start with. Paper [1] and slides [2] available. The Scala.js compiler uses all of that. The Kotlin/JS compiler recently accepted my PR for the non-constant divisors algorithms.
[1] https://arith2026.org/papers/64-bit%20Integer%20Division%20f...
comment 2mo ago · link · parent
I do not have perfect pitch, but I could always do what GP's kid does. I am now a pretty good amateur singer.
What matters for this is learning to read the music notation and developing a sense (mostly subconscious) of scales and harmony. Perfect pitch does not help either of those things.
comment 2mo ago · link · parent
TFA claims it's "new" in 2026, but the current state of the art seems to still be that of 2022.
I bought actual dice like these in 2024 from https://mathsgear.co.uk/collections/dice/products/go-first-d...
So well, is TFA just a big pile of slop?
comment 3mo ago · link · parent
comment 4mo ago · link · parent
[1] https://arith2026.org/program.html (2nd keynote)
comment 7mo ago · link · parent
Technically its type inference is not HM but it's as expressive. In particular it has GADTs and HKTs, which I saw in your docs.
I wonder what you feel is missing from Scala (its .js/Wasm version) that Lumina provides?
comment 7mo ago · link · parent
comment 7mo ago · link · parent
Compiler engineers for mostly linear-memory languages tend to only think in terms of SSA, and assume it's the only reasonable way to perform optimizations. That transpires in this particular article: the only difference between an AST and what they call IR is that the latter is SSA-based. So it's like for them something that's not SSA is not a "serious" data structure in which you can perform optimizations, i.e., it can't be an IR.
On the other side, you actually have a bunch of languages, typically GC-based for some reason, whose compilers use expression-based structures. Either in the form of an AST or stack-based IR. These compilers don't lack any optimization opportunities compared to SSA-based ones. However it often happens that compiler authors for those (I am one of them) don't always realize all the optimization set that SSA compilers do, although they could very well be applied in their AST/stack-based IR as well.
comment 10mo ago · link · parent
We do still maintain this code, although it is deprecated now.
Even with the unrolled tests, we would still keep the table for the decoding operation, I believe. But it's true that it would at the same time provide the normalized value. That could be beneficial.
comment 10mo ago · link · parent
We have one loop: a binary search in the table of powers of 2 for the double-to-bits conversion. It has a fixed number of iterations. I had tried to unroll it, but that did not perform any better.
I'll have to dig more to understand how they got rid of the comparisons, though.
I wonder whether their implementation would be faster than ours. At the time I wrote our conversions, they beat every previous implementation I was aware of hands down.
[1] https://github.com/scala-js/scala-js/blob/v1.20.2/linker-pri...
comment 1y ago · link · parent
It's bad practice to make DSLs left and right, obviously. But when one is warranted, you can.
For example here you could have
"x" --> "y" | "hello world"comment 1y ago · link · parent
comment 1y ago · link · parent
Also, this is the last remaining major system-dependent default in Java. They made strict floating point the default in 17; UTF-8 the default encoding some versions later (21?); only the locale remains. I hope they make ROOT the default in an upcoming version.
FWIW, in the Scala.js implementation, we've been using UTF-8 and ROOT as the defaults forever.
comment 1y ago · link · parent
comment 1y ago · link · parent
Usage of Scala itself is less shiny if you look at market share. But I believe it's still growing in absolute numbers, only quite slowly.
comment 1y ago · link · parent
The good news is that we can still write our Scala `val`s and `var`s (`const` and `let`) in the source code, enjoying good scoping and good performance.
comment 1y ago · link · parent
So from my anecdotal perspective, explanations based on previous experience make no sense. It had to be something more innate, more related to how our brains are "wired".
Some people invert Y but not X. This is the most surprising to me. Most I've seen invert both. I don't remember having seen someone invert X but not Y.
Personally I invert both, except for games with a mouse to aim (like 3rd person shooters). In that case I invert neither. Go figure.
comment 1y ago · link · parent
comment 1y ago · link · parent
In our compiler (featured in TFA), we chose to define our own data structure for an abstract representation of Wasm. We then wrote two emitters: one to .wasm (the default, for speed), and one to .wat (to debug our compiler when we get it wrong). It was pretty straightforward, so I think the instruction set is quite nice. [1]
[1] https://github.com/scala-js/scala-js/tree/main/linker/shared...
comment 1y ago · link · parent
Scala uses Maven repositories (where the common practice is to use fixed dependency versions) but with different resolution rules:
* When there are conflicting transitive versions, the highest number prevails (not the closest to the root).
* Artifacts declare the versioning scheme they use (SemVer is common, but there are others)
* When resolving a conflict, the resolution checks whether the chosen version is compatible with the evicted version according to the declared version scheme. If incompatible, an error is reported.
* You can manually override a transitive resolution and bypass the error if you need to.
The above has all the advantages of all the approaches advocated for here:
* Deterministic, time-independent resolution.
* No need for lock files.
* No silent eviction of a version in favor of an incompatible one.
* For compatible evictions, everything works out of the box.
* Security update in a transitive dependency? No problem, declare a dependency on the new version. (We have bots that even automatically send PRs for this.)
* Conflicting dependencies, but you know what you're doing? No problem, force an override.