Commit Graph

29 Commits

Author SHA1 Message Date
krangelov
3c4e7dd20c partial evaluation for (+) 2021-10-05 15:37:42 +02:00
krangelov
93c2f47752 missed VStr -> string2value 2021-10-05 13:38:00 +02:00
krangelov
557cdb82a7 strings computed from a predefined operation should be tokenized 2021-10-05 11:50:59 +02:00
krangelov
26be741dea most primitives in Predef.gf are now implemented 2021-10-05 11:31:39 +02:00
krangelov
0229329d7c implemented pattern macros 2021-09-29 17:38:53 +02:00
krangelov
6efb878c43 pattern matching for "x"* 2021-09-29 14:57:18 +02:00
krangelov
edd7081dea implement measured patterns 2021-09-29 13:26:06 +02:00
krangelov
2137324f81 safe pattern matching in the presence of a variable 2021-09-29 09:32:09 +02:00
krangelov
86326d282f pattern matching on strings 2021-09-29 09:18:52 +02:00
krangelov
fee186feca fix table selection with meta variables and lambda variables 2021-09-28 13:49:35 +02:00
krangelov
28dd0eda22 evaluation for Prod 2021-09-28 11:47:31 +02:00
krangelov
f82f19ba68 better error handling 2021-09-24 19:54:29 +02:00
krangelov
f83ea160da more patterns in the partial evaluator 2021-09-24 19:14:48 +02:00
krangelov
c5b6432016 implemented tables and parameters 2021-09-24 17:20:25 +02:00
krangelov
ac304ccd7c more low-handing fruits in the partial evaluator 2021-09-24 15:14:52 +02:00
krangelov
3dc2af61a6 done with partial evaluation for records and variants 2021-09-24 15:00:34 +02:00
krangelov
a2102b43bd got started with the new partial evaluation 2021-09-22 18:17:50 +02:00
Andreas Källberg
7faf8c9dad Clean up redundant case expressions 2021-07-12 16:38:29 +08:00
Andreas Källberg
b3881570c7 Remove last traces of the Either in value2term 2021-07-12 15:53:49 +08:00
Andreas Källberg
bd270b05ff Remove the Either Int from value2term
This prevents HUGE space leak and makes compiling a PGF a LOT faster

For example, an application grammar moved from taking over 50GB
of ram and taking 5 minutes (most of which is spent on garbage colelction)
to taking 1.2 seconds and using 42mb of memory

The price we pay is that the "variable #n is out of scope" error is now
lazy and will happen when we try to evaluate the term instead of
happening when the function returns and allowing the caller to chose how
to handle the error.
I don't think this should matter in practice, since it's very rare;
at least Inari has never encountered it.
2021-07-12 15:50:43 +08:00
John J. Camilleri
71d99b9ecb Rename GF.Compile.Compute.ConcreteNew to GF.Compile.Compute.Concrete 2021-07-01 14:21:29 +02:00
hallgren
7d1c011389 Commment code and options relating to the old partial evaluator
This means that the -old-comp and -new-comp flags are not recognized anymore.

The only functional difference is that printnames were still normalized with
the old partial evaluator. Now that is done with the new partial evaluator.
2013-11-29 16:26:49 +00:00
hallgren
f8665c7213 Remove configuration flag cclazy 2011-11-01 13:45:12 +00:00
hallgren
875df01dc6 Add lazy version of GF.Compile.Compute.Concrete
This patch adds GF.Compile.Compute.ConcreteLazy, which replaces the Err monad
with the Identity monad. While the Err monad makes the interpreter
(hyper)strict, the Identity monad let's the interpreter inherit Haskell's
laziness.  This can give big speedups: from 50s to 1s in one example,
from ~4 minutes to ~2 minutes for the RGL.

This is still experimental and might be buggy, so it is off by default.
You can turn it on by configuring with the -fcclazy flag, e.g.

	cabal configure -fcclazy

Let me know if anything breaks.
2011-09-01 16:39:41 +00:00
aarne
6757ab2b41 reload command in shell 2011-08-25 15:58:38 +00:00
aarne
3afefb0ac9 commented Compute/Concrete with explanations 2011-08-22 17:08:07 +00:00
aarne
445a3aafeb Predef.error surfaces as error message in compilation and cc command 2011-02-25 17:01:10 +00:00
aarne
9b5223a06b fixed the failure to partial-evaluate pre in right-associative context 2010-12-11 16:27:35 +00:00
krasimir
e0231cbf5b reorganize the modules in GF.Compile.* 2010-07-01 14:19:32 +00:00