<< 16-11-2023 >>

00:01:37*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
00:04:27*jmdaemon joined #nim
00:14:53FromDiscord<ringabout> Is there a rule about push pragmas, should it be applied to let/const/var universally? It was applied to identifiers with a pragma before. I suppose https://github.com/nim-lang/Nim/pull/22944 might break a few things.
00:37:18FromDiscord<ringabout> It might make push exportc for functions as good as broken since it will be applied to every identfier.
00:38:48FromDiscord<Elegantbeef> You can export variables though
00:42:05FromDiscord<bostonboston> Yeah my bandaid was just export everything from my module even if I never intended for it to be exposed to the user. In my case it can't hurt anything
00:43:21FromDiscord<Elegantbeef> Why are you exporting everything though?
00:45:46*jmdaemon quit (Ping timeout: 268 seconds)
00:45:50FromDiscord<bostonboston> To prevent declared but not used, otherwise it'll be inconvenient to spot more important warnings
00:47:44FromDiscord<Elegantbeef> `{.used.}` exists though
00:47:46FromDiscord<Elegantbeef> I do not get how exporting everything solves your issue, is there a reason you have unexported unused code?
00:49:41FromDiscord<bostonboston> Yes, it's a bunch of enums and byte consts used to know how to communicate with an embedded device, they are not used at the moment but I put them in there for future development
00:50:11FromDiscord<Elegantbeef> Personally I'd just do `when false: ...` and indent them 😄
00:50:17FromDiscord<bostonboston> The modules purpose is to export functions that much use of that information rather than constructing messages as the user
00:50:24FromDiscord<bostonboston> I might try that
00:51:11*jmdaemon joined #nim
01:09:06*jmdaemon quit (Ping timeout: 256 seconds)
01:25:45*mal`` quit (Server closed connection)
01:26:53*mal`` joined #nim
01:28:58*systemdsucks quit (Remote host closed the connection)
01:30:30*computerquip quit (Server closed connection)
01:30:49*computerquip joined #nim
02:01:20*jmdaemon joined #nim
02:28:40FromDiscord<eszettera> hi
02:28:50FromDiscord<eszettera> new acc bcs i got falsely deactivated
02:28:51FromDiscord<eszettera> anyway
02:29:04FromDiscord<eszettera> how do i list all conections in a socket
02:45:09FromDiscord<Elegantbeef> On accept store it in a sequence and every so often send a pulse packet 😄
02:45:10FromDiscord<Elegantbeef> That's my bad method
02:45:27FromDiscord<Elegantbeef> Oh it's taperfade, I regret speaking
02:45:35FromDiscord<eszettera> i thought of that too
02:45:48FromDiscord<eszettera> but i feel like theres a better method
02:46:59FromDiscord<eszettera> In reply to @Elegantbeef "Oh it's taperfade, I": why
03:03:21FromDiscord<eszettera> im voldemort
03:12:17*systemdsucks joined #nim
03:31:18FromDiscord<eszettera> In reply to @Elegantbeef "On accept store it": can u send code maybe
03:58:34*edr quit (Quit: Leaving)
04:23:49*qwestion joined #nim
04:33:54*droidrage joined #nim
05:38:17*dir joined #nim
06:22:53*dir is now known as qaziquza
06:47:31FromDiscord<Chronos [She/Her]> In reply to @eszettera "new acc bcs i": Fun fact, that's against ToS
06:48:30FromDiscord<eszettera> Pfff
06:48:33FromDiscord<eszettera> They wont know
06:48:36FromDiscord<eszettera> Unless
06:48:37FromDiscord<eszettera> Omg
06:49:06FromDiscord<eszettera> Check my bio
06:51:12*cornfeedhobo quit (Server closed connection)
06:51:31*cornfeedhobo joined #nim
06:59:21*antranigv quit (Ping timeout: 240 seconds)
07:00:17*alice quit (Server closed connection)
07:00:37*alice joined #nim
07:06:15*advesperacit joined #nim
07:23:17*PMunch joined #nim
07:25:25*qaziquza quit (Quit: qaziquza)
07:26:21*qaziquza joined #nim
07:26:44*qaziquza quit (Client Quit)
07:41:17FromDiscord<pmunch> "falsely" deactivated. Are you sure you didn't actually get banned because someone reported you for ToS violations?
07:42:40FromDiscord<Elegantbeef> Generally the set of people that get 'deactivated' and the set of people that say "I was wrongly banned" is the same set
07:46:53FromDiscord<odexine> There are a rare few who are truly incorrectly banned
07:47:14FromDiscord<odexine> Wrongly is a more appropriate word I don’t know why I thought incorrectly
07:48:04FromDiscord<Elegantbeef> Tomato tomato
08:11:48*rockcavera quit (Remote host closed the connection)
08:20:16*cm quit (Server closed connection)
08:20:37*cm joined #nim
08:29:06*antranigv joined #nim
09:14:18FromDiscord<nnsee> In reply to @eszettera "new acc bcs i": yes, and everyone in prison didn't do it
09:23:04FromDiscord<Chronos [She/Her]> I only recently realised that my MC networking library was sorta funky with it's behaviour oof
09:26:36FromDiscord<eszettera> In reply to @nnsee "yes, and everyone in": Lmfao
09:26:44FromDiscord<eszettera> No i cant tell why it got deactivated
09:26:53FromDiscord<eszettera> I jokingly said that i was twelve
09:27:01FromDiscord<eszettera> In a cute way to make fun of someone
09:27:08FromDiscord<eszettera> Boom - Deactivated
09:27:10FromDiscord<eszettera> 😭
09:27:38FromDiscord<eszettera> Also rn im working on a c2 thingy
09:27:59FromDiscord<eszettera> I got told thats what its called
09:28:07FromDiscord<eszettera> Pretty fun
09:28:31FromDiscord<eszettera> Also im thinking abt making a module for discord bot stuff , bcs i like discord and nim
09:39:59*Arthur quit (Server closed connection)
09:40:19*Arthur joined #nim
10:02:01PMunchHmm, people who link with C stuff, how do you deal with building object files from C files?
10:03:29FromDiscord<Elegantbeef> If I can do it I just use the `{.compile` and let Nim handle it all
10:03:36FromDiscord<Phil> I don't as I have no idea what I'm doing.↵I just push importc and cdecl pargmas and it dynamically links my binaries and the rest magically works out
10:04:03Amun-Ra{.compile.} or pass .o to --passcl
10:04:09Amun-Rapassl*
10:04:12PMunchOh right, forgot about {.compile.}
10:04:41PMunchPhil, I unfortunately need to static link as this is microcontroller based
10:05:02FromDiscord<Phil> Rest in Pieces my friend
10:05:12PMunchHmm, now just to figure out which objects I need to build..
10:05:24Amun-Raoh, I forgot {.link: "foo.o".} exists
10:05:32FromDiscord<Elegantbeef> Unless you mean in general, then the answer is I do not link with C
10:05:33FromDiscord<Elegantbeef> It can get quite build systemy though
10:05:33FromDiscord<Elegantbeef> https://github.com/beef331/wasm3/blob/master/src/wasm3/wasm3c.nim#L6-L59
10:06:22PMunchYeah it gets complex fast..
10:06:58Amun-Raif object build invocation is pretty complex, link objects with link pragma
10:07:19PMunchI mean I currently have ~20 files I need to link with just for this hello_world sample..
10:07:43PMunchOr rather that's what the existing hello_world sample links with, not sure if all those are actually required
10:11:06Amun-Raar rvs objects.a *.o & {.passl: "objects.a".}
10:20:17*Ekho quit (Server closed connection)
10:20:38*Ekho joined #nim
10:28:55*_________ quit (Server closed connection)
10:29:17*_________ joined #nim
10:30:30FromDiscord<eszettera> Do 2d arrays exist in nim ?
10:33:53FromDiscord<nnsee> yes?
10:39:21FromDiscord<eszettera> Cool
10:50:55FromDiscord<Chronos [She/Her]> I am so confused on why my library refuses to work ugh...
11:07:40FromDiscord<Chronos [She/Her]> Anyone know a good name for a type/union that encompasses `int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | float32 | float64`? :p
11:08:09FromDiscord<Chronos [She/Her]> Not including `float` and `int`/`uint` because they're (supposed to be) platform-specific which isn't really portable
11:08:20FromDiscord<Chronos [She/Her]> `NumberX` probably
11:10:02PMunchNumber would probably be a good name yeha
11:13:00FromDiscord<odexine> SizedNumber
11:13:20FromDiscord<odexine> or something similar, maybe not Sized itself since ofc all numbers have some size
11:19:17Amun-RaChronos: FixedWidthNumber?
11:25:44FromDiscord<Chronos [She/Her]> Technically `int` is also fixed width depending on the system architecture :P
11:26:14FromDiscord<odexine> technicalities will get you nowhere
11:26:35FromDiscord<odexine> static sized number
11:26:49Amun-RaChronos: not according to C spec ;)
11:26:49FromDiscord<odexine> static has a different implication here though
11:30:29*nmz- quit (Server closed connection)
11:30:50*nmz joined #nim
11:33:03Amun-Raright, that it's known ct
11:38:39FromDiscord<odexine> explicit size number?
11:38:41FromDiscord<odexine> sounds long as fu
11:44:43FromDiscord<nnsee> ExplicitWidthNumber
11:46:33FromDiscord<odexine> thats even longer lmao
11:53:48FromDiscord<nnsee> IntOrFloatPossiblyUintWithExplicitlySetWidth
11:54:39Amun-RaSomeIntsAndFloatsWithSizeAppendedBelieveMe
12:00:36*Goodbye_Vincent quit (Server closed connection)
12:00:53*Goodbye_Vincent joined #nim
12:06:23FromDiscord<eszettera> https://media.discordapp.net/attachments/1024742942193221685/1173034077398511726/attachment-4-1.gif?ex=65627c1d&is=6550071d&hm=61028d142e79ca0dd66c15dc193459b05514a800886a91893389d75569cde36d&
12:09:05FromDiscord<241_01499> Is this behavior expected https://play.nim-lang.org/#ix=4LDH
12:11:42FromDiscord<eszettera> how do i use owlkettle
12:11:54FromDiscord<eszettera> it looks cool i want to use it for a project
12:13:45FromDiscord<pmunch> Maybe have a look at the README?
12:13:54FromDiscord<eszettera> boring
12:14:30Amun-Raif the files was renamed to DONOTREAD.md people would actually start reading it
12:14:33Amun-Rafile*
12:19:00PMunchSUPERSECRET_DONOTREAD.md
12:19:11PMunchThat's going to be the name of my READMEs going forward
12:20:35FromDiscord<Chronos [She/Her]> Ehh, NumberX works
12:21:16FromDiscord<Chronos [She/Her]> In reply to @eszettera "boring": And you wonder why you're struggling to understand docs...
12:21:33FromDiscord<eszettera> 😔
12:27:06Amun-RaPMunch: CREDENTIALS.md
12:39:09PMunchChronos_[She/Her], why the X?
12:39:24PMunch241_01499, that looks like a bug..
12:39:29FromDiscord<nnsee> i think to represent the size
12:42:25FromDiscord<ringabout> In reply to @241_01499 "Is this behavior expected": Well, you are supposed to use refs; a known issue https://github.com/nim-lang/Nim/issues/7002
12:43:33FromDiscord<241_01499> What is more likely, that this get fixed or canned in the future?
12:47:05FromDiscord<Chronos [She/Her]> In reply to @PMunch "Chronos_[She/Her], why the X?": `uint16`, `float32`, `int64`, the X is replaced with a number each time so
13:02:38Amun-RaChronos: I read X like "unknown"
13:03:04FromDiscord<Chronos [She/Her]> How about `NumberN`?
13:05:13Amun-RaUmberN (you already have N) ;)
13:06:08FromDiscord<Chronos [She/Her]> Lol
13:06:50Amun-Ratbh. Number is free to use
13:09:34FromDiscord<eszettera> pin
13:09:51*lucasta joined #nim
13:10:58FromDiscord<nnsee> what?
13:15:48FromDiscord<odexine> In reply to @Amun-Ra "tbh. Number is free": its very vague though
13:15:54FromDiscord<Chronos [She/Her]> In reply to @Amun-Ra "tbh. Number is free": True but that'd include `int`, `float` and `uint` too, which I don't want (by the name)
13:18:51Amun-RaFixedNubmer is still my fav
13:21:07FromDiscord<dissolved.girl> Maybe _ExplicitNumber_?
13:25:34FromDiscord<Chronos [She/Her]> Hm... FixedNumber vs ExplicitNumber is thw two choices now then
13:29:02FromDiscord<eszettera> ber
13:33:22PMunchBut since int == int64 and float == float64 that does include those..
13:33:27PMunchWhat are you using this for?
13:33:46Amun-Raisn't int == int32 on i686?
13:43:54*jmdaemon quit (Ping timeout: 256 seconds)
13:45:21PMunchYes
13:45:31PMunchAnd int16 on AVR
13:45:44FromDiscord<eclipse_29383> How do I cast a {} to LPVOID?
13:45:54PMunchWhich causes some interesting problems because of assumptions in the compiler about int sizes..
13:46:05PMuncheclipse_29383, with a cast?
13:46:09FromDiscord<eclipse_29383> when I try to do `&cast[LPVOID](hello)` it says Error: expression cannot be cast to 'LPVOID'
13:46:30PMunchWhet is the type of LPVOID and hello?
13:47:19*def- quit (Server closed connection)
13:47:28FromDiscord<eclipse_29383> lpvoid is 3rd arg in WriteProcessMemory() and hello is var hello = { 0x1, 0x2, 0x3 }
13:47:31*def- joined #nim
13:47:50FromDiscord<eclipse_29383> (edit) "lpvoid is 3rd arg in WriteProcessMemory() ... and" added "in the win32 api"
13:49:11PMunchRight, so those aren't compatible at all
13:50:01PMunch`hello` is a `set[range 0..255(int)]` while LPVOID I guess is a pointer
13:50:33PMunchWhat are you trying to do?
13:50:44FromDiscord<eclipse_29383> write those 3 bytes to a proccess
13:52:33PMunchWelp, sounds a lot like malicious coding, so not sure how much more I want to help you
13:52:33Amun-Ramake a buffer, write it
13:53:18PMunchIf you actually want to learn Nim try some tutorials, if you're just creating malware in it and making our legitimate programs get false positived by AVs then please find something better to do
13:55:14FromDiscord<xtrayambak> In reply to @arathanis "does leftpad exist yet?": fortunately, we have that in the standard library afaik
13:55:42PMunchxtrayambak, indeed we do :)
13:56:07FromDiscord<xtrayambak> that's relieving
13:56:26FromDiscord<xtrayambak> you'll have to push a faulty PR to the stdlib instead of revoking a package
13:56:28FromDiscord<xtrayambak> how nice
13:57:15FromDiscord<xtrayambak> I still don't like that module, but hey, I'm cool as long as it's an attempt to dip toes into Nim, and to be fair, I'm not a good Nim programmer either
13:57:20PMunchWell you'd have to push a faulty PR, and have it pass tests and the people using devel
13:57:32FromDiscord<xtrayambak> (remember when I tried to manually instantiate an array in my RNG library?)
13:57:37PMunchAnd of course people could just use previous version
13:57:43FromDiscord<xtrayambak> yeah
13:57:53FromDiscord<xtrayambak> the magic systems in place are comforting
13:58:20FromDiscord<xtrayambak> some guy has been trying to give me uint64.high reasons as to why Nim is a silly toy language and I should use Rust instead
13:58:23FromDiscord<xtrayambak> 🤣
13:58:48FromDiscord<xtrayambak> I wanted to say that Rust is an overgrown toy language but that'd warrant a block from him lol
13:58:59Amun-Rathere's nothing better than talking with rust zealot
13:59:09Amun-Rato*
13:59:22FromDiscord<xtrayambak> didn't a few of them raid the server a while back?
14:00:02PMunchI don't think we should start throwing stones in the language proselytizing glass house :P
14:00:08FromDiscord<xtrayambak> I also wrote a small tool that lets you create reproducable builds with dotfiles, scripts and stuff, and I plan to add the ability to add nimble packages with it too
14:00:10PMunchYeah we had a raid a while back
14:00:17NimEventerNew thread by lou15b: No =destroy hook(s) in std/tables?, see https://forum.nim-lang.org/t/10642
14:00:42FromDiscord<xtrayambak> the only thing I like how about Nim is that nobody shills it (@aintea please do not speak about this)
14:00:57FromDiscord<xtrayambak> (edit) "the only" => "one"
14:08:53FromDiscord<bostonboston> Oh I shill it, I annoy everyone at work
14:09:16Amun-Rathere's always one… ;)
14:10:18FromDiscord<Chronos [She/Her]> In reply to @PMunch "But since int ==": `int` and `float` can generally mean either depending on the platform, so I wanna be explicit here
14:10:51Amun-RaChronos: float for now is always float64
14:11:03*rockcavera joined #nim
14:11:07FromDiscord<Chronos [She/Her]> In reply to @PMunch "What are you using": MC networking :P↵I'm replacing streams with a 'Buffer' type I made specifically for working with data sent to and received from Minecraft
14:11:18FromDiscord<Chronos [She/Her]> In reply to @Amun-Ra "Chronos: float for now": For now aha
14:12:07Amun-Raas in: I'm not away whether it'll change
14:12:20Amun-Raaware (what's with my writing today…)
14:13:42PMunchYou want to be explicit, yet you've bundled every single int and float type into one big union type..
14:15:00FromDiscord<Chronos [She/Her]> In reply to @PMunch "You want to be": I'm using it with generics :P
14:15:34FromDiscord<Chronos [She/Her]> Like, `proc writeNum[R: NumberN](value: R) = # ...`
14:16:11FromDiscord<Chronos [She/Her]> I just don't wanna rely on `int` and `uint` being 64 bit everywhere (which obviously they're not-)
14:17:49PMunchAh I see
14:23:59FromDiscord<bostonboston> In my experience you can reduce a lot of generics in these situations if you just put `sizeof` everywhere
14:38:16*droidrage quit (Ping timeout: 268 seconds)
14:38:52*qwestion quit (Ping timeout: 256 seconds)
14:48:54FromDiscord<Chronos [She/Her]> In reply to @bostonboston "In my experience you": The point is I don't want to allow the use of `int`, because of it's size being platform dependant :P
14:49:25FromDiscord<nnsee> i'm trying to understand
14:49:39FromDiscord<nnsee> surely you need to account for different sizes regardless, and are probably using sizeof or something?
14:49:58FromDiscord<nnsee> since you allow both 32 and 64 bit integers...
14:53:38*itwrx joined #nim
14:58:08FromDiscord<Chronos [She/Her]> In reply to @nnsee "surely you need to": Yeah, I do, but if MC expects an int64, and on x64 you pass an int, no issue at all
14:59:06FromDiscord<Chronos [She/Her]> But if you're running that same code compiled on arm, then obviously you're not guaranteed to be sending an int
14:59:26FromDiscord<nnsee> but if mc expects an int75 regardless, there's no point writing it as a generic in the first place
14:59:32FromDiscord<nnsee> lol, int64 even
15:00:39FromDiscord<Chronos [She/Her]> In reply to @nnsee "but if mc expects": I use sizeof in the proc to get the correct size too :P
15:00:52PMunchOh nice, I managed to pass a library intended for an embedded target through Futhark
15:01:10FromDiscord<nnsee> oh i think i sort of understand
15:01:11FromDiscord<odexine> int75 sounds funky
15:01:14FromDiscord<Chronos [She/Her]> Also since I'm using stew's endians2 code, I have to cast it to an unsigned int too
15:01:30FromDiscord<nnsee> you basically just want to prevent accidentally using the wrong int size
15:01:34FromDiscord<nnsee> by making it explicit
15:01:38FromDiscord<Chronos [She/Her]> In reply to @nnsee "oh i think i": I hope so aha, words aren't my strong suit and I left my words at home 😛
15:01:46FromDiscord<Chronos [She/Her]> In reply to @nnsee "by making it explicit": Exactly, yeah!
15:02:01*PMunch quit (Quit: Leaving)
15:08:59FromDiscord<Chronos [She/Her]> Unrelated but I'm wondering how stupid would a `dynamic` block would be :P
15:09:48FromDiscord<Phil> In reply to @odexine "int75 sounds funky": Mildly funkiert than int74 indeed
15:10:00FromDiscord<Phil> Which in turn is even funkier than int73
15:10:00FromDiscord<Chronos [She/Her]> The exact opposite of `static`, runs code in a Nim interpreter/runtime/whatever with access to the variables in the current scope and can pass data out of the block completely
15:10:55FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "The exact opposite of": With this, you could do stuff that is normally compile time, at runtime :P
15:11:02FromDiscord<Chronos [She/Her]> Like macros and such
15:11:27FromDiscord<Chronos [She/Her]> What would a use for it even be? No idea lol
15:12:05FromDiscord<odexine> In reply to @isofruit "Mildly funkiert than int74": lets make an extended int like how theres an extended float: int80
15:12:08FromDiscord<Chronos [She/Her]> (edit) "What would a ... use" added "legit"
15:12:17FromDiscord<Chronos [She/Her]> In reply to @odexine "lets make an extended": Stint :P
15:12:29FromDiscord<Chronos [She/Her]> You're talking about stint :P
15:14:18FromDiscord<odexine> no, i mean a dedicated implementation and not a generic one like stint...
15:15:15FromDiscord<Chronos [She/Her]> Make a module that uses stint that defines int80 lol
15:16:15FromDiscord<Phil> int420, all or nothing
15:17:05FromDiscord<Phil> In reply to @chronos.vitaqua "With this, you could": That would require nim binaries to push compile-time data such as types into runtime, which likely would impact performance and binary size
15:17:40FromDiscord<Chronos [She/Her]> In reply to @isofruit "That would require nim": Yep!
15:18:23FromDiscord<Chronos [She/Her]> If you use it, you gotta expect that it'd blow up the binary size a lot-
15:18:28FromDiscord<Chronos [She/Her]> And impact performance-
15:33:38NimEventerNew question by std124_lf: Read headers HappyX, see https://stackoverflow.com/questions/77496097/read-headers-happyx
15:52:05FromDiscord<saint.___.> I dont understand that happyx framework
15:52:16FromDiscord<saint.___.> The site design seems cool but it doesn't really explain how it works
16:13:27*lucasta quit (Ping timeout: 256 seconds)
16:16:29*krux02 joined #nim
16:26:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4LF9
16:26:44FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4LF9" => "https://play.nim-lang.org/#ix=4LFa"
16:30:57FromDiscord<nnsee> yes
17:05:45NimEventerNew thread by mszs: Browser automation recommendation?, see https://forum.nim-lang.org/t/10644
17:30:45FromDiscord<jviega> So I've got a type that's a ref object, and it's definitely a ref object. And in one module (but not others), nil checks are giving me errors claming it's an object, adding :ObjType to the comparison. So how did it decide for my my `r == nil` that r should refer to the underlying object???
17:33:57FromDiscord<jviega> Ok taking the nil check out of a template fixed it
17:33:59FromDiscord<jviega> Sheesh
17:34:43FromDiscord<jviega> Didn't matter if template args typed or not. That's a mind bender
17:45:51FromDiscord<Daniele> Has anyone ever tried to use libuv with Nim? I got it working, but I've noticed that when the loop is started and an exception is thrown, it doesn't get handled at all until the loop is stopped. This also doesn't if I set the exception mode to setjmp
18:01:43FromDiscord<apetransaction> Hey guys, im trying to make a TUI for discord and im using illwill for non blocking character input
18:01:56FromDiscord<apetransaction> Is there anyone here that knows how to use stdin.readline or an equivelent?
18:02:08FromDiscord<apetransaction> do i just deinit and init every time i need text input?
18:02:21FromDiscord<apetransaction> or do i manually add grabbed keys to a string
18:03:03FromDiscord<jviega> Generally, if you're trying to read from stdin, no matter how you read it, it starts out line-buffered
18:03:19FromDiscord<jviega> If you want to get one character at a time you need to unbuffer it
18:03:35FromDiscord<apetransaction> (edit) "character" => "key"
18:03:47FromDiscord<jviega> In C there's setvbuf() and I know it's wrapped somewhere in Nim with a very easy "unbuffer stdio" type thing but I can't remember the name
18:04:32FromDiscord<apetransaction> my current code https://media.discordapp.net/attachments/371759389889003532/1174772003207663696/Screen_Shot_2023-11-16_at_12.04.23_PM.png?ex=6568ceaf&is=655659af&hm=8b95c6ccfb16085cf248b3e6552d45e0c5a01c09fa3d51df1a320927a8635705&
18:05:03FromDiscord<apetransaction> is there a simple way to just get a string from text input ending with enter or no
18:05:53FromDiscord<jviega> Yes, but I just googled it for you, you just have to call setStdIoUnbuffered() before running that code
18:06:08FromDiscord<apetransaction> In reply to @jviega "Yes, but I just": illwill does that when you initialize it
18:06:46FromDiscord<jviega> Well then the library is doing something wrong
18:09:34FromDiscord<apetransaction> nvm
18:09:39FromDiscord<apetransaction> i can just deinit and reinitialize it
18:09:41FromDiscord<apetransaction> im stupid
18:09:58FromDiscord<nnsee> In reply to @apetransaction "is there a simple": just read one key at a time using getKey(), appending to a buffer and breaking if you hit an enter
18:09:59FromDiscord<apetransaction> thanks for reminding me illwill is just toggling something lol
18:10:19FromDiscord<nnsee> this way you can also display the message on the screen as it is being typed
18:10:31FromDiscord<Chronos [She/Her]> For future reference, you should send the code as a message or as a link via the playground, rather than a screenshot :P
18:11:44FromDiscord<apetransaction> i would do this but the way illwill processes keys i would have to use std/tables to make a big dictionary to convert them to normal text as theres no built in function for that
18:11:52FromDiscord<apetransaction> i might just switch to a diferent library at this point
18:12:26FromDiscord<apetransaction> any libraries you would recommend?
18:12:52FromDiscord<nnsee> what do you mean
18:13:07FromDiscord<nnsee> can't you just getKey().ord?
18:13:40FromDiscord<apetransaction> no, getkey returns a key class
18:14:00FromDiscord<apetransaction> its written like this in code 💀 https://media.discordapp.net/attachments/371759389889003532/1174774385056419850/Screen_Shot_2023-11-16_at_12.13.55_PM.png?ex=6568d0e7&is=65565be7&hm=a82286c1a0d931a15bb6fa85cdc4998a7fda2d82327cf9d472d16c0970f78e9d&
18:15:35FromDiscord<ieltan> Hello, anyone explored preallocating/"reusing" exception"s ?
18:18:47FromDiscord<jviega> Why on earth do you need to do that
18:20:39FromDiscord<nnsee> In reply to @apetransaction "no, getkey returns a": that's ASCII, brother
18:20:52FromDiscord<nnsee> 13 in ASCII is carriage return
18:21:07FromDiscord<241_01499> sent a code paste, see https://play.nim-lang.org/#ix=4LFT
18:21:50FromDiscord<241_01499> (edit) "https://play.nim-lang.org/#ix=4LFT" => "https://play.nim-lang.org/#ix=4LFV"
18:22:37FromDiscord<ieltan> In reply to @jviega "Why on earth do": To avoid allocation when raising exceptions?...
18:23:00FromDiscord<ieltan> I read a Nim article mentioning that technique so this is why I'm asking
18:24:37FromDiscord<ieltan> https://media.discordapp.net/attachments/371759389889003532/1174777058539348109/Screenshot_20231116-192407.jpg?ex=6568d365&is=65565e65&hm=a59c516cc5583503e44488bda9844faccb321808835a8d5037232009fa816410&
18:25:28FromDiscord<Phil> is std/xml a similar story to std/json where you really should be using something else to generate XML?
18:25:30FromDiscord<ieltan> https://nim-lang.org/blog/2022/11/11/a-cost-model-for-nim.html
18:26:16FromDiscord<jviega> Really, if you're using exceptions in such a way that frequently doing a malloc is a problem, then you're using them wrong
18:29:24FromDiscord<ieltan> In reply to @jviega "Really, if you're using": Then why does the article mention this technique if raising exceptions is not a problem ? I'm mainly asking out of curiosity because i'm new to the concept, not because i need to satisfy a usecase 😄
18:29:43FromDiscord<ieltan> I knew you could preallocate seq and strings for example but not exceptions
18:30:15FromDiscord<nnsee> In reply to @apetransaction "no, getkey returns a": and that's not a class, that's an enum
18:31:33FromDiscord<jviega> Many people spend way too much time obsessing about the fast way to do things, where computers are so complicated that your instincts and conventional wisdom is often wrong. And performance rarely matters. You should focus on measuring w/ a profiler IF performance is becoming an issue, and then make changes in the areas identified and keep measuring to see the effects of those changes, for your program.
18:32:16FromDiscord<Phil> Do we have some utility proc somewhere that transforms camelcase to kebap-case?
18:32:27FromDiscord<Phil> (edit) "Do we have some utility proc somewhere that transforms camelcase ... to" added "strings"
18:32:38FromDiscord<Phil> Kinda don't want to write my own right now
18:33:46FromDiscord<ieltan> In reply to @jviega "Many people spend way": What you are saying makes sense, I don't think my programs need to preallocate exceptions, I just think the concept is fascinating
18:52:04FromDiscord<Chronos [She/Her]> In reply to @isofruit "Do we have some": Uhhhh I did have some regex at some point that allowed for splitting strings from multiple different cases so that you could make it formatted in a different way yourself
18:53:19FromDiscord<Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/ngpu-bindings/blob/master/tools/remapper.py @Phil
18:53:24FromDiscord<Chronos [She/Her]> Ignore the shit code-
18:54:32FromDiscord<demotomohiro> It is possible that you get out of memory error and try to throw exception.↵But what if there is no memory left to allocate exception?↵It rarely happen though.
18:57:37FromDiscord<Phil> Next question: ... any way to iterate over the fields of an object but not the fields of the object it inherits from?
18:57:42FromDiscord<demotomohiro> In reply to @241_01499 "quick question, I don't": quick answer: https://nim-lang.org/docs/destructors.html↵It depends on what you do with `a` and `b` after declaring them.↵If you don't use them, that string will not exists on output executable file.
18:59:05FromDiscord<Phil> In reply to @chronos.vitaqua "Uhhhh I did have": Thanks, will possibly steal there
19:15:38FromDiscord<Chronos [She/Her]> No worries!
19:17:03FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LGg
19:18:08FromDiscord<Chronos [She/Her]> I know that the buffer is working perfectly fine because my tests for regular number read and write works just fine... I'll put the needed code into a playground script hold on
19:21:16*itwrx quit (Quit: Leaving)
19:29:57FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4LGj
19:34:29FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4LGm
19:39:08FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "Buffer isnot Stream?": I replaced the usage of streams aha
19:39:18FromDiscord<Chronos [She/Her]> Streams had the same issue for some reason
19:41:24FromDiscord<griffith1deadly> isn't java byte is int8?
19:41:40FromDiscord<griffith1deadly> as i can see in protocol it int8
19:41:53FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "as i can see": Wdym?
19:42:07FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Wdym?": Byte 1 An integer between -128 and 127 Signed 8-bit integer
19:43:15FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "Byte ": Ah yeah, no idea there, there's no difference with a uint8 and an int8 here
19:43:27FromDiscord<nnsee> triple check your shl and shr outputs compared to java
19:43:30FromDiscord<Chronos [She/Her]> (As in, the result is the same)
19:43:33FromDiscord<nnsee> it's possible they behave differently
19:43:41FromDiscord<Chronos [She/Her]> I can do that, sure
19:44:01FromDiscord<nnsee> that bit me when writing my emulator
19:44:13FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "(As in, the result": result the same, but in packet's there is a difference
19:45:45FromDiscord<Chronos [She/Her]> In reply to @nnsee "that bit me when": Nope, they behave the same
19:45:56FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "result the same, but": Fair
19:47:47FromDiscord<Chronos [She/Her]> Not sure what the issue is, and it's so frusturating...
19:47:57FromDiscord<Chronos [She/Her]> Unless it's actually my encoding that's off?
19:52:43FromDiscord<Chronos [She/Her]> I want to rip my hair out sigh...
19:53:17FromDiscord<Chronos [She/Her]> Oh mygd
19:53:27FromDiscord<Chronos [She/Her]> I am so BLIND 😭
19:53:48FromDiscord<Chronos [She/Her]> I had an extra `inc b.pos` in the encoding bit
19:53:53FromDiscord<Chronos [She/Her]> Which threw everything off
19:55:18FromDiscord<stoneface86> off by one strikes again
19:55:23FromDiscord<Chronos [She/Her]> 😭
20:11:00FromDiscord<Chronos [She/Her]> Ah... How do I do arithmetic shifts in Nim?-
20:11:45FromDiscord<m4ul3r> In reply to @chronos.vitaqua "Ah... How do I": shr and shl
20:12:15FromDiscord<nnsee> In reply to @chronos.vitaqua "Ah... How do I": didn't we just talk about this lol
20:12:28FromDiscord<Chronos [She/Her]> I thought those were logical
20:12:44FromDiscord<Chronos [She/Her]> I don't understand much ✨
20:13:34FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Ah... How do I": ashr?
20:14:11FromDiscord<Chronos [She/Her]> Ah I'm blind, thanks aha
20:16:54FromDiscord<nnsee> ah
20:17:47FromDiscord<Chronos [She/Her]> Ah it was just my code being off
20:18:02FromDiscord<Chronos [She/Her]> My conversion of binaryto denary
20:54:13FromDiscord<aintea> In reply to @xtrayambak "one thing I like": sure, I won't say anything
20:54:18FromDiscord<aintea> 🤡
20:55:47*tinystoat quit (Server closed connection)
20:55:56*tinystoat joined #nim
21:04:46FromDiscord<saint.___.> In reply to @xtrayambak "one thing I like": Yeah maybe this might be a good thing although slower growth
21:04:53FromDiscord<saint.___.> As long as growth doesn't die
21:26:38FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4LHb pain
21:34:34FromDiscord<Chronos [She/Her]> Oh I forgot to ask my question
21:34:43FromDiscord<Chronos [She/Her]> Why doesn't this print out the correct value 😭
21:35:14FromDiscord<Chronos [She/Her]> I'm thinking that it may be better to store a distinct int or something but how about the format of the position...
21:39:49*lucasta joined #nim
21:49:01FromDiscord<Chronos [She/Her]> Heheh
21:49:03FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LHf
21:51:14*jmdaemon joined #nim
21:52:45FromDiscord<Chronos [She/Her]> Is it better to raise an error when someone tries to make a field go higher than it is actually able to be stored in? Or should I just clamp it and call it a day?
21:57:53FromDiscord<Elegantbeef> Sure it's doable, but what's the pont?
21:59:23FromDiscord<Chronos [She/Her]> 🤷‍♀️ none
21:59:29FromDiscord<Chronos [She/Her]> Just found it a bit funny
22:00:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LHj
22:00:20FromDiscord<Chronos [She/Her]> `.T`?
22:00:29FromDiscord<Chronos [She/Her]> Oh
22:00:32FromDiscord<Chronos [She/Her]> Oh
22:00:34FromDiscord<Elegantbeef> You can access generic parameters as fields
22:00:38FromDiscord<Chronos [She/Her]> Fun :)
22:00:49FromDiscord<Elegantbeef> Both on the type and instances
22:00:51FromDiscord<Chronos [She/Her]> Tho obvs that's compile time only
22:00:59FromDiscord<Chronos [She/Her]> For defining the type
22:01:07FromDiscord<Elegantbeef> You think your `test` isn't compile time only
22:02:02FromDiscord<Chronos [She/Her]> Wdym?
22:02:11FromDiscord<Elegantbeef> `test` is also compile time only
22:02:18FromDiscord<Elegantbeef> In fact it constant folds
22:02:31FromDiscord<Chronos [She/Her]> Yeah I'm aware, it's a given-
22:11:56FromDiscord<Chronos [She/Her]> Ugh I can't get the conversions working properly
22:12:13FromDiscord<Chronos [She/Her]> This time it's a direct 'port' from the pseudocode
22:17:47FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4LHm
22:18:11FromDiscord<Chronos [She/Her]> Hey @nnsee, I know you worked on the classic protocol, but is there any similarities here that you had issues with?
22:21:12*advesperacit quit ()
22:33:47FromDiscord<Chronos [She/Her]> Ngl I'm tempted just do to a stupid thing and cast to bytes, combine into an array, then cast back to an int and call it a day -_-
22:35:57FromDiscord<Chronos [She/Her]> Nvm I can't do that... Pain
23:14:30FromDiscord<Chronos [She/Her]> Fixed the issue now btw
23:14:35FromDiscord<Chronos [She/Her]> I didn't cast to an `int64`
23:16:01FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4LHC
23:16:25FromDiscord<Elegantbeef> `mixin foo`
23:17:12FromDiscord<Elegantbeef> If there is no overloaded symbol generics bind tightly(closed symbol) if there is a overloaded symbol, procedures bind loosely(open symbol). A closed symbol only considers declaration scope, an open symbol considers both declaration and instantiation scope
23:17:19*lucasta quit (Ping timeout: 256 seconds)
23:18:37FromDiscord<patitotective> Thanks :]
23:21:03*forest joined #nim
23:21:28*forest left #nim (#nim)
23:38:06*hexeme quit (Server closed connection)
23:39:28*hexeme joined #nim
23:47:37FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Hey <@961485620075720734>, I know": When you do see this, I've already fixed the library now, but are there any features that'd be useful for you? :P↵↵In terms of 1.7+ though, since I don't think I'll touch the classic editions lol