Pipeline
HiLang is a pipelined code translator that reads a schema model (in a .hilang file) and generates the equivalent model in the target language {C#, C++, Java}. For model development work it is integrated with the Roslyn C# compiler to provide an interactive experience as the model is developed. The Pipeline follows a series of steps to validate, transform and generate implementation types
Directives
function validation
domain validation
function directives
domain directives
import validation
import directives
Enrichment
Resolve mapping
Resolve base
duplicates references
reference resolution
reference type resolution
prune unreferenced elements
remove redundant view
prune redundant segment views
resolve collections
Validation
reference Validation
entity / segment / aspect
id Validation
entity Id Validation
duplicate key validation
duplicate value validation
duplicate member validation
inheritance type validation
inheritance duplicate
aspect segment validation
extent validation
member validation
view validation
Capitalized names validation
Warnings produced if there are errors
circular reference
name match
dangling references
key validation
Extent name clash
reserved words
version property usage
id order validation
nested collection validation
base type validation
collections validation
VectorData validation
DeltaIndex validation
Transform
inheritance transform
Transform Inheritance, duplicating Keys / Values / Extents in child Elements
entity transform
Segment/Aspect transform
Transform Segment and Aspect references to specific implementations that include owner reference of the Element that contains them
Segment/Aspect to view transform
Where there are multiple implementations of a Segment / Aspect, create a view that can aggregate all implementations
id number transform
If #Hash is not provide for a key/value generate #Hash starting above the #hash of any defined values
id entity transform
If #Hash is not provide for an entity / aspect / segment, generate #Hash starting above the #hash of any defined values
index transforms
Transform Extent references to indexes
entity Cousins.Person
(
Name : String
)
{
Mother : Cousins.Person,
Father : Cousins.Person
}
[
FatherChild : Cousins.Person (Father = this),
MotherChild : Cousins.Person (Mother = this),
];
This code will produce index entries to support FatherChild
and MotherChild
access to a collection of Cousins.Person
public Cousins.Person.KeyType? Person { get; set; }
internal PersonFatherChildPath.Index? PersonFatherChildIndex { get; set; }
internal PersonMotherChildPath.Index? PersonMotherChildIndex { get; set; }
index resolve
type parameter transforms
transform generic reference type to the concrete implementation. e.g. Ownes in entity Person [Ownes : Option<Restaurant>];
is transformed to entity Person [Ownes : PersonOwnes];
Cube transform
Transform Entity / Segment / Aspect with @CubeFact property to a _Fact
table for aggregate store
Generate
generate c# Foundations
MetaModel
Fingerprint for durable hiperspaces (e.g.. using RocksDB)
Space
Serialization structures for Key, Index and Value MetaMap for key transform for partial match search
SubSpace
Domain implementation of SubSpace with collection sets for each Entity / Aspect /Segment. This is equivilent to EntityFramework Context
generate c# code
Generation of Values, Entities, Segments, Aspects, Views and ENum
generate c# include code
Generation of SetSpace<> collections for Hiperspace views and aspects