Commit Graph
100 Commits
Author SHA1 Message Date
hallgren 5ca06495b1 translator/DictionarySwe.gf: remove bogus variant "hinna" from film_V2 2014-09-26 16:04:55 +00:00
hallgren 5cda60d36f examples/app/Makefile2: add missing -probs flag 2014-09-23 12:20:44 +00:00
hallgren eadc012b7a doc/gf-developers.t2t: add a note about how to create OS X Installer packages 2014-09-23 12:18:17 +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
hallgren a0d75d0ea8 gf.cabal: add missing c-sources for the Haskell binding to the C run-time library 2014-09-11 11:53:07 +00:00
hallgren 7cf87a3441 Setup.hs: don't ask darcs for the version history if _darcs is not present
This is to avoid a (harmless) error message from darcs when compiling sources
obtained e.g. from github.
2014-09-11 11:47:17 +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
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
hallgren 6494313a14 examples/app/Makefile2: simplifed Makefile for the App grammar (doesn't work yet)
This makefile just calls GF once and lets GF figure out in which order to
compile things. It uses the -j flag to enable parallel compilation and
specifies an explicit -path, overriding the -path flags in the source files.
This allows all needed modules to be found automatically and ensures that
that alltenses is consistently used everywhere. But for some reason, this
doesn't work...
2014-08-30 17:00:14 +00:00
hallgren 224d3a43f7 Add OS X Installed package to the GF 3.6 download page 2014-08-29 11:48:53 +00:00
hallgren 9b8b2d5f03 bin/build-binary-dist.sh: just a small fix 2014-08-29 11:48:10 +00:00
hallgren d25014f24c You can now use 'make pkg' to build OS X Installer packages for GF
The script bin/build-binary-dist.sh has been updated to build either a plain
.tar.gz package or OS X Installer package (.pkg).

Note that bin/build-binary-dist.sh is designed to build and include the
C run-time system in the binary package.  If the C run-time system fails to
build, no binary package will be created.
2014-08-28 13:30:22 +00:00
hallgren cc61d7edd8 gf.cabal ghc-options: don't force -j, -auto-all has been renamed to -fprof-auto 2014-08-25 23:30:22 +00:00
hallgren 20d5a89664 Fix GHC 7.4 compatibility issue caused by previous patch 2014-08-25 11:26:58 +00:00
hallgren 238652c6f9 Setup.hs: disable parallel RGL build support for now, since it is incompatible with Cabal<1.20 2014-08-25 11:22:20 +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
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 be301d8a5e Convert many RGL modules from Latin-1 to UTF-8 to speed up compilation
Also add flags coding=utf8 to silence warnings.
2014-08-19 19:42:05 +00:00
hallgren efcec8e7e9 Convert BeschCat.gf & BeschSpa.gf to UTF-8 to speed up compilation
Big patch!
2014-08-19 19:39:35 +00:00
hallgren 2f0e6c788b Convert lib/src/spanish/IrregSpa.gf to UTF-8 to speed up compilation
Huge patch!
2014-08-19 19:32:49 +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 7dee933802 Adjust the -path flags in 112 RGL modules
The -path flags in the RGL modules compiled during 'cabal build' now refer 
directly to the needed source directories. References 'alltenses' and 'present'
(and the nonexistent directory 'mathematical') have been removed.

This allows the files to be compiled in any order (e.g. in parallel). In
addition, you can do things like

	gf -retain lib/src/api/TrySwe.gf

without compiling/installing any other RGL modules first, and without 
setting any other path flags or environment variables.
2014-08-18 22:26:29 +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 70051a375b Setup.hs: reduce zero build time by a couple of seconds
The RGL is now compile with only three calls to GF (prelude, present,
alltenses). This also makes even more parallelism available to GF for speeding
up full builds of the RGL.
2014-08-13 16:25:03 +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
hallgren 1ce3569c82 Setup.hs: don't build example grammars when the rgl-none argument is specified 2014-08-08 17:02:36 +00:00
hallgren daee08f360 Setup.hs: comment out debugging code 2014-07-28 15:35:22 +00:00
hallgren 067c360ec5 Setup.hs: reduce zero build time by ~30% (from 26 to 18 seconds on my laptop)
This speedup is obtained by instead of generating 211 shell commands to compile the RGL one file at a time, generate 7 shell commands, passing a number of
related files to GF in one go.

In addition to cutting down the zero build time, this opens up for speeding up
full builds of the RGL, by adding more parallelism in GF's grammar compilation
machinery.

(Note: gf.cabal already takes advantage of GHC's parallel build option to
speed up the compilation of GF itself, if GHC>=7.8 is used.)
2014-07-28 15:11:58 +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
hallgren 1374c311d7 Adding GF.Infra.Location and GF.Text.Pretty (forgot to 'darcs add' them before) 2014-07-27 22:13:13 +00:00
hallgren f27d509075 Introducing GF.Text.Pretty for more concise pretty printers and GF.Infra.Location for modularity
GF.Text.Pretty provides the class Pretty and overloaded versions of the pretty
printing combinators in Text.PrettyPrint, allowing pretty printable values to
be used directly instead of first having to convert them to Doc with functions
like text, int, char and ppIdent. Some modules have been converted to use
GF.Text.Pretty, but not all. Precedences could be added to simplify the pretty
printers for terms and patterns.

GF.Infra.Location contains the types Location and L, factored out from
GF.Grammar.Grammar, and the class HasSourcePath. This allowed the import
of GF.Grammar.Grammar to be removed from GF.Infra.CheckM, making it more
like a pure library module.
2014-07-27 22:06:23 +00:00
hallgren ea6aa6dc02 PGF service: expire PGFs from the cache when they have been unused for 24 hours
...to keep memory use down on the server.
2014-07-21 15:53:38 +00:00
hallgren 9ded33829a WebSetup.hs: include Chinese when building the Phrasebook 2014-07-21 15:48:49 +00:00
hallgren 47e185679f src/server/gf-server.cabal: update dependencies 2014-07-15 12:00:51 +00:00
hallgren 93ba5b7b37 minibar: include the grammar's last modification in the grammar info shown by the "i" button
Also bumped version number in gf.cabal to 3.6-darcs.
Also removed some unecessary use of CPP.
2014-06-24 13:59:09 +00:00
hallgren b429086b2f Adjust the release date on the home page 2014-06-23 13:33:38 +00:00
hallgren 18de8c3988 Final updates of the download page for the 3.6 release
+ Describe which features are included in the different binary packages.
+ Describe the new MINGW package.
2014-06-23 13:30:33 +00:00
hallgren 865e818ea9 Update web pages and bump version number to 3.6! 2014-06-21 18:29:29 +00:00
hallgren 2646c40549 doc/gf-developers.t2t: made the C run-time section a bit more informative 2014-06-23 13:28:10 +00:00
hallgren 7d945def61 release-3.6.t2t: just a couple of more fixes.
Sorry.
2014-06-21 18:25:52 +00:00
hallgren ca24be7d7c release-3.6.t2t: fix broken link 2014-06-21 18:17:00 +00:00
hallgren f0ca4e4387 release-3.6.t2t: fix a formatting problem 2014-06-21 18:12:47 +00:00
hallgren e8ceba35b0 debian/changelog: updated for the release of GF 3.6 2014-06-21 17:10:24 +00:00
hallgren 7645207e6b build-binary-dist.sh: include a ghc package configuration file
as an experiment
2014-06-21 16:32:10 +00:00
hallgren 7f1521dbc5 Polished and renamed release notes to release-3.6.t2t
Also added an example use of lookupmorpho to gf-web-api-examples.html.
2014-06-21 13:02:10 +00:00
hallgren 54d081a036 The --output-dir option now applies also to PGF files 2014-06-21 12:26:56 +00:00
hallgren eee9617036 Cloud service & apps: better error handling in wide coverage translation
The wide coverage demo apps now shows a "please wait" message while the grammar
is loading, and a red error message if the grammar is not found on the server.
The Simple Translation Tool also show red error messages if the grammar is not
found.
2014-06-20 18:39:28 +00:00
hallgren 78ccefc4f4 PGF Service: return error code 404 (not found) instead of 500 (internal server error) for missing grammars 2014-06-20 17:28:02 +00:00
hallgren fae535b4e8 PGF Service, command=grammar: include the last modified time of the grammar in the output 2014-06-20 10:34:51 +00:00
hallgren ce116459e9 css/style0.css: like css/style.css but without changing the default table style 2014-06-19 17:42:37 +00:00
hallgren fc49815f32 Demo page: fix the link to the android app 2014-06-19 17:05:21 +00:00
hallgren 42e0e1b78c Demo page: add links to the wide coverage translation page and the android app 2014-06-19 17:00:23 +00:00
hallgren af9fbed84e WebSetup.hs: PhrasebookLav works again 2014-06-19 16:58:33 +00:00
hallgren 8ba34cb652 debian/rules: a hack to put the python binding in the right directory
The setup.py script puts it under site-packages, but python only looks under
dist-packages...
Also some minor changes for 'make deb' in Makefile
2014-06-19 15:45:55 +00:00
hallgren b953e782f6 debian/rules: fix bug that prevented the Python binding from being included 2014-06-19 13:39:03 +00:00
hallgren a4c56fe345 Update the GF shell reference manual 2014-06-19 10:58:35 +00:00
hallgren c2e17662b7 lib/tests/french/bescherelle: rename files containing non-ASCII characters 2014-06-19 10:43:07 +00:00
hallgren 158519624e runtime/c/setup.sh: use make -j to speed up compilation
The configuration script takes significantly longer to run than the compilation
of all the C code, which is a hint that is in need of a major simplification.
2014-06-19 09:26:44 +00:00
hallgren e9869da5e2 Include the Python binding to the C run-time system in Debian packages 2014-06-19 00:43:53 +00:00
hallgren c293812c79 WebSetup.hs: skip PhrasebookLav for now 2014-06-19 00:20:31 +00:00
hallgren 131ef1f444 Compile example grammars during the build phase instead of the install phase
This allows more errors to be detected by the build bot.
TODO: fix the gf --output-dir flag, which does not seem to change where PGF
file are put.
2014-06-18 23:57:45 +00:00
hallgren 7b1ad9de51 build-binary-dist.sh: updated to include the Python binding to the C run-time
There are also some changes in src/runtime/python/setyp.py to support this.
2014-06-18 16:09:46 +00:00
hallgren 12210ebb61 Fix like_Subj in translator/DictionarySwe.gf 2014-06-18 12:12:45 +00:00
hallgren 99321ad0d3 gf.cabal: add a maintainer field 2014-06-17 20:55:13 +00:00
hallgren 24975e4935 Some updates to the GF 3.6 download page and release notes 2014-06-17 20:25:58 +00:00
hallgren bfac5faac1 Compute/ConcreteNew.hs: eliminate selections from wildcard tables
This patch also includes some commented out code that was used to search for
the source of code size explosions and an eta expansion bug.
2014-06-17 14:47:55 +00:00
hallgren b78751d50a doc/gf-developers.t2t: quick note on how to compile the C run-time system
Also a few other minor updates.
2014-06-17 14:17:59 +00:00
hallgren 45a719f1c3 build-binary-dist.sh: updated to include the C runtime system in binary tarballs
Also moved it to the bin directory.
Run it with 'bash bin/build-binary-dish.sh'.
2014-06-17 13:56:59 +00:00
hallgren e783712fde Setup.hs: System.Cmd is deprecated, import System.Process instead 2014-06-17 13:27:14 +00:00
hallgren f2d60380c6 gf-cloud-api.html: fix a broken link
Thanks to Dana Dannells.
2014-06-17 08:45:13 +00:00
hallgren bbeca32a43 src/runtime/c/setup.sh: executable version of INSTALL, used from debian/rules 2014-06-16 23:28:12 +00:00
hallgren 7cc07b755b debian/rules: include the C run-time system when building .deb packages 2014-06-16 20:12:44 +00:00
hallgren 767a0768fe Merge Estonian v1.0.0-alpha from Kaarel Kaljurand 2014-06-16 13:58:04 +00:00
hallgren f739841497 PGF library: expose only PGF and PGF.Internal instead of all modules
PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler & shell,
including the nonstardard version of Data.Binary.
2014-06-12 14:43:18 +00:00
hallgren 577d73abfb New GF home page: trying blue page title and tagline instead of red 2014-06-12 12:29:35 +00:00
hallgren 033e42dbbd new.html: a proposed new look for the GF home page 2014-06-11 13:32:31 +00:00
hallgren 8a5289c921 Updating the release notes and installation instructions for the next release 2014-06-10 22:12:48 +00:00
hallgren bc0249b501 PGF2.hsc: use throwIO instead of throw
From the documentation: the throwIO variant should be used in preference to
throw to raise an exception within the IO monad because it guarantees ordering
with respect to other IO operations, whereas throw does not.

Also removed some unused imports.
2014-06-10 12:42:01 +00:00
hallgren 861a3fa805 Compute/ConcreteNew.hs: adding a Prawitz rewrite
(table { p_i => t_i } ! x).l ==> table { p_i => t_i.l } ! x

This was used in the old partial evaluator and can significantly reduce term
sizes in some cases.
2014-05-16 21:27:20 +00:00
hallgren f78570dabd Fix an eta expansion bug in the grammar compiler
Eta expansion is applied between partial evaluation and PMCFG generation.
The buggy version generated type incorrect terms, but PMCFG generation
apparently worked anyway.
2014-05-16 14:10:07 +00:00
hallgren 104fa03676 Simple Translator: fall back to word-for-word translation if the parser fails
Same as in the Wide Coverage demo app.
2014-05-15 13:58:42 +00:00
hallgren 33af15e803 Haskell binding: free memory pool to avoid space leak when readPGF fails 2014-05-13 14:07:36 +00:00
hallgren 108d546db8 translator/DictionarySwe.gf: add a few nouns and adverbs 2014-05-13 13:32:53 +00:00
hallgren 3c110cbe8d gf -server: include list of loaded PGFs in version info 2014-05-12 13:45:36 +00:00
hallgren 186e3effba examples/phrasebook/Makefile2: add Chinese
Also remove arguments to raise the stack size, GF's built-in default is big
enough now.
2014-05-09 13:07:02 +00:00
hallgren 519f073af3 Wide Coverage Demo Web App: bug fix: swapping source and target works again 2014-05-08 14:18:03 +00:00
hallgren fbe9bb69b1 Wide Coverage Demo Web App: bug fix: restore lost quality indications after switching target languages 2014-05-08 14:05:07 +00:00
hallgren 2a774e946b PGF web api, command c-wordforword: re-enable parsing of individual words
The space leak in the Haskell binding to the C parser has been fixed.
2014-05-08 11:38:41 +00:00
hallgren b7bd866237 Wide Coverage Demo App: show all Phrasebook translations
Also improve behaviour for languages that are missing in Phrasebook (Chinese).
Also update the initial set of languages in the menus to match Translate11.pgf.
2014-05-07 23:42:05 +00:00
hallgren b3d92a1378 pgf-shell.hs: fix compilation problem with GHC 7.4 2014-05-07 17:06:34 +00:00
hallgren 7c88b7935f Two improvements in the pgf-shell example
1. Like pgf-translate, it now shows one result at a time, press Enter to get
   more results.
2. You can load a new grammar with the command 'i <path-to-pgf>'
2014-05-07 16:37:28 +00:00
hallgren b7478a8252 translator/DictionarySwe: add panic_V 2014-05-07 13:01:26 +00:00
hallgren 0fe6a11773 Wide Coverage Web Demo: fix bug introduced in previous patch
Word-for-word translations were shown in the wrong language after switching
traget language.
2014-04-29 19:09:24 +00:00