diff --git a/scripts/generate-og-languages.cjs b/scripts/generate-og-languages.cjs index 76f4d0b..bb84e0c 100644 --- a/scripts/generate-og-languages.cjs +++ b/scripts/generate-og-languages.cjs @@ -29,7 +29,7 @@ const LANGS = [ // Row 1 { name: 'APL', version: 'Dyalog v21.0', file: 'apl.png' }, { name: 'BQN', version: 'CBQN 0.12', file: 'bqn.svg' }, - { name: 'Uiua', version: '0.20.0-dev.1', file: 'uiua.png' }, + { name: 'Uiua', version: '0.20.0-dev.2', file: 'uiua.png' }, // Row 2 { name: 'J', version: 'J9.8.0-beta11', file: 'j_logo.svg' }, { name: 'Kap', version: '2026-11-30', file: 'kap.png' }, diff --git a/scripts/known-versions.json b/scripts/known-versions.json index 16505d1..03ce127 100644 --- a/scripts/known-versions.json +++ b/scripts/known-versions.json @@ -1,6 +1,6 @@ { "cbqn": "v0.12.0", - "uiua": "0.20.0-dev.1", + "uiua": "0.20.0-dev.2", "j": "9.8.0-beta11", "kap": "20261130-2", "tinyapl": "0.12.0" diff --git a/src/keyboard.js b/src/keyboard.js index 0004f1f..c8738ec 100644 --- a/src/keyboard.js +++ b/src/keyboard.js @@ -855,9 +855,7 @@ export const uiuaGlyphNames = { '⤸': 'orient', '▽': 'keep', '⌕': 'find', - '⦷': 'mask', '∊': 'memberof', - '⊗': 'indexin', '⊥': 'base', // Mapping Modifiers @@ -865,7 +863,6 @@ export const uiuaGlyphNames = { '⍚': 'inventory', '⊞': 'table', '⧅': 'tuples', - '⧈': 'stencil', '⊕': 'group', '⊜': 'partition', '⍩': 'case', @@ -957,6 +954,10 @@ export const uiuaGlyphNames = { '⨱': 'outer product', '⍡': 'pattern', '⊨': 'validate', + // Added from upstream documentation; review placement and labels. + '⋉': 'indexin', + '⚇': 'mask', + '◫': 'stencil', }; // Default keyboard layout (US QWERTY) diff --git a/src/keymap.js b/src/keymap.js index e75466a..0da610b 100644 --- a/src/keymap.js +++ b/src/keymap.js @@ -349,16 +349,18 @@ export const uiuaGlyphs = { ], // Dyadic Array - Operate on two arrays dyadicArray: [ - '≍', '⊟', '⊂', '⊏', '⊡', '↯', '↙', '↘', '↻', '⤸', '▽', '⌕', '⦷', '∊', '⊗', '⊥', - '⨰', '⨱', '⊨' + '≍', '⊟', '⊂', '⊏', '⊡', '↯', '↙', '↘', '↻', '⤸', '▽', '⌕', '∊', '⊥', + '⨰', '⨱', '⊨', + '⋉', '⚇' ], // 1-Modifiers (monadic modifiers) - Take 1 function argument monadicModifiers: [ '˙', '˜', '⊙', '⋅', '⟜', '⊸', '⤙', '⤚', '◠', '◡', '∩', - '≡', '⍚', '⊞', '⧅', '⧈', '⊕', '⊜', + '≡', '⍚', '⊞', '⧅', '⊕', '⊜', '/', '∧', '\\', '⍥', '⌅', '°', '⌝', - '⧋', '◇', '∪', '⍩' + '⧋', '◇', '∪', '⍩', + '◫' ], // 2-Modifiers (dyadic modifiers) - Take 2+ function arguments dyadicModifiers: [ diff --git a/src/syntax.js b/src/syntax.js index 86b335c..05fae5e 100644 --- a/src/syntax.js +++ b/src/syntax.js @@ -178,18 +178,20 @@ export const syntaxRules = { functions: [ '+', '-', '×', '÷', '◿', 'ⁿ', '=', '≠', '<', '>', '≤', '≥', '↧', '↥', '∠', '∨', 'ℂ', '⊂', '⊏', '⊡', '↯', - '↙', '↘', '↻', '⊗', '∊', '⊟', '▽', '⤸', - '≍', '⌕', '⦷', '⊥', - '⨰', '⨱', '⊨' + '↙', '↘', '↻', '∊', '⊟', '▽', '⤸', + '≍', '⌕', '⊥', + '⨰', '⨱', '⊨', + '⋉', '⚇' ], // 1-modifiers (pink) - take 1 function argument // Matches uiuaGlyphs.monadicModifiers from keymap.js (popup source of truth) dyadic: [ '∘', '◌', '˙', '˜', '⊙', '⋅', '⟜', '⊸', '⤙', '⤚', '◠', '◡', '∩', - '≡', '⍚', '⊞', '⧅', '⧈', '⊕', '⊜', + '≡', '⍚', '⊞', '⧅', '⊕', '⊜', '/', '∧', '\\', '⍥', '⌅', '°', '⌝', - '⧋', '◇', '∪', '⍩' + '⧋', '◇', '∪', '⍩', + '◫' ], // 2-modifiers (yellow) - take 2+ function arguments // Matches uiuaGlyphs.dyadicModifiers from keymap.js (popup source of truth) diff --git a/src/uiua-docs.js b/src/uiua-docs.js index c2aec42..8137adf 100644 --- a/src/uiua-docs.js +++ b/src/uiua-docs.js @@ -381,8 +381,8 @@ export const uiuaGlyphDocs = { "signature": "1 → 1", "docUrl": "https://www.uiua.org/docs/identity" }, - "⊗": { - "glyph": "⊗", + "⋉": { + "glyph": "⋉", "type": "dyadic function", "name": "indexin", "description": "Find the first index in an array of each row of another array", @@ -469,8 +469,8 @@ export const uiuaGlyphDocs = { "signature": "2 → 1", "docUrl": "https://www.uiua.org/docs/less%20than" }, - "⦷": { - "glyph": "⦷", + "⚇": { + "glyph": "⚇", "type": "dyadic function", "name": "mask", "description": "Mask the occurrences of one array in another", @@ -829,8 +829,8 @@ export const uiuaGlyphDocs = { "signature": "1 → 1", "docUrl": "https://www.uiua.org/docs/sqrt" }, - "⧈": { - "glyph": "⧈", + "◫": { + "glyph": "◫", "type": "modifier", "name": "stencil", "description": "Call a function on windows of an array", diff --git a/wasm/uiua_wasm.js b/wasm/uiua_wasm.js index 4a745a5..a038f4a 100644 --- a/wasm/uiua_wasm.js +++ b/wasm/uiua_wasm.js @@ -93,50 +93,14 @@ export function uiua_version() { function __wbg_get_imports() { const import0 = { __proto__: null, - __wbg___wbindgen_debug_string_a57024b9c6e4a48b: function(arg0, arg1) { - const ret = debugString(arg1); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, - __wbg___wbindgen_is_undefined_6cff064c44e0d823: function(arg0) { - const ret = arg0 === undefined; - return ret; - }, __wbg___wbindgen_throw_bb96b2010945f0bc: function(arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }, __wbg_getRandomValues_436a51d0629d84e1: function() { return handleError(function (arg0, arg1) { globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1)); }, arguments); }, - __wbg_get_971a0c45d172643f: function() { return handleError(function (arg0, arg1) { - const ret = Reflect.get(arg0, arg1); - return ret; - }, arguments); }, - __wbg_now_2283802bfbda617e: function(arg0) { - const ret = arg0.now(); - return ret; - }, - __wbg_static_accessor_GLOBAL_THIS_466428f93b4eaa76: function() { - const ret = typeof globalThis === 'undefined' ? null : globalThis; - return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); - }, - __wbg_static_accessor_GLOBAL_c7aea38d4de089bc: function() { - const ret = typeof global === 'undefined' ? null : global; - return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); - }, - __wbg_static_accessor_SELF_42d4fae05e59267a: function() { - const ret = typeof self === 'undefined' ? null : self; - return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); - }, - __wbg_static_accessor_WINDOW_e0db14a0eba6a812: function() { - const ret = typeof window === 'undefined' ? null : window; - return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); - }, - __wbindgen_cast_0000000000000001: function(arg0, arg1) { - // Cast intrinsic for `Ref(String) -> Externref`. - const ret = getStringFromWasm0(arg0, arg1); + __wbg_now_7a643646c66543d9: function() { + const ret = performance.now(); return ret; }, __wbindgen_init_externref_table: function() { @@ -161,84 +125,11 @@ function addToExternrefTable0(obj) { return idx; } -function debugString(val) { - // primitive types - const type = typeof val; - if (type == 'number' || type == 'boolean' || val == null) { - return `${val}`; - } - if (type == 'string') { - return `"${val}"`; - } - if (type == 'symbol') { - const description = val.description; - if (description == null) { - return 'Symbol'; - } else { - return `Symbol(${description})`; - } - } - if (type == 'function') { - const name = val.name; - if (typeof name == 'string' && name.length > 0) { - return `Function(${name})`; - } else { - return 'Function'; - } - } - // objects - if (Array.isArray(val)) { - const length = val.length; - let debug = '['; - if (length > 0) { - debug += debugString(val[0]); - } - for(let i = 1; i < length; i++) { - debug += ', ' + debugString(val[i]); - } - debug += ']'; - return debug; - } - // Test for built-in - const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); - let className; - if (builtInMatches && builtInMatches.length > 1) { - className = builtInMatches[1]; - } else { - // Failed to match the standard '[object ClassName]' - return toString.call(val); - } - if (className == 'Object') { - // we're a user defined class or Object - // JSON.stringify avoids problems with cycles, and is generally much - // easier than looping through ownProperties of `val`. - try { - return 'Object(' + JSON.stringify(val) + ')'; - } catch (_) { - return 'Object'; - } - } - // errors - if (val instanceof Error) { - return `${val.name}: ${val.message}\n${val.stack}`; - } - // TODO we could test for more things here, like `Set`s and `Map`s. - return className; -} - function getArrayU8FromWasm0(ptr, len) { ptr = ptr >>> 0; return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); } -let cachedDataViewMemory0 = null; -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - function getStringFromWasm0(ptr, len) { return decodeText(ptr >>> 0, len); } @@ -260,10 +151,6 @@ function handleError(f, args) { } } -function isLikeNone(x) { - return x === undefined || x === null; -} - function passStringToWasm0(arg, malloc, realloc) { if (realloc === undefined) { const buf = cachedTextEncoder.encode(arg); @@ -335,7 +222,6 @@ function __wbg_finalize_init(instance, module) { wasmInstance = instance; wasm = instance.exports; wasmModule = module; - cachedDataViewMemory0 = null; cachedUint8ArrayMemory0 = null; wasm.__wbindgen_start(); return wasm; diff --git a/wasm/uiua_wasm_bg.wasm b/wasm/uiua_wasm_bg.wasm index c0ab101..b473b80 100644 Binary files a/wasm/uiua_wasm_bg.wasm and b/wasm/uiua_wasm_bg.wasm differ