freenode/#lisp - IRC Chatlog
Search
1:24:17
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.
2:34:28
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
2:36:02
didi
I was reading a paper by Constanza et al about hygienic macros in Common Lisp. Interesting stuff.
3:11:23
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.
3:12:50
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!
3:13:19
pjb
And what's more, there's basically no MTU: you can seven send bigger packets without splitting them in little packets!
3:14:36
pjb
Not really. You just write your address on the back if you want to receive an answer. That's it.
3:15:36
pjb
Now the maximum ping time can count in tens of years, but it's usually around 3 or 4 days.
3:16:45
pjb
You can even use drawing as addresses: https://qz.com/770819/this-hand-drawn-map-got-a-postcard-delivered-to-a-remote-farm-in-iceland/
3:18:22
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."
3:19:29
gilberth
didi: I was kind of citing Tanenbaum. I assumed everybody around here knew that quote.
3:20:36
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).
3:24:15
pjb
Notice the coverage: https://en.wikipedia.org/wiki/Universal_Postal_Union#/media/File:Universal_Postal_Union_membership.png
3:33:07
gilberth
Heh, my first access to e-mail was by UUCP, where ping times of a few days were common.
3:49:25
pjb
gilberth: perhaps there's already a RFC defining a gateway between the UTU postal network and the TCP/IP Internet network?
3:52:20
aeth
gilberth: Ping times of a few days? Sounds like IPoAC to me... actually IPoAC is faster than that. Really, only a few hours.
3:52:25
pjb
https://www.servicepostal.com/envoyer-lettre-en-ligne/preparer-courrier?gclid=CjwKCAjw1dzkBRBWEiwAROVDLEUdNCXDFCQk4fdoGYv0Y9d0RtrMMogAa4jvqH1CteRZDKn38Rct6hoCwsgQAvD_BwE
3:52:50
gilberth
We had something like this here once, but it was not successful. Actually I like the idea.
3:56:15
gilberth
I becomes silly, when two gateways talk to each other though. Why not send e-mail in the first place? :-)
3:58:38
gilberth
But then it is not that silly. Suppose you want to connect Mars to the internet. You better want a huge MTU.
4:05:20
gilberth
Actually, I believe the UUCP protocol would be a better fit for bringing Mars online. :)
4:09:07
no-defun-allowed
all i know is that IPFS is the only protocol to advertise itself as other-world compatible
4:09:27
pjb
https://web.archive.org/web/20110724054139/http://www.ipnsig.org/reports/IAF-Oct-2002.pdf
4:12:03
gilberth
pjb: UUCP was fun though as I had an e-mail address in something like 1991 or so as a pupil.
4:16:05
pjb
Well, we still were very happy when we got pure IP connectivity and we could do ftp directly :-)
4:25:25
rdap
and problem 2 is solved, making some use of earlier feedback: https://pastebin.com/Lx8GKFVq
7:04:45
gilberth
In the last clause: When I the number was divisible by say 5 can it still be divisible by 3?
7:07:00
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:
7:09:32
gilberth
rdap: About the FACTOR function. IMHO it is a strange mixture of iteration and recursion.
7:12:05
loke
gilberth: It should be possible to write a method combination that selects the method based ont he divisibility, no?
7:12:32
rdap
Ah okay, the mention of 3 and 5 made me wonder if you were commenting on my solution to problem 1.
7:14:10
fiddlerwoaroof
loke: method combinations like that get into a weird interpretive place of the standard
7:14:15
loke
yes. but also with combinator APPEND, that way both fizz and buzz gets printed for arguments divisble by both5 and 3
7:14:51
gilberth
And then we need a list-of-string-concanator-singelton-class. And a protocol for that.
7:14:51
rdap
gilberth: I lifted FACTOR from here: https://rosettacode.org/wiki/Prime_decomposition#Common_Lisp
7:19:10
gilberth
rdap: Ouch. Who wrote all that code. One implementation is worse than the other, IMHO.
7:24:59
fiddlerwoaroof
gilberth: that's a common issue on that site. I mostly go there just to see what a longish piece of code in a language looks like
7:26:33
gilberth
rdap: Somebody else would pick a pure iterative version. It is a bit a matter of taste.
7:28:14
fiddlerwoaroof
If you want to avoid blowing the stack, you can simulate tail-recursion with a tagbody too.
7:28:41
fiddlerwoaroof
you just replace the recursive call with a PSETF of the arguments and a (go start)
7:29:42
fiddlerwoaroof
Well, it's more the opposite :) I knew how TCO worked, so I manually do it on occasion
7:30:05
gilberth
rdap: Start with (defun factor (n) (factor-aux n 2 (isqrt n))) (defun factor-aux (n d d-max) ...) Rest is up to you.
7:32:13
rdap
It's probably going to take a lot more reading, but thank you.. I'll see if I can make that work.
7:38:00
rdap
Thanks, I'll try to remember that, because I'm still stumped on where you're getting 3 and 5 from that
7:38:40
gilberth
Or: Would you try to divide by numbers from d-max down to 2, you would not get prime numbers.
7:45:14
Grue`
minion: memo for didi: then you won't be able to redefine square without recompiling macro and everything that uses this macro
7:47:43
Grue`
rdap: read up on Sieve of Eratosthenes, like half of project Euler problems require using it in one form or another
8:32:34
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.
8:34:10
flip214
Xof said he'll release SBCL 1.5.1 on Sunday from Genova, so he should be somewhere around there too
8:35:41
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.
8:36:08
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
8:39:00
flip214
phoe: how about 09:30 at 44.416306, 8.931091 as a first-order approximation, with ideas to be discussed there?
9:38:46
pyc
Do you use Lisp in production? I am mostly a Python programmer and I am thinking if I should learn Lisp.
9:39:14
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.
9:48:28
ecraven
me, it's mostly different Schemes. people definitely use clojure. so pick one ;) [probably CL, in #lisp ;)]
9:51:24
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
9:53:49
rdap
the last time i spent some time with lisp, i was able to come back to C and see an improvement
9:54:20
fiddlerwoaroof
pyc: I've written lots of useful software in Common Lisp but it's mostly tools for personal use, not for work
10:32:11
pyc
ecraven: jackdaniel: What kind of applications do you write in production with Common Lisp?
10:32:48
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)
10:33:32
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.
10:36:00
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.
10:36:58
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.
10:38:30
akssri
aeth: SBCL can produce numerical code that is roughly within 30% of C-code without SSE/AVX optimizations.
10:39:18
aeth
akssri: yes, and I'm guessing it's the "without SSE/AVX optimizations" that probably makes it "300%" instead of "130%"
10:41:21
schweers
aeth: you can get /really/ bad behaviour with (safety 0). Segfaulting on a function called with the wrong number of arguments, for instance.
10:43:03
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.
10:47:41
schweers
Anyway, SBCL has impressive performance even without type annotations given something like (optimize (speed 3) (space 3) (safety 1))
10:49:36
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.
10:49:52
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
10:49:52
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)
10:53:41
akssri
btw has anyone here used AVX/SSE intrinsics with SBCL ? I'm not sure how to make SBCL emit movapx with simple-arrays.
11:11:58
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)
11:12:27
makomo
not sure if you had anything in plan for that afternoon, but if you did, it'd be cool to meet up :-)
11:12:30
flip214
aeth: install a reader macro that allows to use [], {}, «» etc. instead of only (), that helps
11:13:14
flip214
makomo: don't know about the afternoon. Sunday 10:00 a few people will be at the ELS location.
11:14:27
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
12:02:33
phoe
so it seems there will be a meetup on Sunday at the ELS venue at 10:00 - and we'll travel from there
12:17:52
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
12:19:44
flip214
phoe: "travel" as in "talk a walk" (so no notebooks) or as in "to the next wifi for lisp hacking"?