Thread: [pure-lang-svn] SF.net SVN: pure-lang: [49] pure/releases
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-05-04 09:30:47
|
Revision: 49 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=49&view=rev Author: agraef Date: 2008-05-04 02:30:54 -0700 (Sun, 04 May 2008) Log Message: ----------- Snapshot of Pure 0.2. Added Paths: ----------- pure/releases/pure-0.2/ pure/releases/pure-0.2/ChangeLog pure/releases/pure-0.2/INSTALL pure/releases/pure-0.2/Makefile pure/releases/pure-0.2/NEWS pure/releases/pure-0.2/README pure/releases/pure-0.2/examples/hello.pure pure/releases/pure-0.2/interpreter.cc pure/releases/pure-0.2/interpreter.hh pure/releases/pure-0.2/lexer.ll pure/releases/pure-0.2/lib/prelude.pure pure/releases/pure-0.2/lib/primitives.pure pure/releases/pure-0.2/printer.cc pure/releases/pure-0.2/pure.1 pure/releases/pure-0.2/runtime.cc pure/releases/pure-0.2/runtime.h pure/releases/pure-0.2/test/prelude.log pure/releases/pure-0.2/test/test1.log pure/releases/pure-0.2/test/test1.pure pure/releases/pure-0.2/test/test2.log pure/releases/pure-0.2/test/test3.log pure/releases/pure-0.2/test/test4.log pure/releases/pure-0.2/test/test4.pure pure/releases/pure-0.2/test/test5.log pure/releases/pure-0.2/test/test6.log pure/releases/pure-0.2/test/test7.log pure/releases/pure-0.2/util.cc Removed Paths: ------------- pure/releases/pure-0.2/ChangeLog pure/releases/pure-0.2/Makefile pure/releases/pure-0.2/NEWS pure/releases/pure-0.2/README pure/releases/pure-0.2/examples/hello.pure pure/releases/pure-0.2/interpreter.cc pure/releases/pure-0.2/interpreter.hh pure/releases/pure-0.2/lexer.ll pure/releases/pure-0.2/lib/prelude.pure pure/releases/pure-0.2/lib/primitives.pure pure/releases/pure-0.2/printer.cc pure/releases/pure-0.2/pure.1 pure/releases/pure-0.2/runtime.cc pure/releases/pure-0.2/runtime.h pure/releases/pure-0.2/test/test1.pure pure/releases/pure-0.2/test/test4.pure pure/releases/pure-0.2/util.cc Copied: pure/releases/pure-0.2 (from rev 29, pure/trunk) Deleted: pure/releases/pure-0.2/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-05-02 07:09:21 UTC (rev 29) +++ pure/releases/pure-0.2/ChangeLog 2008-05-04 09:30:54 UTC (rev 49) @@ -1,74 +0,0 @@ -2008-05-02 Albert Graef <Dr....@t-...> - - * Makefile: Add $(LDFLAGS) and $(LIBS) to the link line, so that - the user can easily add his own linker options and local - libraries. - - * lib/strings.pure: Add missing range check in string indexing - operation. Reported by Eddie Rucker. - - * printer.cc (operator <<): Handle stack overflow while printing - an expression. - - * interpreter.cc (dodefn): Fix a tricky bug causing the executable - code of closures bound to variables to be freed when it was still - needed. Reported by Chris Double. - -2008-05-01 Albert Graef <Dr....@t-...> - - * interpreter.cc: Proper alignment of value fields in expression - struct on 64 bit systems. Reported by Tim Haynes. - - * Makefile: g++ shouldn't be hardcoded, use $(CXX) instead. - Reported by Ryan Schmidt. - - * runtime.cc (pure_sys_vars): More OSX compatibility fixes. - Reported by Ryan Schmidt. - -2008-04-30 Albert Graef <Dr....@t-...> - - * interpreter.cc: Fix a compilation error (STL bug: - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729) as well as some - bogus warnings with Apple gcc 4.0.1. Reported by Ryan Schmidt. - - * Makefile (make depend): Get rid of bogus LLVM dependencies. - Reported by Ryan Schmidt. - - * lexer.ll, parser.yy: Fixes for compatibility with newer flex and - bison versions. Reported by Eddie Rucker. - -2008-04-28 Albert Graef <Dr....@t-...> - - * examples/symbolic.pure: Add symbolic evaluation example. This is - just a straightforward port of some Q examples. - - * runtime.cc: Add support for advisory stack checks. - - * matcher.cc: Bugfixes. - -2008-04-27 Albert Graef <Dr....@t-...> - - * lib/string.pure: Added split and join functions. - - * pure.1, examples/hello.pure: Overhaul n queens example, added - quicksort and binary search tree examples. - - * lib/prelude.pure: Added void and curry/uncurry combinators, do, - zipdo. - - * interpreter.cc, pure.cc, runtime.cc: Make SIGINT generate a - useful exception value. - - * pure.cc: Add completion for global function and variable - symbols. - -2008-04-22 Albert Graef <Dr....@t-...> - - * Got a working interpreter, at last. There's still lots of stuff - to do (see the TODO file), but the interpreter should now be - usable as it is. - -2008-03-27 Albert Graef <Dr....@t-...> - - * ChangeLog started - Copied: pure/releases/pure-0.2/ChangeLog (from rev 47, pure/trunk/ChangeLog) =================================================================== --- pure/releases/pure-0.2/ChangeLog (rev 0) +++ pure/releases/pure-0.2/ChangeLog 2008-05-04 09:30:54 UTC (rev 49) @@ -0,0 +1,127 @@ +2008-05-04 Albert Graef <Dr....@t-...> + + * 0.2 release. + + * lexer.ll, printer.cc: Add an explicit notation for big + integers. Any integer immediately followed by the uppercase letter + "G" (as in "biG" or "GMP") will now always be interpreted as a + bigint constant, even if it fits into a machine integer. This + notation is also used when printing bigint constants. This change + was necessary to make it possible to write rules matching against + "small bigint" constants. + + * lib/primitives.pure: Added operations to recognize function + applications and extract the function and argument parts, + implemented in runtime.cc. Note that these operations can't be + defined in Pure because of the "head is function" rule which means + that in a pattern of the form f x, f is always a literal function + symbol and not a variable. + +2008-05-03 Albert Graef <Dr....@t-...> + + * README: Moved installation instructions to a separate INSTALL + file, added Eddie Rucker's detailed instructions there. + + * util.cc (myiconv): Apple's iconv takes const char** as 2nd + parameter. #ifdef that case. Reported by Ryan Schmidt. + + * interpreter.cc (declare_extern): Fixed a bug in the generated + wrapper code for external calls, which caused function arguments + to be garbage-collected prematurely, when they were still needed + to create the default value, in the case of external calls + returning a null expression pointer to indicate failure. Reported + by Eddie Rucker. + + * test/test4.pure: Disabled tail call checks, as they may fail on + some platforms. Reported by Ryan Schmidt. + + * test/test1.pure: Corrected fact3 example, added test cases. + Reported by Libor Spacek. + +2008-05-02 Albert Graef <Dr....@t-...> + + * Makefile: Overhaul of regression tests so that results of + expressions are recorded. Also, 'make check' doesn't depend on the + log files any more, so that the logs can be stored in svn. You can + now use the explicit goal 'make logs' to regenerate the logs for + changed test files. + + * runtime.cc (same): Added a syntactic equality test. Requested by + Eddie Rucker. + + * Makefile: Add $(LDFLAGS) and $(LIBS) to the link line, so that + the user can easily add his own linker options and local + libraries. + + * lib/strings.pure: Add missing range check in string indexing + operation. Reported by Eddie Rucker. + + * printer.cc (operator <<): Handle stack overflow while printing + an expression. + + * interpreter.cc (dodefn): Fix a tricky bug causing the executable + code of closures bound to variables to be freed when it was still + needed. Reported by Chris Double. + +2008-05-01 Albert Graef <Dr....@t-...> + + * interpreter.cc: Proper alignment of value fields in expression + struct on 64 bit systems. Reported by Tim Haynes. + + * Makefile: g++ shouldn't be hardcoded, use $(CXX) instead. + Reported by Ryan Schmidt. + + * runtime.cc (pure_sys_vars): More OSX compatibility fixes. + Reported by Ryan Schmidt. + +2008-04-30 Albert Graef <Dr....@t-...> + + * interpreter.cc: Fix a compilation error (STL bug: + http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729) as well as some + bogus warnings with Apple gcc 4.0.1. Reported by Ryan Schmidt. + + * Makefile (make depend): Get rid of bogus LLVM dependencies. + Reported by Ryan Schmidt. + + * lexer.ll, parser.yy: Fixes for compatibility with newer flex and + bison versions. Reported by Eddie Rucker. + +2008-04-29 Albert Graef <Dr....@t-...> + + * 0.1 release. + +2008-04-28 Albert Graef <Dr....@t-...> + + * examples/symbolic.pure: Add symbolic evaluation example. This is + just a straightforward port of some Q examples. + + * runtime.cc: Add support for advisory stack checks. + + * matcher.cc: Bugfixes. + +2008-04-27 Albert Graef <Dr....@t-...> + + * lib/string.pure: Added split and join functions. + + * pure.1, examples/hello.pure: Overhaul n queens example, added + quicksort and binary search tree examples. + + * lib/prelude.pure: Added void and curry/uncurry combinators, do, + zipdo. + + * interpreter.cc, pure.cc, runtime.cc: Make SIGINT generate a + useful exception value. + + * pure.cc: Add completion for global function and variable + symbols. + +2008-04-22 Albert Graef <Dr....@t-...> + + * Got a working interpreter, at last. There's still lots of stuff + to do (see the TODO file), but the interpreter should now be + usable as it is. + +2008-03-27 Albert Graef <Dr....@t-...> + + * ChangeLog started + Copied: pure/releases/pure-0.2/INSTALL (from rev 38, pure/trunk/INSTALL) =================================================================== --- pure/releases/pure-0.2/INSTALL (rev 0) +++ pure/releases/pure-0.2/INSTALL 2008-05-04 09:30:54 UTC (rev 49) @@ -0,0 +1,174 @@ + +INSTALLING PURE (AND LLVM) +========== ==== ==== ===== + +These instructions (by courtesy of Eddie Rucker, thanks Eddie!) explain how to +compile and install LLVM (which is the compiler backend required by Pure) and +the Pure interpreter itself. More information about installing LLVM and the +required LLVM source packages can be found at http://llvm.org. + + +BASIC INSTALLATION +===== ============ + +The basic installation process is as follows. Note that steps 1-3 are only +required once. Steps 2-3 can be avoided if binary LLVM packages are available +for your system. Additional instructions for compiling Pure from SVN sources +can be found in the INSTALLING FROM SVN SOURCES section below. Moreover, you +can refer to the OTHER COMPILATION OPTIONS section at the end of the file for +details about various options available when building and installing Pure. + +STEP 1. Make sure you have all the necessary dependencies installed (-dev +denotes corresponding development packages): + +- GNU make, GNU C++ and the corresponding libraries; + +- flex and bison (these are only required when compiling the Pure SVN sources, + see the INSTALLING FROM SVN SOURCES section below); + +- libgmp, -dev; + +- libreadline, -dev; + +- libltdl, -dev; + +- subversion (only needed to fetch the SVN sources, see below). + +E.g., the required packages for Ubuntu are: make, g++, g++ 4.0 multilib, flex, +bison, libgmp3c2, libgmp3-dev, readline5-dev, libltdl3, libldtl3-dev, +subversion. + +STEP 2. Get and unpack the LLVM 2.2 sources at: +http://llvm.org/releases/download.html#2.2 + +STEP 3. Configure, build and install LLVM as follows: + +$ cd llvm-2.2 +$ ./configure +$ make +$ sudo make install + +STEP 4. Get and unpack the Pure sources at: http://pure-lang.sf.net/ + +The latest release tarballs can always be found on the SourceForge project +page. See "Downloads" on the Pure website for a quick link to the download +section. + +STEP 5. Build and install the release version of Pure as follows: + +$ cd pure-x.y +$ make build=release +$ sudo make install + +Here, x.y denotes the current Pure version number (0.1 at the time of this +writing). If you want to install the debugging-enabled version, run just +'make' instead of 'make build=release'. + +To check that Pure is working correctly on your computer, also run: + +$ make check + +STEP 6. The Pure interpreter should be ready to go now. (On some systems you +might first have to run ldconfig to update the dynamic linker cache.) + +Run Pure interactively as: + +$ pure +Pure 0.1 Copyright (c) 2008 by Albert Graef +This program is free software distributed under the GNU Public License +(GPL V3 or later). Please see the COPYING file for details. +Loaded prelude from /usr/local/lib/pure/prelude.pure. + +Check that it works: + +> 6*7; +42 + +Read the online documentation (this invokes the Pure manual page): + +> help + +Exit the interpreter (you can also just type the end-of-file character at the +beginning of a line, i.e., Ctrl-D on Unix): + +> quit + + +INSTALLING FROM SVN SOURCES +========== ==== === ======= + +The latest development version of Pure is available in its subversion (SVN) +source code repository. You can browse the repository at: + +http://pure-lang.svn.sourceforge.net/viewvc/pure-lang/ + +(See the pure/trunk subdirectory for the latest sources.) + +Note that if you're going with the development sources, you'll also need +fairly recent versions of the flex and bison utilities (flex 2.5.31 and bison +2.3 should be ok). + +To compile from the development sources, replace steps 4 and 5 above with: + +STEP 4': Fetch the SVN sources. + +$ svn co http://pure-lang.svn.sourceforge.net/svnroot/pure-lang pure-lang + +STEP 5': Build and install the debugging-enabled version (of course you can +also build the release version, as described in step 5 above): + +$ cd pure-lang/pure/trunk +$ make +$ sudo make install + + +OTHER COMPILATION OPTIONS +===== =========== ======= + +By default, the pure program is installed under /usr/local/bin, with the +library files going into /usr/local/lib/pure. The installation directory can +be changed by editing the definition of the 'prefix' variable in the Makefile, +or by specifying the desired value on the 'make' command line, e.g.: + +$ make all install prefix=/usr + +Note that you should specify this option *both* at compile and installation +time since certain default paths are hardcoded into the interpreter (but can +be changed at runtime by setting corresponding environment variables, see the +manpage for details). + +There are a number of other variables you can set on the 'make' command line +if you need special compiler (CXXFLAGS) or linker flags (LDFLAGS), or if you +have to add platform-specific libraries (LIBS) like libiconv on OSX. + +After your build is done, you can (and should) also run 'make check' to verify +that your Pure interpreter works correctly. This can be done without +installing the software. In fact, there's no need to install the interpreter +if you just want to take it for a test drive, you can simply run it from the +source directory. Just make sure that you set the PURELIB environment variable +to the lib directory in the sources which holds the prelude and the other +library scripts. The following command, + +$ PURELIB=./lib ./pure + +will run the Pure interpreter with that setting in Bourne-compatible shells. + +For the release version, you should build the interpreter as follows: + +$ make build=release + +This disables all runtime checks and debugging information in the interpreter. +(Don't worry, your Pure programs will still be executed "safely" and shouldn't +segfault unless you run out of memory or there's a bug in the interpreter.) +The 'release' build gives you *much* faster execution times (factor of 2 +compared to the default flags on my Linux system running gcc 4.1, YMMV). It +also takes a *long* time to compile runtime.cc, but it's really worth the +wait, so please be patient. ;-) + +Please also have a look at the Makefile for details on the build and +installation process and other available targets and options. + + +May 2008 +Albert Graef <Dr.Graef at t-online.de> +Eddie Rucker <erucker at bmc.edu> Deleted: pure/releases/pure-0.2/Makefile =================================================================== --- pure/trunk/Makefile 2008-05-02 07:09:21 UTC (rev 29) +++ pure/releases/pure-0.2/Makefile 2008-05-04 09:30:54 UTC (rev 49) @@ -1,212 +0,0 @@ - -# This Makefile requires GNU make. Really. - -# Basic setup. You can change the version number and installation paths here. - -# For instance, to install under /usr instead of /usr/local, run 'make -# prefix=/usr && make install prefix=/usr'. Please note that the 'prefix' -# option must be specified *both* at build and at installation time. At -# installation time, you can also specify a DESTDIR path if you want to -# install into a staging directory, e.g.: 'make install DESTDIR=$PWD/BUILD'. - -version = 0.1 -dist = pure-$(version) - -prefix = /usr/local -bindir = $(prefix)/bin -libdir = $(prefix)/lib/pure -mandir = $(prefix)/share/man/man1 - -DESTDIR= - -# Compilation flags. We provide three different build profiles: - -# 'default' compiles with extra runtime checks and debugging information. -# 'debug' adds more debugging output (useful to debug the interpreter). -# 'release' optimizes for execution speed (release version). - -# The latter disables all runtime checks and debugging information and gives -# you *much* faster execution times (factor of 2 compared to the default flags -# on my Linux system running gcc 4.1, YMMV). It also takes a *long* time to -# compile runtime.cc, so be patient. ;-) - -# To build with a given profile, just say 'make build=<profile>', e.g.: 'make -# build=release'. (This option only has to be specified at build time, not for -# installation or any other targets except 'all'.) - -build=default - -# No need to edit below this line. Unless you really have to. :) ############ - -LLVM_FLAGS = `llvm-config --cppflags` -LLVM_LIBS = `llvm-config --ldflags --libs core jit native` - -# NOTE: Some of the following flags are gcc-specific, so you'll have to fiddle -# with the options if you're using a different compiler. - -ifeq ($(build),default) -CXXFLAGS = -g -Wall $(LLVM_FLAGS) -CFLAGS = -g -Wall -else -ifeq ($(build),debug) -CXXFLAGS = -g -Wall -DDEBUG=2 $(LLVM_FLAGS) -CFLAGS = -g -Wall -DDEBUG=2 -else -ifeq ($(build),release) -CXXFLAGS = -O3 -DNDEBUG -Wall $(LLVM_FLAGS) -CFLAGS = -O3 -DNDEBUG -Wall -else -CXXFLAGS = -g -Wall $(LLVM_FLAGS) -CFLAGS = -g -Wall -.PHONY: warn -warn: all - @echo "WARNING: Invalid build profile '$(build)'." - @echo "WARNING: Must be one of 'default', 'debug' and 'release'." - @echo "WARNING: Assuming 'default' profile." -endif -endif -endif - -SOURCE = expr.cc expr.hh funcall.h interpreter.cc interpreter.hh lexer.ll \ -matcher.cc matcher.hh parser.yy printer.cc printer.hh pure.cc \ -runtime.cc runtime.h symtable.cc symtable.hh util.cc util.hh -EXTRA_SOURCE = lexer.cc parser.cc parser.hh location.hh position.hh stack.hh -OBJECT = $(subst .cc,.o,$(filter %.cc,$(SOURCE) $(EXTRA_SOURCE))) -ALL_LIBS = $(LLVM_LIBS) -lreadline -lgmp $(LIBS) - -examples = $(wildcard examples/*.pure) -lib = $(wildcard lib/*.pure) -tests = $(wildcard test/*.pure) -logs = test/prelude.log $(tests:.pure=.log) -distlogs = $(wildcard test/*.log) - -DISTFILES = COPYING ChangeLog NEWS README TODO Makefile \ -$(SOURCE) $(EXTRA_SOURCE) w3centities.c pure.1 pure.xml pure.vim \ -$(examples) $(lib) $(tests) $(distlogs) - -.PHONY: all html dvi ps pdf clean realclean depend install uninstall dist \ -logs check - -# compilation - -all: pure - -pure: $(OBJECT) - $(CXX) -o $@ $(LDFLAGS) -rdynamic $(OBJECT) $(ALL_LIBS) - -pure.o: pure.cc - $(CXX) $(CXXFLAGS) -DVERSION='"$(version)"' -DPURELIB='"$(libdir)"' -c -o $@ $< - -lexer.cc: lexer.ll - flex -o lexer.cc $< - -parser.cc: parser.yy - bison -v -o parser.cc $< - -parser.hh location.hh position.hh stack.hh: parser.cc - -# documentation in various formats (requires groff) - -html: pure.html -dvi: pure.dvi -ps: pure.ps -pdf: pure.pdf - -%.html: %.1 - groff -man -Thtml $< > $@ - -%.dvi: %.1 - groff -man -Tdvi $< > $@ - -%.ps: %.1 - groff -man -Tps $< > $@ - -%.pdf: %.1 - groff -man -Tps $< | ps2pdf - $@ - -# cleaning - -clean: - rm -f *~ *.bak *.html *.dvi *.ps pure $(OBJECT) parser.output - -cleanlogs: - rm -f $(logs) - -realclean: clean - rm -f $(EXTRA_SOURCE) $(logs) $(dist).tar.gz - -# dependencies - -depend: $(SOURCE) $(EXTRA_SOURCE) - makedepend -Y $(SOURCE) $(EXTRA_SOURCE) 2> /dev/null - -# installation - -install: pure $(lib) - install -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(mandir) - install -s pure $(DESTDIR)$(bindir)/pure - install -m 644 $(lib) $(DESTDIR)$(libdir) - install -m 644 pure.1 $(DESTDIR)$(mandir)/pure.1 - -uninstall: - rm -rf $(DESTDIR)$(bindir)/pure $(DESTDIR)$(libdir) $(DESTDIR)$(mandir)/pure.1 - -# roll a distribution tarball - -dist: $(DISTFILES) - rm -rf $(dist) - mkdir $(dist) && mkdir $(dist)/examples && mkdir $(dist)/lib && \ -mkdir $(dist)/test - for x in $(DISTFILES); do ln -sf $$PWD/$$x $(dist)/$$x; done - rm -f $(dist).tar.gz - tar cfzh $(dist).tar.gz $(dist) - rm -rf $(dist) - -# test logs, make check - -level=7 - -logs: $(logs) - -check: pure $(logs) - @ echo Running tests. - @ (export PURELIB=./lib; echo -n "prelude.pure: "; if ./pure -n -v$(level) lib/prelude.pure | diff -q - test/prelude.log > /dev/null; then echo passed; else echo FAILED; fi) - @ (cd test; export PURELIB=../lib; for x in $(tests); do f="`basename $$x`"; l="`basename $$x .pure`.log"; echo -n "$$x: "; if ../pure -v$(level) $$f | diff -q - $$l > /dev/null; then echo passed; else echo FAILED; fi; done) - -test/prelude.log: lib/prelude.pure - PURELIB=./lib ./pure -n -v$(level) $< > $@ - -%.log: %.pure - PURELIB=./lib ./pure -v$(level) $< > $@ - -# DO NOT DELETE - -expr.o: expr.hh interpreter.hh matcher.hh symtable.hh printer.hh runtime.h -expr.o: parser.hh stack.hh util.hh location.hh position.hh -interpreter.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh -interpreter.o: runtime.h parser.hh stack.hh util.hh location.hh position.hh -interpreter.o: expr.hh matcher.hh symtable.hh printer.hh runtime.h parser.hh -interpreter.o: stack.hh util.hh location.hh position.hh -lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h -lexer.o: parser.hh stack.hh util.hh location.hh position.hh -matcher.o: matcher.hh expr.hh -matcher.o: expr.hh -parser.o: expr.hh printer.hh matcher.hh runtime.h util.hh interpreter.hh -parser.o: symtable.hh parser.hh stack.hh location.hh position.hh -printer.o: printer.hh expr.hh matcher.hh runtime.h interpreter.hh symtable.hh -printer.o: parser.hh stack.hh util.hh location.hh position.hh -printer.o: expr.hh matcher.hh runtime.h -pure.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h -pure.o: parser.hh stack.hh util.hh location.hh position.hh -runtime.o: runtime.h expr.hh interpreter.hh matcher.hh symtable.hh printer.hh -runtime.o: parser.hh stack.hh util.hh location.hh position.hh funcall.h -symtable.o: symtable.hh expr.hh printer.hh matcher.hh runtime.h -symtable.o: expr.hh printer.hh matcher.hh runtime.h -util.o: util.hh w3centities.c -lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h -lexer.o: parser.hh stack.hh util.hh location.hh position.hh -parser.o: parser.hh stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh -parser.o: location.hh position.hh interpreter.hh symtable.hh -parser.o: stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh -parser.o: location.hh position.hh -location.o: position.hh Copied: pure/releases/pure-0.2/Makefile (from rev 47, pure/trunk/Makefile) =================================================================== --- pure/releases/pure-0.2/Makefile (rev 0) +++ pure/releases/pure-0.2/Makefile 2008-05-04 09:30:54 UTC (rev 49) @@ -0,0 +1,217 @@ + +# This Makefile requires GNU make. Really. + +# Basic setup. You can change the version number and installation paths here. + +# For instance, to install under /usr instead of /usr/local, run 'make +# prefix=/usr && make install prefix=/usr'. Please note that the 'prefix' +# option must be specified *both* at build and at installation time. At +# installation time, you can also specify a DESTDIR path if you want to +# install into a staging directory, e.g.: 'make install DESTDIR=$PWD/BUILD'. + +version = 0.2 +dist = pure-$(version) + +prefix = /usr/local +bindir = $(prefix)/bin +libdir = $(prefix)/lib/pure +mandir = $(prefix)/share/man/man1 + +DESTDIR= + +# Compilation flags. We provide three different build profiles: + +# 'default' compiles with extra runtime checks and debugging information. +# 'debug' adds more debugging output (useful to debug the interpreter). +# 'release' optimizes for execution speed (release version). + +# The latter disables all runtime checks and debugging information and gives +# you *much* faster execution times (factor of 2 compared to the default flags +# on my Linux system running gcc 4.1, YMMV). It also takes a *long* time to +# compile runtime.cc, so be patient. ;-) + +# To build with a given profile, just say 'make build=<profile>', e.g.: 'make +# build=release'. (This option only has to be specified at build time, not for +# installation or any other targets except 'all'.) + +build=default + +# No need to edit below this line. Unless you really have to. :) ############ + +LLVM_FLAGS = `llvm-config --cppflags` +LLVM_LIBS = `llvm-config --ldflags --libs core jit native` + +# NOTE: Some of the following flags are gcc-specific, so you'll have to fiddle +# with the options if you're using a different compiler. + +ifeq ($(build),default) +CXXFLAGS = -g -Wall $(LLVM_FLAGS) +CFLAGS = -g -Wall +else +ifeq ($(build),debug) +CXXFLAGS = -g -Wall -DDEBUG=2 $(LLVM_FLAGS) +CFLAGS = -g -Wall -DDEBUG=2 +else +ifeq ($(build),release) +CXXFLAGS = -O3 -DNDEBUG -Wall $(LLVM_FLAGS) +CFLAGS = -O3 -DNDEBUG -Wall +else +CXXFLAGS = -g -Wall $(LLVM_FLAGS) +CFLAGS = -g -Wall +.PHONY: warn +warn: all + @echo "WARNING: Invalid build profile '$(build)'." + @echo "WARNING: Must be one of 'default', 'debug' and 'release'." + @echo "WARNING: Assuming 'default' profile." +endif +endif +endif + +SOURCE = expr.cc expr.hh funcall.h interpreter.cc interpreter.hh lexer.ll \ +matcher.cc matcher.hh parser.yy printer.cc printer.hh pure.cc \ +runtime.cc runtime.h symtable.cc symtable.hh util.cc util.hh +EXTRA_SOURCE = lexer.cc parser.cc parser.hh location.hh position.hh stack.hh +OBJECT = $(subst .cc,.o,$(filter %.cc,$(SOURCE) $(EXTRA_SOURCE))) +ALL_LIBS = $(LLVM_LIBS) -lreadline -lgmp $(LIBS) + +examples = $(wildcard examples/*.pure) +lib = $(wildcard lib/*.pure) +tests = $(wildcard test/*.pure) +logs = test/prelude.log $(tests:.pure=.log) +distlogs = $(wildcard test/*.log) + +DISTFILES = COPYING ChangeLog INSTALL NEWS README TODO Makefile \ +$(SOURCE) $(EXTRA_SOURCE) w3centities.c pure.1 pure.xml pure.vim \ +$(examples) $(lib) $(tests) $(distlogs) + +.PHONY: all html dvi ps pdf clean realclean depend install uninstall dist \ +distcheck cleanlogs logs check + +# compilation + +all: pure + +pure: $(OBJECT) + $(CXX) -o $@ $(LDFLAGS) -rdynamic $(OBJECT) $(ALL_LIBS) + +pure.o: pure.cc + $(CXX) $(CXXFLAGS) -DVERSION='"$(version)"' -DPURELIB='"$(libdir)"' -c -o $@ $< + +lexer.cc: lexer.ll + flex -o lexer.cc $< + +parser.cc: parser.yy + bison -v -o parser.cc $< + +parser.hh location.hh position.hh stack.hh: parser.cc + +# documentation in various formats (requires groff) + +html: pure.html +dvi: pure.dvi +ps: pure.ps +pdf: pure.pdf + +%.html: %.1 + groff -man -Thtml $< > $@ + +%.dvi: %.1 + groff -man -Tdvi $< > $@ + +%.ps: %.1 + groff -man -Tps $< > $@ + +%.pdf: %.1 + groff -man -Tps $< | ps2pdf - $@ + +# cleaning + +clean: + rm -f *~ *.bak *.html *.dvi *.ps pure $(OBJECT) parser.output + +cleanlogs: + rm -f $(logs) + +realclean: clean + rm -f $(EXTRA_SOURCE) $(logs) $(dist).tar.gz + +# dependencies + +depend: $(SOURCE) $(EXTRA_SOURCE) + makedepend -Y $(SOURCE) $(EXTRA_SOURCE) 2> /dev/null + +# installation + +install: pure $(lib) + install -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(mandir) + install -s pure $(DESTDIR)$(bindir)/pure + install -m 644 $(lib) $(DESTDIR)$(libdir) + install -m 644 pure.1 $(DESTDIR)$(mandir)/pure.1 + +uninstall: + rm -rf $(DESTDIR)$(bindir)/pure $(DESTDIR)$(libdir) $(DESTDIR)$(mandir)/pure.1 + +# roll a distribution tarball + +dist: $(DISTFILES) + rm -rf $(dist) + mkdir $(dist) && mkdir $(dist)/examples && mkdir $(dist)/lib && \ +mkdir $(dist)/test + for x in $(DISTFILES); do ln -sf $$PWD/$$x $(dist)/$$x; done + rm -f $(dist).tar.gz + tar cfzh $(dist).tar.gz $(dist) + rm -rf $(dist) + +distcheck: dist + tar xfz $(dist).tar.gz + cd $(dist) && make && make check && make install DESTDIR=./BUILD + rm -rf $(dist) + +# test logs, make check + +level=7 + +logs: $(logs) + +check: pure + @ echo Running tests. + @ (export PURELIB=./lib; echo -n "prelude.pure: "; if ./pure -n -v$(level) lib/prelude.pure | diff -q - test/prelude.log > /dev/null; then echo passed; else echo FAILED; fi) + @ (cd test; export PURELIB=../lib; for x in $(tests); do f="`basename $$x`"; l="`basename $$x .pure`.log"; echo -n "$$x: "; if ../pure -v$(level) < $$f | diff -q - $$l > /dev/null; then echo passed; else echo FAILED; fi; done) + +test/prelude.log: lib/prelude.pure + PURELIB=./lib ./pure -n -v$(level) $< > $@ + +%.log: %.pure + PURELIB=./lib ./pure -v$(level) < $< > $@ + +# DO NOT DELETE + +expr.o: expr.hh interpreter.hh matcher.hh symtable.hh printer.hh runtime.h +expr.o: parser.hh stack.hh util.hh location.hh position.hh +interpreter.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh +interpreter.o: runtime.h parser.hh stack.hh util.hh location.hh position.hh +interpreter.o: expr.hh matcher.hh symtable.hh printer.hh runtime.h parser.hh +interpreter.o: stack.hh util.hh location.hh position.hh +lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h +lexer.o: parser.hh stack.hh util.hh location.hh position.hh +matcher.o: matcher.hh expr.hh +matcher.o: expr.hh +parser.o: expr.hh printer.hh matcher.hh runtime.h util.hh interpreter.hh +parser.o: symtable.hh parser.hh stack.hh location.hh position.hh +printer.o: printer.hh expr.hh matcher.hh runtime.h interpreter.hh symtable.hh +printer.o: parser.hh stack.hh util.hh location.hh position.hh +printer.o: expr.hh matcher.hh runtime.h +pure.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h +pure.o: parser.hh stack.hh util.hh location.hh position.hh +runtime.o: runtime.h expr.hh interpreter.hh matcher.hh symtable.hh printer.hh +runtime.o: parser.hh stack.hh util.hh location.hh position.hh funcall.h +symtable.o: symtable.hh expr.hh printer.hh matcher.hh runtime.h +symtable.o: expr.hh printer.hh matcher.hh runtime.h +util.o: util.hh w3centities.c +lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h +lexer.o: parser.hh stack.hh util.hh location.hh position.hh +parser.o: parser.hh stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh +parser.o: location.hh position.hh interpreter.hh symtable.hh +parser.o: stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh +parser.o: location.hh position.hh +location.o: position.hh Deleted: pure/releases/pure-0.2/NEWS =================================================================== --- pure/trunk/NEWS 2008-05-02 07:09:21 UTC (rev 29) +++ pure/releases/pure-0.2/NEWS 2008-05-04 09:30:54 UTC (rev 49) @@ -1,20 +0,0 @@ - -** Pure 0.1 2008-04-29 - -The much-awaited initial release. ;-) The interpreter is already fully -functional, but of course there's still a lot to be done (see the TODO file -for details). Please note that this is a preliminary, "beta" release, so -expect some bugs (and please report them to the author!). - -The Pure project is now hosted at SourceForge, see http://pure-lang.sf.net. A -mailing list should soon be available, too. - -See the INSTALLATION section in the README file to get up and running quickly. -After Pure is installed, read the Pure manual page (also available in various -formats from the Pure website) and have a look at the stuff in the examples -subdir, especially hello.pure, and review the standard library modules -(lib/*.pure). - -Enjoy! - -Albert Graef <Dr....@t-...> Copied: pure/releases/pure-0.2/NEWS (from rev 47, pure/trunk/NEWS) =================================================================== --- pure/releases/pure-0.2/NEWS (rev 0) +++ pure/releases/pure-0.2/NEWS 2008-05-04 09:30:54 UTC (rev 49) @@ -0,0 +1,37 @@ + +** Pure 0.2 2008-05-04 + +On the heels of Pure 0.1 comes the first bugfix release which addresses a +couple of bugs, misfeatures and Mac OSX compatibility issues, please refer to +the ChangeLog for details. I also added a more detailed INSTALL guide (thanks +are due to Eddie Rucker who wrote most of the new material in this guide) and +updated the manpage with a few minor corrections and some remarks about issues +raised on the Pure mailing list. + +Please note that there are still some issues with Pure on 64 bit systems (as +well as on Ubuntu running on PowerPC) which are still on my TODO list, these +will hopefully be fixed in the next release. + +Thanks to all who sent in bug reports and patches, in particular: Chris +Double, Tim Haynes, Eddie Rucker, Ryan Schmidt and Libor Spacek. (I hope I +didn't forget anyone.) + +** Pure 0.1 2008-04-29 + +The much-awaited initial release. ;-) The interpreter is already fully +functional, but of course there's still a lot to be done (see the TODO file +for details). Please note that this is a preliminary, "beta" release, so +expect some bugs (and please report them to the author!). + +The Pure project is now hosted at SourceForge, see http://pure-lang.sf.net. A +mailing list should soon be available, too. + +See the INSTALLATION section in the README file to get up and running quickly. +After Pure is installed, read the Pure manual page (also available in various +formats from the Pure website) and have a look at the stuff in the examples +subdir, especially hello.pure, and review the standard library modules +(lib/*.pure). + +Enjoy! + +Albert Graef <Dr....@t-...> Deleted: pure/releases/pure-0.2/README =================================================================== --- pure/trunk/README 2008-05-02 07:09:21 UTC (rev 29) +++ pure/releases/pure-0.2/README 2008-05-04 09:30:54 UTC (rev 49) @@ -1,111 +0,0 @@ - -PURE - The Pure programming language. - -Pure is a functional programming language based on term rewriting. It has a -modern syntax featuring curried function applications, lexical closures and -equational definitions with pattern matching, and thus is somewhat similar to -languages of the Haskell and ML variety. But Pure is also a very dynamic and -reflective language, and is more like Lisp in this respect. The interpreter -has an LLVM backend to do JIT compilation, hence programs run blazingly fast -and interfacing to C modules is easy. - -Please note that this is a preliminary, "beta" release, so please report bugs -to the author. Also have a look at the TODO file for stuff that still needs to -be done. - -WHERE TO GET IT - -You can find tarballs and the svn repository at http://pure-lang.sf.net. - -LICENSE - -GPL V3 or later. See the accompanying COPYING file for details. - -INSTALLATION - -The usual 'make && make install' should do the trick. (No 'configure' step -necessary.) This requires GNU make and g++. For other setups, you'll probably -have to fiddle with the Makefile and the sources. The sources should be pretty -portable, but the Makefile really needs GNU make right now. - -You'll also need LLVM (version 2.2 has been tested) for the compiler backend; -install it before compiling Pure. Instructions for installing LLVM can be -found at the LLVM website (http://llvm.org). - -By default, the program is installed under /usr/local/bin, with the library -files going into /usr/local/lib/pure. The installation directory can be -changed by editing the definition of the 'prefix' variable in the Makefile, or -by specifying the desired value on the 'make' command line, e.g.: - - make all install prefix=/usr - -Note that you should specify this option *both* at compile and installation -time since certain default paths are hardcoded into the interpreter (but can -be changed at runtime by setting corresponding environment variables, see the -manpage for details). - -There are a number of other variables you can set on the 'make' command line -if you need special compiler (CXXFLAGS) or linker flags (LDFLAGS), or if you -have to add special libraries (LIBS) like libiconv on OSX. - -After your build is done, you can (and should) also run 'make check' to verify -that your Pure interpreter works correctly. This can be done without -installing the software. In fact, there's no need to install the interpreter -if you just want to take it for a test drive, you can simply run it from the -source directory. Just make sure that you set the PURELIB environment variable -to the lib directory in the sources which holds the prelude and the other -library scripts. The following command, - - PURELIB=./lib ./pure - -will run the Pure interpreter with that setting in Bourne-compatible shells. - -For the release version, you should build the interpreter as follows: - - make build=release - -This disables all runtime checks and debugging information in the interpreter. -(Don't worry, your Pure programs will still be executed "safely" and shouldn't -segfault unless you run out of memory or there's a bug in the interpreter.) -The 'release' build gives you *much* faster execution times (factor of 2 -compared to the default flags on my Linux system running gcc 4.1, YMMV). It -also takes a *long* time to compile runtime.cc, but it's really worth the -wait, so please be patient. ;-) - -Please also have a look at the Makefile for details on the build and -installation process and other available targets and options. - -USING PURE - -Pure scripts are just ordinary text files, which can be created with any text -editor. The source directory contains Pure syntax highlighting files for Kate -and Vim (no Emacs mode yet, sorry). You might wish to install these into your -katepart/syntax and .vim/syntax directories, respectively. (For Vim you also -need to enable the syntax highlighting for .pure files; see the comments at -the beginning of pure.vim for details.) - -See the manpage ('man pure' after installation) for information on how to use -the interpreter and a brief description of the Pure language. Some example -programs can be found in the examples subdir in the sources; in particular, -have a look at the hello.pure program which will quickly give you an idea how -Pure programs look like. You should also browse the scripts in the lib -directory which contain the "built-in" definitions readily available when you -start up the Pure interpreter. - -This is currently all you get; more elaborate documentation of the Pure -language still needs to be written. But Pure is a really simple language; if -you have some experience using FPLs then you should be able to find your way -with the manpage and the provided examples. Of course, you can also post -questions to the Pure mailing list (see http://pure-lang.sf.net). - -Enjoy! :) - -AUTHOR - -Albert Graef -Dept. of Computer Music -Johannes Gutenberg University of Mainz -Germany - -<Dr....@t-...> -http://pure-lang.sf.net Copied: pure/releases/pure-0.2/README (from rev 38, pure/trunk/README) =================================================================== --- pure/releases/pure-0.2/README (rev 0) +++ pure/releases/pure-0.2/README 2008-05-04 09:30:54 UTC (rev 49) @@ -0,0 +1,68 @@ + +PURE - The Pure programming language. + +Pure is a functional programming language based on term rewriting. It has a +modern syntax featuring curried function applications, lexical closures and +equational definitions with pattern matching, and thus is somewhat similar to +languages of the Haskell and ML variety. But Pure is also a very dynamic and +reflective language, and is more like Lisp in this respect. The interpreter +has an LLVM backend to do JIT compilation, hence programs run blazingly fast +and interfacing to C modules is easy. + +Please note that this is a preliminary, "beta" release, so please report bugs +to the author. Also have a look at the TODO file for stuff that still needs to +be done. + +WHERE TO GET IT + +You can find tarballs and the svn repository at http://pure-lang.sf.net. + +LICENSE + +GPL V3 or later. See the accompanying COPYING file for details. + +INSTALLATION + +Please see the INSTALL file for detailed instructions. On most Unix-like +systems, the usual 'make && sudo make install' should do the trick. (No +'configure' step necessary.) This requires GNU make and g++. For other setups, +you'll probably have to fiddle with the Makefile and the sources. The sources +should be pretty portable, but the Makefile really needs GNU make right now. +You'll also need LLVM for the compiler backend (version 2.2 has been tested). +For your convenience, instructions for installing LLVM are also included in +the INSTALL file. + +USING PURE + +Pure scripts are just ordinary text files, which can be created with any text +editor. The source directory contains Pure syntax highlighting files for Kate +and Vim (no Emacs mode yet, sorry). You might wish to install these into your +katepart/syntax and .vim/syntax directories, respectively. (For Vim you also +need to enable the syntax highlighting for .pure files; see the comments at +the beginning of pure.vim for details.) + +See the manpage ('man pure' after installation) for information on how to use +the interpreter and a brief description of the Pure language. Some example +programs can be found in the examples subdir in the sources; in particular, +have a look at the hello.pure program which will quickly give you an idea how +Pure programs look like. You should also browse the scripts in the lib +directory which contain the "built-in" definitions readily available when you +start up the Pure interpreter. + +This is currently all you get; more elaborate documentation of the Pure +language still needs to be written. But Pure is a really simple language; if +you have some experience using FPLs then you should be able to find your way +with the manpage and the provided examples. Of course, you can also post +questions to the Pure mailing list (see http://pure-lang.sf.net). + +Enjoy! :) + +AUTHOR + +Albert Graef +Dept. of Computer Music +Johannes Gutenberg University of Mainz +Germany + +<Dr.Graef at t-online.de> +http://pure-lang.sf.net Deleted: pure/releases/pure-0.2/examples/hello.pure =================================================================== --- pure/trunk/examples/hello.pure 2008-05-02 07:09:21 UTC (rev 29) +++ pure/releases/pure-0.2/examples/hello.pure 2008-05-04 09:30:54 UTC (rev 49) @@ -1,266 +0,0 @@ - -/* This is a quick tour of Pure, starting from simple numeric calculations, - continuing with list processing, and finishing off with the recursive - manipulation of tree structures. Along the way you can see all major Pure - features at work: equational definitions, conditional expressions, - anonymous functions (lambdas), global and local variable bindings, local - function definitions, list comprehensions, access to external C functions, - and even doing some I/O with the system module. We also sketch out various - important programming techniques and tricks of the trade. So working - through these examples you should get a pretty good idea how Pure programs - look like. */ - -/* USAGE: You can run this script as 'pure hello.pure' to have it print a - friendly greeting. Or you can pipe it into the Pure interpreter with the - command 'pure < hello.pure' to print all computed results on stdout. But - usually you'll just want to run the script interactively in the Pure - interpreter, which can be done with 'pure -i hello.pure'. Or start up the - interpreter with the 'pure' command and at its command prompt enter: - - run hello.pure - - Note that the interactive input language of the interpreter is the full - Pure language, so you can also enter any of the definitions here directly - at the interpreter's prompt. In an interactive session, the interpreter - also understands some additional commands useful for interactive usage; - type 'help' in the interpreter to learn more about this. */ - -/* Let's start with the traditional hello world program. In Pure we need the - system module to do I/O, so we import that first. */ - -using system; -puts "Hello, world!"; - -/* Ok, with that out of the way, let's get on to more serious things. Most of - the time you'll be defining functions to do some calculations. As you'd - rightfully expect from a functional language, Pure makes that quite easy: */ - -// Just a simple function which squares its argument x. -square x = x*x; - -// You can evaluate things by just typing the expression, terminated with ';'. -square 5; square (a+b); - -// You can also bind a global ("free") variable symbol to a value. -let x = square 5; x; - -// Pattern matching definition with 'let'. -let x, y = square x, square (x+2); x; y; - -/* Variations on a theme: The factorial. This illustrates various different - ways to define a simple recursive function. */ - -// Guarded rules. - -fact1 n = n*fact1 (n-1) if n>0; - = 1 otherwise; - -let x = fact1 10; - -// This is essentially the same, but uses a 'case' expression. - -fact2 n = case n of - n = n*fact2 (n-1) if n>0; - = 1 otherwise; - end; - -// Using pattern matching (note the constant pattern on the lhs of eqn. #1). - -fact3 0 = 1; -fact3 n = n*fact3 (n-1) if n>0; - -// Using 'if-then-else'. - -fact4 n = if n>0 then n*fact4 (n-1) else 1; - -// Using lambda ("pointless style"). - -fact5 = \n -> if n>0 then n*fact5 (n-1) else 1; - -// Using fixed points. This technique allows you to define a recursive -// function without referring to the name of the function in its body. See -// http://en.wikipedia.org/wiki/Fixed_point_combinator for an explanation. - -fact6 = Z (\f n -> if n<=0 then 1 else n*f (n-1)); -Z = \f -> (\x -> f (\y -> x x y)) (\x -> f (\y -> x x y)); - -// These should all evaluate to the same list of the first 10 factorials. - -map fact1 (1..10); -map fact2 (1..10); -map fact3 (1..10); -map fact4 (1..10); -map fact5 (1..10); -map fact6 (1..10); - -/* Various different implementations of the Fibonacci function. Shows the use - of 'when' to perform local variable bindings and 'with' to define local - functions, and how to make a definition tail-recursive so that it runs in - constant stack space. */ - -// Naive O(fib n) implementation. Try fib1 35 to see how slow it is. - -fib1 0 = 0; -fib1 1 = 1; -fib1 n = fib1 (n-2) + fib1 (n-1) if n>1; - -// O(n) implementation, using a local function which generates the Fibonacci -// numbers in pairs. Much faster (try fib2 35 to see the change). - -fib2 n = a when a, b = fibs n end - with fibs n = 0, 1 if n<=0; - = b, a+b when a, b = fibs (n-1) end - otherwise; - end; - -// Tail-recursive version, with an "accumulating parameter". This one runs in -// constant stack space. It also uses bigints so that the arithmetically -// correct values are computed for large n. - -fib3 n = a when a, b = fibs (0, 1) n end - with fibs (a, b) n = a, b if n<=0; - = fibs (b, bigint a+b) (n-1) otherwise; - end; - -map fib1 (1..10); -map fib2 (1..10); -map fib3 (1..50); - -/* Ok, enough numbers already. Let's play around with lists! First, the - obligatory quicksort function. This isn't really the fastest version of the - algorithm, but it shows off the elegance of Pure and teaches us several - important lessons: How to perform pattern-matching on structured data; how - to deal with function arguments (the order predicate p in this case); how - to define local "convenience operators" to make definitions more readable - ('<' and '>=' in this example, which we redefine in terms of the order - predicate p); and how to generate lists using list comprehensions. All in - the same little 2.5-liner. ;-) */ - -qsort p [] = []; -qsort p (x:xs) = qsort p [l; l = xs; l<x] + (x : qsort p [r; r = xs; r>=x]) - with x<y = p x y; x>=y = not p x y end; - -qsort (<) (1..20); // ascending sort, no-op in this case -qsort (>) (1..20); // descending sort, reverses the list in this case - -/* Let's now test our quicksort with random inputs. This shows how quickly and - painlessly you can access functions from the C library in Pure (the random - number generator 'rand' in this example). */ - -extern int rand(); - -qsort (<) [rand; i = 1..20]; // sort 20 random numbers in ascending order -qsort (>) [rand; i = 1..20]; // sort 20 random numbers in descending order - -/* Erathosthenes' classical prime sieve. Another example showing the beauty - and usefulness of list comprehensions. */ - -primes n = sieve (2..n) with - sieve [] = []; - sieve (p:qs) = p : sieve [q; q = qs; q mod p]; -end; - -primes 100; - -/* The classical n queens problem: Compute all placements of n queens on an - n x n board so that no two queens hold each other in check. This algorithm - demonstrates how you can use list comprehensions to organize backtracking - searches. */ - -queens n = search n 1 [] -with - search n i p = [reverse p] if i>n; - = cat [search n (i+1) ((i,j):p); j = 1..n; safe (i,j) p]; - safe (i,j) p = not any (check (i,j)) p; - check (i1,j1) (i2,j2) - = i1==i2 || j1==j2 || i1+j1==i2+j2 || i1-j1==i2-j2; -end; - -/* The following version uses catch/throw for non-local value returns, in - order to compute only the first solution. If no solution is found, () is - returned. */ - -queens1 n = catch reverse (search n 1 []) -with - search n i p = throw p if i>n; - = void [search n (i+1) ((i,j):p); j = 1..n; safe (i,j) p]; - safe (i,j) p = not any (check (i,j)) p; - check (i1,j1) (i2,j2) - = i1==i2 || j1==j2 || i1+j1==i2+j2 || i1-j1==i2-j2; -end; - -/* Our final version makes best use of tail recursion to avoid the - construction of intermediate list values and thereby makes the algorithm - run a little faster and in less space. It's also slightly more tricky. In - particular, have a look at the guard in eqn. #2 of the search function - which first recurses on solutions which place the ith queen into column j - (after checking that it's safe there) and then backs out (makes the guard - fail) to pursue alternative solution paths in eqn. #3. */ - -queens2 n = catch reverse (search n 1 1 []) -with - search n i j p - = throw p if i>n; - = () if safe (i,j) p && - (0 when _ = search n (i+1) 1 ((i,j):p) end); - = search n i (j+1) p if j<n; - = () otherwise; - safe (i,j) p = not any (check (i,j)) p; - check (i1,j1) (i2,j2) - = i1==i2 || j1==j2 || i1+j1==i2+j2 || i1-j1==i2-j2; -end; - -// The first expression here evaluates to the number of solutions for the 8 -// queens problem. The other two expressions should both yield the same first -// solution. -#queens 8; -queens1 8; -queens2 8; - -/* Here's how you can print all solutions in a nice format, using some of the - I/O functions from the system module. */ - -print_queens ps = do (puts.join " ".map (sprintf "%d,%d")) ps; - -// Try this when running interactively: -//print_queens (queens 8); - -/* Lists are all good and fine, but what about other, more complicated kinds - of data? Luckily, as a term rewriting language Pure is well-suited to - process any kind of tree-structured data. We only discuss a simple example - here, but using similar, more elaborate techniques like AVL trees, it is - possible to implement almost any kind of container data structure in an - efficient way. - - So let's see how we can implement simple binary search trees in Pure. These - are represented using the constant symbol 'nil' (which denotes the empty - tree) and the constructor application 'bin x L R', where x denotes the - value at the top of the tree, and L and R are the left and right subtrees, - respectively. In Pure, constructor symbols like 'bin' don't have to be - declared, since they are just ordinary function symbols without any - defining equations, but we do need to declare the 'nil' symbol so that the - compiler knows that this symbol denotes a constant and doesn't mistake it - for a variable when it occurs on the left-hand side of an equation. */ - -nullary nil; - -/* The tree insertion operation. This assumes that the tree elements can be - compared using '<'. */ - -insert nil y = bin y nil nil; -insert (bin x L R) y = bin x (insert L y) R if y<x; - = bin x L (insert R y) otherwise; - -/* Create a tree from a list of elements. */ - -bintree xs = foldl insert nil xs; - -/* Do an inorder traversal of the tree to obtain the (now sorted) list of - elements. */ - -members nil = []; -members (bin x L R) = members L + (x:members R); - -// A random example: - -let xs = [rand; i = 1..20]; let T = bintree xs; xs; T; members T; Copied: pure/releases/pure-0.2/examples/hello.pure (from rev 46, pure/trunk/examples/hello.pure) =================================================================== --- pure/releases/pure-0.2/examples/hello.pure (rev 0) +++ pure/releases/pure-0.2/examples/hello.pure 2008-05-04 09:30:54 UTC (rev 49) @@ -0,0 +1,266 @@ + +/* This is a quick tour of Pure, starting from simple numeric calculations, + continuing with list processing, and finishing off with the recursive + manipulation of tree structures. Along the way you can see all major Pure + features at work: equational definitions, conditional expressions, + anonymous functions (lambdas), global and local variable bindings, local + function definitions, list comprehensions, access to external C functions, + and even doing some I/O with the system module. We also sketch out various + important programming techniques and tricks of the trade. So working + through these examples you should get a pretty good idea how Pure programs + look like. */ + +/* USAGE: You can run this script as 'pure hello.pure' to have it print a + friendly greeting. Or you can pipe it into the Pure interpreter with the + command 'pure < hello.pure' to print all computed results on stdout. But + usually you'll just want to run the script interactively in the Pure + interpreter, which can be done with 'pure -i hello.pure'. Or start up the + interpreter with the 'pure' command and at its command prompt enter: + + run hello.pure + + Note that the interactive input language of the interpreter is the full + Pure language, so you can also enter any of the definitions here directly + at the interpreter's prompt. In an interactive session, the interpreter + also understands some additional commands useful for interactive usage; + type 'help' in the interpreter to learn more about this. */ + +/* Let's start with the traditional hello world program. In Pure we need the + system module to do I/O, so we import that first. */ + +using system; +puts "Hello, world!"; + +/* Ok, with that out of the way, let's get on to more serious things. Most of + the time you'll be defining functions to do some calculations. As you'd + rightfully expect from a functional language, Pure makes that quite easy: */ + +// Just a simple function which squares its argument x. +square x = x*x; + +// You can evaluate things by just typing the expression, terminated with ';'. +square 5; square (a+b); + +// You can also bind a global ("free") variable symbol to a value. +let x = square 5; x; + +// Pattern matching definition with 'let'. +let x, y = square x, square (x+2); x; y; + +/* Variations on a theme: The factorial. This illustrates various different + ways to define a simple recursive function. */ + +// Guarded rules. + +fact1 n = n*fact1 (n-1) if n>0; + = 1 otherwise; + +let x = fact1 10; + +// This is essentially the same, but uses a 'case' expression. + +fact2 n = case n of + n = n*fact2 (n-1) if n>0; + = 1 otherwise; + end; + +// Using pattern matching (note the constant pattern on the lhs of eqn. #1). + +fact3 0 = 1; +fact3 n = n*fact3 (n-1) if n>0; + +// Using 'if-then-else'. + +fact4 n = if n>0 then n*fact4 (n-1) else 1; + +// Using lambda ("pointless style"). + +fact5 = \n -> if n>0 then n*fact5 (n-1) else 1; + +// Using fixed points. This technique allows you to define a recursive +// function without referring to the name of the function in its body. See +// http://en.wikipedia.org/wiki/Fixed_point_combinator for an explanation. + +fact6 = Z (\f n -> if n<=0 then 1 else n*f (n-1)); +Z = \f -> (\x -> f (\y -> x x y)) (\x -> f (\y -> x x y)); + +// These should all evaluate to the same list of the first 10 factorials. + +map fact1 (1..10); +map fact2 (1..10); +map fact3 (1..10); +map fact4 (1..10); +map fact5 (1..10); +map fact6 (1..10); + +/* Various different implementations of the Fibonacci function. Shows the use + of 'when' to perform local variable bindings and 'with' to define local + functions, and how to make a definition tail-recursive so that it runs in + constant stack space. */ + +// Naive O(fib n) implementation. Try fib1 35 to see how slow it is. + +fib1 0 = 0; +fib1 1 = 1; +fib1 n = fib1 (n-2) + fib1 (n-1) if n>1; + +// O(n) implementation, using a local function which generates the Fibonacci +// numbers in pairs. Much faster (try fib2 35 to see the change). + +fib2 n = a when a, b = fibs n end + with fibs n = 0, 1 if n<=0; + = b, a+b when a, b = fibs (n-1) end + otherwise; + end; + +// Tail-recursive version, with an "accumulating parameter". This one runs in +// constant stack space. It also uses bigints so that the arithmetically +// correct values are computed for large n. + +fib3 n = a when a, b = fibs (0G, 1G) n end + with fibs (a, b) n = a, b if n<=0; + = fibs (b, a+b) (n-1) otherwise; + end; + +map fib1 (1..10); +map fib2 (1..10); +map fib3 (1..50); + +/* Ok, enough numbers already. Let's play around with lists! First, the + obligatory quicksort function. This isn't really the fastest version of the + algorithm, but it shows off the elegance of Pure and teaches us several + important lessons: How to perform pattern-matching on structured data; how + to deal with function arguments (the order predicate p in this case); how + to define local "convenience operators" to make definitions more readable + ('<' and '>=' in this example, which we redefine in terms of the order + predicate p); and how to generate lists using list comprehensions. All in + the same little 2.5-liner. ;-) */ + +qsort p [] = []; +qsort p (x:xs) = qsort p [l; l = xs; l<x] + (x : qsort p [r; r = xs; r>=x]) + with x<y = p x y; x>=y = not p x y end; + +qsort (<) (1..20); // ascending sort, no-op in this case +qsort (>) (1..20); // descending sort, reverses the list in this case + +/* Let's now test our quicksort with random inputs. This shows how quickly and + painlessly you can access functions from the C library in Pure (the random + number generator 'rand' in this example). */ + +extern int rand(); + +qsort (<) [rand; i = 1..20]; // sort 20 random numbers in ascending order +qsort (>) [rand; i = 1..20]; // sort 20 random numbers in descending order + +/* Erathosthenes' classical prime sieve. Another example showing the beauty + and usefulness of list comprehensions. */ + +primes n = sieve (2..n) with + sieve [] = []; + sieve (p:qs) = p : sieve [q; q = qs; q mod p]; +end; + +primes 100; + +/* The classical n queens problem: Compute all placements of n queens on an + n x n board so that no two queens hold each other in check. This algorithm + demonstrates how you can use list comprehensions to organize backtracking + searches. */ + +queens n = search n 1 [] +with + search n i p = [reverse p] if i>n; + = cat [search n (i+1) ((i,j):p); j = 1..n; safe (i,j) p]; + safe (i,j) p = not any (check (i,j)) p; + check (i1,j1) (i2,j2) + = i1==i2 || j1==j2 || i1+j1==i2+j2 || i1-j1==i2-j2; +end; + +/* The following version uses catch/throw for non-local value returns, in + order to compute only the first solution. If no solution is found, () is + returned. */ + +queens1 n = catch reverse (search n 1 []) +with + search n i p = throw p if i>n; + = void [search n (i+1) ((i,j):p)... [truncated message content] |
From: <ag...@us...> - 2008-06-09 22:26:03
|
Revision: 197 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=197&view=rev Author: agraef Date: 2008-06-09 15:26:09 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Snapshot of Pure 0.3. Added Paths: ----------- pure/releases/pure-0.3/ pure/releases/pure-0.3/ChangeLog pure/releases/pure-0.3/INSTALL pure/releases/pure-0.3/Makefile.in pure/releases/pure-0.3/NEWS pure/releases/pure-0.3/README pure/releases/pure-0.3/aclocal.m4 pure/releases/pure-0.3/config.guess pure/releases/pure-0.3/config.h.in pure/releases/pure-0.3/config.sub pure/releases/pure-0.3/configure pure/releases/pure-0.3/configure.ac pure/releases/pure-0.3/examples/myutils.pure pure/releases/pure-0.3/examples/symbolic.pure pure/releases/pure-0.3/install-sh pure/releases/pure-0.3/interpreter.cc pure/releases/pure-0.3/interpreter.hh pure/releases/pure-0.3/lexer.ll pure/releases/pure-0.3/lib/system.pure pure/releases/pure-0.3/pure.1 pure/releases/pure-0.3/pure.cc pure/releases/pure-0.3/runtime.cc pure/releases/pure-0.3/runtime.h pure/releases/pure-0.3/util.cc Removed Paths: ------------- pure/releases/pure-0.3/ChangeLog pure/releases/pure-0.3/INSTALL pure/releases/pure-0.3/Makefile pure/releases/pure-0.3/NEWS pure/releases/pure-0.3/README pure/releases/pure-0.3/examples/symbolic.pure pure/releases/pure-0.3/interpreter.cc pure/releases/pure-0.3/interpreter.hh pure/releases/pure-0.3/lexer.ll pure/releases/pure-0.3/lib/system.pure pure/releases/pure-0.3/pure.1 pure/releases/pure-0.3/pure.cc pure/releases/pure-0.3/runtime.cc pure/releases/pure-0.3/runtime.h pure/releases/pure-0.3/util.cc Copied: pure/releases/pure-0.3 (from rev 164, pure/trunk) Deleted: pure/releases/pure-0.3/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-06-01 20:14:57 UTC (rev 164) +++ pure/releases/pure-0.3/ChangeLog 2008-06-09 22:26:09 UTC (rev 197) @@ -1,324 +0,0 @@ -2008-06-01 Albert Graef <Dr....@t-...> - - * Makefile, interpreter.cc: Put the runtime and interpreter into a - separate shared library, to make it possible for modules to link - against the runtime, and to reduce the memory footprint when - multiple instances of the interpreter are run as different - processes. Also, this makes it possible to access the runtime - routines on systems where a program cannot dlopen itself. - -2008-05-28 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Optimization pure_freenew calls. - - * lib/strings.pure: Make 'cycle' work on strings. Reported by - Eddie Rucker. - - * lib/prelude.pure: Make 'index' work on lists. Code contributed - by Eddie Rucker. - -2008-05-27 Albert Graef <Dr....@t-...> - - * lib/prelude.pure: Rewrite prelude operations to make them - tail-recursive. - - * interpreter.cc (toplevel_codegen): Experimental support for - tail-recursive logical operators (&& and ||). This works but is - disabled, since it makes these operations behave in different ways - depending on the context, which is a really bad idea because it - violates referential transparency. - -2008-05-26 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Overhaul of the shadow stack - machinery. Environment vectors are now maintained on the shadow - stack, so that all local functions and anonymous closures are - eligible for tail call optimization, even if they need access to - their environment. - -2008-05-25 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Add marshalling between long (64 - bit) ints and Pure bigints in the C interface. This means that - both Pure ints and bigints can now be passed for 'long' arguments - of externals (with sign extension/truncation as necessary), and - 'long' values are promoted to Pure bigints on return. Hence C - functions taking 64 bit integers as arguments and returning them - as results can now be called from Pure without loosing bits due to - truncation. - - * interpreter.cc: Make toplevel if-then-else properly - tail-recursive. Thus, e.g., the following function will now run in - constant stack space: count x = if x<=0 then x else count (x-1); - This also works with nested if-then-else constructs, as long as - they form the right-hand side of an equation. - -2008-05-24 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Fix more memory allocation bugs in - exception handling. - - * runtime.cc, lib/system.pure: Bugfixes in the scanf - functions. Reported by Jiri Spitz. - - * pure.cc, runtime.cc, util.cc: Windows/MinGW compatibility - fixes. Suggested by Jiri Spitz. - -2008-05-23 Albert Graef <Dr....@t-...> - - * runtime.cc: Fix premature freeing of eval result, and a minor - memory allocation glitch in the catch function. Reported by Eddie - Rucker. - - * Makefile: Bump version number. - - * interpreter.cc: If there are any child environments, doeval and - dodefn both create semi-permanent environments now, so that the - child environments and the corresponding LLVM IR survive for the - entire lifetime of any embedded closures, which might still be - called at a later time. This fixes the segfaults occurring when a - closure gets called after its associated environment was purged. A - partial fix for some situations (as reported earlier by Chris - Double) was already in the 0.2 release, but this didn't deal with - all cases, such as closures constructed in a call to the eval - function, as reported by Eddie Rucker. - -2008-05-22 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Major overhaul of expression memory - handling. Fixed the shadow stack and memory debugging code. Both - function arguments and environment are now visible on the shadow - stack, and all remaining memory leaks have been fixed. Note that, - compared to previous revisions, the shadow stack slows down - compiled code by some 10% and it needs some additional memory. - OTOH, it also provides additional data that will be needed in the - planned symbolic debugger, and it seems to be the most efficient - way to handle dangling expression pointers after an exception - anyway. - -2008-05-17 Albert Graef <Dr....@t-...> - - * runtime.cc (pure_free_internal): Fixed a glitch which was - causing big memleaks. Reported by Libor Spacek. - - * interpreter.cc (define): Fixed error messages. - - * interpreter.cc, runtime.h: Reorganize pure_expr data structure - so that the data fields are *always* aligned on 8 byte boundaries. - This should now also work on 32 bit architectures where doubles - are aligned on 8 byte boundaries, such as Linux on 32 bit PPC. - Reported by Tim Haynes. - - * interpreter.cc: Fixed some case labels in switch instructions - which should be signed rather than unsigned values. Also made - void* a pointer to a dummy struct in LLVM IR, so that it can be - distinguished from all other pointer types, and added support for - short (16 bit) and long (64 bit) integer types (as well as the - corresponding pointer types) in the C interface. - - Please note that the typename 'long' *always* denotes signed 64 - bit integers in Pure's extern declarations, even if the C 'long' - type is actually 32 bit (as it usually is even on most 64 bit - systems). - -2008-05-16 Albert Graef <Dr....@t-...> - - * runtime.h: Fix compilation problems when header gets included - from C. - -2008-05-14 Albert Graef <Dr....@t-...> - - * funcall.h: Reduce maximum number of function parameters to - 64. This seems to be large enough for most purposes, and speeds up - compilation with -Ox by a factor of around 10. - - * Makefile: Overhaul of build options. In particular, the - 'default' build now includes basic optimization (-O) which makes - the interpreter almost as fast as with the 'release' build, and - produces a working interpreter also on 64 bit systems. (The - 'debug' build is still broken there, but see the SYSTEM NOTES - section in the INSTALL file for a workaround.) - - * interpreter.cc, runtime.cc: 64 bit compatibility fixes in bigint - handling. - -2008-05-12 Albert Graef <Dr....@t-...> - - * interpreter.cc: Fix a severe bug in the environment handling - code of the code generator, which could cause failed assertions in - the code generator, or wrong code to be generated in some cases. - To resolve this issue, the code generator now properly keeps - separate environments for each rule of a function - definition. Reported by John Lunney. - - * Makefile: Redirect warning and error messages from regression - tests to the logfile. - -2008-05-10 Albert Graef <Dr....@t-...> - - * interpreter.cc (uminop): Handle the value -0x80000000 at the - border of the int range, so that it is correctly treated as a - machine int. - -2008-05-09 Albert Graef <Dr....@t-...> - - * lexer.ll, printer.cc, etc.: Change the "G" suffix to denote - bigints to "L" ("G" can too easily be mistaken for a digit; also, - Python uses the same "L" notation for bigints). Reported by Eddie - Rucker. - -2008-05-06 Albert Graef <Dr....@t-...> - - * lib/primitives.pure: Made the pow function work with all - combinations of integer and double arguments. Also added the sqrt - function and the ^ operator. - - * runtime.cc, lib/primitives.pure: Added predicates funp, lambdap, - varp checking for named and anonymous closures and unbound global - variables, respectively. Requested by Libor Spacek. - - * interpreter.cc (declare_extern, fun_prolog): Handle some obscure - cases of name collisions between Pure and C functions. - -2008-05-05 Albert Graef <Dr....@t-...> - - * INSTALL: Add system-specific notes. - - * Makefile: Massaged some rules for OSX compatibility. In - particular, -rdynamic is now in the LDFLAGS, so that it can be - removed more easily, and I also removed the install -s flag so - that the pure executable is installed without stripping the - symbols which are needed to properly resolve runtime externals on - OSX. Reported by Ryan Schmidt and others. - - * matcher.cc (merge_ctrans): Fixed broken mpz_cmp() test causing - transitions on different (instead of equal) bigint constants to be - merged. Reported by Libor Spacek. - -2008-05-04 Albert Graef <Dr....@t-...> - - * 0.2 release. - - * lexer.ll, printer.cc: Add an explicit notation for big - integers. Any integer immediately followed by the uppercase letter - "G" (as in "biG" or "GMP") will now always be interpreted as a - bigint constant, even if it fits into a machine integer. This - notation is also used when printing bigint constants. This change - was necessary to make it possible to write rules matching against - "small bigint" constants. - - * lib/primitives.pure: Added operations to recognize function - applications and extract the function and argument parts, - implemented in runtime.cc. Note that these operations can't be - defined in Pure because of the "head is function" rule which means - that in a pattern of the form f x, f is always a literal function - symbol and not a variable. - -2008-05-03 Albert Graef <Dr....@t-...> - - * README: Moved installation instructions to a separate INSTALL - file, added Eddie Rucker's detailed instructions there. - - * util.cc (myiconv): Apple's iconv takes const char** as 2nd - parameter. #ifdef that case. Reported by Ryan Schmidt. - - * interpreter.cc (declare_extern): Fixed a bug in the generated - wrapper code for external calls, which caused function arguments - to be garbage-collected prematurely, when they were still needed - to create the default value, in the case of external calls - returning a null expression pointer to indicate failure. Reported - by Eddie Rucker. - - * test/test4.pure: Disabled tail call checks, as they may fail on - some platforms. Reported by Ryan Schmidt. - - * test/test1.pure: Corrected fact3 example, added test cases. - Reported by Libor Spacek. - -2008-05-02 Albert Graef <Dr....@t-...> - - * Makefile: Overhaul of regression tests so that results of - expressions are recorded. Also, 'make check' doesn't depend on the - log files any more, so that the logs can be stored in svn. You can - now use the explicit goal 'make logs' to regenerate the logs for - changed test files. - - * runtime.cc (same): Added a syntactic equality test. Requested by - Eddie Rucker. - - * Makefile: Add $(LDFLAGS) and $(LIBS) to the link line, so that - the user can easily add his own linker options and local - libraries. - - * lib/strings.pure: Add missing range check in string indexing - operation. Reported by Eddie Rucker. - - * printer.cc (operator <<): Handle stack overflow while printing - an expression. - - * interpreter.cc (dodefn): Fix a tricky bug causing the executable - code of closures bound to variables to be freed when it was still - needed. Reported by Chris Double. - -2008-05-01 Albert Graef <Dr....@t-...> - - * interpreter.cc: Proper alignment of value fields in expression - struct on 64 bit systems. Reported by Tim Haynes. - - * Makefile: g++ shouldn't be hardcoded, use $(CXX) instead. - Reported by Ryan Schmidt. - - * runtime.cc (pure_sys_vars): More OSX compatibility fixes. - Reported by Ryan Schmidt. - -2008-04-30 Albert Graef <Dr....@t-...> - - * interpreter.cc: Fix a compilation error (STL bug: - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729) as well as some - bogus warnings with Apple gcc 4.0.1. Reported by Ryan Schmidt. - - * Makefile (make depend): Get rid of bogus LLVM dependencies. - Reported by Ryan Schmidt. - - * lexer.ll, parser.yy: Fixes for compatibility with newer flex and - bison versions. Reported by Eddie Rucker. - -2008-04-29 Albert Graef <Dr....@t-...> - - * 0.1 release. - -2008-04-28 Albert Graef <Dr....@t-...> - - * examples/symbolic.pure: Add symbolic evaluation example. This is - just a straightforward port of some Q examples. - - * runtime.cc: Add support for advisory stack checks. - - * matcher.cc: Bugfixes. - -2008-04-27 Albert Graef <Dr....@t-...> - - * lib/string.pure: Added split and join functions. - - * pure.1, examples/hello.pure: Overhaul n queens example, added - quicksort and binary search tree examples. - - * lib/prelude.pure: Added void and curry/uncurry combinators, do, - zipdo. - - * interpreter.cc, pure.cc, runtime.cc: Make SIGINT generate a - useful exception value. - - * pure.cc: Add completion for global function and variable - symbols. - -2008-04-22 Albert Graef <Dr....@t-...> - - * Got a working interpreter, at last. There's still lots of stuff - to do (see the TODO file), but the interpreter should now be - usable as it is. - -2008-03-27 Albert Graef <Dr....@t-...> - - * ChangeLog started - Copied: pure/releases/pure-0.3/ChangeLog (from rev 192, pure/trunk/ChangeLog) =================================================================== --- pure/releases/pure-0.3/ChangeLog (rev 0) +++ pure/releases/pure-0.3/ChangeLog 2008-06-09 22:26:09 UTC (rev 197) @@ -0,0 +1,332 @@ +2008-06-06 Albert Graef <Dr....@t-...> + + * 0.3 release. + + * configure.ac, etc.: Added autoconf support. Various fixes for 64 + bit and Windows compatibility. See the INSTALL file for updated + installation instructions. + +2008-06-01 Albert Graef <Dr....@t-...> + + * Makefile, interpreter.cc: Put the runtime and interpreter into a + separate shared library, to make it possible for modules to link + against the runtime, and to reduce the memory footprint when + multiple instances of the interpreter are run as different + processes. Also, this makes it possible to access the runtime + routines on systems where a program cannot dlopen itself. + +2008-05-28 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Optimization of pure_freenew calls. + + * lib/strings.pure: Make 'cycle' work on strings. Reported by + Eddie Rucker. + + * lib/prelude.pure: Make 'index' work on lists. Code contributed + by Eddie Rucker. + +2008-05-27 Albert Graef <Dr....@t-...> + + * lib/prelude.pure: Rewrite prelude operations to make them + tail-recursive. + + * interpreter.cc (toplevel_codegen): Experimental support for + tail-recursive logical operators (&& and ||). This works but is + disabled, since it makes these operations behave in different ways + depending on the context, which is a really bad idea because it + violates referential transparency. + +2008-05-26 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Overhaul of the shadow stack + machinery. Environment vectors are now maintained on the shadow + stack, so that all local functions and anonymous closures are + eligible for tail call optimization, even if they need access to + their environment. + +2008-05-25 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Add marshalling between long (64 + bit) ints and Pure bigints in the C interface. This means that + both Pure ints and bigints can now be passed for 'long' arguments + of externals (with sign extension/truncation as necessary), and + 'long' values are promoted to Pure bigints on return. Hence C + functions taking 64 bit integers as arguments and returning them + as results can now be called from Pure without loosing bits due to + truncation. + + * interpreter.cc: Make toplevel if-then-else properly + tail-recursive. Thus, e.g., the following function will now run in + constant stack space: count x = if x<=0 then x else count (x-1); + This also works with nested if-then-else constructs, as long as + they form the right-hand side of an equation. + +2008-05-24 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Fix more memory allocation bugs in + exception handling. + + * runtime.cc, lib/system.pure: Bugfixes in the scanf + functions. Reported by Jiri Spitz. + + * pure.cc, runtime.cc, util.cc: Windows/MinGW compatibility + fixes. Suggested by Jiri Spitz. + +2008-05-23 Albert Graef <Dr....@t-...> + + * runtime.cc: Fix premature freeing of eval result, and a minor + memory allocation glitch in the catch function. Reported by Eddie + Rucker. + + * Makefile: Bump version number. + + * interpreter.cc: If there are any child environments, doeval and + dodefn both create semi-permanent environments now, so that the + child environments and the corresponding LLVM IR survive for the + entire lifetime of any embedded closures, which might still be + called at a later time. This fixes the segfaults occurring when a + closure gets called after its associated environment was purged. A + partial fix for some situations (as reported earlier by Chris + Double) was already in the 0.2 release, but this didn't deal with + all cases, such as closures constructed in a call to the eval + function, as reported by Eddie Rucker. + +2008-05-22 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Major overhaul of expression memory + handling. Fixed the shadow stack and memory debugging code. Both + function arguments and environment are now visible on the shadow + stack, and all remaining memory leaks have been fixed. Note that, + compared to previous revisions, the shadow stack slows down + compiled code by some 10% and it needs some additional memory. + OTOH, it also provides additional data that will be needed in the + planned symbolic debugger, and it seems to be the most efficient + way to handle dangling expression pointers after an exception + anyway. + +2008-05-17 Albert Graef <Dr....@t-...> + + * runtime.cc (pure_free_internal): Fixed a glitch which was + causing big memleaks. Reported by Libor Spacek. + + * interpreter.cc (define): Fixed error messages. + + * interpreter.cc, runtime.h: Reorganize pure_expr data structure + so that the data fields are *always* aligned on 8 byte boundaries. + This should now also work on 32 bit architectures where doubles + are aligned on 8 byte boundaries, such as Linux on 32 bit PPC. + Reported by Tim Haynes. + + * interpreter.cc: Fixed some case labels in switch instructions + which should be signed rather than unsigned values. Also made + void* a pointer to a dummy struct in LLVM IR, so that it can be + distinguished from all other pointer types, and added support for + short (16 bit) and long (64 bit) integer types (as well as the + corresponding pointer types) in the C interface. + + Please note that the typename 'long' *always* denotes signed 64 + bit integers in Pure's extern declarations, even if the C 'long' + type is actually 32 bit (as it usually is even on most 64 bit + systems). + +2008-05-16 Albert Graef <Dr....@t-...> + + * runtime.h: Fix compilation problems when header gets included + from C. + +2008-05-14 Albert Graef <Dr....@t-...> + + * funcall.h: Reduce maximum number of function parameters to + 64. This seems to be large enough for most purposes, and speeds up + compilation with -Ox by a factor of around 10. + + * Makefile: Overhaul of build options. In particular, the + 'default' build now includes basic optimization (-O) which makes + the interpreter almost as fast as with the 'release' build, and + produces a working interpreter also on 64 bit systems. (The + 'debug' build is still broken there, but see the SYSTEM NOTES + section in the INSTALL file for a workaround.) + + * interpreter.cc, runtime.cc: 64 bit compatibility fixes in bigint + handling. + +2008-05-12 Albert Graef <Dr....@t-...> + + * interpreter.cc: Fix a severe bug in the environment handling + code of the code generator, which could cause failed assertions in + the code generator, or wrong code to be generated in some cases. + To resolve this issue, the code generator now properly keeps + separate environments for each rule of a function + definition. Reported by John Lunney. + + * Makefile: Redirect warning and error messages from regression + tests to the logfile. + +2008-05-10 Albert Graef <Dr....@t-...> + + * interpreter.cc (uminop): Handle the value -0x80000000 at the + border of the int range, so that it is correctly treated as a + machine int. + +2008-05-09 Albert Graef <Dr....@t-...> + + * lexer.ll, printer.cc, etc.: Change the "G" suffix to denote + bigints to "L" ("G" can too easily be mistaken for a digit; also, + Python uses the same "L" notation for bigints). Reported by Eddie + Rucker. + +2008-05-06 Albert Graef <Dr....@t-...> + + * lib/primitives.pure: Made the pow function work with all + combinations of integer and double arguments. Also added the sqrt + function and the ^ operator. + + * runtime.cc, lib/primitives.pure: Added predicates funp, lambdap, + varp checking for named and anonymous closures and unbound global + variables, respectively. Requested by Libor Spacek. + + * interpreter.cc (declare_extern, fun_prolog): Handle some obscure + cases of name collisions between Pure and C functions. + +2008-05-05 Albert Graef <Dr....@t-...> + + * INSTALL: Add system-specific notes. + + * Makefile: Massaged some rules for OSX compatibility. In + particular, -rdynamic is now in the LDFLAGS, so that it can be + removed more easily, and I also removed the install -s flag so + that the pure executable is installed without stripping the + symbols which are needed to properly resolve runtime externals on + OSX. Reported by Ryan Schmidt and others. + + * matcher.cc (merge_ctrans): Fixed broken mpz_cmp() test causing + transitions on different (instead of equal) bigint constants to be + merged. Reported by Libor Spacek. + +2008-05-04 Albert Graef <Dr....@t-...> + + * 0.2 release. + + * lexer.ll, printer.cc: Add an explicit notation for big + integers. Any integer immediately followed by the uppercase letter + "G" (as in "biG" or "GMP") will now always be interpreted as a + bigint constant, even if it fits into a machine integer. This + notation is also used when printing bigint constants. This change + was necessary to make it possible to write rules matching against + "small bigint" constants. + + * lib/primitives.pure: Added operations to recognize function + applications and extract the function and argument parts, + implemented in runtime.cc. Note that these operations can't be + defined in Pure because of the "head is function" rule which means + that in a pattern of the form f x, f is always a literal function + symbol and not a variable. + +2008-05-03 Albert Graef <Dr....@t-...> + + * README: Moved installation instructions to a separate INSTALL + file, added Eddie Rucker's detailed instructions there. + + * util.cc (myiconv): Apple's iconv takes const char** as 2nd + parameter. #ifdef that case. Reported by Ryan Schmidt. + + * interpreter.cc (declare_extern): Fixed a bug in the generated + wrapper code for external calls, which caused function arguments + to be garbage-collected prematurely, when they were still needed + to create the default value, in the case of external calls + returning a null expression pointer to indicate failure. Reported + by Eddie Rucker. + + * test/test4.pure: Disabled tail call checks, as they may fail on + some platforms. Reported by Ryan Schmidt. + + * test/test1.pure: Corrected fact3 example, added test cases. + Reported by Libor Spacek. + +2008-05-02 Albert Graef <Dr....@t-...> + + * Makefile: Overhaul of regression tests so that results of + expressions are recorded. Also, 'make check' doesn't depend on the + log files any more, so that the logs can be stored in svn. You can + now use the explicit goal 'make logs' to regenerate the logs for + changed test files. + + * runtime.cc (same): Added a syntactic equality test. Requested by + Eddie Rucker. + + * Makefile: Add $(LDFLAGS) and $(LIBS) to the link line, so that + the user can easily add his own linker options and local + libraries. + + * lib/strings.pure: Add missing range check in string indexing + operation. Reported by Eddie Rucker. + + * printer.cc (operator <<): Handle stack overflow while printing + an expression. + + * interpreter.cc (dodefn): Fix a tricky bug causing the executable + code of closures bound to variables to be freed when it was still + needed. Reported by Chris Double. + +2008-05-01 Albert Graef <Dr....@t-...> + + * interpreter.cc: Proper alignment of value fields in expression + struct on 64 bit systems. Reported by Tim Haynes. + + * Makefile: g++ shouldn't be hardcoded, use $(CXX) instead. + Reported by Ryan Schmidt. + + * runtime.cc (pure_sys_vars): More OSX compatibility fixes. + Reported by Ryan Schmidt. + +2008-04-30 Albert Graef <Dr....@t-...> + + * interpreter.cc: Fix a compilation error (STL bug: + http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729) as well as some + bogus warnings with Apple gcc 4.0.1. Reported by Ryan Schmidt. + + * Makefile (make depend): Get rid of bogus LLVM dependencies. + Reported by Ryan Schmidt. + + * lexer.ll, parser.yy: Fixes for compatibility with newer flex and + bison versions. Reported by Eddie Rucker. + +2008-04-29 Albert Graef <Dr....@t-...> + + * 0.1 release. + +2008-04-28 Albert Graef <Dr....@t-...> + + * examples/symbolic.pure: Add symbolic evaluation example. This is + just a straightforward port of some Q examples. + + * runtime.cc: Add support for advisory stack checks. + + * matcher.cc: Bugfixes. + +2008-04-27 Albert Graef <Dr....@t-...> + + * lib/string.pure: Added split and join functions. + + * pure.1, examples/hello.pure: Overhaul n queens example, added + quicksort and binary search tree examples. + + * lib/prelude.pure: Added void and curry/uncurry combinators, do, + zipdo. + + * interpreter.cc, pure.cc, runtime.cc: Make SIGINT generate a + useful exception value. + + * pure.cc: Add completion for global function and variable + symbols. + +2008-04-22 Albert Graef <Dr....@t-...> + + * Got a working interpreter, at last. There's still lots of stuff + to do (see the TODO file), but the interpreter should now be + usable as it is. + +2008-03-27 Albert Graef <Dr....@t-...> + + * ChangeLog started + Deleted: pure/releases/pure-0.3/INSTALL =================================================================== --- pure/trunk/INSTALL 2008-06-01 20:14:57 UTC (rev 164) +++ pure/releases/pure-0.3/INSTALL 2008-06-09 22:26:09 UTC (rev 197) @@ -1,296 +0,0 @@ - -INSTALLING PURE (AND LLVM) -========== ==== ==== ===== - -These instructions (mostly by courtesy of Eddie Rucker, thanks Eddie!) explain -how to compile and install LLVM (which is the compiler backend required by -Pure) and the Pure interpreter itself. The instructions are for Linux and -similar Unix-like systems; the SYSTEM NOTES section at the end of this file -details the tweaks necessary to make Pure compile and run on various other -platforms. More information about installing LLVM and the required LLVM source -packages can be found at http://llvm.org. - -Pure is known to work on Linux and Mac OSX, but should compile (with the usual -amount of tweaking) on all UNIX/POSIX-based platforms. We recommend using -version 4.x of the GNU C++ compiler; it should be available almost everywhere -(in fact, since you'll need LLVM anyway, you can also use the gcc frontend -available for LLVM). Other ANSI/ISO compatible C/C++ compilers will probably -work as well (after some fiddling with the compilation options and the sources -maybe), but this has not been tested. Also note that the Makefile pretty much -requires GNU make right now, so you should make sure that you have that -installed before trying to compile Pure. - - -BASIC INSTALLATION -===== ============ - -The basic installation process is as follows. Note that steps 1-3 are only -required once. Steps 2-3 can be avoided if binary LLVM packages are available -for your system. Additional instructions for compiling Pure from SVN sources -can be found in the INSTALLING FROM SVN SOURCES section below. Moreover, you -can refer to the OTHER COMPILATION OPTIONS section below for details about -various options available when building and installing Pure. - -STEP 1. Make sure you have all the necessary dependencies installed (-dev -denotes corresponding development packages): - -- GNU make, GNU C++ and the corresponding libraries; - -- flex and bison (these are only required when compiling the Pure SVN sources, - see the INSTALLING FROM SVN SOURCES section below); - -- libgmp, -dev; - -- libreadline, -dev; - -- libltdl, -dev; - -- subversion (only needed to fetch the SVN sources, see below). - -E.g., the required packages for Ubuntu are: make, g++, g++ 4.0 multilib, flex, -bison, libgmp3c2, libgmp3-dev, readline5-dev, libltdl3, libldtl3-dev, -subversion. - -STEP 2. Get and unpack the LLVM 2.2 sources at: -http://llvm.org/releases/download.html#2.2 - -STEP 3. Configure, build and install LLVM as follows: - -$ cd llvm-2.2 -$ ./configure --enable-optimized --disable-assertions --disable-expensive-checks --enable-targets=host-only -$ make ENABLE_OPTIMIZED=1 -$ sudo make install - -Note the configure flags; these are for an optimized (non-debug) build and -disable all compilation targets except the one for your system. To do a debug -build of LLVM, simply leave away all the extra configure parameters (except -possibly --enable-targets=host-only). Note, however, that this will -considerably slow down the Pure compiler. - -STEP 4. Get and unpack the Pure sources at: http://pure-lang.sf.net/ - -The latest release tarballs can always be found on the SourceForge project -page. See "Downloads" on the Pure website for a quick link to the download -section. - -STEP 5. Build and install Pure as follows (x.y denotes the current Pure -version number, 0.3 at the time of this writing): - -$ cd pure-x.y -$ make -$ sudo make install -$ sudo /sbin/ldconfig - -(The latter step is required on Linux systems to tell the dynamic linker to -update its cache so that it finds the Pure runtime library, libpure.so. On -other systems it may be sufficient to install the library in a location which -is searched by the dynamic linker.) - -After the build is complete, you can check that Pure is working correctly on -your computer, as follows: - -$ make check - -STEP 6. The Pure interpreter should be ready to go now. - -Run Pure interactively as: - -$ pure -Pure 0.3 Copyright (c) 2008 by Albert Graef -This program is free software distributed under the GNU Public License -(GPL V3 or later). Please see the COPYING file for details. -Loaded prelude from /usr/local/lib/pure/prelude.pure. - -Check that it works: - -> 6*7; -42 - -Read the online documentation (this invokes the Pure manual page): - -> help - -Exit the interpreter (you can also just type the end-of-file character at the -beginning of a line, i.e., Ctrl-D on Unix): - -> quit - - -INSTALLING FROM SVN SOURCES -========== ==== === ======= - -The latest development version of Pure is available in its subversion (SVN) -source code repository. You can browse the repository at: - -http://pure-lang.svn.sourceforge.net/viewvc/pure-lang/ - -(See the pure/trunk subdirectory for the latest sources.) - -Note that if you're going with the development sources, you'll also need -fairly recent versions of the flex and bison utilities (flex 2.5.31 and bison -2.3 should be ok). - -To compile from the development sources, replace steps 4 and 5 above with: - -STEP 4': Fetch the SVN sources. - -$ svn co http://pure-lang.svn.sourceforge.net/svnroot/pure-lang pure-lang - -This step needs to be done only once; once you've checked out your working -copy, you can update it to the latest revision by running 'svn up'. - -STEP 5': Build and install Pure: - -$ cd pure-lang/pure/trunk -$ make -$ sudo make install -$ sudo /sbin/ldconfig - - -OTHER COMPILATION OPTIONS -===== =========== ======= - -By default, the pure program goes to /usr/local/bin, the libpure.so library to -/usr/local/lib, and the Pure library scripts to /usr/local/lib/pure. The -installation directory can be changed by editing the definition of the -'prefix' variable in the Makefile, or by specifying the desired value on the -'make' command line, e.g.: - -$ make all install prefix=/usr - -Note that you should specify this option *both* at compile and installation -time since certain default paths are hardcoded into the interpreter (but can -be changed at runtime by setting corresponding environment variables, see the -manpage for details). Also note that if you install Pure into a non-standard -location, you may have to set the LD_LIBRARY_PATH variable so that the dynamic -linker finds the Pure runtime library, libpure.so. - -After your build is done, you can (and should) also run 'make check' to verify -that your Pure interpreter works correctly. This can be done without -installing the software. In fact, there's no need to install the interpreter -if you just want to take it for a test drive, you can simply run it from the -source directory, if you set up the following environment variables: - -- LD_LIBRARY_PATH=. This is required on Linux systems so that libpure.so - is found. Other systems may require an analogous setting, or none at all. - -- PURELIB=./lib This is required on all systems so that the interpreter finds - the prelude and other library scripts. - -After that you should be able to run the Pure interpreter from the source -directory, by typing './pure'. - -There are a number of other variables you can set on the 'make' command line -if you need special compiler (CXXFLAGS) or linker flags (LDFLAGS), or if you -have to add platform-specific libraries (LIBS). The DLL variable allows you to -change the shared library suffix as appropriate for your system. Please see -the Makefile for additional information on these. - -As of Pure 0.3, the 'default' build now also includes basic optimizations -(-O). This build should be ok for most purposes, and has the advantage that it -does additional runtime checks which provide diagnostics useful for -maintainers if anything is wrong with the interpreter. - -However, you can also build a "release" version of the interpreter as follows: - -$ make build=release - -This disables all runtime checks and debugging information in the interpreter -and also uses a higher level of optimization. The 'release' build will usually -give you faster execution times, but the differences aren't really that big -anymore (less than 5% compared to the default flags on my Linux system running -gcc 4.1, YMMV), so you are encouraged to use the 'default' build unless -performance is really critical. - -To get smaller executables with either the default or the release build, add -'LDFLAGS=-s' to the 'make' command (gcc only, other compilers may provide a -similar flag or a separate command to strip compiled executables and -libraries). - -You can also do a 'debug' build as follows: - -$ make build=debug - -This is like the standard build, but disables all optimizations, so -compilation is faster but the compiled interpreter is *much* slower (a factor -of about 2 on my Linux box). Hence this build is only recommended for -debugging purposes. - -More details on the build and installation process and other available targets -and options can be found in the Makefile. - - -SYSTEM NOTES -====== ===== - -Pure is known to work on recent Linux and Mac OSX versions under x86, x86-64 -and ppc, but there are a few system-specific quirks which are discussed below. -(Please also see the CAVEATS AND NOTES section of the manual page for -information on other known limitations of the current implementation.) - -ALL PLATFORMS ---- --------- - -Compiling the release version (make build=release) using gcc with all warnings -turned on (which is the default) will give you the warning "dereferencing -type-punned pointer will break strict-aliasing rules" at some point in -util.cc. This is harmless and can be ignored. - -If your Pure program runs out of stack space, the interpreter will segfault. -This is *not* a bug, it happens because runtime stack checks are disabled by -default for performance reasons. You can enable stack checks by setting the -PURE_STACK environment variable accordingly; see the pure(1) manual page for -details. The interpreter will then generate orderly "stack fault" exceptions -in case of a stack overflow. - -64 BIT SYSTEMS --- --- ------- - -64 bit systems are fully supported by Pure. Alas, for unknown reasons the -'debug' build currently does *not* work on (some?) 64 bit systems using -gcc. This has been seen on various different 64 bit Linux versions, YMMV. You -can tell that you're bitten by this bug if, after running 'make debug' (or -using similar, custom compilation flags), 'make check' fails on most tests. -Fortunately, it seems that you can easily work around this by making sure that -you have at least -O enabled when compiling runtime.cc. Also please note that -the 'default' and 'release' builds should work fine. 32 bit builds also seem -to be unaffected. - -LINUX ------ - -Linux is the primary development platform for this software, and the sources -should build out of the box on all recent Linux distributions. - -MAC OSX ---- --- - -A port by Ryan Schmidt exists in the MacPorts collection at -http://www.macports.org/. If you compile Pure from the original sources -yourself, you should add the -liconv flag to the link line. To these ends, -build Pure with the following make command (add the build=release option for -the release build): - -$ make LIBS="-liconv" - -Also note that with at least some current versions of the Apple gcc compiler -(4.0.1 and similar) you'll get the (bogus) warning "control reaches end of -non-void function" a couple of times in interpreter.cc. These are due to a bug -in older gcc versions (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16558), -but they are harmless and can be ignored. These warnings should also go away -once Apple upgrades its SDK to a newer gcc version. - -MS WINDOWS --- ------- - -Jiri Spitz is currently working on a Windows port using Mingw. Once this is -finished, we'll provide Windows installation instructions here. For the time -being, you can try for yourself; porting should be rather straightforward with -either Cygwin (http://www.cygwin.com/) or Mingw (http://www.mingw.org/), once -you have all the necessary dependencies and a suitable version of LLVM -installed. - - -May 2008 -Albert Graef <Dr.Graef at t-online.de> -Eddie Rucker <erucker at bmc.edu> Copied: pure/releases/pure-0.3/INSTALL (from rev 193, pure/trunk/INSTALL) =================================================================== --- pure/releases/pure-0.3/INSTALL (rev 0) +++ pure/releases/pure-0.3/INSTALL 2008-06-09 22:26:09 UTC (rev 197) @@ -0,0 +1,409 @@ + +INSTALLING PURE (AND LLVM) +========== ==== ==== ===== + +These instructions (mostly by courtesy of Eddie Rucker, thanks Eddie!) explain +how to compile and install LLVM (which is the compiler backend required by +Pure) and the Pure interpreter itself. The instructions are somewhat biased +towards Linux and other Unix-like systems; the SYSTEM NOTES section at the end +of this file details the tweaks necessary to make Pure compile and run on +various other platforms. More information about installing LLVM and the +required LLVM source packages can be found at http://llvm.org. + +Pure is known to work on Linux, Mac OSX and MS Windows, and should compile +(with the usual amount of tweaking) on all recent UNIX/POSIX-based platforms. +We recommend using version 4.x of the GNU C++ compiler; it should be available +almost everywhere (in fact, since you'll need LLVM anyway, you can also use +the gcc frontend available for LLVM). You'll also need a Bourne-compatible +shell and GNU make, which are also readily available on most platforms. + + +BASIC INSTALLATION +===== ============ + +The basic installation process is as follows. Note that steps 1-3 are only +required once. Steps 2-3 can be avoided if binary LLVM packages are available +for your system. Additional instructions for compiling Pure from SVN sources +can be found in the INSTALLING FROM SVN SOURCES section below. Moreover, you +can refer to the OTHER COMPILATION OPTIONS section below for details about +various options available when building and installing Pure. + +STEP 1. Make sure you have all the necessary dependencies installed (-dev +denotes corresponding development packages): + +- GNU make, GNU C++ and the corresponding libraries; + +- flex and bison (these are only required when compiling the Pure SVN sources, + see the INSTALLING FROM SVN SOURCES section below); + +- libgmp, -dev; + +- libreadline, -dev; + +- libltdl, -dev; + +- subversion (only needed to fetch the SVN sources, see below). + +E.g., the required packages for Ubuntu are: make, g++, g++ 4.0 multilib, flex, +bison, libgmp3c2, libgmp3-dev, readline5-dev, libltdl3, libldtl3-dev, +subversion. + +STEP 2. Get and unpack the LLVM 2.2 sources at: +http://llvm.org/releases/download.html#2.2 + +STEP 3. Configure, build and install LLVM as follows: + +$ cd llvm-2.2 +$ ./configure --enable-optimized --disable-assertions --disable-expensive-checks --enable-targets=host-only +$ make +$ sudo make install + +Note the configure flags; these are for an optimized (non-debug) build and +disable all compilation targets but the one for your system. (You might wish +to omit the --enable-targets=host-only if you want to use other LLVM +applications offering cross-compilation capabilities.) To do a debug build of +LLVM, simply leave away all the extra configure parameters (except possibly +--enable-targets=host-only). Note, however, that this will have an impact on +the speed of the Pure compiler. + +STEP 4. Get and unpack the Pure sources at: http://pure-lang.sf.net/ + +The latest release tarballs can always be found on the SourceForge project +page. See "Downloads" on the Pure website for a quick link to the download +section. + +STEP 5. Configure, build and install Pure as follows (x.y denotes the current +Pure version number, 0.3 at the time of this writing): + +$ cd pure-x.y +$ ./configure +$ make +$ sudo make install + +On some systems you may have to tell the dynamic linker to update its cache so +that it finds the Pure runtime library, libpure.so. E.g., on Linux this can be +done as follows: + +$ sudo /sbin/ldconfig + +After the build is complete, you can also run a few tests to check that Pure +is working correctly on your computer: + +$ make check + +If all is well, all tests should pass. If not, email the author or the Pure +mailing list for help. + +STEP 6. The Pure interpreter should be ready to go now. + +Run Pure interactively as: + +$ pure +Pure 0.3 (i686-pc-linux-gnu) Copyright (c) 2008 by Albert Graef +This program is free software distributed under the GNU Public License +(GPL V3 or later). Please see the COPYING file for details. +Loaded prelude from /usr/local/lib/pure/prelude.pure. + +Check that it works: + +> 6*7; +42 + +Read the online documentation (this invokes the Pure manual page): + +> help + +Exit the interpreter (you can also just type the end-of-file character at the +beginning of a line, i.e., Ctrl-D on Unix): + +> quit + + +INSTALLING FROM SVN SOURCES +========== ==== === ======= + +The latest development version of Pure is available in its subversion (SVN) +source code repository. You can browse the repository at: + +http://pure-lang.svn.sourceforge.net/viewvc/pure-lang/ + +(See the pure/trunk subdirectory for the latest sources.) + +Note that if you're going with the development sources, you'll also need +fairly recent versions of the flex and bison utilities (flex 2.5.31 and bison +2.3 should be ok). + +To compile from the development sources, replace steps 4 and 5 above with: + +STEP 4': Fetch the SVN sources. + +$ svn co http://pure-lang.svn.sourceforge.net/svnroot/pure-lang/pure/trunk pure + +This will only fetch the latest development sources (the "trunk") from svn and +put it into the 'pure' subdirectory in the current directory. To check out the +entire tree, including past releases and other branches, into a subdirectory +named 'pure-lang', use the following command instead: + +$ svn co http://pure-lang.svn.sourceforge.net/svnroot/pure-lang pure-lang + +This step needs to be done only once; once you've checked out your working +copy, you can update it to the latest revision at any time by running +'svn up'. + +STEP 5': Configure, build and install Pure: + +$ cd pure (or 'cd pure-lang/pure/trunk', if you checked out the entire tree) +$ ./configure +$ make +$ sudo make install + + +OTHER COMPILATION OPTIONS +===== =========== ======= + +The Pure configure script takes a few options which enable you to change the +installation path and control a number of other build options. Moreover, there +are some environment variables which also affect compilation and installation. + +Use './configure --help' to print a summary of the provided options. + +INSTALLATION PATH +------------ ---- + +By default, the pure program, runtime library and library scripts are +installed in /usr/local/bin, /usr/local/lib and /usr/local/lib/pure, +respectively. This can be changed by specifying the desired installation +prefix with the --prefix option, e.g.: + +$ ./configure --prefix=/usr + +(Note that if you install Pure into a non-standard location, you may have to +set LD_LIBRARY_PATH or a similar variable so that the dynamic linker finds the +Pure runtime library, libpure.so.) + +In addition, the DESTDIR variable enables package maintainers to install Pure +into a special "staging" directory, so that installed files can be packaged +more easily. If set at installation time, DESTDIR will be used as an +additional prefix to all installation paths. For instance, the following +command will put all installed files into the tmp-root subdirectory of the +current directory: + +$ make install DESTDIR=tmp-root + +SEPARATE BUILD DIRECTORY +-------- ----- --------- + +It is possible to build Pure in a separate directory, in order to keep your +source tree tidy and clean, or to build multiple versions of the interpreter +with different compilation flags from the same source tree. + +To these ends, just cd to the build directory and run configure and make +there, e.g. (this assumes that you start from the source directory): + +$ mkdir BUILD +$ cd BUILD +$ ../configure +$ make + +COMPILER AND LINKER OPTIONS +-------- --- ------ ------- + +There are a number of environment variables you can set on the 'configure' +command line if you need special compiler or linker options: + +- CPPFLAGS: preprocessor options (-I, -D, etc.) +- CXXFLAGS: compilation options (-g, -O, etc.) +- LDFLAGS: linker flags (-s, -L, etc.) +- LIBS: additional objects and libraries (-lfoo, bar.o, etc.) + +For instance, the following 'configure' command changes the default +compilation options to '-g' and adds '/opt/include' and '/opt/lib' to the +include and library search paths, respectively: + +$ ./configure CPPFLAGS=-I/opt/include CXXFLAGS=-g LDFLAGS=-L/opt/lib + +More details on the build and installation process and other available targets +and options can be found in the Makefile. + +PREDEFINED BUILD TYPES +---------- ----- ----- + +For convenience, 'configure' provides some options to set up CPPFLAGS and +CXXFLAGS for various build types. + +Note that, as of Pure 0.3, the default build already includes most +optimizations (-O2). This build should be ok for most purposes, and has the +advantage that it does additional runtime checks which provide diagnostics +useful for maintainers if anything is wrong with the interpreter. However, you +can also build a "release" version of the interpreter by running configure as +follows: + +$ ./configure --enable-release + +This disables all runtime checks and debugging information in the interpreter, +and uses a higher optimization level (-O3). The release build will usually +give you faster execution times, but the differences to the default build +aren't really that big anymore (less than 5% compared to the default flags on +my Linux system running gcc 4.1, YMMV), so you are encouraged to use the +default build unless performance is really critical. + +To get smaller executables with either the default or the release build, add +'LDFLAGS=-s' to the 'configure' command (gcc only, other compilers may provide +a similar flag or a separate command to strip compiled executables and +libraries). + +You can also do a "debug" build as follows: + +$ ./configure --enable-debug + +This is like the default build, but disables all optimizations, so compilation +is faster but the compiled interpreter is *much* slower (a factor of about 2 +on my Linux box). Hence this build is only recommended for debugging purposes. + +You can combine all build types with the following option to enable compiler +warnings (-Wall): + +$ ./configure --enable-warnings + +This option is useful to check the interpreter sources for questionable +constructs which might actually be bugs. However, for some older gcc versions +it spits out lots of bogus warnings, so it is not enabled by default. + +In addition, there is an option to build a "monolithic" interpreter which is +linked statically against the LLVM libraries, instead of producing a separate +runtime library: + +$ ./configure --disable-shared + +This works with all build types and is provided as a temporary workaround for +systems like 64 bit Linux where LLVM refuses to be linked into shared +libraries (see the notes on 64 bit systems in the NOTES section below). Please +note, however, that it is *not* recommended to do this if you don't need it, +since it drastically increases the size of the executable and thereby the +memory footprint of the interpreter if several interpreter processes are +running simultaneously. + +RUNNING PURE FROM THE SOURCE DIRECTORY +------- ---- ---- --- ------ --------- + +After your build is done, you can (and should) also run 'make check' to verify +that your Pure interpreter works correctly. This can be done without +installing the software. In fact, there's no need to install the interpreter +at all if you just want to take it for a test drive, you can simply run it +from the source directory, if you set up the following environment variables +(this assumes that you built Pure in the source directory; when using a +separate build directory, you'll have to change the paths accordingly): + +- LD_LIBRARY_PATH=. This is required on Linux systems so that libpure.so + is found. Other systems may require an analogous setting, or none at all. + +- PURELIB=./lib This is required on all systems so that the interpreter finds + the prelude and other library scripts. + +After that you should be able to run the Pure interpreter from the source +directory, by typing './pure'. + +OTHER TARGETS +----- ------- + +The Makefile supports the usual 'clean' and 'distclean' targets, and +'realclean' will remove all files created by the maintainer, including test +logs and C++ source files generated from Flex and Bison grammars. (Only use +the latter if you know what you are doing, since it will remove files which +require special tools to be regenerated.) + +There also are a number of targets like 'html' and 'pdf' which generate the +documentation in a variety of formats (this requires groff); see the Makefile +for details. + +Last but not least, maintainers can roll distribution tarballs with 'make +dist' and 'make distcheck' (the latter is like 'make dist', but also does a +test build and installation to verify that your tarball contains all needed +bits and pieces). + + +SYSTEM NOTES +====== ===== + +Pure is known to work on recent Linux and Mac OSX versions under x86, x86-64 +and ppc, as well as on MS Windows, but there are a few system-specific quirks +which are discussed below. (Please also see the CAVEATS AND NOTES section of +the manual page for information on other known limitations of the current +implementation.) + +ALL PLATFORMS +--- --------- + +Compiling the default and release versions using gcc with all warnings turned +on (-Wall) will give you the warning "dereferencing type-punned pointer will +break strict-aliasing rules" at some point in util.cc. This is harmless and +can be ignored. + +If your Pure program runs out of stack space, the interpreter will segfault. +This is *not* a bug, it happens because runtime stack checks are disabled by +default for performance reasons. You can enable stack checks by setting the +PURE_STACK environment variable accordingly; see the pure(1) manual page for +details. The interpreter will then generate orderly "stack fault" exceptions +in case of a stack overflow. + +64 BIT SYSTEMS +-- --- ------- + +64 bit systems are fully supported by Pure. However, LLVM 2.2 apparently +doesn't like to be linked into shared libraries on x86-64 systems. The symptom +is that you get strange relocation errors when linking the runtime library +during the build. In this case you have to build the interpreter as a +monolithic executable which statically includes all required LLVM and the Pure +runtime modules, by configuring with --disable-shared. This has several +disadvantages, but seems to be the only way to get Pure to work on x86-64 +right now. Hopefully, these issues will be fixed with the next LLVM release. + +Also, for unknown reasons the debug build currently does *not* work on (some?) +64 bit systems using gcc. This has been seen on various different 64 bit Linux +versions, YMMV. You can tell that you're bitten by this bug if a normal build +works, but 'make check' fails on most tests with the debug build (or if you +manually disable optimization). Fortunately, it seems that you can easily work +around this by making sure that you have at least -O enabled when compiling +runtime.cc. Also please note that the default and release builds should work +fine. 32 bit builds also seem to be unaffected. + +LINUX +----- + +Linux is the primary development platform for this software, and the sources +should build out of the box on all recent Linux distributions. (But note the +issues on x86-64 Linux systems described above.) + +MAC OSX +--- --- + +Pure has been reported to work on OSX, and a port by Ryan Schmidt exists in +the MacPorts collection, see http://www.macports.org/. + +Note that with at least some current versions of the Apple gcc compiler (4.0.1 +and similar), with all warnings turned on you'll get the (bogus) warning +"control reaches end of non-void function" a couple of times in +interpreter.cc. These are due to a bug in older gcc versions (see +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16558), but they are harmless and +can be ignored. These warnings should also go away once Apple upgrades its SDK +to a newer gcc version. + +MS WINDOWS +-- ------- + +Thanks to Jiri Spitz' perseverance, tireless testing and bug reports, the +sources compile and run fine on Windows now, using the Mingw port of the GNU +C++ compiler and the MSYS environment from http://www.mingw.org/. Just do the +usual './configure && make && make install'. You'll need LLVM, of course +(which builds with Mingw just fine), and a few additional libraries for which +headers and precompiled binaries are available from the Pure website +(http://pure-lang.sf.net/). + +A binary package in msi format is available as well (see "Downloads" on the +Pure website), which includes all required libraries and some shortcuts to run +the Pure interpreter and read online documentation in html help format. + + +June 2008 +Albert Graef <Dr.Graef at t-online.de> +Eddie Rucker <erucker at bmc.edu> Deleted: pure/releases/pure-0.3/Makefile =================================================================== --- pure/trunk/Makefile 2008-06-01 20:14:57 UTC (rev 164) +++ pure/releases/pure-0.3/Makefile 2008-06-09 22:26:09 UTC (rev 197) @@ -1,265 +0,0 @@ - -# This Makefile requires GNU make. Really. - -# Basic setup. You can change the version number and installation paths here. - -# For instance, to install under /usr instead of /usr/local, run 'make -# prefix=/usr && make install prefix=/usr'. Please note that the 'prefix' -# option must be specified *both* at build and at installation time. At -# installation time, you can also specify a DESTDIR path if you want to -# install into a staging directory, e.g.: 'make install DESTDIR=$PWD/BUILD'. - -version = 0.3 -dist = pure-$(version) - -prefix = /usr/local -bindir = $(prefix)/bin -libdir = $(prefix)/lib -mandir = $(prefix)/share/man/man1 - -# Shared library suffix. The default should work on most Linux and Unix -# systems. Use DLL=dll on Windows. - -DLL=so - -# Staging directory for 'make install'. If you use this, make sure that this -# ends in a slash. - -DESTDIR= - -# Linker flags. Adjust these as necessary for your system. - -# LDFLAGS is for additional linker options, LIBS for additional libraries that -# might be needed (e.g., -liconv on OSX and Windows). - -LDFLAGS= -LIBS= - -# Compilation flags. We currently provide the following build profiles: - -# 'default' compiles with extra runtime checks and debugging information. -# 'release' optimizes for execution speed (release version). -# 'debug' like 'default', but without any optimizations. -# 'debug2' extensive debugging output, useful to debug the interpreter. - -# The 'default' build should be suitable for most purposes. As of Pure 0.3, -# this build now also does basic optimizations and so isn't much slower than -# the 'release' build any more. In contrast to 'release', this build also -# provides diagnostics useful for maintainers if anything is wrong with the -# interpreter. - -# The 'release' build disables all runtime checks and debugging information -# and compiles with additional optimizations which makes programs go a little -# faster (some 5-10% on a single-cpu AMD system running Linux and gcc 4.1, -# YMMV); use this if performance is critical. - -# The 'debug' build is like 'default' but without any optimizations; it builds -# faster than 'default', but runs *much* slower, and isn't recommended for -# anything but debugging the interpreter. The 'debug2' build generates massive -# amounts of additional debugging messages, and is really only to be used by -# maintainers debugging the interpreter. - -# To build with a given profile, just say 'make build=<profile>', e.g.: 'make -# build=release'. (This option only has to be specified at build time, not for -# installation or any other targets except 'all'.) Just 'make' builds with the -# default flags. - -build=default - -LLVM_FLAGS = `llvm-config --cppflags` -LLVM_LIBS = `llvm-config --ldflags --l... [truncated message content] |
From: <ag...@us...> - 2008-06-21 11:19:54
|
Revision: 275 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=275&view=rev Author: agraef Date: 2008-06-21 04:13:10 -0700 (Sat, 21 Jun 2008) Log Message: ----------- Snapshot of Pure 0.4 (+some trivial post-release fixes). Added Paths: ----------- pure/releases/pure-0.4/ pure/releases/pure-0.4/ChangeLog pure/releases/pure-0.4/Makefile.in pure/releases/pure-0.4/NEWS pure/releases/pure-0.4/README pure/releases/pure-0.4/etc/pure.lang pure/releases/pure-0.4/examples/symbolic.pure pure/releases/pure-0.4/interpreter.cc pure/releases/pure-0.4/lexer.ll pure/releases/pure-0.4/pure.1.in pure/releases/pure-0.4/pure.cc Removed Paths: ------------- pure/releases/pure-0.4/ChangeLog pure/releases/pure-0.4/Makefile.in pure/releases/pure-0.4/NEWS pure/releases/pure-0.4/README pure/releases/pure-0.4/etc/pure.lang pure/releases/pure-0.4/examples/symbolic.pure pure/releases/pure-0.4/interpreter.cc pure/releases/pure-0.4/lexer.ll pure/releases/pure-0.4/pure.1.in pure/releases/pure-0.4/pure.cc Copied: pure/releases/pure-0.4 (from rev 261, pure/trunk) Deleted: pure/releases/pure-0.4/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-06-18 20:32:46 UTC (rev 261) +++ pure/releases/pure-0.4/ChangeLog 2008-06-21 11:13:10 UTC (rev 275) @@ -1,403 +0,0 @@ -2008-06-18 Albert Graef <Dr....@t-...> - - * runtime.cc, lib/primitives.pure: Add hash function to compute 32 - bit hash codes of Pure expressions. Suggested by Jiri Spitz. - - * parser.yy, lexer.ll, interpreter.hh/cc: Add syntax for multiple - left-hand sides in function definitions and 'case' rules, as - requested by Jiri Spitz and discussed on the mailing list. See the - manual page for details. - - * symtable.cc, lib/prelude.pure, lib/primitives.pure: Rename the - bitwise operators '&' and '|' to 'and' and 'or'. - -2008-06-16 Albert Graef <Dr....@t-...> - - * etc/pure.lang: New language definition file for Andre Simon's - highlight program (http:/www.andre-simon.de/). This allows you to - format Pure sources with syntax highlighting as HTML and LaTeX - files, for instance. - - * configure.ac, Makefile.in: Clean up the source tree. Moved - auxiliary configure files and the syntax highlighting and - programming mode stuff into separate config and etc - subdirectories. Moreover, Makefile.in now has a target to - regenerate the configury using autoconf and autoheader. - -2008-06-15 Albert Graef <Dr....@t-...> - - * matcher.hh: gcc 4.3 compatibility fixes. Suggested by Toni - Graffy. - -2008-06-14 Albert Graef <Dr....@t-...> - - * lexer.ll: Various changes in order to facilitate script - execution and interfacing to Emacs. - - Initial '#!' on a line now denotes a comment line, in order to - support shebangs (see below). - - The new 'completion_matches' command provides information about - completions to programs driving the interpreter, such as Emacs - (see below). - - Paging of the 'list' command is now implemented using the program - specified with the PURE_MORE environment variable. This allows you - to disable this option (if PURE_MORE is undefined) or choose any - pager program and options that you prefer. Define PURE_MORE=more - in your shell startup files to get back the old behaviour of - piping 'list' output through 'more'. - - * pure.cc: Added new -q (quiet) and -x (execute) options. The - former is used in pure-mode.el to suppress the sign-on message of - the interpreter. The latter can be used in conjuction with the new - #! comment syntax to add shebangs to your script, see the manpage - for details. - - * pure-mode.el.in: Added new Emacs Pure mode. This is a quick and - dirty hack of Q mode and still needs some work (in particular, - auto indentation is pretty much broken right now). - -2008-06-13 Albert Graef <Dr....@t-...> - - * configure.ac, Makefile.in, etc.: Overhauled configury and bumped - the version number. - - Building a separate runtime lib on x86-64 works now (but requires - a patched LLVM, see the INSTALL file for details). Linking the - runtime lib on OSX should also work now. Moreover, it is now - possible to install different Pure versions in parallel, again see - the INSTALL file for details. - -2008-06-06 Albert Graef <Dr....@t-...> - - * 0.3 release. - - * configure.ac, etc.: Added autoconf support. Various fixes for 64 - bit and Windows compatibility. See the INSTALL file for updated - installation instructions. - -2008-06-01 Albert Graef <Dr....@t-...> - - * Makefile, interpreter.cc: Put the runtime and interpreter into a - separate shared library, to make it possible for modules to link - against the runtime, and to reduce the memory footprint when - multiple instances of the interpreter are run as different - processes. Also, this makes it possible to access the runtime - routines on systems where a program cannot dlopen itself. - -2008-05-28 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Optimization of pure_freenew calls. - - * lib/strings.pure: Make 'cycle' work on strings. Reported by - Eddie Rucker. - - * lib/prelude.pure: Make 'index' work on lists. Code contributed - by Eddie Rucker. - -2008-05-27 Albert Graef <Dr....@t-...> - - * lib/prelude.pure: Rewrite prelude operations to make them - tail-recursive. - - * interpreter.cc (toplevel_codegen): Experimental support for - tail-recursive logical operators (&& and ||). This works but is - disabled, since it makes these operations behave in different ways - depending on the context, which is a really bad idea because it - violates referential transparency. - -2008-05-26 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Overhaul of the shadow stack - machinery. Environment vectors are now maintained on the shadow - stack, so that all local functions and anonymous closures are - eligible for tail call optimization, even if they need access to - their environment. - -2008-05-25 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Add marshalling between long (64 - bit) ints and Pure bigints in the C interface. This means that - both Pure ints and bigints can now be passed for 'long' arguments - of externals (with sign extension/truncation as necessary), and - 'long' values are promoted to Pure bigints on return. Hence C - functions taking 64 bit integers as arguments and returning them - as results can now be called from Pure without loosing bits due to - truncation. - - * interpreter.cc: Make toplevel if-then-else properly - tail-recursive. Thus, e.g., the following function will now run in - constant stack space: count x = if x<=0 then x else count (x-1); - This also works with nested if-then-else constructs, as long as - they form the right-hand side of an equation. - -2008-05-24 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Fix more memory allocation bugs in - exception handling. - - * runtime.cc, lib/system.pure: Bugfixes in the scanf - functions. Reported by Jiri Spitz. - - * pure.cc, runtime.cc, util.cc: Windows/MinGW compatibility - fixes. Suggested by Jiri Spitz. - -2008-05-23 Albert Graef <Dr....@t-...> - - * runtime.cc: Fix premature freeing of eval result, and a minor - memory allocation glitch in the catch function. Reported by Eddie - Rucker. - - * Makefile: Bump version number. - - * interpreter.cc: If there are any child environments, doeval and - dodefn both create semi-permanent environments now, so that the - child environments and the corresponding LLVM IR survive for the - entire lifetime of any embedded closures, which might still be - called at a later time. This fixes the segfaults occurring when a - closure gets called after its associated environment was purged. A - partial fix for some situations (as reported earlier by Chris - Double) was already in the 0.2 release, but this didn't deal with - all cases, such as closures constructed in a call to the eval - function, as reported by Eddie Rucker. - -2008-05-22 Albert Graef <Dr....@t-...> - - * interpreter.cc, runtime.cc: Major overhaul of expression memory - handling. Fixed the shadow stack and memory debugging code. Both - function arguments and environment are now visible on the shadow - stack, and all remaining memory leaks have been fixed. Note that, - compared to previous revisions, the shadow stack slows down - compiled code by some 10% and it needs some additional memory. - OTOH, it also provides additional data that will be needed in the - planned symbolic debugger, and it seems to be the most efficient - way to handle dangling expression pointers after an exception - anyway. - -2008-05-17 Albert Graef <Dr....@t-...> - - * runtime.cc (pure_free_internal): Fixed a glitch which was - causing big memleaks. Reported by Libor Spacek. - - * interpreter.cc (define): Fixed error messages. - - * interpreter.cc, runtime.h: Reorganize pure_expr data structure - so that the data fields are *always* aligned on 8 byte boundaries. - This should now also work on 32 bit architectures where doubles - are aligned on 8 byte boundaries, such as Linux on 32 bit PPC. - Reported by Tim Haynes. - - * interpreter.cc: Fixed some case labels in switch instructions - which should be signed rather than unsigned values. Also made - void* a pointer to a dummy struct in LLVM IR, so that it can be - distinguished from all other pointer types, and added support for - short (16 bit) and long (64 bit) integer types (as well as the - corresponding pointer types) in the C interface. - - Please note that the typename 'long' *always* denotes signed 64 - bit integers in Pure's extern declarations, even if the C 'long' - type is actually 32 bit (as it usually is even on most 64 bit - systems). - -2008-05-16 Albert Graef <Dr....@t-...> - - * runtime.h: Fix compilation problems when header gets included - from C. - -2008-05-14 Albert Graef <Dr....@t-...> - - * funcall.h: Reduce maximum number of function parameters to - 64. This seems to be large enough for most purposes, and speeds up - compilation with -Ox by a factor of around 10. - - * Makefile: Overhaul of build options. In particular, the - 'default' build now includes basic optimization (-O) which makes - the interpreter almost as fast as with the 'release' build, and - produces a working interpreter also on 64 bit systems. (The - 'debug' build is still broken there, but see the SYSTEM NOTES - section in the INSTALL file for a workaround.) - - * interpreter.cc, runtime.cc: 64 bit compatibility fixes in bigint - handling. - -2008-05-12 Albert Graef <Dr....@t-...> - - * interpreter.cc: Fix a severe bug in the environment handling - code of the code generator, which could cause failed assertions in - the code generator, or wrong code to be generated in some cases. - To resolve this issue, the code generator now properly keeps - separate environments for each rule of a function - definition. Reported by John Lunney. - - * Makefile: Redirect warning and error messages from regression - tests to the logfile. - -2008-05-10 Albert Graef <Dr....@t-...> - - * interpreter.cc (uminop): Handle the value -0x80000000 at the - border of the int range, so that it is correctly treated as a - machine int. - -2008-05-09 Albert Graef <Dr....@t-...> - - * lexer.ll, printer.cc, etc.: Change the "G" suffix to denote - bigints to "L" ("G" can too easily be mistaken for a digit; also, - Python uses the same "L" notation for bigints). Reported by Eddie - Rucker. - -2008-05-06 Albert Graef <Dr....@t-...> - - * lib/primitives.pure: Made the pow function work with all - combinations of integer and double arguments. Also added the sqrt - function and the ^ operator. - - * runtime.cc, lib/primitives.pure: Added predicates funp, lambdap, - varp checking for named and anonymous closures and unbound global - variables, respectively. Requested by Libor Spacek. - - * interpreter.cc (declare_extern, fun_prolog): Handle some obscure - cases of name collisions between Pure and C functions. - -2008-05-05 Albert Graef <Dr....@t-...> - - * INSTALL: Add system-specific notes. - - * Makefile: Massaged some rules for OSX compatibility. In - particular, -rdynamic is now in the LDFLAGS, so that it can be - removed more easily, and I also removed the install -s flag so - that the pure executable is installed without stripping the - symbols which are needed to properly resolve runtime externals on - OSX. Reported by Ryan Schmidt and others. - - * matcher.cc (merge_ctrans): Fixed broken mpz_cmp() test causing - transitions on different (instead of equal) bigint constants to be - merged. Reported by Libor Spacek. - -2008-05-04 Albert Graef <Dr....@t-...> - - * 0.2 release. - - * lexer.ll, printer.cc: Add an explicit notation for big - integers. Any integer immediately followed by the uppercase letter - "G" (as in "biG" or "GMP") will now always be interpreted as a - bigint constant, even if it fits into a machine integer. This - notation is also used when printing bigint constants. This change - was necessary to make it possible to write rules matching against - "small bigint" constants. - - * lib/primitives.pure: Added operations to recognize function - applications and extract the function and argument parts, - implemented in runtime.cc. Note that these operations can't be - defined in Pure because of the "head is function" rule which means - that in a pattern of the form f x, f is always a literal function - symbol and not a variable. - -2008-05-03 Albert Graef <Dr....@t-...> - - * README: Moved installation instructions to a separate INSTALL - file, added Eddie Rucker's detailed instructions there. - - * util.cc (myiconv): Apple's iconv takes const char** as 2nd - parameter. #ifdef that case. Reported by Ryan Schmidt. - - * interpreter.cc (declare_extern): Fixed a bug in the generated - wrapper code for external calls, which caused function arguments - to be garbage-collected prematurely, when they were still needed - to create the default value, in the case of external calls - returning a null expression pointer to indicate failure. Reported - by Eddie Rucker. - - * test/test4.pure: Disabled tail call checks, as they may fail on - some platforms. Reported by Ryan Schmidt. - - * test/test1.pure: Corrected fact3 example, added test cases. - Reported by Libor Spacek. - -2008-05-02 Albert Graef <Dr....@t-...> - - * Makefile: Overhaul of regression tests so that results of - expressions are recorded. Also, 'make check' doesn't depend on the - log files any more, so that the logs can be stored in svn. You can - now use the explicit goal 'make logs' to regenerate the logs for - changed test files. - - * runtime.cc (same): Added a syntactic equality test. Requested by - Eddie Rucker. - - * Makefile: Add $(LDFLAGS) and $(LIBS) to the link line, so that - the user can easily add his own linker options and local - libraries. - - * lib/strings.pure: Add missing range check in string indexing - operation. Reported by Eddie Rucker. - - * printer.cc (operator <<): Handle stack overflow while printing - an expression. - - * interpreter.cc (dodefn): Fix a tricky bug causing the executable - code of closures bound to variables to be freed when it was still - needed. Reported by Chris Double. - -2008-05-01 Albert Graef <Dr....@t-...> - - * interpreter.cc: Proper alignment of value fields in expression - struct on 64 bit systems. Reported by Tim Haynes. - - * Makefile: g++ shouldn't be hardcoded, use $(CXX) instead. - Reported by Ryan Schmidt. - - * runtime.cc (pure_sys_vars): More OSX compatibility fixes. - Reported by Ryan Schmidt. - -2008-04-30 Albert Graef <Dr....@t-...> - - * interpreter.cc: Fix a compilation error (STL bug: - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729) as well as some - bogus warnings with Apple gcc 4.0.1. Reported by Ryan Schmidt. - - * Makefile (make depend): Get rid of bogus LLVM dependencies. - Reported by Ryan Schmidt. - - * lexer.ll, parser.yy: Fixes for compatibility with newer flex and - bison versions. Reported by Eddie Rucker. - -2008-04-29 Albert Graef <Dr....@t-...> - - * 0.1 release. - -2008-04-28 Albert Graef <Dr....@t-...> - - * examples/symbolic.pure: Add symbolic evaluation example. This is - just a straightforward port of some Q examples. - - * runtime.cc: Add support for advisory stack checks. - - * matcher.cc: Bugfixes. - -2008-04-27 Albert Graef <Dr....@t-...> - - * lib/string.pure: Added split and join functions. - - * pure.1, examples/hello.pure: Overhaul n queens example, added - quicksort and binary search tree examples. - - * lib/prelude.pure: Added void and curry/uncurry combinators, do, - zipdo. - - * interpreter.cc, pure.cc, runtime.cc: Make SIGINT generate a - useful exception value. - - * pure.cc: Add completion for global function and variable - symbols. - -2008-04-22 Albert Graef <Dr....@t-...> - - * Got a working interpreter, at last. There's still lots of stuff - to do (see the TODO file), but the interpreter should now be - usable as it is. - -2008-03-27 Albert Graef <Dr....@t-...> - - * ChangeLog started - Copied: pure/releases/pure-0.4/ChangeLog (from rev 274, pure/trunk/ChangeLog) =================================================================== --- pure/releases/pure-0.4/ChangeLog (rev 0) +++ pure/releases/pure-0.4/ChangeLog 2008-06-21 11:13:10 UTC (rev 275) @@ -0,0 +1,420 @@ +2008-06-20 Albert Graef <Dr....@t-...> + + * 0.4 release. + + * pure.cc, lexer.ll: Fake interactive mode when we're not + connected to a terminal but -i is specified. Thus sign-on message + and command prompts will be printed as usual. This is needed, in + particular, to make Emacs Pure-Eval mode work on Windows. + +2008-06-19 Albert Graef <Dr....@t-...> + + * examples/symbolic.pure: Fix DNF example to accommodate changes + in the operator system. + + * interpreter.cc (declare): Fix segfault in reporting of + conflicting fixity declarations. + +2008-06-18 Albert Graef <Dr....@t-...> + + * runtime.cc, lib/primitives.pure: Add hash function to compute 32 + bit hash codes of Pure expressions. Suggested by Jiri Spitz. + + * parser.yy, lexer.ll, interpreter.hh/cc: Add syntax for multiple + left-hand sides in function definitions and 'case' rules, as + requested by Jiri Spitz and discussed on the mailing list. See the + manual page for details. + + * symtable.cc, lib/prelude.pure, lib/primitives.pure: Rename the + bitwise operators '&' and '|' to 'and' and 'or'. + +2008-06-16 Albert Graef <Dr....@t-...> + + * etc/pure.lang: New language definition file for Andre Simon's + highlight program (http:/www.andre-simon.de/). This allows you to + format Pure sources with syntax highlighting as HTML and LaTeX + files, for instance. + + * configure.ac, Makefile.in: Clean up the source tree. Moved + auxiliary configure files and the syntax highlighting and + programming mode stuff into separate config and etc + subdirectories. Moreover, Makefile.in now has a target to + regenerate the configury using autoconf and autoheader. + +2008-06-15 Albert Graef <Dr....@t-...> + + * matcher.hh: gcc 4.3 compatibility fixes. Suggested by Toni + Graffy. + +2008-06-14 Albert Graef <Dr....@t-...> + + * lexer.ll: Various changes in order to facilitate script + execution and interfacing to Emacs. + + Initial '#!' on a line now denotes a comment line, in order to + support shebangs (see below). + + The new 'completion_matches' command provides information about + completions to programs driving the interpreter, such as Emacs + (see below). + + Paging of the 'list' command is now implemented using the program + specified with the PURE_MORE environment variable. This allows you + to disable this option (if PURE_MORE is undefined) or choose any + pager program and options that you prefer. Define PURE_MORE=more + in your shell startup files to get back the old behaviour of + piping 'list' output through 'more'. + + * pure.cc: Added new -q (quiet) and -x (execute) options. The + former is used in pure-mode.el to suppress the sign-on message of + the interpreter. The latter can be used in conjunction with the + new #! comment syntax to add shebangs to your script, see the + manpage for details. + + * pure-mode.el.in: Added new Emacs Pure mode. This is a quick and + dirty hack of Q mode and still needs some work (in particular, + auto indentation is pretty much broken right now). + +2008-06-13 Albert Graef <Dr....@t-...> + + * configure.ac, Makefile.in, etc.: Overhauled configury and bumped + the version number. + + Building a separate runtime lib on x86-64 works now (but requires + a patched LLVM, see the INSTALL file for details). Linking the + runtime lib on OSX should also work now. Moreover, it is now + possible to install different Pure versions in parallel, again see + the INSTALL file for details. + +2008-06-06 Albert Graef <Dr....@t-...> + + * 0.3 release. + + * configure.ac, etc.: Added autoconf support. Various fixes for 64 + bit and Windows compatibility. See the INSTALL file for updated + installation instructions. + +2008-06-01 Albert Graef <Dr....@t-...> + + * Makefile, interpreter.cc: Put the runtime and interpreter into a + separate shared library, to make it possible for modules to link + against the runtime, and to reduce the memory footprint when + multiple instances of the interpreter are run as different + processes. Also, this makes it possible to access the runtime + routines on systems where a program cannot dlopen itself. + +2008-05-28 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Optimization of pure_freenew calls. + + * lib/strings.pure: Make 'cycle' work on strings. Reported by + Eddie Rucker. + + * lib/prelude.pure: Make 'index' work on lists. Code contributed + by Eddie Rucker. + +2008-05-27 Albert Graef <Dr....@t-...> + + * lib/prelude.pure: Rewrite prelude operations to make them + tail-recursive. + + * interpreter.cc (toplevel_codegen): Experimental support for + tail-recursive logical operators (&& and ||). This works but is + disabled, since it makes these operations behave in different ways + depending on the context, which is a really bad idea because it + violates referential transparency. + +2008-05-26 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Overhaul of the shadow stack + machinery. Environment vectors are now maintained on the shadow + stack, so that all local functions and anonymous closures are + eligible for tail call optimization, even if they need access to + their environment. + +2008-05-25 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Add marshalling between long (64 + bit) ints and Pure bigints in the C interface. This means that + both Pure ints and bigints can now be passed for 'long' arguments + of externals (with sign extension/truncation as necessary), and + 'long' values are promoted to Pure bigints on return. Hence C + functions taking 64 bit integers as arguments and returning them + as results can now be called from Pure without loosing bits due to + truncation. + + * interpreter.cc: Make toplevel if-then-else properly + tail-recursive. Thus, e.g., the following function will now run in + constant stack space: count x = if x<=0 then x else count (x-1); + This also works with nested if-then-else constructs, as long as + they form the right-hand side of an equation. + +2008-05-24 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Fix more memory allocation bugs in + exception handling. + + * runtime.cc, lib/system.pure: Bugfixes in the scanf + functions. Reported by Jiri Spitz. + + * pure.cc, runtime.cc, util.cc: Windows/MinGW compatibility + fixes. Suggested by Jiri Spitz. + +2008-05-23 Albert Graef <Dr....@t-...> + + * runtime.cc: Fix premature freeing of eval result, and a minor + memory allocation glitch in the catch function. Reported by Eddie + Rucker. + + * Makefile: Bump version number. + + * interpreter.cc: If there are any child environments, doeval and + dodefn both create semi-permanent environments now, so that the + child environments and the corresponding LLVM IR survive for the + entire lifetime of any embedded closures, which might still be + called at a later time. This fixes the segfaults occurring when a + closure gets called after its associated environment was purged. A + partial fix for some situations (as reported earlier by Chris + Double) was already in the 0.2 release, but this didn't deal with + all cases, such as closures constructed in a call to the eval + function, as reported by Eddie Rucker. + +2008-05-22 Albert Graef <Dr....@t-...> + + * interpreter.cc, runtime.cc: Major overhaul of expression memory + handling. Fixed the shadow stack and memory debugging code. Both + function arguments and environment are now visible on the shadow + stack, and all remaining memory leaks have been fixed. Note that, + compared to previous revisions, the shadow stack slows down + compiled code by some 10% and it needs some additional memory. + OTOH, it also provides additional data that will be needed in the + planned symbolic debugger, and it seems to be the most efficient + way to handle dangling expression pointers after an exception + anyway. + +2008-05-17 Albert Graef <Dr....@t-...> + + * runtime.cc (pure_free_internal): Fixed a glitch which was + causing big memleaks. Reported by Libor Spacek. + + * interpreter.cc (define): Fixed error messages. + + * interpreter.cc, runtime.h: Reorganize pure_expr data structure + so that the data fields are *always* aligned on 8 byte boundaries. + This should now also work on 32 bit architectures where doubles + are aligned on 8 byte boundaries, such as Linux on 32 bit PPC. + Reported by Tim Haynes. + + * interpreter.cc: Fixed some case labels in switch instructions + which should be signed rather than unsigned values. Also made + void* a pointer to a dummy struct in LLVM IR, so that it can be + distinguished from all other pointer types, and added support for + short (16 bit) and long (64 bit) integer types (as well as the + corresponding pointer types) in the C interface. + + Please note that the typename 'long' *always* denotes signed 64 + bit integers in Pure's extern declarations, even if the C 'long' + type is actually 32 bit (as it usually is even on most 64 bit + systems). + +2008-05-16 Albert Graef <Dr....@t-...> + + * runtime.h: Fix compilation problems when header gets included + from C. + +2008-05-14 Albert Graef <Dr....@t-...> + + * funcall.h: Reduce maximum number of function parameters to + 64. This seems to be large enough for most purposes, and speeds up + compilation with -Ox by a factor of around 10. + + * Makefile: Overhaul of build options. In particular, the + 'default' build now includes basic optimization (-O) which makes + the interpreter almost as fast as with the 'release' build, and + produces a working interpreter also on 64 bit systems. (The + 'debug' build is still broken there, but see the SYSTEM NOTES + section in the INSTALL file for a workaround.) + + * interpreter.cc, runtime.cc: 64 bit compatibility fixes in bigint + handling. + +2008-05-12 Albert Graef <Dr....@t-...> + + * interpreter.cc: Fix a severe bug in the environment handling + code of the code generator, which could cause failed assertions in + the code generator, or wrong code to be generated in some cases. + To resolve this issue, the code generator now properly keeps + separate environments for each rule of a function + definition. Reported by John Lunney. + + * Makefile: Redirect warning and error messages from regression + tests to the logfile. + +2008-05-10 Albert Graef <Dr....@t-...> + + * interpreter.cc (uminop): Handle the value -0x80000000 at the + border of the int range, so that it is correctly treated as a + machine int. + +2008-05-09 Albert Graef <Dr....@t-...> + + * lexer.ll, printer.cc, etc.: Change the "G" suffix to denote + bigints to "L" ("G" can too easily be mistaken for a digit; also, + Python uses the same "L" notation for bigints). Reported by Eddie + Rucker. + +2008-05-06 Albert Graef <Dr....@t-...> + + * lib/primitives.pure: Made the pow function work with all + combinations of integer and double arguments. Also added the sqrt + function and the ^ operator. + + * runtime.cc, lib/primitives.pure: Added predicates funp, lambdap, + varp checking for named and anonymous closures and unbound global + variables, respectively. Requested by Libor Spacek. + + * interpreter.cc (declare_extern, fun_prolog): Handle some obscure + cases of name collisions between Pure and C functions. + +2008-05-05 Albert Graef <Dr....@t-...> + + * INSTALL: Add system-specific notes. + + * Makefile: Massaged some rules for OSX compatibility. In + particular, -rdynamic is now in the LDFLAGS, so that it can be + removed more easily, and I also removed the install -s flag so + that the pure executable is installed without stripping the + symbols which are needed to properly resolve runtime externals on + OSX. Reported by Ryan Schmidt and others. + + * matcher.cc (merge_ctrans): Fixed broken mpz_cmp() test causing + transitions on different (instead of equal) bigint constants to be + merged. Reported by Libor Spacek. + +2008-05-04 Albert Graef <Dr....@t-...> + + * 0.2 release. + + * lexer.ll, printer.cc: Add an explicit notation for big + integers. Any integer immediately followed by the uppercase letter + "G" (as in "biG" or "GMP") will now always be interpreted as a + bigint constant, even if it fits into a machine integer. This + notation is also used when printing bigint constants. This change + was necessary to make it possible to write rules matching against + "small bigint" constants. + + * lib/primitives.pure: Added operations to recognize function + applications and extract the function and argument parts, + implemented in runtime.cc. Note that these operations can't be + defined in Pure because of the "head is function" rule which means + that in a pattern of the form f x, f is always a literal function + symbol and not a variable. + +2008-05-03 Albert Graef <Dr....@t-...> + + * README: Moved installation instructions to a separate INSTALL + file, added Eddie Rucker's detailed instructions there. + + * util.cc (myiconv): Apple's iconv takes const char** as 2nd + parameter. #ifdef that case. Reported by Ryan Schmidt. + + * interpreter.cc (declare_extern): Fixed a bug in the generated + wrapper code for external calls, which caused function arguments + to be garbage-collected prematurely, when they were still needed + to create the default value, in the case of external calls + returning a null expression pointer to indicate failure. Reported + by Eddie Rucker. + + * test/test4.pure: Disabled tail call checks, as they may fail on + some platforms. Reported by Ryan Schmidt. + + * test/test1.pure: Corrected fact3 example, added test cases. + Reported by Libor Spacek. + +2008-05-02 Albert Graef <Dr....@t-...> + + * Makefile: Overhaul of regression tests so that results of + expressions are recorded. Also, 'make check' doesn't depend on the + log files any more, so that the logs can be stored in svn. You can + now use the explicit goal 'make logs' to regenerate the logs for + changed test files. + + * runtime.cc (same): Added a syntactic equality test. Requested by + Eddie Rucker. + + * Makefile: Add $(LDFLAGS) and $(LIBS) to the link line, so that + the user can easily add his own linker options and local + libraries. + + * lib/strings.pure: Add missing range check in string indexing + operation. Reported by Eddie Rucker. + + * printer.cc (operator <<): Handle stack overflow while printing + an expression. + + * interpreter.cc (dodefn): Fix a tricky bug causing the executable + code of closures bound to variables to be freed when it was still + needed. Reported by Chris Double. + +2008-05-01 Albert Graef <Dr....@t-...> + + * interpreter.cc: Proper alignment of value fields in expression + struct on 64 bit systems. Reported by Tim Haynes. + + * Makefile: g++ shouldn't be hardcoded, use $(CXX) instead. + Reported by Ryan Schmidt. + + * runtime.cc (pure_sys_vars): More OSX compatibility fixes. + Reported by Ryan Schmidt. + +2008-04-30 Albert Graef <Dr....@t-...> + + * interpreter.cc: Fix a compilation error (STL bug: + http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11729) as well as some + bogus warnings with Apple gcc 4.0.1. Reported by Ryan Schmidt. + + * Makefile (make depend): Get rid of bogus LLVM dependencies. + Reported by Ryan Schmidt. + + * lexer.ll, parser.yy: Fixes for compatibility with newer flex and + bison versions. Reported by Eddie Rucker. + +2008-04-29 Albert Graef <Dr....@t-...> + + * 0.1 release. + +2008-04-28 Albert Graef <Dr....@t-...> + + * examples/symbolic.pure: Add symbolic evaluation example. This is + just a straightforward port of some Q examples. + + * runtime.cc: Add support for advisory stack checks. + + * matcher.cc: Bugfixes. + +2008-04-27 Albert Graef <Dr....@t-...> + + * lib/string.pure: Added split and join functions. + + * pure.1, examples/hello.pure: Overhaul n queens example, added + quicksort and binary search tree examples. + + * lib/prelude.pure: Added void and curry/uncurry combinators, do, + zipdo. + + * interpreter.cc, pure.cc, runtime.cc: Make SIGINT generate a + useful exception value. + + * pure.cc: Add completion for global function and variable + symbols. + +2008-04-22 Albert Graef <Dr....@t-...> + + * Got a working interpreter, at last. There's still lots of stuff + to do (see the TODO file), but the interpreter should now be + usable as it is. + +2008-03-27 Albert Graef <Dr....@t-...> + + * ChangeLog started + Deleted: pure/releases/pure-0.4/Makefile.in =================================================================== --- pure/trunk/Makefile.in 2008-06-18 20:32:46 UTC (rev 261) +++ pure/releases/pure-0.4/Makefile.in 2008-06-21 11:13:10 UTC (rev 275) @@ -1,304 +0,0 @@ - -# This Makefile requires GNU make. Really. - -SHELL = /bin/sh - -# Package and host information. - -name = @PACKAGE_NAME@ -version = @PACKAGE_VERSION@ -dist = $(name)-$(version) - -host = @host@ - -# Source and installation paths. - -srcdir = @srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -datarootdir = @datarootdir@ - -bindir = @bindir@ -includedir = @includedir@ -libdir = @libdir@ -datadir = @datadir@ -mandir = @mandir@ -man1dir = $(mandir)/man1 - -# Staging directory for 'make install'. - -DESTDIR= - -# OS-specific special filename extensions. configure tries to guess this, but -# if it guesses wrong, you can set these as needed. - -EXE=@EXEEXT@ -DLL=@DLLEXT@ - -# Programs. - -CXX = @CXX@ -INSTALL = @INSTALL@ -ECHO_N = @ECHO_N@ - -# Linker flags and required libraries. These are determined automatically by -# configure, but if necessary you can also change these on the command line. - -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ - -# Compilation flags. - -LLVM_FLAGS = `llvm-config --cppflags` -LLVM_LIBS = `llvm-config --ldflags --libs core jit native` - -CPPFLAGS = @CPPFLAGS@ -CXXFLAGS = @CXXFLAGS@ - -# Pure library name. Currently we use a simple versioning scheme, which -# requires that the library version matches that of the interpreter. This -# enables you to install different versions of the Pure interpreter on the -# same system. - -libpure_base = $(name) -libpure_vers = $(libpure_base)-$(version) - -libpure = lib$(libpure_vers)$(DLL) -libpurelnk = lib$(libpure_base)$(DLL) - -# Whether to build the Pure runtime library. If this is set to anything but -# "yes", the interpreter is linked statically and no separate library is -# produced. This is necessary on some systems where LLVM cannot be linked in -# dynamically. - -sharedlib = @sharedlib@ - -# Flag needed to create shared libraries. On most systems this is just -shared. - -shared = @shared@ - -# On some systems -fPIC is needed for code linked as a shared library. - -ifeq ($(sharedlib), yes) -PIC = @PIC@ -else -PIC = -endif - -# Auxiliary libraries to be loaded at runtime. Usually this is just libpure -# (when built), but on some systems we have to load additional dlls to resolve -# some library functions. - -ifeq ($(sharedlib), yes) -AUXLIBS = -DLIBPURE='"$(libpure)"' @AUXLIBS@ -else -AUXLIBS = @AUXLIBS@ -endif - -# No need to edit below this line. Unless you really have to. :) ############ - -SOURCE = expr.cc expr.hh funcall.h interpreter.cc interpreter.hh lexer.ll \ -matcher.cc matcher.hh parser.yy printer.cc printer.hh \ -runtime.cc runtime.h symtable.cc symtable.hh util.cc util.hh -EXTRA_SOURCE = lexer.cc parser.cc parser.hh location.hh position.hh stack.hh -OBJECT = $(subst .cc,.o,$(filter %.cc,$(SOURCE) $(EXTRA_SOURCE))) - -DISTFILES = COPYING ChangeLog INSTALL NEWS README TODO \ -Makefile.in configure.ac configure config.h.in \ -config/aclocal.m4 config/config.guess config/config.sub config/install-sh \ -$(SOURCE) $(EXTRA_SOURCE) w3centities.c \ -pure.cc pure.1 pure.1.in etc/pure-mode.el.in etc/pure.* \ -examples/*.pure lib/*.pure test/*.pure test/*.log - -.PHONY: all html dvi ps pdf clean realclean depend install uninstall strip \ -dist distcheck cleanlogs logs check config - -# compilation - -all: pure$(EXE) etc/pure-mode.el pure.1 - -ifeq ($(sharedlib), yes) -pure$(EXE): pure.o $(libpure) - $(CXX) -o $@ $(LDFLAGS) pure.o -L. -l$(libpure_vers) $(LIBS) -else -pure$(EXE): pure.o $(OBJECT) - $(CXX) -o $@ $(LDFLAGS) pure.o $(OBJECT) $(LLVM_LIBS) $(LIBS) -endif - -$(libpure): $(OBJECT) - $(CXX) $(shared) -o $@ $(LDFLAGS) $(OBJECT) $(LLVM_LIBS) $(LIBS) - ln -sf $(libpure) $(libpurelnk) - -pure.o: pure.cc - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LLVM_FLAGS) -DPURELIB='"$(libdir)/pure-$(version)"' -c -o $@ $< - -interpreter.o: interpreter.cc - $(CXX) $(CXXFLAGS) $(PIC) $(CPPFLAGS) $(LLVM_FLAGS) $(AUXLIBS) -c -o $@ $< - -%.o: %.cc - $(CXX) $(CXXFLAGS) $(PIC) $(CPPFLAGS) $(LLVM_FLAGS) -c -o $@ $< - -lexer.cc: lexer.ll - flex -o lexer.cc $< - -parser.cc: parser.yy - bison -v -o parser.cc $< - -parser.hh location.hh position.hh stack.hh: parser.cc - -# create pure-mode.el from pure-mode.el.in - -etc/pure-mode.el: Makefile etc/pure-mode.el.in - rm -f etc/pure-mode.el etc/pure-mode.el.tmp - sed -e 's,@bindir\@,$(bindir),g' -e 's,@libdir\@,$(libdir),g' etc/pure-mode.el.in >etc/pure-mode.el.tmp - mv etc/pure-mode.el.tmp etc/pure-mode.el - -# create the manpage from pure.1.in - -pure.1: configure.ac pure.1.in - rm -f pure.1 pure.1.tmp - sed -e 's,@version\@,$(version),g' pure.1.in >pure.1.tmp - mv pure.1.tmp pure.1 - -# documentation in various formats (requires groff) - -html: pure.html -dvi: pure.dvi -ps: pure.ps -pdf: pure.pdf - -# We do the html format using rman, because it produces nicer output. If you -# don't have rman, uncomment the rule below instead. - -%.html: %.1 - rman -f HTML $< | sed -e 's/dq/\"/g' -e '/<br>/d' > $@ - -#%.html: %.1 -# groff -man -Thtml $< > $@ - -%.dvi: %.1 - groff -man -Tdvi $< > $@ - -%.ps: %.1 - groff -man -Tps $< > $@ - -%.pdf: %.1 - groff -man -Tps $< | ps2pdf - $@ - -# cleaning - -clean: - rm -f *~ *.bak *.html *.dvi *.ps *.pdf pure$(EXE) $(OBJECT) pure.o $(libpurelnk) $(libpure) parser.output - -distclean: clean - rm -f Makefile config.h config.log config.status etc/pure-mode.el $(dist).tar.gz - -realclean: distclean - rm -f $(addprefix $(srcdir)/, test/*.log $(EXTRA_SOURCE) pure.1) - -# dependencies (rerun configure after this) - -depend: $(SOURCE) $(EXTRA_SOURCE) - (cd $(srcdir) && makedepend -f Makefile.in -Y pure.cc $(SOURCE) $(EXTRA_SOURCE) 2> /dev/null) - -# regenerate configure et al - -config: configure config.h.in - -configure: configure.ac config/aclocal.m4 - autoconf -I config - -config.h.in: configure.ac config/aclocal.m4 - autoheader -I config - -# installation - -install: pure$(EXE) etc/pure-mode.el pure.1 - for x in $(addprefix $(DESTDIR), $(bindir) $(includedir)/pure-$(version) $(libdir)/pure-$(version) $(man1dir)); do $(INSTALL) -d $$x; done - $(INSTALL) pure$(EXE) $(DESTDIR)$(bindir)/pure-$(version)$(EXE) - ln -sf $(bindir)/pure-$(version)$(EXE) $(DESTDIR)$(bindir)/pure$(EXE) -ifeq ($(sharedlib), yes) - $(INSTALL) $(libpure) $(DESTDIR)$(libdir)/$(libpure) - ln -sf $(libdir)/$(libpure) $(DESTDIR)$(libdir)/$(libpurelnk) -endif - $(INSTALL) runtime.h $(DESTDIR)$(includedir)/pure-$(version) - ln -sf $(includedir)/pure-$(version) $(DESTDIR)$(includedir)/pure - for x in $(srcdir)/lib/*.pure; do $(INSTALL) -m 644 $$x $(DESTDIR)$(libdir)/pure-$(version); done - ln -sf $(libdir)/pure-$(version) $(DESTDIR)$(libdir)/pure - $(INSTALL) -m 644 pure.1 $(DESTDIR)$(man1dir)/pure-$(version).1 - ln -sf $(man1dir)/pure-$(version).1 $(DESTDIR)$(man1dir)/pure.1 - -uninstall: - rm -rf $(DESTDIR)$(bindir)/pure$(EXE) $(DESTDIR)$(bindir)/pure-$(version)$(EXE) $(DESTDIR)$(libdir)/$(libpure) $(DESTDIR)$(libdir)/$(libpurelnk) $(DESTDIR)$(includedir)/pure $(DESTDIR)$(includedir)/pure-$(version) $(DESTDIR)$(libdir)/pure $(DESTDIR)$(libdir)/pure-$(version) $(DESTDIR)$(man1dir)/pure.1 $(DESTDIR)$(man1dir)/pure-$(version).1 - -# roll a distribution tarball - -dist: pure.1 - rm -rf $(dist) - mkdir $(dist) && mkdir $(dist)/config && mkdir $(dist)/etc && mkdir $(dist)/examples && mkdir $(dist)/lib && mkdir $(dist)/test - (builddir=$$PWD; cd $(srcdir); for x in $(DISTFILES); do ln -sf $$PWD/$$x $$builddir/$(dist)/$$x; done) - rm -f $(dist).tar.gz - tar cfzh $(dist).tar.gz $(dist) - rm -rf $(dist) - -distcheck: dist - tar xfz $(dist).tar.gz - cd $(dist) && ./configure && make && make check && make install DESTDIR=./BUILD - rm -rf $(dist) - -# test logs, make check - -level=7 - -tests = $(wildcard $(srcdir)/test/*.pure) -logs = $(srcdir)/test/prelude.log $(tests:.pure=.log) - -logs: $(logs) - -cleanlogs: - rm -f $(srcdir)/test/*.log - -$(srcdir)/test/prelude.log: lib/prelude.pure lib/primitives.pure lib/strings.pure - LD_LIBRARY_PATH=. PURELIB=$(srcdir)/lib ./pure -n -v$(level) $< > $@ 2>&1 - -%.log: %.pure - LD_LIBRARY_PATH=. PURELIB=$(srcdir)/lib ./pure -v$(level) < $< > $@ 2>&1 - -check: pure - @ echo Running tests. - @ (export LD_LIBRARY_PATH=.; export PURELIB=$(srcdir)/lib; echo $(ECHO_N) "prelude.pure: "; if ./pure $(ECHO_N) -v$(level) $(srcdir)/lib/prelude.pure 2>&1 | diff -q - $(srcdir)/test/prelude.log > /dev/null; then echo passed; else echo FAILED; fi) - @ (export LD_LIBRARY_PATH=.; export PURELIB=$(srcdir)/lib; for x in $(notdir $(tests)); do echo $(ECHO_N) "$$x: "; if ./pure -v$(level) < $(srcdir)/test/$$x 2>&1 | diff -q - $(srcdir)/test/"`basename $$x .pure`.log" > /dev/null; then echo passed; else echo FAILED; fi; done) - -# DO NOT DELETE - -pure.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h -pure.o: parser.hh stack.hh util.hh location.hh position.hh config.h -expr.o: expr.hh interpreter.hh matcher.hh symtable.hh printer.hh runtime.h -expr.o: parser.hh stack.hh util.hh location.hh position.hh -interpreter.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh -interpreter.o: runtime.h parser.hh stack.hh util.hh location.hh position.hh -interpreter.o: expr.hh matcher.hh symtable.hh printer.hh runtime.h parser.hh -interpreter.o: stack.hh util.hh location.hh position.hh -lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h -lexer.o: parser.hh stack.hh util.hh location.hh position.hh -matcher.o: matcher.hh expr.hh -matcher.o: expr.hh -parser.o: expr.hh printer.hh matcher.hh runtime.h util.hh interpreter.hh -parser.o: symtable.hh parser.hh stack.hh location.hh position.hh -printer.o: printer.hh expr.hh matcher.hh runtime.h interpreter.hh symtable.hh -printer.o: parser.hh stack.hh util.hh location.hh position.hh -printer.o: expr.hh matcher.hh runtime.h -runtime.o: runtime.h expr.hh interpreter.hh matcher.hh symtable.hh printer.hh -runtime.o: parser.hh stack.hh util.hh location.hh position.hh funcall.h -symtable.o: symtable.hh expr.hh printer.hh matcher.hh runtime.h -symtable.o: expr.hh printer.hh matcher.hh runtime.h -util.o: util.hh config.h w3centities.c -lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h -lexer.o: parser.hh stack.hh util.hh location.hh position.hh -parser.o: parser.hh stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh -parser.o: location.hh position.hh interpreter.hh symtable.hh -parser.o: stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh -parser.o: location.hh position.hh -location.o: position.hh Copied: pure/releases/pure-0.4/Makefile.in (from rev 267, pure/trunk/Makefile.in) =================================================================== --- pure/releases/pure-0.4/Makefile.in (rev 0) +++ pure/releases/pure-0.4/Makefile.in 2008-06-21 11:13:10 UTC (rev 275) @@ -0,0 +1,304 @@ + +# This Makefile requires GNU make. Really. + +SHELL = /bin/sh + +# Package and host information. + +name = @PACKAGE_NAME@ +version = @PACKAGE_VERSION@ +dist = $(name)-$(version) + +host = @host@ + +# Source and installation paths. + +srcdir = @srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ + +bindir = @bindir@ +includedir = @includedir@ +libdir = @libdir@ +datadir = @datadir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 + +# Staging directory for 'make install'. + +DESTDIR= + +# OS-specific special filename extensions. configure tries to guess this, but +# if it guesses wrong, you can set these as needed. + +EXE=@EXEEXT@ +DLL=@DLLEXT@ + +# Programs. + +CXX = @CXX@ +INSTALL = @INSTALL@ +ECHO_N = @ECHO_N@ + +# Linker flags and required libraries. These are determined automatically by +# configure, but if necessary you can also change these on the command line. + +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ + +# Compilation flags. + +LLVM_FLAGS = `llvm-config --cppflags` +LLVM_LIBS = `llvm-config --ldflags --libs core jit native` + +CPPFLAGS = @CPPFLAGS@ +CXXFLAGS = @CXXFLAGS@ + +# Pure library name. Currently we use a simple versioning scheme, which +# requires that the library version matches that of the interpreter. This +# enables you to install different versions of the Pure interpreter on the +# same system. + +libpure_base = $(name) +libpure_vers = $(libpure_base)-$(version) + +libpure = lib$(libpure_vers)$(DLL) +libpurelnk = lib$(libpure_base)$(DLL) + +# Whether to build the Pure runtime library. If this is set to anything but +# "yes", the interpreter is linked statically and no separate library is +# produced. This is necessary on some systems where LLVM cannot be linked in +# dynamically. + +sharedlib = @sharedlib@ + +# Flag needed to create shared libraries. On most systems this is just -shared. + +shared = @shared@ + +# On some systems -fPIC is needed for code linked as a shared library. + +ifeq ($(sharedlib), yes) +PIC = @PIC@ +else +PIC = +endif + +# Auxiliary libraries to be loaded at runtime. Usually this is just libpure +# (when built), but on some systems we have to load additional dlls to resolve +# some library functions. + +ifeq ($(sharedlib), yes) +AUXLIBS = -DLIBPURE='"$(libpure)"' @AUXLIBS@ +else +AUXLIBS = @AUXLIBS@ +endif + +# No need to edit below this line. Unless you really have to. :) ############ + +SOURCE = expr.cc expr.hh funcall.h interpreter.cc interpreter.hh lexer.ll \ +matcher.cc matcher.hh parser.yy printer.cc printer.hh \ +runtime.cc runtime.h symtable.cc symtable.hh util.cc util.hh +EXTRA_SOURCE = lexer.cc parser.cc parser.hh location.hh position.hh stack.hh +OBJECT = $(subst .cc,.o,$(filter %.cc,$(SOURCE) $(EXTRA_SOURCE))) + +DISTFILES = COPYING ChangeLog INSTALL NEWS README TODO \ +Makefile.in configure.ac configure config.h.in \ +config/aclocal.m4 config/config.guess config/config.sub config/install-sh \ +$(SOURCE) $(EXTRA_SOURCE) w3centities.c \ +pure.cc pure.1 pure.1.in etc/pure-mode.el.in etc/pure.* \ +examples/*.pure lib/*.pure test/*.pure test/*.log + +.PHONY: all html dvi ps pdf clean realclean depend install uninstall strip \ +dist distcheck cleanlogs logs check config + +# compilation + +all: pure$(EXE) etc/pure-mode.el pure.1 + +ifeq ($(sharedlib), yes) +pure$(EXE): pure.o $(libpure) + $(CXX) -o $@ $(LDFLAGS) pure.o -L. -l$(libpure_vers) $(LIBS) +else +pure$(EXE): pure.o $(OBJECT) + $(CXX) -o $@ $(LDFLAGS) pure.o $(OBJECT) $(LLVM_LIBS) $(LIBS) +endif + +$(libpure): $(OBJECT) + $(CXX) $(shared) -o $@ $(LDFLAGS) $(OBJECT) $(LLVM_LIBS) $(LIBS) + ln -sf $(libpure) $(libpurelnk) + +pure.o: pure.cc + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LLVM_FLAGS) -DPURELIB='"$(libdir)/pure-$(version)"' -c -o $@ $< + +interpreter.o: interpreter.cc + $(CXX) $(CXXFLAGS) $(PIC) $(CPPFLAGS) $(LLVM_FLAGS) $(AUXLIBS) -c -o $@ $< + +%.o: %.cc + $(CXX) $(CXXFLAGS) $(PIC) $(CPPFLAGS) $(LLVM_FLAGS) -c -o $@ $< + +lexer.cc: lexer.ll + flex -o lexer.cc $< + +parser.cc: parser.yy + bison -v -o parser.cc $< + +parser.hh location.hh position.hh stack.hh: parser.cc + +# create pure-mode.el from pure-mode.el.in + +etc/pure-mode.el: Makefile etc/pure-mode.el.in + rm -f etc/pure-mode.el etc/pure-mode.el.tmp + sed -e 's,@bindir\@,$(bindir),g' -e 's,@libdir\@,$(libdir),g' etc/pure-mode.el.in >etc/pure-mode.el.tmp + mv etc/pure-mode.el.tmp etc/pure-mode.el + +# create the manpage from pure.1.in + +pure.1: configure.ac pure.1.in + rm -f pure.1 pure.1.tmp + sed -e 's,@version\@,$(version),g' pure.1.in >pure.1.tmp + mv pure.1.tmp pure.1 + +# documentation in various formats (requires groff) + +html: pure.html +dvi: pure.dvi +ps: pure.ps +pdf: pure.pdf + +# We do the html format using rman, because it produces nicer output. If you +# don't have rman, uncomment the rule below instead. + +%.html: %.1 + rman -f HTML $< | sed -e 's/dq/\"/g' -e '/^<br>$$/d' > $@ + +#%.html: %.1 +# groff -man -Thtml $< > $@ + +%.dvi: %.1 + groff -man -Tdvi $< > $@ + +%.ps: %.1 + groff -man -Tps $< > $@ + +%.pdf: %.1 + groff -man -Tps $< | ps2pdf - $@ + +# cleaning + +clean: + rm -f *~ *.bak *.html *.dvi *.ps *.pdf pure$(EXE) $(OBJECT) pure.o $(libpurelnk) $(libpure) parser.output + +distclean: clean + rm -f Makefile config.h config.log config.status etc/pure-mode.el $(dist).tar.gz + +realclean: distclean + rm -f $(addprefix $(srcdir)/, test/*.log $(EXTRA_SOURCE) pure.1) + +# dependencies (rerun configure after this) + +depend: $(SOURCE) $(EXTRA_SOURCE) + (cd $(srcdir) && makedepend -f Makefile.in -Y pure.cc $(SOURCE) $(EXTRA_SOURCE) 2> /dev/null) + +# regenerate configure et al + +config: configure config.h.in + +configure: configure.ac config/aclocal.m4 + autoconf -I config + +config.h.in: configure.ac config/aclocal.m4 + autoheader -I config + +# installation + +install: pure$(EXE) etc/pure-mode.el pure.1 + for x in $(addprefix $(DESTDIR), $(bindir) $(includedir)/pure-$(version) $(libdir)/pure-$(version) $(man1dir)); do $(INSTALL) -d $$x; done + $(INSTALL) pure$(EXE) $(DESTDIR)$(bindir)/pure-$(version)$(EXE) + ln -sf $(bindir)/pure-$(version)$(EXE) $(DESTDIR)$(bindir)/pure$(EXE) +ifeq ($(sharedlib), yes) + $(INSTALL) $(libpure) $(DESTDIR)$(libdir)/$(libpure) + ln -sf $(libdir)/$(libpure) $(DESTDIR)$(libdir)/$(libpurelnk) +endif + $(INSTALL) runtime.h $(DESTDIR)$(includedir)/pure-$(version) + ln -sf $(includedir)/pure-$(version) $(DESTDIR)$(includedir)/pure + for x in $(srcdir)/lib/*.pure; do $(INSTALL) -m 644 $$x $(DESTDIR)$(libdir)/pure-$(version); done + ln -sf $(libdir)/pure-$(version) $(DESTDIR)$(libdir)/pure + $(INSTALL) -m 644 pure.1 $(DESTDIR)$(man1dir)/pure-$(version).1 + ln -sf $(man1dir)/pure-$(version).1 $(DESTDIR)$(man1dir)/pure.1 + +uninstall: + rm -rf $(DESTDIR)$(bindir)/pure$(EXE) $(DESTDIR)$(bindir)/pure-$(version)$(EXE) $(DESTDIR)$(libdir)/$(libpure) $(DESTDIR)$(libdir)/$(libpurelnk) $(DESTDIR)$(includedir)/pure $(DESTDIR)$(includedir)/pure-$(version) $(DESTDIR)$(libdir)/pure $(DESTDIR)$(libdir)/pure-$(version) $(DESTDIR)$(man1dir)/pure.1 $(DESTDIR)$(man1dir)/pure-$(version).1 + +# roll a distribution tarball + +dist: pure.1 + rm -rf $(dist) + mkdir $(dist) && mkdir $(dist)/config && mkdir $(dist)/etc && mkdir $(dist)/examples && mkdir $(dist)/lib && mkdir $(dist)/test + (builddir=$$PWD; cd $(srcdir); for x in $(DISTFILES); do ln -sf $$PWD/$$x $$builddir/$(dist)/$$x; done) + rm -f $(dist).tar.gz + tar cfzh $(dist).tar.gz $(dist) + rm -rf $(dist) + +distcheck: dist + tar xfz $(dist).tar.gz + cd $(dist) && ./configure && make && make check && make install DESTDIR=./BUILD + rm -rf $(dist) + +# test logs, make check + +level=7 + +tests = $(wildcard $(srcdir)/test/*.pure) +logs = $(srcdir)/test/prelude.log $(tests:.pure=.log) + +logs: $(logs) + +cleanlogs: + rm -f $(srcdir)/test/*.log + +$(srcdir)/test/prelude.log: lib/prelude.pure lib/primitives.pure lib/strings.pure + LD_LIBRARY_PATH=. PURELIB=$(srcdir)/lib ./pure -n -v$(level) $< > $@ 2>&1 + +%.log: %.pure + LD_LIBRARY_PATH=. PURELIB=$(srcdir)/lib ./pure -v$(level) < $< > $@ 2>&1 + +check: pure + @ echo Running tests. + @ (export LD_LIBRARY_PATH=.; export PURELIB=$(srcdir)/lib; echo $(ECHO_N) "prelude.pure: "; if ./pure $(ECHO_N) -v$(level) $(srcdir)/lib/prelude.pure 2>&1 | diff -q - $(srcdir)/test/prelude.log > /dev/null; then echo passed; else echo FAILED; fi) + @ (export LD_LIBRARY_PATH=.; export PURELIB=$(srcdir)/lib; for x in $(notdir $(tests)); do echo $(ECHO_N) "$$x: "; if ./pure -v$(level) < $(srcdir)/test/$$x 2>&1 | diff -q - $(srcdir)/test/"`basename $$x .pure`.log" > /dev/null; then echo passed; else echo FAILED; fi; done) + +# DO NOT DELETE + +pure.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h +pure.o: parser.hh stack.hh util.hh location.hh position.hh config.h +expr.o: expr.hh interpreter.hh matcher.hh symtable.hh printer.hh runtime.h +expr.o: parser.hh stack.hh util.hh location.hh position.hh +interpreter.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh +interpreter.o: runtime.h parser.hh stack.hh util.hh location.hh position.hh +interpreter.o: expr.hh matcher.hh symtable.hh printer.hh runtime.h parser.hh +interpreter.o: stack.hh util.hh location.hh position.hh +lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h +lexer.o: parser.hh stack.hh util.hh location.hh position.hh +matcher.o: matcher.hh expr.hh +matcher.o: expr.hh +parser.o: expr.hh printer.hh matcher.hh runtime.h util.hh interpreter.hh +parser.o: symtable.hh parser.hh stack.hh location.hh position.hh +printer.o: printer.hh expr.hh matcher.hh runtime.h interpreter.hh symtable.hh +printer.o: parser.hh stack.hh util.hh location.hh position.hh +printer.o: expr.hh matcher.hh runtime.h +runtime.o: runtime.h expr.hh interpreter.hh matcher.hh symtable.hh printer.hh +runtime.o: parser.hh stack.hh util.hh location.hh position.hh funcall.h +symtable.o: symtable.hh expr.hh printer.hh matcher.hh runtime.h +symtable.o: expr.hh printer.hh matcher.hh runtime.h +util.o: util.hh config.h w3centities.c +lexer.o: interpreter.hh expr.hh matcher.hh symtable.hh printer.hh runtime.h +lexer.o: parser.hh stack.hh util.hh location.hh position.hh +parser.o: parser.hh stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh +parser.o: location.hh position.hh interpreter.hh symtable.hh +parser.o: stack.hh expr.hh printer.hh matcher.hh runtime.h util.hh +parser.o: location.hh position.hh +location.o: position.hh Deleted: pure/releases/pure-0.4/NEWS =================================================================== --- pure/trunk/NEWS 2008-06-18 20:32:46 UTC (rev 261) +++ pure/releases/pure-0.4/NEWS 2008-06-21 11:13:10 UTC (rev 275) @@ -1,53 +0,0 @@ - -** Pure 0.3 2008-06-06 - -This release sports a lot of improvements as well as bug and portability -fixes, see the ChangeLog for details. Many memory leaks have been plugged, and -tail call elimination has been improved a lot. The build system has gone -through a major overhaul, adding autoconf support. 64 bit support has been -improved as well, and Pure now builds and runs fine on MS Windows. Many -library functions have been rewritten to make them tail-recursive, and some -new functions have been added. Last but not least, the runtime support is now -implemented as a separate shared library which makes it possible to link -external modules against the runtime, and reduces the memory footprint when -multiple instances of the interpreter are run as different processes. - -Special thanks to Tim Haynes, John Lunney, Eddie Rucker, Ryan Schmidt, Libor -Spacek and Jiri Spitz for contributions, suggestions and bug reports. - -** Pure 0.2 2008-05-04 - -On the heels of Pure 0.1 comes the first bugfix release which addresses a -couple of bugs, misfeatures and Mac OSX compatibility issues, please refer to -the ChangeLog for details. I also added a more detailed INSTALL guide (thanks -are due to Eddie Rucker who wrote most of the new material in this guide) and -updated the manpage with a few minor corrections and some remarks about issues -raised on the Pure mailing list. - -Please note that there are still some issues with Pure on 64 bit systems (as -well as on Ubuntu running on PowerPC) which are still on my TODO list, these -will hopefully be fixed in the next release. - -Thanks to all who sent in bug reports and patches, in particular: Chris -Double, Tim Haynes, Eddie Rucker, Ryan Schmidt and Libor Spacek. (I hope I -didn't forget anyone.) - -** Pure 0.1 2008-04-29 - -The much-awaited initial release. ;-) The interpreter is already fully -functional, but of course there's still a lot to be done (see the TODO file -for details). Please note that this is a preliminary, "beta" release, so -expect some bugs (and please report them to the author!). - -The Pure project is now hosted at SourceForge, see http://pure-lang.sf.net. A -mailing list should soon be available, too. - -See the INSTALLATION section in the README file to get up and running quickly. -After Pure is installed, read the Pure manual page (also available in various -formats from the Pure website) and have a look at the stuff in the examples -subdir, especially hello.pure, and review the standard library modules -(lib/*.pure). - -Enjoy! - -Albert Graef <Dr....@t-...> Copied: pure/releases/pure-0.4/NEWS (from rev 265, pure/trunk/NEWS) =================================================================== --- pure/releases/pure-0.4/NEWS (rev 0) +++ pure/releases/pure-0.4/NEWS 2008-06-21 11:13:10 UTC (rev 275) @@ -0,0 +1,74 @@ + +** Pure 0.4 2008-06-19 + +This release features some more bug and portability fixes, a cleanup of the +source tree and an overhaul of the build system, see the ChangeLog for +details. Building a separate runtime lib on x86-64 works now (but requires a +patched LLVM, see the INSTALL file for details). Moreover, it is now possible +to install different Pure versions in parallel. + +An Emacs mode for Pure and support for executing Pure scripts using "shebangs" +has been added. Paging of the 'list' command is now implemented using the +program specified with the PURE_MORE environment variable. This allows you to +disable this option (if PURE_MORE is undefined) or choose any pager program +and options that you prefer. Define PURE_MORE=more in your shell startup files +to get back the old behaviour of piping 'list' output through 'more'. + +There's also a new syntax for multiple left-hand sides in function definitions +and 'case' rules, as suggested by Jiri Spitz and discussed on the mailing +list. Please refer to the manual page for details. To accommodate this change, +the bitwise operators '&' and '|' were renamed to 'and' and 'or', +respectively. + +** Pure 0.3 2008-06-06 + +This release sports a lot of improvements as well as bug and portability +fixes, see the ChangeLog for details. Many memory leaks have been plugged, and +tail call elimination has been improved a lot. The build system has gone +through a major overhaul, adding autoconf support. 64 bit support has been +improved as well, and Pure now builds and runs fine on MS Windows. Many +library functions have been rewritten to make them tail-recursive, and some +new functions have been added. Last but not least, the runtime support is now +implemented as a separate shared library which makes it possible to link +external modules against the runtime, and reduces the memory footprint when +multiple instances ... [truncated message content] |