<< 01-01-2018 >>

00:00:13dom96Happy new year from the UK :)
00:12:19*Ven`` joined #nim
00:25:37*user0 joined #nim
00:29:41*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:32:34*Ven`` joined #nim
00:35:11*dandevelo joined #nim
00:37:47*natrys quit (Quit: natrys)
00:40:26*dandevelo quit (Ping timeout: 252 seconds)
00:59:34*chemist69 quit (Ping timeout: 265 seconds)
01:06:11*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:09:58*Ven`` joined #nim
01:13:08*chemist69 joined #nim
01:20:00GitDisc<treeform> Happy new year
01:20:31GitDisc<treeform> I guess fireworks and SQLite?
02:04:56*dddddd quit (Remote host closed the connection)
02:06:14*chemist69 quit (Ping timeout: 252 seconds)
02:12:46*vlad1777d joined #nim
02:16:58*Jeremy joined #nim
02:17:22*Jeremy is now known as Guest40290
02:17:30*Guest40290 quit (Client Quit)
02:20:02*chemist69 joined #nim
02:23:09*marenz__ quit (Ping timeout: 264 seconds)
02:37:31*dandevelo joined #nim
02:42:51*dandevelo quit (Ping timeout: 256 seconds)
02:43:43*S1t1Schu joined #nim
02:47:26*S1tiSchu quit (Ping timeout: 260 seconds)
02:53:23*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:00:11*vlad1777d quit (Quit: Leaving)
03:39:20*ldlework quit (Changing host)
03:39:20*ldlework joined #nim
03:41:19FromGitter<Quelklef> why sqlite?
03:42:17FromGitter<Quelklef> wait
03:42:33FromGitter<Quelklef> lol i thought you were saying "Happy new year!! Fireworks and SQLite!!"
03:45:56Yardanicohe did say that
03:46:00*Ven`` joined #nim
03:46:28FromGitter<Yardanico> ah
03:48:13FromGitter<Quelklef> man now I'm just more confused
03:51:01*Ven`` quit (Ping timeout: 260 seconds)
04:22:30*Yardanico quit (Read error: Connection reset by peer)
04:40:27*user0 quit (Quit: user0)
05:01:31FromGitter<Quelklef> Happy new years from the US!
06:26:39*nsf joined #nim
06:44:54*dandevelo joined #nim
06:49:56*themagician_n quit ()
06:50:09*dandevelo quit (Ping timeout: 264 seconds)
07:01:33*xet7 joined #nim
07:41:26*awesomelackware joined #nim
07:45:46*NimBot joined #nim
07:45:52awesomelackware!eval while true: echo(9)
07:46:05*awesomelackware left #nim (#nim)
07:46:47NimBot9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9↵9�...
07:46:47*dandevelo joined #nim
07:48:19*yglukhov joined #nim
07:48:23*yglukhov quit (Remote host closed the connection)
07:48:36*yglukhov joined #nim
07:48:57*rauss quit (Quit: WeeChat 2.0.1)
07:50:55*dandevelo quit (Ping timeout: 248 seconds)
08:02:04FromGitter<Quelklef> whaaa
08:02:28FromGitter<Quelklef> !eval 3
08:02:28NimBotCompile failed: <no output>
08:02:45FromGitter<Quelklef> !eval echo "$1$2" % ["a", " b"]
08:02:46NimBotCompile failed: in.nim(1, 13) Error: undeclared identifier: '%'
08:02:53FromGitter<Quelklef> hmmmm
08:03:51FromGitter<Quelklef> !eval import strutils; echo("$1$2" % ["there once was a boy named", " jack"])
08:03:53NimBotthere once was a boy named jack
08:24:22*Vladar joined #nim
08:44:59*prince joined #nim
09:02:45*gmpreussner quit (Ping timeout: 246 seconds)
09:03:38*gmpreussner joined #nim
09:12:20*profkitkat joined #nim
09:26:29*azur_kind joined #nim
09:32:34*prince quit (Quit: Leaving)
09:48:09*dandevelo joined #nim
09:49:35*endragor joined #nim
09:53:45*dandevelo quit (Ping timeout: 264 seconds)
09:57:38*endragor_ joined #nim
09:59:06*endragor quit (Ping timeout: 260 seconds)
09:59:22*claudiuinberlin joined #nim
10:02:57*endragor_ quit (Ping timeout: 240 seconds)
10:04:11FromGitter<data-man> Happy new year! ⏎ @Araq: https://github.com/OpenSystemsLab/unqlite.nim ⏎ But I would use LMDB or libmdbx. (Although libmdbx supports only Windows 10 and higher)
10:04:18*endragor joined #nim
10:07:43Araqdata-man: why?
10:22:02*user0 joined #nim
10:23:19FromGitter<data-man> A mem-mapped reading/writing.
10:24:35FromGitter<data-man> https://github.com/pmwkaa/ioarena - benchmarking tool
10:25:31FromGitter<data-man> But unqlite is missing
10:26:56FromGitter<data-man> https://github.com/pmwkaa/engine.so - list of data storage engines
10:30:37*yglukhov quit (Remote host closed the connection)
10:50:31*dandevelo joined #nim
10:54:39FromGitter<tim-st> @Araq are umlauts not allowed as first letter of tuple member?
10:56:27*yglukhov joined #nim
11:03:52FromGitter<tim-st> or more specific: calling the member like: `const ö = (ö: "ö"); echo ö.ö`
11:06:05*dddddd joined #nim
11:07:07*dandevelo quit (Ping timeout: 265 seconds)
11:13:41Araqtim-st: not sure if the first character of an identifier can be a non-ascii
11:15:23FromGitter<tim-st> ok, thanks. Are there any docs for the `|` op for `type C = A | B` I'm not sure where I can use it or if I can use it like I expect
11:19:26*Trustable joined #nim
11:32:56*xet7 quit (Quit: Leaving)
11:44:58FromGitter<stern0> Just wondering is Nim lang still single threaded??
11:54:40FromGitter<tim-st> Ok, I found it. It's called *Type Classes*: https://nim-lang.org/docs/manual.html#generics-type-classes
11:54:58*Vladar quit (Remote host closed the connection)
12:00:13FromGitter<tim-st> But unfortunately I can't use it as mixed type for something like HashMap
12:10:11FromGitter<dom96> @stern0 nope. Nim isn't single threaded.
12:14:24*marenz__ joined #nim
12:17:30*natrys joined #nim
12:39:06*natrys quit (Quit: natrys)
12:46:53*endragor quit (Remote host closed the connection)
12:50:49*endragor joined #nim
12:54:07*endragor quit (Remote host closed the connection)
12:54:51*Trustable quit (Remote host closed the connection)
13:03:30*dandevelo joined #nim
13:05:24*endragor joined #nim
13:07:35*endragor_ joined #nim
13:09:15*dandevelo quit (Ping timeout: 272 seconds)
13:09:27*endragor quit (Ping timeout: 240 seconds)
13:12:21*endragor_ quit (Ping timeout: 264 seconds)
13:12:25*yglukhov quit (Remote host closed the connection)
13:16:15*endragor joined #nim
13:18:35*endragor_ joined #nim
13:20:31*endragor quit (Ping timeout: 248 seconds)
13:23:22*endragor_ quit (Ping timeout: 268 seconds)
13:28:19*arecacea1 quit (K-Lined)
13:29:00*arecacea1 joined #nim
13:55:56*Yardanico[Phone] quit (Ping timeout: 260 seconds)
13:59:58*nsf quit (Quit: WeeChat 2.0.1)
14:07:36*Trustable joined #nim
14:14:02*yglukhov joined #nim
14:16:44*Yardanico joined #nim
14:18:17*yglukhov quit (Ping timeout: 252 seconds)
14:18:31Araqunsqlite.nim seems to be full of bugs
14:18:53Araqproc fetch*(self: UnQLite, key: string): string =
14:18:53Araq var
14:18:53Araq buf = ""
14:18:53Araq bufSize: int
14:18:53Araq check(unqlite_kv_fetch(self.db, key, -1, buf, addr bufSize))
14:18:54Araq buf[0..<bufSize]
14:19:01Araq^ that's never gonna work
15:02:26*Vladar joined #nim
15:05:16*dandevelo joined #nim
15:10:40*dandevelo quit (Ping timeout: 268 seconds)
15:14:03FromGitter<data-man> @Araq: Try https://github.com/fowlmouth/lmdb.nim :-)
15:15:55FromGitter<tim-st> @Araq is a recursive type definition for tuples planned or is this not possible/wanted?
15:22:38Araqtype recursions have to go through a nominal type
15:22:52Araqeverything else is a pita to deal with
15:24:06FromGitter<tim-st> ok, thanks. and the thing I written above with mixed type `type C = A |B` for something like hashmap wont be supported too? I would think type safety wont get lost
15:24:34FromGitter<tim-st> but I dont have much knowledge in this area^^
15:25:58*natrys joined #nim
15:26:09Araqthe or type doesn't do what you think it does
15:26:19Araqit makes no sense to support it here
15:27:34FromGitter<tim-st> I think it does the following: return a type of A or B. The compiles knows that type A or B will be returned and because of this only procs with the exact same signature can be called, which are defined for A and B and additonally all fields that has same name and same type
15:27:56FromGitter<tim-st> but maybe thats too hard to support
15:29:49Araqthat description seems off. an or type is an implicit generic that is restricted to the types of the or type
15:30:35AraqTable[string|int, int] is **not** a table that takes strings or ints producing ints
15:31:38FromGitter<tim-st> yes, I thought it, but wondered if my idea could be supported too. basically if if I have tuples A and B with one same field and others differ, can I insert both in on hashmap?
15:31:52Araqno.
15:32:25Araqyour idea is an ML like sum type, these are done with Nim's case objects.
15:32:38FromGitter<tim-st> yes, but objects are not constant
15:32:42FromGitter<tim-st> tuples are
15:33:27Araqso you want const case objects, just says so then.
15:34:23*vlad1777d joined #nim
15:39:37FromGitter<tim-st> Const objects would be good, const case objects would be good too but a bit harder for the user to create (my opinion). I'm pretty sure the idea I wrote could be supported for all types and would be quite easy to use for the developer with IDE, but maybe longer compile times or other downsides.
15:41:02*kunev quit (Quit: е те!)
15:41:20Araqthe real downside is that the language would be an incoherent mess with your ideas. int|float means "generic taking int or float". it does not mean "union taking int of float with a hidden tag field"
15:41:50Araqwe cannot make it mean both just so that case objects get a sexier syntax. that is not how things work.
15:42:32FromGitter<tim-st> ok, thanks
15:46:24*kunev joined #nim
15:52:08*nsf joined #nim
16:03:01*MJCaley joined #nim
16:07:57*sz0 joined #nim
16:16:16*MJCaley quit (Ping timeout: 255 seconds)
16:17:17*yglukhov joined #nim
16:17:19*yglukhov quit (Remote host closed the connection)
16:17:55*yglukhov joined #nim
16:22:25*yglukhov quit (Ping timeout: 248 seconds)
16:23:38*Ven`` joined #nim
16:26:57*yglukhov joined #nim
16:30:29*yglukhov quit (Remote host closed the connection)
16:30:54Araqargh, which embedded DB to use...
16:31:00Araqthere are so many of them
16:32:32dom96what are you making?
16:32:43Araq--symbolFiles
16:33:10Araqwant to base them on a simple embedded database, preferably with some support for compression
16:33:59dom96what was wrong with the previous approach?
16:34:12Araqtoo complex, complexity breeds bugs
16:36:37Araqwanted to use "unsqlite", but https://unqlite.org/downloads.html mentions a "one-time fee of $20"
16:37:05Araqso I don't want to use it.
16:37:55Araqon the other hand, I can add compression on my own later with zlib or something
16:39:23dom96use something that can be implemented in Nim easily
16:39:29dom96so that we don't have a dependency
16:40:05Araqthe dependency won't be used during bootstrapping, so it shoudl be fine
16:40:17FromGitter<data-man> UnQLite support in-memory databases (with ":mem:" as filename) and have embeddable scripting language ⏎ Sophia support compresion but non cross-platformed. ⏎ WiredTiger support compresion and cross-platformed but it's big lib.
16:40:45Araqno "in-memory" database, I need the "store to disk" feature
16:41:24FromGitter<RedBeard0531> Wiredtiger is 64 bit only.
16:41:41dom96most in-memory dbs have a "store to disk" feature
16:42:32Araqtrue but "in memory" is quite irrelevant. it needs to be embeddable though
16:42:48Araqmore than anything else, I don't want to start yet another server
16:42:58FromGitter<RedBeard0531> Have you considered https://cr.yp.to/cdb.html. It is simple for simple needs.
16:44:14Araqnever heard of it but the database can grow beyond 4GB
16:45:12AraqI don't need concurrency nor much more features than a key-value store offers
16:45:28dom96what features do you need out of this db?
16:45:32dom96does it need to be SQL?
16:46:55FromGitter<RedBeard0531> > GB symbolfiles?!?!
16:47:20FromGitter<RedBeard0531> err that was supposed to be >4GB, not a quote...
16:47:40*Trioxin joined #nim
16:50:14Trioxincan I use javascript libraries in Nim? like if I wanted to use jquery?
16:50:22YardanicoTrioxin, yes, you can
16:50:26Yardanicoif you use JS as compile target
16:50:43Yardanicobut you wouldn't be able to use C/C++ libraries then :)
16:50:44Trioxinyardanico, how? it's not clear to me looking at the backends page
16:50:56YardanicoTrioxin, "nim js myfile.nim" :P
16:51:02Araqdom96, very few features, no SQL, no concurrency required
16:51:35YardanicoTrioxin, also take a look at https://github.com/pragmagic/karax
16:51:38AraqRedBeard0531: yes, it's mostly a memory dump of the compiler's internals, can grow over 4GB
16:52:02Araqit also stores more than 1 symbolfile, it would be one database per Nim project
16:52:07dom96Araq: So why not just write your own?
16:52:19Trioxinyardanico, that doesn't tell me how I'd use jquery from my Nim code
16:52:40YardanicoTrioxin, https://nim-lang.org/docs/jsffi.html
16:53:15Yardanicoit has a jquery example :)
16:53:21dom96if you want a spec to implement then go for redis
16:53:31dom96In fact, I could have sworn there was an embedded implementation out there but I can't find it
16:54:31Trioxinthx
16:55:37dom96Trioxin: here is how to wrap websockets in JS: https://github.com/stisa/jswebsockets/blob/master/src/jswebsockets.nim
16:55:48dom96(jsffi is just a convenience, it's not necessary)
16:56:58*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:57:12FromGitter<RedBeard0531> Sidenode: I'm a bit confused about the meaning of "project" in nim. Does it correspond to a single compile target so each executable is its own project? Is it one nimble package? Something else?
16:57:20Trioxinyou have to include the .nim source file when you run the js?
16:57:32YardanicoTrioxin, what do you mean?
16:57:36TrioxinI see the .nim file referenced in todoapp.js
16:57:44FromGitter<RedBeard0531> no, the nim sources compile to a single .js file
16:57:46Yardanicoyour nim project will be compiled into one .js file
16:57:53Trioxinoh nvm, it's karax.nim
16:58:21YardanicoRedBeard0531: probably one nimble package, but I can't answer reliably :)
16:59:41*Ven`` joined #nim
17:02:16Araqa project is what you pass to 'nim c/js/cpp ...'
17:04:28FromGitter<RedBeard0531> That is somewhat confusing terminology because it means that unittests are a separate "project" from main program. I guess I can internalize that, but it isn't exactly intuitive
17:06:47Yardanicolol https://gist.github.com/filfat/d2ef7dffb50901064df06609d00f82ec
17:07:32*dandevelo joined #nim
17:12:22FromGitter<RedBeard0531> Harsh
17:13:06*dandevelo quit (Ping timeout: 260 seconds)
17:14:39dom96Good luck enforcing that in court
17:18:25Yardanicowell there's a plenty of "meme" licenses :)
17:18:33Yardanicolike this one or WTFPL
17:20:40FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a4a6de829ec6ac311a7ccc6]
17:20:45FromGitter<Quelklef> wait that's not code
17:28:28FromGitter<tim-st> what is the easiest way to iterate over a tuple? for now I manually do `for v in [t.field1, t.field2, t.field3]: ...`
17:28:51Yardanicotim-st: you can't iterate over tuple AFAIK
17:28:54FromGitter<data-man> I found https://github.com/radare/sdb (based on cdb)
17:29:01Yardanicomaybe you can use seq instead of a tuple?
17:29:09FromGitter<tim-st> @Yardanico ok, thanks!
17:29:17Yardanicowell you can of course make a macro with which you would be able to iterate over tuples
17:31:27FromGitter<Quelklef> ```iterator items[T](t: (T, T, T)): T = ⏎ for x in [t[0], t[1], t[2]]: ⏎ yield x``` [https://gitter.im/nim-lang/Nim?at=5a4a706e03838b2f2a5b88a8]
17:31:48FromGitter<Quelklef> But you'd have to do it for every length, so eh
17:32:05FromGitter<tim-st> @Quelklef Thanks, but my tuples are not all with 3 fields and I would like to iterate without mention items()
17:32:17FromGitter<tim-st> like in python
17:32:24FromGitter<Quelklef> `for val in iterable` is
17:32:32FromGitter<Quelklef> syntactic sugar for `for val in iterable.items`
17:32:36FromGitter<Quelklef> fyi
17:32:41FromGitter<tim-st> ah, nice thanks!
17:34:16*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:34:29FromGitter<tim-st> is it possible to find out tuple number of fields?
17:35:35FromGitter<Quelklef> I think if you want iterators for many kinds of tuples you need to write many iterators
17:35:47FromGitter<Quelklef> or one macro, like @Yardanico said
17:36:21Yardanicomaybe you need an array instead of a tuple?
17:36:25Yardanicoif you need to iterate over it
17:37:04FromGitter<tim-st> thanks you're right my proc could also return array
17:39:47FromGitter<data-man> https://github.com/yahoo/mdbm by Yahoo
17:40:14*iAmSlow joined #nim
17:42:01FromGitter<data-man> https://github.com/timrc-git/mdbm :-)
17:42:28*yglukhov joined #nim
17:44:30Araqyahoo's doesn't seem to run on Windows
17:45:43Araqoh well, I'll just use SQLite
17:46:49FromGitter<data-man> Why not LMDB?
17:53:47*Yardanico quit (Read error: Connection reset by peer)
17:56:55*S1t1Schu quit (Quit: Leaving)
17:57:07*S1t1Schu joined #nim
17:58:53*azur_kind quit (Remote host closed the connection)
17:58:54Araqdata-man: I never used LMDB
17:59:18CalinouI've never heard of LMDB
18:01:20*Yardanico joined #nim
18:07:10*yglukhov quit (Remote host closed the connection)
18:07:20*iAmSlow quit (Remote host closed the connection)
18:15:54*arecacea1 quit (Remote host closed the connection)
18:16:25*arecacea1 joined #nim
18:17:45*S1t1Schu quit (Quit: Leaving)
18:22:41dom96Any C++ experts here?
18:24:16*MJCaley joined #nim
18:43:42*rauss joined #nim
18:57:05*gokr joined #nim
18:59:58FromGitter<RedBeard0531> @dom96 what do you need?
19:01:00dom96http://coliru.stacked-crooked.com/a/b898ebc2fdd758a1
19:01:19dom96I cannot for the life of me get this thing to link :\
19:01:33dom96it seems to only affect static methods
19:02:25Araqleveldb seems good but has no windows support
19:03:43dom96hrm, or more worryingly, I've been getting by on just the methods defined in the header files
19:03:46dom96and the linking never worked
19:06:33FromGitter<RedBeard0531> llvm-config --libs all doesn't lincude libclang
19:07:36dom96hrm
19:08:11dom96yeah, I was assuming that my linking was correct because it's been working up until now, but I was lucky in that I was always just using functions defined in the header file
19:08:25dom96can't find the docs for linking against LLVM anymore grr
19:12:38*vivus joined #nim
19:18:16FromGitter<data-man> @Araq: I disagree with you about closing https://github.com/nim-lang/Nim/pull/6999 ⏎ I added there a comment.
19:18:38Yardanicodata-man: what do you mean by "koch web executes?"
19:19:59FromGitter<data-man> @Yardanico: What documentation is builded, only the tests are not run.
19:22:42*yglukhov joined #nim
19:25:25Araqok whatever
19:26:09*MJCaley quit (Quit: MJCaley)
19:27:58FromGitter<data-man> Thanks! :-)
19:29:54FromGitter<RedBeard0531> Is this a bug that this doesn't compile? https://play.nim-lang.org/?gist=1144a42cc60a146cc6373b4a55465aea It compiles if I change the return type to auto and cast the nil: https://play.nim-lang.org/?gist=2dfab3ecb9814baecb505316b06f5cd4
19:30:01dom96yeah, I needed -lclangAST and a couple others
19:30:10dom96This is why I hate C++ :P
19:32:04FromGitter<RedBeard0531> I have a love/hate relationship with C++. But I've been doing crazy shit with it for almost 10 years now.
19:32:22YardanicoRedBeard0531: because you're using "using", in rawGet proc arguments hhs is not generic
19:33:13Yardanicowell I can't describe it properly, but IDK if it's possible to use "using" with generic types
19:33:14FromGitter<RedBeard0531> Isn't it implicitly generic because HHSet is a generic prefix type (forget what that is called)
19:35:58Araqyeah I suppose it's a bug
19:36:07Araqit is implicitly generic
19:36:41FromGitter<RedBeard0531> @Araq: lmdb is pretty nice, but to make the most of it, you need good string slice/view types. It's claim to fame is zero-copy reads because it just hands you back a pointer to your value in the mmaped file.
19:36:53FromGitter<RedBeard0531> Ok, I'll file a GH issue
19:37:10YardanicoAraq, it's a bug with "using", I've encountered it too but assumed that it's a limitation of "using"
19:37:33Yardanicobut I didn't knew it was a bug :)
19:37:50FromGitter<RedBeard0531> Its odd that the hhs.Key argument works fine but the result type doesn't
19:39:26FromGitter<RedBeard0531> Its not a bug with using since it repros without it: https://play.nim-lang.org/?gist=048f795f28380e26c2d0a86b9658bece
19:39:28*PMunch joined #nim
19:41:49Yardanicowell yeah, it's a big with implicit generics
19:42:47FromGitter<data-man> @RedBeard0531: https://github.com/nim-lang/Nim/pull/5957
19:43:31FromGitter<RedBeard0531> https://github.com/nim-lang/Nim/issues/7006 Feel free to reword if I'm wrong about what the actual problem is
19:45:12*MJCaley joined #nim
19:47:19FromGitter<RedBeard0531> @data-man I've seen it and I'm generally a fan. Yesterday I converted my program to use cstring views rather than strings and it got 30% faster. It may have been even faster with a proper ptr+len, but I haven't tested that.
19:55:56*MJCaley quit (Quit: MJCaley)
19:57:56PMunchMerry Christmas and Happy New years everyone (or whichever combinations of holidays you might've partaken in since the last time I was on)
20:06:46dom96PMunch: Thanks! Same to you :)
20:15:16PMunchStill haven't been able to track down any cheap tickets to Bruxelles..
20:15:25PMunchBut I might consider doing it anyways :P
20:21:30*MJCaley joined #nim
20:22:04dom96yeah, do it :)
20:35:46*Yardanico[Phone] joined #nim
20:41:27*profkitkat quit (Remote host closed the connection)
20:47:39*Trioxin quit (Remote host closed the connection)
20:57:57FromGitter<RedBeard0531> @Yardanico @Araq Is this also a bug or am I misunderstanding how it it supposed to work: https://play.nim-lang.org/?gist=c6964305396f0dc057f6751b99c4d232
21:00:08dom96proc genericProc[T](s: Node[T]; key: s.T), is this what you want?
21:00:27FromGitter<RedBeard0531> Aren't those supposed to mean the same thing?
21:02:46dom96Hrm, i'm not sure.
21:03:01dom96I don't see why we need two syntaxes for this though
21:03:08FromGitter<RedBeard0531> Ugh, that ICEs the compiler: https://play.nim-lang.org/?gist=e091320ee32c5ed007886c22feaeb0c5
21:03:38dom96sorry, s/s.T/T/
21:04:17FromGitter<RedBeard0531> That works, but I think s.T is also supposed to work :/
21:04:29FromGitter<RedBeard0531> and it certainly shouldn't ICE
21:05:44dom96indeed
21:06:18*sz0 quit (Quit: Connection closed for inactivity)
21:13:35FromGitter<RedBeard0531> It triggers in oddly specific scenarios: https://github.com/nim-lang/Nim/issues/7008
21:20:04Araqit shouldn't crash but it also shouldn't work, you can't mix implicit and explicit generics in this way
21:20:46FromGitter<RedBeard0531> How is that mixing? That ICE case seems to be purely explicit generics.
21:21:11FromGitter<RedBeard0531> Once T is resolved, `s.T` is a concrete type
21:23:38FromGitter<RedBeard0531> If it makes you feel any better I've also found a number of bugs in g++ and clang++. I seem to push compilers in ways they aren't built for... :/
21:27:43dom96Araq: Are you aware that exceptions on the C++ backend are still broken? :(
21:27:52dom96Getting SIGSEGV instead of the exception...
21:28:49FromGitter<RedBeard0531> dom96: does this fix it for you: https://github.com/nim-lang/Nim/pull/6893
21:29:15dom96ooh
21:29:19dom96I shall check
21:30:16FromGitter<RedBeard0531> If you can require c++11 there is a better way to write it, but it seems like nim still targets c++98
21:30:52FromGitter<RedBeard0531> I've been meaning to ask if you have plans to switch to c++11 (or newer) any time soon.
21:31:40dom96Nope, the stack trace is longer, but still doesn't give error info
21:33:44dom96also, I answered your question in the PR :)
21:39:19FromGitter<RedBeard0531> Which compiler and what is the triggering code? I've seen a few of g++ bugs with exception handling
21:40:18dom96clang
21:40:24dom96it's an assert
21:40:30dom96full code is too long :)
21:45:14FromGitter<RedBeard0531> For that I usually like `onFailedAssert(msg): writeStackTrace(); quit msg` It seems like no good can come from stack unwinding when an assertion fails since the program is in an invalid state
21:47:06FromGitter<RedBeard0531> I like his take on it: http://joeduffyblog.com/2016/02/07/the-error-model/#bugs-arent-recoverable-errors
21:47:17*Vladar quit (Quit: Leaving)
21:48:58dom96sure, that's fine
21:49:14dom96The Nim spec even states that assert exceptions cannot be caught
21:49:39dom96but we should still output the assert message
21:52:08FromGitter<RedBeard0531> Actually it says: "This exception is only supposed to be caught by unit testing frameworks" which is very different from "cannot be caught"
21:52:42FromGitter<RedBeard0531> did it print "Error: unhandled exception" with my patch or did it not even get that far?
22:05:59dom96it didn't get that far
22:10:25*gokr quit (Ping timeout: 255 seconds)
22:11:19*gokr joined #nim
22:16:45*yglukhov quit (Remote host closed the connection)
22:21:09*iAmSlow joined #nim
22:21:52iAmSlowif i have string BLABLA.TSJJ how to get from right to left .TSJJ
22:22:13iAmSlowbut not last 5 inste last chars to .
22:23:06iAmSlowi guess i can make list of chars and loop from behind until i hit . but i guess there are some inbuild commands in strutilus or something
22:23:57FromGitter<RedBeard0531> iAmSlow: https://play.nim-lang.org/?gist=b427e7c73ab10526ae5979885cbba42b
22:27:28*nsf quit (Quit: WeeChat 2.0.1)
22:30:15YardanicoiAmSlow, split like in python?
22:30:17Yardanicorsplit
22:30:28Yardanicowell, or rfind :)
22:31:40iAmSlowFromGitter, <RedBeard0531> ty
22:31:41FromGitteriAmSlow, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
22:31:54iAmSlowwill try rsplit too
22:32:51*yglukhov joined #nim
22:33:03FromGitter<RedBeard0531> if this is for path manipulation check out https://nim-lang.org/docs/ospaths.html#splitFile,string (and the rest of that module)
22:35:42Yardanicowith rsplit:
22:36:15Yardanicolet data = rsplit(mystring, '.')[1]
22:36:20Yardanicobut it won't include the dot
22:37:26*yglukhov quit (Ping timeout: 260 seconds)
22:38:34FromGitter<RedBeard0531> I've managed to get the compiler to crash silently with no output: https://play.nim-lang.org/?gist=d8644be63702abcc70062ce6bd92489d Anyone got any tips for how to debug? For extra fun, `nim check` seems happy with this code :/
22:39:37*MJCaley quit (Quit: MJCaley)
22:40:53Yardanico./koch temp c <yourfile>.nim
22:40:59Yardanicoand you will see full compiler traceback :)
22:41:59dom96also, nim c --debuginfo compiler/nim, then 'gdb compiler/nim'
22:42:09dom96might help, maybe
22:45:30iAmSlowi think i am retarded , how do you use contain , am trying to get if string has some other string in itself , from what i see it returns bool as it shoud but i get mismatch pasing values
22:46:11iAmSlowif(contains(myString,'hasTHis'))
22:46:19iAmSlowtryed whit " " too
22:47:04iAmSlowmeyeb on documentations you can add simple example
22:47:29YardanicoiAmSlow, can you post full code?
22:47:40Yardanicobasically you don't need to use contains explicitly (but it should work anyway)
22:47:53Yardanicoah
22:47:57Yardanicomaybe you didn't import strutils?
22:48:20iAmSlowi think i did ,sec i check
22:48:28FromGitter<RedBeard0531> @dom96 @Yardanico thanks. Infinite recursion in the compiler: https://github.com/nim-lang/Nim/issues/7012. I think I'm done for the night.
22:48:40iAmSlowlol
22:48:45iAmSlowi dident xD
22:49:16iAmSlowduno why vscode offerd me contains if i dident iport it
22:49:42iAmSlowmeybe cuz i imported sequtils
22:50:11FromGitter<RedBeard0531> because contains is in system.nim as well, but that is the contains(string, char) overload, not the (string, string) overload
22:50:22Yardanicoare you sure?
22:50:27Yardanicocontains(string, char) is in strutils too
22:50:49FromGitter<RedBeard0531> https://nim-lang.org/docs/system.html#contains,openArray[T],T
22:51:03FromGitter<RedBeard0531> I think that matches strings when T == char
22:51:05Yardanicowell string is not an array of chars :)
22:51:07Yardanicono
22:51:18Yardanicostring is not only an array
22:51:23Yardanicowell I mean
22:51:27Yardanicoit's not defined like an array
22:51:43Yardanicoarray[.., char] would match it
22:51:45Yardanicobut not string
22:52:50Yardanicooh wait
22:52:53FromGitter<RedBeard0531> Yardanico: https://play.nim-lang.org/?gist=b53da3755d1f15521594b815082df6a3
22:52:53Yardanicoit works, wat :P
22:53:04FromGitter<RedBeard0531> :)
22:53:10Yardanicostrange :D
22:53:51Yardanicowell why there's duplicate in strutils then
22:53:52Yardanicohmm
22:54:30FromGitter<RedBeard0531> iAmSlow: also, you should probably never write `if contains(haystack, needle)`. Write `if needle in haystack` instead.
22:55:08FromGitter<RedBeard0531> They mean the same thing but the latter is more readable and idiomatic
22:56:05iAmSlowty
22:56:14Yardanicobasically `in` is just a shortcut for contains(x, y)
22:56:20Yardanicobecause `in` will still use the same proc
22:56:48Yardanicobasically the same as some magic methods in python
22:57:35iAmSlowsorry i come from c# so dont know magick stuff :)
22:58:14Yardanicowell it's not magic :)
23:15:17*dandevelo joined #nim
23:20:01*dandevelo quit (Ping timeout: 248 seconds)
23:21:40*natrys quit (Quit: natrys)
23:37:40*Yardanico quit (Read error: Connection reset by peer)
23:37:42GitDisc<NopeDK> Is the development docs available through the official page (i.e. "/docs" -> "/dev") or do we need to pull and compile to see the new stuff?
23:40:53*iAmSlow quit (Remote host closed the connection)
23:44:31dom96you need to pull and compile
23:45:02FromGitter<RedBeard0531> Is there a good way to serve the docs locally with all the bells and whisles?
23:46:18dom96./koch docs should do it
23:47:37*MJCaley joined #nim
23:48:10GitDisc<NopeDK> Thanks
23:48:13*gokr quit (Ping timeout: 256 seconds)
23:48:16FromGitter<RedBeard0531> That builds the docs but doesn't serve them. I tried serving the doc/html directory with `python3 -m http.server` and that works ok-ish, but it is missing things I use heavily like the interactive search.
23:53:38*gokr joined #nim
23:55:03FromGitter<data-man> ./koch web
23:56:42FromGitter<RedBeard0531> ditto, builds but doesn't serve
23:57:52*MJCaley quit (Quit: MJCaley)
23:58:37*endragor joined #nim