Syntax freeze
Surface syntax is frozen: >>/>>>, #path, control-flow symbols, struct@ / name#. There is no user-facing Result / Ok / Err / ?.
| Topic | Frozen | Not doing |
|---|---|---|
| Errors | >> expr + >>> (err) {}; >>> rethrows | user Result / two-result returns |
| Exits | << return, <<< exit, -> continue, <- break | return / break / continue / exit keywords |
| import | #errors, #xu/ast; alias json #encoding/json | import "…" |
| Integers | int = i64; i32/u32/u8/byte are distinct; no implicit widen; wrap | same-slot aliases |
| Strings | double quotes are the literal | single-quoted strings |
| Low-Level & Baremetal | unsafe { … } block isolation, raw pointer *raw T, asm!(…) inline assembly, volatile_read / volatile_write | manual lifetime annotation hell in application code / implicit raw dereference |
| Layout & Attributes | @repr("C", align: N), @repr("C", packed); #[no_mangle], #[naked], #[panic_handler], #[section("…")] | unpredictable automatic struct field padding & reordering |
| Freestanding Tag | Header $freestanding or xu.xun profile: freestanding severs host OS & libc dependencies | rigid coupling to host OS runtime |
any / temp are runtime boxes; # / @ / struct@ are compile-time splits. Unconstrained form is bare name# / name@, not name# any.
Migración de la sintaxis de errores (0.15.0)
Xu 0.15.0 eliminó la sintaxis heredada de errores con or (or (err) { } y or >>). Usar esas formas heredadas ahora provoca un error estricto del analizador sintáctico que te redirige a >>> (err) { } (manejar) y >>> (propagar), mientras que >> expr lanza errores. or ya no es una palabra clave reservada y pasa a ser un identificador normal (el OR booleano sigue siendo ||). En los editores, xu-lsp ofrece una acción rápida (quick-fix) para reemplazar los manejadores or obsoletos por >>>; consulta acciones de código LSP en VS Code / Cursor.