00:00:37 | FromDiscord | <Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2Uj1 |
00:02:02 | FromDiscord | <Mustache Man> Note that NetworkNode's "nodes" object is a seq[NetworkNode] and SpecialNode's is a seq[SpecialNode] |
00:02:11 | FromDiscord | <Mustache Man> (edit) "Note" => "It's important to note" |
00:03:34 | FromDiscord | <Mustache Man> (edit) "NetworkNode's" => "Network's" | "seq[NetworkNode] and SpecialNode's is a seq[SpecialNode]" => "seq[NetworkNode].. here i'll include the types" |
00:04:03 | FromDiscord | <Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2Uj2 |
00:04:29 | FromDiscord | <Mustache Man> (edit) "https://play.nim-lang.org/#ix=2Uj2" => "https://play.nim-lang.org/#ix=2Uj3" |
00:05:12 | FromDiscord | <Mustache Man> (edit) "https://play.nim-lang.org/#ix=2Uj3" => "https://play.nim-lang.org/#ix=2Uj4" |
00:11:14 | FromDiscord | <William> 😦 https://media.discordapp.net/attachments/371759389889003532/825522382268792858/unknown.png |
00:15:08 | * | j joined #nim |
00:17:10 | FromDiscord | <ElegantBeef> They mean nvim |
00:17:41 | * | Vladar quit (Quit: Leaving) |
00:20:27 | * | j is now known as jess |
00:27:16 | Prestige | looks like a copy pasta lol |
00:28:45 | FromDiscord | <ElegantBeef> But yea prestige clyybber is online so feel free to pester them 😄 |
00:29:48 | Prestige | @Clyybber be a pal and merge https://github.com/nim-lang/Nim/pull/17425 plz |
00:36:15 | FromDiscord | <clyybber> aight, lemme see |
00:36:25 | FromDiscord | <clyybber> @ElegantBeef shouldn't the break have the same effect anyways? |
00:36:46 | Prestige | <3 |
00:36:49 | FromDiscord | <clyybber> umm nevermind :D |
00:36:58 | FromDiscord | <ElegantBeef> Yea it broke out of the loop but appended the string still |
00:37:02 | FromDiscord | <ElegantBeef> Atleast iirc |
00:37:31 | FromDiscord | <ElegantBeef> Seems to only cause an issue with using nimscript with many search paths |
00:38:00 | FromDiscord | <ElegantBeef> But it seems like it's a non breaking change(always dubious about that claim) |
00:43:36 | FromDiscord | <clyybber> Ok, the logic makes sense; merged :D |
00:44:08 | FromDiscord | <clyybber> do you think you could come up with a test so that we prevent it from regressing? |
01:00:00 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:01:02 | * | njoseph joined #nim |
01:02:49 | * | drsensor joined #nim |
01:03:06 | FromDiscord | <ElegantBeef> Uhh, possibly but it's pretty elaborate to spool up the VM and point it at a stdlib |
01:03:56 | * | clyybber quit (Quit: WeeChat 3.1) |
01:14:34 | FromDiscord | <ElegantBeef> Well there we go prestige, best get that bot working now to validate the pestering |
01:14:46 | FromDiscord | <ElegantBeef> If you dont get it working clyybber will ban you |
01:15:52 | FromDiscord | <Mustache Man> I made a nim playground link if anyone wants to help me debug this: https://play.nim-lang.org/#ix=2Ujf |
01:16:19 | * | krux02 quit (Remote host closed the connection) |
01:18:20 | * | sixtyten joined #nim |
01:20:30 | FromDiscord | <ElegantBeef> The compiler tells teh issue |
01:20:36 | FromDiscord | <ElegantBeef> (edit) "teh" => "the" |
01:21:07 | FromDiscord | <Mustache Man> Yes, I just don't fully understand it or how to fix it |
01:21:31 | FromDiscord | <ElegantBeef> reciever is lent from `n.network.nodes` and it shouldnt outlive the scope of the for loop |
01:22:36 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Ujh |
01:22:37 | FromDiscord | <Mustache Man> oh, so i need another approach to the callback |
01:22:38 | FromDiscord | <ElegantBeef> There you go |
01:24:38 | FromDiscord | <Mustache Man> oooohhhh, I see! thank you |
01:56:44 | Prestige | Thanks beef and clyybber |
02:01:49 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
02:02:10 | * | njoseph joined #nim |
02:31:11 | * | arecaceae quit (Remote host closed the connection) |
02:31:31 | * | arecaceae joined #nim |
02:40:14 | * | fredrikhr quit (Read error: Connection reset by peer) |
02:45:58 | saem | time for my computer to go to space. :D |
03:01:38 | * | fmaruki joined #nim |
03:04:31 | * | fmaruki left #nim ("ERC (IRC client for Emacs 26.3)") |
03:11:48 | * | drsensor quit (Quit: Connection closed for inactivity) |
03:19:00 | * | fmaruki joined #nim |
03:27:29 | * | fmaruki` joined #nim |
03:28:14 | * | fmaruki` left #nim ("ERC (IRC client for Emacs 26.3)") |
03:35:34 | FromDiscord | <Mustache Man> How would I echo a distinct type? |
03:36:17 | leorize | you can do so by borrowing the `$` proc |
03:36:34 | FromDiscord | <Mustache Man> thank you |
03:46:03 | * | spiderstew_ joined #nim |
03:47:15 | * | spiderstew quit (Ping timeout: 240 seconds) |
03:49:23 | FromGitter | <gogolxdong> How to have jester listen on ipv6? |
03:50:09 | * | hsh quit (Quit: Connection closed for inactivity) |
04:47:49 | * | xet7 quit (Remote host closed the connection) |
04:48:48 | * | xet7 joined #nim |
05:30:01 | * | xet7 quit (Remote host closed the connection) |
05:40:42 | * | valorzard quit (Ping timeout: 240 seconds) |
06:04:52 | * | xet7 joined #nim |
07:07:42 | FromDiscord | <Yardanico> i'm trying to make a silly benchmark for different types of runtime dispatch, am I doing it wrong? https://play.nim-lang.org/#ix=2Ulf |
07:08:06 | FromDiscord | <Yardanico> for me with refc all types are roughly the same speed, but with arc/orc methods are slower than with refc (that's expected), but all other types are 3x faster than with refc |
07:41:37 | FromGitter | <StefanSalewski> 07:07:42 FromDiscord <Yardanico> i'm trying to make a silly benchmark for different types of runtime dispatch, |
07:41:58 | FromGitter | <StefanSalewski> Nice: I am very interested in the results! |
07:42:47 | FromGitter | <StefanSalewski> Question: Do we have something for C++ DBL_MAX in Nim? I guess it is different from system.inf. |
07:44:01 | FromGitter | <StefanSalewski> Well maybe float.high() |
07:45:26 | * | haxscramper joined #nim |
07:48:30 | FromGitter | <StefanSalewski> Well echo system.Inf, float.high in playground gives infinf. Then I will use my own DBL_MAX* = 1e308 # fix later |
07:48:35 | FromGitter | <StefanSalewski> Logout |
07:56:48 | saem | Yardanico: are you doing release only or danger as well? Does lifting bark out help? |
07:58:49 | * | krux02 joined #nim |
08:05:55 | * | NimBot joined #nim |
08:19:05 | * | lritter joined #nim |
08:22:13 | * | sirn quit (Quit: Connection closed for inactivity) |
08:31:09 | * | leorize quit (Ping timeout: 240 seconds) |
08:31:34 | * | leorize joined #nim |
08:39:51 | FromDiscord | <Yardanico> -d:danger |
08:40:14 | FromDiscord | <Yardanico> and wdym "lifting bark"? even without having that field the speeds are roughly the same |
08:40:25 | FromDiscord | <Yardanico> also arc is known to have slower methods because it uses string comparisons for them |
08:41:12 | FromDiscord | <Yardanico> but it's weird for me that all other 3 types of runtime dispatch are much faster with arc |
08:41:19 | FromDiscord | <Yardanico> so I wonder if my benchmark is wrong |
08:45:27 | * | vicfred quit (Quit: Leaving) |
08:48:14 | saem | Profiler gives no hints? |
08:49:43 | FromDiscord | <Yardanico> i haven't tried profiling yet :P |
08:52:57 | FromDiscord | <Esther> hello, in D when making slices you can write arr[0 .. $-1] where $ is replaced with arr.length for convenience. Is there something similar in nim or do I have to write arr.len every time? |
08:53:04 | FromDiscord | <Rika> ^1 |
08:53:08 | FromDiscord | <Yardanico> arr[0..^1] |
08:53:10 | FromDiscord | <Rika> arr[0..^1] |
08:53:13 | FromDiscord | <Rika> wow |
08:53:15 | FromDiscord | <Rika> how dare you |
08:54:03 | FromDiscord | <Esther> oh! |
08:54:04 | FromDiscord | <Esther> thank you |
08:54:24 | FromDiscord | <Esther> I saw that in the docs but I glanced at it and thought "oh that's not what I want" and ignored it |
09:16:41 | * | Q-Master quit (Quit: No Ping reply in 180 seconds.) |
09:16:48 | * | Q-Master joined #nim |
09:33:57 | FromDiscord | <jtiai> Stupid questions but `while i <=% FOOBAR` what that comparison operation means? |
09:36:34 | FromDiscord | <Yardanico> you can always search for operators in the doc search bar |
09:36:43 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/825664690125930516/unknown.png |
09:36:49 | FromDiscord | <Yardanico> "Treats x and y as unsigned and compares them. Returns true if unsigned(x) <= unsigned(y)." |
09:37:17 | FromDiscord | <Rika> so something that shouldnt really be used anymore? |
09:37:20 | FromDiscord | <Yardanico> why? |
09:37:24 | FromDiscord | <Rika> idk its a question |
09:37:28 | FromDiscord | <Rika> im asking |
09:38:03 | FromDiscord | <Yardanico> it would've been marked with deprecated (or there would be a note in the doc) if it were something that shouldn't be used anymore :) |
09:38:11 | FromDiscord | <jtiai> BTW, for me manual page is broken... |
09:38:18 | FromDiscord | <Yardanico> how so? |
09:38:35 | FromDiscord | <Yardanico> what do you mean by "broken"? https://nim-lang.org/docs/manual.html opens here just fine |
09:38:35 | FromDiscord | <jtiai> https://media.discordapp.net/attachments/371759389889003532/825665163654987796/unknown.png |
09:39:04 | FromDiscord | <Yardanico> weird, works for me |
09:39:06 | FromDiscord | <Yardanico> what's your browser? |
09:39:53 | FromDiscord | <jtiai> Firefox ESR: 78.8.0esr (64-bit) |
09:41:13 | FromDiscord | <Yardanico> works for me in latest firefox and firefox esr |
09:41:27 | FromDiscord | <Yardanico> you're searching from https://nim-lang.org/docs/manual.html, right? |
09:41:42 | FromDiscord | <jtiai> Yes. |
09:41:51 | FromDiscord | <Yardanico> then it's really weird, probably a browser+OS combination issue |
09:42:07 | FromDiscord | <Yardanico> how does https://nim-lang.org/docs/system.html#%3C%3D%25%2Cint%2Cint look for you? |
09:43:19 | FromDiscord | <jtiai> It's fine. It was only that search part that doesn't work... |
09:47:43 | FromDiscord | <jtiai> Also search response from ajax seems to be fine so must be something magical happening when extracting that info from respnse. |
10:00:52 | FromDiscord | <jtiai> More stupid questions. In python you can do `" " 10` which returns a string with 10 spaces. Is there equivalent for nim? |
10:02:54 | FromDiscord | <Yardanico> https://nim-lang.org/docs/strutils.html#repeat%2Cchar%2CNatural and https://nim-lang.org/docs/strutils.html#repeat%2Cstring%2CNatural |
10:03:27 | FromDiscord | <Yardanico> you can always make your own operator that will call those procs so you have the same behaviour as in Python, but I'd advise against it :P |
10:05:40 | FromDiscord | <jtiai> I'm pretty sure that I can't use strutils... |
10:05:46 | FromDiscord | <jtiai> Since I don't have standard library. |
10:07:22 | FromDiscord | <Yardanico> @jtiai wdym? |
10:07:55 | FromDiscord | <jtiai> I writing operating system. So my operating system doesn't yet have standard libraries. |
10:08:17 | FromDiscord | <Yardanico> do you have heap in your OS and have you tried ARC/ORC? |
10:08:40 | FromDiscord | <Yardanico> with heap and ARC/ORC you can just use the strutils module, otherwise you'll have to implement it yourself |
10:08:58 | FromDiscord | <Yardanico> and with `cstring` instead of `string` of course, since string is heap-allocated |
10:09:16 | FromDiscord | <jtiai> Nope, I'm at quite beginning since IDT and IRQs gave bunch of headaches for few days, |
10:09:24 | FromDiscord | <jtiai> So no memory management yet. |
10:09:41 | FromDiscord | <Yardanico> if your string is a static literal you can always repeat it at compile-time |
10:09:46 | FromDiscord | <jtiai> just writing the kernel part and basic cosnole IO. |
10:10:04 | FromDiscord | <Yardanico> also, do you want to simply write the same string N amount of times? |
10:10:14 | FromDiscord | <Yardanico> if so, just use for/while loops and write(text) :P |
10:10:35 | FromDiscord | <jtiai> That's what I'm doing. Single liner would have fun though 🙂 |
10:10:47 | FromDiscord | <Yardanico> you can always write a template that will do this loop for you |
10:11:44 | FromDiscord | <Rika> static: "".repeat(10) |
10:11:45 | FromDiscord | <Rika> xd |
10:11:51 | FromDiscord | <Yardanico> I mentioned that above |
10:14:21 | FromDiscord | <jtiai> And most probably that repear relies on some stdlib functionality which I don't yet have for my OS. |
10:14:31 | FromDiscord | <Yardanico> @jtiai no, this will run at compile time |
10:15:00 | FromDiscord | <Yardanico> as I said, if you have a static literal (string that's know at compile-time), you can repeat it at compile-time |
10:15:22 | FromDiscord | <jtiai> Ah so it generates physical string... |
10:17:11 | ForumUpdaterBot | New question by Johannes Hoff: How to construct a `select ... in` SQL query in nim?, see https://stackoverflow.com/questions/66840355/how-to-construct-a-select-in-sql-query-in-nim |
10:31:22 | FromDiscord | <jtiai> More stupid questions coming: python has relatively handy no-op syntax `pass` is there similar to nim? If i understood correctly `discard` doesn't just let function to go on but terminates it. |
10:32:17 | liblq-dev | discard is a noop |
10:32:18 | liblq-dev | just like pass |
10:36:08 | FromDiscord | <jtiai> \o/ my os has keyboard now and basic console io. |
11:12:10 | FromDiscord | <Yardanico> is it guaranteed that == nil or .isNil() will be true for a dealloc'd pointer? |
11:12:26 | FromDiscord | <Yardanico> !eval echo var a = alloc(1); a.dealloc(); echo cast[uint](a) |
11:12:27 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: undeclared identifier: 'a' |
11:12:36 | FromDiscord | <Yardanico> !eval var a = alloc(1); a.dealloc(); echo cast[uint](a) |
11:12:38 | NimBot | 140430955720784 |
11:12:50 | FromDiscord | <Yardanico> ah of course not |
11:12:54 | FromDiscord | <Yardanico> since its a pointer |
11:46:02 | ozzz | after successful integration of FCGI lib with NIM, I will give a try to create lv2 plugin. What you think, will be created audio DSP plugin fast enough to have low latency? |
11:46:33 | liblq-dev | yes |
11:46:53 | liblq-dev | use --gc:arc if you want to be 100% sure |
11:47:51 | ozzz | this may change many things, I hate c++, and creating such complicated software using C quiet bit difficult |
11:48:27 | ozzz | liblq-dev, --gc:arc is similat to -march-native? |
11:48:45 | ozzz | *-march=native |
11:48:57 | liblq-dev | no, it's a different memory management model that's better suited for realtime use |
11:49:17 | liblq-dev | nim can do -march=native though if you wanna |
11:49:22 | liblq-dev | --passC:-march=native |
11:49:25 | ozzz | awesome :) thanks for explanation |
11:49:38 | ozzz | yeah, it will pass to gcc that flag |
11:51:05 | ozzz | btw here is code for libfcgi, if somebody is interested: https://github.com/Mikoool/NIM_libFCGI |
11:52:57 | FromDiscord | <Yardanico> just FYI - Nim is not an acronym so it's Nim and not NIM :) |
11:54:07 | ozzz | oh, I will edit it then.. |
12:00:21 | * | Vladar joined #nim |
12:07:37 | * | PMunch joined #nim |
12:19:35 | FromDiscord | <clyybber> In reply to @Yardanico "is it guaranteed that": nope |
12:20:03 | FromDiscord | <Yardanico> @clyybber I posted https://github.com/nim-lang/Nim/issues/17552 in #internals :) |
12:20:09 | FromDiscord | <Yardanico> not sure if we should deprecate global altogether for ARC/ORC |
12:20:15 | FromDiscord | <Yardanico> but it can be useful sometimes |
12:20:46 | FromDiscord | <clyybber> oh I replied |
12:31:23 | FromDiscord | <Yardanico> Is there any reason to have peername in https://github.com/nim-lang/Nim/blob/devel/lib/pure/net.nim#L775 ? It causes a leak and it's not required if we don't need SAN or the CN |
12:31:33 | FromDiscord | <Yardanico> from the OpenSSL docs: "When the certificate is matched, and peername is not NULL, a pointer to a copy of the matching SAN or CN from the peer certificate is stored at the address passed in peername. The application is responsible for freeing the peername via OPENSSL_free() when it is no longer needed." |
12:33:48 | FromDiscord | <Yardanico> @federico3 around? |
12:34:08 | FromDiscord | <Yardanico> from git commits it seems that you added this proc, so I want to confirm with you that it actually causes a leak |
12:40:32 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/17554 |
12:45:42 | federico3 | looking |
12:47:04 | PMunch | Hmm, is there a way to have an "interface" like what we have for streams but on compile-time |
12:47:53 | PMunch | Like I have my "Pin" abstraction for the Teensy stuff right now, but I'd like to be able to extend that for IO expanders |
12:47:56 | FromDiscord | <Yardanico> For what it's worth https://github.com/yglukhov/iface works at compile-time :P |
12:52:13 | federico3 | Yardanico: looks good, unless we want to return the name as a discardable string |
12:52:41 | federico3 | also, should we enable this checks on windows as well? |
12:52:47 | FromDiscord | <Yardanico> not sure about that :P |
12:53:10 | FromDiscord | <Yardanico> it was disabled before because we didn't do certificate checking on windows, right? |
12:57:57 | federico3 | the original plan was to introduce checking incrementally |
12:58:48 | federico3 | but later on this issues have been treated as vulnerabilities |
13:05:28 | * | tane joined #nim |
13:31:20 | FromDiscord | <jtiai> There are quite few docs about interfacing external libs with Nim, but how about otherway around, how I could call for example from C-code some Nim function? |
13:31:58 | PMunch | First you'd need to attach the `{.exportc.}` pragma to your function |
13:32:08 | PMunch | Then you should be able to call them normally |
13:32:16 | Oddmonger | so it seems that {.global.} should not be used with arc/orc (forum post https://forum.nim-lang.org/t/7709 ), what can be used instead to have static vars in proc ? |
13:32:32 | PMunch | https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c |
13:32:47 | PMunch | See this for example @jtiai ^ |
13:34:06 | FromDiscord | <jtiai> Ah, need to tell nim to create header. That was the missing piece from my puzzle. |
13:37:39 | PMunch | I mean you can write it yourself |
13:37:57 | PMunch | Or if you're interfacing with some already written C code you probably have to match some already known signature |
13:51:12 | * | hsh_ joined #nim |
13:51:59 | FromDiscord | <jtiai> not really. just trying to interface my own OS kernel with minimalistic libc so I could expand my kernel much more easier. |
13:54:23 | PMunch | Aah I see |
13:54:37 | PMunch | Writing your own OS kernel in Nim? |
13:57:05 | FromGitter | <UrKr> If I have Event types that are all subtypes of some BaseEvent, how do I dispatch based on which subtype a function receives? ⏎ I surmise that I'm actually going in the wrong direction though. ⏎ AppEvent = ref object of RootObj ⏎ SpecificEvent1 = ref object of AppEvent ⏎ SpecificEvent2 = ref object of AppEvent [https://gitter.im/nim-lang/Nim?at=60608b3188edaa1eb8e7d7fe] |
13:57:58 | FromGitter | <UrKr> I have procs defined that handle SpecificEvent1 and SpecificEvent2 respectively, but how do I get to these two procs from a sequence of AppEvents ? |
13:59:37 | FromDiscord | <jtiai> In reply to @PMunch "Writing your own OS": Yes. Fun stuff. |
13:59:47 | PMunch | Oh indeed |
13:59:54 | ForumUpdaterBot | New question by mkrieger1: What is a simple and safe way to choose a random enum value?, see https://stackoverflow.com/questions/66842219/what-is-a-simple-and-safe-way-to-choose-a-random-enum-value |
14:00:08 | PMunch | Haven't tried doing it in Nim, but we had to write a small OS in C back in uni |
14:03:26 | FromGitter | <UrKr> I suppose I should do it with a case type... however that would mean all the fields would have to be namespaced because they repeat a lot |
14:04:02 | ozzz | wow, own kernel? will it be unix-like? |
14:05:29 | ozzz | PMunch, nice, and we ended with stdio.h |
14:05:46 | PMunch | ozzz, huh? |
14:06:50 | ozzz | yeah ) math was priority, and lecturer jumped to c++ |
14:07:25 | ozzz | seems he not knew C too much, and started to study what he knows better lol |
14:09:49 | PMunch | We went from the bottom up. Started writing our own bootloader that bootstrapped itself into the rest of our OS. By the end of it we had a multi-tasking OS that could run multiple small programs at the same time by doing context switching and such. Actually pretty cool |
14:09:53 | FromDiscord | <Goel> @PMunch Hello, i was having a look at your repo of Drawille-nim, i know its old but the examples all works, except the gameofLife. It gave me an error with the identifier "random" The module is imported correctly, i tried to replace `random()` in the code with `rand()` and also added an initialization `randomize()` . Now the example compiles without errors but i don't see anything on screen on my terminal |
14:09:58 | PMunch | Written in Assembly/C |
14:10:22 | PMunch | @Goel, hmm, give me a sec |
14:12:28 | PMunch | Try hitting `c` after you've started it |
14:12:50 | PMunch | That 'c'reates more life |
14:13:56 | PMunch | 'q'uit to exit out of the simulation and setting your terminal back correctly |
14:14:12 | ozzz | PMunch, but drivers, how you managed to work with hardware |
14:14:34 | PMunch | 's'ave to save a PNG "output.png" |
14:14:45 | PMunch | 'l'oad to load the image "input.png" |
14:14:55 | PMunch | 'p'ause to pause the simulation |
14:14:58 | FromDiscord | <Goel> @PMunch Yes now it works perfectly thanks |
14:15:18 | PMunch | 'f'orward to perform one step while paused |
14:15:38 | PMunch | ozzo, didn't really have any hardware interaction |
14:16:09 | PMunch | It set the output to terminal mode output, and I don't think you could interact with any of the programs (not 100% sure, might've had keyboard support) |
14:16:22 | ozzz | I got, you made it just for understanding concept of os |
14:16:38 | PMunch | Yup |
14:16:46 | PMunch | And context switching |
14:45:08 | FromDiscord | <jtiai> In reply to @PMunch "Haven't tried doing it": Nim works pretty fine. Irq caller routines I wrote in asm because it was easier that way. |
14:45:38 | PMunch | Yeah that's the stuff we wrote in assembly when we where doing C as well I believe |
14:48:41 | FromDiscord | <jtiai> I now do have basic console working and attempt to write libc for kernel itself so I could expand what I can use from Nim. |
14:52:11 | FromGitter | <deech> Is there a way to get the fully qualified name of a type using `getTypeInst()`? eg. if I have a type `MyType` in module `types` and I do `from types as t import nil` I'd like `..getTypeInst().repr` to print `t.MyType` instead of just `MyType`. |
14:58:14 | FromDiscord | <mratsim> maybe `owner` can give the module name |
14:58:55 | FromGitter | <deech> It does but not the aliased name, so it'll print `types` and not `t`. |
15:11:31 | * | abm joined #nim |
15:26:45 | FromDiscord | <sealmove> Is there a way to tell testament to put executables in a different directory? |
15:29:08 | FromGitter | <Bennyelg> After installing Nim from source - How i define the nimsuggest path in VSCode ? for auto completion ? |
15:29:26 | FromDiscord | <Yardanico> you don't need to do that, just add your nim binary folder to $PATH |
15:29:35 | FromDiscord | <Yardanico> in your system |
15:29:39 | FromGitter | <Bennyelg> I did |
15:29:42 | FromGitter | <Bennyelg> didn't work |
15:29:45 | FromDiscord | <Yardanico> then it should work |
15:29:47 | FromDiscord | <Yardanico> did you relogin or reboot? |
15:29:57 | FromDiscord | <Yardanico> and where did you put it? E.g. if you put it in ~/.profile VSCode might not see it |
15:30:01 | FromGitter | <Bennyelg> PATH=/Users/ABC/personal_workspace/Nim/bin |
15:30:05 | FromDiscord | <Yardanico> the best bet is to put it in /etc/profile or /etc/environment |
15:30:06 | FromGitter | <Bennyelg> ~/.zhsrc |
15:30:16 | FromDiscord | <Yardanico> yeah, that won't work unless you start `vscode` from the terminal |
15:30:17 | FromGitter | <Bennyelg> ~/.zshrc** |
15:30:23 | FromGitter | <Bennyelg> oh |
15:31:40 | FromGitter | <Bennyelg> didnt work too & the go to also :( |
15:31:47 | FromGitter | <Bennyelg> but when I compile and run it it works just fine |
15:32:10 | FromDiscord | <Yardanico> yes, because nimsuggest is used for go to definition as well |
15:32:22 | FromDiscord | <Yardanico> as I said, you need to add it to system-wide PATH so it works everywhere |
15:32:26 | FromGitter | <Bennyelg> donnu why the PATH edition didnt work |
15:32:33 | FromGitter | <Bennyelg> how I add system-wide PATH ? |
15:32:50 | FromDiscord | <Yardanico> https://apple.stackexchange.com/questions/33232/where-is-the-system-wide-path-shell-variable-set-in-os-x |
15:33:19 | FromDiscord | <Yardanico> /etc/environment usually |
15:33:30 | FromDiscord | <Yardanico> or rather /etc/profile |
15:33:38 | FromGitter | <Bennyelg> yea thanks trying now |
15:33:45 | FromDiscord | <Yardanico> and then you'll have to relogin or reboot |
15:38:00 | FromGitter | <Bennyelg> thanks that works |
15:42:10 | * | xet7 quit (Remote host closed the connection) |
15:43:22 | * | xet7 joined #nim |
15:45:57 | * | PMunch quit (Quit: leaving) |
15:54:15 | FromDiscord | <treeform> In reply to @Yardanico "for me with refc": How do you install `iface`? |
15:54:20 | FromDiscord | <Yardanico> github |
15:54:33 | FromDiscord | <Yardanico> nimble install https://github.com/yglukhov/iface or the same in the nimble file |
15:54:45 | FromDiscord | <treeform> oh I was trying to get this going: https://github.com/zielmicha/collections.nim/blob/master/collections/iface.nim |
15:54:49 | FromDiscord | <treeform> name collision! |
15:54:52 | FromDiscord | <Yardanico> xd |
15:56:45 | FromDiscord | <treeform> wow arc is a lot faster on this benchmark |
15:58:51 | FromDiscord | <Yardanico> exactly, that's why I was confused |
16:00:58 | FromDiscord | <treeform> Just using if statement appears to be a little faster then case object... but not statistically significant. |
16:01:15 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=2UnB |
16:01:39 | FromDiscord | <Yardanico> yeah so I was wondering if my benchmark is wrong since with arc all types of dispatch except methods are much faster |
16:02:30 | FromDiscord | <Yardanico> methods' slowness is actually noticeable when you call a method thousands of times a second |
16:02:59 | FromDiscord | <Yardanico> I PR'd to https://github.com/def-/nimes to replace methods with streams-like "interfaces" to make it do 60FPS on ARC as it did with refc |
16:03:08 | FromDiscord | <Yardanico> (of course streams-like interfaces are faster than methods even with refc) |
16:04:07 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
16:05:03 | * | Gustavo6046 joined #nim |
16:06:02 | saem | Seems weird that the dispatch difference would be so high, between ARC and refc |
16:06:13 | FromDiscord | <dom96> Sounds like we should get rid of methods from the language |
16:06:23 | FromDiscord | <Yardanico> well methods with arc are slower because of string comparisons as I said @saem |
16:06:43 | FromDiscord | <Yardanico> they check which method to call by strstr |
16:06:50 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/system/arc.nim#L232 |
16:07:40 | FromDiscord | <treeform> oh wow that sounds python kind of slow |
16:07:53 | FromDiscord | <treeform> function pointers to closures appear to be the fastest |
16:08:00 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/compiler/ccgexprs.nim#L1574 |
16:08:21 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=2UnD |
16:08:42 | FromDiscord | <Yardanico> how can they be faster than case objects? 🤔 |
16:09:28 | FromDiscord | <Yardanico> anyway, I'm doing more memory leak debugging for nim's SSL rn |
16:09:41 | FromDiscord | <Yardanico> Fixed one in https://github.com/nim-lang/Nim/pull/17554 and checking another one rn |
16:09:53 | FromDiscord | <treeform> My hypothesis is that function call always does a pointer indirection. With case/if objects you do a check and then call a function by pointer. With a pointer you just call a function by pointer... |
16:09:59 | FromDiscord | <Yardanico> oh |
16:10:25 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2UnF |
16:11:01 | FromDiscord | <dom96> @Yardanico amazing that you're doing this, thank you 🙂 |
16:11:04 | saem | Methods are great when you need them, their utility is likely to increase dramatically over time. The principles themselves are sound, the rest is implementation. |
16:12:01 | FromDiscord | <dom96> saem: the reason I said the above is because my assumption is that methods can be relatively easily implemented outside the compiler |
16:13:03 | saem | I don't think so, type information and directed dispatch is painful to do outside. The current implementation and sophistication of it in ARC, sure. But otherwise... Ouch |
16:15:56 | saem | I gave trying to get CPS moving yesterday and it was a very humbling reminder as to what it's like for the user to do that kinda stuff. |
16:16:41 | FromDiscord | <Yardanico> wait lol, I think the leak might be in the same checkCertName proc as the previous one |
16:16:55 | FromDiscord | <Yardanico> https://www.openssl.org/docs/man1.1.1/man3/SSL_get_peer_certificate.html |
16:16:55 | FromDiscord | <Zachary Carter> gave or gave up? haha |
16:17:01 | FromDiscord | <Yardanico> "The X509 object must be explicitly freed using X509_free()." |
16:17:06 | FromDiscord | <Yardanico> and we don't do that :P |
16:17:24 | FromDiscord | <Yardanico> I don't even see X509_free in our openssl wrapper |
16:17:27 | FromDiscord | <Zachary Carter> I don't know how we miss stuff like this - it's probably laziness |
16:17:41 | FromDiscord | <Zachary Carter> this is a pattern in like every C library haha |
16:18:01 | saem | Past tense, because I gave up on that very specific implementation path, but that implementation has a ton of key lessons. |
16:18:11 | FromDiscord | <Zachary Carter> Cool 🙂 |
16:18:25 | * | FromDiscord quit (Remote host closed the connection) |
16:18:42 | * | FromDiscord joined #nim |
16:19:00 | saem | Nim wrapping C is still C and fraught with all the dangers thereof. |
16:19:56 | FromDiscord | <Zachary Carter> No I get that - it's just I know whenever I am writing Nim that relies on some C, if I forget to free some allocation it's because I said to myself "I'll add that later" and I never do ;P |
16:20:07 | FromDiscord | <Zachary Carter> but the fact that I need to do it - is very obvious |
16:20:20 | FromDiscord | <Zachary Carter> because I had to perform an allocation in the first place \ |
16:20:22 | FromDiscord | <Zachary Carter> (edit) removed "\" |
16:20:34 | FromDiscord | <Zachary Carter> or call some initialization method or something in the library |
16:20:49 | FromDiscord | <Zachary Carter> but yeah - it happens |
16:21:11 | FromDiscord | <dom96> Not everybody has the same amount of experience as others when it comes to C, it's likely not immediately obvious to most that they need to free something and SSL docs are themselves crap so it adds to the complexity |
16:21:14 | saem | Hmm |
16:21:31 | FromDiscord | <Yardanico> I'm really not sure but the leak only happens under valgrind 🤔 |
16:21:55 | FromDiscord | <Zachary Carter> what else have you tested with? |
16:22:13 | FromDiscord | <Yardanico> if you mean the memory profiling tools, none yet, but I'll test with heaptrack |
16:22:33 | FromDiscord | <Zachary Carter> In reply to @dom96 "Not everybody has the": good point |
16:22:53 | FromDiscord | <Zachary Carter> In reply to @Yardanico "if you mean the": another useful test might be running asan on macOS |
16:23:02 | FromDiscord | <Yardanico> well I can use asan on Linux as well :) |
16:23:07 | FromDiscord | <Zachary Carter> oh true |
16:24:10 | federico3 | also, interactions between Nim's GC and destructors in C libraries can be confusing |
16:24:55 | FromDiscord | <Yardanico> I don't see any destructors/finalizers used for PX509 though? |
16:25:00 | FromDiscord | <Yardanico> but yeah, it's weird that the leak only happens under valgrind |
16:25:25 | FromDiscord | <Yardanico> or maybe it's because without valgrind openssl malloc'd memory is not part of the virt/rss memory in htop? |
16:26:36 | FromDiscord | <flywind> hi @Yardanico what's the state of this issue? does my fix work? https://github.com/nim-lang/Nim/issues/17370 |
16:28:40 | FromDiscord | <Yardanico> @flywind sorry, I havne' |
16:28:49 | FromDiscord | <Yardanico> haven't looked into it yet, need to set up an older macOS VM :( |
16:28:57 | FromDiscord | <Yardanico> About the leak - after adding X509_free it goes away |
16:29:09 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2UnK |
16:29:13 | FromDiscord | <Yardanico> much better than before - nothing indirectly lost |
16:29:23 | FromDiscord | <Yardanico> the 610kb is the global SSL context |
16:29:31 | FromDiscord | <Rika> nice |
16:31:35 | FromDiscord | <Yardanico> that 315 bytes is the leak that I already fixed |
16:31:46 | FromDiscord | <Yardanico> so we only have "possibly lost" 56 bytes in a single block |
16:31:55 | FromDiscord | <Yardanico> which doesn't grow with more reqs so it's not as bad |
16:32:28 | FromDiscord | <flywind> good job! I saw the leaks before but didn't look into it. |
16:39:03 | FromDiscord | <Yardanico> well debugging memory leaks like that isn't exactly hard, it just might take some amount of time :P |
16:39:10 | FromDiscord | <Yardanico> but it's satisfying when you don't see any leaks in the end |
16:41:20 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/17558 |
16:42:52 | FromDiscord | <dom96> I wonder if we should invest in some tests for these |
16:43:10 | FromDiscord | <dom96> in fact, it might be good to run valgrind for all tests that run on arc |
16:47:01 | * | azed joined #nim |
16:49:12 | FromDiscord | <Yardanico> with my PR clang's leak sanitizer (fsanitize=leak) is happy and doesn't error when doing HTTPS requests |
16:50:21 | FromDiscord | <Yardanico> but I'm still confused as to why memory usage of the process wasn't growing in htop |
16:50:33 | FromDiscord | <Yardanico> I know OpenSSL uses its own memory allocation functions, but they still should count towards RSS, no? |
16:55:56 | * | azed quit (Read error: Connection reset by peer) |
16:57:07 | * | teasea quit (Quit: teasea) |
16:59:12 | * | teasea joined #nim |
16:59:53 | * | sixtyten quit (Quit: Leaving) |
17:03:14 | FromDiscord | <TurtleP> Hi, so I'm working on a piece of code that converts a png to a special format. I kind of have it working, but the issue is translating the code from C to nim. I'm stuck on line 17 of this pastebin <https://pastebin.com/FCFjSEjN> since the original code is a pointer to a pointer after indexing (iirc). This is the C code: <https://github.com/devkitPro/3dstools/blob/master/src/smdhtool.cpp#L360>. I'm not sure how to go about doing this and a |
17:04:56 | FromDiscord | <Yardanico> in this case you'll have to use an UncheckedArray I think |
17:05:24 | FromDiscord | <Yardanico> also I've seen someone done the same stuff recently |
17:05:32 | FromDiscord | <Yardanico> you need to convert a PNG to a windows icon, right? |
17:05:38 | FromDiscord | <TurtleP> no, it's a different format |
17:05:52 | FromDiscord | <TurtleP> it's tiling an image for 3DS homebrew |
17:09:10 | * | fputs joined #nim |
17:10:05 | * | Onionhammer8 joined #nim |
17:11:32 | * | Onionhammer quit (Ping timeout: 246 seconds) |
17:11:32 | * | Onionhammer8 is now known as Onionhammer |
17:27:04 | FromDiscord | <TurtleP> In reply to @Yardanico "in this case you'll": Hm.. tried to look at the docs on how to apply it here, although I'm still lost :/ |
17:27:17 | FromDiscord | <TurtleP> it wouldn't let me turn it into an UncheckedArray |
17:28:10 | * | wasted_youth2 quit (Ping timeout: 258 seconds) |
17:28:31 | * | stefantalpalaru quit (Quit: ZNC 1.7.5 - https://znc.in) |
17:29:57 | * | wasted_youth2 joined #nim |
17:31:44 | * | azed joined #nim |
17:35:37 | * | hsh_ quit (Quit: Connection closed for inactivity) |
17:37:01 | * | stefantalpalaru joined #nim |
17:38:10 | * | lritter quit (Quit: Leaving) |
17:42:44 | FromGitter | <Bennyelg> Someone had this before ? ⏎ ERROR: Unable to start debugging. GDB exited unexpectedly with exit code 134 (0x86). |
17:43:02 | * | stefantalpalaru quit (Changing host) |
17:43:02 | * | stefantalpalaru joined #nim |
17:44:23 | FromDiscord | <Yardanico> i think that you should search in google, that error seems to be specific to gdb in vscode on macos |
17:48:23 | * | D_ quit (Remote host closed the connection) |
17:49:03 | * | D_ joined #nim |
17:51:12 | reversem3 | anyone programming on arduino using nim ? |
17:54:17 | FromDiscord | <dom96> sure, join #nim-embedded if you haven't already 🙂 |
17:56:05 | reversem3 | thanks |
17:58:54 | FromDiscord | <Yardanico> no one even in the ##openssl freenode channel replied to me about the memory usage |
17:59:07 | FromDiscord | <Yardanico> maybe somehow the leak doesn't occur when not running under valgrind? |
18:02:05 | ForumUpdaterBot | New thread by Chaemon: Strange behavior (Bug?) of member-iterator of object, see https://forum.nim-lang.org/t/7712 |
18:07:38 | FromDiscord | <Zachary Carter> @TurtleP - does this work? https://play.nim-lang.org/#ix=2Uoe |
18:08:18 | FromDiscord | <Zachary Carter> sorry https://play.nim-lang.org/#ix=2Uof |
18:08:21 | FromDiscord | <Zachary Carter> just updated it |
18:15:05 | FromDiscord | <TurtleP> @Zachary Carter will check soon |
18:29:14 | FromDiscord | <TurtleP> @Zachary Carter sorry for the double ping, but I get this now: https://media.discordapp.net/attachments/371759389889003532/825798699833491517/unknown.png |
18:37:12 | FromDiscord | <Yardanico> ok apparently I'm still sane |
18:37:25 | FromDiscord | <Yardanico> and yes that code leaked even with refc, it's just that it leaks like 5kb per request so it's not easily noticeable |
18:38:06 | FromDiscord | <Yardanico> running a while true loop of a request makes memory usage grow |
18:41:49 | FromDiscord | <Zachary Carter> @TurtleP did you see my change to where image was declared? |
18:41:52 | FromDiscord | <Zachary Carter> you need a `var` not a `let` |
18:42:02 | FromDiscord | <TurtleP> ah |
18:43:07 | FromDiscord | <Yardanico> @Zachary Carter wouldn't that code be getting an addr of an uint8 though? |
18:43:17 | FromDiscord | <Yardanico> sorry, uint16 |
18:43:21 | FromDiscord | <Yardanico> with image[xxx] you get an uint16 and then try to get addr of it |
18:43:47 | FromDiscord | <Zachary Carter> Well I don't think PNGs are 16bpp |
18:43:56 | FromDiscord | <Yardanico> I'm talking about the code |
18:44:07 | FromDiscord | <Zachary Carter> yeah so the image should probably be a seq of uint8 right? |
18:44:19 | FromDiscord | <Yardanico> it's uint16 there, and anyway, my point is - you'll be getting an addr of a local int |
18:44:27 | FromDiscord | <Yardanico> not the position from the seq |
18:45:19 | FromDiscord | <Zachary Carter> I see what you mean |
18:45:21 | FromDiscord | <Yardanico> shouldn't it be something like cast[ptr UncheckedArray[uint8]](addr image[4 (48 (y + yy) + (x + xx))]) |
18:45:39 | FromDiscord | <Yardanico> ah actually this is the same, yeah, lol |
18:45:47 | FromDiscord | <Zachary Carter> it is yeah |
18:45:48 | FromDiscord | <Yardanico> i'm still confused though, need actual code to try :P |
18:45:58 | FromDiscord | <Zachary Carter> you probably want a slice of the original sequence |
18:46:12 | FromDiscord | <Zachary Carter> starting from whatever index `4 (48 (y + yy) + (x + xx))` evaluates to |
18:46:19 | FromDiscord | <Zachary Carter> because you're index from there |
18:46:57 | FromDiscord | <Yardanico> well then your code is right, and mine too |
18:47:26 | FromDiscord | <Zachary Carter> yeah I think it's right |
18:54:00 | * | azed quit (Quit: WeeChat 3.1) |
19:13:53 | FromDiscord | <Yardanico> ok, after that PR no leaks for simple https requests, only "still reachable" and "possibly reachable" which are a part of the global SSL context |
19:14:27 | ForumUpdaterBot | New thread by Zetashift: Neovim users, how are you setting up Nim?, see https://forum.nim-lang.org/t/7713 |
19:21:30 | FromDiscord | <Yardanico> damn ssl surely takes time |
19:23:13 | FromDiscord | <Yardanico> I know that benchmarks shouldn't really be done on IO because of network latency and stuff, but |
19:23:20 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2UoJ |
19:23:28 | FromDiscord | <Yardanico> https request takes ~2.5 more time to complete |
19:42:00 | FromDiscord | <Mustache Man> there's a problem with the solution provided to me here: https://play.nim-lang.org/#ix=2Ujh |
19:42:21 | FromDiscord | <Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2UoN |
19:43:15 | FromDiscord | <Mustache Man> the callback is dependent on the index i, but i keeps being incremented, so n.network.nodes[i] is always the last node in the sequence |
19:45:04 | FromDiscord | <Yardanico> classical closure issue :) |
19:45:05 | FromDiscord | <Yardanico> use closureScope |
19:45:18 | FromDiscord | <Yardanico> or rather capture |
19:45:18 | FromDiscord | <Yardanico> https://nim-lang.org/docs/sugar.html#capture.m%2Cvarargs%5Btyped%5D%2Cuntyped |
19:45:51 | FromDiscord | <Yardanico> something like that I guess |
19:45:54 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2UoO |
19:46:01 | FromDiscord | <Yardanico> also not(receiver == n) is the same as receiver != n |
19:47:04 | FromDiscord | <Mustache Man> perfect! |
19:47:39 | FromDiscord | <Mustache Man> sometimes nim feels so high-level that the low-level gotchas are surprising |
19:48:17 | FromDiscord | <Mustache Man> like i was really thrown off by a segfault after i forgot the [type] after a cast |
19:48:37 | FromDiscord | <Yardanico> wait why cast? |
19:48:43 | FromDiscord | <Yardanico> in most cases a conversion should be fine |
19:49:09 | FromDiscord | <Yardanico> e.g. if you want to convert an inherited object to its base type you simply do BaseObj(myobj) not cast[BaseObj](myobj) |
19:49:25 | FromDiscord | <Mustache Man> other way around though |
19:49:31 | FromDiscord | <Yardanico> it still should work |
19:50:36 | FromDiscord | <Mustache Man> oh how does it look to convert a parent into a child object |
19:51:32 | FromDiscord | <Mustache Man> oh nvm |
19:51:47 | FromDiscord | <Mustache Man> (edit) "nvm" => "nvm, i misread" |
19:51:56 | FromDiscord | <Mustache Man> (edit) "misread" => "misread. thank you, that will clean up some code for sure" |
19:55:25 | * | xet7 quit (Remote host closed the connection) |
20:07:09 | FromDiscord | <Yardanico> any thoughts on https://github.com/nim-lang/RFCs/issues/356 ? |
20:09:23 | FromDiscord | <haxscramper> Looks nice, but as you already mentioned in comments it can be done in three different ways already |
20:09:50 | FromDiscord | <Yardanico> well that's nim for you :D |
20:10:12 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Up0 |
20:10:17 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Up1 |
20:10:21 | Prestige | In the case statement example, wouldn't that already return a value without having `return` there? |
20:10:25 | FromDiscord | <Yardanico> (edit) "https://play.nim-lang.org/#ix=2Up1" => "https://play.nim-lang.org/#ix=2Up2" |
20:10:38 | FromDiscord | <haxscramper> yes, `of <expr>: value` returns |
20:10:50 | FromDiscord | <Yardanico> only when the case statement is exhaustive and there's an matching else (for if) with another branch |
20:10:53 | FromDiscord | <Yardanico> i mean as of now |
20:10:56 | FromDiscord | <haxscramper> If all branches are either expression of the same type or contain `{.noreturn.}` |
20:11:20 | FromDiscord | <haxscramper> I can do one branch with `raise/quit/return` and all others into expression |
20:11:36 | FromDiscord | <haxscramper> `break/continue` works too I think, but I don't remember correctly |
20:12:25 | FromDiscord | <Yardanico> I don't think they work since they are not noreturn |
20:12:41 | FromDiscord | <haxscramper> In reply to @Yardanico "It's actually 4 since": I'd much rather vote for `return block:` to work |
20:16:18 | FromDiscord | <Yardanico> on an unrelated note, I really like how google's closure-compiler works with Nim's JS output |
20:16:34 | FromDiscord | <Yardanico> sadly it breaks sometimes, or throws away all JS code |
20:17:48 | FromDiscord | <Yardanico> for dochack.nim with js -d:danger closure compiler makes this file: `Math.trunc||(Math.trunc=function(a){a=+a;return isFinite(a)?a-a%1||(0>a?-0:0===a?a:0):a});` :D |
20:18:02 | FromDiscord | <Yardanico> I guess because functions from dochack aren't used anywhere in the file itself |
20:18:57 | FromDiscord | <Yardanico> "When you compile functions without compiling the code that calls those functions, the Compiler assumes that the functions are never called and removes them." |
20:20:26 | FromDiscord | <Yardanico> well it can be fixed with https://developers.google.com/closure/compiler/docs/api-tutorial3#removal |
20:22:53 | * | haxscramper quit (Remote host closed the connection) |
20:23:21 | * | haxscramper joined #nim |
20:23:22 | * | haxscramper quit (Read error: Connection reset by peer) |
20:27:02 | * | vicfred joined #nim |
20:36:35 | ForumUpdaterBot | New thread by JohnAD: Converting a hex string to uint32 in JS context, see https://forum.nim-lang.org/t/7714 |
20:50:20 | FromDiscord | <dom96> @Yardanico yeah, you need to export the functions you want it to keep |
20:50:31 | FromDiscord | <Yardanico> simple `export` didn't work though :) |
20:50:44 | FromDiscord | <Yardanico> export function xxx ... |
20:51:36 | FromDiscord | <Yardanico> also I don't get why we add stdlib modules which are hidden under defines anyway - https://github.com/nim-lang/Nim/pull/12531 |
20:51:48 | FromDiscord | <Yardanico> so to use https://nim-lang.github.io/Nim/jsfetch.html you must `import std/jsfetch` and also `-d:nimExperimentalJsfetch` |
20:51:50 | FromDiscord | <Yardanico> why?... |
20:55:48 | FromDiscord | <Yardanico> I mean I understand that the purpose is to show people that the module is "experimental", but isn't putting a warning when compiling or a warning in the module docs enough? |
21:02:25 | FromDiscord | <dom96> I don't get why we're not creating nimble packages first... |
21:13:57 | FromDiscord | <Zachary Carter> is it possible to grab a slice from an unchecked array? |
21:14:09 | FromDiscord | <Yardanico> I think so |
21:14:09 | FromDiscord | <Zachary Carter> or is `toOpenArray` the only way? |
21:14:26 | FromDiscord | <Yardanico> toOpenArray works on an unchecked array :) |
21:14:28 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#toOpenArray%2Cptr.UncheckedArray%5BT%5D%2Cint%2Cint |
21:14:29 | FromDiscord | <Zachary Carter> getting some weird errors regarding out of bounds exceptions |
21:14:50 | FromDiscord | <Zachary Carter> I know it does but seq.add with toOpenArray on my unchecked array is producing some out of bounds exception and I don't understand why |
21:32:19 | FromDiscord | <Zachary Carter> figured out what I was doing wrong |
21:52:53 | * | tane quit (Quit: Leaving) |
22:04:48 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2UpG |
22:10:35 | FromDiscord | <ElegantBeef> Yea this seems sensible, if the goal is supporting all the backends where one can |
22:11:14 | * | blackpawn quit (Remote host closed the connection) |
22:12:45 | * | blackpawn joined #nim |
22:13:26 | FromDiscord | <dom96> `when defined(js): import jshttpclient else: import httpclient` |
22:14:05 | FromDiscord | <dom96> I don't think it should be in the stdlib yet |
22:34:26 | FromDiscord | <Yardanico> i wonder if it's somehow possible to get the instantiationInfo of where a converter was placed by the compiler? |
22:34:40 | FromDiscord | <Yardanico> so e.g. I can add a hint/warning which will point to the line where the converter was used |
22:36:12 | FromDiscord | <Yardanico> ` jq(".blob-code-inner").each do (idx: int, elem: Element):` oh boy |
22:42:08 | * | PMunch joined #nim |
22:44:41 | * | Vladar quit (Quit: Leaving) |
22:50:46 | * | oz quit (Ping timeout: 245 seconds) |
22:58:45 | * | xet7 joined #nim |
23:16:05 | * | oz joined #nim |
23:25:39 | * | oz quit (Ping timeout: 246 seconds) |