• 0 Posts
  • 11 Comments
Joined 5 months ago
cake
Cake day: September 26th, 2024

help-circle

    1. Is a modern language with a good build system (It’s like night and day compared to CMake)

    Meson exists … as do others.

    But they are not the default option. And your new job may not use them.

    1. And I just like how the language works (errors as values etc.)

    Fair enough; though why? What’s wrong with exceptions?

    Exceptions is a non standard exit point. And by “non standard” I’m not talking about the language but about its surprise appearance not specified in the prototype. Calling double foo(); you don’t know if you should try/catch it, against which exceptions, is it an internal function that may throw 10 level deep ?

    By contrast fn foo() -> Result<f64, Error> in rRst tell you the function may fail. You can inspect the error type if you want to handle it. But the true power of Result in Rust (and Option) is that you have a lot of ergonomic ways to handle the bad case and you are forced to plan for it so you cannot use a bad value thinking it’s good:

    • foo().unwrap() panic in case of error (see also expect)
    • foo().unwrap_or_default() to ignore the error and continue the happy path with 0.0
    • foo().unwrap_or(13.37) to use your default
    • foo()? to return with the error and let the parent handle it, maybe








  • Just use this one… or any of this 4 others.

    This is the issue for us, python outsiders. Each time we try we get a different answer with new tools. We are outside of the comtunity, we don’t know the trend, old and new, pro and cons.

    Your first recommandation is hatch… first time I’ve heard of it. Uv seems trendy in this thread, but before that it was unknown to me too.

    As I understands it, it should be pip’s job. When it detect I’m in a project it install packages in it and python use them. It can use any tool under the hood, but the default package manager shoud be able to do it on its own.