SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
A live-coding
introduction to Mill
Guillaume Galy
Software engineer at Fabernovel
guilgaly@gmail.com
@guilgaly
https://github.com/guilgaly
_____________________________________
/ A live-coding introduction to Mill: 
| finally a build tool we can all |
 understand! /
-------------------------------------
 ^__^
 (oo)_______
(__) )/
||----w |
|| ||
Agenda
❖ What’s Mill?
❖ Hint: a build tool for Scala and Java, created by Li Haoyi
❖ Demo
❖ From zero, to publishing to Maven Central!
2
What’s wrong with SBT
❖ No, not the weird syntax…
❖ That’s fixable (and already improved a lot)
❖ The 4D grid of settings (key, task-scope, configuration and project-scope)
❖ Multi-layered, mutable, execution model
❖ Hard to understand and debug
❖ Hard to navigate in an IDE
❖ No caching by default
❖ Done on an ad-hoc basis for some tasks
3
The basic ideas for Mill
❖ The build graph: a directed acyclic graph

compile package

Sources ------> Bytecode ------> Release Jars
❖ That’s basically a purely functional program?

val sources = ...

val bytecode = compile(sources)

val releaseJars = package(bytecode)
❖ But also needed: caching and a way to query the build graph
❖ In Mill, provided by Tasks defined with the T macro

val sources = T.sources{ ... }

val bytecode = T{ compile(sources()) }

val releaseJars = T{ package(bytecode()) }
4
A couple more niceties
❖ Modularity and scoping use standard Scala language features
❖ Build modules are just objects, etc.
❖ Tasks outputs are cached and queryable as JSON
❖ Nice for integration with external tools!
❖ Each task gets a dedicated folder to write files to if needed
❖ Then return a hash (for cache invalidation) + file path (for the next task to read only)
❖ Bonus point: the mill command has relatively little fixed overhead
5
Live demo
❖ Multi-module build (library + app)
❖ Scala versions cross-compilation
❖ Scala JS/JVM cross-compilation
❖ Publishing the library


https://github.com/guilgaly/mill-demo-scalaio2019
_______________________________
/ Let's write a cowsay 
| implementation in Scala, with |
 Mill as our build tool. /
-------------------------------


__
/ 
| |
@ @
| |
|| |/
|| ||
|_/|
___/
6
Resources
❖ Mill:

http://www.lihaoyi.com/mill/

https://github.com/lihaoyi/mill
❖ Mill design choices:

http://www.lihaoyi.com/post/SowhatswrongwithSBT.html

http://www.lihaoyi.com/post/BuildToolsasPureFunctionalPrograms.html

http://www.lihaoyi.com/post/MillBetterScalaBuilds.html
❖ Gitter channel (ask questions about Mill there):

https://gitter.im/lihaoyi/mill
7
Resources
❖ Build pipelines with Mill:

http://www.lihaoyi.com/post/HowtocreateBuildPipelinesinScala.html
❖ IntelliJ IDEA Scala blog, mentioning work on native Mill support:

https://blog.jetbrains.com/scala/2019/08/08/integrating-developer-experiences-the-
build-server-protocol-in-the-intellij-scala-plugin/
❖ Cowsay in Scala (inspiration for today’s example):

https://github.com/guilgaly/cowsay4s

https://github.com/guilgaly/cowsay-online
8
Thank you for your attention!

Weitere ähnliche Inhalte

Was ist angesagt?

Scala can do this, too
Scala can do this, tooScala can do this, too
Scala can do this, tooHairy Fotr
 
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with PulumiInfrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with Pulumiinovex GmbH
 
Rebranding an ios application
Rebranding an ios applicationRebranding an ios application
Rebranding an ios applicationCocoaHeads France
 
Auto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust LibrariesAuto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust LibrariesSteven McCown
 
iOS App Development with F# and Xamarin
iOS App Development with F# and XamariniOS App Development with F# and Xamarin
iOS App Development with F# and XamarinRachel Reese
 
IL2CPP: Debugging and Profiling
IL2CPP: Debugging and ProfilingIL2CPP: Debugging and Profiling
IL2CPP: Debugging and Profilingjoncham
 
Pharo, Spec and GTK
Pharo, Spec and GTKPharo, Spec and GTK
Pharo, Spec and GTKESUG
 
Infrastructure as "Code" with Pulumi
Infrastructure as "Code" with PulumiInfrastructure as "Code" with Pulumi
Infrastructure as "Code" with PulumiVenura Athukorala
 
