<< 06-01-2018 >>

00:06:10*yglukhov joined #nim
00:10:40*yglukhov quit (Ping timeout: 248 seconds)
00:23:05*devdri quit ()
00:26:08*gokr quit (Ping timeout: 248 seconds)
00:27:36*vlad1777d joined #nim
00:39:21*yglukhov joined #nim
00:43:27*yglukhov quit (Ping timeout: 240 seconds)
00:54:25*dddddd joined #nim
00:57:26*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:41:40*MJCaley joined #nim
02:15:55*shodan45 quit (Remote host closed the connection)
02:17:57*MJCaley quit (Quit: MJCaley)
02:20:23*zielmicha__ joined #nim
02:25:48*heinrich5991_ joined #nim
02:26:47*Yardanico[Phone] quit (*.net *.split)
02:26:49*zielmicha_ quit (*.net *.split)
02:26:49*FromGitter quit (*.net *.split)
02:26:50*niv quit (*.net *.split)
02:26:50*heinrich5991 quit (*.net *.split)
02:27:00*zielmicha__ is now known as zielmicha_
02:27:03*niv joined #nim
02:27:15*FromGitter joined #nim
02:27:57*heinrich5991_ is now known as heinrich5991
02:28:57*qwertfisch quit (Ping timeout: 240 seconds)
02:29:26*gmpreussner quit (Ping timeout: 260 seconds)
02:31:55*gmpreussner joined #nim
02:31:56*qwertfisch joined #nim
02:39:45*shodan45 joined #nim
03:01:07*chemist69 quit (Ping timeout: 255 seconds)
03:02:13*yglukhov joined #nim
03:08:09*yglukhov quit (Ping timeout: 264 seconds)
03:15:11*chemist69 joined #nim
03:19:27*cspar quit (Ping timeout: 240 seconds)
03:19:53*endragor joined #nim
03:21:14*MJCaley joined #nim
03:24:05*endragor quit (Ping timeout: 240 seconds)
03:28:46*dandevelo joined #nim
03:33:36*dandevelo quit (Ping timeout: 260 seconds)
03:49:59*cspar joined #nim
04:10:36*yglukhov joined #nim
04:15:21*yglukhov quit (Ping timeout: 268 seconds)
04:26:08*cyraxjoe quit (Remote host closed the connection)
04:29:23*Yardanico[Phone] joined #nim
04:47:10*MJCaley quit (Quit: MJCaley)
05:17:34*yglukhov joined #nim
05:21:57*yglukhov quit (Ping timeout: 240 seconds)
05:30:39*dandevelo joined #nim
05:34:57*dandevelo quit (Ping timeout: 240 seconds)
05:56:04*Yardanico joined #nim
05:56:11*Yardanico quit (Remote host closed the connection)
05:56:34*Yardanico joined #nim
06:08:49*dddddd quit (Ping timeout: 268 seconds)
06:20:38*yglukhov joined #nim
06:22:29*Yardanico quit (Remote host closed the connection)
06:22:57*craigger quit (Ping timeout: 248 seconds)
06:24:15*Yardanico joined #nim
06:25:13*craigger joined #nim
06:25:33*yglukhov quit (Ping timeout: 264 seconds)
06:25:37*user0 quit (Ping timeout: 256 seconds)
06:57:57*trincyolo joined #nim
07:10:12*SitiSchu joined #nim
07:26:30*dandevelo joined #nim
07:30:55*yglukhov joined #nim
07:34:27*dandevelo quit (Ping timeout: 240 seconds)
07:34:57*yglukhov quit (Ping timeout: 240 seconds)
08:03:48*nsf joined #nim
08:06:36*gangstacat quit (Quit: Ĝis!)
08:10:02*gangstacat joined #nim
08:20:06*cspar quit (Ping timeout: 265 seconds)
08:28:47*vlad1777d quit (Ping timeout: 248 seconds)
08:31:50*dandevelo joined #nim
08:42:49*dandevelo quit (Ping timeout: 265 seconds)
08:43:32*endragor joined #nim
08:46:30*miran joined #nim
08:47:03mirananybody here?
08:56:12def-no
08:57:25miranok, nothing then.... :D
08:58:18YardanicoI'm here, but it's only 12AM :P
08:59:15miranok, i'll be gentle :D
08:59:46miranvar a = {1 .. 10} # nice and easy
09:00:20miranwhat if i want just odd numbers? i cannot do: var a = {countup(1, 10, 2)}
09:01:09Yardanicocountup is an iterator
09:01:13Yardanicoyou can use toSeq from sequtils
09:01:22miransomething like `start..step..end` doesn't exist, unfortunately
09:01:22Yardanicovar a = toSeq(countup(1, 10, 2))
09:01:25Yardanicoah
09:01:49Yardanicowell countup will work with toSeq
09:02:11Yardanicoand yeah, there's no start..step..end
09:03:35*gmpreussner quit (Ping timeout: 240 seconds)
09:05:15*gmpreussner joined #nim
09:05:18miranyes, your example works, but this doesn't: var a = {toSeq(countup(1, 10, 2))}
09:05:50Yardanicoahhh, set
09:06:23miranvar a = {1}; for i in countup(1, 10, 2): a.incl(i)
09:06:49miranugly, but i can live with it if there's nothing better
09:07:34Yardanicothere's nothing better for sets AFAIK
09:08:28miranalso there are no +=, *=, etc for sets.... :(
09:09:16Yardanicomiran, did you try these? https://nim-lang.org/docs/sets.html
09:09:20FromGitter<mratsim> what would that be miran?
09:09:30FromGitter<mratsim> union, intersect?
09:09:35mirani had an idea to make a pull request but couldn't figure out even regular +, * for sets in system.nim
09:10:02miranmratsim: instead of a = a * b #intersection
09:10:12miranyou would have: a *= b
09:10:28FromGitter<mratsim> check the link by Yardanico
09:10:59miranalso don't include these (+=, *=) versions
09:12:26miranproc `+` *[T](x, y: set[T]): set[T] {.magic: "PlusSet", noSideEffect.}
09:12:51miranthis is implementation (?) of `+` in system.nim
09:12:58*yglukhov joined #nim
09:13:03mirani have no idea what .magic. is
09:13:22FromGitter<mratsim> magic are proc defined at the compiler level
09:15:19miranok, i won't touch those, and will add procs to module sets and make pull request....
09:17:31*yglukhov quit (Ping timeout: 268 seconds)
09:18:22*Yardanico quit (Remote host closed the connection)
09:19:33*Yardanico joined #nim
09:26:20*Yardanico quit (Remote host closed the connection)
09:26:32*Yardanico joined #nim
09:34:55*def- quit (Quit: -)
09:36:24*def- joined #nim
09:39:14*dandevelo joined #nim
09:41:15miranmy nimsuggest is currently taking 4GB or RAM?!?!
09:45:19Yardanicoit's known that nimsuggest leaks memory :(
09:45:22Yardanicoare you on devel?
09:45:40Yardanicoaraq made some changes to memory allocator which can help to make it a bit less
09:46:02mirancurrently on devel, yeah
09:48:48miranbut usually i'm on stable, because of https://github.com/nim-lang/Nim/issues/6989
09:49:52*Trustable joined #nim
09:51:57*dandevelo quit (Ping timeout: 240 seconds)
09:53:50Yardanicooh
09:54:17Yardanicomiran, hmm, I will try this snippet with devel nim and clang (on arch linux)
09:55:13Yardanicoyeah, same behaviour
09:55:32miranYardanico: and on stable is ok?
09:55:53Yardanicomiran, well I don't have stable to test, but I think it is :)
09:55:58YardanicoI'll experiment with cpp
09:56:01Yardanicobackend
09:56:15Yardanicohvm, no, same for cpp also
10:00:18*yglukhov joined #nim
10:08:59*claudiuinberlin joined #nim
10:33:14*gokr joined #nim
10:35:07*Vladar joined #nim
10:36:47*yglukhov quit (Remote host closed the connection)
10:38:20Araqmiran: I think I know the problem
10:38:46Araqready to follow some instructions?
10:40:00miranlet's try it
10:45:16Araqsystem.nim line 3421 has
10:45:17Araqproc `$`*[T, IDX](x: array[IDX, T]): string
10:45:32Araqand also array to cstring conversions have been removed
10:45:57Araqso that $myCharArrayBuffer quietly changed its meaning
10:46:22Araqremove that `$` proc from system.nim and try to compile your project
10:46:50Araqif should now produce a compiler error where you need to fix your code
10:47:10miranok, how do i compile it? (without changing/breaking existing versions from choosenim)
10:47:27Yardanicomiran, ??
10:47:31Yardanicosystem.nim is not in compiler itself
10:47:38Yardanicoit's an stdlib module just like httpclient.nim
10:47:50Yardanicobut it's implicitly imported into any nim file
10:48:08miranok, just comment out that proc and re-run my file?
10:48:12Yardanicomiran, yes
10:48:19Yardanico*re-compile and re-run
10:49:13miranYardanico: i did that, and it is still the same (cc Araq)
10:49:28Yardanicomiran, are you sure you changed system.nim?
10:49:32Yardanicodid it show in CC step?
10:49:38Yardanicolike CC stdlib_system.c
10:50:14miranah, i probably changed it in my repo instead where i should. sorry for my stupidity
10:50:14Araqthe system.nim file you edited, write doesnotCompile() in it
10:50:32Araqif it still compiles you know it uses a different system.nimm :P
10:50:58AraqYardanico: the CC step is not relevant, we are after making the Nim compiler complain
10:51:23Araqif Nim still eats your program, it's some other problem
10:51:32YardanicoAraq, well I just mean if there's no CC step it means that system.nim wasn't actually changed
10:51:51Araqhuh I wouldn't count on that
10:52:08Araqit's a generic, it might not end up in stdlib_system.c
10:52:55miranuntil i find the correct file, Yardanico have you tried this on your system? does it work as it should?
10:53:09*user0 joined #nim
10:53:24Yardanicomiran, let me try..
10:53:32YardanicoI'll try to edit system.nim too
10:55:01Yardanicohmm
10:55:11Yardanicoafter removing this proc everything is the same
10:55:47Yardanicoand I tested that I removed the correct proc - tried echo [1, 2, 3] in another file
10:56:38miranAraq: still the same
10:56:59mirani made sure i was editing the right file with doesnotCompile()
10:57:08Araqhmm
10:59:06Yardanicomaybe it's related to slices?
11:07:39*yglukhov joined #nim
11:10:43Araqoh good idea!
11:12:21*yglukhov quit (Ping timeout: 256 seconds)
11:36:06*MrAxilus[m] left #nim ("Kicked by @appservice-irc:matrix.org : idle on matrix for more than 30 days")
11:49:12*dandevelo joined #nim
11:53:24*dandevelo quit (Ping timeout: 246 seconds)
12:08:27*yglukhov joined #nim
12:12:35*watzon quit (Quit: idle on matrix for more than 30 days)
12:12:39*yglukhov quit (Ping timeout: 246 seconds)
12:13:57*Vladar quit (Quit: Leaving)
12:17:38*jivank[m] quit (Quit: idle on matrix for more than 30 days)
12:18:15*azur_kind joined #nim
12:20:26*endragor_ joined #nim
12:23:15*endragor quit (Ping timeout: 260 seconds)
12:29:42*endragor joined #nim
12:32:31*endragor_ quit (Ping timeout: 240 seconds)
12:35:45*gokr quit (Ping timeout: 264 seconds)
12:46:04*MJCaley joined #nim
12:55:55*vlad1777d joined #nim
12:58:37*marenz__ joined #nim
13:01:11*yglukhov joined #nim
13:03:42*miran quit (Remote host closed the connection)
13:05:30*yglukhov quit (Ping timeout: 246 seconds)
13:09:56*miran joined #nim
13:11:32*xet7 joined #nim
13:19:48*endragor quit (Remote host closed the connection)
13:20:15*endragor joined #nim
13:24:47*endragor quit (Ping timeout: 248 seconds)
13:43:56*dddddd joined #nim
13:48:46*marenz__ quit (Ping timeout: 265 seconds)
13:49:24*MJCaley quit (Quit: MJCaley)
13:55:03*endragor joined #nim
13:55:52*dandevelo joined #nim
14:12:04*MJCaley joined #nim
14:14:12*yglukhov joined #nim
14:18:43*yglukhov quit (Ping timeout: 252 seconds)
14:31:06mirancan anybody help me with iterators? i find them quite unintuitive and i'm not managing to get what i want....
14:35:37*Vladar joined #nim
14:39:29mirannvm, i managed to get the wanted result, just to be surprised that iterators are 2x slower than version using procs....
14:46:56*rauss quit (Ping timeout: 252 seconds)
14:49:55FromGitter<alehander42> can i check if an object is of a subclass?
14:50:11Araqif obj of SubClass:
14:50:24FromGitter<alehander42> awesome ty
14:53:39*rauss joined #nim
14:54:05*MJCaley quit (Quit: MJCaley)
15:02:30FromGitter<tim-st> What would be the best way to save the object type in an array? Should I generate an enum type for every object type?
15:02:38FromGitter<tim-st> or in a seq
15:03:39FromGitter<Quelklef> what do you mean?
15:04:59FromGitter<tim-st> I mean I want to have a seq that describes which types are allowed in a relation with my type. In Python I could use supportedTypes = [ClassA, ClassB, ClassC]
15:06:51FromGitter<tim-st> basically: Does each object type internally save its type as a unique int and can I access it, or should I make a unique enum type for each object?
15:08:35*nsf quit (Quit: WeeChat 2.0.1)
15:09:52AraqI'll be super unhelpful and tell you to use a macro instead ;-)
15:10:22FromGitter<tim-st> Thanks, I will read into it. I just wasnt sure if I missed some obvious way
15:10:52Araqthe problem is that even once you have the types as a first class entity, the classes are not uniform
15:11:09Araqso you don't store a list of classes and then iterate over it.
15:11:26Araqinstead you do code generation with a macro
15:11:46FromGitter<tim-st> ok, thanks!
15:12:24Araqmacro initAll(a: vararags[typedesc]) = result = newStmtList(); for x in a: result.add newCall(bindSym"init", x)
15:12:59FromGitter<tim-st> wow, this looks hard xD
15:13:41Araqwell you need to redesign everything but usually it works out and the result is something that fits Nim and has zero overhead
15:14:18FromGitter<tim-st> ok, that sounds good
15:16:44*vlad1777d quit (Ping timeout: 265 seconds)
15:20:37*yglukhov joined #nim
15:24:47*yglukhov quit (Ping timeout: 248 seconds)
15:35:58*vlad1777d joined #nim
15:43:25*devdri joined #nim
16:14:18*azur_kind quit (Remote host closed the connection)
16:16:32*vlad1777d quit (Ping timeout: 248 seconds)
16:27:55*yglukhov joined #nim
16:28:07*vlad1777d joined #nim
16:32:05*yglukhov quit (Ping timeout: 240 seconds)
16:38:24*yglukhov joined #nim
16:45:41*rokups joined #nim
16:46:06*MJCaley joined #nim
17:05:58*vlad1777d quit (Ping timeout: 265 seconds)
17:22:52*Yardanico quit (Remote host closed the connection)
17:27:39*gokr joined #nim
17:44:14*devdri quit ()
17:45:00*vlad1777d joined #nim
17:47:10*devdri joined #nim
17:47:37redlegionok, it was someone in here who introduced me to iosevka, and i really gotta thank that person
17:47:50redlegioni just can't freaking remember who it was
17:55:23*yglukhov quit (Remote host closed the connection)
17:59:15*arecacea1 quit (Remote host closed the connection)
17:59:33*arecacea1 joined #nim
18:03:11*Ven`` joined #nim
18:08:02FromGitter<SolitudeSF> iosevka is the best. it was subsetpark, btw
18:11:52subsetparkWord up homies!
18:34:27*arecacea1 quit (Quit: WeeChat 1.9.1)
18:34:53FromGitter<alehander42> wow it looks bizarre :D
18:56:30*yglukhov joined #nim
19:02:05*yglukhov quit (Remote host closed the connection)
19:02:41*yglukhov joined #nim
19:03:30CalinouI prefer Hack myself: http://sourcefoundry.org/hack/
19:03:40Calinouno ligatures unfortunately, but it has a huge character set
19:03:50*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:03:59Calinou(useful in programs which don't support fallbacks, such as Windows's cmd.exe)
19:08:50*yglukhov quit (Remote host closed the connection)
19:09:47FromGitter<Quelklef> Hack seems less... weird
19:10:01FromGitter<Quelklef> Any fans of straight Ubuntu? Love that typeface
19:18:33FromGitter<tim-st> Is using type conversion to bring an Object of type A in Type B good regarding performance and safety?
19:18:58FromGitter<Quelklef> as in, `castTypeA (thingOfTypeB)`?
19:19:03FromGitter<tim-st> https://nim-lang.org/docs/tut2.html#object-oriented-programming-type-conversions
19:21:03*nsf joined #nim
19:21:11FromGitter<tim-st> so basically Type B is a Type A and I convert it from object A to object B
19:22:08*yglukhov joined #nim
19:25:13FromGitter<Quelklef> Performance is gonna depend on the conversion algorithm, I assume
19:26:01FromGitter<Quelklef> Converting from JSON to a Tree may be hard on the computer, but string to cstring won't be
19:26:39FromGitter<tim-st> ok, thanks
19:40:46*miran quit (Quit: Konversation terminated!)
19:50:02*Ven`` joined #nim
19:59:03*Jesin joined #nim
19:59:18Araqobject conversions are cheap in debug mode and free in -d:release
20:04:22*Trustable quit (Remote host closed the connection)
20:05:16FromGitter<Quelklef> What? How?
20:05:45FromGitter<Quelklef> Oh, I misunderstood his question
20:06:00FromGitter<Quelklef> @tim-st, ignore what I said, look at what @Araq has said
20:19:11*salewski joined #nim
20:19:16*MJCaley quit (Quit: MJCaley)
20:20:09salewskiAraq, I still wonder how expensive type query like "if t of RStarTree[M, D, RT, LT]:" is?
20:20:48Araqthe generic is instantiated so this is the same as 't of Subclass'
20:22:36salewskiI guessed that, but have no idea how expensive 't of Subclass' is. Does it depend of number of subclasses?
20:23:15Araqit is a trivial while x != subclass: x = x.up loop
20:23:32Araqso the complexity is O(inheritance depth)
20:23:50salewskiInteresting, thanks!
20:23:58Araqthere is also some caching involved iirc
20:24:39Araqit stores successful and not successful matches to speed up things further. it's not optimal, but it also never shows up in profiles
20:24:53AraqIMO.
20:25:25salewskiBye.
20:25:28*salewski quit (Quit: WeeChat 1.9.1)
20:28:26*MJCaley joined #nim
20:38:30*mostly-harmless quit (Quit: leaving)
20:39:37*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:40:14*Ven`` joined #nim
20:43:50*MJCaley quit (Quit: MJCaley)
20:45:44*Vladar quit (Quit: Leaving)
20:48:02FromGitter<Quelklef> Er, how should I start debugging a program that seems to crash during compilation?
20:48:41FromGitter<Quelklef> As in, it gives a bunch of lines like `Hint: <x> [Processing]`and then "nim.exe has stopped working"
20:49:01Araqkoch temp c myprog.nim
20:49:13Araqbut every compiler crash deserves a bug report
20:49:48FromGitter<Quelklef> Shoot, don't have koch
20:49:49Araqon the other hand, you're misusing 'var ref object'. stop doing that.
20:50:20FromGitter<Quelklef> Wait, is the koch command the same one for generating a stack frame (iirc) when the compiler crashes? Because I think I remember doing that
20:50:21FromGitter<Quelklef> and huh?
20:53:25*rokups quit (Quit: Connection closed for inactivity)
20:54:03*mostly-harmless joined #nim
20:56:44FromGitter<Quelklef> OK, got koch working. I'll work on pinpointing the issue and I'll submit a report. but i still have no idea what you're talking about with var ref object
20:57:10Araqwas just an educated guess of where you screw up
20:57:47FromGitter<Quelklef> Sure, but what's wrong with var ref objects
20:58:17FromGitter<Quelklef> by which you mean, e.g., `var x: A = ...` where `type A = ref object of ...`, right?
20:59:15*marenz__ joined #nim
21:00:33Araqno, I mean method m(x: var ref A)
21:00:44Araqwhere type A = object of ...
21:01:19FromGitter<Quelklef> Oh. Was I doing that before? None of that in this project
21:03:54Araqno, but plenty of other people do that.
21:04:12Araqespecially the people who want 'var' to mean 'mutable' (sorry, that's not what it does)
21:05:31FromGitter<Quelklef> ah. I usually just stay aware from var, ref, and ptr because I don't understand them yet
21:10:24*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:10:48*Ven`` joined #nim
21:27:48FromGitter<tim-st> @Araq Thanks for the answer, that's good to know!
21:27:59*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:39:15*Ven`` joined #nim
21:45:29*S1tiSchu joined #nim
21:46:35*gangstacat quit (Ping timeout: 252 seconds)
21:47:23*SitiSchu quit (Ping timeout: 268 seconds)
21:50:09*S1tiSchu quit (Client Quit)
21:50:20*SitiSchu joined #nim
22:20:19*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:38:30*xet7 quit (Quit: Leaving)
22:39:40FromGitter<finddit> Hi
22:41:05*xet7 joined #nim
22:42:09*strale joined #nim
22:42:35*strale left #nim (#nim)
22:48:32Araqhi, finddit
22:49:05FromGitter<finddit> just silly i will change that name :) thats my startups name :D
22:49:18*qwertfisch is now known as qwertotter
22:53:28FromGitter<reveo> Hi
23:00:25*endragor quit (Remote host closed the connection)
23:00:54FromGitter<ervinbosenbacher> Hi Araq
23:01:08FromGitter<ervinbosenbacher> Ervin aka finddit
23:12:24*vlad1777d quit (Ping timeout: 246 seconds)
23:16:21*nsf quit (Quit: WeeChat 2.0.1)
23:39:21*zama quit (Ping timeout: 264 seconds)
23:42:14*kier quit (Read error: Connection reset by peer)
23:43:38*kier joined #nim
23:46:18*xet7 quit (Quit: Leaving)