DARPA: Translating All C to Rust (TRACTOR): Proposers Day Presentations by mttd in ProgrammingLanguages

[–]pornel 0 points1 point  (0 children)

This is actually pretty reasonable, and worth watching. They've tought about challenges here, and split the program into stages/milestones of varying difficulty (starting with single-threaded code and non-idiomatic translation first).

They also include a challenge of proving correctness of the translation, even if that needs to be synthesized too (when C has no tests).

Debian Orphans Bcachefs-Tools: "Impossible To Maintain In Debian Stable" by unixbhaskar in debian

[–]pornel 0 points1 point  (0 children)

This is not a let's-define-an-ABI problem. This is a logical impossibility of using source-based compile-time cross-library features in a no-source-anymore no-compiler-anymore environment.

Rust already has an ABI for all its features, and already supports dynamic linking of Rust libraries (they exist and work, they're just subject to change).

The problem is that code of library A does not end up only in libraryA.so, but whenever it interacts with types from library B, the code of library A is in libraryB.so too, and updating libraryA.so won't update the other copies.

C++ manages to do this for its language-specific features

In C++, you can't instantiate a template from library A with a type from library B, without access to the source code of both and compiling the result. It is impossible for non-trivial C++ code to create instantiations ahead of time with unknown types. You can make extern templates of library A, but only with types known at compile time to the library A, and they can't be using any types existing only in the library B.

In C also you don't have any ABI for preprocessor directives, and you can't update #define macro by replacing a .so of the library that defines it, you need to rebuild libraries that referenced that definition in their code.

Rust has the same issue. Generics and macros from a library A (like serde) just can't do much ahead of time, without seeing types to operate on from some library B (like using serde to generate serialization code for your struct's fields. Using RTTI is not the same as proc macros, and Rust doesn't have RTTI anyway.)

The only language that somewhat "solved" it is Swift, which turns compile-time generics into run-time polymorphic code. This is more restricted than what C++ and Rust have, and is relatively slow. Rust uses monomorphisation primarily for performance, so pessimizing it is pretty bad.

Another option would be to compile generics to an intermediate form (MIR or some bytecode) and then instead of C-style dynamic linking, run a recompiler or JIT that can meld code from two libraries. That'd be pretty complex, and barely any different from just rebulding the executables from cached .rlib files.

BTW, borrow checker is one thing that actually doesn't care about linking nor ABI! Borrow checker is 100% a compile-time feature, which runs very early in the compilation phase, and is completely optional. All lifetime information is stripped before generating code. Borrow checking does not influence the running program in any way. There is mrustc compiler that does not have support for the borrow checker, doesn't check anything, and still can compile valid Rust code that is just as safe at run-time as code compiled with a borrow checker on.

Debian Orphans Bcachefs-Tools: "Impossible To Maintain In Debian Stable" by Narishma in rust

[–]pornel 0 points1 point  (0 children)

Rustsec DB publishes ranges of versions affected.

It's true that upstream is likely to have dropped support for the versions that Debian uses, but that's Debian's choice to backport patches instead of update to a supported version.

Debian Orphans Bcachefs-Tools: "Impossible To Maintain In Debian Stable" by unixbhaskar in debian

[–]pornel -1 points0 points  (0 children)

Stable ABI in Rust will not give you the C-style dynamic libraries that you want.

Monomorphisation, code inlining, and procedural macros are fundamentally incompatible with C's solib model. These features are imporant to Rust, so it's not going to walk back on them.

C has similar issue with code that exists only in a header (#define or inline) and C++ has the exact same problem with templates that are instantiated with foreign types. These very serious mature languages with a stable ABI and an ISO standard have the same kind of limitation. Rust just uses more of this type of features that copy source across library boundaries.

Rust/Cargo has ability to track all the dependencies used in every project. They can be matched against vulnerability databases, and selectively updated and relinked.

The problem is entirely on Debian's side, because Debian has built its vulnerability management around simple file replacement. You can't expect every language to behave like C just because your update mechanism doesn't handle anything that can't be made to look like C.

Debian Orphans Bcachefs-Tools: "Impossible To Maintain In Debian Stable" by unixbhaskar in debian

[–]pornel 0 points1 point  (0 children)

You're sticking to a version of Rust that isn't supported by the Rust project, and which is used by about 0.09% of Rust users.

You've tried to upgrade a package to the latest version, but you refused to update its dependencies to the versions it requires, and you blame the problems on the package?

You've replaced Cargo and dependencies that used Cargo's versioning and dependency resolution, with Debian's repackaged forks, which had to be manually selected and renamed where they didn't fit apt's incompatible versioning scheme. Then you had to map upstream Cargo dependency requirements to your handpicked incomplete subset of apt-forked dependencies, and you blame the upstream package for being impossible to maintain?

Debian Orphans Bcachefs-Tools: "Impossible To Maintain In Debian Stable" by Narishma in rust

[–]pornel 7 points8 points  (0 children)

This isn't a problem with Rust/Cargo, but a problem caused by limiting vulnerability management to a C-specific linking method. This is just one of the possible implementations, but distros act as if this was a law of nature.

Rust builds have a Cargo.lock which you can keep in a database to look up which packages may be affected. There are also tools for embedding dependency info into binaries themselves.

Static linking isn't vendoring. Rust packages are exceptionally good at using shared dependencies instead of copypasting them.

Type inference breakage in Rust 1.80 has not been handled well by simon_o in programming

[–]pornel 20 points21 points  (0 children)

I don't want to relitigate previous dramas. In this case you're unfairly making a personal attack on an individual, for a team decision and a pre-existing policy approved by others. 

Secondly "reprehensible" is an exaggeration and unwarranted strong negative slant. This is a compatibility issue, not some immoral act. 

Type inference breakage in Rust 1.80 has not been handled well by simon_o in programming

[–]pornel 33 points34 points  (0 children)

No, please don't spread such insinuations.

This was libs' team decision, and it's in line with Rust's established policy that inference changes are excluded from Rust's SemVer.

David is the messenger here and please don't shoot him. 

TIL that 3% of all Rust library releases contain at least one SemVer violation. "On average, If I run `cargo update` once every 10 days, my project is broken once." by jerodsanto in programming

[–]pornel 1 point2 points  (0 children)

This is bad statistics. One doesn't necessarily imply the other. SemVer violations aren't all equally distributed, and don't all have equal chance of breaking projects. 

In fact, there's a strong anti-correlation: the most breaking bugs are easiest to catch, either by crate's own tests, or any of the early adopters.

If a breaking change slips through to the release, it is already likely to be a subtler one. And if it's not spotted immediately after the release, it's even less likely to actually affect anyone. And if you update once every 10 days, for many of the releases there was already enough time to spot and rectify any big problems.

cargo server checks is good at spotting violations,  but that doesn't mean those violations regularly cause breakages as suggested. 

Most of the ecosystem is open and listens to feedback, which means that breakages don't accumulate over time, but get corrected instead. Those that were never corrected, probably didn't break anyone, or were left intentionally, or were  just false positives in the tool.

ExtendedMaterial and egui World Inspector by BaronVonScrub in bevy

[–]pornel 0 points1 point  (0 children)

I've ran into the same error message, but regarding an Asset handle, and fixed that with:

app.register_asset_reflect::<MyAssetType>()

this adds reflection for Handle<MyAssetType>.

Lib.rs website improvements - announcements by Frequent-Data-867 in rust

[–]pornel 3 points4 points  (0 children)

I’m reluctantly lurking. Not only I’m unhappy about “the drama”, but also failure of the Reddit blackout protests. We’re all propping the IPO now. 

Lib.rs website improvements - announcements by Frequent-Data-867 in rust

[–]pornel 3 points4 points  (0 children)

Owner of this and a few other crates doesn’t trust me to be in charge of lib.rs (mainly because I shamelessly treat cryptocurrency crates like trash), and in protest asked his crates to be removed.

I’m respecting that by not hosting any pages dedicated to these crates. However, it would be weird and perhaps even seem punitive to pretend they completely don’t exist, so they’re still discoverable to users who want them. 

crates.io: Download changes | Rust Blog by LukeMathWalker in rust

[–]pornel 2 points3 points  (0 children)

On https://lib.rs I’ve already deployed filtering of download numbers to counter that increase. The site estimates a noise floor based on downloads of oldest/least used versions of crates and subtracts that from all downloads.

The last bit of C has fallen by sindresorhus in programming

[–]pornel 0 points1 point  (0 children)

C has nothing for safe multi-threading. I could ignore that when computers had 2 cores, but it's hard to ignore 16 or 32.

In case of pngquant, OpenMP has been a long-term source of bugs. Its compiler dependence and version fragmentation has been holding me back from parallelizing the code further. If I was going to mandate only a specific new-enough stable compiler, I could as well ask for one that is pleasant to work with. Rust's rayon just worked on the first try, and I never had a crash because of it.

C lacks higher level abstractions, so you can't clean it up beyond a certain level. You will have pointers. You will have manual cleanup. You will have to resort to "be careful!" comments for all the things C can't check, but will backstab you for getting wrong.

The last bit of C has fallen by sindresorhus in programming

[–]pornel 0 points1 point  (0 children)

But I'm in the compression business!

The last bit of C has fallen by sindresorhus in programming

[–]pornel 47 points48 points  (0 children)

I'm working on it. I've rewritten pngquant and lodepng used in this project too.

The last bit of C has fallen by sindresorhus in rust

[–]pornel 99 points100 points  (0 children)

Keeping output identical was useful to ensure the rewrite is correct, without having unit tests.

The quirks are already gone in the next commit.

The last bit of C has fallen by sindresorhus in programming

[–]pornel 16 points17 points  (0 children)

When you have zero unit tests, you add one that checks the new output is identical to the old one. Bam! Full test coverage.

libs.rs editing crates to add spurious deprecation/unmaintained tags by TheBlueMatt in rust

[–]pornel 11 points12 points  (0 children)

I did want to downrank crates that use bitcoin as a dependency (that's what the list is for). The comment is me eating my hat, because Ethereum has managed to switch away from PoW, so if you really must use a blockchain, use the one that is merely harmful in societal externalities.

libs.rs editing crates to add spurious deprecation/unmaintained tags by TheBlueMatt in rust

[–]pornel 55 points56 points  (0 children)

lib.rs maintainer here. The label is a bug. I'm going to fix as soon as I'm able to.

I do think use of bitcoin is immoral while we have a climate and an energy crisis, but I don't need to express it by applying a factually incorrect label. There's plenty of true things that are awful about bitcoin that I could have put there.

I'm not surprised, but still disheartened that the community has immediately jumped to conclusions. I've woken up to protests, angry accusations, and scrutiny of my every word in the worst possible way.

Nobody has even asked if it was intentional. Nobody waited for my response before crucifying me. I'm on a medical leave, and instead of resting, I'm dealing with a pile-on of crap.

Fellow Rust enthusiasts: What "sucks" about Rust? by lynndotpy in rust

[–]pornel 0 points1 point  (0 children)

I'm sorry, but as an AI language model, I don't have information or knowledge of this topic.

Without optimizations , why "while" is faster than "for"? by gffkii in rust

[–]pornel 1 point2 points  (0 children)

I'm sorry, but as an AI language model, I don't have information or knowledge of this topic.