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

Refactor drasil-gool #3934

Open
5 tasks
B-rando1 opened this issue Aug 21, 2024 · 0 comments
Open
5 tasks

Refactor drasil-gool #3934

B-rando1 opened this issue Aug 21, 2024 · 0 comments
Labels
design Related to the current design of Drasil (not artifacts).

Comments

@B-rando1
Copy link
Collaborator

The changes I made this summer went pretty well, but the organization of drasil-gool fell behind a bit. Some of the structure and naming is a bit misleading.

  • It is called drasil-gool when it contains both GOOL and GProc.
  • All of its modules are in drasil-gool/Drasil/GOOL.
  • Some of the helper files have misleading names and/or have functions in the wrong places:
    • LanguagePolymorphic.hs has functions that the Julia renderer doesn't use.
    • CommonPseudoOO.hs has functions that are Shared, i.e. not intrinsically OO.
    • There may be others. For example, CLike.hs may have functions that are used by languages that are not particularly C-like, e.g. Julia.
  • There are some naming inconsistencies in both drasil-gool and drasil-code:
    • Procedural is sometimes referred to as Proc, sometimes as GProc.
    • Features common to both generic languages are referred to as Common or Shared.
  • There's a lot of code duplication between CodeInfoOO.hs and CodeInfoProc.hs.

I would recommend making the following changes:

  • I don't think it's overly important to rename drasil-gool, but if we can find a way to refer to GOOL and GProc collectively, that could be nice. But we would need to use the name consistently for it to be a positive change.
    • drasil-genlang sounds good, but drasil-gen and drasil-lang exist 😄.
  • I think we should split up drasil-gool/Drasil into GOOL, GProc, and Shared folders.
  • We should inventory the helper functions (LanguagePolymorphic.hs, CommonPseudoOO.hs, etc.). We'll want to rename files and move functions to different files, so that the name of each file accurately describes the kinds of functions that can be found in it.
  • We need to pick a name for procedural and shared programs and stick with it. I like GProc and Shared personally.
  • We should merge the implementations for most of the typeclass methods in the CodeInfoX.hs files. This should be pretty easy, and will look a lot like the LanguagePolymorphic.hs functions for the renderers.
@B-rando1 B-rando1 added the design Related to the current design of Drasil (not artifacts). label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Related to the current design of Drasil (not artifacts).
Projects
None yet
Development

No branches or pull requests

1 participant