awslabs / aws-lambda-cpp

C++ implementation of the AWS Lambda runtime
Apache License 2.0
439 stars 88 forks source link

C99 shim #33

Open major0 opened 5 years ago

major0 commented 5 years ago

You can use C++11 or later. Plain C, C++98 and C++03 can work but require you to write a shim. Will add examples on how to do that if there's enough interest.

Can you give guidance (or an example) of this shim layer for C99?

marcomagdy commented 5 years ago

I'll try to write up something in the next few days.

clumsy commented 5 years ago

Is there somewhere we can read about creating this shim layer now?

PauloMigAlmeida commented 4 years ago

@major0 @clumsy I created a C Runtime for Lambda based on the nice work Marco has done on the cpp-runtime so far. [ Credits are duly given in the readme file 😄]

Still on its early development days but most features work out of the box and even though I mention that any C11 compiler is required in the readme file, I'm almost certain that I don't use anything specific that wouldn't allow you to compile with C99.

https://github.com/PauloMigAlmeida/aws-lambda-c-runtime

Disclaimer: I decided to learn C a few months ago and thought that a Lambda C runtime would be a good pet project for me to start with. Any constructive feedback that can help me improve my C skills is welcome. Hope this pet project of mine helps anyone wanting to run C on lambda 😃

clumsy commented 4 years ago

Great job, @PauloMigAlmeida I did the exact same thing you did, with one difference though - I've made it via a single-header library. But around same time I've discovered Rust runtime for lambda which I think is much more robust, safe and has the same performance. This is the reason I decided not to publish my runtime and suggest you give Rust runtime for lambda a try!

marcomagdy commented 4 years ago

which I think is much more robust

Why do you think so?

clumsy commented 4 years ago

@marcomagdy there are two things I think are important:

marcomagdy commented 4 years ago

I hate to digress this thread further but

a) you’re conflating Rust the programming language with the Lambda runtime.

b) The C++ Lambda runtime is also under awslabs just like the Rust runtime.

I was curious if you had more concrete points on why you think the Rust runtime is more robust than the C++ runtime.

clumsy commented 4 years ago

@marcomagdy I'm sorry if I was not clear enough. I was comparing my custom C99 non-awslabs lambda runtime with the Rust lambda runtime. My point was about Rust runtime benefiting from the safety features of the language (again, when comparing to my custom C99 non-awslabs runtime). I was never planing on using C++ lambda runtime, let alone comparing it to the Rust lambda runtime (was only here for the C99 shim).

marcomagdy commented 4 years ago

bah! my bad. I misunderstood.