00:00:13 | dom96 | Happy 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:00 | GitDisc | <treeform> Happy new year |
01:20:31 | GitDisc | <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:19 | FromGitter | <Quelklef> why sqlite? |
03:42:17 | FromGitter | <Quelklef> wait |
03:42:33 | FromGitter | <Quelklef> lol i thought you were saying "Happy new year!! Fireworks and SQLite!!" |
03:45:56 | Yardanico | he did say that |
03:46:00 | * | Ven`` joined #nim |
03:46:28 | FromGitter | <Yardanico> ah |
03:48:13 | FromGitter | <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:31 | FromGitter | <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:52 | awesomelackware | !eval while true: echo(9) |
07:46:05 | * | awesomelackware left #nim (#nim) |
07:46:47 | NimBot | 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↵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:04 | FromGitter | <Quelklef> whaaa |
08:02:28 | FromGitter | <Quelklef> !eval 3 |
08:02:28 | NimBot | Compile failed: <no output> |
08:02:45 | FromGitter | <Quelklef> !eval echo "$1$2" % ["a", " b"] |
08:02:46 | NimBot | Compile failed: in.nim(1, 13) Error: undeclared identifier: '%' |
08:02:53 | FromGitter | <Quelklef> hmmmm |
08:03:51 | FromGitter | <Quelklef> !eval import strutils; echo("$1$2" % ["there once was a boy named", " jack"]) |
08:03:53 | NimBot | there 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:11 | FromGitter | <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:43 | Araq | data-man: why? |
10:22:02 | * | user0 joined #nim |
10:23:19 | FromGitter | <data-man> A mem-mapped reading/writing. |
10:24:35 | FromGitter | <data-man> https://github.com/pmwkaa/ioarena - benchmarking tool |
10:25:31 | FromGitter | <data-man> But unqlite is missing |
10:26:56 | FromGitter | <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:39 | FromGitter | <tim-st> @Araq are umlauts not allowed as first letter of tuple member? |
10:56:27 | * | yglukhov joined #nim |
11:03:52 | FromGitter | <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:41 | Araq | tim-st: not sure if the first character of an identifier can be a non-ascii |
11:15:23 | FromGitter | <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:58 | FromGitter | <stern0> Just wondering is Nim lang still single threaded?? |
11:54:40 | FromGitter | <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:13 | FromGitter | <tim-st> But unfortunately I can't use it as mixed type for something like HashMap |
12:10:11 | FromGitter | <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:31 | Araq | unsqlite.nim seems to be full of bugs |
14:18:53 | Araq | proc fetch*(self: UnQLite, key: string): string = |
14:18:53 | Araq | var |
14:18:53 | Araq | buf = "" |
14:18:53 | Araq | bufSize: int |
14:18:53 | Araq | check(unqlite_kv_fetch(self.db, key, -1, buf, addr bufSize)) |
14:18:54 | Araq | buf[0..<bufSize] |
14:19:01 | Araq | ^ 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:03 | FromGitter | <data-man> @Araq: Try https://github.com/fowlmouth/lmdb.nim :-) |
15:15:55 | FromGitter | <tim-st> @Araq is a recursive type definition for tuples planned or is this not possible/wanted? |
15:22:38 | Araq | type recursions have to go through a nominal type |
15:22:52 | Araq | everything else is a pita to deal with |
15:24:06 | FromGitter | <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:34 | FromGitter | <tim-st> but I dont have much knowledge in this area^^ |
15:25:58 | * | natrys joined #nim |
15:26:09 | Araq | the or type doesn't do what you think it does |
15:26:19 | Araq | it makes no sense to support it here |
15:27:34 | FromGitter | <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:56 | FromGitter | <tim-st> but maybe thats too hard to support |
15:29:49 | Araq | that description seems off. an or type is an implicit generic that is restricted to the types of the or type |
15:30:35 | Araq | Table[string|int, int] is **not** a table that takes strings or ints producing ints |
15:31:38 | FromGitter | <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:52 | Araq | no. |
15:32:25 | Araq | your idea is an ML like sum type, these are done with Nim's case objects. |
15:32:38 | FromGitter | <tim-st> yes, but objects are not constant |
15:32:42 | FromGitter | <tim-st> tuples are |
15:33:27 | Araq | so you want const case objects, just says so then. |
15:34:23 | * | vlad1777d joined #nim |
15:39:37 | FromGitter | <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:20 | Araq | the 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:50 | Araq | we cannot make it mean both just so that case objects get a sexier syntax. that is not how things work. |
15:42:32 | FromGitter | <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:54 | Araq | argh, which embedded DB to use... |
16:31:00 | Araq | there are so many of them |
16:32:32 | dom96 | what are you making? |
16:32:43 | Araq | --symbolFiles |
16:33:10 | Araq | want to base them on a simple embedded database, preferably with some support for compression |
16:33:59 | dom96 | what was wrong with the previous approach? |
16:34:12 | Araq | too complex, complexity breeds bugs |
16:36:37 | Araq | wanted to use "unsqlite", but https://unqlite.org/downloads.html mentions a "one-time fee of $20" |
16:37:05 | Araq | so I don't want to use it. |
16:37:55 | Araq | on the other hand, I can add compression on my own later with zlib or something |
16:39:23 | dom96 | use something that can be implemented in Nim easily |
16:39:29 | dom96 | so that we don't have a dependency |
16:40:05 | Araq | the dependency won't be used during bootstrapping, so it shoudl be fine |
16:40:17 | FromGitter | <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:45 | Araq | no "in-memory" database, I need the "store to disk" feature |
16:41:24 | FromGitter | <RedBeard0531> Wiredtiger is 64 bit only. |
16:41:41 | dom96 | most in-memory dbs have a "store to disk" feature |
16:42:32 | Araq | true but "in memory" is quite irrelevant. it needs to be embeddable though |
16:42:48 | Araq | more than anything else, I don't want to start yet another server |
16:42:58 | FromGitter | <RedBeard0531> Have you considered https://cr.yp.to/cdb.html. It is simple for simple needs. |
16:44:14 | Araq | never heard of it but the database can grow beyond 4GB |
16:45:12 | Araq | I don't need concurrency nor much more features than a key-value store offers |
16:45:28 | dom96 | what features do you need out of this db? |
16:45:32 | dom96 | does it need to be SQL? |
16:46:55 | FromGitter | <RedBeard0531> > GB symbolfiles?!?! |
16:47:20 | FromGitter | <RedBeard0531> err that was supposed to be >4GB, not a quote... |
16:47:40 | * | Trioxin joined #nim |
16:50:14 | Trioxin | can I use javascript libraries in Nim? like if I wanted to use jquery? |
16:50:22 | Yardanico | Trioxin, yes, you can |
16:50:26 | Yardanico | if you use JS as compile target |
16:50:43 | Yardanico | but you wouldn't be able to use C/C++ libraries then :) |
16:50:44 | Trioxin | yardanico, how? it's not clear to me looking at the backends page |
16:50:56 | Yardanico | Trioxin, "nim js myfile.nim" :P |
16:51:02 | Araq | dom96, very few features, no SQL, no concurrency required |
16:51:35 | Yardanico | Trioxin, also take a look at https://github.com/pragmagic/karax |
16:51:38 | Araq | RedBeard0531: yes, it's mostly a memory dump of the compiler's internals, can grow over 4GB |
16:52:02 | Araq | it also stores more than 1 symbolfile, it would be one database per Nim project |
16:52:07 | dom96 | Araq: So why not just write your own? |
16:52:19 | Trioxin | yardanico, that doesn't tell me how I'd use jquery from my Nim code |
16:52:40 | Yardanico | Trioxin, https://nim-lang.org/docs/jsffi.html |
16:53:15 | Yardanico | it has a jquery example :) |
16:53:21 | dom96 | if you want a spec to implement then go for redis |
16:53:31 | dom96 | In fact, I could have sworn there was an embedded implementation out there but I can't find it |
16:54:31 | Trioxin | thx |
16:55:37 | dom96 | Trioxin: here is how to wrap websockets in JS: https://github.com/stisa/jswebsockets/blob/master/src/jswebsockets.nim |
16:55:48 | dom96 | (jsffi is just a convenience, it's not necessary) |
16:56:58 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:57:12 | FromGitter | <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:20 | Trioxin | you have to include the .nim source file when you run the js? |
16:57:32 | Yardanico | Trioxin, what do you mean? |
16:57:36 | Trioxin | I see the .nim file referenced in todoapp.js |
16:57:44 | FromGitter | <RedBeard0531> no, the nim sources compile to a single .js file |
16:57:46 | Yardanico | your nim project will be compiled into one .js file |
16:57:53 | Trioxin | oh nvm, it's karax.nim |
16:58:21 | Yardanico | RedBeard0531: probably one nimble package, but I can't answer reliably :) |
16:59:41 | * | Ven`` joined #nim |
17:02:16 | Araq | a project is what you pass to 'nim c/js/cpp ...' |
17:04:28 | FromGitter | <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:47 | Yardanico | lol https://gist.github.com/filfat/d2ef7dffb50901064df06609d00f82ec |
17:07:32 | * | dandevelo joined #nim |
17:12:22 | FromGitter | <RedBeard0531> Harsh |
17:13:06 | * | dandevelo quit (Ping timeout: 260 seconds) |
17:14:39 | dom96 | Good luck enforcing that in court |
17:18:25 | Yardanico | well there's a plenty of "meme" licenses :) |
17:18:33 | Yardanico | like this one or WTFPL |
17:20:40 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a4a6de829ec6ac311a7ccc6] |
17:20:45 | FromGitter | <Quelklef> wait that's not code |
17:28:28 | FromGitter | <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:51 | Yardanico | tim-st: you can't iterate over tuple AFAIK |
17:28:54 | FromGitter | <data-man> I found https://github.com/radare/sdb (based on cdb) |
17:29:01 | Yardanico | maybe you can use seq instead of a tuple? |
17:29:09 | FromGitter | <tim-st> @Yardanico ok, thanks! |
17:29:17 | Yardanico | well you can of course make a macro with which you would be able to iterate over tuples |
17:31:27 | FromGitter | <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:48 | FromGitter | <Quelklef> But you'd have to do it for every length, so eh |
17:32:05 | FromGitter | <tim-st> @Quelklef Thanks, but my tuples are not all with 3 fields and I would like to iterate without mention items() |
17:32:17 | FromGitter | <tim-st> like in python |
17:32:24 | FromGitter | <Quelklef> `for val in iterable` is |
17:32:32 | FromGitter | <Quelklef> syntactic sugar for `for val in iterable.items` |
17:32:36 | FromGitter | <Quelklef> fyi |
17:32:41 | FromGitter | <tim-st> ah, nice thanks! |
17:34:16 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:34:29 | FromGitter | <tim-st> is it possible to find out tuple number of fields? |
17:35:35 | FromGitter | <Quelklef> I think if you want iterators for many kinds of tuples you need to write many iterators |
17:35:47 | FromGitter | <Quelklef> or one macro, like @Yardanico said |
17:36:21 | Yardanico | maybe you need an array instead of a tuple? |
17:36:25 | Yardanico | if you need to iterate over it |
17:37:04 | FromGitter | <tim-st> thanks you're right my proc could also return array |
17:39:47 | FromGitter | <data-man> https://github.com/yahoo/mdbm by Yahoo |
17:40:14 | * | iAmSlow joined #nim |
17:42:01 | FromGitter | <data-man> https://github.com/timrc-git/mdbm :-) |
17:42:28 | * | yglukhov joined #nim |
17:44:30 | Araq | yahoo's doesn't seem to run on Windows |
17:45:43 | Araq | oh well, I'll just use SQLite |
17:46:49 | FromGitter | <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:54 | Araq | data-man: I never used LMDB |
17:59:18 | Calinou | I'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:41 | dom96 | Any C++ experts here? |
18:24:16 | * | MJCaley joined #nim |
18:43:42 | * | rauss joined #nim |
18:57:05 | * | gokr joined #nim |
18:59:58 | FromGitter | <RedBeard0531> @dom96 what do you need? |
19:01:00 | dom96 | http://coliru.stacked-crooked.com/a/b898ebc2fdd758a1 |
19:01:19 | dom96 | I cannot for the life of me get this thing to link :\ |
19:01:33 | dom96 | it seems to only affect static methods |
19:02:25 | Araq | leveldb seems good but has no windows support |
19:03:43 | dom96 | hrm, or more worryingly, I've been getting by on just the methods defined in the header files |
19:03:46 | dom96 | and the linking never worked |
19:06:33 | FromGitter | <RedBeard0531> llvm-config --libs all doesn't lincude libclang |
19:07:36 | dom96 | hrm |
19:08:11 | dom96 | yeah, 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:25 | dom96 | can't find the docs for linking against LLVM anymore grr |
19:12:38 | * | vivus joined #nim |
19:18:16 | FromGitter | <data-man> @Araq: I disagree with you about closing https://github.com/nim-lang/Nim/pull/6999 ⏎ I added there a comment. |
19:18:38 | Yardanico | data-man: what do you mean by "koch web executes?" |
19:19:59 | FromGitter | <data-man> @Yardanico: What documentation is builded, only the tests are not run. |
19:22:42 | * | yglukhov joined #nim |
19:25:25 | Araq | ok whatever |
19:26:09 | * | MJCaley quit (Quit: MJCaley) |
19:27:58 | FromGitter | <data-man> Thanks! :-) |
19:29:54 | FromGitter | <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:01 | dom96 | yeah, I needed -lclangAST and a couple others |
19:30:10 | dom96 | This is why I hate C++ :P |
19:32:04 | FromGitter | <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:22 | Yardanico | RedBeard0531: because you're using "using", in rawGet proc arguments hhs is not generic |
19:33:13 | Yardanico | well I can't describe it properly, but IDK if it's possible to use "using" with generic types |
19:33:14 | FromGitter | <RedBeard0531> Isn't it implicitly generic because HHSet is a generic prefix type (forget what that is called) |
19:35:58 | Araq | yeah I suppose it's a bug |
19:36:07 | Araq | it is implicitly generic |
19:36:41 | FromGitter | <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:53 | FromGitter | <RedBeard0531> Ok, I'll file a GH issue |
19:37:10 | Yardanico | Araq, it's a bug with "using", I've encountered it too but assumed that it's a limitation of "using" |
19:37:33 | Yardanico | but I didn't knew it was a bug :) |
19:37:50 | FromGitter | <RedBeard0531> Its odd that the hhs.Key argument works fine but the result type doesn't |
19:39:26 | FromGitter | <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:49 | Yardanico | well yeah, it's a big with implicit generics |
19:42:47 | FromGitter | <data-man> @RedBeard0531: https://github.com/nim-lang/Nim/pull/5957 |
19:43:31 | FromGitter | <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:19 | FromGitter | <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:56 | PMunch | Merry 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:46 | dom96 | PMunch: Thanks! Same to you :) |
20:15:16 | PMunch | Still haven't been able to track down any cheap tickets to Bruxelles.. |
20:15:25 | PMunch | But I might consider doing it anyways :P |
20:21:30 | * | MJCaley joined #nim |
20:22:04 | dom96 | yeah, 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:57 | FromGitter | <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:08 | dom96 | proc genericProc[T](s: Node[T]; key: s.T), is this what you want? |
21:00:27 | FromGitter | <RedBeard0531> Aren't those supposed to mean the same thing? |
21:02:46 | dom96 | Hrm, i'm not sure. |
21:03:01 | dom96 | I don't see why we need two syntaxes for this though |
21:03:08 | FromGitter | <RedBeard0531> Ugh, that ICEs the compiler: https://play.nim-lang.org/?gist=e091320ee32c5ed007886c22feaeb0c5 |
21:03:38 | dom96 | sorry, s/s.T/T/ |
21:04:17 | FromGitter | <RedBeard0531> That works, but I think s.T is also supposed to work :/ |
21:04:29 | FromGitter | <RedBeard0531> and it certainly shouldn't ICE |
21:05:44 | dom96 | indeed |
21:06:18 | * | sz0 quit (Quit: Connection closed for inactivity) |
21:13:35 | FromGitter | <RedBeard0531> It triggers in oddly specific scenarios: https://github.com/nim-lang/Nim/issues/7008 |
21:20:04 | Araq | it shouldn't crash but it also shouldn't work, you can't mix implicit and explicit generics in this way |
21:20:46 | FromGitter | <RedBeard0531> How is that mixing? That ICE case seems to be purely explicit generics. |
21:21:11 | FromGitter | <RedBeard0531> Once T is resolved, `s.T` is a concrete type |
21:23:38 | FromGitter | <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:43 | dom96 | Araq: Are you aware that exceptions on the C++ backend are still broken? :( |
21:27:52 | dom96 | Getting SIGSEGV instead of the exception... |
21:28:49 | FromGitter | <RedBeard0531> dom96: does this fix it for you: https://github.com/nim-lang/Nim/pull/6893 |
21:29:15 | dom96 | ooh |
21:29:19 | dom96 | I shall check |
21:30:16 | FromGitter | <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:52 | FromGitter | <RedBeard0531> I've been meaning to ask if you have plans to switch to c++11 (or newer) any time soon. |
21:31:40 | dom96 | Nope, the stack trace is longer, but still doesn't give error info |
21:33:44 | dom96 | also, I answered your question in the PR :) |
21:39:19 | FromGitter | <RedBeard0531> Which compiler and what is the triggering code? I've seen a few of g++ bugs with exception handling |
21:40:18 | dom96 | clang |
21:40:24 | dom96 | it's an assert |
21:40:30 | dom96 | full code is too long :) |
21:45:14 | FromGitter | <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:06 | FromGitter | <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:58 | dom96 | sure, that's fine |
21:49:14 | dom96 | The Nim spec even states that assert exceptions cannot be caught |
21:49:39 | dom96 | but we should still output the assert message |
21:52:08 | FromGitter | <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:42 | FromGitter | <RedBeard0531> did it print "Error: unhandled exception" with my patch or did it not even get that far? |
22:05:59 | dom96 | it 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:52 | iAmSlow | if i have string BLABLA.TSJJ how to get from right to left .TSJJ |
22:22:13 | iAmSlow | but not last 5 inste last chars to . |
22:23:06 | iAmSlow | i 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:57 | FromGitter | <RedBeard0531> iAmSlow: https://play.nim-lang.org/?gist=b427e7c73ab10526ae5979885cbba42b |
22:27:28 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:30:15 | Yardanico | iAmSlow, split like in python? |
22:30:17 | Yardanico | rsplit |
22:30:28 | Yardanico | well, or rfind :) |
22:31:40 | iAmSlow | FromGitter, <RedBeard0531> ty |
22:31:41 | FromGitter | iAmSlow, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
22:31:54 | iAmSlow | will try rsplit too |
22:32:51 | * | yglukhov joined #nim |
22:33:03 | FromGitter | <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:42 | Yardanico | with rsplit: |
22:36:15 | Yardanico | let data = rsplit(mystring, '.')[1] |
22:36:20 | Yardanico | but it won't include the dot |
22:37:26 | * | yglukhov quit (Ping timeout: 260 seconds) |
22:38:34 | FromGitter | <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:53 | Yardanico | ./koch temp c <yourfile>.nim |
22:40:59 | Yardanico | and you will see full compiler traceback :) |
22:41:59 | dom96 | also, nim c --debuginfo compiler/nim, then 'gdb compiler/nim' |
22:42:09 | dom96 | might help, maybe |
22:45:30 | iAmSlow | i 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:11 | iAmSlow | if(contains(myString,'hasTHis')) |
22:46:19 | iAmSlow | tryed whit " " too |
22:47:04 | iAmSlow | meyeb on documentations you can add simple example |
22:47:29 | Yardanico | iAmSlow, can you post full code? |
22:47:40 | Yardanico | basically you don't need to use contains explicitly (but it should work anyway) |
22:47:53 | Yardanico | ah |
22:47:57 | Yardanico | maybe you didn't import strutils? |
22:48:20 | iAmSlow | i think i did ,sec i check |
22:48:28 | FromGitter | <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:40 | iAmSlow | lol |
22:48:45 | iAmSlow | i dident xD |
22:49:16 | iAmSlow | duno why vscode offerd me contains if i dident iport it |
22:49:42 | iAmSlow | meybe cuz i imported sequtils |
22:50:11 | FromGitter | <RedBeard0531> because contains is in system.nim as well, but that is the contains(string, char) overload, not the (string, string) overload |
22:50:22 | Yardanico | are you sure? |
22:50:27 | Yardanico | contains(string, char) is in strutils too |
22:50:49 | FromGitter | <RedBeard0531> https://nim-lang.org/docs/system.html#contains,openArray[T],T |
22:51:03 | FromGitter | <RedBeard0531> I think that matches strings when T == char |
22:51:05 | Yardanico | well string is not an array of chars :) |
22:51:07 | Yardanico | no |
22:51:18 | Yardanico | string is not only an array |
22:51:23 | Yardanico | well I mean |
22:51:27 | Yardanico | it's not defined like an array |
22:51:43 | Yardanico | array[.., char] would match it |
22:51:45 | Yardanico | but not string |
22:52:50 | Yardanico | oh wait |
22:52:53 | FromGitter | <RedBeard0531> Yardanico: https://play.nim-lang.org/?gist=b53da3755d1f15521594b815082df6a3 |
22:52:53 | Yardanico | it works, wat :P |
22:53:04 | FromGitter | <RedBeard0531> :) |
22:53:10 | Yardanico | strange :D |
22:53:51 | Yardanico | well why there's duplicate in strutils then |
22:53:52 | Yardanico | hmm |
22:54:30 | FromGitter | <RedBeard0531> iAmSlow: also, you should probably never write `if contains(haystack, needle)`. Write `if needle in haystack` instead. |
22:55:08 | FromGitter | <RedBeard0531> They mean the same thing but the latter is more readable and idiomatic |
22:56:05 | iAmSlow | ty |
22:56:14 | Yardanico | basically `in` is just a shortcut for contains(x, y) |
22:56:20 | Yardanico | because `in` will still use the same proc |
22:56:48 | Yardanico | basically the same as some magic methods in python |
22:57:35 | iAmSlow | sorry i come from c# so dont know magick stuff :) |
22:58:14 | Yardanico | well 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:42 | GitDisc | <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:31 | dom96 | you need to pull and compile |
23:45:02 | FromGitter | <RedBeard0531> Is there a good way to serve the docs locally with all the bells and whisles? |
23:46:18 | dom96 | ./koch docs should do it |
23:47:37 | * | MJCaley joined #nim |
23:48:10 | GitDisc | <NopeDK> Thanks |
23:48:13 | * | gokr quit (Ping timeout: 256 seconds) |
23:48:16 | FromGitter | <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:03 | FromGitter | <data-man> ./koch web |
23:56:42 | FromGitter | <RedBeard0531> ditto, builds but doesn't serve |
23:57:52 | * | MJCaley quit (Quit: MJCaley) |
23:58:37 | * | endragor joined #nim |