freenode/lisp - IRC Chatlog
Search
12:09:19
schweers
Is anyone aware of documentation on how to interpret the :graph report of sbcl statistical profiler?
12:18:04
heisig
schweers: Do you know about clim.flamegraph? It is great for visualizing the output of sb-sprof.
12:18:21
heisig
The url is https://github.com/scymtym/clim.flamegraph/tree/future (the good stuff is on the future branch)
12:39:03
schweers
heisig: thanks a lot for that tip. It’s a bit buggy, but the tool is really awesome and gave me at least one valuable insight!
12:44:18
heisig
schweers: Great to hear you like it, too! I think it is relatively stable for a not-yet-announced tool from a branch labeled 'future' :)
12:44:59
schweers
also, the only buggyness I’ve encountered, is that it lands in the debugger on redisplay. skipping redisplay works fine
12:48:12
schweers
Sadly I have no idea how [mc]clim works, so I’m afraid I won’t be able to contribute.
12:48:56
jackdaniel
snarky part of myself feels the urge to say: it doesn't (but that would be a lie :)
14:42:16
phoe
Is there some sort of mechanism in ASDF that would prevent an arbitrary symbol from being used?
14:43:26
phoe
I could achieve a similar behavior with a git grep pre-commit hook, but I wonder if it's possible on the Lisp side.
14:50:09
pjb
phoe: you could write a reader macro that would read the symbols, and reject the forbidden symbol. However, there's no link between reading symbols and system. You would have to define such a link, probably dynamically.
14:51:45
pjb
phoe: you could also do it post-hoc, using find-symbol; but again, this would check the symbol is interned in a package, but symbols can be interned in the same package by different systems!
14:54:40
heisig
phoe: Would SBCL's package locks help here? Alternatively, you could preprocess all source files with a suitable Eclector client.
14:55:18
pjb
New O(nlogn) multiplication algorithm: https://hal.archives-ouvertes.fr/hal-02070778/document
14:55:40
phoe
heisig: hmm. Eclector sounds like an option. Can I make it run before ASDF loads a file of a particular system?
15:00:19
heisig
phoe: Sure, ASDF is extensible. It is probably easiest to provide your own system subclass.
16:48:24
selwyn
today i noticed that (make-array '(0 0)) and (make-array '(0 1)) are not eq, or even equalp. yet they have the same printed representation #2A()
16:49:08
selwyn
but i vaguely recall reading somewhere that having two objects that are not 'eq' to each other having the same printed representation in CL is asking for trouble
16:49:47
vsync
I remember PostgreSQL has a way to subscribe to updates - anything in e.g. CLSQL to support? and maybe graph DBs (allegro) have something nice?
16:49:53
selwyn
my question is 1) do i in fact recall correctly and 2) if this is indeed received wisdom how seriously should i take it considering that the language itself does not appear to
16:55:05
phoe
so (make-array '(0 0)) and (make-array '(1 0)) are not going to be equalp because of that.
17:03:13
Bike
in my sbcl, arrays with dimensions (0 0) (0 1) and (1 0) actually all have different readable printed representations.
17:05:53
Bike
this doesn't alter beach's point or anything, i just wanted to say that *print-readably* is important. without it the printer can pretty much do whatever, since it's intended for humans rather than toasters.
17:07:06
selwyn
i am using 1.4.14. no i did not specify *print-readably* -> t , now I do i get the same results as bike.
17:08:16
Bike
the rule you are probably thinking of, selwyn, is that if you read a readably-printed object, you get an object that is "similar" to the original object.
17:36:06
pjb
There are serveral kinds of objects that have the same printed representation. For example, simple-vectors vs. vectors; pathnames, empty arrays, etc. round-trip print/read has been broken by those modern data types…
17:37:19
pjb
(values (make-array '(0 0)) (make-array '(0 1)) (make-array '(1 0))) #| --> #2A() ; #2A() ; #2A(()) |#
17:51:08
jsjolen
stylewarning: Hey, is this stylewarning of cl-a-d-t? If so: I'm using cl-a-d-t to write a compiler (just toy stuff for university) and I got into the situation that I want tests on the output of my AST -> AM compiler. So I want tests like (compile (+ (num 1) (num 2))) == (list (push 2) (push 1) ADD). That means that I need to check for 'shape equality' (structural induction) and that means I need some sort of fold for that to happen
17:51:08
jsjolen
(probably a catamorphism). This would be nice to generate through some macro (DEFINE-FOLD adt) and I know that Haskell can at least generate functors for their ADTs automagically. SO, HERE'S THE POINT TO IT ALL: If I write this, would you like a pull request to the algebraic-data-library?
18:18:54
pjb
(bt:make-thread (lambda () (loop (sleep 3) (update)))) ; more or less precisely regular…
18:21:33
phoe
execute (update) in a separate thread that sets some sorta variable when it's starting, and then sets it again when it's done
18:21:48
pjb
(defmacro on-overtime (time exception &body body) `(let ((start (get-universal-time))) (multiple-value-bind prog1 (progn ,@body) (if (< time (- (get-universal-time) start)) ,exception))))
18:26:03
pjb
I saw people using MacLisp at the university on a Macintosh in 1985, and I couldn't understand then why. Later I could beat me for not having started using lisp in 1986 (ten years earlier!)
18:29:14
pjb
Teach them to read and write with a keyword: HA-NEUL ; then: (loop (print '(annyeonghaseyo ha-neul)))
19:55:43
MichaelRaskin
Mine is CL-Emb. But I am biased, I am currently nominally maintaining it (if bugs are reported, I do investigate and push a fix if I can). But I am only nominally maintaining it because I liked it and it was unmaintained, so to add features I had to pick up maintainership.
19:59:59
MichaelRaskin
Well, it doesn't actually mean I am doing anything. Most of the time it doesn't.
20:01:36
aeth
If I needed to generate HTML, I'd probably write it myself, like a true Lisper, always writing a new library.
20:03:33
MichaelRaskin
But… But… Parsing is also a fun problem with a lot of interesting things inside!
20:04:19
aeth
Parsing is comparatively rare because it's not as trivial because there's no FORMAT for parsing
20:05:06
aeth
Of course, a few lines means you used hard to read FORMAT strings instead of many FORMATs and/or lower-level writing functions
20:05:10
MichaelRaskin
… yes, the standard of Common Lisp does not include an almost complete solution for parsing, that's true
20:08:17
aeth
By rendering you mean (:html (:body)) to "<html><body></body></html>" or the character stream equivalent, right? (And a stream solution can build strings, too... the direct string solution would either use FORMAT NILs or one giant generated FORMAT string)
20:12:06
aeth
White_Flame: Parsing with FORMAT-style strings is probably a bad idea... I think C has something like this?
20:12:45
White_Flame
btw, my renderer does something I gleaned from erlang: generate nested lists of strings ("iostring"), and output it serially as a separate step
20:13:05
White_Flame
it makes more literal conses, but ends up being quite a bit faster, and WAY simpler
20:14:02
verisimilitude
Well, there's that example of writing a JSON parser using only reader macros.
20:15:00
aeth
White_Flame: I suspect comparative benchmarks would depend on with-output-to-string's implementation
20:15:54
vms14
aeth: you are right about a lisper should create it's own, and it's like one of the first exercises a lisper should make to practice with sdl
20:17:16
aeth
I suspect a generating a string from a stream is a character buffer that gets copied and doubled if it runs out of space that is then written with its length and type tag at the end, making the front part of it a valid string. Possibly more efficient than anything we can directly write in CL itself
20:18:24
aeth
"character buffer" being probably UTF 32 characters, not C chars, even though I described a C-like algorithm
20:19:44
aeth
What you can't directly do in CL itself is cut the length of the string once the final size is known. You'd subseq, although a sufficiently smart compiler could see that that is the last use of the original
20:23:11
aeth
(You also can only have adjustable vectors by changing its type or doing the copying manually.)
20:55:21
pjb
aeth: you can directly cut the length of the string, if you allocated it with a fill pointer, or as an adjustable array.
22:54:23
Josh_2
If I (bt:kill-thread <thread>) and that thread is running a function that has a handler-case does the handler-case get called?
22:56:01
Bike
" Terminates the thread THREAD, which is an object as returned by MAKE-THREAD. This should be used with caution: it is implementation-defined whether the thread runs cleanup forms or releases its locks first. " oh, good
22:58:04
Josh_2
I need a big boi thread to stop my other networking threads, currently I just use destroy-thread but the unwind-protect doesn't seem to be called
23:03:07
Josh_2
I think the best way to kill my threads would be to have a variable that the threads will atomic read to check if they should continue
23:13:27
tsizz
idk. all i remeber is that graham website about lisp and he wrote websites with lisp. and since i work with web for now, i thought that'd be cool
23:14:38
Josh_2
There is Hunchentoot which is a webserver and you can use a library like cl-who to generate html
23:15:12
Josh_2
I personally just write the JS normally and include the scripts in my cl-who functions
23:18:44
Josh_2
https://plaster.tymoon.eu/view/1244# this is the navigation bar in this image https://cdn.discordapp.com/attachments/252495909517131776/553259132589703169/yeet-site.png
23:19:15
Josh_2
So whenever I want a navigation bar I just call the function (navigation) within a with-html and it will display that bar in that site
23:20:50
Josh_2
So the client requests a page on my hunchentoot server, the server then generates the page dynamically and serves it to the client
23:22:00
Josh_2
But remember how you use <script src= ...> in html, well all my scripts are just included in my dynamically generated html
23:22:10
aeth
pjb: But only a implementation internals can do this with the simple-string that with-output-to-string returns, i.e. (type-of (with-output-to-string (out) (format out "Hello, world!~%"))) => (SIMPLE-ARRAY CHARACTER (14)) ; technically, only string is specified, but I'm sure some code would break somewhere if it wasn't a simple-array
23:23:21
aeth
If you implemented it yourself you'd have to copy it into a simple character array at the end, or manually adjust it with (simple-array character (*))s and subseq at the end to get the correct final length
23:24:14
Josh_2
tsizz: https://plaster.tymoon.eu/view/1288#1288 that is my html header which is part of all the pages
23:25:26
Josh_2
so my index page ends up being (defun index-page () (with-html (:html (header) (index-body))))
23:25:27
tsizz
import is big in JS/node, but isn't that not a thing in lisp or is that just my academia just talking about strictly functional programming
23:25:33
aeth
pjb: Actually, slight correction, I should have used typep since reporting either simple-array character or simple-string is up to the implementation.
23:27:10
Josh_2
so cl-who the library I'm using to generate that HTML is imported like (ql:quickload #:cl-who) once you have quicklisp installed :P
23:28:05
tsizz
Josh_2: okay cool thanks im reading the first part right now the why learn CL part hha
23:28:36
tsizz
i think this is the one of the most intriuging parts "You'll get more done, faster, using it than you would using pretty much any other language."
23:29:41
Josh_2
you will get things done faster if the program is sufficiently complicated, not sure if people will agree with me
23:30:28
Josh_2
doing simple things can seem a bit annoying but when it comes to doing harder things its a joy to use CL
23:33:14
Josh_2
well major libraries are all documented really well, but stuff you find on github might not be