Skip to content

braintripping/x-vec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

X-Expressions in Clojure, with vectors

Background

The most popular format for specifying HTML in Clojure is Hiccup, by James Reeves. It has spawned variants like sablono and reagent which return React components rather than HTML strings.

This summer I read Matthew Butterick's explanation of X-Expressions, then discovered a related paper and additional references via Jack Rusher. My intuition about what hiccup is began to shift from "a way to generate HTML in Clojure" to "an implementation of X-Expressions in Clojure using vectors".

This library, x-vec, is a small toolset for building 'emitters' that output different kinds of useful things from X-Vector notation. For example:

  • React components (just like Sablono/Reagent)
  • GraphQL queries
  • Code ASTs

Having previously written a hiccup variant myself, I used that code as well as some prior drafts for a graphql emitter as the starting point for this repo.


References

Releases

No releases published

Packages

No packages published