freenode/#lisp - IRC Chatlog
Search
21:51:14
drmeister
A molecule-part can be a symbol or a list with the form (name :label label) or ((name1 name2 name3 ...) :label label)
21:53:05
jmercouris
fe[nl]ix: it's complex, but it is the easiest way for me to do adblocking, I might just append to the hosts file for now, pointing to 0.0.0.0
22:04:41
thorondor[m]
drmeister: I think using (string-equal (string sym) "CYCLE")) could be OK. I think that same technique is used in LOOP macro for example
22:05:59
drmeister
thorondor[m]: Thank you. Is that how the LOOP macro handles all of its loop keywords?
22:07:20
aeth
jackdaniel, ym: What I'm personally going to be doing for GUI "soon" is writing on top of cl-sdl2 and cl-opengl (although I'll probably replace cl-sdl2 with my own SDL bindings)
22:08:20
aeth
I've been looking into GPU-based font rendering like http://wdobbie.com/post/gpu-text-rendering-with-vector-textures/ and I'll either try to convert into a GPU-friendly format from zpb-ttf or write my own ttf parser if that doesn't work well.
22:21:31
aeth
Petit_Dejeuner: With cl-opengl, they're just the bindings, and you can just use %gl if you want to directly use the low-level bindings.
22:22:06
aeth
Plus, the author left the Lisp community so now afaik no one understands how the whole thing works.
22:22:28
aeth
Yeah, afaik it's basically in maintenance mode now, even though the bindings are apparently incomplete.
22:24:12
aeth
I've piece-by-piece rewritten almost all of my usage of cl-sdl2 outside of the init part to use as low level as the library permits (even if I have to use :: private stuff), so it shouldn't be *that* hard for me to switch to fresh bindings, especially if I replace the init stuff first.
22:25:55
Petit_Dejeuner
At least cl-sdl2 has doc strings. I know some people like to set them away from the definition of the function, but that just makes it a pain tor ead imho.
22:26:30
aeth
The problem is that cl-sdl2 uses a lot of large, incredibly fancy, undocumented macros, both directly in the package and indirectly through stuff like autowrap
22:26:45
aeth
It has taken probably a total of 2 months of my time over the years to know as much about it as I do know
22:29:06
aeth
Petit_Dejeuner: e.g. with-sdl-event https://github.com/lispgames/cl-sdl2/blob/e61c10ac96f439729f1b9e128b024b02d8c3b4a8/src/events.lisp#L38-L43
22:29:10
aeth
which then uses c-let: https://github.com/rpav/cl-autowrap/blob/7a9edd3de2e48f66bbc599be247c7025c4e0f87e/plus-c/plus-c.lisp#L227-L268
22:29:49
aeth
When it works, it works. When you want to do something not directly supported by that macro... well... that takes some time.
22:30:47
aeth
I have never seen a macro like c-let before. It essentially creates a pseudo-macro, pseudo-function call. So let's say you have "event" in with-sdl-event. That doesn't actually exist. It's rewritten in the code-rewriting in c-let.
22:32:26
drmeister
Bike: I got grammar like this to work: (:= *olig3* (design:make-oligomer *parts* '((:lego3 :label :first) :default :lego3 :default :lego3 :default (cycle :first))))
22:32:31
aeth
Well it's a macrolet and a symbol-macrolet in two mutually-recursive Lisp functions. I'm not sure I've seen anything more advanced than that.
22:32:52
drmeister
Where: (design:define-part *parts* :lego3 '(((:legodkp :legohyd)) (:fg1>fg (:mbenzoic :pbenzoic :acetyl)) (:fg2>fg (:mbenzoic :pbenzoic :acetyl)) (:fg3>fg (:mbenzoic :pbenzoic :acetyl))))
22:34:02
aeth
If I were to write something like c-let I'd probably use at least 6 helper functions/macros
22:34:28
drmeister
ACTION gets his jollies by doing last minute in-the-trenches programming the day before DOD site visits.
22:36:56
drmeister
Exactly that. We have some folks from the DOD visiting tomorrow and I'm writing code that I plan to demo to them.
22:44:01
aeth
What's cool about #'random is that #'random on fixnums in SBCL is apparently non-consing and quite efficient.
22:46:04
mercourisj
theoretically lisp is one of the few programming languaes that could generate truly random applications
22:46:17
mercourisj
you could use random to random select symbols and combine them until you have a full program
22:46:44
aeth
If you wanted random #'random, afaik, you'd have to use an implementation-specific way to provide a seed to the random state.
22:47:02
mercourisj
I just mean in the sense that one can use macros to generate random code on the fly
22:47:08
Petit_Dejeuner
I always thought it would be fun to make a library add advertisement blurbs and links to all the public identifiers at compile time.
22:50:25
scymtym
aeth: no, SBCL initializes the random state to a fixed constant. without the call Bike mentioned, subsequent (non-threaded) runs will produce identical sequences of "random" values
22:51:42
aeth
scymtym: Yes, but there are two ways to actually set up a random state, including on SBCL, afaik. The portable way and the provide-a-seed way
22:54:02
aeth
scymtym: Yes, I was just wondering how SBCL gets a random state in make-random-state because obviously if it used #'random it would cycle through the same random states!
22:57:31
scymtym
aeth: sure. on linux, it reads from /dev/urandom and uses a weaker fallback based on time and PID if that fails
23:01:53
mercourisj
I believe the accepted way of getting a random seed is by downloading random++ from npm
23:02:25
mercourisj
the reason why it will always be something new is because you'll be fulfilling the dependency via NPM, and who knows what it will be
23:02:36
scymtym
ACTION loves how the urandom(4) man page claims that getrandom(2) is the safer alternative and then 50% of that man page is a super-complicated section called "Interruption by a signal handler"
23:02:42
rme
the /dev/urandom way is nice because it works on a lot of systems (at least linux/freebsd/osx/solaris-ish)
23:03:41
aeth
Well I can understand why switching to getrandom() right way was probably not a good idea because it was introduced fairly recently. The manpage says kernel 3.17
23:03:59
aeth
kernel.org even shows 2 longterm kernels still supported that have a lower version number!
23:16:06
ealfonso
why is hunchentoot insisnting on using html error templates when I set hunchentoot:acceptor-error-template-directory to nil?
23:21:21
ealfonso
"If an ERROR-TEMPLATE-DIRECTORY is set in the current acceptor and the directory contains a file corresponding to HTTP-STATUS-CODE named <code>.html, that file is sent to the client after variable substitution"
1:30:49
ealfonso
the hunchentoot problem I was having earlier was not a hunchentoot problem. I forgot to use (return ...) in a loop finally clause
2:49:55
aeth
first cl-foo, then cl-foo42 because cl-foo is stuck on version 35 and then if you need a different foo 42.x binding you're in trouble
8:16:47
ealfonso
what is the difference between (SYMBOL-VALUE (FIND-SYMBOL (SYMBOL-NAME 'MY-SYM))) and MY-SYM?
8:25:40
phoe
the lexical bindings disappear after the code is compiled, so a string would have nothing to refer to.