Comment by zenkey

Comment by zenkey 2 months ago

88 replies

I've been programming with Python for over 10 years now, and I use type hints whenever I can because of how many bugs they help catch. At this point, I'm beginning to form a rather radical view. As LLMs get smarter and vibe coding (or even more abstract ways of producing software) becomes normalized, we'll be less and less concerned about compatibility with existing codebases because new code will be cheaper, faster to produce, and more disposable. If progress continues at this pace, generating tests with near 100% coverage and fully rewriting libraries against those tests could be feasible within the next decade. Given that, I don't think backward compatibility should be the priority when it comes to language design and improvements. I'm personally ready to embrace a "Python 4" with a strict ownership model like Rust's (hopefully more flexible), fully typed, with the old baggage dropped and all the new bells and whistles. Static typing should also help LLMs produce more correct code and make iteration and refactoring easier.

_ZeD_ 2 months ago

You think of code as an asset, but you're wrong: code is a cost.

Feature is what you want, and performance, and correctness, and robustness; not code

Older code is tested code, that is known to work, with known limitations and known performances

  • shiandow 2 months ago

    A corollary is that if at all possible try to solve problems without code or, failing that, with less code.

    • Beltiras 2 months ago

      Given that you want to solve problems with a computer, what is the alternative to code?

      • brookst 2 months ago

        Why do you want to use a computer? When I hang pictures I have never once thought “I want to use a hammer”

      • shiandow 2 months ago

        That is almost never truly a given. And even if it is, how you use the computer can be more important than the code.

        And if you already have some code, simplifying it is also an option.

      • codr7 2 months ago

        Restating the context as one where the problem doesn't exist.

        Any fool can write code.

      • ModernMech 2 months ago

        If there isn't one, then as little code as possible.

  • abirch 2 months ago

    I agree, older code is evidence of survivorship bias. We don't see all of the code that was written with the older code that was removed or replaced (without a code repository).

anon-3988 2 months ago

> I'm personally ready to embrace a "Python 4" with a strict ownership model like Rust's (hopefully more flexible), fully typed, with the old baggage dropped and all the new bells and whistles. Static typing should also help LLMs produce more correct code and make iteration and refactoring easier.

So...a new language? I get it except for borrow checking, just make it GC'ed.

But this doesn't work in practice, if you break compatibility, you are also breaking compatibility with the training data of decades and decades of python code.

Interestingly, I think as we use more and more LLMs, types gets even more and more important as its basically a hint to the program as well.

pjmlp 2 months ago

I think people are still fooling themselves about the relevance of 3GL languages in an AI dominated future.

It is similar to how Assembly developers thought about their relevance until optimising compilers backends turned that into a niche activity.

It is a matter of time, maybe a decade who knows, until we can produce executables directly from AI systems.

Most likely we will still need some kind of formalisation tools to tame natural language uncertainties, however most certainly they won't be Python/Rust like.

