00:21:44 | * | vicfred quit (Quit: Leaving) |
00:53:44 | Amun-Ra | hmm… I wish nim had flags pragma for enum (sets are suckish in this dept) |
00:56:11 | FromDiscord | <Elegantbeef> What do you mean? |
00:56:45 | FromDiscord | <Rika> Why? |
00:57:32 | Amun-Ra | https://play.nim-lang.org/#ix=3V0q |
00:58:41 | FromDiscord | <Elegantbeef> Eh you can do this with a set and an array of uint32s |
01:00:25 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3V0r |
01:00:26 | Amun-Ra | I'd like to use that for high level interop with some library |
01:00:39 | FromDiscord | <Rika> That’s the wrong way to use sets and enums I believe |
01:01:19 | Amun-Ra | I need it to work one way |
01:01:27 | FromDiscord | <Elegantbeef> What's the library API? |
01:01:41 | FromDiscord | <Rika> look at what beef sent maybe |
01:01:41 | * | jmd_ joined #nim |
01:01:43 | * | SamuelMarks joined #nim |
01:01:45 | * | jmdaemon quit (Ping timeout: 248 seconds) |
01:02:28 | Amun-Ra | over 20+ #defines that are ored as flags |
01:03:00 | Amun-Ra | I guess I'll take beef's approach |
01:03:04 | FromDiscord | <Rika> uh |
01:03:09 | FromDiscord | <Rika> beef why the fuck |
01:03:13 | FromDiscord | <Rika> okay |
01:03:25 | FromDiscord | <Elegantbeef> Why the fuck? |
01:03:50 | FromDiscord | <Rika> so enums in a set, the value of an enum represents the # of bits shifted ex. `1 shl x` where x is the enum value right? |
01:03:52 | FromDiscord | <Elegantbeef> You also can lose type safety and do https://play.nim-lang.org/#ix=3V0s |
01:03:58 | FromDiscord | <Rika> why bother with the array if you could do that |
01:04:11 | FromDiscord | <Rika> beef are you on drugs or something |
01:04:32 | FromDiscord | <Elegantbeef> What the fuck are you talking about? |
01:04:41 | FromDiscord | <Rika> what the fuck are YOU talking about |
01:04:59 | Amun-Ra | hmm |
01:05:05 | FromDiscord | <Elegantbeef> I'm talking about how to hold on to constant values that are too big for a bitset with enums and still have a bitset |
01:08:52 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=3V0u ? |
01:09:45 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
01:09:46 | FromDiscord | <Elegantbeef> Ah yes that works, but there are some weird flags sometimes that have more than 1 bit |
01:09:58 | FromDiscord | <Rika> i assumed there isnt in this case |
01:10:06 | FromDiscord | <Rika> if there is, then fuck that library |
01:10:08 | FromDiscord | <Rika> xdd |
01:10:58 | FromDiscord | <Rika> i wouldnt bother with only enums if there are flags that have more than 1 bit; id use an object at such point |
01:18:35 | FromDiscord | <Elegantbeef> Amun here's the start of a 0 cost version if there is bitflag overlap https://play.nim-lang.org/#ix=3V0y |
01:18:51 | Amun-Ra | how do you [dis]like that? https://play.nim-lang.org/#ix=3V0A |
01:19:00 | Amun-Ra | how much* |
01:19:22 | FromDiscord | <Elegantbeef> Hey that's pretty much waht i was doing |
01:19:42 | FromDiscord | <Elegantbeef> But i'm doing it with normal set stuff minus the set constructor |
01:19:44 | Amun-Ra | yes, a variant of that |
01:20:21 | FromDiscord | <SirOlaf> Where does parameter resolution happen |
01:20:47 | FromDiscord | <Elegantbeef> I think in semoverloadedcall |
01:20:55 | FromDiscord | <Elegantbeef> You may want to ask in #internals |
01:21:54 | FromDiscord | <SirOlaf> No, think I got some type of idea what's going wrong now |
01:24:13 | * | SamuelMarks joined #nim |
01:24:55 | Amun-Ra | Elegantbeef: I think I'll take a varargs approach as the method with the converter has a drawback, non obvious passing Enum to proc taking Flag arg |
01:25:57 | FromDiscord | <Elegantbeef> Yea finish adding in the set ops for the type and go to town |
01:27:28 | Amun-Ra | hmm, I think I've discovered another compiler error ;> |
01:27:53 | FromDiscord | <Elegantbeef> Ruh roh |
01:28:49 | Amun-Ra | nope, that was pebkac |
01:29:06 | FromDiscord | <Elegantbeef> Ah only worse to pebcak |
01:29:24 | Amun-Ra | and picnic ;> |
01:29:37 | FromDiscord | <Elegantbeef> Bit too cold for a picnic |
01:30:37 | Amun-Ra | and a bit too dark (3am here) |
01:31:19 | FromDiscord | <SirOlaf> Yeah so after what should be parameter resolution it's still stuck as identifier which is pretty funny |
01:31:34 | FromDiscord | <huantian> In reply to @Elegantbeef "also `static FunnyKind`": actually I think I can omit the static because an enum member `is` the enum↵so `fkCow is FunnyKind == true` |
01:32:04 | FromDiscord | <SirOlaf> Maybe compiler is getting tricked by the bracket expression |
01:34:58 | FromDiscord | <Elegantbeef> What |
01:35:10 | FromDiscord | <Elegantbeef> Huan i do not follow |
01:35:52 | FromDiscord | <huantian> you said that without static, doing `Kind: FunnyKind` would make the only thing that I could pass to it be `FunnyKind` |
01:36:06 | FromDiscord | <Elegantbeef> Yes |
01:36:16 | FromDiscord | <huantian> but since enum members are subtypes of the Enum kind, I think the compiler lets me pass them in |
01:36:27 | FromDiscord | <Elegantbeef> `Kind: FunnyKind` is a generic constrained to the type `FunnyKind` |
01:36:33 | FromDiscord | <Elegantbeef> What the fuck |
01:37:07 | FromDiscord | <Elegantbeef> Ok that's weird |
01:37:17 | FromDiscord | <Elegantbeef> But there is 0 benefit to that |
01:37:21 | FromDiscord | <Elegantbeef> Like you can do anything with that `fkCow` passed in |
01:37:33 | FromDiscord | <Elegantbeef> Inside the object it's assumed to be a `FunnyKind` |
01:37:37 | FromDiscord | <Elegantbeef> So you have no delimination |
01:39:20 | FromDiscord | <huantian> yeah I don't think there's a point to omitting `static` has any point really |
01:39:38 | FromDiscord | <huantian> just something funny |
01:40:08 | FromDiscord | <Elegantbeef> Well it's cause generic instantiations assume values are supposed to be `typeof` |
01:41:02 | FromDiscord | <Elegantbeef> It's an intentional thing i just forgot about since it's a pointless distinction 😛 |
01:41:10 | FromDiscord | <Elegantbeef> It saves a `typeof` in macros and the like though |
01:42:40 | FromDiscord | <huantian> wait typeof? |
01:43:18 | FromDiscord | <huantian> oh cus `typeof(FunnyKind)` and `typeof(fkCow)` are the same? |
01:43:19 | FromDiscord | <Elegantbeef> `type MyGeneric[T: int] = object` `MyGeneric[100]()` is turned into(internally) `MyGeneric[typeof(100)]()` |
01:44:04 | FromDiscord | <huantian> oh huh |
01:44:35 | FromDiscord | <Elegantbeef> Huan is learning things they never cared about and still dont care about. 😛 |
01:44:44 | FromDiscord | <huantian> yep |
01:44:46 | FromDiscord | <Elegantbeef> Hows the await PR going |
01:45:00 | FromDiscord | <Elegantbeef> Are we going to make async less of a ballache to use? |
01:45:05 | FromDiscord | <huantian> should be wrapping up |
01:45:21 | FromDiscord | <Elegantbeef> Ah good safe asynchrounous code |
01:45:33 | FromDiscord | <huantian> well slightly better errors for async code |
01:45:42 | FromDiscord | <huantian> there's still the other fun ones like discarding a Future[void] |
01:45:54 | FromDiscord | <Elegantbeef> Dont undersell it, those are quite an improvment |
01:46:08 | FromDiscord | <Elegantbeef> "Cannot yield" is fucking unhelpful |
01:47:50 | FromDiscord | <huantian> don't think there's anything to add to the pr ↵other than making the error show up on the entire await when that becomes possible |
01:48:09 | FromDiscord | <huantian> should I bump with a comment or something |
01:49:39 | FromDiscord | <Elegantbeef> Perhaps, also could mention someone |
01:53:38 | FromDiscord | <!Patitotective> someone knows how to convert a PXImage into a pixie image? 💀 |
01:53:41 | FromDiscord | <!Patitotective> (edit) "💀" => "💀↵https://github.com/nim-lang/x11/blob/master/x11/xlib.nim#L200" |
01:54:05 | FromDiscord | <SirOlaf> So, prepareOperand(c: PContext; a: PNode) in sigmatch.nim seems to do something weird |
01:54:15 | FromDiscord | <SirOlaf> Probably gonna need an adult from here |
01:54:30 | FromDiscord | <SirOlaf> It tries considerGenSyms instead of semOperand |
01:54:36 | FromDiscord | <huantian> https://play.nim-lang.org/#ix=3V0H↵ideally this error would be better |
01:54:50 | FromDiscord | <huantian> because rn it's just completely useless |
01:54:59 | FromDiscord | <Elegantbeef> Patito there is a `data` field and format/width/height use that to make a new image |
01:56:35 | FromDiscord | <huantian> also the error `expression 'something' has no type (or is ambiguous)` shows up so much |
01:56:37 | FromDiscord | <Elegantbeef> I mean this is a nim issue |
01:57:15 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Patito there is a": `XImage.data[0].addr`? where do i use that data?↵i mean, to create a new pixie image |
01:57:27 | FromDiscord | <Elegantbeef> You get to learn low level operations |
01:57:32 | FromDiscord | <Elegantbeef> I'm not going to walk you through it |
01:57:45 | FromDiscord | <SirOlaf> Yep I got the issue |
01:57:50 | FromDiscord | <SirOlaf> For PMunch bug |
01:57:52 | FromDiscord | <Elegantbeef> Nice! |
01:58:01 | FromDiscord | <SirOlaf> Question is just what the fix should be |
01:59:18 | FromDiscord | <SirOlaf> So, basically this check seems kinda flawed https://github.com/nim-lang/Nim/blob/devel/compiler/sigmatch.nim#L2311 |
01:59:25 | FromDiscord | <Elegantbeef> Huantian there is also https://github.com/nim-lang/Nim/issues/19654 |
02:00:35 | FromDiscord | <SirOlaf> If you, for testing, add ` or a.kind == nkBracketExpr` to the condition I sent it gives you some type of output |
02:00:45 | FromDiscord | <SirOlaf> Or rather gives what it should |
02:01:20 | FromDiscord | <SirOlaf> So `result = -53.67085806695344 + 0.0 x + 0.0 ln(x) + 35.36216119564057 arctan(x / 223.9725251168868 + 10.85527993806166)` with untyped |
02:01:31 | FromDiscord | <huantian> In reply to @Elegantbeef "Huantian there is also": hm maybe I'll add this asnyc thing onto it for now |
02:01:56 | FromDiscord | <huantian> I wonder if there's a way to, while processing the proc to make it async,↵check if any Future[void] is getting `discard`ed and raise an error |
02:03:12 | FromDiscord | <Elegantbeef> You can of course |
02:05:14 | FromDiscord | <SirOlaf> Any idea what the real fix should be |
02:07:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3V0J |
02:07:32 | FromDiscord | <Elegantbeef> You of course have to have async do that introspection and emitting but yea it should work and would be a nice quality of life for `async` procedures |
02:07:55 | FromDiscord | <huantian> wow asyncSingleProc is big |
02:09:01 | FromDiscord | <SirOlaf> For some reason a.typ is float so it never gets passed to sem stage |
02:11:27 | * | xet7 joined #nim |
02:13:53 | FromDiscord | <huantian> wonder if I should put possible improvements to multisync and async errors in the same issue |
02:13:58 | FromDiscord | <huantian> pull request I mean |
02:16:13 | FromDiscord | <xflywind> better not, it can possibly make merging process slower. |
02:17:03 | * | xet7 quit (Quit: Leaving) |
02:17:15 | FromDiscord | <Elegantbeef> 1 PR = 1 change 😀 |
02:17:38 | * | xet7 joined #nim |
02:17:41 | FromDiscord | <!Patitotective> sent a long message, see http://ix.io/3V0M |
02:17:59 | FromDiscord | <Elegantbeef> it does have `getPixel` |
02:18:05 | FromDiscord | <Elegantbeef> Also you can read the format and see what they mean |
02:18:37 | FromDiscord | <!Patitotective> the format is `cint`? https://github.com/nim-lang/x11/blob/master/x11/xlib.nim#L217↵.confu |
02:18:44 | FromDiscord | <!Patitotective> (edit) "https://github.com/nim-lang/x11/blob/master/x11/xlib.nim#L217↵.confu" => "https://github.com/nim-lang/x11/blob/master/x11/xlib.nim#L217↵😕" |
02:18:47 | FromDiscord | <Elegantbeef> no it's not cint |
02:18:48 | FromDiscord | <Elegantbeef> RTFM |
02:18:57 | FromDiscord | <Elegantbeef> ` int format; / XYBitmap, XYPixmap, ZPixmap /` |
02:19:04 | FromDiscord | <Elegantbeef> Ok let's look at what those are |
02:20:59 | FromDiscord | <Elegantbeef> It might be best just to use `getPixel` and copy that to pixie |
02:22:19 | FromDiscord | <Elegantbeef> So what's the format you get in? |
02:23:21 | FromDiscord | <!Patitotective> 2 which should be ZPixmap |
02:24:49 | FromDiscord | <Elegantbeef> Yep the data isnt image data |
02:24:56 | FromDiscord | <Elegantbeef> So then it's best probably to `getPixel` |
02:26:44 | FromDiscord | <Elegantbeef> You also could just operate with `getPixel` |
02:27:11 | FromDiscord | <Elegantbeef> So huan you going to work on the discard guards? |
02:28:06 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3V0O |
02:28:12 | FromDiscord | <Elegantbeef> it's the colour in a single integer |
02:28:23 | FromDiscord | <Elegantbeef> each byte represents rgba in 0..255 afaik |
02:28:35 | FromDiscord | <Elegantbeef> So bitwise convert it or just make a struct and cast it to that |
02:28:47 | * | noeontheend quit (Ping timeout: 240 seconds) |
02:30:51 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "So bitwise convert it": bitwise `x11pixel` with what? how's a rgba byte? 😕 |
02:31:32 | FromDiscord | <Elegantbeef> `let (r, g, b, a) = cast[ptr (byte, byte, byte, byte)](myPixelData.addr)[]` |
02:32:33 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=3V0Q |
02:32:36 | FromDiscord | <huantian> right here <https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncmacro.nim#L298=> |
02:32:46 | FromDiscord | <Elegantbeef> Nice |
02:32:49 | FromDiscord | <huantian> with a better message though |
02:33:08 | FromDiscord | <Elegantbeef> I dont use async much but it's nice to see someone put the effort in that i'd otherwise put in if i used it 😛 |
02:33:37 | FromDiscord | <creikey> https://github.com/nim-lang/Nim/issues/19713 ↵I think to fix this I'm gonna have to reinstall windows |
02:33:44 | FromDiscord | <creikey> but then I'll never find out why it was broken |
02:33:50 | FromDiscord | <Elegantbeef> Nice can install a real OS that doesnt use NT |
02:33:59 | FromDiscord | <creikey> I need to use windows |
02:34:09 | FromDiscord | <creikey> for a lot of reasons |
02:34:19 | FromDiscord | <Elegantbeef> Keep telling yourself that |
02:34:30 | FromDiscord | <creikey> I would rather be using linux I used it for years and I'm used to it |
02:34:50 | FromDiscord | <creikey> on linux I could probably actually figure this out |
02:35:08 | FromDiscord | <creikey> I just don't understand how it could be an issue with dlls like the error code suggests |
02:35:17 | FromDiscord | <creikey> gcc from nim threads:on isn't linking to anything |
02:35:18 | FromDiscord | <Elegantbeef> Yea i dont know either |
02:35:20 | FromDiscord | <creikey> I don't see pthreads included |
02:35:25 | FromDiscord | <creikey> like the only difference is some nim threading code |
02:35:32 | FromDiscord | <Elegantbeef> Have you tried with msvc? |
02:35:39 | FromDiscord | <Elegantbeef> or `vcc` i guess |
02:35:42 | FromDiscord | <creikey> no I'm not sure where to even start with that |
02:35:46 | FromDiscord | <creikey> but I'll try that now I guess |
02:35:52 | FromDiscord | <Elegantbeef> typially you download visual studio |
02:35:52 | FromDiscord | <creikey> msvc I would anticipate to have a bunch of other issues |
02:35:56 | FromDiscord | <creikey> no I have msvc |
02:35:56 | FromDiscord | <Elegantbeef> then you select it's C compiler |
02:35:57 | FromDiscord | <creikey> and vcvars |
02:36:04 | FromDiscord | <creikey> I just don't know its flags |
02:36:04 | FromDiscord | <Elegantbeef> then you do `nim c --cc:vcc` |
02:36:40 | FromDiscord | <creikey> In reply to @Elegantbeef "then you do `nim": is this just what msvc is called? the compiler isn't called vcc.exe |
02:37:31 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/963628973261226044/image.png |
02:37:31 | FromDiscord | <creikey> In reply to @Elegantbeef "then you do `nim": huh |
02:37:32 | FromDiscord | <creikey> msvc |
02:37:33 | FromDiscord | <creikey> works |
02:37:33 | FromDiscord | <Elegantbeef> It's what they call their C++ compiler i think and is why the name is used |
02:37:35 | FromDiscord | <Elegantbeef> I could be wrong |
02:37:36 | FromDiscord | <creikey> no issues |
02:37:49 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/963629048846749758/image.png |
02:37:53 | FromDiscord | <Elegantbeef> Can you send the code again? |
02:37:59 | FromDiscord | <!Patitotective> beef, it stills outputs an empty image...↵https://play.nim-lang.org/#ix=3V0S 😕 |
02:38:14 | FromDiscord | <Elegantbeef> Why the fuck are you using floats |
02:38:15 | FromDiscord | <creikey> that is actually really helpful |
02:38:18 | FromDiscord | <creikey> thanks beef |
02:38:24 | FromDiscord | <creikey> it's something with the mingw install |
02:38:31 | FromDiscord | <creikey> In reply to @Elegantbeef "Can you send the": `echo "hello"` |
02:38:43 | FromDiscord | <Elegantbeef> ah it's that simple |
02:38:47 | FromDiscord | <creikey> yeah |
02:38:49 | FromDiscord | <creikey> just compile anything |
02:38:53 | FromDiscord | <creikey> with the shipped nim compiler |
02:39:10 | FromDiscord | <Elegantbeef> Yea it works here |
02:39:11 | FromDiscord | <creikey> I feel like it has to be something with `gcc.exe` shipped with nim linking to libraries not built with the mingw version it's shipping with |
02:39:18 | FromDiscord | <creikey> because I know I have like 3 mingws installed on my computer |
02:39:19 | FromDiscord | <Elegantbeef> With mingw i should add |
02:39:30 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Why the fuck are": cause pixie's pixels are https://nimdocs.com/treeform/chroma/chroma/colortypes.html#Color (?) |
02:39:38 | FromDiscord | <Elegantbeef> Yes but cast doesnt convert |
02:39:50 | FromDiscord | <creikey> In reply to @creikey "I feel like it": now how to start with this |
02:39:52 | * | xet7 quit (Remote host closed the connection) |
02:39:52 | FromDiscord | <creikey> there's only one gcc.exe |
02:39:53 | FromDiscord | <Elegantbeef> the data is stored as bytes |
02:39:57 | FromDiscord | <Elegantbeef> or uint8s |
02:40:12 | FromDiscord | <Elegantbeef> you casting to a float means the first value is all of the data |
02:40:18 | FromDiscord | <Elegantbeef> the rest is noise of the stack |
02:41:06 | FromDiscord | <!Patitotective> using bytes it says `Error: type mismatch: got 'byte' for '436207668[0]' but expected 'float32'` |
02:41:15 | FromDiscord | <!Patitotective> (edit) "using bytes it says `Error: type mismatch: got 'byte' for '436207668[0]' but expected 'float32'` ... " added "😕" |
02:41:18 | FromDiscord | <Elegantbeef> yes cause you're assigning to a float |
02:41:23 | FromDiscord | <Elegantbeef> you cant just cast to make datas convert |
02:41:46 | FromDiscord | <Elegantbeef> you then have to do `myPixel = color(r.float32,g.float32,b.float32,a.float32)` |
02:41:58 | * | xet7 joined #nim |
02:42:10 | FromDiscord | <Elegantbeef> A uint8 is 1/4 the size of a float32 casting doesnt do anything but wrong |
02:42:16 | FromDiscord | <Elegantbeef> I chose the type explicitly |
02:42:57 | FromDiscord | <creikey> In reply to @Elegantbeef "A uint8 is 1/4": just kinda curious what does `0.uint8.float` actually do |
02:43:08 | FromDiscord | <creikey> like is there an x86 instruction for converting the one byte of data to a float |
02:43:20 | FromDiscord | <creikey> (edit) "`0.uint8.float`" => "`1.uint8.float`" |
02:43:21 | FromDiscord | <Elegantbeef> I dont know i doubt it |
02:43:39 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/963630520669982851/image.png |
02:43:42 | FromDiscord | <Elegantbeef> Given they're primitives the C or Nim compiler probably optimizes it away |
02:43:44 | FromDiscord | <creikey> so like gcc is using the built in toolchain right |
02:43:54 | FromDiscord | <Elegantbeef> Seems so |
02:44:01 | FromDiscord | <creikey> I don't remember where my other mingws are |
02:44:11 | FromDiscord | <creikey> oh chocolatey |
02:44:15 | FromDiscord | <creikey> I think one is chocolatey |
02:44:21 | FromDiscord | <creikey> and another is the other linux on windows toolchain stuff |
02:44:53 | FromDiscord | <Elegantbeef> And there is a non-zero chance patito that it's actually `(a, b, g, r)` but i dont know |
02:45:00 | FromDiscord | <Rika> Cursed |
02:45:02 | FromDiscord | <yoyojambo> is there a prettier way to iterate over a 2d array than nested for loops? |
02:45:13 | FromDiscord | <Elegantbeef> Make your own iterator |
02:45:17 | FromDiscord | <Rika> In reply to @yoyojambo "is there a prettier": Nested map? |
02:45:18 | FromDiscord | <Rika> Or that |
02:45:23 | FromDiscord | <Rika> What does prettier mean to you |
02:46:08 | FromDiscord | <yoyojambo> In reply to @Rika "What does prettier mean": I guess in a single line |
02:46:12 | FromDiscord | <yoyojambo> In reply to @Elegantbeef "Make your own iterator": good idea |
02:46:24 | FromDiscord | <Elegantbeef> Iterators are the god's nectar |
02:46:35 | * | rockcavera joined #nim |
02:46:35 | * | rockcavera quit (Changing host) |
02:46:35 | * | rockcavera joined #nim |
02:46:36 | FromDiscord | <huantian> hm one day i'll figure out what `owned` does, looks like it has something to do with old newruntime? I have no idea what newruntime is so idk |
02:46:48 | FromDiscord | <Elegantbeef> New runtime is orc/arc |
02:46:53 | FromDiscord | <Rika> Afaik it doesn’t do anything in effect anymore? |
02:47:00 | FromDiscord | <Rika> Or was that something else |
02:47:05 | FromDiscord | <Elegantbeef> I dont think it does anything anymore |
02:47:08 | FromDiscord | <Elegantbeef> It's not in the manual |
02:47:28 | FromDiscord | <Rika> Insert question about <//> here |
02:47:33 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/giP |
02:48:12 | FromDiscord | <Elegantbeef> Guess i was relying on UB like a silly person |
02:49:03 | FromDiscord | <!Patitotective> (same happens with `color(r.float32,g.float32,b.float32,a.float32)`) |
02:49:14 | FromDiscord | <!Patitotective> (edit) "`color(r.float32,g.float32,b.float32,a.float32)`)" => "`pixel = color(r.float32,g.float32,b.float32,a.float32)`)" |
02:49:25 | FromDiscord | <Elegantbeef> Oh it's assignment |
02:49:28 | FromDiscord | <Elegantbeef> Just make a new colour |
02:49:37 | * | arkurious quit (Quit: Leaving) |
02:49:47 | FromDiscord | <Elegantbeef> What you're doing wont work anyway |
02:49:59 | FromDiscord | <Elegantbeef> image.setColor(x, y, myColor)\` |
02:51:10 | * | xet7 quit (Remote host closed the connection) |
02:51:48 | FromDiscord | <!Patitotective> seems like the error is actually here `let (r, g, b, a) = cast[ptr (byte, byte, byte, byte)](x11pixel.addr)[]` |
02:51:58 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "image.setColor(x, y, myColor)\`": `image.setColor(x, y, color(r.float32, g.float32, b.float32, a.float32))`? |
02:52:02 | FromDiscord | <!Patitotective> (edit) "a.float32))`?" => "a.float32))`, righ?" |
02:52:06 | FromDiscord | <!Patitotective> (edit) "righ?" => "right?" |
02:52:10 | FromDiscord | <Elegantbeef> No clue i'm not the one using pixie |
02:52:32 | FromDiscord | <!Patitotective> In reply to @Patitotective "seems like the error": this is not pixie 🤷♂️ |
02:52:36 | FromDiscord | <Elegantbeef> Pixie might even have a api for a colour from bytes |
02:52:44 | FromDiscord | <Elegantbeef> .. i know i'm not stupid |
02:52:52 | FromDiscord | <Elegantbeef> Time to get the old bitwise ops out then |
02:52:54 | FromDiscord | <Elegantbeef> Have fun with that |
02:52:58 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Pixie might even have": let me read the ~~fucking~~ manual |
02:53:30 | FromDiscord | <Elegantbeef> I still could be wrong about the colour data |
02:53:53 | FromDiscord | <Elegantbeef> I've never used xlib's XImage so i'm just assuming xgetPixel returns that data and not something else |
02:54:44 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Pixie might even have": (pixie or chroma? cause github cannot even find the word byte in chroma's code lol) |
02:55:29 | * | xet7 joined #nim |
02:55:31 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I've never used xlib's": > _The XGetPixel function returns the specified pixel from the named image. The pixel value is returned in normalized format (that is, the least significant byte of the long is the least significant byte of the pixel). The image must contain the x and y coordinates. _ |
02:55:55 | FromDiscord | <Elegantbeef> It might also be a uint8 |
02:56:12 | FromDiscord | <!Patitotective> isnt byte == uint8? or wdym |
02:56:33 | FromDiscord | <Elegantbeef> I mean the used name might be uint8 not byte |
02:56:42 | FromDiscord | <Elegantbeef> https://github.com/treeform/chroma/blob/640f26142f47fea023a87bfd684a3fa770a785ae/src/chroma/colortypes.nim#L126-L140 |
03:02:45 | FromDiscord | <huantian> wow this is going to be fun how do I detect if a NimNode returns a Future[void] |
03:03:09 | FromDiscord | <Elegantbeef> It needs to be typed so you cannot in the async macro |
03:03:29 | FromDiscord | <Elegantbeef> You have to emit a when statement like i showed |
03:04:04 | FromDiscord | <huantian> ah so do that for all things that are `dicarod await ...` |
03:04:17 | FromDiscord | <Elegantbeef> Yep |
03:04:24 | FromDiscord | <Elegantbeef> Like i said though this doesnt make anysense |
03:04:33 | FromDiscord | <Elegantbeef> You are not supposed to `discard await` anyway |
03:04:37 | FromDiscord | <Elegantbeef> So you might aswell just emit an error |
03:04:41 | FromDiscord | <Elegantbeef> "use async check" |
03:05:07 | FromDiscord | <huantian> you have to use `asyncCheck` even in an async proc? |
03:05:34 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/963636030710358026/image.png |
03:06:23 | FromDiscord | <Elegantbeef> Any code that does `discard await` is doing so cause the library didnt prevent it |
03:06:50 | FromDiscord | <huantian> but waitFor would be blocking, it wouldn't pass up execution to the loop |
03:06:52 | FromDiscord | <Elegantbeef> I'm sure araq will say "Cannot do that as it changes past behaviour" but I've been wrong before |
03:07:00 | FromDiscord | <Elegantbeef> Did you read the entire thing? |
03:07:26 | FromDiscord | <Elegantbeef> If you want to block you use `waitFor` if you want to await it you do `asyncCheck` you do not `discard` it |
03:07:43 | FromDiscord | <Elegantbeef> `asyncCheck` is the proper way to `discard` a `Future` |
03:08:00 | FromDiscord | <Elegantbeef> The only reason you can discard it inside an `async` is cause no one introduced an error |
03:09:06 | FromDiscord | <huantian> if you do `discard await` you aren't discarding the Future though, you're waiting on it, then when you get the result, you discard that |
03:09:11 | FromDiscord | <huantian> (edit) "if you do `discard await` you aren't discarding the Future though, you're waiting on it, then when you get the ... result," added "non-future" |
03:09:20 | FromDiscord | <Elegantbeef> no you are discarding it |
03:09:31 | FromDiscord | <Elegantbeef> `discard await` is wrong |
03:09:36 | FromDiscord | <Elegantbeef> The docs say as much |
03:09:36 | FromDiscord | <huantian> hmm ok |
03:10:01 | FromDiscord | <Elegantbeef> If i'm wrong fix the docs, if i'm right fix the macro |
03:10:27 | FromDiscord | <huantian> https://github.com/nim-lang/Nim/issues/5021 |
03:10:28 | FromDiscord | <huantian> hm ok |
03:10:55 | FromDiscord | <huantian> maybe I should update the docs then :P |
03:11:16 | FromDiscord | <!Patitotective> Omg almost↵@ElegantBeef thank you beeeeeeeeeeeeeeeeeeeeeeeeeeeef 🙃 https://media.discordapp.net/attachments/371759389889003532/963637467280474122/screenshot_2022-04-12_22_10_39.png |
03:11:45 | FromDiscord | <Elegantbeef> Like i said it might be `abgr` not `rgba` |
03:16:38 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Like i said it": no, its not https://media.discordapp.net/attachments/371759389889003532/963638815153610812/screenshot_2022-04-12_22_16_05.png |
03:17:13 | * | Gustavo6046 quit (Ping timeout: 248 seconds) |
03:17:19 | FromDiscord | <Elegantbeef> well screenshot a blue screen, a red screen, and a greenscreen and then look at the reported values |
03:17:44 | FromDiscord | <!Patitotective> it was `bgra` lol |
03:17:53 | FromDiscord | <!Patitotective> thanks beef 🙃 |
03:18:02 | * | Gustavo6046 joined #nim |
03:18:08 | * | dropkick joined #nim |
03:18:09 | FromDiscord | <ynfle> Wrong endian? |
03:20:34 | termer | is there a way to upload arbitrary data with AsyncHttpClient as a file? |
03:20:56 | termer | I'm looking at AsyncHttpClient.add and I'm seeing no way to do that |
03:35:52 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
03:59:07 | FromDiscord | <!Patitotective> fast enough screenshots? `[1s 880ms 620μs 893.91ns] ± [51ms 634μs 648.92ns] per loop (mean ± std. dev. of 7 runs, 1 loops each)` |
04:02:42 | * | SamuelMarks joined #nim |
04:04:02 | FromDiscord | <Elegantbeef> Is that release? |
04:04:20 | FromDiscord | <!Patitotective> ... one sec |
04:05:34 | FromDiscord | <!Patitotective> `[159ms 121μs 300.57ns] ± [1ms 914μs 66.91ns] per loop (mean ± std. dev. of 7 runs, 1 loops each)` |
04:05:38 | FromDiscord | <!Patitotective> much faser |
04:05:39 | FromDiscord | <!Patitotective> (edit) "faser" => "faster" |
04:05:56 | FromDiscord | <Elegantbeef> Only way to be faster is if you didnt need to convert it 😛 |
04:07:08 | FromDiscord | <!Patitotective> anyways as linerino can stay still forever there's no speed limitation (i think) |
04:07:12 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
04:07:23 | FromDiscord | <huantian> the speed limitation is your patience |
04:07:43 | FromDiscord | <Elegantbeef> I mean you only need a single image to solve it |
04:07:49 | FromDiscord | <huantian> true lmao |
04:08:02 | FromDiscord | <huantian> can't wait for non-deterministic linerino |
04:08:21 | FromDiscord | <Elegantbeef> Lol fighting cmake so going to be waiting a while |
04:09:21 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I mean you only": then why am i making this? 🥲 |
04:09:33 | FromDiscord | <Elegantbeef> No clue |
04:09:51 | FromDiscord | <!Patitotective> lmao |
04:11:52 | * | vicfred joined #nim |
04:17:17 | * | dropkick quit (Remote host closed the connection) |
04:19:14 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=3V15 |
04:19:36 | FromDiscord | <aph> i was trying to turn `test` to `BoneNil` with some inheritance magic, it doesn't work as i expected |
04:19:38 | FromDiscord | <Elegantbeef> `new BoneNil` |
04:19:43 | FromDiscord | <aph> In reply to @Elegantbeef "`new BoneNil`": ahh |
04:20:31 | FromDiscord | <aph> it seems like i done something wrong in the inheritance thing `but expected 'InheritBone = ref InheritBone:ObjectType'` |
04:20:46 | FromDiscord | <huantian> hm shouldn't `BoneType = ref object of RootObj` and so on |
04:21:19 | FromDiscord | <aph> In reply to @huantian "hm shouldn't `BoneType* =": not sure, i thought `object` must have fields, brb lemme check thx |
04:21:24 | FromDiscord | <aph> (edit) "ahh" => "ahh, ty" |
04:21:49 | FromDiscord | <Elegantbeef> objects dont have to have fields |
04:22:16 | FromDiscord | <aph> whoopsi |
04:22:23 | FromDiscord | <!Patitotective> hey beeef, could you tell me whats linerino's window default size? hehe |
04:23:00 | FromDiscord | <Elegantbeef> You mean how many pixels does the screen "have" |
04:23:05 | * | slowButPresent quit (Quit: leaving) |
04:23:07 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "You mean how many": i guess |
04:23:15 | FromDiscord | <Elegantbeef> It's 128x128 |
04:23:25 | FromDiscord | <!Patitotective> thanks 🙃 |
04:26:12 | FromDiscord | <!Patitotective> ~~if i run linerino it blocks the program so it can't take the screenshot 💀 ~~ |
04:27:57 | FromDiscord | <huantian> beef has anticheat! |
04:28:11 | FromDiscord | <!Patitotective> In reply to @huantian "beef has anticheat!": he's just playing with me 💀 |
04:28:55 | FromDiscord | <!Patitotective> anyways, its time to sleep↵gn https://media.discordapp.net/attachments/371759389889003532/963657008274350150/Screenshot_from_2022-04-12_23-28-21.png |
04:28:57 | FromDiscord | <!Patitotective> 🌃 |
04:35:09 | * | SamuelMarks joined #nim |
04:41:27 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
04:44:26 | * | vicfred quit (Quit: Leaving) |
04:47:53 | * | yoyojambo joined #nim |
04:49:24 | * | yiggityswaps quit (Ping timeout: 240 seconds) |
05:32:14 | * | kenran joined #nim |
05:35:59 | * | rockcavera quit (Remote host closed the connection) |
05:52:21 | FromDiscord | <morgan> is there any reason why i should get this warning `Error: undeclared identifier: 'result'`? |
05:52:30 | FromDiscord | <morgan> that's the only instance of result in that proc |
05:52:42 | FromDiscord | <Elegantbeef> entire code |
05:53:04 | FromDiscord | <morgan> sent a code paste, see https://paste.rs/yNN |
05:53:11 | FromDiscord | <Elegantbeef> No return type |
05:53:29 | FromDiscord | <morgan> oohhh thanks |
05:54:46 | FromDiscord | <Elegantbeef> Do i mention now that your callback could just be a `pointer`? |
05:54:47 | FromDiscord | <Elegantbeef> then on invoking you cast to the type based off your flag descrim |
06:04:48 | * | zeus-supreme1 joined #nim |
06:07:52 | * | zeus-supreme quit (Ping timeout: 248 seconds) |
06:18:27 | FromDiscord | <Rika> In reply to @Elegantbeef "`discard await` is wrong": Futures shouldn’t be discarded. Await doesn’t return a future |
06:20:59 | FromDiscord | <Rika> Discard await is fine and you misinterpret the docs |
06:34:40 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
06:52:30 | * | neurocyte8614492 joined #nim |
07:04:30 | * | SamuelMarks joined #nim |
07:08:16 | * | ltriant quit (Ping timeout: 250 seconds) |
07:08:52 | * | ltriant joined #nim |
07:09:34 | * | SamuelMarks quit (Ping timeout: 250 seconds) |
07:31:15 | * | PMunch joined #nim |
07:40:00 | * | ltriant quit (Ping timeout: 246 seconds) |
08:08:07 | * | ltriant joined #nim |
08:13:57 | * | jmd_ quit (Ping timeout: 246 seconds) |
08:52:08 | * | yoyojambo quit (Ping timeout: 248 seconds) |
09:11:11 | * | yoyojambo joined #nim |
09:37:07 | FromDiscord | <Elegantbeef> Ah then yea i'm dumb, and it should be a check for `discard await someProc()` that ensures `someProc() isnot Future[void]` though really the compiler should just be better |
09:45:23 | FromDiscord | <Rika> Doesn’t it already catch if you discard something that gives a void |
09:45:33 | FromDiscord | <Rika> Or is the error just opaque is what you mean |
09:45:35 | FromDiscord | <Tanguy> Or a `.nondiscardable.` and a `forcediscard` |
09:46:50 | FromDiscord | <Rika> You can’t discard void in the first place though so |
09:50:33 | FromDiscord | <tandy> how do i add a project to this month with nim? |
09:50:51 | FromDiscord | <tandy> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: arent you involved ? |
09:52:37 | FromDiscord | <Rika> You pretty much request it |
09:54:13 | FromDiscord | <tandy> pull request? |
09:54:18 | FromDiscord | <tandy> or issue |
09:55:01 | FromDiscord | <Rika> Dunno ngl |
09:55:42 | FromDiscord | <tandy> organisation |
09:56:10 | FromDiscord | <tandy> https://github.com/beef331/website#adding-your-project-to-month-with-nim |
09:56:12 | FromDiscord | <tandy> found this |
09:56:36 | PMunch | @tandy, yes |
09:56:43 | PMunch | You basically just make an issue here: https://github.com/beef331/website/issues?q=is%3Aissue+is%3Aclosed |
09:57:31 | * | PMunch quit (Quit: Leaving) |
10:02:35 | FromDiscord | <tandy> done |
10:13:53 | * | SamuelMarks joined #nim |
10:19:11 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
10:35:15 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/AYX |
10:44:50 | FromDiscord | <Solitude> 2 is less awkward, especially in method call chains. |
10:50:16 | FromDiscord | <Rika> Dunno, depends on you |
10:50:19 | FromDiscord | <Rika> I think either is fine |
10:50:39 | FromDiscord | <Rika> 1 doesn’t have much an issue for method call chains |
10:55:52 | FromDiscord | <jmgomez> Okay, never saw something like typedesc in other langs. Is there a good explanation out there on how it works? |
11:05:34 | FromDiscord | <Rika> It’s a “type descriptor” |
11:22:24 | FromDiscord | <jmgomez> do you know a good article/entry on the docs for it? |
11:22:41 | FromDiscord | <jmgomez> or maybe source code to look at |
11:23:59 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#special-types-typedesc-t |
11:47:55 | FromDiscord | <jmgomez> the concept of types as values is pretty powerful, have to dig in yet into templates and macros |
11:48:42 | FromDiscord | <Rika> Yeah I don’t know why all these other language stopped at functions as values |
11:49:16 | FromDiscord | <Rika> Why not types as well? And why not everything for that matter |
12:02:20 | * | SamuelMarks joined #nim |
12:07:20 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
12:18:02 | * | noeontheend joined #nim |
12:28:28 | FromDiscord | <sOkam!> I'm translating some Ansi C code with c2nim↵It's giving me a lot of `cint`, `cchar` and all those other `c` variable types↵I understand that those are aliases for `{.importc}` variables, so hence my Q:↵- Do I need to care about `c` variables at all, if I won't be interfacing with C with the resulting code? |
12:31:10 | FromDiscord | <sOkam!> The goal is to convert that Ansi C project into pure Nim↵But I don't know if I should take the extra time to change the variable types, or if I can just leave them as they are and not worry about it too much 🤔 |
12:31:46 | FromDiscord | <Rika> If you change the types, your behaviour may change as well |
12:31:57 | FromDiscord | <Rika> If you understand well enough what happens then feel free to change them |
12:32:08 | FromDiscord | <Rika> I’d recommend writing tests before that though |
12:32:10 | FromDiscord | <sOkam!> I'm surely don't 🙈 |
12:32:19 | FromDiscord | <sOkam!> (edit) "I'm" => "I" |
12:32:29 | FromDiscord | <sOkam!> Will leave them as `c` then |
12:34:14 | FromDiscord | <sOkam!> It is also converting `void` functions into typeless `proc`s.↵Should I manually add void at the end, or are nim procs void by default? |
12:34:45 | FromDiscord | <Rika> Void by default |
12:35:09 | * | zeus-supreme joined #nim |
12:38:07 | * | zeus-supreme1 quit (Ping timeout: 240 seconds) |
12:42:15 | * | rockcavera joined #nim |
12:42:15 | * | rockcavera quit (Changing host) |
12:42:15 | * | rockcavera joined #nim |
12:57:22 | * | xet7 quit (Remote host closed the connection) |
12:59:54 | * | xet7 joined #nim |
13:09:29 | * | SamuelMarks joined #nim |
13:20:04 | * | noeontheend quit (Ping timeout: 250 seconds) |
13:34:55 | * | jjido joined #nim |
13:43:11 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
13:49:13 | FromDiscord | <konsumlamm> In reply to @Rika "Why not types as": because types only exist at compile time, usually (and you can't really use `typedesc` for runtime types either)↵althoufh dependent types exist, which somewhat give you that |
13:49:50 | FromDiscord | <sOkam!> are double pointers allowed in nim?↵also, where can I read about how they work in the language? 🤔 |
13:51:49 | FromDiscord | <sOkam!> (edit) "they" => "pointers" |
13:54:41 | FromDiscord | <Rika> In reply to @konsumlamm "because types only exist": I wasn’t asking asking |
13:54:57 | FromDiscord | <Rika> In reply to @sOkam! "are double pointers allowed": Sure |
13:55:20 | * | arkurious joined #nim |
13:55:52 | FromDiscord | <Yardanico> In reply to @sOkam! "are double pointers allowed": = ptr, void = pointer, & = addr |
13:56:17 | FromDiscord | <Yardanico> for dereferencing you use `[]` |
13:56:58 | * | xet7 quit (Remote host closed the connection) |
14:03:45 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
14:08:35 | FromDiscord | <sOkam!> In reply to @Yardanico "https://nim-lang.org/docs/manual.html#types-referen": ty! 🙂 |
14:13:34 | * | rockcavera quit (Remote host closed the connection) |
14:26:49 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3V2x |
14:27:12 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=3V2x" => "https://paste.rs/j7U" |
14:29:34 | nrds | <Prestige99> Is there a way to statically compile c dependencies into a nim library? E.g. I'm using SDL for my game engine, and would like to compile a game to a single binary |
14:34:35 | FromDiscord | <Jakraes> So far what's the best sdl2 wrapper for nim? sdl2 or sdl2_nim? |
14:35:20 | nrds | <Prestige99> sdl2_nim I believe, it's what I'm using at least |
14:41:26 | FromDiscord | <Jakraes> I'll try that out then, thank you |
14:42:36 | nrds | <Prestige99> This may be of use https://github.com/avahe-kellenberger/shade/blob/master/src/shadepkg/game/game.nim |
14:43:51 | NimEventer | New Nimble package! useradd - Linux adduser/useradd library with all batteries included., see https://github.com/theAkito/nim-useradd |
14:44:47 | FromDiscord | <hmmm> lol nim programmers have the freshest avatars 😃 |
14:45:51 | FromDiscord | <Jakraes> In reply to @nrds "<Prestige> This may be": I'll also try that out, also, is it normal to have "Could not load SDL2_xyz.dll" errors? I'm having this with SDL2-image.dll |
14:47:36 | nrds | <Prestige99> Yeah you need to have the dll files in your PATH I think on windows (I'm on linux and use LD_LIBRARY_PATH, not very familiar with windows) |
14:47:54 | FromDiscord | <Solitude> In reply to @Jakraes "I'll also try that": you sure its a 64bit dll? |
14:49:00 | nrds | <Prestige99> Yeah looks like on windows you need the dll files to be in a directory that's in your PATH environment variable |
14:50:12 | nrds | <Prestige99> I'm actually trying to figure out how to statically compile for that reason |
14:50:56 | FromDiscord | <Jakraes> In reply to @Solitude "you sure its a": Yeah it's 64bit, so I'm not sure why it's not working |
14:51:04 | FromDiscord | <Jakraes> Already added it to the path |
14:51:09 | FromDiscord | <Jakraes> Doesn't work :/ |
14:51:16 | nrds | <Prestige99> Is it the right name? |
14:51:24 | FromDiscord | <Jakraes> Yup |
14:51:50 | nrds | <Prestige99> Can you provide all the info? Error message, path it's in, name etc |
14:51:55 | nrds | <Prestige99> Sounds like it should be working |
14:53:09 | FromDiscord | <Jakraes> This is the error https://media.discordapp.net/attachments/371759389889003532/963814099278495825/Screenshot_1.png |
14:53:30 | FromDiscord | <Jakraes> Like, SDL2 itself is working because when I run the first example from sdl2_nim, it works perfectly |
14:55:06 | FromDiscord | <Jakraes> And the sdl2.dll file is in my nim directory https://media.discordapp.net/attachments/371759389889003532/963814589785604176/Screenshot_2.png |
14:55:11 | FromDiscord | <Yardanico> you need SDL2_image.dll as well |
14:55:18 | FromDiscord | <Yardanico> it's an extension of SDL so it's a separate library |
14:55:19 | FromDiscord | <Jakraes> Oh, it's not included in sdl2? |
14:55:21 | nrds | <Prestige99> ^ it's a different dll |
14:55:24 | FromDiscord | <Jakraes> Gotcha |
14:55:26 | FromDiscord | <Yardanico> well, it says right in the error that it's a different dll |
14:59:07 | * | SamuelMarks joined #nim |
14:59:23 | FromDiscord | <konsumlamm> In reply to @sOkam! "Is there any difference": no |
14:59:51 | FromDiscord | <Yardanico> In reply to @sOkam! "Is there any difference": `;` is only useful in a couple of cases |
14:59:59 | FromDiscord | <Yardanico> with `using` and with generics |
15:00:38 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#procedures |
15:01:44 | FromDiscord | <Recruit_main707> i use it bc why not, but yeah, not needed |
15:02:12 | * | slowButPresent joined #nim |
15:03:07 | FromDiscord | <sOkam!> I see. Yeah, the question comes because c2nim is converting all `,` into `;`, so wondered why 🤷♂️ |
15:04:04 | FromDiscord | <Yardanico> because Аraq prefers `;` :) |
15:04:23 | FromDiscord | <Yardanico> and it's generally just a little better so you won't have weird errors in some rare cases |
15:04:29 | FromDiscord | <sOkam!> makes senses 🙂 |
15:04:52 | FromDiscord | <Recruit_main707> In reply to @Yardanico "because Аraq prefers `;`": Araq based |
15:12:34 | FromDiscord | <Solitude> https://github.com/nim-lang/Nim/pull/19711 beef, what the hell |
15:13:31 | FromDiscord | <sOkam!> c2nim its doing this thing where its automatically naming arguments for things↵are unnamed arguments disallowed in nim, but allowed in AnsiC? Or am I missing something else? 🤔 https://media.discordapp.net/attachments/371759389889003532/963819225917558884/unknown.png |
15:15:01 | FromDiscord | <Yardanico> those at the top are C forward declarations, but yes, in Nim arguments should always be named |
15:15:05 | FromDiscord | <Yardanico> even in forward declarations, unlike C |
15:17:02 | FromDiscord | <Solitude> !eval proc t(_: int) = discard |
15:17:04 | NimBot | <no output> |
15:17:10 | FromDiscord | <Solitude> amazing |
15:17:19 | FromDiscord | <Yardanico> but `_` isn't empty |
15:17:31 | FromDiscord | <Solitude> funny, that the only place _ is mentioned in manual is tuple unpacking |
15:17:44 | FromDiscord | <Yardanico> yes |
15:17:50 | FromDiscord | <Solitude> even tho it can be used everywhere |
15:17:56 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/voc |
15:18:07 | FromDiscord | <sOkam!> In reply to @Yardanico "even in forward declarations,": is there any doc about forward declarations? google not being very helpful on this one 😔 |
15:18:13 | FromDiscord | <Yardanico> for C or Nim? |
15:18:16 | FromDiscord | <sOkam!> nim |
15:18:21 | FromDiscord | <sOkam!> (edit) "In reply to @Yardanico "even in forward declarations,": is there any doc about ... forward" added "nim" |
15:18:23 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#procedures |
15:18:29 | FromDiscord | <Yardanico> i linked it already |
15:18:32 | FromDiscord | <Yardanico> it's all in there |
15:18:51 | FromDiscord | <Yardanico> but again, the ones c2nim defines aren't really forward declarations, they're imports of the C functions to Nim |
15:19:10 | FromDiscord | <Yardanico> nim forward declarations are only made for nim-native procedures and functions |
15:19:32 | FromDiscord | <sOkam!> i see |
15:19:39 | FromDiscord | <sOkam!> In reply to @Yardanico "i linked it already": sry, didn't see it |
15:20:32 | FromDiscord | <sOkam!> considering that nim doesn't use header files, should I be translating `.h` files at all? |
15:21:10 | FromDiscord | <sOkam!> Or should I just merge both `.h` and `.c` files of the same name into one `.nim` file, with the header content at the top? |
15:21:51 | FromDiscord | <Solitude> if you're not rewriting it in nim, .h files are the only thing you should be translating |
15:22:05 | FromDiscord | <sOkam!> I am |
15:22:16 | FromDiscord | <Solitude> ... |
15:22:47 | FromDiscord | <Solitude> so are you planning to reuse c code? |
15:22:59 | FromDiscord | <sOkam!> Should I not do that, and keep the whole project in C?↵I want to write nim, not ansic |
15:23:00 | FromDiscord | <Solitude> or are you doing straight port of c code to nim? |
15:23:08 | FromDiscord | <Solitude> you tell me |
15:23:14 | FromDiscord | <Yardanico> In reply to @sOkam! "Should I not do": it's better to do it step-by-step |
15:23:25 | FromDiscord | <Yardanico> since you can easily compile Nim code with C, just start making some Nim code with exportc |
15:23:30 | FromDiscord | <Yardanico> that you'll be using in C code |
15:23:38 | FromDiscord | <Yardanico> and do that until you converted your whole project |
15:23:54 | FromDiscord | <Yardanico> although, if it's small enough the direct "convert everything" approach will probably work too |
15:24:17 | FromDiscord | <sOkam!> In reply to @Yardanico "although, if it's small": its not small at all |
15:25:04 | FromDiscord | <sOkam!> but i don't mind. its a long term investment. I just want to end up eventually writing only nim and forget that the project was C back in who knows when |
15:26:18 | FromDiscord | <Yardanico> the thing is - direct conversion is fine, but after all you'll have to rewrite your code so it's actually idiomatic Nim |
15:27:09 | FromDiscord | <Yardanico> and i don't know if it's even useful to convert your C code to direct Nim alternative with all the C types if you'll have to rewrite large chunks of it later anyway |
15:27:18 | FromDiscord | <sOkam!> In reply to @Yardanico "since you can easily": i tried figuring that out, but i failed pretty bad. and c2nim looks pretty straight forward, since I can check line by line and slowly translate |
15:27:18 | FromDiscord | <Yardanico> so they become actual Nim with nim's native types |
15:27:41 | FromDiscord | <Yardanico> well, but again, if you just want to convert the C code directly to Nim without making it use Nim native types and containers, there's really no point |
15:28:09 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
15:28:11 | FromDiscord | <sOkam!> That would be great, but I'm definitely not knowledgeable enough to understand the type conversion part |
15:28:32 | FromDiscord | <Yardanico> not just simple type conversion |
15:28:43 | FromDiscord | <Yardanico> e.g. your C project is using C libc functions for string management |
15:28:45 | FromDiscord | <sOkam!> In reply to @Yardanico "well, but again, if": there is one big point. I don't need to write C if the whole thing is nim |
15:28:50 | FromDiscord | <Yardanico> you'll have to rewrite them to use nim strutils and stuff |
15:28:58 | FromDiscord | <Yardanico> In reply to @sOkam! "there is one big": You don't have to write C either even if your project is in C |
15:29:06 | FromDiscord | <Yardanico> you can extend it with Nim as well, just using the C native types |
15:29:28 | FromDiscord | <sOkam!> I tried asking for help here before, and it was always "use futhark" or something similar |
15:29:31 | FromDiscord | <sOkam!> I really tried, and failed |
15:29:39 | FromDiscord | <sOkam!> I have no clue how to do that 😔 |
15:30:27 | * | SamuelMarks quit (Ping timeout: 240 seconds) |
15:31:44 | nrds | <Prestige99> Is there a way to statically compile c code into a nim binary? |
15:31:58 | nrds | <Prestige99> Maybe I should post on the forum.. |
15:32:41 | FromDiscord | <Yardanico> you just use {.compile.} |
15:32:49 | FromDiscord | <Yardanico> or compile your C code to object files and then link that with your Nim code |
15:33:57 | nrds | <Prestige99> Yeah my goal is to ship one binary without external dynamic libs, I'll look into the compile pragma |
15:37:07 | nrds | <Prestige99> This might be complicated for something like SDL I guess |
15:37:27 | nrds | <Prestige99> I can already statically compile SDL but yeah |
15:39:48 | * | ehmry joined #nim |
15:41:38 | nrds | <Prestige99> Can I statically link with {.link.} ? |
15:42:25 | FromDiscord | <demotomohiro> Why dont you use dynamic link library? |
15:43:07 | nrds | <Prestige99> Big pain to deal with shipping the dependencies, and it's recommended to statically link for WASM |
15:44:35 | FromDiscord | <demotomohiro> SDL are installed on most of linux or package manager can install it. On windows, people ship program with .dll. |
15:45:08 | nrds | <Prestige99> Sure but it's more than just the main SDL library, and also that still wouldn't help with WASM |
15:45:42 | nrds | <Prestige99> I'm currently dynamically linking because I haven't figured out static linking with Nim, I really don't want to be dynamically linking |
15:47:41 | FromDiscord | <demotomohiro> `--clib:LIBNAME` option or `--passL:-lstaticlibname` option doesn't work to link static lib? |
15:48:23 | nrds | <Prestige99> I'll have to try it - haven't found info on how to do it, so I've had little success |
15:50:34 | * | kenran quit (Quit: WeeChat info:version) |
15:52:37 | FromDiscord | <demotomohiro> At first, when you link C library statically, you need to get it or build it as static library. Most of build tools for C have option to compile to static library. |
15:52:55 | FromDiscord | <juan_carlos> sent a long message, see http://ix.io/3V2Q |
15:53:21 | nrds | <Prestige99> I think I have all but 1 built statically |
15:58:23 | * | vicfred joined #nim |
16:09:43 | * | SamuelMarks joined #nim |
16:11:55 | arkanoid | both "vorbis" and "ogg" packages in nible repo are broken (404 not found). Do you know if there are bindings for libogg? |
16:12:01 | * | Gustavo6046 joined #nim |
16:16:11 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
16:16:13 | * | Gustavo6046_ joined #nim |
16:16:26 | * | SamuelMarks quit (Ping timeout: 250 seconds) |
16:16:54 | * | Gustavo6046_ quit (Read error: Connection reset by peer) |
16:22:39 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
16:23:44 | FromDiscord | <Yayko> Hello everyone, I'm learning more about Nim, I wanted to know what "include" is for, I didn't quite understand? |
16:24:38 | FromDiscord | <Yardanico> In reply to @Yayko "Hello everyone, I'm learning": it literally just "adds" the code from the file you specify in the include statement to the place where you have "include" |
16:25:15 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/Q6n |
16:25:24 | FromDiscord | <Yardanico> but it's recommended to avoid `include` where possible instead using nim's module system |
16:27:16 | FromDiscord | <Yayko> In reply to @Yardanico "it literally just "adds"": Ok that's what I understood, but I don't find too much use compared to an import ^^ |
16:27:36 | FromDiscord | <Yardanico> sometimes when you just want to break one big file into two files without making proper `import` statements and exporting symbols |
16:32:56 | * | Gustavo6046 joined #nim |
16:34:34 | * | xet7 joined #nim |
16:40:24 | * | xet7 quit (Ping timeout: 248 seconds) |
16:40:24 | * | jjido joined #nim |
16:43:01 | FromDiscord | <Jakraes> Does anyone have the link for that blog that talked about good code practices in nim? |
16:43:29 | FromDiscord | <Jakraes> I lost the link :/ |
16:43:41 | * | SamuelMarks joined #nim |
16:49:03 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
16:58:08 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
16:59:03 | arkanoid | it's so damn difficult getting autocompletion to work with nim |
17:00:38 | * | jjido joined #nim |
17:02:01 | arkanoid | the logging of the vscode extension doesn't say anything, it's completely useless |
17:02:10 | FromDiscord | <Yardanico> it always works for me 🤷 |
17:02:17 | FromDiscord | <Yardanico> well, not always, but in most of cases |
17:02:23 | FromDiscord | <Yardanico> just get a blessing from the nim gods |
17:02:34 | arkanoid | do you use "nim.project" settings? |
17:03:58 | FromDiscord | <Yardanico> no |
17:04:05 | FromDiscord | <Yardanico> but how would those change anything |
17:04:46 | arkanoid | I manage to get back to nim every now and then, and this lack of turnkey experience always makes me want to throw nim out of the window |
17:05:28 | arkanoid | my vscode settings.json is empty for my workspace, so I'm using stock config |
17:07:42 | * | kenran joined #nim |
17:15:06 | * | vicfred quit (Quit: Leaving) |
17:19:52 | * | SamuelMarks joined #nim |
17:24:45 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
17:25:27 | * | kenran quit (Quit: WeeChat info:version) |
17:25:39 | * | kenran joined #nim |
17:41:53 | FromDiscord | <hmmm> hmmm what does the science of progamming say about looping a buncha things but you need the first iteration to behave slightly differently? As usual I'm using the caveman approach but I'm pretty sure there must be an elegant way I don't know 🤔 |
17:43:46 | FromDiscord | <Solitude> nah, we wish there was |
17:44:04 | FromDiscord | <hmmm> sadge 😦 |
17:45:03 | FromDiscord | <d4rckh> I forgot what they were called, but its those integer timestamps, how can I get one from DateTime? |
17:45:12 | FromDiscord | <hmmm> solibro always on the freshest vernacular I see 😄 |
17:46:11 | FromDiscord | <Solitude> In reply to @d4rckh "I forgot what they": tounix or something |
17:57:06 | * | vicfred joined #nim |
17:59:12 | FromDiscord | <d4rckh> thanks! |
17:59:39 | FromDiscord | <d4rckh> can i get nano seconds from a datetime object? |
17:59:43 | FromDiscord | <d4rckh> (edit) "object?" => "object when formatting it?" |
18:01:21 | FromDiscord | <d4rckh> fff seems to work |
18:01:34 | * | rockcavera joined #nim |
18:01:35 | * | rockcavera quit (Changing host) |
18:01:35 | * | rockcavera joined #nim |
18:10:03 | * | SamuelMarks joined #nim |
18:15:13 | * | SamuelMarks quit (Ping timeout: 272 seconds) |
18:21:30 | * | enyc quit (Ping timeout: 252 seconds) |
19:01:17 | * | kenran quit (Quit: WeeChat info:version) |
19:01:39 | * | SamuelMarks joined #nim |
19:04:29 | * | rockcavera quit (Ping timeout: 256 seconds) |
19:05:21 | * | zeus-supreme1 joined #nim |
19:06:20 | * | jmdaemon joined #nim |
19:06:43 | * | SamuelMarks quit (Ping timeout: 260 seconds) |
19:07:40 | * | zeus-supreme quit (Read error: Connection reset by peer) |
19:11:05 | * | SamuelMarks joined #nim |
19:17:34 | FromDiscord | <Jakraes> Is it possible to define an array with an undefined size? |
19:18:08 | nrds | <Prestige99> Nah but you can create a sequence which can change size at runtime |
19:18:42 | FromDiscord | <Jakraes> Hmmm that does work as well |
19:33:13 | Amun-Ra | Jakraes: only seq |
19:33:28 | Amun-Ra | yes, you can create arrays in compile time |
19:34:26 | FromDiscord | <jmgomez> Does nim has support for some sort of reflection at runtime? i.e. executing a method on an object by str? |
19:35:41 | FromDiscord | <Yardanico> no, but generally it's not needed as you have a lot of advanced macro stuff at the compile time |
19:35:45 | Amun-Ra | macros |
19:36:07 | FromDiscord | <Yardanico> you can have "executing by proc name" if you store procedures in a table of course, but then they all have to be the same type |
19:36:40 | FromDiscord | <jmgomez> okay |
19:36:40 | FromDiscord | <jmgomez> thanks |
19:37:14 | Amun-Ra | I'd refactor that code, tho |
19:38:59 | FromDiscord | <jmgomez> Im just curios as Im looking for how to approach a large cpp binding |
19:39:12 | FromDiscord | <jmgomez> I do have a reflection mechanism on the cpp side of things |
19:41:36 | Amun-Ra | what mechanism do you use on cxx side? |
19:41:42 | * | noeontheend joined #nim |
19:45:01 | FromDiscord | <jmgomez> UE's Reflection System |
19:45:27 | FromDiscord | <jmgomez> Im planning to use Im not actually using it yet |
19:45:29 | FromDiscord | <jmgomez> lol |
19:46:32 | * | jmdaemon quit (Read error: Connection reset by peer) |
19:46:42 | * | jmd_ joined #nim |
19:47:07 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:54:10 | * | bananahead joined #nim |
19:55:01 | Amun-Ra | :> |
20:04:09 | * | SamuelMarks quit (Ping timeout: 272 seconds) |
20:07:27 | FromDiscord | <Jakraes> Quick question, I'm using the same imported library on various files, is there a way to just import it once across all files? |
20:12:52 | FromDiscord | <!Patitotective> id say no↵but if those modules import each other you could export it https://nim-lang.org/docs/manual.html#modules-export-statement |
20:17:30 | FromDiscord | <Yardanico> In reply to @Jakraes "Quick question, I'm using": there is one way, but it's kind of unclean anyway |
20:18:06 | FromDiscord | <Yardanico> `--import` compiler flag, although I don't think it allows to import stdlib modules if you don't know their PATH |
20:18:07 | FromDiscord | <Yardanico> https://nim-lang.org/docs/nimc.html |
20:18:12 | FromDiscord | <Yardanico> so yeah, just import in all files, it's not a big deal |
20:24:10 | FromDiscord | <hmmm> In reply to @Jakraes "Quick question, I'm using": hey jak why is bad importing the same stuff for every module? 🤔 (signed by a serial mass importer that is now sweating) |
20:25:34 | FromDiscord | <Jakraes> In reply to @Yardanico "`--import` compiler flag, although": I might try that out, and I'll try export as well and see which one works best for what I want |
20:25:57 | FromDiscord | <Jakraes> In reply to @hmmm "hey jak why is": It's just C habits more or less, since you can just import everything into a header file |
20:26:51 | FromDiscord | <Yardanico> well, Nim doesn't work that way really |
20:28:03 | FromDiscord | <Jakraes> Yeah I figured, it's no biggie though, I don't mind the imports that much |
20:30:17 | FromDiscord | <spoon> wouldn't you still have to include that header file in everything? |
20:30:26 | * | SamuelMarks joined #nim |
20:30:55 | FromDiscord | <Jakraes> Yeah, but instead of import 3 or 4 libraries you can import all of them into a header file and just import that file |
20:31:40 | FromDiscord | <spoon> well i mean i'm pretty sure in theory you could make a nim file that just `import`s all the libraries and then `export`s them |
20:32:06 | FromDiscord | <spoon> then just include that |
20:32:22 | FromDiscord | <ynfle> In reply to @spoon "well i mean i'm": This is used for `std/prelude` |
20:33:42 | FromDiscord | <spoon> its also how a lot of libraries have one core file, by exporting all the submodules |
20:33:56 | FromDiscord | <hmmm> anyway the real nastiness about imports is the recursive thingy. I want a simple world in which A imports B and B imports A and all is nice in the world 🧐 |
20:35:03 | FromDiscord | <spoon> In reply to @hmmm "anyway the real nastiness": export statement? |
20:35:09 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
20:37:18 | FromDiscord | <hmmm> hmm I don't use it. I use a weird matrioska way in which types are the smallest and gets imported by everyone and you have bigger modules that import the smallest. It's mental and I hope Araq will soon free me from it 🤔 |
20:45:07 | * | noeontheend quit (Ping timeout: 240 seconds) |
20:48:05 | * | SamuelMarks joined #nim |
20:52:27 | * | SamuelMarks quit (Ping timeout: 240 seconds) |
20:54:40 | * | supakeen quit (Remote host closed the connection) |
20:58:53 | FromDiscord | <SolitudeSF> thats not nice↵(@hmmm) |
20:59:16 | * | jjido joined #nim |
20:59:45 | FromDiscord | <hmmm> hmm? 🤔 |
21:05:45 | Amun-Ra | free in what matter? |
21:12:10 | * | vicfred quit (Quit: Leaving) |
21:15:42 | * | rockcavera joined #nim |
21:15:43 | * | rockcavera quit (Changing host) |
21:15:43 | * | rockcavera joined #nim |
21:26:45 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3V45 |
21:27:12 | FromDiscord | <Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=3V45" => "https://play.nim-lang.org/#ix=3V46" |
21:32:04 | FromDiscord | <konsumlamm> looks like a bug to me |
21:46:47 | FromDiscord | <!Patitotective> In reply to @hmmm "anyway the real nastiness": that would be so confusing, having a `commons.nim` module makes everything cleaner and clearer if it's not your code, i think |
21:47:09 | FromDiscord | <!Patitotective> i have never needed a recursive import, until now 🤷♂️ |
21:47:52 | FromDiscord | <!Patitotective> (edit) "import," => "import" |
21:51:13 | FromDiscord | <Generic> I desparately need cyclic imports |
21:52:11 | FromDiscord | <Generic> it really depends on your project, some just have this cyclic property, there's no way around it |
21:52:29 | * | SamuelMarks joined #nim |
21:53:12 | FromDiscord | <Elegantbeef> Well Nim has limited cyclical support but requires using the noggin to make it work |
21:53:22 | FromDiscord | <Generic> I'm using that already as much as possible |
21:53:28 | FromDiscord | <Generic> but I've come to the point where it breaks cgen |
21:53:57 | FromDiscord | <Generic> so I have to resort to even exportc/importc |
21:54:02 | FromDiscord | <Elegantbeef> breaking cgen instead of Nim compiling using it is quite a challenge |
21:54:45 | FromDiscord | <Generic> the problem is that it somehow forgets to generate the function prototype in one file |
21:55:02 | FromDiscord | <Generic> but I couldn't make a minimal example, so I didn't report it |
21:55:57 | * | dv^_^ quit (Quit: dv^_^) |
21:56:26 | * | dv^_^ joined #nim |
21:57:08 | * | dropkick joined #nim |
21:57:12 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
21:57:38 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3V47 |
21:57:44 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=3V47" => "https://play.nim-lang.org/#ix=3V48" |
21:58:12 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=3V48" => "https://paste.rs/F4x" |
21:58:26 | FromDiscord | <Elegantbeef> `igWindow do:` |
21:59:32 | * | SamuelMarks joined #nim |
22:00:07 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3V49 |
22:00:31 | FromDiscord | <Elegantbeef> Yes |
22:00:39 | FromDiscord | <Elegantbeef> `do` should pass to the last argument |
22:01:06 | FromDiscord | <!Patitotective> same error :C↵https://play.nim-lang.org/#ix=3V4b |
22:01:34 | FromDiscord | <Elegantbeef> Well then you need a seperate template |
22:02:55 | FromDiscord | <morgan> sent a code paste, see https://play.nim-lang.org/#ix=3V4d |
22:03:02 | FromDiscord | <morgan> obvs in that example it doesn't matter |
22:03:21 | FromDiscord | <morgan> but when i have several long types being or'd together it's a bit more helpful |
22:03:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3V4e |
22:03:43 | FromDiscord | <Elegantbeef> the infix operator has to be at the end of a line |
22:04:16 | FromDiscord | <Elegantbeef> This way the compiler knows "Hey the next statement is apart of this one" |
22:04:49 | FromDiscord | <morgan> ooohh ok makes sense |
22:04:51 | FromDiscord | <morgan> thanks |
22:05:33 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "This way the compiler": ~~if that were that easy 💀 ~~ |
22:05:54 | FromDiscord | <Elegantbeef> What? |
22:07:15 | FromDiscord | <!Patitotective> npeg is sometimes not that handy so it gets complicated, at least for me |
22:07:49 | FromDiscord | <!Patitotective> i mean, parsing |
22:08:11 | FromDiscord | <Elegantbeef> I mean the same rule applies |
22:08:13 | FromDiscord | <Elegantbeef> DSLs have to abide by the Nim parser |
22:09:51 | FromDiscord | <morgan> sent a code paste, see https://paste.rs/HPR |
22:09:58 | FromDiscord | <Elegantbeef> Wrap your procs with `()` |
22:10:09 | FromDiscord | <Elegantbeef> Also you know you dont need the `: void`? |
22:10:16 | FromDiscord | <Yardanico> In reply to @MorganAlyssa "aw i can't seem": this won't work |
22:10:21 | FromDiscord | <Yardanico> first of all, you can't store a `var` in a tuple |
22:10:39 | FromDiscord | <Yardanico> ah, callback might work, but then your tuples won't be interchangeable |
22:11:08 | FromDiscord | <Elegantbeef> Eh i've already told them they can use a `pointer` for their tagged unions and cast back |
22:11:13 | FromDiscord | <Elegantbeef> That works |
22:11:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3V4f |
22:11:23 | FromDiscord | <Elegantbeef> The issue is `: void or` |
22:11:27 | FromDiscord | <morgan> ok |
22:12:46 | FromDiscord | <Elegantbeef> `func initFlag(t: typedesc[ValidFlags], args... , callback: proc(val: t)): FlagVariant = result.callBack = cast[pointer](callback)` |
22:13:17 | FromDiscord | <Elegantbeef> Think they didnt like that they had to do `type.initFlag` or something, they'd rather have a tedious api from what i can tell |
22:14:38 | FromDiscord | <morgan> what im working on now, it's gonna let you input a list of tuples containing the params you'd put into one of the procs and then loop over that to add them |
22:15:08 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:16:02 | FromDiscord | <morgan> so yes im trying to make an easier api |
22:16:10 | FromDiscord | <Elegantbeef> Well the api you |
22:16:15 | FromDiscord | <Elegantbeef> you |
22:16:15 | FromDiscord | <Elegantbeef> Jesus |
22:16:19 | FromDiscord | <Elegantbeef> ..... i cannot hit ' |
22:16:39 | FromDiscord | <Elegantbeef> you're making is just the same as the one i suggested but more complicated |
22:18:02 | FromDiscord | <morgan> from what i remember you suggesting, this would be simpler to a user |
22:18:14 | FromDiscord | <morgan> instead of a list with a bunch of procs or something idr exactly |
22:26:54 | * | supakeen joined #nim |
22:29:36 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3V4m |
22:33:02 | FromDiscord | <morgan> really annoyed that im gonna have to have like 20 tuples or'd for this instead of 4 with a param having an or'd type |
22:33:50 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3V4n |
22:34:32 | FromDiscord | <Elegantbeef> Sorry |
22:34:32 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3V4o here |
22:35:22 | FromDiscord | <Elegantbeef> No need for tuples or anything wacky |
22:35:23 | FromDiscord | <morgan> hm i could do two openarrays instead of one, with one just for callbacks or references |
22:36:35 | * | syl quit (Quit: ZNC 1.8.2 - https://znc.in) |
22:37:10 | * | syl joined #nim |
22:39:54 | * | SamuelMarks quit (Quit: leaving) |
22:47:19 | * | gsalazar quit (Ping timeout: 256 seconds) |
22:50:09 | * | noeontheend joined #nim |
22:56:59 | FromDiscord | <Elegantbeef> patito look at the code you're generating |
22:56:59 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3V4u |
22:57:00 | FromDiscord | <Elegantbeef> `greet()` isnt valid |
22:58:16 | FromDiscord | <!Patitotective> becase it missed the parameters, right? |
23:07:25 | FromDiscord | <Elegantbeef> yes |
23:09:14 | FromDiscord | <Forest> Heya, what's a good library for making android apps? |
23:09:44 | FromDiscord | <Forest> I wanna make a game, and I'd preferably want it to be usable on PC and Android, but Android is my main focus (and tbh iOS would be a plus) |
23:09:57 | FromDiscord | <Elegantbeef> Dont think most libraries are setup to be programmed from mobile |
23:10:20 | FromDiscord | <Forest> I wanna make an app for mobile lol, not with |
23:10:32 | FromDiscord | <Elegantbeef> Have you changed? |
23:10:38 | FromDiscord | <Forest> ~~Since i already have the android ndk and sdk installed on my phone~~ |
23:10:44 | FromDiscord | <Yardanico> In reply to @Forest "I wanna make a": making a game is not the same as making an app |
23:10:50 | FromDiscord | <Yardanico> for making a game on android you can use the same tools as on desktop |
23:10:53 | FromDiscord | <Yardanico> e.g. SDL |
23:10:56 | FromDiscord | <Forest> Oh fair |
23:10:57 | FromDiscord | <Yardanico> nico for example works well on android |
23:11:03 | FromDiscord | <Forest> Alright, thanks! |
23:11:04 | FromDiscord | <Elegantbeef> Yep sdl2 is quite easy to work with |
23:11:15 | FromDiscord | <Elegantbeef> make a new activity that inherits the sdl2 activity and use ndk to build your project |
23:12:41 | FromDiscord | <Forest> Alright, thanks! |
23:14:12 | FromDiscord | <Forest> Hm would Naylib be a good idea for making a character creator app? |
23:15:09 | FromDiscord | <Yardanico> there's no really notion of "good idea" or not, since it's not a game engine and just a game framework |
23:15:49 | FromDiscord | <Yardanico> also why do you have a different nickname each time you become active on this server again 🤔 |
23:16:10 | FromDiscord | <Elegantbeef> Yard can you change your name to metreanico? |
23:16:21 | FromDiscord | <Yardanico> no |
23:16:33 | FromDiscord | <Elegantbeef> Damn was worth a try to get you to metric |
23:16:39 | FromDiscord | <Yardanico> im metric already |
23:16:50 | FromDiscord | <Elegantbeef> A yard is imperial |
23:18:14 | FromDiscord | <Forest> In reply to @Yardanico "there's no really notion": Fair |
23:18:25 | FromDiscord | <Forest> In reply to @Yardanico "also why do you": Eh? I haven't changed it for a long time now? |
23:18:36 | FromDiscord | <Forest> I've had this for a few months xD |
23:20:08 | FromDiscord | <Yardanico> > few months |
23:20:16 | FromDiscord | <Yardanico> that is very often in my book |
23:23:26 | FromDiscord | <!Patitotective> @ElegantBeef now its adding the parameters but i guess not the right way cause it says `Error: internal error: environment misses: name`↵https://play.nim-lang.org/#ix=3V4znot sure how to convert param into an ident or to something that's evaluated as a variable |
23:23:30 | FromDiscord | <!Patitotective> (edit) "name`↵https://play.nim-lang.org/#ix=3V4znot" => "name`↵https://play.nim-lang.org/#ix=3V4z↵not" |
23:31:17 | FromDiscord | <Elegantbeef> You're really making this backwards and upside down |
23:32:02 | FromDiscord | <!Patitotective> :C |
23:32:18 | FromDiscord | <!Patitotective> you gotta write a macro's article |
23:32:28 | FromDiscord | <Elegantbeef> I have |
23:32:53 | FromDiscord | <!Patitotective> :o |
23:33:10 | FromDiscord | <!Patitotective> this https://dev.to/beef331/demystification-of-macros-in-nim-13n8 ? |
23:37:31 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3V4B |
23:37:32 | FromDiscord | <Elegantbeef> Write less `[]` not more |
23:37:50 | FromDiscord | <Yardanico> [] is the Nim way of smiling |
23:37:54 | FromDiscord | <Yardanico> :] |
23:37:58 | FromDiscord | <!Patitotective> lmao |
23:38:03 | FromDiscord | <Yardanico> we actually have [: in the language |
23:38:09 | FromDiscord | <Elegantbeef> No it's the way of writing ugly macros |
23:38:14 | FromDiscord | <Elegantbeef> Micros not macros, cmon people! |
23:38:21 | FromDiscord | <Yardanico> Macrohard |
23:38:32 | FromDiscord | <Elegantbeef> No micros easy |
23:38:37 | FromDiscord | <!Patitotective> In reply to @Yardanico "we actually have [:": :[ |
23:38:38 | FromDiscord | <Yardanico> Microsoft |
23:38:39 | * | jmd_ quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:38:57 | * | jmdaemon joined #nim |
23:38:58 | FromDiscord | <!Patitotective> gotta try micros |
23:39:11 | FromDiscord | <Elegantbeef> I really need to actually make a nimib or nimibook writeup for micros it's a big blackbox |
23:39:24 | FromDiscord | <Elegantbeef> But it's much cleaner to read/write |
23:40:58 | FromDiscord | <!Patitotective> btw is it better to use `genast` or `quote do`? i dont like importing stuff lol |
23:41:27 | * | noeontheend quit (Ping timeout: 240 seconds) |
23:42:22 | FromDiscord | <Elegantbeef> `genast` is better than quote do |
23:42:31 | FromDiscord | <Elegantbeef> "i dont like importing stuff" is dumb |
23:42:36 | FromDiscord | <Elegantbeef> Modules exist, use them |
23:42:41 | * | vicfred joined #nim |
23:43:31 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "`genast` is better than": why |
23:43:39 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Modules exist, use them": :] |
23:47:36 | FromDiscord | <Elegantbeef> Cause it doesnt require accquoting and you dont need `let x = a` before the call |