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:17 | ftsf_ | 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:00 | FromGitter | <gogolxdong> How to return ptr object with constructor? |
03:56:54 | * | yglukhov quit (Ping timeout: 264 seconds) |
04:12:01 | FromGitter | <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:46 | ftsf_ | 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:32 | FromGitter | <endragor> it shouldn’t, but it should call `setupForeignThreadGc()` at the beginning |
04:25:13 | ftsf_ | yep, i am calling that (when I can, not supported where I have to use tlsEmulation:on) |
04:25:25 | ftsf_ | when tlsEmulation is on I get crashes D: |
04:25:34 | ftsf_ | not sure how to avoid that |
04:25:40 | ftsf_ | 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:35 | ftsf_ | 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:04 | FromGitter | <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:49 | FromGitter | <gogolxdong> like ``` ⏎ result=ptr Histogram( ⏎ lowestTrackableValue:minValue, ⏎ highestTrackableValue:maxValue, ⏎ unitMagnitude:unitMagnitude.int64, ... [https://gitter.im/nim-lang/Nim?at=57e8c9bdea1b6b1a6c6a1c6f] |
07:10:14 | FromGitter | <gogolxdong> like |
07:10:29 | FromGitter | <gogolxdong> like``` |
07:11:00 | FromGitter | <gogolxdong> like ``` ⏎ result=ptr Histogram( ⏎ lowestTrackableValue:minValue, ⏎ highestTrackableValue:maxValue, ⏎ unitMagnitude:unitMagnitude.int64, ... [https://gitter.im/nim-lang/Nim?at=57e8ca04ab9ba81255e3b155] |
07:11:46 | FromGitter | <gogolxdong> like ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=57e8ca32857ab70f7d401c55] |
07:13:20 | ftsf_ | gogolxdong, that comes across very ugly in irc |
07:13:33 | FromGitter | <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:50 | FromGitter | <gogolxdong> @FromIRC sorry,I didn't know that,how can I make it better across? |
07:19:11 | ftsf_ | use a gist or something? |
07:19:20 | * | Trustable joined #nim |
07:19:44 | FromGitter | <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:29 | Trioxin | can I get a key out of a for loop or do I have to declare one outiside the statement? |
07:31:35 | ftsf_ | Trioxin, what do you mean by a key? |
07:32:34 | Trioxin | some 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:45 | ftsf_ | oh right, yes you can do that |
07:32:50 | ftsf_ | for i,v in foo: |
07:32:58 | Trioxin | thx |
07:32:59 | ftsf_ | or for i,v in mpairs(foo): |
07:38:56 | Trioxin | is "lines" a reserved word for iterating through a file? |
07:39:46 | ftsf_ | Trioxin, i don't think it's reserved |
07:39:46 | Trioxin | ftsf_, 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:16 | ftsf_ | lines is an iterator, the iterator has to support returning the second variable for the index |
07:41:29 | Trioxin | so it is reserved. because I don't have to declare lines |
07:41:53 | ftsf_ | no it's just defined in a library |
07:42:00 | ftsf_ | that you're importing |
07:42:15 | ftsf_ | you could define your own lines that does what you want |
07:42:47 | FromGitter | <endragor> it’s in system module that is imported automatically |
07:43:37 | FromGitter | <MiniDude22> Hey guys any idea what I'm doing wrong trying to import the function GetWindowText? |
07:43:40 | FromGitter | <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:36 | FromGitter | <Araq> @MiniDude22 maybe its importc: "GetWindowTextA" |
07:59:18 | FromGitter | <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:51 | FromGitter | <MiniDude22> ```var title: cstring ⏎ echo getWindowTextA( handle, addr(title), 256 ) ⏎ echo title.len``` [https://gitter.im/nim-lang/Nim?at=57e8d577ea1b6b1a6c6a48f1] |
08:00:12 | FromGitter | <MiniDude22> It gives me a SIGSEV |
08:00:28 | FromGitter | <MiniDude22> but getWindowTextA is printing out 23 for the length |
08:00:38 | FromGitter | <endragor> that’s because `title` buffer is not initialized (allocated) |
08:01:39 | FromGitter | <MiniDude22> Hrm. Okay how do you do that? *facepalm* |
08:03:06 | FromGitter | <Araq> var title: array[256, char] |
08:03:25 | FromGitter | <Araq> getWindowText(handle, title, title.len) |
08:03:48 | FromGitter | <Araq> or sizeof(title) |
08:04:05 | FromGitter | <MiniDude22> So then I need to change the import to work with the array right? |
08:04:20 | FromGitter | <Araq> no |
08:04:38 | FromGitter | <Araq> cstring is ok |
08:05:08 | FromGitter | <MiniDude22> gives me a type mismatch though :/ |
08:05:36 | * | Trioxin left #nim ("Leaving room") |
08:07:53 | * | Andris_zbx joined #nim |
08:08:36 | FromGitter | <Araq> array of char is convertible to cstring |
08:08:41 | FromGitter | <Araq> don't use 'addr' here |
08:09:58 | FromGitter | <MiniDude22> Oh okay. So i got rid of add, and using ptr cstring in the import. |
08:10:12 | FromGitter | <MiniDude22> Sorry I'm new to this! Thank you for the help! |
08:12:11 | FromGitter | <MiniDude22> It seems to be working now! |
08:13:10 | FromGitter | <endragor> your wrapper was fine, you did something wrong in the end :) |
08:13:56 | FromGitter | <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:45 | cheatfate | Araq_, what is problem here? https://gist.github.com/cheatfate/563e2f83a9bcdf018b2aece510151781 |
08:17:10 | FromGitter | <endragor> didn’t you mean `and 0b11`? Te’s length is 4, not 256 |
08:20:12 | cheatfate | endragor: its stripped example Te in real has 256 elements |
08:20:33 | cheatfate | but error still same |
08:20:41 | FromGitter | <endragor> what’s the error? |
08:21:04 | cheatfate | sorry forgot to add comment refresh please |
08:21:54 | cheatfate | Araq_, or this error happens because array indices must be signed integers? |
08:23:41 | * | ftsf_ quit (Remote host closed the connection) |
08:23:47 | FromGitter | <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:08 | flyx | array indices must be Ordinals, as the error message says: proc `[]`[I: Ordinal, T](a: T; i: I): T |
08:25:20 | flyx | uints are not part of Ordinal |
08:27:24 | FromGitter | <endragor> type of array index is a part of array type defintion |
08:28:26 | wgf_ | on my Linux system, it compiles without errors, cheatfate |
08:29:43 | cheatfate | endragor, thanks |
08:30:45 | * | nsf joined #nim |
08:35:14 | FromGitter | <endragor> @wgf_ I guess your system is 32-bit? I think it’s a bug that Nim type-checking depends on arch |
08:36:07 | FromGitter | <endragor> I was surprised by that, too, some time in the past |
08:38:31 | wgf_ | no, using version 0.14.2 on Linux-64 |
08:39:03 | FromGitter | <endragor> then maybe it’s some recent changes related to unsigned types |
08:40:16 | wgf_ | yep |
08:42:36 | * | bjz_ joined #nim |
08:47:21 | FromGitter | <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:25 | FromGitter | <endragor> `hdr[].byteSize()`. or enable `—experimental`, then `hdr.byteSize()` will work. |
08:49:40 | FromGitter | <gogolxdong> helpful |
08:57:47 | * | yglukhov joined #nim |
09:04:45 | * | Demon_Fox quit (Quit: Leaving) |
09:06:07 | FromGitter | <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:56 | FromGitter | <gogolxdong> ` counts:newSeq[int64](0)` `(Attempt to read from nil?)` |
09:15:41 | FromGitter | <gogolxdong> `var hdr =new(1,1000,5) ⏎ echo hdr[].byteSize()` |
09:33:17 | * | aziz quit (Quit: Ex-Chat) |
09:34:57 | FromGitter | <Araq> replace the : by = |
09:35:11 | FromGitter | <Araq> counts=newSeq[int64](0) |
09:36:19 | * | brechtm_ quit (Remote host closed the connection) |
09:36:28 | * | fredrik92 joined #nim |
09:36:44 | FromGitter | <gogolxdong> ok |
09:38:24 | FromGitter | <gogolxdong> Is this new feature ?I didn't see from manual |
09:39:28 | * | chemist69 quit (Ping timeout: 255 seconds) |
09:41:33 | FromGitter | <gogolxdong> I mean counts:newSeq[int64](0) is the assignment in object constructor |
09:41:58 | FromGitter | <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:11 | FromGitter | <Araq> oh it's in an object constr, then the : was right :P and the problem is somewhere else |
09:45:12 | Trioxin | why would my program be sending "@[@[a, b, c, ]]" to the console even if I put quit() in the beginning of the program? |
09:45:36 | FromGitter | <Araq> trixoin because the modules you import produce this output |
09:45:48 | FromGitter | <Araq> use 'when isMainModule' in your imports |
09:45:57 | FromGitter | <Araq> but you asked about this before iirc |
09:46:10 | Trioxin | araq, never did |
09:46:13 | flyx | gogolxdong: `counts: @[]` is shorter, but does the same thing. |
09:46:44 | FromGitter | <MiniDude22> Hey guys sorry for being such a bother. but am I using the callback enum right? |
09:46:52 | FromGitter | <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:16 | FromGitter | <MiniDude22> crap... |
09:47:34 | FromGitter | <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:52 | FromGitter | <MiniDude22> Eff me i cant get it to look like code... |
09:49:24 | FromGitter | <MiniDude22> Here? |
09:49:25 | FromGitter | <MiniDude22> https://gist.github.com/MiniDude22/5dc5e92147e9a403440d2dc184363611 |
09:49:52 | Trioxin | araq, 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:32 | Trioxin | yeah that has to be it. at least I quickly found the offending module. it's csv. meh |
09:53:42 | Trioxin | oic.. 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:34 | flyx | MiniDude22: I think lpEnumFunc needs {.stdcall.} |
09:55:23 | flyx | since 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:30 | Trioxin | thank goodness commandLineParams() recognizes quoted arguments |
10:00:23 | Trioxin | parses them nicely rather |
10:00:45 | * | foocraft joined #nim |
10:04:19 | FromGitter | <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:41 | Trioxin | is there a proc I can use to read a specific line from a file with 1 call without iterating over each line? |
10:58:38 | flyx | Trioxin: how would you know where the line starts if you do not read the previous lines? |
10:59:42 | flyx | Trioxin: this can only work if all lines have an exact, specified width. |
10:59:56 | flyx | (length would be the better term) |
11:01:12 | Trioxin | well, 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:51 | euantor | Trioxin: In which case you can use `sequtils.toSeq(lines(...))` if you import `sequtils` |
11:03:59 | euantor | http://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:15 | FromGitter | <MiniDude22> how would you turn a char array into a string? |
11:08:50 | euantor | MiniDude22: Have you tried casting it? |
11:09:42 | euantor | `cast[string](x)` |
11:11:12 | flyx | um, casting would be really bad. try converting it instead: `string(x)` |
11:11:31 | cheatfate | just make `$` |
11:11:37 | euantor | flyx: Any reason why out of interest? |
11:11:39 | * | yglukhov joined #nim |
11:12:21 | flyx | euantor: 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:49 | euantor | flyx: Ah, thanks! |
11:14:02 | * | brechtm joined #nim |
11:15:49 | * | cheatfate quit (Quit: Leaving) |
11:20:05 | * | cheatfate joined #nim |
11:22:21 | FromGitter | <gogolxdong> Can ptr and manage memory manually avoid gc and result in better performance? |
11:24:27 | FromGitter | <gogolxdong> How to evaluate GC in modern programming languages? Does it matter in real-time application? |
11:30:06 | flyx | the standard approach for real-time applications to GC is „don't“. |
11:30:31 | flyx | as is the standard approach to heap memory. |
11:32:58 | FromGitter | <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:58 | FromGitter | ... link``` [https://gitter.im/nim-lang/Nim?at=57e9076a857ab70f7d40f7ea] |
11:36:32 | FromGitter | <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:46 | FromGitter | <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:20 | FromGitter | <gogolxdong> What are bit operators of Nim ,I found `shr`,`shl`,`xor`. what about bit and ,bit or? |
12:22:44 | FromGitter | <endragor> `and`, `or` |
12:23:00 | FromGitter | <gogolxdong> oops |
12:24:34 | FromGitter | <gogolxdong> I thought they are logical operators. |
12:26:10 | FromGitter | <endragor> both |
12:35:24 | FromGitter | <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:56 | FromGitter | <gogolxdong> Is the dependent routine prior to the call routine,or else`attempting to call undeclared routine` |
13:28:03 | FromGitter | <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:43 | FromGitter | <gogolxdong> Is `x>>=16` identified with `x=x shr 16` or else? |
13:37:44 | * | Andris left #nim (#nim) |
13:39:11 | flyx | gogolxdong: there is no operator `>>=` in the stdlib afaik |
13:41:23 | FromGitter | <gogolxdong> `Error: 'x' cannot be assigned to` |
13:42:56 | FromGitter | <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:11 | FromGitter | <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:03 | flyx | gogolxdong: the error message you posted has nothing to do with the code you posted. |
14:08:30 | flyx | gogolxdong: 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:06 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=57e9321aca69aeb745b05148] |
14:39:00 | flyx | gogolxdong: yeah, `x` is not declared as `var` parameter, therefore, you cannot assign to it. |
14:39:35 | FromGitter | <gogolxdong> :0 |
14:39:58 | * | vqrs joined #nim |
14:41:03 | flyx | try `var tmp = x` at start and use tmp instead of x |
14:41:03 | * | libman joined #nim |
14:41:46 | FromGitter | <gogolxdong> what is the first parameter should be in this context? if it doesn't need. |
14:42:40 | FromGitter | <gogolxdong> it can't assign to the first parameter? |
14:42:55 | flyx | gogolxdong: 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:11 | flyx | gogolxdong: also, you are using an undeclared variable `n` |
14:44:32 | flyx | just start with `result = 0` and increment it directly |
14:45:26 | FromGitter | <gogolxdong> yeah,I see,it's a mess |
14:45:26 | * | yglukhov quit (Remote host closed the connection) |
14:45:59 | FromGitter | <gogolxdong> good advice |
14:50:50 | FromGitter | <aboisvert> ihttrtrnfktbhkcjhutjfduuvgngfbtebvnedtdktutv |
14:51:22 | * | ARCADIVS quit (Quit: ARCADIVS) |
14:52:54 | FromGitter | <gogolxdong> at the last line ⏎ ```Error: ')' expected``` [https://gitter.im/nim-lang/Nim?at=57e93646783fe9b9459a9683] |
14:53:01 | * | yglukhov joined #nim |
14:55:28 | FromGitter | <aboisvert> @gogolxdong make sure your parenthesis are balanced, a matching `)` for every `(` |
14:57:05 | FromGitter | <gogolxdong> could it be some previous unmatched parenthesises? |
14:57:26 | * | yglukhov quit (Ping timeout: 252 seconds) |
14:57:34 | FromGitter | <aboisvert> yes, most likely |
14:57:35 | FromGitter | <gogolxdong> parentheses |
15:00:10 | FromGitter | <gogolxdong> here is a `proc totalCount(h: Histogram): int64 =h.totalCount` ,will it go into recursion? |
15:01:28 | FromGitter | <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:52 | FromGitter | <aboisvert> it isn't about the compiler being "smart enough", it's about lexical rules |
15:06:31 | FromGitter | <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:50 | FromGitter | <aboisvert> i.e., it will not make a recursive call |
15:07:26 | FromGitter | <gogolxdong> fine,then it's subtle. |
15:12:29 | * | yglukhov joined #nim |
15:13:12 | FromGitter | <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:50 | FromGitter | <gogolxdong> `proc getBucketIndex(h :Histogram,v: int64): int32 = bitLen(v or h.subBucketMask) - h.unitMagnitude -h.subBucketHalfCountMagnitude+1` |
15:43:19 | FromGitter | <gogolxdong> `Error: identifier expected, but found 'bitLen(v or h.subBucketMask) - h.unitMagnitude'` |
15:44:23 | * | sp33der89 joined #nim |
15:54:17 | FromGitter | <gogolxdong> I think it's relative to `bitLen()` |
15:57:28 | flyx | gogolxdong: add a space between `-` and `h.subBucketHalfCountMagnitude` |
15:57:49 | flyx | otherwise it is parsed as `-`(h.subBucketHalfCountMagnitude) |
15:58:25 | flyx | `-` 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:14 | FromGitter | <gogolxdong> sharp eyed |
16:04:48 | flyx | this 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:21 | flyx | can 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:27 | Araq_ | 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:09 | flyx | ah okay |
17:54:51 | * | couven92 joined #nim |
17:55:13 | flyx | I have a strange error here: https://gist.github.com/flyx/2f1b12a944615c0c65ee0d1903a3eea9 |
17:55:40 | flyx | it 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:24 | flyx | hmm, I will report this as bug since I do not see an error in my code. |
19:28:41 | * | lyro joined #nim |
19:41:17 | kulelu88 | odd question: what type of program can I write that can test the raw speed of Nim? |
19:43:34 | Calinou | kulelu88: I've done a Fibonacci benchmark |
19:43:43 | Calinou | https://github.com/Calinou/benchmarks |
19:46:44 | flyx | kulelu88: 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:43 | flyx | kulelu88: 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:04 | kulelu88 | flyx: 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:06 | flyx | kulelu88: 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:37 | flyx | kulelu88: code is hardly interpreted anywhere nowadays |
19:50:05 | kulelu88 | hardly? Python? Ruby? Node? |
19:50:34 | flyx | Python compiles to .pyc files. Node does JIT Compilation. Ruby, dunno |
19:50:55 | flyx | hell, even PHP does not interpret anymore since, I think, PHP 4 |
19:51:35 | Calinou | .pyc does not really speed up code execution |
19:51:40 | Calinou | flyx: PHP is JIT? that's news to me |
19:51:53 | zielmicha[m] | Python and Ruby "default" interpreters are, well, interpreters. Python still interprets .pyc. |
19:52:35 | flyx | Calinou: HHVM is a PHP JIT engine. the reference parser just produces bytecode ahead of time afair |
19:52:45 | * | fredrik92 joined #nim |
19:53:54 | flyx | zielmicha[m]: that's not interpreting. then Java would also be an interpreted language |
19:54:39 | zielmicha[m] | Yes, it would be. Most Java VMs JIT-compile .class files into machine code. |
19:55:03 | flyx | well, that is a discussion of terminology and does not lead anywhere |
19:55:49 | flyx | interpreting is reading and executing *source code* line-by-line according to the definition I am familiar with. |
19:56:04 | kulelu88 | back to my question. Would a difficult mathematical problem be a good option? |
19:56:43 | kulelu88 | flyx: semantics? |
19:58:13 | flyx | kulelu88: 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:22 | flyx | kulelu88: unless you want to show „I can solve this problem in x time with Nim“ |
19:58:42 | kulelu88 | flyx: I believe you have found my purpose :) |
19:58:45 | ldlework | The best thing you can do show how Nim is useful, is to write libraries. |
19:59:22 | ldlework | blog posts just momentarilly impress the reader |
19:59:25 | ldlework | libraries open doors |
20:00:28 | flyx | kulelu88: 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:56 | kulelu88 | which is why I asked with this tag at the start: "odd question:" |
20:01:27 | flyx | yeah, well. your task is so oddly unspecific that you can take any problem. |
20:02:36 | flyx | because 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:20 | libman | Nim's nimble is 85.556% copyfree, Lua rocks is 85.445% copyfree... Sooo close!!! |
21:34:43 | ldlework | libman: what is the liscencing preventing you from working on |
21:36:21 | libman | That's like asking Richard Stallman why can't he just use Windows. :P |
21:36:47 | Araq_ | if foo.baz < 0 // typo: bar meant here. |
21:37:10 | ldlework | libman: ah so just religion, nothing practical at stake |
21:37:14 | Araq_ | Lua: turns foo.baz into 'nil', compares it against 0, resulting in false |
21:37:26 | Araq_ | Nim: reports your typo. |
21:37:30 | libman | According 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:03 | Araq_ | it's just no comparison. and libraries cannot patch over a non-existing type system. |
21:38:22 | Araq_ | for the same reason JavaScript will always suck btw. |
21:38:25 | libman | ldlework: yes, that "just religion" statement is 99% correct. |
21:38:32 | ldlework | ok |
21:39:41 | libman | Using 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:50 | libman | Let'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:12 | libman | s/our/out/ |
21:42:14 | * | desophos joined #nim |
21:43:59 | Araq_ | well we already have 1 out of these 1000 and we enjoy your support. more support of yours, we would enjoy more. |
21:44:16 | libman | I haven't done anything for Nim yet. But someday I will. |
21:45:16 | libman | I 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:17 | libman | LLVM/Clang relicensing would have a big impact on the Copyfree-ness of Nim vs Go... |
21:46:51 | libman | (But it would totally take LLVM-married languages Rust and Julia out of contention.) |
21:47:10 | * | couven92 quit (Quit: Client disconnecting) |
21:47:17 | libman | Has anyone used Nim with PCC (Portable C Compiler)? |
21:47:26 | gokr | Araq_: Any interesting thoughts on Linda/tuplespaces in the context of Nim/Spry? |
21:48:01 | gokr | I am reading up on it but curious for your thoughts. |
21:48:12 | * | planhths quit (Quit: Konversation terminated!) |
21:48:37 | Araq_ | 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:32 | Araq_ | free of sugar or not. |
21:50:12 | Araq_ | gokr: what's Linda/tuplespaces? |
21:50:22 | libman | Programming language choice is a marriage. |
21:50:37 | gokr | Araq_: Oho, a hole in your extensive knowledge! :) |
21:51:10 | gokr | https://en.wikipedia.org/wiki/Tuple_space |
21:51:45 | gokr | It's basically a model of shared nothing coop between processes. |
21:52:18 | gokr | Feels like a good fit for Nim and Spry. |
21:54:08 | kulelu88 | libman: surprised there are other people who care about licensing |
21:55:10 | libman | kulelu88: 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:37 | kulelu88 | libman: where do you host your code? |
21:56:01 | libman | I don't. My past code was all proprietary or thrown away. |
21:56:08 | kulelu88 | oh |
21:56:23 | libman | (There's https://github.com/lbmn but there's nothing there.) |
21:56:41 | kulelu88 | using 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:41 | 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:00:19 | * | Snircle joined #nim |
22:01:15 | Araq_ | gokr: how is a shared tuple space "shared nothing"? |
22:01:15 | * | libman quit (Read error: Connection reset by peer) |
22:01:54 | gokr | It can be. There are commercial middleware tuple spaces - that go beyond a single machine. |
22:02:11 | gokr | It's not limited to inter thread communication. |
22:02:39 | * | libman joined #nim |
22:02:45 | kulelu88 | libman got angry and left :P |
22:03:01 | libman | <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:14 | libman | Sorry, I have a very bad connection. |
22:03:16 | kulelu88 | oh you back libman |
22:03:17 | gokr | But 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:37 | libman | The 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:02 | Araq_ | gokr: my own musings are about entity systems and replacing pointers by IDs |
22:17:16 | * | vqrs joined #nim |
22:18:22 | ldlework | Araq_: have you been writing an ECS in Nim? |
22:18:59 | Araq_ | ldlework: no. |
22:21:45 | libman | ECS... (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) |