1
0
forked from GitHub/gf-core
Commit Graph

121 Commits

Author SHA1 Message Date
hallgren
ec31efccc6 Update PGF API documentation link on home page, bump version number in gf.cabal to 3.7.1-darcs 2015-10-05 12:38:23 +00:00
hallgren
74d8e9c6cf Bump version number to 3.7.1 and finalize documentation
Updated version number in gf.cabal and update debian/changelog
News item on home page (index.html)
Some last minute edits on the download page
Move the new release notes and download page in place.
2015-10-02 10:15:02 +00:00
hallgren
264fd05444 Parallel compilation: "gf -make -j" and "gf -make -j=n" now work as expected
* "gf -make -j=n" uses n parallel threads.
  * "gf -make -j" adapts to the number of processors in the system.

This mimics how "cabal build -j" and "ghc --make -j" works.

Support for this is implemented in the new module GF.System.Concurrency and
it depends on the function Control.Concurrent.setNumCapabilities, which is
only available in GHC>=7.6 (base>=4.6). GF can still be compiled with
GHC<7.6, but then you have to use +RTS -N -RTS to take advantage of
multicore processors.

To detect the number of processors in the system, the code depends on a
foreign import of a C function in the GHC run-time system.
2015-09-11 14:18:01 +00:00
hallgren
dab749a956 PGF2.Expr fixes
It needs to be listed in gf.cabal
unsafePerformIO is only exported from System.IO.Unsafe, starting with ghc-7.8
2015-09-03 20:41:00 +00:00
hallgren
721f653e99 GF shell: source commands (cc, sd, so, ss & dg) can now be used in pipes
These commands are now implemented as regular commands (i.e. using the
CommandInfo data type) in the new module GF.Command.SourceCommands.

The list of commands exported from GF.Command.Commmands now called pgfCommands
instead of allCommands.

The list allCommands of all commands is now assembled
from sourceCommands, pgfCommands, commonCommands and helpCommand in
GF.Interactive.
2015-08-12 11:05:08 +00:00
hallgren
6e5d8cebe0 Forgot to include gf.cabal in previous patch 2015-08-10 16:38:28 +00:00
hallgren
230d9780b7 gf -cshell: preliminary support for the C run-time system in the GF shell
Some C run-time functionality is now available in the GF shell, by starting
GF with 'gf -cshell' or 'gf -crun'. Only limited functionality is available
when running the shell in these modes:

- You can only import .pgf files, not source files.
- The -retain flag can not be used and the commands that require it to work
  are not available.
- Only 18 of the 40 commands available in the usual shell have been
  implemented. The 'linearize' and 'parse' commands are the only ones
  that call the C run-time system, and they support only a limited set of
  options and flags. Use the 'help' commmands for details.
- A new command 'generate_all', that calls PGF2.generateAll, has been added.
  Unfortuntaly, using it causes 'segmentation fault'.

This is implemented by adding two new modules: GF.Command.Commands2 and
GF.Interactive2. They are copied and modified versions of GF.Command.Commands
and GF.Interactive, respectively. Code for unimplemented commands and other
code that has not been adapted to the C run-time system has been left in
place, but commented out, pending further work.
2015-08-10 14:12:51 +00:00
hallgren
97c6ffd462 Refactor GF shell modules to improve modularity and reusability
+ Move type CommandInfo from GF.Command.Commands to a new module
  GF.Commands.CommandInfo and make it independent of the PGF type.
+ Make the module GF.Command.Interpreter independent of the PGF type and
  eliminate the import of GF.Command.Commands.
+ Move the implementation of the "help" command to its own module
  GF.Command.Help
