News for hackers. Stuff that matters.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by Tehnix on Thursday November 29, 2018 @12:58PM (#18562188)
I'm personally very hyped for using Haskell natively on Lambda! In the keynote he mentions the partner sponsored runtimes, and actually said "Scala and Haskell, you'll just have to bring your own!" (as in, community effort).
Re:New for AWS Lambda: Use Any Programming Language and Shar... by rmason on Thursday November 29, 2018 @03:36PM (#18563730)
May be the only one(?) on here who is hyped for using CFML natively on Lambda. Now thanks to the work of a member of our community we have a proof of concept in Fuseless http://www.fuseless.org as well as the open source CFML http://www.lucee.org folks hinting at a Lambda project. Only six months ago people told me it was never going to happen but I now see that changing.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by munns on Thursday November 29, 2018 @02:06PM (#18562883)
Yes! We are definitely looking forward to championing awesome projects to build languages for the Runtime API. Take a look at the Rust and C++ examples as they show you a bit of how it all works. (Chris from AWS Serverless team)
Re:New for AWS Lambda: Use Any Programming Language and Shar... by 0db532a0 on Thursday November 29, 2018 @04:31PM (#18564224)
There has never been anything stopping you from running binaries compiled from any language (including Haskell) on Lambdas. They run Linux after all. See serverless-haskell (link at bottom) for defining serverless Haskell functions.

serverless-haskell also takes care of packaging shared objects depended upon alongside the binary. You will have to package any binary dependencies of your Haskell code yourself.

The way it works is by generating a Node script which invokes the compiled binary with the payload as an environment variable, although this is encapsulated by an interface which you implement in the Haskell code.

One thing to make sure is that your libraries and Haskell code are compiled on a system compatible with the Lambda execution environment. Documentation going further into ELF compatibility is available, but I can’t remember where. I remember using stack to have my Haskell code compile on an Ubuntu docker image which was compatible.

https://github.com/seek-oss/serverless-haskell

Re:New for AWS Lambda: Use Any Programming Language and Shar... by pwm on Thursday November 29, 2018 @02:54PM (#18563349)
Same here, Haskell in Lambda is where we want to be.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by hood_syntax on Thursday November 29, 2018 @02:48PM (#18563304)
This would be a real game changer for me, from an internal marketing perspective and for personal use.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by Tehnix on Thursday November 29, 2018 @03:19PM (#18563570)
Internal marketing for me as well! Will help persuade my colleagues to give Haskell a try.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by bob_roboto on Thursday November 29, 2018 @02:33PM (#18563167)
Scala works just fine in the java runtime for us
Re:New for AWS Lambda: Use Any Programming Language and Shar... by Tehnix on Thursday November 29, 2018 @03:18PM (#18563562)
I haven’t personally played with scala yet, but do you need to add any additional runtime components for it to work? Or perhaps scalaz? Or is it just making a .jar and you are good to go? :)
Re:New for AWS Lambda: Use Any Programming Language and Shar... by telechus on Thursday November 29, 2018 @03:31PM (#18563685)
I've simply used sbt assembly to create a far jar. It includes all of the needed dependencies.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by RhodesianHunter on Thursday November 29, 2018 @10:28PM (#18566396)
Ditto Kotlin.
Re:New for AWS Lambda: Use Any Programming Language and Shar... by samstave on Thursday November 29, 2018 @04:39PM (#18564301)
For the uninitiated, can you please provide some example use cases where you would use Lambda for Haskell for great good?
Re:New for AWS Lambda: Use Any Programming Language and Shar... by Tehnix on Thursday November 29, 2018 @05:29PM (#18564744)
Honestly, for everything we are currently running on Lambda. At the moment we are using the Node.js runtime with Typescript.

We use both Lambda for data processing on incoming IoT events, and also for API interactions with our user, along with services to send mails and SMS, etc.

---

I would just want to use the robustness and correctness that I'm able to ensure with Haskell, compare to TypeScript, and especially bundling quirks with Webpack and NPM.

An example of an easy thing to let through is missing an _await_ on a call (might be for logging or something else), which means it'll go out-of-band, and can then easily not be run during the execution, if you have disabled waiting for the event loop to be done (which is necessary in many cases for global setup optimizations).

The call might then finish when the lambda function is thawed, but it might also never run, because the function gets collected.

Now, admittedly, this is not a big issue in any way, but it's the death by a thousand papercuts that I'd like to avoid.

Re:New for AWS Lambda: Use Any Programming Language and Shar... by freedomben on Thursday November 29, 2018 @06:45PM (#18565290)
Haskell (and many functional languages) excel at tasks where data is being transformed and/or can be modeled that way. Most of our lambda functions do exactly that.