Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why is "written in Rust" a feature to be mentioned? Who cares? So my type checker has memory protection and is compiled. I'm not running my type checker on an embedded system or in a mission critical service. It seems kind of like "written in Erlang". I'd prefer to have non-performance critical code for Python written in Python. That way the broader community can support and extend it.


Have you used Rust before? As a user, the speed and safety is nice. But as a developer, Rust projects are easier to hack on and contribute to.

That's kind of the whole appeal of Astral. I know Python better than Rust, but it's a lot easier for me to hack on Rust projects. The whole appeal of Astral is that they want to bring Rust-quality tooling to Python.


> but it's a lot easier for me to hack on Rust projects

That static typing is nice, I wonder if it's going to catch on one day.

The amount of energy spent trying to bend dynamically types languages into being real ones is just comical. Even the standard library is barely typed, so they give no fucks https://github.com/python/cpython/blob/v3.13.3/Lib/re/__init...

What does it accept? Who knows. What does it return? Don't worry about it


Static typing is a big one, but I've been so steeped in Python that I don't appreciate it as much as maybe I should.

The big thing for me is that most Rust projects are statically(ish) compiled (like go) and only need a `cargo build`. No venvs or pip commands or node/npm/nvm or make, etc.


Also, the Zen of Python is supposed to be one obvious way to do something but ddg "python dependency manager" and have a good laugh. That actually becomes triple lol for when uv steps in and says "uh, your pip requirements.txt is unsatisifyable, what are you even?!"

And let me just say what an absolutely stellar job the rustc authors have done with the error messages. Just out of this world thoughtful. I have not yet gotten on board with their compile time vs safety and insight tradeoff, but I can see why they chose those two axes


It’s not a rule. It’s a guide to being idiomatic.

It’s like laughing at photographers for not using the “rule of thirds” sometimes.


"one obvious way to do something" describes almost none of Python. Easier said than done I guess, but I find Python particularly bad at it


Yeah, and static typing is not limited to Rust, and there are many other programming languages that do not have any of that venvs / pip nonsense.


What languages? I'm asking this earnestly, because there are dozens of languages I can name but I have not used. Every language I've used (except maybe Julia) asks you also to install and use something extra, like "meson" or "ninja" or "maven" or "cmake", for its build phase.


You want languages that can be compiled similarly to "cargo build"? Well, Go is one of them. Many C projects are just one "make" command away. OCaml has "dune build". Odin has "odin build", too. There are a lot of other languages I am missing here though.


Oh yeah, right about Go. Odin and OCaml are languages I don't use but have heard their names.

I'm not saying Rust has exclusivity here, I'm only explaining why I like to know a project was written in Rust.


Okay, fair enough. :)


regex.match takes strings and returns a match object. There are most likely stubs, if you are new to it and need support.


This response highlights both parts what I was saying: it's not just strings, and "I'm sure there's some extra things that the standard library wants you to duct tape together, good luck"


It is exactly two strings that are required. The docs are there for flags etc, use them. Types were not entered directly into stdlib source for historical reasons.

If you would enjoy further support, install stubs from typeshed.


> It is exactly two strings that are required

It is exactly as I said, it's not just strings

    $ python3.12 -c '
    import re
    pat = re.compile("who knew")
    ma = re.match(pat, "who knew types matter")
    print(ma)
    '
    <re.Match object; span=(0, 8), match='who knew'>
> The docs are there for flags etc, use them.

I guess it's good we're all using LLMs nowadays, since in general computers no read so good, that's why we write in specialized languages for their benefit. That would include this fancy new thing I've heard about where one writes down what the input and output domains are for functions

> Types were not entered directly into stdlib source for historical reasons.

Historical reasons defeats the purpose of having git tags, to say nothing of them having several concurrent branches named after the various release trains. I mean, historically print was a keyword, but you sure don't see them from __future__ import print_statement all over the 3.12 tree now do you? It's because they DGAF preferring there to be seemingly unlimited aftermarket tooling to try and drag python3000 into the 21st century

