diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Replace sample with factor and fail #56

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

Closes #39.

davidweichiang commented 2 years ago

This one makes a lot more changes than #55 and will need some more careful review.

davidweichiang commented 2 years ago

Currently \f. f fail doesn't parse, but \f. f (fail) does.

Edited: Fixed (maybe not in the prettiest way)

davidweichiang commented 2 years ago

pda_reverse.ppl is giving the error

Expected Stack #5 to be a robust type (or if binding a var, it is used non-affinely), in the definition pda, in the expression fail

Edited: Fixed

davidweichiang commented 2 years ago

Many examples (e.g., pattern1.ppl) are giving the error

compiler.exe: In the rule _1, no factor named ==
CallStack (from HasCallStack):
  error, called at ./Util/FGG.hs:168:32 in main:Util.FGG

Edit: fixed

davidweichiang commented 2 years ago

The expression let _ = factor 0.5 in True is clumsy; are there better alternatives? Like factor 0.5; True?

colin-mcd commented 2 years ago

How about just factor 0.5 in e?

davidweichiang commented 2 years ago

I think I like that, but maybe @ccshan has an opinion.

On Wed, May 11, 2022 at 11:42 Colin McDonald @.***> wrote:

How about just factor 0.5 in e?

— Reply to this email directly, view it on GitHub https://github.com/diprism/compiler/pull/56#issuecomment-1123945597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKVY2MX3WCNQTAJN4PMKT3VJPIMXANCNFSM5VSRRPOA . You are receiving this because you authored the thread.Message ID: @.***>

davidweichiang commented 2 years ago

I think all the bugs are worked out now. Just not the syntax.

davidweichiang commented 2 years ago

Seems like I introduced a bug; will investigate.

Edited: Fixed.

davidweichiang commented 2 years ago

Hi @HerbertMcSnout, do you have time to look at this?

colin-mcd commented 2 years ago

Yeah I'll take a look tomorrow afternoon/evening!

On Thu, Jun 16, 2022, 5:24 PM David Chiang @.***> wrote:

Hi @HerbertMcSnout https://github.com/HerbertMcSnout, do you have time to look at this?

— Reply to this email directly, view it on GitHub https://github.com/diprism/compiler/pull/56#issuecomment-1158325648, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLBJNOUKK6FQQKUPXP67K3VPPASLANCNFSM5VSRRPOA . You are receiving this because you were mentioned.Message ID: @.***>