00:10:23 | * | hc0re quit (Ping timeout: 256 seconds) |
00:12:53 | * | hc0re joined #nim |
00:21:37 | FromDiscord | <xflywind> I used vtune to profile the Nim compiler, then my PC crashed. |
00:22:32 | FromDiscord | <Elegantbeef> "Ah it says here the entire program is a problem" |
00:24:55 | FromDiscord | <xflywind> lol, tried again. different crash code 𤣠|
00:27:01 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995123875916558346/unknown.png |
00:27:17 | FromDiscord | <xflywind> It seems that the hardware mode is quite dangerous |
00:28:19 | FromDiscord | <Generic> ah yes vtune bsod with hw based sampling |
00:42:01 | FromDiscord | <ajusa> Has anyone used vmath's swizzle functionality? Wondering where it would be useful |
00:42:24 | FromDiscord | <Elegantbeef> Swizzling is useful whenever you want specific components of a vector |
00:43:03 | FromDiscord | <enthus1ast> swizzle ist that right?āµ.rgbāµmat |
00:43:06 | FromDiscord | <Elegantbeef> Say you have a vector3 and want to pass it as a vector2 for whatever reason |
00:43:18 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/995127913122906224): swizzle ist that right?āµcol.rgbāµcol.rgba |
00:43:20 | FromDiscord | <Elegantbeef> it's the component level access on a vector |
00:43:26 | FromDiscord | <ajusa> In a certain order, right? I'm looking at https://www.3dbrew.org/wiki/SMDH (specifically the last part of the graphics section) and wondering if swizzling would help there |
00:43:54 | FromDiscord | <ajusa> Since it seems to encode it in tiles |
00:44:12 | FromDiscord | <Elegantbeef> The point of swizzling is to access specific components in a specific order |
00:44:21 | FromDiscord | <Elegantbeef> If you need that then swizzling is useful |
00:44:42 | FromDiscord | <ajusa> Okay, sounds like I'm confusing tiling and swizzling. Thanks for clarifying! |
00:48:50 | FromDiscord | <sOkam!> Does someone know how to work with `mat` types from `glm`? |
00:49:08 | FromDiscord | <Elegantbeef> Probably |
00:49:12 | FromDiscord | <Elegantbeef> What's the actual question |
00:51:53 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420q |
00:52:33 | FromDiscord | <sOkam!> I'm reading the source file of glm/mat.... but I don't understand why b is not a valid field of a matrix, when abcd are listed in the source code |
00:54:04 | FromDiscord | <Elegantbeef> Where are they listed in the source code? |
00:54:31 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420r |
00:55:08 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420s |
00:55:25 | FromDiscord | <Elegantbeef> Did you read what that template does? |
00:55:37 | FromDiscord | <sOkam!> I read it, doesn't mean I understand it |
00:55:49 | FromDiscord | <Elegantbeef> It calls the constructors |
00:55:58 | FromDiscord | <sOkam!> And there is no documentation on the matrices, just on the vectors |
00:56:13 | FromDiscord | <Elegantbeef> you want `a.arr[0].y` probably |
00:56:33 | FromDiscord | <Elegantbeef> or just `a[1]` rather |
00:57:00 | FromDiscord | <sOkam!> so there is no alias for each row? |
00:57:13 | FromDiscord | <Elegantbeef> There is not |
00:58:32 | * | jmdaemon joined #nim |
00:59:04 | FromDiscord | <sOkam!> and how do you access the components of each row? |
00:59:18 | FromDiscord | <Elegantbeef> `rows` |
00:59:33 | FromDiscord | <Elegantbeef> Sorry `row` |
00:59:57 | FromDiscord | <sOkam!> ? |
01:00:12 | FromDiscord | <Elegantbeef> https://github.com/stavenko/nim-glm/blob/master/glm/mat.nim#L316-L335 |
01:01:06 | FromDiscord | <Elegantbeef> you can do `mat[x, y]` to access a specific component and `mat[x]` to get specific group |
01:01:29 | FromDiscord | <Elegantbeef> I dont know what `mat[x]` returns if it's what people call rows or columns |
01:01:29 | FromDiscord | <sOkam!> is mat the variable or the type? |
01:01:37 | FromDiscord | <sOkam!> or a proc |
01:01:38 | FromDiscord | <Elegantbeef> You're kidding right |
01:01:47 | FromDiscord | <sOkam!> im not, ive been stuck in this for hours for a reason |
01:01:53 | FromDiscord | <Elegantbeef> It's an instance |
01:01:56 | FromDiscord | <sOkam!> please don't assume i understand this, because i dont |
01:02:28 | FromDiscord | <sOkam!> never dealt with templates in my life, so this file is mega cryptic for me |
01:02:29 | FromDiscord | <Elegantbeef> The `[]` and `[]=` are defined https://github.com/stavenko/nim-glm/blob/master/glm/mat.nim#L44-L56 |
01:03:15 | FromDiscord | <sOkam!> If i knew templates i could read the file no issue. But I don't understand it, so linking to the file I have open won't help much š |
01:03:41 | FromDiscord | <Elegantbeef> Are we talking about generics or that one template? |
01:04:01 | FromDiscord | <Elegantbeef> Nothing here is complicated, so let's solve your lacking of understanding |
01:04:16 | FromDiscord | <sOkam!> about accesing field `a.x` of mat3x3f. Just a simple example of that, which there is no documentation about |
01:04:37 | FromDiscord | <Elegantbeef> No we're going to make you understand this file |
01:04:39 | FromDiscord | <sOkam!> `thing.a.x` is what I thought I was supposed to access |
01:04:58 | FromDiscord | <Elegantbeef> If you cant read this code you're not going to be able to figure anything out with it |
01:05:08 | FromDiscord | <sOkam!> there is no a... so I try `thing[0].x`.... and still same issue |
01:05:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=420v |
01:05:55 | FromDiscord | <sOkam!> proc `[]=` that returns nothing, which takes some mat thing (no clue) an int and some vector (also no clue) |
01:06:18 | FromDiscord | <sOkam!> (edit) |
01:06:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=420w |
01:06:34 | FromDiscord | <Elegantbeef> So the generic here ensures that the matrix and the vector are of the same type |
01:06:59 | FromDiscord | <Elegantbeef> `M` is the number of matrix elements, `N` is the number of vector elements and `T` is the type of element |
01:07:19 | FromDiscord | <Elegantbeef> So a 3 by 3 matrix with float32 is `Mat[3, 3, float32]` |
01:09:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=420x |
01:09:37 | FromDiscord | <Elegantbeef> With that in mind if you do `myMat[1].x` it will return the x component of the second row(Like i said i'm fucking awful at esoteric names) |
01:10:09 | FromDiscord | <Elegantbeef> So in your case you want to do `result[1, 0] = a.y` |
01:10:12 | * | bigbyt quit (Read error: Connection reset by peer) |
01:10:40 | * | bigbyt joined #nim |
01:10:42 | FromDiscord | <Elegantbeef> Or `result[1].y = a.y` |
01:11:13 | FromDiscord | <sOkam!> `this[0].x` is saying that there is no X |
01:11:45 | FromDiscord | <sOkam!> https://media.discordapp.net/attachments/371759389889003532/995135131335528549/unknown.png |
01:11:52 | FromDiscord | <sOkam!> can't copypaste, sry about the size |
01:12:59 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420y |
01:13:43 | FromDiscord | <Elegantbeef> Is the compiler erroring or the lsp? |
01:13:47 | FromDiscord | <Elegantbeef> Cause it compiles |
01:13:47 | FromDiscord | <sOkam!> lsp |
01:13:54 | FromDiscord | <Elegantbeef> ... |
01:14:18 | FromDiscord | <sOkam!> nimls specifically |
01:14:53 | FromDiscord | <sOkam!> if I change it to array indexes only, it seems to not complain |
01:15:41 | FromDiscord | <Elegantbeef> Restart your editor |
01:15:41 | FromDiscord | <Elegantbeef> Both LSPs work fine here |
01:17:08 | FromDiscord | <Elegantbeef> It doesnt complain eitherway for me |
01:17:21 | FromDiscord | <Elegantbeef> `nim -v`? |
01:31:53 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420A |
01:46:33 | FromDiscord | <xflywind> Is the nim compiler the blocker for compilation time? |
01:46:38 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995143914480738355/unknown.png |
01:47:45 | FromDiscord | <xflywind> For a full compilation, it occupies 10% of the compilation time. |
01:48:34 | FromDiscord | <Rika> I mean that depends on which C compiler you use of course |
02:00:55 | FromDiscord | <Generic> time for the Nim compiler to start outputting code directly |
02:01:32 | FromDiscord | <Generic> I already have a terrible SSA based intermediate representation with a code generator for it in my emulator |
02:02:02 | FromDiscord | <Elegantbeef> The slow down is stil a majority Nim |
02:02:07 | FromDiscord | <Elegantbeef> Turns out reference based compilers are not fast |
02:05:30 | FromDiscord | <xflywind> I think incRef in the compiler hotpot can be probably optimized since I can turn them into cursor/ptr. |
02:06:13 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995148842951520287/unknown.png |
02:06:48 | FromDiscord | <Elegantbeef> Also what's the program you're compiling? |
02:06:55 | FromDiscord | <Elegantbeef> And this is with a orc booted Nim compiler? |
02:07:12 | FromDiscord | <xflywind> orc booted compiler to compile the Nim compiler |
02:07:20 | FromDiscord | <xflywind> (edit) "orc booted compiler to compile the Nim compiler ... " added "using orc" |
02:07:23 | FromDiscord | <Elegantbeef> Ah ok that's what i imagined |
02:07:42 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995149216081002606/unknown.png |
02:09:59 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420H |
02:10:08 | FromDiscord | <enthus1ast> i might be to tired but these (257,292ms) are 0.2 seconds orāµ(@xflywind) |
02:10:08 | FromDiscord | <Elegantbeef> `var T` |
02:10:19 | FromDiscord | <Elegantbeef> `thing: var MyType` |
02:10:36 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/995149826301890570): i might be to tired but these (257,292ms) are 0.2 seconds or 257 seconds? |
02:10:39 | FromDiscord | <sOkam!> var links as a reference? |
02:10:53 | FromDiscord | <xflywind> In reply to @enthus1ast "[Edit](https://discord.com/channels/371759389889003": 0.2 seconds |
02:11:00 | FromDiscord | <Luckayla> It's a point. 257 point 292 ms |
02:11:02 | FromDiscord | <Elegantbeef> `var T` is a mutable reference |
02:11:18 | FromDiscord | <sOkam!> ic |
02:11:33 | FromDiscord | <enthus1ast> points are thousends (in germany)āµ(@Luckayla) |
02:12:04 | FromDiscord | <Elegantbeef> Decimal comma vs decimal point |
02:12:05 | FromDiscord | <Elegantbeef> Always a lovely chat |
02:12:17 | FromDiscord | <enthus1ast> how long does the compilation takes overall @xflywind |
02:12:37 | FromDiscord | <Elegantbeef> thought germans were all about efficiency odd that they use decimal commas |
02:12:42 | FromDiscord | <enthus1ast> ask that excel |
02:13:08 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995150583021457509/unknown.png |
02:13:44 | FromDiscord | <Elegantbeef> This reminds me https://erikmcclure.com/blog/windows-malloc-implementation-is-a-trash-fire/ is a fun writeup |
02:13:48 | FromDiscord | <xflywind> 38.3% of 17.741s |
02:14:30 | FromDiscord | <xflywind> Probably I should try -d:useMalloc |
02:15:11 | FromDiscord | <Elegantbeef> Also is this without a cache? |
02:15:37 | FromDiscord | <Elegantbeef> I imagine not since 20s is fucking fast |
02:15:39 | FromDiscord | <xflywind> It is a partial compilation I changed something |
02:15:49 | FromDiscord | <xflywind> (edit) "It is a partial compilation I changed something ... " added "in compiler." |
02:15:52 | FromDiscord | <Elegantbeef> Ok so there we go |
02:15:54 | FromDiscord | <Elegantbeef> The Nim compiler doesnt have to do much |
02:16:11 | FromDiscord | <Elegantbeef> It'd take forever but if you passed `-f` you'd see drastically different data |
02:16:26 | FromDiscord | <Elegantbeef> Actually representative of the slowdowns |
02:16:33 | FromDiscord | <xflywind> 40s for a full compilation and occupy 10% |
02:16:50 | FromDiscord | <Elegantbeef> Jesus 40s, way to insult my poor CPU |
02:16:51 | FromDiscord | <xflywind> 7s for a recompilation |
02:32:21 | FromDiscord | <huantian> In reply to @Elegantbeef "This reminds me https://erikmcclure.com/blog/window": Bunny |
02:37:28 | FromDiscord | <xflywind> In reply to @flywind "": Optimized |
02:37:37 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=420J |
02:38:28 | FromDiscord | <xflywind> original version |
02:38:36 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=420L |
02:38:55 | FromDiscord | <xflywind> (edit) "https://play.nim-lang.org/#ix=420J" => "https://play.nim-lang.org/#ix=420N" |
02:42:06 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=420P |
02:42:24 | FromDiscord | <Elegantbeef> Using integer manually |
02:42:40 | FromDiscord | <sOkam!> i mean |
02:42:49 | FromDiscord | <sOkam!> the point is to NOT use integers, why would I make this list otherwise |
02:42:58 | FromDiscord | <Elegantbeef> atleast to me `mat[A]` is way less descriptive than `mat[0].x` |
02:43:08 | FromDiscord | <Elegantbeef> `mat[A, X]` |
02:43:59 | FromDiscord | <sOkam!> missing the point. I was asking for a way to declare multiple constants in a compact way |
02:44:10 | FromDiscord | <Elegantbeef> There is no compact way |
02:44:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=420Q |
02:44:59 | FromDiscord | <Elegantbeef> That's the most compact you can do |
02:46:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=420R |
02:53:19 | FromDiscord | <xflywind> It seems to allocate lots of memroy here. |
02:53:22 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995160704497766451/unknown.png |
02:54:41 | FromDiscord | <xflywind> (edit) "lots of memroy" => "too much time" |
02:54:54 | FromDiscord | <xflywind> (edit) "much time" => "many times" |
02:57:47 | FromDiscord | <xflywind> let me try the larger start size. |
03:04:25 | FromDiscord | <Rika> In reply to @huantian "Bunny": bnuuy |
03:40:26 | FromDiscord | <Space Ghost> Does anyone know how to turn on a switch when compiling to show timings, i.e. how long it took to compile, maybe with some details, etc.? |
03:41:01 | FromDiscord | <enthus1ast> you could have a look at benchy |
03:41:02 | FromDiscord | <Elegantbeef> Default Nim shows time |
03:41:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4215 |
03:41:52 | FromDiscord | <Space Ghost> I am in an embedded terminal I will try it from the command line, thank you. |
03:42:56 | FromDiscord | <Elegantbeef> I dont know how an embedded terminal changes that but, yea it's there |
03:44:02 | FromDiscord | <Space Ghost> In reply to @Elegantbeef "I dont know how": You are both right, i am wrong, it is there and I simply missed it. Thank you. |
03:45:01 | FromDiscord | <Elegantbeef> If you want to benchmark runtime code both `timeit` and `benchy` exist |
03:45:16 | FromDiscord | <Elegantbeef> Not apart of the stdlib but are in the nimble registry |
03:48:11 | FromDiscord | <Space Ghost> In reply to @Elegantbeef "Not apart of the": Thank you. |
03:54:14 | * | arkurious quit (Quit: Leaving) |
03:57:17 | FromDiscord | <ripluke> Does nim have a āmascotā |
03:57:32 | FromDiscord | <Rika> No |
03:57:35 | FromDiscord | <Rika> Technically no |
03:57:40 | FromDiscord | <ripluke> Oh |
03:57:44 | FromDiscord | <Rika> Thereās the badger |
03:57:53 | FromDiscord | <Rika> :nimRawr: |
03:58:00 | FromDiscord | <ripluke> Oh |
03:58:11 | FromDiscord | <ripluke> Does it have a name |
03:58:59 | FromDiscord | <Elegantbeef> I like to think it's not named like a pet but with a title that it earned. "The last thing you see" is the title I imagine its earned. |
03:59:46 | FromDiscord | <ripluke> Um that's kinda ominous lol |
03:59:50 | * | bigbyt quit (Read error: Connection reset by peer) |
04:00:11 | FromDiscord | <Elegantbeef> Have you seen the fucking badger? |
04:00:22 | FromDiscord | <ripluke> They're kinda tiny |
04:00:32 | FromDiscord | <Elegantbeef> The thing looks like it kidnaps kids from the playground and eats it for lunch |
04:00:34 | FromDiscord | <ripluke> Compared to a lion or something |
04:00:40 | * | bigbyt joined #nim |
04:00:45 | FromDiscord | <huantian> lion + crown seems cool |
04:00:46 | FromDiscord | <ripluke> In reply to @Elegantbeef "The thing looks like": Well maybe they eat kids |
04:00:49 | FromDiscord | <huantian> but might be a bit pretentous |
04:00:53 | FromDiscord | <Elegantbeef> https://user-images.githubusercontent.com/1189414/94371104-5090e900-00ca-11eb-8e5b-d229504b1435.png |
04:01:00 | FromDiscord | <Elegantbeef> Full image |
04:01:19 | FromDiscord | <ripluke> In reply to @Elegantbeef "https://user-images.githubusercontent.com/1189414/9": It bears a striking resemblance to your profile picture š |
04:01:35 | FromDiscord | <Elegantbeef> Nah my dog would never do that |
04:01:49 | FromDiscord | <ripluke> That's a dog? |
04:01:57 | FromDiscord | <ripluke> I thought it was a rodent š |
04:01:59 | FromDiscord | <huantian> ripluke blind confirmed |
04:02:04 | FromDiscord | <ripluke> I'm not a biologist |
04:02:09 | FromDiscord | <Elegantbeef> Jeezus |
04:02:28 | FromDiscord | <ripluke> Well now that you mention it it does look a bit like a dog |
04:02:32 | FromDiscord | <huantian> how do you not knwo what a dog looks liek w |
04:02:55 | FromDiscord | <ripluke> In reply to @Elegantbeef "Nah my dog would": Which part? The children eating or the crown wearing |
04:03:30 | FromDiscord | <ripluke> In reply to @huantian "how do you not": Yea lol I have a dog |
04:05:07 | FromDiscord | <zhmtzhmt> why ? |
04:05:07 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=4219 |
04:05:34 | FromDiscord | <zhmtzhmt> they are in different folders. |
04:07:10 | FromDiscord | <Yardanico> you need to use `as` to import the other |
04:07:18 | FromDiscord | <Yardanico> because otherwise you'll have ambiguous module symbols |
04:07:33 | FromDiscord | <Yardanico> Nim allows one to use symbols from a module as `modulename.proc()`, so in your case that'll lead to ambiguity |
04:07:52 | FromDiscord | <zhmtzhmt> I see |
04:08:07 | FromDiscord | <zhmtzhmt> Thank you very much. |
05:23:20 | FromDiscord | <ripluke> Is there a Bluetooth library for nim? |
05:23:49 | FromDiscord | <Elegantbeef> nimble.directory does exist |
05:23:52 | FromDiscord | <Elegantbeef> https://github.com/Electric-Blue/NimBluez |
05:25:30 | FromDiscord | <ripluke> In reply to @Elegantbeef "nimble.directory does exist": Ik I'm there now |
05:26:02 | FromDiscord | <ripluke> In reply to @Elegantbeef "https://github.com/Electric-Blue/NimBluez": Linux only? |
05:26:13 | FromDiscord | <ripluke> It seems to use bluez |
05:26:22 | FromDiscord | <Elegantbeef> > You can find wrappers for BlueZ in nimbluez/bluez folder. For Microsoft Bluetooth protocol stack wrappers look at nimbluez/msbt. |
05:26:32 | FromDiscord | <ripluke> Ok |
05:26:43 | FromDiscord | <Elegantbeef> It has highlevel wrappings for those APIs |
05:26:51 | FromDiscord | <Elegantbeef> If you need anything else you can manually do it |
05:27:01 | FromDiscord | <ripluke> In reply to @Elegantbeef "It has highlevel wrappings": Pretty much all I'll need |
05:28:44 | * | rockcavera quit (Remote host closed the connection) |
05:57:19 | FromDiscord | <ripluke> In reply to @Elegantbeef "https://github.com/Electric-Blue/NimBluez": Lol the main feature I need doesn't work .-. |
05:57:37 | FromDiscord | <Elegantbeef> That is? |
05:57:44 | FromDiscord | <ripluke> I'll have to do some jury rigging with Bluetoothctl |
05:57:53 | FromDiscord | <ripluke> In reply to @Elegantbeef "That is?": Device discovery |
05:57:56 | FromDiscord | <Elegantbeef> "jury rigging" |
05:58:01 | FromDiscord | <ripluke> Yea |
05:58:06 | FromDiscord | <ripluke> With execCmd |
05:58:10 | FromDiscord | <Elegantbeef> Isnt it "jerry rigging" |
05:58:21 | FromDiscord | <Elegantbeef> What doesnt work? |
05:58:37 | FromDiscord | <ripluke> In reply to @Elegantbeef "Isnt it "jerry rigging"": Yea |
05:58:53 | FromDiscord | <ripluke> In reply to @Elegantbeef "What doesnt work?": It can't detect any device |
05:59:21 | FromDiscord | <ripluke> And I know there's many in range because blueberry can detect 3-4 |
06:00:20 | FromDiscord | <ripluke> The maintainer doesn't seem active |
06:00:25 | FromDiscord | <ripluke> For a few years |
06:03:40 | * | sagax quit (Remote host closed the connection) |
06:05:16 | FromDiscord | <Elegantbeef> I have to get my dongle setup but you'll be hearing from me |
06:07:00 | FromDiscord | <huantian> Hey beef howās that template unexpanding error pr thingy going |
06:07:13 | FromDiscord | <Elegantbeef> Not i didnt get a response |
06:07:30 | FromDiscord | <Elegantbeef> Araq said no, i suggest multiple solutions he said "...." |
06:08:05 | FromDiscord | <Elegantbeef> He didnt actually say "..." but he didnt respond |
06:09:15 | FromDiscord | <huantian> Perhaps error messages just arenāt his top priority |
06:10:49 | FromDiscord | <Elegantbeef> I mean there is an issue that it requires changing the AST |
06:10:59 | FromDiscord | <Elegantbeef> Atleast afaict |
06:11:17 | FromDiscord | <Elegantbeef> My solution bloats the Nim runtime by adding another 8 bytes to every single AST node |
06:11:46 | FromDiscord | <huantian> Yeah true |
06:12:23 | FromDiscord | <huantian> What would the proper fix involve? |
06:12:24 | FromDiscord | <Elegantbeef> I tested and with the Nim compiler it only adds another 200mb but it's still there |
06:12:40 | FromDiscord | <huantian> Dang thatās like half a chrome tab |
06:16:39 | * | sagax joined #nim |
06:16:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=421h |
06:17:20 | FromDiscord | <Elegantbeef> It atleast works with my phone, doesnt seem to work with my steam controller which is BLE |
06:24:16 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=421i |
06:25:10 | FromDiscord | <ripluke> How can I split a string for every line? |
06:26:21 | FromDiscord | <Elegantbeef> `splitLines` |
06:28:34 | NimEventer | New post on r/nim by treeform: Discussing Nim 2.0 - Its already here [video]., see https://reddit.com/r/nim/comments/vuvg5t/discussing_nim_20_its_already_here_video/ |
06:29:36 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=421k |
06:29:42 | FromDiscord | <ripluke> what am i doing wrong with this code |
06:30:27 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=421l |
06:30:46 | FromDiscord | <ripluke> no error when compiling tho |
06:30:49 | FromDiscord | <ripluke> (edit) "https://play.nim-lang.org/#ix=421m" => "https://paste.rs/YIt" |
06:31:53 | FromDiscord | <Elegantbeef> It's a runtime error it says the issue is on line 9 |
06:32:11 | FromDiscord | <Elegantbeef> Where do you index on line 9 |
06:33:15 | FromDiscord | <ripluke> im splitting the device string |
06:33:36 | FromDiscord | <Elegantbeef> You then index it |
06:34:18 | FromDiscord | <ripluke> hmm i think the split isnt working |
06:34:25 | FromDiscord | <Elegantbeef> ... |
06:35:06 | FromDiscord | <ripluke> i wonder why tho |
06:35:22 | FromDiscord | <ripluke> there are many spaces in the command output |
06:35:35 | FromDiscord | <Elegantbeef> If only there was a better way |
06:35:41 | FromDiscord | <Elegantbeef> `std/strscans` |
06:35:49 | FromDiscord | <ripluke> oh |
06:36:35 | FromDiscord | <ripluke> its quite confusing |
06:36:47 | FromDiscord | <Elegantbeef> It's like regex but for sane people |
06:36:51 | FromDiscord | <Elegantbeef> What's the string you have? |
06:37:36 | FromDiscord | <ripluke> Device 70:EA:41:69:FC:A7 Jabra Elite 75t |
06:38:18 | FromDiscord | <Elegantbeef> `line.scanf("Device $s$.", myId)` |
06:38:36 | FromDiscord | <ripluke> ah so then it returns s right? |
06:39:02 | FromDiscord | <Elegantbeef> That should be uhh `$+$s$.` and it returns a bool |
06:39:08 | FromDiscord | <Elegantbeef> There are docs you know |
06:39:26 | FromDiscord | <Elegantbeef> It writes the captured id to `myId` |
06:40:01 | FromDiscord | <ripluke> oh |
06:41:51 | FromDiscord | <Prestige> Elegantbeef I didn't see if you answered about the wayland compositor, I think we should work on one together |
06:41:56 | FromDiscord | <Prestige> If you're inclined |
06:42:07 | FromDiscord | <Elegantbeef> I am but we need wlroots and libwayland wrapped |
06:42:13 | FromDiscord | <Elegantbeef> futhark screwed the pooch on that one |
06:42:20 | FromDiscord | <ripluke> In reply to @Elegantbeef "It writes the captured": it did an awesome job š āµ@["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""] |
06:42:46 | FromDiscord | <Prestige> hmm are those C libraries? |
06:42:49 | FromDiscord | <ripluke> time to rtfm |
06:42:58 | FromDiscord | <Prestige> Could try to manually wrap them I suppose |
06:43:00 | FromDiscord | <Elegantbeef> Yes those are C libraries |
06:43:07 | FromDiscord | <Elegantbeef> I mean j-james has wlroots wrapped |
06:43:14 | FromDiscord | <Prestige> oh |
06:43:19 | FromDiscord | <Elegantbeef> libwayland isnt yet we talked about it in offtopic earlier today |
06:43:34 | FromDiscord | <Elegantbeef> Also for your matrix woes checkout the cinny matrix client |
06:44:05 | FromDiscord | <Prestige> hm that looks a lot better |
06:44:57 | FromDiscord | <Prestige> Futhark fails to wrap libwayland, have you talked to pmunch about it? |
06:45:33 | FromDiscord | <Elegantbeef> Nah he's on vaca |
06:46:16 | FromDiscord | <Elegantbeef> Seems you can just do `"Device $+ "` |
06:46:30 | FromDiscord | <Elegantbeef> Well it does wrap both libraries but they're written in some horrid code |
06:46:50 | FromDiscord | <Prestige> interesting |
06:47:15 | FromDiscord | <Avahe> This matrix client is pretty nice |
06:48:16 | FromDiscord | <ripluke> In reply to @Elegantbeef "Seems you can just": ah yes thats good |
07:14:38 | FromDiscord | <tylerlinuxdev> Would be nice if they introduce C language library for Matrix chat. |
07:15:36 | FromDiscord | <tylerlinuxdev> That would help accelerate the usability of Matrix chat by a lot by making it so just about every programming language could bind to it and then everyone could create their own Matrix Client or bot. |
07:17:38 | FromDiscord | <tylerlinuxdev> Would be nice to have native chat, well I guess Thunderbird counts as one on version 102 |
07:38:02 | FromDiscord | <d4rckh> im making some sort of http redirector/proxy (https://github.com/d4rckh/http-redirector). i have an issue where sometimes some requests to the website i want to proxy not get resolved |
07:38:09 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/995232374147272835/unknown.png |
07:38:56 | FromDiscord | <d4rckh> and the original request wont resolve too, because i am not getting the response from example.org https://media.discordapp.net/attachments/371759389889003532/995232572579782656/unknown.png |
07:39:09 | FromDiscord | <d4rckh> this will load forever |
07:40:46 | FromDiscord | <d4rckh> this only happens 1/3 of the time |
07:44:40 | FromDiscord | <Elegantbeef> I'm not overly proficient but it's mostly just web requests and encryption |
07:45:25 | FromDiscord | <tylerlinuxdev> It's a bit more involved than that especially on the cryptography aspect. |
07:45:47 | FromDiscord | <tylerlinuxdev> As programming goes, cryptography is the most difficult to get right. |
07:46:10 | FromDiscord | <Elegantbeef> I do want to eventually make my own matrix client but ugh the list of things is larger |
07:46:38 | FromDiscord | <Elegantbeef> Avahe are you using the web or desktop client? |
07:46:53 | FromDiscord | <Elegantbeef> Atleast i assume you're still on matrix |
07:47:15 | FromDiscord | <tylerlinuxdev> Going to try opening up thunderbird 102 to see how it goes |
07:48:19 | * | ggsx joined #nim |
07:48:55 | FromDiscord | <Prestige> In reply to @Elegantbeef "Avahe are you using": I was using the desktop client |
07:49:09 | FromDiscord | <Elegantbeef> Ah it's not electron based if you didnt see |
07:49:14 | FromDiscord | <Prestige> I hate that the ui completely locks up if it is loading messages though |
07:49:29 | FromDiscord | <Prestige> element does it too |
07:49:36 | FromDiscord | <tylerlinuxdev> Yeah, sometime element have a problem with the mouse flickering and UI freezing up |
07:49:43 | FromDiscord | <tylerlinuxdev> I had to kill it and restart it |
07:50:07 | FromDiscord | <Elegantbeef> Maybe one day a client will be made that i dont mind contributing to š |
07:52:24 | FromDiscord | <tylerlinuxdev> If I finish STL-C, I could look into C++ implementation of Matrix chat and see if I can transpose it |
07:52:45 | FromDiscord | <tylerlinuxdev> (STL-C is basically C++ STL ported to C with support for both Thread-safe data container and non-thread safe IE concurrentqueue and whatnot.) |
07:53:55 | FromDiscord | <tylerlinuxdev> Just tried Thunderbird Beta for Matrix Chat, it works, but pretty... slow... just UI freezing up a lot when you switch chat. |
07:54:13 | FromDiscord | <Prestige> Elegantbeef even if we did it in Nim, I don't know what UI framework I would like to use |
07:54:17 | FromDiscord | <tylerlinuxdev> And the conversation list is unorganized |
07:54:21 | FromDiscord | <Prestige> I hear bad things about all of them, lol |
07:54:52 | FromDiscord | <Elegantbeef> Gtk is what i'm partial t o |
07:55:09 | FromDiscord | <d4rckh> In reply to @d4rckh "this only happens 1/3": looks like it gets stuck at `await response.body` |
07:55:09 | FromDiscord | <tylerlinuxdev> @Prestige\: Lol, funny thing I was working on creating new GUI Toolkit to replace GTK and QT, basically C library that uses Vulkan acceleration by default |
07:55:21 | FromDiscord | <Elegantbeef> Or wxwidgets |
07:55:28 | FromDiscord | <Elegantbeef> The down side is that it's not "fancy" |
07:55:42 | FromDiscord | <Prestige> I know/knew a guy that was working on his own UI framework but I haven't spoken to him in a while. Called neogfx |
07:55:51 | FromDiscord | <Prestige> https://neogfx.org/ |
07:55:55 | FromDiscord | <Prestige> but it's c++ so I'll disregard it |
07:57:11 | FromDiscord | <tylerlinuxdev> Ah, basically I originally try to work on replacing Wayland entirely, but realized that it's a massive PITA if I have to fight with QT and GTK to add support for new replacement for Wayland |
07:57:14 | FromDiscord | <Elegantbeef> GUI is just shit in general |
07:57:42 | FromDiscord | <tylerlinuxdev> So it basically become the chicken and the egg problem |
07:57:55 | FromDiscord | <tylerlinuxdev> You need GUI Toolkit first to have something to work with on your new replacement for X11 and Wayland |
07:58:32 | FromDiscord | <tylerlinuxdev> Funny thing is... Wayland whined about how they can't get Nvidia GPU to work |
07:58:33 | FromDiscord | <tylerlinuxdev> I was able to |
07:58:53 | FromDiscord | <Prestige> š¤ |
07:59:43 | FromDiscord | <Prestige> So my smart light switch is able to be controlled by wifi, but it's not open source it seems. I found a python library that can control it, but is super buggy and half the commands don't work |
08:00:19 | FromDiscord | <Prestige> Been trying to copy the very basic command to send a request for the status of the switch but I think I'm misinterpreting what the python code is doing. I hate python |
08:01:12 | FromDiscord | <tylerlinuxdev> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: Because they keep repeating the same mistake of trying to force GUI to fit within a tiny box that doesn't offer any flexibility or creativity and because they often don't write the GUI Toolkit library in C in the first place basically limiting the library to be ONLY be usable in the language it's written in like QT. |
08:01:28 | FromDiscord | <tylerlinuxdev> (I can almost guaranteed that you'll never see C binding for QT that is complete.) |
08:02:12 | FromDiscord | <tylerlinuxdev> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/995238178086727704): [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: Because they keep repeating the same mistake of trying to force GUI to fit within a tiny box that doesn't offer any flexibility or creativity and because they often don't write the GUI Toolkit library in C in the first place basically limiting the library to ONLY be usable in t |
08:03:11 | FromDiscord | <Elegantbeef> Well yea |
08:03:29 | FromDiscord | <Elegantbeef> QT is really unusable outside of C++, which is why it's not overly attractive |
08:03:42 | FromDiscord | <Elegantbeef> i mean QML and it's designer does exist |
08:03:50 | FromDiscord | <tylerlinuxdev> Yeah, but extensibility is gone |
08:04:08 | FromDiscord | <Elegantbeef> GTK is just more attractive as it can be used 1\:1 as it's source language if you really need to |
08:04:24 | FromDiscord | <Elegantbeef> It's not really writing it in C in the first place it's that it's as usable as the source |
08:04:50 | FromDiscord | <tylerlinuxdev> The biggest problem with GTK is how they break ABI regularly, I maintain a database of all libraries symbols, GTK top that list. |
08:05:33 | FromDiscord | <tylerlinuxdev> (Basically `objdump -T` all of the libraries and parse it into PostgreSQL for any changed symbols and have that script hooked into pacman install hook) |
08:07:27 | * | ggsx quit (Quit: Client closed) |
08:07:40 | * | ggsx joined #nim |
08:08:47 | FromDiscord | <Elegantbeef> But but it runs the web \:Pāµ(@Prestige) |
08:09:09 | FromDiscord | <tylerlinuxdev> It honestly not a surprise that we're seeing new apps for Linux just in a web browser, because they just go, "Ah F\\\ it" |
08:09:32 | FromDiscord | <Prestige> Python runs the web? eh |
08:09:39 | FromDiscord | <Elegantbeef> Well it's down to that web apps are relatively painless cross platform and allow nice looking gui |
08:09:40 | FromDiscord | <Prestige> I still think it's a crap language |
08:09:52 | FromDiscord | <Elegantbeef> It can but i'm just joking |
08:10:04 | FromDiscord | <Phil> Even if gtk was the most convenient toolkit on the planet, pwa and electron would still win |
08:10:06 | FromDiscord | <Elegantbeef> Nice looking gtk on windows is a feat afaik |
08:10:20 | FromDiscord | <Phil> Basically no effort is hard to beat |
08:10:38 | FromDiscord | <Elegantbeef> Yea but luckily we're talking about making our client |
08:10:44 | FromDiscord | <Elegantbeef> So we can say "fuck you mr. web man" |
08:11:23 | FromDiscord | <tylerlinuxdev> Only that you have to stick with javascript which sucks for electron, you might squeak by with webasm, but I don't think it support DOM manipulation yet... after decade... |
08:11:38 | FromDiscord | <Phil> Fair. I was playing around with the idea of a Linux native matrix client. But the feature set would be so much effort |
08:11:44 | FromDiscord | <Elegantbeef> I think gtk is nice if you have a decalrative GUI, though i havent played with glad + gintro |
08:11:55 | FromDiscord | <Phil> In reply to @tylerlinuxdev "Only that you have": Angular makes it pretty ready |
08:11:59 | FromDiscord | <Phil> Easy |
08:12:05 | * | matt_13377 quit (Ping timeout: 255 seconds) |
08:12:08 | FromDiscord | <Elegantbeef> I mean there are a group of us here that are interested in a matrix client |
08:12:19 | FromDiscord | <Elegantbeef> Enthus, Prestige, Me, You, .... |
08:12:20 | FromDiscord | <tylerlinuxdev> Isn't Angular a dead framework? |
08:12:34 | FromDiscord | <Phil> Not really |
08:12:43 | FromDiscord | <tylerlinuxdev> image.png https://media.discordapp.net/attachments/371759389889003532/995241077353234442/image.png |
08:12:45 | FromDiscord | <tylerlinuxdev> https://killedbygoogle.com/ |
08:13:03 | FromDiscord | <Phil> Angularjs is the first iteration |
08:13:08 | FromDiscord | <tylerlinuxdev> Ah |
08:13:28 | FromDiscord | <Prestige> I'd rather work on a wayland compositor tbh Elegantbeef |
08:13:32 | FromDiscord | <Phil> That is dead, yes, that's also the reason why angularjs and angular are 2 very different things |
08:14:01 | FromDiscord | <tylerlinuxdev> Haven't kept up with web dev in a while, I quit programming professionally and switch career to IT admin with RHCA certification basically |
08:14:02 | FromDiscord | <Elegantbeef> I mean same prestige |
08:14:02 | FromDiscord | <Elegantbeef> But there is some desire so hey it's not hard to imagine more would contribute |
08:14:06 | FromDiscord | <Phil> The API changes between versions were so drastic that they basically said to start from scratch |
08:15:05 | FromDiscord | <Phil> It's why react has such a much larger market share. The companies that bought into angularjs at the start haven't been that forgiving |
08:16:02 | FromDiscord | <tylerlinuxdev> Yeah, just oof... thanks god I am out of Webdev |
08:16:17 | FromDiscord | <Phil> It's been solid since though and that was like 7 years ago or sth. Very stable and complete every since and a very different approach to react |
08:17:34 | FromDiscord | <Phil> It's fairly good through enforced usage of rxjs and typescript.āµThe routing it uses, like all other front-end routing I've seen so far, is batshit insane though |
08:18:32 | FromDiscord | <Phil> Django did it right and sane. No idea what the guys that settled on the routing paradigms where smoking |
08:18:52 | FromDiscord | <tylerlinuxdev> I looked over Reactjs, apparently it still require hundred of dependencies. |
08:19:49 | FromDiscord | <Phil> Never worked with react, glanced over some routing examples and saw the same stuff that made me cringe in angular |
08:20:15 | FromDiscord | <tylerlinuxdev> Yeah, honestly just happy not to deal with web anymore... wow |
08:20:22 | * | matt_13377 joined #nim |
08:21:24 | FromDiscord | <Prestige> I've used react a lot for work, it's.. not great |
08:21:33 | FromDiscord | <Prestige> but maybe the "best" js front end framework we have |
08:22:07 | FromDiscord | <Prestige> Typescript makes js almost bearable |
08:22:13 | FromDiscord | <tylerlinuxdev> Back then, i just do Bootstrap + JQuery, because I don't want to bother dealing with 1000+ javascript modules |
08:22:17 | FromDiscord | <Phil> I think it's fine. I would need to write a gui with gtk etc. To compare but what I've seen seems somewhat more difficult to work with.āµThough chances are that's me being used to typescript and rxjs |
08:22:54 | FromDiscord | <Phil> I wayyyy preferred angular for choice precisely because it is opinionated |
08:23:32 | FromDiscord | <Prestige> Isn't treeform working on Fidget 2? |
08:23:40 | FromDiscord | <Phil> Enforced typescript and rxjs, routing out of the box, enforced project structure, pre supplied ways of defining service workers etc |
08:23:42 | FromDiscord | <Prestige> or was that some weird fever dream I had |
08:25:59 | FromDiscord | <tylerlinuxdev> It's a bit interesting that Electron takes about 68 MB at min whereas my GUI Toolkit for the same thing uses about 4 MB at most |
08:26:17 | FromDiscord | <Prestige> interesting is a good word for it |
08:30:30 | FromDiscord | <xflywind> There is tauri aiming to replace electron which planned Nim backend. |
08:30:32 | FromDiscord | <xflywind> https://media.discordapp.net/attachments/371759389889003532/995245560103698432/unknown.png |
08:31:00 | FromDiscord | <Prestige> Sounds interesting |
08:35:13 | FromDiscord | <untoreh> sent a code paste, see https://play.nim-lang.org/#ix=421C |
08:36:06 | FromDiscord | <xflywind> unique id for each symbol |
08:36:26 | FromDiscord | <tylerlinuxdev> Yeah, that mangled name for symbol in C++ |
08:38:57 | FromDiscord | <tylerlinuxdev> And it sometime used to uniquely version the library API |
08:40:38 | * | kenran joined #nim |
08:51:00 | FromDiscord | <d4rckh> how do i convert an Uri object to an actual string i can plug in an url? |
08:51:20 | FromDiscord | <d4rckh> `fmt"https://example.org{magicFunction(myUri)}"` |
09:01:27 | * | kenran quit (Quit: WeeChat info:version) |
09:09:24 | FromDiscord | <tylerlinuxdev> `combine(parseUri("https://example.org"), magicFunction(myUri))` is how you usually do it and you can treat uri object as a string |
09:09:44 | FromDiscord | <tylerlinuxdev> image.png https://media.discordapp.net/attachments/371759389889003532/995255422674018375/image.png |
09:09:57 | FromDiscord | <Elegantbeef> He isāµ(@Prestige) |
09:10:08 | FromDiscord | <Elegantbeef> Turns out making GUI is a very very slow process |
09:10:27 | FromDiscord | <tylerlinuxdev> Yup |
09:10:35 | FromDiscord | <Prestige> Very tedious |
09:10:36 | FromDiscord | <tylerlinuxdev> If you can cheat or save time, use all of them |
09:11:01 | FromDiscord | <Elegantbeef> But i mean fidget/nimx are also both options |
09:11:17 | FromDiscord | <Elegantbeef> If we're still talking about a hypothetical nim matrix client |
09:12:03 | FromDiscord | <tylerlinuxdev> Yeah |
09:12:28 | * | ggsx quit (Ping timeout: 252 seconds) |
09:13:01 | FromDiscord | <Prestige> Yep |
09:13:05 | FromDiscord | <Elegantbeef> Fidget can hit a nice medium of good looking gui and sane render pipeline |
09:13:06 | FromDiscord | <Prestige> I'd much rather do it all in Nim |
09:13:45 | madprops | i saw there's an orm now |
09:13:59 | madprops | https://github.com/moigagoo/norm |
09:13:59 | FromDiscord | <Elegantbeef> Say what you will about web tech but clients written in GTK/QT dont look great |
09:15:19 | madprops | i made this in python using a tk library https://i.imgur.com/6G3HGYb.jpg |
09:15:48 | madprops | library is very limited though |
09:15:55 | madprops | can't add/remove widgets dynamically |
09:16:03 | madprops | you're supposed to redraw the whole thing again |
09:16:08 | madprops | it's a known issue |
09:17:50 | FromDiscord | <tylerlinuxdev> sent a long message, see https://paste.rs/Vi6 |
09:18:10 | * | hc0re quit (Ping timeout: 240 seconds) |
09:18:12 | FromDiscord | <tylerlinuxdev> What I try to differentiate on is doing it in vulkan |
09:18:24 | FromDiscord | <Elegantbeef> Yea and i mean fidget does tick some of those boxes |
09:18:32 | FromDiscord | <tylerlinuxdev> Yeah |
09:20:02 | FromDiscord | <tylerlinuxdev> Like "XDrawLine" |
09:20:49 | FromDiscord | <tylerlinuxdev> (GTK uses Cairo for rendering, similar, but better optimized than X11) |
09:25:43 | FromDiscord | <tylerlinuxdev> The problem with CPU based rendering is basically that CPU sucks at that kind of job by raising CPU utilization and thus more electricity/heat being generated. It limit the ability of GUI Toolkit to enable animation, that largely why Web Browsers like Chrome use Skia that utilize GPU. |
09:27:10 | FromDiscord | <tylerlinuxdev> sent a long message, see http://ix.io/421T |
09:28:10 | FromDiscord | <Elegantbeef> I mean Pixie was written in Nim but you can use it from python/C/... \:D |
09:28:54 | FromDiscord | <tylerlinuxdev> Interesting |
09:29:06 | FromDiscord | <tylerlinuxdev> Rely on OpenGL however |
09:29:19 | FromDiscord | <tylerlinuxdev> The problem falls into OpenGL territory where each driver can have different results in how it looks |
09:29:34 | FromDiscord | <tylerlinuxdev> That why I opted for Vulkan, so the looks is consistent across all platforms |
09:29:53 | FromDiscord | <Elegantbeef> Pixie is a skia like library |
09:30:04 | FromDiscord | <tylerlinuxdev> Pixie utilize Boxy which uses OpenGL |
09:30:05 | FromDiscord | <Elegantbeef> Pixie is a cpu drawing library |
09:30:11 | FromDiscord | <tylerlinuxdev> image.png https://media.discordapp.net/attachments/371759389889003532/995260566333571112/image.png |
09:30:18 | FromDiscord | <Elegantbeef> "on top of" |
09:30:23 | FromDiscord | <Elegantbeef> Reading before speaking is a virtue |
09:30:33 | FromDiscord | <Elegantbeef> Pixie is a standalone drawing library |
09:30:35 | FromDiscord | <tylerlinuxdev> I'm tired and it's literally 3\:32 AM here |
09:30:41 | FromDiscord | <Elegantbeef> No it's that time here |
09:30:51 | FromDiscord | <tylerlinuxdev> ? |
09:30:57 | FromDiscord | <Elegantbeef> We're in the same timezone |
09:30:59 | FromDiscord | <tylerlinuxdev> Ah |
09:31:28 | FromDiscord | <Elegantbeef> Fidget does use opengl though |
09:31:40 | FromDiscord | <Elegantbeef> But we were not talking about that there |
09:35:15 | FromDiscord | <Elegantbeef> Suffice to say there arent amazing GUI solutions in Native Nim or as libraries |
09:35:34 | FromDiscord | <tylerlinuxdev> Yeah, Fidget seems pretty bareback and looks to be a starting point |
09:35:43 | FromDiscord | <tylerlinuxdev> I'm looking over code |
09:36:16 | FromDiscord | <Elegantbeef> Well have fun i'm going to sleep |
09:36:22 | FromDiscord | <tylerlinuxdev> Good night |
10:02:24 | * | jmdaemon quit (Ping timeout: 276 seconds) |
10:11:19 | * | hc0re joined #nim |
10:27:37 | * | pro joined #nim |
10:37:28 | * | pro quit (Quit: pro) |
10:45:42 | FromDiscord | <Phil> In reply to @madprops "https://github.com/moigagoo/norm": It's alright. I use it in my project, though I have an abstraction layer on top of it since I don't fully agree with a design choice in there |
10:45:54 | FromDiscord | <Phil> I guess I should also disclaim that I contribute to it |
10:46:09 | FromDiscord | <Phil> (edit) "In reply to @madprops "https://github.com/moigagoo/norm": It's alright. I use it in my project, though I have an abstraction layer on top of it since I don't fully agree with a design choice in there ... " added "about how the API looks" |
10:46:43 | FromDiscord | <Phil> In reply to @Elegantbeef "Say what you will": I wonder in terms of effort which is easier to work with |
10:47:30 | FromDiscord | <Phil> Not even meant sarcastically, I hear that web is comparatively trivial, but I've got no experience to back that up |
10:52:13 | FromDiscord | <tylerlinuxdev> Probably QT if you're going for native rather than web, you could largely get away with it by using QT Designer program and design your GUI and then add some C-language declaration for getter/setter functions for various items in your GUI and then you route the events over a list of function pointers that C language side have to initialize GUI with by providing it's own list of functions that would process the events. |
10:52:46 | FromDiscord | <tylerlinuxdev> But yeah, as far as difficulty goes, web is still easier than doing it in GTK and QT which is why it remains popular on Linux |
10:55:11 | FromDiscord | <Phil> Given that the JS engine isn't even all that slow compared to native, I'm not surprised then |
10:56:45 | madprops | i don't fully agree |
10:56:59 | FromDiscord | <dom96> I can only speak to GTK when I say: stay away. Honestly Electron/CEF is fast enough for 99% of people and if I were to ever create a GUI app I would use either of those. |
10:57:01 | madprops | unless you have a js library with pre-made widgets ready to use |
10:57:36 | madprops | electron is pretty bad though |
10:57:37 | FromDiscord | <dom96> Also the fact that React Native is a thing and is so popular speaks volumes for the web's versatility. |
10:57:39 | FromDiscord | <Phil> CEF? |
10:57:42 | FromDiscord | <Prestige> Really sad to hear because of how slow and resource heavy electron is |
10:57:56 | FromDiscord | <dom96> In reply to @Isofruit "CEF?": https://github.com/chromiumembedded/cef |
10:58:36 | FromDiscord | <Prestige> I thought react native actually uses native rendering |
10:58:56 | FromDiscord | <dom96> In reply to @Avahe "Really sad to hear": it's not too bad https://media.discordapp.net/attachments/371759389889003532/995282901455347753/unknown.png |
10:59:12 | FromDiscord | <Rika> That looks pretty bad given what discord does |
10:59:28 | FromDiscord | <Prestige> Agreed |
10:59:59 | FromDiscord | <dom96> and yet it's only 1.5% of my total RAM |
11:00:01 | FromDiscord | <Prestige> Slow programs and websites have become normalized, it's sad |
11:00:19 | FromDiscord | <dom96> In reply to @Avahe "I thought react native": depends what you mean by "native rendering" |
11:00:40 | FromDiscord | <Prestige> sent a code paste, see https://play.nim-lang.org/#ix=422e |
11:00:48 | FromDiscord | <dom96> there is still a JS engine in there |
11:02:03 | FromDiscord | <dom96> but yeah, I suppose at least it's not relying on webkit |
11:02:42 | FromDiscord | <Prestige> I think the rendering side of things is usually the problem when people complain about js |
11:03:47 | FromDiscord | <Prestige> My current company's code base has a ton of redundant/unnecessary things the code does, shit is slow. Makes using our web app a pain |
11:04:12 | FromDiscord | <Prestige> But that seems to have become the norm since we have so much RAM |
11:04:36 | FromDiscord | <Prestige> Nobody profiles js |
11:05:47 | FromDiscord | <dom96> That's not true |
11:06:17 | FromDiscord | <dom96> The majority likely doesn't care about performance so they don't profile |
11:06:29 | FromDiscord | <dom96> but JS has some of the best tools for profiling it too |
11:06:58 | FromDiscord | <enthus1ast> i profile by using old af hardware |
11:07:19 | FromDiscord | <Prestige> Yeah it has great tooling, my point is just that people don't usually bother profiling web apps |
11:07:21 | FromDiscord | <Phil> I can see the point of insisting on native. Even in the best cases, JS engines are still factor 2-3 slower than C (though significantly faster than python ironically) |
11:07:33 | FromDiscord | <Phil> And that translates into battery life, which users do care about |
11:07:59 | FromDiscord | <Phil> Particularly since most computation devices in use by end users are battery powered nowadays |
11:08:23 | FromDiscord | <Phil> But the fact that the tooling for using native is anywhere near as attractive in terms of productivity is... painful |
11:09:07 | FromDiscord | <dom96> I'd like to see some data on energy usage of a native app vs. Electron. |
11:09:09 | FromDiscord | <Prestige> Through profiling I found out our nodejs server spends more than half it's runtime calling a lodash function that translates snake case to camel case. Quite funny |
11:09:26 | FromDiscord | <dom96> Without data it's all speculation whether it's worth putting up with the pain of native |
11:10:09 | FromDiscord | <Prestige> You'd really have create two apps with the same design/features but yeah |
11:10:30 | FromDiscord | <Prestige> It the very least I think it's safe wo to assume ram usage would be lower |
11:10:36 | FromDiscord | <Prestige> (edit) removed "wo" |
11:11:16 | FromDiscord | <Prestige> Typing on touch screens is such a PITA |
11:30:04 | * | hc0re quit (Ping timeout: 244 seconds) |
11:39:11 | FromDiscord | <Rika> In reply to @Elegantbeef "This reminds me https://erikmcclure.com/blog/window": I was wondering why I recognised that name |
11:39:53 | FromDiscord | <Rika> He made that discord bot with the interesting anti spam (in the sense of actual āspammingā and not unwanted messages) |
12:03:14 | FromDiscord | <Phil> > LLVM was built for Linux - or rather, it was built to work for Mac OSX, which is POSIX compliant and looks like a Linux system if you squintāµBeef did promise it was fun |
12:03:41 | FromDiscord | <Phil> Thanks for replying to that message Rika! I would have missed that article otherwise |
12:07:34 | FromDiscord | <Phil> > So this entire time I've been trying to replace Microsoft's malloc() with Microsoft's other malloc() because Microsoft's malloc() was too slow for Microsoft. āµHooo boy |
12:07:53 | FromDiscord | <Phil> I can't claim I understand 100%, but it most certainly is entertaining |
12:26:23 | FromDiscord | <retkid> so Channels are blocking and never returning |
12:26:54 | FromDiscord | <retkid> well, receiving |
12:26:58 | FromDiscord | <retkid> i forgot how to fix this |
13:20:48 | FromDiscord | <retkid> In reply to @Elegantbeef "This reminds me https://erikmcclure.com/blog/window": in recent news: āµwindows is badāµup next:āµMost cats don't like baths |
13:22:56 | FromDiscord | <enthus1ast> Windows might be bad, but it's the best when you just want to get things working |
13:23:41 | FromDiscord | <retkid> when you're not programming for it |
13:23:52 | FromDiscord | <retkid> the "its just works" is built upon the backs of dead programmers |
13:23:53 | FromDiscord | <enthus1ast> How many hours did I fight linux when I want to get older (scientific) software working... its ridiculous |
13:24:12 | FromDiscord | <retkid> ha |
13:24:16 | FromDiscord | <retkid> yea |
13:24:29 | FromDiscord | <retkid> best solution is get a ubuntu from just before the last release |
13:24:56 | FromDiscord | <retkid> then strace it and find all the api calls |
13:25:25 | FromDiscord | <enthus1ast> Linux has a massive compatibility issue with their software |
13:25:28 | FromDiscord | <retkid> steal the libraries and package them together |
13:25:53 | FromDiscord | <retkid> the linux ethos currently assumes you either package your libs with the software or you are updating it |
13:26:06 | FromDiscord | <retkid> or people are keeping old functions |
13:26:09 | FromDiscord | <enthus1ast> Have a app that needs older tcl/tk? You basically fucked |
13:26:40 | FromDiscord | <retkid> good thing about nim is its pretty portable |
13:26:52 | FromDiscord | <retkid> static packaging of depends |
13:27:18 | FromDiscord | <enthus1ast> So Like windows does it? š |
13:28:00 | FromDiscord | <retkid> no |
13:28:04 | FromDiscord | <retkid> windows has dynamic libs |
13:28:06 | FromDiscord | <retkid> floating around |
13:28:15 | FromDiscord | <retkid> they also have issues |
13:28:30 | FromDiscord | <retkid> its just, it has a central authority to make sure things work |
13:28:41 | FromDiscord | <retkid> linux supposes "eh they're smart enough to figure it out" |
13:37:35 | FromDiscord | <TryAngle> what are good alternatives from Rust's Mutex and Arc for Nim? |
13:37:54 | FromDiscord | <TryAngle> just losing locks and DIY? |
13:40:44 | FromDiscord | <Josef> Is it possible to define offsets of fields of Nim type? |
13:41:05 | FromDiscord | <Josef> (edit) "Is it possible to define ... offsets" added "byte" |
13:41:12 | FromDiscord | <enthus1ast> Don't get me wrong I do not praise windows, but it's on top of my personal, "get things done, and do other stuff, like drinking" listāµ(@retkid) |
13:41:43 | FromDiscord | <retkid> do both drinking and programming |
13:41:53 | FromDiscord | <retkid> its the only time im happy when i code |
13:43:02 | FromDiscord | <enthus1ast> 2. On this list is macos ( I hate it )āµ3. A typewriterāµ4...n\: bsd |
13:44:18 | FromDiscord | <enthus1ast> 3. Should be linux mhhh |
13:45:04 | FromDiscord | <retkid> >a typewriter\ |
13:45:04 | FromDiscord | <retkid> (edit) "typewriter\" => "typewriter" |
13:45:30 | FromDiscord | <retkid> start writing your code on a typewriter and scan it in |
13:53:40 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/423a |
13:55:09 | FromDiscord | <enthus1ast> I should create an "enthus1ast daily rants" channel and not pollute the nim one |
14:08:24 | FromDiscord | <retkid> no i was just trying to remember what to n meant |
14:08:29 | FromDiscord | <retkid> i think its infinitum |
14:10:11 | FromDiscord | <retkid> do i need to stringify to write to a file with msgpack |
14:10:47 | FromDiscord | <retkid> i think its just pack as a var |
14:11:00 | FromDiscord | <retkid> yea |
14:14:00 | FromDiscord | <David> Hey is C2nim still the way to go for wrapping C code or is there a way to directly import C headers nowadays? |
14:17:27 | FromDiscord | <hotdog> In reply to @David "Hey is C2nim still": Check out futhark |
14:17:48 | FromDiscord | <hotdog> https://github.com/PMunch/futhark |
14:19:06 | FromDiscord | <David> Well this looks useful, thanks! |
14:19:42 | FromDiscord | <hotdog> No prob š |
14:21:36 | FromDiscord | <David> One more question, is there a commonly used library for making CLIs? |
14:22:07 | FromDiscord | <planetis> In reply to @TryAngle "what are good alternatives": std/locks and planetis-m/sync has some more |
14:23:16 | FromDiscord | <Yardanico> In reply to @David "One more question, is": cligen, argparse, docopt, etc |
14:23:37 | FromDiscord | <enthus1ast> Eg cligen , or tui like\: illwill |
14:24:01 | FromDiscord | <David> Thanks everyone! |
14:24:07 | FromDiscord | <planetis> In reply to @David "One more question, is": There are many but checkout illwill and nimwave |
14:25:58 | FromDiscord | <David> Hmm does discord support Threads like Matrix or Slack? Iām curious if the bots between the two support that functionality. |
14:30:07 | * | def- quit (Quit: -) |
14:31:51 | FromDiscord | <aru-hackZ> discord has threads yes |
14:31:54 | FromDiscord | <retkid> if I just... copy a variables memory and save it |
14:32:04 | FromDiscord | <retkid> can i cast it to that variable |
14:33:23 | FromDiscord | <retkid> or would i have to build a parser |
14:35:40 | FromDiscord | <hotdog> In reply to @retkid "can i cast it": If you mean cast to the type of the variable then yes |
14:35:48 | FromDiscord | <David> So if I start a thread in Matrix does it make a thread on your side?āµ(@aru-hackZ) |
14:36:34 | FromDiscord | <retkid> In reply to @hotdog "If you mean cast": So i can be like "00FF00" (probably in character form) then just be like "Oh yea, thats an array" @hotdog |
14:36:57 | FromDiscord | <retkid> and if it checks out, it'll just do it |
14:38:06 | FromDiscord | <aru-hackZ> In reply to @David "So if I start": if the bridge supports it |
14:38:18 | FromDiscord | <hotdog> Pretty much as long as the format is correct else youāll get errors when reading it back |
14:38:26 | FromDiscord | <hotdog> @retkid |
14:38:32 | FromDiscord | <hotdog> What are you trying to do? |
14:38:39 | FromDiscord | <retkid> then what is the function for this |
14:38:40 | FromDiscord | <aru-hackZ> also you need to have permissions to create a thread, which seems I don't have |
14:39:03 | FromDiscord | <retkid> In reply to @hotdog "What are you trying": trying to pack things quickly without care for file sizes |
14:39:15 | FromDiscord | <retkid> i just need more data throughput no matter the volume |
14:39:38 | FromDiscord | <retkid> while msgpack is pretty fast its just, still an extra 14 secs on a thread |
14:39:54 | * | arkurious joined #nim |
14:40:03 | FromDiscord | <Rika> In reply to @David "So if I start": the bridge doesnt support it |
14:40:04 | FromDiscord | <Rika> i believe |
14:41:31 | FromDiscord | <David> Hmm it most not, since I created a thread on my side and i can only guess it showed up as a normal message for you |
14:44:23 | FromDiscord | <aru-hackZ> not even that |
14:47:47 | * | def- joined #nim |
15:01:00 | FromDiscord | <TryAngle> In reply to @planetis "std/locks and planetis-m/sync has": RwLock looks good, can be used as a drop in replacement for mutexes right? I have no idea tbh |
15:01:25 | FromDiscord | <TryAngle> ah nvm mutex blocks on read too š¤ |
15:01:30 | FromDiscord | <retkid> i probably cant do what i was imagineing |
15:01:34 | FromDiscord | <retkid> asd |
15:01:38 | FromDiscord | <retkid> (edit) "asd" => "sad" |
15:02:12 | FromDiscord | <planetis> In reply to @TryAngle "ah nvm mutex blocks": Mutex is just a lock |
15:02:26 | FromDiscord | <planetis> So use std/locks for that |
15:02:34 | FromDiscord | <retkid> maybe i can asm this |
15:02:36 | FromDiscord | <retkid> famous last words |
15:02:48 | FromDiscord | <TryAngle> In reply to @planetis "Mutex is just a": ah true š¤ āµbut with lock u can implement Mutex and RwLock no? |
15:03:17 | FromDiscord | <planetis> Yeah |
15:05:23 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/omk |
15:07:04 | FromDiscord | <TryAngle> idk tbh, I'm newbie to threading :c |
15:07:17 | FromDiscord | <Rika> arc isnt atomic |
15:07:32 | FromDiscord | <TryAngle> it's probably not needed in nim š¤ |
15:07:39 | FromDiscord | <planetis> No that wouldn't work you need to share the counter |
15:07:50 | FromDiscord | <Rika> isnt that what nim does |
15:08:43 | FromDiscord | <planetis> there is threading/smartptrs |
15:08:52 | FromDiscord | <TryAngle> ah true count also has to be ref |
15:08:55 | FromDiscord | <planetis> Arc = SharedPte |
15:09:01 | FromDiscord | <planetis> (edit) "SharedPte" => "SharedPtr" |
15:09:09 | FromDiscord | <treeform> In reply to @ajusa "Has anyone used vmath's": I mainly added swizzling because GLSL has it. But now I use it all the time. 3d to 2d conversation, vec4 color conversations, normal to tangent, there are many uses. |
15:16:09 | FromDiscord | <Bloss> Is the current development version 1.8 or 2.0? |
15:20:07 | FromDiscord | <xflywind> The next big release is 2.0, 1.8 is probably skipped. |
15:20:30 | FromDiscord | <xflywind> (edit) "probably" => "most likely" |
15:26:54 | FromDiscord | <Bloss> Cool, there are some small fixes in the development branch that I might need, was just wondering if I should wait to use it, I'll just use it now |
15:27:45 | FromDiscord | <Prestige> Do we know if IC is planned for 2.0 still? |
15:36:04 | FromDiscord | <Bloss> I would assume so |
15:37:47 | FromDiscord | <Bloss> Normal big versions take upwards of 9 months to release, I would expect 2.0 to take even longer |
15:39:01 | FromDiscord | <ajusa> In reply to @treeform "I mainly added swizzling": Thanks for clarifying! |
15:39:17 | FromDiscord | <Bloss> 1.0 to 1.2 and 1.2 to 1.4 both took around 6 months, 1.4 to 1.6 took a full year |
15:40:38 | FromDiscord | <untoreh> is there a way to rewrite an iterator to use async functions inside it? |
15:41:30 | FromDiscord | <Rika> i dont understand what you intend |
15:42:28 | FromDiscord | <Luckayla> How big are the changes coming in 2.0? |
15:42:39 | FromDiscord | <Luckayla> Seems I entered the language at a weird time |
15:43:06 | FromDiscord | <untoreh> sent a code paste, see https://paste.rs/Mrp |
15:45:21 | FromDiscord | <Prestige> People have been discussing what they want to see come with 2.0 but I don't know what is actually planned |
15:46:22 | FromDiscord | <Rika> i dont think you can await in an iterator at all so |
15:46:40 | FromDiscord | <Rika> nim doesnt have async for |
15:49:25 | FromDiscord | <Prestige> Maybe you could rewrite it to use a template |
15:50:46 | FromDiscord | <xflywind> In reply to @Avahe "Do we know if": It is for 2.x or later |
15:51:42 | FromDiscord | <Prestige> Have been really looking forward to IC for better editor support |
15:52:45 | FromDiscord | <xflywind> In reply to @Luckayla "How big are the": defaults to threads, orc and improvements planned by https://github.com/nim-lang/RFCs/issues/437 |
15:56:18 | FromDiscord | <laker31> sent a long message, see http://ix.io/423K |
15:59:11 | FromDiscord | <Prestige> I think you can set LD_LIBRARY_PATH to that directory |
15:59:17 | FromDiscord | <aru-hackZ> add this flags: `--dynlibOverride:SDL2 --passL:"/opt/homebrew/cellar/sdl2/2.0.22/lib"` |
15:59:33 | FromDiscord | <aru-hackZ> (edit) "--passL:"/opt/homebrew/cellar/sdl2/2.0.22/lib"`" => "--passL:"/opt/homebrew/cellar/sdl2/2.0.22/lib/libSDL2.dylib"`" |
15:59:48 | FromDiscord | <aru-hackZ> (edit) "this" => "these" |
16:01:03 | FromDiscord | <aru-hackZ> I also had a problem like that since I'm using NixOS and need to pass some library paths that way, works fine for me |
16:02:33 | FromDiscord | <aru-hackZ> https://nim-lang.org/docs/nimc.html#dynliboverride https://media.discordapp.net/attachments/371759389889003532/995359309250703442/unknown.png |
16:12:14 | FromDiscord | <laker31> Thanks! For some reason adding it to `LD_LIBRARY_PATH` does not work (and that env variable does not have any value to start with - is that normal?), but adding the `--dynlibOverride` flag did it! |
16:32:19 | FromDiscord | <aru-hackZ> yh I tried adding it to `LD_LIBRARY_PATH` and didn't work |
16:36:27 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=423Y |
17:52:14 | FromDiscord | <Phil> I believe this might be because I haven't done much low level coding. So as I understand it you want to manipulate the array in a proc and have that change also apply to the array outside the proc? āµāµI assume the actual array is very large which is why you don't want the array to be copied ? |
17:53:06 | FromDiscord | <Phil> (edit) "coding." => "coding, but I'm having troubles wrapping my head around this." |
17:53:32 | FromDiscord | <Phil> (edit) "I believe this might be because I haven't done much low level coding, but I'm having troubles wrapping my head around this. So as I understand it you want to manipulate the array in a proc and have that change also apply to the array outside the proc? āµāµI assume the actual array is very large which is why you don't want the array to be copied ... ?" added "/ a manipulated version of the array to be returned by the proc" |
18:04:40 | * | krux02 quit (Remote host closed the connection) |
18:23:35 | FromDiscord | <Goel> Yes thats the reason i dont want/need to copy it. Anyway i can't came up with another alternative idea so i'll just use that way of using addr and then dereference |
18:23:53 | FromDiscord | <Goel> (edit) "thats" => "that's" | "reason i dont" => "reason. I don't" |
18:24:31 | FromDiscord | <huantian> You should use ref objects ondtrsd of address but you still need to deref |
18:26:51 | * | vicecea quit (Remote host closed the connection) |
18:27:20 | * | vicecea joined #nim |
18:33:55 | * | pro joined #nim |
18:35:34 | FromDiscord | <Phil> Can you actually do ref type arrays? |
18:36:28 | FromDiscord | <huantian> You should be able to |
18:41:03 | FromDiscord | <Goel> What do you mean "ref type arrays"? And how can i do it? |
18:42:33 | FromDiscord | <Phil> Ah, so are you aware of differences between ref types and value types? |
18:44:03 | FromDiscord | <fwsgonzo> I'm trying to figure out how to take in 2GB of [pointer, length] from C into Nim without copying data around |
18:44:05 | FromDiscord | <fwsgonzo> https://github.com/nim-lang/Nim/issues/8256 |
18:44:27 | FromDiscord | <fwsgonzo> What is the status on this? Is the openArray approach realistic? does it give me access to the full language and standard library? |
18:44:58 | FromDiscord | <fwsgonzo> I basically need a std::span or std::string_view |
18:49:16 | FromDiscord | <Phil> In reply to @huantian "You should be able": So I figured out that "ref array" is a valid type. How to initialize that though is beyond me |
18:58:25 | FromDiscord | <huantian> `let something = new array[int, 4]` should work |
18:58:52 | FromDiscord | <huantian> (edit) "array[int, 4]`" => "array[4, int]`" |
19:04:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=424s |
19:05:04 | FromDiscord | <Phil> In reply to @huantian "`let something = new": Yep, that did it. Swapped to a separate type though |
19:22:14 | * | pro quit (Quit: pro) |
19:29:07 | FromDiscord | <!Patitotective> sooo guys im trying to add asynchronous support for GET requests in downit (asynchronous downloads manager) but for some reason the response's body is incompleteāµhttps://github.com/Patitotective/downit/blob/devel/downit.nim#L180āµsince `AsyncResponse.body` is of type `Future[string]` i have to check if that future is finishes as well, right? |
19:29:42 | FromDiscord | <!Patitotective> (run tests to see the problem https://github.com/Patitotective/downit/blob/devel/tests/test.nim) |
19:31:04 | FromDiscord | <huantian> uh are you using a different client for each asyncronous request? |
19:31:12 | FromDiscord | <!Patitotective> yes |
19:31:51 | FromDiscord | <Alea> Is there a guide to seriously optimizing nim programs? |
19:32:09 | FromDiscord | <!Patitotective> In reply to @huantian "uh are you using": is that dumb? should i use the same for all? |
19:32:31 | FromDiscord | <huantian> no don't use the same for all |
19:34:23 | FromDiscord | <!Patitotective> also i dont get why `AsyncResponse.body` is `Future[string]` instead of just `string`āµsince you always get `Future[AsyncResponse]` shouldn't the request succeed as the body? |
19:34:50 | FromDiscord | <huantian> body is a string tho |
19:34:55 | FromDiscord | <huantian> https://media.discordapp.net/attachments/371759389889003532/995412756138311760/unknown.png |
19:35:04 | FromDiscord | <Alea> Oh I've seen this one before, they do it so you can get headers if something fails iirc? |
19:35:25 | FromDiscord | <!Patitotective> In reply to @huantian "": whaaat |
19:35:27 | FromDiscord | <dom96> the body is a stream so that you can read large bodies without putting it all into memory |
19:35:46 | FromDiscord | <huantian> well FutureStreams are string streams so aren't they all in memory anyways? |
19:36:10 | FromDiscord | <!Patitotective> In reply to @huantian "": someone updatedāµlast week it wasnt like that |
19:36:21 | FromDiscord | <dom96> @!Patitotective I would suggest writing a quick script to `getContent` the URL that's missing part of the body to rule out any httpclient bugs |
19:37:47 | FromDiscord | <dom96> In reply to @huantian "well FutureStreams are string": nope, the body is read in chunks and it should be possible for you to save it to a file in chunks for example |
19:38:35 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/httpclient.nim#L1280 |
19:38:41 | NimEventer | New post on r/nim by rotuami: Record type, see https://reddit.com/r/nim/comments/vv9c4g/record_type/ |
19:39:55 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=424z |
19:41:06 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=424A |
19:41:44 | FromDiscord | <dom96> In reply to @huantian "so if I do": yeah, it shouldn't. Though last time I used it there were bugs which meant that it did :) |
19:41:53 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=424B |
19:42:23 | FromDiscord | <huantian> In reply to @dom96 "yeah, it shouldn't. Though": why does http client use the weird stuff like setting client.bodyStream instead of reading the resp.bodyStream? is it because of said bugs? |
19:42:26 | FromDiscord | <!Patitotective> oh huan i just rememberedāµ`AsyncResponse.body` is not public so i gotta call the `body` proc that returns a futureāµhttps://nim-lang.org/docs/httpclient.html#body%2CAsyncResponse |
19:43:03 | FromDiscord | <dom96> just `waitFor` it |
19:43:35 | FromDiscord | <!Patitotective> why does the response finishes earlier than the body? thats so weird |
19:43:52 | FromDiscord | <!Patitotective> oh, is it because it has to read the stream? |
19:44:59 | FromDiscord | <dom96> yep |
19:45:31 | FromDiscord | <dom96> In reply to @huantian "why does http client": not sure what you mean |
19:45:55 | FromDiscord | <Phil> ... I kinda wish we could use tauri in nim |
19:46:19 | FromDiscord | <Phil> playing around with it looks fun, but writing rust looks still painful |
19:46:38 | FromDiscord | <huantian> `httpclient.downloadFileEx`, isntead of simply doing what I sent, it seems to use `client.bodyStream` instead of `response.bodyStream` |
19:46:39 | FromDiscord | <!Patitotective> anyway domāµim already checking if it finishes here https://github.com/Patitotective/downit/blob/devel/downit.nim#L180 (?)āµ`data.requestFuture.read().body.finished` |
19:47:44 | FromDiscord | <dom96> In reply to @huantian "`httpclient.downloadFileEx`, isntead of simply": don't recall. Could just be a legacy thing |
19:48:59 | FromDiscord | <huantian> my thought was that it doesn't have to write the the response's stream, and can directly write to the file stream |
19:49:20 | FromDiscord | <huantian> but since you mentioned that there's no difference since it stays chunked anyways, I wasn't sure |
19:50:00 | FromDiscord | <dom96> In reply to @Patitotective "anyway dom im already": does doing it in a repro script get you the full body? |
19:50:07 | FromDiscord | <dom96> you still haven't answered that :) |
19:51:01 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=424E |
19:54:32 | FromDiscord | <dom96> hm, okay, so where do you actually read the body stream in your downit code? |
19:55:10 | FromDiscord | <!Patitotective> here https://github.com/Patitotective/downit/blob/devel/downit.nim#L105āµand im checking if it finished there as well |
19:58:22 | FromDiscord | <dom96> I don't see anything obviously wrong I'm afraid |
19:58:52 | FromDiscord | <!Patitotective> :/ |
19:59:21 | FromDiscord | <dom96> Don't be afraid to insert `echo`'s into httpclient and see what's going on there |
20:08:59 | FromDiscord | <enthus1ast> Pdo as much as possible during compiletime, avoid allocations, avoid string split, branch as less as you could, compile with -d\:danger -d\:ltoāµ(@Alea) |
20:09:35 | FromDiscord | <enthus1ast> Benchmark with eg benchy |
20:11:07 | FromDiscord | <huantian> yes for string stuff you wanna use stuff like parseutils instead of splitting |
20:33:34 | FromDiscord | <kevin> @treeform got a question about `puppy` |
20:33:59 | FromDiscord | <kevin> It's very possible I just don't know what I'm doing but I submitted an issue on what I think is a bug in puppy |
20:34:04 | FromDiscord | <kevin> https://github.com/treeform/puppy/issues/76 |
20:44:49 | FromDiscord | <treeform> In reply to @kevin "It's very possible I": It's not an issue we have run into. We will take a look. |
20:45:11 | FromDiscord | <treeform> Does this happen with arc? |
20:45:42 | FromDiscord | <kevin> I guess I have not tried alternate gc's. I am using whatever the default is (i think refc) |
20:47:04 | FromDiscord | <kevin> OK I just tried `--gc:arc` and it still has the same issue |
21:10:12 | * | hc0re joined #nim |
21:11:39 | * | hc0re quit (Remote host closed the connection) |
21:18:32 | FromDiscord | <treeform> ok |
21:18:46 | FromDiscord | <treeform> we will figure it out |
21:40:32 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
21:41:21 | * | ehmry joined #nim |
22:08:20 | * | noeontheend joined #nim |
23:12:20 | * | jmdaemon joined #nim |
23:28:10 | FromDiscord | <ynfle> !eval echo 8 / 9 |
23:28:14 | NimBot | 0.8888888888888888 |
23:28:21 | FromDiscord | <ynfle> Why doesn't it round? |
23:28:38 | FromDiscord | <Elegantbeef> What? |
23:28:47 | FromDiscord | <Elegantbeef> `8 / 9` is float division |
23:28:57 | FromDiscord | <Elegantbeef> `8 div 9` is euclidean division |
23:44:43 | FromDiscord | <ynfle> Shouldn't it be 0.8888888888888889? |
23:46:27 | FromDiscord | <Elegantbeef> Is it culling signfiicant digits or showing all digits inside the float? |
23:47:17 | FromDiscord | <huantian> I don't think when you do float math you round |
23:47:18 | FromDiscord | <huantian> always truncate |
23:49:42 | FromDiscord | <huantian> actually I have no idea how ieee 754 works I learn it then forget it a few seconds because it doesn't matter |
23:49:52 | FromDiscord | <ynfle> !eval echo 0.8888888888888888āµ+ 0.00000000000000001 |
23:49:55 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: invalid token: no whitespace between number and identifier |
23:50:12 | FromDiscord | <ynfle> !eval echo 0.8888888888888888āµ+ 0.00000000000000001 |
23:50:14 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: invalid token: no whitespace between number and identifier |
23:50:33 | FromDiscord | <ynfle> !eval echo 0.8888888888888888āµ + 0.00000000000000001 |
23:50:35 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: invalid token: no whitespace between number and identifier |
23:50:46 | FromDiscord | <huantian> !eval echo 0.8888888888888888 + 0.00000000000000001 |
23:50:50 | NimBot | 0.8888888888888888 |
23:51:12 | FromDiscord | <ynfle> In reply to @Elegantbeef "Is it culling signfiicant": Culling |
23:51:29 | FromDiscord | <huantian> In reply to @NimBot "0.8888888888888888": is this not to be expected? |
23:51:59 | FromDiscord | <ynfle> š¤·āāļø I'd assume not, but not sure |
23:52:28 | FromDiscord | <Elegantbeef> It's floats |
23:53:00 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=42Dg |
23:53:00 | FromDiscord | <Elegantbeef> Turns out floating point impercision is real |
23:53:08 | FromDiscord | <Elegantbeef> If you care about the accuracy of numbers you dont use floats |
23:53:52 | FromDiscord | <ynfle> That's not what I did |
23:53:59 | FromDiscord | <ynfle> I added 1 on to the end |
23:54:05 | FromDiscord | <ynfle> Not to the last 8 |
23:54:26 | FromDiscord | <huantian> maybe you should just use like <http://weitz.de/ieee/> |
23:54:33 | FromDiscord | <huantian> to visualize your calculations |
23:55:06 | FromDiscord | <ynfle> This has nothing to do with calculations, but with printing |
23:55:54 | FromDiscord | <Elegantbeef> Did you look at my code? |
23:56:11 | FromDiscord | <Elegantbeef> Your example doesnt exist as a floating point number |
23:57:59 | FromDiscord | <Elegantbeef> !eval echo 0.1f32 + 0.2f32 |
23:58:03 | NimBot | 0.300000011920929 |
23:58:25 | FromDiscord | <Elegantbeef> Well shucks |
23:58:43 | FromDiscord | <Elegantbeef> Expect the printed float to be the value that is held and not the exact number you gave |