Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)B
Posts
12
Comments
457
Joined
3 yr. ago

  • Users can now use Cranelift as the code-generation backend for debug builds of projects written in Rust

    Didn't read the rest. But this is clearly inaccurate, as most Rustaceans probably already know.

    Cranelift can be used in release builds. The performance is not competitive with LLVM. But some projects are completely useless (too slow) when built with the debug profile. So, some of us use a special release profile where Cranelift backend is used, and debug symbols are not stripped. This way, one can enjoy a quicker edit/compile/debug cycle with usable, if not the best, performance in built binaries.

  • In case you missed it like me yesterday, a new RFC with an initial experimental implementation (tracking issue) is where things at now.

    And we can add a third word to delegate and forward, which is reuse ;)

  • I wanted to mention that this reminds me of the old Delegation RFC, which some of us didn't like, exactly because it felt like a problem for proc-macros to solve. It eventually got postponed.

    But then, the delegation terminology is used in hereditary, so you're probably aware of all that already ;)

    Anyway, other crates like delegate, ambassador and portrait are mentioned in the latest comments below that RFC. I wanted to quickly check how many dependants each one of those have, but https://crates.io can't do that at the moment. Nice error message though!

    Unfortunately, I have no time to check what kind of code each one of them crates generates, so I have nothing of value to add.

  • If you're not familiar with the tracing crate, give the instrument page a read. You may find the #[instrument(err)] part particularly useful.

    As for the errors themselves, if you're using thiserror (you should be), then the variants in your error enum would/should contain the relevant context data. And the chain of errors would be tracked via source/#[source] fields, as explained in the crate docs. You can see such chains if you use anyhow in your application code.

  • A conspiracy theory explanation is not necessary as it:

    • Operates on the idealistic myopic assumption that common people are an altruistic force for good. The reality is that there is plenty of self-servingness going around.
    • Assumes full collusion, removing the simple possible explanation of useful fools being taken advantage of to the maximum. Note that useful fools can still be motivated by self interest. They are just not necessarily fully aware of how they are being used.
    • Ties an argument to unprovable points/events.

    It doesn't take a conspiracy theory explanation to observe how classic corporate anti-FSFers are very content with social licenses (CoCs) being elevated to a position where they are considered more relevant and have more signal power than the software licenses chosen, or how many new-gen open-source contributors have no problem singing the New Microsoft (and the likes) praises... etc

  • You can easily guess who is behind such narratives and why.

    You would think so. But anti-FSF sentiment comes in different forms nowadays.

    My first (and only) visit to the Mastodon world was years ago. Top post (or whatever you call them) was from some micro-celeb (who probably didn't even code) bitching about how Stallmann caused great damage, and how the FSF's biggest achievement was giving decades of "our" free labor to corporations. The microblogtards replying agreed of course. Needless to say, that tab didn't stay open for long.

    Social war ultras (big intersection with microblogtards) also don't like Stallman and the FSF.

    So, new developers may have chosen non-FSF licenses not only because of copyleft implications. But also because it looks and goes along better with the posturing ethics of the times. The snowball has already gotten large of course, and next-gen devs may just be going along with the choices made by their predecessors or library dependencies without knowing much about the why.

    Still, there should probably be more MPLv2 in the Rust ecosystem.

  • It's a conspiracy too big that I don't think anyone of us can really understand or grasp the scale of it all.

    Thankfully, the EU was aware and prepared. And the EUPL is ready to usurp whatever project license, whenever needed.

  • are actually specified in international standards, which ensures they will be around for essentially all eternity

    LOL

  • OP already mentioned relm.

  • Wasn’t Iced basically a one man show before system 76 started using it for their desktop environment and made huge contributions to it?

    No. And what they contribute, they contribute to their own fork.

    They do, however, help the ecosystem with crates like cosmic-text.

    I think for now your best bet is probably...

    Their best bet was to ask around (done) and filter out the waffle. They already got a good specific actionable answer out of it.

  • I don't get it!

    If the T in Result (and presumably Option) is (), then why not just use is_ok()/is_err() from the caller side?

    Other Tips:

    • bool has then() and then_some() methods in std now.
    • You can transpose() in both directions between ResultᐸOptionᐸTᐳᐳs and OptionᐸResultᐸTᐳᐳs
  • That is a terrible time to throw away the error. Best to actually check for file not exists error and...

    lol

    This is unintentionally funny considering how exists() is implemented (which is why we have try_exists() now).

  • As I mentioned in my other comment, part of the problem is the list of implementers (which gets included as a suggestion) being too big, and maybe sometimes too complex.

    This is not inevitable and unescapable, as your comment may suggest. It is, in part, caused by the lack of (mature) support for some type system features, like HKTs.

    Luckily, this is not an inherent eternal limitation it Rust. Although, as I already mentioned, we are probably still years away from seeing this problem being fully in the past.

    • I take slight issue with your title. Such diesel errors are not your average Rust error.
    • Looking at the first example, you should have quickly realized that lack of kind abstractions over types (lol no HKTs) since Rust v1.0 is contributing to the verbosity. Maybe in a few years, with features like GATs maturing, expanding in scope, and being used more in the ecosystem, things will get better!
  • Most specific and technically relevant point:

    • Rust is what we need to turn on concurrent function execution.

    You can read more in the RIIR PR.

  • Used it last month for the first time. It was great.

    Documentation is very good.

    typst-lsp is also good.

    Did it all from neovim, exportPdf = "onSave" as a part of lsp setup, and zathura open in a tiling window manager. zathura auto-reloads the PDF when it changes on disk. So no web editor needed ;)

    First class RTL support (which was required for the task at hand) was a very pleasant surprise.

    Gotta admit though that I couldn't figure out why typst-lsp didn't work initially. Took me some time to figure out that it needs a git repo and files checked in to work. That probably should be mentioned in the README.

    And there was the odd behavior here and there, like setting gradients on text elements in table fields actually setting the gradient over the whole table for some reason. Not sure if it was my fault since I was learning on the go, or an edge case not handled.

    All in all, would definitely recommend.

  • don’t do it during working hours (especially commits - if you’re paranoid, use tor)

    I wanted to mention not using personal emails or committing from home IP addresses, but thought that was needless to say.

  • Meh, everyone scaring you into thinking you don't own your own mind.

    Assuming your boss is not the dangerous kind (beyond legal threats), and if the goal is to make it FOSS, then do it using an alias first. Do it differently. Use components/libs/algos from other people at first, even if they are not perfect. Make those parts easily pluggable/replaceable which would be good design anyway. The code then wouldn't be wholly yours, not even your alias self.

    You can join the project later with your real identity as an interested domain expert (maybe a bit after not working for the same boss). Start contributing. Become a maintainer. And maybe take over after a while. You can start replacing non-optimal components/libs/algos with better ones piecemeal.

    Oh, and if Rust wasn't the choice of implementation, use it this time.

  • As I discovered and mentioned here a couple of months ago, there is a new hyper-util crate that may/should bring a higher-level API interface back. It also predictably brings a hard dependency back on tokio rt. So there is that.

    hyper-util was also just mentioned by Sean (hyper dev) in the discussion you linked.