Search
Friday, 24th of March 2017, 5:27:18 UTC
5:28:28
phoe
http://franz.com/search/search-ansi-about.lhtml
5:40:04
drmeister
l04m33: Thank you very, very much!
5:40:22
drmeister
shrdlu68: Clasp can do that as well.
5:41:09
drmeister
But it's not quite ready for prime-time.
5:41:31
drmeister
Bike: I have some HIR
5:42:37
jackdaniel
shrdlu68: check out https://common-lisp.net/project/ecl/static/ecldoc/Extensions.html#System-building
5:42:50
drmeister
I gotta figure out how to get it out of the Cloud.
5:47:19
drmeister
https://usercontent.irccloud-cdn.com/file/uB5kqu1b/set-pprint-dispatch-mir0.dot.png
5:49:23
drmeister
I'll have to investigate further why it didn't dump the mir of what we wanted it to dump.
5:49:28
drmeister
I'll try again tomorrow.
5:49:56
Bike
...yeah, that's just setting debug-log-on to nil
5:51:51
drmeister
It's not advancing the file name when it writes out the mir.
5:52:03
drmeister
It writes out several files but they clobber each other.
5:52:35
Bike
ah. so you get the last one, turning off the debugging.
5:55:04
drmeister
I fixed it and started it up again.
5:55:11
drmeister
I'll get it to you tomorrow - it's late here.
5:55:27
drmeister
But it looks like it will work this time. We should get the MIR this time.
8:58:18
ryanwatkins
anybody have any info on lisp to webassembly compiling for future web? :D
9:03:52
flip214
ryanwatkins: perhaps parenscript as intermediate would work?
9:04:56
beach
ryanwatkins: It looks like you might have found yourself a project.
9:07:23
JuanDaugherty
anybody know of a work with shrdlu besides the evident stuff, tsgouros, the resurrection 10 ya, e.g. a port to sbcl
9:08:06
jackdaniel
ryanwatkins: this may be related: https://sourceforge.net/p/sbcl/mailman/message/34821303/
9:09:11
beach
ryanwatkins: You can use the Cleavir compiler framework and define a WebAssembly backend for the intermediate format.
9:56:02
White_Flame
flip214: I don't think parenscript would help. There's no JS-isms in webasm, so converting to JS is a sidetrack
9:57:06
flip214
White_Flame: but javascript can be further "compiled" to webasm, AFAIK
9:57:21
White_Flame
It will be interesting to see if webasm will allow you to specify your own ABIs, multiple environmental stacks, etc, in a way that's sensibly fast. I think that it's also supposed to support GC languages in the future; whether it will offer its own GC or just tools tob uild one, I'm not sure
9:57:24
White_Flame
flip214: I think that's wrong
9:57:56
White_Flame
unless things are very new in the few months since I looked at it last
9:58:15
axion
webasm does not yet support garbage collection
9:58:47
White_Flame
you could always build your own, though
10:01:28
flip214
well, perhaps SBCL could get a new backend for webasm...
10:01:56
flip214
I guess that llvm will, so drmeister's clasp should be fine with that.
10:04:37
White_Flame
webasm also might not allow JIT compilation in the initial versions, either
10:05:14
White_Flame
(it, the webasm program dynamically generating more internal webasm to call)
10:50:37
dxtr
I'm getting some issues with äåö in filenames (Don't ask me why someone has put that in the filename)
10:53:35
beach
It handles it quite well.
10:54:56
dxtr
I wonder if it's drakma that's doing weird stuff all of a sudden
10:55:25
dxtr
Somehow ä is converted to \303\244
10:55:26
beach
I just created a file named åäö with two lines of text in it. Then I did an (open "åäö" :direction input) and I was able to read the contents.
10:56:45
dxtr
å is converted to \303\245
10:56:48
beach
It might very well be that \303\244 is the octal representation of ä in UTF-8.
10:58:01
beach
dxtr: Maybe you are not reading with UTF-8 input encoding?
10:58:35
dxtr
How do I tell it to do that?
10:58:35
flip214
122 303 is what "od -o" is telling me, though...
10:58:38
beach
dxtr: But there seems to be a confusion between the file name and the contents.
10:59:25
dxtr
The error is in the *filename* that is being sent to AWS
10:59:26
beach
dxtr: I just called OPEN. Can't you do that too?
11:00:20
H4ns
dxtr: how do you end up with the file name?
11:00:21
beach
That seems correct then. If you send those characters by a network, they are going to be converted to UTF-8.
11:00:36
dxtr
I am PUTing a file with ZS3 (Which I think is using drakma under the hood) and somewhere along the lines it isn't doing the correct thing with åäö
11:00:37
H4ns
dxtr: i.e. how is drakma returning the name to you?
11:01:37
dxtr
So the filename ends up being something along the lines of "tr\303\244.jpg"
11:01:42
H4ns
dxtr: you'll have to encode the name in the url properly, and that is somewhat of a pain. i think your safest bet is to encode the name externally and make drakma not try to encode the url. there is an option for that.
11:02:15
H4ns
dxtr: :preserve-uri is the option for that.
11:02:41
H4ns
dxtr: well, you'll need to figure out how to convince zs3 to do that properly.
11:02:54
H4ns
dxtr: that's certainly the easy way to cop out.
11:03:09
dxtr
But is there a decent library for uri encoding stuff?
11:03:43
dxtr
Also, how do I tell it to read a file as utf-8? I'm gonna try that first
11:03:55
dxtr
Because I get the list of filenames and stuff from a file
11:04:22
dxtr
So the error could very well be there'
11:04:54
Xach
I do test with funny furrin characters
11:05:09
Xach
That is not to say there are no bugs, but at least it is not a completely unknown situation
11:05:23
H4ns
dxtr: drakma has a url-encode function in utils.lisp which also accepts an external format.
11:07:01
dxtr
Oh, nevermind me. The filenames ARE uri encoded
11:07:13
dxtr
So the error comes before that
11:07:29
dxtr
ä is being encoded to %C3%83%C2%A4
11:08:14
dxtr
So %C3 and %A4 is correct :p
11:08:28
dxtr
Where the heck is %83%C2 coming from?
11:08:44
dxtr
That's a control character according to http://www.utf8-chartable.de/
11:10:15
flip214
dxtr: perhaps you've got double utf8 encoding going on
11:12:57
dxtr
How do I tell (with-open-file) to read as utf-8?
11:13:29
Xach
dxtr: it varies by implementation, but often something like :external-format :utf-8.
11:13:51
loke
Remember that there are different ways in which you can encode åäö.
11:14:30
Xach
dxtr: sbcl uses that kind of syntax.
11:15:10
dxtr
So I have to use special utf-8-aware string functions?
11:15:31
Xach
dxtr: the encoding comes into play when converting to and from sequences of non-characters.
11:15:53
Xach
A file on disk (in unix-like systems) is a sequence of 8-bit bytes.
11:16:06
Xach
Strings in Lisp are sequences of characters.
11:18:53
dxtr
http://paste.lisp.org/+7C39 <- Here's the code, by the way
11:19:08
dxtr
Feel free to criticize it :D Doing this to learn
11:21:57
Xach
dxtr: are you familiar with scheme?
11:22:18
Xach
dxtr: in common lisp, nesting defuns is never done. if you want local functions, flet or labels are the things to use.
11:22:43
dxtr
I thought I was being smart
11:24:01
Xach
it is not the source of your encoding problem, though
11:27:18
dxtr
But I must say, Xach, you have done a mighty good job with zs3
11:33:47
dxtr
Okay, so adding that utf-8 stuff didn't help
11:34:59
Xach
ACTION wishes he could help more but is side-tracked
11:38:05
dxtr
I wonder what it looks like if I add some debug prints
11:38:43
dxtr
Where does the output of my threads go? :D
11:40:00
Xach
dxtr: if you use slime, probably *inferior-lisp*
11:40:07
Xach
i would recommend doing away with threads for now.
11:40:18
Xach
when the time comes, you can use lparallel to make it much easier.
11:41:47
dxtr
"media/catalog/product/h/ä/hämta.jpg" well it looks right
11:52:50
dxtr
Is there an easy way to print a string char-by-char?
11:54:17
dxtr
I even tried (remove-if) with (lambda (c) (find (char-downcase c) "åäö" :test #'char-equal))
11:54:30
jdz
dxtr: (loop for char across string do (print char))
11:55:14
jdz
You may want to use CHAR-CODE.
11:55:52
jdz
dxtr: also, why do you do CHAR-DOWNCASE if you use CHAR-EQUAL (which is case-insensitive)?
11:56:11
dxtr
Because I didn't know char-equal was case-insensitive
12:12:04
scymtym
dxtr: lparallel is a somewhat high-level library for parallelizing code. it allows constructs like (pmapc #'upload list-of-files) which calls upload on elements of list-of-files from multiple threads in parallel
12:13:50
dxtr
I'm gonna have to look into that
12:14:08
dxtr
I've actually come to like common lisp more and more
12:14:19
dxtr
In the beginning it felt kind of.. "Icky" in some irrational way
12:14:34
dxtr
Not the language itself but the stuff around it
12:18:05
dxtr
It actually seems to work pretty well now that I removed åäö
12:18:28
shaftoe
dxtr: you mean the "tooling" around common lisp?
12:18:41
dxtr
Actually the main thing has been deployment
12:18:44
shaftoe
yeh it takes a while to learn how to navigate all that
12:18:52
dxtr
I'd ilke a decent way to deploy my applications
12:18:55
shaftoe
there's a book just out on how to deploy apps
12:19:01
shaftoe
one sec lemme get title
12:19:11
shaftoe
and there's something else i suggest
12:19:37
shaftoe
https://github.com/triclops200/quickapp/
12:19:53
shaftoe
creates a project template for a command line app, including makefile for standalone executable
12:20:04
dxtr
So with 8 threads I'm using about 25% CPU on all cores and the bandwidth is spiking around 6MB/s both up and down
12:20:21
shaftoe
if you just want to make libraries, i suggest quickproject
12:20:39
dxtr
I was actually considering buying that book yesterday
12:20:49
dxtr
I had my finger on the trigger but then something happened
12:20:56
shaftoe
i dont write apps big enough to justify qlot/etc
12:21:19
shaftoe
if you want to buy a lisp book, i'd recommend Common Lisp Recipes
12:21:41
dxtr
The fiancee bought me Land of Lisp last yeart
12:21:44
shaftoe
and bookmark practical common lisp
12:22:31
dxtr
I think I can buy Practical Common Lisp discounted from my job
12:22:54
shaftoe
i've only bought the ebook PCL
12:24:24
dxtr
I like to collect dead trees
12:24:49
dxtr
yeah I can get practical common lisp for $45 \o
12:25:09
dxtr
Or around 40€ if you're european
12:31:09
flip214
dxtr: http://www.gigamonkeys.com/book/
12:31:39
flip214
"and print it out" (no, just buy a copy. much nicer that way!)
12:32:13
dxtr
I like to buy these kinds of books to support the author - even though I mainly use the online resource if it's available
12:32:37
flip214
well, having a paper copy to scroll through in the evening is very nice
12:32:49
shaftoe
i figure there's so few good, recent Lisp books out there, better buy and support the authors
12:33:19
dxtr
I was about to say I'm tight on money right now but then I realized I got my paycheck today
12:33:38
dxtr
Who has time for bills anyway?
12:33:51
flip214
well, "good books" means not that many anyway
12:34:04
flip214
"good Lisp books", at least.
12:34:38
shaftoe
there's plenty of lisp books
12:34:45
shaftoe
not so many published in the last 5 years
12:34:57
axion
CLR is a great companion to PCL
12:35:10
shaftoe
i'm still waiting on full stack lisp to be finished :P
12:35:31
axion
shaftoe: The author has exited the Lisp world it seems
12:35:46
shaftoe
axion: that's unfortunate... it had promise
12:36:07
axion
I used to chat with him quite a bit, but recently he has ignored me, even though quite active on Twitter.
12:37:36
shaftoe
it's huge (the printed version)
12:41:22
flip214
shaftoe: ever seen AoE?
12:41:56
pjb
dxtr: (map nil 'princ "String") #| String --> nil |#
12:42:11
pjb
dxtr: (map nil 'prin1 "String") #| #\S#\t#\r#\i#\n#\g --> nil |#
12:42:37
dxtr
pjb: Thanks, but I already solved it :p
12:42:39
flip214
shaftoe: http://artofelectronics.net/ 1223 pages, 2.5kg
12:42:57
pjb
dxtr: just to burn it into your brains for next time ;-)
12:43:19
varjag
should get the new edition someday
12:49:46
Xach
dxtr: thanks, though I would imagine most of what takes time is network transfer, not computation.
12:50:01
dxtr
Running 12 threads and my cpu isn't breaking a sweat and uploading at around 7MB/s
12:50:10
dxtr
I'm up at around 15MB/s up+down
12:50:49
dxtr
Although next time I will try lparallel
12:52:22
Xach
lparallel takes a lot of bookkeeping out of doing work in parallel
13:18:34
dxtr
Shouldn't sbcl garbage collect sometimes? :p The memory usage is increasing a lot
13:27:05
White_Flame
GC is often triggered on some threshold of memory allocated
13:31:53
_death
shaftoe: https://github.com/death/ledstuff/blob/master/morse.c
13:38:37
smokeink
how to destructively remove the last character from a string ?
13:39:50
jdz
smokeink: your string must be an adjustable array.
13:43:52
dlowe
actually, if it has a fill pointer, that will work too.
13:50:00
dlowe
((let ((a (make-array (length str) :fill-pointer (length str) :initial-contents str))) (setf (fill-pointer a) (1- (length a))) ...)
14:02:57
beach
smokeink: Can you describe the use case a bit more?
14:04:54
dxtr
Xach: Is there a way in zs3 to poke an object to see if it exists?
14:17:58
Xach
dxtr: zs3:head is one possible option
14:18:08
Xach
dxtr: but of course there are potential races
14:18:54
dxtr
Also, is it uiop that contains a nicer pathname library? :p
14:19:03
Xach
The last time I checked, I could not find a put-if-does-not-exist operation in s3.
14:26:25
dxtr
So how do I convert a string to something that can be hashed with ironclad?
14:27:17
Xach
dxtr: babel is one easy option. then you can use (babel:string-to-octets string :encoding <something meaningful to you>)
14:27:44
dxtr
ironclad already has ascii-string-to-byte-array
14:27:55
dxtr
But it's ascii so.. Will that work with utf-8? :p
14:28:14
dxtr
"Care should be taken to ensure that the provided string is actually an ASCII string"
14:33:30
l04m33
dxtr: If you're working with sbcl, (sb-ext:string-to-octets string :external-format :utf8) should do
14:35:06
jackdaniel
babel has portable version
14:35:13
jdz
There's trivial-utf8 in Quicklisp.
14:35:47
Xach
It is fast and specialized.
14:35:50
jackdaniel
or was it flexi-streams
14:35:52
jackdaniel
flexi-streams:string-to-octets
14:36:11
oleo
how do i set the font now in mcclims clim-listener ?
14:37:09
oleo
i tried it with (setf climi::*default-text-style* (make-text-style :sans-serif :roman :large)) but it doesn't work....
14:37:51
beach
http://bauhh.dyndns.org:8000/clim-spec/10-1.html#_520
14:38:49
oleo
i'm using your version of mcclim and woder why i can't get the fonts right....
14:39:51
beach
Some of those functions ought to work: (setf medium-text-style) (setf medium-default-text-style)
14:39:51
oleo
so i now have to use medium-text-style rather you mean ?
14:40:23
jackdaniel
you may also check out in utils.lisp – listener seems to overwrite some values
14:40:45
oleo
ya when i try it interactively i have the feeling it does not work
14:41:11
beach
What do you use for the medium when you try?
14:41:11
jackdaniel
I think clim delibaretely customizes its text style in the application (what is understandable)
14:44:53
beach
oleo: works for me: (setf (medium-text-style *standard-output*) (make-text-style :sans-serif :bold 20))
14:48:49
beach
oleo: [Did you faint?] http://metamodular.com/listener.png
14:50:18
dxtr
How do I tell a thread to shut down gracefully when it is done?
14:51:00
dlowe
you embed code in your thread that, when you signal it, shuts down gracefully
14:51:41
dlowe
alternately, you can just sb-thread:terminate-thread. YOLO.
14:51:42
dxtr
Well I guess the question is "How do I quit a thread"?
14:52:07
dlowe
dxtr: the thread starts with a function, right? Just exit that function.
14:52:21
dlowe
or the thread can call terminate-thread on itself
14:52:52
dxtr
Seemed like the threads were still there when I looked in the process list
14:54:10
Xach
(sb-thread:list-all-threads will give a list
14:57:14
nyef
ISTR something about SBCL thread records possibly hanging around until GC? It's been a while since I looked at that part of the runtime, though.
15:11:18
beach
jackdaniel: Speaking of which, we should think about standardizing the place in the file system for putting configuration files for McCLIM applications.
15:12:06
beach
jackdaniel: Last time this came up, GNU/Linux did not have a standard place, but now there is ~/.config, right?
15:13:45
H4ns
beach: fare has researched that comprehensively once and i think if you want to do the right thing, what he found is probably best. (fsvo "right" and "best").
15:14:00
H4ns
beach: if i remember correctly, he did it for asdf
15:14:01
beach
Oh, excellent. We'll check with him.
15:14:56
jdz
I guess one would end up with a directory named ~/.config/common-lisp/mcclim.d/
15:15:05
H4ns
something in the lines of that.
15:15:35
H4ns
but hey: systemd, nix, why not that as well? :D
15:17:21
jackdaniel
it's specified in xdg
15:17:29
jackdaniel
and afaik uiop supports it
15:17:54
jackdaniel
(xdg is a speciication for freedesktop, as found on linux)
15:18:50
beach
As long as we make a decision, and as long as it is not contrary to current practice, I don't care what the exact decision is.
15:19:09
beach
In what way does UIOP support it?
15:19:43
jackdaniel
http://paste.lisp.org/display/342283
15:19:57
jackdaniel
these are functions implemented by it
15:20:26
jackdaniel
it works on Windows to afair (its not xdg standard on windows, gives reasonable windows-specific alternatives)
15:22:06
_death
recently an xdg module was added to emacs as well
15:22:19
jackdaniel
here is a spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
15:24:50
beach
But we still have to decide the names of the sub-directories.
15:25:37
jackdaniel
I'd say – application name, in our case mcclim
15:25:55
jackdaniel
using "clim" would be rude for other clim implementations
15:26:19
jackdaniel
listener is a separate application, so if it has config, it should have its own directory
15:26:22
nyef
There is also established precedent for something on the order of ~/.mcclim.d/
15:26:25
beach
I want to know whether the configuration file for (say) Climacs is directly under ~/.config or in ~/.config/mcclim
15:26:31
_death
maybe have it configurable, so that there can be multiple apps using mcclim with different configurations
15:27:36
beach
Actually, I probably would like an entire directory. And I would like to know not only where to put it, but what to name it.
15:28:06
beach
So ~/.config/mcclim.d/climacs.d/*?
15:28:19
beach
What does .d mean by the way? "directory"?
15:28:57
beach
_death: Configure the configuration? That might not halt.
15:29:38
beach
nyef: Where did you see that?
15:29:42
_death
what I mean is that climacs conf, which may include mcclim conf, could be ~/.config/climacs
15:29:52
dxtr
Xach: I solved this "properly" by hashing the filenames
15:29:57
dxtr
Made everything so much cleaner
15:30:02
nyef
beach: There's often application-specific hidden directories in the user home directory.
15:30:10
dxtr
I found files called ''.jpg and stuff
15:30:28
beach
OK, forget I brought this up. This is getting too complicated.
15:30:39
nyef
I see a ~/.emacs.d/, for example.
15:31:09
nyef
The .d suffix is often used when there can be both a plain file (without the suffix) and a directory.
15:31:19
dlowe
it's not just in the user's directory. You can find it in plenty of places in /etc too
15:31:31
jackdaniel
it means, that application has more configuration files
15:31:34
nyef
Don't know when the convention showed up, but it's not uncommon.
15:31:46
jackdaniel
but it's not strictly obeyed practice
15:31:55
jackdaniel
there is a lot of applications not following this scheme
15:32:11
iago
usually on linux systems .d suffix means a directory to drop config files to be loaded by an application, as example /etc/httpd/conf is where apache stores its main configuracion /etc/http/conf.d all files there will be loaded by it
15:32:23
iago
but it's just a convention
15:32:39
jdz
And it is usually the main config file that has a line to look for additional files in .d directory.
15:33:44
jdz
Then there is also apache/nginx convention of available configurations and enabled configurations (which are symlinks to available configurations).
16:25:41
didi
Is it possible that calling 2+ times (slot-accessor-fn object) performs better than saving the slot value like (let ((slot-value (slot-accessor-fn object))) ...) and using `slot-value' 2+ times?
16:26:46
Xach
didi: it seems very unlikely.
16:30:32
didi
|3b|: I don't have the code anymore, but this puzzles me. I thought about SBCL's manual chapter 6.1 slot access.
16:31:21
didi
Something something about open code.
16:31:22
|3b|
most likely case i could think of is if extra variable causes bad register alloc in a tight loop
16:32:21
|3b|
possibly something involving the extra variable causing creation of a closure that wouldn't have otherwise been needed
16:33:44
|3b|
or allocation, or whatever
16:34:51
White_Flame
I tend to often pull special variable values into local lexical variables, just to micro-optimize things
16:34:58
|3b|
in either case i think it would be more about making something else slow than the actual variable access being slower
17:21:16
mepian
what's the difference between cl-sdl2 and lispbuilder-sdl?
17:22:05
mepian
lispbuilder-sdl seems to be better documented
17:23:08
lispnik
mepian: lispbuilder-sdl is still sdl-1.2 I think
17:23:52
Balooga
That's correct. lispbuilder-sdl is 1.2 only
17:27:08
mepian
so cl-sdl2 is preferred for new projects?
Friday, 24th of March 2017, 17:27:18 UTC