SlideShare a Scribd company logo
1 of 6
Download to read offline
with Logcat
Sanaebadi97
Gradle Kotlin DSL
Tutorial
What is Kotlin DSL ?
If you’ve ever used SQL before or Groovy
with Gradle, it means that you’ve used a
DSL language before. DSL stands for
Domain Specific Language, which is a type
of programming language that cares mainly
about the readability by enforcing the use of
declarative code with minimal boilerplate
(declare to use) instead of imperative code
(explaining how to solve a problem) but as a
drawback, it can be used only inside a
specific context or domain.
Kotlin is already proven to be a very powerful and safe production-ready programming
language especially. As a GPL (General Purpose Language) Kotlin has some great features
that enable writing very clean code with minimal syntax, things like Lambdas with receivers
that can be used outside of method parentheses and infix function notation. These features
permit to write DSL-like code with minimal effort.
Jetbrains’ Anko library brought the power of Kotlin DSL to clean verbose Android API
especially XML layouts.
Being built on top of the core language makes Kotlin DSL considered as an Internal DSL
which means that it does not have a syntax on its own, rather being a library that offers DSL
readability by exploiting the mother GPL language features, in this case, Kotlin.
Gradle Kotlin DSL Primer
Promises made by Kotlin DSL :
● A statically typed and a type-safe DSL (inherited from Kotlin)
● An enhanced IDE editing experience (inherited from Kotlin)
● Interoperability with existing scripts (as a JVM language)
● Maximum readability (as any DSL)
● Consistency and superpower (by using the same language across the project — source
code and configuration 100% Kotlin)
Why should I even care?
Shortly, because Groovy is a dynamically typed language, and because it’s very likely that
you have come across one of these problems when dealing with build script files for Android
:
● Very poor IDE assistant when writing a Groovy DSL script
● Performance issues*
● Errors at build runtime instead of compile-time
● Painful build script debugging experience
● Refactoring is a pain in
Reference : Medium
Read more :
Medium
Github
AndroidRiver
Thank You

More Related Content

What's hot

Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)lennartkats
 
Golang, Future of Programming Language.
Golang, Future of Programming Language.Golang, Future of Programming Language.
Golang, Future of Programming Language.Sunil Yadav
 
蔡学镛 Rebol漫谈
蔡学镛   Rebol漫谈蔡学镛   Rebol漫谈
蔡学镛 Rebol漫谈d0nn9n
 
Test-driven language development
Test-driven language developmentTest-driven language development
Test-driven language developmentlennartkats
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)lennartkats
 
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...lennartkats
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Ganesh Samarthyam
 
Coldfusion
ColdfusionColdfusion
ColdfusionRam
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Objective-C with respect to C# and Java
Objective-C with respect to C# and JavaObjective-C with respect to C# and Java
Objective-C with respect to C# and JavaBabul Mirdha
 
EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...
EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...
EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...Mickael Istria
 
