Convenient Macros for Languages with Conventional Alge- braic Syntax

نویسنده

  • Jonathan Bachrach
چکیده

Motivation: The ability to extend a language with new syntactic forms is a powerful tool. A sufficiently flexible macro system allows programmers to build from a common base towards a language designed specifically for their problem domain. However, macro facilities that are integrated, capable, and at the same time simple enough to be widely used have been limited to the Lisp family of languages to date. In this project we introduce a macro facility, called the Java Syntactic Extender (JSE) [1], with the superior power and ease of use of Lisp macro systems, but for Java, a language with a more conventional algebraic syntax. The design is based on the Dylan macro system, but exploits Java’s compilation model to offer a full procedural macro engine. In other words, syntax expanders may be implemented in, and so use all the facilities of, the full Java language.

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

ثبت نام

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

منابع مشابه

The Scribble Reader An Alternative to S-expressions for Textual Content

For decades, S-expressions have been one of the fundamental advantages of languages in the Lisp family — a major factor in shaping these languages as an ideal platform for symbolic computations, from macros and meta-programming to symbolic data exchange and much more. As convenient as this minimalist syntax has proven to be, it is unfitting for dealing with textual content. In this paper we des...

متن کامل

Two Approaches to Portable Macros

For any programming language that supports macros and has multiple implementations (each with di‚erent AST definitions), there is a common problem: how to make macros that operate on ASTs portable among di‚erent compiler implementations? Implementing portable macros is especially important for statically typed languages like Scala, as IDE vendors usually have di‚erent implementations of the lan...

متن کامل

Macros that Work Together - Compile-time bindings, partial expansion, and definition contexts

Racket is a large language that is built mostly within itself. Unlike the usual approach taken by non-Lisp languages, the self-hosting of Racket is not a matter of bootstrapping one implementation through a previous implementation, but instead a matter of building a tower of languages and libraries via macros. The upper layers of the tower include a class system, a component system, pedagogic v...

متن کامل

The lambda-calculus is nominal alge- braic

In this paper we will write -[a 7→ -] as shorthand for (λa.-)-. Thus g[a 7→ h] stands for (λa.g)h and not for the term resulting from ‘substituting h for a in g’ (we write that as g[h/a], see Definition 44). The λ-calculus represents functions in programming languages [Pau96, Tho96], logic [Bar77, Lei94], theorem-provers [ABI96, Pau89], higher-order rewriting [BN98], and much more besides. Howe...

متن کامل

Typed Syntax Macros

Using parser combinators we can dynamically generate parsers. We show how this property is used to define or to extend the syntax of a programming language from within a program itself, thus bringing the idea of “Syntax Macros” to life again. Part of the context-sensitive constraints that consequently have to be obeyed are enforced by dynamically constructing new parsers that only accept langua...

متن کامل

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


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

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

ثبت نام

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

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

دوره   شماره 

صفحات  -

تاریخ انتشار 2001