-
Notifications
You must be signed in to change notification settings - Fork 37
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
CTFE Ability #33
Comments
This is a good idea, though likely to require quite a bit of work. I might get to it eventually but not in near future (pull requests welcome) - I'll keep this open. |
Biggest blockers to this appear to be std.regex and a few of the data structures (Queue, Array, etc?) used throughout D-YAML. |
Now one blocker due to Currently,
However, I doubt both are needed to prevent too much reallocation. |
the std.regex blocker has only been partially solved. matching still doesn't work at compile time. |
Thank you for your information! I missed the other places that are blocked by unittest
{
import dyaml.loader;
enum str = q"EOS
Hello World : [Hello, World]
Answer: 42
EOS";
enum root = Loader.fromString(str).load();
} It shows the following error message. $ dub test
...
source/dyaml/queue.d(61,22): Error: static variable instance cannot be read at compile time
... So currently I search for the possibility to get rid of |
yeah, it doesn't get far enough to trigger the regex errors. you could work around the other issues by just adding special cases for CTFE, since GC/not-GC doesn't really matter much there. there's just little point in actually doing so as long as the regex issue exists |
FYI: I dived into Fixing them seems to be a difficult task because we cannot ignore There is a workaround to fix CTFEability of D-YAML. Currently If we can get rid of the use of |
removing regex support is out of the question, since it's part of the spec (and will be more important later with schemas). I do have other ideas on how to approach this, though. I'm planning to remove types from Node and placing construction on top of that, which would make it optional. |
Hi
I am using D-yaml in some of my projects, and would like to be able to use it in a compile time executed function. I was wondering if you would be willing to consider making D-Yaml CTFE friendly.
Thanks for your time.
The text was updated successfully, but these errors were encountered: