<< 22-08-2023 >>

00:57:59termeris it possible to override type definitions like float with a specific float then?
00:58:12FromDiscord<Elegantbeef> Nope
00:58:15termerNOOOOO
00:58:31FromDiscord<Elegantbeef> just do `type Float = float32`
00:58:39termeryou're too cruel
00:58:39FromDiscord<Elegantbeef> It's at least consistent with other types 😛
00:58:48termerI want to redefine float as byte
00:59:12FromDiscord<Elegantbeef> Insert 4 panel dog meme here 😄
00:59:12termerthat'll make it faster
00:59:26FromDiscord<Elegantbeef> I mean you can get 8 bit floats
00:59:41FromDiscord<Elegantbeef> Though aside from gpus the smallest most people go are 16bits
00:59:42termerI also want to redefine bool as short
00:59:48FromDiscord<Elegantbeef> Gpus go down to 11 or 10 bits
00:59:55FromDiscord<Elegantbeef> Ok now really insert a 4 panel dog meme here
01:00:07termerAHAHAHA
01:00:22termerA dude over in #nim-embedded was asking about 24bit ints
01:00:30termerI wonder if you could emit some C and make a wrapper type
01:00:30FromDiscord<Elegantbeef> I had seen
01:00:38termerit seems plausible
01:00:41FromDiscord<Elegantbeef> `type int24 = distinct array[3, byte]`
01:00:49termerfigures
01:01:46termerMaybe you should tell that guy
01:02:06FromDiscord<Elegantbeef> They deleted their message they do not get the secrets
01:13:53FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "`type int24 = distinct": How would you implement the addition procs and similar
01:14:40FromDiscord<Elegantbeef> In software doing what the hardware does
01:17:52FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/Adder_%28electronics%29#Half_adder
01:20:02FromDiscord<Elegantbeef> One also could of course use an object with a 24bit field int32
01:22:34FromDiscord<Chronos [She/Her]> Fair enough
01:30:55FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4Ecv It's really inane, but this does indeed 'work'
01:31:07FromDiscord<Elegantbeef> Still using 32bit logic to do all the math, so it sorta defeats the purpose for performance
01:31:11FromDiscord<Elegantbeef> It only saves memory
01:33:01FromDiscord<Elegantbeef> I really should start an encyclopedia of bullshit I write
01:33:37termerseriously
01:33:51termerIf you maintained a Nim wiki, it'd be so incredibly rich
02:02:44FromDiscord<amaank404> Hi y'all
02:02:59FromDiscord<amaank404> Finally moved over to discord from irc
02:03:44FromDiscord<amaank404> I have been struggling to find a good enough gui library, any suggestions from the nim veterans?
02:07:55FromDiscord<Elegantbeef> Owlkettle, nigui, wxnim, uing
02:08:26FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "I really should start": You should honestly
02:08:39FromDiscord<Chronos [She/Her]> Like, genuinely
02:09:59FromDiscord<amaank404> I agree with Elegantbeef, I have encountered him a lot on these nim chats and idk how, he seems to know solution to all the problems
02:10:25FromDiscord<Elegantbeef> But I do not know why children love the taste of cinnamon toast crunch
02:11:06FromDiscord<amaank404> what even is a cinnamon toast?
02:11:18FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "But I do not": Tf is that-
02:11:20FromDiscord<Elegantbeef> A cereal
02:11:28FromDiscord<Chronos [She/Her]> But anyway, you know a lot about Nim soooo
02:12:07FromDiscord<Chronos [She/Her]> Could make a GitHub repo with it full of (new) code snippets, examples, and then also make a wiki/pages site to go with it
02:13:01FromDiscord<amaank404> Agreed, but I believe that maintaining documentation is a programmer's worst fear
02:16:36FromDiscord<Chronos [She/Her]> Yeah that's fair enough lmao
02:16:47FromDiscord<Chronos [She/Her]> I mean, I wonder how hard it'd be to reuse doc comments for it
02:18:24FromDiscord<amaank404> the only part I always spectacularly fail at is docs. Also, lemme know this about discord, is using your real name normal or should it not be used?
02:18:45FromDiscord<Elegantbeef> Between you and you
02:19:08FromDiscord<Chronos [She/Her]> Honestly it's your preference completely lol, you can use your real name, or not
02:19:25FromDiscord<Chronos [She/Her]> Comes with the typical sets of issues that could happen with sharing your identity online
02:35:59FromDiscord<Elegantbeef> Well you guys twisted my noodle arm https://github.com/beef331/nimtrest/wiki/Code-snippets 😄
02:36:10FromDiscord<Elegantbeef> Went back a few months collecting a bunch of snippites
02:38:13FromDiscord<Chronos [She/Her]> Eyyyy
03:04:17FromDiscord<steslos> What is wrong with this nim code? https://play.nim-lang.org/#ix=4EcE↵This is coming from old nim code, originally from https://github.com/fowlmouth/allegro5/blob/master/src/al.nim#L463C13-L463C27↵The error talks about indentation, but I'm thinking the syntax has changed in nim 2.0?
03:04:48FromDiscord<Elegantbeef> The pragma comes after the ident not the `object` now
03:05:25FromDiscord<Elegantbeef> Running it in 1.6.x gives a warning about it
03:06:25FromDiscord<steslos> oh i see, thanks
03:34:53*xet7 quit (Quit: Leaving)
03:45:16*xet7 joined #nim
03:46:51*azimut quit (Ping timeout: 246 seconds)
04:47:04*lucasta_ joined #nim
04:50:11*xet7 quit (Remote host closed the connection)
04:51:06*lucasta_ quit (Ping timeout: 246 seconds)
04:53:55*rockcavera quit (Remote host closed the connection)
05:20:52*advesperacit joined #nim
05:56:35FromDiscord<etra> In reply to @Elegantbeef "Well you guys twisted": I, too, also believe this was a great idea :p
05:56:46FromDiscord<etra> eventually you will not have to repeat yourself!
05:56:54FromDiscord<etra> so you can retire and we can quote your wiki'
05:56:55FromDiscord<etra> (edit) "wiki'" => "wiki"
06:40:18*marcus quit (Ping timeout: 256 seconds)
06:46:48NimEventerNew Nimble package! bc_webservices - Library to authenticate and make requests to Microsoft Dynamics 365 Business Central web services, see https://codeberg.org/pswilde/bc_webservices
06:51:48NimEventerNew Nimble package! dirtygpt - A dirty and free way to use ChatGPT in Nim, see https://github.com/thisago/dirtygpt
06:54:18*marcus joined #nim
07:14:07FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4Ed7
07:14:29FromDiscord<nnsee> 2.0.0 release tarball, not git
07:14:40FromDiscord<leorize> it's more likely that your header is too old
07:15:36FromDiscord<leorize> what kernel are you compiling for?
07:15:58FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4Ed8
07:16:36FromDiscord<nnsee> it's not a mainline kernel and to be frank, i have no idea what the situation with the headers is
07:16:37FromDiscord<leorize> that's plenty new then
07:16:41FromDiscord<nnsee> i'll take a look around
07:17:00FromDiscord<leorize> what distro is that? termux?
07:17:26FromDiscord<nnsee> it's an e-ink tablet 😅
07:17:45FromDiscord<leorize> you're telling me that your tablet have gcc built in? xd
07:18:07FromDiscord<nnsee> you can bootstrap opkg onto it and install anything via that (as long as it's in the repos)
07:18:29FromDiscord<Elegantbeef> Doesnt that tablet ship a linux fork by default?
07:18:35FromDiscord<leorize> is it an android tablet?
07:19:03FromDiscord<nnsee> beef: yes, leorize: nope, just their own custom linux distro
07:19:24FromDiscord<Elegantbeef> > Codex — A purposely designed Linux-based operating↵> system for low-latency digital paper displays
07:19:28FromDiscord<leorize> what repos are you using?
07:19:43FromDiscord<leorize> maybe the headers from there are just too old
07:21:12*azimut joined #nim
07:21:50FromDiscord<nnsee> entware (and toltec, but that's tiny) - entware is pretty big and should be relatively up to date
07:23:24FromDiscord<nnsee> interesting, just found https://github.com/entware/entware/wiki/Using-GCC-for-native-compilation#installing-development-headers, i'll have a look
07:32:53FromDiscord<leorize> looks like entware support for armv7 is kernel 3.2
07:33:22FromDiscord<leorize> which means that code won't compile since getrandom syscall is in 3.17+
07:35:21FromDiscord<leorize> try adding `-d:nimNoGetRandom` to `koch tools`
07:49:15NimEventerNew thread by elcritch: Demo video of Figuro GUI progress, see https://forum.nim-lang.org/t/10425
07:49:38FromDiscord<nnsee> i'd much rather actually have getrandom support - I think I'll just copy the correct headers over, https://github.com/reMarkable/linux/tree/rm1xx_5.4.70_v1.2.x
07:51:53NimEventerNew Nimble package! cligpt - Command line interface for ChatGPT, see https://github.com/thisago/cligpt
07:54:24FromDiscord<leorize> just extract it from a linux distro with kernel 5.4
07:54:43FromDiscord<leorize> the ABI headers are pretty much the same between all kernels (unless you're writing drivers)
07:56:30FromDiscord<nnsee> won't I need it from an actual armv7l system? considering the actual syscall tables are different between arches
08:01:02FromDiscord<leorize> true that, and getting it from kernel source seems simple enough
08:19:24FromDiscord<nnsee> actually, it seems like https://github.com/toltec-dev/toolchain has the correct headers and perhaps I can just cross-compile nim - are there any guides for cross compiling Nim itself?
08:19:48FromDiscord<nnsee> or just pointers on which env vars (or equivalent) to set
08:25:57FromDiscord<demotomohiro> https://nim-lang.org/docs/nimc.html↵Set --os and --cpu options for target OS/CPU.↵https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L35↵Change gcc exe name if it is different from default value.
08:26:36FromDiscord<nnsee> In reply to @demotomohiro "https://nim-lang.org/docs/nimc.html Set --os and": thanks!
08:27:41FromDiscord<nnsee> In reply to @demotomohiro "https://nim-lang.org/docs/nimc.html Set --os and": i'm assuming i'm supposed to set these for koch?
08:28:32FromDiscord<nnsee> it doesn't seem like koch supports these flags
08:28:44FromDiscord<nnsee> just to be clear, i'm not trying to cross-compile nim programs, but rather the nim toolchain itself
08:28:45*PMunch joined #nim
08:31:29FromDiscord<leorize> koch tools works for cross compilation
08:31:40FromDiscord<leorize> you can't `boot` a cross-compiled compiler, though
08:33:16FromDiscord<nnsee> that's kind of a catch-22
08:33:34FromDiscord<nnsee> screw it, i'm just ripping the headers from the toltec toolchain docker image and copying them over
08:41:33*azimut quit (Ping timeout: 246 seconds)
09:50:00FromDiscord<gogolxdong666> Anyone knows `/root/nim-presto/presto/serverprivate.nim(212, 33) Error: undeclared identifier: 'defaultResponse'`
10:20:58*cm_ joined #nim
10:21:36*cm quit (Ping timeout: 260 seconds)
10:21:37*cm_ is now known as cm
10:41:59FromDiscord<heysokam> In reply to @gogolxdong666 "Anyone knows `/root/nim-presto/presto/serverprivate": are you calling a function from a separate file that is `import thefile`? did you `proc defaultResponse `<- the ``?
10:42:31FromDiscord<heysokam> or are two different files importing each other?
10:56:36FromDiscord<System64 ~ Flandre Scarlet> Is it possible to execute the base method for an inherited object?↵Like Super() in Java
11:03:01PMunchSure, just convert to the base and call the proc
11:03:28FromDiscord<System64 ~ Flandre Scarlet> Oh alright, makes sense↵But seems I can't convert a base to a more specialized object
11:03:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdH
11:04:11FromDiscord<Phil> That is if you use methods.↵If you use procs those use static dispatch and nim will always only apply the proc that matches to the type the variable is declared as in that moment
11:04:40FromDiscord<System64 ~ Flandre Scarlet> Makes sense
11:05:59FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EdI
11:06:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdJ
11:08:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdK
11:08:13NimEventerNew thread by Odysseus: Sublime and Nim, see https://forum.nim-lang.org/t/10426
11:08:16FromDiscord<Phil> Like, what are you more comfortable programming this with
11:08:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "There's many ways to": OOP
11:08:38FromDiscord<System64 ~ Flandre Scarlet> because Java was my first language (well, it was GML before)
11:08:54FromDiscord<Phil> Alright, so basically you're seeking an equivalent for an abstract base class
11:09:10FromDiscord<Phil> That provides you some default for implementations that you can also fall back on
11:11:42FromDiscord<Phil> To build the thing you want to, use `procCall` essentially as shown earlier.↵You've got your↵`method <yourMethodName>(a: A) {.base.} = echo "From A"` to do a thing.↵In your subclasses you then call it as shown via `procCall <methodName>(<BaseClass>(parameters))`
11:11:53FromDiscord<Phil> It is not what I would recommend, but it is the syntax for what you want to do
11:13:06FromDiscord<Phil> The thing is that nim can not stop you from accessing and instantiating `BaseClass` , because I don't think we have a keyword `abstract` the way java does - Because nim is more procedurally oriented
11:13:30*rockcavera joined #nim
11:13:46FromDiscord<Phil> The way I would generally go about it rather would be to have a generic method `doBaseThing(x: A)` and then everybody uses that
11:14:11FromDiscord<System64 ~ Flandre Scarlet> This is the differents paths between rooms https://media.discordapp.net/attachments/371759389889003532/1143503379843256410/image.png
11:14:44FromDiscord<System64 ~ Flandre Scarlet> But Title screen has a different update method than a level screen
11:15:34FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EdL
11:15:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdM
11:16:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdN
11:16:46FromDiscord<System64 ~ Flandre Scarlet> Makes sense
11:16:51FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdP
11:17:05FromDiscord<System64 ~ Flandre Scarlet> Oh alright
11:17:25FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EdQ
11:18:24FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdR
11:18:58FromDiscord<Phil> My lack of appdev may be showing here but I don't have enough context here to construct what would stop you
11:19:42FromDiscord<Phil> Beef or Gumbercules might be better if I can't wrap my head around it as they both have gamdev experience
11:20:07FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EdS
11:20:37FromDiscord<Phil> I don't fully get where an object conversion is happening anywhere in there
11:21:34FromDiscord<Phil> Ohhh wait, gnaa java brain from work
11:22:06FromDiscord<Phil> You you can't just turn a "base" instance into a child-instance.↵This is a one-way street. You can interpret a Titlescreen as a Room, but not a Room as a Titlescreen
11:22:24FromDiscord<System64 ~ Flandre Scarlet> Ah so I need to think in another way
11:22:42FromDiscord<Phil> In this particular init method you always want Room to be a TitleScreen?
11:23:00FromDiscord<Phil> In that case it would make more sense to do game.room = TitleScreen()
11:23:13FromDiscord<System64 ~ Flandre Scarlet> no, the specialization can change during runtime
11:26:21FromDiscord<Phil> insert blink meme
11:26:52FromDiscord<Phil> Okay in that case... I think you're either stuck with object-variants or all methods everywhere
11:28:04FromDiscord<System64 ~ Flandre Scarlet> Or I can do a single big object with enum and Case statements
11:28:06FromDiscord<Phil> If you go the method route then as stated you can call the base-type's method's using procCall. Maybe you can do some setup where you have all your subclasses with the base-class in a module and you keep the base-class private?
11:29:02FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdT
11:29:30FromDiscord<Phil> I'd say start out with the method-path as that'll be more familiar to you, but it's up to you
11:30:23FromDiscord<heysokam> Is there any benefit to `cast[MyNumberDistinct](someInt32)` compared to `num.MyNumberDistinct`, when my number type is a `distinct int32`?
11:31:00FromDiscord<heysokam> I'm basically converting between aliased types, so I know the bits are the same, but don't know if conversion does anything for distincts
11:31:02FromDiscord<Phil> You write more code, and thus feel a bigger sense of pride and accomplishment.
11:31:37FromDiscord<Phil> other than that if you're just converting between aliases I'd say no
11:33:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EdU
11:34:33FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EdV
11:35:09FromDiscord<heysokam> last line is what worries me, since its for division so its already gonna be used a lot
11:35:18FromDiscord<heysokam> (edit) removed "already"
11:35:30FromDiscord<Phil> Why not write a div for your FxBase?
11:35:40FromDiscord<heysokam> because fxbase is the aliased
11:35:48FromDiscord<Phil> Is borrow for operators not an option?
11:36:08FromDiscord<heysokam> In reply to @isofruit "Is borrow for operators": not for this. integer division doesn't readjust decimals
11:36:34FromDiscord<heysokam> its a base10-fixed point number, so normal division doesn't quite work
11:37:20FromDiscord<Phil> Would defining your own div operator be an option that does the type-unaliasing for you?
11:37:31FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EdX
11:37:34FromDiscord<Phil> Then in here you could still write `f1 div f2`
11:37:51FromDiscord<heysokam> In reply to @isofruit "Would defining your own": idk if it is. how does that work?
11:38:10FromDiscord<heysokam> like, im basically doing int div in there, don't know what more i need to strip, if that's what you mean
11:41:12FromDiscord<heysokam> if I do `1.0'fx div 2.0'fx`... im actually saying `1_0000'i32 div 2_0000'i32`, which resolves to `0.5` not `0_5000'i32`
11:43:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ee0
11:43:37FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Ee0" => "https://play.nim-lang.org/#ix=4Ee1"
11:44:03FromDiscord<Phil> If you want the result back in Fx again, just do another `.Fx` typecast in your `div`
11:45:05FromDiscord<heysokam> i think the div is wrong though. it chops away all decimals
11:45:27FromDiscord<Phil> hmm
11:45:40FromDiscord<Phil> template?
11:45:51FromDiscord<heysokam> wdym? 🤔
11:46:55FromDiscord<Phil> Keep in mind I have barely an idea of what's going on on the bit level for you here.↵Based on the way you see it I assume that due to the fact these are proc calls some information gets lost due to the proc calls.↵Template `div` would eliminate that, it'd be identical as if you had just written that code there in place
11:47:01FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Ee3
11:47:20FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Ee3" => "https://play.nim-lang.org/#ix=4Ee4"
11:47:46FromDiscord<heysokam> In reply to @isofruit "Keep in mind I": ah i see
11:48:00FromDiscord<heysokam> would inline help with that?
11:48:26FromDiscord<Phil> Maybe? Like I'd tell you but I don't even know how you got it that the proc-way chops off decimals ^^
11:48:37FromDiscord<Phil> So I can't test
11:48:47FromDiscord<heysokam> well because `1000 div 2000` is `0.5` therefore `0`
11:51:20FromDiscord<Phil> Okay, work brain on java is killing me, so you want 0.5 to be the type that gets echo'd out after the division?
11:51:26FromDiscord<Phil> (edit) "division?" => "division and get 0 instead?"
11:51:32FromDiscord<Phil> (edit) "Okay, work brain on java is killing me, so you want 0.5 to be the type that gets echo'd out after the division and ... get" added "wrongly"
11:52:16FromDiscord<heysokam> In reply to @isofruit "Okay, work brain on": `0.5'fx` should be the result of `1'fx div 2'fx` yes
11:52:31FromDiscord<heysokam> but its having to do int div in the background, so it chops the decimals away
11:52:57FromDiscord<Phil> hmmmm
11:53:50FromDiscord<Phil> My brain is dead, all I'm thinking in is data-type mappers for objects and that's not helping here.
11:54:50FromDiscord<heysokam> i think i just need to find an integer-only operation that from `1000 op 2000` returns `500` 🤔
12:08:05FromDiscord<heysokam> `((f1.FxBase FxResolution) div f2.FxBase).Fx`↵lol, that was so simple. a friend found it mashing stuff in the calculator 🙈↵`(a res) div b` 🧠
12:08:37FromDiscord<Phil> Is FxResolution a configurable constant?
12:08:42FromDiscord<Phil> global configurable constant
12:09:00FromDiscord<heysokam> In reply to @isofruit "Is FxResolution a configurable": yes, its an `{.intdefine.}`
12:10:34FromDiscord<Phil> Ah, that's where you get it from
12:10:39FromDiscord<Phil> Was wondering, thanks ^^
12:11:08FromDiscord<heysokam> btw, test-driven development is being a total lifesaver for this project. can't recommend it enough
12:11:34FromDiscord<heysokam> instead of making tests after, just start programming through the tests themselves
12:11:37FromDiscord<Phil> If I could monkey patch in nim I would actually attempt it
12:11:43FromDiscord<testDrivenDevelopment> Can confirm
12:11:53FromDiscord<heysokam> whats monkey patch? im nub
12:12:12FromDiscord<Phil> basically mocking but for static dispatch, so for procs and funcs in nim
12:12:17FromDiscord<ntzeno> hello nimmers, i am trying to use set for bitfields, i have one issue though, where it supposed to assign 2^2, it assigns 2^3, am i doing it wrong ? https://media.discordapp.net/attachments/371759389889003532/1143517997307265045/image.png https://media.discordapp.net/attachments/371759389889003532/1143517997584093254/image.png https://media.discordapp.net/attachments/371759389889003532/1143517997856719050/image.png
12:12:38FromDiscord<ntzeno> my enum is as: https://media.discordapp.net/attachments/371759389889003532/1143518086159413248/image.png
12:13:15FromDiscord<System64 ~ Flandre Scarlet> This is weird↵game.room is a titlescreen, not the root object https://media.discordapp.net/attachments/371759389889003532/1143518244620222464/image.png
12:13:15FromDiscord<ntzeno> (edit) "hello nimmers, i am trying to use set for bitfields, i have one issue though, where it supposed to assign 2^2, it assigns 2^3, am i doing it wrong ... ?" added "or did i skip something"
12:13:19FromDiscord<heysokam> In reply to @isofruit "basically mocking but for": have a dummy example?
12:14:02FromDiscord<Phil> I'll do you one better, my attempt at mocking procs that crashed and burned on generics:↵https://github.com/PhilippMDoerner/mockingbird
12:15:01FromDiscord<Phil> The idea is to only need to test the implementation/code withing one proc, and not of any of the procs it calls.
12:15:10FromDiscord<odexine> In reply to @ntzeno "my enum is as:": the enum values should be the numbers to the right of shl
12:15:55FromDiscord<odexine> aka the numbers should just increase as is, 1 2 3 4 5 etc
12:16:11FromDiscord<heysokam> In reply to @isofruit "The idea is to": interesting idea
12:16:37FromDiscord<Phil> Actually should get back to it now that I don't actually suck at macros
12:16:45FromDiscord<odexine> "are you sure about that"
12:16:56FromDiscord<heysokam> In reply to @ntzeno "my enum is as:": this is what nim is -actually- doing already in the bg↵you don't need to force enums into being bitfields, they already are
12:17:35FromDiscord<Phil> Okam is even looking away, there is no saving you now Rika
12:18:05FromDiscord<odexine> what are you gonna do with a water gun?
12:18:07FromDiscord<Phil> I low-key love that the emoji for `:gun:` is just a flipping watergun
12:18:18FromDiscord<odexine> they changed it a few years ago from a revolver
12:18:24FromDiscord<odexine> yes it used to be a revolver
12:18:26FromDiscord<Phil> Yeh, it's hilarious
12:18:47FromDiscord<ntzeno> In reply to @odexine "aka the numbers should": ooh, alright ty !
12:18:52FromDiscord<ntzeno> In reply to @heysokam "this is what nim": ty
12:19:02FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Eed
12:19:19FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Eed" => "https://play.nim-lang.org/#ix=4Eee"
12:19:24FromDiscord<ntzeno> yea i figured it out with what rika said, thanks sokam and rika
12:19:28FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Eee" => "https://play.nim-lang.org/#ix=4Eef"
12:19:41*azimut joined #nim
12:19:50FromDiscord<ieltan> arguh
12:19:56FromDiscord<Phil> ... I don't know if I like inline enums↵Kinda more concise, but also... inline ↵hmm
12:19:59FromDiscord<heysokam> enum sets can be even for wrapping C importc
12:20:06*FromDiscord quit (Remote host closed the connection)
12:20:19*FromDiscord joined #nim
12:20:35FromDiscord<odexine> inline enums i mean
12:20:36FromDiscord<Phil> ~~Rika declared enums as cursed, you heard it here first folks~~
12:20:55FromDiscord<heysokam> 😄
12:21:16FromDiscord<heysokam> i usually never inline, but #discord
12:21:27FromDiscord<ieltan> anyone knows how to properly use `atlas` ? Trying to `atlas use 'some/local/dep` just dumps everything in my workspace but i want them confined in a single folder
12:21:40FromDiscord<ieltan> (edit) "'some/local/dep`" => "some/local/dep`"
12:21:46FromDiscord<Phil> Beef does, I'm sticking with nimble for the time being
12:22:05FromDiscord<heysokam> In reply to @ieltan "anyone knows how to": it did `file://../the/sup/folder` for me when i tried
12:22:36FromDiscord<heysokam> i had a root folder that hold atlas, and my sub projects for that workspace, and then it worked fine
12:22:48FromDiscord<ieltan> hm
12:22:52FromDiscord<ieltan> okay let me try again
12:45:30NimEventerNew thread by choltreppe: Efficient way of running proc at a given time, that can be changed, see https://forum.nim-lang.org/t/10427
12:46:09FromDiscord<heysokam> @Phil 👆 one for you
12:52:34FromDiscord<heysokam> when should I `inline` a proc/func and when should I not?↵main concern is performance. idc about code size for this specific library, since its already expensive computing-wise↵_(math library with int only operations)_
12:57:20FromDiscord<Phil> Generally the compiler should figure that out for you
12:57:26FromDiscord<Phil> Inline is more a hint than a command to it
12:57:45FromDiscord<Phil> Inline stuff where you really want to make sure the compiler gets the hint
12:57:51FromDiscord<Phil> (edit) "Inline stuff where you really want to make sure the compiler gets the hint ... " added "and where it's important"
12:59:47*rockcavera quit (Remote host closed the connection)
13:09:58FromDiscord<heysokam> In reply to @isofruit "Inline stuff where you": > ... where its important↵thats my Q, in summary
13:10:10FromDiscord<Chronos [She/Her]> Tbh I want to start using atlas
13:10:33*cm_ joined #nim
13:10:48FromDiscord<heysokam> In reply to @chronos.vitaqua "Tbh I want to": same. but not having connection to the root toolchain is a major turnoff for me, personally
13:11:06FromDiscord<heysokam> don't want to have 10 copies of the same libraries in 10 workspaces 😦
13:11:07*cm quit (Ping timeout: 244 seconds)
13:11:07*cm_ is now known as cm
13:11:42FromDiscord<heysokam> (edit) "In reply to @chronos.vitaqua "Tbh I want to": same. but not having connection to the root toolchain is a major turnoff for me, personally ... " added "(even if its only an optional toggle that's disabled by default)"
13:12:14FromDiscord<heysokam> its useful in a big way where it fits, though. great tool
13:13:27FromDiscord<Phil> In reply to @heysokam "> ... where its": As in, figuring out when shit is important?↵Only way to figure out is profiling
13:14:02FromDiscord<Phil> If that proc gets called a billion times a second, inlining it is good.↵Otherwise eh.↵As for how to profile, that's a lengthy topic and I'm not good at explaining it given that I only somewhat fiddled around with it
13:14:27FromDiscord<Phil> Should be easy enough to google profiling with flamegraphs etc.
13:25:45FromDiscord<Phil> In reply to @heysokam "<@180601887916163073> 👆 one for": Wait, how?↵Like, I was looking into that due to playing around with implementing RXNim but I never mentioned that I don't think
13:27:15FromDiscord<heysokam> In reply to @isofruit "If that proc gets": yeah that would basically be the usecase for this↵its eventually going to power a physics engine, so its gonna be used a LOT per frame
13:27:43FromDiscord<heysokam> In reply to @isofruit "Wait, how? Like, I": idk, i just saw the title and reminded me of the lib you just posted
13:27:57FromDiscord<Phil> Then might as well just annotate and go with that.↵If you have solid data backing you up you could also go the template route, but I would want to have solid data before I do that
13:28:04FromDiscord<Phil> mapster?
13:28:10FromDiscord<Phil> Because rxnim I haven't posted anywhere
13:28:40FromDiscord<heysokam> In reply to @isofruit "Because rxnim I haven't": here, you were talking about it and that bridge post came up
13:28:43FromDiscord<Phil> For reference:↵Template is basically a guaranteed inline, but it changes a bit how stuff works and makes the effects slightly wonky, so use with caution
13:28:46FromDiscord<heysokam> just reminded me of what you said ,that sall
13:28:51FromDiscord<heysokam> (edit) ",that sall" => ",thats all"
13:29:13FromDiscord<heysokam> i didn't know that, tyty
13:33:19FromDiscord<Phil> sent a long message, see http://ix.io/4Eez
13:33:37FromDiscord<Phil> (edit) "http://ix.io/4EeB" => "http://ix.io/4EeA"
13:33:52FromDiscord<Phil> (edit) "http://ix.io/4EeA" => "http://ix.io/4EeC"
13:33:58FromDiscord<Phil> (edit) "http://ix.io/4EeC" => "http://ix.io/4EeD"
13:34:54FromDiscord<heysokam> makes senses 👌
13:40:14FromDiscord<heysokam> @PMunch Do you think all of this is fixable for `pkg.nimble` files? https://media.discordapp.net/attachments/371759389889003532/1143540131157000232/image.png
13:40:41FromDiscord<heysokam> They are preset variables by nimble, so they are good. But the lsp doesn't find them declared
13:41:56PMunchHmm, I thought about this a long time ago
13:42:31PMunchBasically my idea was that based on file extension in would pre-process the file, in this case add the same stuff that nimble adds before running the script
13:42:41PMunchit would*
13:42:47FromDiscord<heysokam> exactly yep
13:43:06FromDiscord<heysokam> its been present for a while, even in 1.6.12 i was seeing this err
13:43:27PMunchYeah I mean the error would've been there for as long as nimlsp was triggered for nimble files
13:43:40FromDiscord<heysokam> should I open an issue about it? 🤔 or no need?
13:43:50PMunchSure, open an issue so that we can track it
13:43:55FromDiscord<heysokam> kk ty
13:44:06PMunchI'll leave my proposed design in the issue as well, if someone wants to have a go at implementing it
13:46:22FromDiscord<heysokam> #done
14:05:35FromDiscord<Phil> Pmunch, if you want to effectively have the equivalent of JS "setTimeout" (define a proc that gets executed after N ms) then in nim you basically have to fire up your own event-loop right? You can't do that out of the box with no setup=
14:05:37FromDiscord<Phil> (edit) "setup=" => "setup?"
14:06:22FromDiscord<Phil> or dispatcher or whatever, I have not wrapped my brain around that fundamental level of async and setting that up yourself
14:06:39PMunchHuh?
14:06:59PMunchAh, yes you would need some kind of dispatcher
14:07:15PMunchThe async runtime has this, otherwise your best bet is a thread I guess
14:07:31FromDiscord<Phil> Was asking you on the off chance you if you knew anything about it ^^↵I'll need to read something about the fundamentals on async runtimes I think
14:08:11FromDiscord<Phil> In reply to @PMunch "The async runtime has": What does "async runtime" in this context mean?
14:08:22FromDiscord<Phil> Does nim have a dispatcher or sth out of the box that I just don't get?
14:08:26FromDiscord<Phil> (edit) "get?" => "get where to find?"
14:08:53FromDiscord<jviega> @heysokam the overhead for a static function call is less than 20 clock cycles, compared to inlining. That's not much at all, so you shouldn't be particularly afraid of function calls. The compiler will generally make good decisions on inlining, HOWEVER, will not generally ever inline stuff that has visibility outside the module, even if you ask for it, as it doesn't know what in the future might need the reference.
14:10:15FromDiscord<jviega> So basically as was said, don't ever worry about it. If you end up with something getting called many thousands of times per second, and performance becomes an issue, then the profiler will show you the way. Otherwise, you're thinking too much about it
14:11:18FromDiscord<Phil> Mandatory quote: Premature optimization is the root of all evil and so on
14:12:02FromDiscord<jviega> Yeah, Tony Hoare, I think 50 years ago
14:12:14FromDiscord<heysokam> In reply to @isofruit "Mandatory quote: Premature optimization": yeah i know that one, and abide by it in every single way
14:12:17PMunch@Phil, yeah there's https://nim-lang.org/docs/asyncdispatch.html#addTimer%2Cint%2Cbool%2CCallback
14:12:30FromDiscord<heysokam> but this is like the actual root-core of the engine, so wanted to just have some guidelines
14:12:44FromDiscord<heysokam> (edit) "way" => "way↵but this is like the actual root-core of the engine, so wanted to just have some guidelines"
14:12:50PMunchYou add that, then you run `poll()` or `runForever()` to tick the async dispatcher
14:12:54FromDiscord<jviega> It's always ignore it until you can't
14:17:43*PMunch quit (Quit: Leaving)
14:19:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EeO
14:20:19FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4EeO" => "https://play.nim-lang.org/#ix=4EeP"
14:22:24FromDiscord<Phil> And 5) Is there any way to do this in a way that means I don't have to call poll because the sources I'm skimming through atm make it sound like that would be the task of a runtime to do that for me or sht
14:22:27FromDiscord<Phil> (edit) "sht" => "sth"
14:37:46*lucasta_ joined #nim
14:37:57FromDiscord<Phil> Yknow what, I'll make a forum post
14:42:46NimEventerNew thread by Isofruit: Basic Async Questions, see https://forum.nim-lang.org/t/10428
15:16:12*lucasta_ quit (Ping timeout: 245 seconds)
15:19:39*xet7 joined #nim
15:29:59FromDiscord<kyre58> Is there a way to specify `outdir` to another repo using DocGen?
15:39:00*xet7 quit (Quit: Leaving)
15:43:28*xet7 joined #nim
15:46:03*xet7 quit (Read error: Connection reset by peer)
15:49:25*xet7 joined #nim
16:19:22FromDiscord<ravinder387> what's best usecase of language who compile to C and Javascript
16:24:36FromDiscord<␀ Array> anything that can be done with c or js, so anything frontend or high preformance↵(@ravinder387)
16:24:41FromDiscord<Phil> No idea. I don't use nim because of the language compilation features, I use nim because the syntax is as expressive as pythons, yet it compiles to binaries and exposes far more interesting features that I can dip into if I want to.
16:35:24FromDiscord<krisp0> https://play.nim-lang.org/#ix=4EfD↵I seem to be stuck with exceptions, but is there a way to raise a custom exception that has specific properties?
16:40:38FromDiscord<griffith1deadly> In reply to @krisp0 "https://play.nim-lang.org/#ix=4EfD I seem to": you try assign value to not var variable, bro
16:41:26FromDiscord<griffith1deadly> and all exception need to be ref object
16:41:53NimEventerNew thread by mildred: Convert back cstring to string, see https://forum.nim-lang.org/t/10430
16:42:26FromDiscord<heysokam> In reply to @ravinder387 "what's best usecase of": same usecase as C or JS, pretty much? except you write with python syntax, which is ridiculously faster to prototype with than C or JS↵plus, the nim's stdlib is amazing, so you get even more power than writing python↵with python i had to write my own tools on top of the stdlib. here you just use the damn stdlib as it is, because its sane
16:43:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EfI
16:44:54FromDiscord<jos7388> nim syntax is so good
16:44:56FromDiscord<jos7388> after going back to rust
16:44:57FromDiscord<jos7388> i get what ur sayin
16:45:23FromDiscord<krisp0> sent a code paste, see https://play.nim-lang.org/#ix=4EfJ
16:45:43FromDiscord<Phil> In reply to @krisp0 "oh I must've forgotten": Just add all the stuff you need from the start, I prefer full instantiation over partial instantiation
16:45:50*rockcavera joined #nim
16:46:15FromDiscord<Phil> Leads to less mutable state
16:46:18FromDiscord<Phil> Which is always good
16:47:04FromDiscord<krisp0> in line 22?
16:47:31FromDiscord<Phil> Keep in mind I don't see the linecount in the discord view 😛
16:47:40FromDiscord<griffith1deadly> In reply to @krisp0 "oh I must've forgotten": you can just cast, if u know what exception your type
16:49:44FromDiscord<krisp0> I see
16:55:41FromDiscord<ravinder387> how to create alert/prompt javascript code from nim?
17:05:10FromDiscord<m4ul3r> Will this be possible to do in the future? https://media.discordapp.net/attachments/371759389889003532/1143591707917684756/image.png
17:05:12FromDiscord<Phil> I swear to the almighty void, nim is dragging me further and further down the pipeline towards low-level.↵"Oh how does this work? Why does this only execute once?" And before you know it you find yourself reading articles about async runtimes and behaviour the implications of how polling tasks from a queue is done.
17:05:44FromDiscord<m4ul3r> (edit) "Will this be possible to do in the future? https://media.discordapp.net/attachments/371759389889003532/1143591707917684756/image.png" => "sent a code paste, see https://play.nim-lang.org/#ix=4EfY"
17:05:46FromDiscord<Phil> (edit) removed "behaviour"
17:06:59FromDiscord<Phil> In reply to @m4ul3r "Will this be possible": That sounds like a compiler question for #internals
17:07:08FromDiscord<Phil> Though I would assume not given the warning
17:08:05FromDiscord<Phil> In reply to @ravinder387 "how to create alert/prompt": Mah dude, skim through std/dom or rather use the search function of the nim docs 😛 ↵https://nim-lang.org/docs/dom.html#alert%2CWindow%2Ccstring
17:08:54FromDiscord<ravinder387> In reply to @isofruit "Mah dude, skim through": thanks man
17:12:35FromDiscord<Phil> If I were competent enough/had the time or motivation I'd write a bot that I can just send some command of !search or sth which queries `https://nim-lang.org/docs/theindex.html` for results, extracts the top 3 hits with their links and posts to this chat
17:13:38FromDiscord<Phil> (edit) "were competent enough/had" => "had"
17:38:21FromDiscord<heysokam> In reply to @isofruit "I swear to the": same. nim is such a pleasure to work with for low level, that its not even grudgingly. its super fun
18:15:41FromDiscord<jviega> @m4ul3r That doesn't work if the string is zero length, btw.
18:23:36*flaviu joined #nim
18:24:03*flaviu quit (Client Quit)
19:18:57*rockcavera quit (Read error: Connection reset by peer)
19:19:17*advesperacit quit ()
19:20:04*rockcavera joined #nim
19:20:05*rockcavera quit (Changing host)
19:20:05*rockcavera joined #nim
19:25:16*rockcavera quit (Remote host closed the connection)
19:50:01*rockcavera joined #nim
19:51:25*LuxuryMode joined #nim
20:03:11*junaid_ joined #nim
20:06:00*junaid_ quit (Remote host closed the connection)
20:28:35FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EgC
20:29:11FromDiscord<Chronos [She/Her]> In reply to @isofruit "If I had the": Tbf it's probably possible... Is there a Nim module for parsing HTML nicely?
20:31:45FromDiscord<Phil> In reply to @chronos.vitaqua "Has to be std/json,": Old holdover from prior nim version that some of the std lib can be imported without std/
20:32:05FromDiscord<Phil> In reply to @chronos.vitaqua "Tbf it's probably possible...": std/dom
20:32:30FromDiscord<Phil> and/or xmlparser/htmlparser, there is std lib for that
20:46:30FromDiscord<jos7388> :carted:
21:07:54FromDiscord<Phil> In reply to @jos7388 "<:carted:907698166588145704>": Anything more I can provide in my barely cognizant state?
21:09:04FromDiscord<Elegantbeef> What's 1 + 1 an why is it 3?
21:09:33FromDiscord<Phil> In reply to @Elegantbeef "What's 1 + 1": Bitflips are one hell of a drug
21:09:38FromDiscord<sirolaf> In reply to @isofruit "and/or xmlparser/htmlparser, there is": There is also nimquery for css selectors, has been excellent for me so far https://github.com/GULPF/nimquery
21:44:47FromDiscord<odexine> In reply to @isofruit "I swear to the": Lol
22:10:03FromDiscord<Chronos [She/Her]> In reply to @isofruit "std/dom": Isn't that the JSON backend?
22:10:11FromDiscord<Chronos [She/Her]> JS not JSON lmao
22:10:28FromDiscord<Chronos [She/Her]> In reply to @isofruit "and/or xmlparser/htmlparser, there is": Gucci, may actually do this idea aha
22:20:55FromDiscord<Andreas> beef or is it @ElegantBeouf now 🙂 ? regarding fast string-search via SIMD : What are the rules of the game ? Nim-strings, cstrings, UTF-??, any specalties ? It won' be easy, since glibc uses AVX2 and i think handcrafted asm...
22:21:04*LuxuryMode quit (Quit: Connection closed for inactivity)
22:22:06FromDiscord<Elegantbeef> You do not need the @, but I mean Nim string search, though I think it uses fast find so probably cannot beat it
22:22:34FromDiscord<Andreas> pls explain fast-find ?
22:22:41FromDiscord<Elegantbeef> Searching for a substring inside a string does not really matter though since you have a binary blob and are looking for one
22:22:55FromDiscord<Elegantbeef> I say fast find, but there is a str operation inside C that is fast
22:23:03FromDiscord<Elegantbeef> Or atleast reported to be fast
22:23:20FromDiscord<Andreas> In reply to @Elegantbeef "Or atleast reported to": is this c-function simd-fied ?
22:24:01FromDiscord<Elegantbeef> I do not recall
22:24:25FromDiscord<Andreas> where can i look for that fn ? std/??
22:24:46FromDiscord<Elegantbeef> lib/system/strmantle
22:25:17FromDiscord<Andreas> In reply to @Elegantbeef "lib/system/strmantle": ok, in case its not simd-fied, chances are good..
22:25:33FromDiscord<Elegantbeef> Or not in strmantle
22:25:41FromDiscord<Elegantbeef> I know it's somewhere inside system, just do not recall
22:26:22FromDiscord<Elegantbeef> Ah sorry it's `memmem`
22:26:59FromDiscord<Andreas> maybe `std/private/digitutils` i'll have a look,, you might scan this here :: http://0x80.pl/articles/simd-strfind.html
22:27:09FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/strutils.nim#L2015
22:27:23FromDiscord<Elegantbeef> I've seen that article before
22:28:15FromDiscord<Andreas> In reply to @Elegantbeef "I've seen that article": i'd say its a good place to start. One needs a bit more SWAR to get faster...
22:28:19FromDiscord<Elegantbeef> Yea seems memem is not simd
22:28:39FromDiscord<Elegantbeef> It wasnt an issue of lack of knowledge just lack of motivation to do it\:D
22:54:14FromDiscord<Andreas> In reply to @Elegantbeef "It wasnt an issue": have you heard about Agner Fogs 'Vector-Class-Library' VCL ? https://github.com/vectorclass
23:09:17FromDiscord<Elegantbeef> I've not
23:10:16FromDiscord<Andreas> In reply to @Elegantbeef "I've not": found it yesterday, and well he's legend thats for sure.. Now i'm wondering shall i improve nimsimd or try a wrap for VCL ?
23:10:52FromDiscord<Elegantbeef> I'd personally say make it pure, but I'm a dullard
23:14:55FromDiscord<Andreas> In reply to @Elegantbeef "I'd personally say make": the intrinsics are ugly and no sane person wants to work with these fn-names - i allways have the intel-dictionary by my the side..
23:15:09FromDiscord<Andreas> (edit) "allways" => "always"
23:16:20FromDiscord<jos7388> one thing that’s awesome about nim is the syntax works really well with code folding
23:16:25FromDiscord<jos7388> which is maybe intentional?
23:16:53FromDiscord<jos7388> like annotations for a block are on the same block, which folds well
23:17:05FromDiscord<jos7388> usually annotations are on the line above the block
23:21:55*xet7 quit (Remote host closed the connection)
23:27:05*rockcavera quit (Read error: Connection reset by peer)
23:27:25*rockcavera joined #nim
23:27:25*rockcavera quit (Changing host)
23:27:25*rockcavera joined #nim