Related to https://github.com/idris-lang/Idris2/pull/548.
The PR linked above adds `Cast` implementations for `BitsN` types. These
implementations use primitive functions which are not available in
Iris2-boot. This commit adds these functions as a stub to make the Prelude
in Idris2 compile again.
From here on, this repo is intended only as a bootstrapping step for the
self hosted Idris 2. It will - as long as possible - be kept up to date
enough that it can build Idris 2, but won't be maintained beyond that.
This gives the right location for finding libraries on the Mac, where
dirname has slightly different behaviour.
It does now require 'realpath' to be installed, which on the Mac is part
of 'coreutils' which can be installed via 'brew'
There was a lot of repeated work in packages, since it tried to build
the module tree starting from every listed module. Now, it skips the
ones where they're already in the tree.
It should be -O2 for the rts, but -O2 takes ages for idris2.c so should
be saved for releases (also OPT should be able to be edited easily for
e.g. adding profiling)
Also default to clang (perhaps it would be better if we could check
whether clang was available first, but it does a better job as the
default overall).
Surprisingly, this doesn't affect performance - it shows up as about the
same in the profile. But more importantly, it ports more directly to
Idris 2, which can't guarantee that 'strTail' doesn't allocate at
runtime, so using a List Char here is much more efficient.
This probably points to the need for better string primitives. Later...
Sorry, I should look more carefully... contrib is a space for incoming
experimental libraries that might get sorted into something better, so
it shouldn't be a place for things that are in the default library path
(this is consistent with Idris 1 behaviour)
Switch (un)marshalling of Integer values to Bits8 instead of Int.
Previously, in `fromLimbs`, the read values arrived as a list of
(32-bit) Ints. If any of the limbs had its MSB set, it would be
interpreted as a negative number and corrupt the result.
This commit fixes this by using a `List Bits8` instead, which has an
explicit (and direct) mapping to Bytes in the Buffer, where it's
eventually stored. This way no awkard casts need to happen.