00:06:51 | ldlework | Hey Araq_ I don't understand how macro's like mine are supposed to work without immediate mode since they have to refer to identifiers that don't exist yet? |
00:12:02 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:25:05 | * | derka joined #nim |
00:28:54 | Araq_ | ldlework: use 'untyped' for lazy parameters |
00:50:18 | dom96 | https://github.com/dom96/notifications |
01:02:00 | * | brson joined #nim |
01:14:55 | * | jaco60 quit (Ping timeout: 240 seconds) |
01:19:15 | * | pregressive joined #nim |
01:19:30 | * | yglukhov joined #nim |
01:23:59 | * | yglukhov quit (Ping timeout: 260 seconds) |
01:35:41 | * | pregressive quit (Remote host closed the connection) |
01:36:43 | * | pregressive joined #nim |
01:37:45 | ldlework | Is it known that you can't use var types in `->` proctypes from the future module? |
01:37:52 | ldlework | Error: Incorrect type list in proc type declaration. |
01:38:52 | Araq_ | no. |
01:39:07 | jsudlow | Hey Araq_ Were trying to get the key thats currently pressed down in nimsdl2 |
01:39:22 | jsudlow | https://gist.github.com/jsudlow/b23731db908cf1738ab1 |
01:39:41 | ldlework | jsudlow: this problem isn't apparent in that snippet though |
01:40:12 | ldlework | Araq_: is there a reason why `evConv` specifies the event as var? https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L591 |
01:40:42 | * | frewtc4ke joined #nim |
01:40:52 | Araq_ | it predates unsafeAddr |
01:40:55 | Araq_ | that's why |
01:41:11 | Araq_ | fix it |
01:41:48 | ldlework | huh |
01:42:00 | ldlework | Araq_: by just removing 'var' ? |
01:44:35 | Araq_ | and using unsafeAddr instead of 'addr' |
01:45:16 | ldlework | Araq_: if I have SDL installed from Nimble, how would I test the changes in a fork? |
01:45:43 | Araq_ | clone it on your own. |
01:45:51 | Araq_ | I talked with dom96 about it |
01:46:28 | Araq_ | he thinks nimble does not have to support that. even though it's a common problem and nimble already uses git for downloading... |
01:46:51 | ldlework | I understand I have to clone it on my own |
01:47:01 | ldlework | But how do I then get Nim to use my clone |
01:47:26 | Araq_ | build with --noNimblePath |
01:47:46 | ldlework | frewtc4ke in this channel is a spam bot |
01:48:11 | Araq_ | he PM'ed me |
01:48:22 | ldlework | yeah probably pm'ed everyone |
01:48:44 | Araq_ | maybe he's lonely |
01:49:54 | ldlework | lol |
01:52:07 | ldlework | Araq_: hmm, I'm not sure I understand the whole process. I cloned sdl2 somewhere. Now how do I get my project to build against this non-nimble managed clone? |
01:52:28 | def- | ldlework: as a quick hack you can just run "nimble install" in the cloned directory |
01:52:43 | ldlework | def-: can I keep running that as I change the code |
01:53:25 | def- | Then you have to "nimble install" again after each change you want to test |
01:53:30 | ldlework | ok |
01:53:57 | def- | you could run nim with --path and add the sdl2 path |
01:54:27 | ldlework | yeah that fixed it |
01:54:29 | ldlework | I'll submit a PR |
01:55:47 | jsudlow | nice job ldlework |
01:55:55 | dom96 | aww, frewtc4ke didn't PM me |
01:55:58 | dom96 | I feel left out |
01:56:07 | ldlework | https://github.com/nim-lang/sdl2/pull/58 |
01:56:21 | ldlework | frewtc4ke | is he still an active chatter? |
01:56:22 | ldlework | ldlework | who? |
01:56:24 | ldlework | frewtc4ke | deeze...DEEZE NUTZ |
01:56:30 | ldlework | lol |
01:57:17 | ldlework | def-: so do I just do "nimble install sdl2" from not inside the clone? |
01:57:29 | * | frewtc4ke left #nim (#nim) |
01:57:31 | def- | ldlework: to get back the original version? |
01:57:32 | dom96 | Araq_: I feel like what you think is the "problem" is not actually the problem that ldlework is having. |
01:57:42 | ldlework | def-: yeah |
01:57:50 | def- | yes |
01:58:17 | ldlework | dom96: you mean with regards to individual statements being executed before anything else? |
01:58:36 | ldlework | jsudlow: run "nimble install sdl2" |
01:58:40 | dom96 | ldlework: what |
01:58:56 | ldlework | dom96: I have a bug out against the VM, I thought you were referring to that. |
02:00:41 | dom96 | ldlework: No, i'm replying to Araq_'s message from 1:46am (you can probably guess what time that is in your timezone) |
02:00:54 | ldlework | oh lol |
02:02:43 | * | derka quit (Quit: derka) |
02:03:08 | dom96 | Your issue should be fixed once https://github.com/nim-lang/nimble/pull/183 (or something similar) is merged. |
02:04:18 | dom96 | But yeah, lots of workarounds for this already |
02:04:26 | dom96 | def- mentioned them all I think |
02:28:27 | * | pregressive quit (Remote host closed the connection) |
02:28:39 | * | wuehlmaus quit (Quit: Lost terminal) |
02:41:33 | ldlework | Araq_, dom96: Do you think it would be possible to define a `.` override for a type to dynamically restrict what fields can be used on a type at runtime? |
02:41:59 | ldlework | Like lets say the type had a bitset, and depending on the values in the bitset, certain fields would be usable, but any not represented in the bitset would raise an exception? |
02:44:13 | ldlework | Seems like it might work. |
02:46:48 | ldlework | Maybe the unified type approach is the wrong way to go about it hmmm |
02:50:36 | * | pregressive joined #nim |
02:59:28 | * | brson quit (Quit: leaving) |
03:07:21 | * | pregressive quit (Remote host closed the connection) |
03:20:50 | * | yglukhov joined #nim |
03:25:19 | * | yglukhov quit (Ping timeout: 260 seconds) |
03:31:04 | * | xet7 quit (Ping timeout: 265 seconds) |
04:12:02 | * | vendethiel quit (Remote host closed the connection) |
04:12:13 | * | vendethiel joined #nim |
05:14:20 | * | vangroan joined #nim |
05:21:21 | * | s4 joined #nim |
05:22:22 | * | yglukhov joined #nim |
05:27:07 | * | yglukhov quit (Ping timeout: 260 seconds) |
06:11:11 | * | mogu joined #nim |
06:13:43 | * | mogu quit (Client Quit) |
06:39:38 | * | darkf joined #nim |
06:42:26 | * | Jesin joined #nim |
07:04:33 | * | yglukhov joined #nim |
07:09:19 | * | yglukhov quit (Ping timeout: 260 seconds) |
07:18:48 | * | xet7 joined #nim |
07:35:28 | * | gokr joined #nim |
07:45:59 | * | wuehlmaus joined #nim |
08:01:38 | * | vendethiel quit (Ping timeout: 272 seconds) |
08:02:44 | * | vendethiel joined #nim |
08:23:25 | * | yglukhov joined #nim |
08:40:27 | * | Trustable joined #nim |
08:40:36 | * | Trustable quit (Remote host closed the connection) |
08:44:00 | * | Trustable joined #nim |
08:46:36 | * | Demon_Fox quit (Quit: Leaving) |
08:58:09 | * | vikaton quit (Quit: Connection closed for inactivity) |
09:15:25 | * | jaco60 joined #nim |
09:33:50 | * | bjz joined #nim |
09:45:41 | * | derka joined #nim |
09:45:56 | * | bjz quit (Ping timeout: 256 seconds) |
09:48:01 | * | bjz joined #nim |
10:03:15 | * | derka quit (Quit: derka) |
10:14:49 | * | desophos quit (Read error: Connection reset by peer) |
10:31:15 | * | vangroan quit (Ping timeout: 240 seconds) |
10:46:23 | * | derka joined #nim |
11:07:49 | * | derka quit (Ping timeout: 265 seconds) |
11:08:39 | * | derka joined #nim |
11:20:42 | * | Lea2 is now known as Learath2 |
11:27:35 | * | vendethiel quit (Ping timeout: 240 seconds) |
11:28:59 | * | vendethiel joined #nim |
11:37:08 | * | vangroan joined #nim |
12:23:20 | * | exebook joined #nim |
12:48:47 | * | nchambers joined #nim |
12:52:35 | * | vendethiel quit (Ping timeout: 240 seconds) |
12:53:48 | * | vendethiel joined #nim |
13:40:43 | * | s4 quit (Quit: Konversation terminated!) |
13:58:50 | * | nchambers quit (Ping timeout: 260 seconds) |
14:08:18 | * | askatasuna joined #nim |
14:08:57 | * | yglukhov_ joined #nim |
14:11:00 | * | yglukhov quit (Ping timeout: 250 seconds) |
14:21:48 | * | yglukhov_ quit (Remote host closed the connection) |
14:25:21 | * | yglukhov joined #nim |
14:25:24 | * | yglukhov quit (Remote host closed the connection) |
14:30:13 | * | yglukhov joined #nim |
14:50:25 | * | yglukhov quit (Remote host closed the connection) |
14:51:00 | * | yglukhov joined #nim |
14:56:04 | * | vangroan quit (Quit: Leaving) |
14:58:27 | * | strcmp1 quit (Quit: peace) |
15:00:54 | * | derka_ joined #nim |
15:03:17 | * | derka quit (Ping timeout: 255 seconds) |
15:03:18 | * | derka_ is now known as derka |
15:19:45 | derka | Hello Guys, is there any way to have persistent data in Nim ? |
15:20:39 | derka | like an inmemory database inside nim |
15:22:02 | Araq_ | derka: I uses sqlite for these things. |
15:22:21 | Araq_ | pure Nim solutions are not hard either with marshal.nim |
15:22:52 | derka | Thanks Araq_ |
15:26:17 | derka | Araq_ are there a lot of companies using Nim in real time production environement ? |
15:26:20 | derka | like telecom for instance |
15:26:42 | derka | I really love Nim and I think it is gonna enable me to do what i usually do in python and pure C |
15:26:43 | Araq_ | no, but I expect this to change :-) |
15:26:49 | derka | oh :) |
15:26:57 | derka | What is missing? ANd when do you think it will be |
15:27:09 | Araq_ | 0.13 is around the corner and 0.14 will focus on async. |
15:27:17 | derka | nice |
15:27:39 | Araq_ | but I don't make any release predictions anymore. it's too embarrassing. |
15:27:45 | derka | I’ve been searching for a new langage for a long time, I looked at Go, Erlang, Rust, etc |
15:27:50 | derka | but Nim really is the thing |
15:28:23 | derka | I understand, same here,r you expect something to be done in a few month and it take more than a year is usual lol |
15:39:23 | * | gokr quit (Quit: Leaving.) |
15:40:30 | derka | Araq_ is there anyway to return diferent type of value in a proc or method |
15:43:15 | dom96 | hello derka |
15:43:24 | derka | Hello dom96 |
15:43:28 | dom96 | derka: can you elaborate your question? |
15:43:39 | derka | I am gonna take an example in python |
15:44:12 | derka | a function for instance could either return an integer value, or a list of integer for instance |
15:44:51 | derka | is there anyway to make this work in Nim ? |
15:45:50 | dom96 | yes, you can use a variant object |
15:46:01 | derka | ok thx |
15:46:21 | derka | is there an example somewhere ? |
15:46:22 | dom96 | but you likely shouldn't, if you're thinking dynamically then it sounds like you might doing it incorrectly already :) |
15:46:35 | dom96 | Question is: what do you want to implement? |
15:47:34 | derka | I want to implement a method for which i dont know in advance the type of result i will have |
15:47:54 | derka | the result could be a string, an integer or a list of string |
15:48:06 | dom96 | what does this method do? |
15:48:16 | derka | query a database |
15:48:23 | dom96 | ahh okay. |
15:48:25 | derka | i think i found what i need, you are right variant seems the right stuff |
15:48:26 | derka | http://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
15:49:00 | dom96 | Well, you may as well use the JsonNode object |
15:49:09 | dom96 | http://nim-lang.org/docs/json.html#JsonNode |
15:49:13 | dom96 | instead of defining your own |
15:49:27 | dom96 | it should support everything you need |
15:49:39 | dom96 | Hope this helps, sadly I must go! |
15:49:44 | dom96 | see you later |
15:50:05 | derka | thx a lot |
15:50:50 | * | vendethiel quit (Ping timeout: 260 seconds) |
15:50:51 | * | BitPuffin joined #nim |
15:51:16 | * | vendethiel joined #nim |
16:05:37 | * | gokr joined #nim |
16:17:29 | derka | Guys, the variant example here http://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants is not working |
16:17:40 | derka | I get following error: pnode.nim(17, 24) Error: undeclared identifier: 'PNode' |
16:19:45 | derka | it it should be Node instead of PNode everywhere in the example |
16:30:24 | Araq_ | good catch |
16:36:29 | * | Arrrr joined #nim |
16:39:25 | Arrrr | vegansk: Are you alive ? |
16:42:10 | * | derka quit (Ping timeout: 260 seconds) |
16:50:21 | * | derka joined #nim |
16:51:03 | * | vangroan joined #nim |
16:52:47 | wuehlmaus | wow, tnim with tcc is something that is almost joy :) |
16:57:55 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:22:10 | def- | wuehlmaus: yeah, tcc is crazy fast at compiling |
17:26:06 | * | vangroan quit (Read error: Connection reset by peer) |
17:34:35 | * | onionhammer quit (Ping timeout: 240 seconds) |
17:35:01 | * | Dmirly132 joined #nim |
17:36:04 | * | onionhammer joined #nim |
17:43:49 | * | vangroan joined #nim |
17:45:22 | * | yglukhov joined #nim |
17:47:14 | * | gokr1 joined #nim |
17:47:55 | * | gokr quit (Read error: Connection reset by peer) |
17:49:59 | * | yglukhov quit (Ping timeout: 264 seconds) |
17:50:21 | * | Dmirly132 quit () |
17:51:50 | * | yglukhov joined #nim |
17:55:51 | * | yglukhov quit (Remote host closed the connection) |
18:04:02 | * | Jesin quit (Quit: Leaving) |
18:09:22 | derka | dom96 how do i get nimble to install i get Error: undeclared identifier: 'getModule' when i install it |
18:13:09 | * | BitPuffin quit (Ping timeout: 265 seconds) |
18:24:40 | * | gokr1 quit (Quit: Leaving.) |
18:34:46 | * | satbyy joined #nim |
18:35:50 | * | nchambers_ joined #nim |
18:36:44 | * | nchambers_ is now known as nchambers |
18:45:46 | * | dom96_mobile joined #nim |
18:45:57 | * | Jesin joined #nim |
18:46:32 | dom96_mobile | derka: you need a newer version of Nim |
18:46:50 | derka | so i need to switch to devel ? |
18:47:15 | dom96_mobile | Yeah |
18:47:19 | derka | ok thx |
18:55:02 | * | dom96_mobile quit (Ping timeout: 256 seconds) |
18:59:15 | * | askatasuna quit (Ping timeout: 260 seconds) |
19:01:17 | * | Salewski joined #nim |
19:02:45 | Salewski | Is there something like signum, sign, sgn or copysign already available for Nim? See http://stackoverflow.com/questions/1903954/is-there-a-standard-sign-function-signum-sgn-in-c-c |
19:09:40 | Salewski | proc sign(i: int): int = (if i < 0: -1 elif i > 0: 1 else: 0) # maybe not the best solution |
19:09:48 | * | Salewski quit () |
19:10:47 | * | yglukhov joined #nim |
19:15:50 | * | askatasuna joined #nim |
19:20:55 | * | superfunc joined #nim |
19:29:11 | * | vangroan quit (Quit: Leaving) |
19:35:47 | Araq_ | salewski: I'd expect it to generate optimal code with a modern C compiler |
19:37:56 | Arrrr | Too late for him, he is dead. A question, is this bug going to get fixed before 0.13? https://github.com/nim-lang/Nim/issues/3539 |
19:50:46 | * | Matthias247 joined #nim |
19:51:44 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
19:52:12 | * | bjz joined #nim |
19:59:21 | * | kniteli joined #nim |
20:01:13 | * | Demon_Fox joined #nim |
20:01:14 | * | Salewski joined #nim |
20:02:03 | wuehlmaus | def-: crazy talent: he did ffmpeg , qemu and tcc. amazes me every time! |
20:03:08 | wuehlmaus | plus linux in the browser! |
20:07:19 | Salewski | Araq: CopySign may be more difficult, maybe for Nim we should do that with a var parameter, whle C++ returns the result. And some people seems to try to avoid branching for such expressions... |
20:08:46 | * | yglukhov quit (Remote host closed the connection) |
20:09:09 | * | Salewski quit () |
20:09:49 | Araq_ | Arrrr: sorry, no, I'm building the installers as we speak |
20:10:08 | Araq_ | but after 0.13 we'll get a testing machine for XP |
20:10:41 | * | ephja joined #nim |
20:11:14 | derka | Guys, I am a little lost with error messages provided by Nim |
20:11:33 | derka | what does it mean: jsontest.nim(7, 22) Error: type mismatch: got (NimNode) but expected one of: json.parseFile(filename: string) |
20:12:30 | * | superfunc quit (Quit: WeeChat 1.3) |
20:13:15 | derka | i think i know the issue |
20:13:41 | Arrrr | That sounds good. |
20:14:00 | derka | lol |
20:14:09 | derka | i am trying to make a macro... |
20:14:36 | Arrrr | Sorry, was a response to araq. Any snippet |
20:14:38 | Arrrr | ? |
20:17:12 | derka | oh ok lol |
20:17:19 | derka | lib/pure/lexbase.nim(155, 13) Error: VM is not allowed to 'cast' |
20:17:58 | Arrrr | you cannot cast in compile time |
20:18:18 | derka | so i can not call many things from macro then |
20:18:18 | derka | lol |
20:18:21 | derka | was trying to use json |
20:22:19 | * | yglukhov joined #nim |
20:26:16 | dom96 | derka: did you get Nimble working? |
20:26:22 | derka | no lol |
20:26:24 | dom96 | it's fine to ask here btw |
20:26:43 | dom96 | you don't need to PM me |
20:26:49 | derka | ok but you were away |
20:27:00 | derka | so my message would have been lost in the thread |
20:27:07 | derka | lol |
20:27:15 | dom96 | Nah, I look at the IRC logs (http://irclogs.nim-lang.org/) |
20:29:44 | * | Arrrr quit (Quit: WeeChat 1.2) |
20:32:27 | dom96 | in any case, you must have an old Nim in your PATH |
20:34:07 | * | brson joined #nim |
20:36:51 | * | BitPuffin joined #nim |
20:37:01 | * | darkf quit (Quit: Leaving) |
20:38:37 | * | BitPuffin quit (Read error: Connection reset by peer) |
20:43:46 | derka | ok |
20:47:06 | derka | git branch |
20:47:07 | derka | * devel |
20:47:17 | derka | Nim Compiler Version 0.10.3 (2015-04-25) [MacOSX: amd64] |
20:47:25 | derka | i must be compiling it wrong |
20:47:37 | derka | should i still do sh build.sh in csrouces |
20:48:12 | Araq_ | 0.10.3 ? |
20:48:19 | Araq_ | that's *old* |
20:48:56 | derka | :) |
20:50:54 | dom96 | derka: run `which nim` |
20:51:00 | derka | yeah |
20:51:24 | derka | Abdelkaders-MacBook-Pro:Nim abdelkaderallam$ which nim |
20:52:13 | derka | I am doing some magic with macro |
20:52:24 | derka | and i cant even copy paste into irc |
20:52:25 | derka | lol |
20:52:52 | derka | which nim gives /Users/abdelkaderallam/Code/Nim/bin/nim |
20:52:56 | derka | which is where i jsut compiled |
20:53:10 | derka | and when i do git log i get |
20:53:11 | derka | commit a121c3f9eb2a348b9d6ae03ffd01aab26a238c30 |
20:53:12 | derka | Author: Araq <[email protected]> |
20:53:13 | derka | Date: Mon Jan 18 20:16:21 2016 +0100 |
20:53:14 | derka | updated installer.ini |
20:53:15 | derka | which means i should be up to date |
20:53:51 | dom96 | did you './koch boot -d:release' ? |
20:54:03 | derka | no |
20:54:05 | derka | what is it doing |
20:54:33 | dom96 | bootstrapping the compiler ;) |
20:54:43 | derka | interesting :) |
20:54:49 | derka | i have to admit i didnt do it :) |
20:54:55 | dom96 | the c sources contain an old version of the compiler, which is then used to compile the newest compiler source |
20:54:58 | dom96 | *sources |
20:55:04 | derka | now i am good |
20:55:05 | derka | nim |
20:55:06 | derka | Nim Compiler Version 0.13.0 (2016-01-18) [MacOSX: amd64] |
20:55:22 | derka | it sounds like pypy rpython complication |
20:56:22 | Araq_ | except we don't need 10GB of RAM to bootstrap :P |
20:56:29 | derka | loool |
21:02:19 | * | desophos joined #nim |
21:02:52 | Xe | okay |
21:02:53 | Xe | so |
21:03:06 | Xe | trying to do https://codegolf.stackexchange.com/questions/69189/build-a-compiler-bomb in nim |
21:03:57 | Xe | bigbin.nim(4, 3) Error: undeclared identifier: 'a' for the code http://ix.io/nwP |
21:07:11 | Xe | if you remove the macro "b", and make the macro recursive, it gets the error "bigbin.nim(4, 5) Error: recursive dependency: 'a'" |
21:12:56 | Araq_ | guys, please try 0.13.0!!!! |
21:19:05 | Xe | Araq_: I will!!!! |
21:19:09 | Xe | tarball link??? |
21:21:56 | derka | Guys i just tried to make a redis client in Nim |
21:22:04 | derka | first code ever done in Nim for me |
21:22:05 | derka | https://github.com/aallamaa/desirnim |
21:23:02 | derka | it is missing some stuff but it is a start that contains all the commands of redis, some redis features like pipelining and subscribing are missing though will do it later |
21:23:18 | * | xet7 quit (Read error: Connection reset by peer) |
21:23:28 | derka | I am using macro and variant object |
21:23:39 | def- | Xe: http://nim-lang.org/download.html |
21:24:56 | derka | The way i coded it is similar to the way i did on of the official python redis client : desir which is also using metaclass to self generate functions |
21:25:50 | Araq_ | derka: we also have a redis client as a nimble package |
21:26:03 | derka | yeah i saw it :) |
21:28:06 | derka | but you quoted : "Repetition renders the ridiculous reasonable." -- Norman Wildberger |
21:28:42 | derka | so i tried to make code which generate by it self instead of manually rewriting every possible command in redis |
21:32:22 | derka | Nim is really powerful |
21:33:11 | * | xet7 joined #nim |
21:35:13 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:38:30 | * | askatasuna quit (Ping timeout: 260 seconds) |
21:58:52 | * | lagoon_monster joined #nim |
22:00:14 | lagoon_monster | Hi, I'm trying to access a PostgreSQL database using db_postgres on Windows 7 with Nim. When I run the program, I get "could not load: libpq.dll". Is there something I can do to correct this? |
22:00:46 | ldlework | lagoon_monster: install libpq |
22:02:00 | lagoon_monster | PostgreSQL is installed on this host, and libpq is there. Does nim need to see this in the path, or in an environment variable, etc.? |
22:03:17 | dom96 | lagoon_monster: it needs to be in the path or beside the .exe |
22:06:31 | lagoon_monster | dom96: Interesting, OK, I copied libpq.dll to exe's folder, and then it said I needed ssleay32.dll. Copied that from postgres, and it said it needed libeay32.dll. Copied that, and I'm back to "could not load: libpq.dll". Will try adding the postgres bin folder to the path and see if that works better. |
22:08:47 | lagoon_monster | dom96: That was from a 9.5-beta1 install. If I just copy all the DLLs from the 9.4 bin folder, it runs. |
22:10:13 | Araq_ | lagoon_monster: also often DLLs have 32 vs 64 bit issues |
22:10:55 | lagoon_monster | Araq_: That makes sense, 64-bit nim installed, but the 9.5b1 install might be 32 |
22:13:52 | Araq_ | probably |
22:16:41 | lagoon_monster | Thanks guys :) |
22:22:32 | * | nchambers quit (Ping timeout: 272 seconds) |
22:38:02 | * | lankanmon quit (Quit: I have to Go! Bye Guys!) |
22:41:58 | * | vendethiel quit (Ping timeout: 272 seconds) |
22:44:28 | * | vendethiel joined #nim |
22:48:06 | * | pregressive joined #nim |
22:50:17 | * | enquora joined #nim |
22:54:09 | ldlework | Are BracketExpr's potentially infinitely recursive? |
22:54:30 | ldlework | A[B[C[D[E[F[G[H ... |
22:54:45 | Araq_ | why not? ;-) |
22:54:45 | * | enquora quit (Client Quit) |
22:55:05 | ldlework | heh makes writing pretty abstractions over the top a bit more finicky :D |
22:55:09 | * | enquora joined #nim |
22:55:12 | ldlework | but ok, thanks |
22:56:11 | * | enquora quit (Client Quit) |
22:56:36 | ldlework | I kind of want to treat Ident's and BracketExpr's as just Ident |
22:56:51 | * | enquora joined #nim |
22:57:00 | ldlework | Since there are a number places where a BracketExpr can take the place of an Ident |
22:57:14 | ldlework | like in the type-desc for IdentDefs |
22:57:46 | * | yglukhov quit (Remote host closed the connection) |
22:57:55 | ldlework | I don't think I actually ever need a BracketExpr, where, it wouldn't be possible for an Ident to appear instead |
23:00:35 | ldlework | Araq_: is there a good way for unit-testing macros? |
23:03:13 | ldlework | do you just unit test the stuff that macros produce instead? |
23:04:20 | * | vendethiel- joined #nim |
23:04:46 | * | vendethiel quit (Ping timeout: 272 seconds) |
23:05:00 | Araq_ | good question |
23:07:59 | * | satbyy quit (Ping timeout: 264 seconds) |
23:08:35 | * | vendethiel- quit (Ping timeout: 240 seconds) |
23:15:01 | Xe | i cna't install nimble, it says it needs the library for the compiler |
23:15:13 | Xe | /home/xena/prefix/nimble/src/nimblepkg/nimscriptsupport.nim(8, 11) Error: cannot open 'compiler/ast' |
23:21:31 | dom96 | def-: hrm, I wonder what that caching issue is, any ideas? |
23:21:59 | dom96 | Xe: how are you installing it? |
23:22:19 | Xe | dom96: nimble? |
23:22:34 | dom96 | Xe: yes |
23:22:49 | dom96 | or do you mean that you using nimble to install it? :P |
23:22:55 | Xe | git clone of nimblt to ~/prefix/nimble |
23:22:58 | Xe | xena@greedo (linux) ~/prefix/nimble |
23:23:00 | Xe | ➜ nim c -r src/nimble install |
23:23:02 | Xe | fails |
23:23:38 | * | enquora quit (Quit: enquora) |
23:24:01 | def- | dom96: not sure, wasn't cached for me |
23:24:41 | Xe | dom96: nim itself was installed via https://github.com/Xe/rpmspecs/blob/master/nim/nim.spec |
23:25:51 | dom96 | Xe: My guess is that install.sh does not install the compiler sources. |
23:26:21 | Araq_ | and where would it install these? |
23:26:58 | dom96 | no idea |
23:27:07 | dom96 | definitely a problem |
23:27:16 | Xe | i see them at /usr/lib/nim |
23:28:32 | dom96 | Xe: try: nim c --path:/usr/lib/nim src/nimble |
23:29:09 | Xe | oh |
23:29:11 | Xe | that's odd |
23:29:22 | Xe | it put the stdlib sources in /usr/lib/nim |
23:29:26 | Xe | but not the compiler source |
23:30:08 | Xe | it dumped everything in lib in /usr/lib/nim lol |
23:31:14 | Xe | bug in my rpmspec likely |
23:41:00 | ldlework | What's the best way to have a default arg for a sequence? |
23:41:08 | ldlework | And if the sequence isn't provided, to initialize an empty sequence? |
23:41:56 | ldlework | Do you just make the default nil |
23:42:10 | ldlework | and then in the proc, check if the param is nil, and if it is, set it to a new sequence? |
23:43:50 | dom96 | okay, I think I fixed the caching issue |
23:48:36 | dom96 | ldlework: proc foo(x: seq[int] = @[])? |
23:48:59 | ldlework | dom96: doing this in Python is a gotcha |
23:49:04 | ldlework | is it a gotcha in Nim too? |
23:49:29 | dom96 | Don't think so. |
23:49:45 | ldlework | dom96: when is that array initialized? |
23:49:55 | def- | ldlework: I would say no, but you could emulate the Python gotcha like this, if I understand it correctly: |
23:50:05 | def- | var default = @[] |
23:50:13 | def- | proc foo(x: seq[int] = default) |
23:50:21 | ldlework | okay so each time I call it, I get a new sequence |
23:50:29 | ldlework | thanks |
23:50:36 | dom96 | seq[int] isn't mutable |
23:50:49 | ldlework | hmm? |
23:50:51 | dom96 | so i don't think the gotcha applies right? |
23:51:25 | ldlework | maybe not, but in the var case |
23:51:57 | dom96 | in the var case you can't just set it to @[] in the param list |
23:52:01 | def- | ldlework: with var it fails to compile, preventing the gotcha |
23:52:12 | ldlework | why would it fail to compile |
23:52:29 | Xe | okay so install.sh doesn't copy the compiler sources |
23:52:51 | ldlework | `proc foo(x: var seq[int] = @[])` isn't valid Nim? |
23:52:57 | dom96 | Xe: Well... that's not good :\ |
23:53:32 | * | askatasuna joined #nim |
23:53:32 | dom96 | ldlework: nope. You can't pass a literal to a 'var T' type. |
23:54:43 | ldlework | pass? |
23:55:07 | ldlework | I'm confused |
23:55:21 | ldlework | oh because |
23:55:29 | ldlework | you would have nowhere to access the mutated value? |
23:55:34 | ldlework | because you passed a literal? |
23:56:31 | dom96 | I think so, yeah. |