freenode/#lisp - IRC Chatlog
Search
20:14:09
randyjohnson86
I apologize for the short pastebin time; here is the revised one with your suggestions: https://pastebin.com/5HbMifzg
20:17:27
aeth
I supported 3 or 5 or 7 or ... as long as they used the same operator, e.g. (1 + 3 + 5 + 7)
20:18:02
Bike
i don't want to harp on the indentation, but i don't get why you'd ask me specifically what i meant, and then ignore it
20:19:29
randyjohnson86
perhaps I misunderstood, but I thought the revised snippet is the way you suggested. to me, it looks more complicated than my initial attempt as you cannot reasonably discern where the test concludes and the rest of the if begins
20:31:21
Bike
the then branch is "(list operator lh-operand rh-operand)" and it starts on column four
20:35:56
Bike
randyjohnson86: the problem with starting the then/else on the same line as the if is that you might have more expressions before or after the if, see.
20:38:31
Bike
Right. Now, you see how "x" was the body of the original let and now it's the body of a lambda, and 7 was a value and now it's an argument to a lambda.
21:28:46
mercourisj
is there a way to specify a directory for uiop:run-program? I want to execute 'git show master:file.txt' from a particular dir
21:35:22
mercourisj
well, here's a problem, git show will always prefer to show the directory that it is instead of accepting a path, maybe I'm doing something incorrect syntactically
21:58:56
moldybits
how can several quicklisp projects share the same directory? most files are shared between them.
22:00:55
moldybits
i have a game that supports several frameworks for drawing. they cannot be loaded at the same time, so i'd want (ql:quickload game/sdl) and (ql:quickload game/gamekit) but i don't want two separate directories for the projects since almost all files/resources are the same.
22:03:23
aeth
I'm not sure. When I want multiple ASDF systems, I use package-inferred-system. https://davazp.net/2014/11/26/modern-library-with-asdf-and-package-inferred-system.html
22:04:22
aeth
So I guess they can be defined in the same .asd file, since that's just an abstraction over asdf:defsystem
22:07:52
White_Flame
moldybits: before loading, you could set something on *features*, then #+ that selection in your dependency list
22:08:36
White_Flame
or your first loaded file could perform a runtime selection and do a ql:quickload itself
22:09:12
White_Flame
or you could just load your chosen drawing framework first, then your main project, which has no direct dependency on them but requires one of them be loaded first :-P
22:09:15
aeth
Well, the way I'd do it is require game/backend1 or game/backend2 where game is just game/backend1 (which will be the default).
22:11:34
White_Flame
if you change from the defsystem macro to the register-system-definition function, then your dependencies will be evaluated and you can do more normal inline tests there, too
22:14:49
aeth
moldybits: what makes this hard is that there's complex dependencies... and it's just the nature of the problem
22:14:50
moldybits
i tried defining another system in the same .asd file, and now if i quickload the game first i'm then able to load the other system, which depends on it
22:15:45
aeth
Actually, now that I think about it, it's quite common to have two system definitions in a file, one for "regular" and one for tests.
22:18:38
moldybits
game.asd: (asdf:defsystem #:game ...) (asdf:defsystem #:game/sdl :depends-on (#:lispbuilder-sdl ...) :components (...)) (asdf:defsystem #:game/gamekit ...)
22:25:38
White_Flame
I tend to put scripts in my .sbclrc for loading stuff that isn't a simple quickload
0:37:47
Josh_2
The question isn't write Let*, although that is kewl, It's to convert a let* form into lambdas
0:39:10
pjb
(macroexpand-1 '(let* ((x 6)(y (* x x))) (+ x y))) -> ((lambda (y) (let* ((x 6)) (+ x y))) (* x x)) ; t
0:39:34
pjb
(macroexpand-1 '(let* ((x 6)) (+ x y))) #| --> ((lambda (x) (let* nil (+ x y))) 6) ; t |#
0:46:50
moldybits
Josh_2: x should be bound to 6. y should be bound to (* x x), where x is visible. (+ x y) should be evaluated where x and y are visible
0:47:51
aeth
insert a bunch of prints (well, FORMATs) in the middle of your code so you can see where everything is at each step
1:01:50
aeth
bt:with-lock-held isn't used, but you can still read/write from multiple threads (I'm guessing)
1:07:48
gabbiel
oh I see. I made my own queue implementation, but I never considered threading as I've never really played with that
1:34:12
aeth
gabbiel: Generally, you don't have to think about it, you just pair it with a lock and expect the user to use bt:with-lock-held around it.
1:38:48
drmeister
Does anyone use 'fork' in their day jobs? I'm trying to figure out how to definitively tell if a forked child has crashed. In clasp we are building using 'fork' to compile-file source files and I need to figure out if a child has crashed in C++.
1:40:10
pjb
drmeister: you would establish a pipe between the monitored process and the monitoring process, you exchange 1-byte sized messages, and when you get a SIGPIPE, you know the remote process is dead.
1:41:06
pjb
drmeister: if you need less precise monitoring, between a parent and a children, you can use wait/wait3/wait4/waitpid.
1:41:32
pjb
(and anyways, a parent should use one of those wait functions to reap the children so they don't become zombies).
1:42:18
drmeister
I am using wait and monitoring what signals the children get. But I'm still seeing crashes where the child processes just sit there crashed.
1:43:45
drmeister
Ok, I'll think on that. I was using select/read to try and read all of the output that the children were generating into the parent - but that turned into a disaster.
1:44:39
pjb
with wait you just need to be careful with the retur values and errors. Normally you will call wait once per children, but if a call fails or is interrupted for signals (to the parent), you will have to call wait more times.
1:44:48
drmeister
Then we figured out that gnu make uses a different strategy with -j<value> - they write into unlinked files and the parent keeps a copy of the fd for the unlinked file.
1:45:34
pjb
drmeister: yes, this is why when monitoring, we use 1-byte messages. reading longuer messages will block.
1:45:41
drmeister
saturn2: A forked clasp child crashes in the llvm code and it sits there using about 50% cpu and as far as I can tell does nothing useful.
1:46:45
drmeister
I want to vacuum up all of the child's output (stdout and stderr - which it looks like I'm doing well now with the unlink'd files) into the parent AND I need to know when a child crashes in llvm (still a problem).
1:50:47
drmeister
This is my code: https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/clasp-builder.lsp#L481
1:51:23
drmeister
But it's "pidgin Common Lisp" - I don't have much of Common Lisp up at this point so I rely on a lot of C++ code.
1:51:57
drmeister
https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/clasp-builder.lsp#L363
1:52:31
drmeister
I thought it would catch every problem a child could have but on macOS I could still see children crash and the parent wasn't aware.
1:53:34
drmeister
We have made a lot of progress with Clasp - it is now failing less than 1% of ANSI tests.
1:54:21
drmeister
I'm in the process of exposing debugging information using DWARF. So you will be able to debug compiled Clasp code using DWARF.
1:57:42
drmeister
We've been bringing a new compiler online that gives us much, much better source location information. It should help debug everything.
1:58:50
aeth
In particular, there might be some interest in using Clasp or ECL with Godot via https://github.com/GodotNativeTools/godot_headers for the next Lisp game jams. I might do my own wrapper of the API. There already is one. https://github.com/borodust/bodge-godot
1:59:03
drmeister
But we've been doing work to keep defcallback happy - so I'll run the tests once my build finishes.
1:59:25
gabbiel
this discussion is relevant to me because I'm going to write a C interpreter and was wondering what would happen when the C program crashes
2:25:33
pjb
drmeister: you will need asynchronous I/O or threads to read both stdout and stderr otherwise you risk blocking in the parent.
3:00:54
drmeister
pjb: We switched to using unlink'd files - that's the approach gnu make uses when you specify -j<#>.
3:01:24
drmeister
So we let the children finish writing into the files and then the parent reads the results out.
3:08:50
ck_
I haven't been here in a long while. What has changed? Has Clasp been finished, can I compute a supermolecule a la carte with it already?
3:23:41
ck_
Common Lisp seems pretty finished. Especially compared to newer languages. I could tell you some stories about clojure meetups...
3:26:02
aeth
What happens is one implementation does an extension and if it's popular it slowly trickles everywhere else, either directly or with a portability library over it. And this slow process just recently has gotten the "package local nicknames" extension in most implementations (at least by users)
3:26:27
aeth
So even the language itself isn't static. Most notably stuff like MOP, CFFI, bordeaux-threads, etc.
3:26:40
drmeister
ck_: Both lldb/gdb and slime. I'm using the standard C++ approach of DWARF metadata and exposing that to slime.
3:26:55
ck_
I already yielded. What I meant with that line is: compared to newer, even lisp-like languages, I very often want my common lisp job back because, comparatively, it is at a much higher level of maturity