Pyffi – Use Python from Racket

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • python

    An interface to Python for Gambit Scheme (by gambit)

    Pyffi automatically exports Python modules as scheme objects and that's quite practical. We worked on this briefly while building the Gambit interface to CPython (https://github.com/gambit/python), but ran into some quirks with the current Gambit macro and module systems that forced us to postpone. It is definitely something we want!

    Our syntactic interface based on Gambit's infix parser (SIX) is quite ergonomic and allows you to write expressions that look just like Python, within Scheme code (and vice-versa). It's much more natural than directly[1] passing strings to 'eval', although you can certainly do so (the whole low-level API is available). Here's the 'cal' example:

      > \import calendar

  • pymen

    Neat! Nicely done.

    fwiw, I wrote a Lisp in Python whose sexprs ended up looking similar: https://github.com/shawwn/pymen

    That’s the runtime for it, which is self hosted, so it supports that dot syntax but doesn’t actually use it in its own code. (If you add a new feature like dot syntax to a self hosted lisp, then you start using the feature, and later decide it was a bad idea, it becomes incredibly difficult to revert — So the compiler sticks to a minimal subset.

    But it can run code almost exactly as you’ve written, minus the backslashes. It also has:

      (for x in (list 1 2 3 4)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • libpython-clj

    Python bindings for Clojure

    It’s also worth noting that Clojure has libpython-clj (https://github.com/clj-python/libpython-clj) which offers an interface with Python from another lisp. Here are some advanced ML and dataviz examples using that lib: https://github.com/gigasquid/libpython-clj-examples.

  • libpython-clj-examples

    Examples using libpython-clj

    It’s also worth noting that Clojure has libpython-clj (https://github.com/clj-python/libpython-clj) which offers an interface with Python from another lisp. Here are some advanced ML and dataviz examples using that lib: https://github.com/gigasquid/libpython-clj-examples.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts