<< 10-03-2015 >>

00:02:44*Matthias247 quit (Read error: Connection reset by peer)
00:07:44Araqekarlso: 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:45ggibsonquick question: is the 'posix' module cross platform? My guess is that it is not.
00:50:23ggibsonBy 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:25Araqggibson: no, they will not
00:57:59Araqthe os and osproc modules are OS independent wrappers for parts of posix
00:58:53Araqwhat you can do on windows is to compile via cygwin or mingw, these posix compatibility layers
00:59:05Araq*these are
01:00:05ggibsonAh, 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:28Araqreactormonk: some tests now produce reInvalidPeg that used to work ...
09:19:39ekarlsoAraq: what you mean by glboal variables ?
09:20:21Araqekarlso: just pastebin/gist your code please and I can tell you why it's not gcsafe
09:25:07*tumult joined #nim
09:34:11ekarlsohttps://bpaste.net/show/47b7265aeff6 Araq
09:36:41Araqekarlso: 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:13ekarlsoAraq: how you make it gc safe then :/
09:46:51ekarlsodom96: you aroun ?
09:46:51Araqekarlso: do you use --threads:on?
09:46:56ekarlsoAraq: yeah
09:47:10Araqbut you don't use threads?
09:47:14ekarlsohttps://github.com/nim-lang/nimbuild/blob/rewrite/src/builder/asyncproc.nim < that's it
09:47:19dom96asyncproc uses threads
09:47:41ekarlsoso dom96, how do I solve it ? :p
09:47:57dom96dunno
09:48:03dom96does --threadAnalysis:off not work?
09:50:35Araq--threadanalysis:off is not an official switch btw
09:53:18ekarlsodom96: have you gotten asyncproc to compile before ?
09:53:30dom96yes
09:53:43*bw_ quit (Remote host closed the connection)
09:53:47dom96https://github.com/nim-lang/nimbuild/blob/rewrite/src/builder/asyncproc.nim#L129
09:53:52dom96This worked the last time I tried it
09:55:21*TEttinger quit (Ping timeout: 264 seconds)
10:04:04ekarlsodom96: can it be that jester and asyncproc doesnt play well ?
10:04:16dom96perhaps
10:04:31ekarlsofeck :(
10:04:59ekarlsohttps://bpaste.net/show/4923783ba2f2 < is what I get when compiling
10:05:49ekarlsooh
10:06:20ekarlsothreadanalysis:off did work :/
10:06:26ekarlsodunno how I did not make it work yesterday
10:07:14ekarlsoso global vars are not gc safe at all ?
10:08:57Araqactually they are not threadsafe, since they belong to the main thread
10:09:18ekarlsoso how does one fix that ? :P
10:09:21ekarlsoI guess not possible :/
10:10:01Araqyou better pass the data around explicitly ;-)
10:10:21Araqor use a TChannel
10:10:30ekarlsogawd :P
10:11:23ekarlsohow does a asyncproc signal that it's finished kinda ?
10:11:40ekarlsomy program now doesnt get passed the run.execute() asnyc method
10:14:22*davidhq joined #nim
10:16:49ekarlsohow fun dom96 now the whole program hangs :d
10:17:27ekarlsomeh, nvm me
10:17:31ekarlsoI need more coffee :|
10:17:44dom96how are you using asyncproc?
10:18:10ekarlsodom96: gimme 10 :p, i've slept like 2.5 hours tonight so caffeine levels are not functioning atm :/
10:18:21ekarlsolittle kiddo keeping us awake :p
10:22:20Araqoh ffs
10:22:40Araqreactormonk: you pass expectedMsg as the PEG pattern!
10:22:57ekarlsoAraq: you got small babies in the house ? :p
10:23:15AraqAraq: not anymore
10:23:41ekarlsogrown up or smth? ^
10:24:55*bcinman joined #nim
10:28:14Araqekarlso: 1.5 and 3 years old
10:28:33ekarlsoah
10:28:36ekarlso:d
10:33:32ekarlsowhat does it mean when "illegal capture foo" inside a async proc ?
10:36:17Araqyou cannot capture 'foo' in a closure. usually 'foo' is a var parameter
10:36:25Araqor an openArray
10:36:48Araqyou need to copy it into a local variable and then capture that
10:37:10Araqcausing a copy of course, but then that's the only thing that's safe
10:37:29Araqor 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:59ekarlsodom96: so now I got it runnign asyncproc! :)
10:55:40dom96ekarlso: cool
10:55:47dom96what did you have to change?
10:56:05ekarlsodom96: just cleanup my code ;P
10:56:32dom96hehe
10:56:58ekarlsobut hmm
10:57:10ekarlsohttps://bpaste.net/show/26d2bb2bcdb8
10:57:14ekarlsothat has me a bit beffled
10:57:16ekarlsobaffled
10:58:13ekarlsohappens after 1-3 requests :/
11:00:05ekarlsoany pointrs dom96 ?
11:01:35dom96that's weird
11:01:43dom96that looks like a bug
11:01:49dom96in asyncdispatch
11:01:52ekarlsodom96: got time to take a look or ? ^
11:01:59dom96can you show me your code?
11:02:04ekarlsoI can post up my code to gh
11:04:29ekarlsohttps://github.com/ekarlso/nim-playpen/tree/asyncproc dom96
11:06:38*vendethiel joined #nim
11:06:51dom96you shouldn't create a new executor for each execute call
11:07:03dom96and you should NEVER discard futures
11:07:09dom96remove that discardable pragma
11:08:42ekarlsok
11:09:04ekarlsodo await instead ?
11:09:20dom96that depends
11:09:29dom96do you want it to wait for it to finish?
11:09:41ekarlsoi dont want it to block no
11:09:55dom96it won't block
11:10:19ekarlsook :)
11:10:44ekarlsowhere do I place the executor though then ?
11:10:48dom96you should do await
11:10:56dom96because the code after the execute call
11:11:00dom96depends on the result of it
11:11:22dom96a global variable
11:11:34ekarlsoI thought those where bad :P
11:11:45ekarlsoaccording to mr Araq
11:12:11dom96you already use tons of them anyway...
11:12:30ekarlsoheh, i'm thinking of killing that when I get the time :/
11:12:32dom96you probably shouldn't do that :P
11:12:34*akiradeveloper joined #nim
11:12:47ekarlsowell that was before I was using threads :p
11:12:54akiradeveloperhow to know the arity of a function?
11:12:59dom96shouldn't do that even without them :P
11:13:12dom96but you can make it a local var later
11:13:24dom96to do that you will need to put routes inside a proc
11:13:33dom96something which currently doesn't work
11:13:38ekarlsodoh :p
11:13:58Araqakiradeveloper: depends. are you in a macro?
11:14:24ekarlsodom96: u need to give jester some more love :p
11:14:32dom96ekarlso: pretty sure it's a nim bug
11:15:51*akiradeveloper quit (Remote host closed the connection)
11:18:32ekarlsodom96: still it would be cool to see more stuff in jester :)
11:18:38ekarlsolike a way to handle exceeptions better
11:20:15dom96sure
11:20:38Araqdom96: pretty sure you're holding it wrong :P
11:21:06ekarlsoand hmmms dom96 a way to do auth as well instead of doing the same code pr route would be awesome too
11:21:50dom96ekarlso: create issues please
11:22:05*davidhq joined #nim
11:22:09ekarlsosure :p
11:22:17*akiradeveloper joined #nim
11:22:28akiradeveloperno. I am in a proc
11:25:51*teef joined #nim
11:27:55Araqakiradeveloper: well then why do you need to know the arity?
11:29:23akiradeveloperAraq: In Messagepack-RPC, I want to check the number of args passed is equal to the arity of the function requested
11:30:06Araqhow do you invoke a function of unknown arity in Nim in a non-meta context?
11:31:59Araqmacro arity(n: stmt): int = newLit(n.getType.len - 1) # might work with devel
11:36:50akiradeveloperAraq: I want to use the arity macro but I don't like to use devel for my development. No way with master?
11:38:25Araqthere is typetraits.arity but not sure if that works
11:39:08Araqtypetraits never got much love from me, since I never know how to handle 'typedesc' in the VM ;-)
11:40:39Araqbut again, how do you invoke a function of unknown arity in Nim in a non-meta context?
11:43:07akiradeveloperfor 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:37fowlarity() could be rewritten using getType() now
11:45:21Araqakiradeveloper: well Nim is statically typed
11:45:35Araqthere is no way to invoke 'f' with a wrong number of arguments anyway
11:45:48Araq(if you don't 'cast' the proc type)
11:46:21akiradeveloperAraq: I see what you mean.
11:46:27akiradeveloperthanks
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:10teefI 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:22Araqteef: what's the problem? the converter is not called?
12:37:03teefWell it might just be the library I am using https://gist.github.com/lateefj/7364f68724f6f377933f
12:39:04teefI 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:34Araqwell the converter is not exported
12:39:47Araqthere should be another way to get the underlying object
12:40:04Araqor maybe you need to hack nimborg for that
12:41:31*akiradeveloper joined #nim
12:44:10teefArag: I see so I should be able to just export the converter
12:45:09*vendethiel quit (Ping timeout: 256 seconds)
12:46:02Araqyes
12:48:07Araqteef: is nimborg maintained? iirc the original dev left
12:49:23teefAraq: good question
12:49:34Araqfork it and take over ;-)
12:51:31teefTaken: https://github.com/lateefj/NimBorg I exported and now testing
12:52:41Araqbtw I don't think you should export that, instead add what you need to the API
12:55:58*madmalik joined #nim
12:57:56teefI really just tryng to support the len(obj) operation
13:02:57*mpthrapp_ joined #nim
13:03:53novisthow do i convert between string/cstring?
13:03:54*vendethiel joined #nim
13:05:07def-myStr.cstring to get the cstring
13:05:31novistactually i need cstring -> string
13:06:02def-$
13:06:17novist/facepalm
13:06:19novistthank you
13:07:09def-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:44ekarlsoso 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:35def-right, you made a copy
13:14:08ekarlsofack
13:15:45*ggVGc joined #nim
13:15:53ekarlsowhat's the best pattern for that ?
13:16:06ekarlsodont modify the object in the proc but return and modify above the proc ?
13:16:53ggVGcis there documentation of exactly what in nim creates GC'ed allocations?
13:20:21dom96ekarlso: pass a ref
13:20:37def-ggVGc: you can use --gc:none to find out what in your code uses GC at least
13:21:21def-ggVGc: generally strings, seqs and ref objects are on the heap, so they are GCed
13:22:58ekarlsodom96: isn't that unsafe ?
13:23:09dom96refs are traced
13:23:22dom96you'll likely need to use refs everywhere though
13:23:33ekarlso:/
13:23:42*saml_ quit (Ping timeout: 252 seconds)
13:24:07dom96using a ptr would be unsafe
13:24:14dom96but would take less refactoring
13:25:54*vendethiel quit (Ping timeout: 252 seconds)
13:26:15ekarlsohmm
13:26:17ekarlsoproc execute*(self: ref Run, playPath: string, versionsPath: string) {.async.} =
13:26:24ekarlsoaint that correct ?
13:27:22*teef quit (Ping timeout: 246 seconds)
13:32:15*akiradeveloper quit ()
13:38:57dom96Depends what Run is.
13:40:09ekarlsoobject
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:49ekarlsook dom96 that should make it fully async at least using asyncproc :)
14:09:02*BlaXpirit joined #nim
14:09:10dom96cool
14:09:16*BitPuffin joined #nim
14:14:33ekarlsonow just to fix validation stuff also :/
14:17:33ekarlsodom96: what options needs to be available ?
14:18:35dom96Being able to pass any flag would be nice.
14:21:15novistpassL pragma can pass paths to compiler like -l/usr/lib/something.so or -L/usr/lib too right?
14:22:06def-novist: --passL:-l/usr/lib/something.so
14:22:26novistkk, just making sure its what i expect it is. thanks
14:22:26def-should work
14:28:15ekarlsounsure of how to make the input safe in that case def- ..
14:30:44*arnetheduck joined #nim
14:30:55def-ekarlso: what?
14:32:11fowlnovist, passL passes to linker, passC passes to compiler
14:35:13ekarlsodef-: so that one cant do like flaviu did you ass in like < > ;)
14:36:22def-ekarlso: i have no idea what you're talking about
14:37:24ekarlsodef-: nvm me then :p
14:49:01*jholland joined #nim
15:27:07*darkf quit (Quit: Leaving)
15:56:05arnetheduckhi, 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:58def-arnetheduck: something like ++? I'd consider that bad style but you can write your own of course
16:01:05def-I don't think it's in the stdlib
16:01:13*^aurora^ joined #nim
16:03:27*sampwing joined #nim
16:09:53BlaXpiritinc should just return the value indeed
16:10:01*ChrisMAN joined #nim
16:10:16BlaXpiritthat doesn't necessarily mean any performance overhead
16:11:07*quasinoxen quit (Ping timeout: 245 seconds)
16:11:26*quasinoxen joined #nim
16:11:55novistwhen i run ./koch tests im greeted with "Nim/tests/testament/tester.nim(15, 21) Error: cannot open 'compiler/nodejs'"
16:12:01novistis there more to running testsuite?
16:21:14*wb quit (Read error: Connection reset by peer)
16:21:19reactormonkAraq, -.- so much for type testing
16:22:18def-novist: you have the compiler/nodejs.nim?
16:22:21*quasinoxen quit (Ping timeout: 264 seconds)
16:22:36*quasinoxen joined #nim
16:22:43novistits there
16:24:00def-novist: strange, it works for me. are you sure you're compiling with the right version of nim?
16:24:39novistwell i have installed latest version of devel branch and compiled but not installed same thing + my modifications
16:25:07novisti noticed import statement is like compiler/nodejs. but thats probably ok? that slash?
16:25:20def-yes, that's fine
16:25:34def-nim -v shows the right version?
16:25:56def-I think ./koch tests uses nim from your PATH
16:26:04novist0.10.3
16:26:35novistill see if adding compiler dir to path does any difference (bin i want to test is there after all)
16:27:05novisthey that worked
16:27:36*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:34:22*banister joined #nim
16:35:18arnetheduckdef-, 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:01OderWat@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:30novisti dont quite get it. what i expected is that koch would run tests on compiler that was built in current source tree
16:57:52def-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:17ekarlsoflaviu: 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:27Araqso ... 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:54Araqbut when we do the same with initT and newT it's all Nim's fault
19:24:21Araqand we must fix it by making the language more complex
19:26:03reactormonkAraq, I'm all for return type overloading
19:26:23*fizzbooze joined #nim
19:37:31emilspAraq, 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:48Araqfowl: 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:48filcucVarriount: are you there?
19:59:10*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:59:51*bcinman joined #nim
20:02:02filcucHi all, i'm experiencing the issue i described here in the forum (http://forum.nim-lang.org/t/955/1#6144)
20:02:22filcucbasically 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:44filcucwhen my app use the dynlib pragma for loading some symbols from one dll
20:03:01*saml joined #nim
20:03:03filcucbasically i don't get this error if i compile my program with the cpp compiler
20:03:11filcucinstead of the C compiler
20:03:25filcuc(so invoking nim with the 'cpp' flag)
20:04:33filcucmy lib is meant to be a wrapper for a cpp library (so it links the cpp library it wraps)
20:04:46filcucand has a C interface
20:04:57filcucthat is meant to be used from nim
20:05:15filcucthis issue happen (at the moment) only on windows
20:05:28filcucon linux i'm not experiencing this kind of issue
20:05:37ekarlsoAraq: how would you like the compiler args to be presented on the play site ?
20:05:49emilsphey, why does this line -> var arx = array[0..255, array[0..127, int] ] make the compiler fail with Error: internal error: GetUniqueType
20:06:50Araqfilcuc: are you sure you got the calling conventions right?
20:07:17AraqNim defaults to register calling convention on Windows, so it's neither cdecl nor stdcall
20:07:35Araqemilsp: = vs :
20:07:50Araqthat's fixed in devel, I hope
20:08:35Araqekarlso: just make a string input field. If I want to change the args, I surely know the string representation of it
20:09:18filcucAraq: in my nim files i specified the .cdecl calling convetion
20:09:43Araqfilcuc: but maybe it's stdcall instead? ;-)
20:09:45filcucwhat should i do? i though that it was the default when creating/importing a c library
20:09:51ekarlsoAraq: so dont like to have it like selects / switches ? :p
20:10:28Araqekarlso: can I copy&paste into selects/switches? :P
20:12:06filcucAraq: 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:11filcucor both ? :D
20:12:37Araqwell try it with .stdcall
20:14:11filcucok, 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:43Araqdoes your QML use callbacks and threads?
20:18:21filcucwell..yes i think. For sure there's a UI thread and a Render Thread
20:18:49filcucbut i'm supposing to received all the callbacks for the UI thread (that it's the main thread)
20:19:02filcucso the one that execute the main proc
20:21:36Araqok, well you can validate this assumption with getThreadId() or whatever it's called
20:21:58filcucAraq: just tested the following configuration (dynlib + C compiler + .stdcall) and i get that strange error at exit
20:23:45filcucand with (dynlib + C++ compiler + .stdcall) no error
20:27:45filcucbtw the error message compare after the execution of my nim code (so i think that happen in a C generated part)
20:27:58filcucprobably due to some dll unloading
20:28:12filcuc(maybe :) )
20:33:17filcuci can create a small test case
20:33:22filcuchowever i need to bundle the .dll
20:33:36Araqhrm your macros use more lines of code than dom96's async transformation
20:34:09Araqour 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:53filcucAraq: 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:05filcucthank you all, cya
21:14:28*filcuc quit ()
21:15:56Araqfilcuc: {.cdecl, dynlib:"libDOtherSide.so", importc.} ?
21:16:11Araqdo 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:40flaviuekarlso: 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:29Mat4hello
22:19:34federico3is anybody using nim-fuse?
22:26:57reactormonkI'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:13Araqreactormonk: don't ask me, I love case statements
22:38:52reactormonkoh right
22:38:54Mat4reactormonk: defining two assembler macros embedding subroutine branch and subroutine-return opcode lead to subroutine-threading, which allows using side-effect free procedures
22:39:19Mat4this way the case statement is avoidable
22:40:00reactormonkMat4, 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:00reactormonkMat4, 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:31def-^aurora^: devel branch?
22:42:23Mat4reactormonk: 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:42shalabhhello
23:06:46shalabhFrom the manual "The assignment operator for strings always copies the string"
23:07:35shalabhwhy?
23:07:45def-hi shalabh
23:08:19def-because strings are mutable and it are supposed to have value semantics by default
23:08:26def-but you can mark a string as shallow
23:08:29def-then it won't be copied
23:08:30shalabhright
23:08:43shalabhwhat if I pass strings as function arguments?
23:08:46shalabhcopy or no copy?
23:09:27def-if it's a regular (non-var) argument, the argument will be immutable, so it doesn't need to be copied
23:09:47def-If it's a var argument, no copy necessary because you want to modify the original string
23:10:47shalabhok, what about tables - similar semantics? copy on assignment and no copy on function calls?
23:11:07def-yes
23:11:19def-if you don't want that you can use TableRef for ref semantics
23:11:24shalabhinteresting
23:11:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:11:40shalabhit's a bit surprising that assignment will copy these objects
23:11:54shalabhso instances of any object i define will have similar semantics?
23:12:36def-yes, regular objects have value semantics, ref objects are not copied
23:13:17shalabhwhen 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:31shalabhright now i'm a bit confused about consistency thats all.
23:13:50def-oh right, that's different from strings (I'm not sure strins behave like that, I'm checking right now)
23:14:01shalabhok
23:15:30def-ok, i see no copy being made for strings
23:15:54shalabhweird, the manual says they're copied on assignment and I saw that in the forums too.
23:16:09def-sure, if you write "var newStr = oldStr" a copy is made
23:16:22shalabhIMO no implicit copy is ideal behavior for strings and sequences (and all refs for that mater)
23:16:30shalabhIf I want a copy I can ask for it.
23:17:04shalabhah ok
23:17:12*jholland quit (Quit: Connection closed for inactivity)
23:17:24shalabhthe surprising thing then is passing as arguments will not copy.
23:17:36def-regular objects get translated to a C struct on the stack, so they are copied
23:17:41def-why is that surprising?
23:17:54def-the called proc can't modify the string anyway.
23:19:48shalabhThe main reason it's surprising is because assignment semantics don't match function argument semantic. In most languages they do.
23:20:13shalabhAlso what can't be inferred is if returning a string from a function will copy it.
23:20:20shalabhAre strings allocated on the stack?
23:20:30shalabh(I doubt it, since they can grow)
23:20:39def-indeed, that's why strings are on the heap
23:20:57shalabhsimilar to ref objects then?
23:22:10Jehan_Yes, they're allocated on the stack.
23:22:22Jehan_Eh, heap.
23:22:25shalabhok
23:22:36Jehan_You, can avoid copying by using `shallow`.
23:23:02Jehan_Nevermind my typing skills (or lack thereof). :)
23:23:26shalabhso if I have
23:23:33shalabhnew(my_ref_obj)
23:23:42shalabhvar x = my_ref_obj
23:23:46Jehan_I don't know why strings and seqs have copying semantics, only that they do (like C++).
23:23:48shalabhis the object copied?
23:23:52Jehan_No.
23:24:02shalabhthat's the inconsistency that's surprising
23:24:12Araqno, it's not inconsistent
23:24:15Jehan_Not an inconsistency.
23:24:16shalabhalso, annoying because who wants to copy strings all over the place?
23:24:26Araqin fact, strings and seqs do copy for consistency reasons
23:24:34shalabhah ok
23:24:39shalabhthen I'm missing something
23:24:42Jehan_Having copying semantics is orthogonal to whether something's allocated on the heap.
23:24:52shalabhok, agreed.
23:25:40*TEttinger joined #nim
23:25:42Jehan_The main problem with copying strings/seqs is not the semantics, anyway, but the unexpected overhead that this may result in.
23:25:59shalabhwell - if strings/seqs are consistent, what are they consistent with?
23:26:10def-shalabh: with all other non-ref objects/types
23:26:22Jehan_Similar to this issue: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ
23:26:39shalabhbut I can define a 'ref MyObject' - can I define 'ref string' ?
23:26:47def-Jehan_: Yes, when optimizing performance I nearly always run into strings and seqs being allocated and copied too much
23:26:56Jehan_shalabh: Yes.
23:27:28shalabhah ok - so strings and seq are similar in semantics to value types?
23:27:45Jehan_They are value types.
23:27:51shalabhhmm
23:27:57shalabhok let me play around maybe it's not a big deal
23:28:13shalabhI thought there were 3 categories - values types, ref types and then strings/seq
23:28:39Jehan_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:52Jehan_string/seq are variable length value types.
23:29:03Jehan_The variable length mandates the heap allocation.
23:29:08shalabhJehan_:is that true for value types as well (passing arguments and return values don't copy)
23:29:14Jehan_Correct.
23:29:23shalabhJehan_:I agree the heap allocation is orthogonal.
23:29:30Jehan_It works because non-var arguments are immutable.
23:29:35shalabhI'm concerned about semantics and then performance.
23:29:45*Demos joined #nim
23:30:18Jehan_As I said, if performance is an issue, use `shallow` and `shallowCopy`.
23:30:28*epichero_ joined #nim
23:30:40shalabhsure, it's just tedious
23:30:56Araqsemantics 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:12Jehan_Yup. My personal stdlib has functionality to simplify that.
23:31:38Jehan_It's not just setters and getters.
23:31:50Araqalso ... the semantics allow for c++'s small string optimizations
23:31:56Jehan_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:13Araqwhich we currently don't do, but will try out one day
23:32:26shalabhI'm so used to writing python where references are everywhere. so 'a=b' will never copy anything. Even for mutable objects.
23:32:55Araqthat doesn't work in a systems programming language which embraces value based datatypes
23:33:05AraqNim has the same problems as C++ in this aspect
23:33:11Araqfor the very same reasons
23:33:36shalabhhmm ok
23:33:41shalabhso lets say I want a list of strings
23:33:57shalabhwould that be a seq of ref strings?
23:33:59*Demon_Fox quit (Ping timeout: 245 seconds)
23:34:21Jehan_seq of strings.
23:35:51Araqshalabh: in fact, copying semantics means the semantics are close to Python's immutable strings
23:37:02shalabhand if i loop over them to find a string, assign to x and break - is that a string copy?
23:38:56def-shalabh: yes
23:39:01*Demon_Fox__ joined #nim
23:39:02def-except if you use shallowCopy
23:40:28shalabhAraq: maybe, but lists in Pyhon are mutable and never copied implicitly
23:40:37shalabhso are dicts
23:40:55Araqyeah Python is not consistent
23:41:11Araqit has mutable and immutable data structures ;-)
23:41:24Araqwe only have values and refs :P
23:41:41shalabhsomehow the mutable/immutable structures don't bother me.
23:42:13reactormonkAraq, is a string that's not a var copied via shallowCopy?
23:42:23Araqme neither, I just find immutable strings stupid
23:42:27shalabhalso 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:06Araqwell conceptually you don't know or care about the sizes
23:44:45Jehan_Well, from a practical overview, the data duplication is an issue.
23:45:02Jehan_point of view. Sigh.
23:45:16Jehan_I'm tired. I need to go to bed. Night. :)
23:45:21shalabhgood night
23:45:22*Jehan_ quit (Quit: Leaving)
23:47:46*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:48:26shalabhanyway
23:48:43shalabhi'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:44shalabhIf I can't pinpoint the inconsistency then I'll be happy
23:51:52shalabhstrings 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:20Araqyou can do 'ref string' but usually it's not done
23:56:57shalabhany downside?
23:58:41*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)