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

Separate the different parts of the project in independant Python packages #13

Open
Kristaba opened this issue Feb 12, 2020 · 1 comment

Comments

@Kristaba
Copy link

I discovered this project when looking to some ARM simulator with good introspection capability from Python code.
For the project I have in mind (also educational, at Toulouse University), I only require for now the simulator part (not the web front end nor the assembler).

At a first glance, I think I can quite easily do some modification in your code to make the integration with my project easy.
However, it would be far easier for me to make a Python package with only the simulator-related modules, and install it as a dependency of my project (using a setup.py file for instance).
It seems you have something like 3 main packages that can be extracted from your current code base:

  • the simulator/bytecode interpreter
  • the assembler
  • the web/cli front-ends

I believe such a modular infrastructure could also increase the interest in this -pretty cool- project, but I don't know if you have the time and/or desire to go in this direction?
Such work may also helps to make the different packages or the whole project accessible on PyPi for an easy installation with pip and similar tools! :)

If you are interested, I may find some time to propose a pull request in the upcoming month or so.

@mgard
Copy link
Owner

mgard commented Feb 12, 2020

Thanks for your interest! In the current state, the different parts are already relatively well separated:

  • tokenizer.py, yaccparser.py, assembler.py make the assembler
  • mainweb.py, wsgi.py, bottle_i18n.py, i18n.py and the interface folder make the web front-end
  • The rest (in particular simulator.py, components.py, and everything in simulatorOps) is the simulator

The main issue I can think of would be with the bytecodeinterpreter.py file. This file was originally intended to be UI/front-end-agnostic, but sadly it is not. It is heavily tied to the way the web front-end works. Also, the assembler is tied to a few elements in the simulator (like the definition of instructions and the utility functions), but this is less of a problem.

I think it could be done, and I would be ok merging it, but I do not have much time to put on this project in the upcoming months. The main thing I would like to be very careful about is the design of a stable API for the simulator (and, to a lesser extent, the assembler), such that the three components do not have to be independently kept to a single precise version in order to work. I will think about it, in the meantime if you have suggestions, don't hesitate to put them here!

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