惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
博客园 - 三生石上(FineUI控件)
V
V2EX
有赞技术团队
有赞技术团队
V
Visual Studio Blog
小众软件
小众软件
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
量子位
T
Tailwind CSS Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
P
Palo Alto Networks Blog
Cisco Talos Blog
Cisco Talos Blog
I
Intezer
Project Zero
Project Zero
A
Arctic Wolf
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
L
Lohrmann on Cybersecurity
S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tor Project blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Help Net Security
Help Net Security
N
News | PayPal Newsroom
W
WeLiveSecurity
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
GitHub - ashtree74/zxbasic-rust: 1982 ZX Spectrum BASIC reimplemented in Rust → native + WebAssembly. An AI software-engineering experiment by Frontiers Lab. Live at experiments.frontierslab.ai/zxspectrum
adam_jesion · 2026-05-27 · via Hacker News - Newest: "AI"

ZX Spectrum stripe mark

A modern reimplementation of the 1982 ZX Spectrum BASIC interpreter, written in Rust, running natively in your browser via WebAssembly — built end-to-end as an AI software-engineering experiment.

🟢 Live: https://experiments.frontierslab.ai/zxspectrum

Boot screen — © 1982 Sinclair Research Ltd, exactly as the original ROM puts it on the lower screen


What this is

zxbasic-rust is a from-scratch reimplementation of the BASIC runtime that shipped on every Sinclair ZX Spectrum 48 K — the interpreter, the line editor, the calculator, the screen, the keyboard handler, the beeper, the lower-screen "0 OK" report, even the flashing inverse-K cursor. There is no Z80 CPU emulation, no instruction decoder, no bus, no cycle-stepped ULA, and none of the original ROM bytes are ever executed — in the taxonomy of emulator design this is high-level emulation: every behaviour the 1982 hardware exposed is re-derived in idiomatic Rust from reading the original Z80 source as a specification, and then compiled to native macOS / Windows / Linux binaries and a tiny WebAssembly module that boots a Spectrum-perfect screen inside any modern browser.

You can paste a program written for a real Spectrum and it just runs. The © glyph from the original character ROM. The exact bordcr colour pair the lower screen shifts into after BORDER 2. The K-mode cursor that pulses through the FLASH attribute bit at the same cadence as the real ULA. The 0 OK, 0:1 status line that appears the instant a program completes.

It is also, deliberately, a controlled experiment in what current AI tooling can do.

Why this experiment matters

For decades, "port the BASIC ROM of a 1982 home computer to a modern stack" has been a textbook example of a project that demands a small team of specialists and a long calendar. You need someone who reads Z80, someone who understands the calculator's bytecode dispatch, someone who can reverse the screen attribute model, someone who can land it on multiple targets, and time — months of it — to align all of that with what real software actually does.

This repository was built in a handful of hours, by a single experienced AI builder driving a bespoke workflow designed specifically to reconstruct architectures out of assembly-era source — no human ROM expert in the room, no prior port to crib from. The 16 KB of commented Z80 served the same role a real hardware specification would: an authoritative reference for what the system does. The workflow handled the how — reading the source, re-deriving semantics in Rust, picking the architecture, writing the tests, debugging failures from screenshots, refactoring when the design stopped fitting, and ultimately producing a runtime that boots into a screen indistinguishable from a real Spectrum's.

