views:

147

answers:

4

Hi,

I'm a beginning student in CS, and my classes are mostly in Java. I'm currently going through "Little Schemer" as a self study, and in the process of finding out how to do that I have found numerous references to "implementations" of Scheme. My question is, what are implementations?

Are they sub-dialects of Scheme, or is that something else (DrScheme seem to allow for different "flavors" of the language)? Is it just the name given to any given ecosystem incorporating an IDE, interpreter, interactive tool and the like?

Do all other languages (e.g., Java) also have a variety of "implementations", or is it something reserved to "open" languages?

Thank you,

Joss Delage

+6  A: 

An implementation of a language means any program that runs or compiles that specific language.

In Scheme in specific, it's a good question, because there have been multiple major revisions of the language specification. Beyond that, there are a lot of languages (including the original Scheme!) that are called Scheme that don't follow any of the specifications completely. The beginner languages for HTDP are small in order to be a little restrictive about how problems are solved (and probably for other reasons). The GIMP until very recently used a non-standard Scheme interpreter called SIOD (Scheme In One Defun or Scheme In One Day). There are many other examples; see for instance Dialects Of Scheme for PLT Scheme's take on language standard support.

Jesse Millikan
+5  A: 

An implementation of a programming language is a compiler or interpreter for that language. Additional components of the eco system, like IDEs, can be part of an implementation, but are not necessary. For Scheme there are many, for instance DrScheme, Guile, Gambit.

Many programming languages have different implementations, but all implementations of a certain language should implement (i.e., compile) the exact same dialect. That's easiest if there is a clear and official specification of the language, as is the case for Scheme. Of course, most language specifications go through many versions, so different implementations may support different versions of the language.

For Java, there are implementations from Sun, Oracle, IBM, and I think one other.

Thomas Kappler
The 'other Java' you are forgetting is the rarely-updated one from Apple...
Nathan Sanders
GNU has one as well.
Steven Huwig
+1  A: 

An implementation is a particular vendor's version/product that implements (conforms to, provides, etc.) a certain standard (class interface, API, language specification, etc.).

To make this simple to understand by analogy, both Coca-Cola and Pepsi can be considered to be implementations of Soda (or, if you are so-inclined, of Pop). Soda/Pop is a general concept, and Coca-Cola and Pepsi are particular products that conform to that concept.

Similarly, Mac OS X and Linux are both implementations of the Single UNIX Specification. The GNU C++ Compiler and the Intel C++ compiler are implementations of the C++ programming language. The Sun Java 6 JDK, the OpenJDK, and the GNU Compiler for Java (GCJ) are all implementations of Java.

Within Java, as you will soon discover, the word "implements" is used as a keyword when a class provides a concrete definition of a function declared in an interface, because, by providing the concrete definition, that class implements the requirements of the general concept embodied by the interface.

I hope that helps improve your understanding of the meaning of "implementation".

Michael Aaron Safyan
+1  A: 

An implementation is a compiler or interpreter for a programming language; it is a way to translate the instructions of the language into behavior. The most common language with multiple implementations today is probably JavaScript.

When folks talk about implementations, it's often in the context of having to deal with the problems that arise from having multiple ones. There are benefits -- your favorite one will do things the way you like -- but the problems can be frustrating. Because Chrome and Firefox and IE and Safari all behave slightly differently with the same JavaScript code, web developers have to spend a great deal of time testing their code on the various browsers, detecting which one you're using, and adapting the code to the slightly different sets of libraries, bugs, etc.

Some languages are defined by a standard implementation (ruby, perl, python) rather than by a document, which is why you don't hear of multiple implementations of those. Even in those languages you have the related problem of various versions having different behavior.

Implementations are not a new phenomenon: back in his high school days, Bill Gates got his start writing one of many BASIC implementations, for example.

What makes the problems worse with Scheme than with other languages is that the specification is intentionally small -- tries to specify very little. The benefit is that folks who design programming languages can create a new experimental Scheme implementation with neat new properties relatively quickly. Once they've done this, they can claim that even the small language they've written is "useful" because others have shown how to extend the small language to a useful one. However, there is a great deal of work in that "simple matter of programming", and each implementation must make a great many decisions on their own, so the differences between implementations are many and large. Thus the problems associated with multiple implementations are many and large in Scheme compared to more fully specified languages.

The Scheme community acknowledges the problem, along with the benefit of a small specification, and is actively working on ways to make the transition from experimental language to useful language clearer with new versions of the standard. http://scheme-reports.org/

For now (2010), I personally recommend that new users begin working in PLT Scheme, and I'm glad you started there. Do not let the many implementations problem scare you: there is a great deal of benefit to working in the language that programming language designers designed for themselves. PLT has a large community and a good set of libraries that will help you overcome the difficulties outlined above.

Best, Grem

Gregory Marton
Thanks for the thoughtful, well articulated comments.
JDelage