Skip to content

Commit

Permalink
Remove Stream, Genlex, Pervasives & the legacy bigarray libra…
Browse files Browse the repository at this point in the history
…ry (ocaml#10896)
  • Loading branch information
nojb authored Jan 20, 2022
1 parent e793bfa commit f4b6dce
Show file tree
Hide file tree
Showing 43 changed files with 137 additions and 1,251 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ Working version
Thread.wait_write, Thread.wait_read, the whole ThreadUnix module.
(Nicolás Ojeda Bär, review by Damien Doligez)

* #10896: Remove Stream, Genlex and Pervasives. Also remove legacy standalone
bigarray library (the Bigarray module is now part of the standard library).
(Nicolás Ojeda Bär, review by Kate Deplaix and Anil Madhavapeddy)

### Other libraries:

### Tools:
Expand Down
2 changes: 1 addition & 1 deletion HACKING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ link:stdlib/[]:: The standard library. Each file is largely
independent and should not need further knowledge.

link:otherlibs/[]:: External libraries such as `unix`, `threads`,
`dynlink`, `str` and `bigarray`.
`dynlink` and `str`.

Instructions for building the full reference manual are provided in
link:manual/README.md[]. However, if you only modify the documentation
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ clean::
$(MAKE) -C runtime clean
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib

otherlibs_all := bigarray dynlink \
otherlibs_all := dynlink \
str systhreads unix win32unix
subdirs := debugger lex ocamldoc ocamltest stdlib tools \
$(addprefix otherlibs/, $(otherlibs_all)) \
Expand Down
3 changes: 0 additions & 3 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ INSTALL_BYTECODE_PROGRAMS=@install_bytecode_programs@

### Which libraries to compile and install
# Currently available:
# bigarray Large, multidimensional numerical arrays
# (legacy support: this library is now part of the
# Standard Library)
# dynlink Dynamic linking (bytecode and native)
# (win32)unix Unix system calls
# str Regular expressions and high-level string processing
Expand Down
4 changes: 2 additions & 2 deletions README.win32.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ your `~/.bashrc` file.
the performance of bytecode programs is about 2/3 of that obtained under
Unix/GCC, Cygwin or Mingw-w64 on similar hardware.

* Libraries available in this port: `bigarray`, `dynlink`, `num`,
* Libraries available in this port: `dynlink`, `num`,
`str`, `threads`, and large parts of `unix`.

* The replay debugger is partially supported (no reverse execution).
Expand Down Expand Up @@ -279,7 +279,7 @@ After installing, you will need to ensure that `ocamlopt` (or `ocamlc -custom`)
can access the C compiler. You can do this either by using OCaml from Cygwin's
bash or by adding Cygwin's bin directory (e.g. `C:\cygwin\bin`) to your `PATH`.

* Libraries available in this port: `bigarray`, `dynlink`, `num`,
* Libraries available in this port: `dynlink`, `num`,
`str`, `threads`, and large parts of `unix`.

* The replay debugger is partially supported (no reverse execution).
Expand Down
7 changes: 3 additions & 4 deletions api_docgen/Makefile.docfiles
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dynlink_MLIS := dynlink.mli
thread_MLIS := \
thread.mli event.mli

STDLIB=$(filter-out stdlib__Pervasives, $(STDLIB_MODULES))
STDLIB=$(STDLIB_MODULES)

stdlib_UNPREFIXED=$(filter-out pervasives, $(STDLIB_MODULE_BASENAMES))
stdlib_UNPREFIXED=$(STDLIB_MODULE_BASENAMES)

otherlibref := $(dynlink_MLIS:%.mli=%)

Expand All @@ -55,9 +55,8 @@ ifneq "$(filter systhreads,$(OTHERLIBRARIES))" ""
otherlibref += $(thread_MLIS:%.mli=%)
endif

libref_EXTRA=stdlib__pervasives
libref_TEXT=Ocaml_operators Format_tutorial
libref_C=$(call capitalize,$(libref) $(libref_EXTRA))
libref_C=$(call capitalize,$(libref))

PARSING_MLIS := $(call sort, \
$(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))\
Expand Down
13 changes: 3 additions & 10 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ AC_ARG_ENABLE([unix-lib],
[AS_HELP_STRING([--disable-unix-lib],
[do not build the unix library])])

AC_ARG_ENABLE([bigarray-lib],
[AS_HELP_STRING([--disable-bigarray-lib],
[do not build the legacy separate bigarray library])])
AC_ARG_ENABLE([bigarray-lib], [],
[AC_MSG_ERROR([The bigarray-lib option was deleted in OCaml 5.00, \
as the Bigarray module is now part of the standard library.])],
[])

AC_ARG_ENABLE([ocamldoc],
[AS_HELP_STRING([--disable-ocamldoc],
Expand Down Expand Up @@ -425,9 +426,7 @@ AC_ARG_WITH([flexdll],
AS_IF([test x"$enable_unix_lib" = "xno"],
[AS_IF([test x"$enable_debugger" = "xyes"],
[AC_MSG_ERROR([replay debugger requires the unix library])],
[enable_debugger="no"])
AS_IF([test x"$enable_bigarray_lib" = "xyes"],
[AC_MSG_ERROR([legacy bigarray library requires the unix library])])])
[enable_debugger="no"])])

AS_IF([test x"$enable_unix_lib" = "xno" -o x"$enable_str_lib" = "xno"],
[AS_IF([test x"$enable_ocamldoc" = "xyes"],
Expand Down Expand Up @@ -547,9 +546,7 @@ AS_CASE([$host],
otherlibraries="dynlink"
AS_IF([test x"$enable_unix_lib" != "xno"],
[enable_unix_lib=yes
AS_IF([test x"$enable_bigarray_lib" != "xno"],
[otherlibraries="$otherlibraries $unixlib bigarray"],
[otherlibraries="$otherlibraries $unixlib"])])
otherlibraries="$otherlibraries $unixlib"])
AS_IF([test x"$enable_str_lib" != "xno"],
[otherlibraries="$otherlibraries str"])

Expand Down
3 changes: 0 additions & 3 deletions manual/src/library/core.etex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,4 @@ indexed at the end of this report.
\fi
\begin{linklist}
\libdocitem{Stdlib}{the initially opened module}
\ifouthtml%
\item Module \texttt{Pervasives}: deprecated alias for Stdlib
\fi%
\end{linklist}
4 changes: 0 additions & 4 deletions manual/src/library/stdlib-blurb.etex
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ indentation and line breaking \\
\end{tabular}
\subsubsection*{sss:stdlib-parsing}{Parsing:}
\begin{tabular}{lll}
"Genlex" & p.~\stdpageref{Genlex} & a generic lexer over streams \\
"Lexing" & p.~\stdpageref{Lexing} & the run-time library for lexers generated by "ocamllex" \\
"Parsing" & p.~\stdpageref{Parsing} & the run-time library for parsers generated by "ocamlyacc" \\
"Stream" & p.~\stdpageref{Stream} & basic functions over streams \\
\end{tabular}
\subsubsection*{sss:stdlib-system}{System interface:}
\begin{tabular}{lll}
Expand Down Expand Up @@ -141,7 +139,6 @@ be called from C \\
\stddocitem{Format}{pretty printing}
\stddocitem{Fun}{function values}
\stddocitem{Gc}{memory management control and statistics; finalized values}
\stddocitem{Genlex}{a generic lexical analyzer}
\stddocitem{Hashtbl}{hash tables and hash functions}
\stddocitem{In_channel}{input channels}
\stddocitem{Int}{integers}
Expand Down Expand Up @@ -171,7 +168,6 @@ be called from C \\
\stddocitem{Semaphore}{semaphores, another thread synchronization mechanism}
\stddocitem{Stack}{last-in first-out stacks}
\stddocitem{StdLabels}{include modules \texttt{Array}, \texttt{List} and \texttt{String} with labels}
\stddocitem{Stream}{streams and parsers}
\stddocitem{String}{string operations}
\stddocitem{StringLabels}{string operations (with labels)}
\stddocitem{Sys}{system interface}
Expand Down
2 changes: 1 addition & 1 deletion manual/tests/check-stdlib-modules
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cut -c 2- $TMPDIR/stdlib-$$-files \
exitcode=0
for i in `cat $TMPDIR/stdlib-$$-modules`; do
case $i in
Stdlib | Camlinternal* | *Labels | Obj | Pervasives | In_channel | Out_channel) continue;;
Stdlib | Camlinternal* | *Labels | Obj | In_channel | Out_channel) continue;;
esac
grep -q -e '"'$i'" & p\.~\\stdpageref{'$i'} &' $1/manual/src/library/stdlib-blurb.etex || {
echo "Module $i is missing from the module description in library/stdlib-blurb.etex." >&2
Expand Down
2 changes: 1 addition & 1 deletion otherlibs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ROOTDIR=..
include $(ROOTDIR)/Makefile.common

OTHERLIBRARIES ?= bigarray dynlink str systhreads \
OTHERLIBRARIES ?= dynlink str systhreads \
unix win32unix

# $1: target name to dispatch to all otherlibs/*/Makefile
Expand Down
5 changes: 0 additions & 5 deletions otherlibs/bigarray/.depend

This file was deleted.

26 changes: 0 additions & 26 deletions otherlibs/bigarray/Makefile

This file was deleted.

15 changes: 0 additions & 15 deletions otherlibs/bigarray/bigarray.ml

This file was deleted.

15 changes: 0 additions & 15 deletions otherlibs/bigarray/bigarray.mli

This file was deleted.

Empty file removed otherlibs/bigarray/empty.c
Empty file.
35 changes: 0 additions & 35 deletions stdlib/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -362,24 +362,6 @@ stdlib__Gc.cmx : gc.ml \
stdlib__Gc.cmi
stdlib__Gc.cmi : gc.mli \
stdlib__Printexc.cmi
stdlib__Genlex.cmo : genlex.ml \
stdlib__String.cmi \
stdlib__Stream.cmi \
stdlib__List.cmi \
stdlib__Hashtbl.cmi \
stdlib__Char.cmi \
stdlib__Bytes.cmi \
stdlib__Genlex.cmi
stdlib__Genlex.cmx : genlex.ml \
stdlib__String.cmx \
stdlib__Stream.cmx \
stdlib__List.cmx \
stdlib__Hashtbl.cmx \
stdlib__Char.cmx \
stdlib__Bytes.cmx \
stdlib__Genlex.cmi
stdlib__Genlex.cmi : genlex.mli \
stdlib__Stream.cmi
stdlib__Hashtbl.cmo : hashtbl.ml \
stdlib__Sys.cmi \
stdlib__String.cmi \
Expand Down Expand Up @@ -581,10 +563,6 @@ stdlib__Parsing.cmx : parsing.ml \
stdlib__Parsing.cmi : parsing.mli \
stdlib__Obj.cmi \
stdlib__Lexing.cmi
stdlib__Pervasives.cmo : pervasives.ml \
camlinternalFormatBasics.cmi
stdlib__Pervasives.cmx : pervasives.ml \
camlinternalFormatBasics.cmx
stdlib__Printexc.cmo : printexc.ml \
stdlib.cmi \
stdlib__Printf.cmi \
Expand Down Expand Up @@ -738,19 +716,6 @@ stdlib__StdLabels.cmi : stdLabels.mli \
stdlib__ArrayLabels.cmi
std_exit.cmo :
std_exit.cmx :
stdlib__Stream.cmo : stream.ml \
stdlib__String.cmi \
stdlib__List.cmi \
stdlib__Lazy.cmi \
stdlib__Bytes.cmi \
stdlib__Stream.cmi
stdlib__Stream.cmx : stream.ml \
stdlib__String.cmx \
stdlib__List.cmx \
stdlib__Lazy.cmx \
stdlib__Bytes.cmx \
stdlib__Stream.cmi
stdlib__Stream.cmi : stream.mli
stdlib__String.cmo : string.ml \
stdlib.cmi \
stdlib__Bytes.cmi \
Expand Down
6 changes: 3 additions & 3 deletions stdlib/StdlibModules
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
# with lowercase first letters). These must be listed in dependency order.
STDLIB_MODULE_BASENAMES = \
camlinternalFormatBasics camlinternalAtomic \
stdlib pervasives either \
stdlib either \
sys obj camlinternalLazy lazy \
seq option result bool char uchar \
list int bytes string unit marshal array float int32 int64 nativeint \
lexing parsing set map stack queue stream buffer \
lexing parsing set map stack queue buffer \
atomic mutex condition semaphore domain \
camlinternalFormat printf arg \
printexc fun gc digest bigarray random hashtbl weak \
format scanf callback camlinternalOO oo camlinternalMod genlex ephemeron \
format scanf callback camlinternalOO oo camlinternalMod ephemeron \
filename complex arrayLabels listLabels bytesLabels stringLabels moreLabels \
stdLabels in_channel out_channel effect

Expand Down
Loading

0 comments on commit f4b6dce

Please sign in to comment.