00:05:26 | * | girvo quit (Quit: leaving) |
00:07:15 | TEttinger | woah, what is nim-vec? |
00:07:54 | EXetoC | where? |
00:08:23 | def- | TEttinger: the vectorized implementation of the nbody program tstm posted before |
00:08:42 | TEttinger | ah ok |
00:08:52 | TEttinger | not a different nim compiler |
00:08:59 | TEttinger | wow |
00:10:53 | EXetoC | it's a common prefix for bindings |
00:12:17 | EXetoC | but I guess it's a port in this cas |
00:12:19 | EXetoC | e |
00:12:39 | CryptoToad | Guys my hooks are working as they should now |
00:12:42 | CryptoToad | thanks to everyone for your help |
00:13:02 | CryptoToad | def- k1i araq |
00:19:22 | def- | Great, CryptoToad |
00:20:12 | tstm | def-: Of course real men would implement such vector calculus with SoA instead of AoS that I used.. but I'm not quite sure how I would do that in a neat fashion. |
00:21:12 | tstm | You'd have to collect 4 vectors at once and then process the x of all 4 and then the y and so on. |
00:24:33 | * | fizzbooz1 joined #nim |
00:37:17 | * | jholland quit (Quit: Connection closed for inactivity) |
00:41:59 | * | zipR4ND joined #nim |
00:46:07 | * | MyMind quit (Ping timeout: 252 seconds) |
00:50:03 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
00:53:52 | * | CryptoToad quit (Quit: Leaving) |
00:54:04 | * | davidhq joined #nim |
00:56:23 | * | fluoride quit (Ping timeout: 252 seconds) |
00:56:26 | * | MyMind joined #nim |
00:56:40 | * | davidhq quit (Client Quit) |
00:57:03 | * | bcinman quit (Read error: Connection reset by peer) |
00:57:09 | * | bcinman_ joined #nim |
01:02:29 | * | FusionGaming joined #nim |
01:06:35 | * | MyMind quit (Ping timeout: 246 seconds) |
01:14:51 | * | saml_ joined #nim |
01:15:48 | * | reem quit (Remote host closed the connection) |
01:16:30 | * | reem joined #nim |
01:28:43 | * | pregressive joined #nim |
01:32:19 | * | brson joined #nim |
01:34:22 | * | pregress_ joined #nim |
01:35:22 | * | reem quit (Remote host closed the connection) |
01:36:08 | * | pregressive quit (Ping timeout: 252 seconds) |
01:37:38 | * | reem joined #nim |
01:48:41 | * | bcinman_ quit (Read error: Connection reset by peer) |
01:49:07 | * | bcinman joined #nim |
01:49:41 | * | zipR4ND quit (Ping timeout: 265 seconds) |
01:50:10 | * | darkf joined #nim |
02:02:01 | * | fizzbooz1 quit (Ping timeout: 252 seconds) |
02:23:32 | * | reem quit (Remote host closed the connection) |
02:30:47 | * | pregress_ quit (Remote host closed the connection) |
02:34:10 | * | Woflox_ joined #nim |
02:37:03 | * | reem joined #nim |
02:37:57 | * | Woflox quit (Ping timeout: 252 seconds) |
02:40:31 | * | Woflox_ quit (Ping timeout: 252 seconds) |
02:46:15 | * | adu joined #nim |
02:46:22 | adu | hi |
02:50:33 | * | MyMind joined #nim |
02:52:47 | tstm | I'm reading into more SIMD |
02:53:13 | tstm | With changing the data structures, there should still be massive speedups to be had.. but it does get a touch ugly. :P |
03:05:24 | * | reem quit (Remote host closed the connection) |
03:22:07 | * | reem joined #nim |
03:27:04 | * | Woflox joined #nim |
03:27:16 | * | pregressive joined #nim |
03:38:49 | * | wb quit (Ping timeout: 252 seconds) |
03:44:19 | * | bcinman_ joined #nim |
03:45:29 | * | bcinman quit (Ping timeout: 246 seconds) |
03:45:50 | * | Maxdamantus quit (Ping timeout: 246 seconds) |
03:54:30 | * | kjo quit (Quit: Leaving.) |
03:58:50 | * | bcinman_ quit (Ping timeout: 272 seconds) |
04:00:34 | * | bcinman joined #nim |
04:06:09 | * | reem quit (Remote host closed the connection) |
04:08:00 | * | reem joined #nim |
04:20:46 | * | pregressive quit (Remote host closed the connection) |
04:24:41 | * | reem quit (Remote host closed the connection) |
04:31:14 | adu | tstm: I know a bit about simd |
04:37:05 | * | reem joined #nim |
04:40:03 | * | reem quit (Remote host closed the connection) |
04:45:25 | * | reem joined #nim |
04:55:19 | * | saml_ quit (Quit: Leaving) |
04:56:20 | * | brson quit (Ping timeout: 252 seconds) |
05:00:05 | * | reem quit (Remote host closed the connection) |
05:01:00 | * | reem joined #nim |
05:09:22 | * | Senketsu quit (Read error: Connection reset by peer) |
05:11:44 | * | Senketsu joined #nim |
05:13:34 | * | mwbrown quit (Ping timeout: 252 seconds) |
05:18:38 | * | Woflox quit (Ping timeout: 272 seconds) |
05:26:33 | * | adu quit (Quit: adu) |
05:49:25 | * | fizzbooze quit (Ping timeout: 265 seconds) |
05:57:38 | * | dtscode quit (Ping timeout: 265 seconds) |
06:33:24 | * | epichero quit (Remote host closed the connection) |
06:33:25 | * | gsingh93 quit (Ping timeout: 255 seconds) |
07:32:15 | * | BlaXpirit joined #nim |
07:34:01 | * | dtscode joined #nim |
07:38:29 | * | nande quit (Remote host closed the connection) |
07:49:08 | * | Ven joined #nim |
08:02:07 | * | Ven quit (Ping timeout: 264 seconds) |
08:18:15 | * | Ven joined #nim |
08:46:32 | * | allan0 joined #nim |
08:57:55 | * | fluoride joined #nim |
08:58:38 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
09:09:10 | * | dtscode quit (Ping timeout: 272 seconds) |
09:24:31 | * | xificurC joined #nim |
09:28:55 | * | fluoride quit (Ping timeout: 255 seconds) |
09:31:24 | * | BlaXpirit_ joined #nim |
09:32:06 | * | Aszarsha joined #nim |
09:34:16 | * | BlaXpirit quit (Ping timeout: 252 seconds) |
09:53:13 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
09:59:44 | * | reem quit (Remote host closed the connection) |
10:03:00 | * | Aszarsha quit (Ping timeout: 272 seconds) |
10:24:52 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:26:27 | * | matkuki joined #nim |
10:27:33 | matkuki | Is there a quick way to iterate a sequence in reverse? I couldn't find it in the docs. |
10:33:01 | tstm | matkuki: for i in 10..1 |
10:33:12 | tstm | matkuki: http://nim-lang.org/tut1.html#for-statement |
10:33:54 | matkuki | tstm: I didn't think about the manual, thanks! |
10:35:43 | matkuki | tstm: But 'for i in 10..1' doesn't work with Nim 0.10.3? |
10:37:18 | flaviu | .eval for i in 10..1: stdout.write($i) |
10:37:21 | Mimbus | flaviu: <no output> |
10:37:41 | matkuki | Mimbus: Exactly. |
10:37:57 | flaviu | .eval for i in countdown(10, 1): stdout.write($i) |
10:37:58 | Mimbus | flaviu: 10987654321 |
10:38:33 | tstm | matkuki: Well, the countdown(10,1) seems to work. |
10:38:40 | tstm | Yeah. |
10:38:42 | tstm | Too late. :D |
10:39:44 | matkuki | tstm: I first tried '10..1'. Seems more Nim-ish, but hey. 'countdown' works to. |
10:40:28 | matkuki | But 'for i in 10..1' shouldn't compile then. |
10:41:09 | flaviu | sure it should. i = 10; while i < 1; yield i; inc i |
10:42:22 | flaviu | https://github.com/Araq/Nim/blob/master/lib/system.nim#L1574-L1579 |
10:42:41 | * | epichero joined #nim |
10:43:42 | matkuki | flaviu: Ok, sorry. But it's very counter-intuitive. |
10:45:00 | * | johnsoft quit (Ping timeout: 256 seconds) |
10:45:04 | flaviu | I agree. It'd be a good candidate for checking by a lint tool. |
10:46:20 | * | johnsoft joined #nim |
10:47:59 | * | arnetheduck joined #nim |
10:57:04 | * | davidhq joined #nim |
11:17:08 | * | matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0.1/20150305021524]) |
11:17:11 | * | zipR4ND joined #nim |
11:50:12 | * | Ven joined #nim |
11:52:16 | * | wb joined #nim |
12:04:28 | * | Trustable joined #nim |
12:16:29 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:17:58 | * | Maxdamantus joined #nim |
12:20:36 | * | Ven quit (Read error: Connection reset by peer) |
12:21:46 | * | Ven joined #nim |
12:28:26 | * | irrequietus joined #nim |
12:28:32 | * | mwbrown joined #nim |
12:41:18 | * | banister joined #nim |
12:41:22 | * | banister quit (Max SendQ exceeded) |
12:42:05 | * | zahary quit (Read error: Connection reset by peer) |
12:42:11 | * | zahary1 joined #nim |
12:51:40 | * | banister joined #nim |
12:55:47 | * | TEttinger quit (Ping timeout: 252 seconds) |
12:58:43 | * | Etheco quit (Quit: Leaving) |
13:00:22 | * | reem joined #nim |
13:00:45 | * | pregressive joined #nim |
13:02:42 | * | pregressive quit (Remote host closed the connection) |
13:03:31 | * | epichero quit (Remote host closed the connection) |
13:05:23 | * | reem quit (Ping timeout: 265 seconds) |
13:13:10 | * | mwbrown quit (Ping timeout: 252 seconds) |
13:21:22 | * | davidhq quit (Quit: Textual IRC Client: www.textualapp.com) |
13:23:22 | * | davidhq joined #nim |
13:33:14 | * | OderWat quit (Quit: Textual IRC Client: www.textualapp.com) |
13:33:46 | * | OderWat joined #nim |
13:48:50 | * | Woflox joined #nim |
13:48:56 | * | mpthrapp_ joined #nim |
13:55:19 | * | pregressive joined #nim |
13:55:24 | * | pregressive quit (Remote host closed the connection) |
13:56:10 | * | pregressive joined #nim |
13:56:41 | * | pregressive quit (Remote host closed the connection) |
13:57:24 | * | pregressive joined #nim |
13:58:16 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:06:24 | * | banister joined #nim |
14:06:29 | * | banister quit (Max SendQ exceeded) |
14:07:08 | * | zipR4ND quit (Ping timeout: 246 seconds) |
14:07:30 | * | banister joined #nim |
14:18:51 | * | irrequietus quit (Ping timeout: 265 seconds) |
14:19:23 | * | epichero joined #nim |
14:24:10 | * | epichero quit (Ping timeout: 265 seconds) |
14:29:33 | * | davidhq quit (Quit: Textual IRC Client: www.textualapp.com) |
14:32:21 | * | BroseROC joined #nim |
14:32:54 | * | davidhq joined #nim |
14:38:37 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:40:04 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:55:29 | * | OderWat quit (Quit: Textual IRC Client: www.textualapp.com) |
15:12:36 | * | irrequietus joined #nim |
15:13:14 | * | mpthrapp_ quit (Ping timeout: 246 seconds) |
15:14:01 | * | mpthrapp_ joined #nim |
15:20:04 | * | epichero joined #nim |
15:20:44 | * | jholland joined #nim |
15:23:03 | * | darkf quit (Quit: Leaving) |
15:25:05 | * | epichero quit (Ping timeout: 256 seconds) |
15:44:38 | * | sepisoad joined #nim |
15:50:50 | * | davidhq joined #nim |
15:58:26 | * | BroseROC quit (Quit: Leaving) |
16:01:33 | * | banister joined #nim |
16:02:39 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:14:01 | * | Ven joined #nim |
16:19:07 | * | BitPuffin joined #nim |
16:34:15 | * | bcinman joined #nim |
16:43:43 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
16:45:58 | * | xificurC quit (Ping timeout: 256 seconds) |
16:50:15 | * | gsingh93 joined #nim |
16:51:52 | * | brson joined #nim |
16:53:27 | * | Matthias247 joined #nim |
16:56:50 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:00:16 | * | epichero joined #nim |
17:17:07 | * | sepisoad quit (Quit: Leaving) |
17:22:58 | * | epichero quit (Read error: Connection reset by peer) |
17:23:36 | * | epichero joined #nim |
17:35:43 | * | johnsoft quit (Ping timeout: 264 seconds) |
17:37:11 | k1i | bitwise and on unsigned ints |
17:37:31 | k1i | system.and isn't implemented on unsigned types - should it be |
17:39:46 | EXetoC | k1i: import unsigned |
17:44:47 | k1i | ty |
17:48:33 | k1i | interfacing with C: proc(arrayOfUints: pointer, count: csize) - I cannot make the cast of var x: array[count, uint] = arrayOfUints[] as count isn't known at compile time - can this check be disabled? |
17:49:54 | k1i | interfacing with C: proc(arrayOfUints: pointer, count: csize) - I cannot make the cast of var x: array[count, uint] = arrayOfUints[] as count isn't known at compile time - can this check be disabled? |
17:49:58 | k1i | sry |
17:50:22 | emilsp | can't you const count = 128 or something ? |
17:50:37 | * | clynamen quit (Quit: ZNC - http://znc.in) |
17:51:10 | k1i | emilsp: variable count coming from C, but the array is that length |
17:51:43 | * | clynamen joined #nim |
17:53:12 | * | BlaXpirit joined #nim |
17:53:45 | EXetoC | coming from C how? if it's a run-time value then it doesn't make sense to use an array. what you should be using then is a seq |
17:54:05 | emilsp | is seq just a linked list of sorts ? |
17:54:19 | EXetoC | arrayOfUints is also a run-time value so that does seem to be the case |
17:54:37 | EXetoC | emilsp: a random-access sequence |
17:55:20 | EXetoC | but with a length decided at run-time, unlike arrays where the length is specified at compile-time |
17:57:27 | k1i | auto deref isn't working was my only issue |
17:57:51 | k1i | can't [] w/ ptr uint |
17:58:53 | EXetoC | array[count, uint] actually works? that seems unlikely. either way, don't do that |
17:59:01 | k1i | https://github.com/Araq/Nim/blob/master/lib/system.nim#L1230 |
17:59:03 | EXetoC | k1i: you have to cast it |
17:59:16 | k1i | that's how it's done for a cstringarray |
17:59:29 | k1i | "The array's high value is large enough to disable bounds checking in practice." |
17:59:48 | EXetoC | yes well that's an array *pointer* |
17:59:59 | k1i | sorry, so is this |
18:00:08 | EXetoC | no, not 'x' |
18:02:46 | EXetoC | do "var x = newSeq[uint]()" and then append, or do "var x = newSeq[uint](count)" and fill in the values by doing "for i in 0 .. <count: x[i] = cast[ptr array[someLargeValue, uint]](arrayOfUints)[i]" |
18:03:44 | EXetoC | is uint correct though? keep in mind that it's either 32-bit or 64-bit depending on the architecture |
18:04:10 | k1i | cuint |
18:04:21 | EXetoC | there are aliases for the C types such as cuint... ok nevermind |
18:04:52 | k1i | i just did that cast in the proc def |
18:05:06 | k1i | ptr array[0..50_000, cuint] |
18:05:30 | * | itPuffinB joined #nim |
18:05:42 | EXetoC | some relevant conveniences: https://github.com/fowlmouth/nimlibs/blob/master/fowltek/pointer_arithm.nim |
18:06:17 | k1i | :) |
18:06:26 | * | tPuffinBi joined #nim |
18:06:44 | EXetoC | tPuffinBi: you look a little shifted. is something wrong? |
18:06:52 | * | BitPuffin quit (Ping timeout: 272 seconds) |
18:07:07 | k1i | pointer arithmetic runs the world |
18:09:39 | * | itPuffinB quit (Ping timeout: 244 seconds) |
18:10:13 | * | tPuffinBi is now known as BitPuffin |
18:10:13 | BitPuffin | EXetoC: yeah I dunno why the client did that lol |
18:10:45 | * | xet7 joined #nim |
18:18:26 | * | BitPuffin quit (Ping timeout: 244 seconds) |
18:19:50 | * | clynamen quit (Ping timeout: 246 seconds) |
18:25:16 | * | clynamen joined #nim |
18:27:47 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:36:34 | * | xificurC joined #nim |
18:39:09 | * | AckZ quit (Ping timeout: 252 seconds) |
18:39:09 | * | biscarch quit (Ping timeout: 252 seconds) |
18:39:27 | * | clone1018 quit (Ping timeout: 256 seconds) |
18:40:05 | * | a5i quit (Read error: Connection reset by peer) |
18:40:29 | * | hguux__ quit (Ping timeout: 250 seconds) |
18:41:04 | * | jholland quit (Ping timeout: 272 seconds) |
18:42:19 | * | xificurC quit (Remote host closed the connection) |
18:49:12 | * | banister joined #nim |
19:23:22 | * | UberLambda joined #nim |
19:23:28 | * | _UberLambda_ joined #nim |
19:23:32 | * | gokr joined #nim |
19:23:44 | * | _UberLambda_ quit (Remote host closed the connection) |
19:30:50 | * | Demos joined #nim |
19:33:03 | * | dtscode joined #nim |
19:34:18 | * | epichero quit (Remote host closed the connection) |
19:40:26 | reactormonk | k1i, doesn't mean you can't delegate it to the compiler |
19:41:10 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:43:56 | * | reem joined #nim |
19:48:17 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:48:38 | * | banister joined #nim |
19:49:48 | * | vbtt joined #nim |
19:52:13 | * | vbtt quit (Client Quit) |
19:53:57 | * | reem quit (Remote host closed the connection) |
19:55:05 | * | jholland joined #nim |
19:58:47 | * | reem joined #nim |
20:00:04 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:00:21 | * | BlaXpirit quit (Remote host closed the connection) |
20:00:47 | * | UberLambda quit (Quit: Leaving the Matrix) |
20:02:21 | * | BlaXpirit joined #nim |
20:05:28 | * | mpthrapp_ quit (Remote host closed the connection) |
20:06:00 | * | hguux__ joined #nim |
20:06:12 | * | AckZ joined #nim |
20:14:27 | * | alex99 joined #nim |
20:14:51 | alex99 | what is the proper syntax for a multi-line `if` expression (returning a value) |
20:14:58 | alex99 | something like |
20:15:03 | alex99 | result = if something: |
20:15:06 | alex99 | someProc() |
20:15:08 | alex99 | else: |
20:15:13 | alex99 | someOtherProc() |
20:15:48 | def- | alex99: indent everything from the second line on and it should work |
20:16:40 | alex99 | tried that, still getting "invalid identation" |
20:16:44 | alex99 | you meant: |
20:16:47 | def- | full example? |
20:16:50 | alex99 | result = if something: |
20:16:54 | alex99 | someProc() |
20:16:56 | alex99 | else: |
20:17:01 | def- | yes, that works for me |
20:17:06 | alex99 | someOtherProc() |
20:17:28 | * | biscarch joined #nim |
20:17:48 | flyx | can nim do variadic generics? |
20:18:04 | alex99 | ah, yes, working |
20:18:09 | alex99 | thanks for insisting! |
20:18:17 | alex99 | i had an extra parenthesis in the way |
20:18:44 | * | clone1018 joined #nim |
20:20:23 | * | vbtt joined #nim |
20:20:51 | vbtt | flyx: what do you mean? |
20:21:23 | flyx | like, eg I want to write a proc that take another proc as argument, and then a varargs list of arbitrary variables of arbitrary types |
20:21:32 | flyx | then, it calls the given proc with the supplied values |
20:22:04 | flyx | my proc would need to be generic and instantiated for every proc it's called with |
20:23:38 | flyx | I wonder if I could just use varargs[auto], but I don't think I would be able to call the proc with the variable containing the varargs arguments |
20:24:17 | * | rzzz joined #nim |
20:24:26 | Demos | flyx, I don't think you can do that right now. That is perfect forwarding, which c++ required variadic templates for |
20:24:35 | Demos | and rval refs but that is not something nim needs |
20:24:38 | flyx | I know, that's why I ask |
20:25:40 | vbtt | wouldn't it be possible with a macro? |
20:25:46 | Demos | maybe |
20:25:51 | flyx | probably. |
20:26:05 | flyx | I mean, yes, it's definitely possible |
20:26:15 | EXetoC | it's just inconvenient atm |
20:26:19 | flyx | yes |
20:26:36 | vbtt | see http://nim-lang.org/manual.html#expression-macros, debug macro |
20:26:45 | Demos | you probably want something besides varargs[auto] though |
20:27:06 | vbtt | unless you need to pass this function around as well, a macro might work fine here |
20:27:47 | flyx | well I'm writing lots of macros here anyway, so another one won't be much pain |
20:28:21 | * | a5i joined #nim |
20:35:13 | * | epichero joined #nim |
20:39:51 | * | epichero quit (Ping timeout: 250 seconds) |
20:41:13 | * | banister joined #nim |
20:41:42 | * | vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:42:21 | * | banister quit (Client Quit) |
20:48:03 | * | banister joined #nim |
20:50:52 | * | zipR4ND joined #nim |
20:58:55 | * | brononymous joined #nim |
21:05:53 | * | CryptoToad joined #nim |
21:06:15 | EXetoC | CryptoToad: have you mastered the language yet? |
21:06:21 | CryptoToad | Wouldn't say msatered |
21:06:25 | CryptoToad | but i'm getting much better |
21:06:26 | CryptoToad | :) |
21:06:27 | * | brononymous quit (Quit: Page closed) |
21:06:37 | EXetoC | some day |
21:07:09 | CryptoToad | I plan to make Nim my go-to language for both scripting stuff and small native projects. |
21:07:26 | CryptoToad | so i'm sure over the next few months i'll learn a fair bit more |
21:08:41 | * | kjo joined #nim |
21:12:21 | CryptoToad | Is there any way i can pass a dword array as a dword pointer? I tried casting but no dice. |
21:13:08 | CryptoToad | it's for https://msdn.microsoft.com/en-us/library/windows/desktop/ms682629(v=vs.85).aspx first argument |
21:20:42 | * | jsudlow joined #nim |
21:21:16 | * | jsudlow quit (Client Quit) |
21:25:54 | * | gsingh93 quit (Ping timeout: 256 seconds) |
21:27:46 | * | gsingh93 joined #nim |
21:27:53 | * | rzzz1 joined #nim |
21:28:28 | * | davidhq joined #nim |
21:28:52 | * | Jesin quit (Quit: Leaving) |
21:29:41 | * | bcinman joined #nim |
21:29:52 | EXetoC | CryptoToad: did you cast the address? otherwise you get a pointer whose value is that of the first element and possibly extending it |
21:30:11 | CryptoToad | cast the address... no i'll try that. |
21:30:33 | EXetoC | or you would, had it been working |
21:31:46 | CryptoToad | it works now thanks |
21:32:02 | flaviu | k1i: This was a while ago, but the correct approach would be to use an unchecked array. |
21:32:02 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:32:22 | flaviu | http://nim-lang.org/manual.html#unchecked-pragma |
21:32:46 | EXetoC | sometimes you know it won't extend a certain length |
21:33:13 | * | Jesin joined #nim |
21:43:38 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:53:27 | * | epichero joined #nim |
22:03:31 | * | brson quit (Quit: leaving) |
22:04:57 | * | jholland quit (Quit: Connection closed for inactivity) |
22:11:50 | * | saml quit (Quit: Leaving) |
22:12:34 | * | gsingh93 quit (Ping timeout: 255 seconds) |
22:12:43 | * | reem quit (Remote host closed the connection) |
22:13:26 | * | reem joined #nim |
22:22:58 | * | epichero quit (Remote host closed the connection) |
22:23:12 | * | epichero joined #nim |
22:25:23 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:40:39 | * | davidhq joined #nim |
22:41:15 | * | elbow_jason joined #nim |
22:45:23 | * | Demos quit (Read error: Connection reset by peer) |
22:45:42 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:51:14 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:52:29 | * | davidhq joined #nim |
22:57:30 | flyx | it's possible to call a macro from within a macro, right |
22:58:07 | EXetoC | yes |
22:58:11 | flyx | good |
22:58:36 | flyx | I was too long abstinent from Nim |
23:01:56 | * | johnsoft joined #nim |
23:02:45 | * | johnsoft quit (Client Quit) |
23:02:49 | * | rzzz1 quit (Quit: Leaving.) |
23:03:00 | * | johnsoft joined #nim |
23:06:55 | * | rzzz quit (Ping timeout: 256 seconds) |
23:07:02 | zipR4ND | is it possible to have jester running as one component of a programm listening for http events without its mainloop blocking the rest of the app? |
23:07:25 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:07:36 | flaviu | zipR4ND: Maybe try running it in a thread? |
23:08:29 | flaviu | Or another process, processes are really cheap in linux at least. |
23:09:11 | zipR4ND | flaviu: yes i thought of that, but i didn't find out how to make the jester thread communicate with the programs main thread .. |
23:10:39 | flaviu | zipR4ND: You could try sending it http requests, as you would normally. |
23:12:33 | zipR4ND | that sounds like a workaround ... actually i would really like to use threading, but i couldn't find an example of threads sharing variables (callbacks) and using locking in nim .. |
23:14:50 | EXetoC | http://nim-lang.org/queues.html |
23:14:58 | flaviu | zipR4ND: You can read from http://nim-lang.org/channels.html in your request handlers. |
23:14:58 | flaviu | What are you trying to accomplish here? |
23:15:26 | * | irrequietus quit () |
23:16:59 | zipR4ND | flaviu: im trying to write a modular application, that can have different networking and storage components hooked in and out and uses an internal event bus and rules to orchestrate the whole thing. thatfor i need a certain amount of parallellism. components shouldnt block each other but still be able to communicate ... |
23:18:21 | zipR4ND | flaviu: is thera an example of the use of channels with threads somewhere? i'm really new to programming on this (low) level :) |
23:19:05 | flaviu | If you don't have a strict uptime requirement, the best solution would be to read a config file at startup. |
23:19:18 | * | davidhq joined #nim |
23:19:32 | flaviu | I don't know of any examples, but the operations availbe in the docs seem to be self-explainatory enough. |
23:19:50 | zipR4ND | ok thanks for the hints |
23:20:59 | EXetoC | oops, looked up the wrong thing |
23:22:58 | dom96 | zipR4ND: you should be making everything async |
23:23:10 | zipR4ND | ok, just for the log: found an example of the use of threads and TChannel : https://github.com/winksaville/nim-testTChannel/blob/master/testTChannel.nim |
23:23:40 | dom96 | I wouldn't currently recommend mixing threads and async if you can avoid it |
23:24:16 | zipR4ND | dom96: ok, but i didnt get async to work either. do you have any example ? |
23:24:31 | dom96 | zipR4ND: what are you trying to do? |
23:24:32 | wb | I tried using channels a little while ago, couldn't even get it to compile ("unique type" and other mystery errors) |
23:24:34 | dom96 | that doesn't work? |
23:24:59 | zipR4ND | i described to flaviu a few lines earlier |
23:25:35 | dom96 | you need to be more specific |
23:25:49 | dom96 | what IO is your app doing? |
23:26:45 | zipR4ND | ok, lets say i have a jester-component, that gets a request via http, and this component was registered with a callback, that it should use to inform the main programm of the request |
23:27:21 | dom96 | right |
23:27:23 | zipR4ND | it does so, and the waits for an event to occur on the main programms event bus marking the response to that request |
23:27:42 | dom96 | so what's the problem, what is blocking? |
23:28:12 | dom96 | from what I can tell you are only using IO for networking (Jester) |
23:29:14 | zipR4ND | jesters request methor (get "smth":) should call the callback on the mainloop, than register its interest for a response, get a Future and wait for this Future to fulfill, before going on answering ... |
23:30:52 | zipR4ND | yes, but i am striving for this main-event-bus architecture and want all the other components not to block each other, unless on decides to do so, because it waits for something to happen (therefor i could use the 'await' function ...) |
23:31:56 | dom96 | so use the 'await' function |
23:34:09 | zipR4ND | hmm, ok. maybe I didn't get this async idea right ... |
23:35:27 | zipR4ND | for example: how can my main program start the jester loop in the component without this blocking the main programm without the use of threads? (in a registerAndBootComponent() proc ..) |
23:35:34 | * | akiradeveloper joined #nim |
23:36:25 | flaviu | zipR4ND: That question doesn't really make sense. |
23:36:54 | flaviu | Jester is really a `while true: do stuff` loop at it's core |
23:38:29 | zipR4ND | flaviu: so i should break this while loop, and create a global while loop incorporating all the loops into one? |
23:38:52 | dom96 | no |
23:38:59 | dom96 | Asyncdispatch is an event loop |
23:39:02 | dom96 | jester makes use of it |
23:39:08 | dom96 | you should make use of this event loop |
23:39:13 | dom96 | you shouldn't make your own |
23:39:23 | EXetoC | oh yeah that's right |
23:39:27 | dom96 | if you want something called periodically then you can use sleepAsync |
23:39:58 | dom96 | proc callEvery(x: int) {.async.} = while true: await sleepAsync(x); doStuff() |
23:40:11 | dom96 | asyncCheck callEvery(400) #ms |
23:40:18 | dom96 | routes: |
23:40:20 | dom96 | ... |
23:40:23 | dom96 | runForever() |
23:41:24 | zipR4ND | dom96: thanks, this helps me understand things... i will try to implement this |
23:47:35 | * | filwit joined #nim |
23:49:34 | Araq | hi filwit |
23:49:41 | filwit | hey |
23:52:48 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:53:05 | zipR4ND | ok dom96 now i think i understand how this works, thanks again .. |
23:53:11 | EXetoC | .eval import macros; macro x(s: stmt):; stmt = discard strVal(s); x(1) |
23:53:12 | Mimbus | EXetoC: stack trace: (most recent call last) |
23:56:05 | EXetoC | Araq: that does look correct judging by the code in other macros |
23:57:11 | EXetoC | "Error: field 'strVal' cannot be found" |
23:57:38 | Araq | hi |
23:57:46 | Araq | don't aks Araq |
23:57:59 | Araq | he's busy/drunk/sick/away |
23:58:07 | EXetoC | oh ok |
23:58:07 | Araq | ask fowl |
23:58:44 | CryptoToad | http://hastebin.com/huyefojupi.vbs anyone know why the getModuleBaseName call is failing? It's modeled after this example - https://msdn.microsoft.com/en-us/library/windows/desktop/ms682623(v=vs.85).aspx |
23:59:00 | CryptoToad | ignore the function name lol |
23:59:01 | fowl | EXetoC, thats correct |
23:59:10 | * | brson joined #nim |
23:59:18 | fowl | EXetoC, are you trying to get a string representation of the argument? |