00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:01:03 | FromDiscord | <Recruit_main707> maybe not :p i do cant |
00:01:17 | * | my_dude quit (Quit: ZZZzzz…) |
00:01:34 | FromDiscord | <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:18 | FromDiscord | <Varriount> @Recruit_main707 hm |
00:11:40 | FromDiscord | <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:58 | FromDiscord | <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:13 | FromDiscord | <Rika> r"\x07" |
00:19:19 | FromDiscord | <Rika> i think |
00:19:42 | FromDiscord | <Rika> yeah thats it |
00:20:10 | FromDiscord | <KingDarBoja> But let's said it is a parameter to other function, how I can turn that string without changing the source? |
00:20:34 | FromDiscord | <KingDarBoja> convert* |
00:21:58 | FromDiscord | <Rika> no clue actually |
00:22:46 | FromDiscord | <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:33 | FromDiscord | <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:00 | FromDiscord | <exelotl> i.e. `echo"hello\nworld"` is different to `echo "hello\nworld"` |
00:43:11 | * | noonien quit (Quit: Connection closed for inactivity) |
00:46:05 | FromDiscord | <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:34 | qbradley | Is it possible to have a branch of an object variant with no fields? |
01:00:42 | leorize | @Recruit_main707: you can't because Nim identifier can't start with an underscore |
01:00:52 | leorize | qbradley: yes, put discard in that branch |
01:00:59 | qbradley | ok thanks |
01:01:12 | qbradley | it works. perfect! |
01:03:03 | * | rnrwashere joined #nim |
01:09:12 | * | krux02_ quit (Remote host closed the connection) |
01:14:18 | FromGitter | <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:46 | FromDiscord | <Rika> nope |
01:14:54 | FromDiscord | <Rika> ah wait misunderstood |
01:15:04 | FromDiscord | <Rika> hm, im not sure what happens to the contents |
01:15:43 | FromDiscord | <Rika> yes it works awr1 |
01:15:54 | FromDiscord | <Rika> it's implicitly `new`'d it seems |
01:16:38 | FromGitter | <awr1> thanks |
01:19:43 | * | couven92 quit (Read error: Connection reset by peer) |
01:20:07 | * | couven92 joined #nim |
01:23:18 | FromDiscord | <KingDarBoja> "i dont think non-string literals can be raw" yikes! |
01:27:21 | FromDiscord | <Rika> i honestly dont know okay |
01:30:16 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:30:42 | FromDiscord | <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:44 | leorize | KingDarBoja: non-string literals can't be raw? what does that even mean? |
02:12:22 | disruptek | depends on who is uttering them, usually. |
02:14:51 | FromDiscord | <Rika> you should ping me lmao |
02:15:21 | FromDiscord | <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:16 | leorize | "raw" string is a properly of Nim source code :p |
02:16:40 | leorize | property* |
02:19:56 | disruptek | i can make it as raw as you want, sweetheart. |
02:23:36 | FromDiscord | <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:21 | disruptek | show off. |
02:24:42 | disruptek | ima stream some more obs plugin stuff for an hour or two. |
02:25:10 | leorize | a lot of languages like to impose that strings must contain valid text |
02:25:41 | * | ksandvik joined #nim |
02:28:16 | FromDiscord | <KingDarBoja> For example -> "\uFEFF foo" length is 7 on Nim whereas in Python is 5... |
02:28:16 | FromDiscord | <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:32 | FromDiscord | <Varriount> @KingDarBoja https://nim-lang.org/docs/unicode.html#runeLen%2Cstring |
03:03:11 | FromDiscord | <KingDarBoja> Intriguing... |
03:03:16 | FromDiscord | <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:51 | FromDiscord | <Varriount> Otherwise, `s[i]` would have to iterate through the whole string to find out which rune is at that index. |
03:05:11 | FromDiscord | <Varriount> You'll notice that only ascii specific stuff is in strutils |
03:06:19 | FromDiscord | <KingDarBoja> 🤔 |
03:07:45 | FromDiscord | <Varriount> @KingDarBoja For example, https://nim-lang.org/docs/strutils.html#count%2Cstring%2Cstring%2Cbool |
03:08:01 | FromDiscord | <Varriount> works with any encoding, assuming that your arguments are all the same encoding |
03:08:33 | FromDiscord | <Varriount> @KingDarBoja What are you trying to do? Could you show your code? |
03:09:05 | FromDiscord | <KingDarBoja> I do rather push my changes and share the repo as I mentioned before, doing Graphql port from Python into Nim |
03:09:18 | FromDiscord | <Varriount> Huh, interesting |
03:09:26 | FromDiscord | <KingDarBoja> Right now at the lexer, which is "done" |
03:09:37 | FromDiscord | <KingDarBoja> But not really lol as the tests aren't passing at all |
03:09:43 | FromDiscord | <KingDarBoja> Give me 10 minutes... |
03:20:43 | FromDiscord | <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:34 | FromDiscord | <Varriount> They are failing? |
03:25:43 | FromDiscord | <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:24 | FromDiscord | <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:25 | FromDiscord | <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:57 | FromDiscord | <Varriount> Sorry, line 33 |
03:27:38 | FromDiscord | <KingDarBoja> I see... to be fair, the correct message should be "Cannot contain the invalid character '\\x07'." |
03:28:01 | FromDiscord | <KingDarBoja> Notice the raw string being outputed instead of '\\7' as it does now :/ |
03:28:08 | FromDiscord | <KingDarBoja> at the output* |
03:28:25 | FromDiscord | <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:11 | FromDiscord | <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:21 | FromDiscord | <Varriount> Where's the entry point for the lexer? |
03:30:17 | FromDiscord | <KingDarBoja> There is none atm, just building the modules one by one |
03:30:41 | FromDiscord | <Varriount> Generally, you just explicitly check for the BOM |
03:31:54 | FromDiscord | <Varriount> Then, you use that with your lexer to rearrange the bytes as they are read. |
03:32:28 | FromDiscord | <KingDarBoja> I don't understand what are you saying mate |
03:32:43 | FromDiscord | <Varriount> Hm |
03:32:57 | FromDiscord | <Varriount> Do you know what the byte order mark signifies? |
03:33:06 | FromDiscord | <KingDarBoja> Think like I just want to get the lexer.py file and convert into lexer.nim ,that's it |
03:33:12 | FromDiscord | <KingDarBoja> Oh yes |
03:33:26 | FromDiscord | <Varriount> Can you show me the original python source? |
03:34:10 | FromDiscord | <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:17 | FromDiscord | <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:15 | FromDiscord | <Varriount> I just see an anime character |
03:38:37 | FromDiscord | <KingDarBoja> I see my old profile pic, anyway, continue sir with the lesson 🙂 |
03:41:11 | FromDiscord | <Varriount> @KingDarBoja Are you familier with the size of a character type vs the size of a unicode rune/glyph/etc? |
03:41:50 | FromDiscord | <KingDarBoja> No, I think that's what you explained few comments ago with the unicode lib vs len() |
03:43:12 | FromDiscord | <KingDarBoja> But I assume you are being more technical |
03:43:47 | FromDiscord | <Varriount> So, text data has to be encoded in some way - the characters we see have to have representations as actual data. |
03:44:44 | FromDiscord | <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:52 | FromDiscord | <Varriount> Some encodings might represent the character 'a' as the number '61' in memory |
03:46:05 | FromDiscord | <Varriount> Some might represent 'a' as 1 |
03:46:20 | FromDiscord | <Varriount> It's up to the program to interpret this data correctly. |
03:46:53 | FromDiscord | <Varriount> The most common encodings are ascii, UTF8, UTF16, and UTF32. |
03:47:04 | FromDiscord | <KingDarBoja> Yes |
03:47:26 | FromDiscord | <Rika> ~~utf8 is variable byte count encoding~~ |
03:48:02 | FromDiscord | <Varriount> Yes, and some encodings may use a different number of bytes to represent different characters. |
03:48:28 | FromDiscord | <Varriount> Now, it's important to know the difference between a character (the letter) and char (the data type). |
03:48:56 | FromDiscord | <Varriount> A character is an abstract representation of a piece of text, separate from encoding. |
03:49:16 | FromDiscord | <Varriount> A char is a data type, usually composed of 8 bytes. |
03:50:20 | FromDiscord | <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:30 | FromDiscord | <Varriount> When you use `unicode.runAtPos(stringVar, i)`, you are saying, "give me the i'th utf-8 character in the string" |
03:53:55 | FromDiscord | <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:07 | disruptek | who was working on a wlroots wrapper? |
03:54:35 | FromDiscord | <KingDarBoja> Ah... |
03:54:45 | FromDiscord | <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:50 | FromDiscord | <KingDarBoja> Just tested what you said... |
03:55:28 | FromDiscord | <KingDarBoja> var b = "ánt text" -> echo b[0] yields some � whereas echo runeAtPos(b, 0) yields "á" |
03:55:56 | FromDiscord | <Varriount> Yes, becuase `á` is represented by more than 1 byte |
03:55:56 | FromDiscord | <KingDarBoja> I thought char was taking care of that but was wrong |
03:56:27 | FromDiscord | <Rika> this aint python |
03:56:55 | FromDiscord | <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:20 | FromDiscord | <Varriount> And/or makes strings take up more space, depending on the version of python you are using. |
03:57:38 | FromDiscord | <KingDarBoja> I know, these kind of assumptions are the reason I get confused |
03:58:25 | FromDiscord | <KingDarBoja> That was a great explanation, indeed |
03:58:44 | FromDiscord | <Varriount> https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8 |
03:59:49 | FromDiscord | <Varriount> I would suggest reading through the unicode module and Wikipedia, and posting any question you have here. |
04:00:09 | FromDiscord | <Varriount> I'm not an expert with that module (or with utf-8), but I can try my best. |
04:00:48 | FromDiscord | <KingDarBoja> Essentially I am getting the character but without taking into account the rune itself |
04:01:44 | FromDiscord | <KingDarBoja> But got another question based on that, does that take care of hex values, the ones with "\xHH"? |
04:02:13 | FromDiscord | <KingDarBoja> https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals |
04:04:11 | FromDiscord | <Varriount> What do you mean by "does that"? |
04:05:01 | FromDiscord | <KingDarBoja> Unicode only takes care of "\uHHHH", right? |
04:06:22 | FromDiscord | <Varriount> A Unicode character can be represented by "\uHH", just not all Unicode characters. |
04:07:28 | FromDiscord | <KingDarBoja> And the hex values are handled differently, I assume (i.e. "\xHH") |
04:07:40 | FromDiscord | <Varriount> Rika: Any idea how "\uFEFF" translates to 3 bytes instead of 2? |
04:07:49 | FromDiscord | <Varriount> @Rai Nathan Famakai II |
04:07:59 | FromDiscord | <Varriount> @Rai Nathan Famakai II |
04:08:15 | FromDiscord | <Varriount> @Rika |
04:08:28 | FromDiscord | <Rika> oof rip other dude |
04:08:30 | FromDiscord | <Rika> one moment |
04:08:33 | FromDiscord | <KingDarBoja> lol |
04:10:09 | FromDiscord | <Rika> hm |
04:12:54 | FromDiscord | <Rika> because `\uFEFF` is not `\xFE\xFF` im inferring |
04:13:28 | * | opal quit (Remote host closed the connection) |
04:13:41 | FromDiscord | <Rika> `\uFEFF` is 3 bytes as 3 "unicode bytes" can hold 2 "data bytes" |
04:13:57 | FromDiscord | <Rika> a few bytes are used to determine length and "continuation bytes" |
04:14:13 | FromDiscord | <Rika> `s/few bytes/ few bits` |
04:14:25 | FromDiscord | <Rika> @Varriount @KingDarBoja |
04:14:42 | * | opal joined #nim |
04:14:44 | FromDiscord | <Rika> https://en.wikipedia.org/wiki/UTF-8#Description you can see here |
04:15:35 | * | my_dude quit (Quit: ZZZzzz…) |
04:15:36 | FromDiscord | <Varriount> Ah, gotcha |
04:17:02 | * | my_dude joined #nim |
04:19:25 | FromDiscord | <Rika> `\uFEFF` means that whatever the data bytes would be, the data `FEFF` would be in them on read |
04:20:22 | FromDiscord | <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:25 | FromDiscord | <Rika> so `1110 1111 | 1011 1011 | 1011 1111` |
04:21:27 | disruptek | fwiw yuri has a wayland lib |
04:21:30 | disruptek | !repo wayland |
04:21:31 | disbot | https://github.com/yglukhov/wayland -- 9wayland: 11Nim bindings for wayland 15 5⭐ 1🍴 7& 1 more... |
04:21:39 | FromDiscord | <Rika> oh wow |
04:22:14 | disruptek | i plan to write something to scale surfaces using it. |
04:28:20 | shashlick | Can't do anything without a laptop |
04:29:36 | * | my_dude quit (Quit: ZZZzzz…) |
04:39:11 | leorize | disruptek: 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:22 | kungtotte | disruptek: 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:22 | FromDiscord | <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:22 | FromDiscord | <Benumbed> https://play.nim-lang.org/#ix=2fR5 |
08:09:46 | FromDiscord | <Varriount> @Benumbed I can take a look |
08:09:52 | FromDiscord | <Benumbed> Thanks... |
08:10:30 | FromDiscord | <Benumbed> I think my C/C++ experience may be pushing how I think about this in the wrong direction? |
08:11:01 | FromDiscord | <Benumbed> (more C++ than C, I haven't written C in years) |
08:12:00 | * | sleepyqt joined #nim |
08:13:14 | FromDiscord | <Varriount> @Benumbed: From what I'm observing, Nim is determining the type of the map by the type of the first keys |
08:13:43 | FromDiscord | <Benumbed> Yeah except the type should be a ref to AMQPMethodObj |
08:14:03 | FromDiscord | <Varriount> And the type of the first key is `(int, proc (stream: Stream): ConnectionStart {.....})` |
08:14:22 | FromDiscord | <Benumbed> ConnectionStart refers back to AMQPMethodObj though |
08:14:37 | FromDiscord | <Varriount> The type of the second key is `(int, proc (stream: Stream): ConnectionStartOk{.....})` |
08:15:05 | FromDiscord | <Benumbed> ConnectionStart->AMQPMethodObj->AMQPMethodObj |
08:15:05 | FromDiscord | <Benumbed> ConnectionStartOk->AMQPMethodObj->AMQPMethodObj |
08:15:27 | FromDiscord | <Varriount> Two children of a parent type aren't directly equivalent. |
08:16:07 | FromDiscord | <Varriount> You have to create a container with their common parent type |
08:16:45 | FromDiscord | <Varriount> Also, two procedures that return different types *might* always be unequivalent? I'm not sure. |
08:16:58 | FromDiscord | <Varriount> (or is it inequivalent?) |
08:17:15 | FromDiscord | <Benumbed> No idea heh |
08:17:57 | FromDiscord | <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:32 | FromDiscord | <Benumbed> (you have to cast the pointer to get the child-type back at the end) |
08:18:39 | * | tane_ joined #nim |
08:18:52 | FromDiscord | <Varriount> Hm, one moment |
08:20:04 | FromDiscord | <Varriount> https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
08:20:15 | FromDiscord | <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:52 | FromDiscord | <Benumbed> 🤔 |
08:21:22 | FromDiscord | <Varriount> The `{...}` construct is syntactic sugar for a sequence of tuples |
08:21:57 | FromDiscord | <Benumbed> Yeah, I'm trying a different way of packing values into the Table |
08:22:06 | FromDiscord | <Benumbed> that doesn't involve tuples, but it uglier |
08:22:19 | FromDiscord | <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:35 | FromDiscord | <Varriount> Why do you need a map of methods? |
08:24:05 | FromDiscord | <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:17 | FromDiscord | <Varriount> Hm. |
08:24:30 | FromDiscord | <Benumbed> What I want is a dispatch table which will map those IDs to actual methods that get called |
08:24:50 | FromDiscord | <Benumbed> Because it simplifies things |
08:25:04 | * | my_dude quit (Quit: ZZZzzz…) |
08:25:15 | FromDiscord | <Varriount> Do the dispatch methods read arguments from the stream? |
08:25:24 | FromDiscord | <Benumbed> And all the data structures that get returned inherit from the 'AMQPMethod' structure |
08:25:29 | FromDiscord | <Varriount> And how are return types handled? |
08:26:01 | FromDiscord | <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:22 | FromDiscord | <Varriount> Do you know the entire set of methods at compile time? |
08:27:01 | FromDiscord | <Benumbed> I mean the spec is a static list of methods, so... yeah I think? |
08:27:33 | FromDiscord | <Varriount> Ok. And what will be done with the return type (AMQPMethodObj)? |
08:27:57 | FromDiscord | <Varriount> Sorry for the questions, but it helps to have a good picture of what the goal is. |
08:28:05 | FromDiscord | <Benumbed> No, no problems at all |
08:28:46 | FromDiscord | <Benumbed> The return type is basically just the collected data from the server, packged into a datastructure that looks like the spec |
08:29:10 | FromDiscord | <Benumbed> Hang on, I'm tired and I need to re-think my wording |
08:30:16 | FromDiscord | <Benumbed> I may be over-thinking this |
08:30:39 | FromDiscord | <Varriount> Is there a reason the dispatch methods can't write their result to a stream? |
08:31:34 | FromDiscord | <Benumbed> I mean theoretically they could, but there can be many open channels, all handling RPC calls + data |
08:31:55 | FromDiscord | <Benumbed> I think I need to sit down and draw this out |
08:32:09 | FromDiscord | <Benumbed> Because I'm no longer certain I have the right design here haha |
08:32:49 | FromDiscord | <Benumbed> Yeah I need to re-think this, thanks @Varriount 🙂 |
08:33:05 | FromDiscord | <Benumbed> There may still be a need for a dispatch table, but not in this scope |
08:35:57 | FromGitter | <Vindaar> @Benumbed: this *might* work: https://play.nim-lang.org/#ix=2fRd |
08:36:34 | FromGitter | <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:45 | FromDiscord | <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:04 | FromDiscord | <Benumbed> Which, in that case, makes said dispatch table very straightforward |
08:39:13 | FromGitter | <Vindaar> all the better! |
08:40:01 | FromDiscord | <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:36 | FromGitter | <Vindaar> I agree. Certainly also one of the reasons I stuck with Nim |
08:40:56 | Zevv | https://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:47 | FromDiscord | <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:11 | FromDiscord | <Benumbed> Now if only I could swap Nim and Go for number of jobs available hahaha |
08:42:46 | FromGitter | <Vindaar> @Zevv: haha. Although in isolation that sentence can be read as if to say people using Nim are dumb |
08:42:55 | FromDiscord | <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:39 | FromDiscord | <Benumbed> lol yeah, in context it's a lot more flattering of the language 🙂 |
08:48:53 | FromDiscord | <Varriount> Really? I haven't had much trouble with Go's package system |
08:50:51 | FromDiscord | <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:18 | FromDiscord | <Benumbed> Modules have helped a ton, although I haven't touched it much since 1.13 came out and made them 'official' |
08:51:26 | FromDiscord | <Benumbed> Before that it was a hot mess |
08:52:02 | FromDiscord | <Benumbed> And that's coming from someone with a decade+ of Python experience... and _that_ is a screwed up packaging ecosystem |
08:52:08 | FromDiscord | <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:16 | FromDiscord | <Benumbed> Yep |
08:52:45 | FromDiscord | <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:26 | FromGitter | <Vindaar> > astrophysics-level degree ⏎ I speak from experience. That doesn't help at all :P |
08:53:58 | FromDiscord | <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:11 | FromDiscord | <Benumbed> Leading to some code mistakes that can be quite amusing |
08:55:05 | FromDiscord | <Benumbed> and yes Python packaging is _mental_ |
08:55:06 | FromDiscord | <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:26 | FromDiscord | <Benumbed> Agreed, it's got some _weird_ ideas about syntax too |
08:55:46 | * | my_dude quit (Quit: ZZZzzz…) |
08:55:46 | FromDiscord | <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:52 | FromDiscord | <Varriount> I would love overloading (or at least default/optional parameters) |
08:56:23 | FromDiscord | <Benumbed> I should have started a list last month when I was working more in it |
08:56:24 | FromDiscord | <Varriount> It makes me cringe whenever I see that pattern where the constructor takes a variadic number of closures |
08:56:44 | FromDiscord | <Benumbed> Almost every day I was like "Who on earth made _that_ decision?! WHY?!" |
08:57:24 | FromDiscord | <Varriount> Like `thing := NewThing(OneOption(value), TwoOption(value), ThreeOption(value))` |
08:57:46 | FromDiscord | <Varriount> Because I know what actually has to be done in order to support that pattern behind the scenes. |
08:58:18 | FromDiscord | <Varriount> (The answer is closures and heap allocations.) |
08:58:24 | FromDiscord | <Benumbed> bleh |
08:58:38 | FromDiscord | <Benumbed> Oh that is one thing I do like about Nim |
08:58:46 | FromDiscord | <Benumbed> the let vs var stuff |
08:58:54 | FromDiscord | <Benumbed> despite how confused I get with JavaScript |
08:59:15 | FromDiscord | <Benumbed> let means I'm doing stack allocations, var means heap |
08:59:30 | FromDiscord | <Benumbed> it makes it very easy to see, at a glance, where my memory is coming from |
08:59:36 | FromDiscord | <Varriount> Eh.. not really? |
08:59:51 | FromDiscord | <Benumbed> Really? dammit, did I get something confused again? |
09:01:01 | FromDiscord | <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:36 | FromDiscord | <Varriount> @Benumbed If you want a (mostly correct) guide to where something is allocated: |
09:02:00 | FromDiscord | <Varriount> - Is the variable a reference type? It's on the heap. |
09:02:14 | FromDiscord | <Varriount> - Is the variable an object type? It's on the stack. |
09:02:31 | FromDiscord | <Varriount> - Is the variable captured by a closure? It's on the heap. |
09:03:06 | FromDiscord | <Varriount> That last one supersedes the first two. |
09:03:12 | FromDiscord | <Benumbed> That's actually quite helpful |
09:03:46 | FromDiscord | <Benumbed> See I remember reading about how types influenced allocations, but I think it got corrupted at some point |
09:04:06 | FromDiscord | <Benumbed> Which, given I'm learning 3 new languages, was probably bound to happen, servces me right 😄 |
09:04:18 | FromDiscord | <Varriount> Of course, if you access an object type through a reference, it's also on the heap. |
09:04:32 | FromDiscord | <Benumbed> yeah |
09:04:56 | FromDiscord | <Varriount> And var types can be on the heap or stack (I think. Certainly they can be on the stack). |
09:05:36 | FromDiscord | <Varriount> Sorry, by `var` I mean `proc add[T](s: var seq[T], T)`. |
09:06:58 | FromDiscord | <Benumbed> That makes sense, since, in my mind, you're just getting a safe pointer to the data with that |
09:07:15 | FromDiscord | <Benumbed> rather than a read-only copy |
09:07:28 | FromDiscord | <Benumbed> copy may be the wrong word |
09:07:48 | FromDiscord | <Benumbed> ugh I need to go to bed, my brain is not cooperating anymore |
09:08:06 | FromDiscord | <Varriount> Sleep well. 🙂 |
09:08:15 | FromDiscord | <Benumbed> Thx! Nice chatting with you 🙂 |
09:08:26 | * | filcuc quit (Ping timeout: 256 seconds) |
09:08:59 | FromGitter | <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:09 | FromGitter | <gogolxdong> Is there anything to take care of when accessing global seq from async proc with arc? |
10:05:16 | FromDiscord | <Varriount> gogolxdong: Make sure two async procedures accessing the sequence at the same time so so without race conditions |
10:05:17 | FromGitter | <gogolxdong> crashes randomly. |
10:06:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:06:23 | FromGitter | <gogolxdong> It crashes at echo the seq.len randomly. |
10:11:10 | FromDiscord | <Varriount> gogolxdong: Do you have range checks and stacktraces on? |
10:11:36 | FromDiscord | <Varriount> What does the sequence contain? And have you tried running the program with GDB? |
10:11:42 | FromGitter | <gogolxdong> Does release close these checks? I'm using release. |
10:12:06 | FromGitter | <gogolxdong> contains ref object |
10:13:19 | FromDiscord | <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:25 | FromDiscord | <kodkuce> when copile nim cna i suppress hints |
10:13:36 | FromDiscord | <kodkuce> its sometimes anyoing while debuging |
10:13:46 | FromDiscord | <Varriount> try using `-d:release --stacktrace:on --linetrace:on` |
10:13:46 | FromGitter | <gogolxdong> --hints:off |
10:14:33 | FromDiscord | <kodkuce> yep just duckduckit was blind |
10:14:50 | FromDiscord | <Varriount> Or, if you want to use GDB, use `-d:release --stacktrace:on --linetrace:on --debugger:native` |
10:15:10 | FromGitter | <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:22 | FromDiscord | <kodkuce> am not really debuging by debuger am just consol login it |
10:16:12 | FromGitter | <gogolxdong> the same with what I have. |
10:16:41 | FromDiscord | <Varriount> Looks like either the sequence is nil, or an element in it is nil |
10:16:53 | FromDiscord | <Varriount> I can't tell much without examining the code. |
10:19:16 | FromGitter | <gogolxdong> sequence is not nil by default? it crashes at the line of echoing sequence length. |
10:19:45 | FromDiscord | <Varriount> Hm, then something is off. Can you show me the code? |
10:20:06 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=2fRA |
10:21:17 | FromGitter | <gogolxdong> It compiles with a httpbeast based websocket library. |
10:21:31 | FromGitter | <gogolxdong> Do you need it? |
10:22:18 | * | Arrrrrrrrrrrrrrr joined #nim |
10:22:48 | FromDiscord | <Varriount> Try initializing the sequence explicitly |
10:23:32 | Arrrrrrrrrrrrrrr | Hello there. Is it possible to preserver the ast structure when printing it to str? https://play.nim-lang.org/#ix=2fRN |
10:23:44 | Arrrrrrrrrrrrrrr | *preserve |
10:24:56 | FromDiscord | <Varriount> Do you mean preserve the original formatting of the code? |
10:25:03 | Arrrrrrrrrrrrrrr | That is |
10:25:19 | FromDiscord | <Varriount> No. Formatting information isn't encoded in the AST |
10:26:29 | Arrrrrrrrrrrrrrr | Uggh. Thanks anyway, see you. |
10:26:36 | * | Arrrrrrrrrrrrrrr quit (Remote host closed the connection) |
10:26:40 | FromGitter | <gogolxdong> not the cause, still crashes when I refresh browser which establishes new connection to server. |
10:27:35 | FromGitter | <gogolxdong> do you mean var clients = newSeqClient () by explicitly? |
10:28:03 | FromDiscord | <Varriount> Yeah |
10:28:43 | FromGitter | <gogolxdong> doesn't get it work. |
10:30:43 | FromDiscord | <Varriount> Hm |
10:32:15 | FromDiscord | <Varriount> I notice that your procedure is annotated with gcsafe, even though it isn't. |
10:32:17 | FromDiscord | <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:31 | FromGitter | <gogolxdong> sure, but how to get it working without gcsafe enforcement. |
10:33:58 | FromDiscord | <Varriount> Pass the sequence around in a central server object? |
10:50:16 | * | PMunch joined #nim |
10:56:31 | FromDiscord | <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:31 | FromDiscord | <kodkuce> |
10:56:35 | FromDiscord | <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:36 | FromDiscord | <kodkuce> |
10:56:36 | FromDiscord | <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:40 | FromDiscord | <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:43 | FromDiscord | <kodkuce> var client = newHttpClient() |
10:58:43 | FromDiscord | <kodkuce> var g = client.getContent("https://www.tablicakalorija.com/") |
10:58:43 | FromDiscord | <kodkuce> echo g |
10:58:44 | FromDiscord | <kodkuce> let xml = parseHtml(newStringStream(g)) |
10:58:44 | FromDiscord | <kodkuce> echo xml #here its allready broken |
10:59:43 | FromDiscord | <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:07 | FromDiscord | <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:29 | FromDiscord | <kodkuce> want me to repost with gist or something? |
11:00:39 | FromDiscord | <kodkuce> or just for future 🙂 |
11:03:29 | FromDiscord | <Varriount> Just for the future |
11:04:23 | FromDiscord | <Varriount> If it's a bug, the file an issue and (ideally) find a fix |
11:06:43 | FromDiscord | <kodkuce> http://ix.io/2fRT can someone just confirm so i dont open for nothing |
11:09:44 | FromDiscord | <Varriount> Are you downloading HTML, or XML? |
11:10:32 | FromDiscord | <kodkuce> html i think |
11:10:37 | FromDiscord | <kodkuce> hmm 🙂 |
11:11:00 | FromDiscord | <kodkuce> does nim have seprate html parser 🙂 |
11:11:19 | FromDiscord | <kodkuce> lol |
11:11:44 | FromDiscord | <kodkuce> but ye i am using htmlparser |
11:11:52 | FromDiscord | <kodkuce> i just named it xml for some reason |
11:12:09 | FromDiscord | <Varriount> It looks like a bug. I don't know enough about HTML to be certain |
11:12:43 | FromDiscord | <kodkuce> np i in no hurry will recheck myself too |
11:13:23 | FromDiscord | <Varriount> I'd run the website's HTML through a validator to check that it's valid |
11:14:44 | FromDiscord | <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:44 | go|dfish | the html is broken, there is no closing </a> tag |
11:15:09 | FromDiscord | <kodkuce> where |
11:15:27 | FromDiscord | <Varriount> Curl doesn't parse HTML, does it? It just grabs data from a URL |
11:15:57 | FromDiscord | <kodkuce> <a href="https://www.tablicakalorija.com/povrce/krastavac-oguljen.html%22%3EKrastavac, oguljen</td> |
11:15:57 | go|dfish | <td class="column-2"><a href="Krastavac,">https://www.tablicakalorija.com/povrce/krastavac-oguljen.html">Krastavac, oguljen</td> |
11:16:01 | FromDiscord | <kodkuce> yep you right |
11:16:40 | FromDiscord | <kodkuce> dude probbaly dumped this in DB as a text |
11:16:49 | FromDiscord | <kodkuce> ok sorry my bad |
11:16:57 | FromDiscord | <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:19 | go|dfish | well 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:50 | FromDiscord | <kodkuce> that is probbaly a feature and not a bug, like fix broken a tags before try parse 🙂 |
11:25:21 | go|dfish | yeah, quite possibly |
11:29:25 | PMunch | Hmm, dadada, you on? |
11:42:46 | FromDiscord | <Varriount> go|dfish: It's the question "how hard do we want to parse bad input?" |
11:43:57 | FromDiscord | <Varriount> go|dfish, @kodkuce See also https://devblogs.microsoft.com/oldnewthing/20200304-00/?p=103527 |
11:44:17 | go|dfish | Will check it out - thanks |
11:51:23 | * | filcuc joined #nim |
12:00:09 | FromDiscord | <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:15 | krux02 | Araq: Does it feel satisfying to close my PRs with far fetched reasons? |
13:03:20 | dom96 | :/ |
13:05:43 | * | opal quit (Ping timeout: 240 seconds) |
13:08:47 | FromDiscord | <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:07 | FromDiscord | <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:43 | krux02 | kodcuce, probably with `filter` |
13:13:14 | FromDiscord | <Varriount> krux02: Is this about the unexported fields PR? |
13:13:21 | narimiran | `replace(" ", "')` |
13:14:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:14:19 | FromDiscord | <Varriount> @kodkuce: https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D |
13:14:20 | FromDiscord | <kodkuce> yep i used that narimiran , touqh did you misstype last " and wrote ' insted |
13:14:48 | narimiran | of course |
13:15:46 | krux02 | Varriount: yes it is. |
13:18:53 | * | waleee-cl joined #nim |
13:20:26 | FromDiscord | <Varriount> krux02: I mean, there are valid points for keeping those members. Wouldn't their removal affect compile-time sizeof? |
13:21:05 | krux02 | Varriount: that is exactly what I explained |
13:21:18 | krux02 | compile time sizeof is not affected by the fields of types imported from C. |
13:21:44 | FromDiscord | <Varriount> I mean, in a macro, or compile-time proc |
13:23:24 | FromDiscord | <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:25 | FromGitter | <gogolxdong> How to implement object pooling with arc? |
13:24:35 | FromGitter | <gogolxdong> Will it be issue-free like using array of ref object instead of sequence? |
13:24:56 | FromDiscord | <Varriount> gogolxdong: Do you need object pooling? Memory allocation is fairly fast |
13:25:20 | FromGitter | <gogolxdong> Only if it can solve my problem. |
13:25:45 | FromGitter | <gogolxdong> There isn't any document about this , is it? |
13:25:49 | FromDiscord | <Varriount> gogolxdong: I think your problem is that you are accessing globals from a section of code marked as gcsafe |
13:26:06 | FromDiscord | <Varriount> And gcsafe code isn't supposed to access globals |
13:26:13 | FromGitter | <gogolxdong> array won't be gc'ed right? |
13:26:20 | FromDiscord | <Varriount> Well, yes |
13:27:08 | FromGitter | <gogolxdong> Does it count as object pooling? Is there a pattern of doing so, or just make it array? |
13:27:42 | FromDiscord | <Varriount> Just make an array, and have some flag in an object that shows whether it's in-use or not. |
13:27:55 | FromDiscord | <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:25 | FromDiscord | <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:26 | disbot | ➥ unify tuple expressions |
13:43:15 | * | aEverr quit (Ping timeout: 250 seconds) |
13:43:40 | krux02 | Varriount: They are failures. |
13:43:47 | krux02 | I am currently looking into them. |
13:43:53 | * | aEverr joined #nim |
13:44:04 | krux02 | The failure in ast_pattern_mathcing I thought I fixed. On my machine I don't get a problem anymore. |
13:44:32 | krux02 | That 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:38 | krux02 | easy fix. |
13:45:05 | FromDiscord | <Varriount> I don't suppose there's a way to make the change backwards compatible? |
13:47:12 | dom96 | yay, glad my repro is useful |
13:47:19 | dom96 | I was afraid I'd be told "You're using it wrong" |
13:48:06 | krux02 | dom96, what repro are you talking about? |
13:48:55 | FromGitter | <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:08 | dom96 | krux02, #13794 |
13:49:09 | disbot | https://github.com/nim-lang/Nim/issues/13794 -- 3hashset regression ; snippet at 12https://play.nim-lang.org/#ix=2fOK |
13:49:23 | PMunch | Hmm, what do you guys use for streaming? |
13:50:01 | krux02 | PMunch, twitch |
13:50:13 | krux02 | and obs studio |
13:50:21 | PMunch | Have they relaxed their "only games" policy? |
13:50:46 | dom96 | that hasn't been a thing ever since I can remember |
13:50:48 | FromDiscord | <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:27 | FromDiscord | <Recruit_main707> btw is version 1.1 devel? |
13:51:41 | dom96 | yes |
13:51:55 | FromDiscord | <Varriount> PMunch: I listen to disruptek's stream |
13:52:07 | FromDiscord | <Recruit_main707> how much do you calculate for 1.2 to be released? |
13:52:07 | FromDiscord | <Varriount> He works on the compiler. |
13:55:56 | PMunch | dom96, I'm pretty sure that was a thing in the beginning.. |
13:56:06 | PMunch | Varriount, oh cool |
13:56:21 | PMunch | I was just considering to stream me hacking on something, for lack of anything better to do |
13:58:58 | FromDiscord | <Varriount> PMunch: I'd listen to it. |
13:59:17 | FromDiscord | <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:46 | FromDiscord | <Varriount> What are you thinking of doing? |
14:00:02 | PMunch | Probably 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:09 | FromDiscord | <Varriount> PMunch: Well post a link when you get things up and running |
14:11:37 | PMunch | I wont do it just yet, have to go out and shovel some snow first :P |
14:13:08 | dom96 | ahh, would love some snow right about now |
14:13:52 | PMunch | You can have some of ours.. |
14:14:02 | PMunch | I can barely get out the front door because of all the snow |
14:17:22 | FromDiscord | <Varriount> Meanwhile, the weather roulette has decided to grace the East coast of the US with traditionally seasonal weather for once. |
14:17:45 | FromDiscord | <Varriount> (Cool, with mild rain showers) |
14:19:13 | * | lritter joined #nim |
14:20:07 | disruptek | in new york, it's raining men. |
14:20:15 | FromGitter | <zetashift> Hallelujah? |
14:20:21 | dom96 | nooo, don't put that song in my head |
14:22:59 | FromGitter | <zetashift> just let it in dom96 |
14:23:20 | Zevv | dom96: you don't really care for music, do ya? |
14:25:33 | disruptek | zevv lives |
14:25:51 | disruptek | dude, let's build some corona badges running nim. |
14:26:28 | dom96 | so, 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:13 | PMunch | Nice! |
14:32:18 | * | silvernode joined #nim |
14:32:22 | PMunch | What phone though? |
14:32:41 | dom96 | One Plus 3T |
14:33:19 | PMunch | Good, it wouldn't be that impressive if it was a top-tier flagship :P |
14:33:55 | dom96 | It 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:50 | dom96 | The 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:50 | dadada | PMunch: 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:04 | PMunch | I think it would need to take a block though |
15:03:12 | PMunch | Because of scoping things |
15:05:33 | * | Trustable joined #nim |
15:06:13 | dadada | can 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:40 | PMunch | Sure |
15:09:46 | PMunch | Well, it will be another do block |
15:09:51 | * | defection quit (Ping timeout: 260 seconds) |
15:10:55 | PMunch | It would look like this: https://play.nim-lang.org/#ix=2fTd |
15:11:05 | * | PMunch quit (Quit: leaving) |
15:11:33 | dadada | PMunch: 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:34 | dadada | oh man, timeout |
15:22:03 | leorize | dom96: now I see why threading is evil :P |
15:33:56 | dom96 | You couldn't see that before? |
15:34:13 | FromGitter | <timotheecour> hi @dom96 |
15:34:41 | FromGitter | <timotheecour> can you please try https://github.com/nim-lang/Nim/pull/13800 and see if it fixes your problem? |
15:42:56 | dom96 | Looks like it does |
15:43:13 | dom96 | Tested it with my game and there is no perf degradation |
15:43:28 | FromGitter | <timotheecour> awesome |
15:44:22 | FromGitter | <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:09 | axion | That 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:06 | FromGitter | <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:04 | liblq-dev | @rishavs `seq[Directions]`, not `newSeq[Directions](4)` |
17:35:15 | liblq-dev | if you want a statically-sized array, use `array[4, Directions]` |
17:35:16 | FromGitter | <rishavs> Thanks! |
17:35:36 | liblq-dev | because `newSeq[Directions](4)` creates a new sequence with the size of 4 |
17:35:41 | liblq-dev | and `seq` is a type |
17:35:47 | FromGitter | <rishavs> the seq can have anything from 0 to 4 items so I think i should stick toseq |
17:36:04 | liblq-dev | use whatever suits you best. |
18:02:20 | reversem3 | How would you do a link list in nim ? |
18:02:52 | reversem3 | * How would you do a linked list in nim ? I'm (learning) from C to nim |
18:03:10 | FromDiscord | <Varriount> reversem3: Use a reference type to refer to itself |
18:03:13 | shashlick | there's a lists module |
18:03:19 | shashlick | see how it works |
18:05:22 | * | jjido joined #nim |
18:06:06 | reversem3 | ahh ok very cool thanks |
18:10:45 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:10:51 | reversem3 | so *head -> blockdata would be a type Node = ref Object firstBlock: head ? |
18:12:26 | * | dadada quit (Ping timeout: 256 seconds) |
18:15:27 | reversem3 | or 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:58 | FromDiscord | <exelotl> gonna re-post this userscript I made the other week: https://gist.github.com/exelotl/c0c4b79932d977869811e518b2198b8c |
19:11:16 | FromDiscord | <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:50 | FromDiscord | <Rika> You can always just make a chrome search engine |
19:14:00 | FromDiscord | <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:08 | Yardanico | @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:33 | Yardanico | It supports Nim too, for both stdlib (although not for some new stdlib modules), files in same project or nimble |
19:28:03 | Yardanico | also no support for /[] import syntax, but I guess we can send a PR to add that |
19:28:31 | Yardanico | also no support for "import except" :D |
19:28:58 | Yardanico | it looks like that - https://i.imgur.com/r2D4QPo.png |
19:29:30 | Yardanico | and 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:00 | FromDiscord | <exelotl> ohh that's cool |
19:34:16 | Yardanico | seems it's also available for firefox - https://addons.mozilla.org/en-GB/firefox/addon/module-linker/ |
19:34:48 | Yardanico | https://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:28 | FromGitter | <zetashift> is it stable enough that it needs no updates? |
19:47:44 | * | NimBot joined #nim |
19:54:25 | PMunch | reversem3, 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:30 | Guest60132 | PMunch: (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:03 | PMunch | Ah yes I saw that, that was indeed the plan |
19:57:10 | PMunch | Anything 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:42 | PMunch | Hmm, I have something that start pulseaudio and keeps restarting it when I kill it |
20:21:47 | PMunch | But I'm not sure what.. |
20:21:51 | Yardanico | your DE :P |
20:21:58 | PMunch | I don't have one.. |
20:22:53 | Yardanico | hmm, 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:45 | PMunch | Yeah, 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:26 | Zevv | aaah pulse, one of the loves of my life |
20:28:44 | Yardanico | Zevv: you forgot the /s :P |
20:28:47 | Zevv | the other ones are systemd and network manager |
20:29:00 | FromDiscord | <Benumbed> gross Zevv haha |
20:29:05 | PMunch | Always such a massive pain in the ass.. |
20:29:24 | Zevv | Interestingy enough 2 out of 3 are by the same author |
20:29:35 | PMunch | brb |
20:29:36 | * | narimiran quit (Quit: leaving) |
20:29:36 | * | PMunch quit (Quit: leaving) |
20:29:39 | Zevv | one can not simply kill pulseaudio |
20:29:54 | Zevv | one needs to use pasuspender |
20:29:57 | Yardanico | I 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:21 | Zevv | I've been fighting audio on linux for decades |
20:30:35 | Zevv | I'd really prefer to run jack for everything, but it's not widely supported |
20:30:43 | Zevv | and there are apps these days that run on pulse only |
20:30:49 | Yardanico | well, for alsa there's apulse |
20:30:50 | Zevv | so you need pulse, and pulse does not go together with jack |
20:31:37 | FromDiscord | <clyybber> acktually |
20:32:13 | * | PMunch joined #nim |
20:32:18 | * | jjido joined #nim |
20:32:31 | leorize | PMunch: if you have anything that requests pulseaudio it will keeps respawning |
20:32:42 | leorize | edit /etc/pulse/client.conf and turn off autospawn |
20:33:30 | FromDiscord | <clyybber> I'm using pulseaudio alongside jack regularily |
20:33:36 | FromDiscord | <clyybber> and it was working happily |
20:33:37 | PMunch | Ah, it should be fine now |
20:33:41 | PMunch | Just needed the ol' reboot |
20:33:48 | FromDiscord | <clyybber> but one day it started to fuck firefox up |
20:34:28 | FromDiscord | <clyybber> pulseaudio isn't in the same league as systemd or networkmanager imo |
20:34:29 | leorize | I'm waiting for pipewire |
20:34:32 | FromDiscord | <clyybber> its way better |
20:34:41 | FromDiscord | <clyybber> leorize: Yeah pipewire looks promising |
20:34:45 | leorize | jack is nice and all, but pulseaudio just works :) |
20:34:55 | FromDiscord | <clyybber> jack just works too |
20:35:01 | Zevv | until you want to do something serious with sound |
20:35:06 | Yardanico | or play osu! :D |
20:35:25 | leorize | jack works after a lot of tweaking and tuning the parameters :) |
20:35:32 | FromDiscord | <clyybber> eh |
20:35:34 | leorize | also the docs are lacking |
20:35:35 | Yardanico | (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:47 | FromDiscord | <clyybber> tuning the buffer size and stuff isn't gonna be helped by pipewire I think |
20:35:50 | FromDiscord | <Rika> oh no heres the osu dude |
20:36:03 | FromDiscord | <clyybber> said the other osu dude |
20:36:04 | Yardanico | I only have 2800pp, not really a good osu! player |
20:36:14 | FromDiscord | <Rika> i dont even have 2k |
20:36:19 | FromDiscord | <Rika> though i have 5k on ctb |
20:36:24 | Yardanico | wtf |
20:36:31 | leorize | I stopped playing before pp was a thing :) |
20:36:57 | Zevv | I 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:03 | Zevv | works :) |
20:37:36 | Yardanico | leorize: 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:03 | FromDiscord | <clyybber> why are there so many osu clients |
20:38:11 | FromDiscord | <clyybber> I believe theres even one in nim |
20:38:20 | leorize | I saw it, and I found out that I'm still bad at osu! :p |
20:38:21 | Yardanico | well they're not exactly "osu clients" |
20:38:39 | Yardanico | there's only 1 official one, and one in the works (osu!lazer), all others are technically osu! clones and not clients :P |
20:38:54 | Yardanico | @clyybber AFAIK there's only my osureplay lib for parsing osu! replays in Nim |
20:39:16 | FromDiscord | <clyybber> oh |
20:39:21 | FromDiscord | <clyybber> then that was that 😄 |
20:39:23 | leorize | there's also a pp calculator made by someone |
20:39:26 | leorize | !repo osu |
20:39:37 | leorize | disbot? |
20:39:40 | FromDiscord | <Rika> im still working on mine ;; |
20:40:19 | FromDiscord | <clyybber> is there any particular reason why there are so many osu clients? |
20:40:29 | FromDiscord | <Rika> theyre not clients |
20:40:34 | FromDiscord | <clyybber> clones then |
20:40:34 | FromDiscord | <Rika> theyre just utility libraries |
20:40:37 | FromDiscord | <Rika> oh really? |
20:40:39 | FromDiscord | <Rika> dunno |
20:40:44 | FromDiscord | <Rika> because osu!stable isnt open source |
20:40:48 | Yardanico | @clyybber well, because they provide different options for customization and stuff |
20:40:58 | Yardanico | like McOsu allows you to modify A LOT of stuff about beatmaps and the game |
20:41:03 | Yardanico | oshu is just a simple Java osu! clone |
20:41:12 | Yardanico | (McOsu is in C++ btw) |
20:42:43 | Yardanico | leorize: for osu I only found https://github.com/de-odex/circa but it doesn't seem to calculate pp |
20:42:50 | FromDiscord | <Rika> IM NOT DONE YET |
20:42:53 | FromDiscord | <Rika> GOD |
20:42:54 | FromDiscord | <clyybber> haha |
20:42:54 | FromDiscord | <Rika> ;; |
20:43:02 | FromDiscord | <Rika> IM WORKING ON IT PLEASE ;; |
20:43:17 | FromDiscord | <Rika> i swear ill literally explode |
20:43:28 | Yardanico | actually 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:40 | Yardanico | https://github.com/Yardanico/pippy |
20:43:44 | FromDiscord | <Rika> ok so yall know, i'm `de/odex` and `aEverr`, im only `Rika` in discord |
20:43:50 | Yardanico | lol |
20:44:02 | Yardanico | @Rika i'm gonna hard fork your circa lib!11 |
20:44:28 | FromDiscord | <Rika> Yardanico maybe because francesco or whatever his name was already made `pyttanko` |
20:44:47 | Yardanico | No, I mean I deleted the Nim version |
20:44:54 | FromDiscord | <Rika> huh |
20:44:59 | FromDiscord | <Rika> dunno then, you weird |
20:45:11 | Yardanico | probs because I saw oppai-ng (fast PP calculator in C) and became too depressed |
20:45:18 | PMunch | https://www.twitch.tv/pmunche |
20:45:26 | FromDiscord | <Rika> what's the e there for |
20:45:29 | Yardanico | wow PMunch can stream too |
20:45:30 | PMunch | Testing out to see if my streaming setup works |
20:45:39 | leorize | so many people streaming these days |
20:45:43 | Yardanico | i should start too |
20:45:47 | FromDiscord | <Rika> why's there an e on your name, is there really one? |
20:45:54 | Yardanico | I actually streamed Nim programming like 2 years ago |
20:45:59 | FromDiscord | <Rika> i "started" until i didnt |
20:46:14 | leorize | ah, the best way to test out a stream, showing how nimble doesn't work :) |
20:46:47 | FromDiscord | <Rika> lmao |
20:47:06 | FromDiscord | <Rika> Yardanico, since you mentioned it, ill continue with my lib now. reeee |
20:48:02 | Yardanico | and 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:09 | Yardanico | ahh good times |
20:49:48 | leorize | PMunch: your network is better than disruptek, I'm getting only 3s lag :) |
20:54:28 | PMunch | dadada, are you online? |
20:54:49 | dadada | PMunch: yeah |
20:55:34 | PMunch | What was the other issue you had with extract? |
20:55:40 | PMunch | The horizontal/vertical thing |
20:56:48 | dadada | ah, 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:35 | FromDiscord | <clyybber> @Rika lol so you were the guy that pinged everyone |
20:57:58 | dadada | I thought it might be a good idea, to have something like `foo|` to contrast with `foo*`, yet it's probably not necessary |
20:58:01 | PMunch | dadada, yeah but what was your example? |
20:58:08 | PMunch | Like what was the actual issue |
20:58:29 | PMunch | Yeah that's not necessary, but I wanted to make the * work properly |
20:59:28 | dadada | I'm counting on you, I've put the work on macro on hold until this works |
20:59:29 | dadada | :-) |
20:59:33 | dadada | on a |
20:59:36 | * | natrys quit (Quit: natrys) |
21:03:04 | FromDiscord | <Rika> NO |
21:03:05 | FromDiscord | <Rika> IM NOT |
21:03:07 | FromDiscord | <Rika> WHAT |
21:03:14 | FromDiscord | <Rika> ;; |
21:04:05 | Yardanico | ? |
21:04:10 | Yardanico | ah lol |
21:04:26 | FromDiscord | <clyybber> @Rika I think you are 😄 |
21:04:42 | FromDiscord | <Rika> ;; sorry |
21:04:45 | FromDiscord | <Rika> wasnt malicious |
21:07:58 | dadada | PMunch: did you stream? |
21:08:05 | PMunch | I'm streaming now |
21:08:14 | PMunch | But I'm mostly just testing that it works |
21:08:16 | dadada | where? |
21:08:25 | Yardanico | twitch.tv/pmunche |
21:08:53 | dadada | thanks, PMunch, you need to keep posting the link here like disruptek does, this really motivates people to take a look |
21:10:13 | dadada | I'm tuned in :-) what desktop do you use? |
21:10:21 | PMunch | i3 |
21:12:38 | PMunch | krux02, twitch.tv/pmunche |
21:19:51 | * | tane_ quit (Quit: Leaving) |
21:20:10 | FromDiscord | <Lantos> are you showing us some macro magic |
21:21:55 | PMunch | Right now I'm just messing about |
21:22:03 | PMunch | I was thinking about streaming me fixing macroutils |
21:22:30 | PMunch | But 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:09 | FromDiscord | <Lantos> yes, the successful code streams seem to be like scheduled |
21:25:06 | PMunch | dadada, do you have the example that failed? |
21:28:20 | Yardanico | @Rika why LGPL-3 on your circa lib |
21:28:26 | Yardanico | kinda meh |
21:28:42 | FromDiscord | <Yardanico> @Rika |
21:30:22 | FromDiscord | <Yardanico> can you relicense it to MIT/Apache/BSD since you're the sole contributor to it (at the moment)? 😛 |
21:31:17 | leorize | or MPL if you love copyleft |
21:31:50 | Yardanico | the Mozilla's one or Microsoft's one? :D |
21:31:55 | leorize | mozilla's |
21:33:01 | Yardanico | oh MPL is kinda nice |
21:33:19 | Yardanico | it's really a good alternative for MIT/BSD if you want people to contribute to your project I guess |
21:33:45 | leorize | in Nim land, LGPL is the same as GPL, because we don't do dynamic linking |
21:33:53 | Yardanico | yeah, that's the thing |
21:34:07 | Yardanico | that's why I absolutely don't understand when people use LGPL or GPL for licensing libraries |
21:34:26 | Yardanico | I mean in languages where there's no dynamic linking :P |
21:35:08 | Yardanico | a 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:15 | Yardanico | they relicensed them under MIT after that :) |
21:36:38 | leorize | well gpl is not too bad, it's just not really great given the current status of nim ecosystem |
21:36:48 | Yardanico | I 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:37 | FromDiscord | <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:47 | Yardanico | ohhh I understand now yeah |
21:39:00 | Yardanico | I had thought about the same with another projects, yeah |
21:39:01 | FromDiscord | <Rika> and slider uses lgpl 3 |
21:39:19 | Yardanico | Like should a code translation (with some modifications) be licensed under the same license or not |
21:39:23 | FromDiscord | <Rika> mhm |
21:39:30 | FromDiscord | <Rika> actually theres a lot of modifications |
21:39:34 | leorize | yes, it'll be under the same license |
21:39:36 | FromDiscord | <Rika> because numpy aint in nim lmao |
21:39:47 | Yardanico | you can still use it with nimpy :P |
21:39:49 | FromDiscord | <Rika> so yeah sadly its not my call to change it lol |
21:39:52 | FromDiscord | <Rika> i dont want to |
21:39:59 | Yardanico | but calling numpy like nim->nimpy->python->numpy is meh |
21:39:59 | FromDiscord | <Rika> sounds like unnecessary translation |
21:40:09 | FromDiscord | <Rika> mhm |
21:40:28 | Yardanico | well ok then I won't look at circa code anymore |
21:40:33 | Yardanico | so I wouldn't be copying it :P |
21:40:45 | Yardanico | https://github.com/Francesco149/oppai-ng is under Unlicense btw, just so you know |
21:40:52 | Yardanico | Unlicense is basically public domain |
21:41:38 | leorize | public domain is not legal everywhere though |
21:41:41 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:41:49 | Yardanico | well they include a statement for that in the license |
21:42:05 | FromDiscord | <Rika> > <Yardanico> https://github.com/Francesco149/oppai-ng is under Unlicense btw, just so you know |
21:42:06 | FromDiscord | <Rika> but then why would you convert it to pure nim, its in pure C already 😛 |
21:42:35 | FromDiscord | <Rika> > <Yardanico> well ok then I won't look at circa code anymore |
21:42:35 | FromDiscord | <Rika> this is sad, i'm being cucked by a license choice i didnt make |
21:42:38 | Yardanico | because it will be in Nim and I will be able to understand it better :P |
21:42:45 | FromDiscord | <Rika> i'll ask lllllllllllll to change the license or something |
21:43:32 | Yardanico | oppai-ng is just roughly ~3kloc (actual code) |
21:43:38 | Yardanico | not that much |
21:44:17 | FromDiscord | <Rika> what's so bad about LGPL though? |
21:44:31 | FromDiscord | <Rika> i mean i know its much worse than the other licenses |
21:44:56 | Yardanico | in nim land, as leorize said, LGPL is same as GPL |
21:45:05 | Yardanico | so all your nim apps MUST be licensed under LGPL/GPL |
21:45:12 | Yardanico | if you use circa nim lib |
21:45:28 | FromDiscord | <Rika> ah license virus |
21:45:31 | Yardanico | so you couldn't create proprietary apps with "circa" lib really |
21:45:41 | leorize | that's a feature :P |
21:45:42 | FromDiscord | <Rika> oi stop targeting me |
21:45:51 | FromDiscord | <Rika> its not my fault ;; |
21:45:57 | Yardanico | there's also AGPL which extends GPL for serverside code |
21:46:12 | leorize | it's not that you have to license it under gpl/lgpl |
21:46:18 | leorize | you can license it under anything |
21:46:27 | Yardanico | but you have to keep it fully open source, right? |
21:46:32 | leorize | yep |
21:46:34 | FromDiscord | <clyybber> deck/stack destruction virus |
21:46:50 | FromDiscord | <Rika> `stack destruction virus` sounds like altered carbon to me |
21:47:00 | Yardanico | btw, about AGPL - how will people even find out that your website's backend uses AGPL libs? :D |
21:47:12 | FromDiscord | <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:50 | FromDiscord | <clyybber> bb Yardanico |
22:03:01 | Yardanico | well not from IRC, just from mumble :P |
22:03:14 | Yardanico | I'm actually on 24/7 in IRC since I run Quassel |
22:05:22 | FromDiscord | <clyybber> oh yeah, I just missed saying goodbye on mumble |
22:05:46 | FromDiscord | <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:06 | FromGitter | <sealmove> hey is anyone here? I need help with something simple |
22:30:23 | FromGitter | <sealmove> I need to make an alias on "result" variable |
22:30:27 | FromDiscord | <Rika> hello |
22:30:32 | FromDiscord | <Rika> what do you mean? |
22:30:50 | FromGitter | <sealmove> so for example "this.someThing" should be exactly the same as "result.someThing" |
22:31:15 | FromDiscord | <Rika> i dont understand |
22:31:18 | FromDiscord | <Rika> still |
22:31:26 | Yardanico | @Rika to be able to alias result as something else |
22:31:35 | Yardanico | so "this.stuff = 5" is the same as "result.stuff = 5" |
22:32:00 | FromDiscord | <Rika> maybe a template `var \` |
22:32:02 | FromDiscord | <Rika> damn it |
22:32:06 | FromDiscord | <Rika> sorry premature enter |
22:32:41 | FromDiscord | <Rika> some template that does "var `alias` = result; defer: return `alias`" |
22:33:04 | FromDiscord | <Rika> but this still allows result to be usable |
22:34:16 | FromGitter | <sealmove> or maybe it's more clever if I do something like this? https://play.nim-lang.org/#ix=2fW3 |
22:36:51 | FromGitter | <sealmove> oh wow, "this" seems to have special meaning |
22:37:07 | Yardanico | yes |
22:37:26 | Yardanico | https://nim-lang.org/docs/manual_experimental.html#automatic-self-insertions |
22:37:44 | Yardanico | it's not a keyword though so you can use it safely |
22:38:31 | FromGitter | <sealmove> yes, I checked the keywords, that's why I was surprised |
22:38:52 | Yardanico | well a pragma doesn't need to be a keyword :) |
22:40:38 | Yardanico | I 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:32 | leorize | @sealmove: https://play.nim-lang.org/#ix=2fW7 |
22:42:33 | PMunch | Managed to close mumble by accident |
22:42:36 | PMunch | But I'm off to bed now, |
22:42:43 | krux02 | good night |
22:42:43 | PMunch | Might stream more tomorrow after work |
22:42:48 | Zevv | sweet dreams |
22:42:48 | FromDiscord | <Rika> why is `this` deprecated btw |
22:42:50 | FromGitter | <sealmove> good night! |
22:43:01 | * | PMunch quit (Quit: leaving) |
22:43:15 | leorize | @Rika: it can be done with a macro, so we don't need more magic |
22:43:48 | FromDiscord | <Rika> so what macro is that now |
22:44:10 | leorize | std/with |
22:44:30 | leorize | https://play.nim-lang.org/#ix=2fW7 <- how to alias something :P |
22:44:50 | FromDiscord | <clyybber> I think one could be able to fully replicate {.this.} as a macro |
22:45:39 | leorize | that's not possible actually |
22:46:00 | leorize | {.this.} work in the same scope |
22:46:16 | FromDiscord | <clyybber> wdym? |
22:46:22 | FromDiscord | <clyybber> I mean like as a proc annotation |
22:46:35 | FromDiscord | <clyybber> It should get the proc definition and body passed to it |
22:46:39 | FromDiscord | <clyybber> right? |
22:47:00 | leorize | you write {.this: something.} then every proc after that implicitly use `something` as `this` |
22:47:29 | FromDiscord | <clyybber> oh |
22:47:30 | FromDiscord | <clyybber> right |
22:47:38 | FromDiscord | <clyybber> actually, maybe you can do that too |
22:47:39 | leorize | but yes, you can implement it as a proc annotation, though you can just use `with` in the proc body |
22:47:47 | FromDiscord | <clyybber> via push: someCustomThisMacro |
22:47:56 | leorize | does that even work? |
22:48:00 | FromDiscord | <clyybber> I dunno |
22:48:01 | FromDiscord | <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:08 | FromGitter | <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:46 | FromDiscord | <clyybber> leorize: Seems like theres an issue about it: https://github.com/nim-lang/Nim/issues/12867 |
22:55:52 | FromDiscord | <clyybber> sealmove: Nice, congrats! |
22:55:59 | FromGitter | <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:38 | FromGitter | <sealmove> Really I want to do it in Nim some day, but there are some issues with it. Here are my thoughts: |
23:04:48 | FromGitter | <sealmove> There are 2 options: |
23:04:55 | FromGitter | <sealmove> 1) do it at CT |
23:04:59 | FromGitter | <sealmove> 1) do it at RT |
23:05:03 | FromGitter | <sealmove> 2* |
23:05:15 | FromDiscord | <exelotl> `with` in the standard library is nowhere close to `this` in terms of convenience or power |
23:05:34 | FromGitter | <sealmove> #1 needs a CT yaml parser, and #2 needs compiler as API which is messy imo |
23:06:26 | FromGitter | <sealmove> unless I don't use AST and do it with strings |
23:06:42 | FromGitter | <sealmove> what do you think guys? would producing nim code with string be such a bad idea? |
23:07:12 | FromDiscord | <clyybber> why do you need the compiler as an api? |
23:07:22 | FromDiscord | <clyybber> can't you simply generate type sections? |
23:07:28 | FromDiscord | <clyybber> out of the yaml? |
23:08:29 | FromGitter | <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:27 | Yardanico | what 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:44 | Yardanico | YAML can be mapped 1:1 to JSON afaik |
23:13:07 | FromGitter | <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:10 | Yardanico | you can check how nimterop does things, I think you may use the same approach |
23:14:09 | FromGitter | <sealmove> I'll definitely check it out, it seems the best way out of this mess... |
23:16:06 | shashlick | sealmove happy to help |
23:16:35 | shashlick | See ast2 which does everything at runtime using compiler api which is very nice |
23:16:57 | FromGitter | <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:53 | shashlick | Have been reimplementing the backend the right way for 3 months now |
23:18:07 | FromGitter | <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:17 | shashlick | I think it should be possible to collaborate |
23:18:24 | shashlick | CT is slow |
23:19:05 | shashlick | But what exactly is the goal |
23:19:13 | shashlick | Not familiar with kaitai |
23:19:26 | FromDiscord | <clyybber> sealmove: What is the perfect way? |
23:19:37 | FromDiscord | <clyybber> I guess parse YAML at CT and generate type sections |
23:19:42 | FromDiscord | <clyybber> That should be possible |
23:19:47 | Yardanico | @clyyber nimyaml doesn't support CT |
23:19:53 | Yardanico | but I guess it can be possible to implement that |
23:19:57 | Yardanico | shashlick: https://kaitai.io/ |
23:19:59 | FromDiscord | <clyybber> Yeah, you'd have to implement it |
23:20:05 | shashlick | Is it like protobuf |
23:20:18 | FromGitter | <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:29 | Yardanico | nimyaml at CT should be entirely possible :P |
23:20:31 | FromDiscord | <clyybber> sealmove: Impossible to implement yaml at CT? |
23:20:33 | FromGitter | <sealmove> I read the whole yaml spec, it's an ugly mess |
23:20:37 | Yardanico | json module works at CT too |
23:20:37 | FromDiscord | <clyybber> That is definitely possible |
23:20:41 | FromDiscord | <clyybber> sealmove: Yeah |
23:20:43 | FromDiscord | <clyybber> thats true |
23:20:48 | FromGitter | <sealmove> clyyber yes, it's practically impossible |
23:21:01 | FromDiscord | <clyybber> for sure its not |
23:21:29 | FromGitter | <sealmove> I mean, of course it's possible, but very very difficult, not worth the time |
23:21:45 | FromDiscord | <clyybber> do you think kaitai in general is worth the time? |
23:21:57 | Yardanico | also I'm wondering this as well :P |
23:22:01 | FromGitter | <sealmove> yes, truly believe so |
23:22:14 | FromGitter | <sealmove> at least for my type of work |
23:22:28 | Yardanico | we have nesm and binaryparser in nim |
23:22:58 | Yardanico | did you see https://github.com/xomachine/NESM and https://github.com/PMunch/binaryparse ? |
23:23:35 | FromDiscord | <clyybber> sealmove: Did you try patching nimyaml to work at CT? |
23:23:51 | Yardanico | @clyybber there's this issue, not by sealmove though https://github.com/flyx/NimYAML/issues/70 |
23:23:58 | FromDiscord | <clyybber> yeah |
23:24:05 | FromDiscord | <clyybber> I was looking at that right now |
23:24:44 | FromDiscord | <clyybber> Seems to be a matter of inlining/getting rid of the sourceprovider concept or translating it to a generic |
23:24:46 | FromGitter | <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:08 | FromGitter | <sealmove> clyybber: no I didn't really try, it's beyond me... |
23:25:28 | FromDiscord | <clyybber> sealmove: I think it would take you far less than half a year |
23:25:33 | FromDiscord | <clyybber> maybe a few days |
23:25:41 | FromGitter | <sealmove> if i knew how to do it probably |
23:26:36 | FromDiscord | <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:24 | shashlick | Just do it how toast does it |
23:27:36 | shashlick | Runtime for yaml |
23:27:45 | shashlick | Generate Nim |
23:28:06 | shashlick | Pull in using parseStmt |
23:28:25 | FromGitter | <sealmove> So compiler as API option |
23:29:01 | * | rnrwashere quit (Remote host closed the connection) |
23:30:29 | FromDiscord | <clyybber> or just try to fix nimyaml |
23:30:48 | FromDiscord | <clyybber> a bit harder |
23:30:57 | FromGitter | <sealmove> great, nobody agrees how it should be done :P I am so confused now |
23:31:16 | FromDiscord | <clyybber> making nimyaml work at ct has more benefits |
23:31:31 | FromDiscord | <clyybber> and it is less hacky |
23:31:44 | FromDiscord | <clyybber> it is "the perfect solution" |
23:33:07 | FromGitter | <sealmove> that I agree... |
23:33:38 | * | dadada joined #nim |
23:33:39 | FromGitter | <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:04 | FromGitter | <sealmove> so kaitai struct as nim library, instead of external program |
23:39:29 | FromGitter | <sealmove> Ok, I will try to do that next. But first I will finish the native back-end (in Scala). |
23:39:44 | FromGitter | <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) |