<< 30-11-2022 >>

00:02:20FromDiscord<guttural666> In reply to @pyolyokh "a sophisticated young person": don't be mean
00:09:41FromDiscord<ringabout> Why does Nim use DataInit procs instead of consts in the codegen?
00:12:44FromDiscord<voidwalker> you know what puzzles me, why do we have like 4 NES emulator projects, and no torrent library effort ? I thought emulation was harder
00:15:02FromDiscord<arkanoid> Because it's fun?↵(@voidwalker)
00:15:49FromDiscord<pyolyokh> even if difficulty is lower, there needs to be interest
00:43:58FromDiscord<auxym> bittorrent, unfortunately, isn't as popular as it was in the heyday of supernova and TPB
00:44:22FromDiscord<auxym> though IIRC, someone on here was in the process of implementing a torrent lib in nim'
00:47:21FromDiscord<voidwalker> what do you mean, it is probably still the number 1 traffic generator on the internet. There is no actual popular replacement for it as a public filesharing protocol
00:47:50FromDiscord<voidwalker> looking at the chat history, I can only see me mentioning torrents it a few times this year, nothing else related to any torrent lib dev
00:47:57FromDiscord<Rika> popular to use not popular to program for
00:48:35FromDiscord<Rika> its popular to use yes but theres probably only a handful of torrent clients with a significant usebase
00:48:37FromDiscord<auxym> In reply to @voidwalker "looking at the chat": I was probably thinking of you 😛
00:48:41FromDiscord<Rika> most prolly are in C++ or Python
00:49:48FromDiscord<voidwalker> yeah, there is that huge ass libtorrent in c++ that most clients use
00:50:09FromDiscord<voidwalker> has many thousands , probably tens of thousands of LOC
00:50:15FromDiscord<Rika> we meet again rakshasa
00:50:30FromDiscord<auxym> who uses torrents though? People who download linux ISOs? I get the impression that piracy isn't as big as it used to be. remember private trackers for high quality music rips? pedro's btmusic, waffle.fm, what.cd, etc. All dead. People just use netflix and spotify nowadays.
00:50:31FromDiscord<voidwalker> while the goal for me is to have a working and minialistic one in 300 lines or so
00:50:33FromDiscord<Rika> hell of a fucked up library really
00:51:02FromDiscord<Rika> In reply to @auxym "who uses torrents though?": its not
00:51:04FromDiscord<Rika> really not
00:54:00FromDiscord<voidwalker> I for one, won't stop wearing the hat, even if all digital media becomes free : P
00:57:15FromDiscord<voidwalker> there is a need for super high performance backend + web frontend torrent clients, that can handle tens of thousands of torrents.
01:42:00FromDiscord<Yepoleb> In reply to @auxym "who uses torrents though?": it's actually on the rise again because of the big studios delisting from netflix and starting tons of smaller streaming services
01:43:19FromDiscord<Yepoleb> and afaik for anime the legal options were always shit
01:52:57FromDiscord<@thatrandomperson5-6310e3b26da03> How would i gen a random 16bit int in nim?
01:57:35FromDiscord<jtv> Do you want it stored as two bytes, or do you want an int that can't be larger than 1<<16-1?
01:58:30FromDiscord<Rika> `import random; randomize(); let theInt = rand(int16.low..int16.high).int16`
01:58:37FromDiscord<jtv> NO
01:58:45FromDiscord<jtv> random is insecure, use urandom
01:58:55FromDiscord<Rika> but you dont need security all the time
01:58:58FromDiscord<Rika> security is slow
01:59:02FromDiscord<jtv> False, false false
01:59:06FromDiscord<jtv> It isn't remotely slow
01:59:09FromDiscord<Elegantbeef> lol
01:59:13FromDiscord<Rika> my goodness
01:59:18FromDiscord<jtv> And you need it almost always.
01:59:26FromDiscord<Elegantbeef> You really dont
01:59:36*ltriant quit (Ping timeout: 264 seconds)
01:59:36FromDiscord<Elegantbeef> I have never needed a secure random number
01:59:46FromDiscord<jtv> The one thing I actually like about rust is that it's the only language smart enough to make it the default
02:00:01FromDiscord<jtv> Honestly, I'm a cryptographer, you ALL run algorithms I wrote. They are in hardware.
02:00:22FromDiscord<jtv> The system random number generator is more than fast enough for 10gb/sec encryption
02:00:26FromDiscord<jtv> So you're just wrong
02:00:27FromDiscord<Rika> and basically all the things you write are cryptography
02:00:31FromDiscord<jtv> There's never a reason not to use it
02:00:34FromDiscord<jtv> Nope, not even close.
02:00:54FromDiscord<Elegantbeef> Imagine ensuring a games proc gen is cryptographically secure!
02:01:20FromDiscord<jtv> Most of them are, because, guess what, the OS gives you cheap random numbers that are far more random than algorithms
02:01:39FromDiscord<Rika> but does it really matter in that case
02:01:42FromDiscord<jtv> So unless you're a statistician that needs repeatable sequences, there's no good reason not to use them
02:02:42FromDiscord<jtv> The OS gives you cheap cryptographically secure random numbers via urandom (in Linux). And the algorithms most languages use for non cryptographically strong numbers are slower.
02:02:55madpropstest
02:03:05FromDiscord<Rika> but does it really matter ->>> in that case <<<-
02:03:45FromDiscord<jtv> I have owned all sorts of systems over the past 2 decades via their use of bad random numbers, who all thought it wasn't important and it was slower
02:03:53FromDiscord<jtv> Including several online poker sites
02:03:57FromDiscord<jtv> So 🤷
02:04:50FromDiscord<Generic> well Nim uses xorshiro128 iirc
02:05:02FromDiscord<Generic> not that I'm an expert on the field of random numbers
02:05:16FromDiscord<Generic> but I know that it's hard to top it in terms of speed
02:06:35FromDiscord<Generic> because one iteration will boil down to something around a dozen ALU instructions
02:06:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hfa
02:06:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hfb
02:06:57FromDiscord<Elegantbeef> Now you can have your cake and eat it too
02:07:11FromDiscord<jtv> So the crypto the OS does is incredibly cheap as far as crypto goes, as it's basically all accelerated instructions. You can do about 4-5x faster w/o cryptography but completely yield on security, and you could be encrypting at 10gbit a second and not notice the difference, full stop
02:07:19FromDiscord<Rika> `import sysrand; let theInt = urandom(1).int16 + urandom(1).int16 shl 8`↵if you really really desire then here it is
02:07:25FromDiscord<jtv> So performance is NOT worth the tradeoff, full stop
02:07:40FromDiscord<Rika> forgot the [0]
02:07:48FromDiscord<Rika> `import sysrand; let theInt = urandom(1)[0].int16 + urandom(1)[0].int16 shl 8`
02:07:49FromDiscord<Rika> of course
02:07:51FromDiscord<Elegantbeef> > So performance is NOT worth the tradeoff↵Assuming you need a secure random number
02:07:59FromDiscord<Rika> it would be faster in other ways, of course with urandom(2)
02:08:12FromDiscord<Rika> In reply to @Elegantbeef "> So performance is": well apparently we all do
02:08:14FromDiscord<jtv> And again, even if you think you don't, you've got a good chance of being wrong
02:08:26FromDiscord<Rika> it seems like seeding a prng with a random byte isnt enough anymore
02:08:29FromDiscord<Elegantbeef> Tell me why a video game's proc gen needs a cryptographically secure number?
02:08:32FromDiscord<jtv> It's definitely not worth the margin of error.
02:08:50FromDiscord<albassort> oi
02:08:56FromDiscord<albassort> do you guys wanna see some horrible fucking code
02:08:58FromDiscord<albassort> wel
02:09:00FromDiscord<albassort> docs
02:09:00FromDiscord<jtv> No, Rika, most non-cryptographic PRNGs are completely breakable after just a few outputs
02:09:10FromDiscord<Generic> rng manipluation is actually a fun thing done by really advanced players
02:09:13FromDiscord<albassort> https://github.com/ROCm-Developer-Tools/HIP
02:09:13FromDiscord<Generic> in things like speedruns
02:09:21FromDiscord<Generic> or in older Pokemon games
02:09:25FromDiscord<Rika> it is yes i know about those
02:09:36FromDiscord<jtv> If playing poker, Even if I just get a fraction of the cards in a deal, it'll probably take me a few hundred cards at most to be able to figure out the whole state of the algorithm
02:09:54FromDiscord<jtv> Just as an example.
02:10:22FromDiscord<Elegantbeef> Someone is very smart
02:10:42FromDiscord<Generic> for the newer Pokemon games they use tools to read out the current rng state
02:10:58FromDiscord<Generic> to be still eable to manipulate it
02:11:26FromDiscord<albassort> its u beef
02:11:38FromDiscord<Rika> In reply to @Generic "for the newer Pokemon": well that sounds different now
02:12:25FromDiscord<Generic> it's a bit weird, but the difference to cheating is that "technically" the Pokemon caught this way are still 100% legal
02:13:00FromDiscord<jtv> Modern cryptographic PRNGs are one AES operation, which costs LESS than once cycle per byte
02:13:14FromDiscord<jtv> If that's "too expensive" you're worried about the wrong stuff.
02:13:33FromDiscord<jtv> One operation per 16 bytes output
02:13:36FromDiscord<Elegantbeef> jtv there are many applications that cryptographically secure doesnt matter
02:13:59FromDiscord<jtv> Right, and it's so cheap in comparison to non-cryptographic, you should use it by default JUST TO BE SAFE
02:14:07FromDiscord<Generic> well not every cpu has those AES instructions
02:14:10FromDiscord<Rika> beef of course but whats the difference if the performance isnt any different
02:14:16FromDiscord<jtv> Every CPU built over the last 15 years does
02:14:18FromDiscord<albassort> numba + nim
02:14:30FromDiscord<Rika> what downside would using crypto secure have
02:14:31FromDiscord<albassort> In reply to @jtv "Every CPU built over": mine was built in the last 15 years and does not
02:14:41FromDiscord<albassort> 2009
02:14:43FromDiscord<Generic> also on ARM it's also different
02:14:44FromDiscord<Elegantbeef> Why a video game's procedural generation needs to be crytographically secure is beyond me
02:14:44FromDiscord<Elegantbeef> Why a noise generator needs to be is also confounding
02:14:52FromDiscord<Rika> well it doesnt have to
02:15:01FromDiscord<Generic> idk if they made AES obligatory with ARMv9
02:15:04FromDiscord<jtv> No, it's not, ARM has AES instructions as well
02:15:08FromDiscord<Generic> but with ARMv8 it was still an extension
02:15:17FromDiscord<Generic> which not every cpu implemented
02:15:29FromDiscord<albassort> ++
02:15:42FromDiscord<jtv> The OS is doing the work to gather the entropy no matter what. They bytes are just generated from the state w/ cheap as hell encryption
02:15:55FromDiscord<Elegantbeef> Based off sysrand vs. random about 10ms for a small application↵(@Rika)
02:15:56FromDiscord<huantian> one reason I've heard is that it can give people a false sense of security ↵though personally idk if I agree with that
02:16:24FromDiscord<jtv> It's almost completely ubiquitous, and 80+% of all internet traffic goes through it with nobody complaining
02:16:37FromDiscord<jtv> So you're really just being argumentative to claim the performance is even remotely important
02:16:47FromDiscord<Rika> the performance implication of a game and a website is somewhat different no
02:17:09FromDiscord<Elegantbeef> Generating a world can take a lot of calls to a random generator for noise and prop placement
02:17:16FromDiscord<jtv> Cloudflare cares quite a lot, Rika.
02:17:28FromDiscord<Rika> cloudflare runs their shit on megaservers
02:17:30FromDiscord<jtv> And they prefer everything be encrypted. Yet every byte translates to costs.
02:17:53FromDiscord<jtv> They've long been a customer of mine and friends. I get a lot of performance data through them.
02:17:58FromDiscord<jtv> You're just wrong.
02:18:27FromDiscord<Rika> no matter what i cannot agree that the performance implications of games and even websites run by google with commodity hardware are comparable
02:18:30FromDiscord<Rika> in any way
02:18:42FromDiscord<Rika> because theyre just different
02:19:01FromDiscord<jtv> Except that everyone I know at those companies would 100% disagree with you, but sure
02:19:08FromDiscord<Rika> are they gamedevs
02:19:32FromDiscord<Elegantbeef> appeal to authority in an argument, i've never!
02:19:33FromDiscord<jtv> I have plenty of friends who are game developers, and have worked w/ plenty of gaming companies.
02:20:11FromDiscord<jtv> You can't spare an average of .6 cycles per byte? How much random data do you actually need?
02:20:29FromDiscord<jtv> Compared to the amount of video you're probably pumping? Why are you unwilling to pay that price??
02:20:37FromDiscord<jtv> It's just a daft argument.
02:24:13FromDiscord<jtv> It's all dwarfed by the cost of crossing the ring boundry anyway.
02:24:28FromDiscord<jtv> Which people do all the time without thinking about
02:25:33FromDiscord<Rika> i dont even know why i continue to argue when ive been agreeing with you halfway through the argument
02:31:32FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4hfe
02:31:41FromDiscord<Rika> is the performance loss because of the syscall or what
02:33:25*rockcavera joined #nim
02:34:31FromDiscord<jtv> The system call is REALLY expensive in comparison. And most implementations don't use whatever native system call is there on Unix systems because it's easier from a portability perspective to just open up /dev/urandom
02:34:42FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1047339861306265640/image.png
02:34:44FromDiscord<jtv> Which is generally less direct still
02:34:54FromDiscord<Elegantbeef> I'm going to guess it's the syscall
02:35:05FromDiscord<Elegantbeef> But that still discredits jtv's view that "it's not slower"
02:35:16FromDiscord<Elegantbeef> Cause it's demonstrably slower
02:35:36FromDiscord<Rika> it is slower but not because of the generation
02:35:47FromDiscord<jtv> You read two bytes at a time, in a language that doesn't care at all about crypto performance, and it was still plenty fast
02:36:02FromDiscord<jtv> Sure, the shitty algorithm that doesn't need to make a system call can perform fine
02:36:17FromDiscord<jtv> Trace how many system calls the average high performance game is making
02:37:09FromDiscord<jtv> That's all in the noise, and if you need THAT MUCH random data, then use a crypto library in another language that cares about performance
02:37:12FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1047340396272955412/image.png
02:37:32FromDiscord<Elegantbeef> My argument is two points↵↵1\: sysrand is slower than random↵2\: You dont always need cryptographically secure generators
02:37:57FromDiscord<Elegantbeef> If you disagree with either of those i guess sod off
02:38:02FromDiscord<jtv> People are generally bad at security, and often need them when they don't know it.
02:38:22FromDiscord<Elegantbeef> Yes a video game that uses a seed to generate a world needs to be secure
02:38:27FromDiscord<jtv> And "good and fast" is better than "faster but garbage", even if that's all you can get out of the language
02:38:29FromDiscord<Elegantbeef> Yes a noise generator needs to be secure
02:39:25*pbotfullerton quit (Ping timeout: 260 seconds)
02:39:33FromDiscord<Elegantbeef> But now i'm instituting the sod off part of my plan
02:39:34FromDiscord<jtv> It's so in the noise for the average app, it should be the default, and if you want to shoot yourself in the foot because you think it's not the right option for you, you should be able to do that.
02:40:10FromDiscord<Rika> how would you propose to improve sysrand's performance
02:41:17FromDiscord<jtv> I haven't looked at the implementation, but frankly, you only need to read 16 bytes from the OS, then use it to key AES-CTR which you can do with some scorchingly fast assembly
02:41:27FromDiscord<Rika> In reply to @Elegantbeef "My argument is two": if you dont need cryptosecure then what difference would switching to it make once 1 becomes false if ever
02:41:33FromDiscord<jtv> That's definitely NOT what's going on in the test case
02:41:59FromDiscord<jtv> The whole point is, the average developer shouldn't ever have to worry about what kind of random number they need, or be a security expert
02:42:15FromDiscord<jtv> Why do you want to give them a tool that is going to make it easy for them to shoot themselves in the foot?
02:42:16FromDiscord<Rika> jtv: essentially sysrand is just a call to whatever the os provides so it makes a syscall every function call
02:42:18FromDiscord<jtv> You a C++ fan??
02:42:43FromDiscord<Elegantbeef> There is no reason to in that case rika
02:42:45FromDiscord<jtv> It's quite possibly even multiple syscalls the way it's implemented
02:43:01FromDiscord<Rika> In reply to @Elegantbeef "There is no reason": there is no reason not to, either, no?
02:43:08FromDiscord<Elegantbeef> That's what i mean
02:43:11FromDiscord<jtv> Again, Nim's developers clearly haven't prioritized crypto in any way shape or form
02:43:45FromDiscord<Rika> well of course, we're magnitudes smaller tahn rust or go or whatever
02:43:45FromDiscord<Elegantbeef> Though sysrand does not allow you to seed it
02:43:47FromDiscord<Rika> we have what
02:43:50FromDiscord<Elegantbeef> So actually that's another issue
02:43:56FromDiscord<Rika> a handful or something big developers
02:44:10FromDiscord<Elegantbeef> Many procgen relies on seeding the prng to regenerate the world instead of storing the entire world
02:44:16FromDiscord<Rika> In reply to @Elegantbeef "Though sysrand does not": of course since its not an algorithm
02:44:21FromDiscord<jtv> Even so, those numbers are more than good enough to make it the default, to keep people from having to understand anything about the fact that shooting themselves in the foot is efen a possibility
02:44:21FromDiscord<Elegantbeef> Yes i know
02:44:35FromDiscord<Rika> In reply to @Elegantbeef "Many procgen relies on": this is valid
02:44:38FromDiscord<Elegantbeef> So in many cases sysrand cannot be used how game devs need it
02:45:01FromDiscord<Elegantbeef> It's not crossplatform or repeatable
02:45:19FromDiscord<jtv> Yeah, again, it's generally a good optimization to take 128 bits from the OS and use AES-CTR, which is easy to do almost anywhere in ASM and make it fast
02:45:50FromDiscord<jtv> And then buffer blocks in userland instead of going back across the ring boundry every 2 bytes for crying out loud 🙂
02:47:12FromDiscord<Elegantbeef> Sure but the point was to show the actual speed difference between the two
02:47:27FromDiscord<Rika> yes but your point is to not switch because of the current speed
02:47:35FromDiscord<Rika> so if the speed wasnt an issue then what is your point
02:47:51FromDiscord<Elegantbeef> There is no point then
02:47:53FromDiscord<jtv> In Nim's implementation, the speed is poor compared to what it can be, but it still does not matter
02:47:56FromDiscord<Elegantbeef> As i've said multiple times
02:47:57FromDiscord<Rika> the lack of a seed makes sense, i dont know how to fix that
02:48:00FromDiscord<Rika> mayhe jtv does
02:48:14FromDiscord<Rika> In reply to @jtv "In Nim's implementation, the": it should be better
02:48:19FromDiscord<jtv> The average developer should be able to get random numbers easily, not need to be a security expert, and not shoot themselves in the foor
02:48:21FromDiscord<jtv> foot
02:48:54FromDiscord<jtv> And the relative rarity of calls to the rng even in apps that use it heavily,
02:49:09FromDiscord<Rika> ~~if you didnt know, a lot of people still get bugs with `random` because they forget to call the seeding function `randomize`~~
02:49:25FromDiscord<jtv> That doesn't matter
02:49:54FromDiscord<Rika> yeah no im just pointing it out that with what we have rn people are already pretty footshooty
02:51:25FromDiscord<jtv> 100%, sure. The implementations most languages use leak tons of info, and even if they didn't, are never more than 64 bits worth of internal state
02:57:18FromDiscord<Elegantbeef> Anyway rika i think it's just not possible to use `/dev/urandom` as many would want with procgen projects, since one generally wants a deterministic repeatable PRNG
02:58:21FromDiscord<jtv> Yeah, that's fine, and even there I'd say increase your state space, have a seedable random implementation by default that uses AES-CTR, where the seed is the 128-bit AES key.
02:59:13FromDiscord<jtv> Especially in the math world, if you want repeatability and want the output to be devoid of bias to the degree possible, why use simplistic functions we know have plenty of bias?
02:59:41FromDiscord<Rika> `have a seedable random implementation by default that uses AES-CTR` what algorithms use this?
03:00:32FromDiscord<jtv> So if I were doing the design, you'd have to `import stupidrandom` to get the Mersenne Twister people seem to love for no good reason
03:00:43FromDiscord<jtv> What do you mean? AES-CTR is a PRNG algorithm
03:00:50FromDiscord<Rika> oh okay
03:01:02FromDiscord<Rika> in that sese, i get it
03:01:05FromDiscord<Rika> (edit) "sese," => "sense,"
03:01:06FromDiscord<jtv> With a proof of security behind it that makes quite minimalist assumptions
03:01:12FromDiscord<Rika> In reply to @jtv "So if I were": lol
03:02:01*rockcavera quit (Remote host closed the connection)
03:02:28*rockcavera joined #nim
03:02:31FromDiscord<jtv> The PRP assumption... which is basically, if you only encrypt with a given key, input pair once, and the key remains private, and after each block, you show the attacker 16 bytes of actual random data, and the output, then an attacker won't do meaningfully better than random at guessing which one is from the algorithm.
03:02:43FromDiscord<Rika> i read this (of course, pinch of salt, it's SO) but wdyt? https://crypto.stackexchange.com/questions/83212/using-aes-ctr-as-a-prng
03:02:52FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4hfh
03:03:43FromDiscord<jtv> "not considered a CSPRNG" by who?
03:04:14FromDiscord<jtv> The crypto world moves fast, and most OSes keep up with it reasonably well too
03:04:40FromDiscord<jtv> The design of the OS part is both a) provide a default CSPRNG, and b) collect and manage entropy
03:04:55FromDiscord<jtv> b) is much, much harder to reason about, and the two do get intertwined in the OS
03:05:21FromDiscord<jtv> But it's in a much better position to actually collect the entropy, and nobody is going to do much better than they do there.
03:05:52FromDiscord<Rika> i think that it is perhaps important that the prng is portably quick
03:05:57FromDiscord<jtv> But for the CSPRNG part, I believe every OS is basically using CTR mode
03:06:15FromDiscord<Rika> i assume AES-CTR is implemented in a standard way right
03:06:45FromDiscord<jtv> Yeah, it's use AES to encrypt values in a sequence. Doesn't matter if you start at 0 or randomize it
03:07:12FromDiscord<jtv> The PRP assumption mandates you not re-use key/input pairs, that is the main constraint
03:07:45FromDiscord<jtv> The birthday paradox may also apply, so you shouldn't go for more than 2^60 or so blocks before rekeying with a new seed
03:08:00FromDiscord<jtv> But in practice, that's way beyond anyone's needs
03:08:29FromDiscord<Rika> In reply to @jtv "But in practice, that's": i'd imagine, 2^60 before "needing to do another syscall" sounds unlikely
03:09:50FromDiscord<jtv> Keying AES is actually relatively expensive. Nowhere near public key crypto costs of course
03:10:15FromDiscord<jtv> actual encryption is pretty damn cheap, especially when hardware accelerated
03:11:27FromDiscord<emanresu3> is there a way to have a lambda with generics?
03:11:35FromDiscord<Rika> no, not that i know of
03:12:11FromDiscord<Rika> a lambda is a value, and a generic cannot be a value as long as it is generic, so i dont think its possible
03:15:38FromDiscord<emanresu3> I see, but maybe I can find a workaround with a genSym that creates a named proc
03:15:56FromDiscord<emanresu3> Since I'm making a macro, I could probably work with that
03:23:31FromDiscord<Yepoleb> @jtv using aes requires an external library to ship with my code. That's annoying. Unless i code it up myself which will make cryptographer angry too.
03:24:43FromDiscord<Yepoleb> LCG goes brrrr haha
03:25:49FromDiscord<jtv> Uh, you can statically compile in what you need.
03:26:04FromDiscord<jtv> Even with nim you can do that
03:26:41FromDiscord<Yepoleb> Statically compiling does not eliminate the dependency
03:27:04FromDiscord<jtv> Of course it does, that's the whole point of static compilation
03:27:42FromDiscord<Yepoleb> You just put two files into one, that hardly makes any difference
03:28:39FromDiscord<jtv> You just conflate two things into one, that hardly make any sense
03:32:35FromDiscord<Yepoleb> I'm confused
03:33:04FromDiscord<jtv> Exactly, "You just put two files into one, that hardly makes any difference" makes no sense
03:34:26FromDiscord<Yepoleb> It does not matter if the crypto library is an additional file, including it at all is the problem
03:35:10FromDiscord<Yepoleb> Because it requires work to include it in the build process and takes up space
03:36:37FromDiscord<jtv> If you're only linking in a library that does AES, I can assure you its footprint in your binary will be miniscule compared to the standard library. And code that doesn't run will be paged out all the time at no cost to you, so who cares
03:36:52FromDiscord<jtv> So no, that's not a good reason
03:38:13*arkurious quit (Quit: Leaving)
03:39:42FromDiscord<Yepoleb> Still work to implement it and make it compile
03:40:27FromDiscord<jtv> So is using anything in the standard library?
03:40:49FromDiscord<jtv> I'm sure you can find someone to give you a no-code interface if you like
03:41:47FromDiscord<Yepoleb> I can copy paste a shitty non secure rng in seconds
03:42:16FromDiscord<Rika> so your issue is that no one has implemented it
03:42:21FromDiscord<jtv> You can also use openssl in seconds
03:42:23FromDiscord<Rika> or rather in nim
03:42:42FromDiscord<jtv> Or just use urandom, it is good enough
03:42:54FromDiscord<Yepoleb> Oof so slow
03:43:39FromDiscord<Rika> here we go again...
03:44:13FromDiscord<Yepoleb> In reply to @jtv "You can also use": The openssl api is pain
03:44:25FromDiscord<jtv> As someone who has spent a lot of his career on high performance at scale, I don't bat an eyelash at the cost, nor doesn't see why any reasonable person would (otherwise you should be trying to avoid every system call). But hey, to each his own.
03:44:35FromDiscord<Yepoleb> Almost all crypto apis are pain
03:45:00FromDiscord<jtv> I don't really care what you do personally, I am saying the default is not a good one. That's it, that's my only point.
03:45:22FromDiscord<Yepoleb> In reply to @jtv "As someone who has": Nobody uses urandom for high performance
03:46:01FromDiscord<ringabout> It can be used for seed.
03:46:02FromDiscord<Rika> :Gladsuna:
03:46:26FromDiscord<ringabout> `std/random` uses `unrandom` for that.
03:46:43FromDiscord<ringabout> (edit) "`unrandom`" => "`urandom`"
03:47:04FromDiscord<Yepoleb> Yes, but then you need a crypto library to extend it in a secure way
03:47:17FromDiscord<Yepoleb> One that pleases the security enthusiasts
03:47:44FromDiscord<jtv> Yet many people do plenty of things for performances' sake that they don't need, and isn't worth the time or money. That doesn't make it right, or make it worth trading off security in the average case where it doesn't fing matter.
03:48:07FromDiscord<jtv> Why default to insecure, go find the insecure version in std/stupidrandom if you really want to use it
03:48:49FromDiscord<jtv> That's absurd. Anyone who knows anything about security hates all crypto libraries, some more than others :). And the less code, the less attack surface.
03:49:42FromDiscord<Yepoleb> In reply to @jtv "Why default to insecure,": Because i don't want my pong clone to depend on fucking openssl
03:50:00FromDiscord<Yepoleb> snake clone
03:50:13FromDiscord<Yepoleb> I'm not sure pong is random
03:50:15FromDiscord<jtv> Yeah I don't either, and there's no reason it should. The system random is more than good enough as a default.
03:50:30FromDiscord<ringabout> Does `extern` have some side effects? I have to rely on this to forward a variable C and C++ code gen => https://stackoverflow.com/questions/3714808/forward-declarations-for-variables
03:51:45FromDiscord<jtv> No
03:52:02FromDiscord<jtv> It just means other modules in your app will be able to see the symbol
03:53:16FromDiscord<ringabout> Yeah, I see.
03:54:00FromDiscord<jtv> In C, it's basically C's way of declaring to the compiler that the symbol is going to be there at link time, so don't worry about it
03:54:42FromDiscord<ringabout> I hope so, https://github.com/nim-lang/Nim/pull/20977
03:56:12FromDiscord<jtv> If the symbol is truly defined in something you're linking to, you'll be fine 🙂
03:57:35FromDiscord<ringabout> Yeah, the declaration and the initialization are in the same module.
03:58:06FromDiscord<jtv> There's no performance penalty even in the slightest
03:58:22FromDiscord<ringabout> I see, thank you!
03:59:40FromDiscord<jtv> Any time
04:01:34FromDiscord<Yepoleb> @jtv honestly you do have a point about making it harder to use unsafe random numbers. I just had the argument because i thought your security above all attitude was annoying.
04:02:06FromDiscord<jtv> Honestly, that's not even remotely my attitude
04:02:35FromDiscord<jtv> Meaning, I think most security people definitely care too little about anything else
04:02:42FromDiscord<jtv> So I understand 🙂
04:04:49*derpydoo quit (Ping timeout: 260 seconds)
04:05:56FromDiscord<Yepoleb> In reply to @jtv "And again, even if": Stuff like this rubbed me the wrong way
04:06:15FromDiscord<Yepoleb> And then i had a twitter moment
04:07:22FromDiscord<jtv> I also think plenty of people overemphasize performance. Sometimes thinking about each is merited, sometimes it isn't. In this particular case, the cost/benefit analysis is in favor of keeping the average person safe, because it's no skin off the back of people who want to do something different. 99% of people are just going to go google "nim random number" or some variation, and just implement whatever is in std/random
04:08:51FromDiscord<jtv> If you care about performance, then your m.o. is going to be profiling and working on your hotspots. Even the average person there will just go w/ the default until it's the easiest way to make a difference, which won't be often.
04:13:25FromDiscord<Yepoleb> For something like procedual generation, like beef mentioned, having millions of syscalls will definitely slow things down
04:13:49FromDiscord<Yepoleb> But when you're doing that using the default rng is bad anyway
04:15:20FromDiscord<jtv> Right, and per the thread it wouldn't be too terribly hard to actually make the system random call both strong and far more performant than the system call.
04:26:33*ltriant joined #nim
04:44:34*ltriant quit (Ping timeout: 256 seconds)
05:35:22*ltriant joined #nim
05:43:23*ltriant quit (Ping timeout: 264 seconds)
06:26:19*rockcavera quit (Remote host closed the connection)
07:28:02*kenran joined #nim
07:32:15*kenran quit (Remote host closed the connection)
07:42:35FromDiscord<narimiran> With Advent of Code starting tomorrow, it's time to make our #aoc channel active again..... See you there 🙂
07:47:37*PMunch joined #nim
08:01:28NimEventerNew thread by miran: Advent of Nim 2022, see https://forum.nim-lang.org/t/9678
08:06:42FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=4hg0
08:09:08FromDiscord<luteva> so I understand that the condition is there, as the code is made step-by-step (which is great for learning). but it could be dropped, right?
08:12:53Amun-Rajtv: it's alwa a way of declaring opaque types
08:23:28FromDiscord<planetis> In reply to @luteva "Hi! I am reading": > Identifiers are nnkIdent nodes. After the name lookup pass these nodes get transferred into nnkSym nodes.
08:23:45FromDiscord<planetis> (edit) "nodes." => "nodes.↵https://nim-lang.github.io/Nim/macros.html"
08:24:55FromDiscord<planetis> you should leave both conditions
08:25:50FromDiscord<luteva> otherwise....? it could crash for some (special) input? or what would happen?
08:29:46FromDiscord<planetis> hmm, typed macros return resolved asts so you might think that's all nnkSym but they also return nodes of symbol choices according to https://nim-lang.github.io/Nim/macros.html#bindSym%2C%2CBindSymRule
08:30:23FromDiscord<planetis> in that case it might not matter? But why would it hurt to leave it as is. better ask beef
08:31:22FromDiscord<planetis> yea pass an overloaded proc name instead and see the difference
08:33:50NimEventerNew Nimble package! cppany - A wrapper for C++'s std::any, see https://github.com/sls1005/cppany
08:35:51*disso_peach quit (Quit: Leaving)
08:39:59*junaid_ joined #nim
08:40:19FromDiscord<luteva> In reply to @planetis "in that case it": Thanks @planetis ! Of course it doesn't hurt. 🙂↵I just want to understand (that's why i ask "why?"). 🙂
09:01:31FromDiscord<luteva> did i understand aright? The "quote do:" is for macros only. And with "quote do:" you can write the macro as a nim code "template" with 'parameters' that get inserted into the code you want to generate. Instead of writing the commands to generate the AST.
09:05:53FromDiscord<vindaar> yes, that's essentially correct. Note that nowadays there is also `genAsts` https://nim-lang.org/docs/genasts.html which may be a bit more convenient to work with
09:08:20FromDiscord<planetis> There is also a DSL for declaring the ast tree in fusion
09:09:14FromDiscord<planetis> Sometimes it's more convenient to use quote do/genast others buildast
09:18:08FromDiscord<planetis> In reply to @luteva "Thanks <@915614219364368394> ! Of": Running on an ident crashes https://play.nim-lang.org/#ix=4hge
09:18:08FromDiscord<luteva> nim is so great!! ❤️
09:22:35PMunch@luteva, @vindaar, there is also superquote: https://github.com/PMunch/macroutils
09:23:06FromDiscord<aolko (aolko)> nim might be great, but it lacks sugar and community is goddamn terrible
09:24:40FromDiscord<planetis> wow there
09:25:10FromDiscord<planetis> who's terrible, you?
09:26:18FromDiscord<planetis> I mean do you enjoy defaming others who are trying their best?
09:27:04FromDiscord<planetis> and when that special snowflakes bullshit will stop
09:27:14PMunchAnd Nim has plenty of sugar?
09:27:49PMunchNot quite sure who pissed in their cereal, the Nim community is typically super helpul
09:28:26FromDiscord<ajusa> What is the macro library that uses string interpolation? I can't remember the name for the life of me
09:28:39FromDiscord<ajusa> The author has a few other nim repos as well iirc
09:28:42PMunchFor creating macros?
09:28:47FromDiscord<ajusa> Yes
09:29:08FromDiscord<ajusa> They had an example using an enum to generate variables by looping over them
09:30:41FromDiscord<planetis> rust zealots attack without any justification, they just can't help it
09:31:06PMunch@ajusa, hmm not sure if I've heard of that one. But it sounds pretty nice
09:31:21FromDiscord<planetis> I've been harassed in the comments by just saying I like nim
09:31:30PMunch@planetis, which comments?
09:31:32FromDiscord<ajusa> I even used it once, and I opened an issue which the author fixed.
09:31:36FromDiscord<planetis> youtube
09:31:44FromDiscord<ajusa> BUT I CAN'T SEEM TO FIND IT AGAIN
09:32:23PMunch@ajusa, go to github.com/issues
09:32:54PMunchThen rewrite the filter to is:closed is:issue author:@ajusa for example
09:33:44FromDiscord<ajusa> Thanks, managed to find it: https://github.com/geekrelief/genit
09:33:59FromDiscord<ajusa> Don't think it is on nimble either, no wonder I had a tough time finding it
09:36:13PMunchOoh, that is pretty neat
09:36:19PMunchShame it's not on Nimble though..
09:39:38FromDiscord<luteva> why not asking the author to add it? Or ask him/her what licence the lib uses and if it is free/open, fork it and add that one to nimble...?
09:41:07FromDiscord<aolko (aolko)> > ↵> who's terrible, you?↵> ~~nou~~, community members
09:41:43FromDiscord<Elegantbeef> You can just say my name I dont mind
09:42:07FromDiscord<aolko (aolko)> > I mean do you enjoy defaming others who are trying their best?↵no, in fact i both "hate" and pity them
09:42:27PMunchLet's not start anything here, aolko, feel free to comment in the private message I sent you :)
09:42:55FromDiscord<aolko (aolko)> i'm on the jankiest gitter client ever - the webapp
09:43:02PMunchSo am I
09:43:13FromDiscord<aolko (aolko)> so i didn't receive anything so far
09:43:40FromDiscord<planetis> I am an asshole you can say it, i dont mind either
09:43:57FromDiscord<PMunch (Peter Munch-Ellingsen)> Strange, you could try to send me a message?
09:44:03FromDiscord<aolko (aolko)> trying
09:44:36FromDiscord<Elegantbeef> @luteva\: if you remove that condition and provide an type that's not supported for that macro it'll error something unhelpful
09:45:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hgk
09:45:35FromDiscord<Elegantbeef> `/usercode/in.nim(3, 9) Error: node is not a symbol`
09:45:40FromDiscord<Elegantbeef> Is not a helpful error for the user
09:46:13*disso_peach joined #nim
09:46:54FromDiscord<luteva> uh yeah. That's it! 👍
09:47:26FromDiscord<Elegantbeef> You can use `expectKind` from macros but it's againt not useful for the user
09:47:43FromDiscord<Elegantbeef> When i write macros i tend to use `error` cause it actually provides useful error messages
10:09:05*junaid_ quit (Remote host closed the connection)
10:21:20FromDiscord<aolko (aolko)> sent a long message, see http://ix.io/4hgr
10:22:35FromDiscord<aolko (aolko)> sent a long message, see http://ix.io/4hgs
10:23:42FromDiscord<aolko (aolko)> sent a long message, see http://ix.io/4hgt
10:30:58FromDiscord<ShalokShalom> @aolko (aolko)#0000 you might like to join nimskull, idk
10:31:49FromDiscord<aolko (aolko)> i'm not talking about joining an existing project
10:32:05FromDiscord<aolko (aolko)> after all there might be conflicts
10:33:48FromDiscord<emanresu3> Hi @ShalokShalom , thanks again for putting my pipe repo on nim-awesome
10:34:59FromDiscord<emanresu3> I recall you were interested in a composition operator for Nim, I'm just getting started with that here https://codeberg.org/emanresu3/nim-compose, it's not very usable at the moment
10:35:36FromDiscord<Rika> woah thats cool
10:36:41FromDiscord<aolko (aolko)> .🤔
10:42:08FromDiscord<jmgomez> In reply to @emanresu3 "I recall you were": looks pretty cool. Nim is missing some partial application. Would be nice if it where in GitHub though, much easier to keep track of the progress there
10:43:37FromDiscord<Rika> In reply to @jmgomez "looks pretty cool. Nim": what's wrong with codeberg?
10:44:25FromDiscord<jmgomez> I guess it's just me, but I didnt know it even existed until now
10:49:03FromDiscord<emanresu3> Thanks, I'm trying to make it type generic, but still can't figure out how↵(@jmgomez)
10:49:39FromDiscord<emanresu3> Yeah, Github just gives me headaches sorry
10:53:59*ltriant joined #nim
10:57:23PMunchHaden't heard of Codeberg either, it's like an open-source GitHub?
10:58:40PMunchLooks suspiciously similar to GitHub :P
11:01:11FromDiscord<Yardanico> It's a Gitea instance operated by a non-profit in EU
11:01:18FromDiscord<Yardanico> Well, they run a fork of Gitea
11:32:55FromDiscord<ShalokShalom> In reply to @emanresu3 "I recall you were": Yeaaah 🥳🥳
11:33:35FromDiscord<ShalokShalom> In reply to @Yardanico "Well, they run a": Do they?
11:33:41FromDiscord<Yardanico> yes
11:33:43FromDiscord<ShalokShalom> Interesting, didn't knew
11:33:55FromDiscord<Yardanico> https://codeberg.org/Codeberg/gitea
11:34:11FromDiscord<Yardanico> https://docs.codeberg.org/getting-started/what-is-codeberg/
11:35:08FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4hgF
11:35:14FromDiscord<Rika> why
11:35:21FromDiscord<ShalokShalom> Why what?
11:35:21FromDiscord<Rika> why the mirror, i mean
11:35:49FromDiscord<ShalokShalom> Ah. Because he/she does want to host on Codeberg and dont like to open a Github account.
11:36:32FromDiscord<Rika> wouldnt you need a gh to mirror
11:36:34FromDiscord<ShalokShalom> I published via nimble for him/her, and also cloned the according repo, for clearity.↵↵Some people only find packages via Github.
11:37:14FromDiscord<ShalokShalom> In reply to @Rika "wouldnt you need a": Yeah, this is what I was asking myself.↵↵If that is possible with his/her account on Codeberg and mine on Github.
11:38:34FromDiscord<ShalokShalom> I also have a Codeberg account, if that helps.↵↵https://codeberg.org/ShalokShalom
11:43:16FromDiscord<emanresu3> I really don't mind forks on github, just don't want an account there myself. If it's a mirror through your account I'm fine with it \:)
11:44:59FromDiscord<emanresu3> I'm gonna do a bit on those repos once I get my vacations this weekend, and will see if after that I get more time or someone would like to fork/maintain it
11:45:28FromDiscord<ShalokShalom> Nice
11:45:32FromDiscord<ShalokShalom> Thanks a lot
11:45:34FromDiscord<Rika> get to it shalok
11:45:35FromDiscord<Rika> smh
11:46:51FromDiscord<ShalokShalom> I am on my way 😄
11:47:05FromDiscord<ShalokShalom> Love that you choose >>
11:47:12FromDiscord<ShalokShalom> Makes me feel at home
11:47:24FromDiscord<ShalokShalom> F# vibes
11:48:00FromDiscord<ShalokShalom> @Rika You know their https://codeberg.org/emanresu3/nim-pipexp already?
11:49:22FromDiscord<Rika> nope
11:49:29FromDiscord<Rika> what does it do
11:49:52FromDiscord<Rika> olh
11:49:59FromDiscord<Rika> thats deffo a name i misread lmao
11:50:28FromDiscord<emanresu3> Haha yeah, I saw that F# does that, I initially wanted ∘ like Julia, but having composition both ways it's cool as well↵(@ShalokShalom)
11:51:06FromDiscord<ShalokShalom> I think the PR is still pending. Maybe someone can do something about it?↵↵https://github.com/nim-lang/packages/pull/2415
11:51:17FromDiscord<ShalokShalom> In reply to @emanresu3 "Haha yeah, I saw": Yes, totally
11:51:41FromDiscord<Phil> In reply to @Rika "thats deffo a name": TFW you see pip everywhere
11:51:56FromDiscord<luteva> suppose i would like to use limdb (https://github.com/capocasa/limdb) for storing some data and i would like to store an int (not just a string). so i have to find out the length of the data(or the type) to be stored as Blob/bytes.↵But an int can be int8/16/32/64. so how can i find out the length of the int what's the way to go?
11:52:27FromDiscord<luteva> (edit) "int" => "int?"
11:53:26FromDiscord<Phil> You could force transform from int to whatever int you want (int64?)
11:53:32FromDiscord<Phil> (edit) "You could force transform from int to whatever int you want (int64?) ... " added "before storing"
11:53:56FromDiscord<Phil> int --> int64 --> stored --> int64 (when retrieved from db) --> int
11:53:58FromDiscord<luteva> ok yes. so always choose the biggest, should work.
11:54:26FromDiscord<Phil> Are you doing embedded stuff so is memory or storage capacity potentially a problem?
11:55:06FromDiscord<luteva> is there a way to extract the compile time property/architecture to detect the correct int(8/16/...)?
11:56:32FromDiscord<Phil> In reply to @luteva "is there a way": I don't recall anything off the top of my head, but would check out the libs system and std/os
11:56:32FromDiscord<luteva> In reply to @Isofruit "Are you doing embedded": no! I will do it choosing the biggest, as you suggested. I now just want to know, how it could be done in case there are capacity problems 🙂
11:57:01FromDiscord<Phil> (edit) "system" => ""system"" | "std/os" => ""std/os""
12:00:35FromDiscord<Rika> In reply to @Isofruit "TFW you see pip": MFW
12:00:58*jmdaemon quit (Ping timeout: 252 seconds)
12:06:13FromDiscord<Phil> In reply to @luteva "no! I will do": Going through it, first approach I'm seeing is doing "sizeof" on a variable
12:06:34FromDiscord<Phil> or even a type
12:07:01FromDiscord<Phil> `sizeOf int` e.g. returns "8" for me, so 8 bytes, meaning my int is by default int64
12:08:14FromDiscord<Phil> Having solved that, if you're looking for something more direct you're free to read through the rest of the system lib yourself 😛
12:10:29FromDiscord<ringabout> Hello, @Phil do you happen to have some time to approve the CI? https://github.com/PhilippMDoerner/Snorlogue/pull/12
12:10:43FromDiscord<Phil> Ah, right, good point!
12:11:36FromDiscord<ringabout> Thanks
12:12:30FromDiscord<Phil> Just writing up a commit message so I'll remember in 2 years why that commit was made
12:14:06FromDiscord<luteva> In reply to @Isofruit "Having solved that, if": Hi! Thanks. I also just tested the sizeOf. int64 is default on my system, too.
12:14:07FromDiscord<luteva> 🙂
12:14:11FromDiscord<Phil> Now to figure out later why the hell my `nimble nimidocs` task straight up doesn't finish on my github docs pipeline
12:14:34FromDiscord<Phil> In reply to @luteva "Hi! Thanks. I also": I mean, it better be, we migrated off 32bit in like.... was that 2010?
12:14:48FromDiscord<Phil> How long have we been in a 64 bit world by now?
12:14:59FromDiscord<Phil> Win7 was the last 32bit version, right?
12:15:39FromDiscord<Phil> Actually, nobody answer that, I'm fairly sure once I know I'll just feel old again
12:15:48FromDiscord<luteva> 😄
12:16:46FromDiscord<Phil> ... ringabout, how deep lies your experience on github pipelines involving compiling nimibook?
12:17:03FromDiscord<Rika> In reply to @Isofruit "I mean, it better": help why is my default int size 16bit
12:17:06FromDiscord<Rika> 😛
12:17:43FromDiscord<Phil> I'm pretty sure I'm not old enough to have ever touched a 16bit OS
12:17:55FromDiscord<Phil> Are you on a raspberry pi or sth?
12:19:15FromDiscord<ringabout> In reply to @Isofruit "... ringabout, how deep": I don't use `nimibook` though. It runs locally. That's it.
12:19:31FromDiscord<ringabout> I checked the error message before.
12:19:52FromDiscord<Phil> In reply to @ringabout "I don't use `nimibook`": Fair... maybe I should just copy paste how norm does it.↵But they do it in a docker container which seems like a paaaaaaaiiiiin
12:21:32FromDiscord<ringabout> Perhaps it hangs because of a bug.
12:21:38FromDiscord<ringabout> (edit) "hangs" => "hanged"
12:23:29FromDiscord<ringabout> (edit) "hanged" => "hangs"
12:25:22FromDiscord<Rika> In reply to @Isofruit "Are you on a": a raspberry pi is max 32 bit
12:25:25FromDiscord<Rika> i mean, min
12:25:44FromDiscord<Rika> i dont think there are popular modern 16 bit computers
12:26:25FromDiscord<Phil> Hm, maybe in the embedded world
12:26:29FromDiscord<Phil> But the embedded world is weird anyway
12:31:46FromDiscord<Rika> embedded world usually jumps to 32 bit after 8 bit
12:31:55FromDiscord<Rika> not often does one bother with 16 anymore
12:36:33FromDiscord<ringabout> In reply to @Isofruit "Fair... maybe I should": Switched to ubuntu to build docs, it should work now => https://github.com/PhilippMDoerner/Snorlogue/actions/runs/3583313879/jobs/6028596708
12:37:40FromDiscord<ringabout> The half CI failed because the pull request don't have the access to build docs,
12:37:46FromDiscord<Phil> The deploy step I'll likely have to fix later, but that one's on me. It does get through the doc-compilation stage though, that is a gigantic step forward as I've been stuck on that since yesterday evening
12:37:50FromDiscord<ringabout> https://github.com/PhilippMDoerner/Snorlogue/pull/13
12:38:08FromDiscord<ringabout> (edit) "half" => "deplot"
12:38:17FromDiscord<ringabout> In reply to @ringabout "The deplot CI failed": Which is expected.
12:39:46FromDiscord<ringabout> You can report the issue to nimibook, maybe they can figure out something.
12:41:11FromDiscord<Phil> Wait a second, this step seems to be a general problem for auth↵> Error: You have to provide a GITHUB_TOKEN or GH_PAT↵But this worked before, what the heck.↵That's why I set up a token env variable
12:41:24FromDiscord<Phil> (edit) "Wait a second, this step seems to be a general problem for auth↵> Error: You have to provide a GITHUB_TOKEN or GH_PAT↵But this worked before, what the heck.↵That's why I set up a token env variable ... " added "and put that into the docs.yml"
12:41:44FromDiscord<ringabout> (edit) "You can report the ... issue" added "former"
12:45:58FromDiscord<ringabout> It is weird that the push failed at nimibook building while the pull request succeeded.
13:18:29FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=4hhb
13:18:54FromDiscord<luteva> or does it have es special meaning?
13:20:00FromDiscord<Rika> semicolon has special meaning
13:20:24FromDiscord<Rika> lets say `proc whatever(a, b: int)` a and b are both int
13:21:20FromDiscord<Rika> `proc whatever(a; b: int)` a is not an int (it is either not valid if no `using a: sometype` or is that type if `using` is used), b is
13:22:31FromDiscord<luteva> ok so in the above example it is equivalent, as both parameters have their own type given, right?
13:24:19FromDiscord<luteva> (edit) "it is" => "using a comma would be"
13:41:20FromDiscord<pyolyokh> yep.
13:51:17*derpydoo joined #nim
14:05:47FromDiscord<sOkam!> how do you format a float to a string with max N decimals?
14:06:11FromDiscord<sOkam!> i know of $, but its getting all decimals, and don't know how to format it. plus std/strformat docs are omega confusing
14:06:48*Phytolizer joined #nim
14:07:14FromDiscord<sOkam!> aiming for the C equivalent to: `"%.3f", thevar`
14:09:01FromDiscord<pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4hhm
14:10:42*rockcavera joined #nim
14:13:03FromDiscord<sOkam!> ty
14:14:40*PMunch quit (Quit: Leaving)
14:25:07FromDiscord<Phil> In reply to @ringabout "It is weird that": The pain of github actions
14:36:51FromDiscord<ringabout> In reply to @Isofruit "The pain of github": finally
14:40:54FromDiscord<Phil> Wait, it built? I call hax!
14:41:10FromDiscord<Phil> Okay, now I need to figure out what the url to the nimibook docs are
14:42:15FromDiscord<Phil> Oh nice, it's literally right under "bookCompiled"
14:42:27FromDiscord<ringabout> https://philippmdoerner.github.io/Snorlogue/bookCompiled/
14:42:35FromDiscord<Phil> I may need to rename a couple folders here and there, but sweet
14:43:31FromDiscord<Phil> One of these days I'll have docs where the lists don't get mangled in formatting https://media.discordapp.net/attachments/371759389889003532/1047523273338003546/image.png
14:44:08FromDiscord<ringabout> Good luck 😆
14:44:18FromDiscord<Phil> In reply to @ringabout "https://philippmdoerner.github.io/Snorlogue/bookCom": Thank you very, very, very much btw. for your help here
14:44:29FromDiscord<ringabout> My pleasure
14:50:10*disso_peach quit (Ping timeout: 265 seconds)
14:59:52FromDiscord<ringabout> Why is the test action not triggered?
15:08:18*Phytolizer quit (Ping timeout: 260 seconds)
15:21:39FromDiscord<ShalokShalom> In reply to @Isofruit "Wait, it built? I": Sentence to frame it and putting it on the wall 😄
15:26:36FromDiscord<jmgomez> Is correct to assume that poll(0) doesnt block?
15:29:41FromDiscord<@thatrandomperson5-6310e3b26da03> How wou
15:29:51FromDiscord<@thatrandomperson5-6310e3b26da03> d i make a dns server in nim
15:30:01FromDiscord<@thatrandomperson5-6310e3b26da03> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1047534892252151920): How woul
15:39:34FromDiscord<leetnewb> Could you look through the dnsmasq source, interface with your nim code, and replace it piece by piece?
15:53:11FromDiscord<jtv> @jmgomez If the timeout field to the system poll() is 0, it will not block, correct.
16:41:59FromDiscord<Phil> In reply to @ringabout "Why is the": I'm pretty sure there is no test action, at least I didn't intentionally add any, there may be some left over from copy-pasting
16:42:29FromDiscord<ringabout> In reply to @Isofruit "I'm pretty sure there": https://github.com/PhilippMDoerner/Snorlogue/blob/main/.github/workflows/action.yml ?
16:44:47FromDiscord<Phil> In reply to @ringabout "https://github.com/PhilippMDoerner/Snorlogue/blob/m": Ahhh leftover from copy pasting. And it doesn't run because it requires pushes or prs on stable or devel, I have neither of those branches, I got main, master, github pages and whatever weird branch the github bot added
16:45:25FromDiscord<Phil> devel is for when you actually released something and need to keep a version stable somewhere 😛
16:45:35FromDiscord<Phil> (edit) "somewhere" => "on main"
16:45:53FromDiscord<Phil> Not having it symbolizes that snorlogue is still the wild wild west
17:10:22*jmdaemon joined #nim
17:37:37*jmcantrell quit (Quit: Bridge terminating on SIGTERM)
17:43:02*jmcantrell joined #nim
17:45:17FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4hii
17:46:49FromDiscord<jtv> (edit) "https://play.nim-lang.org/#ix=4hii" => "https://play.nim-lang.org/#ix=4hik"
17:57:47*LuxuryMode quit (Quit: Connection closed for inactivity)
17:59:32FromDiscord<ringabout> In reply to @jtv "Something really weird is": Firstly, the devel branch defaults to ORC. Using `--mm:refc` still works. Secondly, the internal representation of string in ARC/ORC is no long a pointer. You cannot cast it to `int`.
18:01:49*junaid_ joined #nim
18:02:32FromDiscord<Elegantbeef> Thirdly on refc you need to do `GcRef` to keep a GC'd reference alive
18:02:38FromDiscord<albassort> is there anyway to kill a thread?
18:02:43FromDiscord<Elegantbeef> And `GCUnref` to destroy it
18:02:52FromDiscord<albassort> actually
18:02:55FromDiscord<albassort> certainly not
18:02:58FromDiscord<albassort> hmmm
18:03:04FromDiscord<Elegantbeef> Nope there is not, atleast in the stdlib threads
18:03:56FromDiscord<ringabout> It conflicts destructors, I don't think it will be implemented in the future.
18:04:06FromDiscord<albassort> im trying to get around the httpclient deadlocking problem by timingout and then culling threads and instantiating the thead
18:04:33FromDiscord<ringabout> (edit) "It" => "Killing a Thread" | "Killing a Threadconflicts ... destructors," added "with"
18:04:36FromDiscord<Elegantbeef> Why use async properly when you can bolt 10 different features together
18:05:03FromDiscord<albassort> im already doing async
18:05:15FromDiscord<albassort> (just on threads)
18:05:27FromDiscord<jtv> That's not casting a string to an int.
18:05:58FromDiscord<albassort> ???
18:06:03FromDiscord<jtv> It's assuming I'm only ever going to call test with a box that has an int in it
18:06:30FromDiscord<Elegantbeef> Why do you need the cast then?
18:07:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hiu
18:07:31FromDiscord<Elegantbeef> or `getString` if you prefer
18:07:36FromDiscord<pyolyokh> that code'll let you store something int-like in an int by having T differ from box.kind
18:09:32FromDiscord<ringabout> Nim cast in ARC doesn't support arbitrary cast.
18:09:39FromDiscord<ringabout> (edit) "cast." => "casting."
18:12:21FromDiscord<pyolyokh> specifically, it doesn't like the cast[int](somestring) that's possible, even though it never happens
18:12:36*derpydoo quit (Ping timeout: 248 seconds)
18:13:34FromDiscord<Elegantbeef> To get arbitrary casting working all you really need to do is `cast[ptr T](myT.addr)[]`
18:13:57FromDiscord<Elegantbeef> but in reality what i suggested above is saner
18:14:35FromDiscord<ringabout> `casts are allowed as long as castDest.size >= src.size`
18:14:47FromDiscord<huantian> huh that's neat
18:14:48FromDiscord<ringabout> (edit) "as long as" => "when"
18:15:08FromDiscord<Elegantbeef> What is?
18:15:52FromDiscord<ringabout> In reply to @ringabout "`casts are allowed when": One condition from comments in `isCastable`
18:16:23FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4hiy works fine with arc and refc
18:16:36FromDiscord<huantian> how safe!
18:17:27FromDiscord<jtv> Okay, that's all helpful, and I'll check it out in a second
18:18:42FromDiscord<Elegantbeef> For completion's sake this is the 'more proper' way https://play.nim-lang.org/#ix=4hiz
18:18:53FromDiscord<albassort> what about orc
18:18:55FromDiscord<albassort> :\
18:19:05FromDiscord<Elegantbeef> Orc and Arc are the same for 99% of semantics
18:19:18FromDiscord<Elegantbeef> Orc is Arc + cycle collector
18:19:25FromDiscord<albassort> orc is like 0.01% faster sometimes
18:19:35FromDiscord<albassort> (from my testing)
18:19:41FromDiscord<albassort> (on my machine)
18:19:42FromDiscord<Elegantbeef> Margin of error i'd say
18:19:44FromDiscord<albassort> (non-scientifically)
18:19:58FromDiscord<Elegantbeef> Arc and Orc with non cyclical types are identical
18:20:01FromDiscord<huantian> In reply to @Elegantbeef "For completion's sake this": time to write a macro to create enums, fields, and procs for an arbitrary list of types!
18:20:19FromDiscord<Elegantbeef> The only difference is when you have a cyclical graph
18:21:10FromDiscord<Elegantbeef> Meh just use oop at that point huan
18:21:35FromDiscord<huantian> hehe
18:22:36FromDiscord<Elegantbeef> The nice part though is you get an interface for unpacking/packing your own types to/from the box type in the variant example
18:22:52FromDiscord<Elegantbeef> Can even pack floats in there if you really hated yourself 😄
18:23:32FromDiscord<huantian> yeah ig if you wanted arbitrary types you could just use a generic type as well
18:24:18FromDiscord<Elegantbeef> After playing around with my toy ecs I now see tuples as varadic generics 😄
18:31:41FromDiscord<Phil> In reply to @Elegantbeef "Why use async properly": Because potatoe's taste best when properly seasoned and used as filling in dumplings
18:31:47FromDiscord<Phil> (edit) "potatoe's" => "potato's"
18:32:01FromDiscord<Phil> I am hungry and wanted to make a joke
18:32:12FromDiscord<Phil> And now I made myself hungrier
18:32:39FromDiscord<huantian> huh I never put potatos in dumplings
18:32:43FromDiscord<huantian> is that an actual thing?
18:32:50FromDiscord<Elegantbeef> That joke makes 0 sense when your only experience is american dumplings
18:33:02FromDiscord<Phil> It is, and they were among the best dumplings I've ever eaten
18:33:02FromDiscord<Elegantbeef> Which is just bread cooked in a broth
18:33:30FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4hiE
18:33:43FromDiscord<Elegantbeef> Other places huan make dumplings like perogies
18:33:45FromDiscord<jtv> Whoops, replied to the wrong one, I meant the cast
18:33:49FromDiscord<huantian> ah true
18:34:21FromDiscord<Elegantbeef> We generally get "Chicken and Dumplings" which is just soggy bread water 😛
18:35:06FromDiscord<jtv> I'm effectively already keeping detailed type info around for the items in the box so to speak, but they can be complex types, so just having a single function per type isn't going to work
18:35:55FromDiscord<Elegantbeef> I mean I already provided a procedure that handles like 10 types 😄
18:37:48FromDiscord<jtv> It's fine though, understanding why it broke is all I needed to fix the code, thanks again
18:39:50FromDiscord<hotdog> In reply to @Elegantbeef "Arc and Orc with": I read this as "cylindrical types" and was very confused for a moment
18:41:57FromDiscord<albassort> ok is there any reason why div (/) have to be of two floats and cant be of floats and integers
18:42:12FromDiscord<albassort> >:O
18:42:25*disso_peach joined #nim
18:42:30FromDiscord<jtv> Eh? It can be two ints
18:42:35FromDiscord<jtv> The types must match though
18:42:47FromDiscord<albassort> why though
18:42:48FromDiscord<jtv> So if you want to divide an int and a float, just do: float(i)
18:42:53FromDiscord<albassort> yes but why
18:43:09FromDiscord<jtv> Automatic typecasting leads to bugs
18:43:11FromDiscord<hotdog> @albassort check out https://nim-lang.org/docs/lenientops.html
18:43:49FromDiscord<huantian> yeah you dont' want to accidentally lose information when converting from int to float
18:43:58FromDiscord<albassort> thats why you size up
18:44:24FromDiscord<huantian> with cases like division ig it's better to be more explicit
18:44:27FromDiscord<albassort> because obviously binary arithmetic must be done between two equally sized integers
18:44:34FromDiscord<albassort> but
18:44:41FromDiscord<albassort> still
18:44:55FromDiscord<albassort> im pretty sure its a side affect of static
18:45:12FromDiscord<albassort> im too lazy to type now
18:45:16FromDiscord<albassort> humans are hard to talk to
18:45:18FromDiscord<albassort> 👋
18:46:06FromDiscord<jtv> Another minor nit, how should I properly express that I actually mean to do this kind of cast, or do I just need to add the pragma to suppress the warning (which I hate to do): `Warning: target type is larger than source type`
18:46:56*pro joined #nim
18:50:40*nisstyre quit (Ping timeout: 252 seconds)
18:51:22*xet7 joined #nim
18:51:30*nisstyre joined #nim
18:51:30FromDiscord<huantian> I'd assume suppressing the warning is how you'd express that you mena to do this cast
18:52:59*junaid_ quit (Remote host closed the connection)
19:00:25FromDiscord<jtv> Casting is supposed to say "I know what I'm doing in this type conversion" already 🙂
19:36:28*arkurious joined #nim
19:57:27Amun-Rato explicite one?
19:57:56FromDiscord<demotomohiro> In reply to @jtv "Casting is supposed to": Do you want to cast from larger type to smaller type even if you get random bits?↵https://github.com/nim-lang/Nim/issues/19101
20:00:33FromDiscord<demotomohiro> from smaller type to larger type.
20:01:38FromDiscord<demotomohiro> `copyMem` is safer than casting from smaller type to larger type.↵https://github.com/demotomohiro/littlesugar/blob/main/src/littlesugar/bitwiseCopy.nim
20:02:42*krux02 joined #nim
20:06:48FromDiscord<Michal Maršálek> Wanted to setup Visual Studio Code as my editor for this year's Advent of Code. Which is the best extension?
20:09:47Amun-Raiirc one is abandoned, can't remember which one
20:10:30FromDiscord<Michal Maršálek> ok, I'll install the more recently updated one
20:12:09FromDiscord<Michal Maršálek> ty
20:15:01Amun-Raprosim
20:20:14*kenran joined #nim
20:28:41*pro quit (Quit: pro)
20:40:21*junaid_ joined #nim
20:51:46FromDiscord<auxym> nim saem is the good one
21:04:08*attah_ joined #nim
21:04:24*attah quit (Ping timeout: 264 seconds)
21:04:54*attah_ is now known as attah
21:06:58FromDiscord<jtv> @demotomohiro In the specific case I'm getting the errors on, it's a single field of a variant record in a case where the other bits would 100% be zero unless the underlying memory wasn't zero-initialized on allocation. Which would be quite surprising behavior.
21:08:16FromDiscord<jtv> And I think if the purpose of the warning is to alert them because they might be getting random bits, I'd think the error message should explain that fact, otherwise many will just tune it out.
21:11:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hje
21:12:51FromDiscord<Elegantbeef> Level isnt an enum
21:12:53FromDiscord<Elegantbeef> It's a subrange type
21:13:21FromDiscord<Phil> It is 10pm and I did a talk, it appears I'm also more braindead than I should be allowed to write code
21:13:23FromDiscord<Phil> God damn
21:13:49FromDiscord<Elegantbeef> also `myEnum: T` expects a value not a typedesc
21:13:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjf
21:14:15FromDiscord<Elegantbeef> You did it all by yourself!
21:14:42FromDiscord<Phil> I was playing around a lot with "does it have to be typedesc, does it not have to be?" so I accidentally copy pasted the wrong version
21:14:54FromDiscord<Phil> Which, given the kinds of mistakes I'm making atm, isn't that surprising I guess
21:16:56FromDiscord<Phil> Can I do a generic that accepts all kinds of ranges that does something similar? hmmmm
21:17:12*junaid_ quit (Remote host closed the connection)
21:17:36FromDiscord<Elegantbeef> `T: range` and `low(T)..high(T)`
21:18:32FromDiscord<Elegantbeef> Really you could do `SomeOrdinal or (enum and Ordinal)`
21:18:46FromDiscord<Elegantbeef> But have fun when you accidently do `iterateOver(int64)`
21:18:50FromDiscord<Phil> One thing after another
21:19:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hji
21:21:59FromDiscord<Elegantbeef> Built in typeclasses are magic
21:26:09FromDiscord<Phil> In reply to @Elegantbeef "Really you could do": Chances are I'll be forced to do so
21:27:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjn
21:28:16FromDiscord<Phil> I have no idea how Tainted string fits into both of em as apparently it's an enum and a range at once (?)
21:28:48FromDiscord<Elegantbeef> It's neither of them
21:29:22FromDiscord<Elegantbeef> Also tainted string jesus i havent heard that name in a long time
21:29:30FromDiscord<Phil> Then how is this an ambiguous call?↵I thought it can only be an ambiguous call if both procs overloads can be used to run sth
21:30:07FromDiscord<Phil> In reply to @Elegantbeef "Also tainted string jesus": The only reason I even know Tainted strings exist is because I looked into the systems module during lunch today, I swear none of my code ever used it directly or was even aware of it
21:30:18FromDiscord<Phil> So I have no idea where that tainted string business is even coming from
21:30:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4hjp
21:30:53FromDiscord<Elegantbeef> TaintedString is an old idea to make all strings coming from unsafe APIs to be sanitised to string first
21:31:09FromDiscord<Elegantbeef> It's been deprecated and now is an alias to `string` afaik
21:31:47FromDiscord<Phil> okay then... how the hell is it even popping up
21:31:56FromDiscord<Phil> one sec, I'll provide a bit more code
21:34:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjq
21:35:02FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4hjq" => "https://play.nim-lang.org/#ix=4hjr"
21:35:33FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4hjr" => "https://play.nim-lang.org/#ix=4hjs"
21:35:59FromDiscord<Phil> So how any of this is even remotely ambiguous is beyond me
21:36:34FromDiscord<Elegantbeef> Might just be a generic bug
21:36:45FromDiscord<Phil> I have 2 generic `toFormField` covering `range` and `enum`↵I have multiple non-generic `toFormField` covering int, float, string, bool and something else I think
21:36:50FromDiscord<Elegantbeef> also `value is not Option` is sinful 😄
21:37:10FromDiscord<Phil> is `isnot` more correct?
21:37:19FromDiscord<Elegantbeef> Correct
21:37:31FromDiscord<Phil> Works for me
21:37:56FromDiscord<Phil> Unlike ambiguity!
21:38:24FromDiscord<Elegantbeef> `value isnot A or B` works whereas `value is not A or B` does not due to operator precedence
21:38:44FromDiscord<Elegantbeef> I lie 😄
21:38:45FromDiscord<Phil> Alright, so the workaround for my bug is one combined generic for range+enum
21:38:48FromDiscord<Elegantbeef> smoke bomb
21:39:01FromDiscord<Elegantbeef> Odd that you need it but it's not big deal
21:39:07FromDiscord<Elegantbeef> It's the same proc twice really
21:39:20FromDiscord<Elegantbeef> Unless you use holey enums like a satanist
21:39:31FromDiscord<Phil> I was actually keeping holey enums in mind
21:39:36FromDiscord<Phil> I have no idea about their uses
21:39:47FromDiscord<Phil> But I didn't want to exclude anything unless technically necessary
21:39:53FromDiscord<Phil> Which in this case it appears to be
21:41:54FromDiscord<Elegantbeef> well then do `range or (Ordinal and enum)`
21:41:58FromDiscord<Elegantbeef> and your other one can be `enum and not Ordinal`
21:41:59FromDiscord<Elegantbeef> `HoleyEnum` and `OrdinalEnum` exists in typetraits
21:41:59FromDiscord<Elegantbeef> If you want to save a few tippity taps
21:42:38FromDiscord<Phil> Nah, it's fine. I mean, these are just "default" procs, the other can override them at any time by specifying their own `toFormField` proc specifically for their enum type
21:43:04FromDiscord<Phil> If I understood call priority correctly, if they define their proc then it'll be used over whatever generic I provide, if not there's still my generic as a fallback
21:43:23FromDiscord<Elegantbeef> Correct the most specific procedure in scope of first instantiation is used
21:43:49FromDiscord<Elegantbeef> yes first instantiation is always important, but almost never an issue
21:45:28FromDiscord<Phil> Okay, now the type system or sth is just messing with me
21:51:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjv
21:51:55FromDiscord<Phil> Wait a sec, do I need to convert to int... most likely
21:52:41FromDiscord<Phil> Nope, still breaks even with ` result.intSeqVal = value.map(val => val.int)` in Line 72
21:53:16FromDiscord<Phil> Flipping tainted strings
21:56:44*attah quit (Ping timeout: 246 seconds)
21:57:02*attah joined #nim
21:58:51FromDiscord<Phil> Okay.... wtf? So I got it to work, but I have no understanding as to how
22:00:35*xet7 quit (Ping timeout: 260 seconds)
22:00:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjA
22:03:39FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjB
22:05:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4hjC
22:06:23FromDiscord<Phil> So the reason why this map call needs to be nested in the when-statement absolutely escapes me
22:12:59*xet7 joined #nim
22:13:42*kenran quit (Remote host closed the connection)
22:22:57FromDiscord<guttural666> can somebody tell me why I get and invalid type: typedesc[seq[Band]] for var error from the compiler here? https://media.discordapp.net/attachments/371759389889003532/1047638891357802606/image.png
22:23:26FromDiscord<guttural666> Band is an object
22:25:31FromDiscord<guttural666> https://nim-lang.org/docs/manual.html#templates-identifier-construction
22:25:32FromDiscord<guttural666> probably
22:25:51FromDiscord<guttural666> hm no
22:28:35FromDiscord<Rika> `data: seq[data_type]` not ` = `
22:30:34FromDiscord<Phil> Yeh that type annotation is off
22:31:56FromDiscord<guttural666> omg
22:32:22FromDiscord<guttural666> so blind sometimes, but the compiler wasn't helpful at all either ^^
22:33:15FromDiscord<Phil> In reply to @guttural666 "so blind sometimes, but": I mean, I mistook a range for an enum earlier if it makes you feel any better
22:34:19FromDiscord<guttural666> In reply to @Isofruit "I mean, I mistook": most of the times it's the most trivial stuff
22:35:27*krux02 quit (Remote host closed the connection)
22:38:16FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4hjL
22:38:18FromDiscord<albassort> anyway to make this prettier
22:38:38FromDiscord<guttural666> maybe another one: how does one pass a proc to a template? one argument of that proc is the same as a previously untyped argument of the template, another may be unknown and then there's an int and it returns a string, if I'm not mistaken I do have to specify the proc signature, right? https://media.discordapp.net/attachments/371759389889003532/1047642839665868891/image.png
22:38:53FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4hjL" => "https://play.nim-lang.org/#ix=4hjM"
22:39:13FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4hjN
22:39:34FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4hjO
22:39:48FromDiscord<Elegantbeef> `unicode in 0..255 and byte(unicode) in {34u8..57u8, 63u8...126u8}`
22:40:00FromDiscord<Elegantbeef> or just `unicode in 34..57 or uncode in 63..126`
22:40:23FromDiscord<albassort> wait why'd i do == 34
22:40:37FromDiscord<albassort> ah i meant to do 33
22:40:52FromDiscord<albassort> whoopsie
22:41:21FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4hjP
22:41:37FromDiscord<albassort> yea but still
22:42:02FromDiscord<albassort> email restricted characters weren't made to be conveniently tested
22:42:29FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4hjQ
22:43:17*xet7 quit (Ping timeout: 246 seconds)
22:43:28*Lord_Nightmare quit (Excess Flood)
22:43:45FromDiscord<ahungry> How does the `ptr cint` type work? raylib/raygui wants it for the spinner() call - I've seen stuff like `var Foo = ref object` which https://nim-lang.org/docs/tut1.html briefly touches on, but when I try `var x: ptr cint` - I'm not sure what to initialize it to? literal ints fail - do I need an alloc call of some sort there? if I don't initialize it at all, the program compiles, but crashes, with a `SIGSEGV: Illegal storage access. (
22:44:02FromDiscord<Rika> alloc yes
22:44:10*pech joined #nim
22:44:28*Lord_Nightmare joined #nim
22:44:35FromDiscord<Rika> `let aPtrCint = create(cint)`
22:44:36FromDiscord<Elegantbeef> It's likely for this you dont need a heap allocation
22:44:45FromDiscord<Rika> yeah, depends on what it does
22:44:55FromDiscord<Rika> you can just make a cint
22:44:59FromDiscord<Rika> and pass the addr
22:45:06FromDiscord<ITR> I'm trying out openai's newest gpt thingy, and it's actually managing to write nim code pretty well, lol.↵It's really fun, since instead of messing around with comments like with copilot I can literally tell it "you did this wrong" and have it fix something
22:45:16FromDiscord<ITR> have any of y'all tried it yet?
22:45:20FromDiscord<Rika> `let aCint = 1.cint; let aPtrCint = aCint.addr`
22:45:53FromDiscord<Elegantbeef> I dont use AI tools, I find writing the code once enough
22:46:47*disso_peach quit (Ping timeout: 260 seconds)
22:47:16FromDiscord<ITR> Oh hi beef, lol. I haven't used them since copilot went paid, but I find it fun just for smaller personal projects with lots of boilerplate
22:47:53FromDiscord<ITR> Like, they write pretty ugly code, but it's good enough for when I don't want to bother writing it myself
22:50:26FromDiscord<ahungry> I haven't tried it, just the dall-e stuff - just 5 years ago watching Star Trek holodeck "programming" the whole thing seemed far fetched, but once again Star Trek was spot on in predicting the future - imagine being able to create something useful by talking to your speaker in another 5
22:58:53FromDiscord<ahungry> is there a better repl than `inim`? I notice it takes a few seconds to evaluate `1 + 1` , so I'm guessing it's running a full compile in the background - I suppose unlike lisps, nim lacks an `eval()` equivalent for runtime execution of code?
22:59:12FromDiscord<guttural666> damn, templates are fucking amazing
22:59:28FromDiscord<Elegantbeef> There is `nim secret` which uses the nim vm
22:59:44FromDiscord<Elegantbeef> you can also use `--cc:tcc` with inim to reduce compile times
23:01:00FromDiscord<Phil> In reply to @ahungry "is there a better": Note that thanks to the full compile, inim allows you to use all nim libraries.↵nim secret explicitly does not, as libraries like `std/os` can not work in just the vm
23:01:41*xet7 joined #nim
23:01:49FromDiscord<Elegantbeef> Except std/os can work in the VM due to there being OS hooks, though whether they're enabled for `nim secret` is another thing
23:02:35FromDiscord<Phil> If I start nim secret, write std/os and the first thing that greets me is dozens of errors, then it doesn't work 😛
23:02:46FromDiscord<Phil> (edit) "std/os" => "`import std/os`"
23:03:11FromDiscord<ahungry> that's really neat, thanks everyone
23:03:21FromDiscord<Elegantbeef> Sure but std/os does work in the VM so that means it doesnt hook them
23:09:20*derpydoo joined #nim
23:11:57*neceve quit (Quit: ZNC - https://znc.in)
23:12:11*neceve joined #nim
23:14:29FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=4hjX
23:14:53FromDiscord<ITR> it has no love for the nim discord apparently, smh
23:17:41*oprypin_ quit (Quit: Bye)
23:17:51*oprypin joined #nim
23:17:52FromDiscord<ahungry> Sounds like a really long way for the AI to tell you to RTFM 😂
23:19:24FromDiscord<Phil> In reply to @ITR "I tried asking the": TBF if your question is sufficiently complicated, then nim forums becomes your only option since the chances of your question getting drowned out in discord and thus not being seen by the folks knowledgeable enough to answer it is high
23:20:02FromDiscord<Phil> By which I mean, if you've got complicated shizz going on and you're asking outside of the active times of folks like Yard, demo and Beef, you're screwed 😛
23:50:35FromDiscord<Anze> Hey, just looked through the web and found Nim to be an interesting coding language, but I dont see it being used a lot in production. What are Nim usecases / libraries / frameworks? Thanks
23:50:55*pch__ joined #nim
23:52:05FromDiscord<Elegantbeef> It's use cases are "technically anywhere"
23:52:06*pch__ quit (Remote host closed the connection)
23:52:23*pch__ joined #nim
23:52:24FromDiscord<Elegantbeef> https://nimble.directory/ most libraries are here
23:53:21*pech quit (Ping timeout: 246 seconds)
23:55:50FromDiscord<Horizon [She/Her]> Beef, you expose all of the wasm3 procs anyway right?
23:56:10FromDiscord<Elegantbeef> All of the ones that are supposed to be exported that i know of
23:56:23FromDiscord<Horizon [She/Her]> I think I should probably write my own macro instead of relying/trying to work on yours, since it's let me understand it better
23:56:41FromDiscord<Horizon [She/Her]> I'm scatterbrained af which is a pain
23:56:50FromDiscord<Elegantbeef> Yea i mean i still need to think about my macro more anyway
23:57:02FromDiscord<Elegantbeef> It needs to support generic interfaces somehow