You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There have been a couple discussions recently about what the keyword for MLang language fragments should be, without reaching a resounding consensus. Mainly regarding whether we should use the keyword frag, or stick with the keyword lang. There are motivations for both due to how the syntax looks:
-- We are language fragments, not intended to be used on our own... but we are
-- still denoted by lang!
lang LittleFoo
syn Expr =
| XFoo Int
sem handle =
| XFoo i -> XFoo (addi i 1)
end
lang LittleBar
syn Expr =
| XBar Bool
sem handle =
| XBar b -> XBar (not b)
end
-- I am a language intended to be used directly in the code!
lang FooBar = LittleFoo + LittleBar
-- I am a language intended to be used directly in the code as well, but I am
-- also partially defined in the same way as LittleFoo and LittleBar...
lang TreeFooBar = LittleFoo + LittleBar
syn Expr =
| XBranch (Expr, Expr)
sem handle =
| XBranch (l, r) = XBranch (handle l, handle r)
end
mexpr
let fb =
use FooBar in
...
in
let tfb =
use TreeFooBar in
...
in
As there are motivations for both, it might also be the case that neither frag or lang is the right keyword to use. Maybe something like module could be another option, also replacing syn, sem by con, match respectively.
Hopefully I have managed to capture the key motivations brought forth in recent discussions.
The text was updated successfully, but these errors were encountered:
There have been a couple discussions recently about what the keyword for MLang language fragments should be, without reaching a resounding consensus. Mainly regarding whether we should use the keyword
frag
, or stick with the keywordlang
. There are motivations for both due to how the syntax looks:As there are motivations for both, it might also be the case that neither
frag
orlang
is the right keyword to use. Maybe something likemodule
could be another option, also replacingsyn
,sem
bycon
,match
respectively.Hopefully I have managed to capture the key motivations brought forth in recent discussions.
The text was updated successfully, but these errors were encountered: