<rdap>
Grue`: I know... it's just something that was left from experimenting with doing it in a piecemeal fashion. The only reason it was there was so I could catch duplicates side by side when viewing the list after append. But you're right, it wasn't needed in the final solution.
longshi has quit [Ping timeout: 258 seconds]
wigust- has quit [Ping timeout: 246 seconds]
esrse has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
Oladon has quit [Ping timeout: 246 seconds]
wigust has joined #lisp
akoana has left #lisp [#lisp]
Khisanth has joined #lisp
meepdeew has quit [Remote host closed the connection]
torbo has joined #lisp
BertyCoX- has joined #lisp
moldybits has quit [Quit: WeeChat 2.4]
KaitoDaumoto has quit [Ping timeout: 258 seconds]
ltriant has quit [Ping timeout: 250 seconds]
impulse has quit [Ping timeout: 246 seconds]
anewuser has quit [Quit: anewuser]
ltriant has joined #lisp
meepdeew has joined #lisp
didi has quit [Ping timeout: 250 seconds]
didi has joined #lisp
brainacid0 has joined #lisp
<brainacid0>
Hey all. Newbie hobbyist here. Excited to learn and make some penpals
meepdeew has quit []
rdap has quit [Remote host closed the connection]
<Josh_2>
Noice
<loke>
Penpals? :-) Wow, that's a word I haven't heard since the 80's :-)
Zaab1t has joined #lisp
<didi>
They were fun.
<minion>
didi, memo from Grue`: you can avoid that with (funcall 'square ,y) because then you're only calling standard functions which cannot be redefined with flet, and 'square takes the global definition of square
<didi>
Grue`: I would go a step further and use (funcall ,#'square ,y).
<didi>
I was reading a paper by Constanza et al about hygienic macros in Common Lisp. Interesting stuff.
<didi>
Costanza*, sorry.
rdap has joined #lisp
dale has quit [Quit: dale]
CrazyEddy has joined #lisp
pagnol has quit [Ping timeout: 245 seconds]
<brainacid0>
;)
dddddd has quit [Remote host closed the connection]
<pjb>
loke: nowadays, tablets have pens, and OCR…
<loke>
pjb: True. But these days, people don't have pals :-(
<pjb>
Not enough retro. Use Cathode.app for a more retro look.
<gilberth>
There are these new innovative tablets, that don't even need any power to operate. I happen to believe they are called "paper" or something.
Ukari has quit [Remote host closed the connection]
<pjb>
gilberth: and they even have a protocol to communicate remotely, whereby you fold the paper, write down the address (like the ip address, but more human friendly), paste a stamp, and give it to the postman. They it flies thru the postal network and is delivered to the actual mail box of the recipient!
<pjb>
And what's more, there's basically no MTU: you can seven send bigger packets without splitting them in little packets!
<gilberth>
Wow! I didn't knew that. Do I need to register for that service?
<pjb>
Not really. You just write your address on the back if you want to receive an answer. That's it.
<gilberth>
Terrific!
<pjb>
Now the maximum ping time can count in tens of years, but it's usually around 3 or 4 days.
<pjb>
The pro, is that the addressing is really smart.
<pjb>
No need for a DNS or anything like that.
<gilberth>
Hmm, but I guess the bandwidth is great, when I send you a few disks.
<didi>
gilberth: You reminded me of a quote by Tanenbaum: "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway."
<pjb>
Oh, and also there's a security protocol, supported by drastic laws!
holycow has joined #lisp
<gilberth>
didi: I was kind of citing Tanenbaum. I assumed everybody around here knew that quote.
<didi>
gilberth: Ah! /me honks gilberth's nose
<pjb>
If you open a letter you're not the recipient of, you can get 1 year of prison and a free of 45,000 €. (eg in France, article 225-15 du code pénal).
<rdap>
But I used an off-the-shelf example for FACTOR
<rdap>
So I kind of feel like I cheated
vlatkoB has joined #lisp
lnostdal has quit [Remote host closed the connection]
<beach>
It is not good style to use WHEN in a position where its value is used.
<beach>
Plus, you should always show the special case first.
lnostdal has joined #lisp
<beach>
So (if (<= n 1) '() (loop ....))
<gilberth>
In the last clause: When I the number was divisible by say 5 can it still be divisible by 3?
<gilberth>
s/I//
<loke>
5 and 3... is this fizbuz?
<gilberth>
loke: Heh, I just learned about fizzbuz this night.
<rdap>
Thanks, beach! I'll give that a try
<loke>
gilberth: Ah! Then you have not heard about Enterprise Fizzbuz!
<gilberth>
Anybody up for a fizzbuz CL challange? :)
<loke>
gilberth: Have you seen that one?
<rdap>
gilberth: In the last clause of what?
<gilberth>
loke: Just this night, as I said. Which is strange coincidence.
Aruseus has joined #lisp
<loke>
gilberth: Basically, it's a project that impleemnts an "enterprise" version of it. Making using of all Java Enterprise Design patterns you can think of:
<loke>
It's hillarious:
<gilberth>
loke: Perhaps we could abuse MOP to implement a fizz-buz-method-combination.
rozenglass has quit [Remote host closed the connection]
<phoe>
flip214: I'll be there on Sunday, lispin' with some other people
robdog has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
themsay has quit [Ping timeout: 255 seconds]
<gilberth>
Grue`: Is having the sieve (the array) really is beneficial? Becaus most of it is not even needed. When we just skip that, we get the number down quite quickly, when we are lucky.
<flip214>
phoe: If you don't mind me joining -- where exactly?
<phoe>
flip214: no idea yet. (:
<flip214>
ah, okay ;)
<flip214>
Xof said he'll release SBCL 1.5.1 on Sunday from Genova, so he should be somewhere around there too
<phoe>
ELSBCL
<flip214>
phoe: so how are you going to organize the "meeting" then?
<phoe>
flip214: that's a good question, let's do it now
voidlily_ has joined #lisp
<flip214>
well, depending on the weather some park might be nice (like the terrace last year!) - but that probably won't have any Wifi or power sockets.
<flip214>
OTOH, just sitting around in some McD would be boring.
<Grue`>
gilberth: it's not beneficial in this case, but it's beneficial when many numbers need to be factorized, which is needed in other problems
<gilberth>
Grue`: I see. Like a cache of all primes below a certain limit.
<flip214>
phoe: how about 09:30 at 44.416306, 8.931091 as a first-order approximation, with ideas to be discussed there?
<flip214>
or is that too early, better 10:00?
andrei-n has joined #lisp
<phoe>
flip214: I don't know yet, need to align with Shinmera and kpoeck
<phoe>
but the conplace has a hotel, so it will be open on Sunday
<phoe>
so we likely could meet there
smasta has joined #lisp
<flip214>
okay as well... which time?
<phoe>
again, need to align with them - but 10:00 sounds okay for me
<flip214>
Sunday 10:00 -- "proposal accepted" ;)
<phoe>
okiedokie
<flip214>
merci, see you there!
smasta has quit [Ping timeout: 255 seconds]
libertyprime has joined #lisp
longshi has joined #lisp
heisig has joined #lisp
themsay has joined #lisp
Patzy has joined #lisp
longshi has quit [Quit: WeeChat 2.4]
esrse has quit [Ping timeout: 245 seconds]
scymtym has quit [Ping timeout: 245 seconds]
verisimilitude has quit [Remote host closed the connection]
pankajgodbole has joined #lisp
JohnMS has joined #lisp
JohnMS_WORK has quit [Ping timeout: 245 seconds]
pyc has joined #lisp
<pyc>
Do you use Lisp in production? I am mostly a Python programmer and I am thinking if I should learn Lisp.
<pyc>
I am okay with the learning for the joy of learning but I have found that I can make the most out of a new language only if I am also using it to develop useful software that I care about.
scymtym has joined #lisp
<ecraven>
pyc: yes, many of us do
<ecraven>
most languages can be used in production
smasta has joined #lisp
<jackdaniel>
pyc: what ecraven said. I use CL in production for instance
<ecraven>
me, it's mostly different Schemes. people definitely use clojure. so pick one ;) [probably CL, in #lisp ;)]
smasta has quit [Ping timeout: 250 seconds]
schweers has joined #lisp
<rdap>
pyc: take this with a grain of salt, as i'm still relatively new to Lisp; but I feel that learning lisp has been useful for writing better code in languages that aren't lisp
<rdap>
the last time i spent some time with lisp, i was able to come back to C and see an improvement
robdog has joined #lisp
<fiddlerwoaroof>
pyc: I've written lots of useful software in Common Lisp but it's mostly tools for personal use, not for work
robdog has quit [Ping timeout: 250 seconds]
Ukari has joined #lisp
pankajgodbole has quit [Ping timeout: 246 seconds]
smasta has joined #lisp
svillemot has quit [Ping timeout: 258 seconds]
orivej_ has quit [Ping timeout: 246 seconds]
smasta has quit [Ping timeout: 268 seconds]
smasta has joined #lisp
<shka__>
CL has one really good use
<shka__>
that seems to be omitted by everyone
<shka__>
namely, it can be used for exploratory programming very efficiently
<shka__>
so it is very valuable tool for learning
<shka__>
and you can build usefull stuff with it as well
<rdap>
indeed
<pyc>
ecraven: jackdaniel: What kind of applications do you write in production with Common Lisp?
<shka__>
not sure if the above counts for pyc, but there is a huge value in that for me
<ecraven>
web stuff, mostly
<pyc>
thanks ecraven
<aeth>
pyc: From a different angle (not necessarily more important, just not covered yet)... The SBCL implementation of CL has very good performance. Not C-level, but probably Java-level (but AOT-compiled instead of JIT-compiled, so with slightly different specific characteristics)
svillemot has joined #lisp
<aeth>
Performance isn't the most important thing, but it does enable different things you can do with it, especially if you're going for an all-in-one-language approach.
<ecraven>
as long as you send http, no-one cares much what you use behind that ;)
smasta has quit [Ping timeout: 255 seconds]
orivej has joined #lisp
<shka__>
yeah, you kinda can do numeric computation in SBCL
<shka__>
it takes a little bit of effort to optimize, but results are decent
<aeth>
Don't expect C/C++ levels, but probably only 3x slower... more like... what compilers were 20 years ago before they got really crazy with the optimizations.
<ecraven>
in other words, fast enough for most things ;)
<ecraven>
and definitely faster than the usual candidates
<aeth>
And C/C++ (I say that because they're usually part of the same compiler suite) usually does some really bad optimizations that break reliability, anyway.
<aeth>
Although I guess you can kind of get that in SBCL with (safety 0) too :-p
<akssri>
aeth: SBCL can produce numerical code that is roughly within 30% of C-code without SSE/AVX optimizations.
<aeth>
akssri: yes, and I'm guessing it's the "without SSE/AVX optimizations" that probably makes it "300%" instead of "130%"
orivej has quit [Ping timeout: 255 seconds]
<akssri>
aeth: sadly yes. trouble is there is no "nice" way to use the intrinsics.
<schweers>
aeth: you can get /really/ bad behaviour with (safety 0). Segfaulting on a function called with the wrong number of arguments, for instance.
<schweers>
I guess if you have code which is really small and simple (like, you could do it in C), but needs to be blazing fast, you might get away with it, /if/ you tested it very thoroughly. But I wouldn’t do it unless I had very compelling reasons to even try it.
<aeth>
My experience with C is there's never enough tests to be confident with it.
<schweers>
Which is why you should try to avoid (safety 0) in lisp.
<schweers>
Anyway, SBCL has impressive performance even without type annotations given something like (optimize (speed 3) (space 3) (safety 1))
<aeth>
Depends on what you're doing. Type annotations matter for numbers and sequences because it de-generics things, and it matters for arrays because it removes bounds checks. Past that, doesn't matter much ime.
<agspathis>
FWIW, i'll submit a recent example of SBCL, applicable for Lisp in general i think, too): a friend of mine wanted to do some linear algebra in real time. The scenario was that he has some sensors recording human movement live and would like to compute some quantities on the fly. He used sympy to precompute the operations to be carried out symbolically, using the "export to C++" function of sympy. Both gcc and clang choked on the large
<agspathis>
file produced (unless he turned off optimizations completely). Using emacs, I transformed the file into sexps, which were then parsed and compiled into separate lambdas (a process which took about 20 secs -- gcc/clang were taking about 5 minutes before giving up). With only a few type declarations, the lisp version of the update was about twice faster than the C++ counterpart, but I left it there, since due to external (management)
<agspathis>
constraints, Lisp would not be acceptable.
<schweers>
probably because of reasons.
<aeth>
too many parentheses
<akssri>
btw has anyone here used AVX/SSE intrinsics with SBCL ? I'm not sure how to make SBCL emit movapx with simple-arrays.
<schweers>
aeth: but that’s one of lisps huge advantages!
<schweers>
but yes, I know that people think otherwise. Anyway, I shouldn’t rant about this.
<schweers>
anyway, I’m off for lunch.
<agspathis>
bon appetit!
hhdave has joined #lisp
<makomo>
phoe: flip214: is that a meeting i hear? :-) perhaps a friend and i could join as well (if you don't mind), but we won't be in genova until ~14:00 (+- X minutes for checking in and what not)
nirved has quit [Killed (wolfe.freenode.net (Nickname regained by services))]
<makomo>
not sure if you had anything in plan for that afternoon, but if you did, it'd be cool to meet up :-)
<flip214>
aeth: install a reader macro that allows to use [], {}, «» etc. instead of only (), that helps
nirved has joined #lisp
<flip214>
makomo: don't know about the afternoon. Sunday 10:00 a few people will be at the ELS location.
<makomo>
yup, i just read above. :-) we won't be there by 10:00, but we're right across the street though, so it should be like 1-2 minutes of walking to get to the hotel once we're checked in
<flip214>
still, you need to walk
<flip214>
_very_
<flip214>
fast to make that in -3h58'
<makomo>
LOL yeah :D
<flip214>
but it should be loud enough to hear ;)
m00natic has joined #lisp
dddddd has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
Josh_2 has joined #lisp
amerlyq has joined #lisp
<_death>
I'll also be around (starting Friday)
beach has quit [Ping timeout: 252 seconds]
beach has joined #lisp
lerax has joined #lisp
smasta has joined #lisp
<phoe>
makomo: please do
smasta has quit [Ping timeout: 250 seconds]
smasta has joined #lisp
<phoe>
so it seems there will be a meetup on Sunday at the ELS venue at 10:00 - and we'll travel from there
DGASAU has joined #lisp
orivej has joined #lisp
amerlyq has quit [Quit: amerlyq]
Aruseus has quit [Remote host closed the connection]
smasta has quit [Ping timeout: 244 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
robdog has joined #lisp
<makomo>
phoe: cool :-). we won't be there before 14:00 most likely so i'll let you know what the situation is on the day of the meetup so we can sync up
<makomo>
either here on irc or on discord
<pyc>
Can someone tell a newbie like me what are these meetups and where they are held?
<flip214>
phoe: "travel" as in "talk a walk" (so no notebooks) or as in "to the next wifi for lisp hacking"?
andrei-n has quit [Remote host closed the connection]
nalkri has quit [Ping timeout: 272 seconds]
agspathis has quit [Remote host closed the connection]
lumm has joined #lisp
lerax has quit [Remote host closed the connection]
hhdave has quit [Quit: hhdave]
Zaab1t has joined #lisp
scymtym has quit [Ping timeout: 268 seconds]
nowhere_man has joined #lisp
Oddity has quit [Read error: Connection reset by peer]
smasta has joined #lisp
PuercoPope has joined #lisp
smasta has quit [Ping timeout: 244 seconds]
hiroaki has quit [Ping timeout: 245 seconds]
schweers has quit [Ping timeout: 240 seconds]
<p_l>
how viable would it be to replace CL reader with one using syntax-objects?
vlatkoB has quit [Remote host closed the connection]
<Xach>
p_l: what is syntax-objects?
<p_l>
Xach: essentially a bit extended form for data produced by read, so you get also things like position in file etc.
<p_l>
also how scheme macros gets implemented
<Bike>
i don't know about "bit extended", but is that like the cst reader in eclector? where a CST is a standard-object that has a position and such
<pjb>
p_l: it has been done, using com.informatimago.common-lisp.lisp-reader.reader cf. com.informatimago.common-lisp.lisp-text.source-text too.
<pjb>
p_l: unfortunately, I don't remember who did it, rather completely, to read sources and generate documentation.
<pjb>
p_l: also, notice that some CL implementation already note the source position and slime uses it.
m00natic has quit [Ping timeout: 250 seconds]
sauvin has quit [Read error: Connection reset by peer]
<flip214>
is there a YAML reader that returns such extra data like line number etc.? Would help with error messages (for semantic reasons)
jmercouris has joined #lisp
vibs29 has quit [Ping timeout: 246 seconds]
vibs29 has joined #lisp
makomo has joined #lisp
themsay has quit [Read error: Connection reset by peer]
nalkri has joined #lisp
themsay has joined #lisp
scymtym has joined #lisp
spoeplau has joined #lisp
CyL_ has joined #lisp
smasta has joined #lisp
themsay has quit [Ping timeout: 250 seconds]
themsay has joined #lisp
Oddity has joined #lisp
orivej has quit [Ping timeout: 250 seconds]
smasta has quit [Ping timeout: 246 seconds]
JetJej has joined #lisp
amerlyq has quit [Read error: Connection reset by peer]
lucasb has joined #lisp
DrPete has quit [Ping timeout: 250 seconds]
DrPete has joined #lisp
robdog has joined #lisp
themsay has quit [Ping timeout: 246 seconds]
robdog has quit [Ping timeout: 250 seconds]
amerlyq has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
robdog has joined #lisp
robdog has quit [Client Quit]
nowhere_man has quit [Ping timeout: 250 seconds]
libertyprime has joined #lisp
verisimilitude has joined #lisp
karlosz has joined #lisp
gravicappa has quit [Ping timeout: 246 seconds]
hiroaki has joined #lisp
vibs29 has quit [Ping timeout: 255 seconds]
q3d has joined #lisp
vibs29 has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
themsay has joined #lisp
libertyprime has quit [Ping timeout: 255 seconds]
undiscov1 has quit [Remote host closed the connection]
<moldybits>
(ccase 1 (1 2)) in SBCL yields the error: "Variable name is not a symbol: 1." question 1: ccase does accept a place, such as (nth 0 x), so that error message is a bit misleading? question 2: is it even mandated that this should be an error? the spec says keyplace might *possibly* be used later as a place, but that's only for when all normal-clauses fail, which isn't the case here.
<pjb>
indeed.
<pjb>
1. a place. 2. yes a program-error.
<pjb>
The syntax is mandatory.
<Bike>
why would you even want to use ccase with a non-place.
<pjb>
moldybits: But I see what you mean. The problem is that the spec is not a formal spec.
spoeplau has quit [Ping timeout: 245 seconds]
varjag has joined #lisp
<sjl_>
Yeah, SBCL should probably say "1 is not a place" or something that doesn't imply you can only use symbols there.
<sjl_>
same for check-type and probably others
<moldybits>
pjb: but you say it is mandatory? you mean that that is the only "sensible interpretation of the intent", or is there something more than that?
<Bike>
it looks like the error is because it writes out (setf 1 ...) and then setf has that compile error
<moldybits>
Bike: i just thought i should start to read the spec more carefully.
<Bike>
which could probably be changed, since (setf 1 foo) is also wrong and "variable name is not a symbol" doesn't fully encompass the wrongness
<sjl_>
I could see an argument that (ccase 1 (1 2)) could produce 2. In practice, I'm much happier having a compile-time warning.
<Bike>
because get-setf-expander just checks for ATOM i guess
<pjb>
moldybits: I say that you're right to wonder.
libertyprime has joined #lisp
<pjb>
moldybits: also notice that (ccase 1 (1 2)) can be compiled as 2.
<moldybits>
i'm getting the impression that the lisp community is not as anal with the spec as some other languages? :p
<Bike>
uh...
<sjl_>
wait, actually
<pjb>
moldybits: it's probably better to signal an error, incase you write (ccase (sin 0) (0 'yay)) and (sin x) is not a place!
<sjl_>
(defun foo () (ccase 1 (1 'ok))) in SBCL gives you a warning, but compiles just fine
<pjb>
moldybits: well, read some cll, you'll see the analness.
<Bike>
yeah, i just threw (ccase 1 (1 2)) in a repl a nd it just returned 2 no problem
<Bike>
the error is just during compilation
<pjb>
#+ccl (ccase 1 (1 2)) #| ERROR: 1 is not a symbol. |#
<Bike>
and if it ever got to the setf it would probably be a runtime error, but it doesn't
<sjl_>
right
<pjb>
Only sbcl and abcl return 2. the other signal an error.
<Bike>
what do you know, ecl and clasp axctually check for (or symbolp consp)
jmercouris has quit [Remote host closed the connection]
<moldybits>
oh, i missed this. it *does* return 2, even though it signals an error?
<Bike>
there's an error signaled in the compiler
<Bike>
but it doesn't like, drop into the debugger, the compiler intercepts it
<Bike>
when the compiler hits an invalid form it can put something else in like this
<moldybits>
ah, like C's UB. anything goes?
<Bike>
that's not what i said
<Bike>
in this case sbcl has interpreted the (setf 1 ...) form as being a genuine error, something that when executed would have to signal an error
<Bike>
but when you are merely COMPILING the form it doesn't drop into the debugger, it just prints a message like "hey this is gonna break"
q3d has quit [Ping timeout: 256 seconds]
<moldybits>
(+ (ccase 1 (1 10)) 5) complains, but it also returns 15.
<Bike>
yes
<sjl_>
Right, which seems to fit what the spec says (minus the error message being less than ideal)
<Bike>
the actual form involved in the error is the (setf 1 whatever)
<Bike>
but as you noted, that's only when all the normal clauses fail, which doesn't actually happen
<moldybits>
okay, so sbcl's expansion of ccase contains a (setf 1 ...) form, and it tells me this will break if evaluated, but it never actually evaluates that part in this case. okay, now it make sense.
<sjl_>
> ---a form; evaluated initially to produce a test-key. Possibly also used later as a place if no keys match.
<jackdaniel>
I remember I saw an interesting dicussion about compile-time errors for ccase (initiated by previous ecl maintainer), I'm not sure though if it was implementers mailing list or ansi-tests one
<sjl_>
keyplace is specifically said to be "a form" and not "a place"
<jackdaniel>
(dated ~2002-ish)
<phoe>
sjl_: "If the store-value restart is invoked, its argument becomes the new test-key, and is stored in keyplace as if by (setf keyplace test-key). Then ccase starts over, considering each clause anew."
<sjl_>
phoe: yes. which never happens in this example.
<Bike>
as you can see we're not anal about the spec
<phoe>
you cannot SETF a form, you can only SETF a place
<pjb>
The first problem is "used later" when you talk about a form to be compiled. "later" is a dynamic run-time notion. (ccase 1 (1 2)) is a compilation time program-error.
<phoe>
sure, it never happens if you do not invoke the STORE-VALUE restart
<sjl_>
Yes, so if (ccase 1 (1 2)) ever got past the 1 clause it would have problems.
<Bike>
i think the right thing to do would be to give the setf thing a better warning error whatever, and then the righter thing to do would be to have ccase check for placeness itself and signal a warning or whatever, but why would this code be written in the first place
<phoe>
but (if *x* 42 (setf 1 2)) is also correct Lisp if we follow this idea
<phoe>
as long as *x* is true
<sjl_>
sure
<sjl_>
sbcl doesn't even complain about that one
<sjl_>
well, it does if you compile it
<sjl_>
but it still returns 42 fine
Essadon has joined #lisp
<jackdaniel>
because 42 is *the* answer :)
<jackdaniel>
I'd personally prefer having compilation error on errors which may be detected at that time (and definetely I wouldn't like magic like: else clause is invalid code, so it should never trigger, so whole form collapses to 42, I've read something like that happens in llvm c++ compiler - https://blogs.msdn.microsoft.com/oldnewthing/20140627-00/?p=633/)
gxt has joined #lisp
<Bike>
yeah, that's bad ub.
<phoe>
jackdaniel: C++ compilers have pedantic modes luckily, and they are able to detect UB and error on them instead of optimizing them away
<shka_>
this does not work perfectly well
<jackdaniel>
phoe: usually code is full of acceptable undefined behaviors
<jasom>
please confirm that I'm not going insane: *random-state* is thread-local in SBCL, right? The disassembly certainly makes me think so ...
<jackdaniel>
my point was that such optimizations miss the point of what compiler should do
<shka_>
hmm
<shka_>
jasom: i don't know for sure, but i would expect it to be thread local
* jasom
is trying to parallelize work that heavily uses cl:random and is finding that the run time is identical no matter how many threads are used
<shka_>
perhaps i can help?
<shka_>
can you please show your code?
<jackdaniel>
one worker more, not bad ,)
<phoe>
jasom: do you explicitly create a new random state per thread?
<jasom>
phoe: I do not, but could
<phoe>
try it
smasta has joined #lisp
<jasom>
phoe that worked
<shka_>
wow
<jasom>
12x speedup in wall-clock time
<shka_>
so i guess it is not thread local
<shka_>
jasom: this is indeed valuable information
<shka_>
thanks
<jackdaniel>
jasom: what makes you think, that *random-state* is bound to different objects on different threads?
<Bike>
even if it is thread local, if they all share the same random-state object they might only update it through lokcs?
<verisimilitude>
It's rather satisfying to have a program that entirely lacks undefined behavior.
<shka_>
hm, i suspect that this could be lock free with atomics
<verisimilitude>
Common Lisp does make it easy to introspect on the environment, of course, so it's also easy to simply check if the implementation can support the program, beforehand, which still makes it a valid program.
nirved is now known as Guest19688
Guest19688 has quit [Killed (adams.freenode.net (Nickname regained by services))]
<Bike>
the random state has to be updated in an organized way, yeah? probably have to do some loopy cas biznis at best
<phoe>
jackdaniel: I personally despise UB, but that's just my taste
nirved has joined #lisp
<jackdaniel>
phoe: what is undefined behavior in a standard may be well defined in an implementation
<jackdaniel>
case in point: threads in lisp, pointer casting in c
smasta has quit [Ping timeout: 246 seconds]
<verisimilitude>
There's no comparison between C and Common Lisp.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
smasta has joined #lisp
<verisimilitude>
Common Lisp is, in the vast majority of cases, a very well defined language.
<jackdaniel>
suprise, I just did one
<verisimilitude>
There's a difference between a nonstandard extension and undefined behavior.
<shka_>
those are pretty vague statements
<verisimilitude>
There's a league of difference between adding threads to Common Lisp and signed integer overflow in C.
<verisimilitude>
In Common Lisp, you can easily do arithmetic correctly; in C, you can't.
<verisimilitude>
That's a big difference.
<dlowe>
almost nothing else has implicit bignums
<verisimilitude>
Ada gets along just fine, because it actually recognizes that overflow can happen, unlike C, which simply ignores it.
<verisimilitude>
So, you get an exception in Ada, and you get program misbehavior or chunks of code removed by the compiler, in C.
<LdBeth>
Ada has fix point arithmetic
<LdBeth>
Which I think is great
* jasom
remembers some comment on ISAs (RISC-V I think?) where people were requesting efficient traps of signed integer overflow, and the answer was "compilers don't use that" the response was "compiler's don't use that because it's not efficient on most architectures" ... chicken and egg problem.
<verisimilitude>
Ada has modular, integer, floating, and fixed arithmetic.
<verisimilitude>
It also has decimal arithmetic.
smasta has quit [Ping timeout: 250 seconds]
<verisimilitude>
RISC architectures are generally braindead, jasom, and they're also usually not reduced, either.
<jasom>
well I was testing out Nim, in which the random state is neither thread-safe nor thread-local.
<verisimilitude>
SuperH and Power look nice enough, from what I've gleamed, though.
<verisimilitude>
Power may not even be considered RISC anymore.
* jasom
loves Power. When it was first introduced everyone not named IBM argued it wasn't RISC though.
<shka_>
at least it is open
<no-defun-allowed>
The only good RISC has CDR as an opcode.
<jasom>
IBM had some retort along the lines of "When we say RISC, the C is for cycle and all integer operations require a single cycle per pipeline stage"
<White_Flame>
then what does the "RIS" stand for?
<jasom>
Reduced instruction set cycle
<White_Flame>
that doesn't even
<jasom>
yeah, it was pretty silly.
<verisimilitude>
It's less wordplay than RISC itself.
* LdBeth
Disk Locked Content
<verisimilitude>
Yes, let me use three instructions, twelve bytes, to increment and store a value; how minimal, reduced, and general purpose.
<jasom>
well the MIPS acronym hasn't made sense for almost 30 years now I think?
<no-defun-allowed>
sure, now how many opcodes and how much microcode do you need to implement everything that looks similar to that pattern, verisimilitude?
<jasom>
Like I think the R6000 had interlocks.
<White_Flame>
verisimilitude: the hardware is reduced, offloading more work to the software & compiler, which is kind of its stated purpose
<shka_>
hm good night all
<verisimilitude>
The Lisp machines needed less than one million transistors, which is far less than any of these ``reduced'' machines.
<shka_>
this discussion belongs to the #lispcafe
<jasom>
indeed
<no-defun-allowed>
SOAR only used 30k transistors, but off we go.
<LdBeth>
Good morning
<jasom>
verisimilitude: original RISC was 110k resistors ...
<jasom>
s/RISC/MIPS
<no-defun-allowed>
But basically, if CAR, CDR, CONS, EQ and FUNCALL/APPLY aren't opcodes, then you have a boring instruction set.
<verisimilitude>
I meant a modern RISC isn't.
<p_l>
Because it hauls a ton of other stuff to make things fast
<p_l>
Like multiple ALUs, huge caches, register files bigger than internal memory of old cpus
<verisimilitude>
Yes; you could have a faster machine with less, but that makes the hardware more capable, which means the stupid compilers get blamed, then.
<White_Flame>
no-defun-allowed: cons, funcall, and apply weren't opcodes on symbolics
<no-defun-allowed>
The more you know.
<White_Flame>
(at least not on ivory)
<p_l>
White_Flame: "call" was
<verisimilitude>
A call instruction in various forms is in basically anything that isn't a hardcore RISC.
<p_l>
RISC is a very bad name that is mostly PR rather than actual description
<White_Flame>
and for comparison, 390k transistors according to wikipedia
<p_l>
"load-store" tends to be more useful
<White_Flame>
(ivory processor)
<verisimilitude>
Well, it was made for UNIX and C, so that makes sense, p_l.
<p_l>
verisimilitude: interestingly enough, some RISC designs weren't
<verisimilitude>
I meant the name and general idea, but sure.
<verisimilitude>
AT&T's HOBBIT comes to mind as one.
<verisimilitude>
I wouldn't count Alan Turing's ACE as RISC.
<p_l>
And a bunch of PLT papers essentially argued for RISC for higher order languages, because it essentially provided custom microcode for every application
<White_Flame>
either "load store" or "static pipeline" might fit
<White_Flame>
depending on the various design priorities
<p_l>
C doesn't really fit modern CPUs at all, which is why the spec is composed heavily of "X is undefined behaviour"
<jasom>
p_l: it didn't fit older CPUs either, hence the same.
<verisimilitude>
The only old CPU it fit well was that of the PDP-11.
<p_l>
Yes
<p_l>
It has certain assumptions btw which made it really bad for RISC, though, with RISC designs being usually word instead of byte oriented
<p_l>
And C gets broken if you can't address memory in sizeof(char) chunks
<gilberth>
The fun detail is, that B was word oriented.
<gilberth>
And 'char' was a function.
<gilberth>
To extract a six bit character from an 18 bit word.
nalkri has quit [Ping timeout: 272 seconds]
<p_l>
Well, what C's founding fathers knew and did and what mainstream C evolved into are two different things ;-)
shka_ has quit [Ping timeout: 245 seconds]
<pjb>
I don't think the creators of C every said: use C to write your applications.
<jackdaniel>
wow, I've dropped for 30m and it seems CL lost its Lisp on the channel ;)
<pjb>
Very early, all unix systems were sold with both a C and a Fortran compiler. POSIX standardizes both.
actuallybatman has joined #lisp
<pjb>
Now, perhaps the question to ask is about the syscalls and the data types (or lack thereof) used by the syscalls. But I note that basically, all the original syscalls only used simple int parameters and pointers to byte buffers. So rather language agnostic really. Later it degraded…
<jasom>
jackdaniel: yeah, my talk about *random-state* devolved into undefined behavior which devolved into C...
<p_l>
pjb: if not a proper F77, then an f2c program
<pjb>
So, nowadays python.
<p_l>
Ugh
<p_l>
Out of various "modern" languages I think I've got it worst for python from system engineering and internals side
Arcaelyx has joined #lisp
bhyde has joined #lisp
gxt has quit [Remote host closed the connection]
gxt has joined #lisp
ym555 has quit [Ping timeout: 245 seconds]
<Younder>
I like pthon, pseudocod thatb worked. Beats C, as it is less typing.
<Younder>
I like python, pseudo-code that works. Beats C, as it is less typing.
ym555 has joined #lisp
<p_l>
Younder: well, python the language is less offensive than CPython the de-facto standard
<p_l>
And I have trauma of cpu bound python code
<White_Flame>
bjorkintosh: that's a great video, bookmarked for reference
<pjb>
Younder: the misled pseudo-code.
<pjb>
Younder: haskell's better at pseudo-coding stuff…
<Younder>
White_Flame, 1987, that was the year I started studying computer science.
hiroaki has quit [Ping timeout: 245 seconds]
<Younder>
pjb I mostly write in Mathematica these days. Anyhow the type-system in Haskell gives me a headache so I couldn't use it for pseudo-code.