Slide 1

Slide 1 text

Kotlin DSL Juan Guillermo Gómez @jggomezt

Slide 2

Slide 2 text

Juan Guillermo Gómez ● Co-Leader y Co-Founder of GDG Cali. ● Founder DevHack. ● Tech Lead Wordbox ● Consultant and advisor on software architecture, cloud computing and software development. ● Experience in several languages and platforms. (C, C#, Java, NodeJS, android, GCP, Firebase). ● Google Developer Expert GCP & Firebase ● BS in System Engineering and a MS in Software Engineering. ● @jggomezt

Slide 3

Slide 3 text

FOUNDATIONS

Slide 4

Slide 4 text

➢ Open-sourced since 2012. ➢ Developed by JetBrains. ➢ Version 1.0 in 2016. ➢ Modern programming language ➢ Object Oriented. ➢ Statically typed. ➢ Less code with fewer bugs. ➢ Lambdas and properties. ➢ Nullable and non-nullable data type. ➢ Remove a lot of boilerplate from code. ➢ Readability. ➢ Functional constructs. ➢ Use Java Libraries. ➢ Immutability. Kotlin

Slide 5

Slide 5 text

➢ Computer language specialized to a particular application domain. ➢ Contrast General Purpose Language ➢ Examples: HTML, R, SQL, VHDL ➢ BQL ---> Booking Query Language ??? Domain Specific Language

Slide 6

Slide 6 text

➢ External DSL vs Internal DSL ➢ Externals are implemented via an independent interpreter or compiler. LaTex ➢ Internals are typically implemented within a host language as a library. Domain Specific Language

Slide 7

Slide 7 text

➢ Context help to remove the noise. ➢ Ability to continue a conversation. ➢ You need fewer words you can be very expressive in a context. ➢ DLS is important to carry the context. ➢ Fluency is easy to read, it doesn’t feel like code. Context and Fluency

Slide 8

Slide 8 text

Kotlin DSL Examples

Slide 9

Slide 9 text

➢ Nature of the language is very fluent. ➢ Optional semicolon. Semicolons break the flow. ➢ Drop () and . using infix notation. ➢ Extensions method. ➢ Lambda -- no () for passing last lambda. ➢ Implicit receivers. Kotlin DSL Capabilities

Slide 10

Slide 10 text

DEMO

Slide 11

Slide 11 text

REFERENCES ❖ https://www.youtube.com/watch?v=JzTeAM8N1-o ❖ https://www.youtube.com/watch?v=Rvx_BfG3NDo&t=516s ❖ https://github.com/fkorotkov/k8s-kotlin-dsl

Slide 12

Slide 12 text

GRACIAS !! @jggomezt