
X# - XML Oriented programming language - axod
http://www.xsharp.org/samples/
======
codeglide
My name is Mark Giuliani and I am one of the developers behind X#.

I do agree that the language is verbose at the moment, originally it was
designed to be programmed visually but we kept extending it to the level where
it is now. In less than 3 months we are releasing a new version of X# that
will include a C-like or Java-like syntax. So in addition to doing > you would
do if( expr ) { ... }.

For those who think X# is a joke, please take a look at
<http://www.snapcrm.com> which is a CRM and Collaboration Suite far superior
to all open source CRMs and it was coded entirely using X# in 4 months. Also,
take a look at Fusion (<http://fusion.codeglide.com>) which is a Data
Integration Platform superior to anything available in the market today --
coded in 5 months.

Try doing this in other languages!

~~~
ComputerGuru
I'm sorry, Mark, but there's a ton of open-source CRM software written over
the weekend and published in a matter of days.

As a matter of fact, if you'll go through the backlogs here at Hacker News
you'll see a large number of "Game/Site/Tool/Language Written, Released in 3
days!" stories by members of this very community... in languages from C# to
Lisp to Java to C and even ASM.

~~~
codeglide
I agree, but they don't have the number of features that we have.

~~~
jamongkad
Really now? and how hard would that be for anyone who is proficient in their
own language to implement those so called features you boast about? Feature
set alone is a pretty weak argument imho.

------
gojomo
Reminds me of my idea for an XML image format:

    
    
      <image>
       <pixel x="0" y="0" red="255" green="255" blue="0" alpha="0"/>
       <!-- etc -->
       <pixel x="1023" y="767" red="0" green="0" blue="0" alpha="0"/>
      </image>
    

I think it would gzip pretty well.

~~~
oconnor0
Not bad, but I think you forgot to include document unique identifiers on each
important tag. Also, where are the namespaces? You need to be able to embed
this image in a document without having tag name collisions.

~~~
gojomo
Good point on the namespaces. But I'm an idea guy -- the standards committee
can work out the details.

------
daleharvey
It is somewhat disheartening to see the reaction the release of this has had.

It isnt lisp or erlang or anything "cool", from a glance at the code its a
souped up xslt or templating language. The code is obviously supposed to be
tool generated (how many graphically driven lisp generators are there?), yes
they could use s-exps, but if you dont need the power of s-exps, whats the
point? Java has a nice xml parser in built.

But the main point is that there demo looks pretty comprehensive, if it was
written in 4 months then cool, it sounds like it done the job they needed it
to do pretty well.

Can any of the detractors point to as comprehensive web application written in
lisp / erlang etc?, it's obvious they arent worried about algorithmic
complexity and "hacker cred", and more about the integration tools and free
extras that come with having xml as an intermediary language, and shock
horror, getting things done.

They didn't need to release this, seems like they just put out an internal
tool that was useful to them so that others could benefit, and they end up
getting treated like the star wars kid.

~~~
jamongkad
Normally I would be inclined to agree with you. But judging from the OP's
comments on proggit and here. You can see a smack of arrogance around his
posts.

~~~
daleharvey
true, but I think I would be getting defensive after a witch hunt like this

------
sqs
This is hilarious. Maybe it's an improvement over their previous product, a
CSV-oriented programming language.

------
arockwell
I pray this is someone's cruel joke. You just wouldn't write code is poetry at
the bottom of every page for an xml programming language unless this was a
joke.

Also, it runs on the JVM, but is called X#. I mean... I'm honestly speechless.

~~~
jeroen
Doesn't Java have its own "cool" symbol? Anything -# or Iron- implies a
relation to .NET, and I see little value in creating confusion around that.

~~~
cabalamat
Maybe they should call it JXML. Though this name is a bit bland and could be
spiced up with a liberal sprinkling of exclamation marks: J!XML!

When Microsoft bring out their implementation it will be called "Visual Studio
Active Team System IronXML# Server Pro Ultimate".

------
geuis
Oh lord, my company is a java shop. Some asshat is going to hear about this
and want to implement it right away. God help us all....

------
cschep
This reminds me a lot of ColdFusion. It seems like the purpose is to make it
easier for non-programmers to embed code into a web page. The syntax is just
mind numbing though.

It made easy problems manageable for a noob, and hard problems impossible (to
stand working on) for anyone that enjoys programming.

This doesn't seem like a good evolution.

~~~
perezd
I agree, its like ColdFusion...only it validates.

------
haasted
Reminds me of a panel-discussion I was in the audience of once. When panel-
participant Steve Vinoski was asked which trends he saw for software
development 10 years in the future, his only response was _"I just hope we're
not all programming in XML"._

Having done my share of XSLT, I could not agree more. :)

