Harmony as a Compilation Target of my Dreams

Mark S. Miller erights at google.com
Tue Feb 8 13:39:26 PST 2011

-1. I do not like the inline textual annotation style for attributing
original source position. Much better IMO is the tack taken by Java <
Caja, and ClosureCompiler of generating separate source mapping tables that
map from generated text position back to original text position. That way,
one's debugging view can be easily switched between different levels of
abstraction by switching or omitting such mapping info.

And I find HOBD's use of "#" much more valuable. I do not think we should
have both uses of "#" coexist in one language.

On Tue, Feb 8, 2011 at 1:21 PM, Kris Kowal <kris.kowal at cixar.com> wrote:

> This is a half-baked idea. Harmony of Brendan's Dreams makes extensive
> use of new octothorp syntax. There is perhaps another use for
> octothorp prefixes: to annotate generated JavaScript with line numbers
> from the source.
> source.cs:
>    number -= 42 if opposite
>    square = (x) -> x * x
> target.js:
>    var opposite, number, square;
>    #1 if (opposite) { number -= 42; }
>    #2 square = function (x) { return x * x; }
> This would require some form of annotation to connect the line numbers
> with the corresponding source code.  The connection could be inferred
> easily given the tacit strawman for Module(text, fileName, lineNo) and
> I imagine that some similar annotation would be possible on or around
> a module keyword.
> It might even be useful to implicitly increment the annotation line
> number on line breaks to reduce the verbosity so that minifiers can
> provide similar annotation at little cost.
> A third use-case would be annotating the sources of statically bundled
> "Simple Modules" or whatever succeeds them. I imagine that there would
> be a need for tools that transform load directives into inline
> modules, so it would be handy to annotate sources for debugging in
> that case too.
> Kris Kowal
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110208/37e45e1d/attachment.html>

More information about the es-discuss mailing list