HNHacker News
TopNewBestAskShowJobs

vindarel

1,508 karma · joined July 7, 2017

Pythonista turned lisper.

https://lisp-journey.gitlab.io/pythonvslisp/

I run CL apps in production.

CL, batteries included, fast scripting: http://ciel-lang.org/

I create a Common Lisp course in videos. It's a progressive and structured course, where everything that was hard for me (especially hard to find) is made easy for you. Check it out! https://www.udemy.com/course/common-lisp-programming/?referralCode=2F3D698BBC4326F94358

---

@ vindarel mailz.org

submissionscomments
vindarel··on Nim 2.2.6
> with the syntax of Python

this library should allow that: https://github.com/hraban/metabang-bind (never tried)

with some limitations: https://github.com/nimpylib/nimpylib/tree/master/doc/mustRew... no "end" argument in print, no triple quote and newline, no "a not in b" (write not (a in b)), no variable named _ (underscore), or double underscore, no slice as foo[:b] where the left part of the slice is not specified, rewrite foo[0:b], etc.

vindarel··on Clojure Land – Discover open-source Clojure libraries and frameworks
no that doesn't mean we are going back to the same market presence, indeed. Do we have or will we have a useful-enough market presence?

Here are some more companies: https://github.com/azzamsa/awesome-lisp-companies/ (only the ones we know about)

vindarel··on Clojure Land – Discover open-source Clojure libraries and frameworks
It's niche but used enough in the industry to give us tools like Coalton (https://github.com/coalton-lang/coalton/), used enough by hobbyists to give us nice new libraries (new TUI library: https://github.com/atgreen/cl-tuition/blob/master/examples/R...) and exceptionally good and fast open-source compilers (SBCL) (with a good bus factor and contributors from the industry, like Google), it has enough libraries to allow us to ship software to clients (web clients, web servers, web UIs (webview, webui), SQL libraries, etc). It's niche but the motivated developer can publish a game on Steam (Kandria).

(btw, ABCL has the benefit of Java libraries, for those interested)

Julia has its own issues (and isn't on par outside of scientific area).

vindarel··on Clojure Land – Discover open-source Clojure libraries and frameworks
Another big difference, given feedback of people who used both languages, is the CL compiler.

---

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.

(decweb, 2023)

---

As a practitioner of both Common Lisp and Clojure, one of the things that draws me back to Common Lisp is its compiler and the many useful things it does when I C-c C-c a definition in my emacs buffer.

SBCL has many useful checks. I liked this one today (see image). It flagged the format line as unreachable (and deleted) code. It was correct, because the setf should have updated keys, not new-keys, and so keys would always be nil.

I really appreciate this savings in time, finding the bug when I write it, not when I eventually run it, perhaps much later.

Before the Clojure guys tell me they that linters or LSPs will catch this sort of thing, don't bother. Having to incorporate a bunch of additional tools into the toolchain is not a feature of the language, it's a burden. Clojure should step up their compiler game.

https://gist.github.com/vindarel/3484a4bcc944a5be143e74bfae1...

vindarel··on Clojure Land – Discover open-source Clojure libraries and frameworks
I'll invite to explore the CL ecosystem starting with https://github.com/CodyReichert/awesome-cl/ (it might be larger than one thinks)

In terms of asynchronous programming, not built-in to implementations (like, no green threads), we have

- https://github.com/orthecreedence/wookie - an asynchronous HTTP server

- https://github.com/fukamachi/woo - fast non-blocking HTTP server on top of libev.

- an actor-based task manager for Hunchentoot: https://github.com/mdbergmann/cl-tbnl-gserver-tmgr

see also https://github.com/CodyReichert/awesome-cl/#parallelism-and-... for promise libraries, async libraries, the actor library, an STM library, lparallel (run tasks in parallel, easy and often useful), bindings to other async tools.

Those libraries are active.

vindarel··on Spotlight on pdfly, the Swiss Army knife for PDF files
I found PDF SAM basic ("split and merge") well done: https://pdfsam.org/en/pdfsam-basic/. That one is open-source and multi-platform, they have more features in a paying superset project.
vindarel··on Show HN: A Lisp Interpreter for Shell Scripting
nice thanks, I'll check them out.

They are also on https://github.com/CodyReichert/awesome-cl/

vindarel··on Show HN: A Lisp Interpreter for Shell Scripting
> writing your shell scripts in Lisp instead of Bash.

in a Lisp ;)

Related, for Common Lisp:

