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

KEY
About Clack
PPTX
Lisp in the Cloud
PDF
Clack: glue for web apps
PDF
Building GUI App with Electron and Lisp
PDF
Woo: Writing a fast web server
ODP
Developing high-performance network servers in Lisp
PDF
Woo: Writing a fast web server @ ELS2015
PDF
Writing a fast HTTP parser
About Clack
Lisp in the Cloud
Clack: glue for web apps
Building GUI App with Electron and Lisp
Woo: Writing a fast web server
Developing high-performance network servers in Lisp
Woo: Writing a fast web server @ ELS2015
Writing a fast HTTP parser

What's hot (20)

KEY
自分をClojure化する方法
PDF
Ruby in office time reboot
PPTX
Ruby, the language of devops
PPTX
HTTP::Parser::XS - writing a fast & secure XS module
PPTX
Mongo db - How we use Go and MongoDB by Sam Helman
PDF
Developing Java based microservices ready for the world of containers
PDF
Jslab rssh: JS as language platform
PDF
Developing OpenResty Framework
KEY
Plack perl superglue for web frameworks and servers
PDF
Ruby projects of interest for DevOps
PDF
2015-10-07 PPDC HTTP Adapters
KEY
Intro to PSGI and Plack
PDF
Serverless architecture: introduction & first steps
PDF
Building a desktop app with HTTP::Engine, SQLite and jQuery
PPTX
Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
PPTX
Rubykaigi 2017-nishimotz-v6
PDF
DevOps tools for everyone - Vagrant, Puppet and Webmin
PDF
Productive web applications that run only on the frontend
PPTX
Zend Expressive in 15 Minutes
自分をClojure化する方法
Ruby in office time reboot
Ruby, the language of devops
HTTP::Parser::XS - writing a fast & secure XS module
Mongo db - How we use Go and MongoDB by Sam Helman
Developing Java based microservices ready for the world of containers
Jslab rssh: JS as language platform
Developing OpenResty Framework
Plack perl superglue for web frameworks and servers
Ruby projects of interest for DevOps
2015-10-07 PPDC HTTP Adapters
Intro to PSGI and Plack
Serverless architecture: introduction & first steps
Building a desktop app with HTTP::Engine, SQLite and jQuery
Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
Rubykaigi 2017-nishimotz-v6
DevOps tools for everyone - Vagrant, Puppet and Webmin
Productive web applications that run only on the frontend
Zend Expressive in 15 Minutes
Ad

Similar to Lisp Meet Up #31, Clake: a GNU make-like build utility in Common Lisp (20)

PPTX
Makefile for python projects
PDF
Build Systems with autoconf, automake and libtool [updated]
PDF
OpenFaaS JeffConf 2017 - Milan
PDF
Open Source LLMs, from vLLM to Production (Instruct.KR Summer Meetup, 2025)
PDF
Fluvii: A Lightweight Kafka Streams Client for Python
PPTX
Road to sbt 1.0: Paved with server (2015 Amsterdam)
PDF
Spring Cloud Stream with Kafka
PDF
Ruby Meets Cocoa
PDF
LOSS_C11- Programming Linux 20221006.pdf
PDF
Docker Essentials Workshop— Innovation Labs July 2020
PDF
[Hands-on] Kubernetes | Nov 18, 2017
PDF
Zero to Serverless - OpenFaaS at the Open Source Summit
PDF
Ballerina Serverless with Kubeless
PDF
Ballerina Serverless with Kubeless
PDF
CMake - Introduction and best practices
PPTX
Road to sbt 1.0 paved with server
PDF
Dockercon EU 2014
PDF
XPDDS19: A Journey through Unikraft's Build System
PDF
Why Airflow? & What's new in Airflow 2.3?
PDF
Command Line Tool in swift
Makefile for python projects
Build Systems with autoconf, automake and libtool [updated]
OpenFaaS JeffConf 2017 - Milan
Open Source LLMs, from vLLM to Production (Instruct.KR Summer Meetup, 2025)
Fluvii: A Lightweight Kafka Streams Client for Python
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Spring Cloud Stream with Kafka
Ruby Meets Cocoa
LOSS_C11- Programming Linux 20221006.pdf
Docker Essentials Workshop— Innovation Labs July 2020
[Hands-on] Kubernetes | Nov 18, 2017
Zero to Serverless - OpenFaaS at the Open Source Summit
Ballerina Serverless with Kubeless
Ballerina Serverless with Kubeless
CMake - Introduction and best practices
Road to sbt 1.0 paved with server
Dockercon EU 2014
XPDDS19: A Journey through Unikraft's Build System
Why Airflow? & What's new in Airflow 2.3?
Command Line Tool in swift
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative analysis of optical character recognition models for extracting...
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
sap open course for s4hana steps from ECC to s4
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx

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