<< 08-08-2025 >>

00:52:44*jailop quit (Remote host closed the connection)
00:53:24*jailop joined #nim
00:54:16*jailop quit (Remote host closed the connection)
02:01:24FromDiscord<albassort> hey beef
02:01:37FromDiscord<Elegantbeef> Hey @albassort
02:01:58Amun-RaI'm late to the party, C alternative using while: https://play.nim-lang.org/#pasty=VvhNPUSK
02:02:09FromDiscord<albassort> if i made a game where you're an astronomer and you need to program shaders to process 2d to 4d data matrixses, would that be fun
02:02:41FromDiscord<albassort> and you need to do it in forth on a type writer with limited cpu and ram, and load punch cards, and organize the punch cards, and store the punch cards
02:03:34FromDiscord<Elegantbeef> It could be fun, fun is always a measure of the designers abillity
02:04:33FromDiscord<albassort> for example, you are tasked with scanning a given area of a moon to make a depth map, and you need to use two different telescopes, and write a program to, do a non-euclidian map of both images onto each other, then output the maps to a punch card data dump and put it in the mail
02:04:51*syl quit (Quit: C-x C-c)
02:04:55FromDiscord<albassort> and somehow the game evaluates how good you did it
02:05:15Amun-Rapunch cards are best for beat'em up games
02:05:20Amun-Ra(I'll ask myself out)
02:05:28FromDiscord<albassort> while running on like a 2 thread cpu running at like 2 mhz with like 12kb of ram
02:05:58FromDiscord<albassort> basically the game is about being trapped in hell
02:06:23*syl joined #nim
02:12:25Amun-Rain a good (?) old days we had MOS 6502 running at 0.9MHz, having three 8-bit registers (A - single accumulator, X and Y) with whooping 64KB of RAM…
02:13:04FromDiscord<albassort> my other idea is a massively parallel cpu with a slow clock so it will do shaders quickly
02:13:27FromDiscord<albassort> like like 148 threads and each is like 0.2mhz
02:13:34FromDiscord<albassort> so you really need to optimize your code
02:13:39FromDiscord<albassort> (edit) "so you really need to optimize your code ... " added "and do cool IPC things"
02:23:40FromDiscord<albassort> this has been in my brain for years i wanna make it but it would be like 10 years of work and i would need to go to school for cosmology and it seems like a lot of effort
02:26:42FromDiscord<Elegantbeef> So don't make it physically accurate but make it fun @albassort
02:27:11FromDiscord<albassort> well i wanna make learning more about the world reward you in the game
02:27:23FromDiscord<albassort> to encourage those who set forth seek to learn
02:27:33FromDiscord<Elegantbeef> https://www.youtube.com/watch?v=MGpFEv1-mAo is my view
02:27:54FromDiscord<Elegantbeef> Right but you can do that in a fun way
02:27:58FromDiscord<Elegantbeef> Look at turing complete for instance
02:28:28FromDiscord<Elegantbeef> Does it have to be true to life mechanics? No
02:28:31FromDiscord<Elegantbeef> It just has to approach the problem in a way that lets them learn it even at a high level
02:29:19FromDiscord<Elegantbeef> There are plenty of games around programming so make the problem approachable and you will have people interested
02:30:23FromDiscord<Elegantbeef> A shader game could be quite fun if you slowly got more operations and combined them to take an input and match an output
02:30:28FromDiscord<albassort> well, how i feel about this is:↵if there is many high level games, shouldn't there be a few low level ones?
02:31:27FromDiscord<albassort> also feel like, if i make something not for profit, but to find one person, some day, somewhere, who understands, thats worth it
02:31:38FromDiscord<Elegantbeef> Cause why do pretend low level when you can do real low level 😛
02:31:46FromDiscord<Elegantbeef> Turing complete is low level though
02:32:10FromDiscord<Elegantbeef> we're in a similar boat in that regard, it's about making something fun to me
02:32:52FromDiscord<albassort> well the fun for me is the process of creation
02:33:27FromDiscord<Elegantbeef> I mean my reason to make games is that I hope someone will find it fun
02:34:24FromDiscord<albassort> perhapsc im more self centered, i want to make something, how i want to make it, and i don't care if nobody finds it fun, or if one person finds it fun, because so long as I made it. that is the enjoyment for me
02:35:18FromDiscord<albassort> almost as if living and creation aren't different tasks
02:38:10FromDiscord<Elegantbeef> Making is also the point to me, but my reason for making games and not a tshirt is I want to make something people find fun
03:23:56*tiorock joined #nim
03:23:56*tiorock quit (Changing host)
03:23:56*tiorock joined #nim
03:23:56*rockcavera is now known as Guest198
03:23:56*Guest198 quit (Killed (silver.libera.chat (Nickname regained by services)))
03:23:56*tiorock is now known as rockcavera
03:26:00*tiorock joined #nim
03:26:00*tiorock quit (Changing host)
03:26:00*tiorock joined #nim
03:26:00*rockcavera is now known as Guest9134
03:26:00*tiorock is now known as rockcavera
03:29:04*Guest9134 quit (Ping timeout: 260 seconds)
03:58:35*rockcavera quit (Remote host closed the connection)
04:37:18FromDiscord<DetermiedNim1> In reply to @Elegantbeef "Turing complete is low": ~~nim on overture when~~
04:37:57FromDiscord<DetermiedNim1> the only actually useful thing ive made in nim is an overture emulator thing
05:12:24FromDiscord<heysokam> In reply to @Elegantbeef "https://www.youtube.com/watch?v=MGpFEv1-mAo is my v": Legendary concept. So simple, yet so brilliant
05:18:19*SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev)
05:31:02*SchweinDeBurg joined #nim
05:57:54*kasimir_ quit (Remote host closed the connection)
05:58:29*kasimir_ joined #nim
07:42:09*nils` quit (Ping timeout: 248 seconds)
07:52:29*przmk quit (Remote host closed the connection)
07:52:53*przmk joined #nim
08:03:11FromDiscord<heysokam> is there such a thing as a `{.readonly.}` pragma?
08:04:01FromDiscord<albassort> In reply to @heysokam "is there such a": what do you think this would do
08:04:14FromDiscord<albassort> because we have let and const
08:04:25FromDiscord<heysokam> In reply to @albassort "because we have let": not for object fields on the type?
08:04:52FromDiscord<albassort> well that was the clarification i wanted lol
08:04:53FromDiscord<heysokam> In reply to @albassort "what do you think": `assign once, can't write again`
08:05:51FromDiscord<albassort> you know, the way you generally do it is by implementing a getter and a setter and then making sure the field is private
08:05:54FromDiscord<albassort> e.g
08:06:01FromDiscord<heysokam> looking for a `private write, public read` type of feature in actuality, but I figured readonly might exist
08:06:33FromDiscord<heysokam> In reply to @albassort "you know, the way": true
08:06:57FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=cgTLmUxs
08:06:59FromDiscord<heysokam> but it would mean `all` my fields are private and need getters 🙁
08:07:28FromDiscord<albassort> i think beef has a macro library for something like this
08:07:36FromDiscord<heysokam> and land on the cpp getter/setter hell of 100s of lines of boilerplate for just fields access control
08:08:03FromDiscord<albassort> well, you could 100% make a macro implementation to generate these procs for these fields
08:08:37FromDiscord<heysokam> I would rather make it all public with a comment than write a macro, not gonna lie
08:09:07FromDiscord<albassort> ...maybe someone know something we don't and theres a {.readonly.} magic now 🙂
08:09:16FromDiscord<albassort> lets see
08:43:28*skippy8 joined #nim
08:47:05*alexdaguy joined #nim
08:49:05FromDiscord<ayex> in an internal project I used a template for getters and a macro for setters. was not too hard and still works well for me.
08:50:43FromDiscord<ayex> I do spit out the procs code at compile to be reminded that they are generated.
09:02:28*nils` joined #nim
09:05:25*SchweinDeBurg quit (Ping timeout: 248 seconds)
09:06:16*SchweinDeBurg joined #nim
09:31:14*xet7 joined #nim
09:52:54*dv^_^ quit (Server closed connection)
09:53:24*dv^_^ joined #nim
11:50:38*redj joined #nim
11:52:34*redj quit (Client Quit)
11:54:15*redj joined #nim
12:05:54*end quit (Quit: end)
12:05:54*bcksl quit (Quit: \)
12:13:37*nils` quit (Ping timeout: 276 seconds)
12:22:22*xet7 quit (Remote host closed the connection)
12:24:23*bcksl joined #nim
12:29:32*end joined #nim
12:42:02*xet7 joined #nim
13:47:23*nils` joined #nim
13:53:51FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=AkWEaoct
13:54:27FromDiscord<heysokam> Any idea what type of error that could be triggering from?↵Its crashing the compiler, so don't know what I'm doing wrong in my code
13:55:02*SchweinDeBurg quit (Ping timeout: 276 seconds)
13:55:18FromDiscord<leorize> that's just what happens
13:55:29FromDiscord<leorize> use `nim_dbg` and it might tell you more
13:56:10FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=eXTAOWAq
14:01:21FromDiscord<leorize> the more you employ generics the easier it is for the compiler to crash spectacularly
14:01:22FromDiscord<leorize> macros also help with that
14:10:26FromDiscord<heysokam> This is the full bug report:↵https://play.nim-lang.org/#pasty=tSZQjhZc↵I'm not posting a report on github↵@ing to whoever this is useful and can do something about it
14:11:25*skippy8 quit (Quit: WeeChat 4.6.3)
14:18:18FromDiscord<leorize> if you don't put it on GH nothing will happen, speaking from experience
14:19:10FromDiscord<heysokam> if I put it on GH nothing will happen, speaking from experience
14:19:59FromDiscord<heysokam> my issues always get closed with either no message or some nonsense. so tired of wasting my time on them
14:20:17FromDiscord<leorize> I never said anything would happen if you do 😛
14:20:32FromDiscord<heysokam> tru
14:21:36FromDiscord<leorize> anyway for me to repro this at least?
14:22:00FromDiscord<heysokam> I can push the changes, probably. and the repo is open. sec
14:22:10*przmk quit (Remote host closed the connection)
14:22:36*przmk joined #nim
14:26:05FromDiscord<heysokam> sent a long message, see https://pasty.ee/EFcQrvTb
14:52:13*nils` quit (Ping timeout: 276 seconds)
15:09:37*xet7 quit (Remote host closed the connection)
15:13:08*xet7 joined #nim
16:12:23FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=BwDlDkAY
16:15:15FromDiscord<heysokam> Can't remember if there is a way to capture the condition of a while loop somehow in Nim 🤔↵In Zig there is capture syntax, like`while (some.thing()) | thing | { thing.one(); }`,↵but not sure if nim has a similar idea in some other way
16:25:36FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=AifSqTep
16:25:42FromDiscord<griffith1deadly> or smth like that
16:27:16FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=gWGQBSXd
16:42:38*SchweinDeBurg joined #nim
16:55:23*nils` joined #nim
17:07:40*skippy8 joined #nim
17:37:50*lumidify quit (Quit: leaving)
17:39:58*alexdaguy quit (Ping timeout: 240 seconds)
17:41:59*joast quit (Quit: Leaving.)
17:49:17*lumidify joined #nim
17:55:09FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=WEYNtTNi
17:57:20*xet7_ joined #nim
17:59:03*xet7 quit (Ping timeout: 272 seconds)
18:22:16*joast joined #nim
18:25:15*xet7_ quit (Quit: Leaving)
19:18:03*skippy8 quit (Quit: WeeChat 4.6.3)
20:13:15FromDiscord<asviest> sent a code paste, see https://play.nim-lang.org/#pasty=TCYhcTeH
20:14:16FromDiscord<asviest> (edit) "https://play.nim-lang.org/#pasty=DGKuLeEh" => "https://play.nim-lang.org/#pasty=BsEmWpVF"
20:14:17FromDiscord<heysokam> In reply to @asviest "I don't know your": how do you convert the C int to a nim set?
20:14:54FromDiscord<asviest> sent a code paste, see https://play.nim-lang.org/#pasty=toFSxkOC
20:14:55FromDiscord<heysokam> also, the values are out of the known/documented range.. so I can't map them to any enum
20:15:05FromDiscord<asviest> (edit) "https://play.nim-lang.org/#pasty=VEcmpzDc" => "https://play.nim-lang.org/#pasty=UdsgojZW"
20:15:48FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=HEoBQNIP
20:21:17FromDiscord<asviest> I think it work only with enums, because set can't work with ints bigger than int8
20:21:32FromDiscord<Elegantbeef> Sets work with int's bigger than int8
20:21:41FromDiscord<Elegantbeef> You can have a set with 65k elements in any range
20:21:56FromDiscord<asviest> It require std/sets
20:22:13FromDiscord<Elegantbeef> Nope
20:22:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=BJBkYark
20:22:58FromDiscord<asviest> Well, up to 2^16
20:23:12FromDiscord<Elegantbeef> That's what I said
20:23:54FromDiscord<asviest> Anyways it can't work for int32
20:24:18FromDiscord<Elegantbeef> I mean it can cause they're using a bitset of a 32bit integer
20:24:25FromDiscord<leorize> looks like what you have there is just bit flags, `std/bitops` could make it look better, but you should be able to derive a flag set from the definition of that response thing↵(@heysokam)
20:25:07FromDiscord<Elegantbeef> Not saying to do it but `cast[set[0..31]](someCint) in cast[set[0..31]](someOtherCInt)` is valid
20:27:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=UYNQaAOK
20:27:10FromDiscord<Elegantbeef> But again i'm not saying do it
20:27:25FromDiscord<heysokam> In reply to @leorize "looks like what you": yes, but `&` and `~` are nowhere to be found in that page↵and the descriptions are cryptic, and the source uses `{.magic.}` like crazy so I can't inspect either
20:27:33FromDiscord<Elegantbeef> `bitand`
20:27:49FromDiscord<asviest> sent a code paste, see https://play.nim-lang.org/#pasty=GTNyfnjZ
20:27:56FromDiscord<Elegantbeef> `mask`
20:28:00FromDiscord<heysokam> sure, but i need `bitand.bitnot
20:28:02FromDiscord<leorize> `& ~` basically meant "is all bits but not this one set"
20:29:35FromDiscord<leorize> you're looking at `.clearBit(<bit number>) != 0`, basically
20:29:38FromDiscord<heysokam> In reply to @leorize "`& ~` basically meant": that's for `interpret as boolean`, but this is a filter
20:30:00FromDiscord<heysokam> It is trying to strip away flags that aren't meant to be used
20:31:40FromDiscord<leorize> `clearMasked` is basically what it is\: https://github.com/nim-lang/Nim/blob/version-2-2/lib/pure/bitops.nim#L195
20:32:24FromDiscord<heysokam> didn't see the clearMasked one, I only saw masked and mask. tyty
20:35:13FromDiscord<leorize> btw, the meaning of that event thing can be found here\: https://www.x.org/releases/current/doc/xproto/x11protocol.html#event_format
20:35:36FromDiscord<leorize> courtesy of https://stackoverflow.com/a/60746947
20:36:38FromDiscord<heysokam> oh, wtf, the tutorial is so confusing then. I should be using `XCB_EVENT_RESPONSE_TYPE_MASK` instead!
20:36:48FromDiscord<heysokam> tysm leo, that's so useful
20:47:22FromDiscord<heysokam> Here is a more difficult question 🤔↵I'm trying to map a C `ptr T` into a Nimmified API, but that C type is meant to be casted to another type depending on an enum value given by C↵Could there be a way to map that multi-C type into Nim, without having to manually create and copy/move the data↵into a bunch of Nim `type One = object` to hold the different types/fields?
20:48:36FromDiscord<Elegantbeef> A Union
20:48:38FromDiscord<heysokam> I could also have an object variant that I populate manually, but same type of issue. Lots of api bookkeeping and data moving 🤷‍♂️
20:49:16FromDiscord<heysokam> In reply to @Elegantbeef "A Union": Union as in tagged or as in regular union?
20:49:25FromDiscord<Elegantbeef> Regular
20:49:49FromDiscord<heysokam> have an example of what you have in mind? I'm not connecting the dots
20:51:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=igEzleQs
20:52:26FromDiscord<heysokam> Noted, ty. I'll try that tomorrow
20:54:16FromDiscord<heysokam> I think it could work, since I can give the union the C wrapped types. will be genious if it works
21:28:51FromDiscord<Elegantbeef> It is wholly unsafe of course 😄
21:30:44*andy-turner joined #nim
21:31:14*andy-turner quit (Remote host closed the connection)
23:06:43FromDiscord<aintea> guys there is finally an LLM that is good at writing nim and not complete and utter nonsense
23:06:54FromDiscord<aintea> gpt 5 is actually pretty good