I’ve heard someone was working on making a TypeScript flavor of Jessie. Can anyone get me pointed towards that?
Hi Dan, Kate,
Tessie started at Michael Fig’s message at https://github.com/Agoric/Jessie/issues/27#issuecomment-475120848
On some thread somewhere, I remember posting Dean’s suggestion that perhaps Tessie, being a translator from a source language that’s a syntactic subset of TypeScript but semantically only (approximately) a fail-stop subset of TypeScript, could also inject dynamic type checks according to the type declarations while still being a fail-stop subset. Perhaps, with this injection, Tessie could be soundly statically typed?
If so, Tessie would fill an important hole in our overall story. We’ve been saying “Use Jessie to write code that can eventually be statically analyzed for safety properties with confidence.” However, people who want that will think to first find a soundly statically typed language.
Nevermind the “some thread somewhere”. It is that same thread: https://github.com/Agoric/Jessie/issues/27#issuecomment-475120848
(is a broken link!) Here is the new Babel-based https://github.com/michaelfig/jessica/blob/master/lang/nodejs/tessc.js and https://github.com/michaelfig/jessica/blob/master/lang/nodejs/babel-tessie.js.
I found the Typescript Compiler API to be extremely difficult to use for the sorts of rewrites I was trying to do with tessc.ts. So, I kept using
tsc for the typechecking, but switched to Babel to do the rewrites.
Tonight I parsed the entire Jessica library sources with Jessica, and have validated that my Tessie sources (lib/*.mjs.ts) are rewritten as valid Jessie by tessc.js with the syntactic restrictions I’ve proposed in the immunize() discussion.
These sources (lib/*.mjs) have been published to Jessica’s master branch.
As for sound typing of Tessie, that’s an open question. Sound typing of the AST data structures themselves is a real challenge… Typescript’s inference doesn’t do well with Arrays-as-tuples, and Typescript always allows you to punt to the