danielearwicker

Joined 12 years ago

Karma
15
Submissions
17
Member since
Jan 5
View on Hacker News

Recent submissions

Comment · 1 year ago
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.

Comment · 4 years ago
In TS this is controllable. If noEmitOnError is true, then any error (including type errors) will stop it emitting JS output.
Comment · 6 years ago
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.
Comment · 6 years ago
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.
Comment · 6 years ago
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); 
    });
Comment · 7 years ago
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).
Comment · 9 years ago
Comment · 9 years ago
Odd. Erlang uses GC.
Comment · 10 years ago
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.
Comment · 10 years ago
Interesting last line in that presentation:

"Flow written in OCaml, Typescript in Typescript"

Comment · 10 years ago
You may be traumatised if you ever hear Crockford talk about JavaScript!
Comment · 10 years ago
Not sure how well this analysis explains Facebook's widespread use of React.
Comment · 10 years ago
Comment · 10 years ago
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.
Comment · 10 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton