I like the idea of "skins", but I think to sell it to people one would have to 
change their idea of what a "programming laguage" is.

In the case of web pages, we have three kinds of files: CSS, (X)HTML and XSLT. 
They define (in that order) presentation, content/structure and transformation 
of content/structure. In the case of Nim, the analogues would be:

  * CSS: "skin"
  * (X)HTML: a text represenation of the AST (e.g. "canonical" Nim code or 
preferably a presentation agnostic AST dump)
  * XSLT: something that defines AST changes (macros, templates, compiler 
optimizations etc.)



The problem is that, when they think about what defines a particular 
"programming language", many people don't differentiate between presentation 
choices (e.g. curlies vs. indentation for blocks) and actual AST-relevant 
language features (like whether there is _when_ statement). They just call it 
all the "syntax of the language". When they are given presentation choices many 
will say that "the language is ambiguous". Being able to express the same thing 
in multiple equivalent manners is to my experience remarkably unpopular.

Of course this is at its core just a lack of abstraction, but it is real. In a 
better world, maybe we would distribute source code in the form of an AST dump 
and not give a damn about the presentation somebody chooses to look at it. We 
could even transform an "AST-source" to a different language with a set of 
equivalence transformations. Maybe people would even start to think in AST 
(like IMHO many good programmers already do today) and finally stop the endless 
fights about "the best" presentation (which doesn't exist).

Reply via email to