Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fc to STG translation 1st version #8

Open
wants to merge 37 commits into
base: full_pipeline
Choose a base branch
from

Conversation

stormeuh
Copy link

No description provided.

Copy link
Owner

@Gertjan423 Gertjan423 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some feedback here and there.
General feedback : Please add some more comments. There are a number of (not always trivial) functions without any comments or documentation.

Frontend/HsRenamer.hs Show resolved Hide resolved
Frontend/HsRenamer.hs Show resolved Hide resolved
Optimizer/FcTypes.hs Outdated Show resolved Hide resolved
Optimizer/FcPreprocessor.hs Show resolved Hide resolved
Optimizer/FcOptimizer.hs Show resolved Hide resolved
Optimizer/FcTypeChecker.hs Show resolved Hide resolved
return (ctx_ext, FcBind x ty ab)

-- | Type check applicaton of a list of terms to a term
tcFcOptTmApp :: FcOptTerm -> [FcOptTerm] -> FcM (FcType, FcResTerm)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function looks really painful.... I don't really have any constructive feedback or improvements though....




tcFcResBind :: FcResBind -> FcM SBind
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this function supposed to do?

Datatypes representing the System F AST, with supporting functions and smart constructors.
System F syntax is split into two phases:
- Optimiser phase, marked with the @Opt type. These implement "vanilla" system F as it is most commonly seen.
- Preprocessed phase, marked with the @Pre type. This variant is preprocessed to be as easily translated into STG as possible.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name needs to be updated?

Tests/Test5.hs Outdated
@@ -0,0 +1,11 @@
-- * Simple test for using primitives
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably add some more tests later on.

@stormeuh stormeuh changed the title Implemented a first version of the optimizer typechecker Fc to STG translation 1st version Apr 27, 2021
= MkAAlts [SAAlt] SDefAlt -- ^ ADT alternatives
| MkPAlts [SPAlt] SDefAlt -- ^ Primitive alternatives
= SAAlts [SAAlt] --SDefAlt -- ^ ADT alternatives
| SPAlts [SPAlt] --SDefAlt -- ^ Primitive alternatives
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this change. Why did you drop the SDefAlt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants