Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git...
Transcript of Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git...
![Page 1: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/1.jpg)
Hacking GF
Gregoire Detrez
August 29, 2013
![Page 2: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/2.jpg)
Getting the code
With darcs
darcs get --lazy http://www.grammaticalframework.org/ GF
With git
git clone https://github.com/GrammaticalFramework/GF.git
As a zip archive
https://github.com/GrammaticalFramework/GF/archive/
master.zip
![Page 3: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/3.jpg)
Preparing your computer
To be able to build gf, you will need the following:
I ghc & cabal (Recommended: Haskell Platform, 2012.4.0.0 orlater)
I the haskeline
Debian (Ubuntu)
apt-get install haskell-platform libghc-haskeline-dev
Fedora
yum install haskell-platform ghc-haskeline-devel
![Page 4: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/4.jpg)
Building gfInstall dependencies
cabal install --only-dependencies
Configure
cabal configure
Compile
cabal build rgl-none
Tips: use cabal-dev instead of cabal for a sandboxeddevelopement environment
![Page 5: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/5.jpg)
Source files
I Runtime (haskel, used by the compiler):src/runtime/haskell
I Shell & compiler: src/compiler
![Page 6: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/6.jpg)
Compiler overview
Dependency analysis -> Parsing -> Renaming -> GrammarChecking -> Partial Evaluation -> PMCFG generation
(from https://code.google.com/p/grammatical-framework/wiki/CompilationPhases)
![Page 7: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/7.jpg)
Dependency analysis
I traverses the dependencies of the top modulesI determines which modules need to be compiledI . . . and in what orderI circular dependences are not allowed and are reported as error
location: src/compiler/GF/Compile/ReadFiles.hs
(getAllFiles)
![Page 8: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/8.jpg)
Parsing
I parse the .gf source filesI implemented using halex & happy
location: ‘src/compiler/GF/Grammar/{Parser.y,lexer/Lexer.x}
![Page 9: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/9.jpg)
Renaming
I Ambiguous references are reported as warnings. The compilerpicks the first choice and tries to compile with it.
location: src/compiler/GF/Compile/Rename.hs
![Page 10: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/10.jpg)
Grammar Checking
I check that for every lin there is a corresponding fun or datadefinition
I check that for cat there is a corresponding lincatI type checking
location: src/compiler/GF/Compile/CheckGrammar.hs
![Page 11: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/11.jpg)
Partial Evaluation
I missing lindef declarations are automatically generatedI evaluation of the oper using call-by-name
location: ‘src/compiler/GF/Compile/Compute/Concrete.hs’
![Page 12: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/12.jpg)
PMCFG generation
I convert GF rules to PMCFG rulesI this is where the gfo files are generated(?)
location src/compiler/GF/Compile/GeneratePMCFG.hs
![Page 13: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/13.jpg)
Resources
Wiki
https://code.google.com/p/grammatical-framework/wiki/
Issue tracker
https:
//code.google.com/p/grammatical-framework/issues/list
GF Developer guide
http:
//www.grammaticalframework.org/doc/gf-developers.html
![Page 14: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/14.jpg)
The future
![Page 15: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/15.jpg)
C runtime
Location src/runtime/c
I python bindingI java binding (WIP)I . . . other bindings?
![Page 16: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/16.jpg)
Build server
Figure : Jenkins
![Page 17: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/17.jpg)
Build server
Figure : Jenkins gf page
![Page 18: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/18.jpg)
Build server
Figure : RGL status
![Page 19: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/19.jpg)
Git?
benefits
I more people know git than darcsI more, easier to use (GUI) toolsI Github!
I code & issues at the same placeI good exposureI lots of young excited codersI facilitating casual contributions using github’s pull requests
![Page 20: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/20.jpg)
Git?
Separate repository for the RGL
I sugested on the MLI more contributors to the RGL than the haskell code
![Page 21: Hacking GFschool.grammaticalframework.org/2013/slides/gregoire...Git? bene ts I more people know git than darcs I more, easier to use (GUI) tools I Github! I code & issues at the same](https://reader034.fdocuments.in/reader034/viewer/2022050410/5f8756acd7437115dd782f0a/html5/thumbnails/21.jpg)
Git?
Wishlist? Suggestions?