00:00:55 | Araq | I used to make backups of my git repos before doing conflict resolution |
00:00:55 | * | irrequietus quit () |
00:01:17 | Araq | that's how good these tools really work when you happen to be a mortal |
00:01:42 | flaviu | I happen to be a god, so I just did git rebase --interactive and got rid of that commit. |
00:02:28 | BlaXpirit | :o |
00:03:31 | Araq | flaviu: oh it wasn't even git specific, I did the same with subversion |
00:03:42 | ldlework | git has the amazing cache thing |
00:03:49 | ldlework | I've fucked up trees really really badly |
00:04:02 | ldlework | go into the commit log, pick the last commit you recognize, check it out, all is good |
00:04:08 | ldlework | I think the cache lasts like 3 weeks too |
00:04:12 | flaviu | Araq: How long did it take with subversion? :D |
00:04:42 | * | saml_ joined #nim |
00:05:05 | * | rpag quit (Quit: Leaving) |
00:07:42 | Araq | flaviu: I am not sure you understand what "backup" means here |
00:12:15 | * | Mat4 left #nim (#nim) |
00:16:33 | * | matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045]) |
00:37:13 | * | saltylicorice joined #nim |
00:45:05 | renesac | flaviu: while you are at it, you could add a drop of documentation to that module... it has aproximatedly zero |
00:45:28 | flaviu | renesac: Sure, I can send in a PR for that. |
00:50:54 | * | yglukhov____ quit (Quit: Be back later ...) |
00:56:29 | * | BlaXpirit quit (Quit: Quit Konversation) |
01:05:53 | * | jefus_ is now known as jefus |
01:12:22 | jpoirier | Has anyone tried/used Pelles C (http://www.smorgasbordet.com/pellesc/) as Nim's C compiler? |
01:12:37 | Varriount | jpoirier: Yes, it should work... |
01:12:59 | jpoirier | nice |
01:23:02 | Araq | jpoirier: nope, it's completely broken |
01:23:16 | Araq | Pelles C is so buggy it's not funny |
01:23:37 | Araq | well maybe it's acceptable now, tried it years ago |
01:25:40 | def- | jpoirier: tcc works pretty well and compiles so fast |
01:26:26 | * | vqrs quit (Quit: Nettalk6 - www.ntalk.de) |
01:26:56 | jpoirier | Araq: Oh, didn't know that. Probably just stick with gcc on windows. |
01:27:25 | * | superfunc quit (Ping timeout: 246 seconds) |
01:27:42 | dtscode | def-, how is its optimizations? |
01:28:27 | def- | dtscode: terrible |
01:28:41 | dtscode | lame |
01:28:49 | def- | fine for quick debug builds for me |
01:29:48 | def- | for the lpath benchmark: gcc: 1881 ms, clang: 1459 ms, tcc: 4265 ms |
01:30:37 | def- | and compile times: gcc: 2.6 s, clang: 0.9 s, tcc: 0.3 s |
01:31:42 | Araq | too bad TCC sucks on windows |
01:31:51 | def- | why is that, Araq ? |
01:32:01 | Araq | otherwise we would have our winner for the REPL right there |
01:32:03 | flaviu | def-: How about clang without opts? |
01:32:07 | jpoirier | def-: yeah, tcc is really fast at compiling but I don't have a lot of faith in it. I hacked on it, on and off, for about a year at work. It is nice for doing some quick prototyping and stuff. |
01:32:53 | def- | i only found 3 problems with tcc so far out of hundreds of code pieces |
01:33:20 | Araq | def-: doesn't come with C headers and GCC's have some issues |
01:33:37 | def- | Araq: probably like the one I just posted as an issue |
01:34:06 | Araq | is that still maintained? |
01:34:15 | Araq | looked moribund the last time I looked at it |
01:34:30 | def- | new version 2013 |
01:34:31 | jpoirier | def-: I use CH (http://www.softintegration.com/products/chstandard/) to C repl stuff and run small files. Sorry, probably off topic. |
01:35:32 | def- | flaviu: clang without opts: 0.8 s compile, 7881 ms runtime |
01:35:52 | flaviu | Interesting, tcc still beats it. |
01:35:55 | def- | (but that's because of all the debug stuff in) |
01:36:06 | def- | i compiled with tcc and -d:release |
01:36:27 | Araq | TCC should beat it, clang builds an AST and TCC doesn't |
01:36:34 | def- | Araq: i can't imagine how a REPL would work with tcc though |
01:37:01 | Araq | def-: TCC exposes a trivial API to do that |
01:37:13 | Araq | like: runcode(char* code); |
01:37:27 | def- | maybe we should use that and get the bugs on windows fixed? |
01:38:55 | Araq | do it if you want to |
01:39:06 | Araq | compiler/tccgen.nim is still in the repo |
01:39:10 | def- | i think a working repl would be really useful |
01:39:33 | Araq | well the C codegen needs some "trivial" change to support a REPL |
01:39:50 | flaviu | <MyMind> what means that has value semantics? |
01:40:14 | flaviu | It means that when you do `let foo = @[]` you can't change it, but when you do `var foo = @[]`, you can. |
01:40:26 | Araq | accesses to globals need to happen via wrappers |
01:40:49 | Araq | so the state can be kept properly |
01:41:20 | MyMind | ic flaviu |
01:41:24 | MyMind | ty |
01:44:32 | jpoirier | concerning TCC, do you keep Nim's version in synch with http://repo.or.cz/w/tinycc.git |
01:47:25 | def- | oh, looks maintained |
01:47:53 | def- | even some windows fixes |
01:48:06 | def- | " tcc, libtcc: fix build on windows with latest mingw. " |
01:52:00 | jpoirier | yeah, they've done a pretty good job with it, platforms , architectures, compliance, etc... Arm support was okay, but limited, last time I used, which was about a year ago |
01:58:16 | Araq | so. I did it. c2nim can parse (basic) templates. |
01:59:07 | Araq | and no, it's not harder to parse than the rest of C / C++. |
01:59:22 | Araq | it's turtles all the way down |
02:02:59 | Varriount | Araq: Reference to Dr. Seuss? |
02:03:39 | Varriount | Araq: Java's long classpaths... help yet again: http://stackoverflow.com/questions/199130/how-do-i-increase-the-proc-pid-cmdline-4096-byte-limit?lq=1 |
02:05:12 | gokr1 | Is the Nim VM a dead end? |
02:05:22 | Varriount | gokr1: Huh? What do you mean? |
02:05:29 | gokr1 | For a REPL I mean |
02:05:49 | Araq | gokr1: yes. I think so. |
02:06:02 | gokr1 | Although I would rather see a full dev env with "Workspaces" in it etc :) |
02:06:26 | Araq | tinyC seems the old new way to go for a decent REPL |
02:07:19 | Varriount | gokr1: I believe Mat3 is working on something. |
02:08:02 | * | VinceAddons quit (Read error: Connection reset by peer) |
02:17:17 | Araq | good night |
02:21:22 | * | Sergio965 joined #nim |
02:26:02 | * | Trustable quit (Quit: Leaving) |
02:29:54 | Varriount | Hello Sergio965 |
02:30:02 | Sergio965 | Hello! |
02:31:00 | * | jadbox joined #nim |
02:31:03 | jadbox | hey folkd! |
02:31:23 | jadbox | I'm having an issue with enum matching |
02:31:37 | Varriount | jadbox: Oh? |
02:32:07 | jadbox | In http://pastebin.com/SWQke13X |
02:32:21 | jadbox | I'm getting: calc.nim(14, 4) Error: not all cases are covered |
02:32:23 | jadbox | yet |
02:32:27 | jadbox | looks like all the cases are met |
02:32:35 | jadbox | what am I missing? |
02:33:27 | jadbox | Pretty much only the top 25 lines are relevant in the pastebin I believe |
02:33:44 | Varriount | Let me see... |
02:34:01 | jadbox | I'm using the latest nim build from the git repo |
02:34:34 | EXetoC | might be a bug |
02:34:54 | willwillson | gokr1: did you see someone else was interested in petitparser? http://forum.nimrod-lang.org/t/722 |
02:35:38 | gokr1 | Ah, cool |
02:35:49 | jadbox | I was thinking it was a bug... odd that somehow I might have tripped it. |
02:35:51 | gokr1 | Yeah, i am hacking on it right now actually |
02:36:30 | willwillson | nice :) |
02:36:39 | xant1 | Isn't 1.0e9 one billion and not one million? http://nim-lang.org/tut1.html#numbers |
02:39:20 | * | yglukhov____ joined #nim |
02:39:56 | reactormonk | xant1, yeah, already fixed. |
02:39:56 | * | z1y joined #nim |
02:40:04 | * | z1y quit (Remote host closed the connection) |
02:40:21 | gokr1 | willwillson: Replied to him |
02:40:34 | jadbox | I even add an "else" to the case statement: still get "not all cases are covered" |
02:40:37 | Varriount | jadbox: Yeah, that's weird. I don't even know what's causing it. |
02:40:55 | willwillson | gokr1: who needs a mailing list... ;-) |
02:41:03 | def- | Hm, I guess this isn't a bug in tcc after all. rather gcc and clang don't behave according to IEEE 754: https://gist.github.com/def-/d86c40de803819d7d535 |
02:41:25 | Varriount | jadbox: Since I know for sure that there are other places in the standard library that use enums in case statements |
02:41:55 | jadbox | I've even added more enum vals and tried changing their names. No good.. |
02:42:16 | jadbox | (changing the names of the existing enum names) |
02:42:20 | reactormonk | xant1, it's somewhere in git, just hasn't made it to the website yet. |
02:42:32 | reactormonk | Araq, could you rebuild the website? |
02:42:45 | * | z1y joined #nim |
02:42:52 | Varriount | reactormonk: He just went to be. |
02:42:55 | Varriount | *bed |
02:43:03 | reactormonk | Varriount, tomorrow it is |
02:43:38 | * | yglukhov____ quit (Ping timeout: 244 seconds) |
02:49:05 | flaviu | Has anyone seen Marpa? It's a parsing algorithm and C library, and it's much more advanced than what is currently avalible. |
02:50:17 | flaviu | The C library is unfortunately not very user-friendly, it doesn't hide the complexity of how it works. |
02:51:05 | willwillson | jadbox: i think it is the comma in fkVar |
02:51:21 | willwillson | jadbox: try removing it |
02:53:12 | jadbox | yep, got it. It was also that I had an object that had the SAME field names for different cases on the enum. |
02:53:34 | jadbox | removing the comma and making each enum case field have a unique name worked |
02:53:58 | * | darkf joined #nim |
02:54:07 | willwillson | jadbox: the error message definitely needs some improvement ;-) |
02:54:28 | jadbox | I was really hoping that it was possible to have the same field names depending on the type :/ |
02:55:19 | jadbox | as it is, you can, but it has to be global for all instances of the object. I.e., you can't have the same field name for just two cases on the enum for the object. |
02:56:38 | renesac | jadbox: if you add the {.pure} pragma to the enum, it's fields aren't added to the current scope |
02:56:44 | jadbox | Otherwise with duplicate fields depending on the enum (even of the same type): Error: redefinition of 'value' |
02:56:53 | renesac | *{.pure.} |
02:56:56 | renesac | not sure if it helps |
02:58:09 | jadbox | renesac, doesn't help but it is nice to know |
03:01:14 | EXetoC | I don't know what you mean |
03:02:01 | * | saltylicorice quit (Ping timeout: 264 seconds) |
03:04:07 | EXetoC | ok for variant types. nope not possible |
03:05:21 | * | gokr1 quit (Quit: Leaving.) |
03:05:48 | EXetoC | since it doesn't quite work like in rust for example. you just refer to a field name |
03:16:04 | * | BitPuffin quit (Ping timeout: 245 seconds) |
03:18:55 | * | jadbox quit (Quit: Page closed) |
03:20:41 | * | tttt joined #nim |
03:31:02 | * | AMorpork is now known as ZzZMorpork |
03:32:37 | * | Sergio965 quit (Quit: Bye! :)) |
03:32:37 | * | Mimbus quit (Read error: Connection reset by peer) |
03:32:38 | * | flaviu quit (Read error: Connection reset by peer) |
03:35:20 | * | flaviu joined #nim |
03:41:14 | * | learningNim joined #nim |
03:41:57 | * | Sergio965 joined #nim |
03:45:18 | learningNim | Q: I'd like to modify a value in a Table in a child property of an object when I pass the parent object to a procedure. At the moment, I see this - Error: '[](a.tree, current).to' cannot be assigned to |
03:45:52 | def- | learningNim: pass the object as var? |
03:46:16 | learningNim | I pass the parent object as a 'var' |
03:46:35 | def- | can you show the code? |
03:46:40 | learningNim | sure, 1 sec |
03:46:43 | def- | as a gist or paste somewhere |
03:46:46 | learningNim | is pastebin fine? |
03:46:49 | def- | yes |
03:48:23 | * | willwillson quit (Ping timeout: 240 seconds) |
03:49:42 | learningNim | paste link: http://pastebin.com/gQyZH0DK |
03:51:07 | learningNim | I can't figure how to modify the 'to' Table inside the object on line 35 and similar on line 44 |
03:51:25 | def- | use .mget(current) instead of [current] |
03:51:31 | learningNim | i get ahocorasick.nim(35, 21) Error: for a 'var' type a variable needs to be passed |
03:51:38 | def- | then mget returns a var value, then you can modify it |
03:52:19 | learningNim | does the mget procedure return a modifyable value, as in a pointer or a reference ? |
03:52:23 | def- | yes |
03:52:25 | def- | http://nim-lang.org/tables.html#mget,CountTableRef[A],A |
03:52:29 | learningNim | ok I'll try it |
03:53:25 | learningNim | Ah, I see the documentation in tables.nim: ## retrieves the value at ``t[key]``. The value can be modified. |
03:54:51 | def- | for modification idenitifiers are generally prefixed with "m", there's also mvalues and mpairs |
03:55:21 | learningNim | ah, it worked- a.tree.mget(current).to[asInt] = path |
03:55:39 | learningNim | and the 'm' prefixed procedures now make a bit more sense. thanks |
04:02:07 | def- | that's a common gotcha though, I'm wondering if something can be done about that. |
04:02:56 | * | saml_ quit (Quit: Leaving) |
04:06:09 | Varriount | def-: I tried to talk to Araq about changing that. It would make more sense for it to be named something like 'varGet' |
04:06:33 | Varriount | 'm' is supposed to stand for 'mutable', but that's not really the first thing that comes to mind... |
04:07:39 | def- | Varriount: yes, sounds reasonable. what would go wrong if we just replaced [] with mget (and so on)? |
04:12:09 | * | BitPuffin joined #nim |
04:12:25 | renesac | here something I was working last year: https://gist.github.com/ReneSac/ff983a857dd56209d3bb |
04:12:59 | renesac | I stopped halfway, so there can be many functions wrong/incomplete there |
04:14:06 | renesac | and for some reason the assert on line #285 isn't working: |
04:14:09 | renesac | Error: type mismatch: got (int) but expected one of: system.assert(cond: bool, msg: string): stmt |
04:15:29 | renesac | ok, putting parenthesis around 16 >> 1 solves it |
04:16:08 | learningNim | the mutable part is more obvious now to me by looking at the proceude return type, 'var' being there instead of just the value |
04:17:19 | * | BitPuffin quit (Ping timeout: 245 seconds) |
04:17:41 | renesac | def-, Varriount : what you think? |
04:18:09 | renesac | it is much easier to translate C/java code that way |
04:18:32 | renesac | and most example code for bitwise operations use C conventions |
04:19:17 | renesac | of course, even then it is not a simple matter of copy and pasting, as the Celt's ilog2 function shows |
04:20:03 | * | z1y quit (Remote host closed the connection) |
04:20:09 | * | Demon_Fox quit (Quit: Leaving) |
04:21:10 | * | z1y joined #nim |
04:21:52 | def- | renesac: could be a library i guess, if people wantto work on bits like that |
04:22:15 | def- | the problem with >> is probably because it's handled as an arrow |
04:22:37 | def- | was recently added to make -> and => from future module work better |
04:23:37 | def- | that makes `>>` right associative |
04:25:24 | ldlework | so, after updating Nim just now, I get a SIGSEV for all my sdl/graphics apps |
04:26:35 | ldlework | I am sad |
04:26:38 | ldlework | no traceback |
04:27:08 | renesac | def-: uh... so my template magic don't work anymore? |
04:27:15 | ldlework | halp, https://gist.github.com/5bdaa5ce64e8a6fdda8c |
04:27:32 | def- | renesac: seems so |
04:27:32 | renesac | with templates I was capable of correcting the precedence of those operators in nimrod 0.9.4 |
04:27:42 | def- | i don't know |
04:28:03 | renesac | as it would be transformed to 'x shr y' before the precedence being computed |
04:28:04 | Varriount | ldlework: Did you use the traceback switch when compiling the compiler/apps? |
04:28:26 | * | yglukhov____ joined #nim |
04:28:35 | ldlework | Varriount: I didn't have to do that last time is that new? |
04:28:48 | ldlework | Varriount: I'm just using the instructions on the website, but with devel instead of master |
04:29:39 | Varriount | ldlework: I dunno. I thought I read in an issue that --stacktrace isn't on by default for debug builds on linux. |
04:30:09 | ldlework | o_o |
04:30:24 | Varriount | ldlework: Is that true, or did I read wrong? |
04:30:57 | ldlework | I don't know - do you know what issue you're referring to? |
04:31:24 | renesac | def-: your use of ^ as pow in the math library conflicts with my use of it as 'xor'... |
04:31:41 | renesac | but araq don't likes python's ** as pow... that would not conflict |
04:31:54 | def- | renesac: I like ^ more too |
04:32:22 | renesac | but then what to do with the poor 'xor'? :( |
04:32:32 | Varriount | :< |
04:32:32 | def- | I guess they chose ** in Python because ^ was used already. Luckily it's not in Nim |
04:32:44 | renesac | he wants a real operator too! |
04:32:58 | * | yglukhov____ quit (Ping timeout: 244 seconds) |
04:36:07 | ldlework | wow this is a wrench, man |
04:36:40 | ldlework | I can't run my programs anymore :'( |
04:38:39 | * | jefus_ joined #nim |
04:39:05 | ldlework | Varriount: I can't find any issue related to what might sound like what you were talking about |
04:40:27 | def- | ldlework: could you revert back to the last working commit for now? |
04:40:45 | ldlework | def-: I removed my Nim install thinking that some artifacts from upgrading or something |
04:40:56 | ldlework | so I did a clean install from devel, all my SDL apps SIGSEV |
04:41:06 | def- | do you have one of these apps somewhere? |
04:41:14 | ldlework | I could try reinstalling SDL |
04:41:20 | ldlework | but I have no idea why that would have broke |
04:42:28 | * | jefus quit (Ping timeout: 244 seconds) |
04:42:40 | ldlework | def-: https://github.com/dustinlacewell/lights-out.git |
04:44:37 | def- | to get the stracktrace i do ./koch temp c ~/git/lights-out/lightsout.nim |
04:44:46 | def- | crashes for me as well |
04:44:54 | def- | do you remember when it last worked? |
04:45:02 | ldlework | def-: jsudlow has a checkout that compiles it correctly |
04:45:12 | ldlework | I'm waiting for him to cough up the sha |
04:45:32 | ldlework | jsudlow: what's the git sha for your old checkout? |
04:45:38 | * | Demon_Fox joined #nim |
04:45:53 | jsudlow | ldlework: one sec let me log into the github |
04:45:54 | ldlework | (use git status) |
04:45:58 | ldlework | jsudlow: no |
04:46:02 | ldlework | your local install of Nim |
04:46:05 | ldlework | the one that works on the game |
04:46:08 | ldlework | go in there |
04:46:10 | ldlework | and type |
04:46:13 | ldlework | git status |
04:46:20 | ldlework | tell us what commit you're on |
04:46:28 | jsudlow | e63387d08dd9b9fe3af31ed55c89f55dc4736db1 |
04:46:44 | jsudlow | thats the last sha commit to my repo |
04:46:57 | ldlework | jsudlow: for Nim? |
04:46:59 | ldlework | or our game? |
04:47:21 | jsudlow | oh one sec |
04:47:23 | ldlework | jsudlow: we want to know the last commit where Nim didn't break our game |
04:47:31 | jsudlow | ldlework: sorry let me get that for you |
04:48:22 | jsudlow | ldlework: when I say git status in the nim directory that correctly runs the game it does not give me the sha |
04:48:41 | jsudlow | ~/Nim/bin$ git status |
04:48:41 | jsudlow | On branch devel |
04:48:41 | jsudlow | Your branch is up-to-date with 'origin/devel'. |
04:48:41 | jsudlow | Untracked files: |
04:48:41 | jsudlow | (use "git add <file>..." to include in what will be committed) |
04:48:42 | jsudlow | ../csources/ |
04:48:44 | jsudlow | nothing added to commit but untracked files present (use "git add" to track) |
04:49:27 | def- | jsudlow: "git log" and look at the top |
04:49:55 | jsudlow | commit 010b8f85c73671782de956c9dcd2cb3e8441041e |
04:49:55 | jsudlow | Merge: caf2f6e 32db679 |
04:49:55 | jsudlow | Author: Araq <[email protected]> |
04:49:55 | jsudlow | Date: Fri Dec 26 22:43:40 2014 +0100 |
04:49:56 | jsudlow | Merge branch 'devel' of https://github.com/Araq/Nimrod into devel |
04:50:53 | jsudlow | ldlework: thats the date when I pulled so I suppose you could go back to that date |
04:50:59 | ldlework | trying now |
04:51:02 | jsudlow | ldlework: and maybe walk the commits forward until it breaks? |
04:51:03 | def- | Crashes for me, but with an error in random |
04:51:04 | * | vendethiel quit (Ping timeout: 245 seconds) |
04:51:20 | ldlework | def-: heh how did you recompile Nim so fast |
04:51:30 | def- | ./koch temp c ~/git/lights-out/lightsout.nim |
04:51:37 | def- | faster than a full build |
04:51:41 | ldlework | def-: after checking out the commit? |
04:51:46 | def- | yes |
04:51:53 | ldlework | I have no idea what that does then :P |
04:51:57 | ldlework | "magic"? |
04:52:11 | ldlework | the game runs for me |
04:52:13 | ldlework | on this commit |
04:52:16 | ldlework | when I do a full build |
04:52:21 | def- | "creates a temporary compiler for testing" |
04:53:28 | def- | I have to go, good night |
05:10:05 | * | z1y quit (Remote host closed the connection) |
05:10:32 | * | z1y joined #nim |
05:16:01 | * | saltylicorice joined #nim |
05:22:28 | * | learningNim quit (Quit: Page closed) |
05:30:05 | * | z1y quit (Remote host closed the connection) |
05:30:53 | * | saltylicorice quit (Ping timeout: 265 seconds) |
05:30:54 | * | z1y joined #nim |
05:36:20 | * | kapil__ joined #nim |
05:41:16 | * | yglukhov____ joined #nim |
05:56:42 | * | z1y quit (Remote host closed the connection) |
05:57:46 | * | z1y joined #nim |
06:01:33 | * | BitPuffin joined #nim |
06:05:34 | * | yglukhov____ quit (Quit: Be back later ...) |
06:06:39 | * | BitPuffin quit (Ping timeout: 265 seconds) |
06:08:23 | * | xant1 quit (Ping timeout: 240 seconds) |
06:39:48 | * | gour joined #nim |
06:46:47 | * | z1y1 joined #nim |
06:47:53 | * | z1y quit (Ping timeout: 240 seconds) |
06:56:51 | * | gour quit (Remote host closed the connection) |
07:00:35 | * | nande quit (Remote host closed the connection) |
07:10:58 | * | gour joined #nim |
07:42:47 | * | Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:50:16 | * | BitPuffin joined #nim |
07:54:52 | * | BitPuffin quit (Ping timeout: 245 seconds) |
08:00:16 | * | yglukhov____ joined #nim |
08:08:21 | * | vendethiel joined #nim |
08:08:37 | * | ARCADIVS joined #nim |
08:09:01 | * | infrashortfoo joined #nim |
08:40:19 | * | SplinterOfChaos quit (Ping timeout: 255 seconds) |
08:47:56 | * | rainkin joined #nim |
08:50:28 | * | rainkin quit (Remote host closed the connection) |
08:52:18 | * | hakand__ joined #nim |
09:17:20 | * | hakand__ quit (Ping timeout: 244 seconds) |
09:19:53 | * | BlaXpirit joined #nim |
09:27:27 | * | vendethiel quit (Ping timeout: 256 seconds) |
09:29:47 | Triplefox | .eval var bad = array[1,int] |
09:30:06 | * | z1y1 quit (Remote host closed the connection) |
09:30:21 | Triplefox | ah, gone |
09:30:43 | * | z1y joined #nim |
09:31:31 | dtscode | lol can it only have one value? |
09:32:21 | * | vendethiel joined #nim |
09:32:24 | Triplefox | it gives a terrible error message |
09:32:34 | Triplefox | internal error: GetUniqueType |
09:32:56 | Triplefox | the correct syntax is var good : array[1,int] |
09:33:55 | Triplefox | (there are some issues already involving that error message) |
09:34:16 | dtscode | oh wait, yeah, you couldnt do that |
09:35:52 | Triplefox | ah yeah, it's been mentioned already here https://github.com/Araq/Nim/issues/1131 |
09:39:02 | * | BitPuffin joined #nim |
09:39:33 | * | repax joined #nim |
09:43:21 | * | hasenj joined #nim |
09:43:54 | * | Sphax joined #nim |
09:44:27 | * | BitPuffin quit (Ping timeout: 264 seconds) |
09:49:46 | * | vendethiel quit (Ping timeout: 250 seconds) |
09:50:19 | * | bjz joined #nim |
09:51:33 | * | kapil__ quit (Quit: Connection closed for inactivity) |
09:52:23 | * | SplinterOfChaos joined #nim |
09:55:27 | * | bjz quit (Read error: Connection reset by peer) |
10:01:15 | * | dyu joined #nim |
10:05:23 | * | ARCADIVS quit (Quit: ARCADIVS) |
10:08:45 | Triplefox | what is the equivalent of the C stdio.h "NULL" (for passing to a C api) |
10:10:05 | brson | i heard that nim does something like ccache during its bootstrap to avoid rebuilds across stages. does anybody have an approximate idea of what the hit rate is? I imagine it's often pretty high, making a really fast bootstrap |
10:10:10 | brson | re https://www.reddit.com/r/rust/comments/2rgjbr/nims_compile_times/ |
10:10:20 | brson | that's a pretty sweet advantage of having a c backend |
10:10:55 | * | gokr joined #nim |
10:12:28 | brson | what percentage of compile time does nim typically spend in the 'backend' (gcc)? |
10:14:51 | Triplefox | my rough estimate on this little demo project i'm working on is 50%, but that's of a total compile time of like four seconds |
10:15:03 | * | gokr_ quit (Ping timeout: 264 seconds) |
10:17:05 | ekarlso- | Triplefox: what's your project = |
10:17:47 | Triplefox | opengl stuff, right now stuck on making things display with vertex array objects |
10:18:03 | * | bjz joined #nim |
10:21:07 | brson | Triplefox: thanks |
10:24:57 | EXetoC | Triplefox: nil |
10:25:48 | Triplefox | aha, that fixed everything |
10:26:48 | Triplefox | (sigh, hours of effort to narrow down the possibilities to a simple question) |
10:27:44 | * | gokr quit (Ping timeout: 245 seconds) |
10:33:49 | Araq | brson: the hit rate is actually quite horrible, but it's rather easy to fix and planned for after 1.0 ("deterministic C code generation") |
10:35:03 | Araq | also we do something in the lines of 'make -j8', so you more cores you have the more time is spent in the Nim compiler |
10:35:43 | Araq | as that only uses a single core |
10:39:31 | * | gokr joined #nim |
10:40:05 | * | z1y quit (Remote host closed the connection) |
10:40:23 | brson | Araq: thanks for the info! |
10:40:39 | * | z1y joined #nim |
10:46:58 | ekarlso- | hmm |
10:47:09 | ekarlso- | for the package index thing, should licenses be predefined in a database ? |
10:51:08 | Araq | ekarlso-: if you allow for "custom" licenses too |
10:51:41 | ekarlso- | Araq: atm it's you add whatever you want :) |
10:51:59 | Araq | that's good enough for me |
10:52:30 | ekarlso- | as in a admin adds a license to the system |
10:52:34 | MyMind | anybody wrote / ported a path tracer to nim ? http://www.kevinbeason.com/smallpt/ |
10:52:48 | ekarlso- | it shows up in the selection when creating a package Araq |
10:53:18 | ekarlso- | Araq: I was wondering if we could somehow use it to make a license dep graph in nimble or smth |
10:53:25 | ekarlso- | like npm / node has |
10:53:55 | ekarlso- | http://imgur.com/HiQbw2L < there's the license admin bit atm |
11:01:28 | ekarlso- | package stuff is becoming more and more advanced :/ |
11:07:43 | * | gokr_ joined #nim |
11:07:55 | * | Matthias247 joined #nim |
11:10:06 | * | z1y quit (Remote host closed the connection) |
11:10:46 | * | jm116 joined #nim |
11:10:51 | * | z1y joined #nim |
11:10:51 | * | gokr quit (Ping timeout: 264 seconds) |
11:18:47 | * | BlaXpirit quit (Quit: Quit Konversation) |
11:20:32 | * | BlaXpirit joined #nim |
11:24:31 | * | jm116 quit (Changing host) |
11:24:31 | * | jm116 joined #nim |
11:24:51 | * | BitPuffin joined #nim |
11:30:00 | * | BitPuffin quit (Ping timeout: 265 seconds) |
11:30:19 | * | Trustable joined #nim |
11:35:12 | * | VinceAddons joined #nim |
11:40:54 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
11:43:30 | * | Sphax quit (Quit: ZZZZZzzzzz) |
11:47:59 | * | kapil__ joined #nim |
11:53:38 | * | gokr joined #nim |
11:54:12 | * | bjz quit (Ping timeout: 244 seconds) |
11:54:30 | * | bjz joined #nim |
11:55:26 | * | gokr_ quit (Ping timeout: 250 seconds) |
11:55:26 | * | yglukhov____ quit (Read error: Connection reset by peer) |
11:55:34 | * | yglukhov____ joined #nim |
11:57:07 | * | repax_ joined #nim |
11:59:00 | * | z1y quit (Ping timeout: 265 seconds) |
11:59:34 | * | nickles joined #nim |
11:59:38 | def- | Araq: /names |
11:59:42 | def- | oops |
11:59:56 | def- | Araq: I still don't get how to do the TCC REPL stuff |
12:00:09 | Araq | I'll tell you later |
12:00:12 | * | repax quit (Ping timeout: 250 seconds) |
12:01:04 | * | nickles quit (Client Quit) |
12:01:35 | def- | alright, tried it out a bit here, but couldn't get anything interesting working yet: https://github.com/def-/Nim/blob/tcc-repl/compiler/tccgen.nim#L77-L88 |
12:01:44 | def- | at least the most recent tcc works now |
12:07:51 | * | BitPuffin joined #nim |
12:23:51 | * | bjz quit (Ping timeout: 244 seconds) |
12:31:34 | * | ZzZMorpork is now known as AMorpork |
12:37:32 | * | Sphax joined #nim |
12:41:31 | * | BitPuffin quit (Ping timeout: 255 seconds) |
12:44:37 | * | bjz joined #nim |
12:49:04 | * | gokr_ joined #nim |
12:51:54 | * | gokr quit (Ping timeout: 245 seconds) |
12:53:09 | Araq | def-: so what's the concrete question? for a REPL all that counts is that you keep the state in global vars properly. you can pointlessly recompile all of the generated code, nobody can tell the difference |
12:53:55 | def- | Let me try that |
12:53:59 | * | bjz quit (Ping timeout: 245 seconds) |
12:55:10 | Araq | note that you cannot really use 'nim i' as a starting point as that doesn't pointlessly recompile |
12:57:24 | * | willwillson joined #nim |
12:58:41 | def- | Araq: How would I keep the state of global vars then? |
13:00:30 | Araq | you need to translate 'someGlobal' to getGlobalMemory("someGlobale", sizeof(typeof(someGlobal))) and then tell TinyC that 'getGlobalMemory' comes from some DLL |
13:01:29 | Araq | the provider of 'getGlobalMemory' can be the nim.exe itself. On Windows at least, I think ELF supports that too |
13:02:32 | Araq | so you need to touch the C codegen, but it doesn't seem too hard to do |
13:05:06 | Araq | getGlobalMemory(key, size) needs to alloc the memory if it doesn't know about key yet, otherwise it needs to return its previous pointer ... hrm that also needs GC support. fun. |
13:06:05 | * | z1y joined #nim |
13:12:54 | Araq | but for a start you can only care about globals that don't contain GC'ed memory |
13:13:06 | kokozedman | I'm trying to create a hash() proc for a C struct, and I'm not really sure what's in it, but what I want to do is to hash its bytes content |
13:13:32 | kokozedman | how can I do that? give the fact that the object will not be passed in as 'var', so, I can't get its address |
13:14:19 | Araq | kokozedman: ah that's a good point. I think you have to use .emit for now then |
13:14:47 | Araq | var p: pointer |
13:14:49 | kokozedman | I was trying hashData(addr x, sizeof(CStruct)) but got 'expression has no address' |
13:15:07 | Araq | {.emit: "`p` = &`x`;.} |
13:15:17 | Araq | hashData(p, size) |
13:15:35 | kokozedman | Araq: well, I'm new to that construct ... when did that happen? |
13:15:55 | Araq | it's been there since forever but we discourage its usage |
13:16:24 | kokozedman | hmm... hence it's not in the manual |
13:16:43 | Araq | no, it's in nimc.html instead |
13:16:59 | Araq | the manual doesn't list every pragma, for better or worse |
13:17:13 | kokozedman | ah, ok |
13:17:33 | * | vendethiel joined #nim |
13:18:17 | * | meanfish joined #nim |
13:19:23 | ramnes | where is the source code of nim-lang.org homepage? |
13:19:29 | ramnes | cause © 2014 |
13:20:37 | * | bjz joined #nim |
13:20:39 | Araq | $nim/tools/website.tmpl |
13:20:59 | Araq | and yes, I know it's horrible, but I had to hack it together |
13:21:22 | ramnes | lol Araq :D |
13:22:17 | Araq | ramnes: the content (except the snippets) is in web/*.txt though |
13:23:37 | ramnes | ^M everywhere, argh |
13:24:07 | Araq | that's just your editor though. might want to get one that was released after 1940. |
13:26:46 | ramnes | well, not my fault if there is two differents line ending styles |
13:27:12 | Araq | it's your fault when you even notice :P |
13:27:56 | ramnes | I'm using a Unix-like OS, so I stick with Unix style :) |
13:28:17 | Araq | btw it was Unix which introduced the alternative line ending style |
13:29:03 | Araq | they couldn't abstract over \n. Or maybe they didn't want to. |
13:31:25 | * | ahc joined #nim |
13:33:55 | * | meanfish quit (Ping timeout: 244 seconds) |
13:37:00 | Araq | def-: I'd prefer if you work on idetools though. MUCH more important than a REPL. |
13:39:26 | * | vendethiel quit (Ping timeout: 250 seconds) |
13:41:40 | * | bjz quit (Read error: Connection reset by peer) |
13:44:32 | * | bjz joined #nim |
13:48:08 | ekarlso- | if anyone has some webdesign experience I would like some help with the packages stuff :) |
13:48:37 | * | _meanfish joined #nim |
13:51:15 | * | vendethiel joined #nim |
13:54:02 | * | bjz quit (Ping timeout: 245 seconds) |
13:57:23 | * | minciue joined #nim |
14:02:34 | * | irrequietus joined #nim |
14:06:12 | ramnes | Araq: about line endings, I don't care about what line ending should be use, but it should be consistent |
14:06:26 | ramnes | right now two differents styles are in the same file |
14:06:39 | ramnes | it's ugly as hell |
14:06:57 | Araq | so fix it in your PR |
14:07:11 | ramnes | recursively on the whole repo? |
14:07:26 | Araq | no, just for the file you touch |
14:07:32 | ramnes | alright |
14:07:58 | Araq | also, things like readme.txt should have windows line endings for the windows users who open with notepad |
14:08:43 | Araq | also I don't consider things "ugly" that I don't even see ... |
14:09:52 | ramnes | well, those line endings can break things on Unix systems |
14:09:58 | ramnes | so I prefere seeing them :) |
14:10:23 | ramnes | just try a bash script that start with a shebang like #!/bin/bash^M |
14:10:39 | Araq | that's just a bash bug |
14:11:49 | ramnes | lulz |
14:11:52 | def- | Araq: I don't know, I've never used an IDE. Don't even know what idetools does |
14:15:48 | Araq | you never used an IDE? o.O |
14:16:07 | ekarlso- | Araq: does aporia work with trunk nim ? |
14:16:21 | ramnes | Araq: I've never neither |
14:16:32 | Araq | that implies they didn't make you program Java with Eclipse |
14:16:37 | ramnes | I mean, emacs do more than any so-called IDE |
14:16:51 | ramnes | I used emacs for java |
14:17:00 | Araq | lol |
14:17:00 | ramnes | even for android java |
14:17:48 | Araq | well vim with plugins and emacs do count as IDEs for me |
14:18:11 | Araq | def-: what editor do you use? |
14:18:25 | ramnes | I don't see the point of using an IDE that needs gigs of RAM and using a mouse when you can do everything without leaving your keyboard, without X, and with less memory |
14:18:43 | Araq | chances are ... we have a plugin for it and its idetools is broken for it |
14:18:47 | * | nickles joined #nim |
14:19:09 | def- | Araq: vim. and for big projects ctags plugin to jump to definition |
14:19:35 | Araq | def-: I'm sure zahary has a vim plugin that uses idetools |
14:19:42 | ramnes | Araq: do you want 2014 - 2015 as © in all your headers, or just 2015, or I don't touch it? |
14:19:59 | Araq | ramnes: just 2015 |
14:20:41 | * | jez0990_ quit (Quit: No Ping reply in 180 seconds.) |
14:22:09 | nickles | Are there any considerations to implement a static dictionary type like in Perl (i.e. not being dependent on {..}.toTable)? |
14:22:33 | * | jez0990 joined #nim |
14:23:46 | ramnes | so many trailing whitespaces in the code also |
14:24:24 | ramnes | but "we don't see it so we don't care" ® |
14:24:25 | ramnes | :p |
14:24:55 | * | hasenj quit (Quit: hasenj) |
14:26:38 | * | bjz joined #nim |
14:26:45 | * | gmpreussner joined #nim |
14:30:52 | ekarlso- | flaviu: sorry for the delay ;) |
14:32:08 | ramnes | Araq: there you go https://github.com/Araq/Nim/pull/1889 |
14:33:23 | * | willwillson quit (Ping timeout: 240 seconds) |
14:33:29 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:34:17 | * | arekzb joined #nim |
14:34:47 | nickles | Araq: Are there any considerations to implement a static dictionary type like in Perl (i.e. not being dependent on {..}.toTable)? |
14:35:47 | Araq | nickles: no. lots of thought was put into this current design |
14:37:52 | Araq | nickles: but of course, if you come up with a proposal that we like better, we will consider it |
14:38:22 | ramnes | also Araq, you should fetch/rebase instead of merging from origin to your repo, it would avoid useless commits |
14:38:32 | nickles | Araq: When is the conversion with toTable done - at run time? |
14:39:28 | Araq | nickles: yes but in the future not necessarily |
14:40:57 | * | nickles quit (Quit: Page closed) |
14:44:01 | ekarlso- | Araq: does a proc need to have a return type ? |
14:45:07 | Araq | ekarlso-: no, and I wish I knew why people write ': void' everywhere, so pointless |
14:45:28 | ekarlso- | Araq: so proc foo(): ? |
14:45:48 | ekarlso- | ehm : > = |
14:45:52 | gmpreussner | ekarlso-: no colon |
14:45:52 | gmpreussner | proc foo() = ... |
14:48:57 | * | gkoller joined #nim |
14:50:44 | * | Varriount|Mobile joined #nim |
14:52:05 | * | bjz quit (Read error: Connection reset by peer) |
14:52:42 | ekarlso- | So for any web api folks here |
14:54:32 | ekarlso- | when creating a package in the packages api, a License is stored in the db (like MIT, Apache etc), when posting to the api should the license be referenced as {"license": "MIT"} or {"license_id": 1} ? |
14:54:32 | ekarlso- | from the single page app a dropdown is shown, u select the license and it doesn't matter anyways |
14:55:15 | Araq | ekarlso-: don't expose License ids |
14:55:54 | ekarlso- | Araq: juist names ? ^ |
14:56:05 | Araq | ekarlso-: yeah |
14:56:18 | ekarlso- | I guess I can just make the license name the ID instead since it should be unique |
14:56:36 | ekarlso- | like here: http://licenses.opendefinition.org/licenses/groups/all.json |
14:59:20 | MyMind | which is the oldest C that needs Nim in order to compile? |
15:01:13 | * | vendethiel quit (Ping timeout: 265 seconds) |
15:01:35 | ekarlso- | Does anyone have a preference on a max package name lengtH? |
15:04:45 | * | dyu quit (Quit: Leaving) |
15:04:56 | * | vendethiel joined #nim |
15:05:03 | * | dyu joined #nim |
15:06:24 | * | bjz joined #nim |
15:07:13 | EXetoC | 64? |
15:09:16 | Araq | MyMind: nobody knows |
15:09:58 | MyMind | I have an old SGI around and I was wondering if it would compile on IRIX |
15:11:32 | * | gkoller quit (Quit: Page closed) |
15:13:21 | dom96 | ekarlso-: Please make sure you disallow the @ character in package names. |
15:14:42 | Araq | hi dom96 |
15:14:54 | dom96 | hey Araq |
15:15:04 | dom96 | What's up? |
15:15:12 | * | ahc quit (Ping timeout: 250 seconds) |
15:15:18 | ekarlso- | god illegal storage access is so annoying... |
15:15:22 | ekarlso- | is there any way to get where it blows ? |
15:15:39 | Araq | ekarlso-: I always get a stack trace |
15:15:57 | Araq | dom96: having fun teaching c2nim about NEP1 |
15:16:56 | * | jpoirier quit (Quit: Leaving) |
15:17:54 | ekarlso- | sqlite.. |
15:18:05 | ekarlso- | always forgetting the fk pragma |
15:18:27 | Araq | ekarlso-: looked at db_sqlite, you should use "" intead of nil for now |
15:19:07 | ekarlso- | Araq: yeah, but that's not the same effect -,,- |
15:19:12 | ekarlso- | and it's the same for mysql too :D |
15:19:30 | Araq | for mysql it should work |
15:19:39 | dom96 | Araq: Cool. |
15:19:59 | dom96 | I need to start studying for my exams unfortunately. |
15:20:07 | dom96 | But after them i'll have like a week off :) |
15:20:40 | dom96 | bbl |
15:21:17 | * | saml joined #nim |
15:21:28 | ekarlso- | Araq: I was using db_mysql before sqlite (someone in here nudged me off of it) and I think it didn't |
15:21:34 | ekarlso- | Araq: never the less I can verify that in a bit |
15:22:32 | * | bjz quit (Read error: Connection reset by peer) |
15:22:56 | * | bjz joined #nim |
15:26:53 | * | bjz quit (Max SendQ exceeded) |
15:27:34 | * | vendethiel quit (Ping timeout: 255 seconds) |
15:27:41 | * | bjz joined #nim |
15:29:56 | * | eigenlicht joined #nim |
15:31:29 | * | gokr joined #nim |
15:31:44 | ekarlso- | dom96: why never allow @ ? |
15:31:44 | ekarlso- | :D |
15:33:02 | dom96 | ekarlso-: Because that's how you specify versions when installing packages in nimble: nimble install [email protected] |
15:33:08 | dom96 | bbl for real |
15:37:23 | * | vendethiel joined #nim |
15:43:50 | * | BitPuffin joined #nim |
15:45:25 | * | z1y quit (Ping timeout: 256 seconds) |
15:48:24 | MyMind | Araq: the link to twitter is not correct http://nim-lang.org/community.html |
15:48:57 | * | rpag joined #nim |
15:49:02 | Araq | what's the correct link? |
15:49:09 | * | rpag quit (Remote host closed the connection) |
15:49:30 | MyMind | nim_lang |
15:49:42 | MyMind | https://twitter.com/nim_lang |
15:50:10 | MyMind | is @nimlang is an 84 old man with a single tweet |
15:50:29 | MyMind | https://twitter.com/nimlang |
15:51:34 | * | kapil__ quit (Quit: Connection closed for inactivity) |
15:53:27 | * | gokr_ quit (Ping timeout: 264 seconds) |
15:53:47 | * | gokr_ joined #nim |
15:54:39 | * | bjz quit (Ping timeout: 264 seconds) |
15:57:23 | * | darkf quit (Quit: Leaving) |
15:58:58 | * | vendethiel quit (Ping timeout: 250 seconds) |
16:01:06 | * | bjz joined #nim |
16:02:19 | * | gokr_ quit (Ping timeout: 245 seconds) |
16:02:49 | * | ahc joined #nim |
16:03:03 | * | gokr_ joined #nim |
16:06:24 | * | goobles joined #nim |
16:12:07 | * | hasenj joined #nim |
16:13:53 | * | bjz quit (Ping timeout: 240 seconds) |
16:22:00 | * | repax_ quit (Quit: repax_) |
16:23:39 | EXetoC | `ref` broke at some point? |
16:25:14 | EXetoC | nm |
16:31:20 | * | bjz joined #nim |
16:34:23 | * | jpoirier joined #nim |
16:35:04 | EXetoC | I mean, nvm |
16:38:07 | BlaXpirit | MyMind, 87 probably by now :| |
16:38:43 | * | jefus__ joined #nim |
16:39:13 | * | Jesin quit (Read error: Connection reset by peer) |
16:39:47 | * | vendethiel joined #nim |
16:41:29 | * | Var|Mobile joined #nim |
16:42:39 | * | jefus_ quit (Ping timeout: 256 seconds) |
16:42:49 | * | bjz quit (Read error: Connection reset by peer) |
16:43:50 | * | willwillson joined #nim |
16:45:30 | * | Jesin joined #nim |
16:45:37 | * | Varriount|Mobile quit (Ping timeout: 265 seconds) |
16:52:16 | * | bjz joined #nim |
16:52:18 | * | nande joined #nim |
16:55:22 | * | repax joined #nim |
17:01:13 | * | infrashortfoo quit (Remote host closed the connection) |
17:22:27 | * | infrashortfoo joined #nim |
17:22:39 | * | bjz quit (Read error: Connection reset by peer) |
17:22:47 | * | bjz_ joined #nim |
17:25:22 | * | yglukhov____ quit (Ping timeout: 240 seconds) |
17:33:30 | BlaXpirit | At which points whould I change package's version in *.nimble in git repository? |
17:33:39 | * | Matthias247 joined #nim |
17:34:00 | BlaXpirit | It seems strange to keep the old version in commits after a release |
17:34:10 | BlaXpirit | and changing it right away could be harmful too |
17:34:26 | BlaXpirit | Nimble does not accept "x.x.x-dev" versions or any other such business |
17:34:52 | BlaXpirit | which is an issue actually. the whole SemVer thing is important to support |
17:39:14 | BlaXpirit | i've heard that tags can be used, but the question is still valid |
17:40:45 | BlaXpirit | well... nimble itself seems to change version simultaneously to tag, which seems like the only good option |
17:43:23 | * | dyu quit (Quit: Leaving) |
17:54:01 | * | bjz_ quit (Read error: Connection reset by peer) |
17:56:41 | minciue | BlaXpirit: I think changing the version in sync with new tag is the way to go |
17:56:54 | * | bjz joined #nim |
17:57:59 | minciue | hyphenation is supposed to be used for “pre release” stuff (generally the only ones I’ve seen are alpha, beta or pre) |
17:58:00 | * | Sphax quit (Quit: ZZZZZzzzzz) |
17:58:37 | ldlework | When you have a generic type, can you provide procs for discriminator specific types? |
18:01:07 | BlaXpirit | ldlework, yes |
18:01:40 | BlaXpirit | type B* = A[int] ## lol |
18:01:54 | ldlework | BlaXpirit: ah so you can't define it without creating an alias? |
18:02:09 | BlaXpirit | oh you said procs |
18:02:14 | BlaXpirit | i read "docs" -_- |
18:02:22 | BlaXpirit | then probably no, you can't |
18:02:50 | dtscode | love it when nim cant find my .cfg file |
18:03:12 | ldlework | BlaXpirit: well it seems like your solution would work for procs too |
18:03:19 | ldlework | seems like it'd be okay to define a proc for B, there |
18:03:42 | ldlework | actually, I think you can specify procs for things like seq[int] |
18:03:49 | ldlework | so I think the answer is yes, you can |
18:03:55 | BlaXpirit | i definitely misunderstood a lot here... |
18:04:25 | ldlework | sorry |
18:04:49 | BlaXpirit | proc test(x: A[int]) = discard totally works |
18:04:57 | ldlework | yeah |
18:04:58 | ldlework | thanks :) |
18:06:30 | * | jefus__ is now known as jefus |
18:06:38 | BlaXpirit | or does it |
18:06:49 | BlaXpirit | yes... lol |
18:07:05 | ldlework | lol |
18:07:16 | BlaXpirit | no |
18:08:02 | EXetoC | ? |
18:08:11 | BlaXpirit | ldlework, https://bpaste.net/show/7af77815c315 |
18:08:56 | ldlework | lame |
18:08:57 | EXetoC | why did you say no? |
18:09:05 | BlaXpirit | EXetoC, see link |
18:09:20 | BlaXpirit | and initially I said no because I misread and was confused |
18:09:38 | EXetoC | ok |
18:09:41 | EXetoC | ldlework: lame? |
18:09:46 | BlaXpirit | well isn't it? |
18:10:29 | BlaXpirit | that 2nd proc is never called, it seems |
18:10:41 | kokozedman | for the tables, what is the difference between paris and mpairs in terms? I know it is mentioned that the mpairs returns a modifiable, is that related to the original stored object in the table? |
18:11:07 | EXetoC | right |
18:11:09 | kokozedman | I'd like to have a loop, and modify the stored element during the loop |
18:12:52 | ldlework | EXetoC: do you understand why its lame? |
18:12:55 | EXetoC | kokozedman: by iterating over the indices, for now |
18:13:19 | EXetoC | ldlework: yes. it works in simpler cases |
18:13:40 | ldlework | EXetoC: simpler than that? |
18:13:40 | kokozedman | EXetoC: oh, I see ... so I got it all wrong then |
18:14:33 | * | bjz quit (Ping timeout: 265 seconds) |
18:15:14 | EXetoC | kokozedman: I think we'll get mitems iterators at some point |
18:16:03 | EXetoC | ldlework: yes, when the parameter is just 'T' |
18:17:28 | dtscode | hey dom96 i upgraded my nim compiler, and now when i run nimbus, it says error 404: not found when creating gists |
18:17:46 | BlaXpirit | EXetoC, you think it's worth an issue? |
18:18:00 | EXetoC | of type 'T' that is, rather than X[T] or something like that |
18:18:02 | EXetoC | BlaXpirit: I think so |
18:18:11 | BlaXpirit | will do |
18:19:14 | kokozedman | EXetoC: I'm not following ... let's say I want to modify the stored value on the table, let's say table[key] = object; and object has different properties: is modifying the object yeilded by table.mvalues going to modify the reference in the table? in other words, is the entries stored in the table and the entries returned by mvalues the same? |
18:21:08 | kokozedman | it seems to me, that mvalues return a plain var (in situation where one needs a var instead of a normal variable) |
18:21:24 | * | bjz joined #nim |
18:21:36 | kokozedman | that var seems to be a value copied from the table, not a reference |
18:21:41 | kokozedman | am I right? |
18:22:48 | * | gour_ joined #nim |
18:23:04 | * | Var|Mobile quit (Ping timeout: 255 seconds) |
18:26:04 | * | gour quit (Ping timeout: 245 seconds) |
18:31:12 | ekarlso- | flaviu: u up ? |
18:34:12 | * | yglukhov____ joined #nim |
18:35:51 | Trustable | Hi all, can someone explain the compiler warning "use RootObj instead; TObject is deprecated [Deprecated]" ? |
18:40:36 | BlaXpirit | Trustable, means exactly that |
18:40:45 | BlaXpirit | replace TObject in your code with RootObj |
18:41:12 | BlaXpirit | because the T s are going away |
18:41:37 | Trustable | ok, works, then the documentation is outdated |
18:41:53 | Trustable | thanks BlaXpirit |
18:42:02 | ldlework | Trustable: please help and send a pull request for the docs |
18:42:21 | BlaXpirit | tobject appears once in the manual |
18:42:22 | * | goobles quit (Ping timeout: 246 seconds) |
18:42:44 | ldlework | easy fix then |
18:42:53 | BlaXpirit | and many times in tutorial :< |
18:43:04 | BlaXpirit | just 6 in tut2 |
18:44:03 | EXetoC | kokozedman: it returns a var, so it shouldn't copy |
18:44:29 | EXetoC | set it to some value and see what happens |
18:46:13 | * | rpag joined #nim |
18:48:12 | Trustable | The documentation in the repo is already updated, but not deployed to the website. I think the website needs updates also between releases. |
18:52:34 | * | bjz quit (Read error: Connection reset by peer) |
18:53:07 | * | adam_s joined #nim |
19:01:08 | * | bjz joined #nim |
19:06:58 | * | adam_s quit (Quit: Leaving) |
19:13:41 | onionhammer | anyone know of a way to generate a unique identifier? |
19:13:47 | onionhammer | within a macro |
19:15:04 | * | bjz quit (Ping timeout: 264 seconds) |
19:15:11 | BlaXpirit | that... is interesting |
19:15:17 | BlaXpirit | and should be part of the language |
19:15:42 | onionhammer | i dont mean a GUID, i mean generate a unique ident name |
19:15:58 | Araq | onionhammer: gensym? |
19:16:15 | onionhammer | Araq can you give an example? I tried it but couldnt figure out how to actually *use* it |
19:16:32 | BlaXpirit | cooool stuff |
19:16:32 | onionhammer | i.e. what I want is var myIdent = genSym() |
19:16:44 | onionhammer | and then I can use myIdent as a var name |
19:16:47 | onionhammer | or something |
19:17:48 | Araq | it works like you wrote |
19:18:00 | * | rpag quit (Quit: Leaving) |
19:19:46 | onionhammer | Error: internal error: (filename: sem.nim, line: 163) |
19:20:13 | onionhammer | how do i get the name genSym generates? |
19:20:45 | Araq | onionhammer: dude pass the proper symbol kind then |
19:20:52 | Araq | it defaults to 'let' |
19:21:07 | Araq | (but yeah, we should improve the error message) |
19:21:22 | Araq | onionhammer: the name is not of your business |
19:21:40 | onionhammer | ha, okay. guess I cant use it in a parseExpr then |
19:28:15 | jpoirier | Anyone have git alias' for fetching origin/upstream pull requests? I seem to have the format wrong. |
19:28:57 | jpoirier | Never mind; got it working, |
19:29:52 | onionhammer | araq is PNimrodNode ever getting renamed? |
19:30:11 | * | bjz joined #nim |
19:30:51 | * | gour_ is now known as gour |
19:30:55 | Araq | onionhammer: sure why not. |
19:33:10 | * | Sergio965 joined #nim |
19:35:27 | onionhammer | Araq got it working, thanks |
19:42:50 | onionhammer | so now my 'new' macro is essentially as efficient as using MyRefType |
19:44:35 | * | bjz quit (Read error: Connection reset by peer) |
19:54:47 | Araq | onionhammer: that doesn't mean I like it :P |
19:54:55 | * | bjz joined #nim |
19:54:59 | onionhammer | lol |
19:55:01 | onionhammer | whats wrong with it? |
19:55:21 | onionhammer | believe me - I knew you wouldnt like it, but that doesnt mean I understand why |
19:55:31 | onionhammer | because it looks too much like C++? :P |
19:56:23 | * | gsingh93 joined #nim |
19:58:07 | ekarlso- | .eval let i = "" |
19:58:14 | ekarlso- | that bot is always dead -,,- |
19:58:22 | * | askatasuna joined #nim |
19:59:22 | * | askatasuna quit (Client Quit) |
20:00:08 | * | BlaXpirit_ joined #nim |
20:00:11 | * | askatasuna joined #nim |
20:03:39 | * | BlaXpirit quit (Ping timeout: 264 seconds) |
20:08:56 | saml | hey should i use release? master? devel branch? |
20:22:00 | BlaXpirit_ | master works for me |
20:24:01 | * | bjz quit (Read error: Connection reset by peer) |
20:27:15 | Araq | saml: if you work on a nimble package, ensure it works with the latest release please |
20:27:45 | saml | ah i see |
20:34:57 | * | bjz joined #nim |
20:36:04 | * | jpoirier_ joined #nim |
20:36:21 | * | jpoirier_ quit (Client Quit) |
20:37:07 | flaviu | ekarlso-: I'm here now. |
20:39:06 | * | Mat4 joined #nim |
20:39:13 | Mat4 | hello |
20:43:19 | * | bjz quit (Read error: Connection reset by peer) |
20:44:33 | * | gmpreussner|work joined #nim |
20:44:49 | gmpreussner|work | is there a way to recover/reset the password on the forums? |
20:45:00 | EXetoC | no |
20:45:02 | saml | def-, are you gonna implement sort? https://github.com/def-/nimutils/ |
20:46:24 | Araq | gmpreussner|work: unfortunately not. PRs welcome ... |
20:48:15 | def- | saml: probably not, i was just playing around a bit |
20:50:16 | gmpreussner|work | Araq: ok, i'll have to take a look then, coz otherwise i can't log in anymore :) |
20:51:16 | gmpreussner|work | there is a reply to my Kate syntax highlighting post. someone posted a Github repo that has a script that is much more advanced than mine. we should put that one on the wiki instead. |
20:51:29 | Araq | well maybe dom96 can change the db for you |
20:51:29 | * | gokr_ quit (Ping timeout: 245 seconds) |
20:52:01 | * | gokr_ joined #nim |
20:58:15 | * | VinceAddons quit (Ping timeout: 244 seconds) |
20:58:52 | gokr_ | Vidare. |
20:59:11 | gokr_ | oops |
20:59:36 | * | VinceAddons joined #nim |
21:03:12 | Mat4 | Araq: ping |
21:03:25 | * | Mat4 is now known as Mat4|work |
21:05:14 | Araq | Mat4|work: pong |
21:05:29 | * | ahc quit (Quit: Leaving) |
21:07:12 | Mat4|work | I'm writing on a little documentation about cross compilation for AVR and Propeller MCU's. You will find it on my Git repro on sunday |
21:07:23 | renesac | Araq: my template trick for overriding the operators precedence don't work anymore for >> |
21:07:27 | renesac | T_T |
21:07:39 | renesac | https://gist.github.com/ReneSac/ff983a857dd56209d3bb <-- remember this? |
21:07:49 | Araq | on sunday? I don't even plan to live that long |
21:07:51 | * | Sergio965 quit (Ping timeout: 256 seconds) |
21:09:21 | Mat4|work | *lol* |
21:10:01 | Araq | renesac: well? what should I do? |
21:10:08 | * | pdeuchler joined #nim |
21:10:44 | * | bjz joined #nim |
21:11:12 | * | Hakaslak joined #nim |
21:11:14 | * | Hakaslak quit (Remote host closed the connection) |
21:11:54 | pdeuchler | Hey guys, quick n00b question here… does nim support multiple returns? i.e. can I return more than one thing without putting things into an object/array/sequence? |
21:12:24 | Araq | pdeuchler: return a tuple |
21:13:04 | pdeuchler | Araq: cool, thanks! |
21:14:08 | renesac | Araq: it would be good to have a way to keep using those operators... |
21:14:44 | renesac | the strong space helps, as well as parenthesis |
21:15:01 | renesac | but the precedence is very wrong |
21:15:21 | renesac | because the new arrow operators |
21:15:34 | Araq | renesac: well you should have been here when we discussed this language change |
21:15:42 | renesac | I really think those classic C operators are better for bitwise |
21:15:45 | renesac | yeah, I know |
21:16:21 | dtscode | dom96, ping |
21:18:18 | Araq | renesac: we can tweak the "arrow like" rule slightly for you |
21:18:24 | renesac | Araq: do you have any interest in incorporating any of those operators in the language? |
21:18:43 | Araq | no but it sux they don't work anymore for you |
21:19:23 | Araq | arrow like could be "last char is '>' and the char before that is ~ or = or -" |
21:19:57 | Araq | then ~> and => and -> are arrows. and eg *> and >> is not |
21:20:23 | Araq | a bit arbitrary but these rules are already arbitrary to allow for += etc. |
21:20:25 | renesac | ~> ? never seen that |
21:20:42 | saml | is merge sort hard? |
21:20:44 | renesac | is it already used? |
21:21:01 | Araq | no, but it's intuitively obvious that it should be an arrow :P |
21:21:36 | Araq | saml: the stdlib's sort is a merge sort |
21:21:50 | renesac | now I forgot what was the problem with '<<=' |
21:22:37 | * | bjz quit (Read error: Connection reset by peer) |
21:22:38 | saml | https://github.com/Araq/Nim/blob/devel/lib/stdlib.nimble ? |
21:23:09 | Araq | saml: that's just a dummy package |
21:23:45 | saml | https://github.com/Araq/Nim/blob/master/lib/pure/algorithm.nim#L151 oh this |
21:24:30 | saml | i wanna sort (lines of) large files that don't fit in memory |
21:25:06 | Araq | saml: forget about the stdlib then, but you can perhaps look at the algorithm |
21:25:22 | saml | is there lazy list? |
21:25:59 | Araq | no and even if there were, lists are not what you want |
21:27:48 | Araq | in fact, you should look for existing software, it's a nasty problem and if it doesn't fit in memory performance is an issue too |
21:29:10 | Araq | I would import the data into a database and use "order by" in the SQL query ;-) |
21:30:20 | saml | yah just want to learn to code in 2015 |
21:30:33 | saml | i rarely get to implement sort,hashtable, tree.. etc |
21:30:40 | saml | so when i go to job interviews, i fail |
21:30:51 | * | bjz joined #nim |
21:36:30 | Araq | saml: ok, but then you shouldn't use the stdlib either. |
21:36:44 | saml | yup |
21:39:22 | renesac | saml: http://sortbenchmark.org/ <-- sorting large than memory records remember me of this |
21:39:27 | * | bjz quit (Ping timeout: 245 seconds) |
21:40:09 | renesac | the "daytona" category says the sort code must be general purpose, so maybe it can be applied to your problem too |
21:42:23 | * | infrashortfoo quit (Remote host closed the connection) |
21:42:33 | Araq | renesac: how many Nimble packages did you contribute? |
21:43:59 | renesac | zero |
21:43:59 | renesac | :/ |
21:44:10 | renesac | the benchmark package is not on nimble index yet |
21:45:04 | renesac | as I was going to change away from cpu_time(), but never didt |
21:45:44 | Araq | well perhaps I should request Nimble packages in exchange for language changes ;-) |
21:46:05 | renesac | ^^' |
21:48:23 | Araq | renesac: change parser.nim line 197 and line 210 and see what suits you |
21:48:46 | Araq | and then make a PR with the change that also updates the docs and news section |
21:49:24 | renesac | ok, I will see |
21:49:54 | Araq | I'll give feedback and ultimately will accept it |
21:51:45 | renesac | I don't want a too halfassed implementation of those operators, so I want that it as a whole works well |
21:51:54 | renesac | I'm not really sure if all the precedences are right |
21:52:00 | renesac | I need to test it |
21:52:57 | renesac | and mantain it parallel with the evolution of the language is also a bit cumbersome |
21:53:26 | renesac | there is now a pull request in math.nim to use ^ as pow, that conflicts with my use as 'xor' |
21:53:32 | * | _meanfish quit (Ping timeout: 244 seconds) |
21:53:55 | renesac | and those things tend to accumulate |
21:54:07 | renesac | at least it is in a separate module, not on system |
21:54:40 | Araq | well neither will end up in system |
21:55:01 | Araq | so IMO it's fine. import bithacks # ok ^ means xor |
21:55:09 | Araq | import math # ok, ^ means pow |
21:55:36 | renesac | by the way: Binary operators whose first character is ^ or its last character is > are right-associative, all other binary operators are left-associative. |
21:55:49 | renesac | from the manual |
21:56:10 | Araq | that doesn't sound right |
21:56:37 | renesac | Exception: The single "greater than" > operator is left-associative too. Operators ending in > but longer than a single character are called arrow like. |
21:56:54 | Araq | ah, then it's correct |
21:57:34 | renesac | will ^ behave correctly for pow then? |
21:58:05 | Araq | yes, that's the intend behind this rule |
21:58:54 | Araq | maybe xor should be ^^ and left associative ... |
22:00:35 | renesac | hum |
22:01:01 | renesac | I will see if my template hack alone solves this |
22:01:21 | renesac | but right |
22:01:43 | Araq | well we can change that too. x^2^3 is not really common is it? it grows too fast for computers |
22:02:29 | renesac | for float it may be used |
22:03:25 | renesac | and maybe with bignums |
22:03:40 | Araq | btw I don't get your template hack. you cannot change precedence with templates |
22:03:53 | Araq | they don't use textual substitution |
22:03:56 | renesac | yeah, I will check if that really works |
22:07:09 | * | gour quit (Remote host closed the connection) |
22:10:26 | * | BitPuffin quit (Ping timeout: 264 seconds) |
22:13:11 | * | gokr_ quit (Remote host closed the connection) |
22:13:28 | * | gokr_ joined #nim |
22:16:18 | * | hasenj quit (Quit: hasenj) |
22:28:25 | * | goobles joined #nim |
22:28:42 | * | rpag joined #nim |
22:29:01 | * | rpag quit (Client Quit) |
22:31:58 | * | Mat4|work left #nim (#nim) |
22:33:45 | saml | .eval let doc = parseJson("""{"a":{"b":[{"c":1}]},"d":2}"""); $doc["a"].fields["b"].elems[0]["c"].num |
22:36:13 | * | Mimbus joined #nim |
22:36:18 | flaviu | saml: Try again. |
22:36:25 | saml | .eval let doc = parseJson("""{"a":{"b":[{"c":1}]},"d":2}"""); $doc["a"].fields["b"].elems[0]["c"].num |
22:36:28 | Mimbus | saml: eval.nim(3, 10) Error: undeclared identifier: 'parseJson' |
22:36:38 | saml | .eval import json; let doc = parseJson("""{"a":{"b":[{"c":1}]},"d":2}"""); $doc["a"].fields["b"].elems[0]["c"].num |
22:36:41 | Mimbus | saml: eval.nim(5, 16) Error: type mismatch: got (seq[tuple[key: string, val: JsonNode]], string) |
22:39:33 | saml | what's good example of json de/serialization? |
22:40:09 | EXetoC | .eval discard newSeq[int]()[0] |
22:40:15 | Mimbus | EXetoC: Error: unhandled exception: index out of bounds [IndexError] |
22:40:23 | flaviu | saml: Try out the marshal module: http://nim-lang.org/marshal.html |
22:40:43 | EXetoC | oh yeah that doesn't even segfault. such modern. much wow |
22:41:16 | flaviu | EXetoC: It does with -d:release |
22:41:49 | EXetoC | right |
22:44:40 | renesac | https://gist.github.com/ReneSac/eb7c26e27ab1d3901df1 <-- bug with strongSpaces? |
22:45:07 | renesac | if I remove it, it works as it should |
22:47:39 | EXetoC | so, 1 + 16 shl (1 == 1 + (16 shl 1))? |
22:47:57 | Araq | renesac: report it. I'm sure it works according to what I had in mind at the time, but it's weird |
22:48:29 | Araq | it's good that at least *somebody* out there uses this feature :-) |
22:48:33 | renesac | EXetoC: or the oposite, the shl seems to bind weaker |
22:49:16 | * | askatasuna quit (Ping timeout: 264 seconds) |
22:50:27 | renesac | Araq: one more reason for you to drop those ridiculous "xor" and "shl" operators! |
22:50:28 | renesac | ;) |
22:50:49 | * | infrashortfoo joined #nim |
22:50:50 | renesac | they really don't mix well with strong spaces |
22:51:30 | renesac | I mean, even fixing that, they can't get advantage with strong spaces |
22:51:42 | Araq | renesac: I agree, but when you introduce >> people also expect >>= and then new integer like types need to support all this low level stuff |
22:52:35 | renesac | well, they can not implement it |
22:52:41 | renesac | what integer like types you mean? |
22:52:44 | renesac | bitgnums? |
22:53:12 | Araq | yes, or fractions or quaternions or ... |
22:53:32 | renesac | I see many small bignum libraries that don't implement even shifting |
22:54:01 | * | flaviu likes `shr` |
22:54:14 | renesac | and what is the diference to the atual situation? |
22:54:30 | ldlework | flaviu: +1 |
22:54:36 | Araq | the actual situation is "wtf ok this works differently from C" |
22:54:37 | * | renesac likes >> |
22:55:06 | gmpreussner | +1 for shr :) |
22:55:24 | renesac | may I ask why you preffer shr instead of >>? |
22:55:26 | * | infrashortfoo quit (Ping timeout: 264 seconds) |
22:55:34 | renesac | you guys |
22:56:05 | gmpreussner | SHift Right... vs. greater greater than :) |
22:56:21 | renesac | personally, the difference between 'shl' and 'shr' is much more difficult to spot than between ">>" and "<<" |
22:57:04 | gmpreussner | depends on what you're used to |
22:57:13 | renesac | and I'm used to those operators from C (and from almost everywhere that refers to them) |
22:57:25 | Araq | renesac: tbh I often have to look at >> and << and *think* in what direction they point to |
22:57:27 | renesac | gmpreussner: where you got used to shr? |
22:57:43 | gmpreussner | assembler for example |
22:57:53 | ldlework | It isn't about spotting the difference |
22:57:53 | Araq | and then I can decide whether it's multiplication or division like |
22:57:53 | renesac | right |
22:58:00 | ldlework | Its about guessing the semantic of the operator at a glance |
22:58:13 | ldlework | Instead of having to remember if Nim's >> is a bitshift operator or some other crazy thing |
22:58:43 | renesac | well, I argue that 'shr' is as cryptic as '>>' |
22:58:54 | renesac | and the latter at least has a graphical representation of what it does |
22:58:58 | Araq | but it's not for me, read what I wrote |
22:58:59 | renesac | (moves things to the right) |
22:59:04 | * | rpag joined #nim |
22:59:14 | * | rpag quit (Remote host closed the connection) |
22:59:14 | Araq | it's the opposite of "graphical" |
22:59:41 | gmpreussner | x << y means 'push y into x' :) |
22:59:49 | Araq | I need to translate it back into *words* |
22:59:57 | renesac | well, I don't have this problem... |
23:00:16 | gmpreussner | x << could also mean 'x is A LOT smaller than y' |
23:00:18 | ldlework | renesac: its only cryptic if you have never ever used Nim before |
23:00:20 | EXetoC | I see something pointing towards the right side and think, "right" :p |
23:00:24 | BlaXpirit_ | operators are fine -_- |
23:00:26 | EXetoC | but to each his own |
23:00:36 | flaviu | Yeah, I use my hands for shr and shl |
23:00:44 | flaviu | I can't remember which way is left and which is right |
23:00:48 | EXetoC | but it's not so obvious with C++ streams |
23:00:49 | renesac | and english is not my native language, so english words aren't so immediate for my brain either |
23:00:51 | EXetoC | or is it? |
23:00:53 | Araq | renesac: well it's subjective and I got used to it |
23:00:55 | renesac | (I know it is not yors) |
23:01:23 | ldlework | renesac: do you not call >> the "bit shift right operator" |
23:01:30 | EXetoC | I like the idea of not having to press shift all the time |
23:01:34 | renesac | gmpreussner: not if applied between two integers! |
23:01:56 | flaviu | EXetoC: How often do you use bit shifts anyway? |
23:02:07 | EXetoC | but maybe I need a proper programming keyboard :p |
23:02:10 | renesac | ldlework: but you could say the same for ">>" |
23:02:11 | EXetoC | flaviu: I meant in general |
23:02:24 | ldlework | renesac: say the same what? |
23:03:01 | renesac | "its only cryptic if you have never ever used Nim before" <-- if the default was the opposite |
23:03:06 | ldlework | renesac: if you're saying that >> is equally lexcially informative as 'shr' as to conveying "shift right" then you're getting a little cooky |
23:03:08 | gmpreussner | renesac: i'm just messing with you :) ldlework had the right argument. it comes down to discoverability. for example, i like your little bit hacks library, but it is not clear by looking at it what 'x *>= y' does. i'd have to memorize all those cryptic symbol combinations. |
23:03:18 | flaviu | ldlework: no personal attacks please |
23:03:30 | ldlework | then your argument is getting a little cooky? |
23:03:46 | renesac | gmpreussner: yeah, that *>= was supposed to be >>= |
23:04:01 | renesac | but with "shr" you don't have that problem, of course |
23:04:10 | renesac | because you can't have an equivalent operator! |
23:04:13 | renesac | :P |
23:04:30 | ldlework | ? |
23:04:33 | renesac | (another downside of keywords for those operators) |
23:04:39 | ldlework | you'd just have another keyword |
23:04:39 | renesac | 'shl=' |
23:04:51 | renesac | and=? |
23:04:56 | renesac | xor=? |
23:05:08 | gmpreussner | seems legit |
23:05:10 | ldlework | yeah |
23:05:11 | gmpreussner | is that possible? |
23:05:24 | renesac | nim don't have it |
23:05:24 | ldlework | gmpreussner: I think those are special in nim |
23:05:37 | renesac | you can't define it on your own either |
23:05:46 | EXetoC | you would then have to do x.xor = 3, right? |
23:05:50 | renesac | it would need to be special cased on the compiler, as the current bitwise operators |
23:05:55 | EXetoC | had it been working. I don't know if it does |
23:06:01 | EXetoC | guess not |
23:06:29 | gmpreussner | i wonder if op= for binary operators should automatically be supported as 'arg1 = arg1 op arg2' |
23:06:29 | renesac | EXetoC: I don't follow you |
23:07:06 | EXetoC | renesac: `foo=` means you can do bar.foo = baz |
23:07:07 | ldlework | gmpreussner: but how do you invoke it |
23:07:27 | * | repax quit (Quit: repax) |
23:07:39 | gmpreussner | ah, you got me :) |
23:07:41 | renesac | EXetoC: yeah, it has a different meaning |
23:07:55 | ldlework | EXetoC: I sometimes feel that Nim should implement some other way to support property accessors |
23:08:08 | gmpreussner | then perhaps we need to enforce a one character white space between tokens |
23:08:11 | ldlework | since it seems to step all over the operator overloading as we see |
23:08:20 | gmpreussner | so it's either op = 3 or op= 3 |
23:08:23 | gmpreussner | :) |
23:08:29 | EXetoC | {.property.}? but there was talk of making it even more convenient |
23:08:30 | ldlework | gmpreussner: get out. |
23:08:31 | EXetoC | a la C# |
23:08:38 | gmpreussner | haha |
23:08:46 | EXetoC | or something |
23:08:58 | flaviu | Assignment operators are coming "soon", so just wait for those? |
23:09:14 | EXetoC | but just a brief mention, some time ago |
23:09:33 | renesac | flaviu: don't you mean overloading the '=' operator? |
23:09:36 | ldlework | gmpreussner: :) |
23:09:52 | EXetoC | but that's for "x = y" |
23:11:02 | flaviu | renesac: Yes |
23:11:30 | renesac | how is that relevant to the discussion^? |
23:13:06 | flaviu | EXetoC: So what about x = +, y shr 123 |
23:14:04 | renesac | wow, shr 123 |
23:14:09 | renesac | XD |
23:14:23 | renesac | I don't understand your line of code |
23:14:28 | flaviu | renesac: I have HP's new memsister computer |
23:14:39 | flaviu | so my ints are arbitrary wide :P |
23:14:56 | flaviu | renesac: `=`(x, +, y shr 123) |
23:16:08 | * | adam_s joined #nim |
23:16:17 | renesac | I'm lost |
23:16:46 | * | goobles quit (Ping timeout: 246 seconds) |
23:16:56 | renesac | :/ |
23:17:16 | flaviu | template `=`(target, op, expression: expr) = target = target op expression |
23:18:35 | flaviu | or something similar, I'm sure that syntax isn't exactly valid. |
23:18:40 | renesac | so it would translate to x += y shr 123? |
23:18:55 | flaviu | no, to x = x + (y shr 123) |
23:19:04 | dom96 | dtscode: What's up? |
23:19:19 | renesac | isn't it the same? |
23:19:57 | flaviu | renesac: yep, it's exactly the same. |
23:20:15 | renesac | and what is your point? |
23:20:17 | Araq | flaviu: when I brought up a syntax for exactly this feature people weren't excited |
23:20:55 | * | gmpreussner quit (*.net *.split) |
23:20:56 | * | ramnes quit (*.net *.split) |
23:20:56 | * | jh32 quit (*.net *.split) |
23:20:56 | * | vegai quit (*.net *.split) |
23:20:56 | * | biscarch quit (*.net *.split) |
23:20:56 | * | joebo quit (*.net *.split) |
23:20:56 | * | stonecolddevin quit (*.net *.split) |
23:20:57 | * | Amrykid quit (*.net *.split) |
23:20:57 | * | dom96 quit (*.net *.split) |
23:20:57 | * | wtw quit (*.net *.split) |
23:20:57 | * | valberg quit (*.net *.split) |
23:20:57 | * | ldlework quit (*.net *.split) |
23:20:57 | * | flyx quit (*.net *.split) |
23:20:57 | * | xAndy quit (*.net *.split) |
23:20:58 | * | lyro quit (*.net *.split) |
23:20:58 | * | Boscop quit (*.net *.split) |
23:20:59 | * | phI||Ip quit (*.net *.split) |
23:20:59 | * | silven quit (*.net *.split) |
23:20:59 | * | skroll3 quit (*.net *.split) |
23:20:59 | * | ekarlso- quit (*.net *.split) |
23:21:00 | * | betawaffle quit (*.net *.split) |
23:21:00 | * | reactormonk quit (*.net *.split) |
23:21:00 | * | acidx quit (*.net *.split) |
23:21:06 | * | valberg joined #nim |
23:21:06 | * | vegai joined #nim |
23:21:11 | renesac | I'm not understanding what it adds |
23:21:13 | * | stonecolddevin joined #nim |
23:21:18 | BlaXpirit_ | I just wish that += sometimes, somehow, would translate to x = x + |
23:21:20 | * | gmpreussner joined #nim |
23:21:27 | flaviu | renesac: Even though they have the same result and expand to the same thing in the C code, there might be confusion with +=.. |
23:21:31 | * | joebo joined #nim |
23:21:33 | * | ldlework joined #nim |
23:21:47 | * | Amrykid joined #nim |
23:21:53 | * | xAndy joined #nim |
23:21:53 | * | xAndy quit (Changing host) |
23:21:53 | * | xAndy joined #nim |
23:21:57 | * | biscarch joined #nim |
23:22:02 | renesac | BlaXpirit_: isn't what it does? |
23:22:18 | renesac | what confusion? |
23:22:25 | BlaXpirit_ | maybe I misunderstood something, but last time I tried, += doesn't work if you just define + |
23:22:35 | renesac | oh |
23:22:38 | * | z3744817276842 joined #nim |
23:22:41 | renesac | right |
23:22:51 | * | lyro joined #nim |
23:22:51 | * | Boscop joined #nim |
23:22:51 | * | phI||Ip joined #nim |
23:22:51 | * | silven joined #nim |
23:22:51 | * | skroll3 joined #nim |
23:22:51 | * | ekarlso- joined #nim |
23:22:51 | * | betawaffle joined #nim |
23:22:51 | * | reactormonk joined #nim |
23:22:51 | * | acidx joined #nim |
23:23:35 | renesac | well, it can be fixed in the system, the same way that <= is defined when you define >= (or the oposite) |
23:23:38 | renesac | I think |
23:23:52 | Araq | yup |
23:23:53 | renesac | not sure if there is a reason not to do it, though |
23:24:00 | BlaXpirit_ | sure it can, but then you'd modify all other things |
23:24:18 | * | dom96 joined #nim |
23:24:19 | renesac | for example? |
23:24:21 | Araq | sure there is a reason to not do it: "system.nim is bloated" |
23:24:44 | BlaXpirit_ | I just think the documentation is "bloated" because I can never find anything there |
23:24:49 | renesac | I don't see it as more bloat |
23:25:04 | renesac | it will probably shave many lines off system.nim |
23:25:30 | renesac | if you delete all the individual += (I'm not sure if there are many) |
23:25:34 | flaviu | renesac: I'll just drop it, the more I try to explain it, the more confusing it's bound to get :) |
23:25:48 | BlaXpirit_ | it would be awesome to have an opt-in, say something like "I want the += and all other such things to work on my type" |
23:25:51 | BlaXpirit_ | and it doesn't seem crazy |
23:25:55 | BlaXpirit_ | some pragma, some tag |
23:26:06 | BlaXpirit_ | and then the thing that is defined in system would work only for that |
23:26:09 | flaviu | isn't += a template? |
23:26:10 | Araq | BlaXpirit_: that's just a template away |
23:26:15 | renesac | yep |
23:26:23 | * | ramnes joined #nim |
23:27:33 | ekarlso- | should duplicate plackage names be allwoed ? |
23:28:05 | * | johnsoft quit (Ping timeout: 244 seconds) |
23:28:17 | * | irrequietus quit () |
23:28:21 | Araq | ekarlso-: yes. people cannot even come up with unique module names in the *same project* |
23:28:33 | * | johnsoft joined #nim |
23:28:42 | flaviu | Araq: Java, python solve this probem with namespaces... |
23:28:51 | BlaXpirit_ | Araq, make sure you're not misunderstanding package names vs module names |
23:29:01 | BlaXpirit_ | I understood it as nimble packages |
23:29:10 | * | [dee] joined #nim |
23:29:26 | Araq | flaviu: and Nim dares to bound this to a Nimble package |
23:30:30 | ekarlso- | ? |
23:30:41 | ekarlso- | pypi doesn't allow you I think to register foo and foo |
23:30:50 | flaviu | Araq: I don't like it, but do whatever you feel is best. |
23:31:09 | BlaXpirit_ | Araq, I don't understand what you said about "a template away" |
23:31:13 | * | yglukhov_____ joined #nim |
23:31:21 | ekarlso- | flaviu: nah, i'l disallow it |
23:31:31 | ekarlso- | bad idea anyways to allow nimble to mysql@... |
23:31:37 | ekarlso- | and there's two packages for it |
23:31:45 | EXetoC | BlaXpirit_: that a template is all you need |
23:31:49 | flaviu | Unrelated, I saw http://ericsink.com/entries/fsharp_chasm.html on reddit today. It applies to Nim too. |
23:31:54 | BlaXpirit_ | well yes, but what kind of template? |
23:32:18 | flaviu | BlaXpirit_: template `+=`(lhs, rhs: expr): expr = lhs = lhs + rhs |
23:32:30 | BlaXpirit_ | flaviu, that's for every single type in the world |
23:32:34 | BlaXpirit_ | which i don't want |
23:32:42 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:32:43 | flaviu | BlaXpirit_: Nope, see the "expr" part? |
23:32:47 | BlaXpirit_ | no |
23:32:56 | BlaXpirit_ | i mean... i see, but what does that change? |
23:32:57 | flaviu | `(lhs, rhs: expr)` |
23:33:09 | flaviu | that means that any possible lhs and rhs can go in there |
23:33:19 | flaviu | there is no type checking done until after expansion. |
23:33:54 | * | RushPL quit (Remote host closed the connection) |
23:33:56 | * | yglukhov____ quit (Read error: Connection reset by peer) |
23:34:03 | BlaXpirit_ | okay, but it's still for every type that has `+` |
23:34:16 | renesac | yes, what you wanted? |
23:34:23 | BlaXpirit_ | no |
23:34:30 | BlaXpirit_ | [:25:47] <BlaXpirit_> it would be awesome to have an opt-in, say something like "I want the += and all other such things to work on my type" |
23:34:39 | flaviu | {.borrow.}? |
23:34:57 | EXetoC | yes for distinct types |
23:35:01 | renesac | why you would not want it? |
23:35:08 | Varriount | flaviu: Regarding that link, yes, I do think it pertains to Nim. |
23:35:12 | BlaXpirit_ | look |
23:35:15 | renesac | bwt, the += in the system.nim is: |
23:35:20 | renesac | proc `+=`*[T: SomeOrdinal|uint|uint64](x: var T, y: T) {.magic: "Inc", noSideEffect.} ## Increments an ordinal |
23:35:20 | BlaXpirit_ | if I make a library |
23:35:28 | Varriount | flaviu: But in our case, who are the 'pragmatists in pain'? |
23:35:44 | BlaXpirit_ | then I don't want to spam people with += template for everything they do |
23:35:59 | flaviu | Varriount: I don't know. |
23:36:03 | BlaXpirit_ | but I do want it to apply to my types |
23:36:07 | renesac | is this magic really important, or the expr template trick can be done for it too? |
23:36:08 | EXetoC | I told you what araq meant |
23:36:10 | * | RushPL joined #nim |
23:36:40 | flaviu | BlaXpirit_: So make a template for the template. |
23:36:43 | EXetoC | nvm |
23:37:03 | BlaXpirit_ | I see "template additive" in docs |
23:37:09 | BlaXpirit_ | manual* |
23:37:27 | flaviu | template blah(T: expr): stmt = template `+=`(lhs, rhs: T... |
23:37:33 | Araq | BlaXpirit_: yes that gives you the basic idea |
23:38:05 | BlaXpirit_ | I should've grasped that thing, I've read through it twice :s |
23:38:31 | dom96 | Araq: what? Package names should be unique. |
23:38:34 | renesac | BlaXpirit_: but you are not really spamimg it I think |
23:38:39 | Araq | dom96: I wasn't serious |
23:39:01 | dom96 | ...right |
23:39:14 | renesac | if it is defined globaly in system.nim, it becomes something expected in the language |
23:39:14 | * | Trustable quit (Ping timeout: 264 seconds) |
23:39:25 | flaviu | Also, is it really a good idea to use top-level namespaces for non-official projects? |
23:39:27 | BlaXpirit_ | renesac, I do not think such a += template is good by default |
23:39:35 | renesac | why? |
23:39:42 | BlaXpirit_ | I imagine many people do not want += to work with their type while + does |
23:39:46 | flaviu | ex, see freenode's #foo and ##foo |
23:39:47 | * | renesac is also tryng to think why |
23:39:56 | BlaXpirit_ | yeah, I actually can't come up with an example |
23:40:09 | BlaXpirit_ | so maybe it's just a good thing in general |
23:40:16 | BlaXpirit_ | at least if it can be overridden |
23:40:31 | Araq | that has to be possible for efficiency |
23:40:38 | BlaXpirit_ | Python does it, anyway |
23:40:48 | MyMind | is possible to tell compiler to use openmp? |
23:41:32 | renesac | Araq: the efficency answer as for us? |
23:41:48 | BlaXpirit_ | renesac, huh |
23:41:58 | Araq | MyMind: use the || iterator but beware |
23:42:40 | Araq | the compiler isn't really aware of the || semantics, so you cannot even 'echo' unless you call setupForeignThreadGc in the for loop |
23:42:57 | flaviu | ekarlso-: You pinged me earlier today, pong? |
23:43:27 | MyMind | Araq: I was thinking to port this http://www.kevinbeason.com/smallpt/ to nim as exercise |
23:45:00 | Araq | MyMind: sure go ahead. ask def- for help if you're stuck |
23:45:37 | MyMind | hehehe ok |
23:47:34 | MyMind | cpp 2 nim comes with c2nim? |
23:49:30 | Araq | yeah via the --cpp switch |
23:50:47 | * | pdeuchler quit (Quit: pdeuchler) |
23:54:06 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:55:26 | * | flyx joined #nim |
23:56:07 | * | wtw joined #nim |
23:58:04 | * | areckizb joined #nim |