Comment

Comment by simplify

I am definitely biased (being the creator and all), but I like the approach JS Zero[1] is taking. Everything is written in a sound, subset of JavaScript, but you can always use an `assume` tag as an escape hatch, allowing you to write "normal" JavaScript when you really need it.

For example, if you're reading records from a SQL database, you don't have to bother wrestling with the type system – just tell it what your data looks like! :)

    let Pet = Object.of({ name: String, happiness: Number })

    $assume `fetchPets : (Number) => Promise( Array(Pet) )`
    function fetchPets (minHappiness) {
      return db('pets').select('*').where('happiness', '>', minHappiness)
    }
parent simplify 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton