5 ms·
No, but not all parts of std run on all supported platforms. To clarify, there are different levels of support on different platforms.
by Ygg2 7y ago
No, but not all parts of std run on all supported platforms.
To clarify, there are different levels of support on different platforms.
- pjmlp 7y agoThen it already starts with a failure of quality gate of what goes into std.
- nicoburns 7y agoNot really. Rust supports 8 bit microcontrollers. Lot's of libraries, including parts of the standard library make no sense on these kind of platforms. The standard library and 3rd party crates generally have excellent compatibility across mainstream platforms.
- pjmlp 7y agoSo do Basic, Ada, Pascal, C and C++ as well, and yet they have richer standard libraries, with deployment profiles.
- deleted 7y ago[deleted]
- floatboth 7y agoSince when does libc include "rich" things like regex, serialization and http?? Even C++ standard lib is mostly containers and algorithms. libc is barely a standard library, it's almost nothing.
- pjmlp 7y agoC might not include those specific examples, but POSIX + libc already include plenty of stuff. C++ surely does include regex, with serialisation and http scheduled for C++23, or with luck with a TR as intermediate delivery. Although serialisation depends on static reflection being finalized as well.
- Ygg2 7y agoStill, it implies C fails, because you don't get POSIX on all available platforms. I think the definition is meaningless. Rust spends huge amount of resources to test itself and its surrounding ecosystem on tier 1 platforms. I'm fairly certain regex from c++ std will run like crap, if at all on something with 4MB of RAM.
- pjmlp 7y agoExcept the small detail that C's POSIX support is much wider than Rust's tier 1 platforms. I am fairly certain that without profiling and defining a test configuration for a set of specific C++ compilers / standard C++ library I won't assert anything about std::regex performance with 4 MB of RAM.
- Ygg2 7y agoPerhaps. But you're comparing a 26 year old standard for a 47 year old language, to a language that's been stable for 4 years.
- howdydoo 7y ago>deployment profiles In other words, not all functions in the stdlib of Ada, Pascal, C and C++ can be used in all possible target environments? Sounds like a failure to quality gate those standard libraries.
- pjmlp 7y agoNice jab try there, the suble point you are missing is that a deployment profile still is a guarantee of support. There aren't an endless number of profiles.
- ajxs 7y agoI'm not sure if you're just being disingenuous here, but you're right that you're not going to be able to use all functionality from the stdlib of Ada ( and others ) on every possible target, but you were never, ever going to. And Rust certainly won't solve this problem for you. It's not a consequence of poor standard library design either. It might not be immediately obvious, but even C has a runtime library, which needs to be specific to the architecture and OS that you're targeting. Just for a quick example, `malloc` is going to need to function differently depending on what OS you're running, and if you're targeting a microcontroller with extremely limited RAM it might not even need to be implemented at all.
- nicoburns 7y agoI don't think the parent was claiming the Rust was better in this regard, just that it was no worse. Other languages also restrict standard library features on some platforms.
- Ygg2 7y agoNot exactly. Rust can be made to run on 16-bit toaster or even OsIJustWrote. Just because it can be run, doesn't mean Rust std lib devs will support 16-bit toasters or OsIJustWrote. Each platform has different levels of support. Primary being Windows, Mac and Linux, where every pure Rust crate runs. Std lib makes certain reasonable assumptions, for which it works e.g. malloc exists and panic! is implenented.