freenode/lisp - IRC Chatlog
Search
15:44:43
ogamita
When I allocate big arrays, I prefer them to be adjustable and with fill pointers…
15:45:32
ogamita
So I'd rather (make-array big :element-type 'base-char :adjustable t :fill-pointer big) and obtain a base-string, but not a simple-base-string.
16:05:02
drmeister
I think if the thread-local-binding table has no_thread_local_binding for that symbol then it modifies the global value.
16:06:29
drmeister
That's what I came up with walking back from class - but it seems like it should work.
16:14:08
Xach
if that message comes up on sbcl, it usually indicates an incomplete or damaged installation.
16:28:36
eschulte
as I recall quicklisp supports project-local installations (effectively project local local-projects, which is hard to google), is this documented somewhere? Is qlot the tool to use?
16:30:56
bpanthi
Xach: (push #p"/usr/local/lib/sbcl/contrib/" asdf:*central-registry*) solved the problem
16:33:25
bpanthi
Xach: may be asdf or quicklisp should include that directory by default. (my asdf version is 3.1.5)
16:34:01
Xach
bpanthi: in a normal installation of sbcl, with asdf loaded, it will work without any work on the user's part.
16:34:31
Xach
bpanthi: that is, (require 'asdf) (asdf:load-system "sb-rotate-byte") will work out of the box.
16:34:45
Xach
bpanthi: if that does not work for you in some circumstance, there is something to fix.
16:37:41
bpanthi
Xach: but when i do CLEAR-CONFIGURATION-AND-RETRY in (asdf:load-system "sb-rotate-byte") restart , and try again , it works.
16:38:13
Xach
bpanthi: that suggests to me that there is an asdf config file that is messing things up
16:40:06
Xach
bpanthi: not sure...they can live in /etc, I think, and ~/.config, and perhaps other places
16:40:24
jasom
okay, where is upstream for quicklisp's esrap? What I get from quicklisp looks nothing like https://github.com/nikodemus/esrap
16:51:38
ogamita
https://gitlab.com/com-informatimago/com-informatimago/blob/master/common-lisp/cesarum/simple-test.lisp
16:51:59
ogamita
example: https://gitlab.com/com-informatimago/com-informatimago/blob/master/common-lisp/cesarum/string-test.lisp
16:56:39
scymtym
jasom: did you see the reference to https://github.com/nikodemus/esrap in the debian package or somewhere else?
17:04:56
phoe_
just don't pass it symbols, because the fleted/labeled symbols aren't globally fbound and that's where disassemble looks for the symbol-functions
17:05:26
jasom
now I'm trying to figuore out how to get the function object; I'm profiling some code and the top 3 functions are all labels/flet
17:07:13
scymtym
jasom: SB-DISASSEM:DISASSEMBLE-CODE-COMPONENT kind of shows it, but you have to map segments to back to functions
17:08:05
scymtym
with sufficient debug policy there will be semi-helpful labels that may help with that
17:09:03
jasom
phoe_: break drops you into the debugger, and from the debugger you can execute arbitrary code
17:11:46
jasom
The tooling is what keeps me coming back to lisp; I do really like macros, and editing s-expressions is much easier than less regular syntax. The condition system is pretty neat too. However the tooling is unrivaled compared to any language implementations that compile to tight machine code, and it's among the best even for highly dynamic interpreted languages.
17:13:46
jasom
mazoe: right, I can change a single function, recompile and get instruction level profiling faster than a single c++ incremental build
17:15:10
jasom
The other day I modified some performance critical code and it got 30% slower; in under 5 minutes I was able to determine it's because changing the code around an IF made a conditional move become a tst/jne and branch prediction is a thing.
17:18:41
Petit_Dejeuner
jasom: I assume SmallTalk is too in-its-own-world for you and Erlang is too functional?
17:21:41
jasom
And yes, SmallTalk has great tooling; historically there's lots of cross-pollination between ST and Lisp.
17:22:57
jasom
Oh, I should also say that there are some commercial tools that have good tooling, but the price means that they are unlikely to be used for hobby projects.
17:24:29
jasom
I'm not poor, but I'm also not going to drop $5k on development tools for software I'm giving away for free.
17:26:47
aeth
$5k is more than most reasonable development hardware expenses for one individual these days. Iirc, it's also more than setting up an LLC, trademarking something, etc. So even if you *were* selling it, $5k could be your highest expense.
18:13:36
TruePika
Both on my VM and on my server, I have directories such as "Perl"/"C++"/"C"/"common-lisp"
18:15:28
TruePika
(with restructuring; one of my projects has a subdir with over 50k images in it, and if ASDF looks in there, stuff slows down a _lot_)
18:16:41
TruePika
My laptop is only slightly better, since almost all my devving is in VM; all I have is "Github" (in ~/Documents) and "common-lisp" (in ~)
18:17:27
aeth
I just put everything under "~/git". I used to also have an "~/svn" and a "~/hg" a long time ago. (The svn one was first... unless I started with cvs, I don't remember.)
18:17:43
aeth
I'm not sure if it's better to have everything, regardless of language or context under ~/git
18:18:42
aeth
(It's not *all* flat under ~/git, I also have ~/git/other for when I have no commit access to that repository)
18:18:58
TruePika
maybe that filesystem idea MS had ages ago, but which would certainly not work with CL's pathnames
18:20:17
TruePika
ACTION has...either one or two more big things to write before he has a sufficient interface to atc(6)
18:20:49
TruePika
I don't know if airplane position prediction should be part of the interface or the AI
18:21:45
TruePika
but I want to be able to test the prediction in runtime against update packets (to validate that the expected next state matches what actually happens), which would mean it needs to be part of the interface
18:22:40
TruePika
(I'm not very concerned about execution speed at this point, since I can hack out the semi-realtime nature of the game for development purposes, if I need to)
18:23:46
dlowe
AI used to be what we can't make a computer do yet. Now it's what we can make a computer do but we have no clue exactly how it does it.
18:24:45
TruePika
meh, I'll have it be part of the bot code, and the assertions will be in the bot code as well
18:25:01
edgar-rft
airplane position prediction is easy, but it's more difficult to convince the pilot to fly to that point
18:26:00
TruePika
(and the RNG is technically deterministic, but not from the perspective of game inputs)
18:27:06
TruePika
coincidentially, the _other_ thing is a "command" class, which is used to issue commands to pilots (and send the keystrokes)
18:29:42
edgar-rft
TruePica, pjb: both versions only tell me that there is no such manual, but thanks for the link!
19:05:04
pebblexe
I installed clozure and now I am getting this error trying to quickload a project: You need ASDF >= 3.1 to load this system correctly.
19:10:52
TruePika
ACTION tests the COMMAND class by writing code which commands everyone to go to 5,000 feet - I expect _something_ to crash
19:12:36
TruePika
The method #<STANDARD-METHOD AUTO-ATC.INTERFACE::COMMAND-CHECK (AUTO-ATC.INTERFACE:ALTITUDE-COMMAND) {1002F59D43}> on #<STANDARD-GENERIC-FUNCTION AUTO-ATC.INTERFACE::COMMAND-CHECK (6)> has no qualifiers.
19:19:04
TruePika
my code looks pretty much like what's in Practical Common Lisp, but using AND instead of +
19:42:22
drewc
TruePika: Is that starting from a from lisp, or a new package, or a new generic function with the old symbol unintern'd first? I am not familiar with the AND method combination, but the code you pasted should work, and works in my *slime-scratch* buffer with a quick test.
19:59:11
TruePika
I tried to issue an altitude change for plane A to 5,000; all that happened was reception of the first "A" (plane ID), then a bell
20:36:02
decuser
I would like to check a list to see if all of its members are integers. I wrote this code - (map 'list #'integerp '(1 2 A)) and it correctly returns (T T NIL). How can I get it reduced to just NIL?
20:36:59
decuser
I tried reduce using #'and, but it complained that AND wasn't a function. I'm using sbcl 1.3.14
20:40:35
jasom
someone (beach perhaps) was working on a representation for lisp source code that preserves more than READ. My searching for it is failing; anyone know what I'm talking about?
20:42:35
drmeister
jasom: I know about the thing that beach is working on to represent source locations and objects.
21:02:46
malice
How can I make quickload print out the compilation errors/warnings, e.g. when compiler cannot optimize something?
21:03:01
malice
I have (declaim (optimize ...)) in my code, and I must do C-c C-k because quickloading won't do
21:25:25
drmeister
The only think I know that exists is page 61 of this: http://metamodular.com/cleavir.pdf
21:29:07
Bike
https://github.com/robert-strandh/Second-Climacs/tree/master/Papers/Incremental-parsing something like this, i think
21:32:07
Bike
alexandria has it as array-index, which is... (integer 0 (#.(1- array-dimension-limit)))
21:56:37
jasom
I'm seeing a lot of poorly optimized lambdas when they close over a value that will be constant for the entire life of the lambda; is there a declaration I can use to hint this to the compiler?
21:57:04
jasom
I see a *huge* speedup by chainging it from e.g. (lambda () bar) to (compile nil `(lambda () ,bar))
21:59:33
phoe
Drakma question: how can I force HTTP-REQUEST to print the request to *standard-output* instead of sending it to the host?
22:00:25
jasom
Bike: no, the lambda does not have dynamic extent; it's just closing over values that are constant.
22:02:22
Bike
i mean, if you have (lambda () bar), it looks it up in a closure cell, if you do the compile it will be in a load time value cell thing
22:04:14
aeth
(declaim (inline constant-lambda-factory)) (defun constant-lambda-factory (x) (compile nil `(lambda () ,x)))
22:05:52
Bike
i'm not sure what optimization jasom is expecting to occur, but they said it does improve performance, so there must be something
22:06:17
Bike
constantly is likely defined in the obvious way, making it equivalent to (lambda (&rest ignore) bar)
22:11:26
jasom
Here's something closer to the real code (defun member-factory (bar) (lambda (x) (position x bar)) (member-factory "1") will generate fairly crummy code.
22:20:28
Bike
in that case the compiler is optimizing the position call to be something like (cond ((eql x #\1) 0)), i guess
22:20:35
aeth
(defun member-factory (bar) (let ((foo (constantly bar))) (lambda (x) (position x (funcall foo))))) (let ((foo (member-factory "1"))) (time (funcall foo #\1))) ; no observable improvement over the naive way, slower than (compile nil `(lambda (x) (position x ,bar)))
22:20:37
Bike
which it's not going to be able to do even if it knows the value of bar doesn't change, no?
22:22:19
Bike
yeah. so rather than a declaration you want a (limited) runtime compile, really. i've wanted that myself, but it's not in the language
22:24:22
jasom
well the compiler is permitted to generate a new function for each call to lambda; it's just typically inefficient to do so.
22:27:01
Bike
and rather than a declaration it would be more suited as syntax. (clambda (bar) (x) (position x bar)) or something clever like that
22:28:04
pillton
Because I'm guessing jasom wants the closure returned to be specialized to the type of sequence.
22:28:28
Bike
more like compiled specifically. if bar is constant the compiler can do a lot better than calling position-vector or whatever
22:28:58
Bike
i guess the other thing is that orienting the compiler to be able to look at the lambda and see what it can compile ahead of time and what it should delay to later is, well, complicated
22:29:16
Bike
interesting problem, of course, but pretty high effort, especially when you can indeed just call compile
22:32:40
jasom
(or "a" "b" "c" "d") gets compiled by esrap down to (position x "abcd"), except the "abcd" is a closed-over variable
22:33:16
Bike
my sense is that you should just call compile. i don't know how much time you'd even save by limiting it, really, and you'd still have to allocate a code object and all that jazz...
22:41:40
phoe
I want to run a process (as if by UIOP/OS:RUN-PROGRAM) and *not* wait for it to return. How do I do that?
22:42:16
jasom
phoe: A lot of work was done in the past few months on that, so first make sure you have an up-to-date asdf
22:43:46
Bike
actually i guess i could add cltl2 to cleavir with not much trouble, but it's kind of a janky interface anyway
22:46:30
Bike
anyway, cltl2 isn't like, really bad, it's just kind of old, has complex argument formats, stuff
22:51:49
Bike
middle of your head would be what, like the pons? you wanna go more for the top but a little bit underneath
22:52:15
jasom
pillton: in any event, here's what you want:https://gitlab.common-lisp.net/asdf/asdf/blob/master/uiop/launch-program.lisp#L422
22:54:40
pillton
jasom: Dam. Look at all the restrictions on the streams. Someone should write a CDR.
23:02:25
pillton
jasom: It isn't abandoned. I haven't head time to work on it with specialization-store and the other stuff I haven't released yet.
23:07:32
pillton
The interface also needs to be changed in order to handle the way Windows "posts" IO events. It only emits the signal once.
0:40:45
phoe
In other words: if anyone has ECL and Wine installed on a Linux box, could you try running the following:
0:40:48
phoe
(with-output-to-string (*standard-output*) (uiop:run-program (list "winepath" "C:\\some\\path") :output t))
1:25:18
myrkraverk
Ooops, some mac ransomware dude made a booboo: In other words, paying the ransom will not unlock the files.
1:53:48
akkad
is there a way to execute the format during the actual web request? also how do you convert the output from a funmction to a sequence? https://gist.github.com/3caed4edea5c6ae1aef86b83f6013c8f
2:39:23
TruePika
well, my current plan for the bot involves running up to 27 pathfinding operations per game tick
2:50:16
TruePika
nope, going to have to emulate with bit vectors if I want any sort of memory efficiency
2:51:54
White_Flame
do you have to complete the pathfinds per tick? There are ways to perform partial pathfinding, spreading the load out over multiple ticks, and still being able to move stuff on partial information
2:52:21
TruePika
White_Flame: actually, my plan is to run a pathfind every time a plane enters the "arena"
2:52:48
White_Flame
ACTION envisions mathematical planes somehow traveling through a space without intersecting
2:52:49
TruePika
but if it can't find a path (which should be rare), everyone's paths get recomputed
2:55:18
TruePika
the difficulty is that each airplane has a limited amount of fuel, so if there doesn't exist a path that can be executed, someone (who might have more fuel to waste) will have to get out of the way
2:56:35
TruePika
I believe the absolute minimum amount of time a tick can be is one second, but if the pathfinder is too slow, those 27 operations can take too long and cause the game state to advance before the bot can decide on what to do
3:01:08
TruePika
SBCL's man page: Multidimensional arrays are inefficient, especially multidimensional arrays of floating point numbers.
3:01:48
krwq
TruePika: that sounds like you should invest time on fixing that problem instead of investing in working it around
3:05:24
Bike
right, so the way sbcl does arrays is that one dimensional simple arrays are just themselves, but anything else is a complex header with an underlying one of those as its "storage vector". so access is less direct, for a start
3:06:21
krwq
ok but you can technically detect how that array is used and create a better code from that
3:07:51
krwq
let's just create macro: with-optimized-array-1 which detects if you created n-dim-array and corrects the code. if you used that in a subcall then it won't optimize it
3:08:44
TruePika
Would it theoretically use a bit vector at the base, or a simple array of one-bit values (each taking the word size)?
3:09:03
krwq
the generic version would be tougher i guess but that's why i have started learning lisp so that language is not getting into my way
3:09:42
Bike
i said "one dimensional simple array" because "simple vector" means something else, for sorta dumb reasons