An updated version of ZephyrASDL domain-specific language -> Bring the power of ML-like languages type systems to C, with a superset of default types (Based on 1997 paper by Wang, Appel et al)
![](https://programming.dev/pictrs/image/8140dda6-9512-4297-ac17-d303638c90a6.png)
![GitHub - Chubek/ZephyrASDL: An implementation of Zephyr ASDL in C, targeting C](https://programming.dev/pictrs/image/5f288710-b140-4a38-81a1-b0ffe94be079.png?format=jpg&thumbnail=256)
I have added a lot of features to my implementation of ASDL. This includes:
- More built-in types (since they are not listed yet, they are: int, uint, char, uchar, size, usize, int8, uint8, int16, uint16, int32, uint32, int64, uint64, string, bytearrray, identifier).
- Append/dump for list functions
- Linked lists for generated code
I am currently using it to implement POSIX Shell. You can find the ASDL descriptions I am using for it in examples/shell.asdl.
Basically, ASDL allows you to have an ML-like type system for any language. My implementation does C, because it would be pointless for more modern languages like Rust, that have it built-in (although in a rather clumsy way). Or it's a foregone conclusion for OCaml or Haskell. The only 'old' language still in use is C, and I think this services the purpose.
You can use the generated C code with C++, because C++ is a superset of C --- unless your C++ compiler is weird.
There's an alternative to my implementation of ASDL, that is, 'pyasdl` which is a library for Python that just parses ASDL and lets you generate the code.
Bring up man page to lean more about it, but sadly it's a bit outdated. I will update the documentation soon.
Thanks, enjoy.