If programming is more than just a means of getting things done for you, then Common Lisp is for you!
Table of Contents
If programming is more than just a means of getting things done for you, then Common Lisp is for you!
Table of Contents
(defpackage :weblocks/forms | |
(:use :cl) | |
(:import-from #:weblocks/actions | |
#:make-action-url | |
#:function-or-action->action | |
#:get-request-action) | |
(:import-from #:weblocks/html | |
#:with-html) | |
(:import-from #:weblocks/request | |
#:get-path) |
;; This example illustrates how to call actions from JS and update the widget in response. | |
;; It is incomplete but could be refactored into reusable library. | |
;; Hope, somebody will do this some day. | |
(defpackage #:weblocks-autocomplete | |
(:use #:cl)) | |
(in-package weblocks-autocomplete) | |
(ql:quickload '(weblocks log4cl)) |
I'll preface this with three things. 1. I prefer schemes over Common Lisps, and I prefer Racket of the Schemes. 2. There is more to it than the points I raise here. 3. I assume you have no previous experience with Lisp, and don't have a preference for Schemes over Common Lisp. With all that out of the way... I would say Common Lisp/SBCL. Let me explain
Now as to why Common Lisp over Scheme
#!/usr/bin/env python | |
import math | |
import sys | |
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips | |
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb) | |
# Assumes x1 < x2, y1 < y2 |
Testimonies
The thing in CL I miss most doing Clojure as my day job? CL's compiler. I like having a compiler tell me at compile time about the mistakes I've made. Bogus arguments. Unreachable code because of unhandled exceptions, and so on. CL saves me round after round of bugs that in clojure aren't found until you run the code. If you test well, it's found when testing, if you don't it's found in production. "Clojure compiler" almost demands air quotes.
CL's optional but oh-so-useful model of type declarations is also infinitely more useful (to me) than Clojure's use of "spec", and instrumentation that happens only at test time because of the cost. Depending on the OPTIMIZE declarations, other type defs are a floor wax and dessert topping. Want checks for argument types? Lower optimizations. Want most efficient machine code? High optimizations.
/u/Decweb, March 2023 https://www.reddit.com/r/lisp/comments/11ttnxk/the_rise_fall_of_lisp_too_good_for_the_rest_of/jczpysp/
#!/usr/bin/sbcl --script | |
#| | |
Usage | |
===== | |
$ ./braille-pixels.lisp [path] | |
Main | |
==== |