ocaml-community / ISO8601.ml

Parser and printer for date-times in ISO8601
https://ocaml-community.github.io/ISO8601.ml
MIT License
28 stars 13 forks source link

Remove the dependency to Unix #1

Closed samoht closed 5 years ago

samoht commented 9 years ago

That would be great to not depend on Unix at all!

sagotch commented 9 years ago

Copying and pasting unix time functions (or part of) you need?

I could look at it when I will be back from holiday.

c-cube commented 6 years ago

I think this can be closed?

sagotch commented 6 years ago

This issue has not been resolved, but I do not plan to work on it.

c-cube commented 6 years ago

What are the unix functions used for? I can try to take a look at it (maybe indeed by copying and adapting some code) if it's still a desirable feature.

sagotch commented 6 years ago

The library itself relies on Unix.gmtime to handle day/month/year fields.

c-cube commented 6 years ago

Ah, it seems gmtime is a thin wrapper around the underlying C API… So I guess that to get a pure OCaml solution right would be a lot of work :disappointed:

sagotch commented 6 years ago

I think so. But do you know a platform where Unix module would not be supported? ISO8601 could use its own type and wrapper to C call, but I do not see the point...

On the other hand, going from a float/tm to a tm/float from scratch is probably just copy/pasting/translating some well-known algorithm, so it should not be that hard to do, but you need time to do it ^^

c-cube commented 6 years ago

I'm not sure, are there stubs for that in jsoo? Not that jsoo matters to me, but I don't really consider unix as universally available.

c-cube commented 5 years ago

Until a clean solution is found, or someone makes a PR for that, I'm closing it.