freenode/#lisp - IRC Chatlog
Search
10:22:19
aeth
My first reaction was "oh verisimilitude is back, isn't verisimilitude the one with the odd style?" and then I read the text and it's a style debate. Some things never change. :-)
10:23:19
aeth
I guess you can assume most Lispers are unlearning C and/or C++. For a while there there was a very good chance that people might've learned Java instead of C++, but thanks to Oracle's neglect after the Sun acquisition, C++ kind of made a comeback in teaching afaik.
10:25:52
aeth
JavaScript might actually be a "security feature" as in a "don't cheat the survey" feature. Obviously this assumes that it's the worst case, privacy-destroying JS, too, which is probably is. On the other hand, thanks to the recent Nevada Caucuses (last Saturday), we can now say that Google Forms were used for an election so...
10:30:01
aeth
As for USE, IMO you can (probably) safely use exactly one thing other than CL, assuming that it's very unlikely that a conflict will be introduced later on, especially if e.g. it's another one of your own libraries.
10:31:24
no-defun-allowed
To be fair, I was able to repeatedly send a HTTP request to resend my response many times a couple of years ago with Google Forms.
10:32:53
aeth
But I I'm guessing the USE stuff is in response to https://old.reddit.com/r/lisp/comments/f98d1h/modern_functional_common_lisp_myths_and_best/fipyf7u/
11:19:18
phoe
aeth: using exactly one thing other than CL won't be a big issue as long as you are sure to *not* define stuff on the symbols that are used from that package
11:19:51
phoe
and by USEing a package, you allow it to define which symbols of the using package belong to the used package.
11:24:06
phoe
was thinking of e.g. :use :alexandria which is a fully external and independent package
11:24:31
aeth
:use :alexandria is problematic because not enough people do that, so it's really easy to get conflicts, so I'm surprised so many people say it's used so often
11:25:00
aeth
alexandria uses some ultra-generic names where it's likely some other library also tries to solve the same thing
11:26:46
aeth
Although I suppose the issue is when new conflicts are introduced, since known ones can be worked around.
12:16:54
jmercouris
hello everyone, I'm trying to extend cl-webkit bindings http://dpaste.com/2YJ30D6
12:21:29
jmercouris
as you can see I am trying to add a single slot titled navigation-action of type WebKitNavigationAction
12:23:25
jmercouris
You can see the version I've made on this branch: https://github.com/atlas-engineer/cl-webkit/tree/navigation-action
12:23:52
jmercouris
these are the changes I've made: https://github.com/atlas-engineer/cl-webkit/commit/94cfbd961e53eafcac18b0a8b667bd933be9ab72
12:28:42
jmercouris
according to here: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitNavigationPolicyDecision.html#webkit-navigation-policy-decision-get-navigation-action
12:52:14
LdBeth
jmercouris: "Unknown GBoxed type" is signaled when type name can't be found in gobject::*g-type-name->g-boxed-foreign-info*
12:53:15
LdBeth
https://github.com/dmitryvk/cl-gtk2/blob/a3108fbc701dbab93b899e04b9637ded2f813410/glib/gobject.boxed.lisp#L117
16:07:35
jmercouris
is it saying here: https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitNetworkProxySettings.html
16:10:57
Bike
Looks like an array of strings, yes. So you allocate your strings however, and then you allocate an array of char* pointers to them.
16:12:00
jmercouris
I need an array of character pointers which are actually pointing to the first character in each string
16:12:58
Bike
Just wondering what's with the question mark. And yeah, null terminated, and also you need to null terminate the array itself.
16:15:01
Bike
So if you have n strings, you do like (with-foreign-object (array :pointer (1+ n)) ...), where ... setfs a bunch of mem-arefs
16:18:35
jmercouris
there seems to be something here: https://common-lisp.net/project/cffi/manual/cffi-manual.html
16:23:04
Bike
since the other functions in here seem to allocate memory themselves, what i would guess is that it allocates its proxy settings object, and then copies in your ignore_hosts. so you can delete the ignore_hosts immediately. but that's a guess
16:24:44
dlowe
I wonder if there's some way to override malloc() in our lisp image so that it uses the lisp allocator instead.
16:29:03
phoe
in theory, you could allocate an ub8 vector, and then pin it and use its data-pointer when necessary
16:29:29
phoe
that's not covering everything though, you still need some way of keeping track of it when it isn't pinned and used
16:30:24
Bike
I mean think of the performance characteristics here. C programs allocate memory in different ways than lisp ones, and malloc is optimized for C ways
16:30:41
pjb
If foreign-alloc is specified to do it, then you can use it. But otherwise, allocate and fill the foreign stuff yourself.
19:43:10
verisimilitude
I think of Ada, and how you can use Ada types, but with a C convention, so that they're still completely under the control of the Ada side of things. Poor programming practices have killed people, and so even a small memory leak is principally unacceptable. This has me think about how I disagree with some of the design decisions made in other portability libraries, and it has me remark on how designing a library as a collected subset
19:43:11
verisimilitude
of nonstandard functionality will likely result in something suboptimal, compared to how the ANSI would've been able to design it.
19:43:46
Bike
didi: no such operator. PUSH is probably just defined with defmacro (using get-setf-expansion, though)
19:45:24
phoe
verisimilitude: ANSI would not and will not be able to design anything better. Would not, given their time and money constraints; will not, because no one has enough money to revise the CL standard.
19:45:42
Bike
didi: What exactly are you asking? When you can use a setf function versus having to use the macro mechanism?
19:46:01
phoe
didi: seems like defmacro with get-setf-expansion. One cannot have a #'(setf getf) function because functions cannot modify variable bindings.
19:46:36
didi
Bike: I am playing with SETF. Now I'm playing with writing a way to setf a value of an alist.
19:47:59
Bike
alexandria has something for that. probably kind of hard to follow the macrology, unfortunately https://github.com/keithj/alexandria/blob/master/lists.lisp#L29-L71
19:48:34
verisimilitude
The basic point is that portability libraries tend to be suboptimal, when considering their purpose, phoe.
19:48:52
verisimilitude
I've written a very simple one and even that isn't the ideal version of the interface I'd want.
19:48:55
phoe
Bike: non-trivial, but one could macrostep these define-alist-get- forms to get a more sensible expansion.
19:49:47
phoe
verisimilitude: I am aware, and yes, they tend to be suboptimal. They are usually "good enough" for contemporary purposes though, since most people do not want to optimize every single thing possible and instead move to other endeavours.
19:51:33
verisimilitude
Taking a quick look at what LZMA is to refresh myself, there's no reason it shouldn't be written in Common Lisp, in my eyes, phoe. I've only taken a brief glance, however, so is there a reason beyond it already being implemented in C?
19:52:15
verisimilitude
When I wrote of portability libraries, I more meant USOCKET and BORDEAUX-THREADS than simple C bindings.
19:52:25
Bike
didi: If you make the define-alist-get macro global and then macroexpand the (define-alist-get assoc-value ...) form it should be easier to understand.
19:52:52
phoe
verisimilitude: I did not care enough about the project to actually reimplement all of the compressor and decompressor in CL. I prefered to reuse existing and tested code.
19:57:59
phoe
I think I've said everything I have on that matter in the reddit comments related to your blogpost on that. Don't have anything new to add.
20:01:56
verisimilitude
I ask because I understand you'd either be flaming_bird or _priyadarshan, if I'm looking at the correct discussion; it's not much discussion, though, since two of the three messages are bemoaning the license.
20:13:42
verisimilitude
Alright; you may find it amusing seeing your recent advice about :USE had me come here to start with.
20:40:42
jackdaniel
I was going to find some nice relevant quote directed at Shinpachi from Ginatama but I've failed
20:48:41
pfdietz
I will not be going to ELS this year, unfortunately. Last year it was a court appearance, this year a global pandemic. I fear next year will involve vacuum decay.
21:04:21
asarch
When the (with-open-file ...) scope ends, does it automatically close the stream or should I do manually?
21:06:20
jackdaniel
as of corona virus, I've read into it and it seems that it is "just" a nasty flu with higher risk of pneumonia; still very bad but it seems much better than how media has pictured it
21:06:49
phoe
asarch: WITH-* macros are a Lisp idiom that allocate some closeable resource, allow you to use it in the dynamic scope of the macro, and then automatically close it whenever control leaves that macro.
21:08:52
phoe
didi: it is. You might want to see https://github.com/robert-strandh/SICL/blob/8dbb240fc688bc9a28865eb1629f8dbc84ca71b4/Code/Setf-expanders/setf-expanders.lisp for some references on how to use it in trivial cases, and https://github.com/phoe/phoe-toolbox/blob/master/phoe-toolbox.lisp#L538 for two macros that use get-setf-expansion
21:19:37
pjb
asarch: because the REPL is not standardized, it can do whatever it wants to get input from the user.
21:19:42
z147
who's here? why are you looking at me with your eyes? short answer: try clisp or read the sbcl manual
21:22:58
pjb
asarch: it looks to me quite reasonable to get a dialog when calling (read) on a system with a GUI…
21:25:13
pjb
*query-io* is also like this. Don't be surprised if your system reads the prompt aloud when you (progn (format *query-io* "Please enter your age: ") (force-output *query-io*) (read *query-io*)) and it expects you to tell an integer to the speech recognizer…
21:33:41
z147
btw, there's several solutions for quit across implementations, is there something similar for read?
21:39:18
z147
With sbcl, prompting for user input, I had to finish-output nil, which was not needed in clisp
21:40:15
pjb
z147: the problem you may have, is that you learned programming with some language that hides that fact.
21:41:03
phoe
writing to a stream does not necessarily mean that stuff gets sent away, e.g. if output is buffered
21:41:46
pjb
z147: you definitely want to control that, so that your batch programs can be as I/O-efficient as possible, and your interactive programs can be as responsive as possible.