00:02:44 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:07:44 | Araq | ekarlso: you're using global variables? |
00:12:25 | * | vendethiel quit (Ping timeout: 264 seconds) |
00:14:22 | * | kjo1 quit (Quit: Leaving.) |
00:15:17 | * | vendethiel joined #nim |
00:23:58 | * | l04m33 quit (Ping timeout: 255 seconds) |
00:24:37 | * | BlaXpirit quit (Quit: Quit Konversation) |
00:34:54 | * | Mat4 joined #nim |
00:37:06 | * | Mat4 left #nim (#nim) |
00:38:12 | * | vendethiel quit (Ping timeout: 245 seconds) |
00:45:34 | * | ggibson joined #nim |
00:49:45 | ggibson | quick question: is the 'posix' module cross platform? My guess is that it is not. |
00:50:23 | ggibson | By cross-platform I mean, will windows users be able to compile code which uses the 'posix' module? |
00:52:06 | * | madmalik quit (Quit: Connection closed for inactivity) |
00:57:25 | Araq | ggibson: no, they will not |
00:57:59 | Araq | the os and osproc modules are OS independent wrappers for parts of posix |
00:58:53 | Araq | what you can do on windows is to compile via cygwin or mingw, these posix compatibility layers |
00:59:05 | Araq | *these are |
01:00:05 | ggibson | Ah, right. Thanks for the reminder - that is a decent solution. |
01:01:30 | * | Jehan_ quit (Quit: Leaving) |
01:02:02 | * | Jehan_ joined #nim |
01:04:21 | * | vendethiel joined #nim |
01:06:55 | * | sampwing quit (Ping timeout: 252 seconds) |
01:25:19 | * | ggibson quit (Ping timeout: 246 seconds) |
01:27:10 | * | Jehan_ quit (Quit: Leaving) |
01:28:33 | * | saml_ joined #nim |
01:28:52 | * | vendethiel quit (Ping timeout: 240 seconds) |
01:42:55 | * | darkf joined #nim |
01:58:26 | * | reem quit (Remote host closed the connection) |
02:00:52 | * | reem joined #nim |
02:07:01 | * | quasinoxen quit (Ping timeout: 255 seconds) |
02:07:10 | * | quasinoxen joined #nim |
02:09:34 | * | gokr quit (Remote host closed the connection) |
02:26:02 | * | TEttinger joined #nim |
02:38:15 | * | brson quit (Quit: leaving) |
02:43:00 | * | vezzy joined #nim |
02:44:52 | * | quasinoxen quit (Ping timeout: 240 seconds) |
02:50:02 | * | chemist69_ joined #nim |
02:51:41 | * | vendethiel joined #nim |
02:53:22 | * | chemist69 quit (Ping timeout: 255 seconds) |
03:09:41 | * | reem quit (Remote host closed the connection) |
03:13:27 | * | reem joined #nim |
03:15:44 | * | vendethiel quit (Ping timeout: 264 seconds) |
03:21:07 | * | onionhammer quit (Quit: WeeChat 1.0.1) |
03:22:21 | * | reem quit (Remote host closed the connection) |
03:28:59 | * | reem joined #nim |
03:31:06 | * | reem quit (Remote host closed the connection) |
03:33:03 | * | reem joined #nim |
03:37:02 | * | vezzy quit (Ping timeout: 252 seconds) |
03:50:24 | * | reem quit (Remote host closed the connection) |
03:58:27 | * | reem joined #nim |
03:58:58 | * | a5i quit (Quit: Connection closed for inactivity) |
04:01:45 | * | saml_ quit (Quit: Leaving) |
04:07:20 | * | ChrisMAN quit (Ping timeout: 264 seconds) |
04:14:54 | * | reem quit (Remote host closed the connection) |
04:21:20 | * | reem joined #nim |
04:53:27 | * | reem quit (Remote host closed the connection) |
05:05:31 | * | reem joined #nim |
05:24:53 | * | wb quit (Ping timeout: 246 seconds) |
05:37:44 | * | wb joined #nim |
05:41:30 | * | reem quit (Remote host closed the connection) |
05:55:14 | * | reem joined #nim |
05:57:41 | * | Shadox joined #nim |
06:01:31 | * | Demos quit (Read error: Connection reset by peer) |
06:19:34 | * | reem quit (Remote host closed the connection) |
06:24:22 | * | reem joined #nim |
06:28:01 | * | reem quit (Remote host closed the connection) |
06:29:01 | * | reem joined #nim |
06:33:59 | * | fizzbooze quit (Ping timeout: 256 seconds) |
06:38:24 | * | reem quit (Remote host closed the connection) |
06:43:51 | * | aidanh quit (Ping timeout: 250 seconds) |
06:44:00 | * | reem joined #nim |
06:49:29 | * | ^aurora^ joined #nim |
06:49:47 | * | reem quit (Remote host closed the connection) |
06:49:58 | * | aidanh joined #nim |
07:05:27 | * | xificurC joined #nim |
07:07:16 | * | Shadox quit (Quit: Leaving) |
07:09:58 | * | reem joined #nim |
07:13:05 | * | reem quit (Remote host closed the connection) |
07:14:36 | * | bjz joined #nim |
07:15:31 | * | bjz quit (Client Quit) |
07:15:49 | * | bjz joined #nim |
07:16:09 | * | bjz quit (Read error: Connection reset by peer) |
07:18:25 | * | bjz_ joined #nim |
07:18:52 | * | reem joined #nim |
07:19:29 | * | bjz_ quit (Remote host closed the connection) |
07:24:22 | * | untitaker quit (Ping timeout: 240 seconds) |
07:28:03 | * | gsingh93 quit (Ping timeout: 250 seconds) |
07:29:14 | * | reem quit (Remote host closed the connection) |
07:29:45 | * | untitaker joined #nim |
07:34:02 | * | gokr joined #nim |
07:43:07 | * | reem joined #nim |
07:56:40 | * | ^aurora^ quit (Quit: Leaving.) |
07:58:26 | * | bjz joined #nim |
08:11:12 | * | chemist69_ quit (Quit: WeeChat 1.1.1) |
08:20:25 | * | BlaXpirit joined #nim |
08:27:18 | * | reem quit (Remote host closed the connection) |
08:27:53 | * | reem joined #nim |
08:42:04 | * | Zigara left #nim (#nim) |
08:43:48 | * | reem quit (Remote host closed the connection) |
09:03:16 | * | Trustable joined #nim |
09:16:28 | Araq | reactormonk: some tests now produce reInvalidPeg that used to work ... |
09:19:39 | ekarlso | Araq: what you mean by glboal variables ? |
09:20:21 | Araq | ekarlso: just pastebin/gist your code please and I can tell you why it's not gcsafe |
09:25:07 | * | tumult joined #nim |
09:34:11 | ekarlso | https://bpaste.net/show/47b7265aeff6 Araq |
09:36:41 | Araq | ekarlso: I think the essential part is in 'asyncproc', but your defaultOpts is not gcsafe |
09:44:49 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
09:46:13 | ekarlso | Araq: how you make it gc safe then :/ |
09:46:51 | ekarlso | dom96: you aroun ? |
09:46:51 | Araq | ekarlso: do you use --threads:on? |
09:46:56 | ekarlso | Araq: yeah |
09:47:10 | Araq | but you don't use threads? |
09:47:14 | ekarlso | https://github.com/nim-lang/nimbuild/blob/rewrite/src/builder/asyncproc.nim < that's it |
09:47:19 | dom96 | asyncproc uses threads |
09:47:41 | ekarlso | so dom96, how do I solve it ? :p |
09:47:57 | dom96 | dunno |
09:48:03 | dom96 | does --threadAnalysis:off not work? |
09:50:35 | Araq | --threadanalysis:off is not an official switch btw |
09:53:18 | ekarlso | dom96: have you gotten asyncproc to compile before ? |
09:53:30 | dom96 | yes |
09:53:43 | * | bw_ quit (Remote host closed the connection) |
09:53:47 | dom96 | https://github.com/nim-lang/nimbuild/blob/rewrite/src/builder/asyncproc.nim#L129 |
09:53:52 | dom96 | This worked the last time I tried it |
09:55:21 | * | TEttinger quit (Ping timeout: 264 seconds) |
10:04:04 | ekarlso | dom96: can it be that jester and asyncproc doesnt play well ? |
10:04:16 | dom96 | perhaps |
10:04:31 | ekarlso | feck :( |
10:04:59 | ekarlso | https://bpaste.net/show/4923783ba2f2 < is what I get when compiling |
10:05:49 | ekarlso | oh |
10:06:20 | ekarlso | threadanalysis:off did work :/ |
10:06:26 | ekarlso | dunno how I did not make it work yesterday |
10:07:14 | ekarlso | so global vars are not gc safe at all ? |
10:08:57 | Araq | actually they are not threadsafe, since they belong to the main thread |
10:09:18 | ekarlso | so how does one fix that ? :P |
10:09:21 | ekarlso | I guess not possible :/ |
10:10:01 | Araq | you better pass the data around explicitly ;-) |
10:10:21 | Araq | or use a TChannel |
10:10:30 | ekarlso | gawd :P |
10:11:23 | ekarlso | how does a asyncproc signal that it's finished kinda ? |
10:11:40 | ekarlso | my program now doesnt get passed the run.execute() asnyc method |
10:14:22 | * | davidhq joined #nim |
10:16:49 | ekarlso | how fun dom96 now the whole program hangs :d |
10:17:27 | ekarlso | meh, nvm me |
10:17:31 | ekarlso | I need more coffee :| |
10:17:44 | dom96 | how are you using asyncproc? |
10:18:10 | ekarlso | dom96: gimme 10 :p, i've slept like 2.5 hours tonight so caffeine levels are not functioning atm :/ |
10:18:21 | ekarlso | little kiddo keeping us awake :p |
10:22:20 | Araq | oh ffs |
10:22:40 | Araq | reactormonk: you pass expectedMsg as the PEG pattern! |
10:22:57 | ekarlso | Araq: you got small babies in the house ? :p |
10:23:15 | Araq | Araq: not anymore |
10:23:41 | ekarlso | grown up or smth? ^ |
10:24:55 | * | bcinman joined #nim |
10:28:14 | Araq | ekarlso: 1.5 and 3 years old |
10:28:33 | ekarlso | ah |
10:28:36 | ekarlso | :d |
10:33:32 | ekarlso | what does it mean when "illegal capture foo" inside a async proc ? |
10:36:17 | Araq | you cannot capture 'foo' in a closure. usually 'foo' is a var parameter |
10:36:25 | Araq | or an openArray |
10:36:48 | Araq | you need to copy it into a local variable and then capture that |
10:37:10 | Araq | causing a copy of course, but then that's the only thing that's safe |
10:37:29 | Araq | or you can use 'ptr T' instead of 'var T' but this is unsafe |
10:45:45 | * | bw_ joined #nim |
10:47:46 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:54:59 | ekarlso | dom96: so now I got it runnign asyncproc! :) |
10:55:40 | dom96 | ekarlso: cool |
10:55:47 | dom96 | what did you have to change? |
10:56:05 | ekarlso | dom96: just cleanup my code ;P |
10:56:32 | dom96 | hehe |
10:56:58 | ekarlso | but hmm |
10:57:10 | ekarlso | https://bpaste.net/show/26d2bb2bcdb8 |
10:57:14 | ekarlso | that has me a bit beffled |
10:57:16 | ekarlso | baffled |
10:58:13 | ekarlso | happens after 1-3 requests :/ |
11:00:05 | ekarlso | any pointrs dom96 ? |
11:01:35 | dom96 | that's weird |
11:01:43 | dom96 | that looks like a bug |
11:01:49 | dom96 | in asyncdispatch |
11:01:52 | ekarlso | dom96: got time to take a look or ? ^ |
11:01:59 | dom96 | can you show me your code? |
11:02:04 | ekarlso | I can post up my code to gh |
11:04:29 | ekarlso | https://github.com/ekarlso/nim-playpen/tree/asyncproc dom96 |
11:06:38 | * | vendethiel joined #nim |
11:06:51 | dom96 | you shouldn't create a new executor for each execute call |
11:07:03 | dom96 | and you should NEVER discard futures |
11:07:09 | dom96 | remove that discardable pragma |
11:08:42 | ekarlso | k |
11:09:04 | ekarlso | do await instead ? |
11:09:20 | dom96 | that depends |
11:09:29 | dom96 | do you want it to wait for it to finish? |
11:09:41 | ekarlso | i dont want it to block no |
11:09:55 | dom96 | it won't block |
11:10:19 | ekarlso | ok :) |
11:10:44 | ekarlso | where do I place the executor though then ? |
11:10:48 | dom96 | you should do await |
11:10:56 | dom96 | because the code after the execute call |
11:11:00 | dom96 | depends on the result of it |
11:11:22 | dom96 | a global variable |
11:11:34 | ekarlso | I thought those where bad :P |
11:11:45 | ekarlso | according to mr Araq |
11:12:11 | dom96 | you already use tons of them anyway... |
11:12:30 | ekarlso | heh, i'm thinking of killing that when I get the time :/ |
11:12:32 | dom96 | you probably shouldn't do that :P |
11:12:34 | * | akiradeveloper joined #nim |
11:12:47 | ekarlso | well that was before I was using threads :p |
11:12:54 | akiradeveloper | how to know the arity of a function? |
11:12:59 | dom96 | shouldn't do that even without them :P |
11:13:12 | dom96 | but you can make it a local var later |
11:13:24 | dom96 | to do that you will need to put routes inside a proc |
11:13:33 | dom96 | something which currently doesn't work |
11:13:38 | ekarlso | doh :p |
11:13:58 | Araq | akiradeveloper: depends. are you in a macro? |
11:14:24 | ekarlso | dom96: u need to give jester some more love :p |
11:14:32 | dom96 | ekarlso: pretty sure it's a nim bug |
11:15:51 | * | akiradeveloper quit (Remote host closed the connection) |
11:18:32 | ekarlso | dom96: still it would be cool to see more stuff in jester :) |
11:18:38 | ekarlso | like a way to handle exceeptions better |
11:20:15 | dom96 | sure |
11:20:38 | Araq | dom96: pretty sure you're holding it wrong :P |
11:21:06 | ekarlso | and hmmms dom96 a way to do auth as well instead of doing the same code pr route would be awesome too |
11:21:50 | dom96 | ekarlso: create issues please |
11:22:05 | * | davidhq joined #nim |
11:22:09 | ekarlso | sure :p |
11:22:17 | * | akiradeveloper joined #nim |
11:22:28 | akiradeveloper | no. I am in a proc |
11:25:51 | * | teef joined #nim |
11:27:55 | Araq | akiradeveloper: well then why do you need to know the arity? |
11:29:23 | akiradeveloper | Araq: In Messagepack-RPC, I want to check the number of args passed is equal to the arity of the function requested |
11:30:06 | Araq | how do you invoke a function of unknown arity in Nim in a non-meta context? |
11:31:59 | Araq | macro arity(n: stmt): int = newLit(n.getType.len - 1) # might work with devel |
11:36:50 | akiradeveloper | Araq: I want to use the arity macro but I don't like to use devel for my development. No way with master? |
11:38:25 | Araq | there is typetraits.arity but not sure if that works |
11:39:08 | Araq | typetraits never got much love from me, since I never know how to handle 'typedesc' in the VM ;-) |
11:40:39 | Araq | but again, how do you invoke a function of unknown arity in Nim in a non-meta context? |
11:43:07 | akiradeveloper | for exmaple, server has a proc f(a,b,c) and client requests to call the function with args [1,2]. If we can know the arity of f that is 3, then we can reject the request because the number of args is wrong |
11:43:37 | fowl | arity() could be rewritten using getType() now |
11:45:21 | Araq | akiradeveloper: well Nim is statically typed |
11:45:35 | Araq | there is no way to invoke 'f' with a wrong number of arguments anyway |
11:45:48 | Araq | (if you don't 'cast' the proc type) |
11:46:21 | akiradeveloper | Araq: I see what you mean. |
11:46:27 | akiradeveloper | thanks |
11:57:29 | * | aidanh left #nim (#nim) |
11:57:50 | * | akiradeveloper quit (Remote host closed the connection) |
12:01:38 | * | xeizlif quit (Ping timeout: 265 seconds) |
12:05:49 | * | BitPuffin quit (Ping timeout: 250 seconds) |
12:14:38 | * | vendethiel quit (Ping timeout: 272 seconds) |
12:22:30 | * | vendethiel joined #nim |
12:29:10 | teef | I am experimenting with some nim python stuf and somving some trouble with the type conversion. Specifically https://github.com/micklat/NimBorg/blob/master/nimborg/py/high_level.nim#L85 |
12:34:41 | * | saml_ joined #nim |
12:35:22 | Araq | teef: what's the problem? the converter is not called? |
12:37:03 | teef | Well it might just be the library I am using https://gist.github.com/lateefj/7364f68724f6f377933f |
12:39:04 | teef | I Mainly I am trying to get the size of a Python list (echo(PyList_Size(pyObj))) and for some reason I can't get a PPyObject from a PPyRef |
12:39:34 | Araq | well the converter is not exported |
12:39:47 | Araq | there should be another way to get the underlying object |
12:40:04 | Araq | or maybe you need to hack nimborg for that |
12:41:31 | * | akiradeveloper joined #nim |
12:44:10 | teef | Arag: I see so I should be able to just export the converter |
12:45:09 | * | vendethiel quit (Ping timeout: 256 seconds) |
12:46:02 | Araq | yes |
12:48:07 | Araq | teef: is nimborg maintained? iirc the original dev left |
12:49:23 | teef | Araq: good question |
12:49:34 | Araq | fork it and take over ;-) |
12:51:31 | teef | Taken: https://github.com/lateefj/NimBorg I exported and now testing |
12:52:41 | Araq | btw I don't think you should export that, instead add what you need to the API |
12:55:58 | * | madmalik joined #nim |
12:57:56 | teef | I really just tryng to support the len(obj) operation |
13:02:57 | * | mpthrapp_ joined #nim |
13:03:53 | novist | how do i convert between string/cstring? |
13:03:54 | * | vendethiel joined #nim |
13:05:07 | def- | myStr.cstring to get the cstring |
13:05:31 | novist | actually i need cstring -> string |
13:06:02 | def- | $ |
13:06:17 | novist | /facepalm |
13:06:19 | novist | thank you |
13:07:09 | def- | I would appreciate a search like hoogle, so you can search for a proc by type (in this case proc(x: cstring): string) |
13:10:35 | * | quasinoxen joined #nim |
13:12:44 | ekarlso | so in a async proc when you do a copy of a object to make it a var and you modify a field of the object that's not reflected on the passed object ? |
13:13:35 | def- | right, you made a copy |
13:14:08 | ekarlso | fack |
13:15:45 | * | ggVGc joined #nim |
13:15:53 | ekarlso | what's the best pattern for that ? |
13:16:06 | ekarlso | dont modify the object in the proc but return and modify above the proc ? |
13:16:53 | ggVGc | is there documentation of exactly what in nim creates GC'ed allocations? |
13:20:21 | dom96 | ekarlso: pass a ref |
13:20:37 | def- | ggVGc: you can use --gc:none to find out what in your code uses GC at least |
13:21:21 | def- | ggVGc: generally strings, seqs and ref objects are on the heap, so they are GCed |
13:22:58 | ekarlso | dom96: isn't that unsafe ? |
13:23:09 | dom96 | refs are traced |
13:23:22 | dom96 | you'll likely need to use refs everywhere though |
13:23:33 | ekarlso | :/ |
13:23:42 | * | saml_ quit (Ping timeout: 252 seconds) |
13:24:07 | dom96 | using a ptr would be unsafe |
13:24:14 | dom96 | but would take less refactoring |
13:25:54 | * | vendethiel quit (Ping timeout: 252 seconds) |
13:26:15 | ekarlso | hmm |
13:26:17 | ekarlso | proc execute*(self: ref Run, playPath: string, versionsPath: string) {.async.} = |
13:26:24 | ekarlso | aint that correct ? |
13:27:22 | * | teef quit (Ping timeout: 246 seconds) |
13:32:15 | * | akiradeveloper quit () |
13:38:57 | dom96 | Depends what Run is. |
13:40:09 | ekarlso | object |
13:44:14 | * | vendethiel joined #nim |
13:51:54 | * | onionhammer joined #nim |
14:06:09 | * | kjo1 joined #nim |
14:07:08 | * | BlaXpirit quit (Remote host closed the connection) |
14:08:16 | * | vendethiel quit (Ping timeout: 265 seconds) |
14:08:49 | ekarlso | ok dom96 that should make it fully async at least using asyncproc :) |
14:09:02 | * | BlaXpirit joined #nim |
14:09:10 | dom96 | cool |
14:09:16 | * | BitPuffin joined #nim |
14:14:33 | ekarlso | now just to fix validation stuff also :/ |
14:17:33 | ekarlso | dom96: what options needs to be available ? |
14:18:35 | dom96 | Being able to pass any flag would be nice. |
14:21:15 | novist | passL pragma can pass paths to compiler like -l/usr/lib/something.so or -L/usr/lib too right? |
14:22:06 | def- | novist: --passL:-l/usr/lib/something.so |
14:22:26 | novist | kk, just making sure its what i expect it is. thanks |
14:22:26 | def- | should work |
14:28:15 | ekarlso | unsure of how to make the input safe in that case def- .. |
14:30:44 | * | arnetheduck joined #nim |
14:30:55 | def- | ekarlso: what? |
14:32:11 | fowl | novist, passL passes to linker, passC passes to compiler |
14:35:13 | ekarlso | def-: so that one cant do like flaviu did you ass in like < > ;) |
14:36:22 | def- | ekarlso: i have no idea what you're talking about |
14:37:24 | ekarlso | def-: nvm me then :p |
14:49:01 | * | jholland joined #nim |
15:27:07 | * | darkf quit (Quit: Leaving) |
15:56:05 | arnetheduck | hi, is there any increment function/operator that also returns the value? inc seems to increment but not return, succ will return next but not increment.. atomicInc kind of does the right thing, but is clunky and overkill..? |
15:59:44 | * | quasinoxen quit (Ping timeout: 246 seconds) |
16:00:13 | * | quasinoxen joined #nim |
16:00:58 | def- | arnetheduck: something like ++? I'd consider that bad style but you can write your own of course |
16:01:05 | def- | I don't think it's in the stdlib |
16:01:13 | * | ^aurora^ joined #nim |
16:03:27 | * | sampwing joined #nim |
16:09:53 | BlaXpirit | inc should just return the value indeed |
16:10:01 | * | ChrisMAN joined #nim |
16:10:16 | BlaXpirit | that doesn't necessarily mean any performance overhead |
16:11:07 | * | quasinoxen quit (Ping timeout: 245 seconds) |
16:11:26 | * | quasinoxen joined #nim |
16:11:55 | novist | when i run ./koch tests im greeted with "Nim/tests/testament/tester.nim(15, 21) Error: cannot open 'compiler/nodejs'" |
16:12:01 | novist | is there more to running testsuite? |
16:21:14 | * | wb quit (Read error: Connection reset by peer) |
16:21:19 | reactormonk | Araq, -.- so much for type testing |
16:22:18 | def- | novist: you have the compiler/nodejs.nim? |
16:22:21 | * | quasinoxen quit (Ping timeout: 264 seconds) |
16:22:36 | * | quasinoxen joined #nim |
16:22:43 | novist | its there |
16:24:00 | def- | novist: strange, it works for me. are you sure you're compiling with the right version of nim? |
16:24:39 | novist | well i have installed latest version of devel branch and compiled but not installed same thing + my modifications |
16:25:07 | novist | i noticed import statement is like compiler/nodejs. but thats probably ok? that slash? |
16:25:20 | def- | yes, that's fine |
16:25:34 | def- | nim -v shows the right version? |
16:25:56 | def- | I think ./koch tests uses nim from your PATH |
16:26:04 | novist | 0.10.3 |
16:26:35 | novist | ill see if adding compiler dir to path does any difference (bin i want to test is there after all) |
16:27:05 | novist | hey that worked |
16:27:36 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:34:22 | * | banister joined #nim |
16:35:18 | arnetheduck | def-, yeah, ++.. sure, can split it into two lines (inc + get value), or impl my own.. was just curious if I missed something in the docs.. thanks |
16:44:04 | * | arnetheduck quit (Ping timeout: 255 seconds) |
16:47:01 | OderWat | @novist imho the important thing is that the compiler which runs is the one which has the ../compiler/ directory. So I guess you have another nim binary which was called before you changed the path |
16:48:08 | * | OderWat quit (Quit: Textual IRC Client: www.textualapp.com) |
16:51:30 | novist | i dont quite get it. what i expected is that koch would run tests on compiler that was built in current source tree |
16:57:52 | def- | novist: it probably should |
16:58:13 | * | OderWat joined #nim |
17:05:04 | * | tumult quit (Ping timeout: 246 seconds) |
17:06:38 | * | kjo1 left #nim (#nim) |
17:12:13 | * | chrisheller joined #nim |
17:27:03 | * | ^aurora^ quit (Quit: Leaving.) |
17:34:20 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:36:16 | * | Matthias247 joined #nim |
17:52:03 | * | shodan45 quit (Quit: Konversation terminated!) |
18:01:37 | * | brson joined #nim |
18:06:23 | * | ^aurora^ joined #nim |
18:08:31 | * | banister joined #nim |
18:08:36 | * | banister quit (Max SendQ exceeded) |
18:14:39 | * | jfchevrette joined #nim |
18:30:17 | ekarlso | flaviu: u around ? |
18:52:38 | * | BitPuffin quit (Ping timeout: 246 seconds) |
19:13:23 | * | pregressive joined #nim |
19:15:32 | * | Trixar_za quit (Quit: ZNC - http://znc.in) |
19:16:11 | * | fizzbooze joined #nim |
19:16:41 | * | Trixar_za joined #nim |
19:23:27 | Araq | so ... when we use $ consistently and some people cannot guess it, that's not a problem of $ |
19:23:53 | * | fizzbooze quit (Ping timeout: 265 seconds) |
19:23:54 | Araq | but when we do the same with initT and newT it's all Nim's fault |
19:24:21 | Araq | and we must fix it by making the language more complex |
19:26:03 | reactormonk | Araq, I'm all for return type overloading |
19:26:23 | * | fizzbooze joined #nim |
19:37:31 | emilsp | Araq, isn't the root of the problem the lack of documentation ? And even then, it's not that it doesn't exist, but that people don't find it ? |
19:41:53 | * | Demon_Fox joined #nim |
19:47:48 | Araq | fowl: any idea how to get a bool's value with macros.nim? looks like we forgot the API for that |
19:53:02 | * | filcuc joined #nim |
19:56:30 | * | jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com) |
19:58:48 | filcuc | Varriount: are you there? |
19:59:10 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:59:51 | * | bcinman joined #nim |
20:02:02 | filcuc | Hi all, i'm experiencing the issue i described here in the forum (http://forum.nim-lang.org/t/955/1#6144) |
20:02:22 | filcuc | basically i received "This application has requested the runtime to terminate in an unusual way." on exit |
20:02:43 | * | saml quit (Quit: Leaving) |
20:02:44 | filcuc | when my app use the dynlib pragma for loading some symbols from one dll |
20:03:01 | * | saml joined #nim |
20:03:03 | filcuc | basically i don't get this error if i compile my program with the cpp compiler |
20:03:11 | filcuc | instead of the C compiler |
20:03:25 | filcuc | (so invoking nim with the 'cpp' flag) |
20:04:33 | filcuc | my lib is meant to be a wrapper for a cpp library (so it links the cpp library it wraps) |
20:04:46 | filcuc | and has a C interface |
20:04:57 | filcuc | that is meant to be used from nim |
20:05:15 | filcuc | this issue happen (at the moment) only on windows |
20:05:28 | filcuc | on linux i'm not experiencing this kind of issue |
20:05:37 | ekarlso | Araq: how would you like the compiler args to be presented on the play site ? |
20:05:49 | emilsp | hey, why does this line -> var arx = array[0..255, array[0..127, int] ] make the compiler fail with Error: internal error: GetUniqueType |
20:06:50 | Araq | filcuc: are you sure you got the calling conventions right? |
20:07:17 | Araq | Nim defaults to register calling convention on Windows, so it's neither cdecl nor stdcall |
20:07:35 | Araq | emilsp: = vs : |
20:07:50 | Araq | that's fixed in devel, I hope |
20:08:35 | Araq | ekarlso: just make a string input field. If I want to change the args, I surely know the string representation of it |
20:09:18 | filcuc | Araq: in my nim files i specified the .cdecl calling convetion |
20:09:43 | Araq | filcuc: but maybe it's stdcall instead? ;-) |
20:09:45 | filcuc | what should i do? i though that it was the default when creating/importing a c library |
20:09:51 | ekarlso | Araq: so dont like to have it like selects / switches ? :p |
20:10:28 | Araq | ekarlso: can I copy&paste into selects/switches? :P |
20:12:06 | filcuc | Araq: so what it's wrong: i mean, it's wrong having specified the cdecl calling convenction on my .nim files or i'm compiling wrongly my .dll library? |
20:12:11 | filcuc | or both ? :D |
20:12:37 | Araq | well try it with .stdcall |
20:14:11 | filcuc | ok, i'll try it. However isn't strange that i get this error message only on exit? during the execution of my program (a QML app) i don't get any error calling the functions of my .dll |
20:14:39 | * | alexruf joined #nim |
20:16:43 | Araq | does your QML use callbacks and threads? |
20:18:21 | filcuc | well..yes i think. For sure there's a UI thread and a Render Thread |
20:18:49 | filcuc | but i'm supposing to received all the callbacks for the UI thread (that it's the main thread) |
20:19:02 | filcuc | so the one that execute the main proc |
20:21:36 | Araq | ok, well you can validate this assumption with getThreadId() or whatever it's called |
20:21:58 | filcuc | Araq: just tested the following configuration (dynlib + C compiler + .stdcall) and i get that strange error at exit |
20:23:45 | filcuc | and with (dynlib + C++ compiler + .stdcall) no error |
20:27:45 | filcuc | btw the error message compare after the execution of my nim code (so i think that happen in a C generated part) |
20:27:58 | filcuc | probably due to some dll unloading |
20:28:12 | filcuc | (maybe :) ) |
20:33:17 | filcuc | i can create a small test case |
20:33:22 | filcuc | however i need to bundle the .dll |
20:33:36 | Araq | hrm your macros use more lines of code than dom96's async transformation |
20:34:09 | Araq | our VM cannot be so bad |
20:37:38 | * | coopernurse joined #nim |
20:42:14 | * | vendethiel joined #nim |
20:42:34 | * | Aszarsha joined #nim |
20:43:48 | * | pregressive quit (Remote host closed the connection) |
20:45:25 | * | gsingh93 joined #nim |
20:49:05 | * | arnetheduck joined #nim |
20:50:40 | * | alexruf quit (Quit: Textual IRC Client: www.textualapp.com) |
20:52:44 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:53:53 | filcuc | Araq: i debugged also the C code..and the message is printed after executable exited |
20:53:55 | * | bcinman joined #nim |
21:02:25 | * | mpthrapp_ quit (Remote host closed the connection) |
21:05:12 | * | BlaXpirit_ joined #nim |
21:07:11 | * | BlaXpirit quit (Ping timeout: 244 seconds) |
21:14:05 | filcuc | thank you all, cya |
21:14:28 | * | filcuc quit () |
21:15:56 | Araq | filcuc: {.cdecl, dynlib:"libDOtherSide.so", importc.} ? |
21:16:11 | Araq | do you use cygwin or what? |
21:16:25 | * | pregressive joined #nim |
21:17:22 | * | Jehan_ joined #nim |
21:24:23 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
21:28:24 | * | reem joined #nim |
21:29:45 | * | Aszarsha quit (Ping timeout: 252 seconds) |
21:29:59 | * | Aszarsha joined #nim |
21:38:40 | flaviu | ekarlso: I'm around now, but I've got to go soon. |
21:39:52 | * | quasinoxen quit (Ping timeout: 240 seconds) |
21:40:21 | * | quasinoxen joined #nim |
21:53:15 | * | tillzy joined #nim |
21:57:18 | * | quasinoxen quit (Ping timeout: 272 seconds) |
21:57:33 | * | quasinoxen joined #nim |
22:03:22 | * | arnetheduck quit (Ping timeout: 240 seconds) |
22:03:46 | * | Trustable quit (Remote host closed the connection) |
22:06:34 | * | xificurC quit (Ping timeout: 256 seconds) |
22:17:25 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:18:23 | * | Mat4 joined #nim |
22:18:29 | Mat4 | hello |
22:19:34 | federico3 | is anybody using nim-fuse? |
22:26:57 | reactormonk | I've never been a fan of dispatch tables... Araq, any way to make this with multiple procs? Gotta switch to methods, which is slow? https://github.com/akiradeveloper/nim-fuse/blob/master/fuse.nim#L1312-L1495 |
22:27:47 | * | fizzbooze quit (Ping timeout: 244 seconds) |
22:33:13 | Araq | reactormonk: don't ask me, I love case statements |
22:38:52 | reactormonk | oh right |
22:38:54 | Mat4 | reactormonk: defining two assembler macros embedding subroutine branch and subroutine-return opcode lead to subroutine-threading, which allows using side-effect free procedures |
22:39:19 | Mat4 | this way the case statement is avoidable |
22:40:00 | reactormonk | Mat4, that statement sounded like bullshitting deluxe the first time I read it... |
22:40:09 | ^aurora^ | mmm |
22:40:09 | * | reem quit (Remote host closed the connection) |
22:40:56 | ^aurora^ | installing c2nim with nimble leads to the error Unsatisfied dependency: nim (>= 0.10.3) |
22:41:00 | reactormonk | Mat4, well, in the end you gotta gather all the code paths and contruct a large tabela anyway |
22:41:15 | ^aurora^ | i am already using latest nim from github ... |
22:41:20 | ^aurora^ | am i missing something? |
22:41:31 | def- | ^aurora^: devel branch? |
22:42:23 | Mat4 | reactormonk: please read some documentation about subroutine threading. This technique uses precompiled (read here at runtime generated) sequences of native calls |
22:42:29 | ^aurora^ | ah … sorry :) … master … |
22:42:43 | ^aurora^ | strange … i thought i already installed devel |
22:44:56 | * | pregressive quit () |
22:47:19 | * | Mat4 doesn't want waste time |
22:47:27 | * | Mat4 left #nim (#nim) |
22:48:51 | * | shalabh joined #nim |
22:49:19 | * | reem joined #nim |
22:50:16 | * | flaviu quit (Remote host closed the connection) |
23:05:42 | shalabh | hello |
23:06:46 | shalabh | From the manual "The assignment operator for strings always copies the string" |
23:07:35 | shalabh | why? |
23:07:45 | def- | hi shalabh |
23:08:19 | def- | because strings are mutable and it are supposed to have value semantics by default |
23:08:26 | def- | but you can mark a string as shallow |
23:08:29 | def- | then it won't be copied |
23:08:30 | shalabh | right |
23:08:43 | shalabh | what if I pass strings as function arguments? |
23:08:46 | shalabh | copy or no copy? |
23:09:27 | def- | if it's a regular (non-var) argument, the argument will be immutable, so it doesn't need to be copied |
23:09:47 | def- | If it's a var argument, no copy necessary because you want to modify the original string |
23:10:47 | shalabh | ok, what about tables - similar semantics? copy on assignment and no copy on function calls? |
23:11:07 | def- | yes |
23:11:19 | def- | if you don't want that you can use TableRef for ref semantics |
23:11:24 | shalabh | interesting |
23:11:36 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:11:40 | shalabh | it's a bit surprising that assignment will copy these objects |
23:11:54 | shalabh | so instances of any object i define will have similar semantics? |
23:12:36 | def- | yes, regular objects have value semantics, ref objects are not copied |
23:13:17 | shalabh | when you say value semantics - does that imply no copy when passed as arguments (something not usually associated with value semantics, but thats ok) |
23:13:31 | shalabh | right now i'm a bit confused about consistency thats all. |
23:13:50 | def- | oh right, that's different from strings (I'm not sure strins behave like that, I'm checking right now) |
23:14:01 | shalabh | ok |
23:15:30 | def- | ok, i see no copy being made for strings |
23:15:54 | shalabh | weird, the manual says they're copied on assignment and I saw that in the forums too. |
23:16:09 | def- | sure, if you write "var newStr = oldStr" a copy is made |
23:16:22 | shalabh | IMO no implicit copy is ideal behavior for strings and sequences (and all refs for that mater) |
23:16:30 | shalabh | If I want a copy I can ask for it. |
23:17:04 | shalabh | ah ok |
23:17:12 | * | jholland quit (Quit: Connection closed for inactivity) |
23:17:24 | shalabh | the surprising thing then is passing as arguments will not copy. |
23:17:36 | def- | regular objects get translated to a C struct on the stack, so they are copied |
23:17:41 | def- | why is that surprising? |
23:17:54 | def- | the called proc can't modify the string anyway. |
23:19:48 | shalabh | The main reason it's surprising is because assignment semantics don't match function argument semantic. In most languages they do. |
23:20:13 | shalabh | Also what can't be inferred is if returning a string from a function will copy it. |
23:20:20 | shalabh | Are strings allocated on the stack? |
23:20:30 | shalabh | (I doubt it, since they can grow) |
23:20:39 | def- | indeed, that's why strings are on the heap |
23:20:57 | shalabh | similar to ref objects then? |
23:22:10 | Jehan_ | Yes, they're allocated on the stack. |
23:22:22 | Jehan_ | Eh, heap. |
23:22:25 | shalabh | ok |
23:22:36 | Jehan_ | You, can avoid copying by using `shallow`. |
23:23:02 | Jehan_ | Nevermind my typing skills (or lack thereof). :) |
23:23:26 | shalabh | so if I have |
23:23:33 | shalabh | new(my_ref_obj) |
23:23:42 | shalabh | var x = my_ref_obj |
23:23:46 | Jehan_ | I don't know why strings and seqs have copying semantics, only that they do (like C++). |
23:23:48 | shalabh | is the object copied? |
23:23:52 | Jehan_ | No. |
23:24:02 | shalabh | that's the inconsistency that's surprising |
23:24:12 | Araq | no, it's not inconsistent |
23:24:15 | Jehan_ | Not an inconsistency. |
23:24:16 | shalabh | also, annoying because who wants to copy strings all over the place? |
23:24:26 | Araq | in fact, strings and seqs do copy for consistency reasons |
23:24:34 | shalabh | ah ok |
23:24:39 | shalabh | then I'm missing something |
23:24:42 | Jehan_ | Having copying semantics is orthogonal to whether something's allocated on the heap. |
23:24:52 | shalabh | ok, agreed. |
23:25:40 | * | TEttinger joined #nim |
23:25:42 | Jehan_ | The main problem with copying strings/seqs is not the semantics, anyway, but the unexpected overhead that this may result in. |
23:25:59 | shalabh | well - if strings/seqs are consistent, what are they consistent with? |
23:26:10 | def- | shalabh: with all other non-ref objects/types |
23:26:22 | Jehan_ | Similar to this issue: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ |
23:26:39 | shalabh | but I can define a 'ref MyObject' - can I define 'ref string' ? |
23:26:47 | def- | Jehan_: Yes, when optimizing performance I nearly always run into strings and seqs being allocated and copied too much |
23:26:56 | Jehan_ | shalabh: Yes. |
23:27:28 | shalabh | ah ok - so strings and seq are similar in semantics to value types? |
23:27:45 | Jehan_ | They are value types. |
23:27:51 | shalabh | hmm |
23:27:57 | shalabh | ok let me play around maybe it's not a big deal |
23:28:13 | shalabh | I thought there were 3 categories - values types, ref types and then strings/seq |
23:28:39 | Jehan_ | Note that passing arguments to or results from a procedure does not result in that argument being copied. |
23:28:52 | * | epichero quit (Remote host closed the connection) |
23:28:52 | Jehan_ | string/seq are variable length value types. |
23:29:03 | Jehan_ | The variable length mandates the heap allocation. |
23:29:08 | shalabh | Jehan_:is that true for value types as well (passing arguments and return values don't copy) |
23:29:14 | Jehan_ | Correct. |
23:29:23 | shalabh | Jehan_:I agree the heap allocation is orthogonal. |
23:29:30 | Jehan_ | It works because non-var arguments are immutable. |
23:29:35 | shalabh | I'm concerned about semantics and then performance. |
23:29:45 | * | Demos joined #nim |
23:30:18 | Jehan_ | As I said, if performance is an issue, use `shallow` and `shallowCopy`. |
23:30:28 | * | epichero_ joined #nim |
23:30:40 | shalabh | sure, it's just tedious |
23:30:56 | Araq | semantics are just fine and natural this way. performance well... performance is not bad unless you write OO-ish code with setters and getters |
23:31:12 | Jehan_ | Yup. My personal stdlib has functionality to simplify that. |
23:31:38 | Jehan_ | It's not just setters and getters. |
23:31:50 | Araq | also ... the semantics allow for c++'s small string optimizations |
23:31:56 | Jehan_ | One of the places where I ran into serious issues was a directed graph library where the nodes were strings. |
23:32:08 | * | Demon_Fox_ joined #nim |
23:32:13 | Araq | which we currently don't do, but will try out one day |
23:32:26 | shalabh | I'm so used to writing python where references are everywhere. so 'a=b' will never copy anything. Even for mutable objects. |
23:32:55 | Araq | that doesn't work in a systems programming language which embraces value based datatypes |
23:33:05 | Araq | Nim has the same problems as C++ in this aspect |
23:33:11 | Araq | for the very same reasons |
23:33:36 | shalabh | hmm ok |
23:33:41 | shalabh | so lets say I want a list of strings |
23:33:57 | shalabh | would that be a seq of ref strings? |
23:33:59 | * | Demon_Fox quit (Ping timeout: 245 seconds) |
23:34:21 | Jehan_ | seq of strings. |
23:35:51 | Araq | shalabh: in fact, copying semantics means the semantics are close to Python's immutable strings |
23:37:02 | shalabh | and if i loop over them to find a string, assign to x and break - is that a string copy? |
23:38:56 | def- | shalabh: yes |
23:39:01 | * | Demon_Fox__ joined #nim |
23:39:02 | def- | except if you use shallowCopy |
23:40:28 | shalabh | Araq: maybe, but lists in Pyhon are mutable and never copied implicitly |
23:40:37 | shalabh | so are dicts |
23:40:55 | Araq | yeah Python is not consistent |
23:41:11 | Araq | it has mutable and immutable data structures ;-) |
23:41:24 | Araq | we only have values and refs :P |
23:41:41 | shalabh | somehow the mutable/immutable structures don't bother me. |
23:42:13 | reactormonk | Araq, is a string that's not a var copied via shallowCopy? |
23:42:23 | Araq | me neither, I just find immutable strings stupid |
23:42:27 | shalabh | also from a practical point of view - I understand value types will be copied - often they are very small. strings otoh may often be large. |
23:43:01 | * | Demon_Fox_ quit (Ping timeout: 264 seconds) |
23:43:06 | Araq | well conceptually you don't know or care about the sizes |
23:44:45 | Jehan_ | Well, from a practical overview, the data duplication is an issue. |
23:45:02 | Jehan_ | point of view. Sigh. |
23:45:16 | Jehan_ | I'm tired. I need to go to bed. Night. :) |
23:45:21 | shalabh | good night |
23:45:22 | * | Jehan_ quit (Quit: Leaving) |
23:47:46 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:48:26 | shalabh | anyway |
23:48:43 | shalabh | i'll just play around a bit more and see if I still have concerns |
23:49:03 | * | tillzy quit (Read error: Connection reset by peer) |
23:50:44 | shalabh | If I can't pinpoint the inconsistency then I'll be happy |
23:51:52 | shalabh | strings being value types is not the main issue. with other values types, I can use 'refs' where I dont want copying. If I can do the same with strings in all cases then it should be fine. |
23:52:34 | * | bjz joined #nim |
23:55:20 | Araq | you can do 'ref string' but usually it's not done |
23:56:57 | shalabh | any downside? |
23:58:41 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |