Update type system draft.
Giving a type to each, um, kind of type. Syntax draft changed. Bigger examples elsewhere. May need to start writing up more, but might not belong in this repo, either (it's not a detail of the golang implementation alone). Anyway, it's only for eyecandy at present: I'm not going to start work on a parser for the DSL any time soon; it's just something to keep in mind so it can be evaluated against simplicity heuristics. Struct fields are in a slice now. Waffling on whether to call that kind "struct" vs "object". Neither is very satisfying. "Struct" is suggestive of something with concrete memory layout considerings; this is not that. "Object" is suggestive of something with methods and behaviors attached; this is not that. Introduce an enum for different kinds of union. Some of the terms here are developed from https://github.com/ipfs/unixfs-v2/issues/20 ; the term "keyed" is from https://github.com/polydawn/refmt/pull/30 ; and the style "kinded" is a concept I haven't written up much about before, but the TypeUnion.ValuesKinded field type should self-explain it. Flip terminology from "required" to "optional". Struct fields that are mentioned in the schema default to being required; why else would you have mentioned them? Previous draft of DSL which used question marks and exclamations points to denote these things dropped; the new hope is that *neither* nullable nor optional will be used with enough frequency that the sigil-heavy shorthand will turn out to be desirable. Signed-off-by: Eric Myhre <hash@exultant.us>
Showing
typed/kinds.go
0 → 100644
typed/types.go
0 → 100644
typed/universe.go
0 → 100644
Please register or sign in to comment