freenode/#lisp - IRC Chatlog
Search
10:46:54
jmercouris
not looking for something as full blown as curses, but just like a way to make and print menus
10:47:06
jmercouris
of course I could roll my own rather easily, but just wondering if something already exists
10:47:28
jackdaniel
I've written cl-charms tutorial lately: http://turtleware.eu/posts/cl-charms-crash-course.html
10:48:16
jackdaniel
https://asciinema.org/a/KNDnnycLc2uHMsmi7YvFMUpau ← here is tutorial final effect
10:49:19
jmercouris
I just fully appreciate the fact that it is possible for clim to be loaded into a terminal, blows my mind
10:51:18
jackdaniel
loke: depends on use - displaying images or non-rectangular shapes won't be pretty for sure
10:53:48
jmercouris
jackdaniel: not sure if you are interested, but I found a small grammatical issue in your article
10:55:35
beach
jmercouris: The reason McCLIM uses CLX is that, when I wanted a GUI library for Gsharp (score editor), I wanted to have as little foreign code as possible, and CLX is mostly written in Common Lisp. That is also the reason why McCLIM exists at all. I was not willing to use any GUI library written in some other language.
10:56:41
beach
jmercouris: So, I would be very unhappy, if the CLX backend was dropped in favor of a single SDL-based solution, since SDL is not Common Lisp code.
11:00:44
|3b|
ACTION suspects a lot of the work involved in a SDL backend could be shared with a glop backend... not sure a glop backend would be all that good of an idea either though :)
11:03:00
|3b|
arguable whether it is as "pure cl" than CLX, since it does FFI on the user side rather than hidden behind implementation-specific networking APIs
11:03:05
beach
That actually looks appealing if what it states is true, i.e., that system functions are used directly.
11:04:25
|3b|
ACTION doesn't have any OSX though, so all my knowledge of that is second hand at best
11:04:35
beach
Well, if system functions are used directly, they could be hidden behind an abstraction layer that would allow someone to replace the FFI layer by some native implementation of the system functions.
11:09:04
beach
ACTION should be quiet since we are entering a territory of which he knows very little.
11:09:05
|3b|
i'm guessing that none of the options (glop or either of the sdl bindings) was particularly designed with that in mind though
11:28:31
jmercouris
beach: Ultimately CLX must have some non-lisp code if only to interface with the OS
11:38:20
|3b|
X programs tend to mix with 'native' things on windows even worse than GTK or whatever :p
11:39:18
|3b|
also hard to get good GL performance out of things using CLX (admittedly not something everyone cares about)
11:50:14
Shinmera
GLOP is a good idea, but unfortunately as it is right now it's pretty severely broken
11:54:04
Shinmera
if I remember correctly on Windows it's a fixed size window that doesn't show in the taskbar and can't be moved (??), and on OS X it doesn't work at all on recent versions.
11:54:56
|3b|
ACTION doesn't have that problem on windows, possibly it has some bad defaults that i don't use though
11:58:15
|3b|
ACTION isn't trying to suggest you didn't have problems, or that you did something unreasonable if you did... just that there is a way to use it that works
12:00:39
|3b|
ACTION should probably make sure i'm not using any important fixes that haven't been pushed
12:03:48
Shinmera
FWIW this is the glop backend https://github.com/Shirakumo/trial/blob/master/backends/glop/context.lisp
12:04:49
Shinmera
The vsync stuff doesn't work and I'm aware of that, but the problems I encountered were independent of that
12:06:29
|3b|
ACTION has it using dwm instead of wglSwapInterval where appropriate, but still not getting it initialized correctly somewhere i think
12:19:28
|3b|
Shinmera: i suspect your window would be created in wrong thread on OSX (if you manage to run glop on OSX in the first place), not really sure exactly what's going on there though
12:23:13
|3b|
ACTION was looking at https://github.com/Shirakumo/trial/blob/master/backends/glop/context.lisp#L181
12:25:45
|3b|
if that isn't called until start, what is in https://github.com/Shirakumo/trial/blob/master/backends/glop/context.lisp#L172 ?
12:26:27
Shinmera
Ah-- you're right, that's wrong. Shouldn't call create-context automatically there.
12:29:16
solene
jackdaniel, I'm writing a software that should run in a "kiosk" mode so I should forbid access to the shell
12:29:52
Shinmera
I've had reports of harmony segfaulting on windows, so I've been meaning to dive back into platform bullshit anyway.
12:31:27
Shinmera
But I should have time to check things this week. Last exam was today, so I finally got my mind (and schedule) free again
12:32:38
solene
|3b|, I tried with this code but it triggers a "simple error" now : (handler-case (main) (interactive-interrupt () (quit)))
12:32:48
|3b|
ACTION wonders if glop would get confused if you opened the window twice (assuming you also create-context elsewhere)
12:33:17
Shinmera
I'm not sure if that's the case right now, it's been a while since I rewrote the context stuff.
12:37:03
solene
|3b|, I still have the same error with (handler-case (main) (sb-sys:interactive-interrupt () (quit)))
12:37:27
|3b|
(which i think is technically a package you aren't supposed to use, but not much choice here, so hopefully they won't change it any time soon)
12:38:58
solene
|3b|, oh sorry I didn't see, it didn't compiled with ecl so I was trying the same binary. ecl can't find sb-sys or sb-ext
12:40:39
|3b|
CL spec doesn't (and shouldn't) say anything about ctrl-c, so details are specific to each implementation
13:17:22
Xach
From my stats, it was only used for a few thousand requests, most recently on 2013-10-08.
13:26:17
Xach
heh, since recording started, there have been 124,930 ECL requests, 1,389,988 Clozure CL requests, and 10,851,074 SBCL requests.
13:42:52
Cthulhux
it has an insane default price which is not THAT much better. also, if you want multi-platform lispworks, it IS insane
14:41:43
Xach
thanks dim for getting me started with importing log stats into postgres. finding out stats was a breeze.
14:47:14
Xach
dlowe: no, probably just download stuff as needed. or maybe just use shopmade libraries.
15:05:00
|3b|
and does look like someone removed asdf-install links from cliki, so probably hasn't worked in a while (and probably many of the links were dead by then anyway)
15:06:39
tfb
Cthulhux: LW's price is only insane if your time is very cheap (which, for someone doing something for themselves it is: I am not trying to suggest it's not expensive). It's less than four days of a contractor's daily rate for instance, so maybe 2% of their annual cost. If it makes them more than 2% more efficient it's paid for itself.
15:07:37
killerstorm
Hi people, does anyone have experience with cl-yacc? Specifically, you do you deal with optional productions.
15:09:06
killerstorm
I'm trying to fix a library which uses (empty) production as an alternative for optional productions. but that doesn't seem to work, and I think I know why...
15:19:56
Cthulhux
tfb: Lisp is a free time hobby for me, so I'm really not in a position to judge here.
15:25:19
tfb
Cthulhux: this probably doesn't belong here, but commercial SW that's not popular has to be expensive: if I sell only n copies of product x per year, I need to charge at least (salary + costs)/n per copy, and if n is small ...
15:28:56
beach
Cthulhux: That's why software is a winner-takes-all market. Bigger market share means price can be lower, which means increased market share.
15:40:53
Cthulhux
Which also means that it is weird that SBCL hasn't spawned an enterprise-grade IDE yet.
15:46:16
Cthulhux
I thought the general opinion is that LispWorks is an "enterprise-grade IDE" which is why they can take "enterprise-grade prices"
15:46:39
beach
Is it "can be handled by developers with almost no training, neither in computer science, in software engineering, nor in programming"?
15:47:35
jmercouris
I'm trying to come up with a good scenario for where you'd use hooks in your browser, so far I've come up with a ficticious scenario where every time you set a bookmark, you want to append the web page to a file on your computer with some keywords as part of a journal or something
15:48:03
jmercouris
this scenario will be used as part of a blog post promoting next, so any ideas that play to the strengths of CL and offer some wow factor are appreciated
15:48:11
|3b|
price is for support, gui libs and other libs, and running existing expensive code that depends on them :)
15:48:18
beach
jmercouris: CLX does have a small amount of non-Lisp code. But I don't see why you say that it would "have to".
15:49:17
jmercouris
beach: Well, it's not turtles all the way down is it? ultimately we have to interact with something that isn't lisp
15:49:52
jmercouris
beach: sure, you have to have some knowledge of which syscalls are available on a system, those have to be embedded into your CL system
15:50:11
jackdaniel
beach: to my best knowledge there is no ffi usage nor foreign code (there are some implementation-specific bits of course)
15:51:15
jackdaniel
jmercouris: clx "talks" with X server via a socket, it doesn't perform syscalls or library calls on it
15:51:23
|3b|
jmercouris: after running firefox for a while, it tends to take up lots of ram, and sometimes CPU. would be nice to be able to dig into things and see which pages are causing problems. or see which pages try to use various features (camera or webvr or whatever)
15:53:21
jmercouris
|3b|: That would be interesting, I'll keep that in mind, but for now I'm looking for a cool way to use hooks basically
15:54:26
|3b|
jmercouris: yeah, that's what i meant (assuming your definition of hooks would let me do that sort of thing) :)
15:54:48
jackdaniel
beach: there are files two with ".c" extension but they are not loaded with the system (they are legacy files)
15:55:10
jmercouris
|3b|: You can hook into literally any type of function, question is moreso, how would I determine when to check, like after which events? every time I open a page? to issue a warning that a page has very slow js?
15:56:10
tfb
jmercouris: can you hook things in the way that (say) Stylish does / did, to control how things render?
15:56:56
jmercouris
tfb: You may hook to literally any event, so you may inject css or js or whatever before a page load
15:57:12
|3b|
jmercouris: yeah, now that i think about it, probably too late to use hooks by the time i decide i want to find out what's happening :/
15:58:02
tfb
ie 'I'm about to render something from Wikipedia.org, insert this CSS to make it look like I want'
15:59:18
jmercouris
then you need something like an alist as well for different JS on different sites
15:59:26
beach
jackdaniel: This is what I found: https://github.com/sharplispers/clx/blob/master/socket.c
16:08:28
beach
jmercouris: So I was wrong. CLX not only does not have to use foreign code, not even "technically". And it doesn't.
16:31:33
Xach
I'd like to make a chart of the trends over time. CCL and SBCL used to be closer (I think)
16:32:55
dlowe
I've often thought that what would be neat would be an app server that was able to take a higher-level widget description with a socket protocol.
16:33:52
dlowe
and web browsers more recently, though they're a bit overpowered for what I was thinking.
16:48:00
lerax
Hey guys, how I can fetch all the symbols on a package? I know that I can use (apropos <string-designator> :package), but there is a string-designator like a wild card for all symbols?
16:49:01
pjb
(length (com.informatimago.common-lisp.cesarum.package:list-symbols :cl-user)) #| --> 856 |#
16:49:30
pjb
(length (com.informatimago.common-lisp.cesarum.package:list-symbols :cl-user :exported t)) #| --> 0 |#
16:52:51
pjb
lerax: however, (apropos-list "") is probably non-conforming: it wil give you results depending on the implementation.
16:53:55
pjb
Case-sensitivity and extensions such as regular expressions are implementation dependent.
17:05:24
sjl
jackdaniel: small typo in the charms tutorial post: in the First Application section it says it makes a 50x15 window, but the call is (charms:make-window 50 50 10 10)
17:36:27
Xach
lerax: projects in ~/quicklisp/local-projects/ will be loaded before projects quicklisp provides itself!
17:36:46
Xach
lerax: http://blog.quicklisp.org/2018/01/the-quicklisp-local-projects-mechanism.html has more details
17:59:27
sigjuice
lerax if you are running slime then C-c C-d C-p ql RET will do the equivalent of (apropos "" :ql)
18:10:50
whoman
in emacs, the inspector has a tree and you can click on stuff and perform actions with menus.
18:11:19
ecraven
yes, but I want to see the actual slime->swank messages, those won't show up in the inspector
18:13:04
whoman
logically, if *slime-events* contains the slime-swank messages, there they are, upon inspection
18:42:24
phoe
(documentation #'foo 'function) ;=> WARNING: unsupported DOCUMENTATION: doc-type FUNCTION for object of type STANDARD-GENERIC-FUNCTION
18:45:00
beach
Hmm, no there is a method for it: documentation (x function) (doc-type (eql 'function))
18:46:15
phoe
Not really a bug, because "An implementation is permitted to discard documentation strings at any time for implementation-defined reasons. "
19:10:36
ecraven
would it be possible to properly export swank::inspector-call-nth-action from swank, so that it is accessed by swank:inspector-call-nth-action (single colon)?
19:11:02
ecraven
I have a mostly-working swank for r7rs schemes, but :: does not work at all under kawa, its reader dies (it is used for type annotations there)
19:11:20
ecraven
I know that scheme is not at all a priority, but it would be a simple change and should not influence anything else much
19:12:20
jackdaniel
I don't see technical problems with that - make a PR and see what maintainers say
19:13:23
ovidnis
I'm getting a compile-file-error while compiling #<CL-SOURCE-FILE "static-vectors" "impl"> when I try to quickload caveman2
19:28:14
ecraven
jackdaniel: https://github.com/slime/slime/pull/428 I hope this is simple enough to get it merged ;)
19:33:07
Xach
ovidnis: i usually download the latest binary if i'm starting from scratch, or build from git if i already have a binary
19:44:32
phoe
practically, it still tends to fail here and there, but it makes for a very nice SBCL installer.
19:47:04
phoe
Some people like having a tool that can switch between different Lisp implementations and versions
19:58:40
ebrasca
Can I format 3 as "03" instead of " 3". I am using someting like (format t "~2x" i)
20:15:35
shrdlu68
When comparing two bit vectors with #'equal, I notice it does not immediately return nil if the bit vectors are of different lengths.
20:21:58
Bike
both the definition and transform for bit-vector-= check for length equality before looking at the actual bits, as far as i see
20:39:39
stacksmith
Greetings. Am I correct about this: if a macro has an optional or keyword parameter with an init-form, and the init-form relies on another parameter, such init-form needs to be backquoted with said parameter unquoted to expand correctly... Yikes.
20:45:12
stacksmith
It can be implemented with an conditional that selects one of two expansions - one using a provided parameter, another into a let form to evaluate it once, I suppose.
20:46:33
stacksmith
_death, I am not sure about the inference about the interface... Technically, one should be able to _use_ a macro or a function without knowing which one it is...
20:48:01
ig88th
where am I supposed to put .config/common-lisp/source-registry.conf.d/projects.conf on windows?
20:48:45
ig88th
I've tried my home directory C:\Users\ig88t\ as well as C:\Users\ig88t\AppData\Roaming\ (which is where emacs wants it's .emacs.d folder, so I thought asdf might be the same)
20:49:25
pjb
stacksmith: this means, for macros, at macroexpansion-time, which is usually at compilation-time.
20:50:17
Bike
The manual says "For Windows users, and starting with ASDF 3.1.5, start from your %LOCALAPPDATA%, which is usually ~/AppData/Local/ (but you can ask in a CMD.EXE terminal echo %LOCALAPPDATA% to make sure) and underneath create a subpath config/common-lisp/source-registry.conf.d/."
20:50:23
pjb
stacksmith: whether you need to quote or not the initform depends on what you what to evaluate!
20:53:06
Bike
it's in kind of a random place, footnote 3 here https://common-lisp.net/project/asdf/asdf.html#Configuring-ASDF-to-find-your-systems
20:53:52
ig88th
Bike: I came across that page earlier but I guess I didn't check the footnotes! thank you!
20:54:04
stacksmith
pjb: indeed it does... A bit confusing with multiple evaluation issue, as it is not immediately obvious how many times ,a gets expanded..
20:54:12
pjb
stacksmith: and indeed, as _death mentionned, macros can be expanded any number of times, and not necessarily while compiling or intepreting (eg. they can be called by the editor or some other tools). Therefore expressions evaluated by the macros, including their initforms, must be prepared to be evaluated in strange environments.
20:57:06
pjb
stacksmith: (defmacro foo (&optional (a (with-open-file (io "foo" :direction :io :if-exists :append :if-does-not-exist :create) (prog1 (progn (file-position io 0) (read io nil 'foo)) (file-position io (file-length io)) (print (get-universal-time) io))))) `',a)
20:59:44
stacksmith
pjb: - is there a preferred way to deal with this? I haven't seen anything mentioned about this... I suppose the wisest approach is to use &key to be certain about the argument being supplied, and expand a let form evaluating the original argument, then the 'optional one'...
21:02:05
pjb
stacksmith: the only thing is that if your macro has side effects, then you must ensure that it still give the same results for it to be conforming.
21:03:44
stacksmith
pjb: Not complaining at all! Just trying to understand if (defmacro foo (a &optional (b `(+ 1 ,a)) `(values ,a ,b)) should be implemented differently because of uncertainty about the number of ,a expansions...
21:04:52
pjb
stacksmith: in this case it doesn't matter, since (+ 1 a) will always return the same thing, without side effect. (loop with result repeat (1+ (random 10000)) do (setf result (+ 1 a)) finally (return result)) will always do the same thing as (+ 1 a).
21:05:47
pjb
Yes, in this case, either you document your macro, and let the user deal with it, or you write it otherwise, so that the expression bound to A is evaluated only once.
21:06:28
Bike
there's no uncertainty. if you pass one form, it'll be evaluated twice, if the + doesn't signal an error etc
21:07:15
pjb
Something like: (defmacro foo (a &optional (b nil b-p)) (let* ((a ,a) (b (if b-p b (+ 1 a)))) `(values ,a ,b)))
21:07:36
ig88th
okay I can't seem to figure out where the config file should be on windows. I've located this function (https://github.com/quicklisp/quicklisp-controller/blob/master/asdf.lisp#L6247) in asdf that I think hints at the right answer, but I am unsure of what to make of it
21:07:54
pjb
Bike: macro calls can be evaluated more than once. if foo evaluates a once, then (foo (incf a)) may increment a 1 or more times.
21:09:47
phoe
stacksmith: you'll need to pull the initform from the lambda list and put it in the body.
21:11:43
stacksmith
There is little advantage in macros having anything complicated in init-forms, I suppose. Functions in SBCL wind up having multiple entry points, for efficiency.