HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
rafa-rrayes
SHDL
Python2026–2026
rafa-rrayes / SHDL

SHDL

A minimalist HDL built entirely from logic gates for education and experimentation. Compiles circuits to C so that they can run anywhere

2Distinct people
3Mentions
1Explicit recommenders
53GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A minimalist HDL built entirely from logic gates for education and experimentation. Compiles circuits to C so that they can run anywhere

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

The project looks great! I browsed the codebase and enjoyed how much documentation there is about the user-facing and internal workings. I'm not familiar with the subject…

lioeters used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by 3-hour interval3 dated mentions

Observed mentions: 2026-01-26 00:34:58 UTC to 2026-01-29 13:42:47 UTC.

012026-01-26 00:00:00 UTC to 2026-01-26 03:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsJan 26, 00:002026-01-26 03:00:00 UTC to 2026-01-26 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-26 06:00:00 UTC to 2026-01-26 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-26 09:00:00 UTC to 2026-01-26 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-26 12:00:00 UTC to 2026-01-26 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-26 15:00:00 UTC to 2026-01-26 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-26 18:00:00 UTC to 2026-01-26 21:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-26 21:00:00 UTC to 2026-01-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 00:00:00 UTC to 2026-01-27 03:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 03:00:00 UTC to 2026-01-27 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 06:00:00 UTC to 2026-01-27 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 09:00:00 UTC to 2026-01-27 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 12:00:00 UTC to 2026-01-27 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 15:00:00 UTC to 2026-01-27 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-27 18:00:00 UTC to 2026-01-27 21:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJan 27, 18:002026-01-27 21:00:00 UTC to 2026-01-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 00:00:00 UTC to 2026-01-28 03:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 03:00:00 UTC to 2026-01-28 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 06:00:00 UTC to 2026-01-28 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 09:00:00 UTC to 2026-01-28 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 12:00:00 UTC to 2026-01-28 15:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2026-01-28 15:00:00 UTC to 2026-01-28 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 18:00:00 UTC to 2026-01-28 21:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-28 21:00:00 UTC to 2026-01-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-29 00:00:00 UTC to 2026-01-29 03:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-29 03:00:00 UTC to 2026-01-29 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-29 06:00:00 UTC to 2026-01-29 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-29 09:00:00 UTC to 2026-01-29 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-29 12:00:00 UTC to 2026-01-29 15:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJan 29, 12:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jan 26, 00:002026-01-26 00:00:00 UTC2026-01-26 03:00:00 UTC110
Jan 26, 03:002026-01-26 03:00:00 UTC2026-01-26 06:00:00 UTC000
Jan 26, 06:002026-01-26 06:00:00 UTC2026-01-26 09:00:00 UTC000
Jan 26, 09:002026-01-26 09:00:00 UTC2026-01-26 12:00:00 UTC000
Jan 26, 12:002026-01-26 12:00:00 UTC2026-01-26 15:00:00 UTC000
Jan 26, 15:002026-01-26 15:00:00 UTC2026-01-26 18:00:00 UTC000
Jan 26, 18:002026-01-26 18:00:00 UTC2026-01-26 21:00:00 UTC000
Jan 26, 21:002026-01-26 21:00:00 UTC2026-01-27 00:00:00 UTC000
Jan 27, 00:002026-01-27 00:00:00 UTC2026-01-27 03:00:00 UTC000
Jan 27, 03:002026-01-27 03:00:00 UTC2026-01-27 06:00:00 UTC000
Jan 27, 06:002026-01-27 06:00:00 UTC2026-01-27 09:00:00 UTC000
Jan 27, 09:002026-01-27 09:00:00 UTC2026-01-27 12:00:00 UTC000
Jan 27, 12:002026-01-27 12:00:00 UTC2026-01-27 15:00:00 UTC000
Jan 27, 15:002026-01-27 15:00:00 UTC2026-01-27 18:00:00 UTC000
Jan 27, 18:002026-01-27 18:00:00 UTC2026-01-27 21:00:00 UTC000
Jan 27, 21:002026-01-27 21:00:00 UTC2026-01-28 00:00:00 UTC000
Jan 28, 00:002026-01-28 00:00:00 UTC2026-01-28 03:00:00 UTC000
Jan 28, 03:002026-01-28 03:00:00 UTC2026-01-28 06:00:00 UTC000
Jan 28, 06:002026-01-28 06:00:00 UTC2026-01-28 09:00:00 UTC000
Jan 28, 09:002026-01-28 09:00:00 UTC2026-01-28 12:00:00 UTC000
Jan 28, 12:002026-01-28 12:00:00 UTC2026-01-28 15:00:00 UTC110
Jan 28, 15:002026-01-28 15:00:00 UTC2026-01-28 18:00:00 UTC000
Jan 28, 18:002026-01-28 18:00:00 UTC2026-01-28 21:00:00 UTC000
Jan 28, 21:002026-01-28 21:00:00 UTC2026-01-29 00:00:00 UTC000
Jan 29, 00:002026-01-29 00:00:00 UTC2026-01-29 03:00:00 UTC000
Jan 29, 03:002026-01-29 03:00:00 UTC2026-01-29 06:00:00 UTC000
Jan 29, 06:002026-01-29 06:00:00 UTC2026-01-29 09:00:00 UTC000
Jan 29, 09:002026-01-29 09:00:00 UTC2026-01-29 12:00:00 UTC000
Jan 29, 12:002026-01-29 12:00:00 UTC2026-01-29 15:00:00 UTC101

What Hacker News says

