Milan Todorović

Create DSL (Domain Specific Language) on top of Swift

Did you know you can build your own programming language inside Swift? Learn how to create powerful DSLs for any domain using features like Result Builders.

Create DSL (Domain Specific Language) on top of Swift
#1about 2 minutes

Defining a Domain Specific Language (DSL)

A Domain Specific Language is a high-level programming language optimized to solve problems within a specific business domain.

#2about 2 minutes

Classifying internal vs external DSLs

DSLs can be classified as external (built from scratch with a new compiler) or internal (built on top of a host language like Swift).

#3about 3 minutes

Common examples and best practices for DSLs

Effective DSLs often use English-like syntax for clarity, with common examples including HTML, CSS, SQL, and various markup languages.

#4about 4 minutes

Analyzing SwiftUI as a powerful DSL in Swift

SwiftUI serves as a prime example of a DSL built on Swift, using structures for nouns and modifier methods for verbs to describe user interfaces declaratively.

#5about 4 minutes

Key Swift syntax features for building DSLs

Swift enables powerful DSL creation through key features like result builders, trailing closures, property wrappers, and modifier-style methods.

#6about 7 minutes

Live coding a simple drawing DSL in Xcode

This live coding session demonstrates how to build a simple drawing DSL from scratch using a result builder, protocols, and structures for custom commands.

#7about 4 minutes

Applying DSLs and leveraging the host environment

A DSL allows you to focus on the problem domain while leveraging the host environment's features like version control, debugging, and UI tools.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
BB
Benedikt Bischof
How we Build The Software of Tomorrow
Welcome to this issue of the WeAreDevelopers Live Talk series. This article recaps an interesting talk by Thomas Dohmke who introduced us to the future of AI – coding.This is how Thomas describes himself:I am the CEO of GitHub and drive the company’s...
How we Build The Software of Tomorrow

From learning to earning

Jobs that call for the skills explored in this talk.

Scala developer

Scala developer

DHL
Utrecht, Netherlands

Remote
5-6K
GIT
Azure
Scrum
+6