2015-08-10 13:01:02 +00:00
hallgren
03d3814501 Remove left over [...] from release notes, bump version number in gf.cabal to 3.7-darcs 2015-06-25 14:56:15 +00:00
hallgren
f77fba354e Update home page, download page & release notes for GF 3.7. Bump version number in gf.cabal 2015-06-25 12:22:06 +00:00
hallgren
4e9e7c2bdd Documentation updates for the release of GF 3.7 2015-06-25 12:10:47 +00:00
krasimir
4cbe4403f2 forgot to update gf.cabal 2015-04-20 12:25:52 +00:00
hallgren
3aaeaf1325 Translating linearization functions to Haskell: move Haskell AST and pretty printer to GF.Haskell
For further separation of pretty printing concerns from conversion concerns,
the Haskell AST and pretty printer has been moved to its own module,
GF.Haskell, also allowing it to be reused in other places where Haskell
code is generated.
2015-04-14 12:44:14 +00:00
hallgren
bc7500bd26 gf.cabal: increase idle time before full GC to 5 seconds
The builtin GHC RTS default is 0.3 seconds, which results in very bad
interactive behaviour when working with a large grammar in the GF shell.
2015-03-05 15:30:41 +00:00
krasimir
d408c7df9f remove some more old code 2015-03-05 14:47:36 +00:00
hallgren
eea4dfd2fa gf.cabal: adjust version constrains on the network, cgi and httpd-shed packages 2015-02-25 18:41:57 +00:00
hallgren
5cf0ab4110 PGFService: make the restriction on parallelism more effective
Restrict the entire request handler instead of just the call to the C parser.
2015-02-25 16:08:21 +00:00
hallgren
2ce3e954fd Changes for compatibility with ghc-7.10-rc2
2 modules: Name clashes caused by Applicative-Monad change in Prelude
2 modules: Ambiguities caused by Foldable/Traversable in Prelude
2 modules: Backwards incompatible changes in time-1.5 for defaultTimeLocale
9 modules: {-# LANGUAGE FlexibleContexts #-} (because GHC checks inferred types
           now, in addition to explicitly given type signatures)

Also silenced warnings about tab characters in source files.
2015-02-16 15:05:06 +00:00
hallgren
fbed7c19d5 gf.cabal: include PGF.Haskell 2015-01-14 14:53:28 +00:00
hallgren
69e314eedc gf.cabal: include editor modes in the list of data files to install
Also add ghc-7.8.3 to the list of tested compiler versions
2014-12-15 15:16:50 +00:00
hallgren
dc3fd2c044 Work in progress on translating linearization functions to Haskell
The translation is currently good enough to translate all concrete syntaxes
of the Foods and Letter grammars, and some concrete syntaxes of the Phrasebook
grammar (e.g. PhrasebookEng & PhrasebookSpa works, but there are problems with
e.g. PhrasebookSwe and PhrasebookChi)

This functionality is enabled by running

	gf -make -output-format=haskell -haskell=concrete ...

TODO:
	- variants
	- pre { ... }
	- eta expansion of linearization functions
	- record subtyping can still cause type errors in the Haskell code
	  in some cases
	- reduce code large tables
2014-12-11 16:08:36 +00:00
hallgren
c02fef9b6a Some work to improve the structure of the haddock documenation 2014-11-10 15:23:02 +00:00
hallgren
120597750b gf.cabal: when compiling with ghc>=7.8 require cgi>=3001.2.2.0 2014-11-05 15:38:10 +00:00
hallgren
fd1c6a0a17 Use terminfo to highlight warnings and errors in blue and red
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-28 19:04:48 +00:00
hallgren
1e0d078ae2 Some small documentation improvements 2014-10-20 19:45:43 +00:00
hallgren
cd0f887ad9 Rename src/programs/gf.hs to gf-main.hs to avoid confusing GHC
It appears that GHC can't keep GF.hs and gf.hs apart on systems with case
insensitive file names.
2014-10-16 15:21:00 +00:00
hallgren
ede4a5a4c2 Turn the GF compiler into a library. Main program is now in src/programs/gf.hs
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-16 15:00:49 +00:00
hallgren
1d4215b822 Rename modules GFI, GFC & GFServer...
... to GF.Interactive, GF.Compiler & GF.Server, respectively.
2014-10-15 21:04:29 +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
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
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
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
Sergei Trofimovich
b154361e24 gf.cabal: fix depend in --flags=-custom-binary case
Detected when building today:

Building gf-3.6...
Preprocessing library gf-3.6...

