Gemini conversations

78 views
Skip to first unread message

Edward K. Ream

unread,
Jul 3, 2025, 9:33:16 AMJul 3
to leo-editor
I continue to be impressed with Google's Gemini AI. I'll let you judge for yourself based on several of my recent chats. None of these chats were "pre-conditioned" in any way except for my first comment.

Here is my first rust-related chat: Rust study

My question " I have done the preliminary steps. I would like to know how traits influence the borrow checker." elicited a superb response.

Aside: I know from my study of the Rust compiler docs that borrow checking happens much later than I previously thought. So I knew that the following statement was correct:

"When you use generics with trait bounds, the borrow checker still operates on concrete types after the compiler has performed monomorphization."

I then created a new chat to keep the original chat short: Smart Pointers. This chat lead me to the Smart Pointers Chapter in The Book.

A cff of my study file of Rust's compiler showed hundreds of instances of the COW and Into traits, both part of the std:borrow lib, something that I did not know existed previously. I then created this COW chat.

Wrapping up my study?

After sleeping on these chats, my conclusion (for now) is that I'm not very interested in learning more about Rust :-) Why? Because smart pointers sidestep otherwise intractable problems keeping the borrow checker happy. Clearly, smart pointers do not impose an significant performance penalty, though I still don't know enough to saw why!

Finally, this morning I thought to ask Gemini about Ruff's expected performance. I found the response reasonable and exciting.

Summary

Gemini is a genius level tutor for someone who can ask the right questions. Note the links in the chats. They help verify the information.

Edward

Thomas Passin

unread,
Jul 3, 2025, 10:12:38 AMJul 3
to leo-editor
That's very interesting and I tried your exact queries with ChatGPT (free version). One difference: I usually prefix my sessions with this bit of boilerplate, which I got by asking the chatbot what prompt would reduce its sycophant, hallucination, and redundancy tendencies:

Answer this as a skeptical expert would, minimizing speculation and avoiding any attempt to affirm or reassure me. If the answer requires assumptions, state them explicitly. If you don’t know or can’t verify something, say so clearly. I want a strictly factual and critical analysis, not an optimistic or polished summary.

 Here's the part of the transcript I got using Edward's prompts. I only include one part, near the end.  ChatGTP's response is not unlike Gemini's.

3. Hypothetical Estimate: Ruff with Full Type Inference

If Ruff were to implement a full type inference engine—comparable in depth to astroid—performance would necessarily degrade, though not necessarily to Pylint's level. Several outcomes are plausible:

  • Even a highly optimized Rust implementation of a full astroid-like system would likely be:

    • 10x–30x faster than Pylint, at best,

    • 2x–10x faster in more complex multi-module cases with rich type hints,

    • But still far slower than current Ruff without inference.

The key factors that would erode Ruff’s speed edge:

  • Recursive import resolution and cross-module tracking,

  • Deep attribute and method resolution (e.g., obj.attr.foo() chain analysis),

  • Context-aware inference (e.g., type narrowing in conditionals),

  • Possible fallback to interpreting stub files (.pyi) or runtime inspection.

Unless the Ruff team adopts very conservative, localized inference strategies, any addition of deep inference would be a major architectural shift.

I think this response is better focused and less wordy but that's probably because of my boilerplate prompt. Otherwise they are both pretty decent.

Edward K. Ream

unread,
Jul 3, 2025, 11:56:06 AMJul 3
to leo-e...@googlegroups.com
On Thu, Jul 3, 2025 at 9:12 AM Thomas Passin <tbp1...@gmail.com> wrote:

That's very interesting and I tried your exact queries with ChatGPT (free version). One difference: I usually prefix my sessions with this bit of boilerplate, which I got by asking the chatbot what prompt would reduce its sycophant, hallucination, and redundancy tendencies:

Answer this as a skeptical expert would, minimizing speculation and avoiding any attempt to affirm or reassure me. If the answer requires assumptions, state them explicitly. If you don’t know or can’t verify something, say so clearly. I want a strictly factual and critical analysis, not an optimistic or polished summary.

Excellent.

Here's the part of the transcript I got using Edward's prompts.

Thanks. We'll have to see how fast ruff can get with full type inference. The only benchmark I care about is Leo's codebase :-)

Edward

Ville M. Vainio

