• 3 Posts
  • 30 Comments
Joined 1 year ago
cake
Cake day: September 2nd, 2023

help-circle

  • KillTheMuleOPtoRustTypst 0.12 released
    link
    fedilink
    arrow-up
    3
    ·
    1 month ago

    Yeah I was very happy to find that out. I was calling latex externally before, and there was a lot of pain interacting with the filesystem and temporary files. Now it all happens in-memory :)


  • KillTheMuleOPtoRustTypst 0.12 released
    link
    fedilink
    arrow-up
    3
    ·
    1 month ago

    One thing that prevents me from letting users build their own templates is the scripting capabilities. A joker creating an endless loop could block the whole server.

    I know little about servers, but can’t you run the generation in a thread with a timeout or so? Or maybe compile to wasm and let the generation run on the users machines? I also know little about wasm, but I’d have guessed it has facilities to keep runtime and load under control.

    What would be nice is a “safe” mode in which no access to the file system (include and sorts) and limited runtime makes it safe to let users build their own templates.

    Ah, are you by chance shelling out to the typst binary? You can actually use typst as a library, and then you’ve got full control over the files involved, so it’s “safe” in that respect.






  • 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 :)







  • KillTheMuleOPtoRustNew crate: derive_typst_intoval
    link
    fedilink
    arrow-up
    4
    ·
    7 months ago

    Did I get it right? The crate lets you directly input data into a typst document from an arbitrary struct?

    Well, typst provides those means in itself, this crate just makes it easier to fulfill the necessary trait.

    Also out of scope of OP, is typst in anyway capable of typesetting music notation?

    I don’t really think so. Music notation is also pretty specific, so I’d look into specialized software for that (although it might be theres a latex package, those things are everywhere ^^).



  • It’s absolutely awesome. For my use case, it already surpasses latex, but I’m pretty sure that for other usecases there will be a point where latex offers more, at least due to ecosystem support. I for sure made the switch (wrote some personal docs in typst as well), and I’d suggest anybody at least looks into switching, it’s so much better :)

    From a dev perspective, it’s also great that this is useable as a lib, instead of having to muck with an external binary (or rather full external latex installation).



  • This parting shot sounds pretty dire

    a bug in safe code can easily cause unsound behavior in your unsafe code if you’re not careful.

    That’s definitely not how it should be. Fortunately, I think I disagree with that, since miri points to the “real” buggy code:

    unsafe { inner.as_ref() }

    As opposed to the article, I’d argue this code is not correct, since it did not account for alignment, which it must (I mean, by standard use of the word unsound this is unsound, since it can be called from safe code introducing UB). Or am I wrong? Is the fundamental value proposition of rust moot?


  • 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.