OrgPad logo

Clojure Superpower: Interactive programming with REPL

Created by Pavel Klavík

#Clojure, #ClojureScript, #REPL, #hot-code reloading, #interactive programming, #programming, #web development

Clojure Superpower: Interactive programming with REPL

Clojure superpower: REPL

800px-Clojure logo.svg

https://orgpad.com/s/repl

Pavel Klavík

pavel v obleku

CTO and founder of OrgPad

Fully written in Clojure in last 5 years.

799px-OrgPad Logo.svg

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

Sharvit-DOP-HI

268125

2250206

Compiling

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

4765DC68-ACA1-4AC0-93C7-00989817688C

white-circle-basic

white-circle-basic

2560px-Stripe Logo%2C revised 2016.svg

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 -

Logo Hetzner.svg

User chooses subscription plan in OrgPad website

Redirects to Stripe checkout for entering payment information

689360

2345350

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

Screenshot (143)

Objects

Reinventing custom language for everything.

Screenshot (142)

REPL into dev client

REPL into dev server

Payment canceled

Google Chrome icon (February 2022).svg

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.

Spiderman---With-Great-Power-comes-Great-Responsibility 800x800 SEPS-1000x1000

Data of an example document in OrgPad

Interactive data processing

One-time DB conversions

white-circle-basic

white-circle-basic

Hot code reloading for dev client

Randomize cell colors

Generating accounting reports for Stripe

Quick bug fixes

Manual creation or extension of a subscription

white-circle-basic

reduce over n ids

white-circle-basic

effects

id₁

effects₁

id₂

effects₂

id₃

idₙ

effectsₙ

1 cell recolored

2 cells recolored

all cells recolored