freenode/#lisp - IRC Chatlog
Search
6:10:18
kamen
beach: Yup, I'm new. Been hanging around some irc channels (emacs, etc.), but hadn't dared to venture in #lisp yet. No idea why.
6:16:42
pyc
Nilby: yesterday, you said, "Everything that still works, works because they don't depend on external conditions. But for most useful things, the external conditions have changed enough that they don't run."
6:17:59
pyc
kamen: how did you finally decide to join #lisp? for me the journey was opposite. I first decided to learn Lisp and that led me to Emacs.
6:22:53
Nilby
pyc: Things like databases, web servers, some O/S things like file locations, and I was running on Solaris OS on 32 bit sparc hardware at the time.
6:24:42
pyc
Nilby: okay. I am still learning CL so not familiar with the term "external condition". Does "external condition" mean external package?
6:26:13
Nilby
pyc: No. I just meant things like the O/S, network, and external programs, like database and web servers,
6:28:26
pyc
Nilby: so if I understood you right, things like CLSQL still work the same. But things like O/S, network, etc. that you depended on in Solaris OS days, don't work the same and you had to rewrite some of that code?
6:31:58
Nilby
Yes. Like for example, migrating from an Oracle database to Postgresql, and from Apache web server to hunchentoot or nginx
6:35:00
pyc
Nilby: Can one create a web-based application in Common Lisp directly using CLHS functions and Nginx or do you need to use Hunchentoot for it?
6:35:20
Nilby
pyc: In general, the CL code I've written is more portable, than any other language I've ever used.
6:36:24
pyc
Nilby: that is great to know. what other languages are in your mind when you say that CL code is more portable than them? Python, Java? or something else?
6:37:41
Nilby
pyc: Back then was before hunchentoot existed so I just used sockets code to talk to mod_lisp in an apache server. If the whole system was never touched, it could still run today, but people like to upgrade things
6:38:33
pyc
Nilby: how about now? can I write a Common Lisp web application without Hunchentoot and serve it over the Internet via Nginx or something like Hunchentoot is necessary?
6:42:23
Nilby
Yes. I mean you can make a HTTP 1 server from a few lines of CL code using implementation specific (or OS specific) socket code, but things like hunchentoot make things easier.
6:44:43
pyc
ah! looks like I have done a hello, world with Hunchentoot already. the Emacs4CL script I used to set up my Emacs introduced me to Hunchentoot in its docs. it had a Hunchentoot example to demo quicklisp: https://github.com/susam/emacs4cl#use-quicklisp
6:45:07
pyc
Nilby: can you take a look at my other question above: what other languages are in your mind when you say that CL code is more portable than them?
6:46:06
Nilby
The application I'm thinking of was in C++ before I converted it to Lisp. CLSQL gave me the cool ability to write mostly DB independent SQL, as well as immediately work on different DBs, but more importantly I could write SQL, HTML, and application logic using the same Lisp syntax.
6:51:34
kamen
beach: Oh, nothing special. Since I had resurrected ERC, I thought I might as well hang around, lurk and read/listen to lispers. Also, I've stopped dabbling in CL and started taking it a bit seriously, so, as "ongoing education", it's a good idea to be here.
7:20:57
pyc
what am I doing wrong in this statement: (uiop:with-current-directory "/tmp/" (uiop:getcwd)). I get: Error while parsing arguments to DEFMACRO UIOP/FILESYSTEM:WITH-CURRENT-DIRECTORY:
7:25:55
Nilby
pyc: When a macro has an arg in parens, it has to be in parens when you use it. So in your case it's (with-current-directory ("/tmp/") ...)
7:28:04
beach
pyc: Common Lisp has "statements" only inside TAGBODY. In general, an expression meant to be evaluated is called a "form".
7:48:41
beach
Most people say "never", but I found a use for it, as described in my paper on method combinations.
7:51:22
jackdaniel
it is useful when you want to introduce a binding that wraps whole body (i.e you want to rebind an argument)
7:53:55
beach
And that's precisely the use in the paper I mentioned. It needs to wrap an entire body of externally-supplied code.
7:58:16
beach
I don't think it has any great use in a function that is entirely written by the programmer. But in this case, I needed it because the body of the code could be arbitrary, and I had to wrap it as jackdaniel said.
8:13:35
beach
Nilby: If so, I challenge you to come up with an alternative solution to the problem in that paper.
9:27:21
scymtym
beach: another use of &AUX is computing the value of a structure slot depending on constructor arguments: (defstruct (foo (:constructor make-foo (bar &aux (baz (1+ bar))))) bar baz)
9:33:05
dim
I must admit I like using structures a lot, and that might be because when using CCL it's possible to change their definitions online, much like classes
9:37:47
pyc
Is it true that 'loop' is discouraged and something like 'mapcar' is encouraged to adhere to more functional programming style?
9:38:02
beach
Carkh: It depends on the generic dispatch algorithm that your implementation is using. But, yes, with current implementations, it is usually agreed that structures are faster than standard classes/objects.
9:39:14
gj
I am here again because I am still a little bit confused about using packages in a lisp program.
9:39:27
beach
pyc: Common Lisp is a multi-paradigm language. You will find the functional style mostly in macro expanders. Of course, someone who wants to program in Common Lisp using a functional style may want to avoid imperative constructs.
9:40:20
beach
Carkh: Now, if current implementations used my algorithm for generic dispatch and my technique for call-site optimization, the conclusions may be different. :)
9:40:23
gj
Things like asdf and quicklisp seem to only work in a REPL? how does it work if I want to do things outside of a REPL?
9:41:05
beach
gj: You use those tools to build your program. And you would not usually build your program at run time.
9:41:15
Carkh
beach : i was under the impression they were doing call site optimization ? or was it java ?
9:41:54
beach
Carkh: Nothing like my draft paper suggests: http://metamodular.com/SICL/call-site-optimization.pdf
9:42:34
beach
Carkh: Some very special cases are optimized in high-performance implementations, but nothing this general.
10:40:17
pyc
Found this post on Reddit: https://www.reddit.com/r/spxy/comments/luiq8k - "makes me wonder how it is webdev with Lisp. I know some old stories, like reddit itself"
10:43:16
jackdaniel
but I'm reading this right now: https://funcall.blogspot.com/2009/03/not-lisp-again.html
10:45:04
beach
I need to put the first one on the queue. I can't figure out how Python would be faster. Maybe they were using CLISP initially?
10:46:34
jackdaniel
I mean - experienced python programmer can write faster code than inexperienced lisp programmer who takes into the heart, that "everything is a list"
10:49:21
jackdaniel
or: overly ambitious lisp programmer tries to do the right thing, while not exactly the right things gives faster code
12:11:26
Carkh
if i set the fill-pointer of a vector to a lower value, should i first fill the upper array cells with nil in order to help the garbage collector ?
12:12:41
beach
AREF ignores the fill pointer, so the objects beyond the fill pointer can't be reclaimed.
12:16:36
Carkh
in other news, after so many years doing clojure, i'm having the hardest time coming up with imperative algorithms ><
12:17:05
Carkh
feels like it's even harder than the adaption i had to undergo the other way back then
12:17:58
beach
Carkh: Try something with a huge graph, like adding an edge. If you do that functionally, it might very well be unbearably slow.
12:20:06
Carkh
though CL is not always that friendly towards non-consing imperative stuff... sometimes feels like fighting it
12:21:44
beach
The, consing is not a problem in general. Only in Common Lisp implementations with bad garbage collectors.
12:24:51
Carkh
wasn't it ITA or whatever is the name of this trip calculating application that had to keep its data in a C application ?
12:25:37
Carkh
ok so here it is : i'm trying to make a game, 60fps not required, and i'm glad it isn't because i don't think i could maintain it with CL
12:27:52
beach
That just confirms what I said. It is a problem only with Common Lisp implementations with bad garbage collectors.
12:29:10
beach
Pretty much all Common Lisp implementation currently used, at least the free ones, started life a very long time ago, and nobody has implemented a good concurrent and parallel GC for them.
12:34:24
beach
The applications I had in mind for this design are "analysis, processing, and synthesis of sound"
12:37:29
beach
You have to make sure that the application responds adequately fast to the user pressing some key on the MIDI keyboard.
12:38:17
Carkh
microsoft windows... I notice it's nothing but an afterthought for most implementations
12:38:53
beach
I have no time or energy for Microsoft products, and very little for Unix as well, so I think the answer is "no".
12:39:36
Carkh
that's something i'll never understand, the users are on windows, most of them anyways
12:41:09
beach
I do my job and try to show good results. If people don't care, then that's their problem.
12:42:43
beach
Yes, but the kind of people that would be attracted by "advocacy" are not the kind of people I would like help from.
12:43:50
jackdaniel
another thing is that effort of managing low quality contributions sometimes is bigger than not accepting them
12:44:17
beach
I seem to come up with more ideas per time unit than I have time to implement. So the backlog is already considerable.
12:44:23
jackdaniel
heck, even a consensus with knowledgeble people is hard in quantity of 2-3 devs!
12:45:14
jackdaniel
might or might not, the free time you put in growing someone you don't know doesn't grow on trees
12:45:37
jackdaniel
well, I'm sure that there are positive examples, but there is some merit in not making a community bubble :)
12:45:38
beach
Carkh: It is part of my job to help people make progress, but I don't do it hoping that they will contribute to SICL.
12:47:33
beach
Carkh: For the past 40 years or so, I have "attracted" people by showing what I can do, without talking much about it, and certainly without trying to "market" it. I think I have a good track record of attracting people that have understood the point of what I do.
12:49:36
beach
Almost. It is certainly not worth *my* time, but that can be because I am not very good at it.
12:50:18
jackdaniel
i.e fact that I'm not going to the cinema does not equal to saying that I don't see value in going to the cinema
12:50:59
beach
Carkh: I also think it is risky. I frequently see people asking questions here in order to "sell" Common Lisp to their manager, but those people would have no clue whatsoever when they then are asked to handle problems with their proposed solutions.
12:52:00
Carkh
again thinking about clojure, rich hickey spent a lot of time doing advocacy, and this resulted in a vibrant community and some tools and solutions that are objectively the best for their purpose (that i know of)
12:52:45
aggin
anyone familiar with the maintainer of https://github.com/naryl/cl-tui/commits/master ?
12:56:21
beach
Carkh: Also, this is probably not a good time to push Common Lisp to a wider audience. Our development tools are not that great, and as you pointed out, the garbage collectors of existing implementations are not that great either. We are working on improving it though.
12:56:50
ldbeth
Is there any material I can reference for how to do "real time" signal processing in CL?
12:57:16
jackdaniel
n.b abcl relies on jvm gc, so it is rather good given how much effort has been put into that technology
12:59:12
ldbeth
to be more specific, I'd like to know how to keep video and sound in sync, but unfortunatly I have no experience in game programming etc
13:00:49
Carkh
i'm yet to tackle the sound issue, looks like there are a few libs to be found with borodust
13:03:53
beach
ldbeth: I know of no such material. Even with more traditional languages, the OS is going to get in your way a lot. I can't even get a real-time synthesizer program to give adequate response times on Linux. I am told I need to recompile the kernel for that.
13:06:27
ldbeth
Carkh: ah, so I accept that it is not easy to accomplish this with trivial programs.
13:07:19
Lycurgus
all my hosts in this LAN for example and this one I'm typing on where I expect interactive resposivity
13:10:08
beach
I think I could convince someone to be my system administrator, but I have no idea how that would work remotely.
13:14:32
Lycurgus
remote isn't a reall issue these days; was gonna sey, dedicate a box to rt if it's important
13:21:04
beach
Thanks for the advice. When I have time, I'll give it some more thought. It is a very attractive idea.
15:27:09
pyc
Given a relative path "foo" what is the best way to convert it to an absolute pathname, example: #p"/home/pyc/project/foo/" ?
15:29:28
jackdaniel
or (make-pathname :name "foo" :defaults *default-pathname-defaults*) if it doesn't
15:32:36
pyc
jackdaniel: yes, I will use the second option because it evaluates what I need when the directory name is a symbolic link to another path.
15:33:52
pyc
just to ensure that I am not falling in the trap of X-Y problem, here is my problem X: given a relative source path "foo" and relative target path "bar", I want to copy all files and folders recursively from "foo" and copy them to "bar".
15:34:26
pyc
so when I start walking through "foo", I get absolute paths for all files and directories found recursively, example, "/home/pyc/project/foo/dir1/file1.txt" and so on.
15:35:21
pyc
so what I am going to do is resolve "foo/" to "/home/pyc/project/foo/" (the prefix), remove that from the source file path to get "dir1/file1.txt" and then append that to "bar" to get the destination path, that is, "bar/dir1/file1.txt"
15:46:49
pyc
What am I doing wrong here: (enough-namestring "/home/pyc/foo/bar" :defaults "/home/pyc/foo/"). Error: invalid number of arguments: 3
15:48:10
Bike
enough-namestring takes an optional parameter for the defaults, not a keyword parameter
15:51:39
pyc
oops! thanks for the help Bike! I am still misinterpreting the docs even though Practical Common Lisp has taught me the difference between keyword and optional.
16:13:17
semz
I'm starting to think ITERATE is largely pointless. It's idiosyncratic with lots of gotchas, hard to extend (beats impossible I guess, but still), and purging it from my code showed that there were maybe two features I used that didn't have a direct LOOP equivalent.
16:15:42
beach
I find mapping works fine when I have the function already made, but not so practical if I have to make up an anonymous function just for the call.