1
0
forked from GitHub/gf-core
Commit Graph

3750 Commits

Author SHA1 Message Date
kr.angelov
dee64838f4 bugfix in pgf_evaluate_expr_thunk 2014-09-30 17:34:29 +00:00
kr.angelov
0bdd599972 fix pgf_value2expr for partial applications 2014-09-30 13:46:46 +00:00
kr.angelov
8801915523 enough fixes to get the JIT compiler compile for ARM. It is still broken if you try to use it 2014-09-30 12:39:31 +00:00
kr.angelov
f124723236 add evaluator.c in Android.mk 2014-09-30 12:37:18 +00:00
kr.angelov
ceb5b7bbf3 fix in reader.h for compiling jpgf.c 2014-09-30 11:25:27 +00:00
kr.angelov
cdac80b6b2 fix in pgf_print_expr for lambda abstractions with more than one argument 2014-09-30 09:42:18 +00:00
kr.angelov
9fd8d5d019 bugfix in the gate evaluate_value_lambda 2014-09-30 08:42:06 +00:00
kr.angelov
2f7bd0306f minor stylistic change in GenerateBC 2014-09-29 15:08:00 +00:00
kr.angelov
698329f469 bugfix in the pattern matching compiler and a number of other fixes that I somehow did not push before 2014-09-29 15:00:04 +00:00
kr.angelov
0d08417efe bugfix in the RET instruction 2014-09-29 13:04:49 +00:00
kr.angelov
1d7e976560 enlarge the code window in pgf_jit_gates to ensure enough space on 64-bit machines 2014-09-29 07:34:32 +00:00
aarne
a757798656 checked that course of value tables (table P [...]) have the correct number of values w.r.t the type P. This was previously not checked, and caused hard-to-find run-time errors. 2014-09-27 17:14:35 +00:00
kr.angelov
2cf55a0631 the literals API is now exposed in Python 2014-09-25 11:59:40 +00:00
kr.angelov
3064fc737e switch off the debugging of the JIT compiler which I had turned on accidentally. silence two harmless warnings 2014-09-25 11:44:45 +00:00
kr.angelov
25e8e4ce5a now a complete JIT compiler and ByteCode compiler for the def rules in the abstract syntax. there might be some bugs yet to be found, meta variables and computation under lambda is only partially supported 2014-09-25 10:35:06 +00:00
hallgren
38811b06c9 haskell-bind/PGF2.hsc: unexport functions that break referential transparency
loadConcr, unloadConcr and addLiteral modify the Concr structure as a side
effect. This means that other functions with a Concr argument (e.g. parse
and linearize) are no longer pure.

Possible solutions:

1. Don't try to hide the imperative nature of the C run-time system: remove
   all uses of unsafePerformIO and let all functions operate in the IO monad.

2. Don't export functions with side effects. Perhaps the desired functionality
   of loadConcr, unloadConcr and addLiteral can be folded into readPGF.
   The Concr structures can then treaded as immutable after after the
   readPGF function returns...
