Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: My experience with Common Lisp. Is there a better way?
1 point by boxmonster 15 days ago | hide | past | favorite
I'm posting my experience hoping someone will tell me I'm doing it wrong and tell me a better way. I'm aware that I could use Racket or Clojure but I really wanted to try Common Lisp as a historically important language.

2 days ago I posted a link that looked really interesting as a fun way to learn Common Lisp. See https://news.ycombinator.com/item?id=29856110 or Sketch https://github.com/vydd/sketch

Turns out it was previously posted and got good feedback so I decided to try it. I use Windows. There were several Common Lisp installations to choose from. I choose Clozure because it appeared to be developed by Mac users, so I thought it might to have features I liked.

Clozure installation on Windows was fine. However, I ran into problems installing sketch because I had to build Simple Direct Media components https://www.libsdl.org/ and it wasn't clear ahead of time which ones. I didn't have MinGW, MSYS2 or Cygwin setup so instead I rooted around until I found SDL2.dll and libtiff.dll. Unfortunately, I couldn't find libffi.dll so had to build it. I installed MSYS2 but failed. Cygwin same thing. This is my fault as I never learned how to do this.

I installed Steel Bank Common Lisp without problem hoping it might have what Sketch needs but it doesn't

I gave up on Windows proper and installed WSL2 because I'm on a developers preview of Windows 11 and had read that it does graphics now. I installed Ubuntu 20 into it, but couldn't get it to work. I had the same problem building SDL.

I switched to my VMWare installation of Ubuntu 20 and failed there too, but I suspected there might be a conflict, so I installed a fresh copy of Ubuntu 20 in a new virtual machine.

It worked! Very nice. I can do graphics with Common Lisp.

I prefer not using VMWare so I am currently learning the difference between MSYS2, MinGW, Cygwin, and GnuMake32. I expect to have a Windows version working by the end of the day. I wondering if I should do a Docker image or maybe there is something better now? Last time I used Docker it seemed more difficult than it need to be.

// These are the steps I took to make it work on Ubuntu. I don't use Linux that often so I'm sure there is a better way like combining some of these commands

    // Install dev tools
    sudo apt-get update -y
    sudo apt install build-essential -y
    sudo apt-get install -y m4
    sudo apt-get install -y git
    sudo apt-get install -y libsdl2-dev
    sudo apt-get install -y libsdl2-image-dev
    sudo apt-get install -y libsdl2-ttf-dev
    sudo apt-get install -y curl

    // install Clozure
    git clone https://github.com/Clozure/ccl.git ccl-dev
    curl -L -O         https://github.com/Clozure/ccl/releases/download/v1.12.1/linu    xx86.tar.gz
    cd ccl-dev
    tar xf ../linuxx86.tar.gz
    sudo cp ./scripts/ccl64 /usr/local/bin
    cd /usr/local/bin
    sudo chmod +rwx ccl64
    sudo chown mike ccl64
    sudo chgrp mike ccl64
    sudo mv ccl64 ccl
    code . // start vscode
    put path to home ccl in var CCL_DEFAULT_DIRECTORY=/home/mike/ccl-dev
    cd ~/ccl-dev
    ccl to start REPL
    (rebuild-ccl :full t)
    (quit)

    // install quicklisp into ccl-dev
    curl -O https://beta.quicklisp.org/quicklisp.lisp
    ccl --load quicklisp.lisp      
    (quicklisp-quickstart:install)   
    (ql:add-to-init-file) 
    (quit)

    // start sketch
    cd to ccl-dev directory
    type 'ccl' to start Clozure REPL
    (load "quicklisp.lisp")       
    (ql:quickload :sketch)
    (ql:quickload :sketch-examples)
    (make-instance 'sketch-examples:hello-world)
    (make-instance 'sketch-examples:sinewave)
    (make-instance 'sketch-examples:brownian)
    (make-instance 'sketch-examples:life)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: