Clojure Superpower: Interactive programming with REPL
Created by Pavel Klavík
#Clojure, #ClojureScript, #REPL, #hot-code reloading, #interactive programming, #programming, #web development

Clojure superpower: REPL

https://orgpad.com/s/repl
Pavel Klavík

CTO and founder of OrgPad
Fully written in Clojure in last 5 years.

20% off
promocode REPL
Why Clojure??
Language is really simple
Instead f(x,y,z) write (f x y z).
Interactive programming
REPL + hot code reloading
Data-oriented programming



Compiling

REPL
Writing code
Running arbitrary code within application
Reading state
Updating code while application is running
Testing out
Debugger
How is my desktop organized




Failed renewal
Integration with Stripe payment gateway
Sends email to the user asking for update of payment information
Automatic renewal
REPL into staging
Into a server in Hetzner cloud in Falkenstein.
Using Stripe API
Payment successful
Stripe sends back messages using a webhook
Extends the subscription in OrgPad DB
REPL showcase
SSH tunnel for nREPL
Host remote-repl
HostName <host>
User <user>
Port <port>
LocalForward 7001 localhost:7000
ExitOnForwardFailure yes
RequestTTY no
RemoteCommand cat -

User chooses subscription plan in OrgPad website
Redirects to Stripe checkout for entering payment information


Creates a subscription in OrgPad DB
Just text
Shell programming. Custom serialization and parsing.
POST /cgi-bin/process.cgi HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 48
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
licenseID=string&content=string&/paramsXML=string
Nested data

Objects
Reinventing custom language for everything.

REPL into dev client
REPL into dev server
Payment canceled

A new server route
Ad-hoc computations with real data
Redirects back to OrgPad website
Redirects to payment page in OrgPad
REPL into production
Into a server in Hetzner cloud in Nürnberg.

Data of an example document in OrgPad
Interactive data processing
One-time DB conversions


Hot code reloading for dev client
Randomize cell colors
Generating accounting reports for Stripe
Quick bug fixes
Manual creation or extension of a subscription

reduce over n ids

effects
id₁
effects₁
id₂
effects₂
id₃
…
idₙ
effectsₙ
1 cell recolored
2 cells recolored
all cells recolored