phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
torbo has joined #lisp
leotaku has quit [Ping timeout: 246 seconds]
leotaku has joined #lisp
<no-defun-allowed> Is there an equivalent to subst that can work with circular trees?
<Bike> not built in
Folkol has quit [Quit: Textual IRC Client: www.textualapp.com]
<Bike> you could probably use subst with a test that refers to an accessor hash table
<no-defun-allowed> Ooh, good idea.
<no-defun-allowed> Fortunately I don't think I need that kind of function now but it does sound handy to know.
ltriant has quit [Quit: leaving]
lucasb_ has quit [Quit: Connection closed for inactivity]
ltriant has joined #lisp
Arcaelyx has quit [Quit: Arcaelyx]
ricekrispie has quit [Quit: YEET]
alexanderbarbosa has quit [Remote host closed the connection]
xkapastel has quit [Quit: Connection closed for inactivity]
alexanderbarbosa has joined #lisp
alexanderbarbosa has quit [Remote host closed the connection]
igemnace has joined #lisp
ebrasca has joined #lisp
actuallybatman has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
moldybits has quit [Quit: WeeChat 2.4]
zcid has quit [Ping timeout: 244 seconds]
zcid has joined #lisp
alexanderbarbosa has joined #lisp
alexanderbarbosa has quit [Remote host closed the connection]
alexanderbarbosa has joined #lisp
pfdietz has quit [Ping timeout: 256 seconds]
refpga has quit [Ping timeout: 258 seconds]
xkapastel has joined #lisp
paul0 has quit [Remote host closed the connection]
paul0 has joined #lisp
nullman has joined #lisp
ym555 has joined #lisp
torbo has quit [Ping timeout: 245 seconds]
bexx has quit [Remote host closed the connection]
edgar-rft is now known as computers
computers is now known as edgar-rft
Oladon has joined #lisp
anewuser has joined #lisp
ricekrispie has joined #lisp
zotan has quit [Ping timeout: 272 seconds]
xkapastel has quit [Ping timeout: 250 seconds]
zotan has joined #lisp
wilfredh has quit [Ping timeout: 250 seconds]
Kaisyu7 has quit [Ping timeout: 248 seconds]
manualcrank has quit [Ping timeout: 248 seconds]
Kaisyu7 has joined #lisp
manualcrank has joined #lisp
wilfredh has joined #lisp
xkapastel has joined #lisp
_whitelogger has joined #lisp
lavaflow_ has joined #lisp
lavaflow has quit [Ping timeout: 248 seconds]
CrazyEddy has quit [Ping timeout: 248 seconds]
Inline has quit [Quit: Leaving]
sauvin has joined #lisp
libertyprime has quit [Ping timeout: 258 seconds]
libertyprime has joined #lisp
sauvin has quit [Remote host closed the connection]
sauvin has joined #lisp
CrazyEddy has joined #lisp
dacoda has quit [Remote host closed the connection]
dacoda has joined #lisp
iovec has joined #lisp
dacoda has quit [Remote host closed the connection]
JohnMS_WORK has joined #lisp
hiroaki has quit [Ping timeout: 245 seconds]
libertyprime has quit [Quit: leaving]
sr5h has joined #lisp
jprajzne has joined #lisp
akoana has quit [Ping timeout: 248 seconds]
<manualcrank> hey guys, i've been wasting time solving problems at open.kattis.com
vlatkoB has joined #lisp
<manualcrank> the server there uses sbcl
<manualcrank> performance is usually average, but occasionally awful (vs same algorithm in another lang)
<manualcrank> (click on statistics link for running time distribution)
<manualcrank> my solution (http://pasted.co/8f42afb7) takes 1.2s, which is the slowest time
<manualcrank> translated directly to c++ using unordered_set for the hash table takes 0.06s
<manualcrank> what's taking so long?
<manualcrank> (the only suspects in this case seem (read-line) and hash table stuff)
akoana has joined #lisp
<no-defun-allowed> Have you tried using SBCL's profiler?
<no-defun-allowed> Though it will slow down the program a bit, it will show you the slow function calls.
<xantoz> I would try using a bloom filter for that
<manualcrank> i don't know how to use the profiler yet
<manualcrank> declaim speed 3 safety 0 has no effect
<no-defun-allowed> The interface looks like TRACE, use (sb-profile:profile foo bar baz) to profile foo bar and baz, sb-profile:unprofile to unprofile, and (sb-profile:report) to see the report
<manualcrank> so the problem with that is i don't have access to the data set
<manualcrank> only example data shown in problem statement, which is too small
<manualcrank> when a problem is submitted you can see its progress though
<no-defun-allowed> Do you get access to the program's output?
<manualcrank> no
quazimodo has quit [Ping timeout: 245 seconds]
<no-defun-allowed> I don't know how the problem goes, but could you try to generate some input data?
<manualcrank> i guess :-(
<manualcrank> was hoping others have experience using lisp at competitive programming sites
<manualcrank> who could say "yeah, i/o is slow" or "yeah, your algorithm sux"
<shka__> manualcrank: without profiler it is imposible to tell what's going on (unless algorithm sucks)
<xantoz> like I said, try a bloom filter
<xantoz> for the algo, that is
<manualcrank> again, though, direct translation of algo to c++ = 0.06s (like all the other c++ soln's)
<shka__> i doubt that this is a solution
<xantoz> would cons significantly less
themsay has quit [Read error: Connection reset by peer]
<shka__> manualcrank: i would generate data, put it in the vector, eleminate read-lines and see how this works then
<shka__> xantoz: not really
<shka__> he is already reserving proper size of the hash-table so i don't think that realocations are a problem
<no-defun-allowed> Consing is pretty cheap though. I would profile a bunch first.
<manualcrank> u mean bulk read the file and then parse (instead of read-line)?
<shka__> no-defun-allowed: hash-table reallocation can be quite brutal actually
<no-defun-allowed> true
<shka__> manualcrank: yes, eleminate IO from the profile
themsay has joined #lisp
<shka__> it is my best bet on why you are getting such a bad performance
<manualcrank> i'll try that
<xantoz> is there some way to re-use the memory when reading the strings in lisp? (in C I would just use stack-alloced fixed-size arrays for current and previous word)
<shka__> xantoz: i am almost certain that memory is not issue at all in this program
<no-defun-allowed> read-sequence? Still don't think that'd be the bottleneck and you should investigate further.
<shka__> and if you want to, (setf (aref string index) char) is possible
<xantoz> I was thinking that read-line would create lots of transient objects, but I might be wront
ebrasca has quit [Remote host closed the connection]
donotturnoff has joined #lisp
<manualcrank> i'll generate some data for profiling purposes, then bulk i/o
akoana has left #lisp ["Leaving"]
<manualcrank> not tonight though
<shka__> manualcrank: if words are short (8 chars) you probabbly won't come close to C++ anyway but i agree that 1.2s is suspicious
<shka__> manualcrank: good night
<manualcrank> problem limits are 100,000 words between 1 and 20 characters
<shka__> ok
<manualcrank> so i'll try 100,000 1 character words, then 100,000 20 character words
JohnMS has joined #lisp
ltriant has quit [Ping timeout: 272 seconds]
xantoz has quit [Ping timeout: 248 seconds]
JohnMS_WORK has quit [Ping timeout: 245 seconds]
manualcrank has quit [Quit: WeeChat 1.9.1]
catalinbostan has joined #lisp
eschatologist has quit [Quit: ZNC 1.7.2+deb2 - https://znc.in]
nowhere_man has quit [Ping timeout: 272 seconds]
eschatologist has joined #lisp
Lycurgus has joined #lisp
dacoda has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
igemnace_ has joined #lisp
igemnace_ is now known as igemnace
freakcode has joined #lisp
actuallybatman has quit [Ping timeout: 245 seconds]
dacoda has quit [Read error: Connection reset by peer]
catalinbostan has quit [Ping timeout: 248 seconds]
freakcode has quit [Quit: leaving]
grumble has quit [Quit: LAVENDER]
hhdave has joined #lisp
grumble has joined #lisp
hhdave has quit [Ping timeout: 248 seconds]
aindilis has quit [Remote host closed the connection]
w37 has quit [Remote host closed the connection]
aindilis has joined #lisp
dacoda has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
dacoda has quit [Ping timeout: 248 seconds]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
scymtym has joined #lisp
datajerk has quit [Ping timeout: 244 seconds]
colelyman has joined #lisp
datajerk has joined #lisp
cosimone has joined #lisp
FreeBirdLjj has joined #lisp
zhlyg has joined #lisp
heisig has joined #lisp
manualcrank has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
<manualcrank> hey guys, an update: read-line is slow, see <http://pasted.co/d38ad8fb>
<shka__> manualcrank: yeah, this sounds about right
<manualcrank> i'll read the whole file into a string tomorrow. good night.
SaganMan has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
test1600 has joined #lisp
lavaflow_ has quit [Ping timeout: 244 seconds]
crystalball has joined #lisp
crystalball has quit [Remote host closed the connection]
catalinbostan has joined #lisp
szmer has joined #lisp
v0|d has joined #lisp
igemnace has quit [Ping timeout: 248 seconds]
mindthelion has joined #lisp
SaganMan has quit [Ping timeout: 268 seconds]
mindthelion has quit [Read error: Connection reset by peer]
pjb has quit [Ping timeout: 252 seconds]
techquila has quit [Ping timeout: 252 seconds]
igemnace has joined #lisp
techquila has joined #lisp
SaganMan has joined #lisp
<dmiles> karlosz: did you get sb-heapdump to work?
* dmiles is working on gettign CLOAK to work
<dmiles> any advice or dis/encouragement for other is appriciated
jmercouris has joined #lisp
<jmercouris> for boolean variable naming, what convention is favored by yourself or the community?
<minion> jmercouris, memo from beach: Because it only removes from the end, whereas subseq can simultaneously remove from the start and from the end.
<jmercouris> ah, that is a good point
<jmercouris> beach: however, I can't imagine myself remembering the spec so well and keeping that in mind
<flip214> who's maintaining 5am? I've got a feature request resp. bug report: when PARSE-INTEGER reports an error, :START isn't taken into account - so 5am happily reports "no digits in string "1234...""
orivej has joined #lisp
<scymtym> flip214: isn't that an issue in your CL implementation rather than 5am?
<flip214> scymtym: no, SBCL's error message is different.
<flip214> 5am "helpfully" replaces it.
<varjag> is there a way to associate compilation in certain buffers to certain SLIME connections?
donotturnoff has quit [Remote host closed the connection]
SaganMan has quit [Ping timeout: 245 seconds]
SaganMan has joined #lisp
<scymtym> flip214: i see. do you know where that happens? i couldn't immediately find any references to PARSE-INTEGER in 5am's code
<jmercouris> for boolean variable naming, what convention is favored by yourself or the community?
xkapastel has joined #lisp
<scymtym> flip214: SBCL has both error messages: (parse-integer "12345" :start 5) => "no non-whitespace char…" (parse-integer "12345-" :start 5) => "no digits in string …"
zotan has quit [Ping timeout: 258 seconds]
zotan has joined #lisp
dmiles has quit [Ping timeout: 272 seconds]
logicmoo has joined #lisp
aeth has quit [Ping timeout: 248 seconds]
aeth has joined #lisp
sjl has quit [Ping timeout: 248 seconds]
mingus has quit [Ping timeout: 248 seconds]
grms has quit [Ping timeout: 272 seconds]
sjl has joined #lisp
logicmoo is now known as dmiles
<flip214> scymtym: yes, just reproduced that. sorry for the bad error report, that comes from trying to offload things -- my recursion depth was nearly exceeded.
SaganMan has quit [Ping timeout: 258 seconds]
kajo has joined #lisp
catalinbostan has quit [Read error: Connection reset by peer]
python476 has joined #lisp
Lycurgus has quit [Quit: Exeunt]
crystalball has joined #lisp
m00natic has joined #lisp
<jackdaniel> jmercouris: whateverp
<jackdaniel> or things-got-wild-p
<jmercouris> jackdaniel: here is a question for you, (a counter argument I heard), P stands for predicate, and predicates are only functions, is this true?
<jackdaniel> it is a predicate result, so it doesn't bother me at all
<jmercouris> interesting, a good point
<jackdaniel> in semantics (at least in Polish language) predicate is either an expression or result of such expression
<jmercouris> the noun form in english is "predication"
<jackdaniel> the best thing about -p suffix is that you may expand it to both ,)
<jmercouris> indeed
<jackdaniel> http://l1sp.org/search?q=-p* indicates, that some library authors do agree
<aeth> I use foo-p or foo? for boolean variables, not just functions
<aeth> Since things are generalized booleans, not even type information will help you when it comes to trying to figure out intent
sr5h has quit [Ping timeout: 258 seconds]
<aeth> symbol-macrolet and with-accessors exist so there's often a blurry line between variable and function, anyway.
<LdBeth> GG
ym555 has quit [Quit: leaving...]
techquila has quit [Remote host closed the connection]
techquila has joined #lisp
cosimone has quit [Ping timeout: 252 seconds]
cosimone has joined #lisp
crystalball has quit [Read error: Connection reset by peer]
w37 has joined #lisp
jmercouris has quit [Ping timeout: 248 seconds]
test1600_ has joined #lisp
longshi has joined #lisp
test1600 has quit [Ping timeout: 258 seconds]
jmercouris has joined #lisp
ym555 has joined #lisp
steadshot has joined #lisp
longshi has quit [Quit: WeeChat 2.4]
Lord_of_Life has quit [Ping timeout: 258 seconds]
cosimone has quit [Quit: WeeChat 2.4]
Lord_of_Life has joined #lisp
freakcode has joined #lisp
alexanderbarbosa has joined #lisp
freakcode has quit [Client Quit]
Achylles has joined #lisp
jmercouris has quit [Ping timeout: 268 seconds]
samebchase has quit [Ping timeout: 257 seconds]
makomo has joined #lisp
moldybits has joined #lisp
JohnMS has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
jmercouris has joined #lisp
test1600__ has joined #lisp
test1600__ has quit [Client Quit]
test1600_ has quit [Ping timeout: 245 seconds]
dddddd has joined #lisp
random-nick has joined #lisp
orivej has quit [Ping timeout: 248 seconds]
bexx has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
random-jellyfish has joined #lisp
<random-jellyfish> how do I delete parentheses in the Slime REPL?
<jackdaniel> you put the prompt after them and press backspace repeteadly until all parentheses are deleted
<random-jellyfish> jackdaniel: I don't want to delete what is between a pair of parentheses
iovec has quit [Quit: Connection closed for inactivity]
<random-jellyfish> I just want to delete the pair of parentheses that encloses the content, but not the content
<shka__> random-jellyfish: i use evil mode and corresponding surround functions to do that
<shka__> sd) and done
<jmercouris> random-jellyfish: you could use paredit to do that, though I believe it has problems in the REPL
<random-jellyfish> shka__: does Evil work in the slime REPL?
<jackdaniel> you may enable paredit mode for slime-repl buffer, but that doesn't work well
<shka__> random-jellyfish: works for me at least
<shka__> another solution is to use slime-scratch instead of repl directly
<jackdaniel> here's how I do that: I put prompt after the expession enclosed with parens, I press backspace and navigate after the first paren
<jackdaniel> then I remove said first paren
<jackdaniel> with backspace
<random-jellyfish> "go to the beginning, press M-<up>" - this works
<random-jellyfish> the guys from #sharikumo said so, they developed portacle
pfdietz has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
v88m has quit [Ping timeout: 245 seconds]
<jmercouris> shka__: slime-scratch? can you expand on that? a google search yields gibberish results
<shka__> slime has contrib with scratch buffer
<jmercouris> fascinating
<jmercouris> that's a really cool idea
<shka__> it is like emacs scratch buffer but instead of evaluating emacs lisp it is for evaluating common lisp
<shka__> same concept
<jmercouris> right, it makes a lot of sense
<jmercouris> especially if you plan on taking the code from the REPL into actual source
<shka__> it is useful
<jmercouris> can I just add it to the list in slime-setup and it will work?
<shka__> i guess?
<shka__> i am using spacemacs and it comes with it out of the box
<jmercouris> ok, that is what it required
<shka__> slime-eval-print-last-expression is love
<shka__> ;-)
<jmercouris> I find slime contribs to be very counter-intuitive
<jmercouris> I don't understand why all contribs are not just enabled by default
<shka__> well, not question i can answer
jmercouris has quit [Ping timeout: 248 seconds]
<jackdaniel> imagine a contrib implementing a prompt in a form of a nyan cat
<jackdaniel> while I'm sure many people would be delighted to have it I wouldn't load such contrib myself, hence loading it by default may be a bit problematic (for me)
ggole has joined #lisp
charh has quit [Remote host closed the connection]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
iovec has joined #lisp
bexx has quit [Remote host closed the connection]
heisig has quit [Quit: Leaving]
powerbit has quit [Ping timeout: 258 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
manualcrank has joined #lisp
Inline has joined #lisp
Lycurgus has joined #lisp
mindCrime has joined #lisp
Bike has joined #lisp
mindCrime has quit [Read error: Connection reset by peer]
mindCrime has joined #lisp
sjl_ has joined #lisp
sjl_ has quit [Client Quit]
sjl_ has joined #lisp
cosimone has joined #lisp
xkapastel has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
bobby has quit [Read error: Connection reset by peer]
jprajzne has quit [Quit: Leaving.]
powerbit has joined #lisp
Lycurgus has quit [Ping timeout: 258 seconds]
warweasle has joined #lisp
rippa has joined #lisp
varjag has joined #lisp
travv0 has joined #lisp
themsay has quit [Ping timeout: 248 seconds]
themsay has joined #lisp
ebrasca has joined #lisp
shka_ has joined #lisp
<random-jellyfish> new to lisp here
<random-jellyfish> I want to return a pair of random values from a function
<random-jellyfish> (defun dice2 () ( (random 6) (random 6) ))
<random-jellyfish> I get error ; in: DEFUN DICE2 ; ((RANDOM 6) (RANDOM 6)) ; ; caught ERROR: ; illegal function call ; ; compilation unit finished ; caught 1 ERROR condition WARNING: redefining COMMON-LISP-USER::DICE2 in DEFUN
<dlowe> (values (random 6) (random 6))
<random-jellyfish> why?
<dlowe> you can't just put parens everywhere and expect it to work :)
<dlowe> the first element of the form always has an operator
<random-jellyfish> so what operator should I use to return a list with 2 random numbers?
<dlowe> the LIST function returns a list with its arguments
<dlowe> but CL can return multiple values too
<dlowe> without putting them in a list
<dlowe> *CL functions
<random-jellyfish> with the values form?
<dlowe> Yes.
<random-jellyfish> what is the difference?
<dlowe> You might like the #clschool channel
<random-jellyfish> okay I will ask other beginner questions there
<dlowe> If you use LIST, your function will return a linked list with two numbers in it
<random-jellyfish> and if I use values?
<dlowe> if you use VALUES, your function will return two numbers. Calls that don't expect two numbers will only get the first
<dlowe> You can use the multiple values in a variety of ways
<dlowe> including turning them into a list at the call
<random-jellyfish> is that similar to the generators in python?
pjb has joined #lisp
<dlowe> No, it's nothing like that.
<Bike> not really, no
<dlowe> It's literally that functions can return more than one result, without wrapping it in a intermediate structure
<dlowe> it's more akin to returning a tuple in python and then doing a deconstructing assignment
<random-jellyfish> ah that kind of makes sense
<random-jellyfish> like a,b = (1,2) ?
rpg has joined #lisp
<random-jellyfish> of a,b=func_returning_tuple()
<dlowe> right. In CL, (multiple-value-bind (a b) (values 1 2) ...)
<dlowe> except no tuple or anything is created
<random-jellyfish> got it¨
<random-jellyfish> too bad the docs are not as clear as your answers
<dlowe> You can do the analogous thing in CL with (destructuring-bind (a b) (list 1 2) ...) but it's not as useful
jmercouris has joined #lisp
<jmercouris> is there a way to recompile a defpackage form after you've removed some symbols you previously exported?
<jmercouris> what I always find my doing is reloading the entire system
<jmercouris> s/my/myself
<Bike> delete the package?
<jmercouris> you can delete a package from an image?
<Bike> clhs delete-package
<Bike> you'll probably have to recompile everything that uses symbols in the package, though
<jmercouris> that doesn't help too much then :\
<jmercouris> interesting to know that exists though
<jmercouris> I can't imagine using it, but yeah
<jmercouris> somehow adding exported symbols is OK, but if you delete some, SBCL loses its mind
<Bike> you could also manually unexport
<Bike> clhs unexport
<Bike> kind of a pain, but you oughtnt need to rebuild
<jmercouris> unexport could be the ticket
<jmercouris> I'll give it a try the next time this comes up, thank you Bike
<Bike> this also applies to other package alterations sbcl complains about. nothing defpackage does is impossible to do outside of defpackage
<jmercouris> it is however convenient to use defpackage at the top of a file
<jmercouris> maybe it would be another style to export symbols directly after they are defined
<jmercouris> does anyone do things that way?
actuallybatman has joined #lisp
<jmercouris> like if they have a defun they want to export, they have the export right next to it
<sjl_> cl-annot does something like this. I don't personally like it, but I guess some people do https://github.com/m2ym/cl-annot
<sjl_> @export (defun foo ...)
<jmercouris> I didn't like them in Python, and I don't like decorators in LISP either
<jmercouris> I just meant something as simple as (export 'foo) right after (defun foo)
<sjl_> I mean, you could just write the (export 'foo) before
<jmercouris> or even before it, on the precedening line
<sjl_> yeah
<jmercouris> would people curse my code or no?
<sjl_> I personally prefer the one-big-package.lisp-file approach. I like that it makes you lay out the API of each package explicitly in a single place. I like that I know where to go to see a quick overview of a package's API, rather than having to grep through source files for `export`
<sjl_> But to each their own.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jmercouris> sjl_: so you make a package.lisp file?
<jmercouris> and you include all of your defpackages there?
<jmercouris> I do that usually, but I'm working with a caveman2 skeleton project and trying to understand/adapt to Eitaro's style, I may just nix it in the end and go back to the package.lisp approach
LiamH has joined #lisp
<jmercouris> its just that before I completely discount something, I like to at least try it and understand
<karlosz> dmiles: why are you asking me?
moei has joined #lisp
ebrasca has quit [Remote host closed the connection]
<markasoftware> i have an array of :element-type 'boolean. However, each element is taking up many bytes of memory (maybe 8?) in sbcl. Is there any way to decrease this memory usage to 1-2 bytes per element?
<sjl_> not if you want to keep the elements as booleans. A boolean in CL is one of the symbols T or NIL, SBCL uses a pointer to refer to the symbol.
<sjl_> But you could use :element-type 'bit and then use (zerop ...) or (plusp ...)
<aeth> in SBCL (upgraded-array-element-type 'boolean) => T
random-jellyfish has quit [Ping timeout: 256 seconds]
<aeth> I use bits with (zerop foo) and (= 1 foo) and flip the bit with (if (zerop foo) 1 0) etc.
<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.
<aeth> i.e. wrapped like (= 1 (aref foo 0))
<aeth> (and for setting (if foo 1 0))
HDurer has quit [Remote host closed the connection]
<sjl_> that would be all kinds of fun with displaced arrays
<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.
<Xach> markasoftware: a bit vector would be more compact in memory at the cost of some interpretation of the values as booleans.
* Xach catches up to sjl 10 minutes ago
<markasoftware> ok, i'll use bit
<markasoftware> that seems like the right solution, tahnks!
<Xach> on the other hand, memory is so cheap! who cares! cons more!!
jmercouris has quit [Ping timeout: 272 seconds]
lavaflow_ has joined #lisp
phoe has quit [Ping timeout: 252 seconds]
<dlowe> memory is cheap, but it does cost cpu cycles from g
<dlowe> gc
<dlowe> maybe not as much as the bit access though
m00natic has quit [Remote host closed the connection]
<markasoftware> haha, i'm doing project euler, cons would eat everything
simendsjo has joined #lisp
terpri_ has quit [Read error: Connection reset by peer]
<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.
<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.
<aeth> I should probably publish my prime sieve
szmer has quit [Ping timeout: 244 seconds]
cosimone has joined #lisp
travv0 has left #lisp [#lisp]
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Lycurgus has joined #lisp
nanoz has joined #lisp
donotturnoff has joined #lisp
simendsjo has quit [Ping timeout: 258 seconds]
gareppa has joined #lisp
gareppa has quit [Remote host closed the connection]
rpg has joined #lisp
<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
chipolux has joined #lisp
<aeth> Interesting. I turn my sieve into a simple-array fixnum afterwards. Maybe I should hold onto the intermediate bit vector somewhere.
<sjl_> An array of just the primes, which you then bisect to check primality?
<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))
<sjl_> er, (ash n -1)
<sjl_> of course you don't need 64 bits to store numbers < 200,000,000...
<aeth> It doesn't look like I do a lookup of primes
<aeth> I mean, I don't do a primep
<aeth> Is that used in a later problem?
<sjl_> But I still think the bit vector method uses less space, and the lookup is O(n) instead of O(log(n))
<sjl_> "later" than what?
<sjl_> I use it in 35
<sjl_> in 27 too
<sjl_> 37, 41, 50, 51
<sjl_> and more after that
<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.
<aeth> it doesn't look like I did those
terpri has joined #lisp
<sjl_> I sort by difficulty and have been trying to mostly just go in order
<sjl_> friend code 48257_AAgoR50jsmK1HqPwtcQJZV9iqzIuk6ay if any other Lisp people do Project Euler
<aeth> I haven't been doing it recently
cosimone has quit [Quit: WeeChat 2.4]
alexanderbarbosa has quit [Remote host closed the connection]
phoe has joined #lisp
Achylles has quit [Remote host closed the connection]
kajo has quit [Ping timeout: 258 seconds]
kajo has joined #lisp
themsay has quit [Read error: Connection reset by peer]
sauvin has quit [Ping timeout: 248 seconds]
themsay has joined #lisp
nanoz has quit [Ping timeout: 248 seconds]
kajo has quit [Ping timeout: 252 seconds]
hvxgr_ has quit [Ping timeout: 252 seconds]
MichaelRaskin has joined #lisp
dacoda has joined #lisp
paul0 has quit [Read error: Connection reset by peer]
dacoda has quit [Ping timeout: 248 seconds]
rumbler31__ has quit [Read error: Connection reset by peer]
Folkol has joined #lisp
ggole has quit [Quit: Leaving]
blackswan has joined #lisp
orivej has joined #lisp
<blackswan> how many people would you estimate have written tetris clones in lisp?
<Bike> Six
alexanderbarbosa has joined #lisp
<blackswan> did you google it?
<blackswan> because that's the number of apparently unique repositories referenced on the first two pages when i search for "tetris lisp"
<Bike> No, I based it on nothing at all.
<blackswan> i was wondering whether you actually counted
simendsjo has joined #lisp
iovec has quit [Quit: Connection closed for inactivity]
<Bike> nope. six just seemed like a good number
<Bike> and as it turned out it was
v88m has joined #lisp
<blackswan> six is an excellent number, as i'm sure baltar would agree
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
random-nick has quit [Read error: Connection reset by peer]
kajo has joined #lisp
<moldybits> blackswan: in #lispgames 2 of us are currently writing one each
paul0 has joined #lisp
flazh has joined #lisp
nowhere_man has joined #lisp
<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
random-nick has joined #lisp
shka_ has quit [Ping timeout: 272 seconds]
<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.
<blackswan> the other two were not in lisp.
Bike has quit []
<dmiles> karlosz: google showed you asking the same question a while back
lime[_] is now known as uplime
<karlosz> dmiles: oh, okay. im not really sure what you are asking me though
<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
<dmiles> it was left off inconclusice.. i couldnt tell if you succeeded or not
<dmiles> 2018-01-10T15:02:33Z karlosz: do you happen to know if sb-heapdump is still working?
<dmiles> 2018-01-10T15:02:43Z karlosz: i could do that as well in this thing
<karlosz> dmiles: i have no idea what cloak is. i am pretty sure i was working on some sbcl internals related thing
ober has joined #lisp
<dmiles> oh maybe unrelated to CLOAK as i am rereading
<dmiles> yeah no CLOAK in this
aeth has quit [Ping timeout: 245 seconds]
mindCrime has quit [Ping timeout: 244 seconds]
<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.
<dmiles> question i cant find sb-heapdump anywhere
aeth has joined #lisp
<dmiles> i reverted to sbcl -C -D "2007-7-11"
<dmiles> to make sure it will be compatible
<dmiles> (reverted to CVS -C -D "2007-7-11")
<dmiles> anyone know where i can find the src https://www.cliki.net/sb-heapdump
<dmiles> oh weird may the git repo is wornming agian
<dmiles> ok it just missing for https://repo.or.cz/?a=project_list and cl.net
<dmiles> so yeah.. dont know where to find https://www.cliki.net/sb-heapdump
<ober> ahh purely a guix problem
Arcaelyx has joined #lisp
nowhere_man has quit [Ping timeout: 258 seconds]
rozenglass has quit [Ping timeout: 244 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
rozenglass has joined #lisp
simendsjo has quit [Ping timeout: 248 seconds]
cosimone has joined #lisp
nicksmaddog has joined #lisp
vlatkoB has quit [Remote host closed the connection]
Arcaelyx has quit [Quit: Arcaelyx]
aeth_ has joined #lisp
Lycurgus has quit [Quit: Exeunt]
python476 has quit [Ping timeout: 259 seconds]
aeth has quit [Ping timeout: 248 seconds]
aeth_ is now known as aeth
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
random-nickname has joined #lisp
random-nick has quit [Ping timeout: 248 seconds]
<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.
nicksmaddog has quit [Remote host closed the connection]
nicksmaddog has joined #lisp
donotturnoff has quit [Ping timeout: 245 seconds]
<oni-on-ion> mgsk, is this too old perhaps? https://github.com/DamienCassou/DSLides
aeth has quit [Ping timeout: 248 seconds]
grewal has quit [Quit: leaving]
aeth has joined #lisp
LiamH has quit [Quit: Leaving.]
Bike has joined #lisp
random-nickname is now known as random-nick
nicksmaddog has quit [Remote host closed the connection]
nicksmaddog has joined #lisp
zhlyg has quit [Ping timeout: 248 seconds]
orivej has quit [Ping timeout: 246 seconds]
wigust- has quit [Read error: Connection reset by peer]
wigust has joined #lisp
jack_rabbit has joined #lisp
nirved_ has quit [Read error: Connection reset by peer]
nicdev has quit [Quit: ERC (IRC client for Emacs 26.1)]
nicdev has joined #lisp
nicksmaddog has quit [Ping timeout: 252 seconds]
krwq has joined #lisp
Lycurgus has joined #lisp
random-nick has quit [Ping timeout: 246 seconds]
sjl_ has quit [Quit: WeeChat 2.3-dev]
Folkol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cosimone has quit [Ping timeout: 248 seconds]
Oladon has joined #lisp
elderK has joined #lisp
<elderK> Hey all!
<elderK> I was wondering if anyone here is currently in Christchurch, New Zealand?
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
vms14 has joined #lisp
ym555 has quit [Quit: leaving...]
ym555 has joined #lisp
<Oladon> I'm not, but I could pretend to be for the right price.
<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
<no-defun-allowed> That was a while ago, Colleen
<Oladon> Quite so...
<Oladon> I have no memory of the context of that, but looking at the link helps :P
<Oladon> Colleen: Tell no-defun-allowed I said thanks
<Colleen> no-defun-allowed: Unknown command. Possible matches: 8, set, say, mop, get, time, tell, roll, help, deny,
<no-defun-allowed> I think you were asking for a forum program a while ago.
<Oladon> no-defun-allowed: :P
<Oladon> Sounds right
<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.
nowhere_man has joined #lisp
<Oladon> Coulda sworn I'd talked in here since then though :P
<Oladon> no-defun-allowed: Looking it over now, seems reasonable.
<Oladon> Heh, I like your name generator
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
vms14 has quit [Quit: WeeChat 2.3]
libertyprime has joined #lisp