Search
Thursday, 28th of May 2020, 21:33:10 UTC
21:35:32
seok
Can I specify utf-8 encoding with with-open-file?
22:27:01
bitmapper
cl-permutation doesn't load in CCL
22:54:35
Lord_of_Life_
** NICK Lord_of_Life
0:39:32
ldb
bitmapper: it's simple, the author just doesn't know that CCL won't eval defstruct at compile time.
3:13:03
beach
Good morning everyone!
3:19:37
ArthurStrong
beach: good morning
7:01:32
seok
Hey guys, does this look like a db that is bottlenecking? https://ibb.co/kSvfXM7
7:03:41
phoe
I see no parentheses in that screenshot, I don't think I can help
7:04:12
seok
well, I am calling from lisp
7:04:40
seok
spreading the task using bt didn't improve performance by any, so I'm wondering if it is the db
7:04:55
seok
which I doubt, not doing that many reads
7:07:46
no-defun-allowed
Maybe, that's a lot of TPS.
7:08:33
phoe
transactions per second
7:09:33
seok
no-defun-allowed thanks! I don't have much experience with big tps to for comparison
7:10:29
no-defun-allowed
Can you look at how fast it writes to disk, and how that compares to how fast you think your disk can be written to?
7:11:02
seok
Yeah, it could be the hd now you mention it
7:11:08
seok
Since I'm writing the output to file too
7:11:44
no-defun-allowed
On my system, I can have the activity monitor program show me how much each process writes and reads.
7:13:28
seok
https://ibb.co/MkWsXcv nope don't see much disc usage
7:13:39
no-defun-allowed
I would watch that while having my program do its doings, and compare that to how fast the disk can be written to (which is around 100MB/s for a mechanical drive and more than 1000MB/s for a good solid state drive).
7:15:39
no-defun-allowed
How long does each burst of transactions last?
7:16:13
seok
Not sure by exact, but the program is spewing out 3.5mb file per second
7:17:04
no-defun-allowed
That graph could be smoothing it all out, I'm not sure.
7:17:34
seok
maybe if I have 2 processes it will smooth out
7:18:51
seok
ok, the graph does go up with 3
7:19:04
seok
hm, guess it is a bit faster
7:21:30
seok
Nevermind, it is a bit better with bt
8:10:57
kapil_
i am totally new to lisp.
8:11:34
kapil_
is lisp is good language to learn to learn functional programming?
8:14:38
beach
kapil_: There are better languages is you want to do purely functional programming.
8:14:53
beach
kapil_: Common Lisp is a multi-paradigm language.
8:15:03
beach
It does support functional programming is one of the paradigms.
8:15:22
beach
But it also has the best object-oriented subsystem around.
8:16:01
kapil_
i only want to learn functional programming
8:16:35
beach
You are probably better off with something like Haskell then, or maybe Clojure.
8:16:48
kapil_
is Practical Common Lisp book is still valid today?
8:17:01
beach
Yes, the language hasn't changed.
8:17:18
beach
The tools have, so when you get ready, ask here for the latest tools.
8:17:53
beach
One of the strengths of Common Lisp is that it has an international standard that is stable.
8:18:03
kapil_
i download and installed https://portacle.github.io/
8:18:23
kapil_
is it all i need to learn and use common lisp?
8:18:34
beach
And the literature, yes.
8:19:34
kapil_
in how many days i can learn common lisp?
8:20:05
beach
As with anything, count 10 years to be a master. But you can learn the basics in a week or two if you work hard on it.
8:20:37
beach
A warning: If C++ is what you are used to, you will have some "aha" moments, and when you understand what is going on, you won't want to go back.
8:21:08
ldb
^ agree from my observation
8:21:10
kapil_
oh thanks a lot. you motivated me to learn now
8:21:30
beach
So if, say, your livelihood depends on developing C++ code, you will no longer be happy at work. :)
8:22:22
kapil_
i have currently a c++ back end web server. i want to use common lisp . if it is easy
8:22:54
kapil_
beach, why its so cool then c++?
8:23:31
beach
Oh, I don't even know where to begin. Let's see if I can find the URL...
8:24:58
beach
random-state.net/features-of-common-lisp.html
8:25:38
phoe
beach: fun fact: there is a proposal to introduce metaclasses to C++
8:25:55
beach
Why am I not surprised.
8:26:29
beach
But they won't get there ultimately anyway, until they abandon manual memory management and that crazy syntax.
8:26:59
pjb
phoe: you mean beyound OpenC++? https://www.informatimago.com/articles/life-saver.html
8:27:36
pjb
Anyways, there's no point in tracking languages that asymptotically tend toward lisp.
8:33:09
beach
kapil_: Feel free to ask questions if there is something in that document that you do not understand.
8:33:44
beach
It was initially written by me, but then Abhishek Reddy improved it vastly.
8:40:04
Guest2239
Isn't (= (min 0d0 (/ 0d0 0d0)) (min (/ 0d0 0d0) 0d0)) supposed to return t?
8:40:54
beach
You can't divide by 0.
8:40:56
phoe
that's a division by zero for you
8:41:00
Guest2239
it's weird that nan is handled asymmetrically
8:41:46
Guest2239
use (sb-int:set-floating-point-modes :traps nil) in SBCL, for example
8:42:27
beach
There are no NaNs in the standard, so the behavior is implementation specific.
8:42:52
phoe
(float-features:with-float-traps-masked (:invalid) (list (min 0d0 (/ 0d0 0d0)) (min (/ 0d0 0d0) 0d0))) ;=> (#<DOUBLE-FLOAT quiet NaN> 0.0d0)
8:43:21
phoe
I know what is happening
8:43:27
phoe
you cannot compare NaNs using <
8:44:13
phoe
(float-features:with-float-traps-masked (:invalid) (list (> 0d0 (/ 0d0 0d0)) (= 0d0 (/ 0d0 0d0)) (< 0d0 (/ 0d0 0d0)))) ;=> (NIL NIL NIL)
8:44:16
Guest2239
actually, I was wrong because the original = should return nil because nan != nan
8:44:19
phoe
that is what confuses MIN
8:44:42
Guest2239
but nevertheless, (min nan 0d0) should return nan irrespective of the arrgument order
8:45:39
phoe
NaN < 0d0 is false, so obviously NaN is smaller
8:45:51
phoe
at the same time, NaN > 0d0 is false, so obviously NaN is larger
8:46:00
Guest2239
because that makes way more sense mathematically, and if one needs less consistence then should use a low level primitive
8:46:11
phoe
NaN makes *no* sense mathematically
8:46:19
Shinmera
How does "not a number" make any mathematical sense
8:46:24
no-defun-allowed
I don't remember NaN from any of my maths classes.
8:46:46
phoe
if you have NaNs compared to numbers, you've already screwed up, and no amount of lacquer on top of that will fix that
8:47:21
ldb
try import floating point theory from sat solver
8:47:30
phoe
orders like #'< are only defined for real numbers, and NaN is, well, not a number. garbage in, garbage out.
8:48:29
Guest2239
this reasoning makes * / + - handling nan-s the way they do completely useless
8:48:53
Guest2239
I'm not talking about < <= etc but min, max specifically
8:48:59
Guest2239
I don't care how it's implemented
8:49:07
phoe
let's see where IEEE 754 mentions minimum and maximum operations
8:49:11
Guest2239
whether it's < or anything else inside
8:49:18
Shinmera
well you must, because it's implementation specific
8:49:34
Guest2239
I'm not talking about the standard
8:50:45
phoe
https://2pi.dk/2016/05/ieee-min-max
8:51:24
phoe
"IEEE however, treats NaN as a missing value for the purpose of the minNum and maxNum functions. They will suppress a single NaN operand and return the number instead."
8:53:10
Guest2239
so it either supposed to return the other number independently of the argument order or nan
8:55:34
phoe
a naïve implementation of the algorithm there is (defun float< (x y) (cond ((> x y) x) ((< x y) x) ((= x y) x) ((float-features:float-nan-p x) y) ((float-features:float-nan-p y) x) (t x)))
8:58:54
phoe
but then again, it's up to the implementations to say whether they support ieee754-2008 float comparison
8:59:09
phoe
so if you're e.g. using SBCL, you should ask on #sbcl mayhaps
Friday, 29th of May 2020, 9:33:10 UTC