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:56 | EXetoC | Araq: 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:13 | Araq | EXetoC: "ERROR: Failed to load plugin /usr/lib/ao/plugins-4/libalsa.so" is an error that already comes from ao_initialize |
09:46:24 | Araq | so calling that works already I think |
09:46:52 | Araq | looks like you have some installation problem; maybe you installed only the 32bit version on a 64 bit system or something like that? |
09:48:03 | Araq | you can try to link statically against libao.so but I don't think it will change anything |
09:51:44 | EXetoC | Araq: 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:57 | Araq | nope |
09:52:03 | EXetoC | but linking statically solved it. thanks |
09:52:07 | Araq | your D compiler could default to 32bit |
09:53:24 | Araq | hmm perhaps static linking changes the search path for libs |
09:53:32 | Araq | I have to leave, bbl |
09:54:17 | EXetoC | yeah |
09:54:19 | EXetoC | later! |
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:15 | EXetoC | "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:22 | EXetoC | memory 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:17 | Araq | EXetoC: var xxx = int16(32767 - random(32767)); echo xxx |
15:23:20 | Araq | works for me |
15:37:43 | * | Araq_ quit (Read error: Connection timed out) |
15:38:23 | * | Araq_ joined #nimrod |
15:46:28 | EXetoC | it happens before that even, but it depends on it being there |
15:51:12 | Araq | you're talking about a runtime crash, right? not about the compiler crashing? |
15:53:26 | EXetoC | Araq: yes |
15:53:59 | EXetoC | it depends on two things being there even. might be hard to reduce |
15:54:20 | Araq | pastebin your code if it's small enough |
16:34:05 | * | DAddYE joined #nimrod |
16:38:13 | EXetoC | Araq: it currently depends on ao though |
16:38:16 | EXetoC | https://gist.github.com/anonymous/92b09d474ceb92996eb3 |
16:38:40 | EXetoC | fails on line 100 |
16:42:52 | EXetoC | this 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:33 | EXetoC | "samples[i] = int16(get() + get())" and "samples[i] = int16(1 + get())" fails int16(1) and int16(1 + 1) for example doesn't |
16:46:39 | EXetoC | and yes it still fails on line 100 |
16:48:00 | EXetoC | neither does int16(get()) |
16:50:25 | * | Araq_ quit (Read error: Connection timed out) |
16:52:25 | * | Araq_ joined #nimrod |
17:07:47 | Araq | EXetoC: your gist link doesn't work for me |
17:09:49 | EXetoC | Araq: https://gist.github.com/EXetoC/5798460 now? |
17:23:01 | Araq | var samples = newSeq[int16](44_100 * 2) # I'm not sure this should work right now |
17:23:03 | Araq | try: |
17:23:16 | Araq | var samples = newSeq(int16, 44_100 * 2) |
17:23:19 | Araq | or: |
17:23:29 | Araq | var samples: seq[int16] |
17:23:35 | Araq | newSeq(samples, ...) |
17:29:28 | Araq | err = "No audio driver named %" % [$driver] # also wrong btw |
17:29:40 | Araq | make that: err = "No audio driver named $#" % [$driver] |
17:31:37 | EXetoC | I think it substituted that % at some point. will try out those changes in a minute |
17:50:09 | EXetoC | Araq: "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:05 | EXetoC | and that's with the second one. is the first supposed to work? |
17:53:53 | EXetoC | nevermind. they appear to be the same thing |
18:05:48 | EXetoC | in which case it seems like it implicitly passes the default value of said type |
18:08:26 | EXetoC | which 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:07 | dom96 | when you write newSeq[int16] you are instantiating the T with a type of 'int16'. |
18:49:02 | dom96 | In 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:07 | dom96 | Araq's second example probably doesn't work because proc newSeq(typ: typedesc, size: int): seq[typ] does not exist. |
18:50:35 | Araq | yeah indeed |
18:50:53 | Araq | EXetoC: you can't pass an rvalue to a 'var' parameter, only an lvalue |
18:51:44 | Araq | in the worst case this means you need to pass an explicit temporary but this never happens for me |
18:52:24 | EXetoC | I needed that once, but w/e it's a minor thing |
18:52:34 | EXetoC | anyway, none of the examples worked, but I'll try again |
18:53:51 | Araq | I've no idea why this fails: result.device = ao_open_live(driverid, addr(fmt.val), nil) # SIGSEGV here. |
18:58:11 | Araq | oh |
18:58:17 | EXetoC | dom96: my approach worked, and the others didn't |
18:58:26 | Araq | your ao_sample_format is wrong |
18:58:35 | EXetoC | ok |
18:58:39 | Araq | the last should be: matrix: cstring |
18:58:57 | Araq | that would explain the sigsegv |
18:59:25 | EXetoC | oops. 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:27 | Araq | you should use c2nim :P |
19:01:05 | * | tumak joined #nimrod |
19:03:24 | EXetoC | faceplam |
19:03:28 | EXetoC | yup, that seems to work |
20:10:40 | reactormonk | Araq, does the exception returned by newException have anything added while runtime? |
20:13:56 | Araq | reactormonk: yeah the stack trace is set and so is the type name |
20:14:22 | reactormonk | Araq, hmmmm |
20:15:19 | reactormonk | Araq, ok, good, I've seen that code. But why do you set the string at runtime? |
20:15:46 | Araq | which string? |
20:15:56 | reactormonk | the type name |
20:16:22 | Araq | ease of implementation I think |
20:16:27 | reactormonk | kk |
20:31:17 | * | Trix[a]r_za is now known as Trixar_za |
22:06:14 | * | OrionPK joined #nimrod |
22:16:40 | EXetoC | there's no type that makes the distinction between length and capacity, right? |
22:18:04 | fowl | eh |
22:18:12 | fowl | what u mean by make distinction |
22:18:21 | fowl | strings and sequences have lengths and capacities |
22:20:02 | reactormonk | EXetoC, all collections make a distinction, but you should not rely on the capacity |
22:25:34 | EXetoC | reactormonk: where? I haven't found anything of relevance |
22:26:00 | reactormonk | EXetoC, length is what you can query with len(). Capacity is an implementation detail |
22:27:20 | fowl | newString() vs newStringOfCap() |
22:27:34 | EXetoC | that's the only explicit example I've found |
22:28:22 | fowl | capacity is how many can be stored before a realloc is needed |
22:29:41 | EXetoC | reactormonk: 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:01 | EXetoC | because if there is then it's just a matter of calling newSeq and then setLen(0) |
22:30:19 | fowl | dont do it that way, its silly |
22:30:36 | fowl | results = newSeq[int](10) |
22:30:39 | fowl | results[0] = .. |
22:30:45 | fowl | results[1] = .. |
22:30:52 | fowl | (or in a loop, w/e) |
22:31:01 | EXetoC | I don't necessarily want to initialize right after |
22:31:30 | fowl | you arent gaining anything by doing it the way you suggested |
22:31:46 | fowl | if you want to save an allocation, prealloc with newseq(num) |
22:47:04 | EXetoC | fowl: yeah, but the answer to my question is still no |
22:47:09 | EXetoC | not 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:40 | EXetoC | Araq: are enough details exposed to users such that sequences can be treated as basic std::vector'ish types? |
23:01:50 | EXetoC | I 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:46 | reactormonk | Araq, any opinion on that new repo? |
23:49:05 | * | Araq__ quit (Read error: Connection timed out) |
23:50:28 | * | Araq_ joined #nimrod |