Hacker News new | ask | show | jobs
by 616c 4304 days ago
So I am trying to restart a blog using org-mode. I think it is the way forward. Right now, I meaning using it as one subset, a markup language to convert into other representations. I know org-mode is more featureful than that by a long shot. I am just curious for this use case for the reason below.

Having said that,I am more interested in why, despite the Church of Emacs and Its Holy Love of Parens (that is a joke from an admirer, btw), why pure sexpr is not the way forward for a markup language. I decided to look into them recently, including cl-who, Scribble (CL, Scheme, and now most popular Racket variants), and other sexpr markup languages. I did so thinking that, if you want to have a ground-up markup language to convert to anything, would not sexpr-based data be the best for the iconicity Lispers crave. Is it not that far removed from XML+XLST for this very reason.

Does anyone have full-bodied markup that uses sexpr as a source and translates to everything? I think this would be quite compelling, well maybe only to Lispers. Would there be a desire for such a thing?

4 comments

The difference here is that we're not talking about describing data, like XML does (most of the time), where sexpr-based markup is pretty great. For actual markup, SGML wasn't all that bad (closing tags are useful if the start of the current section is a few screenfuls away), or the more "do what I mean" approach as commonly used by markdown, asciidoc, rst or org-mode. And while Emacs might be "in love" with lisp, it's also all about dwim.

(Never mind the texinfo legacy)

But what are we describing then. I like to see org, HTML, asciidoc, and XML as taking any data, in a very moronic basic sense, and annotating it or reshaping it for different kinds of parsers to accept.

Am I missing the mark somehow in your comment?

Isn't that a bit ad absurdum? Sure, in a sense this comment, the works of Shakespeare, the contents of this web page and the last 24 hours of stock trading exported as CSV are all just data/information. Go one step further and you could say that we might as well abolish English and instead write the content itself in some sexpr-structured Lojban.

But we don't operate in pure data structures, AST's, etc, so there has to be some kind of abstraction. Sexpr are one approach, but even die-hard lisp-heads usually don't contend that it's the only one. The aforementioned scribble isn't sexpr-based, either. Most markup languages these days really try to avoid spurious line noise for something as simple as paragraphs.

The working elements of your average program are much more complicated and varied than those of your average marked up document, and quite often much easier to heuristically derive -- significant line-ends being one prime example. Quite rarely is there a need for deep hierarchies, for example.

HTML these days isn't just about formating content, so there's a much higher signal/noise ratio, where something like sexpr markup could improve upon spurious end tags, attributes etc. And this is even more true for most XML data.

So I'd see a use case for these kinds of complicated and generic scenarios. But for simple annotated content, outlines and the occasional date? Do you really want to write tables as nested s-expressions instead of just working automagically with a neat ascii-art representation?

Javascripters are beginning to rediscover some of these ideas in React.js.

I'm still waiting for them to rediscover continuations again. They have the "Callbacks aren't great" part down, but they still haven't pieced together the "Let's use continuations instead" part quite yet. Give it a year or two :)

Some Javascript developers would love to have support for first class continuations, but the Javascript engines would need to implement several changes to make them practical.
That's a good point. It's still a long ways away, and even if it were possible, continuations make it easy to shoot yourself in the foot.
>Does anyone have full-bodied markup that uses sexpr as a source and translates to everything?

Check out Skribilo.

http://www.nongnu.org/skribilo/

For XML/HTML, I'm partial towards the SXML notation: https://en.wikipedia.org/wiki/SXML
Huh, cool. I haven't seen this before.
Thanks. I guess I really do not need to take a look at Clojure, no matter what excuse I put forward.