Re: Writing Compilers in Functional Languages

Ali Al-Shabibi <ali@olympe.ch>
13 May 2005 18:03:08 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: Writing Compilers in Functional Languages neelk@cs.cmu.edu (Neelakantan Krishnaswami) (2005-04-28)
Re: Writing Compilers in Functional Languages awwaiid@thelackthereof.org (Brock) (2005-04-28)
Re: Writing Compilers in Functional Languages torbenm@diku.dk (2005-04-30)
Re: Writing Compilers in Functional Languages neelk@cs.cmu.edu (Neelakantan Krishnaswami) (2005-05-02)
Re: Writing Compilers in Functional Languages alcremi@pobox.com (Alain Cremieux) (2005-05-03)
Re: Writing Compilers in Functional Languages YRassokhin@luxoft.com (2005-05-05)
Re: Writing Compilers in Functional Languages ali@olympe.ch (Ali Al-Shabibi) (2005-05-13)
| List of all articles for this month |

From: Ali Al-Shabibi <ali@olympe.ch>
Newsgroups: comp.compilers
Date: 13 May 2005 18:03:08 -0400
Organization: Compilers Central
References: 05-04-068 05-04-085
Keywords: functional

Brock wrote:
> One starting place is "Modern Compiler Implementation in ML" by Andrew
> Appel, ISBN 0521582741. I found the book very helpful.
>
> I also suggest you research parser combinators. There are even toolkits
> to ease combinator style parser development, such as Parsec for Haskell.
>
> --Brock
>
> On 2005.04.26.20.43, Kkaa wrote:
> | ...
> | Are there any books or online resources that instead focus on using
> | functional languages as implementation languages? I'm considering
> | using Haskell or Scheme, but I'm hoping that the resources won't
> | assume a particular functional langauge.


Maybe you could try Scala, it a new functional language develeoped at
the Swiss Federal Institute of Technology. http://scala.epfl.ch


Scala is a pure object-oriented language in the sense that every value
is an object. Types and behavior of objects are described by classes
and traits. Class abstractions are extended by subclassing and a
flexible mixin-based composition mechanism as a clean replacement for
multiple inheritance.


Scala is also a functional language in the sense that every function
is a value. Scala provides a lightweight syntax for defining anonymous
functions, it supports higher-order functions, it allows functions to
be nested, and supports currying. Scala's case classes and its
built-in support for pattern matching model algebraic types used in
many functional programming languages.


Furthermore, Scala's notion of pattern matching naturally extends to
the processing of XML data with the help of regular expression
patterns. In this context, sequence comprehensions are useful for
formulating queries. These features make Scala ideal for developing
applications like web services.


Scala is equipped with an expressive type system that enforces
statically that abstractions are used in a safe and coherent
manner. In particular, the type system supports:


          * generic classes,
          * variance annotations,
          * upper and lower type bounds,
          * classes and abstract types as object members,
          * compound types,
          * explicitly typed self references,
          * views, and
          * polymorphic methods.


A local type inference mechanism takes care that the user is not
required to annotate the program with redundant type information. In
combination, these features provide a powerful basis for the safe reuse
of programming abstractions and for the type-safe extension of software.


Let me know if you do decide to use Scala.


Cheers,


--
-- Ali Al-Shabibi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.