by mrcwinn · 3y ago · 0 comments
Faster, yes, but at what cost?
I'm so impressed by the Python community, but I'll never quite understand why they gravitated to... Python itself. It's unbelievable to me that in Mojo's case some of the brightest, most famous engineers have gathered to do incredible computer science work to improve the compute performance of a language that is fundamentally flawed in its performance characteristics for those very applications. It just seems like such a waste.
How on earth did we arrive at this moment?
Chris Lattner is right in his Lex interview: he had to accept that the community was already committed to Python and given that reality, that in turn pre-filtered his available paths. But my god, what if the community had gravitated to a better language [for these purposes] in the first place? How much further along would we be in our tooling and capabilities to deliver value?
Chris, who I admire, loves to talk about language design decisions; loves to talk about how thoughtful they were in the decision-making around Swift; and then in the next breath says, hey whitespace-based scoping doesn't matter, don't worry about these things. Chris all you do is worry about these things, and worry about them for Mojo. He clearly has opinions that he masks about design choices Python has made; otherwise, after all, why the need to make Mojo?
It just seems like at the end of the day, Mojo may be the most technologically advanced lipstick ever to be placed on a pig.
(Edit for grammar, but clearly not for brevity or conciseness. XD)
Braces are strictly worse than whitespace indentation for several reasons. Brace-based languages:
1) Generally have the "dangling else" set of ambiguities. 2) Some (e.g. C) allow but do not require braces which leads to style debates. The ones that require braces are more verbose. 3) Require more punctuation clutter, and consume more vertical whitespace in practice. 4) ... use braces that are completely redundant with indentation in practice!
It's super funny to see people defend curly based languages. Using curlies but not indenting properly is almost always a sign of a bug (e.g. clang has warnings for this sort of thing due to the "goto fail" and other debacles.
That said, as you also know, Python compat is not optional for us, so Mojo doesn't actually a choice at all here. I find it amusing though that your post acknowledges thoughtfulness in language design and thinks this is an example of a lapse of judgement. :P
-Chris
Well, that's because they're not really "strictly worse" in every way. I find curly braces helpful for readability and cursor navigation. The latter is only possible with Python by completely parsing the code. Also I don't like reading vertically dense code, so having (almost) empty lines inbetween is fine. All subjective of course, but that's the case for every aspect of language syntax.
> Using curlies but not indenting properly is almost always a sign of a bug
I don't think anyone criticising Python's syntax cares about the freedom to have inconsistent indentation, that's not the point.
Ha! I love your reply. Thank you.
I know you care about language design. As I said more or less, that's self-evident, and I'm sorry for taking your whitespace comments too literally. You're the source, after all, not me, so accept my apologies there. It's misinterpretation, but not meant to be a misrepresentation. :-)
My comment wasn't meant to be critical of you. Honestly, as a pretty famous engineer, it never even crossed my mind you might read my message. As I said, I know you have to deal with reality to accomplish your goal, and that reality existed before you showed up to take on the challenge.
Thank you for all your contributions and good luck on Mojo.
Chris
Better in what regard? Performance? Maybe there are more important things than performance, like ease of use and barriers to entry.
People in this space already tackle essentially complex problems, don't throw more accidental complexity in the form of "better" or more performant languages/APIs.
It seems like there are some potential candidates with improvements in dimension X, but nothing that is an obvious alternative.
Python is fantastic at lashing things together, and most programming is combining pre-existing functionality.
Based on Python's slow and steady incresae, timing and luck don't seem like good factors for explaining its popularity. The others are debatable though.
[0]
https://flatironschool.com/blog/python-popularity-the-rise-o...
Luck is harder to quantify, but at the very least competitors like common lisp didn't have much of it.
Language wars have been forever, of course. But for a few years around 2010-ish, practically every single thread would have someone bringing up Python. If the post was about a tool, how the thing should have really been written in Python. If it was a how-to tutorial about a feature in another language, there would be a subthread about how Python undeniably does it better. Not occasionally, in a thread here and there - it was to the extent you couldn't miss it even if you wanted to. That's a kind of marketing that's proven effective in a forum like this, which is why it's being replicated by other languages now.
As someone that started to use python for science relatively soon (before numpy), I have to ask: which better language was existing at this time ?