News for hackers. Stuff that matters.
Re:Assembly for XML by pavlov on Thursday October 30, 2014 @01:30PM (#8534411)
The COBOL of 2050?

I can imagine some poor sap who has not yet been born getting his first job in programming around that time. "Yeah, we don't actually do VR code modelling here, so you have to type. Fortunately there's not a lot of typing for this particular job. Your task is to maintain these assembly scripts. They generate a really complicated old text document format, which is then fed to a big old server in our original data center, which is now completely dark apart from this one machine... It's running something called AIX. Nobody knows what that shit is, so don't execute any commands that are not on the safe list."

Re:Assembly for XML by masklinn on Thursday October 30, 2014 @01:59PM (#8534623)
This seems like a procedural step back from XSLT.

Don't get me wrong, I certainly am not fond of XSLT, its programmatic fundamentals were certainly lacking (technically there, practically a pain in the ass) and the implicit nature of the "current node" always weirded me out, but the very descriptive match/transform of XSLT was reasonably great, any not-too-badly-written stylesheet would show the output structure shine through.

If I wanted something to replace XSLT, I'd take adding XLST-type (match-and-transform) capabilities to a general-purpose language, not attempting to extract a fucked-up version of a jQuery DOM manipulation chain.

Re:Assembly for XML by yegor256a on Friday October 31, 2014 @05:05AM (#8537883)
Yes, exactly a procedural step back from XSLT. In certain situations (most of them are that) you don't want to bother with XSLT. You just want to add attribute to the node, in a few lines of code.
Re:Assembly for XML by OhHeyItsE on Thursday October 30, 2014 @02:56PM (#8535008)
For the coder who looks at XML and says "This isn't quite difficult enough to work with already. There must be another way!"
Re:Assembly for XML by chc on Thursday October 30, 2014 @03:58PM (#8535449)
To be honest, the author is not wrong. It does look easier than XSLT.
Re:Assembly for XML by wtetzner on Thursday October 30, 2014 @05:04PM (#8535811)
But it doesn't look easier than XQuery.
Re:Assembly for XML by masklinn on Friday October 31, 2014 @04:55AM (#8537862)
> It does look easier than XSLT.

Not really. It may look more familiar if you can only think procedurally.

Re:Assembly for XML by yegor256a on Friday October 31, 2014 @05:06AM (#8537886)
Not just difficult, but verbose. XML/DOM manipulations are very verbose, especially in Java. Xembly make them very simple and compact.
Re:Assembly for XML by CmonDev on Friday October 31, 2014 @05:07AM (#8537891)
XML is not difficult to work with though.
Re:Assembly for XML by bbcbasic on Thursday October 30, 2014 @06:10PM (#8536121)
What is the point of this? I don't see a situation where this would be a better choice over:

(1) XSLT (2) Regular programming language e.g. Java / .NET and use the XML libraries to build the document.

Also with the navigation e.g. UP; it looks hard to maintain.

I can imagine production code ending up with:

UP; UP; UP; UP; UP;

A simple change to the XML structure and this will break so easily.

Re:Assembly for XML by killertypo on Friday October 31, 2014 @01:17AM (#8537436)
this supports PUSH and POP

so you could easily PUSH the current node

dive deep deep deep deep (and even have no problem adding more later)

then POP the original location back.

Re:Assembly for XML by bbcbasic on Sunday November 02, 2014 @08:18PM (#8548889)
That ain't a whole lot better.

But if you are only doing very simple stuff that you could do quite simply in XSLT anyway then it is probably fine.

Although XSLT may be preferable anyway due to tooling support.

Re:Assembly for XML by hippowithgas on Thursday October 30, 2014 @05:41PM (#8535988)
Wait, shouldn't this be written in Rust, but with a competing implementation in Go, but it translates it to Javascript in the meantime, because, well, everything is Javascript these days. Then someone will complain that in the book 'XML: The Good Parts', that XML, is just misunderstood, and really, it is beautiful underneath, if you just ignore the cataract-forming hideousness of it all.
Re:Assembly for XML by icholy on Thursday October 30, 2014 @02:09PM (#8534687)
Being implemented in java is just the icing on the cake.
Re:Assembly for XML by zellyn on Thursday October 30, 2014 @02:52PM (#8534977)
1. Reimplement in go. 2. Put "go" in the article title. 3. MADNESS ON HACKERNEWS.
Re:Assembly for XML by smacktoward on Thursday October 30, 2014 @03:11PM (#8535137)
"It's in Go... but it's for working with XML..."

Head explodes

Re:Assembly for XML by icholy on Thursday October 30, 2014 @03:23PM (#8535215)
Not too mindblowing http://godoc.org/encoding/xml
Re:Assembly for XML by smacktoward on Thursday October 30, 2014 @03:27PM (#8535239)
See, it was a joke about how Go is super popular on HN and XML is not, and...

Oh, never mind.

Re:Assembly for XML by taybin on Thursday October 30, 2014 @09:39PM (#8536876)
They don't really do jokes here...
Re:Assembly for XML by malka on Thursday October 30, 2014 @07:55PM (#8536546)
"XML in assembly implemented in 55 lines of Javascript !"
Re:Assembly for XML by yegor256a on Friday October 31, 2014 @05:08AM (#8537894)
Implement it in any other language and send a pull request :) The implementation is very simple, can be done in just a few hours.
Re:Assembly for XML by mey on Thursday October 30, 2014 @04:28PM (#8535622)
Was kinda hoping this was an XML representation of ASM, similar to IBM's JSON in XML recently.
Re:Assembly for XML by chillingeffect on Thursday October 30, 2014 @07:54PM (#8536543)
I was hoping it was assembly code for manipulating XML...
Re:Assembly for XML by bbcbasic on Sunday November 02, 2014 @08:22PM (#8548898)
I thought it would be a .NET assembly for manipulating XML.
Re:Assembly for XML by unwind on Friday October 31, 2014 @08:48AM (#8538433)
Well, that's interesting and weird.

It was very strange for this to use the term "directive" for the core instructions used in the language.

In actual assembly, the term (http://en.wikipedia.org/wiki/Assembly_language#Assembly_dire...) is used for meta information, i.e. the directives are to the assembler (the tool converting your source to a program), not part of the resulting program as such. This created a huge disconnect for me, and I stopped reading.

Re:Assembly for XML by malkia on Friday October 31, 2014 @12:37AM (#8537345)
It actually might be quite useful when doing merging/diffs/undos/redos/etc. operations either with a source server system (p4, git, svn, etc.) or exposing internal tree hiearachy as commands, also serializing/deserializing.

If I'm not mistaken, Autodesk Maya for examples does not store the DAG tree, but the operations done on objects as commands (tcl-like syntax (MEL script)).

So while I'm not entirely sure of its usefulness, I've found situations where this might be helpful, but need to explore it more.

Also for conversion from XML to other things and vice versa...

Re:Assembly for XML by tootie on Thursday October 30, 2014 @07:38PM (#8536489)
For those of you balking, I think this would be really useful for coding XML migrations. If you have a schema, write a xembly script for every breaking change.
Re:Assembly for XML by polemic on Thursday October 30, 2014 @09:36PM (#8536869)
That's the only sane scenario I can think of too, but I have my doubts that it would really be simpler than XSLT for migrating XML. XML->XML is pretty much the only thing that is sort-of easy with XSLT, and it's likely to be a lot more robust, easier to create and debug that the equivalent procedural script.
Re:Assembly for XML by StefanKarpinski on Thursday October 30, 2014 @10:43PM (#8537057)
The elegance of assembly with the performance of XML!
Re:Assembly for XML by kreinba on Friday October 31, 2014 @08:03AM (#8538303)
http://www.yegor256.com/2014/04/09/xembly-intro.html This article explains it even better
Re:Assembly for XML by _random_ on Thursday October 30, 2014 @03:59PM (#8535455)
Well, no worse than transpiling to JavaScript.
Re:Assembly for XML by je42 on Friday October 31, 2014 @01:44AM (#8537498)
what's the use case for this ?