The Eta Programming Language, a dialect of Haskell on the JVM

Overview

Eta logo

Eta - Modern Haskell on the JVM

Join the chat at https://gitter.im/typelead/eta Build Status Open Source Helpers

The Eta programming language is a dialect of Haskell which runs on the JVM and has the following goals:

  • accessibility for beginners from imperative languages, especially Java
  • compatibility with GHC 7.10.3's Haskell.

Visit eta-lang.org for instructions on getting started.

Version

Version: 0.8.6

Stable Build: 0.8.6b5

Latest Build: 0.8.6b5

Subscribe to the Eta-Discuss for updates.

Getting Started

Visit the Getting Started page in the documentation.

Contribute

Visit the Contribute page in the official website for details.

You are required to sign TypeLead Individual CLA before we can merge any of your work into our code base.

Report issues

You can report issues at eta issue tracker for more details check Bug Report page in the official website for more details.

Eta Proposals

Visit the Eta Proposals page in the official website to propose changes to Eta.

License

Eta is available under the BSD 3-Clause License, see LICENSE for more information.

Contributors

We would like to specifically thank the following groups/people:

Thanks folks!

Comments
  • Using dhall with eta

    Using dhall with eta

    Dhall is a programmable configuration language that is not Turing-complete You can think of Dhall as: JSON + functions + types + imports

    (from https://github.com/dhall-lang/dhall-lang)

    Dhall is a relatively new configuration language written in haskell and its goals and features marry very well with langs like haskell/eta. Its main advantage over yaml f.e. is that dhall is typed and is guaranteed to terminate so you can make your config more discoverable and safe.

    • you can use it to configure programs written in other language: haskell, scala or rust
      • maybe the next can be java or groovy!
    • It can be compiled to other config formats likejson, yaml, bash, nix or cabal
      • maybe the next could be gradle

    Its main drawbacks are:

    • it has a lot of dependencies
    • maybe it is too much powerful (functions and imports) for simple configurations

    The goal of this issue is track the progress and possible problems of the use of dhall ant its tools:

    • [X] compilation of dhall-haskell with eta
    • [X] execution with eta of all core program subcommands (dhall, dhall repl, dhal format, dhall hash, ...)
      • Tested repl, format, hash and lint
    • [X] execution with etlas of its tools:
    • test performance: we will open a new one if needed
    • [X] use dhall-to-etlas to make etlas use dhall as its default configuration input.
      • In progress, tracked in this one: https://github.com/typelead/etlas/issues/66
    • [X] create a library to expose the dhall api and make easy the interop with java client code
    packages 
    opened by jneira 72
  • Windows support

    Windows support

    I am trying to bootstrap eta on Windows and stack exec eta-build install fails with

    Configuring ghc-prim-0.4.0.0...
    # epm (for install)
    Building ghc-prim-0.4.0.0...
    Preprocessing library ghc-prim-0.4.0.0...
    eta.exe: could not execute: C:\Users\abiehl\AppData\Roaming\eta/../mingw/bin/gcc.exe
    Error when running Shake build system:
    * install
    user error (Development.Shake.cmd, system command failed
    Command: epm build
    Current directory: C:\Users\abiehl\git\eta\libraries\ghc-prim
    Exit code: 1
    Stderr:
    eta.exe: could not execute: C:\Users\abiehl\AppData\Roaming\eta/../mingw/bin/gcc.exe
    )
    

    Somehow it thinks a gcc is at C:\Users\abiehl\AppData\Roaming\eta/../mingw/bin/gcc.exe which is of course not right! (a good gcc is on path through stack exec).

    Trying to manually build ghc-prim with stack exec -- epm build --eta-options=" -v4 -pgmP C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin\gcc"

    Building ghc-prim-0.4.0.0...
    Preprocessing library ghc-prim-0.4.0.0...
    The ETA programming language compiler, Version 0.0.1 booted by GHC version 7.10.3
    wired-in package ghc-prim not found.
    wired-in package integer not found.
    wired-in package base not found.
    wired-in package rts mapped to rts-0.1.0.0-dd60ce55e5e6e7d613c6ae1fe388a75d
    wired-in package template-haskell not found.
    wired-in package ghc not found.
    wired-in package dph-seq not found.
    wired-in package dph-par not found.
    E   rts-0.1.0.0-dd60ce55e5e6e7d613c6ae1fe388a75d
    Hsc static flags:
    wired-in package ghc-prim not found.
    wired-in package integer not found.
    wired-in package base not found.
    wired-in package rts mapped to rts-0.1.0.0-dd60ce55e5e6e7d613c6ae1fe388a75d
    wired-in package template-haskell not found.
    wired-in package ghc not found.
    wired-in package dph-seq not found.
    wired-in package dph-par not found.
    *** Chasing dependencies:
    Chasing modules from: *GHC.CString,*GHC.Classes,*GHC.Magic,*GHC.Tuple,*GHC.Types,*GHC.JArray
    Running the pipeline
    Running phase Cpp HsSrcFile
    Running phase HsPp HsSrcFile
    Running the pipeline
    Running phase Cpp HsSrcFile
    Running phase HsPp HsSrcFile
    Running the pipeline
    Running phase Cpp HsSrcFile
    Running phase HsPp HsSrcFile
    Running the pipeline
    Running phase Cpp HsSrcFile
    Running phase HsPp HsSrcFile
    Running the pipeline
    Running phase Cpp HsSrcFile
    Running phase HsPp HsSrcFile
    Running the pipeline
    Running phase Cpp HsSrcFile
    Created temporary directory: C:\Temp\ghc13676_0
    *** C pre-processor:
    "C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin\gcc" "-include" "dist\build\autogen\cabal_macros.h" "-v" "-I" "dist\build" "-I" "dist\build" "-I" "dist\build\autogen" "-I" "dist\build" "-D__GLASGOW_HASKELL__=710" "-D__ETA_VERSION__=000"
    "-include" "C:\Users\abiehl\AppData\Roaming\eta\include\ghcversion.h" "-D__GLASGOW_HASKELL_TH__=NO" "-D__SSE__=1" "-D__SSE2__=1" "-x" "assembler-with-cpp" ".\GHC\JArray.hs" "-o" "C:\Temp\ghc13676_0\ghc_1.hscpp"
    Using built-in specs.
    COLLECT_GCC=C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin/realgcc.exe
    COLLECT_LTO_WRAPPER=C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../gcc-5.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --w
    ith-gxx-include-dir=/mingw64/include/c++/5.2.0 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynam
    ic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry
    --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --wit
    h-gnu-as --with-gnu-ld
    Thread model: posix
    gcc version 5.2.0 (Rev3, Built by MSYS2 project)
    COLLECT_GCC_OPTIONS='-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin' '-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin/../lib' '-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\gh
    c-7.10.3\mingw\bin/../lib/gcc/x86_64-w64-mingw32/5.2.0' '-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin/../libexec/gcc/x86_64-w64-mingw32/5.2.0' '-include' 'dist\build\autogen\cabal_macros.h' '-v' '-I' 'dist\build' '-I' 'dist\build'
     '-I' 'dist\build\autogen' '-I' 'dist\build' '-D' '__GLASGOW_HASKELL__=710' '-D' '__ETA_VERSION__=000' '-include' 'C:\Users\abiehl\AppData\Roaming\eta\include\ghcversion.h' '-D' '__GLASGOW_HASKELL_TH__=NO' '-D' '__SSE__=1' '-D' '__SSE2__=1' '-o' 'C:\Temp\ghc13676_0\ghc_1
    .hscpp' '-mtune=generic' '-march=x86-64'
     C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/cc1.exe -E -lang-asm -quiet -v -I dist\build -I dist\build -I dist\build\autogen -I dist\build -iprefix C:/Users/abiehl/AppData/Local/Programs/stack/x86_
    64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/ -isystem C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/include -isystem C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows
    /ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/include-fixed -D_REENTRANT -D __GLASGOW_HASKELL__=710 -D __ETA_VERSION__=000 -D __GLASGOW_HASKELL_TH__=NO -D __SSE__=1 -D __SSE2__=1 -include dist\build\autogen\cabal_macros.h -include C:\Users\abiehl\AppData\Roam
    ing\eta\include\ghcversion.h .\GHC\JArray.hs -mtune=generic -march=x86-64 -fno-directives-only -o C:\Temp\ccGrlwBj.s
    ignoring duplicate directory "C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/include"
    ignoring duplicate directory "C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/include-fixed"
    ignoring duplicate directory "C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/5.2.0/include"
    ignoring nonexistent directory "D:/develop/msys64/mingw64/include"
    ignoring nonexistent directory "/mingw64/include"
    ignoring duplicate directory "C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/5.2.0/include-fixed"
    ignoring duplicate directory "C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/include"
    ignoring nonexistent directory "D:/develop/msys64/mingw64/x86_64-w64-mingw32/include"
    ignoring duplicate directory "dist\build"
    ignoring duplicate directory "dist\build"
    #include "..." search starts here:
    #include <...> search starts here:
     dist\build
     dist\build\autogen
     C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/include
     C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/include-fixed
     C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../include
     C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/include
    End of search list.
    COLLECT_GCC_OPTIONS='-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin' '-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin/../lib' '-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\gh
    c-7.10.3\mingw\bin/../lib/gcc/x86_64-w64-mingw32/5.2.0' '-B' 'C:\Users\abiehl\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3\mingw\bin/../libexec/gcc/x86_64-w64-mingw32/5.2.0' '-include' 'dist\build\autogen\cabal_macros.h' '-v' '-I' 'dist\build' '-I' 'dist\build'
     '-I' 'dist\build\autogen' '-I' 'dist\build' '-D' '__GLASGOW_HASKELL__=710' '-D' '__ETA_VERSION__=000' '-include' 'C:\Users\abiehl\AppData\Roaming\eta\include\ghcversion.h' '-D' '__GLASGOW_HASKELL_TH__=NO' '-D' '__SSE__=1' '-D' '__SSE2__=1' '-o' 'C:\Temp\ghc13676_0\ghc_1
    .hscpp' '-mtune=generic' '-march=x86-64'
     C:/Users/abiehl/AppData/Local/Programs/stack/x86_64-windows/ghc-7.10.3/mingw/bin/as.exe -v -I dist\build -I dist\build -I dist\build\autogen -I dist\build -o C:\Temp\ccopr6Jw.o C:\Temp\ccGrlwBj.s
    GNU assembler version 2.25.1 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.25.1
    .\GHC\JArray.hs: Assembler messages:
    
    GHC\JArray.hs:1:0:
         Error: junk at end of line, first unrecognized character is `{'
    
    GHC\JArray.hs:2:0:
         Error: no such instruction: `ghcforeignimportprim '
    
    GHC\JArray.hs:3:0:
         Error: junk at end of line, first unrecognized character is `{'
    
    GHC\JArray.hs:4:0:  Error: no such instruction: `module GHC.JArray'
    
    GHC\JArray.hs:5:0:
         Error: junk at end of line, first unrecognized character is `('
    
    GHC\JArray.hs:6:0:  Error: no such instruction: `jshortarray'
    
    GHC\JArray.hs:7:0:  Error: no such instruction: `jchararray'
    
    GHC\JArray.hs:8:0:  Error: no such instruction: `intarray'
    
    GHC\JArray.hs:9:0:  Error: no such instruction: `jlongarray'
    
    GHC\JArray.hs:10:0:  Error: no such instruction: `floatarray'
    
    GHC\JArray.hs:11:0:  Error: no such instruction: `doublearray'
    
    GHC\JArray.hs:12:0:  Error: no such instruction: `objectarray'
    
    GHC\JArray.hs:13:0:  Error: no such instruction: `objectarrayat'
    
    GHC\JArray.hs:14:0:  Error: no such instruction: `objectarrayset'
    
    GHC\JArray.hs:15:0:
         Error: junk at end of line, first unrecognized character is `)'
    
    GHC\JArray.hs:17:0:  Error: no such instruction: `import GHC.Prim'
    
    GHC\JArray.hs:18:0:  Error: no such instruction: `import GHC.Types'
    
    GHC\JArray.hs:20:0:  Error: no such instruction: `type JByteArray'
    
    GHC\JArray.hs:21:0:  Error: no such instruction: `type JShortArray'
    
    GHC\JArray.hs:22:0:  Error: no such instruction: `type JCharArray'
    
    GHC\JArray.hs:23:0:  Error: no such instruction: `type IntArray'
    
    GHC\JArray.hs:24:0:  Error: no such instruction: `type JLongArray'
    
    GHC\JArray.hs:25:0:  Error: no such instruction: `type FloatArray'
    
    GHC\JArray.hs:26:0:  Error: no such instruction: `type DoubleArray'
    
    GHC\JArray.hs:27:0:  Error: no such instruction: `type ObjectArray'
    *** Deleting temp files:
    Deleting: C:\Temp\ghc13676_0\ghc_1.hscpp
    Warning: deleting non-existent C:\Temp\ghc13676_0\ghc_1.hscpp
    *** Deleting temp dirs:
    Deleting: C:\Temp\ghc13676_0
    

    Well it does find gcc now but it tries to assemble JArray.hs as is which is of course wrong.

    How can I install eta and co on Windows?

    bug build 
    opened by alexbiehl 51
  • Optimization produces incorrect results

    Optimization produces incorrect results

    @jarekratajski reported this:

    fibbtcoinner 0 sum presum  = sum
    fibbtcoinner n sum presum = fibbtcoinner  (n-1) (sum + presum) sum
    
    fibbtco n = fibbtcoinner n 1 0
    
    fibbnaive  0 = 1
    fibbnaive  1 = 1
    fibbnaive  n = fibbnaive ( n-1) + fibbnaive ( n - 2)
    
    main = do
            putStrLn $ show $ fibbtco <$> arr
            putStrLn $ show $ fibbnaive <$> arr
            where
    arr = [0..10]
    

    produces

    [1,1,2,4,8,16,32,64,128,256,512]
    [1,1,2,3,5,8,13,21,34,55,89]
    

    when it should produce:

    [1,1,2,3,5,8,13,21,34,55,89]
    [1,1,2,3,5,8,13,21,34,55,89]
    

    Reproduced on v0.7.

    bug 
    opened by rahulmutt 36
  • unix-2.7.2.2 Not working

    unix-2.7.2.2 Not working

    Hi I want to use the Scotty module 0.11.0 and has as dependency unix-2.7.2.2 which seems is not working properly with eta version 0.8.0b2

    The error code says

    Building unix-2.7.2.2 (lib)...

    > Task :installDependenciesEta FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':installDependenciesEta'.
    > [/.gradle/caches/etlas/1.4.0.0/etlas, --select-eta=0.8.0b2, deps, lib:eta-init] failed with ExitCode 1
    

    Any idea how to fix this?

    opened by politrons 31
  • Problems with concurrent requests in wai and servant

    Problems with concurrent requests in wai and servant

    I am reporting this here because it seems like some of the things I am seeing are probably not wai specific. Sorry for the length of this ticket, it tires to document various issues I encountered when several requests are executed concurrently/very close to each other by wai Jetty server.

    I have a project using servant that now has been converted to eta: https://github.com/rpeszek/crud-ex-backend-servant/tree/eta-jetty (eta-jetty branch) It uses Raw WAI logic to serve static files, and I see somewhat different errors with 'true' servant endpoints like endpoints serving JSON.

    Right after etlas run if I first issue a single GET request like: http://localhost:9000/static/css/pure.css everything works fine. The first request takes some time to complete (warmup time typical of Java apps) but after that everything works and seems fast.

    If right after starting the app I point my browser at: http://localhost:9000/elm# (which returns a full page) browser issues 4 GET request one for the page which completes and 3 for CSS and JS file which never complete (none of the 3 completes). It looks like a deadlock. If that happens, nothing works until the app is restarted and I issue a simple isolated 'warm-up' request. No errors are printed in the console.

    To troubleshoot I added some putStrLn "hello" lines (at the beginning of WAI.Application handler) to see if the line gets hit. Weirdly enough, with that change I get errors printed

    2017-09-17 18:40:09.996:WARN:oejs.HttpChannel:qtp1468343491-15: /static/css/pure.css
    eta.runtime.exception.EtaException: thread blocked indefinitely in an MVar operation
    	at resourcet.control.monad.trans.Resource$sat_s1FFQ.enter(Resource.hs:189)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at eta.runtime.exception.Exception.catch_(Exception.java:174)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: 
    eta.runtime.exception.EtaException: thread blocked indefinitely in an MVar operation
    	at eta.runtime.stg.Capability.detectMVarDeadlock(Capability.java:523)
    	at eta.runtime.stg.Capability.idleLoop(Capability.java:516)
    	at eta.runtime.stg.Capability.blockedLoop(Capability.java:534)
    	at eta.runtime.stg.Capability.blockedLoop(Capability.java:530)
    	at eta.runtime.concurrent.Concurrent.takeMVar(Concurrent.java:63)
    	at base.ghc.io.handle.Internals$$wa2.enter(Internals.hs:163)
    	at base.ghc.io.handle.Internals$a3_sG1VB.enter(Internals.hs:132)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at base.ghc.io.handle.Internals$withHandlezq1.enter(Internals.hs:130)
    	at base.ghc.io.handle.Internals$wantWritableHandle2.enter(Internals.hs:236)
    	at base.ghc.io.handle.Internals$wantWritableHandle1.enter(Internals.hs:226)
    	at base.ghc.io.handle.Text$hPutStr2.enter(Text.hs:544)
    	at crud_ex_backend_servant.util.WaiStatic$$wa1.enter(WaiStatic.hs:30)
    	at crud_ex_backend_servant.util.StaticFiles$sat_s1HO6.enter(StaticFiles.hs:29)
    	at eta.runtime.apply.Function.applyPPV(Function.java:164)
    	at servant_server.servant.server.Internal$sat_s42PO.enter(Internal.hs:441)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:91)
    	at resourcet.control.monad.trans.Resource$sat_s1FFK.enter(Resource.hs)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.catch_(Exception.java:136)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    2017-09-17 18:40:09.997:WARN:oejs.HttpChannel:qtp1468343491-11: /static/css/styles.css
    eta.runtime.exception.EtaException: Exception was thrown in rendering exception of type class java.lang.NullPointerException
    	at resourcet.control.monad.trans.Resource$sat_s1FFQ.enter(Resource.hs:189)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at eta.runtime.exception.Exception.catch_(Exception.java:174)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:126)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: 
    eta.runtime.exception.EtaException: thread blocked indefinitely in an MVar operation
    	at eta.runtime.stg.Capability.detectMVarDeadlock(Capability.java:523)
    	at eta.runtime.stg.Capability.idleLoop(Capability.java:516)
    	at eta.runtime.stg.Capability.blockedLoop(Capability.java:534)
    	at eta.runtime.stg.Capability.blockedLoop(Capability.java:530)
    	at eta.runtime.concurrent.Concurrent.takeMVar(Concurrent.java:63)
    	at base.ghc.io.handle.Internals$$wa2.enter(Internals.hs:163)
    	at base.ghc.io.handle.Internals$a3_sG1VB.enter(Internals.hs:132)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at base.ghc.io.handle.Internals$withHandlezq1.enter(Internals.hs:130)
    	at base.ghc.io.handle.Internals$wantWritableHandle2.enter(Internals.hs:236)
    	at base.ghc.io.handle.Internals$wantWritableHandle1.enter(Internals.hs:226)
    	at base.ghc.io.handle.Text$hPutStr2.enter(Text.hs:544)
    	at crud_ex_backend_servant.util.WaiStatic$$wa1.enter(WaiStatic.hs:30)
    	at crud_ex_backend_servant.util.StaticFiles$sat_s1HO6.enter(StaticFiles.hs:29)
    	at eta.runtime.apply.Function.applyPPV(Function.java:164)
    	at servant_server.servant.server.Internal$sat_s42PO.enter(Internal.hs:441)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:91)
    	at resourcet.control.monad.trans.Resource$sat_s1FFK.enter(Resource.hs)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.catch_(Exception.java:136)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:126)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    

    (here pure.css returned 500 and remaining 2 never returned). I see no errors if putStrLn is removed or if requests are run in isolation. I see the printouts with or without warmup (with warmup fewer printouts and more intermittent). If requests are run in isolation everything works. However once the errors are encountered server stops responding and printing anything. suggesting that serving threads are dead.

    MemoryManager: Adding putStrLn to a JSON handler (true Servant endpoint) produces another strange behavior. No error are printed in JSON request is executed in isolation. However if it is accompanied with other requests (like CSS files, etc) I get this error:

    2017-09-17 16:12:02.603:WARN:oejs.HttpChannel:qtp1468343491-16: /things
    eta.runtime.exception.EtaException: JException java.lang.IllegalStateException: The block that corresponds to the address 1048587 is not allocated in memory
    	at resourcet.control.monad.trans.Resource$sat_s1FFQ.enter(Resource.hs:189)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at eta.runtime.exception.Exception.catch_(Exception.java:174)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by:
    java.lang.IllegalStateException: The block that corresponds to the address 1048587 is not allocated in memory
    	at eta.runtime.io.MemoryManager.getBoundedBuffer(MemoryManager.java:615)
    	at eta.bytestring.Utils.memcmp(Utils.java:46)
    	at bytestring.data.bytestring.Internal$$wcompareBytes.enter(Internal.hs:594)
    	at http_media.network.http.media.mediatype.Internal$$w$cparseAccept.enter(Internal.hs:47)
    	at http_media.network.http.Media$mapAcceptMedia_go.enter(Media.hs:235)
    	at http_media.network.http.Media$$w$sparseQuality.enter(Media.hs:232)
    	at crud_ex_backend_servant.crudex.Server$$Lr2SVZZ$wlvl18.enter(Server.hs)
    	at crud_ex_backend_servant.crudex.Server$$Lr2SW0lvl49.enter(Server.hs)
    	at eta.runtime.apply.Function.applyPPP(Function.java:190)
    	at servant_server.servant.server.Internal$sat_s40K8.enter(Internal.hs:220)
    	at eta.runtime.apply.Function.applyP(Function.java:102)
    	at servant_server.servant.server.internal.RoutingApplication$sat_s1X8U.enter(RoutingApplication.hs:379)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:91)
    	at resourcet.control.monad.trans.Resource$sat_s1FFK.enter(Resource.hs)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.catch_(Exception.java:136)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    

    I sometimes see this super puzzling error that does not even have any of my code in the stack trace:

    2017-09-17 13:41:33.517:WARN:oejs.HttpChannel:qtp2114537280-11: /things
    eta.runtime.exception.EtaException: JException java.nio.BufferUnderflowException
    	at resourcet.control.monad.trans.Resource$sat_s1FFQ.enter(Resource.hs:189)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at eta.runtime.exception.Exception.catch_(Exception.java:174)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by:
    java.nio.BufferUnderflowException
    	at java.nio.Buffer.nextGetIndex(Buffer.java:500)
    	at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:249)
    	at eta.bytestring.Utils.memcmp(Utils.java:50)
    	at bytestring.data.bytestring.Internal$$wcompareBytes.enter(Internal.hs:594)
    	at http_media.network.http.media.mediatype.Internal$$w$cparseAccept.enter(Internal.hs:47)
    	at http_media.network.http.Media$mapAcceptMedia_go.enter(Media.hs:235)
    	at http_media.network.http.Media$$w$sparseQuality.enter(Media.hs:232)
    	at servant_server.servant.server.Internal$v_s40IY.thunkEnter(Internal.hs:205)
    	at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    	at eta.runtime.thunk.Thunk.applyP(Thunk.java:151)
    	at servant_server.servant.server.Internal$eta1_s40JA.thunkEnter(Internal.hs)
    	at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    	at eta.runtime.thunk.Thunk.applyP(Thunk.java:151)
    	at servant_server.servant.server.Internal$sat_s40JM.thunkEnter(Internal.hs)
    	at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.apply.Function.applyPV(Function.java:117)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.apply.Function.applyPV(Function.java:117)
    	at eta.runtime.apply.Function.applyPPV(Function.java:156)
    	at servant_server.servant.server.internal.RoutingApplication$sat_s1X7V.enter(RoutingApplication.hs:215)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyPV(PAP.java:142)
    	at eta.runtime.thunk.Thunk.applyPV(Thunk.java:156)
    	at servant_server.servant.server.internal.RoutingApplication$sat_s1X8U.enter(RoutingApplication.hs:370)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:91)
    	at resourcet.control.monad.trans.Resource$sat_s1FFK.enter(Resource.hs)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.catch_(Exception.java:136)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    

    Is putStrLn not safe to use here? I modified https://github.com/rahulmutt/eta-servant-example code like so:

            hello :: Maybe String -> Handler HelloMessage
            hello mname = do
              _ <- liftIO $ putStrLn "Hello"
              return . HelloMessage $ case mname of
                 Nothing -> "Hello, anonymous coward"
                 Just n  -> "Hello, " ++ n
    

    By issuing 2 requests very close to each other right after app start: http://localhost:9000/invalid http://localhost:9000/hello

    I can get this error:

    2017-09-17 16:50:31.686:WARN:oejs.HttpChannel:qtp1987360300-10: /hello
    eta.runtime.exception.RuntimeInternalError: |[Eta v0.0.9b1] ap_p|Please report this as a bug: https://github.com/typelead/eta/issues
    	at eta.runtime.RuntimeLogging.barf(RuntimeLogging.java:15)
    	at eta.runtime.stg.Closure.applyP(Closure.java:62)
    	at eta.runtime.thunk.Thunk.applyP(Thunk.java:151)
    	at main.Main$sat_s3EDC.thunkEnter(Main.hs)
    	at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    	at eta.runtime.thunk.Thunk.applyP(Thunk.java:151)
    	at bytestring.data.bytestring.builder.Internal$sat_s490T.enter(Internal.hs:391)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.IO$unsafeDupablePerformIO.enter(IO.hs:182)
    	at bytestring.data.bytestring.builder.Internal$toLazzyByteStringWith.enter(Internal.hs:248)
    	at bytestring.data.bytestring.Builder$toLazzyByteString.enter(Builder.hs:281)
    	at main.Main$$s$fAllCTRender_ZC_a_$s$fMimeRender_zt_JSON_a_$cmimeRender2.enter(Main.hs)
    	at eta.runtime.apply.Function.applyPP(Function.java:139)
    	at servant.servant.api.ContentTypes$bs_s1TVC.thunkEnter(ContentTypes.hs:277)
    	at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    	at servant_server.servant.server.Internal$sat_s40K5.thunkEnter(Internal.hs:189)
    	at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    	at eta.runtime.stg.Closure.evaluate(Closure.java:24)
    	at wai.network.Wai$responseLBS1.enter(Wai.hs)
    	at servant_server.servant.server.Internal$sat_s40K6.enter(Internal.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyPV(PAP.java:142)
    	at blaze_builder.blaze.bytestring.Builder$$wa2_s1GQB.enter(Builder.hs)
    	at blaze_builder.blaze.bytestring.Builder$sat_s1GUH.enter(Builder.hs:246)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.IO$unsafeDupablePerformIO.enter(IO.hs:182)
    	at blaze_builder.blaze.bytestring.Builder$$wtoLazzyByteStringWith.enter(Builder.hs:245)
    	at wai_servlet.network.wai.servlet.Response$$wa.enter(Response.hs:61)
    	at wai_servlet.network.wai.servlet.Response$updateHttpServletResponse1.enter(Response.hs)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFE.enter(Jetty.hs:46)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.apply.Function.applyPV(Function.java:117)
    	at servant_server.servant.server.internal.RoutingApplication$sat_s1X8U.enter(RoutingApplication.hs:371)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:91)
    	at resourcet.control.monad.trans.Resource$sat_s1FFK.enter(Resource.hs)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at eta.runtime.exception.Exception.catch_(Exception.java:136)
    	at resourcet.control.monad.trans.Resource$sat_s1FFR.enter(Resource.hs:188)
    	at eta.runtime.apply.Function.applyV(Function.java:16)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
    	at resourcet.control.monad.trans.Resource$sat_s1FG4.enter(Resource.hs:187)
    	at eta.runtime.apply.Function.applyPV(Function.java:120)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1067)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at base.ghc.Base$bindIO1.enter(Base.hs:1021)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyV(PAP.java:41)
    	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    	at wai_servlet_handler_jetty.network.wai.servlet.handler.Jetty$sat_sRFP.enter(Jetty.hs:41)
    	at eta.runtime.apply.Function.applyO(Function.java:87)
    	at eta.runtime.thunk.Thunk.applyO(Thunk.java:146)
    	at base.java.TopHandler$runJava1.enter(TopHandler.hs:25)
    	at base.java.TopHandler$runJava.enter(TopHandler.hs)
    	at eta.runtime.apply.PAP.apply(PAP.java:31)
    	at eta.runtime.apply.PAP.applyO(PAP.java:111)
    	at eta.runtime.stg.Closures$EvalJava.enter(Closures.java:149)
    	at eta.runtime.stg.Capability.schedule(Capability.java:156)
    	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:101)
    	at eta.runtime.Runtime.evalJava(Runtime.java:201)
    	at eta.org.eclipse.jetty.server.handler.AbstractHandler$Eta.handle(Unknown Source)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    	at org.eclipse.jetty.server.Server.handle(Server.java:564)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
    	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:126)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
    	at java.lang.Thread.run(Thread.java:745)
    Hello
    
    bug 
    opened by rpeszek 30
  • Can't run jar even in uberjar-mode

    Can't run jar even in uberjar-mode

    I had install eta 0.0.6b3

    But can't run jar even in uberjar mode the error info is as blow.

    I had try etlas run without uberjar-mode, the error info is the same.

    $etlas clean
    cleaning...
    $ etlas configure --enable-uberjar-mode
    Resolving dependencies...
    Configuring eta-example-0.1.0.0...
    zhangjuns-MacBook-Pro:eta-example zhangjun$ etlas build
    Preprocessing executable 'eta-example' for eta-example-0.1.0.0..
    Building executable 'eta-example' for eta-example-0.1.0.0..
    [1 of 1] Compiling Main             ( src/Main.hs, dist/build/eta-example/eta-example-tmp/Main.jar )
    
    src/Main.hs:10:1: Warning: Tab character
    
    src/Main.hs:11:1: Warning: Tab character
    
    src/Main.hs:12:1: Warning: Tab character
    
    src/Main.hs:15:5: Warning: Tab character
    
    src/Main.hs:16:5: Warning: Tab character
    
    src/Main.hs:17:5: Warning: Tab character
    
    src/Main.hs:18:5: Warning: Tab character
    
    src/Main.hs:19:5: Warning: Tab character
    
    src/Main.hs:26:1: Warning: Tab character
    Linking dist/build/eta-example/eta-example.jar ...
    
    $ java -jar ./dist/build/eta-example/eta-example.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: eta/base/Utils
    	at base.system.Environment$getArgs1.enter(Unknown Source)
    	at eta.runtime.apply.StgFun.apply(StgFun.java:19)
    	at eta.runtime.apply.ApV.stackEnter(ApV.java:12)
    	at eta.runtime.stg.StackFrame.enter(StackFrame.java:43)
    	at eta.runtime.stg.StgContext.checkForStackFrames(StgContext.java:79)
    	at base.ghc.Base$bindIO1.enter(Unknown Source)
    	at eta.runtime.apply.Apply$PAPApply.enter(Apply.java:231)
    	at eta.runtime.apply.StgPAP.apply(StgPAP.java:46)
    	at eta.runtime.apply.ApV.stackEnter(ApV.java:12)
    	at eta.runtime.stg.StackFrame.enter(StackFrame.java:43)
    	at eta.runtime.stg.StackFrame.enter(StackFrame.java:26)
    	at eta.runtime.stg.StackFrame.enter(StackFrame.java:26)
    	at eta.runtime.stg.Capability.schedule(Capability.java:260)
    	at eta.runtime.RtsScheduler.scheduleWaitThread(RtsScheduler.java:57)
    	at eta.runtime.Rts.evalLazyIO(Rts.java:96)
    	at eta.runtime.Rts.hsMain(Rts.java:38)
    	at eta.main.main(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: eta.base.Utils
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	... 17 more
    
    bug 
    opened by JulianZhang 30
  • Install Failure - eta: panic! (the 'impossible' happened)   (Eta version 0.0.5):

    Install Failure - eta: panic! (the 'impossible' happened) (Eta version 0.0.5):

    [1 of 5] Compiling GHC.Types ( GHC/Types.hs, dist/build/GHC/Types.jar ) eta: panic! (the 'impossible' happened) (Eta version 0.0.5): Parsing of archive structure failed: Cannot locate end of central directory in "/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Types.jar"

    Please report this as a Eta bug: http://github.org/typelead/eta/issues

    Failed to install ghc-prim-0.4.0.0 epm: Error: some packages failed to install: ghc-prim-0.4.0.0 failed during the building phase. The exception was: ExitFailure 1 Error when running Shake build system:

    • install user error (Development.Shake.cmd, system command failed Command: epm install --solver=topdown Current directory: /home/john/eta/eta/libraries/ghc-prim Exit code: 1 Stderr: eta: panic! (the 'impossible' happened) (Eta version 0.0.5): Parsing of archive structure failed: Cannot locate end of central directory in "/home/john/eta/eta/libraries/ghc-prim/dist/build/GHC/Types.jar"

    Please report this as a Eta bug: http://github.org/typelead/eta/issues

    epm: Error: some packages failed to install: ghc-prim-0.4.0.0 failed during the building phase. The exception was: ExitFailure 1 )

    bug build 
    opened by Hondough 27
  • Building shake package causes panic

    Building shake package causes panic

    See https://github.com/rahulmutt/eta-bug for reproducing.

    The error is:

    [58 of 58] Compiling Development.Shake.Config ( src/Development/Shake/Config.hs, dist/build/Development/Shake/Config.jar )
    
    <no location info>:
        eta: panic! (the 'impossible' happened)
      (Eta version 0.7.0b2):
    	unequal assigmnents
    
    Please report this as a Eta bug: http://github.com/typelead/eta/issues
    

    @jarekratajski This panic is coming from your recent multiAssign changes.

    The tail end of Config.dump-cg-trace:

    ...
    Generating (mutually recursive) readConfigFile_go
    StgCase wild_sF1XY Alg HashMap
    StgApp ds_sF1XW []
    cgIdApp: EnterIt
    StgApp z1_sF1XV [eta_sF1XX]
    cgIdApp: SlowCall
    StgCase sat_sF1Y1 Prim Int#
    StgOpApp sizeofSmallArray# [dt1_sF1Y0] Int#
    StgApp $s$wgo2_rF1KD [dt1_sF1Y0, sat_sF1Y1, 0, z1_sF1XV, eta_sF1XX]
    cgIdApp: JumpToIt
    

    So that indicates the problem occurred when generating a call to $s$wgo2_rF1KD.

    The context from Config.dump-stg:

    ...
            case ds_sF1XW of _ [Occ=Dead] {
              Data.HashMap.Base.Empty -> z1_sF1XV eta_sF1XX;
              Data.HashMap.Base.BitmapIndexed _ [Occ=Dead] dt1_sF1Y0 ->
                  case sizeofSmallArray# [dt1_sF1Y0] of sat_sF1Y1 {
                    __DEFAULT ->
                        $s$wgo2_rF1KD dt1_sF1Y0 sat_sF1Y1 0 z1_sF1XV eta_sF1XX;
                  };
    ...
    

    I wonder if there's some assumption we made about multi assignments that's getting invalidated here?

    bug codegen 
    opened by rahulmutt 23
  • Using Data.Text.IO.readFile throws intermitent java.nio.channels.ClosedByInterruptException

    Using Data.Text.IO.readFile throws intermitent java.nio.channels.ClosedByInterruptException

    Description

    dhall-eta tests reads lot of dhall files using Data.Text.IO.readFile and some of the calls throws java.nio.channels.ClosedByInterruptException

    Expected Behavior

    All files should be readed correctly

    Actual Behavior

    Some of the calls throws:

    normalization/success/prelude/Natural/even/0A.dhall:          FAIL
          Exception: 
          ↳ ./../dhall-lang/Prelude/package.dhall
          JException java.nio.channels.ClosedByInterruptException
    

    In windows i get occasionally

          Exception:
          ↳ ./../dhall-lang/Prelude/package.dhall
            ↳ ./../dhall-lang/Prelude/Integer/package.dhall
              ↳ ./../dhall-lang/Prelude/Integer/toDouble
          D:\ws\eta\dhall\dhall-eta\..\dhall-lang\Prelude\Integer\toDouble: openFile: resource busy (file is locked)
    

    Possible Fix

    Not sure where the bug can be fixed.. to investigate

    Steps to Reproduce

    1. Trigger a circleci test build for dhall-eta like https://circleci.com/gh/eta-lang/dhall-eta/13
    2. Or checkout dhall-eta and run etlas test in local

    Context

    Setup test suite for dhall-eta

    Your Environment

    • circleci with eta master docker image
    • local: windows with eta and etlas built from master
    • Link to your project: https://github.com/eta-lang/dhall-eta
    bug rts 
    opened by jneira 21
  • Error installing package with cpp condition over package base version using etlas new-build

    Error installing package with cpp condition over package base version using etlas new-build

    • In double-conversion-2.0.2.0 there is a module (Data.Double.Conversion.Text) with a cpp condition:
    #if MIN_VERSION_base(4,4,0)
    import Control.Monad.ST.Unsafe (unsafeIOToST)
    #else
    import Control.Monad.ST (unsafeIOToST)
    #endif
    
    • with etlas new-build it fails with:
    Data\Double\Conversion\Text.hs:30:26:
        Module `Control.Monad.ST' does not export `unsafeIOToST'
    
    • it seems the cpp condition is not working
    • with etlas old-build it works
    bug build 
    opened by jneira 20
  • java.lang.NoClassDefFoundError: eta/time/Utils when calling Data.Time.LocalTime.getZonedTime

    java.lang.NoClassDefFoundError: eta/time/Utils when calling Data.Time.LocalTime.getZonedTime

    Minimum program to reproduce

    etlas build this program as a uberjar.

    module Main where
    
    import           Data.Time.LocalTime
    
    main :: IO ()
    main = print =<< getZonedTime
    

    The error message

    $ etlas build
    Resolving dependencies...
    Configuring eta-time-error-0.1.0.0...
    Preprocessing executable 'eta-time-error' for eta-time-error-0.1.0.0..
    Building executable 'eta-time-error' for eta-time-error-0.1.0.0..
    [1 of 1] Compiling Main             ( src\Main.hs, dist\build\eta-time-error\eta-time-error-tmp\Main.jar )
    Linking dist\build\eta-time-error\eta-time-error.jar ...
    $ java -jar dist\build\eta-time-error\eta-time-error.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: eta/time/Utils
            at time.data.time.localtime.internal.TimeZone$$wa.enter(TimeZone.hs:91)
            at time.data.time.localtime.internal.TimeZone$$wa1.apply2V(TimeZone.hs:99)
            at time.data.time.localtime.internal.ZonedTime$getZZonedTime1.applyV(ZonedTime.hs:52)
            at main.Main$main1.applyV(Main.hs:8)
            at main.Main$DZCmain.applyV(Main.hs)
            at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:104)
            at eta.runtime.stg.Capability.schedule(Capability.java:157)
            at eta.runtime.stg.Capability.scheduleClosure(Capability.java:102)
            at eta.runtime.Runtime.evalLazyIO(Runtime.java:189)
            at eta.runtime.Runtime.main(Runtime.java:182)
            at eta.main.main(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: eta.time.Utils
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            ... 11 more
    

    My environment

    $ etlas exec eta -- --version
    Compiler for the Eta Programming Language, version 0.0.9b6
    $ etlas --version
    etlas version 1.1.0.0
    compiled using version 2.1.0.0 of the etlas-cabal library
    $ java -version
    java version "1.7.0_80"
    Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
    Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
    
    opened by igrep 20
  • Spelling

    Spelling

    Description

    This PR corrects misspellings identified by the check-spelling action.

    The misspellings have been reported at https://github.com/jsoref/eta/commit/5a440c46768b4d4553dc2bfeffa329b2a7262fda#commitcomment-79875390

    How Has This Been Tested?

    The action reports that the changes in this PR would make it happy: https://github.com/jsoref/eta/commit/28d74f30e4030b2e82326c1962ea8d726c7aa294

    Note: this PR does not include the action. If you're interested in running a spell check on every PR and push, that can be offered separately.

    Types of changes

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [x] Breaking change (fix or feature that would cause existing functionality to change)
    • [x] Documentation change
    • [x] Test suite change

    It's quite possible there are breaking changes. I fully expect this will need to be split or something. I'm very comfortable w/ working on large changesets. I just need direction about how each project prefers to address them.

    Checklist:

    • [ ] I have read the CONTRIBUTING document.
    opened by jsoref 0
  • Update URLs

    Update URLs

    Description

    Generally https urls should be preferred over http urls. Also, live urls should be preferred over dead ones.

    Note that I tend to leave distinct changes as distinct commits as it makes it easier for me to drop things that groups don't like. I'm not attached to any of these individual changes, nor their structure. I'm happy to squash, although I prefer to do that after the changes are accepted (and I'm happier to let someone else squash and pick a commit message).

    How Has This Been Tested?

    I used a simple script that checked to see if it looked like pages were available via https:

    check() { curl -I "$1"; curl -I "$(echo "$1" | perl -pe 's<http:><https:>')"; }
    

    And had a handy script to update them if they did:

    update() { rs "$1" "$(echo "$1" | perl -pe 's<http:><https:>')" "https"; }     
    

    For a number of things that failed or provided redirects, I followed them.

    Note that I left a handful of dead dangling links as http (and msys insists on using http, so...)

    Types of changes

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)
    • [x] Documentation change
    • [ ] Test suite change

    Checklist:

    • [x] I have read the CONTRIBUTING document.
    opened by jsoref 0
  • Website down?

    Website down?

    I'm trying to get eta/etlas setup to compile a pretty straightforward cabal project to the jvm using eta on wsl, and it appears certain parts of the eta-lang website nescesary to get etlas to work are down.

    Whenever I try to setup the eta-init project using gradle, I get `Execution failed for task ':setupEnvironmentEta'.

    Failed to fetch file from url: http://cdnverify.eta-lang.org/eta-binaries/etlas-1.5.0.0/binaries/x86_64-linux/etlas`

    Similarly, whenever I try to etlas update, I get: curl: (6) Could not resolve host: metrics.eta-lang.org

    opened by Sintrastes 5
  • Installation fails on freebsd

    Installation fails on freebsd

    git clone https://github.com/typelead/eta-init

    Task :setupEnvironmentEta FAILED FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':setupEnvironmentEta'.

    Unsupported OS 'FreeBSD'; install etlas manually and configure with etlasPath

    opened by devosalain 1
  • Task :installDependenciesEta FAILED when building statistics-0.15.2.0 from Hackage

    Task :installDependenciesEta FAILED when building statistics-0.15.2.0 from Hackage

    Task :installDependenciesEta FAILED when building statistics-0.15.2.0 from Hackage

    Description

    When Eta tries to build and install the dependency, 'statistics:0.15.2.0', it suddenly went into panic while building the library for math-functions-0.3.3.0.

    Eta then exited the build process with an exception.

    Expected Behavior

    Successful build and installation of the statistics-0.15.2.0 package.

    Actual Behavior

    The dependency build process failed at step 7 when building the library for math-functions-0.3.3.0.

    The information provided by Eta is as follows:

    [ 6 of 11] Compiling Numeric.Series
    [ 7 of 11] Compiling Numeric.SpecFunctions.Compateta: panic! (the 'impossible' happened) (Eta version 0.8.6b5): tcCheckFIType: Unsupported calling convention. ccall unsafe "value erfc"

    Please report this as a Eta bug: http://github.com/typelead/eta/issues

    statistics-0.15.2.0). See the build log above for details.

    Task :installDependenciesEta FAILED :installDependenciesEta (Thread[Task worker for ':',5,main]) completed. Took 3.536 secs.

    FAILURE: Build failed with an exception.

    Possible Fix

    N.A.

    Steps to Reproduce

    1. Include 'statistics:0.15.2.0' as a dependency in the Gradle build config file.
    2. Import Statistics.Distribution.Normal in Main.hs
    3. Run gradlew

    Context

    Trying to import the library to use in my program.

    Your Environment

    • Did you install an older version of Eta/Etlas before? No
    • Current Eta & Etlas version: Eta 0.8.6b5 & Etlas 1.5.0.0
    • Operating System and version: Ubuntu 18.04.4 LTS / bionic
    • Link to your project: N.A.
    opened by kervinlow 1
  • Is this project still alive?

    Is this project still alive?

    Based on the fact that there's not much commit/release activity in last half year, I'm wondering if this project is still alive, under development, or has it been abandonned?

    opened by vaclavsvejcar 5
