Skip to content

Talks at the <Programming> 2022 Conference in Porto, Portugal

Notifications You must be signed in to change notification settings

sritchie/programming-2022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<programming> 2022

Hello! Welcome to the repository for my (Sam Ritchie's) talks from the 2022 European Lisp Symposium and <programming> conferences.

If you find this work interesting, please consider sponsoring it via Github Sponsors. Thank you!

Here you'll find:

  • More information about SICMUtils and the projects I discussed in the talks
  • Working versions of the demos
  • The org-re-reveal-generated slides from the presentations.

Links

Demo Instructions

The demos include both Clojure and Clojurescript code. Two environments means two build tools, so you'll need to have these installed:

  • clj, for running the JVM side
  • shadow-cljs for building the JS bundle used by the demos. This is a lovely system that will automatically rebuild the bundle any time you save a cljs file.
    • You'll also need node.js installed, to install the initial npm dependencies.

When those are all set (the links include installation instructions),

Clone the repository:

git clone [email protected]:sritchie/programming-2022.git
cd programming-2022

Generate the JS bundle for the demos by running the following commands in one terminal window:

npm install
shadow-cljs watch sicm-browser

In another tab, start a Clojure repl with clj. This REPL has the full SICMUtils API available, so run some tests for fun:

(->infix (((exp D) (literal-function 'f)) 'x))
;;=> "f(x) + Df(x) + 1/2 D²f(x) + 1/6 D³f(x) + ..."

Next, start a webserver for Clerk, (the literate programming viewer) by running the following commands:

;; point Clerk at our newly-generated JS bundle instead of its default:
(swap! clerk-config/!resource->url
       assoc
       "/js/viewer.js"
       "http://localhost:9000/out/main.js")

;; Start the clerk server.
(clerk/serve!
 {:browse? true :port 7777})

Now run (clerk/show! <path/to/file.clj>) to run any of the demos. Some examples to try:

;; intro:
(clerk/show! "src/demo.clj")

;; Mathbox basics:
(clerk/show! "src/cube_controls.clj")

;; functions:
(clerk/show! "src/functions.clj")
(clerk/show! "src/polar.clj")

;; symbolic physics:
(clerk/show! "src/einstein.clj")

;; vega, symbolic, double-pendulum
(clerk/show! "src/pendulum.clj")

;; mathbox physics:
(clerk/show! "src/oscillator.clj")
(clerk/show! "src/ellipsoid.clj")
(clerk/show! "src/double_ellipsoid.clj")

;; browser/client comms:
(clerk/show! "src/live_oscillator.clj")

NOTE: Clojure is far more pleasant if you can get a REPL running from inside of your favorite code editor. I'll update this repo with links to a good "Getting Started" resource; but please open an issue if you're having trouble and I'll get you sorted.

If you're running a REPL from inside your editor, see the Clerk homepage for instructions on how to trigger clerk-show! with a key command, making dynamic interaction much more fun.

Presentations

The presentations themselves live in presentations/org/*.html. see presentations/README.md for more detail on how to:

  • build these html files from their associated org files
  • generate slides by executing Clojure code
  • Serve these presentations in presenter mode

Enjoy!

About

Talks at the <Programming> 2022 Conference in Porto, Portugal

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published