← Home ← Back to /g/

Thread 106994238

311 posts 90 images /g/
Anonymous No.106994238 [Report] >>106995489 >>107015578 >>107015733 >>107020336 >>107030624 >>107031822 >>107034518 >>107055239
(λ) - Lisp and Emacs general
>Lisp is a family of programming languages with a long history and a distinctive parenthesized prefix notation. There are many dialects of Lisp, including Common Lisp, Scheme, Clojure and Elisp.

>Emacs is an extensible, customizable, self-documenting free/libre text editor and computing environment, with a Lisp interpreter at its core.

>Emacs Resources
https://gnu.org/s/emacs
https://github.com/emacs-tw/awesome-emacs
https://github.com/systemcrafters/crafted-emacs

>Learning Emacs
C-h t (Interactive Tutorial)
https://emacs-config-generator.fly.dev
https://systemcrafters.net/emacs-from-scratch
http://xahlee.info/emacs
https://emacs.tv

>Emacs Distros
https://spacemacs.org
https://doomemacs.org

>Elisp
Docs: C-h f [function] C-h v [variable] C-h k [keybinding] C-h m [mode] M-x ielm [REPL]
https://gnu.org/s/emacs/manual/eintr.html
https://gnu.org/s/emacs/manual/elisp.html
https://github.com/emacs-tw/awesome-elisp

>Common Lisp
https://lispcookbook.github.io/cl-cookbook
https://cs.cmu.edu/~dst/LispBook
https://gigamonkeys.com/book
https://lem-project.github.io
https://stumpwm.github.io
https://nyxt-browser.com
https://awesome-cl.com

>Scheme
https://scheme.org
https://try.scheme.org
https://get.scheme.org
https://books.scheme.org
https://standards.scheme.org
https://go.scheme.org/awesome
https://research.scheme.org/lambda-papers

>Clojure
https://clojure.org
https://tryclojure.org
https://clojure-doc.org
https://calva.io
https://clojure.land
https://www.clojure-toolbox.com
https://mooc.fi/courses/2014/clojure
https://clojure.org/community/resources

>Other
https://github.com/dundalek/awesome-lisp-languages

>Guix
https://guix.gnu.org
https://nonguix.org
https://systemcrafters.net/craft-your-system-with-guix
https://futurile.net/resources/guix
https://github.com/franzos/awesome-guix

>SICP/HtDP
https://web.mit.edu/6.001/6.037/sicp.pdf
https://htdp.org

>More Lisp Resources
https://lisp.nexus
https://rentry.org/lispresources

(set! prev-bread (quote >>106931744))
Anonymous No.106994327 [Report] >>106994421
Nice
https://github.com/lem-project/lem/blob/main/extensions/coalton-mode/coalton-mode.lisp
Anonymous No.106994343 [Report]
> new thread
fantastic and beautiful
Anonymous No.106994362 [Report]
emakkk
Anonymous No.106994421 [Report]
>>106994327
>Coalton and LEM
based
Anonymous No.106994502 [Report] >>107015561
>common lisp being slow for reading stdin
lmaoing
imagine having to write IO and buffer logic just to process some logs. Kudos on the monkey that posted that on the previous jej
Anonymous No.106995201 [Report] >>106995377
bruh
Anonymous No.106995235 [Report]
Again asking for help for this:
>>106987033

Some anon in last thread managed to get it working but we don't understand why it is not working for me
Anonymous No.106995377 [Report] >>106995401
>>106995201
Don't worry I'll mantain it when I learn enough Lem
Anonymous No.106995401 [Report]
>>106995377
it just killed all my expectations, someone who thinks webview is a good substitute for anything just cant make good things
Anonymous No.106995452 [Report] >>106995650 >>106996158 >>106996861
#!/usr/bin/env -S sbcl --script

(load "~/.sbclrc")

(require :sb-sprof)


(declaim (optimize (speed 3) (safety 0) (debug 0)))

(defun main ()
(declare (optimize (speed 3) (safety 0) (debug 0)))
(let ((i 0)
(line nil))
(declare (fixnum i)
(type (or string null) line))
(loop
do (setf line (read-line *standard-input* nil))
while line
do (incf i)
finally (format t "size: ~a~%" i))))

(eval-when (:execute)
(sb-sprof:with-profiling
(:max-samples 100000
:sample-interval 0.00001
:report :graph)
(main)))


It indeed wastes most of its time with UFT-8 conversion stuff. If I use (with-open-file (str file) :external-format :my-format ...) it goes faster, but then I can't use stdin.
Anonymous No.106995489 [Report] >>106999669
>>106994238 (OP)
no use case for lisp
Anonymous No.106995646 [Report]
>CIEL Is an Extended Lisp
https://ciel-lang.org
https://github.com/ciel-lang/CIEL
Anonymous No.106995650 [Report] >>106995930
>>106995452
Have you tried using read-byte instead and just treating the input as a raw binary?
Anonymous No.106995930 [Report]
>>106995650
but I need to run regex on it bruh
Anonymous No.106996158 [Report]
>>106995452
God the loop syntax is so fucking fugly
Anonymous No.106996861 [Report] >>106997006
>>106995452
I think I found the fastest approach for this, but its incompatible with stdin, is that strictly neccesary?
Anonymous No.106996925 [Report] >>107001835
Please give me GNOME 2 but written in Lisp (including REPL) thank you
Anonymous No.106997006 [Report] >>106997848 >>106997917
>>106996861
Ideally for scripts yeah, but what have you found?
Anonymous No.106997848 [Report] >>106997857 >>106998241 >>106999697
>>106997006
Ok so I tried everything under the sun
>streaming bytes
>buffers
>transducers
>alexandria
>fast-io

First of all my test was over a 1.5 GB log file from
https://github.com/logpai/loghub (HDFS_v1). I made a simple python benchmark to
check these regex over each line (not at the same time) using 'with open' and
'for line in f'.
<code>
HDFS_PATTERN = re.compile(r'^(\d{6} \d{6}) (\d+) (INFO|WARN|ERROR) ([^:]+): (.+)$')
BLOCK_PATTERN = re.compile(r'blk_-?\d+')
IP_PATTERN = re.compile(r'\d+\.\d+\.\d+\.\d+')
THREAD_PATTERN = re.compile(r'^\d{6} \d{6} (\d+)')
CLASS_PATTERN = re.compile(r'^\d{6} \d{6} \d+ (?:INFO|WARN|ERROR) ([^:]+):')
</code>

that got me these times
<code>
PYTHON
Log levels (11.2s): INFO 10.8M | WARN 363K
Blocks (10.2s): 575K unique
IPs (49.1s): 203 unique
Threads (9.3s): 27.8K unique, 11.2M total
Classes (9.9s): 9 unique
Top 5: FSNamesystem 3.7M | PacketResponder 3.4M | DataXceiver 2.5M
FSDataset 1.4M | DataBlockScanner 120K

</code>
in the end I had to use lparalel, splitting into chunks and mapping a regex over
each line in each chunk with a scanner defined by 'ppcre:create-scanner'
that got me these results:
<code>
LISP LPARALLEL
Log levels (5.4s): INFO 10.8M | WARN 363K
Blocks (10.2s): 575K unique
IPs (19.0s): 203 unique
Threads (3.3s): 27.8K unique, 11.2M total
Classes (4.2s): 9 unique
Top 5: FSNamesystem 3.7M | PacketResponder 3.4M | DataXceiver 2.5M
FSDataset 1.4M | DataBlockScanner 120K
</code>

Still that's pretty fucked, wasnt THAT complciated but still significantly more
involved than a sinelg python readline. This could probably be turned into a
library so you dont need to deal with it again though. And like I said, no
stdinput because we need mem access. I've simplified the script so it fits in here give me a sec.
Anonymous No.106997857 [Report]
>>106997848
lol fucked the code blocks my bad
Anonymous No.106997917 [Report] >>106998241
>>106997006
Didn't fit here:

https://pastebin.com/MxqFqgmV

so for example with the log entry you showed before,
>[22/Oct/2025:03:39:03 -0300] GET /url/path/9f37f23a-61f6-4cff-a38f-d900d93c7ce6/ HTTP/1.1 status=200 rid="cb3c45f3-d98c-43ce-bc29-a61571902381" host="host" forwarded_host="host" forwarded_for="ip1, ip2, ip3" referer="referer_url" ua="ua" res_bytes="74693" req_duration_s=0.3885111


you could use the pmap function there in the script to do something like this

;;; Extract HTTP status codes
(defun extract-status (line)
"Extract status code from: status=200"
(multiple-value-bind (match groups)
(ppcre:scan-to-strings "status=(\\d+)" line)
(when match (aref groups 0))))

