00:02:43 | * | sz0_ quit (Quit: Connection closed for inactivity) |
00:22:46 | * | yglukhov joined #nim |
00:26:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
00:34:53 | * | pigmej quit (Ping timeout: 276 seconds) |
00:35:00 | * | pigmej joined #nim |
00:41:13 | * | zahary quit (Quit: Leaving.) |
00:45:46 | * | MJCaley joined #nim |
00:50:44 | * | kafke quit () |
00:54:23 | * | xet7 quit (Quit: Leaving) |
01:01:35 | * | wurui joined #nim |
01:14:30 | * | vlad1777d joined #nim |
01:16:26 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:16:49 | * | gokr left #nim (#nim) |
01:20:45 | * | regtools quit (Ping timeout: 264 seconds) |
01:35:08 | FromGitter | <RedBeard0531> dom96: you around? got a question about the async macro try impl |
01:59:17 | * | MJCaley quit (Quit: MJCaley) |
02:03:51 | * | S1t1Schu joined #nim |
02:07:33 | * | S1tiSchu quit (Ping timeout: 264 seconds) |
02:19:43 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:22:23 | * | marenz__ quit (Ping timeout: 248 seconds) |
02:33:25 | * | chemist69 joined #nim |
02:37:15 | * | sz0_ joined #nim |
02:37:20 | * | sz0_ quit (Client Quit) |
02:38:19 | * | sz0_ joined #nim |
02:38:37 | * | sz0_ quit (Client Quit) |
02:41:35 | * | MJCaley joined #nim |
02:42:05 | * | lotzz joined #nim |
02:46:34 | * | lotzz quit (Ping timeout: 260 seconds) |
02:52:03 | * | MJCaley quit (Quit: MJCaley) |
02:59:41 | * | wurui quit (Remote host closed the connection) |
03:04:10 | * | emgonam2 joined #nim |
03:04:26 | emgonam2 | morning all |
03:05:27 | * | vlad1777d quit (Ping timeout: 240 seconds) |
03:22:27 | * | endragor joined #nim |
03:26:55 | * | endragor quit (Ping timeout: 248 seconds) |
03:39:07 | * | vivus quit (Quit: Leaving) |
03:41:09 | * | __pycache__ quit (Quit: bye-nyan!) |
03:41:28 | * | m712 joined #nim |
03:54:33 | * | sz0_ joined #nim |
04:19:41 | * | endragor joined #nim |
05:24:52 | FromGitter | <DavidMeagher1> hello |
05:25:42 | FromGitter | <DavidMeagher1> I was wondering if anyone could help me with some curiosities I have about the static keyword and its implementation |
06:38:14 | * | nsf joined #nim |
07:03:49 | FromGitter | <Varriount> @DavidMeagher1 What's your question? |
07:29:35 | * | emgonam2 quit (Ping timeout: 276 seconds) |
07:38:18 | * | emgonam2 joined #nim |
07:42:47 | * | miran joined #nim |
07:43:57 | * | gokr joined #nim |
07:46:52 | * | PMunch joined #nim |
07:51:39 | * | oprypin quit (Remote host closed the connection) |
07:56:31 | * | xet7 joined #nim |
07:57:04 | * | vlad1777d joined #nim |
08:00:00 | * | xet7 quit (Client Quit) |
08:03:38 | * | xet7 joined #nim |
08:20:49 | * | cspar joined #nim |
08:23:10 | * | PMunch quit (Quit: Leaving) |
08:24:56 | * | PMunch joined #nim |
08:25:15 | * | yglukhov joined #nim |
08:25:20 | * | yglukhov quit (Read error: Connection reset by peer) |
08:25:36 | * | yglukhov joined #nim |
08:39:06 | * | claudiuinberlin joined #nim |
08:40:36 | * | floppydh joined #nim |
08:47:50 | * | zahary joined #nim |
08:51:37 | * | yglukhov quit (Ping timeout: 252 seconds) |
09:04:35 | * | gmpreussner quit (Ping timeout: 240 seconds) |
09:05:36 | * | yglukhov joined #nim |
09:05:38 | * | gmpreussner joined #nim |
09:14:52 | * | livcd quit (Remote host closed the connection) |
09:18:35 | * | livcd joined #nim |
09:22:55 | * | wurui joined #nim |
09:29:01 | * | wurui quit (Quit: http://quassel-irc.org - ???????) |
09:29:25 | * | wurui joined #nim |
09:29:40 | * | wurui quit (Remote host closed the connection) |
09:30:07 | * | wurui joined #nim |
09:38:00 | * | dddddd joined #nim |
09:43:29 | * | zahary quit (Quit: Leaving.) |
09:45:10 | * | zahary joined #nim |
09:50:27 | * | BitPuffin joined #nim |
10:13:43 | * | BitPuffin quit (Remote host closed the connection) |
10:14:43 | * | BitPuffin joined #nim |
10:15:09 | * | hogeland quit (Ping timeout: 268 seconds) |
10:16:39 | * | floppydh quit (Remote host closed the connection) |
10:17:27 | * | floppydh joined #nim |
10:17:27 | * | wurui quit (Remote host closed the connection) |
10:32:43 | * | Yardanico joined #nim |
10:33:57 | * | emgonam2 quit (Ping timeout: 240 seconds) |
10:44:45 | * | vlad1777d quit (Ping timeout: 264 seconds) |
10:45:27 | * | vlad1777d joined #nim |
10:57:25 | dom96 | RedBeard0531: just ask... |
11:02:46 | * | vlad1777d quit (Ping timeout: 276 seconds) |
11:06:46 | * | marenz__ joined #nim |
11:21:50 | * | SunDwarf quit (Ping timeout: 260 seconds) |
11:35:01 | * | regtools joined #nim |
11:36:38 | * | Vladar joined #nim |
11:55:36 | * | emgonam2 joined #nim |
12:10:54 | FromGitter | <survivorm> iup motivates me to learn lua :) ⏎ Since there are much more examples in lua, than in nim ⏎ btw, iup nim bindings doesn't have gridbox :( |
12:23:57 | * | sleepyqt joined #nim |
12:26:01 | PMunch | survivorm, you could learn Nim by expanding the bindings :) |
12:27:25 | FromGitter | <survivorm> I know, and it's pretty simple AFAIK (just copy and replace name) ⏎ If I won't be lazy, i'll do it :) |
12:28:09 | FromGitter | <survivorm> But for now, i'll be building my menu :) |
12:35:38 | PMunch | You should of course also check the wxWidgets genui macro: https://github.com/PMunch/wxnim#the-genui-macro *shameless plug* |
12:52:26 | FromGitter | <survivorm> Oh! Pretty. Thanks! Currently, i'm going to make interface pluggable to the main code, so i'm going to try several frameworks, wxwidgets included |
12:58:19 | FromGitter | <survivorm> how to install it via nimble? |
12:58:36 | FromGitter | <survivorm> it's not found 'out of box' |
13:02:01 | PMunch | Yeah, wxWidgets is a bit weird so I don't think it's nimble-installable atm |
13:02:12 | PMunch | Or it was weird |
13:02:26 | PMunch | Now you can just install the system wxWidgets package and use it |
13:02:31 | PMunch | Maybe it should be a nimble package.. |
13:02:45 | * | Snircle joined #nim |
13:03:44 | PMunch | You could try to clone it and run nimble install from the repo root |
13:03:48 | PMunch | See what happens :P |
13:13:56 | FromGitter | <survivorm> thanx, but why not in global nimble repo? Unstable, or just lazy? |
13:15:43 | * | SunDwarf joined #nim |
13:15:44 | FromGitter | <survivorm> I scanned through nimble packages while choosing UI framework |
13:16:04 | FromGitter | <survivorm> If it's where, it would be much better |
13:17:26 | FromGitter | <survivorm> btw, going by examples: ⏎ nim cpp -r controlgallery.nim ⏎ Hint: used config file '/etc/nim.cfg' [Conf] ⏎ nim.cfg(5, 1) Error: '@end' expected [https://gitter.im/nim-lang/Nim?at=5a561266ae53c15903cec682] |
13:19:27 | FromGitter | <survivorm> without nim.cfg in the same folder, compiles |
13:31:56 | FromGitter | <nc-x> How do you guys work on tools like nimble, nimsuggest etc? You work in the `"nim install directory" / "the folder in which the source code of the tool is"` or you have the github repo cloned elsewhere for development purposes? ⏎ Because everytime I do even a single line of change I get random issues unrelated to the change I made. ⏎ ⏎ For example, Right now I cloned nimble repo, did `nimble build`, renamed the |
13:31:56 | FromGitter | ... compiled binary to `nimbl`, ⏎ did `nimble path any-random-installed-package` multiple times, and now I get magic - ... [https://gitter.im/nim-lang/Nim?at=5a5615cc290a1f4561706c03] |
13:32:21 | FromGitter | <nc-x> Or maybe this is a bug? |
13:32:25 | FromGitter | <nc-x> IDK |
13:32:37 | FromGitter | <nc-x> Can anybody reproduce this issue? |
13:33:38 | Araq | nc-x: I only have nim devel in my PATH |
13:33:39 | FromGitter | <survivorm> I use packed version, based on github repo, though |
13:33:59 | FromGitter | <survivorm> and don't have such issues |
13:34:59 | FromGitter | <nc-x> Araq: Okay |
13:38:05 | FromGitter | <codenoid> i love nimble |
13:38:06 | FromGitter | <codenoid> <3 |
13:43:22 | PMunch | survivorm, a bit lazy, a bit unstable |
13:44:31 | PMunch | survivorm, and the @end is a bug. Not sure how we didn't notice that (maybe the parsing changed..) |
13:44:43 | PMunch | Just make sure to use the correct flag :) |
13:45:01 | PMunch | Oh wait, it has @endif |
13:45:09 | PMunch | Did they change it to @end? |
13:45:27 | Araq | it always was @end |
13:45:30 | * | samhain joined #nim |
13:45:42 | Araq | not sure why it wasn't caught much earlier |
13:46:40 | FromGitter | <survivorm> @PMunch, understandable... but to give a benefit of choice, you'd better add it. Nim have not much UI (i found only 2, but maybe i've not looked hard enough) prepacked, so another choice is much welcome |
13:48:02 | Araq | we have Qt, wxWidgets, libui, iup, gtk2, gtk3 |
13:48:26 | Araq | but UI programming is not done by many people anymore |
13:48:31 | PMunch | Don't we also have fltk? |
13:48:45 | PMunch | And NuGui |
13:48:45 | Araq | not sure fltk has been released yet, but yeah |
13:48:51 | livcd | what kind of ipc do you guys use when interacting with other programs in Nim ? |
13:48:55 | PMunch | Err, NiGui |
13:49:30 | Araq | ipc? how is that UI related? |
13:49:42 | livcd | unrelated to UI |
13:50:15 | Araq | varriount: http://typicalprogrammer.com/what-does-code-readability-mean ;-) |
13:50:18 | PMunch | survivorm, the original idea was to have the genui stuff in it's own package, but I had to do some changes to wxWidgets to make it work properly. That's the main reason it wasn't added from the start, now it's just laziness :P |
13:50:42 | PMunch | livcd, depends. Are you writing both programs? |
13:50:55 | livcd | PMunch: yes |
13:51:13 | Araq | then use sockets |
13:52:01 | PMunch | Yeah sockets is a good choice |
13:52:04 | livcd | ok |
13:52:23 | FromGitter | <krux02> Araq: I have a problem with getting rid of type aliases in macros |
13:52:57 | Araq | yes I know and it annoys me. |
13:53:09 | Araq | there have been test cases added |
13:53:16 | * | Vladar quit (Quit: Leaving) |
13:53:17 | Araq | to make your specific code work. |
13:53:18 | FromGitter | <krux02> ok, cool |
13:53:28 | Araq | and now you tell me it's broken again. |
13:53:40 | Araq | so at least contribute a real test, this time. |
13:53:52 | FromGitter | <survivorm> Oh. Than i think nimble needs at least a 'tags' optional field |
13:54:04 | FromGitter | <krux02> that I can do |
13:54:14 | FromGitter | <krux02> then how should I write the test then? |
13:54:26 | FromGitter | <survivorm> to get at least general categorization |
13:55:11 | FromGitter | <survivorm> Because as it's now, it's not very comfortable to use |
13:55:38 | FromGitter | <survivorm> The list, i mean |
13:56:11 | PMunch | survivorm, it does have a tags field |
13:56:23 | FromGitter | <survivorm> hm |
13:56:34 | FromGitter | <krux02> Araq: I can write a test that pretents that pretents there are functions ``proc isAlias(arg: NimNode): bool`` and ``proc resolveAlias(arg: NimNode)`` and then I can write tests on what they should return |
13:56:35 | FromGitter | <survivorm> and does anyone use it? |
13:57:15 | PMunch | survivorm, well most packages have them: https://github.com/nim-lang/packages/blob/master/packages.json#L6 |
13:58:00 | FromGitter | <survivorm> and if they do, why's the list on nim-lang.org unoficcial packages PLAIN? |
13:58:00 | * | Jesin quit (Quit: Leaving) |
13:59:02 | PMunch | survivorm, because it's old? |
13:59:12 | PMunch | Use something like nimble.directory instead :) |
14:00:47 | FromGitter | <survivorm> And that's? |
14:00:55 | Yardanico | https://nimble.directory |
14:00:56 | Yardanico | website |
14:01:24 | FromGitter | <survivorm> And no, answer "it's old" is no good for official website |
14:02:10 | FromGitter | <survivorm> @Yardanico, @PMunch thanx |
14:02:38 | FromGitter | <nc-x> Why does this line https://github.com/nim-lang/nimble/blob/6354132959f3018883d7b93dbd6af8bbddff5b0e/src/nimble.nim#L628 check *only* if the path *startsWith* the package name and not match the complete name? |
14:03:35 | Yardanico | because packages installed by nimble also have version in folder name? |
14:03:48 | FromGitter | <nc-x> So it should split the `-` |
14:03:59 | Yardanico | like drawille-0.1.0 |
14:04:08 | PMunch | survivorm, it's this list you're talking about right? https://nim-lang.org/docs/lib.html |
14:04:09 | Yardanico | nc-x: make an issue in nimble repo then :) |
14:04:24 | FromGitter | <nc-x> Right now, won't it match wrong package names? |
14:04:30 | FromGitter | <survivorm> @PMunch yeah |
14:04:37 | Araq | nc-y: I agree, it's sloppy coding and needs to be fixed asap. |
14:04:51 | PMunch | nc-x yeah a package named gtk could also match gtk3 for example |
14:05:03 | FromGitter | <nc-x> That may be the issue I am experiencing right now, but i don't understand why it didn't happen in earlier nimble version I have installed. |
14:05:10 | FromGitter | <nc-x> I'll open an issue. |
14:09:51 | FromGitter | <nc-x> Done -> https://github.com/nim-lang/nimble/issues/449 |
14:09:52 | Araq | oh sorry about the upgrade, I meant nc-x |
14:10:31 | FromGitter | <nc-x> 😄 |
14:10:51 | PMunch | It's a bit annoying that we don't get tab-completion with Gitter users.. |
14:11:51 | FromGitter | <survivorm> E-e-eh. Is it right that nimble.directory's search is case-sensitive? |
14:12:03 | FromGitter | <survivorm> Yeah, same to IRC |
14:12:28 | FromGitter | <survivorm> Example: https://nimble.directory/search?query=Qt, https://nimble.directory/search?query=qt |
14:13:05 | FromGitter | <nc-x> Looks like it. |
14:13:10 | FromGitter | <survivorm> It's not only annoying, but confusing too |
14:13:40 | Yardanico | make an issue :) https://github.com/FedericoCeratto/nim-package-directory |
14:13:43 | euantor | Create an isue: https://github.com/FedericoCeratto/nim-package-directory |
14:13:52 | euantor | Oops, Yardanico beat me to it! |
14:13:57 | Yardanico | :d |
14:15:06 | PMunch | Oh wow, yeah that is confusing :P |
14:15:26 | FromGitter | <survivorm> https://github.com/FedericoCeratto/nim-package-directory/issues/5 |
14:19:11 | PMunch | Better yet create a pull request :) |
14:21:53 | FromGitter | <survivorm> more stranges about directory: https://nimble.directory/search?query=GUI, https://nimble.directory/search?query=gui |
14:22:20 | FromGitter | <survivorm> Searches are different, but not completely |
14:22:24 | * | sendell joined #nim |
14:25:04 | PMunch | survivorm, it searches tags as well. So that might be the issue |
14:25:47 | PMunch | Or rather that might be why you're seeing so strange results |
14:28:32 | Araq | krux02: well I trust you will write a test case that finally covers your use case |
14:28:57 | * | sleepyqtx joined #nim |
14:32:19 | * | sleepyqt quit (Ping timeout: 255 seconds) |
14:39:49 | FromGitter | <survivorm> @PMunch that might be the case, yeah |
14:40:07 | FromGitter | <survivorm> but still, confusing like htll |
14:55:21 | * | samhain quit (Ping timeout: 265 seconds) |
15:00:30 | FromGitter | <krux02> Araq: what is my test case that does not cover my use case? |
15:01:53 | Araq | don't remember, somewhere in tests/macros, check the commit that claimed to fix your bug |
15:02:48 | FromGitter | <krux02> https://github.com/nim-lang/Nim/issues/6900 |
15:02:54 | FromGitter | <krux02> do you mean that? |
15:05:00 | FromGitter | <krux02> The behavior of nim changed, so that this test works now much less than it did before |
15:06:25 | * | gokr quit (Ping timeout: 260 seconds) |
15:07:08 | FromGitter | <alehander42> what are common reasons to get memory error while compiling tr macros? |
15:08:20 | FromGitter | <alehander42> hm, it seems to be needless return values, then second question, I read about the idea of norecurse pragma, but I cant see it in the docs |
15:08:57 | * | sleepyqtx quit (Quit: Leaving) |
15:09:58 | * | xet7 quit (Quit: Leaving) |
15:10:14 | * | PMunch_ joined #nim |
15:11:27 | * | emgonam2 quit (Ping timeout: 248 seconds) |
15:13:41 | * | PMunch quit (Ping timeout: 276 seconds) |
15:14:15 | * | MJCaley joined #nim |
15:15:05 | * | sz0_ quit (Quit: Connection closed for inactivity) |
15:28:33 | * | nc-x joined #nim |
15:28:46 | nc-x | Araq: https://github.com/nim-lang/nimsuggest/issues/72#issuecomment-356636137 |
15:30:29 | * | emgonam2 joined #nim |
15:32:27 | * | PMunch_ quit (Quit: Leaving) |
15:33:00 | * | nc-x quit (Client Quit) |
15:38:21 | * | nsf quit (Quit: WeeChat 2.0.1) |
15:38:23 | FromGitter | <krux02> Araq: I found out, that all I need is the skipTypes procedure also at compile time |
15:38:35 | FromGitter | <krux02> I mean callable from macros |
15:38:48 | Araq | that doesn't seem right |
15:38:50 | * | endragor quit (Remote host closed the connection) |
15:38:58 | Araq | you're supposed to call getTypeInst() in a loop |
15:39:08 | Araq | or getTypeImpl(), not sure |
15:39:24 | Araq | you loop until you get something concrete like ntyObject |
15:39:30 | Araq | or ntyArray etc |
15:39:47 | FromGitter | <krux02> or wait, maybe not I am not 100% sure, but it get's me pretty far |
15:40:06 | Araq | skipTypes would skip valuable information because other programmers quite like you demand to know the type aliases |
15:40:23 | FromGitter | <krux02> well I wanted to resolve type aliases, but not generic implementations |
15:41:09 | FromGitter | <krux02> meaning I wanted to resolve to ``Vec[4,float32]``, not ``object: arr: array[0..3, float32]`` |
15:42:08 | * | emgonam2 left #nim ("Leaving") |
15:42:25 | FromGitter | <krux02> getTypeImpl resolves to get the implementation |
15:42:36 | FromGitter | <krux02> but that is not what I am looking for. |
15:42:38 | Araq | nc-x unfortunately there are other regressions with nimsuggest, want to bisect them? |
15:43:00 | Araq | krux02: ok, but what does getTypeInst do? |
15:44:39 | Araq | btw https://github.com/nim-lang/Nim/issues/7041 is missing a heart from you XD |
15:47:12 | * | nc-x joined #nim |
15:48:57 | nc-x | Araq: I will try my best if I have time. But is this a bug or not (I am confused)? |
15:49:02 | * | azur_kind joined #nim |
15:49:05 | * | arnetheduck joined #nim |
15:50:11 | Araq | h1() has its definition in htmlgen, I think |
15:50:18 | Araq | and so nimsuggest should point to that |
15:50:51 | Araq | "resp" is part of jester's macro DSL, there is no definition at all |
15:50:51 | nc-x | 👍 |
15:51:25 | Araq | and "get" might be mapped to http.get, ask dom |
15:51:55 | Araq | and so nimsuggest tells you something you don't want to know, but which is correct anyway :P |
15:53:38 | nc-x | So the only problem is with h1(). I will edit the description then. |
15:56:33 | FromGitter | <krux02> Araq: getTypeInst returns the generic representation of a type, meaning I get a type like Vec[4,float32] or Vec4[float32] or Vec4f |
15:57:01 | FromGitter | <krux02> all those type are correct, but I want to normalize them to the representation of `Vec[4,float32]` |
15:57:28 | Araq | earlier you said you want Vec[4, float32] |
15:57:41 | FromGitter | <krux02> I just said that again |
15:57:43 | Araq | now that is in the list of options and you're still not happy |
15:57:53 | FromGitter | <krux02> ? |
15:58:05 | FromGitter | <krux02> how is that in the list of options? |
15:58:29 | Araq | "getTypeInst returns the generic representation of a type, meaning I get a type like Vec[4,float32] or Vec4[float32] or Vec4f" |
15:58:41 | FromGitter | <krux02> yes |
15:58:47 | * | jxy quit (Quit: leaving) |
15:58:48 | FromGitter | <krux02> that is exactly the problem |
15:59:04 | FromGitter | <krux02> Vec4f is just an alias for Vec[4,float32] |
15:59:04 | Araq | I fail to see how. |
15:59:22 | Araq | Vec4f is an ntyAlias, skip it with getTypeImpl |
15:59:22 | * | gokr joined #nim |
15:59:26 | FromGitter | <krux02> and I want a normalized representation that doesn't care about aliases |
15:59:34 | FromGitter | <krux02> Vec4f is easy to skip |
15:59:39 | Araq | so write one more line of code, yes. |
15:59:42 | * | endragor joined #nim |
15:59:50 | FromGitter | <krux02> but Vec4 is a generic alias type |
15:59:56 | FromGitter | <krux02> that causes problems |
16:00:08 | FromGitter | <krux02> because it is not an ntyAlias even though it is an alias |
16:00:13 | nc-x | Before even attempting to bisect any regressions in nimsuggest, I would love to have some documentation for `sug|con|def|use|dus|chk|mod|highlight|outline|known`. Can't find it anywhere. |
16:00:22 | FromGitter | <krux02> it is not just a symbol that is an alias for something |
16:00:48 | nc-x | Also `debug` and `terse` |
16:00:51 | Araq | what is it? |
16:01:29 | FromGitter | <krux02> ntyGenericInvocation |
16:01:48 | nc-x | Typing `terse` and **any** command for eg `sug a.nim:1:1` crashes nimsuggest. |
16:06:59 | Araq | nc-x the experienced user usually knows what's wrong. ;-) |
16:07:22 | Araq | nc-x: there are good tests for nimsuggest |
16:07:55 | Araq | krux02: ntyGenericInvocation seems ok as the canonical type? |
16:11:35 | FromGitter | <tim-st> When I have the choice to put a recursive called helper func inside another proc or outside, what would be better, or is it internally the same? |
16:13:34 | * | nc-x quit (Quit: Page closed) |
16:14:08 | Araq | outside to prevent captures if you care about performance (as I do) |
16:14:17 | FromGitter | <tim-st> Thanks! |
16:14:19 | Araq | inside if you care more about code readability. |
16:16:35 | zahary | let's say you are writing a term-rewriting macro that's only interested in adding code (i.e. a sort of aspect-oriented programming). The matched pattern is then going to appear in the bod of the macro. Is there a way to prevent the macro from being instantiated recursively in this situation? |
16:18:39 | Araq | the best solution is to wrap it in something like prevent(...) and don't match it again in the prevent() |
16:19:18 | Araq | this can be hard to do, there was an idea about .nonrecursive to prevent these things |
16:20:25 | Araq | but optimizations that are non-recursive are not really optimizations, I think and so you're misusing the TR macro system ;-) |
16:20:49 | * | gokr quit (Ping timeout: 248 seconds) |
16:21:37 | zahary | we want to misuse it as a code-instrumentation mechanism |
16:22:48 | * | Jesin joined #nim |
16:23:38 | zahary | for patch-free tracking of the modifications of certain built-in types such as string, seq, etc |
16:24:04 | * | jxy joined #nim |
16:24:59 | * | UxerUospr joined #nim |
16:26:37 | FromGitter | <krux02> Araq: the type is constructed like this: `Vec4f` → `Vec4[float32]` → `Vec[4,float32]` → `object: arr: array[0..3,float32]` and I would like to have a reliable way that stops at `Vec[4,float32]` |
16:31:44 | * | jxy quit (Quit: leaving) |
16:31:54 | * | jxy joined #nim |
16:33:00 | Araq | zahary: I would patch the string and seq implementations :-) |
16:33:20 | Araq | but just do what you think is best, PRs for .nonrecursive are welcome |
16:33:37 | * | floppydh quit (Quit: WeeChat 2.0.1) |
16:35:27 | Araq | krux02: I would match against Vec4f and tell my users to use that to get the optimizations they are after. |
16:36:30 | Araq | it's the clean solution IMO, a generic solution is the opposite of an optimized one. |
16:39:10 | * | azur_kind quit (Ping timeout: 260 seconds) |
16:42:43 | * | azur_kind joined #nim |
16:49:03 | * | azur_kind quit (Ping timeout: 248 seconds) |
16:54:35 | * | endragor quit (Remote host closed the connection) |
16:55:09 | * | endragor joined #nim |
16:55:53 | Yardanico | on of the hottest nim issues recently: https://github.com/nim-lang/Nim/issues/6958 :P |
16:56:50 | Yardanico | oh lol, it's 4th most commented nim issue ever :D |
16:59:55 | dom96 | what's the #1? :O |
17:00:14 | Yardanico | https://github.com/nim-lang/Nim/issues/2811 |
17:00:29 | Yardanico | https://github.com/nim-lang/Nim/issues?q=is%3Aissue+sort%3Acomments-desc+is%3Aclosed if you're interested (you can switch between closed and open tabs) |
17:01:14 | FromGitter | <nc-x> Araq: Debugging the reason for crash in `terse` mode, I get it the crash at https://github.com/nim-lang/Nim/blob/5f3438a3fe701544e1841419ecac9c8e64d5e66b/nimsuggest/nimsuggest.nim#L460 ⏎ According to the docs, tryRecv() isn't supposed to crash? |
17:01:18 | * | Jesin quit (Quit: Leaving) |
17:01:33 | FromGitter | <nc-x> The issue for `terse` mode crash is at https://github.com/nim-lang/nimsuggest/issues/74 |
17:01:36 | FromGitter | <alehander42> hahaha "Araq suggested rune ·" that would be amazing |
17:02:04 | Yardanico | hello·world |
17:02:21 | dom96 | yeah, that hyphen feature ended up being removed too |
17:02:33 | FromGitter | <alehander42> so it was actually in ? |
17:02:37 | dom96 | yep |
17:02:56 | dom96 | Looking at these most commented issues, so many people wanting something... getting it and then disappearing. |
17:03:42 | FromGitter | <RedBeard0531> I think that `hello·world` is how go does its name mangling. So it is probably a terrible idea :) |
17:03:47 | FromGitter | <alehander42> freed souls fleeing to hyphen(heaven) |
17:04:28 | FromGitter | <nc-x> I have absolutely no experience with channels/threads/etc., but I got a similar (i think) crash when I tried to get `spinny` package running on devel, I think I had changed https://github.com/molnarmark/spinny/blob/master/spinny.nim#L76 to `tryAcquire` ⏎ ⏎ No idea if I did something wrong, or changes to nim in new version made it crash. |
17:04:49 | FromGitter | <RedBeard0531> Just threaten to have the compiler enforce nep1 and silly requests like that should go away |
17:05:58 | dom96 | Sounds like a great idea :P |
17:07:04 | FromGitter | <krux02> Araq: my use case is not about optimizations |
17:07:20 | FromGitter | <krux02> my use case is about mapping glm types to glsl types |
17:08:06 | FromGitter | <krux02> and it is not easy to do, when I can't normalize the type representation |
17:08:50 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:09:42 | Yardanico | hmm, is it only me or nimsuggest is crashing on very simple files too? |
17:10:29 | FromGitter | <nc-x> nimsuggest's behaviour is pretty random for me. Works pretty good at times, fails at even simple things at other times, no idea why. |
17:11:08 | Yardanico | it worked better in the past :) |
17:11:14 | dom96 | What nimsuggest needs IMO is a simple way to submit bug reports with the code that's causing them |
17:11:40 | FromGitter | <alehander42> it probably hit puberty |
17:11:55 | dom96 | Something that is integrated into VS code: if nimsuggest crashes, you get a question asking you whether it's okay to submit the code you're working on to help fix the nimsuggest issue |
17:12:11 | Yardanico | dom96, well usually you'll need to submit whole project |
17:12:58 | Yardanico | so I reloaded project and now nimsuggest works.. strange :) |
17:13:41 | dom96 | people have enough bandwidth nowadays to upload the whole project |
17:14:33 | dom96 | of course that probably wouldn't help either. I bet most crashes happen as a result of nimsuggest running for long periods of time, and its state becoming corrupt. |
17:14:52 | dom96 | The compiler unfortunately was never designed to do this. |
17:15:05 | * | Vladar joined #nim |
17:15:20 | * | MJCaley quit (Quit: MJCaley) |
17:19:45 | * | endragor quit (Remote host closed the connection) |
17:19:48 | FromGitter | <RedBeard0531> Could nimsuggest be a wrapper daemon that launched a subprocess to do the actual work and restarted it if it crashes? While a hack, it would probably solve a lot of the usability issues on crashes |
17:21:39 | * | azur_kind joined #nim |
17:22:02 | dom96 | Yeah, I have a similar project in my todo list. |
17:22:23 | dom96 | A proper language server implementation |
17:22:31 | * | darithorn joined #nim |
17:22:53 | dom96 | That uses a mix of nimsuggest and simple custom parsing for faster response times. |
17:31:35 | dom96 | Honestly I would start working on this now, but the amount of projects I am maintaining scares me. |
17:32:38 | * | endragor joined #nim |
17:34:18 | * | sendell quit (Remote host closed the connection) |
17:36:48 | * | yglukhov quit (Remote host closed the connection) |
17:37:22 | * | yglukhov joined #nim |
17:40:48 | * | Trustable joined #nim |
17:41:04 | * | yglukhov quit (Read error: Connection reset by peer) |
17:41:15 | * | miran_ joined #nim |
17:41:17 | * | yglukhov joined #nim |
17:43:47 | * | azur_kind quit (Remote host closed the connection) |
17:45:47 | * | yglukhov quit (Ping timeout: 256 seconds) |
17:45:49 | * | oprypin joined #nim |
17:47:15 | * | azur_kind joined #nim |
17:47:29 | * | BitPuffin quit (Ping timeout: 252 seconds) |
17:55:19 | * | gokr joined #nim |
18:19:28 | * | yglukhov joined #nim |
18:19:49 | * | claudiuinberlin joined #nim |
18:22:59 | Yardanico | ok, now strfmt vs strformat has 49 comments (sharing second place with "new comment syntax" issus) |
18:23:02 | Yardanico | *issue |
18:23:18 | miran_ | you're welcome :) |
18:23:52 | Yardanico | first place will be hard to beat - 70 comments |
18:23:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:24:24 | Yardanico | btw - rust record is 300 comments |
18:26:38 | * | yglukhov joined #nim |
18:31:21 | FromGitter | <tim-st> If I understand the wiki page for utf8 correct, I can use char instead of runes if I want to find a specific ascii char? In other words: an ascii char is never part (e.g. prefix, suffix) of an utf8 rune? |
18:31:30 | * | yglukhov quit (Read error: Connection reset by peer) |
18:32:06 | * | yglukhov joined #nim |
18:35:26 | Yardanico | strings in nim are just bytes |
18:36:13 | Yardanico | AFAIK if you check for ascii "a" for example and somehow utf8 rune has "a" byte it will match |
18:36:29 | Yardanico | of course if you're talking about nim strings and not Rune type :) |
18:37:35 | FromGitter | <tim-st> I mean for example: If I want to parse until `[` will there be any utf8 symbol e.g. a chinese one that is a "combined utf8 char" and maybe have the value of `[` as part of the symbol? In this case my parser would match the chinese symbol but I only want `[` |
18:38:22 | FromGitter | <tim-st> If I understood correct bigger utf8 symbol are sequences of bytes, so I'm not sure if one of this sequence bytes could match |
18:38:31 | Yardanico | it won't match if it doesn't have "[" byte |
18:38:37 | Yardanico | I'm not really an expert in utf8, sorry :) |
18:39:04 | FromGitter | <tim-st> I'm not parsing for "[" I'm parsing for '[' |
18:43:47 | dom96 | If you're concerned about this, you can access each Rune in a string and match against that |
18:44:02 | dom96 | At least I think that's possible, I'm no expert either |
18:44:46 | FromGitter | <tim-st> I dont want to use the runes iterator and need indexing. It would be *much* easier to access the indices of the string directly. |
18:45:42 | FromGitter | <tim-st> This is in the english wiki: `Moreover, 7-bit bytes (bytes where the most significant bit is 0) never appear in a multi-byte sequence, and no valid multi-byte sequence decodes to an ASCII code-point.` |
18:47:56 | * | devdri joined #nim |
18:50:31 | Yardanico | then you're fine it seems? |
18:51:11 | FromGitter | <RedBeard0531> Rune isn't enough because it doesn't consider multi-rune graphemes. Everything in unicode is simultaneously simple and extremely complicated. @tim-st what precisely do you mean when you say you want to check for "a"? |
18:52:34 | FromGitter | <RedBeard0531> if you mean something that will be shown to the user as "a", you need to worry about combining characters, which is still a problem even with utf-32 or Rune iterators |
18:52:51 | FromGitter | <tim-st> I want to scan a string until char `'['` and I wanted to prevent runes(). I'm not sure if the bits of the char `'['` can be part of any utf8 symbol. If that's the case I have to use runes to make my parser secure |
18:53:26 | FromGitter | <tim-st> I dont want my parser to accidently match the wrong "combined symbol" |
18:53:28 | FromGitter | <RedBeard0531> symbol isn't a meaningful word in this context. Choose one of "byte/code unit", "code point/Rune", "grapheme" |
18:54:34 | FromGitter | <RedBeard0531> 99% of the time, the answer to your question is to ignore all of this and just look for the '[' byte |
18:55:03 | FromGitter | <tim-st> Yes, but can it match accidently the oth 1%? Is there a worst case? |
18:55:10 | FromGitter | <RedBeard0531> Are you parsing a defined protocol or dealing with general user text rendering? |
18:55:34 | FromGitter | <RedBeard0531> It is more like 99% of use cases than 99% of inputs. |
18:55:45 | FromGitter | <tim-st> utf8, it could be anything, |
18:55:56 | FromGitter | <tim-st> most times it's ascii, but I cannot know |
18:56:29 | FromGitter | <RedBeard0531> let me rephrase. Why are you looking for the '['? What are you planning to do with it? What is the actual use case? |
18:57:46 | FromGitter | <tim-st> bascially: can you generate a string `a` where readable char `'['` not in `a` but it matches `'[' in a` |
18:58:09 | * | nsf joined #nim |
18:58:16 | FromGitter | <tim-st> I'm developing a text parser at the moment |
19:00:38 | FromGitter | <tim-st> I'm scanning until char `'['` and then call a specific function because this symbol has a meaning |
19:02:04 | FromGitter | <RedBeard0531> What kind of text are you parsing? If you are defining the language the simplest thing to do is to just define the meaning of special symbols in terms of code points. Then you define your way out of the problem. |
19:02:43 | FromGitter | <tim-st> It's a text where it's likely that many symbols of the complete utf8 table appear |
19:02:56 | FromGitter | <tim-st> like 80% appear at least once |
19:03:38 | FromGitter | <tim-st> I'll probably just bruteforce the answer using a for loop over utf8 table |
19:03:46 | FromGitter | <RedBeard0531> again, "symbol" isn't a meaningful word in unicode |
19:05:26 | FromGitter | <tim-st> I'll bruteforce this now, I think I have the answer within the next 30mins |
19:05:42 | FromGitter | <RedBeard0531> I'm not sure if graphemes are a finite set in unicode since I don't know if there are any limits on the number of combining chars you can use in single grapheme. But even if it is technically finite the space is so large that you probably can't have a meaningfully large percentage of the possible graphemes. |
19:06:19 | FromGitter | <RedBeard0531> If you mean code points, then the answer is that the byte '[' will only appear in that code point for utf8 |
19:06:54 | dom96 | Looks like the language server protocol supports showing a message to the user and getting a reply: https://microsoft.github.io/language-server-protocol/specification#window_showMessageRequest |
19:07:04 | dom96 | So implementing an error reporting mechanism would be possible |
19:09:08 | * | yglukhov quit (Remote host closed the connection) |
19:09:41 | * | yglukhov joined #nim |
19:09:56 | Yardanico | but this will probably handled by vscode, no? |
19:10:05 | FromGitter | <tim-st> @RedBeard0531 Thanks |
19:10:19 | * | subsetpark_ quit (Quit: Connection closed for inactivity) |
19:10:22 | dom96 | Yardanico: Yes |
19:12:05 | GitDisc | <NopeDK> dom96, you working on an LSP compatible nimsuggest-like engine? |
19:12:24 | dom96 | nope, thinking about it though |
19:12:44 | * | yglukhov quit (Remote host closed the connection) |
19:13:00 | * | yglukhov joined #nim |
19:13:06 | GitDisc | <NopeDK> nice |
19:14:38 | Yardanico | yeah, LSP will be better than using EPC |
19:15:02 | Yardanico | because we'll get free autocomplete support for all modern editors with LSP :) |
19:16:13 | Yardanico | because there's stuff like this https://github.com/tomv564/LSP :) |
19:17:18 | Yardanico | https://langserver.org/#implementations-client |
19:17:32 | FromGitter | <RedBeard0531> @tim-st you may find this useful to read http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries (not the algorithms but the main explanation part of section 3 before 3.1 starts) |
19:18:52 | FromGitter | <RedBeard0531> A key phrase from there "In those relatively rare circumstances where programmers need to supply end users with user-perceived character counts[...]" |
19:19:37 | * | azur_kind quit (Quit: Leaving) |
19:35:20 | FromGitter | <nitely> anyone has a clue what's going on here: https://github.com/nim-lang/Nim/issues/7059 ? |
19:39:44 | FromGitter | <tim-st> @RedBeard0531 Thanks! I will read it |
19:41:00 | Yardanico | nitely: well I mean big files work fine, but it seems that compile-time stuff in big files doesn't work fine :) |
19:41:17 | Yardanico | int16 is used only for optimization purposes AFAIK |
19:42:30 | FromGitter | <nitely> I figured that much. The only problem with that is that it will show the wrong line/column number when it overflows |
19:43:16 | Yardanico | yes that's known, I'm trying to find an issue on github |
19:43:19 | Yardanico | don't close yours though |
19:43:54 | FromGitter | <nitely> The two issues opened has nothing to do with reporting, though |
19:44:50 | FromGitter | <nitely> well,the koch one does https://github.com/nim-lang/Nim/issues/7056 but I can live with it |
19:45:22 | Yardanico | vmgen.nim is not koch |
19:45:36 | Yardanico | well I mean koch is just a wrapper |
19:45:49 | Yardanico | well it's a *build tool* |
19:45:57 | FromGitter | <nitely> I know |
19:46:36 | FromGitter | <nitely> koch dies when trying to build the stack trace coz it's in debug mode, so it can't convert int16 |
19:46:54 | Yardanico | koch doesn't die, nim compiler does :) |
19:46:56 | FromGitter | <nitely> and it dies in msgs.nim not in vmgen |
19:47:12 | FromGitter | <nitely> it crashes there |
19:47:33 | Yardanico | koch just calls nim binary, see https://github.com/nim-lang/Nim/blob/devel/koch.nim#L476 |
19:47:49 | FromGitter | <nitely> anyway, I don't immediately care about that |
19:48:36 | FromGitter | <nitely> I want to use my unicode chars db at compile time (big arrays), so it's the other issue I care about |
19:50:45 | FromGitter | <nitely> Yardanico: ah, well, then if you find the issue about nim not handling big files when there is an error, you can close https://github.com/nim-lang/Nim/issues/7056 as duplicated |
19:51:48 | FromGitter | <nitely> but https://github.com/nim-lang/Nim/issues/7059 has nothing to do it with that (I think) |
19:56:43 | FromGitter | <data-man> Hi! ⏎ I want to add Nim support to CodeMirror, and then to Github linguist. Which keywords should be highlighted? Integer types? Or https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-keywords only? |
19:57:31 | Yardanico | only keywords from manual |
19:57:46 | Yardanico | because otherwise you make Araq sad :( |
19:58:17 | Yardanico | data-man: but wait, there IS nim support in github linguist |
19:59:12 | FromGitter | <data-man> Without syntax highlighting |
19:59:26 | Yardanico | ehm? |
19:59:41 | Yardanico | there is syntax highlighting on github for nim, but it uses NimLime and it's a bit broken |
20:00:59 | FromGitter | <data-man> Try edit any your nim-gist |
20:01:19 | Yardanico | ah, yes, there's no support on gist |
20:03:09 | FromGitter | <RedBeard0531> I'd highlight `result` since it is a psuedo-keyword inside any function that returns a value. The vim highlighting does that by default and I find it makes code much more readable: https://github.com/zah/nim.vim/blob/master/syntax/nim.vim#L145-L147 |
20:03:38 | dom96 | there is support on gist |
20:03:49 | dom96 | 'result' isn't a keyword |
20:03:54 | Yardanico | RedBear0531: ask Araq about this :P |
20:04:04 | dom96 | it's an identifier with a special meaning |
20:04:52 | FromGitter | <data-man> BTW Notepad3 now supports Nim :-) https://github.com/rizonesoft/Notepad3/issues/284 ⏎ For Windows only. |
20:04:55 | FromGitter | <RedBeard0531> What's the difference? addr is basically a normal function, but it is technically a keyword. |
20:05:47 | dom96 | The difference is that I can define my own 'result' variable |
20:05:53 | dom96 | I cannot define an 'addr' variable |
20:06:39 | FromGitter | <RedBeard0531> That matters when writing, not when reading code though |
20:07:52 | FromGitter | <RedBeard0531> I would want it to look weird when code defines a variable named result because that means that `result = asdfasdf` no longer has its normal meaning. |
20:09:28 | * | Sembei joined #nim |
20:11:17 | * | Trustable quit (Remote host closed the connection) |
20:14:43 | * | Trustable joined #nim |
20:15:13 | * | Trustable quit (Client Quit) |
20:26:30 | Araq | RedBeard0531: there are precise rules about what is a keyword and what isn't. if you really want to you can highlight 'result' (but then what's so special about it?) and not highlight 'addr', but don't pick some random misguided list of "built-in" words please |
20:29:45 | * | Sembei quit (Quit: WeeChat 2.1-dev) |
20:30:31 | * | yglukhov quit (Remote host closed the connection) |
20:31:02 | * | yglukhov joined #nim |
20:31:09 | * | Sembei joined #nim |
20:35:37 | * | yglukhov quit (Ping timeout: 265 seconds) |
20:37:47 | FromGitter | <RedBeard0531> I'm fine with highliting addr. And I agree that highlighting len is a bad idea. I guess my definition would be that tokens that are special in the *language* are worth highlighting and words that are special in the *library* aren't (at least not automatically). This is a bit broader than the technical definition of "keyword" but that seems more like a parser/lexer implementation detail than something that is worth |
20:37:47 | FromGitter | ... highlighting when reading code. There is also the somewhat thorny question of what to do about int, seq, string, cstring and the like. They are technically defined in system.nim, but it also seems somewhat reasonable to highlight them specially. |
20:38:16 | FromGitter | <RedBeard0531> Meh, coming up with hard and fast rules is hard. Seems like its all just squishy judgement calls :) |
20:43:48 | * | yglukhov joined #nim |
20:44:26 | * | devdri quit () |
20:50:39 | * | devdri joined #nim |
20:54:24 | Araq | RedBeard0531: VSCode, github, ... their highlighting is worse than no highlighting because of this "semantic" highlighting bullshit. |
20:54:38 | Araq | lexers have no semantic information. |
20:54:58 | Araq | so highlight keywords, it's proven to work and is helpful. |
20:55:15 | Yardanico | Araq, make a PR to vscode-nim :D |
20:55:22 | * | Yardanico quit (Remote host closed the connection) |
20:56:36 | * | yglukhov quit (Read error: Connection reset by peer) |
20:57:12 | * | yglukhov joined #nim |
20:57:54 | * | miran_ quit (Quit: Konversation terminated!) |
21:02:58 | dom96 | RedBeard0531: I agree that it would be helpful to highlight 'result', but it shouldn't have the same highlighting as a keyword |
21:03:02 | dom96 | because it's not a keyword :) |
21:04:51 | Araq | I don't want result = 0 to render differently than res = 0 or r = 0 or let foo = 0 |
21:05:20 | * | yglukhov quit (Read error: Connection reset by peer) |
21:05:22 | Araq | there is no control flow happening and 'result' is nothing that needs my attention. |
21:05:41 | Araq | for the same reason I despise ALL_UPPER_CONSTANTS_LIKE_THEY_ARE_SO_IMPORTANT |
21:05:43 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
21:06:11 | Araq | sorry, you constants are not important, they are in fact likely the only thing where no bug will be hiding |
21:08:13 | * | Sembei quit (Quit: WeeChat 2.1-dev) |
21:10:04 | * | Sembei joined #nim |
21:10:10 | FromGitter | <data-man> @Araq: What else I can do for my truecolored (very sexy, dom96's ©)PR? |
21:10:41 | Araq | data-man: will you work on something important afterwards? |
21:11:36 | FromGitter | <data-man> Allocators? |
21:12:00 | FromGitter | <data-man> CI? |
21:12:16 | FromGitter | <data-man> Containers? |
21:14:45 | FromGitter | <data-man> I think about Nim IDE, based on Scintilla & ImGUI. Soon docking system will be added to ImGUI. |
21:16:32 | * | gangstacat quit (Quit: Ĝis!) |
21:22:51 | FromGitter | <data-man> I'm now unemployed and I have a lot of time. :-( |
21:31:12 | * | gangstacat joined #nim |
21:32:18 | * | UxerUospr quit (Quit: Lost terminal) |
21:32:22 | * | yglukhov joined #nim |
21:32:54 | Araq | data-man: we can hire you |
21:33:39 | Araq | we're looking for a new Nim core developer |
21:34:36 | FromGitter | <data-man> Really? It would be great! :-) |
21:34:54 | * | yglukhov quit (Remote host closed the connection) |
21:36:03 | * | yglukhov joined #nim |
21:37:21 | * | Vladar quit (Quit: Leaving) |
21:38:16 | FromGitter | <zetashift> @data-man have you could help with: https://github.com/Araq/nimedit ? |
21:41:48 | FromGitter | <data-man> @zetashift: Do you use nimedit? |
21:44:34 | Araq | nimedit is awesome if only I could font rendering not to suck. or fix its annoying bugs. :P |
21:48:01 | FromGitter | <RedBeard0531> @Araq if you want a good stress-test for font rendering, see if it can handle https://github.com/tonsky/FiraCode |
21:48:16 | * | Atomic2 joined #nim |
21:48:21 | FromGitter | <data-man> I dislike to use SDL. :-) |
21:49:40 | FromGitter | <zetashift> @data-man No(t yet) but I'd rather have the focus on 1 Nim centered IDE/LSP rather than 10 different ones. Ofcourse I won't stop you from making your own :P |
21:53:37 | * | darithorn quit (Quit: Leaving) |
21:56:41 | dom96 | Improvements to nimsuggest/nimformat (or whatever it's called nowadays) would be a more effective use of time than writing yet another IDE |
21:57:00 | subsetpark | I would love love LOVE a working vim/nimsuggest setup |
21:58:14 | Araq | I have to agree with dom96. but there is also a good list of bugs to fix. |
21:58:31 | FromGitter | <RedBeard0531> @subsetpark I have a shitty but mostly working integration with zah/nim.vim. If you're interested I can post it to gist or something. |
21:58:59 | subsetpark | yeah post! |
22:00:41 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:05:08 | FromGitter | <RedBeard0531> OK, but I warned you it is shitty :) https://gist.github.com/RedBeard0531/6e29dc5e5b40d666bfdfaee2d5270a81 |
22:05:14 | Araq | btw it's called nimpretty because I like pretty. |
22:05:38 | Araq | human being is an animal of the eye and all that. |
22:05:55 | FromGitter | <RedBeard0531> Unfortunately nimsuggest requires knowing what the "main" file is, so it requires some manual effort to make it work each time you start vim. |
22:05:57 | FromGitter | <data-man> Hmm, what about nimsexy? :-) |
22:06:08 | GitDisc | <NopeDK> nimilicious |
22:06:21 | FromGitter | <RedBeard0531> ding ding ding, we have a winner! |
22:06:48 | GitDisc | <NopeDK> xD |
22:08:50 | FromGitter | <RedBeard0531> @subsetpark that also only works with vim8 since it uses async channels and such. But if you aren't already running vim8, that is a bigger problem than nimsuggest integration. Also, I recommend installing https://github.com/w0rp/ale which has built-in support for running `nim check` on save |
22:10:01 | FromGitter | <RedBeard0531> I'm going to add a link to Ale in https://github.com/nim-lang/Nim/wiki/editor-support#vim unless anyone objects |
22:10:17 | FromGitter | <data-man> @RedBeard0531: neovim worked? |
22:11:34 | Araq | data-man: nimpretty makes your code pretty but not sexy. unless you have some dubious affections to source code :-) |
22:12:02 | GitDisc | <NopeDK> Micro also has nim check on save but no integration for nimilicious yet |
22:12:05 | FromGitter | <data-man> :-D |
22:13:32 | dom96 | » nimble install nimpretty |
22:13:33 | dom96 | Error: Package not found. |
22:13:34 | dom96 | :/ |
22:14:09 | FromGitter | <RedBeard0531> @data-man nope. I wrote that for personal use and I only use vim8. I know it won't work in neovim because it uses a different API for jobs and channels, and I only know how to use the vim8 one. But feel free to steal this code and make it not-shitty :) |
22:14:49 | FromGitter | <RedBeard0531> Unless you meant Ale, in which case yeah, it works with both vim8 and neovim |
22:16:57 | * | vlad1777d joined #nim |
22:18:07 | FromGitter | <RedBeard0531> ALE link added: https://github.com/nim-lang/Nim/wiki/Editor-Support/_compare/16d203735f74fb72b424d1d8caa88fcd3f8fe3c9...5143ce05feb8ffc28c04cd7a98f5ee6459e11826 |
22:22:14 | subsetpark | ahh... I use neovim :/ |
22:22:33 | FromGitter | <RedBeard0531> On the general topic of nimsuggest, what is the correct way to use `sug` vs `con`, and how important is the difference? Could nimsuggest figure it out automatically? |
22:23:28 | Araq | how so? it's a completely different logic and might be bound to different key presses |
22:23:57 | Araq | sug -- '.' was pressed |
22:24:05 | Araq | con -- '(' was pressed |
22:24:42 | Araq | you can and should have both things open simultanously though |
22:24:46 | FromGitter | <data-man> nimsuggest can be compiled as dynamic library? |
22:24:59 | Araq | probably |
22:25:58 | * | Jesin joined #nim |
22:27:05 | Araq | "This is a breaking change, please don't do this at initialization but only if requested via enableTrueColor." |
22:27:12 | Araq | is my latest remark. |
22:27:19 | Araq | which you seem to have missed. |
22:27:43 | FromGitter | <RedBeard0531> But it isn't bound to a keypress directly. I use https://github.com/Valloric/YouCompleteMe which calls a single completion on one of several triggers, including when <c-space> is hit to request language-aware completion at any time. Couldn't nimsuggest just look around where the cursor is to figure out what should be suggested? |
22:27:53 | FromGitter | <data-man> Oh, sorry, I missed. Will be corrected. |
22:28:20 | FromGitter | <RedBeard0531> Also 'con' seems like it should also happen after a space due to command syntax. |
22:29:23 | FromGitter | <RedBeard0531> @subsetpark if this is true, neovim support will be harder. vim8 supports a few protocols including line-delimited text, while neovim only supports msgpack-rpc https://www.reddit.com/r/neovim/comments/58nrwv/neovim_api_comparison_with_vim_channels/ |
22:31:30 | Araq | space is too ambiguous, I'm a fan of explicit suggestion control anyway |
22:32:07 | Araq | my point is that nimsuggest cannot really figure out what to do here |
22:32:39 | * | yglukhov quit (Remote host closed the connection) |
22:44:03 | * | kafke joined #nim |
22:45:36 | * | devdri quit () |
22:52:27 | subsetpark | RedBeard0531, yeah, I have ALE - i love it |
22:53:04 | FromGitter | <Yardanico> @dom96: was something changed in httpclient? This doesn't crash after ~an hour https://github.com/nim-lang/Nim/issues/6155 |
22:53:30 | dom96 | Dunno, check the history? |
22:54:55 | * | Jesin quit (Quit: Leaving) |
22:56:53 | FromGitter | <Yardanico> Hmm, maybe https://github.com/nim-lang/Nim/commit/ac67f5eda57a91e97d16b31dcdea65fb39de9fc5#diff-232b8586e82bf9dedf2b071ec6fd52aa |
22:57:54 | dom96 | oh yes, that fixes a very critical bug |
22:58:28 | dom96 | yeah, I'm going to close your issue. |
22:59:19 | FromGitter | <Yardanico> Thanks for fixing it :) |
23:07:10 | dom96 | Anybody mind if I merge this? https://github.com/nim-lang/Nim/pull/6962 |
23:07:51 | FromGitter | <RedBeard0531> @Araq, I still don't get why nimsuggest can't figure it out. Doesn't it's semantic analyzer know what type (kind?) of identifier the user is entering at the current cursor position? It seems like it would be necessary to know if the current position is part of an argument or a dot-call expr. |
23:08:30 | FromGitter | <RedBeard0531> This feels like a classic "parsers know more than lexers" case that you are so fond of citing for highlighting :) |
23:10:33 | FromGitter | <RedBeard0531> @dom96 👍 I've been running with that patch manually applied on top of devel. I'll go ahead and close #6915 once some fix gets merged. |
23:10:55 | FromGitter | <Yardanico> Ohhhh openssl 1.1 is merged!!! |
23:11:17 | dom96 | okay, gonna merge that. |
23:11:39 | FromGitter | <RedBeard0531> Oh nice, I've also been manually applying that one :) |
23:11:53 | FromGitter | <Yardanico> I |
23:12:08 | FromGitter | <Yardanico> I'll test now on arch linux arm :P |
23:15:17 | FromGitter | <RedBeard0531> @dom96 did you see the async bugs I filed last night (#7051 and #7502)? Would it make sense for the macro to just wrap the `fut.read` call inside a `try` with the original except/finally blocks rather than rewriting it to use an if block? I think that would knock out both bugs, and hopefully simplify the macro. |
23:15:35 | FromGitter | <RedBeard0531> erm I meant #7052 |
23:17:16 | dom96 | I've sort of given up trying to fix the `try` transformation |
23:17:32 | dom96 | it's far over-complicated right now and I'm not sure what to do with it |
23:17:39 | FromGitter | <RedBeard0531> I was looking into adding a preprocess pass to rewrite `defer` into try/finally in async, until I realized that try/finally in async compiles but doesn't work :( |
23:17:49 | dom96 | and it doesn't really achieve the same semantics as a proper try |
23:18:44 | dom96 | but hrm, you might be on to something here |
23:18:48 | FromGitter | <RedBeard0531> How so, assuming that finally worked? |
23:19:41 | dom96 | Do try this change if you're up for it |
23:19:43 | FromGitter | <RedBeard0531> I was thinking you could avoid having the `if failed` check and just have a linear sequence of non-nested try/except/finally blocks |
23:19:51 | dom96 | But I have a feeling it's not that simple :) |
23:21:20 | FromGitter | <RedBeard0531> I'm still kinda rough at reading, let alone writing, macros. But I think I finally mostly understand the async macro, so maybe I'm getting the hang of it. Is there a "trick" to learning/understanding AST-level macros is is it always hard even when you are used to them? |
23:22:37 | dom96 | It sort of becomes overwhelming after a while, especially with the async macro |
23:22:55 | dom96 | there is so many different combinations it's hard to keep track of everything and make sure all AST transformations are correct |
23:23:37 | dom96 | an good IDE could definitely help here |
23:26:55 | FromGitter | <RedBeard0531> Have you looked at https://github.com/zielmicha/reactor.nim/blob/master/reactor/async/asyncmacro.nim? It felt a lot simpler especially because it makes await a real identifier rather than magicing it in, but that could be because it doesn't attempt to make try/except work |
23:27:56 | FromGitter | <RedBeard0531> It does support defer though which I prefer to try/finally (although I know that doesn't seem to be the majority opinion around here) |
23:28:49 | dom96 | It seems it also requires you to prefix everything with 'async' though, no? |
23:29:12 | FromGitter | <RedBeard0531> Unfortunately I assume it will be impossible to support destructors in async without proper compiler support for dtors in closure iterators |
23:29:48 | FromGitter | <alehander42> A plug-in that displays macro expansions with fuzzed input parallely to a macro would be so cool |
23:31:07 | FromGitter | <RedBeard0531> No this block handles adding async prefixes to identifiers that can't be overloaded because they are keywords: https://github.com/zielmicha/reactor.nim/blob/master/reactor/async/asyncmacro.nim?#L73-L90 |
23:32:27 | FromGitter | <RedBeard0531> It does have a slightly different meaning of defer though since they happen at function exit. Assuming I'm correct that nim's defer usually happens at block exit |
23:34:55 | FromGitter | <brentp> I'm using devel branch and getting a lot of new errors (Illegal storage access) inside of alloc.nim after recently pulling. Is this expected? |
23:35:06 | FromGitter | <brentp> I haven't previously had problems on devel. |
23:36:13 | dom96 | RedBeard0531: Interesting. I wonder where so much complexity comes from in my implementation. |
23:37:30 | dom96 | brentp: nope, is this in your program? |
23:37:46 | dom96 | can you give a repro test case? |
23:38:55 | FromGitter | <brentp> heh. yeah it's deep in my program. but I can see that what I'm sending is not nil |
23:39:09 | FromGitter | <brentp> then I get ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a56a41dce68c3bc74a28e77] |
23:41:43 | FromGitter | <brentp> sorry to drop a bug and run, but I'll check in later and/or try to make a small repro. the error is intermittent. |
23:47:38 | FromGitter | <mratsim> Oh yglughov and me got similar stuff, it's something in the new allocator (from mid December) |
23:49:16 | FromGitter | <mratsim> Offtopic: I'm curious about this newCigar proc |
23:50:58 | FromGitter | <RedBeard0531> @Araq do you have some grand plan for how to support destructors in closure iterators? |
23:51:28 | FromGitter | <zetashift> @mratsim probably returns a string of of base lengths |
23:51:49 | FromGitter | <RedBeard0531> Does it involve using c++17 + coroutines TS? :D |
23:52:01 | FromGitter | <zetashift> iirc CIGAR is a way of describing DNA bases with an operation after an alignment |