SlideShare a Scribd company logo
1 of 16
INCREMENTAL DEVELOPMENT WITH LISP
       Building a Game and a Website




                                           @jlongster
                                       James Long
INCREMENTAL DEVELOPMENT

• “acyclic software development process developed in
 response to the weaknesses of the waterfall model”
 - Wikipedia

• Rapidly   evolving software by means of frequent small changes
CODING

• Let’s
      focus on PROGRAMMING, apply the same model to just
 the programmer

• Write   small pieces of code, run them, and repeat

• Tweak   and extend the program while it is running

• Advantages: instant   results, higher morale, less rabbit trails
WHY LISP?

• Lisp   is famous for embracing incremental development

• Very   expressive and dynamic

• Functional
           simplicity allows for “piece-by-piece” evaluation, or
 running small chunks of code quickly

• Thephilosophy of Lisp is built around incremental
 development
IN PRACTICE
• How    do you actually write code incrementally?

• REPL

• IDE

 • Emacs

   • SLIME

   • comint-mode
EXAMPLE #1
                                    VECTORS

• Goal: Write    a 3d vector library with support for addition

   (define-type v3
     x y z)

   EVAL

   (define (v3-add   v1 v2)
     (make-v3
      (+ (v3-x v1)   (v3-x v2))
      (+ (v3-y v1)   (v3-y v2))
      (+ (v3-z v1)   (v3-z v2))))

   EVAL




• Intimate   with what’s going on with the code
EXAMPLE #1
                                    VECTORS

