Commit Graph

333 Commits (7b771fa21a892e481b07ae0c456ae4b3389e744c)

Author SHA1 Message Date
Fabrice Le Fessant 63a3924f47 Install all include files, and access internals with CAML_INTERNALS 2016-07-12 17:53:24 +02:00
alainfrisch c1ead896a2 Pass -slash to ocamldep so that dependencies generated from a Windows system are closer to those generated from a Unix system. 2016-04-13 17:04:15 +02:00
Damien Doligez 9166e7003e update .depend and bootstrap compilers before release 2016-02-29 14:07:07 +01:00
Damien Doligez 69a906872f tweak tools/check-typo and break more overlong lines 2016-02-19 17:13:53 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
David Allsopp f23d1424ee Add Unix.has_symlink 2016-02-10 23:25:39 +00:00
David Allsopp 616ef2cae7 Support Unix.symlink on Windows 2016-02-10 23:25:39 +00:00
Gabriel Scherer 8cbccbffe4 remove ocamlbuild-specific files 2016-02-01 15:05:18 -05:00
François Bobot 03ed6a0f51 [Stdlib] Ephemeron: add the module in the stdlib 2016-01-25 08:33:54 +01:00
Damien Doligez 0225ca01e3 GC latency improvements 2015-12-21 14:27:46 +01:00
Gabriel Scherer 1b8909d332 Revert "Simplify the use of custom .() and .[]"
This reverts commit 7e47735db8.