What is (not) Pharo 8?
What is (not) Pharo 8?What is (not) Pharo 8?
What is (not) Pharo 8?FAST
 
Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.Yurii Bychenok
 
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx USEclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx USmelbats
 
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetFrom Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetPôle Systematic Paris-Region
 
Esri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJSFestUA
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCLMin-Yih Hsu
 
Docker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKERDocker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKERZWEIDENKER GmbH
 
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflowSheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflowPaul Richards
 

Was ist angesagt? (20)

Scala can do this, too
Scala can do this, tooScala can do this, too
Scala can do this, too
 
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with PulumiInfrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
 
Rebranding an ios application
Rebranding an ios applicationRebranding an ios application
Rebranding an ios application
 
Auto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust LibrariesAuto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust Libraries
 
iOS App Development with F# and Xamarin
iOS App Development with F# and XamariniOS App Development with F# and Xamarin
iOS App Development with F# and Xamarin
 
IL2CPP: Debugging and Profiling
IL2CPP: Debugging and ProfilingIL2CPP: Debugging and Profiling
IL2CPP: Debugging and Profiling
 
Pharo, Spec and GTK
Pharo, Spec and GTKPharo, Spec and GTK
Pharo, Spec and GTK
 
Infrastructure as "Code" with Pulumi
Infrastructure as "Code" with PulumiInfrastructure as "Code" with Pulumi
Infrastructure as "Code" with Pulumi
 
What is (not) Pharo 8?
What is (not) Pharo 8?What is (not) Pharo 8?
What is (not) Pharo 8?
 
Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.
 
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx USEclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
Eclipse Democamp Nantes 2017 - Back to the Future: EclipseConverge & Devoxx US
 
Roslyn: el futuro de C#
Roslyn: el futuro de C#Roslyn: el futuro de C#
Roslyn: el futuro de C#
 
Pollyfills in JavaScript
Pollyfills in JavaScriptPollyfills in JavaScript
Pollyfills in JavaScript
 
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François SaussetFrom Python to smartphones: neural nets @ Saint-Gobain, François Sausset
From Python to smartphones: neural nets @ Saint-Gobain, François Sausset
 
Esri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa Python for Everyone
Esri South Africa Python for Everyone
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCL
 
Docker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKERDocker and Pharo @ZWEIDENKER
Docker and Pharo @ZWEIDENKER
 
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflowSheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
 
Autolab Workshop
Autolab WorkshopAutolab Workshop
Autolab Workshop
 

Ähnlich wie Live coding intro to Mill: Build Scala projects easily

Ansible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps MatchAnsible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps MatchJeff Geerling
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projectsMpho Mphego
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with serverEugene Yokota
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Eugene Yokota
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryAndy Piper
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)jaxLondonConference
 
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plansOpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plansMichael Vorburger
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumNgoc Dao
 
Build your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resourcesBuild your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resourcesMartin Czygan
 
Introduction to stack's docker integration (1)
Introduction to stack's docker integration (1)Introduction to stack's docker integration (1)
Introduction to stack's docker integration (1)悠滋 山本
 
How to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id esHow to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id esAurélien Pupier
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud FoundryAndy Piper
 
Cross Platform Objective C Development Using Gn Ustep
Cross Platform Objective C Development Using Gn UstepCross Platform Objective C Development Using Gn Ustep
Cross Platform Objective C Development Using Gn Ustepwangii
 
What's new in Scala and the Scala IDE for Eclipse for 2.8.0
What's new in Scala and the Scala IDE for Eclipse for 2.8.0What's new in Scala and the Scala IDE for Eclipse for 2.8.0
What's new in Scala and the Scala IDE for Eclipse for 2.8.0Miles Sabin
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James NelsonGWTcon
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - MindbowserMindbowser Inc
 
Scalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex GryzlovScalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex GryzlovVasil Remeniuk
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.brandongulla
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?Charlie Gracie
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?Charlie Gracie
 

Ähnlich wie Live coding intro to Mill: Build Scala projects easily (20)

Ansible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps MatchAnsible + Drupal: A Fortuitous DevOps Match
Ansible + Drupal: A Fortuitous DevOps Match
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projects
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud Foundry
 
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
Run Your Java Code on Cloud Foundry - Andy Piper (Pivotal)
 
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plansOpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
OpenDaylight Developers Experience 1.5: Eclipse Setup, HOT reload, future plans
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Build your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resourcesBuild your own discovery index of scholary e-resources
Build your own discovery index of scholary e-resources
 
