Really wish Apple would give users more choices here without requiring third party hacks.
745 karma · joined November 1, 2021
Really wish Apple would give users more choices here without requiring third party hacks.
Any python library that cares about performance is written in C/C++/Rust/Fortran and only provides a python interface.
ML will have 0 benefit from this.
"It’s also important to note that if you’re using a non-commercial license, you cannot opt out of the collection of anonymous usage statistics. This is similar to our Early Access Program (where statistics is opt-out) and in compliance with our Privacy Policy"
Considering the state Fleet is in you are much better off with VSCode for Rust + web dev support.
https://doc.rust-lang.org/nightly/std/primitive.array.html#m...
You don't know you need it but once you have it it's hard to go back.
Running pyright in CI/CD and in vscode has considerably improved the quality of my code, especially when refactoring.
This should have been a MacBook Air.
Edit: Oh, and one less thunderbolt port, nice.
> I questioned my sanity every time I circled back around to the Clippy issue above. Surely, I was wrong. There must be a configuration I missed. I couldn’t believe it. I still can’t. Surely there must be a way to configure lints globally. I quadruple-checked when I wrote this to make sure I wasn’t delusional.
You create a .cargo/config.toml in the workspace root so it covers all your crates.
inside the file:
[build]
rustflags = ["-Wclippy::lint_name_to_warn", "-Dclippy::lint_name_to_deny"]
The only limitation is that rustflags are not additive, so if you have other sources of rustflags like the RUSTFLAGS environment variable it will overwrite this setting.So far the only thing that bothers me about pyright is that it can't infer the type of collections based on later insertions.
So in something like:
lst = []
lst.append(1)
lst is of type list[Any]I also program in Rust so I kinda expect this to work :P
I asked the maintainer about this and this is apparently by design, though mypy handles this correctly IIRC.
I have gotten really annoying deadlocks because of this in the past.
There is no GIL in C/C++/Rust/Zig/Whatever, just use threads.
There is a strong desire to stop that and have Box be a normal std type, the main thing that is blocking this at the moment is that Box has special deref magic that is not possible to implement with surface level rust syntax (even with nightly features).
Even in a single threaded runtime spawn requires Send and you need to use LocalSet + spawn_local for !Send futures.
1. ADTs with exhaustive pattern matching
2. No exceptions
3. Zero cost generics
4. Traits
5. No nulls
6. No inheritance
comptime doesn't allow you to create domain specific macros like html! in Rust, it also doesn't allow you to constrain what types are accepted by your functions. It also has its own problems with long compile times.
No your not, you spawn a runtime on each thread and use spawn_local on each runtime. This is how actix-web works and it uses tokio under the hood.
let x = || async {
let file = std::fs::read_to_string("foo.txt")?;
Ok::<_, Box<dyn std::error::Error>>(file)
};In any case, the second example is definitely not a stub.
No it isn't. The accepted stub syntax is an ellipses (...).
A competent type checker like pyright will error on this code.
Function with declared return type "int" must return value on all code paths
Type "None" cannot be assigned to type "int"
And if you need more proof that pycharm is useless as a type checker: def foo(b) -> int:
if b:
return 1
A classic error where you forget to return a value from all paths and pycharm is silent. Expression of type "None" cannot be assigned to declared type "int"
Type "None" cannot be assigned to type "int" def foo() -> int:
pass
I sure hope they improved the type checker in later versions...I recently switched from Pycharm to vscode which uses pyright and it's night and day on the amount of type errors it catches, it considerably improved the quality of my code and confidence during refactoring.
And to add insult to injury Pycharm doesn't even have a pyright plugin and the mypy plugin is extremely slow and buggy.
First of all it's not 50 crates, it's 3 main crates syn, quote and proc-macro2 and a few smaller helper crates which are used less often.
And the reason to not include them in the compiler is exactly the same reason why "crate X" is not included in std. Stuff in std must be maintained forever without breaking changes. Just recently syn was bumped to version 2 with breaking changes which would have not been possible if it was part of the compiler.
In any case, shipping precompiled proc macros WASM binaries will solve this problem.
> Serde has to enumerate the universe even for types that wind up not used. Those types then need to be discarded--which is problematic if it takes a non-trivial amount of time to enumerate or construct them (say: by using proc macros). Part of this is the specification that must be done because Rust can't do compile-time reflection/introspection...
Yes, it's a design tradeoff, in return Rust has no post-monomorphization errors outside of compile time function evaluation. I think it's worth it.
> I'm beginning to think that the folks who claimed that compiler speed is the single most important design criterion were right.
I don't agree. As long as the compile times are reasonable (and I consider Rust compile times to be more than reasonable) other aspects of the language are more important. Compile time is a tradeoff and should be balanced against other features carefully, it's not the end goal of a language.
What does the orphan rule have to do with the compilation speed of serde? How does it reduce the work it needs to do?
For all intents and purposes Rust is dropping support for anything below Windows 10.
It is suggested in the MCP that a new target can be created for older versions of Windows if members of the community will step up to support it.