Releases(0.8.6b5)
  • 0.8.6b5(Feb 24, 2019)

    This release contains support for Java 9 and above and includes some bug fixes.

    See the commentary in the issues below for more details:

    • #648 - A minor code generation improvement that avoids off-heap allocations for constant strings.

    • #943 - Finally adds support for Java 9, 10, and 11.

    • #942 - Code generation improvement that avoids overflowing the constant pool for large code files (2k+ lines).

    • #947 - Fixes a bug that causes invalid paths to be generated for temporary files resulting in runtime exceptions. (@mgsloan)

    Thanks to @jneira and @GordonBGood for documentation improvements (#561, #935, #936).

    In addition, thanks to all the people who have filed detailed issues and all our wonderful community members and users.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.6b4(Jan 21, 2019)

    This release contains major performance improvements and several bug fixes.

    Eta has suffered from some space leaks in programs that make heavy use of laziness to the point where it can potentially cause the GC to hang. We not only fixed this problem in general by implementing thunk clearing, but we also implemented an optimization we didn't have before - the selector thunk optimization which is an absolute requirement for any lazy language to be practical.

    See the commentary in the issues below for more details:

    • #517 - Implements selector thunk optimization

    • #907 - Fixes a bug with foreign exports involving generics and arrays

    • #916 - Fixes a bug with file locking on Windows which causes spurious "resource busy" exceptions.

    • #919 - Fixes a bug where pattern splices via Template Metaprogramming were causing compiler panics.

    • #927 - Fixes a bug with importing multidimensional Java arrays into Eta

    Thanks to all the people who have filed detailed issues and all our wonderful community members and users.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.6b3(Jan 4, 2019)

    This release primarily contains bug fixes.

    The relevant issues are linked below with brief descriptions of what they entail:

    #878 - Fixes a severe bug with floating point operations in Eta. #891, #897 - Fixes a bug with categorizing Unicode characters in the GHC.Unicode module in base. #893 - Fixes a bug with using <: constraints in foreign export declarations. #896 - Fixed a bug with the trampoline function that makes it fail for values. #898 - Support supplementary Unicode character literals #913 - Relaxes case restriction for type constructors since their names won't appear in generated code. #915 - Fixes a bug that caused ClosedByInterruptException to be thrown spuriously.

    Thanks to all the contributors who have contributed to this release:

    • @Jyothsnasrinivas
    • @jneira
    • @puffnfresh
    • @shirouto
    • @rolandtritsch
    • @noahhaasis
    • @mmisamore

    Thanks to all the people who have filed detailed issues and all our wonderful community members and users.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.6b2(Aug 26, 2018)

    What's in the v0.8.6b2 release

    1) REPL Upgrades

    • Printing non-Showable Values
    • Saving Evaluation History

    2) CPU Usage Fix

    It was reported that the CPU usage was over 100% when idle (#839, #862, etlas #69 ). We fixed this problem by doing a small refactor of the RTS. Now the usage is down to < 1% when idle.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.6b1(Aug 19, 2018)

    Eta v0.8.6

    Reproducible builds

    Eta now supports reproducibility by default. If you need details on how to see this in action, check out this gist.

    Base-4.11.1.0

    We've upgraded to base-4.11.1.0 to support the newer hackage packages.

    Backpack

    In order to support better extensibility at compile-time while keeping good performance we took sometime to port Backpack into Eta.

    Language Extensions

    Eta now supports ApplicativeDo, Strict, and StrictData language extensions.

    Library Stabilizations

    Servant, Scotty, Spock, Yesod, and Warp work in Eta.

    Better Nix Builds

    For more information check out this page

    Pattern Match Checking

    We’ve backported GHC 8’s pattern match checker which performs intelligent exhaustiveness checking, especially for GADTs.

    Warning Messages

    Warnings now give a proper context showing you exactly which flags enable the warning in the first place, making day-to-day usage a bit smoother.

    Major Bug Fixes

    • Concurrent Runtime: We did a stress test on a simple Warp server by flooding it with requests to see whether there were any concurrent bugs we needed to fix. We found a few and the fixes are included in this release. There are currently known issues with Eta apps hogging the CPU, which will be fixed by the next release.
    • Memory Manager: The memory manager is part of the runtime responsible for allocating off-heap memory. There were some concurrent bugs discovered and fixed in this release.
    • StackOverflowErrors: In the process of making PureScript work with Eta we discovered some gaps in our trampolining mechanism. We fixed those allowing you to use the trampoline function to handle a wider class of StackOverflowErrors.
    • TemplateHaskell: They were several minor bugs in TemplateHaskell that lead to strange type errors. These have been fixed in this release.

    For more details on this release check out the blog post.

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0b2(Jan 31, 2018)

    Compiler

    • Fixed an FFI bug where the wrong class was being generated for a method call in generic class causing method not found exceptions at runtime. (@rahulmutt)
    • (#603, #610) Fixed a bug in which let-no-escape bindings were being passed arguments in the wrong order causing unexpected (but exception-free) behavior at runtime. (@jarekratajski)
    • (#609, #622) Accurately track relinking state of java inputs to the compiler. (@jneira)

    Runtime

    • Improve performance of eta.runtime.io.MutVar.set() by using lazySet to avoid a volatile write since MutVar provides no concurrency guarantees. (@rahulmutt)
    • (#628) When deferencing an address to a ByteBuffer, return an empty buffer when the input is a null address. (@jneira)

    Documentation

    • (#615, #620) Update the etlas init dialogue and fixed the Java code adding an exception throwing signature. (@y-taka-23)
    Source code(tar.gz)
    Source code(zip)
Owner
TypeLead
Building tools to expedite software development
TypeLead
Transform ML models into a native code (Java, C, Python, Go, JavaScript, Visual Basic, C#, R, PowerShell, PHP, Dart, Haskell, Ruby, F#, Rust) with zero dependencies

m2cgen m2cgen (Model 2 Code Generator) - is a lightweight library which provides an easy way to transpile trained statistical models into a native cod

Bayes' Witnesses 2.3k Jan 4, 2023
lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game resources!

lazy-language-loader lazy-language-loader improves loading times when changing your language by only reloading the language instead of all the game re

Shalom Ademuwagun 7 Sep 7, 2022
For Jack language. Most of codes were commented with their usage, which can be useful for beginner to realize the running principle of a compiler for object-oriented programming language.

Instructions: Download the Java source codes Store these codes into a local folder and open this folder Click the right key of mouse and click ‘Open i

gooooooood 1.1k Jan 5, 2023
This application can recognize the sign language alphabets and help people who do not understand sign language to communicate with the speech and hearing impaired.

Sign Language Recognition App This application can recognize the sign language alphabets and help people who do not understand sign language to commun

Mihir Gandhi 12 Oct 7, 2021
Jamal is a macro language (JAmal MAcro Language)

Jamal Macro Language Jamal is a complex text processor with a wide variety of possible use. The first version of Jamal was developed 20 years ago in P

Peter Verhas 29 Dec 20, 2022
Very spicy additions to the Java programming language.

Project Lombok Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another g

Reinier Zwitserloot 11.7k Jan 1, 2023
The place to come for pair programming practice problems in your language, designed for new and old developers alike.

Coding Dojo About The Coding Dojo is a project and weekly meetup hosted by Code Connector to offer opportunities for learning, mentoring, and practici

Code Connector 55 Nov 18, 2022
👨‍🏫ITMO University first 4 labs. They are about object oriented programming and Java language

Java-Programming-1st-semester 1st lab - math operations, formatted output. 2nd lab - object oriented programming. 3rd lab - SOLID and STUPID principle

Andrey Vasiliev 4 Dec 1, 2022
Very spicy additions to the Java programming language.

Project Lombok Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another g

Project Lombok 11.7k Dec 30, 2022
JurjenLang, an interpreted programming language

JurjenLang An untyped interpreted functional programming language Getting started Follow these three steps on your computer to get started git clone h

JVerbruggen 5 May 3, 2022
Create different patterns and designs using your favorite programming language for this project.

Patterns project for Hacktoberfest Create different patterns and designs using your favourite programming language weather it be a square pattern, sta

Pulkit Handa 5 Oct 5, 2022
MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJ

Andrei Ciobanu 59 Sep 17, 2022
👄 The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike

Quick Info this library tries to solve language detection of very short words and phrases, even shorter than tweets makes use of both statistical and

Peter M. Stahl 532 Dec 28, 2022
Programming Services and Processes - 04 Secure Programming Techniques

Programación de Servicios y Procesos - 04 Técnicas de Programación Segura Tema 04. Técnicas de Programación segura. Curso 2021/2022. Contenidos Introd

José Luis González Sánchez 5 Dec 27, 2022
Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners.

Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners. If You Have any doubt or query you can ask me here or you can also ask me on My LinkedIn Profile

Shaikh Minhaj 3 Nov 8, 2022
a fast, scalable, multi-language and extensible build system

Bazel {Fast, Correct} - Choose two Build and test software of any size, quickly and reliably. Speed up your builds and tests: Bazel rebuilds only what

Bazel 20k Jan 4, 2023
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR v4 Build status ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating

Antlr Project 13.6k Dec 28, 2022
Microservice query language

restQL-core-java restQL-core allows you to run restQL queries directly from JVM applications, making easy to fetch information from multiple services

B2W Digital 43 Jan 26, 2022