Creating Internal DSLs in Kotlin

Creating Internal DSLs in Kotlin

Creating Internal DSLs in Kotlin

Transcript

  1. 2.

    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
  2. 4.

    ➢ 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
  3. 5.

    ➢ Computer language specialized to a particular application domain. ➢

    Contrast General Purpose Language ➢ Examples: HTML, R, SQL, VHDL ➢ BQL ---> Booking Query Language ??? Domain Specific Language
  4. 6.

    ➢ 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
  5. 7.

    ➢ 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
  6. 9.

    ➢ 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
  7. 10.