Re: [MLton] Implementation of processing ML Basis files

Matthew Fluet <[email protected]> Wed, 6 Aug 2025 12:09:49 -0400
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <CAMrhFL4AHJcKG8EvMcX8HpetOGpE5qHwm_AgnU+Cy_DKBiVgQw@mail.gmail.com>
--===============3483808415869698662==
Content-Type: multipart/alternative; boundary="000000000000b030d5063bb492da"

--000000000000b030d5063bb492da
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Haven't tried it, but it is advertised as matching the MLB specification
(which isn't that difficult, assuming the right environment manipulation
infrastructure in the compiler).  I especially like the support for
`compiler:xyzzy` annotations, which make it easy to include annotations for
different compilers without warnings about unknown annotations.


On Tue, Aug 5, 2025 at 8:07=E2=80=AFAM Gergely Buday <[email protected].=
uk>
wrote:

> My student has found this:
>
> https://github.com/vqns/polymlb
>
> What do you think of it, does it implement the semantical framework?
>
> - Gergely
>
> On Sun, 20 Jul 2025 at 13:38, Matthew Fluet <[email protected]>
> wrote:
> >
> > The amount of work to support MLB files really depends on the
> infrastructure around saving and restoring static environments and howeve=
r
> the host compiler represents the program post-type checking.
> >
> > In MLton, elaboration of MLBs is at:
> >
> https://github.com/MLton/mlton/blob/master/mlton/elaborate/elaborate-mlbs=
.fun
> > It's only 270 lines, but a lot of the interesting aspects come from the
> implementation of environments:
> >
> https://github.com/MLton/mlton/blob/master/mlton/elaborate/elaborate-env.=
sig
> >
> > MLton's implementation of environments is rather involved (and with a
> bit more mutable state than might be desired); I suspect that supporting
> MLBs would be simpler with a purely functional representation of
> environments.
> >
> >
> >
> > On Sat, Jul 19, 2025 at 10:54=E2=80=AFAM Gergely Buday via MLton-devel =
<
> [email protected]> wrote:
> >>
> >> Hi there,
> >>
> >> I ask this on the devel list as this is about the compiler itself.
> >>
> >> I would like to ask you to estimate how much work it would be to port
> >> MLton's .mlb file support to Poly/ML. I have a student who is willing
> >> to do it.
> >>
> >> I have found the semantics of ML Basis files:
> >>
> >> http://mlton.org/MLBasisSyntaxAndSemantics
> >>
> >> especially
> >>
> >> http://mlton.org/MLBasis.attachments/mlb-formal.pdf
> >>
> >> I have found the lexer and grammar files for it, which can be directly
> used:
> >>
> >> https://github.com/MLton/mlton/tree/master/mlton/front-end
> >>
> >> Where is the part which actually "evaluates" an .mlb file?
> >>
> >> And, what do you think, how much work would it be to port it?
> >>
> >> The ML Kit also supports ML Basis files, they write their libraries
> >> with .mlb files. So it would be useful to have this for Poly/ML as
> >> well.
> >>
> >> Yours
> >>
> >> - Gergely
> >>
> >>
> >> _______________________________________________
> >> MLton-devel mailing list
> >> [email protected]; [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/mlton-devel
>

--000000000000b030d5063bb492da
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,sa=
ns-serif;font-size:large">Haven&#39;t tried it, but it is advertised as mat=
ching the MLB specification (which isn&#39;t that difficult, assuming the r=
ight environment manipulation infrastructure in the compiler).=C2=A0 I espe=
cially like the support for `compiler:xyzzy` annotations, which make it eas=
y to include annotations for different compilers without warnings about unk=
nown annotations.</div><div class=3D"gmail_default" style=3D"font-family:ar=
ial,sans-serif;font-size:large"><br></div></div><br><div class=3D"gmail_quo=
te gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Aug=
 5, 2025 at 8:07=E2=80=AFAM Gergely Buday &lt;<a href=3D"mailto:g.buday@she=
ffield.ac.uk">[email protected]</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex">My student has found this:<br>
<br>
<a href=3D"https://github.com/vqns/polymlb" rel=3D"noreferrer" target=3D"_b=
lank">https://github.com/vqns/polymlb</a><br>
<br>
What do you think of it, does it implement the semantical framework?<br>
<br>
- Gergely<br>
<br>
On Sun, 20 Jul 2025 at 13:38, Matthew Fluet &lt;<a href=3D"mailto:matthew.f=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<br=
>
&gt;<br>
&gt; The amount of work to support MLB files really depends on the infrastr=
ucture around saving and restoring static environments and however the host=
 compiler represents the program post-type checking.<br>
&gt;<br>
&gt; In MLton, elaboration of MLBs is at:<br>
&gt;=C2=A0 =C2=A0<a href=3D"https://github.com/MLton/mlton/blob/master/mlto=
n/elaborate/elaborate-mlbs.fun" rel=3D"noreferrer" target=3D"_blank">https:=
//github.com/MLton/mlton/blob/master/mlton/elaborate/elaborate-mlbs.fun</a>=
<br>
&gt; It&#39;s only 270 lines, but a lot of the interesting aspects come fro=
m the implementation of environments:<br>
&gt;=C2=A0 =C2=A0<a href=3D"https://github.com/MLton/mlton/blob/master/mlto=
n/elaborate/elaborate-env.sig" rel=3D"noreferrer" target=3D"_blank">https:/=
/github.com/MLton/mlton/blob/master/mlton/elaborate/elaborate-env.sig</a><b=
r>
&gt;<br>
&gt; MLton&#39;s implementation of environments is rather involved (and wit=
h a bit more mutable state than might be desired); I suspect that supportin=
g MLBs would be simpler with a purely functional representation of environm=
ents.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Jul 19, 2025 at 10:54=E2=80=AFAM Gergely Buday via MLton-devel=
 &lt;<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi there,<br>
