00:05:39 | * | rnrwashere quit () |
00:15:46 | ryukoposting | (warning: anime ahead) I'm not the only one that sees this, right https://lewd.pics/p/tdOz.jpg |
00:27:22 | * | Snircle joined #nim |
00:36:19 | FromDiscord | <demotomohiro> @Zevv |
00:36:19 | FromDiscord | <demotomohiro> quote from 2.1 Execution Model in OpenGL 4.6 API Specification (February 2, 2019): |
00:36:20 | FromDiscord | <demotomohiro> |
00:36:20 | FromDiscord | <demotomohiro> > Data binding occurs on call. This means that data passed to a GL command |
00:36:20 | FromDiscord | <demotomohiro> > are interpreted when that command is received. Even if the command requires a |
00:36:22 | FromDiscord | <demotomohiro> > pointer to data, those data are interpreted when the call is made, and any subsequent |
00:36:25 | FromDiscord | <demotomohiro> > changes to the data have no effect on the GL (unless the same pointer is used in a |
00:36:26 | FromDiscord | <demotomohiro> > subsequent command). |
00:36:27 | FromDiscord | <demotomohiro> |
00:36:30 | FromDiscord | <demotomohiro> That means when you write buffer object with ``glBufferData`` or ``glBufferSubData``, memory area given to them doesn't need to be valid after they return. |
00:36:31 | FromDiscord | <demotomohiro> |
00:36:33 | FromDiscord | <demotomohiro> @liquid600pgm |
00:36:35 | FromDiscord | <demotomohiro> If you are using OpenGL core profile, you have to bind vertex array object before calling glDrawElements. |
00:36:37 | FromDiscord | <demotomohiro> Debug Output might also help. |
00:36:39 | FromDiscord | <demotomohiro> https://www.khronos.org/opengl/wiki/Debug_Output |
00:42:21 | * | rnrwashere joined #nim |
00:43:16 | * | noeontheend quit (Ping timeout: 264 seconds) |
00:43:33 | FromDiscord | <exelotl> ryukoposting: lmao |
00:44:24 | FromDiscord | <exelotl> my friend says the only language megumin knows is explosion |
00:47:09 | ryukoposting | lmao |
00:47:39 | ryukoposting | does anyone know where I can find the type definition for addTimer, or just a code snippet showing how it's used? I'm so confused |
00:48:31 | ryukoposting | not type definiton for addTimer, type definition for Callback, sorry |
00:48:44 | ryukoposting | trying to figure out how to use addTimer, or really just get a timed callback honestly |
00:49:49 | disruptek | you mean async futures? |
01:06:50 | * | dddddd quit (Ping timeout: 250 seconds) |
01:17:03 | * | rnrwashere quit (Remote host closed the connection) |
01:21:03 | * | neceve quit (Remote host closed the connection) |
01:51:10 | * | dddddd joined #nim |
02:06:56 | * | banc quit (Quit: Bye) |
02:10:37 | * | arecacea1 quit (Remote host closed the connection) |
02:10:55 | * | arecacea1 joined #nim |
02:12:24 | * | rnrwashere joined #nim |
02:28:19 | * | banc joined #nim |
02:30:50 | * | I_Right_I quit (Remote host closed the connection) |
02:35:13 | * | drewr joined #nim |
02:42:54 | * | Jesin quit (Quit: Leaving) |
02:45:06 | * | Jesin joined #nim |
02:51:34 | * | noeontheend joined #nim |
03:15:18 | * | rnrwashe_ joined #nim |
03:17:45 | * | rnrwashere quit (Ping timeout: 250 seconds) |
03:20:55 | * | chimez joined #nim |
03:21:03 | * | chimez quit (Client Quit) |
03:22:58 | * | rnrwashe_ quit () |
03:23:54 | * | rnrwashere joined #nim |
03:23:54 | * | rnrwashere quit (Client Quit) |
03:38:56 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:42:48 | * | dddddd quit (Remote host closed the connection) |
04:01:53 | ryukoposting | disruptek yuh |
04:02:48 | ryukoposting | I've used the the async stuff before, but I can't find a type definition for Callback anywhere in the docs, even though https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback uses it |
04:06:10 | FromGitter | <Varriount> ryukoposting: Oh good, your around |
04:06:25 | * | arecacea1 quit (Remote host closed the connection) |
04:06:45 | * | arecacea1 joined #nim |
04:12:41 | ryukoposting | yuh |
04:14:39 | FromGitter | <Varriount> ryukoposting: You're at the point where you need to sign AWS requests? |
04:15:06 | ryukoposting | yeah, we've got the v4 signing code almost finished or finished, v2 I believe is either starting or in progress |
04:15:38 | ryukoposting | but the guy working on it is super busy rn |
04:17:18 | FromGitter | <Varriount> Uh, you know I have working v4 signing code, right? |
04:17:42 | ryukoposting | the code you sent wouldn't compile |
04:24:05 | FromGitter | <Varriount> ryukoposting: Even the newer revisions? https://gist.github.com/Varriount/076f406c475b5369301a2fcd7b4527af |
04:24:46 | ryukoposting | yeach chief, what's utils |
04:25:51 | FromGitter | <Varriount> Utility functions required by aws.nim? |
04:26:02 | FromGitter | <Varriount> The gist has multiple files. |
04:26:15 | ryukoposting | aaaaaaaaah there it is |
04:26:51 | ryukoposting | alright I'm just dumb, I'll give it another shot then |
04:27:09 | ryukoposting | I also have actual code to test it out with now lol |
04:28:22 | ryukoposting | is nimcrypto actively maintained? |
04:28:32 | FromGitter | <Varriount> Last I checked, it was. |
04:28:36 | ryukoposting | nice |
04:28:49 | FromGitter | <Varriount> It was the only crypto implementation that allowed streaming data to be used. |
04:29:28 | ryukoposting | ok and calculate_signature is sample code |
04:29:33 | FromGitter | <Varriount> Yes. |
04:29:38 | ryukoposting | neat |
04:29:46 | FromGitter | <Varriount> I was using that code to test against the AWS signature v4 test suite |
04:30:33 | * | rnrwashere joined #nim |
04:30:51 | * | rnrwashere quit (Remote host closed the connection) |
04:30:57 | FromGitter | <Varriount> ryukoposting: There's probably still some "bugs" in the implementation. The V4 signature specification is a bit ambiguous about certain cases. |
04:31:56 | ryukoposting | (as a side node, whoever published a nimble package called "utils" should be skinned alive) |
04:32:31 | ryukoposting | that's what I've heard Varriount |
04:32:50 | * | nsf joined #nim |
04:32:56 | FromGitter | <Varriount> ryukoposting: Oh! So that's why it wouldn't compile originally? |
04:33:18 | ryukoposting | no, that's not it |
04:33:31 | ryukoposting | I just have a room temperature IQ and didn't realize the gist had more than 1 file |
04:38:43 | FromDiscord | <demotomohiro> ``Callback`` type is used for parameter type but it is not exported. |
04:38:43 | FromDiscord | <demotomohiro> It is defined here: |
04:38:43 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L248 |
04:38:44 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1073 |
04:39:24 | ryukoposting | why is it an argument for exported procs if it isn't even exported? |
04:40:25 | ryukoposting | it's the second argument to a bunch of procs, it isn't even something that could be called on the member of another object |
04:40:32 | ryukoposting | at least not without weird cruft |
04:40:40 | FromGitter | <Varriount> ryukoposting: Perhaps it's used by the async macro? |
04:41:10 | ryukoposting | that makes sense |
04:41:22 | ryukoposting | still kind of weird |
04:48:24 | FromGitter | <Varriount> ryukoposting: Feel free to ask me questions. I should be up for a couple more hours |
04:50:26 | FromGitter | <Varriount> the calculate_signature program was written with the AWS V4 signature test suite in mind |
04:55:59 | * | narimiran joined #nim |
05:14:08 | Zevv | @demotomohior: you're absolutely right; my case was about glVertexData (which he was not using) |
05:34:59 | * | rnrwashere joined #nim |
05:35:18 | * | noeontheend quit (Ping timeout: 264 seconds) |
05:36:35 | * | solitudesf joined #nim |
05:48:55 | Zevv | hehe, "room temperature IQ", is that celcius or fahrenheit? |
05:51:18 | * | solitudesf quit (Ping timeout: 245 seconds) |
05:54:08 | * | rnrwashere quit (Remote host closed the connection) |
05:55:43 | * | rnrwashere joined #nim |
05:57:46 | Araq | the new for loop unpacking syntax is so intuitive that I used it without realizing... |
05:57:51 | Araq | :-) |
06:07:06 | * | rnrwashere quit (Remote host closed the connection) |
06:10:41 | * | rnrwashere joined #nim |
06:11:55 | * | krux02 joined #nim |
06:13:41 | * | rnrwashere quit (Remote host closed the connection) |
06:14:47 | * | rnrwashere joined #nim |
06:16:30 | * | PMunch joined #nim |
06:19:32 | FromGitter | <Varriount> Araq: New syntax? |
06:25:13 | * | arecacea1 quit (Remote host closed the connection) |
06:25:31 | * | arecacea1 joined #nim |
06:28:04 | FromGitter | <kayabaNerve> Are there any actual differences between ord and int? |
06:33:29 | FromGitter | <Varriount> @kayabaNerve `int` is a type, not a procedure? So if you do `int(value)`, value must be convertible to an integer |
06:33:49 | FromGitter | <Varriount> Whereas `ord` can be overridden (I think) for a specific type. |
06:34:04 | FromGitter | <kayabaNerve> Thanks |
06:34:08 | leorize | also you can't pass `int()` into `map` :P |
06:35:42 | leorize | Varriount: I believe Araq was talking about this: https://github.com/nim-lang/Nim/commit/001835bdecfb64974b52e91e1167301f66e4c72d |
06:36:11 | FromGitter | <Varriount> leorize: You mean, Nim hasn't had that since forever? |
06:37:17 | leorize | yea? there was a huge post in the forum requesting that syntax iirc |
06:52:10 | * | Arlenx joined #nim |
06:52:22 | * | rnrwashere quit (Remote host closed the connection) |
06:52:46 | * | rnrwashere joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:49 | * | gmpreussner joined #nim |
07:10:56 | * | rnrwashere quit (Remote host closed the connection) |
07:18:42 | * | dddddd joined #nim |
07:27:47 | * | Vladar joined #nim |
07:46:11 | FromGitter | <mratsim> oh? |
07:46:35 | FromGitter | <mratsim> the syntax without parenthesis worked when iterators returned a tuple |
08:06:23 | * | absolutejam joined #nim |
08:07:15 | * | Arlenx quit (Quit: Leaving) |
08:10:40 | * | gangstacat quit (Remote host closed the connection) |
08:17:19 | * | fanta7531 joined #nim |
08:33:51 | * | stefanos82 joined #nim |
08:48:22 | * | gangstacat joined #nim |
09:05:55 | * | floppydh joined #nim |
09:06:18 | Araq | http://gliese1337.blogspot.com/2012/04/schrodingers-equation-of-software.html |
10:07:35 | FromGitter | <kayabaNerve> I think I may have found a bug, but I'm honestly not sure |
10:08:25 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cab1d983ebbdc55b37fdb93] |
10:08:37 | FromGitter | <kayabaNerve> This is perfectly valid code, without the `| int`. |
10:09:17 | FromGitter | <kayabaNerve> Even with the nesting. When you add the second `| int`, it's a compile time error of `Error: undeclared identifier: '|'` |
10:09:39 | FromGitter | <mratsim> what happens with "or" instead? |
10:10:08 | FromGitter | <kayabaNerve> Works fine |
10:10:16 | FromGitter | <kayabaNerve> Thanks for the workaround. I kinda needed this. |
10:10:37 | FromGitter | <kayabaNerve> So should I file a bug for the `|` part, noting the workaround of `or`? |
10:11:37 | FromGitter | <kayabaNerve> I forget how I found out Nim supports this feature. I can't find it in the manual. I'm guessing it's working off the concepts system but... I also don't have experience there. |
10:16:52 | FromGitter | <mratsim> I think it's in the typeclass section of the manual |
10:17:05 | FromGitter | <mratsim> it predates concepts |
10:17:36 | FromGitter | <mratsim> concepts are only about 2.5 years old iirc |
10:21:41 | FromGitter | <kayabaNerve> I've only been using Nim on a heavy basis for an year now. |
10:23:09 | FromGitter | <liquid600pgm> what proc do I use to convert a `ptr char` and length to a `string`? |
10:28:34 | * | lritter joined #nim |
10:29:09 | Araq | newString + copyMem |
10:29:19 | FromGitter | <liquid600pgm> thanks! |
10:32:27 | FromGitter | <liquid600pgm> something like ⏎ ⏎ ```var msg = newString(length) ⏎ copyMem(msg.unsafeAddr, msgPtr, length)``` [https://gitter.im/nim-lang/Nim?at=5cab233b1f6e900d5efa779f] |
10:32:45 | Araq | yes |
10:33:02 | FromGitter | <liquid600pgm> hmm, I get a segmentation fault for some reason |
10:34:23 | Araq | unsafeAddr(msg[0]) |
10:34:25 | Araq | obviously |
10:34:33 | Araq | don't copy into the string's header |
10:34:38 | FromGitter | <liquid600pgm> aah, forgot the `[0]` |
10:34:42 | FromGitter | <liquid600pgm> of course |
10:42:03 | FromGitter | <kayabaNerve> Araq: Have a second? |
10:45:17 | Araq | hardly but shoot |
10:48:44 | FromGitter | <kayabaNerve> I had my issue on block hints closed because `used` exists and you could push all hints off. |
10:49:11 | FromGitter | <kayabaNerve> When I just found an error with Type Classes, and tested on devel, I saw that was already fixed. I also saw you could no longer push all hints off. |
10:49:25 | * | NimBot joined #nim |
10:49:40 | FromGitter | <kayabaNerve> I was curious if you'd accept a PR to re-enable that (after I reopen the issue, explain the update...). |
10:51:21 | Araq | "could no longer push" ... what are you talking about, nothing was changed |
10:51:58 | FromGitter | <kayabaNerve> From stable to devel. |
10:52:18 | FromGitter | <kayabaNerve> On stable, 0.19.4, you can push all hints off, and pop it back later. |
10:52:23 | FromGitter | <kayabaNerve> On devel, just compiled, that does nothing. |
10:53:47 | * | Araq shrugs |
10:53:54 | Araq | give us some snippet to reproduce |
10:53:57 | FromGitter | <kayabaNerve> https://imgur.com/a/I9S2rqF |
10:54:27 | Araq | no, write a real bug report |
10:54:36 | FromGitter | <kayabaNerve> That test can be... 'fixed' via the `used` pragma, I know. |
10:54:53 | FromGitter | <kayabaNerve> I was trying to send that before I got your message :P |
10:55:12 | FromGitter | <kayabaNerve> I'll add a snippet to the existing issue or a new one, your choice. |
10:59:11 | * | neceve joined #nim |
11:04:08 | FromGitter | <kayabaNerve> I was writing the MWE, and it turns out that pushing/popping `hints: off` works, it's just that no longer affects generated procs `XDeclaredButNotUsed`. Using both workarounds (`used` and `push hints:off`) in tandem solves any issue. |
11:04:23 | FromGitter | <kayabaNerve> So never mind, I guess? Sorry for bringing you into this. |
11:06:13 | FromGitter | <liquid600pgm> oh gosh, I just noticed the issue |
11:06:43 | FromGitter | <liquid600pgm> (https://files.gitter.im/nim-lang/Nim/Duf7/image.png) |
11:07:03 | FromGitter | <liquid600pgm> it's all \`=destroy\`'s fault |
11:07:41 | FromGitter | <liquid600pgm> basically, it destroyed the window too early, right when a glDrawElements was about to happen |
11:07:58 | FromGitter | <liquid600pgm> and destroying a window invalidates its GL context |
11:08:02 | * | fredrik92 is now known as couven92 |
11:09:24 | Araq | liquid600pgm: if you have =destroy you also better have = and =sink |
11:09:35 | Araq | will probably enforce it soon |
11:09:35 | FromGitter | <liquid600pgm> what are those for? |
11:09:57 | FromGitter | <liquid600pgm> I know =, but what's =sink |
11:09:59 | FromGitter | <liquid600pgm> ? |
11:10:29 | Araq | the move operator |
11:10:38 | FromGitter | <liquid600pgm> ahh, right |
11:11:21 | FromGitter | <liquid600pgm> I thought =destroy was basically a finalizer for objects that are about to get garbage collected |
11:11:35 | * | Vladar quit (Remote host closed the connection) |
11:11:55 | * | Vladar joined #nim |
11:12:01 | Araq | no. |
11:12:30 | FromGitter | <liquid600pgm> right, so how do I create a finalizer then? |
11:12:48 | Araq | new(result, finalizerHere) |
11:13:20 | FromGitter | <liquid600pgm> that's what I thought I should do, but then saw `=destroy` as a "cleaner solution" and switched to it |
11:13:29 | * | clyybber joined #nim |
11:13:31 | FromGitter | <liquid600pgm> perhaps the docs should be more clear on what it does |
11:17:19 | FromGitter | <liquid600pgm> so I deleted =destroy for my window, but the error still persists for no apparent reason |
11:17:53 | FromGitter | <liquid600pgm> I have absolutely no idea what the driver is doing, but it seems as if it executes `glVertexAttribPointer` later than it should |
11:41:58 | krux02 | liquid600pgm: it is not all the drivers fault. |
11:42:24 | FromGitter | <liquid600pgm> it's strange then that the window is closed *right before* my call to `glDrawElements` |
11:44:44 | krux02 | I recommend you to use the functions from GL_ARB_direct_state_access everywhere, it prevents bugs. |
11:46:13 | krux02 | what function closes the window? |
11:46:58 | FromGitter | <liquid600pgm> glXDestroyWindow, right after that glXDestroyContext |
11:47:16 | krux02 | and what function call glXDestroyWindow? |
11:49:04 | krux02 | this doesn't seems to be a driver bug |
11:49:27 | krux02 | it seems to be related to using nim correctly. |
11:51:44 | FromGitter | <liquid600pgm> how do I find out? |
11:52:25 | FromGitter | <liquid600pgm> qapitrace only shows me the function that was called and its params, not the call stack |
11:52:53 | Zevv | writeStackTrace()? |
11:53:07 | Zevv | or a breakpoint in Your Favorite Debugger |
11:54:16 | krux02 | Zevv, we don't really support any other debugger other than gdb |
11:54:30 | Zevv | I know :) |
11:54:39 | * | fanta7531 quit (Quit: fanta7531) |
11:54:44 | krux02 | at least we have gdb now |
11:54:46 | FromGitter | <liquid600pgm> problem is, the call is done somewhere in (I think) GLFW and I don't use my own generated GLX wrapper |
11:55:07 | Zevv | you shoul still be able to get a full traceback - the close must be coming somewhere through your code |
11:55:51 | krux02 | or you can show me your code and I might be able to tell you |
11:56:21 | FromGitter | <liquid600pgm> it's not, I only have an `updateEbo` call, which doesn't close the window, and then there's a `glDrawElements` call which does cause the window to get closed |
11:56:41 | krux02 | do you have the code online? |
11:56:55 | FromGitter | <liquid600pgm> wait, let me push a commit to my repo |
11:58:14 | FromGitter | <liquid600pgm> here: https://github.com/liquid600pgm/rapid/blob/master/src/gfx/gfx.nim#L201 |
11:58:28 | FromGitter | <liquid600pgm> this is *precisely* where I draw glDrawElements |
12:01:00 | krux02 | yay yet another game engine :P |
12:01:39 | Zevv | we can't all use Pygame |
12:01:42 | FromGitter | <liquid600pgm> what's wrong with making my own? |
12:02:02 | FromGitter | <liquid600pgm> I have my own requirements which this engine aims to satisfy |
12:02:03 | Zevv | nothing at all! |
12:02:19 | FromGitter | <mratsim> I still think push XDeclaredButNotUsed should be enabled for blocks @Araq @kayabaNerve (https://github.com/nim-lang/Nim/issues/10973). |
12:02:30 | FromGitter | <mratsim> probably other pragmas have this push/pop issue |
12:03:23 | FromGitter | <liquid600pgm> I don't intend to make this engine super wide-spread, I'm just going to use it in my games and that's it |
12:03:27 | FromGitter | <mratsim> it can be low prio though (unless another pragmas without any workaround pops out |
12:04:41 | krux02 | well I can't build it at all |
12:05:17 | krux02 | I just tried to build it |
12:05:57 | Zevv | same here, don't seem to have vulkan headers in my glfw |
12:06:10 | krux02 | can't find glfw/src/x11_monitor.c |
12:08:09 | krux02 | liquid600pgm: did you try to set a breakpoint in gdb via ``break glXDestroyWindow``? |
12:08:51 | FromGitter | <liquid600pgm> I'm not really that experienced with gdb so I didn't know I could just break into a function like that |
12:08:59 | krux02 | yes you can |
12:09:06 | FromGitter | <liquid600pgm> thanks for the tip |
12:09:09 | FromGitter | <kayabaNerve> @mratsim I'm copying the function in a macro, and I don't want any hints to appear from the copy, whether caused by macro or present in the original one. `push hints: off` disables everything on stable. On devel, you need to use that and `used` in the ProcDef to mute everything. `push hints: off` still handles other hints. |
12:09:16 | krux02 | you need to build with "--debugger:native" though |
12:09:23 | FromGitter | <liquid600pgm> yeah, I know |
12:09:25 | dom96 | Araq/krux02/narimiran: any thoughts about this? https://github.com/nim-lang/Nim/pull/10932 |
12:09:51 | narimiran | dom96: my thought: "You can't just break this module like that." ;) |
12:10:00 | FromGitter | <mratsim> @kayabaNerve you can also push: used |
12:10:41 | dom96 | narimiran: Agreed. |
12:10:47 | FromGitter | <mratsim> but I'm also using workarounds because for testing I want some proc to be "used" but not for normal code |
12:11:27 | krux02 | liquid600pgm: it might be though that glXDestroyWindow isn't actually called glXDestroyWindow in the binary. So you might also try ``rbreak glXDestroyWindow``. |
12:13:28 | FromGitter | <mratsim> @dom96, ini comments are supposed to be #, not & or did I miss the memo |
12:13:31 | FromGitter | <liquid600pgm> both don't break, it just continues until the segfault |
12:13:43 | dom96 | mratsim: ini isn't standardised |
12:14:37 | FromGitter | <mratsim> then we can add a "comment" char option. |
12:46:04 | * | Snircle joined #nim |
13:02:16 | FromGitter | <liquid600pgm> krux02: rbreak also doesn't break |
13:11:38 | krux02 | well I guess the debugger doesn't see the symbol then |
13:13:19 | shashlick | Did devel get fixed? Nightlies failed |
13:13:41 | narimiran | shashlick: yes, devel is now green |
13:13:52 | shashlick | Cool |
13:20:37 | FromGitter | <liquid600pgm> seems I can't use gdb, I can't even set a simple breakpoint lol |
13:21:16 | FromGitter | <liquid600pgm> I tried setting a breakpoint at glDrawElements and it doesn't work too |
13:21:39 | narimiran | https://www.youtube.com/watch?v=DmYOPkI_LzU this video helped me use gdb with nim for the first time |
13:23:02 | krux02 | I just tried it as well the gl functions are "special" |
13:23:38 | krux02 | they are function pointers not not normal functions |
13:23:50 | FromGitter | <liquid600pgm> yeah, that's probably why it doesn't work |
13:23:56 | krux02 | liquid600pgm what opengl wrapper are you using |
13:24:15 | FromGitter | <liquid600pgm> glad |
13:24:22 | krux02 | yea, me too |
13:24:30 | FromGitter | <liquid600pgm> for OpenGL 3.3 core profile |
13:24:56 | krux02 | you can see if you can configure glad in a way that you will see function names |
13:25:19 | FromGitter | <liquid600pgm> I just found this https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown#backtrace-capturing |
13:25:24 | FromGitter | <liquid600pgm> how could I miss this |
13:28:26 | * | kapil____ joined #nim |
13:29:20 | FromGitter | <liquid600pgm> yeah now qapitrace doesn't show any calls, how nice |
13:29:55 | Zevv | why weren't you able to get a backtrace on the segfault in gdb? |
13:30:25 | krux02 | https://github.com/Dav1dde/glad#cc-debug |
13:30:35 | krux02 | Zevv, segfault was too late |
13:31:14 | FromGitter | <liquid600pgm> that segfault occurs somewhere in the nvidia driver, that's all I know |
13:31:38 | FromGitter | <liquid600pgm> and I know that it occurs because the GL context is destroyed right before my glDrawElements call |
13:32:05 | FromGitter | <liquid600pgm> KHR_debug doesn't really help because no error message is generated before the segfault |
13:32:05 | Zevv | valgrind? |
13:32:36 | FromGitter | <liquid600pgm> that won't tell me anything new (I tried when this error first occured) |
13:33:15 | FromGitter | <liquid600pgm> I need the backtrace from *right before* the segfault occurs |
13:33:28 | krux02 | that link I sent you for glad debug, that is what you need for nim as well |
13:33:40 | krux02 | the functions are all function pointers |
13:33:47 | krux02 | the symbols are known in gdb |
13:34:14 | krux02 | print (long*)glDrawBuffer_jkzdyP5IArhk9cqJik5N15g |
13:34:20 | krux02 | that one for example works |
13:34:29 | krux02 | the problem is, it is not a breakable symbol |
13:34:58 | krux02 | at program start it's value is also 0 |
13:36:10 | Zevv | its cb(fd: AsyncFD): bool |
13:36:18 | Zevv | oops |
13:37:03 | * | MasterdonY quit (Quit: ZNC - http://znc.in) |
13:37:41 | * | masterdonx joined #nim |
13:38:42 | FromGitter | <liquid600pgm> all right, I had enough |
13:38:48 | FromGitter | <liquid600pgm> I'm going to start from the beginning |
13:39:49 | FromGitter | <mratsim> People said that and spent their life implementing a CSV parser ;) |
13:40:19 | FromGitter | <liquid600pgm> I mean, I have no idea what could be wrong |
13:40:20 | Zevv | well, that's not trivial, is it |
13:40:38 | Zevv | liquid600pgm: what would I need to do to get your code running? |
13:40:39 | FromGitter | <liquid600pgm> I just prefer to do a solid re-write than spend 3 more days debugging this code |
13:40:47 | FromGitter | <liquid600pgm> Zevv: what OS? |
13:40:59 | Zevv | debian unstable or ubuntu 16.04 |
13:44:49 | FromGitter | <liquid600pgm> all you'll need is GLFW's dependencies (https://www.glfw.org/docs/latest/compile.html#compile_deps), everything else is pure Nim |
13:45:00 | * | nsf quit (Quit: WeeChat 2.4) |
13:45:25 | Zevv | is everything added to your repo? I don't have glfw/src/posix_tls.c for example |
13:46:29 | Zevv | ok, built |
13:46:38 | Zevv | I added upstream glfw to rapid/src |
13:47:52 | Zevv | nimble test opens a blue window, how do I reproduce your crash? |
13:49:10 | FromGitter | <liquid600pgm> that's strange, is there a white triangle in the window? |
13:50:00 | Zevv | nope |
13:50:21 | FromGitter | <liquid600pgm> that's completely different from what I get, what about console output? |
13:50:27 | Zevv | debug: GL | kind 33360, severity 37191: Scanning index buffer to compute index buffer bounds. Use glDrawRangeElements() to avoid this. |
13:50:30 | Zevv | a thousand times |
13:50:37 | Zevv | hint :) |
13:51:06 | FromGitter | <liquid600pgm> that's *very* different from what I get, what drivers are you on? |
13:51:35 | Zevv | OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) |
13:52:20 | FromGitter | <liquid600pgm> so now for sure that crash is caused by the nvidia driver |
13:52:26 | Zevv | you could maybe try to force linking to mesa or swiftshader instead of nvidia to force software rendering? |
14:01:09 | * | PMunch quit (Remote host closed the connection) |
14:18:23 | * | solitudesf joined #nim |
14:32:41 | dom96 | wow, 3D development sounds fun when you get different behaviour for each graphics driver |
14:34:55 | FromGitter | <liquid600pgm> yeah, for example, there's an nvidia specific thing where it tells you that a buffer object has just been created *every single time you do so* |
14:35:23 | FromGitter | <liquid600pgm> yet it doesn't give you **any** optimization hints, like Mesa does |
14:35:33 | * | Trustable joined #nim |
14:44:01 | * | fanta7531 joined #nim |
14:44:35 | * | noeontheend joined #nim |
14:46:57 | * | abm joined #nim |
14:47:51 | * | ng0 joined #nim |
14:54:39 | clyybber | dom96 That's why vulkan is a good thing |
14:54:55 | FromGitter | <mratsim> But Apple went solo ... |
14:54:59 | * | clyybber is happy to not deal with buggy openGL drivers |
14:55:14 | * | Xe quit (Quit: WeeChat 1.9.1) |
14:56:16 | clyybber | mratsim: I honestly don't care about apple. If they *want* to fuck their customers they can. But I won't support them by adding support for their proprietary crap, |
14:57:41 | clyybber | sadly/luckily theres vulkan->metal |
14:57:49 | dom96 | How does Vulkan solve this? Isn't it possible to get poorly implemented Vulkan drivers? |
14:58:56 | clyybber | dom96 yeah, but generally it's harder for the manufacturers to fuck up the vulkan implementation |
14:59:12 | clyybber | since vulkan does not do so much by itself. |
15:00:03 | * | couven92 quit (Quit: Client disconnecting) |
15:00:43 | clyybber | As in, the API user has to do more of the things the opengl driver implementation did for you. |
15:01:28 | clyybber | it's just much more verbose. |
15:01:40 | FromGitter | <mratsim> DX12 on Vulkan works great in Linux btw |
15:01:55 | clyybber | yeah, wine has done a really great job at that |
15:02:16 | clyybber | its amazing, a year ago DX12 support was nothing. |
15:02:25 | * | Xe joined #nim |
15:05:59 | * | fanta7531 quit (Quit: fanta7531) |
15:12:22 | * | noeontheend quit (Remote host closed the connection) |
15:25:35 | FromGitter | <liquid600pgm> I just rewrote the whole thing, making it much more bare-bones yet it *still* crashes for the same reason |
15:26:19 | FromGitter | <liquid600pgm> I bind the vertex array, the window gets closed for no reason, and the call to glDrawArrays occurs |
15:26:35 | FromGitter | <liquid600pgm> vertex buffer* that is |
15:27:19 | FromGitter | <liquid600pgm> it all worked until I put my seq of vertex data into an object |
15:31:26 | shashlick | What os @liquid600pgm |
15:31:38 | FromGitter | <liquid600pgm> fedora 29 |
15:45:37 | * | rnrwashere joined #nim |
15:50:27 | * | noonien joined #nim |
15:52:09 | * | MightyJoe joined #nim |
15:55:04 | * | cyraxjoe quit (Ping timeout: 268 seconds) |
15:57:22 | * | kapil____ quit (Quit: Connection closed for inactivity) |
16:05:36 | * | rnrwashe_ joined #nim |
16:07:25 | WilhelmVonWeiner | if calling a function in the form obj.f(), should I keep or leave parens? |
16:08:09 | dom96 | keep |
16:08:47 | * | rnrwashere quit (Ping timeout: 240 seconds) |
16:11:40 | WilhelmVonWeiner | why? |
16:13:20 | Araq | leave them out |
16:13:46 | narimiran | and to have a third opinion: it depends :D |
16:14:20 | WilhelmVonWeiner | sorry dom96 but Araq has tied my hands |
16:15:00 | dom96 | It does depend indeed |
16:15:16 | dom96 | leaving them out is ambiguous ;) |
16:15:27 | WilhelmVonWeiner | is it? |
16:15:34 | Araq | no it is ambiguous when the compiler tells you it is. |
16:16:10 | Araq | and leaving out the () is much of the point of having a syntax |
16:16:59 | * | fanta7531 joined #nim |
16:18:02 | clyybber | Araq: Can I use the header pragma for a c macro? |
16:20:19 | Araq | sure |
16:22:13 | * | noeontheend joined #nim |
16:25:46 | clyybber | nice. |
16:26:00 | clyybber | wrapping alsa sure is a feat |
16:40:49 | * | rnrwashe_ quit () |
16:41:55 | * | kapil____ joined #nim |
16:43:55 | * | noeontheend quit (Remote host closed the connection) |
16:44:02 | * | clyybber is not so sure it's a good idea wrapping alsa |
16:44:08 | Zevv | haha |
16:44:16 | Zevv | alsa is hell |
16:45:47 | Zevv | but cant you get away with a small subset? |
16:46:21 | clyybber | yeah, but wrapping that subset is the problem |
16:46:39 | clyybber | I actually wanted to only wrap alsa's seq API |
16:48:29 | clyybber | but those headers require things out of the other headers and all that jazz |
16:49:39 | Zevv | can't you get there without the headers? |
16:50:20 | clyybber | Zevv Hmm, you mean just wrapping whatever I need with importc and header |
16:50:47 | leorize | you don't even need header |
16:50:52 | Zevv | should be doable if the structs aren't not too complicated |
16:50:59 | leorize | just importc the procs you need |
16:51:07 | Zevv | you can just define Nim objects which are binary compatible with the alsa data structures |
16:51:12 | Zevv | define some enums, and procs, and you're good to go |
16:51:23 | clyybber | leorize I need to have #include <alsa/asoundlib.h> generated in the source code though |
16:51:44 | clyybber | Zevv: Yeah, that's essentially what I'm doing. |
16:51:54 | clyybber | with the help of c2nim |
16:52:00 | clyybber | but there are so many |
16:52:49 | clyybber | and for some reason alsa has to fuck my head with 2 type aliases per struct... |
16:53:12 | Zevv | let me see, did you give nimterop a try yet? |
16:53:16 | clyybber | one with the _t suffix, and one with an underscore prefix, which in turn fucks c2nim |
16:53:25 | Zevv | ./toast -rnp /usr/include/alsa/seq.h |
16:53:47 | clyybber | Zevv: Nah, I want to keep it as "simple" as possible |
16:53:51 | Zevv | http://paste.debian.net/plain/1076680 |
16:53:53 | Zevv | this is what you get |
16:54:32 | Zevv | you don't need nimterop in your project, you can use it like c2nim; sometimes c2nim gives better results, sometimes nimterop does |
16:54:49 | clyybber | oh, alright. thanks |
16:55:02 | clyybber | but c2nim actually works with some postprocessing bash |
16:55:18 | Zevv | ask the nimterop people how to get the best results |
16:55:20 | clyybber | and the problem is seq.h doesn't suffice |
16:55:26 | * | I_Right_I joined #nim |
16:55:29 | clyybber | Zevv: aka shashlick? |
16:55:30 | Zevv | no, but nimterop can recurse and find whatever is needed |
16:55:38 | Zevv | there problem is that sometimes it pulls in half the world, though |
16:55:43 | clyybber | lol |
16:55:48 | clyybber | but thats a nice feature |
16:56:05 | * | _Raid_ joined #nim |
16:56:55 | clyybber | and then alsa can't have a fucking normal header to just include, no. They have a makefile which builds the header, depending on build variables |
16:57:53 | * | _Raid_ quit (Client Quit) |
16:58:18 | FromGitter | <liquid600pgm> I found my problem! apparently you need to bind your VBO before you declare your vertex attributes, and I didn't think of that. |
16:58:32 | clyybber | \o/ |
16:58:46 | * | _Raid_ joined #nim |
16:58:58 | Zevv | haha |
16:59:15 | Zevv | opengl is always a PITA. *everything* needs to be in place, or you get either a black screen or a black screen |
16:59:19 | Zevv | or a segfault :) |
16:59:30 | Zevv | congrats |
16:59:42 | clyybber | vulkan is a bit nicer in that regard |
16:59:42 | * | I_Right_I quit (Ping timeout: 255 seconds) |
16:59:54 | clyybber | with validation layers at least |
17:00:00 | clyybber | without them... not so much |
17:00:20 | Zevv | crayons is even more fool proof |
17:01:53 | clyybber | * is wondering if its a better idea to build a pure C midi library and then wrap that with nim |
17:05:39 | * | rnrwashere joined #nim |
17:05:55 | Araq | no |
17:06:09 | Araq | build a --newruntime midi library |
17:07:48 | * | noeontheend joined #nim |
17:07:52 | FromGitter | <liquid600pgm> why create a pure C MIDI lib and wrap that if you can just write a Nim library for that? |
17:08:46 | clyybber | yeah, because creating a wrapper around alsa is tricky |
17:09:03 | FromGitter | <liquid600pgm> MIDI is standardized, for device communication all you'll need is some way of sending and receiving serial data from USB |
17:09:21 | clyybber | I want to support the alsa_seq api |
17:09:24 | clyybber | though |
17:09:41 | Zevv | how do you plan to integrate with the rest of your app; main loop, timing, etc? |
17:09:42 | clyybber | and possibly the jack api too (although jack implements the alsa_seq api too) |
17:12:41 | clyybber | Zevv: WDYM? |
17:13:22 | clyybber | for now I just want to make a midi sequencer library for nim |
17:18:06 | * | clyybber wonders why sed exists, when there is perl |
17:19:18 | Zevv | I just learned sed is as old as I am. amazing |
17:31:17 | * | druonysus quit (Ping timeout: 245 seconds) |
17:34:27 | clyybber | Araq: Will do. Though I doubt --newruntime will affect much. |
17:34:45 | clyybber | Or do you mean I should use refs instead of pointers |
17:34:51 | clyybber | and owned refs |
17:36:07 | * | noeontheend quit (Ping timeout: 268 seconds) |
17:37:41 | shashlick | Let me know how nimterop does with alsa |
17:37:44 | shashlick | Happy to help |
17:38:31 | shashlick | If nothing else use -p to process the preprocessor stuff out |
17:38:47 | shashlick | Then use nimterop or c2nim |
17:38:48 | Zevv | hi shashlick; I forgot, toast was able to dynlib instead of header importc's, right? |
17:38:51 | FromGitter | <samdmarshall> @Araq hey, I'm not sure I am understanding your suggestion here: https://github.com/nim-lang/nimble/issues/625#issuecomment-480772731 I seem to keep running into errors with module-names or import/include behavior as the properties in the .nimble file don't have a var/let/const attached. I have constructed a macro to intake and process the data at compile-time but seems like an ugly solution to this |
17:39:12 | clyybber | shashlick Does -p use gcc as its preprocessor? |
17:39:24 | shashlick | Zevv: I don't think so yet but minor fix for that |
17:39:39 | Zevv | ah ok, would be cool |
17:39:50 | Araq | sandmarshall: well yeah, it requires something like 'var version: string' |
17:40:15 | shashlick | Yes it is gcc right now but works with clang too |
17:40:30 | shashlick | Can always be expanded |
17:40:39 | _Raid_ | Hey,in nim whats the most efficient way to convert an array of chars to a string? |
17:43:38 | FromGitter | <samdmarshall> @Araq that seems to break the parsing of the nimble file. I had a thought about if I could get the chunk of text that gets returned from the `include` statement, then a very small macro should be able to nicely wrap that into a `const` def block but i'm not that clever with macros to figure out the first part of that :\ |
17:43:45 | clyybber | shashlick Can nimterop handle macros with concatenation ## ? |
17:51:23 | * | floppydh quit (Quit: WeeChat 2.4) |
17:52:05 | * | fanta7531 quit (Quit: fanta7531) |
17:52:24 | livcd | How should I do the error checking for a winapi when a winapi function returns something when it succeeds and it returns nil when it does not ? |
17:55:24 | clyybber | Araq: How do multiple arguments for c2nim's --assumedef option look? |
17:56:06 | clyybber | I'm trying --assumedef:SOMETHING,OTHERTHING but it doesn't work |
18:00:20 | * | rnrwashe_ joined #nim |
18:01:32 | * | noeontheend joined #nim |
18:04:15 | * | rnrwashere quit (Ping timeout: 264 seconds) |
18:09:17 | FromDiscord | <demotomohiro> @livcd I think you need to call GetLastError function. https://msdn.microsoft.com/en-us/library/windows/desktop/ms679360(v=vs.85).aspx |
18:11:38 | _Raid_ | so I am guessing this is the fastest way to copy an array of chars to a string ----> https://pastebin.com/JPLhvM6Q |
18:14:13 | _Raid_ | but if there is a better method than copyMem() plz let me know |
18:16:59 | Araq | clyybber: --assumedef:a --assumedef:b |
18:20:00 | * | zielmicha__ quit (Read error: Connection reset by peer) |
18:20:15 | * | msmorgan quit (Ping timeout: 252 seconds) |
18:20:15 | * | nimblepoultry quit (Ping timeout: 252 seconds) |
18:20:38 | * | zielmicha__ joined #nim |
18:20:43 | * | nimblepoultry joined #nim |
18:21:34 | * | msmorgan joined #nim |
18:21:41 | * | JStoker quit (Ping timeout: 250 seconds) |
18:23:02 | * | JStoker joined #nim |
18:26:26 | * | theelous3__ joined #nim |
18:26:40 | FromGitter | <samdmarshall> @Araq is there a way I can dump or otherwise iterate/access what is defined during compile time. I know there are ways to check for specific things but I haven't seen anything with regards to seeing what exists |
18:26:53 | * | noeontheend quit (Ping timeout: 250 seconds) |
18:44:36 | * | uvegbot quit (Ping timeout: 250 seconds) |
18:46:10 | * | nsf joined #nim |
18:54:36 | * | noeontheend joined #nim |
19:19:25 | * | clyybber quit (Quit: WeeChat 2.4) |
19:22:48 | * | noeontheend quit (Ping timeout: 255 seconds) |
19:29:31 | Zevv | Araq: I was looking to improve the performance of bit sets. bitsets.nim mentions in comments that U8 is used to "avoid issues with cross-compiling", can you recall what issues you expect here? |
19:32:42 | livcd | what would be the equivalent of this in nim ? lpservice = new ENUM_SERVICE_STATUS [dwBytes]; |
19:33:59 | * | Trustable quit (Remote host closed the connection) |
19:36:02 | FromGitter | <arnetheduck> Zevv, if you want to take it over, https://github.com/nim-lang/Nim/pull/9029 has some improvements, specially in removing the ugly -d option to select sane or insane behavior.. |
19:37:22 | * | kapil____ quit (Quit: Connection closed for inactivity) |
19:37:46 | shashlick | @Clyybber can give me an example? Right now only numeric defines are translated |
19:38:46 | FromGitter | <arnetheduck> at status we've already forked it though, except for the builtins (maybe), the rest could live in a separate library easily.. specially that new macro stuff is.. different from our needs |
19:38:49 | shashlick | I'm more wondering why you'd need this in Nim |
19:40:31 | Araq | arnetheduck: any opinion on my 'owned ref' RFC? |
19:41:33 | FromGitter | <arnetheduck> Araq, tbh, I haven't had time to give it the time and focus it deserves |
19:42:02 | FromGitter | <arnetheduck> intuitively, I like it conceptually, but the devil is in the details |
19:42:30 | Araq | sure, fair enough. |
19:44:48 | * | rnrwashe_ quit (Remote host closed the connection) |
19:44:54 | _Raid_ | how's the newruntime coming alone? |
19:45:05 | _Raid_ | along* |
19:45:50 | Araq | _Raid_: strutils' tests are beginning to work, next is koch.nim then we will get serious and port an async program |
19:46:41 | Araq | in the worst case we'll have a *much* better --gc:none alternative |
19:47:08 | FromGitter | <arnetheduck> > btw, Araq, the new owner thing, would it cover the following scenario: ⏎ > * I have some `state` which is a ref object ⏎ > * I compute a cache over that `state` ⏎ > * I want to make sure that the `state` does not change while the cache "exists" (by scoping cache object) ⏎ > something like: ... [https://gitter.im/nim-lang/Nim?at=5caba53cc55bd14d35af9fac] |
19:48:22 | Araq | unclear, are you asking about immutability? |
19:49:06 | FromGitter | <arnetheduck> no, just that as long as cache exists and holds a (non-owning) ref to `state`, I can't create another owning ref |
19:49:41 | Araq | well but who owns the cache entry? the cache? |
19:50:04 | FromGitter | <arnetheduck> yeah, just some local with a scoped duration |
19:50:17 | FromGitter | <arnetheduck> so I compute a cache over state, then use it |
19:50:40 | FromGitter | <arnetheduck> I want to ensure that `state` doesn't change while `cache` is around |
19:51:14 | Araq | but your local doesn't own the cache entry so it cannot outlive the cache |
19:51:44 | Araq | (checked at runtime, I know, I know, give me a break. We can add more borrow checks later.) |
19:52:15 | FromGitter | <arnetheduck> so `cache` is the cache entry here, if I understand your question right |
19:52:31 | FromGitter | <arnetheduck> ie I compute it from `state` - say that it's an index into a vector |
19:53:41 | Araq | ok, well if 'someFunc' doesn't play nice and invalidates the cached result you'll get a runtime error |
19:54:01 | FromGitter | <arnetheduck> and what exactly causes that runtime error? |
19:54:26 | Araq | cache means the object's refcount is > 0 |
19:55:12 | FromGitter | <arnetheduck> so basically, when I take a non-owning ref, refcount goes up.. then if I try to mutate through owning ref and refcount > 0, runtime error |
19:55:55 | Araq | no, mutations are fine but if you lose the owned pointer and it gets free()d then it asserts the RC == 0 |
19:56:17 | livcd | how i can get this in Nim ? https://glot.io/snippets/fb43trn74x oO |
19:56:43 | Araq | think about it this way: Instead of detecting dangling pointer *reads*, it detects dangling pointers and assumes they might be used later on for a read |
19:57:12 | Araq | so instead of a read barrier we can use reference counts to detect the bugs |
19:58:25 | FromGitter | <arnetheduck> ok, I need to make a more detailed pass over the proposal then - in particular, it sounds like it won't be enough on its own to provide a safe way to pass stuff between threads |
19:59:25 | * | nsf quit (Quit: WeeChat 2.4) |
19:59:55 | Araq | it's enough if you enforce RC == 0 when passing the owned ref to a different thread |
20:00:21 | FromGitter | <arnetheduck> yeah, but is there a language construct for that? |
20:00:31 | Araq | but for thread interop you might be better off with the classic uniquePtr. |
20:01:16 | Araq | Please notice that with the destructors we can replicate C++'s unique and shared pointers. However, it was unclear what to do with the builtin 'ref' that is everywhere |
20:01:45 | Araq | and the proposal claims these are exactly the semantics that fit the stdlib's needs best. |
20:01:51 | FromGitter | <arnetheduck> what happens in (modern) c++ is that you generally start off with uniqueptr, then you promote them to shared when needed (by moving the unique ptr into the shared one) |
20:02:24 | FromGitter | <arnetheduck> but like I said, it's been a busy few weeks.. need to read up on the details |
20:03:14 | _Raid_ | Araq: Sorry AFK, That's really cool! When I have the time I can't wait to try it out! |
20:03:39 | Araq | _Raid_: I'll announce it on the forum when I think you can give it a try |
20:04:20 | FromGitter | <arnetheduck> the second (general) question I would have for ref is that memory is just one kind of resource - what about files, handles etc? |
20:04:40 | FromGitter | <arnetheduck> it seems that owned + destructors should take care of that too, but.. |
20:05:11 | Araq | that is indeed the case. you define =destroy for a file and it's called when the owned ref disappears |
20:06:47 | * | narimiran quit (Ping timeout: 240 seconds) |
20:08:07 | * | c3V0aXZ joined #nim |
20:13:21 | * | avanderneut quit (Remote host closed the connection) |
20:22:49 | * | rnrwashere joined #nim |
20:25:05 | FromGitter | <arnetheduck> different topic: there's a `quoteShell`, but is there a `parseShell` too? |
20:27:01 | * | rnrwashere quit (Ping timeout: 246 seconds) |
20:30:06 | livcd | oh noes no one replied to me :-( |
20:32:25 | * | rnrwashere joined #nim |
20:36:24 | Araq | arnetheduck: there is os.parseCmdLine |
20:36:34 | Araq | livcd: please repeat |
20:39:08 | FromGitter | <arnetheduck> perfect. |
20:41:07 | * | noeontheend joined #nim |
20:44:24 | * | rnrwashere quit (Remote host closed the connection) |
20:46:24 | shashlick | parseCmdLine is awesome |
20:46:55 | * | theelous3__ quit (Ping timeout: 258 seconds) |
20:50:27 | * | solitudesf quit (Ping timeout: 268 seconds) |
20:52:58 | * | c3V0aXZ quit (Quit: Leaving) |
20:53:27 | FromDiscord | <exelotl> if I'm currently dependent on gc:none (as in, it's literally the only option that works for my platform), will I be able to switch to newruntime without any additional memory usage? |
20:55:28 | * | c3v0axz joined #nim |
20:56:16 | Araq | exelotl: it's very likely, the new runtime doesn't produce RTTI anymore either |
21:00:47 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
21:03:34 | * | Vladar quit (Remote host closed the connection) |
21:19:15 | * | rnrwashere joined #nim |
21:23:28 | federico3 | I feel the need for a more expressive parseopt |
21:23:35 | * | rnrwashere quit (Ping timeout: 246 seconds) |
21:39:28 | FromDiscord | <exelotl> Araq: oh that's good to hear :D |
22:01:36 | FromGitter | <mratsim> @federico3 agree, maybe RFC? cligen works quite well |
22:11:17 | * | stefanos82 quit (Remote host closed the connection) |
22:12:28 | * | rnrwashere joined #nim |
22:13:06 | * | rnrwashere quit (Remote host closed the connection) |
22:13:12 | * | rnrwashere joined #nim |
22:14:15 | _Raid_ | I wanted to double check, are strings passed by reference? |
22:16:33 | * | noeontheend quit (Ping timeout: 250 seconds) |
22:21:36 | * | abm quit (Quit: Leaving) |
22:25:19 | Araq | sure they are |
22:26:56 | _Raid_ | but int is passed by value? |
22:27:10 | * | rnrwashere quit (Remote host closed the connection) |
22:28:08 | * | rnrwashere joined #nim |
22:29:53 | * | seni joined #nim |
22:30:03 | _Raid_ | I asked because I read a post that said all nim basic types where passed by value and I just assumed they where including strings |
22:32:03 | * | noeontheend joined #nim |
22:32:29 | FromGitter | <mratsim> Nim default types have value semantics |
22:33:28 | FromGitter | <mratsim> but at a low-level they are passed by reference if they are bigger than the size of 3 pointers. It's only a Nim<->C optimization though you don't need to care about that. |
22:38:04 | _Raid_ | Yeah, I don't know why I even needed to double check that. I see that nim is pretty fast. But I didn't trust you to handle strings efficiently. |
22:40:03 | * | rnrwashere quit (Remote host closed the connection) |
22:40:49 | * | rnrwashere joined #nim |
22:41:28 | * | _Raid_ is now known as i_Right_i |
22:43:32 | FromGitter | <mratsim> Since strings are mutable and you can also preallocate a string buffer you're free to do the fastest string implementation of algorithm you need without any low-level restriction |
22:44:15 | FromGitter | <mratsim> The main issue is temporaries when using API with return values (like in strutils). |
22:49:28 | FromGitter | <Varriount> *Raid*: For efficient string handling, avoid creating slices and temporaries, like this code does: https://gist.github.com/Varriount/076f406c475b5369301a2fcd7b4527af |
22:56:55 | i_Right_i | so when a proc returns a string that is local to its scope, is the return a full copy? |
22:57:10 | i_Right_i | or deep copy |
22:58:21 | * | noeontheend quit (Remote host closed the connection) |
23:01:34 | * | lritter quit (Ping timeout: 250 seconds) |
23:02:45 | FromGitter | <mratsim> if you use result = you will get return value optimisation and directly build the string efficiently |
23:03:07 | FromGitter | <mratsim> otherwise it's a copy. |
23:14:37 | * | krux02_ joined #nim |
23:17:07 | * | krux02 quit (Ping timeout: 240 seconds) |
23:31:18 | copygirl | I'm a copy! |
23:31:46 | FromGitter | <mratsim> :D |
23:39:20 | * | krux02_ quit (Remote host closed the connection) |
23:40:28 | i_Right_i | mratsim: thanks again! |
23:41:10 | * | rnrwashere quit (Remote host closed the connection) |
23:52:57 | * | rnrwashere joined #nim |
23:53:41 | * | rnrwashere quit (Remote host closed the connection) |
23:53:47 | * | rnrwashere joined #nim |