Skip to content

Project Structure/Naming #13

@bitwalker

Description

@bitwalker

Per my note in #12, I think we should reorganize the crates in this project a bit and fix up the naming.

The broad strokes:

  • Make sure crates are namespaced
  • Make sure crates use consistent, standardized naming scheme (e.g. pattern-compiler should be pattern_compiler, as - is a pain and has to be used as _ anyway)
  • Split up executable code from supporting library code
  • Merge library crates which perform similar but slightly different tasks

My specific thoughts/recommendations (in alphabetical order by crate). NOTE: I haven't fully grokked the role of each crate in the repo, so these thoughts are based mostly on my impressions of how they fit together, if adjustments are needed, that's no problem.

  • Extract the Core parser from compiler as libeir_syntax_core
  • Create a new crate, eirc which holds the executable parts of compiler
  • Rename compiler as libeir_ir, make it a library crate
  • Create a new crate libeir_passes to hold various IR passes
  • Merge cps_transform into libeir_passes
  • Rename diagnostics to libeir_diagnostics
  • Rename frontend to libeir_syntax_erl
  • Merge executable parts of gen_nif into eirc
  • Extract library parts of gen_nif into libeir_nif
  • Remove internal_lib if not used
  • Rename interpreter to libeir_eval, libeir_interpreter, or libeir_vm
  • Rename pattern-compiler to libeir_patternc, or possibly merge into libeir_passes if that makes more sense
  • Merge tools into eirc
  • Rename util to libeir_utils

I'm happy to do any/all of these, and I think the end result will be a much more cohesive crate workspace, and provide better hints to contributors on what things are, how they relate to one another.

My naming scheme/recommendations are largely based on community guidelines as well as the rust repository itself, as I've found their organization to be very helpful when navigating that code base, and it is massive. Lumen is organized this way as well, and has so far been pleasant to work with. Seems to be a good approach for compilers anyway!

Thoughts?

Metadata

Metadata

Assignees

Labels

cleanupNitpicky fixes for project organization/source code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions