News for hackers. Stuff that matters.
Re:XML Is the Future by yarg on Monday June 26, 2023 @03:35AM (#36476809)
XML has been around for long enough that a lot of people have developed a tacit understanding of it, it's not reasonable in all cases (I once went to war with an 8000 line build.xml file - fuck everything about that), but for simple cases it's an easy to parse hierarchical format that most people who need to can get a handle on.

But there's one vestigial artefact that irks me.

    <tree>
        <leaf colour="green"/>
        <leaf colour="yellow"/>
    </tree>
Why can't I just do this? Validation and highlighting are well past the point where it should be a viable option.

    <tree>
        <leaf colour="green"/>
        <leaf colour="yellow"/>
    </>
Re:XML Is the Future by tomgp on Monday June 26, 2023 @03:39AM (#36476830)
I’m not sure, but possible legibility? Like if you have a bunch of nested nodes it’s nice to be able to see where one ends at a glance.
Re:XML Is the Future by yarg on Monday June 26, 2023 @03:58AM (#36476958)
Decent indenting generally helps there (and siblings are often of the same type anyway, in which case it doesn't improve indistinguishability).

Beyond that syntax highlighting and marcation of the head and tail of the currently selected tree can improve things when you're manually editing a document.

Re:XML Is the Future by MawKKe on Monday June 26, 2023 @03:47AM (#36476884)
why not go further, why can't we just write

  <tree
    <leaf colour="green">
    <leaf colour="yellow">
  >
although now that ="foo" business seems too noisy. how about

  <tree
    <leaf :colour green>
    <leaf :colour yellow>
  >
also, those angle brackets are too pointy, let's swap them to something more pleasant

   (tree
     (leaf :colour green)
     (leaf :colour yellow))
Re:XML Is the Future by yarg on Monday June 26, 2023 @03:53AM (#36476929)
The change I suggested is backwards compatible - probably a relatively small change to a single method in parsing.

You, on the other hand, took the pre-existing syntax and contemptuously threw it out the window - and completely ignored the advantage of widespread tacit understanding.

Re:XML Is the Future by throwaway744678 on Monday June 26, 2023 @04:07AM (#36477029)
Don't sweat it, it was a joke (turning your sample into LISP)
Re:XML Is the Future by yarg on Monday June 26, 2023 @04:11AM (#36477053)
Sorry, I haven't spent any time with LISP.

I do however want to write a dialect of it, though mostly for the sake of naming it 'Lithp'.

Re:XML Is the Future by bad_login on Monday June 26, 2023 @05:42AM (#36477630)
Re:XML Is the Future by lionkor on Monday June 26, 2023 @07:56AM (#36478546)
i dont have eyes so id prefer

   enum Color { green, yellow };
   struct Leaf { Color color; };
   std::vector<Leaf> tree = {
       { .color = green },
       { .color = yellow },
   };
which has the benefit of requiring a massive compiler suite, a specific language version, but it compiles to 0 bytes because it's not used (how great!!)
Re:XML Is the Future by HelloNurse on Monday June 26, 2023 @07:58AM (#36478562)
Simplification from SGML was a core design objective for XML, and this kind of fairly harmless syntax options was mostly exterminated as a cognitive and implementation cost.