14 comments

  • santiagobasulto 2 hours ago
    This is awful. I love type correctness, but going all the way to flag PORT=8080? There should be a basic level of type inference.

    Especially for “typed” languages that have done typing very wrong, as Python or Typescript.

    • jlnthws 24 minutes ago
      I agree. This looks like a dogmatic types-everywhere, unpythonesque limitation. Add type inference and I’ll buy it.
    • IceDane 2 hours ago
      Can you elaborate how those languages have "done typing very wrong"?
  • gavmor 5 hours ago
    Gawain, the finest night alive (literally Þe most kydde knyȝtez vnder Krystes seluen) committed one indisputable, albeit minor, transgression under a regime of unsparing precision.

    > ȝe han redily rehersed, bi resoun ful trwe, Alle þe covenauntz þat I yow kende...

    ("You have readily recapitulated, by fully accurate accounting, all covenants that I declared.")

    I can't think of a more fitting name except, perhaps, the speaker of these lines: the exacting Lord Bertilak.

    • thaumasiotes 38 minutes ago
      > the finest [k]night alive (literally Þe most kydde knyȝtez vnder Krystes seluen)

      Some scattered thoughts:

      - As far as I can tell kyðde means "known" and is only indirectly a statement about his quality as a knight. You can be the most famous without being the best.

      - Resoun ["reason"] does means 'accounting', but as in 'give an account of what happened', not in the modern sense of "financial figures". I have difficulty understanding your translation for that reason.

      - I'm curious why there's a 'v' in "covenauntz" when "seluen" is spelled with a 'u', or, for that matter, when "vnder" is spelled with a 'v'.

      - Tolkien (as seen on wikisource) and Richard Morris (Project Gutenberg) have And þou hatȝ redily rehersed, bi resoun ful trwe / Clanly al þe couenaunt þat I þe kynge asked. (This solves the problem of why there would be a 'v' in covenaunt...) This seems to acknowledge that Gawain has accurately repeated the terms of the single covenant that the Green Knight has declared to Arthur ("let one of your men take up my guisarme and deal me any blow, and I will return the same blow twelve months hence"), not a list of every agreement he's ever made with anyone. I'm a little surprised by þat I yow kende; as far as I was aware, the Green Knight made his declaration to the court in general and had no idea that the person taking him up on it would be Gawain.

      - Does Lancelot exist in the source you're quoting from? The Knight of the Cart seems to predate Gawain and the Green Knight by a couple of centuries.

      (While looking into some of these questions, I found the following project:

      https://digitalcollections.ucalgary.ca/Browse/Collections/Ga...

      https://wpsites.ucalgary.ca/gawain-ms/wp-content/uploads/sit...

      https://wpsites.ucalgary.ca/gawain-ms/wp-content/uploads/sit...

      which I'm linking here in case other people find it interesting, and also in case this makes it easier for me to find it again myself one day.)

    • bustermellotron 4 hours ago
      > "You have readily recapitulated, by fully accurate accounting, all covenants that I declared."

      This should be in the README.

  • orsorna 4 hours ago
    This is cool. And I appreciate the cheeky comment about not using this program if your IDE or whatever does type checking already :)

    But honestly, after I realized I appreciate types being enforced, I started writing in different languages. I rarely return to Python unless I'm scripting something that doesn't require longevity.

    • nekgrim 3 hours ago
      What languages are you using ?
  • michalc 3 hours ago
    I think similar to `dict[str, Any]`, my (justified?) recent pet peeve is `| None`.

    I posted this yesterday pretty much on that: https://charemza.name/blog/posts/software/type-safety/type-s...

    • disgruntledphd2 2 hours ago
      Yeah, that always stinks of types look nice, but I can't be bothered to try a little harder.
      • stephantul 1 hour ago
        What do you think it should be? I use | None a lot and it doesn’t seem like a smell to me
        • disgruntledphd2 40 minutes ago
          i feel like you probably just shouldn't return None, as it causes issues when tracing problems through the system.

          If you must return None somewhere, I'd really prefer it to happen in one place (so the top level function may return None if something weird happens, but all the individual functions return a value).

          But to be fair, this is probably just trauma from tracking down weird sentinel values.

  • Garlef 5 hours ago
    Maybe not for me but I love the attitude.

    (And actually, my personal objection is incidental: The python syntax is not pretty to begin with and the situation does not improve with even more visual verbosity)

    • skeledrew 4 hours ago
      > The python syntax is not pretty to begin

      That's an interesting objection, given Python is the closest programming language to English. Understandable if your native language isn't English, but really strange otherwise IMO.

      • stackghost 3 hours ago
        Semantic indentation is fundamentally an insane design. And I don't mean "insane" as a colloquialism for "dumb". I mean it is literally not a sane choice to make.

        English would make a horrid programming language, so being close to it is not a plus.

        • somat 6 minutes ago
          I think it makes a lot of sense.

          Nearly everybody agrees that a neat formatting style is better and more readable than a messy inconsistent one. So while designing a programing language intended to be highly readable we jump two steps ahead. mandatory linting, make the neat format part of the syntax, remove the parts of the syntax now superfluous due to the mandatory neat format, and you have python.

        • throw-qqqqq 48 minutes ago
          > Semantic indentation is fundamentally an insane design

          That is a common complaint against Python, and tbh it also made me uneasy at first.

          But honest question: Do you write any Python yourself?

          I ask because I’ve only heard this objection from people who do not write Python at all.

          IME, people soften up on it after some use. I find that this is the case for many (visual) aspects of syntax.

        • teiferer 2 hours ago
          In the age of auto-formatters, I have less and less sympathy for this point of view.

          Any widely used formatter indents along semantics anyway, so why clutter your code with curly braces everywhere if stucture is clear from indentation? Might as well make it semantic.

          Before auto-formatters, there was the occasional case where you could argue that some quick hack made something more readable, at the expense of less consistency and wasted time arguing about this in code reviews. But that ship has sailed, arguably rightfully so.

          And that doesn't even bring the LLM angle. If code is generated by a machine anyway and you just review it, if even that, why still bash indentation as a semantic construct?

          • stackghost 2 hours ago
            If you have to run your source code through a formatter to make sure it doesn’t have mixed tabs and spaces that is not the flex you seem to think it is.

            If you’re going to just have an LLM write all the code anyway why bother with a slow janky mess like python at all? Just make it write rust or java or go or literally anything.

            Imagine having a magical machine that can write code in any programming language ever conceived, and you ask it to pick the language whose community thinks virtualenvs are a reasonable solution as opposed to a mark of profound shame. Couldn’t be me.

            • 7bit 30 minutes ago
              [dead]
        • UltraSane 1 hour ago
          Considering the endless arguments over C syntax I really don't see what is so weird about Python indentation. It has the nice effect of making code look a lot more consistent.
        • 7bit 31 minutes ago
          [dead]
      • lefra 1 hour ago
        Python code using advanced features of the language (see for example [1]) look as much like line noise as C++ template metaprogramming. If "close to the english language" is your criterion, I believe COBOL should rank higher than python:

        ADD transaction-balance TO total-balance.

        Is readable to a layman whereas this isn’t:

        total-balance += transaction-balance

        Or even worse for someone who learned algebra but not programming (this looks like an equation, and transaction-balance is therefore equal to zero):

        total-balance = total-balance + transaction-balance

        [1] https://stackoverflow.com/questions/6760685/what-is-the-best...

  • __mharrison__ 5 hours ago
    Be cool to have a strict Python that actually runs fast with types...
  • pmg101 33 minutes ago
    I wish the people spearheading the charge to integrate static typing into Python has borne in mind the old aphorism about not being able to make an octopus by nailing legs to a dog.

    Python is a great dynamic language. There are many great statically typed languages. Why does every great dog have to become a half-assed octopus?

  • isaachinman 4 hours ago
    Maybe just... Stop writing py?
  • rbnafo 3 hours ago
    Python 9.x release notes: we are a statically typed language now.
  • cadamsdotcom 4 hours ago
    Yes! Exactly what a long term codebase needs.

    May as well be strict, right! We have the technology.

    Agents will fix lint issues same as any other kind of error. So lint in a blocking pre-commit hook. End result: 100% strongly typed agent written code, at least one kind of slop gone.

  • blunt_read 5 hours ago
    [flagged]
  • mesm7903 4 hours ago
    [flagged]
  • jheriko 4 hours ago
    [dead]