[m-rev.] for post-commit review: grade-and-architecture-specific extensions

Julien Fischer jfischer at opturion.com
Sat Sep 21 01:34:19 AEST 2024


On Sat, 21 Sept 2024 at 01:13, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
>
> On Sat, 21 Sep 2024 00:56:36 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> > >  :- type ext_cur_gs
> > > +    --->    ext_cur_gs_lib_init                 % ".init"
> > > +    ;       ext_cur_gs_lib_jar.                 % ".jar"
> >
> > I assume you put .jar files in the _gs category, because Java byte code
> > is not architecture specific?
>
> Yes, that's right.
>
> > However, the CIL byte code used in the.dll files
> > generated in the C# grade is similarly architecture independent,
>
> I thought .dll files generally contain ISA-specific code, so I figured
> the C# compilers we now use generated real, not virtual, machine code.

The C# compilers we use generate CIL bytecode (MS-IL) by default.
(That bytecode can be further compiled into native code, but we don't
do that for Mercury; AOT compilation options also exist for Java.)

...

> Actually, file_names.m can treat the two kinds of .dlls separately.
> We can put dlls into the _gs category as ext_cur_gs_lib_dll,
> while ext_cur_gas_lib_sh_lib_opt remains in the _gas category.
> Specifying "--shared-library-extension .dll" makes *those* .dll files
> ISA-dependent.

That seems fine.  Note that we don't currently support creating dlls
in C grades at the moment anyway.  (I think it's unlikely support
for them will ever be added, but I'd like to keep the possibility
open.)

Julien.


More information about the reviews mailing list