Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[WSO2 Integration Summit New York 2019] Ballerina - Cloud Native Middleware as a Programming Language

38 views

Published on

Ballerina is a programming language designed for network-distributed applications. One of its key objectives is to make providing and consuming services easier by baking concepts such as listeners, services, and endpoints as inherently concurrent first-class language constructs. Another important aspect of the language is the sequence diagram based graphical view which shows the most fundamental aspect of the semantics of a network distributed application. Ballerina language is pragmatic and intended for commercial adoption and provides familiarity for users of Java, C#, and JavaScript. While it looks like Java and other popular languages in some ways, it is very different from those in fundamental ways.

In this deck, Lakmal, discusses and demonstratees how Ballerina simplifies your microservices development. Also, shows you how Ballerina is different, why it's different, and how those differences give Ballerina an unfair advantage when it comes to developing resilient, performant, and secure network services and applications.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

[WSO2 Integration Summit New York 2019] Ballerina - Cloud Native Middleware as a Programming Language

  1. 1. Cloud Native Middleware as a Programming Language September 2019 Lakmal Warusawithana, Senior Director - Developer Relations, WSO2 @lakwarus
  2. 2. (Almost) Every programmer is using and/or creating APIs
  3. 3. Existing languages treat the network as simply I/O Ballerina treats APIs, listeners, endpoints, network types as first class entities
  4. 4. Ballerina is a modern, compiled, type safe, concurrent programming language Open Source implementations, Apache Licensed Open Specification, Creative Commons Licensed
  5. 5. Hello World
  6. 6. Annotations
  7. 7. caller hello POST (name) Hello, name!
  8. 8. caller hello POST (status) response twitter tweet (status) response
  9. 9. ○ Built in taint analysis ○ Built in API Gateway (JWT and OAuth) ○ Research on embedding SPIFFE into the language ○ First-class integration with Istio / Envoy More info here: https://github.com/prabath/ballerina-security
  10. 10. Based on sequence diagrams
  11. 11. ○ A type defined by union of two or more other types float | string v1 = "John"; float | string v2 = 457.68; float | string 0.51 1.01 457.68 -11.0 “John” “name” “” “bal” // The return type of 'post' is a union of 'http:Response' and 'error' http:Response | error response = orderEP -> post("/create", reqPayload)
  12. 12. json is just a union - () | int | float | string | map<json> | json[] // JSON object json payload = { "orderdata": { "id": 1, "name": "XYZ", "price": 2500 } }; //Access object values json orderid = payload.orderdata.id; //JSON arrays json orders = { "orderdata": [ { "id": 1, "name": "XYZ", "price": 2500 }, { "id": 2, "name": "ABC", "price": 3000 } ] };
  13. 13. // Simple XML literal xml x1 = xml`<name>Lakmal Warusawithana</name>`; // XML with namespaces xmlns "http://wso2.com" as ns0; xml x2 = xml `<name id="123" status="married"> <ns0:fname>Lakmal</ns0:fname> <ns0:lname>Warusawithana</ns0:lname> </name>`; // XML literal with interpolation string lastName = "Warusawithana"; xml x3 = xml`<lname>${lastName}</lname>`; // Concat XML values xml x4 = x1 + x2 + x3;
  14. 14. Cloud native
  15. 15. Concurrency
  16. 16. future<int> f = start add( 2,2); if (f.isDone()) { int result = wait f; io:println(result); } else if (f.isCancelled()) { io:println("cancelled"); } else { io:print("cancelling: "); io:println(f.cancel()); }
  17. 17. Batteries included
  18. 18. ○ Test ○ Documentation ○ Swagger tooling ○ gRPC tooling ○ Secret encryption ○ Docker / Kubernetes integration ○ Istio integration
  19. 19. Serverless
  20. 20. Observability
  21. 21. Continuous Integration
  22. 22. gRPC and ProtoBuf
  23. 23. Ballerina syntax Automatically creates this .proto
  24. 24. https://ballerina.io/learn/by-example/
  25. 25. https://github.com/ballerina-platform/ballerina-spec
  26. 26. ○ Come to https://ballerina.io ○ Join the slack channel and/or ballerina-dev mailing list ○ Create a module and upload into Ballerina Central ○ Create issues ○ On the spec or implementation ○ If you have compiler skills, submit PRs on nBallerina or jBallerina
  27. 27. Homepage https://ballerina.io/ Downloads https://ballerina.io/downloads/ Ballerina By Example https://ballerina.io/learn/by-example/ Github https://github.com/ballerina-platform/ballerina-lang

×