• This repository has been archived on 18/Dec/2018
  • Stars
    star
    320
  • Rank 127,041 (Top 3 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Support for running Rust programs on AWS Lambda

Rust on AWS Lambda

UPDATE 30/11/2018: AWS have released an official runtime for Rust (announcement).

We recommend that you use the official runtime instead. You can still use the events crate, which has moved to LegNeato/aws-lambda-events.


This repository contains multiple crates that make it possible to run programs written in Rust directly as functions in AWS Lambda, while keeping a low footprint with regards to memory consumption, bundle size, and start-up speed.

Build Status

🌏 Website | 🚀 Getting Started

Example

The start function will launch a runtime which will listen for messages from the lambda environment, and call a handler function every time the lambda is invoked. This handler function can be async, as the runtime itself is based on top of futures and tokio.

// [dependencies]
// aws_lambda = { git = "https://github.com/srijs/rust-aws-lambda" }
extern crate aws_lambda as lambda;

fn main() {
    // start the runtime, and return a greeting every time we are invoked
    lambda::start(|()| Ok("Hello ƛ!"))
}

Blogposts

Comparison to other projects

AWS Lambda does not officially support Rust. To enable using Rust with lambda, great projects such as rust-crowbar and serverless-rust were created. They leverage Rust's C interoperability to "embed" Rust code into lambda supported language runtimes (in this case Python and Node.js respectively).

This project forgoes embedding and instead leverages lambda's official Go support. With Go, lambda runs a standard Linux binary containing a server and then sends it gob-encoded messages via rpc. This project reimplements all that machinery in Rust, using rust-gob for gob support and a custom tokio server runtime. Lambda does not care that the Linux binary it runs is written in Rust rather than Go as long as they behave the same.

Due to the no-overhead method of adding Rust support, a project deployed to lambda using this runtime should match (and might possibly exceed) the performance of a similar project written in Go.

More Repositories

1

rusha

High-performance pure-javascript SHA1 implementation suitable for large binary data, reaching up to half the native speed.
JavaScript
274
star
2

rust-crc32fast

Fast, SIMD-accelerated CRC32 (IEEE) checksum computation in Rust
Rust
228
star
3

rust-tokio-retry

Extensible, asynchronous retry behaviours for futures/tokio
Rust
121
star
4

rust-plumbum

Conduit-like data processing library for Rust
Rust
55
star
5

rust-gob

serialization and deserialization for the gob binary format
Rust
28
star
6

rust-copperline

Pure-Rust Command Line Editing Library
Rust
27
star
7

rpdf

Rust
22
star
8

rust-gearhash

Fast, SIMD-accelerated hash function for content-defined chunking
Rust
18
star
9

hwsl2-haskell

Hashing with SL2 for Haskell
Haskell
14
star
10

rust-serde-schema

Rust
12
star
11

muject

10 sloc, ⅛ kb, no-bullshit dependency injection micro-library
JavaScript
12
star
12

rust-futures-backoff

Extensible, asynchronous retry behaviours
Rust
9
star
13

rust-semaphore

Atomic counting semaphore
Rust
7
star
14

rust-cfn

Type-safe representation for AWS CloudFormation templates
Rust
7
star
15

git-build

Build a git repository with a Dockerfile.
Go
6
star
16

clam-js

Control a ClamAV daemon over TCP or Unix Domain Sockets.
JavaScript
6
star
17

hwsl2-scala

Hashing with SL2 for Scala
Scala
6
star
18

hwsl2-core

Hashing with SL2
C
6
star
19

haskell-lambda-term-zipper

Functional Pearl: Environmentally Aware Zippers
Haskell
6
star
20

node-aff

Asynchronous effect system for TypeScript
TypeScript
5
star
21

rust-try-future

Convenient short-hand for returning early from `futures`-based functions
Rust
5
star
22

node-arbitrator

Generative property testing for JavaScript
JavaScript
4
star
23

haskell-ndjson-conduit

Conduit-based parsing and serialization for newline delimited JSON
Haskell
4
star
24

hwsl2-node

Hashing with SL2 for Node.js
C++
4
star
25

haskell-aws-dynamodb-conduit

Conduit-based interface for AWS DynamoDB
Haskell
3
star
26

node-clam-engine

Native bindings for the clamav engine
C++
3
star
27

rustretto

Rust
3
star
28

rust-follow-redirects

Extension for hyper to follow HTTP redirects
Rust
3
star
29

vim-colors-rusty

Rust-inspired color scheme for vim
Vim Script
3
star
30

node-lcg

Seedable and Splittable (LCG) Random Number Generator
TypeScript
3
star
31

rust-coyoneda

Functor composition via the Co-Yoneda Lemma
Rust
3
star
32

haskell-result

Encode success or at least one error
Haskell
2
star
33

node-kung-fu

Functional Standard Library with TypeScript support
TypeScript
2
star
34

rust-simdop

SIMD operations for Rust, with traits and pixiedust
Rust
2
star
35

rust-comonoid

Comonoid trait for Rust.
Rust
2
star
36

statistics-hypergeometric-genvar

Random variate generation for hypergeometric distributions
Haskell
2
star
37

rust-functor

Rust
2
star
38

haskell-free-concurrent

Free monads suitable for concurrent computation
Haskell
2
star
39

udp-stats-redis-adapter

Small performant frontend to redis, receiving minimal statistics data via udp messaging.
C
2
star
40

rust-tagged

PhantomData's partner in crime!
Rust
1
star
41

node-buffer-indexof-fast

Fast .indexOf for the Buffer data type
C++
1
star
42

backtape

A doctape client for the truly paranoid.
JavaScript
1
star
43

haskell-json-togo

Incremental conduit-based parsing of JSON documents.
Haskell
1
star
44

random-hypergeometric

Random variate generation from hypergeometric distributions
Haskell
1
star
45

node-resumable-hash

Serializable and deserializable hashing implementations
C++
1
star
46

rust-operational

Operational Monad for Rust
Rust
1
star
47

talks

1
star
48

rust-ot

Operational Transformations in Rust
Rust
1
star
49

haskell-attoparsec-trans

Interleaved effects for attoparsec parsers
Haskell
1
star
50

haskell-zipkin

Haskell
1
star
51

rijckit

Handwritten, low-level lexer for c-like languages. Still in early development.
C
1
star
52

rust-backtrace-parser

A zero-copy parser for Rust backtraces
Rust
1
star
53

node-redis-function

Run transpiled Javascript functions on the Redis scripting engine.
JavaScript
1
star