- unix in lisp https://github.com/PuellaeMagicae/unix-in-lispMount Unix system into Common Lisp image.

- kiln https://github.com/ruricolist/kiln - an infrastructure (managing a hidden multicall binary) to make Lisp scripting efficient and ergonomic.

- CIEL https://github.com/ciel-lang/CIEL/ - CIEL Is an Extended Lisp is a collection of dozens of libraries useful for mundane tasks (HTTP, JSON, regexps…). It also comes as a binary that is able to run scripts from sources. Scripts that use the built-in libraries start fast without a compilation step. [project of mine]

- discussed here: https://news.ycombinator.com/item?id=41401415

- Lish https://github.com/nibbula/lish - maybe someday a Lisp shell

- SHCL https://github.com/bradleyjensen/shcl - a POSIX shell in CL (stalling)

- lserver https://notabug.org/quasus/lserver/ - live-coding remote function calls for the shell. Write a command in the REPL, and run it instantly in the shell.

I use CIEL ;)

And, built-in: use the --load flag or build a self-contained binary, compiled to machine code with SBCL. It can contain your web assets (html, js etc). A compressed binary weights ±30MB and starts fast. A stripped off binary with LispWork$ (no compiler, no debugger etc) is ±5MB. There's ECL too.

vindarel··on Lisp project of the day
It's great but some chosen libraries are a bit too random or early. You can look at a curated list of Common Lisp libraries here: https://github.com/CodyReichert/awesome-cl/
vindarel··on Extending Emacs with Fennel (2024)
For CL hash-tables I can recommend serapeum's dict:

    (dict :a 1 :b 2)
(it's an 'equal HT)

With toggle-pretty-print-hash-table it will pretty-print its content, readably.

vindarel··on Benben: An audio player for the terminal, written in Common Lisp
It's a Common Lisp program for end users and I can literally use it in 3 clicks, thanks to its AppImage (for Linux x86-64). Good (and rare) stuff!

It's also impressive to see that the audio decoding is mostly done in CL, without bindings.

