summaryrefslogtreecommitdiff
path: root/src/compiler
AgeCommit message (Collapse)Author
2014-11-10Some work to improve the structure of the haddock documenationhallgren
2014-10-31now (+) in the abstract syntax works, i.e. it knows how to deal with partial ↵kr.angelov
sums
2014-10-30a more efficient tail call by using the new TUCK instructionkr.angelov
2014-10-28Use terminfo to highlight warnings and errors in blue and redhallgren
This replaces the hardwired ANSI escape codes that were accidentally included in a previous patch. This adds a dependency on terminfo, but this should be unproblematic, since haskeline already depends on the same underlying C library. The color highlighting is omitted on Windows.
2014-10-28Show paths relative to the current directory in progress reportshallgren
It is much nicer to see something like - compiling FoodsSwe.gf... write file FoodsSwe.gfo - compiling FoodsTha.gf... write file FoodsTha.gfo - compiling FoodsTsn.gf... write file FoodsTsn.gfo - compiling FoodsTur.gf... write file FoodsTur.gfo - compiling FoodsUrd.gf... write file FoodsUrd.gfo linking ... OK Writing Foods.pgf... instead of - compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsSwe.gf... write file /Users/hallgren/src/GF/gf/examples/foods/FoodsSwe.gfo - compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsTha.gf... write file /Users/hallgren/src/GF/gf/examples/foods/FoodsTha.gfo - compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsTsn.gf... write file /Users/hallgren/src/GF/gf/examples/foods/FoodsTsn.gfo - compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsTur.gf... write file /Users/hallgren/src/GF/gf/examples/foods/FoodsTur.gfo - compiling /Users/hallgren/src/GF/gf/examples/foods/FoodsUrd.gf... write file /Users/hallgren/src/GF/gf/examples/foods/FoodsUrd.gfo linking ... OK Writing Foods.pgf...
2014-10-28A couple of haddock documentation improvementshallgren
2014-10-26an explicit SAVE instructionkr.angelov
2014-10-22Various small changes for improved documentationhallgren
2014-10-22an explicit PUSH_FRAME instructionkr.angelov
2014-10-21ModuleName and Ident are now distinct typeshallgren
This makes the documentation clearer, and can potentially catch more programming mistakes.
2014-10-21Renaming SourceGrammar to Grammar and similarly for some related typeshallgren
Included renamings: SourceGrammar -> Grammar SourceModule -> Module SourceModInfo -> ModuleInfo emptySourceGrammar -> emptyGrammar Also introduces a type synonym (which might be good to turn into a newtype): type ModuleName = Ident The reason is to make types like the following more self documenting: type Module = (ModuleName,ModuleInfo) type QIdent = (ModuleName,Ident)
2014-10-20use of 'head' in TypeCheck/RConcrete created an uncomprehensible error ↵aarne
message. Now checking for the emptiness of the list concerned, so that the error can be found.
2014-10-20Some small documentation improvementshallgren
2014-10-20type IOE a = IO ahallgren
IOE used to be a monad with extra error handling built on top of the IO monad, But the IO monad already supports error handling, so this construction was a superfluous. The new 'instance ErrorMonad IOE' is defined to preserve the previous error handling behaviour, i.e. the function 'handle' only catches errors thrown with 'raise' (or 'fail') and not other errors in the IO monad.
2014-10-20Remove some dead codehallgren
* The following modules are no longer used and have been removed completely: GF.Compile.Compute.ConcreteLazy GF.Compile.Compute.ConcreteStrict GF.Compile.Refresh * The STM monad has been commented out. It was only used in GF.Compile.SubExpOpt, where could be replaced with a plain State monad, since no error handling was needed. One of the functions was hardwired to the Err monad, but did in fact not use error handling, so it was turned into a pure function. * The function errVal has been renamed to fromErr (since it is analogous to fromMaybe). * Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places. * Some additional old code that was already commented out has been removed.
2014-10-19(un)lexmixed: added the other math environments than $ used in latexaarne
2014-10-17ps -lines preserves line-by-line structure when preprocessing files for ↵aarne
parsing line by line
2014-10-16Some work on the haddock documentationhallgren
2014-10-16Turn the GF compiler into a library. Main program is now in src/programs/gf.hshallgren
The module src/compiler/GF.hs now serves as a prelimiary compiler API. It just exports a selection of functions and types from the compiler. Haddock documentation can be generated with cabal haddock --hyperlink-source Also bumbed the version number to 3.6.10.
2014-10-16More haddock documentation improvementshallgren
2014-10-16finally proper stack unwind in the evaluatorkr.angelov
2014-10-15Rename modules GFI, GFC & GFServer...hallgren
... to GF.Interactive, GF.Compiler & GF.Server, respectively.
2014-10-15Fixes for the haddock documentationhallgren
2014-10-14the compiler now allows + to be used as a floating point addition in the ↵kr.angelov
abstract syntax
2014-10-14yet another bugfix in the byte codekr.angelov
2014-10-14another bugfix in the byte code generationkr.angelov
2014-10-14bugfix in the bytecode generatorkr.angelov
2014-10-09Prelude.CAPIT is now a built-in primitive. It still generates &| in the ↵kr.angelov
Haskell runtime but will be intepreted in the C runtime
2014-10-08GF.Infra.Options: change from String to Int in the type of optJobshallgren
2014-10-08now we statically allocate closures for all top-level functions and all ↵kr.angelov
nullary constructors. closures are dynamically allocated only for CAFs. this reduces memory use and time to allocate dynamic closures
2014-10-07bugfix in the byte code compilerkr.angelov
2014-10-06using instruction RET was wrong; now use EVALkr.angelov
2014-09-29minor stylistic change in GenerateBCkr.angelov
2014-09-29bugfix in the pattern matching compiler and a number of other fixes that I ↵kr.angelov
somehow did not push before
2014-09-27checked that course of value tables (table P [...]) have the correct number ↵aarne
of values w.r.t the type P. This was previously not checked, and caused hard-to-find run-time errors.
2014-09-17forgot to type check the type of a typed let expressionkr.angelov
2014-09-17appForm now skips over Typed expressionskr.angelov
2014-09-17the type checker for the abstract syntax now allows let expressions in def ↵kr.angelov
rules, since they are easily compilable to byte code. This fails in the Haskell runtime since let expressions are not allowed as abstract syntax expressions.
2014-09-11a major revision of the bytecode generator and JIT compiler. the effect is ↵kr.angelov
that now we can compute with lambda functions and with true tail recursion
2014-09-08(1) Refactor concurrency, (2) write to .gfo.tmp then rename to .gfohallgren
(1) introduces the module GF.Infra.Concurreny with lifted concurrency operators (to reduce uses of liftIO) and some additional concurrency utilities, e.g. a function for sequential logging that is used in both GF.CompileInParallel and GFServer. (2) avoids leaving broken .gfo files behind if compilation is aborted.
2014-09-05the code for def rules now uses proper graph update to preserve lazynesskr.angelov
2014-09-05full support for recursive def rules in the C runtimekr.angelov
2014-09-02src/server: refactoring to isolate dependencies on the cgi/fastcgi packageshallgren
* Introducing the module CGI, re-exporting a subset of the cgi package. It might complete replace the cgi package in the future. * Introducing the module CGIUtils, containing functions from FastCGIUtils that have nothing to do with fastcgi. Some low level hackery with unsafePerformIO and global variables was left in FastCGIUtils, but it is actually not used, neither for gf -server nor exec/pgf-fcgi.hs.
2014-09-01partial implementation for recursive def ruleskr.angelov
2014-08-25Fix GHC 7.4 compatibility issue caused by previous patchhallgren
2014-08-25Experimental: parallel batch compilation of grammarshallgren
On my laptop these changes speed up the full build of the RGL and example grammars with 'cabal build' from ~95s to ~43s and the zero build from ~18s to ~5s. The main change is the introduction of the module GF.CompileInParallel that replaces GF.Compile and the function GF.Compile.ReadFiles.getAllFiles. At present, it is activated with the new -j flag, and it is only used when combined with --make or --batch. In addition, to get parallel computations, you need to add GHC run-time flags, e.g., +RTS -N -A20M -RTS, to the command line. The Setup.hs script has been modified to pass the appropriate flags to GF for parallel compilation when compiling the RGL and example grammars, but you need a recent version of Cabal for this to work (probably >=1.20). Some additonal refactoring were made during this work. A new monad is used to avoid warnings/error messages from different modules to be intertwined when compiling in parallel, so some functios that were hardiwred to the IO or IOE monads have been lifted to work in arbitrary monads that are instances in the appropriate classes.
2014-08-22Command line flag -s/-q now silences all warningshallgren
These flags now do what the say.
2014-08-20Add lifted directory operations in GF.System.Directory to eliminate the need ↵hallgren
for liftIO in various places
2014-08-20GF.CompileOne: refactoring to reduce code duplication and improve readabilityhallgren
I prefer small functions with descriptive names over large monilithic chunks of code, so I grouped the compiler passes called from compileSourceModule into funcitons named frontend, middle and backend. This also makes decisions about which passes to run clearly visible up front. Also made some small changes in GF.Compile.
2014-08-19GF.Compile.ReadFiles: a simpler & faster way to convert from Latin1 to UTF-8hallgren