Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sjrd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
151.
▲
by
sjrd
9y ago
Nice article. Although, as always with articles on WebAssembly, it keeps repeating that wasm is faster than JavaScript, without ever mentioning the limitations of wasm wrt. JS (no GC, no interaction with the DOM or with JS libraries besides
152.
▲
by
sjrd
9y ago
If I recall correctly, the state-of-JS survey did not even have an "Other: ____" field for the Flavors category [1]. Which means that people going to the survey had no way to even mention alternative languages. The set of language
153.
▲
by
sjrd
9y ago
It is monadic if the monad laws about it hold. `null` has nothing to do with it. In the context of my unboxed option, `null` is like `5`: one of many primitive values, uninterpreted by the abstraction, and therefore it does not break the a
154.
▲
by
sjrd
9y ago
Oh primitive types do get one level of boxing (on the JVM): a `Double` becomes a `java.lang.Double`. But it doesn't become a `Some` with a `java.lang.Double` inside, so we gained one allocation anyway. It is not possible to remove th
155.
▲
by
sjrd
9y ago
I wrote a zero-allocation `Option`-style (monadic) data structure for Scala a while ago [1]. Unlike all the previous attempts, it supports the distinction between `None`, `Some(None)`, `Some(null)`, `Some(Some(None))`, etc., which is what a
156.
▲
by
sjrd
9y ago
Ah, so you prefer your phone just shutting down unexpectedly when you open your picture-taking app, update the public transportation app to buy a ticket because they updated the server, or exit the metro into the freezing cold of winter? Ri
157.
▲
by
sjrd
9y ago
Publishing Scala.js [1] version 1.0.0 final, obviously. ;) [1] https://www.scala-js.org/
158.
▲
Stopify – An experimental, web-based code editor
(stopify.org)
96 points
by
sjrd
9y ago
|
48 comments
159.
▲
by
sjrd
9y ago
I know precisely why they did this. They did it because IntelliJ cannot cope with a file being part of two different modules. Scala/JVM + Scala.js has been sharing code for almost three years now, and it works perfectly out-of-the-box
160.
▲
by
sjrd
9y ago
Or ... you don't break down ifs, loops and so on into branches to begin with. Scala.js has an optimizing compiler that doesn't do that (and I've heard a bunch of compiler people who were really impressed at the level of opt
161.
▲
by
sjrd
9y ago
As a PL researcher, I disagree with you. JS is a much neater target to compile to than Assembly, for example.
162.
▲
by
sjrd
9y ago
I'm the author of Scala.js, so supposedly a Scala "expert", and I still don't understand category theory. Does that answer the question?
163.
▲
by
sjrd
9y ago
foo(x, -y) is not the same as foo(x -y) (from your last sentence, I assume you were talking about JS in general, not just JSON)
164.
▲
by
sjrd
9y ago
Fair enough. I think TypeScript enjoys some "protection" from the obvious complaints because it advertises itself as (and it is) "just JavaScript", with types. Therefore the complaints I often see about other languages c
165.
▲
by
sjrd
9y ago
My main issue with the term "transpiler" is not its existence per se. It is the effect that its existence has on a large portion of developers, having them reject some kinds of technologies for the wrong reasons. If we look back t
166.
▲
by
sjrd
9y ago
> From what I understand, the definition of a transpiler is one which almost exclusively performs syntax-syntax transforms, and doesn't delve into the semantics with e.g. dataflow or control flow. I suggest you read the other articl
167.
▲
by
sjrd
9y ago
That's unfortunately not my experience. I'm appalled every time someone tells me "But Scala.js is not a compiler, it's a transpiler, since it compiles to JS!" I assume other language users and authors suffer the sam
168.
▲
by
sjrd
9y ago
Oh indeed. I read the first two paragraphs and didn't bother to read the last sentence. Thanks for correcting me!
169.
▲
by
sjrd
9y ago
Source repo: https://github.com/dyoo/whalesong Latest non-Readme commit: 4 years ago. Not sure this is still relevant.
170.
▲
by
sjrd
9y ago
Right, because wasm is there to solve all our performance problems, isn't it? And how exactly is your jquery.wasm going to access the DOM? Or expose methods to your application, for that matter? wasm is not a drop-in replacement for JS
171.
▲
by
sjrd
9y ago
For a more comprehensive reference on v8 internals, there is http://wingolog.org/tags/v8 , which has been around for a long time. It is even directly referenced from https://developers.google.com/v8/
172.
▲
by
sjrd
9y ago
In terms of what?
173.
▲
by
sjrd
9y ago
The linked page is a proposal for the Eclipse "foundation" or whatever it's called to "take over" Ceylon. It's not a page about Ceylon itself. The web site of Ceylon is at https://ceylon-lang.org&#
174.
▲
by
sjrd
9y ago
> If parsing is so slow, maybe browsers should be caching the parsed representation of javascript sources to speed up page loading, or even better: the bytecode/JIT-generated code. This is addressed in the article: https:/
175.
▲
by
sjrd
9y ago
A lot of the mentioned languages also allow deep interoperability between their heap and the JavaScript heap, e.g., circular references between objects of the "two heaps", and free access to fields and methods of objects of the ot
176.
▲
by
sjrd
9y ago
It might allow you to have as good performance as JS compilation, but definitely not as good interoperability with JS. Some of those languages, like ClojureScript, Scala.js and BuckleScript, have complete 2-way interop between them and JS,
177.
▲
by
sjrd
9y ago
That seems awesome. I'm glad that it's on your radar. If you can point me to the best place to suggest ideas or spend my spare cycles, I would gladly do so. At the very least, I can comment on how we serialize positions in the (tr
178.
▲
by
sjrd
9y ago
This is a very good point. I would also add that there are a lot of languages compiling to JavaScript that would similarly not benefit from wasm. Right now, pretty much all GC-ed languages compiling to JS (such as ClosureScript, Elm, Scal
179.
▲
by
sjrd
9y ago
> Scala 2.11 will remain supported for some time Even though I very much wanted this to be true, that promise has been broken. Scala 2.11 has been EOL'ed 3 months ago with 2.11.11.
180.
▲
by
sjrd
9y ago
How come this is not already obvious to everyone? I completely agree with the article. Version ranges are evil. Avoid them at all cost.
More ›