BYU - Spring 2013 - CS 630 - 6/12 - Paper

5 views
Skip to first unread message

Noonan

unread,
Jun 13, 2013, 2:26:08 AM6/13/13
to byu-cs-630-spring-2013

Honu: Syntactic Extension for Algebraic Notation through Enforestation


Summary: The paper starts out talking about how great macro systems are but how all of the additions of macro systems have happened in Lisp-like languages. The author then says they’re presenting a new language, Honu,  that adds in the power of macros but isn’t lisp-like. The author then describes the basic syntax of Honu. The author then describes the macro system and shows how you can build a macro that does something without having to enclose the call to the macro in parenthesis. The author then talks about how ellipses can be used inside of a macro. The paper then talked about syntax classes and how they are used in Honu. The author then describe’s Honu’s mechanism for adding operators to the language. The author describes why a BNF grammar is insufficient for Scheme and likewise, Honu. The author then describes the grammar used for parsing Honu. The author then talks about how the first phase of parsing is performed by a scheme reader. The author then talks about enforestation which is the process of converting terms into a syntax tree. Then they step over an example of it being performed. The author then talks about how honu pattern matching is performed. The author then describes the process of parsing, which are repeated enforest operations and explains how mutual recursion is handled in the language. The author then steps through a simple example illustrating the how the parsing mechanism works. The author discusses related work starting out talking about extensions to C and C++ macro systems. Then the author differentiates Honu by explaining how its parsing mechanism is inherently different.


Primary Contributions: A language with macros that is kind of like C.


Something I learned: BNF grammar is not powerful enough for Scheme macros.


Something I have questions about/didn’t understand: I had trouble understanding the syntax class part of the paper and how they were used. What is your opinion of Honu. Is is better or worse than racket and why?

Yu Huang

unread,
Jun 13, 2013, 3:02:35 AM6/13/13
to byu-cs-630-...@googlegroups.com
Title: Honu: Syntactic Extension for Algebraic Notation through Enforestation. 

Summary: This paper defines a new language, Honu, that combines the natural way of design programs from non-parenthetical language and the extensibility from parenthetical language. As such, it is in the middle ground between the syntactic minimalism of Lisp and maximal grammatical freedom. Section 2 starts by showing the Honu syntax with an example to compute the roots of a quadratic equation. The function in Honu syntax is similar to those in C and Javascript, but has no return form. Instead, the last expression of this function is the return value. Also, the Honu syntax is able to create anonymous function. Further, Honu views the ambiguity of a form as a single expression, and allows semicolons to separate it into multiple expressions.  The Honu macro is just like a pattern-based macro. It binds a "name" to the pattern consisting of literals, pattern and body. In this example, the macro D is expanded as a call to a function derivative. As Scheme macros, Honu macros are hygienic. The other feature of Honu macros is that the pattern can be matched to the entire expression without requiring parentheses around the expression. Besides the predefined syntax classes id and expression, programmers can introduce new syntax classes. The Honu pattern form binds a new syntax class. In addition to defining new macros, Honu allows programmers to declare new binary and unary operators. The operator's binary transform or unary transform form is a function that is called during parsing. Further, these two forms have their own structures. Section 3 discusses three layers for parsing Honu. They are reader layer, enforestation layer and parsing layer that are similar to Lisp and Scheme. 3.1 describes the revised BNF syntax grammar because the traditional BNF is not suitable for Lisp like language. The Honu reader is just like Scheme reader that plays a role similar to token analysis for a language with a static grammar. Enforestation is a distinctive part of Honu. In order to handle infix syntax, it converts a relatively flat sequence into a more Scheme-like tree of nested expressions.  This paper also discusses the Honu parsing in 3.5. 

Things I understood: The motivation of the paper is going to make the language natural to express but also keeps the capability of extension. I also understood the structures and features of Honu. 

Things I have trouble understanding:  still confused by the steps to parse Honu. 


Reply all
Reply to author
Forward
0 new messages