frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Coi – A language that compiles to WASM, beats React/Vue

2•io_eric•1h ago
I usually build web games in C++, but using Emscripten always felt like overkill for what I was doing. I don't need full POSIX emulation or a massive standard library just to render some stuff to a canvas and handle basic UI.

The main thing I wanted to solve was the JS/WASM interop bottleneck. Instead of using the standard glue code for every call, I moved everything to a Shared Memory architecture using Command and Event buffers.

The way it works is that I batch all the instructions in WASM and then just send a single "flush" signal to JS. The JS side then reads everything directly out of Shared Memory in one go. It’s way more efficient, I ran a benchmark rendering 10k rectangles on a canvas and the difference was huge: Emscripten hit around 40 FPS, while my setup hit 100 FPS.

But writing DOM logic in C++ is painful, so I built Coi. It’s a component-based language that statically analyzes changes at compile-time to enable O(1) reactivity. Unlike traditional frameworks, there is no Virtual DOM overhead; the compiler maps state changes directly to specific handles in the command buffer.

I recently benchmarked this against React and Vue on a 1,000-row table: Coi came out on top for row creation, row updating and element swapping because it avoids the "diffing" step entirely and minimizes bridge crossings. Its bundle size was also the smallest of the three.

One of the coolest things about the architecture is how the standard library works. If I want to support a new browser API (like Web Audio or a new Canvas feature), I just add the definition to my WebCC schema file. When I recompile the Coi compiler, the language automatically gains a new standard library function to access that API. There is zero manual wrapping involved.

I'm really proud of how it's coming along. It combines the performance of a custom WASM stack with a syntax that actually feels good to write (for me atleast :P). Plus, since the intermediate step is C++, I’m looking into making it work on the server side too, which would allow for sharing components across the whole stack.

Example (Coi Code):

component Counter(string label, mut int& value) {

    def add(int i) : void {
        value += i;
    }

    style {
        .counter {
            display: flex;
            gap: 12px;
            align-items: center;
        }
        button {
            padding: 8px 16px;
            cursor: pointer;
        }
    }

    view {
        <div class="counter">
            <span>{label}: {value}</span>
            <button onclick={add(1)}>+</button>
            <button onclick={add(-1)}>-</button>
        </div>
    }
}

component App { mut int score = 0;

    style {
        .app {
            padding: 24px;
            font-family: system-ui;
        }
        h1 {
            color: #1a73e8;
        }
        .win {
            color: #34a853;
            font-weight: bold;
        }
    }

    view {
        <div class="app">
            <h1>Score: {score}</h1>
            <Counter label="Player" &value={score} />
            <if score >= 10>
                <p class="win">You win!</p>
            </if>
        </div>
    }
}

app { root = App; title = "My Counter App"; description = "A simple counter built with Coi"; lang = "en"; }

Live Demo: https://io-eric.github.io/coi

Coi (The Language): https://github.com/io-eric/coi

WebCC: https://github.com/io-eric/webcc

I'd love to hear what you think. It's still far from finished, but as a side project I'm really excited about :)

Comments

hans2002•1h ago
Binary size alone got me interested. What's missing before 1.0?

Collaborative editing with AI is hard

https://www.moment.dev/blog/collab-with-ai-is-hard
1•antics•2m ago•0 comments

Show HN: WhoDB CLI – Terminal database client (Golang) with local AI support

1•hkdeman•4m ago•0 comments

Hootsuite seeks business with ICE amid financial pressures

https://www.theglobeandmail.com/business/article-hootsuite-canada-vancouver-ice-social-media-cont...
1•corny•5m ago•1 comments

Stop Vibe Shipping Agents

1•exordex•7m ago•0 comments

Amazon CEO says Trump tariffs are driving prices up

https://www.axios.com/2026/01/20/amazon-prices-trump-tariffs-andy-jassy-davos
3•belter•7m ago•1 comments

My Meandering Path to Silver

https://www.campbellramble.ai/p/my-meandering-path-to-silver
1•surprisetalk•8m ago•0 comments

Got factory ruin. Now builds Nordic prefab homes with industrial precision [video]

https://www.youtube.com/watch?v=oxWXMInZm-g
1•surprisetalk•8m ago•0 comments

