freenode/#lisp - IRC Chatlog
Search
17:38:39
Bike
which will probably run more efficiently, but the compilation process will take longer
17:38:49
Bike
...assuming the implementation actually has a separate compiler and evaluator, which it may not
17:40:10
Bike
may i ask what it is you're actually doing, that you want to save functions to a file?
17:41:21
dlowe
I mean, you could write code to a file, then call COMPILE-FILE which might make a fasl
17:41:34
moldybits
i want to save the current state of the snake game. how to calculate the new cooldown for the snake (based on its length) is a lambda that i want to be user-modifiable.
17:44:56
verisimilitude
If you call a function in SNAKE-COOLDOWN, set by a file LOAD or with a default value, otherwise, you can of course still change this variable at any point.
17:47:08
moldybits
hm. there's a further complication: replays. i need to store every change to the state somewhere.
17:48:27
moldybits
(set-cooldown-calculator '(lambda (snake-length) ...)), and set-cooldown-calculator will stuff this into the replay.
17:50:51
moldybits
i'm using this snake game to figure out how to structure more advanced games in the future. i've run into these issues before.
17:58:41
Xach
moldybits: it would be more tractable to maintain state in an object passed into callbacks.
18:02:47
moldybits
i'm not following exactly. my thought was to not allow any free variables in the callbacks.
18:05:08
moldybits
eventually i would want the callbacks to be evaluated in a separate environment, with a custom eval
18:18:40
moldybits
Bike: i'm not sure? i want code writing to be a part of some games. suppose this snake game has a level where you're supposed to figure out the appropriate cooldown function to get past some obstacle in a clever way, or something.
18:36:09
jdz
moldybits: Probably something similar to what you're doing: https://technomancy.itch.io/bussard
19:19:31
sjl_
A while back I proof-of-concepted using https://github.com/jessymilare/storable-functions to serialize lambdas to https://github.com/conspack/cl-conspack
19:19:45
sjl_
it wasn't super pretty, but it worked https://github.com/sjl/sand/blob/fc0cb77fd8eefec8d29d69a1eca36f599101b890/src/serializing-functions.lisp
20:14:20
White_Flame
Xach: is there a simple way to download an entire ql dist for offline site usage?
20:15:13
Xach
White_Flame: in packager ql-dist-user, evaluate (map nil 'ensure-installed (provided-systems (dist "quicklisp")))
21:29:39
pjb
sjl_: I fail to see the point in conspack when the problem is to serialize functions. In anycase, we cannot portably or even conformingly serialize functions (much less closures), only lambda expressions, which are S-expressions, and for which there is a perfectly good serialization format: S-expressions!
21:30:08
pjb
sjl_: (print1 lambda-list stream) is all that is needed to write, and (read stream) all that is needed to read a lambda expression.
21:57:42
verisimilitude
It helps if FUNCTION-LAMBDA-EXPRESSION gives a useful result instead of the useless one that's common. If you have the LAMBDA and its name, you can serialize the function definition.
22:13:26
pjb
moldybits: Yes, this is why I wrote lambda expression which refers to the whole lambda expression.
22:14:17
pjb
verisimilitude: Since you cannot count on function-lambda-expression, you have to implement your own bookkeeping. see; Image Based Development http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html
22:15:00
pjb
An alternative, is when you have your own model for functions and other expressions, then you can implement a decompile method. This is what is done in Patchwork.
23:31:33
asarch
Xach: sudo apt-get -y install apt-file && sudo apt-file update && apt-file -x search libsmokeqtwebkit
23:38:38
p_l
Xach: I stumbled on QtWebkit getting deprecated back when doing something with Qt two years ago
23:51:18
asarch
https://packages.debian.org/search?searchon=contents&keywords=libsmokeqtwebkit&mode=filename&suite=oldstable&arch=any