(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
(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
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
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
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
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
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
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
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
Noticed that I had to bootstrap to test on ARM, so I commit a new bootstrap
compiler.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
14278
14277
14276
14176
14175
14173
14172
14171
14169
14168
14167
These changes need to mature on their own branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14329 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
This script was built from ocamlcomp.sh.in through sed and is called
instead of "ocamlc" (for instance).
It makes it possible to switch from "ocamlc" to "ocamlc.opt" without
changing anything in the Makefiles, only calling sed.
I couldn't cleanly make it handle both a compiler for the target and for
the build. Instead I'm replacing it and doing as much as possible
directly in the Makefiles.
I hoped it would reduce the number of shell invocations, which would
speed things up quite a lot on Windows but I still had to have at least
one since it's not possible to update a make variable from inside a make
rule: i.e. it's not possible to do X=a, build a.opt and update X to be
a.opt.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02