Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load 'script' from external file #221

Closed
YoSev opened this issue Jan 11, 2025 · 7 comments
Closed

feat: load 'script' from external file #221

YoSev opened this issue Jan 11, 2025 · 7 comments

Comments

@YoSev
Copy link

YoSev commented Jan 11, 2025

I ship a product (cli) written in go which requires postProcessing, after tasks have been done.
I was looking for a small scripting language, that does not require to ship another interpreter.

This library is very promising from the simplicity and the featureset - i would just love to execute scripts from an external .script file like:
myBinary scripts -f my.script -- more parameters here

Is this something that could possible with this library?
Wouldn't that require "only" an interpreter for pipes?

@YoSev YoSev closed this as completed Jan 11, 2025
@YoSev
Copy link
Author

YoSev commented Jan 11, 2025

nvm, i can see that my idea doesn't fit the scope of this lib.

@rahji
Copy link

rahji commented Jan 11, 2025

nvm, i can see that my idea doesn't fit the scope of this lib.

I think you probably want to write an interpreter (which would become this myBinary that you're talking about) but it could be useful to then look at this library to see how they implemented the things that you want your scripting language to do (since it sounds like you want it to do the same kinds of things this library does). Check out this book: https://interpreterbook.com/

@bitfield
Copy link
Owner

Alternatively, have a look at: https://til.simonwillison.net/bash/go-script

@rahji
Copy link

rahji commented Jan 12, 2025

Alternatively, have a look at: https://til.simonwillison.net/bash/go-script

Wow thanks for this link. It requires that Go is installed so maybe it won't satisfy the OP's requirements but it seems like a great pair for go-script. You should add it to the readme if it's not there.

@YoSev
Copy link
Author

YoSev commented Jan 13, 2025

Thanks guys. I re-thought things over the weekend and i came to the concussion, that an interpreter does actually make sense for this lib.
This repo is focused mainly on sysadmins who want automation without advanced coding knowledge.
Why would they create a new binary every time they want to execute pipes?

I think a lightweight interpreter would actually make sense.

@YoSev YoSev reopened this Jan 13, 2025
@YoSev
Copy link
Author

YoSev commented Jan 13, 2025

Alternatively, have a look at: https://til.simonwillison.net/bash/go-script

Thanks for that!
Not quite the thing i am looking for, but interesting for sure.

@bitfield
Copy link
Owner

You should add it to the readme if it's not there.

Done in #222.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants