Melange_compiler_libs.Primitive
type native_repr =
| Same_as_ocaml_repr
| Unboxed_float
| Unboxed_integer(boxed_integer)
| Untagged_immediate
;
type description = pri {
prim_name: string,
prim_arity: int,
prim_alloc: bool,
prim_native_name: string,
prim_native_repr_args: list(native_repr),
prim_native_repr_res: native_repr,
};
let simple: name:string => arity:int => alloc:bool => description;
let make:
name:string =>
alloc:bool =>
native_name:string =>
native_repr_args:list(native_repr) =>
native_repr_res:native_repr =>
description;
let parse_declaration:
Parsetree.value_description =>
native_repr_args:list(native_repr) =>
native_repr_res:native_repr =>
description;
let print: description => Outcometree.out_val_decl => Outcometree.out_val_decl;
let native_name: description => string;
let byte_name: description => string;
let equal_boxed_integer: boxed_integer => boxed_integer => bool;
let equal_native_repr: native_repr => native_repr => bool;
let native_name_is_external: description => bool;
native_name_is_externa
returns true
iff the native_name
for the given primitive identifies that the primitive is not implemented in the compiler itself.
exception Error(Location.t, error);