We are moving into another abstraction layer, closer to the 4GL, CASE tooling dreams.

  • mpweiher 2 months ago

    "Since FORTRAN should virtually eliminate coding and debugging…" -- FORTRAN report, 1954 [1]

    If, as you seem to imply and as others have stated, we should no longer even look at the "generated" code, then the LLM prompts are the programs / programming language.

    I can't think of a worse programming language, and I am not the only one [2]

    However, it does indicate that our current programming languages are way to low-level, too verbose. Maybe we should fix that?

    [1] http://www.softwarepreservation.org/projects/FORTRAN/BackusE...

    [2] https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667...

    [3] https://objective.st/

  • albertzeyer 2 months ago

    4GL and 5GL are already taken. So this is the 6GL.

    https://en.wikipedia.org/wiki/Programming_language_generatio...

    But speaking more seriously, how to get this deterministic?

    • pjmlp 2 months ago

      Fair enough, should have taken a look, I stopped counting when computer magazines buzz about 4GLs faded away.

      Probably some kind of formal methods inspired approach, declarative maybe, and less imperative coding.

      We should take an Alan Kay and Bret Victor like point of view where AI based programming is going to be in a decade from now, not where it is today.

      • codr7 2 months ago

        That future is far from inevitable, the first question we SHOULD ask is if it's a good idea to go down this path.

  • dragonwriter 2 months ago

    > I think people are still fooling themselves about the relevance of 3GL languages in an AI dominated future.

    I think, as happens in the AI summer before each AI winter, people are fooling themselves about both the shape and proximity of the “AI dominated future”.

    • brookst 2 months ago

      It will be approximately the same shape and proximity as “the Internet-dominated future” was in 2005.

  • Wowfunhappy 2 months ago

    Assemblers and compilers are (practically) deterministic. LLMs are not.

    • chowells 2 months ago

      That's the wrong distinction, and bringing it up causes pointless arguments like are in the replies.

      The right distinction is that assemblers and compilers have semantics and an idea of correctness. If your input doesn't lead to a correct program, you can find the problem. You can examine the input and determine whether it is correct. If the input is wrong, it's theoretically possible to find the problem and fix it without ever running the assembler/compiler.

      Can you examine a prompt for an LLM and determine whether it's right or wrong without running it through the model? The idea is ludicrous. Prompts cannot be source code. LLMs are fundamentally different from programs that convert source code into machine code.

      This is something like "deterministic" in the colloquial sense, but not at all in the technical sense. And that's where these arguments come from. I think it's better to sidestep them and focus on the important part: compilers and assemblers are intended to be predictable in terms of semantics of code. And when they aren't, it's a compiler bug that needs to be fixed, not an input that you should try rephrasing. LLMs are not intended to be predictable at all.

      So focus on predictability, not determinism. It might forestall some of these arguments that get lost in the weeds and miss the point entirely.

    • traverseda 2 months ago

      LLMs are deterministic. So far every vendor is giving them random noise in addition to your prompt though. They don't like have a free will or a soul or anything, you feed them exactly the same tokens exactly the same tokens will come out.

      • mmoskal 2 months ago

        If you change one letter in the prompt, however insignificant you may think it is, it will change the results in unpredictable ways, even with temperature 0 etc. The same is not true of renaming a variable in a programming language, most refactorings etc.

      • jnwatson 2 months ago

        Only if you set temperature to 0 or have some way to set the random seed.

        • vlovich123 2 months ago

          Locally that’s possible but for multi tenant ones I think there’s other challenges related to batch processing (not in terms of the random seed necessarily but because of other non determinism sources).

      • codr7 2 months ago

        That's not how they are being used though, is it?

    • pjmlp 2 months ago

      Missed the part?

      > Most likely we will still need some kind of formalisation tools to tame natural language uncertainties, however most certainly they won't be Python/Rust like

      • Wowfunhappy 2 months ago

        No, I didn't miss it. I think the fact that LLMs are non deterministic means we'll need a lot more than "some kind of formalization tools", we'll need real programming languages for some applications!

  • sitkack 2 months ago

    > It is a matter of time, maybe a decade who knows, until we can produce executables directly from AI systems.

    They already can.

    • codr7 2 months ago

      If you're lucky.

      If you're even luckier it will perform the desired function fast enough.

      Why not spend the money on lottery tickets instead?

  • zenkey 2 months ago

    Yes I agree this is likely the direction we're heading. I suppose the "Python 4" I mentioned would just be an intermediate step along the way.

    • sanderjd 2 months ago

      I think the question is: What is the value of that intermediate step? It depends on how long the full path takes.

      If we're one year away from realizing a brave new world where everyone is going straight from natural language to machine code or something similar, then any work to make a "python 4" - or any other new programming languages / versions / features - is rearranging deck chairs on the Titanic. But if that's 50 years away, then it's the opposite.

      It's hard to know what to work on without being able to predict the future :)

  • krembo 2 months ago

    Wild thought: maybe coding is a thing of the past? Given that an llm can get fast&deterministic results if needed, maybe a backend for instance, can be a set of functions which are all textual specifications and by following them it can do actions (validations, calculations, etc), approach apis and connect to databases, then produce output? Then the llm can auto refine the specifications to avoid bugs and roll the changes in real time for the next calls? Like a brain which doesn't need predefined coding instructions to fulfill a task, but just understand its scope, how to approach it and learn from the past.

    • TechDebtDevin 2 months ago

      I really want to meet these people that are letting an LLM touch their db.

      • krembo 2 months ago

        Fast forward to the near future, why wouldn't it with the correct restrictions? For instance, would you let it today run SELECT queries? as Hemingway once said "if it's about price we know who you are".

