WIP: Add prolog implementation#187
Conversation
|
I've been following your prolog implementation. The main thing that I like to see (related to merging into the main tree) is that every implementation follows the overall structure and incremental process. Your implementation doesn't seem too far off (similar in many ways to the Haskell implementation actually). I think the main thing I notice is that the core functions should be in a separate module if possible rather than defined inline in the step (step4). You would probably find the mal FAQ informative if you haven't already seen it: https://github.com/kanaka/mal/blob/master/docs/FAQ.md#why-is-some-code-split-into-steps-and-some-code-not Also, if you use IRC, I'm often available at #mal on freenode during the day (US central time). |
|
Hi,
I've been meaning to do that. I haven't done it because I am not sure if it will stay the way it is. There is something that feels off to me. I will probably rebase a couple more times before it will be ready. You can see in The ugliest thing right now is how I treat Thanks for the comments. It will probably take some time for me to finish this as prolog requires me to think differently when I solve problems then when I use a other programming languages, so it goes a bit slow. I just thought others might add some ideas or find it fun to look at, even though it is not finished. |
8482f6b to
f95d821
Compare
|
I'm sorry this is taking some time. Still a while until I can work on this again. |
|
I realised some things about definite clause grammars and prolog (after 2 years) and now the implementation is a bit nicer to work with. I am little bit stuck on macros right now, but I should be able to solve it. There are some ugly things still (see swap! and still print_readably), but it is getting there. |
|
@ljos Are you still interested in pushing this through to completion? If you aren't, or it may be a while please let me know and I'll close the issue until you are able to make progress. Thanks! |
|
I’m sorry that I have been slow. I was actually thinking about this the
last couple of days. If I haven’t made any progress over the weekend I
think you should close it. I will try to work on it Saturday and Sunday.
…On Fri, 15 Mar 2019 at 21:04, Joel Martin ***@***.***> wrote:
@ljos <https://github.com/ljos> Are you still interested in pushing this
through to completion? If you aren't, or it may be a while please let me
know and I'll close the issue until you are able to make progress. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#187 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjt1ikZefhfqHFyLE_wX6AeGKwfx0j0ks5vW_yxgaJpZM4H2Xdm>
.
|
There probably are optimizations that can be done, but this is the exact same code as in step4. We just rely on prologs builtin tco. There is probably some magic we can do to implement it ourselves, but I don't think that is neccessary.
|
It will take a bit longer than anticipated. I will close it and reopen when I have finished. |
|
@ljos Okay, no problem. I'm happy to take a look again in the future. Also no time pressure, apart from the policy that the first submission for each implementation is the one that is included in the tree (unless the subsequent implementations are notably different in interesting ways). |
This is a work-in-progress prolog implementation.
Prolog, because of the shift in paradigm, needs to be implemented a little different than the rest of the languages. This is an attempt to do that.