unread,
Jul 3, 2025, 12:45:41 PMJul 3
to leo-e...@googlegroups.com
I'm not sure types are that relevant to Ruff, Astral is building Ty as their type checker: https://github.com/astral-sh/ty

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3sE26TnhC9uvT1AQ9tLGwXeg2FsbtP-gsMSx5d%2BKkRew%40mail.gmail.com.

Edward K. Ream

unread,
Jul 3, 2025, 6:43:45 PMJul 3
to leo-e...@googlegroups.com
On Thu, Jul 3, 2025 at 11:45 AM Ville M. Vainio <viva...@gmail.com> wrote:
I'm not sure types are that relevant to Ruff, Astral is building Ty as their type checker: https://github.com/astral-sh/ty

Thanks for this. Maybe Ruff will use Ty. In any case, type checking is Pylint's most important feature.

Edward

Edward K. Ream

unread,
Jul 4, 2025, 6:04:22 AMJul 4
to leo-editor
On Thursday, July 3, 2025 at 5:43:45 PM UTC-5 Edward K. Ream wrote:
On Thu, Jul 3, 2025 at 11:45 AM Ville M. Vainio <viva...@gmail.com> wrote:
I'm not sure types are that relevant to Ruff, Astral is building Ty as their type checker: https://github.com/astral-sh/ty

Ruff issue #970 tracks compliance with pylint. This issue explicitly mentions type inference and multi-file analysis.

Ah. At last I see the source of our confusion. Ruff's type inference engine used to be known as red knot. It has been renamed to Ty.

There are 298 open Ty issues, so it remains to be seen when Ty will become operational and how fast it will be.

Googling "red ruff type inference" yielded this AI (presumably Gemini) summary:

QQQ
Red Ruff, now known as Ty, is a new type checker being developed by the Astral team, the creators of Ruff, and is designed to be a distinct alternative to tools like Mypy and Pyright. It focuses on strong type inference, even in unannotated code, and aims to minimize false positives. This means it tries to infer types automatically and avoids reporting errors on code that works correctly but lacks explicit type hints. [1, 2, 3]

Here's a more detailed breakdown:
  • Emphasis on Type Inference: Red Ruff prioritizes inferring types from code, even without explicit annotations. This is in contrast to some other type checkers that might require more annotations to function correctly. [1, 1, 3, 3]
  • Minimizing False Positives: The developers of Red Ruff aim to avoid reporting errors on code that is already correct. This makes it easier for developers to gradually adopt type checking without being overwhelmed by errors in existing code. [1, 1, 3, 3, 4, 5]
  • Not a Drop-in Replacement: While Red Ruff is designed to be a powerful type checker, it's not intended to be a complete replacement for existing tools like Mypy or Pyright. It will have its own set of features and design choices, offering a different approach to type checking. [3, 3]
  • Part of a Broader Toolchain: Red Ruff (now Ty) is part of a larger developer tool suite being built by Astral, which includes the Ruff linter and formatter. This suite aims to provide a comprehensive set of tools for Python development. [2, 2]
  • Active Development: Red Ruff is still under active development, and it's not yet officially released, according to a blog post about the tool. You can try it out from the source code, but expect ongoing changes and improvements. [1, 1, 6]
AI responses may include mistakes.

QQQ

I copied the text using the copy button. Many reference numbers are strangely repeated, as you can see.

HTH.

Edward

Ville M. Vainio

unread,
Jul 4, 2025, 4:06:36 PMJul 4
to leo-e...@googlegroups.com
Astral team has a very good track record, so there's no doubt that Ty will be the type checker people will be using, just like everyone standardized on Ruff. The deal with type checkers is that they can be useful even if they don't catch everything, as you can disable the checks that are not ready.

Facebook/Meta has a competing type checker coming up, also written in rust: https://pyrefly.org/ - but the deal with Meta stuff often is that they are optimized to deal with Meta problems and Meta code bases, ignoring the wider community.

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.

Edward K. Ream

unread,
Jul 5, 2025, 9:03:28 AMJul 5
to leo-editor
On Friday, July 4, 2025 at 3:06:36 PM UTC-5 Ville M. Vainio wrote:
Astral team has a very good track record, so there's no doubt that Ty will be the type checker people will be using, just like everyone standardized on Ruff. The deal with type checkers is that they can be useful even if they don't catch everything, as you can disable the checks that are not ready.

Thanks for these comments. I too expect great things from ruff and Ty.

Edward
Reply all
Reply to author
Forward
0 new messages