[Devember 2022] Open-source typescript serverside lambda/functions

Hello everybody.

A little late to the party, but I’ve been thinking about this for some time. I figure it warrants posting the work I’ve been doing on this for Devember.

Info

Me

I’m Raoul, I’m enthusiastic about typescript, IOT, backend, networking, databases and embedded. I’m a student from the netherlands. You can find me on github.

Project

I’m building a package/framework to build and run lambda/functions-ish applications. Basically, I want to make a small function in typescript, rust, go, c or c++ and run that on demand with custom input arguments.

Start

I’ve started working on this a couple of days ago and tried getting a small prototype to work with WebAssembly modules (WASM). This would create a secure context. But I couldn’t find a way to compile typescript with all the node modules to wasm. This was a major problem, so I switched to using npm pack to make a tgz package. Which is installed on the runner and is imported to run the ‘function’. To run rust, c and c++ I would compile to wasm and use some typescript glue to run it. Dependency management is already included in the npm package, so I don’t have to worry about that.

Current

As of today, I’ve got a working prototype with npm pack and a simple demo runner to test functions.

Road ahead

Things on the roadmap are:

  • Server runner
  • Functions storage
  • Queueing / scheduling
  • Multithreading and/or clustering
2 Likes

Update 1

I’ve been working on building the parts needed for the server. Single runner demo is working and added code to the repo: raouldeheer/ts-functions (github.com)

1 Like

Update 2

I’ve added a temporary database (mongodb). It’s good enough for dev & testing. Added some models, not sure about the functionjob model with the status and logging. Also added a file download function.

Update 3

There haven’t been a lot of update and work on the project because I’ve been remarkably busy in Januari.
Nevertheless, today I’ve got an update.
Added a simple server. Just a simple server with multiple jobs running in parallel. No clustering :frowning:
Still using Mongodb as the database. Seems to be fast enough for now. But I will probably change this in the future.

This is probably the last update on the project. So, in conclusion, I’m happy with the results of the project. Having spent only about 6 hours creating this. A lot of things could still be improved like the database, clustering, etc. But the original project goal has been reached, having a working lamba-/function-ish framework/package that would create and run.
Looking back at the project I realize that building this wasn’t too much work and that this was quite a fun devember project.