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

Use multiple source files and have a plug-in system for the "languages"? #78

Open
mattwynne opened this issue Jun 17, 2022 · 2 comments
Milestone

Comments

@mattwynne
Copy link
Member

🤔 What's the problem you've observed?

When I've talked to other people about this script, I've heard feedback that it's intimidating.

✨ Do you have a proposal for making it better?

I'm thinking that the code would be easier to read if it was broken over multiple files. This could enable us to make the language "plugins" each live in separate files.

📚 Any additional context?

A consequence of this would be that we'd have to change how the tool is deployed (since it currently assumes it's a single file).


This text was originally generated from a template, then edited by hand. You can modify the template here.

@mattwynne mattwynne added this to the v2 milestone Jun 17, 2022
@mpkorstanje
Copy link
Contributor

We could have a main.sh that looks like:

# declare global vars

source util.sh
source self-update.sh

source javascript.sh
source java.sh
...

# read program arguments

# run program

This would put the argument parsing and execution front and center and would give people some help understanding everything else.

Installing could be done by downloading a zip/tar from GitHub. And that would be easier after #67 is done because then we have the hooks to make releases.

It would break the updater but that's what major versions are for. This project is used by like 5 people. So nog big deal if we don't do it often.

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Jun 17, 2022

That said, with only ~550 lines and unlikely to grow much bigger I don't think we'll gain much from splitting files.

Rather I think improving the structure in the file could remove the worst of the intimidation factor.

If we put the main block in a function on top and then invoke main at the bottom of the file. It would show people the meat of the program straight away while deferring everything else til later.

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

2 participants