(Again, this required manual conflict resolution in parsing/parser.mly,
due to the change in argument label type)
2015-11-29 21:01:29 +01:00
Xavier Leroy ef8bc511ce PR#4023 and GPR#68: add Unix.sleepf and improve Unix.sleep
Follow-up to commit 50648ed: update otherlibs/threads.
2015-11-16 10:48:14 +01:00
Damien Doligez 7cb9a80744 simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo 2015-11-06 16:25:05 +01:00
François Bobot 203c444fd4 Make `Pervasives.ldexp` unboxed and noalloc 2015-11-05 13:07:03 +01:00
alainfrisch 0287ee2ecf Also adapt threads/pervasives.ml. 2015-10-28 16:46:12 +01:00
Jérémie Dimino 1b219582a0 Replace uses of "float" by [@@unboxed] [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16456 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:24 +00:00
Jérémie Dimino 62b89a3a5c Replace uses of "noalloc" by [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16455 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:22 +00:00
Gabriel Scherer 91d1e34e2d Document backtrace infrastructure, make types more explicit
From: Frédéric Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16366 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-22 06:04:20 +00:00
Gabriel Scherer 1957021b27 make alldepend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16318 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 18:34:09 +00:00
Gabriel Scherer e91bb93784 GPR#196: Make [Thread.id] and [Thread.self] [noalloc].
(Clark Gaebel)

These functions are called every tick of the Async scheduler, and
are the only remaining calls to [caml_c_call] every cycle. It would
be nice to remove them, especially since these functions don't
allocate.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16259 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:01:45 +00:00
Alain Frisch 49a2533472 PR#6902, GPR#210: runtime emits a warning when finalizing an I/O channel which is still open.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16245 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 13:11:26 +00:00
Damien Doligez 4b83d53fbc update .depend and bootstrap compilers after 4.02 merge
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16218 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 18:34:07 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Mark Shinwell 8df90ef051 Port fix for GPR#191 to trunk (making gc.h and some part of memory.h public)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16163 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-08 13:21:42 +00:00
Damien Doligez 0477bab3bf deduplicate some startup code and fix PR#6808: the parsing of OCAMLRUNPARAM is too lax
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16074 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-04 15:44:40 +00:00
Gabriel Scherer 19a5d5eb50 `type 'a result = Ok of 'a | Error of 'b` in Pervasives
(Yaron Minsky)

To whoever reads commit messages: the consensus on this change is
weak, which means the opinions can still evolve with experience using
the feature or seeing which external packages it affects. It is not
impossible that the change be reverted before a 4.03 release.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16011 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-12 18:44:59 +00:00
Damien Doligez 66af6470a6 PR#5418 (comments) : generate dependencies with $(CC) instead of gcc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-20 17:02:26 +00:00
Gabriel Scherer 7ca29ef3f7 PR#5887: move the byterun/*.h headers to byterun/caml/*.h to avoid header name clashes
(Jérôme Vouillon and Adrien Nader and Peter Zotov)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-27 14:41:49 +00:00
Gabriel Scherer 7e47735db8 Simplify the use of custom .() and .[]
This commit modifies the parser to use the newly defined .() and .[] operators. It also moves the definition of the standard .() and .[] operator for String/Bytes and Array to the pervasives module.

Before this commit, expressions of the form array.(index) and string.(index) where desugared to Array.get[_unsafe] array index and Strinf.get[_unsafe] string index. The unsafe or unsafe version were chosen depending on the presence of the "-unsafe" compiler option. Such expression are now desugared to ( .() ) array index and ( .[] ) string index respectively. The same desugar operation is applied to array.(index) <- value which becomes ( .()<- ) array index value.

In order to keep the standard semantic for the string and array index operations, these new index operators are defined in the pervasives module using new compiler primitives, e.g.
let .() = "%array_opt_get".
These new primitives are then mapped to safe or unsafe version depending on the
the "-unsafe" compiler option. Consequently, these modifications should have no impact on existing code.

With these modifications, defining custom .() and .[] operators should be easier, at the cost of losing access to the standard index operator for either array or string.

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:34 +00:00
Alain Frisch b66603a7b7 Use specialized marshal module in threads.cma.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15607 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-25 13:05:22 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Gabriel Scherer bb313fa192 Fix PR#6417: sprintf broken when local module named Pervasives is in scope
(Backport from Jacques' commit 4.02@14921)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14972 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-09 13:53:45 +00:00
Gabriel Scherer e0b000527b format+gadts: make format types "relational" to fix %(...%) typing
See the long comment in pervasives.ml for an explanation of the
change. The short summary is that we need to prove more elaborate
properties between the format types involved in the typing of %(...%),
and that proving things by writing GADT functions in OCaml reveals
that Coq's Ltac is a miracle of usability.

Proofs on OCaml GADTs are runtime functions that do have a runtime
semantics: it is legitimate to hope that those proof computations are
as simple as possible, but the current implementation was optimized
for feasability, not simplicity. François Bobot has some interesting
suggestions to simplify the reasoning part (with more equality
reasoning where I used transitivity and symmetry of the
relation profusely), which may make the code simpler in the future
(and possibly more efficient: the hope is that only %(...%) users will
pay a proof-related cost).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-21 13:23:13 +00:00
Gabriel Scherer 3ffa399b37 Use a nominal datatype for CamlinternalFormat.format6
This should make the type-checking of formats simpler and more robust:
instead of trying to find a pair as previously, we can now use the
path of the format6 type directly.

A nice side-effect of the change is that the internal definition of
formats (as a pair) is not printed in error messages anymore.
Because format6 is in fact defined in the CamlinternalFormatBasics
submodule of Pervasives, and has an alias at the toplevel of
Pervasives, error messages still expand the definition:

> Error: This expression has type
>          ('a, 'b, 'c, 'd, 'd, 'a) format6 =
>            ('a, 'b, 'c, 'd, 'd, 'a) CamlinternalFormatBasics.format6
>        but an expression was expected of type ...

Passing the option `-short-paths` does avoid this expansion and
returns exactly the same error message as 4.01:

> Error: This expression has type ('a, 'b, 'c, 'd, 'd, 'a) format6
>        but an expression was expected of type ...

(To get this error message without -short-paths, one would need to
define format6 directly in Pervasives; but this type is mutually
recursive with several GADT types that we don't want to add in the
Pervasives namespace unqualified. This is why I'll keep the alias
for now.)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14868 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:13 +00:00
Gabriel Scherer 8e52400ebe move code from pervasives.ml to camlinternalFormat.ml
This simplifies the charset-handling code, as camlinternalFormat is
allowed to depend on Bytes and String instead of re-importing the
needed primitives.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14837 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:27 +00:00
Gabriel Scherer 7f8e43aa9a minor strengthening of the typing of %{...%} formats
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14832 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:17 +00:00
Gabriel Scherer 39ab064baf introduce type aliases for simple padding and precision types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14825 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:05 +00:00
Gabriel Scherer bf6e3185c0 Add support for ignored scan_get_counter formats (%_[nlNL])
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14820 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:56 +00:00
Gabriel Scherer 628a2a2ed9 sync threads/pervasives.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14811 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:39 +00:00
Gabriel Scherer 72669307e8 second part of Benoît Vaugon's format+gadts patch
To finish the bootstrap cycle, run:

  make library-cross
  make promote
  make partialclean
  make core

  make library-cross
  make promote-cross
  make partialclean
  make ocamlc ocamllex ocamltools

  make library-cross
  make promote
  make partialclean
  make core
  make compare

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14810 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:37 +00:00
Gabriel Scherer 43647ba502 first part of Benoît Vaugon's format-gadts patch
After applying this patch, you should run:

  make library-cross
  make promote-cross
  make partialclean
  make ocamlc ocamllex ocamltools

and then immediately apply the following patches until the "second
part of Benoît Vaugon's format+gadts patch"; the bootstrap cycle is
not finished yet.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14806 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:29 +00:00
Damien Doligez 9baf42b72d safe-string: documentation fixes and add a couple of functions in Pervasives and Digest
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14721 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01 21:54:15 +00:00
Fabrice Le Fessant a72d304fa4 document __LOC__ in pervasives.mli
Also removes __FILE_OF__ and __MODULE_OF__, since they are not more precise
than __FILE__ and __MODULE__



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14715 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 14:22:27 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Damien Doligez 0cba565437 fix some whitespace
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14680 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 22:34:13 +00:00
Gabriel Scherer 2fc7ac7e8b [whitespace] bring threads/pervasives.ml closer to stdlib/pervasives.ml
(report by Hugo Heuzard)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14604 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 13:10:33 +00:00
Damien Doligez 7303ac34ca fix some of the whitespace problems in the source
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 10:17:02 +00:00
Fabrice Le Fessant 2859498cad Add %loc_* primitives and corresponding values in Pervasives
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14571 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-10 14:11:25 +00:00
Gabriel Scherer de4f4cf8b3 PR#6358: obey DESTDIR in install targets
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 07:06:17 +00:00