Zulip Chat Archive

Stream: lean4

Topic: os interface and regex


Alexandre Rademaker (Oct 10 2023 at 16:55):

Do we have any primitives for an OS interface? I am especially looking for a function that lists files in a folder, for example. Inspect the filenames etc. I am also curious about regex implementation; anything on that direction?

Marcus Rossel (Oct 10 2023 at 16:56):

Regex was recently discussed in Requirements for regex library.

Marcus Rossel (Oct 10 2023 at 17:01):

Regarding operations like listing files in a directory, you might find the things you need by poking around the IO.FS and System namespaces (you're looking for System.FilePath.readDir).

Alexandre Rademaker (Oct 10 2023 at 17:03):

Thank you @Marcus Rossel for the pointers.

Ioannis Konstantoulas (Oct 10 2023 at 17:18):

I have been able to go surprisingly far with the matching functions in Std.Data.String.

Alexandre Rademaker (Oct 10 2023 at 19:30):

good to know @Ioannis Konstantoulas ! Thank you

Alexandre Rademaker (Oct 10 2023 at 19:33):

Hum, Std is part of the math lib, right? I guess for me, depending on Mathlib can be too much...

Johan Commelin (Oct 10 2023 at 19:34):

Mathlib depends on Std. But they are separate packages.

Johan Commelin (Oct 10 2023 at 19:35):

You can depend on Std without depending on Mathlib

Alexandre Rademaker (Oct 10 2023 at 19:37):

Oh, great @Johan Commelin. Thank you

Scott Morrison (Oct 10 2023 at 23:56):

In particular, Std is intended to be the standard library for Lean, and our plan is that it is high enough quality (and small enough / fast enough to build) that almost all projects are comfortable depending on it.

Scott Morrison (Oct 10 2023 at 23:56):

If anyone has concerns in that direction (i.e. are hesitant to depend on it) please let us know sooner rather than later!

Ioannis Konstantoulas (Oct 11 2023 at 11:09):

Scott Morrison said:

If anyone has concerns in that direction (i.e. are hesitant to depend on it) please let us know sooner rather than later!

I have found Std very satisfactory so far, both in terms of size and code. Of course I would love to see many more features there, but everyone says that :laughing:


Last updated: Dec 20 2023 at 11:08 UTC