[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic Editor[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic EditorMickael Istria
 
Kotlin & Arrow the functional way
Kotlin & Arrow the functional wayKotlin & Arrow the functional way
Kotlin & Arrow the functional wayThoughtworks
 

What's hot (18)

Introduction to Go-Lang
Introduction to Go-LangIntroduction to Go-Lang
Introduction to Go-Lang
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)
 
Golang, Future of Programming Language.
Golang, Future of Programming Language.Golang, Future of Programming Language.
Golang, Future of Programming Language.
 
DSLs: what, why, how
DSLs: what, why, howDSLs: what, why, how
DSLs: what, why, how
 
蔡学镛 Rebol漫谈
蔡学镛   Rebol漫谈蔡学镛   Rebol漫谈
蔡学镛 Rebol漫谈
 
Java vs kotlin
Java vs kotlin Java vs kotlin
Java vs kotlin
 
Test-driven language development
Test-driven language developmentTest-driven language development
Test-driven language development
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
 
Managed Code .NET
Managed Code .NETManaged Code .NET
Managed Code .NET
 
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Golang introduction
Golang introductionGolang introduction
Golang introduction
 
Coldfusion
ColdfusionColdfusion
Coldfusion
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Objective-C with respect to C# and Java
Objective-C with respect to C# and JavaObjective-C with respect to C# and Java
Objective-C with respect to C# and Java
 
EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...
EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...
EclipseCon Europe 2016, S. Cela, M.Istria: Eclipse Generic and Extensible Edi...
 
[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic Editor[EclipseCon France 2017] Eclipse Platform Generic Editor
[EclipseCon France 2017] Eclipse Platform Generic Editor
 
Kotlin & Arrow the functional way
Kotlin & Arrow the functional wayKotlin & Arrow the functional way
Kotlin & Arrow the functional way
 

Similar to Log cat kotlindsl

Android with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdfAndroid with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdfSkilliQCourse
 
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?9 series
 
Introduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptxIntroduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptxHARSHITJAIN068
 
What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? Shady Selim
 
Kotlin - A Beginner’s Guide__________________
Kotlin - A Beginner’s Guide__________________Kotlin - A Beginner’s Guide__________________
Kotlin - A Beginner’s Guide__________________Mars Devs
 
Kotlin native for iOS and Android
Kotlin native for iOS and AndroidKotlin native for iOS and Android
Kotlin native for iOS and AndroidShady Selim
 
Android Development with Kotlin course
Android Development  with Kotlin courseAndroid Development  with Kotlin course
Android Development with Kotlin courseGoogleDevelopersLeba
 
Kotlin vs-java-which-will-succeed-android-development-in-coming-times
Kotlin vs-java-which-will-succeed-android-development-in-coming-timesKotlin vs-java-which-will-succeed-android-development-in-coming-times
Kotlin vs-java-which-will-succeed-android-development-in-coming-timesParamInfo
 
Kotlin vs Java-A Comparison for Application Development Projects.pdf
Kotlin vs Java-A Comparison for Application Development Projects.pdfKotlin vs Java-A Comparison for Application Development Projects.pdf
Kotlin vs Java-A Comparison for Application Development Projects.pdfTechugo
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?Mindfire LLC
 
Kotlin App Development Tips.pdf
Kotlin App Development Tips.pdfKotlin App Development Tips.pdf
Kotlin App Development Tips.pdfMarie Weaver
 
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdfLearn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdfBcoder Dev
 

Similar to Log cat kotlindsl (20)

Android with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdfAndroid with Kotlin Course - SkillIQ.pdf
Android with Kotlin Course - SkillIQ.pdf
 
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
Why to Choose Kotlin in 2023 to Build Mobile Apps Faster?
 
Groovy DSL
Groovy DSLGroovy DSL
Groovy DSL
 
Introduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptxIntroduction_to_Kotlin.pptx
Introduction_to_Kotlin.pptx
 
What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How? What is Kotlin Multiplaform? Why & How?
What is Kotlin Multiplaform? Why & How?
 
Kotlin - A Beginner’s Guide__________________
Kotlin - A Beginner’s Guide__________________Kotlin - A Beginner’s Guide__________________
Kotlin - A Beginner’s Guide__________________
 
Kotlin tlv
Kotlin tlvKotlin tlv
Kotlin tlv
 
Kotlin
KotlinKotlin
Kotlin
 
Kotlin native for iOS and Android
Kotlin native for iOS and AndroidKotlin native for iOS and Android
Kotlin native for iOS and Android
 
Android Development with Kotlin course
Android Development  with Kotlin courseAndroid Development  with Kotlin course
Android Development with Kotlin course
 
Android with kotlin course
Android with kotlin courseAndroid with kotlin course
Android with kotlin course
 
CC Presentation.pptx
CC Presentation.pptxCC Presentation.pptx
CC Presentation.pptx
 
Kotlin vs-java-which-will-succeed-android-development-in-coming-times
Kotlin vs-java-which-will-succeed-android-development-in-coming-timesKotlin vs-java-which-will-succeed-android-development-in-coming-times
Kotlin vs-java-which-will-succeed-android-development-in-coming-times
 
Kotlin
KotlinKotlin
Kotlin
 
Kotlin vs Java-A Comparison for Application Development Projects.pdf
Kotlin vs Java-A Comparison for Application Development Projects.pdfKotlin vs Java-A Comparison for Application Development Projects.pdf
Kotlin vs Java-A Comparison for Application Development Projects.pdf
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
 
What's DSL and what isn't
What's DSL and what isn'tWhat's DSL and what isn't
What's DSL and what isn't
 
Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
 
Kotlin App Development Tips.pdf
Kotlin App Development Tips.pdfKotlin App Development Tips.pdf
Kotlin App Development Tips.pdf
 
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdfLearn Kotlin and Build Robust Android Apps with Bcoder.pdf
Learn Kotlin and Build Robust Android Apps with Bcoder.pdf
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Log cat kotlindsl

  • 2. What is Kotlin DSL ? If you’ve ever used SQL before or Groovy with Gradle, it means that you’ve used a DSL language before. DSL stands for Domain Specific Language, which is a type of programming language that cares mainly about the readability by enforcing the use of declarative code with minimal boilerplate (declare to use) instead of imperative code (explaining how to solve a problem) but as a drawback, it can be used only inside a specific context or domain.
  • 3. Kotlin is already proven to be a very powerful and safe production-ready programming language especially. As a GPL (General Purpose Language) Kotlin has some great features that enable writing very clean code with minimal syntax, things like Lambdas with receivers that can be used outside of method parentheses and infix function notation. These features permit to write DSL-like code with minimal effort. Jetbrains’ Anko library brought the power of Kotlin DSL to clean verbose Android API especially XML layouts. Being built on top of the core language makes Kotlin DSL considered as an Internal DSL which means that it does not have a syntax on its own, rather being a library that offers DSL readability by exploiting the mother GPL language features, in this case, Kotlin. Gradle Kotlin DSL Primer
  • 4. Promises made by Kotlin DSL : ● A statically typed and a type-safe DSL (inherited from Kotlin) ● An enhanced IDE editing experience (inherited from Kotlin) ● Interoperability with existing scripts (as a JVM language) ● Maximum readability (as any DSL) ● Consistency and superpower (by using the same language across the project — source code and configuration 100% Kotlin)
  • 5. Why should I even care? Shortly, because Groovy is a dynamically typed language, and because it’s very likely that you have come across one of these problems when dealing with build script files for Android : ● Very poor IDE assistant when writing a Groovy DSL script ● Performance issues* ● Errors at build runtime instead of compile-time ● Painful build script debugging experience ● Refactoring is a pain in Reference : Medium