frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: An ObjC-like compiler for Mac ARM, x86_64(Linux, Win), WASM, & others

1•spacedcowboy•54m ago
Hi folks,

So this is my announcement of a compiler[1] I've been working on for about 6 months now (so yes, to get the obvious out of the way early, this was written with Claude code).

The compiler is called 'xc', stands for 'cross-C' or 'extended-C' or whatever you want, really. It's fairly similar to Objective-C in style (without the [] brackets), and in fact the first version of the language was written in ObjC.

It works on Mac M-series, Windows, and Linux - and any of these hosts can create binaries for any of {Mac M-series, Windows, Linux, Android, iOS, WASM, Arm9 (Zynq), m68k and even 6502}.

Building the compiler needs host-tools to bootstrap everything, either GNUStep on Linux, or a Mac with Xcode. Once built, however, the system is entirely self-contained, and you don't need any platform tools. I have a binary running on my iPhone which was compiled and signed on a Linux box... The suite ships with 5 host-specific assemblers, 10 object/executable writers, and a native Apple code-signer (we don't shell out to 'codesign') Downloads are available at [3] for all three hosts (xcc-osx-0.6.tar.bz2, xcc-linux-0.6.tar.bz2, xcc-win64-0.6.zip). Linux and Windows are larger because of static linking to make sure things are easy to run.

The documentation for the language is all at [2], it goes into the language details, but you get ARC (Automatic reference counting, which automatically goes atomic when you have threads), blocks, callbacks, Classes, and Protocols. It's an optimising compiler with a shared IR, deliberately not LLVM's IR because one of the original targets was the 6502, and LLVM likes register-rich architectures. The compiler runs Vectorize, LICM, LoopRotate, LoopUnroll (fixed and variable trip), StrengthReduce, Inline, TailRecursion, NarrowIV, PointerIV, RedundantLoadCSE, IdiomMemset, LoopReductionCollapse,...

One major inter-operability feature is the ability to say #import <GEM> (or #use, which also promotes its statics into the bare-call space) and have the compiler read libGEM.so, parse its DWARF, and expose the functions, types and enum constants inside. Xc uses the platform's native structure packing, so binding a C library is mostly just pointing -L at it.

The Licence for the compiler is GPL3, for the standard library there's the "standard" library exception, since that code is bundled into most apps. Bottom line, you are free to create any applications you like, open or closed, without any licensing issues. If you make a fix to the compiler, I would appreciate the bug report/patch.

A utility in the tools/ section is c2xc. This takes almost all C code (I used it on Kundert's Sparse 1.4 — sparse.sourceforge.net) and converts it to valid XC. It might not be the best XC possible, but it will compile, and if you're trying to produce WASM code and can't just #use a dynamic library, this is the important part :)

There's also the beginnings of a cross-platform UI toolkit and Interface-Builder, though these are very early days.

There are 568 fixtures, 608 unit-tests, two simulators (6502 and 68k) and ~50 differential scripts to check output vs clang / binutils. The compiler is written in its own language, forming a "reference" ObjC compiler and the "shipped" written-in-xc compiler (all 120k lines of it), meaning it has two chances to find obscure bugs. Other real-world tests have been:

- transpiling Kundert's Sparse 1.4 to xc and diffing its test program's output against a clang build of the same library

- a circuit simulator built on it, checked against ngspice-47 and against an independent numpy MNA implementation

- writing a "test in anger" application, a server that listens for incoming web requests, parses them, uses them to query a DB and then sends the results out to a web-client (written in XC, and compiled to WASM)

Enjoy :)

1: https://github.com/ThrudTheBarbarian/xc

2: https://compile-xc.org/

3: https://compile-xc.org/compiler/downloads

We've created the first vectorized Quicksort

https://opensource.googleblog.com/2022/06/Vectorized%20and%20performance%20portable%20Quicksort.html
1•mococa•37s ago•0 comments

9-year-old Minecraft YouTuber ran up a $118,000 ad bill using dad's company card

https://www.videogameschronicle.com/news/im-definitely-cooked-a-9-year-old-minecraft-youtuber-ran...
1•speckx•2m ago•0 comments

Ask HN: What is the best local model that runs on your Mac at decent speed?

1•carloslfu•7m ago•0 comments

UK mathematician debunks myth around Parthenon's optical illusions

https://www.theguardian.com/science/2026/sep/16/uk-mathematician-debunks-myth-parthenon-optical-i...
2•pseudolus•7m ago•0 comments

A masterfully architected application for solving ANYTHING