&gt;&gt;<br>
&gt;&gt; I ask this on the devel list as this is about the compiler itself.=
<br>
&gt;&gt;<br>
&gt;&gt; I would like to ask you to estimate how much work it would be to p=
ort<br>
&gt;&gt; MLton&#39;s .mlb file support to Poly/ML. I have a student who is =
willing<br>
&gt;&gt; to do it.<br>
&gt;&gt;<br>
&gt;&gt; I have found the semantics of ML Basis files:<br>
&gt;&gt;<br>
&gt;&gt; <a href=3D"http://mlton.org/MLBasisSyntaxAndSemantics" rel=3D"nore=
ferrer" target=3D"_blank">http://mlton.org/MLBasisSyntaxAndSemantics</a><br=
>
&gt;&gt;<br>
&gt;&gt; especially<br>
&gt;&gt;<br>
&gt;&gt; <a href=3D"http://mlton.org/MLBasis.attachments/mlb-formal.pdf" re=
l=3D"noreferrer" target=3D"_blank">http://mlton.org/MLBasis.attachments/mlb=
-formal.pdf</a><br>
&gt;&gt;<br>
&gt;&gt; I have found the lexer and grammar files for it, which can be dire=
ctly used:<br>
&gt;&gt;<br>
&gt;&gt; <a href=3D"https://github.com/MLton/mlton/tree/master/mlton/front-=
end" rel=3D"noreferrer" target=3D"_blank">https://github.com/MLton/mlton/tr=
ee/master/mlton/front-end</a><br>
&gt;&gt;<br>
&gt;&gt; Where is the part which actually &quot;evaluates&quot; an .mlb fil=
e?<br>
&gt;&gt;<br>
&gt;&gt; And, what do you think, how much work would it be to port it?<br>
&gt;&gt;<br>
&gt;&gt; The ML Kit also supports ML Basis files, they write their librarie=
s<br>
&gt;&gt; with .mlb files. So it would be useful to have this for Poly/ML as=
<br>
&gt;&gt; well.<br>
&gt;&gt;<br>
&gt;&gt; Yours<br>
&gt;&gt;<br>
&gt;&gt; - Gergely<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; MLton-devel mailing list<br>
&gt;&gt; <a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a>; <a href=3D"mailto:mlton-devel@m=
lton.org" target=3D"_blank">[email protected]</a><br>
&gt;&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/mlton-deve=
l" rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists=
/listinfo/mlton-devel</a><br>
</blockquote></div>

--000000000000b030d5063bb492da--


--===============3483808415869698662==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============3483808415869698662==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
MLton-devel mailing list
[email protected]; [email protected]
https://lists.sourceforge.net/lists/listinfo/mlton-devel

--===============3483808415869698662==--