<< 15-11-2018 >>

00:01:27*cozachk quit (Quit: Leaving)
00:02:51*zachk joined #nim
00:03:17*PMunch quit (Ping timeout: 244 seconds)
00:03:36*PMunch joined #nim
00:03:45*zachk quit (Changing host)
00:03:45*zachk joined #nim
00:06:17*ftsf joined #nim
00:08:09*PMunch quit (Ping timeout: 268 seconds)
00:19:16FromDiscord_<treeform> Hey @dom96, I want to apologize, I think I was overly negative about async/await stuff. But now that I have used it for a bit its not that bad. It kind of just works now which is nice.
00:19:49dom96when were you negative?
00:19:57dom96I guess I missed it :)
00:20:02FromDiscord_<treeform> ok then
00:20:41FromDiscord_<treeform> async/await works great
00:21:20dom96what problems were you having?
00:21:47FromGitter<kdheepak> I think I'm still struggling to know when to use `config.nims`, `package_name_here.nims`, `package_name_here.nimble` and `package_name_here.nim.cfg`. Can someone comment on what is used when?
00:21:57FromGitter<kdheepak> Or point me to the documentation?
00:23:43dom96.nims/nim.cfg are for compiler configuration
00:23:54FromGitter<kdheepak> https://nim-lang.org/0.19.0/nims.html
00:24:00*PMunch joined #nim
00:24:13FromGitter<kdheepak> So are they interchangable? If I use one I don't need the other?
00:24:19dom96.nimble contains metadata about your package
00:24:26FromGitter<kdheepak> Is one preferred over the other?
00:24:29dom96nims and nim.cfg are interchangeable
00:24:33dom96.nims is preferred
00:25:13FromGitter<kdheepak> thanks! what is the difference between `./config.nims` versus `./src/modulename.nims`?
00:25:40FromGitter<kdheepak> Is the latter for a single file alone and the former for the entire project?
00:27:01FromGitter<kdheepak> `nimble build` swallows all the `echo output` from `config.nims` and `./src/modulename.nims` so I don't know whether it is being run or not.
00:29:23PMunchMade nimsuggest able to be imported as a library: https://github.com/PMunch/Nim/blob/nimsuggestlib/nimsuggest/nimsuggest.nim
00:29:39PMunchWith a little code-deduplication I think it can work pretty well
00:31:04FromDiscord_<treeform> dom96, I guess the problems I had were: hard to read stack traces, it forced to write Future[..] {.async.} everywhere for no reason, it had a bunch of confusing words like await/waitFor/runForever/asycnCheck ... but now it all makes sense and works well.
00:38:41shashlickdom96: can you please accept my packages PR - have a bunch more to submit
00:42:31*Aareon_ quit (Ping timeout: 260 seconds)
00:45:21*Aareon_ joined #nim
00:45:38FromGitter<bung87> does seq has something like `std::vector::data` in cpp ?
00:47:39FromGitter<bung87> never mind
01:01:45*PMunch quit (Remote host closed the connection)
01:10:09shashlickhow's it going bung87
01:11:05FromGitter<bung87> 2 files need to porting
01:13:50FromGitter<bung87> https://github.com/bung87/fastText guess almost there
01:15:28*zachk quit (Quit: Leaving)
01:29:23shashlickoh boy
02:13:55*smt quit (Read error: Connection reset by peer)
02:14:02*smt` joined #nim
02:15:47*Aareon_ quit (Remote host closed the connection)
02:16:05*Aareon_ joined #nim
02:16:24*Aareon_ quit (Remote host closed the connection)
02:16:41*Aareon_ joined #nim
02:44:34FromGitter<arnetheduck> @shashlick - to actually parse C++, you need some semantic capabilities - ie the parse rules change depending on if you're parsing a type, function or variable. most parsers intended for syntax highlighting and the like deliberately ignore this additional complexity at the cost of accuracy. good tooling (like semantic analysis and transformation) needs good accuracy - one of the reasons clang-* tools work so well is
02:44:34FromGitter... because they have access to a high-quality parser (or... crap in, crap out, as they say).. so my question was really in which category tree-sitter falls - parsing 18 languages indicates it's shooting for width, not depth
02:49:09*endragor joined #nim
03:05:08*vlad1777d quit (Ping timeout: 268 seconds)
03:05:33*banc quit (Quit: ZNC - http://znc.in)
03:07:05*dddddd quit (Read error: Connection reset by peer)
03:21:06*banc joined #nim
03:41:41shashlickWell ya it does target atom so might not be that good
03:42:22shashlickI won't claim to know one from the other at any length
03:43:14shashlickWhen it comes to wrapping c++ headers, do you think you still need semantics?
03:50:07*smt` quit (Read error: Connection reset by peer)
04:13:42*Aareon_ quit (Ping timeout: 276 seconds)
04:17:04*Aareon_ joined #nim
04:36:30FromGitter<arnetheduck> well.. my gut-feeling would be that tree-sitter is an upgrade compared to c2nim, accuracy-wise. I'm also guessing you can get away with heuristics and cover a good portion without accurate semantic analysis.. that said, for completely seamless integration, there's no escaping a fully accurate parser, so I guess it all depends where you want to place the bar
04:39:27*gangstacat quit (Ping timeout: 252 seconds)
04:43:02*rauss joined #nim
04:43:28*rauss quit (Client Quit)
04:43:39*rauss joined #nim
05:24:11*krux02 quit (Remote host closed the connection)
05:37:00*nsf joined #nim
05:46:38*rockcavera joined #nim
05:56:50*stefanos82 joined #nim
05:58:30*narimiran joined #nim
05:58:59*LyndsySimon quit (Ping timeout: 250 seconds)
05:59:13*LyndsySimon joined #nim
06:00:26*cyraxjoe quit (Ping timeout: 260 seconds)
06:00:26*deepend quit (Ping timeout: 260 seconds)
06:01:16*cyraxjoe joined #nim
06:02:32*deepend joined #nim
06:09:19*brainproxy quit (Read error: Connection reset by peer)
06:10:55*brainproxy joined #nim
06:17:00*rauss quit (Quit: WeeChat 2.3)
07:05:55*narimiran quit (Ping timeout: 244 seconds)
07:13:20*vlad1777d joined #nim
07:25:27*Aareon_ quit (Ping timeout: 276 seconds)
07:30:13*Aareon_ joined #nim
07:31:04*krux02 joined #nim
08:25:24FromGitter<cyberlis> Hi. If I take a slice of a string `text[1..^2]`, is it copy of the string or some kind of mapping?
08:28:03Araqcopy
08:28:17FromGitter<cyberlis> thank you
08:29:00FromGitter<narimiran> @cyberlis it is a copy, and you can test it easily by yourself: http://ix.io/1rXs/
08:29:17FromGitter<narimiran> ah, i'm too slow
08:29:43FromGitter<cyberlis> it is ok :)
08:39:39*Snircle quit (Read error: Connection reset by peer)
08:40:30*Snircle joined #nim
09:12:45FromGitter<cyberlis> Is `jester` the only up to date web framework ?
09:14:06AraqI don't know
09:15:43*floppydh joined #nim
09:19:58FromGitter<yglukhov> Araq: there seems to be a mistake in gc_commmon.nim. grep `when defined(stackIncreases):`. Should be `when stackIncreases` i think.
09:21:40Araqindeed
09:23:14FromGitter<yglukhov> I didn't file a pr because I dont know what it fixes :)
09:46:47*Snircle quit (Read error: Connection reset by peer)
09:47:45*Snircle joined #nim
10:36:58*gangstacat joined #nim
11:04:45*platoff_ joined #nim
11:09:03*cavariux quit (Quit: Ping timeout (120 seconds))
11:09:32*cavariux joined #nim
12:15:10Araqbtw there is a new broken tool, "nimfind"
12:15:42Araqan alternative idea of how to do a "nimsuggest"-like editor integration
12:30:17*nsf quit (Quit: WeeChat 2.3)
12:31:14*vlad1777d quit (Ping timeout: 268 seconds)
12:33:28*kapil____ joined #nim
12:35:22FromGitter<alehander42> what is this format that "every editor uses"
12:39:25FromGitter<alehander42> otherwise seems pretty nice
12:50:23*smt joined #nim
13:27:57*endragor quit (Remote host closed the connection)
13:44:03*platoff_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:45:04*ArchieTMichaKrzy joined #nim
13:56:23*dddddd joined #nim
13:58:06Araqit's filename:line:col
14:33:01*leorize quit (Quit: WeeChat 2.2)
14:35:13FromGitter<cyberlis> if i wanna use regexp, what module should I choose? module `re` or some other module?
14:38:47*leorize joined #nim
14:49:25FromDiscord_<treeform> I use `re`
14:52:43*ftsf quit (Ping timeout: 252 seconds)
15:11:43*nsf joined #nim
15:32:25*craigger quit (Quit: bye)
15:32:35*craigger joined #nim
15:32:46*craigger quit (Remote host closed the connection)
15:32:55*craigger joined #nim
16:12:46*Trustable joined #nim
16:13:38*narimiran joined #nim
16:35:59*couven92 quit (Read error: Connection reset by peer)
16:40:36FromGitter<cooldome> I am following the nimfind development, it looks really promising
16:41:34FromGitter<cooldome> Nimfind has the potential to fix the Nimsuggest issues everyone is complaining about
16:57:53Araqwell it only solves the "goto declaration"/"find usages" use cases but these are the most important
16:58:06Araqand autocompletion with "tabnine" is really awesome IME
16:58:44Araqbetter than a type-based analysis unless you use it for figuring out an API
17:00:02jxynimfind is a virus according to google
17:01:21FromGitter<iffy> Android question: I can compile with `--os:android` to make binaries that run on Android. But there's no way to distribute that binary (e.g. in an APK) so that a user could run it like a normal app, right? To make an APK, I *have* to use Java and eventually make a .dex file. Am I understanding correctly?
17:11:07*dddddd quit (Ping timeout: 240 seconds)
17:11:15FromGitter<yglukhov> @iffy Yep. Funny enough, there's no way to create a 100% native app for android. You would use at least NativeActivity or your own written in java. And yeah, the packaging tools are jvm dependent.
17:12:37FromGitter<iffy> Okay, that's unfortunate. Especially since it looks like dex files are immediately turned into ELFs on install: https://en.wikipedia.org/wiki/Android_Runtime#/media/File:ART_view.png
17:12:56FromGitter<iffy> (why not let me just provide an ELF, Android?) okay; well thanks for confirming my understanding
17:14:04*platoff_ joined #nim
17:16:41FromGitter<yglukhov> @iffy i'd suggest using gradle anyway even if you technically can get away without it.
17:17:28FromGitter<iffy> @yglukhov yeah, that seems like the most easy-to-maintain option
17:19:15shashlickAraq: what editor are you using? vscode?
17:19:20FromGitter<zacharycarter> @iffy - might want to look into android studio
17:19:46FromGitter<zacharycarter> although I've only used the android NDK
17:19:51FromGitter<zacharycarter> which isn't much fun
17:20:03FromGitter<yglukhov> android studio - why? there's nothing of interest there :)
17:20:08FromGitter<zacharycarter> I do have a sdl2 nim app still installed and running on my phone
17:20:11narimiranshashlick: yes, that is what he used in his streams, and i think most of people here use it
17:20:30FromGitter<zacharycarter> @yglukhov - I mean if you're already stuck in that hellish world of having to use gradle etc
17:20:42FromGitter<zacharycarter> maybe it makes nothing easier / better - I don't know
17:22:34FromGitter<yglukhov> iirc, given the use case (nim app), android studio will do pretty much nothing for you :). vim or vscode would be more useful
17:23:12FromGitter<iffy> No Android Studio for this project -- command line only :)
17:23:28*jxy quit (Quit: leaving)
17:23:43FromGitter<yglukhov> that was my design principle as well :)
17:26:24*dddddd joined #nim
17:28:56FromGitter<zacharycarter> I'm not a fan of JetBrains or their IDEs - android studio was particularly awful - but Java tooling is so bad without an IDE
17:29:12FromGitter<zacharycarter> maybe you're doing something different from what I was doing - or I could have gotten away without android studio
17:29:36FromGitter<iffy> Hold your laughter: I'm trying to make an Electron killer (but for mobile, too)
17:29:42FromGitter<zacharycarter> either way - I'm hopeful I'll never have to experience the android NDK ever again
17:29:55FromGitter<zacharycarter> oh - you mean a cross platform GUI solution?
17:29:58FromGitter<zacharycarter> yikes - gl
17:30:20*narimiran trying not to laugh
17:30:41FromGitter<zacharycarter> https://github.com/zserge/webview - seems like it might be worth checking out if you haven't already
17:30:44FromGitter<zacharycarter> before you go down that road
17:31:44xace@zacharycarter: isn't that a equivalent of electron?
17:31:45FromGitter<iffy> Yeah, I've looked at that. And this project could actually use that for the interface. But right now I'm more focused on the other parts that make Electron nice to use (auto updates, single command builds, seeing logs as the app runs, code signing, etc...)
17:32:25FromGitter<iffy> Cause other people have written good GUI things (like nimx or webview or whatever OpenGL lib you want to use)
17:32:30FromGitter<zacharycarter> xace: no it's much lighter weight than electron
17:35:15FromGitter<zacharycarter> xace: electron uses chromium under the hood - https://electronjs.org/blog/electron-internals-building-chromium-as-a-library
17:35:55FromGitter<kayabaNerve> CEF < Electron < React Native
17:36:02FromGitter<kayabaNerve> WebView < CEF
17:36:39FromGitter<kayabaNerve> I have to thank whoever here pointed out WebView. I was resistant but they were right.
17:36:48FromGitter<kayabaNerve> Might have been @zacharycarter... I'd have to check the logs
17:36:52FromGitter<zacharycarter> no wasn't me
17:37:00FromGitter<zacharycarter> maybe @mratsim ?
17:37:14FromGitter<kayabaNerve> OK. Don't steal credit and become a King in my eyes.
17:37:15FromGitter<zacharycarter> but I definitely promote it now whenever someone is talking about x-platform GUI
17:37:15FromGitter<kayabaNerve> Nah
17:37:18FromGitter<zacharycarter> lol
17:37:27FromGitter<zacharycarter> I thought I already was :P
17:37:33FromGitter<zacharycarter> and my royal palace was going to be your garage
17:37:42FromGitter<zacharycarter> and my royal stipend was going to be working for free
17:37:48FromGitter<zacharycarter> we've already figured all of this out already :P
17:38:19*platoff_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:38:46FromGitter<kayabaNerve> enthus1ast from IRC
17:39:02FromGitter<kayabaNerve> @zacharycarter Why the hell would I give a King my garage? They'd get under my bed.
17:39:08FromGitter<zacharycarter> lol
17:39:45FromGitter<kayabaNerve> Thanks enthus1ast
17:39:58FromGitter<zacharycarter> +1
17:42:58*Perkol joined #nim
17:43:16*Perkol quit (Remote host closed the connection)
17:44:22FromGitter<alehander42> Araq, so tabnine is good ? I have to try it for all of my code then
17:48:54*jxy joined #nim
17:51:41xacehmm, its just that my computers are old and weak, infact my cellphone might be faster than my pc, and I dont think I hate anything more than I hate the web related apps.
17:53:33Araqalehander42, it could be better but it's really nice so far
17:56:41xaceit seems like webview is just a webbrowser wrapped over your app, but the webbrowser is likely already installed on the target os
17:57:20FromGitter<alehander42> Araq, do you have the free or full version? I think the free one is based on max 200kb of the codebase
17:57:50FromGitter<alehander42> but i've tried it on smaller repo-s, so it felt ok
17:58:11FromGitter<yglukhov> @iffy, since you're into android now, I suggest looking into the standalone toolchains approach. so that you build the binary end-to-end by running nim and nim under the hood would invoke the standalone toolchain, and then you feed the built .so to gradle. The main idea is to not let gradle do the ndk-build.
18:03:18FromGitter<arnetheduck> all these little tools (grep, find, suggest, etc) would have a much larger chance of being used if they didn't require changes to the editor itself to be supported - changing *all* editors out there scales poorly.. thus sticking with outputs that resemble make/gcc/python/whatevers increase the potential utility greatly.
18:04:11shashlicktabnine just keeps saying generating to me - completes local text but nothing beyond the file
18:07:42FromGitter<alehander42> your name reminds me to eat, thank you
18:07:54FromGitter<alehander42> which editor do you try it in?
18:08:15shashlicki tried vim, now i'm trying on vscode
18:09:46FromGitter<zacharycarter> oh man
18:09:53FromGitter<zacharycarter> I didn't realize your name actually meant something
18:09:59FromGitter<zacharycarter> and it means something extremely delicious
18:10:11FromGitter<zacharycarter> and given my circumstances, that's a bad thing lmao
18:10:42shashlickwhat's funnier is that I'm vegetarian 🙂
18:11:29xacewait is tabnine + nim anygood?
18:11:43FromDiscord_<potatonomicon> thats quite the jump, from vim to vscode
18:11:48FromGitter<zacharycarter> shashlick: so now you're just trolling me :P
18:12:10FromGitter<zacharycarter> xace: I think tabnine supports all programming languages - I haven't used / tried it yet but I've heard good things from most that have
18:12:20*nsf quit (Quit: WeeChat 2.3)
18:12:36*Zevv quit (Quit: leaving)
18:12:38FromGitter<zacharycarter> although I think the commercial version is what you need - the free version sounds more like a trial than something that's really usable
18:12:50FromGitter<alehander42> yeah, it basically can work on any tokenizable content I think
18:12:55shashlick@potatonomicon: I've been scavenging - basically a lazy vimmer, tried Notepad++, Sublime, VSCode, Atom, Emacs, Scite
18:13:20FromDiscord_<potatonomicon> I currently use sublime
18:13:25xacehmm, I will have to look it up
18:13:33FromGitter<alehander42> @shashlick i am flabbergasted, but nice choice :D
18:13:41FromGitter<alehander42> (still, the name)
18:13:42FromDiscord_<potatonomicon> atom was nice but it's nicer having a text editor that doesn't take a minute to open ._.
18:13:54shashlicki guess back when I picked the name, I didn't know what it meant
18:17:58narimiranshashlick: vim plugin for vscode is quite alright (not perfect, but usable)
18:18:12FromGitter<zacharycarter> I think I'm going to switch to Emacs
18:18:26FromGitter<zacharycarter> for portability
18:19:22shashlickugh, 500MB RAM for no files open
18:19:30FromGitter<zacharycarter> potatonomicon - is an amazing handle
18:19:45FromGitter<zacharycarter> also - I was thinking about starting a website called rottengitatoes
18:20:02FromGitter<zacharycarter> which just aggregates github repo info and assigns a freshness rating to repos
18:20:09FromGitter<zacharycarter> based on who knows what criteria
18:20:39FromDiscord_<potatonomicon> thanks
18:20:50shashlickI'm very very tempted to make a scintilla based editor
18:21:05shashlicknimscintilla is already done so
18:23:51FromGitter<zacharycarter> there's also kak
18:23:55FromGitter<zacharycarter> which like 1% of the nim community uses
18:23:57FromDiscord_<potatonomicon> so does nim have any way to construct an object with positional arguments rather than named ones? kind of like how in c++ you can do; object{ 1, 2, 3 };
18:24:23FromGitter<zacharycarter> I tried it - but again, portability and not having to worry about what OS I'm using is more important to me than worrying about an editor already being installed or not
18:24:40narimiran@potatonomicon you can use tuples for that
18:24:46FromGitter<zacharycarter> potatonomicon: not with objects
18:24:49FromGitter<zacharycarter> yeah
18:25:00FromGitter<zacharycarter> I've inquired about that before - but I think it's quite complex to actually implement
18:25:10FromDiscord_<potatonomicon> I see
18:26:03FromGitter<zacharycarter> I've also seen before - where arguments are matched based on their key
18:26:19FromGitter<zacharycarter> so you don't need to adhere to parameter order - you just supply variables with the same name as the parameters
18:26:23FromGitter<zacharycarter> and the mapping will be handled for you
18:26:31FromGitter<zacharycarter> but I don't think either of those are currently supported
18:26:38FromGitter<zacharycarter> you currently have to be explicit
18:27:18FromGitter<zacharycarter> btw - can anyone hook me up with a link to the Nim discord channel? I would very much like to ditch gitter
18:27:31FromGitter<zacharycarter> and I really like discord
18:27:44shashlickhttps://discord.gg/ezDFDw2
18:27:48FromDiscord_<potatonomicon> https://discord.gg/ezDFDw2
18:27:52FromDiscord_<potatonomicon> whoops
18:27:53FromGitter<zacharycarter> thank you guys
18:27:58shashlickits on the http://nim-lang.org website
18:28:39FromDiscord_<potatonomicon> the discord doesn't seem all that active outside of this bridge
18:28:43FromGitter<zacharycarter> really? I thought I had looked for it the other day
18:28:53shashlickright at the bottom
18:28:53FromDiscord_<potatonomicon> It's at the very bottom
18:29:17FromDiscord_<Zachary Carter> wewt
18:29:25FromGitter<timotheecour> @araq i don’t understand colB behavior in nimfind; it’s shown in some cases but not others; is that expected?
18:29:49FromGitter<alehander42> @zacharycarter that's JS based on var names I think
18:29:51FromGitter<alehander42> {a, b}
18:29:57FromDiscord_<Zachary Carter> yes exactly
18:30:06FromDiscord_<Zachary Carter> couldn't remember what language
18:30:12FromDiscord_<Zachary Carter> thanks alehander42
18:33:39Araqhuh? it's never shown
18:34:32FromGitter<timotheecour> ah i was under impression it was from this example: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ maybe that’s another bug? [https://gitter.im/nim-lang/Nim?at=5bedbc38bb88787474d45146]
18:35:24FromGitter<timotheecour> $nimc_D/bin/nimfind $timn_D/bugs/nimfind/t01.nim:9:5 ⏎ shows: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bedbc6c7a36913a9a49c038]
18:35:35Araqthere are no bugs, only missing onUse() calls :P
18:36:15FromGitter<timotheecour> it looked like: ⏎ Def ⏎ (Col ⏎ colB)+ [https://gitter.im/nim-lang/Nim?at=5bedbc9fbb88787474d4532b]
18:37:01Araqwell there is an off-by-one problems with the column as you noticed but that's a Nim compiler glitch, the tool does it correctly
18:38:13Araqmore importantly though... what do you think? better/worse than nimsuggest's approach?
18:39:11FromGitter<timotheecour> ah, i had noticed off by 1 error in my PR https://github.com/nim-lang/Nim/pull/8795 ; btw i worked around it but maybe I could revive that PR (just the refactoring part) and fix the off by 1 error there
18:39:30Araqdon't work around bugs
18:40:02FromGitter<timotheecour> that’s not what i meant; i worked around the fact that format is not sublime or iterm-friendly; not the off by 1 error
18:41:00FromGitter<timotheecour> what i meant: i could revive that PR to just fix the off by 1 error and reuse lineInfoToString everywhere
18:41:21FromGitter<timotheecour> (stripping out from that PR the customization for sublimetext)
18:42:29*floppydh quit (Quit: WeeChat 2.3)
18:42:37FromGitter<timotheecour> as for better or worse, well it depends; 1 big advantage of nimsuggest approach (especially after my PR https://github.com/nim-lang/Nim/pull/9721 that allows random files) is it doesn’t have to rebuild index after every file change
18:43:41Araqwell I don't rebuild after every file change either
18:43:50FromGitter<timotheecour> so nimfind is mostly useful for a static codebase; i could see it useful maybe in a documentation server (eg an alternative to static website on GitHub)
18:44:55*yonson joined #nim
18:45:34FromGitter<timotheecour> > *<Araq>* well I don't rebuild after every file change either ⏎ ⏎ well nimfind returns wrong results if files changed, unlike nimsuggest
18:47:11AraqI envisioned it to rebuild the index every minute or so
18:47:58Araqbut I only have "static" codebases I guess
18:48:13FromGitter<timotheecour> but it’s most useful for static code, and I can think of other use cases similar to clang-query, eg allowing to search for procs that have a signature constraint, eg: find me all routines of type iterator that have at least 3 params, including 1 of type string; having nimfind as a library (or with SQL helpers) would allow that
18:49:59FromGitter<timotheecour> “static” is 1 aspect; the other aspect is scope: you don’t known ahead of time which files you’re gonna be looking at ; is there any way a partial rebuild can be achieved (as in my semi-working previous approach https://github.com/nim-lang/Nim/pull/9715 ) for nimfind ?
18:51:46FromGitter<timotheecour> btw even with off-by-1 error I still don’t understand why it’d return both t01.nim:10:3 and t01.nim:10:7 in example above ? why 2 use instead of 1 use?
18:52:03FromGitter<timotheecour> (i mean 2 use per line instead of 1 use per line)
18:52:38Araqdunno, usage tracking is complex, have to track it before and after template/macro expansion
18:53:51yonsonI'm trying to create a template to generate procs (don't know if I need to use a macro for that) but I'm not quite getting it, is it feasible to use a template for my use case?
18:54:00yonsonheres a gist of what I'm trying https://gist.github.com/yonson2/ec9e0fa0b54fd61d4cdc0689a6ba5b90
18:54:12Araqabout your other question, nimfind finds the project.nim file and builds the index for that
18:55:03*miran joined #nim
18:55:26Araqyonson, since you also want to pass the parameters you can only do it with a macro
18:56:12*stefantalpalaru joined #nim
18:56:36FromGitter<timotheecour> finding the project.nim file corresponding to an input.nim file is the easy part (and could be handled by clients / wrappers around nimfind) but the hard part is: can this be made efficiently by avoiding full rebuild when a yet unknown file is being queried
18:57:15*narimiran quit (Ping timeout: 250 seconds)
18:59:23yonsonOk, thanks Araq I'll read a bit more on macros first then, I'll ask again If I can't solve it
18:59:39Araqwell that's "Only" the --incremental:on problem which we will solve anytime soon now (TM)
19:00:09Araqnimfind would benefit from that as much as any compiler-related tool
19:00:45Araqso I don't spend time thinking about it
19:02:05FromGitter<timotheecour> is `—incremental:on` at least somewhat useable?
19:02:10Araq" finding the project.nim file corresponding to an input.nim file is the easy part" most editor plugins struggle with this
19:02:49FromGitter<timotheecour> also, one possibility in the meantime would be using fsmonitor or similar to monitor for file changes and rebuild these (along with files having these as dependencies) when fsmonitor triggers
19:03:00FromGitter<arnetheduck> Araq, thoughts on https://github.com/nim-lang/Nim/issues/9684 btw? hit it when porting some python code from eth research the other day
19:04:19Araqwhat about it? it's a bug, albeit one that is personally offending, having fixed very similar bugs in the past
19:05:04FromGitter<arnetheduck> yeah, that's what I thought too, seems pretty... basic
19:06:14FromGitter<arnetheduck> just checking if I missed some semantic quirk of the language
19:06:36Araqwell we have strict left-to-right evaluation
19:06:41FromGitter<timotheecour> i really think we should (at least as option) allow a standard format for tools like nimsuggest,nimfind instead of letting each tool parse yet another custom format (however simple it may seem to parse) ; either json (or a typesafe version like protobuf which would allow finding errors at CT) ; these allow for seamless forward/backward compatibility changes
19:07:22Araqbut it doesn't apply here.
19:08:25Araqtimotheecour: can't take that serious, sorry, the tool assumes the worst editor integration possible and that means the editor lacks a JSON parser
19:09:08Araqit uses the format you wanted so much...
19:09:16FromGitter<timotheecour> hence “as option” ; json to custom format is trivial
19:09:42FromDiscord_<Zachary Carter> Curious about thoughts on - https://skatejs.netlify.com/
19:10:14FromGitter<timotheecour> it uses the format you wanted so much… ⏎ that’s not really what i meant, it could be also: ⏎ `{“type” : “def”, loc: “foo/bar.nim:32:2”}`
19:10:29FromDiscord_<Zachary Carter> and if something like that + karax would be desirable
19:10:49FromGitter<timotheecour> (ie doesn’t have to split loc into separate fields file,line,col)
19:11:53FromGitter<timotheecour> btw: you marked `nimfind seems to return the 1st definition that matches a given line` as solved but I’m still seeing that issue
19:13:40FromDiscord_<Zachary Carter> also - does anyone have a way to handle ES6 style imports with Nim yet?
19:15:00Araq<Zachary Carter> here is what you should do: Ignore everything from the JS world for the next decade.
19:15:07FromDiscord_<Zachary Carter> heh
19:15:39FromDiscord_<Zachary Carter> I don't disagree
19:15:46FromDiscord_<Zachary Carter> the web is a mess
19:16:13FromDiscord_<Zachary Carter> I'd really like to be able to use Nim at work - but I've been there and fought that battle in regards to FE web dev
19:16:13*stefanos82 quit (Quit: Quitting for now...)
19:16:32FromGitter<timotheecour> here’s the output for the example I have where I’d expect nimfind to report multiple definitions: https://github.com/nim-lang/Nim/issues/9712#issuecomment-439157161
19:16:47FromDiscord_<Zachary Carter> and I don't think they'd be willing to broach the topic of using Nim server side
19:16:53FromDiscord_<Zachary Carter> doh well
19:18:41Araqtimotheecour: I don't test these things, I changed the logic to teach you how to do it
19:19:00Araqobviously this thing should gain a test suite
19:19:37FromGitter<timotheecour> well you marked it as solved so i assumed… ok thx for clarifying
19:20:38FromGitter<timotheecour> but that’s a perfect example where standard format (eg json/protobuf, at least as option) would be beneficial, if we are to support returning multiple definitions+usages
19:21:32FromGitter<timotheecour> the current flat list ⏎ ⏎ ```Def ⏎ Use ⏎ Use``` ⏎ ⏎ just doesn’t work well with multiple definitions found [https://gitter.im/nim-lang/Nim?at=5bedc73bbb06d73a997ce878]
19:22:53Araqnimsuggest would have been better with json output but for 'nimfind' it's total overkill
19:25:03Araqbut whatever, so add a --json switch. Everything grows a never ending number of switches and features with your thinking
19:25:30FromGitter<timotheecour> i think it’s “famous last works”; especially if we want to support additional query features; in my ideal world you’d have protobuf input/output, and, for tools that don’t want to deal with protobuf, json input/output (note that protobuf<=>json is automatic so long you’re not using certain features ), and further, this can degrade to text input/output for tools that don’t wanna deal with json.
19:26:33AraqI don't want "additional query features", we already have nimsuggest for the one-fits-all solution
19:27:04Araqit's complex, frequently crashing, misused by editors
19:27:49Araqand IME hard to debug
19:28:51FromGitter<timotheecour> (meanwhile, https://github.com/nim-lang/Nim/pull/9723 is green)
19:31:11FromGitter<rayman22201> imo, "Nim compiler as a library" is the real winner here. The fact that Araq was able to make this alternate tool so quickly is pretty cool.... Want a compiler tool that does X,Y,Z and outputs fizzbuzz format 9000. You can easily build it. :-)
19:32:19FromDiscord_<potatonomicon> oh dang you got the fizzbuzz 9000?
19:33:54Araqrayman22201, it wasn't quick, took me the weekend
19:34:32FromGitter<rayman22201> I'm comparing this to what I saw when looking into gcc plugins and libclang tooling. GCC can just go die in a ball of fire, the api is so terrible. Libclang is much better but still such a complex beast that my brain explodes a little... Nim makes them both look like the dark ages.
19:34:59FromGitter<timotheecour> ya the callback approach in nimfind is definitely more elegant; I just wish we can get to parity so nimsuggest isnt’ needed (in terms of efficiency at least, eg when a file was changed or when we need to process a random file not yet known)
19:37:05Araqand it's not there yet, but hey, I'm allowed to have fun at the weekends
19:37:26FromGitter<rayman22201> lol. I like your idea of fun :-)
19:40:52Araqyeah, back to fixing destructors and incremental compilation, see you
19:41:15FromGitter<timotheecour> ya both would be great
19:47:23FromDiscord_<Zachary Carter> make nim great again
19:47:32FromDiscord_<Zachary Carter> not that it ever stopped being great
19:47:34*zachk joined #nim
19:48:13FromDiscord_<Zachary Carter> very excited though for destructors / copy and move semantics
19:48:14*zachk quit (Changing host)
19:48:14*zachk joined #nim
19:48:36FromDiscord_<potatonomicon> ._.
19:50:04FromDiscord_<Zachary Carter> haha I was very much joking around with the make nim great again thing
19:50:07FromDiscord_<Zachary Carter> if that's what you're concerned with
19:50:28FromDiscord_<potatonomicon> more move semantics
19:50:30FromDiscord_<Zachary Carter> ah
19:50:30FromDiscord_<Zachary Carter> okay
19:50:43FromDiscord_<Zachary Carter> well - I don't know what they'll end up looking like
19:50:55FromDiscord_<Zachary Carter> how everything will fit together
19:50:57FromDiscord_<potatonomicon> if it's done under the hood thats fine, but that shit gets old real quick in c++
19:51:20FromDiscord_<Zachary Carter> yeah - I don't know - it seems to be a difficult thing to do simply
19:51:24FromDiscord_<Zachary Carter> or elegantly
19:51:27FromDiscord_<Zachary Carter> is the better term I guess
19:51:41FromDiscord_<Zachary Carter> but having RAII at our disposal will be nice
19:52:16FromDiscord_<potatonomicon> c++s problem is it's half implemented in stl, or at least to actually do it properly you have to have std::move calls all over the place
19:53:36*stefantalpalaru quit (Quit: Leaving)
20:01:33*nsf joined #nim
20:06:10*ChristianWitts joined #nim
20:09:16*ChristianWitts quit (Client Quit)
20:11:49FromGitter<rayman22201> @potatonomicon this is a good overview of Nim destructor semantics: https://github.com/nim-lang/Nim/wiki/Destructors
20:14:05FromGitter<rayman22201> It's arguably closer to Rust semantics than C++, hopefully better than either Rust or C++, but we will see :-P
20:14:11*stefanos82 joined #nim
20:15:23*ChristianWitts joined #nim
20:19:32*Trustable quit (Remote host closed the connection)
20:19:34*Jesin quit (Quit: Leaving)
20:19:50*ChristianWitts quit (Client Quit)
20:22:28*darithorn joined #nim
20:26:10FromGitter<iffy> Is there a list somewhere of valid --cpu: arguments?
20:27:37FromDiscord_<Zachary Carter> @iffy: https://github.com/nim-lang/Nim/blob/559a7615ad8e2e169aa9684f034c156881d88d4d/lib/system/platforms.nim#L14
20:27:53FromDiscord_<Zachary Carter> https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim#L14 - is a link to devel
20:27:56*Zevv2 joined #nim
20:28:51FromGitter<iffy> @yglukhov by standalone toolchain, are you talking about the thing you get from doing `build/tools/make_standalone_toolchain.py` in the android NDK?
20:29:10FromGitter<iffy> @zacharycarter thank you!
20:29:12*V-X joined #nim
20:29:19FromGitter<zacharycarter> np
20:29:22FromGitter<yglukhov> @iffy yes
20:30:37FromGitter<iffy> okay, so I use `ndk-build` to make the .so, then use gradle to package it all up. I was just stumbling over making the .so with Nim directly, so let me look at that
20:34:33*yonson quit (Ping timeout: 252 seconds)
20:41:47*Jesin joined #nim
20:42:36*kapil____ quit (Quit: Connection closed for inactivity)
20:45:51FromDiscord_<potatonomicon> if I import C.nim into B.nim and then B.nim into A.nim will C.nims symbols be accessable in A.nim?
20:46:06FromGitter<kayabaNerve> I have spent ten minutes on this.
20:46:12FromGitter<kayabaNerve> I am highly annoyed at this point.
20:46:22FromGitter<kayabaNerve> I am trying to compare two variables using `>`.
20:46:46FromGitter<kayabaNerve> One is an uint. One is an int. ⏎ `merit.blockchain.blocks.len < newBlock.header.nonce` ⏎ It fails due to the type difference.
20:47:33FromGitter<kayabaNerve> I cast the int to uint via `uint(var)`. I get `Error: type mismatch: got <uint> but expected one of: proc predT: Ordinal (x: T; y = 1): T`
20:47:39FromGitter<kayabaNerve> I cast the int to an uint. Same issue.
20:47:48FromGitter<kayabaNerve> I tried cast[int] and cast[uint].
20:47:52FromGitter<kayabaNerve> I tried casting them both.
20:47:56FromGitter<kayabaNerve> What is the issue here?
20:47:58FromGitter<zetashift> @potatonomicon I don't think so
20:48:53FromGitter<kayabaNerve> And it's a typo in the variable name. I feel like an idiot. NVM. Wasted 15 minutes lol
20:54:47*Jesin quit (Quit: Leaving)
20:55:13*Jesin joined #nim
21:20:34FromDiscord_<exelotl> is it safe to make a module that generates IDs at compile time like this? https://gist.github.com/geckojsc/7e389f8c4b351bc95c7a098543a71ccc
21:23:08FromGitter<mratsim> I don’t have any issue with that
21:23:29FromDiscord_<exelotl> and then assume that every dependent module which uses getUid() during compilation is guaranteed to a) get a different UID b) the gotten UID will be consistent across all the places that the dependent module was used
21:23:44FromGitter<mratsim> I use a compile-time C variable suffix generator here: https://github.com/numforge/laser/blob/master/laser/openmp.nim#L13-L25
21:24:10miran@potatonomicon if you want C to be available in A, you can `export C` in your B
21:24:40FromDiscord_<potatonomicon> I don't :P
21:25:16FromGitter<mratsim> @kayabaNerve don’t use cast, just use int(foo) or uint(foo)
21:25:33FromGitter<mratsim> unless you really need to reinterpret the bitpattern
21:25:33miranthen you get what you want by default :)
21:26:20FromDiscord_<exelotl> mratsim: isn't it technically possible to get a duplicate suffix by that approach?
21:27:11FromGitter<mratsim> the period is 2^128 − 1
21:27:23FromGitter<mratsim> of xoroshiro128+ rng that is used by Nim std lib
21:27:30FromGitter<mratsim> no collision on int64
21:28:07FromGitter<mratsim> see here: http://xoshiro.di.unimi.it/
21:30:56FromDiscord_<exelotl> but even the highest quality RNG with the longest period could happen to give the same number twice by random chance, right?
21:32:25FromDiscord_<potatonomicon> yes
21:35:20*nsf quit (Quit: WeeChat 2.3)
21:40:44FromGitter<kayabaNerve> @mratsim I use () for primitives and cast for objects.
21:41:43FromGitter<mratsim> @exelotl yes, but you should embrace randomness
21:42:06FromGitter<mratsim> for example on blockchain you have 2^-256 chance to have tycoon as someone else
21:42:23FromGitter<mratsim> but really if you worried about 2^-128 chance you should immediately move into a bunker
21:42:29FromGitter<mratsim> you’re*
21:54:24*Zevv2 quit (Quit: Lost terminal)
22:06:42*stefanos82 quit (Quit: Quitting for now...)
22:10:42*miran quit (Remote host closed the connection)
22:28:41*mech422_ quit (Remote host closed the connection)
22:29:04*mech422_ joined #nim
22:51:09*vlad1777d joined #nim
22:52:31FromDiscord_<potatonomicon> anyone ever had any problems with nims opengl bindings having an undefined reference for nimLoadProcs0
22:55:48FromGitter<zacharycarter> yes
22:56:11*theelous3 joined #nim
22:56:13FromGitter<zacharycarter> https://github.com/nim-lang/opengl#extension-loading
22:56:21FromGitter<zacharycarter> potatonomicon ^
22:56:34FromDiscord_<potatonomicon> I am calling that yes
22:56:37FromGitter<zacharycarter> hrm
22:57:02FromDiscord_<potatonomicon> seems related to sdl2_nim
22:57:32FromDiscord_<potatonomicon> nim-lang/sdl2 works fine with loadExtensions()
22:58:15FromGitter<zacharycarter> I've only ever used the Nimlang sdl2 bindings
22:58:20FromGitter<zacharycarter> the offical ones
22:59:33FromDiscord_<potatonomicon> yeah, the sdl2_nim ones just looked a little more nimified, but I guess I'll use the official ones instead
22:59:41FromDiscord_<Zachary Carter> they definitely are
22:59:50FromDiscord_<Zachary Carter> I just don't know how up-to-date they are
23:00:00FromDiscord_<Zachary Carter> might want to talk to @krux02 - he probably does the most OpenGL dev out of anyone
23:00:19FromDiscord_<Zachary Carter> I'm a fan of BGFX - and when I get back to gfx programming with Nim, plan to use that library
23:14:56*thomasross joined #nim
23:26:29*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
23:35:23*theelous3 quit (Ping timeout: 268 seconds)
23:37:12FromGitter<zacharycarter> Getting some love on twitter - https://twitter.com/bketelsen/status/1063212074749317120
23:48:06FromDiscord_<Zachary Carter> he's using the library I wrote - litz - to author them
23:48:32FromDiscord_<Zachary Carter> I don't know whether an approach like karax / react takes vs what web components proposes is what to focus around
23:48:54FromDiscord_<Zachary Carter> they're not 1:1 - web components, for instance, doesn't handle state management
23:49:33FromDiscord_<Zachary Carter> react does for components, but not for your application - people use redux or mobx or other libraries in that vein for that purpose
23:50:24FromDiscord_<Zachary Carter> react basically nests your app inside of a div, whereas web components allow you to define your own custom HTML elements
23:51:01FromDiscord_<Zachary Carter> litz isn't near completion - but I haven't found a lot of reason to continue its development either - if the Nim web dev community is fine with karax - I'm fine with letting karax be the goto
23:51:21FromDiscord_<Zachary Carter> but this is also the reason I shared skatejs earlier - because you could probably still use karax to define custom elements via the web component spec
23:51:26FromDiscord_<Zachary Carter> I just don't know if anyone cares that much
23:51:29*Aareon_ quit (Ping timeout: 250 seconds)
23:51:31xacejesus just looked at karax/example/button.nim, the generated .js is--- is cthulhu real?
23:51:34FromDiscord_<Zachary Carter> the web / JS world is indeed a bit out of control
23:51:45FromDiscord_<Zachary Carter> well this is what sourcemaps are for
23:52:04FromDiscord_<Zachary Carter> oh wait
23:52:08FromDiscord_<Zachary Carter> JS generated by the Nim compiler
23:52:10shashlickI have a while loop in a macro with idx += 1 and idx = 0 initialized at the top as a global
23:52:17shashlicksomehow every loop, idx = 0 again
23:52:20FromDiscord_<Zachary Carter> yes - it's not pretty - but I'm sure there's still a way to get JS to nim line numbers
23:52:21shashlicknever increments
23:53:25*Aareon_ joined #nim
23:55:11FromGitter<rayman22201> @slashlick Nim macros are hygenic. You need to explicitly bind the value. https://nim-lang.org/docs/manual.html#generics-bind-statement
23:56:56*smt quit (Read error: Connection reset by peer)
23:57:45shashlickrayman22201: interesting - tried it out but it says invalid expression
23:57:55shashlicki did `bind idx` at the top of the macro
23:57:56*smt joined #nim
23:57:59FromDiscord_<Zachary Carter> gensym
23:58:01FromDiscord_<Zachary Carter> first
23:58:08FromDiscord_<Zachary Carter> I think?
23:58:22FromGitter<rayman22201> sorry, that's the wrong syntax for macros. I think it's: https://nim-lang.org/docs/macros.html#bindSym%2C%2CBindSymRule
23:58:46*Jesin quit (Quit: Leaving)
23:58:59xacewell maybe its unfair of me to just look at that, i mean, looking at the code that generated it, it might be convenient
23:59:40FromDiscord_<Zachary Carter> xace: I think as long as there's a way to debug from the Nim source code - it doesn't matter