Skip to content

Hydra developers

Joshua Shinavier edited this page Aug 3, 2023 · 4 revisions

This page is for developers of Hydra itself. See Contributors.

Dependency tiers

Since Hydra generates much of its own source code, it is challenging to prevent circular dependencies. To make things easier, we categorize Hydra source code into several dependency tiers, and enforce the simple rule that code in a lower tier may not depend on code in a higher tier:

  • tier-0 kernel modules: generated sources consisting mainly of type definitions, including hydra/core, hydra/graph, etc. These are not allowed to depend on primitive functions.
  • tier-0 DSLs: language-specific DSLs, such as Hydra-Haskell's Types and Terms DSLs, which depend only on each other and on tier-0 kernel modules. The kernel modules are not allowed to depend on the DSLs.
  • tier-1 kernel modules: generated code which is allowed to depend on (tier-1) primitive functions, as well as tier-0 kernel modules and DSLs (but not on tier-1 primitive functions)
  • tier-1 primitive functions: primitive functions whose implementations are allowed to depend on tier-0 kernel modules and tier-0 DSLs
  • tier-1 DSLs: language-specific DSLs which are allowed to depend on tier-1 kernel modules and primitive functions
  • tier- 2 kernel modules: the rest of Hydra's generated kernel code
  • tier-2 primitive functions: the rest of Hydra's built-in functions
  • tier-3 kernel sources: these are the DSL-based definitions of tier-0, tier-1, tier-2, and tier-3 kernel code. For example, Hydra/Sources/Core.hs in Hydra-Haskell is the DSL-based definition of hydra/core, which is generated to produce the tier-0 Hydra/Core.hs module in Haskell, the corresponding hydra/core package in Java, etc.
  • tier-4 non-kernel code: built-in language coders and utilities which are provided with an implementation of Hydra, but are not part of the Hydra kernel. For example, Hydra-Haskell provides a Java coder among many others, but this not part of the kernel; other Hydra implementations might not provide a Java coder.
  • tier-5 code (aka third-party code): sources, generated code, and user-defined functions which are external to Hydra proper. Developers of third-party code may create their own dependency tiers within this one, but these are not specified by Hydra.
Clone this wiki locally