freenode/#lisp - IRC Chatlog
Search
16:07:55
aeth
I use bits with (zerop foo) and (= 1 foo) and flip the bit with (if (zerop foo) 1 0) etc.
16:08:28
aeth
I guess there's nothing stopping an implementation from using booleans and storing them as bits, and wrapping every access in a conversion, but I don't think any do.
16:15:56
sjl_
I'm sure it's possible, but yeah, I don't think any implementations do it. Generally if you say "I want to store X" it will use a scheme that actually does store X.
16:16:09
Xach
markasoftware: a bit vector would be more compact in memory at the cost of some interpretation of the values as booleans.
16:43:39
aeth
Yeah, I use bit vectors in my prime sieve which is used for quite a few Project Euler problems. And that's a place where bits-over-booleans really, really matter.
16:44:27
aeth
I could probably cache the primes, but then that would go against the spirit of trying to do things in < 1 second if possible.
17:22:40
sjl_
Yeah, for Euler I sieve and store the primality of the first 100 million odd numbers in a bit vector, and use miller rabin to check primality for numbers larger than 200000000
17:27:48
aeth
Interesting. I turn my sieve into a simple-array fixnum afterwards. Maybe I should hold onto the intermediate bit vector somewhere.
17:32:59
sjl_
There are ~11,000,000 primes below 200,000,000. With an array of (unsigned-byte 64) that's roughly 80mb to store them all. If you store the odd numbers below 200,000,000 in a bit vector that's ~11mb, and lookup is (aref v (ash n 2))
17:34:56
sjl_
But I still think the bit vector method uses less space, and the lookup is O(n) instead of O(log(n))
17:38:48
sjl_
honestly now that I have a machine with 64gb of RAM I should probably be a little less stingy on the precomputation. Though mostly it's annoying that it takes a while to quickload the system. I should probably make it so the primality array gets compiled into the FASL so it can load without recomputing it every time.
17:43:33
sjl_
friend code 48257_AAgoR50jsmK1HqPwtcQJZV9iqzIuk6ay if any other Lisp people do Project Euler
19:20:41
blackswan
because that's the number of apparently unique repositories referenced on the first two pages when i search for "tetris lisp"
19:54:51
aeth
If I wrote a falling tetromino game I would make sure that no one confuses it with Tetris®, the property of the notoriously litigious The Tetris Company
20:00:31
blackswan
i would not, because nobody cares about mine. i think i wrote three of them in the 80s. one was for the symbolic lisp machine.
20:13:37
dmiles
well i am trying to build cloak right now (i think you were as well once) and you wondered about if sb-heapdump was working.. sinc ethat ius what cloak uses
20:15:40
dmiles
2018-01-10T15:02:33Z karlosz: do you happen to know if sb-heapdump is still working?
20:16:13
karlosz
dmiles: i have no idea what cloak is. i am pretty sure i was working on some sbcl internals related thing
20:17:10
ober
(CFFI::TRY-FOREIGN-LIBRARY-ALTERNATIVES THNAPPY::LIBSNAPPY ("libsnappy.so" "libsnappy.so.1" "libsnappy.dylib") NIL) what would keep sbcl from finding a lib that exists in /lib, /lib64, /usr/lib, and ldconfig has been run.
20:28:12
dmiles
ok found a way to get it https://repo.or.cz/sbcl/lichteblau.git/snapshot/HEAD.tar.gz
21:17:04
mgsk
Does anybody recall the package that makes presentation slides? I seem to remember a cool one floating around recently, where you could interactively change the slideshow as you presented.
23:36:32
Colleen
Oladon: no-defun-allowed said at 2018.10.04 07:57:01: I put up the code on https://gitlab.com/theemacsshibe/mboard, it's very messy and bad so you get all the loose parts under WTFPL
23:37:35
Colleen
no-defun-allowed: Unknown command. Possible matches: 8, set, say, mop, get, time, tell, roll, help, deny,
23:38:30
no-defun-allowed
It shouldn't be too hard to make persistent, if you use a wrapper like Postmodern and you probably should change the software to use usernames the users chose and passwords.
0:19:56
defaultxr
has anyone got sly working? sly-connect seems to do nothing when i try to connect to a slynk server created with (slynk:create-server :port 4005 :style :spawn :dont-close t) . emacs just says "[sly] Connecting to Slynk on port 4005.." and nothing else happens. the sly-events buffer says (:emacs-rex (slynk:connection-info) nil t 1) .
0:22:14
defaultxr
slime-connect also worked nicely for me... never had any issues with it. figured i could swap out swank:create-server for slynk:create-server and be able to call sly-connect just like slime-connect
3:40:54
ober
is there a static representation of a hash that can be done like on some lisps (hash (a 1) (b 2) (c 3) (c 4))?
3:43:01
pjb
(com.informatimago.common-lisp.cesarum.utility:hashtable :test 'equal :elements '((a 1) (b 2) (c 3) (c 4))) #| --> #<hash-table :test equal size 3/60 #x302003DBE14D> |#
3:44:10
pjb
(com.informatimago.common-lisp.cesarum.utility:hashtable :size 3 :test 'eql :elements '((a 1) (b 2) (c 3) (c 4))) #| --> #<hash-table :test eql size 3/31 #x302003DFE33D> |#
3:49:51
White_Flame
alexandria has plist & alist to hashtable conversions, that you can use literally
3:59:51
no-defun-allowed
alternately: alexandria.0.dev:alist-to-hashtable or whatever its name is, I forgot