kryptiskt 2 months ago

I'd think LLMs would be more dependent on compatibility than humans, since they need training data in bulk. Humans can adapt with a book and a list of language changes, and a lot of grumbling about newfangled things. But an LLM isn't going to produce Python++ code without having been trained on a corpus of such code.

  • johnisgood 2 months ago

    It should work if you feed the data yourself, or at the very least the documentation. I do this with niche languages and it seems to work more or less, but you will have to pay attention to your context length, and of course if you start a new chat, you are back to square one.

  • energy123 2 months ago

    I don't know if that's a big blocker now we have abundant synthetic data from a RL training loop where language-specific things like syntax can be learned without any human examples. Human code may still be relevant for learning best practices, but even then it's not clear that can't happen via transfer learning from other languages, or it might even emerge naturally if the synthetic problems and rewards are designed well enough. It's still very early days (7-8 months since o1 preview) so to draw conclusions from current difficulties over a 2-year time frame would be questionable.

    Consider a language designed only FOR an LLM, and a corresponding LLM designed only FOR that language. You'd imagine there'd be dedicated single tokens for common things like "class" or "def" or "import", which allows more efficient representation. There's a lot to think about ...

    • jurgenaut23 2 months ago

      It’s just as questionable to declare victory because we had a few early wins and that time will fix everything.

      Lots of people had predicted that we wouldn’t have a single human-driven vehicle by now. But many issues happened to be a lot more difficult to solve than previously thought!

    • LtWorf 2 months ago

      How would you debug a programming language made for LLMs? And why not make an LLM that can output gcc intermediate representation directly then?

      • energy123 2 months ago

        You wouldn't, this would be a bet that humans won't be in the loop at all. If something needs debugging the LLM would do the debugging.

zzzeek 2 months ago

> As vibe coding becomes normalized

Just want you to know this heart monitor we gave you was engineered with vibe coding, that's why your insurance was able to cover it. Nobody really knows how the software works (because...vibes), but the AI of course surpasses humans on all current (human-created) benchmarks like SAT and bar exam tests, so there's no reason to think its software isn't superior to human-coded (crusty old non "vibe coded" software) as well. You should be able to resume activity immediately! good luck

  • lioeters 2 months ago

    Welcome to the flight, this is your captain speaking. Just want to let you know our entire flight system was vibe coded to the strict standards you expect from our industry, iterated and refined in a virtual environment over twenty virtual-years, with no fallible human eyes reviewing it - even if it were possible to review the mountain of impenetrable machine-generated code. The pilot will be controlling the plane via a cutting-edge LLM interface, prompt-engineering our way to our overseas destination. Relax, get comfortable, and pray to the collective intelligence distilled from Reddit posts.

  • brookst 2 months ago

    What percent of applications require that level of reliability?

    Vibe coding will be normalized because the vast, vast majority of code is not life or death. That literally what “normal” means.

    Exceptional cases like pacemakers and spaceflight will continue to be produced with rigor. Maybe even 1% of produced code will work that way!

    • codr7 2 months ago

      Do we really want to go further down this path?

      Things that used to work just fine are already breaking badly because of AI.

    • poulpy123 2 months ago

      Not so many, but all programs need to be designed and developed with reason, not statistics

    • zzzeek 2 months ago

      this is black and white thinking. if the practice of "let the AI write the code and assume it's fine because I'm only an incurious amateur anyway" becomes normalized, the tendency of AI to produce inaccurate slop will become more and more part of software we use every day and definitely will begin impacting functions that are more and more critical over time.

      • brookst 2 months ago

        Different tools for different jobs is not black and white thinking.

        I remember when people said the same thing about Basic; how dare anyone create such an abomination, whole generations of programmers will be useless because they learned this oversimplified, terrible language instead of proper assembly.

        We were fine.

