Skip to content
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

Which memoization library to use? #1108

Closed
mizlan opened this issue Sep 9, 2022 · 3 comments
Closed

Which memoization library to use? #1108

mizlan opened this issue Sep 9, 2022 · 3 comments

Comments

@mizlan
Copy link

mizlan commented Sep 9, 2022

I can't seem to use any memoization library when running Exercism tests, stackage or not...

I tried:

  • chimera
  • memoize
  • fastmemo

There are probably more but I don't know how to find them all. What's the recommended solution for this? Get by without memoizing? For reference, I am working on the Change problem, whose most immediate (and imo straightforward) solution is to use a recursive DP algorithm and incorporate memoization.

@mizlan
Copy link
Author

mizlan commented Sep 9, 2022

Oh and I forgot to mention: the reason why I cannot use these libraries is because of #1006

@MatthijsBlom
Copy link
Contributor

I can't seem to use any memoization library when running Exercism tests, […]

This is caused by no memoization libraries being listed as dependencies of the test runner. This cannot be fixed other than by arguing that one should be added and sending an patch.

What's the recommended solution for this?

In a local environment, you can use any dependencies you like. Only on the Exercism servers will compilation fail.

Get by without memoizing?

Yes, or rolling your own. Maybe you can lazily generate intermediate results into a data structure, and then to get the answer index into that data structure? Incidentally, that is how MemoTrie does it.

@mizlan
Copy link
Author

mizlan commented Sep 10, 2022

Understood. Rolling my own seems sufficient for probably all cases here. Thanks!

@mizlan mizlan closed this as completed Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants