Hacker News new | ask | show | jobs
by dccsillag 1189 days ago
Because a library in a programming language would be madly inconvenient? I can't see something like this being pleasant to use:

  document(
    paragraph("blah blah blah"),
    math("sum_(i=1)^n i = (n (n+1))/2"),
    paragraph("foo bar")
  )
Also, I'd imagine being a DSL and having a dedicated compiler is what let's Typst have such great incremental compilation (it's actually instant).
1 comments

Not to say people haven’t done it, though, and with enough willingness to adapt the syntax of the host language it can work quite well[1,2,perhaps 3].

[1] https://docs.racket-lang.org/scribble/

[2] https://docs.racket-lang.org/pollen/

[3] https://patoline.github.io/