00:10:41 | * | Jesin joined #nim |
00:14:34 | * | relax joined #nim |
00:26:59 | * | sz0 quit (Quit: Connection closed for inactivity) |
00:31:59 | * | relax quit (Ping timeout: 248 seconds) |
00:38:48 | * | def-pri-pub joined #nim |
00:38:53 | * | relax joined #nim |
00:47:49 | * | mahmudov joined #nim |
00:50:07 | * | relax quit (Ping timeout: 248 seconds) |
00:52:13 | * | pilne joined #nim |
00:56:26 | def-pri-pub | zacharycarter: 2 byte patch; https://github.com/zacharycarter/zengine/pull/27 |
01:22:00 | * | vivus joined #nim |
01:36:18 | * | def-pri-pub quit (Quit: leaving) |
01:38:30 | * | chemist69 quit (Ping timeout: 240 seconds) |
01:45:31 | * | BitPuffin|osx quit (Ping timeout: 255 seconds) |
01:52:34 | * | chemist69 joined #nim |
02:11:41 | * | endragor joined #nim |
02:16:05 | * | endragor quit (Ping timeout: 240 seconds) |
03:07:04 | * | vlad1777d joined #nim |
03:22:30 | * | big_num quit (Quit: WeeChat 1.7) |
03:27:09 | * | endragor joined #nim |
03:43:05 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
03:48:07 | * | vivus quit (Quit: Leaving) |
03:59:49 | * | dddddd quit (Remote host closed the connection) |
04:07:03 | * | ryu0 joined #nim |
04:07:30 | * | ryu0 left #nim (#nim) |
04:13:28 | * | ibash joined #nim |
04:22:41 | * | ibash left #nim ("Textual IRC Client: www.textualapp.com") |
04:30:04 | * | arnetheduck quit (Remote host closed the connection) |
04:33:22 | * | mahmudov quit (Ping timeout: 255 seconds) |
04:33:49 | * | mahsav quit (Ping timeout: 255 seconds) |
04:36:55 | * | Yardanico joined #nim |
04:49:18 | * | yglukhov joined #nim |
04:50:09 | * | arnaud2 quit (Ping timeout: 248 seconds) |
04:53:22 | * | yglukhov quit (Ping timeout: 240 seconds) |
05:03:21 | * | rauss quit (Quit: WeeChat 1.9) |
05:05:25 | * | mahmudov joined #nim |
05:06:07 | * | Yardanico quit (Ping timeout: 248 seconds) |
05:06:59 | * | Vladar joined #nim |
05:10:28 | * | ketralnis joined #nim |
05:14:59 | * | pilne quit (Quit: Quitting!) |
05:55:40 | * | mahmudov quit (Remote host closed the connection) |
05:57:03 | * | mahsav joined #nim |
06:09:09 | * | ShalokShalom joined #nim |
06:12:34 | * | Arrrr joined #nim |
06:31:35 | * | nsf joined #nim |
06:49:23 | * | yglukhov joined #nim |
06:54:19 | * | endragor quit (Remote host closed the connection) |
07:00:43 | * | endragor joined #nim |
07:03:41 | * | PMunch joined #nim |
07:05:27 | * | endragor quit (Ping timeout: 240 seconds) |
07:10:46 | * | pydsigner quit (Ping timeout: 246 seconds) |
07:10:56 | * | pydsigner joined #nim |
07:21:27 | * | endragor joined #nim |
07:22:47 | * | Yardanico joined #nim |
07:35:49 | gokr | dom96: Got the book yesterday ;) |
07:39:45 | * | Arrrr quit (Ping timeout: 248 seconds) |
07:47:44 | * | TheManiac quit (Ping timeout: 240 seconds) |
07:47:52 | * | TheManiac joined #nim |
07:51:09 | * | scriptum joined #nim |
07:52:42 | euantor | The new UI on nimble.directory is a vast improvement, good work dom96 :) |
07:59:16 | * | couven92 joined #nim |
08:37:39 | * | Yardanico quit (Read error: Connection reset by peer) |
08:37:55 | * | Yardanico_ joined #nim |
08:37:55 | * | Yardanico_ quit (Client Quit) |
08:38:20 | * | Yardanico joined #nim |
08:42:53 | PMunch | dom96, on nim-lang.org it says: * Printed soft cover book hasn't been released yet. ETA 11 Aug 2017. |
08:42:58 | PMunch | Might want to update that? |
08:44:14 | * | Arrrr joined #nim |
08:44:39 | Jipok[m] | https://nim-lang.org/docs/backends.html |
08:44:41 | Jipok[m] | text is hard to see |
08:45:15 | Jipok[m] | https://i.imgur.com/4NoBPMo.png |
08:45:32 | Jipok[m] | https://i.imgur.com/OqBHT68.png |
08:46:51 | PMunch | Jipok[m], I think that's a font option on your end. Looks fine here |
08:47:19 | * | jinshil quit (Quit: Good-bye!) |
08:47:34 | Jipok[m] | But all the other pages of documentation are seen well |
08:47:49 | Jipok[m] | https://i.imgur.com/mNCcbA5.png |
08:48:30 | Yardanico | Jipok[m], I don't have this problem too |
08:48:48 | Jipok[m] | Maybe it's because of the outdated version of the document? |
08:48:53 | PMunch | That's odd, they are defined with the same fonts |
08:48:54 | Jipok[m] | Version: 0.14.0 |
08:50:51 | PMunch | If you inspect element you can see which font is being used for both pages |
08:53:19 | * | pydsigner quit (Ping timeout: 246 seconds) |
08:53:29 | * | pydsigner joined #nim |
08:55:20 | * | Matthias247 joined #nim |
08:56:05 | Yardanico | can I use "replace" from PEG on unicode words? |
08:56:10 | Yardanico | *strings |
08:56:31 | * | Matthias247 quit (Client Quit) |
08:56:55 | Yardanico | because seems not to work |
08:56:58 | PMunch | The documentation says "UTF-8 is supported" |
08:57:03 | Yardanico | but |
08:57:06 | PMunch | So it should work in theory I think |
08:57:17 | Jipok[m] | So, I added this to the styles |
08:57:22 | Jipok[m] | https://pastebin.com/96309yjZ |
08:57:28 | Yardanico | echo "приветhello".replace(peg"[^А-Яа-я]*") should print "привет" but it does print this: п�иве� |
08:57:33 | Jipok[m] | And now it looks normal |
08:57:59 | crem | :) |
08:58:33 | PMunch | Ah yes Jipok[m] the backend page seems to have some issues loading the Raleway font, so if you don't have HelveticaNeue installed then it might look weird. |
08:59:11 | Araq | Yardanico: unicode ranges are not supported and probably should trigger an error :-) |
08:59:18 | Yardanico | Araq, eh :( |
08:59:41 | Yardanico | I just thought it would work because "UTF-8 is supported" |
08:59:45 | Araq | echo "приветhello".replace(peg"[A-Za-z]*") |
09:00:05 | Yardanico | well I need to remove all non-russian letters from string |
09:00:22 | Yardanico | but it doesn't matter if resulting string would be slightly invalid |
09:00:31 | Yardanico | I just need to check for lenght if it would be 0 |
09:00:40 | Yardanico | *length |
09:01:53 | couven92 | Araq, would you like to review https://github.com/nim-lang/Nim/pull/6051 it's been a while now, I think euantor wanted leftAlign... :P |
09:03:16 | FromGitter | <ephja> Araq: what's missing? https://gist.github.com/ephja/dd0b62135de416bbd774a66b8d0ad679 |
09:04:53 | couven92 | hmmm, do we have a macro that can apply nep1 on all declared identifiers in a const, var or let block? |
09:05:02 | Araq | system/alloc.nim? |
09:05:37 | Araq | couven92: but is 'alignLeft' what Python uses? |
09:06:11 | Araq | think about the people who learn Nim by enumerating the differences to Python... |
09:06:42 | couven92 | Araq, what do you mean? the name of the proc? I'd be happy to rename it, should we use the SAME name as in python? |
09:06:50 | crem | nim is much better python! |
09:07:23 | Yardanico | well for tasks where speed and all compile checking is needed - yes |
09:07:50 | Yardanico | it's very annoying to write python code, execute it, fix errors (many type errors), and re-run it again |
09:07:57 | couven92 | Araq, it seems form my 3 second SO research that Python uses `ljust` |
09:07:59 | Yardanico | but hopefully PyCharm can check all this errors |
09:08:00 | FromGitter | <ephja> Araq: it is in the same directory as mmdisp.nim is. is it looking elsewhere? |
09:08:31 | euantor | Regarding that PR, the change that I suggested with `result[0 .. (s.len - 1)] = s` won't work as expected if `s` contains any `NULL` bytes in the string (eg: not at the end) due to the way slicing works in Nim |
09:08:54 | euantor | (I tripped over this issue a coupel of weekends and came here wondering what on earth was happening) |
09:09:27 | couven92 | I think `alignLeft` is better, more understandable for name |
09:09:49 | couven92 | euantor, okay, so should I revert your suggestion? |
09:09:58 | euantor | I think it may be for the best, yes |
09:10:27 | * | nattefrost joined #nim |
09:10:37 | Araq | euantor: that's not correct |
09:10:52 | Araq | but 'echo' is broken when it comes to zero bytes |
09:11:23 | Araq | couven92: thinking about it, this belongs to unicode.nim and needs to use runeLen |
09:11:59 | couven92 | Araq, oh? okay... I'll give it a shot later today |
09:12:35 | couven92 | what about a nep1 macro? do we have something like that (thinking that c2nim does that transformation?) |
09:12:51 | FromGitter | <ephja> I'm able to compile things with the nim exe |
09:15:05 | euantor | Araq: It was you who told me it was expected behaviour a while back |
09:15:19 | Araq | I doubt it. |
09:15:39 | Araq | ephja: ah, the search path setup is missing then? |
09:15:58 | Araq | couven92: we have no such macro and what would it do anyway? |
09:16:40 | Araq | macros transform the AST, they don't render the program text back to your editor |
09:17:39 | euantor | Hm, it does seem to work. I don't know what the problem I was having was then. Ignore me couven92! |
09:18:32 | * | euantor left #nim (#nim) |
09:18:47 | * | euantor joined #nim |
09:24:28 | FromGitter | <ephja> I'll see if I've missed anything from the usual initialization steps |
09:27:17 | euantor | Found my old question, I was confused slightly with this example code: https://glot.io/snippets/erjeacgl8y |
09:27:38 | euantor | I now understand what you were saying when answering me Araq - sorry if I was being dim at the time |
09:38:27 | * | endragor quit (Remote host closed the connection) |
09:39:09 | couven92 | Araq, yeah, I realize that the AST is not rerendered into the editor, but wel... Windows SDK headers are not c2nim friendly, so I cannot use c2nim to automagically import stuff, so I am using regexp to transform defines to nim constants |
09:39:37 | couven92 | I am fine with having an ugly.nim and importing that... because ast rewriting DOES work for nimsuggest |
09:39:39 | Araq | patch c2nim then |
09:40:04 | couven92 | Oh hell no! :O |
09:40:05 | Araq | it's not really a hard codebase |
09:40:34 | * | endragor joined #nim |
09:40:39 | couven92 | it's more that Windows SDK headers are ugly in every meaning of the word ugly |
09:40:40 | Araq | you can even give it yet another preprocessing step that takes regexes |
09:41:17 | Araq | you don't have to touch c2nim's logic to improve it, just add another pass, I wanted to do that too multiple times |
09:41:43 | couven92 | ... okay... there goes my next weekend... :P |
09:41:48 | FromGitter | <ephja> there we go ⏎ ⏎ ```options.setDefaultLibpath() ⏎ searchPaths.add(options.libpath)``` [https://gitter.im/nim-lang/Nim?at=599bfc5c97cedeb04828397d] |
09:42:10 | FromGitter | <ephja> globals<3 |
09:45:03 | * | endragor quit (Ping timeout: 248 seconds) |
09:49:09 | couven92 | Araq, hmmm... being able to have a --define:<value> option for C preprocessing would certainly be a thought |
09:49:22 | * | endragor joined #nim |
09:49:28 | Araq | wasn't that added already? |
09:49:38 | couven92 | recently? |
09:50:22 | * | endragor_ joined #nim |
09:50:32 | FromGitter | <ephja> graph.compileModule(gProjectMainIdx, cache, {sfMainModule}) -> "cannot open macros" |
09:53:06 | couven92 | Araq, yeah my bad, was using c2nim that is in the distribution package... 0.9.13 does indeed have --assumedef:IDENT |
09:53:25 | * | endrago__ joined #nim |
09:53:30 | * | endragor quit (Ping timeout: 240 seconds) |
09:54:10 | PMunch | Is that to resolve #ifdef in C code? |
09:54:40 | * | endragor_ quit (Ping timeout: 255 seconds) |
09:54:44 | couven92 | PMunch, yup |
09:54:52 | PMunch | Well that's practical |
09:55:22 | PMunch | Which I had known about that when I sat and tried to get the newest version of wxWidgets working.. |
09:56:09 | PMunch | I'm considering to join a GameJam here using Nim and my library by the way. It will be nice to have something to try it out on :) |
09:56:46 | FromGitter | <ephja> mmmm jam |
09:57:52 | couven92 | PMunch, yes the --assumedef is nice, but I need to actually define a symbol so that c2nim stops complaining... |
10:10:48 | Araq | couven92: use #def ? |
10:10:57 | couven92 | Araq, AH! |
10:11:18 | couven92 | it does not come up in `c2nim --help` |
10:13:43 | Araq | read its docs please |
10:14:07 | Araq | https://nim-lang.org/docs/c2nim.html |
10:16:27 | couven92 | got it |
10:16:49 | couven92 | but for some bizarre reason, it does not work even with `#def` |
10:20:42 | couven92 | I get `C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\winerror.h(27716, 7) Error: ';' expected` but line 27716 is the `#endif` of a preprocessorblock that c2nim should ignore because of `#ifdef __cplusplus`, I even put in `--assumendef:__cplusplus` for good measure |
10:25:30 | * | ShalokShalom_ joined #nim |
10:27:39 | * | gokr left #nim (#nim) |
10:28:52 | * | ShalokShalom quit (Ping timeout: 255 seconds) |
10:30:18 | * | haha_ joined #nim |
10:31:27 | FromGitter | <ephja> "loadConfigs(DefaultConfig, cfg)" this is not loading the system config for some reason I guess |
10:34:07 | * | sz0 joined #nim |
10:43:26 | FromGitter | <ephja> of course, it's all designed with the layout of the nim directory in mind, which makes it difficult to use the compiler package |
10:53:53 | * | zama quit (Ping timeout: 248 seconds) |
10:54:05 | * | yglukhov_ joined #nim |
10:54:57 | * | yglukhov quit (Ping timeout: 248 seconds) |
10:55:44 | * | zama joined #nim |
10:58:50 | * | PMunch_ joined #nim |
11:00:47 | * | haha_ quit (Ping timeout: 248 seconds) |
11:01:18 | * | Vindaar`` joined #nim |
11:01:19 | * | PMunch quit (Ping timeout: 248 seconds) |
11:01:21 | * | Vindaar` quit (Ping timeout: 248 seconds) |
11:01:41 | * | haha_ joined #nim |
11:01:52 | * | joshbaptiste_ quit (Ping timeout: 248 seconds) |
11:01:53 | * | kier quit (Ping timeout: 248 seconds) |
11:03:52 | * | abeaumont quit (Ping timeout: 240 seconds) |
11:05:15 | * | joshbaptiste_ joined #nim |
11:05:53 | * | kier joined #nim |
11:29:50 | * | Vindaar`` left #nim ("ERC (IRC client for Emacs 26.0.50.2)") |
11:54:49 | * | endrago__ quit (Remote host closed the connection) |
12:15:19 | * | endragor joined #nim |
12:20:15 | * | endragor quit (Ping timeout: 248 seconds) |
12:21:26 | * | vlad1777d quit (Remote host closed the connection) |
12:22:09 | * | BitPuffin|osx joined #nim |
12:23:24 | * | vlad1777d joined #nim |
12:24:57 | * | Amun_Ra quit (Ping timeout: 246 seconds) |
12:25:31 | * | endragor joined #nim |
12:25:31 | * | haha_ quit (Read error: Connection reset by peer) |
12:26:02 | * | haha_ joined #nim |
12:30:42 | * | Amun_Ra joined #nim |
12:31:12 | * | dddddd joined #nim |
12:33:06 | FromGitter | <ephja> Araq: "# Find out if $nim/../../lib/system.nim exists." isn't this outside the root directory? |
12:34:04 | * | gokr joined #nim |
12:37:25 | * | fraya joined #nim |
12:44:06 | * | ShalokShalom_ is now known as ShalokShalom |
12:46:25 | * | haha_ quit (Ping timeout: 246 seconds) |
12:47:03 | * | haha_ joined #nim |
12:48:16 | * | vlad1777d quit (Remote host closed the connection) |
12:49:58 | * | vlad1777d joined #nim |
12:52:28 | * | fraya quit (Quit: Leaving) |
13:00:39 | * | AndroUser2 joined #nim |
13:01:25 | * | haha_ quit (Ping timeout: 255 seconds) |
13:03:12 | * | abeaumont joined #nim |
13:04:59 | * | yeeve quit (Quit: Leaving) |
13:09:06 | * | haha_ joined #nim |
13:11:27 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
13:12:54 | * | vlad1777d quit (Remote host closed the connection) |
13:13:49 | * | vlad1777d joined #nim |
13:15:44 | * | arnaud2 joined #nim |
13:16:20 | * | PMunch_ quit (Quit: Leaving) |
13:16:31 | * | PMunch joined #nim |
13:16:35 | * | vlad1777d quit (Remote host closed the connection) |
13:17:08 | * | vlad1777d joined #nim |
13:23:00 | couven92 | is it acceptable to write a lonely discard statement to mark the end of a block (i.e. in cases where you have multiple block nested into each other) |
13:28:45 | * | dom96|w joined #nim |
13:29:41 | * | ludocode_ quit (Ping timeout: 240 seconds) |
13:29:41 | * | arnetheduck joined #nim |
13:29:43 | * | vlad1777d quit (Remote host closed the connection) |
13:31:05 | * | endragor quit (Remote host closed the connection) |
13:32:48 | * | vlad1777d joined #nim |
13:33:17 | * | vlad1777d quit (Remote host closed the connection) |
13:33:19 | * | gokr quit (Ping timeout: 248 seconds) |
13:33:53 | * | vlad1777d joined #nim |
13:33:55 | * | vlad1777d quit (Remote host closed the connection) |
13:34:22 | Yardanico | couven92, why it's useful? |
13:34:35 | Yardanico | well you can do it probably |
13:34:49 | Yardanico | but i recommend to set up your editor so it will highlight different indentation levels |
13:34:52 | couven92 | because I loose track of how many levels I have indented |
13:34:59 | couven92 | still... |
13:35:05 | * | ludocode joined #nim |
13:35:06 | * | vlad1777d joined #nim |
13:35:25 | Yardanico | couven92, well yes, you can use discard then (if you really want) |
13:35:36 | Yardanico | in this case it would be similar to python's "pass" |
13:35:58 | * | Arrrr quit (Read error: Connection reset by peer) |
13:37:22 | * | rauss joined #nim |
13:37:36 | dom96|w | You should fix your text editor not add noise to your code. |
13:38:04 | dom96|w | I'm afraid to say that I would stay away from code like that if I saw it. |
13:40:13 | * | relax joined #nim |
13:40:19 | * | arnetheduck quit (Ping timeout: 246 seconds) |
13:47:17 | * | BitPuffin|osx joined #nim |
13:48:55 | couven92 | I was just thinking loudly |
13:54:09 | * | Vindaar joined #nim |
13:59:13 | dom96|w | couven92: Sorry, hope what I said doesn't discourage you :) |
14:00:03 | couven92 | dom96|w, nah :P I mean, you can always define a helper proc to reduce the number of indent levels anyways, right? |
14:00:10 | Yardanico | yeah |
14:00:27 | dom96|w | yes, and in general you should aim to use as little indents levels as possible anyway. |
14:01:31 | * | AndroUser2 quit (Read error: Connection reset by peer) |
14:06:47 | Yardanico | also, what was the reason for using 2 spaces in most of them Nim code? just curious, I use 2 spaces myself |
14:07:47 | crem | The optimal is e spaces, but it's not easy to type non-integer amount of spaces. |
14:08:02 | * | endragor joined #nim |
14:08:35 | Yardanico | well I was just asking why not 4 :) |
14:08:50 | Yardanico | But it's fine for me actualyl |
14:08:54 | Yardanico | actually |
14:09:38 | crem | Usually when there is a limit of 80 chars for a width, indent is 2 to conserve horizontal space. |
14:11:16 | * | gangstacat joined #nim |
14:12:49 | * | endragor quit (Ping timeout: 248 seconds) |
14:15:58 | * | haha_ quit (Ping timeout: 276 seconds) |
14:21:47 | * | haha_ joined #nim |
14:21:48 | PMunch | Personally I prefer a single tab per indent level. That way everyone can size their tabs as they wish, and one level = one character which just makes sense. |
14:24:08 | crem | https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ |
14:24:31 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
14:25:05 | Yardanico | just a statistics thing) |
14:25:07 | Yardanico | :) |
14:25:34 | PMunch | _Uses_ tabs, or _prefers_ tabs? |
14:25:41 | * | dom96|w joined #nim |
14:25:53 | PMunch | I also use spaces at work since our style guide dictates it |
14:25:53 | * | gangstacat quit (Quit: Leaving) |
14:26:09 | PMunch | But I _prefer_ tabs |
14:26:33 | FromGitter | <ephja> so that's why I suddenly got a raise after running every source file through tabs2spaces |
14:28:15 | FromGitter | <ephja> Araq: So, why do you think that debuggers aren't as necessary for Nim than they are for certain other languages? |
14:29:15 | FromGitter | <ephja> The ability to print arbitrary objects and retrieve the stack trace at arbitrary locations certainly allows one to get by without one sometimes |
14:31:00 | * | gangstacat joined #nim |
14:31:12 | PMunch | I've found that GDB actually works pretty well for Nim :) |
14:31:25 | * | sz0 quit (Quit: Connection closed for inactivity) |
14:31:27 | PMunch | I'm off now |
14:31:28 | * | PMunch quit (Quit: Leaving) |
14:36:24 | Araq | ephja: I said debuggers are mostly worthless for debugging the Nim compiler because the bugs are manifestations of complex feature interactions. this means a section of code is run thousands of times before the interesting thing happens. This means conditional breakpoints and debuggers suck at these. |
14:37:37 | Araq | PMunch: sigh, tabs for indentation don't work, never have, never will. |
14:37:51 | Araq | you cannot *prefer* something that objectively does not work... |
14:38:11 | Yardanico | Araq, he can use them with filters thought :D but I doubt this is a good thing |
14:39:13 | * | gangstacat quit (Quit: Leaving) |
14:39:26 | Araq | someLongCall(a, |
14:39:38 | Araq | b # under 'a' please |
14:39:41 | Araq | ) |
14:39:51 | Yardanico | yeah I do that :) |
14:40:09 | Araq | tabs for indentation, spaces for alignment, so in other words, mix tabs and spaces |
14:41:27 | FromGitter | <andreaferretti> well, just put a on its new line |
14:41:31 | FromGitter | <andreaferretti> problem solved :-) |
14:41:56 | FromGitter | <andreaferretti> or just do not align things vertically |
14:42:18 | Araq | ok so tabs work with more restrictive layout rules. |
14:42:40 | FromGitter | <andreaferretti> yup, kind of |
14:42:40 | Araq | and these layout rules just so happen to describe a way that you can as easily automate with spaces only... |
14:43:09 | FromGitter | <andreaferretti> but you lose the ability to have each person set its preferred indent level |
14:43:20 | Araq | no, not at all. |
14:43:35 | FromGitter | <andreaferretti> but yeah, whatever, it's not something worth worrying about |
14:43:37 | FromGitter | <andreaferretti> :-) |
14:43:51 | Araq | an editor can easily detect the indentation and provide a "fake-tab width" switch |
14:44:17 | FromGitter | <andreaferretti> well, in theory yes |
14:44:27 | relax | one day, science will solve the social problem of tabs vs spaces |
14:44:30 | relax | ...one day |
14:44:32 | FromGitter | <andreaferretti> in practice this does not happen a lot |
14:45:01 | Yardanico | relax, by introducing new symbol? :D |
14:45:04 | * | endragor joined #nim |
14:45:30 | Araq | a 10 line vim/emacs/vscode plugin is a very thin line between "theory" and "practice" |
14:45:50 | Yardanico | yeah vscode is able to detect indentation levels very easily (from my and even from copy-pasted code) |
14:47:22 | Araq | btw tabs are not for indentation, they have strange X characters modulo N (where N is usually 8) semantics |
14:48:57 | Yardanico | also it's funny that some people make an argument "tabs consume less space in bytes". maybe this was true like 15-20 years ago? |
14:49:21 | * | endragor quit (Ping timeout: 240 seconds) |
14:50:06 | euantor | It's still true, just that it doesn't matter quite so much in practice as it used to |
14:50:24 | Yardanico | well I know it's true |
14:50:26 | Araq | it never mattered. |
14:50:45 | Yardanico | but no one looks at source code size in bytes :) |
14:51:08 | Araq | otherwise C would never have grown semicolons |
14:51:14 | * | BitPuffin joined #nim |
14:53:13 | FromGitter | <ephja> Araq: oh ok. got it |
14:54:56 | * | tankfeeder left #nim (#nim) |
14:58:22 | * | haha_ quit (Ping timeout: 246 seconds) |
15:00:55 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:04:33 | federico3 | Yardanico: the space argument was a joke I hope |
15:05:26 | Yardanico | federico3, it's not a joke |
15:05:35 | Yardanico | federico3, example - https://softwareengineering.stackexchange.com/a/2037 |
15:05:41 | Yardanico | "take less size than multiple spaces." |
15:06:26 | * | BitPuffin|osx quit (Ping timeout: 255 seconds) |
15:06:44 | Yardanico | so yeah, it's a strange argument |
15:07:02 | federico3 | Yardanico: sometimes people enforce a number of characters per line (e.g. 80 columns) and count a tab as 1 |
15:07:15 | Yardanico | federico3, lol |
15:08:16 | federico3 | the "logic" is that the limit exists for readability and if you count a tab as more than 1 you are punishing people for indenting |
15:10:08 | * | BitPuffin quit (Read error: Connection reset by peer) |
15:12:31 | * | Trustable joined #nim |
15:12:41 | * | BitPuffin joined #nim |
15:14:51 | * | Vladar quit (Quit: Leaving) |
15:15:01 | * | sz0 joined #nim |
15:21:09 | * | endragor joined #nim |
15:25:35 | * | endragor quit (Ping timeout: 240 seconds) |
15:30:03 | * | gangstacat joined #nim |
15:37:14 | * | ldleworker is now known as ldlework |
15:37:14 | * | ldlework quit (Changing host) |
15:37:14 | * | ldlework joined #nim |
15:37:50 | * | dom96|w joined #nim |
15:55:59 | * | ofelas joined #nim |
15:57:28 | * | endragor joined #nim |
16:00:24 | * | couven92 quit (Read error: Connection reset by peer) |
16:01:09 | * | nhywyll joined #nim |
16:01:57 | * | endragor quit (Ping timeout: 240 seconds) |
16:21:12 | FromGitter | <ephja> let's encourage tabs by counting it as -1 |
16:28:23 | ldlework | Does Nim have if assignment statements? |
16:28:51 | ldlework | like Golang/C++17 where you can assign a variable inside the if expression and then have the conditional use that variable |
16:32:04 | Yardanico | ldlework, yes |
16:32:17 | ldlework | Can I see an example of it |
16:32:20 | Yardanico | one sec |
16:32:22 | FromGitter | <ephja> it's limited atm |
16:32:33 | Yardanico | but it works |
16:32:52 | Yardanico | https://gist.github.com/Yardanico/dc9bf14004281adcf8171bd85014133e |
16:33:33 | FromGitter | <ephja> I was thinking of if expressions |
16:33:44 | ldlework | cool |
16:34:24 | Yardanico | it works with while too |
16:34:31 | Yardanico | IDK about for thought |
16:36:38 | * | yglukhov_ quit (Remote host closed the connection) |
16:37:35 | * | nsf quit (Quit: WeeChat 1.9) |
16:39:49 | * | couven92 joined #nim |
16:39:51 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
16:40:29 | * | yglukhov joined #nim |
16:41:52 | * | yglukhov_ joined #nim |
16:42:44 | Yardanico | also I learned that you can assign variables in if after reading some library code |
16:43:04 | Yardanico | you can learn a lot of tricks while reading libraries/apps written in nim |
16:44:46 | * | yglukhov quit (Ping timeout: 246 seconds) |
16:46:10 | * | yglukhov_ quit (Ping timeout: 246 seconds) |
16:49:31 | federico3 | ephja: or indent using a backspace character |
16:50:38 | * | nattefrost quit (Remote host closed the connection) |
16:52:51 | ldlework | With Rust's compiler VM on the way, and its AST macros in the bag, I'm wondering what Nim has over Rust these days other than the lack of memory-saftey bondage |
16:53:01 | ldlework | I don't mean to be inflammatory whatsoever |
16:53:24 | federico3 | ldlework: the nicer syntax |
16:53:32 | ldlework | Sure that's the bondage bit |
16:53:40 | ldlework | Is there anything else left? |
16:54:46 | Yardanico | portability |
16:54:53 | * | haha_ joined #nim |
16:55:51 | ldlework | Is Rust really not portable? |
16:56:22 | Yardanico | ldlework, maybe, but compare it to GCC |
16:56:31 | Yardanico | GCC supports far more platforms/OSes than LLVM |
16:56:42 | Yardanico | you can also use clang, which has LLVM :D |
16:57:08 | ldlework | Yeah but LLVM is basically everywhere you could want |
16:57:33 | Yardanico | well you can compile nim with Visual Studio compiler for example |
16:57:44 | federico3 | ldlework: not on most microcontrollers or less common hw |
16:57:59 | ldlework | Sure, hence the basically - leaving room for people who do that stuff |
16:58:09 | ldlework | I'm just trying to update my language survivability estimations |
16:58:59 | federico3 | ldlework: being community-driven help long-term survivability at the expense of popularity |
16:59:42 | ldlework | Yeah but differentiation is what explains the community in the first place. |
17:04:52 | Yardanico | what's the define for gc asserts? |
17:06:08 | * | oprypin quit (Quit: Bye) |
17:06:24 | * | oprypin joined #nim |
17:07:20 | couven92 | in a macro, how do I get the type of a declared let/var/const variable? |
17:08:00 | couven92 | say I pass `const x = 42` into the macro, how do I get the typedesc for `x`? |
17:09:48 | couven92 | (which in this example should be the typedesc for `int`) |
17:23:13 | * | haha_ quit (Ping timeout: 248 seconds) |
17:25:58 | Yardanico | Araq, how can I trace make a more helpful error log for this GC error: "gc.nim(278) asgnRefNoCycle"? |
17:26:32 | Yardanico | I haven't yet tried to make a small program to reproduce it |
17:27:27 | Yardanico | Araq, https://gist.github.com/Yardanico/5b1c9000780db8c4d67e26d815fd83e0 |
17:27:39 | Yardanico | sadly my application is async which is even worse for debugging |
17:28:26 | * | haha_ joined #nim |
17:30:54 | * | yglukhov joined #nim |
17:31:58 | * | yglukhov quit (Remote host closed the connection) |
17:32:14 | * | yglukhov joined #nim |
17:32:58 | Yardanico | Araq, well my app is open-source, but comments are all in russian |
17:34:19 | * | endragor joined #nim |
17:35:03 | * | Matthias247 joined #nim |
17:38:41 | Yardanico | oh wait! |
17:38:49 | Yardanico | I actually made a reproducable script |
17:38:50 | Yardanico | wait a sec |
17:39:13 | * | endragor quit (Ping timeout: 248 seconds) |
17:40:42 | Yardanico | and it is async-only issue |
17:42:01 | * | itseris quit (Ping timeout: 276 seconds) |
17:46:35 | Yardanico | wait, it doesn't happen now 0_0 |
17:48:10 | Araq | Yardanico: used Nim devel? |
17:48:24 | Yardanico | yeah |
17:48:26 | Yardanico | 7c1ac5eff88e2c98d3803ed4a5367a62e862b63b |
17:48:32 | FromGitter | <ephja> I need to traverse only the 'when' nodes whose conditionals evaluate to true |
17:48:32 | Yardanico | but GC error disappeared now |
17:48:49 | Yardanico | this error was in code which is making requests for weather API |
17:48:53 | Araq | often the stack trace is slightly wrong and it's just a nil deref bug |
17:49:17 | Yardanico | now there's no GC error (maybe there was some issue on API side) |
17:51:00 | FromGitter | <ephja> I have a pass that runs after the semantic pass |
17:52:46 | Yardanico | Araq, should there be a SIGSEGV in gc if I "await" a future two times? |
17:53:21 | * | couven92 quit (Ping timeout: 240 seconds) |
17:57:46 | FromGitter | <ephja> nah I don't even need to do that |
17:58:40 | Yardanico | Araq, https://github.com/nim-lang/Nim/issues/6268 |
17:59:53 | Yardanico | oh wait there's a GC error even if I comment first "await" |
18:00:04 | Yardanico | I don't know what's happening here |
18:02:21 | * | gangstacat quit (Quit: Leaving) |
18:04:05 | Yardanico | Araq, seems to be a JSON parsing error, but somehow it results in GC error |
18:04:28 | Yardanico | with mark & sweep and first await commented code throws proper json parsing error (but still not clear one) |
18:05:26 | * | couven92 joined #nim |
18:05:39 | Yardanico | hmm |
18:07:09 | FromGitter | <Varriount> I wouldn't be surprised if it has to do with the unsafe features lexbase uses. |
18:09:27 | Yardanico | also json returnted from api seems to be correct |
18:09:46 | Yardanico | If I replace this async http request with plain JSON - everything parses fine |
18:11:16 | * | endragor joined #nim |
18:11:21 | * | AndroUser2 joined #nim |
18:15:29 | * | endragor quit (Ping timeout: 248 seconds) |
18:15:31 | * | itseris joined #nim |
18:20:26 | * | Trustable quit (Remote host closed the connection) |
18:26:34 | * | Trustable joined #nim |
18:39:02 | * | endragor joined #nim |
18:39:21 | * | PMunch joined #nim |
18:43:47 | * | endragor quit (Ping timeout: 260 seconds) |
18:43:58 | FromGitter | <dandevelop> Hi there, I know that using this trick will make your file compile as .m file: template enableObjC*() = ⏎ ⏎ ```block: ⏎ proc dummyWithNoParticularMeaning() {.used, importobjc.}``` [https://gitter.im/nim-lang/Nim?at=599c7b6eba0f0f6e38d0cd78] |
18:44:14 | FromGitter | <dandevelop> This seems to work when nim compiles to c |
18:45:11 | FromGitter | <dandevelop> However, when nim compiles to c++, this does not work as expected. I thought it would convert my file to a .mm one but the generated file still has the .cpp extension. Did anyone else experience this? |
18:45:12 | * | AndroUser2 quit (Read error: Connection reset by peer) |
18:47:13 | FromGitter | <dandevelop> @yglukhov I know this enableObjC trick from your code. Do you have any experience with this? |
18:50:51 | yglukhov | dandevelop: sure, why? |
18:51:28 | * | relax quit (Ping timeout: 246 seconds) |
18:51:45 | yglukhov | dandevelop: oh, just read your first question |
18:52:22 | yglukhov | dandevelop: so no, i don't know how to help you with importobjc, but i've got something better, still very experimental ;) |
18:52:38 | yglukhov | and it should work in c++ mode |
18:52:48 | FromGitter | <dandevelop> @yglukhov I would love to know more about it :D |
18:53:52 | yglukhov | dandevelop: a picture worth a thousand words: https://github.com/yglukhov/darwin/blob/master/tests/tobjc_runtime.nim |
18:54:50 | yglukhov | the benefit of this is that no objc compiler needed. c/c++ is enough. at the same time, the runtime cost is almost zero. |
18:55:58 | yglukhov | i'm trying to convince Araq to deprecate nim's objc support in favor of this. =) |
18:56:23 | * | oprypin quit (Quit: Bye) |
18:56:39 | * | oprypin joined #nim |
19:00:40 | subsetpark | But what about .... |
19:00:53 | * | subsetpark struggles in vain to think of a non-Apple platform for ObjC... |
19:00:58 | subsetpark | ... NeXT? |
19:01:20 | Yardanico | maybe just let user choose? |
19:01:24 | Yardanico | between old and new |
19:03:16 | Yardanico | also I don't know what is NeXT :D |
19:04:53 | FromGitter | <dandevelop> @yglukhov that looks interesting. Do you think it will also work with cpp generated code? The reason is that I have a static C++ library that I need to link to my nim project. |
19:07:21 | * | endragor joined #nim |
19:08:06 | yglukhov | dandevelop: i can't see any reason why it should not work with cpp |
19:08:48 | yglukhov | maybe it will require some extra casts somewhere under the hood, but from design perspective it is totally compatible |
19:10:42 | FromGitter | <dandevelop> @yglukhov I am now struggling with this, maybe you can help: I am trying to include AppKit.h while compiling my nim code as C++ by doing: {.emit: """ ⏎ ⏎ ===import <AppKit/AppKit.h>=== ⏎ ⏎ """} [https://gitter.im/nim-lang/Nim?at=599c81b1c101bc4e3a466711] |
19:11:19 | yglukhov | dandevelop: err, no. you don't want to do that. |
19:11:33 | FromGitter | <dandevelop> What would be a good way to do it? |
19:11:46 | yglukhov | what are you trying to bind to? |
19:11:59 | * | endragor quit (Ping timeout: 248 seconds) |
19:13:01 | FromGitter | <dandevelop> You mean the library? |
19:13:27 | yglukhov | dandevelop : what classes do you need from AppKit.h? |
19:13:45 | FromGitter | <dandevelop> I need it for this: |
19:13:46 | FromGitter | <dandevelop> template StartEventLoop():stmt = ⏎ {.emit: """ ⏎ [NSApp run]; ⏎ """} [https://gitter.im/nim-lang/Nim?at=599c826a578b44a046d9205d] |
19:15:12 | yglukhov | ok. use smth like this: `type NSApplication = ptr object of NSObject` |
19:15:28 | yglukhov | var NSApp {.importc.}: NSApplication |
19:15:52 | yglukhov | proc run(a: NSApplication) {.objc.} |
19:15:58 | yglukhov | NSApp.run() |
19:16:11 | yglukhov | that's it |
19:17:50 | FromGitter | <dandevelop> how would I declare NSObject? |
19:17:57 | subsetpark | Yardanico: https://en.wikipedia.org/wiki/NeXT |
19:18:04 | Yardanico | yeah I've read that |
19:18:07 | yglukhov | it is declared in darwin.objc.runtime |
19:18:12 | yglukhov | in my lib |
19:22:03 | FromGitter | <dandevelop> So I would first need to import the lib, right? |
19:22:22 | yglukhov | yup. import darwin.objc.runtime |
19:23:12 | FromGitter | <dandevelop> Is it on nimble or I need to download the zip from github? |
19:23:51 | yglukhov | dandevelop: not in nimble yet. add `requires "https://github.com/yglukhov/darwin"` to your nimble file. |
19:24:17 | yglukhov | or nimble install https://github.com/yglukhov/darwin |
19:25:43 | FromGitter | <ephja> is it feasible to write canvas apps with nim yet? I want to avoid dynamic typing as always |
19:26:06 | yglukhov | ephja: sure, just do the bindings! ;) |
19:26:33 | yglukhov | actually i think i've came across those a while ago... |
19:26:55 | FromGitter | <ephja> https://gitlab.com/define-private-public/HTML5-Canvas-Nim ? |
19:27:07 | Yardanico | also you can see dom96's snake game |
19:27:08 | FromGitter | <dandevelop> @yglukhov It fails on this line: proc run(a: NSApplication) {.objc.} |
19:27:09 | Yardanico | for html5 |
19:27:22 | FromGitter | <ephja> and the doms module should be less broken nowadays, so I'm going to give it a go |
19:27:33 | FromGitter | <ephja> Yardanico: didn't know it was for html5. I'll check it out |
19:27:48 | yglukhov | dandevelop: try `proc run(a: NSApplication) {.objc: "run".}` ? |
19:28:44 | FromGitter | <dandevelop> @yglukhov : Error: type mismatch: got (NSApplication, SEL) ⏎ but expected one of: ⏎ proc (self: NSObject, selector: SEL){.cdecl.} |
19:29:05 | yglukhov | dandevelop: hrm, ok, let me check it. 5min =) |
19:29:45 | FromGitter | <dandevelop> @yglukhov I think it worked. I had this line added before using your module: NSObject* = ptr object {.pure, inheritable.} |
19:29:50 | FromGitter | <dandevelop> I removed it and it works now |
19:29:57 | FromGitter | <dandevelop> At least it compiles |
19:30:07 | yglukhov | ah, ok. |
19:30:34 | yglukhov | does it run properly? =) |
19:31:35 | FromGitter | <ephja> have any other third parties written compiler plugins or is it just me? |
19:31:37 | FromGitter | <dandevelop> @yglugh |
19:31:52 | FromGitter | <dandevelop> @yglukhov : here is the error |
19:32:00 | FromGitter | <dandevelop> macosxapp.cpp:1510:33: error: cannot initialize a variable of type 'tyProc_QjaYZ9bMjtLmC35Vjupak6A' (aka 'void (*)(NSObjectcolonObjectType__9auPgmgK5nknOFigSOsIkoQ *, void *)') with an lvalue of type 'void ()': different number of parameters (2 vs 0) ⏎ ⏎ ``` tyProc_QjaYZ9bMjtLmC35Vjupak6A performSend = objc_msgSend;``` [https://gitter.im/nim-lang/Nim?at=599c86b0bc46472974afcef4] |
19:32:31 | FromGitter | <dandevelop> Looks like it is related to this line: proc run(a: NSApplication) {.objc: "run".} |
19:32:42 | yglukhov | ok, so a bunch of casts is missing probably... let me check it. |
19:35:25 | * | relax joined #nim |
19:42:43 | yglukhov | dandevelop: done. try again please. |
19:43:38 | Jipok[m] | http://www.luna-lang.org/ |
19:43:42 | Jipok[m] | Nim seems there can also be added |
19:43:56 | Jipok[m] | I do not know why this is needed |
19:44:03 | Jipok[m] | but it looks beautiful |
19:47:49 | FromGitter | <dandevelop> @yglukhov seems to compile now but now I have another question: does Nim compile with libstdc++ when choosing c++ as a target? |
19:48:58 | yglukhov | dandevelop: not sure about that, don't use cpp mode |
19:49:41 | FromGitter | <dandevelop> the static library I am linking with is C++. Will this work? |
19:50:09 | yglukhov | there should be a simple way to find out ;) |
19:50:51 | FromGitter | <dandevelop> Looks like it doesn't: Undefined symbols for architecture x86_64: ⏎ "std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const", referenced from: ⏎ ⏎ ``` vtable for std::__1::__shared_ptr_emplace<std::__1::mutex,``` [https://gitter.im/nim-lang/Nim?at=599c8b1b9acddb2407bab246] |
19:51:32 | yglukhov | well you can add a linker pragma to your wrapper, or add it via cmdline |
19:51:59 | yglukhov | {.passL:"-lstdc++".} or smth? |
19:52:53 | yglukhov | or cmdline option: --passL:-lstdc++ |
19:54:04 | yglukhov | dunno if thats the canonical way though. maybe other c++ users will help here. |
19:55:05 | * | Sembei joined #nim |
19:55:19 | yglukhov | oh, since you're using AppKit, you'll have to link it as well: {.passL:"-framework AppKit".} |
19:56:02 | * | gokr joined #nim |
19:57:05 | * | Pisuke quit (Ping timeout: 240 seconds) |
19:57:30 | FromGitter | <dandevelop> @yglukhov Looks like I had to change the min sdk version from 10.7 to 10.9 and it worked |
19:58:07 | yglukhov | is that because your cpp static lib is built against that? |
19:58:38 | yglukhov | well, congrats anyway ;) |
20:01:36 | FromGitter | <dandevelop> @yglukhov the library was build against 10.7 |
20:01:48 | FromGitter | <dandevelop> @yglukhov but thanks for the help! |
20:02:54 | FromGitter | <dandevelop> @yglukhov by the way, your nimx project looks like a great way to learn Nim :D |
20:03:11 | * | Yardanico quit (Remote host closed the connection) |
20:03:27 | yglukhov | dandevelop: thats strange. the link error should say where those symbols are used from. what does it say? |
20:03:41 | yglukhov | dandevelop: thanks, glad to help =) |
20:04:01 | FromGitter | <dandevelop> Ok, I will set it back to 10.7 and see what it says |
20:05:22 | yglukhov | dandevelop: also note, that my objc bindings lib is not tested on ios. there might be some abi differences, so feel free to file a ticket in case you happen to test it on ios and it fails. |
20:05:41 | FromGitter | <dandevelop> @yglukhov so the library is built with libc++ but if I set the min sdk to 10.7 looks like nim will build it with libstdc++ |
20:05:52 | FromGitter | <dandevelop> Here is the warning: clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated] |
20:07:09 | yglukhov | ah ok. i suppose these options come somewhere from nim.cfg, you can try tinker with it and see if it works for you. probably a pr with nim.cfg patch would be welcome ;) |
20:07:25 | * | vlad1777d quit (Remote host closed the connection) |
20:08:55 | * | haha_ quit (Ping timeout: 255 seconds) |
20:11:59 | FromGitter | <dandevelop> @yglukhov yes, I will take a look at it tomorrow. Thanks again! I really appreciate it! |
20:12:19 | yglukhov | anytime :) |
20:17:38 | * | mahsav2 joined #nim |
20:19:27 | * | ipjk joined #nim |
20:19:27 | * | mahsav quit (Ping timeout: 240 seconds) |
20:22:55 | * | gangstacat joined #nim |
20:31:42 | * | rauss quit (Quit: WeeChat 1.9) |
20:32:17 | * | rauss joined #nim |
20:33:02 | * | PMunch quit (Quit: leaving) |
20:33:22 | * | Trustable quit (Remote host closed the connection) |
20:35:50 | * | rauss quit (Client Quit) |
20:40:32 | * | Yardanico joined #nim |
20:51:46 | * | nsf joined #nim |
20:51:51 | * | mahsav2 quit (Ping timeout: 240 seconds) |
21:22:31 | * | mahsav joined #nim |
21:24:31 | * | rauss joined #nim |
21:26:21 | * | relax quit (Ping timeout: 240 seconds) |
21:39:21 | * | mahsav quit (Ping timeout: 240 seconds) |
21:51:19 | * | xaxisx quit (Read error: Connection reset by peer) |
21:51:45 | * | xaxisx joined #nim |
21:51:57 | TheManiac | Newbie question: is there a reason why you can't raise an exception inside a case expression? |
21:52:37 | TheManiac | (Given that it works fine inside a case statement?) |
21:59:16 | Araq | it would require a bottom type in the type system and we like simplicity (yes, really, we do) |
21:59:25 | * | couven92 quit (Quit: Client Disconnecting) |
22:00:55 | * | Yardanico quit (Read error: Connection reset by peer) |
22:05:20 | TheManiac | You mean there's no way to type check it if it raises an exception? |
22:08:01 | * | Jesin quit (Quit: Leaving) |
22:10:16 | * | Sembei quit (Ping timeout: 246 seconds) |
22:14:05 | Araq | I mean it makes everything more complex for little gain |
22:19:19 | * | nhywyll quit (Quit: nhywyll) |
22:22:42 | * | ipjk quit (Quit: Leaving) |
22:25:24 | * | ofelas quit (Quit: shutdown -h now) |
22:33:44 | * | mahsav joined #nim |
22:37:21 | * | yglukhov quit (Remote host closed the connection) |
22:47:08 | * | nsf quit (Quit: WeeChat 1.9) |
23:31:09 | * | Jesin joined #nim |
23:39:12 | * | jinshil joined #nim |
23:43:25 | * | sz0 quit (Quit: Connection closed for inactivity) |
23:46:21 | * | itseris quit (Ping timeout: 240 seconds) |
23:47:36 | * | gangstacat quit (Quit: Leaving) |
23:48:44 | * | Nobabs27 joined #nim |
23:55:23 | * | Sembei joined #nim |