2014-09-22 14:05:17 +00:00
kr.angelov
4d6994ffde forgot to type check the type of a typed let expression 2014-09-17 22:25:08 +00:00
kr.angelov
4f23ed2289 appForm now skips over Typed expressions 2014-09-17 22:02:36 +00:00
kr.angelov
ff45e7dd3a the type checker for the abstract syntax now allows let expressions in def 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-17 21:59:45 +00:00
kr.angelov
db68456727 fix a portability problem with the Python binding (found by Prasanth) 2014-09-17 16:12:40 +00:00
kr.angelov
e308f384de dummy jit_base_tail_finishr for x86_64. 2014-09-16 12:29:35 +00:00
kr.angelov
923ad6b3c0 a major revision of the bytecode generator and JIT compiler. the effect is that now we can compute with lambda functions and with true tail recursion 2014-09-11 15:39:39 +00:00
kr.angelov
5c0ef5c4ed now release the FunPtr:s that are allocated for each literal callback 2014-09-10 15:41:53 +00:00
kr.angelov
d84d3b5763 added an API for custom literals in the Haskell binding 2014-09-10 14:56:18 +00:00
kr.angelov
fb18482aeb added loadConcr/unloadConcr to the Haskell binding. This exposes an API for loading grammars compiled with -split-pgf 2014-09-10 14:35:54 +00:00
hallgren
98e01dc63e Wide Coverage Demo web app: use the App grammar instead of the Translate grammar
This gives faster but slightly lower quality translations.
2014-09-09 13:53:10 +00:00
hallgren
782bdf3a52 (1) Refactor concurrency, (2) write to .gfo.tmp then rename to .gfo
(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-08 15:43:20 +00:00
kr.angelov
d7dc541f74 the code for def rules now uses proper graph update to preserve lazyness 2014-09-05 11:53:02 +00:00
kr.angelov
5e5ad8f2db full support for recursive def rules in the C runtime 2014-09-05 10:09:43 +00:00
hallgren
fe8daf7f94 gf.cabal, gf-server.cabal: add version bounds on network & httpd-shed
* httpd-shed-0.4 does not specify an upper bound on network, but it fails
  to build against network>=2.6. This is fixed in httpd-shed-0.4.0.2.
* With network-2.6, the Network.URI modules is moved to a separate package,
  so for the time being GF requires network>=2.3 && <2.6. This is compatible
  with the four most recent versions of the Haskell Platform.
2014-09-03 15:40:26 +00:00
hallgren
0e87a88f4b src/server: refactoring to isolate dependencies on the cgi/fastcgi packages
* 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-02 12:27:47 +00:00
kr.angelov
442dadf100 partial implementation for recursive def rules 2014-09-01 14:51:20 +00:00
kr.angelov
9adf01a91e bug fixes in the JIT compiler 2014-09-01 12:53:14 +00:00
kr.angelov
9bc507f1d6 added evaluator.h which I had forgoten 2014-08-29 08:36:53 +00:00
hallgren
20d5a89664 Fix GHC 7.4 compatibility issue caused by previous patch 2014-08-25 11:26:58 +00:00
hallgren
c0eb79b403 Experimental: parallel batch compilation of grammars
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-25 09:56:00 +00:00
kr.angelov
14101a6fd7 bugfix in the android app 2014-08-22 12:33:35 +00:00
hallgren
5f9e6b1220 src/www/robots.txt: robot exclusion file for the GF cloud service.
To reduce potential server load caused by search bots.
2014-08-22 12:13:04 +00:00
hallgren
11105f81cd Command line flag -s/-q now silences all warnings
These flags now do what the say.
2014-08-22 00:30:33 +00:00
hallgren
e1644ef319 Add lifted directory operations in GF.System.Directory to eliminate the need for liftIO in various places 2014-08-20 17:47:08 +00:00
hallgren
ff960a27b8 GF.CompileOne: refactoring to reduce code duplication and improve readability
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-20 17:04:15 +00:00
hallgren
d2e326b182 GF.Compile.ReadFiles: a simpler & faster way to convert from Latin1 to UTF-8 2014-08-19 14:27:15 +00:00
hallgren
7b42582682 Fix compliation error with GHC 7.4 caused by previous patch 2014-08-13 22:21:54 +00:00
hallgren
1cfdffd5e9 Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8 2014-08-13 22:16:18 +00:00
hallgren
6215fc941f Refactoring in GF.Compile and GF.ReadFiles with an eye to parallel compilation
In particular, the function compileOne has been moved to the new module
GF.CompileOne and its type has been changed from

    compileOne :: ... -> CompileEnv -> FilePath -> IOE CompileEnv

to

    compileOne :: ... -> SourceGrammar -> FilePath -> IOE OneCompiledModule

making it more suitable for use in a parallel compiler.
2014-08-13 16:46:11 +00:00
hallgren
147af96983 GF.Compile: remove the Int from CompileEnv
It has been unused since the refresh pass was removed.
This eliminates one obstacle to parallel module compilation.
2014-08-11 16:30:11 +00:00
kr.angelov
912225a5dd pattern matching in def rules is now supported 2014-08-11 15:53:41 +00:00
kr.angelov
a18c1709f3 revert an accidental change that I pushed together with the last patch 2014-08-11 11:44:49 +00:00
kr.angelov
03b067782c a partial support for def rules in the C runtime
The def rules are now compiled to byte code by the compiler and then to
native code by the JIT compiler in the runtime. Not all constructions
are implemented yet. The partial implementation is now in the repository
but it is not activated by default since this requires changes in the
PGF format. I will enable it only after it is complete.
2014-08-11 10:59:10 +00:00
hallgren
cbe5e8ab18 Convert from Text.PrettyPrint to GF.Text.Pretty
All compiler modules now use GF.Text.Pretty instead of Text.PrettyPrint
2014-07-28 11:58:00 +00:00