Live data from Hacker News

A Modern Compiler for the French Tax Code

arxiv.org

81–90 of 136 posts

Re: A Modern Compiler for the French Tax Code

#81
post #63

During one of those rabbit hole journeys I discovered that Dutch Tax authorities use MPS, a DSL creation language/tool by JetBrains [1] It makes me wonder, why haven't DSLs caught up? Their claim that it allows developers spend more time implementing the business logic makes sense. But somehow that promise hasn't been realised. I'm curious to know from those who tried DSLs. [1] https://www.jetbrains.com/mps/documenta…

I make them all the time ( https://jtree.treenotation.org/designer/ ), and track many thousands of DSLs. IMO, the problem is our languages are unnecessarily complicated. they are all linearly parsed BNFs, and you don't need any of that. I think things will start changing big time. That being said, my favorite ecosystem in the traditional DSL world is ANTLR, and I'd highly recommend Terence Parr's books on the field i…

ANTLR 3.x was a game changer for me. I was able to refine my grammars so that the resulting parse tree and abstract syntax trees were the same thing. No goofy inlined tree construction pragmas, term rewriting, post parse tree walk processing.

I'm just a grammar mechanic, so I don't really grok the underlying theory or use the right word for this stuff.

Re: A Modern Compiler for the French Tax Code

#82
post #80

Earlier quoted context omitted.

Yeah, it's Norway. https://github.com/Skatteetaten/trekktabell

How can you tell? All "Languages" I get is "Java 100.0%".

The COBOL part is from memory. I'll have a look to see if I can find a copy floating around somewhere.

Edit: the transition appears to be more like 2016, and one of the commits then refers to a file generated from COBOL: https://github.com/Skatteetaten/trekktabell/commit/5181d86c5...

Re: A Modern Compiler for the French Tax Code

#83

Earlier quoted context omitted.

In Belgium, calculation of the pensions was done in a mix of BS2000 assembly language and COBOL until at least 2007, when they entered a race to switch to Java before the last of the original developers retired.

I worked for an org that tried to modernize, again, their mainframe legacy code, and failed. I always thought it'd be easier to use an emulator and keep using the old stuff. Then over time whittle the code base down to just the business logic.

So you think they still had a 1970s mainframe ? No: Siemens themselves replaced it with an x84 based emulator in the 90s (which ran on a desktop machine).

Re: A Modern Compiler for the French Tax Code

#84
post #30
post #20

Earlier quoted context omitted.

The languages breakdown is interesting. It seems GitHub refuses to admit defeat and categorises the .m files into various other languages which use the extension (M, MATLAB, Objective-C, Mathematica and Mercury). I wonder if they use some sort of fuzzy ML solution for categorising them rather than conventional parsing.

Wonder no more! https://github.com/github/linguist/blob/7c2adbdb15d4efd25d92... As most AI, it's regex and ifs all the way down.

These incredibly vague regexes are hilarious. But I guess if it works, it works (until it doesn't)

Re: A Modern Compiler for the French Tax Code

#86

I remember when the US tax code was going to be simplified so that an entire tax return form could be printed on a post card.

Was that the 9-9-9 plan? To be honest such simple tax rules was eye-opening and refreshing but I don't think it was particularly fair.

Re: A Modern Compiler for the French Tax Code

#87
post #86

I remember when the US tax code was going to be simplified so that an entire tax return form could be printed on a post card.

Was that the 9-9-9 plan? To be honest such simple tax rules was eye-opening and refreshing but I don't think it was particularly fair.

It actually goes back to the flat tax proposals to set the top rate to 28% with very few deductions.

The idea was that you don’t have some rich paying the top rate of 39%, and some paying near zero (cough, cough, Mr. Trump) due to a large discrepancies in deductions.

Re: A Modern Compiler for the French Tax Code

#88

> In France, income tax is computed from taxpayers' individual returns, using an algorithm that is authored, designed and maintained by the French Public Finances Directorate (DGFiP). This algorithm relies on a legacy custom language and compiler originally designed in 1990, which unlike French wine, did not age well with time. This interesting. When it comes to legacy code we think of COBOL and FORTRAN most of the t…

My entire industry (subset of healthcare) mostly uses a single application for 95% of our core business functions. That application is written in Visual FoxPro and is, predictably, pretty terrible. Obviously it isn't going to get better, either, but it'll be a decade or more before there's a serious competitor.

Hah I’m also working in healthcare and we also use Visual FoxPro for storing data. Luckily most of the Visual FoxPro UI is gone.

Re: A Modern Compiler for the French Tax Code

#89
post #63

Earlier quoted context omitted.

I make them all the time ( https://jtree.treenotation.org/designer/ ), and track many thousands of DSLs. IMO, the problem is our languages are unnecessarily complicated. they are all linearly parsed BNFs, and you don't need any of that. I think things will start changing big time. That being said, my favorite ecosystem in the traditional DSL world is ANTLR, and I'd highly recommend Terence Parr's books on the field i…

ANTLR 3.x was a game changer for me. I was able to refine my grammars so that the resulting parse tree and abstract syntax trees were the same thing. No goofy inlined tree construction pragmas, term rewriting, post parse tree walk processing. I'm just a grammar mechanic, so I don't really grok the underlying theory or use the right word for this stuff.

I was late to the party and didn't start until ANTLR4 https://pragprog.com/titles/tpantlr2/the-definitive-antlr-4-...

Re: A Modern Compiler for the French Tax Code

#90
post #63

Earlier quoted context omitted.

I make them all the time ( https://jtree.treenotation.org/designer/ ), and track many thousands of DSLs. IMO, the problem is our languages are unnecessarily complicated. they are all linearly parsed BNFs, and you don't need any of that. I think things will start changing big time. That being said, my favorite ecosystem in the traditional DSL world is ANTLR, and I'd highly recommend Terence Parr's books on the field i…

Does his book actually teach you how to create a DSL using ANTLR and not just and overview? Btw the 2 books of his are almost a decade old, so are they any good now?

Yes, it walks your through it step by step. I have https://pragprog.com/titles/tpantlr2/the-definitive-antlr-4-... and at least 1 more of his, forget where it is. I would say it is ageless (at least, until something better than ANTLR comes along—ohm is promising but not sure what the latest is with that).

"The Definitive ANTLR 4 Reference" is absolutely the most understated title I've ever seen in a book. It's really more like "The Book That Will Change How you Look at Programming Languages Forever"

IMO anyway. I guess it depends on how much you've been exposed to parsers and grammars and compiler compilers already.

Post reply on HN