[-] KillTheMule@programming.dev 5 points 1 week ago

transitive performance benefits

I would have assumed the benchmark suite accounts for that, otherwise the results aren't quite as meaningfull really. Which ties back you your 2nd senctence: I certainly trust the rust team more than myself on these things :)

[-] KillTheMule@programming.dev 5 points 1 week ago

only affect very select use cases

I did not read the whole conversation, but sorting seems a very common usecase (not mine, but seems to me a lot of people sort data), so this seems quite a broad improvement to me.

that is already perceived as a pain point

Note though, as is mentioned in the issue, that the survey showed people still prioritize runtime performance over compilation performance in general, so this tradeoff seems warranted.

the total regression is still minor

It's not unheard of that regressions can be unmade later on, so here's hoping :)

[-] KillTheMule@programming.dev 5 points 1 week ago

Alas, on the whole the compiler slowed down as a result of this. I think it's a worthy tradeoff though.

[-] KillTheMule@programming.dev 7 points 1 week ago

No sarcasm, just an honest suggestion :)

[-] KillTheMule@programming.dev 18 points 1 week ago

From the Fine Readme:

This project allows you to create games for the Playdate handheld gaming system in Rust lang.

You really should preface every announcement with something like this :)

[-] KillTheMule@programming.dev 6 points 2 weeks ago* (last edited 2 weeks ago)

It's surprisingly simple: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f176852c61dcf0c3382f0ac97c26de03 As a side node, asking for a value, and then immediately calling to_string on it seems kinda hiding the allocation. I'd suggest let the user call to_string on it themselves.

(e) Changed it a bit to account for passing None as the third argument.

22

Hey all!

I've just published a small crate, and would like to take the occasion to not only announce this, but also make typst better known in the rust community, because I think it's awesome :)

What does this do?

It provides a derive macro to derive typst::foundations::IntoValue for a struct.

Why would I want that?

If you're using typst as a library, chances are you want to get data into your documents. Rather than using a templating library or rolling your own, I'd suggest using inputs (I'm still excited being made aware of that!), which implies making a Value out of your data. typst_macros provides the possibility to derive Cast, which includes the treasured IntoValue... for enums. This is a gap somewhat closed by this crate.

So what about this typst?

typst is a typesetting system (akin to LaTeX) written in Rust. The core and cli are licensed freely, and it is very useable up to the point that I personally don't use latex anymore, but have switched to typst. I'm personally ultra-fond of the ability to use typst as a library, which makes it perfect for apps that want to produce high-quality documents from user-provided data.

Any questions, comments, criticism, code reviews welcome! Also, give typst a shot.

[-] KillTheMule@programming.dev 6 points 3 months ago

I have an app that ultimately renders pdfs via typst. I'm starting to write tests for the output, exporting the documents to png instead and then applying something like https://github.com/kornelski/dssim or so.

(If anyone has experience with that, I'd take any hint I get ;))

[-] KillTheMule@programming.dev 20 points 7 months ago

Note that this is not only a cli and a (closed source) web editor, but also a library. So it's possible to embed a full typesetting library in your project, which is awesome. It's probably not on par with TeX yet, but you can already do an awful lot with it. Scripting it is really much, much easier than, say, LaTeX.

[-] KillTheMule@programming.dev 4 points 8 months ago

I've written nvim-rs, an async library for interfacing with neovim via RPC.

As a sidejob, I'm writing and selling a program to create school reports.

[-] KillTheMule@programming.dev 9 points 8 months ago

Wow, they're sort-of-targeting edition 2024. I did not expect this, holding my breath ;)

[-] KillTheMule@programming.dev 33 points 9 months ago

While funny, this also highlights part of why I like rust's error handling story so much: You can really just read the happy path and understand what's going on. The error handling takes up minimal space, yet with one glance you can see that errors are all handled (bubbled up in this case). The usual caveats still apply, of course ;)

[-] KillTheMule@programming.dev 5 points 9 months ago

Enums/Structs first, but those 2 are mixed, and any impl for them will be directly after the definition of the type itsef. Free functions last.

15

... might be interesting for most people

view more: next โ€บ

KillTheMule

joined 10 months ago