What does HackerNews think of hiccup?

Fast library for rendering HTML in Clojure

Language: Clojure

#8 in Clojure
#1 in HTML
Not equivalent, but arguably more useful for manual authoring: Emmet [0] was all the range a while back, and I still use it to write HTML. It comes naturally if you're used to writing CSS-like selectors, and mostly gets out of the way.

DSL-wise, I've rather enjoyed Clojure's Hiccup [1].

[0] https://emmet.io/

[1] https://github.com/weavejester/hiccup

Clojure's great for this too, I've never seen a Clojure programmer generating HTML with string templates and that's not because Clojure programmers are more disciplined, it's because Clojure's syntax is flexible/simple enough to make generating HTML in a structured way the natural solution.

https://github.com/weavejester/hiccup

That is why I like Hiccup/ Clojure so much: https://github.com/weavejester/hiccup It is very natural to produce something resembling a document in pure Clojure data structures and then just convert it to valid HTML. I think, Reagent has some hiccup extensions that are nice like writing the class or id with a . or # notation right in the keyword describing the tag. So there probably still is some space to improve the ergonomics and probably performance. Concatenating strings still wins performance wise by a lot.
Indeed. We all know hiccup[0] style is the one true way to do it.

[0] https://github.com/weavejester/hiccup

Surprised htmx isn't mentioned more in the comments.

I'm using it with Janet for a side project, really liking it so far. Writing server-side html with a hiccup-like library is very nice! :)

(Clojure Hiccup library, similar libraries exist for other lisp-like languages: https://github.com/weavejester/hiccup)

This would have really benefited from looking over something like clojure’s hiccup: https://github.com/weavejester/hiccup
- Backend: Clojure (with Reitit[0] for the API)

- Database: Postgres or SQLite

- Frontend: None, the backend serves html + js by combining htmx[1] and hiccup[2]

[0] https://github.com/metosin/reitit

[1] https://htmx.org/

[2] https://github.com/weavejester/hiccup

I'm new to LISP but the way Hiccup (https://github.com/weavejester/hiccup) in Clojure allows to embeds HTML in Clojure code feels really powerful.
* 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 these 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.