libera/#commonlisp - IRC Chatlog
Search
21:32:08
Josh_2
etimmons: are the docs generated by 40ants/doc able to be hosted by a webserver like nginx straight away?
21:37:55
etimmons
Josh_2: yep! For instance, cl-tar publishes through Gitlab pages (which is just a static webserver under the hood)
21:39:07
etimmons
Any time I tag a commit in cl-tar or cl-tar-file, it triggers a new pipeline in cl-tar-site which downloads the documentation for the tag, shoves it in the correct folder, and then does the magic Gitlab pages dance to tell it there's a new set of files ready to be served
21:44:08
etimmons
Separate repo: <https://gitlab.common-lisp.net/cl-tar/cl-tar-site> it has some CL code in it, but I have zero plans to add it to QL since it's only used to build the project website
21:45:17
etimmons
It's also kind of an artifact of how c-l.net does its project pages. In order to get a site to show up under c-l.net/project/X/ using Gitlab pages, you need to use a repo named X/X-site
0:58:12
hayley
FWIW Bike's definition of parallel (w.r.t parallel assignment) is the undisputed definition of concurrent at least, that there are no happens-before relations that would order one before the other.
1:26:13
hayley
Can I do anything to make the SBCL compiler do less optimization somehow? It doesn't appear that the code I generate would benefit from much more type inference, for example.
1:56:22
hayley
Huh, optimizing for (speed 0) actually affected compile time (which went from 450ms to 250ms), and the drop in execution performance isn't that bad. Somehow I don't seem to write code where it usually does much.
5:37:35
lisp123
Usually its a trade-off between abbreviations vs. longer names, e.g. ((find (cadr function-definition) *cl-symbols* :test #'symbol-name-equalp)
5:38:28
lisp123
I put that into a COND as a test and now its hard to indent the body of the form since its already so long
5:42:35
lisp123
flip214: Yes, perhaps I should use anaphoric macros (seems a bit too much to define a wrapper around find)
5:45:35
lisp123
\n :test ) --> Since the test is optional, it flows better having that on a new line
5:45:50
beach
lisp123: Please don't use anaphoric macros. They tend to violate the rules of page 13 of the LUV slides.
5:47:41
beach
The best solution is to have lots of small functions, and occasional macros, so that the total code size is still limited.
5:48:46
lisp123
The trade off I am having with small functions is that one has to make an extra step to read what they do, whereas writing in terms of the standard function "inlines" it
5:50:46
lisp123
In this case, I think it might be a good idea, (defun IS-CL-SYMBOL (sym)), so I will do that -> But I used to have a lot of smaller functions and it felt like I was going through 5 functions to get to the final code
5:54:29
flip214
lisp123: right. but these additional small functions are a kind of documentation - one that (hopefully) better reflects what happens than comments that are outdated
5:58:21
lisp123
As in adding doc strings to these functions vs. writing comments? That sounds interesting
6:00:40
flip214
lisp123: yes. Small function tend to not change so much, so the docstrings stay current... they might not be used anymore, but that you can find out via xrefs and then delete them.
6:41:39
beach
lisp123: I agree with flip214. Small functions with relevant long names are self documenting, so they save effort to understand.
6:42:42
beach
Plus, if those small functions reflect useful abstractions, they can be reused in several places.
7:55:54
pjb
saturn2: as I said, if you want the performance of C (or python), then do what C (or python) does. Don't parse and convert octet sequences into strings. Process the octets directly.
8:16:09
lisp123
Thoughts of using newlines to break up code blocks? e.g. https://plaster.tymoon.eu/view/2643#2643
8:17:36
jackdaniel
if you have long blocks of code you want to "separate" you probably should think about defining a function (i.e in flet, or toplevel)
8:18:18
lisp123
jackdaniel: Thanks, the progn was a leftover from a previous code, so I will adjust that. Here I need to keep the parts together due to lexical scoping
8:20:43
lisp123
moon-child: Yeah, ignore the indenting :) Question was on line breaks (obviously indenting I can do ;)
8:22:46
pjb
lisp123: you can factorize locally; using flet/labels and macrolet, you can design a local mini-dsl that allows you to express your function code more concisely.
8:23:50
pjb
lisp123: (flet ((find-function-name (function-definition) (find (cadr function-definition) *cl-symbols* :test #'symbol-name-equalp))) … (cond ((find-function-name function-definition) …)) …)
8:24:04
pjb
lisp123: you can't deny that ((find-function-name function-definition) …) is clearer and shorter than (find (cadr function-definition) *cl-symbols* :test #'symbol-name-equalp)
8:26:50
pjb
(let ((v (velocity thrown-weapon)) (dt (game-time-step game)) (x (player-position player))) (+ x (* v dt))) instead of (+ (player-position player) (* (velocity thrown-weapon) (game-time-step game)))
8:27:46
pjb
write down the formula (+ x (* v dt)), then assign the value (describe what each variable is), the compute the result.
8:28:08
lotuseater
oh pjb, so when you play DOOM or such you fight the demons by throwing the weapons rather than shooting? ^^
8:28:11
pjb
Note that there are with-slots and with-accessors to deal with length accessor names too.
8:30:47
lotuseater
oh I remember some funny situations when classmates had expressions like log(10)/log(2) and they "canceled" it to 10/2 = 5 ...
8:32:11
pve
lisp123: instead of using blank lines, why don't you separate stuff with cute comments instead ;)
8:32:28
lotuseater
pjb: most times when i translated some algorithm from TAoCP and Knuth uses t i used c for that instead if it was free. also when parameters are in small and big form like n and N, so I used %N for the big one
8:33:55
lotuseater
pve: like "this is a really interesting comment"? lines that speak about themselves
8:34:50
pjb
the idea is to use a DSL that allows you to transcribe maths and physics formalae as-is to avoid errors, and let the DSL make the formula translation.
8:35:34
pjb
lotuseater: if there's n and N, I'd use a reader macro to activate a case sensitive mode and write down the formula as-is.
8:35:45
pve
lotuseater: Well, I was actually being half-serious. Like if you need to separate code blocks, at least explain why.