frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://github.com/rafa-rrayes/SHDL
16•rafa_rrayes•9h ago
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;
    }
}

Comments

Lramseyer•2h ago
Kind of a wild idea, but have you considered using this as a markup language for logic diagrams? I'm thinking something like mermaid - https://mermaid.js.org/ While this might not be super useful for chip design, it is a fully functional HDL, and since it is gate level, it would map nicely to diagrams.
notherhack•1h ago
[flagged]
dang•12m ago
I'm sure you didn't mean to, but this comes across as a shallow dismissal, which is against the site guidelines (https://news.ycombinator.com/newsguidelines.html): "Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something.", as well as the Show HN guidelines (https://news.ycombinator.com/showhn.html).

A comment like this could turn from a bad one to a good one if it were written more in the key of curiosity: what are the similarities or differences? what are some pointers for further development? and so on. If you know more than someone else does, that's great, but then please share some of what you know so we can all learn.

Telling somebody that their project which they've been pouring their passion and creativity into is merely reinventing some well-known thing that's been around for years is going to come across as a putdown even when it isn't intended that way. The effect is to shut down creativity and exploration, which is the opposite of what this place is supposed to be for.

fspeech•1h ago
If you are just interested in a structural description (so-called netlist) the standard is EDIF.

Show HN: The HN Arcade

https://andrewgy8.github.io/hnarcade/
269•yuppiepuppie•10h ago•69 comments

Show HN: A MitM proxy to see what your LLM tools are sending

https://github.com/jmuncor/sherlock
10•jmuncor•2h ago•3 comments

Show HN: Cursor for Userscripts

https://github.com/chebykinn/browser-code
12•mifydev•2h ago•1 comments

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

https://github.com/rafa-rrayes/SHDL
16•rafa_rrayes•9h ago•4 comments

Show HN: Pinecone Explorer – Desktop GUI for the Pinecone vector database

https://www.pinecone-explorer.com
4•arsentjev•20h ago•0 comments

Show HN: Sandbox Agent SDK – unified API for automating coding agents

https://github.com/rivet-dev/sandbox-agent
13•NathanFlurry•7h ago•0 comments

Show HN: I'm building an AI-proof writing tool. How would you defeat it?

https://auth-auth.vercel.app/
4•callmeed•3h ago•7 comments

Show HN: Dwm.tmux – a dwm-inspired window manager for tmux

https://github.com/saysjonathan/dwm.tmux
82•saysjonathan•4d ago•16 comments

Show HN: Lendy – Keep track of books you have lended

https://lendy.viraat.dev/
3•viraatdas•20h ago•1 comments

Show HN: I built a small browser engine from scratch in C++

https://github.com/beginner-jhj/mini_browser
111•crediblejhj•7h ago•36 comments

Show HN: WordRE, Wordle for Real Estate

https://reidsherman.com/wordre/
3•reidjs•16h ago•0 comments

Show HN: Cua-Bench – a benchmark for AI agents in GUI environments

https://github.com/trycua/cua
32•someguy101010•2d ago•6 comments

Show HN: Config manager for Claude Code (and others) – rules, MCPs, permissions

https://github.com/regression-io/coder-config
3•jtr101•5h ago•0 comments

Show HN: Build Web Automations via Demonstration

https://www.notte.cc/launch-week-i/demonstrate-mode
26•ogandreakiro•1d ago•10 comments

Show HN: Extracting React apps from Figma Make's undocumented binary format

https://albertsikkema.com/ai/development/tools/reverse-engineering/2026/01/23/reverse-engineering...
48•albertsikkema•5d ago•12 comments

Show HN: Record and share your coding sessions with CodeMic

https://codemic.io/#
9•seansh•7h ago•2 comments

Show HN: pqry – A fast, lightweight CLI tool to diagnose Parquet datasets

https://github.com/symblic/pqry
4•setzeno•2h ago•0 comments

Show HN: SharpAPI – Real-time sports odds API with +EV and arbitrage detection

https://sharpapi.io
3•MykLaz•2h ago•0 comments

Show HN: LemonSlice – Upgrade your voice agents to real-time video

111•lcolucci•1d ago•122 comments

Show HN: Ghostly: The Ultimate Platform for Ghosting Candidates (Satire)

https://staticfile-25978.wasmer.app/
2•dw1014•3h ago•0 comments

Show HN: Fuzzy Studio – Apply live effects to videos/camera

https://fuzzy.ulyssepence.com/
50•ulyssepence•1d ago•19 comments

Show HN: One Human + One Agent = One Browser From Scratch in 20K LOC

https://emsh.cat/one-human-one-agent-one-browser/
304•embedding-shape•1d ago•145 comments

Show HN: We Built the 1. EU-Sovereignty Audit for Websites

https://lightwaves.io/en/eu-audit/
100•cmkr•1d ago•78 comments

Show HN: PNANA - A TUI Text Editor

https://github.com/Cyxuan0311/PNANA
7•Frameser•8h ago•7 comments

Show HN: I wrapped the Zorks with an LLM

https://infocom.tambo.co/
102•alecf•1d ago•57 comments

Show HN: A header-only C++20 compile-time assembler for x86/x64 instructions

https://github.com/mahmoudimus/static_asm
2•mahmoudimus•5h ago•0 comments

Show HN: Is this the perfect 404 page? [CSS only]

https://github.com/AntiKippi/errorpages
3•AntiKippi•6h ago•0 comments

Show HN: We built a type-safe Python ORM for RedisGraph/FalkorDB

5•hello-tmst•6h ago•3 comments

Show HN: Multi-Agent Framework for Ruby

https://github.com/chatwoot/ai-agents
2•shivam-dev•6h ago•0 comments

Show HN: Cloakly – Hide sensitive windows from screen shares in real-time

4•jaygood•6h ago•0 comments