Você está na página 1de 8

Programming Languages

Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing". Topics within this page Object-Oriented Languages Documentation Generator Tools Functional Languages Logic Programming Languages Free Implementations Language Design Issues/Mistakes

Text Formatting Languages (TeX,HTML) XML-related Languages (XSLT etc.) The Open Directory Project has lots of programming language information. For examples of programming in 200+ different languages, check out Tim Robinson's 99 Bottles of Beer page. The Dylan version is nice, but make sure you check out all the C++ versions too! The template version is amazing! More programming language comparisons, including employer demand, are available at http://www.pixeldate.com/dev /comparison/

Object-Oriented Languages
The Cetus Team maintains a large collection of links about most object-oriented languages. One of my favourite object-oriented languages is Cecil, by Craig Chambers. It is a multiple-dispatch language that supports both exploratory untyped programming and large-scale statically-typed programming. It includes some new and very expressive ideas (see the paper "Predicate Dispatching: A Unified Theory of Dispatch" by Michael Ernst, Craig Kaplan and Craig Chambers). Cecil is quite similar to the theoretical language that I developed in my PhD thesis. An equally nice language is Dylan. Like Cecil, Dylan is a safe, strongly-typed, pure object-oriented language that supports multiple dispatch, modules, first-class functions etc. Dylan was originally designed by Andrew Shalit at Apple. There is a commercial implementation of it for Windows 95/NT platforms available from Functional Objects Inc., with a personal version available via free download. Free versions of Dylan for various UNIX machines are available from the Gywdion group. Other useful Dylan sites include:

the Introduction of Shalit's book, `The Dylan Reference Manual', gives an overview and rationale for Dylan; Eric Kidd's 'Getting Started With Dylan' tutorial is the best online tutorial; an A First Look at Dylan: Classes, Functions, and Modules an introductory article about Dylan from Apple (Steve Strassman); Gwydion's 12 short example Dylan programs.

