00:06:38 | * | Demos quit (Quit: Lost terminal) |
00:44:01 | * | jefus__ is now known as jefus |
00:50:13 | * | BitPuffin quit (Ping timeout: 264 seconds) |
00:51:41 | * | arnetheduck joined #nim |
01:29:35 | * | desal joined #nim |
01:35:53 | * | rational quit (Quit: Lost terminal) |
01:41:30 | * | saml_ joined #nim |
01:55:50 | * | Kingsquee quit (Quit: Konversation terminated!) |
02:02:14 | * | coopernurse quit () |
02:02:46 | * | untitaker quit (Ping timeout: 272 seconds) |
02:09:12 | * | untitaker joined #nim |
02:09:44 | * | polde quit (Ping timeout: 272 seconds) |
02:12:45 | * | polde joined #nim |
02:15:09 | * | n1ftyn8 joined #nim |
02:31:51 | * | saml_ quit (Quit: Leaving) |
02:32:58 | * | saml_ joined #nim |
02:40:58 | * | darkf joined #nim |
02:45:01 | * | jholland quit (Quit: Connection closed for inactivity) |
02:47:59 | * | Varriount joined #nim |
03:27:48 | * | brson joined #nim |
03:32:42 | * | polde quit (Ping timeout: 272 seconds) |
03:33:10 | * | reem joined #nim |
03:33:16 | * | Kingsquee joined #nim |
03:41:17 | * | gsingh93 joined #nim |
03:47:23 | * | reem quit (Read error: Connection reset by peer) |
03:47:51 | * | reem joined #nim |
03:50:52 | * | reem quit (Remote host closed the connection) |
03:54:55 | * | reem joined #nim |
04:01:56 | * | polde joined #nim |
04:13:31 | * | TEttinger joined #nim |
04:16:24 | * | polde quit (Ping timeout: 272 seconds) |
04:16:39 | * | lorxu joined #nim |
04:16:56 | * | reem quit (Remote host closed the connection) |
04:18:12 | * | reem joined #nim |
04:19:16 | * | reem quit (Remote host closed the connection) |
04:20:11 | * | dashed joined #nim |
04:21:07 | * | reem joined #nim |
04:24:16 | * | reem quit (Remote host closed the connection) |
04:25:29 | * | polde joined #nim |
04:34:46 | * | polde quit (Ping timeout: 272 seconds) |
04:36:57 | * | reem joined #nim |
04:37:26 | * | reem quit (Remote host closed the connection) |
04:37:57 | * | reem joined #nim |
04:38:39 | * | saml_ quit (Quit: Leaving) |
04:42:29 | * | reem quit (Ping timeout: 246 seconds) |
04:50:21 | * | reem joined #nim |
04:51:56 | * | reem quit (Remote host closed the connection) |
05:01:44 | * | pipitone joined #nim |
05:02:26 | * | polde joined #nim |
05:02:28 | pipitone | /join #lesswrong |
05:02:36 | * | pipitone left #nim (#nim) |
05:14:40 | * | polde quit (Ping timeout: 272 seconds) |
05:23:08 | * | polde joined #nim |
05:34:11 | * | pregressive joined #nim |
05:39:12 | * | pregressive quit (Ping timeout: 246 seconds) |
06:14:50 | * | polde quit (Ping timeout: 272 seconds) |
06:26:57 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
06:27:47 | * | MightyJoe joined #nim |
06:44:52 | * | polde joined #nim |
06:47:15 | * | clynamen_ is now known as clynamen |
06:56:00 | * | polde quit (Ping timeout: 272 seconds) |
07:00:24 | * | yglukhov_ joined #nim |
07:04:41 | * | yglukhov_ quit (Ping timeout: 250 seconds) |
07:18:34 | * | brson quit (Quit: leaving) |
07:31:11 | * | ChrisMAN quit (Ping timeout: 264 seconds) |
07:39:08 | * | polde joined #nim |
07:41:10 | * | desal quit (Ping timeout: 246 seconds) |
07:46:19 | * | gsingh93 quit (Ping timeout: 255 seconds) |
07:49:11 | * | Ven joined #nim |
07:57:26 | * | polde quit (Ping timeout: 272 seconds) |
08:09:22 | * | BlaXpirit joined #nim |
08:12:57 | * | lorxu quit (Remote host closed the connection) |
08:15:34 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:29:07 | * | pafmaf joined #nim |
08:42:25 | * | polde joined #nim |
08:45:45 | * | yglukhov_ joined #nim |
08:46:58 | * | polde quit (Ping timeout: 265 seconds) |
08:47:29 | * | Ven joined #nim |
09:02:37 | * | pafmaf quit (Quit: This computer has gone to sleep) |
09:16:54 | * | polde joined #nim |
09:20:20 | * | yglukhov_ quit (Quit: Lingo: www.lingoirc.com) |
09:29:55 | BlaXpirit | how to do method dynamic dispatch at compile time? |
09:30:32 | dtscode | i dont think you can |
09:31:05 | BlaXpirit | well yeah, ref types don't work and all that jazz |
09:31:23 | BlaXpirit | but i mean maybe there is some way to simulate this concept otherwise |
09:31:58 | BlaXpirit | so one option is to give each object a member that says what class is it |
09:32:01 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:32:11 | BlaXpirit | and then instead of many methods have one proc with a condition on type :| :| :| |
09:37:45 | * | polde quit (Ping timeout: 276 seconds) |
09:56:37 | * | EXetoC quit (Ping timeout: 248 seconds) |
09:59:12 | * | pafmaf_ joined #nim |
10:04:37 | * | polde joined #nim |
10:08:51 | * | dtscode left #nim ("Leaving") |
10:08:57 | * | dtscode joined #nim |
10:12:39 | * | TEttinger quit (Read error: Connection reset by peer) |
10:13:10 | * | TEttinger joined #nim |
10:13:39 | * | TEttinger quit (Read error: Connection reset by peer) |
10:14:49 | * | pafmaf_ quit (Ping timeout: 264 seconds) |
10:15:15 | * | pafmaf joined #nim |
10:28:56 | * | banister joined #nim |
10:29:26 | * | polde quit (Ping timeout: 272 seconds) |
10:30:54 | * | Ven joined #nim |
10:34:11 | * | milosn quit (Ping timeout: 264 seconds) |
10:35:40 | * | milosn joined #nim |
10:38:30 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:38:38 | * | eigenlicht joined #nim |
10:39:48 | * | polde joined #nim |
10:43:53 | * | eigenlicht quit (Quit: WeeChat 0.3.2) |
10:47:48 | * | polde quit (Ping timeout: 265 seconds) |
10:48:15 | * | Trustable joined #nim |
10:51:33 | def- | BlaXpirit: there should be an internal field already, because that's what methods do. Not sure if you can access it easily though |
10:54:18 | * | dashed quit (Quit: Connection closed for inactivity) |
10:55:35 | * | Matthias247 joined #nim |
10:56:23 | BlaXpirit | but gee, ref types really should work |
10:57:02 | BlaXpirit | even without garbage collection |
11:07:47 | * | Strikecarl joined #nim |
11:08:45 | Strikecarl | If i want to copy all files in x folder to x folder using copyFIle |
11:08:48 | Strikecarl | copyFile* |
11:08:51 | Strikecarl | how would i do that+ |
11:10:04 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:11:29 | * | Ven joined #nim |
11:16:38 | * | polde joined #nim |
11:21:22 | * | polde quit (Ping timeout: 272 seconds) |
11:28:30 | * | endragor joined #nim |
11:29:14 | * | polde joined #nim |
11:37:25 | * | johnsoft quit (Ping timeout: 248 seconds) |
11:37:50 | * | polde quit (Ping timeout: 272 seconds) |
11:41:33 | endragor | Is there a template in Nim's standard library similar to Python's "with" or Java's try-with-resources? Basically, I want file/resource to be closed automatically either when a block ends or an exception happens. I've seen such template in tutorial, but can't find it in standard library. And code examples seem to explicitly open/close files. |
11:43:40 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
11:46:19 | BlaXpirit | endragor, http://nim-lang.org/manual.html#defer-statement |
11:50:18 | endragor | thanks! |
12:02:30 | * | johnsoft joined #nim |
12:06:17 | * | meeeee3 joined #nim |
12:06:27 | meeeee3 | iup help anyone? |
12:07:07 | * | polde joined #nim |
12:07:57 | def- | meeeee3: you have iup installed? |
12:08:16 | meeeee3 | how |
12:08:27 | meeeee3 | nimble installed |
12:08:29 | def- | http://webserver2.tecgraf.puc-rio.br/iup/ |
12:08:38 | def- | I guess you have to install that also |
12:08:42 | def- | I've never used IUP |
12:09:03 | def- | if you can compile C programs with IUP, then it should also work with Nim |
12:10:33 | def- | hm, compilation of iup fails for me on linux, no idea |
12:12:12 | meeeee3 | dont get it |
12:12:20 | def- | I guess you can get precompiled libraries from here: http://sourceforge.net/projects/iup/files/3.13/ |
12:12:23 | def- | meeeee3: what OS do you use? |
12:12:28 | meeeee3 | i downlaoded 13mb with iuptest.exe iupview.exe |
12:12:30 | meeeee3 | win |
12:13:03 | meeeee3 | shouldnt it be a lib or something |
12:13:13 | meeeee3 | which i install with nimble |
12:14:02 | def- | nimble only installs nim libraries |
12:14:30 | def- | but iup is a c library and we have a nim wrapper for that |
12:15:00 | def- | so you need to get the c library, and probably put it in the same directory as your .nim file |
12:15:01 | * | BlaXpirit quit (Read error: Connection reset by peer) |
12:15:22 | meeeee3 | iup-3.13_Win32_mingw4_lib.zip |
12:15:25 | meeeee3 | this |
12:15:51 | def- | no, the dynamic library |
12:15:52 | meeeee3 | many.a files |
12:15:54 | * | BlaXpirit joined #nim |
12:15:56 | meeeee3 | ok |
12:16:27 | def- | are you building 32bit binaries? |
12:17:12 | meeeee3 | yes |
12:17:34 | def- | iup-3.13_Win32_dllw4_lib.zip should work then |
12:17:41 | meeeee3 | do i need the "include" folder or the 84 dll files |
12:17:42 | def- | but probably the other win32 dlls too |
12:17:49 | def- | i think you just need one dll |
12:17:59 | def- | iup31.dll |
12:18:10 | def- | and I see that you'll have to fix the iup nim wrapper because it only goes to iup30.dll |
12:18:49 | def- | I guess you could just call the iup.dll iup30.dll as a workaround |
12:19:19 | meeeee3 | i just see iup.dll - shouldnt that be right? |
12:19:37 | def- | in the end the nim wrapper should work with iup.dll, but it doesn't right now |
12:19:58 | def- | you can fix it in the wrapper with const dllname = "iup(|30|27|26|25|24).dll" |
12:20:20 | meeeee3 | should i dl an older version which works with the wrapper |
12:20:36 | meeeee3 | or just that |
12:20:56 | meeeee3 | where is the wrapper |
12:20:58 | def- | i think it will work with that one |
12:21:09 | def- | the wrapper is in lib/wrappers/iup.nim |
12:21:25 | meeeee3 | oh lol |
12:21:34 | meeeee3 | should have searched my system |
12:22:10 | * | polde quit (Ping timeout: 272 seconds) |
12:23:39 | meeeee3 | so now i open nimble and create a new project? |
12:23:45 | meeeee3 | init .. |
12:23:52 | def- | you could do that |
12:23:53 | meeeee3 | ? |
12:24:12 | def- | or just create a new foo.nim file and worry about nimble later |
12:24:17 | meeeee3 | ok |
12:24:19 | meeeee3 | already |
12:24:26 | meeeee3 | :) |
12:24:37 | meeeee3 | *thinking* |
12:25:09 | meeeee3 | place dll file in the same dir as my.nim file? |
12:25:12 | def- | yes |
12:25:23 | def- | the documentation is here: http://nim-lang.org/iup.html |
12:26:14 | def- | but it should be easy to port C iup code to nim |
12:26:27 | def- | if this is your first nim project, i guess it would be easier to start with something non-graphical |
12:27:10 | meeeee3 | messagebox would be fine ^^ |
12:27:32 | meeeee3 | import lib/iup? |
12:27:50 | def- | You just want to show message boxes? |
12:27:53 | def- | just "import iup" |
12:28:30 | def- | you should use the dialogs module then, it works with winapi on windows and gtk on the rest: http://nim-lang.org/dialogs.html |
12:28:32 | meeeee3 | no, i will go for the window with listview |
12:28:59 | meeeee3 | no, just as a test. should be a real gui. |
12:29:39 | * | polde joined #nim |
12:30:16 | endragor | Is there a clean way to remove elements of a sequence while iterating? Something like "filter" doesn't work for me, because deletion criteria is based on other items of the seq (I have nested for-loops) |
12:30:48 | def- | endragor: I guess creating a new seq and replacing the other one with that later would be "clean" |
12:31:19 | def- | meeeee3: example for iup here: https://github.com/Araq/Nim/blob/devel/examples/iupex1.nim |
12:32:01 | meeeee3 | thx, was stuck with an 180 lines cairo canvas example |
12:32:07 | def- | meeeee3: this also works for me: https://gist.github.com/def-/45efb8d57cb2985c6d58 |
12:33:05 | meeeee3 | works |
12:33:11 | meeeee3 | thx :) |
12:34:01 | meeeee3 | dllname = "iup.dll" |
12:34:08 | * | polde quit (Ping timeout: 265 seconds) |
12:38:54 | * | pafmaf quit (Quit: Verlassend) |
12:39:33 | endragor | thanks, def-. I've realized that what I need is linked list, not seq. Then iterating with nodes() and using remove() would work |
12:39:48 | def- | endragor: and removing is much faster then |
12:40:06 | endragor | sure |
12:41:37 | * | polde joined #nim |
12:44:00 | meeeee3 | is there a way to avoid writing iup.open( but just open( without triggering error -> ambiguous call; both system.open(... |
12:44:10 | meeeee3 | dont want to mix it |
12:44:20 | meeeee3 | some iup. some without |
12:46:09 | meeeee3 | also system.open and iup.open dont have the same paramers |
12:46:19 | meeeee3 | wat da heww |
12:46:34 | endragor | I personally would not do so. "iup" is short enough, and it's better if reader of the code can quickly distinguish whether that is system proc or iup proc without having to think. (I don't know the answer to your question though) |
12:47:59 | meeeee3 | ok, but why does the compiler think i want to call a function that takes 4 parameters with a call with two parameters |
12:48:02 | def- | meeeee3: discard open(nil, nil) works for me |
12:48:14 | def- | meeeee3: maybe it's just a compiler bug in an old Nim version |
12:48:21 | meeeee3 | i hope ^^ |
12:48:34 | meeeee3 | latest installer |
12:48:46 | * | polde quit (Ping timeout: 272 seconds) |
12:49:53 | def- | right, that was a bug in 0.10.2, it's fixed now |
12:50:56 | * | polde joined #nim |
12:54:04 | meeeee3 | endragor: i thought in that direction, because i like oop style.calls() |
12:55:15 | meeeee3 | dont know if par.iup.call() is or should be a thing .. |
12:56:31 | meeeee3 | no |
13:01:20 | * | saml_ joined #nim |
13:06:20 | * | meeeee3 left #nim (#nim) |
13:11:34 | * | polde quit (Ping timeout: 272 seconds) |
13:28:41 | * | HakanD_ joined #nim |
13:30:14 | * | BitPuffin joined #nim |
13:35:06 | * | Kingsquee quit (Quit: Konversation terminated!) |
14:02:12 | * | polde joined #nim |
14:13:42 | * | irrequietus joined #nim |
14:19:20 | * | polde quit (Ping timeout: 272 seconds) |
14:26:28 | * | polde joined #nim |
14:36:08 | * | flaviu quit (Remote host closed the connection) |
14:36:23 | * | flaviu joined #nim |
14:38:06 | * | Senketsu quit (Ping timeout: 244 seconds) |
14:43:59 | * | darkf quit (Quit: Leaving) |
14:51:39 | * | HakanD_ quit (Quit: Be back later ...) |
14:53:26 | endragor | is there a standard iterator to iterate sequence in reversed order? |
14:55:04 | def- | endragor: don't think so |
14:59:07 | * | HakanD_ joined #nim |
15:01:56 | * | mpthrapp joined #nim |
15:02:39 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:03:21 | * | BitPuffin quit (Ping timeout: 252 seconds) |
15:09:03 | * | nima joined #nim |
15:15:04 | * | wan quit (Ping timeout: 272 seconds) |
15:15:18 | * | nima quit (Quit: Page closed) |
15:17:07 | * | mpthrapp quit (Remote host closed the connection) |
15:23:23 | gmpreussner|work | i'm having trouble compiling c2nim @ head today (with nim @ head in Devel) |
15:23:33 | gmpreussner|work | it can't find 'compiler/llstream' even though the file is there |
15:23:52 | gmpreussner|work | did something change with how module paths are resolved? |
15:24:22 | gmpreussner|work | this is on Windows btw |
15:29:45 | * | wan joined #nim |
15:32:21 | * | BitPuffin joined #nim |
15:38:20 | * | Ven joined #nim |
15:38:48 | def- | gmpreussner|work: works for me on linux |
15:49:00 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:52:05 | * | Ven joined #nim |
15:57:42 | * | BitPuffin quit (Remote host closed the connection) |
16:00:40 | * | irrequietus quit (Remote host closed the connection) |
16:00:57 | * | irrequietus joined #nim |
16:02:37 | * | BitPuffin joined #nim |
16:19:12 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:19:30 | * | Ven joined #nim |
16:23:54 | * | Ven quit (Ping timeout: 246 seconds) |
16:26:01 | * | ChrisMAN joined #nim |
16:26:40 | * | reem joined #nim |
16:28:38 | * | coopernurse joined #nim |
16:29:46 | * | Ven joined #nim |
16:30:32 | * | EXetoC joined #nim |
16:37:46 | Araq | gmpreussner|work: not sure what your problem is but path handling didn't change |
16:41:50 | * | reem quit (Remote host closed the connection) |
16:48:30 | * | irrequietus quit () |
16:57:29 | * | Strikecarl joined #nim |
16:57:34 | Strikecarl | Uhm. |
16:57:37 | Strikecarl | http://nim-lang.org/hashes.html |
16:57:44 | Strikecarl | A way i can dehash the hash? |
17:00:45 | dom96 | Strikecarl: most hashing functions are one-way. |
17:00:59 | Strikecarl | Ah, okay! |
17:03:24 | * | HakanD_ quit (Read error: Connection reset by peer) |
17:03:59 | * | dtscode is now known as charmander |
17:04:05 | * | charmander is now known as mewtwo |
17:04:30 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:05:15 | * | brson joined #nim |
17:06:44 | * | endragor quit (Ping timeout: 265 seconds) |
17:06:48 | Strikecarl | dom96 I just tried making a simple case statement |
17:06:50 | Strikecarl | like ths |
17:07:21 | Strikecarl | http://pastebin.com/qzHBGG0Q |
17:07:52 | dom96 | what error do you get? |
17:07:55 | Strikecarl | dont mind me that forgot echo inside the statements |
17:07:57 | Strikecarl | i get the error |
17:08:02 | Strikecarl | e:\nim\nim.nim(6, 5) Error: type mismatch: got (string) but expected 'THash' |
17:08:09 | Strikecarl | which is line 5 |
17:08:13 | Strikecarl | cause i just added a extra int |
17:08:18 | Strikecarl | line 5 in the pastebin |
17:08:52 | * | Ven joined #nim |
17:09:04 | dom96 | Strikecarl: So what can you see on line 5? |
17:09:13 | dom96 | ' of "33479340351518853":' |
17:09:14 | dom96 | Right? |
17:09:17 | Strikecarl | yes |
17:09:23 | dom96 | You've got a String in there. |
17:09:28 | dom96 | not a 'THash' |
17:09:30 | dom96 | hence the error. |
17:09:43 | Strikecarl | How do i convert the string |
17:09:46 | Strikecarl | to a THash? |
17:10:21 | dom96 | You shouldn't do that. |
17:10:30 | dom96 | You should instead of convert the THash into a string. |
17:10:34 | dom96 | in the line above |
17:10:58 | Strikecarl | Error: conversion from THash to string is invalid |
17:11:06 | Strikecarl | I guess i dont do case string wordhashed: |
17:11:32 | dom96 | Are you trying to convert it via string()? |
17:11:47 | Strikecarl | Nope |
17:11:49 | Strikecarl | i just did |
17:11:52 | Strikecarl | case string wordhashed: |
17:11:53 | Strikecarl | instead of |
17:11:55 | Strikecarl | case wordhashed: |
17:12:00 | Strikecarl | -_- |
17:12:18 | dom96 | that's equivalent to 'case string(wordhashed)' |
17:12:38 | Strikecarl | neither works. |
17:12:42 | dom96 | In Nim, when you want to convert something to a string ALWAYS use `$`. |
17:12:55 | Strikecarl | oh |
17:12:58 | dom96 | Yes, I know. I'm trying to explain things to you. |
17:13:05 | dom96 | i.e. |
17:13:10 | dom96 | case $wordhashed: |
17:13:12 | dom96 | is what you want |
17:13:20 | Strikecarl | so using $ just makes it to a string |
17:13:23 | dom96 | Yes. |
17:13:37 | dom96 | The dollar sign is the "stringification" operator. |
17:13:37 | Strikecarl | Woops, that was easy. |
17:13:41 | Strikecarl | Thanks alot dom96! |
17:13:49 | dom96 | np |
17:16:32 | * | endragor joined #nim |
17:19:38 | flaviu | Strikecarl: You can often dehash the "hash" here. |
17:19:46 | flaviu | https://github.com/Araq/Nim/blob/master/lib/pure/hashes.nim#L113 |
17:19:53 | flaviu | since it isn't actually a hash. |
17:20:42 | Strikecarl | so like, |
17:20:47 | BlaXpirit | pretty sure it is a hash |
17:20:49 | Strikecarl | echo hash*(longnumberofhashhere) |
17:21:35 | Strikecarl | also is there commenters that do multiple lines at once |
17:21:38 | Strikecarl | like in c++ theres /* |
17:21:42 | Strikecarl | and to end it */ |
17:21:52 | dom96 | discard """ """ |
17:21:59 | Strikecarl | ? |
17:22:23 | BlaXpirit | use a good text editor |
17:25:20 | flaviu | BlaXpirit: Only in the strict definition of the term, and then only for datatypes > 4 bytes. |
17:26:14 | * | UberLambda joined #nim |
17:27:41 | * | reem joined #nim |
17:31:13 | * | UberLambda quit (Quit: Leaving) |
17:32:15 | * | UberLambda joined #nim |
17:33:10 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:34:09 | gmpreussner|work | is "{.push hint[XDeclaredButNotUsed]:off.}" still the right way to disable hints for unused const declarations in binding modules? |
17:34:55 | BlaXpirit | hm, gmpreussner|work, i recently used the same but without push |
17:35:09 | BlaXpirit | would like to know too |
17:35:28 | BlaXpirit | gmpreussner|work, deadcodeelim works well |
17:35:40 | BlaXpirit | seems to achieve the same effect |
17:35:45 | gmpreussner|work | i thought "{.deadCodeElim: on.}" would do the trick, but it didn't for const |
17:36:33 | gmpreussner|work | actually, i should be more specific: it doesn't work for const arrays |
17:36:37 | gmpreussner|work | maybe this is a bug |
17:36:49 | gmpreussner|work | i have: const foo = [1, 2, 3] |
17:37:23 | gmpreussner|work | oh nevermind, the following wasn't caught either: const bar = 9 |
17:37:53 | gmpreussner|work | 'bar' is declared but not used [XDeclaredButNotUsed] |
17:45:05 | * | reem quit (Quit: Leaving...) |
17:47:21 | Araq | what has deadCodeElim to do with that? |
17:47:46 | Araq | and why is it a bug when the compiler properly complains about artifacts in your code? |
17:48:26 | BlaXpirit | read again then |
17:49:13 | Araq | I read it again. nothing changed. now what? |
17:49:25 | gmpreussner|work | Araq, what is the correct way to disable this warning? |
17:49:49 | Araq | your push way. |
17:50:12 | Araq | but I would simply remove the unused const in the wrapper |
17:50:21 | gmpreussner|work | ? |
17:50:35 | BlaXpirit | ... |
17:50:36 | Araq | const unUsed = 4 # well? remove it then? |
17:50:47 | gmpreussner|work | sigh |
17:50:51 | BlaXpirit | sigh indeed |
17:51:02 | gmpreussner|work | ok, those const values are actually important to consumers of the wrapper :) |
17:51:12 | BlaXpirit | "what has deadCodeElim to do with that?" well it silences XDeclaredButNotUsed warnings too |
17:51:16 | Araq | why are they not exported then? |
17:51:24 | Araq | BlaXpirit: no it doesn't. |
17:51:34 | gmpreussner|work | Araq, alright, that is the actual problem |
17:51:36 | gmpreussner|work | thank you :) |
17:52:09 | BlaXpirit | "why is it a bug when the compiler properly complains about artifacts in your code?" he mistakenly thought it may not work only for arrays |
17:52:30 | gmpreussner|work | it's all good. my bad. |
17:54:20 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:58:52 | Varriount | Araq: Which revision should I build the installer from? |
17:59:30 | * | mewtwo is now known as dtscode |
17:59:59 | Araq | Varriount: first please fix our "minimal mingw" stuff. we need to test somthing which uses --app:ui works too. |
18:00:19 | Araq | or we abandon the "minimal mingw" idea |
18:00:49 | Araq | since it's an optional download now, maybe we should? |
18:01:40 | * | brson quit (Quit: leaving) |
18:04:54 | * | johnsoft quit (Read error: Connection reset by peer) |
18:09:59 | Varriount | Hm, probably |
18:12:27 | Araq | but people want to use Nim from USB sticks, so a small selfcontained package is nice |
18:23:11 | endragor | how do you fill array with same values, but different from type defaults? Searching index by "fill" didn't reveal anything, and no other synonyms come to my mind. |
18:25:21 | BlaXpirit | https://github.com/Araq/Nim/blob/e7d709791942480cc60afc5e34ec75ec26402b9e/lib/pure/collections/sequtils.nim#L50 |
18:25:39 | endragor | that's seq, not array |
18:25:44 | BlaXpirit | riiigh... |
18:25:46 | BlaXpirit | t |
18:25:48 | BlaXpirit | use a loop |
18:25:54 | endragor | :( |
18:27:27 | BlaXpirit | you're gonna have to live with this |
18:28:03 | BlaXpirit | nim's standard library wasn't designed, it was grown |
18:31:36 | BlaXpirit | hm |
18:31:59 | renesac | it just has to be refined more |
18:32:02 | renesac | repeat could be generalized for arrays |
18:32:25 | renesac | and that is not an iterator anyway |
18:32:44 | BlaXpirit | endragor, a.map_it(6) |
18:33:07 | BlaXpirit | (sequtils) |
18:35:55 | * | BitPuffin quit (Remote host closed the connection) |
18:37:23 | renesac | https://github.com/Araq/Nim/pull/2461 <-- quick pull request |
18:37:52 | * | BitPuffin joined #nim |
18:38:20 | * | BitPuffin quit (Remote host closed the connection) |
18:39:19 | renesac | [06:30:16] <BlaXpirit> how to do method dynamic dispatch at compile time? <-- the compile time alternative is using concepts and composition, I think |
18:39:23 | * | BitPuffin joined #nim |
18:39:39 | BlaXpirit | that is not an alternative |
18:40:01 | BlaXpirit | i don't see how that provides polymorphism |
18:41:30 | Araq | I don't see what's wrong with 'case' at compile-time. This is 2015, nobody gives a shit about "OO design" anymore. |
18:41:44 | renesac | https://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29 <-- it is the second type of polimorphism there |
18:41:45 | EXetoC | oh really? :p |
18:41:48 | BlaXpirit | problem is rewriting everything -____- |
18:42:36 | renesac | but you can mention some specific type requeriments (kinda like a base class) with concepts |
18:43:07 | BlaXpirit | i want a seq of objects |
18:43:22 | BlaXpirit | that act differently when a function is called |
18:44:14 | * | BitPuffin quit (Remote host closed the connection) |
18:44:58 | * | BitPuffin joined #nim |
18:44:59 | EXetoC | Araq: except most programmers? or was there really a shift? |
18:45:30 | EXetoC | BlaXpirit: what about callbacks? |
18:45:36 | renesac | rust don't supports classical OO design and seems to be getting quite a following |
18:46:00 | BlaXpirit | php got quite a following |
18:46:02 | BlaXpirit | pls |
18:46:04 | * | johnsoft joined #nim |
18:46:11 | renesac | just saying |
18:46:12 | renesac | XD |
18:46:26 | Araq | EXetoC: "most programmers" never understood OO to begin with. |
18:47:25 | * | irrequietus joined #nim |
18:50:04 | renesac | quick question: can macros be used to create and import artificial modules on the fly? |
18:50:25 | Araq | yes, I think so. |
18:50:37 | Araq | via writeFile which works at compile-time |
18:50:37 | renesac | to get that conflict resolution on variable names |
18:50:56 | renesac | hum |
18:52:03 | flaviu | BlaXpirit: struct of function pointers? |
18:52:25 | BlaXpirit | someone is gonna make a library that uses artificial modules to make namespaces |
18:52:36 | renesac | BlaXpirit: you already know for what |
18:53:00 | BlaXpirit | flaviu, hmmmm |
18:54:03 | BlaXpirit | let's just hope function pointers work at compile time |
18:54:19 | Araq | uh oh ... |
18:54:27 | BlaXpirit | :| |
18:54:32 | Araq | well they *should* work |
18:54:56 | Araq | spent some time thinking about them so that they can work |
18:55:03 | EXetoC | Araq: that's a different thing but ok |
18:55:22 | BlaXpirit | such silly workarounds |
18:56:07 | EXetoC | just play the waiting game then |
18:56:13 | Araq | BlaXpirit: feel free to fix the VM so that 'method' and 'ref' works |
18:56:54 | BlaXpirit | how can i feel free when i've never seen vm code |
18:57:06 | BlaXpirit | renesac, if you are talking about docopt, i don't see how namespaces can be useful |
18:57:32 | BlaXpirit | i mean, if you're gonna use namespaces, just use square brackets instead |
18:57:38 | renesac | BlaXpirit: instead of emulating namespaces via prefixes |
18:58:02 | BlaXpirit | i have quite a different vision of this stuff |
18:58:42 | * | BitPuffin quit (Remote host closed the connection) |
18:58:51 | renesac | and being like a module, you can ommit the module name (flags, cmd, arg) if there is no conflict |
18:59:02 | * | BitPuffin joined #nim |
18:59:06 | BlaXpirit | hm that's actually an interesting idea |
19:00:00 | BlaXpirit | what i'm (hopefully) gonna do first is make it work at compile time |
19:00:14 | BlaXpirit | then maybe nothing else is needed |
19:00:22 | renesac | oh, now I understood your problem |
19:00:40 | renesac | with compile time OOP |
19:00:58 | BlaXpirit | gonna make the lib ugly as heck |
19:01:09 | BlaXpirit | wait till you see how i replaced regexes with rudimentary code |
19:01:32 | renesac | do python uses regex? |
19:01:42 | BlaXpirit | yes |
19:01:50 | renesac | :/ |
19:02:01 | renesac | yeah... that is gonna be ugly |
19:02:23 | * | BlaXpirit_ joined #nim |
19:03:09 | * | vendethiel- quit (Ping timeout: 245 seconds) |
19:03:10 | * | vendethiel joined #nim |
19:03:29 | renesac | why regex don't work at compile time? |
19:03:34 | renesac | because it is an impure module? |
19:04:09 | BlaXpirit_ | yes |
19:04:34 | * | BitPuffin quit (Remote host closed the connection) |
19:04:35 | renesac | isn't better to re-write the parts of the regex module you need |
19:04:41 | renesac | and keep the code like it is |
19:04:52 | BlaXpirit_ | i tried that first |
19:05:05 | BlaXpirit_ | dived nose-first into writing a regex implementation |
19:05:11 | BlaXpirit_ | forgetting the most important difficulty of it |
19:05:17 | renesac | even an non-optimized one is difficult? |
19:05:30 | BlaXpirit_ | i forgot about backtracking |
19:05:36 | * | renesac never looked into that |
19:06:12 | BlaXpirit_ | .*abc zxcabc .* consumes everything and abc can't be matched |
19:06:31 | BlaXpirit_ | that's my fail |
19:06:54 | * | gsingh93 joined #nim |
19:07:12 | Araq | BlaXpirit_: take a look at my lexim project |
19:07:13 | BlaXpirit_ | then Arаq said he got some regex implementation |
19:07:19 | Araq | yup |
19:07:24 | * | BitPuffin joined #nim |
19:07:39 | Araq | but it's built as the base for a lexer generator |
19:08:03 | BlaXpirit_ | i don't know what to look at : |
19:08:18 | Araq | a real regex impl needs years of work since regexes are a horrible clusterfuck |
19:09:16 | BlaXpirit_ | naaah |
19:09:33 | Araq | but hey, my implementation does handle * and beats PCRE by a factor of 8 |
19:09:34 | BlaXpirit_ | maybe if it involves unicode |
19:09:58 | Araq | * vs *? non-capturnig groups, capturing groups, unicode classes |
19:10:11 | Araq | . sometimes matches \n, sometimes it doesn't |
19:10:24 | Araq | \a and \z and \b |
19:10:32 | Araq | zero length matches |
19:10:36 | Araq | back references |
19:10:56 | Araq | trust me, full fledged regexes are horrible to support |
19:11:53 | Araq | and at the end a lexer generator is far more useful :P |
19:12:13 | * | BitPuffin quit (Read error: Connection reset by peer) |
19:12:26 | BlaXpirit_ | just make it accessible please :| |
19:13:20 | Araq | well I'm building a lexer generator out of it |
19:13:36 | renesac | well, it is indeed a lexer that is needed to parse the docopt DSL |
19:13:50 | Araq | you can use it as a base for a proper regex implementation, but I won't do that |
19:14:34 | renesac | but BlaXpirit code is already written based on regex |
19:15:04 | renesac | I don't know if the interface is too different |
19:15:32 | Araq | as soon as it's useful some BlaXpirit will come along and say "but this doesn't support XYZ" and some FUD campaign starts and everybody will use the pcre based stuff anyway |
19:15:49 | BlaXpirit_ | well sure |
19:16:01 | BlaXpirit_ | there is absolutely no reason to make a regex implementation |
19:16:12 | renesac | the main requeriment is that it should work at compile time |
19:16:15 | renesac | :P |
19:16:30 | Araq | see above, I beat PCRE by a facter of 8 without trying hard. |
19:16:42 | Araq | but yes, "no reason" |
19:16:45 | BlaXpirit_ | you may be forgetting something important |
19:17:25 | renesac | factor of 8 for small things, or asymptotically? |
19:17:42 | Araq | for a benchmark where pcre doesn't cheat :P |
19:17:56 | Araq | (but then we can easily cheat too) |
19:18:08 | flaviu | Araq: Keep in mind PCRE is interpreted. |
19:18:13 | flaviu | Does it still beat the JIT? |
19:18:30 | Araq | flaviu: dunno but my implemention is interpreted too |
19:18:41 | Araq | for this benchmark |
19:18:56 | flaviu | ah, ok. |
19:36:59 | endragor | in which memory do arrays get allocated? |
19:38:43 | endragor | I get segementation fault when trying to allocate large array (100mil elements) from a function, but no problem when I do the same from top level scope |
19:42:27 | flaviu | endragor: if something like var foo: array[1000000, bar], on the stack |
19:42:46 | flaviu | If you'd like to be sure, use clang and --passC:-fsanitize=address --passL:-fsanitize=address |
19:47:51 | * | HakanD_ joined #nim |
19:49:22 | Araq | endragor: 100 million elements array sounds like you want to use a 'seq' or maybe a saner data structure |
19:51:39 | endragor | yeah, I know I'm doing crazy stuff. Just was surprised it worked from top level |
19:55:55 | * | brson joined #nim |
19:56:08 | def- | endragor: inside a proc it will be on the stack, global arrays in the data segment |
19:56:28 | endragor | I see |
20:15:49 | * | endragor quit (Remote host closed the connection) |
20:16:27 | * | UberLambda quit (Quit: Leaving) |
20:17:01 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
20:35:12 | BlaXpirit | lol |
20:35:46 | BlaXpirit | refs accomplish so much more than dynamic dispatch |
20:36:01 | BlaXpirit | this is futile |
20:37:48 | Varriount | BlaXpirit: Howso? |
20:38:19 | BlaXpirit | do u know what i'm talking about |
20:38:44 | Varriount | Well, I know what a reference is, and I know what dynamic dispatch is. |
20:39:16 | BlaXpirit | ok so I thought all I needed is dynamic dispatch at compile time |
20:39:36 | BlaXpirit | so i replaced it with lame conditionals |
20:39:38 | BlaXpirit | but apparently I also need a seq of refs |
20:40:28 | dom96 | BlaXpirit: what are you writing? |
20:40:51 | BlaXpirit | did another push to make docopt work at compile time |
20:44:09 | * | Kingsquee joined #nim |
20:49:17 | Araq | BlaXpirit: well sometimes 'ref' works :P |
20:50:15 | * | BitPuffin joined #nim |
20:51:42 | Varriount | Araq: Anything besides --app:gui ? |
21:07:17 | Araq | Varriount: well ... let me go through the list of PRs |
21:07:48 | * | repax joined #nim |
21:15:28 | * | NimBot joined #nim |
21:22:36 | * | irrequietus quit () |
21:27:02 | * | Strikecarl joined #nim |
21:28:12 | Strikecarl | Araq you here? |
21:28:16 | * | repax quit (Quit: repax) |
21:28:35 | Araq | yes |
21:28:42 | Strikecarl | uhm |
21:28:45 | Strikecarl | hash() |
21:28:49 | Strikecarl | can i dehash the THash? |
21:30:14 | Strikecarl | or is it final? |
21:30:15 | reactormonk | Strikecarl, nope, impossible by definition |
21:30:23 | Strikecarl | Damnit. |
21:30:34 | reactormonk | a hash is a one-way operation. hashtabels 101 :-) |
21:30:40 | * | flaviu quit (Remote host closed the connection) |
21:30:53 | reactormonk | But I think we have an XY problem. What are you trying to do? |
21:31:06 | Strikecarl | Idk, was just wondering. |
21:31:14 | Strikecarl | Messing around with the hash() |
21:31:41 | BlaXpirit | -_- |
21:31:51 | * | flaviu joined #nim |
21:32:18 | reactormonk | Strikecarl, https://en.wikipedia.org/wiki/Hash_table |
21:32:39 | reactormonk | just read the first half and you'll see why |
21:34:12 | Strikecarl | Does NIM support MD5? |
21:36:12 | def- | Strikecarl: you can search for libraries here: http://nim-lang.org/lib.html |
21:36:37 | flaviu | Strikecarl: That isn't really a useful question. It's a general purpose language, so MD5 can be implemented in Nim. |
21:37:01 | flaviu | But there is an MD5 implementation in the stdlib: http://nim-lang.org/md5.html |
21:38:05 | Strikecarl | Found it. |
21:41:04 | * | HakanD_ quit (Ping timeout: 255 seconds) |
21:47:35 | * | irrequietus joined #nim |
21:47:39 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
21:52:01 | * | gsingh93 quit (Ping timeout: 264 seconds) |
21:59:40 | reactormonk | where's the definition which flags are used by the compiler by default? |
21:59:48 | reactormonk | stuff like stacktrace:on |
22:00:22 | Varriount | Compiler user guide? |
22:00:44 | reactormonk | Varriount, that's the documentation. I'm looking for the code definition |
22:00:53 | reactormonk | I wanna add another one |
22:02:18 | def- | reactormonk: nim.cfg i guess |
22:02:21 | Varriount | reactormonk: options.nim and nim.nim |
22:02:33 | reactormonk | def-, nope, only overrides in there |
22:02:35 | def- | (nope, varriound is right |
22:02:35 | def- | ) |
22:02:44 | reactormonk | Varriount, I'm currently at commands.nim, I'll go take a look |
22:07:03 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:10:04 | * | Jehan_ joined #nim |
22:10:33 | * | wink-s joined #nim |
22:11:24 | * | wink-s quit (Client Quit) |
22:17:57 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:30:17 | * | gsingh93 joined #nim |
22:34:36 | * | xet7 quit (Ping timeout: 272 seconds) |
22:58:58 | * | coopernurse quit (Remote host closed the connection) |
23:01:37 | * | coopernurse joined #nim |
23:07:25 | * | jefus_ joined #nim |
23:11:03 | * | Demon_Fox joined #nim |
23:11:39 | * | jefus quit (Ping timeout: 265 seconds) |
23:28:11 | Jehan_ | Is it me or is the csources master out of sync with the Nim master branch? |
23:29:47 | def- | Jehan_: maybe the problem is that devel is the default branch of csources? |
23:30:03 | Jehan_ | def-: I used -b master |
23:30:16 | def- | ok, I'm trying currently |
23:31:13 | Jehan_ | I'm usually working off devel (not necessarily bleeding edge devel, but some point on devel), so I didn't notice it until now. |
23:31:33 | def- | apparently no one noticed. I don't see any changes in the master branches for quite some time |
23:32:32 | * | irrequietus quit () |
23:33:12 | def- | master branch bootstraps fine for me from master csources |
23:35:26 | * | johnsoft quit (Ping timeout: 244 seconds) |
23:36:14 | * | johnsoft joined #nim |
23:39:50 | * | Demon_Fox quit (Ping timeout: 256 seconds) |
23:43:25 | * | Demon_Fox joined #nim |
23:43:30 | Jehan_ | Hmm. Let me check what I did wrong. |
23:44:03 | flaviu | Jehan_: Try gcc if you've been using clang. |
23:46:06 | Jehan_ | Ugh, I think I see. devel is the default branch for Nim, too, not just csources. |
23:46:44 | Jehan_ | So I was building the devel branch with the csources from master without realizing it. |
23:50:03 | Varriount | I really wish we had a better way of warning people about that. |
23:50:22 | Jehan_ | I hadn't realized that master already didn't typecheck `expr` arguments of templates/macros. Interesting. |
23:51:06 | Jehan_ | Unless it does and I'm just not thinking straight on account of the time of night. :) |
23:51:27 | Araq | that change is quite old, yes |
23:52:53 | Jehan_ | I'm writing a response to winksaville w.r.t. immediate and wanted to make sure that I get it right. |
23:53:12 | Jehan_ | So, essentially, a template/macro with all `expr` arguments is already equivalent to {.immediate.}? |