CUTE-Lang / miniCUTE

Basic compiler for a simpler version of CUTE Lang
https://CUTE-Lang.github.io/miniCUTE
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Add optimizers for abstract machine codes #76

Open Ailrun opened 4 years ago

Ailrun commented 4 years ago

Is your feature request related to a problem? Please describe. Some optimizations are only applied to abstract machine codes.

Describe the solution you'd like Something like removing double Pop, double Slide, ...

Describe alternatives you've considered Implement a better transpiler

Ailrun commented 4 years ago

@ENvironmentSet I think with this one you can check your knowledge of or understanding for G-Machine. How do you think?

ENvironmentSet commented 4 years ago

@Ailrun Indeed it is, but I couldn't find proper document/paper for G-Machine so far(I've searched in your fb timeline and google, and I've got only some articles about STG -- a G-machine variant of ghc --(I think that you'll going to use this, but I need something more general)). could you suggest me some articles?

Ailrun commented 4 years ago

@ENvironmentSet For G-Machine only, G-Machine part of Simon's book is the best source, because the initial paper for G-Machine is not on the internet, as far as I know.

Ailrun commented 4 years ago

I mean, https://www.microsoft.com/en-us/research/publication/implementing-functional-languages-a-tutorial/

Ailrun commented 4 years ago

@ENvironmentSet Or, you can check our Haddock page by building it in your machine. In the Haddock page, specifically, in the module for G-Machine Instructions, there is the semantics for G-Machine.

Ailrun commented 4 years ago

@ENvironmentSet And actually, STG-Machine and G-Machine are quite different, and currently this repo uses G-Machine.

ENvironmentSet commented 4 years ago

@Ailrun Is this G-Machine of cute language?

I saw a lots of progmas...

Ailrun commented 4 years ago

@ENvironmentSet That part is for translating miniCUTE to G-Machine code. the module for instructions of G-Machine is here. https://github.com/CUTE-Lang/miniCUTE/blob/master/src/Minicute/Data/GMachine/Instruction.hs