GithubHelp home page GithubHelp logo

silky / lambdazonka Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryansroberts/lambdazonka

0.0 1.0 0.0 9 KB

A skeleton project for GHCJS with all the Amazonka libraries ready for AWS Lambda

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%

lambdazonka's Introduction

Lambdazonka

This is a project skeleton to show that all of the Haskell Amazonka AWS API libraries compile with GHCJS and could be deployed to AWS Lambda.

*NOTE: It’s been discovered that Amazonka uses the haskell network library. This library hasn’t been fully shimmed for GHCJS yet. So this whole thing will have to wait for a bit. :(*

Basic Dependencies

  • Node.js Stable 0.10.x - AWS Lambda is currently 0.10.36. Don’t get aggressive with Node.js 4.x and 5.x from Nodesource. It’s not necessary and you might run into trouble.
  • Haskell Stack - Install the latest for your OS and then run stack setup in your $HOME. This will give you a default GHC installation inside the $HOME/.stack directory.
  • Additional Packages - You’ll need some basic developer packages before bootstrapping GHCJS. Here’s an example on Ubuntu/Debian
    apt-get install -y build-essential libtinfo-dev
    stack setup
        

Stack Setup (specific to GHCJS)

In this project directory and with Stack & Node.js in your PATH run the following:

stack setup

This will bootstrap GHCJS into your $HOME/.stack directory.

Building the GHCJS Project

The hsc2hs binary is required to be in your PATH in order to build Amazonka on GHCJS (or any time you need to rebuild Amazonka). I tried using an alias for *hsc2hs-ghcjs*, installed by Stack as part of GHCJS, but it didn’t work. You have a native hsc2hs in your $HOME that was installed in the stack setup step above. This works. Once the dependencies have been built you no longer need the special PATH.

export PATH=$HOME/.stack/programs/x86_64-linux/ghc-7.10.3/bin:$PATH

Now lets build the project (takes a while)

stack build

NOTE: Don’t worry too much about the Stack warnings that are shown about the version of GHCJS-compiled packages that are installed vs the Stackage LTS approved versions. This is a known issue to both Stack & GHCJS folks. Hopefully, as people have time for the effort, GHCJS will be 100% compatible with the Stackage LTS index. In my opinion, people survived for decades before Stackage was available. In my 2 full-time months on GHCJS using Stack, I haven’t seen any bugs that have kept my code from working. Be aware of these warnings though if something fishy comes up.

The “executable” (the js files) will be in your .stack-work directory in the project. The easy way to find them is to run:

find . -type d -name lambdazonka.jsexe

That’s it. The all.js file is self-contained and is all you need with Node.js or for deployment to the cloud. Now you are ready for AWS Lambda experiments!

lambdazonka's People

Contributors

dysinger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.