00:00:28 | * | mofeng joined #nim |
00:19:01 | * | LyndsySimon quit (*.net *.split) |
00:19:01 | * | surma quit (*.net *.split) |
00:22:22 | * | abm quit (Quit: Leaving) |
00:24:15 | * | LyndsySimon joined #nim |
00:24:15 | * | surma joined #nim |
00:24:50 | * | GordonBGood_ quit (Ping timeout: 240 seconds) |
00:31:01 | * | nif_ quit (Quit: ...) |
00:31:11 | * | nif joined #nim |
00:42:14 | * | krux02_ joined #nim |
00:44:53 | * | krux02 quit (Ping timeout: 245 seconds) |
00:48:53 | * | LyndsySimon quit (*.net *.split) |
00:48:53 | * | surma quit (*.net *.split) |
00:54:19 | * | LyndsySimon joined #nim |
00:54:19 | * | surma joined #nim |
01:12:19 | * | couven92 quit (Quit: Client Disconnecting) |
01:17:29 | * | kevin- joined #nim |
01:18:08 | * | dddddd quit (Remote host closed the connection) |
01:21:14 | * | uu91 quit (Ping timeout: 265 seconds) |
01:40:21 | * | jwm2241 quit (Quit: WeeChat 2.7-dev) |
01:43:21 | * | seni quit (Quit: Leaving) |
01:43:36 | * | jwm2241 joined #nim |
01:45:38 | * | ponyrider quit (Ping timeout: 240 seconds) |
01:48:44 | * | LyndsySimon quit (*.net *.split) |
01:48:44 | * | surma quit (*.net *.split) |
01:54:00 | FromDiscord | <++x;> Tensorflow fanboys |
01:54:03 | FromDiscord | <++x;> Typical |
01:54:27 | * | LyndsySimon joined #nim |
01:54:27 | * | surma joined #nim |
02:02:15 | * | krux02_ quit (Ping timeout: 250 seconds) |
02:04:53 | * | krux02 joined #nim |
02:17:56 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
02:19:15 | * | Jjp137 quit (Read error: Connection reset by peer) |
02:22:17 | * | Jjp137 joined #nim |
02:26:18 | * | Jjp137 quit (Read error: Connection reset by peer) |
02:27:38 | * | Jjp137 joined #nim |
02:43:34 | * | kevin- quit (Ping timeout: 268 seconds) |
02:48:49 | * | LyndsySimon quit (*.net *.split) |
02:48:49 | * | surma quit (*.net *.split) |
02:53:54 | * | LyndsySimon joined #nim |
02:53:54 | * | surma joined #nim |
03:21:47 | * | theelous3_ joined #nim |
03:23:02 | * | theelous3 quit (Ping timeout: 268 seconds) |
03:25:40 | disruptek | this `splitPath` change has broken all of the aws apis. |
03:50:30 | * | dchem joined #nim |
04:29:00 | * | notgne2 quit (Quit: ZNC 1.7.3 - https://znc.in) |
04:31:51 | * | notgne2 joined #nim |
04:41:00 | * | kevin- joined #nim |
04:53:23 | * | nsf joined #nim |
04:54:19 | * | chemist69 quit (Ping timeout: 252 seconds) |
04:56:13 | * | chemist69 joined #nim |
05:05:01 | * | kevin- quit (Ping timeout: 265 seconds) |
05:05:32 | * | dchem quit (Quit: WeeChat 2.4) |
05:05:51 | * | dchem joined #nim |
05:07:43 | FromDiscord | <Bub_Lite_63_Jr> I wanted to switch from a manual install to a brew install, so I removed the .nimble and the .chosennim files in my home folder (on mac) and ran `brew install nim` |
05:08:05 | FromDiscord | <Bub_Lite_63_Jr> I'm getting compiler errors now about missing headers, so I assume I did something incorrectly |
05:08:42 | FromDiscord | <Bub_Lite_63_Jr> ``` |
05:08:42 | FromDiscord | <Bub_Lite_63_Jr> Josephs-MBP-15:nim_test josephlyons$ nim compile --run hello.nim |
05:08:43 | FromDiscord | <Bub_Lite_63_Jr> Hint: used config file '/usr/local/Cellar/nim/1.0.2/nim/config/nim.cfg' [Conf] |
05:08:43 | FromDiscord | <Bub_Lite_63_Jr> Hint: system [Processing] |
05:08:43 | FromDiscord | <Bub_Lite_63_Jr> Hint: widestrs [Processing] |
05:08:43 | FromDiscord | <Bub_Lite_63_Jr> Hint: io [Processing] |
05:08:45 | FromDiscord | <Bub_Lite_63_Jr> Hint: hello [Processing] |
05:08:46 | FromDiscord | <Bub_Lite_63_Jr> CC: stdlib_io.nim |
05:08:48 | FromDiscord | <Bub_Lite_63_Jr> CC: stdlib_system.nim |
05:08:49 | FromDiscord | <Bub_Lite_63_Jr> CC: hello.nim |
05:08:53 | FromDiscord | <Bub_Lite_63_Jr> Error: execution of an external compiler program 'clang -c -w -I/usr/local/Cellar/nim/1.0.2/nim/lib -I/Users/josephlyons/Programming/Nim/nim_test -o /Users/josephlyons/.cache/nim/hello_d/@mhello.nim.c.o /Users/josephlyons/.cache/nim/hello_d/@mhello.nim.c' failed with exit code: 1 |
05:08:55 | FromDiscord | <Bub_Lite_63_Jr> |
05:08:57 | FromDiscord | <Bub_Lite_63_Jr> /Users/josephlyons/.cache/nim/hello_d/@mhello.nim.c:10:10: fatal error: 'stdio.h' file not found |
05:08:59 | FromDiscord | <Bub_Lite_63_Jr> #include <stdio.h> |
05:09:00 | FromDiscord | <Bub_Lite_63_Jr> ^~~~~~~~~ |
05:09:01 | FromDiscord | <Bub_Lite_63_Jr> 1 error generated. |
05:09:03 | FromDiscord | <Bub_Lite_63_Jr> Josephs-MBP-15:nim_test josephlyons$ |
05:09:05 | FromDiscord | <Bub_Lite_63_Jr> ``` |
05:24:56 | FromDiscord | <++x;> Java makes me cry |
05:26:49 | FromDiscord | <++x;> |
05:26:50 | FromDiscord | <++x;> https://cdn.discordapp.com/attachments/371759389889003532/641146378248257546/Screenshot_20191104-232420.png |
05:30:00 | FromDiscord | <Rai Nathan Famakai II> > deleting messages |
05:34:57 | * | rockcavera quit (Remote host closed the connection) |
05:38:27 | * | GordonBGood joined #nim |
05:44:14 | * | kevin joined #nim |
05:44:37 | * | kevin is now known as Guest67576 |
05:44:47 | * | Guest67576 is now known as kevin- |
05:48:44 | * | LyndsySimon quit (*.net *.split) |
05:48:44 | * | surma quit (*.net *.split) |
05:48:58 | * | surma joined #nim |
05:49:09 | * | LyndsySimon joined #nim |
05:59:16 | FromGitter | <zetashift> Bub_Lite_63_Jr for long messages please use a pastebin; formatting doesn't go through the bridges correctly |
05:59:58 | FromGitter | <zetashift> as for your error, you might need to install clang? `xcode-select --install` from: https://nim-lang.org/install_unix.html |
06:07:10 | FromGitter | <gogolxdong> @maxadjsky we have a Chinese community QQ group 624680081 |
06:26:03 | * | nisstyre joined #nim |
06:27:39 | nisstyre | How do I contribute to the nim manual? |
06:29:48 | Zevv | checkout the nim repository, edit the files in place and create a git PR |
06:30:07 | Zevv | if you don't know how to do that, people here will be glad to help you out |
06:30:25 | nisstyre | should be good, I just wasn't sure if I need anything else |
06:30:33 | Zevv | nope. |
06:31:05 | Zevv | much appreciated work! |
06:35:27 | * | narimiran joined #nim |
06:41:41 | * | Kevin-NimBot joined #nim |
06:43:49 | * | Kevin-NimBot quit (Remote host closed the connection) |
06:46:58 | * | jwm2241 quit (Ping timeout: 245 seconds) |
06:52:24 | * | jwm2241 joined #nim |
07:00:19 | * | jwm2241 quit (Quit: WeeChat 2.7-dev) |
07:03:27 | * | Kevin-NimBot joined #nim |
07:04:20 | * | Kevin-NimBot quit (Remote host closed the connection) |
07:10:21 | * | go|dfish quit (Ping timeout: 250 seconds) |
07:12:26 | * | dchem quit (Ping timeout: 268 seconds) |
07:23:47 | * | go|dfish joined #nim |
07:27:13 | * | solitudesf joined #nim |
07:30:31 | * | ftsf joined #nim |
07:38:05 | * | PMunch joined #nim |
07:45:37 | * | kevin- quit (Remote host closed the connection) |
07:46:27 | * | kevin- joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:11 | * | theelous3_ quit (Ping timeout: 276 seconds) |
08:04:56 | * | gmpreussner joined #nim |
08:07:49 | * | ng0 joined #nim |
08:17:07 | * | kevin- quit (Remote host closed the connection) |
08:19:35 | * | filcuc joined #nim |
08:30:45 | * | Guest62919 joined #nim |
08:30:54 | * | Guest62919 is now known as kevin- |
08:53:34 | Araq | ping shashlick |
09:01:47 | * | Vladar joined #nim |
09:09:00 | PMunch | Hmm, is there a way to get the filename of a DLL/so from within itself? |
09:09:45 | PMunch | So when I load /home/peter/mydynlib.so from a program in say /etc/program I want to get /home/peter/ |
09:09:56 | * | GordonBGood quit (Quit: Always try to be modest, and be proud about it!) |
09:11:01 | * | ftsf quit (Read error: Connection reset by peer) |
09:15:07 | Araq | I dunno. |
09:19:02 | * | mofeng quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
09:21:38 | FromGitter | <alehander42> hm test |
09:21:46 | FromGitter | <alehander42> oh no, it doesnt see it |
09:22:19 | FromGitter | <alehander92> ah ok, nvm |
09:22:22 | * | floppydh joined #nim |
09:23:14 | * | kevin- quit (Ping timeout: 240 seconds) |
09:25:07 | Zevv | PMunch: there is not portable way for that |
09:25:27 | PMunch | Zevv, yeah I realised.. |
09:25:52 | Zevv | If you don't care and can accept a hackish way, dereference /proc/self/exe and run `ldd` on it |
09:25:55 | PMunch | Wrapping up something with dladdr and GetModuleHandleEx/GetModuleFileName now |
09:26:17 | Zevv | whatever works for you, I'd say :) |
09:26:53 | PMunch | Yeah dladdr should be fine, it should be available on any GNU system |
09:27:09 | PMunch | And GetModuleHandleEx/GetModuleFileName should be there for Windows |
09:28:58 | Araq | Windows is usually fine when it comes to DLLs. |
09:35:29 | PMunch | What do you mean? |
09:37:20 | Zevv | that he thinks shared libraries are messy on linux |
09:40:15 | PMunch | Well, they are different kind of messy |
09:41:16 | PMunch | Ugh, what's up with creating their own types for everything in Windows: https://docs.microsoft.com/en-gb/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexa?redirectedfrom=MSDN |
09:41:59 | Zevv | enjoying yourself? |
09:43:21 | PMunch | Time of my life |
09:43:22 | Araq | it's legacy and a (rather poor) attempt to get more type safety |
09:43:47 | Araq | all the H* types are HANDLEs, LPCSTR is 'const char*' |
09:44:03 | Araq | DWORD is uint32 |
09:44:19 | Araq | I got used to it, at least it doesn't change... |
09:44:59 | PMunch | Yeah I guess it's just something you need to learn once |
09:46:27 | Araq | the best thing is that there is only one Windows, whereas in posix land you need to special case osx, freebsd, openbsd, solaris, linux, ... |
09:47:22 | PMunch | Well that's like saying that the Workers' Party of Korea is great because there is only one option.. |
09:47:37 | PMunch | Without any further comparisson :P |
09:48:16 | PMunch | (for reference that's the party of Kim Jung Un in NK, and the only option in their elections) |
09:48:45 | Araq | well I'm speaking of myself. |
09:49:03 | Araq | for me it's great that Windows is roughly a single target. Less work for us. |
09:49:26 | FromGitter | <alehander92> but the other os-es are different os-es man |
09:49:30 | FromGitter | <alehander92> its like the opposite |
09:49:39 | PMunch | Oh yeah, I definitely see the benefit of it :) |
09:49:41 | FromGitter | <alehander92> you can share so much api-s between them even if they are separate os-es |
09:49:55 | FromGitter | <alehander92> and with windows you have to impl completely different stuff |
09:50:32 | Araq | you read too much into my words. |
09:50:55 | Araq | if there was only a single Linux it would have the same benefit. |
09:52:27 | FromGitter | <alehander92> but its not a benefit imo |
09:52:34 | FromGitter | <alehander92> solaris bsd are just different os-es |
09:53:16 | PMunch | Wait, LPCSTR is defined as a 32-bit pointer? |
09:53:19 | FromGitter | <alehander92> we cant expect different os-es to not be different targets |
09:53:27 | PMunch | So I can't just map it to cstring? |
09:53:39 | Araq | PMunch, it's a 'cstring'. |
09:53:41 | FromGitter | <alehander92> and on the other hand i havent noticed the 10-20 (?) distros of linux to be a problem for nim |
09:54:12 | PMunch | Isn't cstring a regular pointer dependent on the target architecture? |
09:54:28 | Araq | PMunch, LPCSTR is not 32 bit, it's a pointer, as wide as it needs to be |
09:54:44 | Araq | (typically 64 bits these days) |
09:55:35 | Araq | alehander92: simply try to sell commercial software for Linux and you'll begin to appreciate the problem. |
09:55:42 | PMunch | Not according to this: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/f8d4fe46-6be8-44c9-8823-615a21d17a61 |
09:56:27 | Araq | PMunch, it also says |
09:56:31 | Araq | typedef const char* LPCSTR; |
09:56:40 | PMunch | Araq, we're actually working to get our customers over to Linux because it would be easier to distribute to.. But I guess it depends on what you're shipping. |
09:56:52 | PMunch | Yeah.. |
09:56:59 | Araq | the "32 bit" is wrong, somebody should update that page :P |
09:57:04 | PMunch | So it's just a classic docs doesn't match implementation thing.. |
09:57:19 | PMunch | Apparently it was updated 02/14/2019.. |
09:57:22 | Araq | PMunch, do you tell your customers they can use any Linux distro? |
09:57:45 | PMunch | TBH I have no idea what marketing is telling them :P |
09:58:44 | Araq | IMHE it's usually like "we support Ubuntu. End of story." |
09:59:21 | Araq | because QA exists and ensuring it works on X distros means you have X times the testing overhead. |
09:59:36 | Araq | It's math, math always wins. |
10:04:21 | FromGitter | <alehander92> Araq we'll try to do that .. |
10:04:33 | FromGitter | <alehander92> exactly, selling software for linux |
10:04:51 | FromGitter | <alehander92> so i do appreciate it has some issues, but i am not sure they apply to nim itself |
10:06:56 | PMunch | Araq, do you know what BOOL is defined as? |
10:06:59 | PMunch | cint? |
10:07:18 | Araq | WINBOOL* = int32 # see winlean.nim |
10:07:26 | PMunch | Ah cool |
10:08:19 | * | narimiran quit (Remote host closed the connection) |
10:08:52 | * | narimiran joined #nim |
10:09:55 | PMunch | Hmm, how can I create a cstring of a given size? |
10:10:12 | PMunch | What I want to do is this: char path[MAX_PATH]; |
10:10:29 | PMunch | Then pass a pointer to that to a function |
10:10:42 | FromGitter | <alehander92> use an array imo |
10:11:07 | PMunch | But I want to use that as a string elsewhere in my code |
10:11:19 | PMunch | And cast[cstring](theArray) didn't work |
10:11:28 | PMunch | Oh wait |
10:13:18 | PMunch | theArray.addr |
10:13:28 | PMunch | But is that properly handled by the GC? |
10:13:54 | * | clyybber joined #nim |
10:14:42 | PMunch | If I do: "var theArray: array[MAX_PATH, char]" pass "theArray.addr" to a C procedure, then do "result = cast[cstring](theArray.addr)" |
10:17:26 | * | tklohna joined #nim |
10:18:26 | Araq | don't return a pointer to your local stack frame |
10:18:30 | PMunch | Okay, this works on both Windows and linux now: http://ix.io/20Rn/nim |
10:18:31 | Araq | it'll crash and burn |
10:18:31 | disbot | ^ play at https://play.nim-lang.org/#ix=20Rn 😏 |
10:18:49 | PMunch | Yeah, that's what I was thinking |
10:19:03 | PMunch | So do I need to copy it out? |
10:19:34 | * | gangstacat quit (Remote host closed the connection) |
10:20:04 | * | gangstacat joined #nim |
10:21:16 | Araq | yeah and then you might as well convert it to string already |
10:21:26 | Araq | result = $cast[string](addr myarray) |
10:21:59 | * | FromGitter quit (Remote host closed the connection) |
10:22:09 | PMunch | Wait, cast[string]? |
10:22:17 | PMunch | That won't work will it? |
10:22:17 | * | FromGitter joined #nim |
10:22:48 | PMunch | I guess I could make a seq of a certain length, then pass the pointer to theSeq[0] and then cast that to a string before returning it |
10:28:22 | PMunch | http://ix.io/20Rq/nim <- there, that should make the GC happy right? |
10:28:23 | disbot | ^ play at https://play.nim-lang.org/#ix=20Rq 😏 |
10:35:45 | Araq | result = $cast[cstring](addr myarray) |
10:35:49 | Araq | typo :P |
10:36:17 | * | FromGitter quit (Remote host closed the connection) |
10:36:35 | * | FromGitter joined #nim |
10:37:00 | PMunch | Ah okay, yeah that's what I expected |
10:39:54 | * | GordonBGood joined #nim |
10:43:06 | krux02 | @mratsim sorry I was AFK yesterday, I am online now |
10:43:41 | krux02 | When you want to talk about Vulkan, I don't really know it, I only know OpenGL and looked over the Vulkan API quickly to get an idea. |
10:44:41 | * | tklohna quit (Ping timeout: 246 seconds) |
10:49:18 | * | fanta1 joined #nim |
10:59:32 | PMunch | Hmm, what is the best way to create a string from an UncheckedArray[byte] and a length? |
11:00:49 | PMunch | var myString = newString(length); copyMem(myString[0].addr, myUncheckedArray.addr, length) |
11:01:11 | Araq | that's what I use too but I don't keep up with all stdlib additions |
11:10:16 | FromGitter | <kaushalmodi> PMunch: I've always done `let strVar = $cStringVar`. Wouldn't that work? |
11:11:41 | * | fredrik92 is now known as couven92 |
11:23:18 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
11:28:31 | Araq | er |
11:28:46 | Araq | this is a bit embarrassing but what is the issue that tracks "Incremental compilation"? |
11:31:04 | FromDiscord | <mratsim> wasn't there an RFC |
11:31:14 | FromDiscord | <mratsim> I think it's in the RFC repo not the nim repo |
11:31:33 | FromDiscord | <mratsim> https://github.com/nim-lang/RFCs/issues/46 |
11:34:13 | Araq | ah it got moved, thanks |
11:38:22 | * | rockcavera joined #nim |
11:38:23 | * | filcuc quit (Quit: Konversation terminated!) |
11:55:48 | FromGitter | <alehander92> ooh ic |
11:58:30 | FromDiscord | <mratsim> https://github.blog/2019-11-04-github-sponsors-is-now-out-of-beta-in-30-countries/ |
12:09:42 | * | venk joined #nim |
12:17:30 | PMunch | kaushalmodi, well the problem was creating allocating the memory in a way that the GC would care for it |
12:19:01 | FromGitter | <kaushalmodi> Hmm, that might explain why I need to mostly use --gc: none when printing stuff I receive from C side in Nim.. |
12:19:24 | FromGitter | <kaushalmodi> I haven't yet found time to understand that problem properly |
12:20:10 | PMunch | Hmm, well a cstring you receive from C code should be fine. You just need to remember to deallocate it at some point |
12:20:32 | PMunch | But here I was passing in a buffer that was going to be populated by a string, and then used in my Nim program. |
12:21:03 | PMunch | That's why I created a string of a given length and then passed the address to the first element (which is also the address to the rest of the string buffer) |
12:21:09 | FromGitter | <kaushalmodi> Understood |
12:21:38 | PMunch | And of course I added a myStr.setLen(myStr.find('\0') + 1) in order to have the string be the correct length. |
12:27:19 | Araq | ? |
12:32:05 | FromGitter | <Vindaar> @kaushalmodi I merged the ggplotnim PR. So you don't have to depend on the #addDocs branch anymore. Also means first set of docs are now live :) |
12:37:31 | clyybber | Araq: IMO outplace should take the inplace arg of the proc to outplace as a first arg, so instead of `outplace(sort(a))` you would do `outplace(a, sort())` or `a.outplace(sort())` |
12:45:18 | FromGitter | <kaushalmodi> @Vindaar yes, I saw that. I'll update the README on my repo accordingly |
12:45:49 | FromGitter | <kaushalmodi> Btw a recipe request for ggplotnim is brewing |
12:46:12 | FromGitter | <kaushalmodi> Power spectral density plots or FFT plots |
12:46:56 | FromGitter | <kaushalmodi> Where the Y axis is in log scale and X axis is -F |
12:47:04 | FromGitter | <kaushalmodi> .. to +F |
12:47:33 | FromGitter | <kaushalmodi> I'll share more details with an equivalent examples and plot from Matlab |
12:47:39 | FromGitter | <Vindaar> that would be great! |
12:48:24 | * | tklohna joined #nim |
12:53:33 | FromGitter | <kaushalmodi> @Vindaar ggplotnim is doing things stably at least for the brief experimentation I did |
12:53:36 | FromDiscord | <mratsim> Seems like Julia has a 400x scheduling overhead to overcome in their new parallel runtime :/ https://github.com/JuliaLang/julia/issues/33762#issuecomment-549806041 |
12:53:57 | FromGitter | <kaushalmodi> do you want to cut a new release for ginger and seqmath and a new ggplotnim release that depends on them? |
12:54:24 | FromGitter | <kaushalmodi> then the instructions to install would be simply `nimble install ggplotnim` |
12:54:36 | * | Vladar quit (Quit: Leaving) |
12:55:07 | Araq | clyybber, outplace(a, sort()) ? |
12:55:13 | Araq | why? |
12:55:40 | * | nsf quit (Quit: WeeChat 2.6) |
12:56:08 | Araq | mratsim brought up x.reverse().outplace().join.outplace() |
12:56:28 | Araq | maybe we can improve this macro somehow |
12:56:39 | FromGitter | <Vindaar> @kaushalmodi good to hear! yeah, I could do that I suppose |
12:57:50 | clyybber | Araq: For chaining |
12:58:06 | Araq | chaining is broken with 'untyped' |
12:58:12 | shashlick | @Araq pong |
12:58:15 | Araq | better solve that one first then? |
12:58:30 | clyybber | Araq: I'm ok with mratsims proposal too |
12:58:39 | Araq | proposal? |
12:58:56 | Araq | anyway, sort it out please, I'm busy |
12:59:07 | Araq | don't mind replacing outplace by something better. |
12:59:27 | Araq | shashlick, can I PM you? |
13:00:37 | FromGitter | <Vindaar> @treeform: not sure if you're around. I just noticed that you didn't tag the latest release of chroma |
13:01:00 | shashlick | Yes #shashlick but check if anyone else is idling there |
13:01:14 | shashlick | Or use gitter |
13:01:24 | FromDiscord | <mratsim> my proposal means creating a library though |
13:02:20 | FromDiscord | <mratsim> (and maybe reusing the range keyword, which could happen if we deprecate it once we have this design by contract thing I heard about here and there) |
13:02:55 | clyybber | mratsim, Araq: I was referring to the syntax of outplace |
13:03:01 | FromDiscord | <mratsim> Anyway if you want a Range library, I'm sure @timotheecour would be very happy to refine his proposal |
13:03:03 | FromDiscord | <mratsim> ah |
13:03:34 | clyybber | But I think x.outplace(reverse()).outplace(join()) might be easier to implement |
13:06:18 | FromGitter | <Vindaar> @kaushalmodi all done |
13:06:48 | FromGitter | <kaushalmodi> 👍 |
13:09:20 | FromGitter | <yglukhov> Is there a way to prevent implicit converter in a call? Or ban converters in a scope or smth? |
13:10:46 | FromDiscord | <Stuffe> is it possible with nim to have code that only runs if it isn't a release build? |
13:12:11 | * | shashlick_ joined #nim |
13:12:26 | solitudesf | when not (defined(release) or defined(danger)): |
13:12:41 | FromDiscord | <mratsim> too fast |
13:12:45 | FromDiscord | <mratsim> 😛 |
13:14:18 | FromDiscord | <Stuffe> Ok thanks, didn't know about the when statement |
13:14:50 | FromDiscord | <mratsim> wait until you learn about `when compiles(foo)` |
13:15:29 | FromDiscord | <Stuffe> compiles? |
13:15:46 | FromDiscord | <Stuffe> some of these things are still hard to google |
13:15:51 | FromDiscord | <mratsim> the compiler tries to compile an expression and returns true if it's valid or false if you can't compile it |
13:16:17 | FromDiscord | <mratsim> it's the last resort escape hatch of metaprogramming |
13:17:10 | FromDiscord | <Stuffe> when would that ever be nondeterministic? is anything semantic in nim hardware dependent? |
13:17:48 | * | rockcavera quit (Remote host closed the connection) |
13:18:13 | FromDiscord | <mratsim> no it's not related to hardware |
13:19:04 | FromDiscord | <mratsim> Nim allows code-generation at compile-time and that may depend on user supplied arguments |
13:19:34 | FromDiscord | <Stuffe> I see |
13:19:43 | * | theelous3 joined #nim |
13:20:31 | FromDiscord | <Stuffe> I like that these things exist, even if I wouldn't like to use them. It means I will never have to resort to some even uglier hack |
13:21:07 | FromDiscord | <mratsim> well, it's one of the ugliest hacks ever and basically a kludge for something missing |
13:21:49 | FromDiscord | <Stuffe> yeah, sure |
13:22:12 | FromDiscord | <Stuffe> reminds me of "try" |
13:24:25 | Araq | yglukhov: import x except theConverter |
13:24:41 | Araq | it's why converters are forced to have names ;-) |
13:25:25 | FromDiscord | <mratsim> I wonder who is using converters in a complex codebase |
13:25:51 | FromGitter | <yglukhov> right. so my macro is generating some stuff along with a converted. the "stuff" mixins other stuff, and I don't want the converter to kick in anywhere in the generated stuff. so import except is not an option. |
13:26:03 | FromDiscord | <mratsim> both in Status codebase and in Arraymancer I had to quickly remove them because of strange bugs/error messages they introduce |
13:26:07 | FromGitter | <alehander92> they can be useful if used only in some modules |
13:26:15 | FromGitter | <alehander92> e.g. a symbolic math ds |
13:26:17 | FromGitter | <alehander92> l |
13:27:09 | FromDiscord | <mratsim> In Arraymanceer, my converter were private but they manage to still cause issues to end users: https://github.com/mratsim/Arraymancer/issues/394 |
13:28:06 | FromDiscord | <mratsim> afaik maybe the issue is just that ambiguous calls should not take existing converters if there is a concrete type that matches |
13:28:15 | Araq | mratsim: I know cooldome uses them extensively and his code base is as non-trivial as I can imagine |
13:28:31 | FromGitter | <yglukhov> Araq: I've got an idea of limiting symchoice. So that `foo(a, b, c)` becomes `limitSymChoice(foo)(a, b, c)` and limitSymChoice will filter out the symbol (which provokes the converter). But that doesn't work surprisingly: `Error: in expression 'limitSymChoice(say)(unpackedThis, a, b, c)': identifier expected, but found 'limitSymChoice(say)'` |
13:34:17 | FromGitter | <yglukhov> Another way would be to declare the converter locally with {.error.} or smth, but apparently converters can be defined only at the top level. |
13:35:03 | FromGitter | <alehander92> you can import an override from a special handwritten module? |
13:35:14 | FromGitter | <alehander92> no idea if this would compile |
13:36:01 | FromGitter | <yglukhov> but imports are top level only too :) |
13:37:11 | FromGitter | <alehander92> but anyway even if you could, {.error.} would just inform you the converter is called |
13:37:25 | FromGitter | <alehander92> i assumed you want to just choose the next possible overload |
13:37:27 | FromGitter | <yglukhov> I'm pretty fine with that one :) |
13:38:00 | FromGitter | <alehander92> so cant you use the closest thing to converter in overload order and define locally that instead |
13:38:49 | FromGitter | <yglukhov> I expect the user to have the overload, and it should be a compile time error if he doesn't. Unfortunately the converter makes it so that my (wrong) overload is picked. |
13:38:50 | planetis[m] | the problem with outplace is that ``let x = outplace(reverse(a))`` works, ``let x = outplace reverse(a)`` also works but ``let x = reverse(a).outplace`` doesn't? |
13:39:43 | FromGitter | <alehander92> so you also have a converter overload? |
13:43:12 | * | filcuc joined #nim |
13:43:15 | FromDiscord | <mratsim> I think it's that outplace is noisy when used in chained manner @planetis |
13:43:38 | FromDiscord | <mratsim> i.e. when you want a functional style for applying transformation to sequences |
13:43:49 | planetis[m] | cool macro anyway |
13:44:02 | FromDiscord | <mratsim> Lua uses ":" for out-of-place results |
13:44:30 | FromGitter | <alehander92> but i think outplace would be best with iterators |
13:44:38 | Zevv | mratsim: what? |
13:44:54 | FromGitter | <alehander92> otherwise chaining would produce too many temp collections |
13:45:07 | FromDiscord | <mratsim> yes see: http://lua-users.org/wiki/MethodChainingWrapper |
13:45:13 | clyybber | Araq, mratsim, alehander92: https://github.com/nim-lang/Nim/pull/12599 |
13:45:18 | clyybber | My approach. |
13:46:04 | clyybber | It works like `let x = a.outplace(reverse())` |
13:46:13 | FromDiscord | <mratsim> @alehander42, I agree, but for now inline iterator chaining doesn't work ¯\\_(ツ)_/¯ |
13:46:17 | Zevv | mratsim: ':' is just sugar, v:name(args) is syntactic sugar for v.name(v,args), |
13:46:35 | FromDiscord | <mratsim> I just meant that it's pretty |
13:46:40 | clyybber | And also allows `let x = a.outplace(reverse(someOptionalArgumentOfReverse))` |
13:47:13 | FromGitter | <alehander92> mratsim i know, wondering when would iterator chaining work |
13:47:29 | FromGitter | <alehander92> dont know if its in the roadmap to 1.x |
13:47:32 | planetis[m] | i agree with you mratsim |
13:48:07 | planetis[m] | sorry for a week ago btw I have overreacted |
13:49:38 | FromDiscord | <mratsim> not a problem |
13:49:47 | FromDiscord | <mratsim> I also overreacted in my answer |
13:50:27 | FromDiscord | <mratsim> You're not alone in having 400x speed issues btw see my issue in Julia tracker 😉 https://github.com/JuliaLang/julia/issues/33762#issuecomment-549806041 |
13:50:36 | FromGitter | <yglukhov> @alehander92 my macro defines a Type, a converter from anything to Type, and a bunch of procs for that Type. Those procs forward to user procs with the same name. So instead of failing when there's no user proc, they end up being called recursively because of the converter. So I want to disable my generated converter in my generated procs. |
13:51:26 | planetis[m] | clybber, nice though, ``sort`` can have more arguments |
13:52:50 | * | solitudesf quit (Ping timeout: 240 seconds) |
13:52:53 | planetis[m] | man, i dont care :p life has more worries for me than how fast is my toy lib :D |
13:54:40 | * | shashlick_ left #nim ("Quit") |
13:54:55 | planetis[m] | so how is your compute graph experiment going? |
13:55:14 | FromDiscord | <mratsim> I didn't work on it for the past 3 months |
13:55:31 | FromDiscord | <mratsim> I can't do that with my multithreading experiments at the same time |
13:55:59 | FromDiscord | <mratsim> there is an actual example that works here: https://github.com/numforge/laser/blob/master/laser/lux_compiler/lux_dsl.nim#L57-L71 |
13:56:06 | FromDiscord | <mratsim> and the internals seem quite good to me |
13:56:47 | planetis[m] | looks really cool though, I kind of understand what you are doing, but not completly :p |
13:56:53 | FromGitter | <kaushalmodi> PMunch: Can you cut a new release of persvector? |
13:57:02 | * | GordonBGood quit (Ping timeout: 276 seconds) |
13:57:08 | FromGitter | <kaushalmodi> I am looking into the nimble packages that ggplotnim is fetching from head |
13:57:27 | FromDiscord | <mratsim> the idea is that you only put the actual math that you need, and you will have something correct |
13:57:40 | FromGitter | <kaushalmodi> would be nice to have a nimble install install all dependencies using their tagged versions |
13:57:45 | FromDiscord | <mratsim> and then, you can refine the low-level detail for speed but separately |
13:57:51 | clyybber | planetis[m]: Yeah, and thats exactly what my PR supports |
13:58:04 | FromDiscord | <mratsim> let me give you some slides examples |
13:59:38 | planetis[m] | clybber: i will try it |
13:59:57 | clyybber | mratsim: Added an example for chaining |
14:00:16 | PMunch | kaushalmodi, done :) |
14:00:36 | PMunch | Should've done that a long time ago :S |
14:00:46 | FromGitter | <kaushalmodi> thanks |
14:01:01 | FromDiscord | <mratsim> @planetis: what I want to do is fig 1: https://people.csail.mit.edu/jrk/halide12/halide12.pdf |
14:01:29 | FromDiscord | <mratsim> basically, the Clean C++ example is your code, the Fast C++ example is my code |
14:01:44 | FromDiscord | <mratsim> but this is time consuming, very error-prone to optimize |
14:01:56 | FromDiscord | <mratsim> the last oen is what I want to do |
14:02:22 | FromDiscord | <mratsim> a separation of the algorithm and the scheduling (parallelism, cache optimizations and such) |
14:02:32 | FromDiscord | <mratsim> so that anyone can implement the algorithm |
14:03:05 | FromDiscord | <mratsim> and then experts or even autotuning can then optimize with the assurance that the algorithm still give good results |
14:03:37 | FromDiscord | <mratsim> Also, while an algorithm will be good on both CPU and GPU, the way to execute it on CPU and GPU might differ a lot |
14:04:10 | FromDiscord | <mratsim> and I want a DSL that only requires rewriting the schedule when compiling to GPU |
14:04:27 | FromDiscord | <mratsim> and not the whole algorithm + schedule |
14:05:08 | planetis[m] | yes, I got that part alright, the rest is bit difficult |
14:06:03 | FromDiscord | <mratsim> in short, I want people that focuses on algorithm and math and that know that best to be able to focus on it, and people that focus on speed to be able to focus on it. |
14:06:37 | FromDiscord | <mratsim> and they would be able to work and experiments on the same codebase because their concerns are cleanly separated. |
14:07:12 | planetis[m] | clybber: works fine for me |
14:08:07 | planetis[m] | it's just Araq's version makes more sense, you can't deny he makes awesome macros :D |
14:08:12 | planetis[m] | i wonder why... |
14:09:19 | clyybber | Ugh |
14:09:45 | FromDiscord | <mratsim> When you say the rest, I suppose you were talking about the expression problem, object algebra, tagless final. That was research on how to design the private and public data structures so that it's extensible |
14:09:49 | planetis[m] | mratsim: say i want to implement softmax |
14:10:28 | FromDiscord | <mratsim> like this: https://github.com/ravi-teja-mullapudi/Halide-NN/blob/master/layers.h#L48-L73 |
14:10:40 | Araq | planetis[m], hey, thank you! |
14:10:47 | FromDiscord | <mratsim> and the schedule part is the expert tuning for CPU or GPU |
14:12:32 | clyybber | planetis[m]: Yeah, my macro would make more sense as a kind of dot operator |
14:12:51 | planetis[m] | mratsim: nice |
14:14:04 | clyybber | planetis[m]: Because then you would simply write x.<shuffle instead of x.shuffled |
14:14:20 | clyybber | Replace `.<` by whatever you want it to be |
14:15:19 | planetis[m] | yes that makes more sense |
14:18:13 | FromGitter | <cloudcalvin> Hi guys, could I just ask for a sanity check. I am learning about concepts and tried out the Function[A] example from https://nim-lang.github.io/Nim/manual_experimental.html#concepts-concept-derived-values but I get `false` instead of `true`. Is something missing? |
14:20:01 | FromDiscord | <mratsim> if the exact example is giving you the wrong result you can raise a bug. |
14:20:01 | FromDiscord | <mratsim> AFAIK there is one for the Functor concept as well |
14:20:43 | shashlick | @treeform ping |
14:23:31 | FromGitter | <cloudcalvin> Thanks will check |
14:23:35 | planetis[m] | note there is an rfc for refining concepts: https://github.com/nim-lang/RFCs/issues/168 so it might be to late for that |
14:24:41 | * | abm joined #nim |
14:25:44 | FromGitter | <cloudcalvin> https://github.com/nim-lang/Nim/issues/5650 |
14:25:47 | disbot | ^ The ``Functor`` example from merged concepts branch doesn't work |
14:25:47 | disbot | ^ snippet at https://play.nim-lang.org/#ix=20Sa 😏 |
14:25:50 | FromGitter | <cloudcalvin> yeah this is pretty old |
14:26:30 | FromGitter | <cloudcalvin> I'v seen the rfc, looks cool. Probably also means the example wont be fixed soon. |
14:26:50 | * | Vladar joined #nim |
14:27:13 | FromGitter | <cloudcalvin> I'm just wondering whats actually wrong with the example! |
14:27:52 | FromGitter | <cloudcalvin> <I say without reading the entire bug ticket> |
14:30:09 | disruptek | can we just go ahead and fix the compiler to not look in ~/.nimble? |
14:31:24 | FromDiscord | <treeform> Vindaar, ok i'll tag it. Why do I need to tag things again? |
14:31:30 | * | filcuc quit (Ping timeout: 268 seconds) |
14:31:39 | disruptek | without tags, dependencies are a pita. |
14:33:03 | FromGitter | <kaushalmodi> treeform: Tags allow a nimble package build to be reproducible |
14:33:09 | FromDiscord | <treeform> shashlick, pong? |
14:33:12 | disruptek | https://github.com/nim-lang/Nim/issues/12367 -- if this can be fixed, i will write a package manager for localdeps that uses only nimble and nim.cfg. |
14:33:14 | disbot | ^ nim.cfg syntax for --define:FOO:VAL undocumented or absent |
14:33:14 | disbot | ^ snippet at https://play.nim-lang.org/#ix=20Sb 😏 |
14:33:31 | FromGitter | <kaushalmodi> good boy disbot |
14:34:17 | FromGitter | <kaushalmodi> .. though that snippet was not useful |
14:34:26 | FromGitter | <kaushalmodi> it will just spam ix.io |
14:34:27 | * | disruptek smacks disbot. |
14:35:21 | FromGitter | <kaushalmodi> may be just send blocks in ```` ```nim .. ``` ```` to ix.io? |
14:35:23 | disruptek | it knows when the snippet is tagged as nim, but there are a lot of snippets that aren't. |
14:35:41 | disruptek | ix.io won't duplicate ids for identical content. |
14:35:48 | disruptek | https://github.com/nim-lang/Nim/issues/12367 |
14:35:49 | disbot | ^ nim.cfg syntax for --define:FOO:VAL undocumented or absent |
14:35:49 | disbot | ^ snippet at https://play.nim-lang.org/#ix=20Sb 😏 |
14:35:53 | disruptek | so it's pretty harmless. |
14:36:02 | FromGitter | <kaushalmodi> cool |
14:39:51 | planetis[m] | hey violence against robots is not the answer, besides machines don't forget stuff... |
14:41:47 | Araq | disruptek, --noNimblePath, add it to your global config |
14:42:09 | Araq | it should probably become the new default, I use it regularly myself |
14:42:30 | * | solitudesf joined #nim |
14:42:53 | FromDiscord | <treeform> what does --noNimblePath do? |
14:43:15 | disruptek | i will test it again. last time, i think a missing package caused the compiler to pick up one in ~/.nimble. |
14:46:01 | disruptek | yeah, you can't use --nimblePath without the compiler looking in ~/.nimble. |
14:46:08 | disruptek | why can't that be fixed? |
14:47:12 | disruptek | yes, i understand that --noNimblePath works. |
14:47:21 | disruptek | just looking for a more convenient solution. |
14:47:56 | Araq | I'm sorry, what are you saying? you override --nimblePath and yet .nimble still has to exist? |
14:48:32 | disruptek | it doesn't have to exist, but if you try to import a package /not/ in your overriden path, the compiler will search ~/.nimble and import the package from there if it exists. |
14:48:36 | disruptek | to me, that's a bug. |
14:49:27 | * | fanta1 quit (Quit: fanta1) |
14:49:48 | FromGitter | <Vindaar> @PMunch: you also didn't push a tag to github. However, for some reason nimble still understands that version 1.0.0 is the latest (for chroma it didn't) |
14:50:28 | Araq | disruptek, report it please, I still don't understand it completely |
14:50:34 | disruptek | PMunch: try using bump; it's pretty good. |
14:50:35 | Araq | maybe --nimblePath is additive |
14:50:48 | PMunch | dispruptek, bump? |
14:50:50 | disruptek | that makes the most sense. |
14:51:21 | FromGitter | <kaushalmodi> Araq: Yes, --nimblePath is additive |
14:51:22 | disruptek | PMunch: it's a thing that cuts a new nimble release for you. |
14:51:33 | FromGitter | <kaushalmodi> I have also been looking for a --nimblePathOverride |
14:51:33 | disruptek | https://github.com/disruptek/bump |
14:51:52 | FromGitter | <kaushalmodi> which just overrides the default ~/.nimble even if it's present |
14:53:24 | FromGitter | <zaphodef> is there a reason why `compiler/sem.nim:myClose()` calls `rawCloseScope()` after `closeScope()`, while the later already calls the former? |
14:53:37 | disruptek | kaushalmodi: yeah, that really should be fixed. |
14:54:46 | Araq | @if nimbabel: |
14:54:46 | Araq | nimblepath="$home/.nimble/pkgs/" |
14:54:46 | Araq | @if not windows: |
14:54:46 | Araq | nimblepath="/opt/nimble/pkgs/" |
14:54:47 | Araq | @else: |
14:54:48 | Araq | # TODO: |
14:54:49 | Araq | @end |
14:54:51 | Araq | @end |
14:55:01 | Araq | yeah, it's additive |
14:55:10 | Araq | so it works as designed :P |
14:55:33 | FromGitter | <zaphodef> ok ahah |
14:56:02 | Araq | zaphodef: there was a reason for that but I forgot |
14:56:11 | FromGitter | <zaphodef> no problem |
14:57:11 | Araq | it had something to do with "unused identifier" checking |
14:57:21 | FromGitter | <zaphodef> i'm still looking for a way to compile all the libs' processes, and i went across this |
14:57:32 | FromGitter | <zaphodef> yup, it is related to this check |
14:57:49 | FromGitter | <zaphodef> i want to un-optimize the optimization x) |
14:57:51 | Araq | I think it's the scope for module imports, no checking for these |
14:58:37 | FromGitter | <zaphodef> mhh, any hint where the compiler gets rid of the unused modules? |
15:01:58 | PMunch | Vindaar, there pushed a tag as well :) |
15:02:18 | PMunch | disruptek, oh that would indeed be useful |
15:04:48 | FromGitter | <Vindaar> hehe, thanks! |
15:09:58 | FromGitter | <kaushalmodi> @Vindaar @PMunch Thanks, now ggplotnim install installs only tagged versions and it still works great |
15:10:57 | PMunch | Woo |
15:10:59 | * | PMunch quit (Quit: Leaving) |
15:11:42 | FromGitter | <Vindaar> yay |
15:12:01 | disruptek | bump was started as a joke but i've really put a lot of work into it. i wish more people used it. it's hard to play the nimble game without tags. we need to be releasing more. |
15:15:28 | FromGitter | <Vindaar> you're right. I always feel like I shouldn't release a new version for every small thing. But really, aside from the work to tag a version there isn't really a downside to it |
15:16:16 | disruptek | it ends up being super helpful because you can tell someone to roll back to /just prior/ to the misfeature that's breaking them. |
15:16:46 | disruptek | it gives you an alternate timeline in which the software in your master-only project is always stable. |
15:18:50 | FromGitter | <kaushalmodi> A question from someone ignorant with how GC works: ⏎ ⏎ Where do I start debugging this crash: ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=5dc192da6570b076740f7389] |
15:18:56 | disruptek | i guess it wouldn't be so important if nimble understood the relative position of a git hash. |
15:20:37 | * | filcuc joined #nim |
15:20:39 | FromGitter | <Vindaar> here I am, already causing you crashes @kaushalmodi :P |
15:21:02 | clyybber | afaik its not possible to identify which came first from two git hashes |
15:21:13 | clyybber | I would love to be corrected :) |
15:21:17 | FromGitter | <kaushalmodi> @Vindaar That's not you :) |
15:21:23 | FromGitter | <Vindaar> phew ;) |
15:21:30 | FromGitter | <kaushalmodi> I have always seen those, and used --gc:none as a crutch |
15:21:38 | FromGitter | <kaushalmodi> trying to understand why I need --gc:none |
15:22:05 | FromGitter | <kaushalmodi> all: Here's a minimal code that causes above crash: http://ix.io/20Sl/nim |
15:22:06 | disbot | ^ play at https://play.nim-lang.org/#ix=20Sl 😏 |
15:22:56 | FromGitter | <kaushalmodi> It won't work in standalone mode on the playground as it needs to be run by that host C application |
15:25:36 | * | letto quit (Ping timeout: 240 seconds) |
15:26:12 | FromGitter | <kaushalmodi> Doing some "here debug", I see that the code after here6 in this snippet ( http://ix.io/20So/nim) is causing the crash |
15:26:13 | disbot | ^ play at https://play.nim-lang.org/#ix=20So 😏 |
15:26:35 | FromGitter | <kaushalmodi> ```code paste, see link``` ⏎ ⏎ Any hints on how to continue this debug? [https://gitter.im/nim-lang/Nim?at=5dc194aba9f0dc24852bcb85] |
15:33:10 | * | bacterio quit (Read error: Connection reset by peer) |
15:40:32 | disruptek | git hashes aren't oids with timestamps embedded, but you can tell which came first by looking at the repo. |
15:43:05 | * | letto joined #nim |
15:44:02 | Araq | kaushalmodi: you cannot convert from string to cstring in your case |
15:44:10 | * | lritter joined #nim |
15:44:39 | Araq | you need to GC_ref the strings before that or do the alloc() dance |
15:48:29 | * | shodan45 quit (Remote host closed the connection) |
15:53:10 | * | shodan45 joined #nim |
15:57:27 | * | floppydh quit (Quit: WeeChat 2.6) |
16:03:07 | FromGitter | <kaushalmodi> at the point where it crashes, the code is all in "Nim scope" |
16:03:42 | FromGitter | <kaushalmodi> I replaced the call after "here6" with `p.setFontTtf("DejaVuSans.ttf")` which is to a nimble package proc |
16:03:53 | FromGitter | <kaushalmodi> so I am confused why it crashes there |
16:04:41 | FromGitter | <kaushalmodi> > you need to GC_ref the strings before that or do the alloc() dance ⏎ ⏎ If possible, can you point to some examples? |
16:05:31 | FromGitter | <kaushalmodi> I have looked at https://nim-lang.github.io/Nim/gc.html but I'd like to see some code examples |
16:08:06 | FromGitter | <kaushalmodi> Looking at an arbitrary Nim file: https://github.com/nim-lang/Nim/blob/f18fcf65b3a61b1960c14aa9503eea34fee76492/tests/deps/zip-0.2.1/zip/zipfiles.nim, seems like `var.GC_ref` needs to be called after its declaration and `var.GC_unref` at the end of the proc? |
16:12:16 | Araq | possibly. Look, the GC doesn't understand 'cstring', it doesn't keep its alive |
16:12:38 | * | filcuc quit (Ping timeout: 268 seconds) |
16:13:00 | FromGitter | <kaushalmodi> I'm fiddling with GC_ref to make it work.. the complication is that cstring is inside an obj whose ptr I get from C side: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc19f8c3f4ea333f2c52fbe] |
16:13:15 | FromGitter | <kaushalmodi> I am getting only `ptr PlotOptions`.. so trying to figure out how to GC_unref that |
16:13:37 | FromGitter | <kaushalmodi> I am getting only `ptr PlotOptions` on the Nim side.. so trying to figure out how to GC_ref that |
16:13:58 | * | clyybber quit (Quit: WeeChat 2.6) |
16:15:06 | Zevv | I don't think you can |
16:15:27 | Araq | stop hacking around and understand the real problem |
16:17:41 | FromGitter | <kaushalmodi> I tried the below understanding for GC_ref expects but this also did not work: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc1a0a53f4ea333f2c52fc0] |
16:18:14 | FromGitter | <kaushalmodi> (I need to get hold of a primer on how this work in Nim.) |
16:18:37 | Araq | don't GC_ref the "optionsRef", the GC is not concerned with 'ptr's |
16:19:13 | Araq | look man, when you do someCStringHere = someNimStringHere the GC is free to collect someNimStringHere afterwards |
16:19:30 | Araq | someCStringHere will point to garbage |
16:19:35 | Araq | solution: |
16:19:40 | FromGitter | <kaushalmodi> so I need to GC_ref only options.cStrVars? |
16:19:53 | Araq | GC_ref(someNimStringHere); someCStringHere = someNimStringHere |
16:20:09 | FromGitter | <kaushalmodi> got it |
16:20:16 | FromGitter | <kaushalmodi> thank you. I will try that out |
16:21:04 | Araq | you also need to call GC_unref afterwards so that you don't produce a memory leak |
16:21:20 | FromGitter | <kaushalmodi> yes.. and does that string need to be a `var`? |
16:23:12 | FromGitter | <kaushalmodi> confusion: I am not assigning anything to the cstring |
16:23:41 | FromGitter | <kaushalmodi> I am only copying the values of the cstrings from a deferenced obj/struct I get from C |
16:24:09 | FromGitter | <kaushalmodi> so I am not doing `someCStringHere = someNimStringHere`.. I am doing the opposite |
16:24:42 | Araq | maybe you simply got the wrapper wrong and the GC problem is only a symptom |
16:25:22 | FromGitter | <kaushalmodi> the wrappers work functionally well, only with gc:none though |
16:25:37 | FromGitter | <kaushalmodi> and I have seen this issue in many wrappers between SystemVerilog/Nim |
16:25:48 | Araq | you get them all wrong :P |
16:25:54 | FromGitter | <kaushalmodi> could be :) |
16:26:02 | FromGitter | <kaushalmodi> so I am trying to understand what's going wrong |
16:26:31 | Araq | use c2nim for the wrapping process :P |
16:26:54 | FromGitter | <kaushalmodi> I am not writing C wrappers here |
16:27:08 | FromGitter | <kaushalmodi> let me try to explain.. |
16:27:35 | FromGitter | <kaushalmodi> I have this struct in SystemVerilog: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc1a2f7bbdf5f17b420b69e] |
16:27:44 | FromGitter | <kaushalmodi> the SV compiler auto translates to C |
16:28:03 | FromGitter | <kaushalmodi> string becomes C style string, real becomes float and so on |
16:28:16 | FromGitter | <kaushalmodi> all that translations is defined in IEEE-1800 standard |
16:28:39 | FromGitter | <kaushalmodi> on Nim side, I then have a mirror type for that: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc1a3373f4ea333f2c52fc7] |
16:29:21 | FromGitter | <kaushalmodi> on SV side, the function "importc-like" decl looks like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc1a3613f4ea333f2c52fc9] |
16:29:36 | FromGitter | <kaushalmodi> on Nim side, it is: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc1a370bbdf5f17b420b6a3] |
16:29:42 | FromGitter | <kaushalmodi> that's all the wrapping I am doing |
16:29:55 | FromGitter | <kaushalmodi> the intermediate C code generation happens in the SV compiler |
16:30:42 | Araq | use the .bycopy pragma on your object declaration |
16:30:49 | Araq | (c2nim would have done this... :P ) |
16:31:01 | FromGitter | <kaushalmodi> *looking into bycopy* |
16:32:25 | FromGitter | <kaushalmodi> I am not importcing that Nim obj type because I don't know name of the type identifier defined by SV compiler |
16:32:53 | FromGitter | <kaushalmodi> you mean, just use `{.bycopy.}` with no other pragma? |
16:33:11 | Araq | yes |
16:34:04 | FromGitter | <kaushalmodi> tried: ⏎ ⏎ ```type ⏎ PlotOptions {.bycopy.} = object ⏎ ..``` ⏎ ⏎ but still the same crash [https://gitter.im/nim-lang/Nim?at=5dc1a47cbbdf5f17b420b6ab] |
16:34:20 | Araq | it's much better now anyways, keep it |
16:39:51 | FromDiscord | <kodkuce> like this chat is becoming like matrix, just some magick writings all across |
16:44:52 | disruptek | i just see blonde, brunette, redhead... |
16:45:44 | FromGitter | <kaushalmodi> Araq: So far I have this.. but still not able to figure out the cause of the crash: http://ix.io/20SB/nim |
16:45:45 | disbot | ^ play at https://play.nim-lang.org/#ix=20SB 😏 |
16:55:48 | * | narimiran quit (Ping timeout: 268 seconds) |
16:55:48 | * | narimiran_ joined #nim |
16:59:23 | * | abm quit (Ping timeout: 265 seconds) |
17:02:55 | shashlick | @treeform sorry been a busy morning, can you please take a look at the nimble local deps rfc and share your thoughts |
17:03:54 | Araq | you can't GC_ref the title before it contains the useful string ;-) |
17:04:13 | Araq | but that's not the cause of the crash either |
17:07:05 | * | nsf joined #nim |
17:07:35 | shashlick | @disruptek please check out my tissue project on github |
17:07:42 | shashlick | It does this Nim snippet search on issues |
17:07:57 | disruptek | yeah, i saw it. |
17:08:05 | shashlick | Cool deal |
17:08:27 | disruptek | i had to impl github api anyway. 😊 |
17:09:28 | Araq | github API? can it be used to search for projects? |
17:09:33 | disruptek | of course. |
17:12:04 | * | narimiran_ is now known as narimiran |
17:13:40 | FromGitter | <kaushalmodi> Araq: does this help? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dc1adc4a9f0dc24852bcbc1] |
17:14:03 | FromGitter | <kaushalmodi> I was finally able to enable gdb on the SV compiler side and also enabled the gdb symbols on Nim side |
17:15:10 | FromGitter | <kaushalmodi> How do I see into the "optimzed out" stuff? Also pinging @krux02 |
17:16:03 | FromGitter | <kaushalmodi> looks like the typography pkg is causing the crash here? |
17:28:17 | krux02 | kaushalmodi: do you mean optimized out variables from gdb? |
17:28:43 | krux02 | from my experience "optimized out" often means "not yet initialized" |
17:29:25 | krux02 | but when it is truly optimized out it is optimized out, you can't inspect tha value. The only option you will have left is to disable optimizations |
17:30:25 | FromGitter | <kaushalmodi> krux02: I am already disbling optimization |
17:30:38 | FromGitter | <kaushalmodi> `--debugger:native --opt:none -t="-O0"` |
17:30:59 | * | Jesin quit (Quit: Leaving) |
17:32:00 | FromGitter | <kaushalmodi> but in the Nim generated .c, I see ` gcc -c -w .. -O0 -g3 -Og`. I don't know why the `-Og` switch gets added |
17:33:19 | Araq | it's in the default config |
17:33:36 | Araq | we always optimize, you can edit your nim.cfg to change it |
17:33:44 | FromGitter | <kaushalmodi> ok |
17:34:02 | FromDiscord | <itmuckel> Hey guys! Can I pass an object by reference in nim? In C++ you can pass a Variable from the stack to a method by doing `changeVar(&var)`. Is that possible in nim? I tried `changePerson(ref person)`, but that didn't work. 🤔 I got `type ref Error Type`. |
17:34:53 | Araq | Nim passes by const ref if it thinks it's a good idea |
17:35:05 | Araq | don't mess with it, Nim knows better than you do. |
17:35:07 | * | dddddd joined #nim |
17:36:15 | FromDiscord | <Generic> this is just a stupid thing which sprung to my mind this morning |
17:36:28 | * | Trustable joined #nim |
17:36:34 | disruptek | uh oh. |
17:36:37 | FromDiscord | <Generic> but are/or has anyone considered using a ref |
17:36:45 | FromGitter | <kaushalmodi> Araq: got rid of the optimized out stuff with `--gcc.options.debug="-O0 -g3"`, but that didn't reveal anything useful |
17:36:54 | FromDiscord | <Generic> when only having a single ref as closure env |
17:37:03 | FromDiscord | <Generic> to not wrap it again in a ref object |
17:37:14 | FromGitter | <kaushalmodi> now I get http://ix.io/20SS/text |
17:37:15 | FromDiscord | <Generic> and instead take it directly as the closure env |
17:37:23 | Araq | Generic: I considered it but lambdas are already the hardest part in the compiler |
17:37:36 | FromDiscord | <Generic> ah, ok thanks |
17:38:18 | Araq | kaushalmodi: you won't find stack corruptions with gdb, use valgrind |
17:38:44 | * | filcuc joined #nim |
17:39:01 | FromGitter | <kaushalmodi> that's another learning curve.. I will continue this exploration at a later point |
17:39:42 | FromDiscord | <itmuckel> @Araq okay, thx |
17:40:57 | FromGitter | <kaushalmodi> Araq: I really wanted to get to the bottom of this today.. I started looking into valgrind but the complication is that a host C appl is running the Nim compiled .so: https://stackoverflow.com/questions/20321753/valgrind-how-to-use-valgrind-for-so-library |
17:45:30 | * | Jesin joined #nim |
17:49:37 | * | nsf quit (Quit: WeeChat 2.6) |
18:15:27 | * | eys joined #nim |
18:17:31 | * | bacterio joined #nim |
18:17:51 | * | bacterio quit (Client Quit) |
18:22:23 | * | bacterio joined #nim |
18:22:57 | * | filcuc quit (Ping timeout: 240 seconds) |
18:23:53 | * | filcuc joined #nim |
18:37:33 | * | filcuc quit (Ping timeout: 268 seconds) |
18:52:28 | * | filcuc joined #nim |
18:52:54 | * | GordonBGood joined #nim |
18:57:14 | * | GordonBGood quit (Ping timeout: 240 seconds) |
19:00:58 | * | filcuc quit (Quit: Konversation terminated!) |
19:04:37 | rayman22201 | @Araq you around? |
19:04:56 | * | NimBot joined #nim |
19:05:41 | rayman22201 | I'm trying an experiment to keep refs to the closure environments with the Future for the Dispose stuff, and I'm hitting a code gen bug maybe? I get GCC casting errors... :/ |
19:06:38 | * | nsf joined #nim |
19:11:31 | Araq | rayman22201: |
19:11:34 | Araq | pong |
19:11:42 | FromGitter | <mratsim> (I would love to be able to capture environment like a closures or serialize them) |
19:12:18 | rayman22201 | I made it work by removing some casting code as a prototype. |
19:12:41 | rayman22201 | this won't work in the general case, but I'm going to see if this will work as a proof of concept |
19:12:51 | rayman22201 | stand by :-P |
19:14:50 | * | rockcavera joined #nim |
19:18:34 | FromGitter | <mratsim> Do you have a branch somewhere? |
19:19:53 | rayman22201 | now it looks like "deepDispose" isn't disposing? |
19:21:57 | * | nif quit (Quit: ...) |
19:22:08 | * | nif_ joined #nim |
19:22:31 | rayman22201 | https://www.irccloud.com/pastebin/13Q28ZQO/ |
19:23:33 | rayman22201 | notice that, deepDispose visits the relevant nodes, but the memory doesn't seem to be freed? https://www.irccloud.com/pastebin/ORrXqody/ |
19:26:17 | rayman22201 | test program for context https://www.irccloud.com/pastebin/kUGafxMa/ |
19:27:58 | disruptek | i wouldn't expect it to return it to the os. |
19:28:09 | disruptek | if you alloc the same type again, does it reuse the memory? |
19:28:17 | rayman22201 | that's not what those stats are showing. Those are the internal GC stats |
19:28:30 | disruptek | does it leak? |
19:28:42 | rayman22201 | obviously. That's what it's showing |
19:28:55 | disruptek | it shows that X units were freed. |
19:29:30 | disruptek | what i'm asking is, is it stable? |
19:29:38 | rayman22201 | It's not, and that's my problem. |
19:29:44 | disruptek | okay. |
19:29:47 | rayman22201 | I would expect it to be, and I'm not sure why it isn't |
19:29:58 | rayman22201 | I could also be totally mis-understanding those stats |
19:31:19 | disruptek | is dumpNumbleOfInstances useful? |
19:31:32 | rayman22201 | namely, I would expect the "freed objects" to be higher. Since it should free: |
19:31:32 | rayman22201 | 1.) The Future |
19:31:32 | rayman22201 | 2.) the T inside the future |
19:31:32 | rayman22201 | 3.) the closure environment |
19:31:32 | rayman22201 | 4.) the closure iterator environment |
19:31:38 | disruptek | it seemed to work for me. |
19:31:57 | rayman22201 | hrmm, good idea. I will try it |
19:32:07 | disruptek | s/Numble/Number/ |
19:32:09 | rayman22201 | it looks like it's only freeing the Future |
19:32:40 | rayman22201 | I should say, "dispose", not "free", since it's not returning the memory the OS. |
19:34:03 | disruptek | i don't think i've ever measured something that didn't leak. |
19:34:55 | rayman22201 | It's leaking, but it's internal to the GC. if that makes sense |
19:35:25 | rayman22201 | amounts to the same thing, but I get less tools since Nim is handling all the MM internally |
19:35:44 | rayman22201 | what is the proc? dumpNumberofInstances(T)? |
19:35:49 | disruptek | yeah; i'm okay with a small amount of stable leakage. |
19:35:51 | disruptek | () |
19:36:00 | disruptek | you need to -d:nimTypeNames though. |
19:36:08 | rayman22201 | already have that on :-P |
19:43:21 | FromDiscord | <kodkuce> is figma just a design tool it dosent build me gkt qt win android or wahter bindings rith? |
19:43:47 | disruptek | kodkuce: right, but treeform has a package to turn figma output into ui. |
19:46:26 | rayman22201 | cool proc. Thank you @disruptek |
19:46:45 | rayman22201 | definitely confirms that only the Future itself is being "disposed". :-/ |
19:47:09 | FromDiscord | <kodkuce> is it working? |
19:47:15 | * | abm joined #nim |
19:47:35 | disruptek | 😦 |
19:47:47 | disruptek | kodkuce: yep. |
19:48:29 | disruptek | https://github.com/treeform/fidget |
19:52:42 | FromDiscord | <kodkuce> will try |
19:56:01 | rayman22201 | what is the syntax for a destructor on a Generic type? |
20:08:52 | rayman22201 | how do you "dispose" a seq? |
20:25:12 | * | tyler569 left #nim (#nim) |
20:38:41 | * | nsf quit (Quit: WeeChat 2.6) |
20:40:38 | FromGitter | <zacharycarter> fidget looks cool - but I'd rather have the OpenGL backend at this point than the HTML one |
20:40:51 | FromGitter | <zacharycarter> also - I don't think the OpenGL backend should require GLFW... that doesn't make sense to me |
20:43:40 | FromGitter | <zacharycarter> oh - maybe I was looking at old code |
20:43:44 | FromDiscord | <kodkuce> opengl should work on Phone/Desktops and for web its HTML right |
20:44:28 | FromGitter | <zacharycarter> I don't know / understand what the difference is between _backendopengl and backendopengl is |
20:44:40 | FromGitter | <zacharycarter> well I think that's the idea - but it doesn't look like the OpenGL backend is complete |
20:45:09 | FromGitter | <zacharycarter> maybe it is |
20:47:48 | FromDiscord | <kodkuce> it says only HTML is working atm |
20:48:30 | FromGitter | <zacharycarter> ah |
20:48:42 | FromGitter | <zacharycarter> I can't get the examples to run anyway - some errors in the typography package |
20:50:42 | FromDiscord | <treeform> zacharycarter, fidget is not out yet. I am still working on it. |
20:51:02 | FromGitter | <zacharycarter> yeah - I figured as much |
20:51:03 | FromDiscord | <treeform> It has an OpenGL backend. Why don't you like GLFW? |
20:51:20 | FromGitter | <zacharycarter> it's not that I don't like GLFW - it's just IMO it should be window library agnostic |
20:51:28 | FromGitter | <zacharycarter> all it should need is an OpenGL context, no? |
20:51:52 | FromDiscord | <treeform> they you would have to wire up all of the input stuff? |
20:52:04 | FromGitter | <zacharycarter> callbacks I guess |
20:52:11 | FromDiscord | <treeform> opening a window yourself is not hard, but what about keyboard input, mouse input, screen resizes ... its a ton! |
20:52:19 | krux02 | glfw has callbacks for input, SDL has events. |
20:52:38 | FromGitter | <zacharycarter> yeah - but like, today if I were going to choose a GUI library solution |
20:52:49 | FromGitter | <zacharycarter> I'd go with NanoVG or something similar |
20:52:53 | FromGitter | <zacharycarter> and then a layout engine |
20:53:10 | krux02 | there is an API for all of those things on all platforms. both sdl and glfw provide a wrapper that works also on other systems |
20:53:19 | FromDiscord | <treeform> yeah thats a ton of work to integrate. I could not get NanoVG to work on windows. I was looking at maybe making it a backend. |
20:53:23 | FromGitter | <zacharycarter> I really don't want my GUI library coupled with my windowing library |
20:53:53 | FromDiscord | <treeform> Yeah, fidget will never be for you then. |
20:54:14 | FromGitter | <zacharycarter> well then it's more than a GUI library :P |
20:54:19 | FromDiscord | <treeform> All I want is people to go, I want to a button that does this, And it will work. |
20:54:23 | FromGitter | <zacharycarter> but that's cool |
20:54:50 | krux02 | I am personally not the biggest fan of antialiased vector graphics. What it usually means in my personal experience is software rendering. |
20:55:13 | FromDiscord | <treeform> How so? Most other other GUI libraries include windowing and keyboard as well. |
20:55:16 | krux02 | and not even the fastest software rendering |
20:55:31 | FromDiscord | <treeform> NanoVG is the only one I know that says bring your own windows and input. |
20:55:44 | FromGitter | <zacharycarter> nuklear, imgui, etc don't either |
20:55:51 | krux02 | yea |
20:55:55 | FromGitter | <zacharycarter> they just need opengl contexts |
20:56:21 | krux02 | I wrote my opengl sandbox and I already got feedback why I don't have my own keyboard handling. |
20:56:53 | krux02 | I really don't like these libraries that start with wrapping GLFW and SDL under yet another abstraction. |
20:56:58 | FromDiscord | <treeform> WinForms, uwp, Qt, Coco, GTK... all do. |
20:57:00 | FromGitter | <zacharycarter> same |
20:57:07 | FromDiscord | <treeform> You right I know of nuklear, imgui and they dont. |
20:57:17 | krux02 | I think SDL isn't perfect, but it is good. |
20:57:25 | FromDiscord | <treeform> I don't like SDL. |
20:57:32 | FromGitter | <zacharycarter> GLFW doesn't support iOS or Android either |
20:57:35 | FromDiscord | <treeform> Soo big! Soo much things I tries to do. |
20:57:40 | krux02 | why don't you like SDL? |
20:57:48 | FromGitter | <zacharycarter> most of SDL is opt in |
20:58:01 | krux02 | true sdl is modular |
20:58:05 | FromGitter | <zacharycarter> you explicitly load functionality when you intiailize SDL2 |
20:58:06 | FromDiscord | <treeform> Mainly it's hard for me to read the source. It's written in this odd style. |
20:58:07 | FromDiscord | <kodkuce> "I really don't want my GUI library coupled with my windowing library" << what you mean by this? |
20:58:29 | FromDiscord | <kodkuce> GLFW doesn't support iOS or Android either? really? |
20:58:31 | FromGitter | <zacharycarter> I mean that rendering a GUI and creating a window / handling input are two separate concerns |
20:58:35 | FromDiscord | <treeform> GLFW doesn't support iOS or Android either, but its sister library GLFM does. |
20:58:39 | FromGitter | <zacharycarter> no it doesn't |
20:58:42 | krux02 | what do you mean with it is hard to read? |
20:59:01 | FromDiscord | <kodkuce> best would be if we you can target all with 1 lib |
20:59:06 | FromDiscord | <kodkuce> but i guess life sux |
20:59:08 | krux02 | I read SDL source only once, and I actually liked it. |
20:59:32 | FromGitter | <zacharycarter> yeah but GLFM isn't written / maintained by the GLFW authors is it? |
20:59:36 | krux02 | SDL can target almost everything, some official and some inofficial implementations. |
21:00:42 | FromGitter | <zacharycarter> I think designing a GUI library without having it also handle windowing / input is doable but for a retained mode GUI solution it will be more difficult |
21:00:58 | FromDiscord | <treeform> To me GLFW feels light wight and simple wrapper. Some thing I would write myself. SDL feels big and complex ... not some thing I would write. |
21:01:35 | krux02 | I never felt SDL was big and complex, why do you think like that? |
21:01:53 | FromGitter | <zacharycarter> maybe - https://bitbucket.org/duangle/oui-blendish/src/default/ - could be a source of inspiration |
21:02:13 | krux02 | SDL is industry standard if you care about that |
21:02:34 | FromDiscord | <kodkuce> i would try but i am uber newb |
21:02:49 | FromDiscord | <treeform> take two examples: https://github.com/treeform/quickcairo/blob/master/examples/realtime_glfw.nim |
21:02:55 | FromDiscord | <treeform> and https://github.com/treeform/quickcairo/blob/master/examples/realtime_sdl2.nim |
21:03:25 | FromDiscord | <treeform> With SDL you have to do bit fiddling and conversion and stuff: |
21:03:26 | FromDiscord | <treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_sdl2.nim#L45 |
21:03:38 | krux02 | SDL2 is 3 lines shorter |
21:03:40 | FromDiscord | <treeform> The whole thing with Image -> Bitmap -> Surface is odd. |
21:03:51 | krux02 | that is what I see from barely looking at the sources |
21:04:09 | FromDiscord | <treeform> glfw has more comments for some reason |
21:04:22 | krux02 | treeform: where do you see that? |
21:04:24 | FromGitter | <zacharycarter> I'm using sokol_app.h for my windowing / input code |
21:04:58 | FromGitter | <zacharycarter> I've used glfw 3 and sdl2 extensively and the biggest difference is like krux02 said, sdl2 uses events and glfw3 uses callbacks |
21:05:18 | FromGitter | <zacharycarter> other than that they have basically the same set of fucntionality, with GLFW supporting less platforms |
21:05:48 | FromDiscord | <treeform> krux02, my glfw has more comments. |
21:05:51 | FromGitter | <zacharycarter> and it's API being perhaps a bit less cumbersome |
21:05:58 | FromDiscord | <treeform> krux02, making it longer |
21:06:04 | FromGitter | <zacharycarter> but that could also be due to the wrapper |
21:06:22 | krux02 | regaridng image -> bitmap -> surface |
21:06:27 | krux02 | I don't know exactly what you mean |
21:06:44 | krux02 | but SDL2 has two different classes of impages. |
21:06:46 | FromDiscord | <treeform> krux02, my comment cairo surface -> sdl serface -> sdl texture -> copy to render |
21:06:54 | Araq | rayman22201, `=destroy`(daSeq) |
21:07:02 | FromDiscord | <treeform> krux02 , it seems like I am copying the same images 4 times |
21:07:08 | FromGitter | <zacharycarter> here's my code for my entry point: https://gist.github.com/zacharycarter/d1b105787fc3153eea9087e60cd8fe89 |
21:07:37 | FromGitter | <zacharycarter> whenever I'm using SDL2 and OpenGL I never use SDL surfaces or SDL textures |
21:07:40 | krux02 | The Surface, which is basically a texture in RAM with software operations enabled, and a "Texture" which is the same thing on the GPU for rendering operations. |
21:08:00 | krux02 | I personally don't use the "texture" class at all, because I don't like the SDL2 renderer. |
21:08:30 | FromDiscord | <treeform> Yeah I don't get SDL2 renderer. I though that is the part you guys liked. |
21:08:46 | krux02 | that means that is Surface left for image loading and changing it's format to write it into GPU memory in my own texture class. |
21:09:01 | krux02 | yea just skip the sdl2 renderer. |
21:09:12 | FromDiscord | <treeform> Well then SDL is a lot smaller 🙂 |
21:09:25 | FromGitter | <zacharycarter> yeah - unless you are creating a simple 2d game using the SDL renderer doesn't make much sense |
21:09:29 | krux02 | nice thing, you can skip it. |
21:09:40 | krux02 | you can decide no not initialize it |
21:10:07 | krux02 | I think it is still part of th DLL though |
21:10:27 | FromGitter | <zacharycarter> that's the main reason I'm using sokol |
21:10:29 | krux02 | I think even for 2d games the renderer is not really great. |
21:10:30 | FromGitter | <zacharycarter> no linking of any libraries |
21:10:43 | FromGitter | <zacharycarter> well no, it's not, no sprite batching |
21:10:53 | krux02 | yea, but I think it makes sense to link sdl dynamically. |
21:11:02 | FromDiscord | <kodkuce> nuclear? |
21:11:05 | FromGitter | <zacharycarter> I agree |
21:11:15 | krux02 | libraries that connect to hardware components should be linked dynamically. |
21:11:26 | FromGitter | <zacharycarter> unless they're single header files :) |
21:11:28 | krux02 | so that the hardware may be newer than the software. |
21:11:50 | FromGitter | <zacharycarter> then a compile pragma and a preprocessor definition will do |
21:12:04 | krux02 | not really |
21:12:30 | FromDiscord | <treeform> but only like drivers connect to hardware components? |
21:12:43 | FromGitter | <zacharycarter> I don't get your point |
21:12:52 | FromDiscord | <treeform> I hate dynamical linking ... |
21:13:34 | FromDiscord | <kodkuce> https://github.com/vurtun/nuklear |
21:13:49 | FromGitter | <zacharycarter> if I can avoid my end users having to build SDl2 / GLFW3 into a shared library by just compiling a single header file |
21:13:55 | FromGitter | <zacharycarter> and get windowing / input handling |
21:13:56 | FromGitter | <zacharycarter> that's a win to me |
21:14:00 | krux02 | yea you are probably right, only drivers connect to hardware components. But what if the operating system changes API and new features are enabled only through the new API, for example more axes for joysticks. |
21:14:20 | krux02 | a dynamic SDL could swap internally to the new internal API. |
21:14:28 | FromGitter | <zacharycarter> well then SDL needs to add support for them and you need to build a new version of SDL2 to take advantage of them |
21:14:30 | FromDiscord | <treeform> well axes for joysticks, you iterate over these? |
21:14:39 | FromDiscord | <treeform> There isn't a fixed amount... |
21:14:52 | FromGitter | <zacharycarter> or download a new version of SDL2 |
21:14:56 | krux02 | yes, but on windows there is a maximum of 8 I guess |
21:15:03 | krux02 | (last time I checked was some years ago) |
21:15:05 | FromDiscord | <treeform> there is? |
21:15:42 | krux02 | On linux I connected my Dualshock 3 controller and got my system told me that I had 23 axes |
21:15:48 | * | xet7_ joined #nim |
21:16:00 | krux02 | every button was an axes with pressure sensitivity. |
21:16:14 | krux02 | didn't know it before I connected it. |
21:16:27 | krux02 | plus montion controls |
21:16:30 | krux02 | no game could handle it. |
21:18:34 | FromDiscord | <treeform> wow this is really cool: https://user-images.githubusercontent.com/7249728/60570947-e6787f80-9d72-11e9-8b26-d189f44b1256.gif |
21:18:43 | FromDiscord | <treeform> from https://github.com/nimgl/nimgl |
21:18:43 | krux02 | anyway, point is. There is an advantage if you link SDL2 dynamically. Every game does bundle SDL2 DLL on windows (if it uses it). I don't understand why you really want to strive against the stream here. |
21:19:16 | * | xet7 quit (Ping timeout: 264 seconds) |
21:19:50 | FromDiscord | <treeform> Bundling your app wit the DLL in the folder is basically static linking but without the optimizations. And yeah I'll do it. But I don't like it. |
21:20:40 | shashlick | @treeform, hope you got my message from earlier |
21:21:48 | FromDiscord | <treeform> No this? "<shashlick> @treeform sorry been a busy morning, can you please take a look at the nimble local deps rfc and share your thoughts" |
21:22:25 | FromDiscord | <treeform> hmm google does not return it |
21:22:54 | FromDiscord | <treeform> its not this https://github.com/nim-lang/nimble/issues/131 ? |
21:24:04 | FromDiscord | <treeform> oh this https://forum.nim-lang.org/t/5448 |
21:30:20 | shashlick | yep, both point to the gist |
21:30:29 | shashlick | thanks 🙂 |
21:31:10 | shashlick | since you've worked on nimby |
21:31:35 | FromDiscord | <treeform> @shashlick, I guess my main thing is I don't get why nimble is so complex. And here this thing is asking to add more stuff to it. I just can't get into the problem. I just want to install, remove and update... why are all of the features and flags here? I think I just made my nimby ( https://github.com/treeform/nimby ) thing and kind of forgot problems exists and now you bring me the problem again ... and I am like I just evolved beyond it |
21:34:02 | shashlick | @treeform - i cannot answer why it is complex but it has been around since 2011 |
21:34:27 | * | narimiran quit (Ping timeout: 240 seconds) |
21:34:42 | disruptek | agree. |
21:35:44 | FromDiscord | <treeform> I feel like I can't get excited bout nimble discussion ... which prevents me from forming an opinion on your RFC. Just reading the comments is making me feel uneasy. |
21:36:12 | shashlick | i don't think package management is an easy problem either so I am keen on improving what we have with community feedback |
21:36:32 | shashlick | i have attempted to update the main proposal based on those comments so you could probably skip them |
21:38:15 | disruptek | i would say a 200-line package manager suggests otherwise. |
21:38:20 | disruptek | what's hard is arguing about this crap. |
21:38:32 | disruptek | i'm done talking about it. i started on nimph today. |
21:38:49 | Zevv | wut |
21:38:51 | FromDiscord | <treeform> haha lets all make our own package managers 🙂 |
21:38:53 | disruptek | you guys do what you want with nimble. |
21:39:05 | FromDiscord | <treeform> I am with disruptek on this one. |
21:39:16 | FromDiscord | <treeform> Well not with him, I am on a seperate thing. |
21:39:43 | FromDiscord | <treeform> I don't get why there is a global json file... just use github urls. |
21:40:05 | FromDiscord | <treeform> I don't get why there is a global ~/.nimble dir just put everything locally in like a `libs` folder |
21:40:23 | FromDiscord | <treeform> I don't get why it uses version numbers, just use githashes ... |
21:40:48 | shashlick | you are ignoring the fact that you are sitting on years of development in this whole area |
21:40:56 | shashlick | npm, pip, cargo, etc |
21:41:00 | shashlick | lots of lessons learned |
21:41:22 | disruptek | yep. |
21:41:26 | FromGitter | <Willyboar> i personally hate npm |
21:41:27 | FromDiscord | <treeform> I love npm... npm install goes locally, npm -G goes globally |
21:41:27 | disruptek | that's the whole point. |
21:41:33 | FromGitter | <Willyboar> and i like pip |
21:41:39 | FromGitter | <Willyboar> especially freeze |
21:41:44 | FromDiscord | <treeform> I hate pip, its always broken for me |
21:41:52 | shashlick | there may be better ways no doubt but throwing out everything without knowing what's in there isn't wise |
21:41:53 | FromDiscord | <mratsim> pip is broken |
21:41:55 | rayman22201 | @araq any clues why deepDispose is not doing the right thing automatically? Shouldn't just calling it on the future invoke the destructor? |
21:41:59 | FromDiscord | <treeform> There are like 3 different pip installs and they all do different hings |
21:42:04 | disruptek | if i hadn't had any experience with anything else, i wouldn't be unsatisfied with nimble. |
21:42:04 | FromDiscord | <treeform> There are like 3 different pip installs and they all do different things |
21:42:32 | * | MightyJoe joined #nim |
21:42:51 | shashlick | instead of a variety of efforts in different directions, it would be great to collaborate and improve nimble |
21:42:52 | FromDiscord | <mratsim> I don't get why I have to remember this script to update python version: https://gist.github.com/mratsim/8135b4f6824b61955122fdf828652298 |
21:43:05 | FromDiscord | <treeform> shashlick, I totally agree with you. You can't just throw out nimble as a community. |
21:43:12 | FromDiscord | <mratsim> "pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U" |
21:43:17 | shashlick | collaboration isn't easy or without compromise but nothing comes out without it |
21:43:25 | FromDiscord | <treeform> shashlick, but me as an individual ... I totally can! |
21:43:44 | FromGitter | <Willyboar> well mostly the basic idea of pip |
21:43:48 | Araq | rayman22201: I suspect I got deepDispose's logic wrong |
21:43:56 | Araq | but i tested it quite a bit... |
21:44:14 | Araq | but I have to sleep now, sorry |
21:44:16 | Araq | good night |
21:44:23 | FromDiscord | <mratsim> night |
21:44:26 | FromGitter | <Willyboar> gn |
21:44:33 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
21:44:46 | FromGitter | <Willyboar> what about rubygems? |
21:44:53 | FromGitter | <Willyboar> what do you think? |
21:44:56 | shashlick | anyway, i'm trying to get folks together to attack this together, I understand if you are turned off but I wouldn't seek your opinions if I thought your ideas or concerns were bad |
21:45:01 | FromDiscord | <mratsim> I never used ruby, except homebrew |
21:45:36 | disruptek | shashlick: i will always support you. i'm just not interested in waiting another 5 years. |
21:45:48 | shashlick | i'm already coding local deps mode |
21:46:02 | shashlick | i've already identified step 2, 3 and am working towards lock files |
21:46:03 | FromDiscord | <treeform> shashlick, same what you are doing is very noble |
21:46:08 | disruptek | and that's great. i will use it. |
21:46:18 | FromDiscord | <treeform> what are lock files? |
21:46:26 | FromDiscord | <mratsim> for me it's important to have better control on the version of each packages for production, and for experimentation, it should default to the latest stable release or master but currently it's impossible to know if nim will call mypackage-#head, mypackage-#master or mypackage-0.1.0 |
21:46:51 | * | Trustable quit (Remote host closed the connection) |
21:47:02 | FromDiscord | <mratsim> And give me a nimble update |
21:47:15 | disruptek | i'm just going to do this properly, honestly. it's not even worth enumerating what that means. |
21:47:19 | shashlick | it will simply move faster with you all as well |
21:47:20 | FromDiscord | <mratsim> updating a dependency is a pain, I often have to nuke my .nimble directory |
21:47:24 | disruptek | everyone knows what a proper package manager looks like. |
21:47:38 | FromDiscord | <treeform> disruptek, will you have a global json file? |
21:47:50 | shashlick | right but everyone lives with legacy |
21:47:59 | disruptek | i use nimble's json file if i find it, so that you don't /have/ to use the url. |
21:48:01 | shashlick | some of it dies, some of it transforms, some of it persists |
21:48:15 | disruptek | but i integrate with github directly, so... |
21:49:08 | shashlick | there's a con with every method if you ask enough people honestly |
21:49:35 | FromDiscord | <mratsim> tbh, I like what cargo is doing |
21:50:10 | FromDiscord | <treeform> Main issue i have with global json is stuff like `nimble install glfw` can install one of 3 packages... I have to know which nimble names map to which github urls to install the right one. |
21:50:27 | FromDiscord | <treeform> https://nimble.directory/search?query=glfw |
21:50:50 | FromDiscord | <mratsim> we probably need a central repo at one point |
21:51:08 | disruptek | it's just too useful to be able to rattle off a bunch of crap you know you'll need. |
21:51:12 | disruptek | so i want to support that. |
21:51:18 | FromGitter | <Willyboar> personally i think that nim needs central package hosting similar to rubygems and cargo |
21:51:21 | disruptek | if it's ambiguous, that's a separate issue. |
21:51:24 | FromDiscord | <mratsim> or decentralized, but somewhere we can clone packages so that dependencies don't suddenly disappear when people delete their Githu account |
21:51:44 | FromDiscord | <treeform> well then they will delete their nimble.com account. |
21:51:45 | * | go|dfish quit (Ping timeout: 250 seconds) |
21:51:56 | FromDiscord | <mratsim> but the package will still be there |
21:52:12 | FromDiscord | <treeform> so not allow deleting of stuff? |
21:52:15 | disruptek | there are many ways around that problem. |
21:52:24 | FromDiscord | <treeform> could they upload a "" file? |
21:52:28 | FromDiscord | <mratsim> on Cargo it's says expressly that what you put there will not be deleted unless big issue |
21:52:38 | FromDiscord | <mratsim> no, it's versioned |
21:52:45 | disruptek | nimph builds immutable distributions, but it could also let you move your dependency to your own github fork and then handle updating it for you. |
21:52:50 | FromDiscord | <mratsim> you can use 0.3.0 or 0.4.0 |
21:53:08 | FromDiscord | <mratsim> this allows everyone to update at its own pace |
21:53:15 | FromDiscord | <mratsim> at the cost of storage |
21:53:24 | disruptek | github storage is free, though. |
21:53:33 | FromDiscord | <mratsim> I don't think cargo is on Github |
21:53:55 | shashlick | okay so still at step 1 here - can i count on you guys to help with testing, code reviews and contributions on nimble |
21:54:01 | FromGitter | <Willyboar> take a look at rubygems.org |
21:54:23 | disruptek | i'm happy to look but i'm done with touching. |
21:54:47 | * | paxis quit (Quit: Client exiting) |
21:54:51 | FromDiscord | <mratsim> more likely testing + opening bugs for me |
21:55:44 | shashlick | okay, i'll continue asking for feedback so that we can solve these issues over time |
21:55:57 | shashlick | @mratsim - appreciate your review of the gist as well |
21:56:01 | FromDiscord | <mratsim> don't hesitate to use the forum btw |
21:56:11 | shashlick | @treeform - anything you disagree with on the gist |
21:56:15 | shashlick | main proposal |
21:56:38 | shashlick | @mratsim - i've posted it on the forum as well |
21:57:14 | FromDiscord | <treeform> shashlick, I just don't feel like it solves any of my problems. If it solves your problems great. |
21:58:25 | * | nif_ quit (Quit: ...) |
21:58:34 | * | nif joined #nim |
21:58:47 | shashlick | you mentioned you don't like the global ~/.nimble and to use a local libs |
21:58:49 | shashlick | this is exactly that |
21:59:39 | dom96 | what are you all discussing? |
21:59:52 | FromDiscord | <treeform> dom96, nothing... |
22:01:07 | dom96 | You're discussing nothing? |
22:01:13 | FromDiscord | <treeform> yep |
22:02:07 | shashlick | trying to win some love for nimble |
22:04:29 | shashlick | @dom96 - question for you - I've explained why i think project isolation is valuable and how it will make lock files easier to build than the user deps mode |
22:04:43 | shashlick | why do you think this is not accurate? |
22:05:13 | * | go|dfish joined #nim |
22:05:34 | * | Tyresc joined #nim |
22:05:54 | dom96 | Can you point me to exactly where you explain how lock files can benefit from this feature? |
22:06:22 | dom96 | I read your "Motivations" in your RFC and I'm still not certain |
22:06:32 | dom96 | Presumably "Once a working configuration is reached regardless of deps mode, the user can then generate a lock file that improves on distribution. That design will be discussed separately and not distract this RFC."? |
22:06:35 | * | Vladar quit (Quit: Leaving) |
22:06:56 | dom96 | But in my mind you don't /need/ project-local deps for this |
22:08:13 | shashlick | not for simple project sure - but if you have many active projects and a variety of dependencies installed in ~/.nimble, you have lesser control over which package gets pulled into your active project |
22:08:36 | dom96 | Also, your motivations do not match Araq's. Your motivations sound a lot like the same motivations for lock files. |
22:09:27 | shashlick | this comment is an example - https://gist.github.com/genotrance/ee2ce321a56c95df2d4bb7ce4bd6b5ab#gistcomment-3073716 |
22:09:31 | dom96 | shashlick, that sounds like a rare issue, and if it happens you can always remove old versions of packages. |
22:10:12 | dom96 | yes, that comment describes what lock files will solve. |
22:10:41 | shashlick | you cannot create a lock file in the first place when you have such conflicts |
22:12:08 | dom96 | Cargo manages it somehow, no? :) |
22:13:11 | * | letto quit (Quit: Konversation terminated!) |
22:13:27 | shashlick | the whole reason I picked up this local deps mode thing is because you and Araq agreed on it in the first place |
22:13:34 | shashlick | i am simply documenting all the nuances |
22:13:49 | shashlick | and i'm happy not to do it if it isn't useful |
22:15:09 | shashlick | where does cargo store dependencies? globally or per project |
22:16:11 | FromGitter | <Willyboar> i think globally |
22:16:19 | * | pbb quit (Remote host closed the connection) |
22:16:25 | dom96 | yeah, globally AFAIK |
22:17:02 | dom96 | Most users of Rust also do not use `rustc` directly, they use `cargo` to build their software |
22:18:08 | shashlick | yes but that's not what our community is used to |
22:18:25 | shashlick | and we do not have lock files yet or any plan or design |
22:20:10 | dom96 | our community isn't used to project local dependencies either |
22:20:31 | * | pbb joined #nim |
22:20:35 | dom96 | it's up to us to decide where we go, and I've been advocating for "use Nimble instead of Nim for everything" for a while now |
22:21:23 | shashlick | its not like cargo hasn't run into these issues |
22:21:23 | shashlick | https://stackoverflow.com/questions/25074191/how-to-resolve-multiple-matching-crates-for-package-in-cargo |
22:21:27 | dom96 | The reason I am asking you to clarify your motivations is because they are different to Araq's motivations as far as I understand |
22:21:29 | shashlick | https://www.reddit.com/r/rust/comments/3tsohd/cargo_url_version_conflict/ |
22:21:38 | shashlick | agreed they are old and i have zero rust experience |
22:21:46 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:22:13 | shashlick | so no idea but this idea of isolating deps has resonated with many folks |
22:22:29 | shashlick | what are Araq's motivations? |
22:22:55 | dom96 | Araq's motivations: https://gist.github.com/genotrance/ee2ce321a56c95df2d4bb7ce4bd6b5ab#gistcomment-3072467 |
22:23:19 | shashlick | those are my motivations after a bunch of revisions mainly because i understand project local deps do not solve every instance of dependency conflicts but definitely reduce the instances |
22:23:38 | shashlick | and lock files remove them once and for all but you even need to get to that point where a stable lock file can be created |
22:24:33 | dom96 | You're presenting this as an alternative to lock files, which is why I am asking for clarification |
22:24:36 | shashlick | looking at that comment, it is exactly what i'm saying |
22:24:49 | shashlick | i'm not saying this is an alternative to lock files |
22:24:53 | dom96 | Perhaps that is the way to go, but if that is what we're considering then we need to be clear about it. |
22:25:09 | shashlick | Once a working configuration is reached regardless of deps mode, the user can then generate a lock file that improves on distribution. That design will be discussed separately and not distract this RFC. |
22:25:15 | shashlick | from motivations ^^ |
22:25:45 | shashlick | basically local deps will provide project isolation which will help reduce dependency conflicts |
22:25:55 | dom96 | Okay, but all of the things you want to implement seem like a replacement for lock files to me |
22:26:01 | shashlick | and lock files will solve the distribution and reproducible builds concerns |
22:26:23 | shashlick | which aspects in particular? |
22:27:26 | dom96 | You say that you want to provide "dependency isolation", to me that is what lock files are about as well. |
22:28:24 | * | letto joined #nim |
22:28:39 | dom96 | I think many people here also see it that way. |
22:29:16 | dom96 | But on the other hand, if we say that this isn't a replacement for lock files, then I'm not sure it solves a big enough problem to be worth so much effort. |
22:29:56 | dom96 | Maybe I'm overestimating the effort required though |
22:30:07 | shashlick | the code change for this is quite minor - just leveraging nimbleDir functionality |
22:31:17 | shashlick | lock files have bigger impacts |
22:32:00 | dom96 | I could say that changes to implement lock files are quite minor too to be honest. |
22:32:15 | dom96 | All it is is a list of URLs and commit hashes |
22:32:30 | dom96 | Nimble already understands those and can install them into isolated directories |
22:33:34 | dom96 | At a high level it would just involve reading the lock file and use the list of deps that is specified there instead of in the .nimble file. |
22:34:40 | dom96 | Let's look at this another way though |
22:34:43 | shashlick | let me ask this question |
22:34:53 | dom96 | okay, go ahead |
22:35:18 | dom96 | btw just noticed this in your RFC "Checking in $prj/deps/* - vendoring or poor man's lock files" |
22:35:39 | shashlick | if you have prj1 and prj2 - both need dep1 but prj1 needs v1 and prj2 needs v2 |
22:36:01 | dom96 | okay, I'm with you so far |
22:36:29 | shashlick | so prj1 nimble file says dep1 >= v1 and prj2 says dep1 >= v2 |
22:36:43 | dom96 | right |
22:37:18 | shashlick | so somehow, v1 of dep1 is already installed in ~/.nimble by some other project |
22:37:19 | * | ng0 joined #nim |
22:37:56 | shashlick | if you work on prj2, it will now install dep1v2 by nimble and when you create its lock file, it will be created correctly |
22:38:11 | dom96 | right, I think see where you're going with this |
22:38:21 | shashlick | but if you now switch to prj1 and attempt to create a lock file, it will just pick up v2 again which is not the right version |
22:38:27 | dom96 | prj1's `dep1 >= v1` is wrong then |
22:38:32 | shashlick | i'm curious how cargo solves this, or if the sequence is off |
22:38:44 | dom96 | the way cargo solves this is with semantic versioning |
22:39:01 | dom96 | `dep1 ~= 1.*.*` |
22:39:50 | dom96 | In Nim you could write: `dep1 >= 1.0.0 && dep1 < 2.0` |
22:40:08 | dom96 | or sorry, dep1 >= 1.0.0 && < 2.0 |
22:40:15 | dom96 | That's the correct syntax IIRC |
22:40:44 | dom96 | Cargo has syntax sugar for this, and Nimble should get this too: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements |
22:41:15 | dom96 | bah, I got the syntax wrong again, it's just one ampersand |
22:41:27 | dom96 | https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/version.nim#L300 |
22:41:52 | dom96 | This has been implemented in Nimble since 2012 :) |
22:41:54 | shashlick | so now the package author has to be very prescriptive in his package ranges instead of project isolation which avoids this whole thing |
22:42:43 | dom96 | the package author has to be prescriptive anyway |
22:42:50 | dom96 | even with project isolation |
22:43:02 | dom96 | Do you expect everyone to commit their local deps folder into git? |
22:43:23 | dom96 | if the answer is yes, then consider the implications |
22:43:29 | shashlick | I don't want local deps to be used to solve distribution issues |
22:43:33 | shashlick | that is a lock file domain |
22:43:56 | dom96 | the local deps folder is the source of truth for dependencies, so how can Nimble install the package? It'll need to copy the packages in the local deps directory into wherever it is installing I guess? |
22:43:58 | shashlick | that's why i mentioned vendoring or poor man's lock files - it doesn't really solve anything beyond the immediate developer's issues |
22:44:35 | dom96 | okay, so the developer will still need to specify the dependency requirements accurately |
22:44:47 | dom96 | so that others can install their packages |
22:45:31 | shashlick | when a local deps package is installed, it goes back into standard behavior |
22:45:33 | dom96 | (remember that lock files only make sense for binary packages, so for library authors lock files will not save the developers from having to specify good requirements) |
22:45:40 | shashlick | until lock files come, we won't solve the distribution issue |
22:46:06 | shashlick | which is why i said isolation is perhaps a foundation, not crucial for or a replacement for lock files |
22:46:37 | dom96 | once again, if all it solves is the example you gave above then it's a misfeature |
22:46:51 | dom96 | package authors will *need* to specify good package requirements anyway |
22:51:04 | dom96 | Does that make sense? |
22:51:23 | shashlick | ya am thinking about it |
22:51:47 | shashlick | like i said, i started this based on the assumption that you and Araq agreed that $prj/deps is a simple/easy thing |
22:53:09 | dom96 | I actually wanted Araq to implement this so that I could discuss these issues with him. I figured that once he would start to implement it we would have a more concrete idea of what this feature will be like |
22:53:20 | dom96 | So in principle, yes, I agreed to this. |
22:53:44 | shashlick | https://irclogs.nim-lang.org/30-10-2019.html#13:18:47 |
22:55:50 | shashlick | how often do people override CARGO_HOME |
22:55:55 | shashlick | or GOROOT or whatever |
22:57:06 | dom96 | yes, I discussed it with Araq and gave him some ideas on how to implement this with the intention of iterating on the solution until we got to something we would be happy with. |
22:57:41 | dom96 | I would have challenged him in the same way I am challenging you if I didn't understand the motivation behind his plans. |
22:59:40 | shashlick | okay i understand if this wasn't clear at the time but i don't see my motivations as different from what Araq has mentioned |
23:00:35 | dom96 | Okay, well now I know that they are the same, but now I've become less convinced that this is a necessary feature after all these discussion. |
23:00:39 | dom96 | I hope you can understand why |
23:02:14 | shashlick | your solution to this is effectively to be more prescriptive of the dependency version in nimble |
23:03:36 | shashlick | the topic of communicating nimble dep selection to nim and removing nim's knowledge of nimble is still separate and open |
23:04:06 | dom96 | I argue that packages should /already/ be prescriptive |
23:04:19 | dom96 | But I agree that Nimble can do more to encourage that |
23:05:00 | shashlick | that's not necessarily an easy problem though - lock files + caret requirements and other magic will take time to get right |
23:05:29 | dom96 | Btw now that I think about it a bit more, I actually don't think Araq would have given the same example as you when speaking about his motivations. I think he just doesn't want to bother writing .nimble files, and instead wants to install the packages he needs with a command and be done with it. |
23:06:10 | shashlick | that's a separate issue of nimble updating the nimble file on install/uninstall |
23:06:29 | shashlick | it's not quite as easy since nimble files are code and not data |
23:06:37 | dom96 | Maybe it's a separate issue to you, but I believe that is his motivation for this feature. |
23:07:05 | shashlick | i mean it is a potential nimble feature |
23:07:38 | dom96 | true, and it would solve the same problem as the "local deps" solution |
23:08:06 | dom96 | but it might actually be much easier to do |
23:08:16 | * | Tyresc quit (Ping timeout: 268 seconds) |
23:08:29 | dom96 | oh, the only problem is you wouldn't be able to run `nim c` to compile the code |
23:09:09 | dom96 | but even for "local deps" you'd need a `nim` modification for this to work |
23:09:41 | shashlick | ya but from our earlier discussion, you said let's figure it out with nimble c before we work out the nim <=> nimble improvements |
23:09:41 | dom96 | maybe instead we can give Araq a little command line tool that modifies his nim.cfg file with `--path` statements :D |
23:10:21 | shashlick | i'm not sure how this use case has anything to do with local deps really |
23:10:54 | dom96 | yeah, what worries me the most about this local deps feature is that you intend to modify `nim` as well for it |
23:11:00 | * | ng0 quit (Ping timeout: 260 seconds) |
23:11:15 | dom96 | which I'm glad we agreed not to do for now |
23:11:39 | dom96 | Here is what I see might work for Araq: |
23:11:54 | dom96 | nimble edit-cfg-mode # TODO: better name |
23:12:19 | dom96 | nimble install pkg # Installs the package into ~/.nimble and adds its path to nim.cfg |
23:12:57 | * | ng0 joined #nim |
23:13:24 | shashlick | i think we can share this transcript with him and see what his thoughts are |
23:13:31 | dom96 | The reason I suggest this is because I'm rather worried that Araq's problems don't extend to the wider Nim community, hence the very specialised command for this |
23:13:51 | shashlick | my concern with the nim.cfg method is that it works fine if you install/uninstall packages in a folder - nim.cfg will be kept up to date |
23:14:13 | dom96 | right, but won't you have to do the same with the "local deps" folder? |
23:14:31 | shashlick | but if you never use nimble and simply try to run nim commands on some .nim file, none of the already installed packages will get picked up since there won't be any nim.cfg |
23:15:02 | shashlick | like i said, i tabled that entire nim <=> nimble design for later |
23:15:34 | dom96 | well, this particular thing seems important, I can't imagine what you're planning the work flow here to be |
23:15:47 | shashlick | that's why local deps was simply isolation |
23:15:51 | dom96 | It might in fact help to specify this in future RFCs: a typical normal user's workflow for this feature |
23:16:10 | dom96 | Do you expect users to manually copy dependencies into the local deps folder? |
23:17:07 | shashlick | i know there are nuances - that's why i want them discussed well before we code up anything |
23:17:39 | shashlick | for local deps, once you mkdir, any nimble command you run will setup deps locally |
23:17:46 | shashlick | any command that runs processDeps |
23:18:18 | shashlick | and a user would have to use nimble since that's the only way to download and install deps |
23:18:21 | dom96 | right |
23:18:37 | dom96 | so I don't understand your concern above |
23:18:52 | dom96 | for the nim.cfg method |
23:19:50 | shashlick | assume that a package is already installed in ~/.nimble and there isn't a nim.cfg, there's no need to run nimble |
23:20:19 | dom96 | but the whole idea is isolation? no? |
23:20:46 | shashlick | i'm not talking isolation, i'm talking about your edit-cfg-mode |
23:21:42 | shashlick | again, without Araq here to speak for himself, it is hard to guess what he wants |
23:22:25 | shashlick | I didn't cover any nim <=> nimble interop in the proposal and he liked it |
23:22:38 | dom96 | I'm trying to compare local deps to edit-cfg-mode |
23:22:55 | dom96 | your concern is that it requires nimble |
23:23:01 | dom96 | but local deps requires nimble too... |
23:23:21 | shashlick | i see edit-cfg-mode as the solution to remove nim's awareness of nimble |
23:23:42 | shashlick | that way, nim gets told what packages to load, regardless of whether it comes from $prj/deps or ~/.nimble |
23:24:02 | shashlick | it does not have anything to do with isolation |
23:24:31 | shashlick | perhaps it does in some way if nim's algorithm to pull pacakges is not as fine grained as nimble's |
23:24:49 | shashlick | that's why you are arguing that nimble should be the front end |
23:25:02 | shashlick | i haven't reviewed nim's dependency search algorithm |
23:25:20 | dom96 | it has everything to do with the motivation behind "local deps" |
23:25:26 | shashlick | quoting araq: It's to avoid bugs when nim c picks the wrong version of a package for a build |
23:25:35 | dom96 | and it does solve isolation too |
23:25:53 | dom96 | the only difference is that packages are installed in the same place they always have been |
23:26:03 | dom96 | and that Nim doesn't need to be modified |
23:28:15 | shashlick | so you are saying it provides isolation since once the nim.cfg file is created, it now has a hard-coded path to a version of the dep |
23:28:39 | shashlick | but i don't understand how the package can be distributed like this with no `requires` |
23:28:56 | shashlick | there will just be a nim.cfg pointing to stuff that isn't installed yet |
23:29:32 | dom96 | yes, but "local deps" cannot be distributed either |
23:29:55 | shashlick | local deps still requires requires |
23:30:24 | dom96 | I don't think it does |
23:30:31 | dom96 | not when running `nim` |
23:31:30 | shashlick | how will those deps show up on a second machine |
23:31:43 | shashlick | nimble won't look at the nim.cfg and install them |
23:32:41 | shashlick | so in `edit mode`, nimble install will install to ~/.nimbe and update nim.cfg |
23:33:01 | dom96 | again, this is how "local deps" would work too |
23:33:14 | shashlick | so the location will be hard-coded to that specific package in global ~/nimble |
23:33:18 | dom96 | if local deps is enabled, you run `nimble install blah` and it gets put into the local deps |
23:33:42 | shashlick | but user will still have to specify requires dep1, etc |
23:33:52 | shashlick | that way when project is installed, they will redownload the deps |
23:34:14 | dom96 | Will you force them to do that? |
23:34:29 | dom96 | You cannot force them because Nim will "just work" with the local deps |
23:34:29 | shashlick | if they don't, project won't be redistributable |
23:34:43 | dom96 | Yes, and this is why it's bad to encourage this |
23:34:58 | shashlick | i'm not talking local deps at all - i'm talking edit mode |
23:35:18 | shashlick | can you describe step by step, i'm not sure what the problem is that is being solved |
23:35:29 | dom96 | argh |
23:35:42 | dom96 | I know you're not talking edit mode |
23:35:51 | dom96 | er |
23:35:52 | dom96 | local deps |
23:36:02 | dom96 | I'm trying to show you that these are very similar |
23:36:07 | dom96 | to show you the problems with the proposal |
23:36:45 | shashlick | yes i'm getting that it is possible to get isolated deps with nim.cfg but i'm trying to get the rest of what you are saying |
23:38:48 | dom96 | in edit-cf-mode: nimble install blah # -> .nimble and into .nim.cfg |
23:39:10 | dom96 | in local deps mode: nimble install blah # -> into $PWD/deps |
23:39:18 | dom96 | in edit-cfg-mode: nim c project.nim |
23:39:35 | dom96 | (Reads the .nim.cfg and knows the paths) |
23:40:03 | dom96 | in local deps mode: nim c project.nim (Looks for $PWD/deps and adds any packages in there to the path automatically) |
23:40:44 | dom96 | Both solve the same problem, both have the same problems. |
23:44:54 | shashlick | the problem of distribution? |
23:45:47 | dom96 | They solve isolation, and indeed they have the problem of distribution |
23:47:04 | shashlick | i think nim.cfg method solves the interop issue as well without requiring duplicate dep pkgs per project |
23:47:09 | shashlick | but would the user then check in the nim.cfg |
23:47:57 | shashlick | it almost sounds like we can promote the nim.cfg into nimble.lock or something instead and that can be checked in |
23:48:31 | dom96 | yes, I'm intentionally trying to raise these parallels between these |
23:48:34 | shashlick | but we need to solve the issue of paths - perhaps $nimbleDir/pkg/123 and nim will use the std nimble dir for that platform |
23:49:13 | dom96 | For isolation I would be happy with just lock files |
23:49:18 | shashlick | how would nimble c then work? in edit mode, would it no longer pass stuff to nim? |
23:49:31 | dom96 | But then Araq won't be happy because he'll need a .nimble file in order to get a lock file |
23:50:03 | dom96 | My suggestion of edit mode isn't 100% serious, I just wanted to demonstrate why I think local deps isn't what we should be pursuing |
23:50:08 | shashlick | i'm not sure that should be true - every pkg manager expects you to tell what version range you want |
23:50:40 | shashlick | i'm cool with that, that's why i'm asking questions of everyone - i don't have a strong opinion either way |
23:50:56 | shashlick | what I want though is to solve the community's concern with nimble |
23:51:29 | dom96 | That's brilliant, in order to do that though you need to understand the concerns |
23:52:01 | dom96 | If Nimble becomes a mess of features which achieve the same goals then no one will have a good experience |
23:52:27 | dom96 | it's important we get behind a single solution that solves 95% of the problems |
23:52:37 | dom96 | and suggest fair workarounds for the rest of the use case |
23:52:39 | dom96 | *cases |
23:53:38 | shashlick | ok here's a thought - we can certainly create a nim.cfg format file with paths to specific versions |
23:54:13 | shashlick | this will provide isolation (path to specific version not impacted by other packages) which is simultaneously a lock as well |
23:54:19 | shashlick | it can be checked into source control |
23:54:39 | shashlick | it is also reducing nimble specific code in nim |
23:54:48 | shashlick | all nim would need to know is the nimbleDir |
23:54:58 | dom96 | okay, this sounds like a separate proposal |
23:55:01 | shashlick | rest of the paths are in the nim.cfg |
23:55:13 | shashlick | big question - how can nimble now recreate this configuration |
23:55:13 | dom96 | honestly I'm too tired now and need to go to bed. Feel free to write it up though |
23:55:30 | dom96 | I think this is just an implementation detail of how lock files will be implemented though |
23:55:34 | shashlick | for that nimble will need to read this nim.cfg, figure out the specific pkg versions and install those |
23:56:37 | disruptek | i'm doing this in nimph, but it requires a compiler tweak. |
23:58:02 | shashlick | why does it need a compiler tweak |
23:58:10 | disruptek | 'cause the parse isn't exported. |
23:58:15 | disruptek | s/parse/parser/ |
23:58:31 | disruptek | i know. it's dumb. |
23:58:45 | shashlick | you mean it will import the nim.cfg using the compiler as a lib? |
23:58:50 | disruptek | yeah. |
23:59:08 | shashlick | it's just a cfg file, we can just read --path: |
23:59:13 | shashlick | anyway nimble no longer imports compiler |
23:59:18 | disruptek | i don't see the point in maintaining my own parser for nim.cfg. |
23:59:19 | shashlick | it calls nim as a separate binary |
23:59:38 | disruptek | you can do whatever you want. 😉 |
23:59:59 | shashlick | come on, don't walk away randomly |