<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.
<drmeister>
Hello abarbosa
<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++.
<drmeister>
It's off topic - so we could take the discussion elsewhere.
<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.
lnostdal has quit [Ping timeout: 244 seconds]
<pjb>
drmeister: if you need less precise monitoring, between a parent and a children, you can use wait/wait3/wait4/waitpid.
<drmeister>
What do I exchange the 1-byte sized messages for?
<pjb>
(and anyways, a parent should use one of those wait functions to reap the children so they don't become zombies).
<drmeister>
I am using wait.
<pjb>
drmeister: to detect whether you can send something on the pipe.
<pjb>
The pipe let you monitor between sibbling or stranger processes.
<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.
<drmeister>
So the pipe is for a heartbeat?
<pjb>
Yes, and to monitor non-children.
<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.
<drmeister>
select said fds were ready to read and the read still blocked.
<saturn2>
what do you mean by "sit there crashed"?
<saturn2>
deadlocked?
<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.
<pjb>
Perhaps you're not repeating wait when you should.
<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.
<pjb>
drmeister: yes, this is why when monitoring, we use 1-byte messages. reading longuer messages will block.
<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.
<saturn2>
maybe set a cpu time ulimit
<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).
<pjb>
drmeister: you will need asynchronous I/O or threads to read both stdout and stderr otherwise you risk blocking in the parent.
zotan has quit [Ping timeout: 259 seconds]
zotan has joined #lisp
_whitelogger has joined #lisp
meepdeew has joined #lisp
joast has joined #lisp
meepdeew has quit [Ping timeout: 246 seconds]
milanj has quit [Quit: This computer has gone to sleep]
<drmeister>
pjb: We switched to using unlink'd files - that's the approach gnu make uses when you specify -j<#>.
<drmeister>
So we let the children finish writing into the files and then the parent reads the results out.
<drmeister>
aeth: Thank you.
X-Scale` has joined #lisp
<ck_>
hopefully that name is not an omen :)
<ck_>
or, actually, I've never read the play. doesn't godot never arrive?
X-Scale has quit [Ping timeout: 244 seconds]
X-Scale` is now known as X-Scale
<beach>
Good morning everyone!
<ck_>
good morning
<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?
<beach>
ck_: For Clasp-specific questions, there is now the #clasp channel too.
<ck_>
noted, thank you
<drmeister>
Software is never finished. :-)
<mfiano>
If it ever seems as such, just incf your users
igemnace has quit [Ping timeout: 268 seconds]
igemnace has joined #lisp
<drmeister>
I'm putting time into improving the debugging capabilities right now.
<ck_>
Common Lisp seems pretty finished. Especially compared to newer languages. I could tell you some stories about clojure meetups...
<ck_>
I see. From which side are you doing that? lldb or slime?
<aeth>
Common Lisp is far from finished, they just added package local nicknames.
<beach>
ck_: Common Lisp is not software. It is a specification.
<ck_>
beach: realized in software. but I see your point.
<beach>
ck_: But the realizations of it are not finished.
<beach>
They evolve all the time.
<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)
<aeth>
So even the language itself isn't static. Most notably stuff like MOP, CFFI, bordeaux-threads, etc.
<drmeister>
ck_: Both lldb/gdb and slime. I'm using the standard C++ approach of DWARF metadata and exposing that to slime.
<drmeister>
We get better lldb/gdb debugging for free.
<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
<aeth>
(And I'm still waiting to see Unicode. There's sb-unicode, and that's about it.)
meepdeew has joined #lisp
meepdeew has quit [Ping timeout: 244 seconds]
gravicappa has joined #lisp
meepdeew has joined #lisp
meepdeew has quit [Remote host closed the connection]
caltelt_ has joined #lisp
shidima has joined #lisp
X-Scale` has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
Arcaelyx has quit [Ping timeout: 248 seconds]
X-Scale has quit [Ping timeout: 268 seconds]
X-Scale` is now known as X-Scale
Necktwi has quit [Ping timeout: 258 seconds]
Necktwi has joined #lisp
vlatkoB has joined #lisp
caltelt has quit [Ping timeout: 248 seconds]
shidima has quit [Ping timeout: 248 seconds]
nowhere_man has joined #lisp
nowhereman has quit [Ping timeout: 248 seconds]
igemnace has quit [Ping timeout: 248 seconds]
meepdeew has joined #lisp
nanozz has joined #lisp
nanoz has quit [Ping timeout: 248 seconds]
igemnace has joined #lisp
anewuser has quit [Ping timeout: 258 seconds]
caltelt_ has quit [Ping timeout: 258 seconds]
terpri has joined #lisp
Bike has quit [Quit: Lost terminal]
nanozz has quit [Ping timeout: 248 seconds]
meepdeew has quit [Remote host closed the connection]
Necktwi has quit [Ping timeout: 268 seconds]
SaganMan has joined #lisp
sjl has quit [Quit: WeeChat 2.2-dev]
libertyprime has quit [Quit: leaving]
libertyprime has joined #lisp
libertyprime has quit [Client Quit]
libertyprime has joined #lisp
gabbiel has quit [Remote host closed the connection]
dale has quit [Quit: dale]
dddddd has joined #lisp
crystalball has joined #lisp
longshi has joined #lisp
sr5h has joined #lisp
JohnMS_WORK has joined #lisp
donotturnoff has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
libre-man has quit [Ping timeout: 248 seconds]
libre-man has joined #lisp
vlatkoB has quit [Remote host closed the connection]
JohnMS has joined #lisp
longshi has quit [Ping timeout: 252 seconds]
JohnMS_WORK has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 245 seconds]
gravicappa has joined #lisp
amerlyq has joined #lisp
orivej has quit [Ping timeout: 248 seconds]
vlatkoB has joined #lisp
shrdlu68 has joined #lisp
<shrdlu68>
Good morning #lisp!
<White_Flame>
Place the green block in the good morning area
igemnace has quit [Ping timeout: 248 seconds]
_leb has quit []
ggole has joined #lisp
scymtym has joined #lisp
<phoe>
morning
<shka_>
phoe: hi!
<shka_>
i need to precisly measure time spent in the callback
<shka_>
what profiler can do that reasonably well?
<shka_>
or should i simply make my own funcall?
<shka_>
with unique name so standard profiler can track it
igemnace has joined #lisp
varjag has joined #lisp
amerlyq has quit [Quit: amerlyq]
manualcrank has quit [Quit: WeeChat 1.9.1]
iovec has joined #lisp
hhdave has joined #lisp
rdh has quit [Read error: Connection reset by peer]
makomo has joined #lisp
amerlyq has joined #lisp
nowhere_man has quit [Ping timeout: 268 seconds]
terpri has quit [Ping timeout: 248 seconds]
heisig has joined #lisp
pankajgodbole has joined #lisp
SaganMan has quit [Ping timeout: 268 seconds]
mulk has quit [Ping timeout: 246 seconds]
mulk has joined #lisp
crystalball has quit []
gareppa has joined #lisp
gareppa has quit [Remote host closed the connection]
v88m has quit [Read error: Connection reset by peer]
orivej has joined #lisp
v88m has joined #lisp
m00natic has joined #lisp
igemnace has quit [Ping timeout: 258 seconds]
abarbosa has quit [Remote host closed the connection]
mulk has quit [Ping timeout: 248 seconds]
<LdBeth>
If a language is very terse (TECO), where almost every token is one character, is there any possibility benefiting from using a parser generator?
glv has joined #lisp
<beach>
That is unrelated. The grammar for combining the tokens can still be complex.
<beach>
You might avoid the lexer, though.
mulk has joined #lisp
benkard has joined #lisp
mulk has quit [Ping timeout: 244 seconds]
benkard is now known as mulk
<LdBeth>
beach: it is mean to be executed when typed
<LdBeth>
It is no more complex than prefixing argument in a emacs key strokes
<beach>
Then it has nothing to do with the tokens themselves, but with the fact that the grammar is very simple too.
t58 has joined #lisp
<beach>
Implementing a typical language often consists of defining two separate things, namely a lexer and a parser. The lexer turns sequences of characters into tokens, and the parser turns the sequence of tokens into a parse tree (usually). If the tokens are simple, the lexer is simple. If the grammar for combining tokens into parse trees is simple, then the parser is simple. The two are orthogonal.
igemnace has joined #lisp
<LdBeth>
Haven’t aware the lexer before XD
<aeth>
I wonder where optimizations fit. These are especially key when you have a minimal command language where you're supposed to compose things. One case would be +++++ which in a hypothetical simple language taken literally would mean (progn (incf x 1) (incf x 1) (incf x 1) (incf x 1) (incf x 1)) but can be optimized to (incf x 5)
<aeth>
It seems like this kind of thing could be done at either the lexer or the parser, and would complicate even a seemingly simple language.
<beach>
The role of the lexer and that of the parser are often blurred. In most real languages, a lexer is in fact not possible as a first step. It has to know the context as defined by the grammar. Also, there are parsing techniques that do not need a lexer at all.
* beach
vanishes in order to have lunch.
shka_ has quit [Quit: WeeChat 1.9.1]
sr5h has quit [Ping timeout: 258 seconds]
SaganMan has joined #lisp
dmiles has quit [Ping timeout: 246 seconds]
Lord_of_Life has quit [Ping timeout: 244 seconds]
Lord_of_Life has joined #lisp
milanj has joined #lisp
dmiles has joined #lisp
mulk has quit [Ping timeout: 245 seconds]
zaquest has joined #lisp
mulk has joined #lisp
<White_Flame>
aeth: generally the parser does not optimize. Once you have the parse tree or AST or whatever, then you perform that sort of analysis in the compiler
shidima has joined #lisp
jessup has joined #lisp
Folkol has quit [Read error: Connection reset by peer]
Folkol has joined #lisp
nowhere_man has joined #lisp
crystalball has joined #lisp
hhdave has quit [Ping timeout: 258 seconds]
hhdave has joined #lisp
nowhere_man has quit [Ping timeout: 272 seconds]
zooey has quit [Remote host closed the connection]
zooey has joined #lisp
SaganMan has quit [Ping timeout: 248 seconds]
hhdave has quit [Ping timeout: 248 seconds]
<aeth>
White_Flame: but is +++++ add 1 5 times (optimize after the parser) or add 5?
glv has quit [Remote host closed the connection]
hhdave has joined #lisp
<White_Flame>
I guess that depends on if that concatenation is a lexical construct, a parser construct, or neither
t58 has quit [Quit: Leaving]
<White_Flame>
obviously your language definition could demand that at any level, or leave it optional for the compiler to optimize. It would be fairly transparent to the actual source code, but not to implementers
<White_Flame>
or metaprogrammers dealing with AST-ish structures
v88m has quit [Ping timeout: 268 seconds]
xantoz has quit [Quit: WeeChat 2.4]
xantoz has joined #lisp
bendersteed has joined #lisp
notzmv has joined #lisp
Bike has joined #lisp
bendersteed has quit [Read error: Connection reset by peer]
bendersteed has joined #lisp
djeis[m] has joined #lisp
bendersteed has quit [Remote host closed the connection]
random-nick has joined #lisp
techquila has quit [Remote host closed the connection]
<pfdietz_>
That, and ~x in format, print the digits in upper case.
sauvin has quit [Ping timeout: 272 seconds]
<pfdietz_>
(anyway. base, not radix)
<Bike>
(format nil "~(~x~)" 10) => "a"
<Bike>
stupid, i admit
<pfdietz_>
Heh
<Bike>
i think that first prints to an internal string and then string downcases it
<Bike>
dunno if that matters
<sjl>
(format nil "~(~vr~)" 16 255)
<ck_>
does your lisp implementation offer anything, pfdietz_? Allegro CL has something called Case Mode, but I don't have one and can't check whether it applies to numbers
<Bike>
i don't think there's a flag you can use, if you're worried about doing this in the middle of some structure
_leb has quit []
random-nick has quit [Read error: Connection reset by peer]
<aeth>
Works until |+ONE HUNDRED+| which seems to be the first space, at least on SBCL.
<aeth>
my bad, it's progn ,@
semz has joined #lisp
rdh has joined #lisp
donotturnoff has quit [Remote host closed the connection]
<semz>
Is there a standard way to get a nicely behaved nested REPL? (loop (print (eval (read)))) doesn't integrate well with SLIME and while I could of course mess with SLIME directly, it would be nice if it worked in a normal Lisp shell as well.