AI 资讯
Galfus Script MVP is complete
Galfus Script has reached its first MVP milestone. Galfus is an experimental programming language written in Rust, designed around a typed VM-first execution model, compact .gfb artifacts, deterministic module/workspace resolution, and an ownership model based on anchors, edges, and weak observers. The MVP goal was not to build a full ecosystem yet. The goal was to prove the complete local execution pipeline: txt .gfs source -> lexer and parser -> resolver -> type checker and semantic analyzer -> ownership check -> MIR lowering -> bytecode emitter -> Galfus Module Image -> .gfb serialization -> VM interpreter execution https://github.com/vulppi-dev/galfus-script/discussions/10
AI 资讯
V.E.L.O.C.I.T.Y.-OS: The Self-Healing Kernel & LLM Terminal Handover (Part 12)
I had arrived at the final frontier. My bare-metal kernel was booting in QEMU, driving NVMe block storage, running multi-agent swarms, and rendering a force-directed canvas. But to make V.E.L.O.C.I.T.Y.-OS a truly next-generation system, I needed to close the loop: the operating system had to be able to evolve and compile itself without human intervention. The V.E.L.O.C.I.T.Y.-OS 12-Part Roadmap We are building a bare-metal, self-healing operating system running entirely inside the CPU's L3 cache. Here is the roadmap for this 12-part series: Part 1: The Spark — Exposing the "Safe-Room" security leak and building the compiler gate. Part 2: The NDA Language — Designing a content-addressed triplet representation to cure context bloat. Part 3: Ditching the Web Stack — Building a native 30MB IDE with 1,500,000x IPC latency drops. Part 4: The Closure JIT — Compiling AST blocks to nested closures and bypassing borrow checker limits. Part 5: JIT Math Optimizations — Replacing division operations with precomputed 16-bit lookup tables. Part 6: x86-64 Assembler & SCEV-Lite — Compiling scalar loops directly to native code in constant time. Part 7: Classic Compiler Passes — Implementing inter-procedural Dead Code Elimination and loop unrolling. Part 8: Reclaiming Ring 0 — Exiting UEFI boot services and transitioning the kernel to Ring 0. Part 9: Bare-Metal Drivers — Writing a PCI scanner, NVMe block storage controller, and FAT32 parser. Part 10: Synaptic Canvas — Rendering a spatial, force-directed GUI based on model token activation vectors. Part 11: Swarms & Hot-Patching — Building multi-agent scheduling and zero-downtime RCU driver updates. Part 12: Self-Evolution — Handing system control over to a local LLM Terminal that self-optimizes via telemetry. (You are here) During the final hours of my Sunday morning sprint, I completed the self-healing loop, the Biosphere P2P registry, and the Boot-to-NDA LLM Terminal handover. To achieve self-healing, I built a Ring 0 telemetry sys
AI 资讯
V.E.L.O.C.I.T.Y.-OS: Swarms, Headless Streaming & RCU Hot-Patching (Part 11)
With the Synaptic Canvas GUI rendering, my bare-metal kernel was fully functional. However, as I expanded the OS features, I ran into multitasking bottlenecks: how do I run background compilation, model inference, and GUI rendering concurrently without crashing the system? Last night, I solved this by implementing three core infrastructure services: Nexus Swarms , Beacon Headless Streaming , and Zero-Downtime OTA Hot-Patching . The V.E.L.O.C.I.T.Y.-OS 12-Part Roadmap We are building a bare-metal, self-healing operating system running entirely inside the CPU's L3 cache. Here is the roadmap for this 12-part series: Part 1: The Spark — Exposing the "Safe-Room" security leak and building the compiler gate. Part 2: The NDA Language — Designing a content-addressed triplet representation to cure context bloat. Part 3: Ditching the Web Stack — Building a native 30MB IDE with 1,500,000x IPC latency drops. Part 4: The Closure JIT — Compiling AST blocks to nested closures and bypassing borrow checker limits. Part 5: JIT Math Optimizations — Replacing division operations with precomputed 16-bit lookup tables. Part 6: x86-64 Assembler & SCEV-Lite — Compiling scalar loops directly to native code in constant time. Part 7: Classic Compiler Passes — Implementing inter-procedural Dead Code Elimination and loop unrolling. Part 8: Reclaiming Ring 0 — Exiting UEFI boot services and transitioning the kernel to Ring 0. Part 9: Bare-Metal Drivers — Writing a PCI scanner, NVMe block storage controller, and FAT32 parser. Part 10: Synaptic Canvas — Rendering a spatial, force-directed GUI based on model token activation vectors. Part 11: Swarms & Hot-Patching — Building multi-agent scheduling and zero-downtime RCU driver updates. (You are here) Part 12: Self-Evolution — Handing system control over to a local LLM Terminal that self-optimizes via telemetry. 1. The Nexus Core Swarm Runtime ( nexus.rs ) To support concurrent compilation and optimization, I built the Nexus Core Swarm Runtime . The
AI 资讯
V.E.L.O.C.I.T.Y.-OS: The Synaptic Canvas GUI & V-NCE GPU (Part 10)
After writing drivers for NVMe storage, my bare-metal kernel could load files and run JIT code. However, I was still typing commands into a text-only COM1 serial terminal. I needed a graphical interface. Last night, the second agent took over to build a double-buffered visual rendering compositor on top of the UEFI Graphics Output Protocol (GOP) framebuffer. The V.E.L.O.C.I.T.Y.-OS 12-Part Roadmap We are building a bare-metal, self-healing operating system running entirely inside the CPU's L3 cache. Here is the roadmap for this 12-part series: Part 1: The Spark — Exposing the "Safe-Room" security leak and building the compiler gate. Part 2: The NDA Language — Designing a content-addressed triplet representation to cure context bloat. Part 3: Ditching the Web Stack — Building a native 30MB IDE with 1,500,000x IPC latency drops. Part 4: The Closure JIT — Compiling AST blocks to nested closures and bypassing borrow checker limits. Part 5: JIT Math Optimizations — Replacing division operations with precomputed 16-bit lookup tables. Part 6: x86-64 Assembler & SCEV-Lite — Compiling scalar loops directly to native code in constant time. Part 7: Classic Compiler Passes — Implementing inter-procedural Dead Code Elimination and loop unrolling. Part 8: Reclaiming Ring 0 — Exiting UEFI boot services and transitioning the kernel to Ring 0. Part 9: Bare-Metal Drivers — Writing a PCI scanner, NVMe block storage controller, and FAT32 parser. Part 10: Synaptic Canvas — Rendering a spatial, force-directed GUI based on model token activation vectors. (You are here) Part 11: Swarms & Hot-Patching — Building multi-agent scheduling and zero-downtime RCU driver updates. Part 12: Self-Evolution — Handing system control over to a local LLM Terminal that self-optimizes via telemetry. This led to the design of the Synaptic Canvas GUI . The Swappable GUI Engines I started by mapping the physical screen buffer pointer discovered by UEFI GOP. I implemented a double-buffering scheme: drawing elem
AI 资讯
V.E.L.O.C.I.T.Y.-OS: Kimi K2.7 and the 'Safe-Room Security' Illusion (Part 1)
It all started on June 23rd with a casual post about a VPS Manager benchmark. Out of curiosity, I decided to ask the author of the benchmark, Pascal CESCATO Follow Full-stack dev sharing practical guides on WordPress, n8n automation, AI tools, Docker & self-hosting. Always experimenting with new tech to make life easier. , if he had tried Cloudflare's new Workers AI offering—specifically Kimi K2.7, a massive 1-trillion parameter MoE (Mixture of Experts) model that was incredibly cheap ($0.27 per million input tokens) and highly capable at code generation. Pascal was intrigued. He pointed out a brilliant hypothesis: if a model makes significantly fewer mistakes, the total session cost drops dramatically even if the per-token price is higher. He cited GLM 5.2 as a model that self-corrected multiple bugs during verification to achieve 37/37 tests passing. Curiosity got the better of me. I spun up my development environment, wrote a custom agent harness, and ran it on Kimi K2.7 using Cloudflare Workers AI. The V.E.L.O.C.I.T.Y.-OS Series Table of Contents We are building a bare-metal, self-healing operating system running entirely inside the CPU's L3 cache. Here is the roadmap for this 12-part series: Part 1: The Spark — Exposing the "Safe-Room" security leak and building the compiler gate. (You are here) Part 2: The NDA Language — Designing a content-addressed triplet representation to cure context bloat. Part 3: Ditching the Web Stack — Building a native 30MB IDE with 1,500,000x IPC latency drops. Part 4: The Closure JIT — Compiling AST blocks to nested closures and bypassing borrow checker limits. Part 5: JIT Math Optimizations — Replacing division operations with precomputed 16-bit lookup tables. Part 6: x86-64 Assembler & SCEV-Lite — Compiling scalar loops directly to native code in constant time. Part 7: Classic Compiler Passes — Implementing inter-procedural Dead Code Elimination and loop unrolling. Part 8: Reclaiming Ring 0 — Exiting UEFI boot services and transi
AI 资讯
Day 6: my language now compiles to WebAssembly — and I emit the bytes by hand
I'm building LOOM — a small open-source language that is a machine-checked trust layer for AI-written code. I don't write it by hand anymore: an organism I built grows it, day and night, on my own machine. This is Day 6, and the whole day went to one thing — WebAssembly . Why this was a real test LOOM already runs three ways: an interpreter, and backends that compile checked code to Python and JavaScript. The thesis is "trust survives translation" — effects and provenance, proven once, hold the same on every target. WebAssembly is the strongest test of that: a low-level stack machine with linear memory, nothing like Python or JS. And there was a constraint. This machine's clang has no wasm target, and I install nothing paid or heavy. So I don't compile to wasm through a toolchain — I emit the wasm bytes myself (LEB128, the type / function / memory / global / export / code sections, the i32 stack machine) and run them through node's built-in WebAssembly . Zero dependencies. From fib to a value runtime, in a day Every step was prototyped and proven (wasm output == interpreter output) before it touched the kernel: The integer core — arithmetic, comparison, if , first-order calls and recursion. fib(10) becomes 61 bytes of real WebAssembly and returns 55, identically on the interpreter, Python, Node and wasm. A value runtime — let and integer lists in a real linear-memory heap (a bump pointer + a $cons cell allocator; head / tail are i32.load , empty is i32.eqz ). A list sums and folds by recursion, inside wasm. Sum types — (variant Tag e) becomes a tagged cell [tag-id | payload] ; match loads the tag, compares, binds the payload, branches. You can watch it: the live playground has a Compile → WAT button and WASM · fib / list-sum / match examples. Type a program, see it become real assembly, in your browser. Honest scope: ints, let , integer lists and sum types compile to wasm today. Records, closures and effects are the next frontiers (closures are the hard one — a func
AI 资讯
Sprint 7 Review: Generics.Collections | Review Sprint 7: Generics.Collections
Bilingual post · Post bilíngue Jump to: English · Português English {#english} Sprint 7 Review: Generics.Collections Mintlify docs tour — after Sprint 4 exceptions , Sprint 7 brings the collections every Horse API and CRUD service needs. Generic containers are not syntactic sugar in Delphi — they are how you build caches, registries, and JSON maps. Sprint 7 ( v2.15.0 ) shipped System.Generics.Collections with working TDictionary<K,V> and TList<T> , including TryGetValue with proper var write-back. What the review documents From Sprint 7 Review : var parameters — Value::Reference , write-back in procedures/functions and TryGetValue . TDictionary::Add / TryGetValue — dispatch in simulate_function_execution ; direct routing for instantiated generics. Parser — generic types with Integer / String in expressions ( TDictionary<String,Integer> ). RTL — rtl/sys/System.Generics.Collections.pas ; semantic layer recognizes Generics.Collections . Tests — generics_collections.rs plus fixtures. Tag v2.15.0 approved. Dictionary pattern in production code program DictDemo ; uses System . SysUtils , System . Generics . Collections ; var D : TDictionary < string , Integer >; V : Integer ; begin D := TDictionary < string , Integer >. Create ; try D . Add ( 'apples' , 3 ); if D . TryGetValue ( 'apples' , V ) then WriteLn ( 'apples = ' , V ); finally D . Free ; end ; end . TryGetValue only writes V when the key exists — the Delphi idiom you expect in services and controllers. Why var was the sprint's hidden hero Before v2.15.0, incomplete var semantics blocked realistic APIs. TryGetValue requires the callee to mutate the caller's variable through a reference. CrabPascal introduced Value::Reference and write-back in procedure dispatch specifically for this surface. Three implementation lessons from the retrospective: D := TDictionary<...>.Create needs normalize_call_name in execute_assignment — not just in direct calls. Generic instance methods must hit intrinsics before empty VMT lookups
AI 资讯
Codegen to C: Native Binaries from Pascal (v2.18.0) | Codegen para C: binários nativos a partir de Pascal (v2.18.0)
Bilingual post · Post bilíngue Jump to: English · Português English {#english} Codegen to C: Native Binaries from Pascal (v2.18.0) Sprint 10 ( v2.18.0 ) closes the loop on CrabPascal's most ambitious feature: turning Pascal source into real native executables via C codegen — with string builtins that actually match the interpreter. The pipeline Pascal (.dpr/.pas) → AST → C source + stubs.c → gcc/clang → native binary run skips the last steps and executes in Rust. build-exe is for when you want an .exe or ELF on disk without carrying the CrabPascal runtime as a dependency. End-to-end example program NativeHello ; uses System . SysUtils ; begin WriteLn ( Trim ( ' Hello, native world! ' )); end . crab-pascal build-exe NativeHello.dpr ./NativeHello # or NativeHello.exe on Windows Expected output: Hello, native world! — no leading or trailing spaces. What Sprint 10 fixed Parser: Trim , Copy , Length , and friends are recognized as SysUtils builtins , not mistaken for type names starting with T . A denylist prevents hard-casts that produced invalid C. Codegen: Forward declarations for pascal_* helpers in generated C. WriteLn emits correct %s formats for string expressions. main returns 0 like a well-behaved C program. Tests: build_string_conformance_stdout_matches_run_when_toolchain_present runs only when gcc/clang is available — skipping cleanly in CI sandboxes without a compiler, failing loudly when a compiler is present but output diverges. cargo test --test run_build_parity stubs.c: shared runtime surface String functions implemented once in Rust for run mirror into stubs.c for native builds: // conceptual — see repo for full signatures int pascal_Length ( const char * s ); char * pascal_Trim ( const char * s ); Generated Pascal calls route through these instead of ad-hoc inline logic, keeping Sprint 5–8 string semantics intact in binaries. When build-exe is not enough yet Sprint 10 explicitly did not ship full OO, exception, or generics codegen parity — those appear
AI 资讯
Building REST APIs in Pascal with Horse | APIs REST em Pascal com Horse
Bilingual post · Post bilíngue Jump to: English · Português English {#english} Building REST APIs in Pascal with Horse Pascal is not stuck in desktop forms. With Horse — a lightweight HTTP framework popular in the Delphi ecosystem — CrabPascal v2.22.0 runs real REST servers from .dpr files. No IIS, no Apache: just crab-pascal run and curl. Why Horse in CrabPascal? Horse provides routing, JSON bodies, and middleware-style handlers. CrabPascal ships RTL shims and a runtime HTTP stack so examples work out of the box: Example Port Endpoints examples/crud/ 9000 Full product CRUD examples/time-server/ 9001 Time/date ping examples/agenda/ 9000 Contact registry All runnable with the internal runtime — no gcc required. Minimal API program SimpleAPI ; uses Horse , System . JSON ; begin THorse . Get ( '/ping' , procedure ( Req : THorseRequest ; Res : THorseResponse ; Next : TNextProc ) var J : TJSONObject ; begin J := TJSONObject . Create ; J . AddPair ( 'message' , 'pong' ); Res . Send ( J . ToJSON ); end ); THorse . Listen ( 9000 ); end . Run and test: crab-pascal run SimpleAPI.dpr curl http://localhost:9000/ping Expected response: {"message":"pong"} . CRUD example from the repo The examples/crud/crud.dpr project demonstrates production-style routes: THorse . Get ( '/produtos' , procedure ( Req , Res , Next ) begin Res . Send < TJSONObject >( TProdutoService . ListarProdutos ); end ); THorse . Post ( '/produtos' , procedure ( Req , Res , Next ) var json : TJSONObject ; begin json := Req . Body < TJSONObject >; Res . Send ( TProdutoService . CriarProduto ( json . GetValue ( 'nome' ). Value , json . GetValue ( 'categoria' ). Value , StrToFloatDef ( json . GetValue ( 'preco' ). Value , 0 ), StrToIntDef ( json . GetValue ( 'estoque' ). Value , 0 ) )); end ); Start the server: cd examples/crud crab-pascal run crud.dpr Testing with curl List products: curl http://localhost:9000/produtos Create a product: curl -X POST http://localhost:9000/produtos \ -H "Content-Type: application/j
开源项目
Configuring CrabPascal with crabpascal.toml | Configurando com crabpascal.toml
Bilingual post · Post bilíngue Jump to: English · Português English {#english} Configuring CrabPascal with crabpascal.toml Every serious compiler needs project-level configuration. CrabPascal v2.22.0 reads crabpascal.toml from your project root — search paths, preprocessor symbols, Delphi vs FPC mode, output format, and runtime defaults. Where the file lives The compiler searches in order: crabpascal.toml (project root) .crabpascal.toml (hidden) config/crabpascal.toml If none exist, sensible defaults apply. Add the file when your project grows beyond a single .dpr . Starter configuration [compiler] version = "2.22.0" search_paths = [ "rtl/" , "lib/" , "examples/" ] defines = [ "CRABPASCAL" , "RELEASE" , "MSWINDOWS" ] mode = "DELPHI" # or "OBJFPC" strict = false warnings = true [preprocessor] enabled = true process_includes = true symbols = [] [output] error_format = "vscode" # or "gcc", "delphi" colors = true [runtime] default_http_port = 9000 [paths] rtl_path = "rtl/" output_path = "output/" Place this beside your .dpr file. All CLI commands ( check , run , build-exe ) pick it up automatically. Common use cases Delphi vs Free Pascal mode [compiler] mode = "DELPHI" defines = [ "CRABPASCAL" , "MSWINDOWS" ] Switch to FPC compatibility: [compiler] mode = "OBJFPC" defines = [ "FPC" , "UNIX" ] Mode affects parsing rules and RTL resolution under rtl/ . Custom unit search paths Large projects split units across folders: [compiler] search_paths = [ "rtl/" , "src/units/" , "src/services/" , "third_party/" ] This replaces hardcoded -U flags in scripts. Preprocessor symbols Match Delphi conditional compilation: [preprocessor] enabled = true symbols = [ "DEBUG" , "TESTING" ] Your Pascal code can use: {$IFDEF DEBUG} WriteLn ( 'Debug build' ); {$ENDIF} Run crab-pascal preproc MyApp.dpr to inspect expanded source. CI-friendly error output [output] error_format = "gcc" colors = false show_stacktrace = false GitHub Actions parsers often prefer gcc-style lines. Local development can