1 / 54

Jan Wielemaker VU University Amsterdam

Jan Wielemaker VU University Amsterdam. Contents. Viewpoint A brief history of SWI-Prolog The Prolog landscape The place of Prolog in IT infrastructure The Prolog software community. Viewpoint. Logic programming Programming languages Prolog Prolog implementations Prolog usage

jesther
Download Presentation

Jan Wielemaker VU University Amsterdam

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jan Wielemaker VU University Amsterdam ICLP-2012

  2. ICLP-2012 Contents • Viewpoint • A brief history of SWI-Prolog • The Prolog landscape • The place of Prolog in IT infrastructure • The Prolog software community

  3. ICLP-2012 Viewpoint • Logic programming • Programming languages • Prolog • Prolog implementations • Prolog usage • Prolog community (user and developers) • Used TPLP special issue on Prolog implementations

  4. ICLP-2012 A brief history of SWI-Prolog • 1983 D. L. Bowen, L. M. Byrd, and WF. Clocksin. “A portable Prolog compiler” • 1986 I wrote a virtual machine based on this paper • 1987 Use in European KADS project, replacing Quintus. Distributed using FTP

  5. ICLP-2012 Success in KADS • Bi-directional Prolog ↔ C interface allowed for better integration to PCE (graphics) • Quintus compatibility on `as needed' basis to support the project • Fast compiler, lazy loading (autoload) • Fast saved-state (based on `undump') and reload of modified code using ?- make. • Command-line editing and completion

  6. ICLP-2012 Yet another Prolog(not to br confused YAP) • Satisfied our needs • We had full control • … but, nothing unique that was not added to commercial systems within weeks → Released • FTP • Academic `non-commercial use' • No need to fill out forms

  7. ICLP-2012 Educational • Free of hassle (download, compile, use) • Supports popular academic Unix machines • Resource friendly • Compliant with primitives in textbooks

  8. ICLP-2012 The Carrot: quick release model • Input • Contributions (mostly portability) • Bug reports • Functionality requests • Output • Fast response • Updated source on FTP, ranging from hours to a week

  9. ICLP-2012 The middle ages (1988-2001) • New libraries, bugfixes, etc. • ISO part-I • Port to Windows 95/NT3.5 • Quality (CVS, test suite) • But … we missed lots of Prolog research (parallel, CLP, ...)

  10. ICLP-2012 2001: License • GNU libreadline conflicts with non-commercial-use license • FSF: remove libreadline or change SWI-Prolog license → SWI-Prolog moved to LGPL • Started http://www.swi-prolog.org

  11. ICLP-2012 2003: CLP • After Mumbai ICLP, together with Tom Schrijvers and Bart Demoen • Copy of `dynamic attributed variables' as proposed by Demoen and implemented for hProlog • Leuven CHR, coroutining • Markus Triska started pure Prolog clp(fd)

  12. ICLP-2012 2003.. Web support • Multi-threading • Unicode • Atom garbage collection • SGML/XML • HTTP Server and client libraries • RDF libraries and store

  13. ICLP-2012 Commercial involvement • Contributions • JPL, the Java interface • Quality checks and bug fixes • Sponsored development • Unbounded integers and rationals (GMP) • SSL interface • Memory management • PlDoc, PlUnit • IF/Prolog portability layer

  14. ICLP-2012 Success • Right time • Early hassle-free Prolog for education • Early port to Windows (students) • Model • Quick release cycle: 2 weeks for development, 6 months for stable version • Technical • Interface, do-what-I-mean, robustness, interfaces

  15. ICLP-2012 Failure • Trying to do `everything' • Packages often rely on undocumented SWI-specific extensions, making it hard to reuse them • Improving • Development APIs (share with PDT) • Modularized I/O and OS interface (YAP) • Modularize (GIT) repository

  16. ICLP-2012 Part-II The Prolog landscape

  17. ICLP-2012 Is Prolog in BAD shape? • Ohloh (http://www.ohloh.net/)

  18. ICLP-2012 Is Prolog in BAD shape? • Discontinued in many Dutch universities or moved to a `language overview course' • Hard to convince our (PhD) students to use it, even for RDF because • Perceived as `hard to learn' • No modern (IDE) tools • No library for X, Y and Z (you name it) • ``An irrelevant language from the past'' • ``I always programmed in (often) Java''

  19. ICLP-2012 Some often heard reasons • (Early) fragmentation of the language • No programmers/No jobs • Logic programming/Prolog is unsuitable as a general purpose language • Failed standardization

  20. ICLP-2012 Fragmentation? #Implementations (source: OpenDirectory)

  21. ICLP-2012 No programmers?

  22. ICLP-2012 Books Source: Amazon (UK)

  23. ICLP-2012 The Gartner Hype Cycle Explained

  24. ICLP-2012 Part III The place of Prolog in IT infrastructure

  25. ICLP-2012 General Purpose vs Logic server • `General purpose' • Missing language features (e.g., destructive assignment) • Needs graphics, Web, DB, etc., interfaces • `Logic server' • Needs language interfaces • Suffers from object/relational impedance mismatchhttp://en.wikipedia.org/wiki/Object-relational_impedance_mismatch

  26. ICLP-2012 Logic server • Native (Amzi!) • JVM based (Jinni, Minerva, Jekejeke, …) • Successor • BinProlog → Jinni • IF/Prolog → Minerva

  27. ICLP-2012 Embedding is popular • SWI-Prolog has interfaces for C (native), C++ (native and contributed), Java, C#, Python, Perl (contributed) • 113 projects on GitHUB combine Prolog with:

  28. ICLP-2012 SWI-Prolog: `glue' • Prolog is good at `glue' due to • Dynamic nature (incl. typing) • Flexible dynamically typed data representation makes it simple to represent data from external systems • Natural mapping of tabular data • Interactive development environment • Rules, DSLs, ...

  29. ICLP-2012 Some realized `glue' (for SWI) • Databases (ODBC) • RDF • XML/SGML/HTML • R (statistical computing) • HTTP Server library • Spatial reasoning (geos library) • OpenGL, OSC, MIDI, Gtk, Matlab, ...

  30. ICLP-2012 Prolog as primary language(SecuritEase)

  31. ICLP-2012 Conclusion • `Logic server' seems a more natural and easier to sell first option • Provided with well designed `glue', Prolog is also attractive as primary application language, including scripting

  32. ICLP-2012 Part IV The Prolog software community

  33. ICLP-2012 Comparing models * Stability of specification makes duplicates easier to handle

  34. ICLP-2012 Forking (Unix wars) Source: Wikipedia

  35. ICLP-2012 Distributions (Linux)

  36. ICLP-2012 Summary • Shared standards are good but slow. Fits poorly in a culture of innovation. • Shared code leads to • Reuse (stand on the shoulders of giants) • Fast innovation • Sharing needs a common ground And, where do we stand?

  37. ICLP-2012 Independent Development • Various module systems • Predicate based ↔ name based • Operating system access • File system, networking • Interfaces • DB, Graphics, C, Java, C#, ...

  38. ICLP-2012 Shared design • WAM • Garbage collectors • Tabled evaluation • Attributed variables

  39. ICLP-2012 Shared specification • ISO standard

  40. ICLP-2012 Forked specification • Quintus module system (SICStus, Ciao, YAP, SWI) • hProlog Dynamic attributed vars (SWI, YAP, XSB) • SWI Thread API (YAP, XSB)

  41. ICLP-2012 Forked code • DEC10 library (forked many times) • clp(q,r) • Draxler's Prolog → SQL compiler • SWI I/O and OS access (YAP, close to shared) • SWI XML/SGML (XSB) • SWI PlUnit (SICStus) • Parts of XSB tabling (YAP)?

  42. ICLP-2012 Shared Prolog components • Logtalk (many) • CHR (hProlog, SWI, XSB, YAP, B-Prolog, SICStus, Ciao)

  43. ICLP-2012 Requirements for sharing • Common ground for • Core Prolog (++) • Prolog extensions (attvar,tabling) (+) • Structuring (modules, objects) (+/-) • Interface to non-Prolog resources (–) http://www.cs.unipr.it/~bagnara/Papers/Prolog-FLI-survey • Always remaining issues → need work-around • Conditional compilation (++) • Macro expansion (+)

  44. ICLP-2012 Comparision of FLI m: manual, f: functional, p: procedural, l: low level, s: static, d: dynamic, b: both http://www.cs.unipr.it/~bagnara/Papers/Prolog-FLI-survey

  45. ICLP-2012 Progress (Foreign) • FLI emulations • SICStus ↔ SWI (Alpino, XPCE) • YAP ← SWI (SWI packages) • YAP ← Bprolog (PRISM) • Reuse SWI I/O and OS builtins in YAP • In part based on FLI emulation • Also emulated low-level SWI FLI

  46. ICLP-2012 Prolog Commons • Goal: arrive at a shared Prolog library • Minimal shared module support • Shared document and annotation model • Ciao effort • Website, GIT repo

  47. ICLP-2012 YAP/SWI`dialect' framework :- expects_dialect(X) says • Text is written for X • Loads dialect(X) (= library(dialect/X)) • Defines built-ins of X not in target • Rewrites conflicting built-ins using macros • Rewrites module API using macros • Pushes X-compatible library

  48. ICLP-2012 Dialects implemented • YAP • BProlog, Commons, hProlog, SWI-Prolog • SWI • YAP, BIM, hProlog, Commons, Ciao, IF/Prolog `As-needed' basis

  49. ICLP-2012 Dialect applied (SWI) • Alpino (now maintained as portable code) • 500Klines, C,C++,Tcl/Tk • SICStus → SWI • Prosyn (ported) • 1Mlines, C,C++ (Windows MFC) • IF/Prolog → SWI • Replaced MFC with web-GUI, other C with pure Prolog code

  50. ICLP-2012 Dialect Applied (YAP) • Many of SWI's extension packages • PRISM

More Related