Hacker News new | ask | show | jobs
by fao_ 3256 days ago

  DSL stands for Domain Specific Language. In our story, the
  DSL is HTML. An internal DSL refers to the host programming 
  language’s ability to express that DSL using just the host
  language (with no string building).

  One could argue that Internal DSLs are not really a separate
  technique from #2 (Tree Building) and #3 (Templates). In fact, 
  internal DSLs could be described as a less-crappy tree building
  API. Or as a templating language that is more integral to the
  host language.
  But I think the technique is different enough to deserve it’s own category.
This person is describing Lisp, and I'm flummoxed that they do not appear to be aware of Lisp, given that it is an area where it is so strong! I think both Arc and Closure have the ability to describe HTML documents in lists (I can't remember if it's as s-expressions, or lists of functions).

EDIT: I just noticed that they reference Om :) Never mind!

3 comments

Yes. As a Lisp programmer I've almost forgotten that I should be thankful to be able to say something as simple as:

  (defun button-bar (name)
    (let ((i 0))
      (with-html-output (*page*)
        (:div
         (do-query (button-name)
           (select [button-name]
                   :from [tools]
                   :where [= [bar] name])
           (htm (:button
                 (format nil "~@r. ~a" (incf i) button-name))))))))
I know that Arc uses macros, such as `blankpage` if I remember correctly, which will start you off with a <!doctype html><html> or whatever.
I do mention lisp (or rather Clojurescript)