<< 19-05-2022 >>

00:00:10FromDiscord<retkid> In reply to @Elegantbeef "so if you do": I specifically wanna read between two bytes
00:00:22FromDiscord<Elegantbeef> Yes i know
00:00:30FromDiscord<Elegantbeef> You set position then read
00:03:12FromDiscord<retkid> I don'
00:03:18FromDiscord<retkid> (edit) "don'" => "don't see how readData is any different"
00:03:37FromDiscord<Elegantbeef> It takes an address of data and a length
00:04:10FromDiscord<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:16FromDiscord<retkid> but the length is arbitrary and can be bigger than the size of the strea,
00:04:22FromDiscord<retkid> (edit) "strea," => "stream"
00:04:45FromDiscord<Elegantbeef> How can you read more data then a stream has?
00:05:50FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/976636762963202048/unknown.png
00:06:01FromDiscord<Elegantbeef> Yes
00:06:07FromDiscord<Elegantbeef> That's a programmer bug
00:06:27FromDiscord<retkid> but it reads 2048 bytes and not 1024
00:06:35FromDiscord<Elegantbeef> No it doesnt
00:06:47FromDiscord<retkid> buffer == 2048
00:06:53FromDiscord<retkid> or would it cut off at 1024
00:06:53FromDiscord<Elegantbeef> So fucking what
00:06:57FromDiscord<Elegantbeef> It decays to `pointer`
00:07:07FromDiscord<retkid> dont be mad i just don
00:07:16FromDiscord<retkid> (edit) "don" => "don't understand 🥺"
00:08:18FromDiscord<retkid> alright i understand
00:08:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y7d
00:08:31FromDiscord<retkid> if the buffer is bigger than the reading size it just outputs null
00:08:35FromDiscord<Elegantbeef> It reads up to `len`
00:08:45FromDiscord<Elegantbeef> It returns how many bytes read
00:09:00FromDiscord<Elegantbeef> No
00:09:00FromDiscord<Elegantbeef> If the buffer is bigger than the read data it doesnt touch it
00:09:05FromDiscord<Elegantbeef> It only writes between `0..1024`
00:10:06FromDiscord<huantian> can I handle sigterms?
00:10:39FromDiscord<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:53FromDiscord<morgan> i think you can catch some
00:20:00FromDiscord<morgan> idr which can and can’t
00:20:19FromDiscord<morgan> i think 9 can’t be caught or delayed but idr what it’s name is
00:20:23FromDiscord<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:19FromDiscord<huantian> In reply to @MorganAlyssa "i think 9 can’t": yeah SIGKILL is insta death
00:22:01FromDiscord<huantian> In reply to @Zectbumo "I'm having trouble compiling": look at the two paths
00:22:52FromDiscord<Zectbumo> In reply to @huantian "look at the two": oh thank you. I didn't see the /usr/local part
00:23:59FromDiscord<Zectbumo> so, how to compile koch if it's going to conflict?
00:26:16FromDiscord<Zectbumo> I was promised "simple" ↵'''Compiling the compiler is a simple matter of running:'''
00:27:14FromDiscord<huantian> Hm I never had this error when running build-all.sh or whatever
00:33:52FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3Y7g
00:34:05FromDiscord<Zectbumo> that was on HEAD
00:35:32FromDiscord<Zectbumo> same errors checking out v1.6.6 andv1.6.4 😞
00:56:24NimEventerNew 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:26FromDiscord<retkid> @ElegantBeef
01:42:52FromDiscord<retkid> i keep getting segfaults when i read fromthe stream
01:42:56FromDiscord<retkid> (edit) "fromthe" => "from the"
01:42:58FromDiscord<retkid> ?
01:48:49FromDiscord<Elegantbeef> What's the code
01:50:06FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/976663002994585630/unknown.png
01:50:21FromDiscord<Elegantbeef> `buffybuffy[0].addr`
01:50:33FromDiscord<Elegantbeef> you're writing over the stack with `addr buffybuffy`
01:50:43FromDiscord<retkid> >:O
01:51:09FromDiscord<retkid> works like a charm
01:51:10FromDiscord<retkid> lmao
02:17:28FromDiscord<resumin> I just want to say, I appreciate you on here, ElegantBeef. good night
02:17:56FromDiscord<Elegantbeef> Shit how do i make a self deprecating response to that
02:17:59FromDiscord<Elegantbeef> Uhhhhh
02:19:45FromDiscord<retkid> In reply to @Elegantbeef "Shit how do i": appreciate you being here for us to CLOWN ON
02:19:57FromDiscord<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:31om3gaYardanico, I think I found the reason
07:00:05om3gaC compiler with enabled optimisation executes if-else, and other blocks separately
07:01:16om3gaI 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:08om3gaso that may cause that issues definitely
07:05:14om3gayeah.. looks like that, just right now I passed -fno-inline-functions, and it again crashes
07:05:59om3gabut not the compact version of the code, I will examine it
07:13:37*xet7 joined #nim
07:16:17PMunch"cat futhark_FCE8A8C7A4AF7C7B.nim | wc -l": 113723
07:16:27PMunchI'm so glad I'm not wrapping this stuff by hand :P
07:18:33FromDiscord<Elegantbeef> Would be a lot cooler if you did 😛
07:18:57FromDiscord<Elegantbeef> "I wrapped a lot of code instead of using a tool i made to do it for me AMA"
07:26:49FromDiscord<Rika> Doesn’t your tool generate multiples larger code than by hand anyway
07:27:05FromDiscord<Elegantbeef> it does indeed
07:28:30PMunchYes it generates a whole bunch of extra lines
07:28:43PMunchStill, I'm wrapping GTK and GTKWebView
07:28:49PMunchAnd it takes me seconds
07:32:04FromDiscord<Elegantbeef> Dont lie the wrapping has just begun
07:32:46FromDiscord<Elegantbeef> Unless you're actually using gtk's capi directly i guess
07:34:23PMunchI am
07:36:16om3gaawesome, I fixed all declarations appropriately, and now --opt:speed works with it too
07:37:49om3gabut why withLock and try: except: could be the problem? what do you think?
07:42:49om3gait might be inline related things I think
08:12:20*jmdaemon quit (Ping timeout: 272 seconds)
08:22:02FromDiscord<voidwalker> need some spoondfeeding kind of guidance for correctly defining a data structure I need, please. It's like this:
08:22:14FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=3Y88
08:23:18FromDiscord<Elegantbeef> Use the object variant i gave you last time
08:23:24FromDiscord<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:27FromDiscord<Elegantbeef> You cannot have heterogenous arrays
08:23:53FromDiscord<voidwalker> Yes elegantbeef, that part I understood. But the next part with generic types.. nope, stuck there conceptually
08:24:12FromDiscord<voidwalker> Because I need various lengths for the number of rows per table
08:24:13FromDiscord<Elegantbeef> Well ask the questions! 😄
08:24:43FromDiscord<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:22FromDiscord<Rika> If you don’t know how many rows per table on compile time just use another seq again
08:26:26FromDiscord<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:52FromDiscord<voidwalker> Some "projects" might have a table with 10 rows, otheres maybe as much as 10.000
08:27:28FromDiscord<Rika> Are they known on compile time or do they change on runtime
08:27:40FromDiscord<Elegantbeef> It's static
08:27:43FromDiscord<voidwalker> it's supposed to end up a webapp, user submitted, so runtime
08:27:55FromDiscord<Elegantbeef> Oh you lied to me last time 😄
08:28:03FromDiscord<voidwalker> Surely not on purpose ?
08:28:09FromDiscord<voidwalker> Why would I sabotage my own efforts lol
08:28:32FromDiscord<Elegantbeef> I'm just joking of course
08:28:38FromDiscord<Rika> I don’t know maybe you’re dual personality
08:28:41FromDiscord<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:45FromDiscord<Elegantbeef> I have a bitch of a headache so hopefully rika can help
08:29:28FromDiscord<Rika> I injured myself badly a few minutes ago so maybe
08:30:17FromDiscord<voidwalker> a sip of coffee and a walk is what i'd do for headaches
08:30:52FromDiscord<voidwalker> `type Table[Columns: static int] = distinct array[Columns, Row]`
08:31:09FromDiscord<Elegantbeef> The distinct was optional iirc
08:31:39FromDiscord<voidwalker> This is what you proposed last time elegantbeef. Which I didn't understood.
08:31:49FromDiscord<voidwalker> explain like i'm 5 ? : D
08:32:02FromDiscord<Elegantbeef> Well this was under the notion that you the columns statically
08:32:07FromDiscord<Rika> It’s a table where you can specify the amount of columns on compile time only
08:32:07FromDiscord<Elegantbeef> you knew the columns
08:32:08FromDiscord<voidwalker> Ohhhhh
08:32:21FromDiscord<Elegantbeef> Since you do not this is worthless to you
08:32:30FromDiscord<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:31FromDiscord<Elegantbeef> a `seq[Row]` will have to do
08:32:50FromDiscord<Elegantbeef> Sorry, but given what you said it's what i thought would work
08:33:32FromDiscord<voidwalker> sent a code paste, see https://paste.rs/oPL
08:33:44FromDiscord<Elegantbeef> Yea i took that as "I know it at compile time"
08:33:55FromDiscord<Elegantbeef> Not "I know the length at runtime before i make the table"
08:34:16FromDiscord<voidwalker> oh ok, glad i can move on with my life and not reinvent the wheel
08:34:26FromDiscord<voidwalker> I was sure nim had some more clever way of doing this, vs the obvious
08:35:02FromDiscord<Elegantbeef> Well just do `newSeq[Row](columns)` on creation and you're golden
08:35:08PMunch@Rika, you injured yourself badly a few minutes ago?
08:35:22PMunchThis sounds like a bash.org level "my house is on fire brb" scenario :P
08:35:41FromDiscord<Rika> I’m not bleeding but I can’t walk properly so yeah lol
08:36:06PMunchWhat did you do?
08:36:48PMunchI really wish there was some syntax sugar for variant types like this..
08:36:56FromDiscord<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:10FromDiscord<Rika> I hurt my ass too but I don’t know how exactly other than it hit the saddle
08:37:19PMunchIt would be neat to have `seq[int or float or string]` and then have that automatically be a variant object
08:37:28FromDiscord<Elegantbeef> use union
08:37:34FromDiscord<Elegantbeef> https://github.com/alaviss/union
08:37:40PMunch@Rika, ouch, that sucks..
08:41:06*krux02 quit (Remote host closed the connection)
09:07:32*Arrrrrrr quit (Quit: Arrrrrrr)
09:32:16FromDiscord<voidwalker> sent a code paste, see https://paste.rs/HmJ
09:32:45FromDiscord<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:41FromDiscord<Rika> do you need reference semantics
09:34:53FromDiscord<voidwalker> I don't know :-?
09:43:38FromDiscord<Phil> In reply to @voidwalker "I don't know :-?": Hmmm what other languages do you know so I can draw comparisons?
09:43:47FromDiscord<voidwalker> just pascal
09:43:49FromDiscord<Phil> Or is this your first? Then I'll throw in a code example
09:44:00FromDiscord<Phil> I never wrote pascal, code example it is
09:44:16FromDiscord<Phil> This'll be pseudocode, I don't have nim on this pc
09:48:57FromDiscord<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:36FromDiscord<voidwalker> `Since sequences are resizable they are always allocated on the heap and garbage collected`
09:52:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Y8u
09:53:05FromDiscord<Phil> There you go
09:53:19FromDiscord<Phil> https://play.nim-lang.org/#ix=3Y8v
09:54:52FromDiscord<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:00FromDiscord<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:34FromDiscord<Phil> All that matters is what behaviour you want on that object in general, ref semantics or no
10:01:46FromDiscord<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:40FromDiscord<Phil> Sounds like you want ref types to me, anyone else feel free to correct me
10:37:07*ltriant joined #nim
11:16:32FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=3Y8O
11:22:36PMunchDoes that file exist?
11:24:42FromDiscord<Forest> Huh looking at it, no
11:24:51FromDiscord<Forest> despite running `nayget build`
11:25:09PMunchAnd that returned without errors?
11:27:52FromDiscord<Forest> nope, no errors at all
11:28:00FromDiscord<Forest> idk where the include dir could even be
11:46:08FromDiscord<Forest> just used git clone and that works after building
11:48:28FromDiscord<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:44FromDiscord<Forest> cinclude dir isn't even generated with nimble method
11:49:56FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=3Y8Q
11:50:00FromDiscord<planetis> relevant code segment
11:50:15FromDiscord<planetis> why it doesn't work?
11:51:43FromDiscord<planetis> just did a clean build, worked fine
11:51:53FromDiscord<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:02FromDiscord<Forest> In reply to @planetis "just did a clean": Huh? That's odd
11:52:14FromDiscord<Forest> Oh, note that i'm using latest nimble devel
11:54:03FromDiscord<Forest> I'm also on Manjaro Linux
11:54:06FromDiscord<planetis> just tried with nimble
11:54:15FromDiscord<planetis> directory missing...
11:54:24FromDiscord<Forest> yeah that's the issue i'm having
11:55:14FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=3Y8S
11:56:11FromDiscord<Forest> probably
11:56:46FromDiscord<planetis> I found it, it's in /tmp/nimble_something
11:57:19FromDiscord<planetis> Oh gosh, what do I do?
11:57:30FromDiscord<Forest> could move it over maybe?
11:57:58FromDiscord<planetis> but how to get the .nimble/pkg2/... directory
11:58:17FromDiscord<Forest> no idea rip
12:00:07FromDiscord<planetis> I will ask in #nimble and get back with a solution
12:07:18FromDiscord<planetis> I think the solution here is to create .nims file that would build raylib static library for each project
12:08:15FromDiscord<planetis> so you would do nayget init myproject, it would create all the relevant files for you
12:08:38FromDiscord<planetis> so the first time you build it, it would compile raylib for the target platform
12:14:42FromDiscord<planetis> no, that would be wasteful, need to build only once for each platform
12:23:14FromDiscord<voidwalker> Can you add a new empty element (an object with many fields) to a sequence ? Like just incrementing its element number
12:23:37FromDiscord<planetis> setLen ?
12:25:42FromDiscord<voidwalker> Projects.setLen(Projects.len+1) I see
12:27:32*noeontheend joined #nim
12:36:12FromDiscord<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:33FromDiscord<Phil> Or do you actually want an empty instance?
12:36:43FromDiscord<voidwalker> I am filling the content right after that.
12:37:04FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=3Y8X
12:38:03FromDiscord<voidwalker> otherwise i'd have to make another var object of the same type, initialize that, and then do PProjects.add(NewObject)
12:38:41FromDiscord<voidwalker> am I doing it wrong ? : P
12:40:37FromDiscord<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:54FromDiscord<Phil> (edit) "how you'd do it." => "the reasoning for your approach."
12:42:06FromDiscord<Phil> (edit) "your approach." => "wanting to expand the seq that way"
12:42:10FromDiscord<voidwalker> Uglier code I guess, but a tiny bit more memory efficient :-?
12:42:17FromDiscord<Phil> I wouldn't even say uglier
12:42:27FromDiscord<Phil> You save yourself a reference that strictly speaking is unnecessary
12:42:36FromDiscord<Phil> Doing less is always nice.
12:45:17*noeontheend quit (Ping timeout: 260 seconds)
12:45:28FromDiscord<Rika> if project
12:45:32FromDiscord<Rika> fuck
12:45:50FromDiscord<Rika> i mean if project is a ref, then how is it non-negligibly less memory efficient
12:46:11FromDiscord<Rika> if you store a ref the size you take up on the stack is just the size of a pointer
12:46:25FromDiscord<Rika> which is likely also the size of `p` right there in your code 😛
12:49:19FromDiscord<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:45FromDiscord<Rika> if it is not i'd say it is still negligible in effect
12:51:42FromDiscord<Rika> unless you're doing trillions of projects in which case you probably wouldnt use an array of structs
12:54:19FromDiscord<voidwalker> it's a seq of structs
12:54:36FromDiscord<voidwalker> What would I use then ? a database ?
12:54:49FromDiscord<Rika> i think ive confused you
12:55:11FromDiscord<Rika> just dont worry about one extra instance on the stack, its not much of a difference unless you can measurably check
12:55:46FromDiscord<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:00FromDiscord<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:31FromDiscord<Phil> Does pascal even have ref types? I wonder
13:07:03NimEventerNew Nimble package! libharu - library for libharu, see https://github.com/z-kk/libharu
13:34:20FromDiscord<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:13FromDiscord<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:27FromDiscord<d4rckh> how can i get rid of msvcrt.dll from my program?
13:43:30FromDiscord<d4rckh> its being imported
13:46:32FromDiscord<Rika> You cannot, that’s equivalent to libc on Linux
13:46:40FromDiscord<Rika> The C runtime for windows
13:46:56FromDiscord<Rika> Well, I mean you can
13:47:02FromDiscord<Rika> But I don’t tecommend it
13:47:04FromDiscord<Rika> Recommend
13:47:37FromDiscord<Rika> Why do you want to remove it?
13:48:13*noeontheend joined #nim
14:05:23FromDiscord<d4rckh> nvm
14:05:26FromDiscord<d4rckh> thanks for the info :\)
14:10:15FromDiscord<d4rckh> sent a code paste, see https://paste.rs/mk1
14:10:22FromDiscord<d4rckh> does anyone know despite the connection being opened, why nothing is sent?
14:10:27FromDiscord<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:14FromDiscord<d4rckh> (edit) "does anyone know ... despite" added "why" | removed "being"
14:12:40FromDiscord<Prestige> Are you sure it's not being sent?
14:13:02FromDiscord<d4rckh> Yes
14:13:22FromDiscord<d4rckh> connections is a global variable
14:13:31FromDiscord<d4rckh> sent a code paste, see https://paste.rs/w1V
14:13:47FromDiscord<d4rckh> sent a code paste, see https://paste.rs/6xw
14:13:53FromDiscord<d4rckh> and this is the jester endpoint that adds the connections
14:14:16FromDiscord<d4rckh> and `notifyClientConnection` is called from an async proc
14:14:28FromDiscord<d4rckh> (edit) "and `notifyClientConnection` is called from ... an" added "another proc thats called by"
14:16:14FromDiscord<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:41FromDiscord<d4rckh> sounds a bit painful but i will try
14:16:50FromDiscord<d4rckh> why would it not work tho
14:16:53FromDiscord<d4rckh> (edit) "why would it not work ... tho" added "this way"
14:17:36FromDiscord<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:46FromDiscord<Prestige> <@&371760044473319454>
14:17:56FromDiscord<Rika> God damn why so many Oliver bots
14:17:57FromDiscord<Prestige> er, whoever
14:18:13FromDiscord<d4rckh> In reply to @Rika "Make the notify proc": that didn ot work
14:18:16FromDiscord<d4rckh> (edit) "didn ot" => "did not"
14:18:23FromDiscord<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:36FromDiscord<d4rckh> also after i try to send something, the connection closes (the client doesnt get notified the connection got closes)
14:18:54FromDiscord<d4rckh> (edit) "closes)" => "closed)"
14:19:02FromDiscord<Rika> Is your client behaving properly
14:19:12FromDiscord<d4rckh> its a website
14:20:07FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y9n
14:20:09FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=3Y9n" => "https://paste.rs/Ijc"
14:21:03FromDiscord<d4rckh> ive been struggling to get this work for one day
14:22:35FromDiscord<whisper> Is there anything specific to be done to setup Nim with Visual Studio compiler?
14:24:33FromDiscord<demotomohiro> You sould be able to use `cl.exe` in visual studio just adding `--cc:vcc` option to nim.
14:25:00FromDiscord<Andreas> sent a long message, see https://paste.rs/iLL
14:25:54FromDiscord<Andreas> (edit) "http://ix.io/3Y9p" => "http://ix.io/3Y9q"
14:26:44FromDiscord<Andreas> (edit) "http://ix.io/3Y9q" => "http://ix.io/3Y9r"
14:35:01FromDiscord<d4rckh> wtf..
14:35:05FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y9u
14:36:28FromDiscord<d4rckh> restarted the websocket server and now they both stopped worked. added a third send call and they all started working again
14:36:39FromDiscord<d4rckh> (edit) "again" => "again, of course until i restarted the server"
14:37:31FromDiscord<d4rckh> even after i restart the client, it wont work until i edit that specific that function and recompile the code
14:37:36FromDiscord<d4rckh> (edit) removed "that"
14:37:47FromDiscord<Forest> How do i use Naylib flags? :P
14:37:57FromDiscord<Forest> Been spending the last 10 minutes trying to figure it out lmao
14:45:50FromDiscord<d4rckh> this ws library is making me cry
14:48:39FromDiscord<planetis> In reply to @Forest "Been spending the last": Look at the readme
14:49:21FromDiscord<planetis> flags(FlagMsaa4xHint, FlagWindowHighdpi)
14:49:52FromDiscord<Forest> How did i miss that lmao-
14:49:58FromDiscord<Forest> Thanks!
14:50:30FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=
14:50:34FromDiscord<d4rckh> why does jester throw this error at me?
14:50:48FromDiscord<d4rckh> all of my endpoints have a resp call except the ws one
14:50:55FromDiscord<d4rckh> does the ws endpoint also have to resp?
14:51:31FromDiscord<Prestige> What's the ws one?
14:51:57FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Y9z
14:52:13FromDiscord<Prestige> Yeah you need to respond
14:52:19FromDiscord<d4rckh> with what?
14:55:05FromDiscord<d4rckh> okay, just sent `ok` after i finished up with the socket
15:01:13FromDiscord<d4rckh> why cant it keep the connection alive??
15:03:54FromDiscord<Prestige> Maybe because the socket is being created in that scope
15:04:03*noeontheend quit (Ping timeout: 244 seconds)
15:05:03FromDiscord<d4rckh> but i add it to a global sequence
15:14:32FromDiscord<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:32NimEventerNew 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:16FromDiscord<retkid> is there a javascript-like print module for nim
17:15:11FromDiscord<spoon> what would make printing javascript-like?
17:43:25FromDiscord<retkid> have you never used console.log() and then be like "woa thats pretty"
17:44:55*smvg joined #nim
17:46:43FromDiscord<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:27FromDiscord<Prestige> Because there is https://nim-lang.org/docs/jsconsole.html
17:50:59FromDiscord<retkid> In reply to @Avahe "Do you want to": https://media.discordapp.net/attachments/371759389889003532/976904816007716924/unknown.png
17:51:10FromDiscord<Prestige> Yes
17:51:31FromDiscord<retkid> very sad
17:51:40FromDiscord<Prestige> Do you want https://nim-lang.org/docs/logging.html maybe?
17:51:51FromDiscord<Prestige> if you aren't targeting js explicitly
17:52:03FromDiscord<Prestige> Take a look at https://nim-lang.org/docs/logging.html#18
17:52:28FromDiscord<planetis> Does nimble support post install hook?
17:53:23FromDiscord<Prestige> https://github.com/nim-lang/nimble#creating-packages search for `post hooks`
17:54:34FromDiscord<planetis> so would post install work?
17:55:06FromDiscord<Prestige> Is that like, code you want your package to run after someone has nimble installed it?
17:55:18FromDiscord<Prestige> If so, I don't think that is a thing
17:56:26FromDiscord<planetis> I want it to build a static library after its installed
17:56:37FromDiscord<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:48FromDiscord<planetis> I have no idea how to do it
17:59:24FromDiscord<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:15NimEventerNew 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:59FromDiscord<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:49om3gaYardanico, macos clang and sanitizers work better actually
18:29:51om3gahttps://0paste.com/375122-ac9b09f8
18:30:26om3gaI 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:52FromDiscord<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:52FromDiscord<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:05FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=3YaO
20:16:36FromDiscord<Elegantbeef> align is only meant for object fields iirc
20:18:46FromDiscord<ambient> how do i get memory from heap that's aligned to 32 byte boundary?
20:19:38FromDiscord<Elegantbeef> I've not really used align so I do not really know
20:48:27*LuxuryMode joined #nim
21:07:38FromDiscord<voidwalker> What should I use for json-ifying/serialization of custom data types (objects) ?
21:08:19FromDiscord<Elegantbeef> `import std/json`
21:08:24FromDiscord<Elegantbeef> If you want custom hooks you can use `jsonutils`
21:24:49FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=3Yba
21:25:15FromDiscord<voidwalker> I don't really understand what Foo() is in this context
21:30:05FromDiscord<Elegantbeef> It's a struct or record
21:30:11FromDiscord<Elegantbeef> I think pascal calls them records
21:31:01FromDiscord<voidwalker> I mean foo with ()
21:31:05FromDiscord<voidwalker> what does the () do ?
21:31:20FromDiscord<Elegantbeef> It's an object constructor which creates a 0'd Foo
21:31:39FromDiscord<Elegantbeef> `Foo() == Foo(a1: 0, a2: 0, a0: 0, a3: 0, a4: 0)`
21:32:11FromDiscord<voidwalker> Oh so it's a var, that's why it works..
21:32:18FromDiscord<Elegantbeef> It's not a var
21:32:29FromDiscord<Elegantbeef> It's an object constructor, it's actually a constant
21:32:54FromDiscord<voidwalker> Right, that's what I meant, var as in not a type def but its instantiation
21:40:36FromDiscord<voidwalker> It seems it has a problem with DateTime types in objects, i get a compile error if my object has that
21:40:55FromDiscord<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:18FromDiscord<Elegantbeef> Yes it has procs those cannot easily be json'd
21:41:27FromDiscord<Elegantbeef> Consider using `jsonutils` and writing your own hook
21:42:22FromDiscord<voidwalker> I will, when I get older : P
21:54:50*noeontheend joined #nim
22:00:26FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Ybg
22:01:12FromDiscord<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:58FromDiscord<demotomohiro> It is because when `--mm:orc` is used, runtime check is not implemented?
22:09:21FromDiscord<Elegantbeef> No they're implemented they just behave differently for some types
22:44:23FromDiscord<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:52FromDiscord<tinkerbaj> discord bot api I hope u understand what I mean
22:46:26FromDiscord<Elegantbeef> dimscord i think is the one that most use
22:47:43FromDiscord<tinkerbaj> Oh ok
22:47:58FromDiscord<tinkerbaj> Is there any simple way to find libraries for nim
22:48:34FromDiscord<Elegantbeef> https://nimble.directory/
22:49:10FromDiscord<tinkerbaj> Exactly what I looking for
22:49:19FromDiscord<tinkerbaj> Excellent
22:49:27FromDiscord<Elegantbeef> you can also search github with `language: Nim`
22:50:01FromDiscord<tinkerbaj> I low to make for my personal use cli apps
22:50:16FromDiscord<tinkerbaj> For now nim is like most beautiful and elegant language
22:50:23FromDiscord<tinkerbaj> I ever use
23:10:06FromDiscord<!Patitotective> to delete all elements from a seq, do i `mySeq.setLen(0)`?
23:10:34FromDiscord<Elegantbeef> It doesnt free the memory but it resets the len
23:11:15FromDiscord<!Patitotective> then `mySeq.delete(0, mySeq.high)`?
23:11:22FromDiscord<!Patitotective> (edit) "`mySeq.delete(0, mySeq.high)`?" => "`mySeq.delete(0..mySeq.high)`?"
23:11:26FromDiscord<Elegantbeef> no
23:11:33FromDiscord<Elegantbeef> If you want to free the memory you do `= @[]`
23:11:34FromDiscord<!Patitotective> ;[
23:12:20FromDiscord<!Patitotective> another SmartBeef moment
23:38:21FromDiscord<demotomohiro> There is also `reset` proc: https://nim-lang.org/docs/system.html#reset,T
23:44:28FromDiscord<!Patitotective> In reply to @demotomohiro "There is also `reset`": 🤩
23:44:32FromDiscord<!Patitotective> amazing thanks
23:51:21FromDiscord<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:12FromDiscord<NiChrosia> is there a proc to set memory within a `pointer`?
23:54:22FromDiscord<NiChrosia> sent a code paste, see https://play.nim-lang.org/#ix=3Ybs
23:54:42FromDiscord<NiChrosia> (edit) "https://play.nim-lang.org/#ix=3Ybs" => "https://play.nim-lang.org/#ix=3Ybt"
23:55:35FromDiscord<NiChrosia> (edit) "https://play.nim-lang.org/#ix=3Ybt" => "https://play.nim-lang.org/#ix=3Ybu"
23:56:06FromDiscord<NiChrosia> (edit) "https://play.nim-lang.org/#ix=3Ybu" => "https://paste.rs/b68"
23:58:17FromDiscord<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:23FromDiscord<NiChrosia> (edit) removed "if necessary,"
23:59:10FromDiscord<Elegantbeef> use a seq
23:59:31FromDiscord<NiChrosia> is a seq memory equivalent to an array
23:59:33FromDiscord<NiChrosia> (edit) "array" => "array?"
23:59:44FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/shaders.nim#L108-L116
23:59:58FromDiscord<Elegantbeef> If the data type is a value type it's contiguousu