SH

SHDL – A minimal hardware description language built from logic gates

Hacker News

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 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; } }

Share card

Actual performance

48points
21comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
67%67% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Product HuntOn track for Day 1 leaderboard · Strong signals: visual · Missing: mac, agents, macos
65%65% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: lua, io · Missing: https docs, excited, just released
63%63% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoStrong fit for a featured deal · Strong signals: interface · Missing: plus, platform, intuitive
55%55% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: education · Missing: mobile apps, ios, personal
44%44% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
21%21% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Veryl
Veryl31%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Modern hardware description language

Product Hunt+5
Wy
Wyre, a hardware definition language that compiles to Verilog62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Wyre, a hardware definition language that compiles to Verilog

Hacker News4
Ci
Cixl – a minimal scripting language53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cixl – a minimal scripting language

Hacker News11
Ci
Cixl – a minimal, decently typed scripting language55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cixl – a minimal, decently typed scripting language

Hacker News2
Ci
Cixl – a minimal, decently typed scripting language55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cixl – a minimal, decently typed scripting language

Hacker News64
Mi
Minimal Object Description Language – char efficient data serialisation58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Minimal Object Description Language – char efficient data serialisation

Hacker News2
Mi
Minimum Description Length RNNs in PyTorch44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Minimum Description Length RNNs in PyTorch

Hacker News7
Go
Go-rabbitmq, reconnection logic and sane defaults46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Go-rabbitmq, reconnection logic and sane defaults

Hacker News2
I
I made an Ethernet transceiver from logic gates46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I made an Ethernet transceiver from logic gates

Hacker News460
Op
OpenRPC – Language-agnostic API description language for JSON-RPC28%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

OpenRPC – Language-agnostic API description language for JSON-RPC

Hacker News9