one-more-minute
Joined 12 years ago
Joined 12 years ago
I've spent the last couple of months porting the compiler from Julia to TypeScript. That's nearly done, so I'm hoping I can post an interactive web demo next month!
What Datalog and co give you is the ability to do interesting program transformations. Mostly that's not because they are "declarative", if that means anything, but because they avoid all the little bits of non-determinism that imperative languages include. If you avoid those you're pretty much set. Coming from another angle, JAX [1] shows how you can do program transformations in Python with a relatively small set of semantic restrictions.
[0]: https://www.scattered-thoughts.net/writing/unexplanations-sq... [1]: https://github.com/jax-ml/jax
Something cool the web can do is static, reliable, easily readable documents – might be nice to show that off.
The WASI project specifies wasm-native APIs (modelled on posix) for running locally without JS, so you could imagine something similar for the browser. But the complexity of the DOM is forbidding.
I've not tried Emscripten hello world for a while, but I imagine it depends on things like optimisation level, dead code elim etc. In general to compile C code you'll need a malloc, string support and so on as you say. You can make the wasm file tiny if you lean on JS strings, but that increases the amount of support code again. Languages other than C will have an easier time reusing parts of the JS runtime (like strings or GC).
Very possibly the "autistic"/"allistic" labels refer to a mix of different underlying cognitive variables, monotropism being just one. Either way, the theory seems an important step forward.
Things like Forth or the JVM byte code are true stack machines: all locals can be on the stack, and the stack shape can vary at runtime (which in turn makes validation harder). I seem to be in the minority, but I think wasm is quite different and the distinction is useful to maintain.
A dictionary of medicine from 1882 suggests that common usage of the word has become more narrow, not less, and that there was some level of debate about the technical meaning [1]. Stedman's Medical Dictionary (1920) gives a more modern definition, "a disease attacking nearly simultaneously a large number of people", without restriction to infectious diseases.
[1] https://www.google.co.uk/books/edition/A_Dictionary_of_Medic...
If you wanted to, you could explicitly model all possible values of the envelopes, and all possible observations of A – and you'd get the right answer again, including in the case above. You just can't define A in a path-dependent way, and then treat it as having the same value in all paths.
I've been working through advent of code using my own little compiler/language. It's in such an early state that some creative problem solving is required, not to mention the compiler bugs! But I'm very pleased to have it running interactively on my blog like this – I want to work towards some bigger notebooks in the style of explorable explanations.