00:02:49 | * | Jesin quit (Ping timeout: 255 seconds) |
00:16:02 | * | Jesin joined #nim |
00:24:53 | * | drewsrem quit (Quit: Leaving) |
00:31:27 | * | boop is now known as boopisaway |
00:38:39 | wb | Just noticed it says in the documentation that os.sleep() takes milliseconds. It actually takes seconds on my (windows) system, so either the code or doc is wrong or my system is strange |
00:41:49 | cazov | as far as I can see, it should be milliseconds unless there's something funny on your system. os.sleep goes straight down to https://msdn.microsoft.com/en-us/library/windows/desktop/ms686298%28v=vs.85%29.aspx |
00:43:23 | cazov | ahh, yeah, there might be something funny with your system clock going on. windows and time/clock stuff has always been a scary maze of things |
00:45:27 | * | cornus_ammonis joined #nim |
00:48:21 | cornus_ammonis | hello, I'm new to nim and I'm trying out some of the templating examples in aporia, and the result of one of them is different from the documentation |
00:49:16 | cornus_ammonis | template t{(0|1|2){x}}(x: expr): expr = x+1 |
00:49:20 | cornus_ammonis | let a = 1 |
00:49:32 | cornus_ammonis | echo a |
00:49:44 | cornus_ammonis | for me, that outputs 3, but it's supposed to be 2 |
00:50:49 | cornus_ammonis | indeed it outputs 3 if a is 0, 1, or 2 |
00:53:13 | * | wan quit (Ping timeout: 264 seconds) |
00:54:50 | * | kumul quit (Ping timeout: 256 seconds) |
00:55:16 | reactormonk | cornus_ammonis, I think that's because the template is applied repeatatly |
00:55:28 | reactormonk | cornus_ammonis, check the compiler output |
00:57:06 | * | jaco60 quit (Ping timeout: 256 seconds) |
00:58:37 | cornus_ammonis | reactormonk, the C output? I'm looking at it, not sure what part is relevant |
00:58:48 | reactormonk | cornus_ammonis, no, the nim compiler output |
00:59:37 | cornus_ammonis | oh, this? |
00:59:39 | cornus_ammonis | c:\users\winter~1\appdata\local\temp\aporia\a0.nim(2, 9) Hint: t(1) --> '2' [Pattern] |
00:59:44 | reactormonk | exactly |
00:59:44 | cornus_ammonis | c:\users\winter~1\appdata\local\temp\aporia\a0.nim(2, 9) Hint: t(2) --> '3' [Pattern] |
01:00:08 | cornus_ammonis | it does say in the docs that outputs 2, though |
01:00:28 | reactormonk | Sounds like a regression to me |
01:00:35 | cornus_ammonis | http://nim-lang.org/docs/manual.html#term-rewriting-macros-pattern-operators |
01:01:42 | reactormonk | we need doctest or something similar :-/ |
01:03:21 | reactormonk | cornus_ammonis, https://github.com/Araq/Nim/issues/new |
01:03:59 | cornus_ammonis | got it, will submit an issue |
01:05:07 | reactormonk | cornus_ammonis, the basic question - should term rewrite be applied repeatly? e.g. for recursive stuff |
01:06:02 | cornus_ammonis | I'm sure a case could be made for either behavior being preferable in some situation |
01:06:28 | cornus_ammonis | what happens if my rewrite rules create a loop, anyway |
01:06:43 | reactormonk | try it |
01:08:28 | cornus_ammonis | infinite compilation |
01:08:41 | cornus_ammonis | er |
01:08:45 | * | ChrisMAN quit (Ping timeout: 264 seconds) |
01:09:01 | cornus_ammonis | actually it bails after a bunch of iterations, possibly stack overflow? |
01:09:16 | cornus_ammonis | template t{(0|1){x}}(x: expr): expr = x xor 1 |
01:09:22 | cornus_ammonis | let a = 1 |
01:09:27 | cornus_ammonis | echo a |
01:09:35 | cornus_ammonis | then a bunch of this: |
01:09:48 | cornus_ammonis | c:\users\winter~1\appdata\local\temp\aporia\a0.nim(2, 9) Hint: t(0) --> '1' [Pattern] |
01:09:53 | cornus_ammonis | c:\users\winter~1\appdata\local\temp\aporia\a0.nim(2, 9) Hint: t(1) --> '0' [Pattern] |
01:10:20 | cornus_ammonis | it outputs 1 after iterating a couple hundred times |
01:10:27 | cornus_ammonis | compilation is somehow successful |
01:14:49 | * | dddddd quit (Ping timeout: 256 seconds) |
01:15:52 | reactormonk | ^^ |
01:17:02 | * | wan joined #nim |
01:17:08 | reactormonk | cornus_ammonis, stresstesting the compiler is always good |
01:17:50 | cornus_ammonis | I suppose that's hitting a recursion depth limit somewhere |
01:19:24 | reactormonk | cornus_ammonis, wanna mess around in the compiler? ./koch temp c <your file> to see what the compiler does and if you wanna change stuff in it |
01:24:28 | * | kumul joined #nim |
01:27:55 | cornus_ammonis | took me a minute to figure out how to do that on windows |
01:32:01 | * | lokulin joined #nim |
01:33:30 | cornus_ammonis | output isn't much different than what's shown in aporia, except it also shows a big list of packages |
01:33:50 | reactormonk | sure, that's just for compiling the compiler after you messed with it |
01:34:26 | cornus_ammonis | ah ok |
01:35:37 | reactormonk | cornus_ammonis, eg.g. insert debug(n) at patterns.nim in the compiler at line 157 (below the elif) and run the koch temp |
01:38:47 | reactormonk | cornus_ammonis, then you can see that's it's a symbol like this: |
01:38:50 | cornus_ammonis | my line nums seem to be different, you mean elif p.kind == nkCurlyExpr: ? |
01:38:50 | reactormonk | { |
01:38:52 | reactormonk | "kind": "nkIntLit", |
01:38:54 | reactormonk | "intVal": 2, |
01:38:56 | reactormonk | "info": ["test.nim", 2, 8] |
01:38:58 | reactormonk | } |
01:39:00 | reactormonk | yeah |
01:39:30 | reactormonk | So you can go and an if n.kind == nkIntLit:\n debug(n) writeStackTrace to get some more info |
01:40:14 | reactormonk | And as you see, it's in proc hlo in the file hlo.nim where the recursion happens |
01:40:29 | reactormonk | apparently line 90 |
01:41:42 | reactormonk | if you take a look at proc hlo, you'll also see a comment about loop detector :-) |
01:42:43 | cornus_ammonis | so the limit is 300 iterations I guess |
01:45:56 | reactormonk | I don't know how exactly to solve the problem with non-repetitive expansions |
01:46:55 | cornus_ammonis | I'd be satisfied with the docs matching actual behavior :) |
01:47:38 | reactormonk | cornus_ammonis, that's in doc/trmacros.txt |
01:47:46 | reactormonk | but I'm pretty certain it's a bug for them not to work |
01:51:48 | * | shodan45 joined #nim |
01:58:51 | * | pregressive joined #nim |
02:11:44 | * | OnO quit (Ping timeout: 272 seconds) |
02:11:51 | * | OnO joined #nim |
02:12:15 | * | OnO is now known as Guest9271 |
02:45:03 | * | BitPuffin|osx quit (Ping timeout: 250 seconds) |
02:55:14 | * | fioco_ joined #nim |
03:20:07 | * | saml_ quit (Quit: Leaving) |
03:31:01 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
03:33:01 | * | fioco__ joined #nim |
03:35:12 | * | fioco_ quit (Ping timeout: 256 seconds) |
03:35:36 | * | fioco__ left #nim (#nim) |
03:45:05 | * | darkf joined #nim |
03:57:02 | * | vendethiel joined #nim |
04:18:55 | * | cornus_ammonis quit (Read error: Connection reset by peer) |
04:19:14 | * | cornus_ammonis joined #nim |
04:25:13 | * | pregressive quit (Remote host closed the connection) |
04:26:36 | * | jbomo quit () |
05:04:15 | * | shodan45 quit (Quit: Konversation terminated!) |
05:08:05 | * | vikaton quit (Quit: Connection closed for inactivity) |
05:10:32 | * | ddl_smurf quit (Quit: ddl_smurf) |
05:14:18 | * | Jesin quit (Quit: Leaving) |
05:25:30 | * | datanoise quit (Ping timeout: 246 seconds) |
05:42:17 | * | dalarmmst quit (Ping timeout: 256 seconds) |
05:42:17 | * | vendethiel quit (Ping timeout: 250 seconds) |
05:51:35 | * | kas joined #nim |
05:56:36 | * | woadwarrior joined #nim |
06:01:03 | * | woadwarr_ joined #nim |
06:02:39 | * | woadwarrior quit (Ping timeout: 250 seconds) |
06:08:21 | * | vendethiel joined #nim |
06:17:21 | * | kumul quit (Quit: Leaving) |
06:22:57 | * | datanoise joined #nim |
06:25:53 | * | tennix joined #nim |
06:37:01 | * | vendethiel quit (Ping timeout: 264 seconds) |
06:38:44 | * | bjz joined #nim |
06:39:07 | * | bjz quit (Client Quit) |
06:40:11 | * | vendethiel joined #nim |
06:40:56 | * | FreeArtMan joined #nim |
06:57:02 | * | bjz joined #nim |
07:10:43 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:11:20 | * | Trustable joined #nim |
07:19:59 | * | Guest93295 is now known as wuehlmaus |
07:25:57 | * | kas quit (Ping timeout: 276 seconds) |
07:27:45 | * | jaco60 joined #nim |
07:33:52 | * | Ven joined #nim |
07:36:43 | * | ingsoc joined #nim |
07:41:13 | * | datanoise quit (Ping timeout: 264 seconds) |
07:50:49 | * | davidhq joined #nim |
07:55:35 | * | Ven quit (Read error: Connection reset by peer) |
07:55:37 | * | Ven_ joined #nim |
08:02:28 | * | avsej joined #nim |
08:02:28 | * | avsej quit (Client Quit) |
08:03:13 | * | avsej joined #nim |
08:03:13 | * | avsej quit (Changing host) |
08:03:13 | * | avsej joined #nim |
08:06:14 | * | Kingsquee quit (Quit: Konversation terminated!) |
08:06:53 | * | coffeepot joined #nim |
08:10:49 | * | wan quit (Ping timeout: 265 seconds) |
08:13:17 | * | afiskon joined #nim |
08:15:55 | wb | Put up an issue about the `^` vs pow() thing: https://github.com/Araq/Nim/issues/2897 |
08:18:23 | * | bjz joined #nim |
08:20:16 | * | yglukhov________ joined #nim |
08:20:58 | * | Sembei joined #nim |
08:23:29 | * | wan joined #nim |
08:24:29 | * | ioctl joined #nim |
08:30:18 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
08:37:10 | * | Ven_ quit (Ping timeout: 255 seconds) |
08:38:56 | * | banister joined #nim |
08:43:37 | * | Sembei quit (Ping timeout: 256 seconds) |
08:59:53 | * | Sentreen joined #nim |
09:05:21 | * | Sembei joined #nim |
09:07:21 | scoeri | is there a way to look at my code after macro-expansion? |
09:09:34 | r-ku | scoeri: you can print tree that macro returns |
09:09:49 | r-ku | tree_repr(result) i believe |
09:15:12 | * | banister quit (Ping timeout: 256 seconds) |
09:19:10 | * | coffeepot joined #nim |
09:24:45 | scoeri | I'll try that, thanks |
09:25:40 | * | milosn quit (Quit: leaving) |
09:27:34 | * | avsej quit (Ping timeout: 255 seconds) |
09:28:38 | * | FreeArtMan quit (Ping timeout: 265 seconds) |
09:35:39 | * | woadwarr_ quit (Ping timeout: 245 seconds) |
09:41:10 | * | FreeArtMan joined #nim |
09:41:29 | * | avsej joined #nim |
09:41:29 | * | avsej quit (Changing host) |
09:41:29 | * | avsej joined #nim |
09:44:05 | * | Sentreen quit () |
09:46:27 | * | FreeArtMan left #nim ("=P") |
09:56:30 | scoeri | is there a page where I can get an overview of all the possible AST nodes and their constructors? |
09:59:24 | * | Sembei quit (Ping timeout: 256 seconds) |
10:01:23 | scoeri | I think I found it in the macro module documentation |
10:06:36 | * | zikolach joined #nim |
10:09:56 | * | woadwarrior joined #nim |
10:11:48 | * | woadwarr_ joined #nim |
10:11:56 | * | Ven joined #nim |
10:13:33 | * | Sembei joined #nim |
10:14:21 | * | woadwarrior quit (Ping timeout: 244 seconds) |
10:19:06 | * | Sentreen joined #nim |
10:22:20 | * | datanoise joined #nim |
10:24:14 | * | Arrrr joined #nim |
10:26:54 | * | datanoise quit (Ping timeout: 245 seconds) |
10:27:25 | * | zikolach quit (Ping timeout: 250 seconds) |
10:33:50 | * | JinShil joined #nim |
10:38:43 | * | Sembei quit (Ping timeout: 265 seconds) |
10:40:10 | * | zikolach joined #nim |
10:45:26 | * | cornusammonis joined #nim |
10:47:20 | * | datanoise joined #nim |
10:47:57 | * | datanoise quit (Client Quit) |
10:48:20 | * | Tennis joined #nim |
10:48:34 | * | cornus_ammonis quit (Ping timeout: 245 seconds) |
10:48:44 | * | Tennis quit (Changing host) |
10:48:44 | * | Tennis joined #nim |
10:49:24 | * | boopisaway is now known as boop |
10:51:30 | * | jm116__ quit (Ping timeout: 252 seconds) |
11:04:55 | * | tennix quit (Remote host closed the connection) |
11:05:53 | * | tennix joined #nim |
11:11:57 | * | dddddd joined #nim |
11:13:53 | * | Sentreen quit () |
11:20:15 | * | Sentreen joined #nim |
11:20:56 | * | miraclesu joined #nim |
11:25:28 | * | miraclesu quit (Ping timeout: 246 seconds) |
11:29:32 | * | zikolach quit (Read error: Connection reset by peer) |
11:29:51 | * | ddl_smurf joined #nim |
11:30:10 | * | zikolach joined #nim |
11:31:07 | * | tennix quit (Remote host closed the connection) |
11:35:38 | EastByte | hello there |
11:36:03 | EastByte | why is \n not allowed as character literal? |
11:38:25 | * | zikolach quit (Quit: Leaving) |
11:38:39 | * | zikolach joined #nim |
11:39:16 | Arrrr | EastByte, use \l |
11:39:42 | Arrrr | I dont recall the reason behind this |
11:40:56 | * | JinShil quit (Quit: Konversation terminated!) |
11:41:40 | EastByte | okay I will, thanks |
11:48:52 | * | zikolach quit (Ping timeout: 265 seconds) |
11:49:18 | * | so joined #nim |
11:50:26 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:54:42 | * | zikolach joined #nim |
11:54:52 | dom96_ | EastByte: it's two characters on some platforms |
11:55:02 | dom96_ | Arrrr: ^ |
12:01:46 | * | Ven joined #nim |
12:02:35 | * | Ven quit (Client Quit) |
12:20:33 | EastByte | well that makes sense |
12:23:16 | afiskon | Are threads in Nim usual OS threads or Go/Erlang-style lightweight threads with scheduler, user space context switches etc? |
12:25:43 | gokr | OS threads |
12:26:36 | gokr | But if you use say spawn with threadpool - they are quite fast (since you don't recreate them all the time). My socket server article demos that. |
12:27:20 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:28:01 | * | zikolach quit (Ping timeout: 256 seconds) |
12:28:48 | afiskon | gokr, Thanks. I believe you are talking about this article? http://goran.krampe.se/2014/10/25/nim-socketserver/ |
12:28:55 | gokr | yes |
12:29:26 | * | davidhq joined #nim |
12:32:19 | afiskon | And what about IO? Is it sync, async or it depends? |
12:32:26 | * | zikolach joined #nim |
12:32:42 | gokr | It depends, there is an asynch framework if you want. |
12:33:09 | gokr | dom96 wrote it, he knows more :) |
12:33:53 | * | davidhq quit (Ping timeout: 246 seconds) |
12:35:05 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
12:36:09 | * | Ven joined #nim |
12:36:30 | * | coffeepot joined #nim |
12:36:44 | * | zikolach quit (Ping timeout: 252 seconds) |
12:36:52 | afiskon | http://nim-lang.org/docs/asyncdispatch.html - I see there are Futures in Nim. Its quite a substitution for lightweight threads as I understand. |
12:37:30 | * | zikolach joined #nim |
12:42:36 | * | zikolach quit (Ping timeout: 252 seconds) |
12:43:19 | * | Ven quit (Ping timeout: 276 seconds) |
12:44:41 | pigmej | afiskon: yup it's async :) |
12:44:55 | dom96_ | afiskon: yep, we've got async via epoll (on linux) and iocp on windows |
12:45:09 | dom96_ | Async await ala C# too. |
12:45:20 | pigmej | and python 3.5+ |
12:45:23 | * | zikolach joined #nim |
12:46:09 | dom96_ | and all the other languages which copied C# :P |
12:46:51 | pigmej | ;] |
12:54:06 | taotetek | I like this poll loop abstraction - very nice |
12:54:24 | taotetek | enjoying nim quite a bit so far. |
12:57:43 | afiskon | same here. One thing I can't figure out so far - how to create trait/interface in Nim |
12:58:22 | * | zikolach quit (Ping timeout: 272 seconds) |
13:00:20 | dom96_ | afiskon: http://nim-lang.org/docs/manual.html#generics-concepts |
13:04:28 | afiskon | dom96_, it looks like concepts are a bit more powerful than traits/interfaces/type classes in haskell. right? |
13:05:00 | dom96_ | yeah, I think in some ways they are. |
13:10:08 | * | zikolach joined #nim |
13:16:36 | scoeri | can somebody explain why the above code compiles and the bottom code doesn't # http://pastie.org/10233158 |
13:16:43 | * | zikolach quit (Read error: Connection reset by peer) |
13:17:47 | scoeri | I'm struggling to create a macro that accepts a variable amount of expressions |
13:18:27 | scoeri | and accepts undefined identifiers as arguments |
13:18:37 | * | kumul joined #nim |
13:19:35 | * | TEttinger quit (Ping timeout: 256 seconds) |
13:21:51 | ozra | cornusammonis: reactormonk: saw the earlier discussion about template recursion, was thinking this might be somewhat related? : #2859 |
13:22:17 | ozra | I mean.. https://github.com/Araq/Nim/pull/2859 |
13:23:35 | * | zikolach joined #nim |
13:25:17 | afiskon | Is there any roadmap like "release 1.0 in may 2016" or something similar? |
13:25:27 | * | Ven joined #nim |
13:35:57 | * | davidhq joined #nim |
13:37:11 | * | Sembei joined #nim |
13:45:14 | * | avsej quit (Ping timeout: 245 seconds) |
13:50:04 | NfNitLoop | Was talking about {.noforward.} in here yesterday. Didn't seem to work for me. If I'm reading this correctly, the test for it is disabled: https://github.com/Araq/Nim/blob/devel/tests/misc/tnoforward.nim So... that would explain things. :p |
13:52:23 | * | pregressive joined #nim |
13:54:05 | * | xcombelle joined #nim |
13:57:28 | * | pregressive quit () |
13:57:49 | * | aziz joined #nim |
13:58:44 | * | pregressive joined #nim |
14:00:58 | aziz | Hi! Nim should be theoretically able to compile for the ARM architecture via C. Has this been tried and is it possible to write code as part of an Android app? |
14:02:38 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:04:02 | * | banister joined #nim |
14:05:19 | * | anthgur joined #nim |
14:05:31 | * | ggVGc joined #nim |
14:05:51 | ggVGc | what's the difference between var and ref arguments to a proc? |
14:09:33 | * | gokr quit (Quit: Leaving.) |
14:15:14 | * | Sentreen quit () |
14:15:45 | aziz | new to Nim, but I know about compiler construction. A ref parameter is basically a pointer to the argument passed to the proc, which means that assigning to it will change the contents of the variable outside. The argument will also have to have a location (stack or heap), so you can't pass null to the proc. |
14:18:10 | ggVGc | aziz: sure, but how is "var" different then? |
14:18:18 | ggVGc | to me they both seem to be "modifiable references" |
14:18:51 | aziz | only for objects, because they are passed as a pointer behind the scenes |
14:18:53 | ggVGc | it eve sais says in the doc that a var argument is just implemented as a pointer |
14:18:59 | ggVGc | ah, okay |
14:19:44 | * | milosn joined #nim |
14:19:54 | aziz | also assigning to a var inside the proc will not modify the variable of the caller |
14:22:35 | * | pregressive quit (Remote host closed the connection) |
14:22:38 | ggVGc | aziz: you sure? This prints '20' for me, https://gist.github.com/6cc19201d552e99ec713 |
14:22:52 | aziz | I have to say that Nim is so much cleaner than the D programming language, which also turned into a Frankenstein monster, yet not as horrifyingly bad as C++. |
14:23:27 | * | Ven joined #nim |
14:23:39 | aziz | ggVGc, wow, okay, so the docs are correct |
14:24:16 | ggVGc | well, that's because D tried to be a C++ "with better syntax", while Nim is trying map quite closely to C |
14:24:23 | ggVGc | which imo is a much better plan |
14:24:36 | ggVGc | aziz: seems to me that var/ref only matters for value types |
14:25:09 | ggVGc | a ref int and a var int is very different, but since objects are always passed by ref(it seems), ref/var is the same for object types |
14:25:16 | ggVGc | but I'm basically guessing now |
14:25:22 | ggVGc | because I can't find docds on ref params |
14:25:23 | aziz | D is actually way more than a C++ with better syntax. |
14:25:47 | aziz | let me try compiling some code |
14:26:18 | ggVGc | aziz: what I meant is that walter seems to have been quite into the type system and object model of C++, and attempted to improve it, while Nim stuck with the simplicity that is C |
14:26:34 | ggVGc | but I haven't been following D since about 7 years ago |
14:26:36 | aziz | just installed Nim a few minutes ago. thought I'd give it a chance because it's really appealing in many ways. |
14:26:53 | ggVGc | I used to hang out in ##D here on freenode, but that was like 10 years ago now |
14:27:08 | aziz | a long time |
14:27:19 | aziz | I haven't been following it for 1.5 years now |
14:27:50 | * | zikolach quit (Remote host closed the connection) |
14:27:54 | aziz | I started writing a compiler for it years ago and eventually got stuck with the semantic analysis |
14:28:07 | ggVGc | to me D seems to have wanted to be a better variant of the C++/Java/C# type of languages, and imo that whole family is rotten at the core |
14:28:14 | aziz | I got so very tired of it and just left it collecting dust |
14:28:23 | ggVGc | why did you start writing a D compiler? |
14:28:37 | aziz | for the learning experience |
14:28:46 | aziz | and it did teach me alot |
14:28:49 | ggVGc | why D out of all possible choices? |
14:29:09 | aziz | I can understand new languages very quickly because I know how compilers work |
14:29:11 | ggVGc | it seems like a very big project for writing your first compiler. Or maybe you've written compilers before that? |
14:29:23 | aziz | Nim wasn't really an option back then |
14:29:36 | aziz | no, my first attempt |
14:30:11 | aziz | I put my hopes and dreams on D |
14:30:16 | * | Ven quit (Read error: Connection reset by peer) |
14:30:37 | aziz | as time passed though I started to realize that it was getting uglier and uglier |
14:31:16 | * | pregressive joined #nim |
14:31:23 | aziz | *as time was passing |
14:31:33 | ggVGc | from the D homepage, this is why I said it seems like a strange choice for writing a first compiler, " D offers classic polymorphism, value semantics, functional style, generics, generative programming, contract programming, and more—all harmoniously integrated" |
14:31:57 | ggVGc | it's just a fucing huge project to implement all that semantics, and D doesn't have very easy to parse syntax either |
14:34:50 | aziz | doing the lexer was the easiest but the bigger challenge for me was writing the parser. never did it before so the path was very steep in the beginning. |
14:35:27 | aziz | eventually I got the hang of it, and I believe I did a far better job than the ref compiler did |
14:36:43 | aziz | for example, I could actually try a parse function and reject or accept the output if there was an error or not |
14:37:01 | aziz | and it backtracked automatically |
14:37:12 | * | ingsoc quit (Read error: Connection reset by peer) |
14:38:37 | aziz | Walter had all these duplicated funcs for the actual parsing funcs as a way to test whether it was a Declaration for example |
14:39:47 | * | Ven joined #nim |
14:40:34 | aziz | made the error msges even multilingual, because I could and cause I'm sure it would help out devs with other native languages especially when they are beginners |
14:44:01 | * | woadwarr_ quit (Quit: Textual IRC Client: www.textualapp.com) |
14:45:49 | * | Ven quit (Read error: Connection reset by peer) |
14:48:36 | * | Ven joined #nim |
14:52:07 | * | milosn_ joined #nim |
14:52:09 | pigmej | reactormonk: ping |
14:52:42 | * | milosn quit (Read error: Connection reset by peer) |
14:52:56 | aziz | ggVGc, always passing integral types like int doesn't seem very efficient to me. This certainly affects performance. |
14:53:21 | * | Ven quit (Read error: Connection reset by peer) |
14:53:55 | aziz | ggVGc, as a pointer I mean |
14:54:34 | * | vikaton joined #nim |
14:59:45 | * | shodan45 joined #nim |
15:04:00 | ozra | aziz: Well, D 10 years ago might have been simpler to implement ;) |
15:04:15 | aziz | not even then haha |
15:04:31 | ozra | aziz: ggVGc: If you don't use var in the param, it should be compile time error trying to modify it, *me thinks* |
15:04:44 | aziz | ozra, oh interesting |
15:05:03 | ozra | by default params a immutable constrained |
15:05:08 | ozra | *are* |
15:05:27 | aziz | but then I'm not sure any longer what the difference between var and ref is |
15:05:33 | ggVGc | right |
15:05:36 | ggVGc | which was my original question |
15:06:12 | ozra | aziz: var gives ok for modifying the argument in the proc. |
15:06:45 | aziz | and ref does, too, no? |
15:06:50 | ggVGc | but now i I have another one. How do I get export a nim type to C fully, i.e so the header contains all fields, rather than a forward declaration |
15:07:02 | ggVGc | -get |
15:07:04 | aziz | apparently not, I tested it |
15:07:06 | ozra | No, ref just passes the data by ref instead of by value |
15:07:20 | ozra | It's constrained to read only |
15:07:34 | * | Ven joined #nim |
15:07:42 | aziz | wow, I would have expected it to be the other way around |
15:07:45 | ozra | Keeps your code safer . It's like the reverse of C/C++ const ;-) |
15:08:01 | aziz | ozra, that's really great! |
15:08:12 | ozra | aziz: Arguably the keyword should be 'mut'.. |
15:08:19 | ozra | perhaps less confusion |
15:08:36 | * | Ven quit (Read error: Connection reset by peer) |
15:08:37 | ozra | aziz: Yeah, it's a nifty language :-) |
15:09:16 | aziz | that's the way D wanted to be but that train was already gone by then |
15:10:53 | ozra | ggVGc: Haven't tried that yet.. http://nim-lang.org/docs/theindex.html is a good start for searching things.. |
15:10:54 | aziz | are there plans for changing ref to mut? |
15:11:09 | * | gokr joined #nim |
15:11:13 | ozra | aziz: No, that's just something I thought of now... |
15:11:44 | ggVGc | aziz: that would break shitloads of code, so I assume no |
15:11:47 | ggVGc | for like no benefit |
15:12:17 | ozra | Just think of it like "may _var_y" or something ;) |
15:12:21 | aziz | old code could be converted by a tool that parses the sources and replaces the keywords |
15:12:36 | dddddddd | i cant remember who was working on some type safe sql, but imo this is the way to do it: http://fsprojects.github.io/SQLProvider/general.html |
15:12:51 | Arrrr | maybe coffeepot |
15:13:03 | dddddddd | 100% type safe , types generated at compile time from the database, with FK support etc |
15:13:23 | aziz | ozra, I've been musing on it, var is just a variable which may change, and ref is a reference to an immutable argument, because immutability is the default |
15:13:44 | ozra | aziz: There is a tool for upgrading code, nimfix. Pre 1.0 I think it would be good to change some things in one go (so everyone can do one fix up), as not to get C++ deseases for the rest of the future after 1.0... But it's up to the Wizards of Nim. |
15:15:13 | aziz | ozra, can be very useful in case a wrong or better decision was made |
15:15:34 | ozra | Yeah |
15:15:40 | aziz | but I'm okay with ref now, because I didn't know that parameters were immutable by default |
15:16:42 | ozra | Cool. |
15:16:56 | aziz | I love how Nim is similar to Python in syntax. it's so elegant and way more readable than C/C++/D crap |
15:17:33 | dddddddd | immutability by default is a good thing |
15:17:46 | ozra | aziz: Deffo! I've been coding C++ for 16 years, and from time to time tried to find an alternative. This is the first! I'm just a few weeks in playing with it :) |
15:18:05 | ozra | dddddddd: Deffo! :) |
15:18:46 | dddddddd | i wish nim had more of a functional focus :( |
15:19:24 | aziz | ozra, hope it's not gonna disappoint :) |
15:19:31 | Arrrr | whwat functional feature are you missing dddddddd |
15:19:56 | ozra | dddddddd: It's not hard to code functional. Use "future" mod for shorthand lambda notation. And, well.. code away :) |
15:19:58 | dddddddd | plenty, but pattern matching with better ADT syntax are the main one |
15:20:11 | ozra | dddddddd: Yeah pattern matching would be nice :) |
15:20:14 | dddddddd | + more immutability support |
15:20:29 | ozra | dddddddd: More? How? |
15:21:42 | dddddddd | you can do any sideeffect you please, so you are not really immutable |
15:21:47 | dddddddd | even if the 'ref' is immutable |
15:21:49 | ozra | aziz: As always you have your gripes, still it blows C++ away :) |
15:22:02 | aziz | absolutely |
15:22:05 | dddddddd | you can still do, seqx.add(x) |
15:22:13 | aziz | not that hard to do honestly hehe |
15:22:36 | ozra | dddddddd: Yeah, I'd like to see the func keyword make a proc which is pure functional (no mutation, globals etc. allowed in it) |
15:22:57 | * | kumul quit (Ping timeout: 250 seconds) |
15:23:02 | dddddddd | id like to be able to restrict it as much as haskell :) |
15:23:13 | Arrrr | that's too much |
15:23:22 | dddddddd | i mean, with qualifiers |
15:23:42 | ozra | dddddddd: https://github.com/Araq/Nim/issues/2716 |
15:24:26 | ozra | dddddddd: I haven't coded too much Haskell, been to a few seminars, since most of my coding requires imperative (with todays compilers) |
15:24:57 | dddddddd | you can do imperative with haskell |
15:25:03 | dddddddd | io + do notation |
15:25:42 | * | ChrisMAN joined #nim |
15:25:47 | ozra | I'm aware of that, I mean for performance, not out of "want".. and the C* compilers are the optimal still to this day (yes, surpassed Fortran also) |
15:26:43 | ozra | Which makes Nim a great option for me :) |
15:26:54 | vikaton | w0w |
15:27:05 | vikaton | I just got $100 in DigitalOcean 4free |
15:27:10 | aziz | isn't compiling to LLVM code a better option? |
15:27:46 | aziz | ozra, that means that you can write Android apps, or parts thereof, in Nim, doesn't it? |
15:28:29 | * | johnsoft quit (Ping timeout: 258 seconds) |
15:28:58 | * | kumul joined #nim |
15:29:04 | ozra | aziz: One of the things that attracted me to Nim is that it does _not_ go the LLVM route. It would be great to do that _too_. But I like this way since there are more target options, and gcc is currently faster than clang for my projects. But I can see clang/llvm surpassing gcc soon, so it won't be an issue for long. Still yet, I find C as perfect modern assembly (given that you utilize certain compiler specific pragmas and don't stick to |
15:29:08 | ozra | ...lang) |
15:29:11 | * | johnsoft joined #nim |
15:29:35 | ozra | aziz: Yeah, I think there was someone here on the IRC that does that - not sure.. |
15:29:47 | Arrrr | Yeah, pattern matching would be useful to have. I have the secret hope that someday ozra will pr it |
15:30:15 | aziz | ozra, yeah as long as gcc is faster than llvm it makes sense to compile to C |
15:30:21 | ozra | Arrrr: Haha, I think it's beyond my capabilities (given time constraints) |
15:30:48 | ozra | aziz: And then also for different obscure targets like your favourite kitchen toaster.. |
15:31:23 | aziz | or the microwave oven :) |
15:31:46 | ozra | aziz: Oh those are dangerous, dooom! Dooom I tell you! ;) |
15:33:35 | aziz | A guy who knows his stuff actually modified his microwave and managed to get it to oat with fruits in a perfect way |
15:33:47 | aziz | *get it to cook |
15:34:14 | ozra | "cook with gay people"? haha |
15:35:24 | aziz | sounds fabulous |
15:35:59 | ozra | Time to get some coding done. later folks |
15:36:27 | wuehlmaus | what i love about nim is that i can use --cc:tcc and this is sooo fast for trying out stuff :) |
15:37:47 | aziz | wuehlmaus, what does it do? |
15:37:56 | wuehlmaus | it uses the tcc compiler |
15:38:07 | wuehlmaus | and tcc is the fastest c compiler that i know |
15:38:20 | wuehlmaus | done by a genius :) |
15:38:29 | wuehlmaus | Bellard did ffmpeg and qemu, too :) |
15:38:59 | wuehlmaus | http://en.wikipedia.org/wiki/Fabrice_Bellard |
15:38:59 | aziz | wish C had modules then it would be even faster |
15:39:08 | aziz | I mean the compilation process |
15:43:10 | wuehlmaus | http://en.wikipedia.org/wiki/Tiny_C_Compiler |
15:46:11 | * | pregressive quit (Remote host closed the connection) |
15:46:43 | aziz | wuehlmaus, why is it not the default C compiler? |
15:48:28 | * | anthgur quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:48:31 | wuehlmaus | soe trade offs as mentioned in the wiki article |
15:48:46 | wuehlmaus | but it's very, very cool while trying out stuff :) |
15:48:59 | * | milosn_ is now known as milosn |
15:50:32 | ggVGc | yep tcc is great |
15:53:15 | aziz | should only make a difference when compiling huge projects, no? |
15:53:39 | ggVGc | aziz: or as wesaid, when testing out stuff |
15:54:16 | aziz | don't understand how tcc helps with that |
15:54:16 | coffeepot | can anyone help me here? If I have an array[arrsize, byte] and need to pass it to a C call as an untyped pointer (for a buffer), can I just use addr(myarray)? 'Cos this doesn't seem to work :/ |
15:54:48 | * | pregressive joined #nim |
15:56:25 | Arrrr | maybe myarray[0].addr ? |
15:57:18 | coffeepot | Arrrr good idea, unfortunately still confusing the C call :( |
15:57:45 | Arrrr | why |
15:58:38 | coffeepot | I'm trying to get SQL to accept string parameters but it's just returning garbage, though reading the string back in nim it's fine |
15:59:03 | coffeepot | i thought it was a unicode issue at first but now I'm starting to think it's something funky with the address of the array |
16:00:11 | * | afiskon quit (Quit: Leaving) |
16:00:45 | coffeepot | I had better luck with string -> cstring, I think I'll try that for a buffer instead... |
16:01:01 | * | aziz quit (Remote host closed the connection) |
16:03:55 | * | dalarmmst joined #nim |
16:03:59 | coffeepot | nope, still garbage, ahhh leave till tomorrow i think. Thanks Arrrr |
16:05:10 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:29:49 | * | yglukhov________ quit (Ping timeout: 264 seconds) |
16:30:06 | * | darkf quit (Quit: Leaving) |
16:30:25 | * | yglukhov________ joined #nim |
16:31:22 | * | yglukhov________ quit (Client Quit) |
16:34:31 | * | dddddddd quit (Ping timeout: 246 seconds) |
16:40:05 | * | Tennis quit (Quit: Leaving) |
16:50:31 | * | Jesin joined #nim |
16:51:33 | * | kas joined #nim |
16:51:40 | * | pregressive quit (Remote host closed the connection) |
16:51:56 | * | vbtt_ quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:53:27 | * | pregressive joined #nim |
16:57:39 | * | brson joined #nim |
16:59:36 | * | dddddd_ joined #nim |
16:59:53 | r-ku | how c2nim is supposed to be built? i get c2nim/c2nim.nim(11, 42) Error: cannot open 'compiler/llstream' |
16:59:59 | r-ku | this kind of stuff really should be in docs.. |
17:00:08 | * | shodan45 quit (Quit: Konversation terminated!) |
17:01:59 | reactormonk | pigmej, pong |
17:14:02 | * | Sembei quit (Ping timeout: 256 seconds) |
17:18:34 | reactormonk | ozra, I have to admit I've never seen a coder that and also write well |
17:19:09 | reactormonk | r-ku, yeah, compiler stuff still sucks via nimble, if you wanna poke someone about it, go for dom96_ |
17:19:51 | ozra | reactormonk: Eh? |
17:19:52 | r-ku | thing is im not using nimble, i checked c2nim repo out to Nim's repo dir, it made most sense |
17:19:57 | r-ku | still cant compile though |
17:21:11 | reactormonk | ozra, I like your arguments. |
17:21:23 | reactormonk | r-ku, really? muh. |
17:21:30 | wuehlmaus | how can i get ``nim doc`` to generate the html in a certain directory? |
17:21:34 | ozra | Haha, ah, ok. Thanks. |
17:21:54 | gokr | r-ku: That sounds familiar |
17:22:03 | reactormonk | r-ku, just yesterday nimble build in the c2nim directory worked |
17:22:18 | gokr | r-ku: Did you actually install nim? Or did you just add it to your PATH? |
17:22:37 | r-ku | gokr: as per Araq's instructions i put it on PATH and uninstalled from /usr/local |
17:22:42 | r-ku | still doesnt help |
17:22:44 | reactormonk | wuehlmaus, does help show you anything? Otherwise I'll dig the source real quick |
17:23:10 | gokr | That llstream stuff is from compiler - so... |
17:23:11 | reactormonk | r-ku, try nimble build in the c2nim repo |
17:23:33 | gokr | I think dom96 or someone turned that into a nimble package, and I guess c2nim nimble package has it as dep? |
17:24:00 | * | mgee joined #nim |
17:24:01 | * | mgee left #nim (#nim) |
17:24:04 | wuehlmaus | reactormonk: perhaps i was missing something |
17:24:17 | reactormonk | r-ku, I'll fix the c2nim readme |
17:24:30 | wuehlmaus | but it's a bit hard if you generate /usr/lib/nim files as non root :) |
17:24:54 | wuehlmaus | and i seem to miss a -o |
17:25:11 | reactormonk | wuehlmaus, you can probably adjust your package-building program to move them |
17:27:06 | r-ku | am i supposed to clone c2nim repo and run "nimble build" inside that dir? |
17:28:02 | r-ku | cause doing that nimble checks out compiler but trying to build it results in cparse.nim(146, 11) Error: undeclared field: 'next' |
17:28:28 | reactormonk | r-ku, added documentation |
17:28:40 | reactormonk | or not, fucking git https remotes |
17:29:15 | r-ku | hmm yeah noticed last commit is day old ;) |
17:30:05 | reactormonk | wuehlmaus, lemme check |
17:31:59 | r-ku | deleting old c2nim and cloning new one made nimble build work. thanks for help |
17:32:43 | reactormonk | wuehlmaus, apparently you can make it output to stdout |
17:32:45 | * | Matthias247 joined #nim |
17:32:57 | wuehlmaus | ah, that would be sufficient |
17:33:48 | reactormonk | wuehlmaus, there's also doc2, but I have no idea what the difference is |
17:34:01 | * | yglukhov________ joined #nim |
17:35:03 | wuehlmaus | i tried 'nim doc file.nim -' , that didn't work :) |
17:38:14 | * | pregressive quit (Remote host closed the connection) |
17:39:07 | wuehlmaus | ah, -dump |
17:39:35 | dddddd_ | is there a way to push : noSideEffect: off |
17:39:52 | dddddd_ | or not even push it, just mark it as off |
17:42:11 | reactormonk | dddddd_, you just add a sideeffect? |
17:45:09 | * | Guest68501 is now known as avsej |
17:45:38 | * | avsej is now known as Guest49008 |
17:46:19 | * | Guest49008 is now known as avsej_ |
17:46:21 | * | avsej_ quit (Changing host) |
17:46:21 | * | avsej_ joined #nim |
17:47:19 | wuehlmaus | reactormonk: i don't get it, tried all kinds of commands |
17:48:02 | dddddd_ | reactormonk: im pushing on all my modules nosideeffect |
17:48:09 | dddddd_ | and just want to disable it for specifics |
17:48:22 | dddddd_ | its a pain with push pop |
17:48:23 | reactormonk | dddddd_, I don't think that's how push works |
17:48:29 | dddddd_ | what? |
17:48:34 | dddddd_ | it definitly is |
17:49:19 | dddddd_ | .push nosideeffect works |
17:49:43 | dddddd_ | then id like to push nosideffect: off, but.. its not possible |
17:49:46 | dddddd_ | anyway bbl |
17:50:59 | reactormonk | wuehlmaus, try --stdout |
17:51:50 | wuehlmaus | ah, thanks for looking it up |
17:51:50 | reactormonk | dddddd_, not sure if the compiler is smart enough to deal with the inverse logic pushes |
17:52:00 | reactormonk | wuehlmaus, it's just a guess. |
17:53:46 | wuehlmaus | it just worked :) |
17:54:06 | wuehlmaus | so it really solves my problem |
17:54:15 | wuehlmaus | redirection |
17:54:37 | reactormonk | wuehlmaus, I guessed that from the fact that it checks for gStdout |
18:00:34 | ozra | dddddd_: As reactormonk said, it's not push prob, it's that nosideeffect is an atomic term, so to speak. No reversing. I can see from your use case how the reverse would be useful though. |
18:02:29 | dddddd_ | thats what im sayting |
18:02:40 | ozra | ozra: And a great role model for coding! |
18:04:54 | reactormonk | dddddd_, then create an issue |
18:05:04 | * | glurp joined #nim |
18:06:24 | * | glurp quit (Client Quit) |
18:06:28 | * | pregressive joined #nim |
18:35:56 | * | kas quit (Ping timeout: 258 seconds) |
18:46:38 | * | wuehlmaus quit (Quit: Lost terminal) |
18:48:31 | * | aziz joined #nim |
18:49:17 | * | NimBot joined #nim |
18:53:57 | * | xet7 quit (Quit: Leaving) |
18:56:49 | * | Arrrrr joined #nim |
18:58:11 | * | Arrrr quit (Ping timeout: 276 seconds) |
18:58:27 | * | wuehlmaus joined #nim |
18:59:13 | * | milosn quit (Ping timeout: 264 seconds) |
19:00:28 | * | milosn joined #nim |
19:05:42 | * | afiskon joined #nim |
19:07:12 | pigmej | reactormonk: hey |
19:07:37 | reactormonk | pigmej, sup, currently RL-grinding |
19:08:41 | pigmej | just finished my supper |
19:08:42 | pigmej | :) |
19:08:55 | pigmej | and I think I will code some nim-mode ;D |
19:09:05 | afiskon | I have some problems installing nimsuggest http://paste.ubuntu.com/11691787/ As I understand there is no nim version 0.11.3 so far. Any ideas how to solve this issue? |
19:09:17 | reactormonk | pigmej, your time to shine ^^ |
19:10:22 | afiskon | Or nim 0.11.3 == nim in devel branch? |
19:11:30 | pigmej | reactormonk: nah... I just like to have nice tools:P |
19:11:47 | reactormonk | pigmej, I mean in terms of helping afiskon >:) |
19:12:35 | pigmej | ah :D |
19:12:57 | pigmej | reactormonk: I think nimbot has to learn nimsuggest questions;P |
19:13:05 | pigmej | afiskon: so, clone nim repo |
19:13:30 | pigmej | afiskon: then goto compiler/nimsuggest |
19:13:47 | pigmej | then nim c -d:release nimsuggest.nim |
19:14:02 | pigmej | and then copy nimsuggest to THE SAME bin directory where nim resides |
19:16:34 | afiskon | pigmej, thanks a lot! |
19:16:36 | * | rgv151 joined #nim |
19:17:11 | pigmej | reactormonk: ah I have one problem with your nim-mode.el |
19:17:27 | pigmej | is there any way to hide message about dirty file ? |
19:17:35 | afiskon | now I have another problem - core dump in aporia when using goto definition :) I believe I stick with vim for a while :) |
19:18:00 | pigmej | because everytime epc does something, I have mess in echo area |
19:18:08 | pigmej | afiskon: ouch |
19:19:10 | reactormonk | pigmej, huh? The writing file part? |
19:19:15 | reactormonk | pigmej, ask in #emacs, I dunno. |
19:19:47 | * | aziz quit (Remote host closed the connection) |
19:19:51 | pigmej | I just found some dirty hacks with defadvice that temporary disables echo area ;D |
19:20:37 | reactormonk | pigmej, Normally, write-region displays the message ‘Wrote filename’ in the echo area. If visit is neither t nor nil nor a string, then this message is inhibited. This feature is useful for programs that use files for internal purposes, files that the user does not need to know about. |
19:20:46 | reactormonk | pigmej, read doc first, apply hacks later |
19:21:26 | pigmej | reactormonk: .... |
19:21:38 | pigmej | my elisp fu is weak ;d |
19:22:05 | reactormonk | that's not elisp, that's reading doc |
19:22:22 | pigmej | I searched for it already... |
19:22:28 | pigmej | ehs;/ |
19:22:34 | reactormonk | :-( |
19:22:41 | reactormonk | Yeah, apparently it's called "echo area" not message :-/ |
19:22:51 | reactormonk | (write-region (point-min) (point-max) filename nil 1) |
19:22:53 | reactormonk | ^ there we go |
19:22:58 | pigmej | so |
19:23:03 | pigmej | you already use it in taht way:D |
19:23:08 | pigmej | (write-region (point-min) (point-max) filename) nil 'foo) |
19:23:13 | pigmej | and it still messeas with echo area |
19:23:21 | reactormonk | nope, check parens |
19:23:49 | pigmej | ahs |
19:23:52 | reactormonk | oh fuck, I messed up the parens |
19:23:54 | reactormonk | my faul. |
19:24:06 | reactormonk | just move the parens at the end by two. |
19:24:10 | pigmej | yeah |
19:24:11 | pigmej | ;D |
19:24:11 | reactormonk | if you have paredit-mode (recommended) |
19:24:15 | pigmej | I do :) |
19:24:20 | pigmej | C-arr |
19:24:30 | pigmej | though I have no idea how to "delete" () |
19:24:41 | reactormonk | ctrl-right |
19:24:45 | reactormonk | ehh alt-right |
19:25:00 | reactormonk | alt+up: delete parens |
19:25:04 | reactormonk | alt+down: delete parens & content |
19:25:08 | reactormonk | ... or the other way round |
19:25:11 | pigmej | k |
19:25:17 | pigmej | I was unaware of "up/down" then :) |
19:26:04 | reactormonk | check C-h m |
19:26:09 | reactormonk | then C-s paredit |
19:28:38 | pigmej | k |
19:28:49 | * | afiskon quit (Quit: Leaving) |
19:34:59 | * | sepisoad joined #nim |
19:37:21 | * | gokr quit (Quit: Leaving.) |
19:39:24 | * | TEttinger joined #nim |
19:39:57 | ozra | Anyone know if there's a way to test expected failure of lexing, like `compiles()` does for expressions? |
19:41:31 | reactormonk | ozra, use case? |
19:41:44 | ozra | unittest of the lexer :) |
19:41:46 | reactormonk | ah, for tests. Yeah, there's a few of those IIRC |
19:41:52 | reactormonk | check tests/ |
19:42:04 | ozra | alright, digs.. |
19:42:41 | reactormonk | ozra, there's a few that check for compiler output |
19:43:03 | ozra | Yes, I'll opt for that - thanks |
19:47:17 | * | Arrrrr quit (Quit: WeeChat 1.2) |
19:49:24 | * | rgv151 quit (Quit: Leaving...) |
19:56:01 | * | kas joined #nim |
20:10:23 | Varriount | onionhammer: Found any NimLime bugs in ST3? |
20:13:45 | ozra | dom96_: around for a quick quiz? Blame check ;) |
20:14:09 | dom96_ | sure |
20:14:43 | ozra | dom96: in lib/pure/terminal.nim - this should really be unsigned, no? `0x8000'i16 # COMMON_LVB_UNDERSCORE` |
20:16:15 | dom96_ | why? |
20:17:48 | ozra | Stumbled upon it because of my fixes to the literal lexer (above hex would become -1 in i16, is that intended?) in that case it's the question if this edge case should be allowed for creating -1's. I was pondering it while coding, but thought "why not use '-0x1' in such cases?" |
20:18:18 | ozra | Also: 0b10000000'i8 - same thing.. |
20:19:00 | dom96_ | I don't think that matters. It's just a flag. |
20:19:22 | ozra | I'm guessing it should be u16 then? |
20:19:54 | * | gokr joined #nim |
20:20:13 | * | kas quit (Ping timeout: 264 seconds) |
20:21:19 | dom96_ | Unsigned numbers are discouraged in Nim, so I would say no. |
20:21:31 | vikaton | why are they discouraged |
20:21:59 | dom96_ | vikaton: Check the unofficial FAQ |
20:22:00 | ozra | dom96_: If I change it, it compiles and tests pass... |
20:22:14 | dom96_ | ozra: oh, is it broken? |
20:22:18 | ozra | This is an exception, since it's bit fiddling I guess. |
20:23:13 | ozra | Yes, after my fix to the lexer, it's broken, because the code in fact is 'wrong' (32768 does not fit in i16), but the lexer didn't catch that before... |
20:24:49 | ozra | In this particular case it works in practise because it only looks at the bits, the real number there is -1 instead of 32768 |
20:25:38 | ozra | I'll just change it to u16 and call it a day :) |
20:26:07 | dom96_ | might want to ask Araq |
20:26:12 | ozra | dom96_: Unless the beaviour i wanted?? (I can see reasons for that too) |
20:26:21 | ozra | dom96_: Yes, good idea! |
20:26:27 | dom96_ | If it breaks stdlib code then it also breaks code in the wild |
20:26:40 | dom96_ | So your patch needs to be reviewed by the BDFL :P |
20:27:41 | ozra | dom96_: Yes :) It only breaks -1 expressed as overflowing positive numbers. |
20:29:19 | * | sepisoad quit (Ping timeout: 250 seconds) |
20:29:59 | dom96_ | I don't think the hex representation of numbers should have the notion of a negative or a positive. |
20:31:47 | * | kumul quit (Ping timeout: 276 seconds) |
20:34:46 | pigmej | hmm |
20:35:02 | pigmej | reactormonk: SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
20:35:03 | pigmej | |
20:35:03 | pigmej | Process epc:server:6 exited abnormally with code 1 |
20:35:11 | reactormonk | pigmej, fuck. |
20:35:15 | reactormonk | compile with debug? |
20:37:20 | pigmej | hmm |
20:39:23 | pigmej | reactormonk: http://wklej.to/yS3wa/text nimsuggest --stdin /tmp/{this_file} |
20:39:24 | ozra | dom96_: Elaborate? |
20:39:30 | pigmej | crashes instantly |
20:39:37 | reactormonk | pigmej, fuck |
20:40:02 | ozra | dom96_: Meaning that their more of 'bit-setting' then number represantations? |
20:40:07 | dom96_ | yeah |
20:40:36 | pigmej | reactormonk: I will recompile Nim to be sure :D |
20:40:54 | ozra | Ok, then I change the behaviour so that it's allowed as long as the literal gives a unique bit pattern that fits in the data type. |
20:44:12 | pigmej | dom96_: what's currently the right way of using nimsuggest ? |
20:44:29 | pigmej | using 'old' way returns compiler/nimsuggest/nimsuggest.nim(12, 8) Error: This project has moved to the following repo: https://github.com/nim-lang/nimsuggest |
20:44:42 | dom96_ | ozra: Ask Araq please. I'm by no means an expert on these matters. |
20:44:57 | pigmej | and using repo throws exception as usually |
20:45:02 | dom96_ | yeah, the new way needs to be fixed. |
20:45:29 | pigmej | because I got SIGSEGV on nimsuggest |
20:45:31 | dom96_ | You can move ~/.nimble/pkgs/nimsuggest-ver/nimsuggest to $nimLoc/bin/ as a workaround |
20:45:34 | pigmej | and I wanted to chceck |
20:46:06 | dom96_ | Nimsuggest needs to search for the nim stdlib |
20:46:09 | pigmej | hmm |
20:46:17 | ozra | Araq: Are you around? Decision needed on the edge case whether 0x80'i8 == - 1, 0x8000 == -1, etc. should be ok. |
20:46:50 | ozra | * 0x8000i16 == -1 * |
20:47:00 | * | xcombelle quit (Remote host closed the connection) |
20:47:56 | pigmej | dom96_: no it's still broken |
20:48:29 | pigmej | I have nimsuggest in $nimLoc/bin/ |
20:48:32 | dom96_ | You sure you're calling the right one? |
20:48:37 | dom96_ | check 'which nimsuggest' |
20:48:42 | pigmej | ad it throws Error: unhandled exception: cannot open: lib/system/inclrtl.nim [IOError |
20:48:47 | pigmej | dom96_: I'm using full path |
20:48:55 | pigmej | so yes, correct one for sure |
20:49:16 | pigmej | I have to enter $nimLoc |
20:49:25 | pigmej | some paths are messed up |
20:49:46 | pigmej | when I will execute nimsuggest from $nimLoc then it works (still SIGSEGV but works) |
20:49:52 | pigmej | in any other location => crash |
20:50:34 | pigmej | and taht SIGSEGV of nimsuggest is: http://wklej.to/ILT8J/text |
20:50:53 | dom96_ | yeah, you have to do that too |
20:51:07 | pigmej | dom96_: prety useless then ? |
20:51:34 | pigmej | I mean, then I need hacks around PATH and make wrappers |
20:52:10 | dom96_ | Yes, it's a bug. |
20:52:14 | dom96_ | It needs to be fixed. |
20:52:25 | dom96_ | The old version needed that too |
20:52:36 | pigmej | dom96_: ok so that's the firt 'bug' what about that SIGSEGV ? |
20:52:45 | pigmej | dom96_: nope old version worked fine from any directory |
20:52:47 | Araq | ozra: yeah I think that's fine |
20:52:55 | dom96_ | pigmej: No idea |
20:53:03 | pigmej | Araq: http://wklej.to/ILT8J/text |
20:53:26 | ozra | Ok, cool. I'll push the change soon along with the tests. |
20:54:05 | Araq | pigmej: well? |
20:54:29 | pigmej | Araq: http://wklej.to/k5QcJ |
20:54:35 | pigmej | nimsuggest segfaults on this file |
20:54:44 | pigmej | (anoter demo file from internet) |
20:55:13 | pigmej | I'm too noobish to fix it. |
20:55:16 | dom96_ | pigmej: what are you sending to nimsuggest? |
20:55:23 | pigmej | dom96_: that's the thing |
20:55:24 | pigmej | nothing ;) |
20:55:29 | pigmej | it crashes just on start |
20:55:43 | dom96_ | Report it on github |
20:55:44 | pigmej | bin/nimsuggest --stdin /tmp/blah.nim |
20:55:52 | pigmej | and bum |
20:56:05 | Araq | there is a --debug switch or something |
20:56:23 | pigmej | Araq: it doesn't even enter nimsuggest |
20:56:30 | pigmej | it crashes before nimsuggest fully load |
20:56:46 | Araq | aye, well 'assert not carl.dead' is wrong |
20:57:01 | Araq | the compiler will likely crash on that too then |
20:57:12 | Araq | so it's not nimsuggest's fault :P |
20:57:17 | pigmej | segfault |
20:57:38 | pigmej | btw if it's another 'broken code' then http://nim-by-example.github.io/ is full of broken codes |
20:58:36 | pigmej | but yeah removing assert not carl.dead |
20:58:41 | dom96_ | pigmej: Ty tez jestes z polski? :O |
20:58:49 | pigmej | dom96_: .... |
20:59:04 | pigmej | czesc :) |
20:59:07 | dom96_ | hah |
20:59:11 | dom96_ | fajnie. |
20:59:25 | dom96_ | Anyway, you should tell flaviu about this. |
20:59:41 | pigmej | about nim-by-example ? |
20:59:43 | dom96_ | (Moze czas zrobic #nim-pl? :P) |
20:59:51 | dom96_ | yeah |
20:59:57 | dom96_ | There is a repo for it |
21:00:26 | pigmej | k I will try to remember about that then. |
21:00:41 | pigmej | dom96_: anyway, Error: unhandled exception: cannot open: blah.nim [IOError] |
21:00:51 | dom96_ | https://github.com/flaviut/nim-by-example |
21:01:11 | pigmej | oks, |
21:01:17 | pigmej | and back to the error, that file exists |
21:03:14 | pigmej | so I wonder what the heck |
21:03:45 | pigmej | dom96_: yeah there is a bug |
21:03:50 | * | bulbasaur joined #nim |
21:03:57 | pigmej | nimsuggest is now always looking for relative paths |
21:04:15 | reactormonk | pigmej, http://pastie.org/10234427 |
21:04:35 | pigmej | reactormonk: yeah same there |
21:04:48 | pigmej | Araq: said that assert not carl.dead makes it crash |
21:05:36 | dom96_ | pigmej: relative to what? $PWD? |
21:05:40 | pigmej | yeah |
21:05:49 | pigmej | bin/nimsuggest --stdin /tmp/blah.nim |
21:05:53 | pigmej | searches 'blah.nim' |
21:06:00 | dom96_ | interesting |
21:06:25 | pigmej | but |
21:06:32 | pigmej | nim/nimsuggest --stdin ../../../../tmp/blah.nim |
21:06:34 | pigmej | works fine |
21:07:30 | pigmej | hmm |
21:07:51 | pigmej | I created subdirectory in /tmp |
21:07:57 | pigmej | so now I have /tmp/nims/blah.nim |
21:08:03 | pigmej | and absolute path works also |
21:08:43 | Araq | yeah somebody should look into how the compiler handles paths. |
21:08:55 | Araq | we have a "Path handling" issue tag |
21:09:37 | pigmej | Araq: it was working "before" |
21:09:46 | pigmej | sadly I have no idea what git tag I had before |
21:10:27 | reactormonk | pigmej, git bisect ./koch temp nimsuggest.nim /tmp/blah.nim |
21:10:35 | reactormonk | oh, I forgot -r c there |
21:11:03 | pigmej | yeah but nimsuggest is now separate package |
21:11:03 | pigmej | ;d |
21:11:39 | pigmej | or could I safely copy just nimsuggest.nim package? |
21:11:41 | pigmej | file |
21:12:18 | reactormonk | pigmej, why? should still work. |
21:12:38 | reactormonk | oh, right, might be easier to copy it over for the paths |
21:13:01 | Araq | yeah I just wanted to check nimsuggest still compiles with the colors patch |
21:13:02 | reactormonk | just make sure you don't use the nimsuggest folder so it doesn't conflict with older checkouts |
21:13:05 | pigmej | it prints now some repo info or something |
21:13:13 | Araq | and it told me "it's now an external package" |
21:13:19 | Araq | and I was like "wtf?" |
21:13:43 | reactormonk | Araq, did it tell you with colored output at least? |
21:13:52 | pigmej | Araq: don't worry, for now package setup is even more complicated ;P |
21:14:12 | pigmej | reactormonk: lol |
21:14:48 | Araq | reactormonk: no cause they are still disabled per default |
21:15:25 | pigmej | oh, i destroyed my nimcache ;/ |
21:15:32 | Araq | TIL our website sucks cause it uses colors and our compiler sucks cause it doesn't use colors |
21:15:59 | * | Ven joined #nim |
21:16:53 | pigmej | reactormonk: the problem is that I can't use koch now ;d |
21:16:57 | reactormonk | pigmej, hm? |
21:17:07 | pigmej | ah nvm |
21:17:24 | reactormonk | koch temp rebuilds the compiler, you might not need that |
21:17:31 | pigmej | (nimsuggest requires now (bug) to be runned from $nimLoc) |
21:18:00 | Araq | ozra: btw you're wrong. ;-) top level menu bars are wrong in the age of 27" monitors |
21:18:16 | reactormonk | Araq, top level menu bars? mac-style? |
21:19:14 | Araq | and if I have 3 windows vertically aligned why should they share the topmost 20 pixels for the menu bar? I aligned them so they don't share pixels |
21:19:19 | ozra | Araq: Haha, fair enough, I'm sitting with a stone age 22" though :-0 |
21:20:48 | ozra | I have that "task bar" up there anyway, it shares the space with the menu, I like seeing the watch, haha |
21:20:55 | pigmej | reactormonk: nah automating this is kinda tricky now |
21:20:55 | pigmej | ;d |
21:21:08 | reactormonk | pigmej, then do it manually |
21:21:29 | pigmej | doing |
21:21:51 | Araq | ozra: yeah but the "task bar" is shared space. it doesn't change contents willy-nilly |
21:23:48 | ozra | When I shove the mouse pointer up there, the menu texts are revealed on it, to the left, and all notification panel stuff, menu etc. is to the right. I like it :) |
21:23:55 | pigmej | hm |
21:29:22 | flaviu | Fixed nim-by-example, thanks dom96_ for the ping. |
21:29:56 | pigmej | flaviu: cool |
21:30:07 | pigmej | I can now use it as my source for nimsuggest + emacs ;P |
21:32:36 | reactormonk | pigmej, neat |
21:33:16 | reactormonk | Araq, I'm gonna test the repo transfer with nim-mode |
21:35:34 | reactormonk | Araq, https://github.com/nim-lang/nim-mode/pulls looks good, PR still here |
21:37:12 | pigmej | (my irc crashed) |
21:37:18 | pigmej | reactormonk: what nimsuggest do you have ? |
21:37:38 | reactormonk | pigmej, the one from the nim-lang repo |
21:38:16 | reactormonk | pigmej, btw, tossed you an invite |
21:39:05 | pigmej | confirmed ;) |
21:39:08 | pigmej | cool :) |
21:39:39 | reactormonk | also included the nimsuggest repo |
21:40:00 | pigmej | you mean nim-mode ? |
21:40:04 | reactormonk | that too |
21:40:18 | pigmej | ok |
21:40:42 | pigmej | reactormonk: could you copy that 'blah.nim' to /tmp |
21:40:49 | pigmej | and try to run ith with --stdin ? |
21:40:51 | reactormonk | pigmej, did so |
21:41:01 | pigmej | --stdin /tmp/blah.nim |
21:41:03 | pigmej | and works for oyu ? |
21:41:17 | pigmej | I mean, it doesn't complain about 'blah.nim not found' ? |
21:41:46 | * | kumul joined #nim |
21:42:10 | reactormonk | Error: unhandled exception: cannot open: lib/system/inclrtl.nim [IOError] |
21:42:50 | pigmej | oh I got this one too, |
21:43:03 | pigmej | but I recompilled nim and it started working |
21:43:15 | pigmej | I got also lib/system/gc_ms.nim(61, 52) Error: key:value pair expected |
21:43:18 | pigmej | and some other funny things |
21:43:41 | pigmej | it seems that devel commits are changing a lot of things in compiler |
21:43:51 | reactormonk | Error: unhandled exception: not (son == nil) [AssertionError] |
21:44:05 | pigmej | yeah that is our original failure |
21:45:09 | pigmej | Araq: should we report that assert not blah segfault ? |
21:45:47 | Araq | yeah please |
21:46:14 | * | Mat4 joined #nim |
21:46:47 | pigmej | but hmm Araq compilre is not crashing on it |
21:47:13 | Araq | well then it's a nimsuggest bug |
21:48:14 | pigmej | yeah obvious but you said that assert not carl.dead would crash compiler too probably ;-) |
21:48:30 | pigmej | hm |
21:48:31 | pigmej | https://github.com/nim-lang/nimsuggest/issues/4 |
21:48:45 | pigmej | reactormonk: this looks like yours |
21:48:59 | * | BitPuffin|osx joined #nim |
21:49:26 | reactormonk | I don't get a "cannot open" |
21:53:33 | pigmej | dom96_: I really have no idea why nimsuggest tries to open blah.nim file instead of /tmp/blah.nim |
21:58:26 | dom96_ | pigmej: I only ever made nimsuggest work as a separate package. Haven't changed anything else. |
21:58:43 | dom96_ | The changes needed to get that working were minimal |
21:58:48 | pigmej | ok let's blame fedora then.. |
21:59:06 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:59:39 | pigmej | probably it dislikes something in my /tmp |
22:01:22 | reactormonk | dom96_, hm. What are the proper installation instructions for nimsuggest? |
22:02:20 | dom96_ | For now: install it via nimble and copy the binary to where your Nim compiler is |
22:02:45 | pigmej | reactormonk: AND you have to run it from $nimDir |
22:02:59 | pigmej | because otherwise it will complain about some stuff |
22:03:04 | reactormonk | pigmej, hm? oh fuck |
22:04:39 | * | pregressive quit (Remote host closed the connection) |
22:05:52 | pigmej | reactormonk: yeah ;/ |
22:06:35 | bulbasaur | Could someone help me with this? https://bpaste.net/show/96b91fb767cd |
22:07:10 | pigmej | reactormonk: bash exec + cd and it will work |
22:09:53 | dom96_ | bulbasaur: did you just paste your password? |
22:10:16 | bulbasaur | omfg |
22:10:19 | bulbasaur | shit |
22:11:16 | pigmej | bulbasaur: well at least it was not password1 |
22:11:17 | pigmej | ;P |
22:11:21 | pigmej | or dupadupa ;d |
22:13:47 | bulbasaur | :p |
22:15:16 | bulbasaur | any ideas dom96? |
22:17:21 | * | Mat4 left #nim (#nim) |
22:17:51 | dom96_ | need the {.no_conv.} pragma? |
22:18:42 | bulbasaur | Thanks that fixed it |
22:22:12 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:25:32 | * | Trustable quit (Ping timeout: 258 seconds) |
22:27:55 | * | Trustable joined #nim |
22:37:00 | * | Jehan` joined #nim |
22:38:03 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:39:05 | pigmej | cu ! |
22:40:47 | bulbasaur | ;-; I need a static analyzer for nim |
22:45:29 | * | yglukhov________ quit (Quit: Be back later ...) |
23:14:14 | * | Jehan` quit (Quit: Leaving) |
23:16:01 | bulbasaur | https://gist.github.com/DTSCode/7bbcf0c8cd40dd7c8d89 :D |
23:18:06 | * | vikaton quit (Quit: Connection closed for inactivity) |
23:19:35 | reactormonk | bulbasaur, we have one, it's called the compiler |
23:20:02 | bulbasaur | eh |
23:20:20 | bulbasaur | It missed an out of bounds |
23:20:44 | reactormonk | then improve it |
23:21:13 | bulbasaur | Or we could not have every tool rolled into one like an ide :p |
23:24:43 | * | Trustable quit (Remote host closed the connection) |
23:27:46 | reactormonk | bulbasaur, an IDE only works for that ide. tools work for all envs |
23:30:45 | bulbasaur | uh wat? an ide can work on all environments too. and not all tools work on all environments |
23:31:16 | reactormonk | let's say nimsuggest can be integrated with all editors, as can the compiler. Static code analyzers... oh well |
23:31:22 | * | Jesin quit (Ping timeout: 276 seconds) |
23:31:24 | reactormonk | And it's duplicated work :-) |
23:34:42 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:34:42 | bulbasaur | Whats you point? and its not really duplicated work... |
23:35:21 | ozra | Ehm, how does on PM in IRC (noob!) |
23:35:40 | bulbasaur | ozra: /query the_person |
23:35:43 | bulbasaur | usually |
23:35:51 | bulbasaur | although irc sees them all as the same thing |
23:36:17 | ozra | bulbasaur: Hmm, ok, how do you mean? |
23:37:11 | bulbasaur | Thats how you pm someone |
23:37:41 | * | bjz joined #nim |
23:38:49 | * | bjz quit (Client Quit) |
23:39:53 | ozra | Ok, got it, thanks bulbasaur :) |
23:45:19 | * | Jesin joined #nim |
23:46:20 | reactormonk | Araq, and get that repo over. as you see, PRs get transferred |
23:54:50 | reactormonk | is it possible to create two binaries? |
23:57:44 | * | Kingsquee joined #nim |