Release of jsii 1.90, C#, Go, Java and Python code generator from TypeScript

Amazon has published the jsii 1.90 compiler, which is a modification of the TypeScript compiler that allows you to extract API information from compiled modules and generate a universal representation of this API for accessing JavaScript classes from applications in various programming languages. The project code is written in TypeScript and distributed under the Apache 2.0 license.

Jsii makes it possible to create class libraries in TypeScript that can be used in projects in C#, Go, Java and Python by translating into native modules for these languages ​​that provide the same API. Tooling is used in the AWS Cloud Development Kit to provide libraries for different programming languages, built from a single code base. The new version implements caching of the list of classes for each assembly and documents the ability to make properties optional.

Example of source code in TypeScript: export class Greeter { public greet(name: string) { return `Hello, ${name}!`; } } View compiled in C# var greeter = new Greeter(); greeter.Greet("World"); // => Hello, World! View compiled in Go greeter := NewGreeter() greeter.Greet("World") // => Hello, World! View compiled in Java final Greeter greeter = new Greeter(); greeter.greet("World"); // => Hello, World! View compiled in JavaScript const greeter = new Greeter(); greeter.greet("World"); // => Hello, World! View compiled in Python greeter = Greeter() greeter.greet("World") # => Hello, World!

Source: opennet.ru

Add a comment