Syntax & Compatibility
Tfkity is designed for flexibility. Since our compiler builds the source code, there are no runtime restrictions. Write in our native TFY syntax, standard JavaScript, or mix both.
Choose Your Style
if x > 10 { // No parentheses needed
var result = x * 2 // Dynamic typing
log("Result: " + result)
return result
}
}
if (x > 10) {
let result = x * 2;
console.log("Result: " + result);
return result;
}
}
Hybrid Mode
Since Tfkity compiles everything, you can mix both styles in the same file. Use standard JS libraries alongside concise TFY syntax logic.
const data = [1, 2, 3]; // Standard JS Array
// Use TFY logic flows
data.forEach(item => {
if item > 1 {
log("Processing: " + item)
}
})
}
Why a new syntax?
It's not just a wrapper. Unlike Node.js or Bun which run JavaScript at runtime, Tfkity is a compiler.
You are writing code that looks like JavaScript, but at build time, our compiler transforms it into: other languages, and platforms especifics.
The TFY syntax was the original intent for this architecture, designed to be cleaner and safer. However, we support standard JS syntax to make adoption zero-friction for web developers.
Universal Imports
Don't wait for bindings. Tfkity auto-detects imports at build time, downloads the package, and embeds it into your project's optimized bundle.
TFY Style Import
Standard Import
Build-Time Intelligence
When you build, we generate a .tfkity.bundle
file. We scan your imports and the original package (mainOG.tfkity.bundle), removing any unused code (tree-shaking) before it
ever reaches the runtime. This ensures your app stays
small even if you import massive libraries.