Paul Haahr's Procedural Programming in Dylan compares Pascal and Dylan versions of several simple functions. Section 3 introduces Dylan's support for higher-order functions in a gentle way. (His site also has a YACC grammar for Dylan, and an alternative multiple-inheritance linearization; A small Dylan FAQ (Frequently Asked Questions). The open directory project has lots of dylan links. The Dylan Language Standard group is managing changes to the Dylan language. The draft Dylan Reference Manual is available in PDF format (2Mb). A final version of this was published by Apple (via Addison-Wesley) in 1996, and is available at a special price from Functional Objects. There is also a nice browsable html version of it. the Gywdion implementation of Dylan, started by the CMU Gwydion Group and being continued by volunteers (here is their mailing list archives). It is available for various machines The Open Directory Project's Dylan page. the Dylan Code Repository for reusable Dylan code. Chris Double has written several example programs including one that displays .bmp files in a window. Peter Norvig's slide presentation on Design Patterns in Dynamic Languages includes examples of patterns in Dylan, LISP, C++, Smalltalk and Sather. A Dr. Dobbs Journal article on Dylan (by Tamme D. Bowen and Kelly M. Hall) which defines the semantics of the main Dylan features in Haskell! This 1995 MacTech Magazine article (Vol 11, No. 8). includes a brief description and some screenshots of the original Apple Dylan Development Environment. Miscellaneous old Dylan documents at the CMU AI repository.

Python is another favourite. Interpreted, and ideal for knocking up quick prototypes, but with a nice module system, lots of handy libraries, and almost purely objectoriented. Apart from Simula-67, Smalltalk started the OO craze. Implementations are becoming more easily available now. (See also ObjectShare's non-commercial VisualWorks Smalltalk, available for Linux and Windows) Squeak is an open source Smalltalk that is becoming very popular. A lot of Smalltalk-related information and projects are accessible from the Panasoft Smalltalk Links. Here is a nice Smalltalk tutorial from IBM. Some other clean OOLs are:

Blue, a clean OOL especially designed for teaching first-year students. Modula-3 Oberon Sather Component Pascal is an object oriented programming language most closely related to Oberon-2. Compared to Oberon-2 it adds a number of annotations which are intended to enhance the type-safety of component oriented programs. QUT offers an open source compiler which generates Java bytecodes or Microsoft.NET output.

Alternatively, Oberon Microsystems offer a free educational version of their BlackBox Component Builder compiler/environment for Component Pascal. Eiffel (see also here) TOM is a new object-oriented programming language that advocates unplanned reuse of code (classes can be extended in very flexible ways, even without source code for them). Suneido is a free, open-source, pure-OO language whose syntax is similar to C++ or Java, but simpler. It is a safe, dynamic language like Smalltalk, enabling rapid development. It supports automatic garbage collection, exception handling and has builtin client-server relational database, user interface and reporting frameworks. Available for all Windows platforms, but a Linux version is planned. How about a simple OO Forth? It takes less than one screenful of Forth to define objects, classes and single inheritance.

Then we have the less clean C extensions: Objective-C seems less widely used now, but is supported by gcc. C++ is the most widely used object-oriented language. See: Readings, FAQS, ANSI Standard or here A recommended book on the design of C++ is "The Design and Evolution of C++", by Bjarne Stroustrup, Addison-Wesley, 1995. I quite like the standard template library (STL) of C++ (local docs here). It allows higher-order programming to a certain extent and comes with about 10 generic data structures and 70 simple algorithms over them. See Mumit's STL Newbie guide for some handy STL hints. Other STL-like libraries include: the Graph Template Library (GTL). There seem to be two major contenders for the "best GUI toolkit" title at the moment. GTK+ (the GIMP toolkit) is more C oriented, but does slots and signals without a preprocessor, whereas Qt uses a preprocessor (MOC) but has the dis/advantage of being a complete solution for porting to Windows 95/NT. The GTK+ toolkit has bindings for several languages, including a C++ wrapper for GTK+ called gtk-- (or FTP). Of course, there is the cleaner C++ derivative, Java (see also the Java white paper, a Java tutorial, Java Games and Java Puzzles). The two most attractive aspects of Java are that it can be a safe language (all errors are caught by the compiler or bytecode checker or cause runtime exceptions), and its portability (especially its wide range of standard libraries). Some problems with Java that I've heard about include: hard to format a floating point number, integers etc. are not objects so cannot be subtyped or subranged, non-portable thread semantics, text I/O difficult for beginners.

Here are several interesting extensions/variants of Java:

The Java Modelling Language, is Java extended with specification facilities (class invariants, preconditions, postconditions etc.); These can be added within comments, so that existing Java tools are unaffected, but the JML tools can perform deeper analysis of the program to detect more errors. Pizza is Java extended with parametric polymorphism, first-class functions and pattern matching. Jbed is a commercial real-time subset of Java that supports deadline-driven scheduling. There are also quite a few other languages being implemented on top of the Java Virtual Machine, see here, here and here.

Even Ada and Perl (Perl 4 was my least-liked language!) are object-oriented these days. Rational Software Corporation have done an interesting comparison between development in C and Ada. Rational Software Corporation also sell Purify (a heap-memory checker) and are responsible for the OO Unified Modelling Language, which is now the industry standard for specifying the structure of OO systems. Finally, CLU is an old but influential language that introduced important ideas for iterating through collection objects, for exception handling and a carefully-designed theory of object invariants, pre/post conditions etc.

The book Abstraction and Specification in Program Development, by Barbara Liskov and John Guttag, MIT Press, 1986. Here are some of my notes on the book. A 1978 paper: A Critique of the Programming Language CLU by James Peterson. This also gives a brief overview of the language.

Here are some Software Engineering methods/tools for object-oriented programming:


Project Technology: Shlaer-Mellor methodology ObjectTime: Real-Time Object-Oriented Modeling (ROOM) Rational: Unified Method & Jacobson

See John Yeager's S/W Engineering resources for more information.

Functional Programming Languages


Haskell is the one that I've used the most. It is an elegant high-level language, with fast compiled implementations plus a interpreter (HUGS) that is good for development. Haskore (an extension of Haskell for writing MIDI tunes) comes with it too!

It is not too hard to interface Haskell to arbitrary C procedures, and I have interfaced it to mSQL (a freely available mini-SQL database system). Contact me for details.

Logic Programming Languages


There is a WWW virtual library for logic programming. Michael Ley has a database/logic programming bibliography The ALP (Association of Logic Programming) newsletter. I am part of the Starlog research group, which is designing and implementing a new pure logic-programming language that is especially suited to reactive and realtime programming. Recently, I've implemented a version of Starlog for controlling Lego Robots! Prolog is the most commonly known logic programming language, albeit impure. A few well-known implementations are: Quintus Prolog, SICStus Prolog, Eclipse Prolog, SWI Prolog (free!). Qu-Prolog is Prolog customised for formal methods (it handles quantifiers, object-variables and substitutions as primitives). The Prolog at VIP is free for non-commercial use. Another free one is TRINCProlog. Michael D. Kersey recommends Amzi! Logic Explorer and the "Adventures in Prolog" (with a "very nice and complete tutorial"). See here for other free Prologs. [mindgap@my-dejanews.com, Alexander.Apostolovski@worldonline.be, and mkersey@metricom.com; comp.lang.prolog, 12Mar99.] Roman Bartak's Interactive Prolog Guide includes FAQs, program samples, implementations, and references. The BURKS project provides documentation and free Prolog implementations for DOS, Windows etc. LPA Prolog for Windows -- with an IDE and single-step debugger -- offers a free 30-day trial. [Nov98] Amzi! Logic Explorer is free for personal use. It comes with a full tutorial and sample programs, plus a GUI development environment. Amzi! inc. also offers a Prolog compiler and embeddable libraries (for C/C++, Java, Delphi, VB, etc) for a 90-day trial. [Dec98] Mercury is an elegant, pure, logic programming language from Melbourne University. The fastest logic programming language around... The Cetus Links OO Prolog page has links to object-oriented logic programming languages. Curry is an extension of Haskell that adds logic-programming features like logical variables, constaint solving and concurrent and distributed programming. Here are some useful online sites for constraint logic programming:

The constraints archive;

Bartak's online constraint programming tutorial; Tsang's 1993 book, Foundations of Constraint Satisfaction is out of print, but available from him via online order. Not really CLP, but here is a useful site on good algorithms for solving numerical problems (numerical analysis books etc.).

The quarterly Logic Programming Newsletter is now online. The textbook Logic, Programming and Prolog (2ed) by Ulf Nilsson and Jan Maluszynski is now available online. It covers theoretical aspects of logic programming as well as practical programming in Prolog, and extensions logic programming such as equational logic programming, constraint logic programming and query answering in deductive databases.

Text Formatting Languages


LaTeX is the defacto text formatting system for academic papers containing mathematics. There is lots of online reference material for it. See also the Comprehensive TeX Archive Network (CTAN). More documentation is here. Basser Lout is another text formatting language that produces Postscript/PDF directly and has a more elegant (and functional!) programming/macro language than TeX. For HTML (the web markup language):

The NCSA Beginner's Guide to HTML. Ian Graham's guide to HTML. An online quick reference card. Tips on writing HTML files to reduce net load. Peter Flynn's "How to write HTML". Nelson Minar's html-helper-mode is an excellent macro package for writing writing HTML pages in Emacs. I use it with the table extensions by Joe Hildebrand. Mag's HTML Resources Page. Computist's Weekly (CW 10.07) recommends: ML Goodies, the HTML Web Board, the Really Big site, Index DOT HTML, Web Reference, HTML Guides Index and More HTML Guides.

XML-related Languages

The World Wide Web Consortium (W3C) is the official source for XML-related documents, and has lots of tools links. ZVON.org has lots of XML-related tutorials and reference manuals, including an XML glossary, unicode character references a good reference for XSLT

Documentation Generators

There are lots of programs available for generating HTML and/or LaTeX documentation from C++ source files etc. For example:

Perceps is a Perl program that uses template files to generate very pretty looking HTML pages. Doxygen generates crosslinked HTML pages in a style similar to the Qt documentation. It also handles the Signal/Slot declarations of Qt.

Free Implementations
A Catalog of Free Compilers and Interpreters. Poplog is an open source, extendable, portable, multilanguage software development environment providing incremental compilers for several interactive programming languages: Pop-11, Prolog, Common Lisp, and Standard ML. It comes with documentation, libraries, and teaching materials for AI and Computer science (and more general programming).

Language Design Issues and Mistakes


Here are a few interesting papers about language design:

Go To Statement Considered Harmful (a classic, by Dijkstra) Arrays and Pointers Considered Harmful, [Ince 92] D.C.INCE, ACM SigPlan Notices, January 1992. Primitive Types Considered Harmful (why Java should be a pure OO language). Interface Pointers Considered Harmful (About COM and C++, in The C++ Report, Sep 1995) COM Smart Pointers Even More Harmful (A follow-up article in The C++ Report, Feb 1996) An interesting comparison of language abstraction levels which showed that an almost functional language, CAML, was the best language for a large complex numerical simulation task. Garbage collection is an important aspect of modern programming languages. XANALYS's Memory Management Reference is a good resource for everyone interested in memory management and garbage collection.

Source Code

Sourcebank is a search engine for finding reusable source code, postscript papers about software, and articles in online programming journals.

marku@cs.waikato.ac.nz

Last modified: Fri Feb 7 14:01:31 NZDT 2003gvb

Você também pode gostar