freenode/#lisp - IRC Chatlog
Search
2:52:09
goreye
Hi, I'm trying to do `(write-byte (char-code #\A) *standard-output*)` which works fine on SBCL but fails on SLIME.
2:54:35
goreye
Any way I can test write-bytes on stdout? Though I'm writing the function for generic streams, but I'm testing it on standard output
3:35:39
nydel
at sdf.org pubnix we try to build sbcl for all users on netbsd8. if there is any special bsd unix instructions, the system op wants me to pass them on. thanks in advance if you know anything!
4:39:06
Guest16495
pjb, sjl, Shinmera: thank you for the answers about ctrl-c in cl-charms/curses development. `stty intr undef` was the magic i needed!
6:33:42
nydel
jack_rabbit: thanks for asking! we got 1.4.1 up on the meta-array which is a red-hat-like linux 2.2 kernel. all my programs work!
6:34:05
nydel
but the cluster (the main place - about 5 or 6 machines with a shared user filesystem) runs NetBSD8
6:34:48
nydel
in fact we're the only live beta of netbsd8. the developers are working on the kernel from 7 on our system. so i guess it is proving difficult to easily install SBCL on the bsd system for all users
6:35:12
nydel
i'm hoping to find some existing documentation on bsd-specific sbcl building or to begin creating such a thing as we go
6:35:39
jack_rabbit
I know clisp is currently running there. Having an updated version of that might be easier?
6:36:32
jack_rabbit
The clisp there is (oddly) new enough that I was able to load asdf3 into it and actually compile stuff from quicklisp, which I was not able to do with the old SBCL on MA.
6:36:41
nydel
savvy jack_rabbit ! i guess clisp can be used to build sbcl. so that's exactly what we're trying, to update clisp (we have a version from 2010! woof.) then the sbcl hopefully will follow
6:37:03
nydel
there is a pkgsrc entry for sbcl 1.3.1 and that is plenty current enough for the general SDF population to be using.
6:38:19
nydel
a package i used to rely on called cl-daemonize i guess is no longer listed in quicklisp repository. it's how i backgrounded my hunchentoot-behind-apache webserver (then my sdf website would fetch sdf.org:9903, an arbitrary port running my server)
6:40:38
jack_rabbit
nydel, You can try loading my little gopher client there. https://github.com/knusbaum/cl-gopher
6:41:44
jack_rabbit
That one's different than the one I showed you before. That one is text based and the other is built on McClim, so it's graphical.
6:43:04
jack_rabbit
Although, actually, the main branch there won't work there, since I can't load iolib on the cluster.
6:43:40
nydel
in an ideal world, a person simply does ./cl-gopher-start.sh from the command line yes?
6:44:21
jack_rabbit
This thing is super alpha, though. I haven't made much effort to make it portable yet.
6:44:50
jack_rabbit
however I haven't been able to get slime working with the current clim on the cluster.
6:45:35
jack_rabbit
cl-gopher:text-browser is the function to start the interactive browser, though.
6:45:40
nydel
right away the lsh script gives "system cl-gopher not found" a quicklisp error ... huh
6:47:03
nydel
yes quicklisp is up to date and asdf3 & 2 ... let me get cl-gopher in my quicklisp local real quick
6:49:26
jack_rabbit
Not sure. That might work! It doesn't matter where you place it if you manually load the .asd file.
6:51:06
nydel
that was the idea. and the script progressed quite a ways before running into a very long foreign interface problem that i'm just now looking into
6:52:27
jack_rabbit
Yes. iolib requires libfixposix. Instead, check out the 'iolib->usocket+flexi-streams' branch.
6:53:10
dundee
If I were to make a purely functional lisp, would it still be possible to read in code from imperative languages like C via macros?
6:53:56
phoe
functional paradigm is equivalent to the imperative one, everything computable in one is computable in the other and vice versa.
6:54:19
phoe
so you can write C-reading macros in either of them and compile them into something that you can execute.
6:54:36
nydel
i'm trying on my local machine (not part of SDF) in a slime. having put cl-gopher in quicklisp local-projects, i get a halt at iolib. so i must need to install iolib, with which i am not familiar.
6:54:58
nydel
this is a debian machine, should iolib be something i retrieve by hand, with a lisp, from linux repo?
6:55:02
phoe
so you can do even the blasphemy of grabbing a purely imperative language like C and compile it into a purely functional language like your hypothetical Lisp.
6:56:25
jack_rabbit
nydel, No, iolib is a common-lisp library. However, it depends on libfixposix, which you should be able to install with 'apt-get libfixposix'
6:57:13
dundee
phoe: but you can do all sorts of data mutation in C functions, for loops, and other control structures. I'm sure any sufficiently smart compiler could optimize a naive translation (see: GHC, Stalin Scheme), but would a set of naive translations consistently produce legal lisp?
6:57:55
phoe
dundee: it doesn't matter. in imperative programmming, mutable state is contained everywhere; in functional programming, functional state is isolated and contained in function arguments.
6:58:23
nydel
let's try that then first. i feel like since i haven't used iolib it is probably something i need to spend an hour or two getting learned on.
6:58:24
phoe
in imperative programming, you mutate this global state; in functional programming, you change the arguments passed from function to function.
6:59:13
phoe
functions are directly translatable to functional programming, loops can be transformed into recursion, other control structures, like switches, can be turned into pattern matching.
6:59:37
phoe
and right now I consider only the *possibility* - yes, it is possible. I do not consider whether it's *feasible*.
7:01:02
phoe
and in new-state, a functional data structure, the alist or whatever now contains a mapping from var to new-value.
7:01:34
dundee
I suppose passing continuations from new state object returns are a way to consistently achieve what I'm thinking of.
7:06:17
nydel
jack_rabbit: i clone the other branch (and put it in quicklisp/local-projects for good measure) ... in a slime environment, should i asdf load cl-gopher.asd, or some other action e.g. evaluate cl-gopher.lisp & client.lisp etc?
7:06:44
jack_rabbit
If it's in local-projects, all you should need to do is (ql:quickload 'cl-gopher)
7:08:57
nydel
the same type of error (this is the newer branch not master) condition of type iolib/grovel:grovel::grovel-error ... which happens when apparnetly a call is made to g++
7:10:01
jack_rabbit
Check the .asd file and make sure it matches https://github.com/knusbaum/cl-gopher/blob/iolib-%3Eusocket%2Bflexi-streams/cl-gopher.asd
7:11:01
nydel
oh here is the problem (my fault) - i am not sure how to clone this branch with git. i didn't read what i coppied, it suggest the main cranch
7:13:57
nydel
jack_rabbit: right i had to do clone -b "io.... you get it. i got it, quicklisp loaded and evaluated it, all set! what do i run to get going (cl-gopher:.....)?
7:15:46
jack_rabbit
Oh! and if you want to allow it to download files, you can add the keyword :allow-downloads (cl-gopher:text-browser :allow-downloads t)
7:18:26
jack_rabbit
There's currently no 'quit' option, so you just have to interrupt it with C-c C-c and return to toplevel to get out.
7:20:41
nydel
this is great jack_rabbit i'm reading new phlog entries from today and not in a "hey this a fun novelty" way but in a "this is how i prefer to do this" way
7:21:50
jack_rabbit
It still needs quite a bit of work. Honestly, the browser was mostly an afterthought. cl-gopher's main intention is to be a protocol library that I'm going to put into clim-gopher and my yet-to-be-named gopher server.
7:23:24
nydel
i haven't seen a good clim project in a while so i'm excited to try that. there (AFAIK) aren't a lot of good true gopher GUI browsers. there are proxies and extensions for firefox etc
7:24:10
jack_rabbit
It's available and working now, if you wanted to try it out. It does need iolib currently, but I could switch that over real quick.
7:25:13
nydel
i'm right now working on getting iolib working locally (and understanding what it is/does for myself) ... just give me a little bit to poke around, i feel like this is something i should know how/why it works
7:29:46
nydel
it's probably for the best especially for software that can work on multiuser systems without a lot of hassle
7:32:08
nydel
the meta-array allows for x11 forwarding. i run 'links2 -g' on it often and sometimes firefox. tomorrow i will try to get your clim client running that way
7:33:06
nydel
oh the possibilities. if a commonlisp gopher server, you can have a multi-user repl or version control repo. what fun!
7:35:15
jack_rabbit
nydel, Yeah! My server currently is translating news articles to plaintext, but the possibilities are large.
9:04:16
jack_rabbit
Never found one. I've been in need of one before, but ended up fudging a solution.
9:49:44
phoe
Shinmera: unless I want to insert at position 0, at which point I must modify the place.
9:50:55
Shinmera
If you want efficient inserting at any place you might want to consider something that isn't a list anyway. Like a skiplist.
9:51:23
phoe
And to avoid the NIH syndrome, I'm looking for someone who already encountered that problem and wrote an already existing library function.
9:54:12
jackdaniel
in case of single utilities NIH doesn't apply, because pulling whole library as a dependency for a single (side-) utility is more absurd than adding 10 lines of code
10:00:01
phoe
jackdaniel: unless it's already in some commonly used library that I am likely to have already pulled in.
10:38:21
jackdaniel
I see some [] which are not valid common lisp as well as various indentation and naming problems
10:38:39
jackdaniel
if I had to guess, I'd say it is not Common Lisp either way (even if it is not scala)
10:38:59
DonVlad
Well I tried to copy as much as possible Common Lisp but still add my own unique features, but it's lisp...
10:40:47
jackdaniel
if something is an atom in non-functional position, then it is not a function (unless it is lisp-1, which Common Lisp is not)
12:30:56
shka_
is there standard or de facto standard function for comparing floating point numbers?
12:36:04
shka_
i know that, it would be silly though if I was doing this while alexandria already has function for that
12:37:52
shka_
pjb: true, but i just need to compare floats in unit test, so I will just that since i know precision beforehand
13:04:39
dim
SBCL through buildapp gives me Fatal SIMPLE-ERROR: Compilation failed: PGLOADER.COPY also uses the following packages: (PGLOADER.PGSQL) ; CCL says nothing about it, and SBCL in SLIME loads pgloader just fine
13:05:23
phoe
In the new definition, you do not use the PGLOADER.SQL package, but it was used in the previous definition.
13:07:55
dim
I have a source type that's named after the PostgreSQL COPY format, and also a CL implementation of the COPY protocol with error handling
13:12:18
dim
https://github.com/dimitri/pgloader/blob/master/src/package.lisp --- improvements ideas welcome of course
13:28:14
borodust
hmm, i generally should be able to load systems via asdf while being in other packages rather than :cl-user, right?
13:29:46
borodust
on sbcl 1.4.0 i'm getting rather weird behavior: if i'm in package that doesn't import anything (not even :cl), asdf fails to load some files that contains macros and at the top of the file i use 'in-package
13:30:07
borodust
when i change 'in-package to 'cl:in-package (fully qualified symbol name) it works correctly
13:31:16
borodust
so, generally, speaking, i always should use cl:in-package rather than in-package, correct?
13:33:18
pjb
papachan: in lisp you can interpret a form, only knowing whether the symbols are macros or functions!
13:34:22
pjb
papachan: if all your first symbols are fbound to functions, then (modulus (! (1- (length seq)))) means call the function LENGTH in the value of the variable SEQ, then call the function 1- on the result, then call the function ! on the result, then call the function modulus on the result.
13:34:43
pjb
papachan: but if one of those symbols is bound to a macro, then we can only interpret the subexpressions depending on the macros!
13:39:03
pjb
papachan: now, what function is called depend, and can be mostly determined only at run-time.
13:39:16
pjb
papachan: if length is CL:LENGTH, then it's the length function defined in the hyperspec.
13:39:50
pjb
papachan: otherwise, if a function with the same name is defined in the same compilation unit (basically the same file), then it can be this exact same function. (perhaps even inlined).
13:40:32
pjb
for functions in the same compilation unit, it is assuming it is not declaimed notinline. If declaimed notinline, then it's determined at run-time.
13:47:20
dim
hehe, I was supposed to spend some days in the Bordeaux area this week… it's a 3h ride train away…
13:51:25
beach
rme: My favorite coauthor is very likely coming to my house for lunch on Wednesday. Would you care to join us?
13:56:21
beach
We typically eat soon after 12, but you can come early if you would like to hang out.
14:21:30
beach
It is in Marbella in Spain, yes. But there will be lots more and lots cooler people there.