Calling Haskell from Swift

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
  • brassica

    A featureful sound change applier for language construction

  • I’ve done something like this before to call Haskell from C++ (in [0]), so that I can build my GUI using Qt. It worked pretty well, except that I ran into various difficult-to-resolve linking problems on both Windows and Linux. After a year or two of trying to maintain it, I gave up and switched to a protocol where both sides pass JSON over stdin/stdout. This particular piece of software doesn’t require a huge amount of communication or shared data, so it works well enough.

    The really nice thing about the original interop code, though, is that GHC’s new WASM backend uses essentially the same foreign function interface to export functions to JavaScript. So with only some minor modifications, I was able to get the same program working on a webpage [1], which I think is pretty cool.

    [0] https://github.com/bradrn/brassica

    [1] At the risk of DDOS’ing my poor little home server: https://bradrn.com/brassica/

  • Franz

    A desktop client for Apache Kafka. (by Bogdanp)

  • * https://defn.io/2023/02/04/racket-foreign-callouts-to-swift/

    I also started out using JSON to exchange data between the languages, but eventually wiring everything manually became an annoyance so I came up with a little Racket DSL[1] that automatically serializes and deserializes between the two languages (at runtime in Racket & using code generation in Swift). So far, I've built two apps with this approach, and I think it's great:

    * https://github.com/Bogdanp/Franz (macOS)

  • 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.

    WorkOS logo
  • remember

    Stash distractions away for later. (by Bogdanp)

  • Noise

    A Swift wrapper around Racket CS. (by Bogdanp)

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