00:14:23 | * | mcc joined #nim |
00:24:29 | * | libman quit (Read error: Connection reset by peer) |
00:29:52 | * | yglukhov joined #nim |
00:30:15 | * | GangstaCat quit (Quit: Leaving) |
00:38:05 | * | yglukhov quit (Ping timeout: 265 seconds) |
00:40:44 | * | libman joined #nim |
00:49:46 | * | libman left #nim (#nim) |
01:06:45 | * | chemist69 quit (Disconnected by services) |
01:06:50 | * | chemist69_ joined #nim |
01:09:27 | * | yglukhov joined #nim |
01:14:16 | * | yglukhov quit (Ping timeout: 264 seconds) |
01:58:42 | * | brson quit (Ping timeout: 276 seconds) |
02:03:28 | * | pie__ quit (Ping timeout: 264 seconds) |
02:23:34 | * | Sembei quit (Read error: Connection reset by peer) |
02:23:34 | * | learath2 quit (Read error: Connection reset by peer) |
02:24:00 | * | learath2 joined #nim |
02:24:35 | * | Sembei joined #nim |
02:27:59 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:43:01 | * | dddddd quit (Ping timeout: 244 seconds) |
02:56:14 | * | yglukhov joined #nim |
03:00:46 | * | yglukhov quit (Ping timeout: 255 seconds) |
03:18:47 | * | desophos quit (Read error: Connection reset by peer) |
03:38:39 | * | yglukhov joined #nim |
03:42:48 | * | yglukhov quit (Ping timeout: 244 seconds) |
03:58:40 | * | Sentreen quit (Ping timeout: 265 seconds) |
04:07:53 | * | yglukhov joined #nim |
04:08:20 | * | yglukhov quit (Remote host closed the connection) |
04:10:05 | * | Sentreen joined #nim |
04:35:30 | * | brson joined #nim |
04:35:30 | * | brson quit (Client Quit) |
04:35:50 | * | Demon_Fox quit (Quit: Leaving) |
04:46:47 | * | ics joined #nim |
04:59:32 | * | dashed joined #nim |
05:04:51 | * | gokr joined #nim |
05:51:26 | * | gokr quit (Ping timeout: 252 seconds) |
06:05:50 | * | yglukhov joined #nim |
06:10:31 | * | chemist69_ quit (Quit: WeeChat 1.5) |
06:19:06 | * | csoriano_ joined #nim |
06:19:09 | FromGitter | <endragor> @Araq @dom96 do you plan to use bountysource donations for bounties? The goals are entitled as “medium bounty budget”, “large bounty budget”, but there were no bounties created since the campaign started. |
06:20:52 | * | xet7 quit (Quit: Leaving) |
06:32:15 | * | yglukhov quit (Ping timeout: 250 seconds) |
06:33:42 | * | zaquest joined #nim |
06:36:07 | * | yglukhov joined #nim |
06:40:39 | * | filcuc joined #nim |
06:45:03 | * | yglukhov quit (Remote host closed the connection) |
06:47:18 | * | ics quit (Quit: Connection closed for inactivity) |
06:53:42 | * | Trustable joined #nim |
06:54:28 | * | chemist69 joined #nim |
07:01:06 | * | gokr joined #nim |
07:25:00 | * | nairobi joined #nim |
07:27:20 | * | nairobi_ joined #nim |
07:28:19 | * | nairobi quit (Read error: Connection reset by peer) |
07:34:50 | * | GangstaCat joined #nim |
08:12:41 | * | girvo quit (Ping timeout: 244 seconds) |
08:12:48 | * | dashed quit (Quit: Connection closed for inactivity) |
08:18:30 | * | coffeepot joined #nim |
08:34:45 | dom96 | endragor: that was my intention but Araq needs to agree to it first. |
08:37:35 | * | kulelu88 joined #nim |
08:45:32 | * | JeffCanJam4a20 joined #nim |
08:45:32 | * | nairobi_ quit (Read error: Connection reset by peer) |
08:51:43 | * | Arrrr joined #nim |
08:55:58 | * | Arrrr quit (Client Quit) |
09:04:52 | * | Arrrr joined #nim |
09:04:52 | * | Arrrr quit (Changing host) |
09:04:52 | * | Arrrr joined #nim |
09:17:44 | * | girvo joined #nim |
09:17:48 | * | yglukhov joined #nim |
09:19:24 | * | nairobi joined #nim |
09:21:55 | * | girvo quit (Ping timeout: 244 seconds) |
09:59:12 | * | xet7 joined #nim |
10:05:30 | * | JeffCanJam4a20 quit (Ping timeout: 250 seconds) |
10:13:44 | * | dddddd joined #nim |
10:18:43 | * | kulelu88 quit (Quit: Leaving) |
10:52:58 | * | bjz joined #nim |
10:57:21 | * | PMunch joined #nim |
10:59:29 | * | dddddd quit (Ping timeout: 260 seconds) |
11:02:08 | * | Snircle joined #nim |
11:07:35 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:08:04 | * | GangstaCat quit (Quit: Leaving) |
11:09:45 | * | brechtm_ joined #nim |
11:12:14 | * | dddddd joined #nim |
11:12:54 | * | brechtm quit (Ping timeout: 260 seconds) |
11:18:33 | * | girvo joined #nim |
11:18:38 | * | GangstaCat joined #nim |
11:23:01 | * | girvo quit (Ping timeout: 250 seconds) |
11:23:15 | * | bjz joined #nim |
11:28:22 | * | nairobi quit (Read error: Connection reset by peer) |
11:34:59 | * | bjz_ joined #nim |
11:37:22 | * | bjz quit (Ping timeout: 255 seconds) |
11:37:36 | * | elrood joined #nim |
11:47:46 | * | arnetheduck joined #nim |
11:57:38 | * | brechtm_ quit (Remote host closed the connection) |
11:58:12 | * | brechtm joined #nim |
12:03:58 | * | gokr quit (Ping timeout: 244 seconds) |
12:27:39 | * | Arrrr quit (Quit: WeeChat 1.5) |
12:46:54 | * | ngc quit (Remote host closed the connection) |
12:57:23 | * | xet7 quit (Quit: Leaving) |
13:15:38 | * | xet7 joined #nim |
13:16:00 | * | gokr joined #nim |
13:19:20 | * | girvo joined #nim |
13:23:12 | * | gokr quit (Ping timeout: 265 seconds) |
13:23:32 | * | girvo quit (Ping timeout: 240 seconds) |
14:24:06 | coffeepot | should a threadvar in a proc crash the compiler? https://gist.github.com/coffeepots/1122e6aeef686266c6d42861e47ae134 |
14:24:19 | * | dddddd quit (Ping timeout: 255 seconds) |
14:25:08 | coffeepot | well, not crash compiler but produce error in c code |
14:33:29 | elrood | what is the error you're getting? that gist looks.. kind of useless but compiles and runs fine here |
14:33:35 | kier | coffeepot: doesn't seem to cause an error for me. what nim version are you using? |
14:33:40 | kier | snap |
14:35:01 | coffeepot | ah ok, running windows? |
14:35:10 | coffeepot | running latest devel from earlier today |
14:35:27 | coffeepot | sec i'll add the msg to the gist |
14:37:13 | coffeepot | updated |
14:37:23 | * | dddddd joined #nim |
14:37:40 | coffeepot | "error: 'NimThreadVars' has no member named 'str0'" |
14:39:37 | coffeepot | the irony is i dont even need threadvars here, but due to an issue I encountered yesterday with running --threads:on and the compiler saying globals aren't threadsafe when being used in the main thread, I used threadvar as quick dirty get around |
14:42:47 | coffeepot | i can upload the test2.c if it helps? |
14:44:35 | elrood | even without any ironies, catching a compiler glitch is always useful, under any circumstances. can't reproduce the error, though |
14:44:52 | coffeepot | yeah that's what i thought, but odd you can't reproduce it :/ |
14:46:51 | coffeepot | nim's version is 0.14.3 (2016-09-09), git has 083b31b47314c1aa70b2726a9b7d0a3c942c2bd8 |
14:48:14 | * | nsf quit (Quit: WeeChat 1.5) |
14:52:37 | kier | let y: uint8 = (x.uint8 and 0x0Fu8) shl 4 |
14:52:44 | kier | "type mismatch: got (int) but expected 'uint8'" |
14:52:48 | kier | what am I doing wrong here? |
14:55:32 | kier | if I change 4 to 4u8 it works, but only for certain value of the second operand of 'and' |
14:55:41 | kier | certain values* |
14:56:20 | Araq | kier: shl/shr are weirdly typed :P |
14:56:25 | Araq | but consistent. |
14:56:47 | Araq | I think we should change it though, it often comes up. |
14:56:58 | Araq | patch system.nim please |
15:04:30 | csoriano_ | Araq: hey, yesterday I was wondering about constructors. Someone pointed me to ask you. As far as I can see there is no regular way for having constructors? So the compiler cannot know when an object is not allocated and point that out? Also there is no syntaxt enforcement on how to create an object? |
15:06:39 | kier | Araq: https://github.com/nim-lang/Nim/pull/4743 |
15:09:06 | * | arnetheduck quit (Ping timeout: 276 seconds) |
15:09:40 | Araq | csoriano_: initialization checking doesn't require constructors |
15:10:05 | csoriano_ | Araq: right |
15:10:11 | Araq | and yes, Nim has no C++ style constructors, but it has a notion of construction |
15:10:17 | csoriano_ | and about the syntax enforcement? |
15:10:20 | csoriano_ | hm |
15:10:30 | csoriano_ | is that on pourpose? |
15:10:51 | Araq | what about it? the syntax "enforcement" leads to factories and crazy shit to work around it |
15:11:05 | Araq | it's on purpose, yes. |
15:11:46 | csoriano_ | at the end of the day you have to always create an object. So any object can have it's own way to be created, that kinda makes it unconvenient no? |
15:12:26 | Araq | the convention is clearly documented. |
15:13:04 | Araq | initT for value type T, newT for pointer to T. |
15:13:24 | Araq | and since it's only a convention and not syntax, factories can be named newT too |
15:13:36 | Araq | makes perfect sense. IMO. |
15:20:18 | * | girvo joined #nim |
15:21:26 | coffeepot | araq, in the tutorial it gives an example of object construction using T(), but the tutorial states it should only be used internally. Is this just to maintain the proc init/new convention or are there other reasons? |
15:22:08 | coffeepot | I'm thinking of student = Student(name: "Anton", age: 5, id: 2) in http://nim-lang.org/docs/tut2.html |
15:24:44 | csoriano_ | hm okay... |
15:24:51 | Araq | well you essentially cannot change the object when you expect people to create them manually |
15:24:57 | * | girvo quit (Ping timeout: 244 seconds) |
15:25:23 | coffeepot | fair point |
15:27:13 | csoriano_ | where is the newT vs initT documented? |
15:27:53 | csoriano_ | also one thing I didn't understand from the docs is, why not every object does ref object of RootObj by default |
15:28:04 | csoriano_ | similar to what java does |
15:28:40 | Sentreen | I am using getType in the macro module to turn a typedesc into a NimNode, however, for some reason, it does not simply return the type identifier, instead, it returns `typeDesc[int]` for an int, and the entire object implemenentation for one of my own types |
15:28:59 | Sentreen | Any idea what I'm doing wrong? experimenting with macros is not working out so great for me right now! |
15:29:51 | Araq | Sentreen: if you pass 'int' to the macro, then its type is typeDesc[int] |
15:30:27 | Araq | csoriano_: http://nim-lang.org/docs/apis.html |
15:31:07 | Araq | csoriano_: because inheritance sucks and should be used more conciously than in Java |
15:32:02 | csoriano_ | Araq: thanks, I saw this document before, but I guess I was expecting some explanation (I understand the docs are in an early state) |
15:32:06 | Araq | also 'ref object' is inherently slower than 'object' if the object is small and after 3 decades Java still cannot optimize away reference semantics... |
15:33:18 | Sentreen | Thanks Araq, I did not know I could index a typedesc to get the inner type :) |
15:33:28 | csoriano_ | Araq: okay... |
15:33:53 | Sentreen | Ah wait, I'm actually indexing the node that it returns, makes much more sense. |
15:35:41 | coffeepot | araq, whilst you're about, you mentioned yesterday you had an idea to do with the issue I had with threading and "not thread safe" errors in the main thread, will that be something that's changed any time soon or is it a big job? |
15:38:22 | Araq | my idea is a builtin assumeRunsOnMainThread() that checks the thread id at runtime |
15:38:40 | federico3 | "assume"? |
15:38:50 | Araq | and is known by the compiler so that it can say "aha, ok, accesses global but is gcsafe" |
15:39:23 | coffeepot | wouldn't everything be implicitly threadsafe that isn't marked by {.thread.} pragma anyway? |
15:39:48 | Araq | no, that's not how it works. |
15:40:25 | Araq | federico3: compiler assumes, runtime assures |
15:41:58 | coffeepot | how would thread context change for any procs that aren't called from a {.thread.} proc? |
15:42:33 | coffeepot | or createThread/spawn |
15:43:24 | coffeepot | tbf any fix would be welcome. Is there a github issue for this already? |
15:43:36 | Araq | no. |
15:43:44 | coffeepot | ok i'll make one |
15:43:47 | Araq | you think of this problem like a human being :P |
15:43:55 | Araq | the compiler works differently |
15:44:32 | * | PMunch quit (Quit: leaving) |
15:44:57 | coffeepot | ha yes that I can appreciate |
15:59:03 | * | filcuc quit (Read error: Connection reset by peer) |
16:02:10 | coffeepot | well.. having trouble creating a simple test case for the threads issue without jester |
16:03:44 | * | mcc quit (Quit: Connection closed for inactivity) |
16:13:18 | * | brson joined #nim |
16:15:13 | * | yglukhov quit (Ping timeout: 244 seconds) |
16:15:56 | coffeepot | reported here https://github.com/nim-lang/Nim/issues/4744 |
16:20:59 | kier | I have: |
16:20:59 | kier | proc `shl`*[T1: SomeUnsignedInt, T2: SomeInteger](x: T1, y: T2): T1 |
16:21:20 | kier | why doesn't `shl`(1'u32, 1'u8) match this? |
16:25:23 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:52:40 | * | brechtm quit (Ping timeout: 264 seconds) |
16:54:01 | * | brechtm joined #nim |
17:08:32 | * | desophos joined #nim |
17:12:46 | * | libman1 joined #nim |
17:17:17 | * | aziz joined #nim |
17:19:52 | * | acidx quit (Quit: leaving) |
17:21:08 | FromGitter | <kteza1> What is the reason behind not being able to modify non ref objects inside methods? |
17:21:09 | * | girvo joined #nim |
17:21:53 | * | acidx joined #nim |
17:24:26 | BlaXpirit | kteza1, please show an example |
17:26:15 | * | girvo quit (Ping timeout: 276 seconds) |
17:26:42 | FromGitter | <kteza1> http://pastebin.com/kBD2vxYY |
17:27:41 | BlaXpirit | kteza1, the reason is that these objects are passed by copy |
17:28:49 | BlaXpirit | kteza1, https://glot.io/snippets/eiahyfa6i3 |
17:32:13 | FromGitter | <kteza1> Ohh. This is just a reminder for explicitness ? So that user is sure that he wants to modify the copy but not the original object? |
17:32:56 | BlaXpirit | kteza1, well I don't know if there is a way to modify the copy |
17:33:17 | BlaXpirit | `var` is passing by reference so it can be modified |
17:36:04 | FromGitter | <kteza1> Ohh. 'var Object' in method is a reference to Object? |
17:37:31 | FromGitter | <kteza1> This is confusing |
17:37:37 | * | libman1 quit (Read error: Connection reset by peer) |
17:37:51 | FromGitter | <kteza1> IMO 'ref Object' would have been better |
17:38:21 | BlaXpirit | kteza1, but it has a different meaning already |
17:39:12 | kier | "var Object" is like passing by reference in C++. the value is likely allocated on the stack somewhere, and you're passing a pointer to it so that code unrelated to that stack frame can modify it |
17:39:20 | * | Matthias247 joined #nim |
17:39:32 | kier | "ref Object" is instead referring to a heap-allocated value |
17:40:11 | FromGitter | <kteza1> Ohh cool. Makes sense now :) |
17:45:20 | kier | how does one indicate you want to allow a type class to bind to more than one concrete type during overload resolution? |
17:45:48 | kier | the manual says "use the distinct keyword", but it's not particularly specific about it and none of my attempts have worked yet |
17:49:17 | * | nsf joined #nim |
17:55:31 | * | libman1 joined #nim |
18:15:01 | BlaXpirit | kier, always best with an example |
18:15:18 | BlaXpirit | because i don't even remember the syntax, but i may have an idea because i used to mess with this stuff |
18:37:42 | kier | BlaXpirit: suppose I have proc foo(a: SomeUnsignedInt, b: SomeUnsignedInt) |
18:38:27 | * | gokr joined #nim |
18:38:47 | kier | normally only foo(0'u32, 0'u32) or foo(0'u8, 0'u8) etc are valid, not foo(0'u32, 0'u8), because both a and b must be bound to the same concrete type (and that concrete type must be a member of the SomeUnsignedInt typeclass) |
18:39:15 | kier | the manual says you can specify that a and b can be different concrete types using the distinct keyword, but i'm not sure how to do this |
18:39:25 | kier | hmm just though of something |
18:40:17 | kier | wait what |
18:40:37 | kier | that example I just gave is wrong, foo(0'u32, 0'u8) does compile |
18:46:00 | BlaXpirit | kier, what is even going on with that SomeUnsignedInt |
18:46:10 | BlaXpirit | it's either bugged or just too special of a type |
18:46:35 | BlaXpirit | https://glot.io/snippets/eiak3tn7j4 ????? |
18:49:42 | * | gokr quit (Ping timeout: 244 seconds) |
18:50:37 | * | planhths joined #nim |
18:56:27 | kier | yeah ignore what I said, I didn't actually test before I spoke |
18:56:31 | kier | nvm |
18:56:49 | * | nsf quit (Quit: WeeChat 1.5) |
18:57:13 | BlaXpirit | yes but the question remains - how to force them to be the same type |
19:07:43 | * | GustavoLapasta joined #nim |
19:09:17 | * | brson quit (Ping timeout: 250 seconds) |
19:22:06 | * | girvo joined #nim |
19:26:52 | * | girvo quit (Ping timeout: 264 seconds) |
19:36:18 | * | aziz quit (Remote host closed the connection) |
20:07:18 | * | brson joined #nim |
20:08:19 | * | planhths quit (Ping timeout: 252 seconds) |
20:09:16 | * | planhths joined #nim |
20:33:49 | * | libman1 left #nim (#nim) |
20:38:57 | * | GangstaCat quit (Quit: Leaving) |
20:45:58 | * | _stowa joined #nim |
20:52:09 | * | nairobi joined #nim |
20:52:32 | * | Trustable quit (Remote host closed the connection) |
20:53:46 | * | GustavoLapasta quit (Quit: Leaving) |
20:53:49 | * | _stowa quit (K-Lined) |
21:03:07 | * | gokr joined #nim |
21:07:05 | * | planhths quit (Quit: Konversation terminated!) |
21:15:32 | * | brson quit (Ping timeout: 240 seconds) |
21:22:58 | * | girvo joined #nim |
21:27:33 | * | girvo quit (Ping timeout: 250 seconds) |
22:13:26 | * | kjrose quit (Read error: Connection reset by peer) |
22:13:47 | * | kjrose joined #nim |
22:13:47 | * | nairobi quit (Read error: Connection reset by peer) |
22:21:42 | * | kjrose quit (Read error: Connection reset by peer) |
22:22:02 | * | kjrose joined #nim |
22:28:18 | * | kellyjrose joined #nim |
22:28:48 | * | kjrose quit (Ping timeout: 244 seconds) |
22:32:04 | * | kjrose joined #nim |
22:35:31 | * | kellyjrose quit (Ping timeout: 244 seconds) |
22:41:47 | * | kjrose quit (Read error: Connection reset by peer) |
22:42:07 | * | kjrose joined #nim |
22:53:20 | * | brson joined #nim |
22:53:51 | * | gokr quit (Ping timeout: 276 seconds) |
22:54:25 | * | Ven_ joined #nim |
23:00:26 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:00:27 | * | kjrose quit (Read error: Connection reset by peer) |
23:00:43 | * | kjrose joined #nim |
23:05:05 | * | elrood quit (Quit: Leaving) |
23:18:13 | * | brson quit (Ping timeout: 244 seconds) |
23:23:43 | * | girvo joined #nim |
23:27:01 | * | yglukhov joined #nim |
23:27:59 | * | girvo quit (Ping timeout: 250 seconds) |
23:31:40 | * | yglukhov quit (Ping timeout: 264 seconds) |
23:58:14 | * | nsf joined #nim |