vindarel··on Mostly dead influential programming languages (2020)
the image-based REPL, including the interactive debugger, is still unique (matched maybe by Smalltalk), CLOS and the condition system too… pair them with stability, fast implementations, instantaneous compile-time errors and warnings a keystroke away, a Haskell-like type system on top of the language (Coalton), macros… and the whole is still pretty unique.
vindarel··on Lisp-stat: Lisp environment for statistical computing
Their dataframe is pretty cool, I used it with CSV: https://lisp-stat.dev/docs/manuals/data-frame/
vindarel··on Smalltalk, Haskell and Lisp
indeed. Note that's a function declaration in Common Lisp (yours is Scheme):

    (defun time-to-move (from-pos to-pos)
it's like the author didn't understand accessors? They don't need the with-accessors. They also might not need with-slots, had they had an accessor for last-duration.

    (with-slots (last-duration) antenna
      (setf last-duration total-time)
=>

    (setf (last-duration antenna) total-time)  ;; given last-duration is an accessor: both a getter and a setter.
vindarel··on Smalltalk, Haskell and Lisp
> good dep management

you can see https://github.com/ocicl/ocicl and https://github.com/fosskers/vend (newer)

> sane beginner defaults

agree. CLISP's REPL is beginner friendly, but we shall not advise it today. I'm doing this: https://github.com/ciel-lang/CIEL/ Common Lisp with batteries included. The terminal REPL has completion and syntax highlighting. You can run scripts easily. You get many common libraries. (beta)

vindarel··on Smalltalk, Haskell and Lisp
(to be clear those historic stuff are present in today's implementations)
vindarel··on Hacker News now runs on top of Common Lisp
I appreciate the feedback, I edited the post. I actually should have noticed it, it's a grammar lesson I remember quite well and a mistake I spot in others' posts :] My first wording was mentioning "September of 2024", which I replaced with "a few months" at the last minute.
vindarel··on Hacker News now runs on top of Common Lisp
I edited the post to add this clarification, thank you.

Vincent (my full name appears in linked projects ;) )

vindarel··on A simple Common Lisp web app
oh, hello. Yes, you write "I was surprised by the absence of a quickstart page to help me set up a simple server", that's spreading FUD. Many such tutorials have been written.

> I could not find a quick tutorial for Caveman

But what about Caveman's own README? It's a tutorial.

You would phrase differently I could not discuss it (like your first sentences on CL's documentation state in general). The "absence", I can. Words are important.

> triggered

yeah obviously, and by the fact that I put efforts to improve CL's (web) documentation situation.

> hostile

abrupt and impatient, yet relevant? I make some points.

vindarel··on Typed Lisp, a Primer
just get Common Lisp with this new Clojure collection and sequence API! https://github.com/dtenny/clj-coll
vindarel··on A simple Common Lisp web app
yeah the author does too much (and un-necessary stuff). To keep his stack just use the Caveman library has he does:

    (defparameter *web* (make-instance '<app>))

    @route GET "/"
    (defun index ()
      (render #P"index.tmpl"))
https://github.com/fukamachi/caveman/ (I like Mito and Djula, I'd go with Hunchentoot rather than Clack which is famously undocumented)
vindarel··on A simple Common Lisp web app
false premises, false conclusions, and bad good ideas in-between.

> I was surprised by the absence of a quickstart page to help me set up a simple server

what about https://lispcookbook.github.io/cl-cookbook/web.html ?

Also I think that the READMEs of Mito (ORM) and Djula (templating) and easy-routes (routing) are very good. Heck, Djula's documentation is excellent. Double heck, even Caveman's README, which the author uses, has a good and sufficient getting-started page.

Oh, I understand, the author uses Clack/Lack… where Hunchentoot is much better documented.

there are of course more blog posts, some videos. I invite any blogger to consolidate community resources.

More recent: https://web-apps-in-lisp.github.io/

ps:

> ;; If the template is not already compiled, it is compiled, and stored in TEMPLATE-REGISTRY.

won't that prevent the template to compile changes? I suggest to follow Djula's doc.

> I would add a way to invalidate the cache automatically if a template changes.

yeah. So don't do that ;)

(also +1 to Jach's remarks and explanations)

> I created a macro that ensure the table gets created correctly

hummm… I'd suggest to leave the migration step explicit.

> some database helpers to perform a few CRUD actions on the db.

I felt the need for CRUD helpers too when defining Mito classes. However those four ones are only similar functions with same parameters but another name :]

    (defun db-add (instance)
      "Inserts a model instance into the database."
      (insert-dao instance))
> I would say that there are better languages for developing modern web apps.

Burn this article with fire ;)

You don't need to need extraordinary clever needs to use CL. You benefit about it during development, deployment, and the application lifecycle.

time-saving error handling? You can use it 100x times a day. https://www.youtube.com/watch?v=jBBS4FeY7XM

simple "scripts", data-munging applications for B2B? You can do it easily in CL, and save yourself sanity during development, deployment, etc. https://lisp-journey.gitlab.io/blog/running-my-4th-lisp-scri...

One caveat: have some experience with the language.

> since hot reloading has already been implemented in all high-level languages

nope you can't compare hot reloading with image-based development.

Please just don't compare anything or induce "better languages for modern web apps" with Python…

> shout-out to Alive which is the only Common Lisp extension for VSCode that implements the REPL with features similar to what SLIME and SLY bring to Emacs.

please don't forget SLIMA for Atom/Pulsar which has even more features than Alive, or the Sublime one, or Vim, or the Intellij one, or… https://lispcookbook.github.io/cl-cookbook/editor-support.ht...

vindarel··on A simple Common Lisp web app
I also hear "programmable chips", does that count? Example:

- [Barefoot Networks](https://www.barefootnetworks.com/)

- "we use Lisp (via Allegro CL’s Enterprise class development environment) in the design of our Intel Tofino series of programmable switch chips"

  - article on [Franz Inc networks](https://allegrograph.com/press_room/barefoot-networks-uses-franzs-allegro-cl-to-drive-artificial-intelligence-in-networks/), some words [on reddit](https://www.reddit.com/r/lisp/comments/oq884e/how_do_you_use_lisp_at_work/h6d8xcw/), and a [youtube video](https://www.reddit.com/r/lisp/comments/oq884e/how_do_you_use_lisp_at_work/h6d8xcw/).
vindarel··on A Common Lisp jq replacement
Similar, in CL too:

* [lqn](https://github.com/inconvergent/lqn) - query language and terminal utility for querying and transforming Lisp, JSON and other text files.

(by this person doing nice generative art: https://inconvergent.net/)

vindarel··on LibreLingo – FOSS Alternative to Duolingo
A big shootout and kuddos to Language Transfer. I love their method (since I loved Michel Thomas, we see the influence).

"Don't try to remember, don't do homework, but repeat with the two other students. It is of our responsibility [the teacher] to make you understand the language. What you know, you don't forget" (para-phrasing)

And it works (for me© and surely for more software engineers).

https://www.michelthomas.com/

vindarel··on Graphics livecoding in Common Lisp
for folks looking for libraries: https://github.com/CodyReichert/awesome-cl/

(I don't know for popularity but my personal opinion is that CL is still unmatched: this level of interactive development + good debugging tools + excellent implementation that compiles to fast machine code + fast startup for binaries + self-contained binaries + stable yet improving language, implementations and ecosystem + connect from a running program + commercial vendors if you need + … such a unique and productive set)

(re. the type system: https://github.com/coalton-lang/coalton/ for a Haskell on top of CL now)

vindarel··on Slip – A Lisp System in the Browser
Absolutely mindblowing.
vindarel··on Why I Program in Lisp
> I will check out your courses to see if I can learn something from you.

Thanks. Don't hesitate to reach out and give feedback. If you're into web, you might find my newer (opinionated) resource helpful: https://web-apps-in-lisp.github.io/

> Listen, I like Lisp. But Lisp has this weird effect where people, I think in an effort to boost the community, want to present every tool as a viable answer to their problems, no matter how unfinished or difficult to use.

I see. On social media comments, that's kinda true: I'm so used to hear "there is no CL editor besides Emacs" (which is literally plain false and has been for years, even if you exclude VSCode), and other timeless FUD. Articles or pages on community resources (Cookbook) should be better measured.

> listing every editor under the sun.

there's an Eclipse plugin (simple), a Geany one (simple), a Sublime one (using Slynk, can be decent?), Allegro (proprietary, tried the web version without color highlighting, surprising), Portacle and plain-common-lisp are easy to install Emacs + CL + Quicklisp bundles…

some would add CLOG as a CL editor.

BTW the Intellij plugin is also based on Slime. Not a great development activity though. But a revolution for the Lisp world if you think about it. Enough to make me want mention it twice or thrice on HN.

> tried them extensively

emphasis on "extensively", so no. SLIMA for Atom/Pulsar was decent.

> ECL… slower…

true and for this I've been measured, but looking at how vend is doing would be very interesting, as it ships a very small binary, based on libecl.

vindarel··on Why I Program in Lisp
Maybe you tried some time ago? This experience report concludes by "all in all, a great rig": https://blog.djhaskin.com/blog/experience-report-using-vs-co...

> The usage experience was very ergonomic, much more ergonomic than I'm used to with my personal CL set-up. Still, the inability to inspect stack frame variables would bother me, personally.

I don't use them, but I'd recommend Pulsar's SLIMA over the VSCode plugin, because it's older and based on Slime, where ALIVE is based on LSP.

> But Lispworks is the only one that makes actual tree-shaken binaries, whereas SBCL just throws everything in a pot and makes it executable, right?

right. SBCL has core compression, so as I said a web app with dozens of dependencies and all static assets is ±35MB, that includes the compiler and debugger (that allow to connect and update a running image, whereas this wouldn't be possible with LispWorks' stripped down binary). 35MB for a non-trivial app is good IMO (and in the ballparks of a growing Go app right?)

There's also ECL, if you rely on libecl you can get very small binaries (I didn't explore this yet, see example in https://github.com/fosskers/vend)

vindarel··on Why I Program in Lisp
Common Lisp can compete with Python no problem, that's what matters to me. You get:

- truly interactive development (never wait for something to restart, resume bugs from any stack frame after you fixed them),

- self-contained binaries (easy deployment, my web app with all the dependencies, HTML and CSS is ±35MB)

- useful compile-time warnings and errors, a keystroke away, for Haskell levels see Coalton (so better than Python),

- fast programs compiled to machine code,

- no GIL

- connect to, inspect or update running programs (Slime/Swank),

- good debugging tools (interactive debugger, trace, stepper, watcher (on some impls)…)

- stable language and libraries (although the implementations improve),

- CLOS and MOP,

- etc

- good editor support: Emacs, Vim, Atom/Pulsar (SLIMA), VScode (ALIVE), Jetbrains (SLT), Jupyter kernel, Lem, and more: https://lispcookbook.github.io/cl-cookbook/editor-support.ht...

What we might not get:

- advanced refactoring tools -also because we need them less, thanks to the REPL and language features (macros, multiple return values…).

---

For a lisp machine of yesterday running on Ubuntu or the browser: https://interlisp.org/

← PreviousPage 3 of 20Next →