Re: Pengine - the Prolog engine running SWISH
Torbjörn Lager <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CA+Y3JZjvF4UySvatkmBuVrKAyKmjUeBT5iEez_the4D-tW8Jkg@mail.gmail.com> |
Hi Michael, Thanks for your comments! I think we will have to wait a long time before someone implements a viable Prolog in JavaScript. And if and when it happens, it won't find that many users, simply because there are not that many Prolog programmers around. Also, for GUI programming, OO is kind of nice to have. I think we can safely predict that future alternatives to JavaScript will be class based OO languages that compile into JavaScript, like Google's Dart for example (see [1]). Of course, Pengine will be usable out of the box for such languages too. You want to keep most of your data on servers anyway, in particular if the data is supposed to be shared among many clients. Prolog is *good* at handling data and to reason over it, as I'm sure we all appreciateBut with your data on servers, there is no way you can avoid making network round-trips. Doing it from Pengine is very flexible. You can ask for solutions one at the time, or N at the time, which is great if you have lots of data. OK, looking at 10 solutions to a goal one at the time will cost you 10 network roundtrips, but if you choose to look at all at one, it will cost you only one request. Using an all-solutions predicate from Pengine you could request all solutions for any goal, but to attempt that is of course a good idea only if they are not too many. [1] http://en.wikipedia.org/wiki/Dart_(programming_language) Best, Torbjörn On Thu, Aug 15, 2013 at 4:08 PM, Michael Hendricks <[email protected]> wrote: > On Thu, Aug 15, 2013 at 6:57 AM, Torbjörn Lager <[email protected]> > wrote: >> >> At this point I could use some feedback so you are hereby invited to >> take the first versions of Pengine Scratchpad, the Pengine JavaScript >> API Tutorial and (if you haven't tried it before) SWISH (which really >> hasn't changed much lately): >> >> http://swish.spyderbrain.com:5003/scratchpad >> >> http://swish.spyderbrain.com:5003/tutorial >> >> http://swish.spyderbrain.com:5003/swish > > > This is some very impressive work. I haven't gone through the entire > tutorial, but the JS API seems natural and productive. I found the > Scratchpad examples helpful for bootstrapping my understanding of the > system. I look forward to investigating in greater depth. > >> >> So, what do you think? Could Pengine (or something similar) become THE >> way to do web logic programming in the future? Please be critical and >> feel free to argue as fiercely as you want against my admittedly very >> bold claim. > > > I personally think Prolog will make an excellent language for web > development (both client and server). I've written so much JS code where I > thought, "This would be much better in Prolog". My biggest concern with > Pengine is that it requires network round-trips. Many applications, > especially on mobile devices, can't afford that kind of latency. > > I predict that Prolog web development will eventually settle on a good > Prolog engine written in Javascript that's code compatible with SWI-Prolog. > That would eliminate network latency, allow one to use SWI's extensive > library (at least the pure Prolog parts) and run the same code in both the > client and server. > > -- > Michael -- Torbjörn Lager Professor of General and Computational Linguistics Department of Philosophy, Linguistics and Theory of Science University of Gothenburg Box 200, SE-405 30 Gothenburg, Sweden Phone: +46317864962