<< 14-06-2018 >>

00:00:15*Jesin quit (Ping timeout: 256 seconds)
00:32:22*dddddd quit (Remote host closed the connection)
01:10:31*leorize joined #nim
01:11:42*rockcavera quit (Ping timeout: 265 seconds)
01:29:31*CodeVance joined #nim
01:30:16*CodeVance quit (Client Quit)
01:38:36*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:53:32*donlzx joined #nim
01:55:04*Jesin joined #nim
02:04:49*yglukhov[i] joined #nim
02:09:05*yglukhov[i] quit (Ping timeout: 240 seconds)
02:12:21*rockcavera joined #nim
02:19:25*rockcavera quit (Remote host closed the connection)
02:27:24*rockcavera joined #nim
02:28:00*rockcavera quit (Remote host closed the connection)
02:28:39*endragor joined #nim
02:33:18*endragor quit (Ping timeout: 268 seconds)
02:46:55*leorize quit (Ping timeout: 265 seconds)
03:03:49*NimBot joined #nim
03:22:00*DarkArctic_ quit (Ping timeout: 260 seconds)
03:25:05*rockcavera joined #nim
03:38:44*skrylar quit (Remote host closed the connection)
04:02:12*thomasross_ joined #nim
04:04:27*thomasross quit (Ping timeout: 240 seconds)
04:25:41*thomasross_ is now known as thomasross
04:40:20*endragor joined #nim
04:44:04*xkapastel quit (Quit: Connection closed for inactivity)
05:04:58*rockcavera quit (Read error: Connection reset by peer)
05:09:20*miran joined #nim
05:20:02*gangstacat quit (Quit: Ĝis!)
05:32:58*nsf joined #nim
06:00:29*Vladar joined #nim
06:35:09*miran quit (Ping timeout: 264 seconds)
06:43:11*yglukhov[i] joined #nim
06:45:00*rockcavera joined #nim
06:45:22*yglukhov[i] quit (Remote host closed the connection)
06:45:36*yglukhov[i] joined #nim
06:46:14*xkapastel joined #nim
07:07:14*yglukhov[i] quit ()
07:09:25*yglukhov[i] joined #nim
07:14:25*PMunch joined #nim
07:16:47*gangstacat joined #nim
07:21:51*mostly-h1rmless quit (Ping timeout: 240 seconds)
07:29:04*Tanger joined #nim
07:30:41TangerHey folks, when you test defined types that have private attributes, do you put the tests in the same source file or do you always define getter/setter procs?
07:31:53AraqI usually don't test private attributes at all, fwiw
07:33:43TangerMakes sense :) Thanks Araq
07:37:23PMunchTanger, if you want to test them and not put your tests in the same file you can "include" the file instead of "import"-ing it. By including it the code is simply copy-pasted into your code, so all the private fields will be visible
07:37:56*dddddd joined #nim
07:39:51TangerOoh, good point PMunch! Thanks for that
07:39:59*mostly-harmless joined #nim
07:48:17*Electrux joined #nim
07:49:21FromGitter<Varriount> @ski
07:54:28*floppydh joined #nim
07:57:10*zahary joined #nim
08:03:21*gmpreussner_ quit (Ping timeout: 240 seconds)
08:04:18*gmpreuss- joined #nim
08:06:25*zahary quit (Quit: Leaving.)
08:20:02*rockcavera is now known as Guest24198
08:20:02*tiorock joined #nim
08:20:02*Guest24198 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
08:20:02*tiorock is now known as rockcavera
08:33:15*Electrux quit (Quit: WeeChat 2.1)
08:33:37*Electrux joined #nim
08:53:30*xkapastel quit (Quit: Connection closed for inactivity)
08:55:04*rokups joined #nim
09:45:13*noonien joined #nim
09:53:17*elrood joined #nim
09:54:38*elrood quit (Remote host closed the connection)
09:55:02*elrood joined #nim
10:09:43*user1101 joined #nim
10:15:21user1101I discovered a very interesting approach to use impure GUI libraries. You communicate with the library with JSON, lets you write idiomatic code https://github.com/KDE/rust-qt-binding-generator . I just felt like sharing
10:17:10FromGitter<narimiran> @mratsim you said yesterday that you expect rust-crowd on HN post about nim tutorial, but it seems this time we got D-brigade.... :)
10:17:12Yardanicothere's nim-qml btw
10:17:27FromGitter<mratsim> :p
10:20:27user1101Yardanico: I think the binding generator is somewhat feature complete (I might be wrong though). The DOtherSide bindings, afaik, misses a whole bunch of Qt GUI modules :) Well I'd love to see it get finished, because that'd help not only Nim but also D :P
10:27:51PMunchnarimiran, yeah there were some D proponents there. I'm curious about D, might check it out
10:28:16Araqheresy!
10:29:16PMunchHaha :P
10:30:08PMunchuser1101, I've thought about a similar approach in Nim. Basically declare an interface that GUIs can then use to interact with your program.
10:33:37FromGitter<narimiran> @PMunch: i had a quick look at both D and Rust, but i'm too big fan of the significant whitespace to switch :)
10:34:24PMunchI'm impartial to significant whitespace, but I will admit that code looks "cleaner" with it :P
10:35:44PMunchuser1101, my biggest problem was that I wanted to do it transparently. So you could implement your entire program without really thinking about the GUI. The problem then was capturing when variables changed, which I haven't found a non-intrusive way to do in Nim.
10:36:29user1101I have tried D before, even though the language is pretty nice something about D feels pretty bland idk... I'm glad that it caught your attention, PMunch. I hope your genui comes useful
10:36:51user1101I see
10:38:45user1101Well I guess there will be some trade offs everywhere. Why I am really interested in that particular bindings generator, is that people can just write C++ or QML for the GUI portion, with all the available documentations out there to help and write the logic in Nim
10:39:34Araqwhat "logic" whould that be? "When button A is clicked, copy the text to the clipboard"
10:39:51AraqUI programming is full of UI specific stuff
10:40:27Araqand "write the frontend in X, the backend in Nim" only works when you have a meaningful backend
10:40:28user1101For example, when a button is clicked, rename file with this specific name pattern to that pattern
10:41:10user1101In QML, it's a good practice to do heavy logic in C++
10:41:33Araqwhether you have "heavy logic" is application dependent.
10:41:54Araqand more often than not, you don't. IME anyway.
10:45:04FromGitter<alehander42> well I guess the "change the model and let the UI take care of rendering/recalculating it again" is kinda that
10:45:05PMunchYeah, some code in a GUI program is bound to be GUI specific
10:45:22FromGitter<alehander42> but that's what libs like karax do
10:45:48PMunchBut many programs (at least on Linux) has both a terminal command with switches, and a GUI
10:46:18PMunchSo while there definitely is code in the GUI to do certain things, lot's of the code doesn't care about the GUI at all
10:46:58FromGitter<alehander42> well technically you can abstract a lot of it to more generic [input]-s and [output]-s but practically it's not clear if it always makes sense
10:49:03*arecaceae quit (Remote host closed the connection)
10:49:29*arecaceae joined #nim
10:49:35AraqI've never seen it working. UI code is event based, that means callbacks. callbacks are the enemies of any serialization mechanism
10:50:08user1101I guess you have a point. But not all desktop GUI applications are that trivial. Many of the operations are trivial, some of them are not. I would not write a program that finds the shortest path/match long substring/add a table of million numbers using JS code. And there are good reasons why I want to move out of C++ (and of course C).
10:50:17user1101Any way nice talk.
10:50:19*user1101 quit (Quit: user1101)
10:50:45PMunchWhat do you mean Araq?
10:53:30AraqI mean we need Nim libraries for UIs, not text-based protcols for UI development
10:54:34Araqyeah, you can use GTK Builder to produce an XML that describes the UI layout and that's loaded by the Nim program. but it's far worse than what Delphi offered in the 90ies.
10:55:18Araqas the XML fails at these details called onX event handlers...
10:56:40PMunchOh yeah, I'm not saying write a text protocol
10:56:51FromGitter<kaushalmodi> @dom96 Not sure if you get HN reply notifications, but someone has asked you if Nim In Action works with 0.18.0. I think it does mostly, except for stuff like "<N" deprecation in slices, and few others. But I'm not sure as I haven't finished that book yet :)
10:58:22PMunchI'm saying write a Nim library that exposes a common interface for GUI implementations. Then GUI implementations can write a wrapper against this interface and "just work"
11:02:38elroodPMunch, you'll only generate yet another instance of everyone's favourite n+1-standards problem that way
11:04:03PMunchWhat are the current n standards for this?
11:04:14FromGitter<mratsim> yeah, genericity/abstraction is a Java-ism nowadays
11:05:37FromGitter<mratsim> even abstracting Windows/Mac/Linux API seems like creating another GTK/QT but I’m really unfamiliar with that field
11:06:01FromGitter<kaushalmodi> @narimiran In Nim Basics, in the Loops exercise about inches/cm table, did you intend the user to print that exact table with aligned "|" chars and all? If so, I find the code to do that a bit cludgy if strformat's fmt is not introduced to the user.. Can that be added to that tutorial? It would also pull in Python fans :)
11:07:06*Electrux quit (Ping timeout: 256 seconds)
11:07:22FromGitter<mratsim> is strformat in master 0.18?
11:07:29FromGitter<kaushalmodi> Yes
11:08:57FromGitter<mratsim> so it’s the sugar module that is not in 0.18
11:10:12*Electrux joined #nim
11:10:16FromGitter<kaushalmodi> Wait, it's not in 0.18? I was pretty sure it was..
11:11:17FromGitter<kaushalmodi> Confirming that it actually was a part of 0.18.0: https://nim-lang.org/blog/2018/03/01/version-0180-released.html
11:12:03FromGitter<narimiran> @kaushalmodi good observation! i can't remember how i created that table :) but it is given just as a guide ("the table might look like this")
11:12:38FromGitter<narimiran> IIRC, sugar is in 0.18.1
11:12:53FromGitter<mratsim> you know how politics works. “We might” is either syntactic sugar for we will, or we will not, neither in beteen ;)
11:13:06FromGitter<narimiran> :)
11:13:20FromGitter<mratsim> 1) 18.1 is devel
11:13:23*Vladar quit (Quit: Leaving)
11:13:56FromGitter<kaushalmodi> @narimiran Maybe show that "looks like this" in bare bones form.. without vertical bars and aligned columns?
11:14:47FromGitter<kaushalmodi> Because given how it is, I used stuff like `fmt"{valInch:<4}| {valCm}"` :P
11:15:49FromGitter<kaushalmodi> The release notes link is for 0.18.0 and I searched for strformat in there.. it's there.
11:27:56*Yardanico quit (Read error: Connection reset by peer)
11:39:30*Yardanico joined #nim
11:40:56*fvs_afk is now known as fvs
11:48:42*elrood quit (Remote host closed the connection)
11:51:58*donlzx quit (Quit: Leaving)
11:57:23AraqPMunch, yes, I like your genui ideas :-)
11:58:47Araqand I wouldn't mind "another QT" written in Nim
12:08:28*DarkArctic joined #nim
12:08:52FromGitter<alehander42> how does one print the current traceback on exception?
12:09:45FromGitter<alehander42> writeStackTrace
12:10:06FromGitter<alehander42> ok is it supported for js backend o.O
12:18:20AraqI remember tinkering with getStackTrace in JS land
12:19:44FromGitter<alehander42> yeah I tried console.trace(e.stack)
12:19:56FromGitter<alehander42> but I saw nim exceptions are actually not js exceptions :D
12:33:44*xet7 joined #nim
12:43:07*xet7 quit (Remote host closed the connection)
13:00:15*nsf quit (Quit: WeeChat 2.1)
13:04:14*cryptocat1094 joined #nim
13:14:19FromGitter<7sDream> We can't bound `spawn someProc()` to a variable when `someProc` returns `void`?
13:14:40FromGitter<7sDream> Example: https://glot.io/snippets/f1z8lg78oj
13:15:59FromGitter<7sDream> It shows `Error: expression 'spawn echoId(),' has no type (or is ambiguous)`
13:18:00FromGitter<Vindaar> If it returns `void` there's nothing to assign to the variable `thread`
13:18:46FromGitter<Vindaar> Instead of your `await thread` you can just write `sync()`
13:18:51FromGitter<7sDream> So what show I do if I have a lots of `void` threads and I only wan't `await` one of them
13:19:05FromGitter<7sDream> s/show/should
13:20:17FromGitter<7sDream> Use `createThread` and `joinThread` in `threads` module?
13:20:23*find0x90 joined #nim
13:21:30*find0x90 quit (Client Quit)
13:22:49FromGitter<Vindaar> I guess that's your option, yeah. Not sure myself. But the description of `sync` states that one should use explicit barriers for more complicated wait cases https://nim-lang.org/docs/threadpool.html#sync
13:25:39FromGitter<7sDream> but I don't like APIs in threads module, I like spawn :)... and if I have both `void` thread and `int`-return thread, I need to use threadpool *and* threads API, it's a bit confusing
13:27:00FromGitter<7sDream> emmm, I see the `explicit barriers`, but what is it?
13:36:54FromGitter<Vindaar> The `Barrier` object is defined in `threadpool.nim` (https://github.com/nim-lang/Nim/blob/master/lib/pure/concurrency/threadpool.nim#L49). But it's not even exported, so I'm not sure what that comment is trying to tell us :)
13:37:27FromGitter<7sDream> So, may be I should open an issue for this...
13:37:51FromGitter<Vindaar> I mean you can always have your `void` threads return a an `int` as a status basically and then await that. Not sure if that would work in your case
13:38:07FromGitter<7sDream> #8040
13:39:18FromGitter<7sDream> return an int is OK (as a workaround)
13:46:09*DarkArctic quit (Quit: Leaving)
13:46:35*DarkArctic joined #nim
13:48:42*yglukhov[i] quit (Remote host closed the connection)
13:49:04*yglukhov[i] joined #nim
13:50:18*yglukhov[i] quit (Remote host closed the connection)
13:54:59*yglukhov[i] joined #nim
13:55:12*yglukhov[i] quit (Read error: Connection reset by peer)
14:10:13YardanicoI still don't understand why a lot of people who are new to Nim use methods instead of procs (even in places where they don't need them): https://github.com/Yardanico/discordnim/commit/dae95b7a2b49a487bc530a1f9cc690415ee1fa13
14:12:51Araqit just takes another decade to debunk this OO cult.
14:17:55Yardanicoby the way, is there any support for default values in json.to macro?
14:18:03*nathanj joined #nim
14:18:31YardanicoI just want to refactor this file "a bit" - https://github.com/Yardanico/discordnim/blob/master/src/discordobjects.nim
14:20:34*endragor quit (Remote host closed the connection)
14:21:44Calinou<Araq> and I wouldn't mind "another QT" written in Nim
14:21:53Calinouit took a few million $ (if not more) to bring Qt where it is today :P
14:22:30AraqNim is cheaper to develop in as you don't have to write #include guards
14:22:33*endragor joined #nim
14:22:37Araq:P
14:23:22Yardanicooh, json.to supports options, but that's not really the thing I want..
14:24:41cryptocat1094I notice that async/await is mentioned in the manual but nowhere is it explained or even demonstrated.
14:24:54Yardanicowhy it's not?
14:25:01Yardanicolook in asyncdispatch module docs
14:25:22cryptocat1094Yardanico: Ah, thanks.
14:25:31Araqthe manual is about the language.
14:25:42*nathanj left #nim ("WeeChat 2.1")
14:25:46AraqNim suffers a bit from the fact that so many things are pure library features :P
14:25:57Araqand so not of the manual's concern.
14:26:53Yardanicooh wait, actually.. maybe we can add default values to json.to using custom pragmas?
14:27:21Araqyeah but the 'to' macro ignores custom pragmas
14:27:22*endragor quit (Ping timeout: 264 seconds)
14:27:27Araq"Note on paths
14:27:27Araq-----------
14:27:28AraqIn module related statements, if any part of the module name /
14:27:28Araqpath begins with a number, you may have to quote it in double quotes.
14:27:28AraqIn the following example, it would be seen as a literal number '3.0' of type
14:27:29Araq'float64' if not quoted, if uncertain - quote it"
14:27:48Araq^ I hate these things.
14:27:51pqflx3[m]Can nimscript's 'exec' modify current PATH? e.g. exec "vcvarsall.bat"
14:28:15Araqso some user used '3d' as a directory name once and was "confused"
14:28:25Araqand now the manual contains this random rambling.
14:28:43Araqyes, identifiers need to adhere to Nim's rules about identifiers, jezz...
14:28:47YardanicoAraq, why does it ignore them?
14:33:06Araqer ... becaues they are "custom" ?
14:33:40Yardanicowell, I mean - is it possible to add support for them to json.to macro? it's possible, right?
14:33:52Araqsure you can add it
14:34:02Araqbut we're getting foo: T = value in objects
14:34:02dom96Yardanico: What do you need in the `to` macro?
14:34:48YardanicoAraq, is it something that will be available in 1 month, or no? just roughly
14:34:50Yardanicodom96, default values :)
14:34:51*endragor joined #nim
14:35:02YardanicoI don't really *need* them, but they're would be nice to have
14:35:22Araqeverything is always a day away.
14:36:13dom96Yardanico: I would just use option + get with a default value
14:36:47dom96you can even create a nice accessor procedure that does this for you on your type
14:39:21*endragor quit (Ping timeout: 265 seconds)
14:44:13*elrood joined #nim
14:52:37FromGitter<alehander42> wow default values
14:59:12*xet7 joined #nim
15:04:31FromGitter<7sDream> I just read the lock level (https://nim-lang.org/docs/manual.html#guards-and-locks-lock-levels) section in *Nim Manual*, but the `TLock` is deprecated and the `Lock` object don't accept an level param... ⏎ Has this feature been deleted?
15:04:58FromGitter<data-man> @Araq: #7944 is ready for merge, I hope.
15:13:49*miran joined #nim
15:20:35Araq7sDream no but the stdlib doesn't make use of this feature
15:20:42Araq:-)
15:22:07FromGitter<7sDream> Oh, I see
15:33:13FromGitter<7sDream> Araq, So, how can I wrap stdlib's Lock Object to an level lock? Just add an generic arguments `static[int]` and make some template like `withLock`?
15:34:27AraqI think so, yes.
15:35:12FromGitter<7sDream> OK, I will try
15:36:52*yglukhov[i] joined #nim
15:39:03FromGitter<mratsim> I don’t think the “It took few millions to do X” is that relevant in software development. @Calinou
15:39:30FromGitter<mratsim> Proof: Arraymancer vs Numpy/Tensorflow/Torch/PyTorch/Scikit Learn
15:39:55FromGitter<mratsim> a single dev is usually consistent with himself and can go pretty far when politics and bureaucracy don’t interfere
15:40:46Calinoutrue
15:40:56CalinouQt's history is pretty chaotic to be fair
15:41:06Calinouit started as proprietary software, was open sourced and was passed between several companies
15:41:49FromGitter<mratsim> Also, by coming later you usually benefits from the previous failures or success, and usually more efficient libraries.
15:42:52FromGitter<mratsim> You can see that in terms of products as well, there was a before AWS (Box which had to deploy all infrastructure) and after (Dropbox, which could just buy it).
15:43:14FromGitter<mratsim> With Nim it’s “before metaprogramming” and “after metaprogramming” I would say ;)
15:52:59*Vladar joined #nim
15:56:36*clyybber joined #nim
16:00:22*yglukhov[i] quit (Remote host closed the connection)
16:07:57*Elronnd\srn quit (Quit: leaving)
16:08:09*elronnd joined #nim
16:08:24*elronnd is now known as Elronnd\srn
16:09:52Vindaarmiran: just looked at your post on /r/programming again. Man that comment by that vorlontech. What's wrong with that guy? Well, it's "the internet™"...
16:19:46*clyybber quit (Ping timeout: 256 seconds)
16:20:30*Trustable joined #nim
16:24:16federico3Vindaar: it's reddit...
16:24:42VindaarI know and I shouldn't be surprised, but well..
16:27:33elroodhis point that people new to programming are probably better off using a more mature language with a bigger community isn't completely invalid, but his style of presenting that opinion is.. questionable at best
16:28:53FromGitter<kaushalmodi> Right.. if he had the authority to do what he said when C came out, no one would have learned C.. Lame.
16:28:57miranVindaar: ah, i learnt from my internet experience you shouldn't be bothered to much by haters/trolls. (it took me some time to realize that :D)
16:29:37miranelrood: agreed on both counts
16:30:08VindaarHehe, indeed. To be honest though, it's still not easy to /completely/ ignore it for me
16:31:48rokupsany idea if nim works with function hooking?
16:32:01Yardanicowhat do you mean by that?
16:32:15rokupshttp://jbremer.org/x86-api-hooking-demystified/#ah-method-5
16:32:35rokupswriting jmp instruction that jumps to function implemented in nim
16:33:01rokupsi wonder how gc would react if random thread nim is not aware of would call suck function
16:43:05*nsf joined #nim
16:58:36*pie_ joined #nim
17:09:32*pie_ quit (Remote host closed the connection)
17:14:13FromGitter<tim-st> @Araq I saw what you meant with native nimscript support (there is an example for cmpIgnoreStyle in `scriptconfig.nim`), what are the downsides if nimscript has more (native) procs, besides compile time of nim, how many would you allow for nimscript?
17:15:53FromGitter<tim-st> (if I understand correct I can implement the "hard" procs like network and time using native procs and then full pure interpretion would be supported, if iteration limit would be turnt off)
17:21:15FromGitter<b71729> Hi guys. I've been checking Nim out recently. It's truly a great language, so hats off to you all.
17:21:42FromGitter<7sDream> Any progress on #5617? No lineinfo makes my macro hard to tell user where is the problem...
17:22:14FromGitter<b71729> I was wondering one thing: I'm working in an async context, using `asynchttpserver` + `asyncdispatch`, and notice that if I use the `:Future[void]` return type, it seems to function the same as applying the `{.async.}` pragma. Is there any difference between the two?
17:22:55Yardaniconot really, with Future[void] you only return a future type which returns nothing on completion
17:23:03Yardanicobut you can't use await in not-async proc
17:23:10*Trustable quit (Remote host closed the connection)
17:23:47FromGitter<b71729> Ah, I'm with you. Good stuff.
17:24:00Yardanicowell, I didn't explain it fully, but you can probably read docs in asyncdispatch
17:25:06FromGitter<7sDream> Araq, I finish my first try with level lock, it works and tell me I'm using lock in wrong order: https://i.loli.net/2018/06/15/5b22a4958bd7f.png ⏎ But how can I change the line number in the error message? is this related to #5617?
17:25:40FromGitter<7sDream> I want this error tell me line 45 is invalid nested locking happened
17:26:56*Trustable joined #nim
17:29:20*endragor joined #nim
17:33:58*endragor quit (Ping timeout: 264 seconds)
17:34:03Yardanicoby the way, is it preferred to use strtabs or tables when operating over string, string tables?
17:34:30FromGitter<kaushalmodi> @Yardanico critbits? (I'm a big fan of those :))
17:35:24*DarkArctic quit (Read error: Connection reset by peer)
17:37:02*rockcavera quit (Remote host closed the connection)
17:38:27Yardanico@kaushalmodi why would you use them over strtabs/tables?
17:42:22FromGitter<tim-st> Yardanico: critbits allow range iteration and uses less memory (I think)
17:42:35FromGitter<tim-st> well, odered tables too
17:43:15dom96b71729: There is a big difference between `proc foo(): Future[void]` and `proc foo() {.async.}`
17:43:36dom96The latter gets transformed into a closure iterator and allows you to use `await`
17:43:50FromGitter<kaushalmodi> @Yardanico It mostly comes from my syntax preference. I see Critbits as tables + sets.
17:44:16FromGitter<kaushalmodi> From docs, looks like it's optimized for string-type "keys" (I have no way to prove that)
17:45:37FromGitter<kaushalmodi> about syntax, the only "special" syntax critbittrees need is when declaring it: `var foo: CritBitTree[string]`.
17:46:02FromGitter<kaushalmodi> After that all syntax for adding/removing/etc. is overloaded from familiar syntax
17:47:10FromGitter<kaushalmodi> *.. and I haven't used `strtabs`*
17:55:25*jjido joined #nim
18:05:25FromGitter<data-man> keys in CBT are always string
18:05:35FromGitter<data-man> values can be any type
18:05:43FromGitter<data-man> or void
18:06:00Yardanicowell, then we should have some faq/etc to explain where it's better to use tables/strtabs/critbits for string: string mapping
18:06:18FromGitter<tim-st> @data-man critbit doesnt work with nimscript, any idea?
18:06:26FromGitter<kaushalmodi> Yardanico: +1
18:06:40FromGitter<kaushalmodi> In any case, I had ended up doing a semi-thesis on critbits: https://scripter.co/notes/nim/#critbits
18:06:41Yardanico@tim-st probably because critbits use "addr"
18:07:07dom96Don't pre-maturely optimise. You can always switch to critbits if you require the speed boost.
18:07:20FromGitter<data-man> And in CBT keys are always sorted
18:07:51FromGitter<tim-st> yardanico: cant nimscript support addr, or is it just not implemented?
18:09:40FromGitter<data-man> CBT can be adapted for seq[byte]. It's a big plus.
18:10:54FromGitter<tim-st> cbt without ref types and with custom cmp proc support would be perfect
18:11:13Yardanicoit's impossible
18:11:34FromGitter<data-man> Yes, impossible.
18:11:34Yardanicobecause without "ref" types you can't recurse objects into themselves
18:12:22FromGitter<tim-st> recursive objects arent needed in generell, just the current implementation wouldnt support it
18:12:31Yardanicowhy they are not needed?
18:12:39Yardanicothey are required for a lot of different data structures
18:13:10FromGitter<tim-st> I'm pretty sure there is an alternative implementation (likely more complex)
18:13:28FromGitter<data-man> But reversed order can be added.
18:14:08FromGitter<tim-st> at least a const critbit tree can be precalculated and saved in an array
18:14:22FromGitter<tim-st> without refs
18:15:54FromGitter<data-man> Something like CBT.toSeq/CBT.fromSeq
18:16:38FromGitter<tim-st> yes
18:18:05*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:18:33FromGitter<kaushalmodi> @data-man Just a note.. if you do end up doing that, should it match the table procs?
18:18:39FromGitter<kaushalmodi> tables module has `toTable`
18:18:58FromGitter<kaushalmodi> so may be `toCritBitTree`?
18:20:18FromGitter<data-man> IDK, it has a low priority :)
18:24:03FromGitter<tim-st> an interface is needed^^
18:24:08FromGitter<kaushalmodi> well.. just in case you implement that :)
18:24:20FromGitter<tim-st> like List interface in java
18:26:46FromGitter<kaushalmodi> Should nimble give an option to first create a dir and generate the files in there?
18:27:13FromGitter<data-man> I dream about toOpenArray for any type. Then CBT could support openarrays.
18:27:25FromGitter<kaushalmodi> it has happened few times to me.. I do `nimble init foo` assuming that it will first create a dir `foo/` and then generate stuff in there.
18:27:44FromGitter<kaushalmodi> Right now, it expects user to do `mkdir foo && cd foo/ && nimble init foo`.
18:30:40dom96kaushalmodi: yeah, that sounds like a bug
18:30:47*nsf quit (Quit: WeeChat 2.1)
18:32:01FromGitter<kaushalmodi> @dom96 the --help says ⏎ ⏎ > Initializes a new Nimble project in the current directory.
18:32:43dom96still a bug
18:32:52FromGitter<kaushalmodi> But the same could also mean that it creates a new Nimble project dir in current dir
18:32:55FromGitter<kaushalmodi> yes :)
18:33:05FromGitter<kaushalmodi> it doesn't make sense to offload the mkdir and cd steps to the user
18:34:25FromGitter<kaushalmodi> My tcsh alias until then: ⏎ ⏎ ```alias niminit 'mkdir \!:1 && cd \!:1 && nimble init \!:1'``` [https://gitter.im/nim-lang/Nim?at=5b22b53086343c3a32052971]
18:41:55*jjido joined #nim
18:43:47*Electrux quit (Ping timeout: 276 seconds)
18:53:38*Electrux joined #nim
18:57:34*yglukhov[i] joined #nim
19:00:38*krux02 joined #nim
19:04:01Electruxis there a discord API for nim?
19:04:14*rokups quit (Quit: Connection closed for inactivity)
19:04:46FromGitter<kaushalmodi> If url is a string, this gives an error: `urlSplits = url.rsplit({'/'}, maxsplits = 1)` (after `import strutils`)
19:05:03FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b22bc5febf21755ca324546]
19:05:22FromGitter<kaushalmodi> The strange part is: ⏎ ⏎ ``` required type: set[char] ⏎ but expression '{'/'}' is of type: set[char]``` [https://gitter.im/nim-lang/Nim?at=5b22bc721ee2d149ecc2b66b]
19:05:25YardanicoElectrux, luckily for you - yes!
19:05:39Electruxfor real?! that's amazing!! :O
19:05:40dom96Electrux: https://nimble.directory/search?query=discord ;)
19:05:48Yardanicosearch for discordnim or use https://github.com/Yardanico/discordnim if you want to have it working for devel
19:06:29dom96Yardanico: PR! :)
19:06:59Electruxoh the original one is abandoned?
19:07:12YardanicoElectrux, well, it's not really (I think that if I will make a PR it will be accepted)
19:07:19Yardanicobut I made my own fork for now
19:07:23Electruxah
19:07:32Electruxfair enough... thanks a lot :D
19:07:42Yardanicodom96, maybe a bit later, when I figure out how can I remove/simplify stuff like this https://github.com/Yardanico/discordnim/blob/master/src/discordobjects.nim#L602
19:07:48Yardanicoit's REALLY ugly
19:07:50Electruxbeen a while since i have been active with nim... (internship thingy)
19:07:58FromGitter<kaushalmodi> continuing from that rsplit error.. loks like a bug in error reporting?
19:08:16dom96Yardanico: Use the `to` macro
19:08:34FromGitter<kaushalmodi> found my mistake was using `maxsplits` instead of `maxsplit`.. but why are the error messages talking about the `seps` parameter?
19:08:42dom964-space indents D:
19:09:00Yardanicodom96, discord has many optional parameters, of course I can use Option type, but then I will need to unpack this option types a lot
19:09:23dom96Yardanico: Yes, you will and you should
19:09:34Electruxoh hey the package isn't tested on mac... perhaps i can do that :D
19:09:39dom96You should always have code that deals when a value is missing
19:09:50dom96*deals with the situation
19:09:58dom96An option type will enforce that
19:10:09YardanicoElectrux, there's nothing stopping it from working on mac :)
19:10:13Yardanicoor on windows
19:10:24Yardanicowell IDK why, but it uses locks
19:10:26Electruxhaha true :P
19:11:14Yardanicoalso idk how he "altered" websockets from niv
19:11:21YardanicoI need to diff between his version and upstream one
19:13:13FromGitter<b71729> Hi guys, any idea why ```type Route = tuple[path: Regex, handler: proc(req:Request) {.async.}] ⏎ var indexRoute: Route = (path: re"^/$", handler: handleIndex)``` fails with `attempting to call undeclared routine: 'async'`? The pragma is definitely used just above in another function
19:13:27Yardanicodid you import asyncdispatch?
19:13:31Yardanicoah, nvm
19:15:00FromGitter<b71729> in fact, just this will trigger it: `type Route = tuple[path: Regex, handler: proc(req:Request) {.async.}]`
19:15:33dom96{.async.} can't be used for proc types
19:15:53dom96In that case you just specify a Future[T] return type, e.g. Future[void]
19:16:03dom96We should fix that :)
19:16:14dom96Make an issue
19:17:27FromGitter<b71729> Cool will do. Cheers
19:30:04*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:35:25dom96oooh https://www.spiria.com/en/blog/web-applications/webassembly-nim
19:40:59*breakfast1 joined #nim
19:53:02subsetparkIs there a way to print the system library path?
19:53:07subsetparkEsp. from nimscript?
19:54:51*noonien quit (Quit: Connection closed for inactivity)
19:58:31FromGitter<data-man> @subsetpark: Nim's libs path?
19:59:02subsetparkyeah
19:59:20FromGitter<data-man> exec ```nim dump```?
19:59:28subsetparkAs a part of a build script, I need to be able to copy nimbase.h into a package
20:00:34*nsf joined #nim
20:00:36subsetparkyes, by default `nim dump` actually only puts the defined symbols to stdout. i'm not sure what it's doing with the path exactly. stderr maybe. it's odd
20:01:19FromGitter<b71729> @dom96 https://github.com/nim-lang/Nim/issues/8042 thanks for the workaround
20:06:00*Vladar quit (Quit: Leaving)
20:15:49*jjido joined #nim
20:23:32Yardanicofor anyone wondering - this seems to be the oldest (public) repository with Nim language - https://github.com/dom96/nael
20:23:55dom96:D
20:24:11dom96how did you find that out?
20:24:21Yardanicodom96, https://github.com/search?q=language%3Anim+pushed%3A%3C2013-01-01&type=Repositories
20:24:43Yardanicowell, it's a bit wrong
20:25:14Yardanicobecause I sorted by "pushed" - there may be a 5 year old repo but if it's still updated, I couldn't find it
20:25:21*CodeVance joined #nim
20:25:39dom96lol "84M" issues
20:25:46dom96And when you click it it drops to 14K
20:27:23subsetparkbtw dom96 is it intended that half the output of `nim dump` is to stderr instead of stdout?
20:27:35dom96No idea
20:27:58dom96But if it was up to me I would say "no"
20:28:27dom96Yardanico: Seems accurate to me
20:28:42dom96I was using Factor before Nim
20:28:57dom96So I was in that stack-based language mindset when I switched to Nim
20:29:14*endragor joined #nim
20:31:44*breakfast1 quit (Quit: Leaving)
20:33:21*endragor quit (Ping timeout: 240 seconds)
20:37:58*clyybber joined #nim
20:39:37*xkapastel joined #nim
20:40:30*yglukhov[i] quit (Read error: Connection reset by peer)
20:41:06*yglukhov[i] joined #nim
20:46:13*cryptocat1094 quit (Quit: gtg)
20:46:43*yglukhov[i] quit (Read error: Connection reset by peer)
20:47:15*yglukhov[i] joined #nim
20:50:08Yardanicodom96, this nael wasn't having a lot of deprecated errors btw, biggest one was about null chars not being accessible in latest devel :) I fixed them all :P
20:51:32Yardanicohttps://github.com/Yardanico/nael/commit/7adfb1a50b83773b291b620fb0fed2de4c62e7db
20:51:53FromGitter<metasyn> hello ~
20:52:07Yardanicohi
20:52:08*yglukhov[i] quit (Read error: Connection reset by peer)
20:52:37FromGitter<metasyn> i wanted to say "nimsters" but realized I don't know the proper plural for those that program in nim
20:52:41*yglukhov[i] joined #nim
20:52:49FromGitter<metasyn> e.g. python -> pythonistas
20:52:57shashlickwelcome 🙂
20:53:53CodeVancehi
20:54:00CodeVancenimsters XD
20:54:27FromGitter<metasyn> I just tried out nim for the first time over the last week... I had been checking it out casually over the last few years
20:55:35FromGitter<metasyn> I'm pretty impressed / interested. So thought I would come say hi. I had some questions about code style... being compiled, things like linters aren't maybe *as* important as in languages like ecmascript or python... but is there some type of PEP8-ish style guide/suggestion somewhere?
20:56:01FromGitter<metasyn> I'm trying to start getting a grasp on what idiomatic nim looks like, although, I mean, I guess I can just start poking around in packages \shrug
20:56:13Yardanicothere's NEP1
20:56:23CodeVancethere was an attempt. But most of the coding guidelines are strictly enforced atm
20:56:27Yardanicohttps://nim-lang.org/docs/nep1.html
20:56:34YardanicoCodeVance, they're not really "enforced"
20:56:45CodeVancethey are
20:56:56Yardanicofor example?
20:57:03CodeVancelike it won't compile if you try to be "creative"
20:57:32CodeVanceonly line continuation if and|or is at the end of line not the beginning
20:57:49FromGitter<metasyn> I see. I saw that from googling but was curious about adherence
20:57:58FromGitter<metasyn> I will read it anyhow
20:58:06YardanicoCodeVance, that's not really a "coding guideline"
20:58:09CodeVanceindentation is required for ternary style if
20:58:15Yardanicothat's how syntax works
20:58:20CodeVanceya but it would have been
20:58:22Yardanico*or better - parser
20:58:27dom96Yardanico: hehe, back when I was still capitalising my True and False after Python :)
20:58:38CodeVanceif it was looser
20:58:52dom96Someone should create an RFC for the proper plural for Nim programmers :D
20:58:53Yardanicodom96, but even this 6-year old code looks very clean
20:59:11dom96Yardanico: Of course, I wrote it :P
20:59:30dom96if you want to see ugly code look at this: https://github.com/dom96/MDSBot
21:00:01dom96or maybe this https://github.com/dom96/Nyx
21:00:22dom96metasyn: welcome to Nim :)
21:01:50FromGitter<data-man> nimans?
21:01:55*miran quit (Ping timeout: 260 seconds)
21:02:18Yardanicodom96, Nyx still works with python 2 on my arch linux btw :)
21:02:35Yardanicoand it looks quite good, very similar to hexchat
21:03:03FromGitter<data-man> programnimmers? :)
21:03:07*Nyx joined #nim
21:03:15Nyxhello from Nyx
21:03:28FromGitter<metasyn> hello all, thanks for the welcomes ✨
21:03:57*Nyx quit (Client Quit)
21:06:58FromGitter<metasyn> another question i have... i started trying out: ⏎ https://github.com/zah/nim.vim ⏎ ⏎ but wasn't able to get it to work on my first try, so ended up using vscode + vim + nim plugins ⏎ ... [https://gitter.im/nim-lang/Nim?at=5b22d8f182b1b355c958c218]
21:11:05FromGitter<kaushalmodi> Does anything like this exist in std libs? Would that be a useful addition? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b22d9e81ee2d149ecc3015a]
21:11:15FromGitter<Yardanico> afaik it does
21:11:35dom96Yardanico: It works :O
21:11:40FromGitter<Yardanico> there's findExe
21:11:43dom96Yardanico: Send me a screenshot :)
21:11:49Yardanicodom96, screenshot of Nyx? ok
21:12:11*Nyx joined #nim
21:12:13CodeVanceos module?
21:12:30*nsf quit (Quit: WeeChat 2.1)
21:12:33Yardanicoyeah
21:12:47FromGitter<kaushalmodi> CodeVance: Yes, for os module, but didn't find anything like that
21:13:04Yardanico@kaushalmodi findexe
21:13:06Yardanicodom96, https://i.imgur.com/RfPs3n6.png
21:13:34Yardanico(there's exceptions if I try to right-click usernames or servers though)
21:13:40dom96Awesome :)
21:13:49CodeVancehttps://nim-lang.org/docs/os.html#findExe,string,bool,openArray[string]
21:13:57dom96Yeah, there is plenty of bugs in it
21:14:33CodeVancedom96: what OS you using?
21:14:34dom96lol, it even shows the time in your locale
21:14:35FromGitter<kaushalmodi> thanks Yardanico, CodeVance.. didn't think of "exe"
21:14:42dom96CodeVance: Currently macOS
21:15:03CodeVanceI thought it was a linux os
21:15:15CodeVanceI want to try linux for dev instead of ms
21:15:41YardanicomacOS is pretty close to linux in terms of terminal/most terminal apps/compilers
21:16:04CodeVanceexcept its just far enough away to need an emulator to work
21:16:10CodeVanceXD
21:16:31*Nyx quit (Client Quit)
21:18:29*Trustable quit (Remote host closed the connection)
21:28:05*yglukhov[i] quit (Remote host closed the connection)
21:29:46FromGitter<kaushalmodi> OK, does a version check boolean proc exist somewhere.. something that returns true/false on `isVersionNewer("0.43", "0.43-DEV")`?
21:31:21Yardanicoyou want to compare two strings?
21:31:29FromGitter<zetashift> @Yardanico except for a dota hero what the hell is Nyx?
21:31:30Yardanicobut I don' think that this exists
21:31:42Yardanico@zetashift IRC client written in Python by dom96 9 years ago with gtk
21:32:04Yardanicoand this is a screenshot - https://i.imgur.com/RfPs3n6.png
21:32:11Yardanico(https://github.com/dom96/Nyx)
21:32:41*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:32:42FromGitter<kaushalmodi> they would need to be strings as the tool I am dealing with has version like "0.43-DEV"
21:32:59Yardanicowell, I don't think a proc like this exists in stdlib
21:33:20FromGitter<kaushalmodi> .. or I might need to have a custom function to convert such "dev" string versions to floats
21:33:26ElectruxYardanico: i literally forgot how to build a project with nim... could you please tell how? the discordnim project
21:33:44FromGitter<zetashift> @Electrolux nim c main.nim?
21:34:07Electruxproject... not single source
21:34:12Yardanicoehm
21:34:23Electruxnimble build gives me errors
21:34:27Yardanicowith "nim c main.nim" you will compile this file and all other files, so you will compile a whole project
21:34:29YardanicoElectrux, there's some examples in examples directory :) and you
21:34:39Yardanicojust "nim c -d:ssl examples/somefile.nim" them
21:34:47Electruxoh... ouch
21:34:48Yardanicoand replace somefile.nim with some file from examples dir
21:34:59Electruxthanks a lot... sorry for that stupid question
21:35:00Electrux:)
21:35:14FromGitter<zetashift> sometimes it can be that simple
21:35:28FromGitter<zetashift> I was messing around with Scala and I was like "isn't this a bit too much for a simple hello world?"
21:35:34*clyybber quit (Quit: good night)
21:45:05*Electrux quit (Ping timeout: 248 seconds)
21:55:31*rockcavera joined #nim
22:01:36*CodeVance left #nim (#nim)
22:09:47*Electrux joined #nim
22:14:15*Electrux quit (Ping timeout: 260 seconds)
22:27:45FromGitter<dom96> https://news.ycombinator.com/item?id=17315554
22:29:56*rockcavera quit (Ping timeout: 256 seconds)
22:37:13*krux02 quit (Remote host closed the connection)
22:38:20*shashlick quit (Remote host closed the connection)
22:38:51*rockcavera joined #nim
22:38:51*rockcavera quit (Changing host)
22:38:51*rockcavera joined #nim
22:39:42*Electrux joined #nim
22:40:34*shashlick joined #nim
22:43:57*Electrux quit (Ping timeout: 240 seconds)
22:46:33*elrood quit (Remote host closed the connection)
22:48:59*xkapastel quit (Quit: Connection closed for inactivity)
22:50:53*xet7 quit (Read error: Connection reset by peer)
22:53:41*shashlick quit (Remote host closed the connection)
22:53:48FromGitter<honewatson> @metasyn for neovim I have https://github.com/w0rp/ale and https://github.com/baabelfish/nvim-nim though my preference is for vim over vscode for Nim at the moment I would recommend using vscode with nim plugin, code runner plugin, and VSCodeVim. You can add your own vim keymaps in Vscode. Its not as powerful as vim but the tradeoff with the Nim plugin is worth in my opinion.
22:53:57*shashlick joined #nim
22:54:52FromGitter<honewatson> VSCodeVim also comes with some emulated plugins like vim easy motion, comments, surround
22:58:18FromGitter<honewatson> Here is vim related vscode settings ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b22f30ae87f0c7bee8c878d]
22:59:41*Electrux joined #nim
23:03:57*Electrux quit (Ping timeout: 240 seconds)
23:09:41*Electrux joined #nim
23:14:20*Electrux quit (Ping timeout: 260 seconds)
23:20:21dom96kaushalmodi: "Not as easy as installing go/rust toolchains locally (without admin rights), but not difficult either." Can you elaborate? :)
23:21:56FromGitter<kaushalmodi> @dom96 For Go, I just download the tar.xz, extract the binary and put it in PATH.
23:22:17dom96and rust?
23:22:55FromGitter<honewatson> Yeah I have to disagree to some extent with Rust for toolchains. Basically I haven't been able to get racer to work for external crates on windows or mac. Only Linux. Haven't had any such issues with nimsuggest which out of the box has better performance.
23:23:13dom96Indeed, it would be nice to offer a tarball with binaries for Nim too
23:24:21FromGitter<kaushalmodi> "rustup upgrade" or something like that. If I remember rustup download was a binary too.
23:25:20dom96Are you aware of choosenim?
23:25:42FromGitter<kaushalmodi> I had opened an issue for that.. it didn't work on RHEL 6.6 :)
23:27:08dom96Why use such an old glibc D:
23:38:01*dddddd quit (Remote host closed the connection)
23:39:11*Electrux joined #nim
23:44:05*Electrux quit (Ping timeout: 260 seconds)
23:46:59FromGitter<kaushalmodi> Work
23:48:41*Electrux joined #nim
23:49:25FromGitter<kaushalmodi> The point is that the Go/Rust installation were easier even on that old OS.
23:51:06shashlickwe should figure out snap as well - https://snapcraft.io/go
23:53:07*Electrux quit (Ping timeout: 245 seconds)