Growing a Syntax

نویسندگان

  • Eric Allen
  • Ryan Culpepper
  • Janus Dam Nielsen
  • Sukyoung Ryu
چکیده

In this paper we present a macro system for the Fortress programming language. Fortress is a new programming language designed for scientific and high-performance computing. Features include: implicit parallelism, transactions, and concrete syntax that emulates mathematical notation. Fortress is intended to grow over time to accommodate the changing needs of its users. Our goal is to design and implement a macro system that allows for such growth. The main challenges are (1) to support extensions to a core syntax rich enough to emulate mathematical notation, (2) to support combinations of extensions from separately compiled macros, and (3) to allow new syntax that is indistinguishable from core language constructs. To emulate mathematical notation, Fortress syntax is specified as a parsing expression grammar (PEG), supporting unlimited lookahead. Macro definitions must be checked for well-formedness before they are expanded and macro uses must be well encapsulated (hygienic, composable, respecting referential transparency). Use sites must be parsed along with the rest of the program and expanded directly into abstract syntax trees. Syntax errors at use sites of a macro must refer to the unexpanded program at use sites, never to definition sites. Moreover, to allow for many common and important uses of macros, mutually recursive definitions should be supported. Our design meets these challenges. The result is a flexible system that allows us not only to support new language extensions, but also to move many constructs of the core language into libraries. New grammar productions are tightly integrated with the Fortress parser, and use sites expand into core abstract syntax trees. Our implementation is integrated into the open-source Fortress reference interpreter.To our knowledge, ours is the first implementation of a modular hygienic macro system based on parsing expression grammars. ∗ Work partially done while visiting Sun Microsystems Laboratories. † Supported by the SIMAP Project under the Danish Strategic Research Council NABIIT-program. Copyright is held by Sun Microsystems, Inc. FOOL ’09 24 January, 2009, Savannah, Georgia, USA. ACM .

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Cross-linguistic Influence at Syntax-pragmatics Interface: A Case of OPC in Persian

Recent research in the area of Second Language Acquisition has proposed that bilinguals and L2 learners show syntactic indeterminacy when syntactic properties interface with other cognitive domains. Most of the research in this area has focused on the pragmatic use of syntactic properties while the investigation of compliance with a grammatical rule at syntax-related interfaces has not received...

متن کامل

Social Logic of Cities and Urban Tourism Accessibility; Space Syntax Analysis of Kuala Lumpur City Centre

Tourism is a progressively major part of economies of urban areas. Urban regeneration as a subcategory of urban tourism has been the center of many urban projects. This study addresses the role of space syntax theory as an analytical tool and design aided tool in urban regeneration. For this purpose, we examined the development of a square in the Kuala Lumpur City Center (KLCC) using space synt...

متن کامل

Deficiency of the Space Syntax method as an urban design tool in designing traditional urban space and the need for some supplementary methods

Urban design problems have become so complex that no single designer is able to consider all aspects of a design area simultaneously. Lately the application of computerized and scientific methods have helped designers analyze complex problems. One of these new methods is Space Syntax. The purpose of this study is to first investigate the strengths and weaknesses of this method and then suggest ...

متن کامل

Description Theory and Approach about Space Syntax Methodology in Urban Design Process

Nowadays space is considered to be a net of connections between different areas. The questions how to delineate its character and how it is possible to objectively compare two spaces is a matter under consideration. This was the reason for creating new theories about the structure of space. Space syntax analysis (SSA) or simply Space Syntax defines a number of theories and research areas devo...

متن کامل

Alpha - Structural Recursion and Induction ( Extended

There is growing evidence for the usefulness of name permutations when dealing with syntax involving names and name-binding. In particular they facilitate an attractively simple formalisation of common, but often technically incorrect uses of structural recursion and induction for abstract syntax trees modulo α-equivalence. At the heart of this formalisation is the notion of finitely supported ...

متن کامل

Neural substrates of processing syntax and semantics in music.

Growing evidence indicates that syntax and semantics are basic aspects of music. After the onset of a chord, initial music-syntactic processing can be observed at about 150-400 ms and processing of musical semantics at about 300-500 ms. Processing of musical syntax activates inferior frontolateral cortex, ventrolateral premotor cortex and presumably the anterior part of the superior temporal gy...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008