freenode/#lisp - IRC Chatlog
Search
13:41:25
boeg
beach: yes but isnt is saved as a slot value anyways? Anyways, its just a list i found out
13:43:00
beach
Yes, it is stored as a slot when it is a class or a generic function for instance, or a slot too as I recall.
13:55:03
_death
no-defun-allowed: still it might just be low-hanging fruit to get it to compile faster.. e.g., during compilation I C-c C-c'd and it was at some pushnew form to component-reanalyze-functionals, which is a set represented as a list.. it was used in few places so I replaced it with a hash table (sbcl likely has a better representation for sets) .. this shaved a few seconds from compilation
14:00:04
kenu
I've got a problem with postmodern's insert-dao, I've got (setq s-sql:*escape-sql-names-p* :literal), but then there is following error on inserting a record Database error 42703: column "updatedat" of relation "actions" does not exist
14:00:04
kenu
QUERY: INSERT INTO "actions" ("updatedat", "createdat", "actiontype", "referer", "visitorip", "productid", "visitorid", "shopuserid", "userid") VALUES ("$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9") RETURNING "shoptransactionid", "actionid"
14:01:48
kenu
it doesn't but the actual question is how do I ahndle cammelCase column names with dao
14:18:09
kenu
QUERY: INSERT INTO "actions" ("updatedAt", "createdAt", "actionType", "referer", "visitorIp", "productId", "visitorId", "shopUserId", "userId") VALUES ("$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9") RETURNING "shopTransactionId", "actionId"
14:43:25
dlowe
and also if you want to store input code to be executed later, you're much better off wrapping it in a function and storing the result of CL:COMPILE to call later
14:43:26
jackdaniel
if you put (+ 2 3) in your source code it will be evaluated unless explicitly quoted
14:43:55
beach
chimneys: This is the place where we typically ask "What is it that you *really* want to do?"
14:44:55
chimneys
jupyter notebooks %%writefile file.cl \n code.. shift+enter to get new cell then !clisp file.cl
14:45:03
pfdietz
(and I say that as someone who does use it on occasion, but only when it's appropriate)
14:51:16
jackdaniel
I feel bad about it, otoh he didn't lose anything, just like with priate copies of software ,)
14:53:11
jdz
And I'd expect there to be a slot and class options to provide case-sensitive names for columns and table name.
15:02:57
jmercouris
since declaim is implementation dependent, is it possibly that it could signal a condition in some implementations?
15:03:48
jmercouris
should declaim therefore be avoided in implementation independent code as it may cause issues?
15:04:20
Bike
if you use declaim/proclaim with a valid declaration specifier it shouldn't signal an error.
15:04:59
Bike
proclaim is not particularly different from any function in the standard in terms of when it signals
15:05:07
Odin-
In that case you shouldn't do anything, because you can't be sure the implementation actually implements the standard.
15:06:29
Odin-
If it does cause any kind of issue, that would be an implementation bug, not a bug in your code.
15:06:52
_death
indeed.. and if you use nonstandard declarations, you may be able to use (declaim (declaration ...)) to tell other implementations to not warn
15:10:08
Bike
I mean if you have a reason to think declaim is especially dangerous I'd like to hear it
15:20:02
pfdietz
The problem was to turn off inlining in a package. I did that by (conditionally) shadowing the symbol INLINE, then declaring the new symbol to be a declaration (which is then ignored).
15:21:29
pfdietz
Sneaky is when I write a macroexpand hook to automatically add the shadowing to a defpackage form at macroexpansion time.
15:38:18
Colleen
Unknown command. Possible matches: 8, set, say, mop, get, time, tell, roll, help, deny,
15:54:06
pjb
Bike: declaim forms are data for the CL compilers, and for any tool that will take the source as input. Therefore it is as dangerous as any data. (declaim (launch-missile :type supersonic :target-coordinate (find-current-coordinate 'Bike))) if you happen to process this source with a program that is connected to the Russian missile network, you're toast…
15:55:52
pjb
jmercouris: the only thing of declaim and proclaim, is that they may mutate some global state. For example, the optimization levels. And there is no introspection of the declared (or declaimed) declarations! Therefore it is bad to use proclaim or declaim as toplevel forms in libraries!
15:56:41
Demosthenex
is there a cl lib for pgp or gpg? i was discussing doing a POC password repo and that came up. my google-fu can't seem to find a straight answer
15:57:01
pjb
jmercouris: you can instead write and export a function that will call proclaim to declare the things like you'd want them, and let the user call it. Of course, if you want to declaim stuff for compilation time, the user will have to load this function before compiling your library which can be difficult if this function is in your library…
15:58:27
Xach
Demosthenex: the primitives are implemented in ironclad, but not drawn together in the overall format.
15:58:33
Demosthenex
pjb: i was reading that, it's a cl native crypto lib, but it also said limited support for public key crypto
15:59:43
Xach
i have implemented protocol-compliant signature verification but i am not interested in implementating encryption/decryption
16:01:26
pjb
jmercouris: what I do, is write a separate, "tool" library, and instruct to load it first, use it to configure things, and then compile and load the target library.
16:05:43
HiRE
Is there a nice way to expland a number into a list of bytes? For example, if I want a 4 byte representation of 13 in hex, I would get (#x00 #x00 #x00 #x0D)
16:17:24
pjb
(loop with n = (random (expt 2 64)) for pos from 0 to 56 by 8 collect (ldb (byte 8 pos) n)) #| --> (205 7 220 165 176 97 6 156) |#
17:36:23
pjb
chimneys: I once considered merging flightgear with ecl, to be able to script it in CL…
17:36:24
beach
chimneys: Common Lisp can generate code with performance comparable to that generated by a C compiler.
17:37:01
beach
chimneys: Furthermore, as I often point out, given the manual memory management of C++, it is impossible to write a C++ program that is both fast and modular.
17:37:38
pjb
chimneys: it shouldn't be too hard to do: first compile flightgear as a library. Then link it with libecl in a single executable. Then add the flightgear API to lisp. Since it's already scriptable in lua IIRC, it shouldn't be too hard.
17:38:30
Xach
beach: on the other hand, games remind me of movie sets a little bit. they are not built to last or to be extensible, but to provide an entertaining brief impression and then be discarded. as long as they are captured once under the right conditions it is ok.
17:38:32
pjb
chimneys: now, IIRC flightgear uses C++, so it may be more indicated to use clasp (an ecl derivative optimized for C++ interaction), but clasp didn't exist at the time.
17:38:55
Xach
Many unacceptable shortcuts in building a place to live are acceptable in other contexts.
17:39:26
pjb
Not all games are games. Realistic simulators like flightgear are in a different category, and used not as games, but as training or study tools amongst other uses.
17:39:30
beach
Xach: I believe you. But the maintenance nightmare must be a problem during development as well, I would imagine.
17:39:54
pjb
For example, you could hook the worldwide flight data into flightgear and see real traffic.
17:40:23
pjb
Pleasantness is reduced by the capitalistic constraints on commercial game development…
17:40:57
Xach
but the upside is you can pretend you are interacting with a space ship, and we can't really make space ships that millions can try yet, so
17:43:41
_death
Xach: this is true, but in recent years some companies put a lot of effort in maintenance of existing games, especially if they have an "online community"
17:47:27
Xach
anyway, it makes me think about how many entertaining illusions are created by unsustainable practices and the magic is from a) not knowing that there's a trick involved or b) not knowing how the trick works or c) not believing that anyone would go to the lengths to make it work
17:49:18
chimneys
lisp is 4 times slower than java and C++ I checked on those benchmarks,so if your desktop is 4 times faster then lisp performance shouldn't matter
17:50:40
beach
chimneys: Most often, the comparison does not involve programs with the same semantics in the different languages involved.
17:52:04
chimneys
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/sbcl-gpp.html no i believe those benchmarks
17:57:08
_death
when use of (say) _mm_mul_pd is consider valid, the programming language doesn't matter much
18:06:15
HiRE
I think beach hit the nail on the head. You can't be both fast and modular. It's one of those attribute triangle problems.
18:08:13
HiRE
chimneys is missing the GC optimization route. Benchmarks aren't perfect. Lisp is highly compiler dependent.
18:08:43
HiRE
I mean they power space shuttles with it so it's can't be that bad for real time/near real time work
18:09:12
HiRE
I think chimneys is vastly overestimating how optimized games actually are...last one I downloaded was 50GB and ran like garbage...
18:11:23
HiRE
(you could argue real time doesn't imply fast but rather consistent...but you see my point)
18:13:04
pjb
HiRE: it depends. Modularity is in the source. We have compiler to mix and merge and optimize and remove generality.
18:13:56
Xach
The answer to "Can I do X with Lisp?" is always yes, but the question of "Will it be as easy to do X in Lisp as it is in SomeOtherLanguage?" is usually "it depends a lot on X and SomeOtherLanguage"
18:14:12
pjb
eg. if a global analysis of your lisp program demonstrates that 1- the program never evaluates input (ie. it doesn't change at run-time), 2- at a call point, the arguments to a generic function are always of the same class, then it can hardwire the method called without computing anything.
18:15:07
HiRE
yeah. To Xach's point the magic of turing completeness makes "can I do X in Y" vacuously true.
18:15:26
HiRE
Some languages have features that enable better developer interop, nicer structures to help think about things, etc.
18:18:19
chimneys
but still you yourself admitted C isn't faster than a factor of 10 that a good CL code, and processor capacity doubles every year so 2**3 = 8, so the hardware is lagging by only 3 years, and therefore the game too.
18:19:15
chimneys
infact they said numerous times on numerous sites CL generates C-like optimized code
18:20:47
_death
high performance code is never vanilla C, so no need to expect it to be vanilla Lisp either
18:22:31
HiRE
It's getting off topic but I'll leave it at this and clear channel. C++ is likely popular because of the extensive amount of libraries, bandwagoning, and developer interop.
18:33:21
chimneys
I did android phone benchmarks and found 200Mflops desktop 200Gflop , and laptop 50gflops
18:34:05
chimneys
so the phone is thousand times slower, so the factor is 10 shouldn't even matter , even if it's 20, 2**4 = 16 , so you just lag by only 4 years?
18:36:27
chimneys
also companies can save lots of money too, as it's less headache, for example google used Java and lost billion dollar lawsuit to oracle upon copyrights of Java in android
20:05:59
HiRE
are we able to post code here for review? I have some stuff I'm working on and in a few days I'd like experienced eyes to rip it apart and make me cry.
20:27:37
Xach
HiRE: it can be tough sorting out good feedback from bad. it gets easier with practice.
21:02:24
Shinmera
HiRE: there's a new, very fast deflate/zip compressor by |3b|: https://github.com/3b/3bz
0:42:58
smokeink
what is this used for ? https://github.com/sbcl/sbcl/blob/master/src/code/target-package.lisp#L739
0:49:33
smokeink
ok I'll takke a look at that paper. ANy idea why does swank need to handler-bind it?
1:05:31
asarch
If I have this timestamp with time zone enabled in a PostgreSQL record which corresponds to 2020-01-17 12:24:44.809571-06 why (let ((fecha (make-instance 'simple-date:timestamp :days 3788274284 :ms 3788274284))) (simple-date:decode-timestamp fecha)) gives other results: 10373942 11 15 1052 17 54 284
1:12:56
npfaro
I can spawn processes fine with uiop:launch-program, but uiop:terminate-process just doesn't work
1:13:08
asarch
Ok, let's try another angle: how could I convert this 3788274284 (the value stored in the PostgreSQL cluster) into this 2020-01-17 12:24:44.809571-06 using Postmodern?
1:14:16
npfaro
Ok actually it seems like it's working with :urgent t now.... but why doesn't it without