00:05:15 | * | abm quit (Ping timeout: 252 seconds) |
00:11:57 | * | Jesin joined #nim |
00:34:36 | * | seni quit (Quit: Leaving) |
00:44:31 | * | Jesin quit (Quit: Leaving) |
00:45:28 | * | vlad1777d__ quit (Ping timeout: 272 seconds) |
00:51:12 | * | zachk quit (Quit: Leaving) |
01:24:16 | * | Guest32018 quit (Quit: WeeChat 2.0) |
01:24:34 | * | c15ade4 joined #nim |
01:24:57 | * | c15ade4 is now known as Guest89712 |
01:26:00 | * | Guest89712 quit (Client Quit) |
01:26:14 | * | c15ade4 joined #nim |
01:46:00 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc694581c100a4f299a2993] |
02:04:51 | * | banc quit (Quit: ZNC - http://znc.in) |
02:23:04 | * | banc joined #nim |
02:36:49 | FromGitter | <yyyc514> i can call methods directly without importing them, can’t it? |
02:38:04 | FromGitter | <yyyc514> or only if they are marked public? |
02:48:47 | * | dddddd quit (Remote host closed the connection) |
02:50:08 | FromGitter | <yyyc514> jester makes it hard to just use the router portions :) |
02:50:22 | FromGitter | <yyyc514> wonder if they’d be open to splitting those out into a router.nim |
03:00:48 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:12:41 | * | chemist69 quit (Ping timeout: 250 seconds) |
03:14:37 | * | chemist69 joined #nim |
03:56:00 | FromGitter | <juancarlospaco> I need to rate limit api calls to 5000/day without persistance (eg write to disk etc), what would be the best way?. |
03:59:23 | shashlick | dom96: nimble is broken on #head - doesn't recognize tasks anymore |
03:59:24 | shashlick | ``` |
03:59:26 | shashlick | Error: undeclared identifier: 'task' |
03:59:27 | shashlick | ``` |
04:24:30 | * | MyMind joined #nim |
04:26:21 | * | Sembei quit (Ping timeout: 250 seconds) |
04:29:08 | shashlick | https://github.com/nim-lang/nimble/issues/562 |
04:31:11 | FromGitter | <yyyc514> anyway to see what a template is spitting out? |
04:33:51 | * | endragor joined #nim |
04:51:20 | FromGitter | <juancarlospaco> @yyyc514 https://nim-lang.org/docs/macros.html#treeRepr%2CNimNode |
05:17:51 | * | leorize quit (Ping timeout: 252 seconds) |
05:19:10 | * | narimiran joined #nim |
05:23:11 | * | nsf joined #nim |
05:40:36 | * | regtools quit (Ping timeout: 272 seconds) |
05:41:09 | * | regtools joined #nim |
05:49:11 | * | smt quit (Read error: Connection reset by peer) |
05:51:52 | * | narimiran quit (Quit: Konversation terminated!) |
05:54:25 | * | k0mpjut0r joined #nim |
06:09:09 | * | darithorn quit () |
06:13:53 | FromGitter | <vegai> is there a code formatter anywhere? |
06:15:55 | FromGitter | <technicallyagd> `nimpretty` |
06:20:40 | * | MyMind quit (Excess Flood) |
06:21:45 | * | MyMind joined #nim |
06:22:41 | FromGitter | <technicallyagd> @vegai, You can find the code here (https://github.com/nim-lang/Nim/blob/devel/nimpretty/nimpretty.nim). It should be installed if you compiled from the Nim source code, or use `devel` channel with `choosenim`. It has some quirks, but it's totally usable. Plus, @Araq just made a lot of commit fixing the quirks. |
06:42:39 | FromGitter | <cipharius> How would one call the statement line that starts a new control flow block in python style syntax? Been trying to find tool that displays beginning of indented block my cursor is currently in, can't seem to find anything online |
06:44:49 | FromGitter | <cipharius> I ran in a problem, of having long enough if statement block, but i want to return to lower level block, except i have to scroll up and see if I am on the correct indentation depth. Instead i thought of tool that prints beginning of current block, like an if statement |
06:45:13 | FromGitter | <vegai> @technicallyagd thanks |
06:48:23 | FromGitter | <cipharius> It wouldn't be tough to create the command myself, but i wanted to see how others deal with such problem. I guess i can always just try to keep the functions short and split it up in smaller logical parts |
06:50:01 | FromGitter | <technicallyagd> @vegai You're welcome :D ⏎ @cipharius I would love this tool too. |
06:50:21 | * | krux02 joined #nim |
06:51:48 | FromGitter | <cipharius> I'm using emacs, so it has all the nescessary functions to easily do it. It's hard to believe something like that doesn't exist already |
06:53:21 | krux02 | cipharius: I just joined and I have no history. |
06:53:34 | krux02 | what doesn't exist already? |
06:53:47 | krux02 | and I have a question |
06:53:49 | krux02 | nimble is broken |
06:53:55 | krux02 | what can I do about it? |
06:54:04 | krux02 | it crashes when it tries to parse the version |
06:54:20 | FromGitter | <technicallyagd> @krux02 jumping to/peeking at the top of a code block like `if` |
06:54:31 | FromGitter | <cipharius> krux02: Tool that displays headline of control flow block your cursor is on |
06:54:45 | krux02 | ah |
06:54:55 | krux02 | like in the git diff |
06:55:03 | FromGitter | <cipharius> Annoying when you have long nested if statements |
06:55:17 | krux02 | shouldn't be too hard to implement |
06:55:40 | krux02 | just show last top level statement |
06:55:56 | FromGitter | <cipharius> Yeah, at the least create keybinding that prints the line in mini-buffer |
06:56:09 | FromGitter | <cipharius> Fancier version cpuld use the popup.el |
06:56:09 | krux02 | tho only thing I don't trust emacs in is to visualize that information without breaking the content of some buffers |
06:56:24 | krux02 | (sorry windows I mean) |
06:56:50 | FromGitter | <cipharius> oh i meant just with message, not popup window |
06:57:09 | FromGitter | <technicallyagd> Yeah, but should this function be implemented separately in each IDE/editor or could we incorporate this into `nimsuggest`? |
06:57:38 | FromGitter | <cipharius> It could be nice feature of nimsuggest |
06:58:11 | FromGitter | <technicallyagd> Does python have this feature in most editors? |
06:58:16 | krux02 | something like this pseudo code (save-excursion (re-search backwards "^[^ ]") (message-the-current-line)) |
06:59:31 | krux02 | another question does anybody have problems with recent nimble version? |
06:59:37 | FromGitter | <cipharius> i was actually looking for that to use in python, so i didn't find anything |
06:59:42 | krux02 | My nimble can't parse my version string anymore |
07:00:18 | * | rewadz joined #nim |
07:00:42 | FromGitter | <cipharius> I also can't believe that nim-mode company support is still so broken |
07:01:10 | krux02 | I think the most useful version of that feature would print that information at the top of the window (first line or something), but only when it is not already visible |
07:01:33 | krux02 | cipharius: yea I just disabled it |
07:01:40 | krux02 | just causes problems |
07:02:04 | krux02 | I made a PR with readme changes that warns about the immature state of nimsuggest-mode |
07:02:06 | FromGitter | <cipharius> Last time i tried, it hung up and failed to communicate with nimsuggest |
07:02:13 | FromGitter | <technicallyagd> @krux02 I haven't tried the latest nimble yet. |
07:02:26 | krux02 | but that is something the current maintainer doesn't like |
07:02:35 | FromGitter | <cipharius> krux02: yeah, would like that too. Basically stickyfunc but for each scope |
07:03:07 | * | leorize joined #nim |
07:04:34 | krux02 | I can't find the source folder of nimble |
07:09:35 | krux02 | I did find it |
07:21:05 | Araq | krux02: nimble works for me |
07:37:18 | krux02 | Araq: it crashes on my project |
07:37:30 | krux02 | I looked in the sourcecode, and it looks clearly like a bug |
07:38:51 | krux02 | Araq: here is the bug https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/version.nim#L193 |
07:39:01 | krux02 | i+1 is out of bounds |
07:39:14 | krux02 | the if condition before is incorrect |
07:39:29 | krux02 | but I checked when that code was changed the last time |
07:39:34 | krux02 | it was 6 years ago |
07:39:56 | krux02 | so I guess it was dead and now it is active for some reason |
07:43:53 | krux02 | I am actually surprised that this isn't done with regular expressions |
07:44:07 | krux02 | they would really match the problem better |
07:46:24 | Araq | regexes suck |
07:46:43 | Araq | anyhow, accessing the \0 used to not be an error, remember |
07:47:04 | Araq | and the code wasn't updated properly for newer Nims, compile Nimble with --laxStrings:on |
07:49:10 | FromGitter | <yyyc514> lol |
08:01:36 | FromGitter | <yyyc514> "A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature." |
08:01:37 | * | floppydh joined #nim |
08:01:51 | FromGitter | <yyyc514> but this doesn’t hold true if you’re using a type that knows the function signature? |
08:11:15 | * | abm joined #nim |
08:21:39 | * | stefanos82 joined #nim |
08:46:25 | * | Vladar joined #nim |
08:51:35 | * | platoff joined #nim |
08:55:17 | FromGitter | <glassofethanol> Good Morning |
08:58:33 | * | krux02_ joined #nim |
09:00:53 | * | krux02 quit (Ping timeout: 245 seconds) |
09:02:35 | * | gmpreussner quit (Ping timeout: 244 seconds) |
09:03:28 | * | gmpreussner joined #nim |
09:05:22 | * | anamok joined #nim |
09:05:23 | anamok | hi |
09:05:48 | * | leorize quit (Ping timeout: 272 seconds) |
09:06:23 | anamok | From the official tutorial: "Note that $ applied to strings is a nop." What is a nop? Does it mean the compiler notices that you want to convert a string to a string and does nothing with that? "No operation"? |
09:13:24 | Araq | yes |
09:14:13 | Araq | but this sentence should be removed, tutorials should not be about compiler optimizations |
09:14:54 | Araq | with 0.20 we may get a real high-level optimizer anyway (*cough*) |
09:15:44 | FromGitter | <yyyc514> Error: type mismatch: got <proc (r: var Request){.closure, noSideEffect, gcsafe, locks: <unknown>.}> but expected 'proc (r: var Request){.gcsafe, locks: <unknown>.}' |
09:15:49 | FromGitter | <yyyc514> ok this one has me head scratching |
09:17:27 | Araq | .closure vs .nimcall mismatch? |
09:17:39 | * | glassofethanol joined #nim |
09:18:37 | FromGitter | <yyyc514> so it doesn’t like that i’m using a closure? |
09:18:57 | anamok | thanks |
09:19:45 | * | glassofethanol quit (Remote host closed the connection) |
09:27:04 | * | krux02_ quit (Remote host closed the connection) |
09:46:40 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/3c5dbcbf67b64d1cbbc42c68df104ece |
09:46:43 | FromGitter | <yyyc514> can someone help |
09:47:00 | FromGitter | <yyyc514> i’m trying to build a stack of middleware but it’s creating an infinite loop |
09:47:12 | FromGitter | <yyyc514> i think i’m not understanding the proc variables or something |
09:47:45 | FromGitter | <yyyc514> stack[0] is corret but stack[1] must not be |
09:48:12 | Araq | don't use .global here |
09:48:29 | Araq | don't use ': void' as the return type, Nim is not C++ |
09:48:57 | FromGitter | <yyyc514> ok but those arne’t the issues. it was working fine when i manually hooked up each middlware |
09:49:00 | FromGitter | <yyyc514> but the loop isn’t working |
09:49:33 | Araq | use the 'mitems' iterator instead 'for mw in mitems(stack)' so the changes are write-through |
09:50:23 | FromGitter | <yyyc514> mw is a ref, does that matter? |
09:50:35 | FromGitter | <yyyc514> they seem to be getting changed |
09:51:09 | FromGitter | <yyyc514> same with mitems |
09:51:48 | FromGitter | <yyyc514> illegal capture 'mw' of type <var Middleware> which is declared here: pastie.nim(80, 6) |
09:51:51 | FromGitter | <yyyc514> oh that’s diff |
09:51:54 | FromGitter | <yyyc514> if i remove the inbetween variable |
10:03:17 | FromGitter | <yyyc514> i made the changes you suggested, btu same behavior |
10:03:24 | * | leorize joined #nim |
10:14:32 | * | dddddd joined #nim |
10:15:13 | Araq | oh I think you need system.closureScope here :P |
10:17:13 | FromGitter | <yyyc514> bingo :) |
10:17:17 | FromGitter | <yyyc514> but only works if i remove mitem |
10:18:20 | FromGitter | <yyyc514> Error: illegal capture 'mw' of type <var Middleware> which is declared here: pastie.nim(80, 6) with mitems |
10:18:34 | Araq | sure |
10:18:35 | FromGitter | <yyyc514> man nim is just such a huge thing to learn |
10:19:18 | Araq | not really, it's still the smallest systems programming language ;-) |
10:19:29 | FromGitter | <yyyc514> is it now? |
10:19:54 | Araq | if you compare the manual against the specs of the other systems programming languages |
10:20:12 | Araq | but admittedly it's an unfair comparison as Nim's spec is not yet complete |
10:20:58 | Araq | but still, it's not as big as many make it to be and we also occasionally remove features |
10:21:08 | FromGitter | <yyyc514> yikes :) |
10:23:06 | FromGitter | <yyyc514> hmmm |
10:23:11 | FromGitter | <yyyc514> i’m losing 4-5us per nested call |
10:26:12 | FromGitter | <yyyc514> i wonder if that’s because of all the indirection or just function calls in general |
10:28:19 | anamok | bye |
10:28:23 | * | anamok quit (Remote host closed the connection) |
10:34:22 | FromGitter | <yyyc514> trying to think og how you’d compile this tighter |
10:39:15 | * | elrood joined #nim |
10:42:48 | Araq | yyyc514, well closures are quite expensive, if speed is really important, better use something else :-) |
10:43:08 | Araq | like proc (this: FooBase; params) {.nimcall.} |
10:44:04 | FromGitter | <xmonader> Is nim plugin for vscode working well with autocompletion everyone? |
10:44:55 | FromGitter | <yyyc514> is there a noclosure pragma? |
10:45:07 | FromGitter | <yyyc514> is that what nimcall is? |
10:45:08 | Araq | yyyc524, that's .nimcall |
10:45:41 | Araq | xmonader: I'd give it a 5 out of 10 currently |
10:46:17 | FromGitter | <xmonader> @Araq been coding without autocomplete for the past week i'd say (not sure if it's my setup or something else) |
10:46:18 | FromGitter | <yyyc514> i need a better bench env but speed seems about the same to me |
10:46:28 | FromGitter | <kaushalmodi> @cipharius I wouldn't be surprised if you are looking for (showing the line on parent indentation level) already exist. I'd suggest asking about this on the Emacs subreddit or the official help-gnu-emacs mailing list (great to see another Emacs user here!) |
10:48:00 | FromGitter | <cipharius> I ended up writing function for that, was easy enough |
10:48:35 | FromGitter | <kaushalmodi> @cipharius It shouldn't be difficult to derive something from this package: https://github.com/alphapapa/org-sticky-header/blob/master/README.org (see the gif). |
10:48:40 | FromGitter | <kaushalmodi> Ok |
10:49:55 | FromGitter | <cipharius> I mean, i just wrote the function that retrieves the headline. No fancy display yet, just printing it |
10:53:39 | FromGitter | <cipharius> Basically recursively went to previous line beginning of text and checked if line isn't empty and if indentation is less than one at point. Should also check if point is inside multi-line string |
11:05:57 | * | sagax joined #nim |
11:18:49 | * | PMunch joined #nim |
11:24:28 | FromGitter | <kaushalmodi> @cipharius Yes, that's what you'd need to do. Btw every major mode can also implement its own `which-func` hook. I haven't checked if nim-mode has done that too. Try `M-x which-func-mode`. Even if it's not implemented, it's pretty easy to do so. https://emacs.stackexchange.com/questions/18391/which-class-or-method-or-function-am-i-in |
11:25:25 | * | Snircle joined #nim |
11:27:29 | FromGitter | <cipharius> Thing is i want to get beginning of any control block, not just function or class. Stickyfunc would be enough then |
11:40:46 | * | revere quit (Ping timeout: 246 seconds) |
11:41:37 | * | revere joined #nim |
11:49:15 | * | revere quit (Ping timeout: 264 seconds) |
11:51:19 | * | revere joined #nim |
11:51:23 | * | Vladar quit (Read error: Connection reset by peer) |
11:56:45 | * | Vladar joined #nim |
11:58:38 | poopBot | nimx or what gui lib? |
11:59:59 | * | vlad1777d__ joined #nim |
12:01:55 | FromGitter | <narimiran> @poopBot https://github.com/trustable-code/NiGui ? |
12:06:37 | poopBot | hmm i just tryed nimx but it crys ... kAlt.nim(4, 12) Error: cannot open file: nimx/window |
12:06:47 | poopBot | and i did nimble install nimx |
12:07:45 | poopBot | narimiran[m], hmm WIP Event handling , so no buttons or what? |
12:11:30 | poopBot | i just need some buttons image display and text fileds |
12:11:40 | poopBot | best would be some gtk |
12:12:29 | Araq | poopBot please try nim-lang/ui |
12:12:38 | * | kapil____ joined #nim |
12:13:38 | leorize | a bit of advice when installing `ui`: after installation `cd` into the package dir, then run `git submodule update --init` |
12:13:44 | poopBot | hmm am trying atm nigui will try that next xD |
12:14:16 | poopBot | leorize, thats for restarting autocomplete or what? |
12:14:33 | poopBot | updating submodule? |
12:14:44 | poopBot | wont nimble install get latest |
12:19:29 | poopBot | hmm |
12:19:31 | poopBot | Error: cannot open file: nigui |
12:19:40 | poopBot | why am i getting this even i installed lib |
12:19:56 | poopBot | same heppend with nimix |
12:20:57 | poopBot | think nimble is joking me or something |
12:23:28 | Araq | poopBot, bug https://github.com/nim-lang/Nim/issues/9375 ? |
12:28:15 | poopBot | hmm , same for ui too , Alt.nim(1, 16) Error: cannot open file: ui , guess same for all |
12:28:26 | poopBot | am reading link |
12:29:01 | poopBot | hmm but i have gcc (GCC) 8.2.1 20180831 |
12:29:48 | poopBot | i try with clang |
12:37:02 | poopBot | life sux |
12:37:03 | poopBot | Error: execution of an external compiler program 'clang -c -w /bin/sh: pkg-config: command not found -I/home/me/.choosenim/toolchains/nim-0.19.0/lib -o /home/me/.cache/nim/kAlt_d/common_shouldquit.c.obj /home/me/.nimble/pkgs/ui-0.9.2/ui/./libui/common/shouldquit.c' failed with exit code: 1 |
12:37:26 | poopBot | is this pgk-config some lib i missing |
12:37:51 | poopBot | yep |
12:38:10 | poopBot | yey it worked |
12:40:19 | Araq | seems like we need to replace O3 with O2 asap |
12:44:32 | * | cavariux quit (Quit: Ping timeout (120 seconds)) |
12:44:59 | * | cavariux joined #nim |
13:03:41 | FromGitter | <alehander42> Araq, weren't there some plans to make karax able to as a server-side html renderer |
13:03:48 | FromGitter | <alehander42> able to be used as* |
13:04:48 | * | smt joined #nim |
13:05:16 | * | anamok joined #nim |
13:05:21 | anamok | hi |
13:05:30 | PMunch | Hello |
13:06:34 | anamok | When launching my program, I want to change the directory to somewhere and I want to work there. So for instance if I create a file, I want it to be created in that selected folder. |
13:06:55 | anamok | I want that to be the current folder. |
13:07:33 | PMunch | anamok, maybe the setCurrentDir in the os module will help |
13:07:58 | FromGitter | <alehander42> huh it works already |
13:08:18 | anamok | thanks, I think this is what I need |
13:09:29 | * | endragor quit (Remote host closed the connection) |
13:10:07 | anamok | I want to set that dir. to be the current dir. I want to do some work, and then switch back to the original dir. In Python there are context managers (`with` blocks). Is there something similar in Nim? |
13:11:16 | FromGitter | <alehander42> I just need karaxdsl, I can probably even staticRead the buildHtml-s from template files |
13:11:34 | FromGitter | <alehander42> @anamok you can easily simulate with blocks using templates |
13:12:27 | PMunch | anamok, well you can easily create one with a template |
13:12:28 | anamok | Right, I can do that with a template. Something like `with_chdir("/path/to/dest"): ...` |
13:12:49 | FromGitter | <alehander42> e.g. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7355164cfc273f9df27eb] |
13:13:53 | FromGitter | <alehander42> you might want to have ⏎ ⏎ ```try: `handler` finally: restoring directory ``` [https://gitter.im/nim-lang/Nim?at=5bc73590c08b8b30672b69f4] |
13:14:02 | FromGitter | <kaushalmodi> anamok: we already have `withDir` that does exactly what you want |
13:14:19 | FromGitter | <kaushalmodi> .. or is that only in NimScripts? |
13:14:24 | FromGitter | <alehander42> but still this pattern is useful if you want to make a similar resource/context manager |
13:16:00 | FromGitter | <kaushalmodi> anamok: the best way to discover things is to visit the *theindex* page, and Ctrl+F to search in there. |
13:16:18 | FromGitter | <alehander42> actually one can even have a general `buildwith` macro which just lets the user define custom enter / exit templates |
13:16:32 | FromGitter | <alehander42> we did something like this in py2nim, but not sure how useful would it be |
13:17:32 | anamok | kaushalmodi: thanks, I didn't know that page. Very useful. |
13:19:12 | FromGitter | <kaushalmodi> Search for "with" on that page :) |
13:26:24 | anamok | Since an import brings in a lot of things, very often I don't know where a proc came from. Thus this index will be very helpful to find the corresponding lib. |
13:30:58 | FromGitter | <alehander42> ok i needed import karaxdsl, vdom actually |
13:33:27 | * | endragor joined #nim |
13:33:28 | * | endragor quit (Remote host closed the connection) |
13:43:14 | FromGitter | <Vindaar> Not sure how useful this actually is, but it was fun: https://github.com/Vindaar/shell ⏎ @kaushalmodi you might like this :D |
13:49:32 | FromGitter | <kaushalmodi> @Vindaar looks great! |
13:49:59 | FromGitter | <kaushalmodi> And no kidding, just yesterday I was thinking of: |
13:50:24 | poopBot | how is going with karax , i think it will be a nice thing when it finishes i hate js |
13:52:09 | FromGitter | <kaushalmodi> sed:\n search: ..\n replace: .. \n delete: book |
13:52:23 | FromGitter | <kaushalmodi> (sorry, on phone Gitter app) |
13:53:39 | FromGitter | <alehander42> awesome idea @Vindaar |
13:54:48 | FromGitter | <alehander42> the cool thing with such a dsl is that it's easy to add custom behavior for each command |
13:55:04 | FromGitter | <alehander42> e.g. debugging info (starting command ... finished with status ) |
13:55:05 | leorize | Vindaar: you might want to try copying https://xon.sh/ ;) |
13:56:03 | FromGitter | <alehander42> once we have a good REPL, sometimes like this https://github.com/tqdm/tqdm would be very cool |
13:56:41 | FromGitter | <kaushalmodi> @Vindaar Why do you have run command in this order? `run "--out:test.txt" myProg` |
13:56:48 | FromGitter | <Vindaar> thanks! ⏎ @kaushalmodi in what context where you thinking about that? As as Nim macro? ⏎ @leorize: haha, maybe one day ;) ⏎ @alehander yep, indeed! [https://gitter.im/nim-lang/Nim?at=5bc73f9f82893a2f3bf716f6] |
13:57:03 | FromGitter | <Vindaar> oh, that `run` there is just supposed to be a dummy program |
13:57:06 | FromGitter | <Vindaar> :D |
13:57:23 | FromGitter | <Vindaar> I'll change it to something clearer |
13:57:57 | * | vlad1777d__ quit (Ping timeout: 252 seconds) |
13:58:25 | FromGitter | <kaushalmodi> Ok, I thought that "nim c foo.nim" would need to be run as `run "c foo.nim" "nim"`, which looks odd |
13:58:51 | FromGitter | <Vindaar> updated |
13:59:09 | anamok | vindaar: Windows support would be great too |
13:59:37 | leorize | I think it's possible to implement something like xon.sh in pure macro |
13:59:51 | FromGitter | <kaushalmodi> Ok, for the sed context, I thought of that after I needed sed in the docs task (and many other places) in my nim_config repo |
14:00:35 | FromGitter | <kaushalmodi> There's also a Python library which allows shell piping in pythonic code |
14:00:36 | FromGitter | <Vindaar> @anamok: well in theory I'm just calling `execCmdEx` in the background with some string. So if you run this in powershell and use proper syntax, it should work |
14:01:12 | anamok | ok |
14:01:32 | FromGitter | <kaushalmodi> anamok: or just use bash on Windows? |
14:02:37 | FromGitter | <Vindaar> Ok, I currently don't consider `\`. So if you were to hand Windows as `Some\Path\To` it would break. I can add that real quic |
14:02:38 | FromGitter | <Vindaar> k |
14:03:48 | FromGitter | <kaushalmodi> `foo/bar/paths` work on windows too |
14:04:10 | FromGitter | <Vindaar> ah, that's good then |
14:04:15 | FromGitter | <kaushalmodi> @Vindaar any idea to make this prettier? ⏎ ⏎ ```sedCmd = "sed -i 's|" & pkgName & r"\.html|" & docOutBaseName & ".html|' " & deployIdxFile``` ⏎ ⏎ (on PC now) [https://gitter.im/nim-lang/Nim?at=5bc7415f384492366153c810] |
14:04:47 | FromGitter | <kaushalmodi> used raw string `r"\.html|"` to avoid needing double backslashes |
14:05:28 | anamok | alehander42: you said "once we have a good REPL". Is it planned to be part of a future Nim release? |
14:05:54 | * | PrimHelios joined #nim |
14:06:05 | leorize | more like: once FFI works in VM context... |
14:06:28 | FromGitter | <alehander42> not sure, but we have https://github.com/nim-lang/Nim/issues/8927 |
14:06:38 | FromGitter | <alehander42> so I guess if the grant is accepted, it can happen |
14:07:17 | FromGitter | <kaushalmodi> @Vindaar something like? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7421582893a2f3bf72d10] |
14:07:21 | leorize | IIRC when Araq was implementing incremental compilation, he said something about it would enable FFI in VM context |
14:09:18 | FromGitter | <Vindaar> @kaushalmodi sure, that should be possible. A little bit of work, but if used a lot probably worth it. ⏎ Regarding the string comment, I had a little trouble with strings and raw string literals right now. But I guess so. |
14:13:08 | anamok | I just made a discovery... You told me about the Index where one can look up functions / procs / etc. In VS Code with the Nim plugin, if you leave the cursor on a function name, in a popup it's also indicated the package from where the given function came from. |
14:17:00 | FromGitter | <alehander42> Araq, I made a macro which lets me use karaxdsl-based template files in Jester |
14:17:46 | * | PrimHelios quit (Ping timeout: 260 seconds) |
14:18:21 | FromGitter | <alehander42> does it make sense to include something like this in karax (it basically does render(path) => string with html so it can be used in any server side setting) |
14:18:34 | FromGitter | <alehander42> or should it be its own lib |
14:21:41 | FromGitter | <kaushalmodi> @Vindaar You are already depending on elnim in shell? |
14:22:57 | FromGitter | <kaushalmodi> I haven't published it yet as it doesn't yet have much material |
14:32:23 | * | elrood_ joined #nim |
14:32:57 | FromGitter | <Vindaar> @kaushalmodi sorry, was afk. Met someone when making coffee, haha. ⏎ Well, I just wanted to try if it works. :D I only use it for mapconcat. |
14:36:22 | FromGitter | <Vindaar> But since `elnim` is on github it can be installed via `nimble`. But I can also just use `mapIt` if you wish |
14:37:53 | FromGitter | <alehander42> please add all packages to the .nimble file |
14:38:16 | FromGitter | <alehander42> one can add github paths |
14:38:20 | FromGitter | <kaushalmodi> > But since elnim is on github it can be installed via nimble ⏎ ⏎ Can you add an unpublished dependency to nimble? |
14:38:26 | FromGitter | <Vindaar> yep, just did that |
14:38:29 | FromGitter | <kaushalmodi> @alehander42 ah cool |
14:38:48 | * | brainproxy quit (Ping timeout: 245 seconds) |
14:38:50 | FromGitter | <kaushalmodi> > But I can also just use mapIt if you wish ⏎ ⏎ Nope, was just plesantly surprised to see elnim being used :) |
14:39:02 | FromGitter | <Vindaar> :) |
14:40:04 | * | PrimHelios joined #nim |
14:41:14 | leorize | isn't `mapconcat` just a fancier `foldr`? |
14:44:28 | * | Snircle_ joined #nim |
14:44:33 | FromGitter | <Vindaar> yeah, it basically is |
14:44:41 | FromGitter | <kaushalmodi> leorize: looks like it is! `@["nim", "is", "cool"].foldr(a & " " & b)` |
14:46:13 | * | craigger_ joined #nim |
14:46:51 | FromGitter | <kaushalmodi> `mapconcat` is just a useful sugar for folks who know what that term means :) |
14:46:54 | FromGitter | <kaushalmodi> `@["nim", "is", "cool"].mapconcat()` |
14:47:12 | * | craigger quit (Ping timeout: 244 seconds) |
14:47:54 | leorize | kaushalmodi: if you use it like that then, uh... use `strutils.join()` |
14:48:18 | FromGitter | <kaushalmodi> above does the same as that `foldr`. My hope is to have a much mature lisp-like Nim procs library over time; it has just started: https://kaushalmodi.github.io/elnim/ |
14:48:20 | FromGitter | <zah> Hey, do you guys know that bootstrapping currently fails with VCC 2017. What is worse, it looks like some kind of memory corruption problem (happens only in release) |
14:48:20 | * | syntonym[m]1 joined #nim |
14:49:21 | FromGitter | <kaushalmodi> leorize: yeah `join(" ")` is nicer than `foldr` for this |
14:49:42 | * | Snircle quit (*.net *.split) |
14:49:42 | * | elrood quit (*.net *.split) |
14:49:43 | * | nsf quit (*.net *.split) |
14:49:43 | * | flyx quit (*.net *.split) |
14:49:43 | * | gh0st[m] quit (*.net *.split) |
14:49:43 | * | syntonym[m] quit (*.net *.split) |
14:49:45 | * | planetis[m] quit (*.net *.split) |
14:49:45 | * | TheKing[m] quit (*.net *.split) |
14:49:46 | * | nif quit (*.net *.split) |
14:49:48 | * | def- quit (*.net *.split) |
14:52:57 | * | banc quit (Ping timeout: 252 seconds) |
14:53:51 | FromGitter | <kaushalmodi> also, I don't have a real use case on when I might need to specify a closure to `mapconcat` as allowed in the original elisp version, but my idea was to port that fn to Nim as much faithfully as possible.. so this works `@["nim", "is", "cool"].mapconcat(" + ", proc (x: string): string = x & "(" & $x.len & ")")` |
14:54:15 | * | PrimHelios quit (Ping timeout: 250 seconds) |
14:54:21 | leorize | you know, there's the `do` notation |
14:54:24 | FromGitter | <Vindaar> @leorize: good point regarding `join` |
14:54:45 | FromGitter | <kaushalmodi> leorize: yes, but afair, `do` is on chopping block |
14:55:03 | leorize | ? |
14:55:13 | FromGitter | <kaushalmodi> I had done some analysis between do and anon procs:https://scripter.co/notes/nim/#summary-of-anonymous-procs-and-do-notation |
14:55:55 | * | banc joined #nim |
14:57:03 | FromGitter | <kaushalmodi> leorize: I could be mistaken, but a while back, there were some talks about `do` notation. May be Araq can help clarify this. (or may be it was `do` notation in some other context in Nim) |
14:57:33 | leorize | there used to be a syntax change for the `do` notation |
14:57:49 | leorize | it was reverted in the release after that however |
14:59:18 | Araq | alehander42: Karax already supports this |
14:59:45 | Araq | if you import karax_dsl from native Nim it's a toString renderer |
15:00:26 | FromGitter | <kaushalmodi> Araq: the `do` notation for anon procs is here to stay? |
15:02:23 | leorize | kaushalmodi: https://stackoverflow.com/questions/12450066/flushing-buffers-in-c |
15:02:29 | * | sagax quit (Quit: Konversation terminated!) |
15:02:34 | leorize | that should address the `stdout.flushFile` in your notes |
15:03:06 | FromGitter | <kaushalmodi> leorize: Ah yes, I have to yet respond to a kind comment someone posted. I never got back to them. |
15:03:59 | FromGitter | <kaushalmodi> thanks for that link; I will assimilate that into my notes |
15:04:13 | Araq | kaushalmodi: I don't like it but it's not in .experimental so unless somebody writes an RFC with a massive number of upvotes, it's here to stay |
15:04:29 | FromGitter | <kaushalmodi> Araq: cool |
15:05:11 | FromGitter | <kaushalmodi> I then got confused with discussion about deprecating some other do syntax few months back |
15:05:32 | Araq | well I really don't like it :P |
15:05:38 | * | craigger joined #nim |
15:05:46 | Araq | it feels bolted on |
15:06:13 | Araq | and its primary use cases never materialized |
15:06:26 | Araq | so ... don't make me think about it |
15:06:35 | FromGitter | <kaushalmodi> :P OK |
15:06:37 | * | narimiran joined #nim |
15:06:42 | * | craigger_ quit (Ping timeout: 252 seconds) |
15:13:37 | * | planetis[m] joined #nim |
15:15:53 | * | TheKing[m] joined #nim |
15:17:03 | anamok | In system we have Natural, Positive, but no Negative. |
15:19:29 | anamok | Shouldn't Negative be there too? |
15:20:04 | leorize | well, how many times would you found yourself using `Negative`? |
15:20:36 | anamok | well, rarely :) |
15:20:49 | anamok | OK, so that's the reason |
15:23:30 | * | nsf joined #nim |
15:25:20 | shashlick | Any ideas in this https://github.com/dom96/choosenim/issues/96 |
15:25:53 | FromGitter | <kaushalmodi> Can we have generic anonymous procs? |
15:26:22 | leorize | why would that even be a thing? |
15:26:47 | FromGitter | <zah> I remember implementing generic lambdas in the past ⏎ try map(list, proc (x: auto): auto) |
15:26:48 | FromGitter | <kaushalmodi> hehe, I was just trying this out: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc754b8600c5f6423c42925] |
15:27:12 | FromGitter | <zah> the -> sugar syntax is based on this I think |
15:27:38 | FromGitter | <kaushalmodi> @zah yay! `auto` works |
15:27:42 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc754ee6e5a401c2d882a19] |
15:27:44 | FromGitter | <kaushalmodi> thanks |
15:27:51 | FromGitter | <zah> Any other generic type class will work as well |
15:28:13 | leorize | why would one even use that... |
15:28:21 | FromGitter | <kaushalmodi> leorize: in above example, it would be odd to restrict the type in the anon proc if the parent proc is generic |
15:28:39 | FromGitter | <kaushalmodi> In writing notes, I cover all possibilities |
15:29:07 | FromGitter | <kaushalmodi> I just end up with many "what if" questions and try them out |
15:32:33 | * | craigger quit (Ping timeout: 252 seconds) |
15:32:43 | leorize | I don't feel "odd" at all... |
15:32:43 | * | craigger joined #nim |
15:33:19 | leorize | well the `sugar` syntax should cover when you don't feel like typing the type out |
15:35:57 | * | Trustable joined #nim |
15:39:22 | * | darithorn joined #nim |
15:43:47 | * | craigger_ joined #nim |
15:45:19 | * | nsf quit (Quit: WeeChat 2.2) |
15:45:28 | * | craigger quit (Ping timeout: 245 seconds) |
15:45:54 | * | gh0st[m]1 joined #nim |
16:07:33 | anamok | Can we add a doc string to a var? I want to comment a public var in my library. |
16:09:34 | leorize | sure |
16:10:05 | leorize | either append it like this: `var smt = 0 ## doc str` |
16:10:22 | * | smt quit (Read error: Connection reset by peer) |
16:10:44 | leorize | or `var smtelse = 1\n<indent>## doc str` |
16:11:13 | anamok | thanks |
16:12:01 | PMunch | The variable might have to be exported as well |
16:12:18 | leorize | it's a public var so... |
16:12:30 | PMunch | Yeah |
16:15:18 | * | smt joined #nim |
16:17:48 | anamok | worked well |
16:24:40 | * | 7IZAAOQQ7 joined #nim |
16:24:40 | * | flyx joined #nim |
16:24:40 | * | gh0st[m] joined #nim |
16:24:40 | * | nif joined #nim |
16:24:40 | * | def- joined #nim |
16:24:41 | * | 7IZAAOQQ7 quit (Ping timeout: 252 seconds) |
16:24:41 | * | gh0st[m] quit (Ping timeout: 252 seconds) |
16:26:37 | * | Vladar quit (Remote host closed the connection) |
16:49:12 | * | platoff quit (Quit: Textual IRC Client: www.textualapp.com) |
17:08:06 | * | platoff joined #nim |
17:14:30 | * | Trustable quit (Remote host closed the connection) |
17:32:06 | * | PrimHelios joined #nim |
17:41:38 | FromGitter | <kayabaNerve> How can I overload `=` for a ref or ptr? |
17:41:48 | FromGitter | <kayabaNerve> It looks like I can't. At all. |
17:42:19 | FromGitter | <kayabaNerve> It has to be a ptr or a ref. ref has nicer syntax. If it's not either, then it crashes, because this C++ lib has the constructor marked private. |
17:42:26 | Araq | yes, by design, the destructor spec is hard enough to get right already |
17:42:41 | Araq | and it's easy to wrap the ptr/ref in an object field |
17:42:55 | Araq | shashlick, it crashes consistently... hmmm |
17:42:56 | FromGitter | <kayabaNerve> Got it. Thanks for the info. |
17:50:49 | narimiran | "Warning: safeAdd is deprecated" and should be replaced with...... ? |
17:52:56 | * | voiceftp quit (Read error: Connection reset by peer) |
17:53:25 | Araq | add |
17:54:13 | FromGitter | <kayabaNerve> Thanks Araq for the object wrapper trick; worked perfectly. |
17:54:53 | shashlick | Araq: is it an async issue? |
17:55:26 | Araq | shashlick, probably, what does the code look like? |
17:55:47 | narimiran | Araq: should i try to replace `safeAdd` with `add` inside of compliler/, or those should not be touched? |
17:56:55 | leorize | once we have proper destructors, would there be a "Box" type that encapsulate a `ptr`? |
17:57:12 | narimiran | `safeAdd` is used 12 times in total, if my search is correct |
17:58:03 | shashlick | Araq: starts here - https://github.com/dom96/choosenim/blob/493d5d68cd76bb17e6ef0e49565774676cffde96/src/choosenim/telemetry.nim#L170 |
17:58:58 | shashlick | Could be a bug in the analytics package but I'm a noob with macros |
18:00:42 | Araq | there are no macros insight |
18:02:08 | FromGitter | <kayabaNerve> Araq: While you're here, there's no command line option to set the language, right? |
18:02:12 | Araq | leorize, and what would that 'Box' do? usually you have a ptr because some foreign memory management scheme |
18:02:28 | Araq | that means you need to write your own destructor. |
18:02:40 | Araq | "set the language"? |
18:02:45 | FromGitter | <kayabaNerve> The backend. |
18:02:59 | * | rwerzxc joined #nim |
18:03:49 | FromGitter | <kayabaNerve> I'll just manually define cpp |
18:03:54 | FromGitter | <citycide> @kayabaNerve I think you need `nim c`, `nim cpp`, `nim js` etc |
18:04:40 | * | PrimHelios_ joined #nim |
18:04:44 | FromGitter | <kayabaNerve> @citycide My IDE is running `nim check`. |
18:04:58 | FromGitter | <kayabaNerve> It's a tool to see if you're command is valid when compiling it. |
18:05:24 | FromGitter | <kayabaNerve> Since it interfaces with a C++ lib, I have this block. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc779e464cfc273f9e11d18] |
18:05:47 | FromGitter | <kayabaNerve> Because I have that block, my IDE keeps complaining my code is invalid because `nim check` acts as if it's C. |
18:06:05 | FromGitter | <kayabaNerve> I think the solution is just to run `nim check -d:cpp`. |
18:06:30 | FromGitter | <citycide> can't you use a nim.cfg or `.nims` |
18:06:54 | FromGitter | <citycide> hmm actually I don't recall |
18:07:09 | * | PrimHelios quit (Ping timeout: 244 seconds) |
18:07:27 | FromGitter | <kayabaNerve> I could but that's problematic for other reasons |
18:07:30 | Araq | `-d:cpp` is the proper way to solve this, it needs to be documented. |
18:07:39 | FromGitter | <kayabaNerve> Thanks A |
18:07:55 | Araq | but yeah, it means 'nim compile --backend:cpp' would have been a better way |
18:08:02 | Araq | well we can still introduce it |
18:08:13 | FromGitter | <kayabaNerve> I tried that lol. Then I looked up the nimc page. |
18:09:09 | FromGitter | <kayabaNerve> @citycide The issue with a Nims is that this is a Nimble package and it would have to be placed at the root of the package. I have no idea what side effects that would cause. |
18:10:34 | * | rewadz left #nim (#nim) |
18:10:43 | * | rewadz joined #nim |
18:13:56 | * | rewadz left #nim (#nim) |
18:13:59 | * | rewadz joined #nim |
18:14:10 | * | rewadz left #nim (#nim) |
18:14:18 | * | rwerzxc quit (Quit: Page closed) |
18:14:35 | FromGitter | <bpo217> hmmm the unittest module seems to suppress any echo messages within the tested code base. Is there a way to enable it? |
18:15:42 | FromGitter | <bpo217> It looks like the default output formatter is set to print all |
18:15:52 | FromGitter | <mratsim> that’s a bug then, are you sure it’s not exceptions that are captured? |
18:16:47 | FromGitter | <bpo217> The echo happens within the code base before the assertion is fired. The assertion is printed correctly. |
18:17:34 | FromGitter | <bpo217> I just converted a simple block test to try out the `unittest` module, and the echo I was expecting disappears. |
18:17:57 | FromGitter | <bpo217> By disappears, I mean, does not appear. |
18:20:58 | FromGitter | <bpo217> Something is up, it might be my fault after all. |
18:21:09 | narimiran | another one: "Warning: mdbg is deprecated" ...and what is the alternative? |
18:23:37 | FromGitter | <bpo217> @mratsim Thank goodness it was my fault. |
18:27:48 | * | TheLemonMan joined #nim |
18:28:18 | TheLemonMan | Araq, if I move() an object into a sink parameter should I get an error if I try to use it again? |
18:28:31 | TheLemonMan | wasMoved seems to only zero it out |
18:32:24 | shashlick | Araq: is this crash because currentExc.msg is nil? https://github.com/dom96/choosenim/blob/master/src/choosenim.nim#L211 |
18:32:26 | * | PrimHelios_ quit (Ping timeout: 276 seconds) |
18:32:33 | shashlick | not sure where the msg is set |
18:34:38 | * | stefanos82 quit (Quit: Quitting for now...) |
18:37:36 | TheLemonMan | oh I see, the move semantics are similar to C++ |
18:39:07 | Araq | TheLemonMan, yeah, but sink parameters' spec is about to change slightly |
18:39:36 | Araq | that said, in general "attempt to use after move" is at best a warning, not an error |
18:40:03 | Araq | because I'm not really happy how Rust models the heap |
18:40:41 | TheLemonMan | I expected `sink T` to be a "give ownership to the callee" and that it'd prevent any further use of the sunk object |
18:41:06 | Araq | in a way we turn a temporal memory safety problem into a spatial one, that's good enough in my book :-) |
18:41:36 | Araq | 'sink T' does mean "give ownership to the callee" |
18:42:05 | Araq | it's just that proving after an explicit 'move' that it's not gonna accessed ever again is hard |
18:42:29 | TheLemonMan | let's add lifetimes then! |
18:42:32 | Araq | essentially you can only prove it in the cases where the compiler determines this on its own |
18:42:56 | Araq | so 'move' is comparable to 'cast' |
18:43:37 | Araq | and lifetimes don't help, 'p(move a[i]); echo a[j] # valid if i != j' |
18:44:05 | Araq | it's the aliasing problem, nobody has a good solution for it. |
18:44:44 | TheLemonMan | yeah, aliasing complicates every kind of analisys |
18:49:02 | * | endragor joined #nim |
18:53:27 | * | endragor quit (Ping timeout: 250 seconds) |
18:53:38 | anamok | Was Objective-C support dropped? |
18:54:09 | poopBot | ok so i am no more looking for best gui , i will take any gui that has good docs |
18:54:48 | shashlick | this is asyncmacro related - beyond me |
18:55:48 | Araq | poopBot, I spent quite some time on ui.nim, it's portable and simple. installation problems should be solvable |
18:55:58 | Araq | shashlick, dom96 will read this :-) |
18:56:36 | Araq | TheLemonMan, what Rust does here (and correct me if I'm wrong) is it treats the array as a whole, you can only move it completely or not |
18:56:59 | Araq | which IMHO is too restrictive |
18:57:01 | shashlick | Araq: yep 🙂 I have a nimble and async bug for him |
18:57:14 | shashlick | but am unable to do anything with choosenim at this time |
18:57:17 | TheLemonMan | Araq, AFAIR yes, you borrow the whole thing |
18:59:46 | poopBot | Araq, ok i have some questions, var mainwin : Window , how can i do mainwin.background color or img? |
19:01:44 | * | kapil____ quit (Quit: Connection closed for inactivity) |
19:03:37 | Araq | poopBot: ui.nim uses the native widget/window system and doesn't support that |
19:04:03 | * | rockcavera quit (Remote host closed the connection) |
19:04:08 | poopBot | oh |
19:04:08 | FromGitter | <iffy> Is there a way to use `astToStr` inside a `compileTime` proc? When I do: ⏎ ⏎ ```astToStr: ⏎ tmp``` [https://gitter.im/nim-lang/Nim?at=5bc787a8069fca52a5502129] |
19:04:21 | poopBot | i thiked i could do this with gtk |
19:04:37 | anamok | I was looking for a REPL and I just found "nim secret". It looks great. |
19:04:39 | poopBot | wanted to something like bot left on this img |
19:04:40 | poopBot | https://kodi.tv/sites/default/files/page/field_image/about--devices.jpg |
19:05:05 | poopBot | then should i try nuklear-nim |
19:05:40 | poopBot | doom is coming for me :) |
19:06:06 | FromGitter | <iffy> err... I guess I'm asking if there's a way to turn a NimNode into it's equivalent Nim (as a string) |
19:07:00 | FromGitter | <iffy> *its |
19:07:10 | anamok | well, it just crashed |
19:07:12 | shashlick | nimnuklear for latest |
19:08:36 | Araq | poopBot: well GTK would also work, if you are familiar with that |
19:09:41 | poopBot | i used gtk with mono 1 time :) |
19:10:00 | * | PMunch shudders |
19:10:05 | Araq | or you use Karax for a HTML based UI and use a client/server split |
19:10:09 | PMunch | Gtk with Mono is about as painful as it gets.. |
19:10:35 | PMunch | Gtk with Nim and genui is bliss in comparison :P |
19:12:09 | Araq | oh yeah, genui... I need to try that one day. too bad I don't write UIs currently |
19:14:04 | * | krux02 joined #nim |
19:15:16 | poopBot | guess that day is now for me |
19:15:17 | FromGitter | <mratsim> by the way does sink happen for aliases? ⏎ ⏎ let a = expensiveComputation() ⏎ block: ⏎ let alias123_a = a ... [https://gitter.im/nim-lang/Nim?at=5bc78a45384492366155d145] |
19:15:58 | PMunch | Araq, I'm still considering how to make the "proper" genui |
19:16:13 | PMunch | Now I'm talking about the Gtk macro (I should really have named these projects different things..) |
19:16:28 | FromGitter | <mratsim> Proper code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc78a8b069fca52a55037d4] |
19:18:17 | poopBot | hmm , then nukler it is xD |
19:19:08 | PMunch | poopBot, it works great for Gtk though :) |
19:19:40 | PMunch | https://github.com/PMunch/gtkgenui |
19:19:42 | poopBot | so i can use genui or you have some separte |
19:19:47 | poopBot | oh ok |
19:19:55 | * | PrimHelios joined #nim |
19:19:58 | PMunch | https://github.com/PMunch/gtkgenui/blob/master/example.nim |
19:20:03 | PMunch | Example of how it's used |
19:22:20 | shashlick | there's nimui too which is up to date but i cannot get it working on windows - same with ui.nim |
19:23:11 | FromGitter | <mratsim> And also: are custom memory allocators and custom alignments for seqs working @Araq, I’m ready to rebuild Arraymancer backend using destructors and I’d like to experiment seqs on top of memory pools. (and Maybe on top of Cuda :P) |
19:23:14 | PMunch | If you want Windows compatibility you can try wxWidgets, it also has genui support :) |
19:23:44 | poopBot | i need this for rpi3 so just linux gtk, or that nuckler lib cuz i think it can be more pritty |
19:23:56 | FromGitter | <mratsim> Webview has potential as well, just run this example: https://github.com/oskca/webview/blob/master/tests/bindEx.nim |
19:25:30 | poopBot | PMunch, i copy pasted example but i get this error |
19:25:40 | poopBot | cannot generate code for: mArrGet |
19:25:44 | PMunch | Hmm |
19:25:47 | poopBot | on genui: |
19:26:43 | PMunch | Seems like it's broken past 0.17.0 |
19:26:52 | PMunch | I'll see if I can fix it :) |
19:26:59 | poopBot | then nukler it is xD |
19:27:19 | poopBot | or at least then nukler i will try |
19:27:30 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
19:28:07 | PMunch | Oh wait |
19:28:13 | PMunch | I got an error from glib2 |
19:29:11 | PMunch | Okay that was fixed by an update, but cairo is throwing me an error now |
19:29:51 | poopBot | yep thats how life works |
19:31:14 | PMunch | I have two different versions of cairo installed.. |
19:31:36 | PMunch | I have a vague memory that this had a purpose.. |
19:32:44 | poopBot | sorry i am like newbe a lot so cant really shake your memory |
19:33:29 | PMunch | Haha, no worries. IIRC the guy who made the Gtk bindings rewrote the whole thing, but something didn't work the same way |
19:38:29 | * | nsf joined #nim |
19:39:53 | * | PrimHelios_ joined #nim |
19:41:57 | PMunch | Hmm, is there a way to do identifier comparison |
19:42:10 | PMunch | ie. case-insensitive and underscore insensitive |
19:42:13 | * | PrimHelios quit (Ping timeout: 244 seconds) |
19:42:22 | FromGitter | <Vindaar> `eqIdent` in `macros` |
19:43:04 | PMunch | Oh neat |
19:47:12 | PMunch | ../../.choosenim/toolchains/nim-0.19.0/lib/pure/collections/deques.nim(171, 10) Error: internal error: too implement |
19:47:15 | * | zachk joined #nim |
19:47:17 | PMunch | Well that's not good |
19:52:13 | PMunch | Works in 0.18.0 |
19:53:35 | poopBot | hmm i in no hurry :) |
19:58:15 | Araq | ? |
20:01:00 | PMunch | Araq: https://github.com/PMunch/gtkgenui/tree/0.19.0 |
20:01:06 | PMunch | That's where the error message is from |
20:01:13 | PMunch | nim c example |
20:01:40 | PMunch | Works on 0.18.0 (but is not safe for 0.18.0 use as it can have nil errors) |
20:01:45 | anamok | I'm trying to implement the functional programming function "partition", but I ran into a problem: https://pastebin.com/1atzp45W . Could someone help me? |
20:01:47 | PMunch | But not on 0.19.0 |
20:04:51 | anamok | sorry, it should be `if pred: t &= it else: f &= it`. But I get the same error |
20:06:10 | * | PrimHelios_ quit (Ping timeout: 246 seconds) |
20:09:48 | anamok | Maybe I had better write a proc called partition instead of a template. |
20:11:22 | copygirl | Mhh I want to implement some union types (Union[T0,T1], implemented with case) where I have some magic to be able to do union[string] or so which would get me the string (if it is a string). Not quite sure how to go about that. |
20:14:51 | * | rockcavera joined #nim |
20:15:18 | copygirl | Mhh maybe I can just do it with generic functions. |
20:16:06 | copygirl | And perhaps macros later to generate n-length union types, constructors and getters. |
20:16:34 | bozaloshtsh | anamok: why are you using result? use the variables you defined. |
20:17:05 | anamok | At 22:04:51 I noticed that. But I get the same error. |
20:17:28 | anamok | There is a problem with the template. |
20:17:38 | bozaloshtsh | can you say what line the error really is on |
20:17:51 | bozaloshtsh | relative to the first line |
20:18:30 | bozaloshtsh | oh nvm |
20:18:30 | FromGitter | <Vindaar> @anamok: I guess this is what you want: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ note the difference in the `newSeq` lines [https://gitter.im/nim-lang/Nim?at=5bc7991664cfc273f9e1e545] |
20:18:35 | anamok | The problem happens when I try to call it. |
20:18:42 | bozaloshtsh | use t = newseq, not t: newseq |
20:19:03 | * | PrimHelios_ joined #nim |
20:19:10 | bozaloshtsh | do t: seq[type(arg)] = newSeq(0) |
20:20:15 | bozaloshtsh | newSeq is a value, but only types follow colons |
20:21:27 | bozaloshtsh | could even just do var t: type(s) = newSeq(0) |
20:22:44 | anamok | Thanks a lot, the tests passed. Yeah, my bad. |
20:23:10 | bozaloshtsh | also if you want better compile errors if you call the template with a non-seq, use openArray[T] instead of untyped |
20:23:59 | bozaloshtsh | template tempname[T](arg: openArray[T]) will be the line with the compile error, rather than whenever the [] proc is called |
20:26:31 | anamok | Why is the return type `untyped`? Could I specify that I return a tuple? |
20:26:40 | bozaloshtsh | you should |
20:27:51 | bozaloshtsh | untyped means "type doesn't matter now, the compiler will check it later on instantiation" -- it'll never lead to runtime errors but can obfuscate compile errors if misused |
20:29:40 | * | narimiran quit (Quit: Konversation terminated!) |
20:29:53 | bozaloshtsh | you should never use untyped if a generic would also work |
20:30:34 | bozaloshtsh | it's for really special cases, like injecting symbols/statements into a template or complex compile-time logic |
20:32:27 | anamok | I'm trying to add the tuple as a return type but ran into newer problems: https://pastebin.com/DAQBndFj |
20:33:23 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:33:37 | bozaloshtsh | openarray can't be used as a return type |
20:33:39 | bozaloshtsh | only as a parameter |
20:33:48 | bozaloshtsh | it's like varargs, a special union type |
20:34:05 | bozaloshtsh | https://forum.nim-lang.org/t/3872 |
20:35:39 | anamok | Should I return (seq[T], seq[T]) ? |
20:35:53 | * | kapil____ joined #nim |
20:35:57 | bozaloshtsh | yeah, because that's what you're constructing |
20:38:39 | dom96 | shashlick: Araq: what will I see? |
20:40:38 | FromGitter | <Vindaar> @dom96 I think https://irclogs.nim-lang.org/17-10-2018.html#15:25:20 shashlick's responses below |
20:41:07 | anamok | bozaloshtsh, Vindaar: thanks for the help, I could solve it. Here is the final (?) version: https://pastebin.com/2BG5Kpsz |
20:41:35 | dom96 | Ahh, already replied |
20:42:17 | shashlick | dom96: any ideas how to proceed |
20:42:54 | shashlick | I looked at the exception string, nothing outstanding there |
20:43:05 | dom96 | --laxStrings:on |
20:43:12 | dom96 | to check if that's the cause |
20:43:14 | shashlick | Async post not working would get caught right away |
20:43:17 | shashlick | Ok |
20:43:48 | shashlick | Didn't want to jump too deep into async dispatch and macros |
20:48:36 | * | vlad1777d__ joined #nim |
20:49:48 | anamok | Is openArray a union type for arrays and seqs? When should I use it instead of seq? If I also want to pass an array to the func? |
20:50:42 | bozaloshtsh | read that forum post I linked |
20:50:48 | bozaloshtsh | It explains it pretty well |
20:51:36 | bozaloshtsh | tldr; it's a special parameter-only union type |
20:51:38 | anamok | oh, I missed that line |
20:53:00 | shashlick | dom96: nope --laxStrings:on didn't help |
20:53:33 | dom96 | weird |
20:53:48 | shashlick | how do exception strings get initialized? |
20:54:55 | dom96 | How can it be happening with Nim 0.18.0? |
20:55:04 | dom96 | Pretty sure that's what I built the latest choosenim with |
20:55:10 | shashlick | ya so it isn't that |
20:55:18 | shashlick | so I had to delete my entire ~/.nimble/pkgs to even compile |
20:55:30 | shashlick | since I had some packages installed as #head which don't get updated |
20:55:43 | shashlick | i don't think packages should make #head a dependency |
20:55:51 | shashlick | cause nimlbe will never update that |
20:57:21 | shashlick | so the NimbleError does have a valid message - can print it just fine |
21:00:26 | * | opi_ quit (Quit: ZNC - http://znc.in) |
21:00:41 | shashlick | I don't get it - my nim devel checkout is up to date but still shows as v0.18.1 |
21:01:07 | * | opi_ joined #nim |
21:05:36 | * | flaviu quit (Remote host closed the connection) |
21:05:55 | * | flaviu joined #nim |
21:08:18 | shashlick | was in some messed up state, at least one defect is gone |
21:13:29 | * | krux02 quit (Remote host closed the connection) |
21:15:00 | * | nsf quit (Quit: WeeChat 2.2) |
21:22:41 | * | flaviu quit (Remote host closed the connection) |
21:27:33 | * | PrimHelios_ quit (Ping timeout: 245 seconds) |
21:28:44 | FromDiscord | <treeform> I don't know what to do, -d:ssl = works, -d:ssL + jwt = works, -d:ssl + jwt + db_postgres = NPE SEGFAULT |
21:28:50 | FromDiscord | <treeform> why is SSL such a pain |
21:29:19 | FromDiscord | <treeform> oh and -d:ssl + db_postgres = also works |
21:29:23 | * | flaviu joined #nim |
21:29:35 | FromDiscord | <treeform> its only only when 3 things combine it SEGFAULTS |
21:30:09 | FromDiscord | <treeform> https://gist.github.com/treeform/1277270c3ece8051d5a5178923756237 |
21:32:07 | * | PrimHelios joined #nim |
21:34:20 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
21:40:20 | dom96 | jwt? Is that Java? |
21:41:02 | shashlick | dom96: choosenim crash is SSL related |
21:41:15 | shashlick | not sure what to do though - this is ubuntu |
21:41:32 | shashlick | `error:140E0197:SSL routines:SSL_shutdown:shutdown while in init` |
21:42:48 | * | PrimHelios quit (Remote host closed the connection) |
21:42:55 | FromDiscord | <treeform> dom96, json web tokens: https://github.com/treeform/jwt |
21:43:04 | * | PrimHelios joined #nim |
21:43:19 | FromDiscord | <treeform> main point that it includes libcrypto again: https://github.com/treeform/jwt/blob/master/src/private/crypto.nim |
21:43:44 | PMunch | Hmm, something has broken the deque module in 0.19.0 |
21:44:06 | FromDiscord | <treeform> -d:ssl includes libcrypto, db_postgres includes libcrypto, then my jwt includes libcrypto |
21:44:10 | dom96 | treeform: best thing to do is to reduce it to as small an example as possible, unfortunately |
21:44:21 | * | smt quit (Read error: Connection reset by peer) |
21:44:23 | FromDiscord | <treeform> they work separately, or if I have 2 of them |
21:44:24 | FromDiscord | <treeform> but not 3 |
21:44:33 | FromDiscord | <treeform> 3 libcrypto includes is too much |
21:45:04 | FromDiscord | <treeform> dom96, you right if you are willing to take a look I will make the smallest thing possible |
21:45:54 | dom96 | creating the smallest thing possible will make it easy for you to figure out what's going on |
21:46:07 | dom96 | I'll take a look too if you ping me about it |
21:46:29 | * | abm quit (Quit: Leaving) |
21:48:34 | * | smt joined #nim |
21:48:49 | * | endragor joined #nim |
21:49:08 | PMunch | Ah, it appears it's only when called from within a macro |
21:52:38 | * | shadowbane quit (Quit: Konversation terminated!) |
21:53:16 | * | endragor quit (Ping timeout: 246 seconds) |
21:56:01 | shashlick | dom96: https://github.com/nim-lang/Nim/issues/4617 |
21:57:12 | dom96 | oh, you're using a proxy? |
21:57:35 | shashlick | Ya |
21:57:47 | dom96 | well there you go |
21:57:49 | shashlick | But nimble works fine thru it |
21:57:58 | * | zachk quit (Changing host) |
21:57:58 | * | zachk joined #nim |
21:58:12 | shashlick | Why doesn't choosenim |
21:58:39 | PMunch | https://github.com/nim-lang/Nim/issues/9418 <- deque issue |
22:02:08 | * | PrimHelios quit (Ping timeout: 245 seconds) |
22:02:25 | * | PMunch quit (Remote host closed the connection) |
22:05:50 | FromDiscord | <treeform> hey @dom96 got it to a really small example, all stdlib, no my code at all: https://github.com/nim-lang/Nim/issues/9419 |
22:06:23 | * | abm joined #nim |
22:08:55 | dom96 | fun |
22:09:17 | dom96 | Either a stack corruption |
22:09:22 | dom96 | or some weird C code is generated |
22:11:54 | dom96 | ugh, where the hell is nimcache |
22:12:07 | FromGitter | <kaushalmodi> ? |
22:12:18 | FromGitter | <kayabaNerve> .cache ? |
22:13:04 | dom96 | bah |
22:13:07 | dom96 | Why not /tmp? |
22:13:30 | FromGitter | <kayabaNerve> I also dislike the change and just manually specify the nimcache. |
22:13:52 | * | Jesin joined #nim |
22:13:54 | FromGitter | <kaushalmodi> dom96: `set XDG_CACHE_HOME /tmp/$USER/.cache` that's what I do |
22:14:13 | FromGitter | <kaushalmodi> I mixed up tchs/bash syntax.. but you got the idea |
22:14:22 | dom96 | Awesome |
22:14:26 | dom96 | So we all set it to something else |
22:14:33 | dom96 | Sign of a great feature |
22:14:36 | * | PrimHelios joined #nim |
22:14:45 | FromGitter | <kaushalmodi> no, it uses XDG_CACHE_HOME if set |
22:14:51 | FromGitter | <kaushalmodi> I am using *that* feature |
22:15:00 | FromGitter | <kaushalmodi> I had that env var already set |
22:15:31 | FromGitter | <kaushalmodi> I like the chrome, mozilla, etc caches to live in /tmp |
22:16:04 | * | Jesin quit (Remote host closed the connection) |
22:23:46 | * | Jesin joined #nim |
22:23:52 | anamok | I think I found a "nim doc" bug. See this file: https://pastebin.com/X5xgtrLY . nim doc drops an error on this. If you remove the doc comments though, no problem. Can someone confirm it? |
22:30:16 | FromGitter | <kaushalmodi> Unrelated, but just now when I rebuilt nim from master, I saw "koch docs" fail |
22:30:44 | FromGitter | <kaushalmodi> After compiling the times module docs, I get; ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7b814ae7be9401673db27] |
22:31:34 | FromGitter | <kaushalmodi> ok the root cause of the failure is: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7b8461e23486b93d7335e] |
22:31:54 | FromGitter | <kaushalmodi> Wondering why Travis is green.. Araq? ^ |
22:36:58 | FromGitter | <kaushalmodi> here |
22:37:19 | FromGitter | <kaushalmodi> here's a quicker recipe: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc7b99fef4afc4f288e025f] |
22:43:25 | FromGitter | <kaushalmodi> anamok: about the "nim doc" bug you referred, I cannot reproduce any error |
22:43:40 | FromGitter | <kaushalmodi> `nim doc yourfile.nim` builds fine, no errors: https://ptpb.pw/qbaS |
22:44:11 | FromGitter | <kaushalmodi> I am using the latest build of nim from devel |
22:47:30 | * | elrood_ quit (Quit: Leaving) |
22:49:15 | anamok | kaushalmodi: I'll try with the devel version too |
22:50:00 | FromGitter | <kaushalmodi> Araq: btw that above framePtr error started happening because I now have a config.nims in ~/.config/nim/. Odd. |
22:50:26 | FromGitter | <iffy> @alehander42 It now supports subcommands (through some black magic) but I have to figure out why the run proc is getting executing twice for a command: https://github.com/iffy/nim-argparse/blob/subcommands/tests/test1.nim#L148-L161 |
22:52:18 | FromGitter | <iffy> oh nm, I know why it's getting called twice :) |
22:54:27 | anamok | kaushalmodi: thanks for trying it out. No problem with the devel build. |
22:55:26 | * | abm quit (Quit: Leaving) |
22:56:16 | FromGitter | <kaushalmodi> 👍 |
22:59:15 | * | arecaceae quit (Remote host closed the connection) |
22:59:34 | * | arecaceae joined #nim |
22:59:42 | * | PrimHelios quit (Ping timeout: 252 seconds) |
23:02:19 | FromGitter | <iffy> I've satisfied my goal to learn about macros/templates... is this project worth continuing for the benefit of people who actually want to use it? https://github.com/iffy/nim-argparse |
23:02:26 | FromGitter | <iffy> I'm heading off now, but will read comments later |
23:10:57 | FromGitter | <zacharycarter> I'm finally getting a handle on tmux / kakoune |
23:11:12 | FromGitter | <zacharycarter> I haven't written / edited any Nim code with it - but I'm starting to see the attraction |
23:11:36 | FromGitter | <zacharycarter> I'm not very used to modal text editors - I can deal with having to open / use vim, but I've become way too reliant on IDEs |
23:11:39 | FromGitter | <zacharycarter> and VSCode |
23:12:36 | FromGitter | <zacharycarter> anyway - just thought I'd share my thoughts on the editor so far - as soon as I start writing some Nim code with it (starting on Sunday) - I'll report back. I may try to do a twitch stream on Sunday too - I have to see how exhausted I am after Saturday and the work I have left to do on my house is done |
23:14:46 | FromGitter | <zacharycarter> also - if anyone has any up-to-date info @PMunch *wink* about the language server for Nim - I'd love to hear about it / potentially contribute |
23:15:36 | FromGitter | <zacharycarter> I think LSP is kind of overbearing / not needed - but I guess it's really the best path atm to getting robust Nim support into other editors that implement it |
23:15:38 | FromGitter | <zacharycarter> kak being one |
23:19:04 | * | NimBot joined #nim |
23:21:44 | * | kapil____ quit (Quit: Connection closed for inactivity) |
23:22:22 | * | Jesin quit (Quit: Leaving) |
23:29:51 | * | darithorn quit (Ping timeout: 252 seconds) |
23:33:19 | * | darithorn joined #nim |
23:36:29 | * | benjikun quit (Quit: Lost terminal) |
23:41:12 | * | smt quit (Read error: Connection reset by peer) |
23:41:57 | * | smt joined #nim |
23:42:29 | * | smt quit (Max SendQ exceeded) |
23:42:57 | * | smt joined #nim |
23:43:35 | * | smt quit (Max SendQ exceeded) |
23:44:03 | * | smt joined #nim |
23:47:06 | anamok | bye |
23:47:09 | * | anamok quit (Remote host closed the connection) |