-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement pragma for declaring nat optimizations #348
base: master
Are you sure you want to change the base?
Conversation
3948eaa
to
2840e23
Compare
Helped me improve the performance of an alternative idris2 prelude I am playing with, tested with mock of ProjectEuler problem #1:
|
2e4ecb6
to
cd106f6
Compare
Marceline discovered that this PR causes an explosion of memory usage while compiling Idris2 in Core/Binary (Extra ~ 5GB or so of memory usage) |
cd106f6
to
16550e6
Compare
This does make the nat hack a bit less hacky, thanks! Is the compile time performance still an issue? Sometimes that can be due to ambiguity resolution going a bit out of control. |
Yes, there is still an issue with Idris1 compilation of Idris2. Idris2 runs fine though. |
|
||
-- Prim Nat Optimizations | ||
|
||
<|> do pragma "builtinNatZero" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we refactor this as something like:
do c <- builtinPragma
n <- name
atEnd indents
pure (c n)
where builtinPragma
is a big choice
of parsers of the form
PrimNatSucc <$ pragma "builtinNatSucc"
Co-authored-by: MarcelineVQ <[email protected]>
16550e6
to
a8e099b
Compare
No description provided.