https://kotlinlang.org logo
#coroutines
Title
# coroutines
g

groostav

07/25/2018, 6:28 AM
would appreciate any feedback
n

nwh

07/25/2018, 4:20 PM
I have something similar. I've found for my purposes that having a class that represents an executable is helpful. For example, I have this:
Copy code
val cmd = Kmd("cmd.exe", "/C")
cmd.run("echo hi", ...)
Which actually is very useful for inheritance. I have a dedicated wrapper to
youtube-dl
that extends this. Perhaps that is out of the scope of your library, though.
g

groostav

07/27/2018, 1:10 AM
I was thinking about trying to remove some of the launcher gunk that you often see, eg:
cmd /C myscript
and
powershell.exe -File myfile -ExecutionPolicy Bypass
come to mind. But I dont think I want to do anything that is specific beyond wrappers to help the platforms themselves. So your idea about classes that wrap some of the bigger scripting languages sounds good.
my driving use case is actually kind've like Continuous Integration for (mechanical & electrical) engineers: we invoke a number of gigantic complicated old windows programs that may (or may not) emit things on standard out that we want to show our user in real time. My annoyance with the existing libraries is how poorly they treat std-out and std-error.
2 Views