Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference to aws-lambda-haskell-runtime? #118

Open
nomeata opened this issue Feb 18, 2023 · 7 comments
Open

Difference to aws-lambda-haskell-runtime? #118

nomeata opened this issue Feb 18, 2023 · 7 comments

Comments

@nomeata
Copy link

nomeata commented Feb 18, 2023

hal was recently highlighted on the Haskell Foundation slack, and got me curious. I am using https://theam.github.io/aws-lambda-haskell-runtime/ / https://github.com/theam/aws-lambda-haskell-runtime for my (few and small) Haskell on Lambda projects, and I wonder how the two related.

Are they comparable? Any benefits one way or the other?

@IamfromSpace
Copy link
Collaborator

It’s a good question! One I’m not totally sure how to answer.

Both libs came out at basically the same time, as there was immediate mutual excitement for provided runtimes enabling Haskell—the other was even published a little sooner. We even had a bit of correspondence about how we might consolidate efforts, but it wasn’t ever quite clear how.

The main goal of this lib was always to enable a bring-your-own-monad approach via Monad Transformers, plus some small adapters that enabled an easier start for when you didn’t want to deal with them. That opened a door for others to build some cool stuff like the Wai adapter.

I hesitate to speak for someone else’s lib, but the main offering and investment I see is ease of use. They’ve got some really great docs setup and some things to help bootstrap.

To me, it seems like they both have their use cases. I think hal may be able to take a user further, but may not be quite as easy for some of the most common cases.

Our goal was just to enable more Haskell, so we’re happy if you use either!

@nomeata
Copy link
Author

nomeata commented Mar 3, 2023

Thanks for the summary! I’ll cross link this to the aws-lambda-haskell-runtime repo. Feel free to close if you like to keep the issue list tidy (or maybe the README should actually have a friendly pointer to the alternative to help new users decide)?

@mbj
Copy link
Contributor

mbj commented Mar 3, 2023

BTW I had a reason to hadn roll my own runtime, mostly as I needed better exception handling control, especially being able to let the runtime crash and NOT re-use a container on an unexpected container.

The undocumented work is here: https://github.com/mbj/mhs/tree/main/lambda-runtime

@IamfromSpace
Copy link
Collaborator

@mbj oh interesting, so the difference is that the client throws an exception that the user may catch, and in doing so, they can report on these errors or even prevent the error from crashing the lambda and then continue using the container?

I’d be curious about the ways you use that. I think in theory it would be a non breaking change to hal, just given how exceptions work, but it does seem like quite a glimpse under the hood.

@mbj
Copy link
Contributor

mbj commented Mar 3, 2023

report on these errors or even prevent the error from crashing the lambda and then continue using the container?

no the default is to kill the container, that was the main motivation.

Users can have specific exceptions they may allow the container to continue, but the default is inversed to crash. Which is much better IMO.

Each time I get an unexpected excpetion I have to assume my environment is infected and I cannot just re-use it silently.

@mbj
Copy link
Contributor

mbj commented Mar 3, 2023

And I needed native xray intgration.

@mbj
Copy link
Contributor

mbj commented Mar 3, 2023

Plus I had a disagreement with hal on timeouts on the HTTP poller, IMO they should not exist at all ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants