Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jvilk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
jvilk
10y ago
One of Doppio's explicit goals was to leverage existing resources in the browser to bring conventional programming languages to the web on top of JavaScript. Using WebAssembly would prevent Doppio from using the browser's garbage
32.
▲
by
jvilk
10y ago
Absolutely true. I believe I proposed that in our correspondence, but it was a dealbreaker for bck2brwsr and TeaV M, which is understandable.
33.
▲
by
jvilk
10y ago
I misspoke -- you can polyfill WeakSet, but you cannot polyfill WeakMap, since you do not know when you can shrink the map. (But you still cannot use it to emulate weak references, since you need a strong reference to get data out of the ma
34.
▲
by
jvilk
10y ago
Actually, those are not sufficient to implement weak references, and have a much different use case! With WeakMap and WeakSet, the keys are weakly referenced, hence the names. If you have a WeakMap, you can't produce a value stored i
35.
▲
by
jvilk
10y ago
Haha, I've actually tried to do this. The only missing link, I believe, is to add a Nashorn/Rhino backend to BrowserFS (Doppio's file system library) so that Doppio can access the filesystem that Rhino is running in to load t
36.
▲
by
jvilk
10y ago
If the authors compressed the JAR files into a single bundle, storing the data into a BrowserFS-created IndexedDB file system removes decompression/extraction overhead on subsequent visits. If they didn't.... then it might be suff
37.
▲
by
jvilk
10y ago
> It would be really good if gwt,doppio,teavm all agreed on a single api facade for targeting the browser API. Unfortunately, that is impossible due to differing requirements; I've actually talked with the teavm and bck2brwsr folks
38.
▲
by
jvilk
10y ago
It's true that SharedArrayBuffer is coming, but there's no way to share objects from what I understand. Since Doppio maps JVM objects to JS objects, it cannot take advantage of shared array buffers to emulate shared memory threa
39.
▲
by
jvilk
10y ago
Doppio uses JavaScript's garbage collector. (As a result, it cannot support weak references.) As for concurrency, thread quanta are mapped to JavaScript events, so Doppio can emulate preemptive multithreading. Doppio potentially preemp
40.
▲
by
jvilk
10y ago
Actually, Doppio is an artifact from my own research, so there is a very good reason "why" [0]! Basically, if you want to re-use your existing, well-tested code in the browser, it is quite difficult. The browser environment is ver
41.
▲
by
jvilk
10y ago
The main goal of Doppio was never speed -- it was compatibility [0]. It's actually a JVM interpreter at present, leading to noticeable slowdown over a native JVM. Thus, there are many opportunities for performance improvements! A recen
42.
▲
by
jvilk
10y ago
The last time I checked, doppio can run the Closure compiler [0]. [0] https://github.com/plasma-umass/doppio/issues/317
43.
▲
by
jvilk
10y ago
Yeah, Doppio needs to download the entire JDK to run, since it's a full-featured JVM (JRE for running Java programs, JDK for javac so it can compile them). Compressed, it's ~30MB. The authors of this project can preload the JDK wi
44.
▲
by
jvilk
10y ago
Lead author of Doppio here! This is quite cool. I don't recognize the authors of this work, so I was unaware of the project and was surprised to see it on the front page of HN! If you find any issues with Doppio or have any requests, f
45.
▲
by
jvilk
10y ago
Actually, the master version of Doppio can run Rhino AND Nashorn! (I'm the primary author of Doppio.)
46.
▲
by
jvilk
10y ago
I actually embarked on a similar Python VM called Ninia [1] awhile back, but shelved it as other projects became more important. Ninia supports multiple threads and preempts execution to give the browser breathing space, just like my JVM in
47.
▲
by
jvilk
11y ago
> It works, except when the UI thread is blocked, because messages are routed through the UI thread. This bug actually causes a ~40% slowdown in one of my projects, since I use sendMessage() in a Worker context to quickly yield to the br
48.
▲
by
jvilk
11y ago
Absolutely agreed. We should be able to debug Web Workers with development tools (e.g. set breakpoints / examine state / etc), nest Web Workers, use console.log from within a Worker, and construct Web Workers from Blob URLs. It&#x
49.
▲
by
jvilk
11y ago
BrowserFS actually supports Dropbox integration already... so you could do the same with a Dropbox shared folder. (Sidenote: I'm the author of BrowserFS, and helped implement this feature.)
50.
▲
by
jvilk
11y ago
Well, it's not infeasible. We don't use localStorage -- we use IndexedDB, which can store gigantic files. But I've never tried stuffing 100+MB into IndexedDB before. (Sidenote: I'm the author of the BrowserFS library, an
51.
▲
by
jvilk
11y ago
You can also chat with me (John Vilk), the lead grad student/dev on Ninia/Doppio/etc. I'm happy to answer any questions you may have!
52.
▲
by
jvilk
11y ago
Like Sublime Text, it's somewhere between an IDE and a text editor. For example, both Sublime Text and Atom have a TypeScript plugin that uses the TypeScript language service to highlight compilation errors as you type, and to provide
53.
▲
Time-Travel Debugging for JavaScript/HTML Applications [video]
(channel9.msdn.com)
1 points
by
jvilk
11y ago
|
0 comments
54.
▲
by
jvilk
12y ago
If you're talking about TypeScript, I don't believe that mantra is applicable when the extensions are open source, liberally licensed (Apache License), cross-browser, and developed in the open. There's nothing proprietary or
55.
▲
by
jvilk
12y ago
Understood. If `ffiFunc()` returns an empty array at a double call site, does ASM.js just accept it as `0`? (`+[]` is `0`). Or are there runtime checks that verify that the return value is a numeric type? btw, I hope these questions make it
56.
▲
by
jvilk
12y ago
Follow-up question. How does it deduce the return type of a foreign function? Can foreign functions return values? Normally, ASM.js functions require an annotation on the return statement [0]. [0] http://asmjs.org/spec/
57.
▲
by
jvilk
12y ago
The example doesn't use the FFI, though. And I understand the graph of value types and the restrictions that ASM.js imposes on ASM.js code, but there's no clear linkage between that and the FFI. Some other FFIs require you to enco
58.
▲
by
jvilk
12y ago
Ah, I wasn't aware there was an actual repo associated with ASM.js. The example doesn't show how you call into the module with `consoleDotLog` defined, though. I know that sounds like a triviality, but complete examples are really
59.
▲
by
jvilk
12y ago
> What extra info are you looking for? Essentially, a complete executable example of a simple ASM.js program that involves a foreign function, including processing return values. (I imagine if it's this simple, then return values ar
60.
▲
by
jvilk
12y ago
Are there any tutorials at all on how to use ASM.js's Foreign Function Interface (FFI)? The specification lacks examples, and seems to be very underspecified. :( Note that the FFI is a crucial component of ASM.js, as everything in th
More ›