hint: Runtime Haskell interpreter

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/haskell

Our great sponsors
  • Scout APM - Truly a developer’s best friend
  • talent.io - Download talent.io’s Tech Salary Report
  • SonarLint - Clean code begins in your IDE with SonarLint
  • hint

    Runtime Haskell interpreter

    with haskell.nix, well, you've found the github issue, you need to put the apecs package in the right nix incantation.

  • binaryen

    A Haskell to WebAssembly compiler

    Also, hint uses unsafeCoerce, and thus implicitly relies on an assumption about how values are represented at runtime. Namely, if a program P is interpreting an expression E of type A, hint assumes that the value of type A produced by the ghc interpreter has the same representation as the values of type A which are manipulated by program P. This is not guaranteed to be the case, since P has been compiled by the compiler portion of ghc while E has been evaluated by the interpreter portion of ghc. This means the ghc devs had to carefully craft their compiler and interpreters to match. When targetting the browser, a Haskell-to-js or Haskell-to-wasm compiler such as Asterius modifies ghc's code-generator so it produces js or wasm code. You would thus also need to tweak the interpreter so that it produces js or wasm values which match what the modified code-generator outputs. Or you could restrict yourself to the hint's less expressive eval :: String -> String API.

  • Scout APM

    Truly a developer’s best friend. Scout APM is great for developers who want to find and fix performance issues in their applications. With Scout, we'll take care of the bugs so you can focus on building great things 🚀.

  • deploy-hint

    Demonstrating that you don't need to install ghc in order to use the hint library.

    The fact that a ghc installation is needed at runtime is indeed a weak point of the library, but I want to point out that hint is not calling the ghc executable at runtime, it is calling the ghc library, which in turn assumes the presence of a bunch of files on your machine. The easiest way to get those files on your machine is to install ghc, but it's not the only way! I have a proof of concept demonstrating how it is possible to bundle those files with your project so that your end users don't have to install ghc themselves. That proof of concept was recently extended to a real world use case in https://tidalcycles.org/; /u/yaxu, did that end up working? Is there anything you or I could do to make it easier for the next person to apply those ideas to their project?

  • Tidal

    Pattern language

    The fact that a ghc installation is needed at runtime is indeed a weak point of the library, but I want to point out that hint is not calling the ghc executable at runtime, it is calling the ghc library, which in turn assumes the presence of a bunch of files on your machine. The easiest way to get those files on your machine is to install ghc, but it's not the only way! I have a proof of concept demonstrating how it is possible to bundle those files with your project so that your end users don't have to install ghc themselves. That proof of concept was recently extended to a real world use case in https://tidalcycles.org/; /u/yaxu, did that end up working? Is there anything you or I could do to make it easier for the next person to apply those ideas to their project?

  • apecs-hint-demo

    demonstrating how to use hint to dynamically modify the game world of an apecs-based game

    Assuming you've succeeded this far, the real challenge is going to be to give the interpreted code access to your game's types. It is imperative to define those in a separate library from the package which calls hint. With stack and cabal, it then suffices to point hint to the package database in which that library is installed. I just created an example repo demonstrating how to use this inside a small apecs program: https://github.com/gelisam/apecs-hint-demo

  • talent.io

    Download talent.io’s Tech Salary Report. Median salaries, most in-demand technologies, state of the remote work... all you need to know your worth on the market by tech recruitment platform talent.io

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