SlideShare a Scribd company logo
Clake: a GNU make-like build utility in Common Lisp
2015.8.26 Masayuki Takagi
Lisp Meet Up presented by Shibuya.lisp #31
© 2015 Masayuki Takagi
-2-
About me
●
Masayuki Takagi
●
Common Lisp
●
cl-cuda on Lisp Meet Up #19
●
PIC compiler on Lisp Meet Up #25 and #27
© 2015 Masayuki Takagi
-3-
What's clake?
Clake is a build utility in Common Lisp like:
●
GNU make
●
Ruby's rake
$ cat Makefile
CC = gcc
hello: hello.c
${CC} -o $@ $<
$ make hello
$ cat Rakefile
CC = “gcc”
file “hello” => “hello.c” do
sh “#{CC} -o hello hello.c”
end
$ rake hello
Makefile Rakefile
© 2015 Masayuki Takagi
-4-
Motivation
Web applications on shoulders of UNIX
Redis
UNIX / Linux
MySQL
AWS CLI
docker
etc.
git
Apache
Nginx
© 2015 Masayuki Takagi
-5-
Motivation
GNU make and Ruby's rake
●
Originally build utility
●
Another point of view,
shell command manager
task “compile” do
sh “gcc -o product
product.c”
end
task “test” do
sh “test product”
end
task “profile” do
sh “profile product”
end
task “deploy” do
sh “deploy product”
end
Rakefile
© 2015 Masayuki Takagi
-6-
Motivation
Want to use the power of UNIX,
while keep standing on Common Lisp.
(defparameter cc “gcc”)
(file “hello” (“hello.c”)
(sh #?”${cc} -o hello hello.c”))
© 2015 Masayuki Takagi
-7-
How it started
●
Originally Rudolph Miller's GitHub repository
●
Fork and jack
© 2015 Masayuki Takagi
-8-
Clakefile
●
“Task” and “File Task”
●
File Tasks are executed only when out of date
;; Tasks that build an executable with dependency.
(defparameter cc "gcc")
(file "hello" ("hello.o" "message.o")
(sh #?"${cc} -o hello hello.o message.o"))
(file "hello.o" ("hello.c")
(sh #?"${cc} -c hello.c"))
(file "message.o" ("message.c")
(sh #?"${cc} -c message.c"))
(task "clean" ()
(sh "rm -f hello hello.o message.o"))
© 2015 Masayuki Takagi
-9-
Clakefile
●
Manage a group of tasks using “Namespace”
$ cat Clakefile
(namespace "hello"
(task "foo" (“bar”)
(echo "hello.foo"))
(task "bar" ()
(echo "hello.bar")))
$ clake hello:foo
hello.bar
hello.foo
© 2015 Masayuki Takagi
-10-
Clakefile
●
Clakefile dictionary
TASK task-name dependency-list form*
FILE task-name dependency-list form*
DIRECTORY task-name
NAMESPACE form*
© 2015 Masayuki Takagi
-11-
API
●
[Function] clake
CLAKE &key target pathname verbose
Loads a Clakefile specified with pathname to execute a task of name
target declared in the loaded Clakefile.
●
[Function] sh, echo
SH command &key echo
ECHO string
SH spawns a subprocess that runs the specified command given as a
string. ECHO writes the given string into the standard output
followed by a new line. Both are intended for UNIX terminology
convenience.
© 2015 Masayuki Takagi
-12-
Command Line Interface
●
Provided as a roswell script
●
Lisp / UNIX gap
SYNOPSIS
clake [ -f clakefile ] [ options ] ... [ targets ] ...
OPTIONS
-f FILE
Use FILE as a clakefile.
-h
Print usage.
-v
Verbose mode.
EXAMPLE
$ clake hello:foo hello:bar
© 2015 Masayuki Takagi
-13-
Lisp / UNIX gap
●
Common Lisp does not have the concept of current directory
●
uiop:getcwd, uiop:chdir
;; Where hello and hello.c should be located?
(file “hello” (“hello.c”)
(sh “gcc -o hello hello.c”))
●
*default-pathname-defaults* does not follow CL process' current
directory changed
“An implementation-dependent pathname, typically in the
working directory that was current when Common Lisp was
started up.”
●
How clake function should work? The command line interface would be
its main use case.
© 2015 Masayuki Takagi
-14-
clake-tools
●
A complementary program to provide some useful
goodies
SYNOPSIS
clake-tools COMMAND
COMMANDS
init Create an empty Clakefile with boilerplates
in current directory.
EXAMPLE
$ clake-tools init
$ ls
Clakefile
© 2015 Masayuki Takagi
-15-
GitHub repository
●
https://github.com/takagi/clake
© 2015 Masayuki Takagi
-16-
Closing
●
Beyond the Lisp / UNIX gap
●
Bring the power of Common Lisp to UNIX world

More Related Content

What's hot (20)

KEY
自分をClojure化する方法
fukamachi
 
PDF
Ruby in office time reboot
Kentaro Goto
 
PPTX
Ruby, the language of devops
Rob Kinyon
 
PPTX
HTTP::Parser::XS - writing a fast & secure XS module
Kazuho Oku
 
PPTX
Mongo db - How we use Go and MongoDB by Sam Helman
Hakka Labs
 
PDF
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
PDF
Jslab rssh: JS as language platform
Ruslan Shevchenko
 
PDF
Developing OpenResty Framework
OpenRestyCon
 
KEY
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
PDF
Ruby projects of interest for DevOps
Ricardo Sanchez
 
PDF
2015-10-07 PPDC HTTP Adapters
awwaiid
 
KEY
Intro to PSGI and Plack
Tatsuhiko Miyagawa
 
PDF
Serverless architecture: introduction & first steps
The Software House
 
PDF
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
PPTX
Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
Fwdays
 
PPTX
Rubykaigi 2017-nishimotz-v6
Takuya Nishimoto
 
PDF
DevOps tools for everyone - Vagrant, Puppet and Webmin
postrational
 
PDF
Productive web applications that run only on the frontend
Stefan Adolf
 
PPTX
Zend Expressive in 15 Minutes
Chris Tankersley
 
自分をClojure化する方法
fukamachi
 
Ruby in office time reboot
Kentaro Goto
 
Ruby, the language of devops
Rob Kinyon
 
HTTP::Parser::XS - writing a fast & secure XS module
Kazuho Oku
 
Mongo db - How we use Go and MongoDB by Sam Helman
Hakka Labs
 
Developing Java based microservices ready for the world of containers
Claus Ibsen
 
Jslab rssh: JS as language platform
Ruslan Shevchenko
 
Developing OpenResty Framework
OpenRestyCon
 
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 
Ruby projects of interest for DevOps
Ricardo Sanchez
 
2015-10-07 PPDC HTTP Adapters
awwaiid
 
Intro to PSGI and Plack
Tatsuhiko Miyagawa
 
Serverless architecture: introduction & first steps
The Software House
 
Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 
Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
Fwdays
 
Rubykaigi 2017-nishimotz-v6
Takuya Nishimoto
 
DevOps tools for everyone - Vagrant, Puppet and Webmin
postrational
 
Productive web applications that run only on the frontend
Stefan Adolf
 
Zend Expressive in 15 Minutes
Chris Tankersley
 

Recently uploaded (20)

PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Digital Circuits, important subject in CS
contactparinay1
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Ad

Lisp Meet Up #31, Clake: a GNU make-like build utility in Common Lisp

  • 1. Clake: a GNU make-like build utility in Common Lisp 2015.8.26 Masayuki Takagi Lisp Meet Up presented by Shibuya.lisp #31
  • 2. © 2015 Masayuki Takagi -2- About me ● Masayuki Takagi ● Common Lisp ● cl-cuda on Lisp Meet Up #19 ● PIC compiler on Lisp Meet Up #25 and #27
  • 3. © 2015 Masayuki Takagi -3- What's clake? Clake is a build utility in Common Lisp like: ● GNU make ● Ruby's rake $ cat Makefile CC = gcc hello: hello.c ${CC} -o $@ $< $ make hello $ cat Rakefile CC = “gcc” file “hello” => “hello.c” do sh “#{CC} -o hello hello.c” end $ rake hello Makefile Rakefile
  • 4. © 2015 Masayuki Takagi -4- Motivation Web applications on shoulders of UNIX Redis UNIX / Linux MySQL AWS CLI docker etc. git Apache Nginx
  • 5. © 2015 Masayuki Takagi -5- Motivation GNU make and Ruby's rake ● Originally build utility ● Another point of view, shell command manager task “compile” do sh “gcc -o product product.c” end task “test” do sh “test product” end task “profile” do sh “profile product” end task “deploy” do sh “deploy product” end Rakefile
  • 6. © 2015 Masayuki Takagi -6- Motivation Want to use the power of UNIX, while keep standing on Common Lisp. (defparameter cc “gcc”) (file “hello” (“hello.c”) (sh #?”${cc} -o hello hello.c”))
  • 7. © 2015 Masayuki Takagi -7- How it started ● Originally Rudolph Miller's GitHub repository ● Fork and jack
  • 8. © 2015 Masayuki Takagi -8- Clakefile ● “Task” and “File Task” ● File Tasks are executed only when out of date ;; Tasks that build an executable with dependency. (defparameter cc "gcc") (file "hello" ("hello.o" "message.o") (sh #?"${cc} -o hello hello.o message.o")) (file "hello.o" ("hello.c") (sh #?"${cc} -c hello.c")) (file "message.o" ("message.c") (sh #?"${cc} -c message.c")) (task "clean" () (sh "rm -f hello hello.o message.o"))
  • 9. © 2015 Masayuki Takagi -9- Clakefile ● Manage a group of tasks using “Namespace” $ cat Clakefile (namespace "hello" (task "foo" (“bar”) (echo "hello.foo")) (task "bar" () (echo "hello.bar"))) $ clake hello:foo hello.bar hello.foo
  • 10. © 2015 Masayuki Takagi -10- Clakefile ● Clakefile dictionary TASK task-name dependency-list form* FILE task-name dependency-list form* DIRECTORY task-name NAMESPACE form*
  • 11. © 2015 Masayuki Takagi -11- API ● [Function] clake CLAKE &key target pathname verbose Loads a Clakefile specified with pathname to execute a task of name target declared in the loaded Clakefile. ● [Function] sh, echo SH command &key echo ECHO string SH spawns a subprocess that runs the specified command given as a string. ECHO writes the given string into the standard output followed by a new line. Both are intended for UNIX terminology convenience.
  • 12. © 2015 Masayuki Takagi -12- Command Line Interface ● Provided as a roswell script ● Lisp / UNIX gap SYNOPSIS clake [ -f clakefile ] [ options ] ... [ targets ] ... OPTIONS -f FILE Use FILE as a clakefile. -h Print usage. -v Verbose mode. EXAMPLE $ clake hello:foo hello:bar
  • 13. © 2015 Masayuki Takagi -13- Lisp / UNIX gap ● Common Lisp does not have the concept of current directory ● uiop:getcwd, uiop:chdir ;; Where hello and hello.c should be located? (file “hello” (“hello.c”) (sh “gcc -o hello hello.c”)) ● *default-pathname-defaults* does not follow CL process' current directory changed “An implementation-dependent pathname, typically in the working directory that was current when Common Lisp was started up.” ● How clake function should work? The command line interface would be its main use case.
  • 14. © 2015 Masayuki Takagi -14- clake-tools ● A complementary program to provide some useful goodies SYNOPSIS clake-tools COMMAND COMMANDS init Create an empty Clakefile with boilerplates in current directory. EXAMPLE $ clake-tools init $ ls Clakefile
  • 15. © 2015 Masayuki Takagi -15- GitHub repository ● https://github.com/takagi/clake
  • 16. © 2015 Masayuki Takagi -16- Closing ● Beyond the Lisp / UNIX gap ● Bring the power of Common Lisp to UNIX world