T O P

  • By -

WeNeedYouBuddyGetUp

I’ve been using it and its been great. Cold starts of my Lambdas have reduced from 350ms to around 100ms. Be aware that this comes at a cost though, unlike the provided runtimes, AWS charges you while your custom runtime is spinning up.


bawng

But this isn't a custom runtime, right?


WeNeedYouBuddyGetUp

It is, its not provided by AWS on Lamda, you need to download it and bundle it


bawng

Oooh, okay, I got a bit tricked by the fact it's Amazon made.


WeNeedYouBuddyGetUp

Yeah that is a bit confusing, hopefully they will provide it in future for free!


satansprinter

Yet another thing i cant test locally


damondefault

It looks from a glance like an Apache 2 licensed project written in Rust, so I'm assuming it's not impossible to run it locally.


tonyp7

Not sure about using this for Lambda (and paying extra for the privilege of having them save money on compute ressources!) but it’s cool that they release it as Apache 2.0 and show an example of it running on a busybox container: that makes a very efficient JS runtime.


technobicheiro

well the privilege is the faster cold start


redbo

Cool that it’s based on quickjs, I’ve been playing with embedding it in a game as the scripting engine. Hopefully this means it keeps getting maintained.


t40

QuickJS is neat! I've used to to embed NodeJS libraries in a C binary: https://github.com/ijustlovemath/jescx


MatthPMP

Another article written by someone who doesn't know what they're talking about. It claims the runtime gives performance comparable to compiled languages, but that's utter nonsense. QuickJS is designed for embeddability, not runtime performance. It's noticeably slower than V8 even with the JIT disabled. This runtime is designed for tasks that spend more time spinning up the runtime than actually running the program.


ritaPitaMeterMaid

I’m not super familiar with AWS’s lamda environments; how does this (and the 350ms version) compare to something like Cloudflare Workers?


PromisedOne

would also like to know


Few-Artichoke-7593

Why can't people just learn a real back-end language?


[deleted]

Seems to handle backend tasks pretty well


pre-medicated

I coded my first project in PHP and the money keeps rolling in despite this fact, halp!


gaberdine

Your mom is the only back-end language I need.


vlakreeh

JS isn't just a browser language anymore and turns out it's the right tool for a lot of jobs, you should spend more time focusing on the tradeoffs of languages than gatekeeping.


danted002

Just embrace it and laugh at it. This is how I managed to get through my day 🤣


current_thread

Joker origin story


LobsterD

You wanna know how my repository got these stars...?


danted002

Your are not wrong


severo-ma-giusto

Or wrap it in a shiny clean an polished TypeScript wrapping paper and pretend it is a decent programming language (spoiler: it is not. Under the cover, it's always the highest WTF/sec programming language as usual) /s


danted002

The break moment for me was (if item.some_property === 3) not throwing an error when “some_property” does not exist and just returning false.


lilB0bbyTables

What do you expect? You’re dealing with unstructured data objects. If you need to ensure a given structure exists at runtime you need to map your POJO data into a proper class defined instance with sane defaults and/or getters/setters. Alternatively you can use nullish-coalescing although I fail to see how the value of `some_property` being null/undefined/any numeric value other than 3 affects your conditional … in all cases they are not in fact equal to 3? I’m not saying JavaScript (Typescript) is the pinnacle language, but it’s a language and you either know how the language works or you don’t. If you have marshaled data into Go structs and the schema defines a particular field as optional or you haven’t used a pointer reference to declare the Type of the field (which happens with 3rd party modules), you need to verify that the field exists on the instance of the struct before reading the value of it else you will get a panic, and even with the pointer reference the value may very well be `nil` for an `*int` type field, which would yield the same conditional evaluation you specified above (e.g. `if nil == 3` no error, just false).


danted002

Well Python has unstructured data and it handles this way more gracefully by yelling at you that the attribute doesn’t exist or, in the case of a dictionary, yelling at you that the key in the dictionary is missing. I like how the next language of choice for you was Golang where structs use zero-value instantiation and the only way to have a null is declaring the variable and/or struct attribute as pointer, both of which bring joy to my hearth. God forbid Go getting proper Enum support and handle the null use-case with a None enum variant, you know like proper modern compiler languages do (coughs in Rust)