This was too long for a tweet (and I don't tweet anyway).
Thinking in terms of a gradually typed language was new to me. The capabilities and behaviour of the compiler were (expectedly) different from that of gcc. I found the following video helpful in understanding the concepts and relation to strongly typed programming.
But wait, you usually (infrequently) blog about Ethereum and Solidity and cheese, what’s with this post? Typescript is firmly in crypto developers tool set, it’s recently consistently rated highly in StackOverflow’s “what’s hot” list and is probably become the most praised language in crypto podcasts behind Rust.
Numerous projects in the blockchain space primarily focus on adding Typescript support when building their interfaces to their chain based smart contracts. Typechain is an effort by a team at Neufund (early Typescript advocates alongside 0x, Bloom and Nomic Labs) to add Typescript bindings to smart contract interactions.
These tools mostly follow the same pattern: Feed it your ABI.json and web3 (or similar) target and import the wrapped contract calls in ES6. You now have eslint/tslint and many benefits of this gradually typed paradigm.
Typescript <> AssemblyScript
AssemblyScript is a subset of Typescript that can be compiled to WebAssembly. The future of script execution on blockchain networks is unknown at present, with eth2.0 designs moving towards using the beacon chain as a data availability layer, creating a paradigm _almost_ agnostic to execution engines.
There has long been a movement towards using a deterministic subset of WebAssembly (“Wasm”), termed Ethereum-Wasm (“colloquially termed eWasm”), with some eWasm execution environment already functional, like Parity’s Ethereum client. Alongside the performance benefits of closer to the metal instruction types (goodbye hairy 256 bit performance drawbacks and EVM OP_JUMP’S), the surrounding tooling is thought to be the main benefit of adoption. Mozilla and other mature web companies have been working on this project for many years.
Near Protocol, Ethereum, are all toying with this idea and have created demo execution environments for AssemblyScript (with a lot of functionality mocked out).