Use hal and custom runtime instead of node.js
What are your thoughts on switching from using a node.js runtime environment to using a custom environment with hal instead?
I didn't know about hal, thanks for sharing! I'll have a look this weekend.
This is very interesting, I didn't know you could provide custom runtimes: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html
I wonder if using hal would buy us anything, since we need the full input request as opposed to just the request body (I'm sure there's a way of accessing that with hal but couldn't find it). Also the wai-lambda code is much shorter so I do wonder if this wouldn't be overkill. Another solution would be for wai-lambda to provide a function similar to pureRuntime that turns the executable into a "runtime". ll play with both solutions and see what the pros and cons are. Do you have any experience using it @purefn ? Anything to report?
I haven't used It in anger yet, I've just played with it a bit. I think the mail benefit would be getting rid of any JS code in favor or pure Haskell. It should result in easier to maintain and understand code and better performance.
I'm not sure what you mean about not having full access to the Lambda request. Any of theWithContext or the readerTRuntime function allow you to read it out of the environment.
You have probably seen this already but you can also use the Haskell AWS Lambda Runtime https://medium.com/the-theam-journey/getting-started-with-the-haskell-aws-lambda-runtime-951b2322c7a3.