> If you would enjoy further support, install stubs from typeshed.

While trying to dig up whatever a sane person would use to "install stubs" -- because it for damn sure isn't $(pip install typeshed) -- I learned that you were even more incorrect - it accepts bytes, too https://github.com/python/typeshed/blob/9430260770b627c04313...

Anyway, they also go out of their way to say "don't install typeshed" and I guess that's why they don't have any git tags because releases are for children


Right, the first arg can also be a compiled pattern|bytes. Not an issue in the real world however. The problem is when it can't handle what you give it, not when it can handle what you give it and additional things.

Normally you'd use `pattern.match(string)` in that case.

They said specifically more than once that they're not going to change (almost) every line in the repo for any reason, and not only to types but other syntax improvements. Probably to keep git blame intact and avoid introducing new bugs.

Honestly, this reads as an obsession with theoretical concerns.


Hindly Milner type inference needs to catch on


Type inference is handy, but as an observation source code is 90% written for humans - I believe that CPython knows what types they are, that's how TypeError even exists, but seeing "def doit(erthang):" doesn't help me in the slightest. Often PyCharm can figure it out, because bless their hearts, but then developers whine about "wwwaaa, pycharm too slo grug use ed" and then one gets AttributeError in production because who could have foreseen


Pyright being so fast has gotten my coworkers (as well as myself) who dare to code using tooling not made by JetBrains an easy to use instant-feedback type checker that can be used in CI. So I think it's a huge win.


IntelliJ sadly has slow UI, including bizarrely high typing latency. That is unrelated to analysis it does, which is acceptable to be slow.


Real ones?


> Rust projects are easier to hack on and contribute to.

This was actually the subject of a study at the University of Waterloo:

> We find that despite concerns about ease of use, first-time contributors to Rust projects are about 70 times less likely to introduce vulnerabilities than first-time contributors to C++ projects.

https://cypherpunks.ca/~iang/pubs/gradingcurve-secdev23.pdf


> Rust projects are easier to hack on and contribute to.

You can say that about any languages that you yourself know, or other people know. There are beautiful codebases in many other languages, and awful ones in the same languages.

If your Rust codebase has a lot of unwraps and lifetime annotations (among other things), I will probably not find it a joy to contribute to it, at all.


> You can say that about any languages that you yourself know, or other people know.

No, I'm saying that Rust was easier to hack on and contribute to (on my own) when I had never written any Rust before. Rust (and almost Go) is the only language I can confidently say this about. It's not even in my top 5 strongest languages now, but I still stand by this.

E.g. Look at the build instructions for Gimp and all its prerequisites: https://developer.gimp.org/core/setup/build/

Very normal C++ project, ~500 words of instructions. Once I started thinking about using a chroot to fix dependency issues after I'd already built bebl and gegl, I gave up, because I ran out of free time. It didn't matter how much C++ I knew.

Rust projects, comparatively, almost never demand that. It's almost always just `cargo build`, with some rare exceptions (e.g. The one exception I know of for which this is not true for is Graphite, which is a web app and also uses npm. )


I do not know about Rust (because of all these lifetime and borrow checking stuff), but Go is definitely one of the languages one can easily contribute to without knowing much about the language, especially if you use VSCode with its Go extension.

I do not like C++ projects, they are behemoths, slow to compile, and C++ continues getting so much bullshit bolted on top of the language. It is extremely complicated, at least for me.

Most of my projects - regardless of language - has extremely simple build instructions, no matter how large it is.

As for GIMP, "meson" and "ninja" is not too bad, I have come across projects with much worse build instructions, but I agree, it is leaning towards "complicated".

> Once I started thinking about using a chroot to fix dependency issues after I'd already built bebl and gegl

Been there, done that. I remember compiling GCC myself, it was not as straightforward as, say, LLVM + clang. I think the issue is not with the language itself, however, but the developers who do not simplify the build process.


