News for hackers. Stuff that matters.
Re:Show HN: Refurb – A tool for refurbishing and modernizing... by datalopers on Wednesday September 28, 2022 @01:42AM (#33004600)
That code, starting on line 41, has convinced me to continue avoiding Python. Python has went from a clear concise language with one right way to do things, to outpacing C++ when it comes to adding esoteric language features.
Re:Show HN: Refurb – A tool for refurbishing and modernizing... by zem on Wednesday September 28, 2022 @02:57AM (#33004989)
that code is pattern matching on an ast node; the complexity is from the data structure involved, not the language. there is no more concise way to match a specific node and get at the relevant fields, just various different forms of verbose code.
Re:Show HN: Refurb – A tool for refurbishing and modernizing... by jraph on Wednesday September 28, 2022 @05:51AM (#33006204)
If anything, this matching on an AST is very readable and elegant, and that just convinced me that the syntax of Python seems really good to write a parser.
Re:Show HN: Refurb – A tool for refurbishing and modernizing... by sireat on Wednesday September 28, 2022 @12:18PM (#33009754)
that AST parsing code looks like something written in Scala ...

seems like Scala is moving to more Python like and Python is moving to add some features from Scala.

Re:Show HN: Refurb – A tool for refurbishing and modernizing... by Waterluvian on Wednesday September 28, 2022 @08:02AM (#33006933)
I’m actually genuinely curious what alternative you might present from any language. I always thought that was relatively concise for such a complex data structure.
Re:Show HN: Refurb – A tool for refurbishing and modernizing... by fny on Wednesday September 28, 2022 @09:00AM (#33007377)
They're complaining about types, :=, and match.
Re:Show HN: Refurb – A tool for refurbishing and modernizing... by ac130kz on Wednesday September 28, 2022 @04:13AM (#33005471)
That code has nothing to do with conciseness, he could've extracted the arguments in separate variables