<< 26-09-2016 >>

00:05:49*ftsf_ joined #nim
00:13:38*yglukhov joined #nim
00:18:32*yglukhov quit (Ping timeout: 265 seconds)
00:49:11*starbux quit (Remote host closed the connection)
00:49:50*starbux joined #nim
00:53:02*nsf quit (Quit: WeeChat 1.5)
00:56:01*yglukhov joined #nim
01:00:37*yglukhov quit (Ping timeout: 255 seconds)
01:02:44*spindle quit (Quit: Leaving)
01:28:04*ftsf_ quit (Ping timeout: 255 seconds)
01:38:31*kulelu88 quit (Quit: Leaving)
01:39:41*ftsf_ joined #nim
01:40:47*chemist69 quit (Ping timeout: 265 seconds)
01:53:59*chemist69 joined #nim
01:59:34*ftsf_ quit (Ping timeout: 255 seconds)
01:59:38*yglukhov joined #nim
02:03:47*yglukhov quit (Ping timeout: 244 seconds)
02:11:31*ftsf_ joined #nim
02:38:17ftsf_hmm should foreign thread functions be marked with {.thread.} ?
03:03:12*yglukhov joined #nim
03:07:56*yglukhov quit (Ping timeout: 252 seconds)
03:24:36*Trioxin joined #nim
03:25:03*starbux quit (Ping timeout: 272 seconds)
03:45:55*brechtm joined #nim
03:50:48*brechtm quit (Ping timeout: 265 seconds)
03:52:10*yglukhov joined #nim
03:55:00FromGitter<gogolxdong> How to return ptr object with constructor?
03:56:54*yglukhov quit (Ping timeout: 264 seconds)
04:12:01FromGitter<endragor> @ftsf_: if you want to call it from Nim, make Nim `{.thread.}` proc and call it from there, wrap it as usual (without `{.thread.}`)
04:22:46ftsf_endragor, So the C library (SDL2) registers a callback which it calls from another thread. The callback is a nim proc in this case, but i'm not sure whether it should have {.thread.} or not
04:24:32FromGitter<endragor> it shouldn’t, but it should call `setupForeignThreadGc()` at the beginning
04:25:13ftsf_yep, i am calling that (when I can, not supported where I have to use tlsEmulation:on)
04:25:25ftsf_when tlsEmulation is on I get crashes D:
04:25:34ftsf_not sure how to avoid that
04:25:40ftsf_thanks though!
04:34:45*yglukhov joined #nim
04:39:05*yglukhov quit (Ping timeout: 240 seconds)
04:41:41*ARCADIVS joined #nim
04:42:41*sp33der89 quit (Quit: I'll be back)
05:05:35*Trioxin quit (Quit: Quitting.)
05:13:44*zielmicha_ joined #nim
05:16:01*SianaGea1z joined #nim
05:17:09*yglukhov joined #nim
05:20:02*NoJoke joined #nim
05:20:06*Amrykid2 joined #nim
05:20:10*Vendan_ joined #nim
05:20:14*gsingh93- joined #nim
05:20:23*bodie__ joined #nim
05:20:33*SirCmpwn_ joined #nim
05:20:58*ThisIsZenified quit (*.net *.split)
05:20:58*federico3 quit (*.net *.split)
05:20:59*gsingh93 quit (*.net *.split)
05:20:59*zielmicha quit (*.net *.split)
05:21:00*SirCmpwn quit (*.net *.split)
05:21:00*Sergio965 quit (*.net *.split)
05:21:01*nim-buildbot quit (*.net *.split)
05:21:02*SianaGearz quit (*.net *.split)
05:21:04*Amrykid quit (*.net *.split)
05:21:05*bodie_ quit (*.net *.split)
05:21:05*Vendan quit (*.net *.split)
05:21:05*Xe quit (*.net *.split)
05:21:05*ftsf quit (*.net *.split)
05:21:05*reactormonk quit (*.net *.split)
05:21:06*heinrich5991 quit (*.net *.split)
05:21:07*bodie__ is now known as bodie_
05:21:23*gsingh93- is now known as gsingh93
05:21:32*zielmicha_ is now known as zielmicha
05:21:40*yglukhov quit (Ping timeout: 265 seconds)
05:22:02*Xe joined #nim
05:22:04*heinrich5991 joined #nim
05:23:09*Sergio965 joined #nim
05:27:18*ftsf joined #nim
05:27:58*federico3 joined #nim
05:28:11*reactormonk joined #nim
05:38:40*gokr joined #nim
05:47:30*wgf_ joined #nim
05:52:35*gokr quit (Ping timeout: 260 seconds)
06:03:51*mcc quit (Quit: Connection closed for inactivity)
06:04:33*desophos quit (Read error: Connection reset by peer)
06:20:31*yglukhov joined #nim
06:24:52*yglukhov quit (Ping timeout: 244 seconds)
06:31:26*chemist69 quit (Ping timeout: 252 seconds)
06:49:35ftsf_anyone successfully using nim SDL2 with audio on OSX?
06:58:13*chemist69 joined #nim
06:58:22*PMunch joined #nim
07:00:56*yglukhov joined #nim
07:05:48*yglukhov quit (Ping timeout: 276 seconds)
07:07:05*vqrs quit (Ping timeout: 240 seconds)
07:08:00*girvo quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:08:27*girvo joined #nim
07:08:55*gokr joined #nim
07:09:04FromGitter<gogolxdong> like `result=ptr Histogram( ⏎ lowestTrackableValue:minValue, ⏎ highestTrackableValue:maxValue, ⏎ unitMagnitude:unitMagnitude.int64, ⏎ significantFigures:sigfigs.int64, ... [https://gitter.im/nim-lang/Nim?at=57e8c990ea1b6b1a6c6a1c24]
07:09:05*vqrs joined #nim
07:09:49FromGitter<gogolxdong> like ``` ⏎ result=ptr Histogram( ⏎ lowestTrackableValue:minValue, ⏎ highestTrackableValue:maxValue, ⏎ unitMagnitude:unitMagnitude.int64, ... [https://gitter.im/nim-lang/Nim?at=57e8c9bdea1b6b1a6c6a1c6f]
07:10:14FromGitter<gogolxdong> like
07:10:29FromGitter<gogolxdong> like```
07:11:00FromGitter<gogolxdong> like ``` ⏎ result=ptr Histogram( ⏎ lowestTrackableValue:minValue, ⏎ highestTrackableValue:maxValue, ⏎ unitMagnitude:unitMagnitude.int64, ... [https://gitter.im/nim-lang/Nim?at=57e8ca04ab9ba81255e3b155]
07:11:46FromGitter<gogolxdong> like ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=57e8ca32857ab70f7d401c55]
07:13:20ftsf_gogolxdong, that comes across very ugly in irc
07:13:33FromGitter<endragor> ```result = cast[ptr Histogram](alloc0(sizeof(Histogram))) ⏎ result[] = Histogram(…)``` ⏎ make sure `dealloc()` is called somewhere [https://gitter.im/nim-lang/Nim?at=57e8ca9d783fe9b94598f806]
07:18:50FromGitter<gogolxdong> @FromIRC sorry,I didn't know that,how can I make it better across?
07:19:11ftsf_use a gist or something?
07:19:20*Trustable joined #nim
07:19:44FromGitter<gogolxdong> @endragor thanks
07:23:42*girvo quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:24:13*brechtm joined #nim
07:24:58*brechtm_ joined #nim
07:28:47*brechtm quit (Ping timeout: 265 seconds)
07:29:44*Trioxin joined #nim
07:30:29Trioxincan I get a key out of a for loop or do I have to declare one outiside the statement?
07:31:35ftsf_Trioxin, what do you mean by a key?
07:32:34Trioxinsome langs you can define a key for for and foreach loops so on each iteration you have a variable indicating the number of iterations
07:32:45ftsf_oh right, yes you can do that
07:32:50ftsf_for i,v in foo:
07:32:58Trioxinthx
07:32:59ftsf_or for i,v in mpairs(foo):
07:38:56Trioxinis "lines" a reserved word for iterating through a file?
07:39:46ftsf_Trioxin, i don't think it's reserved
07:39:46Trioxinftsf_, I can't do it when iterating through a file like this: for cfgI,cfgLine in cfgLines "config.txt": and if I change cfgLines to lines I get "wrong number of variables"
07:40:16ftsf_lines is an iterator, the iterator has to support returning the second variable for the index
07:41:29Trioxinso it is reserved. because I don't have to declare lines
07:41:53ftsf_no it's just defined in a library
07:42:00ftsf_that you're importing
07:42:15ftsf_you could define your own lines that does what you want
07:42:47FromGitter<endragor> it’s in system module that is imported automatically
07:43:37FromGitter<MiniDude22> Hey guys any idea what I'm doing wrong trying to import the function GetWindowText?
07:43:40FromGitter<MiniDude22> proc getWindowText*(hWnd: Handle, lpString: cstring, nMaxCount: int): int {. ⏎ stdcall, importc: "GetWindowText", dynlib: "user32".}
07:45:51*PMunch quit (Quit: leaving)
07:47:07*lyro quit (Quit: WeeChat 1.1.1)
07:53:52*flyx quit (Quit: ZNC - http://znc.in)
07:54:25*flyx joined #nim
07:58:36FromGitter<Araq> @MiniDude22 maybe its importc: "GetWindowTextA"
07:59:18FromGitter<MiniDude22> You're right! I did get it to load it right with that, but calling it, i'm unable to print the result
07:59:51FromGitter<MiniDude22> ```var title: cstring ⏎ echo getWindowTextA( handle, addr(title), 256 ) ⏎ echo title.len``` [https://gitter.im/nim-lang/Nim?at=57e8d577ea1b6b1a6c6a48f1]
08:00:12FromGitter<MiniDude22> It gives me a SIGSEV
08:00:28FromGitter<MiniDude22> but getWindowTextA is printing out 23 for the length
08:00:38FromGitter<endragor> that’s because `title` buffer is not initialized (allocated)
08:01:39FromGitter<MiniDude22> Hrm. Okay how do you do that? *facepalm*
08:03:06FromGitter<Araq> var title: array[256, char]
08:03:25FromGitter<Araq> getWindowText(handle, title, title.len)
08:03:48FromGitter<Araq> or sizeof(title)
08:04:05FromGitter<MiniDude22> So then I need to change the import to work with the array right?
08:04:20FromGitter<Araq> no
08:04:38FromGitter<Araq> cstring is ok
08:05:08FromGitter<MiniDude22> gives me a type mismatch though :/
08:05:36*Trioxin left #nim ("Leaving room")
08:07:53*Andris_zbx joined #nim
08:08:36FromGitter<Araq> array of char is convertible to cstring
08:08:41FromGitter<Araq> don't use 'addr' here
08:09:58FromGitter<MiniDude22> Oh okay. So i got rid of add, and using ptr cstring in the import.
08:10:12FromGitter<MiniDude22> Sorry I'm new to this! Thank you for the help!
08:12:11FromGitter<MiniDude22> It seems to be working now!
08:13:10FromGitter<endragor> your wrapper was fine, you did something wrong in the end :)
08:13:56FromGitter<MiniDude22> I had changed it from what I'd sent earlier to try and make it work, so I needed to revert it for it to work with the char array. Thanks for the help guys!
08:15:45cheatfateAraq_, what is problem here? https://gist.github.com/cheatfate/563e2f83a9bcdf018b2aece510151781
08:17:10FromGitter<endragor> didn’t you mean `and 0b11`? Te’s length is 4, not 256
08:20:12cheatfateendragor: its stripped example Te in real has 256 elements
08:20:33cheatfatebut error still same
08:20:41FromGitter<endragor> what’s the error?
08:21:04cheatfatesorry forgot to add comment refresh please
08:21:54cheatfateAraq_, or this error happens because array indices must be signed integers?
08:23:41*ftsf_ quit (Remote host closed the connection)
08:23:47FromGitter<endragor> `int` is incompatible with `uint32`. declaring Te this way in your sample works: `Te: array[0'u32..3'u32, int] = [1, 2, 3, 4]`
08:25:08flyxarray indices must be Ordinals, as the error message says: proc `[]`[I: Ordinal, T](a: T; i: I): T
08:25:20flyxuints are not part of Ordinal
08:27:24FromGitter<endragor> type of array index is a part of array type defintion
08:28:26wgf_on my Linux system, it compiles without errors, cheatfate
08:29:43cheatfateendragor, thanks
08:30:45*nsf joined #nim
08:35:14FromGitter<endragor> @wgf_ I guess your system is 32-bit? I think it’s a bug that Nim type-checking depends on arch
08:36:07FromGitter<endragor> I was surprised by that, too, some time in the past
08:38:31wgf_no, using version 0.14.2 on Linux-64
08:39:03FromGitter<endragor> then maybe it’s some recent changes related to unsigned types
08:40:16wgf_yep
08:42:36*bjz_ joined #nim
08:47:21FromGitter<gogolxdong> can I access to a ptr object's method like `hdr.byteSize()` which is initialized through `result[]=Historgram(...)`
08:47:31*pie_ joined #nim
08:48:25FromGitter<endragor> `hdr[].byteSize()`. or enable `—experimental`, then `hdr.byteSize()` will work.
08:49:40FromGitter<gogolxdong> helpful
08:57:47*yglukhov joined #nim
09:04:45*Demon_Fox quit (Quit: Leaving)
09:06:07FromGitter<gogolxdong> How to assign a dynamic array to its field in the object constructor ?
09:06:35*SirCmpwn_ is now known as SirCmpwn
09:09:23*aziz joined #nim
09:13:50*jivank_ joined #nim
09:14:56FromGitter<gogolxdong> ` counts:newSeq[int64](0)` `(Attempt to read from nil?)`
09:15:41FromGitter<gogolxdong> `var hdr =new(1,1000,5) ⏎ echo hdr[].byteSize()`
09:33:17*aziz quit (Quit: Ex-Chat)
09:34:57FromGitter<Araq> replace the : by =
09:35:11FromGitter<Araq> counts=newSeq[int64](0)
09:36:19*brechtm_ quit (Remote host closed the connection)
09:36:28*fredrik92 joined #nim
09:36:44FromGitter<gogolxdong> ok
09:38:24FromGitter<gogolxdong> Is this new feature ?I didn't see from manual
09:39:28*chemist69 quit (Ping timeout: 255 seconds)
09:41:33FromGitter<gogolxdong> I mean counts:newSeq[int64](0) is the assignment in object constructor
09:41:58FromGitter<gogolxdong> `counts:newSeq[int64](0)`
09:42:40*chemist69 joined #nim
09:44:13*Trioxin joined #nim
09:44:31*brechtm joined #nim
09:45:11FromGitter<Araq> oh it's in an object constr, then the : was right :P and the problem is somewhere else
09:45:12Trioxinwhy would my program be sending "@[@[a, b, c, ]]" to the console even if I put quit() in the beginning of the program?
09:45:36FromGitter<Araq> trixoin because the modules you import produce this output
09:45:48FromGitter<Araq> use 'when isMainModule' in your imports
09:45:57FromGitter<Araq> but you asked about this before iirc
09:46:10Trioxinaraq, never did
09:46:13flyxgogolxdong: `counts: @[]` is shorter, but does the same thing.
09:46:44FromGitter<MiniDude22> Hey guys sorry for being such a bother. but am I using the callback enum right?
09:46:52FromGitter<MiniDude22> nim```proc enumWindows(lpEnumFunc: proc(handle: Handle, data: ptr DWORD): bool, lp: ptr DWORD): bool {. ⏎ stdcall, importc: "EnumWindows", dynlib: "user32".} ⏎ ⏎ type ⏎ window_data = ref object ... [https://gitter.im/nim-lang/Nim?at=57e8ee8cea1b6b1a6c6aa8fb]
09:47:16FromGitter<MiniDude22> crap...
09:47:34FromGitter<MiniDude22> > ```nim ⏎ proc enumWindows(lpEnumFunc: proc(handle: Handle, data: ptr DWORD): bool, lp: ptr DWORD): bool {. ⏎ stdcall, importc: "EnumWindows", dynlib: "user32".} ⏎ ⏎ type ... [https://gitter.im/nim-lang/Nim?at=57e8eeb6ea1b6b1a6c6aa970]
09:47:52FromGitter<MiniDude22> Eff me i cant get it to look like code...
09:49:24FromGitter<MiniDude22> Here?
09:49:25FromGitter<MiniDude22> https://gist.github.com/MiniDude22/5dc5e92147e9a403440d2dc184363611
09:49:52Trioxinaraq, what do you mean use when isMainModule: in my imports? Meaning I need to find where this is being sent to the console in the module source and run that check?
09:51:32Trioxinyeah that has to be it. at least I quickly found the offending module. it's csv. meh
09:53:42Trioxinoic.. there's an example at the end of the module that echos the return of a proc
09:54:14*gokr left #nim (#nim)
09:54:34flyxMiniDude22: I think lpEnumFunc needs {.stdcall.}
09:55:23flyxsince it is declared as CALLBACK, which is identical to __stdcall: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633498(v=vs.85).aspx
09:59:07*planhths joined #nim
09:59:30Trioxinthank goodness commandLineParams() recognizes quoted arguments
10:00:23Trioxinparses them nicely rather
10:00:45*foocraft joined #nim
10:04:19FromGitter<MiniDude22> @flyx Wow that was it! Thank you so much. I wouldn't have even looked at that. Dang so much to learn still!
10:06:29*gokr joined #nim
10:32:42*brechtm quit (Remote host closed the connection)
10:36:06*brechtm joined #nim
10:38:00*Demon_Fox joined #nim
10:49:41Trioxinis there a proc I can use to read a specific line from a file with 1 call without iterating over each line?
10:58:38flyxTrioxin: how would you know where the line starts if you do not read the previous lines?
10:59:42flyxTrioxin: this can only work if all lines have an exact, specified width.
10:59:56flyx(length would be the better term)
11:01:12Trioxinwell, I should have said something more along the lines of taking each line into something like a numbered array. I suppose I can do that.
11:03:51euantorTrioxin: In which case you can use `sequtils.toSeq(lines(...))` if you import `sequtils`
11:03:59euantorhttp://nim-lang.org/docs/sequtils.html#toSeq.t,expr
11:05:14*yglukhov quit (Ping timeout: 265 seconds)
11:05:35*brechtm quit (Remote host closed the connection)
11:08:15FromGitter<MiniDude22> how would you turn a char array into a string?
11:08:50euantorMiniDude22: Have you tried casting it?
11:09:42euantor`cast[string](x)`
11:11:12flyxum, casting would be really bad. try converting it instead: `string(x)`
11:11:31cheatfatejust make `$`
11:11:37euantorflyx: Any reason why out of interest?
11:11:39*yglukhov joined #nim
11:12:21flyxeuantor: because a cast is a reinterpretation of the same data structure as a different type, while a conversion may actually change the data representation
11:12:49euantorflyx: Ah, thanks!
11:14:02*brechtm joined #nim
11:15:49*cheatfate quit (Quit: Leaving)
11:20:05*cheatfate joined #nim
11:22:21FromGitter<gogolxdong> Can ptr and manage memory manually avoid gc and result in better performance?
11:24:27FromGitter<gogolxdong> How to evaluate GC in modern programming languages? Does it matter in real-time application?
11:30:06flyxthe standard approach for real-time applications to GC is „don't“.
11:30:31flyxas is the standard approach to heap memory.
11:32:58FromGitter<endragor> depends on what kind of app you’re making. Nim’s GC is based on reference counting and is very lightweight unless you have referential cycles in your data structures. You can control how much time exactly GC step may take for soft-realtime apps: http://nim-lang.org/docs/gc.html ⏎ ⏎ if it’s hard-realtime, then no GC, as @flyx said. in soft realtime you should be fine with a program structure like this: ⏎ ```code paste, see
11:32:58FromGitter... link``` [https://gitter.im/nim-lang/Nim?at=57e9076a857ab70f7d40f7ea]
11:36:32FromGitter<gogolxdong> manually management is the underlying of GC and makes you better understand about GC,right?
11:45:55*planhths quit (Ping timeout: 265 seconds)
11:47:22*chemist69 quit (Ping timeout: 265 seconds)
11:51:10*chemist69 joined #nim
12:02:17*yglukhov quit (Ping timeout: 265 seconds)
12:02:57*planhths joined #nim
12:08:46FromGitter<gogolxdong> There are some procs in math.nim are just lowercase of Go funcs in the same name module, it's kind of convinient. pow,log2,trunc etc.
12:12:33*yglukhov joined #nim
12:14:51*Demon_Fox quit (Quit: Leaving)
12:22:20FromGitter<gogolxdong> What are bit operators of Nim ,I found `shr`,`shl`,`xor`. what about bit and ,bit or?
12:22:44FromGitter<endragor> `and`, `or`
12:23:00FromGitter<gogolxdong> oops
12:24:34FromGitter<gogolxdong> I thought they are logical operators.
12:26:10FromGitter<endragor> both
12:35:24FromGitter<gogolxdong> tricky
12:37:57*cnu- quit (Ping timeout: 272 seconds)
12:41:43*cnu- joined #nim
12:49:21*Andris_zbx quit (Ping timeout: 272 seconds)
13:18:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:20:56FromGitter<gogolxdong> Is the dependent routine prior to the call routine,or else`attempting to call undeclared routine`
13:28:03FromGitter<gogolxdong> or `undeclared identifier`
13:29:07*yglukhov quit (Remote host closed the connection)
13:31:54*yglukhov joined #nim
13:34:29*Andris joined #nim
13:36:43FromGitter<gogolxdong> Is `x>>=16` identified with `x=x shr 16` or else?
13:37:44*Andris left #nim (#nim)
13:39:11flyxgogolxdong: there is no operator `>>=` in the stdlib afaik
13:41:23FromGitter<gogolxdong> `Error: 'x' cannot be assigned to`
13:42:56FromGitter<gogolxdong> upside down ,should be Is `x=x shr 16`or else identified with `x>>=16` ?
13:51:12*rusua joined #nim
13:53:29*vqrs quit (Ping timeout: 240 seconds)
14:00:03*vqrs joined #nim
14:01:11FromGitter<gogolxdong> ```while x >= 0x8000 : ⏎ x =x shr 16``` [https://gitter.im/nim-lang/Nim?at=57e92a27009614165519a78f]
14:02:21*planhths quit (Quit: Konversation terminated!)
14:05:03flyxgogolxdong: the error message you posted has nothing to do with the code you posted.
14:08:30flyxgogolxdong: you probably declared x with `let` instead of `var`
14:08:59*gokr quit (Ping timeout: 265 seconds)
14:12:59*rusua quit (Quit: Textual IRC Client: www.textualapp.com)
14:23:30*niv50 joined #nim
14:26:38*niv50 is now known as niv
14:26:53*chemist69 quit (Ping timeout: 272 seconds)
14:30:54*chemist69 joined #nim
14:33:13*yglukhov quit (Remote host closed the connection)
14:34:01*yglukhov joined #nim
14:34:03*vqrs quit (Ping timeout: 265 seconds)
14:35:06FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=57e9321aca69aeb745b05148]
14:39:00flyxgogolxdong: yeah, `x` is not declared as `var` parameter, therefore, you cannot assign to it.
14:39:35FromGitter<gogolxdong> :0
14:39:58*vqrs joined #nim
14:41:03flyxtry `var tmp = x` at start and use tmp instead of x
14:41:03*libman joined #nim
14:41:46FromGitter<gogolxdong> what is the first parameter should be in this context? if it doesn't need.
14:42:40FromGitter<gogolxdong> it can't assign to the first parameter?
14:42:55flyxgogolxdong: you cannot assign to any by-value parameter.
14:42:58*Jesin joined #nim
14:43:36*FreezerburnV joined #nim
14:43:58*xet7_ joined #nim
14:44:11flyxgogolxdong: also, you are using an undeclared variable `n`
14:44:32flyxjust start with `result = 0` and increment it directly
14:45:26FromGitter<gogolxdong> yeah,I see,it's a mess
14:45:26*yglukhov quit (Remote host closed the connection)
14:45:59FromGitter<gogolxdong> good advice
14:50:50FromGitter<aboisvert> ihttrtrnfktbhkcjhutjfduuvgngfbtebvnedtdktutv
14:51:22*ARCADIVS quit (Quit: ARCADIVS)
14:52:54FromGitter<gogolxdong> at the last line ⏎ ```Error: ')' expected``` [https://gitter.im/nim-lang/Nim?at=57e93646783fe9b9459a9683]
14:53:01*yglukhov joined #nim
14:55:28FromGitter<aboisvert> @gogolxdong make sure your parenthesis are balanced, a matching `)` for every `(`
14:57:05FromGitter<gogolxdong> could it be some previous unmatched parenthesises?
14:57:26*yglukhov quit (Ping timeout: 252 seconds)
14:57:34FromGitter<aboisvert> yes, most likely
14:57:35FromGitter<gogolxdong> parentheses
15:00:10FromGitter<gogolxdong> here is a `proc totalCount(h: Histogram): int64 =h.totalCount` ,will it go into recursion?
15:01:28FromGitter<gogolxdong> or is compiler smart enough to distinguish ?
15:04:23*xet7b joined #nim
15:05:29*xet7_ quit (Ping timeout: 240 seconds)
15:05:52FromGitter<aboisvert> it isn't about the compiler being "smart enough", it's about lexical rules
15:06:31FromGitter<aboisvert> assuming `Histogram` is object type with a field name `totalCount`, then yes it will prioritize the field rather than a proc invocation
15:06:50FromGitter<aboisvert> i.e., it will not make a recursive call
15:07:26FromGitter<gogolxdong> fine,then it's subtle.
15:12:29*yglukhov joined #nim
15:13:12FromGitter<gogolxdong> blind to find unmatched parentheses
15:14:04*brechtm_ joined #nim
15:14:07*brechtm quit (Read error: No route to host)
15:22:58*foocraft quit (Quit: Leaving)
15:33:53*xet7b quit (Read error: Connection reset by peer)
15:34:17*xet7b joined #nim
15:39:59*PMunch joined #nim
15:42:50FromGitter<gogolxdong> `proc getBucketIndex(h :Histogram,v: int64): int32 = bitLen(v or h.subBucketMask) - h.unitMagnitude -h.subBucketHalfCountMagnitude+1`
15:43:19FromGitter<gogolxdong> `Error: identifier expected, but found 'bitLen(v or h.subBucketMask) - h.unitMagnitude'`
15:44:23*sp33der89 joined #nim
15:54:17FromGitter<gogolxdong> I think it's relative to `bitLen()`
15:57:28flyxgogolxdong: add a space between `-` and `h.subBucketHalfCountMagnitude`
15:57:49flyxotherwise it is parsed as `-`(h.subBucketHalfCountMagnitude)
15:58:25flyx`-` is both a prefix and an infix operator, and spacing determines which is used
16:00:17*xet7b quit (Read error: Connection reset by peer)
16:00:27*xet7b joined #nim
16:02:14FromGitter<gogolxdong> sharp eyed
16:04:48flyxthis could definitely need a better error message
16:06:52*libman quit (Read error: Connection reset by peer)
16:10:45*Vendan_ is now known as Vendan
16:13:35*xet7b quit (Read error: Connection reset by peer)
16:13:45*xet7b joined #nim
16:19:25*brechtm_ quit (Read error: Connection reset by peer)
16:19:40*brechtm joined #nim
16:31:11*fredrik92 quit (Quit: Client disconnecting)
16:32:20*Trioxin left #nim ("Leaving room")
16:32:29*PMunch quit (Quit: leaving)
16:32:48*Matthias247 joined #nim
16:32:57*xet7b quit (Ping timeout: 265 seconds)
16:41:12*arne joined #nim
16:41:45*arne quit (Client Quit)
16:44:21flyxcan someone explain the difference between getTypeInst and getTypeImpl?
16:47:56*yglukhov_ joined #nim
16:50:18*yglukhov_ quit (Read error: Connection reset by peer)
16:50:45*yglukhov_ joined #nim
16:51:27*yglukhov quit (Ping timeout: 276 seconds)
16:55:04*yglukhov_ quit (Ping timeout: 255 seconds)
16:59:07*planhths joined #nim
17:09:28*brechtm_ joined #nim
17:13:08*brechtm quit (Ping timeout: 265 seconds)
17:14:01*brechtm_ quit (Ping timeout: 265 seconds)
17:27:27Araq_flyx: type TypeInst = TypeImpl
17:31:46*fredrik92 joined #nim
17:33:31*fredrik92 quit (Read error: Connection reset by peer)
17:33:37*couven92 joined #nim
17:37:37*couven92 quit (Client Quit)
17:37:45*fredrik92 joined #nim
17:45:09flyxah okay
17:54:51*couven92 joined #nim
17:55:13flyxI have a strange error here: https://gist.github.com/flyx/2f1b12a944615c0c65ee0d1903a3eea9
17:55:40flyxit complains that (int) does not match any of yamlTagUri, but there is yamlTagUri(typedesc[int]), which matches, and it is even listed.
17:57:53*fredrik92 quit (Ping timeout: 240 seconds)
17:59:15*couven92 is now known as fredrik92
18:01:59*wgf_ quit (Quit: Leaving)
18:01:59*gokr joined #nim
18:02:20*sp33der89 quit (Ping timeout: 260 seconds)
18:40:18*elrood joined #nim
18:48:02*Trustable quit (Remote host closed the connection)
18:49:21*brechtm joined #nim
18:59:24*kulelu88 joined #nim
19:00:24*brson joined #nim
19:00:40*PMunch joined #nim
19:01:05*fredrik92 quit (Ping timeout: 240 seconds)
19:03:02*fredrik92 joined #nim
19:03:32*yglukhov joined #nim
19:08:14*yglukhov quit (Ping timeout: 252 seconds)
19:12:10*Jesin quit (Quit: Leaving)
19:15:34*Jesin joined #nim
19:17:02*yglukhov joined #nim
19:21:29*fredrik92 quit (Ping timeout: 240 seconds)
19:24:24flyxhmm, I will report this as bug since I do not see an error in my code.
19:28:41*lyro joined #nim
19:41:17kulelu88odd question: what type of program can I write that can test the raw speed of Nim?
19:43:34Calinoukulelu88: I've done a Fibonacci benchmark
19:43:43Calinouhttps://github.com/Calinou/benchmarks
19:46:44flyxkulelu88: first, try to find a definition of the „raw speed of Nim“. what is it? speed of I/O-heavy code? of algorithmic code? of multi-threading code? networking? there might be quite different results in each of those fields.
19:47:43flyxkulelu88: if you want to compare it against other programming languages, find something with a clear specification and an implementation in other languages, and then implement it in Nim.
19:49:04kulelu88flyx: not really wanting to compare Nim against X. I am just looking for a problem where compiled code can crunch said-problem really fast (as compared to interpreted code)
19:49:06flyxkulelu88: for example, I have some benchmarks for NimYAML, because YAML has an (arguably) clear specification, and therefore, comparing it against libyaml and other implementations yields meaningful results.
19:49:37flyxkulelu88: code is hardly interpreted anywhere nowadays
19:50:05kulelu88hardly? Python? Ruby? Node?
19:50:34flyxPython compiles to .pyc files. Node does JIT Compilation. Ruby, dunno
19:50:55flyxhell, even PHP does not interpret anymore since, I think, PHP 4
19:51:35Calinou.pyc does not really speed up code execution
19:51:40Calinouflyx: PHP is JIT? that's news to me
19:51:53zielmicha[m]Python and Ruby "default" interpreters are, well, interpreters. Python still interprets .pyc.
19:52:35flyxCalinou: HHVM is a PHP JIT engine. the reference parser just produces bytecode ahead of time afair
19:52:45*fredrik92 joined #nim
19:53:54flyxzielmicha[m]: that's not interpreting. then Java would also be an interpreted language
19:54:39zielmicha[m]Yes, it would be. Most Java VMs JIT-compile .class files into machine code.
19:55:03flyxwell, that is a discussion of terminology and does not lead anywhere
19:55:49flyxinterpreting is reading and executing *source code* line-by-line according to the definition I am familiar with.
19:56:04kulelu88back to my question. Would a difficult mathematical problem be a good option?
19:56:43kulelu88flyx: semantics?
19:58:13flyxkulelu88: I do not really understand what your goal is. if you do not want to compare Nim against anything else, then any numbers you would get would be rather meaningless
19:58:22flyxkulelu88: unless you want to show „I can solve this problem in x time with Nim“
19:58:42kulelu88flyx: I believe you have found my purpose :)
19:58:45ldleworkThe best thing you can do show how Nim is useful, is to write libraries.
19:59:22ldleworkblog posts just momentarilly impress the reader
19:59:25ldleworklibraries open doors
20:00:28flyxkulelu88: yeah but if you want to show that, the problem is a required input. if you want to show that you can solve an arbitrary problem in some time x, that information is of very little use
20:00:56kulelu88which is why I asked with this tag at the start: "odd question:"
20:01:27flyxyeah, well. your task is so oddly unspecific that you can take any problem.
20:02:36flyxbecause since there are no goals defined about what you want to show, there is no „good“ or „bad“ problem to tackle
20:11:29*fredrik92 quit (Ping timeout: 240 seconds)
20:11:56*PMunch quit (Quit: leaving)
20:12:51*PMunch joined #nim
20:19:51*samuell joined #nim
20:21:10*sp33der89 joined #nim
20:27:02*libman joined #nim
20:31:10*gokr left #nim (#nim)
20:42:48*Trustable joined #nim
20:42:48*gokr joined #nim
20:44:50*chemist69 quit (Ping timeout: 265 seconds)
20:45:27*Trustable quit (Remote host closed the connection)
20:46:22*Trustable joined #nim
20:46:42*huonw quit (Ping timeout: 265 seconds)
20:47:58*huonw joined #nim
20:48:43*chemist69 joined #nim
20:54:26*sp33der89 left #nim ("Might have choked on too many memes")
21:00:50*fredrik92 joined #nim
21:01:23*fredrik92 quit (Client Quit)
21:01:40*fredrik92 joined #nim
21:02:26*couven92 joined #nim
21:02:40*couven92 quit (Remote host closed the connection)
21:03:11*couven92 joined #nim
21:03:30*couven92 quit (Remote host closed the connection)
21:03:52*fredrik92 quit (Client Quit)
21:04:10*fredrik92 joined #nim
21:04:41*couven92 joined #nim
21:04:50*fredrik92 quit (Client Quit)
21:07:28*vqrs quit (Ping timeout: 265 seconds)
21:09:11*vqrs joined #nim
21:27:57*brechtm quit (Remote host closed the connection)
21:31:33*samuell quit (Remote host closed the connection)
21:34:20libmanNim's nimble is 85.556% copyfree, Lua rocks is 85.445% copyfree... Sooo close!!!
21:34:43ldleworklibman: what is the liscencing preventing you from working on
21:36:21libmanThat's like asking Richard Stallman why can't he just use Windows. :P
21:36:47Araq_if foo.baz < 0 // typo: bar meant here.
21:37:10ldleworklibman: ah so just religion, nothing practical at stake
21:37:14Araq_Lua: turns foo.baz into 'nil', compares it against 0, resulting in false
21:37:26Araq_Nim: reports your typo.
21:37:30libmanAccording to my automated analysis, there are 59 GPL projects in Nimble, 35 Apache, 23 LGPL, 6 Eclipse license, 4 artistic, 3 zlib ... 38 without a clear license, and 13 "other". Help Nim retain first place by switching to a license like MIT or BSD. :)
21:38:03Araq_it's just no comparison. and libraries cannot patch over a non-existing type system.
21:38:22Araq_for the same reason JavaScript will always suck btw.
21:38:25libmanldlework: yes, that "just religion" statement is 99% correct.
21:38:32ldleworkok
21:39:41libmanUsing AL2 or even GPL is not going to kill anybody. But it's an ideological line in the sand about the definition of "Free Software".
21:41:50libmanLet's say there are 1000 programmers in the world (our of many millions) who care about what I'm talking about. Someday there may be more. For an upstart language like Nim, at this early stage, appealing to these programmers would increase its support by a noteworthy percentage.
21:41:54*vqrs quit (Ping timeout: 264 seconds)
21:42:12libmans/our/out/
21:42:14*desophos joined #nim
21:43:59Araq_well we already have 1 out of these 1000 and we enjoy your support. more support of yours, we would enjoy more.
21:44:16libmanI haven't done anything for Nim yet. But someday I will.
21:45:16libmanI haven't even decided if Nim is the language I wanna specialize in. Go is a very strong contender. (Lua has zero appeal to me, I just mentioned it because it's a close second in the package ecosystem license percentage.)
21:45:44*vqrs joined #nim
21:46:17libmanLLVM/Clang relicensing would have a big impact on the Copyfree-ness of Nim vs Go...
21:46:51libman(But it would totally take LLVM-married languages Rust and Julia out of contention.)
21:47:10*couven92 quit (Quit: Client disconnecting)
21:47:17libmanHas anyone used Nim with PCC (Portable C Compiler)?
21:47:26gokrAraq_: Any interesting thoughts on Linda/tuplespaces in the context of Nim/Spry?
21:48:01gokrI am reading up on it but curious for your thoughts.
21:48:12*planhths quit (Quit: Konversation terminated!)
21:48:37Araq_well at some point you actually have to program in your programming language of choice. and deciding based on the license for this is like deciding what to eat based on whether it's
21:49:32Araq_free of sugar or not.
21:50:12Araq_gokr: what's Linda/tuplespaces?
21:50:22libmanProgramming language choice is a marriage.
21:50:37gokrAraq_: Oho, a hole in your extensive knowledge! :)
21:51:10gokrhttps://en.wikipedia.org/wiki/Tuple_space
21:51:45gokrIt's basically a model of shared nothing coop between processes.
21:52:18gokrFeels like a good fit for Nim and Spry.
21:54:08kulelu88libman: surprised there are other people who care about licensing
21:55:10libmankulelu88: the goal is not having to care about licensing. But if we didn't, we'd end up with AQGPLv4 that makes Apple EULA's look tame...
21:55:37kulelu88libman: where do you host your code?
21:56:01libmanI don't. My past code was all proprietary or thrown away.
21:56:08kulelu88oh
21:56:23libman(There's https://github.com/lbmn but there's nothing there.)
21:56:41kulelu88using github is a bit of a paradox, if you care about licensing
21:57:48*Matthias247 quit (Read error: Connection reset by peer)
21:59:41libmanI don't really "use github", I just have an account there because all the cool kids are doing it. I'm not depended on it for anything.
22:00:19*Snircle joined #nim
22:01:15Araq_gokr: how is a shared tuple space "shared nothing"?
22:01:15*libman quit (Read error: Connection reset by peer)
22:01:54gokrIt can be. There are commercial middleware tuple spaces - that go beyond a single machine.
22:02:11gokrIt's not limited to inter thread communication.
22:02:39*libman joined #nim
22:02:45kulelu88libman got angry and left :P
22:03:01libman<libman> I don't really "use github", I just have an account there because all the cool kids are doing it. I'm not depended on it for anything.
22:03:14libmanSorry, I have a very bad connection.
22:03:16kulelu88oh you back libman
22:03:17gokrBut I presume for very high performance inter thread stuff - a tuple space implementation could "hand over" tuples using pointers.
22:05:18*sp33der89 joined #nim
22:05:37libmanThe proper channel for "why copyfree" discussion is ##copyfree (or #nim-offtopic). In this channel I only aim to discuss Nim advocacy / outreach / marketing, and I propose that one of Nim's promo points is less license fuss in its ecosystem.
22:08:44*Trustable quit (Remote host closed the connection)
22:14:25*gangstacat quit (Quit: Leaving)
22:15:01*vqrs quit (Ping timeout: 244 seconds)
22:16:02Araq_gokr: my own musings are about entity systems and replacing pointers by IDs
22:17:16*vqrs joined #nim
22:18:22ldleworkAraq_: have you been writing an ECS in Nim?
22:18:59Araq_ldlework: no.
22:21:45libmanECS... (over my head) Entity Component System?
22:26:48*fredrik92 joined #nim
22:29:16*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:29:55*fredrik92 quit (Read error: Connection reset by peer)
22:30:06*libman quit (Read error: Connection reset by peer)
22:31:41*libman joined #nim
22:47:25*brson quit (Ping timeout: 255 seconds)
22:49:28*gokr quit (Ping timeout: 265 seconds)
22:52:49*chemist69 quit (Ping timeout: 255 seconds)
22:53:27*brson joined #nim
22:54:51*elrood quit (Quit: Leaving)
22:58:11*chemist69 joined #nim
23:01:26*Jesin quit (Quit: Leaving)
23:03:31*yglukhov quit (Remote host closed the connection)
23:05:06*bjz joined #nim
23:06:34*gangstacat joined #nim
23:07:44*bjz quit (Client Quit)
23:13:18*libman quit (Read error: Connection reset by peer)
23:15:50*libman joined #nim
23:16:03*PMunch quit (Quit: leaving)
23:17:50*yglukhov joined #nim
23:22:35*yglukhov quit (Ping timeout: 260 seconds)
23:27:57*bjz joined #nim
23:28:00*girvo joined #nim
23:30:35*bjz quit (Client Quit)
23:42:47*libman quit (Read error: Connection reset by peer)
23:45:31*libman joined #nim
23:46:12*pie_ quit (Changing host)
23:46:12*pie_ joined #nim
23:47:58*yglukhov joined #nim
23:52:17*yglukhov quit (Ping timeout: 240 seconds)