------
felideon
_A fully working e-mail auto-responder using only two statements..._

and 28 lines of code.

------
darthtrevino
XML is like violence; If it doesn’t solve all your problems, you’re not using
enough of it

~~~
TweedHeads
Haven't heard of Don Box in a looong time. What's he cooking now?

~~~
darthtrevino
So that's where it came from! My co-worker had it posted on his cube and I
thought it was great

------
sidsavara
Not for me, but still voting it up because I was curious enough to click the
link =P

It is exactly as sharp and pointy as I had feared - but then again, XML was
never meant to be looked at by humans right? Isn't the point that it's easy to
traverse and build tools around?

An XML based language would definitely aid in creating more visual IDEs. I
suspect the example they give could be done easily in Yahoo pipes, and is
likewise stored in a similar XML document.

~~~
michaelneale
>but then again, XML was never meant to be looked at by humans right?

Actually I think it was, in as far as it is a text _markup_ language. The only
case when I have enjoyed looking at it, and editing is docbook - where its
mostly text, just with limited docbook XML markup (and having the redundant
closing tags does help you navigate).

~~~
newt0311
I personally prefer docbook SGML. Its much more forgiving when it comes to end
tags which can be inferred. Also, sometimes the case insensitivity is nice.

------
pavelludiq

       <!-- SQUARE function -->  
       <xsp:variable name="square" type="node">  
           <xsp:processing-instruction>  
               <xsp:text value="{node() * node()}"/>  
           </xsp:processing-instruction>  
       </xsp:variable>  
    

This is a one-liner in python and you can guess what it does without knowing
python.

~~~
eru
And in Forth: : square dup * ;

------
silvajoao
<Why> God </Why>

------
russell
Lord no! Think of the children!

I am all for DSL's because you can do some very neat things with them, but
don't make it XML based. Use a reasonable language like Python (replace with
your favorite language). XML is pretty hard to read. A good programming
language should be concise. You can type only so many symbols per hour; make
the most of it. I worked with VoiceXML a decade back. It was not a pleasant
experience.

The seductive attraction of an XML based language is that the heavy lifting of
writing a parser is done for you. That's just an illusion. There is most
certainly a grammar for any language that you like. With a little bit of
hacking you are in business. I've done it. It's a piece of cake, more fun than
banging away at a DOM tree.

------
zaius
Wow.. There's a lot of hate going on here. If you don't like it, don't use it.
I would have thought that the HN community would appreciate this solely for
the novelty factor.

------
burke
I love the footer: "Code is Poetry". Eugh.

~~~
justindz
As a poet and programmer, my first response was to be offended. But, then I
remembered all the poetry I read on Facebook earlier today and kind of thought
"eh, yeah, I can see that now."

------
dennmart
This would've been damn cool - If we were still in the year 2000 or so, when
XML was all the rage.

I'm sure people will find lots of uses for this, though.

~~~
kschrader
No, it would have sucked then too.

------
geuis
My roommate is saying this is a prank that's been going on for a few years.
Not sure if this is for real or not.

------
whalesalad
Obsurd. With an O.

------
IsaacSchlueter
First of all, a lot of the comments here, imo, are not so great, for they miss
the meat of the matter. It's easy to poopoo a language because it's different,
or verbose. Hacker News hates XML, worships s-expressions, and has some mixed
fondness for maps and json, so the anti-XML snark is expected, I suppose. But
let's put that aside talk about _why_ X# is actually distasteful. That might
even be helpful to the developers and incite more than defensiveness on their
part.

Disclaimer: I'm not an X# expert. I've just read the pages linked to from the
sidebar on <http://xsharp.org>. This review may well be a failure of marketing
more than anything else.

When I saw the title, I was expecting something a bit like lisp, but with
about 10x as many characters. Granted, xml done right is not just sexprs, so I
was curious about how attributes might be used to add additional expressive
power. _Maybe_ , I thought, _you could do something as "pure" as lisp, albeit
with a much uglier syntax. It probably wouldn't be my thing, but it might be
neat nonetheless._

Oh, if only.

The problem with X# is that it uses enough XML to be ugly, and yet not enough
to be pure. If you were to use it, you still need to be thinking in a very
ruby-like block syntax with stuff like processing-instruction and append-child
and for-each and so on. (Nested _with_ blocks? Srsly??)

