00:02:05 | * | devdri joined #nim |
00:02:32 | * | Yardanico[Phone] quit (Remote host closed the connection) |
00:02:43 | * | Yardanico[Phone] joined #nim |
00:04:29 | FromGitter | <RedBeard0531> Is there a fancier assert that stringifies inputs on failure? `Exception message: deps.output == target` isn't as helpful as if I knew what those were at the time of failure. |
00:08:53 | FromGitter | <Quelklef> can you just |
00:09:25 | FromGitter | <Quelklef> `if not cond: raise newException(CustomErrorExtendingBaseException, "Two values didn't match and instead where $1, $2" % [...]")` |
00:09:26 | FromGitter | <Quelklef> ? |
00:11:18 | FromGitter | <RedBeard0531> Sure, I could do that on every assert... Or I could have a macro do it for me☺ |
00:11:44 | FromGitter | <Quelklef> Right, point being: Just raise an an exception |
00:12:15 | FromGitter | <RedBeard0531> I was checking if anyone had already written such a macro before I go off and write one |
00:12:54 | FromGitter | <Quelklef> oooooh i thought you were asking if it existed as a feature of assert |
00:15:07 | FromGitter | <RedBeard0531> No, I know it isn't, but I assert that assert should |
00:15:22 | FromGitter | <RedBeard0531> Sorry, I can't resist a dumb pun |
00:15:35 | * | devdri quit () |
00:16:14 | FromGitter | <Quelklef> It's fine. It was exceptionally good =) |
00:20:12 | dom96 | the unittest module does this |
00:20:32 | dom96 | it might be nice to add this to assert as well |
00:24:05 | * | devdri joined #nim |
00:27:06 | FromGitter | <RedBeard0531> Thanks, I'll give that a shot. Hopefully it works outside of tests. |
00:29:19 | * | willprice quit (Ping timeout: 248 seconds) |
00:29:29 | * | willprice94 quit (Ping timeout: 276 seconds) |
00:31:54 | * | yglukhov joined #nim |
00:34:39 | * | devdri quit () |
00:36:17 | * | yglukhov quit (Ping timeout: 256 seconds) |
00:43:45 | * | tefter quit (Ping timeout: 248 seconds) |
01:12:15 | * | dandevelo joined #nim |
01:16:15 | * | marenz__ quit (Ping timeout: 248 seconds) |
01:16:57 | * | dandevelo quit (Ping timeout: 240 seconds) |
01:28:19 | * | ieatnerds joined #nim |
01:32:03 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:36:19 | * | ieatnerds quit (Quit: Leaving) |
01:37:09 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:43:17 | * | Trustable quit (Remote host closed the connection) |
01:45:35 | * | Yardanico[Phone] quit (Quit: Quit) |
01:45:59 | * | Yardanico[Phone] joined #nim |
01:59:01 | * | cspar quit (Ping timeout: 256 seconds) |
02:01:52 | * | cspar joined #nim |
02:16:51 | * | MJCaley joined #nim |
02:22:35 | * | gokr quit (Ping timeout: 240 seconds) |
02:27:30 | * | yglukhov joined #nim |
02:28:03 | * | MJCaley quit (Quit: MJCaley) |
02:29:25 | * | bmaxa joined #nim |
02:31:59 | * | yglukhov quit (Ping timeout: 248 seconds) |
02:35:49 | * | bmaxa quit (Quit: Leaving) |
02:38:28 | FromGitter | <RedBeard0531> blarg. unittest.check prints the right stuff, but keeps running on failure. require aborts but doesn't print a stack trace first :( |
02:41:08 | * | vivus quit (Quit: Leaving) |
02:47:30 | * | MJCaley joined #nim |
02:52:58 | FromGitter | <raydf> hey Can anyone help me on how to use regex in the js backend? |
02:53:35 | * | vlad1777d quit (Ping timeout: 268 seconds) |
03:00:51 | Yardanico[Phone] | You can't |
03:01:08 | Yardanico[Phone] | re module uses native pcre module |
03:01:33 | FromGitter | <Varriount> Hm, you can still import the JavaScript regex functions though |
03:01:37 | Yardanico[Phone] | But you can wrap native (from JS) regex |
03:01:38 | Yardanico[Phone] | Yes |
03:02:17 | * | chemist69 quit (Ping timeout: 272 seconds) |
03:05:40 | FromGitter | <raydf> thanks for the help |
03:15:43 | * | chemist69 joined #nim |
03:20:44 | FromGitter | <raydf> yeah i'll go to wrap the test() native js function |
03:40:49 | * | dddddd quit (Remote host closed the connection) |
03:41:45 | FromGitter | <zacharycarter> Hi all :) I have a file I'm compiling into a static library and then I'm trying to call a proc I defined in that library in another nim file |
03:42:18 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a4c511a232e79134dbc7a39] |
03:42:28 | FromGitter | <zacharycarter> I'm compiling the first file with - |
03:42:50 | FromGitter | <zacharycarter> `nim c --app:staticLib --noMain -o:libfoo.a ./src/foo/foo.nim` |
03:43:04 | FromGitter | <zacharycarter> and the second file with - |
03:43:26 | FromGitter | <zacharycarter> `nim c --passL:libfoo.a ./src/bar/bar.nim` |
03:43:37 | FromGitter | <zacharycarter> I get the following errors: |
03:44:56 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a4c51b8b48e8c3566934a34] |
03:46:31 | FromGitter | <zacharycarter> I has no idea what I'm doing wrong |
03:47:09 | FromGitter | <Varriount> @zacharycarter Hrm. Your command-line looks correct. |
03:48:28 | FromGitter | <RedBeard0531> I don't think you are allowed to static link a nim lib into a nim program since that would get you two nim runtimes, but I could be wrong |
03:48:56 | FromGitter | <Varriount> @zacharycarter What happens if you compile the lib with run-time dll loading? |
03:49:08 | FromGitter | <zacharycarter> I'm guessing that will work |
03:53:14 | FromGitter | <zacharycarter> thanks for the help guys, the two runtimes explanation makes sense |
03:57:33 | FromGitter | <Varriount> Did it work? |
03:57:48 | FromGitter | <zacharycarter> dynamic linking? |
03:57:57 | * | cspar quit (Ping timeout: 240 seconds) |
03:58:19 | FromGitter | <zacharycarter> I didn't try - I decided to just do something else as I didn't really need to split the code that way anyway I was just kind of playing around with some ideas |
03:58:31 | FromGitter | <zacharycarter> I will be dynamic linking some C++ code though |
03:58:41 | FromGitter | <zacharycarter> well I might write a C API for it I don't know yet |
03:59:12 | FromGitter | <Varriount> Careful, C++ is touchy about what it links with |
04:00:03 | FromGitter | <RedBeard0531> windows or posix? |
04:00:04 | FromGitter | <zacharycarter> yeah, and I don't really have experience with interop b/w Nim and C++ so I may write a C API to just make life easier |
04:00:21 | FromGitter | <RedBeard0531> linking c++ with posix is slightly saner |
04:01:26 | FromGitter | <Varriount> @zacharycarter I'm paying around with Closure compiler |
04:01:34 | FromGitter | <Varriount> *playing |
04:02:02 | FromGitter | <zacharycarter> @RedBeard0531 just posix for now |
04:02:33 | FromGitter | <zacharycarter> @Varriount the JS thing? |
04:02:43 | FromGitter | <RedBeard0531> Then you have the advantage of only having a single c-runtime (heap, etc) in your whole process |
04:03:09 | FromGitter | <Varriount> @zacharycarter Yeah |
04:03:29 | FromGitter | <zacharycarter> @Varriount ah cool |
04:05:43 | * | MJCaley quit (Quit: MJCaley) |
04:31:59 | * | Yardanico[Phone] quit (Ping timeout: 248 seconds) |
04:32:15 | * | Yardanico[Phone] joined #nim |
04:35:50 | * | user0 quit (Quit: user0) |
04:50:48 | * | endragor joined #nim |
04:55:39 | * | endragor quit (Ping timeout: 272 seconds) |
05:49:23 | * | noonien quit (Quit: Connection closed for inactivity) |
06:34:39 | * | nsf joined #nim |
07:19:18 | * | dandevelo joined #nim |
07:29:00 | * | yglukhov joined #nim |
07:32:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
07:33:51 | * | dandevelo quit (Ping timeout: 248 seconds) |
07:34:56 | * | PMunch joined #nim |
08:03:59 | * | Vladar joined #nim |
08:32:52 | * | claudiuinberlin joined #nim |
08:44:14 | * | floppydh joined #nim |
08:54:57 | * | BitPuffin|osx joined #nim |
09:02:56 | * | yglukhov joined #nim |
09:04:20 | * | endragor joined #nim |
09:18:58 | * | themagician_e joined #nim |
09:19:00 | * | themagician quit (Ping timeout: 268 seconds) |
09:30:17 | * | noonien joined #nim |
09:30:59 | * | dandevelo joined #nim |
09:32:49 | * | natrys joined #nim |
09:36:09 | * | themagician_e quit () |
09:36:21 | * | dandevelo quit (Ping timeout: 264 seconds) |
09:43:51 | * | gokr joined #nim |
09:44:46 | * | user0 joined #nim |
10:04:27 | * | PMunch_ joined #nim |
10:05:57 | * | PMunch quit (Ping timeout: 240 seconds) |
10:09:37 | * | PMunch__ joined #nim |
10:09:47 | * | PMunch__ is now known as PMunch |
10:11:10 | * | Trustable joined #nim |
10:12:21 | * | PMunch_ quit (Ping timeout: 264 seconds) |
10:18:40 | * | willprice94 joined #nim |
10:18:40 | * | willprice joined #nim |
10:26:57 | * | vlad1777d joined #nim |
10:32:38 | * | dandevelo joined #nim |
10:34:47 | * | natrys quit (Quit: natrys) |
10:36:59 | * | dandevelo quit (Ping timeout: 252 seconds) |
10:37:29 | * | willprice quit (Remote host closed the connection) |
10:37:29 | * | willprice94 quit (Remote host closed the connection) |
10:43:57 | * | vlad1777d quit (Ping timeout: 240 seconds) |
10:46:26 | * | Trustable quit (Remote host closed the connection) |
10:49:11 | FromGitter | <mratsim> @yardanico @tim-st Huh I thought object variant only takes the space of the kind discriminator + biggest variant. |
10:51:40 | FromGitter | <mratsim> @RedBeard0531 strange when unittest.check fails it does keep running but I also get stack traces when raising exceptions (including assert) |
11:21:22 | * | miran joined #nim |
11:43:13 | * | endragor quit (Remote host closed the connection) |
12:12:35 | * | gokr quit (Ping timeout: 250 seconds) |
12:14:22 | * | dddddd joined #nim |
12:51:00 | * | dandevelo joined #nim |
13:02:01 | * | Snircle joined #nim |
13:28:35 | PMunch | Haha, I got conways game of life running in drawille |
13:42:25 | * | dddddd quit (Ping timeout: 248 seconds) |
13:43:50 | * | dddddd joined #nim |
13:43:53 | * | iAmSlow joined #nim |
13:44:21 | iAmSlow | hi can i access somhow gpu memory to get frame ? |
13:45:02 | miran | are arrays limited in size?! |
13:45:20 | miran | this fails: array[-1000 .. 1000, array[-1000 .. 1000, int]] |
13:46:09 | miran | but this works: array[-100 .. 100, array[-100 .. 100, int]] |
13:47:57 | * | dddddd quit (Ping timeout: 240 seconds) |
13:49:06 | miran | this is the last value that works: array[-511 .. 511, array[-511 .. 511, int]] |
13:53:25 | * | gokr joined #nim |
13:54:22 | FromGitter | <data-man> @PMunch: With unlimited a field's size? ;-) |
13:54:48 | dom96 | miran: hrm, wouldn't anything bigger not fit on the stack? |
13:55:19 | miran | dom96: i have no idea about internals.... |
13:55:52 | dom96 | maybe what you want is a seq? |
13:56:58 | miran | nah, i had a table, now converting to array - i get a nice ~3x speedup :) |
13:58:21 | miran | in tables i could get away with not knowing exact dimensions (getordefault to the rescue) |
13:58:37 | * | MJCaley joined #nim |
13:58:59 | miran | in the new case, i'm giving dimensions in advance, so i guess arrays are better than seqs (?) |
14:00:41 | * | dddddd joined #nim |
14:06:27 | dom96 | have you tried using newSeq with a capacity? |
14:09:40 | miran | dom96: good idea! although i just found out the array limit will suffice for this problem at hand, but good to know for the future, thanks! |
14:11:45 | PMunch | data-man, it takes the max size the terminal can have |
14:11:49 | PMunch | And wraps |
14:13:40 | * | marenz joined #nim |
14:13:46 | PMunch | Is there any way to do poll stdin without blocking? |
14:14:33 | iAmSlow | https://blog.parsecgaming.com/description-of-parsec-technology-b2738dcc3842 |
14:15:06 | iAmSlow | hmm, i need monelight alternative for RPI3 , have stupit gpu, read this article ^^^ , is this duable in nim |
14:15:57 | PMunch | iAmSlow, pretty much everything is doable in Nim :) |
14:16:53 | dom96 | PMunch: on linux, yes. |
14:16:53 | iAmSlow | oh f i am dumb/lazy |
14:16:58 | dom96 | but not on windows |
14:17:10 | iAmSlow | windows sux |
14:17:25 | PMunch | dom96, Linux is fine (at least for now) |
14:17:29 | * | marenz_ joined #nim |
14:17:29 | PMunch | How would I do it? |
14:17:44 | dom96 | PMunch: use asynfile on the stdin fd |
14:17:46 | dom96 | *asyncfile |
14:18:02 | iAmSlow | i alwes skip some row of reading, just now saw it sasys "Each vendor has a different C API for interacting with their video processing hardware |
14:19:08 | PMunch | dom96, is it not possible at all on Windows? |
14:19:18 | dom96 | maybe it is |
14:19:20 | FromGitter | <data-man> @PMunch: There is a suggestion: use the colors module in your library. |
14:19:44 | dom96 | you can also use threads |
14:19:50 | PMunch | data-man, yeah I was thinking about adding colours to it |
14:20:03 | * | azur_kind joined #nim |
14:20:53 | FromGitter | <data-man> Good :-) |
14:21:13 | * | marenz quit (Ping timeout: 272 seconds) |
14:22:19 | PMunch | dom96, hmm how do I convert stdin to a AsyncFile? |
14:22:34 | dom96 | newASyncFile? |
14:23:05 | PMunch | newAsyncFile(stdin) didn't work |
14:23:16 | PMunch | Since it's a file and not a AsyncFD |
14:24:30 | FromGitter | <tim-st> @mratsim it uses the space like I assumed: https://gist.github.com/anonymous/fd7d6dad3880c3a60210cd4b655cbaa8 |
14:24:39 | dom96 | you should be able to convert the type |
14:24:48 | dom96 | or get the FD somehow and convert that |
14:25:05 | FromGitter | <tim-st> (https://play.nim-lang.org/?gist=fd7d6dad3880c3a60210cd4b655cbaa8) |
14:25:25 | PMunch | Fair enough |
14:26:16 | PMunch | Undeclared identifier await? |
14:26:51 | dom96 | {.async.} |
14:26:58 | dom96 | look at some async examples |
14:27:12 | PMunch | On the entire module? |
14:27:18 | dom96 | no, on a proc |
14:27:26 | PMunch | I don't have any procs.. |
14:27:33 | dom96 | then create one |
14:27:34 | PMunch | Apart from the implicit main |
14:27:48 | * | nastavnic joined #nim |
14:28:25 | * | nastavnic quit (Client Quit) |
14:30:18 | FromGitter | <RedBeard0531> @tim-st I think you are seeing the effects of padding. If you add more data to d2 the sizeof doesn't grow |
14:30:58 | FromGitter | <tim-st> Interesting will try |
14:31:26 | FromGitter | <RedBeard0531> float64 is 8-byte aligned, so even if you have less than 8 bytes of data before it, it will "skip" some bytes to start at a multiple of 8 |
14:32:20 | FromGitter | <RedBeard0531> The general rule is for tight packing, sort your fields from biggest to smallest |
14:32:54 | * | Jesin quit (Quit: Leaving) |
14:32:59 | FromGitter | <RedBeard0531> Unfortunately nim doesn't currently give you a way to control the placement of the discriminator. |
14:34:07 | PMunch | dom96, do you have any good examples of async/await? |
14:34:24 | PMunch | I know there is one in your book, but it's at home |
14:34:34 | FromGitter | <tim-st> @RedBeard0531 Thanks, it works like you said. But I dont understand why the smaller ones always get the biggest size though^^ |
14:34:45 | dom96 | PMunch: my books code is online https://github.com/dom96/nim-in-action-code/tree/master/Chapter3/ChatApp |
14:34:49 | * | nastavnic joined #nim |
14:35:02 | FromGitter | <RedBeard0531> what do you mean? |
14:35:04 | * | Trustable joined #nim |
14:35:45 | PMunch | Ooh, nice |
14:36:08 | * | nastavnic quit (Client Quit) |
14:36:23 | FromGitter | <RedBeard0531> Each type has a fixed size, regardless of its current state. Using "case" just lets you use (discrim + max(cases)) size rather than sum(cases) |
14:36:24 | * | nastavnic joined #nim |
14:36:27 | * | nastavnic quit (Client Quit) |
14:36:45 | * | nastavnic joined #nim |
14:39:17 | iAmSlow | hmm anyone know where is C API for amd gpu? Mesa meybe? |
14:41:29 | iAmSlow | i am willing to kill 2 months for this |
14:41:41 | iAmSlow | https://blog.parsecgaming.com/description-of-parsec-technology-b2738dcc3842 |
14:41:49 | iAmSlow | just duno where to start |
14:42:01 | iAmSlow | cant find AMD C API |
14:45:21 | FromGitter | <mratsim> You want to access AMD OpenGL? Search for AMDGPU (probably on Phoronix to find more keywords) |
14:46:13 | FromGitter | <mratsim> Or fglrx or fgrlx don't remember for the proprietary driver. |
14:46:44 | FromGitter | <tim-st> @RedBeard0531 Thanks, now I understand how it works: The compiler reserves the amount of memory of the maximum, so it can copy all possible wariants without problems. I assumed the following: the compiles "knows" of object variants and treats them as single differents objects, which wouldnt require to reserve the amount of mem of the maximum variant but instead the amount of memory of each object. |
14:46:50 | FromGitter | <mratsim> Or maybe you're looking into OpenCL? I would need more info |
14:47:25 | PMunch | Hmm, I really can't get this asynchronous keyboard input to work.. |
14:48:38 | * | nastavnic quit (Quit: WeeChat 2.0.1) |
14:48:42 | FromGitter | <tim-st> @RedBeard0531 But thanks for the explanation. Now, I now that object variants are very efficient, if all variants have (nearly) the same amount of memory inside |
14:49:16 | iAmSlow | https://hastebin.com/juvidagebo.vbs |
14:49:31 | iAmSlow | i strped whole article |
14:49:37 | iAmSlow | to major point |
14:50:16 | FromGitter | <RedBeard0531> @tim-st I think the main benefit is for code structure and understandability. The fact that it saves a few bytes is a nice side benefit |
14:50:55 | * | Snircle quit (Ping timeout: 252 seconds) |
14:51:39 | FromGitter | <RedBeard0531> Its also nice the you get an error when your assumptions are wrong and you access the wrong field (maybe that is just without -d:release though?) |
14:53:53 | * | Yardanico joined #nim |
14:53:57 | * | dandevelo quit (Ping timeout: 240 seconds) |
14:56:14 | FromGitter | <data-man> LaPeSD LibGOMP 1.6 released https://github.com/lapesd/libgomp |
14:56:16 | FromGitter | <RedBeard0531> Is there a good heap profiler for nim? My peak resident size is 2.5-4x the c++ impl, depending on which --gc I use. Interestingly this is the first time I've seen boehm be smallest and fastest. |
14:59:17 | * | nastavnic joined #nim |
15:01:22 | * | nastavnic quit (Client Quit) |
15:11:35 | * | nastavnic joined #nim |
15:12:03 | * | PMunch quit (Quit: Leaving) |
15:12:18 | * | nastavnic quit (Client Quit) |
15:12:52 | * | nastavnic joined #nim |
15:13:16 | * | nastavnic quit (Client Quit) |
15:14:13 | * | MJCaley quit (Quit: MJCaley) |
15:14:35 | * | nastavnic joined #nim |
15:22:05 | * | nastavnic quit (Quit: WeeChat 2.0.1) |
15:24:02 | * | nastavnic joined #nim |
15:25:35 | * | nastavnic quit (Client Quit) |
15:26:25 | * | nastavnic joined #nim |
15:27:39 | * | nastavnic quit (Client Quit) |
15:27:56 | * | nastavnic joined #nim |
15:28:31 | * | nastavnic quit (Client Quit) |
15:30:03 | * | nastavnic joined #nim |
15:33:45 | * | nastavnic quit (Client Quit) |
15:34:10 | * | nastavnic joined #nim |
15:34:41 | * | nastavnic quit (Client Quit) |
15:37:03 | * | Jesin joined #nim |
15:39:13 | * | endragor joined #nim |
15:46:16 | Araq | RedBeard0531: gc:v2 had some support for heap dumps. peak resident size of 2.5-4x seems to be reasonable though, GCs require more memory |
15:48:39 | FromGitter | <RedBeard0531> "Had" meaning it was removed? I mostly wanted to make sure I wasn't doing something dumb like holding references to large buffers that aren't needed anymore |
15:52:49 | Araq | no it wasn't removed but it's not documented either and it only works for gc:v2 |
15:53:14 | Araq | but it can't be hard to find Nim's GCs are rather tiny in size |
15:56:50 | * | dandevelo joined #nim |
16:01:39 | * | dandevelo quit (Ping timeout: 256 seconds) |
16:06:35 | * | Cthalupa- quit (Ping timeout: 240 seconds) |
16:08:59 | * | Cthalupa joined #nim |
16:16:25 | subsetpark | Is there a stdlib way to this kind of work - https://github.com/OpenSystemsLab/struct.nim - ie, getting a string from a socket and reading it in terms of bytes? |
16:18:06 | Araq | not sure I'd probably cook up something based on the ideas of strscans.nim |
16:18:23 | dom96 | Doesn't that package decode strings? |
16:18:26 | * | natrys joined #nim |
16:19:16 | Araq | yes well to rephrase my answer: I would write a macro for that |
16:19:28 | subsetpark | dom96: yeah, it's the Python interface to saying, "Interpret the 1st byte as a char, the next three bytes as a long, the next four bytes as a double", etc |
16:20:15 | dom96 | Actually, federico3 made a PR to add something like this to the stdlib |
16:22:14 | federico3 | ...and it was closed 5 hours ago |
16:30:41 | FromGitter | <data-man> About strscans... https://github.com/nim-lang/Nim/pull/6985 can be merged? |
16:30:59 | subsetpark | I'm fine just converting sequences of chars to bytes for now |
16:31:04 | subsetpark | but I honestly am not sure how to do it |
16:31:23 | subsetpark | Since 'a'.byte makes sense but "ab".byte is a type error |
16:32:42 | federico3 | subsetpark: in case it might help: #6564 |
16:33:47 | dom96 | Why was it closed? :( |
16:34:13 | FromGitter | <RedBeard0531> Federico3 could you enable index generation when building docs in nimble.directory? |
16:35:52 | FromGitter | <RedBeard0531> Also would you mind if I wrote a low-frequency scraper? I might try my hand at writing a hoogle for nim |
16:38:50 | subsetpark | federico3: it does! It looks like the readIntN procs are what I need |
16:39:05 | dom96 | IIRC nim generates nicely formatted index files alongside the html docs |
16:39:08 | federico3 | happy to help :) |
16:39:13 | dom96 | Maybe nimble.directory could expose those? |
16:39:26 | federico3 | dom96: yes, if they are useful to users |
16:39:28 | dom96 | Scraping is horrible |
16:40:14 | dom96 | Yeah, please expose them. I've wanted a Nim hoogle for years :) |
16:40:33 | federico3 | the .idx files? What would you use those for? |
16:41:07 | dom96 | federico3: RedBeard0531 wants to make a search engine for procedures ala hoogle |
16:41:18 | dom96 | What do the .idx files contain? |
16:41:48 | dom96 | I assume the exported identifiers and their types, right? |
16:42:57 | federico3 | procs descriptions, looks like, in tab separated "CSV" |
16:48:17 | Araq | dom96, federico3 I closed it because it doesn't belong into this module and uses the wrong approach. |
16:50:54 | * | pcuser_ joined #nim |
16:53:25 | subsetpark | federico3: is there a way to readUnsignedInt{16, 32} ? |
16:53:53 | * | iAmSlow quit (Ping timeout: 248 seconds) |
16:54:00 | subsetpark | oh i see you use readUInt |
16:54:09 | subsetpark | maybe it's not in the version of the docs I have saved... |
16:55:27 | * | pcuser_ quit (Ping timeout: 248 seconds) |
16:55:35 | * | floppydh quit (Quit: WeeChat 2.0) |
16:58:36 | dom96 | Araq: AFAIK federico3 was going to fix it |
16:59:37 | FromGitter | <RedBeard0531> Araq, would you take a PR that adds a readFile overload that reads into a reusable var string out param? I'd make the current readFile implemented in terms of the new one so it shouldn't result in code duplication |
17:07:02 | FromGitter | <data-man> @RedBeard0531: Why not the FileStream? |
17:09:31 | FromGitter | <RedBeard0531> I'm reading thousands of whole files in a loop. FileStream doesn't help with that |
17:21:08 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:22:45 | Araq | RedBeard0531: Fine with me. 'result: var string' is quickly becoming trick number one in writing fast Nim code... |
17:34:30 | * | yglukhov quit (Remote host closed the connection) |
17:35:12 | * | yglukhov joined #nim |
17:36:19 | * | yglukhov_ joined #nim |
17:36:19 | * | yglukhov quit (Read error: Connection reset by peer) |
17:36:54 | * | nastavnic joined #nim |
17:40:27 | * | yglukhov_ quit (Ping timeout: 240 seconds) |
17:55:15 | * | endragor quit (Remote host closed the connection) |
17:56:00 | * | miran quit (Quit: Konversation terminated!) |
17:56:55 | * | gmpreussner quit (Quit: kthxbye) |
17:58:35 | * | gokr quit (Ping timeout: 276 seconds) |
17:59:55 | * | gmpreussner joined #nim |
18:02:36 | * | endragor joined #nim |
18:04:50 | * | kalkin- joined #nim |
18:04:52 | kalkin- | hi |
18:05:19 | kalkin- | How do i specify in .nimble file that the project provides multiple binaries? |
18:05:34 | dom96 | bin = @["bin1", "bin2"] |
18:06:09 | kalkin- | dom96: thanks |
18:06:35 | kalkin- | I used this, but it didn't work until I noticed that I haven't prepended the NIMBLE_BIN to my PATH |
18:08:57 | * | yglukhov joined #nim |
18:09:37 | dom96 | hrm, yeah, Nim's installation should add that to the PATH |
18:09:42 | * | MJCaley joined #nim |
18:13:39 | * | yglukhov quit (Ping timeout: 268 seconds) |
18:14:25 | FromGitter | <tim-st> Is it possible to compare current element of two different iterators without "closure iterators"? because I dont know if they are same length |
18:14:57 | FromGitter | <tim-st> without saving both first |
18:15:46 | * | yglukhov joined #nim |
18:16:29 | * | yonyonniisan65 joined #nim |
18:16:30 | yonyonniisan65 | ,13▄13,07▄,05▄04,13▄,06▄13,08▄,07▄05,12▄,13▄06,02▄,03▄12,03▄,08▄07,07▄,13▄13,12▄ A BUSY MEETING IS GOING ON NOW IN #/JOIN ITS A JOINT MEETING WITH THE DISCUSSION OF RE-ENSLAVEMENT OF NIGGERS..MESSAGE CHRONO OR VAP0R FOR DETAILSltbehace: Vladar endragor arecacea1 12,02▄,05▄08,06▄,08▄10,03▄,04▄12,02▄,03▄09,10▄,02▄ |
18:16:35 | * | yglukhov_ joined #nim |
18:16:36 | yonyonniisan65 | ,12▄05,12▄,12▄08,13▄,13▄05,09▄,04▄13,13▄,07▄07,04▄,04▄09,06▄,11▄08,05▄,03▄10,08▄,12▄05 A BUSY MEETING IS GOING ON NOW IN #/JOIN ITS A JOINT MEETING WITH THE DISCUSSION OF RE-ENSLAVEMENT OF NIGGERS..MESSAGE CHRONO OR VAP0R FOR DETAILSsczouiyk: rupil chemist69 arecacea1 ,06▄08,09▄,13▄11,09▄,02▄08,07▄,05▄07,12▄,11▄10,10▄ |
18:16:41 | yonyonniisan65 | ,06▄13,02▄,13▄06,10▄,04▄11,10▄,10▄02,06▄,10▄12,04▄,04▄12,13▄,10▄02 A BUSY MEETING IS GOING ON NOW IN #/JOIN ITS A JOINT MEETING WITH THE DISCUSSION OF RE-ENSLAVEMENT OF NIGGERS..MESSAGE CHRONO OR VAP0R FOR DETAILSrsoeeytzm: rupil arecacea1 yglukhov ,04▄05,08▄,12▄09,09▄,12▄08,07▄,04▄13,04▄,10▄03,07▄,13▄11,12▄,11▄02,09▄ |
18:16:46 | yonyonniisan65 | ,09▄04,09▄,12▄12,13▄,12▄03,11▄,08▄11,04▄,03▄12,02▄,04▄05,11▄ A BUSY MEETING IS GOING ON NOW IN #/JOIN ITS A JOINT MEETING WITH THE DISCUSSION OF RE-ENSLAVEMENT OF NIGGERS..MESSAGE CHRONO OR VAP0R FOR DETAILSvjdxoasmw: kalkin- azur_kind chemist69 05,07▄,11▄10,05▄,03▄02,03▄,12▄06,11▄,02▄10,05▄,02▄09,03▄,04▄10,05▄,08▄05,06 |
18:17:22 | dom96 | These have been quite prevalent recently |
18:17:33 | Araq | for x in a: for y in b: return x != y |
18:17:56 | Araq | good thing that IRC supports colors |
18:18:10 | dom96 | bells too :) |
18:18:21 | Yardanico | dom96, you was pretty fast |
18:18:27 | * | nastavnic quit (Ping timeout: 240 seconds) |
18:18:39 | Yardanico | 18 to get op and ban him |
18:19:17 | FromGitter | <RedBeard0531> Is is possible to walk two non-closure iterators in parallel, like python's zip? |
18:19:32 | dom96 | Yardanico: yeah, I heard the "bell" and immediately knew it was that spam bot so I acted quickly |
18:20:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:21:56 | FromGitter | <tim-st> @Araq well this works but it's n^2 runtime, I wanted O(n) |
18:23:29 | Araq | I don't think so. I return after the first iteration of the first iteration |
18:30:59 | * | xet7 joined #nim |
18:31:10 | * | nastavnic joined #nim |
18:32:28 | FromGitter | <tim-st> Seems that it only works with closure iterators.. |
18:37:11 | * | claudiuinberlin joined #nim |
18:43:33 | * | UxerUospr joined #nim |
18:55:12 | * | jjido joined #nim |
18:56:13 | * | azur_kind quit (Remote host closed the connection) |
18:58:39 | * | nastavnic quit (Quit: WeeChat 2.0.1) |
19:04:25 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:18:59 | FromGitter | <RedBeard0531> Why does only the second forward declare fail with an "implementation of ... expected" error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a4d2ca30163b02810ab16be] |
19:19:52 | FromGitter | <RedBeard0531> order doesn't matter, it is always the out param that fails |
19:20:52 | FromGitter | <RedBeard0531> I haven't quite figured out the rules for when forward declares of procs are valid and when they aren't. Is it documented anywhere? |
19:21:19 | FromGitter | <stisa> @RedBeard0531 probably because the first one has an implementation in system : https://nim-lang.org/docs/system.html#readFile,string |
19:23:46 | FromGitter | <RedBeard0531> @stisa I'm trying to add the second one in system.nim |
19:34:08 | * | nsf quit (Quit: WeeChat 2.0.1) |
19:40:26 | FromGitter | <mratsim> @RedBeard0531 yes you can walk 2 inline iterators “at the same time” https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/p_accessors.nim#L170 |
19:40:47 | * | yglukhov_ quit (Remote host closed the connection) |
19:43:47 | FromGitter | <mratsim> Basically the approach is similar to Rust iterator, use an `init` template to initialize a state, and use a `next` template to advance the iterators by one, all being inline |
19:45:20 | FromGitter | <RedBeard0531> I've never seen ⚠ in a comment before |
19:45:23 | * | yglukhov joined #nim |
19:45:51 | * | endragor quit (Remote host closed the connection) |
19:46:02 | * | endragor joined #nim |
19:46:55 | * | endragor quit (Remote host closed the connection) |
19:47:21 | * | endragor joined #nim |
19:47:44 | dom96 | ⚠The future is now⚠ |
19:48:05 | FromGitter | <RedBeard0531> @mratsim which arguments are iterators? I thought you can't pass iterators to typed params? |
19:48:48 | FromGitter | <mratsim> None, iterators are yielded there: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/p_accessors.nim#L127-L131 |
19:50:40 | FromGitter | <RedBeard0531> That's making a specific strided iterator, not striding exisiting iterators. I was thinking about something like `for (line1, line2) in zip(lines("file1"), lines("file2")): ...` |
19:51:34 | FromGitter | <RedBeard0531> I don't think it is possible to write that zip today (unless you cheat and load one of the iters into a seq, but that doesn't count...), but I'd love to be proved wrong |
19:51:57 | * | endragor quit (Ping timeout: 265 seconds) |
19:52:38 | FromGitter | <tim-st> are there any calls I can use for the iterator like next()? |
19:52:50 | FromGitter | <tim-st> other than yield |
19:54:55 | dom96 | For closure iterators you just have to call them |
19:55:47 | FromGitter | <tim-st> I have the feeling that closure iterators have a downside and also I would prefer the way with zip() |
19:56:38 | * | endragor joined #nim |
19:59:26 | * | Serenitor joined #nim |
20:06:16 | * | kalkin- quit (Quit: Leaving) |
20:09:15 | * | yglukhov quit (Remote host closed the connection) |
20:14:27 | * | Yardanico quit (Remote host closed the connection) |
20:15:14 | FromGitter | <Varriount> closure iterators are slow compared to inline iterators. |
20:19:30 | FromGitter | <mratsim> @RedBeard0531 Maybe look there: https://github.com/alehander42/zero-functional ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a4d3ad2232e79134dc14959] |
20:20:33 | * | Yardanico joined #nim |
20:26:57 | * | yglukhov joined #nim |
20:29:03 | * | jjido joined #nim |
20:34:07 | * | endragor quit (Remote host closed the connection) |
20:38:18 | * | endragor joined #nim |
20:42:31 | * | nsf joined #nim |
20:46:56 | * | MJCaley quit (Quit: MJCaley) |
20:47:12 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:49:08 | * | MJCaley joined #nim |
20:49:19 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:52:04 | FromGitter | <RedBeard0531> @mratsim if I'm reading this right (and I'm not so good at reading macros yet so that isn't guaranteed) even that zip only works with seqs, not arbitrary iterators: https://github.com/alehander42/zero-functional/blob/master/zero_functional.nim#L47 |
20:52:47 | FromGitter | <RedBeard0531> Oh, that is actually documented: "zip is more special, it can be for now only in the begining, and it can work with n sequences" |
20:53:32 | * | Yardanico quit (Ping timeout: 252 seconds) |
20:55:39 | * | jjido joined #nim |
20:57:49 | * | endragor quit (Remote host closed the connection) |
21:01:40 | FromGitter | <tim-st> btw if I dont explicit say `ref object` the object will always passed as value and the compiler wont change it if seems better? and what was the downside of refs, if I remember correct, it had to do with garbage collection? |
21:02:48 | FromGitter | <RedBeard0531> refs are always heap allocated |
21:03:42 | FromGitter | <RedBeard0531> non-ref objects are passed by (implicit) pointer if the compiler decides it is worth it (nim and the c/c++ compilers have different thresholds for this) |
21:04:47 | FromGitter | <RedBeard0531> IIRC nim does it for objects >24 bytes and the x86_64 sysV ABI (used everywhere except windows) says > 16 bytes (glossing over a *lot* of details) |
21:05:32 | FromGitter | <RedBeard0531> You can take a look at the generated c code in nimcache/ to see what the nim compiler is doing. Checking the c compiler requires reading asm, or ABI documentation. |
21:05:37 | FromGitter | <tim-st> Thanks, now I saw that also value object dont seem to grow more than 16byte and ref is 8byte |
21:05:59 | FromGitter | <tim-st> I cannot read c very good, especially autogenerated .( |
21:06:01 | FromGitter | <tim-st> :( |
21:06:17 | FromGitter | <RedBeard0531> 1) or & means pointer :) |
21:06:28 | FromGitter | <tim-st> ok^^ |
21:06:29 | FromGitter | <RedBeard0531> That was supposed to be an asterisk... |
21:09:53 | * | Yardanico[Phone] quit (Read error: Connection reset by peer) |
21:10:16 | * | Yardanico[Phone] joined #nim |
21:10:17 | FromGitter | <tim-st> so when should I prefer ref over non ref object? I never had to choose with java or python :\ |
21:11:11 | FromGitter | <mratsim> @tim-st do you want value semantics (fully copy on assignment) or reference semantics (copies are shallow) |
21:11:34 | FromGitter | <mratsim> and related questions: how cheap is it to copy your object |
21:11:43 | FromGitter | <tim-st> I think I can achieve all possible ideas using both |
21:12:03 | FromGitter | <mratsim> is your object related to a resource (database connection, file handler, http socket, etc) |
21:12:05 | FromGitter | <tim-st> yes, that was my initial idea, the more fields it has the longer it takes most likely |
21:12:28 | FromGitter | <tim-st> ah, ok. no it's a normal object |
21:12:44 | FromGitter | <mratsim> My rule of thumb would be, if both can fit your need, use the simplest: plain object |
21:13:08 | FromGitter | <tim-st> ok, thanks. so the compiler can not always find out the best way automatically? |
21:13:29 | FromGitter | <mratsim> When passing an object to a function call it will |
21:13:49 | FromGitter | <RedBeard0531> The compiler isn't allowed to change semantics. object vs ref object have different semantics |
21:13:58 | FromGitter | <mratsim> what I’m talking about is in the type declaration ⏎ ⏎ ```type YourObject = object``` [https://gitter.im/nim-lang/Nim?at=5a4d4795b48e8c3566984a10] |
21:15:16 | FromGitter | <mratsim> oh, also inheritance/collections of heterogeneous objects require ref objects as well |
21:16:03 | * | vlad1777d joined #nim |
21:16:33 | FromGitter | <RedBeard0531> btw if you keep the objects in a central repo (like a seq or table) and need to mutate them it can be somewhat error prone to use non-ref object. It is a bit too easy (for my taste) to accidentally write to a copy rather than the "real" object. Conversely, if you use ref objects, it is easy to mutate the main object when you think you are mutating your own private copy. |
21:16:42 | FromGitter | <RedBeard0531> software is hard... |
21:16:55 | FromGitter | <mratsim> memory is hard ;) |
21:17:40 | FromGitter | <RedBeard0531> fuck it, if it can't be done in my 16 registers it isn't worth doing! |
21:18:52 | FromGitter | <tim-st> Ok, thanks. I think I have to research this, I dont have a feeling now for it :( in Java it always worked like I expected, there was one case it didnt that was deep copy |
21:20:07 | FromGitter | <tim-st> but I only needed it one time^^ |
21:25:01 | * | aziz joined #nim |
21:25:34 | FromGitter | <RedBeard0531> If you want works-like-java use ref object |
21:25:38 | * | aziz quit (Client Quit) |
21:38:57 | * | UxerUospr quit (Quit: Lost terminal) |
21:42:43 | * | Trustable quit (Remote host closed the connection) |
21:43:59 | * | Snircle joined #nim |
21:47:32 | * | dandevelo joined #nim |
21:50:06 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
21:51:41 | FromGitter | <data-man> https://github.com/github/explore/pull/129 - Fix a couple things with spacevim, nim topics |
21:53:02 | * | devdri joined #nim |
21:58:14 | * | endragor joined #nim |
22:05:50 | * | Yardanico[Phone] quit (Ping timeout: 260 seconds) |
22:06:41 | * | endragor quit (Ping timeout: 252 seconds) |
22:06:51 | * | Yardanico[Phone] joined #nim |
22:15:05 | * | gokr joined #nim |
22:15:27 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
22:16:02 | * | Jesin quit (Ping timeout: 252 seconds) |
22:23:57 | * | MJCaley quit (Quit: MJCaley) |
22:27:59 | * | Vladar quit (Quit: Leaving) |
22:32:07 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:40:54 | * | rauss quit (Quit: WeeChat 2.0.1) |
22:43:29 | * | rauss joined #nim |
23:20:27 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:22:14 | * | yglukhov quit (Remote host closed the connection) |
23:30:14 | * | endragor joined #nim |
23:30:55 | * | kier quit (Remote host closed the connection) |
23:34:02 | * | kier joined #nim |
23:35:27 | * | endragor quit (Ping timeout: 240 seconds) |
23:40:18 | * | user0 quit (Quit: user0) |
23:49:18 | * | devdri quit () |
23:52:17 | * | yglukhov joined #nim |
23:57:08 | * | yglukhov quit (Ping timeout: 268 seconds) |