https://the-analog-method--sophiasbookofl2.replit.app/
1•Harperissharper•7m ago•0 comments

Artificial Analysis: What Is the Intelligence Index Measuring?

https://itsmonkey.business/blogposts/01-On_Artificial_Analysis.html
1•baddash•8m ago•0 comments

GoBench: Evaluating LLMs on 9×9 Go using KataGo opponents as Elo anchors

https://rolandgao.com/blog/gobench/
1•GodelNumbering•8m ago•1 comments

Pull the best espresso shot with derivative-free optimization

https://humpday.microprediction.org/applications/espresso.html
1•timkpaine•10m ago•0 comments

An agent fleet needs a new kind of OS, not a bigger harness

https://pentad.ai/blog/fleet-needs-an-os/
3•kgcgfva•10m ago•0 comments

Iran improved targeting of US assets. How Russian satellites likely have helped

https://www.cnn.com/2026/09/16/world/video/russia-spy-satellites-iran-intelligence-strikes-us-ass...
1•giuliomagnifico•16m ago•0 comments

Fed approves interest rate hike, signals one more to come this year

https://www.cnbc.com/2026/09/16/fed-rate-decision-september-2026.html
5•rawgabbit•17m ago•0 comments

Is GitHub a social network that endangers children? Australia wants to know

https://www.theregister.com/offbeat/2025/09/25/australia-asks-github-if-its-a-dangerous-social-ne...
2•docflabby•18m ago•0 comments

Jotter – A local recording and transcription tool written in Rust

https://github.com/nfishel48/Jotter
1•movingmovie•20m ago•1 comments

NASA spacecraft discovers a new crater on the moon

https://apnews.com/article/moon-lunar-crater-space-nasa-80eea242ad275fda1f7a88587cdccd2f
1•dwringer•20m ago•0 comments

Feds Want California to Give Up 14 Years of Broadband Protections. It Should Sue

https://cyberlaw.stanford.edu/blog/2026/09/california-is-being-asked-to-give-up-14-years-of-broad...
1•rsingel•22m ago•0 comments

Who is vertigoruntime and how do they have 3 posts on the front page rn?

https://news.ycombinator.com/user?id=vertigoruntime
1•johnnyApplePRNG•22m ago•1 comments

GDScript: The Good, Bad, and Ugly Parts

https://azhdarchid.com/gdscript-good-bad-ugly/
3•birdculture•24m ago•0 comments

Fed Raises Rates as Warsh Bucks Trump to Contain Inflation

https://www.bloomberg.com/news/articles/2026-09-16/fed-raises-rates-as-warsh-bucks-trump-to-conta...
13•toomuchtodo•26m ago•4 comments

Show HN: Real-Time Chess Assistant (C++ DirectX, OpenCV, ImGui and Stockfish)

https://github.com/rccmb/oracle
2•baptistarodrigo•26m ago•1 comments

How to Train a Frontier-Level World Model

https://next-state.github.io/open-dreamer/
3•Sacco215•27m ago•0 comments

The Oddity of Your Sneezes

https://bodilyoddities.com/blog/the-oddity-of-your-sneezes/
2•vesterde•29m ago•1 comments

Statement On V/H/S SCP Foundation Film

https://scp-wiki.wikidot.com/statement-on-vhs-film
3•andybak•31m ago•0 comments

First Round Capital Sales Program – Free

https://www.firstround.com/sales-combine
1•lockeluhnow•32m ago•1 comments

Show HN: TabMail. Open-source AI email for Thunderbird and iPhone

https://tabmail.ai/
2•kmyi•33m ago•0 comments

Show HN: I built a router for agent tools

https://github.com/monid-ai/monid
8•Exquisitian•33m ago•2 comments

AI Safety Needs a State

https://atomstointelligence.substack.com/p/ai-safety-needs-a-state
2•abhinavsns•34m ago•0 comments

Show HN: Pkgbot – Fast Linux package search engine

https://pkg.bot
2•knadh•35m ago•0 comments

ArXivMath and BrokenArXiv: Harder Problems and Revised Grading

https://matharena.ai/arxiv_august/
5•bluepeter•37m ago•0 comments

Every Agent Session Is a Test Run

https://mielony.com/blog/self-improvement-by-cron/
2•tkwiatek•39m ago•0 comments

OpenAI's Navier-Stokes Proof Meets a New Kind of Database

https://8braid.com/journal/openai-navier-stokes-proof-meets-a-new-kind-of-database
4•ashdee•41m ago•0 comments