The XML feels out of place, tacked on. Rather than use a consistent expression
language to define programming language fundamentals, it seems like a sloppy
addition to a kludgey language.

The examples seem to use some powerful built-ins, without telling me how I
would actually apply the concepts to new ideas. What is the xml "schema" for
an HTTP POST? For a CouchDB document? For a curl request to the Twitter API,
or the results of it?

In other languages, it's generally very clear how a given bit of XML is turned
into an object. However, it's not so clear here how a given bit of JSON (or
other data) would be turned into XML, or vice versa. Compared with the
facilities in ruby or php for handling any kind of data encoding syntax, I
wouldn't even consider this. How do I dump out the data? What are the rules
for converting non-XML to something that's XPath-able?

Take this example, for instance _(comments added)_

    
    
        <!-- start in curly-brace land, using builtin for-each and document functions,
             passing xpath query on the imap "document", which is not natively XML -->
        for-each document('imaps://imap.gmail.com?user=jkirk@gmail.com&pass=secret')/folder[@name='INBOX']/mail[@seen = 'false'] {
            append-child document('smtp://smtp.gmail.com') {  
                <!-- switch to XML to define the message.
                     Where do I look up the XML syntax for a message? I would not
                     have guessed that this would be the way to do it. -->
                <!-- Function call in the subject attribute? That's weird.
                     What if I wanted to email someone about curly braces and
                     concatenation functions? Would I have to escape the curly
                     braces that are escaping the function nested in my xml nested
                     in my code?  I think the "fail" stack just overflowed. -->
                <mail subject="{concat('RE: ', @subject)}" from="jkirk@gmail.com" to="{addresses/from/@address}">
                    <!-- So, we're back to c-ish syntax now?  That is so strange.
                         Also, text must be quoted inside of XML?  I always thought
                         the primary (only) benefit of XML over sexprs or JSON is that
                         plain text doesn't have to be quoted or escaped. -->
                    "Hi text ";  
                    select addresses/from/@name;  
                    ",\n\nI've received your message titled '";  
                    text @subject;  
                    "' and\nI will reply to it shortly.\n\n--James\n";  
                </mail>  
            }  
        }
    
    

Letting data and code mingle closely is an attractive premise, to be sure. XML
is not the only data definition language, and many would argue that it's far
from the best, but it's certainly a contestable point. In my view, it is not
XML that turns me off from X#, but rather the overall lack of consistency and
transparency in the language.

Also, about the footer and some general site tips… The mascot has <?X#?> on
his chest, but the language doesn't use <? as far as I can tell. (Or does it?
Jesus, please say it doesn't.) This code is not poetry. (The tumbleweeds in
the forums and on the blog also do not inspire confidence.)

It would be better to start with the most elegant syntax possible, and work
backwards from there to an implementation. As it is, with the market for
programming languages and frameworks so full of robust and elegant solutions,
I would not even consider using X# for anything whatsoever.

~~~
codeglide
Thank you for your comments. My replies follow,

\- The syntax we have at xsharp.org is an alternative C-like syntax (which we
are still working on BTW). The full XML way of coding X# can be seen at
<http://wiki.codeglide.com/X_Sharp/Examples>.

\- Rules to convert non-XML structures to XML are defined by the connectors.
We've chosen an intuitive XML structure to represent non-XML data on these
connectors. Of course you can't guess what is the structure an XML that
represents an e-mail has to have, but this is the same in other programming
languages, you need documentation or an IDE with inline help to find out how
to do stuff. The most powerful feature of X# is that you can combine data from
unlimited and different sources using XPath and that instead of using multiple
functions all actions are abstracted behind common operations such as append,
remove, select and update.

\- Yes, <?xpath ?> is used on the XML syntax to select nodes.

Originally X# was going to be a language to create applications visually and
we chose an XML syntax because each tag is represented by a visual element on
screen. Since we are still working on the visual X# editor, we offer an
alternate C-like syntax (which is not definitive).

Although X# is Turing complete, we are not proposing it as a general purpose
programming language -- we know it has limitations, having this level of
abstraction has trade offs. Of course if we need to write a 3D Adventure Game
or a Web Server we will use another language, but for writing the web based
applications we wrote it has proven to be extremely fast and useful.

\--mark at X#

------
moonpolysoft
Why is their logo an M&M?

~~~
arjungmenon
Because M&M is a tasty chocolate that is especially popular with children, the
creators of X# want to send the message that their language is delicious toy
suited for tots.

