00:01:37 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
00:04:27 | * | jmdaemon joined #nim |
00:14:53 | FromDiscord | <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:18 | FromDiscord | <ringabout> It might make push exportc for functions as good as broken since it will be applied to every identfier. |
00:38:48 | FromDiscord | <Elegantbeef> You can export variables though |
00:42:05 | FromDiscord | <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:21 | FromDiscord | <Elegantbeef> Why are you exporting everything though? |
00:45:46 | * | jmdaemon quit (Ping timeout: 268 seconds) |
00:45:50 | FromDiscord | <bostonboston> To prevent declared but not used, otherwise it'll be inconvenient to spot more important warnings |
00:47:44 | FromDiscord | <Elegantbeef> `{.used.}` exists though |
00:47:46 | FromDiscord | <Elegantbeef> I do not get how exporting everything solves your issue, is there a reason you have unexported unused code? |
00:49:41 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> Personally I'd just do `when false: ...` and indent them 😄 |
00:50:17 | FromDiscord | <bostonboston> The modules purpose is to export functions that much use of that information rather than constructing messages as the user |
00:50:24 | FromDiscord | <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:40 | FromDiscord | <eszettera> hi |
02:28:50 | FromDiscord | <eszettera> new acc bcs i got falsely deactivated |
02:28:51 | FromDiscord | <eszettera> anyway |
02:29:04 | FromDiscord | <eszettera> how do i list all conections in a socket |
02:45:09 | FromDiscord | <Elegantbeef> On accept store it in a sequence and every so often send a pulse packet 😄 |
02:45:10 | FromDiscord | <Elegantbeef> That's my bad method |
02:45:27 | FromDiscord | <Elegantbeef> Oh it's taperfade, I regret speaking |
02:45:35 | FromDiscord | <eszettera> i thought of that too |
02:45:48 | FromDiscord | <eszettera> but i feel like theres a better method |
02:46:59 | FromDiscord | <eszettera> In reply to @Elegantbeef "Oh it's taperfade, I": why |
03:03:21 | FromDiscord | <eszettera> im voldemort |
03:12:17 | * | systemdsucks joined #nim |
03:31:18 | FromDiscord | <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:31 | FromDiscord | <Chronos [She/Her]> In reply to @eszettera "new acc bcs i": Fun fact, that's against ToS |
06:48:30 | FromDiscord | <eszettera> Pfff |
06:48:33 | FromDiscord | <eszettera> They wont know |
06:48:36 | FromDiscord | <eszettera> Unless |
06:48:37 | FromDiscord | <eszettera> Omg |
06:49:06 | FromDiscord | <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:17 | FromDiscord | <pmunch> "falsely" deactivated. Are you sure you didn't actually get banned because someone reported you for ToS violations? |
07:42:40 | FromDiscord | <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:53 | FromDiscord | <odexine> There are a rare few who are truly incorrectly banned |
07:47:14 | FromDiscord | <odexine> Wrongly is a more appropriate word I don’t know why I thought incorrectly |
07:48:04 | FromDiscord | <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:18 | FromDiscord | <nnsee> In reply to @eszettera "new acc bcs i": yes, and everyone in prison didn't do it |
09:23:04 | FromDiscord | <Chronos [She/Her]> I only recently realised that my MC networking library was sorta funky with it's behaviour oof |
09:26:36 | FromDiscord | <eszettera> In reply to @nnsee "yes, and everyone in": Lmfao |
09:26:44 | FromDiscord | <eszettera> No i cant tell why it got deactivated |
09:26:53 | FromDiscord | <eszettera> I jokingly said that i was twelve |
09:27:01 | FromDiscord | <eszettera> In a cute way to make fun of someone |
09:27:08 | FromDiscord | <eszettera> Boom - Deactivated |
09:27:10 | FromDiscord | <eszettera> 😭 |
09:27:38 | FromDiscord | <eszettera> Also rn im working on a c2 thingy |
09:27:59 | FromDiscord | <eszettera> I got told thats what its called |
09:28:07 | FromDiscord | <eszettera> Pretty fun |
09:28:31 | FromDiscord | <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:01 | PMunch | Hmm, people who link with C stuff, how do you deal with building object files from C files? |
10:03:29 | FromDiscord | <Elegantbeef> If I can do it I just use the `{.compile` and let Nim handle it all |
10:03:36 | FromDiscord | <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:03 | Amun-Ra | {.compile.} or pass .o to --passcl |
10:04:09 | Amun-Ra | passl* |
10:04:12 | PMunch | Oh right, forgot about {.compile.} |
10:04:41 | PMunch | Phil, I unfortunately need to static link as this is microcontroller based |
10:05:02 | FromDiscord | <Phil> Rest in Pieces my friend |
10:05:12 | PMunch | Hmm, now just to figure out which objects I need to build.. |
10:05:24 | Amun-Ra | oh, I forgot {.link: "foo.o".} exists |
10:05:32 | FromDiscord | <Elegantbeef> Unless you mean in general, then the answer is I do not link with C |
10:05:33 | FromDiscord | <Elegantbeef> It can get quite build systemy though |
10:05:33 | FromDiscord | <Elegantbeef> https://github.com/beef331/wasm3/blob/master/src/wasm3/wasm3c.nim#L6-L59 |
10:06:22 | PMunch | Yeah it gets complex fast.. |
10:06:58 | Amun-Ra | if object build invocation is pretty complex, link objects with link pragma |
10:07:19 | PMunch | I mean I currently have ~20 files I need to link with just for this hello_world sample.. |
10:07:43 | PMunch | Or rather that's what the existing hello_world sample links with, not sure if all those are actually required |
10:11:06 | Amun-Ra | ar 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:30 | FromDiscord | <eszettera> Do 2d arrays exist in nim ? |
10:33:53 | FromDiscord | <nnsee> yes? |
10:39:21 | FromDiscord | <eszettera> Cool |
10:50:55 | FromDiscord | <Chronos [She/Her]> I am so confused on why my library refuses to work ugh... |
11:07:40 | FromDiscord | <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:09 | FromDiscord | <Chronos [She/Her]> Not including `float` and `int`/`uint` because they're (supposed to be) platform-specific which isn't really portable |
11:08:20 | FromDiscord | <Chronos [She/Her]> `NumberX` probably |
11:10:02 | PMunch | Number would probably be a good name yeha |
11:13:00 | FromDiscord | <odexine> SizedNumber |
11:13:20 | FromDiscord | <odexine> or something similar, maybe not Sized itself since ofc all numbers have some size |
11:19:17 | Amun-Ra | Chronos: FixedWidthNumber? |
11:25:44 | FromDiscord | <Chronos [She/Her]> Technically `int` is also fixed width depending on the system architecture :P |
11:26:14 | FromDiscord | <odexine> technicalities will get you nowhere |
11:26:35 | FromDiscord | <odexine> static sized number |
11:26:49 | Amun-Ra | Chronos: not according to C spec ;) |
11:26:49 | FromDiscord | <odexine> static has a different implication here though |
11:30:29 | * | nmz- quit (Server closed connection) |
11:30:50 | * | nmz joined #nim |
11:33:03 | Amun-Ra | right, that it's known ct |
11:38:39 | FromDiscord | <odexine> explicit size number? |
11:38:41 | FromDiscord | <odexine> sounds long as fu |
11:44:43 | FromDiscord | <nnsee> ExplicitWidthNumber |
11:46:33 | FromDiscord | <odexine> thats even longer lmao |
11:53:48 | FromDiscord | <nnsee> IntOrFloatPossiblyUintWithExplicitlySetWidth |
11:54:39 | Amun-Ra | SomeIntsAndFloatsWithSizeAppendedBelieveMe |
12:00:36 | * | Goodbye_Vincent quit (Server closed connection) |
12:00:53 | * | Goodbye_Vincent joined #nim |
12:06:23 | FromDiscord | <eszettera> https://media.discordapp.net/attachments/1024742942193221685/1173034077398511726/attachment-4-1.gif?ex=65627c1d&is=6550071d&hm=61028d142e79ca0dd66c15dc193459b05514a800886a91893389d75569cde36d& |
12:09:05 | FromDiscord | <241_01499> Is this behavior expected https://play.nim-lang.org/#ix=4LDH |
12:11:42 | FromDiscord | <eszettera> how do i use owlkettle |
12:11:54 | FromDiscord | <eszettera> it looks cool i want to use it for a project |
12:13:45 | FromDiscord | <pmunch> Maybe have a look at the README? |
12:13:54 | FromDiscord | <eszettera> boring |
12:14:30 | Amun-Ra | if the files was renamed to DONOTREAD.md people would actually start reading it |
12:14:33 | Amun-Ra | file* |
12:19:00 | PMunch | SUPERSECRET_DONOTREAD.md |
12:19:11 | PMunch | That's going to be the name of my READMEs going forward |
12:20:35 | FromDiscord | <Chronos [She/Her]> Ehh, NumberX works |
12:21:16 | FromDiscord | <Chronos [She/Her]> In reply to @eszettera "boring": And you wonder why you're struggling to understand docs... |
12:21:33 | FromDiscord | <eszettera> 😔 |
12:27:06 | Amun-Ra | PMunch: CREDENTIALS.md |
12:39:09 | PMunch | Chronos_[She/Her], why the X? |
12:39:24 | PMunch | 241_01499, that looks like a bug.. |
12:39:29 | FromDiscord | <nnsee> i think to represent the size |
12:42:25 | FromDiscord | <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:33 | FromDiscord | <241_01499> What is more likely, that this get fixed or canned in the future? |
12:47:05 | FromDiscord | <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:38 | Amun-Ra | Chronos: I read X like "unknown" |
13:03:04 | FromDiscord | <Chronos [She/Her]> How about `NumberN`? |
13:05:13 | Amun-Ra | UmberN (you already have N) ;) |
13:06:08 | FromDiscord | <Chronos [She/Her]> Lol |
13:06:50 | Amun-Ra | tbh. Number is free to use |
13:09:34 | FromDiscord | <eszettera> pin |
13:09:51 | * | lucasta joined #nim |
13:10:58 | FromDiscord | <nnsee> what? |
13:15:48 | FromDiscord | <odexine> In reply to @Amun-Ra "tbh. Number is free": its very vague though |
13:15:54 | FromDiscord | <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:51 | Amun-Ra | FixedNubmer is still my fav |
13:21:07 | FromDiscord | <dissolved.girl> Maybe _ExplicitNumber_? |
13:25:34 | FromDiscord | <Chronos [She/Her]> Hm... FixedNumber vs ExplicitNumber is thw two choices now then |
13:29:02 | FromDiscord | <eszettera> ber |
13:33:22 | PMunch | But since int == int64 and float == float64 that does include those.. |
13:33:27 | PMunch | What are you using this for? |
13:33:46 | Amun-Ra | isn't int == int32 on i686? |
13:43:54 | * | jmdaemon quit (Ping timeout: 256 seconds) |
13:45:21 | PMunch | Yes |
13:45:31 | PMunch | And int16 on AVR |
13:45:44 | FromDiscord | <eclipse_29383> How do I cast a {} to LPVOID? |
13:45:54 | PMunch | Which causes some interesting problems because of assumptions in the compiler about int sizes.. |
13:46:05 | PMunch | eclipse_29383, with a cast? |
13:46:09 | FromDiscord | <eclipse_29383> when I try to do `&cast[LPVOID](hello)` it says Error: expression cannot be cast to 'LPVOID' |
13:46:30 | PMunch | Whet is the type of LPVOID and hello? |
13:47:19 | * | def- quit (Server closed connection) |
13:47:28 | FromDiscord | <eclipse_29383> lpvoid is 3rd arg in WriteProcessMemory() and hello is var hello = { 0x1, 0x2, 0x3 } |
13:47:31 | * | def- joined #nim |
13:47:50 | FromDiscord | <eclipse_29383> (edit) "lpvoid is 3rd arg in WriteProcessMemory() ... and" added "in the win32 api" |
13:49:11 | PMunch | Right, so those aren't compatible at all |
13:50:01 | PMunch | `hello` is a `set[range 0..255(int)]` while LPVOID I guess is a pointer |
13:50:33 | PMunch | What are you trying to do? |
13:50:44 | FromDiscord | <eclipse_29383> write those 3 bytes to a proccess |
13:52:33 | PMunch | Welp, sounds a lot like malicious coding, so not sure how much more I want to help you |
13:52:33 | Amun-Ra | make a buffer, write it |
13:53:18 | PMunch | If 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:14 | FromDiscord | <xtrayambak> In reply to @arathanis "does leftpad exist yet?": fortunately, we have that in the standard library afaik |
13:55:42 | PMunch | xtrayambak, indeed we do :) |
13:56:07 | FromDiscord | <xtrayambak> that's relieving |
13:56:26 | FromDiscord | <xtrayambak> you'll have to push a faulty PR to the stdlib instead of revoking a package |
13:56:28 | FromDiscord | <xtrayambak> how nice |
13:57:15 | FromDiscord | <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:20 | PMunch | Well you'd have to push a faulty PR, and have it pass tests and the people using devel |
13:57:32 | FromDiscord | <xtrayambak> (remember when I tried to manually instantiate an array in my RNG library?) |
13:57:37 | PMunch | And of course people could just use previous version |
13:57:43 | FromDiscord | <xtrayambak> yeah |
13:57:53 | FromDiscord | <xtrayambak> the magic systems in place are comforting |
13:58:20 | FromDiscord | <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:23 | FromDiscord | <xtrayambak> 🤣 |
13:58:48 | FromDiscord | <xtrayambak> I wanted to say that Rust is an overgrown toy language but that'd warrant a block from him lol |
13:58:59 | Amun-Ra | there's nothing better than talking with rust zealot |
13:59:09 | Amun-Ra | to* |
13:59:22 | FromDiscord | <xtrayambak> didn't a few of them raid the server a while back? |
14:00:02 | PMunch | I don't think we should start throwing stones in the language proselytizing glass house :P |
14:00:08 | FromDiscord | <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:10 | PMunch | Yeah we had a raid a while back |
14:00:17 | NimEventer | New thread by lou15b: No =destroy hook(s) in std/tables?, see https://forum.nim-lang.org/t/10642 |
14:00:42 | FromDiscord | <xtrayambak> the only thing I like how about Nim is that nobody shills it (@aintea please do not speak about this) |
14:00:57 | FromDiscord | <xtrayambak> (edit) "the only" => "one" |
14:08:53 | FromDiscord | <bostonboston> Oh I shill it, I annoy everyone at work |
14:09:16 | Amun-Ra | there's always one… ;) |
14:10:18 | FromDiscord | <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:51 | Amun-Ra | Chronos: float for now is always float64 |
14:11:03 | * | rockcavera joined #nim |
14:11:07 | FromDiscord | <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:18 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "Chronos: float for now": For now aha |
14:12:07 | Amun-Ra | as in: I'm not away whether it'll change |
14:12:20 | Amun-Ra | aware (what's with my writing today…) |
14:13:42 | PMunch | You want to be explicit, yet you've bundled every single int and float type into one big union type.. |
14:15:00 | FromDiscord | <Chronos [She/Her]> In reply to @PMunch "You want to be": I'm using it with generics :P |
14:15:34 | FromDiscord | <Chronos [She/Her]> Like, `proc writeNum[R: NumberN](value: R) = # ...` |
14:16:11 | FromDiscord | <Chronos [She/Her]> I just don't wanna rely on `int` and `uint` being 64 bit everywhere (which obviously they're not-) |
14:17:49 | PMunch | Ah I see |
14:23:59 | FromDiscord | <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:54 | FromDiscord | <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:25 | FromDiscord | <nnsee> i'm trying to understand |
14:49:39 | FromDiscord | <nnsee> surely you need to account for different sizes regardless, and are probably using sizeof or something? |
14:49:58 | FromDiscord | <nnsee> since you allow both 32 and 64 bit integers... |
14:53:38 | * | itwrx joined #nim |
14:58:08 | FromDiscord | <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:06 | FromDiscord | <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:26 | FromDiscord | <nnsee> but if mc expects an int75 regardless, there's no point writing it as a generic in the first place |
14:59:32 | FromDiscord | <nnsee> lol, int64 even |
15:00:39 | FromDiscord | <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:52 | PMunch | Oh nice, I managed to pass a library intended for an embedded target through Futhark |
15:01:10 | FromDiscord | <nnsee> oh i think i sort of understand |
15:01:11 | FromDiscord | <odexine> int75 sounds funky |
15:01:14 | FromDiscord | <Chronos [She/Her]> Also since I'm using stew's endians2 code, I have to cast it to an unsigned int too |
15:01:30 | FromDiscord | <nnsee> you basically just want to prevent accidentally using the wrong int size |
15:01:34 | FromDiscord | <nnsee> by making it explicit |
15:01:38 | FromDiscord | <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:46 | FromDiscord | <Chronos [She/Her]> In reply to @nnsee "by making it explicit": Exactly, yeah! |
15:02:01 | * | PMunch quit (Quit: Leaving) |
15:08:59 | FromDiscord | <Chronos [She/Her]> Unrelated but I'm wondering how stupid would a `dynamic` block would be :P |
15:09:48 | FromDiscord | <Phil> In reply to @odexine "int75 sounds funky": Mildly funkiert than int74 indeed |
15:10:00 | FromDiscord | <Phil> Which in turn is even funkier than int73 |
15:10:00 | FromDiscord | <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:55 | FromDiscord | <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:02 | FromDiscord | <Chronos [She/Her]> Like macros and such |
15:11:27 | FromDiscord | <Chronos [She/Her]> What would a use for it even be? No idea lol |
15:12:05 | FromDiscord | <odexine> In reply to @isofruit "Mildly funkiert than int74": lets make an extended int like how theres an extended float: int80 |
15:12:08 | FromDiscord | <Chronos [She/Her]> (edit) "What would a ... use" added "legit" |
15:12:17 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "lets make an extended": Stint :P |
15:12:29 | FromDiscord | <Chronos [She/Her]> You're talking about stint :P |
15:14:18 | FromDiscord | <odexine> no, i mean a dedicated implementation and not a generic one like stint... |
15:15:15 | FromDiscord | <Chronos [She/Her]> Make a module that uses stint that defines int80 lol |
15:16:15 | FromDiscord | <Phil> int420, all or nothing |
15:17:05 | FromDiscord | <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:40 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "That would require nim": Yep! |
15:18:23 | FromDiscord | <Chronos [She/Her]> If you use it, you gotta expect that it'd blow up the binary size a lot- |
15:18:28 | FromDiscord | <Chronos [She/Her]> And impact performance- |
15:33:38 | NimEventer | New question by std124_lf: Read headers HappyX, see https://stackoverflow.com/questions/77496097/read-headers-happyx |
15:52:05 | FromDiscord | <saint.___.> I dont understand that happyx framework |
15:52:16 | FromDiscord | <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:33 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4LF9 |
16:26:44 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4LF9" => "https://play.nim-lang.org/#ix=4LFa" |
16:30:57 | FromDiscord | <nnsee> yes |
17:05:45 | NimEventer | New thread by mszs: Browser automation recommendation?, see https://forum.nim-lang.org/t/10644 |
17:30:45 | FromDiscord | <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:57 | FromDiscord | <jviega> Ok taking the nil check out of a template fixed it |
17:33:59 | FromDiscord | <jviega> Sheesh |
17:34:43 | FromDiscord | <jviega> Didn't matter if template args typed or not. That's a mind bender |
17:45:51 | FromDiscord | <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:43 | FromDiscord | <apetransaction> Hey guys, im trying to make a TUI for discord and im using illwill for non blocking character input |
18:01:56 | FromDiscord | <apetransaction> Is there anyone here that knows how to use stdin.readline or an equivelent? |
18:02:08 | FromDiscord | <apetransaction> do i just deinit and init every time i need text input? |
18:02:21 | FromDiscord | <apetransaction> or do i manually add grabbed keys to a string |
18:03:03 | FromDiscord | <jviega> Generally, if you're trying to read from stdin, no matter how you read it, it starts out line-buffered |
18:03:19 | FromDiscord | <jviega> If you want to get one character at a time you need to unbuffer it |
18:03:35 | FromDiscord | <apetransaction> (edit) "character" => "key" |
18:03:47 | FromDiscord | <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:32 | FromDiscord | <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:03 | FromDiscord | <apetransaction> is there a simple way to just get a string from text input ending with enter or no |
18:05:53 | FromDiscord | <jviega> Yes, but I just googled it for you, you just have to call setStdIoUnbuffered() before running that code |
18:06:08 | FromDiscord | <apetransaction> In reply to @jviega "Yes, but I just": illwill does that when you initialize it |
18:06:46 | FromDiscord | <jviega> Well then the library is doing something wrong |
18:09:34 | FromDiscord | <apetransaction> nvm |
18:09:39 | FromDiscord | <apetransaction> i can just deinit and reinitialize it |
18:09:41 | FromDiscord | <apetransaction> im stupid |
18:09:58 | FromDiscord | <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:59 | FromDiscord | <apetransaction> thanks for reminding me illwill is just toggling something lol |
18:10:19 | FromDiscord | <nnsee> this way you can also display the message on the screen as it is being typed |
18:10:31 | FromDiscord | <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:44 | FromDiscord | <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:52 | FromDiscord | <apetransaction> i might just switch to a diferent library at this point |
18:12:26 | FromDiscord | <apetransaction> any libraries you would recommend? |
18:12:52 | FromDiscord | <nnsee> what do you mean |
18:13:07 | FromDiscord | <nnsee> can't you just getKey().ord? |
18:13:40 | FromDiscord | <apetransaction> no, getkey returns a key class |
18:14:00 | FromDiscord | <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:35 | FromDiscord | <ieltan> Hello, anyone explored preallocating/"reusing" exception"s ? |
18:18:47 | FromDiscord | <jviega> Why on earth do you need to do that |
18:20:39 | FromDiscord | <nnsee> In reply to @apetransaction "no, getkey returns a": that's ASCII, brother |
18:20:52 | FromDiscord | <nnsee> 13 in ASCII is carriage return |
18:21:07 | FromDiscord | <241_01499> sent a code paste, see https://play.nim-lang.org/#ix=4LFT |
18:21:50 | FromDiscord | <241_01499> (edit) "https://play.nim-lang.org/#ix=4LFT" => "https://play.nim-lang.org/#ix=4LFV" |
18:22:37 | FromDiscord | <ieltan> In reply to @jviega "Why on earth do": To avoid allocation when raising exceptions?... |
18:23:00 | FromDiscord | <ieltan> I read a Nim article mentioning that technique so this is why I'm asking |
18:24:37 | FromDiscord | <ieltan> https://media.discordapp.net/attachments/371759389889003532/1174777058539348109/Screenshot_20231116-192407.jpg?ex=6568d365&is=65565e65&hm=a59c516cc5583503e44488bda9844faccb321808835a8d5037232009fa816410& |
18:25:28 | FromDiscord | <Phil> is std/xml a similar story to std/json where you really should be using something else to generate XML? |
18:25:30 | FromDiscord | <ieltan> https://nim-lang.org/blog/2022/11/11/a-cost-model-for-nim.html |
18:26:16 | FromDiscord | <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:24 | FromDiscord | <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:43 | FromDiscord | <ieltan> I knew you could preallocate seq and strings for example but not exceptions |
18:30:15 | FromDiscord | <nnsee> In reply to @apetransaction "no, getkey returns a": and that's not a class, that's an enum |
18:31:33 | FromDiscord | <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:16 | FromDiscord | <Phil> Do we have some utility proc somewhere that transforms camelcase to kebap-case? |
18:32:27 | FromDiscord | <Phil> (edit) "Do we have some utility proc somewhere that transforms camelcase ... to" added "strings" |
18:32:38 | FromDiscord | <Phil> Kinda don't want to write my own right now |
18:33:46 | FromDiscord | <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:04 | FromDiscord | <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:19 | FromDiscord | <Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/ngpu-bindings/blob/master/tools/remapper.py @Phil |
18:53:24 | FromDiscord | <Chronos [She/Her]> Ignore the shit code- |
18:54:32 | FromDiscord | <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:37 | FromDiscord | <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:42 | FromDiscord | <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:05 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Uhhhh I did have": Thanks, will possibly steal there |
19:15:38 | FromDiscord | <Chronos [She/Her]> No worries! |
19:17:03 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LGg |
19:18:08 | FromDiscord | <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:57 | FromDiscord | <Chronos [She/Her]> https://play.nim-lang.org/#ix=4LGj |
19:34:29 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4LGm |
19:39:08 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "Buffer isnot Stream?": I replaced the usage of streams aha |
19:39:18 | FromDiscord | <Chronos [She/Her]> Streams had the same issue for some reason |
19:41:24 | FromDiscord | <griffith1deadly> isn't java byte is int8? |
19:41:40 | FromDiscord | <griffith1deadly> as i can see in protocol it int8 |
19:41:53 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "as i can see": Wdym? |
19:42:07 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Wdym?": Byte 1 An integer between -128 and 127 Signed 8-bit integer |
19:43:15 | FromDiscord | <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:27 | FromDiscord | <nnsee> triple check your shl and shr outputs compared to java |
19:43:30 | FromDiscord | <Chronos [She/Her]> (As in, the result is the same) |
19:43:33 | FromDiscord | <nnsee> it's possible they behave differently |
19:43:41 | FromDiscord | <Chronos [She/Her]> I can do that, sure |
19:44:01 | FromDiscord | <nnsee> that bit me when writing my emulator |
19:44:13 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "(As in, the result": result the same, but in packet's there is a difference |
19:45:45 | FromDiscord | <Chronos [She/Her]> In reply to @nnsee "that bit me when": Nope, they behave the same |
19:45:56 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "result the same, but": Fair |
19:47:47 | FromDiscord | <Chronos [She/Her]> Not sure what the issue is, and it's so frusturating... |
19:47:57 | FromDiscord | <Chronos [She/Her]> Unless it's actually my encoding that's off? |
19:52:43 | FromDiscord | <Chronos [She/Her]> I want to rip my hair out sigh... |
19:53:17 | FromDiscord | <Chronos [She/Her]> Oh mygd |
19:53:27 | FromDiscord | <Chronos [She/Her]> I am so BLIND 😭 |
19:53:48 | FromDiscord | <Chronos [She/Her]> I had an extra `inc b.pos` in the encoding bit |
19:53:53 | FromDiscord | <Chronos [She/Her]> Which threw everything off |
19:55:18 | FromDiscord | <stoneface86> off by one strikes again |
19:55:23 | FromDiscord | <Chronos [She/Her]> 😭 |
20:11:00 | FromDiscord | <Chronos [She/Her]> Ah... How do I do arithmetic shifts in Nim?- |
20:11:45 | FromDiscord | <m4ul3r> In reply to @chronos.vitaqua "Ah... How do I": shr and shl |
20:12:15 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "Ah... How do I": didn't we just talk about this lol |
20:12:28 | FromDiscord | <Chronos [She/Her]> I thought those were logical |
20:12:44 | FromDiscord | <Chronos [She/Her]> I don't understand much ✨ |
20:13:34 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Ah... How do I": ashr? |
20:14:11 | FromDiscord | <Chronos [She/Her]> Ah I'm blind, thanks aha |
20:16:54 | FromDiscord | <nnsee> ah |
20:17:47 | FromDiscord | <Chronos [She/Her]> Ah it was just my code being off |
20:18:02 | FromDiscord | <Chronos [She/Her]> My conversion of binaryto denary |
20:54:13 | FromDiscord | <aintea> In reply to @xtrayambak "one thing I like": sure, I won't say anything |
20:54:18 | FromDiscord | <aintea> 🤡 |
20:55:47 | * | tinystoat quit (Server closed connection) |
20:55:56 | * | tinystoat joined #nim |
21:04:46 | FromDiscord | <saint.___.> In reply to @xtrayambak "one thing I like": Yeah maybe this might be a good thing although slower growth |
21:04:53 | FromDiscord | <saint.___.> As long as growth doesn't die |
21:26:38 | FromDiscord | <Chronos [She/Her]> https://play.nim-lang.org/#ix=4LHb pain |
21:34:34 | FromDiscord | <Chronos [She/Her]> Oh I forgot to ask my question |
21:34:43 | FromDiscord | <Chronos [She/Her]> Why doesn't this print out the correct value 😭 |
21:35:14 | FromDiscord | <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:01 | FromDiscord | <Chronos [She/Her]> Heheh |
21:49:03 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LHf |
21:51:14 | * | jmdaemon joined #nim |
21:52:45 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> Sure it's doable, but what's the pont? |
21:59:23 | FromDiscord | <Chronos [She/Her]> 🤷♀️ none |
21:59:29 | FromDiscord | <Chronos [She/Her]> Just found it a bit funny |
22:00:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LHj |
22:00:20 | FromDiscord | <Chronos [She/Her]> `.T`? |
22:00:29 | FromDiscord | <Chronos [She/Her]> Oh |
22:00:32 | FromDiscord | <Chronos [She/Her]> Oh |
22:00:34 | FromDiscord | <Elegantbeef> You can access generic parameters as fields |
22:00:38 | FromDiscord | <Chronos [She/Her]> Fun :) |
22:00:49 | FromDiscord | <Elegantbeef> Both on the type and instances |
22:00:51 | FromDiscord | <Chronos [She/Her]> Tho obvs that's compile time only |
22:00:59 | FromDiscord | <Chronos [She/Her]> For defining the type |
22:01:07 | FromDiscord | <Elegantbeef> You think your `test` isn't compile time only |
22:02:02 | FromDiscord | <Chronos [She/Her]> Wdym? |
22:02:11 | FromDiscord | <Elegantbeef> `test` is also compile time only |
22:02:18 | FromDiscord | <Elegantbeef> In fact it constant folds |
22:02:31 | FromDiscord | <Chronos [She/Her]> Yeah I'm aware, it's a given- |
22:11:56 | FromDiscord | <Chronos [She/Her]> Ugh I can't get the conversions working properly |
22:12:13 | FromDiscord | <Chronos [She/Her]> This time it's a direct 'port' from the pseudocode |
22:17:47 | FromDiscord | <Chronos [She/Her]> https://play.nim-lang.org/#ix=4LHm |
22:18:11 | FromDiscord | <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:47 | FromDiscord | <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:57 | FromDiscord | <Chronos [She/Her]> Nvm I can't do that... Pain |
23:14:30 | FromDiscord | <Chronos [She/Her]> Fixed the issue now btw |
23:14:35 | FromDiscord | <Chronos [She/Her]> I didn't cast to an `int64` |
23:16:01 | FromDiscord | <patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4LHC |
23:16:25 | FromDiscord | <Elegantbeef> `mixin foo` |
23:17:12 | FromDiscord | <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:37 | FromDiscord | <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:37 | FromDiscord | <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 |