|
|
|
|
|
by rattray
1468 days ago
|
|
Thanks – the question I had was answered in the "Bytecode" part of that section: https://deepkit-book.herokuapp.com/deepkit-book-english.html... My summary is that the DeepKit compiler is a JS transpiler (used as a ts-node or webpack plugin, or conveniently/invasively as a replacement of node_modules/typescript) that produces code like this: //TypeScript
export type TypeA = string[];
//generated JavaScript
export const __ΩtypeA = ['&F'];
//TypeScript
function log(message: string): void {}
//generated JavaScript
function log(message) {}
log.__type = ['message', 'log', 'P&2!$/"'];
Where '&F' and 'P&2!$/"' are the compact bytecode translations of the types ("&" means string, "F" means array) and '__Ω' is a prefix used to avoid naming conflicts.Personally, I'd love to see a live example of code in & compiled code out on the homepage. I'm sure it's on your roadmap :) |
|