00:07:55 | * | Kaivo quit (Quit: WeeChat 2.4) |
00:09:43 | * | Kaivo joined #nim |
00:11:44 | FromGitter | <jrfondren> so asyncstreams.read works by assigning the stream callback so that the next write() will complete the future that .read is now returning. |
00:14:18 | FromGitter | <jrfondren> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cdcab5abdc3b64fcf52b0ce] |
00:14:54 | FromGitter | <jrfondren> @dirsuptek there you go. see, it's not a bug at all. your read is handled immediately by which I mean soon. |
00:16:06 | FromGitter | <jrfondren> the 'soon' isn't 500ms later. it's actually pretty close to immediately after. but there's always a poll() after the 'soon'. |
00:31:20 | * | theelous3 quit (Ping timeout: 246 seconds) |
00:32:59 | FromGitter | <jrfondren> https://gist.github.com/jrfondren/abeaef41b69b149945d325c34936f697 - updated with a fix and timings in the comment. |
00:33:20 | * | theelous3 joined #nim |
00:33:58 | disruptek | think i'll stick with sync, thanks. |
00:40:57 | FromDiscord | <Avatarfighter> discord previews are on point today |
00:42:31 | FromDiscord | <Avatarfighter> https://prnt.sc/np55yo |
00:42:37 | FromDiscord | <Avatarfighter> ^ what i mean lol |
00:42:49 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
00:43:27 | FromGitter | <jrfondren> the tiny image is pretty much the essence of that link, aye |
00:43:52 | FromDiscord | <Avatarfighter> the image is the true eye candy to the gist haha |
01:00:19 | * | stefanos82 quit (Remote host closed the connection) |
01:01:29 | FromDiscord | <Avatarfighter> Stupid question, how do you make a table hold any type as a value? |
01:06:44 | FromGitter | <jrfondren> you can't. |
01:07:25 | FromGitter | <jrfondren> what you can do instead is define a variant type AnyType and then make that your value, which means runtime checking every time you fetch a value to see what its actual type is. |
01:07:45 | FromGitter | <jrfondren> I believe there are some packages in nimble that provide an AnyType that might be more convenient |
01:08:20 | FromGitter | <jrfondren> ... I don't remember what it's called. I saw it in passing. |
01:08:51 | FromGitter | <jrfondren> if your actual need is to have one of a small set of types, your own variant will be easy |
01:09:34 | FromDiscord | <Avatarfighter> Yeah I just need to handle a specific set of types, I just don't know what or how I should make an "AnyType" |
01:10:01 | FromGitter | <jrfondren> alright one sec |
01:10:05 | FromGitter | <kayabaNerve> Inheritance. |
01:10:18 | FromGitter | <kayabaNerve> type x = ref object of RootObj |
01:10:28 | FromGitter | <kayabaNerve> type y = ref object of x |
01:10:55 | FromGitter | <kayabaNerve> Add an enum of possible types, save a value from there to X, cast as needed |
01:12:14 | FromDiscord | <Avatarfighter> huh, I'll try that |
01:13:03 | FromDiscord | <Avatarfighter> Thank you 😃 |
01:14:18 | FromGitter | <jrfondren> ah if only Nim dispatched off return types as well as parameter types, like Ada. |
01:14:50 | FromGitter | <jrfondren> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cdcb98ada34620ff94b7bf0] |
01:14:53 | FromGitter | <jrfondren> then that would actually work :p |
01:18:19 | FromGitter | <jrfondren> this is what I was talking about: https://gist.github.com/jrfondren/44fb942087502336eac4c9e5471e729c |
01:19:58 | FromDiscord | <Avatarfighter> That seems pretty straightforward, I just need to rewrite some stuff to handle this kind of thing, i'm ngl i'm pretty excited for when i put all this code together \:). Thank you jrfondren |
01:31:29 | FromGitter | <jrfondren> #11263 created for that async stuff. |
01:53:54 | FromGitter | <kayabaNerve> A case statement doesn't allow named subtypes |
01:54:07 | FromGitter | <kayabaNerve> It is cast-less though |
01:54:18 | FromGitter | <kayabaNerve> And a Generic doesn't preserve the master type |
02:01:11 | * | banc quit (Quit: Bye) |
02:06:21 | * | rnrwashere quit (Remote host closed the connection) |
02:11:43 | * | laaron quit (Remote host closed the connection) |
02:15:12 | * | rnrwashere joined #nim |
02:17:47 | * | rnrwashere quit (Remote host closed the connection) |
02:19:56 | * | ftsf joined #nim |
02:22:37 | * | banc joined #nim |
02:29:49 | * | laaron joined #nim |
03:01:16 | * | rockcavera quit (Ping timeout: 246 seconds) |
03:05:20 | * | theelous3 quit (Ping timeout: 246 seconds) |
03:09:02 | * | dddddd quit (Remote host closed the connection) |
03:12:22 | * | rockcavera joined #nim |
03:22:07 | * | Tanger quit (Quit: Leaving) |
03:24:59 | * | Tanger joined #nim |
03:51:09 | * | gangstacat quit (Ping timeout: 250 seconds) |
04:14:30 | * | rnrwashere joined #nim |
04:17:30 | * | rnrwashere quit (Remote host closed the connection) |
04:23:11 | * | nsf joined #nim |
04:42:27 | * | leorize quit (Remote host closed the connection) |
04:42:56 | * | leorize joined #nim |
04:46:54 | * | narimiran joined #nim |
04:55:13 | * | rnrwashere joined #nim |
04:59:39 | * | rnrwashere quit (Ping timeout: 248 seconds) |
05:01:12 | * | cyberjpn joined #nim |
05:12:07 | FromDiscord | <Avatarfighter> Do case statements with enums with holes not work? |
05:12:39 | FromDiscord | <Avatarfighter> I'm getting the error `selector must be of an ordinal type` but I'm a bit perplexed as to why |
05:13:03 | FromDiscord | <Avatarfighter> https://hastebin.com/vupuwuxahi.js if anyone is interested |
05:16:42 | * | leorize quit (Quit: WeeChat 2.3) |
05:25:45 | * | cyberjpn quit (Remote host closed the connection) |
05:28:49 | * | rnrwashere joined #nim |
05:36:35 | * | cyberjpn joined #nim |
05:45:10 | rayman22201 | preliminary support for Nim in Godbolt working: https://imgur.com/se1mU6j |
05:47:18 | rayman22201 | What works: compiling nim. |
05:47:18 | rayman22201 | What doesn't work: everything else lol |
05:52:14 | * | leorize joined #nim |
05:58:15 | * | cyberjpn quit (Remote host closed the connection) |
06:02:54 | leorize[m] | @Avatarfighter: see https://nim-lang.github.io/Nim/manual#types-enumeration-types |
06:03:23 | leorize[m] | > An explicit ordered enum can have holes ... However, it is then not an ordinal anymore ... |
06:03:26 | * | solitudesf joined #nim |
06:03:40 | * | krux02 joined #nim |
06:04:06 | leorize[m] | but I don't think the ordinal requirement is really needed for case object :/ |
06:08:48 | * | arecaceae quit (Remote host closed the connection) |
06:09:08 | * | arecaceae joined #nim |
06:18:03 | leorize | narimiran: how often does nimsuggest crashes for you? |
06:18:51 | * | ftsf quit (Remote host closed the connection) |
06:19:06 | * | ftsf joined #nim |
06:26:01 | rayman22201 | debugger:native "almost" gives Godbolt enough info to do code -> asm highlighting correctly lol |
06:26:49 | * | PMunch joined #nim |
06:29:09 | * | solitudesf quit (Ping timeout: 252 seconds) |
06:30:16 | * | Summertime quit (Quit: Sunsetting.) |
06:31:05 | FromGitter | <jrfondren> Cool |
06:31:45 | * | Summertime joined #nim |
06:33:36 | leorize | rayman22201: I think you'd only need --lineDirs:on? |
06:36:54 | * | jjido joined #nim |
06:41:17 | rayman22201 | Nope. Tried that. wasn't sufficient. |
06:42:00 | rayman22201 | I thought the same thing. I'm not sure why lineDirs:on isn't enough |
06:43:45 | PMunch | Okay, trying to deploy the new playground now :) |
06:44:01 | leorize | rayman22201: try passing --passC:'-g' |
06:44:24 | leorize | maybe debuginfo have to be embedded into the resulting object files? |
06:45:35 | PMunch | Hmm, devel doesnt seem to build atm.. |
06:46:59 | leorize | PMunch: I saw localhost in the frontend code :P |
06:47:21 | PMunch | Oh right, good catch! |
06:48:15 | leorize | you should really store it in a const |
06:49:07 | leorize | narimiran: just made a new feature that should reduce the amount of nimsuggest instance running, would you like to take a testdrive? |
06:49:39 | narimiran | leorize: of course :) |
06:50:19 | narimiran | and i don't know how often does it crash |
06:50:44 | PMunch | leorize, well in production it should just use relative URLs |
06:50:54 | PMunch | But that didn't work when I opened it as a file in my browser |
06:51:02 | leorize | narimiran: see :messages and count the number of "exited with error code 1" :P |
06:51:07 | leorize | PMunch: use jester :) |
06:51:13 | leorize | serve it with jester :P |
06:51:18 | PMunch | That's what the actual server does |
06:51:24 | PMunch | I was just lazy while testing this :P |
06:51:30 | leorize | :P |
06:51:44 | PMunch | I even had the jester instance running locally, it would've just been a matter of moving the files over |
06:52:27 | leorize | laziness strikes |
06:52:45 | leorize | narimiran: please checkout the session-resume branch of nim.nvim |
06:53:22 | leorize | this should attempts to revive nimsuggest when it dies instead of spawning a new one at the current location |
06:53:28 | narimiran | leorize: ok, and what am i looking for? just count open nimsuggest instances? |
06:54:13 | leorize | yea, it should only use 1 per project |
06:54:43 | * | Vladar joined #nim |
06:55:01 | leorize | note: a project is the directory containing the first file you open, any subdir will reuse this instance |
06:55:33 | narimiran | ok, will try it |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:02:39 | FromGitter | <gogolxdong> wrote a simpler SQL composer demo like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5cdd0b0f7c363c75a7ea5d93] |
07:04:19 | leorize | nice, maybe you could try expanding ormin to support mysql? |
07:04:32 | leorize | it already sports a query building engine |
07:04:44 | * | gmpreussner joined #nim |
07:04:50 | PMunch | Since I couldn't build devel through choosenim (and Karax needs devel ATM) I manually installed the new frontend in a directory if anyone wants to try it https://play.nim-lang.org/newfrontend/index.html |
07:05:53 | leorize | nice, but you should try hiding the index.html part :) |
07:06:00 | PMunch | And the link format has changed, so a tour is now linked to like this: https://play.nim-lang.org/newfrontend/index.html#tour=https://play.nim-lang.org/tours/example.html |
07:06:52 | PMunch | leorize, that's just because I manually put in there, you can go to: https://play.nim-lang.org/newfrontend/ as well |
07:08:04 | leorize | it doesn't work without the trailing slash |
07:09:33 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:11:05 | PMunch | Hmm, seems to be down to it not finding the CSS and JavaScript |
07:11:43 | leorize | now the only cool thing left that the playground needs is output streaming from the server |
07:12:10 | PMunch | Hmm, yeah |
07:12:43 | PMunch | That's a tricky one though.. |
07:12:48 | leorize | after that you can even go further and implements terminal emulation :D |
07:13:21 | PMunch | Let's not get too carried away here :P |
07:14:56 | leorize | I think you could use websockets for data streaming? |
07:25:15 | * | NimBot joined #nim |
07:25:32 | leorize | the logo doesn't appear without the trailing / |
07:25:36 | * | jjido joined #nim |
07:25:51 | narimiran | leorize: i have tested it. when i'm careful which file i open first, it is just one instance of nimsuggest, but: |
07:26:34 | narimiran | ...if i save a session with multiple windows and buffers, and then i do `nvim -S`, i immediately get multiple nimsuggests |
07:28:04 | leorize | that's a feature I don't use... |
07:28:13 | leorize | I'll try to think of a way to combat that |
07:28:35 | narimiran | well i guess it is the same if i manually open multiple files in "wrong order" |
07:28:52 | leorize | well there aren't any easy way to detect a project :P |
07:29:16 | narimiran | .nimble file? |
07:29:58 | leorize | walking directories is a synchronous operation, so with the rate of nimsuggest dying this is not a nice choice |
07:30:33 | * | rnrwashe_ joined #nim |
07:30:53 | PMunch | leorize, should be fixed once the cache is updated :) |
07:30:54 | livcd | PMunch: good job |
07:31:05 | PMunch | livcd, thanks :) |
07:31:12 | PMunch | It's pretty much exactly the same as the old one |
07:31:19 | PMunch | Just in Karax this time |
07:31:41 | livcd | i get a huge cloudflare error |
07:31:42 | livcd | for ix |
07:31:51 | livcd | cant wait for your karax write up |
07:32:01 | leorize | narimiran: ofc, you could try to extend `nimble path` to return the path to the project file :) |
07:32:16 | leorize | also it should work everywhere within the project |
07:32:28 | PMunch | livcd, cloudflare error? |
07:32:49 | PMunch | This works fine for me: https://play.nim-lang.org/newfrontend#ix=1Hwy |
07:33:53 | * | rnrwashere quit (Ping timeout: 250 seconds) |
07:33:56 | narimiran | leorize: in the above scenario with multiple NS, i kill all of them and then try suggestions in "root file" first, and other files later - multiple NS again :/ |
07:34:33 | leorize | use :call nim#suggest#ProjectStop() |
07:34:43 | leorize | or else the session resume feature will just resurrect them |
07:35:10 | Mister_Magister | can i use nim inside c++ program? |
07:35:15 | leorize | yes |
07:35:57 | narimiran | leorize: did that, still the same. but this is getting offtopic, we can continue privately.... |
07:41:15 | * | madpat joined #nim |
07:52:41 | livcd | PMunch: https://imgur.com/a/sXX1svF |
07:59:32 | PMunch | livcd, hmm, and what did you try to do? |
07:59:41 | PMunch | Do you have any more information in the console? |
07:59:47 | * | leorize quit (Ping timeout: 256 seconds) |
08:01:39 | * | solitudesf joined #nim |
08:01:42 | * | leorize joined #nim |
08:03:00 | FromGitter | <dom96> Pmunch: why are you abusing hashes for what the URL Param have been invented for? |
08:03:12 | FromGitter | <dom96> *params |
08:04:30 | leorize | imo it's easier to use with karax |
08:05:31 | leorize | also, having both `tour` and `ix` params make no sense at all :P |
08:05:46 | * | madpat quit (Ping timeout: 252 seconds) |
08:06:15 | FromGitter | <dom96> Why is it easier? |
08:06:42 | PMunch | Mosly because Karax has the hash in "RouterData" but no other information |
08:07:17 | PMunch | And yeah, what leorize said about the tour and ix at the same time, but that was an accidental discovery after the fact :P |
08:08:13 | * | floppydh joined #nim |
08:11:32 | * | madpat joined #nim |
08:12:28 | * | rnrwashe_ quit (Remote host closed the connection) |
08:15:27 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:18:22 | * | madpat quit (Remote host closed the connection) |
08:23:03 | * | hoijui joined #nim |
08:27:28 | * | disruptek quit (Ping timeout: 258 seconds) |
08:29:44 | * | Gertm joined #nim |
08:29:50 | * | disruptek joined #nim |
08:35:15 | * | neceve joined #nim |
08:35:51 | * | JustASlacker joined #nim |
08:44:17 | * | Vladar quit (Ping timeout: 244 seconds) |
08:47:23 | * | ftsf quit (Ping timeout: 244 seconds) |
08:54:16 | * | beatmox_ quit (Remote host closed the connection) |
08:55:11 | poopBot | hmm about websockets |
08:55:12 | poopBot | WS negotiation failed: no advertised protocol supported; server speaks `myfancyprotocol` |
08:55:12 | poopBot | WS negotiation failed: the only supported sec-websocket-version is 13 |
08:55:34 | poopBot | do i have to change myfancyprotocol to 13 or am i doomed |
08:55:47 | poopBot | let (ws, error) = await(verifyWebsocketRequest(req, "myfancyprotocol")) |
08:56:37 | * | beatmox joined #nim |
08:58:20 | poopBot | oh guess i am doomed or meybe i can change client websocket too to 13 |
09:00:19 | Araq | maybe it's not hard to support more protocols for websockets.nim |
09:01:02 | poopBot | will focus on gamelogic first guess can expand on that leater |
09:03:19 | livcd | PMunch: maybe it's my corporate network |
09:03:30 | livcd | PMunch: just clicked on share on ix |
09:04:48 | * | laaron quit (Remote host closed the connection) |
09:06:58 | * | laaron joined #nim |
09:07:17 | * | laaron quit (Remote host closed the connection) |
09:07:47 | * | laaron joined #nim |
09:12:41 | Araq | STRIKE! finally #11239 works. Now I only have to detect/fix all the regressions... |
09:13:16 | narimiran | https://github.com/nim-lang/Nim/issues/11239 this one? |
09:14:19 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
09:14:33 | Araq | yeah and also other overloading resolution problems |
09:18:33 | Araq | and ... the tests are ... |
09:19:24 | Araq | .. the tension reaches unbearable levels ... |
09:19:34 | narimiran | queued :D |
09:19:52 | Araq | green except for a single one |
09:19:56 | Araq | damn |
09:20:52 | Zevv | so, was this always broken? |
09:20:58 | * | Vladar joined #nim |
09:23:45 | Araq | Zevv, at least of a couple of years |
09:25:14 | * | ftsf joined #nim |
09:25:28 | Zevv | interesting that it didn't pop up earlier and there were no tests for it, it feels like a very obvious thing |
09:25:38 | Zevv | but noone ran into it |
09:25:50 | Araq | I'm sure it was reported before |
09:26:05 | Araq | but it's also un-generic programming aka bad style |
09:26:54 | Araq | why would you specialize stuff like that? it means your generic T is not valid for string |
09:28:07 | FromGitter | <alehander42> well it's a form of overloading |
09:28:29 | * | Gertm left #nim ("Leaving") |
09:28:49 | Araq | that's just a word, if you want to specialize the implementation there are two reasons for this: |
09:29:18 | Araq | 1. it doesn't do the right thing for 'string' |
09:29:28 | Araq | if so, better use [T: not string] |
09:29:38 | Araq | 2. you think you can optimize it |
09:30:06 | Araq | if so, better use a 'when' statement in the generic it's clearer than misusing the overload resolution mechanism for it |
09:30:22 | FromGitter | <alehander42> yeah, but what if you have many cases: string, int etc |
09:30:41 | Araq | then you don't have a "generic" implementation |
09:30:41 | FromGitter | <alehander42> can you even write not about them |
09:30:55 | FromGitter | <alehander42> but you can still have a default for the other types |
09:32:29 | Araq | well please tell me about a valid use case, I'm not seeing it |
09:34:24 | Araq | remember that the specialization of vector<bool> in C++ is now widely regarded as a mistake |
09:36:55 | * | laaron quit (Remote host closed the connection) |
09:37:57 | * | laaron joined #nim |
09:39:00 | PMunch | livcd, that is strange. It works fine for me here.. |
09:42:31 | livcd | would anyone have an idea how I can hide the powershell.exe window ? :X...i am executing a ps script from my nim app |
09:45:19 | PMunch | Well nim has the --app:gui to hide the console |
09:45:29 | PMunch | Not sure if that applies to scripts called by the program though.. |
09:45:38 | PMunch | Otherwise I guess it depends on how you call them |
09:46:31 | livcd | that does not work because I am calling explicitly powershell.exe from execCmd |
09:52:25 | PMunch | PowerShell.exe -windowstyle hidden { your script.. } |
09:52:30 | PMunch | According to StackOverflow |
09:52:53 | PMunch | https://stackoverflow.com/questions/1802127/how-to-run-a-powershell-script-without-displaying-a-window |
09:54:33 | livcd | unfortunately that's not it :/ |
09:58:28 | * | ftsf_ joined #nim |
09:58:58 | * | ftsf__ joined #nim |
10:01:19 | * | ftsf_ quit (Read error: Connection reset by peer) |
10:02:07 | * | ftsf_ joined #nim |
10:02:13 | * | ftsf quit (Ping timeout: 258 seconds) |
10:05:03 | * | ftsf__ quit (Ping timeout: 245 seconds) |
10:07:12 | * | laaron quit (Remote host closed the connection) |
10:09:01 | * | ftsf_ quit (Quit: Leaving) |
10:09:14 | * | laaron joined #nim |
10:14:14 | * | rnrwashere joined #nim |
10:18:33 | * | rnrwashere quit (Ping timeout: 250 seconds) |
10:20:07 | * | clyybber joined #nim |
10:29:28 | * | lritter joined #nim |
10:30:03 | * | leorize quit (Quit: WeeChat 2.3) |
10:34:40 | FromGitter | <kaushalmodi> https://lobste.rs/s/dnahfo/nim_programming_language_version_0_19_6#c_den659 |
10:41:40 | PMunch | Hmm, anyone have any good phone recommendations? |
10:41:58 | PMunch | My trusty OnePlus One is starting to show its age.. |
10:42:35 | PMunch | Probably didn't help that I dropped it in the sink under running water yesterday so I had to take the entire thing apart to get the speaker (and hence my alarm) to work again.. |
10:43:33 | FromGitter | <kaushalmodi> Pixel 3 |
10:45:17 | FromGitter | <kaushalmodi> I loved my OnePlus One too, which coincidentally, I lost to water as well .. I went swimming with my son with the phone in my swim shorts |
10:45:40 | clyybber | pocophone f1, though you might want to flash lineage on it |
10:45:48 | clyybber | to get rid of the bloatware/spyware |
10:46:21 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
10:47:11 | PMunch | clyybber, yeah I was looking at the Pocophone yesterday |
10:47:13 | * | laaron joined #nim |
10:48:16 | PMunch | Hmm, the Pixel 3 lacks a mini-jack and has a smallish battery.. |
10:48:47 | PMunch | The Pocophone has such a huge notch though.. |
10:49:03 | PMunch | I wish they'd just remake the One with better internal specs.. |
10:49:54 | PMunch | The grippy texture on the back is great, battery life is great (at least when it was new), and the flash anything and stay within warrenty was cool (not that I ever used it) |
10:56:57 | PMunch | Hmm, the Pocophone looks nice |
10:57:12 | PMunch | Spec-wise |
10:57:19 | PMunch | And price-wise :P |
11:01:52 | * | dddddd joined #nim |
11:13:11 | narimiran | leorize[m]: i have an indentation bug to report when you're here :) |
11:18:08 | * | leorize[m] waves |
11:18:46 | narimiran | come on irc so i can bother you privately :D |
11:18:58 | leorize[m] | PMunch: pixel 3a, the full-featured pixel |
11:21:23 | leorize[m] | narimiran: private messages work here too :) |
11:21:39 | PMunch | leorize[m], ooh, the 3a actually looks like a good deal |
11:21:52 | PMunch | No silly noth, headphone jack, good camera, fairly cheap |
11:21:56 | FromGitter | <kaushalmodi> PMunch: Pixel 3 lasts me one day plus |
11:22:04 | FromGitter | <kaushalmodi> I have never needed to charge it midday |
11:22:51 | FromGitter | <kaushalmodi> Camera is great (the beat I've used on a phone) on Pixel 3; is believe that 3a would be the same |
11:23:09 | FromGitter | <kaushalmodi> The Night Shot feature is not a gimmick; it's really awesome |
11:23:32 | Zevv | PMunch: phone: https://store.planetcom.co.uk/products/gemini-pda-1 |
11:23:41 | FromGitter | <kaushalmodi> Btw, about Nim, are the package names supposed to be case-insensitive? |
11:23:52 | FromGitter | <kaushalmodi> Ref: https://github.com/nc-x/crafty/pull/1 |
11:24:31 | FromGitter | <kaushalmodi> Apparently, they are style-insensitive on Windows, but case-sensitive on Linux |
11:25:12 | FromGitter | <kaushalmodi> Araq: please see above question about package identifier case-sensitivity on Linux. |
11:25:57 | * | gangstacat joined #nim |
11:26:19 | narimiran | kaushalmodi it is known |
11:26:59 | narimiran | kaushalmodi see stdlib modules and you'll see `naming_like_this.nim` but not `usingCamelCase.nim` |
11:30:30 | PMunch | Zevv, if I were to get a Planet phone I think I'll hold off for the Cosmo: https://www.indiegogo.com/projects/cosmo-communicator#/ |
11:34:41 | Zevv | makes sense. I'm still pretty heppy with the gemini, only thing is the camera is barely usable |
11:37:08 | Araq | kaushalmodi: on Unix we attempt the module name as you wrote it followed by trying it in alllowercase |
11:38:45 | Araq | by the convention is snake_case_everywhere.nim |
11:41:23 | PMunch | Zevv, wait you actually have a Gemini? |
11:41:28 | * | hoijui quit (Ping timeout: 264 seconds) |
11:43:25 | Zevv | for about a year. Its not perfect but amazing how they pulled that off |
11:45:32 | FromGitter | <kaushalmodi> Araq: Coincidentally, today another Windows vs Linux thing came up on lobsters: https://lobste.rs/s/dnahfo/nim_programming_language_version_0_19_6#c_den659 |
11:46:48 | livcd | hmm i think I need a serious guide to threads |
11:47:00 | narimiran | livcd: who doesn't? ;) |
11:47:14 | livcd | narimiran: maybe Araq |
11:47:43 | narimiran | btw, here is a not-so-serious guide, disguised as a game: https://deadlockempire.github.io/ |
11:48:04 | leorize[m] | newruntime will make threading life easier :) |
11:49:28 | * | tdc quit (Remote host closed the connection) |
11:49:30 | Zevv | narimiran: well that is a fun way of teaching things |
11:49:47 | livcd | narimiran: oh i meant with Nim |
11:49:54 | * | tdc joined #nim |
11:50:09 | Zevv | better then they way I once learned it - figuring out at 02.30 at night why the hell my interrupt handler code sometimes misbehaves |
11:50:49 | * | solitudesf quit (Ping timeout: 246 seconds) |
11:51:04 | PMunch | I have a fairly solid grasp on both Nim and threads in C, but threads in Nim still confuses me.. |
11:51:09 | Araq | kaushalmodi: I don't care what the internet thinks about Windows vs Linux, I know enough of both systems to have an informed opinion on my own |
11:51:46 | PMunch | Zevv, neat. Isn't it a bit big though? And do you actually use the keyboard and/or linux on it? |
11:52:36 | Araq | PMunch, threading in Nim is pretty simple, you use createThread on global vars and you use channels as global vars for communication. everything else pretty much doesn't work |
11:52:45 | Araq | :D |
11:53:38 | Araq | but hey, it's a lovely shared-nothing architecture that SCALES (TM) (better never benchmark anything though) |
11:54:37 | PMunch | Haha, yeah I've done a thing or two with threads in Nim. But they just seem odd to use, I always feel like I'm doing it wrong |
11:55:27 | Araq | that's good, I also planned a compiler switch --verify to give you move of this feeling |
11:55:55 | FromGitter | <kaushalmodi> Araq: It's not about opinion; I'm genuinely curious how other languages deal with symlinks |
11:56:15 | Araq | --verify would verify your code automatically, it's pretty simple, the compiler would always say "I am sorry, I cannot compile this Dave, it has a bug somewhere" |
11:56:37 | FromGitter | <kaushalmodi> I can see myself creating a similar issue like that symlink support issue. |
11:56:41 | livcd | kaushalmodi: is not that an old gh issue ? |
11:56:50 | FromGitter | <kaushalmodi> Yes, it is |
11:57:17 | FromGitter | <kaushalmodi> Talking about that because it surfaced in a lobste.rs thread |
11:57:48 | PMunch | Araq, great feature! |
11:58:23 | Araq | thanks |
11:59:47 | * | cyberjpn joined #nim |
12:02:09 | clyybber | kaushalmodi: Fix it :) shouldn't be too hard |
12:04:40 | Araq | before you "fix" it, create a good test case for it |
12:05:02 | Araq | extra points when I can still checkout the tests/ directory on Windows |
12:06:15 | Araq | extra points if I can later on still *add* new test files on Windows |
12:10:28 | * | livcd quit (Remote host closed the connection) |
12:13:36 | * | JustASlacker quit (Ping timeout: 268 seconds) |
12:18:47 | FromGitter | <kaushalmodi> The first step would be to create that issue again so that we can track it. While I not be capable to fix this myself, I will attempt to investigate which part of the stdlib is causing this. |
12:19:39 | Araq | for me the bug report was a cry for medical help. |
12:20:29 | FromGitter | <jrfondren> as in, "Doctor, when I do this, it hurts" ? |
12:20:37 | Zevv | "don't do that" |
12:22:24 | Araq | "after I've setup my system in the most convoluted way I cannot get any work done, please help me" |
12:33:36 | * | Snircle joined #nim |
12:38:04 | poopBot | wmm in nvim , when i write example rank:int it shows autocmpleti for int and only way to continue is to write a whiespace or am i using it worng |
12:42:10 | narimiran | poopBot: you can type anything |
12:44:29 | poopBot | yep but mainly i just want to Enter to go new line |
12:44:51 | poopBot | but Enter dosent work so i do 1 whitespace then Enter like tard :) |
12:45:29 | narimiran | for me it does. i guess you need to tweak some setting |
12:45:49 | poopBot | for me Enter is to pick form autocmople form what i see |
12:47:02 | poopBot | for OOP do i need to write alwes Person = object of type RootObj , atm i just write Person = object and i think it wokrs |
12:49:58 | * | cyberjpn quit (Ping timeout: 246 seconds) |
12:53:55 | clyybber | Araq: Should I make "var a = @[1]" generate "var a; var tmp = @[1]; `=move`(a, tmp)" or just a simple assignment? |
12:55:43 | * | sacredfrog joined #nim |
12:56:58 | clyybber | because previously, it was apparently mapped to "var a; `=sink`(a, @[1])" |
12:59:36 | Araq | what would the "simple assignment" be? keep in mind that the assignment can be in a loop and then you need to free the old seq |
13:02:27 | clyybber | hmm, yeah. The problem rn is that seq literals are NIM_CONST in the generated C code, so are generating segfaults upon trying to move. |
13:04:16 | FromGitter | <mratsim> sometimes I'd like to have a seq be materialized in the BSS segment of the binary. When I'm usin them for table implementations of transcendatal functions like exponential or logarithm. |
13:04:26 | FromGitter | <mratsim> const seq* |
13:04:50 | FromGitter | <mratsim> right now I'm forced to use `var` and I can't use no-sideeffect/func |
13:05:47 | FromGitter | <alehander42> but why can't you use a const array |
13:05:55 | FromGitter | <alehander42> const seq cant change, right? |
13:09:38 | FromGitter | <jrfondren> a seq needs an accumulator. that's a pointer though so it could be 0, so you could have a const seq. |
13:09:55 | FromGitter | <mratsim> it's the same. const array/seq only exist in the VM and have no address |
13:10:12 | * | cyberjpn joined #nim |
13:10:22 | FromGitter | <mratsim> if you index them, the compiler will directly inline the value needed |
13:10:37 | FromGitter | <jrfondren> ah, different problem. |
13:11:09 | FromGitter | <mratsim> See: https://github.com/numforge/laser/blob/master/laser/primitives/simd_math/exp_log_common.nim#L40-L46 |
13:11:59 | FromGitter | <mratsim> And it's used there: https://github.com/numforge/laser/blob/master/laser/primitives/simd_math/exp_log_avx512.nim#L62 |
13:12:18 | FromGitter | <mratsim> but the proc can't be noSideEffect due to accessing a global var :/ |
13:12:36 | FromGitter | <mratsim> it's just a small issue anyway. |
13:17:41 | FromGitter | <jrfondren> maybe `func getx: int = {.gcsafe.}: x` should work. |
13:17:56 | FromGitter | <mratsim> ah yeah, right |
13:18:04 | FromGitter | <jrfondren> it doesn't now |
13:18:58 | FromGitter | <mratsim> well since this will be mostly used in an OpenMP multithreaded context, and OpenMP proc cannot be noSideEffect, ultimately it's fine. |
13:19:12 | FromGitter | <jrfondren> I guess noSideEffects is the stronger guarantee so that shouldn't work in general, but it could at least work in the case where the only side effects are global variable accesses |
13:20:16 | Araq | you can use a {.noSideEffect.}: block in devel |
13:21:17 | FromGitter | <mratsim> yipeeh! :p |
13:21:28 | * | enthus1ast joined #nim |
13:21:29 | FromGitter | <jrfondren> ah cool |
13:22:38 | enthus1ast | can i trigger exec() from nimble file when i do "nimble install" ? |
13:23:14 | enthus1ast | so that i could execute shell commands after the nimble install procedure |
13:24:07 | * | sacredfrog quit (Ping timeout: 255 seconds) |
13:24:20 | enthus1ast | "after install" ... |
13:25:48 | FromGitter | <jrfondren> I don't think so, but I haven't checked for sure. What commands are you wanting to run? |
13:26:12 | Zevv | enthus1ast: the problem is that you can not rely on shell commands if someone does your nimble thing on windows |
13:26:25 | enthus1ast | "git submodule init" and "git submodule update" |
13:26:26 | FromGitter | <jrfondren> depending on what you need to do, for a library, you might have an {.error.} at compile-time to warn the user to do something |
13:26:39 | * | PMunch quit (Remote host closed the connection) |
13:27:13 | enthus1ast | it seems that "after install:" does what i want |
13:27:38 | FromGitter | <jrfondren> sir, please keep language "git submodule" in the seedy bar or the alley-way where it belongs |
13:27:57 | enthus1ast | ? |
13:28:33 | enthus1ast | too much slang for me :D |
13:28:37 | FromGitter | <jrfondren> I would surprised if "after install" does what you want because on install, most of your repo has already been discarded by nim |
13:28:52 | FromGitter | <jrfondren> *by nimble |
13:29:42 | enthus1ast | the thing is, this is an installer for an internal webchat that is divided into multiple submodules. Most of the public functionality is done in submodules. |
13:29:48 | * | sacredfrog joined #nim |
13:29:52 | FromGitter | <jrfondren> maybe nimble should --recurse-submodules when it does a git clone, instead |
13:30:24 | FromGitter | <jrfondren> yeah, all I know about git submodules is that they steal candy from children and push old ladies in front of cars |
13:30:28 | Araq | sounds like you're misusing 'nimble' for 'niminst' |
13:31:05 | enthus1ast | propably |
13:31:32 | FromGitter | <jrfondren> https://nim-lang.github.io/Nim/niminst.html |
13:32:23 | enthus1ast | but then it's not an git repo |
13:32:42 | poopBot | hmm, duckducking a video share site sux, i need somesite that wont blure my video, like some hastbin |
13:33:19 | FromGitter | <jrfondren> well you said you found something that works for you. if it doesn't, I think either nimble can be modified in one direction or another to support git submodules, or you can use nimble dependencies instead of submodules. Your deps don't need to be in the nimble repository, you can link them like `requires "https://github.com/walkre-niboshi/nim-ncurses >= 0.1.0"` |
13:34:58 | * | nsf quit (Quit: WeeChat 2.4) |
13:35:09 | poopBot | https://streamable.com/1vjcr here my nvim autocomple issue |
13:35:13 | poopBot | :) |
13:36:39 | narimiran | poopBot: have you tried pressing right arrow before enter? |
13:36:41 | enthus1ast | ok it does not work for me because it is executed from .pkg path :D |
13:36:59 | poopBot | hm am trying to stop using arrow but can try |
13:37:06 | narimiran | poopBot: and have you tried searching for "disable enter as tab completion"? |
13:37:28 | poopBot | yep right arrro works |
13:37:50 | poopBot | didn not :) |
13:38:05 | * | Gertm joined #nim |
13:40:41 | * | theelous3 joined #nim |
13:42:06 | enthus1ast | ok thanks guys for your help! Soon i'll change it to requires as you've mentioned jrfondren, and i'll play with niminst Araq, but for now "before install" helps me |
13:43:29 | Araq | sure, np |
13:43:58 | * | livcd joined #nim |
13:48:04 | poopBot | narimiran, hmm i didnet find any anwer, is there any way i can just make it like if i duble enter it goes next row i can probbaly do it with that keybinds stuff if there is some way to detect first if autocomplet is open, so i do it like if autocompletopn, fast EnterEnter = <Esc> Enter |
13:48:15 | poopBot | or <Esc> I Enter |
13:48:40 | leorize[m] | how did you configure your nvim? |
13:49:22 | leorize[m] | also, you can record terminal sessions with asciinema |
13:51:18 | poopBot | https://hastebin.com/mohuwupoku.sql |
13:51:26 | poopBot | my conf |
13:56:31 | poopBot | and i just got stuck |
13:56:39 | poopBot | while autocomplet was opening |
13:57:36 | poopBot | https://pasteboard.co/IeYjwYj.png |
13:57:43 | poopBot | it now ignores all input |
13:58:31 | poopBot | lol it freezed for 20 sec and now its back and i done all jdkhasjkdhajs i typed while i was Wtfking |
13:58:47 | * | cyberjpn quit (Ping timeout: 246 seconds) |
13:58:58 | narimiran | poopBot: have in mind this is #nim, not #neovim ;) |
13:59:44 | narimiran | they might know better how to fix your enter problem |
14:07:53 | * | Gertm left #nim ("Leaving") |
14:08:12 | Zevv | /join #neonim |
14:09:15 | federico3 | huh? |
14:09:47 | FromDiscord | <Avatarfighter> Oofers so I couldn't figure out how to fix my issue where an emun with holes wasn't being considered an ordinal so I just manually made a case statement handling all my stuff, not as optimal as I would've liked it but w/e |
14:10:06 | Araq | use an enum without holes |
14:10:16 | FromDiscord | <Avatarfighter> lmao |
14:10:17 | Araq | will produce better code anyway |
14:11:05 | FromDiscord | <Avatarfighter> I shall note that down 😛 |
14:13:16 | * | krux02 quit (Remote host closed the connection) |
14:13:20 | * | Vladar quit (Remote host closed the connection) |
14:16:43 | poopBot | narimiran, no respone thare, tought 1 simple fast question, how do people move trough autocomplete if no key arrows? |
14:18:00 | FromDiscord | <Avatarfighter> Dang I would've liked an enum here bc it would've slightly more readable haha |
14:18:00 | FromDiscord | <Avatarfighter> https://cdn.discordapp.com/attachments/371759389889003532/578586952249376788/unknown.png |
14:18:27 | narimiran | poopBot: i use 'supertab' plugin, which allows me to use tab for moving through autocomplete, and i can freely use enter for going to a new line |
14:20:49 | * | Trustable joined #nim |
14:26:59 | livcd | i am so dumb with nim :/ |
14:27:11 | livcd | i do not know how to translate this in Nim and it's so simple https://glot.io/snippets/fc9r1hs0av |
14:27:13 | * | federico3 pats livcd |
14:28:30 | FromGitter | <mratsim> Are you trying to access an username that wasn't properly erased from memory? |
14:29:21 | FromGitter | <gogolxdong> Do you feel exception stacktrace loose some key frame? |
14:29:22 | FromGitter | <mratsim> the first 2 lines are let buffer = newSequint16 (256) |
14:29:39 | FromGitter | <mratsim> the first 2 lines are let buffer = newSeq\uint16\ (256) |
14:29:53 | FromGitter | <mratsim> @gogolxdong it's not feel, it's concrete truth |
14:30:23 | livcd | mratsim: just trying to use this https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getusernamew |
14:30:37 | FromGitter | <mratsim> the 3rd line is procGetuserName(buffer[0].addr, buffer.len) |
14:30:37 | FromGitter | <gogolxdong> a known issue? |
14:30:56 | FromGitter | <mratsim> I don't think anyone submitted a minimal example |
14:31:11 | FromGitter | <mratsim> When I minimize stuff the frames tends to be good again :/ |
14:31:22 | poopBot | narimiran, yey now i can enter ty :) |
14:32:09 | poopBot | tough i still feel 10 time slower then using vscode, i am mostly editing in insert mode that bad or what? |
14:33:24 | narimiran | poopBot: go through vimtutor and some other tutorials; buy 'practical vim' book; solve vimgolf challenges; practice on your own |
14:35:52 | livcd | mratsim: that does not work :/ GetUserNameW wants LPWSTR |
14:37:50 | FromGitter | <mratsim> You need to define LPWSTR somewhere: ⏎ ⏎ type LPWSTR {.importc, header:"<foo.h>".} = something |
14:38:32 | FromGitter | <mratsim> I suppose it's a cstring |
14:38:50 | FromGitter | <mratsim> or UncheckedArray[int16] |
14:39:36 | * | sz0 joined #nim |
14:40:19 | FromGitter | <mratsim> For reference, if you want to alloc raw buffer here is how to do it: https://github.com/numforge/laser/blob/master/laser/tensor/allocator.nim#L24 |
14:40:33 | FromGitter | <mratsim> type is here https://github.com/numforge/laser/blob/master/laser/tensor/datatypes.nim#L26 |
14:40:55 | FromGitter | <mratsim> You can use alloc, alloc0, allocShared, allocShared0 |
14:41:06 | FromGitter | <mratsim> The 0 variant of for initialization with 0 |
14:41:31 | FromGitter | <mratsim> don't forget the +1 to size for the \0 byte |
14:45:10 | poopBot | hmm how do i make object have a tuple |
14:45:12 | poopBot | type |
14:45:12 | poopBot | PokerTable = object |
14:45:12 | poopBot | deck52:seq[Card] |
14:45:12 | poopBot | on_t:seq[Card] |
14:45:12 | poopBot | blinds:[int,int] |
14:45:27 | poopBot | blinds ^^ that wont work |
14:45:46 | narimiran | blinds: tuple[a, b: int] |
14:46:03 | * | laaron quit (Remote host closed the connection) |
14:46:07 | poopBot | ty i tryed tuple[int,int] but now i get why it ident wokr too :) |
14:47:11 | narimiran | you can also do `blinds: (int, int)` if you want anonymous tuple |
14:47:54 | * | rnrwashere joined #nim |
14:48:18 | narimiran | (..., ...) syntax is like an "international sign for tuples" :P i havent seen [..., ...] used for it never (but maybe i haven't looked hard enough) |
14:48:54 | * | jxy quit (Quit: leaving) |
14:49:46 | * | laaron joined #nim |
14:49:51 | * | JustASlacker joined #nim |
14:50:23 | * | rnrwashere quit (Remote host closed the connection) |
14:50:38 | * | rnrwashere joined #nim |
14:50:42 | poopBot | newb power forewer :) |
14:54:54 | * | laaron quit (Remote host closed the connection) |
15:00:04 | livcd | mratsim: thanks. I am using winim for this but i am a retard when it comes to those types / casting and passing..... |
15:04:23 | * | jxy joined #nim |
15:06:03 | * | rnrwashere quit (Remote host closed the connection) |
15:06:37 | * | rnrwashere joined #nim |
15:06:47 | shashlick | winim is broken on devel |
15:08:15 | * | enthus1ast quit (Ping timeout: 256 seconds) |
15:08:39 | livcd | oh |
15:08:42 | livcd | but i did not update |
15:09:00 | livcd | so i have something like this and this gives me 4 characters of the username :D https://glot.io/snippets/fc9s6hhgk0 |
15:11:06 | * | rnrwashere quit (Ping timeout: 252 seconds) |
15:11:44 | * | laaron joined #nim |
15:12:09 | shashlick | Try ascii call |
15:17:15 | * | couven92 joined #nim |
15:19:30 | * | fredrik92 joined #nim |
15:20:16 | livcd | hmm that works |
15:20:22 | livcd | but i do not know what I am doing :D |
15:21:03 | * | rayman22201 joined #nim |
15:21:28 | * | natrys joined #nim |
15:22:20 | * | fredrik92 quit (Client Quit) |
15:25:38 | * | leorize joined #nim |
15:31:49 | shashlick | Haven't yet figured out how to convert to Nim string |
15:41:33 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:41:55 | * | laaron joined #nim |
15:49:08 | * | enthus1ast joined #nim |
15:53:17 | * | sacredfrog quit (Ping timeout: 258 seconds) |
16:00:13 | * | sacredfrog joined #nim |
16:03:42 | * | JustASlacker quit (Ping timeout: 258 seconds) |
16:11:36 | * | ng0 joined #nim |
16:20:03 | leorize | WString is a wide string I think, then it'd need to be converted to seq[Rune] before turning into `string` |
16:20:58 | * | rnrwashere joined #nim |
16:25:51 | * | rnrwashere quit (Ping timeout: 264 seconds) |
16:36:28 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
16:36:39 | * | enthus1ast quit (Ping timeout: 256 seconds) |
16:38:39 | couven92 | Do we have something that does fuzzy string matching? |
16:39:11 | couven92 | I am thinking on how to do it, and realizing that it is a fairly complicated problem... :O |
16:39:59 | shashlick | use fts_fuzzy_match - works nicely for me in feud - https://github.com/genotrance/feud/blob/master/wrappers/fuzzy.nim |
16:40:35 | shashlick | here's how i use it - https://github.com/genotrance/feud/blob/master/plugins/server/file.nim#L86 |
16:42:30 | * | laaron quit (Remote host closed the connection) |
16:42:30 | couven92 | shashlick, huh... that's a lot of C++ :O, thanks... I'll look into it |
16:44:25 | narimiran | couven92: we do, our search in the documentation :) |
16:44:57 | * | laaron joined #nim |
16:45:06 | couven92 | narimiran, do we use the same as shashlick suggested? |
16:45:55 | narimiran | couven92: see tools/dochack/fuzzysearch.nim |
16:47:48 | couven92 | Hmmm... nice! Now I get to port it to C#, yaih! Sry, writing C# right now, but I actually use stuff from Nim to make it great! :D |
16:48:19 | couven92 | Learned a few tricks when dealing with strings when I did some of the Unicode stuff in stdlib... |
16:49:15 | couven92 | Like, linear-overhead Levenshtein |
16:59:11 | * | nsf joined #nim |
17:03:15 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:03:59 | * | laaron joined #nim |
17:07:54 | * | floppydh quit (Quit: WeeChat 2.4) |
17:11:42 | * | laaron quit (Remote host closed the connection) |
17:15:11 | * | laaron joined #nim |
17:28:11 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:28:34 | * | laaron joined #nim |
17:29:56 | * | rnrwashere joined #nim |
17:31:10 | * | theelous3 quit (Ping timeout: 252 seconds) |
17:32:19 | * | stefanos82 joined #nim |
17:33:03 | * | rnrwashere quit (Remote host closed the connection) |
17:35:42 | * | rnrwashere joined #nim |
17:38:59 | * | theelous3 joined #nim |
17:41:05 | * | rnrwashere quit (Remote host closed the connection) |
17:44:27 | * | sacredfrog quit (Ping timeout: 258 seconds) |
17:56:53 | * | Trustable quit (Remote host closed the connection) |
17:57:14 | * | neceve quit (Remote host closed the connection) |
18:04:05 | * | solitudesf joined #nim |
18:05:44 | poopBot | leorize, hmm should this nim plugin for neovim show me erros like vscode |
18:06:30 | poopBot | do i need to install some plugin for that too |
18:06:59 | poopBot | cuz atm i can wirte any garbage stuff and it dosent mark any error or anything |
18:07:32 | shashlick | Perhaps use ale |
18:14:26 | * | nsf quit (Quit: WeeChat 2.4) |
18:17:39 | * | hoijui joined #nim |
18:20:21 | * | rnrwashere joined #nim |
18:23:52 | leorize | poopBot: yea, you'd need some plugin for that |
18:24:32 | leorize | nimsuggest would provide a bit of this info as part of the highlighting (red background/white text/depends on your colorscheme) |
18:25:21 | leorize | so far there's ALE and neomake. I don't know much about this field because I never use this function |
18:25:52 | * | xet7 quit (Quit: Leaving) |
18:26:01 | * | sacredfrog joined #nim |
18:33:25 | * | rnrwashere quit (Remote host closed the connection) |
18:45:06 | * | rnrwashere joined #nim |
18:49:05 | * | rnrwashere quit (Remote host closed the connection) |
18:50:13 | * | rnrwashere joined #nim |
18:50:25 | * | rnrwashere quit (Remote host closed the connection) |
18:51:00 | * | rnrwashere joined #nim |
18:52:16 | * | rnrwashere quit (Remote host closed the connection) |
18:52:32 | * | rnrwashere joined #nim |
18:59:10 | * | rnrwashere quit (Remote host closed the connection) |
19:07:36 | * | xet7 joined #nim |
19:07:56 | * | PrimHelios quit (Quit: ZNC - https://znc.in) |
19:08:12 | * | PrimHelios joined #nim |
19:10:38 | * | rnrwashere joined #nim |
19:11:44 | * | rnrwashere quit (Remote host closed the connection) |
19:13:36 | * | rnrwashere joined #nim |
19:15:14 | * | jjido joined #nim |
19:16:48 | * | rnrwashere quit (Remote host closed the connection) |
19:19:25 | * | jjido quit (Client Quit) |
19:28:05 | * | rnrwashere joined #nim |
19:28:14 | * | rnrwashere quit (Remote host closed the connection) |
19:28:34 | * | rnrwashere joined #nim |
19:28:52 | * | jjido joined #nim |
19:32:03 | * | sacredfrog quit (Ping timeout: 268 seconds) |
19:39:52 | poopBot | how to clear list before refill :) |
19:39:56 | poopBot | seq |
19:40:54 | narimiran | why does it have to be "clear"? |
19:40:58 | rayman22201 | This is probably an Araq or a Krux02 question, is there a way to demangle nim function names from C / asm? I'm working on Godbolt support for Nim... |
19:41:27 | poopBot | PokerTable = object |
19:41:28 | poopBot | 25 deck52:seq[Card] |
19:41:28 | poopBot | |
19:41:49 | narimiran | poopBot: do not paste multiple lines here. use some pasting service |
19:42:02 | rayman22201 | @leorize, `passC:-g` worked btw |
19:42:31 | poopBot | sorry i frogot this no discord cant redit xD, hmm when i create an object like this is deck 52 done as let or var or do i need to manly specify for each? |
19:44:48 | narimiran | can you change it? (this is a question that you should ask yourself) yes you can. (this is the answer you need to test by yourself) it is a var. (this is the conclusion that you would come up with) |
19:45:14 | rayman22201 | also, philosophical question, should I hide nim runtime functions in Godbolt, or leave them shown? I.E. initStackBottomWith, PreMain, etc... |
19:46:10 | narimiran | rayman22201: it's great to hear that somebody is working on godbolt support!! bravo! |
19:46:13 | * | xace quit (Remote host closed the connection) |
19:46:13 | FromGitter | <jrfondren> showing's better. it's a compiler explorer after all. you want to see what's going on. that said, I don't know how it looks with all that. |
19:46:56 | rayman22201 | @narimiran :-) It's a project I have been thinking about for a while. I decided to just say screw it and dive in. |
19:47:05 | poopBot | 'pt.deck52' cannot be assigned to |
19:47:22 | poopBot | i tryed deck52= newSeq(Card) |
19:47:30 | rayman22201 | @jrfonden, I'm inclined to agree with you, but I wanted to get some other opinions |
19:47:32 | FromGitter | <jrfondren> poopBot, so you probably want a var then |
19:48:04 | poopBot | thats why i asked when i make objects is it let or var by default |
19:48:07 | * | xace joined #nim |
19:48:19 | FromGitter | <jrfondren> there's no default. they mean different things |
19:48:56 | poopBot | when i create |
19:48:58 | poopBot | type |
19:49:05 | narimiran | poopBot: here is my test, it works: http://ix.io/1Jf2 |
19:49:07 | poopBot | Person = object |
19:50:15 | rayman22201 | I'm very sad because I think I'm going to have to make a new nim syntax highlighting config file for godbolt... Godbolt uses monaco, which is what vscode uses, and yet the syntax format is completely different (┛ಠ_ಠ)┛彡┻━┻ |
19:50:22 | poopBot | proc fill_deck(pt:PokerTable)= << hmm i am using it in proc meybe thats why is coplaing |
19:50:40 | poopBot | do i need to do proc fill_duck(var pt:PokerTable) ? |
19:50:50 | FromGitter | <jrfondren> not as a rule |
19:50:56 | FromGitter | <jrfondren> it depends on how you're using the arg |
19:51:02 | FromGitter | <jrfondren> but yeah with that name, probably |
19:51:37 | poopBot | i wanted to just pass it as reference |
19:51:45 | narimiran | poopBot: yes, use `var` there |
19:52:04 | FromGitter | <jrfondren> if you just want to pass it as reference, change the type to ref object |
19:52:30 | * | Jesin quit (Quit: Leaving) |
19:53:01 | narimiran | poopBot: updated example: http://ix.io/1Jf4 |
19:53:36 | narimiran | but i feel like all these questions could be answered (faster) if you just experimented and tried stuff on your own |
19:53:57 | poopBot | hmm i want to have a Poker Table object that will be a var, but i want to have proc that effects that object so i just need to pass ref of it rihg |
19:54:10 | narimiran | poopBot: yes, use `var` there |
19:56:33 | * | sacredfrog joined #nim |
20:01:18 | * | sacredfrog quit (Ping timeout: 258 seconds) |
20:01:50 | poopBot | ty it worked, where can i read about seq functions, i am trying to empty/clear it |
20:02:17 | narimiran | poopBot: but why you need to clear it before filling it up again? |
20:02:53 | narimiran | look at my example posted above, i didn't clear `x.b` seq before calling `fill` |
20:02:54 | poopBot | cuz each round i dont collect old cards for players i just drop them create new deck and remix |
20:03:12 | poopBot | or at least that was the plan :) |
20:04:07 | poopBot | tough i can probbaly do it other whey do buy just assinging card form deck to player whiout really removing it form deck |
20:04:08 | narimiran | you can use `setLen` if you want to start from an empty seq: http://nim-lang.github.io/Nim/system.html#setLen%2Cseq[T][T]%2CNatural |
20:04:25 | poopBot | but i thinked its easy operation so nothing to lose |
20:04:41 | * | rnrwashere quit (Remote host closed the connection) |
20:08:10 | FromDiscord | <exelotl> wow the View type in https://github.com/zielmicha/collections.nim is really good. Basically essentially when you want to interpret some bytes as an array of some type without performing a copy |
20:08:12 | * | nsf joined #nim |
20:08:18 | FromDiscord | <exelotl> *essential |
20:09:20 | * | rnrwashere joined #nim |
20:10:09 | * | Jesin joined #nim |
20:13:11 | * | narimiran quit (Ping timeout: 258 seconds) |
20:23:29 | clyybber | good night |
20:23:31 | * | clyybber quit (Quit: WeeChat 2.4) |
20:24:09 | Zevv | what the blip is <//> ?! |
20:24:29 | FromGitter | <jrfondren> @Zevv that's 'owned' |
20:24:40 | Zevv | wow |
20:25:26 | Zevv | why not use something more obvious, like, ehm, "owned"? |
20:26:56 | FromGitter | <jrfondren> something about 0.19 compatibility. |
20:27:11 | * | rnrwashere quit (Remote host closed the connection) |
20:27:20 | FromGitter | <jrfondren> I don't believe it's going to be the syntax you use normally. "it's allowed to be ugly" was part of the selection criteria |
20:27:34 | leorize | Araq said it's temporary |
20:27:38 | * | rnrwashere joined #nim |
20:29:27 | Zevv | ah ok, that makes sense :) |
20:29:57 | Zevv | I was curious how linked lists would be solved in the new runtime, that's where I ran into this |
20:32:52 | Zevv | but it seems that the details are not yet in place |
20:34:03 | leorize | yea, see https://github.com/nim-lang/Nim/issues/11217 |
20:35:27 | Zevv | ah yes, thanks |
20:36:07 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:39:41 | * | sacredfrog joined #nim |
20:41:20 | poopBot | hmm is there any inbuild or modul to shuffle/randomize a seq? |
20:41:44 | Zevv | I still miss some pieces of the puzzle - how will this work? appending an item to a doubly linked list, the new item will be owned by the next pointer of the tail, and will overwrite the tail of te list itself. The new item passed to the append() proc needs to be owned, but how do you reference an owned type in an 'unowned' way? |
20:43:17 | Zevv | and how does append() indicate to the caller that the object passed is now owned by the list? |
20:44:00 | * | sacredfrog quit (Client Quit) |
20:46:27 | * | rnrwashere quit (Remote host closed the connection) |
20:48:50 | * | rnrwashere joined #nim |
20:49:03 | * | rnrwashere quit (Remote host closed the connection) |
20:50:01 | * | rnrwashere joined #nim |
20:52:39 | * | rnrwashere quit (Remote host closed the connection) |
20:54:22 | rayman22201 | There was a long discussion about this on the original RFC thread, but I can't find it now. Did the RFC repo go away? |
20:55:12 | rayman22201 | append() has to takes ownership of the object basically |
20:55:30 | * | natrys quit (Quit: natrys) |
20:59:03 | poopBot | so to randomize list i should write some custom coperator in sort? |
20:59:52 | FromGitter | <jrfondren> there's a random.shuffle |
21:00:14 | rayman22201 | found it: https://github.com/nim-lang/RFCs/issues/144#issuecomment-478721735 |
21:00:20 | rayman22201 | @zevv |
21:01:18 | * | nsf quit (Quit: WeeChat 2.4) |
21:01:55 | poopBot | oh there is shuffle in random, lol waht a waste of time |
21:08:08 | * | rnrwashere joined #nim |
21:11:32 | * | hoijui quit (Ping timeout: 252 seconds) |
21:12:38 | * | rnrwashere quit (Remote host closed the connection) |
21:13:00 | * | hoijui joined #nim |
21:19:16 | * | lritter quit (Quit: Leaving) |
21:26:15 | poopBot | narimiran[m], how to fold back unfolded? |
21:26:27 | poopBot | i asked on nevim but still no reply :( |
21:29:32 | poopBot | does nim have like python take [:3] |
21:31:34 | FromGitter | <jrfondren> !eval echo "hello"[0..2] |
21:31:35 | NimBot | hel |
21:31:55 | poopBot | that can wokr too :) |
21:37:39 | * | rnrwashere joined #nim |
21:43:39 | * | solitudesf quit (Ping timeout: 258 seconds) |
21:53:14 | * | FromGitter quit (Remote host closed the connection) |
21:53:14 | * | oprypin quit (Quit: Bye) |
21:53:30 | * | oprypin joined #nim |
21:53:41 | * | FromGitter joined #nim |
22:03:24 | * | oprypin quit (Quit: Bye) |
22:03:31 | * | oprypin joined #nim |
22:03:35 | * | rnrwashere quit (Remote host closed the connection) |
22:10:57 | * | hoijui quit (Ping timeout: 250 seconds) |
22:13:39 | poopBot | https://pasteboard.co/If1z4Lg.png |
22:13:44 | poopBot | why i cant assing? |
22:19:35 | FromGitter | <jrfondren> I don't see a screenshot there. |
22:22:33 | poopBot | what |
22:22:44 | poopBot | how i just opend it |
22:23:02 | poopBot | if scroll bot it says ps.card_1 cannot be assigned to |
22:33:18 | * | rnrwashere joined #nim |
22:36:25 | FromGitter | <jrfondren> alright, it's some anti-adblock stuff that makes the website lie about whether there's a screenshot available. |
22:37:54 | FromGitter | <jrfondren> if you use a code pastebin, like http://ix.io/ or https://gist.github.com/ , it'd be easier for me to copy&paste that and try it locally |
22:38:10 | FromGitter | <jrfondren> I don't see the problem there. |
22:38:18 | FromGitter | <jrfondren> try running 'nim check' against your file instead. |
22:38:33 | FromGitter | <jrfondren> or trying to compile it, rather than using those warnings. |
22:48:11 | * | cyberjpn joined #nim |
22:54:25 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:04:24 | * | smitop joined #nim |
23:05:14 | smitop | Is it possible to invoke the Nim compiler from within Nim (or during compiletime)? I want to have a server written in C that serves HTML+JS written in Nim |
23:06:20 | FromGitter | <jrfondren> there's hot code loading support in the compiler but I don't know how it's used. inim is a pre-compiler-support example. |
23:07:01 | * | rutenl joined #nim |
23:07:17 | rutenl | hello |
23:07:46 | rutenl | anyone know maximum recursion depth in nim? using -d:release |
23:08:36 | rutenl | my program gives no output with recursion depth above about 10000, 8000 and below works fine |
23:12:22 | FromGitter | <jrfondren> in principle that can't be a single number; it depends on how much of the stack you're consuming on each recursive call. |
23:14:20 | * | rnrwashere quit (Remote host closed the connection) |
23:15:39 | * | nif_ quit (Ping timeout: 248 seconds) |
23:15:48 | * | nif joined #nim |
23:16:06 | FromGitter | <jrfondren> without -d:release I get ... 126 recursive calls before stack overflow, on a function that takes no arguments. with -d:release, I get 262k recursive calls with the same code |
23:18:44 | FromGitter | <jrfondren> without tail tail optimization, avoid recursion :/ you can write iterative code and work with an explicit stack data structure, instead. |
23:21:03 | FromDiscord | <exelotl> holy shit concepts are cool |
23:21:48 | * | rnrwashere joined #nim |
23:22:39 | rutenl | thanks for the replies, the release flag makes the compiler use tail call optimisation though right? |
23:23:24 | rutenl | i'm just messing around a bit implementing the game of nim in nim |
23:24:30 | FromGitter | <jrfondren> rutenl, a proc that just increments a global variable and calls itself until that variable exceeds 100mil can't run to completion on -d:release, so I reckon TCO doesn't happen in general. |
23:25:51 | FromGitter | <jrfondren> ... TCO *does* happen for funcs though |
23:26:07 | FromGitter | <jrfondren> so you need {.noSideEffect.} for it |
23:26:14 | rutenl | hmm yea, this case it's minimax, where the recursion is guaranteed to end, but I don';t know if the compiler can be expected to know that |
23:26:31 | rutenl | and it does have a side effect for now as it uses a transposition table (cache) |
23:26:49 | FromGitter | <jrfondren> if you use `func` instead of `proc` you'll get TCO. it might work to pass that table around as a parameter |
23:27:09 | rutenl | i'll try that |
23:27:12 | FromGitter | <jrfondren> in devel you can use {.noSideEffect.}: blocks |
23:27:42 | FromGitter | <jrfondren> so in a func body, {.noSideEffect.}: blatantlyModifyGlobalTranspositionTable() |
23:28:19 | FromGitter | <jrfondren> unrelatedly, I'd appreciate it if anyone has a better way to do this: https://gist.github.com/jrfondren/e9d60761ce727acabc6256ebd22e6115 |
23:30:08 | FromGitter | <jrfondren> it's not just needing 8 variations of the query, it's also needing to give it different arguments depending on the query. |
23:34:06 | shashlick | smitop: you can use staticExec |
23:36:23 | * | couven92 quit (Quit: Client Disconnecting) |
23:38:01 | * | sacredfrog joined #nim |
23:41:49 | FromGitter | <jrfondren> for a start a varargs template works well here... |
23:46:50 | rutenl | if i have a table Table[(int, int), (int, int)] i should be able to do table[(intA, intB)] = (intC, intD) right? |
23:47:12 | rutenl | it's giving me a type mismatch |
23:48:12 | * | rnrwashere quit (Remote host closed the connection) |
23:49:23 | rutenl | https://gist.github.com/RuurdBijlsma/e81c2a4be85ba4d441f0e98432169ca6 is the code if anyone would like to help, at line 30 nim gives me a type mismatch I can't figure out |
23:58:23 | FromGitter | <jrfondren> @rutenl, add a 'var' before the Table parameter in negaMax() |
23:59:29 | FromGitter | <jrfondren> `Error: type mismatch: got <Table[tuple of (int, int), tuple of (int, int)], tuple of (int, int), tuple of (int, int)>` ⏎ `proc `[]=`A, B (t: var Table[A, B]; key: A; val: B)` |
23:59:53 | FromGitter | <jrfondren> parameters are immutable, see. |