Introduction to stack's docker integration (1)
Introduction to stack's docker integration (1)Introduction to stack's docker integration (1)
Introduction to stack's docker integration (1)
 
How to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id esHow to contribute textual tooling for apache camel in several id es
How to contribute textual tooling for apache camel in several id es
 
Run your Java code on Cloud Foundry
Run your Java code on Cloud FoundryRun your Java code on Cloud Foundry
Run your Java code on Cloud Foundry
 
Cross Platform Objective C Development Using Gn Ustep
Cross Platform Objective C Development Using Gn UstepCross Platform Objective C Development Using Gn Ustep
Cross Platform Objective C Development Using Gn Ustep
 
What's new in Scala and the Scala IDE for Eclipse for 2.8.0
What's new in Scala and the Scala IDE for Eclipse for 2.8.0What's new in Scala and the Scala IDE for Eclipse for 2.8.0
What's new in Scala and the Scala IDE for Eclipse for 2.8.0
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - Mindbowser
 
Scalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex GryzlovScalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex Gryzlov
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?
 

Kürzlich hochgeladen

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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 ...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Live coding intro to Mill: Build Scala projects easily

  • 1. A live-coding introduction to Mill Guillaume Galy Software engineer at Fabernovel guilgaly@gmail.com @guilgaly https://github.com/guilgaly _____________________________________ / A live-coding introduction to Mill: | finally a build tool we can all | understand! / ------------------------------------- ^__^ (oo)_______ (__) )/ ||----w | || ||
  • 2. Agenda ❖ What’s Mill? ❖ Hint: a build tool for Scala and Java, created by Li Haoyi ❖ Demo ❖ From zero, to publishing to Maven Central! 2
  • 3. What’s wrong with SBT ❖ No, not the weird syntax… ❖ That’s fixable (and already improved a lot) ❖ The 4D grid of settings (key, task-scope, configuration and project-scope) ❖ Multi-layered, mutable, execution model ❖ Hard to understand and debug ❖ Hard to navigate in an IDE ❖ No caching by default ❖ Done on an ad-hoc basis for some tasks 3
  • 4. The basic ideas for Mill ❖ The build graph: a directed acyclic graph
 compile package
 Sources ------> Bytecode ------> Release Jars ❖ That’s basically a purely functional program?
 val sources = ...
 val bytecode = compile(sources)
 val releaseJars = package(bytecode) ❖ But also needed: caching and a way to query the build graph ❖ In Mill, provided by Tasks defined with the T macro
 val sources = T.sources{ ... }
 val bytecode = T{ compile(sources()) }
 val releaseJars = T{ package(bytecode()) } 4
  • 5. A couple more niceties ❖ Modularity and scoping use standard Scala language features ❖ Build modules are just objects, etc. ❖ Tasks outputs are cached and queryable as JSON ❖ Nice for integration with external tools! ❖ Each task gets a dedicated folder to write files to if needed ❖ Then return a hash (for cache invalidation) + file path (for the next task to read only) ❖ Bonus point: the mill command has relatively little fixed overhead 5
  • 6. Live demo ❖ Multi-module build (library + app) ❖ Scala versions cross-compilation ❖ Scala JS/JVM cross-compilation ❖ Publishing the library 
 https://github.com/guilgaly/mill-demo-scalaio2019 _______________________________ / Let's write a cowsay | implementation in Scala, with | Mill as our build tool. / ------------------------------- __ / | | @ @ | | || |/ || || |_/| ___/ 6
  • 7. Resources ❖ Mill:
 http://www.lihaoyi.com/mill/
 https://github.com/lihaoyi/mill ❖ Mill design choices:
 http://www.lihaoyi.com/post/SowhatswrongwithSBT.html
 http://www.lihaoyi.com/post/BuildToolsasPureFunctionalPrograms.html
 http://www.lihaoyi.com/post/MillBetterScalaBuilds.html ❖ Gitter channel (ask questions about Mill there):
 https://gitter.im/lihaoyi/mill 7
  • 8. Resources ❖ Build pipelines with Mill:
 http://www.lihaoyi.com/post/HowtocreateBuildPipelinesinScala.html ❖ IntelliJ IDEA Scala blog, mentioning work on native Mill support:
 https://blog.jetbrains.com/scala/2019/08/08/integrating-developer-experiences-the- build-server-protocol-in-the-intellij-scala-plugin/ ❖ Cowsay in Scala (inspiration for today’s example):
 https://github.com/guilgaly/cowsay4s
 https://github.com/guilgaly/cowsay-online 8
  • 9. Thank you for your attention!