Guide to Retroarch, system, emulator, core, and ROM config files (2021)

https://www.raphkoster.com/about-raph/hobbies/emulation/guide-to-retroarch-system-emulator-core-a...
1•surprisetalk•8m ago•0 comments

Can you read 900 words per minute?

https://substack.com/@jameslucasit/note/c-202186114
3•Jun8•11m ago•1 comments

WildCAT3D: Appearance-Aware Multi-View Diffusion in the Wild

https://arxiv.org/abs/2506.13030
1•PaulHoule•11m ago•0 comments

Article on the History of Spot Instances: Analyzing Spot Instance Pricing Change

https://spot.rackspace.com/blogs/history-of-spot-instances
2•aleroawani•12m ago•0 comments

Show HN: NativeLine – Build native iOS apps through conversation (Swift only)

2•Nativeline•12m ago•1 comments

Ozempic Is Reshaping the Fast Food Industry

https://philippdubach.com/posts/ozempic-is-reshaping-the-fast-food-industry/
2•7777777phil•13m ago•0 comments

Show HN: Open-source tool for converting docs into .md and loading into Postgres

https://github.com/pgEdge/pgedge-docloader
1•pgedge_postgres•16m ago•0 comments

Monitor Hacker News Post in Realtime

https://www.timeplus.com/post/hacker-news-monitoring
1•gangtao•16m ago•0 comments

Shallow review of technical AI safety (2025)

https://www.lesswrong.com/posts/Wti4Wr7Cf5ma3FGWa/shallow-review-of-technical-ai-safety-2025-2
1•ofou•19m ago•0 comments

Show HN: Run Claude Code from WhatsApp

https://github.com/gokapso/claude-code-whatsapp
2•aamatte•20m ago•0 comments

The Repetition of China

https://madeinchinajournal.com/2025/10/15/the-repetition-of-china/
2•keiferski•20m ago•0 comments

Memory chip makers could face 100% tariffs unless increased US production

https://www.pcgamer.com/hardware/memory/spraying-kerosene-over-the-dram-inferno-us-commerce-secre...
3•perihelions•20m ago•1 comments

'It's Now Happening'–Urgent U.S. Dollar 'Collapse' Warning Issued

https://www.forbes.com/sites/digital-assets/2026/01/20/get-ready-us-dollar-collapse-warning-issue...
6•hypnot•21m ago•2 comments

A scammer's blueprint: How cybercriminals plot to rob a target in a week

https://www.reuters.com/graphics/SOUTHEASTASIA-SCAMS/MANUALS/klpyjlqelvg/
3•giuliomagnifico•21m ago•0 comments

Pipeline Parallelism in SGLang: Scaling to Million-Token Contexts and Beyond

https://lmsys.org/blog/2026-01-15-chunked-pipeline/
1•gmays•23m ago•0 comments

SWE-gen: Scaling SWE-bench task generation

https://github.com/abundant-ai/SWE-gen
3•coffeecoder123•25m ago•0 comments

Blog: Prototyping a Bloom filter-based erasure code in Zig

https://lumramabaja.com/posts/let-it-bloom-the-seeds-of-information-chaining-part-1/
1•irwt•26m ago•0 comments

Ads in ChatGPT, Why OpenAI Needs Ads, the Long Road to Instagram

https://stratechery.com/2026/ads-in-chatgpt-why-openai-needs-ads-the-long-road-to-instagram/
1•feross•27m ago•0 comments

Curl closing their bug bounty due to overload and abuse

https://github.com/curl/curl/pull/20312
4•troupo•27m ago•0 comments

The Battlefield Is Now Your Mind

https://gilpignol.substack.com/p/the-battlefield-is-now-your-mind
3•light_triad•27m ago•0 comments

File systems are here to stay

https://archil.com/post/why-file-systems-are-here-to-stay
2•mathewpregasen•29m ago•0 comments

Free Next.js Hosting

https://www.hyploy.co.uk/
2•hellosoftware•31m ago•0 comments

Claude Code as a Sales Guy

https://twitter.com/chaaai/status/2013530788676149755
4•chaitanyya•32m ago•1 comments