<no-defun-allowed>
is there a print depth variable which has the levels of recursion that the printer has done to get to print the current object?
<no-defun-allowed>
eg in (a (b c)) when it's printing c it might be 1
<beach>
Not in the standard.
<beach>
LdBeth: What is wrong with the existing implementation?
<no-defun-allowed>
damn! i guess i could wrap my own depth value since the conditions when it'll be printed shouldn't be too broad
<Bike>
you can bind *print-depth* but it'll just replace compound objects at that depth with # or something
<djeis[m]>
`...`
<no-defun-allowed>
yeah, i'm trying to make the CL printer emit LLVM representations out of boredom
<LdBeth>
beach: it expands to a DEFUN handle-event-fun-'mode'-'keyword', and uses frequent unintern & intern symbols in keyword packages to archive something close OOP paradigm
<no-defun-allowed>
so if we recurse into something like an arithmetic operator, we have to make another line before the current line
<LdBeth>
*Achieve
<beach>
LdBeth: OK.
Lord_of_Life has quit [Ping timeout: 246 seconds]
<no-defun-allowed>
no, that idea won't work, nvm
<beach>
Does it have to be printed with CL:PRINT?
<no-defun-allowed>
well, it'd be nice to do so since i could examine results using the usual REPL stuff, but it's not necessary
<no-defun-allowed>
i suppose to print a LLVM instruction though, i have to check if any arguments in the instruction are instructions themselves and create temporary values for them at least
wxie has quit [Ping timeout: 240 seconds]
<beach>
What are you working on?
<beach>
I am just curious, not trying to help out. :)
Lord_of_Life has joined #lisp
<no-defun-allowed>
well, my strange smalltalk-lookalike parser worked out alright so i wanted to make a compiler for the parser :P
<no-defun-allowed>
since i did write out some examples that i'd test the parser with, and they look pretty good and readable to me
dale has quit [Quit: dale]
<no-defun-allowed>
my first plan was to write a compiler to C, but i realised it wouldn't work too nicely for local variables and mutating code, and i found out LLVM had GC hooks too
marvin3 has quit [Ping timeout: 246 seconds]
marvin2 has joined #lisp
gravicappa has joined #lisp
pjb has quit [Ping timeout: 252 seconds]
jason_m has quit [Ping timeout: 240 seconds]
ntbre has quit [Quit: Leaving]
Oladon has quit [Quit: Leaving.]
<no-defun-allowed>
however, i could do that printer trick, but if i temporarily rewrite the values in an operator
notzmv has quit [Ping timeout: 272 seconds]
notzmv has joined #lisp
dale has joined #lisp
iovec has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #lisp
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
<beach>
It used to be easy to produce simple sounds on GNU/Linux, but I don't know how to do it anymore. I only need it for some testing purposes, so does anyone know a simple way of producing short sound snippets from, say, SBCL? Specifically, I need to know how to open (and perhaps initialize) a sound device.
<LdBeth>
beach: you mean OSS's /dev/dsp? it is depreciated by ALSA
<beach>
LdBeth: That appears to be the case.
<beach>
Linux sound seems to be a disaster.
<beach>
But don't get me started on that. I just need to generate a sine wave from Common Lisp and listen to it.
<LdBeth>
There's a package called alsa-oss provide that device, you'd be able to find it in Ubuntu's package manager
<beach>
Oh, that would be the thing to do. Thanks.
<no-defun-allowed>
beach: I used the program `aplay` and fed bytes to it to make noise.
<no-defun-allowed>
As a silly example, `aplay /dev/urandom` plays white noise.
<beach>
Oh, I guess I could do something like that. Start a program from Common Lisp and pipe things to it. That's what you mean right?
<no-defun-allowed>
Yes.
<aeth>
beach: Linux sound is a disaster, so you're right.
<no-defun-allowed>
When aplay isn't around, sox also has a `play` tool which needs more context about what's being given to it (as it doesn't default to 8khz/u8/mono), but it's probably more portable.
<no-defun-allowed>
aeth: PulseAudio is probably the worst sound system ever created.
<beach>
I think I have enough information to try some things.
<no-defun-allowed>
I used to hate JACK, but I can at least get the latency under 20ms nowadays.
<aeth>
This could be an interesting low-level Common Lisp project, perhaps? Conventional wisdom would say that a GCed language would be bad at this sort of thing.
<LdBeth>
There's Common Lisp Music
<no-defun-allowed>
My laptop makes enough x-runs without a GCed language. You'd have to be really careful with consing.
<aeth>
Well, it's all about the latency.
krwq has joined #lisp
<no-defun-allowed>
AFAIK, to drop down below 10ms-ish, you need a "realtime" Linux kernel which probably switches contexts much faster.
<LdBeth>
well idon't care much about latency but recently pulseauido just hangs 100% CPU sometimes
<beach>
Interestingly, CLOSOS could be made to have very fast context switches, since it doesn't need to trap to supervisor mode, doesn't need to remap the address space, and doesn't need to flush the cache.
<beach>
So, maybe I should push CLOSOS as an OS for working with real-time sound processing.
<no-defun-allowed>
I was going to bring up that model, actually. The program would effectively be writing to the sound card/DAC/output device itself.
<beach>
Oh, aplay takes floating-point samples. No need to convert in Common Lisp.
<|3b|>
there are also tricks with masking off a core or 2, migrating tasks off it, then moving your process onto that core for doing things where linux scheduler is bad, though still need to deal with GC for lisp things
<no-defun-allowed>
aplay takes binary data, so you need to pack the number either way
<LdBeth>
good to hear that, because I didn't figure out how to play proper sound with dev/dsp when I was using FreeBSD
<beach>
The other thing, of course, is that, since CLOSOS is based on SICL, and SICL has a parallel concurrent GC with a nursery collection taking a few ms at most, the GC would be a problem here.
<beach>
no-defun-allowed: I'll just open the output stream with a float element type.
<beach>
I am pretty sure I have done that in the past.
<no-defun-allowed>
You can do that? O.o
<no-defun-allowed>
I guess I don't have to pack my samples anymore.
<beach>
Unless I dreamed that, yes I think so.
<|3b|>
implementation specific results if i remember correctly,but usually what you expect
Bike has quit [Quit: Lost terminal]
<|3b|>
(for files that is, running programs is implementation extension anyway, but pretty sure you can do that there too)
<beach>
OK, so now I just have to figure out how to run an external program and pipe data to it.
<|3b|>
for sbcl, sb-ext:run-program, and ask for a stream for stdin of the process i think
<LdBeth>
beach: make a fifo
* |3b|
isn't sure which of the portability wrappers let you leave the process running in the background
<beach>
Sounds easy. But I always get in trouble when I try things like that.
<beach>
LdBeth: You assume that I know how to do these things. Not so. I shall have to dig a bit.
<LdBeth>
A fifo in unix is a named pipe, you create one with mkfifo, and have aplay read it and have common lisp write to the fifo just as writing a regular file
<beach>
Oh, that's an idea. Thanks.
<|3b|>
yeah, that might be easier, not seeing a way to set element type of streams from run-program
<beach>
Hmm.
<no-defun-allowed>
Okay, that printer hack did work. Funny that.
ahungry has quit [Remote host closed the connection]
ebrasca has joined #lisp
dddddd has quit [Remote host closed the connection]
* |3b|
wonders how many currently interesting implementations could be made to reasonably efficiently share memory between specialized arrays of different element types (either using existing displaced array, or something else)
<|3b|>
or alternately, copy the memory between arrays of different specialized element types
<|3b|>
not that i have time to investigate, specify, and promote such an extension in either case :/
sword has joined #lisp
rippa has joined #lisp
<|3b|>
similarly ability to write any type of sequence to ub8 streams as if it were a ub8 sequence would be nice
* |3b|
should probably go back to what i'm actually working on rather than continuing to think about that though
wxie has joined #lisp
<beach>
I forget how to write a floating-point value to a stream with element-type double-float.
<beach>
write-byte requires an integer.
<no-defun-allowed>
Maybe write-sequence has a trick for it?
<beach>
Hmm, that seems twisted.
<beach>
I am pretty convinced I have done this in the past.
travv0 has joined #lisp
<beach>
I can't believe this!
<beach>
Oh, well, I'll convert to 16-bit integers.
<beach>
IT WORKS! So aplay + fifo + RUN-PROGRAM is a workable solution. Thanks LdBeth, no-defun-allowed, |3b|.
<no-defun-allowed>
no problem :)
<no-defun-allowed>
hah, one of the first CL projects i did was a simple synthesiser
<|3b|>
does aplay just idle if there is no input on fifo, and continue when there iis?
<no-defun-allowed>
yes, but it writes to stderr that there was an underrun
pillton has quit [Read error: Connection reset by peer]
<|3b|>
cool
<no-defun-allowed>
let's see, i did additive, subtractive and phase synthesis
* |3b|
wants to write a synth one day, pretty far down the list though :(
<no-defun-allowed>
and there was a silly celluar automaton-based song "generator" which is quite terrible but still half-impressive i think
<|3b|>
along with the whole "learn to music" thing
<beach>
|3b|: Good question. When I cat a file to it, it exist after that. But when I do WITH-OPEN-FILE it waits for the next batch of samples.
<|3b|>
i figure i'd probably do as well with teaching the computer to compose/perform as learning to do it myself, so song generator would be in there too if i ever get to that point
mrcom has quit [Read error: Connection reset by peer]
<beach>
Er, it "exits" after that.
mrcom has joined #lisp
<no-defun-allowed>
I was half-inspired by http://tones.wolfram.com/ but I didn't have their magic apparently, so the result I have is less impressive.
meepdeew has quit [Remote host closed the connection]
dale has quit [Quit: dale]
stereosphere has quit [Read error: Connection reset by peer]
otirc has quit [Remote host closed the connection]
torbo has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 245 seconds]
Lycurgus has joined #lisp
whartung has quit [Ping timeout: 250 seconds]
iovec has joined #lisp
shka_ has joined #lisp
pesite has joined #lisp
robdog has quit [Remote host closed the connection]
robdog has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
robdog has joined #lisp
robdog has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
krwq has quit [Remote host closed the connection]
cyraxjoe has joined #lisp
MightyJoe has quit [Ping timeout: 272 seconds]
heisig has joined #lisp
notzmv has quit [Ping timeout: 244 seconds]
robdog has joined #lisp
notzmv has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
orivej has quit [Ping timeout: 258 seconds]
jello_pudding has joined #lisp
robdog has joined #lisp
wxie has quit [Ping timeout: 250 seconds]
pjb has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
random-nick has joined #lisp
glv has joined #lisp
void_pointer has joined #lisp
jello_pudding has quit [Quit: Leaving, Quit]
robdog has joined #lisp
robdog has quit [Ping timeout: 260 seconds]
orivej has joined #lisp
ggole has quit [Ping timeout: 260 seconds]
robotoad has quit [Quit: robotoad]
robdog has joined #lisp
ggole has joined #lisp
robdog has quit [Ping timeout: 268 seconds]
themsay has joined #lisp
robdog has joined #lisp
ggole has quit [Ping timeout: 252 seconds]
undiscovered has joined #lisp
robdog has quit [Ping timeout: 252 seconds]
atgreen has joined #lisp
ggole has joined #lisp
robdog has joined #lisp
ggole has quit [Client Quit]
theBlackDragon has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
orivej has quit [Ping timeout: 245 seconds]
wxie has joined #lisp
Lycurgus has quit [Quit: Exeunt]
igemnace has joined #lisp
scymtym has quit [Ping timeout: 245 seconds]
robdog has joined #lisp
robdog has quit [Remote host closed the connection]
robdog has joined #lisp
smokeink has quit [Remote host closed the connection]
robdog has quit [Ping timeout: 252 seconds]
scymtym has joined #lisp
dddddd has joined #lisp
<phoe>
LdBeth: hm?
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
notzmv has quit [Ping timeout: 244 seconds]
undiscovered has quit [Remote host closed the connection]
notzmv has joined #lisp
wxie has quit [Ping timeout: 258 seconds]
Mr-Potter has joined #lisp
metallicus has joined #lisp
random-nick has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #lisp
orivej has joined #lisp
random-nick has joined #lisp
notzmv has quit [Ping timeout: 258 seconds]
orivej has quit [Ping timeout: 258 seconds]
xkapastel has joined #lisp
mulk has joined #lisp
Bike has joined #lisp
varjag has joined #lisp
McParen has joined #lisp
mulk has quit [Ping timeout: 272 seconds]
mulk has joined #lisp
MichaelRaskin has joined #lisp
moei has quit [Ping timeout: 246 seconds]
Zaab1t has joined #lisp
notzmv has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
SaganMan has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
atgreen has quit [Ping timeout: 240 seconds]
karlosz has joined #lisp
actuallybatman has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
FreeBirdLjj has quit [Remote host closed the connection]
SaganMan has left #lisp ["WeeChat 1.6"]
heisig has quit [Ping timeout: 252 seconds]
Lycurgus has joined #lisp
notzmv has quit [Ping timeout: 250 seconds]
Oladon has joined #lisp
notzmv has joined #lisp
pesite has quit [Ping timeout: 250 seconds]
orivej has joined #lisp
Mr-Potter has quit [Read error: Connection reset by peer]
Mr-Potter has joined #lisp
mrcom has quit [Read error: Connection reset by peer]
mrcom has joined #lisp
mulk has quit [Ping timeout: 272 seconds]
mulk has joined #lisp
mrcom has quit [Read error: Connection reset by peer]
mrcom has joined #lisp
scymtym has quit [Ping timeout: 260 seconds]
asarch has joined #lisp
scymtym has joined #lisp
dddddd has quit [Ping timeout: 245 seconds]
akoana has joined #lisp
Grauwolf has joined #lisp
dddddd has joined #lisp
themsay has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 250 seconds]
robotoad has joined #lisp
robotoad has quit [Read error: Connection reset by peer]
Josh_2 has joined #lisp
anewuser has joined #lisp
robotoad has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
karlosz has quit [Client Quit]
karlosz has joined #lisp
noloop has joined #lisp
Josh_2 has quit [Remote host closed the connection]
mulk has quit [Ping timeout: 272 seconds]
mulk has joined #lisp
Selwyn has joined #lisp
Lycurgus has quit [Quit: Exeunt]
kajo has joined #lisp
gxt has quit [Quit: WeeChat 2.3]
McParen has left #lisp [#lisp]
Zaab1t has quit [Ping timeout: 268 seconds]
Zaab1t has joined #lisp
Zaab1t has quit [Client Quit]
gxt has joined #lisp
Josh_2 has joined #lisp
bexx has quit [Read error: Connection reset by peer]
random-nick has quit [Read error: Connection reset by peer]
bexx has joined #lisp
Josh_2 has quit [Remote host closed the connection]
lavaflow has quit [Ping timeout: 246 seconds]
X-Scale has quit [Ping timeout: 245 seconds]
X-Scale` has joined #lisp
Josh_2 has joined #lisp
X-Scale` is now known as X-Scale
mulk has quit [Ping timeout: 244 seconds]
mulk has joined #lisp
yvy has joined #lisp
nowhere_man has quit [Ping timeout: 252 seconds]
nowhere_man has joined #lisp
<asarch>
I have this code: http://paste.scsys.co.uk/582760 and I get "NIL fell through ECASE expression." What's wrong? (I'm trying to create an empty CLIM window)
<jackdaniel>
that said this error message is bad, feel free to report a bug on that
random-nick has joined #lisp
<aeth>
jackdaniel: sounds like a simple check could be placed there to give a more helpful error message? Just a simple (when (null pane) (error "You don't have any pane. Try inserting (:pane :application)")) above the ecase?
<jackdaniel>
yes, something like that
<aeth>
I guess also (unless pane ...) could work
<no-defun-allowed>
(when (null pane) ...)
<asarch>
null?
<asarch>
Shouldn't be nil?
<aeth>
I usually use unless as a simplification for (when (not foo) ...) not for (when (null foo) ...) which is why I didn't notice it at first
<aeth>
asarch: NULL is exactly the same thing as NOT except semantically it's for this sort of thing rather than for logical negation.
<aeth>
asarch: and yes, it should be "NIL?" but "NILP" would have worked too.
<jackdaniel>
this doesn't matter, it will be probably (when (null panes) …), because pane option (which is mutually exclusive with panes) is ensure-list'ed to panes
<aeth>
"The fact that too many implementation details were leaking at a higher level, i.e. showing up too much" and "Code that uses intimate knowledge."
<Josh_2>
0==()
<Josh_2>
plez no ban
<aeth>
that somehow has more votes than the actual answer
<aeth>
(20 vs 18)
<Josh_2>
I don't understand what they mean by leaking implementation details at a higher level
<Josh_2>
is that like print being implementation specific instead of something like mutexes?
<aeth>
Josh_2: NIL doesn't have to be 0 internally and it isn't in most modern implementations.
karlosz has quit [Quit: karlosz]
<aeth>
From (defun foo () NIL) (disassemble #'foo) it looks like my SBCL version's NIL is #x20100017
<aeth>
And I just pulled up a more recent SBCL and I get #x50100017 as NIL in the same commented line.
<aeth>
Compare with (defun bar () 42) (disassemble #'bar) and you see it's definitely a number (there, 42 is 84)
<pjb>
notice that in C, union { void* p; intptr_t i; } u; u.p=0; i==0 may be false.
<pjb>
(assuming &p == &i, which may be false too).
mulk has quit [Ping timeout: 268 seconds]
mulk has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
trittweiler has quit [Ping timeout: 250 seconds]
glv has quit [Quit: Leaving]
angavrilov has quit [Remote host closed the connection]