<< 29-03-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:01:03FromDiscord<Recruit_main707> maybe not :p i do cant
00:01:17*my_dude quit (Quit: ZZZzzz…)
00:01:34FromDiscord<Recruit_main707> (is that well written?)
00:01:38*rnrwashere quit (Remote host closed the connection)
00:01:39*tane quit (Quit: Leaving)
00:01:42*junland joined #nim
00:11:18FromDiscord<Varriount> @Recruit_main707 hm
00:11:40FromDiscord<Varriount> @Recruit_main707 identifiers in Nim ignore underscores, that may be why
00:13:03*rnrwashere joined #nim
00:13:19*rnrwashere quit (Remote host closed the connection)
00:13:57*rnrwashere joined #nim
00:18:46*PMunch quit (Ping timeout: 256 seconds)
00:18:49*rnrwashere quit (Ping timeout: 264 seconds)
00:18:58FromDiscord<KingDarBoja> It is possible to convert a string like "\x07" into raw string? Tried using repr("\x07") but yields 0x7f59df3e8080"\7" while $"\x07" yields . I want to get the raw value.
00:19:11*Trustable quit (Remote host closed the connection)
00:19:13FromDiscord<Rika> r"\x07"
00:19:19FromDiscord<Rika> i think
00:19:42FromDiscord<Rika> yeah thats it
00:20:10FromDiscord<KingDarBoja> But let's said it is a parameter to other function, how I can turn that string without changing the source?
00:20:34FromDiscord<KingDarBoja> convert*
00:21:58FromDiscord<Rika> no clue actually
00:22:46FromDiscord<Rika> i dont think non-string literals can be raw
00:26:10*rnrwashere joined #nim
00:28:06*ksandvik quit (Quit: Leaving.)
00:29:52*Vladar quit (Quit: Leaving)
00:31:15*krux02_ joined #nim
00:33:36*krux02 quit (Ping timeout: 256 seconds)
00:35:15*rnrwashere quit (Remote host closed the connection)
00:36:35*rnrwashere joined #nim
00:41:33FromDiscord<exelotl> a string is only passed as raw if there is no space between the proc and the string
00:41:38*couven92 joined #nim
00:43:00FromDiscord<exelotl> i.e. `echo"hello\nworld"` is different to `echo "hello\nworld"`
00:43:11*noonien quit (Quit: Connection closed for inactivity)
00:46:05FromDiscord<Rika> huh. thats good to know
00:46:35*NimBot joined #nim
00:59:47*rnrwashere quit (Remote host closed the connection)
01:00:19*qbradley joined #nim
01:00:34qbradleyIs it possible to have a branch of an object variant with no fields?
01:00:42leorize@Recruit_main707: you can't because Nim identifier can't start with an underscore
01:00:52leorizeqbradley: yes, put discard in that branch
01:00:59qbradleyok thanks
01:01:12qbradleyit works. perfect!
01:03:03*rnrwashere joined #nim
01:09:12*krux02_ quit (Remote host closed the connection)
01:14:18FromGitter<awr1> what does ctoring a `ref object` do (e.g. `SomeObject(foo: 1, bar: 2)`, if `SomeObject` were defined to be `ref object` in the type) does it implictly call `new`?
01:14:46FromDiscord<Rika> nope
01:14:54FromDiscord<Rika> ah wait misunderstood
01:15:04FromDiscord<Rika> hm, im not sure what happens to the contents
01:15:43FromDiscord<Rika> yes it works awr1
01:15:54FromDiscord<Rika> it's implicitly `new`'d it seems
01:16:38FromGitter<awr1> thanks
01:19:43*couven92 quit (Read error: Connection reset by peer)
01:20:07*couven92 joined #nim
01:23:18FromDiscord<KingDarBoja> "i dont think non-string literals can be raw" yikes!
01:27:21FromDiscord<Rika> i honestly dont know okay
01:30:16*chemist69 quit (Ping timeout: 256 seconds)
01:30:42FromDiscord<KingDarBoja> I know, just reacting 😛
01:30:47*rnrwashere quit (Remote host closed the connection)
01:32:18*chemist69 joined #nim
01:36:23*rnrwashere joined #nim
01:48:16*rnrwashere quit (Remote host closed the connection)
01:56:01*dwdv quit (Ping timeout: 264 seconds)
02:09:44leorizeKingDarBoja: non-string literals can't be raw? what does that even mean?
02:12:22disruptekdepends on who is uttering them, usually.
02:14:51FromDiscord<Rika> you should ping me lmao
02:15:21FromDiscord<Rika> also i mean if its not a literal string i dont think you can make it raw exactly since there are many representations no?
02:16:16leorize"raw" string is a properly of Nim source code :p
02:16:40leorizeproperty*
02:19:56disrupteki can make it as raw as you want, sweetheart.
02:23:36FromDiscord<KingDarBoja> I am getting sick of trying to handle strings, chars and unicode stuff xD as Python handles all of them as string type
02:24:21disruptekshow off.
02:24:42disruptekima stream some more obs plugin stuff for an hour or two.
02:25:10leorizea lot of languages like to impose that strings must contain valid text
02:25:41*ksandvik joined #nim
02:28:16FromDiscord<KingDarBoja> For example -> "\uFEFF foo" length is 7 on Nim whereas in Python is 5...
02:28:16FromDiscord<Rika> shouldnt they?
02:35:27*ksandvik quit (Quit: Leaving.)
02:43:22*muffindrake quit (Ping timeout: 256 seconds)
02:45:13*muffindrake joined #nim
02:45:23*defection joined #nim
03:02:32FromDiscord<Varriount> @KingDarBoja https://nim-lang.org/docs/unicode.html#runeLen%2Cstring
03:03:11FromDiscord<KingDarBoja> Intriguing...
03:03:16FromDiscord<Varriount> Nim strings use bytes for indexing (as that is the fastest method, and generally works). For UTF encoding, the unicode module should work.
03:04:51FromDiscord<Varriount> Otherwise, `s[i]` would have to iterate through the whole string to find out which rune is at that index.
03:05:11FromDiscord<Varriount> You'll notice that only ascii specific stuff is in strutils
03:06:19FromDiscord<KingDarBoja> 🤔
03:07:45FromDiscord<Varriount> @KingDarBoja For example, https://nim-lang.org/docs/strutils.html#count%2Cstring%2Cstring%2Cbool
03:08:01FromDiscord<Varriount> works with any encoding, assuming that your arguments are all the same encoding
03:08:33FromDiscord<Varriount> @KingDarBoja What are you trying to do? Could you show your code?
03:09:05FromDiscord<KingDarBoja> I do rather push my changes and share the repo as I mentioned before, doing Graphql port from Python into Nim
03:09:18FromDiscord<Varriount> Huh, interesting
03:09:26FromDiscord<KingDarBoja> Right now at the lexer, which is "done"
03:09:37FromDiscord<KingDarBoja> But not really lol as the tests aren't passing at all
03:09:43FromDiscord<KingDarBoja> Give me 10 minutes...
03:20:43FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate there you go, the main issue right now are the first two tests on test_lexer.nim
03:23:34FromDiscord<Varriount> They are failing?
03:25:43FromDiscord<KingDarBoja> Kinda, "Disallows uncommon control characters" one does work but not as it should be as I had to change the message slighty to match the one from the ValueError
03:26:24FromDiscord<Varriount> Line 32 looks redundant/not needed, unless your input source isn't containing the hex character `\x07`, but the actual string represented by `'\' & 'x' & '0' & '7'`
03:26:25FromDiscord<KingDarBoja> The next one "Accepts Bom header" is the unicode related, struggling with it due to my lack of knowledge
03:26:27*my_dude joined #nim
03:26:57FromDiscord<Varriount> Sorry, line 33
03:27:38FromDiscord<KingDarBoja> I see... to be fair, the correct message should be "Cannot contain the invalid character '\\x07'."
03:28:01FromDiscord<KingDarBoja> Notice the raw string being outputed instead of '\\7' as it does now :/
03:28:08FromDiscord<KingDarBoja> at the output*
03:28:25FromDiscord<Varriount> A raw string literal is a string literal in which escapes aren't processed (as in, what the programmer writes is what will be in the string).
03:29:11FromDiscord<KingDarBoja> Just as reference to the source tests -> https://github.com/graphql-python/graphql-core/blob/master/tests/language/test_lexer.py#L33
03:29:21FromDiscord<Varriount> Where's the entry point for the lexer?
03:30:17FromDiscord<KingDarBoja> There is none atm, just building the modules one by one
03:30:41FromDiscord<Varriount> Generally, you just explicitly check for the BOM
03:31:54FromDiscord<Varriount> Then, you use that with your lexer to rearrange the bytes as they are read.
03:32:28FromDiscord<KingDarBoja> I don't understand what are you saying mate
03:32:43FromDiscord<Varriount> Hm
03:32:57FromDiscord<Varriount> Do you know what the byte order mark signifies?
03:33:06FromDiscord<KingDarBoja> Think like I just want to get the lexer.py file and convert into lexer.nim ,that's it
03:33:12FromDiscord<KingDarBoja> Oh yes
03:33:26FromDiscord<Varriount> Can you show me the original python source?
03:34:10FromDiscord<KingDarBoja> Sir, yes sir -> https://github.com/graphql-python/graphql-core/blob/master/src/graphql/language/lexer.py
03:36:25*my_dude quit (Quit: ZZZzzz…)
03:37:17FromDiscord<Varriount> So this: https://github.com/KingDarBoja/Phosphate/blob/master/src/language/lexer.nim#L122
03:37:57*FromDiscord <KingDarBoja> Why the hell my face still showing as profile pic on GitHub lol
03:38:15FromDiscord<Varriount> I just see an anime character
03:38:37FromDiscord<KingDarBoja> I see my old profile pic, anyway, continue sir with the lesson 🙂
03:41:11FromDiscord<Varriount> @KingDarBoja Are you familier with the size of a character type vs the size of a unicode rune/glyph/etc?
03:41:50FromDiscord<KingDarBoja> No, I think that's what you explained few comments ago with the unicode lib vs len()
03:43:12FromDiscord<KingDarBoja> But I assume you are being more technical
03:43:47FromDiscord<Varriount> So, text data has to be encoded in some way - the characters we see have to have representations as actual data.
03:44:44FromDiscord<Varriount> Some encodings encode a character (such as 'a') in using 8 bytes of memory, 16 bytes of memory, or 32 bytes of memory
03:45:52FromDiscord<Varriount> Some encodings might represent the character 'a' as the number '61' in memory
03:46:05FromDiscord<Varriount> Some might represent 'a' as 1
03:46:20FromDiscord<Varriount> It's up to the program to interpret this data correctly.
03:46:53FromDiscord<Varriount> The most common encodings are ascii, UTF8, UTF16, and UTF32.
03:47:04FromDiscord<KingDarBoja> Yes
03:47:26FromDiscord<Rika> ~~utf8 is variable byte count encoding~~
03:48:02FromDiscord<Varriount> Yes, and some encodings may use a different number of bytes to represent different characters.
03:48:28FromDiscord<Varriount> Now, it's important to know the difference between a character (the letter) and char (the data type).
03:48:56FromDiscord<Varriount> A character is an abstract representation of a piece of text, separate from encoding.
03:49:16FromDiscord<Varriount> A char is a data type, usually composed of 8 bytes.
03:50:20FromDiscord<Varriount> When you use `stringVar[i]` in Nim, you are saying, "give me the i'th char in the string"
03:51:42*my_dude joined #nim
03:52:30FromDiscord<Varriount> When you use `unicode.runAtPos(stringVar, i)`, you are saying, "give me the i'th utf-8 character in the string"
03:53:55FromDiscord<Varriount> The reason these are different is that utf-8 is a variable-width encoding. In order to find the i'th utf-8 character in the string, you first have to find the length of the first character, then the length of the second character, etc.
03:54:07disruptekwho was working on a wlroots wrapper?
03:54:35FromDiscord<KingDarBoja> Ah...
03:54:45FromDiscord<Varriount> It's like trying to find the i'th word in a sentence. You can't just say "the 4th word is always going to be here", because words vary in length
03:54:50FromDiscord<KingDarBoja> Just tested what you said...
03:55:28FromDiscord<KingDarBoja> var b = "ánt text" -> echo b[0] yields some � whereas echo runeAtPos(b, 0) yields "á"
03:55:56FromDiscord<Varriount> Yes, becuase `á` is represented by more than 1 byte
03:55:56FromDiscord<KingDarBoja> I thought char was taking care of that but was wrong
03:56:27FromDiscord<Rika> this aint python
03:56:55FromDiscord<Varriount> Python essentially uses `unicode.runeAtPos` for everything. While this makes it easier for programmers to work with textual data, it slows down string access.
03:57:20FromDiscord<Varriount> And/or makes strings take up more space, depending on the version of python you are using.
03:57:38FromDiscord<KingDarBoja> I know, these kind of assumptions are the reason I get confused
03:58:25FromDiscord<KingDarBoja> That was a great explanation, indeed
03:58:44FromDiscord<Varriount> https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
03:59:49FromDiscord<Varriount> I would suggest reading through the unicode module and Wikipedia, and posting any question you have here.
04:00:09FromDiscord<Varriount> I'm not an expert with that module (or with utf-8), but I can try my best.
04:00:48FromDiscord<KingDarBoja> Essentially I am getting the character but without taking into account the rune itself
04:01:44FromDiscord<KingDarBoja> But got another question based on that, does that take care of hex values, the ones with "\xHH"?
04:02:13FromDiscord<KingDarBoja> https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
04:04:11FromDiscord<Varriount> What do you mean by "does that"?
04:05:01FromDiscord<KingDarBoja> Unicode only takes care of "\uHHHH", right?
04:06:22FromDiscord<Varriount> A Unicode character can be represented by "\uHH", just not all Unicode characters.
04:07:28FromDiscord<KingDarBoja> And the hex values are handled differently, I assume (i.e. "\xHH")
04:07:40FromDiscord<Varriount> Rika: Any idea how "\uFEFF" translates to 3 bytes instead of 2?
04:07:49FromDiscord<Varriount> @Rai Nathan Famakai II
04:07:59FromDiscord<Varriount> @Rai Nathan Famakai II
04:08:15FromDiscord<Varriount> @Rika
04:08:28FromDiscord<Rika> oof rip other dude
04:08:30FromDiscord<Rika> one moment
04:08:33FromDiscord<KingDarBoja> lol
04:10:09FromDiscord<Rika> hm
04:12:54FromDiscord<Rika> because `\uFEFF` is not `\xFE\xFF` im inferring
04:13:28*opal quit (Remote host closed the connection)
04:13:41FromDiscord<Rika> `\uFEFF` is 3 bytes as 3 "unicode bytes" can hold 2 "data bytes"
04:13:57FromDiscord<Rika> a few bytes are used to determine length and "continuation bytes"
04:14:13FromDiscord<Rika> `s/few bytes/ few bits`
04:14:25FromDiscord<Rika> @Varriount @KingDarBoja
04:14:42*opal joined #nim
04:14:44FromDiscord<Rika> https://en.wikipedia.org/wiki/UTF-8#Description you can see here
04:15:35*my_dude quit (Quit: ZZZzzz…)
04:15:36FromDiscord<Varriount> Ah, gotcha
04:17:02*my_dude joined #nim
04:19:25FromDiscord<Rika> `\uFEFF` means that whatever the data bytes would be, the data `FEFF` would be in them on read
04:20:22FromDiscord<Rika> so `1110 F | 10 E F[part1] | 10 F[part2] F` im assuming is what it would look like
04:20:30*waleee-cl quit (Quit: Connection closed for inactivity)
04:21:25FromDiscord<Rika> so `1110 1111 | 1011 1011 | 1011 1111`
04:21:27disruptekfwiw yuri has a wayland lib
04:21:30disruptek!repo wayland
04:21:31disbothttps://github.com/yglukhov/wayland -- 9wayland: 11Nim bindings for wayland 15 5⭐ 1🍴 7& 1 more...
04:21:39FromDiscord<Rika> oh wow
04:22:14disrupteki plan to write something to scale surfaces using it.
04:28:20shashlickCan't do anything without a laptop
04:29:36*my_dude quit (Quit: ZZZzzz…)
04:39:11leorizedisruptek: lqdev[m] is working on that
04:42:21*rockcavera quit (Remote host closed the connection)
04:48:53*rnrwashere joined #nim
04:53:26*rnrwashere quit (Ping timeout: 258 seconds)
04:53:38*dddddd quit (Remote host closed the connection)
04:57:00*Asgaroth quit (Read error: Connection reset by peer)
04:57:06*Asgaroth_ joined #nim
05:23:03*my_dude joined #nim
05:24:22*my_dude quit (Client Quit)
05:28:58*silvernode joined #nim
05:52:22kungtottedisruptek: I don't think I'll be using nimph. There's just too many headaches at this point. I'm playing around trying to see how to fix all the issues I'm having and now it won't even let me install version-pinned packages. A plain requires or a minimum version works fine, but pinned packages errors out with "tried to clone into <path> but it already exists".
05:53:42*dadada joined #nim
05:54:05*dadada is now known as Guest35429
06:12:21*Guest35429 quit (Ping timeout: 256 seconds)
06:41:33*nsf joined #nim
06:51:34*narimiran joined #nim
06:58:16*silvernode quit (Ping timeout: 256 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:02:51*thomasross quit (Ping timeout: 250 seconds)
07:05:04*gmpreussner joined #nim
07:13:43*nsf quit (Quit: WeeChat 2.7)
07:55:28*my_dude joined #nim
08:09:22FromDiscord<Benumbed> Could I ask for a second pair of eyes on this code? I'm trying to write a dispatch table for RPC methods coming in over the wire, only what I thought would work, doesn't....
08:09:22FromDiscord<Benumbed> https://play.nim-lang.org/#ix=2fR5
08:09:46FromDiscord<Varriount> @Benumbed I can take a look
08:09:52FromDiscord<Benumbed> Thanks...
08:10:30FromDiscord<Benumbed> I think my C/C++ experience may be pushing how I think about this in the wrong direction?
08:11:01FromDiscord<Benumbed> (more C++ than C, I haven't written C in years)
08:12:00*sleepyqt joined #nim
08:13:14FromDiscord<Varriount> @Benumbed: From what I'm observing, Nim is determining the type of the map by the type of the first keys
08:13:43FromDiscord<Benumbed> Yeah except the type should be a ref to AMQPMethodObj
08:14:03FromDiscord<Varriount> And the type of the first key is `(int, proc (stream: Stream): ConnectionStart {.....})`
08:14:22FromDiscord<Benumbed> ConnectionStart refers back to AMQPMethodObj though
08:14:37FromDiscord<Varriount> The type of the second key is `(int, proc (stream: Stream): ConnectionStartOk{.....})`
08:15:05FromDiscord<Benumbed> ConnectionStart->AMQPMethodObj->AMQPMethodObj
08:15:05FromDiscord<Benumbed> ConnectionStartOk->AMQPMethodObj->AMQPMethodObj
08:15:27FromDiscord<Varriount> Two children of a parent type aren't directly equivalent.
08:16:07FromDiscord<Varriount> You have to create a container with their common parent type
08:16:45FromDiscord<Varriount> Also, two procedures that return different types *might* always be unequivalent? I'm not sure.
08:16:58FromDiscord<Varriount> (or is it inequivalent?)
08:17:15FromDiscord<Benumbed> No idea heh
08:17:57FromDiscord<Benumbed> So this isn't going to work like passing pointers to objects around in C++ as a pointer to their parent type?
08:18:32FromDiscord<Benumbed> (you have to cast the pointer to get the child-type back at the end)
08:18:39*tane_ joined #nim
08:18:52FromDiscord<Varriount> Hm, one moment
08:20:04FromDiscord<Varriount> https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
08:20:15FromDiscord<Varriount> "Different tuple-types are equivalent if they specify the same fields of the same type in the same order. "
08:20:15*filcuc joined #nim
08:20:52FromDiscord<Benumbed> 🤔
08:21:22FromDiscord<Varriount> The `{...}` construct is syntactic sugar for a sequence of tuples
08:21:57FromDiscord<Benumbed> Yeah, I'm trying a different way of packing values into the Table
08:22:06FromDiscord<Benumbed> that doesn't involve tuples, but it uglier
08:22:19FromDiscord<Varriount> I can't find anything in the manual stating equivalence of procedural types, but I know that you couldn't do something like this if there were arguments.
08:22:35FromDiscord<Varriount> Why do you need a map of methods?
08:24:05FromDiscord<Benumbed> So I'm writing a client library for the AMQP protocol, and AMQP is basically RPC over the wire. What I get back is a class ID and method ID that tell me what method the server wants to call. The rest of the data that follows those IDs is, essentially, the arguments to pass to the method
08:24:17FromDiscord<Varriount> Hm.
08:24:30FromDiscord<Benumbed> What I want is a dispatch table which will map those IDs to actual methods that get called
08:24:50FromDiscord<Benumbed> Because it simplifies things
08:25:04*my_dude quit (Quit: ZZZzzz…)
08:25:15FromDiscord<Varriount> Do the dispatch methods read arguments from the stream?
08:25:24FromDiscord<Benumbed> And all the data structures that get returned inherit from the 'AMQPMethod' structure
08:25:29FromDiscord<Varriount> And how are return types handled?
08:26:01FromDiscord<Benumbed> They read the raw values from the network yep (I basically read from a sock, and shove that into a StringStream)
08:26:01*my_dude joined #nim
08:26:22FromDiscord<Varriount> Do you know the entire set of methods at compile time?
08:27:01FromDiscord<Benumbed> I mean the spec is a static list of methods, so... yeah I think?
08:27:33FromDiscord<Varriount> Ok. And what will be done with the return type (AMQPMethodObj)?
08:27:57FromDiscord<Varriount> Sorry for the questions, but it helps to have a good picture of what the goal is.
08:28:05FromDiscord<Benumbed> No, no problems at all
08:28:46FromDiscord<Benumbed> The return type is basically just the collected data from the server, packged into a datastructure that looks like the spec
08:29:10FromDiscord<Benumbed> Hang on, I'm tired and I need to re-think my wording
08:30:16FromDiscord<Benumbed> I may be over-thinking this
08:30:39FromDiscord<Varriount> Is there a reason the dispatch methods can't write their result to a stream?
08:31:34FromDiscord<Benumbed> I mean theoretically they could, but there can be many open channels, all handling RPC calls + data
08:31:55FromDiscord<Benumbed> I think I need to sit down and draw this out
08:32:09FromDiscord<Benumbed> Because I'm no longer certain I have the right design here haha
08:32:49FromDiscord<Benumbed> Yeah I need to re-think this, thanks @Varriount 🙂
08:33:05FromDiscord<Benumbed> There may still be a need for a dispatch table, but not in this scope
08:35:57FromGitter<Vindaar> @Benumbed: this *might* work: https://play.nim-lang.org/#ix=2fRd
08:36:34FromGitter<Vindaar> I'm not experienced with inheritance in Nim though. I think wherever you use the resulting type then you have to convert it to the correct type
08:38:45FromDiscord<Benumbed> Yeah I have no problems casting it to the correct type, and yeah that might work, although after chatting with Varriount, I'm re-thinking my approach, I think was over-working the problem, and I may not even need methods that return anything
08:39:04FromDiscord<Benumbed> Which, in that case, makes said dispatch table very straightforward
08:39:13FromGitter<Vindaar> all the better!
08:40:01FromDiscord<Benumbed> It's honestly nice to have a community to bounce stuff off of that doesn't take off the top of your head when you're doing something dumb 😄
08:40:36FromGitter<Vindaar> I agree. Certainly also one of the reasons I stuck with Nim
08:40:56Zevvhttps://abe-winter.github.io/2020/03/28/jitu-brutus.html: "If you don’t know what a JIT is skip to the appendix or better yet, pick up Nim or something and never learn"
08:41:47FromDiscord<Benumbed> Yep, I've had my hands on my fair share of languages in my time and I really like Nim for many reasons
08:42:11FromDiscord<Benumbed> Now if only I could swap Nim and Go for number of jobs available hahaha
08:42:46FromGitter<Vindaar> @Zevv: haha. Although in isolation that sentence can be read as if to say people using Nim are dumb
08:42:55FromDiscord<Benumbed> (Writing Go makes me sad, using Go's package management system ends up with me having steam coming out of my ears)
08:44:02*Vladar joined #nim
08:44:39FromDiscord<Benumbed> lol yeah, in context it's a lot more flattering of the language 🙂
08:48:53FromDiscord<Varriount> Really? I haven't had much trouble with Go's package system
08:50:51FromDiscord<Varriount> I take it that it really improved once modules became a thing, though I have no experience with the system before that.
08:51:18FromDiscord<Benumbed> Modules have helped a ton, although I haven't touched it much since 1.13 came out and made them 'official'
08:51:26FromDiscord<Benumbed> Before that it was a hot mess
08:52:02FromDiscord<Benumbed> And that's coming from someone with a decade+ of Python experience... and _that_ is a screwed up packaging ecosystem
08:52:08FromDiscord<Varriount> Benumbed: From what I can gather, it's much like NPM/Yarn now - each project has it's own library of dependencies
08:52:16FromDiscord<Benumbed> Yep
08:52:45FromDiscord<Varriount> @Benumbed Oh man, I feel you. It feels like you need an astrophysics-level degree to actually do packaging right in Python.
08:53:26FromGitter<Vindaar> > astrophysics-level degree ⏎ I speak from experience. That doesn't help at all :P
08:53:58FromDiscord<Benumbed> I started learning Go to expand my job horizons (C++ and Python are my major ones atm), then I got moved to a new team at work because my expertise was apparently sorely needed, although I did not know NodeJS, which is what this team uses, so I have been learning: Go, NodeJs and Nim, all at the same time
08:54:11FromDiscord<Benumbed> Leading to some code mistakes that can be quite amusing
08:55:05FromDiscord<Benumbed> and yes Python packaging is _mental_
08:55:06FromDiscord<Varriount> I like Go because of it's simplicity - being able to just take a pointer to a object/struct and not have to worry about memory safety is nice - but it also tends to be overly conservative.
08:55:26FromDiscord<Benumbed> Agreed, it's got some _weird_ ideas about syntax too
08:55:46*my_dude quit (Quit: ZZZzzz…)
08:55:46FromDiscord<Benumbed> I found it hard to read at first, but that's just a learning cuve, I can read it just fine now
08:55:52FromDiscord<Varriount> I would love overloading (or at least default/optional parameters)
08:56:23FromDiscord<Benumbed> I should have started a list last month when I was working more in it
08:56:24FromDiscord<Varriount> It makes me cringe whenever I see that pattern where the constructor takes a variadic number of closures
08:56:44FromDiscord<Benumbed> Almost every day I was like "Who on earth made _that_ decision?! WHY?!"
08:57:24FromDiscord<Varriount> Like `thing := NewThing(OneOption(value), TwoOption(value), ThreeOption(value))`
08:57:46FromDiscord<Varriount> Because I know what actually has to be done in order to support that pattern behind the scenes.
08:58:18FromDiscord<Varriount> (The answer is closures and heap allocations.)
08:58:24FromDiscord<Benumbed> bleh
08:58:38FromDiscord<Benumbed> Oh that is one thing I do like about Nim
08:58:46FromDiscord<Benumbed> the let vs var stuff
08:58:54FromDiscord<Benumbed> despite how confused I get with JavaScript
08:59:15FromDiscord<Benumbed> let means I'm doing stack allocations, var means heap
08:59:30FromDiscord<Benumbed> it makes it very easy to see, at a glance, where my memory is coming from
08:59:36FromDiscord<Varriount> Eh.. not really?
08:59:51FromDiscord<Benumbed> Really? dammit, did I get something confused again?
09:01:01FromDiscord<Varriount> `let` just means the variable's value can't be changed. For objects, that mean's the object can't be modified, and for references, that means the reference can't be changed (but the memory it references can).
09:01:36FromDiscord<Varriount> @Benumbed If you want a (mostly correct) guide to where something is allocated:
09:02:00FromDiscord<Varriount> - Is the variable a reference type? It's on the heap.
09:02:14FromDiscord<Varriount> - Is the variable an object type? It's on the stack.
09:02:31FromDiscord<Varriount> - Is the variable captured by a closure? It's on the heap.
09:03:06FromDiscord<Varriount> That last one supersedes the first two.
09:03:12FromDiscord<Benumbed> That's actually quite helpful
09:03:46FromDiscord<Benumbed> See I remember reading about how types influenced allocations, but I think it got corrupted at some point
09:04:06FromDiscord<Benumbed> Which, given I'm learning 3 new languages, was probably bound to happen, servces me right 😄
09:04:18FromDiscord<Varriount> Of course, if you access an object type through a reference, it's also on the heap.
09:04:32FromDiscord<Benumbed> yeah
09:04:56FromDiscord<Varriount> And var types can be on the heap or stack (I think. Certainly they can be on the stack).
09:05:36FromDiscord<Varriount> Sorry, by `var` I mean `proc add[T](s: var seq[T], T)`.
09:06:58FromDiscord<Benumbed> That makes sense, since, in my mind, you're just getting a safe pointer to the data with that
09:07:15FromDiscord<Benumbed> rather than a read-only copy
09:07:28FromDiscord<Benumbed> copy may be the wrong word
09:07:48FromDiscord<Benumbed> ugh I need to go to bed, my brain is not cooperating anymore
09:08:06FromDiscord<Varriount> Sleep well. 🙂
09:08:15FromDiscord<Benumbed> Thx! Nice chatting with you 🙂
09:08:26*filcuc quit (Ping timeout: 256 seconds)
09:08:59FromGitter<Vindaar> good night!
09:14:54*natrys joined #nim
09:22:06*jjido joined #nim
09:23:49*dwdv joined #nim
09:55:59*opal quit (Remote host closed the connection)
09:57:33*dadada joined #nim
09:57:56*dadada is now known as Guest10057
10:01:57*opal joined #nim
10:03:09FromGitter<gogolxdong> Is there anything to take care of when accessing global seq from async proc with arc?
10:05:16FromDiscord<Varriount> gogolxdong: Make sure two async procedures accessing the sequence at the same time so so without race conditions
10:05:17FromGitter<gogolxdong> crashes randomly.
10:06:10*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:06:23FromGitter<gogolxdong> It crashes at echo the seq.len randomly.
10:11:10FromDiscord<Varriount> gogolxdong: Do you have range checks and stacktraces on?
10:11:36FromDiscord<Varriount> What does the sequence contain? And have you tried running the program with GDB?
10:11:42FromGitter<gogolxdong> Does release close these checks? I'm using release.
10:12:06FromGitter<gogolxdong> contains ref object
10:13:19FromDiscord<Varriount> Depends on the version of Nim you are using. I believe the latest version keeps range checks on, but turns stack traces off
10:13:25FromDiscord<kodkuce> when copile nim cna i suppress hints
10:13:36FromDiscord<kodkuce> its sometimes anyoing while debuging
10:13:46FromDiscord<Varriount> try using `-d:release --stacktrace:on --linetrace:on`
10:13:46FromGitter<gogolxdong> --hints:off
10:14:33FromDiscord<kodkuce> yep just duckduckit was blind
10:14:50FromDiscord<Varriount> Or, if you want to use GDB, use `-d:release --stacktrace:on --linetrace:on --debugger:native`
10:15:10FromGitter<gogolxdong> `Traceback (most recent call last) ⏎ httpbeast.nim(287) eventLoop ⏎ httpbeast.nim(219) processEvents ⏎ asyncmacro.nim(313) onRequest ⏎ asyncmacro.nim(34) onRequestNimAsyncContinue ... [https://gitter.im/nim-lang/Nim?at=5e80752eceb76448184266f2]
10:15:22FromDiscord<kodkuce> am not really debuging by debuger am just consol login it
10:16:12FromGitter<gogolxdong> the same with what I have.
10:16:41FromDiscord<Varriount> Looks like either the sequence is nil, or an element in it is nil
10:16:53FromDiscord<Varriount> I can't tell much without examining the code.
10:19:16FromGitter<gogolxdong> sequence is not nil by default? it crashes at the line of echoing sequence length.
10:19:45FromDiscord<Varriount> Hm, then something is off. Can you show me the code?
10:20:06FromGitter<gogolxdong> https://play.nim-lang.org/#ix=2fRA
10:21:17FromGitter<gogolxdong> It compiles with a httpbeast based websocket library.
10:21:31FromGitter<gogolxdong> Do you need it?
10:22:18*Arrrrrrrrrrrrrrr joined #nim
10:22:48FromDiscord<Varriount> Try initializing the sequence explicitly
10:23:32ArrrrrrrrrrrrrrrHello there. Is it possible to preserver the ast structure when printing it to str? https://play.nim-lang.org/#ix=2fRN
10:23:44Arrrrrrrrrrrrrrr*preserve
10:24:56FromDiscord<Varriount> Do you mean preserve the original formatting of the code?
10:25:03ArrrrrrrrrrrrrrrThat is
10:25:19FromDiscord<Varriount> No. Formatting information isn't encoded in the AST
10:26:29ArrrrrrrrrrrrrrrUggh. Thanks anyway, see you.
10:26:36*Arrrrrrrrrrrrrrr quit (Remote host closed the connection)
10:26:40FromGitter<gogolxdong> not the cause, still crashes when I refresh browser which establishes new connection to server.
10:27:35FromGitter<gogolxdong> do you mean var clients = newSeqClient () by explicitly?
10:28:03FromDiscord<Varriount> Yeah
10:28:43FromGitter<gogolxdong> doesn't get it work.
10:30:43FromDiscord<Varriount> Hm
10:32:15FromDiscord<Varriount> I notice that your procedure is annotated with gcsafe, even though it isn't.
10:32:17FromDiscord<Varriount> > We call a proc p GC safe when it doesn't access any global variable that contains GC'ed memory (string, seq, ref or a closure) either directly or indirectly through a call to a GC unsafe proc.
10:33:17*jjido joined #nim
10:33:31FromGitter<gogolxdong> sure, but how to get it working without gcsafe enforcement.
10:33:58FromDiscord<Varriount> Pass the sequence around in a central server object?
10:50:16*PMunch joined #nim
10:56:31FromDiscord<kodkuce> hi, am scraping some site want to make some food died for me 🙂 , so duno why but i noticed that xml.querySelectorAll(".row-hover tr") is destroying 1 coulmn for just 1 row in 925 rows, i think its a bug, cuz when i echo just get request with | grep Krast
10:56:31FromDiscord<kodkuce>
10:56:35FromDiscord<kodkuce> <td class="column-1"></td><td class="column-2"><a href="Krastavac,">https://www.tablicakalorija.com/povrce/krastavac-oguljen.html">Krastavac, oguljen</td><td class="column-3">12</td><td class="column-4">2,16</td><td class="column-5">0,59</td><td class="column-6">0,16</td><td class="column-7">Povrće</td>
10:56:36FromDiscord<kodkuce>
10:56:36FromDiscord<kodkuce> but after doing xml.querySelectorAll(".row-hover tr") i get those rows but just for this row it disapires column-3 for some reason
10:56:40FromDiscord<kodkuce> <td class="column-1" /><td class="column-2"><a href="Krastavac,">https://www.tablicakalorija.com/povrce/krastavac-oguljen.html">Krastavac, oguljen</a>12</td><td class="column-4">2,16</td><td class="column-5">0,59</td><td class="column-6">0,16</td><td class="column-7">Povrće</td>
10:58:43FromDiscord<kodkuce> var client = newHttpClient()
10:58:43FromDiscord<kodkuce> var g = client.getContent("https://www.tablicakalorija.com/")
10:58:43FromDiscord<kodkuce> echo g
10:58:44FromDiscord<kodkuce> let xml = parseHtml(newStringStream(g))
10:58:44FromDiscord<kodkuce> echo xml #here its allready broken
10:59:43FromDiscord<kodkuce> duno form where this %22 came i just copy pasted but if anyone wants to check it should be whitout it just dot com
11:00:07FromDiscord<Varriount> Please don't post code in the chat. Use a pasting service like gist
11:00:14*Guest10057 quit (Ping timeout: 256 seconds)
11:00:29FromDiscord<kodkuce> want me to repost with gist or something?
11:00:39FromDiscord<kodkuce> or just for future 🙂
11:03:29FromDiscord<Varriount> Just for the future
11:04:23FromDiscord<Varriount> If it's a bug, the file an issue and (ideally) find a fix
11:06:43FromDiscord<kodkuce> http://ix.io/2fRT can someone just confirm so i dont open for nothing
11:09:44FromDiscord<Varriount> Are you downloading HTML, or XML?
11:10:32FromDiscord<kodkuce> html i think
11:10:37FromDiscord<kodkuce> hmm 🙂
11:11:00FromDiscord<kodkuce> does nim have seprate html parser 🙂
11:11:19FromDiscord<kodkuce> lol
11:11:44FromDiscord<kodkuce> but ye i am using htmlparser
11:11:52FromDiscord<kodkuce> i just named it xml for some reason
11:12:09FromDiscord<Varriount> It looks like a bug. I don't know enough about HTML to be certain
11:12:43FromDiscord<kodkuce> np i in no hurry will recheck myself too
11:13:23FromDiscord<Varriount> I'd run the website's HTML through a validator to check that it's valid
11:14:44FromDiscord<kodkuce> curl gives normal output and echo g gives normal output (at least for manualy reading that coulmn) too so i think it brokes with htmlParser,
11:14:44go|dfishthe html is broken, there is no closing </a> tag
11:15:09FromDiscord<kodkuce> where
11:15:27FromDiscord<Varriount> Curl doesn't parse HTML, does it? It just grabs data from a URL
11:15:57FromDiscord<kodkuce> <a href="https://www.tablicakalorija.com/povrce/krastavac-oguljen.html%22%3EKrastavac, oguljen</td>
11:15:57go|dfish<td class="column-2"><a href="Krastavac,">https://www.tablicakalorija.com/povrce/krastavac-oguljen.html">Krastavac, oguljen</td>
11:16:01FromDiscord<kodkuce> yep you right
11:16:40FromDiscord<kodkuce> dude probbaly dumped this in DB as a text
11:16:49FromDiscord<kodkuce> ok sorry my bad
11:16:57FromDiscord<kodkuce> or his bad 🙂
11:18:01*krux02 joined #nim
11:19:14*dadada joined #nim
11:19:37*dadada is now known as Guest68723
11:23:19go|dfishwell it may not be your bad, i tried that broken html with 'lxml' and python's beautifulsoup just to test, and they both add in the </a> tag but keep the correct amount of columns - so perhaps it could still be classified as a "bug"
11:24:50FromDiscord<kodkuce> that is probbaly a feature and not a bug, like fix broken a tags before try parse 🙂
11:25:21go|dfishyeah, quite possibly
11:29:25PMunchHmm, dadada, you on?
11:42:46FromDiscord<Varriount> go|dfish: It's the question "how hard do we want to parse bad input?"
11:43:57FromDiscord<Varriount> go|dfish, @kodkuce See also https://devblogs.microsoft.com/oldnewthing/20200304-00/?p=103527
11:44:17go|dfishWill check it out - thanks
11:51:23*filcuc joined #nim
12:00:09FromDiscord<kodkuce> 🙂
12:10:11*acidx quit (Ping timeout: 260 seconds)
12:10:30*acidx joined #nim
12:12:27*dddddd joined #nim
12:24:05*Guest68723 quit (Ping timeout: 265 seconds)
12:25:29*dadada joined #nim
12:25:53*dadada is now known as Guest1320
12:40:16*endragor joined #nim
12:45:32*endragor quit (Remote host closed the connection)
12:49:45*rnrwashere joined #nim
12:54:32*rnrwashere quit (Ping timeout: 265 seconds)
12:56:15krux02Araq: Does it feel satisfying to close my PRs with far fetched reasons?
13:03:20dom96:/
13:05:43*opal quit (Ping timeout: 240 seconds)
13:08:47FromDiscord<kodkuce> uber dumb question duno if i am blind but how to remove all whitespaces form string, i am scroling strutils up and down but i think i am blind
13:09:06*opal joined #nim
13:10:07FromDiscord<kodkuce> guess i can use replace but then would need 3 time for newlines and similar, tough in my case i have only " " so guess that would do
13:12:43krux02kodcuce, probably with `filter`
13:13:14FromDiscord<Varriount> krux02: Is this about the unexported fields PR?
13:13:21narimiran`replace(" ", "')`
13:14:10*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:14:19FromDiscord<Varriount> @kodkuce: https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D
13:14:20FromDiscord<kodkuce> yep i used that narimiran , touqh did you misstype last " and wrote ' insted
13:14:48narimiranof course
13:15:46krux02Varriount: yes it is.
13:18:53*waleee-cl joined #nim
13:20:26FromDiscord<Varriount> krux02: I mean, there are valid points for keeping those members. Wouldn't their removal affect compile-time sizeof?
13:21:05krux02Varriount: that is exactly what I explained
13:21:18krux02compile time sizeof is not affected by the fields of types imported from C.
13:21:44FromDiscord<Varriount> I mean, in a macro, or compile-time proc
13:23:24FromDiscord<Varriount> I get that the generated C code will use the C compiler's `sizeof`, but aren't there (admittedly few) cases where sizeof needs to be known in macros, etc?
13:23:25FromGitter<gogolxdong> How to implement object pooling with arc?
13:24:35FromGitter<gogolxdong> Will it be issue-free like using array of ref object instead of sequence?
13:24:56FromDiscord<Varriount> gogolxdong: Do you need object pooling? Memory allocation is fairly fast
13:25:20FromGitter<gogolxdong> Only if it can solve my problem.
13:25:45FromGitter<gogolxdong> There isn't any document about this , is it?
13:25:49FromDiscord<Varriount> gogolxdong: I think your problem is that you are accessing globals from a section of code marked as gcsafe
13:26:06FromDiscord<Varriount> And gcsafe code isn't supposed to access globals
13:26:13FromGitter<gogolxdong> array won't be gc'ed right?
13:26:20FromDiscord<Varriount> Well, yes
13:27:08FromGitter<gogolxdong> Does it count as object pooling? Is there a pattern of doing so, or just make it array?
13:27:42FromDiscord<Varriount> Just make an array, and have some flag in an object that shows whether it's in-use or not.
13:27:55FromDiscord<Varriount> But you can't reallocate an array
13:32:27*sleepyqt quit (Quit: Leaving)
13:40:54*arecaceae quit (Read error: Connection reset by peer)
13:41:11*arecaceae joined #nim
13:42:25FromDiscord<Varriount> krux02: Are these failures, or warnings? I can't tell - https://github.com/nim-lang/Nim/pull/13793/checks?check_run_id=542534454
13:42:26disbotunify tuple expressions
13:43:15*aEverr quit (Ping timeout: 250 seconds)
13:43:40krux02Varriount: They are failures.
13:43:47krux02I am currently looking into them.
13:43:53*aEverr joined #nim
13:44:04krux02The failure in ast_pattern_mathcing I thought I fixed. On my machine I don't get a problem anymore.
13:44:32krux02That one was also an expected failure, because I had a test in there to ensure the AST doesn't change (so that I know if the ast changes and can adopt).
13:44:38krux02easy fix.
13:45:05FromDiscord<Varriount> I don't suppose there's a way to make the change backwards compatible?
13:47:12dom96yay, glad my repro is useful
13:47:19dom96I was afraid I'd be told "You're using it wrong"
13:48:06krux02dom96, what repro are you talking about?
13:48:55FromGitter<gogolxdong> How to construct derived object variable from base object variable , say `type Client = ref object of AsyncWebSocket`, I have `var ws: AsyncWebSocket`, how to build `var client:Client`
13:49:08dom96krux02, #13794
13:49:09disbothttps://github.com/nim-lang/Nim/issues/13794 -- 3hashset regression ; snippet at 12https://play.nim-lang.org/#ix=2fOK
13:49:23PMunchHmm, what do you guys use for streaming?
13:50:01krux02PMunch, twitch
13:50:13krux02and obs studio
13:50:21PMunchHave they relaxed their "only games" policy?
13:50:46dom96that hasn't been a thing ever since I can remember
13:50:48FromDiscord<Recruit_main707> i used streamlabs obs, and even though its very intuitive, its very consuming. so probably obs studio is the best option
13:51:27FromDiscord<Recruit_main707> btw is version 1.1 devel?
13:51:41dom96yes
13:51:55FromDiscord<Varriount> PMunch: I listen to disruptek's stream
13:52:07FromDiscord<Recruit_main707> how much do you calculate for 1.2 to be released?
13:52:07FromDiscord<Varriount> He works on the compiler.
13:55:56PMunchdom96, I'm pretty sure that was a thing in the beginning..
13:56:06PMunchVarriount, oh cool
13:56:21PMunchI was just considering to stream me hacking on something, for lack of anything better to do
13:58:58FromDiscord<Varriount> PMunch: I'd listen to it.
13:59:17FromDiscord<Varriount> Though, I might not watch it. Hard to watch video and program at the same time.
13:59:44*solitudesf joined #nim
13:59:46FromDiscord<Varriount> What are you thinking of doing?
14:00:02PMunchProbably trying to fix some of the issues dadada brought up about macroutils
14:05:57*kungtotte quit (Read error: Connection reset by peer)
14:06:14*kungtotte joined #nim
14:11:09FromDiscord<Varriount> PMunch: Well post a link when you get things up and running
14:11:37PMunchI wont do it just yet, have to go out and shovel some snow first :P
14:13:08dom96ahh, would love some snow right about now
14:13:52PMunchYou can have some of ours..
14:14:02PMunchI can barely get out the front door because of all the snow
14:17:22FromDiscord<Varriount> Meanwhile, the weather roulette has decided to grace the East coast of the US with traditionally seasonal weather for once.
14:17:45FromDiscord<Varriount> (Cool, with mild rain showers)
14:19:13*lritter joined #nim
14:20:07disruptekin new york, it's raining men.
14:20:15FromGitter<zetashift> Hallelujah?
14:20:21dom96nooo, don't put that song in my head
14:22:59FromGitter<zetashift> just let it in dom96
14:23:20Zevvdom96: you don't really care for music, do ya?
14:25:33disruptekzevv lives
14:25:51disruptekdude, let's build some corona badges running nim.
14:26:28dom96so, good news, my game can handle 60 fps on Android. All I needed to do was build in release mode and add `APP_OPTIM := release` to my Android.mk file :)
14:32:13PMunchNice!
14:32:18*silvernode joined #nim
14:32:22PMunchWhat phone though?
14:32:41dom96One Plus 3T
14:33:19PMunchGood, it wouldn't be that impressive if it was a top-tier flagship :P
14:33:55dom96It gets an avg frame time of 12ms, so there should be room for older phones. Jumps up to 18ms when the camera zooms out, I'll be optimising that.
14:34:59*filcuc quit (Ping timeout: 252 seconds)
14:39:50dom96The next challenge: getting it to work with --threads:on so I can have ads in the game
14:59:26*Guest1320 is now known as dadada
15:00:55*chemist69 quit (Remote host closed the connection)
15:01:21*chemist69 joined #nim
15:01:50dadadaPMunch: I'll test any updates to macroutils you make, this graceful extract feature, that either returns a value to see if the input was extractable or not, or is usable inside an if-else-branch, would be really nice, sadly I didn't make much progress doing it myself, cause I get distracted a lot :-)
15:03:04PMunchI think it would need to take a block though
15:03:12PMunchBecause of scoping things
15:05:33*Trustable joined #nim
15:06:13dadadacan there be an else: at the end of the block? so either it executes the inside of the block, if the stuff got extracted, or you land in the else part and do something else with it (including repeating extractif with different ideas)
15:07:19*Kaivo joined #nim
15:09:23*liblq-dev joined #nim
15:09:40PMunchSure
15:09:46PMunchWell, it will be another do block
15:09:51*defection quit (Ping timeout: 260 seconds)
15:10:55PMunchIt would look like this: https://play.nim-lang.org/#ix=2fTd
15:11:05*PMunch quit (Quit: leaving)
15:11:33dadadaPMunch: to be useful, I think the thing needs to either find all the required (quoted) bits, or fail, if it's something in the middle, the user/coder would always have to check what's there and what aint there and what else there's potentially needed to parse based on that
15:12:34dadadaoh man, timeout
15:22:03leorizedom96: now I see why threading is evil :P
15:33:56dom96You couldn't see that before?
15:34:13FromGitter<timotheecour> hi @dom96
15:34:41FromGitter<timotheecour> can you please try https://github.com/nim-lang/Nim/pull/13800 and see if it fixes your problem?
15:42:56dom96Looks like it does
15:43:13dom96Tested it with my game and there is no perf degradation
15:43:28FromGitter<timotheecour> awesome
15:44:22FromGitter<timotheecour> thx for the reproducing example and sry for the regression
16:01:10*sepples joined #nim
16:04:52*rockcavera joined #nim
16:07:04*uu91 joined #nim
16:23:20*liblq-dev quit (Ping timeout: 265 seconds)
16:23:48*liblq-dev joined #nim
16:32:46*jjido joined #nim
16:44:12*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:00:09axionThat was a short debug, repro, fix, and merge lifetime. Nice work dom/tim
17:00:34*arecaceae quit (Remote host closed the connection)
17:01:37*arecaceae joined #nim
17:08:18*waleee-cl quit (Quit: Connection closed for inactivity)
17:10:14*jjido joined #nim
17:12:36*thomasross joined #nim
17:23:21*fredrik92 joined #nim
17:25:29*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:25:54*couven92 quit (Ping timeout: 240 seconds)
17:26:28*fredrik92 is now known as couven92
17:28:06FromGitter<rishavs> Hi. How would I set a seq as an object attribute? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e80daa649e7a8130cd7ae27]
17:35:04liblq-dev@rishavs `seq[Directions]`, not `newSeq[Directions](4)`
17:35:15liblq-devif you want a statically-sized array, use `array[4, Directions]`
17:35:16FromGitter<rishavs> Thanks!
17:35:36liblq-devbecause `newSeq[Directions](4)` creates a new sequence with the size of 4
17:35:41liblq-devand `seq` is a type
17:35:47FromGitter<rishavs> the seq can have anything from 0 to 4 items so I think i should stick toseq
17:36:04liblq-devuse whatever suits you best.
18:02:20reversem3How would you do a link list in nim ?
18:02:52reversem3 * How would you do a linked list in nim ? I'm (learning) from C to nim
18:03:10FromDiscord<Varriount> reversem3: Use a reference type to refer to itself
18:03:13shashlickthere's a lists module
18:03:19shashlicksee how it works
18:05:22*jjido joined #nim
18:06:06reversem3ahh ok very cool thanks
18:10:45*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:10:51reversem3so *head -> blockdata would be a type Node = ref Object firstBlock: head ?
18:12:26*dadada quit (Ping timeout: 256 seconds)
18:15:27reversem3or is it like this https://github.com/def-/nim-unsorted/blob/master/linkedlist.nim
18:18:29*dadada joined #nim
18:18:52*dadada is now known as Guest60132
18:22:00*clyybber joined #nim
18:26:14*clyybber quit (Client Quit)
18:38:06*dddddd quit (Ping timeout: 256 seconds)
18:38:51*rnrwashere joined #nim
18:42:20*rnrwashere quit (Remote host closed the connection)
18:42:52*rnrwashere joined #nim
18:47:44*rnrwashere quit (Ping timeout: 256 seconds)
18:48:51*rnrwashere joined #nim
18:51:47*rnrwashere quit (Remote host closed the connection)
19:08:34*xet7 quit (Remote host closed the connection)
19:09:33*xet7 joined #nim
19:09:58FromDiscord<exelotl> gonna re-post this userscript I made the other week: https://gist.github.com/exelotl/c0c4b79932d977869811e518b2198b8c
19:11:16FromDiscord<exelotl> it's been coming in super handy to me lately, cause search engines always take me to the stable docs
19:12:20*Vladar quit (Quit: Leaving)
19:13:26*Kaivo quit (Quit: WeeChat 2.7.1)
19:13:50FromDiscord<Rika> You can always just make a chrome search engine
19:14:00FromDiscord<Rika> Or a Firefox bookmark with keyword
19:18:13*junland quit (Quit: %ZNC Disconnected%)
19:18:55*junland joined #nim
19:20:06*waleee-cl joined #nim
19:27:08Yardanico@exelotls there's also a very great extension not a lot of people know about - https://chrome.google.com/webstore/detail/module-linker/dglofghjinifeolcpjfjmfdnnbaanggn?hl=en
19:27:33YardanicoIt supports Nim too, for both stdlib (although not for some new stdlib modules), files in same project or nimble
19:28:03Yardanicoalso no support for /[] import syntax, but I guess we can send a PR to add that
19:28:31Yardanicoalso no support for "import except" :D
19:28:58Yardanicoit looks like that - https://i.imgur.com/r2D4QPo.png
19:29:30Yardanicoand if you click it sends you to that module's github page, and for nim stdlib - to nim docs
19:29:45*xet7 quit (Remote host closed the connection)
19:34:00FromDiscord<exelotl> ohh that's cool
19:34:16Yardanicoseems it's also available for firefox - https://addons.mozilla.org/en-GB/firefox/addon/module-linker/
19:34:48Yardanicohttps://github.com/fiatjaf/module-linker no updates since sept though
19:37:09*xet7 joined #nim
19:43:36*xet7 quit (Remote host closed the connection)
19:45:18*PMunch joined #nim
19:47:28FromGitter<zetashift> is it stable enough that it needs no updates?
19:47:44*NimBot joined #nim
19:54:25PMunchreversem3, I saw you asking about linked lists earlier. If you are coming from C I just wanted to let you know that the more Nimian solution is to use a seq or sequence instead. Linked lists should really only be used if you actually need some very specific performance characteristics.
19:56:30Guest60132PMunch: (you didn't disconnect, this is a repeat from earlier) to be useful, I think tryExtract needs to either find all the required (quoted) bits, or fail, if it's something in the middle, the user/coder would always have to check what's there and what aint there and what else there's potentially needed to parse based on that
19:56:44*Guest60132 is now known as dadada
19:57:03PMunchAh yes I saw that, that was indeed the plan
19:57:10PMunchAnything else would just be silly
19:57:36*gangstacat quit (Quit: Ĝis!)
20:06:29*rnrwashere joined #nim
20:11:20*sleepyqt joined #nim
20:18:28*xet7 joined #nim
20:21:42PMunchHmm, I have something that start pulseaudio and keeps restarting it when I kill it
20:21:47PMunchBut I'm not sure what..
20:21:51Yardanicoyour DE :P
20:21:58PMunchI don't have one..
20:22:53Yardanicohmm, strange, pulseaudio usually starts when a DE starts it or some program which uses PulseAudio is launched
20:24:13*uvegbot quit (Ping timeout: 264 seconds)
20:24:45PMunchYeah, I'm not quite sure what's going on here..
20:26:39*rockcavera quit (Remote host closed the connection)
20:27:04*rockcavera joined #nim
20:28:26Zevvaaah pulse, one of the loves of my life
20:28:44YardanicoZevv: you forgot the /s :P
20:28:47Zevvthe other ones are systemd and network manager
20:29:00FromDiscord<Benumbed> gross Zevv haha
20:29:05PMunchAlways such a massive pain in the ass..
20:29:24ZevvInterestingy enough 2 out of 3 are by the same author
20:29:35PMunchbrb
20:29:36*narimiran quit (Quit: leaving)
20:29:36*PMunch quit (Quit: leaving)
20:29:39Zevvone can not simply kill pulseaudio
20:29:54Zevvone needs to use pasuspender
20:29:57YardanicoI have Void Linux (no systemd), so maybe I should try not using PA too, it shouldn't be too hard because I've already tried before
20:30:21ZevvI've been fighting audio on linux for decades
20:30:35ZevvI'd really prefer to run jack for everything, but it's not widely supported
20:30:43Zevvand there are apps these days that run on pulse only
20:30:49Yardanicowell, for alsa there's apulse
20:30:50Zevvso you need pulse, and pulse does not go together with jack
20:31:37FromDiscord<clyybber> acktually
20:32:13*PMunch joined #nim
20:32:18*jjido joined #nim
20:32:31leorizePMunch: if you have anything that requests pulseaudio it will keeps respawning
20:32:42leorizeedit /etc/pulse/client.conf and turn off autospawn
20:33:30FromDiscord<clyybber> I'm using pulseaudio alongside jack regularily
20:33:36FromDiscord<clyybber> and it was working happily
20:33:37PMunchAh, it should be fine now
20:33:41PMunchJust needed the ol' reboot
20:33:48FromDiscord<clyybber> but one day it started to fuck firefox up
20:34:28FromDiscord<clyybber> pulseaudio isn't in the same league as systemd or networkmanager imo
20:34:29leorizeI'm waiting for pipewire
20:34:32FromDiscord<clyybber> its way better
20:34:41FromDiscord<clyybber> leorize: Yeah pipewire looks promising
20:34:45leorizejack is nice and all, but pulseaudio just works :)
20:34:55FromDiscord<clyybber> jack just works too
20:35:01Zevvuntil you want to do something serious with sound
20:35:06Yardanicoor play osu! :D
20:35:25leorizejack works after a lot of tweaking and tuning the parameters :)
20:35:32FromDiscord<clyybber> eh
20:35:34leorizealso the docs are lacking
20:35:35Yardanico(osu! is a rhythm game so lower the latency -> the better, ofc you have to change the offset ingame if your latency is not 0ms)
20:35:47FromDiscord<clyybber> tuning the buffer size and stuff isn't gonna be helped by pipewire I think
20:35:50FromDiscord<Rika> oh no heres the osu dude
20:36:03FromDiscord<clyybber> said the other osu dude
20:36:04YardanicoI only have 2800pp, not really a good osu! player
20:36:14FromDiscord<Rika> i dont even have 2k
20:36:19FromDiscord<Rika> though i have 5k on ctb
20:36:24Yardanicowtf
20:36:31leorizeI stopped playing before pp was a thing :)
20:36:57ZevvI sometimes use ninjam for jamming over the internet. I was never widely used but over the last weeks it suddenly got pretty popular at once for some reason. It has a nice way of handling latency: it just delays all sound for a number of beats, and sends every individual track to all other participants after the round. I've been trying to explain the mechanism to my band mates, but they just can't see how it
20:37:03Zevvworks :)
20:37:36Yardanicoleorize: they're in the process of making an entirely new osu! client rn (osu!lazer), which is fully crossplatform (still written in C# and uses .net core)
20:38:03FromDiscord<clyybber> why are there so many osu clients
20:38:11FromDiscord<clyybber> I believe theres even one in nim
20:38:20leorizeI saw it, and I found out that I'm still bad at osu! :p
20:38:21Yardanicowell they're not exactly "osu clients"
20:38:39Yardanicothere's only 1 official one, and one in the works (osu!lazer), all others are technically osu! clones and not clients :P
20:38:54Yardanico@clyybber AFAIK there's only my osureplay lib for parsing osu! replays in Nim
20:39:16FromDiscord<clyybber> oh
20:39:21FromDiscord<clyybber> then that was that 😄
20:39:23leorizethere's also a pp calculator made by someone
20:39:26leorize!repo osu
20:39:37leorizedisbot?
20:39:40FromDiscord<Rika> im still working on mine ;;
20:40:19FromDiscord<clyybber> is there any particular reason why there are so many osu clients?
20:40:29FromDiscord<Rika> theyre not clients
20:40:34FromDiscord<clyybber> clones then
20:40:34FromDiscord<Rika> theyre just utility libraries
20:40:37FromDiscord<Rika> oh really?
20:40:39FromDiscord<Rika> dunno
20:40:44FromDiscord<Rika> because osu!stable isnt open source
20:40:48Yardanico@clyybber well, because they provide different options for customization and stuff
20:40:58Yardanicolike McOsu allows you to modify A LOT of stuff about beatmaps and the game
20:41:03Yardanicooshu is just a simple Java osu! clone
20:41:12Yardanico(McOsu is in C++ btw)
20:42:43Yardanicoleorize: for osu I only found https://github.com/de-odex/circa but it doesn't seem to calculate pp
20:42:50FromDiscord<Rika> IM NOT DONE YET
20:42:53FromDiscord<Rika> GOD
20:42:54FromDiscord<clyybber> haha
20:42:54FromDiscord<Rika> ;;
20:43:02FromDiscord<Rika> IM WORKING ON IT PLEASE ;;
20:43:17FromDiscord<Rika> i swear ill literally explode
20:43:28Yardanicoactually before discovering Nim I had a fork of a Python lib for calculating pp, and after that I rewrote it in Nim (just almost 1:1 translation by hand) but after that I just deleted it, i don't remember why :P
20:43:40Yardanicohttps://github.com/Yardanico/pippy
20:43:44FromDiscord<Rika> ok so yall know, i'm `de/odex` and `aEverr`, im only `Rika` in discord
20:43:50Yardanicolol
20:44:02Yardanico@Rika i'm gonna hard fork your circa lib!11
20:44:28FromDiscord<Rika> Yardanico maybe because francesco or whatever his name was already made `pyttanko`
20:44:47YardanicoNo, I mean I deleted the Nim version
20:44:54FromDiscord<Rika> huh
20:44:59FromDiscord<Rika> dunno then, you weird
20:45:11Yardanicoprobs because I saw oppai-ng (fast PP calculator in C) and became too depressed
20:45:18PMunchhttps://www.twitch.tv/pmunche
20:45:26FromDiscord<Rika> what's the e there for
20:45:29Yardanicowow PMunch can stream too
20:45:30PMunchTesting out to see if my streaming setup works
20:45:39leorizeso many people streaming these days
20:45:43Yardanicoi should start too
20:45:47FromDiscord<Rika> why's there an e on your name, is there really one?
20:45:54YardanicoI actually streamed Nim programming like 2 years ago
20:45:59FromDiscord<Rika> i "started" until i didnt
20:46:14leorizeah, the best way to test out a stream, showing how nimble doesn't work :)
20:46:47FromDiscord<Rika> lmao
20:47:06FromDiscord<Rika> Yardanico, since you mentioned it, ill continue with my lib now. reeee
20:48:02Yardanicoand I streamed the programming of my VKontakte (russian social network) bot in Nim, and had 3-7 viewers, that was on livecoding.tv btw (before it became an almost paid-only thing)
20:48:09Yardanicoahh good times
20:49:48leorizePMunch: your network is better than disruptek, I'm getting only 3s lag :)
20:54:28PMunchdadada, are you online?
20:54:49dadadaPMunch: yeah
20:55:34PMunchWhat was the other issue you had with extract?
20:55:40PMunchThe horizontal/vertical thing
20:56:48dadadaah, don't know if I'd call it issue, your approach might suffice, as long as getting the members in a type works
20:57:35FromDiscord<clyybber> @Rika lol so you were the guy that pinged everyone
20:57:58dadadaI thought it might be a good idea, to have something like `foo|` to contrast with `foo*`, yet it's probably not necessary
20:58:01PMunchdadada, yeah but what was your example?
20:58:08PMunchLike what was the actual issue
20:58:29PMunchYeah that's not necessary, but I wanted to make the * work properly
20:59:28dadadaI'm counting on you, I've put the work on macro on hold until this works
20:59:29dadada:-)
20:59:33dadadaon a
20:59:36*natrys quit (Quit: natrys)
21:03:04FromDiscord<Rika> NO
21:03:05FromDiscord<Rika> IM NOT
21:03:07FromDiscord<Rika> WHAT
21:03:14FromDiscord<Rika> ;;
21:04:05Yardanico?
21:04:10Yardanicoah lol
21:04:26FromDiscord<clyybber> @Rika I think you are 😄
21:04:42FromDiscord<Rika> ;; sorry
21:04:45FromDiscord<Rika> wasnt malicious
21:07:58dadadaPMunch: did you stream?
21:08:05PMunchI'm streaming now
21:08:14PMunchBut I'm mostly just testing that it works
21:08:16dadadawhere?
21:08:25Yardanicotwitch.tv/pmunche
21:08:53dadadathanks, PMunch, you need to keep posting the link here like disruptek does, this really motivates people to take a look
21:10:13dadadaI'm tuned in :-) what desktop do you use?
21:10:21PMunchi3
21:12:38PMunchkrux02, twitch.tv/pmunche
21:19:51*tane_ quit (Quit: Leaving)
21:20:10FromDiscord<Lantos> are you showing us some macro magic
21:21:55PMunchRight now I'm just messing about
21:22:03PMunchI was thinking about streaming me fixing macroutils
21:22:30PMunchBut it's getting late, so I'm not sure if I'll do that, or if I'll call it the night and just leave this stream as a test stream
21:23:09FromDiscord<Lantos> yes, the successful code streams seem to be like scheduled
21:25:06PMunchdadada, do you have the example that failed?
21:28:20Yardanico@Rika why LGPL-3 on your circa lib
21:28:26Yardanicokinda meh
21:28:42FromDiscord<Yardanico> @Rika
21:30:22FromDiscord<Yardanico> can you relicense it to MIT/Apache/BSD since you're the sole contributor to it (at the moment)? 😛
21:31:17leorizeor MPL if you love copyleft
21:31:50Yardanicothe Mozilla's one or Microsoft's one? :D
21:31:55leorizemozilla's
21:33:01Yardanicooh MPL is kinda nice
21:33:19Yardanicoit's really a good alternative for MIT/BSD if you want people to contribute to your project I guess
21:33:45leorizein Nim land, LGPL is the same as GPL, because we don't do dynamic linking
21:33:53Yardanicoyeah, that's the thing
21:34:07Yardanicothat's why I absolutely don't understand when people use LGPL or GPL for licensing libraries
21:34:26YardanicoI mean in languages where there's no dynamic linking :P
21:35:08Yardanicoa few weeks ago I asked one person on github why they licensed their nim libs in GPL, and they said that's why because their friend said "it's the best license"
21:35:15Yardanicothey relicensed them under MIT after that :)
21:36:38leorizewell gpl is not too bad, it's just not really great given the current status of nim ecosystem
21:36:48YardanicoI think I might consider using MPL for my future projects :P
21:37:39*gangstacat joined #nim
21:38:00*my_dude joined #nim
21:38:37FromDiscord<Rika> @Yardanico well the issue is i cannot tell whether i have to also respect `slider`'s license since i'm "copying" it, but its not a direct port
21:38:47Yardanicoohhh I understand now yeah
21:39:00YardanicoI had thought about the same with another projects, yeah
21:39:01FromDiscord<Rika> and slider uses lgpl 3
21:39:19YardanicoLike should a code translation (with some modifications) be licensed under the same license or not
21:39:23FromDiscord<Rika> mhm
21:39:30FromDiscord<Rika> actually theres a lot of modifications
21:39:34leorizeyes, it'll be under the same license
21:39:36FromDiscord<Rika> because numpy aint in nim lmao
21:39:47Yardanicoyou can still use it with nimpy :P
21:39:49FromDiscord<Rika> so yeah sadly its not my call to change it lol
21:39:52FromDiscord<Rika> i dont want to
21:39:59Yardanicobut calling numpy like nim->nimpy->python->numpy is meh
21:39:59FromDiscord<Rika> sounds like unnecessary translation
21:40:09FromDiscord<Rika> mhm
21:40:28Yardanicowell ok then I won't look at circa code anymore
21:40:33Yardanicoso I wouldn't be copying it :P
21:40:45Yardanicohttps://github.com/Francesco149/oppai-ng is under Unlicense btw, just so you know
21:40:52YardanicoUnlicense is basically public domain
21:41:38leorizepublic domain is not legal everywhere though
21:41:41*solitudesf quit (Ping timeout: 256 seconds)
21:41:49Yardanicowell they include a statement for that in the license
21:42:05FromDiscord<Rika> > <Yardanico> https://github.com/Francesco149/oppai-ng is under Unlicense btw, just so you know
21:42:06FromDiscord<Rika> but then why would you convert it to pure nim, its in pure C already 😛
21:42:35FromDiscord<Rika> > <Yardanico> well ok then I won't look at circa code anymore
21:42:35FromDiscord<Rika> this is sad, i'm being cucked by a license choice i didnt make
21:42:38Yardanicobecause it will be in Nim and I will be able to understand it better :P
21:42:45FromDiscord<Rika> i'll ask lllllllllllll to change the license or something
21:43:32Yardanicooppai-ng is just roughly ~3kloc (actual code)
21:43:38Yardaniconot that much
21:44:17FromDiscord<Rika> what's so bad about LGPL though?
21:44:31FromDiscord<Rika> i mean i know its much worse than the other licenses
21:44:56Yardanicoin nim land, as leorize said, LGPL is same as GPL
21:45:05Yardanicoso all your nim apps MUST be licensed under LGPL/GPL
21:45:12Yardanicoif you use circa nim lib
21:45:28FromDiscord<Rika> ah license virus
21:45:31Yardanicoso you couldn't create proprietary apps with "circa" lib really
21:45:41leorizethat's a feature :P
21:45:42FromDiscord<Rika> oi stop targeting me
21:45:51FromDiscord<Rika> its not my fault ;;
21:45:57Yardanicothere's also AGPL which extends GPL for serverside code
21:46:12leorizeit's not that you have to license it under gpl/lgpl
21:46:18leorizeyou can license it under anything
21:46:27Yardanicobut you have to keep it fully open source, right?
21:46:32leorizeyep
21:46:34FromDiscord<clyybber> deck/stack destruction virus
21:46:50FromDiscord<Rika> `stack destruction virus` sounds like altered carbon to me
21:47:00Yardanicobtw, about AGPL - how will people even find out that your website's backend uses AGPL libs? :D
21:47:12FromDiscord<Rika> they dont lol
21:47:22*my_dude quit (Ping timeout: 256 seconds)
21:59:58*rnrwashere quit (Remote host closed the connection)
22:02:50FromDiscord<clyybber> bb Yardanico
22:03:01Yardanicowell not from IRC, just from mumble :P
22:03:14YardanicoI'm actually on 24/7 in IRC since I run Quassel
22:05:22FromDiscord<clyybber> oh yeah, I just missed saying goodbye on mumble
22:05:46FromDiscord<clyybber> like you were already gone so quick :p
22:15:41*sleepyqt quit (Ping timeout: 265 seconds)
22:18:35*leth quit (Ping timeout: 265 seconds)
22:18:38*leth` joined #nim
22:28:41*rnrwashere joined #nim
22:30:06FromGitter<sealmove> hey is anyone here? I need help with something simple
22:30:23FromGitter<sealmove> I need to make an alias on "result" variable
22:30:27FromDiscord<Rika> hello
22:30:32FromDiscord<Rika> what do you mean?
22:30:50FromGitter<sealmove> so for example "this.someThing" should be exactly the same as "result.someThing"
22:31:15FromDiscord<Rika> i dont understand
22:31:18FromDiscord<Rika> still
22:31:26Yardanico@Rika to be able to alias result as something else
22:31:35Yardanicoso "this.stuff = 5" is the same as "result.stuff = 5"
22:32:00FromDiscord<Rika> maybe a template `var \`
22:32:02FromDiscord<Rika> damn it
22:32:06FromDiscord<Rika> sorry premature enter
22:32:41FromDiscord<Rika> some template that does "var `alias` = result; defer: return `alias`"
22:33:04FromDiscord<Rika> but this still allows result to be usable
22:34:16FromGitter<sealmove> or maybe it's more clever if I do something like this? https://play.nim-lang.org/#ix=2fW3
22:36:51FromGitter<sealmove> oh wow, "this" seems to have special meaning
22:37:07Yardanicoyes
22:37:26Yardanicohttps://nim-lang.org/docs/manual_experimental.html#automatic-self-insertions
22:37:44Yardanicoit's not a keyword though so you can use it safely
22:38:31FromGitter<sealmove> yes, I checked the keywords, that's why I was surprised
22:38:52Yardanicowell a pragma doesn't need to be a keyword :)
22:40:38YardanicoI think you can make a macro which, when used as a pragma for a proc, can replace all instances of "this" (or any other name) to "result"
22:42:32leorize@sealmove: https://play.nim-lang.org/#ix=2fW7
22:42:33PMunchManaged to close mumble by accident
22:42:36PMunchBut I'm off to bed now,
22:42:43krux02good night
22:42:43PMunchMight stream more tomorrow after work
22:42:48Zevvsweet dreams
22:42:48FromDiscord<Rika> why is `this` deprecated btw
22:42:50FromGitter<sealmove> good night!
22:43:01*PMunch quit (Quit: leaving)
22:43:15leorize@Rika: it can be done with a macro, so we don't need more magic
22:43:48FromDiscord<Rika> so what macro is that now
22:44:10leorizestd/with
22:44:30leorizehttps://play.nim-lang.org/#ix=2fW7 <- how to alias something :P
22:44:50FromDiscord<clyybber> I think one could be able to fully replicate {.this.} as a macro
22:45:39leorizethat's not possible actually
22:46:00leorize{.this.} work in the same scope
22:46:16FromDiscord<clyybber> wdym?
22:46:22FromDiscord<clyybber> I mean like as a proc annotation
22:46:35FromDiscord<clyybber> It should get the proc definition and body passed to it
22:46:39FromDiscord<clyybber> right?
22:47:00leorizeyou write {.this: something.} then every proc after that implicitly use `something` as `this`
22:47:29FromDiscord<clyybber> oh
22:47:30FromDiscord<clyybber> right
22:47:38FromDiscord<clyybber> actually, maybe you can do that too
22:47:39leorizebut yes, you can implement it as a proc annotation, though you can just use `with` in the proc body
22:47:47FromDiscord<clyybber> via push: someCustomThisMacro
22:47:56leorizedoes that even work?
22:48:00FromDiscord<clyybber> I dunno
22:48:01FromDiscord<clyybber> :p
22:50:09*liblq-dev quit (Quit: WeeChat 2.7.1)
22:51:56*planetis[m] quit (Ping timeout: 246 seconds)
22:55:08FromGitter<sealmove> guys, I am finally making some progress with the Nim back-end for Kaitai Struct :)
22:55:22*planetis[m] joined #nim
22:55:46FromDiscord<clyybber> leorize: Seems like theres an issue about it: https://github.com/nim-lang/Nim/issues/12867
22:55:52FromDiscord<clyybber> sealmove: Nice, congrats!
22:55:59FromGitter<sealmove> I abandoned my ambition of re-writing it in Nim, so I am sticking with the original project which is in Scala. But this way I will get the job done because a lot of things are already implemented.
22:56:17*aEverr quit (Read error: Connection reset by peer)
22:58:39*aEverr joined #nim
23:02:41*dadada quit (Ping timeout: 250 seconds)
23:03:30*dadada joined #nim
23:03:54*dadada is now known as Guest42146
23:04:38FromGitter<sealmove> Really I want to do it in Nim some day, but there are some issues with it. Here are my thoughts:
23:04:48FromGitter<sealmove> There are 2 options:
23:04:55FromGitter<sealmove> 1) do it at CT
23:04:59FromGitter<sealmove> 1) do it at RT
23:05:03FromGitter<sealmove> 2*
23:05:15FromDiscord<exelotl> `with` in the standard library is nowhere close to `this` in terms of convenience or power
23:05:34FromGitter<sealmove> #1 needs a CT yaml parser, and #2 needs compiler as API which is messy imo
23:06:26FromGitter<sealmove> unless I don't use AST and do it with strings
23:06:42FromGitter<sealmove> what do you think guys? would producing nim code with string be such a bad idea?
23:07:12FromDiscord<clyybber> why do you need the compiler as an api?
23:07:22FromDiscord<clyybber> can't you simply generate type sections?
23:07:28FromDiscord<clyybber> out of the yaml?
23:08:29FromGitter<sealmove> Sure, but it would be at string level. I'd imagine one would like to use Nim's metaprogramming and do it with AST. That's what I am asking.
23:09:27Yardanicowhat about doing YAML->JSON with some helper tool (can be written in Nim too) and then doing all work at CT? json nim module works at CT
23:09:44YardanicoYAML can be mapped 1:1 to JSON afaik
23:13:07FromGitter<sealmove> People has recommender this to me before. Well, it's probably the best solution. I just don't like the fact that you have to do pre-work and can't use the yaml files directly.
23:13:10Yardanicoyou can check how nimterop does things, I think you may use the same approach
23:14:09FromGitter<sealmove> I'll definitely check it out, it seems the best way out of this mess...
23:16:06shashlicksealmove happy to help
23:16:35shashlickSee ast2 which does everything at runtime using compiler api which is very nice
23:16:57FromGitter<sealmove> really, i lost half a year just because I was stubborn and wanted to do it "the perfect way". really bad mindset for programming!
23:17:51*tefter joined #nim
23:17:53shashlickHave been reimplementing the backend the right way for 3 months now
23:18:07FromGitter<sealmove> Thanks shashlick. So you believe option 2 (do it at RT with compiler api) is better than option 1 (convert to json and do it at CT)?
23:18:17shashlickI think it should be possible to collaborate
23:18:24shashlickCT is slow
23:19:05shashlickBut what exactly is the goal
23:19:13shashlickNot familiar with kaitai
23:19:26FromDiscord<clyybber> sealmove: What is the perfect way?
23:19:37FromDiscord<clyybber> I guess parse YAML at CT and generate type sections
23:19:42FromDiscord<clyybber> That should be possible
23:19:47Yardanico@clyyber nimyaml doesn't support CT
23:19:53Yardanicobut I guess it can be possible to implement that
23:19:57Yardanicoshashlick: https://kaitai.io/
23:19:59FromDiscord<clyybber> Yeah, you'd have to implement it
23:20:05shashlickIs it like protobuf
23:20:18FromGitter<sealmove> no guys, it's impossible to implement that xD I've been trying for half a year, don't do it at home!!!
23:20:29Yardaniconimyaml at CT should be entirely possible :P
23:20:31FromDiscord<clyybber> sealmove: Impossible to implement yaml at CT?
23:20:33FromGitter<sealmove> I read the whole yaml spec, it's an ugly mess
23:20:37Yardanicojson module works at CT too
23:20:37FromDiscord<clyybber> That is definitely possible
23:20:41FromDiscord<clyybber> sealmove: Yeah
23:20:43FromDiscord<clyybber> thats true
23:20:48FromGitter<sealmove> clyyber yes, it's practically impossible
23:21:01FromDiscord<clyybber> for sure its not
23:21:29FromGitter<sealmove> I mean, of course it's possible, but very very difficult, not worth the time
23:21:45FromDiscord<clyybber> do you think kaitai in general is worth the time?
23:21:57Yardanicoalso I'm wondering this as well :P
23:22:01FromGitter<sealmove> yes, truly believe so
23:22:14FromGitter<sealmove> at least for my type of work
23:22:28Yardanicowe have nesm and binaryparser in nim
23:22:58Yardanicodid you see https://github.com/xomachine/NESM and https://github.com/PMunch/binaryparse ?
23:23:35FromDiscord<clyybber> sealmove: Did you try patching nimyaml to work at CT?
23:23:51Yardanico@clyybber there's this issue, not by sealmove though https://github.com/flyx/NimYAML/issues/70
23:23:58FromDiscord<clyybber> yeah
23:24:05FromDiscord<clyybber> I was looking at that right now
23:24:44FromDiscord<clyybber> Seems to be a matter of inlining/getting rid of the sourceprovider concept or translating it to a generic
23:24:46FromGitter<sealmove> Yardanico: Yes of course I saw them. When working on forensics though you need a lot more features, and the yaml syntax for collecting file format specs is just perfect. I truly believe this is the future of forensics since at the moment everyone uses 1342342 different random tools for each format.
23:25:08FromGitter<sealmove> clyybber: no I didn't really try, it's beyond me...
23:25:28FromDiscord<clyybber> sealmove: I think it would take you far less than half a year
23:25:33FromDiscord<clyybber> maybe a few days
23:25:41FromGitter<sealmove> if i knew how to do it probably
23:26:36FromDiscord<clyybber> but if you don't want that you could also use staticExec to convert the yaml to json and use that
23:26:54*Guest42146 quit (Ping timeout: 240 seconds)
23:27:24shashlickJust do it how toast does it
23:27:36shashlickRuntime for yaml
23:27:45shashlickGenerate Nim
23:28:06shashlickPull in using parseStmt
23:28:25FromGitter<sealmove> So compiler as API option
23:29:01*rnrwashere quit (Remote host closed the connection)
23:30:29FromDiscord<clyybber> or just try to fix nimyaml
23:30:48FromDiscord<clyybber> a bit harder
23:30:57FromGitter<sealmove> great, nobody agrees how it should be done :P I am so confused now
23:31:16FromDiscord<clyybber> making nimyaml work at ct has more benefits
23:31:31FromDiscord<clyybber> and it is less hacky
23:31:44FromDiscord<clyybber> it is "the perfect solution"
23:33:07FromGitter<sealmove> that I agree...
23:33:38*dadada joined #nim
23:33:39FromGitter<sealmove> and I can make nice interface where you can inject the parser in your binary without even having to produce a seperate nim module. this was my ambition from the get go
23:34:02*dadada is now known as Guest86804
23:34:04FromGitter<sealmove> so kaitai struct as nim library, instead of external program
23:39:29FromGitter<sealmove> Ok, I will try to do that next. But first I will finish the native back-end (in Scala).
23:39:44FromGitter<sealmove> thanks for the ideas everyone :)
23:42:08*krux02 quit (Remote host closed the connection)
23:47:52*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:54:52*silvernode quit (Ping timeout: 256 seconds)
23:57:32*Guest86804 quit (Ping timeout: 256 seconds)
23:58:00*tefter quit (Quit: WeeChat 2.7.1)