;; Usage:
(pmap "access.log" #'extract-status)
;; Returns: #<HASH-TABLE "200" -> 1523, "404" -> 42, "500" -> 3>


;;; Extract IP addresses from forwarded_for
(defun extract-client-ip (line)
"Extract first IP from: forwarded_for=\"ip1, ip2, ip3\""
(multiple-value-bind (match groups)
(ppcre:scan-to-strings "forwarded_for=\"([^,\"]+)" line)
(when match
(string-trim '(#\Space #\Tab) (aref groups 0)))))

;; Usage:
(pmap "access.log" #'extract-client-ip)
;; Returns: #<HASH-TABLE "192.168.1.1" -> 523, "10.0.0.5" -> 234, ...>


Could probably turn it into a library at some point.
Anonymous No.106998241 [Report] >>106998355 >>106998355
>>106997917
>>106997848
that is so weird. I was never let down by CL's speed. This is such a silly use case and seems really weird to be so slow.

With-open-file with the appropriate external format gave me significant speedups, but it is still slower than python (probably there is a second or so to start sbcl, but still).
Anonymous No.106998355 [Report] >>106998533
>>106998241
>>106998241
Cant let go now, I have to know why this shit is so slow.
Anonymous No.106998533 [Report] >>106999137
>>106998355
I'll ask stackoverflow, there are some good lisp autism there
Anonymous No.106998809 [Report] >>107000542
what are you coding?
Anonymous No.106999137 [Report]
>>106998533
The problem is that sbcl strings are utf-32. I have to deal with this every year doing bigboys during AoC.
Anonymous No.106999669 [Report]
>>106995489
no use case for your brain
Anonymous No.106999697 [Report] >>106999730
>>106997848
Post your CL source code...
Anonymous No.106999730 [Report] >>107009963
>>106999697
dont '...' at me motherfucker bitch basterd
Anonymous No.107000542 [Report]
>>106998809
improved my Snake from last thread
https://0x0.st/K2jv.url
Anonymous No.107001117 [Report] >>107001629 >>107002683 >>107010013
Ok this is the fastest I could get it by cheating with all my might using lparallel and other shit to compete with the python read lol.

>CODE: https://pastebin.com/Ju4UM5vz

Ran it over 2.75GiB of spark logs consisting of 3,852 files. 33,236,604 lines. Tested these 2 regex:
(defparameter *simple-re* (ppcre:create-scanner "\\b(INFO|WARN|ERROR)\\b"))
(defparameter *complex-re*
(ppcre:create-scanner "^(\\d{2}/\\d{2}/\\d{2} \\d{2}:\\d{2}:\\d{2}) (INFO|WARN|ERROR) ([^:]+): (.+)$"))


Python simple read line results:
> uv run bench4.py "~/Downloads/sparklogs/"
Directory: ~/Downloads/sparklogs/
Files: 3,852
Total size: 2,941,224,304 bytes (2804.97 MB)

[0] Counting total lines...
Time: 2.754 seconds
Total lines: 33,236,604

[1] Simple regex (INFO|WARN|ERROR)...
Time: 12.375 seconds
ERROR: 11,259
INFO: 27,389,482
WARN: 9,595

[2] Complex regex (full log parsing)...
Time: 10.226 seconds
Matched lines: 27,406,384


SBCL parallelism on steroids:
> ./io-bench6.lisp "~/Downloads/test/"
Directory: ~/Downloads/sparklogs/
Files: 3,852
Total size: 2,941,224,304 bytes (2804.97 MB)

[0] Counting total lines...
Time: 1.930 seconds
Total lines: 33,236,604

[1] Simple regex (INFO|WARN|ERROR)...
Time: 5.848 seconds
INFO: 27,389,482
ERROR: 11,259
WARN: 9,595

[2] Complex regex (full log parsing)...
Time: 6.129 seconds
Matched lines: 27,406,384


Most of the actual code is the core processing functions, the rest is just boilerplate for the benchmark, had to:

>byte-based I/O (:element-type '(unsigned-byte 8))
>batch UTF-8 decoding (trivial-utf-8:utf-8-bytes-to-string)
>integer comparisons for newlines (= (aref buf i) 10)
>parallel processing with lparallel (lp:pmapcar)
>chunk-based file splitting (byte ranges)
>per-worker hash tables
>pre-compiled regex scanners (ppcre:create-scanner)
>skip partial lines at chunk boundaries
>single-pass merge at the end
>optimal tuning: 10 chunks, 10 workers

Which is fucking ridiculous, but was fun
Anonymous No.107001629 [Report]
>>107001117
It's really bizarre but I guess it makes sense that if there's anything CL would choke on it'd be UTF, which was invented and implemented long after it's original design.
Anonymous No.107001835 [Report]
>>106996925
Write it yourself.
Anonymous No.107002683 [Report] >>107002700
>>107001117
just for counting the lines in a given file, I created these programs:
(require '[clojure.java.io :as io])

(defn count-lines [filename]
(with-open [rdr (io/reader filename)]
(count (line-seq rdr))))

(println "Total lines: " (count-lines "HDFS.log"))

#!/usr/bin/env python3

with open('HDFS.log', 'r') as file:
line_count = sum(1 for line in file)
print(f"Total lines: {line_count}")

#!/usr/bin/env dart
import 'dart:io';
import 'dart:convert';

void main() async {
final file = File('HDFS.log');
int lineCount = 0;

await file.openRead()
.transform(utf8.decoder)
.transform(LineSplitter())
.forEach((_) => lineCount++);

print('Total lines: $lineCount');
}

Results:
Python version takes 3.3 seconds
Dart version takes 7.9 seconds
Clojure version takes 2.3 seconds from a REPL, 3.9 seconds when started from a command line, and 9.1 seconds via babashka
wc -l takes 0.4 seconds
Anonymous No.107002694 [Report] >>107003093 >>107003815 >>107057203
what do you guys think the next game changing lisp software is going to be?

I'm studying lisp game engines.
Anonymous No.107002700 [Report]
>>107002683
I'm the autist that started this, the line couting is just a bare minimum sanity check. I actually need to process a large amount of logs. The slowdown wasn't on my log parsing, ppcre or math, it was actually in read-line.
Anonymous No.107003093 [Report]
>>107002694
electric clojure is the only somewhat exciting new thing I can think of
Anonymous No.107003815 [Report]
>>107002694
Maybe when eval/apply is extended for QPUs
Anonymous No.107004013 [Report] >>107004169 >>107004694
Now I wonder if Coalton io library addresses any of this, it's being used for defense and quantum shit so surely they would address the bottleneck

https://github.com/coalton-lang/coalton/blob/main/library/file.lisp
Anonymous No.107004169 [Report] >>107004680
>>107004013
Maybe you've already done this but if you've identified read-line as the issue then it's defined here
https://github.com/sbcl/sbcl/blob/master/src/code/stream.lisp#L387
it dispatches to either s-%read-line or ansi-stream-read-line, at least under ansi-stream-read-line there are two comments for each path ansi-* can take:
;; Stream has a fast-read-char buffer. Copy large chunks directly
;; out of the buffer.
;; Slow path, character by character.
;; There is no need to use PREPARE-FOR-FAST-READ-CHAR
;; because the CIN-BUFFER is known to be NIL.
so read-line may be faster given a fast-read-char buffer (whatever that is), there's also likely some faster io functions that basically wrap fgets if we can find them
Anonymous No.107004680 [Report] >>107004866
>>107004169
I'll try installing CCL to see if it is also slow
Anonymous No.107004694 [Report]
>>107004013
who uses this?
Anonymous No.107004825 [Report] >>107005064 >>107007112
I need some guidance on understanding this guy's config:
https://codeberg.org/hako/Testament/src/branch/trunk/config/dorphine.org
1. What's all those <<>>? Placeholders? How does that work? Is it part of the "literate configuration" or something?
2. He uses (load "../common.scm"), aren't you supposed to "import" other files as a module with #:use-module ?
3. This snippet, the manual has a single instance of "compose" and I didn't understand, is nonguix-transformation-* a standard?
((compose (nonguix-transformation-nvidia)
(nonguix-transformation-linux #:linux (spec->pkg "linux@6.12")))

He also provides a nonguix ISO that comes with the Linux kernel already, in the default config.scm he uses
((compose (nonguix-transformation-guix)
(nonguix-transformation-linux))

The rest of the config.scm is the same and doesn't even mention anything else about using the default linux kernel (but it is).
How is that possible? Even the nonguix guide has the following
(use-modules (nongnu packages linux)
(nongnu system linux-initrd))

(operating-system
(kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))

The modified code is https://codeberg.org/hako/nonguix/commits/branch/installer

There's a bunch of interesting stuff I don't know how it works, it'd be much better without this literate config org bullshit and just have the code though.
I know it'd be better to just ask the guy but I'm shy and he's probably busy given how he even has blog entries on guix.gnu.org/en/blog/
Anonymous No.107004866 [Report] >>107004940
>>107004680
At some point all implementations will make a series of similar syscalls to read from a file, Lisp functions with the shortest codepath to those syscalls should be faster (sans any runtime stuff), so those are the functions to identify

I haven't read it closely but the stuff in fd-stream.lisp could be a candidate, it's basically the same as you'd write in C
https://github.com/sbcl/sbcl/blob/master/src/code/fd-stream.lisp
Anonymous No.107004940 [Report] >>107004964 >>107005165
>>107004866
(with-open-file ...) is at least 2x as fast. It seems to follow a slightly different path.
https://stackoverflow.com/questions/79799232/common-lisp-performance-issues-with-reading-lines-from-standard-input/79799403#79799403
Anonymous No.107004964 [Report]
>>107004940
In my case, with-open-file sucks, because I have a bagillion zipped logs. So I need to unzip, process, save result, delete log, aggregate, get the next one.

In python or perl this is just a matter of piping zcat.
Anonymous No.107005064 [Report] >>107005189
>>107004825
>1. What's all those <<>>? Placeholders? How does that work? Is it part of the "literate configuration" or something?
thats just noweb reference in org mode
open the file as raw
you will see source blocks delimited by #+begin_src and #+end_src
<<nig>> means pull whatever is in the block named nig, or concatenation of blocks with :noweb-ref nig and insert it here
https://orgmode.org/manual/Noweb-Reference-Syntax.html
all that shit eventually gets "tangled" (meaning written) to a separate file
Anonymous No.107005165 [Report] >>107005188 >>107006088 >>107006230
>>107004940
the problem is definitely with the bytes to string conversion
i wrote a poorly optimized program to read 1MB of data at a time and then search for byte = 10 (newline); ultimately it executed in between 9 and 11 seconds, while the loop for line version ran in around 40
but when i put sb-ext:octets-to-string to translate these bytes back to strings, the execution time jumped back to 40-something seconds
then you have shit like clisp where this takes minutes, and even decoding the bytes to ascii instead of unicode still yielded over 2 minutes of execution time

i would simply ask around on sbcl irc or the mailing list at this point
Anonymous No.107005188 [Report] >>107005463 >>107006088
>>107005165
I'll open a bug report.
Anonymous No.107005189 [Report] >>107005265
>>107005064
Ahhhh I clearly need to learn more about org then, still, this literate configuration shit is the definition of form over function, I don't think anyone benefits from that desu. The guy who made it doesn't need it (since he's the one who built it in the first place) and anyone looking at it would be utterly confused at all the back and forth in the code. What a damn waste of time.
Anonymous No.107005265 [Report]
>>107005189
>The guy who made it doesn't need it (since he's the one who built it in the first place)
its nice to describe config files sometimes, especially since you don't revisit them often. i can guarantee you (and he) won't remember anything in a few months
>this literate configuration shit is the definition of form over function
you need to have gigabrain like mr. donald knuth to handle it
there's a reason it hasn't taken off since the 80s; most people just want to skim, understand what they need to, and dip, instead of striving to deeply understand every aspect of the program

anyway you can literally just take this file, put it in a org buffer and run org-tangle; it will create dorphine.scm file you can read normally

though i would probably remove this shit
#+name: emacs-packages
#+begin_src shell :results output
grep '^;;guix:' ../files/plain/emacs-init.el | sed -E 's/^;;guix:(.*)/"\1"/g'
#+end_src

since it might execute something
Anonymous No.107005463 [Report] >>107005481
>>107005188
>cuck report
Anonymous No.107005481 [Report] >>107005525
>>107005463
Sometimes I like to imagine the life of someone who posts shit like this.
Anonymous No.107005525 [Report]
>>107005481
I-I think I found a bug… sorry if this is stupid


Hi… um, I hope it’s okay that I’m writing this. I’m not really sure if this is even a real bug or if I’m just doing something wrong, so please forgive me in advance if I’m wasting your time.

I was trying to do a very simple thing (probably something obvious) in Emacs—just opening a file and, um, moving the cursor around. But then… well… something weird happened? I think.

Here’s what I did, if it helps at all:

Opened Emacs.

Opened a file.

Tried to move the cursor using the arrow keys.

And then, um, nothing happened? Or maybe it moved once and then… stopped? I’m really not sure. My keyboard might be broken too, I don’t know.

I also tried typing some stuff, and Emacs… uh… kind of ignored it? Or maybe it didn’t. I really don’t want to bother you if it’s just me being dumb.

Emacs version: I think it’s the latest one? I might be wrong.
OS: My computer (sorry, I know that’s vague!)

Anyway… sorry again if this isn’t a bug. I just wanted to… um, report it, I guess. I really appreciate all the work you do and I feel bad even asking for help.

Thanks a lot. I’ll understand if you ignore this.
Anonymous No.107005540 [Report] >>107005698 >>107006685
Ah is just the schizo running the shitpost llm.
Kinda weird to see him in a fucking lisp thread
Anonymous No.107005698 [Report]
>>107005540
please stop you're making me (cum) I'm going to emacs if you don't stop
Anonymous No.107006088 [Report] >>107006253 >>107006309 >>107007089
>>107005165
>>107005188
Apparently there is something funky with *standard-input* and read-line. I'm not very good with this low level stuff.
(defun main ()
(let ((stdin (open "/dev/stdin")))
(loop for line = (read-line stdin nil)
while line)))

Seems to have made it fast. It is a workaround and there is a maintainer working on a permanent change..
Anonymous No.107006230 [Report] >>107026937
>>107005165
I've never understood mailing lists, it it simply a long chain or emails and replies? Any tips on interacting with that shit? I've wanted to contribute to emacs and some sourcerepos but mailing lists and patches filter me out hard.
Anonymous No.107006253 [Report] >>107006621
>>107006088
Damn, nice.
Link to the issue or where this shit is being tracked?
Anonymous No.107006309 [Report] >>107006621
>>107006088
so with write-line it went down to around 4 seconds, that's still 2 seconds slower than python
but good enough i guess
just avoid using print for strings, it's 4 seconds vs over 20
Anonymous No.107006621 [Report] >>107007187 >>107017101
>>107006253
>>107006309
https://bugs.launchpad.net/sbcl/+bug/2129811
Anonymous No.107006685 [Report] >>107006738
>>107005540
someone made a schizo bot? Or it is a schizo that generates shitposts with llms?
Anonymous No.107006738 [Report] >>107006753
>>107006685
Schizobot, basedjakwiki.org/Main_Page/Featured_Gem/Article
Replace onions with you know what.
Anonymous No.107006753 [Report]
>>107006738
so depressing... dead internet is not longer a theory.
Anonymous No.107007089 [Report] >>107007129
>>107006088
>loop
Anonymous No.107007112 [Report]
>>107004825
>2. He uses (load "../common.scm"), aren't you supposed to "import" other files as a module with #:use-module ?
if you see the common.scm file you would see that it doesn't define a module, so use-modules wouldn't work here. plus, to use a module it needs to be in %load-path. so what he's doing is simpler.
Anonymous No.107007129 [Report] >>107007146
>>107007089
Shut the fuck up. Yes, it can get ugly as sin, but it's standardized, it's fast and it works.
Anonymous No.107007146 [Report] >>107007196
>>107007129
imagine how much better CL would be if it standardized TCO
Anonymous No.107007187 [Report]
>>107006621
Still on this autisme, look at the SBCL code for the benchmarks game:https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/knucleotide-sbcl-6.html
They do their own IO autism.

read-in-data-chunked and others at the end.
Anonymous No.107007196 [Report]
>>107007146
It would become strictly less portable for no concrete gain. No thanks.
Anonymous No.107007468 [Report] >>107007542 >>107007608 >>107007952 >>107007989 >>107008465 >>107009033 >>107009166 >>107014786
what is your favorite data structure?
Anonymous No.107007542 [Report] >>107007717
>>107007468
The list.
Anonymous No.107007608 [Report] >>107008474
>>107007468
Alist + Vector.
Makes more sense to me to treat data in a columnar fashion.

'(("key1" . #(vector-data))
("key2" . #(more-data)))


Or
(("id" . #("1" "2" "3"))
("name" . #("Alice" "Bob" "Charlie"))
("age" . #(25 30 28)))
Anonymous No.107007717 [Report]
>>107007542
lel. Ironically every data type can turn into a list.
Anonymous No.107007952 [Report]
>>107007468
hash map
Anonymous No.107007989 [Report]
>>107007468
space partitioning trees (linked lists)
Anonymous No.107008465 [Report]
>>107007468
Bloom filters.
Anonymous No.107008474 [Report]
>>107007608
Why not plists?
Anonymous No.107009033 [Report]
>>107007468
n-negree tensor flow markov chains of spirographic eigenvalues
Anonymous No.107009166 [Report]
>>107007468
Ballistic skipgraph
Anonymous No.107009963 [Report]
>>106999730
>dont '...' at me motherfucker bitch basterd
(declare (fuck-you 3))
Anonymous No.107010013 [Report] >>107010022 >>107010078 >>107011287 >>107011773 >>107012247
>>107001117
>ppcre:create-scanner

Guys.
CL-PPCRE was never a high performance library. For example, it doesn't compile to machine code, which is silly considering that CL makes this task fairly easy.

You might want to try this library which is forty times(40x) faster than CL-PPCRE:

https://github.com/telekons/one-more-re-nightmare
Anonymous No.107010022 [Report]
>>107010013
Nice, not the original log autist but I'll check it out.
Anonymous No.107010078 [Report] >>107010237 >>107012441 >>107028221
>>107010013
Man I really want to learn how to write FAST AS FUCK code in CL, 98% of the time it's not needed, but when you're making things that you actively use and expect feedback, a second is an eternity.
Anonymous No.107010237 [Report]
>>107010078
the secret to fast code is in your heart <3
Anonymous No.107010597 [Report]
One thing I miss about sbcl when working with Julia is how fast the sbcl compiler is. I'm never waiting too long for the REPL to become responsive with sbcl, but Julia REPLs can take a while to warm up, especially at the beginning of a session.
Anonymous No.107010605 [Report]
Anonymous is now recruiting for the sacred anime hokage code projects. We are building the matrix using the SICP scheme. It will house the new reality. The new kingdom. Far better than meta facebook. We will have lambda and anonymous functions with tail call optimizations as well.

This project needs the greatest minds of 4chan and goon motivation to have constant sex in the new hokage anime matrix.
Anonymous No.107010715 [Report] >>107011044
org mode abuse
Anonymous No.107011044 [Report] >>107015085
>>107010715
what's that
> - elisp(...)
part? is it an in-line codeblock?
Anonymous No.107011287 [Report]
>>107010013
>applied-langua.ge
Into the trash it goes.
Anonymous No.107011773 [Report] >>107011802
>>107010013
>not perl compatible
>written by a tranny
no thanks
Anonymous No.107011802 [Report]
>>107011773
Trannies have started to infest the CL community.

Worst thing is, they spend all their time talking about Smalltalk instead.
Anonymous No.107011816 [Report] >>107011838 >>107011889 >>107012249 >>107014786
Do you write all your config files in org or is it a waste of time?
Anonymous No.107011838 [Report] >>107011889
>>107011816
IMHO it's a waste of time. outline-minor-mode is more than sufficient for organizing your init file.

If it gets REALLY big, consider splitting it into multiple files.
Anonymous No.107011889 [Report] >>107012249
>>107011816
>>107011838
I write in org. It allows me to not only configure emacs, but also other linux programs I use, I write their config files in the same org file.
Anonymous No.107012184 [Report]
just spent like 6 hours trying to run lem on windows without success
Anonymous No.107012247 [Report] >>107014786 >>107028191
>>107010013
CL-PPCRE is fast. stop Bullshiting.
Anonymous No.107012249 [Report]
>>107011816
I initially wrote my emacs config in org, but switched to plain .el files very quickly. Yeah it's a waste of time with no real benefit, and more importantly it adds another layer of clunky shit that can break.

If you want all your system config in one place like >>107011889 though, I can see the appeal.
Another reason would be if you're a youtuber or something and want to document stuff for your audience (distrotube uses .org files for everything including his config)
Anonymous No.107012441 [Report]
>>107010078
It's mostly about avoiding allocations and doing proper type annotations.
Anonymous No.107012517 [Report] >>107012644
logtard here, I give up. I will just use python for this. Python re module and IO, I kneel....
Anonymous No.107012644 [Report]
>>107012517
there's always Clojure, sir
Anonymous No.107012916 [Report] >>107013031 >>107013084 >>107014049 >>107014745 >>107017508
Kind of a general programming complaint but I've tried to get into Clojure and Lisp for a while now but I always seem to yearn for something easy like python or C# when I want to cobble something together easily.

It just feels kind of hard trying to reason about things in a way where things are functionally pure/immutable. Doesn't hut that you're also supposed to use Emacs which I just find kind of painful to use since it's so slow and you can't click on stuff like vscode. It's to the point where I'm genuinely thinking about just using C to do stuff since it's easy to compile, widely used, and has a ton of libraries for any use case.

What am I doing wrong?
Anonymous No.107013031 [Report]
>>107012916
VScodium has calva and other parens handling utilities for it. A large portion of clojurians use vscodium on a daily basis.
Anonymous No.107013084 [Report]
>>107012916
>It just feels kind of hard trying to reason about things in a way where things are functionally pure/immutable.
It's true, it is extra effort during the initial writing process, and only really pays off later when you want to make changes. It also took me some practice to get into the mindset of doing things functionally. FP lets you achieve things by writing a lot less code, though.
CL has good support for imperative programming.
>you're also supposed to use Emacs
VScode and IntelliJ have good Clojure support nowadays. There's also neat additional tools like FlowStorm.
>thinking about just using C to do stuff
not trying to dissuade you here, but I find using C to do anything to be a pain. It takes huge amounts of code to do anything, and compiling any non-trivial program is incredibly complex compared to Clojure (or any other language I've used).
Anonymous No.107014049 [Report] >>107014364
>>107012916
>Doesn't hut that you're also supposed to use Emacs
Emacs is great, but it's not mandatory.
https://lispcookbook.github.io/cl-cookbook/editor-support.html
Anonymous No.107014364 [Report]
>>107014049
Reminds me of the Casio AI-1000 https://www.youtube.com/watch?v=H-yuZ2pejGU
Anonymous No.107014551 [Report] >>107014685
Any of you tried cakelisp? It's more C then lisp but I like it. C and Lisp are the two most beautiful languages so something like this which combines them can be really interesting. I know lispers are always going on about how static typing ruins the dynamism of lisp but I never bought that especially for a systems language like C it's the most convenient way to tell at which stack offsets function variables should be.
Anonymous No.107014685 [Report]
>>107014551
>C and Lisp are the two most beautiful languages so something like this which combines them can be really interesting
Agreed.
That's why Pre-Scheme and Chicken Scheme's CRUNCH are very promising.
https://prescheme.org
https://www.more-magic.net/posts/crunch.html
Anonymous No.107014745 [Report]
>>107012916
you're yet to get burned by mutable state in a big project, then you will write mostly functional code no matter the language
Anonymous No.107014760 [Report] >>107015719
Anyone with a running Guix VM try installing and running Niri on it? All I'm getting is a black screen and I have no idea why.
Anonymous No.107014786 [Report] >>107014886
>>107012247
>didnt read this and previous thread
>>107011816
init.el only
>>107007468
a c struct. i just like its simplicity.
Anonymous No.107014876 [Report]
When you use fixed-size arrays with fill pointers in CL (SBCL specifically) are objects that are beyond the fill pointer garbage collected?
Anonymous No.107014886 [Report]
>>107014786
>>didnt read this and previous thread
it seems like you didn't either
Anonymous No.107015085 [Report] >>107015866
>>107011044
elisp links in org can execute code when opened.

https://sachachua.com/blog/2024/01/yay-emacs-using-elisp-links-in-org-mode-to-note-the-time-and-display-messages-on-stream/
Anonymous No.107015091 [Report] >>107015230
is emacs a man or a woman
Anonymous No.107015230 [Report]
>>107015091
emac is love
emac is life
emac is my waifu
Anonymous No.107015561 [Report]
>>106994502
qrd?
Anonymous No.107015578 [Report] >>107016020
>>106994238 (OP)
>Guix
Didn't these guys try to backstab Stallman and split GNU with their GNU Assembly thing?
Anonymous No.107015719 [Report]
>>107014760
Niri doesn't work without hw acceleration lmao what the fuck.
Anonymous No.107015733 [Report] >>107015767
>>106994238 (OP)
I am attracted to Lisp but I am not exactly sure why.
Anonymous No.107015767 [Report] >>107020743
>>107015733
its very curvy and sexy
Anonymous No.107015866 [Report] >>107015921
>>107015085
very hacker-spirited I love it
is there an emacs or orgmode manual page detailing this?
Anonymous No.107015921 [Report] >>107015986
>>107015866
(info "(org) External Links")
Anonymous No.107015986 [Report] >>107016283 >>107016333 >>107016363
>>107015921
thanks. that's so out of the ordinary tho. who would expect or want the `elisp:` link type (which, on top of existing, indeed executes the elisp code, when clicked on) -- like what
Anonymous No.107016020 [Report]
>>107015578
This is a very old drama. Many of these anti-RMS guys aren't even Guix maintainers anymore.
Also, Stallman is cool, but not everyone in the Lisp World worships him (like the Symbolics fans). Likewise, I'm more of a John McCarthy fan myself.
Anonymous No.107016252 [Report] >>107016477
i wish every program had a good hooking system like emacs
Anonymous No.107016283 [Report]
>>107015986
Web pages have JavaScript links. Why can't org documents have Elisp links.
Anonymous No.107016333 [Report] >>107016561
>>107015986
hyperbole takes this idea and runs with it. it allows you to make links like that (called buttons in hyperbole) anywhere and run them when clicked. it offers different types of buttons too
Anonymous No.107016363 [Report]
>>107015986
>(which, on top of existing, indeed executes the elisp code, when clicked on)
that's just how normal links in emacs work
you can even bind different functions to all of the mouse buttons when you click + yet different actions when you press keys with the point on the link
Anonymous No.107016477 [Report] >>107016516
>>107016252
>good hooking system like emacs
how 2 redeem hookers with emac sir?
Anonymous No.107016516 [Report]
>>107016477
ask xah
Anonymous No.107016527 [Report]
there are a lot of functions that jump to C when you go to definition. wasnt there a project about rewriting a lot more of those core functions in elisp?
would that make emacs even more hypothetically portable? since it would be easier to make an elisp interpreter if elisp was bootstrapped, the actual core language being very sparse. then you could have an interpreter in, or on all sorts of weird shit. webasm, custom minimal OSes, or in the browser with js not even using webasm.
Anonymous No.107016561 [Report] >>107016587
>>107016333
I liked Hyperbole but it suffers from being nearly as old as GNU Emacs itself. It's very buggy and probably does way too much.
Anonymous No.107016586 [Report] >>107016712
ESS is actually quite nice.
Anonymous No.107016587 [Report] >>107016628 >>107016749
>>107016561
>It's very buggy
haven't had any problems so far but that wouldn't surprise me too much
>and probably does way too much.
that's one of the things i like about it, it's like the emacs of emacs packages
Anonymous No.107016628 [Report]
>>107016587
>it's like the emacs of emacs packages
isn't this actually Gnus?
Anonymous No.107016712 [Report] >>107016796
>>107016586
>ESS
what's this
Anonymous No.107016749 [Report] >>107016775
>>107016587
I think the problem is how aggressive it is. It just took a bunch of shit over iirc. I did some very nice stuff with it though.
>implicit link type to open a video in mpv at a certain time stamp, it looked something like "~/video.webmT+00:10:00"
>using explicit links to build a doom wad launcher which actually integrated nicely with org mode, picrel. every wad listed here would launch the appropriate source port with the appropriate arguments
But it just ended up being too jank and breaking every other update.
Anonymous No.107016775 [Report]
>>107016749
Oh, and the personal button feature was nice. It's bookmarks on steroids and actually integrated decently with Vertico.
Anonymous No.107016796 [Report]
>>107016712
Emacs Speaks Statistics, mostly for R but it supports other langs.
Anonymous No.107016810 [Report] >>107017006
How the heck do you use org-roam? I just create a bunch of notes. Is this supposed to be any different than saving a bunch of files? how?
Anonymous No.107017006 [Report] >>107017081
>>107016810
you're supposed to link the files together. and normally each file represent a single idea, so there should be a lot links between the files as the number of ideas grows
Anonymous No.107017081 [Report] >>107017091 >>107017160
>>107017006
how do I do this, is there a blog that shows this?
Anonymous No.107017091 [Report]
>>107017081
just use your head and start doing something.
if you dont have any ideas to organize it's not going to help you
Anonymous No.107017094 [Report] >>107026658
My first clojure (and lisp) program. Do you guys see if there is anything glaringly wrong here?

https://pastebin.com/RNJ7eyt8
Anonymous No.107017101 [Report]
>>107006621
>https://bugs.launchpad.net/sbcl/+bug/2129811
>A workaround might be available: depending on your OS and use case, you could do
>(setq *standard-input* (open "/dev/stdin"))
>But note that the semantics of "/dev/stdin" differ in ways that could conceivably matter between Linux and other Unices, so this is just a suggestion.
>That it's a synonym stream (to a bivalent stream) also slows it down.
>In my measurements, READ-LINE on a bivalent input stream is about 9x
>slower than on a character-only stream, and each level of composite
>stream adds another roughly 3x. [Edit: this is for reading lines with
>an average length of 70. Obviously, these numbers will vary with
>line length.]
>Additionally, and counterintuitively, READ-SEQUENCE into a string
>is slower than READ-LINE on builtin streams that have no CIN buffer
>than on character-only, input-only FD-STREAMs. [Edit: same inputs as
>I'm using to measure READ-LINE.]
>Anyhow, I've been working on this recently, and it's ready enough
>for review (just 2 commits at the moment):
>https://github.com/kreuter/sbcl/commits/read-some-chars/
>For the stream types I've covered, that approach makes READ-LINE,
>READ-SEQUENCE into a string between 3.75x and 130x faster than
>in 2.5.5 (an arbitrary baseline I had around). Bivalent UTF-8/linefeed
>streams are still 2.75x slower than character-only ones, but further
>optimization is probably possible.
>FWIW, with (open "/dev/stdin") and the same sample.txt, I find the SBCL script to take between 50% and 65% the runtime of the Python on FreeBSD and MacOS x86-64, and in a Debian x86-64 VM. Can't explain this difference in our findings.
This is how you get the attention of retired CL devs huh
Anonymous No.107017160 [Report]
>>107017081
if you're talking about the dividing ideas part, look up "zettelkasten", there's plenty of blogs about it. if you're talking about linking files in org-roam, you have to select some text, press M-x org-roam-node-insert (you should bind a key to this command), and type the name of the node (i.e. file) you want to link to
Anonymous No.107017508 [Report] >>107017770 >>107018654
>>107012916
Something I forgot to mention here is that I don't really feel any particular allure towards programming for the sake of it. I always have to have a project with some overarching goal.

The problem, then, is that the projects I work on for class or for pleasure usually force me to work with one programming language or another. I also think that I have a mental block or something that makes me feel too tired to actually do anything in between working on these things.

So I suppose I'm lamenting how I don't really have the time to actually program in lisp?
Since another thing is that most of the langs in the lisp family don't really have tools that make compilation or whatever braindead. You kind of have to do some set up for Clojure, etc (build-deps) that you don't necessarily have to with more pedestrian langs.

Though I suppose this also winds up being a question of how I want to develop my skills as well. A rather powerful mentor I speak with says that ultimately things like getting good with algorithms and knowing how to implement your own efficient versions of things doesn't really matter since libraries exist to handle these aspects of your 'ware, and that ultimately what matters is the end result. And I suppose that this is true, provided that one follows best practices so that the software can more easily be modified and extended, but at the same time feels like a cheap answer since it feels like I'm eschewing a deeper understanding of logic and lower level details in favour of short term gains.
Anonymous No.107017770 [Report]
>>107017508
>A rather powerful mentor I speak with says that ultimately things like getting good with algorithms and knowing how to implement your own efficient versions of things doesn't really matter since libraries exist [...] but at the same time feels like a cheap answer since it feels like I'm eschewing a deeper understanding of logic and lower level details in favour of short term gains.
There's a power to pragmatism but the curry-howard isomorphism shows your intuition regarding logic is (provably) correct, which helps to verify your program (for example, a library)
Anonymous No.107018599 [Report] >>107018910
is there a book about reading other peoples codes?
Anonymous No.107018654 [Report]
>>107017508
> I also think that I have a mental block or something that makes me feel too tired to actually do anything in between working on these things
i spent a lot of time always feeling awful about this but i think it really might be a universally-suffered human quality. except for like napoleon etc. there ARE exceptional people, but 99% of people have this mental block.
>doesn't really matter since libraries exist to handle these aspects
i think this is basically true in real practical cases. the other thing about real practical cases is that your brain is in "work mode", which is a type of pain. you do things more effectively sometimes because youre trying to just get done with them and get to the result and just get to the Next Thing already, like dinner or sleep. it's not the same as slowly chipping away at some hobby thing in a relaxed manner. hobby things dont get done unless you activate "work mode" for them, which again, demands something of you (humans are aggressively lazy), and it's all the more demanding without incentives like pay or even sex or anything. so you kind of just do less of it. tragic but the ideal stage of life is being young and in school where you have a balance of all this shit, higher reward feeling, where you can "just do" stuff. it's a transitory stage and you cant ever get it back. getting old is kind of like dying in that way.
Anonymous No.107018910 [Report] >>107018930
>>107018599
>book about reading other peoples codes
https://www.amazon.com/Art-Mastering-Other-Peoples-Code-ebook/dp/B0DHY7Y2W6
Anonymous No.107018930 [Report]
>>107018910
just like other peoples code, I don't know this language xD
Anonymous No.107020336 [Report]
>>106994238 (OP)
In c this is just
rotateball();
Anonymous No.107020574 [Report]
New org-social: https://en.andros.dev/blog/4e12225f/why-your-socialorg-files-can-have-millions-of-lines-without-any-performance-issues/
Anonymous No.107020743 [Report] >>107022456 >>107023805
>>107015767
I've been "working" on (mostly just fantasizing about) a PL-inspired game and for Lisp the concept is a curvy green-haired woman, similar to Palutena and Rhea.
>forever 17
>friendly primordial goddess vibes
>also secondary subtle eldritch horror vibes
>wears absolutely nothing by default, light_censor, convenient_censoring, floating parens censor, a robe made from parens-like ribbons (arranged horizontally like waves)

C is a skinny black-haired girl in a black hoodie with blue accents.
Forth is a short red-haired (twin braids or drills) girl wielding a huge hammer.
Anonymous No.107021871 [Report]
Anyone know how I could locally store every entry on https://planet.emacslife.com?

Want something to skim, search and read through offline.
Anonymous No.107022120 [Report]
Alright, time to get off my ass and get my packages to MELPA.
中出し No.107022456 [Report] >>107023344
>>107020743
https://next.rikunabi.com/journal/20160215_t21_iq/
Anonymous No.107022955 [Report]
Thoughts on this? I'm currently using it for duckdb-sql src blocks but got the idea of making it into an expandable registry for org source blocks

name: org-babble
description: programatic access to babel src blocks through elisp

The idea is to:
- Import named source blocks from org files into a registry either by name or the entire file
- Execute blocks programmatically with parameters from Elisp
- Generate Elisp functions automatically from blocks
- Semi-literate programming (disle -> define src blocks and use elisp to program their deployment.

It started by me wanting to have proper syntax highlight in elisp scripts/functions that used some non-elisp code execution, like shell commands or sql execution from commandline, initialy I got it working with sql blocks but then I realized this could be used for any src block, so now I'm working on making it a general framework.

It's currently working with my other package ob-duckdb and can use it like this:

;; 1. Write blocks in org file (queries.org)
;; #+NAME: get-users
;; #+HEADER: :var country="US"
;; #+begin_src duckdb-sql ...

;; 2. Import
(org-babble-import "queries.org")

;; 3. Execute
(org-babble-execute "get-users" :country "JP")

;; Or generate functions
(org-babble-import-from "queries.org" :as :functions :prefix "db-")
(db-get-users :country "JP")
Anonymous No.107023344 [Report]
>>107022456
why is short-haired patchouli fighting anchovy from girls und panzer
Anonymous No.107023805 [Report]
>>107020743
Cute anon
Anonymous No.107024228 [Report] >>107024815 >>107028262
What do you anons think about CLIM?
Anonymous No.107024637 [Report] >>107024681 >>107024944 >>107026008 >>107028289
Don't you guys sometimes miss a modern-looking UI and that kind of stuff?
I've been toying around with Sublime and even vscode and sometimes the eye candy really helps a lot and I end up missing it whenever I open Emacs again
Anonymous No.107024681 [Report]
>>107024637
No, I abhor modern GUI aesthetics and everyone who implements them.
Anonymous No.107024815 [Report]
>>107024228
Overhyped garbage, the CL community needs to stop forcing that (and many other) meme and actually write working software.
Anonymous No.107024944 [Report] >>107025281
>>107024637
What kind of eye candy are we talking about any examples?
I've used vscode before and too me it just seemed like any other editor nothing special really.
Anonymous No.107025281 [Report]
>>107024944
I have one good example that is bothering me a little bit lately: Shift+k, which shows hover info on the type of the variable or the function signature and an example and that kind of stuff. It looks a little cooler on both vscode and Sublime, even on Neovim.
Not very important, pretty much a non problem, but yeah.
Anonymous No.107025374 [Report] >>107025479 >>107025573
Setting (service home-bash-service-type) causes XFCE to reset it's icon theme from elementary-xfce-dark to Adwaita, despite Adwaita not even showing up in the icon/theme selector. It also locks you out from changing the icon/overall theme, when you click the options they do nothing and that does not get reversed if you remove the service.

To reproduce you just have to
1. Check your current theme with xfconf-query -c xsettings -p /Net/IconThemeName
2. Add (service home-bash-service-type) to your home config and reconfigure
3. Check how the theme changed to Adwaita, you're also unable to revert it back (or change at all).

Everything I could find is mainly aimed at normal distros so the solutions don't work, also it's a pretty bad thing because ideally you'd setup your bashrc in the config file.
Anonymous No.107025479 [Report]
>>107025374
Oh, I figured it out.
Running XFSETTINGSD_DEBUG=1 xfsettingsd --replace --no-daemon and trying to change the theme gives me this
"(xfsettingsd:1417): dconf-WARNING **: 16:16:06.258: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files"
It turns out.... XFCE doesn't come with dconf preinstalled. I don't know what the home service triggers but it resets XFCE and makes you unable to change it back since well, it can't communicate it to dconf.
Someone should report that...not me of course...
Anonymous No.107025573 [Report] >>107025622
>>107025374
>Setting (service home-bash-service-type)
well what did you set it to? the service sets your variables and bash_profile and stuff, so it's important to know the values you specified
Anonymous No.107025622 [Report]
I just got banned for ban evasion on a shitpost what the fuck have the jannies gone insane?
>>107025573
Yes, I know. I've spent hours trying to figure out what
the fuck I was doing wrong, commenting out sections of my config and reverting back the VM to a clean slate (because once the theme changes it wouldn't change back).
I literally meant (service home-bash-service-type), I tried commenting out sections of it but they all resulted into the icons missing, so i ended up literally just enabling it and it still made them go away.
Anonymous No.107025761 [Report] >>107026115
I hate OOP but I'm seriously considering CLOSmaxxing for my next CL project just because.

What am I in for?
Anonymous No.107026008 [Report]
>>107024637
no, I use Emacs in terminal mode and I wish I could do the same with vscode.

Microsoft apps USED to be good in how snappy and responsive the GUI was, but they fucked all of that up more and more in recent releases. In Windows 11, they even replaced good ol' Notepad with a slow, bloated markdown editor that has the same sluggish UX as websites with too many React elements, forcing me to fall back to use edit.exe in a terminal when I'm at somebody else's PC and need to edit a file.
Anonymous No.107026042 [Report] >>107026136 >>107026621 >>107026674 >>107027975 >>107028243 >>107031430
Master, forgive me, but I'll have to go all out... Just this once
GENERATING TEST DATA: https://pastebin.com/Duha7ZwG
CODE: https://pastebin.com/nsfVC5nU

> 1.1 GB, 3 million line log file with entries such as the ones described by logtard originally.

RESULTS:
~SCRIPTS time cat ./logs.txt | ./cl-io-bench-test.lisp

Processing HTTP logs from stdin...
Total lines: 3,000,000

Methods:
PATCH: 600,434
DELETE: 599,597
POST: 600,585
GET: 599,017
PUT: 600,367

Status Codes:
401: 249,510
404: 250,013
201: 249,624
204: 250,136
500: 250,247
200: 250,048
301: 250,069
503: 250,208
302: 249,946
403: 249,460
502: 250,422
400: 250,317

Top 10 IPs:
187.78.94.121: 2
121.134.77.202: 2
221.33.54.71: 2
224.150.235.192: 2
171.29.251.220: 2
106.64.20.219: 2
8.20.104.83: 2
127.192.79.233: 2
75.180.73.157: 2
86.73.2.249: 2
Evaluation took:
5.282 seconds of real time
5.278661 seconds of total run time (5.167399 user, 0.111262 system)


For reading file as fast as possible:
#!/usr/bin/env -S sbcl --script

(declaim (optimize (speed 3) (safety 0) (debug 0)))

(defun count-lines ()
(let ((buffer (make-array 65536 :element-type '(unsigned-byte 8)))
(count 0))
(declare (type fixnum count))
(with-open-file (stream "/dev/stdin" :element-type '(unsigned-byte 8))
(loop
(let ((bytes-read (read-sequence buffer stream)))
(when (zerop bytes-read) (return count))
(loop for i from 0 below bytes-read
when (= (aref buffer i) 10)
do (incf count)))))))

(format t "Lines: ~:d~%" (time (count-lines)))


>3 Million lines: 0.490 s
>10 Million lines: 1.658 s

Learned a lot:
>Read bytes, not characters
>NO regex - Direct byte comparisons (73 78 70 79 for "INFO")
>Zero allocations in loops - Reuse fixed buffers, only allocate strings for final results, not intermediate processing
>Chunked read-sequence - 64KB blocks with buffer reuse is optimal
Anonymous No.107026115 [Report]
>>107025761
imo the pinnacle of doing OOP shit, It's good, great even.
I was also reluctant to do it but generics won me over.
Anonymous No.107026136 [Report] >>107026199
>>107026042
>Direct byte comparisons
that only works reliably in the 7bit ascii range, or maybe not even that if the encoding is something like utf32
Anonymous No.107026199 [Report]
>>107026136
Such is the nature of optimizing above all else, fun times though, didn't even know half of this shit when anon asked originally.
Anonymous No.107026506 [Report] >>107027462 >>107027975
Bitwise operations in CL are surprisingly confusing.

How the FUCK do I do a logical right shift? The standard ASH function does arithmetic shifts only.
Anonymous No.107026621 [Report]
>>107026042
impressive
Anonymous No.107026658 [Report]
>>107017094
>https://pastebin.com/RNJ7eyt8
looks fine 2 me
Anonymous No.107026674 [Report] >>107026809
>>107026042
#!/usr/bin/env perl
use strict;
use warnings;

my $log_rx = qr/\[(\d{2}\/[a-zA-Z]{3,4}\/\d{4}):([^ ]+) [+-]\d{4}\] ([A-Z]+) ([^ ]+) HTTP.*?status=(\d{3}).*?forwarded_for="([\d.]+)(?:,.*?)?".*?req_duration_s=([\d.]+)/;

my $filter_rx = qr/(?:hooks:|\/static\/|\[INFO\]|\/media\/|favicon\.ico)/;

my $uuid_rx = qr/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;

sub normalize_url{
my ($url) = @_;

$url =~ s/\?next=//;
$url =~ s/$uuid_rx/{UUID}/;
$url =~ s/\d+(?=\/|$)/{ID}/;
$url =~ s/\?.*/{PARAMS}/;
return($url);
}

sub process_fwf{
my ($fwf) = @_;
return shift @{[split(/,/,$fwf)]};
}

while (<>) {
/$filter_rx/ and next;

chomp;

/$log_rx/ or next;
print join("\t", $1, $2, $3, normalize_url($4),$5, $6, $7), "\n";
}
Anonymous No.107026809 [Report]
>>107026674
lol yeah was constantly thinking of that while doing it.
Anonymous No.107026937 [Report]
>>107006230
You sound like me trying navigate the stream of consciousness bullshit that is discord trying to learn the latest theory on an enhancement shaman. I'll never understand how that became a defacto method of collaborative communication AND documentation for zillenials.
Anonymous No.107027031 [Report]
https://github.com/lem-project/lem/tree/42624226d81a3c97f66692305ca341e44c3e3ca2

do you guys want to read how lem was developed?

I tried reading current, but have no clue how to read common lisp apparently.
Anonymous No.107027462 [Report] >>107027975 >>107028055
>>107026506
Literally just mask it by an all-ones bitmask shifted right by the same amount:
(logand (ash #xFFFFFFFF (- bits))
(ash n (- bits)))


This works even if n is negative.
Anonymous No.107027975 [Report] >>107028028 >>107028055 >>107057406
>>107026042
Nice, I admire your passion

>>107026506
>>107027462
It's unintuitive but
(defun lsh (n count &optional (width 64))
(ldb (byte width count) n))
Anonymous No.107028028 [Report] >>107028055
>>107027975
This is arguably a better solution, I always forget about ldb and dpb, which allow you to avoid doing explicit masks.
Anonymous No.107028055 [Report] >>107028089
>>107027975
>>107027462
>>107028028
dont know much about bwise operations, what are they useful for?
Anonymous No.107028089 [Report] >>107028115
>>107028055
they're useful for operating bitwisely
Anonymous No.107028115 [Report]
>>107028089
iknew trhat was coming youre dancing in the palm of my hand you fool. you think i would write ;bwise; for no reason!!!??? you are nothing but a puppet under my command nothing
Anonymous No.107028191 [Report] >>107031514
>>107012247
>CL-PPCRE is fast. stop Bullshiting.
It is not, read the fucking thread. And, if you would look at the source code you'd see it is not optimized for speed at all.
Anonymous No.107028221 [Report]
>>107010078
>Man I really want to learn how to write FAST AS FUCK code in CL

The major speedups can be obtained by using type declarations, return type declarations ("the"), and then using (declare (optimize (speed 3) (safety 0) (debug 0))) everywhere.

COALTON is making this task easier than ever now, but you'd have to learn a kind of new language.

Besides that, obviously check what kind of data structures you use. Arrays are fast..

These optimizations easily will get you major speed gains, like 10x or more. Then of course you can multithread, using tools like lparalell and/or cl-STMX (software transactional memory)
Anonymous No.107028243 [Report]
>>107026042
Cleaned up your loop, also as far as I could test it, the type/optimization declarations and treating stdin as a file did nothing, they even SLOWED the execution by a fraction of a second! The main key is using binary input and testing for newlines manually. The unicode conversion speed is what's fucked up, everything else seems to perform fine.
(defun count-lines ()
(loop with buffer = (make-array (expt 2 16) :element-type '(unsigned-byte 8))
for bytes-read = (read-sequence buffer *standard-input*)
until (zerop bytes-read)
sum (loop for i from 0 below bytes-read
count (eql (aref buffer i)
(char-code #\Newline)))))
Anonymous No.107028262 [Report]
>>107024228
>What do you anons think about CLIM?
"The stuff that really boring dreams are made of"
Anonymous No.107028289 [Report] >>107029400
>>107024637
>Don't you guys sometimes miss a modern-looking UI and that kind of stuff?
>I've been toying around with Sublime and even vscode and sometimes the eye candy really helps a lot and I end up missing it whenever I open Emacs again
You mean the UI of the IDE, i understand.

I never found Visual Studio Code particularly good. IntelliJ IDEA (for Java) is a good IDE but not as quickly responsive as it should.

For Common Lisp, Emacs (with SLIME) "just works". That is, it does everything you need and in a very quick way. I couldn't care less how it looks, although you could be able to customize tons of stuff should you want to.

I have over 32 years programming and have used many, many IDEs, and Emacs+SLIME was one of the most enjoyable experiences, once you learn the key combinations. I couldn't care less on how it looks. Only newbies and fucking uneducated coders are caring about "wow look at my dark theme and my 5 monitors". Real alpha chad developers can program amazing stuff with a small monitor and vanilla IDE setups.
Anonymous No.107029383 [Report] >>107029661 >>107036181
>>107028523
To be honest, that looks like absolute shit. But yeah I'll take it. Mine (doom) shows as a horizontal buffer in the bottom of the screen. How have you configured yours? is it a package?
Anonymous No.107029400 [Report]
>>107028289
>Visual Studio Code particularly good
Yeah I tried to force myself to just use it and ignore the problems. And it has many good things and it does kind of feel like "it just works" but still, even if "it just works", it still feels like it just sucks.
Thanks for the remarks.
Anonymous No.107029661 [Report] >>107029754
>>107029383
nta and not a doom user, i just required lsp-mode with straight and doc frame on mouse hover is on by default; that's for non lisps. for lispy stuff i dedicate a window and put the help/whatever doc buffer there because frankly i dont give a single fuck
Anonymous No.107029754 [Report]
>>107029661
>>107029596
Thanks anons
Anonymous No.107030226 [Report]
How do you check which faces have been changed by custom-set-faces? I skimmed through custom.el and cus-face.el but I can't find anything.
Anonymous No.107030624 [Report]
>>106994238 (OP)
Use case for such lust inducing smooth rotation?
Anonymous No.107030636 [Report] >>107031272 >>107031600
God is speaking to me through my pc
Anonymous No.107031272 [Report] >>107031600 >>107031714
>>107030636
Include the Nag Hammadi library and then we’re getting serious
Anonymous No.107031430 [Report]
>>107026042
>Just process bytes instead of chars bro
>Just, like, don't use regexp bro
How is this a solution? It's not idiomatic CL.
How fast would idiomatic Python and Go run for this task?

And CL is supposed to be the most performant Lisp...
Anonymous No.107031514 [Report]
>>107028191
you should make a test like the logtard did. He arrived at the conclusion that IO was the bottleneck, not regex.
Anonymous No.107031600 [Report] >>107034353
>>107031272
>>107030636
here you go, hundreds of terabytes of kikery collected over the course of more than two millennia, in machine-readable formats:
https://github.com/Sefaria/Sefaria-Export
Anonymous No.107031714 [Report]
>>107031272
The demiurge may have hacked together the universe in Perl, but Lisp is the language of the Pleroma
Anonymous No.107031822 [Report] >>107032483
>>106994238 (OP)
Custom method combinations are almost certainly unnecessary in the real world, but my god is it an interesting can of worms.
Anonymous No.107032483 [Report]
>>107031822
No idea what that is, qrd?
Anonymous No.107032641 [Report] >>107034180
going into the encoding rabbithole, help

>https://kyo.iroiro.party/en/posts/why-rewriting-emacs-is-hard/
>https://emacsninja.com/posts/code-conversion-language.html
Anonymous No.107033833 [Report] >>107033863 >>107034180
>looking up ccl.el log history
>first commit 29 years ago
Man looking up emacs git logs is surreal.
Anonymous No.107033863 [Report]
>>107033833
>My text editor is almost 20 years older than I am

Yeah it for sure is surreal
Anonymous No.107034180 [Report]
>>107032641
>>107033833
This feels like less a text editor and more an archaeological dig
Anonymous No.107034353 [Report]
>>107031600
>https://github.com/Sefaria/Sefaria-Export
Awesome stuff thank you.
Anonymous No.107034432 [Report] >>107035053
any guix chad had problems with its integration with other distros, with desktop managers specifically?

i want to have .desktop files accesible via gui to launch them but read-only filesystem doesnt allow me that
update-desktop-database ~/.guix-home/profile/share/applications -v
Search path is now: [/home/anon/.guix-home/profile/share/applications]
File "/home/anon/.guix-home/profile/share/applications/kitty.desktop" lacks MimeType key
File "/home/anon/.guix-home/profile/share/applications/btop.desktop" lacks MimeType key
File "/home/anon/.guix-home/profile/share/applications/drracket.desktop" lacks MimeType key
Could not create cache file in "/home/anon/.guix-home/profile/share/applications": Read-only file system
The databases in [/home/anon/.guix-home/profile/share/applications] could not be updated.
Anonymous No.107034518 [Report] >>107034597
>>106994238 (OP)
Jew language.
Anonymous No.107034597 [Report]
>>107034518
((()))
https://www.adl.org/resources/hate-symbol/echo
Anonymous No.107035053 [Report] >>107037416
>>107034432
i don't use a DE so idk how this mechanism works, but what if you symlink the contents of ~/.guix-home/profile/share/applications to ~/.local/share/applications and then run update-destop-database on the latter?
Anonymous No.107035596 [Report] >>107036131 >>107036634 >>107037006 >>107037900 >>107038295 >>107039274
Here's a bit of a retarded question but it's one that's always persisted no matter how many times I try to read up on the subject.

What's the deal with Macros? Why do people jerk off and cum over them in every lisp tutorial or whatever?
I've never written a Macro of my own and find those that already exist premade to be convenient and nice enough for me most of the time.

They allow you to create new functions and/or condense boilerplate or do some funny tricks at compile-time but even knowing that I don't really feel like I 'get' them. They just exist to me and I don't even think about making macros of my own. What's wrong with me?
Anonymous No.107035696 [Report]
in my experience, they allow me to do whatever the fuck I want, and I meant anything, for me they're the best tool to mold the solution to the problem, mostly from an usage standpoint, so whenever I figure out the solution for something and want that solution to be expandable/readable/easier to use, I write a macro or macros that makes it easier to use my function/solution/etc.

What made it click for me was when making reusable tools. Whenever I have an issue that I constantly need to solve in a vertain way, or want to use a function in a certain context but it becomes way too involved, I make a macro. But in my case is not that I think about the macro to solve the problem, but first solve the problem and then make a macro to make that shit easier to use, but I'm sure others use it differently.
Anonymous No.107036131 [Report] >>107037026 >>107037349
>>107035596
macros let you extend the language itself, whereas in other languages you can only whine that it lacks the syntax features you want and hope the devs implement it.
There are some good examples here:
https://stackoverflow.com/questions/10434638/good-examples-of-clojure-macros

Some other good examples:
- the threading macros in Clojure make long nested calls more readable
- some of the most impressive Clojure libraries (hiccup, core.async, Electric Clojure) are only possible because of macros
- I've created some macros for Malli that have saved me a shitload of typing
Anonymous No.107036181 [Report]
>>107029383
>that looks like absolute shit
Not sure why that anon's looks poopy. Mine on spacemacs looks pretty good. I wish Shift+K did the popup instead of opening a buffer at the bottom that temporarily resizes everything. I hate how much emacs does that. I can probably keybind the mouseover to shift-k, but the little one line at the bottom on the bottom has been good enough so far.
Anonymous No.107036634 [Report] >>107036675
>>107035596
It lets you generate code and use it with zero performance cost. This is useful/necessary even in C just for system configuration(you can check implementation at runtime and automatically define the correct versions).
The biggest feature is DSLs, you can create and embed entire mini programming languages inside lisp and use them with native performance. So for instance you've got loop and format, but also several entire other languages like APl/prolog.
Plus while it doesn't matter as much to the end user, the entire language itself is built using macros, it's literally how the entire compiler functions and how it's even possible to load and compile code at runtime.

It's also just useful for prettying up ugly/verbose code. like all the package configuration in emacs or all the object definitions in CLOS.
Anonymous No.107036675 [Report]
>>107036634
>The biggest feature is DSLs
>Dick sucking lips
Big feature for my big D
Anonymous No.107036885 [Report] >>107036907
You don't even really need macros in Lisp because you can just quote the program and call a function instead of a macro.
Anonymous No.107036907 [Report]
>>107036885
good morning sar
Anonymous No.107037006 [Report]
>>107035596
Implicit delayed evaluation gives you more control without cluttering your code with lambda wrappers.
And since code is structured data you can operate on an expression in more ways than just evaluating it or not.
Anonymous No.107037026 [Report] >>107037197 >>107037349 >>107046557
>>107036131
> extend the language itself
This is the programming equivalent of the people on here that spend their days ricing their desktops rather than doing any actual work.
Just use the language as intended instead of wrecking/obfuscating it. Other languages have similar problems (I’m looking at you, C++) and lisps are not immune to it.
One of the points of lisp and scheme is to get as close to pure computation as possible. Do likewise gents.
And stop using square brackets. It’s completely unnecessary.
Anonymous No.107037061 [Report]
Switch statements are macros.
Anonymous No.107037067 [Report]
>>107028523
> LogManager
> GetSafeSAXParserFactory
> isValidate

I’ve been out of Java for a couple years now, thanks for flashing back my PTSD.
Anonymous No.107037083 [Report]
>>107028523
I will have to work on java in the future. What is your setup?
Anonymous No.107037197 [Report] >>107037349 >>107039390
>>107037026
What if the macro eliminates runtime overhead and enables compile-time specialization you fucking retard. That's the whole point—the macro transforms high-level abstractions into direct computation before runtime. Look at Coalton: macros implement a static type system that generates specialized code, eliminating type dispatch overhead.

The macro makes it possible to do optimization impossible with pure runtime abstractions, and can even make shit more readable/debugabble.
Anonymous No.107037349 [Report]
>>107037197
>>107037026
>>107036131
All Me (you)
Anonymous No.107037416 [Report]
>>107035053
yes, that would do the trick, but i would need to do it every time i add/remove package

but i found out another solution https://gist.github.com/peanutbutterandcrackers/844c211a91137c19607ae75b59fa116f

which works great when i set GUIX_PROFILE to my ~/.guix-home/profile
Anonymous No.107037900 [Report]
>>107035596
nothing wrong with you. macros are pre-processing, code which operates on code. a python file generating a c hello world is a macro; lisps merely have it ootb. your needs need to be rather specific to use macros
Anonymous No.107038295 [Report] >>107043458
>>107035596
>What's the deal with Macros? Why do people jerk off and cum over them in every lisp tutorial or whatever?
It's likely because they are implemented so poorly in other languages, the most modern attempt is this:
#[macro_export]
macro_rules! vec {
( $( $x:expr ),* ) => {
{
let mut temp_vec = Vec::new();
$(
temp_vec.push($x);
)*
temp_vec
}
};
}
and the less said about string substitution preprocessors and templates the better, they have caused endless problems
Anonymous No.107039265 [Report] >>107039418 >>107042469
what the fuck is this code I'm reading.

Why don't lisp people write comments?
Anonymous No.107039274 [Report]
>>107035596
personally i never really needed to use them. i tried using one once but i realized i could just write a function.
Anonymous No.107039390 [Report] >>107039442 >>107043441 >>107053256
>>107037197
> compile-time specialization
That should be rare in lisp and scheme. Most of the lisp code people write should be portable.
Go has a pragma for conditional compilation, and you are told not to use it.

> optimization
Most of that is not in macros, but in the optimizer (be it byte-code, llvm, or intermediate/object files). The emacs native code generator for elisp uses llvm for example.

I can’t think of an example of where I implemented anything low-level enough where I needed conditional “compilation” (especially when I’m doing things in, essentially, an interpreter) or any significant optimization using macros.

> coalton implemented a type system
Interesting, macro systems usually “emit” core language syntax, maybe it uses something like C++ name mangling to keep track of the type?
Anyway, if I wanted fancy, unportable, non-standard, non-core-language extensions like that, I’d probably switch to another language that specializes in that rather than dilute the pure lisp and scheme pool with yet another “idea” that has been tried numerous times before and ultimately fell into obscurity and disuse. Or, in this case, started in obscurity.
Anonymous No.107039418 [Report]
>>107039265
> wtfair?
I think that’s actually “rust language” but I admit that I’m not sure. Probably just a “modern” example.
Anonymous No.107039442 [Report] >>107039817
>>107039390
I write software to solve very specific problems.
Anonymous No.107039817 [Report] >>107041124
>>107039442
Can you write software to solve my autism?
Anonymous No.107041124 [Report]
>>107039817
emacs already exists
Anonymous No.107042469 [Report]
>>107039265
>comments
usecase?
Anonymous No.107042674 [Report] >>107050338
Any obscure lisps that are worth knowing?
Anonymous No.107043441 [Report] >>107043962
>>107039390
>The emacs native code generator for elisp uses llvm for example.
It uses gccjit

>I can’t think of an example of where I implemented anything low-level enough where I needed conditional “compilation” (especially when I’m doing things in, essentially, an interpreter)
srfis and other libraries often use cond-expand (a macro) to check for features at least, making them more portable
Anonymous No.107043458 [Report] >>107043712
>>107038295
C preprocessor macros, while far less powerful and more error-prone than traditional Lisp macros, are underrated and an order of magnitude less headache-inducing than Sepples templates.
Anonymous No.107043712 [Report]
>>107043458
It remains an unsolved problem in both cases. As you already know it can get tricky in Lisp with nested quasi/quoted and unquoted forms, which naturally gets compounded in languages with more sophisticated syntax. I'm guessing the Rust example ($($x:expr),*) is similar to a ,@ splice in Lisp (requiring additional state after =>), so Rust is comparatively hamstrung by its own syntax for even a simple macro
Anonymous No.107043962 [Report] >>107044344 >>107054988
>>107043441
> gccjit
I stand corrected. It’s similar to llvm in that regard. In retrospect, it was ludicrous to imagine they’s use a non-gnu (in fact, anti-gnu) system for that.

> and other libraries often use cond-expand (a macro)
Sure. In the old days you’d publish your library on Floppies or CD ROMs, too. But building public libraries are niche cases.
C++ has the same (but much bigger) problem, most of the features in C++ are in support the crazy shit like the STL. As a “regular developer” I tend to *use* standard libraries. Not write them. It’s missing the while point.
You see shit written by developers that uses, say, templates, in a multi-million line code base, and you examine that and find out that the template implementation (a) duplicates something in the standard library except in a shitty way, (b) is only ever instantiated once (or never) on a single type.

It makes me think people with these ideas are either power-tripping, or want to be famous, or both.

In 99.9999% of the cases, a simple function written by someone who actually knows the language and can use it effectively serves the purpose much better than someone who tries to unnecessarily re-syntaxify the language according to their wild imagination an inexperience with it, like this retarded shit https://srfi.schemers.org/srfi-119/
Anonymous No.107044344 [Report] >>107054428
>>107043962
>Sure. In the old days you’d publish your library on Floppies or CD ROMs, too. But building public libraries are niche cases. [...] As a “regular developer” I tend to *use* standard libraries. Not write them. It’s missing the while point.
As a regular developer cond-expand is useful for interoperating between r7rs scheme implementations (presumably you use only a single machine or os?)

>In 99.9999% of the cases, a simple function written by someone who actually knows the language and can use it effectively serves the purpose much better than someone who tries to unnecessarily re-syntaxify the language according to their wild imagination an inexperience with it, like this retarded shit https://srfi.schemers.org/srfi-119/
wisp doesn't use macros however, just regular functions: https://github.com/scheme-requests-for-implementation/srfi-119/tree/master/srfi-119

It seems your aversion is less towards macros themselves and more towards lacking standards conformance. The r7 report defines standard libraries such as (scheme base), (scheme char), (scheme complex), (scheme cxr), (scheme eval), etc, but the srfi process is distinct from this and open to public requests (hence the name)
Anonymous No.107044402 [Report] >>107046572 >>107047272
Maybe I'm barking up the wrong tree here, but it feels like this should be an easy toggle and I'm just missing it.
I often have my emacs windows in a frame sized so one is 30% width and one is 70% width or thereabouts. When emacs opens a buffer in the second frame though, my windows are resized back to the default 50/50 split. How can I make it so this doesn't resize?
Example: I have an org buffer open in a window, to the right I have any other buffer. The org buffer is active. C-h f to describe any function (which will open in other-buffer), and now my buffers are 50/50 sized instead of 30/70.
Anonymous No.107045744 [Report] >>107046386
Lisp mentioned
https://youtu.be/rv3S1HVxwD4?t=1739
Anonymous No.107046386 [Report] >>107046564 >>107046576
>>107045744
I choose to imagine that this thread is full of really cute guys just like that
Anonymous No.107046557 [Report] >>107054553
>>107037026
I gave several examples of very useful macros, you haven't given a single good reason not to use them other than some weird idea of purism
>And stop using square brackets
square and curly brackets actually denote different data types in Clojure, [ vectors ] and { maps }.
Anonymous No.107046564 [Report]
>>107046386
I'm more a schizo lisper like Xah
Anonymous No.107046572 [Report]
>>107044402
I don't know the answer, but you might find out how to do if you look at which hooks etc. are manipulated by this extension:
https://github.com/roman/golden-ratio.el
Anonymous No.107046576 [Report]
>>107046386
I'm a cute ojisan like this
Anonymous No.107047272 [Report] >>107047829
>>107044402
>I often have my emacs windows in a frame sized so one is 30% width and one is 70% width or thereabouts. When emacs opens a buffer in the second frame though, my windows are resized back to the default 50/50 split. How can I make it so this doesn't resize?
(setq even-window-sizes nil), also try out (setq display-buffer-reuse-frames t)
Anonymous No.107047829 [Report] >>107047895
>>107047272
widemacs
Anonymous No.107047895 [Report]
>>107047829
e m a c
Anonymous No.107048806 [Report] >>107050537 >>107050692
I wish clojure had a good repl. If you enter a bad piece of code into it and restart it the repl remembers the last state and tries to resume meaning you can hard lock a project. The only way I can get it to work is by starting a new project and copying source files. But alas, these pain points are par for the course for anything running on the JVM.
Anonymous No.107050338 [Report] >>107052761
>>107042674
https://picolisp.com
Anonymous No.107050537 [Report] >>107050596
>>107048806
>If you enter a bad piece of code into it and restart it the repl remembers the last state and tries to resume meaning you can hard lock a project.
this has nothing to do with "Clojure" and even less with the JVM, but with whatever piece of tooling you use that auto-evaluates the files in your project for you, or remembers the REPL state, or whatever it does.
Anonymous No.107050596 [Report] >>107050658 >>107051683
>>107050537
I just use leiningen for everything.
Anonymous No.107050658 [Report]
>>107050596
I use neil
https://blog.michielborkent.nl/new-clojure-project-quickstart.html
Anonymous No.107050692 [Report] >>107050796
>>107048806
>If you enter a bad piece of code into it and restart it the repl remembers the last state and tries to resume
not sure what you're talking about here. If you mean that this happens when you restart the repl via CIDER in emacs, my guess is that the old REPL process is still running and CIDER just reconnects.
Kill all running java/lein/clojure processes and then run cider-jack-in-clj
Anonymous No.107050796 [Report] >>107050845
>>107050692
If I make an infinite loop. Kill all repl and java processes and restart the repl, the infinite loop persists.
Anonymous No.107050845 [Report]
>>107050796
the jvm does not persist state between sessions, so there must be something in your setup that re-evaluates the repl history on startup.

feel free to post your project.clj and record your screen to show us exactly what you're doing to achieve this.
Anonymous No.107050959 [Report] >>107051063
on emacs do you have a window/frame configuration you save and re-use each session?
I saw someone had screen shot their setup. But, I don't like opening all the windows each time I launch. I also don't have a long term lisp project to hack on that needs a window configuration.
Anonymous No.107051063 [Report] >>107051498 >>107056952
>>107050959
I use C-x r to open the recent stuff I was working on.
Anonymous No.107051498 [Report]
>>107051063
C-X-r sorry
Anonymous No.107051549 [Report]
deps.edn documentation is so bad omfg
Anonymous No.107051683 [Report]
>>107050596
Just ask technomancy directly(guy who made leiningen) , the guy always responds immediately in the fennel irc chat, and there's quite a few Clojure people over there too.
Anonymous No.107052671 [Report] >>107057290
On the topic of fast easy text search in Common Lisp.

>This week anon found this bug in SBCL: https://bugs.launchpad.net/sbcl/+bug/2129811
>some anons tried solving this in order to do fast read and search in a text file from stdin
>some other anon made a fast script but it did byte search, which is brittle and cumberstone to use

Then someone posted this https://github.com/telekons/one-more-re-nightmare when talking about how fucking slow ppcre is. That was interesting so it lead me down a rabbithole.
That repo had a pretty interesting manual, mentioned a couple research papers and something which I hadn't heard before: Derivatives. Then those papers also had some interesting references. All in all i've checked out:

>Derivatives of Regular Expressions: https://dl.acm.org/doi/10.1145/321239.321249
>Regular-expression derivatives reexamined: https://www.khoury.northeastern.edu/home/turon/re-deriv.pdf
> Regular Expression Matching: the Virtual Machine Approach: https://swtch.com/~rsc/regexp/regexp2.html

And in the references from one of these there was this paper that seemed interesting (and from 2016, which surprised me)

>Type-Checking of Heterogeneous Sequences in Common
Lisp: hal.science/hal-01380792/document

Also used this opportunity to check transforming research papers into org documents+latex with gptel by sending images (not the entire pdf, since i dont know if it can deal with the double columns and all other fancy stuff they use for formatting papers), for this anthropic-haiku-4.5 was the best at it.

Now I have the research papers in org-mode and can make notes from them and test shit out. I love emacs bros. Also I feel like there's something in between all this shit about making an incredibly fast library/utility by using Coalton, similar to one-more-re. Will have to ask stylewarning about it.
Anonymous No.107052761 [Report]
>>107050338
Cool!
Anonymous No.107053256 [Report]
>>107039390
>I’d probably switch to another language that specializes in that
which is exactly what this family of languages is. the only other languages capable of doing staged computation through meta interpreters are forth and prolog. the former lacks free high quality implementations and requires you to make the high level language yourself, and the latter requires a quadruple digit iq to write, so lisp and scheme remain a comfy middle ground.
Anonymous No.107054241 [Report]
found https://github.com/karlicoss/grasp
can finally easily do org-capture from firefox.
Anonymous No.107054428 [Report] >>107054988
>>107044344
> r7
> one machine
Quite the opposite, I use and write for all kinds of suff, including things like windows CE. Mostly old.
I will probably never even read the r7 spec. I use a portable subset of r5 at best.

Lisp is still the best way to get a lot of shit done with a high level language in 2025, even if it’s based on something like david betz’s xscheme from the 80s.

For everything else, use a bit of C in foreign functions, syscalls, or hack new functions directly into lisp using C … but only as a last resort.
Anonymous No.107054553 [Report] >>107054854
>>107046557
It’s not weird purism, I don’t need or want to see 47 types of unnecessary loop constructs. In scheme, you need approximately one. Might as well get good at it, eh?
It’s a standard practice to avoid other loop constructs.
I don’t use “setf” either, on principle, which is purism. But that’s also common.
If you’re using a new implementation that happens to use macros to implement old, standard features, then yeah, I’d be “using macros” but I’m probably not going to use the system directly. No need.

Sometimes I have to work on other systems, I took on a C# project a few years ago. I found that the best thing about C# is that it can just about compile plain C89-style code! So that’s what I did. Now runs on XP through 11 with no effort.
Anonymous No.107054854 [Report]
>>107054553
>I don’t need or want to see 47 types of unnecessary loop constructs
irrelevant to the examples I gave.
core.async implements go-routines, Hiccup provides a short-hand syntax for HTML, and Malli provides schema-based validation and instrumentation. All of them make heavy use of macros.
Anonymous No.107054988 [Report] >>107056865
>>107054428
>I will probably never even read the r7 spec. I use a portable subset of r5 at best.
>Lisp is still the best way to get a lot of shit done with a high level language in 2025, even if it’s based on something like david betz’s xscheme from the 80s.
>For everything else, use a bit of C in foreign functions, syscalls, or hack new functions directly into lisp using C … but only as a last resort.
I'm not sure why you wrote about using the standard library, avoiding macros, and writing portable programs in replies like >>107043962 when you're willing to extend Lisp in C
Anonymous No.107055019 [Report]
Why macros instead of fexprs? They are so elegant.
Anonymous No.107055223 [Report]
Emac
Anonymous No.107055239 [Report] >>107055335 >>107057273
>>106994238 (OP)
scheme is better than lisp
im sick of lisptards luring kids into the inferior sexpr language
Anonymous No.107055335 [Report] >>107056899
>>107055239
Scheme is lisp.
Anonymous No.107055557 [Report]
is there any point in using global variables in Guile when parameters exist?
Anonymous No.107056011 [Report] >>107056180 >>107057025
I want to try Guix coming from Gentoo. How close to Gentoo can Guix be made to be?
Anonymous No.107056180 [Report] >>107056903
>>107056011
You can run Guix on Gentoo, it's just a manager.
Anonymous No.107056572 [Report] >>107056883
>100% of my github history is contributions to obscure lisp dialects
what am I doing
Anonymous No.107056865 [Report] >>107056964
>>107054988
I don’t avoid macros, if they were used to implement core language syntax, but I avoid using them if they are used to implement weird-looking shit nobody needs, and then reduplicates again in 2026 with new, weird syntax ideas.

Most lisps are implemented in C, so it’s practical concern. Also, they’re just functions using ordinary fn call syntax, that you've read and written thousands of them probably. It’s practically the *point* of lisp. Thirdly, it’s a *last resort* — i mean obviously I try and do everything with, say, ordinary “ports” first.
Anonymous No.107056883 [Report]
>>107056572
>what am I doing
Living the dream
Anonymous No.107056899 [Report]
>>107055335
Sure, but he means something like
“Scheme is closer to perfection than Common Lisp”
Anonymous No.107056903 [Report] >>107057025
>>107056180
Does it have sourcebased granularity of portage?
Anonymous No.107056927 [Report] >>107057025 >>107057256
>tfw guix has no USE flags
Anonymous No.107056952 [Report]
>>107051063
> recents
I found it was somewhat broken/iffy with tramp (which is why I wanted it because typing out those full tramp paths was killing me).
Anonymous No.107056964 [Report]
>>107056865
>Most lisps are implemented in C
In the Common Lisp world, most Lisps are implemented in Lisp.
Anonymous No.107057025 [Report] >>107057238
>>107056011
>>107056903
>>107056927
>One of the nice things with Guix is that, given a package definition, you can easily derive variants of that package—for a different upstream version, with different dependencies, different compilation options, and so on. Some of these custom packages can be defined straight from the command line (see Package Transformation Options).
https://guix.gnu.org/manual/devel/en/html_node/Defining-Package-Variants.html
https://guix.gnu.org/manual/devel/en/html_node/Package-Transformation-Options.html
Anonymous No.107057203 [Report]
>>107002694
Probably my new elisp function which inserts a link to my latest screenshot into an org document. It's revolutionary.
Anonymous No.107057238 [Report] >>107057991
>>107057025
It's still too much work because it's not only the inputs but also configure flags and probably other assumption the package code makes that needs patching if I wanted to remove a lot of dependencies. Basically every package would need more or less extensive babysitting. Nix has the same problem as far as I know. portage doesn't have perfect granularity either, but overall it's pretty painless for this kind of stuff.
Anonymous No.107057256 [Report]
>>107056927
Outdated concept for an outdated distribution.
Anonymous No.107057273 [Report]
>>107055239
If Scheme had retained traditional Lisp macros instead of falling for the hygiene meme, it would have been the better language.

Sadly, they turned them into an abomination, which is completely unfitting considering that Scheme aims at being a smaller, simpler language.

For me, at least, this is enough of a deal breaker to prefer CL over Scheme. The increased portability is also a plus.
Anonymous No.107057290 [Report]
>>107052671
COol. I wasn't aware of this concept. Good mornign sir!
Anonymous No.107057302 [Report]
えまっくす
Anonymous No.107057330 [Report]
Conclusions from the previous threads. Common Lisp is slow as shit and benchmarks are a JOKE.
Anonymous No.107057406 [Report]
>>107027975
Doesn't work as-is: the width in the byte specifier must "shrink" to compensate for the offset.
(defun lsh (n count &optional (width 64))
(ldb (byte (- width count) count) n))

This works.
Anonymous No.107057473 [Report] >>107057490 >>107057634
In dired what does it mean when filenames end in an asterisk? They are not named like that in the operating system.
Anonymous No.107057490 [Report]
>>107057473
You mean when they are marked?
Anonymous No.107057634 [Report]
>>107057473
i'm pretty sure it means the file is executable, but maybe they changed that because on my emacs it doesn't show an asterisk at the end of executable files anymore
Anonymous No.107057991 [Report]
>>107057238
>pretty painless
USE flags are great if you love tinkering. But they are a double-edged sword. Dealing with all that slot/dependency/mask/unmask hell is a massive pain in Gentoo, so if something breaks, there's no rollback—you're fucked.
To make it worse, emerge is written in Python.