Search
Tuesday, 21st of March 2017, 15:07:32 UTC
15:07:40
pebblexe
this is what I have so far: http://paste.lisp.org/display/342001
15:07:55
pebblexe
I've been working on this for days and I have so little to show for it
15:08:16
loke___
pebblexe: What is it you are trying to do?
15:08:52
pebblexe
loke___: make match a nice easy looking version of the function I am trying to write
15:09:06
loke___
pebblexe: sure, but what do you want the function to do?
15:09:27
pebblexe
I want it to be a shorter version of pack/pack-int
15:09:51
loke___
pebblexe: I don' t know what pack-int is supposed to do.
15:10:26
pebblexe
loke___: I am trying to port msgpack to cl, so this is a serialization/deserialization library
15:10:46
pebblexe
I am really trying to port this: https://github.com/edma2/clojure-msgpack/blob/master/src/msgpack/core.clj
15:11:08
axion
pebblexe: There is conspack already, which is superior
15:11:20
Xach
pebblexe: as a learning exercise?
15:11:25
flip214
pebblexe: https://github.com/mbrezu/cl-messagepack
15:11:31
flip214
pebblexe: https://github.com/mbrezu/cl-messagepack
15:11:34
axion
pebblexe: https://github.com/conspack/cl-conspack
15:11:53
flip214
sorry, https://github.com/adolenc/cl-messagepack-rpc
15:12:01
pebblexe
I just checked cliki and didn't see it
15:12:05
flip214
even in QL already, IIRC
15:12:25
flip214
pebblexe: protip for next time: (ql:system-apropos "pack")
15:12:30
flip214
or similar search strings ;)
15:13:32
flip214
axion: is conspack supported by other languages as well?
15:14:03
flip214
uh, yeah. there had to be a problem with it ;/
15:14:24
axion
it is oGMo's invention. Very fast and useful library nonetheless
15:14:39
flip214
so for an API msgpack is still much easier to use. thanks for the link, though; perhaps I'll use it in some project.
15:16:56
didi
ACTION feels the urge of using SXHASH to total order EQUAL objects
15:17:20
ogamita
didi: two equal objects can have the same SXHASH…
15:17:29
ogamita
while they're EQL-different.
15:17:49
ogamita
(mapcar 'sxhash (list (list 'a) (list 'a))) #| --> (78287 78287) |#
15:18:08
didi
I think I am fine with it.
15:18:21
ogamita
(mapcar 'sxhash (list (list 'a) (list 'b))) #| --> (78287 78288) |#
15:18:23
flip214
didi: how about (sb-kernel:get-lisp-obj-address X) ?
15:18:24
shka
ogamita: first of, sxhash may or may not return reasonable value for lists
15:18:26
jackdaniel
sxhash always returns same value for vectors on some implementations
15:18:44
jackdaniel
it's not said that hashtable uses sxhash internally
15:18:57
flip214
not sure whether that is constant, ie. whether a GC will change the values, though.
15:19:27
shka
didi: check serapeum ordering function
15:19:41
shka
you need something like that
15:20:20
shka
it returns function that can be used to compare objects and perform topological sort
15:20:47
shka
but don't assume that sxhash is usefull for your use case
15:21:05
shka
as jackdaniel pointed out it may return same value on vectors
15:21:14
shka
in fact, it does that in sbcl
15:21:25
axion
ogamita: I apologize. I thought I was in the #lispgames channel. I can see how you didn't have enough context now as you haven't been there in over a year.
15:21:44
shka
i'm not even sure that it must work on lists
15:22:13
shka
ideally, supply your own hash function
15:22:42
ogamita
axion: hopefully, I should be resuming writing games in lisp within a year. :-)
15:49:48
didi
Heh, this "serapeum" looks like my own collection of functions. I think every CL programmer might have one such companion.
15:54:40
Xach
i have ten or fifteen that i have to track
15:58:45
ogamita
didi: alexandria, cesarum, serapeum, clocc, etc.
16:00:08
White__Flame
our "simple-utils" is quite large :)
16:00:58
White__Flame
is it time to flood quicklisp with "leftpad" systems? ;)
16:02:22
ogamita
Eventually I will set up a git repo with world-writeable access rights.
16:04:31
didi
A global hash of functions? Some dream about it.
16:06:46
loke___
clearly we need an IsArray librrary
16:07:00
ogamita
(defun is-array (x) (typep x 'array))
16:07:13
loke___
ogamita: No no. We need a QL system for that.
16:07:36
loke___
https://www.npmjs.com/package/isarray
16:07:37
jackdaniel
so we can do: (ql:quickload 'is-array)
16:07:42
jackdaniel
(is-array:is-array array)
16:08:00
White__Flame
yes, moar left-pad
16:08:03
ogamita
or: (is-array:p array) ?
16:08:08
White__Flame
then somebody can unpublish it
16:08:29
White__Flame
and hail the 2nd AI winter
16:08:30
loke___
And in line with the JS implementation (here: https://www.npmjs.com/package/isarray), the CL implementation should be:
16:09:06
loke___
(defun is-array (a) (search "ARRAY" (format nil "~s" (type-of a))))
16:14:00
ogamita
(deftype RadarRayDesignator () `(or symbol radar-ray))
16:15:00
didi
Ah, cool. SLIME has a ,test-system
16:18:00
malice`
we already have trivial-left-pad: https://gitlab.com/mbabich/trivial-left-pad
17:03:20
_death
the initial commit is 2016-03-24.. I'd have expected 2016-04-01
17:27:22
Xof
is anyone here going to ELS?
17:29:19
jackdaniel
afair also beach, Bike, phoe and antoszka on this channel
17:29:25
Xof
any recommendations for places to stay?
17:30:25
antoszka
Xof: Jam Hotel – at least 6 or 7 lispers already declared staying there.
17:32:01
antoszka
I booked a bed in a dorm, it was crazy cheap, but I suppose „normal” rooms are available as well.
17:33:09
varjag
i'm in a something something palace at the central square
17:33:32
varjag
the conference site has recommendations list
17:34:32
attila_lendvai
antoszka: which dorm? in case I make a last minute decision... I'm considering
17:37:55
Xof
I should have booked before brexit :-/
17:39:50
beach
Xof: Do you have a paper to present?
17:41:00
Xof
I haven't been following anything about ELS this year. Is there a social activity on the Sunday evening?
17:41:16
beach
Nothing is planned as far as I can tell.
17:41:25
beach
But we can plan one if you like.
17:42:46
jackdaniel
if anything is planned, I'd vote for time after or during ELS, many people arrive at Sunday
17:43:17
beach
They are not mutually exclusive. :)
17:44:46
antoszka
attila_lendvai: I've no idea which dormitory it is… Just clicked the cheapest one on booking.com
17:45:13
antoszka
attila_lendvai: feel free to ask the hotel staff about my reservation under the name of 'Antoni Grzymala'
17:53:27
antoszka
attila_lendvai: i looked at the reservation e-mail and all it says is just 'dormitory'.
18:03:53
attila_lendvai
antoszka: thanks
18:34:10
mood
antoszka: You replied to the elsconf mailing list that you booked at the Jam hotel
18:45:59
mood
Yeah, I'm sorry, I misread the conversation
19:37:46
andrzejku
is lisp a dead language?
19:45:12
jackdaniel
antoszka: nah, it just smells funny ;)
19:45:37
jackdaniel
antoszka: please ignore :)
0:21:39
aeth
Does anyone have any idea why something that would perform around 3% CPU in SBCL and around 6% CPU in CCL would struggle at 100% CPU in ECL? I'm guessing something creates a lot of garbage in an inner loop in ECL but not SBCL and CCL, or at least not as much garbage.
0:26:42
jason_m
aeth: Could you get an idea using (time ...) and comparing the number of bytes consed, time spent in gc? i know ccl and sbcl have those things in their time output. Not sure about ecl.
0:29:07
shrdlu68
Just finished asdfying a project. First time for everything :)
0:37:27
pillton
shrdlu68: I like ASDF. It saves a lot of time.
1:05:55
aeth
jason_m: I used to use time, but in SBCL one can just disassemble a function and look for a commented allocation there.
1:05:58
aeth
I'm not sure about CCL
1:06:20
aeth
(time and a lot of other fancy things)
1:09:21
jason_m
aeth: sounds like a more reliable approach. I haven't played with disassembling yet.
1:09:52
aeth
It's very useful. I'm surprised I discovered it so late.
1:10:49
aeth
If the function is creating something, there should be one (?) thread.alloc-region and it shouldn't be there if the function is merely modifying something
1:12:45
pillton
The statistical profile in SBCL allows you to profile allocations. (sb-sprof:with-profiling (:mode :alloc) ...)
1:13:39
aeth
Yes, that is one of the things I used to use. Statistical means it misses some tiny allocations, though.
1:13:54
aeth
I noticed that after checking ROOM
1:14:09
aeth
Disassembling will miss nothing, unless there's some allocation in SBCL that isn't commented in the disassembly
1:14:37
aeth
I mean, disassembling will miss nothing if I can also read the assembly too :-p
1:15:10
pillton
Well it picked up https://bugs.launchpad.net/sbcl/+bug/1398785.
1:27:11
aeth
bah, there can still be consing when that's not there
1:27:15
aeth
probably a function it calls
1:27:25
krwq
how do you create a metapackage? what I mean is to create a package - when someone does use-package on that he should automatically also use few other packages
1:28:13
krwq
i.e. (use-package :foo) would imply (use-package :foo.a) (use-package :foo.b) ...
1:28:40
Bike
you can't, but you can have foo export symbols from those other packages.
1:28:49
pillton
You can't do it declaratively. You can do it programmatically though.
1:29:19
Bike
...and of course you can define a package that's just there to reexport symbols from a bunch of packages.
1:29:42
krwq
Bike: could you explain the last one?
1:30:21
krwq
which option is the most recommended for defining subpackages?
1:30:33
pillton
The case you specify would be easier if you did (defpackage "FOO.A" (:import-from "FOO" ...)).
1:30:35
krwq
i just want some submodules but i want them in separate packages
1:31:02
krwq
does :import-from imports all symbols?
1:31:07
Bike
you can have a "metapackage" that imports symbols from other package and then exports them. so like uh...
1:31:15
Bike
no, it imports only the symbols you list.
1:31:15
pillton
No. You specify which symbols to import.
1:31:34
krwq
so it would be like (:import-from "FOO" :a :b :c)?
1:32:09
Bike
nah whatever i'm not good with packages anyway
1:32:47
pillton
It would be better if you used strings.
1:33:07
krwq
Bike: is there some easy way to import all? some function or something? I'm not sure if it would be ok to just put some random code under the defpackage
1:33:27
Bike
import all symbols a package exports?
1:33:40
Bike
something with do-external-symbols, yeah. hopefully in a macro
1:34:13
pillton
(defpackage "FOO.A" (:use "FOO"))
1:34:25
Bike
i have no idea how imports work with use
1:34:33
krwq
pillton: is this going to be recursive?
1:34:58
krwq
ok, thank you Bike and pillton!
1:35:00
pillton
I don't understand the question sorry.
1:35:19
krwq
you put the deps reverse so I was wondering if it will blow
1:35:48
pillton
The package FOO.A is in no way related to the package FOO.
1:36:15
pillton
The relationship you see is entirely based on the naming convention.
1:36:22
Bike
you can also (loop for s being the extrnal-symbols of ...)
1:36:48
krwq
Bike: loop supports that?
1:37:40
krwq
so I can just (import (loop for s being the external-symbols of pkg-here collect s))?
1:38:12
krwq
ok, sounds good to me :)
1:47:10
warweasle
XachX: There were some changes to rtg-math which broke some of clinch's examples. The fix is in master, if you want to include them.
2:54:30
krwq
can you use only some symbols from the package?
3:00:08
krwq
can you do i.e.: (use-package-symbol 'cl-ppcre:regex-replace) and then just do (regex-replace ...) but without using all symbols from the package?
3:00:21
l04m33
krwq: you mean :import-from ? http://clhs.lisp.se/Body/m_defpkg.htm
3:00:42
krwq
l04m33: not import-from - that also exports it automatically
3:00:44
Bike
krwq: no, using is a package-level thing.
3:00:50
Bike
import-from does not export it automatically.
3:01:04
krwq
Bike: but it is visible
3:01:17
Bike
in the package. not to a package using the package or anything.
3:04:09
krwq
Bike: so if this is only making it visible in this package then is there a way to also make it visible in the packages using your package?
3:04:41
krwq
Bike: so you do both import-from and then export the same symbol?
3:05:19
krwq
ok, thank you both l04m33 and Bike - i got confused with this completely
Wednesday, 22nd of March 2017, 3:07:32 UTC