LaTeX, the anti-tool

I used it a lot in the past few days. Or rather: I got prevented from doing so by LaTeX itself.

I wrote a paper about creating a programming language and my supervisor suggested using LaTeX to typeset the document. This sounded like a good idea to me, as I had played around with LaTeX before. I wouldn’t have to worry about coming up with a layout, keeping track of citations and the numbering and positioning of figures. Well…

Before I go on, I would like to state, that I love the basic principle of LaTeX: Text, annotated with semantic information, that gets automatically turned into a good looking document. Just like HTML…

The only problem: LaTeX is a chaotic chunk of hacks, glued together by a more or less robust package system. There is absolutely no consistency among the different extensions. A simple example are the packages pstricks and pdftricks: One abbreviates picture, the other does not. Why can’t they just agree on a naming scheme?

Definitely the worst thing about LaTeX is the non-existing usefulness of its error messages. To a complete novice, it must look as if one would have to have invented LaTeX in order to understand it.

Also very annoying is the fact, that compilation is slow as hell, even on modern machines. I mean, taking 5 or so seconds would be understandable, if I’m compiling a 41′000-lines-of-code project, but not in the case of just 2000 lines.
Well, this statement is actually wrong as I must consider that the whole compiler is actually interpreted. LaTeX’s flexibility comes at a price.

Looking backwards, I must say, that I spent at least as much time fighting LaTeX as I did writing my paper. Something must be seriously wrong. Isn’t a tool supposed to make things easier? Did I miss anything?

The sad thing about this story: There is not really an alternative for texts that heavily rely on mathematics. At least none I know of.
So this probably wasn’t my last paper typeset by LaTeX

Prexonite October07 Edition

I doubt anyone has noticed it, but yesterday I published a new version of Prexonite. It sort-of replaces the fourth beta preview I had planned to ship earlier.

First, I have to disappoint you: There is not going to be anything like tab-completion in the near feature. Prexonite fully supports Unicode and I couldn't find a library that supports non-ASCII character encoding. Although Prx.exe currently contains an experimental tab-completion solution, I refuse to enable it by default as long as it ignored my umlauts.

Yet another disappointment is, that Prexonie October07 does not yet contain the collection of scripts I plan to include in the Prexonite Standard Repository, but I promise you, to release them in the next edition.

"Did you actually change anything?"

... you might be wondering. In addition to the features announced in the last post, I have added/changed the following:

Improved local variable access

By addressing local variables using an index instead of looking up a name in a dictionary, the time required to access a local variable has measurably decreased. Specialized variants for all instructions dealing with local variables have been added. This is necessary because global code cannot take advantage of this feature.

Also note that this optimization happens after the code has been emitted, so even assembler code takes advantage of the new access method.

Experimental 'data flow' operator

When chaining functions that manipulate lists, I often found myself tediously counting brackets as the expressions got more and more sophisticated. Brackets don't scale very well, so a different way of chaining functions had to be found. While an actual 'chain' operator, like those found in many functional programming languages, might have been the solution, I went a different way.

I wanted pipe the result of one function into another function like it is done in shell scripts. Instead of overloading the '|' operator though, I went with '>>' and '<<'.

Prexonite Script:
  1. function main =
  2.     ::Console.ReadLine~Int>> [1,5,7,1,5].Insert(3)>>
  3.         map(x => 2*x)>> where(x => x mod 3 == 0)>>
  4.         foldl((l,r)=>l+r,"")>> println("[ ") <<"] ";

This sample reads an integer from stdin, inserts it after the third element in the list, which is then restricted to numbers divisible by three. The result is then concatenated and printed.

Although the compiler allows multiple arguments to be added in the way, functions still can only return one value. It might look like tuples are used but that's just a facade for plain vanilla arguments.

Misc.

Prexonite already contains some extensions, that were previously part of the Standard Repository. Most notably the debug command and a set of benchmarking classes.

Also: Tomorrow I will hand in a paper I have been writing on for the past few months. 'Creating a programming language' is a short overview over the concepts of the implementation of a programming language, from its design over the compiler to the runtime environment. As I cannot just print out the Prexonite source code (about 460 pages), the paper will point to the October07 release available from SealedSun.ch.

If you think, the new additions are worth an update, go
Get Prx