src/runtime/haskell/PGF/Internal.hs:17:8:
    Could not find module ‘Data.Binary.IEEE754’
    It is a member of the hidden package ‘data-binary-ieee754-0.4.4’.
    Perhaps you need to add ‘data-binary-ieee754’ to the build-depends in your .cabal file.
2014-07-25 14:41:11 +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
865e818ea9 Update web pages and bump version number to 3.6! 2014-06-21 18:29:29 +00:00
hallgren
99321ad0d3 gf.cabal: add a maintainer field 2014-06-17 20:55:13 +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
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
9135f93e51 gf.cabal: require base>=4.3
This makes it explicit that we no longer support compiling GF with GHC 6.12
(which is 4 years old and comes with base-4.2).
2014-04-22 14:38:33 +00:00
hallgren
1a1ca2f618 gf.cabal: add GF builtin default -K64M. Enable parallel compile with ghc>=7.8
+ Programs compiled with ghc<7.8 have a default built-in 8M stack size limit.
  With ghc>7.0 this built-in default can be changed, so it is now 64M, allowing
  GF to work with larger grammars without manually increasing the stack size.
  (But if GF is compiled with ghc 6.12, the built-in default is still 8M.)

+ Enable ghc>=7.8 support for compiling modules in parallel, to speed up the
  compilation of GF.
2014-04-22 12:43:24 +00:00
hallgren
cf34ee8890 Move basic lexing functions from GF.Text.Lexing to the new module PGF.Lexing
They are thus part of the PGF Run-Time Library, making it possible to add
lexing functionality in PGF service in a natural way.
2014-04-08 14:07:49 +00:00
hallgren
73221769c2 Three fixes for compatibility with GHC 7.8
Two of the fixes were in the custom version of the binary package. We
should get rid of it at some point, to reduce the maintenance burden.

The third fix was to add new version constraints for happy and alex in
gf.cabal. New versions of them are needed because of the ugly, low-level,
GHC-specific code they produce need to be different for GHC 7.8.

More fixes might be needed for -server mode, but the cgi package is not
compatible with GHC 7.8 at the moment, so it will have to wait.
2014-03-04 14:13:41 +00:00
hallgren
ac3fae334e Fix broken C runtime support in gf.cabal and PGFService.hs
Also add PGF service command c-flush to explicitly flush cached parse results
from memory.
2014-02-10 16:04:40 +00:00
hallgren
01b90b95f8 gf.cabal: pgf-shell needs containers now 2014-02-07 16:42:51 +00:00
hallgren
d1ab3072db pgf-shell: enable -rtsopts, call performGC between commands
This is to make it easier to find the cause of space leaks.
2014-02-07 13:57:13 +00:00
hallgren
a81d7db70b gf.cabal: add default-language to silence warning 2014-02-03 12:24:42 +00:00
hallgren
1189a13840 gf.cabal: bump version number to 3.5.12 2014-01-21 16:30:01 +00:00
hallgren
b8f3914209 Optionally include C run-time support
If the C run-time library is compiled and installed on your system, you can now
do 'cabal configure -fc-runtime' to get the following extras:
  + The haskell binding to the C run-time library will be included in the
    PGF library (so you can import it in Haskell applications).
    Documentation on the new modules will be included when you run
    'cabal haddock'.
  + The new command 'pgf-shell', implemented on top of haskell binding to
    the C run-time system.
  + Three new commands in the web API: c-parse, c-linearize and
    c-translate. Their interfaces are similar to the corresponding commands
    without the "c-" prefix, but they should be considered preliminary.
2014-01-20 17:06:11 +00:00
hallgren
6ce085349d Release note updates and some other minor things 2013-12-18 16:22:59 +00:00
hallgren
d90657f1f1 Add backward compatibility for reading old PGF files
Some backwards incompatible changes were made to the PGF file format after
the release of GF 3.5. This patch adds a module for reading PGF files in the
old format.

This means that old PGF files on the grammaticalframework.org server will
continue to work after we install the latest version of GF.
2013-12-17 13:27:37 +00:00