Skip to content

Instantly share code, notes, and snippets.

View svetlyak40wt's full-sized avatar
💭
Making Ultralisp.org

Alexander Artemenko svetlyak40wt

💭
Making Ultralisp.org
View GitHub Profile
@svetlyak40wt
svetlyak40wt / README.md
Created December 13, 2023 19:13
A fix for quicklisp-client making it work well with package-inferred-asdf systems

This patch fixes two problems:

  • Is that quicklisp is unable to load primary system's dependencies, which are subsystems of other primary system not mentioned in the quicklisp distribution's metadata. Issue quicklisp/quicklisp-client#139
  • When asdf system is known to ASDF, quicklisp client ignores it's dependencies and again, if the system depends on a subsystem of other primary system, ASDF can't load it and quicklisp client too.

How to reproduce the problem

For example, I have reblocks-ui-docs ASDF system. One of it's subsystems depends on reblocks/doc/example subsystem of other package-inferred system available from Quicklisp.

Checkout this repository somewhere:

curl -v http://dist.ultralisp.org
* Trying 172.67.169.20...
* TCP_NODELAY set
* Connected to dist.ultralisp.org (172.67.169.20) port 80 (#0)
> GET / HTTP/1.1
> Host: dist.ultralisp.org
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
@svetlyak40wt
svetlyak40wt / replies.md
Last active July 16, 2023 22:25
Some advices about Common Lisp in reply to the https://www.youtube.com/watch?v=jLkqYVTqM38&lc=UgxECAkwcplTdFWvwit4AaABAg comment

...saw all your videos until this day. Thanks so much, cleared up alot of questions! Best tutorials out there for getting a overview on workflows! Still struggling with a couple of things

  1. QLOT vs (push "./" asdf:central-registry) workflow often you (push "./" asdf:central-registry) in the repl. Here you use qlot and it does that automatically as I understand Then you start $qlot exec ros emacs

So my questions are

  • what is the right flow or do I need both often ?
(defun save-me (core-file)
"This function closes all threads and dumps image of SBCL into the core file."
(flet ((saver ()
(loop for thread in (sb-thread:list-all-threads)
unless (eql thread
sb-thread:*current-thread*)
do (sb-thread:terminate-thread thread)
finally (save-lisp-and-die core-file))))
(loop for thread in (sb-thread:list-all-threads)
when (string-equal (sb-thread:thread-name thread)
@svetlyak40wt
svetlyak40wt / README.md
Created June 16, 2023 15:19
A small test checking Tungsten Postgres Driver in fetching random records from WebframeworkBenchmars' database

Database hello_world contains table world with 10000 records and two columns id, randomnumber. Here we are fetching 5 records in a loop. Using Tungsten 100 loops took about 22 on my VPS, whereas similar code using CL-POSTGRES runs 100000 loops in 40 second on the same machine.

CL-POSTGRES code uses get-a-random-record defined like this:

(defun get-a-random-record (id)
  (declare (fixnum id))
@svetlyak40wt
svetlyak40wt / packages-finder.lisp
Created April 12, 2023 17:42
This code collects all packages, created by ASDF-SYSTEM and it's dependencies
;; This code collects all packages, created by ASDF-SYSTEM and it's dependencies
(let* ((asdf-system :cl-telegram-bot)
(packages-before (list-all-packages))
(packages-after (progn (ql:quickload asdf-system)
(list-all-packages))))
(sort (set-difference packages-after packages-before
:key #'package-name
:test #'string=)
#'string<
:key #'package-name))
(defun print-dependency-graph (system-name &key (level 0))
(loop repeat level
do (format t " "))
(format t "~A~%" system-name)
(typecase system-name
((or string symbol)
(let ((system (asdf/system:find-system system-name)))
(loop for dep in (asdf/system:system-depends-on system)
do (print-dependency-graph dep :level (1+ level)))))))
@svetlyak40wt
svetlyak40wt / cl-reex-examples.lisp
Created February 5, 2023 07:29
Examples of the CL-REEX Common Lisp library
(in-package :cl-user)
(defparameter *observer*
(rx:make-observer
(rx:on-next (x) (print x))
(rx:on-error (x) (format t "error: ~S~%" x))
(rx:on-completed () (print "completed")) ))
(defparameter *sequence*
* (kandria:launch)
WARNING: No server for :PORT: 4005
2023-01-15 14:01:42 [INFO ] <TRIAL.SETTINGS>: Loading settings from /Users/art/.config/shirakumo/kandria/settings.lisp
2023-01-15 14:01:42 [INFO ] <TRIAL.SETTINGS>: Saving settings to /Users/art/.config/shirakumo/kandria/settings.lisp
2023-01-15 14:01:45 [INFO ] <TRIAL.MAIN>: GENESIS
2023-01-15 14:01:45 [INFO ] <TRAIL.MAIN>: Launching version 1.0.0-458e21a
[CoreAudio] Matching default device sample rate 48000
[Harmony] Will use ORG.SHIRAKUMO.FRAF.MIXED.COREAUDIO:DRAIN for output (2xFLOAT @ 48000kHz)
STYLE-WARNING:
slot names with the same SYMBOL-NAME but different SYMBOL-PACKAGE (possible
(ql:quickload :40ants-doc-full)
(ql:quickload :polymorphic-functions)
(use-package :polymorphic-functions)
(define-polymorphic-function my= (a b)
:documentation "Test polymorphic function.")
(uiop:define-package #:40ants-doc-full/locatives/polymorphic-function
(:use #:cl)
(:import-from #:polymorphic-functions