Live data from Hacker News

XML is a cheap DSL

unplannedobsolescence.com

171–180 of 274 posts

Re: XML is a cheap DSL

#171

Earlier quoted context omitted.

I keep seeing people make the same mistake as XML made over and over; without learning from it. I will clarify the problem thusly: > The more capabilities you add to a interchange format, the harder that format is to parse. There is a reason why JSON is so popular, it supports so little, that it is legitimately easy to import. Whereas XML supports attributes, namespaces, CDATA, DTDs, QNames, xml:base, xml:lang, XIncl…

I consider CSV to be a signal of an unserious organization. The kind of place that uses thousand line Excel files with VBA macros instead of just buying a real CRM already. The kind of place that thinks junior developers are cheaper than senior developers. The kind of place where the managers brow beat you into working overtime by arguing from a single personal perspective that "this is just how business is done, son…

Most people salaries transfers & healthcare offers literally run on a mix of CSV and XML!

CSV is probably the most low tech, stack-insensitive way to pass data even these days.

(I run & maintain long term systems which do exactly that).

Re: XML is a cheap DSL

#173
post #108

To go up one level of abstraction; any thoughts on to whether or not we might actually be able "solve" the time old problem of "which data format" thanks to ubiquitous AI tooling? Just kind of spitballing here, but in a world where can point AI at some good, or badly formed -- XML, json, toml whatever and just kind of say "hey, what's going on here, fix it?"

An omniscient AI would tell you the same thing as any experienced engineer: “it depends.”

Re: XML is a cheap DSL

#174

Earlier quoted context omitted.

A Norwegian "ENK" ("enkeltmannsforetak"; self-employment) deals with a more integrated state reporting environment, stricter cash-sale controls, more emphasis on formal bookkeeping and VAT/cash-register infrastructure, and a more pre-filled tax ecosystem. You can get a long way cheating the system if you deal with cash only, as banks etc. are required to report everything about everyone to the government, but these d…

If you have only W2 income ("W2" is the name of the form the employer reports your income and tax witholding on) and no unusual other credits or deductions, then US tax filing is very simple. It is not much more than: Taxable income = Total income - Standard deduction Look up tax due in a table. Subtract taxes already witheld, pay (or refund) the difference. In most states you also have to file, but this is normally…

If it's that simple, how come it's so complicated that the US have an entire business line profiting from tax filing?

Re: XML is a cheap DSL

#175
”With a declarative graph representation, we get auditability and introspection for free, for every single calculation.”

No, you don’t. Those are dependent on the actual implementation.

The XML layer is a neat looking storefront hiding the crimes being committed in the back room.

Re: XML is a cheap DSL

#176
post #139

Earlier quoted context omitted.

I think you have it backward. Libraries like zod exist _because_ JSON is so ubiquitous. Someone could just as easily implement a zod for XML. I’m not a huge proponent of XML (hard to write, hard to parse), but what you describe are not technical limitations of the format.

I think that you're missing that the parent poster and I are implicitly assuming that XML is validated the most common way, i.e. with XSD, and that I'm comparing XSD validation and Zod.

Ah that’s fair. So the discussion is about the quality of the validation libraries?

Re: XML is a cheap DSL

#177

There is a middle ground between using XML and imperative code for representing tax forms. Robert Sesek’s ustaxlib [0] uses JavaScript to encode the forms in a way that is reasonably statically analyzable. See the visualizer [1]. My approach uses XML to represent the forms with an embedded DSL to represent most expressions tersely. See for example Form 8960 in ustaxlib [2] and my TaxStuff program [3]. The main thing…

For what it's worth, I think that an embedded DSL to represent most expressions tersely is a worthwhile idea to explore—it's just a more expensive one. That's a cost-effective choice at a some levels of resourcing, but not every level of resourcing.

Re: XML is a cheap DSL

#178

Earlier quoted context omitted.

If you have only W2 income ("W2" is the name of the form the employer reports your income and tax witholding on) and no unusual other credits or deductions, then US tax filing is very simple. It is not much more than: Taxable income = Total income - Standard deduction Look up tax due in a table. Subtract taxes already witheld, pay (or refund) the difference. In most states you also have to file, but this is normally…

If it's that simple, how come it's so complicated that the US have an entire business line profiting from tax filing?

Most people never look into how simple their situation might be. They just pay TurboTax $50 and move on with their day.

But also, taxes can get complicated, I'm just suggesting that for many people, with typical incomes and employment, they are not.

When I was in middle school (1970s) we learned how to file a tax return. For some reason this is no longer taught today.

Re: XML is a cheap DSL

#179

Earlier quoted context omitted.

A lot of people dislike that decision not to include comments in JSON, but I think while shocking it was and is totally correct. In a programming language it's usually free to have comments because the comment is erased before the program runs; we usually render comments in grey text because they can't change the meaning of the program. In a data language you have no such luxury. In a data language there's no comment…

Could you imagine hitting a rest api and like 25% of the bytes are comments? lol

Worse than that - people will start tagging "this value is a Date" via comments, and you'll need to parse ad-hoc tags in the comments to decode the data. People already do tagging in-band, but at least it's in-band and you don't have to write a custom parser.

Re: XML is a cheap DSL

#180
post #124

Earlier quoted context omitted.

Could you imagine hitting a rest api and like 25% of the bytes are comments? lol

HTML and JS both have comments, I don't see the problem

And both are poor interchange formats. When things stay in their lane, there is no "problem." When you try to make an interchange format using a language with too many features, or comments that people abuse to add parsable information (e.g. "type information") then there is a BIG problem.
Post reply on HN