purescript-bundle-fast alternatives and similar packages
Based on the "Development" category.
Alternatively, view purescript-bundle-fast alternatives based on common mentions on social networks and blogs.
-
hadolint
Dockerfile linter, validate inline bash, written in Haskell -
ShellCheck
ShellCheck, a static analysis tool for shell scripts -
intero
Complete interactive development program for Haskell -
fay-base
A proper subset of Haskell that compiles to JavaScript -
criterion
A powerful but simple library for measuring the performance of Haskell code. -
haskell-lsp
Haskell library for the Microsoft Language Server Protocol -
cabal-install-parsers
Scripts and instructions for using CI services (e.g. Travis CI or Appveyor) with multiple GHC configurations -
stgi
A user-centric visual STG implementation to help understand GHC/Haskell's execution model. -
structured-haskell-mode
Structured editing minor mode for Haskell in Emacs -
retrie
Retrie is a powerful, easy-to-use codemodding tool for Haskell. -
inline-c
Write Haskell source files including C code inline. No FFI required. -
inline-java
Haskell/Java interop via inline Java code in Haskell modules. -
gi-atk
Generate Haskell bindings for GObject-Introspection capable libraries -
gtk2hs-buildtools
GUI library for Haskell based on GTK+ -
lambdabot-core
A friendly IRC bot and apprentice coder, written in Haskell. -
fourmolu
A fourk of ormolu that uses four space indentation and allows arbitrary configuration. Don't like it? PRs welcome! -
c2hs
c2hs is a pre-processor for Haskell FFI bindings to C libraries -
scion
OLD, DEPRECATED: Use this instead https://github.com/haskell/haskell-ide-engine -
hie-bios
Set up a GHC API session for various Haskell Projects -
lambdabot
A friendly IRC bot and apprentice coder, written in Haskell. -
threadscope
A graphical tool for profiling parallel Haskell programs
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of purescript-bundle-fast or a related project?
README
purescript-bundle-fast
Tested with PureScript version 0.7.1.0
Synopsis
A fast alternative to Purescript's psc-bundle
to be used during development.
About
One great thing about programming in JavaScript is the speed of development. Just edit your source code file, and immediately reload your browser to instantly see your changes.
With PureScript, you must go through a compilation process. Even if it only takes a few seconds, the lag becomes frustrating when trying to iterate rapidly.
But we can try to bring the compilation time down to almost nothing! This
project manages to do so for the psc-bundle
stage of compilation. It is a
tool called psc-bundle-fast
that replaces the official psc-bundle
tool that
comes with PureScript.
psc-bundle-fast
should be used only during development. For production you
should still use the official psc-bundle
since it does dead code elimination
and will produce smaller output files.
Benchmarks
So how much faster is it? Results for a sample project:
Command | Time | Output .js Size |
---|---|---|
psc-bundle | 1.458s | 108K |
psc-bundle-fast | 0.091s | 464K |
That's 16x faster! It's bigger because it contains lots of library code that is
not being used (regular psc-bundle
strips this out). But for local
development, the larger file size has negligible impact on load time, and no
impact on performance.
What about browserify and webpack?
They are even slower than PureScript's psc-bundle
. Feel free to run your own
benchmarks (and tell us the results!)
Installation
You need GHC and cabal.
$ cabal update
$ cabal install purescript-bundle-fast
Example Usage
First, use psc
as usual to compile your program:
$ psc './bower_components/**/src/*.purs' \
--ffi './bower_components/**/src/*.js' \
'./src/**/*.purs' \
--ffi './src/**/*.js' \
-o output
Now, just for a comparison, here is how we'd use the regular psc-bundle
:
$ psc-bundle './output/**/*.js' -m Main --main Main -o app.js
And here is how you would use psc-bundle-fast
instead of the previous step:
$ psc-bundle-fast -i output -m Main --main Main -o app.js
Differences with psc-bundle
and limitations
Unlike psc-bundle
, psc-bundle-fast
does not use a real JavaScript parser.
Therefore:
It is not able to perform dead code elimination the way that
psc-bundle
does, so it will produce output files that are larger.It will not detect syntax errors in
foreign.js
files. (This is actually an advantage since the error messages thatpsc-bundle
generates are confusing. It's more helpful to see the error that the browser shows).foreign.js
files that userequire
to load external JavaScript modules/libraries will not work. Theseforeign.js
files will load, but if they are executed then an error will be triggered. If you need to a PureScript library that has suchrequire
usage, then you will need to externally load the required JavaScript library, and then create a stub function called "require" that hooks into it. (If you succeed to do this then share with us how you did it!)The custom parser that
psc-bundle-fast
uses is brittle and relies on the specific format thatpsc
outputs. Ifpsc
ever makes (even slight) changes to its output thenpsc-bundle-fast
will break.
Usage
psc-bundle-fast - Bundles compiled PureScript modules for the browser (fast
version, for development)
Usage: psc-bundle-fast (-i|--input-dir DIR) [-o|--output FILE]
(-m|--module MODULE) [--main MODULE] [-n|--namespace ARG]
Available options:
--version Show the version number
-h,--help Show this help text
-i,--input-dir DIR The directory containing the compiled modules. This
directory should contain a subdirectory for each
compiled module(with the name of the module), and
within each of those there should be an index.js (and
optional foreign.js) file. The psc compiler usually
calls the desired directory "output"
-o,--output FILE The output .js file (Default is stdout)
-m,--module MODULE Entry point module name(s). All code which is not a
transitive dependency of an entry point module will
be removed.
--main MODULE Generate code to run the main method in the specified
module.
-n,--namespace ARG Specify the namespace that PureScript modules will be
exported to when running in the
browser. (default: "PS")