Open subes opened 8 months ago
Better alternative: https://github.com/Frege/frege-interpreter
Call Java from Frege: http://mmhelloworld.github.io/blog/2013/07/10/frege-hello-java/
blocker: https://github.com/Frege/frege-interpreter/issues/36#issuecomment-1969676299 (fixed)
Repl with: java -cp frege3.25-latest.jar frege.repl.FregeRepl
https://learnyouahaskell.com/introduction https://github.com/Frege/frege/wiki/LYAH-adaptions-for-Frege https://dierk.gitbooks.io/fregegoodness/content/
Frege ScriptEngine has a few flaws:
Won't do since ScriptEngines don't work for In-JVM usage. Could introduce a REPL based binding (which should also work for vanilla haskell "ghci"), but this would be in a separate project, not in invesdwin-context.
GHCI interpreter: https://stackoverflow.com/a/2144410
arch install "cabal-install" and "ghc-static"
cabal update cabal install hint
$ ghci
import Language.Haskell.Interpreter runInterpreter $ setImports ["Prelude"] >> eval "3 + 5"
hGetLine to read a line from a socket: https://stackoverflow.com/questions/25040884/hgetcontents-vs-hgetline
hPutStrLn to write to socket https://stackoverflow.com/questions/37143458/socket-programming-in-haskell-putstrln-hputstrln-not-behaving-as-expected
https://eta-lang.org/
Unsuitable because there is no ScriptEngine in eta: https://github.com/typelead/eta/issues/466