00:05:44 | * | pregressive joined #nim |
00:08:14 | * | MagusOTB quit (Ping timeout: 250 seconds) |
00:12:08 | * | bcinman joined #nim |
00:21:32 | * | user7181 quit (Quit: leaving) |
00:26:18 | * | MagusOTB joined #nim |
00:31:38 | * | pregressive quit (Remote host closed the connection) |
00:32:27 | * | vendethiel quit (Ping timeout: 252 seconds) |
00:34:16 | * | flaviu quit (Read error: Connection reset by peer) |
00:34:20 | * | cjbest joined #nim |
00:38:08 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:38:10 | * | flaviu joined #nim |
00:38:27 | * | bcinman joined #nim |
00:39:56 | * | vendethiel joined #nim |
00:48:11 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:50:18 | * | flaviu quit (Remote host closed the connection) |
00:53:05 | * | flaviu joined #nim |
01:04:51 | * | vendethiel quit (Ping timeout: 256 seconds) |
01:04:55 | * | cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
01:05:38 | * | Trustable quit (Quit: Leaving) |
01:07:01 | * | vendethiel joined #nim |
01:07:36 | MagusOTB | how do you split expressions across lines? |
01:08:07 | MagusOTB | I have echo("really_long_format_string" % [list_of_args]) and when I break the line after the % it doesn't compile |
01:09:44 | def- | MagusOTB: you need to indent the new line |
01:27:57 | * | vendethiel quit (Ping timeout: 245 seconds) |
01:31:29 | * | vendethiel joined #nim |
01:36:52 | * | bjz quit (Quit: Textual IRC Client: www.textualapp.com) |
01:38:15 | Joe-T | eugh when you save a file in vim and it freezes completely for 5 seconds when it checks syntax |
01:38:56 | def- | Joe-T: did you build the compiler with ./koch boot -d:release? |
01:39:05 | Joe-T | debug lol |
01:39:26 | Joe-T | I'm complaining more about vim not being multi threaded :p |
01:39:27 | def- | the compiler without -d:release is really slow |
01:39:54 | Joe-T | I'm trying to get my head around some stack trace |
01:42:32 | Joe-T | thought i'd fixed a bug, try to compile the test and then: |
01:42:40 | Joe-T | lib/system.nim(2274, 6) Error: unhandled exception: not (operand.flagMask == 0) |
01:42:55 | cazov | the vim thing can be really slow if you do a lot of complex const stuff too |
01:43:56 | Joe-T | is it possible to used the embedded debugger with the build in libraries? |
01:44:11 | Joe-T | I'm doing so much echo debugging |
01:45:09 | def- | For debugging you can use writeStackTrace and gdb when compiling with --linedir:on --debuginfo |
01:46:06 | Joe-T | ok thanks |
01:47:14 | * | bcinman joined #nim |
01:48:09 | Joe-T | what's the best editor to use for things like quickly jumping to definitions etc? |
01:48:29 | Joe-T | vim freezes for me when I try that |
01:48:48 | * | bjz joined #nim |
01:49:56 | def- | Joe-T: There's a new nimsuggest tool that makes this possible. Aporia should be the first that will have support for that. (Doesn't work for me yet) But today someone tried to add it to emacs as well. |
01:50:07 | MagusOTB | is there a reason GLshort = int64? |
01:50:40 | Joe-T | oh cool |
01:52:04 | Joe-T | does it also have find usages? |
01:56:11 | * | anthony joined #nim |
01:56:35 | * | anthony is now known as Guest10328 |
02:03:10 | def- | Joe-T: yes |
02:05:00 | Joe-T | were unsigned ints added at a later date or something, or is there a reason why where are so many nkCharLit..nkUInt64Lits in the code |
02:06:51 | fowl | Joe-T, because that is the range of nodes that store a literal int value |
02:07:14 | Joe-T | but what about UInt64 |
02:07:59 | def- | Yes, unsigned ints were added later to Nim |
02:10:29 | fowl | MagusOTB, i looked at the first commit when i moved opengl from the stdlib to its own repo, in the first commit GLshort = int16, it looks like someone changed it later, i dont have the git-fu to figure out who or when |
02:11:17 | def- | fowl: git blame or the "Blame" button on github |
02:13:26 | * | wink-s quit (Quit: Page closed) |
02:15:07 | fowl | so blame, find last commit for that line, go to parent commit, repeat ? |
02:15:37 | def- | I think so, looks a bit stupid, but I think I found the culprit: https://github.com/nim-lang/opengl/commit/2d65a0dcd3b2d317dddd5f8b17ecf2f8ca768df9 |
02:20:29 | * | pregressive joined #nim |
02:22:51 | Joe-T | wow d:release is fast |
02:24:09 | Joe-T | and I get a shorter stack trace and shows just the things done wrong in the file being compiled |
02:24:23 | Joe-T | and it was an assert statement that I swear I had the same error when I commented out.. wot m8 |
02:24:48 | renesac | d:debug for the compiler is only for debuging the compiler |
02:24:56 | Joe-T | ok now getting sigsegv, d:debug time |
02:24:57 | renesac | if it crashes, for example |
02:25:10 | * | pregressive quit (Ping timeout: 250 seconds) |
02:30:24 | * | TEttinger joined #nim |
02:31:11 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
02:37:16 | * | vendethiel quit (Ping timeout: 252 seconds) |
02:38:02 | * | vendethiel joined #nim |
02:48:19 | * | darkf joined #nim |
02:55:09 | Varriount | I don't suppose anyone here has some 'appropriate sources' that could be added to Nim's wikipedia page, to save it? |
02:56:52 | * | brson joined #nim |
02:57:21 | * | bcinman joined #nim |
03:01:01 | * | vendethiel quit (Ping timeout: 256 seconds) |
03:02:17 | * | vendethiel joined #nim |
03:10:51 | * | Guest10328 quit (Ping timeout: 250 seconds) |
03:16:03 | * | BitPuffin quit (Ping timeout: 250 seconds) |
03:17:30 | * | b0z983oj joined #nim |
03:17:52 | renesac | Varriount: you may try to send e-mails to some reputable sites that may be interested in making a third party review on Nim |
03:18:03 | b0z983oj | does anyone recommend any tool when working on Nim? Or just the default compiler/debugger? |
03:18:05 | * | MagusOTB quit (Ping timeout: 276 seconds) |
03:18:09 | renesac | Phoronix covers rust, for example |
03:18:23 | Varriount | renesac: Hm, good idea... |
03:18:34 | Varriount | b0z983oj: What do you mean? |
03:18:46 | Varriount | Renesac: Any ideas for other sites? |
03:18:55 | b0z983oj | I mean are there any ... newbie friendly tools when working with Nim code |
03:19:17 | renesac | Varriount: search for big ones that covered rust, D or go? |
03:20:30 | renesac | b0z983oj: syntax highlighting should help: https://github.com/Araq/Nim/wiki/Editor-Support |
03:20:39 | renesac | for starters |
03:20:44 | b0z983oj | renesac, I already have that |
03:20:57 | b0z983oj | I was looking for autocompletion for instance |
03:21:11 | renesac | see the editors that support "idetools" and such |
03:21:18 | renesac | there is some ongoing work about that |
03:21:27 | renesac | there is a visual studio plugin |
03:21:33 | b0z983oj | oh |
03:21:37 | renesac | vim also seems to have something |
03:21:38 | b0z983oj | I did not know about idetools |
03:21:43 | renesac | aporia probably too |
03:22:03 | renesac | I think it is called nimsuggest now |
03:22:30 | renesac | I'm using kate, and nobody has made a plugin supporting it yet |
03:22:43 | renesac | and the compiler support is still experimental also |
03:23:18 | renesac | well, you might also look into Nimble, for packages and dependency solving |
03:23:31 | * | Varriount|Mobile joined #nim |
03:25:03 | b0z983oj | I followed the instructions to build nim on github but the only binary in bin/ is "nim" |
03:25:10 | b0z983oj | how do I install tools like idetools? |
03:25:45 | renesac | I dunno, check with the plugin writters for your editor |
03:25:56 | renesac | or with araq if you plan to implement it in a new editor |
03:29:23 | b0z983oj | does anyone use Zeal for offline doc? |
03:29:31 | Varriount|Mobile | You need to download their respective repositories |
03:29:49 | Varriount|Mobile | Either via Babel, or manually |
03:30:02 | b0z983oj | oh, I thought it's a compiler tool |
03:30:12 | Varriount|Mobile | It used to be. |
03:30:29 | Varriount|Mobile | But I believe it's now separate |
03:31:01 | Varriount|Mobile | Or rather, in a separate repository. It still uses compiler code. |
03:31:29 | Varriount|Mobile | Try looking through github.com/nim/ |
03:32:12 | b0z983oj | any idea what the "norm" tool is? |
03:34:07 | b0z983oj | lol that's the wrong github link |
03:34:48 | * | adu joined #nim |
03:35:29 | b0z983oj | idetools is actually a command in the compiler now |
03:36:43 | b0z983oj | btw, does anyone use Zeal for offline documentation (for Nim ofc)? |
03:41:41 | renesac | never heard of it |
03:41:50 | renesac | you can use ctrl + f here: http://nim-build.nim-lang.org/theindex.html |
03:42:07 | renesac | not the same thing of course |
03:43:46 | Joe-T | lol wow my linter does not like repr.nim |
04:03:03 | * | brson quit (Quit: leaving) |
04:09:15 | * | pregressive joined #nim |
04:13:42 | * | pregressive quit (Ping timeout: 252 seconds) |
04:26:49 | * | pregressive joined #nim |
04:30:16 | * | endragor joined #nim |
04:36:46 | * | gsingh93 joined #nim |
04:36:59 | reactormonk | b0z983oj, it's nimsuggest now |
04:37:29 | b0z983oj | reactormonk, isn't it "nim idetools <command>" ? |
04:39:57 | reactormonk | b0z983oj, from what I gathered it's been replaced... but I might be misinformed |
04:40:51 | * | endragor quit (Remote host closed the connection) |
04:41:10 | b0z983oj | oh I see |
04:42:13 | Varriount | It has been replaced. |
04:42:42 | Varriount | onionhammer: Have you seen the new sublime text 3 language syntax files? |
04:45:10 | * | Senketsu joined #nim |
04:46:04 | b0z983oj | I just built nim(master branch) which is 0.10.2 but nimsuggest asks for 0.10.3, should I check out devel? |
04:46:24 | * | endragor joined #nim |
04:47:16 | Varriount | b0z983oj: Yes. |
04:47:54 | Varriount | b0z983oj: You'll probably need to recompile a csources version of nim (use the devel branch of csources) |
04:48:10 | b0z983oj | I must have messed up somehow, after checking out "devel" I ran "bin/nim c koch && ./koch boot -d:release" |
04:48:16 | b0z983oj | but the second command fails |
04:48:24 | b0z983oj | lib/pure/collections/tables.nim(98, 39) Error: type expected |
04:48:29 | Varriount | See my last comment. |
04:48:37 | b0z983oj | oh |
04:48:43 | b0z983oj | didnt notice that |
04:54:14 | * | msmith491 joined #nim |
05:10:42 | * | pregressive quit (Remote host closed the connection) |
05:15:33 | * | endragor quit (Remote host closed the connection) |
05:16:27 | * | vendethiel quit (Ping timeout: 256 seconds) |
05:24:33 | * | endragor joined #nim |
05:25:26 | * | endragor quit (Remote host closed the connection) |
05:37:49 | * | vendethiel joined #nim |
05:45:31 | b0z983oj | ~/.nimble/pkgs/compiler-0.10.3/compiler/nimfix/prettybase.nim(10, 7) Error: cannot open 'ast' |
05:45:49 | b0z983oj | can anyone help me understand what this error is |
05:48:44 | * | TylerE_ joined #nim |
05:51:25 | * | Araq_ joined #nim |
05:51:42 | adu | hi all |
05:51:46 | * | b0z983oj quit (Ping timeout: 264 seconds) |
05:52:21 | * | endragor joined #nim |
05:53:53 | * | egrep quit (*.net *.split) |
05:53:55 | * | ldlework quit (*.net *.split) |
05:53:55 | * | fold quit (*.net *.split) |
05:53:55 | * | Araq quit (*.net *.split) |
05:53:55 | * | TylerE quit (*.net *.split) |
05:55:20 | * | ldlework joined #nim |
05:58:51 | * | endragor quit (Remote host closed the connection) |
05:59:02 | * | vendethiel quit (Ping timeout: 246 seconds) |
06:02:34 | * | fold joined #nim |
06:04:37 | * | wb quit (Ping timeout: 255 seconds) |
06:06:37 | * | b0z983oj joined #nim |
06:06:52 | * | clynamen joined #nim |
06:08:37 | * | b0z983oj quit (Client Quit) |
06:12:58 | * | Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
06:13:43 | * | adu quit (Ping timeout: 245 seconds) |
06:25:20 | * | repax quit (Ping timeout: 252 seconds) |
07:00:25 | * | endragor joined #nim |
07:22:02 | * | BlaXpirit joined #nim |
07:36:31 | endragor | > tkInfixOpr, tkPrefixOpr, tkPostfixOpr < are these tokens used at all? Can't find usages |
07:54:11 | * | akiradeveloper joined #nim |
07:56:13 | * | gsingh93 quit (Ping timeout: 264 seconds) |
07:57:56 | BlaXpirit | endragor, looking at this i can only guess |
07:58:11 | BlaXpirit | they are used after the first stage of parsing |
07:58:25 | BlaXpirit | then they are changed to proc calls like `*`(stuff) |
07:59:11 | BlaXpirit | also pretty sure postfix `*` (public) stays until the end |
08:01:05 | endragor | lexer is the first stage, right? in lexer.nim it looks like endOperator() can only return one of tkColon, tkColonColon, tkEquals, tkDot, tkDotDot, tkOpr |
08:01:53 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
08:03:04 | endragor | well, maybe tkOpr somewhere later gets converter into one of tkInfixOpr, tkPrefixOpr, tkPostfixOpr using enum arithmetic, so it makes hard to find usages by string search |
08:10:45 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
08:11:31 | * | msmith491 quit (Ping timeout: 246 seconds) |
08:11:38 | * | pregressive joined #nim |
08:13:22 | * | akiradeveloper quit () |
08:14:14 | * | xcombelle joined #nim |
08:15:48 | * | pregressive quit (Ping timeout: 245 seconds) |
08:27:02 | * | vendethiel joined #nim |
08:39:20 | * | HakanD joined #nim |
08:42:39 | * | b0z983oj joined #nim |
08:47:22 | * | xcombelle quit (Remote host closed the connection) |
08:49:24 | BlaXpirit | endragor, oh yeah, these enum ranges are a horrible practice seen everywhere in compiler |
08:52:03 | b0z983oj | hi, what is a "converter" in nim lang? |
08:52:16 | b0z983oj | there's one in asyncio |
08:54:09 | BlaXpirit | rtfm? |
08:54:46 | BlaXpirit | very easy to find http://nim-lang.org/manual.html#converters |
08:57:50 | b0z983oj | any reason why osInvalidSocket = INVALID_SOCKET is a "let" and not a "const" |
08:57:53 | b0z983oj | in rawsockets |
09:00:30 | BlaXpirit | b0z983oj, winlean.INVALID_SOCKET is a macro in C, so it can't be imported as nim const, so it's actually a var |
09:00:43 | b0z983oj | ok |
09:04:58 | * | milosn quit (Ping timeout: 245 seconds) |
09:26:02 | b0z983oj | aside from the technical details behind the initialization of a "const" and "let", they should be the same usage wise right? |
09:27:07 | BlaXpirit | b0z983oj, can't use let at compiletime :s |
09:27:14 | b0z983oj | I realized that |
09:27:28 | BlaXpirit | i mean, can't use its value at compile time |
09:27:31 | BlaXpirit | but otherwise yes |
09:27:33 | b0z983oj | just that, in the entire standard library, there's only one "let" |
09:27:47 | BlaXpirit | can't be true |
09:27:54 | b0z983oj | well I checked |
09:28:01 | BlaXpirit | nope nope nope |
09:30:58 | b0z983oj | by only one I mean only one found in the doc like this one http://nim-lang.org/rawsockets.html |
09:31:27 | b0z983oj | I downloaded it recursively for offline use and that's the only section that uses "lets" |
09:32:21 | BlaXpirit | wow, it might actually be true |
09:36:44 | * | filcuc joined #nim |
09:43:49 | * | filcuc quit (Quit: Konversation terminated!) |
09:45:04 | * | filcuc joined #nim |
09:45:17 | * | repax joined #nim |
09:54:25 | * | ffffffffBG joined #nim |
09:54:55 | * | ffffffffBG quit (Client Quit) |
10:01:38 | EXetoC | BlaXpirit: because it's not always obvious what the range covers? |
10:01:54 | BlaXpirit | huh |
10:02:53 | federico3 | mornin' |
10:06:29 | * | b0z983oj quit (Ping timeout: 245 seconds) |
10:08:56 | EXetoC | BlaXpirit: enum ranges |
10:10:32 | EXetoC | "only one let in the compiler"?? |
10:12:19 | * | filwit joined #nim |
10:12:23 | EXetoC | oh, standard library. still not true |
10:13:33 | * | flaviu quit (Remote host closed the connection) |
10:14:01 | * | flaviu joined #nim |
10:14:50 | * | Mimbus joined #nim |
10:15:08 | * | milosn joined #nim |
10:18:16 | * | Arrrrrrrr joined #nim |
10:27:18 | * | milosn quit (Read error: Connection reset by peer) |
10:27:34 | filwit | any way to convert a NimNode -> type inside a macro? |
10:27:39 | * | milosn joined #nim |
10:27:59 | filwit | macro foo(T): stmt = |
10:28:06 | filwit | let t = T() # I want this |
10:30:02 | filwit | actually, scratch that question.. what I'm really looking for is a way to iterator over a types field names/types inside a macro |
10:30:37 | dom96 | hrm, haven't dabbled with the type api yet |
10:30:41 | dom96 | so I can't help much |
10:30:44 | filwit | i can achieve this using 'fieldPairs' inside a template, storing them into a static seq, then iterating over them inside the macro |
10:31:21 | filwit | but I remember Araq saying typetraits had seen some improvements recently, so I'm wondering if there's anything more straight forward |
10:32:38 | filwit | dom96: type api? I'm not sure exactly what you're referring too. |
10:33:12 | dom96 | Araq added a type API recently |
10:33:37 | filwit | right, that's what I'm thinking of |
10:33:44 | filwit | i'm guessing there's no docs yet? |
10:34:02 | dom96 | dunno. Look through the macros module and see if you can find something |
10:34:06 | filwit | but do you know what files in the compiler was changed for this? something new or just typetraits? |
10:34:16 | filwit | dom96: been doing that :P |
10:34:48 | filwit | anyways, i'll keep hunting |
10:35:52 | dom96 | I think it's 'typ[]' in macros |
10:36:05 | dom96 | proc typ[](n: PNimrodNode): typedesc {.magic: "NGetType", noSideEffect.} |
10:36:32 | filwit | ah.. thanks, i'll try that out |
10:37:17 | * | filcuc quit (Quit: Konversation terminated!) |
10:40:36 | * | davidhq joined #nim |
10:45:15 | HakanD | wikipedia article is relisted, again |
10:47:58 | Arrrrrrrr | Nice http://www.wikiwand.com/en/Nim_(programming_language) |
10:51:21 | * | BitPuffin joined #nim |
10:51:25 | * | Trustable joined #nim |
11:01:49 | * | HakanD quit (Quit: Be back later ...) |
11:02:14 | * | irrequietus joined #nim |
11:03:27 | flaviu | filwit: fowl did something with that, perhaps I can find the Gist again. |
11:05:05 | flaviu | filwit: https://gist.github.com/fowlmouth/9b9010397ad5fe4b9872 |
11:05:07 | filwit | was gone for a sec |
11:05:15 | filwit | flaviu: thanks. |
11:05:44 | * | flaviu left #nim (#nim) |
11:05:48 | * | flaviu joined #nim |
11:05:50 | filwit | dom96: btw, 'typ' from macros doesn't seem to be working |
11:06:04 | dom96 | pity |
11:06:30 | filwit | dom96: well I mean, it's not even being found.. i wonder if it was removed in devel and the docs don't reflect that yet |
11:07:01 | * | untitaker quit (Ping timeout: 255 seconds) |
11:07:12 | dom96 | ahh, we really need devel docs: https://github.com/Araq/Nim/blob/devel/lib/core/macros.nim#L169 |
11:07:21 | dom96 | try that |
11:07:36 | filwit | ah, okay |
11:09:15 | * | Arrrrrrrr quit (Quit: Page closed) |
11:09:55 | * | user7181 joined #nim |
11:11:02 | filwit | kinda odd though.. i can't do `macro foo(T): stmt = echo getType(T)` .. i get "Error: node has no type" |
11:11:34 | filwit | i'll take a look at what fowl did |
11:14:03 | * | untitaker joined #nim |
11:17:55 | * | MouldySammich joined #nim |
11:28:40 | * | milosn quit (Ping timeout: 272 seconds) |
11:31:11 | * | banister joined #nim |
11:44:26 | * | MouldySammich quit (Quit: Page closed) |
11:48:14 | * | milosn joined #nim |
11:56:07 | * | milosn quit (Read error: Connection reset by peer) |
11:56:35 | * | milosn joined #nim |
11:57:57 | * | davidhq quit (Quit: Textual IRC Client: www.textualapp.com) |
12:07:12 | * | milosn quit (Read error: Connection reset by peer) |
12:07:57 | * | milosn joined #nim |
12:08:35 | * | tmku joined #nim |
12:10:32 | * | BlaXpirit quit (Read error: Connection reset by peer) |
12:11:30 | * | BlaXpirit joined #nim |
12:14:50 | * | wb joined #nim |
12:15:50 | BlaXpirit | seq is implemented as pointer to {length, reserved, pointer to data} |
12:16:08 | BlaXpirit | why the need for the outer pointer? |
12:19:30 | filwit | i've always wondered that too.. was it proven "faster" (in a broad sense) to make seq's a reference type or was this choice made for other reasons? |
12:19:36 | * | Kingsquee quit (Quit: Konversation terminated!) |
12:21:48 | filwit | it's even more odd given that an object with only an int and pointer in it with pass by copy, while anything larger will implicitly pass by ref in Nim.. I always assumed that was due to a better understanding of cache systems than I was aware of.. but then why don't seq's follow this pattern? |
12:23:41 | filwit | ref seq's also seem 'gotcha prone' since the length is invalid before explicit allocation |
12:23:53 | def- | BlaXpirit: probably so you can make them shallow |
12:24:27 | BlaXpirit | filwit, it wouldn't hurt to get 0 length seq by default |
12:25:23 | BlaXpirit | def-, it's difficult to think about, but maybe you're right |
12:29:24 | * | milosn quit (Ping timeout: 245 seconds) |
12:29:27 | filwit | BlaXpirit: well I don't think seq's should auto-allocate (because that will cause a lot of pointless allocations), and even with ref seq's you can make 'len' perform nil checks and be useful before allocation.. I just don't understand why you would do ref seqs for performance reasons.. it seems like in many ways (length on stack, pass by copy, no need for nil checks on 'len') non-ref seqs would be better. |
12:29:37 | filwit | perhaps it's something to do with threading |
12:30:00 | filwit | i know Nim handles ref objects differently inside spawned procs |
12:30:39 | BlaXpirit | there is no need to allocate |
12:30:54 | BlaXpirit | make what is currently a nil seq synonymous to 0-length seq |
12:31:16 | BlaXpirit | i mean, make reserved==0 be synonymous to data==nil |
12:31:30 | filwit | right |
12:32:29 | BlaXpirit | although that adds some data!=nil checks on many operations |
12:33:06 | filwit | those ops should probably use len > 0 |
12:33:24 | BlaXpirit | what about add |
12:33:38 | filwit | does allocation if needed |
12:33:40 | BlaXpirit | well it checks capacity anyway |
12:33:48 | filwit | that's what already happens cause it needs to expand |
12:34:04 | filwit | so it would work out well |
12:34:11 | BlaXpirit | well now i don't see any real reasons |
12:34:17 | filwit | me either |
12:34:24 | filwit | awaiting Araq's explanation |
12:34:33 | BlaXpirit | we have def-'s explanation for now :| |
12:35:12 | filwit | i don't really understand how 'shallow' applies though |
12:35:13 | BlaXpirit | the real problem now would be that things rely on this nillability |
12:35:50 | filwit | well theoretically 'inNil' and even 's == nil' could be overwridden to not break code |
12:35:54 | BlaXpirit | but it's much more harm than good to allow seqs and strings to be nil |
12:36:03 | BlaXpirit | yes, that is true |
12:36:23 | BlaXpirit | but nil synonymous to zero length, remember? |
12:36:59 | filwit | sure, but what are you implying by that? |
12:37:05 | BlaXpirit | well they're different |
12:37:22 | BlaXpirit | code will start swearing at empty strings and whatnot |
12:37:23 | filwit | technically 'nil' doesn't apply to a stack seq at all |
12:38:00 | filwit | it would just exist temporarily as a transitional thing for old code, type of deal |
12:38:36 | filwit | i don't see any downsides.. but I am just guessing at the reasons here, so I'm just speculating |
12:38:36 | * | milosn joined #nim |
12:38:42 | * | b0z983oj joined #nim |
12:38:47 | BlaXpirit | nil can't be synonymous to zero length tho |
12:39:29 | b0z983oj | if anyone uses Zeal offline doc, I made a package for nim: http://nim.trungaczne.info/nim.xml |
12:39:38 | b0z983oj | not sure if it works for OSX Dash since I don't use OSX |
12:40:34 | filwit | BlaXpirit: if you made seq and object, nil wouldn't apply at all... I'm not sure what problem you're trying to demonstrate.. the only reason you could have a isNil/== proc for object seqs at all would be for backward compat |
12:40:44 | * | b0z983oj is now known as trungaczne |
12:40:45 | filwit | made seq an** object... |
12:40:53 | BlaXpirit | filwit, i'm saying it is impossible to make a backward compat isNil |
12:41:44 | filwit | hmm.. yeah that might cause problems in some places, true |
12:43:10 | * | trungaczne quit (Quit: Leaving) |
12:43:59 | filwit | depreciated errors/warnings would probably be best if was to actually change. I'm really curious as to Araq's reason for this now.. |
12:44:39 | BlaXpirit | nil strings are omnipresent. |
12:46:08 | * | milosn quit (Remote host closed the connection) |
12:47:27 | * | milosn joined #nim |
12:48:05 | filwit | that doesn't seem to hard to fix though.. first you make a isNil/== op which dumps LINE to the console and mimics len>0 behavior as a way to track down and remove everything from the compiler/libs.. then make a major breaking change announcement in the next release (and maybe leave the ops in temporarily for others to do the same, but marked as depreciated) |
12:49:04 | filwit | it'd be grunt work, but hell i'd gladly spend a few hours doing that for a good cause |
12:49:38 | filwit | although I doubt Araq would trust anyone but himself to do it |
12:50:29 | BlaXpirit | you don't understand, it is omnipresent in libraries too |
12:51:07 | filwit | you mean third-party libs? I know it's used everywhere.. thus the major breaking change message |
12:51:39 | filwit | stand libs would be just as easy to fix as the compiler would be |
12:51:46 | BlaXpirit | ok but let's keep thinking here. |
12:52:35 | BlaXpirit | @[] is allocated |
12:52:54 | BlaXpirit | one can even keep the nil behavior by just checking data!=nil |
12:54:57 | filwit | yeah I didn't think about that, you're right.. I don't know what you're saying about @[].. that would basically function the same as now, just without heap allocating the seq structure |
12:55:35 | BlaXpirit | honestly, the nillability of seq bothers me even more than implementation detail |
12:56:26 | filwit | yeah, i agree, but I need to get back to doing stuff now, and I want to hear Araq's reasoning before speculating too much (although I'm guessing you're on point about breaking changes being his biggest concern) |
12:56:44 | BlaXpirit | bye |
13:02:00 | BlaXpirit | i've thought something up |
13:02:34 | BlaXpirit | seq's default state would be (length: 0, capacity: -1, data: null) |
13:02:54 | BlaXpirit | @[] would be (0, 0, null) |
13:03:12 | BlaXpirit | isNil would be capacity==-1 |
13:04:55 | BlaXpirit | nah, much simpler to make default state (0, 0, null) and @[] (0, 0, []) and isNil data==null |
13:05:13 | BlaXpirit | there would be some extraneous ifs but they can be removed when isNil is phased out |
13:07:47 | filwit | i forgot seq's had a capacity |
13:08:04 | * | irrequietus quit () |
13:11:54 | * | b0z983oj joined #nim |
13:12:04 | b0z983oj | the tutorial on the main site is out of date isn't it |
13:14:21 | filwit | b0z983oj: you'll have to be more specific, but I'm yes some of the documentation is out of sync with the devel branch of course, and surely there are places it's even out of sync with master as well. |
13:15:09 | b0z983oj | say where do I get documentation for anything |
13:15:15 | b0z983oj | slices don't seem to be documented in manual.html |
13:15:44 | filwit | slices are documented in the system libs docs |
13:16:06 | filwit | docs -> Standard Libs -> system |
13:16:07 | b0z983oj | I am on devel branch and slices now use ^ for negative indexing while the tutorial says it's - (minus). Also the tutorial uses the $ which is apparently deprecated |
13:16:11 | b0z983oj | I will look into it |
13:17:06 | filwit | yeah, unfortunately devel docs where dropped awhile ago (due to time constraints, IIRC) |
13:17:36 | filwit | the IRC is the best place to get up-to-date information about devel stuff |
13:17:46 | b0z983oj | okay then |
13:31:33 | * | milosn quit (Ping timeout: 248 seconds) |
13:37:24 | flaviu | I found the problem with findAll performance! |
13:37:25 | flaviu | https://gist.githubusercontent.com/flaviut/d3a0747dfac02eaa239a/raw/81587cae6a5a5f2b51c56b9d75a84847d506cf4d/- |
13:38:06 | flaviu | If zero-length matches are impossible, then the last ~20k are totally unnecessary! |
13:38:08 | BlaXpirit | wut |
13:38:21 | BlaXpirit | oh i get it |
13:38:28 | flaviu | And it just so happens that PCRE provides PCRE_INFO_MATCH_EMPTY! |
13:38:47 | BlaXpirit | so zero-length matches make everything horrible? |
13:39:24 | flaviu | yep, but we can choose a sane implementation for patterns that always match something, which leads to a much faster implementation. |
13:40:41 | BlaXpirit | why is find called so many times? |
13:40:55 | flaviu | It's called for every character in the input file. |
13:40:56 | BlaXpirit | or does pcre only provide a "match" function? |
13:41:03 | BlaXpirit | doesn't pcre provide a "find"? |
13:41:10 | flaviu | match is find. |
13:41:18 | BlaXpirit | no it isn't |
13:41:34 | BlaXpirit | do you mean "pcre"s match is what we call "find" |
13:41:51 | flaviu | It is, pcre_exec(ANCHORED) == match, pcre_exec() == find. |
13:41:52 | BlaXpirit | and "pcre"s match with start-only argument is what we call "match"? |
13:41:58 | BlaXpirit | :> |
13:42:09 | flaviu | yep |
13:42:38 | flaviu | The problem is that findIter has basically this code: if notMatched: idx += 1; # try again |
13:43:04 | * | HakanD_ joined #nim |
13:46:57 | Varriount | flaviu: Are you the author of NRE? |
13:48:11 | flaviu | Varriount: yes |
13:51:58 | * | HakanD__ joined #nim |
13:52:35 | * | HakanD___ joined #nim |
13:55:13 | * | HakanD_ quit (Ping timeout: 250 seconds) |
13:56:04 | * | HakanD__ quit (Ping timeout: 245 seconds) |
14:02:17 | * | irrequietus joined #nim |
14:03:07 | * | b0z983oj quit (Quit: Leaving) |
14:16:38 | * | darkf quit (Quit: Leaving) |
14:17:15 | filwit | well it looks like there is still a deficiency with macros.getType().. works great for instances of a Type, but not on typedesc itself AFAIK |
14:17:36 | filwit | need to report I guess |
14:23:41 | renesac | dom96, filwit: by devel docs, do you mean this: http://nim-build.nim-lang.org/documentation.html |
14:23:42 | renesac | ? |
14:24:36 | dom96 | that's the same as http://nim-lang.org/documentation.html |
14:24:53 | flaviu | renesac: f3w703p9ahtp9wawh59gp.nim-lang.org/documentation.html |
14:25:22 | renesac | hum |
14:28:17 | renesac | why time constraints prevents the script from building it? |
14:28:28 | renesac | or the script became broken? |
14:31:04 | * | BoobLord joined #nim |
14:31:24 | * | b0z983oj joined #nim |
14:31:53 | b0z983oj | how do I init an openArray? I tried "var x : openArray[int]" but this doesn't seem to work. Also can't find any proc like newSeq in system either |
14:32:18 | renesac | openArray is only for parameters |
14:32:33 | b0z983oj | how do I use algorithms procs then? |
14:32:33 | renesac | I don't think you can init it |
14:32:39 | renesac | ? |
14:32:41 | b0z983oj | algorithms.reverse for example |
14:32:45 | b0z983oj | it requires an openArray |
14:32:45 | renesac | with either seqs or arrays |
14:32:53 | renesac | read the manual |
14:32:55 | renesac | or the tutorial |
14:33:08 | renesac | search for "openArray" |
14:33:23 | BlaXpirit | gah i cringe every time |
14:34:17 | * | HakanD___ quit (Quit: Be back later ...) |
14:34:32 | renesac | "arrayLike" would probably be a better name |
14:34:39 | renesac | for a concept |
14:35:19 | renesac | or SomeArray |
14:35:51 | renesac | but it don't helps that "seq" has a completely different name |
14:35:53 | * | BoobLord left #nim ("Leaving") |
14:35:53 | b0z983oj | well I read the tutorial and it was too mystique for me. One paragraph saying that it's for parameter only (does that mean I have to cast it? Or is it magically resolved?) . It does say that "array" of compatible type could be passed, but is it referring to openArray or the array type, or is it seq? Then the manual/system doesn't help either |
14:36:08 | BlaXpirit | b0z983oj, think of it like this: |
14:36:16 | BlaXpirit | type openArray = seq or array |
14:38:21 | BlaXpirit | the line i just wrote crashes the compiler. it's heresy |
14:39:15 | * | HakanD___ joined #nim |
14:41:28 | b0z983oj | yeah I got that part. I was just *really* confused about the compiler message I got. I wrote "reverse(@[1, 2, 3, 4, 5])" which is of course stupid (but I didn't realize) and it said it expected an array or a seq. I thought i meant openArray is neither seq nor array |
14:44:13 | flaviu | Can I get some bikeshedding on https://github.com/flaviut/nre/issues/11 ? |
15:03:46 | * | flaviu quit (Remote host closed the connection) |
15:07:55 | * | b0z983oj quit (Quit: Leaving) |
15:08:44 | * | flaviu joined #nim |
15:14:58 | * | filcuc joined #nim |
15:15:27 | * | filcuc quit (Client Quit) |
15:15:44 | * | filcuc joined #nim |
15:24:18 | onionhammer | Varriount nope i havent. Whats new? |
15:27:01 | novist | so i was talking to my friend about nim |
15:27:56 | novist | he was blown away by pervasive -1 and [0.. ^2] (to which he replied "wtf xor 2??") |
15:28:44 | novist | well we both think these two things will bite lang in the ass in a long run.. |
15:29:28 | renesac | I think the problem is inclusive ranges, instead of half-inclusive ranges that everybody else uses |
15:29:50 | novist | it certainly is. i think inclusive ranges would have made sense with 1-based array indexing |
15:30:00 | novist | w/ 0-based it wrecks havoc |
15:30:02 | renesac | we can't even have a safe "for i in x .. y" if they are "int" |
15:30:13 | * | bcinman joined #nim |
15:30:31 | * | milosn joined #nim |
15:31:18 | BlaXpirit | novist, that's what i've been saying |
15:31:32 | BlaXpirit | but it can't be changed |
15:31:40 | renesac | and novist, ^ isn't xor in nim, anymore than "type X* = int" has anything to do with pointers |
15:31:46 | flaviu | The problem is the conflated usage of ranges. |
15:31:47 | novist | sure it can, everything can be changed |
15:31:59 | novist | not immediately but it can be changed |
15:32:02 | renesac | I already proposed a "..<" iterator |
15:32:16 | flaviu | They do three things: iteration bounds, sets, and slicing. |
15:32:29 | renesac | that should be used for half inclusive ranges |
15:32:44 | BlaXpirit | renesac, it's already there, just add a space in between |
15:32:56 | renesac | the .. iterator will just be slower for ints then, and if you care about the performance difference you use the ..< |
15:33:17 | renesac | BlaXpirit: it is not the same thing |
15:33:37 | renesac | negative ranges also showed this |
15:34:28 | novist | being perfectionist it nags me that less obvious longer ..< should be used most of the time while more obvious .. is reserved for something that is rather a corner-case ('a'..'z') |
15:35:57 | novist | BlaXpirit: what was the reason for [0..-1] being impossible? |
15:36:15 | BlaXpirit | and what do u mean by "impossible" |
15:36:30 | BlaXpirit | https://github.com/Araq/Nim/issues/1979 |
15:36:40 | novist | well if its not how it works while being most obvious way then i bet there was a problem |
15:36:47 | * | pregressive joined #nim |
15:37:58 | novist | cause "abc"[0:-1] meaning "-"=reverse, "1"=one, resulting in "ab", i can understand why it takes one last char |
15:38:20 | novist | "abc"[0..^1] still being full "abc" i dont quite get |
15:38:40 | BlaXpirit | "abc"[0:-1] was "abc" |
15:38:50 | BlaXpirit | "abc"[0 .. -1] was "abc" |
15:38:52 | BlaXpirit | uh |
15:39:08 | BlaXpirit | blah, i'm not getting into this |
15:39:55 | novist | but whats the reasoning for having a slice return full string when its not "full" slice? |
15:40:47 | novist | and "abc"[:-1] returns "ab" in py |
15:41:04 | novist | and i think in php substr works same way, -1 taking away last char |
15:42:32 | novist | anyway alright, to ease frustration im gonna use range() in loops and s.slice() instead of []. but its bummer to see twovery important lang features incapacitated |
15:43:09 | BlaXpirit | and what about substr? |
15:43:20 | novist | also reason im talking about this is that basically every person i talk to about nim feels weirded out by these things. and they dont plan to use nim due to such surprises |
15:43:28 | novist | yeah i noticed substr also returns one char too long |
15:43:34 | novist | the hell idk |
15:43:38 | BlaXpirit | and what about everything else? |
15:43:50 | novist | what do you mean everything else? |
15:44:06 | renesac | novist: you can't expect a new language being equal to every other language |
15:44:09 | BlaXpirit | anything that has a range is inclusive |
15:44:16 | renesac | ^ is not xor in nim, get over it |
15:44:25 | BlaXpirit | on point |
15:44:33 | novist | renesac: i dont expect that, but there is obvious shortcoming |
15:44:48 | renesac | as for "Language design: Undesired property", yeah, they should be fixed |
15:44:49 | novist | ^/- problem is that one is more obvious than other |
15:44:58 | BlaXpirit | no |
15:45:03 | novist | ofc yes |
15:45:08 | renesac | I don't see a problem there |
15:45:16 | novist | while ^ can have many meanings - usually has one |
15:45:18 | BlaXpirit | goddammit dude. go unlearn python then return here |
15:45:27 | federico3 | [insert quote about off-by-one errors] |
15:45:48 | renesac | as Araq said, he optimizes the language not for the complete newebie that hasn't read the manual, but for who is programming some time in nim |
15:46:18 | renesac | novist: yes, it means "pow" |
15:46:22 | novist | alright fine. hell fuck ^/- thing. but inclusive ranges on 0-base lang is.. you know |
15:46:36 | BlaXpirit | yes, most people will agree it's bad |
15:46:44 | BlaXpirit | it's will not be changed |
15:47:02 | novist | not even for say 2.0? if its too late for 1.0 |
15:47:13 | renesac | even more unlikely then |
15:47:24 | BlaXpirit | ^ |
15:47:31 | novist | but why? |
15:47:41 | novist | too much code would become unusable? |
15:47:46 | federico3 | is there a design reason behind inclusive ranges (not arguing, just curious) |
15:48:19 | novist | i think it stems from araq's love for pascal |
15:48:21 | novist | but its 1-based |
15:48:31 | BlaXpirit | Araq thinks thinks int.low .. int.high is a reason |
15:48:45 | BlaXpirit | but no, there is no real reason |
15:48:48 | renesac | federico3: araq don't fells like 'a' .. 'Z' should be a special case |
15:49:03 | renesac | but I would be perfectly fine typing 'a' ... 'Z' for those cases |
15:49:05 | novist | as far as im concerned 'a'...'z' could be that solution |
15:49:05 | federico3 | what? |
15:49:41 | BlaXpirit | `:` is not taken |
15:49:44 | renesac | well, Araq likes inclusive ranges, but I think they do much more harm than good for nim |
15:50:10 | novist | ^ |
15:50:37 | * | pregress_ joined #nim |
15:51:25 | novist | i would love to use nim for next thing we will do in our line of work. that software should be in native code, easily deployable and multiplatform. nim fits the bill perfect |
15:51:33 | novist | but now im thinking of workarounds im gonna use for these problems |
15:51:44 | renesac | novist: just define ..< for half-inclusive ranges |
15:52:17 | renesac | I think I will make an issue proposing it and the deprecation of the < unary operator |
15:52:19 | novist | sure, workaround |
15:52:22 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:52:48 | novist | or range() being non-inclusive iterator |
15:52:59 | novist | again workaround. even if im very used to it its a workaround |
15:53:22 | BlaXpirit | renesac, lol that's no good |
15:53:31 | renesac | BlaXpirit: why? |
15:53:36 | BlaXpirit | at least people can do substr(4, <6) now |
15:53:44 | renesac | hum |
15:53:57 | * | pregressive quit (Ping timeout: 248 seconds) |
15:53:57 | BlaXpirit | ..< is something that is on everybody's mind |
15:53:58 | novist | BlaXpirit: but that substr is one more not so obvious thing |
15:54:02 | BlaXpirit | saves 1 space of typing, whatevber |
15:54:08 | BlaXpirit | novist, everything is obvious |
15:54:20 | BlaXpirit | just different to what you're used to. get over it. |
15:55:13 | novist | eh nim is pretty much what i have dreamed about for quite some years |
15:55:26 | novist | its sad to see it come so close, but not quite |
15:55:32 | BlaXpirit | you sound exactly like me a few months ago |
15:55:35 | novist | thats why im talking here.. |
15:55:37 | renesac | the uncanny valley |
15:55:38 | renesac | :P |
15:56:07 | novist | BlaXpirit: but i think there will be more people like me |
15:56:13 | BlaXpirit | of course |
15:56:18 | novist | who will flip the table and scream "feck this sh1t" |
15:56:25 | novist | it does no good to anyone |
15:57:11 | BlaXpirit | and what good is rewriting half of existing code? |
15:57:20 | federico3 | sounds like we should rather improve the documentation and flag very clearly any surprising behavior |
15:57:51 | novist | well it depends what would be outcome of rewriting/not rewriting half of existing code |
15:58:09 | novist | if it will be something that seriously slows adoption then.. |
15:58:12 | * | bluenote10 joined #nim |
15:58:30 | novist | im greedy person, i dont want nim to be language that araq made just for himself to enjoy :)) |
15:58:31 | flaviu | Why can't existing code use an old compiler? |
15:58:41 | BlaXpirit | libs |
15:59:00 | flaviu | Useful libs will be adapted, and they might even gain a test suite in the process! |
15:59:26 | BlaXpirit | who needs 1.0, let's release 2.0 |
15:59:31 | flaviu | Exactly! |
15:59:50 | BlaXpirit | immediately better than rust |
16:00:53 | * | filcuc quit (Ping timeout: 248 seconds) |
16:01:46 | HakanD___ | hah |
16:03:54 | renesac | if the inclusive to half-inclusive conversion can be done entirelly mechanically, by a script, then I would be more for it |
16:04:26 | renesac | but I fell those things are tricky |
16:04:47 | renesac | as they say: there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors. |
16:05:03 | * | HakanD___ quit (Quit: Be back later ...) |
16:05:43 | novist | imo biggest problem is lack of desire to fix this |
16:06:04 | flaviu | renesac: certainly feels that way. |
16:06:08 | novist | important people seem to be at peace with this and are prepared to live with consequences |
16:06:37 | BlaXpirit | that's why you couldn't make a programming language |
16:07:04 | novist | thats true. my level aint that high. if it was i would just maintain a fork for myself w/ these two solved |
16:07:18 | flaviu | novist: I dislike this inclusive bounds, but I can't go against the convention. |
16:07:23 | novist | but oh well.. must do politics now instead |
16:08:15 | novist | flaviu: well there are two ways.. not use those things, use helper procs instead, and not use language (very bad solution) |
16:08:21 | novist | both dont go against convention.. |
16:08:26 | novist | nevertheless there is a problem |
16:11:24 | flaviu | novist: I'm coming from the opposite prospective, as a person writing a library. (with major contributions from BlaXpirit, credit where credit is due) |
16:11:25 | * | HakanD___ joined #nim |
16:11:48 | flaviu | I can't have the library use exclusive upper bounds, as it does not mesh well with other things. |
16:12:55 | novist | its probably too rather specific lib no? |
16:13:13 | novist | not casual code people write daily to get things done i bet? |
16:13:40 | flaviu | Sorry, I don't understand what you wrote |
16:13:47 | novist | cause so far i cant recall doing for (i=0; i < SOMETHING+1; i++) |
16:14:11 | novist | well im saying 'a'..'z' is cornercase |
16:14:22 | novist | meaning useful inclusive ranges cornercase |
16:14:32 | BlaXpirit | novist, yes, so? |
16:14:44 | BlaXpirit | nobody's even arguing for inclusive ranges |
16:15:06 | flaviu | BlaXpirit: Araq is. |
16:15:11 | novist | so preferring cornercase while having more often written code to deal with it's fallout is kind of odd |
16:15:26 | * | filcuc joined #nim |
16:15:29 | renesac | novist: I've done plenty of for (i=0; i <= SOMETHING; i++) |
16:15:46 | novist | renesac: you lost +1 bit :) |
16:15:49 | renesac | much less than the < version, of course |
16:15:51 | novist | oh <= |
16:15:59 | renesac | novist: nim don't do +1 |
16:16:00 | renesac | yeah |
16:16:01 | novist | well yeah, thats what im saying |
16:16:17 | novist | or another solution would be for everyone to use 1-based arrays |
16:16:25 | novist | and strings to be 1-based then |
16:16:31 | novist | and seqs etc.. |
16:17:02 | novist | though i still prefer 0-based.. |
16:17:16 | renesac | I don't think there is anyone pushing for this |
16:17:29 | novist | cause its crappy solution maybe |
16:17:48 | novist | bigger part of the world is 0-based |
16:18:21 | renesac | it is confusing for non-programmers though |
16:18:27 | renesac | mathematics is 1 based |
16:18:45 | renesac | and most of the world outside programming is also 1 based |
16:18:51 | novist | you speaking of some advanced math maybe? |
16:19:10 | novist | cause from school i dont remember anything like that heh |
16:19:35 | renesac | matrixes |
16:19:36 | renesac | on school |
16:19:55 | novist | yeah.. never dealt with that |
16:20:21 | novist | aside from 3d libs where its 0-based hehe |
16:21:12 | renesac | lua for example was made 1-based to cater to non-programming engineers at the time |
16:21:38 | renesac | fortran too, for mathematicians |
16:21:46 | novist | different target audience though |
16:21:51 | renesac | I agree |
16:22:41 | renesac | and for new languages, Julia is 1-indexed too |
16:22:49 | renesac | again, aiming at scientists |
16:23:48 | * | filcuc quit (Quit: Konversation terminated!) |
16:24:01 | renesac | Mathematica, matlab, etc too |
16:24:44 | renesac | but yeah, not nim target audience |
16:25:02 | renesac | and even that target audience can adapt to 0-based indexing, as seen by python science community |
16:27:14 | novist | well its not a rocket science. you aint supposed to learn 10 different gotcha situations and keep an eye for them when learning 0-based indexing. in c and friends anyway |
16:27:55 | novist | btw this is great explanation why py has 0-based indexing https://plus.google.com/115212051037621986145/posts/YTUxbXYZyfi |
16:28:06 | renesac | the problem of nim seems to be inclusive plus 0-based indexing |
16:28:34 | federico3 | 0 or 1? |
16:28:52 | renesac | is there any other languages that use inclusive ranges and have 0-based indexing? |
16:29:01 | novist | i not know of one |
16:29:16 | renesac | federico3: I meant, the combination of the two |
16:30:41 | BlaXpirit | i dont know any |
16:31:29 | BlaXpirit | http://irclogs.nim-lang.org/15-01-2015.html 20:21:35 lol |
16:31:33 | novist | maybe that combination isnt widespread for a good reason |
16:31:39 | BlaXpirit | we've been here 3 months ago |
16:32:12 | BlaXpirit | i was even more passionate about this than novist |
16:32:33 | novist | BlaXpirit: what broke your spirit? :D |
16:32:48 | EXetoC | corner case? why? |
16:33:08 | BlaXpirit | i was mostly mad about a broken behavior as described in my issue |
16:33:19 | BlaXpirit | that was fixed, negative indices were removed, good enough for me |
16:34:06 | novist | isnt ^2 still negative indice except working one and not looking negative? |
16:34:33 | novist | oh dom96 agrees with me: dom96 I kind of wish that we just copied Python's intervals. |
16:34:41 | EXetoC | no |
16:34:44 | renesac | ^2 isn't negative indice, it is indexing the array in reverse |
16:36:05 | renesac | some languages do the same thing using negative indices |
16:37:08 | renesac | while on others they are invalid or point to values before the spot pointed by the initial array pointer |
16:37:16 | * | Gilgamesh joined #nim |
16:37:40 | * | Gilgamesh is now known as Guest81738 |
16:38:04 | BlaXpirit | using inclusive indices is working out pretty nicely for me at this moment |
16:38:09 | novist | well i do not have high knowledge of good terminology so for me it meant pretty much same thing |
16:39:16 | novist | so you people think its totally unrealistic to expect any fix for this? |
16:39:38 | BlaXpirit | not totally |
16:39:41 | BlaXpirit | almost |
16:39:57 | renesac | I hope an ..< operator is realistic... |
16:40:16 | novist | that i can define myself, its not a fix though |
16:40:30 | TEttinger | ,, |
16:40:40 | novist | fix would be 1-based+inclusive or 0-based+non-inclusive |
16:41:00 | renesac | ..< is non-inclusive, plus the 0 based of the language |
16:41:01 | renesac | is a fix |
16:41:12 | BlaXpirit | substr says no |
16:41:16 | renesac | ok |
16:41:18 | EXetoC | I still don't have a problem with the current behavior, but then again I don't care too much about what people are used to |
16:41:23 | novist | and slicing too |
16:41:26 | BlaXpirit | return values |
16:41:33 | BlaXpirit | return values are the worst |
16:41:41 | BlaXpirit | like regex match - it returns a..b |
16:41:44 | dom96 | Isn't Araq's fix good enough? |
16:41:46 | BlaXpirit | no |
16:41:51 | dom96 | how much more time must we waste on this? :( |
16:41:59 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
16:42:02 | Guest81738 | :( |
16:42:16 | BlaXpirit | whenever someone comes really caring about the language, time will be wasted, forever, unless it is fixed |
16:42:26 | renesac | dom96: araq fix for "for" didn't fix it for integers |
16:42:35 | renesac | int integers |
16:42:39 | dom96 | renesac: huh? |
16:42:43 | dom96 | what fix for "for"? |
16:42:43 | renesac | I must open a new issue because he closed the last one |
16:43:31 | * | EXetoC quit (Quit: WeeChat 1.1.1) |
16:44:32 | renesac | https://github.com/Araq/Nim/issues/148 |
16:44:33 | renesac | this one |
16:48:17 | renesac | hum, ok, now trying: |
16:48:21 | renesac | for i in int.high - 1 .. int.high: |
16:48:21 | renesac | echo i |
16:48:33 | renesac | fails with an overflow error, instead of an infinite loop |
16:50:34 | renesac | but with uint64 it is still an infinite loop |
16:51:09 | renesac | and there goes one of the advantages of inclusve ranges: being able to easily loop to the highest value |
16:51:15 | renesac | well, now it works for smaller types, at least |
16:52:07 | renesac | uh, for uint32 it also gives an infinite loop |
16:52:29 | Guest81738 | it has been like that for 3 year now? |
16:52:31 | renesac | https://github.com/Araq/Nim/issues/1008 <-- this needs to be reopened |
16:53:33 | renesac | can you do that for me dom96? |
16:53:57 | dom96 | can't you reopen it? It's your issue? |
16:54:05 | renesac | let's see |
16:54:32 | BlaXpirit | did i really just implement this thing without any mistakes |
16:54:40 | renesac | nope, I can't open it |
16:55:27 | dom96 | ok, I reopened it |
17:00:05 | Joe-T | wot that code doesn't even compile for me |
17:01:38 | Joe-T | I don't have any proc `-` for uints in system.nim |
17:02:49 | renesac | Joe-T: import unsigned |
17:02:56 | Joe-T | ohh thanks lol |
17:02:56 | renesac | :P |
17:03:41 | BlaXpirit | i can't believe it. i wrote a really complicated piece of code and it worked first try |
17:03:49 | BlaXpirit | writing test after test and none fail |
17:04:16 | Guest81738 | maybe the compiler is broken |
17:04:24 | Joe-T | yeah I was surprised by how much I could first try write code taht compiles with nim, without even knowing the language |
17:04:37 | dhasenan | Guest81738: wouldn't be surprised. |
17:04:38 | Joe-T | what does the infinite loop do? |
17:04:43 | Joe-T | I'm still counting up in the |
17:04:51 | Joe-T | like 160 millions or something |
17:05:18 | Joe-T | oh it wraps around |
17:05:27 | Joe-T | ok this is gonna take a while.. |
17:06:16 | BlaXpirit | :> |
17:06:22 | BlaXpirit | kill it with fire |
17:07:38 | * | irrequietus quit () |
17:07:44 | BlaXpirit | lol novist will be so happy to hear thi |
17:08:06 | BlaXpirit | these loops with inclusive indices don't work because they are implemented with a noninclusive index |
17:08:06 | novist | wha? |
17:08:08 | * | gever-gever quit (Remote host closed the connection) |
17:08:21 | BlaXpirit | kinda.. |
17:08:30 | BlaXpirit | not really |
17:08:30 | novist | seeeeee!!! :) |
17:09:13 | BlaXpirit | this is what i meant. https://github.com/Araq/Nim/issues/148#issuecomment-6693883 |
17:09:52 | novist | lots of gotchas to watch out for.. |
17:11:48 | * | HakanD___ quit (Quit: Be back later ...) |
17:12:51 | * | irrequietus joined #nim |
17:13:02 | Joe-T | why am I running this code with echo in the loop, going to make it take so much longer lol |
17:15:08 | BlaXpirit | forever*100? |
17:15:59 | Guest81738 | when reading a char from windows's terminal i get the char 224 after pressing a key, is this normal? |
17:16:51 | * | pregress_ quit (Remote host closed the connection) |
17:16:53 | BlaXpirit | probably not. elaborate. |
17:16:56 | * | endragor quit (Ping timeout: 240 seconds) |
17:17:08 | BlaXpirit | are you writing in your language? |
17:17:16 | BlaXpirit | and by that i mean non-english language? |
17:17:35 | BlaXpirit | and by that I mean non-ASCII characters |
17:17:38 | Guest81738 | i'm using conio.h getch, and when i press any arrow key, it gets both the arrow pressed and that strange char |
17:18:12 | Guest81738 | with nim, language agnostic |
17:18:15 | * | bluenote10 quit (Quit: Page closed) |
17:18:19 | BlaXpirit | bleh |
17:18:27 | BlaXpirit | do it in C, gonna get the same result |
17:18:35 | Guest81738 | Yeah, i guess. |
17:19:36 | BlaXpirit | Guest81738, "When reading a function key or an arrow key, each function must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code." |
17:19:53 | BlaXpirit | that's your 224. RTFM :p |
17:19:58 | Joe-T | I was runing it for like 15 mins, didn't reach the wraparound, took out the echo and it wrapped around almost instantly |
17:20:15 | BlaXpirit | Joe-T, you took the joke far enough :| |
17:20:28 | Joe-T | lol |
17:20:38 | Guest81738 | wow, how did you find that? |
17:20:42 | flaviu | Joe-T: Well, that's the difference between a hundred instructions and a lock and a branch + increment. |
17:20:57 | BlaXpirit | http://google.com/#q=winapi+arrow+keys+getch |
17:20:59 | Joe-T | yeah and system calls |
17:21:04 | Joe-T | for each echo |
17:21:34 | Joe-T | but that's what the code in the issue did lol |
17:22:08 | Guest81738 | my google-fu needs more leveling |
17:22:20 | Guest81738 | thank you based BlaXpirit |
17:33:54 | * | HakanD___ joined #nim |
17:38:15 | * | egrep joined #nim |
17:39:59 | * | TEttinger quit (Ping timeout: 276 seconds) |
17:41:15 | * | endragor joined #nim |
17:48:49 | onionhammer | dom96 you should change the topic URL slightly every time someone posts something on the forum so new posts mark links unread |
17:49:02 | onionhammer | just add a &t={lastposttime} |
17:49:39 | dom96 | ooh cool idea |
17:49:53 | dom96 | create an issue for this please |
17:50:57 | renesac | Joe-T: the code with echo wrapps around immediatedly |
17:51:03 | * | filwit quit (Quit: Leaving) |
17:51:05 | renesac | otherwise you wouldn't be seeing those low numbers |
17:51:28 | onionhammer | done |
17:51:55 | dhasenan | If I don't report at least two compiler bugs in a day, it feels like I'm not getting any work done. |
17:52:10 | renesac | isn't better to just add a "see new posts" button on the side of the topic title? |
17:52:40 | renesac | when there are new posts since your last visit? |
17:52:44 | renesac | using cookies? |
17:55:18 | onionhammer | renesac that would be nice, but it would be a lot more effort |
17:55:34 | onionhammer | involving db queries and storing each users last visit to each thread |
17:58:13 | Joe-T | oh yeah lol, what was I thinking, it was only counting from 100 less than max |
17:59:07 | Joe-T | Error: type mismatch: got (uint8, Operand:ObjectType) but expected one of: utils.isFlagSet(f: uint8, mask: uint8) |
17:59:08 | Joe-T | wat |
17:59:44 | renesac | what line you gave it? |
17:59:57 | Joe-T | https://github.com/Araq/Nim/issues/2518 |
18:00:14 | Joe-T | + not cpu.f.isFlagSet(`operand.flagMask`) |
18:00:35 | Guest81738 | how can i run a console command in nim (like ls, or rm) |
18:00:58 | def- | Guest81738: osproc module |
18:01:03 | Joe-T | http://nim-lang.org/osproc.html |
18:01:19 | renesac | Guest67437: os module is probably a better fit for what you want |
18:01:21 | dom96 | Joe-T: Are you trying to get my gbemulator running? |
18:01:26 | Guest81738 | Thanks, you both were fast |
18:01:31 | Joe-T | yeah lol |
18:01:39 | renesac | you don't want to call shell operations by string |
18:01:40 | Guest81738 | os? i'll check it now |
18:02:16 | dom96 | Joe-T: It barely works :P |
18:02:27 | renesac | http://nim-lang.org/os.html |
18:03:06 | renesac | if you want to call a program, use osproc |
18:03:11 | Guest81738 | ok thanks, is string concat done with + ? |
18:03:19 | dom96 | Guest81738: & |
18:03:25 | Guest81738 | I just wanted to invoke mode command in win |
18:03:29 | Guest81738 | thanks dom96 |
18:06:18 | Joe-T | hmm quotes don't seem to like: |
18:06:24 | Joe-T | obj.intVar |
18:06:35 | Joe-T | you have to do like var intVar = obj.intVar first |
18:07:09 | dom96 | Joe-T: what are you trying to do? |
18:07:12 | * | HakanD___ quit (Quit: Be back later ...) |
18:07:31 | Joe-T | I was using it as a test script for uint stuff |
18:10:08 | Joe-T | wat it compiles now |
18:24:09 | * | HakanD___ joined #nim |
18:25:32 | * | endragor quit (Remote host closed the connection) |
18:27:51 | * | Matthias247 joined #nim |
18:28:37 | pigmej | reactormonk: ping |
18:36:30 | Joe-T | hmm, like 170, pragmas.nim |
18:36:32 | Joe-T | line* |
18:36:45 | Joe-T | expectIntLit |
18:36:59 | Joe-T | of nkIntLit..nkInt64Lit: result = int(n.sons[1].intVal) |
18:37:15 | Joe-T | that method can't deal with UInt then can it? |
18:37:31 | Joe-T | UInt64 can't be cast to int? |
18:43:23 | * | wink-s joined #nim |
18:46:18 | Joe-T | hmm BiggestInt is int64 |
18:47:48 | renesac | http://nim-lang.org/manual.html#ordinal-types |
18:54:30 | BlaXpirit | is it possible to turn the expression that a template got into string? |
18:54:57 | BlaXpirit | tpl(blah) - i'd like to get "blah" |
18:55:21 | Joe-T | so atm unsigned ints can't be compared to signed? |
18:55:54 | renesac | Joe-T: yeah |
18:56:15 | BlaXpirit | import unsigned |
18:56:15 | renesac | BlaXpirit: I think I saw some debug thing |
18:56:23 | BlaXpirit | renesac, that might be macro |
18:56:25 | renesac | BlaXpirit: even with import unsigned |
18:56:45 | BlaXpirit | renesac, good tip |
18:56:54 | Joe-T | yeah it's T: SomeUnsignedInt |
18:56:55 | BlaXpirit | i distinctly remember the words "powerful debug macro" in some tutorial or manual |
18:57:04 | Joe-T | == in unsigned only compares unsigned |
18:57:39 | BlaXpirit | don't use unsigned lol |
18:57:51 | BlaXpirit | Araq pushes it too hard |
18:58:38 | renesac | unsigneds are often the best tool for the job |
18:58:53 | renesac | you even have "byte" defined by default |
18:58:57 | renesac | to uint8 |
18:59:04 | renesac | IIRC |
18:59:09 | * | pigmej gosh, I really hate elisp |
18:59:32 | renesac | yep |
18:59:59 | renesac | var b:byte = 5 # the only line here that works. |
19:00:00 | renesac | var y:int = b + 2 # Error: type mismatch: got (Byte) but expected 'int' |
19:02:59 | * | Pokon joined #nim |
19:03:15 | * | bcinman joined #nim |
19:03:16 | * | onionhammer quit (Ping timeout: 244 seconds) |
19:04:14 | Guest81738 | behold! new roguelike incoming http://i.imgur.com/h2V0o7c.gif |
19:04:35 | Guest81738 | 100% nimrod |
19:04:53 | renesac | *nim |
19:05:01 | Guest81738 | & rod |
19:06:10 | * | banister joined #nim |
19:06:43 | renesac | nim should have changed name again to 'rod' 12 days ago |
19:07:15 | Pokon | y'all are confusing with the name changes |
19:07:30 | renesac | Pokon: ? |
19:08:18 | Pokon | it's just nim now, right? no rod? |
19:09:27 | Guest81738 | whenever i want to compile something i have to write: rod c file.rod |
19:09:57 | ggVGc | actually, it's now called rimscript |
19:09:57 | renesac | Pokon: yes, just nim |
19:10:18 | renesac | Guest81738 that is weird |
19:12:55 | * | Varriount_ joined #nim |
19:13:08 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:13:43 | * | Varriount quit (Ping timeout: 252 seconds) |
19:23:54 | tmku | Guest81738: pdcurses? |
19:32:08 | a5i | does Ruby support more aspects of functional programming than JS ? |
19:32:53 | a5i | sorry, wrong chat room... |
19:33:07 | Araq_ | a5i: I can answer anyway: no. |
19:33:30 | a5i | Araq: what about vice versa ? |
19:34:08 | * | user7181_ joined #nim |
19:34:34 | Araq_ | the question makes not much sense. both are imperative dynamically typed languages with first class functions, well in Ruby's case it's blocks instead |
19:36:32 | Araq_ | both are in reality quite far away from FP when you consider that the major point of FP is its additional *constraints* and not map and filter |
19:36:47 | * | user7181 quit (Ping timeout: 264 seconds) |
19:36:55 | * | Araq_ is now known as Araq |
19:37:13 | a5i | I see |
19:37:16 | BlaXpirit | Araq, could you read our discussion about seq being a pointer? |
19:37:43 | Araq | BlaXpirit: I skimmed it. what's the concrete question? |
19:37:57 | BlaXpirit | why is seq implemented as a pointer? |
19:38:04 | Araq | why not? |
19:38:14 | BlaXpirit | because it's an indirection |
19:38:19 | BlaXpirit | performance hit adds up |
19:38:36 | Araq | as opposed to what alternative? |
19:39:02 | BlaXpirit | like i said, seq is implemented as pointer to {length, reserved, pointer to data} |
19:39:10 | BlaXpirit | the alternative is {length, reserved, pointer to data} |
19:39:17 | Araq | well you said that, but it's wrong |
19:39:31 | * | anthony joined #nim |
19:39:47 | BlaXpirit | what is wrong? |
19:39:51 | Araq | it's pointer to {length, reserved, data[0], data[1], ...} |
19:39:54 | * | anthony is now known as Guest49234 |
19:40:07 | BlaXpirit | oh really |
19:40:41 | Araq | yes. |
19:40:51 | BlaXpirit | i don't think that's true |
19:41:36 | BlaXpirit | var a: seq[int] = @[]; var p = cast[ptr int](a); echo cast[int](p.offset(2)) |
19:41:37 | * | Guest49234 quit (Max SendQ exceeded) |
19:41:44 | BlaXpirit | output is 140613933871200 |
19:42:21 | BlaXpirit | (offset is part of fowltek.pointer_arithm, advances pointer by 2*sizeof) |
19:43:01 | a5i | Araq: But Ruby has lambdas |
19:43:02 | BlaXpirit | wait, that doesn't necessarily prove it. but same thing if the seq is not empty |
19:43:17 | Araq | so? do you think I don't know how seqs are implemented? |
19:43:27 | Guest81738 | tmku: nop, windows module |
19:43:31 | BlaXpirit | apparently yes |
19:43:58 | BlaXpirit | let me just check again... maybe i'm a complete dummy |
19:44:18 | BlaXpirit | yes, it appears so |
19:44:45 | BlaXpirit | echo((length: p[], capacity: p.offset(1)[], data: p.offset(2)[])) (length: 2, capacity: 2, data: 123) |
19:45:10 | Guest81738 | i have to go, thanks for your help nimroders. |
19:45:12 | * | Guest81738 quit (Quit: Page closed) |
19:45:25 | * | MagusOTB joined #nim |
19:45:31 | BlaXpirit | thx for the reply. now it all makes sense |
19:46:04 | Araq | a5i: eine Schwalbe macht noch keinen Sommer. |
19:46:32 | a5i | brb translating |
19:47:04 | a5i | "one swallow does not make a summer" |
19:48:09 | Pokon | is there a destructor-like function defined when compiling with --app:lib? |
19:48:56 | a5i | Araq, you dont think Ruby has lambdas ? |
19:49:00 | Araq | Pokon: I don't think so |
19:49:21 | Araq | a5i: I don't think "lambdas" are the essence of functional programming |
19:49:30 | a5i | Oh |
19:49:57 | a5i | but haskell's logo is a lambda ! |
19:50:07 | BlaXpirit | lol |
19:50:08 | flaviu | Araq: What is the essence of functional programming then? |
19:50:09 | Pokon | Araq: ok thanks. couldn't find anything and wasn't sure if i was overlooking it |
19:50:13 | a5i | clearly Ruby has more functional aspects then ! |
19:50:25 | a5i | </jokin> |
19:51:20 | Araq | flaviu: additional constraints in the form of static typing and functions that don't have side effects |
19:51:38 | Araq | immutable data structures |
19:52:28 | * | UberLambda joined #nim |
19:54:46 | BlaXpirit | is it possible to make a macro work for only one type, but still get the passed expression as a tree? |
19:55:09 | Araq | BlaXpirit: macros always get trees anyway |
19:58:03 | BlaXpirit | import macros;macro test(a: int): expr =; dumpLisp(a); 6;discard test(1+2) |
19:58:28 | BlaXpirit | output: Ident(!"a") |
19:58:41 | * | Kingsquee joined #nim |
20:01:10 | * | Trustable quit (Remote host closed the connection) |
20:04:27 | Araq | don't dump* |
20:04:40 | Araq | these are .immediate and so dump too early |
20:05:26 | Araq | echo repr like the rest of us :P |
20:05:52 | BlaXpirit | aha. thanks. |
20:06:36 | * | bcinman joined #nim |
20:16:16 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:17:46 | * | pregressive joined #nim |
20:17:52 | BlaXpirit | how to do bool literal in macros? :o |
20:18:32 | BlaXpirit | how to call a proc with a boolean argument inside a macro? |
20:19:31 | Araq | bindSym"true" ? |
20:19:45 | Araq | bindSym"false" ? |
20:20:03 | BlaXpirit | well what if it is in a variable? |
20:20:15 | BlaXpirit | var x: bool |
20:20:25 | BlaXpirit | newCall(..., bindSym"x") is what i tried |
20:20:47 | BlaXpirit | for others I just did newLit(x) |
20:20:55 | BlaXpirit | but no such thing for bool |
20:22:15 | * | pregressive quit (Ping timeout: 265 seconds) |
20:25:44 | Joe-T | am I right in saying you can't have sets containing uints and uint64s? |
20:27:01 | BlaXpirit | probably |
20:27:02 | Araq | Joe-T: sets only work for 0..0xffff anyway iirc |
20:27:05 | renesac | I don't think you can have sets containing ints either |
20:27:07 | def- | Joe-T: there are two kinds of sets, see the sets module |
20:27:08 | renesac | yeah |
20:27:52 | Araq | BlaXpirit: yeah I should add that :P |
20:27:58 | Joe-T | it says it has to be an ordinal type |
20:28:15 | Joe-T | oh or is that because |
20:28:27 | Joe-T | I specified values in {....}, which |
20:28:30 | BlaXpirit | for now i suppose bindSym($x) might work?? |
20:28:35 | Joe-T | requires ordinal types to do ranges |
20:29:12 | * | bcinman joined #nim |
20:29:57 | Joe-T | ah no, let s: set[uint] says it too |
20:30:16 | * | bcinman quit (Client Quit) |
20:30:20 | BlaXpirit | bindSym gives me bool | proc (...) |
20:30:37 | Joe-T | in repr.nim, addSeElem |
20:30:40 | Joe-T | at it's |
20:30:40 | BlaXpirit | i'm doing something so wrong |
20:30:56 | Joe-T | of tyInt..tyInt64: add result, reprInt(elem) |
20:31:14 | MagusOTB | is it possible to make a generic that takes only primitive types? |
20:31:32 | Joe-T | would: of tyInt..tyInt64, tyUInt8..tyUInt32: add result, reprInt(elem) be ok? |
20:32:03 | renesac | [17:27:42] <Araq> Joe-T: sets only work for 0..0xffff anyway iirc <-- and 0xffff don't works for numbers that set works, XD |
20:32:27 | renesac | just filled a bug about this, but I've already complained about this earlier: https://github.com/Araq/Nim/issues/2539 |
20:36:34 | reactormonk | pigmej, o/ |
20:39:05 | Joe-T | is this stuff in tpegs.nim? |
20:39:30 | Joe-T | like handleHexChar takes an int |
20:40:15 | * | bcinman joined #nim |
20:45:04 | * | jholland quit (Quit: Connection closed for inactivity) |
20:45:43 | * | Jehan_ joined #nim |
20:51:59 | * | TEttinger joined #nim |
20:58:53 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
21:06:14 | * | bcinman joined #nim |
21:14:44 | * | UberLambda quit (Remote host closed the connection) |
21:29:25 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:48:30 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:03:36 | renesac | well, I guess it can take an int64/uint64 and cast it to the appropriate result |
22:04:41 | flaviu | .eval let x = 0xFFFF_FFFF_FFFF_FFFFu64 |
22:04:42 | Mimbus | flaviu: <no output> |
22:04:47 | flaviu | renesac: ^ |
22:05:49 | renesac | humm |
22:06:02 | renesac | so it is supported some way |
22:06:23 | flaviu | Its shorter to use a postfix then to bother type out the type anyway. |
22:06:51 | renesac | yeah, but there is no reason why the way I typed shouldn't work too |
22:07:12 | renesac | I wonder if that code compiles on 32bit |
22:07:30 | renesac | if nim really uses an 'int' to store that value |
22:07:33 | flaviu | renesac: Agreed, but you can see why fixing that bug is not a high priority. |
22:08:07 | renesac | flaviu: the signed integer version is uglier |
22:08:36 | flaviu | .eval let x = int64(0xFFFF_FFFF_FFFF_FFFFu64) |
22:08:37 | Mimbus | flaviu: <no output> |
22:09:30 | * | vendethiel quit (Ping timeout: 256 seconds) |
22:11:23 | renesac | humm |
22:11:37 | renesac | it fails for literal though |
22:12:09 | renesac | .eval let x = int8(0xFF) |
22:12:10 | Mimbus | renesac: eval.nim(3, 12) Error: conversion from int literal(255) to int8 is invalid |
22:12:18 | renesac | .eval let x = int8(0xFFu64) |
22:12:20 | Mimbus | renesac: <no output> |
22:12:25 | renesac | that is weird |
22:12:35 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:12:48 | renesac | the second works |
22:12:51 | renesac | by the way |
22:13:56 | flaviu | .eval let x = int8(0xFFu8) |
22:13:57 | Mimbus | flaviu: <no output> |
22:14:07 | renesac | flaviu: I know tha |
22:14:10 | renesac | *that |
22:14:37 | renesac | I just finds it weird this conversion be allowed for normal types but not for literals |
22:14:45 | renesac | *find it |
22:15:24 | renesac | is this conversion defined anywhere in the documentation? |
22:15:52 | flaviu | renesac: Well, you're converting int literal 255 -> int8, there is a check. I think that all checks are disabled on uints. |
22:16:37 | TEttinger | .eval let x = int8(0x7F) |
22:16:38 | Mimbus | TEttinger: <no output> |
22:18:33 | renesac | http://nim-lang.org/manual.html#convertible-relation <-- this don't explains what we saw |
22:20:28 | * | vendethiel joined #nim |
22:20:36 | renesac | the algorithm would return false for u64 |
22:21:04 | renesac | the isExplicitlyConvertible() |
22:29:59 | Varriount_ | *this doesn't explain what we saw |
22:30:05 | * | Varriount_ is now known as Varriount |
22:30:55 | renesac | this is a weak point in my english grammar |
22:30:56 | renesac | :P |
22:31:19 | Varriount | renesac: Don't worry, at least you know more than one language. |
22:31:47 | Varriount | renesac: Also, I'm sorry to say, most native english speakers would make the same mistake. |
22:32:18 | renesac | heh |
22:32:27 | renesac | might become the right way in some decades |
22:32:28 | renesac | :P |
22:37:02 | Jehan_ | The code is in handleRange() in compiler/sigmatch.nim |
22:37:12 | Jehan_ | But I'm too tired right now to figure out what's going wrong there. |
22:39:01 | renesac | well, I agree that it isn't high priority, but it will require a breaking backwards compatibility fix eventually |
22:42:24 | * | vendethiel quit (Ping timeout: 250 seconds) |
22:51:54 | * | wb quit (Read error: Connection reset by peer) |
22:54:45 | * | Jehan_ quit (Quit: Leaving) |
23:02:25 | * | user7181_ quit (Quit: leaving) |
23:05:27 | * | vendethiel joined #nim |
23:21:04 | Varriount | Hm... |
23:21:14 | Varriount | The windows core audio api is strange... |
23:21:20 | Varriount | It seems to be C++ |
23:24:04 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:24:39 | cazov | is it a new api? |
23:25:07 | cazov | MS (probably due to herb sutter) has been pushing towards being more C++ with their newer stuff |
23:26:35 | * | vendethiel quit (Ping timeout: 246 seconds) |
23:52:15 | * | irrequietus quit () |
23:56:57 | Varriount | cazov: https://msdn.microsoft.com/en-us/library/windows/desktop/dd370802%28v=vs.85%29.aspx |
23:56:58 | * | bcinman joined #nim |
23:57:28 | Varriount | It's irritating, because C++ is so hard to wrap |
23:57:34 | cazov | yeah |