00:00:10 | FromDiscord | <retkid> In reply to @Elegantbeef "so if you do": I specifically wanna read between two bytes |
00:00:22 | FromDiscord | <Elegantbeef> Yes i know |
00:00:30 | FromDiscord | <Elegantbeef> You set position then read |
00:03:12 | FromDiscord | <retkid> I don' |
00:03:18 | FromDiscord | <retkid> (edit) "don'" => "don't see how readData is any different" |
00:03:37 | FromDiscord | <Elegantbeef> It takes an address of data and a length |
00:04:10 | FromDiscord | <Elegantbeef> so say you want to read to a sequence you can do `var mySeq = newSeq[byte](30); myStream.readData(mySeq[0], 30)` |
00:04:16 | FromDiscord | <retkid> but the length is arbitrary and can be bigger than the size of the strea, |
00:04:22 | FromDiscord | <retkid> (edit) "strea," => "stream" |
00:04:45 | FromDiscord | <Elegantbeef> How can you read more data then a stream has? |
00:05:50 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/976636762963202048/unknown.png |
00:06:01 | FromDiscord | <Elegantbeef> Yes |
00:06:07 | FromDiscord | <Elegantbeef> That's a programmer bug |
00:06:27 | FromDiscord | <retkid> but it reads 2048 bytes and not 1024 |
00:06:35 | FromDiscord | <Elegantbeef> No it doesnt |
00:06:47 | FromDiscord | <retkid> buffer == 2048 |
00:06:53 | FromDiscord | <retkid> or would it cut off at 1024 |
00:06:53 | FromDiscord | <Elegantbeef> So fucking what |
00:06:57 | FromDiscord | <Elegantbeef> It decays to `pointer` |
00:07:07 | FromDiscord | <retkid> dont be mad i just don |
00:07:16 | FromDiscord | <retkid> (edit) "don" => "don't understand 🥺" |
00:08:18 | FromDiscord | <retkid> alright i understand |
00:08:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y7d |
00:08:31 | FromDiscord | <retkid> if the buffer is bigger than the reading size it just outputs null |
00:08:35 | FromDiscord | <Elegantbeef> It reads up to `len` |
00:08:45 | FromDiscord | <Elegantbeef> It returns how many bytes read |
00:09:00 | FromDiscord | <Elegantbeef> No |
00:09:00 | FromDiscord | <Elegantbeef> If the buffer is bigger than the read data it doesnt touch it |
00:09:05 | FromDiscord | <Elegantbeef> It only writes between `0..1024` |
00:10:06 | FromDiscord | <huantian> can I handle sigterms? |
00:10:39 | FromDiscord | <Elegantbeef> Maybe with a user defined signal handle but i doubt it |
00:16:31 | * | tiorock joined #nim |
00:16:31 | * | tiorock quit (Changing host) |
00:16:32 | * | tiorock joined #nim |
00:16:32 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
00:16:32 | * | tiorock is now known as rockcavera |
00:19:53 | FromDiscord | <morgan> i think you can catch some |
00:20:00 | FromDiscord | <morgan> idr which can and can’t |
00:20:19 | FromDiscord | <morgan> i think 9 can’t be caught or delayed but idr what it’s name is |
00:20:23 | FromDiscord | <Zectbumo> I'm having trouble compiling koch. With a weird message saying that "both" is ambiguous with itself??↵`"/tmp/Nim/tools/kochdocs.nim(60, 37) Error: ambiguous call; both strutils.replace(s: string, sub: string, by: string) [func declared in /usr/local/lib/nim/pure/strutils.nim(2079, 6)] and strutils.replace(s: string, sub: string, by: string) [func declared in /tmp/Nim/lib/pure/strutils.nim(2079, 6)] match for: (string, string, string)` |
00:21:19 | FromDiscord | <huantian> In reply to @MorganAlyssa "i think 9 can’t": yeah SIGKILL is insta death |
00:22:01 | FromDiscord | <huantian> In reply to @Zectbumo "I'm having trouble compiling": look at the two paths |
00:22:52 | FromDiscord | <Zectbumo> In reply to @huantian "look at the two": oh thank you. I didn't see the /usr/local part |
00:23:59 | FromDiscord | <Zectbumo> so, how to compile koch if it's going to conflict? |
00:26:16 | FromDiscord | <Zectbumo> I was promised "simple" ↵'''Compiling the compiler is a simple matter of running:''' |
00:27:14 | FromDiscord | <huantian> Hm I never had this error when running build-all.sh or whatever |
00:33:52 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Y7g |
00:34:05 | FromDiscord | <Zectbumo> that was on HEAD |
00:35:32 | FromDiscord | <Zectbumo> same errors checking out v1.6.6 andv1.6.4 😞 |
00:56:24 | NimEventer | New post on r/nim by EnrikeChurin: Is that possible to use a Nim compiler in the browser?, see https://reddit.com/r/nim/comments/usrfkb/is_that_possible_to_use_a_nim_compiler_in_the/ |
01:42:26 | FromDiscord | <retkid> @ElegantBeef |
01:42:52 | FromDiscord | <retkid> i keep getting segfaults when i read fromthe stream |
01:42:56 | FromDiscord | <retkid> (edit) "fromthe" => "from the" |
01:42:58 | FromDiscord | <retkid> ? |
01:48:49 | FromDiscord | <Elegantbeef> What's the code |
01:50:06 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/976663002994585630/unknown.png |
01:50:21 | FromDiscord | <Elegantbeef> `buffybuffy[0].addr` |
01:50:33 | FromDiscord | <Elegantbeef> you're writing over the stack with `addr buffybuffy` |
01:50:43 | FromDiscord | <retkid> >:O |
01:51:09 | FromDiscord | <retkid> works like a charm |
01:51:10 | FromDiscord | <retkid> lmao |
02:17:28 | FromDiscord | <resumin> I just want to say, I appreciate you on here, ElegantBeef. good night |
02:17:56 | FromDiscord | <Elegantbeef> Shit how do i make a self deprecating response to that |
02:17:59 | FromDiscord | <Elegantbeef> Uhhhhh |
02:19:45 | FromDiscord | <retkid> In reply to @Elegantbeef "Shit how do i": appreciate you being here for us to CLOWN ON |
02:19:57 | FromDiscord | <retkid> fucking nerd |
04:05:52 | * | noeontheend joined #nim |
04:51:48 | * | noeontheend quit (Ping timeout: 244 seconds) |
06:22:35 | * | PMunch joined #nim |
06:37:47 | * | xet7 quit (Quit: Leaving) |
06:47:52 | * | Arrrrrrr joined #nim |
06:52:57 | * | ltriant quit (Ping timeout: 260 seconds) |
06:58:31 | om3ga | Yardanico, I think I found the reason |
07:00:05 | om3ga | C compiler with enabled optimisation executes if-else, and other blocks separately |
07:01:16 | om3ga | I forgot how it called, but all declared vars in that blocks are not accessible afte, inline optimisation maybe if I'm not wrong |
07:02:08 | om3ga | so that may cause that issues definitely |
07:05:14 | om3ga | yeah.. looks like that, just right now I passed -fno-inline-functions, and it again crashes |
07:05:59 | om3ga | but not the compact version of the code, I will examine it |
07:13:37 | * | xet7 joined #nim |
07:16:17 | PMunch | "cat futhark_FCE8A8C7A4AF7C7B.nim | wc -l": 113723 |
07:16:27 | PMunch | I'm so glad I'm not wrapping this stuff by hand :P |
07:18:33 | FromDiscord | <Elegantbeef> Would be a lot cooler if you did 😛 |
07:18:57 | FromDiscord | <Elegantbeef> "I wrapped a lot of code instead of using a tool i made to do it for me AMA" |
07:26:49 | FromDiscord | <Rika> Doesn’t your tool generate multiples larger code than by hand anyway |
07:27:05 | FromDiscord | <Elegantbeef> it does indeed |
07:28:30 | PMunch | Yes it generates a whole bunch of extra lines |
07:28:43 | PMunch | Still, I'm wrapping GTK and GTKWebView |
07:28:49 | PMunch | And it takes me seconds |
07:32:04 | FromDiscord | <Elegantbeef> Dont lie the wrapping has just begun |
07:32:46 | FromDiscord | <Elegantbeef> Unless you're actually using gtk's capi directly i guess |
07:34:23 | PMunch | I am |
07:36:16 | om3ga | awesome, I fixed all declarations appropriately, and now --opt:speed works with it too |
07:37:49 | om3ga | but why withLock and try: except: could be the problem? what do you think? |
07:42:49 | om3ga | it might be inline related things I think |
08:12:20 | * | jmdaemon quit (Ping timeout: 272 seconds) |
08:22:02 | FromDiscord | <voidwalker> need some spoondfeeding kind of guidance for correctly defining a data structure I need, please. It's like this: |
08:22:14 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=3Y88 |
08:23:18 | FromDiscord | <Elegantbeef> Use the object variant i gave you last time |
08:23:24 | FromDiscord | <voidwalker> Row is fixed size array (10 columns/entries) of strings/ints/char. I understand I can implement this with an object variant.. yes |
08:23:27 | FromDiscord | <Elegantbeef> You cannot have heterogenous arrays |
08:23:53 | FromDiscord | <voidwalker> Yes elegantbeef, that part I understood. But the next part with generic types.. nope, stuck there conceptually |
08:24:12 | FromDiscord | <voidwalker> Because I need various lengths for the number of rows per table |
08:24:13 | FromDiscord | <Elegantbeef> Well ask the questions! 😄 |
08:24:43 | FromDiscord | <voidwalker> I spent a few hours trying to figure it out, read some more of that nim in action book, but didn't get to that chapter yet : D |
08:26:22 | FromDiscord | <Rika> If you don’t know how many rows per table on compile time just use another seq again |
08:26:26 | FromDiscord | <voidwalker> qusetion is, can you please show me, and explain to me (like to someone who never used generics and nim before), how you define a data type that is basically a 2d array (table), that can have variable number of "rows" (otherwise much memory wasted) |
08:26:52 | FromDiscord | <voidwalker> Some "projects" might have a table with 10 rows, otheres maybe as much as 10.000 |
08:27:28 | FromDiscord | <Rika> Are they known on compile time or do they change on runtime |
08:27:40 | FromDiscord | <Elegantbeef> It's static |
08:27:43 | FromDiscord | <voidwalker> it's supposed to end up a webapp, user submitted, so runtime |
08:27:55 | FromDiscord | <Elegantbeef> Oh you lied to me last time 😄 |
08:28:03 | FromDiscord | <voidwalker> Surely not on purpose ? |
08:28:09 | FromDiscord | <voidwalker> Why would I sabotage my own efforts lol |
08:28:32 | FromDiscord | <Elegantbeef> I'm just joking of course |
08:28:38 | FromDiscord | <Rika> I don’t know maybe you’re dual personality |
08:28:41 | FromDiscord | <voidwalker> Ok so Rika's option makes sense, that's what I did in the old project. A seq of Tables, and each table a seq of rows |
08:28:45 | FromDiscord | <Elegantbeef> I have a bitch of a headache so hopefully rika can help |
08:29:28 | FromDiscord | <Rika> I injured myself badly a few minutes ago so maybe |
08:30:17 | FromDiscord | <voidwalker> a sip of coffee and a walk is what i'd do for headaches |
08:30:52 | FromDiscord | <voidwalker> `type Table[Columns: static int] = distinct array[Columns, Row]` |
08:31:09 | FromDiscord | <Elegantbeef> The distinct was optional iirc |
08:31:39 | FromDiscord | <voidwalker> This is what you proposed last time elegantbeef. Which I didn't understood. |
08:31:49 | FromDiscord | <voidwalker> explain like i'm 5 ? : D |
08:32:02 | FromDiscord | <Elegantbeef> Well this was under the notion that you the columns statically |
08:32:07 | FromDiscord | <Rika> It’s a table where you can specify the amount of columns on compile time only |
08:32:07 | FromDiscord | <Elegantbeef> you knew the columns |
08:32:08 | FromDiscord | <voidwalker> Ohhhhh |
08:32:21 | FromDiscord | <Elegantbeef> Since you do not this is worthless to you |
08:32:30 | FromDiscord | <voidwalker> fml, so I spent a few hours trying to understand something which wouldn't have been of use to me anyway. nice : d |
08:32:31 | FromDiscord | <Elegantbeef> a `seq[Row]` will have to do |
08:32:50 | FromDiscord | <Elegantbeef> Sorry, but given what you said it's what i thought would work |
08:33:32 | FromDiscord | <voidwalker> sent a code paste, see https://paste.rs/oPL |
08:33:44 | FromDiscord | <Elegantbeef> Yea i took that as "I know it at compile time" |
08:33:55 | FromDiscord | <Elegantbeef> Not "I know the length at runtime before i make the table" |
08:34:16 | FromDiscord | <voidwalker> oh ok, glad i can move on with my life and not reinvent the wheel |
08:34:26 | FromDiscord | <voidwalker> I was sure nim had some more clever way of doing this, vs the obvious |
08:35:02 | FromDiscord | <Elegantbeef> Well just do `newSeq[Row](columns)` on creation and you're golden |
08:35:08 | PMunch | @Rika, you injured yourself badly a few minutes ago? |
08:35:22 | PMunch | This sounds like a bash.org level "my house is on fire brb" scenario :P |
08:35:41 | FromDiscord | <Rika> I’m not bleeding but I can’t walk properly so yeah lol |
08:36:06 | PMunch | What did you do? |
08:36:48 | PMunch | I really wish there was some syntax sugar for variant types like this.. |
08:36:56 | FromDiscord | <Rika> I was cycling and pedal struck the ground, causing me to knee my bike frame and hit my chest onto the handle bars |
08:37:10 | FromDiscord | <Rika> I hurt my ass too but I don’t know how exactly other than it hit the saddle |
08:37:19 | PMunch | It would be neat to have `seq[int or float or string]` and then have that automatically be a variant object |
08:37:28 | FromDiscord | <Elegantbeef> use union |
08:37:34 | FromDiscord | <Elegantbeef> https://github.com/alaviss/union |
08:37:40 | PMunch | @Rika, ouch, that sucks.. |
08:41:06 | * | krux02 quit (Remote host closed the connection) |
09:07:32 | * | Arrrrrrr quit (Quit: Arrrrrrr) |
09:32:16 | FromDiscord | <voidwalker> sent a code paste, see https://paste.rs/HmJ |
09:32:45 | FromDiscord | <voidwalker> in this context, does it make sense for the 'project' to be ref object instead of object ? since it will only exist as an element of sequences containing it |
09:33:41 | FromDiscord | <Rika> do you need reference semantics |
09:34:53 | FromDiscord | <voidwalker> I don't know :-? |
09:43:38 | FromDiscord | <Phil> In reply to @voidwalker "I don't know :-?": Hmmm what other languages do you know so I can draw comparisons? |
09:43:47 | FromDiscord | <voidwalker> just pascal |
09:43:49 | FromDiscord | <Phil> Or is this your first? Then I'll throw in a code example |
09:44:00 | FromDiscord | <Phil> I never wrote pascal, code example it is |
09:44:16 | FromDiscord | <Phil> This'll be pseudocode, I don't have nim on this pc |
09:48:57 | FromDiscord | <Phil> Nevermind, turns out I have some missunderstanding as well, huh....↵Generally ref semantics mean you allocate an object on heap, non-ref semantics allocate stuff on the stack IIRC↵There's some ways it also affects how you manipulate objects but that appears to not work quite as I thought |
09:52:36 | FromDiscord | <voidwalker> `Since sequences are resizable they are always allocated on the heap and garbage collected` |
09:52:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Y8u |
09:53:05 | FromDiscord | <Phil> There you go |
09:53:19 | FromDiscord | <Phil> https://play.nim-lang.org/#ix=3Y8v |
09:54:52 | FromDiscord | <Phil> With ref semantics you copy around references to the same fundamental object. Helps keep object count down, java does this sort of thing a lot. In exchange they're stored in heap which is a smidge slower to access and work with in general. I'm not all that well versed in it, but that's what I kept in mind.↵↵With non-ref semantics you copy an object around a lot, but it happens in stack and is acted upon faster |
09:58:00 | FromDiscord | <Phil> In reply to @voidwalker "`Since sequences are resizable": Ohhh in that context. It doesn't really matter that the seq is a ref type on whether you should make the original object a ref type or not.↵At least to my knowledge. |
09:58:34 | FromDiscord | <Phil> All that matters is what behaviour you want on that object in general, ref semantics or no |
10:01:46 | FromDiscord | <voidwalker> well, since I will be moving the "Project" object from one sequence to another, and never have duplicates of it.. uh, I guess I will figure it out later |
10:02:40 | FromDiscord | <Phil> Sounds like you want ref types to me, anyone else feel free to correct me |
10:37:07 | * | ltriant joined #nim |
11:16:32 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=3Y8O |
11:22:36 | PMunch | Does that file exist? |
11:24:42 | FromDiscord | <Forest> Huh looking at it, no |
11:24:51 | FromDiscord | <Forest> despite running `nayget build` |
11:25:09 | PMunch | And that returned without errors? |
11:27:52 | FromDiscord | <Forest> nope, no errors at all |
11:28:00 | FromDiscord | <Forest> idk where the include dir could even be |
11:46:08 | FromDiscord | <Forest> just used git clone and that works after building |
11:48:28 | FromDiscord | <Forest> In reply to @Forest "anyone know why naylib": @planetis small issue with naylib, workaround is to just clone it instead of nible installing |
11:48:44 | FromDiscord | <Forest> cinclude dir isn't even generated with nimble method |
11:49:56 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=3Y8Q |
11:50:00 | FromDiscord | <planetis> relevant code segment |
11:50:15 | FromDiscord | <planetis> why it doesn't work? |
11:51:43 | FromDiscord | <planetis> just did a clean build, worked fine |
11:51:53 | FromDiscord | <Forest> In reply to @Forest "cinclude dir isn't even": there's no errors, but when checking the naylib dir in nimble pkgs, nothing besides the normal installation works |
11:52:02 | FromDiscord | <Forest> In reply to @planetis "just did a clean": Huh? That's odd |
11:52:14 | FromDiscord | <Forest> Oh, note that i'm using latest nimble devel |
11:54:03 | FromDiscord | <Forest> I'm also on Manjaro Linux |
11:54:06 | FromDiscord | <planetis> just tried with nimble |
11:54:15 | FromDiscord | <planetis> directory missing... |
11:54:24 | FromDiscord | <Forest> yeah that's the issue i'm having |
11:55:14 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=3Y8S |
11:56:11 | FromDiscord | <Forest> probably |
11:56:46 | FromDiscord | <planetis> I found it, it's in /tmp/nimble_something |
11:57:19 | FromDiscord | <planetis> Oh gosh, what do I do? |
11:57:30 | FromDiscord | <Forest> could move it over maybe? |
11:57:58 | FromDiscord | <planetis> but how to get the .nimble/pkg2/... directory |
11:58:17 | FromDiscord | <Forest> no idea rip |
12:00:07 | FromDiscord | <planetis> I will ask in #nimble and get back with a solution |
12:07:18 | FromDiscord | <planetis> I think the solution here is to create .nims file that would build raylib static library for each project |
12:08:15 | FromDiscord | <planetis> so you would do nayget init myproject, it would create all the relevant files for you |
12:08:38 | FromDiscord | <planetis> so the first time you build it, it would compile raylib for the target platform |
12:14:42 | FromDiscord | <planetis> no, that would be wasteful, need to build only once for each platform |
12:23:14 | FromDiscord | <voidwalker> Can you add a new empty element (an object with many fields) to a sequence ? Like just incrementing its element number |
12:23:37 | FromDiscord | <planetis> setLen ? |
12:25:42 | FromDiscord | <voidwalker> Projects.setLen(Projects.len+1) I see |
12:27:32 | * | noeontheend joined #nim |
12:36:12 | FromDiscord | <Phil> In reply to @voidwalker "Projects.setLen(Projects.len+1) I see": Out of curiosity, this is so that you get the memory allocated before you actually need it? |
12:36:33 | FromDiscord | <Phil> Or do you actually want an empty instance? |
12:36:43 | FromDiscord | <voidwalker> I am filling the content right after that. |
12:37:04 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=3Y8X |
12:38:03 | FromDiscord | <voidwalker> otherwise i'd have to make another var object of the same type, initialize that, and then do PProjects.add(NewObject) |
12:38:41 | FromDiscord | <voidwalker> am I doing it wrong ? : P |
12:40:37 | FromDiscord | <Phil> I'm not deep enough to make a judgement call on that, I was just curious about your usecase.↵Ironically enough, my first way to think about the very same piece of code you'd be writing would be constructing the instance on its own and then move the constructed instance into the seq.↵Your way of doing it is perfectly valid, I just didn't think of it and became curious on how you'd do it. |
12:41:54 | FromDiscord | <Phil> (edit) "how you'd do it." => "the reasoning for your approach." |
12:42:06 | FromDiscord | <Phil> (edit) "your approach." => "wanting to expand the seq that way" |
12:42:10 | FromDiscord | <voidwalker> Uglier code I guess, but a tiny bit more memory efficient :-? |
12:42:17 | FromDiscord | <Phil> I wouldn't even say uglier |
12:42:27 | FromDiscord | <Phil> You save yourself a reference that strictly speaking is unnecessary |
12:42:36 | FromDiscord | <Phil> Doing less is always nice. |
12:45:17 | * | noeontheend quit (Ping timeout: 260 seconds) |
12:45:28 | FromDiscord | <Rika> if project |
12:45:32 | FromDiscord | <Rika> fuck |
12:45:50 | FromDiscord | <Rika> i mean if project is a ref, then how is it non-negligibly less memory efficient |
12:46:11 | FromDiscord | <Rika> if you store a ref the size you take up on the stack is just the size of a pointer |
12:46:25 | FromDiscord | <Rika> which is likely also the size of `p` right there in your code 😛 |
12:49:19 | FromDiscord | <voidwalker> For now it is not a ref. I am having too hard of a time understanding how that would work, and why I would need it |
12:50:45 | FromDiscord | <Rika> if it is not i'd say it is still negligible in effect |
12:51:42 | FromDiscord | <Rika> unless you're doing trillions of projects in which case you probably wouldnt use an array of structs |
12:54:19 | FromDiscord | <voidwalker> it's a seq of structs |
12:54:36 | FromDiscord | <voidwalker> What would I use then ? a database ? |
12:54:49 | FromDiscord | <Rika> i think ive confused you |
12:55:11 | FromDiscord | <Rika> just dont worry about one extra instance on the stack, its not much of a difference unless you can measurably check |
12:55:46 | FromDiscord | <voidwalker> yeah I know, this ccode will eventually get rewritten anyway, I can't get it right with my experience and skill level anyway (not to mention I am new to nim itself) |
12:56:00 | FromDiscord | <voidwalker> (edit) "yeah I know, this ccode will eventually get rewritten anyway, I can't get it right ... with" added "on try1" |
13:06:23 | * | LuxuryMode joined #nim |
13:06:31 | FromDiscord | <Phil> Does pascal even have ref types? I wonder |
13:07:03 | NimEventer | New Nimble package! libharu - library for libharu, see https://github.com/z-kk/libharu |
13:34:20 | FromDiscord | <Forest> In reply to @planetis "so the first time": Well, just cloning the project and using nayget build locally works, so maybe something could be done for that? |
13:36:13 | FromDiscord | <planetis> What I'll do is add --path argument to nayget and you can have .nims file in your project which does exec(nayget build --path:...) |
13:42:45 | * | rockcavera quit (Remote host closed the connection) |
13:43:27 | FromDiscord | <d4rckh> how can i get rid of msvcrt.dll from my program? |
13:43:30 | FromDiscord | <d4rckh> its being imported |
13:46:32 | FromDiscord | <Rika> You cannot, that’s equivalent to libc on Linux |
13:46:40 | FromDiscord | <Rika> The C runtime for windows |
13:46:56 | FromDiscord | <Rika> Well, I mean you can |
13:47:02 | FromDiscord | <Rika> But I don’t tecommend it |
13:47:04 | FromDiscord | <Rika> Recommend |
13:47:37 | FromDiscord | <Rika> Why do you want to remove it? |
13:48:13 | * | noeontheend joined #nim |
14:05:23 | FromDiscord | <d4rckh> nvm |
14:05:26 | FromDiscord | <d4rckh> thanks for the info :\) |
14:10:15 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/mk1 |
14:10:22 | FromDiscord | <d4rckh> does anyone know despite the connection being opened, why nothing is sent? |
14:10:27 | FromDiscord | <d4rckh> (edit) "does anyone know despite the connection being opened, why nothing is ... sent?" added "being" |
14:10:42 | * | PMunch quit (Quit: Leaving) |
14:11:14 | FromDiscord | <d4rckh> (edit) "does anyone know ... despite" added "why" | removed "being" |
14:12:40 | FromDiscord | <Prestige> Are you sure it's not being sent? |
14:13:02 | FromDiscord | <d4rckh> Yes |
14:13:22 | FromDiscord | <d4rckh> connections is a global variable |
14:13:31 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/w1V |
14:13:47 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/6xw |
14:13:53 | FromDiscord | <d4rckh> and this is the jester endpoint that adds the connections |
14:14:16 | FromDiscord | <d4rckh> and `notifyClientConnection` is called from an async proc |
14:14:28 | FromDiscord | <d4rckh> (edit) "and `notifyClientConnection` is called from ... an" added "another proc thats called by" |
14:16:14 | FromDiscord | <Rika> In reply to @d4rckh "and `notifyClientConnection` is called": Make the notify proc async too and change asyncCheck with await, then await the notify proc as well? Perhaps |
14:16:41 | FromDiscord | <d4rckh> sounds a bit painful but i will try |
14:16:50 | FromDiscord | <d4rckh> why would it not work tho |
14:16:53 | FromDiscord | <d4rckh> (edit) "why would it not work ... tho" added "this way" |
14:17:36 | FromDiscord | <williamskim> I'll help 10 people on how to earn $20,000 within 72 hours but you will pay me 10% of your profit when you receive it.↵Note\: only interested people should apply, drop a message let's get started↵https://t.me/Tradewitholiver01 |
14:17:46 | FromDiscord | <Prestige> <@&371760044473319454> |
14:17:56 | FromDiscord | <Rika> God damn why so many Oliver bots |
14:17:57 | FromDiscord | <Prestige> er, whoever |
14:18:13 | FromDiscord | <d4rckh> In reply to @Rika "Make the notify proc": that didn ot work |
14:18:16 | FromDiscord | <d4rckh> (edit) "didn ot" => "did not" |
14:18:23 | FromDiscord | <Rika> In reply to @d4rckh "why would it not": Async check doesn’t run the proc until the next await you do on any other future I believe |
14:18:36 | FromDiscord | <d4rckh> also after i try to send something, the connection closes (the client doesnt get notified the connection got closes) |
14:18:54 | FromDiscord | <d4rckh> (edit) "closes)" => "closed)" |
14:19:02 | FromDiscord | <Rika> Is your client behaving properly |
14:19:12 | FromDiscord | <d4rckh> its a website |
14:20:07 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y9n |
14:20:09 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3Y9n" => "https://paste.rs/Ijc" |
14:21:03 | FromDiscord | <d4rckh> ive been struggling to get this work for one day |
14:22:35 | FromDiscord | <whisper> Is there anything specific to be done to setup Nim with Visual Studio compiler? |
14:24:33 | FromDiscord | <demotomohiro> You sould be able to use `cl.exe` in visual studio just adding `--cc:vcc` option to nim. |
14:25:00 | FromDiscord | <Andreas> sent a long message, see https://paste.rs/iLL |
14:25:54 | FromDiscord | <Andreas> (edit) "http://ix.io/3Y9p" => "http://ix.io/3Y9q" |
14:26:44 | FromDiscord | <Andreas> (edit) "http://ix.io/3Y9q" => "http://ix.io/3Y9r" |
14:35:01 | FromDiscord | <d4rckh> wtf.. |
14:35:05 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y9u |
14:36:28 | FromDiscord | <d4rckh> restarted the websocket server and now they both stopped worked. added a third send call and they all started working again |
14:36:39 | FromDiscord | <d4rckh> (edit) "again" => "again, of course until i restarted the server" |
14:37:31 | FromDiscord | <d4rckh> even after i restart the client, it wont work until i edit that specific that function and recompile the code |
14:37:36 | FromDiscord | <d4rckh> (edit) removed "that" |
14:37:47 | FromDiscord | <Forest> How do i use Naylib flags? :P |
14:37:57 | FromDiscord | <Forest> Been spending the last 10 minutes trying to figure it out lmao |
14:45:50 | FromDiscord | <d4rckh> this ws library is making me cry |
14:48:39 | FromDiscord | <planetis> In reply to @Forest "Been spending the last": Look at the readme |
14:49:21 | FromDiscord | <planetis> flags(FlagMsaa4xHint, FlagWindowHighdpi) |
14:49:52 | FromDiscord | <Forest> How did i miss that lmao- |
14:49:58 | FromDiscord | <Forest> Thanks! |
14:50:30 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix= |
14:50:34 | FromDiscord | <d4rckh> why does jester throw this error at me? |
14:50:48 | FromDiscord | <d4rckh> all of my endpoints have a resp call except the ws one |
14:50:55 | FromDiscord | <d4rckh> does the ws endpoint also have to resp? |
14:51:31 | FromDiscord | <Prestige> What's the ws one? |
14:51:57 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y9z |
14:52:13 | FromDiscord | <Prestige> Yeah you need to respond |
14:52:19 | FromDiscord | <d4rckh> with what? |
14:55:05 | FromDiscord | <d4rckh> okay, just sent `ok` after i finished up with the socket |
15:01:13 | FromDiscord | <d4rckh> why cant it keep the connection alive?? |
15:03:54 | FromDiscord | <Prestige> Maybe because the socket is being created in that scope |
15:04:03 | * | noeontheend quit (Ping timeout: 244 seconds) |
15:05:03 | FromDiscord | <d4rckh> but i add it to a global sequence |
15:14:32 | FromDiscord | <ambient> Is it possible to attach source code line by line to a profiler and a debugger? |
15:46:11 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
16:24:40 | * | haliucinas joined #nim |
16:26:32 | NimEventer | New post on r/nim by Familiar_Ad_8919: nim openssl3?, see https://reddit.com/r/nim/comments/ut76aj/nim_openssl3/ |
16:29:57 | * | hellstabber quit (Quit: Connection closed for inactivity) |
17:14:16 | FromDiscord | <retkid> is there a javascript-like print module for nim |
17:15:11 | FromDiscord | <spoon> what would make printing javascript-like? |
17:43:25 | FromDiscord | <retkid> have you never used console.log() and then be like "woa thats pretty" |
17:44:55 | * | smvg joined #nim |
17:46:43 | FromDiscord | <Prestige> Do you want to use this for code compiling to js, or just make a function that looks like `console.log` that compiles to c @retkid ? |
17:47:27 | FromDiscord | <Prestige> Because there is https://nim-lang.org/docs/jsconsole.html |
17:50:59 | FromDiscord | <retkid> In reply to @Avahe "Do you want to": https://media.discordapp.net/attachments/371759389889003532/976904816007716924/unknown.png |
17:51:10 | FromDiscord | <Prestige> Yes |
17:51:31 | FromDiscord | <retkid> very sad |
17:51:40 | FromDiscord | <Prestige> Do you want https://nim-lang.org/docs/logging.html maybe? |
17:51:51 | FromDiscord | <Prestige> if you aren't targeting js explicitly |
17:52:03 | FromDiscord | <Prestige> Take a look at https://nim-lang.org/docs/logging.html#18 |
17:52:28 | FromDiscord | <planetis> Does nimble support post install hook? |
17:53:23 | FromDiscord | <Prestige> https://github.com/nim-lang/nimble#creating-packages search for `post hooks` |
17:54:34 | FromDiscord | <planetis> so would post install work? |
17:55:06 | FromDiscord | <Prestige> Is that like, code you want your package to run after someone has nimble installed it? |
17:55:18 | FromDiscord | <Prestige> If so, I don't think that is a thing |
17:56:26 | FromDiscord | <planetis> I want it to build a static library after its installed |
17:56:37 | FromDiscord | <planetis> how hard could it be? |
17:56:44 | * | rockcavera joined #nim |
17:56:45 | * | rockcavera quit (Changing host) |
17:56:45 | * | rockcavera joined #nim |
17:56:48 | FromDiscord | <planetis> I have no idea how to do it |
17:59:24 | FromDiscord | <Prestige> I could see that being potentially dangerous (letting a package run any code upon install) |
18:06:46 | * | noeontheend joined #nim |
18:14:05 | * | jmdaemon joined #nim |
18:15:15 | NimEventer | New thread by Planetis: How to build a static library after nimble install?, see https://forum.nim-lang.org/t/9163 |
18:15:37 | * | smvg quit (Quit: smvg) |
18:18:52 | * | jmd_ joined #nim |
18:20:20 | * | jmdaemon quit (Ping timeout: 272 seconds) |
18:22:14 | * | noeontheend quit (Ping timeout: 272 seconds) |
18:27:59 | FromDiscord | <Zectbumo> if a C function has a wrapper with a `var cstring` parameter that the C implementation obtained via malloc() then do I have to free it in Nim or does Nim free it for me when it leaves scope because it knows it's a var cstring?↵`errmsg: var cstring` is the one in question↵https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/lib/wrappers/sqlite3.nim#L141-L143 |
18:29:49 | om3ga | Yardanico, macos clang and sanitizers work better actually |
18:29:51 | om3ga | https://0paste.com/375122-ac9b09f8 |
18:30:26 | om3ga | I have zero output in arch with the same cfg |
18:37:42 | * | jmdaemon joined #nim |
18:38:00 | * | jmd_ quit (Ping timeout: 246 seconds) |
19:18:52 | FromDiscord | <demotomohiro> In reply to @Zectbumo "if a C function": I don't think Nim free it automatically. Whether `var cstring` need to be freed or not depends on C library. |
19:40:40 | * | noeontheend joined #nim |
19:46:09 | * | tiorock joined #nim |
19:46:09 | * | tiorock quit (Changing host) |
19:46:09 | * | tiorock joined #nim |
19:46:09 | * | rockcavera is now known as Guest1946 |
19:46:09 | * | Guest1946 quit (Killed (strontium.libera.chat (Nickname regained by services))) |
19:46:09 | * | tiorock is now known as rockcavera |
19:48:52 | FromDiscord | <Zectbumo> okay, the lib says it needs to be freed. so I have to handle it then. How do I transfer this into a Nim managed string? |
19:51:19 | * | noeontheend quit (Ping timeout: 244 seconds) |
19:59:05 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3YaO |
20:16:36 | FromDiscord | <Elegantbeef> align is only meant for object fields iirc |
20:18:46 | FromDiscord | <ambient> how do i get memory from heap that's aligned to 32 byte boundary? |
20:19:38 | FromDiscord | <Elegantbeef> I've not really used align so I do not really know |
20:48:27 | * | LuxuryMode joined #nim |
21:07:38 | FromDiscord | <voidwalker> What should I use for json-ifying/serialization of custom data types (objects) ? |
21:08:19 | FromDiscord | <Elegantbeef> `import std/json` |
21:08:24 | FromDiscord | <Elegantbeef> If you want custom hooks you can use `jsonutils` |
21:24:49 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=3Yba |
21:25:15 | FromDiscord | <voidwalker> I don't really understand what Foo() is in this context |
21:30:05 | FromDiscord | <Elegantbeef> It's a struct or record |
21:30:11 | FromDiscord | <Elegantbeef> I think pascal calls them records |
21:31:01 | FromDiscord | <voidwalker> I mean foo with () |
21:31:05 | FromDiscord | <voidwalker> what does the () do ? |
21:31:20 | FromDiscord | <Elegantbeef> It's an object constructor which creates a 0'd Foo |
21:31:39 | FromDiscord | <Elegantbeef> `Foo() == Foo(a1: 0, a2: 0, a0: 0, a3: 0, a4: 0)` |
21:32:11 | FromDiscord | <voidwalker> Oh so it's a var, that's why it works.. |
21:32:18 | FromDiscord | <Elegantbeef> It's not a var |
21:32:29 | FromDiscord | <Elegantbeef> It's an object constructor, it's actually a constant |
21:32:54 | FromDiscord | <voidwalker> Right, that's what I meant, var as in not a type def but its instantiation |
21:40:36 | FromDiscord | <voidwalker> It seems it has a problem with DateTime types in objects, i get a compile error if my object has that |
21:40:55 | FromDiscord | <voidwalker> (edit) "It seems it has a problem with DateTime types in objects, i get a compile error if my object has that ... " added "and i try to jsonify like in the code above" |
21:41:18 | FromDiscord | <Elegantbeef> Yes it has procs those cannot easily be json'd |
21:41:27 | FromDiscord | <Elegantbeef> Consider using `jsonutils` and writing your own hook |
21:42:22 | FromDiscord | <voidwalker> I will, when I get older : P |
21:54:50 | * | noeontheend joined #nim |
22:00:26 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Ybg |
22:01:12 | FromDiscord | <Elegantbeef> They use different object type comparisons so one of them is a bug |
22:04:36 | * | noeontheend quit (Ping timeout: 276 seconds) |
22:08:58 | FromDiscord | <demotomohiro> It is because when `--mm:orc` is used, runtime check is not implemented? |
22:09:21 | FromDiscord | <Elegantbeef> No they're implemented they just behave differently for some types |
22:44:23 | FromDiscord | <tinkerbaj> Every day I checking this programming language and slowly falling in love. But I really scare that I cant find libraries I use all the time. Can someone tell me what is best discord api for nim. |
22:44:52 | FromDiscord | <tinkerbaj> discord bot api I hope u understand what I mean |
22:46:26 | FromDiscord | <Elegantbeef> dimscord i think is the one that most use |
22:47:43 | FromDiscord | <tinkerbaj> Oh ok |
22:47:58 | FromDiscord | <tinkerbaj> Is there any simple way to find libraries for nim |
22:48:34 | FromDiscord | <Elegantbeef> https://nimble.directory/ |
22:49:10 | FromDiscord | <tinkerbaj> Exactly what I looking for |
22:49:19 | FromDiscord | <tinkerbaj> Excellent |
22:49:27 | FromDiscord | <Elegantbeef> you can also search github with `language: Nim` |
22:50:01 | FromDiscord | <tinkerbaj> I low to make for my personal use cli apps |
22:50:16 | FromDiscord | <tinkerbaj> For now nim is like most beautiful and elegant language |
22:50:23 | FromDiscord | <tinkerbaj> I ever use |
23:10:06 | FromDiscord | <!Patitotective> to delete all elements from a seq, do i `mySeq.setLen(0)`? |
23:10:34 | FromDiscord | <Elegantbeef> It doesnt free the memory but it resets the len |
23:11:15 | FromDiscord | <!Patitotective> then `mySeq.delete(0, mySeq.high)`? |
23:11:22 | FromDiscord | <!Patitotective> (edit) "`mySeq.delete(0, mySeq.high)`?" => "`mySeq.delete(0..mySeq.high)`?" |
23:11:26 | FromDiscord | <Elegantbeef> no |
23:11:33 | FromDiscord | <Elegantbeef> If you want to free the memory you do `= @[]` |
23:11:34 | FromDiscord | <!Patitotective> ;[ |
23:12:20 | FromDiscord | <!Patitotective> another SmartBeef moment |
23:38:21 | FromDiscord | <demotomohiro> There is also `reset` proc: https://nim-lang.org/docs/system.html#reset,T |
23:44:28 | FromDiscord | <!Patitotective> In reply to @demotomohiro "There is also `reset`": 🤩 |
23:44:32 | FromDiscord | <!Patitotective> amazing thanks |
23:51:21 | FromDiscord | <NiChrosia> how would you go about filling a dynamically sized block of memory (like an array, but the size can't be set at runtime) with values? |
23:52:12 | FromDiscord | <NiChrosia> is there a proc to set memory within a `pointer`? |
23:54:22 | FromDiscord | <NiChrosia> sent a code paste, see https://play.nim-lang.org/#ix=3Ybs |
23:54:42 | FromDiscord | <NiChrosia> (edit) "https://play.nim-lang.org/#ix=3Ybs" => "https://play.nim-lang.org/#ix=3Ybt" |
23:55:35 | FromDiscord | <NiChrosia> (edit) "https://play.nim-lang.org/#ix=3Ybt" => "https://play.nim-lang.org/#ix=3Ybu" |
23:56:06 | FromDiscord | <NiChrosia> (edit) "https://play.nim-lang.org/#ix=3Ybu" => "https://paste.rs/b68" |
23:58:17 | FromDiscord | <NiChrosia> if necessary, the context is dynamically creating data to send via an OpenGL buffer (`glBufferData(id: uint32, memory size of data: int32, pointer to data: pointer, usage: GLenum)`) |
23:58:23 | FromDiscord | <NiChrosia> (edit) removed "if necessary," |
23:59:10 | FromDiscord | <Elegantbeef> use a seq |
23:59:31 | FromDiscord | <NiChrosia> is a seq memory equivalent to an array |
23:59:33 | FromDiscord | <NiChrosia> (edit) "array" => "array?" |
23:59:44 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/shaders.nim#L108-L116 |
23:59:58 | FromDiscord | <Elegantbeef> If the data type is a value type it's contiguousu |