00:05:24 | * | arkurious quit (Quit: Leaving) |
01:11:30 | FromDiscord | <impbox [ftsf]> I'm pretty sure there's a way to do it but I can't find the syntax for a for loop that's expanded at compile time |
01:12:26 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3yNJ |
01:19:49 | * | Pyautogui joined #nim |
01:26:52 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
01:30:07 | * | crem quit (Ping timeout: 240 seconds) |
01:30:13 | * | neurocyte0 joined #nim |
01:30:13 | * | neurocyte0 quit (Changing host) |
01:30:13 | * | neurocyte0 joined #nim |
01:30:46 | * | Gustavo6046 joined #nim |
01:32:10 | * | crem joined #nim |
01:32:35 | * | neurocyte quit (Ping timeout: 268 seconds) |
01:32:35 | * | neurocyte0 is now known as neurocyte |
01:39:28 | * | Pyautogui quit (Ping timeout: 252 seconds) |
01:40:44 | * | pch quit (Remote host closed the connection) |
02:01:01 | * | pch joined #nim |
02:11:41 | * | rockcavera quit (Remote host closed the connection) |
02:16:22 | * | pch quit (Ping timeout: 268 seconds) |
02:20:56 | * | pch joined #nim |
03:11:59 | FromDiscord | <leorize> tag your proc with compileTime |
03:12:10 | FromDiscord | <leorize> or are you looking for loop unrolling? |
03:13:04 | FromDiscord | <impbox [ftsf]> loop unrolling since N is known at compile time as it's a generic param |
03:14:17 | FromDiscord | <leorize> pray really hard that the compiler will do it for you, or ask in #science |
03:14:44 | FromDiscord | <leorize> I'm pretty sure mratsim made an unroller, couldn't find it though |
03:15:07 | FromDiscord | <Elegantbeef> https://github.com/schneiderfelipe/unrolled archived but yea |
03:15:09 | nrds | <R2D299> itHub: 7"🧻 Unroll for-loops at compile-time." |
03:18:55 | FromDiscord | <impbox [ftsf]> oh ok, i thought it was a built-in nim feature i couldn't find |
03:19:11 | FromDiscord | <leorize> i think it was removed because it wasn't implemented |
03:19:21 | FromDiscord | <impbox [ftsf]> but yeah maybe compiler will do it for me anyway |
04:00:45 | FromDiscord | <xflywind> see also https://github.com/nim-lang/Nim/pull/18038/files |
04:02:02 | FromDiscord | <xflywind> https://github.com/mratsim/constantine/blob/c2d716b0/helpers/static_for.nim |
04:05:57 | FromDiscord | <impbox [ftsf]> Thanks |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
04:06:31 | * | supakeen joined #nim |
04:07:00 | FromDiscord | <xflywind> there is also a hole in Nim compiler, so you can also use #pragma directives. |
04:07:11 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3yOe |
04:08:21 | FromDiscord | <xflywind> generates |
04:08:29 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3yOf |
04:26:48 | Zevv | Varriount: yes, I know. but that's of course caused by the fact that npeg generates a 17k case statement full with stuff from your grammar |
04:26:56 | Zevv | it's something to chew on for the compiler |
04:27:12 | Zevv | you're boldly pushing npeg where noone has pushed it before |
04:27:25 | Zevv | I'd like to call it insanity, but hey, I'm not stopping you from testing my code, right |
05:03:38 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
05:04:04 | * | Gustavo6046 joined #nim |
05:19:50 | FromDiscord | <Varriount> Zevv: My end goal here is to create an actually usable SQL formatter. So far every formatter I've used has either had... highly questionable code quality, cost money, or been too buggy to use. |
05:20:06 | nrds | <Prestige99> impbox: Are you using sdl2_nim? Curious if we can easily target wasm |
05:20:10 | FromDiscord | <Varriount> (or been fairly inflexible, configuration-wise) |
05:20:52 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
05:21:05 | * | Gustavo6046 joined #nim |
05:21:27 | FromDiscord | <impbox [ftsf]> @prestige, yep |
05:21:31 | FromDiscord | <impbox [ftsf]> it works well |
05:21:36 | FromDiscord | <Varriount> In reply to @Zevv "<@169336940846514176>: yes, I know.": Bison (another parser generator for C) appears to generate jump tables. I'm guessing the compiler doesn't choke on that because it doesn't even attempt to optimize the jumps. What I'd like to know is what Clang is actually spending all its time doing. |
05:22:12 | * | max22- joined #nim |
05:22:27 | nrds | <Prestige99> impbox: How do you compile for that target? |
05:23:02 | FromDiscord | <impbox [ftsf]> emscripten |
05:23:14 | FromDiscord | <impbox [ftsf]> check out nico's exampleApp |
05:23:27 | nrds | <Prestige99> Thanks I'll take a look |
05:23:31 | FromDiscord | <impbox [ftsf]> https://github.com/ftsf/nico/tree/main/exampleApp |
05:23:46 | FromDiscord | <impbox [ftsf]> https://github.com/treeform/nim_emscripten_tutorial based off this |
05:23:48 | nrds | <R2D299> itHub: 7"Nim emscripten tutorial." |
05:23:58 | nrds | <Prestige99> Sweet :D |
05:24:42 | FromDiscord | <impbox [ftsf]> i just do `nimble webr` and it builds a wasm, js, data and html via empscripten |
05:34:10 | arfy | hi. is there plans for, or does an REPL for nim exist? |
05:34:19 | FromDiscord | <impbox [ftsf]> inim exists |
05:34:31 | FromDiscord | <Elegantbeef> `inim` and `nim secret` |
05:34:51 | FromDiscord | <impbox [ftsf]> whoa a secret repl |
05:35:05 | FromDiscord | <impbox [ftsf]> now i don't need to run a calculator |
05:35:08 | FromDiscord | <Elegantbeef> Well nimsecret is the VM iirc so it's not as feature filled |
05:35:21 | arfy | hahaha. i use python as a calculator all the time. :D |
05:48:45 | FromDiscord | <Varriount> Anyone know of a way to get an output of what the Nim compiler is allocating memory for? |
05:50:24 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
05:51:04 | arfy | excellent. inim installed. very cool |
05:56:16 | * | Gustavo6046 joined #nim |
06:00:17 | * | eph quit (Remote host closed the connection) |
06:02:56 | Zevv | Varriount: by "stack trace", do you mean a nim-level stack trace or a peg-level stack trace? |
06:03:37 | Zevv | i've been trying to propagate my original peg nimnode lineinfo through into the npeg IR and generated code, but stuff is buggy - I get nonsense output every now and then and I'm having troubles to isolate and minimize the problem |
06:04:06 | Zevv | for now I'm blaming myself, but i wouldn't be suprised if it's a nim bug |
06:04:22 | FromDiscord | <Varriount> Zevv: In the issue I just posted? Ideally both, but a peg-level stacktrace at minimum (the sequence representing the return stack). |
06:04:47 | Zevv | hmm that should be doable, I'll have to check if I have all the state present in the backframes |
06:05:19 | FromDiscord | <Varriount> Otherwise, you know that you have a recursive loop somewhere, but not where. |
06:05:27 | Zevv | true, that |
06:05:34 | Zevv | is the closure allocation really a problem for you? |
06:05:50 | Zevv | I did this on purpose for sake of code simplicity, but if it booms on you I might have to change that somehow |
06:07:45 | FromDiscord | <Varriount> Zevv: Yes. It causes the program to immediately crash half the time. I was able to fix it by making `doTrace` a procedure, and passing in all the state through parameters. |
06:08:23 | FromDiscord | <Varriount> Zevv: https://gist.github.com/Varriount/bc815b21ca6df742b19f22e8f8844b59 |
06:09:15 | FromDiscord | <Varriount> Feel free to clean it up. I'm just hacking onto things, trying to make the output C file palatable for Clang |
06:44:53 | Zevv | well, something like that might work just fine, this was not designed to scale up this far |
06:44:55 | * | PMunch joined #nim |
06:45:20 | Zevv | altough i am surprised by things crashing on a stack oveflow; this is 2021 |
06:45:25 | Zevv | what os are you runing on? |
07:00:58 | * | tdc joined #nim |
07:05:45 | FromDiscord | <gogolxdong (liuxiaodong)> How to solve `No 'Access-Control-Allow-Origin' header is present on the requested resource.` with jester? |
07:21:42 | FromDiscord | <gogolxdong (liuxiaodong)> sent a code paste, see https://play.nim-lang.org/#ix=3yOH |
07:21:52 | * | Vladar joined #nim |
07:29:21 | FromDiscord | <Varriount> In reply to @Zevv "what os are you": Windows. To be honest, it's only my guess that it's a stack overflow. All I know is that the changes I've made to NPeg appear to make the crash go away. |
07:35:51 | FromDiscord | <linux user> i found out that you cna only use 1 space for indentation :V |
07:36:17 | FromDiscord | <linux user> manual said it was 2 spaces minimum |
07:39:11 | FromDiscord | <Yardanico> In reply to @richard stallmen(crazy GNU guy) "manual said it was": it didn't |
07:39:15 | FromDiscord | <Yardanico> (edit) "didn't" => "doesn't" |
07:40:06 | FromDiscord | <Yardanico> manual has no mention of "2 spaces" at all, maybe you're referring to NEP-1 which is a code style you might or might not want to follow and not the language spec |
07:41:01 | Zevv | Varriount: why the sleep in the dotrace? :) |
07:42:29 | FromDiscord | <Varriount> In reply to @Zevv "<@169336940846514176>: why the sleep": Oh! Sorry about that. I was trying to debug an infinite loop |
07:42:59 | Zevv | haha, np |
07:45:37 | FromDiscord | <Varriount> In reply to @Zevv "haha, np": Looks like there might be some backend optimizations I can disable to prevent Clang from consuming all memory: https://stackoverflow.com/questions/59041227/any-tips-for-compiling-huge-code-generated-source-files |
07:46:21 | FromDiscord | <Varriount> Right now a -O2 build is taking 15 minutes and counting. |
07:46:22 | Zevv | well, i guess optimizing these things in npeg makes sense right, it'll likely reduce memory and improve speed in any case |
07:46:27 | Zevv | wait what |
07:46:34 | Zevv | that's horrific. why the hell are you doing this |
07:46:54 | FromDiscord | <Varriount> Do you have any alternative options? |
07:47:04 | Zevv | just write a parser by hand? |
07:47:11 | Zevv | top down, classical |
07:48:03 | FromDiscord | <linux user> oh sorry |
07:48:55 | FromDiscord | <Varriount> In reply to @Zevv "just write a parser": There's a reason PostgreSQL's grammar is generated via a parser generator. |
07:49:06 | Zevv | hmm. fair enough |
07:49:57 | Zevv | Varriount: master is updated, now uses a nimCall proc instead of a closure for trace |
07:50:04 | FromDiscord | <Varriount> It's definitely past the "too complex to write by hand without going insane" mark. |
07:50:35 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
07:51:25 | FromDiscord | <Varriount> I'll muddle along. Hopefully simplifying the grammar will help. |
07:53:41 | * | neurocyte joined #nim |
07:53:41 | * | neurocyte quit (Changing host) |
07:53:41 | * | neurocyte joined #nim |
07:53:56 | FromDiscord | <Varriount> In reply to @Zevv "<@169336940846514176>: master is updated,": Any idea if a table-based approach is comparable in runtime performance to a case-based approach? |
07:54:25 | Zevv | what goes in the the table then, functions? |
07:55:00 | Zevv | i haven't tried for a long time, but when developing this i looked at a number of different implementations and this one was about 1.5 times faster then second place |
07:55:14 | FromDiscord | <Varriount> I don't know yet. I'm still looking through Bison's output. |
07:55:18 | Zevv | the good thing about the computed goto is that the C compiler can optimize way deeper |
07:55:21 | Zevv | it throws away half of the states |
07:55:28 | Zevv | or the jumps, anyway |
07:55:53 | Zevv | in the olden days npeg did not compile to nim but simply had a VM running the IR |
07:56:25 | Zevv | instead of compiling every IR instruction into a nim snippet |
07:56:54 | FromDiscord | <Varriount> Hm, could you have a double-case statement, to expand the maximum number of states a computed goto could handle? |
07:57:08 | Zevv | probably |
07:57:27 | Zevv | but the non-goto case works well enough, albeit it has a somewhat lower performance |
07:57:42 | Zevv | nesting the gotos will require 2 jumps per instruction |
07:57:45 | * | arfy thinks he needs to learn more about compiler construction to answer this, but what's the process for getting nim onto a new system, if it's needed to compile itself? cross-compile from another system? |
07:58:02 | Zevv | arfy: typically you generate the C code somewhere |
07:58:05 | Zevv | and compile it on your target |
07:58:32 | Zevv | but cross compiling might work as well, if you have that all setup |
07:58:51 | FromDiscord | <Varriount> In reply to @arfy "thinks he needs to": You generally need a C compiler capable of generating executables for an architecture other than the one the compiler is running on. |
07:58:56 | arfy | ah yes, nim essentially transpiles to C. |
07:59:19 | FromDiscord | <Varriount> It's very handy like that. |
07:59:39 | FromDiscord | <Elegantbeef> Plus as it generates C you can always output C that fits a niche and it just works |
07:59:57 | arfy | C: the modern assembler. |
08:00:02 | FromDiscord | <Elegantbeef> It's how i've compiled Nim for the rpi-pico, emit C into the directory then call Cmake |
08:01:11 | * | arfy now giggles at the thought of... wait for it, nim for dos. |
08:01:17 | arfy | someone's probably done it. |
08:05:37 | PMunch | @arfy, Nim compiles to C, not transpiles. It drops a level of abstraction when it goes from Nim to C, in the same way that C drops a level of abstraction when it compiles to assembly |
08:07:15 | FromDiscord | <Elegantbeef> Pmunch on a battle he'll never win |
08:07:26 | * | PMunch picks up pitchfork |
08:11:38 | FromDiscord | <Yardanico> @arfy why giggle at dos? https://github.com/nim-lang/Nim/blob/devel/compiler/platform.nim#L42 |
08:11:43 | FromDiscord | <Yardanico> that said, I'm not sure it works with latest nim |
08:11:53 | FromDiscord | <impbox [ftsf]> what, no dos CI? |
08:12:04 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/compiler/options.nim#L587 |
08:26:23 | FromDiscord | <Varriount> Zevv: So, what it looks like Bison does (and this is just from skimming through the generated C code) is something similar to NPeg, except that it extracts the information that makes each state unique (token to match, next state, etc.) to global tables. The core "loop" consists of generic logic that looks up all the information about the current state, and then acts on it. |
08:26:23 | PMunch | Damn it, I've been trying to write this module without using macroutils. But now I need it and know I could've made some better patterns around the code.. |
08:27:53 | FromDiscord | <Varriount> Zevv: It looks like a shift-reduce parser (https://en.wikipedia.org/wiki/Shift-reduce_parser), based on the terminology used in the source code. (note, I don't actually understand what a shift-reduce parser is) |
08:32:49 | Zevv | Varriount: well, I don't understand any of this as well. I'm blisfully oblivious of all other parser types then peg and top-down-recursive |
08:56:06 | * | sagax quit (Read error: Connection reset by peer) |
08:56:43 | FromDiscord | <Varriount> Zevv: Well, I'm going to head off to bed. I really appreciate your help with this. |
09:18:36 | Zevv | nighty |
09:25:51 | * | hmmm joined #nim |
09:25:51 | Yardanico | @federico3 you around? Can you please resolve some of my doubts about licenses? So far I thought that LGPL-3 is not suitable for languages where all modules are compiled into a single binary since one of the points of LGPL is the ability to swap the library after compilation so there won't be any difference between GPL and LGPL, but you use LGPL in some of your Nim projects - so with e.g. https://github.com/FedericoCeratto/nim-httpauth my whole Nim |
09:25:51 | Yardanico | project has to be LGPL-3, right? |
09:26:18 | hmmm | hooooy |
09:26:28 | hmmm | long time no see folks nimions |
09:28:26 | FromDiscord | <Elegantbeef> Hello |
09:28:37 | Yardanico | *correction - I know that I don't need my whole project to be LGPL or GPL in this case, but it needs to have a GPL-compatible license and I still should ship the source with the binaries, right? |
09:29:50 | hmmm | beefy bro! what happened to this place we used to be so many |
09:33:23 | FromDiscord | <Elegantbeef> uhh people leave over time it seems |
09:33:35 | hmmm | those damn people |
09:33:44 | FromDiscord | <Elegantbeef> Though i think the discord server has had growth |
09:33:51 | hmmm | it's also irc that is now unmanagable, I'm downloading discord client rn |
09:33:52 | hmmm | yea |
09:34:08 | FromDiscord | <Yardanico> you can also use matrix |
09:34:15 | FromDiscord | <Yardanico> like beef does :) |
09:34:21 | hmmm | what's the handle of my boi xflywind I need to bother for my personal gain |
09:34:27 | FromDiscord | <Elegantbeef> Wait this is matrix, where's keanu?! |
09:34:29 | hmmm | [him] |
09:34:48 | FromDiscord | <cabboose> So… matrix resurrection |
09:35:12 | hmmm | yard I'm too low tech for matrix I think |
09:35:38 | hmmm | is my man disruptek still around? |
09:35:55 | FromDiscord | <Elegantbeef> Not here but in other places he is |
09:36:30 | FromDiscord | <cabboose> Like a bdsm ninja? |
09:36:43 | FromDiscord | <Elegantbeef> You'd know wouldnt you |
09:36:52 | FromDiscord | <cabboose> I learnt watching you |
09:38:38 | FromDiscord | <hmmm> jeez discord looks like it was made by a trippy 6 yo on pills |
09:39:46 | FromDiscord | <hmmm> I think @xflywind is a cute looking boi, also he might tell me why his xlxs lib hello world example complains about lacking zlib.h |
09:41:39 | FromDiscord | <Rika> The files likely use compression from zlib |
09:42:12 | FromDiscord | <hmmm> Rika! weren't you my bro from jp? |
09:42:30 | supakeen | xlsx is a zipfile with some xml in them ;) |
09:42:38 | FromDiscord | <hmmm> installing zlib on windows turned out to be a huge nightmare |
09:43:40 | FromDiscord | <hmmm> like: install 8gb o VisualStudio, then install CMake, then run this weird powershell script and it will still not work |
09:43:54 | FromDiscord | <Rika> In reply to @hmmm "Rika! weren't you my": My memory is exceptionally bad. I do not recall who you are |
09:44:08 | FromDiscord | <hmmm> Rika I might get hurt by this comment |
09:44:22 | FromDiscord | <hmmm> delete it since it's discord and they probably have the babby features |
09:44:29 | FromDiscord | <Rika> I understand. It has happened with multiple people before |
09:44:37 | FromDiscord | <hmmm> but I still love u |
09:44:44 | FromDiscord | <Rika> But I’m not in control of my memory |
09:44:57 | FromDiscord | <hmmm> if I choose a cute discord icon you might like me again |
09:45:01 | FromDiscord | <hmmm> or even remember about me |
09:45:32 | FromDiscord | <cabboose> This sounds like a priest at a school joke gone wrong |
09:45:34 | FromDiscord | <Rika> I legitimately do not recall you |
09:46:29 | FromDiscord | <Rika> In reply to @hmmm "like: install 8gb o": Nim does not use mvsc, so you will need to install it for the compiler it does use |
09:46:34 | FromDiscord | <Rika> Which I have forgotten as well |
09:46:47 | FromDiscord | <hmmm> hmmm |
09:46:49 | * | arkurious joined #nim |
09:46:54 | FromDiscord | <Rika> In reply to @Rika "Nim does not use": Does not use mvsc by default |
09:46:56 | FromDiscord | <Rika> In reply to @hmmm "hmmm": Ah |
09:46:59 | FromDiscord | <Rika> You’re that guy |
09:47:10 | FromDiscord | <hmmm> 😄 |
09:47:14 | FromDiscord | <Rika> You’re /hm+/ |
09:47:35 | FromDiscord | <hmmm> ❤️ |
09:47:35 | FromDiscord | <Rika> The man with ever changing m counts |
09:47:59 | FromDiscord | <hmmm> you see Rika that you couldn't forget me even with your memory |
09:48:07 | FromDiscord | <Rika> It takes a while |
09:53:32 | * | hmmm quit (Quit: WeeChat 3.2) |
09:54:33 | FromDiscord | <PsychoClay> anyone have some threading code i can look at? |
09:55:08 | FromDiscord | <cabboose> Theres some in the manual/gc/threads section I tink |
09:55:29 | FromDiscord | <PsychoClay> yea but i need some more |
09:55:41 | FromDiscord | <cabboose> MOAR |
09:56:03 | FromDiscord | <Rika> What in particular is stumping you? |
09:56:10 | FromDiscord | <cabboose> What trouble do you have with threading |
09:56:21 | FromDiscord | <PsychoClay> everything just segfaults :Sadge: |
09:56:54 | FromDiscord | <cabboose> Do you have some example code? |
09:57:17 | FromDiscord | <Rika> I am betting that you are passing a reference around |
09:57:21 | FromDiscord | <PsychoClay> well its kind of hard to show because it involved multiple files and templates |
09:57:27 | FromDiscord | <Rika> Or a wrongly allocated pointer |
09:57:29 | FromDiscord | <PsychoClay> (edit) "involved" => "involves" |
09:57:41 | FromDiscord | <hmmm> icon test |
09:57:49 | FromDiscord | <cabboose> are you using refc or arc/orc |
09:57:51 | FromDiscord | <hmmm> perfect |
09:57:51 | FromDiscord | <cabboose> but as rika says |
09:57:53 | FromDiscord | <Rika> Oh wow you actually took what I wrote |
09:57:54 | FromDiscord | <PsychoClay> orc |
09:58:11 | FromDiscord | <Rika> Okay it’s a bit harder to wrongly allocate on orc so |
09:58:24 | FromDiscord | <Rika> Now it’s odd that you’re getting issues |
09:58:33 | FromDiscord | <Rika> Do you not have code even if it is long |
09:58:36 | FromDiscord | <cabboose> Are you dealing with IO? |
09:58:37 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3yPf |
09:59:07 | FromDiscord | <cabboose> I dont know what I’m looking at; I defer to master rika |
09:59:38 | FromDiscord | <PsychoClay> i think im trying to copy a Table |
10:00:31 | FromDiscord | <Rika> In reply to @cabboose "I dont know what": I could understand it but I am not really in the mood to read such a long stack trace |
10:00:44 | FromDiscord | <cabboose> It also looks like theres some IO in there |
10:01:01 | FromDiscord | <cabboose> are you doing async naughty things? |
10:01:03 | FromDiscord | <Rika> It says thread local storage there so are you sure you’re using orc? |
10:01:12 | FromDiscord | <PsychoClay> ye |
10:01:14 | FromDiscord | <Rika> Or maybe orc still has thread local heap |
10:01:20 | FromDiscord | <Rika> Are you using ref or pointer |
10:01:28 | FromDiscord | <PsychoClay> just object |
10:01:36 | FromDiscord | <Rika> How do you initialise the table |
10:01:41 | FromDiscord | <Rika> With new or init |
10:01:44 | FromDiscord | <PsychoClay> initTable |
10:01:58 | FromDiscord | <PsychoClay> i was using ref but that gave me other issues |
10:02:00 | FromDiscord | <Rika> How is it passed to the thread |
10:02:34 | FromDiscord | <PsychoClay> its the ArgStore |
10:02:37 | FromDiscord | <cabboose> There shouldn’t be that much issues using thread on ORC |
10:02:40 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3yPk |
10:02:45 | FromDiscord | <Rika> How are you allocating these pointers |
10:02:46 | FromDiscord | <cabboose> o yummy pres |
10:02:50 | FromDiscord | <cabboose> ptrs |
10:03:05 | FromDiscord | <PsychoClay> allocShared0 |
10:03:39 | FromDiscord | <Rika> I assume all of these pointers are allocated with that |
10:03:43 | FromDiscord | <PsychoClay> ye |
10:03:57 | FromDiscord | <Rika> Definitely strange |
10:04:20 | FromDiscord | <cabboose> well if you don’t initialise the objects correctly after using allocShared0 won’t it be nil? |
10:04:26 | FromDiscord | <Rika> Uh? |
10:04:31 | FromDiscord | <Rika> Objects are never nil |
10:04:36 | FromDiscord | <Rika> Ah |
10:04:41 | FromDiscord | <Rika> Wait no |
10:04:49 | FromDiscord | <Rika> Objects are never nil indeed |
10:05:02 | FromDiscord | <Rika> After calling allocation you have a zeroed object |
10:05:13 | FromDiscord | <cabboose> I thought thats createShared |
10:05:14 | FromDiscord | <Rika> It should be fine once you []= |
10:06:00 | FromDiscord | <PsychoClay> but dont u guys have some example code somewhere |
10:06:09 | FromDiscord | <cabboose> I’m probably wrong but I thought you just give allocShared0 a size while createShared gets a type |
10:06:27 | FromDiscord | <cabboose> so I thought only createShared actually knows what to do with it in terms of object in it |
10:06:51 | FromDiscord | <Rika> Create shared is basically just alloc shared with size of type as the argument |
10:06:54 | FromDiscord | <Rika> I believe |
10:07:15 | FromDiscord | <cabboose> But why use pointers when you’re using orc \:’) |
10:07:25 | FromDiscord | <PsychoClay> dude i have no idea what im doing |
10:07:42 | FromDiscord | <Rika> Is there a reason you use threading |
10:07:52 | FromDiscord | <PsychoClay> fast |
10:07:58 | FromDiscord | <Rika> Not necessarily |
10:08:00 | FromDiscord | <cabboose> Fast to die |
10:08:04 | FromDiscord | <PsychoClay> async doesnt work fast |
10:08:07 | FromDiscord | <cabboose> 🤣 |
10:08:07 | FromDiscord | <PsychoClay> i tried |
10:08:07 | FromDiscord | <Rika> Fast to lose mind |
10:08:15 | FromDiscord | <Rika> You probably tried wrong then |
10:08:21 | FromDiscord | <PsychoClay> yea :Sadge: |
10:08:27 | FromDiscord | <Rika> Or you have some crazy performance goals |
10:08:27 | FromDiscord | <cabboose> Async can be pretty fast |
10:08:56 | FromDiscord | <PsychoClay> i wanted to try something like 10 threads each with 10 async workers |
10:08:59 | FromDiscord | <cabboose> It’s hard to give you example code because if you’re doing manual memory allocation it’s up to you to be safe about it |
10:09:08 | FromDiscord | <Rika> That sounds like a quick way to get rate limited |
10:09:20 | FromDiscord | <PsychoClay> nah its for a web crawler |
10:09:38 | FromDiscord | <Rika> That sounds like a quick way to get rate limited (1) |
10:09:40 | FromDiscord | <cabboose> have you tried using `MyType = ref object` instead of `MyType = ptr object` |
10:09:55 | FromDiscord | <Rika> He did as he said |
10:09:57 | FromDiscord | <PsychoClay> il try that |
10:10:01 | FromDiscord | <Rika> Oh? |
10:10:04 | FromDiscord | <Rika> You liar |
10:10:09 | FromDiscord | <PsychoClay> no i was talkin about the table |
10:10:14 | FromDiscord | <PsychoClay> no the udata object |
10:10:21 | FromDiscord | <PsychoClay> (edit) "no" => "not" |
10:10:22 | FromDiscord | <Rika> Rude |
10:10:26 | FromDiscord | <Rika> Smh |
10:10:32 | FromDiscord | <cabboose> Hahahaha fair |
10:10:45 | FromDiscord | <cabboose> If you don’t know what you’re doing with manual memory allocs just do ref pointers |
10:10:47 | FromDiscord | <PsychoClay> well i was using refc before thats why it was a ptr |
10:10:47 | FromDiscord | <cabboose> orc has a shared heap |
10:11:01 | FromDiscord | <cabboose> fair |
10:11:15 | FromDiscord | <PsychoClay> so if u use orc i dont have to use any pointers |
10:11:20 | FromDiscord | <PsychoClay> every thing can just be ref? |
10:11:25 | FromDiscord | <Rika> Supposedly |
10:11:28 | FromDiscord | <cabboose> Well in a way |
10:11:53 | FromDiscord | <Rika> I’ve had issues with putting locks in objects before so maybe that contributes to the issue but it doesn’t seem so |
10:12:19 | FromDiscord | <cabboose> For most use cases refs work good |
10:12:55 | FromDiscord | <PsychoClay> sent a long message, see http://ix.io/3yPo |
10:13:00 | FromDiscord | <cabboose> and I also found manual memory allocations had to be handled differently if they can also contain referenced objects in ORC compared to RefC |
10:13:47 | FromDiscord | <cabboose> I actually don’t know about channel |
10:13:49 | FromDiscord | <cabboose> I mean |
10:13:51 | FromDiscord | <cabboose> again |
10:13:53 | FromDiscord | <cabboose> you have a shared heap |
10:14:05 | FromDiscord | <PsychoClay> so? |
10:14:20 | FromDiscord | <cabboose> Why bother with channel |
10:14:36 | FromDiscord | <PsychoClay> how else do i pass msgs between threads? deque maybe |
10:14:41 | FromDiscord | <cabboose> That’s mostly for interthread communication in pre-orc world AFAIK |
10:14:50 | FromDiscord | <cabboose> yeah |
10:14:55 | FromDiscord | <PsychoClay> hmm ok |
10:15:09 | FromDiscord | <cabboose> Deque and locks will do swimmingly |
10:15:57 | FromDiscord | <cabboose> If you’re doing async and threading make sure your asyncs are poll’d only on the thread they were dispatched from |
10:16:09 | FromDiscord | <cabboose> else shit blows |
10:16:11 | FromDiscord | <PsychoClay> ofc |
10:17:09 | FromDiscord | <PsychoClay> should i lock when writing to int? |
10:17:10 | FromDiscord | <cabboose> I could show sample code of multi threading and CPS but that’s all i’ve got on a public repo |
10:17:28 | FromDiscord | <Rika> Personally I’d just recommend going with one or the other |
10:17:40 | FromDiscord | <Rika> In reply to @PsychoClay "should i lock when": Unless the operation explicitly says it is atomic, use the lock |
10:20:31 | FromDiscord | <cabboose> Or as I like to say, always lock and \\\\ |
10:25:06 | FromDiscord | <Rika> Sorry but this isn’t exactly on topic but seems extremely important to spread |
10:25:07 | FromDiscord | <Rika> https://twitter.com/peter_szilagyi/status/1437646118700175360?s=21 |
10:25:51 | FromDiscord | <Rika> “Between the 3 Sept and 10 Sept, secure env vars of all public @travisci repositories were injected into PR builds. Signing keys, access creds, API tokens. ↵↵Anyone could exfiltrate these and gain lateral movement into 1000s of orgs. “ |
10:26:50 | FromDiscord | <PsychoClay> who is travis :thonk3d: |
10:27:21 | FromDiscord | <Rika> Name of CI service |
10:28:30 | PMunch | Damn, that is baaaad |
10:29:16 | FromDiscord | <Rika> Yes it’s pretty bad, and that’s not the end of it |
10:29:39 | FromDiscord | <Rika> “Felix Lange found this on the 7th and we've notified @travisci within the hour. Their only response being "Oops, please rotate the keys", ignoring that all their infra was leaking.↵↵Not getting through, we've started reaching out to @github to have Travis blacklisted.” |
10:29:54 | FromDiscord | <Rika> “After 3 days of pressure from multiple projects, @travisci silently patched the issue on the 10th.↵↵No analysis, no security report, no post mortem, not warning any of their users that their secrets might have been stolen.” |
10:30:07 | FromDiscord | <Rika> “Finally after multiple ultimatums from multiple projects @travisci posted this lame ass post hidden deep where nobody will read it: travis-ci.community/t/security-bul… ↵↵Not even a single "thank you". Not acknowledgment of responsible disclosure. Not even admitting the gravity of it all.” |
10:30:25 | FromDiscord | <Rika> The link that I copied incorrectly |
10:30:27 | FromDiscord | <Rika> https://travis-ci.community/t/security-bulletin/12081 |
10:30:47 | PMunch | Yeah I saw that |
10:32:16 | NimEventer | New thread by Kiloneie: Looking for feedback on my latest video before it goes live: Nim for Beginners #26 Reference Objects, see https://forum.nim-lang.org/t/8425 |
10:32:26 | FromDiscord | <Rika> Secrets are not plaintext but nonetheless |
10:32:35 | FromDiscord | <Rika> It is not safe to keep them unchanged |
10:41:00 | FromDiscord | <enthus1ast> does one know if its possible in ormin to specify the result type in a select?↵I want to query the db like this\:↵`select checkruns(id, exitcode, output, startedat, stoppedat, !!"stoppedat::timestamp - startedat::timestamp")` |
10:41:31 | FromDiscord | <enthus1ast> but obviously it knows nothing about this calculated column |
10:49:16 | FromDiscord | <fwsgonzo> Hey all, is there a 128-bit integer type in Nim? |
10:49:40 | FromDiscord | <fwsgonzo> all C, C++ compilers of note support `uint128_t` and `int128_t` and I need it specifically for my project |
10:50:12 | FromDiscord | <Rika> There is none |
10:50:15 | FromDiscord | <Rika> You can make it so |
10:50:21 | FromDiscord | <Rika> With importc |
10:50:51 | FromDiscord | <Rika> But you will need to create the procedures (probably with importc as well) |
10:51:03 | FromDiscord | <xflywind> there is a rfc |
10:51:09 | FromDiscord | <xflywind> https://github.com/nim-lang/RFCs/issues/399 |
10:51:30 | FromDiscord | <xflywind> and a package |
10:51:32 | FromDiscord | <xflywind> https://github.com/rockcavera/nim-nint128 |
10:51:35 | nrds | <R2D299> itHub: 7"128-bit integers" |
10:52:00 | FromDiscord | <fwsgonzo> the problem for me is that while uint64 works most of the time, I am building an assembler for a 128-bit achitecture, so it's going to be a PITA without it |
10:52:15 | FromDiscord | <hmmm> xxxxxflywind my favourite boi |
10:52:34 | FromDiscord | <hmmm> what incantation I have to spend to install zlib on windows |
10:52:48 | FromDiscord | <Rika> The package does not use C’s 128-bit integers |
10:53:03 | FromDiscord | <enthus1ast> can you not just download the dll?↵(@hmmm) |
10:53:10 | FromDiscord | <enthus1ast> or the lib? |
10:53:31 | FromDiscord | <hmmm> I have no idea how to get the dll, the official site just spits the sources |
10:53:54 | FromDiscord | <fwsgonzo> In reply to @flywind "https://github.com/rockcavera/nim-nint128": That might be just what I needed 👍 |
10:53:54 | FromDiscord | <Rika> He needs the header |
10:53:56 | FromDiscord | <hmmm> I suspect zlib dudes hate windows |
10:53:57 | FromDiscord | <enthus1ast> https://github.com/kiyolee/zlib-win-build |
10:53:59 | nrds | <R2D299> itHub: 7"zlib Windows build with Visual Studio." |
10:54:30 | FromDiscord | <enthus1ast> i can remember that building it was quite a pain |
10:54:37 | FromDiscord | <enthus1ast> but with msys it was okisch |
10:54:59 | FromDiscord | <enthus1ast> building withouth msys on windows is always a pain ;D |
10:55:03 | FromDiscord | <enthus1ast> except nim |
10:56:02 | FromDiscord | <hmmm> hmm |
10:56:10 | FromDiscord | <hmmm> I should try msys |
10:56:46 | FromDiscord | <hmmm> the other github link has the very helpful "To build, simply open the required solution file, and you know how to use Visual Studio, right?" |
10:56:52 | FromDiscord | <hmmm> jeez |
10:57:01 | FromDiscord | <hmmm> who uses visual studio in this day and age ffs |
11:00:06 | PMunch | Hmm, this is annoying: http://ix.io/3yPx/nim, http://ix.io/3yPy/nim |
11:00:41 | PMunch | For some reason One, Two, and Three aren't declared as they would otherwise be when they are part of a generated symbol.. |
11:00:50 | FromDiscord | <hmmm> munchie you old fox |
11:01:07 | PMunch | Huh? |
11:01:26 | FromDiscord | <hmmm> jesus I stay away some months and everyone forgets about lowly me |
11:01:46 | PMunch | Haha, I haven't forgotten you |
11:01:50 | PMunch | Where did you go? |
11:01:53 | FromDiscord | <hmmm> ❤️ |
11:02:09 | FromDiscord | <Rika> In reply to @hmmm "jesus I stay away": I apologise |
11:03:01 | FromDiscord | <hmmm> I had some real life spells, frightening stuff being exposed to irl tbh, but now I'm back with my stupid nim questions |
11:03:15 | FromDiscord | <cabboose> @PsychoClay\: are you still having issues or all good |
11:03:37 | FromDiscord | <PsychoClay> im converting from ptr to ref |
11:03:58 | FromDiscord | <cabboose> You mad man; you were just choc full of ptrs werent you |
11:03:59 | FromDiscord | <PsychoClay> do have some weird deque issue where elemtns dont get removed |
11:04:22 | FromDiscord | <PsychoClay> In reply to @cabboose "You mad man; you": yea it was pretty bad |
11:04:24 | FromDiscord | <cabboose> That is... odd. |
11:04:38 | FromDiscord | <cabboose> Even with a lock? |
11:04:47 | FromDiscord | <PsychoClay> yea |
11:05:06 | FromDiscord | <PsychoClay> but only the first time each thread acceses the que |
11:05:42 | FromDiscord | <cabboose> I'd be interested to help but it's becoming more abstract without seeing the code |
11:05:59 | FromDiscord | <cabboose> And my code is all CPS so it's not very helpful to share unless you're interested in going down that rabbithole |
11:06:07 | FromDiscord | <cabboose> (worth it) |
11:06:46 | FromDiscord | <PsychoClay> heres the file if u want to take a look https://github.com/PsychoClay/aberrant/blob/master/src/scrapers/mcrawl.nim |
11:08:57 | FromDiscord | <cabboose> `# threading in nim is hell` |
11:08:58 | FromDiscord | <cabboose> woke |
11:09:15 | FromDiscord | <PsychoClay> i spent like a month trying to figure it out |
11:09:55 | FromDiscord | <cabboose> Your name is truly fitting for the sites you are scraping friend |
11:10:05 | FromDiscord | <PsychoClay> wha t?? |
11:10:12 | FromDiscord | <PsychoClay> im scraping all the sites |
11:10:23 | FromDiscord | <PsychoClay> downloading all the files |
11:10:42 | FromDiscord | <cabboose> maybe i just didn't read further pass the files called onlyfans.nim etc hahahaa |
11:10:48 | FromDiscord | <PsychoClay> lol |
11:11:10 | FromDiscord | <cabboose> I'll have a looksy |
11:12:40 | FromDiscord | <PsychoClay> i think maybe i was copying the que with `var targets = udata.targets` |
11:12:56 | FromDiscord | <fwsgonzo> how do i capture variables in an inline function like C++ lambdas? |
11:14:04 | FromDiscord | <Rika> In reply to @fwsgonzo "how do i capture": You should be able to, what error are you getting |
11:14:21 | FromDiscord | <fwsgonzo> does it work like in javascript where you "inherit" the larger scope? |
11:14:35 | FromDiscord | <Rika> What do you mean? |
11:14:39 | FromDiscord | <Rika> I am unfamiliar |
11:15:18 | FromDiscord | <fwsgonzo> well, in C++ I would do: `auto x = [captured_var] (int arg) { function; goes; here; }` |
11:15:34 | FromDiscord | <fwsgonzo> and then I can invoke it, `x(myint)` later. |
11:16:14 | FromDiscord | <fwsgonzo> in javascript you inherit the scope you are in when the function is created, so you can bring with you locals |
11:16:40 | FromDiscord | <fwsgonzo> either is fine with me, I just need inline functions with capture storage |
11:18:09 | FromDiscord | <Rika> You don’t need any extra special syntax |
11:18:21 | FromDiscord | <Rika> You just use the variable and it should work |
11:18:54 | FromDiscord | <fwsgonzo> Yes, I see that's very simple |
11:19:04 | FromDiscord | <fwsgonzo> In C++ everything has to be rocket theory |
11:20:30 | FromDiscord | <tandy> is there a way to force nimble to install from the latest commit and not the latest tag / release? |
11:20:43 | FromDiscord | <impbox [ftsf]> there is... i forget the syntax |
11:20:49 | FromDiscord | <impbox [ftsf]> nimble install foo@#head maybe |
11:20:51 | FromDiscord | <impbox [ftsf]> (edit) "nimble" => "`nimble" |
11:20:55 | FromDiscord | <impbox [ftsf]> (edit) "foo@#head" => "foo@#head`" |
11:21:33 | FromDiscord | <tandy> yee i got it |
11:21:39 | FromDiscord | <tandy> repo@#head |
11:23:43 | FromDiscord | <cabboose> my friend, you have a lot here to be refactored hahahaha |
11:23:45 | FromDiscord | <cabboose> so many ptrs |
11:23:47 | FromDiscord | <cabboose> so so many |
11:23:52 | FromDiscord | <PsychoClay> yea iknow |
11:24:33 | FromDiscord | <cabboose> For starters don't pass your udata as a pointer to the threads, it'll bring up issues with the reference counting |
11:24:43 | FromDiscord | <cabboose> make an arbitrary object to contain the references and pass that to the thread |
11:25:08 | FromDiscord | <cabboose> but pass that I got scared by all the pointers |
11:25:20 | FromDiscord | <PsychoClay> i tried to pass it directly but it didnt work |
11:25:57 | FromDiscord | <cabboose> that should work no? |
11:26:01 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3yPI |
11:26:04 | FromDiscord | <PsychoClay> oh like that |
11:26:21 | FromDiscord | <cabboose> ye |
11:27:01 | FromDiscord | <cabboose> anytime you pass things around in pointers you risk them not being reference counted correctly; and since you are using orc it's really unnecessary to risk that unless you really have to |
11:27:23 | FromDiscord | <cabboose> I mean it would be more manageable if things weren't so nested |
11:27:26 | FromDiscord | <cabboose> this looks like a hell of a project |
11:27:34 | FromDiscord | <cabboose> Kudoes |
11:27:36 | FromDiscord | <PsychoClay> its fun |
11:27:51 | FromDiscord | <PsychoClay> except for the threading part lol |
11:28:05 | FromDiscord | <PsychoClay> well it should be better now |
11:28:21 | FromDiscord | <cabboose> I haven't had so much trouble with threading, but I could see how it could get chaotic trying to refactor all this into a multithreaded model |
11:28:43 | FromDiscord | <cabboose> Have you tried turning it off and on again? 🤣 |
11:29:01 | FromDiscord | <PsychoClay> bruh |
11:29:34 | FromDiscord | <Rika> I’m gonna assume your model is messy |
11:29:45 | FromDiscord | <cabboose> \:') |
11:29:48 | FromDiscord | <Rika> In which case it might be easier to refactor the whole thing before threading |
11:30:06 | FromDiscord | <cabboose> That would be a painful experience |
11:30:09 | FromDiscord | <PsychoClay> its not messy i think? |
11:30:38 | FromDiscord | <Rika> Less painful than fixing the current I would assume, can |
11:30:39 | FromDiscord | <cabboose> \:') |
11:30:42 | FromDiscord | <Rika> Cab |
11:30:56 | FromDiscord | <Rika> I don’t know for sure, I can’t look at the code on my mobile |
11:31:06 | FromDiscord | <Rika> I mean I can but I will cry |
11:31:08 | FromDiscord | <cabboose> Definitely easier to just refactor it all |
11:31:12 | FromDiscord | <cabboose> but |
11:31:13 | FromDiscord | <PsychoClay> what part is messy? |
11:31:17 | FromDiscord | <cabboose> it looks painful |
11:31:18 | * | leth joined #nim |
11:32:00 | FromDiscord | <cabboose> well; I would suggest strongly against mixing camelCase and\_this\_stuff |
11:32:16 | FromDiscord | <PsychoClay> right |
11:32:49 | FromDiscord | <PsychoClay> its becuase autocomplete gives camelcase |
11:32:54 | FromDiscord | <cabboose> but it's whether it makes sense to you or not; the issue is making it all multithreaded friendly while tracking errors might be a pain in the ass |
11:33:06 | FromDiscord | <cabboose> it's no issue, just difficult for someone outside to come into it \:) |
11:35:03 | FromDiscord | <cabboose> I still think its a cool project and I'm all for it |
11:35:04 | FromDiscord | <cabboose> I am maybe too used to a certain style |
11:35:11 | FromDiscord | <Rika> Jesus this is messy code |
11:35:40 | FromDiscord | <PsychoClay> guys its not that bad :copege: |
11:36:10 | FromDiscord | <cabboose> 🤣 Rika be nice hahahaha |
11:37:06 | FromDiscord | <Rika> Well there’s no separation of logic I think |
11:37:39 | FromDiscord | <PsychoClay> you mean too much in 1 func? |
11:37:57 | FromDiscord | <Rika> Yeah |
11:38:08 | FromDiscord | <Rika> Handling too many different things in one proc |
11:38:21 | FromDiscord | <cabboose> 🍝 |
11:38:54 | FromDiscord | <Rika> Also why pass a pointer? You’re not required to |
11:39:15 | FromDiscord | <Rika> What do these names mean? Too short to be descriptive |
11:42:23 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3yPN |
11:42:55 | FromDiscord | <cabboose> image.png https://media.discordapp.net/attachments/371759389889003532/887302387738497024/image.png |
11:43:21 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3yPO |
11:43:21 | FromDiscord | <PsychoClay> should be fine right? |
11:43:52 | FromDiscord | <Rika> Kinda |
11:43:54 | FromDiscord | <cabboose> what |
11:43:55 | FromDiscord | <cabboose> nein |
11:44:02 | FromDiscord | <Rika> Wait |
11:44:09 | FromDiscord | <Rika> Why the fuck do you need to set length all the time |
11:44:12 | FromDiscord | <PsychoClay> ehhhh |
11:44:26 | FromDiscord | <PsychoClay> because var in llop make thread go dissapear |
11:44:27 | FromDiscord | <Rika> Just do it once to the thread count |
11:44:33 | FromDiscord | <cabboose> hahahahahaha someone hold him down |
11:44:35 | FromDiscord | <PsychoClay> oh right |
11:44:37 | FromDiscord | <Rika> What |
11:44:48 | FromDiscord | <Rika> Did you get enough sleep today |
11:44:58 | FromDiscord | <Rika> Did you forget your morning coffee |
11:45:02 | FromDiscord | <cabboose> ITS FINE |
11:45:03 | FromDiscord | <cabboose> okay |
11:45:03 | FromDiscord | <Rika> Are you eating properly |
11:45:07 | FromDiscord | <PsychoClay> im vibreaigng |
11:45:08 | FromDiscord | <cabboose> also |
11:45:09 | FromDiscord | <cabboose> don't do that |
11:45:21 | FromDiscord | <cabboose> Tdata(udata\: udata) will sink the udata |
11:45:21 | FromDiscord | <cabboose> make a Tdata() |
11:45:35 | FromDiscord | <cabboose> and then assign udata to the udata field |
11:45:37 | FromDiscord | <cabboose> that's safer |
11:45:40 | FromDiscord | <cabboose> AFAIK |
11:45:43 | FromDiscord | <PsychoClay> whats the difference |
11:45:48 | FromDiscord | <Rika> semantics |
11:45:52 | * | pro joined #nim |
11:45:58 | FromDiscord | <cabboose> if you sink it; it makes your program sad |
11:46:00 | FromDiscord | <Rika> Can’t you force a copy without doing that though |
11:46:12 | FromDiscord | <Rika> Prolly with .copy or so |
11:46:55 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3yPQ |
11:47:02 | FromDiscord | <PsychoClay> good? |
11:47:15 | FromDiscord | <cabboose> I reckon |
11:47:51 | FromDiscord | <Rika> Might still sink |
11:48:04 | FromDiscord | <Rika> Is there no explicit copy |
11:48:07 | FromDiscord | <Rika> Like I’ve said |
11:48:28 | FromDiscord | <PsychoClay> but its a ref? |
11:48:50 | FromDiscord | <PsychoClay> it seems to work |
11:49:03 | FromDiscord | <Rika> Well why would constructor syntax sink then |
11:49:29 | FromDiscord | <cabboose> I remember seeing it somewhere |
11:49:30 | FromDiscord | <cabboose> I can't remember |
11:49:45 | FromDiscord | <cabboose> but pretty sure constructor syntax is automatically sunk |
11:50:01 | FromDiscord | <cabboose> otherwise the compiler will determine if it's safe to do so? |
11:50:09 | FromDiscord | <cabboose> I'm sure I remember seeing it somewhere |
11:50:18 | FromDiscord | <cabboose> I've definitely run into the problem before |
11:50:38 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3yPR |
11:50:55 | FromDiscord | <cabboose> oh dear |
11:51:01 | FromDiscord | <cabboose> cyclic structures |
11:51:06 | FromDiscord | <PsychoClay> (edit) "https://play.nim-lang.org/#ix=3yPR" => "https://play.nim-lang.org/#ix=3yPS" |
11:51:24 | FromDiscord | <cabboose> wait |
11:51:48 | FromDiscord | <rb3.nim> Hey guys, is there some trick to figure out if a variable is a `let` or `var` in variable declaration macro pragmas? I saw this RFC https://github.com/nim-lang/RFCs/issues/220, but I was hoping there was an existing solution |
11:52:24 | FromDiscord | <cabboose> Does that occur when you try to access the field in your thread psychoclay? |
11:52:45 | FromDiscord | <cabboose> Also; why are you creating a new Tdata for every thread |
11:52:47 | FromDiscord | <cabboose> you only need 1 |
11:52:53 | FromDiscord | <PsychoClay> oh right |
11:52:57 | FromDiscord | <xflywind> it seems like a known issue |
11:52:59 | * | pro quit (Quit: WeeChat 3.2) |
11:52:59 | FromDiscord | <xflywind> https://github.com/nim-lang/Nim/issues/14901 |
11:53:27 | FromDiscord | <cabboose> But would the same behaviour occur with manual thread creation? |
11:53:30 | FromDiscord | <cabboose> fak |
11:54:37 | FromDiscord | <PsychoClay> hm it doesnt error anymore |
11:54:51 | FromDiscord | <cabboose> `nim` |
11:55:10 | * | Vladar quit (Quit: Leaving) |
11:55:48 | FromDiscord | <cabboose> There was a pragma for stopping ORC from collecting your cycles wasn't there? |
11:55:50 | FromDiscord | <cabboose> or was it the opposite |
11:55:56 | FromDiscord | <cabboose> I think it was the opposite |
11:56:15 | FromDiscord | <Rika> In reply to @rb3.nim "Hey guys, is there": I recall someone asking about the same thing |
11:56:22 | * | rockcavera joined #nim |
11:56:22 | * | rockcavera quit (Changing host) |
11:56:22 | * | rockcavera joined #nim |
11:56:49 | FromDiscord | <cabboose> Too much effort; goodluck psychoclay friend 🤣 |
11:57:01 | FromDiscord | <PsychoClay> thanks :)) |
11:58:28 | FromDiscord | <Rika> I’d like to help but I ain’t at my PC so lol |
11:59:10 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3yPT |
12:00:00 | FromDiscord | <Rika> @PsychoClay by the way in the async portion of your code instead of awaiting everything one by one in the sequence you can just “await all ts” |
12:00:10 | FromDiscord | <PsychoClay> oh nice |
12:00:29 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=3yPT" => "https://play.nim-lang.org/#ix=3yPU" |
12:00:34 | FromDiscord | <cabboose> Oh yeah if you await everything one by one youre in for a bad time |
12:00:41 | FromDiscord | <Rika> Not really |
12:00:51 | FromDiscord | <Rika> It wouldn’t be much slower I don’t think |
12:01:12 | FromDiscord | <Rika> Actually I don’t think it would be slower at all |
12:01:22 | leth | Goel: you could also check for gap.len - 1. |
12:01:32 | FromDiscord | <Rika> Smh use high please |
12:01:46 | FromDiscord | <cabboose> wait is it in the same async pragma proc? |
12:01:58 | FromDiscord | <cabboose> because then it would have to await the first result before itll fetch the next no? |
12:02:08 | FromDiscord | <Rika> No |
12:02:11 | FromDiscord | <Rika> That’s not how that works |
12:02:26 | FromDiscord | <cabboose> D\: |
12:02:38 | FromDiscord | <Rika> When you call the proc that’s when each thing runs until the first await part of such called proc, then it’s waiting for data |
12:02:56 | FromDiscord | <cabboose> Ye |
12:03:11 | leth | Goel: either start at 1 and do - 1 on operations, or start at 0 and do -1 when checking when to stop. |
12:03:14 | FromDiscord | <Rika> When you await the first future you wait for it to finish (but every proc is fetching data I believe) |
12:03:19 | FromDiscord | <Goel> @leth but my problem is not with out of bound for the last, but for the first pass |
12:03:38 | FromDiscord | <cabboose> I think I misunderstood what you were referencing then, I thought he was awaiting independent things within a single async proc |
12:03:51 | FromDiscord | <Rika> https://github.com/PsychoClay/aberrant/blob/master/src/scrapers/mcrawl.nim#L159 |
12:03:53 | FromDiscord | <Rika> I mean this line |
12:04:16 | FromDiscord | <cabboose> Ohhhh |
12:05:32 | FromDiscord | <cabboose> Yeah I getchya |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
12:06:30 | * | supakeen joined #nim |
12:06:37 | * | max22- quit (Ping timeout: 252 seconds) |
12:07:14 | FromDiscord | <cabboose> I can hear my neighbour diarrhoeaing in the toilet |
12:07:24 | FromDiscord | <cabboose> send help |
12:07:39 | FromDiscord | <Rika> That’s TMI |
12:08:34 | FromDiscord | <cabboose> I don’t think he has an issue with throughput at least |
12:08:38 | FromDiscord | <cabboose> no awaiting there |
12:08:51 | leth | Goel: 0 - 1 is expected to be out of bound because it's -1. |
12:10:11 | FromDiscord | <Goel> I found a way, even if not optimal, just added a different indexer for the `texture`, not the same of the `gap` |
12:10:26 | FromDiscord | <Goel> (edit) removed "the" |
12:17:28 | PMunch | Hmm, damn it |
12:17:38 | PMunch | I think my C wrapping is breaking the Nim compiler.. |
12:17:49 | PMunch | It outputs the output of the macro, and then it just sets there |
12:18:12 | PMunch | One core pegged |
12:18:22 | PMunch | But doesn't seem to ever progress.. |
12:19:09 | PMunch | I guess having a bunch of "when declared" and types pointing to other types just somehow breaks things.. |
12:45:51 | PMunch | If someone wants to try and help figure out what is wrong: http://ix.io/3yQ2 |
12:45:56 | PMunch | Warning, it's a massive file.. |
12:46:14 | PMunch | Well, not that massive, only 2.5K lines |
12:46:25 | PMunch | But compiling it causes the compiler to just freeze up |
12:46:39 | PMunch | I'm guessing it might be a circular type definition there or something |
12:59:58 | PMunch | Hmm, removed all of the when stuff and weird alias names from the generation but it still won't build |
13:00:11 | PMunch | http://ix.io/3yQ5 <- new file, only 1.2k lines |
13:00:51 | PMunch | TBH no idea why this one fails.. |
13:02:45 | PMunch | Fails on devel as well.. |
13:05:43 | leth | Having some troubles with understanding scope in nested templates. |
13:06:09 | leth | how would I make something like this work for instance? https://play.nim-lang.org/#ix=3yQ7 |
13:11:08 | PMunch | https://play.nim-lang.org/#ix=3yQ9 |
13:11:15 | PMunch | Something like that works leth ^ |
13:14:37 | PMunch | Okay, built a debug compiler build and got this: http://ix.io/3yQc |
13:15:02 | PMunch | Now to figure out where that recursion is.. |
13:22:15 | leth | PMunch: Thanks, I see i made some mistakes in my example. I wanted to do something like this rather https://play.nim-lang.org/#ix=3yQd |
13:22:56 | * | max22- joined #nim |
13:26:00 | leth | But if i understand correctly the template content: string you added works in a way to make it work on that defined variable in the nested templates, on some sort of implied definition that is done in the templates? I'm not sure I understand how it works. |
13:35:20 | PMunch | That `template content: string = message.content` simply rewrites every instance of `content` in your `body` to a `message.content` |
13:36:26 | leth | Oh, thank you, good explanation, and handy syntax. |
13:47:54 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
13:48:12 | * | Gustavo6046 joined #nim |
13:52:23 | * | Vladar joined #nim |
14:04:19 | leth | I also need to add the string in the template and then apply that to the object, would that be possible? |
14:08:10 | arfy | Just refreshing my syntax. this is a function that's going to take a variable number of directory paths, and return a single list of files. is this correct? |
14:08:12 | arfy | proc getFileList(files: vararg[string]): seq[string] = |
14:24:08 | PMunch | Holy shit, it actually builds! |
14:25:07 | PMunch | Not to hype this up too much, but I've got libclang wrapping a massive C project by only telling it what I want to include, where it can find the C sources, and a couple type rewrites just because I want it more type safe |
14:25:18 | PMunch | Hopefully I can release this soon! :D |
14:25:19 | * | PMunch quit (Quit: Leaving) |
15:47:18 | arkanoid | PMunch: whaat? |
15:47:41 | arkanoid | wait a moment, are you and haxscramper working on same tool? |
15:51:50 | FromDiscord | <haxscramper> No, pmunch is working on the C conversion tool |
15:52:27 | arkanoid | but he said wrapping, not converting |
15:52:27 | FromDiscord | <haxscramper> So he avoided this abyss of fuck-you language design choices and edge cases that libclang dumps on you |
15:52:40 | FromDiscord | <haxscramper> Well, wrapping |
15:53:19 | FromDiscord | <gerwy> Hi, is there any good Javascript FFI tutorial for Nim? i have one library i want to use but im not sure how i should translate the code for it↵also idk if i need to locally have those .js files for library or i can have it installed via npm i have both to be sure |
15:53:20 | FromDiscord | <haxscramper> But anyway, c2nim v2 using libclang |
15:54:45 | arkanoid | And aren't you doing same but with C++ and preprocessing included? |
15:56:11 | arkanoid | gerwy, I've learn how to do that myself in an afternoon. Is quite easy, just follow https://github.com/nim-lang/Nim/wiki/Nim-for-TypeScript-Programmers#javascript-interoperability and jsffi module docs/tests/examples |
15:57:15 | FromDiscord | <haxscramper> Technically yes↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
15:57:51 | FromDiscord | <haxscramper> Practically "with c++ and preprocessor included" makes it not "the same" |
15:57:56 | FromDiscord | <gerwy> In reply to @arkanoid "And aren't you doing": i mean kinda, but there is some async going on in the example code for the lib↵i could use nim's async module do i? |
15:58:14 | FromDiscord | <gerwy> In reply to @arkanoid "<@347345994217816066>, I've learn how": ooooh i forgot about this thank youuu |
15:58:17 | FromDiscord | <haxscramper> Well, maybe pmunch just was smart enough to avoid all walls, while I repeatedly managed to hit them for a year |
15:58:51 | FromDiscord | <haxscramper> But I'm pretty sure his tool would be more usable than what I have right now |
15:59:21 | arkanoid | haxscramper, sure, I was not trying to underestimate. I know how C++ is massively more complex and generally bad than C, that's why I tend to avoid it |
16:00:32 | arkanoid | gerwy: https://nim-lang.org/docs/asyncjs.html |
16:00:38 | arkanoid | never used it myself |
16:02:43 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
16:03:14 | * | stkrdknmibalz joined #nim |
16:06:51 | FromDiscord | <gerwy> In reply to @arkanoid "<@347345994217816066>: https://nim-lang.org/docs/as": :😳 |
16:06:53 | FromDiscord | <gerwy> (edit) ":😳" => "😳" |
16:09:06 | * | Gustavo6046 joined #nim |
16:17:54 | * | rockcavera quit (Read error: Connection reset by peer) |
16:18:19 | * | rockcavera joined #nim |
16:18:19 | * | rockcavera quit (Changing host) |
16:18:19 | * | rockcavera joined #nim |
16:19:16 | FromDiscord | <gerwy> ugh i think i need some examples on how its done, i will look more into it later |
16:25:21 | FromDiscord | <fwsgonzo> what is the sanest way to check if a string is a number vs a hex string? |
16:25:42 | FromDiscord | <fwsgonzo> (edit) "a" => "an integral" | "string?" => "string vs a floating-point constant?" |
16:26:10 | FromDiscord | <cabboose> check if it's all numerical characters? |
16:29:54 | FromDiscord | <cabboose> https://nim-lang.org/docs/strutils.html#allCharsInSet%2Cstring%2Cset%5Bchar%5D |
16:30:19 | FromDiscord | <cabboose> I guess use that against `Digits` |
16:30:45 | FromDiscord | <cabboose> if you get `false` then it's not an int |
16:30:54 | FromDiscord | <dain> im trying to get my head around writing macros |
16:31:04 | FromDiscord | <dain> this is so much fun :) |
16:31:06 | FromDiscord | <cabboose> can then test it against `HexDigits`? |
16:31:50 | FromDiscord | <fwsgonzo> yeah, but I think to make it easier for myself I will just enforce 0x, 0b and all digits = integral |
16:32:23 | FromDiscord | <fwsgonzo> that leaves floating points but I will handle that later |
16:32:30 | FromDiscord | <cabboose> so you specifically want to know if its a hex/integer vs a float? |
16:33:46 | FromDiscord | <fwsgonzo> yes I'm actually parsing assembly instructions |
16:34:17 | FromDiscord | <cabboose> well the fastest thing then might just be an iteration over the characters. return a val of 0 while the characters are integers, and then return a val of 1 if you hit a hex, and a 2 if you hit a period? |
16:34:28 | FromDiscord | <cabboose> oh shiet |
16:34:34 | FromDiscord | <cabboose> byelolnope |
16:37:06 | FromDiscord | <fwsgonzo> I think the only sane way is to enforce 0x and 0b to avoid confusion |
16:48:56 | FromDiscord | <gerwy> actually it might be my lib that doesn't work not nim hmm |
16:49:27 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=3yRv |
16:49:35 | FromDiscord | <fwsgonzo> (edit) |
16:49:40 | FromDiscord | <Rika> you cannot have sets of strings |
16:49:43 | FromDiscord | <Rika> use hashset |
16:49:50 | FromDiscord | <cabboose> You cant do dat |
16:50:11 | FromDiscord | <Rika> cabby my man you're a bit too late ain't ya :PP |
16:50:18 | FromDiscord | <Rika> i kid |
16:50:24 | FromDiscord | <cabboose> it's getting too late for me |
16:50:26 | FromDiscord | <cabboose> leave me behind |
16:50:32 | FromDiscord | <cabboose> let me die |
16:50:37 | FromDiscord | <Rika> you cant |
16:50:42 | FromDiscord | <Rika> you still have responsibilities |
16:50:49 | FromDiscord | <cabboose> hahahahahahahahahahaha |
16:50:52 | FromDiscord | <cabboose> hahahahahahahhahahahahhahahahahhaa |
16:50:56 | FromDiscord | <cabboose> dead |
16:50:58 | FromDiscord | <Rika> oh no |
16:51:15 | FromDiscord | <Rika> this will really impact your relationships with your employer... |
16:51:16 | FromDiscord | <Rika> x d |
16:51:20 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
16:51:39 | FromDiscord | <cabboose> you heartless bastard hahahaha |
16:51:57 | FromDiscord | <cabboose> I won't die so long as I can still pester you and beef |
16:52:02 | FromDiscord | <Rika> poggers |
16:52:05 | FromDiscord | <Rika> one more in the group |
16:52:13 | FromDiscord | <Rika> pestering triad |
16:52:28 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=3yRw |
16:52:35 | FromDiscord | <fwsgonzo> (edit) "https://play.nim-lang.org/#ix=3yRw" => "https://play.nim-lang.org/#ix=3yRx" |
16:52:40 | FromDiscord | <Rika> the generic is not needed |
16:52:42 | FromDiscord | <cabboose> aiyaaaaa |
16:52:43 | FromDiscord | <Rika> that isnt a type |
16:52:46 | FromDiscord | <Rika> here is the correct: |
16:52:55 | FromDiscord | <Rika> `let opcodes = toHashSet([""])` |
16:53:10 | FromDiscord | <Rika> but you can make it empty, empty string != no string |
16:53:17 | FromDiscord | <Rika> if it were empty, you'd use the generic |
16:53:28 | FromDiscord | <Rika> `let opcodes = toHashSet[string]([])` i think will work |
16:53:29 | FromDiscord | <cabboose> or just do a nice `let opcodes = initHashSet[string]()` if you want to use the generic |
16:53:34 | FromDiscord | <Rika> oh yeah |
16:53:35 | FromDiscord | <Rika> init |
16:53:42 | FromDiscord | <Rika> it's 2 am and i wake up early forgive me |
16:53:43 | FromDiscord | <cabboose> you need tea |
16:53:48 | * | Vladar quit (Quit: Leaving) |
16:53:49 | FromDiscord | <cabboose> hahahahahaha |
16:55:17 | FromDiscord | <fwsgonzo> thanks |
16:58:00 | * | neurocyte joined #nim |
16:58:00 | * | neurocyte quit (Changing host) |
16:58:00 | * | neurocyte joined #nim |
17:15:43 | * | arfy8820 joined #nim |
17:18:04 | arfy8820 | ok... help? I'm trying to call a function that requires a pointer. I have this, but can't remember how to create a pointer in the function call. |
17:18:06 | arfy8820 | var info: BASS_DEVICEINFO |
17:18:06 | arfy8820 | discard BASS_GetDeviceInfo(1, info) |
17:22:37 | FromDiscord | <Rika> pointers can be retrieved from variables by `addr` |
17:22:53 | arfy8820 | aha. thanks. |
17:23:03 | * | arfy8820 quit (Quit: Reality intrudes...) |
17:23:20 | FromDiscord | <Rika> letiables will need `unsafeAddr` for reference |
17:23:28 | FromDiscord | <Rika> ~~sorry not sorry for the bad joke~~ |
17:47:36 | FromDiscord | <dain> is it possible to attach an else clause to a macro |
17:48:19 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3yRP |
17:48:34 | FromDiscord | <haxscramper> it should be possible |
17:49:39 | FromDiscord | <dain> but isn't the else syntactically outside of the macro so it wouldn't get passed in? |
17:50:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yRQ |
17:50:26 | FromDiscord | <haxscramper> `else/elif/of/finally/except/do` are passed in the same block↵(@dain) |
17:50:35 | FromDiscord | <dain> oooh cool |
17:50:42 | FromDiscord | <dain> that's good |
17:50:43 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/420#issuecomment-917476330 |
18:01:29 | FromDiscord | <tandy> i wish the compiler would tell me where im using native sockets |
18:01:44 | FromDiscord | <tandy> instead of just warning me \>\:o |
18:03:17 | FromDiscord | <exelotl> ohhh wow else block actually landed? |
18:03:30 | FromDiscord | <exelotl> that's super cool I always wanted that to be a thing |
18:05:30 | FromDiscord | <exelotl> actually maybe it didn't, I can't tell from the convo 😅 |
18:06:52 | * | Gustavo6046 quit (Remote host closed the connection) |
18:07:24 | * | Gustavo6046 joined #nim |
18:18:55 | FromDiscord | <haxscramper> In reply to @exelotl "ohhh wow else block": They have been available for the last five years at least |
18:19:13 | FromDiscord | <tandy> is there any serialisation library that supports the JS backend? |
18:19:28 | FromDiscord | <haxscramper> serialization to what? jsony would probably work |
18:20:45 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yRW |
18:21:16 | FromDiscord | <haxscramper> seems to be fixed now |
18:21:18 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yRZ |
18:37:27 | FromDiscord | <tandy> string, jsony had some sort of parsehook error for my enum↵(@haxscramper) |
18:38:25 | FromDiscord | <tandy> \`jsony/objvar.nim(53, 16) Error\: the field 'service' is not accessible.\` |
18:43:43 | NimEventer | New Nimble package! nimcrypt - Implementation of Unix crypt with support for Crypt-MD5, Crypt-SHA256 and Crypt-SHA512, see https://github.com/napalu/nimcrypt |
18:43:46 | nrds | <R2D299> itHub: 7"Nim implementation of Unix crypt" |
18:45:13 | FromDiscord | <ynfle (ynfle)> Is there anyway to skip a certain routine for stack traces? |
18:46:10 | FromDiscord | <ynfle (ynfle)> Meaning that if a calls b and b calls c, the if there is an error in be, it will only report a and b |
18:47:19 | FromDiscord | <haxscramper> `getStackTraceEntries` and write your own pretty-printer |
18:49:03 | FromDiscord | <ynfle (ynfle)> Wrap everything in a try catch block and call it? |
18:49:47 | FromDiscord | <exelotl> In reply to @haxscramper "They have been available": wtf |
18:49:54 | FromDiscord | <exelotl> I could've sworn I tried this before |
18:50:08 | FromDiscord | <exelotl> or maybe I just assumed it wouldn't work since it's not documented anywhere? |
18:50:15 | FromDiscord | <haxscramper> yes |
18:50:34 | FromDiscord | <haxscramper> there is no built-in hook for exception message printouts |
18:50:47 | FromDiscord | <ynfle (ynfle)> That wouldn't work for compile-time crashes though |
18:51:05 | FromDiscord | <haxscramper> well, compiler-time crashes are not exceptions |
18:51:18 | FromDiscord | <ynfle (ynfle)> Not a hook per se, but even using lineinfo from macros |
18:51:27 | FromDiscord | <haxscramper> they are just bugs in compiler |
18:52:22 | FromDiscord | <haxscramper> What are you trying to do? Get better stacktraces when compiler crahes? |
18:52:33 | FromDiscord | <haxscramper> Or when `.error.` is called |
18:52:47 | FromDiscord | <haxscramper> Or when your own exception is raised? |
18:54:58 | FromDiscord | <ynfle (ynfle)> Not compiler crashes but when there are compilation issues |
18:55:27 | FromDiscord | <ynfle (ynfle)> I want to pretend that a template isn't there |
18:55:40 | FromDiscord | <haxscramper> not possible |
18:55:59 | FromDiscord | <haxscramper> right now you can just wrap everything in `compiles()` |
18:56:23 | FromDiscord | <haxscramper> nkError would supposedly might allow this |
18:56:33 | FromDiscord | <haxscramper> But generally speaking invalid code means invalid code |
18:57:52 | FromDiscord | <ynfle (ynfle)> Can this not be acheived with manipulating lineinfo for the nodes |
18:58:50 | FromDiscord | <ynfle (ynfle)> ? |
19:01:13 | FromDiscord | <haxscramper> Can you describe what you want to do? |
19:01:32 | FromDiscord | <haxscramper> You jumped from stacktraces to compilation errors and then to node lineinfo |
19:01:39 | FromDiscord | <haxscramper> Being a bit more concrete will help |
19:01:42 | FromDiscord | <ynfle (ynfle)> Hah lol |
19:02:02 | FromDiscord | <dain> i like this stuff |
19:02:05 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3ySe |
19:02:19 | FromDiscord | <Rika> congrats looks nice |
19:02:42 | FromDiscord | <ynfle (ynfle)> I want to pretend that calling an intemediate template or macro didn't happen |
19:03:28 | FromDiscord | <haxscramper> So you want to reduce number of "template instantiation of" in errors? |
19:04:29 | FromDiscord | <ynfle (ynfle)> Yup |
19:05:23 | FromDiscord | <haxscramper> not possible, or at least highly unlikely this can be done in a sane manner |
19:05:37 | FromDiscord | <haxscramper> Template/macro instantiation context is tracked by compiler |
19:05:57 | FromDiscord | <haxscramper> Not exposed to user code in any way |
19:10:48 | * | ozzz quit (Quit: Bye) |
19:11:04 | * | ozzz joined #nim |
19:16:23 | FromDiscord | <ynfle (ynfle)> Hmmm |
19:16:54 | FromDiscord | <Goel> How can i use `echo` to print an adress/pointer of a field of an object? |
19:17:10 | FromDiscord | <ynfle (ynfle)> I have user code. I'm running it in a subprocess and modifying it. That's why I want to change the stacktraces |
19:17:23 | FromDiscord | <ynfle (ynfle)> `echo someVar.addr` |
19:17:26 | FromDiscord | <haxscramper> `echo addr object.field`?↵(@Goel) |
19:17:35 | FromDiscord | <haxscramper> Or you mean `field: ptr T` being printed as `...` |
19:17:39 | FromDiscord | <Goel> That's what i tried but doesn't work |
19:17:39 | FromDiscord | <haxscramper> Overload `$` for your pointer |
19:19:06 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3ySm |
19:19:17 | FromDiscord | <Rika> .data is already a pointer? |
19:19:19 | FromDiscord | <haxscramper> `cast[int](addr text.data)` |
19:19:37 | FromDiscord | <Goel> yes |
19:19:40 | FromDiscord | <haxscramper> Or better do `repr` on the thing |
19:19:53 | FromDiscord | <Goel> But only data is a pointer the other fields are not |
19:19:56 | FromDiscord | <ynfle (ynfle)> Try type conversion to int |
19:21:14 | FromDiscord | <dain> hmm im trying to do a more sophisticated version of the above "assuming" thing, that can handle `assuming expr() as name: ...` . im trying to use the fusion/matching and im getting a weird error just trying to define it |
19:21:28 | FromDiscord | <dain> sent a code paste, see https://paste.rs/zzw |
19:21:45 | FromDiscord | <Goel> In reply to @haxscramper "Or better do `repr`": Thanks |
19:21:56 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3ySo |
19:22:09 | FromDiscord | <dain> but when I delete the `is Ident()` part at the end, the error goes away. why is that? |
19:23:27 | FromDiscord | <dain> it works inside the square brackets |
19:23:58 | FromDiscord | <haxscramper> Wrap `@name is Ident()` in pars |
19:24:15 | FromDiscord | <haxscramper> I'm not sure but `|` might bind closer |
19:24:28 | FromDiscord | <dain> ah thanks, that works |
19:24:44 | FromDiscord | <haxscramper> The error message is shit though |
19:24:50 | FromDiscord | <dain> that's strange, though, in the tutorial I was following you don't need parentheses |
19:24:59 | FromDiscord | <haxscramper> You can report it on fusion issue, I will look into it |
19:25:23 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3ySp |
19:26:59 | * | ozzz quit (Quit: Bye) |
19:27:05 | FromDiscord | <haxscramper> Can you show how you use this `assuming_v2` macro? |
19:27:45 | * | ozzz joined #nim |
19:28:05 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix= |
19:28:06 | FromDiscord | <dain> i havent written it yet |
19:28:09 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ySq |
19:28:15 | FromDiscord | <dain> im just trying to figure out how macros and stuff work |
19:30:21 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3ySr |
19:30:33 | FromDiscord | <dain> where the expression / foo are option types |
19:30:58 | FromDiscord | <dain> it just unwraps the option if is_some() and rebinds it if appropriate, and if it's none it's a no-op |
19:31:14 | FromDiscord | <dain> i wouldn't actually use this, i just came up with it as an exercise to learn macros |
19:31:50 | FromDiscord | <dain> (edit) "https://play.nim-lang.org/#ix=3ySr" => "https://play.nim-lang.org/#ix=3ySs" |
19:35:16 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3ySu |
19:35:59 | NimEventer | New thread by Kiloneie: Nim for Beginners #26 Reference Objects, see https://forum.nim-lang.org/t/8426 |
19:36:11 | * | Gustavo6046_ joined #nim |
19:36:25 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
19:36:38 | FromDiscord | <Kiloneie> https://youtu.be/kkSAVKKIoVc↵↵Double plug. |
19:36:40 | nrds | <R2D299> outube: 7"Nim for Beginners #26 Reference Objects FINISHED VIDEO" |
19:36:56 | FromDiscord | <Kiloneie> Wait what |
19:37:21 | FromDiscord | <Kiloneie> (fixed that typo in the title ups) |
19:38:38 | * | Gustavo6046_ is now known as Gustavo6046 |
19:43:14 | NimEventer | New post on r/nim by Kiloneie: Nim for Beginners #26 Reference Objects, see https://reddit.com/r/nim/comments/po9zlz/nim_for_beginners_26_reference_objects/ |
19:44:52 | * | tdc quit (Ping timeout: 265 seconds) |
19:45:15 | FromDiscord | <Kiloneie> Man these bots. |
19:50:50 | * | ozzz quit (Read error: Connection reset by peer) |
19:55:03 | * | ozzz joined #nim |
20:12:00 | FromDiscord | <dain> okay I figured it out |
20:12:02 | NimEventer | New thread by Trisub: Setting object value by providing key as string?, see https://forum.nim-lang.org/t/8427 |
20:12:19 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3ySL |
20:44:50 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3yTp |
20:45:14 | FromDiscord | <Yardanico> it doesn't depend on options and instead implements its own types though |
21:08:50 | * | max22- quit (Quit: Leaving) |
21:36:49 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
21:36:51 | * | Gustavo6046_ joined #nim |
21:39:28 | * | Gustavo6046_ is now known as Gustavo6046 |
21:41:28 | * | leth quit (Quit: no reason) |
21:49:02 | FromDiscord | <Recruit_main707> so i turned on my pc today and `nimble.exe` doesnt work, i tried uninstalling nim and installing it again but its broken even from a fresh install |
21:55:47 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
21:56:06 | * | Gustavo6046 joined #nim |
22:06:47 | FromDiscord | <Recruit_main707> building from source now to see if it works |
22:50:07 | FromDiscord | <Recruit_main707> now it runs but if i try to install anything i get:↵`Could not download: No SSL/TLS CA certificates found.`↵after it tries to download `packages.json` if someone could help me id appreciate it |
23:08:50 | FromDiscord | <leorize> download the official nim binaries and copy the .pem from the bin folder |
23:11:37 | FromDiscord | <leorize> https://curl.se/docs/caextract.html \<- you can download this one and put it next to nimble.exe too |
23:39:46 | FromDiscord | <Yardanico> LOL, was setting up my local ircord debugging configuration, and changed the IRC network from irc.freenode.net to irc.libera.net (not .chat but .net) |
23:39:59 | FromDiscord | <Yardanico> and apparently freenode OWNS this domain and redirects it to freenode! |
23:40:28 | FromDiscord | <Yardanico> and I was confused as to why I was getting "freenode" in the IRC responses while trying to connect to libera chat |
23:40:36 | FromDiscord | <Yardanico> https://news.ycombinator.com/item?id=27797806 |
23:44:08 | FromDiscord | <exelotl> holy crap lol |
23:44:40 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
23:45:34 | * | Gustavo6046 joined #nim |
23:45:36 | FromDiscord | <Yardanico> @exelotl and about ircord - the current codebase is pretty messy, especially the edit handling and pasting :) |
23:48:04 | FromDiscord | <exelotl> haha, I was having a real hard time getting my head around it, then I realised the line causing the problem was completely unused xD |
23:48:21 | FromDiscord | <exelotl> so at least it was an easy fix after all |
23:49:02 | FromDiscord | <exelotl> I'm using ircord for the GBAdev community and it's working great |
23:49:12 | FromDiscord | <Yardanico> oh, nice! |
23:50:19 | FromDiscord | <exelotl> it's really good, thanks for all your hard work battle testing it already :) |
23:50:29 | FromDiscord | <Yardanico> although I'd say there are a lot of pretty good alternatives like (ofc) mattermost and t2bot |
23:50:34 | FromDiscord | <Yardanico> although afaik they don't do code paste handling |
23:51:20 | FromDiscord | <exelotl> oh yeah we were using matterbridge before, it sucked |
23:51:45 | FromDiscord | <exelotl> it doesn't handle edits either, just reposts the whole message |
23:52:12 | FromDiscord | <exelotl> which is _horrible_ for code pastes 😅 |
23:53:19 | FromDiscord | <exelotl> and it doesn't change the nick to look like a different user is speaking either, just prefixes every message with `nick:` |
23:53:35 | FromDiscord | <exelotl> (edit) "and ... it" added "when posting to discord" |
23:53:54 | * | jkl quit (Quit: Gone.) |
23:55:16 | * | jkl joined #nim |