LtU Forum

Writing a DSL for Java

The site java.net has an article on extending Java with Tasks, code blocks executing in a separate thread. This particular extension may not be very exciting, but perhaps it will introduce the idea of DSLs to a new group of programmers.

The article uses a parser generator called VisualLangLab that seems to be "Yacc with a GUI". Since the goal of the article is to extend the Java language, they need a Java grammar to start with. VisualLangLab comes with a Java 1.4 grammar, so that is what is used.

This means that the Task extension cannot be used with a 1.5 compiler; even though the extension only touches parts of the Java grammar that have not changed between 1.4 and 1.5 (I guess). Could this problem be circumvented if the standard libraries provided a representation of the grammar used in the current platform?

Language design: Escaping escapes

Most languages use special characters or special sequence of characters to denote the use of special directives. For instance, in C format strings:

"\n" denotes new line, and if you wanted to have backquote n, you'd have to write "\\n".

In VB, since " is used to delimit strings, you'd use "" to mean double quotes. eg. "He said ""Boo""!"

In each case, if you wanted to show source code in the same language, it gets very painful, since you'd have to escape escapes. For instance to show the example of <img> tag in HTML, I'd have to do this:

&lt;img src="example" &gt;

In C you'd do this:

printf("For example: printf(\"Hello World\\n\"); prints \Hello World\"\n");

Are there any languages or patterns which handle this kind of situation more elegantly?

Examples of patterns:

  1. Escaping HTML escapes is not really necessary because the user can "View source"
  2. Another example is python, which uses triple quotes """.
  3. ASP, JSP, PHP use a sequence of unusual characters eg: <php?>

Succ Zeroth International Obfuscated Haskell Code Contest Results

See the results!


Winners by Category:



Best overall entry

UlfNorell with MetaSteganoGraphicObfuscation



Best Abuse of Compiler Specific Features and Best Signature Sized Entry

DonSteward with Crawl



Most Useful submission

JeremyGibbons with PiSpigot



Thanks to everyone who entered! Please enter again next year!

Proceedings of Scheme Workshop 2004

Proceedings of the Fifth Workshop on Scheme and Functional Programming
(Workshop Program)

The proceedings from this year's Scheme Workshop, co-located with ICFP in Snowbird, Utah, are available online. The proceedings include the R6RS status report.

Laszlo - So good, I had to change my underwear

Lazlo does was Java was supposed to do -- let you run desktop-app-like applications within a browser window. But Lazlo doesn't require any plugin on its own, or flaky, slow Java. Instead, the Lazlo compiler turns Lazlo code (which is written in very fast, flexible, human-readable XML) into Flash apps. - BoingBoing

Develop applications via a highly productive declarative programming approach [...] Laszlo applications are developed via a familiar object-oriented XML markup approach that reinforces todays development best practices - Laszlo Systems

LZX is an event-driven, object-oriented language for building dynamic, data-driven applications. Because it's an XML language, LZX integrates seamlessly with your existing IDE, source control, and team development systems. - Laszlo in 10 minutes

A reliable, free, Flash development tool is really good news for amateur web designers. This will probably be a huge success.

Paul Graham's invited talk at ILC 2003

Some Work on Arc

Hope this hasn't been posted yet.

House , hOp - the Haskell Operating System

Bored by those lemmings who use wildly popular operating systems such as the HURD?
Wondering how Arrows might improve operating system design now that monads are ho-hum?
Looking for an opportunity to write a purely functional network driver?

If this sounds familiar, hOp, and now House is the project for you!


hOp is 'Haskell on the Bare Metal' It consists of the Glasgow Haskell Compiler runtime system booting from grub. hOp was inspired by jNode and other Language/OS projects.

hOp features VGA screen text and PS2 keyboard support, House adds a PS2 mouse driver and linear framebuffer graphics support.

Reserve your copy of hOppix today!

away from interpreter hacking and toward enhancing stdlib

Andrew Kuchling writes:

I'd like to suggest that we should retarget Python's development, away from interpreter hacking and toward enhancing and expanding the standard library. The idea is simple, but has far-reaching consequences for the development process; I think that on balance the consequences would be positive. The proposal: We should deflect effort away from language changes and redirect them toward the standard library.

...

... I find the new language features added in 2.4 unimpressive and not likely to be useful to me.

Shoot-out: most annoying compiler error message

Today, I ran into a compiler error message which was hopelessly uninformative. Since I am up for something light-hearted, I thought I might as well just ask if anyone remembers his most annoying compiler message. I guess anything goes, well maybe except for the "e345: internal error message" kind of type.

Will Kodak kill Java?

More political or economical than technological - software patents again:

Kodak wins Java lawsuit

It returns to court next week to seek $1.06 billion in damages from Sun
Rochester's largest employer claimed during a three-week trial that portions of Java infringed on patents Kodak purchased from Wang Laboratories Inc. in late 1997. The patents describe a method by which a program can "ask for help" from another application to carry out certain computer-oriented functions. That's generally similar to the way Java operates, according to Kodak and other experts.
Will dinosaurs kill each other with patents? Who will be the last saur standing? I know of a three-letter acronym company (not SCO) with a huge patent base - will it subsume all the (interesting) others (de facto, if not de jure)? How will it affect the progress?
XML feed