hammerlab / genspio

Generate Shell Phrases In OCaml
https://smondet.gitlab.io/genspio-doc/
Apache License 2.0
48 stars 3 forks source link

Is calling external executables type check ? #111

Open danielo515 opened 1 year ago

danielo515 commented 1 year ago

Hello. Thank you for this great idea. I was looking for a way to write, not only easier POSIX scripts, but if possible, to also have them be type safe. It will be enough to avoid typos in command names and make sure the variables contain the right kind of values. Are the terms that call external programs checking the names in some way? Is there any option to do such thing? I understand that there should be a way to call arbitrary binaries, but having some of the most common ones be "built-in" will also be very nice.

Regards.

smondet commented 1 year ago

yes, but maintaining the portability of those things is not easy :)

we've tried a bit see for instance, grep is wrapped there to fit in a nicer API: https://github.com/hammerlab/genspio/blob/master/src/lib/EDSL.ml#L438

more of those are welcome in PRs!

danielo515 commented 1 year ago

That is super nice. I understand that you have to choose the smaller set of features that is common to most grep versions (for example) and that is no easy task to generalise. If the executable, for some reason, is not available at runtime, will that error be properly caught automatically? Or do I have to take care of that in my program?

On Wed, Nov 16, 2022 at 7:21 PM Seb Mondet @.***> wrote:

yes, but maintaining the portability of those things is not easy :)

we've tried a bit see for instance, grep is wrapped there to fit in a nicer API: https://github.com/hammerlab/genspio/blob/master/src/lib/EDSL.ml#L438

more of those are welcome in PRs!

— Reply to this email directly, view it on GitHub https://github.com/hammerlab/genspio/issues/111#issuecomment-1317465188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARKJWMCNQTHB2EOUJJSOALWIUQZPANCNFSM6AAAAAASB4P4UM . You are receiving this because you authored the thread.Message ID: @.***>

--

https://danielorodriguez.com