You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while the primitives list_dir and is_dir might be a good start, you are basically asking every user to reinvent the wheel on top of it ?
The filtering primitive you expose is really just a list + an array filter, so what is left beyond those is the glob. Glob is a fairly high-level feature and could easily be part of a package on Typst Universe, so that users don't have to reinvent the wheel.
should i also bring up the standard libs of other scripting languages (perl, python, lua, etc) ?
while in rust there is: [...]
All the ones you list for Rust are non-std packages from crates.io.
there is also a speed issue to be considered.
while the methods with match patterns could run entirely (and fast) in rust, doing (re-implementing) that in highlevel typst-script might be overkill.
Even if done on the Rust side, it would need to go through a standard World trait API, which would likely be one that just lists the directory. So just the filtering itself would be faster. I don't think that speed is a huge concern in this case with the number of files we are likely talking about. If it turns out yes, a glob package could even make use of a WebAssembly plugin.
As a final addition, I would ask you to make your point in a bit less confrontative way next time. I'm not asking any users to reinvent any wheels, I'm just trying to find a sweet spot in terms of what are stdlib APIs and what is left to packages.
As a final addition, I would ask you to make your point in a bit less confrontative way next time. I'm not asking any users to reinvent any wheels, I'm just trying to find a sweet spot in terms of what are stdlib APIs and what is left to packages.
maybe i misunderstood, but you pointed me to an issue talking at the end about having list_dir/is_dir api
... with the comment to build on top of that
... surely i felt compelled to have to reinvent the wheel myself, as might need others who have the same use-case.
we might have different approaches in thinking about how such functionality should be implemented.
for me this functionality is part of a set of standard libraries that have solved the problems for good (some even a long time ago).
forgive me if i am oblivious to the details and implications of the rust module ecosystem.
so i was under the impression if i find something on doc.rs with a MIT or Unlicense license status it should be unproblematic to consider.
please forgive if i might sounded rude, provocative or uncaring, but my neuro-divergence is sometimes causing difficulties for others.
Activity
laurmaedje commentedon Apr 8, 2025
I think #2123 is probably better as a base API since what you want could be built on top fairly easily.
terefang commentedon Apr 8, 2025
while the primitives
list_dirandis_dirmight be a good start, you are basically asking every user to reinvent the wheel on top of it ?also what is missing is fnmatch/glob/ant-style matching, which again causes each user to reinvent the wheel.
there are standard apis for it in libc:
while in rust there is:
and you might also need to expose
dirname/basename/extnamelike functions from Path.should i also bring up the standard libs of other scripting languages (perl, python, lua, etc) ?
there is also a speed issue to be considered.
while the methods with match patterns could run entirely (and fast) in rust, doing (re-implementing) that in highlevel typst-script might be overkill.
laurmaedje commentedon Apr 8, 2025
The filtering primitive you expose is really just a list + an array filter, so what is left beyond those is the glob. Glob is a fairly high-level feature and could easily be part of a package on Typst Universe, so that users don't have to reinvent the wheel.
All the ones you list for Rust are non-std packages from crates.io.
Even if done on the Rust side, it would need to go through a standard
Worldtrait API, which would likely be one that just lists the directory. So just the filtering itself would be faster. I don't think that speed is a huge concern in this case with the number of files we are likely talking about. If it turns out yes, a glob package could even make use of a WebAssembly plugin.As a final addition, I would ask you to make your point in a bit less confrontative way next time. I'm not asking any users to reinvent any wheels, I'm just trying to find a sweet spot in terms of what are stdlib APIs and what is left to packages.
terefang commentedon Apr 9, 2025
maybe i misunderstood, but you pointed me to an issue talking at the end about having
list_dir/is_dirapi... with the comment to build on top of that
... surely i felt compelled to have to reinvent the wheel myself, as might need others who have the same use-case.
we might have different approaches in thinking about how such functionality should be implemented.
for me this functionality is part of a set of standard libraries that have solved the problems for good (some even a long time ago).
forgive me if i am oblivious to the details and implications of the rust module ecosystem.
so i was under the impression if i find something on doc.rs with a
MITorUnlicenselicense status it should be unproblematic to consider.please forgive if i might sounded rude, provocative or uncaring, but my neuro-divergence is sometimes causing difficulties for others.
laurmaedje commentedon Apr 10, 2025
As I understood the argument, it was that other languages standard libraries ship with glob built-in and I was just trying to say that https://docs.rs/path-matchers/latest/path_matchers/ is not std, but more like Typst Universe. Rust has file listing in std, but glob is left to third-party packages, and I think for Typst a similar setup could work.
laurmaedje commentedon Apr 6, 2026
I'll close this as out of scope and something that could be built on top of #2123.