All Projects → coot → Zephyr

coot / Zephyr

Licence: mpl-2.0
Tree shaking breeze for PureScript CoreFn AST

Programming Languages

haskell
3896 projects
purescript
368 projects

Projects that are alternatives of or similar to Zephyr

How To Setup Webpack 2
🔧 ⚙ Tutorial to setup webpack 2 from scratch.
Stars: ✭ 107 (-13.71%)
Mutual labels:  build-tool
Hq
Lightning fast, zero configuration, web application development server
Stars: ✭ 114 (-8.06%)
Mutual labels:  build-tool
Nginx Builder
A tool to build deb or rpm package of required Nginx version from the source code, with the ability to connect third-party modules. Nginx parameters are set in the yaml configuration file.
Stars: ✭ 123 (-0.81%)
Mutual labels:  build-tool
Buildcache
A build cache
Stars: ✭ 107 (-13.71%)
Mutual labels:  build-tool
Fobis
FoBiS.py, Fortran projects Building System for poor people
Stars: ✭ 111 (-10.48%)
Mutual labels:  build-tool
Pants
The Pantsbuild developer workflow system
Stars: ✭ 1,814 (+1362.9%)
Mutual labels:  build-tool
Make.go
A Go script that could replace your Makefile.
Stars: ✭ 105 (-15.32%)
Mutual labels:  build-tool
Style Dictionary
A build system for creating cross-platform styles.
Stars: ✭ 2,097 (+1591.13%)
Mutual labels:  build-tool
Aria2 Build Msys2
aria2 build scripts on msys2 with custom patches.
Stars: ✭ 112 (-9.68%)
Mutual labels:  build-tool
Please
High-performance extensible build system for reproducible multi-language builds.
Stars: ✭ 1,856 (+1396.77%)
Mutual labels:  build-tool
Walk
A fast, general purpose, graph based build and task execution utility.
Stars: ✭ 108 (-12.9%)
Mutual labels:  build-tool
Ant Javacard
Easy to use Ant task for building JavaCard Classic applets (2.1.1 to 3.1)
Stars: ✭ 109 (-12.1%)
Mutual labels:  build-tool
Mill
Your shiny new Java/Scala build tool!
Stars: ✭ 1,667 (+1244.35%)
Mutual labels:  build-tool
Parcel
The zero configuration build tool for the web. 📦🚀
Stars: ✭ 39,670 (+31891.94%)
Mutual labels:  build-tool
Mmake
Mmake is a small program which wraps make to provide additional functionality, such as user-friendly help output, remote includes, and eventually more. It otherwise acts as a pass-through to standard make.
Stars: ✭ 1,593 (+1184.68%)
Mutual labels:  build-tool
Corrosion
Marrying Rust and CMake - Easy Rust and C/C++ Integration!
Stars: ✭ 106 (-14.52%)
Mutual labels:  build-tool
Catkin tools
Command line tools for working with catkin
Stars: ✭ 115 (-7.26%)
Mutual labels:  build-tool
Mafia
Provides protection against cabal swindling, robbing, injuring or sabotaging people with chopsticks.
Stars: ✭ 125 (+0.81%)
Mutual labels:  build-tool
Arduino Cmake Ng
CMake-Based framework for Arduino platforms
Stars: ✭ 123 (-0.81%)
Mutual labels:  build-tool
Blade Build
Blade is a powerful build system from Tencent, supports many mainstream programming languages, such as C/C++, java, scala, python, protobuf...
Stars: ✭ 1,722 (+1288.71%)
Mutual labels:  build-tool

zephyr

Maintainer: coot zephyr

A tree-shaking tool for PureScript. zephyr takes root terms, finds all terms which are required to evaluate them, and generates code just for them. This is done across all dependencies, and can substantially reduce the size of PureScript bundles. zephyr can also evaluate some expressions (an experimental feature).

Installation

The simplest option is to download the latest release binary. You may also build from source (see "Build & Test" section below).

Usage

# compile your project
purs compile -g corefn bower_components/purescript-*/src/**/*.purs src/**/*.purs

# run `zephyr`
zephyr -f Main.main

then you can bundle with purs bundle command:

purs bundle -o app.js -m Main dce-output/**/*.js

You can integrate it with other build tools, see below.

You can specify modules as entry points, which is the same as specifying all exported identifiers.

# include all identifiers from Data.Eq module
zephyr Data.Eq

# as above
zephyr module:Data.Eq

# include Data.Eq.Eq identifier of Data.Eq module
zephyr ident:Data.Eq.Eq

# include 'Data.Eq.eq' identifier
zephyr Data.Eq.eq

zephyr reads corefn json representation from the output directory, removes non transitive dependencies of entry points and generates common js modules (or corefn representation) to dce-output directory.

Evaluation of literal expressions

Zephyr can evaluate some literal expressions.

import Config (isProduction)

a = if isProduction
  then "api/prod/"
  else "api/dev/"

will be transformed to

a = "api/prod/"

whenever isProduction is true. This allows to have different development and production environments while still ship a minified code which only contains production code. You may define isProduction in a module under a src-prod directory and include it when compiling production code with pulp build -I src-prod and to have another copy for your development environment under src-dev where isProduction is set to false.

Integration with build tools

zephyr can be integrated with

  • pulp: use pulp build -- -g corefn to compile, and pulp browserify --skip-compile -o dce-output to bundle zephyr's output.
  • parcel
  • spago. See this example. Use spago build --purs-args '--codegen corefn,js' to compile, using spago bundle is currently affected by issue.

Build & Test

cabal build exe:zephyr

To run tests

cabal run zephyr-test

C Libraries

The released binaries are dynamically linked against glibc, so if your system is using musl (like Alpine Linux in docker) or another alternative C library, you will need to compile zephyr from source using ghc on that system.

Comments

The -f switch is not 100% safe. Upon running, zephyr will remove exports from foreign modules that seems to be not used: are not used in PureScript code and seem not to be used in the foreign module. If you simply assign to exports using JavaScript dot notation then you will be fine, but if you use square notation exports[var] in a dynamic way (i.e. var is a true variable rather than a string literal), then zephyr might remove code that shouldn't be removed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].