That is the demonstration. The interesting thing isn't that "the AI wrote some code." The interesting thing is the kind of code:

  • Decoding undocumented legacy assembly. Following 16 KB of hand-written Z80 across thirteen files of jumps, system variables, and self-referencing data tables. Recognising the calculator's tokenised bytecode is not Z80 instructions. Inferring that bordcr is a packed attribute byte and that set_de is the editor's cursor-positioning routine. Reading the ROM the way a domain expert would — without one in the room.
  • Re-implementing semantics across a 40-year language gap. Translating side-effecty Z80 with shared system variables into an idiomatic Rust state machine with explicit ownership. Choosing where to mirror Spectrum quirks pixel-for-pixel (the © at character 0x7F, the 0 OK, 0:1 report format, the FLASH-attribute cursor pulse) and where modern abstractions are obviously better (the audio queue, the frame-driven scheduler that doesn't freeze the browser tab during an infinite loop).
  • Targeting platforms the original couldn't reach. The same Rust core compiles to a native desktop binary and to WebAssembly. The browser frontend is 16 KB of unoptimised .wasm, draws straight to a <canvas> via ImageData, and synthesises the BEEP through WebAudio.

This is work that genuinely was out of reach for an individual engineer at any reasonable cost. With the right workflow, it isn't anymore — not in months of effort, not even in days. In hours.

That shift is bigger than any one project. It's the same kind of moment as the first time compilers replaced hand-written machine code, or the first time a high-level web framework replaced bespoke CGI. The threshold of "things one person can credibly ship" just moved, and it moved a long way. The bottleneck is no longer how many specialists you can hire — it's the workflow you bring.

This repository is a small, concrete data point on that curve.

In action

A short BASIC program from the original Spectrum manual — the SIN-curve "apple" graphic — typed into the editor and then run:

Listing of the SIN-curve apple program

The same program after RUN: PLOT a+110, s-15 over nested FOR loops draws the apple wave on a BORDER 1 background

BORDER 1 paints the surrounding strip blue, RUN clears the upper screen and walks the nested FOR loops, every PLOT lands on the screen in real time, and PAUSE 0 parks the runtime until you press a key — exactly the cadence of a real 1982 machine.

What it does today

  • Full Spectrum BASIC core: LET, PRINT (with ; , ' separators, AT row,col, TAB n), INPUT, IF/THEN, GOTO, GOSUB/RETURN, STOP, FOR/NEXT/STEP, DEF FN / FN, DIM (1‑D numeric), DATA / READ / RESTORE, NEW, CLS, LIST, RUN.
  • Numeric and string values with the Spectrum suffix rule (A$).
  • String slicing: a$(n), a$(n TO m), a$(n TO), a$(TO m), a$(TO).
  • Built-in functions: SIN COS TAN ASN ACS ATN LN EXP INT ABS SQR SGN RND PI LEN CODE CHR$ STR$ VAL.
  • Comparisons returning 0/1 the Spectrum way.
  • Graphics: PLOT x,y, DRAW dx,dy, CIRCLE x,y,r, with a Bresenham line and a midpoint circle.
  • Colour: INK, PAPER, BRIGHT, FLASH, BORDER. Full 32×24 attribute file. Authentic 16‑colour Spectrum palette (8 normal + 8 BRIGHT). FLASH cells alternate ink/paper through a counter advanced by frame().
  • Audio: BEEP duration, pitch synthesised by WebAudio, with the Spectrum's blocking semantics (next statement waits for the tone to finish) and BREAK that actually cuts the playback.
  • Editor: rows 22-23 are the lower screen, rendered in bordcr after a BORDER change. The K cursor only appears once the user starts typing — exactly as on a freshly powered-on Spectrum. Boot copyright reads © 1982 Sinclair Research Ltd and lives in the lower screen until cleared.
  • Esc is BREAK (Caps Shift + Space). Interrupts a running program mid-statement, drains the audio queue, and posts the proper L BREAK into program, <line>:1 report.
  • Cmd/Ctrl+V paste pours a clipboard program into the editor as if you had typed every keystroke yourself, multi-line programs included.
  • Reports follow 07_executive.asm:218's exact format — single-character code, message text, , line:stmt.
  • Frame-driven RUN: programs execute in chunks aligned to the host's animation frames, so an infinite loop never freezes the tab and the screen redraws in real time as PRINT output appears.

How it's built

Three Cargo crates plus a tools crate for one-shot data extraction:

crates/
├── zxbasic-core/      # platform-agnostic runtime: parser, executor, display model
├── zxbasic-web/       # wasm-bindgen façade — canvas, keyboard, audio glue
└── zxbasic-native/    # desktop harness (winit + softbuffer; minimal MVP-0 stub for now)
tools/                 # one-shot binaries that extract data tables from vendor/zxrom
vendor/zxrom/          # the original 1982 ROM in commented Z80 — submodule, spec-only

The vendor/zxrom submodule is the cheveron/zxrom repository — a faithful, well-commented disassembly of the original Sinclair Research ROM that compiles back to a byte-identical binary. We use it solely as a specification: the source comments and labels tell us what each routine is supposed to do, and we re-implement that meaning in Rust. The Z80 itself is never executed, and the binary the source produces (which remains the property of Sky/Comcast) is never built or shipped. Data tables that are reproduced — the 96‑glyph font, the keyword table, the error messages — are extracted by one-shot Rust programs in tools/ and committed as plain Rust constants.

The runtime is a state machine over BASIC semantics — there is no Z80 CPU underneath. System owns everything: the BASIC program (a BTreeMap<u16, String> of stored lines), the variable table, the for-stack, the gosub-stack, the user-fn table, the array table, the audio queue, the program counter, the BREAK flag, the BEEP-blocking frame countdown, the editor input line, and the lower-screen status. The host (browser or native window) calls feed_key, frame, and render_into — that's the entire API. Everything else, including the JS-side audio scheduling and the canvas paint, is a thin glue layer.

Running it locally

# Clone with the ROM disassembly submodule:
git clone --recursive https://github.com/ashtree74/zxbasic-rust.git
cd zxbasic-rust

# Web build (requires rustup + wasm-pack):
wasm-pack build crates/zxbasic-web --target web --out-dir ../../web/pkg
python3 -m http.server 8765 -d web
# open http://localhost:8765/index.html

# Run the full test suite:
cargo test -p zxbasic-core

Deploying to a VPS

The whole runtime is a static site once the WebAssembly bundle has been built: an HTML file, a JS shim, and a .wasm binary, all under web/. Any HTTP server that can serve a directory works. On a Linux VPS the smallest reasonable setup is:

# One-time install of the Rust toolchain (skip if already present):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
rustup target add wasm32-unknown-unknown
cargo install wasm-pack

# Clone the repo somewhere persistent on the VPS:
sudo mkdir -p /opt && cd /opt
sudo git clone --recursive https://github.com/ashtree74/zxbasic-rust.git
cd zxbasic-rust

# Build the WebAssembly bundle into web/pkg:
wasm-pack build crates/zxbasic-web --target web --out-dir ../../web/pkg

Then point your existing web server at /opt/zxbasic-rust/web/.

For the canonical deployment at experiments.frontierslab.ai/zxspectrum, nginx looks roughly like:

location /zxspectrum/ {
    alias /opt/zxbasic-rust/web/;
    try_files $uri $uri/ /zxspectrum/index.html;
}

Apache:

Alias /zxspectrum /opt/zxbasic-rust/web
<Directory /opt/zxbasic-rust/web>
    Require all granted
</Directory>

To update to the latest commit:

cd /opt/zxbasic-rust
git pull --recurse-submodules
wasm-pack build crates/zxbasic-web --target web --out-dir ../../web/pkg

That's it — no rsync, no CI secrets, no third-party hosting. Wire git pull into a cron job or a webhook handler if you want it automated.

Roadmap

Already in: everything listed under "What it does today."

Reasonable next steps (none required for the demo to be useful):

  • AND / OR / NOT operators in expressions.
  • SAVE / LOAD of programs to / from localStorage.
  • Multi-dimensional arrays; string arrays.
  • INVERSE, OVER, BRIGHT n, FLASH n as inline PRINT modifiers.
  • A full K/L/C/E/G mode editor with single-keystroke keyword entry — the most authentic touch left to add. This pulls in the rest of 02_keyboard.asm's token table and editor mode tables.
  • Optional Z80 emulator backplane to let real .tap games run — explicit non-goal of the BASIC project, but trivially layerable on top once someone wants it.

Credits & contact

Built by Adam Jesionkiewicz at Frontiers Lab, an applied AI lab exploring what current AI tooling makes newly feasible.

The ZX Spectrum is © Sky/Comcast (formerly Sinclair Research Ltd, 1982). This project reimplements the semantics of the system's BASIC interpreter from a Creative Commons-licensed source disassembly and ships no binary derived from the original ROM. The character font is reproduced under the source disassembly's CC BY-SA 4.0 terms.

The Z80 source used as a specification is cheveron/zxrom, © 2011 Source Solutions, Inc., released under CC BY-SA 4.0 — the source files are public for historical and educational use; the binary they produce is not. We respect that boundary.

Inspirations & borrowings

The CRT shader pipeline borrows from two public-domain Godot shaders by Harrison Allen — "CRT with luminance preservation" and the "no scanlines" variant — for the radial barrel warp, the sRGB-linear mask math, the three-tap subpixel reconstruction with per-channel beam offsets, and the catalogue of phosphor patterns (Dots, Aperture, Wide, Wide Soft, Slot). The screen-rect layout, the BORDER stripe rendering, the rounded bezel, the master toggle, and the settings UI on top are ours.

The wider analog-CRT feel — burn-in phosphor trail, static noise, screen flicker, jitter, horizontal-sync wobble, ambient halation, the curated monochrome phosphor profiles (Amber, Green, Apple ][, IBM CGA, Vintage), and the rasterization-pattern picker — is modelled on Swordfish90's cool-retro-term, the QML/GLSL terminal that set the bar for this look. Our implementation is a from-scratch WebGL2 port of those ideas; nothing is copied verbatim.

License

The Rust source in this repository is dual MIT / Apache‑2.0. Data tables extracted from vendor/zxrom (the 96‑glyph font, eventually the keyword and key‑map tables) inherit the upstream CC BY‑SA 4.0 licence.