You are browsing as a guest. Sign up (or log in) to start making projects!

Serverless-Function-Runner

  • 6 Devlogs
  • 19 Total hours

tried to build a serverless function runner with go (first learning this language) And adapt js by quickjs, python by starlark (Python-like)

Open comments for this post

6h 40m 8s logged

  1. Write a simple router using the built-in net/http.
  2. Design a basic database schema to store binaries and function information.
  3. Create a database wrapper. (which use Transaction as main exec method)
  4. Support two languages that can compile and execute from binaries.
  5. Ensure both languages can generate responses (JavaScript returns an object, Starlark returns a dict).
  6. Build a simple HTTP server to test functions (compile / execute / save to DB).

TODO:

  1. Add support for Starlark.
  2. Implement authentication.
  3. Create a frontend / admin panel.

It might take some time to work on next step.
Not only because it have lots things to do, also due to I am trying to create something by 3D Printing.
Spending too much time on it…
If I can share those model. It will be nice.

0
0
4
Open comments for this post

2h 12m 27s logged

Just add more function to fetch and response.
and force js function return obj as response source.

and maybe I will give up on settimeout (though I didn’t try.) maybe after finish main function.
also I will make js function first.
still didn’t know how to let starlark have async ability.
Seems like js code didn’t work properly…
fix it nextday!

0
0
3
Open comments for this post

2h 54m 4s logged

  1. change quickjs lib from modernc.org/quickjs to github.com/fastschema/qjs for better control
  2. add async sleep and simple fetch function for js (work as builtin function)
  3. add a simple http related file to do any http related things

Next might be add fetch in starlark
and try to make it have async
and maybe make a settimeout?
also needed to extend fetch function (currently only have basic function)

0
0
1
Open comments for this post

3h 26m 2s logged

  1. Complete sandbox Exec(both js and starlark)
    (currently scan dir and execut file inside)

  2. Implement sleep and print / console.log
    (warp as fmt.Printf)


Plan to add http server and request related thing later

0
0
1

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…