freenode/#lisp - IRC Chatlog
Search
6:09:25
pjb
drmeister: defpackage forms cannot include circular dependencies. For this you have to use run-time package functions.
6:23:14
drmeister
Monolithic ASDF builds for the win - I can package up all of the cando Common Lisp source code along with cl-jupyter, cl-jupyter-widgets and nglview (for viewing molecules) into a single fasl file.
7:26:19
borodust
phoe larsen: that's unfortunate, but no :) i forged the API before Shinmera's :flow was introduced: naming is so hard, i don't feel like redoing all the name-fiddling again :/. More details in the issue comment.
7:42:17
borodust
obviously, i'm the only one to blame for not pushing :cl-flow to quicklisp, but at the time i didn't feel like it was complete enough
7:59:00
borodust
Shinmera: nope, this nicknames is introduced exactly for the reason to have sound full symbol names
8:10:27
larsen
yesterday night I was commenting on the general idea of nicknames defined by package authors. it seems to me a bad idea in general: wouldn't they serve the same purpose if it was the user assigning them when a package is used ?
8:24:24
larsen
I'm more concerned about one bit in the comment to the issue: " those two systems (this and Shinmera's flow) would never be able to coexist". Besides naming, do you see any other technical problem preventing them to work together ?
8:25:24
borodust
i meant that i'm not going to rename package and neither Shinmera, i'm pretty sure ;p
8:28:59
borodust
larsen: oh! Fare has a thing exactly for such cases: https://github.com/fare/package-renaming
8:30:10
borodust
now that's a good reason to have whatever convenient nickname and jibberish main package name (java-style or whatever)
8:47:48
Shinmera
borodust: It's already released on QL and people might be using it, so I can't without breaking people's code.
8:50:23
Shinmera
Before I release anything I always check QL for systems with the same name to avoid problems like this
8:52:39
Shinmera
I also prepare for the day when package-local-nicknames will be available on all implementations that matter by internally using FQDNs. I could then remove the shorter name for all of my systems in a big, breaking change. Alas I don't see the p-l-n future coming any time soon.
8:55:44
borodust
i'll investigate Fare's package-renaming and maybe add something convenient for bodge dist users
8:57:07
Shinmera
In other news apparently Harmony's WASAPI backend is pretty badly broken... but only on some Windows setups. SIGH.
10:21:28
resttime
Is there a good way of handling C opaque structures as pointers without know the size of the structure in the CFFI?
10:26:18
Shinmera
I don't know what you mean. You have a pointer and you want to do... what with it?
10:27:46
Shinmera
The struct is going to remain in memory whether you have a pointer to its starting address or not
10:29:50
resttime
So I'm forced to define the cstruct with CFFI and then allocate the structure before then passing
10:31:03
resttime
varjag: There isn't, Use cases seem to be defining the keystate like: ALLEGRO_KEYBOARD_STATE keyState;
10:31:05
p_l
varjag: looks like there's no allocator, but you're expected to do malloc(sizeof struct_type)
10:31:36
Shinmera
What you do in this case is write a C program that emits the sizeof and then just allocate that.
10:32:20
Shinmera
Remember to run that program and record the size for all systems you want to run on. It might change!
10:32:53
Shinmera
Zhivago: Then you'd have to compile that C program on every system and you'd be back to the same deal.
10:33:24
resttime
I was hoping to be able avoid external C stuff, but I guess it's "impossible" after all.
10:35:10
resttime
p_l: Well they do have a new event system which mostly gets used. Someone using the bindings I wrote for allegro was wondering if there could be more support for the keyboard routines, so I started looking into this
10:38:58
resttime
Shinmera: Well at this point I'm thinking that the structure probably won't be changing so I'll define the opaque type and write a WITH-KEYBOARD-STATE macro that could work
10:42:15
Zhivago
resttime: If the structure is opaque, you should not be allocating yourself in the first place. There is somewhere that it will have a complete type, and that's where the allocator needs to be.
10:43:29
resttime
http://www.gamefromscratch.com/post/2017/11/10/Allegro-Tutorial-Series-Part-4-Keyboard-and-Mouse.aspx
10:47:59
Zhivago
opaque is gibberish made up by people to express an intent realized via a pointer to an incomplete type.
10:48:29
Zhivago
struct foo; <- this type is incomplete here. struct foo { int i; }; <- Now struct foo is a complete type, and has a sizeof, etc.
10:54:01
borodust
resttime: shameful self-plug: if all you need is simple graphics, audio and input for your game w/o diving into native and/or configuration land, trivial-gamekit might work for you
10:55:10
resttime
borodust: Counter plug, if you need a monolith game programming library you can use my cl-liballegro :D
11:12:40
borodust
resttime: not only that, but you would require users to install whole gnu thing onto their machines for groveller to work :/
11:13:27
resttime
borodust: Also cl-bodge looks interesting, game engines and stuff are currently above me since my knowledge is meagre :P
11:15:20
resttime
Maybe one day I'll have my own to add onto the pile of game enginers laying around
11:18:01
resttime
borodust: In your exp do think making a game is orthogonal to making a game engine?
11:18:12
borodust
cl-bodge is a pile of functionality at the moment with vast api i literally don't have time to cover with docs - part of the reason trivial-gamekit exists
11:19:35
borodust
unless there's not tools, but then you would just write specific tool, not an engine
11:53:10
Shinmera
resttime: If you're interested in gamedev and game engine dev: I have a weekly stream on Sundays where I do exactly that. https://events.tymoon.eu/1 https://www.youtube.com/playlist?list=PLkDl6Irujx9MtJPRRP5KBH40SGCenztPW
11:56:47
borodust
resttime: i also can recommend Bagger's vids: https://www.twitch.tv/baggers___ https://www.youtube.com/channel/UCMV8p6Lb-bd6UZtTc_QD4zA
11:57:25
borodust
Pushing Pixels with Lisp series: https://www.youtube.com/watch?v=82o5NeyZtvw&list=PL2VAYZE_4wRITJBv6saaKouj4sWSG1FcS
11:59:50
borodust
resttime: also i can recommend #lispgames channel for sharing and acquiring lispgamedev experiences (not always on topic)
12:03:43
beach
wxie: You may be wasting your time. paule32 has come here for quite some time, and he doesn't follow the advice he is given.
12:04:17
beach
wxie: He continues to submit code that does not follow accepted conventions, and he refuses to go read a book about Common Lisp.
12:53:45
borodust
hi Xach, i'm scheduling a debug session on friend's machine, if we would be able to reproduce the issue
13:23:53
paule32
or is it enough, to programming a if condition with the display/output code in Lisp?
15:02:06
resttime
Adding 4 more definitions to that code I generated a C++ braced initializer list for an unordered map that associates hardware commands to hexstrings :3
15:20:50
flip214
can a macro signal the macroexpander to stop expanding this level, and continue with subforms only?
15:21:53
Shinmera
Macros are functions that are run at compile time to emit new forms in place of the macro expression.
15:22:50
flip214
and I'd like to have (foo . args) to be expanded into (foo something . args), ie. insert a state argument into a function call.
15:23:21
flip214
currently I'm using a macro that puts the function on a gensym, and provides a macro that expands into such a call instead
15:23:47
flip214
but that means I can't trace the original function name anymore, I need to trace the gensym instead
15:26:11
Shinmera
(defmacro with-injected-thing (&body body) `(flet ((fn (&rest args) (apply fn something args))) ,@body)) ?
15:26:27
flip214
so, (defmacro define-state-fn (name args &body body) `(progn (defun ,<gensym> ,(cons state args) ...)) (defmacro ,name (args) (,<gensym> state ,@ args))) is the gist of it
15:27:27
Shinmera
And what prevents you from just supplying a foo* that calls foo with the argument you need?
15:27:51
flip214
what I'm asking is can I do something like (defmacro foo (args) (values `(,foo state ,@ args) :STOP-TRANSLATING-THIS-FORM)))
15:28:21
flip214
Shinmera: it's still not possible to use the _visible_ symbol for tracing, seeing the documentation, etc.
15:29:21
Shinmera
Though arguably the docstring shouldn't be the same since it'll be supplying a hidden argument
15:30:19
Bicyclidine
What if the user was to write in the state argument? It would fail, if I follow correctly.
15:31:07
Bicyclidine
the macro and the function are essentially two different things. Giving them the same name is just confusing.
15:31:54
flip214
Bicyclidine: well, perhaps I should just put all that on a blog somewhere... having the big picture makes discussing about the feature easier
16:14:38
pjb
minion: memo for Josh_2: perhaps you want to count the ACTUAL number of operations needed to sort, and compare that for your different inputs. For sort algorithms, it's usually the number of swap that is counted. Or the number of accesses to the sequence. Or the number of comparison. Unless you have your own quicksort implementation, if you use cl:sort it will be easier to just count the number of comparisons.
16:17:00
pjb
paule32: at this point, it might be a good idea to read a book about NLP… Perhaps Gazdar & Mellish, Natural Language Processing in LISP - An Introduction to Computational Linguistics, Addison Wesley.
17:06:53
emaczen
SBCL does a tail call optimization but CCL instead overflows the stack. Any suggestions for getting CCL to do the same tail call optimization?
17:20:07
schweers
emaczen: SBCL does tco depending on the optimization settings, maybe CCL does so to, but has different criteria?
17:21:59
emaczen
schweers: I'm just finding out that my optimization settings are not what I thought they were.
17:22:39
emaczen
I expect (declaim (optimize ...)) to be evaluated at startup in init files for each implementations compiler.
17:25:14
schweers
emaczen: um, I’m not sure, but it might be that declaim only has an effect during the compilation of the file in which it occurs
17:28:07
Bicyclidine
unspecified for compile file. if the rc is loaded maybe it's defined to continue effecting. not sure.
17:28:13
emaczen
how can I check optimization settings in SBCL? #ccl informed me in CCL how to do it, which is how I found out.
17:40:46
phoe
schweers: it pays to read software manuals once in a while, including your language specification and implementation manual :)
17:41:05
phoe
take into account that these are global settings and can be modified by local declarations.
17:41:45
phoe
If you want to be EXTRA sure that your programs are compiled without tricks like (declare (optimize (speed 3) (debug 0) (safety 0))) you may want to sb-ext:restrict-compiler-policy
17:42:50
phoe
what is common in people's .sbclrc files is actually firmly setting the debug/safety policy to 3, so everything is compiled with debug 3 and safety 3.
17:43:56
phoe
_rumbler31: CL has no TCO so your stack may explode at the implementation's discretion
17:44:22
phoe
also, it is common for Lisp programmers in general to favor iterative programming style. Macros like LOOP are an example of that.