adsharma 2 months ago

You described the thinking behind py2many.

Code in the spirit of rust with python syntax and great devx. Give up on C-API and backward compat with everything.

Re: lifetimes

Py2many has a mojo backend now. You can infer lifetimes for simple cases. See the bubble sort example.

fulafel 2 months ago

> embrace a "Python 4" with a strict ownership model like Rust

Rust only does this because it targets low-level use cases without automatic memory management, and makes a conscious tradeoff against ease of programming.

mountainriver 2 months ago

At the point which you describe we could easily write Rust or even just C

mdaniel 2 months ago

> Static typing should also help LLMs produce more correct code and make iteration and refactoring easier.

You say that as if they "understand" and, as actual usage has shown us, if they're perfectly comfortable making up whole function names I'm super confident a little nuance of "what type is this?" is not going to stand in their way of just placating the requestor

pseudony 2 months ago

Ownership models like Rust require a grester ability for holistic refactoring, otherwise a change in one place causes a lifetime issue elsewhere. This is actually exactly what LLM's are doing the worst at.

Beyond that, a Python with something like lifetimes implies doing away with garbage-collection - there really isn't any need for lifetimes otherwise.

What you are suggesting has nothing to do with Python and completely misses the point of why python became so widely used.

The more general point is that garbage collection is very appealing from a usability standpoint and it removes a whole class of errors. People who don't see that value should look again at the rise of Java vs c/c++. Businesses largely aren't paying for "beautiful", exacting memory management, but for programs which work and hopefully can handle more business concerns with the same development budget.

  • pjmlp 2 months ago

    While I go into another direction in a sibling comment, lifetimes does not imply not needing garbage collection.

    On the contrary, having both allows the productivity of automatic resource management, while providing the necessary tooling to squeeze the ultimate performance when needed.

    No need to worry about data structures not friendly to affine/linear types, Pin and Phantom types and so forth.

    It is no accident that while Rust has been successful bringing modern lifetime type systems into mainstream, almost everyone else is researching how to combine linear/affine/effects/dependent types with classical automatic resource management approaches.

  • vlovich123 2 months ago

    Rust lifetimes are generally fairly local and don’t impact refactoring too much unless you fundamentally change the ownership structure.

    Also a reminder that Rc, Arc, and Box are garbage collection. Indeed rust is a garbage collected language unless you drop to unsafe. It’s best to clarify with tracing GC which is what I think you meant.

oivey 2 months ago

I mean, why not just write Rust at that point? Required static typing is fundamentally at odds with the design intent of the language.

  • trealira 2 months ago

    A lot of people want a garbage collected Rust without all the complexity caused by borrow checking rules. I guess it's because Rust is genuinely a great language even if you ignore that part of it.

    • logicchains 2 months ago

      Isn't garbage collected Rust without a borrow checker just OCaml?

      • johnisgood 2 months ago

        Pretty much, I would say, in fact, I like OCaml better if we put the borrow checker aside.

    • Elucalidavah 2 months ago

      > a garbage collected Rust

      By the way, wouldn't it be possible to have a garbage-collecting container in Rust? Where all the various objects are owned by the container, and available for as long as they are reachable from a borrowed object.

    • spookie 2 months ago

      D and Go exist.

      There are alternatives out there

  • tgv 2 months ago

    Not only that: Rust is considerably faster and more reliable. Since you're not writing the code yourself, Rust would be an objectively better choice.

    Who are we trying to fool?

poulpy123 2 months ago

Why would you want a fully typed, with ownership model python ? Especially if you consider that backward compatibility is useless ?

throwaway48476 2 months ago

I would like an optionally garbage collected version of rust for less performance critical parts.

qaq 2 months ago

You pretty much described Mojo