• Goal: Write    a 3d vector library with support for addition
                                     (define-type v3
   (define-type v3                     constructor: really-make-vec3d
     x y z)                            x y z)
   EVAL                              EVAL
   (define (v3-add   v1 v2)          (define (make-v3 x y z #!key (scale 1.))
     (make-v3                          (really-make-vec3d (* x scale)
      (+ (v3-x v1)   (v3-x v2))                           (* y scale)
      (+ (v3-y v1)   (v3-y v2))                           (* z scale)))
      (+ (v3-z v1)   (v3-z v2))))
                                     EVAL
   EVAL
                                     v3-add is still available


• Intimate   with what’s going on with the code
EXAMPLE #2
                          RENDER QUEUE

• Goal: Write     a library which queues objects to render
    (define queue '())

    (define (queue-add obj)
      (set! queue (cons obj queue)))

    (define (queue-render-all)
      (for-each (lambda (obj)
                  (write obj))
                queue))

    EVAL-REGION


• Modify   a program while its running and never throw away
 state
EXAMPLE #2
                          RENDER QUEUE

• Goal: Write     a library which queues objects to render
    (define queue '())
                                       (define (queue-render-all)
    (define (queue-add obj)              (display "--- RENDERED OBJECTS ---n")
      (set! queue (cons obj queue)))     (for-each (lambda (obj)
                                                     (display obj)
    (define (queue-render-all)                       (newline))
      (for-each (lambda (obj)                      queue))
                  (write obj))
                queue))                queue and queue-add are the same as before

    EVAL-REGION


• Modify   a program while its running and never throw away
 state
INITIAL THOUGHTS?

• Emacs greatly enhances the ability for “live coding”, could be
 done in other editors though

• “Scratch   buffers” are commonly used to test the system

• Your “scratch   code” evolves into unit tests
REAL WORLD EXAMPLE #1
                            WEBSITE

• Clojure   is a Lisp dialect which runs on the JVM

• Compojure     is a web framework developed in Clojure

• jlongster.com

• Clojure
        supports SLIME, an incredible development
 environment fully embracing incremental development
REAL WORLD EXAMPLE #2
                           GAME

•Iused Gambit Scheme to make
 an iPhone game, Farmageddon

• Wrote  a tool that embeds
 “remote REPLs” in applications
 so that you can develop it
 SLIME-style

• Extended   Emacs keybindings
REAL WORLD EXAMPLE #2
                           GAME

•Iused Gambit Scheme to make
 an iPhone game, Farmageddon

• Wrote  a tool that embeds
 “remote REPLs” in applications
 so that you can develop it
 SLIME-style

• Extended   Emacs keybindings
PROBLEMS

• Youmust write your code in a way that allows incremental
 development

• Your   IDE must support it

• Sometimes    there’s a lot of overhead for little gain
WHAT ABOUT YOU?


• Most     of you don’t use Lisp, probably

• Python     and many other languages could support this too

• It’s   a different mindset that I challenge you to try
• Buymy game, available next week on the App Store for only
 $1.99

• @farmageddongame

• http://farmageddongame.com

More Related Content

What's hot

What make Swift Awesome
What make Swift AwesomeWhat make Swift Awesome
What make Swift Awesome
Sokna Ly
 

What's hot (20)

iSoligorsk #3 2013
iSoligorsk #3 2013iSoligorsk #3 2013
iSoligorsk #3 2013
 
Scala Refactoring for Fun and Profit
Scala Refactoring for Fun and ProfitScala Refactoring for Fun and Profit
Scala Refactoring for Fun and Profit
 
Haskell - Being lazy with class
Haskell - Being lazy with classHaskell - Being lazy with class
Haskell - Being lazy with class
 
Triton and symbolic execution on gdb
Triton and symbolic execution on gdbTriton and symbolic execution on gdb
Triton and symbolic execution on gdb
 
What make Swift Awesome
What make Swift AwesomeWhat make Swift Awesome
What make Swift Awesome
 
Introduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platformIntroduction to Kotlin Language and its application to Android platform
Introduction to Kotlin Language and its application to Android platform
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
Clojure, Plain and Simple
Clojure, Plain and SimpleClojure, Plain and Simple
Clojure, Plain and Simple
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
A Scala Corrections Library
A Scala Corrections LibraryA Scala Corrections Library
A Scala Corrections Library
 
Start Wrap Episode 11: A New Rope
Start Wrap Episode 11: A New RopeStart Wrap Episode 11: A New Rope
Start Wrap Episode 11: A New Rope
 
DConf 2016: Keynote by Walter Bright
DConf 2016: Keynote by Walter Bright DConf 2016: Keynote by Walter Bright
DConf 2016: Keynote by Walter Bright
 
DevNexus 2018: Learn Java 8, lambdas and functional programming
DevNexus 2018: Learn Java 8, lambdas and functional programmingDevNexus 2018: Learn Java 8, lambdas and functional programming
DevNexus 2018: Learn Java 8, lambdas and functional programming
 
Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)
 
Clojure (and some lisp) in 10 mins for OO developers
Clojure (and some lisp) in 10 mins for OO developersClojure (and some lisp) in 10 mins for OO developers
Clojure (and some lisp) in 10 mins for OO developers
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
Let'swift "Concurrency in swift"
Let'swift "Concurrency in swift"Let'swift "Concurrency in swift"
Let'swift "Concurrency in swift"
 
Writing Hadoop Jobs in Scala using Scalding
Writing Hadoop Jobs in Scala using ScaldingWriting Hadoop Jobs in Scala using Scalding
Writing Hadoop Jobs in Scala using Scalding
 
Ruby on rails - Ruby Basics
Ruby on rails - Ruby BasicsRuby on rails - Ruby Basics
Ruby on rails - Ruby Basics
 

Similar to Incremental Development with Lisp: Building a Game and a Website

JSLounge - TypeScript 소개
JSLounge - TypeScript 소개JSLounge - TypeScript 소개
JSLounge - TypeScript 소개
Reagan Hwang
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Nilesh Panchal
 
How to really obfuscate your pdf malware
How to really obfuscate   your pdf malwareHow to really obfuscate   your pdf malware
How to really obfuscate your pdf malware
zynamics GmbH
 
How to really obfuscate your pdf malware
How to really obfuscate your pdf malwareHow to really obfuscate your pdf malware
How to really obfuscate your pdf malware
zynamics GmbH
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
Anton Arhipov
 

Similar to Incremental Development with Lisp: Building a Game and a Website (20)

Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
 
Coscup
CoscupCoscup
Coscup
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"
 
Java 101
Java 101Java 101
Java 101
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
 
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNIntroducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
 
Java se-7-evolves-toulouse-jug-2001-09-14
Java se-7-evolves-toulouse-jug-2001-09-14Java se-7-evolves-toulouse-jug-2001-09-14
Java se-7-evolves-toulouse-jug-2001-09-14
 
Ropython-windbg-python-extensions
Ropython-windbg-python-extensionsRopython-windbg-python-extensions
Ropython-windbg-python-extensions
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
JSLounge - TypeScript 소개
JSLounge - TypeScript 소개JSLounge - TypeScript 소개
JSLounge - TypeScript 소개
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming language
 
How to really obfuscate your pdf malware
How to really obfuscate   your pdf malwareHow to really obfuscate   your pdf malware
How to really obfuscate your pdf malware
 
How to really obfuscate your pdf malware
How to really obfuscate your pdf malwareHow to really obfuscate your pdf malware
How to really obfuscate your pdf malware
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with java
 
Java 101 Intro to Java Programming
Java 101 Intro to Java ProgrammingJava 101 Intro to Java Programming
Java 101 Intro to Java Programming
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Incremental Development with Lisp: Building a Game and a Website

  • 1. INCREMENTAL DEVELOPMENT WITH LISP Building a Game and a Website @jlongster James Long
  • 2. INCREMENTAL DEVELOPMENT • “acyclic software development process developed in response to the weaknesses of the waterfall model” - Wikipedia • Rapidly evolving software by means of frequent small changes
  • 3. CODING • Let’s focus on PROGRAMMING, apply the same model to just the programmer • Write small pieces of code, run them, and repeat • Tweak and extend the program while it is running • Advantages: instant results, higher morale, less rabbit trails
  • 4. WHY LISP? • Lisp is famous for embracing incremental development • Very expressive and dynamic • Functional simplicity allows for “piece-by-piece” evaluation, or running small chunks of code quickly • Thephilosophy of Lisp is built around incremental development
  • 5. IN PRACTICE • How do you actually write code incrementally? • REPL • IDE • Emacs • SLIME • comint-mode
  • 6. EXAMPLE #1 VECTORS • Goal: Write a 3d vector library with support for addition (define-type v3 x y z) EVAL (define (v3-add v1 v2) (make-v3 (+ (v3-x v1) (v3-x v2)) (+ (v3-y v1) (v3-y v2)) (+ (v3-z v1) (v3-z v2)))) EVAL • Intimate with what’s going on with the code
  • 7. EXAMPLE #1 VECTORS • Goal: Write a 3d vector library with support for addition (define-type v3 (define-type v3 constructor: really-make-vec3d x y z) x y z) EVAL EVAL (define (v3-add v1 v2) (define (make-v3 x y z #!key (scale 1.)) (make-v3 (really-make-vec3d (* x scale) (+ (v3-x v1) (v3-x v2)) (* y scale) (+ (v3-y v1) (v3-y v2)) (* z scale))) (+ (v3-z v1) (v3-z v2)))) EVAL EVAL v3-add is still available • Intimate with what’s going on with the code
  • 8. EXAMPLE #2 RENDER QUEUE • Goal: Write a library which queues objects to render (define queue '()) (define (queue-add obj) (set! queue (cons obj queue))) (define (queue-render-all) (for-each (lambda (obj) (write obj)) queue)) EVAL-REGION • Modify a program while its running and never throw away state
  • 9. EXAMPLE #2 RENDER QUEUE • Goal: Write a library which queues objects to render (define queue '()) (define (queue-render-all) (define (queue-add obj) (display "--- RENDERED OBJECTS ---n") (set! queue (cons obj queue))) (for-each (lambda (obj) (display obj) (define (queue-render-all) (newline)) (for-each (lambda (obj) queue)) (write obj)) queue)) queue and queue-add are the same as before EVAL-REGION • Modify a program while its running and never throw away state
  • 10. INITIAL THOUGHTS? • Emacs greatly enhances the ability for “live coding”, could be done in other editors though • “Scratch buffers” are commonly used to test the system • Your “scratch code” evolves into unit tests
  • 11. REAL WORLD EXAMPLE #1 WEBSITE • Clojure is a Lisp dialect which runs on the JVM • Compojure is a web framework developed in Clojure • jlongster.com • Clojure supports SLIME, an incredible development environment fully embracing incremental development
  • 12. REAL WORLD EXAMPLE #2 GAME •Iused Gambit Scheme to make an iPhone game, Farmageddon • Wrote a tool that embeds “remote REPLs” in applications so that you can develop it SLIME-style • Extended Emacs keybindings
  • 13. REAL WORLD EXAMPLE #2 GAME •Iused Gambit Scheme to make an iPhone game, Farmageddon • Wrote a tool that embeds “remote REPLs” in applications so that you can develop it SLIME-style • Extended Emacs keybindings
  • 14. PROBLEMS • Youmust write your code in a way that allows incremental development • Your IDE must support it • Sometimes there’s a lot of overhead for little gain
  • 15. WHAT ABOUT YOU? • Most of you don’t use Lisp, probably • Python and many other languages could support this too • It’s a different mindset that I challenge you to try
  • 16. • Buymy game, available next week on the App Store for only $1.99 • @farmageddongame • http://farmageddongame.com

Editor's Notes