HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
weavejester
hiccup
Clojure2010–2025
weavejester / hiccup

hiccup

Fast library for rendering HTML in Clojure

59Distinct people
64Mentions
1Explicit recommenders
2.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Fast library for rendering HTML in Clojure

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Do you have a github repo for your project ? Or somewhere where I can take a look at the code ? I was hoping to find the time to write something similar in Clojure (a lisp…

siscia 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

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 6:36:16 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 year64 dated mentions

Observed mentions: 2010-04-26 15:18:06 UTC to 2025-12-03 19:46:10 UTC.

0369122010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 11 mentions; 0 submissions, 11 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2025

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
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC202
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC101
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC11011
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC404
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC303
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC404
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC404
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC606
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC707
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC606
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC110
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC606
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC404
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC211

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Hiccup Hiccup is a library for representing HTML in Clojure. It uses vectors to represent elements, and maps to represent an element's attributes. Install Add the following dependency to your deps.edn file: hiccup/hiccup {:mvn/version "2.0.0"} Or to your Leiningen project.clj file: [hiccup "2.0.0"] Documentation Wiki API Docs Syntax Here is a basic example of Hiccup syntax: user=> (require '[hiccup2.core :as h]) nil user=> (str (h/html [:span {:class "foo"} "bar"])) "<span class=\"foo\">bar</span>" The first element of the vector is used as the element name. The second attribute can optionally be a map, in which case it is used to supply the element's attributes. Every other element is considered part of the tag's body. Hiccup is intelligent enough to render different HTML elements in different ways, in order to accommodate browser quirks: user=> (str (h/html [:script])) "<script></script>" user=> (str (h/html [:p])) "<p />" And provides a CSS-like shortcut for denoting id and class attributes: user=> (str (h/html [:div#foo.bar.baz "bang"])) "<div id=\"foo\" class=\"bar baz\">bang</div>" If the body of the element is a seq, its contents will be expanded out into the element body. This makes working with forms like map and for more convenient: user=> (str (h/html [:ul (for [x (range 1 4)] [:li x])])) "<ul><li>1</li><li>2</li><li>3</li></ul>" Strings are automatically escaped: user=> (str (h/html [:p "Tags in HTML are written with <>"])) "<p>Tags in HTML are written with &lt;&gt;</p>" To bypass this, use the hiccup2.core/raw function: user=> (str (h/html [:p (h/raw "Hello <em>World</em>")])) "<p>Hello <em>World</em></p>" This can also be used for doctype declarations: user=> (str (h/html (h/raw "<!DOCTYPE html>") [:html {:lang "en"}])) "<!DOCTYPE html><html lang=\"en\"></html>" Differences between Hiccup 1 and 2 In brief: Hiccup 1 doesn't escape strings by default, while Hiccup 2 does. They occupy different namespaces to ensure backward compatibility. In Hiccup 1, you use the h function to escape a string - that is, ensure that unsafe characters like <, > and & are converted into their equivalent entity codes: (h1/html [:div "Username: " (h1/h username)]) In Hiccup 2 strings are escaped automatically, but the return value from the html macro is a RawString, rather than a String. This ensures that the html macro can still be nested. (str (h2/html [:div "Username: " username])) It's recommended to use Hiccup 2 where possible, particularly if your app handles user data. Use of the non-core namespaces, such as hiccup.page, should be avoided with Hiccup 2. License Copyright © 2025 James Reeves Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Read the full README on GitHub

What Hacker News says

7 sources
* Hiccup (https://github.com/weavejester/hiccup) - DSL for generating html. You can easily mix it with other language constructs. There are similar libraries for Common Lisp and Scheme. * Compojure-api (https://github.com/metosin/compojure-api) - for building web applications. Mix json-like, hiccup and clojure constructs for web applications and autogenerate Swagger documentation. * LOL book (https://letoverlambda.com/). Extreme examples what you can do with macros and code modifications during compile time. * Seesaw (https://gist.github.com/daveray/1441520) - library for building GUI apps with Clojure and Swing. Express GUI elements through declarative syntax. Qt and other libraries has similar feature, but is usually preprocessed with external tools. * Scheme - MiniKanren (https://docs.racket-lang.org/minikanren/index.html) Most of thes
Read the rest
e things in regular languages would require modifying language parser or compiler, or adding external tool that will parse that code and generate new one; e.g. like React is doing with html chunks. Also, many Scheme/CL/Clojure implementations provide functions to modify syntax table in runtime, allowing you to alter how things are parsed. That is extremely hard in regular languages due unregular syntax constructs.
In LFE: Lisp Flavored Erlang
Hi fellow PHP'er and in a long time gone C#er here I would highly recommend learning the spirit of Clojure first: https://changelog.com/posts/rich-hickeys-greatest-hits https://www.youtube.com/watch?v=vK1DazRK_a0 There are a few classes of tech that are uniquely Clojure: Data driven DSLs: - https://github.com/noprompt/garden - https://github.com/weavejester/hiccup - https://github.com/seancorfield/honeysql Hyper normalised relational databases: - https://www.datomic.com/ - https://opencrux.com/ - https://github.com/replikativ/datahike Advanced SPA tech (hyper normalised data driven): - http://fulcro.fulcrologic.com/ - https://wilkerlucio.github.io/pathom/v2 Once you understand the spirit and rationale for Clojure it becomes apparent why other communities don't have this kind of tech yet Once it gets down to practical things I recomm
Read the rest
end using clj-Kondo with type hints, Cursive for Intellji, make sure you learn how to hot code inject new code into your running program using your editor shortcuts, and TDD in Clojure is also excellent and immediate: https://cursive-ide.com/userguide/testing.html Also look out for GraalVM and Babashka we're using it to compile fast native binaries out of Clojure
In A History of Clojure [pdf]
The "object" syntax reminds me a lot of Clojure/script's Hiccup (https://github.com/weavejester/hiccup) style, which has become a de-facto standard across many popular libraries. In hiccup, this example: { tag: "button", attributes: { "id": "baz", "class": "foo bar", "data": "1", "onclick": f, }, children: [ "Hello", { tag: "em", attributes: {}, children: ["there"], } ] } Would be represented as: [:button#baz.foo.bar {:data 1 :on-click f} "Hello" [:em "there"]]
In What if we'd had better HTML-in-JS syntax all along?
There is a library called reagent which is a wrapper for React, check it out: https://reagent-project.github.io/ It uses a the same data format as hiccup template library which can be used on server side - https://github.com/weavejester/hiccup That's why the same code can be used on client and server. The simplicity of the process (uses pure functions to turn immutable data structures to html) means that it can be also easily unit tested.
In Clojure: A Lisp that wants to spread

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.