Documentation of Ruby at the level of S-expressions.
Being a non-expert, I understood that Ruby is parsed into something like S-expressions. I am happy that Ruby allows me not to write in sexps. This buys ergonomy (code readability). I am also happy that Ruby allows me to write in sexps and even convert the sexp code to standard Ruby with tools such as Jim Weirich's Sorcerer. However, it seems to me that at the level of sexps, Ruby is underdocumented for us average users. I can only guess what :program, :stmts, :@int, :@float, :@ident etc. in Ripper.sexp output mean. Why not make the Ruby sexp documentation public?
#1 [ruby-core:57130] Updated by Yui NARUSE almost 3 years ago
- Status changed from Open to Rejected
Why Ruby doesn't documantate its sexp is because we don't limit Ruby's future by its compatibility.
For version compatibility, Ruby's abstract syntax tree is internal expression and it may be changed suddenly.
If the syntax tree is published, people want the compatibility and it will limit future implementation.
For implementation compatibility, other than CRuby can use another internal expression for AST.
If the tree is published, the compatibility will disturb new parser implementations.
Anyway people can use AST as sexp with some gems or tools at their own risk.
This is considered the best situation.