HackerPapers

arXiv:2308.15893cs.PL

The Janus System: Multi-paradigm Programming in Prolog and Python

Theresa Swift, Carl Andersen

Abstract

Python and Prolog express different programming paradigms, with different strengths. Python is wildly popular because it is well-structured, easy to use, and mixes well with thousands of scientific and machine learning programs written in C. Prolog's logic-based approach provides powerful reasoning capabilities, especially when combined with constraint evaluation, probabilistic reasoning, well-founded negation, and other advances. Both languages have commonalities as well: both are usually written in C, both are dynamically typed, and both use data structures based on a small number of recursive types. This paper describes the design and implementation of Janus, a system that tightly combines Prolog and Python into a single process. Janus bi-translates data structures and offers performance of many hundreds of thousands of round-trip inter-language calls per second. Although Janus is still new, it has been used in commercial applications including natural language processing, visual query answering and robotic automation. Janus was developed for XSB, but porting Janus code to a second Prolog has been straightforward, indicating that Janus is a tool that other Prologs may easily adopt.

arXiv comments
In Proceedings ICLP 2023, arXiv:2308.14898
Journal reference
EPTCS 385, 2023, pp. 241-255
DOI
doi:10.4204/EPTCS.385.24
Subjects
cs.PLProgramming Languages cs.LOLogic in Computer Science

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Sep 2023 to Jul 2024. Found in 1 HN submission from Sep 2023 to Sep 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • To playing well with Python, this was on a front page some time ago: https://arxiv.org/abs/2308.15893 "The Janus System: Multi-paradigm Programming in Prolog and Python"

      klibertpView on HNParent context

  1. The Power of Prolog 1 comment
    • For Node, check out trealla-js: https://github.com/guregu/trealla-js. I tried to make it as easy to embed as possible. This paper is also very interesting. It describes the Janus System, a deep integration between Python and Prolog: https://arxiv.org/pdf/2308.15893v1.pdf

      groseView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.