Closed chsasank closed 3 months ago
It is opined that C's syntax is unnecessarily complicated. With some care it should be possible to come up with a simpler syntax that implements similar semantics to C. In specific, we will try to implement a syntax that can be generated easily. This is what C-Lisp is intended to be.
While implementing such a language, observing ASTs for C programs would be useful. One approach is to generate a parser using the standard C grammar (in the EBNF spec), use it to parse C programs and observe the resulting ASTs.
Another possibility is to use features of compilers that can emit ASTs of the program (such as Clang's -emit-ast
option).
Started making notes on this here: https://outline.von-neumann.ai/s/d0cd5eb9-2e15-4fa4-bd17-c3911f305008/doc/notes-on-the-structure-of-the-c-language-b0N3g0Mv18
Basically C with lisp like syntax. So that we can generate this C easily. Look up C book for spec of what C is: http://cslabcms.nju.edu.cn/problem_solving/images/c/cc/The_C_Programming_Language_%282nd_Edition_Ritchie_Kernighan%29.pdf