3 sources
lioeters·Jan 29, 2026Recommendation phrase
The project looks great! I browsed the codebase and enjoyed how much documentation there is about the user-facing and internal workings. I'm not familiar with the subject matter but I do love me a DSL, so the language design aspect was interesting to learn about. I was curious how the language compiles to C, what the resulting code does, and how one interacts with it. It took a while of reading to find it, so maybe this could be linked from places where compilation is mentioned. This part is my favorite, it's cool how it works. Especially since you mention "anti-abstraction", I like seeing how the DSL maps to C. https://github.com/rafa-rrayes/SHDL/blob/master/docs/docs/ar... > Compiles circuits to C so that they can run anywhere Input (Base SHDL): component Buffer(A) -> (B) { n1: NOT; n2: NOT; connect { A
Read the rest
-> n1.A; n1.O -> n2.A; n2.O -> B; } } Output (C code): #include <stdint.h> #include <string.h> typedef struct { uint64_t NOT_O_0; } State; static inline State tick(State s, uint64_t A) { State n = s; // NOT gate inputs uint64_t NOT_0_A = 0ull; NOT_0_A |= ((uint64_t)-( (A & 1u) )) & 0x1ull; NOT_0_A |= ((uint64_t)-( ((s.NOT_O_0 >> 0) & 1u) )) & 0x2ull; // Evaluate NOT gates n.NOT_O_0 = (~NOT_0_A) & 0x3ull; // 2 active lanes return n; } static inline uint64_t extract_B(const State *s) { return (s->NOT_O_0 >> 1) & 1ull; // B from lane 1 } ...
In Show HN: SHDL – A minimal hardware description language built from logic gates

Show HN: SHDL – A minimal hardware description language built from logic gates

Hi, everyone! I built SHDL (Simple Hardware Description Language) as an experiment in stripping hardware description down to its absolute fundamentals. In SHDL, there are no arithmetic operators, no implicit bit widths, and no high-level constructs. You build everything explicitly from logic gates and wires, and then compose larger components hierarchically. The goal is not synthesis or performance, but understanding: what digital systems actually look like when abstractions are removed. SHDL is accompanied by PySHDL, a Python interface that lets you load circuits, poke inputs, step the simulation, and observe outputs. Under the hood, SHDL compiles circuits to C for fast execution, but the language itself remains intentionally small and transparent. This is not meant to replace Verilog or VHDL. It’s aimed at: - learning digital logic from
Read the rest
first principles - experimenting with HDL and language design - teaching or visualizing how complex hardware emerges from simple gates. I would especially appreciate feedback on: - the language design choices - what feels unnecessarily restrictive vs. educationally valuable - whether this kind of “anti-abstraction” HDL is useful to you. Repo: https://github.com/rafa-rrayes/SHDL Python package: PySHDL on PyPI To make this concrete, here are a few small working examples written in SHDL: 1. Full Adder component FullAdder(A, B, Cin) -> (Sum, Cout) { x1: XOR; a1: AND; x2: XOR; a2: AND; o1: OR; connect { A -> x1.A; B -> x1.B; A -> a1.A; B -> a1.B; x1.O -> x2.A; Cin -> x2.B; x1.O -> a2.A; Cin -> a2.B; a1.O -> o1.A; a2.O -> o1.B; x2.O -> Sum; o1.O -> Cout; } } 2. 16 bit register # clk must be high for two cycles to store a value component Register16(In[16], clk) -> (Out[16]) { >i[16]{ a1{i}: AND; a2{i}: AND; not1{i}: NOT; nor1{i}: NOR; nor2{i}: NOR; } connect { >i[16]{ # Capture on clk In[{i}] -> a1{i}.A; In[{i}] -> not1{i}.A; not1{i}.O -> a2{i}.A; clk -> a1{i}.B; clk -> a2{i}.B; a1{i}.O -> nor1{i}.A; a2{i}.O -> nor2{i}.A; nor1{i}.O -> nor2{i}.B; nor2{i}.O -> nor1{i}.B; nor2{i}.O -> Out[{i}]; } } } 3. 16-bit Ripple-Carry Adder use fullAdder::{FullAdder}; component Adder16(A[16], B[16], Cin) -> (Sum[16], Cout) { >i[16]{ fa{i}: FullAdder; } connect { A[1] -> fa1.A; B[1] -> fa1.B; Cin -> fa1.Cin; fa1.Sum -> Sum[1]; >i[2,16]{ A[{i}] -> fa{i}.A; B[{i}] -> fa{i}.B; fa{i-1}.Cout -> fa{i}.Cin; fa{i}.Sum -> Sum[{i}]; } fa16.Cout -> Cout; } }
48 points · Open discussion

Show HN: SHDL – A minimal hardware description language built from logic gates

Hi, everyone! I built SHDL (Simple Hardware Description Language) as an experiment in stripping hardware description down to its absolute fundamentals. In SHDL, there are no arithmetic operators, no implicit bit widths, and no high-level constructs. You build everything explicitly from logic gates and wires, and then compose larger components hierarchically. The goal is not synthesis or performance, but understanding: what digital systems actually look like when abstractions are removed. SHDL is accompanied by PySHDL, a Python interface that lets you load circuits, poke inputs, step the simulation, and observe outputs. Under the hood, SHDL compiles circuits to C for fast execution, but the language itself remains intentionally small and transparent. This is not meant to replace Verilog or VHDL. It’s aimed at: - learning digital logic from
Read the rest
first principles - experimenting with HDL and language design - teaching or visualizing how complex hardware emerges from simple gates. I would especially appreciate feedback on: - the language design choices - what feels unnecessarily restrictive vs. educationally valuable - whether this kind of “anti-abstraction” HDL is useful to you. Repo: https://github.com/rafa-rrayes/SHDL Python package: PySHDL on PyPI Thanks for reading, and I’m very open to critique.
2 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.