Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pfalcon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
pfalcon
6y ago
Note that the original PEP622 relied on ":=" initially, but they found some corner case with it (apparently, operator precedence related) and switched to "as" in PEP634.
32.
▲
by
pfalcon
6y ago
Pattern matching is the brainchild of ML. Python, being a multi-paradigm language with the strong functional side, missed this simple in concept and powerful in practice language concept.
33.
▲
by
pfalcon
6y ago
No, that's not robust. The idea was simple - to use explicit marker like: case == FOO: case is True: That was part of PEP642, but it ended up containing more other questionable things. I hope that particular point will be separated and
34.
▲
by
pfalcon
6y ago
"f(x)" and "|" inside a regular expression mean something different. Similarly here, pattern matching has its own sub-language (a DSL).
35.
▲
by
pfalcon
6y ago
They went for "UB" exactly because they understand the current behavior is not ideal, and to allow for better implementation and to change it later.
36.
▲
by
pfalcon
6y ago
No worries, this was debated fiercely. In the end, we had to choose between "Python has a reference syntax for pattern matching" vs "Python continues to have disparate 3rd-party extensions for pattern matching, without clear
37.
▲
by
pfalcon
6y ago
I'm with everyone on "incredibly disappointing" valuation. But being pragmatic, I had to accept the idea "it can be addressed later" vs continuing this mess. And there was truly mess, e.g. PEP642, which initially tr
38.
▲
by
pfalcon
6y ago
Don't forget that the poll is dated 2020-11-20 (and majority of votes were cast soon). There was a lot of discussion (and thus maybe elaboration of opinions) since that.
39.
▲
by
pfalcon
6y ago
> From what you're saying, I believe you would complain about a foreign language simply because it doesn't resemble your native language enough. I assume you mean a natural language. No, I won't complain about a real langu
40.
▲
by
pfalcon
6y ago
> Its implicitness is zero -- there is zero information not available in the syntax of the current block Ah, so your mind's window is single block, that what you bang on. You know, blocks can be long too. To the end of reading 1000-
41.
▲
by
pfalcon
6y ago
> I think it's quite the opposite. Don't forget that C also has macros and a lot of arcane undefined behaviour. C lexic-based "macros" are implemented by a separate component, "C preprocessor". C clearly nee
42.
▲
by
pfalcon
6y ago
> I feel like what you're complaining about is the equivelent of Calculon's critique of a screenplay: "no, I don't like the font" I'm a human, and syntax is very important to me. 't broken read can synt
43.
▲
by
pfalcon
6y ago
But no, there's a kind of continuum, and Go/Zig "defer" is already pretty high towards "implicit flow of control" end. (I agree that exceptions are a notch higher.) It's only C's syntax which is truly
44.
▲
by
pfalcon
6y ago
No, I'm adept of (anti)survivorship bias. In other words, I like to study mistakes. And Zig offers a great field of study in that regard, as many issues are seen with a naked eye (i.e. even to casual passers-by).
45.
▲
by
pfalcon
6y ago
Oh, so you really expect every comment not singing hymns to Zig to be downvoted? ;-) Well, they now are.
46.
▲
by
pfalcon
6y ago
Sorry, but throwing an exception in a function call is equivalent to: res, exc = fun(); if (exc) goto exception_handler; That's underlying model of how exceptions behave, and how they're implemented "manually&quo
47.
▲
by
pfalcon
6y ago
I'm sorry, but I do programming languages for decades, and familiar with a bunch of them. There's absolutely nothing special about Zig, it's yet another wannabe proglingo. What sets it apart is strong desire "to replace
48.
▲
by
pfalcon
6y ago
> couldn't be ideologically diverse without jumping through ridiculous hoops. Jumping thru hoops is what Zig seems to choose with its unorthodox, different-just-to-be-different syntax. I wonder, how many will want to jump with it?
49.
▲
by
pfalcon
6y ago
> It existed before. Golang, Haskell, C, D (both kind of - int32_t), caml, and many others. It's i32 that deserves a "why this one?" comment. "i32" and "u32" are used because they are short (and used of
50.
▲
by
pfalcon
6y ago
Both forms feature "implicit flow of control", contrary to Zig's stated goals. In "while (i < 10) : (i += 1)", it's hard to understand what the heck "(i += 1)". The best concept one might get is th
51.
▲
by
pfalcon
6y ago
> while (it.next()) |item| { Talk about confusing, implicit syntax of Zig - there's no connection between "it.next()" and "|item|". It's implicit and you need to make it up. Compare that to other languages:
52.
▲
by
pfalcon
6y ago
> It seeks to be as simple as C It seeks too, but fails. Comparing to really-simple C, it's full of arcane stuff. > Zig rejects any kind of implicitness; all calls must appear as calls. We already have that in C. > Of course,
53.
▲
by
pfalcon
6y ago
Never heard about it. Using OsmAnd for "on foot", bike, motorbike, car, train, flight, sail for 10 years or so.
54.
▲
by
pfalcon
6y ago
Where's your site which has all that?
55.
▲
by
pfalcon
6y ago
> This misses the point. > of food we are able to produce, as well as the amount of energy. We have the technology, and we have the ability. And you miss my point too. I keep reading "we", "we", "we" in r
56.
▲
by
pfalcon
6y ago
By taking them from whoever owns them already? That's still popular petty street crime tactics in 3rd-world countries.
57.
▲
by
pfalcon
6y ago
Let me guess - it's thrown when it's already not in the very edible condition? And it's produced in the first place in the hope that it will be bought at the price asked? So, I'm not sure that those who produce (or distr
58.
▲
by
pfalcon
6y ago
> Who's going to want to play the garbageman game? I'm sorry, but that's exactly the kind of "work" which needs sharing and gamification. Look up "plogging" for example. Also, in 3rd-world, signs like
59.
▲
by
pfalcon
6y ago
> controlled largely by deterministic chemicals I wonder if that's a typo, but there's no determinism all the way up from position of an electron in the core, and thru protein binding, which is also non-deterministic. That'
60.
▲
by
pfalcon
6y ago
> if a city wanted to make automated cars a reality in their streets, there are tons of accommodations they could do: from radio beacons to official maps, standards on how to signal construction work, purposefully designed roads... Sorry
More ›