Hacker Timesnew | past | comments | ask | show | jobs | submitlogin
Synthesising Elisp Code (wilfred.me.uk)
76 points by ProfDreamer on July 4, 2017 | hide | past | favorite | 11 comments



My first thought. I wonder how much logic programming is in suggest.el .. if it's full fledge then I'll be damned.


Sounds like it's brute forcing elisp fns.


Well prolog is a kind of brute force too


A major attraction of (pure) Prolog is that you can easily reorder goals and use all-solutions predicates to try different search strategies. Further, constraints like dif/2 help considerably to prune the search space. So yes, it can be brute force, but is often better than that.


Sure, but there's no magic here when you want to explore the space of all possibilities. I'm a prolog noob and barely new about dif


Yes I agree. Still, the key insight of constraints like dif/2 may also be applicable in this concrete case to limit the candidates already before and even during the search. It is this automatic pruning that makes logic programming with constraints so fast for many combinatorial applications. You are right of course that it may end up in brute force though, if there is nothing to prune.


I have yet to read about CLP, I'm eager now.


Related;

https://en.wikipedia.org/wiki/Inductive_logic_programming

Popular field when I was in uni. IFP was popular-ish 10 years later. Not sure if anyone is still doing much now that computers are much faster, but I always liked it.


Are there any practical uses for something like this?


Smalltalk environments have used this as a fancy docsearch for ages now, I believe - Pharo has one. It's actually pretty nice for beginners to help them learn a standard library. It's unfortunate that the search space is probably to big for some of the less trivial examples you'd want (e.g. the trickier Clojure collection functions).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: