frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Ask HN: How far has "vibe coding" come?

4•pigon1002•4h ago•8 comments

The Anti-Pomodoro Technique: Focus on Taking Breaks, Not Watching the Timer

4•kentich•1h ago•1 comments

Ask HN: Books to learn 6502 ASM and the Apple II

97•abkt•2d ago•67 comments

Ask HN: Who do you follow via RSS feed?

67•znpy•2d ago•51 comments

Designing programming languages beyond AI comprehension

4•mr_bob_sacamano•15h ago•6 comments

Ask HN: DDD was a great debugger – what would a modern equivalent look like?

56•manux81•3d ago•60 comments

Ask HN: What recent UX changes make no sense to you?

29•superasn•1d ago•34 comments

Ask HN: Has Show HN become LLM-prompt-centric?

8•piratesAndSons•15h ago•3 comments

Ask HN: What's the Point Anymore?

60•fnoef•1d ago•73 comments

Ask HN: Gmail spam filtering suddenly marking everything as spam?

210•goopthink•4d ago•122 comments

Ask HN: Where to find cool companies to work for?

5•truetaurus•16h ago•4 comments

How much recurring income do you generate in 2026 and from what?

9•djshah•1d ago•4 comments

Ask HN: What's the current best local/open speech-to-speech setup?

256•dsrtslnd23•6d ago•61 comments

Ask HN: Vibe Researching" with AI – Anyone Using It for Real?

8•spenceXu•1d ago•5 comments

Ask HN: Notification Overload

7•fractal618•2d ago•8 comments

Ask HN: European alternative to Vercel/Cloudflare for hosting

11•vldszn•1d ago•14 comments

Where can I find startups looking for fractional product leads?

6•stulogy•1d ago•3 comments

How to DeGoogle Myself?

12•neuralkoi•1d ago•1 comments

Ask HN: How to prevent Claude/GPT/Gemini from reinforcing your biases?

29•akshay326•2d ago•22 comments

I built a C++ runtime with immutable objects and no GIL

5•gamarino•1d ago•3 comments

Ask HN: How much emphasis to put on unit testing and when?

9•theturtlemoves•2d ago•18 comments

Tell HN: I cut Claude API costs from $70/month to pennies

40•ok_orco•3d ago•25 comments

Ask HN: If Everyone Can "Build" a SaaS, What Becomes Valuable?

10•spenceXu•1d ago•8 comments

Ask HN: Can a MMO be vibe coded?

3•radicalethics•20h ago•4 comments

Ask HN: What usually happens after a VC asks for a demo?

12•stijo•4d ago•7 comments

Tell HN: JumpCloud 2FA appears to be down

2•sgammon•1d ago•0 comments

Why did the developer go broke?

7•oxqbldpxo•1d ago•6 comments

Generative AI failed to replace SaaS

3•AIFairy•1d ago•2 comments

Ask HN: What's something interesting you learned from training your own GPT?

2•amadeuswoo•1d ago•3 comments

Ask HN: If OpenAI stops its free Web service (ChatGPT)

3•JPLeRouzic•1d ago•2 comments
Open in hackernews

I built a C++ runtime with immutable objects and no GIL

5•gamarino•1d ago
I’ve spent the last few months rethinking how a dynamic language runtime should interact with modern hardware. The result is ProtoCore and its first major implementation, ProtoJS.

Most dynamic runtimes (Python, Ruby, and even JS engines) handle concurrency through Global Interpreter Locks (GIL) or complex memory barriers because managing mutable state across threads is notoriously difficult.

With ProtoCore, I took a different path based on three pillars:

Immutability by Default: All core data structures are immutable. Instead of locking, we use structural sharing for memory efficiency. This inherently eliminates data races at the object level.

Hardware-Aware Memory Model: Objects are cache-line aligned (64-byte cells) to prevent false sharing and optimize cache locality.

Tagged Pointers: We use a 56-bit embedded payload for SmallIntegers, meaning zero heap allocation for most numeric operations.

To prove the architecture, I built ProtoJS. It uses QuickJS for parsing but replaces the entire runtime with ProtoCore primitives. This allows for real worker thread execution ("Deferred") where immutable objects are shared across threads without copying or GIL-related contention.

Current Status:

ProtoCore: 100% test pass rate (50/50 tests) and a comprehensive technical audit completed today.

ProtoJS: Phase 1 complete, demonstrating real parallel execution and sub-1ms GC pauses.

I’m an Electronic Engineer by training (now a university professor), and I wanted to see if applying low-level hardware principles could fix the high-level concurrency "mess."

I’d love to hear your thoughts on the trade-offs of this immutable-first approach in systems programming.

ProtoCore (The engine): https://github.com/numaes/protoCore ProtoJS (The JS runtime): https://github.com/gamarino/protoJS

Comments

gamarino•1d ago
Context & Technical Highlights I’ve been exploring the intersection of low-level hardware constraints and high-level dynamic runtimes. The goal with ProtoCore was to build a system where concurrency isn’t an afterthought, but a result of the memory model itself.

Key Architectural Decisions:

Immutability-First: Every core data structure is immutable by default, utilizing structural sharing to remain memory-efficient. This allows us to run without a Global Interpreter Lock (GIL).

Hardware-Aware Design: Objects are allocated as 64-byte Cells, aligned with CPU cache lines to prevent false sharing and optimize cache locality.

Tagged Pointers: We use the lower bits for type tagging, allowing 56-bit integers to be stored directly in the pointer (zero-allocation for small integers).

Concurrent GC: A dedicated GC thread handles reclamation with minimal stop-the-world pauses (typically <1ms).

To demonstrate this, I built ProtoJS. It uses QuickJS for the frontend (parsing/bytecode) but replaces the entire runtime with ProtoCore primitives. This enables a unique "Deferred" execution model where we can ship bytecode to real worker threads and share immutable state with zero-copy overhead.

Project Status: ProtoCore has just passed a full technical audit with 100% test coverage (50/50 tests) and ~5,780 LOC of production-grade C++20. ProtoJS is currently in its Phase 1 (demonstrator), successfully proving parallel execution across thread pools.

I'm a university professor and electronic engineer based in Argentina, and I'm very interested in discussing the trade-offs of this "immutable-at-the-bottom" approach for future runtime development.

gus_massa•1d ago
Clicky: https://github.com/numaes/protoCore https://github.com/gamarino/protoJS

> ProtoJS: Phase 1 complete, demonstrating real parallel execution and sub-1ms GC pauses.

Is it a moving GC or a non-moving GC? IIRC Golang use a non-moving GC to make pauses very short.

Is it possible to create cycles? I think I didn't use cycles since a long time ago, but it's useful for big systems with a lot of interacting objects.

gamarino•1d ago
It is a non-moving GC.

The short pauses are a direct consequence of the immutable-by-default model. Once we collect the roots from thread stacks and global data during a brief Stop-The-World (STW) phase, those objects will not be modified by user threads. This allows the GC thread to perform the marking and sweeping phases in parallel with application threads without needing complex write barriers or locks.

Regarding mutability and cycles:

All mutable objects are managed through a centralized structure whose root is scanned during the STW phase.

Even this internal tracking structure uses immutable tree patterns, ensuring that once the GC starts its parallel phase, the pointers it is traversing remain stable.

Cycles are indeed possible in the object model, and the Mark-and-Sweep algorithm handles them naturally, ensuring that big systems with complex interactions don't leak memory.

The goal was to eliminate the standard synchronization overhead (locks/barriers) by leveraging the fact that 99% of the object graph is immutable and hardware-aligned.