Sunday, December 12, 2021

AWS CDK: TypeScript + jsii => JavaScript, Python, C#, Java, Go

AWS CDK is open source tool, written in TypeScript languages.
To support other languages it is using "jsii" library

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework to define cloud infrastructure in code and provision it through AWS CloudFormation.

It offers a high-level object-oriented abstraction to define AWS resources imperatively using the power of modern programming languages. Using the CDK’s library of infrastructure constructs, you can easily encapsulate AWS best practices in your infrastructure definition and share it without worrying about boilerplate logic.

jsii allows code in any language to naturally interact with JavaScript classes. It is the technology that enables the AWS Cloud Development Kit to deliver polyglot libraries from a single codebase!

A class library written in TypeScript can be used in projects authored in TypeScript or Javascript (as usual), but also in PythonJavaC# (and other languages from the .NET family)


How the jsii open source framework meets developers where they are @ AWS blog

Generate Python, Java, and .NET software libraries from a TypeScript source

Translating TypeScript AWS CDK code to other languages

Numba: Python => LLVM

Numba: A High Performance Python Compiler

Numba translates Python functions to optimized machine code at runtime using the industry-standard LLVM compiler library. Numba-compiled numerical algorithms in Python can approach the speeds of C or FORTRAN.

You don't need to replace the Python interpreter, run a separate compilation step, or even have a C/C++ compiler installed. Just apply one of the Numba decorators to your Python function, and Numba does the rest.