diff --git a/Changes b/Changes index f3245d570..a0ae5194b 100644 --- a/Changes +++ b/Changes @@ -4,11 +4,19 @@ Objective Caml 1.06: * Language: - Added two new keywords: "assert" (check assertion) and "lazy" (delay evaluation). - - Added "protected" methods (visible only from subclasses, can be hidden - in class type declared in module signature). - Allow identifiers to start with "_" (such identifiers are treated as lowercase idents). +* Objects: + - Added "protected" methods (visible only from subclasses, can be hidden + in class type declared in module signature). + - Objects can be compared using generic comparison functions. + - Fixed compilation of partial application of object constructors. + +* Type system: + - Occur-check now more strict (all recursions must traverse an object). + - A few bugs fixed. + * Run-time system: - A heap compactor was implemented, so long-running programs can now fight fragmentation. @@ -27,8 +35,8 @@ Objective Caml 1.06: - Better printing of uncaught exceptions. * Both compilers: - - Parsing: better reporting of syntax errors (e.g. shows unmatched opening - parenthesis on missing closing parenthesis). + - Parsing: more detailed reporting of syntax errors (e.g. shows + unmatched opening parenthesis on missing closing parenthesis). - Check consistency between interfaces (.cmi). - Revised rules for determining dependencies between modules. - Options "-verbose" for printing calls to C compiler, "-noassert" @@ -37,7 +45,7 @@ Objective Caml 1.06: * Native-code compiler: - Machine-dependent parts rewritten using inheritance instead of parameterized modules. - - GC bug in value letrec fixed. + - GC bug in value let rec fixed. - Port to Linux/Alpha. - Sparc: cleaned up use of %g registers, now compatible with Solaris threads. @@ -46,32 +54,23 @@ Objective Caml 1.06: - Reads commands from ./.ocamlinit on startup. - Now thread-compatible. -* Typing: - - Occur-check now stricter (all recursions must traverse an object). - - A few bugs fixed. - -* Objects: - - Private methods. - - Objects can be compared using generic comparison functions. - - Fixed compilation of partial application of object constructors. - * Standard library: + - New library module: Lazy (delayed computations). + - New library module: Marshal. Allows marshalling to strings and + transmission of closures between identical programs (SPMD parallelism). - Filename: "is_absolute" is superseded by "is_implicit" and "is_relative". To adapt old programs, change "is_absolute x" to "not (is_implicit x)" (but the new "is_relative" is NOT the opposite of the old "is_absolute"). - Array, Hashtbl, List, Map, Queue, Set, Stack, Stream: the "iter" functions now take as argument a unit-returning function. - - New library module: Lazy (delayed computations). - Format: added "printf" interface to the formatter (see the documentation). Revised behaviour of simple boxes: no more than one new line is output when consecutive break hints should lead to multiple line breaks. - - New library module: Marshal. Allows marshalling to strings and - transmission of closures between identical programs (SPMD parallelism). - Stream: revised implementation, renamed Parse_failure to Failure and Parse_error to Error (don't you love gratuitous changes?). - String: added index, rindex, index_from, rindex_from. - - Added Map.map, Set.subset, Printexc.to_string, Array.mapi, - Array.iteri, Array.fold_left, Array.fold_right, Array.init. + - Array: added mapi, iteri, fold_left, fold_right, init. + - Added Map.map, Set.subset, Printexc.to_string. * ocamllex: lexers generated by ocamllex can now handle all characters, including '\000'. diff --git a/INSTALL b/INSTALL index 96997f599..307342515 100644 --- a/INSTALL +++ b/INSTALL @@ -60,8 +60,8 @@ The "configure" script accepts the following options: conformant POSIX 1003.1c implementation on your system. As a rule of thumb, this option works under Solaris 2.5 and later, Digital Unix 4.0, and Linux with the LinuxThreads library. - It will *not* work under Digital Unix 3.2 or earlier, HPUX, - AIX, nor Linux without LinuxThreads. + It will *not* work under Digital Unix 3.2 or earlier, SunOS 4, + HPUX, AIX, nor Linux without LinuxThreads. Examples: ./configure -bindir /usr/bin -libdir /usr/lib/ocaml -mandir /usr/man/manl @@ -86,9 +86,9 @@ This phase is fairly verbose; consider redirecting the output to a file: make world > log.world 2>&1 # in sh make world >& log.world # in csh -3- To be sure everything works well, you can try to bootstrap the -system --- that is, to recompile all Objective Caml sources with -the newly created compiler. From the top directory, do: +3- (Optional) To be sure everything works well, you can try to +bootstrap the system --- that is, to recompile all Objective Caml +sources with the newly created compiler. From the top directory, do: make bootstrap @@ -115,7 +115,23 @@ or: make opt > log.opt 2>&1 # in sh make opt >& log.opt # in csh -5- You can now install the Objective Caml system. This will create the +5- (Optional) If you want to give the native-code compiler a serious +test, you can try to compile the Objective Caml compilers with the +native-code compiler (they are compiled to bytecode by default). +Just do: + + make ocamlc.opt # to build a native-code version of ocamlc + make ocamlopt.opt # to build a native-code version of ocamlopt + +Later, you can compile your programs to bytecode using ocamlc.opt +instead of ocamlc, and to native-code using ocamlopt.opt instead of +ocamlopt. The ".opt" compilers should run faster than the normal +compilers, especially on large input files, but they may take longer +to start due to increased code size. If compilation times are an issue on +your programs, try the ".opt" compilers to see if they make a +significant difference. + +6- You can now install the Objective Caml system. This will create the following commands (in the binary directory selected during autoconfiguration): ocamlc the batch bytecode compiler @@ -131,17 +147,22 @@ following commands (in the binary directory selected during autoconfiguration): ocamlprof execution count profiler ocamlcp the bytecode compiler in profiling mode +and also, if you built them during step 5, + + ocamlc.opt the batch bytecode compiler compiled with ocamlopt + ocamlopt.opt the batch native-code compiler compiled with ocamlopt + From the top directory, become superuser and do: umask 022 # make sure to give read & execute permission to all make install -6- Installation is complete. Time to clean up. From the toplevel +7- Installation is complete. Time to clean up. From the toplevel directory, do "make clean". -7- The emacs/ subdirectory contains Emacs-Lisp files for an Objective Caml -editing mode and an interface for the debugger. To install these -files, change to the emacs/ subdirectory and do +8- (Optional) The emacs/ subdirectory contains Emacs-Lisp files for an +Objective Caml editing mode and an interface for the debugger. To +install these files, change to the emacs/ subdirectory and do make EMACSDIR= install or diff --git a/LICENSE b/LICENSE index 2116f658c..bfd08912b 100644 --- a/LICENSE +++ b/LICENSE @@ -64,7 +64,7 @@ freely, with the sole condition that the distribution includes the following statement: "This software includes the Objective Caml run-time system, - which is copyright 1996 INRIA." + which is copyright 1996, 1997 INRIA." Executable files that include the Objective Caml interactive system (such as those generated by the ocamlmktop command) can also be @@ -72,5 +72,5 @@ distributed freely, with the sole condition that the distribution includes the following statement: "This software includes the Objective Caml interactive system, - which is copyright 1996 INRIA." + which is copyright 1996, 1997 INRIA." diff --git a/Makefile b/Makefile index 7c802eb1d..5a65cb511 100644 --- a/Makefile +++ b/Makefile @@ -206,6 +206,8 @@ installopt: cp ocamlopt $(BINDIR)/ocamlopt cd stdlib; $(MAKE) installopt for i in $(OTHERLIBRARIES); do (cd otherlibs/$$i; $(MAKE) installopt); done + if test -f ocamlc.opt; then cp ocamlc.opt $(BINDIR)/ocamlc.opt; else :; fi + if test -f ocamlopt.opt; then cp ocamlopt.opt $(BINDIR)/ocamlopt.opt; else :; fi clean:: partialclean @@ -289,15 +291,14 @@ partialclean:: beforedepend:: parsing/linenum.ml -# The compiler compiled with the native-code compiler -# Currently not working because it requires C primitives from byterun/meta.c -# which are not provided by asmrun/libasmrun.a +# The bytecode compiler compiled with the native-code compiler -# ocamlc.opt: $(COMPOBJS:.cmo=.cmx) -# $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) -# -#partialclean:: -# rm -f ocamlc.opt +ocamlc.opt: $(COMPOBJS:.cmo=.cmx) + cd asmrun; $(MAKE) meta.o + $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) asmrun/meta.o + +partialclean:: + rm -f ocamlc.opt # The native-code compiler compiled with itself diff --git a/Makefile.nt b/Makefile.nt index e64cf6e48..7741bfd30 100644 --- a/Makefile.nt +++ b/Makefile.nt @@ -289,12 +289,11 @@ partialclean:: beforedepend:: parsing\linenum.ml -# The compiler compiled with the native-code compiler -# Currently not working because it requires C primitives from byterun\meta.c -# which are not provided by asmrun\libasmrun.lib +# The bytecode compiler compiled with the native-code compiler -# ocamlc.opt: $(COMPOBJS:.cmo=.cmx) -# $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) +ocamlc.opt: $(COMPOBJS:.cmo=.cmx) + cd asmrun & $(MAKEREC) meta.o + $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) asmrun\meta.o partialclean:: rm -f ocamlc.opt diff --git a/asmrun/Makefile b/asmrun/Makefile index 5f1e6cdc9..f50fe9c01 100644 --- a/asmrun/Makefile +++ b/asmrun/Makefile @@ -87,11 +87,13 @@ weak.c: ../byterun/weak.c ln -s ../byterun/weak.c weak.c compact.c: ../byterun/compact.c ln -s ../byterun/compact.c compact.c +meta.c: ../byterun/meta.c + ln -s ../byterun/meta.c meta.c LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c \ compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \ parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \ - weak.c compact.c + weak.c compact.c meta.c clean:: rm -f $(LINKEDFILES) diff --git a/asmrun/Makefile.nt b/asmrun/Makefile.nt index 1d0e58adb..056a72964 100644 --- a/asmrun/Makefile.nt +++ b/asmrun/Makefile.nt @@ -75,11 +75,13 @@ weak.c: ../byterun/weak.c cp ../byterun/weak.c weak.c compact.c: ../byterun/compact.c cp ../byterun/compact.c compact.c +meta.c: ../byterun/meta.c + cp ../byterun/meta.c meta.c LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c \ compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \ parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \ - weak.c + weak.c compact.c meta.c wincmdline.obj: ../byterun/wincmdline.c $(CC) /c $(NATIVECCCOMPOPTS) ..\byterun\wincmdline.c diff --git a/boot/ocamlc b/boot/ocamlc index 3edb6a1a3..fd66930d6 100755 Binary files a/boot/ocamlc and b/boot/ocamlc differ diff --git a/byterun/meta.c b/byterun/meta.c index 84e6dc5fe..2e995fffc 100644 --- a/byterun/meta.c +++ b/byterun/meta.c @@ -15,6 +15,7 @@ #include "alloc.h" #include "config.h" +#include "fail.h" #include "fix_code.h" #include "interp.h" #include "major_gc.h" @@ -25,6 +26,8 @@ #include "prims.h" #include "stacks.h" +#ifndef NATIVE_CODE + value get_global_data(value unit) /* ML */ { return global_data; @@ -74,3 +77,24 @@ value get_current_environment(value unit) /* ML */ { return *extern_sp; } + +#else + +/* Dummy definitions to support compilation of ocamlc.opt */ + +value get_global_data(value unit) +{ + invalid_argument("Meta.get_global_data"); +} + +value realloc_global(value size) +{ + invalid_argument("Meta.realloc_global"); +} + +value available_primitives(value unit) +{ + invalid_argument("Meta.available_primitives"); +} + +#endif diff --git a/parsing/parser.mly b/parsing/parser.mly index 58cd167fe..a326b9493 100644 --- a/parsing/parser.mly +++ b/parsing/parser.mly @@ -423,10 +423,6 @@ expr: { mkexp(Pexp_apply($1, List.rev $2)) } | LET rec_flag let_bindings IN seq_expr %prec prec_let { mkexp(Pexp_let($2, List.rev $3, $5)) } - | LET rec_flag let_bindings IN error %prec prec_let - { syntax_error() } - | LET rec_flag let_bindings error %prec prec_let - { unclosed "let" 1 "in" 4 } | PARSER opt_pat opt_bar parser_cases %prec prec_fun { Pstream.cparser ($2, List.rev $4) } | FUNCTION opt_bar match_cases %prec prec_fun @@ -441,8 +437,6 @@ expr: { mkexp(Pexp_try($2, List.rev $5)) } | TRY seq_expr WITH error %prec prec_try { syntax_error() } - | TRY seq_expr error %prec prec_try - { unclosed "try" 1 "with" 3 } | expr_comma_list { mkexp(Pexp_tuple(List.rev $1)) } | constr_longident simple_expr %prec prec_constr_appl @@ -453,12 +447,8 @@ expr: { mkexp(Pexp_ifthenelse($2, $4, None)) } | WHILE seq_expr DO seq_expr DONE { mkexp(Pexp_while($2, $4)) } - | WHILE seq_expr DO seq_expr error - { unclosed "while" 1 "done" 5 } | FOR val_ident EQUAL seq_expr direction_flag seq_expr DO seq_expr DONE { mkexp(Pexp_for($2, $4, $6, $5, $8)) } - | FOR val_ident EQUAL seq_expr direction_flag seq_expr DO seq_expr error - { unclosed "for" 1 "done" 9 } | expr COLONCOLON expr { mkexp(Pexp_construct(Lident "::", Some(mkexp(Pexp_tuple[$1;$3])), false)) } | expr INFIXOP0 expr diff --git a/test/Makefile b/test/Makefile index f39053f76..2634316d4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -17,8 +17,7 @@ CODE_EXE=$(BYTE_EXE:.byt=.out) default: make all - make test bytetest - #cd Moretest; make + make codetest bytetest all: $(BYTE_EXE) $(CODE_EXE) diff --git a/utils/config.mlp b/utils/config.mlp index 7b2257f51..b1768543d 100644 --- a/utils/config.mlp +++ b/utils/config.mlp @@ -11,7 +11,7 @@ (* $Id$ *) -let version = "1.06-1/17" +let version = "1.06" let standard_library = try