00:00:01 | FromDiscord | <Gyllou> sry for pic spam |
00:00:11 | FromDiscord | <nikki> yo i didn't realize nim had a documentation website |
00:00:37 | FromDiscord | <Gyllou> are you being facetious? |
00:00:45 | FromDiscord | <nikki> yeah sorry lol i'm in friday silly mode |
00:00:50 | PMunch | @InventorMatt, well that's not good. But I think you might just be running into byte ordering |
00:01:04 | FromDiscord | <nikki> it happens between 3pm and 2am on fridays |
00:01:16 | FromDiscord | <Gyllou> lol kk i know im a nim noob just trying to link for that guy asking |
00:01:25 | FromDiscord | <Gyllou> metoo, im slightly drunk too |
00:01:39 | FromDiscord | <nikki> oh no hard feelings at all. it's great that this community is generally kinda nice and helpful to each other |
00:01:49 | FromDiscord | <nikki> that's one thing that i immediately felt when i got on this discord |
00:01:57 | PMunch | Binaryparse is strictly big endian IIRC |
00:02:04 | FromDiscord | <Gyllou> friday is my paper reading day so i usually get tired of that and start drinking wine at like 3pm |
00:02:13 | disruptek | i feel like we could totally smoke the competition with a proper graph library. |
00:02:16 | FromDiscord | <nikki> newspaper or like academic papers |
00:02:25 | FromDiscord | <Gyllou> i agree disruptek |
00:02:28 | FromDiscord | <Gyllou> academic papers |
00:02:32 | disruptek | like, it's not hard to make really fast code in nim. we have the right level of abstraction for it. |
00:02:39 | FromDiscord | <InventorMatt> PMunch, when I do a manual approach to check it I am able to get the right result. I wonder what I may be doing wrong with your lib then |
00:02:43 | FromDiscord | <Gyllou> im aiming for totem level performance but thats a long way off |
00:02:54 | FromDiscord | <nikki> http://shape-of-code.coding-guidelines.com/2020/11/08/evidence-based-software-engineering-book-released/ this thing was posted on the webz recently if u want sth to read |
00:02:57 | PMunch | Cheers Gyllou, I'm sitting here sipping a drink :) |
00:03:12 | FromDiscord | <Gyllou> its friday ya'll, gotsta |
00:03:12 | disruptek | its been a few years since i did graph stuff but it's central to my startup, so i am down to do some heavy lifting. |
00:03:20 | FromDiscord | <nikki> yeah i think nim can make anything as fast as you want. like there are no limits. bc you can literally generate or compile against whatever |
00:03:29 | FromDiscord | <nikki> and the normal code you write just is good |
00:03:43 | FromDiscord | <nikki> like what it generates to |
00:03:56 | disruptek | i am counting on cps for threading the algos. |
00:03:57 | FromDiscord | <nikki> except some times when i iterate through hash tables and it copies the entries out 😐 |
00:04:03 | FromDiscord | <Gyllou> yea its very nice to change it up |
00:04:07 | FromDiscord | <nikki> i wish it just was a compile error to copy anything |
00:04:11 | planetis[m] | Hes dtg |
00:04:15 | disruptek | i mean, it can be. |
00:04:19 | planetis[m] | Down to graph |
00:04:46 | FromDiscord | <Gyllou> we have a speech module called phonographica we built in python, i'd love to port it over one day as well |
00:04:56 | disruptek | skiplists is >2.5x faster under arc. just a cli switch and boom. |
00:05:39 | FromGitter | <jrfondren> for my part I'm replacing various Rust and D utilities with Nim. It's very satisfying. |
00:05:50 | disruptek | what kinda utilities? |
00:05:52 | FromDiscord | <nikki> i think the right way to do that is to keep writing macros until you can just compile the python code you wrote; with nim |
00:05:54 | FromDiscord | <Gyllou> i have no desire to write an audio package for nim though. port audio is miserable to work with too |
00:05:59 | PMunch | InevntorMatt, could you try to call one of the `swapEndian` procedures from here on your number? https://nim-lang.org/docs/lib.html |
00:06:07 | PMunch | Woops, wrong link: https://nim-lang.org/docs/endians.html |
00:06:10 | FromDiscord | <nikki> for audio for the game i'm thinking about using soloud |
00:06:16 | FromDiscord | <nikki> mostly cuz i want it to work out of the box in emscripten too |
00:06:24 | * | sagax quit (Ping timeout: 260 seconds) |
00:07:18 | FromGitter | <jrfondren> CGI scripts, log mungers, some small UDP and TCP servers. nothing too big of a deal. |
00:08:20 | FromDiscord | <Gyllou> i might look at soloud, but even still the main dependencies are a TF type lib and deepspeech interface |
00:08:41 | FromDiscord | <Gyllou> though come to think of it i vaguely remember some deepspeech nim package, idk |
00:09:39 | FromGitter | <jrfondren> https://github.com/jrfondren/chrestomathy/tree/master/pwcheck is actually one of them |
00:12:57 | FromDiscord | <InventorMatt> Pmunch: what would I put for the other pointer? also while iterating through the tuple it gives me I am able to echo the values correctly and calling type on them works but any other function called on them and it points back to the tuple itself not the value |
00:14:08 | PMunch | Hmm, do you have an example of your code? |
00:15:28 | * | astronavt quit (Remote host closed the connection) |
00:16:00 | PMunch | Depends on what you want for how to use endians |
00:16:12 | * | astronavt___ joined #nim |
00:16:31 | PMunch | Here's an example: https://play.nim-lang.org/#ix=2E4r |
00:16:44 | FromDiscord | <InventorMatt> yes, I do. i have the full everything in the github issue but here is the code https://play.nim-lang.org/#ix=2E4q |
00:19:21 | PMunch | And the problem is? |
00:19:30 | PMunch | Hard to tell without knowing the content of that file |
00:20:44 | FromDiscord | <InventorMatt> https://figshare.com/articles/dataset/NEON_Teaching_Data_LiDAR_Point_Cloud_las_Data/4307750 |
00:20:49 | FromDiscord | <InventorMatt> here is the file |
00:21:06 | FromDiscord | <InventorMatt> https://www.asprs.org/wp-content/uploads/2010/12/LAS_1_4_r13.pdf here is the spec |
00:21:43 | FromDiscord | <InventorMatt> the id parameter should be 101 but instead i am getting 25856 |
00:22:06 | PMunch | Yeah, that's big vs. little endian |
00:22:39 | PMunch | From that spec you linked: [A note on Bit Fields – The LAS storage format is “Little Endian.” This means that multi-byte data fields are stored in memory from least significant byte at the low address to most significant byte at the high address. |
00:23:03 | mipri | !eval echo (0x6500, 0x0065) |
00:23:06 | NimBot | (25856, 101) |
00:23:07 | PMunch | And binaryparse is Big Endian, meaning you need to swap the endianess of any field with more than one byte |
00:23:40 | FromDiscord | <InventorMatt> is there a way to change that for the parser or will just have to iterate through the result and do the swap there? |
00:24:04 | PMunch | You just need to do it whenever you use the fields |
00:24:17 | PMunch | Well, you could define your own parser that does it automatically |
00:25:46 | FromDiscord | <InventorMatt> okay, thanks for the help. |
00:25:52 | PMunch | No problem |
00:26:19 | PMunch | I was thinking of adding byte ordering to binaryparse, but I remember I had a reason that made me not do it.. |
00:26:48 | * | astronavt___ is now known as astronavt |
00:27:10 | FromDiscord | <InventorMatt> so it won't be seen as a feature in the future then? |
00:27:12 | FromDiscord | <Avatarfighter> Yo yo yo everyone how is everyone 😄 |
00:27:12 | mipri | you thought that virtually all portable formats are big endian anyway? |
00:27:13 | disruptek | improper byte ordering can yield indigestion; it was probably that. |
00:27:37 | PMunch | mipri, might've been :P |
00:27:51 | PMunch | But I remember i wanted to add support for it |
00:28:03 | mipri | the swapEndian* API might also have been harder to apply than libc ntohs/ntohl functions |
00:28:14 | PMunch | There is even procedures implemented for reading/writing the different endians |
00:28:50 | PMunch | InventorMatt, I might add it, but if you want to add it feel free :) |
00:29:06 | PMunch | I have no specific plans for adding it, but I agree that it would be useful |
00:30:07 | FromDiscord | <InventorMatt> i'll look through the code more and see how simply it could be done. it is a pretty dense macro in there so I don't know much i would want to mess with that |
00:30:46 | PMunch | Haha, yeah it's not the prettiest code.. |
00:31:25 | * | astronavt quit (Remote host closed the connection) |
00:32:41 | mipri | https://play.nim-lang.org/#ix=2E4u |
00:32:45 | FromDiscord | <InventorMatt> is it in the getinfo where the endianeness would be or could point me to the main proc for this part of it? |
00:34:29 | PMunch | Oh wow, this is even worse than I remember.. |
00:35:42 | FromDiscord | <VideoCarp> does Nim have any GUI packages other than IUP bindings? |
00:36:13 | mipri | nimble search gui |
00:36:43 | FromDiscord | <VideoCarp> will try that |
00:37:22 | PMunch | InventorMatt, basically you want to add something to the format that allows you to specify endianess |
00:37:41 | FromDiscord | <VideoCarp> ah great thanks.↵is `nimble` basically the package manager? |
00:37:46 | mipri | yes |
00:38:38 | mipri | I haven't done any GUI stuff in Nim but looking around, nimqml looks interesting. |
00:38:42 | PMunch | Then you need to check info.size in createReadStatement and createWriteStatement and if it is a power of two and it was supposed to be the opposite endianess then use the other readData(LE|BE) function |
00:38:54 | PMunch | Some for writeData(LE|BE) |
00:39:11 | PMunch | wxnim also works fine @VideoCarp |
00:39:20 | PMunch | Has a neat little DSL as well |
00:40:00 | mipri | that's not in nimble search though :/ |
00:40:15 | FromDiscord | <InventorMatt> I'll look into doing that and see what can be done, thank PMunch |
00:40:56 | PMunch | No problem |
00:41:35 | FromDiscord | <shadow.> anyone know how to use winim? |
00:41:46 | FromDiscord | <shadow.> GetCursorPos is returning 0 every call |
00:41:49 | PMunch | Huh, I guess the original wxNim package might predate Nimble |
00:41:51 | PMunch | I'll add it |
00:43:53 | FromDiscord | <shadow.> nvm its bc i needed a POINT not an LPPOINT |
00:47:34 | PMunch | Hmm, I'll add it tomorrow |
00:47:37 | PMunch | It's getting late here |
00:55:48 | FromDiscord | <Daniel> sent a code paste, see https://play.nim-lang.org/#ix=2E4C |
00:57:49 | mipri | https://nim-lang.org/docs/assertions.html#assert.t,untyped,string |
00:59:12 | FromDiscord | <Daniel> i already read that, however i am still at basics, did reach to templates yet |
00:59:27 | mipri | then what are you asking? |
00:59:48 | FromDiscord | <Daniel> because i dont understand the explanation written on that link |
00:59:58 | mipri | ask a question about it, then |
01:00:21 | FromDiscord | <Daniel> what is assert used for? |
01:00:47 | PMunch | mipri, that was a discord bot code paste thing, it's a bit weird. But his question is in the "code" |
01:00:49 | mipri | enforcing invariants in debugging or assertion builds. |
01:01:23 | PMunch | Assert will basically quit out of your program if the check is false |
01:01:27 | mipri | https://www.sqlite.org/assert.html talks about assert in general |
01:01:41 | PMunch | An easy way to make sure that some value is something while debugging |
01:02:42 | PMunch | And you will see it quite often in examples because it shows what value is expected, and with Nims ability to check code example from the documentation when it's generated it will make sure the documentation generation fails if something returns the wrong value. |
01:02:48 | FromDiscord | <Daniel> so basicaly its true/false checkpoint i guess |
01:02:51 | mipri | the idea is, when writing something you'll think, "this is only true if X is the case", and you'll promise yourself that you'll make X always the case. Maybe you still have to ensure that elsewhere. Maybe that's definitely the case right now but modifications to the code have to maintain it, so you write a comment to effect of "make sure X is the case!" |
01:03:09 | mipri | and writing an assertion when you have such thoughts is a way of actually ensuring that X is really the case |
01:03:30 | FromDiscord | <shadow.> !eval echo cast[string]([97.byte, 97.byte]) |
01:03:33 | NimBot | Traceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
01:03:37 | FromDiscord | <shadow.> f |
01:03:54 | PMunch | Daniel, yes pretty much |
01:03:59 | mipri | if it isn't, you have a bug, but because you made the assertion you have a quick failure at the point of X not being the case, rather than some potentially horrible behavior later on |
01:04:02 | FromDiscord | <shadow.> !eval var x: array[2, char] = [97, 97]; echo cast[string](x) |
01:04:04 | NimBot | Compile failed: /usercode/in.nim(1, 25) Error: type mismatch: got <array[0..1, int]> but expected 'array[0..1, char]' |
01:04:05 | PMunch | But when compiling with -d:release they will be removed |
01:04:24 | PMunch | If you need them in your release builds use `doAssert` instead |
01:04:27 | FromDiscord | <shadow.> !eval var x: array[2, char] = [97.chr, 97.chr]; echo cast[string](x) |
01:04:29 | NimBot | <no output> |
01:04:32 | mipri | shadow., a string is structurally equivalent to a seq[char], so there's a header, it's not just a bare array |
01:04:37 | FromDiscord | <shadow.> ahh ok |
01:04:49 | FromDiscord | <shadow.> im tryna figure out how to send 2 uint16's as a packet string lol |
01:04:54 | FromDiscord | <shadow.> ill figure it out |
01:05:08 | mipri | what you might find more convenient is casting 0-terminating that and casting it to a cstring, and then .string'ing that |
01:05:15 | FromDiscord | <shadow.> hmm ok |
01:05:33 | FromDiscord | <shadow.> because right now im just sending an array[4, byte] through `net` but i wanna convert to `netty` which only supports strings iirc |
01:05:36 | FromDiscord | <shadow.> (edit) "iirc" => "afaik" |
01:05:39 | PMunch | Use binaryparse :) |
01:05:44 | FromDiscord | <shadow.> smart |
01:06:12 | FromDiscord | <Daniel> thank you guys, i understand much better now....i just wish documentation would have been written more noob friendly :)↵Luckily, you guys are here to help in non-programming terminology 👍 |
01:06:26 | FromDiscord | <shadow.> can i parse a uint16 into a string with that lib lol (the sequence of bytes that make up that uint16) |
01:06:31 | PMunch | Oh by the way InventorMatt, you can use `.read` instead of `[0]` to access the reader part of the parser tuple |
01:07:00 | PMunch | Depends on what you mean "as a string" |
01:07:17 | PMunch | Do you want "100,200" or do you want four characters parsed as a string? |
01:07:24 | FromDiscord | <shadow.> four characters parsed as string |
01:07:29 | FromDiscord | <shadow.> for instance |
01:07:32 | FromDiscord | <shadow.> if x is 1000 |
01:07:50 | FromDiscord | <shadow.> then the string should be "bb" |
01:07:51 | FromDiscord | <shadow.> byte, byte |
01:07:58 | FromDiscord | <shadow.> since yk 2 bytes for a uint16 |
01:08:20 | PMunch | Huh? |
01:08:26 | FromDiscord | <shadow.> and yeah so if its 400, 300 it should be a string of 4 chars |
01:08:34 | mipri | "since you need 2 bytes for a uint16" |
01:08:52 | FromDiscord | <shadow.> ye sorry |
01:09:21 | PMunch | I'm still not sure what you want your string to be |
01:09:29 | FromDiscord | <shadow.> lemme get an example |
01:09:54 | FromDiscord | <shadow.> !eval echo cast[array[2, byte]](1000) |
01:09:57 | NimBot | [232, 3] |
01:10:03 | FromDiscord | <shadow.> the string equivalent of that basically |
01:10:21 | FromDiscord | <shadow.> i was wondering how that would work tho since there isnt an encoding that has yk the full range of 1 byte values afaik |
01:10:29 | PMunch | So chr(232) & chr(3)? |
01:10:32 | FromDiscord | <shadow.> ye basically |
01:10:58 | PMunch | Yeah, that would be a `s: yourField[2]` |
01:11:20 | PMunch | s for string, yourField is the name of, well, your field, and [2] is to read two bytes. |
01:11:28 | Zoom[m] | Eh, can you iterate over table's values with iterutils? |
01:11:31 | FromDiscord | <shadow.> hmm ok thanks lemme try that |
01:11:47 | Zoom[m] | foldl for example |
01:11:56 | PMunch | Zoom[m], what's wrong with `for x in myTable.values`? |
01:12:09 | PMunch | Oh |
01:12:47 | PMunch | I think you should be able to |
01:13:13 | FromDiscord | <shadow.> so if i have variable x which is equal to 1000, how do i get the string value? sorry |
01:13:14 | Zoom[m] | Nothing, it's just nice to read |
01:13:24 | FromDiscord | <shadow.> im a bit confused by the macro lol |
01:13:40 | PMunch | Oh you just have a single variable? |
01:13:59 | FromDiscord | <shadow.> well i have x and y sorry |
01:14:04 | FromDiscord | <shadow.> basically im encoding mouse x and y into a string packet lmao |
01:14:13 | FromDiscord | <shadow.> (edit) "basically im encoding mouse ... x" added "position" |
01:14:15 | PMunch | I thought you wanted to read this out of or into some binary format |
01:14:27 | FromDiscord | <shadow.> well i need to convert the two uint16's into a string form |
01:14:31 | FromDiscord | <shadow.> in binary yeah |
01:14:36 | FromDiscord | <shadow.> not in text form |
01:14:51 | FromDiscord | <shadow.> like you said before, [chr(232), chr(3)] |
01:14:57 | FromDiscord | <shadow.> rather than "1000" |
01:15:14 | PMunch | I mean you could do `cast[cstring](cast[array[4, char](x.uint32 shl 1)[1..^1])` |
01:15:18 | PMunch | Or something like that |
01:15:28 | FromDiscord | <shadow.> ahh thats what i was doing before lol |
01:15:32 | FromDiscord | <shadow.> except for the cstring part |
01:15:33 | FromDiscord | <shadow.> thanks |
01:16:19 | FromDiscord | <nikki> you might want to explicitly take the bytes out bc endiannness stuff |
01:16:25 | Zoom[m] | PMunch i get `undeclared field: 'values'` when I pass it to foldl. `1..10` in it's place works |
01:16:25 | FromDiscord | <shadow.> hm |
01:16:29 | FromDiscord | <shadow.> well the way i was going to do it was like |
01:16:38 | FromDiscord | <shadow.> "xxyy" |
01:16:42 | FromDiscord | <nikki> could look at what frosty does |
01:16:43 | FromDiscord | <shadow.> x being an x byte and y being a y byte |
01:16:58 | Zoom[m] | * PMunch i get `undeclared field: 'values'` when I pass it to foldl. `1..10` in its place works |
01:17:22 | FromDiscord | <nikki> yeah values is an iterator |
01:17:32 | FromDiscord | <nikki> can we see the whole code |
01:17:36 | FromDiscord | <nikki> for this foldl thing |
01:18:41 | FromDiscord | <nikki> why not just write a bunch of for loops 😄 |
01:18:43 | mipri | seems like a gap for iterutils to not be able to iterate over an iterator |
01:19:16 | Zoom[m] | In deed :D |
01:19:30 | mipri | but toSeq(xs.values).map(...) works |
01:20:21 | FromDiscord | <nikki> yea this is why i prefer for loops |
01:20:32 | FromDiscord | <nikki> no need to make intermediate seqs |
01:20:53 | FromDiscord | <nikki> iterators are not first class values they are kinda macros to generate loop code |
01:21:00 | FromDiscord | <nikki> closure iterators are more like that tho |
01:21:32 | PMunch | Yeah that's a bit weird |
01:21:38 | Zoom[m] | Yeah, it kind of defeats the purpose. Too bad they're not first class |
01:23:31 | Zoom[m] | Let me see what zero_functional offers |
01:25:05 | FromDiscord | <shadow.> how do you concatenate c strings? |
01:25:44 | PMunch | By turning them into strings |
01:25:55 | PMunch | Zoom[m], you can do this: https://play.nim-lang.org/#ix=2E4K |
01:25:57 | FromDiscord | <shadow.> smart |
01:26:24 | FromDiscord | <nikki> @shadow. i feel like you should have a buffer somewhere and just keep writing bytes to it |
01:26:29 | PMunch | But I feel you're doing something wrong @shadow :P |
01:26:37 | mipri | incidentally Kotlin made a similar choice to Nim's iterators (vs. C++/D/Rust iterators) with https://kotlinlang.org/docs/reference/inline-functions.html |
01:27:07 | PMunch | I think there is a PR or a thing in devel that allows you to use iterators like this |
01:27:09 | PMunch | IIRC |
01:27:19 | FromDiscord | <shadow.> i just wish the netty package supported array[byte] lol |
01:27:25 | FromDiscord | <shadow.> but i have to send strings |
01:27:32 | FromDiscord | <shadow.> i suppose i could look at the source |
01:27:49 | FromDiscord | <shadow.> i mean technically all i need is a way to convert an array[4, byte] to a string of 4 chars |
01:28:03 | Zoom[m] | Yay, zero_functional worked on a CountTable |
01:28:04 | FromDiscord | <nikki> yeah i just think iterator composition on data strctures is meh |
01:28:17 | FromDiscord | <nikki> seems fine ish on stream style things |
01:28:26 | FromDiscord | <nikki> nice |
01:28:55 | FromDiscord | <nikki> @shadow. wait it really only supports sending strings? |
01:29:03 | FromDiscord | <nikki> of binary data |
01:29:06 | mipri | well in a pinch, newString() and then copyMem(mystr[0].addr, myarray[0].addr) |
01:29:13 | * | abm quit (Read error: Connection reset by peer) |
01:29:22 | FromDiscord | <nikki> after resizing the string |
01:29:45 | FromDiscord | <nikki> but yeah if you setLen it to be big enough, that works |
01:29:50 | PMunch | Create a stringStream and use binaryparse to put your data in it |
01:30:11 | FromDiscord | <nikki> i think it's good to just use the string as the buffer at that point yeah |
01:30:26 | FromDiscord | <shadow.> alright fair enough |
01:30:31 | FromDiscord | <shadow.> and yeah it only supports strings from what i can tell |
01:32:36 | mipri | https://play.nim-lang.org/#ix=2E4L |
01:32:48 | Zoom[m] | PMunch: thanks, will look into Nim closures |
01:33:36 | FromDiscord | <nikki> yea "first class symbols" or sth |
01:33:43 | FromDiscord | <nikki> @shadow. https://media.discordapp.net/attachments/371759389889003532/776983160751783956/image0.png |
01:33:46 | FromDiscord | <nikki> sorry for image lol am on mobile |
01:33:50 | FromDiscord | <nikki> but found this in netty code |
01:34:09 | FromDiscord | <nikki> you can probs do sth similar |
01:34:16 | FromDiscord | <nikki> make string of cap, add stuff, send |
01:34:35 | PMunch | Or, you know, just use binaryparse and a string stream :P |
01:34:40 | PMunch | Anyways, I'm off to bed |
01:34:47 | FromDiscord | <shadow.> rip |
01:34:51 | FromDiscord | <shadow.> cya thx for the help |
01:34:54 | FromDiscord | <shadow.> copymem seemed to work |
01:34:55 | PMunch | No problem |
01:34:57 | * | PMunch quit (Quit: leaving) |
01:35:05 | FromDiscord | <shadow.> ill do binaryparse soon once i yk |
01:35:07 | FromDiscord | <shadow.> figure it out |
01:35:07 | FromDiscord | <shadow.> lol |
01:37:20 | FromDiscord | <shadow.> ah well treeform is on this server |
01:37:25 | FromDiscord | <shadow.> so if he ever swings around i could ask him lol |
01:39:48 | FromDiscord | <shadow.> nvm figured out the issue lo |
01:39:49 | FromDiscord | <shadow.> (edit) "lo" => "lol" |
01:43:06 | FromDiscord | <Rika> Closure iterators are kinda slow and it’s sad, I think they’re great |
01:43:14 | FromDiscord | <shadow.> !eval echo sizeof(int) |
01:43:17 | NimBot | 8 |
01:43:26 | FromDiscord | <shadow.> oop yike |
01:44:34 | FromGitter | <gogolxdong> could iterator be recursive? |
01:47:41 | FromDiscord | <shadow.> !eval echo cast[cstring](1000) |
01:47:44 | NimBot | Compile failed: Error: unhandled exception: value out of range: 1000 notin 0 .. 255 [RangeDefect] |
01:47:50 | FromDiscord | <shadow.> lol fair enough |
01:48:10 | FromDiscord | <shadow.> !eval echo $(cast[cstring](cast[array[2, byte]](1000))) |
01:48:13 | NimBot | <no output> |
01:48:20 | FromDiscord | <shadow.> ah right |
01:50:30 | * | pbb quit (Read error: Connection reset by peer) |
01:50:59 | * | pbb joined #nim |
02:02:20 | FromDiscord | <shadow.> @nikki i wound up just abusing the fuck out of copyMem |
02:02:34 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2E4T |
02:02:49 | FromDiscord | <shadow.> (edit) "https://play.nim-lang.org/#ix=2E4T" => "https://play.nim-lang.org/#ix=2E4U" |
02:02:53 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2E4V |
02:06:27 | FromDiscord | <nikki> u can use sizeof instead of writing 4 everywhere |
02:13:13 | * | apahl_ joined #nim |
02:16:16 | * | apahl quit (Ping timeout: 258 seconds) |
02:17:00 | FromDiscord | <shadow.> smart |
02:17:39 | * | kinkinkijkin joined #nim |
02:18:26 | FromGitter | <gogolxdong> !eval echo (if true: 1 else:0) |
02:18:29 | NimBot | 1 |
02:19:16 | FromDiscord | <shadow.> smart |
02:19:23 | disruptek | why would i want to write `sizeof` when i can just write `4`? |
02:20:01 | FromDiscord | <shadow.> or even better, just replace 4 with \` and make a compile-time script to replace all the \` with 4's |
02:20:13 | FromDiscord | <shadow.> much easier to reach that key than 4 |
02:22:55 | disruptek | ~& |
02:22:55 | disbot | &: 11unreachable |
02:26:23 | FromDiscord | <shadow.> !eval echo (let x = (let y = (let z = 0; z); y); x) |
02:26:26 | NimBot | 0 |
02:26:42 | FromDiscord | <shadow.> brb making a macro to do that for every assignment |
02:27:40 | mipri | if you want to initialize a bunch of variables to the zero or the same thing, there's respectively |
02:27:48 | mipri | !eval var x, y, z; echo (x, y, z) |
02:27:50 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: ':' or '=' expected, but got ';' |
02:27:54 | FromDiscord | <shadow.> nah it was sarcastic lol |
02:27:55 | mipri | !eval var x, y, z: int; echo (x, y, z) |
02:27:58 | NimBot | (0, 0, 0) |
02:28:05 | FromDiscord | <shadow.> im just saying it was an overly complicated way of getting a value |
02:28:07 | mipri | !eval var x, y, z = 2; echo (x, y, z) |
02:28:08 | FromDiscord | <shadow.> satire |
02:28:10 | NimBot | (2, 2, 2) |
02:28:41 | mipri | in general, an expression = would conflict with Nim's syntax for named parameters |
02:28:42 | disruptek | there's nothing funny about trip dueces. |
02:28:48 | FromDiscord | <shadow.> for instance macro would replace↵`let num = 10`↵with↵`let num = (let x = (let y = (let z = 10; z); y); x)` |
02:28:56 | FromDiscord | <shadow.> rip |
02:29:03 | * | xet7 quit (Quit: Leaving) |
02:30:44 | * | xet7 joined #nim |
02:45:13 | FromDiscord | <shadow.> !eval echo false.int |
02:45:16 | NimBot | 0 |
02:48:55 | mipri | !eval ["yes", "no"][int(7 > 3)] |
02:48:57 | NimBot | Compile failed: /usercode/in.nim(1, 14) Error: expression '["yes", "no"][int: |
02:49:03 | mipri | !eval echo ["yes", "no"][int(7 > 3)] |
02:49:05 | NimBot | no |
02:49:32 | FromDiscord | <shadow.> !eval if 0: echo "hi" elif 1: echo "hello" |
02:49:33 | NimBot | Compile failed: /usercode/in.nim(1, 4) Error: type mismatch: got <int literal(0)> but expected 'bool' |
02:49:40 | FromDiscord | <shadow.> (edit) ""hi"" => ""hi";" |
02:49:44 | FromDiscord | <shadow.> ah right .bool |
02:51:22 | mipri | !eval echo (0.bool, 1.bool, 2.bool) |
02:51:25 | NimBot | (false, true, true) |
02:52:19 | FromDiscord | <demotomohiro> !eval echo 0.0.bool, "".bool, nil.bool |
02:52:22 | NimBot | Compile failed: /usercode/in.nim(1, 18) Error: type mismatch: got <string> but expected 'bool' |
02:53:18 | FromDiscord | <ElegantBeef> there is a lot wrong with above |
02:53:50 | mipri | maybe above isn't too fond of you. did you consider that? |
02:54:24 | FromDiscord | <ElegantBeef> Well i know they arent, it's me after all |
03:03:52 | FromDiscord | <nikki> !echo 0xbeef |
03:03:59 | FromDiscord | <nikki> lol i'm silly |
03:04:08 | FromDiscord | <nikki> !eval echo 0xbeef |
03:04:10 | FromDiscord | <ElegantBeef> Yea your forget `!eval |
03:04:11 | NimBot | 48879 |
03:04:53 | FromDiscord | <ElegantBeef> !eval echo 0xe1e9a47beef |
03:04:56 | NimBot | 15524600200943 |
03:07:35 | FromDiscord | <nikki> !eval echo "hello @", "ElegantBeef" |
03:07:37 | NimBot | hello @ElegantBeef |
03:07:44 | FromDiscord | <ElegantBeef> Lol |
03:07:53 | FromDiscord | <ElegantBeef> Fucking nim bot |
03:09:06 | FromDiscord | <nikki> !eval echo "/tableflip" |
03:09:08 | NimBot | /tableflip |
03:09:28 | FromDiscord | <nikki> (╯°□°)╯︵ ┻━┻ |
03:15:41 | FromDiscord | <Rika> That’s a discord client thing |
03:16:16 | FromDiscord | <nikki> yee |
03:16:26 | FromDiscord | <nikki> i wanted to see if @blah would just get interpreted tho |
03:16:30 | FromDiscord | <nikki> and it did which was nice |
03:16:48 | FromDiscord | <Rika> !eval echo "haha pinged you @","nikki" |
03:16:50 | NimBot | haha pinged you @nikki |
03:16:58 | FromDiscord | <Rika> LOL who is that |
03:17:15 | FromDiscord | <nikki> lmao. also i just did the same thing above with beef if u can see it |
03:17:23 | FromDiscord | <Rika> Ok |
03:17:49 | disruptek | the bridge lets the bot ping you? |
03:17:58 | FromDiscord | <Rika> Yes |
03:18:09 | FromDiscord | <Rika> And it’s pretty broken still |
03:18:26 | disruptek | wanna fix it for me? |
03:18:41 | disruptek | i am waiting for someone to impl my requested feature. |
03:20:03 | disruptek | rika: do you remember how to code? |
03:20:22 | FromDiscord | <Rika> I hope I do |
03:20:46 | FromDiscord | <Rika> I’d fix it if I were motivated enough, might be tomorrow, I’ll take a look then |
03:21:15 | disruptek | i just want a way for my bot to send privmsg through the bridge. |
03:22:55 | FromDiscord | <Rika> Ooh that’s a bit hard, also people can disable dm from bots in discord |
03:23:10 | disruptek | that's their problem. |
03:23:23 | FromDiscord | <Rika> Okay |
03:23:40 | FromDiscord | <Rika> I’ll look into it tomorrow, not like I have anything to do during this damn quarantine |
03:23:42 | FromDiscord | <nikki> @Rika did u impl the bridge |
03:23:43 | disruptek | it's just annoying that people cannot !help and get help. |
03:23:46 | FromDiscord | <Rika> No |
03:23:51 | FromDiscord | <Rika> That’s Yardanico |
03:24:37 | disruptek | i've seen the code. i'm not going near it. |
03:25:05 | * | astronavt joined #nim |
03:34:59 | FromDiscord | <demotomohiro> !eval echo ((1.0 + 1.0e-15 - 1.0).bool, (1.0 + 1.0e-16 - 1.0).bool, (1.0 + 1.0e-17 - 1.0).bool, ) ↵!eval echo ((1.0e-15 - 1.0 + 1.0).bool, (1.0e-16 - 1.0 + 1.0).bool, (1.0e-17 - 1.0 + 1.0).bool, )↵!eval echo ((0.5 + 1.0e-15 - 0.5).bool, (0.5 + 1.0e-16 - 0.5).bool, (0.5 + 1.0e-17 - 0.5).bool, ) |
03:35:01 | NimBot | Compile failed: /usercode/in.nim(1, 96) Error: undeclared identifier: '!' |
03:36:57 | FromDiscord | <demotomohiro> !eval echo ((1.0 + 1.0e-15 - 1.0).bool, (1.0 + 1.0e-16 - 1.0).bool, (1.0 + 1.0e-17 - 1.0).bool, )↵echo ((1.0e-15 - 1.0 + 1.0).bool, (1.0e-16 - 1.0 + 1.0).bool, (1.0e-17 - 1.0 + 1.0).bool, )↵echo ((0.5 + 1.0e-15 - 0.5).bool, (0.5 + 1.0e-16 - 0.5).bool, (0.5 + 1.0e-17 - 0.5).bool, ) |
03:36:59 | NimBot | Compile failed: /usercode/in.nim(1, 92) Error: undeclared identifier: '↵echo' |
03:38:21 | Prestige | Anyone know what the int index here is supposed to be? https://tronche.com/gui/x/xlib/utilities/keyboard/XLookupKeysym.html |
03:42:45 | FromDiscord | <shadow.> > Specifies the index into the KeySyms list for the event's KeyCode |
03:42:56 | FromDiscord | <shadow.> that doesnt mean anything to you im guessing? |
03:43:00 | FromDiscord | <ElegantBeef> Welcome to X where that means nothing 😄 |
03:43:20 | FromDiscord | <shadow.> rip |
03:44:00 | FromDiscord | <ElegantBeef> I could be wrong prestige but 0 might mean xkeypresedevent and 1 means releasedevent |
03:44:31 | Prestige | well, the issue is that multiple keys (like 1 and !) share the same keycode |
03:44:54 | Prestige | so the col/index might determine which... I'm not sure |
03:44:56 | FromDiscord | <demotomohiro> https://tronche.com/gui/x/xlib/input/keyboard-encoding.html↵I duckduckgo "xlib keysym" and it seems explaining about keysym |
03:44:58 | FromDiscord | <ElegantBeef> Yea the mod mask is different for them |
03:45:04 | FromDiscord | <shadow.> !eval var x = [232.byte, 3.byte, 232.byte, 3.byte]; var y: array[2, uint16]; memCopy(y[0].addr, x[0].addr, sizeof(x)); echo y |
03:45:07 | NimBot | Compile failed: /usercode/in.nim(1, 72) Error: undeclared identifier: 'memCopy' |
03:45:13 | FromDiscord | <shadow.> shoot |
03:45:23 | FromDiscord | <ElegantBeef> shadow do you need to `nimble install inim`? |
03:45:26 | Prestige | the keysym is different |
03:45:46 | FromDiscord | <shadow.> is memCopy not on the playground |
03:45:51 | mipri | it's copyMem |
03:46:52 | FromDiscord | <ElegantBeef> Speaks like yoda shadow |
03:47:29 | mipri | it's not a mem kinda copy, it's a proc that copies memory |
03:48:07 | FromDiscord | <ElegantBeef> well it'd just be copy if it was a mem type of copy |
03:48:21 | FromDiscord | <shadow.> im dumb |
03:48:31 | FromDiscord | <shadow.> !eval var x = [232.byte, 3.byte, 232.byte, 3.byte]; var y: array[2, uint16]; copyMem(y[0].addr, x[0].addr, sizeof(x)); echo y |
03:48:34 | NimBot | [1000, 1000] |
03:48:43 | FromDiscord | <shadow.> THAT WORKS? |
03:48:47 | FromDiscord | <ElegantBeef> Also this isnt "the playground" |
03:48:51 | FromDiscord | <shadow.> lol |
03:48:55 | FromDiscord | <shadow.> eval bot |
03:49:10 | disruptek | disbot: ignore shadow. |
03:49:10 | disbot | on it. 👍 |
03:49:19 | FromDiscord | <shadow.> wow |
03:49:23 | FromDiscord | <shadow.> :c |
03:49:35 | FromDiscord | <shadow.> sad |
03:49:37 | FromDiscord | <ElegantBeef> Selectively ignored, see that's what you get |
03:49:48 | FromDiscord | <shadow.> for doing what |
03:49:51 | FromDiscord | <ElegantBeef> Just remember the eval bot isnt ignored afaik |
03:49:56 | FromDiscord | <ElegantBeef> So you can still pester him |
03:50:00 | FromDiscord | <shadow.> huh |
03:50:07 | FromDiscord | <ElegantBeef> I clearly joke |
03:50:10 | FromDiscord | <shadow.> im confused why was i just ignored |
03:50:54 | FromDiscord | <shadow.> did i do something wrong lmao |
03:50:59 | FromDiscord | <ElegantBeef> Probably due to the abuse of the eval bot |
03:51:11 | FromDiscord | <shadow.> wait are we not suppose to use it like that |
03:51:31 | FromDiscord | <shadow.> shit my bad |
03:52:40 | FromDiscord | <shadow.> my apologies |
03:55:57 | * | muffindrake quit (Ping timeout: 260 seconds) |
03:56:07 | ForumUpdaterBot | New thread by Stbalbach: Creating unique ID from strings, see https://forum.nim-lang.org/t/7088 |
03:57:12 | FromDiscord | <shadow.> so can i not use eval bot now 💀 |
03:57:16 | FromDiscord | <shadow.> rip |
03:57:25 | FromDiscord | <ElegantBeef> I have no idea |
03:57:52 | FromDiscord | <Rika> disbot is not nimbot lol |
03:57:55 | * | muffindrake joined #nim |
03:58:00 | FromDiscord | <shadow.> oh lmao |
03:58:12 | FromDiscord | <Rika> anyway still use the playground please |
03:58:12 | FromDiscord | <ElegantBeef> I forget which is which |
03:58:18 | FromDiscord | <shadow.> kk i will |
03:58:18 | FromDiscord | <ElegantBeef> Or inim |
03:58:25 | FromDiscord | <shadow.> what does disbot even do lol |
03:58:30 | FromDiscord | <Rika> idk |
03:58:31 | FromDiscord | <ElegantBeef> !repo nimscripter |
03:58:32 | disbot | https://github.com/beef331/nimscripter -- 9nimscripter: 11Quick and easy Nim <-> Nimscript interop 15 10⭐ 0🍴 |
03:58:38 | FromDiscord | <Rika> ah yeah that |
03:58:39 | FromDiscord | <shadow.> woa |
03:59:26 | FromDiscord | <shadow.> i believe i mighta asked this a while ago but i forget, has an interactive shell type thing been made for nim yet? |
03:59:34 | FromDiscord | <ElegantBeef> if i say inim |
03:59:39 | FromDiscord | <ElegantBeef> And you dont `nimble install inim` |
03:59:42 | FromDiscord | <ElegantBeef> it's your own fault |
03:59:46 | FromDiscord | <shadow.> ah so thats what that is LOL |
03:59:49 | FromDiscord | <shadow.> ty |
03:59:57 | FromDiscord | <shadow.> where can i read docs? |
04:00:17 | FromDiscord | <ElegantBeef> !repo inim |
04:00:18 | disbot | https://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 371⭐ 18🍴 |
04:00:23 | FromDiscord | <shadow.> ty |
04:01:27 | FromDiscord | <shadow.> damn that is very sick |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:35 | * | supakeen joined #nim |
04:11:06 | * | sagax joined #nim |
04:32:57 | * | ForumUpdaterBot quit (Remote host closed the connection) |
04:32:57 | * | Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
04:33:16 | * | Yardanico joined #nim |
04:45:43 | FromDiscord | <Daniel> can anyone help me to determine why am i getting an error here: https://media.discordapp.net/attachments/371759389889003532/777031483696611348/unknown.png |
04:46:47 | FromDiscord | <Daniel> i have been bulging my eyes into this for last 20minutes, but just cant notice what i did wrong 🤔 |
04:47:05 | * | apahl_ quit (Ping timeout: 272 seconds) |
04:47:14 | FromDiscord | <Daniel> i should be in bed sleeping, fml |
04:47:35 | disruptek | could be that the newline characters don't match. |
04:47:35 | disruptek | echo expected |
04:47:35 | disruptek | that's \c\l not \c\1, right? |
04:47:47 | * | apahl joined #nim |
04:49:01 | FromDiscord | <Daniel> sent a code paste, see https://play.nim-lang.org/#ix=2E5g |
04:49:06 | FromDiscord | <Rika> why \c\1? |
04:49:34 | FromDiscord | <Daniel> for carriage return |
04:50:56 | FromDiscord | <Rika> carriage return uses \1? [SOH Start of Heading]? |
04:51:15 | FromDiscord | <Rika> thats a one, not an L |
04:52:03 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals |
04:52:28 | FromDiscord | <Rika> you prolly mean l yeah |
04:52:36 | FromDiscord | <Rika> `\c\l` and not `\c\1` |
04:53:35 | FromDiscord | <Daniel> i am following this to learn:↵https://livebook.manning.com/book/nim-in-action/chapter-3/240 |
04:53:51 | FromDiscord | <ElegantBeef> yea |
04:53:54 | FromDiscord | <Daniel> but now i am stuck, i better go to bed and sleep over it |
04:53:59 | FromDiscord | <ElegantBeef> they use `\c\l` |
04:54:03 | FromDiscord | <ElegantBeef> as in L not 1 |
04:54:21 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/777033654828400640/unknown.png |
04:54:30 | FromDiscord | <Daniel> omg, i see what you meen, small case letter L |
04:54:37 | FromDiscord | <Rika> yeah and you put 1 |
04:54:54 | FromDiscord | <Daniel> yea, i used a number, ....this rly means i need some sleep, lol |
04:54:56 | FromDiscord | <Daniel> thank you guys |
04:57:38 | * | astronavt quit (Quit: Leaving) |
05:00:42 | FromDiscord | <VideoCarp> why am I getting invalid indentation here? it looks fully consistent, all of them are using the same amount of spaces, 4.↵location: 23,51↵<https://play.nim-lang.org/#ix=2E5h> |
05:01:43 | disruptek | your tuples need to be in () |
05:01:56 | disruptek | you cannot destructure `1, 2`. |
05:02:31 | FromDiscord | <VideoCarp> ah so it isn’t indentation |
05:02:46 | disruptek | it's a message from the parser. |
05:04:51 | FromDiscord | <VideoCarp> now it’s doing all of the conditions whether failed or not |
05:06:16 | disruptek | try `for cond in conditions: ... for action in dostuff: ...` |
05:06:51 | disruptek | i personally use items() and pairs() explicitly, but i'm in the minority. |
05:07:25 | FromDiscord | <Daniel> i got the error again https://media.discordapp.net/attachments/371759389889003532/777036942473822248/unknown.png |
05:07:32 | FromDiscord | <Daniel> but i found it accidentaly |
05:07:39 | FromDiscord | <Daniel> it was this space before hello |
05:07:49 | FromDiscord | <Daniel> i thought space would be ignored inside |
05:07:59 | disruptek | nah. it's a string. |
05:08:07 | FromDiscord | <VideoCarp> never knew the `for` can be done like python, but it had the same problem, doing all of them. |
05:08:34 | FromDiscord | <Daniel> yea its a string, but isnt only stuff in quotes analysed? |
05:08:37 | disruptek | echo your unit. |
05:08:52 | disruptek | daniel: it's in quotes. it's triple-quoted, in fact. |
05:09:20 | FromDiscord | <Daniel> is it because of triple quotes then? |
05:10:07 | FromDiscord | <nikki> it's because the json output you're checking against doesn't have the space |
05:10:30 | FromDiscord | <VideoCarp> when using `h`, it results in `hhhhhhhhhhhhh` with newlines separating each character.↵so it’s getting the right input. |
05:10:32 | disruptek | triple-quotes are syntax for strings. |
05:11:33 | FromDiscord | <Daniel> righto, thank you, going to bed, my brain is soup, gn |
05:11:40 | FromDiscord | <VideoCarp> i think they’re multiline strings |
05:12:16 | FromDiscord | <Rika> they are |
05:16:29 | * | ForumUpdaterBot joined #nim |
06:21:52 | * | xet7 quit (Quit: Leaving) |
06:23:20 | * | xet7 joined #nim |
06:38:48 | * | mmohammadi9812 joined #nim |
06:45:13 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:48:05 | * | thomasross quit (Quit: Leaving) |
06:54:47 | * | a_chou joined #nim |
06:56:08 | * | a_chou quit (Remote host closed the connection) |
07:00:30 | * | habamax joined #nim |
07:19:43 | * | solitudesf joined #nim |
07:50:07 | * | narimiran joined #nim |
07:55:42 | * | mmohammadi9812 quit (Ping timeout: 260 seconds) |
07:56:09 | * | mmohammadi9812 joined #nim |
07:57:52 | * | narimiran quit (Ping timeout: 246 seconds) |
08:00:16 | * | narimiran joined #nim |
08:20:41 | * | Vladar joined #nim |
08:22:45 | * | bung joined #nim |
08:28:11 | bung | https://github.com/nim-lang/Nim/pull/15933 merge this please |
08:28:11 | disbot | ➥ add testcase for #15937 |
08:57:31 | * | narimiran quit (Ping timeout: 265 seconds) |
09:16:11 | bung | is there a way avoiding duplicated "template/generic instantiation of " messages ? |
09:16:54 | ForumUpdaterBot | New thread by Elcritch: Possible usage of Nim & Z3 for embedded?, see https://forum.nim-lang.org/t/7089 |
09:38:51 | * | gangstacat quit (Quit: Ĝis!) |
09:40:57 | ForumUpdaterBot | New thread by Yglukhov: Tweaking optimizations for dependencies, see https://forum.nim-lang.org/t/7090 |
09:44:43 | * | natrys joined #nim |
10:03:00 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:25:06 | * | bung quit (Ping timeout: 256 seconds) |
10:26:01 | * | bung joined #nim |
10:36:40 | FromDiscord | <lqdev> @Daniel btw you probably want to be using \p instead of \c\l |
10:36:57 | FromDiscord | <lqdev> \p is the platform specific newline escape sequence |
10:37:18 | FromDiscord | <lqdev> so \c\l on windows, \l on unix |
11:10:04 | * | Vladar quit (Quit: Leaving) |
11:27:58 | * | Vladar joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:34 | * | supakeen joined #nim |
12:09:22 | ForumUpdaterBot | New thread by Enthus1ast: Muk - a crossplattform terminal music and video player., see https://forum.nim-lang.org/t/7091 |
12:19:24 | * | lritter joined #nim |
12:30:02 | FromDiscord | <alehander42> ok |
12:32:24 | * | weeqw joined #nim |
12:50:55 | * | haxscramper joined #nim |
12:52:04 | Zevv | https://pwlconf.org/2019/shriram-krishnamurthi/ |
12:57:30 | * | Vladar quit (Quit: Leaving) |
12:57:33 | disruptek | oh yeah? |
12:57:40 | haxscramper | Is there any way to use block call syntax to pass to a particular argument of a template? I have `mapIt`-like template with 4 arguments, where `body` must be last, but I want to have some default values for arguments. |
12:58:02 | haxscramper | I tried with `do:` but it didn't work |
12:58:42 | disruptek | make more templates that forge the default values. |
13:01:10 | * | gangstacat joined #nim |
13:04:15 | Zevv | disruptek: if you can spare the bandwith, the guy make sense |
13:04:57 | disruptek | lemme make some coffee and rub one out. |
13:19:29 | ForumUpdaterBot | New thread by Peter: Kill thread?, see https://forum.nim-lang.org/t/7092 |
13:21:01 | * | PMunch joined #nim |
13:34:49 | * | habamax quit (*.net *.split) |
13:34:50 | * | Kaivo quit (*.net *.split) |
13:34:50 | * | vesper11 quit (*.net *.split) |
13:34:50 | * | jxy quit (*.net *.split) |
13:35:50 | * | Kaivo joined #nim |
13:35:52 | * | jxy joined #nim |
13:37:43 | * | MTRNord[m] quit (*.net *.split) |
13:37:43 | * | hnOsmium0001[m] quit (*.net *.split) |
13:37:43 | * | jonjitsu[m] quit (*.net *.split) |
13:37:43 | * | npgm_ quit (*.net *.split) |
13:37:43 | * | kwilczynski quit (*.net *.split) |
13:37:43 | * | matlock quit (*.net *.split) |
13:37:43 | * | ehmry quit (*.net *.split) |
13:37:43 | * | lum quit (*.net *.split) |
13:37:43 | * | koltrast quit (*.net *.split) |
13:37:43 | * | Northstrider[m] quit (*.net *.split) |
13:40:58 | * | MTRNord[m] joined #nim |
13:40:58 | * | hnOsmium0001[m] joined #nim |
13:40:58 | * | jonjitsu[m] joined #nim |
13:40:58 | * | npgm_ joined #nim |
13:40:58 | * | kwilczynski joined #nim |
13:40:58 | * | matlock joined #nim |
13:40:58 | * | ehmry joined #nim |
13:40:58 | * | lum joined #nim |
13:40:58 | * | koltrast joined #nim |
13:40:58 | * | Northstrider[m] joined #nim |
13:41:09 | * | habamax joined #nim |
13:41:21 | * | hnOsmium0001[m] quit (Max SendQ exceeded) |
13:43:36 | * | kwilczynski quit (Ping timeout: 246 seconds) |
13:44:18 | * | jonjitsu[m] quit (Ping timeout: 246 seconds) |
13:44:25 | * | Avatarfighter[m] quit (Ping timeout: 240 seconds) |
13:44:25 | * | jrhawley[m] quit (Ping timeout: 240 seconds) |
13:44:26 | * | brainbomb[m] quit (Ping timeout: 240 seconds) |
13:44:26 | * | Zoom[m] quit (Ping timeout: 240 seconds) |
13:44:27 | * | nikki93[m] quit (Ping timeout: 240 seconds) |
13:44:32 | * | Helios quit (Ping timeout: 260 seconds) |
13:44:37 | * | ee7[m] quit (Ping timeout: 244 seconds) |
13:44:37 | * | lnxw37d4 quit (Ping timeout: 244 seconds) |
13:44:37 | * | guelosk[m] quit (Ping timeout: 244 seconds) |
13:44:38 | * | planetis[m] quit (Ping timeout: 244 seconds) |
13:44:38 | * | Jitty[m] quit (Ping timeout: 244 seconds) |
13:44:39 | * | unclechu quit (Ping timeout: 246 seconds) |
13:44:41 | * | leorize[m]1 quit (Ping timeout: 244 seconds) |
13:44:41 | * | BitPuffin quit (Ping timeout: 244 seconds) |
13:44:41 | * | reversem3 quit (Ping timeout: 244 seconds) |
13:44:41 | * | lum[m] quit (Ping timeout: 244 seconds) |
13:44:56 | * | ache-of-head[m] quit (Ping timeout: 268 seconds) |
13:44:56 | * | leorize[m] quit (Ping timeout: 268 seconds) |
13:46:21 | * | kwilczynski joined #nim |
13:48:08 | * | MTRNord[m] quit (Ping timeout: 246 seconds) |
13:50:26 | * | muffindrake quit (Ping timeout: 264 seconds) |
13:52:14 | * | muffindrake joined #nim |
13:56:49 | * | superbia joined #nim |
13:57:11 | * | bung quit (Quit: Lost terminal) |
14:00:25 | * | weeqw quit (Read error: Connection reset by peer) |
14:05:25 | * | objQ joined #nim |
14:06:34 | objQ | Hey, dumb question, what is the purpose of the * when defining an object? The Nim by Example tutorial gives the example "type Animal* = object" |
14:06:51 | * | jonjitsu[m] joined #nim |
14:09:49 | supakeen | It means it's exported. |
14:10:08 | * | BitPuffin joined #nim |
14:10:14 | * | planetis[m] joined #nim |
14:10:40 | objQ | Is that just for objects or for functions as well? I |
14:11:24 | supakeen | Both. |
14:11:49 | objQ | Cool, thank you. |
14:11:55 | * | unclechu joined #nim |
14:11:56 | supakeen | objQ: https://nim-lang.org/docs/manual.html#procedures-export-marker see there :) |
14:12:42 | objQ | What happens if you don't use an asterisk on one of the fields of an exported object? |
14:13:52 | solitudesf | it wont be exported |
14:15:01 | * | brainbomb[m] joined #nim |
14:15:44 | * | reversem3 joined #nim |
14:15:47 | * | nikki93[m] joined #nim |
14:15:48 | * | lum[m] joined #nim |
14:15:56 | * | lnxw37d4 joined #nim |
14:16:31 | * | leorize[m]1 joined #nim |
14:16:53 | * | ee7[m] joined #nim |
14:17:13 | objQ | Are there any libraries or packages I can look at to get a sense of how Nim codebases are supposed to be formatted? I've read the style guide but it's pretty short and doesn't really speak to larger scale format. |
14:17:22 | * | jrhawley[m] joined #nim |
14:17:24 | * | Zoom[m] joined #nim |
14:17:24 | * | Avatarfighter[m] joined #nim |
14:17:47 | * | Jitty[m] joined #nim |
14:17:48 | * | guelosk[m] joined #nim |
14:18:06 | * | Helios joined #nim |
14:18:18 | * | leorize[m] joined #nim |
14:18:26 | * | ache-of-head[m] joined #nim |
14:24:05 | * | habamax quit (Quit: leaving) |
14:24:22 | * | habamax joined #nim |
14:24:47 | * | objQ quit (Remote host closed the connection) |
14:25:27 | supakeen | You can take a look at some of the codebases around such as npeg, etc but I don't know if there's really any 'standard of formatting' :) |
14:25:36 | FromDiscord | <haxscramper> Can read stdlib implementation. But there is no difference really between large and small-scale format |
14:26:15 | disruptek | everything i've ever written is perfect. |
14:26:18 | FromDiscord | <haxscramper> Most code I've seen formatted like stdlib (`camelCase`, 2 spaces indentation and that's about it) |
14:30:43 | * | hnOsmium0001[m] joined #nim |
14:30:44 | Zevv | yeah npeg is the new standard |
14:30:45 | Zevv | sure |
14:31:26 | disruptek | honestly, compiler style is really the only gate i can think of. |
14:32:44 | * | evilkhaoskat joined #nim |
14:34:23 | * | MTRNord[m] joined #nim |
14:34:36 | disruptek | 1) `for t in items tees:` or 2) `for t in tees.items:` or 3) `for t in tees:`... vote. |
14:36:07 | * | waleee-cl joined #nim |
14:41:20 | FromDiscord | <Rika> id do 3 |
14:44:26 | disruptek | i've been experimenting with 1 but i think i'm going back to 2. |
14:45:59 | FromDiscord | <Rika> 1 looks really weird to me |
14:46:04 | FromDiscord | <Rika> i do 2 sometimes |
14:46:55 | disruptek | the goal is to remove implicit items/pairs, and being more explicit is, to me, a win. |
14:47:19 | disruptek | ie. nim-2 probably won't do implicit items/pairs. |
15:01:03 | FromDiscord | <dom96> `for t in items(tees)` is the winner |
15:01:38 | disruptek | the problem with it is that the piece of info you want to convey earliest, that is most important for comprehension, is `tees`. |
15:02:22 | disruptek | "in items" becomes noise. |
15:03:32 | disruptek | .items can be thought of as conversion, which maybe makes it easier to accept. |
15:06:35 | Zevv | i always 3. I like terse. Its not like it's ambigious |
15:07:40 | disruptek | i didn't get that talk. |
15:08:21 | disruptek | could be that i just take the theorems for granted, though. |
15:09:42 | disruptek | but i definitely sympathize with the introduction of expression as a can-o-worms that i don't always want to unpack; timmy tends to aggravate these things. |
15:13:13 | disruptek | Zevv: this is why the `return in expr` is so disturbing to me. |
15:13:58 | * | natrys quit (Ping timeout: 246 seconds) |
15:14:09 | supakeen | i like doms |
15:15:34 | FromDiscord | <haxscramper> `3` might suffer from some generic issues - e.g. you can't easily (AFAIK) mixin implicit `items` |
15:17:46 | disruptek | not sure what you mean. |
15:18:16 | disruptek | the omission of the iterator is, afaik, sugar. |
15:22:48 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/1MV |
15:23:01 | FromDiscord | <haxscramper> If I add `items` to `difference` implementation it works |
15:24:16 | FromDiscord | <haxscramper> Something like that. But this has issue already AFAIC, I just don't remember which one |
15:24:35 | disruptek | huh. i don't use mixin. |
15:24:47 | disruptek | can't remember if it's because of this, though. |
15:25:14 | FromDiscord | <haxscramper> It doesn't change anything here actually - unless I edit `std/sets.difference` nothing works |
15:25:30 | FromDiscord | <haxscramper> Need to make smaller example actually |
15:25:52 | disruptek | i'm not sure it's wrong, honestly. |
15:29:08 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2E9y |
15:29:26 | * | natrys joined #nim |
15:30:32 | disruptek | well, if you make it explicit, the sugar doesn't run. |
15:31:21 | disruptek | probably the sugar isn't working correctly and this is another reason not to use it. |
15:33:09 | FromDiscord | <haxscramper> `for val in u: discard` should be identical to `for val in items(u): discard`, right? But it seems that it is not. Just another argument against `3`. And `.items` call can also suffer from some symbol resolution issues, so `items()` it the safest one. For generic code especially |
15:47:32 | disruptek | you mean ufcs issues with templates? |
15:48:45 | disruptek | i've stopped using () for calls with a single argument unless the syntax is ambiguous. |
16:09:52 | FromDiscord | <shadow.> is there any way to copyMem into a tuple? for instance copying into a tuple(uint16, uint16) from an array[4, uint8] |
16:11:30 | * | evilkhaoskat quit () |
16:13:35 | FromDiscord | <lqdev> yeah |
16:13:42 | FromDiscord | <Idefau> you could declare a type as a tuple of some length |
16:13:50 | FromDiscord | <Idefau> then you have your destination variable as that type |
16:13:56 | FromDiscord | <lqdev> copyMem(yourTuple.addr, yourArray[0].addr, sizeof(yourTuple)) |
16:14:04 | FromDiscord | <shadow.> alr lemme try that ty |
16:14:59 | FromDiscord | <shadow.> worked, thanks |
16:15:02 | * | weeqw joined #nim |
16:16:50 | * | superbia quit (Quit: WeeChat 2.9) |
16:18:21 | * | weeqw quit (Quit: Leaving) |
16:22:06 | FromDiscord | <shadow.> well thats a much easier way to send packets lol |
16:22:19 | FromDiscord | <shadow.> just copy mem from a Packet tuple into a string and then copy mem into a Packet tuple |
16:22:27 | FromDiscord | <shadow.> (edit) "just copy mem from a Packet tuple into a string and then copy mem into a Packet tuple ... " added "from the string" |
16:33:21 | disruptek | ~ufcs |
16:33:22 | disbot | no footnotes for `ufcs`. 🙁 |
16:34:08 | disruptek | ~ufcs is a misnomer. See https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d for one set of opinions. |
16:34:09 | disbot | ufcs: 11a misnomer. See https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d for one set of opinions. |
16:35:06 | * | PMunch quit (Quit: leaving) |
16:43:26 | * | a_chou joined #nim |
16:43:34 | * | natrys quit (Ping timeout: 246 seconds) |
16:56:38 | * | natrys joined #nim |
16:59:47 | * | stever left #nim (#nim) |
17:00:12 | * | a_chou quit (Remote host closed the connection) |
17:06:50 | * | xet7 quit (Remote host closed the connection) |
17:08:13 | * | xet7 joined #nim |
17:23:35 | * | narimiran joined #nim |
17:35:45 | * | mmohammadi9812 quit (Read error: Connection reset by peer) |
17:35:56 | * | mmohammadi9812 joined #nim |
17:40:32 | * | mmohammadi9812 quit (Ping timeout: 256 seconds) |
17:42:34 | * | mmohammadi9812 joined #nim |
17:56:53 | FromDiscord | <shad0w> @shadow. hey, you sound familiar ~.^ |
17:57:33 | FromDiscord | <shadow.> hmm |
17:57:37 | FromDiscord | <shadow.> indeex |
17:57:38 | FromDiscord | <shadow.> (edit) "indeex" => "indeed" |
18:00:56 | * | xet7 quit (Quit: Leaving) |
18:18:54 | FromDiscord | <Daniel> just discovered this video, watching: 👍 ↵https://www.youtube.com/watch?v=O8Y4faZPnsc↵@PMunch |
18:24:40 | * | xet7 joined #nim |
18:25:01 | * | vicfred_ joined #nim |
18:27:44 | * | vicfred quit (Ping timeout: 260 seconds) |
18:29:36 | * | kinkinkijkin quit (Remote host closed the connection) |
18:29:38 | Zevv | disruptek: return in expr? |
18:29:40 | Zevv | whats that |
18:52:18 | * | NimBot joined #nim |
19:00:05 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
19:01:34 | * | pbb joined #nim |
19:23:16 | * | hnOsmium0001 joined #nim |
19:29:11 | FromGitter | <ynfle> is `@` on a seq a noop? |
19:52:47 | Zoom[m] | If multidim openArrays are not supported, how do I pass them to a function? |
20:06:45 | FromGitter | <ynfle> `seq[seq[int]]` |
20:06:58 | FromGitter | <ynfle> Or use a matrix library |
20:09:44 | Zoom[m] | ynfile, nope you can't pass arrays if a function requires seqs, can't you? That's the point of having openArray in the first place, right? |
20:13:41 | planetis[m] | Hey checkout brand new macro writing dsl! https://github.com/nim-lang/fusion/pull/40 |
20:13:42 | disbot | ➥ Added macro dsl based on karaxdsl |
20:14:01 | planetis[m] | its fresh |
20:14:35 | planetis[m] | can use some testers |
20:21:48 | FromDiscord | <Rebel> Are there any packages to easily interact with smb in Nim? |
20:23:57 | planetis[m] | Have you checked nimble.directory ? |
20:24:31 | haxscramper | planetis[m]: `isMainModule.cases` is an example of use? |
20:24:54 | planetis[m] | well yes |
20:26:27 | FromGitter | <ynfle> @zoom, Yes but you can make a generic |
20:26:34 | planetis[m] | it was taken from a script i made, it builds a fsm from a table |
20:26:47 | haxscramper | This is mostly the same as `makeTree` from `fusion/matching` - https://github.com/haxscramper/fusion/blob/matching/tests/tMatching.nim#L727 (except this one does not allow to splice logic and code generation - only to create tree) |
20:27:30 | haxscramper | s/this/one from matching/ |
20:28:08 | * | natrys quit (Quit: natrys) |
20:28:33 | planetis[m] | isn't that pattern matching? |
20:28:52 | haxscramper | No, this is construction of the tree, just using the same DSL |
20:29:08 | haxscramper | The same parser for DSL. Like pattern matching but in reverse |
20:30:00 | planetis[m] | its huge you put a lot of effort on it |
20:30:53 | planetis[m] | i just copied karaxdsl, hope it's useful to other ppl |
20:32:01 | FromGitter | <ynfle> @Zoom, Here is an implementation using generics https://play.nim-lang.org/#ix=2Eb2 |
20:32:46 | * | habamax quit (Ping timeout: 244 seconds) |
20:33:42 | Zoom[m] | ynfle, thanks. there's a place in the docs and/or nimbyexample for this somewhere! |
20:33:54 | * | Axiomatic left #nim ("Leaving") |
20:34:13 | haxscramper | planetis[m]: Yeah, I thought that too. I'm not familliar with karax though, so maybe there is some things besides splicing logic and ast generation? `makeTree` is not a full 'reverse' - things like `all` etc. are not supported yet. With these additions there would probably be an overlap on feaures |
20:34:42 | FromGitter | <ynfle> Are you asking if there is place in the docs for this application of generics specifically? Not that I'm aware of |
20:34:59 | FromGitter | <ynfle> ~generics |
20:34:59 | disbot | no footnotes for `generics`. 🙁 |
20:35:22 | FromGitter | <ynfle> https://nim-lang.org/docs/manual.html#Generics |
20:35:43 | Zoom[m] | This was not a question :) I meant the docs should mention this possibility right after saying you can't have multidim openarrays. |
20:42:42 | planetis[m] | haxscramper: no thats exactly what it does. Its quite good |
20:43:19 | planetis[m] | Im not familiar with maketree but will check it |
20:45:24 | planetis[m] | I must say im quite satisfied with how it turned. I mean repurposing a web dsl into macros and its just working |
20:46:49 | planetis[m] | I want to show @Araq after all he wrote all the logic |
20:47:52 | haxscramper | https://raw.githubusercontent.com/haxscramper/fusion/matching/src/fusion/matching.rst - for `makeTree` (github can't deal with `.. code:: nim`, so link is to raw `.rst`). |
20:49:51 | planetis[m] | haxscramper: are you aware of https://github.com/krux02/ast-pattern-matching ? |
20:49:55 | haxscramper | Yes |
20:50:20 | haxscramper | Yes, I'm aware of absolutely all pattern matching implementations for nim |
20:51:08 | haxscramper | But `ast-pattern-matching` is not generic (e.g only `NimNode`) |
20:52:59 | haxscramper | Pattern /matching/ dsl alreay supports loops in form of `all`, `any`, `none`, and `until` as well as custom predicates. Just need to come up with semantics for `makeTree` that would exactly mirror `match` part. |
20:56:44 | planetis[m] | All these sound so complicated to me, i have to admit |
20:59:02 | haxscramper | You can match nim node using `matches:⮒ StmtList[all @statements]` - and it will inject `statements` variable. So it is logical (well, at least to me) to think that `makeTree:⮒ StmtList[all @statements]` would create `StmtList` node and add all elements from `statements`. |
20:59:39 | planetis[m] | yes that makes sense |
21:00:47 | FromDiscord | <notchris> Hello friends |
21:01:02 | notchris | o/ |
21:02:16 | haxscramper | But the problem is - I also have `StmtList[until @elements is Ident(strVal: "stop")]` that would capture elements until first `stop` identifier in statment list. But for `makeTree` it might be a bit pointless. Though kind of logical to expect, so I would probably stick to it too. |
21:04:18 | planetis[m] | Now that you explain it, it all makes sense, its just im not used to program declaretively |
21:07:17 | haxscramper | Good point actually. I kind of forgot about this, so should probably include more examples of how things like `all` etc. map into for loops/ifs and so on. |
21:18:14 | * | stefantalpalaru quit (Ping timeout: 244 seconds) |
21:20:20 | * | vicfred_ quit (Quit: Leaving) |
21:26:14 | * | Nimer4-2 joined #nim |
21:35:34 | * | vesper11 joined #nim |
21:49:54 | * | haxscramper quit (Remote host closed the connection) |
21:52:42 | FromDiscord | <notchris> if i have a C lib that is just a UI bundled into a single header file |
21:52:50 | * | narimiran quit (Ping timeout: 264 seconds) |
21:53:01 | FromDiscord | <notchris> whats the easiest way to interact with it without using c2nim etc |
21:53:45 | FromDiscord | <nikki> `proc foo(blah: cstring, bleh: int): int {.importc, header: "\"theheader.h\"".}` |
21:53:53 | FromDiscord | <nikki> should let you call eg. foo from the lib |
21:54:10 | FromDiscord | <notchris> so i need to find where its rendering to a surface and starting a window first right |
21:54:59 | FromDiscord | <nikki> depends on what the ui lib is saying i think. if it expects a window handle, or if it creates its own window etc. 🤔 |
21:55:39 | FromDiscord | <notchris> hmmm |
22:00:12 | * | stefantalpalaru joined #nim |
22:36:59 | ForumUpdaterBot | New thread by Spip: Life is nice..., see https://forum.nim-lang.org/t/7093 |
22:50:02 | Zoom[m] | Huh, so it seems I need to `import enumerate` to use it, but I get "cannot open file" |
23:01:31 | * | stefantalpalaru quit (Changing host) |
23:01:31 | * | stefantalpalaru joined #nim |
23:01:46 | * | Axiomatic joined #nim |
23:02:57 | FromDiscord | <ElegantBeef> it quite possibly is under `std/enumerate` |
23:04:02 | FromDiscord | <ElegantBeef> Some of the more recent/smaller libraries require the `std/` afaik |
23:04:54 | FromDiscord | <j-james> What are some good GUI libraries for Nim? |
23:06:07 | * | Nimer4-2 quit (Remote host closed the connection) |
23:06:41 | FromDiscord | <ElegantBeef> Fidget, Nimx, WebGUI |
23:06:54 | * | Axiomatic left #nim ("Leaving") |
23:07:26 | FromDiscord | <ElegantBeef> What type of GUI do you want though, "native" or native? |
23:09:29 | FromDiscord | <j-james> I suppose native |
23:09:55 | FromDiscord | <j-james> This is mostly for learning, not for a full-fledged project |
23:10:08 | FromDiscord | <ElegantBeef> Well then you've got Nigui if you want cross platform native |
23:10:39 | FromDiscord | <ElegantBeef> It's also "native" since on linux/mac it uses gtj |
23:10:42 | FromDiscord | <ElegantBeef> (edit) "gtj" => "gtk" |
23:10:56 | FromDiscord | <ElegantBeef> But on windows it does use windows GUI, so close enough |
23:16:07 | FromDiscord | <j-james> Thanks, I'll give that a whirl |
23:16:24 | * | solitudesf quit (Ping timeout: 256 seconds) |
23:28:56 | FromDiscord | <ElegantBeef> So i'm curious is the `_` in `for _ in 0..10` supposed to be accessible, I know underscore is the unused indicator and if you do it in a `let _ = 100` then try to access it the identfier doesnt exist, shouldnt it be the case for `for` aswell? |
23:38:40 | FromDiscord | <nikki> i think it's not supposed to be accessible |
23:38:52 | FromDiscord | <nikki> like you can do `for _, _ in ...` -- and if it was accessible that would cause an ambiguity |
23:39:13 | * | lritter quit (Remote host closed the connection) |
23:39:35 | FromDiscord | <nikki> one "somewhat analogous" place where you can't actually do multiple `_` is in parameter lists -- like you can't do `proc(_, _: int)` to take two `int`s that you ignore iirc |
23:46:11 | FromDiscord | <krabbypatty> huh |
23:46:20 | FromDiscord | <krabbypatty> nim accepts both `case x` and `case x:` |
23:47:04 | FromDiscord | <krabbypatty> first one should be probably emit a syntax error? |
23:47:09 | FromDiscord | <krabbypatty> (edit) removed "be" |
23:51:25 | FromDiscord | <ElegantBeef> @nikki yea that was my intuition as well but it's for a normal `for _ in iterator` |
23:51:33 | FromDiscord | <ElegantBeef> So i guess time to make an issue 😄 |
23:52:46 | FromDiscord | <nikki> @ElegantBeef yea it's accessible indeed |
23:52:54 | FromDiscord | <nikki> 🤔 |
23:53:20 | FromDiscord | <ElegantBeef> I used the playground and it compiles in every version |
23:53:23 | FromDiscord | <ElegantBeef> So it's weird indeed |