X#

While browsing reddit today, I ran across X#, a programming language that describes itself as “an XML-oriented programming language designed to quickly create Web applications and services.” Looking over the samples, I have to agree with the reddit description: I can’t believe they are serious about this!

In my opinion, XML is a great data interchange format. There are tons of libraries available in probably every language (I bet even COBOL has one by now), it’s pretty easy to read, writing it isn’t too bad, and a huge amount of software uses it in some form or another (even MS Office uses it). I’m not saying that all XML is created equal, but I am saying that the concept and basics of XML seems pretty sound to me, and its advantages are many.

But XML as a programming language seems a bit loopy. X# is like Adobe Flex’s MXML: both promote the mixing of data and logic (in contrast to MVC architecture), both are verbose compared to more “normal” languages, and both may look easier to manipulate (“hey, it’s just XML, of course I can work with that!”) but in practice, they’re still programming languages.

I think there’s a chance that X# will take off in some specific areas, such as templating. But perhaps not; the X# implementors made a few not so ideal decisions which may limit that application.

  1. X# compiles to JVM bytecode using a custom compiler. The X# developers should have looked at JSR 223 and built a new script implementation for Java, making X# instantly available for any application that uses JSR 223 – and lots of applications do.
  2. X# has no API allowing it to be added to an existing application (at least, that I could find). For example, if I wanted to add X# as the view layer in my MVC application, how would I do that?
  3. X# can embed Java. This feature severely limits the potential for X# to become a more common language. For example, let’s say the X# team (or someone else) decides to implement an X# front end for the .NET CLR (via Mono). Ideally, any X# code in existence should seamlessly run on this runtime/compiler – but because the language spec includes the ability to embed Java, the Mono version of X# can never truly be called X#, because it can never embed Java.

Overall, I’m impressed with X#. Given some work, it could become a nice addition to the family of front end markup languages (like FreeMarker, Velocity, JSP, et al). And because it’s licensed under the GPLv3, perhaps it will mature. Best of luck, X# Team!

CC BY-SA 4.0 X# by Craig Andrews is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.