<< 14-12-2024 >>

00:17:29FromDiscord<Robyn [She/Her]> I still hate how a `float` defined in `builtin_class_sizes` has the size of 8 and in `builtin_class_member_offsets` it's 4
00:17:38FromDiscord<Robyn [She/Her]> Iirc it's bc `builtin_class_member_offsets` uses the C types
00:22:39FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=lqWTSlto
00:23:13FromDiscord<Elegantbeef> You ask a question where it's valid code then I question what the question is 😄
00:23:51FromDiscord<that_dude.> LSP returns `duplcate case label` error. Is it just lying tome?
00:23:53FromDiscord<that_dude.> (edit) "tome?" => "to me?"
00:24:14FromDiscord<Elegantbeef> There is no duplicate label in your code
00:24:33FromDiscord<that_dude.> There are two `Zero` cases
00:25:12FromDiscord<Elegantbeef> Right you cannot do that
00:25:27FromDiscord<Elegantbeef> Each branch can only appear once
00:26:17FromDiscord<Elegantbeef> Could use my fungus package if if you don't mind some sugar
00:26:32FromDiscord<that_dude.> Is there just no way to reuse the `ref_row` field? I swear I saw some conversation at on point about things like this
00:26:57FromDiscord<Elegantbeef> Not in Nim 2.0
00:27:00FromDiscord<that_dude.> :(
00:27:02FromDiscord<that_dude.> Got it
00:27:16FromDiscord<Elegantbeef> Since Nim does not have static typed branches you cannot share branch names
00:27:33FromDiscord<Elegantbeef> Fungus does use static typed branches which allows overlap ;D
00:33:56*krux02_ quit (Remote host closed the connection)
01:05:41FromDiscord<Robyn [She/Her]> Oh great, C enums... Kill me now ;-;
01:06:04FromDiscord<Robyn [She/Her]> I could just be lazy and generate constants for them all but that's horrible
01:07:32FromDiscord<Robyn [She/Her]> Oh wait maybe this isn't too bad... Mostly
01:07:46FromDiscord<Robyn [She/Her]> I can just search for "Mask" and pray it's actually a bitmask
01:11:04*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
01:11:26*SchweinDeBurg joined #nim
01:11:47FromDiscord<Robyn [She/Her]> Oh yeah enums don't need to be sorted anymore, epic
01:22:10FromDiscord<Robyn [She/Her]> I hope casting an int to a set won't have any negative consequences for me :D
01:22:42FromDiscord<Elegantbeef> `static: assert sizeof(set[T]) <= sizeof(TheIntType)`
01:25:53FromDiscord<Robyn [She/Her]> Oh that's a good idea, thanks Beef :)
01:46:54*xet7 quit (Remote host closed the connection)
02:19:28FromDiscord<Robyn [She/Her]> Not too sure about this `"InlineAlignment": (values: {"InlineAlignmentCenterTo": 1, "InlineAlignmentToBottom": 12, "InlineAlignmentToBaseline": 8, "InlineAlignmentTopTo": 0, "InlineAlignmentBottom": 14, "InlineAlignmentCenter": 5, "InlineAlignmentToTop": 0, "InlineAlignmentBaselineTo": 3, "InlineAlignmentTop": 0, "InlineAlignmentBottomTo": 2, "InlineAlignmentToCenter": 4}, masks: {"InlineAlignmentImage": 3, "InlineAlignmentText":
02:20:00FromDiscord<Robyn [She/Her]> Nim won't be happy and I'm not too happy making it a constant or something
02:22:25FromDiscord<Elegantbeef> Welcome to named masks 😄
02:24:58FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Welcome to named masks": As in, using something outside of the range of the enum?
02:26:16FromDiscord<Elegantbeef> I mean it's common in C to have aliases to other flags
02:26:27FromDiscord<Robyn [She/Her]> I don't even know the size of the enum since it's never checked
02:27:07FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I mean it's common": Oh, that's hellish
02:42:40FromDiscord<heysokam> In reply to @chronos.vitaqua "I could just be": https://github.com/heysokam/wgpu/blob/b88fb2dcf80eda0f94b77c407bf6b3ba6afb95a5/src/wgpu/types.nim#L45-L50
02:42:55FromDiscord<heysokam> Do yourself a favor and use enum sets for that
02:45:12FromDiscord<heysokam> they are fully ABI compatible with C ints, and you can map C functions that take ints with flags to take a nim enum set from the wrapper directly, without extra conversion code
02:49:11FromDiscord<Elegantbeef> Day #10003321 of requesting that we use Pascal for ABI documentation 😄
03:00:53FromDiscord<Robyn [She/Her]> In reply to @heysokam "Do yourself a favor": was already planning on using sets, i was gonna store them as a constant though lol
03:02:16FromDiscord<Robyn [She/Her]> In reply to @heysokam "https://github.com/heysokam/wgpu/blob/b88fb2dcf80ed": also quick question, how so you know the size of a C enum? Is it always a 32 bit int unless specified?
03:02:17*rockcavera is now known as Guest3666
03:02:17*tiorock joined #nim
03:02:17*Guest3666 quit (Killed (copper.libera.chat (Nickname regained by services)))
03:02:17*tiorock is now known as rockcavera
03:02:27FromDiscord<Elegantbeef> It's best fit
03:04:20*tiorock joined #nim
03:04:20*rockcavera is now known as Guest5464
03:04:20*Guest5464 quit (Killed (tungsten.libera.chat (Nickname regained by services)))
03:04:20*tiorock is now known as rockcavera
03:09:36FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "It's best fit": So do C enums default to int32 on 64 bit and 32 bit platforms?
03:10:11FromDiscord<Elegantbeef> No it's best fit to the range of the values
03:10:30*nils` quit (Ping timeout: 252 seconds)
03:10:32FromDiscord<bostonboston> I say theyred "minimized"
03:12:45FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "No it's best fit": oh
03:13:11*rockcavera quit (Remote host closed the connection)
03:13:15FromDiscord<bostonboston> Speaking of enums, annoyed that c# doesn't support ninit or nuint as an underlying type for enums
03:13:36FromDiscord<bostonboston> Even though it's support in the CIL
03:13:56FromDiscord<Elegantbeef> It's more annoying it doesnt have enum indexed arrays
03:16:24FromDiscord<bostonboston> Could you not make a silly wrapper class, or just wish it was there by default
03:16:43FromDiscord<Elegantbeef> A class for an array
03:16:46FromDiscord<Elegantbeef> All of the indirection
03:17:05FromDiscord<bostonboston> Yes I know, but when in rome
03:17:33FromDiscord<Elegantbeef> Add two pointers and heap allocations for temporarys!
04:18:13FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=txMdiPaq
06:01:50*rockcavera joined #nim
07:20:29FromDiscord<Robyn [She/Her]> In reply to @heysokam "best fit, like they": apparently clang doesn't do that by default and for gcc it depends on ABI
07:21:12FromDiscord<Robyn [She/Her]> In reply to @heysokam "best fit, like they": that is horrible, i hate C
08:30:55FromDiscord<heysokam> In reply to @chronos.vitaqua "that is horrible, i": you are only seeing an inconvenient part of C. the lang is actually one of the best
08:31:32FromDiscord<heysokam> the minimalism can get extreme at times, like in this case, but overall C does almost everything right
08:44:28FromDiscord<odexine> …what
08:47:32FromDiscord<zumi.dxy> In reply to @heysokam "best fit, like they": I thought enums were glorified #defines? And that they're all uint32? 🤔
08:47:39FromDiscord<zumi.dxy> At least on GCC
08:48:52*coldfeet joined #nim
09:24:51FromDiscord<Robyn [She/Her]> https://hastebin.skyra.pw/akozigifur.json pain.
09:25:13FromDiscord<Robyn [She/Her]> https://hastebin.skyra.pw/yadicusuro.cc
09:25:18FromDiscord<Robyn [She/Her]> This is how it's defined
09:25:47FromDiscord<Robyn [She/Her]> Don't wanna write it out manually so what do I do?
09:38:57*ntat joined #nim
09:44:44Amun-Raheysokam: what do you mean? you don't see enums like that in C for enum have fixed size
09:48:34Amun-RaC99, 6.7.2.2
11:50:03FromDiscord<marioboi3112> are there any docs regarding pragmas in Nim, except for https://nim-lang.org/docs/compiler/pragmas.html
11:51:32*nyeaa49284230101 joined #nim
11:52:22*ntat quit (Ping timeout: 244 seconds)
12:00:17FromDiscord<odexine> manualk
12:00:18FromDiscord<odexine> (edit) "manualk" => "manual"
12:04:22FromDiscord<marioboi3112> thanks mate, does it show all the pragmas available with their definitions?
12:12:04*nils` joined #nim
12:24:03FromDiscord<odexine> Oh that
12:24:27FromDiscord<odexine> No you can’t do that, pragmas can be defined in any module…
12:36:15*nils` quit (Ping timeout: 252 seconds)
12:37:41FromDiscord<marioboi3112> In reply to @odexine "No you can’t do": aha, so i'm gonna have to look at the library's docs for user defined pragmas then, but the default ones should be there right
12:38:56*coldfeet quit (Quit: Lost terminal)
12:44:59FromDiscord<odexine> Default? Anything that’s imported by system would be default yes, manual should cover most if not all
12:45:27FromDiscord<marioboi3112> i see, thanks
13:16:53*ntat joined #nim
13:26:10*xet7 joined #nim
13:30:10Amun-Rayou can have them in separate file and include them
13:44:59*rockcavera quit (Remote host closed the connection)
13:48:32*rockcavera joined #nim
14:26:24*rockcavera quit (Ping timeout: 246 seconds)
14:32:06*rockcavera joined #nim
14:32:07*rockcavera quit (Changing host)
14:32:07*rockcavera joined #nim
15:18:05FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "Don't wanna write it": Any clue y'all? I'm tryna figure out how to write a bitfield enum in C into something nice for Nim
15:21:29*nils` joined #nim
15:32:42FromDiscord<fabric.input_output> `set` perhaps
15:37:12FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "`set` perhaps": Look at how the enum is defined in C
15:37:24FromDiscord<Robyn [She/Her]> https://hastebin.skyra.pw/yadicusuro.cc
15:39:17FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=WzTZcSjG
15:39:50FromDiscord<fabric.input_output> you could even cast the set to an integer or whatever, which is unsafe but for me has worked in C/C++ backend
15:39:56FromDiscord<fabric.input_output> breaks in js backend
15:40:09FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "yeah, just make a": With the same values? And that works fine>?
15:40:10FromDiscord<Robyn [She/Her]> (edit) "fine>?" => "fine?"
15:40:56FromDiscord<fabric.input_output> In reply to @chronos.vitaqua "With the same values?": well it has worked for me
15:41:48FromDiscord<fabric.input_output> fun fact, `set[T]` on the js backend is implemented as an object with keys being ordinals of `T` and values being `true`
15:42:53FromDiscord<fabric.input_output> In reply to @chronos.vitaqua "With the same values?": I suggest you try and see for yourself first. this is how I've solved this type of thing
15:43:10*tiorock joined #nim
15:43:10*tiorock quit (Changing host)
15:43:10*tiorock joined #nim
15:43:10*rockcavera is now known as Guest4848
15:43:10*Guest4848 quit (Killed (osmium.libera.chat (Nickname regained by services)))
15:43:10*tiorock is now known as rockcavera
15:43:56FromDiscord<Robyn [She/Her]> Alright then, thanks fabrico
15:44:03FromDiscord<fabric.input_output> 👍
15:44:14FromDiscord<Robyn [She/Her]> I hate C APIs :p
15:45:44FromDiscord<fabric.input_output> In reply to @fabric.input_output "fun fact, `set[T]` on": I found out about this when I tried to do https://discord.com/channels/371759389889003530/371759389889003532/1317516407008661614 on the js backend for webgpu
15:46:16FromDiscord<fabric.input_output> webgpu is so stupid
15:47:14FromDiscord<fabric.input_output> there are some options that can be either the string `"auto"` or some object. wtf?? how do I express this in the nim bindings dawg. just have `null` in place of `"auto"`
15:47:33FromDiscord<Robyn [She/Her]> In reply to @fabric.input_output "there are some options": Oh jesus fuck
15:47:39FromDiscord<Robyn [She/Her]> That's just gross...
15:48:40FromDiscord<fabric.input_output> I'd have to make some sort of abstract wrapper type, and then make converters for strings and that object type if I wanted to use the raw binding. or I would have to make some sort of wrapper
15:49:04FromDiscord<fabric.input_output> but damn which braindead idiot is designing these APIs
16:10:27*xaltsc quit (Quit: WeeChat 4.4.4)
16:25:25*rockcavera quit (Ping timeout: 248 seconds)
16:30:46*rockcavera joined #nim
16:51:39*nils` quit (Ping timeout: 245 seconds)
17:20:43*tiorock joined #nim
17:20:43*rockcavera is now known as Guest6041
17:20:43*Guest6041 quit (Killed (lead.libera.chat (Nickname regained by services)))
17:20:43*tiorock is now known as rockcavera
17:22:51*tiorock joined #nim
17:22:51*rockcavera is now known as Guest2159
17:22:51*Guest2159 quit (Killed (lithium.libera.chat (Nickname regained by services)))
17:22:51*tiorock is now known as rockcavera
17:27:42*tiorock joined #nim
17:27:42*rockcavera is now known as Guest5709
17:27:42*Guest5709 quit (Killed (lead.libera.chat (Nickname regained by services)))
17:27:42*tiorock is now known as rockcavera
17:27:55*rockcavera quit (Remote host closed the connection)
17:33:19*rockcavera joined #nim
17:49:09*tiorock joined #nim
17:49:09*rockcavera is now known as Guest1912
17:49:09*Guest1912 quit (Killed (lead.libera.chat (Nickname regained by services)))
17:49:09*tiorock is now known as rockcavera
17:51:13*tiorock joined #nim
17:51:13*tiorock quit (Changing host)
17:51:13*tiorock joined #nim
17:51:13*rockcavera is now known as Guest3588
17:51:13*tiorock is now known as rockcavera
17:54:02*Guest3588 quit (Ping timeout: 265 seconds)
18:11:31FromDiscord<jasonboyles3> sent a long message, see https://pasty.ee/erszbdol
18:47:27*nils` joined #nim
19:49:05*shrikant joined #nim
20:00:56*shrikant quit (Quit: shrikant)
20:03:55*krux02_ joined #nim
20:50:55FromDiscord<snoot6464> sent a long message, see https://pasty.ee/tzOWLcEW
20:52:46Amun-Rafabric.input: have in mind the bitfield placement in C is implementation defined
21:00:13FromDiscord<fabric.input_output> In reply to @Amun-Ra "fabric.input: have in mind": nim bitsets don't use C bitfields tho
21:00:33Amun-RaI thought you use it for C interop
21:01:15Amun-Rabitsize pragma does
21:03:20FromDiscord<fabric.input_output> nah the thing on the C side is just raw integer bitwise flag stuff
21:03:22FromDiscord<System64 ~ Flandre Scarlet> Is this normal? https://media.discordapp.net/attachments/371759389889003532/1317597828213899284/nimble-error.txt?ex=675f441a&is=675df29a&hm=400a2462e75d0edb567d86e6e4a1e45989999bcd4191a1d8a39247f66fd46772&
21:03:50FromDiscord<fabric.input_output> I was saying to put the stuff in a nim `set` to make it look nicer
21:04:18FromDiscord<fabric.input_output> and translate it to the required C format
21:04:32Amun-RaI see
21:05:06Amun-RaI've never used sets for that, I use different approach - distinct types
21:05:35Amun-Raas an equivalent of flag type
21:34:30FromDiscord<.bobbbob> In reply to @snoot6464 "Hey, I tried to": probably because the virus detector blocks it due to a false positive
21:34:42FromDiscord<.bobbbob> you guys seriously gotta put something about that on the website
21:45:53FromDiscord<snoot6464> Should I try download the 32 bit version or download choosenim?
21:46:48FromDiscord<snoot6464> (edit) "version" => "version, download choosenim" | "download choosenim?" => "wait?"
22:03:25FromDiscord<bostonboston> You can try choosenim, but if it is an anti virus thing itll likely quarantine one or two of binaries when the tool chain is installed, you can try to download an older version, windows defender did not like 2.2 for me but was okay with 2.0.8
22:20:15*ntat quit (Quit: Leaving)
22:38:04FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=TYvdqRHK
22:39:04FromDiscord<Elegantbeef> Nothing screams invalid code, but that stmtlist is ugly
22:39:31FromDiscord<Elegantbeef> Oh wait it's a recursive template
22:39:41FromDiscord<Elegantbeef> Yea there's your problem you generate an infinite expression
22:40:20FromDiscord<aintea> but there is a stop condition
22:40:23FromDiscord<aintea> how is that
22:40:26FromDiscord<Elegantbeef> At runtime
22:40:33FromDiscord<aintea> oooooh
22:40:39FromDiscord<aintea> that explains everything
22:41:13FromDiscord<aintea> I know what to ask for in the Nim survey (I won't for the sake of the Nim developers)
22:41:28FromDiscord<Elegantbeef> You pointless templates?
22:41:31FromDiscord<Elegantbeef> you want\
22:43:28FromDiscord<aintea> I don't want to, it has no use I think, if I want something at compile time I have `const` or the `compileTime` pragma
22:43:46FromDiscord<aintea> I don't see any situation in which recursive macros could be useful
22:44:48FromDiscord<Elegantbeef> Well you can do it with an arraay
22:44:55FromDiscord<Elegantbeef> But the proc method makes more sense
22:46:07FromDiscord<System64 ~ Flandre Scarlet> Is it possible to cross-compile from Windows to Linux with zigcc?
22:46:16FromDiscord<Elegantbeef> Yes
22:46:22FromDiscord<System64 ~ Flandre Scarlet> How please?
22:46:40FromDiscord<Elegantbeef> By setting the target to windows and supply `-d:windows`
22:47:05FromDiscord<aintea> I don't think it will work for the future since I've heard Nim will maybe stop transpiling to C and start directly compiling to machine code.↵I have no valid sources on this, I heard it from someone so take it with a grain of salt
22:47:21FromDiscord<Elegantbeef> Maybe in 10 years that'll be true
22:47:51FromDiscord<aintea> It's not that pressing
22:47:56FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=CtcpvHxt
22:48:11FromDiscord<Elegantbeef> What are your Nim flags?
22:48:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "What are your Nim": My build script is quite complex, can I send it please?
22:49:11FromDiscord<Elegantbeef> I don't know why you have a complex build script, but sure
22:49:15FromDiscord<aintea> also what were your answers on the nim survey about things you want to see in the future in the language ? asking to everyone, I'm curious for answers
22:49:40FromDiscord<Elegantbeef> The same thing as the past 4 years, first class view types
22:50:02FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see https://pasty.ee/yidqYKTQ
22:50:05FromDiscord<Elegantbeef> The only feature that matters
22:51:27FromDiscord<Elegantbeef> Such a messy build system
22:51:35FromDiscord<aintea> What is first class view types ?
22:51:43FromDiscord<Elegantbeef> Borrowing
22:51:48FromDiscord<aintea> oh
22:52:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Such a messy build": Yes↵But those are not from me
22:52:03FromDiscord<aintea> Rust 2 then (joking)
22:52:09FromDiscord<aintea> (edit) "(joking)" => "(I'm joking)"
22:52:14FromDiscord<Elegantbeef> How arent those from you
22:52:16FromDiscord<Elegantbeef> You wrote that ostensibly
22:52:40FromDiscord<Elegantbeef> Nim's experimental view types are much nicer than Rust's as they don't get all in your face in theory
22:52:49FromDiscord<Elegantbeef> But they are unusable as is so...
22:52:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "How arent those from": https://github.com/dinau/imguin/tree/main/examples↵Based from here
22:53:27FromDiscord<Elegantbeef> Quite messy still
22:53:33FromDiscord<Elegantbeef> I'd clean that up before attempting anything
22:55:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=wzVlSHMq
22:55:48FromDiscord<Elegantbeef> Not any better than the procedure method, but alas you can do it
22:56:18FromDiscord<System64 ~ Flandre Scarlet> Well I can just use gcc and mingw, works too
22:56:22FromDiscord<aintea> looks really cool
22:56:42FromDiscord<aintea> thanks, quite an elegant solution too
22:57:12FromDiscord<Elegantbeef> With borrow types one could without unsafe methods create a typed array from an array so wouldbe zero copying 😄
22:57:34FromDiscord<aintea> that sounds like black magic
22:58:13FromDiscord<aintea> Is there somewhere I could learn more about first class view and how it would impact the way people code or the way code works ?
22:58:28FromDiscord<Elegantbeef> Experimental manual documents them
22:58:32FromDiscord<aintea> I'm really interested in this, but when I search about first class view I only get airplane tickets
22:58:40FromDiscord<aintea> In reply to @Elegantbeef "Experimental manual documents them": thanks
22:58:44FromDiscord<Elegantbeef> It practically lets you write code using `ptr` but in a safe way
23:05:26FromDiscord<whorf> sent a code paste, see https://play.nim-lang.org/#pasty=vjpVRxNp
23:06:20FromDiscord<Elegantbeef> `echo (d.max, d.min, d.mean)` will print them as a tuple if that helps
23:06:27FromDiscord<Elegantbeef> You also could write your own echo
23:06:55FromDiscord<whorf> oh the tuple thing is a very easy fix for now, thanks!
23:16:22FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=RpsRaHvl
23:51:42FromDiscord<nasuray> Is Nimble not already appending .exe to compiled binaries when ran on windows?
23:57:33*Onionhammer quit (Quit: The Lounge - https://thelounge.chat)
23:58:28*Onionhammer joined #nim