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

Relevance of conj for self-hosting #182

Closed
wasamasa opened this issue Mar 4, 2016 · 4 comments
Closed

Relevance of conj for self-hosting #182

wasamasa opened this issue Mar 4, 2016 · 4 comments

Comments

@wasamasa
Copy link
Collaborator

wasamasa commented Mar 4, 2016

guide.md speaks of conj being optional and not required for self-hosting. However the Mal implementation that is run in this step does contain conj in its core.mal. I cannot find any other usage of conj in its sources, so I suspect it's either been added with the intention of making use of it (and making conj mandatory to implement for self-hosting) or in error.

@kanaka
Copy link
Owner

kanaka commented Mar 4, 2016

It's a little bit tricky: if conj isn't defined in an implementation, the the mal implementation will fail to load (step4 and later) because mal/core.mal has a reference to conj. However, I don't want to just drop conj from the mal implementation because then the self-hosting tests won't completely pass even if the underlying implementation does provide conj because it's not referenced in the mal impl core namespace list. So while an implementation of conj isn't necessary for self-hosting, a stub definition of conj is necessary to run tests for steps 4-9. That could be clarified in the guide. Want to add that to the list you're making for the guide?

@wasamasa
Copy link
Collaborator Author

wasamasa commented Mar 4, 2016

I've read this like three times and still don't understand why conj is required...

But yeah, I guess I'll add that to my list.

@kanaka
Copy link
Owner

kanaka commented Mar 4, 2016

Heh, yeah that was pretty confusing. Let me try a different approach:

  1. Completely remove conj from an implementation -> using that language to self-host will fail for steps 4-A (undefined reference to "conj").
  2. Remove conj from mal/mal/core.mal: self-host for every impl will have stepA soft failures regardless of whether host language has conj.

So if the guide is changed to mention that while "conj" is optional, something trivial needs to at least be defined in the environment so that most of the self-host tests can run. The same is true of "string?" and "seq". Basically, all the symbols (list in mal/mal/core.mal) at least need stubs (even if the value is just nil) for self-host tests to be able to run from step4 onwards.

@wasamasa
Copy link
Collaborator Author

wasamasa commented Mar 4, 2016

Thanks, this is indeed much clearer.

@wasamasa wasamasa closed this as completed Mar 4, 2016
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