`cmark`’s pretty-printer matches our output pretty well, with a few differences:
- it puts a space between the fence and the info string for in code blocks;
- it prefers `-` over `*` for bulleted lists (as do I) and it indents them;
- it `\`-escapes certain chars very conservatively;
- it prefers indented/unfenced code blocks if there is no info string; and
- it prefers `*` over `_` (unlike any sane person).
This also shows how the change fixes a number of issues:
- fix2158-1.output.md also illustrates how this change fixes#1809;
- alias-many.output.md and input-parse-errors.output.md show how fenced
code blocks without an info string would use the beginning of the
content as the info string;
- transcripts-round-trip/main.output.md shows how output blocks for
generated `unison` stanzas (which could contain nested fenced blocks)
might not have long-enough fences; and
- error-messages.output.md and generic-parse-errors.output.md show how
Unison errors were reported on the wrong line number (and thus the
printed error lines were also incorrect).
This should avoid any possibility of picking conflicting names for
distinct functions. I'm not aware of any actual examples of this, but it
could in principle happen.
I decided to use the full length hashes because picking just-long-enough
names starts to become very cumbersome when doing dynamic loading. You
need to keep track of all your past choices, not just the choices for
the module you're loading, because the one you're loading could refer to
things in previously loaded modules. It would be possible to use shorter
names in a compile-time context, since you have all the names up front.
But you'd still have to remember _those_ for runtime loading, and it
seemed not worth it.
This doesn't include any custom error formatting, because I'd like to
see error messages in the wild before doing anything, but if they're too
verbose, it's possible to override the Racket error reporting to produce
shorter names there, rather than generating them up front.
Makes various internal values print more nicely, which makes debugging
more tractable. Links now print as base32hex strings like they would in
ucm. Functions inside unison structures print as their hash if possible.
Also, short hashes are printed in most cases, rather than the full hash.
Had to shuffle around some bytevector stuff to make the above work.
Pulled `tryEval` completely into primops, and made it directly do an
exception request, rather than implementing the TFRC pseudo instruction.
This requires a share bump, as does a fix to the `Failure` data info.
Some of the exception/failure related internal functions were wrapping
the last argument in Any when they shouldn't have, causing errors for
code expecting a single wrapper.
- Changes the naming convention for builtin types/data to avoid clashes
between builtins and pregenerated data types. For instance, both had a
Value type in scheme, because of the in-unison representation. Instead
of just `unison-`, now either `builtin-` or `ref-` prefixes are used.
- Fixes several places where invalid values were being used in
exceptions. Raw scheme values were being returned that do not
correspond to unison values, and this was causing problems with
reflection.
- Fixes some code loading operations returning in-unison `Reference`
values instead of term link values. Parts of these are implemented in
unison, so both types are in play, and need to be correctly mediated.