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

Jsh software design #46

Open
jovanbulck opened this issue Oct 26, 2014 · 4 comments
Open

Jsh software design #46

jovanbulck opened this issue Oct 26, 2014 · 4 comments

Comments

@jovanbulck
Copy link
Owner

Since the jsh code base is growing, we should think more about structuring. Currently the code is far from cohesive. This of course limits readability and makes adding new features harder.

Ideally, the code should be divided into small cohesive 'modules', communicating via C header interfaces. Just like the alias.c & alias.h files now. I therefore drafted out a first idea on paper:
jsh_modularisation

Sorry for the crappy quality ;-) Also, don't worry about the arrows to much. Most of them are just #includes for jsh-common.h, containing some helper functions. I marked the important relationships in green. Since all functionality in a shell is related, I think the coupling will never be very satisfying, but at least this way it's more controlled.

As you can see, functionality is divided in different header files. This will make adding new features (e.g. new autocompleters, new built_ins, grammar enhancement, prompt customizing, ...) more local and thus also easier. Separating the command line interface in particular, will allow implementing a alternative simpler 'fall-back' modus for readline. Being more independent from readline can be nice, I think ;-) Especially if we want to port to Android, see issue #23 .

Drop your thoughts! However, since jsh is not a master-thesis, I started a zero-code policy till Thursday so I won't be starting on this yet... ;-)

@stefaantruijen
Copy link
Collaborator

Maybe you can try to scan in the diagram in CBA?

@jovanbulck
Copy link
Owner Author

I'll assign @KevinMordijck for scanning in the diagram ;-)

@jovanbulck
Copy link
Owner Author

Check out the zsh built_ins
They basically also have a huge array of built_ins

@KevinMordijck
Copy link
Collaborator

the diagram is updated

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

No branches or pull requests

3 participants