danielearwicker
danielearwicker on Hacker News
Re:WASM 3.0 Completed
on Friday September 19, 2025 @01:13PM (#45304055)
Java approach: create the JVM to support one language, so it has rich high-level concepts that are unfortunately skewed toward certain assumptions about language design, and it can be reused only for other languages that are similar enough.
WASM approach: start very low-level so C is definitely supported. Thus everything is supported, although every language has to roll its own high-level constructs. But over time more patterns can be standardised so languages can be interoperable within a polyglot WASM app.
Re:Iām porting the TypeScript type checker tsc to Go
on Friday January 28, 2022 @05:09PM (#30121106)
In TS this is controllable. If noEmitOnError is true, then any error (including type errors) will stop it emitting JS output.
Re:Is Probability Real?
on Monday November 30, 2020 @04:30PM (#25259246)
I think of probability as a summary of the structure/symmetries in a model. A model of a jar of red and blue beads is characterised by the ratio of red to blue, and that beads are only distinguished by colour.
Re:Please disable JavaScript to view this site
on Monday November 30, 2020 @11:38AM (#25255647)
It ought to be possible for the page to disable JavaScript with a meta tag:
<meta name="noscript">
The browser could put an extra icon next to the https padlock so the user would know they were viewing a document rather than an application.
Re:Please disable JavaScript to view this site
on Monday November 30, 2020 @11:34AM (#25255565)
This must be the most unnecessarily awkward way of doing it (have to do it from the console after navigating to the site, so the request is allowed).
fetch("https://heydonworks.com").then(x => x.text()).then(x => {
var f = document.createElement("iframe");
document.body.append(f);
f.style.left = "0px";
f.style.top = "0px";
f.style.width = "100%";
f.style.height = "100%";
f.style.position = "absolute";
f.style.border = 0;
x = x.replace(/\<\/?noscript\>/gi, "");
x = x.replace(/\<script\>.*\<\/script\>/gi, "");
f.contentDocument.write(x);
});
Re:The Bytecode Alliance: Building a secure, composable future for Web...
on Tuesday November 12, 2019 @05:30PM (#21518916)
That future possibiilty reminds me of https://en.wikipedia.org/wiki/Singularity_(operating_system) - where process/address-space isolation was replaced with fine-grained static verification of high-level code (presumably not the first experiment in this area).
Re:Build Yourself a Redux
on Saturday May 06, 2017 @02:53PM (#14281671)
I developed a kind of meta programming pattern and supporting library, based on Redux, called Immuto, to get absolute and complete static typing (via TypeScript) and minimal boilerplate, also referentiality and modularity (cursors that accepted actions). It was fun, but ultimately pointless, as it was never as straightforward as using the automatic observable approach that I'd learned from Knockout.js. Then I heard about MobX (which is the same ideas from KO but better implemented and without any quirky UI templating thrown in) and so now I used that.
Also I use my json-mobx library to get serialisation and undo/redo. Example: https://github.com/danielearwicker/baltar
Re:Nectar: A Native JavaScript Compiler Inspired by Crystal Lang and N...
on Tuesday January 03, 2017 @04:07AM (#13307872)
Odd. Erlang uses GC.
Re:Flow vs. Typescript
on Monday June 06, 2016 @10:47AM (#11847141)
It's very likely that JS will adopt some things tried initially in TS. Both TS and Babel have implemented extensions to the class syntax, for example, which are being considered for JS-future.
Re:I Was Wrong About TypeScript
on Monday June 06, 2016 @04:19AM (#11845325)
Interesting last line in that presentation:
"Flow written in OCaml, Typescript in Typescript"
Re:I Was Wrong About TypeScript
on Monday June 06, 2016 @12:18AM (#11844628)
You may be traumatised if you ever hear Crockford talk about JavaScript!
Re:I Was Wrong About TypeScript
on Monday June 06, 2016 @12:15AM (#11844622)
Not sure how well this analysis explains Facebook's widespread use of React.
Re:I Was Wrong About TypeScript
on Monday June 06, 2016 @12:04AM (#11844580)
Definitely an aim of TS to make it easier to continue using JS for those who prefer a half-way house, see: https://github.com/Microsoft/TypeScript/issues/4789
Re:I Was Wrong About TypeScript
on Sunday June 05, 2016 @11:57PM (#11844553)
The example you give has been supported since day 1. Example: document.createElement("canvas") returns HTMLCanvasElement. A limited form of string literal types has always been supported specifically for overloading return types. The newer support added in 1.8 is a way more powerful generalisation.
Re:I Was Wrong About TypeScript
on Sunday June 05, 2016 @11:54PM (#11844544)
I've been playing with https://github.com/danielearwicker/doop
Re:The Hating Game
on Monday March 16, 2015 @07:34PM (#9215246)
+1 Knockout is a treasure chest of powerful patterns from remarkably few core concepts.
Re:Show HN: Primrose ā A text editor that draws to Canvas
on Monday January 05, 2015 @08:10AM (#8838545)
Thanks for the plug!
Caveat: Carota does not solve Right-To-Left text or complex scripts, and I'd really appreciate help with that. It's the only blocking issue against me using it in my main work project.
(By a strange coincidence I use the codename Primrose in an unrelated project...)