[λ] thegeez blog index

Web app on AWS Lambda with Janet

28 Oct 2021

Janet is a small functional and imperative programming language. The language has some similarities to Clojure with its Lispy syntax, its data notation, and with its proper REPL for dynamic developing within a running system. Janet also compiles its runtime and VM to C and can therefore run almost anywhere.

All of Janet's features make it a good candidate to make AWS Lambda serverless functions with. This is because Janet programs start up and compile quickly, certainly when compared to a combination of Clojure and native-image compilation. Postings is a simple forum web app on AWS Lambda behind an API Gateway and using DynamoDB as the database.

Postings web app at https://iakerss4c6.execute-api.eu-central-1.amazonaws.com, source at https://github.com/thegeez/janet-postings

Differences between Janet & Clojure

Janet and Clojure look alike and share many concepts and programming approaches. This is usefull to get started quickly, but can also trip you up when things that look the same in both languages behave slightly different. Here are some of the things I ran into:

The source for the Posting app is here: https://github.com/thegeez/janet-postings