freenode/#lisp - IRC Chatlog
Search
13:59:10
minion
bzp: please look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
19:35:49
shka_
is it possible in asdf to ask to compile every file in the project as one compilation unit?
19:40:02
p_l
don't recall such function, but it could be possible to write something that makes it happen? a new kind of file which is interpreted to be concatenated from several others...
19:40:27
p_l
there's a problem that the only way to force single compilation unit iirc is to make it a single CL:COMPILE input
19:46:42
shka_
p_l: i don't think that this is true, standard explicitly states that compile-file works by wrapping input in with-compilation-unit (:override nil)
19:47:07
shka_
therefore, it should be possible to compile-file in loop while in with-compilation-unit
19:48:17
p_l
shka_: still, you will probably need to either modify existing ASDF compile-op, or implement your own as different file-type and inside of it call compile including with-compilation-unit
19:56:26
p_l
very interesting. I thought of various extensions one can use to implement their own compile-op, but I see there's some arguments already...
20:17:19
p_l
I was thinking if it would be possible to make an :around method around compile-op or something to verify what's getting passed, but now I realize it won't guarantee anything since I don't see a way to check for compilation unit
21:55:30
garbochock
new lisper (and programmer altogether) here. Currently reading 'a gentle introduction to symbolic computation' - which is a great resource for learning the basics of lisp. Looking at 'the little schemer' for further reading. My question is - where do one continue studying in order to learn how to write useful programs in lisp?
21:58:08
dialectic
I wouldn't read the little schemer. It's basically a book for teaching you how to think recursively.
22:00:16
dialectic
It does not teach you any of the interesting parts of Lisp, either: symbols, heterogeneous lists and property lists, macros, the object system, any of the sophisticated control structures in Lisp or the conveniences (like keyword arguments, rest arguments, #'APPLY . . .)
22:00:27
garbochock
really? My impression was that it was fairly generic - and as such could be easily applied to common lisp
22:01:21
dialectic
Then you'll probably benefit from that book. I don't often reach for recursion but of course it is indispensible when I ned it.
22:04:01
dialectic
I'm writing a compiler. I needed the dynamic type system and garbage collection so I wouldn't give myself a headache. I needed the macros so I could properly abstract over repeated patterns.
22:07:13
dialectic
garbochock: Let me show you a little macro I wrote the other day for lexing operator string sequences in source code. It isn't particularly good style and I take some liberties because it's only used in one place (I assume a free variable, I'm rather ad-hoc about the data structure, etc...) but it should be instructive anyway. And it's recursive.
22:08:39
garbochock
Please do. It might fly over my head honestly but im curiousn about individual user cases of lisp so it's greatly appreciated
22:12:39
garbochock
fyi I'm a 27yo 2nd semester compsci student with little background in the field prior - i'm very much fumbling in the dark
22:15:00
dialectic
ctrl-f "lex-operators". What I'm saying in that call is "every (string sym) pair should parse string and return sym". So if "..." appears in a source code file, that returns the token ELLIPSIS
22:16:17
dialectic
What that macro does, pay attention, is it takes that list of pairs (anyone else in here, please don't correct me that those aren't really "pairs"), and it sorts them lexicographically. Then it builds a finite state machine out of those strings.
22:17:15
dialectic
It takes the state machine - this is all happening at compile time! - and it recurses over it, building up the case-switch code that I've pasted at the end, peeking at the next char and advancing when necessary.
22:18:09
dialectic
You could use a regular expression... but this should show you how libraries like cl-ppcre do this very task
22:20:29
dialectic
You can't do this with a scheme "syntax-rules" btw. But you can do it with the various nonportable macro facilities in each scheme implementation.
22:25:02
dialectic
if you can't read that code, don't worry, after seeing that again for the first time in two weeks I can't read it either. Only slightly kidding.
22:26:22
garbochock
haha. No it's just over my level of understanding of the language. Seriously appreciated though - I need study material, and I need to look at code written by people knowing the language better than me
22:30:19
dialectic
Reading and writing are both important. On Lisp is a very inspiring book. Same with Let Over Lambda
22:30:38
dialectic
Basically if you keep using Lisp, you should read Practical Common Lisp -> Let Over Lambda or On Lisp or both.
22:33:35
garbochock
anyway thanks. turn in time for me - maybe see you around in the channel another point. night!
22:47:53
makomo
how come clsql's insert-records doesn't support inserting multiple records at once :(
22:55:19
dialectic
Ok, I haven't tested this yet, but I need some opinions: is string interning worth it for a well organized symbol table? I thought I'd get cheap string tests out of it but I'm wondering if the overhead for interning strings makes it come out the same.
22:58:58
aeth
Hmm, Ryzen 3000 is coming out tomorrow. It sure would be nice if a 12 core computer (the most in tomorrow's launch, but not overall) would actually be a substantial improvement in CL compilation times over a 4 core computer.
23:00:32
dialectic
Plus the whole bestiary of new features every few years. I would hate to be a maintainer for GCC or Clang.
23:01:05
aeth
Still, we should start a gofundme to send out as many Ryzen 9 3950X (coming out in September) to as many people involved in CL build processes and CL compilers. Only $749. https://en.wikipedia.org/wiki/Ryzen#Zen_2_microarchitecture
23:04:19
aeth
Not every compiler is thread safe afaik, which is why the last attempt to parallelize ASDF does heavyweight forking insetad of lightweight threads. Although they might have improved since then.
23:04:24
Petit_Dejeuner
Wasn't someone on here talking earlier about how SBCL uses fork or something?
23:05:22
Petit_Dejeuner
Side not, I feel like I'm losing my mind. I used to be apple to SBCL and SLIME working perfectly on any machine with little to no effort, but not it feels like the REPL is always broken for some reason.
23:06:42
dialectic
As one of the poor people using the SLIME package for Atom, I have never had a bug free environment
0:42:05
DaveLib
hello i am running sbcl i am trying to compile a common lisp program i just downloaded : clfswm common lisp full screen window manager i just tried and got an error message last month i came to this channel and someone here solved it for me by giving me a single line lisp command to insert into the lisp spurce code i recall the issue was to add an item to a PATH variable since then my computer crashed and i lost my old files
0:43:10
White_Flame
I don't know about that specific error, but the first problem to solve is one of having good backups.
0:44:25
DaveLib
yes i reinstalled my os after the crash and this time i did a separate home partition so i can reinstall oif necessary without losing my personal files
1:02:35
DaveLib
Thanks saturn2: i found the old solution in those logs i will try it again it worked for me last time
1:08:13
stacksmith
aeth: I wrote a macro 'with-' that automatically (or manually) creates package-local accessors to struct, class or foreign object instances and can prefix them on per-instance basis. It can use existing instances or create new ones (including temporary CFFI foreign objects). It can also combine multiple with- style macros, and bind single or multiple values. http://github.com/stacksmith/cl-with
1:09:48
stacksmith
Well, it uses the same syntax for all slotted objects, and lets you, in a single statement, use any number of objects with different prefixes for slots...
1:12:41
dialectic
stacksmith: How do I use with-foo if it's in another package? I have to explicitly import?
1:15:13
stacksmith
Yeah, it is a bit of a pain - if it starts with a symbol it assumes it's a binding, not a with- aggregation...
1:17:00
stacksmith
I tried a few different ways, but it is most natural to have the symbol in the first position be a binding... A list for multiple values. A keyword for with- macros.
1:17:38
dialectic
Just add one more clause. If it starts with a list and the CAR is QUOTE, it's like the keyword case.
1:18:11
dialectic
If you're doing a multiple-value-bind and one of your new bindings is the symbol QUOTE, you're a bad person.
1:19:00
stacksmith
Actually, the way it stands you always create bindings in *package*. So if you specify a symbol in another package it can always treat it as a with-... clause.
1:56:33
stacksmith
I think it's useful. Anyway, I just did it. I don't ever want to look at this code again, and I can imagine a with-macro in another package situation... My idea of always using local bindings sucked - with :old you use existing bindings which could well be in another packege...