freenode/#lisp - IRC Chatlog
Search
22:22:51
aeth
I'm surprised there's nothing that has really hit HN yet. https://news.ycombinator.com/from?site=tymoon.eu
22:28:19
Shinmera
Though I've been wondering if I should even bother posting those too since I don't really seem to get extra visitors aside from the regularls anyway
22:45:13
shrdlu68
What was that function for reporting memory stuff in an implementation-defined manner?
22:48:26
Shinmera
SBCL recently got a function to get the size of an object. Can't recall what it's called, though
22:51:25
shrdlu68
Does an N-bit unsigned-integer consume as much memory as an N-bit simple-bit-vector?
22:52:59
phoe
integers would most likely be stored in boxes, be it fixnums or bignums, and vectors also need boxes
22:54:02
aeth
Oh... As far as forum-style things with Lisp content, I'm aware of comp.lang.lisp, r/lisp and r/common_lisp on reddit, the lisp and common-lisp tags in stackoverflow, and at least one traditional-style phpBB forum (the one I can find right now is LispForum, but I'm not sure if there is more than one because all phpBB looks the same). If anyone wanted me to elaborate on "one of the few Lisp places"...
22:54:55
aeth
Only reddit (and maybe comp.lang.lisp if it's major?) seem suitable for announcements rather than tech support
22:56:16
aeth
pjb: you're not kidding, gavino is... all but one of the February content (as far as thread creators goes)
22:57:22
aeth
People who actually spend time doing other things cannot possibly compete with someone who literally lives on the Internet.
22:59:58
aeth
pjb: One day, all of the content on the Web will be created by spam bots and trolls (and it will be increasingly hard to tell them apart) as people move on to the next thing.
23:03:13
aeth
I've already stopped using a lot of the Web because it has lowered in quality to essentially nothing. e.g. I don't read news articles anymore. (And it doesn't help that a significant fraction of shared news articles aren't even available without a paywall... The WSJ is probably the worst offender here. People probably share it based on the headline alone.)
23:03:33
aeth
But I just go to other websites instead. Nothing has really threatened it except apps, which are like modern websites, but worse and without easy adblocking.
23:05:21
shrdlu68
After I run a function, #'room tells me that there are all these objects taking up memory that weren't there before.
23:05:52
aeth
shrdlu68: disassemble that function and look for allocations, which is especially easy in SBCL
23:06:19
aeth
No need to guess with things like room, you can get exact results with disassemble or sb-profile (one method reads and looks for allocations, the other detects consing)
23:06:35
pjb
shrdlu68: also, if you work in the REPL, the variables * ** *** / // /// - + ++ +++ keep references to previous stuff.
23:07:32
shrdlu68
That might be it, because running the function twice with the same large input exhausts heap the second time.
23:08:20
aeth
shrdlu68: Is it possible to preallocate something and setf parts of that preallocated thing?
23:08:46
aeth
You could even make it external to the function, put it in a *foo* and recycle it each call. (foobar *foo* 1 2 3) or something
23:10:25
shrdlu68
The function creates a large hash-table, but it's not persistent. Should not be around after the function exits.
23:13:27
jasom
ACTION has finally gotten a full REPL in the browser running only on the client after trying and failing for years.
23:15:32
jasom
phoe: I mean not "Run this lisp code on the server and print the result" but "run this lisp code in the browser and print the result"
23:16:55
jasom
phoe: trivially kawa comes up in under 5 seconds and is an example for the JVM I am using
23:21:45
jasom
http://plasma-umass.org/doppio-demo/ <-- kawa is available from the command line there
23:22:51
White_Flame
(defmacro foo (&rest params) `(progn ,@(mapcar (param) `(call-something ,param))))
23:23:55
White_Flame
(defmacro foo (&rest params) `(progn ,@(mapcar (lambda (param) `(call-something ,param)) params))))))))))))))))))))))
23:25:20
White_Flame
just do (mapcar (lambda (param) `(call-something ,param)) '(1 2 3 4 5)) individually
23:26:07
White_Flame
hence macros tend to be more advanced, after you're more familiar with the language
23:26:27
White_Flame
a rule of thumb is that you shouldn't use a macro unless you can't express it with a function
0:01:03
jasom
aha, I found what is so slow with ABCL on Doppio: compiling DEFUNs takes a *long* time; I wonder if I could precompile the initialization lisp script to a .class
0:40:43
emaczen
how does restart-inferior-lisp work exactly? I would like to perform this function programmatically
0:41:19
Xach
emaczen: i don't know, but if i wanted to find out, i'd look at the source of slime-restart-inferior-lisp
0:42:44
whartung
then the question doesn’t make much sense since the “inferior lisp” is an emacs concept
0:43:07
emaczen
Xach: Yes, my question is how do I perform this same function, preferably without emacs
0:43:38
whartung
you tell the lisp to die elegantly and restart it, or you kill it (politely or forcefully) and restart it
0:44:18
whartung
you restart programmaticlaly just like you start any program programatically (i.e. exec as mentioned)
0:44:19
jasom
emaczen: then wrap lisp with a program that manages it and setup a way to signal it from lisp, or you can try exec hacks if you're on *nix as others have suggested
0:46:01
pjb
Now the thing is that exec is a little violent. Perhaps you would want to terminate gracefully the current process.
0:46:30
pjb
Then you could try something like: (if (zerop (fork)) (progn (sleep 3) (swank/backend:exec-image "ccl")) (quit))
0:49:05
emaczen
Actually, I think I could use run-program in a loop, and use my lisp program as the executable
0:56:01
jasom
evaluating a simple DEFUN on firefox: 258s same DEFUN on chrome under 1s... I'm thinking perhaps I found a GC corner case on firefox
0:59:44
Xach
I believe uiop/foo and asdf/foo are meant to be treated as implementation details, and you are supposed to use uiop:whatever instead.
1:00:23
jasom
but honestly I check uiop for any system functionality that isn't in the hyperspec and alexandria for any algorithmic functionality that isn't in the hyperspec
2:04:43
pjb
whoman: for very simple uses of CLOS, a direct mapping could work. If you declare all your methods virtual.
2:05:59
pjb
whoman: you will have more difficulties translating that, (and even more, such as custom method combinations), into direct C++ code.
2:06:36
pjb
whoman: notice that you could use the MOP in C++, cf. OpenC++ http://informatimago.com/articles/life-saver.html
2:06:54
pjb
whoman: but it's a patch to an old gcc which hasn't been ported to more recent gcc, much less to clang.
2:07:57
pjb
oh, right, it's also easy to find at least light use of the MOP in CLOS programs! Then you won't have a direct translation to C++. (unless you upgrade and use OpenC++ MOP).
2:15:43
Bike
even if it did, it wouldn't really work the same, since in C++ many objects are destructed upon leaving scope
2:20:26
stacksmith
Is there an idiomatic way of 'unflattening' a list - that is turning a list like (a b c) into (a (b (c)))?
2:24:22
Bike
(defun unflatten (list) (cond ((null list) nil) ((null (rest list)) (list (car list))) (t (list (car list) (unflatten (rest list))))) is all i can think of.
2:28:26
stacksmith
It's actually to convert a DSL that is linear to a functional notation. LIke ((fun1 a)(fun2 b)(fun3 c)) to (fun3 c (fun2 b (fun1 a)))...
2:29:46
stacksmith
And insert the result of each function application as an extra argument into the next.
2:30:25
ig88th
I am currently having issues having ASDF/quicklisp load projects. I wrote a better description of my problem here: https://stackoverflow.com/questions/48675274/when-installing-quicklisp-on-windows-10-where-should-i-put-config-common-lis
2:31:12
ig88th
I don't know if anyone else uses Common Lisp on Windows, but I would really appreciate any suggestions
2:34:30
ig88th
Xach: I get the same error when I just try to use ~/quicklisp/local-projects: https://gist.github.com/ig88th/4338184cec847f6eef6e01baa94b538e
2:39:33
pjb
whoman: well, going from C++ to CLOS is another can of worm, sincee in C++ the methods are attached to the classes, while in CLOS they are attached to generic functions.
2:40:10
pjb
whoman: however, it is possible to NOT use CLOS (or use it only as the basis to implement the following), but to implement an object system in CL that matches the C++ object system.
2:40:21
ig88th
Xach: I am using the most recent version of Clozure CL, 1.11.5, and the 64-bit version
2:40:25
pjb
whoman: if you have a lot of code to convert, this would be a good idea to do it that way.
2:41:03
pjb
whoman: in that case, you basically implement the C++ object system into CL, just like CLOS is implemented in CL.
2:41:42
ig88th
Xach: I am getting 'System "swatch" not found [Condition of type QUICKLISP-CLIENT:SYSTEM-NOT-FOUND]' after running (ql:register-local-projects) and then trying to quickload
2:41:48
stacksmith
So (defun chain (list) (when list (append (car list) (list (chain (cdr list)))))) is the best I could do... after reversing...I can't believe there is not a tool for 'functionalizing' lists...
2:42:24
pjb
(you may need to add some syntactic support, ie. define some with- macro to make it simple, otherwise you could have to implement a sophisticated code walker and compiler-like algorithms to implement RAII and destructors with the same semantics as in C++).
2:42:59
pjb
Notice that in most CL implementation, there's a finalizer mechanism that can be used for dynamic destructors.
2:43:05
Xach
ig88th: ok! so can you tell me what you get from (directory "~/quicklisp/local-projects/**/*.asd")?
2:43:39
ig88th
Xach: I get '(#P"C:/Users/ig88t/quicklisp/local-projects/swatch/system.asd" #P"C:/Users/ig88t/quicklisp/local-projects/swatchblade/system.asd")'
2:44:31
pjb
But yes, I would say that RAII is a bad abstraction. We have unwind-protect and with- macros.
2:44:37
Xach
ig88th: Oh, I think I see the trouble. I think it could be a bug in quickproject! I think you might have better luck if you use a trailing slash on the pathname you give to make-project.
2:45:41
ig88th
Xach: same error when I use a trailing slash such as (quickproject:make-project "~/quicklisp/local-projects/swatch2/" :depends-on '(vecto hunchentoot))
2:46:34
ig88th
Xach: now I get (#P"C:/Users/ig88t/quicklisp/local-projects/swatch/system.asd" #P"C:/Users/ig88t/quicklisp/local-projects/swatch2/system.asd" #P"C:/Users/ig88t/quicklisp/local-projects/swatchblade/system.asd")
2:46:56
pjb
whoman: also, perhaps you could consider clasp, since it integrates C++ with CL natively.
2:47:12
Xach
ig88th: Ok. I don't know why quickproject is creating system.asd instead of the proper name. The short-term fix is to rename system.asd to what it really should be, or to not use quickproject for now.
2:47:20
whoman
yes i am on the page now, but i have no system to compile it. i also looked a bit at ECL
2:47:55
pjb
whoman: ecl can be compiled using a C++ compiler instead of a C compiler, but I don't know what that brings in terms of C++ integration with CL. Ask in #ecl.
2:48:24
Xach
ig88th: oh, one more question, what do you get from (ql:where-is-system "quickproject")?
2:49:04
ig88th
Xach: sure. I get '#P"C:/Users/ig88t/quicklisp/dists/quicklisp/software/quickproject-1.3/"' when I run (ql:where-is-system "quickproject")
2:50:02
Xach
ig88th: ok. i see that quickproject doesn't work properly in ccl, so I'll try to figure it out. Thanks for the info!
2:51:33
ig88th
Xach: also I stumbled on this line of code and thought it might be related: https://github.com/quicklisp/quicklisp-controller/blob/master/asdf.lisp#L6247
3:32:13
ig88th
Xach: but it took creating a project using quickproject with sbcl to be able to load it; the quickproject creations under ccl are unable to be loaded
3:42:04
ig88th
Xach: actually it looks sort of complicated. It seems I can only load projects created within that slime session with sbcl; when I restart emacs and slime I can no longer load that project.
3:43:53
Xach
ig88th: i wish i could help but it's time to sleep. interactive debugging will be required.
3:59:24
drmeister
Is there a function that takes a list of symbols and returns the list of unique symbols?
4:14:03
beach
iqubic: When we write LISP, we usually mean some pre Common Lisp language. We have written in "Lisp" for several decades.
4:14:44
White_Flame
but yeah, the modern statistical AI is just math, doesn't need any special language support like symbols & metaprogramming
4:14:53
iqubic
Really? The people in #emacs were telling me that I should use python, and then called me a troll for not knowing much about AI.
4:16:42
pjb
iqubic: for statistical methods, languages more optimized for the current hardware may be more indicated (eg. cuda if you use nvidia hardware).
4:16:54
White_Flame
obviously things like computer vision are going to be crunching lots more numeric arrays than logical inference
4:17:17
pjb
iqubic: however, statistical methods are not the be all-end all of AI methods. Currently, commercial ventures are totally losing sight of symbolic methods.
4:18:01
pjb
iqubic: cf. the point of view about AI of people like Hofstadter https://www.youtube.com/results?search_query=Hofstadter+AI
4:18:46
pjb
iqubic: and then, even if you consider statistical methods, I would consider using lisp to compile high level system definitions and compose statistical modules, including at run-time.
4:18:46
White_Flame
when people say "AI" unadornedly, they're usually talking about some variant of "machine learning" today
4:19:56
iqubic
All I'm trying to do is write a program that works to get the highest score in the game 2048.
4:24:48
iqubic
The original question: "What stratergy do I think will wrok best for a program that plays 2048?"
4:27:14
iqubic
Let me ask another question than. Is there a CL graphics library that works with SBCL.
4:28:42
White_Flame
cepl brings graphics more native to CL style, rather than just being raw opengl bindings
4:30:07
White_Flame
I'd think you're usually opening up a separate opengl context GUI window, so it doesn't matter how you're talking to the lisp image
4:32:25
iqubic
White_Flame: What I really want is emacs company completion and documentation via C-h f / C-h v for whatever library I use.
4:33:24
White_Flame
whether it's a database connector library, or a graphics connector library, or soket connector library, all the same
4:33:54
iqubic
Yes, but I have no idea how to tell emacs what libraries I'm using so that it can fetch the documentation I need.
4:34:25
White_Flame
well, I haven't used documentation features, if you're talking about mor ethan docstrings
4:43:48
beach
iqubic: When we write LISP, we usually mean some pre Common Lisp language. We have written in "Lisp" for several decades.
4:46:31
beach
iqubic: I see two reasonable definitions of "interpreted language". The first one is that the language CAN BE implemented by an interpreter, and the second is that it HAS TO BE implemented by an interpreter. The first definition implies that every language is interpreted, and the second definition that no language is interpreted.
4:47:24
beach
iqubic: Well, you could try doing a little bit of research on your own. Terms like "computer vision" I am sure have Wikipedia entries.
4:48:40
beach
"The term is somewhat vague. In principle, any language can be implemented with a compiler or with an interpreter"
4:52:32
beach
iqubic: I agree with White_Flame. This channel is about Common Lisp, not about you. Try to keep the question more Common Lisp related.
4:53:10
White_Flame
but I think the real fundamental issue is you're probably trying to bite off more than you can chew at once
4:53:32
White_Flame
you need to work with some simpler problems before jumping right into opengl + AI + CLOS + whatever else
4:58:33
pjb
iqubic: you cannot understand OO if you know C++. You have to learn Smalltalk to understand OO. Smalltalk is simple. (It's made for children).
4:59:08
pjb
iqubic: alternatively, you may learn Objective-C, which is C+Smalltalk, but it's more complicated because of the C part.
4:59:48
pjb
iqubic: Sometimes, in universities, one learns OO by implementing it in lisp (or scheme), instead of learning Smalltalk. It's also a good way to do it.
6:21:40
krwq
hello, does anyone know if there is a way to make swig generate valid fields from the header file which uses bitfields? it currently seems to be generating for 4 :unsigned-int fields instead of 29+1+1+1 bit numbers
6:41:08
krwq
I ended up with %ignore in swig file and redefining the struct by myself using a single uint - ifanyone knows a better way to handle that please let me know
10:18:56
flip214
I've got a GF with multiple methods which have EQL specializations on the first argument.
10:19:19
flip214
I can list them via GENERIC-FUNCTION-METHODS, but how would I selectively call one of them?