Rendered at 21:43:59 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
gavmor 2 days 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.
MarinhoD 1 days ago [-]
You're a man of culture my good sir.
thaumasiotes 1 days 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.
- 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:
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.)
thaumasiotes 1 days ago [-]
There seems to be a much bigger problem with calling Gawain "the finest knight" based on the line þe most kyd knyȝteȝ vnder Krysteȝ seluen - isn't knyȝteȝ plural?
With all þe wele of þe worlde þay woned þer samen, [With all the wealth of the world they were there together]
þe most kyd knyȝteȝ vnder krysteȝ seluen, [the best-known knights under Christ's self]
and þe louelokkest ladies þat euer lif haden, [and the loveliest ladies that ever lived] ("had life"?)
and he þe comlokest kyng þat þe court haldes [and he the comeliest king that holds the court]
Granted, I'm mostly going off of a dictionary of Middle English here, but I note that Morris' edition annotates this passage as "All was joy in hall and chamber, among brave knights and lovely ladies". And the structure of the passage, describing how "they" are all "together" at court, the knight(s) and the ladies and the king, really strongly suggests that it is in fact the knights and not the knight.
gavmor 2 hours ago [-]
Re: ladies, maybe "had lived", ie "live had-ed."
Re: "most kyd" vs "finest", wow--not sure how I missed the obvious plural. Also, I mis-spelled "knight" XD.
thaumasiotes 2 hours ago [-]
It seems fairly safe to take the verse as written and just understand that 14th-century English seems to have used "have life" where modern English instead uses "be alive". There's nothing shocking about the expression in general, it just isn't part of the English spoken 700+ years after the poem was written.
bustermellotron 2 days ago [-]
> "You have readily recapitulated, by fully accurate accounting, all covenants that I declared."
This should be in the README.
mcswell 1 days ago [-]
It's not, because it's in the License Agreement that you clicked without reading.
santiagobasulto 2 days 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 1 days ago [-]
I agree. This looks like a dogmatic types-everywhere, unpythonesque limitation. Add type inference and I’ll buy it.
thatsabadlook 1 days ago [-]
I really wish more people would take a look at the tools they used and considered "does this tool actually do what I need, or am I bending it because toolbox is limited?".
I won't go as far as to say this is awful but I will say, why? If you want or need this, please change languages. There are so many strongly typed languages out there.
IceDane 2 days ago [-]
Can you elaborate how those languages have "done typing very wrong"?
santiagobasulto 1 days ago [-]
Python is not statically typed, so I’ll leave it out of the conversation cause it doesn’t even qualify.
As for Typescript, everything is wrong. Interfaces can’t describe static methods, can’t declare what exceptions a method throws, etc. not even gonna mention type variance because it’d be a waste of time.
I used to study a lot type systems in my youth. Correct statically typed languages are not practical (think Scala). Practical languages can’t be correctly typed (think Go or even Java). There’s always a compromise. That’s why project like this one makes me chuckle, the idea of using statically typed languages is to introduce “some” safety and correctness, so trying to go the other extreme makes no sense.
IceDane 12 hours ago [-]
It's very hard to argue against something so hand-wavy where you won't even bother with certain arguments "because it'd be a waste of time". I also doubt that you yourself have a proper definition in your head for what "statically typed" really means, nor do you really answer why these languages "do typing very wrong", whatever that is supposed to mean.
"Python is not statically typed" doesn't really make sense, because if it is possible to build a static type-checker for python, then you can in fact write statically typed programs in Python, whether or not it is dynamic underneath. The same applies to TypeScript. If I have checked all the types in my program statically, I have written a statically typed program, regardless of whether javascript is dynamically typed underneath.
As for this project: I don't think it's useful because the type-checkers that exist for python have type inference. There is no particularly good reason to give every single thing a type annotation because it provides very little value.
In the end, the only question that is relevant for these sort of type-checkers that are built after the fact is really "Do they provide extra safety and value?" and the answer is very clearly a resounding "yes". Your theoretical gripes don't really have any bearing on that.
whattheheckheck 20 hours ago [-]
Is Rust correctly typed? Is there anything wrong with it
soulofmischief 1 days ago [-]
Is 8080 a number or a string? The distinction matters in certain contexts.
stratos123 1 days ago [-]
It's not ambiguous in Python. 8080 is an integer and '8080' is a string.
soulofmischief 11 hours ago [-]
Yeah, my brain wasn't working for a moment, when I saw the all-caps variable name I short-circuited.
KaiserPro 1 days ago [-]
I really wish there was a "strict" mode like there is in perl.
I know thats incredibly unlikely, as python is captain duck typing, and type inference is built so deeply into the language internals that its almost impossible to undo.
But, just think of how many bugs you could squash by forcing type inference up front. (yes, it would also cause a whole load of others as well.)
Perhaps I should just use c# instead, as that basically has all of this, with the option for looseygoosey mode.
dmmartins 1 days ago [-]
I write python code for more than 20 years and I never hit a bug that was related to a variable type. Really don’t understand all the type hint noise. To me it just makes the code harder to read
rented_mule 1 days ago [-]
I've been writing Python since v1.4 and no other language comes close to matching my brain so well. I've rarely hit such bugs, but I hit a gigantic source of them at one job.
It was a 1-2M line codebase built in the Python 2.3-2.5 years. A pattern that had evolved in that codebase was to pass around a context dict to every non-trivial call. It was always the first parameter (other than `self`) and always had the same name. The only way to know the contents of the dict was to know the upstream call path to your function (not just the stack, any detours could have written into it as well). Things like a "price" whose value might be an integer number of US pennies or a Money object with a value and a currency identifier (e.g., USD, JPY, etc.). Much of the code just assumed it was whatever it was the first time they inspected the context dict as it arrived at their call site. Someone else modifies a code path and suddenly the contents of the context dict change on you. If your automated tests don't include that new code path, you catch the issue in prod. So, automated tests had to include all possible run-time call paths to catch these bugs before deployment, and that's impractical.
To me, one of the most important advancements Python has ever made is frozen, kw_only dataclasses with thorough type hints. They bring a lot of clarity to the code that uses them, such code is easier to test, and there are fewer bugs discovered at run-time. Extensive use of them makes type inference easier, so hints can me skipped in many places. Any difficulty in creating them often means the data model is not sufficiently flushed out, and that's good to know. I rarely write non-dataclass classes in recent years. I do add read-only properties to dataclasses liberally.
All this fixes many of the challenges that come with Python's highly dynamic nature, but let us keep many of the benefits.
KaiserPro 1 days ago [-]
I have written for a similar amount of time, and I think I've just got used to it.
The classic is pulling in json or some other structured data and something not being the type you expect. The error happens way down the line, rather than at import, because why would you do a full validation every time you use JSON right?
I think typehinting is pretty useless in python. Its a nice idea and if your IDE is setup for it, can provide useful information that you're doing something wrong. But its requires lots of tooling and setup to provide useful signal, and is optional.
zbentley 1 days ago [-]
That seems impossible, unless you’re using a very unusual definition of “bug related to a variable type”.
You’ve never had a bug caused by None showing up in code that didn’t expect it? Or getting an object of the wrong type that didn’t have the method you tried to call on it?
mcswell 1 days ago [-]
I recently added type checking on arguments and return types (not on the variable inside a function). I didn't exactly discover bugs, but I did run into a number of issues I wasn't expecting, like a function that returned TextIOWrapper in one case, and StreamWriter in another. Had to do some research to figure out which one I should be using.
orsorna 2 days 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 2 days ago [-]
What languages are you using ?
michalc 2 days ago [-]
I think similar to `dict[str, Any]`, my (justified?) recent pet peeve is `| None`.
Yeah, that always stinks of types look nice, but I can't be bothered to try a little harder.
stephantul 1 days ago [-]
What do you think it should be? I use | None a lot and it doesn’t seem like a smell to me
disgruntledphd2 1 days 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.
frogulis 1 days ago [-]
Asking as an outsider: what's the issue with `| None`? Is it not type checked properly? Just prefer to do all error handling with exceptions? Other?
whattheheckheck 20 hours ago [-]
It doesn't really constrain the range of Types that could come through so it's a tad bit harder to think about
michalc 15 hours ago [-]
I think exactly... and it can be "pervasive": you end up with special-casing None in a lot of places, when actually the "better" thing _could_ be to have a check once somewhere higher up the stack and dealing the None case there. Or (depending on how None is used) restructuring the code so there is never a None case. Often None signifies just "what happened to be coded up first" and that historical legacy can end up enshrined in the code structure for years.
It's not necessarily always "wrong", but you essentially have to think about "what's the right behaviour on None" a lot more, and while yes the type checker will help avoid runtime errors from random places, I think that can lead to essentially runtime bugs if you answer that question wrong. Or, at best you end up with quite messy data transformation and error handling, which itself can end up as a source of bugs.
One thing I try to ask myself is "what would this look like without `| None`", and take it from there. Also, it isn't `| None` as such, it can be any union type: code can end up with blurry responsibility.
disgruntledphd2 13 hours ago [-]
> when actually the "better" thing _could_ be to have a check once somewhere higher up the stack and dealing the None case there.
This is what I tend to prefer. Not always possible, but worth striving for.
> One thing I try to ask myself is "what would this look like without `| None`", and take it from there. Also, it isn't `| None` as such, it can be any union type: code can end up with blurry responsibility.
Yeah, unions can be problematic, but at least they're more legible than None as this can basically break everything.
stephantul 1 days ago [-]
Ah right, I didn’t consider this was about return types! I agree that returning None is often a smell.
Garlef 2 days 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 2 days 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 2 days 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 1 days 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 1 days 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.
skeledrew 1 days ago [-]
> English would make a horrid programming language, [...]
We now have definitive proof that this is incorrect: LLMs make using English - and any other natural language - very straight-forward to instruct machines. Similar to how the compilers and interpreters make the bastardized subset of natural language that we formalize into "programming languages" translatable into machine language. Ultimately the goal is identical: human-machine communication.
UltraSane 2 days 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.
teiferer 2 days 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 days 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.
skeledrew 1 days ago [-]
> Just make it write rust or java or go or literally anything.
Not literally anything. Just go the full distance and have it directly output binary. No need for any intermediate code at all.
7bit 1 days ago [-]
[dead]
7bit 1 days ago [-]
[dead]
lefra 2 days 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):
Yes, the more natural language-like, the better. I think the issue with BASIC, COBOL, etc is they're too English-like, because it forces everyone to learn a lot of English in order to learn programming. Mathematics uses more universal symbols, which is a better compromise. It also scales better as it's far less effort to type "+" vs "ADD", etc.
wongarsu 1 days ago [-]
Perl is another language I would rank as much closer to English than Python is. Cobol might take the crown though, at least if we exclude joke languages
2 days ago [-]
cadamsdotcom 2 days 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.
codedrift_ 22 hours ago [-]
I see it as more of a spectrum.
Like, maybe untyped Python is good enough for you with pylint or another linter that helps the code me more idiomatic. Or maybe you reach for ty because you want to have some type checking to avoid common coercion bugs.
And then there's this, for when ty simply wasn't enough and you've inherited some monster codebase where absolute rule over types is required. It's probably overkill for most codebases, but I can think of a few legacy codebases that would benefit from this...
MustafaYenler 1 days ago [-]
[flagged]
__mharrison__ 2 days ago [-]
Be cool to have a strict Python that actually runs fast with types...
>a strict Python that actually runs fast with types...
Isn't that just C with extra steps
perpetualpanda 2 days ago [-]
C is the last thing I'd call strict XD
stratos123 1 days ago [-]
Isn't this just... a strict downgrade to a type checker? If you want to require typehints wherever the type checker can't infer them, there's options for that. Requiring type hints everywhere is a terrible idea.
pmg101 1 days ago [-]
I wish the people spearheading the charge to integrate static typing into Python had 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 2 days ago [-]
Maybe just... Stop writing py?
rbnafo 2 days ago [-]
Python 9.x release notes: we are a statically typed language now.
> ȝ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.
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.
- 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.)
With all þe wele of þe worlde þay woned þer samen, [With all the wealth of the world they were there together]
þe most kyd knyȝteȝ vnder krysteȝ seluen, [the best-known knights under Christ's self]
and þe louelokkest ladies þat euer lif haden, [and the loveliest ladies that ever lived] ("had life"?)
and he þe comlokest kyng þat þe court haldes [and he the comeliest king that holds the court]
Granted, I'm mostly going off of a dictionary of Middle English here, but I note that Morris' edition annotates this passage as "All was joy in hall and chamber, among brave knights and lovely ladies". And the structure of the passage, describing how "they" are all "together" at court, the knight(s) and the ladies and the king, really strongly suggests that it is in fact the knights and not the knight.
Re: "most kyd" vs "finest", wow--not sure how I missed the obvious plural. Also, I mis-spelled "knight" XD.
This should be in the README.
Especially for “typed” languages that have done typing very wrong, as Python or Typescript.
I won't go as far as to say this is awful but I will say, why? If you want or need this, please change languages. There are so many strongly typed languages out there.
As for Typescript, everything is wrong. Interfaces can’t describe static methods, can’t declare what exceptions a method throws, etc. not even gonna mention type variance because it’d be a waste of time.
I used to study a lot type systems in my youth. Correct statically typed languages are not practical (think Scala). Practical languages can’t be correctly typed (think Go or even Java). There’s always a compromise. That’s why project like this one makes me chuckle, the idea of using statically typed languages is to introduce “some” safety and correctness, so trying to go the other extreme makes no sense.
"Python is not statically typed" doesn't really make sense, because if it is possible to build a static type-checker for python, then you can in fact write statically typed programs in Python, whether or not it is dynamic underneath. The same applies to TypeScript. If I have checked all the types in my program statically, I have written a statically typed program, regardless of whether javascript is dynamically typed underneath.
As for this project: I don't think it's useful because the type-checkers that exist for python have type inference. There is no particularly good reason to give every single thing a type annotation because it provides very little value.
In the end, the only question that is relevant for these sort of type-checkers that are built after the fact is really "Do they provide extra safety and value?" and the answer is very clearly a resounding "yes". Your theoretical gripes don't really have any bearing on that.
I know thats incredibly unlikely, as python is captain duck typing, and type inference is built so deeply into the language internals that its almost impossible to undo.
But, just think of how many bugs you could squash by forcing type inference up front. (yes, it would also cause a whole load of others as well.)
Perhaps I should just use c# instead, as that basically has all of this, with the option for looseygoosey mode.
It was a 1-2M line codebase built in the Python 2.3-2.5 years. A pattern that had evolved in that codebase was to pass around a context dict to every non-trivial call. It was always the first parameter (other than `self`) and always had the same name. The only way to know the contents of the dict was to know the upstream call path to your function (not just the stack, any detours could have written into it as well). Things like a "price" whose value might be an integer number of US pennies or a Money object with a value and a currency identifier (e.g., USD, JPY, etc.). Much of the code just assumed it was whatever it was the first time they inspected the context dict as it arrived at their call site. Someone else modifies a code path and suddenly the contents of the context dict change on you. If your automated tests don't include that new code path, you catch the issue in prod. So, automated tests had to include all possible run-time call paths to catch these bugs before deployment, and that's impractical.
To me, one of the most important advancements Python has ever made is frozen, kw_only dataclasses with thorough type hints. They bring a lot of clarity to the code that uses them, such code is easier to test, and there are fewer bugs discovered at run-time. Extensive use of them makes type inference easier, so hints can me skipped in many places. Any difficulty in creating them often means the data model is not sufficiently flushed out, and that's good to know. I rarely write non-dataclass classes in recent years. I do add read-only properties to dataclasses liberally.
All this fixes many of the challenges that come with Python's highly dynamic nature, but let us keep many of the benefits.
The classic is pulling in json or some other structured data and something not being the type you expect. The error happens way down the line, rather than at import, because why would you do a full validation every time you use JSON right?
I think typehinting is pretty useless in python. Its a nice idea and if your IDE is setup for it, can provide useful information that you're doing something wrong. But its requires lots of tooling and setup to provide useful signal, and is optional.
You’ve never had a bug caused by None showing up in code that didn’t expect it? Or getting an object of the wrong type that didn’t have the method you tried to call on it?
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.
I posted this yesterday pretty much on that: https://charemza.name/blog/posts/software/type-safety/type-s...
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.
It's not necessarily always "wrong", but you essentially have to think about "what's the right behaviour on None" a lot more, and while yes the type checker will help avoid runtime errors from random places, I think that can lead to essentially runtime bugs if you answer that question wrong. Or, at best you end up with quite messy data transformation and error handling, which itself can end up as a source of bugs.
One thing I try to ask myself is "what would this look like without `| None`", and take it from there. Also, it isn't `| None` as such, it can be any union type: code can end up with blurry responsibility.
This is what I tend to prefer. Not always possible, but worth striving for.
> One thing I try to ask myself is "what would this look like without `| None`", and take it from there. Also, it isn't `| None` as such, it can be any union type: code can end up with blurry responsibility.
Yeah, unions can be problematic, but at least they're more legible than None as this can basically break everything.
(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)
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.
English would make a horrid programming language, so being close to it is not a plus.
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.
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.
We now have definitive proof that this is incorrect: LLMs make using English - and any other natural language - very straight-forward to instruct machines. Similar to how the compilers and interpreters make the bastardized subset of natural language that we formalize into "programming languages" translatable into machine language. Ultimately the goal is identical: human-machine communication.
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?
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.
Not literally anything. Just go the full distance and have it directly output binary. No need for any intermediate code at all.
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...
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.
Like, maybe untyped Python is good enough for you with pylint or another linter that helps the code me more idiomatic. Or maybe you reach for ty because you want to have some type checking to avoid common coercion bugs.
And then there's this, for when ty simply wasn't enough and you've inherited some monster codebase where absolute rule over types is required. It's probably overkill for most codebases, but I can think of a few legacy codebases that would benefit from this...
To be honest, I never tried it personally, but I try to check up on its status every couple of months.
https://github.com/shedskin/shedskin
Isn't that just C with extra steps
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?