hinter alternatives and similar packages
Based on the "Compiler" category.
Alternatively, view hinter alternatives based on common mentions on social networks and blogs.
-
binaryen
DEPRECATED in favor of ghc wasm backend, see https://www.tweag.io/blog/2022-11-22-wasm-backend-merged-in-ghc -
husk-scheme
A full implementation of the Scheme programming language for the Haskell Platform. -
hyper-haskell-server
The strongly hyped Haskell interpreter. -
hint
Runtime Haskell interpreter [Moved to: https://github.com/haskell-hint/hint] -
bound
Combinators for manipulating locally-nameless generalized de Bruijn terms -
lambdacube-compiler
LambdaCube 3D is a Haskell-like purely functional language for GPU. Try it out: -
haskell-to-elm
Generate Elm types, encoders, and decoders from Haskell types -
unbound
Replib: generic programming & Unbound: generic treatment of binders -
haskelm
Haskell to Elm translation using Template Haskell. Contains both a library and executable. -
lazyboy
An EDSL implemented in Haskell for programming the Nintendo Game Boy. -
accelerate-fft
FFT library for Haskell based on the embedded array language Accelerate -
elm-syntax
Library for generating Elm syntax from Haskell in a scope-safe way -
feldspar-compiler
This is the compiler for the Feldspar Language.
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of hinter or a related project?
Popular Comparisons
README
hint
This library defines an Interpreter monad within which you can interpret
strings like "[1,2] ++ [3]"
into values like [1,2,3]
. You can easily
exchange data between your compiled program and your interpreted program, as
long as the data has a Typeable
instance.
You can choose which modules should be in scope while evaluating these expressions, you can browse the contents of those modules, and you can ask for the type of the identifiers you're browsing.
It is, essentially, a huge subset of the GHC API wrapped in a simpler API.
Limitations
It is possible to run the interpreter inside a thread, but on GHC 8.8 and below, you can't run two instances of the interpreter simlutaneously.
GHC must be installed on the system on which the compiled executable is running.
Compatibility is kept to the three last major GHC releases: GHC 8.10, 8.8 and 8.6. When the next GHC release comes out and hint is adapted to work with it, we will drop support for GHC 8.6.
Example
{-# LANGUAGE LambdaCase, ScopedTypeVariables, TypeApplications #-}
import Control.Exception (throwIO)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Writer (execWriterT, tell)
import Data.Foldable (for_)
import Data.Typeable (Typeable)
import qualified Language.Haskell.Interpreter as Hint
-- |
-- Interpret expressions into values:
--
-- >>> eval @[Int] "[1,2] ++ [3]"
-- [1,2,3]
--
-- Send values from your compiled program to your interpreted program by
-- interpreting a function:
--
-- >>> f <- eval @(Int -> [Int]) "\\x -> [1..x]"
-- >>> f 5
-- [1,2,3,4,5]
eval :: forall t. Typeable t
=> String -> IO t
eval s = runInterpreter $ do
Hint.setImports ["Prelude"]
Hint.interpret s (Hint.as :: t)
-- |
-- >>> :{
-- do contents <- browse "Prelude"
-- for_ contents $ \(identifier, tp) -> do
-- when ("put" `isPrefixOf` identifier) $ do
-- putStrLn $ identifier ++ " :: " ++ tp
-- :}
-- putChar :: Char -> IO ()
-- putStr :: String -> IO ()
-- putStrLn :: String -> IO ()
browse :: Hint.ModuleName -> IO [(String, String)]
browse moduleName = runInterpreter $ do
Hint.setImports ["Prelude", "Data.Typeable", moduleName]
exports <- Hint.getModuleExports moduleName
execWriterT $ do
for_ exports $ \case
Hint.Fun identifier -> do
tp <- lift $ Hint.typeOf identifier
tell [(identifier, tp)]
_ -> pure () -- skip datatypes and typeclasses
Check [example.hs](examples/example.hs) for a longer example (it must be run from hint's base directory).