00:05:51 | * | gokr quit (Ping timeout: 248 seconds) |
00:24:53 | * | d10n-work quit (Quit: Connection closed for inactivity) |
00:42:17 | * | def-pri-pub joined #nim |
00:48:14 | * | libman joined #nim |
01:07:11 | * | ipjk quit (Quit: Leaving) |
01:11:06 | * | ipjk joined #nim |
01:18:00 | * | def-pri-pub quit (Quit: Leaving.) |
01:23:17 | * | astronavt joined #nim |
01:26:57 | * | def-pri-pub joined #nim |
01:45:58 | * | xkapastel joined #nim |
02:03:30 | * | d10n-work joined #nim |
02:06:37 | * | chemist69 quit (Ping timeout: 250 seconds) |
02:13:39 | * | def-pri-pub quit (Quit: Leaving.) |
02:20:45 | * | chemist69 joined #nim |
02:26:08 | * | nim_newb joined #nim |
02:27:50 | nim_newb | @dom I see you are working on improving the json.to macro. Last time I used it, it did not work for all integer types. Is that expected or going to be fixed now? |
02:29:23 | FromGitter | <zacharycarter> that's not the right dom nim_newb just fyi |
02:30:24 | * | ipjk quit (Read error: Connection reset by peer) |
02:31:11 | nim_newb | Ah. I meant @dom96 |
02:32:35 | * | rbrt quit (Quit: Oíche mhaith) |
02:44:23 | Tanger | o |
02:45:44 | * | marenz__ quit (Ping timeout: 255 seconds) |
02:48:58 | * | byte512 quit (Ping timeout: 264 seconds) |
02:51:33 | * | byte512 joined #nim |
02:55:56 | FromGitter | <RedBeard0531> Hi. I'm curious about the relationship between FileHandle/AsyncFD/AsyncFile. In particular, is doing something like this supposed to be valid? ⏎ let p = startProcess(cmd, options=flags) ⏎ let outputF = p.outputHandle.AsyncFD.newAsyncFile() |
02:57:05 | * | vlad1777d quit (Ping timeout: 248 seconds) |
02:59:05 | * | nim_newb quit (Ping timeout: 260 seconds) |
03:03:33 | * | Jesin joined #nim |
03:08:15 | * | endragor joined #nim |
03:08:17 | * | dddddd quit (Remote host closed the connection) |
03:09:39 | * | endragor quit (Remote host closed the connection) |
03:10:29 | * | endragor joined #nim |
03:36:55 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:40:06 | FromGitter | <zacharycarter> https://imgur.com/a/q04rs |
03:40:14 | FromGitter | <zacharycarter> getting prerendered sprites down for ldjam :D |
03:43:20 | FromGitter | <RedBeard0531> Why does all() from asyncfutures use .callback= rather than addCallback? This seems like a bug since it will prevent waking anyone else waiting on one of those futures. https://github.com/nim-lang/Nim/blob/ff7cb3ec66d52f0a76a80273162b3bc4b049c2ae/lib/pure/asyncfutures.nim#L336 (and #L358) |
03:50:07 | FromGitter | <RedBeard0531> I am trying to build a graph of nodes and tracked down a hang in `await all inputs.map(build)` to that. Changing all() to use addCallback solved the issue. |
03:57:34 | * | libman quit (Quit: Connection closed for inactivity) |
04:35:56 | FromGitter | <Varriount> @RedBeard0531 It would probably be best to either ask when @dom96 is around, or post in the forum, or post an issue. |
04:47:49 | * | skrylar joined #nim |
04:48:41 | * | nim_newb joined #nim |
04:49:19 | nim_newb | what is the `--run` equivalent for `nimble build` |
04:55:40 | * | xkapastel quit (Quit: Connection closed for inactivity) |
05:19:19 | * | xkapastel joined #nim |
05:29:04 | * | JappleAck joined #nim |
05:29:41 | * | how_do_I_even_ma joined #nim |
05:30:38 | how_do_I_even_ma | hi, I see that the list is long, but is anybody in here active right now? |
05:30:43 | * | astronavt quit (Remote host closed the connection) |
05:31:08 | how_do_I_even_ma | thats the opposite of what I was hoping for but thats cool |
05:31:30 | * | how_do_I_even_ma quit (Client Quit) |
05:34:14 | * | BitPuffin|osx joined #nim |
05:41:10 | * | gangstacat quit (Quit: Ĝis!) |
06:36:40 | * | nim_newb quit (Ping timeout: 260 seconds) |
06:38:25 | * | nsf joined #nim |
06:55:32 | skrylar | mratsim: so.. any opinions on flexnets? |
06:56:08 | skrylar | it seems like with distinct types we could probably have fixed precision ints that were pretty easy to use |
06:57:22 | FromGitter | <mratsim> Didn't have time to read the paper yet. trying to release Arraymancer 0.3 this weekend. |
07:06:00 | skrylar | ah. |
07:06:18 | skrylar | it sounds interesting but i don't know if i want to break all my tensors for it |
07:27:27 | * | JappleAck quit (Ping timeout: 248 seconds) |
07:30:46 | skrylar | mratsim: so am i correct in reading arraymancer has some magic thing where you can define math formulas like normal and its auto-arranging them in to calls |
07:31:22 | skrylar | my old c# code didn't use tensors, so slower but read pretty easy. the nim version does but its all manually crammed in to like 4 scratch tensors and hand-converted |
07:32:24 | FromGitter | <mratsim> It's an autograd, operations are traced in a graph and when you call backprop it triggers backward propagation on the graph. |
07:33:03 | skrylar | oh. not quite what i was looking for |
07:33:49 | skrylar | still just using torch7 style "simplenets" but it would be neat if i could just write the update formulas for GRUs instead of all this manual tensor_add tensor_mul stuff |
07:34:37 | FromGitter | <mratsim> Very short logistic regression example: https://github.com/mratsim/Arraymancer/blob/master/benchmarks/ex01_xor.nim |
07:35:41 | FromGitter | <mratsim> Or I directly exposes the primitives, here is torch vs Arraymancer: https://github.com/edubart/arraymancer-demos?files=1 |
07:36:05 | skrylar | well |
07:37:09 | skrylar | (hidden * value) + bias == scratch[0].set_mul(self.hidden, self.values); scratch[0].add(inputs, [...]) is more the pain in the arse |
07:37:51 | skrylar | did google register allocators and they are.. not simple |
07:39:57 | * | JappleAck joined #nim |
07:52:38 | * | sakalli joined #nim |
07:57:26 | * | sakalli quit (Ping timeout: 252 seconds) |
08:03:36 | * | Vladar joined #nim |
08:03:40 | FromGitter | <mratsim> Araq mentionned in the destructors blog post that it would be nice to lift `proc foo(a: Tensor, var result)` into something useable like this `let a = t.foo().foo().foo()` i.e. we can define the proc without a return variable but still use it in function chains like in Lua |
08:04:27 | FromGitter | <mratsim> sorry `proc foo(a: Tensor, result: var Tensor)` |
08:04:33 | * | gokr joined #nim |
08:14:15 | skrylar | i just recently encountered a use case for call chains |
08:23:13 | * | gangstacat joined #nim |
08:25:39 | * | xkapastel quit (Quit: Connection closed for inactivity) |
08:27:13 | * | PMunch joined #nim |
08:30:08 | * | claudiuinberlin joined #nim |
08:30:16 | FromGitter | <mratsim> So GUI programming is a hue pain in Python as well: https://www.reddit.com/r/learnprogramming/comments/7gclo8/where_to_start_gui_programming/ |
08:30:21 | FromGitter | <mratsim> huge* |
08:34:23 | miran | *hue paint :D |
08:45:37 | FromGitter | <Varriount> @mratsim I wonder how hard it would be to get UWP application running with Nim |
08:45:48 | FromGitter | <Varriount> (Universal Windows Application) |
08:50:12 | * | nim_newb joined #nim |
08:55:03 | skrylar | mratsim: gui programming is a pain everywhere. |
08:55:14 | skrylar | i'm working on it, but .. |
08:56:16 | skrylar | miglayout is deferred until i write this sparse matrix thing. |
08:57:20 | skrylar | that implementation ought to endgame laying out widgets by hand, since it's pretty easy to define stuff with tables |
08:57:47 | skrylar | cobweb (which sorta half works but mostly crashes) does dataflow, so that should take away managing so much UI state by hand |
09:06:57 | * | oprypin quit (Ping timeout: 240 seconds) |
09:10:05 | * | vlad1777d joined #nim |
09:10:27 | * | oprypin joined #nim |
09:24:29 | * | vlad1777d quit (Ping timeout: 276 seconds) |
09:37:59 | * | beaumonta joined #nim |
09:39:35 | * | abeaumont quit (Ping timeout: 240 seconds) |
09:39:36 | * | jivank[m] quit (Ping timeout: 240 seconds) |
09:39:38 | * | Vladar quit (Ping timeout: 240 seconds) |
09:39:59 | * | Vladar joined #nim |
09:42:16 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:42:16 | * | federico3 quit (Quit: WeeChat 1.9) |
09:42:49 | * | federico3 joined #nim |
09:42:57 | * | beaumonta quit (Ping timeout: 240 seconds) |
09:44:38 | * | jivank[m] joined #nim |
09:44:59 | * | sakalli joined #nim |
09:46:15 | * | nim_newb quit (Ping timeout: 260 seconds) |
09:48:42 | FromGitter | <tim-st> Another thing I didn't expect: I can use the iterator runes() and can compare each rune using a case but I cannot compare the runes by == operator, is that intended? |
09:49:10 | * | abeaumont joined #nim |
09:52:26 | FromGitter | <tim-st> Ok, I've seen now, that == is not defined on type Rune, although it's an int?! |
09:54:33 | * | BitPuffin|osx quit (Ping timeout: 258 seconds) |
09:59:15 | FromGitter | <mratsim> @skrylar, sparse matrix? Like Netflix's Vectorflow? |
10:02:26 | * | crem1 joined #nim |
10:03:20 | * | crem quit (Disconnected by services) |
10:05:07 | * | sakalli quit (Ping timeout: 260 seconds) |
10:05:15 | * | crem1 is now known as crem |
10:07:05 | skrylar | mratsim: haven't heard of it |
10:07:27 | skrylar | i just need one to store when someone puts a tall grid element in somewhere and it can check that it needs to skip over that cell |
10:08:32 | * | yaiyan quit (Ping timeout: 255 seconds) |
10:08:46 | * | Jipok[m]1 joined #nim |
10:08:46 | * | notdekka[m]1 joined #nim |
10:09:57 | * | EastByte quit (*.net *.split) |
10:09:58 | * | dyce[m] quit (*.net *.split) |
10:09:59 | * | notdekka[m] quit (*.net *.split) |
10:09:59 | * | Jipok[m] quit (*.net *.split) |
10:09:59 | * | gsingh93 quit (*.net *.split) |
10:09:59 | * | MightyJoe quit (*.net *.split) |
10:10:00 | * | FromGitter quit (*.net *.split) |
10:10:00 | * | Araq quit (*.net *.split) |
10:10:37 | * | Araq joined #nim |
10:11:44 | * | yaiyan joined #nim |
10:12:42 | * | redlegion quit (Ping timeout: 260 seconds) |
10:15:02 | * | redlegion joined #nim |
10:15:02 | * | redlegion quit (Changing host) |
10:15:02 | * | redlegion joined #nim |
10:15:19 | * | dyce[m] joined #nim |
10:15:25 | * | EastByte joined #nim |
10:15:26 | * | gsingh93 joined #nim |
10:15:26 | * | MightyJoe joined #nim |
10:15:26 | * | FromGitter joined #nim |
10:16:08 | FromGitter | <tim-st> Nice, didn't know that! |
10:21:14 | FromGitter | <nitely> I think most things in strutils now have a `ASCII` suffix to prevent that issue. But maybe the old procs/iterators/templates are still there for a deprecation period. I've not checked. |
10:22:07 | FromGitter | <nitely> not only coz of that, but coz they only work with ASCII |
10:23:46 | crem | Most of functions in strutils also work with characters other than ascii! Only the categorization (like isSpaceAscii) functions only categorize ascii, that's why they are called that way. |
10:24:23 | FromGitter | <nitely> well, I meant the ones with the ASCII suffix, otherwise that would be qute misleading |
10:24:32 | FromGitter | <nitely> *quite |
10:25:32 | FromGitter | <nitely> There are lots of them isUpperAscii, toLowerAscii etc |
10:26:07 | crem | Yes, those are geniune ASCII functions. :) |
10:30:39 | FromGitter | <tim-st> Does anyone has an idea how much slowdown runes() has vs. iterating over string index? Basically I'm not interested in every Rune I just want to detect them to know that the next char belongs to the previous.. |
10:31:07 | FromGitter | <tim-st> for example "ä" has len 2 and "a" len 1 |
10:31:22 | FromGitter | <andreaferretti> @mratsim I vote for RNN :-) |
10:33:29 | crem | For UTF-8 string, you can just check two upper bits of the codeunit. If it's 10, then it's continuation, else it's first beginning of a codepoint. |
10:34:01 | FromGitter | <tim-st> @crem that's exactly what I wanted to know, what would be the code? |
10:34:49 | FromGitter | <tim-st> I'm not skilled with bits^^ |
10:36:20 | crem | proc isUtf8Continuation(x: char): bool = return (x and 0xc) == 0x80 |
10:36:43 | FromGitter | <tim-st> @crem Thank you very much! |
10:37:26 | crem | (not tested but should work). Returns false for first byte of utf-8 char, true for the rest. |
10:37:51 | FromGitter | <tim-st> do you know what is the max. len of a unicode continuation? |
10:38:00 | FromGitter | <tim-st> "ä" was 2 is there a longer one? |
10:38:10 | crem | Hm, should char be converted to ints to be able to be compared to ints?... |
10:38:18 | crem | Yes, 4 is the longest possible length |
10:38:26 | crem | https://en.wikipedia.org/wiki/UTF-8#Description |
10:38:51 | FromGitter | <tim-st> Thanks! That will speed up my code very much |
10:39:13 | FromGitter | <tim-st> Because I expect many ascii chars |
10:39:46 | crem | fixed: proc isUtf8Continuation(x: char): bool = return (x.int and 0xc) == 0x80 |
10:39:54 | crem | (added .int) |
10:39:56 | Araq | I doubt it will speed up much, the runes iterator is no slug |
10:40:28 | FromGitter | <tim-st> @Araq Have now seen it in fastRuneAt, but will have a look |
10:44:05 | crem | I don't know what that depends on (readline library?), but in python REPL when I press up I go through history (also the line is editable, e.g. left-right arrows work), while `nim secret` just prints control codes. |
10:46:42 | Araq | koch boot -d:release -d:useLinenoise |
10:47:03 | Araq | maybe we can make it the default |
10:47:48 | FromGitter | <nitely> @tim-st be aware there are grapheme clusters, which are composed of many unicode characters although they visually look like a single character |
10:51:35 | skrylar | i dont know if araq ever took any of that skutf stuff ig ave him |
10:51:50 | Araq | nope, sorry, lost it |
10:51:51 | skrylar | i don't want to relive the unicode nightmare. already been there, learned about graphemes, and stremaing safe encodings, and bidi markers |
10:52:14 | Araq | unless it was some PR |
10:52:20 | Araq | then I probably merged it |
10:52:27 | skrylar | i don't think it was a pr |
10:52:32 | skrylar | you said you wanted it and i dumped it somewhere |
10:52:39 | skrylar | if i see it again i'll poke it |
10:52:47 | Araq | ty |
10:53:26 | skrylar | tl;dr efficiency goes to hell when unicode is involved |
10:53:44 | skrylar | technically unicode requires indefinite memory because there is no limit on how many diacritics can be on a single character |
10:53:50 | skrylar | you can have 500eb of bytes for one letter |
10:53:50 | crem | On my pre-previous job I wrote text layouting for bidirectional text! That's actually not that bad, Unicode standard describes it well. |
10:54:25 | skrylar | the "stream safe" encoding is 20, so that's what i set the limit to, and had a grapheme iterator that did let you just say "for every grapheme in this string" |
10:54:27 | FromGitter | <nitely> there is a practical limit of 30 characters according to some of the unicode annex |
10:54:42 | skrylar | nitely: there's a subset with that rule yes |
10:54:55 | FromGitter | <tim-st> @nitely Ok thanks, I think when runes() is performant I will start with this iterator, btw. can I call Rune.char() on every rune? what would be the return value if the rune has len 2,3,4 for example? |
10:55:20 | FromGitter | <tim-st> Didn't find it here: https://nim-lang.org/docs/unicode.html#Rune |
10:55:37 | skrylar | Araq, https://github.com/Skrylar/skUnicode herp |
10:56:28 | skrylar | ah yep, theres "iterator Utf8Graphemes" |
10:56:30 | skrylar | ^______^ |
10:56:56 | FromGitter | <nitely> @tim-st You cannot. Well you can, but won't work as expected. Use the `utf8` iterator if you just want the string version of unicode characters |
10:57:20 | FromGitter | <nitely> skrylar: https://github.com/nitely/nim-graphemes |
10:57:26 | FromGitter | <tim-st> No, I don't just want the string version, so it would throw an exception? |
10:57:59 | skrylar | nitely: nifty. |
10:58:05 | * | Ven`` quit (Ping timeout: 240 seconds) |
10:58:24 | skrylar | i know i did something more recently with the old skylights code. not sure if skUnicode still compiles |
10:58:30 | FromGitter | <nitely> @tim-st It won't. `char` will truncate the int and return some nonsence |
10:59:04 | FromGitter | <tim-st> @nitely So the method is not good at all? |
10:59:11 | FromGitter | <nitely> It will work fine for unicode characters lower than 256 |
10:59:38 | FromGitter | <nitely> the `char` for unicode? no. Don't use that for unicode |
10:59:56 | skrylar | import vicodent |
11:00:09 | FromGitter | <tim-st> @nitely Ok, thank you! |
11:00:32 | skrylar | so unicode (utf8) is a series of uint8s which have a pseudo-huffman prefix for length |
11:00:41 | skrylar | and then on top of that, varible length elements |
11:00:58 | Araq | skrylar, thanks, looks useful |
11:01:20 | skrylar | Araq, when i looked (before you broke case styling >:|) you had most of whats in there, except the grapheme and safe-split stuff |
11:02:31 | skrylar | looking over it, you do get utf-32 code points but they're unpacked and used for the grapheme object |
11:02:50 | skrylar | i had some normalization code but that never got ported from C |
11:04:33 | FromGitter | <nitely> skrylar: how that graphemes iterator works without looking the unicode database?? |
11:05:05 | Araq | any new unicode implementation should be generated from the unicode database so that updating it is easy |
11:06:00 | FromGitter | <nitely> skrylar: https://github.com/nitely/nim-normalize |
11:06:07 | FromGitter | <nitely> and https://github.com/nitely/nim-unicodedb |
11:06:08 | * | dyce[m] quit (Ping timeout: 255 seconds) |
11:06:13 | skrylar | you don't need the database for that |
11:06:17 | FromGitter | <nitely> Araq: but he ain't using no unicode database |
11:06:19 | skrylar | diacritics are above a certain range |
11:06:34 | skrylar | i DID have the database, for normalization and case changing |
11:06:36 | * | Demos[m] quit (Ping timeout: 255 seconds) |
11:06:46 | skrylar | with a neat little ruby script where you could ask for a fat db or a slimmer one |
11:06:53 | FromGitter | <nitely> mmmh, did you tested it o the test data provided by the unicode consortium |
11:07:05 | FromGitter | <nitely> I've been lied if that works |
11:07:14 | FromGitter | <mratsim> @andreaferretti RNNs would be cool but marketing-wise OpenCL would be the first. I'm not aware of Numpy-like tensor library with first class OpenCL support. |
11:07:32 | skrylar | i did rnns kinda. |
11:07:36 | skrylar | GRUs. |
11:07:55 | skrylar | I mean elman layers in C# but who uses those anymore? |
11:08:00 | * | sz0 joined #nim |
11:08:02 | skrylar | usually when they say 'rnn' they mean 'lstm' |
11:09:42 | skrylar | nitely: technically they COULD add more diacritics outside the BMP plane, then skUnicode would be derpy about those |
11:10:18 | skrylar | So would every other unicode app, which does a worse job on average |
11:10:27 | skrylar | ex. .net/java with their 16-bit chars |
11:11:12 | FromGitter | <nitely> Does it work with nim 0.17? I'll try it and let you know |
11:11:46 | skrylar | doubt it. last time it was touched was many versions ago |
11:13:42 | * | Jipok[m]1 quit (Ping timeout: 246 seconds) |
11:13:43 | FromGitter | <nitely> if it does works, it does not make sence why would recommend using a DFA |
11:13:47 | * | shashlick quit (Ping timeout: 252 seconds) |
11:13:47 | * | macsek1911[m] quit (Ping timeout: 252 seconds) |
11:13:57 | FromGitter | <nitely> *why would they recommend |
11:14:03 | * | watzon quit (Ping timeout: 246 seconds) |
11:14:08 | * | ehmry quit (Ping timeout: 240 seconds) |
11:14:09 | * | TheManiac quit (Ping timeout: 240 seconds) |
11:14:09 | * | byteflame quit (Ping timeout: 240 seconds) |
11:14:09 | * | planetis[m] quit (Ping timeout: 240 seconds) |
11:14:10 | * | MrAxilus[m] quit (Ping timeout: 240 seconds) |
11:14:25 | * | Miguelngel[m] quit (Ping timeout: 246 seconds) |
11:14:32 | skrylar | there are a lot of random things in that spec |
11:14:46 | * | notdekka[m]1 quit (Ping timeout: 264 seconds) |
11:14:47 | * | unclechu quit (Ping timeout: 264 seconds) |
11:14:47 | * | jivank[m] quit (Ping timeout: 255 seconds) |
11:14:53 | skrylar | one of which is like, a 400-rule setup for Korean |
11:14:53 | * | hohlerde quit (Ping timeout: 252 seconds) |
11:15:16 | * | floppydh joined #nim |
11:16:04 | skrylar | for fun, actually try to put korean or japanese in to random programs some time |
11:16:16 | skrylar | you'll find out a lot of "unicode aware" software butchers it completely |
11:16:28 | skrylar | or inconsistently supports it and then has random ???'s in the same window |
11:23:36 | FromGitter | <tim-st> btw is there any downside/difference in using a += 1 instead of inc(a) ? |
11:24:11 | Araq | maybe slower debug builds |
11:24:37 | FromGitter | <tim-st> but the compiler should translate it the same, or? |
11:24:56 | FromGitter | <nitely> skrylar: there's at least a few graphemes that code won't work on. Emojis. |
11:25:02 | * | nim_newb joined #nim |
11:25:52 | skrylar | nitely: it was always called conversational for a reason |
11:25:56 | FromGitter | <nitely> Some do not have a character combinator |
11:26:08 | skrylar | well you mean emojis as in lenny? |
11:26:31 | FromGitter | <nitely> I mean unicode emojis |
11:26:43 | skrylar | ( ͡° ͜ʖ ͡°) is multiple graphemes |
11:26:55 | FromGitter | <nitely> http://unicode.org/emoji/charts/full-emoji-list.html |
11:27:17 | skrylar | browsers trying to load it |
11:27:21 | FromGitter | <nitely> that's not an emoji according to unicode though |
11:27:29 | FromGitter | <nitely> ahahaha |
11:27:33 | skrylar | going to hazard a guess that those are outside the BMP plane |
11:28:23 | FromGitter | <nitely> :P |
11:28:38 | skrylar | the original skUtf code (which was C99, and partly ported as skUnicode) carried with it a warning that non-BMP stuff was where dragons lay |
11:29:03 | skrylar | the rule that just checks the numbers was also there for if you *didn't* include the database module |
11:29:29 | skrylar | because the database is like 60mb or some shit, and ~1mb when selectively trimmed and using weird indexes |
11:29:59 | FromGitter | <nitely> there are techniques to make it waaaay lighter |
11:30:10 | skrylar | i used them |
11:30:15 | skrylar | it's still megabytes. |
11:30:24 | FromGitter | <nitely> https://github.com/nitely/nim-unicodedb#sizes |
11:30:30 | FromGitter | <nitely> take a look |
11:30:43 | skrylar | the ruby script had an option to do one that was 'just' diacritics and casing, no names and it merged some stuff |
11:30:57 | skrylar | i forget the name of the technique that was also involved to get the size of indexes down |
11:31:14 | FromGitter | <nitely> multi-stage tables |
11:31:27 | Araq | nitely, nice things. any chance of getting some of that into the stdlib? |
11:31:44 | FromGitter | <nitely> all of it. If you want it |
11:31:58 | skrylar | time to bookmark multistage tables all over again |
11:32:09 | Araq | is it compatible with unicode.nim? |
11:33:08 | FromGitter | <nitely> It is |
11:33:49 | FromGitter | <nitely> I would put the unicodedb in its own module though |
11:34:29 | FromGitter | <nitely> well that's what python does. There's not really a reason to |
11:36:11 | Araq | own module would be good, not sure though the existing unicode does have some lookup tables |
11:36:16 | Araq | outdated ones. |
11:37:49 | FromGitter | <nitely> although go-lang does not has all of this (normalize, graphemes, etc) in the stdlib and it's doing fine.. |
11:38:12 | FromGitter | <nitely> another option would making it an official library or something |
11:41:03 | Araq | another official unicode package is fine with me, but what do we do about keeping unicode.nim up to date? |
11:43:34 | * | marenz__ joined #nim |
11:44:56 | Araq | ugh, my shared pointers finally compile... |
11:45:07 | Araq | that was a pita to implement |
11:46:39 | Araq | speaking of which how do I get an atomic swap in C++? |
11:47:32 | FromGitter | <nitely> Araq: I dunno how the current tables where generated for the unicode module, but I would guess that's how you would keep them up to date |
11:48:05 | Araq | I took them from Plan 9 manually XD |
11:48:16 | FromGitter | <nitely> hahahaha XD |
11:49:13 | skrylar | well.. plan 9 did many goods. |
11:52:35 | crem | Araq: in C++ you can only atomically swap std::atomic<T>s (with atomic_exchange). |
11:53:36 | Araq | crem, my goal is that swap(p1, p2) can be used to exchange pointers in a threaded program |
11:54:00 | Araq | but I read it requires double CAS which C++ doesn't have since the hardware usually doesn't offer it |
12:00:57 | * | BitPuffin|osx joined #nim |
12:04:30 | * | nim_newb quit (Ping timeout: 260 seconds) |
12:26:39 | * | Jipok[m] joined #nim |
12:28:14 | * | Snircle joined #nim |
12:35:17 | FromGitter | <RedBeard0531> @tim-st if you expect mostly |
12:37:29 | * | MrAxilus[m] joined #nim |
12:37:29 | * | watzon joined #nim |
12:37:30 | * | dyce[m] joined #nim |
12:37:30 | * | Miguelngel[m] joined #nim |
12:37:30 | * | ehmry joined #nim |
12:37:30 | * | Demos[m] joined #nim |
12:37:30 | * | unclechu joined #nim |
12:37:36 | * | jivank[m] joined #nim |
12:37:36 | * | byteflame joined #nim |
12:37:36 | * | macsek1911[m] joined #nim |
12:37:36 | * | notdekka[m] joined #nim |
12:37:36 | * | shashlick joined #nim |
12:37:37 | * | planetis[m] joined #nim |
12:37:37 | * | TheManiac joined #nim |
12:37:37 | * | hohlerde joined #nim |
12:44:02 | * | mal`` quit (Quit: Leaving) |
12:44:21 | FromGitter | <RedBeard0531> (Blarg didn't mean to hit send yet) @tim-st if you expect mostly ascii and care about perf you should try to avoid doing byte-by-byte or rune-by-rune processing. Utf8 is amenable to simd processing of 16 bytes at a time. As an example of case folding in simd https://github.com/mongodb/mongo/blob/master/src/mongo/db/fts/unicode/string.cpp#L170-L256 |
12:47:50 | FromGitter | <RedBeard0531> I was somewhat sad to see that all of the string processing in the stdlib was byte by byte. @Araq any plans to add native simd support to the language? |
12:54:14 | * | mal`` joined #nim |
12:56:55 | Araq | PRs welcome |
13:00:17 | * | JappleAck quit (Ping timeout: 276 seconds) |
13:00:28 | FromGitter | <RedBeard0531> I can pr the algorithms, but I don't feel comfortable adding simd to the core language. I only started using nim a week ago :) |
13:01:19 | Araq | well it's not that you won't get any help with the PRs |
13:05:32 | FromGitter | <Varriount> How good are C/C++ compilers at vectorization? |
13:06:10 | * | nsf quit (Quit: WeeChat 1.9.1) |
13:06:46 | crem | You can test at https://godbolt.org/, generally pretty good. |
13:06:54 | crem | Especially clang. |
13:07:15 | FromGitter | <RedBeard0531> meh |
13:08:07 | FromGitter | <RedBeard0531> they can do a lot (sometimes borderline magical) but they also trip own their own feet frequently enough |
13:09:36 | FromGitter | <RedBeard0531> Also, they can't rewrite the algorithm to be more simd-friendly. They also aren't allowed to read any bytes of memory that they can't prove would be read otherwise. This gets really hard when you need to call out to other functions in your slow path. |
13:10:28 | FromGitter | <Varriount> @RedBeard0531 I'm all for a "SIMD" module, however one has to keep in mind that Nim has backends other than C/C++ |
13:11:53 | FromGitter | <RedBeard0531> Sure, I assume there'd be something like a `when simd:` block. You always need the byte-by-byte fallback for short strings anyway. |
13:12:59 | FromGitter | <RedBeard0531> Also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SIMD :) (although I now see that attempt was aborted) |
13:17:34 | * | JappleAck joined #nim |
13:18:01 | * | skrylar quit (Ping timeout: 268 seconds) |
13:19:18 | FromGitter | <mratsim> You can ask jcosborn or jlp675 (something like that): https://github.com/jcosborn/qex/blob/master/src/simd/simdAvx.nim |
13:21:20 | FromGitter | <mratsim> Btw there is an article currently on HN about Faster, a Rust simd wrapper. And a discussion about runtime feature detection. (Not unlike what is talked about in the forum) |
13:25:14 | FromGitter | <mratsim> Also one of the best way to ensure efficient code is to use restrict and builtin_assume_aligned |
13:28:59 | FromGitter | <RedBeard0531> Actually gcc generates better code (at least for avx-capable cpus) if you tell it to assume that the buffer is completely *unaligned*. AVX has full support for unaligned access, but gcc still tries *really* hard to inject an alignment prolog/epilog. I once benchmarked a 2x improvement in a trivial example by adding a pragma to indicate that the buffer was unaligned. |
13:30:15 | FromGitter | <RedBeard0531> and many string processing algorithms rely on unaligned reads |
13:30:34 | FromGitter | <mratsim> It doesn't use avx2 instructions if it's unaligned though |
13:31:14 | FromGitter | <alehander42> Araq: I am adding js codegenDecl support currently ⏎ The ref says ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5a2008223ae2aa6b3f6c20d0] |
13:31:24 | FromGitter | <mratsim> Well I don't know for strings I only tested for numrical computing. |
13:38:02 | dom96 | alehander42: https://github.com/nim-lang/Nim/pull/6841#issuecomment-348189957 |
13:40:31 | * | kier quit (Remote host closed the connection) |
13:45:03 | FromGitter | <alehander42> @dom96 overally, `emit` was the wrong tool for changing codegen for a function delcaration and `codegenDecl` seems perfect, so I am adding support for `codegenDecl` in the js backend |
13:45:25 | dom96 | yes, I see that |
13:45:30 | dom96 | I still don't think this is necessary however :) |
13:45:47 | dom96 | So please answer my question |
13:46:02 | dom96 | oh, I see you did |
13:46:28 | FromGitter | <alehander42> yep, I fail to see why do you expect `{.emit.}` to be generated immediately before a function |
13:46:46 | dom96 | what I have in mind is to generate the entire function and put it in an emit |
13:47:13 | FromGitter | <alehander42> how can I generate the js source of a function in a macro ? |
13:47:22 | dom96 | but now that I think about it some more that would be a lot of duplication |
13:47:24 | Araq | that JS doesn't support .codegenDecl is an inconsistency anyway |
13:47:27 | FromGitter | <alehander42> (and still a codegenDecl solution seems more beautiful for me) |
13:48:03 | dom96 | oh, I thought it was a new feature |
13:48:12 | dom96 | since it exists already then sure, sounds perfect |
13:48:26 | FromGitter | <alehander42> ah yeah it seems to work for C |
13:48:35 | Araq | even better. It's a documented feature :-) |
13:49:23 | FromGitter | <alehander42> yeah, so again, Araq: for codegenDecl and js the first parameter (return type) doesn't make much sense: should I always keep it an empty string? |
13:50:05 | Araq | not sure, how does asm.js annotate the return type? it doesn't, right? |
13:50:21 | * | xet7 quit (Quit: Leaving) |
13:50:35 | Araq | to keep it future proof it seems wise to map the return type in .codegenDecl |
13:50:51 | Araq | even though it's currently impossible to make use of |
13:50:57 | FromGitter | <alehander42> > An asm.js function's formal return type is determined by the last statement in the function body, which for non-void functions is required to be a ReturnStatement. This distinguished return statement may take one of five forms: |
13:51:21 | FromGitter | <alehander42> ok |
13:51:40 | Araq | omg, asm.js is an abomination |
13:51:42 | dom96 | also, it seems that 'await' support is actually pretty good https://caniuse.com/#search=await |
13:52:00 | dom96 | 71% support based on usage |
13:52:46 | Araq | 71% is pretty good |
13:53:30 | dom96 | Another thing regarding the PR: can we avoid introducing a new module and implement this in asyncdispatch? |
13:54:23 | Araq | not wise, it would be a long 'when defined(js): ... else: ...' section |
13:54:40 | Araq | you can move the impls to include files |
13:55:07 | Araq | but it's still messy. maybe we just switch the stdlib path for the JS target |
13:57:17 | dom96 | we already have a 'when' in asyncdispatch |
13:57:45 | FromGitter | <alehander42> I am not sure which option is better, another idea I had was to include it in `jsffi` as people usually import it for js code |
13:58:09 | FromGitter | <alehander42> including it in asyncdispatch doesn't sound bad too |
13:59:08 | dom96 | the idea is to allow code written for the C backend to work on the JS backend as well |
13:59:10 | dom96 | (as much as possible) |
13:59:36 | Araq | asyncfile -- impossible? |
13:59:44 | Araq | async sockets -- possible? |
13:59:51 | dom96 | some modules are impossible indeed |
14:00:22 | Araq | JS is a messy target I would keep the core libraries clean tbh |
14:01:10 | dom96 | it will be clean, it will all be under a define |
14:01:27 | FromGitter | <alehander42> maybe including an asyncjs file in asyncdispatch for defined(js) would be a good compromise |
14:02:41 | FromGitter | <RedBeard0531> Since asyncdispatch was mentioned, is there any way to get the generated docs to be better? They seem to be missing a *lot* of the available functionality. For example, the Future type can't be found and the ability to wait on Events and processes is only visible if you go read all the code. |
14:03:09 | Araq | the ability to wait on events and processes is new |
14:03:24 | Araq | docs are constantly improving |
14:03:45 | Araq | more automatic linking is probably the next big thing the docgen needs to do |
14:03:47 | dom96 | RedBeard0531: please create issues for these sorts of things |
14:05:57 | FromGitter | <RedBeard0531> Are the docs supposed to represent master or 0.17.2? The source links go to master, so that is what I end up reading when I dig in. |
14:06:07 | dom96 | 0.17.2 == master |
14:07:58 | * | FromGitter * RedBeard0531 must have flipped to devel when browsing github at some point last night. That explains a lot... :-/ |
14:09:12 | FromGitter | <RedBeard0531> oh, its the default branch. So if you enter from docs you go to master, if you enter from github you go to devel. |
14:10:56 | FromGitter | <RedBeard0531> @dom96 (reposting from last night now that you are online) Why does all() from asyncfutures use .callback= rather than addCallback? This seems like a bug since it will prevent waking anyone else waiting on one of those futures. https://github.com/nim-lang/Nim/blob/ff7cb3ec66d52f0a76a80273162b3bc4b049c2ae/lib/pure/asyncfutures.nim#L336 (and #L358) ⏎ I am trying to build a graph of nodes and tracked down a hang in |
14:10:56 | FromGitter | ... `await all inputs.map(build)` to that. Changing all() to use addCallback solved the issue. |
14:11:12 | niv | TWIMC, nim is used to build the data files for a recent game release (Neverwinter Nights: Enhanced Edition)! https://github.com/niv/neverwinter_utils.nim it has saved us SO much time. |
14:11:43 | Araq | wth ... that is awesome :-) |
14:12:33 | dom96 | RedBeard0531: addCallback is a relatively recent addition, please make an issue for this or better yet a PR :) |
14:12:34 | niv | the old tooling was in c++ from 15 years ago, partially lost in time. rewriting it took me a couple of days and it was totally worth it. |
14:13:27 | FromGitter | <RedBeard0531> @dom96 will do. Just wanted to make sure it wasn't intentional and I was missing some subtlety. |
14:14:20 | dom96 | niv: ooh, didn't realise you were making an enhanced edition for Neverwinter Nights! :O |
14:14:28 | niv | consider yourself informed! |
14:16:30 | dom96 | Can I tweet about it? :) |
14:16:40 | niv | feel free |
14:16:56 | niv | tag #neverwinternights and @beamdog if you want to ;) |
14:18:45 | dom96 | done |
14:19:07 | niv | fancy, with a pic. awesome. |
14:19:17 | * | nim_newb joined #nim |
14:19:29 | nim_newb | @dom96 :point_up: [November 30, 2017 7:57 AM](https://gitter.im/nim-lang/Nim?at=5a1f6ca6ba39a53f1aff9834) |
14:20:17 | dom96 | nim_newb: yes, thanks. I saw that. You should really create issues for this sort of thing though. Do you have a code sample that reproduces the problem? |
14:20:17 | * | dddddd joined #nim |
14:20:39 | nim_newb | I had a code sample. let me check. |
14:20:45 | FromGitter | <zacharycarter> I <3 NWN |
14:21:43 | * | MJCaley joined #nim |
14:22:45 | FromGitter | <mratsim> Baldur's Gate > NWN. |
14:22:46 | dom96 | I still need to play some Baldur's Gate: Enhanced edition ;) |
14:22:57 | niv | me too, if it's any consolation |
14:23:30 | FromGitter | <zacharycarter> Baldur's Gate is great but NWN was special |
14:23:48 | FromGitter | <zacharycarter> mostly because of the ability to create your own campaigns and play online, this of course was before BG:EE |
14:24:12 | FromGitter | <zacharycarter> @dom96 - Did you see my pre-rendered sprite from last night? |
14:24:21 | niv | @zacharycarter: online community is still going fairly strong, with peak players of about 600/day |
14:24:50 | FromGitter | <zacharycarter> @niv if I didn't spend all my time making games / tooling I'd probably try to get involved |
14:25:05 | niv | https://neverwintervault.org/ |
14:25:20 | FromGitter | <zacharycarter> thanks |
14:25:22 | dom96 | zacharycarter: nope, link? |
14:25:37 | FromGitter | <zacharycarter> https://imgur.com/a/q04rs |
14:26:05 | FromGitter | <zacharycarter> just using mixamo and blender - but I think it will allow me to quickly pump out isometric sprite art for LD |
14:26:26 | nim_newb | @dom96 Here is an example https://play.nim-lang.org/?gist=916724ab3aa3c4e676311fb427773dd5 |
14:27:00 | dom96 | nim_newb: thanks, i'll fix it |
14:27:20 | Araq | once it's fixed we need to optimize it ... |
14:27:50 | Araq | it creates the full JSON and then converts it to native Nim types, that's not required |
14:27:58 | nim_newb | @dom96 - this issue is also for float types |
14:28:09 | FromGitter | <mratsim> Yeah I probably spent more time creating monsters and maps in NWN than coding in Nim (for now). The Aurora engine was awesome. |
14:28:27 | FromGitter | <zacharycarter> agreed |
14:28:52 | FromGitter | <mratsim> For BG2 I'm quite content with the base BG2 + mods like SCS (sword coast stratagems). |
14:29:01 | niv | if you want to get involved with the EE, check out the beamdog forums instead. more activity related to that. |
14:29:58 | * | dddddd_ joined #nim |
14:30:04 | FromGitter | <zacharycarter> niv: do you work for beamdog? |
14:30:14 | niv | yes |
14:30:22 | * | dddddd quit (Ping timeout: 264 seconds) |
14:30:24 | FromGitter | <zacharycarter> Cool :D Any Nim programmer job openings? |
14:30:27 | FromGitter | <mratsim> Now if NWN 1 is rewritten in Nim hum hum, maybe I'll build neural networks for NWN :D. What do you think @skrylar? |
14:30:35 | niv | haha. i'll post here if that ever happens. |
14:30:43 | dom96 | Araq: You mean you want it to use only the json parser directly? |
14:30:50 | FromGitter | <zacharycarter> :D sweet! |
14:30:51 | Araq | yes |
14:30:57 | dom96 | Araq: PRs welcome ;) |
14:31:10 | niv | nwn1 in nim? omg. i can't even imagine the amount of work that would be. |
14:31:19 | * | dddddd_ is now known as dddddd |
14:31:55 | FromGitter | <mratsim> I meant an API, scripting engine or something. |
14:32:21 | Araq | dom96, in retrospect I wonder why we didn't adapt marshal.nim to use getType() |
14:32:37 | niv | wait a week or so and we'll have nwnx ported over. (tl;dr: a preloadable for the server that allows you to do anything you want to it) |
14:33:20 | dom96 | niv: what does the rest of beamdog think of Nim? :) |
14:33:32 | * | nsf joined #nim |
14:33:46 | niv | happy with the tooling. and it's better than D. |
14:34:12 | dom96 | awesome |
14:34:23 | dom96 | means we're doing something right :) |
14:34:45 | niv | it's not really widely used or anything. this is the only project so far, and the main driver behind it was me. |
14:34:53 | niv | but It Works(tm) |
14:36:04 | FromGitter | <mratsim> I'm pretty sure a blog post on that would be a hit in r/gaming, r/programming and HN. |
14:36:15 | dom96 | ^^ |
14:36:29 | FromGitter | <mratsim> Might be too much pressure after though. |
14:36:41 | dom96 | Happy to accept a guest post on nim-lang.org if you're up for it :) |
14:36:52 | niv | hrrrrmmmh |
14:38:44 | PMunch | Cool to see that more and more people are using Nim for actual serious stuff :) |
14:41:17 | FromGitter | <mratsim> "serious" + games ? Some might disagree ;). |
14:41:38 | PMunch | Serious as in business serious, not as in application serious :) |
14:42:02 | niv | oh, nwn is quite is SRZ BIZNEZ if you listen to some online community members |
14:42:22 | PMunch | Haha, I don't doubt it |
14:43:56 | Araq | niv, GC vs no-GC? |
14:44:14 | niv | definitely GC as far as I am concerned. the nim GC gets out of the way nicely |
14:46:16 | PMunch | niv, make sure to give me a call if you need more nim devs in the future :) |
14:46:35 | niv | if i were writing a realtime game that has hard limits for each frame, i might reconsider. haven't evaluated the GC from that standpoint. but for tooling and network server daemons, it's great. |
14:46:47 | * | endragor quit (Remote host closed the connection) |
14:48:02 | * | MJCaley quit (Quit: MJCaley) |
14:48:18 | Araq | I'm thinking about a data driven approach for MM but so far no good ideas came up |
14:51:53 | * | endragor joined #nim |
14:52:19 | FromGitter | <mratsim> MM ? Matrix Multiplication :D? |
14:52:26 | PMunch | Would be fun to get into game-dev again :) |
14:52:45 | * | MJCaley joined #nim |
14:53:36 | FromGitter | <mratsim> Some of the game devs articles in the past months were quite depressing (the one about Mass Effect Andromeda, the one from Kotaku about the rampant burnout and project management issues). |
14:54:09 | PMunch | mratsim, links? |
14:56:09 | FromGitter | <mratsim> https://www.nytimes.com/2017/10/25/opinion/work-culture-video-games-crunch.html |
14:56:14 | Araq | mratsim: memory management |
14:56:51 | FromGitter | <mratsim> https://kotaku.com/the-story-behind-mass-effect-andromedas-troubled-five-1795886428 |
14:59:48 | FromGitter | <RedBeard0531> Is running `setGlobalDispatcher newDispatcher()` supposed to be required? Adding that line seems to shave a fixed ~500ms from my execution time. |
15:00:20 | PMunch | Hmm crunch is pretty normal in many IT fields isn't it? Not exclusively limited to games |
15:00:53 | FromGitter | <zacharycarter> Game dev crunch is definitely far worse |
15:01:08 | FromGitter | <zacharycarter> although I know non game devs that work for Amazon who have hellish working hours |
15:01:16 | PMunch | Although since games have a broader audience I guess many game developers would get more personally invested with the product |
15:01:27 | FromGitter | <zacharycarter> I think a lot of it depends on the company and publisher behind the game |
15:01:36 | PMunch | zacharycarter, well Amazon isn't known to be the best company to work for.. |
15:02:01 | FromGitter | <zacharycarter> true |
15:02:07 | PMunch | zacharycarter, definitely. I wonder as well how early access games are in this regard |
15:02:56 | PMunch | With no firm deadline and more continuous development I'd guess it could stave of some of that crunch pressure |
15:03:12 | FromGitter | <zacharycarter> Maybe - I think game dev in itself is a long grind |
15:03:19 | FromGitter | <zacharycarter> You're working on a concept for years at a time |
15:03:51 | FromGitter | <zacharycarter> It's tough not to get distracted / bored / frustrated with a single project for that length of time |
15:06:06 | PMunch | Yeah, I noticed that when I started programming games when I was younger. You'd think of all these great ideas and start working. After a while the core was done and working, and it was time to add all the content. But by then I had already thought of a new cool idea and ditched the last project. |
15:06:21 | PMunch | Got a lot of programming experience from it, but not that many actual games :P |
15:08:09 | FromGitter | <tim-st> @RedBeard0531 Thanks for the link, that's interesting! |
15:09:11 | FromGitter | <tim-st> I'm wondering what's best to close a filestream automatically, that is used inside an object. Is this done by gc? |
15:10:29 | * | sakalli joined #nim |
15:10:51 | FromGitter | <tim-st> The filestream should stay open as long the object lives |
15:11:11 | Araq | currently you need to write a finalizer for this to work |
15:11:41 | FromGitter | <tim-st> Is there an example for a "finalizer" in nim? |
15:11:54 | FromGitter | <tim-st> Maybe in the docs |
15:11:59 | dom96 | RedBeard0531: that shouldn't be necessary |
15:13:22 | FromGitter | <tim-st> I read that Python GC closes the file object automatically and file.close is not necessary in Python |
15:13:33 | FromGitter | <tim-st> I thought maybe nim would have a similar effect |
15:15:53 | dom96 | does it? Why does Python have a 'with' statement then? :) |
15:17:47 | FromGitter | <tim-st> The with statement calls *exit* on the object but I read that this doesn't have an effect at all because of gc, but maybe I'm not 100% correct, I remember some guys on sx texted it |
15:18:11 | federico3 | tim-st: https://stackoverflow.com/questions/4599980/python-close-file-descriptor-question |
15:19:37 | FromGitter | <tim-st> @federico3 yes, that was the page^^ |
15:20:06 | FromGitter | <tim-st> "Strictly speaking, using with is not "explicitly" closing the file" |
15:21:31 | FromGitter | <tim-st> Nonetheless, I'm not sure how to solve this. Maybe someone implemented it before on FileStream. |
15:24:34 | FromGitter | <RedBeard0531> @dom96 https://github.com/nim-lang/Nim/issues/6846 |
15:27:57 | FromGitter | <RedBeard0531> @dom96 @tim-st python's with is for *deterministic* destruction. It is guaranteed by the language to happen at the end of the with block. The finalizes are a fallback and are non-deterministic. (It happens that they are deterministic in CPython because it uses ref-counting, but the language explicitly allows other kinds of GC and that doesn't hold for pypy or jython) |
15:29:17 | FromGitter | <RedBeard0531> See http://doc.pypy.org/en/latest/cpython_differences.html#differences-related-to-garbage-collection-strategies for much more details |
15:29:44 | * | nim_newb quit (Quit: Page closed) |
15:30:52 | FromGitter | <tim-st> @RedBeard0531 Ok, but in fact I never heard of a finalizer and because of this don't know how to implement it. The following alternatives are possible: 1) Always reopen and reclose the file for each method call. 2) if nim closes the file through gc after object not used, jsut ignore it 3) let the file open as long the process runs |
15:31:12 | dom96 | tim-st: what are you trying to solve? |
15:31:22 | dom96 | a finalizer is just a callback you specify to the new() proc |
15:31:28 | dom96 | (when you're allocating a GC'd ref) |
15:31:54 | FromGitter | <tim-st> "" |
15:32:00 | FromGitter | <tim-st> "I'm wondering what's best to close a filestream automatically, that is used inside an object. Is this done by gc? ⏎ The filestream should stay open as long the object lives" |
15:32:25 | FromGitter | <wdecoster> Hi, I have experience in Python and would like to learn a second language for speeding up some more computationally heavy parts, while keeping it integrated with the Python code. Would something like that be possible with Nim? |
15:33:19 | dom96 | tim-st: new(YourRefObjectType, proc (x: YourRefObjectType) = x.file.close() |
15:33:20 | dom96 | https://nim-lang.org/docs/system.html#new,ref.T,proc%28ref.T%29 |
15:34:00 | FromGitter | <tim-st> @dom96 Thanks, that looks easier than I thought :) |
15:34:25 | dom96 | wdecoster: yep, this talk might help: https://www.youtube.com/watch?v=IVgNVJdizHg&feature=youtu.be |
15:38:07 | * | floppydh quit (Remote host closed the connection) |
15:38:51 | * | floppydh joined #nim |
15:38:55 | FromGitter | <wdecoster> Thanks for the link! |
15:39:24 | FromGitter | <tim-st> @dom96 Maybe it would be good if the line you wrote, could be added to the streams doc, I think people who come from Python will ask the same because they first reach the streams manual: https://nim-lang.org/docs/streams.html |
15:44:53 | dom96 | I'm about to head out to lecture, so maybe you could make a PR for that? :) |
15:46:07 | FromGitter | <tim-st> @dom96 I'm not really familiar with Github but will try |
15:46:35 | * | jjido joined #nim |
15:49:08 | * | MJCaley quit (Quit: MJCaley) |
15:52:49 | FromGitter | <Varriount> @Araq @dom96 Do we still have project files? |
15:53:19 | FromGitter | <Varriount> I'm updating NimLime's project file support, and want to know if it's still a thing. |
15:57:52 | * | sakalli quit (Ping timeout: 240 seconds) |
16:02:54 | * | MJCaley joined #nim |
16:03:15 | * | floppydh quit (Remote host closed the connection) |
16:03:20 | Demos[m] | Presumably the kernel closes filehandles at process teardown |
16:11:01 | FromGitter | <alehander42> hey @Varriount I often have this problem when NimLime generates new files with output in my sublime, is it a known bug ? |
16:11:15 | FromGitter | <alehander42> (otherwise thanks for the excellent plugin) |
16:13:12 | FromGitter | <Varriount> @alehander42 Are you using OSX? |
16:13:20 | FromGitter | <alehander42> ubuntu 16.10 |
16:13:24 | FromGitter | <Varriount> Hrm. |
16:13:35 | FromGitter | <Varriount> What happens if you completely restart Sublime Text? |
16:14:17 | FromGitter | <alehander42> i have this trick that I do one nim c after I open sublime and before saving any nim file but I am not sure if it's connected somehow |
16:14:28 | FromGitter | <alehander42> well usually it works fine then |
16:15:01 | FromGitter | <Varriount> There's a problem with how Sublime Text is firing setting change notifications that causes it. |
16:15:13 | FromGitter | <Varriount> I'm planning on fixing it today. |
16:16:30 | FromGitter | <alehander42> no problem, gl |
16:18:20 | * | miran_ joined #nim |
16:22:23 | FromGitter | <mratsim> @tim-st use finalized if your type is ref object or a destructor (`=destroy`) if your type is an object |
16:22:32 | FromGitter | <mratsim> Finalizer* |
16:23:57 | FromGitter | <tim-st> @mratsim Thanks for your help, will try it |
16:30:59 | * | nim_newb joined #nim |
16:31:45 | nim_newb | why am i getting `Error: unhandled exception: len(ver) == 0 or contains({0, 35, 48..57}, ver[0]) Wrong version: master\build [AssertionError]` when i run `nake` in https://github.com/yglukhov/nimx/tree/master/test folder? |
16:32:16 | * | PMunch quit (Quit: Leaving) |
16:41:27 | * | sakalli joined #nim |
16:42:37 | * | nim_newb quit (Quit: Page closed) |
16:53:16 | niv | dom96: you wrote asyncnet, if i recall? got a sec to answer a question? |
16:55:02 | Araq | varriount: nimsuggest detects the project when you pass it a directory |
16:55:11 | Araq | but these still exist, yes |
16:58:12 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
16:58:50 | * | Jesin quit (Ping timeout: 276 seconds) |
17:03:28 | * | sakalli quit (Ping timeout: 240 seconds) |
17:04:14 | * | rbrt joined #nim |
17:05:35 | * | rbrt quit (Client Quit) |
17:06:28 | * | rbrt joined #nim |
17:15:11 | * | Jesin joined #nim |
17:18:31 | * | couven92 joined #nim |
17:21:41 | * | NimBot joined #nim |
17:23:08 | dom96 | niv: don't ask to ask, just ask |
17:24:13 | niv | eh. i'm confused. apparently, dial() returns with the connected socket, but recvLine() fails with "" (meaning socket disconnected) immediately after. |
17:24:27 | niv | this goes on through a couple dozen loops until it finally connects for real. |
17:25:04 | niv | i'm sure i'm doing something horrible. |
17:25:49 | niv | if you could cross-check me i'd appreciate it, i have been banging my head against this for the past two hours. code: https://gist.github.com/niv/7576e958ff0dce050a436c28934c504c output: https://gist.github.com/niv/3853e9bf871f7646c7a7f49c2269ddb5 |
17:28:43 | niv | really easy to repro: just kill the serverside daemon (nats) while the loop is running. it'll try to connect rapidly until suddenly noticing it's not actually working |
17:31:49 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:34:15 | * | Sentreen joined #nim |
17:42:00 | dom96 | I guess I'd need to install this NATS thing :\ |
17:42:30 | niv | do you have docker? |
17:42:37 | dom96 | nope |
17:42:43 | niv | drats. |
17:42:58 | niv | well it should be a single static binary you can run |
17:43:01 | dom96 | instead of testing with such a large app, write just a simple reproduction of this |
17:43:21 | niv | sure. |
17:43:31 | dom96 | it'll help you diagnose the problem |
17:43:40 | dom96 | but I wonder how you got this far if you've had such issues |
17:45:05 | * | endragor quit (Remote host closed the connection) |
17:46:55 | niv | thats a bit harsh. |
17:50:33 | dom96 | Sorry, I didn't mean it in a harsh way! :/ |
17:55:06 | niv | dom96 figured it out. its docker-proxy. |
17:55:26 | niv | it kills first the demon, then the proxy, but the proxy port is still open while the backing service shuts down |
17:56:27 | dom96 | Awesome. Glad you worked it out :) |
17:57:22 | niv | some days .. i hate all software. |
17:58:08 | * | endragor joined #nim |
17:58:33 | FromGitter | <kayabaNerve> Even my Windoze? |
17:58:44 | FromGitter | <kayabaNerve> I love Windoze 24/7. Gives me so much freedom |
17:59:36 | * | xkapastel joined #nim |
18:02:51 | * | endragor quit (Ping timeout: 260 seconds) |
18:06:04 | * | MJCaley quit (Quit: MJCaley) |
18:12:25 | jjido | I think it is called windows 365 |
18:15:00 | * | Trustable joined #nim |
18:15:40 | * | jjido_ joined #nim |
18:16:51 | * | jjido quit (Ping timeout: 246 seconds) |
18:18:21 | rbrt | so this seems to work https://gist.github.com/jrwells/3669e151b04803e6c51405be2926e381 |
18:18:58 | rbrt | can i make the wrapper proc more simple? |
18:20:12 | rbrt | also, im not 100% on why i need to pass in a ref |
18:23:04 | * | arnetheduck quit (Remote host closed the connection) |
18:27:08 | * | JappleAck quit (Quit: Leaving) |
18:28:12 | dom96 | rbrt: probably because a non-ref object lives on the stack |
18:28:18 | dom96 | so it disappears once the function returns |
18:28:45 | * | couven92 quit (Quit: Client disconnecting) |
18:34:54 | * | rbrt quit (Quit: Oíche mhaith) |
18:38:12 | * | Trustable quit (Remote host closed the connection) |
18:40:08 | * | nsf quit (Quit: WeeChat 1.9.1) |
18:42:22 | * | rbrt joined #nim |
18:44:18 | rbrt | dom96 lol of course! that makes sense |
18:51:37 | * | Ven joined #nim |
18:52:00 | * | Ven is now known as Guest33619 |
18:52:06 | rbrt | oh actually i was wondering why i've been unable to create a new ref inside the proc (vs passing in a ref and changing what the ref refers to) |
18:52:49 | * | gokr quit (Ping timeout: 248 seconds) |
18:53:14 | rbrt | (using ref now, but haven't been able to get it to work with ptr either) |
18:59:58 | dom96 | why can't you? |
19:02:16 | rbrt | i guess i've just been unable to figure out how, probably messing up the syntax |
19:04:17 | dom96 | show me what you're trying :) |
19:07:53 | * | PMunch joined #nim |
19:14:38 | * | sakalli joined #nim |
19:24:01 | * | sz0 quit (Quit: Connection closed for inactivity) |
19:25:09 | * | vivus joined #nim |
19:35:27 | * | gokr joined #nim |
19:40:40 | * | vivus quit (Quit: Leaving) |
19:48:16 | * | claudiuinberlin joined #nim |
19:51:19 | * | d10n-work quit (Quit: Connection closed for inactivity) |
19:57:21 | * | gokr quit (Ping timeout: 248 seconds) |
20:01:06 | * | Guest33619 is now known as Ven`` |
20:11:38 | * | Trustable joined #nim |
20:12:52 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:19:37 | * | nsf joined #nim |
20:21:28 | * | Ven`` joined #nim |
20:24:00 | * | gokr joined #nim |
20:28:13 | * | Trustable quit (Remote host closed the connection) |
20:33:09 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:34:56 | * | gokr quit (Ping timeout: 255 seconds) |
20:39:08 | * | astronavt joined #nim |
20:44:11 | * | astronavt quit (Ping timeout: 240 seconds) |
20:52:25 | copygirl | Hereos and Generals, a P2W MMOFPS |
20:55:16 | FromGitter | <zacharycarter> ? |
20:55:18 | copygirl | Wrong channel, apologies. |
20:55:30 | FromGitter | <zacharycarter> hehe Hereos |
20:55:35 | FromGitter | <zacharycarter> sounds like a cookie |
20:55:49 | FromGitter | <zacharycarter> or a breakfast cereal |
20:56:05 | copygirl | Mhhh *drools* |
21:05:54 | * | PMunch quit (Quit: leaving) |
21:10:06 | * | miran_ quit (Quit: Konversation terminated!) |
21:11:31 | * | vlad1777d joined #nim |
21:18:19 | * | Ven`` joined #nim |
21:21:23 | * | Ven`` quit (Client Quit) |
21:24:30 | * | rbrt quit (Quit: Oíche mhaith) |
21:26:00 | * | Ven`` joined #nim |
21:40:15 | * | astronavt joined #nim |
21:45:10 | * | astronavt quit (Ping timeout: 252 seconds) |
22:08:26 | * | gokr joined #nim |
22:13:28 | * | jjido_ quit (Quit: going, gone.) |
22:18:46 | FromGitter | <Quelklef> What's happening when I set a proc var to an overloaded proc? |
22:19:11 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a2083df71ad3f87364ea167] |
22:19:47 | Araq | the compiler disambiguates properly as your example shows |
22:20:07 | FromGitter | <Quelklef> Sure, but why's the error message say what it does? |
22:20:38 | FromGitter | <Quelklef> I can get why it doesn't work conceptually, 'cause I'm not specifying a type, but the error seems to report something else |
22:20:38 | Araq | the set of overloads has the type "None" ? |
22:20:57 | Araq | error messages could always be better |
22:21:15 | Araq | but guess what in this stage of the compiler we lost the AST and only know the type |
22:21:33 | FromGitter | <Quelklef> o shit |
22:21:41 | FromGitter | <Quelklef> i dont think i know enough about compilers |
22:21:49 | Araq | error messages are not bad because we're mean. |
22:22:07 | Araq | they are bad because they often abstraction breaking within the compiler's code |
22:22:09 | * | vlad1777d quit (Remote host closed the connection) |
22:23:04 | FromGitter | <Quelklef> often? is that a typo or am i not reading this right |
22:23:39 | Araq | typo |
22:24:16 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:24:23 | Araq | "they are bad because often in order to make them better you would need to break the internal abstractions" |
22:24:38 | * | couven92 joined #nim |
22:24:41 | * | vlad1777d joined #nim |
22:24:50 | Araq | like passing an AST around instead of a type just so that we can generate better error messages. |
22:26:04 | * | jjido joined #nim |
22:27:16 | FromGitter | <Quelklef> Oh like during type checking? |
22:27:29 | Araq | yes |
22:28:30 | FromGitter | <Quelklef> makes sense |
22:29:09 | * | rbrt joined #nim |
22:33:58 | * | sakalli quit (Ping timeout: 264 seconds) |
22:34:56 | * | nsf quit (Quit: WeeChat 1.9.1) |
22:39:55 | * | vlad1777d quit (Remote host closed the connection) |
22:41:14 | * | astronavt joined #nim |
22:46:23 | * | astronavt quit (Ping timeout: 250 seconds) |
22:49:24 | * | Vladar quit (Quit: Leaving) |
22:56:52 | * | Jesin quit (Quit: Leaving) |
23:01:23 | * | gokr quit (Ping timeout: 268 seconds) |
23:01:55 | * | jjido quit (Remote host closed the connection) |
23:09:11 | * | arecaceae quit (Remote host closed the connection) |
23:09:29 | * | arecaceae joined #nim |
23:10:52 | * | MJCaley joined #nim |
23:26:55 | * | libman joined #nim |
23:35:39 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:35:48 | * | vlad1777d joined #nim |
23:41:48 | * | vlad1777d quit (Remote host closed the connection) |
23:42:15 | * | astronavt joined #nim |
23:45:42 | * | klaver010110 joined #nim |
23:47:03 | * | astronavt quit (Ping timeout: 250 seconds) |
23:47:58 | * | Ven`` joined #nim |
23:59:43 | * | yglukhov joined #nim |