freenode/lisp - IRC Chatlog
Search
14:36:51
jmercouris
nij: or you could add your system to ultra lisp and then add the ultra lisp dist to your QL
15:10:39
jcowan
beach: I worked out an answer to `read` allocating multiple empty strings. Stash the reader macro for " and replace it with one that peeks to see if the next character is also quote. If so, read the quote and return a unique empty string; if not, call the stashed macro. The only thing this breaks is if you try to use eq(l) on an empty string.
16:45:31
dbotton
so let's say I wanted to say "member function" it would give the equivalent clos term
16:46:05
Bike
oh, like for other kinds of jargon. yeah, i don't know anything like that. also i'm not sure there's any real equivalent to member functions?
16:50:14
dbotton
It is easy to look up method or generic function and then learn what that means in CL
16:51:34
dbotton
but if someone was coming from another language could explain the approximate mapping or why things are different
16:52:17
dbotton
I think would be helpful, maybe will try and work on. Would certainly help me be come more specific with my lisp terminology
16:53:18
Bike
let's see, i suppose the main things that trip people up are CLOS, the call by value semantics, and the condition system
16:56:23
dbotton
CL is itself the raw material of computer "language" and that lends itself to a different lingo in many ways
16:56:49
phoe
but, yeah, that is not going to work very well for people who come from C++/Java/whatever single inheritance language there is
16:57:19
phoe
there's CLOS basics that need to be understood before becoming somewhat able with it, and the two CLOS chapters of PCL work decent with that
17:00:44
phoe
"IOlib requires a C library named LibFixPOSIX - https://github.com/sionescu/libfixposix - and its headers in order to compile."
17:00:45
Bike
because i already knew iolib depended on libfixposix, and "lfp" is then an obvious initialism
17:06:23
nij
Unable to load foreign library (LIBFIXPOSIX). Error opening shared object "libfixposix.so": libfixposix.so: cannot open shared object file: No such file or directory.
17:08:01
Bike
so i've heard. but what i mean is that it's the normal posix tools that are failing to work, rather than anything in lisp.
17:08:56
Bike
https://common-lisp.net/project/cffi/manual/cffi-manual.html#g_t_002aforeign_002dlibrary_002ddirectories_002a cffi lets you manually define where libraries are
17:10:12
nij
Yeah.. it's time for me to face this thread and follow it - and hopefully it will fix the problem - https://www.mail-archive.com/bug-guix@gnu.org/msg16190.html
17:10:37
nij
I just want to make sure that it's CFFI's problem before it - cuz in the error message there's no cffi.
18:21:27
jasom
does SBCL have operations for efficiently calculating leading zeros or leading ones of a machine word?
18:27:16
jasom
(integer-length most-positive-fixnum) => 62, so given that there are negative fixnums, looks like 63
18:29:21
jasom
1 bit tag, 63 bits encode the number in twos complement; (integer-length #xff) => 8, but clearly if you can go up to 255 with signed values it's 9 bits twos complement
18:29:24
flip214
phoe: no, you were right first time... 1 tag, 1 sign, 62 significant for both positive and negative
18:30:26
flip214
the ol' compression trick - just remember where the 1 bits are, the 0 bits take care of themselves. applied recursively you end up with "1", which encompasses every possible meaning at once!
19:04:09
Shinmera
Heh, *exaggerated smug face* check this out: UAX-9 Total: 1'815'582 Passed: 1'815'582 (100%) Failed: 0 ( 0%)
19:05:43
_death
for proper TDD brag you need to show that each failed first, and that the previous ones succeeded
19:09:43
Shinmera
Anyway, in case it wasn't obvious, there are 2 million tests for UAX9, but they're all auto-generated from unicod conformance data. :)
19:11:07
aeth
put this in a macro and win the test war... (defun generate-tests (number-of-tests) (list* '5am:test 'lots-of-tests "Win the war of having the most tests" (loop :for i :from 0 :below number-of-tests :collect `(5am:is (= ,i ,i)))))
19:12:21
aeth
(generate-tests 2000000) ; oops, ran out of memory in SBCL... looks like it needs to be optimized more
19:15:13
mfiano
Hey Lispers, gamedevs, and the uninitiated -- it's almost time: https://itch.io/jam/spring-lisp-game-jam-2021
19:15:50
Shinmera
Hmm. If my current jam project wasn't aimed to be commercial I'd actually join for once.
19:17:14
contrapunctus
I've been looking into making a game for the last three days, but I'm new to both game dev and Common Lisp :\ (and not a very experienced programmer either)
19:22:45
Shinmera
I made games in Fortran when I was 5, it's not hard to make /a/ game. It's hard to make a game with high production values and comparable to commercial games you might be envisioning.
19:22:49
mfiano
The idea is to practice. Even if you don't finish something, it is still desirable to submit it, as it gives you something to look back on to get a sense of your progression, and it also gives other people a base on which to work on, or ideas for their own future submissions.
19:24:33
Xach
I think like many endeavors it can be daunting to understand how to break down into completable individual pieces that, if you complete enough, results in a complete product/project
19:24:56
mfiano
So, you could just take an existing game, from past jams or GitHub etc, modify it, study it to learn how it works, and perhaps get a better idea of gamedev in general and some ideas you'd like to execute in the future.
19:25:16
Xach
(Which is part of the magic - when you see something and can instantly figure out how it's done, it is hard to be very delighted...)
19:25:52
mfiano
It's quite intimidating to try to make a game as a beginner in a public jam with a time limit. That is not the point at all though...the point is to learn and have fun :)
19:28:37
Xach
The desire to make games led to my interest in computers, but I don't enjoy games nearly as much as I used to :~(
19:28:47
mfiano
_death said he might too. I'd like to see longtime lispers that never participated try.
19:29:08
mfiano
Xach: Same here, I don't like playing games, but it is incredibly interesting to code them.
19:29:21
Shinmera
I can offer more assistance with Trial than usual this and next week if someone wants to give it a shot using it.
19:30:13
aeth
The games I liked the most (especially as a teenager) tended to be massive time sinks, so I just stay away from them entirely. And I don't try games that have patterns like that, especially if you have to log in daily/weekly (quite a few AAA games now), if you have things you need to constantly defend from raids (most survival games), etc.
19:31:02
aeth
So for me personally, it's not that I don't like games anymore, it's that I try not to like games too much anymore.
19:32:21
mfiano
_death: I see. 2010 was before my time as a host, when I was just a few years into Lisp at that point, and not sure I was doing games.
19:32:37
_death
mfiano: but, right now I'm compiling aseprite.. so it's one step closer to participation
19:34:49
mfiano
I'd just like to see more COmmon Lispers participate. Too many Lua/Fennel Lisp games :)
19:35:21
mfiano
I've thought about making the first of the bi-annual jams CL only, but then I don't think we'd get anyone but borodust :)
19:40:16
Nilby
I already have 7 unfinished lisp games, and the 3 that I finished were very un-fun, so I'm not sure working on games as an anti-burnout tactic has worked.
19:44:10
Nilby
Presumably results would be better with intrinsic motivation, rather than boredom with other things.
19:50:36
_death
mfiano: I also have some tic-80 w/ ecl thing.. it was some years ago, but maybe someone wants to pick it up
19:53:30
Bike
quick question - i was looking at tic-80 before - it's not an actual virtual machine is it? like it doesn't have a bytecode ISA or something, you can write code in whatever
19:54:24
Bike
ok yeah, that's what it looked like. i think i had it in my head that it was an actual VM
19:56:51
_death
mfiano: I've not kept up with tic-80.. it was just when it was made public (hence only 60 commits in that repo).. it seemed pretty functional back then though
20:07:32
luis
Hmm, although the site only lists CMUCL, ECL, SBCL, ABCL and CCL, https://gitlab.common-lisp.net/asdf/asdf/-/blob/master/gitlab-ci.yml suggests there's a CLISP image too.
20:13:02
nij
Weird.. in my stumpwm config, I have (when (ignore-errors (ql:quickload :some-package)) (progn (defcommand ..)))
20:23:39
_death
you could do something yucky like (format t "~A~3,'0D" (if (minusp x) "-" "") (abs x))
20:24:50
jasom
_death: that gives the behavior like C's "%.3d" but still not like C's "%03d" (the former prints 3 digits, the later 3 characters)
20:31:13
Krystof
do you have a compiler macro to turn constant-printf-string printfs into constant-format-string format controls?
21:00:57
lotuseater
i learned today for what SYMBOL-MACROLET not to use :) had often something like (aref e k) in a function with even SETF and thought, oh hm, so use (symbol-macrolet ((e_k '(aref e k))) ...)
21:12:55
lotuseater
but hm, the other thing was, translating an algorithm with three closures and that use same parameter names as declared for lexical scope in the main algorithm ^^ how does FLET handle that?
21:14:05
lotuseater
being more concrete, it was this: https://en.wikipedia.org/wiki/Jacobi_eigenvalue_algorithm#Algorithm
21:17:01
_death
not sure what you're asking.. this pseudocode looks like it could use some factoring.. I'd start by pulling those functions out
21:20:54
Shinmera
Or just use one of a bunch of matrix libraries that can already compute eigenvalues
22:08:41
ioa
Hi everyone, if you're interested in talking about the ELS, SAL9000 made a room for it: #elsconf
22:09:37
ioa
Especially the presence of marco heisig (no bouncer? I forgot his nick), easye and phoe would be very much appreciated, as they have all the info. :)
22:11:04
ioa
phoe, oh, I didn't know about #els2021, there was a discussion about this years els in the old room els2020, and SAL9000 made elsconf so we don't create a room every year.
22:12:02
phoe
sure, sounds good! let's discuss the channel setup when everyone (including me) is awake tomorrow
0:38:25
nij
>> Weird.. in my stumpwm config, I have (when (ignore-errors (ql:quickload :some-package)) (progn (defcommand ..)))
0:39:01
nij
When :some-package is not presented, (defcommand) was still evaluated, leading to an error.
0:41:18
nij
The package :some-package was not presented, so (progn..) shouldn't be evaluated (indeed, TEST wasn't set to 123). However, (defcommand..) was evaluated and led to another error.
1:03:37
jasom
is it possible to sign-extend a number, given a desired bitwidth? i.e. treat a positive number as being the unsigned representation of a twos-complement value?
1:09:34
jasom
moon-child: or just < without the 1-, but then you'd have a bignum at machine-word sizes
1:10:09
moon-child
there's nothing as far as I know. Txr has it apparently https://www.nongnu.org/txr/txr-manpage.html#N-026F9F46
1:23:17
jasom
Here's what I had, FWIW: (defun foo (x width) (if (logbitp (1- width) x) (- x (ash 1 width)) x))
1:26:04
jasom
though on reflection, this is probably clearer: (defun foo (x width) (if (logbitp (1- width) x) (dpb x (byte width 0) -1) x))
1:26:50
mfiano
I'd be impressed if you can do this more efficiently. stassats helped me write that years ago
1:27:40
jasom
ah, uses a multiply to avoid a branch. Probably a good call on any processor made in the last 20 years or so
1:29:18
moon-child
(maybe a couple extra if you want to avoid a branch, but predictable branches are übercheap)
1:36:11
jasom
mfiano: yours is about 2x as fast on a quick benchmark despite being more instructions; not too surprising since the sign bit branch is completly random on my test-case
1:36:37
jasom
mfiano: I suspect mine would be faster if the test corpus was entirely positive or entirely negative
2:03:35
pagnol
Has anyone here used Postmodern a lot? I only recently found out about it and it seems like the ideal way to interface with a relational db to me, but I'm wondering if there are downsides that only become apparent after a while.
2:09:40
nij
Hello! I'm trying out qlot. In its official github repo, it says I can get it by (ql:quickload :qlot). But that doesn't seem to generate the binary `qlot` (for cli usage) directly. Did I miss any step? https://github.com/fukamachi/qlot
2:10:41
Bike
well, in the readme it mentions that the roswell install, introduces the shell command unlike the quicklisp install
2:11:14
Bike
i don't see any obvious explanation of how you get the shell command if installed via quicklisp