ats-pkg: Package manager for ATS

[ ats, bsd3, development, library, program ] [ Propose Tags ]

A collection of scripts to make building ATS projects easy.


[Skip to Readme]
Versions 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.3.0.1, 0.3.0.2, 1.0.0.0, 1.1.0.0, 1.1.0.1, 1.1.0.2, 1.1.0.3, 1.2.0.0, 1.2.0.1, 1.2.0.2, 1.2.0.3, 1.2.0.4, 1.2.0.5, 1.2.0.6, 1.2.0.7, 1.2.0.8, 1.2.1.0, 1.2.1.3, 1.3.0.0, 1.4.0.0, 1.4.0.1, 1.4.0.3, 1.4.0.6, 2.0.0.2, 2.0.0.4, 2.0.0.6, 2.0.0.7, 2.0.0.8, 2.0.0.9, 2.0.0.10, 2.0.0.11, 2.0.0.12, 2.0.0.13, 2.1.0.0, 2.1.0.3, 2.1.0.5, 2.1.0.6, 2.1.0.7, 2.1.0.8, 2.1.0.9, 2.1.0.10, 2.2.0.0, 2.2.0.1, 2.2.0.2, 2.2.0.5, 2.2.0.6, 2.2.0.7, 2.2.0.8, 2.2.0.11, 2.2.0.15, 2.2.0.16, 2.2.0.17, 2.2.0.18, 2.2.1.0, 2.2.1.1, 2.3.0.0, 2.3.0.3, 2.3.0.6, 2.4.0.0, 2.4.0.3, 2.4.0.6, 2.4.1.0, 2.4.1.6, 2.4.2.0, 2.4.2.7, 2.4.2.8, 2.4.2.9, 2.4.2.18, 2.4.2.19, 2.5.0.3, 2.6.0.0, 2.6.0.1, 2.6.0.2, 2.6.0.3, 2.6.1.0, 2.6.1.1, 2.6.1.2, 2.6.1.3, 2.6.1.11, 2.6.1.16, 2.7.0.10, 2.7.0.22, 2.7.1.0, 2.7.1.1, 2.7.1.2, 2.8.0.0, 2.8.0.8, 2.9.0.0, 2.9.0.1, 2.9.0.2, 2.10.0.0, 2.10.0.2, 2.10.0.8, 2.10.0.11, 2.10.0.17, 2.10.0.20, 2.10.1.5, 2.10.1.8, 2.10.2.0, 2.10.2.2, 2.10.2.5, 2.11.0.1, 2.11.0.7, 2.11.0.8, 2.11.0.9, 2.11.0.10, 3.0.0.0, 3.0.0.1, 3.0.0.2, 3.0.0.4, 3.0.0.10, 3.0.0.11, 3.1.0.2, 3.1.0.6, 3.1.0.12, 3.2.1.2, 3.2.1.8, 3.2.2.0
Dependencies ansi-wl-pprint, ats-pkg, base (>=4.7 && <5), binary, bytestring, composition-prelude (>=1.1.0.2), dhall, directory, filemanip, http-client, http-client-tls, lens, optparse-applicative, parallel-io, process, shake, shake-ats (>=1.3.0.0), shake-ext (>=2.3.0.0), tar, temporary, text, unix, zlib [details]
License BSD-3-Clause
Copyright Copyright: (c) 2018 Vanessa McHale
Author Vanessa McHale
Maintainer vamchale@gmail.com
Category Development
Home page https://github.com/vmchale/atspkg#readme
Source repo head: git clone git@github.com:vmchale/atspkg.git
Uploaded by vmchale at Mon Feb 5 01:11:55 UTC 2018
Distributions NixOS:3.2.2.0
Executables atspkg
Downloads 5848 total (528 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-02-05 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Flags

NameDescriptionDefaultType
development

Enable -Werror

DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for ats-pkg-2.2.0.6

[back to package description]

ats-pkg

Build Status

This is a build system for ATS written in Haskell and configured with Dhall. It is not yet stable.

Installation

The easiest way to install is via a script, viz.

curl -sSl https://raw.githubusercontent.com/vmchale/atspkg/master/bash/install.sh | bash -s

Alternately, you can download Cabal and GHC and install with

cabal new-install ats-pkg ~/.local/bin --happy-options='-gcsa' --alex-options='-g'

Note that $HOME/.local/bin will need to be on your PATH.

Examples

atspkg is configured with Dhall. You may wish to read the Dhall tutorial first, but you do not need to fully understand everything to get started.

Project Templates

You can use pi with the builtin ats template as follows:

pi new ats cool-project

You can then build with atspkg build or install with atspkg install.

Alternately, you can start with a templated Haskell library calling ATS code:

pi git vmchale/haskell-ats ambitious-project

which can be built with atspkg build followed by cabal new-build.

Building a Binary Package

The minimal configuration for a package with a binary target is as follows:

let pkg = https://raw.githubusercontent.com/vmchale/atspkg/master/pkgs/default.dhall
in
let dbin = https://raw.githubusercontent.com/vmchale/atspkg/master/pkgs/default-bin.dhall

in pkg //
  { bin =
    [ dbin //
      { src = "src/program.dats"
      , target = "target/program"
      }
    ]
  }

You need only specify the source file and the target; atspkg will parse your ATS source files and track them (it will not track included C).

Building a Haskell Library

You can see an example here. You can configure the ATS side of things as follows:

let pkg = https://raw.githubusercontent.com/vmchale/atspkg/master/pkgs/default.dhall

in pkg //
  { atsSource = [ "ats-src/ambitious-project.dats" ] }

This just tells atspkg to look for a source file called ats-src/ambitious-project.dats, which will be compiled to ambitious-project.c in the default directory (i.e. cbits). You can then call the generated code just as you would call C.

You may want to consider ats-setup as well if you are packaging the Haskell for distribution.

Calling Haskell from ATS

You can see a demo here. Currently, there is not generic Storable instance that works with ATS, so the process is a bit more involved than is ideal. atspkg has abilities similar to hs2ats, which means that you can usually generate ATS types based on the Haskell types.

The following is a minimal example of a configuration file:

let pkg = https://raw.githubusercontent.com/vmchale/atspkg/master/pkgs/default.dhall
in
let dbin = https://raw.githubusercontent.com/vmchale/atspkg/master/pkgs/default-bin.dhall

in pkg //
  { bin =
    [
      dbin //
      { src = "src/project.dats"
      , target = "target/project"
      , hsDeps = [ { cabalFile = "hs/foreign.cabal", objectFile = "hs/Foreign.o" } ]
      , hs2ats = [ { hs = "hs/Foreign.hs", ats = ".atspkg/hs2ats/gen.sats" } ]
      }
    ]
    , ccompiler = "ghc-8.2.2"
    , cflags = ["-package-db", "hs/dist-newstyle/packagedb/ghc-8.2.2/", "-optc-O2", "-optc-flto", "-optc-mtune=native", "hs/Foreign"]
  }