Skip to content
Lucent
SEARCH LUCENT

Search guides, APIs, and examples.

GitHub

Very early and experimental. The language, the generated native code and every package API change without notice. Do not use Lucent in production.

Built-ins

The JavaScript built-ins Lucent has, and where they differ from JavaScript's.

Built-inWhat's thereNot there, or different
MathEvery function and constant.
NumberisInteger, isSafeInteger, isFinite, isNaN, parseInt, parseFloat, the constants; toString(radix), toFixed, toPrecision, toExponential.
BigIntBigInt(value) of a number, string, boolean or bigint; BigInt.asIntN, BigInt.asUintN; toString(radix), valueOf.No toLocaleString.
GlobalsparseInt, parseFloat, isNaN, isFinite, String(), Number(), Boolean().
StringThe instance methods, String.fromCharCode, String.fromCodePoint. Case mapping uses Unicode's full rules; localeCompare uses the platform's collator.No Intl.
ArrayThe instance methods, including find, findIndex, flatMap, at; Array.from, Array.of, Array.isArray, new Array(n).Not the ES2023 methods: toSorted, toReversed, findLast, findLastIndex. Writing past the end throws a RangeError.
Map, SetThe whole API; new Map(entries), new Set(iterable).
Objectkeys, values, entries, fromEntries.On records; keys also on object types.
JSONJSON.stringify of any value; JSON.parse(text) as T.No replacer, indent or reviver. parse checks the text against T.
RegExpEvery feature and flag (dgimsuvy); exec, test, match, matchAll, search, replace, replaceAll, split.A replacer with capture parameters needs a literal pattern.
DateConstructors, Date.now, Date.parse, Date.UTC, the getters and setters, toISOString, toString and the other string forms.No toLocale… methods. toString has Hermes's format.
Uint8Arraylength, byteLength, subarray, slice, fill, indexOf, includes, set, forEach, map, reduce, join.reduce needs an initial value.
PromisePromise.all, Promise.resolve, Promise.reject, new Promise.No race, allSettled, any or .then.
consolelog, info, debug, warn, error: to the unified log on iOS, logcat on Android (tag Lucent).Arguments print as String(value); a bigint with its n, as in JavaScript.
AbortController, AbortSignalsignal, abort(error?); aborted, throwIfAborted(), addEventListener("abort", …).No signal.reason.

Not available: Intl, Symbol, WeakMap, WeakRef, Proxy, eval, TextEncoder and TextDecoder. Each is a compile error; for text, use utf8Encode and utf8Decode from lucent:core.