Tools Used by No Latte
- Original Latte website
- ANTLR, to implement the front end
- JUnit, for unit testing
- ANTLR Testing, my own library for unit-testing ANTLR grammars
- FitNesse, for functional and acceptance testing
Personal Sites
- NoRecess.org, my personal website
- my professional webpages
- Programming During Recess, my coding blog
- Computer Science at Calvin College, my job
No Latte Interpreter
Writing raw HTML is really, really annoying:
HTML was never supposed to be something that you would see... it staggers me that people have actually put up with having to write HTML by hand.
-- Tim Berners-Lee, inventor of HTML, Technology Review July 1996
- maintaining balanced tags...
<em><strong>problem!</em></strong> - worrying about paragraph tags...
<p>Paragraph</p> - using entity encodings...
&and< - lots of repetition... any website template
For years (starting in the mid to late 1990s), I wrote raw HTML. I tried languages which generated static HTML pages, but they all disappointed in some way. I loved using LaTeX for paper documents, but LaTeX-to-HTML translators were (and still are) quite lacking.
Then I discovered Latte.
Latte provided a Scheme-like syntax (and semantics) with some LaTeX ideas. So...
- tags are automatically balanced...
{\\em {\\strong no problem!}} - paragraph tags are added for you...
Paragraphbecomes<p>Paragraph</p> - entities are automatically encoded...
&and<become&and< - abstract to your hearts content...
{\\my-page content}
But then Latte dried up. So for a variety of reasons, I wrote my own version of the interpreter (mostly compatible with the last version of Latte).
The Four Pillars
Balanced Tags
The syntax of No Latte is based on LISP and Scheme. While many complain about the many parentheses in these languages, those parentheses are still much easier to deal with that the end tags of HTML. So a simple webpage might look like this:
{\head
{\title Title of the page}
}
{\body
{\h1 Header One}
Content.
}
Notice how each (implied) end tags is closed with a single curly brace.
Paragraph Tags
In the example above, Content. appears in a
<body> tag. The paragraph inserter knows enough
to place paragraph tags around this text,
<p>Content.</p>. It does not put
paragraph tags around Header One because it's within a
<h1> tag.
Entity Encodings
Just type in the characters that you want, and the No Latte
interpreter will turn the necessary characters into the proper
entity encodings. i >= 0 && i <= 5
becomes i >= o && i <=
5.
Abstraction
Defined fuctions:
{\def \my-page
{\lambda {\page-title \&content}
{\group
{\head
{\title \page-title}
}
{\body \content}
}
}
}
{\my-page {The Title}
{\h1 Header One}
Content.
}
Sure, it's a lot of heavy lifting to get started, but consider
that my-page can be reused millions of times
now...
© 2007. Developer and
website author: Jeremy D.
Frens
This website is licensed under a Creative
Commons Attribution-Noncommercial-Share Alike 3.0
License