Rust has very arcane syntax and a lot of rules that developers coming from interpreted / garbage-collected languages (like the ones using these tools) would have a hard time grasping. It’s easy for people who are already familiar with it, but isn’t that always the case?


I'm saying the opposite, actually. I found it easier to contribute to Rust projects (with zero hours Rust experience, and much Python/Java/C/C++/Ada) because Rust projects are significantly easier to build. (Just a `cargo build` in the default case.)


It makes no sense to me. You found it easier to contribute to Rust projects because... Rust projects are significantly easier to build? What? You can just do "dune build" in OCaml, or run "make" for many C projects. Plus, it is also significantly slower to build Rust projects, you should have probably added that.


> run "make" for many C projects.

This generally fails miserably, in my experience. It's normally a dance of error: libfoo missing, followed by install (which is generally only straightforward on linux), followed by libbar is missing etc.

Don't get me wrong, I have built lots of non-trivial C projects, but it's not straighforward at all (maybe if you always work in C it's easier).


I don't like autotools, but I suppose that would be a good fit here, and perhaps proper pre-build instructions (e.g. "pacman -S libfoo").


Totally, autotools helps. However, it's generally dependency issues that cause the problems, you're missing some header files etc. Finding out about these at configure time is better, but there's still a bunch of toil in identifying and getting those dependencies.


Yes, I meant the words I said. I haven't used OCaml, and some C projects are "just make" but that's not the rule like it is with Rust projects.

The time I spend doing things is much more valuable than the time my computer spends doing things.

I can only speak for why I like to know a project is written in Rust. I didn't add the build time because I didn't care.


An LSP is performance-critical code. It directly affects responsiveness of your IDE, or even the viable scope of a project that the LSP can handle.

Rust is both CPU- and memory-efficient, quite unlike Python. (It could have been OCaml / Reason, or Haskell, they are both reasonably fast and efficient, and very convenient to write stuff like typecheckers in. But the circle of possible contributors would be much narrower.)


The circle of possible contributors doesn't really matter. It's a Meta project, they have others written in OCaml and to this day they manage to have contributors eg https://github.com/facebook/flow because they hire and pay them.


To be fair, pyright's performance as an LSP is tolerable. The main issue to me is running the type checker as a pre-commit hook or as part of CI. Mypy is awful, though.


> I'd prefer to have non-performance critical code for Python written in Python

A type checker is performance critical code. You can watch how Pylint, just a linter, written in Python, lints your source code line by line. It's so slow it can take 30 seconds to update the linting after you change some lines.


Or entire projects abandoning checking because mypy is so damned slow for anything non-trivial


Many of these make the mistake of running against an entire codebase instead of checking vcs first and only running against changed files.


You still need to type-check files that weren't changed if they were affected by a file that was.


It makes it easy to find performant and quality software by searching for "[insert tool description] rust", I personally don't mind! Seeing how 95% of the tools I use on the daily are written in Rust, I love finding new ones and am rarely disappointed.


Shortcut for "noticeably fast."

Open source Rust is still review able.


>Why is "written in Rust" a feature to be mentioned? Who cares?

A lot of people. Correct or not, I think "written in rust" have become synonymous with "very much faster than the alrernatives" in the pyrhon community.


I feel like 70% of open source projects on GitHub say written in the language that they were written in


I feel like the likelihood that a project will say what language it is written in is much higher if that language is Rust. I like Rust but I do find this trend a little annoying. (Even though I acknowledge that "written in Rust" probably means the tool is relatively new, not buggy, and easy to use.)


> Even though I acknowledge that "written in Rust" probably means the tool is relatively new, not buggy, and easy to use.

I genuinely chose the language for one of my projects based on this reasoning. I want to be in the nice UX gang.


> Why is "written in Rust" a feature to be mentioned? Who cares?

If one is a "purist", the idea of non-python tool involvement may dissatisfy.

Scare-quoting "purist", given the general lack thereof anywhere in Open Source, python itself being a case in point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: