Skip to content

dpemmons/typedef

Repository files navigation

typedef

C/C++ CI

Typedef is a statically typed data declaration language and code generator, intended for interface definition, data serialization, and string templating. It compiles to C++ (with other languages planned).

The language is in active development; the gramamr is stabilizing but still incomplete and may change. Code generation is incomplete. Docs are very incomplete. As are tests. It may not compile. It will probably eat your homework.

A Visual Studio Code extension for syntax highlighting is available here.

Documentation

TODO

Items in bold are in-progress.

  • string templates
    • inside-out mode?
    • configurable opening / closing strings
      • formatting
    • comments
    • boolean logic expressions (ie "and" and "or" expressions)
    • call template functions from others with literal arguments
  • tests
  • generated cpp features (probably after template engine)
  • more types
    • onordered set type? (does it make sense?)
    • Foundational
      • fixed length arrays
      • message
      • enum
    • Features
      • dates
      • IPv4 and IPv6 addresses
      • domain names
      • paths
      • TODO: look up postgres types for inspiration
  • better build system (meson?)
  • more literals
    • byte literals
    • byte strings
    • raw byte strings

Done moved here (and then eventually deleted):

  • actually resolve symbols, and make SymRef's point to their symbols.
  • fix unique_ptr for vectors, maps, etc.
  • inline types: structs, vectors, maps.
  • nested types
  • consider making cpp codegen more sane?
  • pitchfork repo layout
  • separate type declaration from field, value, etc. declaration
  • make symbol references independent of declaration order
  • tests: literals... (clear out /old)
  • required fields (grammar)

string templates

  • simple replacement
  • if/then, for (vector and map)
  • type checking
  • type checking tests
  • subtemplates
  • escape sequences
  • variants: switch statements
  • built-in functions: first() last() etc.

code generation

  • self-hosting!
  • JSON rendering
  • defaults

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published