Tish vs JavaScript
What differs from JavaScript and what is additional in Tish.
This page documents how Tish differs from JavaScript and what Tish adds. Since Tish is not pure JS, developers coming from JS/TS need this reference.
Differences from JavaScript
Additions (Tish-specific)
Semantic Details
No undefined
Tish has only null. Optional chaining (?.) and missing properties return null where JavaScript returns undefined. Because of this, typeof null returns "null" in Tish, unlike JavaScript where it returns "object".
Strict equality only
Loose equality (==) is not supported. Use === and !== only. There is no implicit type coercion in comparisons.
No this, with, eval
Tish omits these for security and compileability. Pass explicit parameters instead of relying on this.
No prototypes
Objects and arrays are plain data structures. No Object.create, prototype chain, or instanceof.
No classes, new, super
Use plain objects and functions. No OOP class syntax.
Async/await support
Tish supports async fn and await for asynchronous I/O. Use fetchAsync and fetchAllAsync with await for non-blocking HTTP requests. Promises (ECMA-262 §27.2) are supported: Promise(executor), .then, .catch, .finally, Promise.resolve, Promise.reject, Promise.all, Promise.race. Host APIs setTimeout, setInterval, clearTimeout, and clearInterval are non-blocking (callbacks run after the delay; setTimeout returns immediately). Generators are not supported.
No modules (import/export)
Single-file programs for now. Module support is deferred.
See also
- ECMA Alignment — Mapping to ECMA-262
- JS Compatibility Gaps — Implementation gaps requiring workarounds
- Builtins Overview — Feature flags and secure-by-default