Kali
1 program
Added 2026-03-11T23:50:28Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled
Evidence
Report issue
View issues
Aliases: Kali Scheme
Provenance: commit 18ceb65a05 · authored 2026-03-12T00:51:04+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Comrade Server
Provenance: commit 18ceb65a05 · authored 2026-03-12T00:51:04+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
; A comrade is a Kali process with no REPL.
;
; The idea is to provide Kali as a service.
; - add a line to /etc/inetd.conf to start comrades
; - add a line to /etc/services to get the port number
; - make a comrade image that talks to stdin and stdout, telling them
; the port on which it is listening for connections. Stdout should
; be redirected to stderr.
(define (start-comrade port-number)
(run-threads (make-comrade-event-handler
(lambda ()
(start-server (lambda (server-port)
(write-number-to-port-number server-port
port-number)))))))
(define (write-number-to-port-number n port-number)
(let ((channel (open-channel port-number (enum channel-status-option input)))
(string (number->string n)))
(channel-write string 0 (string-length string) channel)
(close-channel channel)))
(define comrade-quantum 200) ; thread quantum in msec
(define (make-comrade-event-handler initial-thunk)
(let ((runnable (make-thread-queue))
(thread-count (make-counter)))
(increment-counter! thread-count)
(exclusively-enqueue-thread!
runnable
(make-thread initial-thunk dynamic-env-link 'comrade-server)
'())
(save-base-fluid-env! (with-handler report-handler dynamic-env))
(round-robin-event-handler runnable
comrade-quantum
dynamic-env-link
thread-count
(lambda args #f) ; we handle no events
propogate-upcall ; or upcalls
wait)))
(define report-handler
(lambda (c next-handler)
(for-each display
`(#\newline
"HCC: in report-handler."
#\newline
" c: " ,c
#\newline
" next-handler: " ,next-handler
#\newline
" (error? c): " ,(error? c)
#\newline
" (interrupt? c): " ,(interrupt? c)
#\newline
" (current-thread): " ,(current-thread)
#\newline))
(force-output (current-output-port))
(next-handler)))