<< 17-06-2013 >>

01:34:09*Araq_ quit (Read error: Connection timed out)
01:35:28*Araq_ joined #nimrod
02:00:19*Trixar_za is now known as Trix[a]r_za
02:16:29*Araq_ quit (Read error: Connection timed out)
02:18:26*Araq_ joined #nimrod
02:21:14*Trix[a]r_za quit (Ping timeout: 255 seconds)
02:23:21*Trix[a]r_za joined #nimrod
02:37:22*Araq_ quit (Read error: Connection timed out)
02:38:25*Araq_ joined #nimrod
03:04:08*Araq_ quit (Read error: Connection timed out)
03:05:22*Araq_ joined #nimrod
03:12:53*Trix[a]r_za quit (Ping timeout: 240 seconds)
03:29:54*Trix[a]r_za joined #nimrod
03:41:39*OrionPK quit (Quit: Leaving)
03:54:06*XAMPP joined #nimrod
04:48:26*ARCADIVS joined #nimrod
05:10:49*zz_fowl is now known as fowl
05:27:15*Araq_ quit (Read error: Connection timed out)
05:28:23*Araq_ joined #nimrod
06:10:02*q66 joined #nimrod
08:34:32*EXetoC joined #nimrod
08:42:05*Araq_ quit (Read error: Connection timed out)
08:44:24*Araq_ joined #nimrod
08:53:16*zahary_ joined #nimrod
09:11:56EXetoCAraq: calling this function "proc init*() {.importc: "ao_initialize", dynlib: "libao.so"}" results in "ERROR: Failed to load plugin /usr/lib/ao/plugins-4/libalsa.so => dlopen() failed". do you know why this might happen? I don't know how nimrod does dynamic loading, but could it really have an effect on some external lib?
09:46:13AraqEXetoC: "ERROR: Failed to load plugin /usr/lib/ao/plugins-4/libalsa.so" is an error that already comes from ao_initialize
09:46:24Araqso calling that works already I think
09:46:52Araqlooks like you have some installation problem; maybe you installed only the 32bit version on a 64 bit system or something like that?
09:48:03Araqyou can try to link statically against libao.so but I don't think it will change anything
09:51:44EXetoCAraq: dom96 said something about static linking, and I too thought it wouldn't help, but that's the only difference between this wrapper and the one I wrote in D
09:51:57Araqnope
09:52:03EXetoCbut linking statically solved it. thanks
09:52:07Araqyour D compiler could default to 32bit
09:53:24Araqhmm perhaps static linking changes the search path for libs
09:53:32AraqI have to leave, bbl
09:54:17EXetoCyeah
09:54:19EXetoClater!
10:03:09*Araq_ quit (Read error: Connection timed out)
10:04:25*Araq_ joined #nimrod
10:22:02*fowl is now known as zz_fowl
11:06:13*Araq_ quit (Read error: Connection timed out)
11:08:22*Araq_ joined #nimrod
12:22:21*Endeg quit (Read error: Connection reset by peer)
12:22:53*apotheon_ joined #nimrod
12:24:06*apotheon quit (Ping timeout: 264 seconds)
13:15:32*Trix[a]r_za is now known as Trixar_za
13:31:50*Araq_ quit (Read error: Connection timed out)
13:32:22*Araq_ joined #nimrod
13:55:15EXetoC"samples[i] = int16(32767 - random(32767))" int16 rather than cast[int16] results in a segfault. it also works if I keep the first statement, but invoke the cast on the next statement
13:55:22EXetoCmemory corruption? will create a test case later
14:11:25*Araq_ quit (Read error: Connection timed out)
14:12:23*Araq_ joined #nimrod
14:33:38*apotheon_ is now known as apotheon
14:33:39*apotheon quit (Changing host)
14:33:39*apotheon joined #nimrod
14:49:37*Araq_ quit (Read error: Connection timed out)
14:50:23*Araq_ joined #nimrod
14:55:12*Trixar_za is now known as Trix[a]r_za
14:55:47*ARCADIVS quit (Quit: WeeChat 0.3.8)
15:23:17AraqEXetoC: var xxx = int16(32767 - random(32767)); echo xxx
15:23:20Araqworks for me
15:37:43*Araq_ quit (Read error: Connection timed out)
15:38:23*Araq_ joined #nimrod
15:46:28EXetoCit happens before that even, but it depends on it being there
15:51:12Araqyou're talking about a runtime crash, right? not about the compiler crashing?
15:53:26EXetoCAraq: yes
15:53:59EXetoCit depends on two things being there even. might be hard to reduce
15:54:20Araqpastebin your code if it's small enough
16:34:05*DAddYE joined #nimrod
16:38:13EXetoCAraq: it currently depends on ao though
16:38:16EXetoChttps://gist.github.com/anonymous/92b09d474ceb92996eb3
16:38:40EXetoCfails on line 100
16:42:52EXetoCthis is the exact error message "SIGSEGV: Illegal storage access. (Attempt to read from nil?)". I found something relevant on github before. I've now commented out everything other than the offending statement in newDevice, and I still get that
16:46:33EXetoC"samples[i] = int16(get() + get())" and "samples[i] = int16(1 + get())" fails int16(1) and int16(1 + 1) for example doesn't
16:46:39EXetoCand yes it still fails on line 100
16:48:00EXetoCneither does int16(get())
16:50:25*Araq_ quit (Read error: Connection timed out)
16:52:25*Araq_ joined #nimrod
17:07:47AraqEXetoC: your gist link doesn't work for me
17:09:49EXetoCAraq: https://gist.github.com/EXetoC/5798460 now?
17:23:01Araqvar samples = newSeq[int16](44_100 * 2) # I'm not sure this should work right now
17:23:03Araqtry:
17:23:16Araqvar samples = newSeq(int16, 44_100 * 2)
17:23:19Araqor:
17:23:29Araqvar samples: seq[int16]
17:23:35AraqnewSeq(samples, ...)
17:29:28Araq err = "No audio driver named %" % [$driver] # also wrong btw
17:29:40Araqmake that: err = "No audio driver named $#" % [$driver]
17:31:37EXetoCI think it substituted that % at some point. will try out those changes in a minute
17:50:09EXetoCAraq: "main.nim(10, 23) Error: type mismatch: got (typedesc[int16], int literal(88200)) but expected one of: system.newSeq(s: var seq[T], len: int) system.newSeq(len: int): seq[T]"
17:52:05EXetoCand that's with the second one. is the first supposed to work?
17:53:53EXetoCnevermind. they appear to be the same thing
18:05:48EXetoCin which case it seems like it implicitly passes the default value of said type
18:08:26EXetoCwhich is kind of like an rvalue that is typed as 'var'. is that possible when some arbitrary value is needed though, or is creating a temporary variable the only way?
18:48:07dom96when you write newSeq[int16] you are instantiating the T with a type of 'int16'.
18:49:02dom96In the case of Araq's third example at the point where newSeq is seen by the compiler it knows that 'samples' is a seq[int16]
18:50:07dom96Araq's second example probably doesn't work because proc newSeq(typ: typedesc, size: int): seq[typ] does not exist.
18:50:35Araqyeah indeed
18:50:53AraqEXetoC: you can't pass an rvalue to a 'var' parameter, only an lvalue
18:51:44Araqin the worst case this means you need to pass an explicit temporary but this never happens for me
18:52:24EXetoCI needed that once, but w/e it's a minor thing
18:52:34EXetoCanyway, none of the examples worked, but I'll try again
18:53:51AraqI've no idea why this fails: result.device = ao_open_live(driverid, addr(fmt.val), nil) # SIGSEGV here.
18:58:11Araqoh
18:58:17EXetoCdom96: my approach worked, and the others didn't
18:58:26Araqyour ao_sample_format is wrong
18:58:35EXetoCok
18:58:39Araqthe last should be: matrix: cstring
18:58:57Araqthat would explain the sigsegv
18:59:25EXetoCoops. how come I wrote cchar everywhere? :E will try again
18:59:43*tumak_ quit (Ping timeout: 245 seconds)
19:00:18*zz_fowl is now known as fowl
19:00:27Araqyou should use c2nim :P
19:01:05*tumak joined #nimrod
19:03:24EXetoCfaceplam
19:03:28EXetoCyup, that seems to work
20:10:40reactormonkAraq, does the exception returned by newException have anything added while runtime?
20:13:56Araqreactormonk: yeah the stack trace is set and so is the type name
20:14:22reactormonkAraq, hmmmm
20:15:19reactormonkAraq, ok, good, I've seen that code. But why do you set the string at runtime?
20:15:46Araqwhich string?
20:15:56reactormonkthe type name
20:16:22Araqease of implementation I think
20:16:27reactormonkkk
20:31:17*Trix[a]r_za is now known as Trixar_za
22:06:14*OrionPK joined #nimrod
22:16:40EXetoCthere's no type that makes the distinction between length and capacity, right?
22:18:04fowleh
22:18:12fowlwhat u mean by make distinction
22:18:21fowlstrings and sequences have lengths and capacities
22:20:02reactormonkEXetoC, all collections make a distinction, but you should not rely on the capacity
22:25:34EXetoCreactormonk: where? I haven't found anything of relevance
22:26:00reactormonkEXetoC, length is what you can query with len(). Capacity is an implementation detail
22:27:20fowlnewString() vs newStringOfCap()
22:27:34EXetoCthat's the only explicit example I've found
22:28:22fowlcapacity is how many can be stored before a realloc is needed
22:29:41EXetoCreactormonk: makes sense. I just want to pre-allocate, while still having a length of zero initially. are there any guarantees regarding the capacity when calling setLen?
22:30:01EXetoCbecause if there is then it's just a matter of calling newSeq and then setLen(0)
22:30:19fowldont do it that way, its silly
22:30:36fowlresults = newSeq[int](10)
22:30:39fowlresults[0] = ..
22:30:45fowlresults[1] = ..
22:30:52fowl(or in a loop, w/e)
22:31:01EXetoCI don't necessarily want to initialize right after
22:31:30fowlyou arent gaining anything by doing it the way you suggested
22:31:46fowlif you want to save an allocation, prealloc with newseq(num)
22:47:04EXetoCfowl: yeah, but the answer to my question is still no
22:47:09EXetoCnot that I have such high requirements
22:50:41*DAddYE quit (Remote host closed the connection)
22:51:17*DAddYE joined #nimrod
22:51:24*fowl is now known as zz_fowl
22:55:40EXetoCAraq: are enough details exposed to users such that sequences can be treated as basic std::vector'ish types?
23:01:50EXetoCI guess not. Maybe I'll have a go at implementing such a type when I know the language better
23:03:06*Araq__ joined #nimrod
23:04:23*Araq_ quit (Ping timeout: 240 seconds)
23:25:05*q66 quit (Remote host closed the connection)
23:32:46reactormonkAraq, any opinion on that new repo?
23:49:05*Araq__ quit (Read error: Connection timed out)
23:50:28*Araq_ joined #nimrod