00:11:24 | * | yassernasc quit (Remote host closed the connection) |
00:19:34 | * | krux02 quit (Remote host closed the connection) |
00:20:19 | * | krux02 joined #nim |
00:20:53 | FromDiscord | <ynfle> Beef, can I ask you some questions about `sigmatch.typeRel`? |
00:31:08 | FromDiscord | <Elegantbeef> sure |
00:33:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
00:33:38 | FromDiscord | <ynfle> It doesn't show up on the stacktrace |
00:33:53 | FromDiscord | <ynfle> Is that because it just returns the wrong result? |
00:34:46 | FromDiscord | <Elegantbeef> Yes it's doing the type comparisons for the calls, so it uses the return value |
00:34:58 | FromDiscord | <ynfle> It seems that the `typed` case return `isGeneric`. What is the "correct" return value? I think I need one that would say they are compatible types |
00:36:22 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/32d4bf352585a4fc4a6fa1bd24b270af087b0372/compiler/types.nim#L29-L43 |
00:36:43 | FromDiscord | <Elegantbeef> I think the issue is in typerel it might be elsewhere |
00:37:31 | FromDiscord | <Elegantbeef> You'll need to investigate going up with the stack trace |
00:37:56 | FromDiscord | <Elegantbeef> I just assumed it came from there it might be in other places |
00:38:04 | FromDiscord | <Elegantbeef> You need to play detective to fix X doesnt work but should |
00:39:52 | FromDiscord | <ynfle> It seems it return none |
00:39:58 | FromDiscord | <ynfle> `isNone` |
00:42:49 | FromDiscord | <Elegantbeef> That's the process i take, use the stack trace to know where the problem goes and figure out why it thinks it's wrong |
00:43:13 | FromDiscord | <Elegantbeef> So then time for you to figure out why it does |
00:43:17 | * | Mister_Magister quit (Excess Flood) |
00:43:37 | * | Mister_Magister joined #nim |
00:44:06 | FromDiscord | <ynfle> Thanks man |
00:44:16 | FromDiscord | <ynfle> Thanks individual |
00:44:19 | FromDiscord | <ynfle> Sorry |
00:46:25 | FromDiscord | <ynfle> What does `aOrig` represent the candidate match? |
00:46:30 | FromDiscord | <ynfle> (edit) "represent" => "represent," |
00:46:41 | FromDiscord | <Elegantbeef> The actual |
00:48:03 | FromDiscord | <Elegantbeef> you can `echo aOrig, " ", formal` |
00:48:59 | FromDiscord | <ynfle> I did |
00:49:20 | FromDiscord | <ynfle> It seems like it's a candidate sym when it's a nnkclosedsymchoice |
00:51:11 | FromDiscord | <ynfle> Ok. so varargs returns isnone, while typed itself return isgeneric |
00:57:45 | * | krux02 quit (Remote host closed the connection) |
01:03:13 | FromDiscord | <ynfle> What is a supposed to represent? More specifically `a.flags`? |
01:04:02 | FromDiscord | <Elegantbeef> those are type flags |
01:04:08 | FromDiscord | <Elegantbeef> You can read most of the flags |
01:04:21 | FromDiscord | <Elegantbeef> it holds a bunch of information for type |
01:15:09 | FromDiscord | <ynfle> What does `tfVarargs in a.flags` mean? |
01:15:29 | FromDiscord | <Elegantbeef> `a.flags` is a bitset so if `tfVarags in a.flags` |
01:15:51 | FromDiscord | <ynfle> What would it mean if tfVarargs is in a.flags? |
01:16:21 | FromDiscord | <Elegantbeef> `a` is a varargs i assume |
01:17:15 | FromDiscord | <Elegantbeef> Ah sorry that's C style varargs |
01:17:24 | FromDiscord | <Elegantbeef> The flags have documentation |
01:17:24 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L505 |
01:17:42 | FromDiscord | <ynfle> No. It would have kind of tyVarargs if itself was varargs |
01:18:03 | FromDiscord | <ynfle> Can I import the compiler? |
01:18:23 | FromDiscord | <Elegantbeef> Yes the compiler can be used as a library |
01:19:09 | FromDiscord | <Elegantbeef> Not that it matters for this problem |
01:19:28 | FromDiscord | <ynfle> https://play.nim-lang.org/#ix=3NqV |
01:19:52 | FromDiscord | <Elegantbeef> Well yea it's not in path |
01:19:55 | FromDiscord | <ynfle> In reply to @Elegantbeef "Not that it matters": It help with debugging enum. nim-gdb.py isn't so helpful just gives the number not the string value |
01:20:04 | FromDiscord | <ynfle> In reply to @Elegantbeef "Well yea it's not": How do I get it in path |
01:20:06 | FromDiscord | <Elegantbeef> I mean just echo |
01:20:17 | FromDiscord | <Elegantbeef> echo works |
01:21:41 | FromDiscord | <ynfle> in gdb? How? |
01:21:51 | FromDiscord | <ynfle> echo aOrig.flags↵aOrig.flags |
01:21:56 | FromDiscord | <ynfle> This is what I get |
01:21:58 | FromDiscord | <Elegantbeef> I mean put an echo in the compiler |
01:22:08 | FromDiscord | <ynfle> RIght, but I have to recompile |
01:22:14 | FromDiscord | <ynfle> Either way I just installed using nimble |
01:22:41 | FromDiscord | <Elegantbeef> Yea but the recompile shouldnt be too long |
01:22:56 | FromDiscord | <ynfle> Ya but then i'd have to restart the debug session |
01:22:59 | FromDiscord | <Elegantbeef> `./koch temp c ./yourTestFile.nim` |
01:23:20 | FromDiscord | <Elegantbeef> Dont use a debugger |
01:24:32 | FromDiscord | <ynfle> Why? I find it helps alot |
01:24:41 | FromDiscord | <Elegantbeef> Not that i've often used a debugger anywhere, so i'm biased, there isnt any weird flow logic so printing values is more than enough |
01:25:43 | FromDiscord | <Elegantbeef> I can probably count on one hand the amount of times i've reached for a debugger 😀 |
01:25:50 | FromDiscord | <ynfle> Nice |
01:26:07 | FromDiscord | <Elegantbeef> So my view is mostly swayed that thay're not overly needed |
01:27:19 | FromDiscord | <Elegantbeef> Nim's temp compiler takes like 10s t orecompile depending on what you're touching so it's bad but not horrendous to debug/test things ime |
01:30:14 | FromDiscord | <Valdar> I never use a debugger in Nim either. With echo and .repr , you can get pretty much any value you need. |
01:30:34 | FromDiscord | <ynfle> @Valdar for the compiler? |
01:31:02 | FromDiscord | <Elegantbeef> A wild valdar appears 😀 |
01:31:56 | FromDiscord | <Valdar> Hey, I've appeared often 🙂 |
01:32:08 | FromDiscord | <Valdar> sort of |
01:33:59 | FromDiscord | <Valdar> I just caught the tail end of the convo. I wasn't referring to the compiler specifically. |
01:35:02 | FromDiscord | <ynfle> Oh ok |
01:35:20 | FromDiscord | <ynfle> I agree about non compiler stuff, but the compiler is just too overwhelming |
01:35:51 | FromDiscord | <congusbongus> a debugger can be super useful especially in cases where the state is very hard to set up↵I've been trying to set up nim debugging, disappointed that it's not easy to set up |
01:36:25 | FromDiscord | <Elegantbeef> I'm not saying it's not useful, but i've never personally found the usage beneficial to understanding the compiler |
01:36:38 | FromDiscord | <ynfle> In reply to @congusbongus "a debugger can be": I actually had good success this time with vscode integration |
01:36:42 | FromDiscord | <Elegantbeef> Reading the little bit of comments and echoing the cases out is more than enough ime to understand it |
01:37:55 | FromDiscord | <Elegantbeef> It's a complex system. Just you're touching such a small surface area to fix these X doesnt work but should" you only need to print flags and kind |
01:38:22 | FromDiscord | <Elegantbeef> Atleast that's my view |
01:41:08 | FromDiscord | <Elegantbeef> And i know that's a shared debug process by multiple developers that work on the compiler |
01:45:47 | FromDiscord | <ynfle> Cause you guys know what's going on |
01:46:01 | FromDiscord | <Elegantbeef> I didnt know what was going on when i started |
01:48:46 | FromDiscord | <Elegantbeef> I will say if you want to have very noisey but filled of information view `import astalgo` and do `debug yourType` |
01:49:08 | FromDiscord | <Elegantbeef> Personally i find it absolutely useless but I do know some appreciate all the information being visible |
01:49:53 | FromDiscord | <ynfle> That's way to overwhelming |
01:50:03 | FromDiscord | <ynfle> Especially for such a hot path |
01:50:25 | FromDiscord | <Elegantbeef> You can limit to to a specific condition or file |
01:51:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NqX |
01:52:34 | FromDiscord | <ynfle> I couldn't get `conf` |
01:52:42 | FromDiscord | <ynfle> It's not a variable in scope |
01:53:03 | FromDiscord | <ynfle> and info isn't initialized |
01:54:01 | FromDiscord | <Elegantbeef> the TCandidate has `c` which is context which has `c.graph.config` |
01:55:06 | FromDiscord | <ynfle> and which info should I use |
01:55:11 | FromDiscord | <ynfle> aorig or f |
01:55:33 | FromDiscord | <Patitotective> is there some project working on _Qt_ bindings for _Nim_? or there is not? |
01:55:41 | FromDiscord | <Elegantbeef> doesnt matter in this case since they're in the same file |
01:55:59 | FromDiscord | <ynfle> In reply to @Elegantbeef "doesnt matter in this": Its nil sometimes |
01:56:39 | FromDiscord | <Rika> In reply to @Patitotective "is there some project": QML |
01:57:46 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3NqY |
01:57:57 | FromDiscord | <Elegantbeef> Well i guess disregard me |
01:58:00 | * | Gustavo6046 joined #nim |
01:58:14 | FromDiscord | <Patitotective> In reply to @Rika "QML": i mean qt, not qt quick↵like pyqt or pyside |
01:58:19 | FromDiscord | <Rika> No |
01:58:41 | FromDiscord | <Patitotective> :( |
02:06:30 | FromDiscord | <ynfle> Sleep time |
02:13:52 | FromDiscord | <Patitotective> 🌃 |
02:21:41 | * | neurocyte0917090 quit (Ping timeout: 256 seconds) |
02:29:54 | * | vicfred quit (Quit: Leaving) |
02:52:31 | FromDiscord | <evoalg> for me, `print` is so much more convenient than `echo` when debugging |
02:53:43 | FromDiscord | <Elegantbeef> the topic was more along writing debugging vs debugger debugging 😀 |
02:54:06 | FromDiscord | <evoalg> yep 😉 |
02:54:42 | FromDiscord | <evoalg> but it's just so good I had to mention it 😄 |
03:02:18 | * | arkurious quit (Quit: Leaving) |
04:18:36 | * | rockcavera quit (Remote host closed the connection) |
05:48:50 | FromDiscord | <Elegantbeef> @SirOlaf\: Could i bother you to shoot me a diff one last time for that borrow stuff, want to take a shot it 🙂 |
06:37:02 | FromDiscord | <Evrensel Kişilik> why is Android SDK this bad? |
06:42:37 | * | jmdaemon joined #nim |
06:47:08 | * | rienske joined #nim |
07:15:23 | haakon | Is there no way to return "lack of value" from a proc? Like `None` in Python or `null` in Java? It looks like the common thing is to make up an "empty" value within the return type, like the empty string. But this is not distinguishable from a legitimate value, so in other languages it would be bad practice. Hope I'm overlooking something |
07:16:28 | FromDiscord | <Elegantbeef> `std/options` or `ref T` |
07:17:31 | haakon | Oh, there is an option type :-) |
07:46:22 | PMunch | By the way, for reference or pointer types you can use nil |
07:46:57 | haakon | Yeah I noticed that. Hadn't gotten that far into the tutorials yet :-P |
07:47:22 | haakon | Naively speaking, it does seem like more of the stdlib should do this instead of returning empty strings and whatnot (like the sqlite module) |
07:49:25 | * | Goodbye_Vincent quit (Quit: Ping timeout (120 seconds)) |
07:49:46 | * | Goodbye_Vincent joined #nim |
07:50:17 | FromDiscord | <Elegantbeef> Well remember that Nim also has exceptions so some of that optional stuff is done through that |
07:51:12 | haakon | Sure, but a lot seems to be done through sentinel values |
07:51:50 | FromDiscord | <Elegantbeef> Surprisingly most of what i use aside from `find` does not 😀 |
07:51:54 | Amun-Ra | haakon: you can't return nil from proc foo(): string |
07:51:59 | FromDiscord | <Elegantbeef> Just an observation 😀 |
07:52:19 | haakon | Good to hear, Elegantbeef :-) |
07:52:36 | haakon | Amun-Ra: yeah, it would affect the type signature |
07:55:00 | FromDiscord | <Elegantbeef> Perhaps it might be a valid change for Nim 2.0 |
07:55:17 | PMunch | To do what @Elegantbeef? |
07:55:59 | FromDiscord | <Elegantbeef> Introduce options instead of constant returns in places it makes sense |
07:56:13 | PMunch | Ah right |
07:57:52 | PMunch | Hmm, is there a way to get the name mangling table in Nim? |
07:58:45 | FromDiscord | <Elegantbeef> I dont think so |
07:59:44 | PMunch | Hmm, that's annoying |
08:00:06 | PMunch | I want to wrap a C tool that outputs symbols to show the Nim symbols instead |
08:00:34 | PMunch | Hmm, how does the GDB extension do it? |
08:02:11 | FromDiscord | <Elegantbeef> \Whistles whilst pointing in the sky" |
08:04:09 | PMunch | Hmm, I guess that would be the frame define stuff |
08:18:38 | PMunch | Hmm, or maybe not |
08:26:03 | arkanoid | Apart from being runtime/compiletime are inline functions like templates? |
08:27:36 | FromDiscord | <Elegantbeef> They arent guaranteed to be inlined but for the most part yes |
08:30:18 | PMunch | {.inline.} is just giving a hint to the C compiler |
08:30:30 | PMunch | But it's smart and will inline stuff anyways |
08:31:23 | arkanoid | Thanks |
09:03:17 | PMunch | Hmm, I could potentially grep the file and then look for the closest nimfr_ call |
09:03:18 | Amun-Ra | that works kind of 'inline' in C standard, it's just a hint |
09:03:27 | PMunch | It's an ugly hack though |
09:03:39 | PMunch | Amun-Ra, it is 'inline from the C standard |
09:05:37 | arkanoid | Is there any difference between a byte and a char in nim? |
09:05:56 | Amun-Ra | yes |
09:06:03 | PMunch | Well, they're different types |
09:06:13 | FromDiscord | <Elegantbeef> No |
09:06:21 | PMunch | They're both stored the same though |
09:06:23 | Amun-Ra | let foo: byte = 'a' |
09:06:25 | Amun-Ra | ¯\(ツ)/¯ |
09:06:27 | FromDiscord | <Elegantbeef> They're both 8 bit |
09:06:41 | PMunch | !eval let foo: byte = 'a' |
09:06:43 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: type mismatch: got 'char' for ''a'' but expected 'byte = uint8' |
09:06:45 | FromDiscord | <Elegantbeef> A char is a distinct uint8 basically |
09:06:54 | Amun-Ra | and that is a difference |
09:06:58 | FromDiscord | <Elegantbeef> I figured you were talking about internal representation |
09:09:11 | arkanoid | Ok, but if I have to store binary data that *may* also be interpreted as string, is it better to handle it as a bytes or chars? I know I can reinterpret it at any time, but is just which one is known to be a better choice |
09:09:45 | FromDiscord | <Elegantbeef> i'd go with the string personally |
09:10:07 | FromDiscord | <vindaar> I'd go with `byte` to be honest. That's a more honest representation of what the data is you're dealing with, no? |
09:10:25 | FromDiscord | <Elegantbeef> Yea it's purely preference and how you manage it |
09:10:25 | Amun-Ra | esp. if that's a part of some interop |
09:10:26 | FromDiscord | <vindaar> unless "may" refers to "can always be" |
09:11:12 | FromDiscord | <Rika> Well what exactly is this data |
09:11:16 | FromDiscord | <Elegantbeef> Remember you can always make your own types |
09:12:49 | FromDiscord | <Elegantbeef> Knowing arkanoid it's going to be apache arrow stuff |
09:13:17 | FromDiscord | <Elegantbeef> So it's going to be data stored inside a binary buffer |
09:13:57 | * | [R] quit (Ping timeout: 240 seconds) |
09:14:28 | FromDiscord | <Elegantbeef> I say data but i mean objects |
09:14:33 | arkanoid | Yes, the physical layout is w "variable size binary", but the logical type inside can be utf8 or binary |
09:14:43 | arkanoid | *is always |
09:17:37 | FromDiscord | <Rika> The byte sequence then |
09:17:55 | FromDiscord | <Elegantbeef> byte is probably more descriptive than `uint8` or `char` |
09:19:06 | arkanoid | Yup, thanks |
09:20:15 | * | yassernasc joined #nim |
09:21:36 | * | yassernasc left #nim (#nim) |
09:31:10 | FromDiscord | <mratsim> In reply to @arkanoid "Ok, but if I": If you don't use byte, I'll have to ban you: https://github.com/nim-lang/RFCs/issues/32 |
09:32:58 | FromDiscord | <Elegantbeef> Lol |
09:33:30 | FromDiscord | <Elegantbeef> byte just makes the most sense when dealing with presently untyped data |
09:34:11 | FromDiscord | <Elegantbeef> I dont know if it's just my love of distincts but i feel i question whether instead of an alias it gets turned into a distinct 😛 |
09:36:06 | FromDiscord | <Rika> Personally I wish Nim went with the Python distinction of representation and stringification |
09:36:27 | FromDiscord | <mratsim> pray tell |
09:36:31 | FromDiscord | <mratsim> I'm not aware of that |
09:36:50 | FromDiscord | <mratsim> `$` is stringification and `toHex` is representation no? |
09:37:03 | FromDiscord | <Rika> It’s no convention though |
09:37:16 | FromDiscord | <Rika> And in Python it’s for every type, standardised by repr and str |
09:38:22 | FromDiscord | <mratsim> oh |
09:38:29 | FromDiscord | <mratsim> I agree |
09:40:07 | FromDiscord | <mratsim> I can't believe there was a time where arrays didn't have `$` |
09:40:13 | FromDiscord | <Clonkk> A while ago I made a small package to convert between string / seq[byte] https://github.com/Clonkk/bytesequtils↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
09:40:39 | FromDiscord | <Elegantbeef> Oh boy copying data 😛 |
09:41:18 | FromDiscord | <mratsim> @Clonkk, where is prepareMutation declared? https://github.com/Clonkk/bytesequtils/blob/main/src/bytesequtils.nim#L49 |
09:41:20 | FromDiscord | <Evrensel Kişilik> 😱 |
09:41:23 | FromDiscord | <Evrensel Kişilik> hruuuuuuuuuuuuuuuuuuuuuuuuu |
09:41:39 | FromDiscord | <Clonkk> system.nim ?↵(@mratsim) |
09:41:41 | FromDiscord | <Elegantbeef> It's a system procedure |
09:41:42 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#prepareMutation%2Cstring |
09:42:32 | FromDiscord | <mratsim> that's not true, if you do newString(len) it will automatically be \0 terminated: https://github.com/Clonkk/bytesequtils/blob/main/src/bytesequtils.nim#L54-L57 |
09:42:45 | FromDiscord | <Evrensel Kişilik> In reply to @Clonkk "system.nim ? (<@570268431522201601>)": how can i setup this documentation thing on github.io? |
09:43:03 | FromDiscord | <Clonkk> Either manually or github action↵(@Evrensel Kişilik) |
09:43:10 | FromDiscord | <Evrensel Kişilik> In reply to @Clonkk "Either manually or github": 😱 |
09:43:14 | FromDiscord | <Evrensel Kişilik> how? |
09:43:22 | FromDiscord | <Elegantbeef> `nim doc` generates nim docs |
09:43:36 | FromDiscord | <Evrensel Kişilik> i want to make a documentation thing for my debugger |
09:43:37 | FromDiscord | <mratsim> Thankfully the GC doesn't insult you when you do raw pointer casting between GC-ed types: https://github.com/Clonkk/bytesequtils/blob/main/src/bytesequtils.nim#L50 |
09:43:44 | FromDiscord | <Elegantbeef> I did make an issue on nimble.directory since docs were not generated |
09:44:12 | FromDiscord | <Clonkk> Manually something like nimbledoc --proect src/myfile?nim --out\:docs/ and enable github pages on docs/ folder↵(@Evrensel Kişilik) |
09:44:33 | FromDiscord | <Evrensel Kişilik> In reply to @Clonkk "Manually something like nimbledoc": oh it is not a Nim thing |
09:44:34 | FromDiscord | <Clonkk> With github actions something like this https://github.com/SciNim/nimfftw3/blob/master/.github/workflows/docs.yml |
09:44:50 | FromDiscord | <Evrensel Kişilik> In reply to @Clonkk "Manually something like nimbledoc": i want to make a documentation thing for this https://github.com/rohanrhu/gdb-frontend |
09:44:55 | FromDiscord | <Clonkk> nimble doc is pretty much an alias for nim doc i think↵(@Evrensel Kişilik) |
09:45:06 | FromDiscord | <Clonkk> Then the result is static html file hosted on github |
09:45:08 | FromDiscord | <Evrensel Kişilik> In reply to @Clonkk "nimble doc is pretty": hmmmmmmmmmmmmmmmm |
09:45:20 | FromDiscord | <Elegantbeef> Nim has a doc generator built into it |
09:45:32 | FromDiscord | <Evrensel Kişilik> sooooooooooooooooooooooooo |
09:45:37 | FromDiscord | <Clonkk> Yeah it's unsafe and totally shouldn't be used for crypto or anything serious but if you just want so raw buffer passing between API it does the job↵(@mratsim) |
09:45:46 | FromDiscord | <Evrensel Kişilik> i will create a repo like "gdb-frontend-docs" |
09:45:57 | FromDiscord | <Evrensel Kişilik> and we will manage it with markdowns right? |
09:45:58 | FromDiscord | <Clonkk> I basically could have made the whole thing using `pointer` |
09:46:09 | FromDiscord | <Elegantbeef> Nim's doc gen uses RST |
09:46:11 | FromDiscord | <Evrensel Kişilik> Markdowns on Git repo |
09:46:16 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Nim's doc gen uses": hmmmmmmmmmmmmmmmm |
09:46:23 | FromDiscord | <Evrensel Kişilik> what is that? |
09:46:34 | FromDiscord | <Elegantbeef> There are things like nimibook or nimib if you want to use MD with Nim code |
09:46:39 | FromDiscord | <enthus1ast> you can use the gh-pages branch |
09:46:40 | FromDiscord | <enthus1ast> https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site |
09:46:44 | FromDiscord | <mratsim> Last time someone did a seq[byte] -> string cast it was between a blob and an http endpoint and it crashed in the C lib :/ |
09:47:00 | FromDiscord | <Clonkk> The main idea was just to be able to reconcile API that expects `seq[byte]` with API that expects `string`↵(@mratsim) |
09:47:03 | FromDiscord | <Elegantbeef> How to mis a nu;l char |
09:47:06 | FromDiscord | <Evrensel Kişilik> i want it to be manageable with Markdowns on Git |
09:47:53 | FromDiscord | <mratsim> In reply to @Clonkk "The main idea was": for that you can use `proc foo[T: byte:char](input: openarray[T])`↵↵For better or worse string decay in openarray[char] |
09:48:01 | FromDiscord | <Clonkk> Well yeah, It says so in the readme that it doesn't deal with null terminated stuff well and that you absolutly shouldn't interface thatwith cstring↵(@mratsim) |
09:48:36 | FromDiscord | <mratsim> in Arraymancer it's worse because I have to prefix `proc toTensor[T: not char](a: openarray[T]): Tensor[T]` |
09:49:18 | FromDiscord | <Evrensel Kişilik> soooooooooooooooooooooooooo |
09:49:19 | FromDiscord | <Evrensel Kişilik> https://github.com/rohanrhu/gdb-frontend-docs |
09:49:22 | FromDiscord | <Evrensel Kişilik> i made this |
09:49:26 | FromDiscord | <mratsim> https://github.com/mratsim/constantine/blob/master/constantine/hashes/h_sha256.nim#L350-L352↵this accepts string/seq[byte] |
09:49:55 | FromDiscord | <Clonkk> But you control your own API↵(@mratsim) |
09:50:37 | FromDiscord | <ynfle> Is there any way to print the current line and filename? |
09:51:10 | FromDiscord | <Clonkk> If you have a seq[byte] for a resizable buffer (which makes sense to use) and an API that expects a Nim string holding a buffer (so no null terminated issue) and you have no control over said API, well a dirty cast can help you |
09:51:17 | FromDiscord | <mratsim> In reply to @ynfle "Is there any way": instantiationInfo() in system.nim |
09:51:20 | FromDiscord | <Evrensel Kişilik> In reply to @ynfle "Is there any way": `LINE` and `FILE` |
09:51:41 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "`__LINE__` and `__FILE__`": that would give you the C line not the Nim line |
09:51:49 | FromDiscord | <mratsim> unless you compile with --debugger:native |
09:52:04 | FromDiscord | <mratsim> or --lineinfo and --linedir iirc |
09:52:56 | FromDiscord | <ynfle> In reply to @mratsim "instantiationInfo() in system.nim": It doens't seem to work. What should the index be? |
09:53:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/mvB |
09:53:31 | FromDiscord | <Elegantbeef> Or are chararrays just not allowed? |
09:53:31 | PMunch | @Evrensel_Kişilik, ooh I've been looking for a nice Gdb frontend |
09:53:49 | FromDiscord | <Elegantbeef> Their frontend is pretty snazzy |
09:54:17 | FromDiscord | <Evrensel Kişilik> In reply to @PMunch "@Evrensel_Kişilik, ooh I've been": oh 😱 |
09:54:26 | FromDiscord | <Evrensel Kişilik> im glad you found it finally xD |
09:54:51 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Their frontend is pretty": thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu |
09:55:10 | PMunch | I mean I haven't tried it yet, but it looks neat |
09:55:13 | FromDiscord | <mratsim> you'll have cannot instantiate T I think no? |
09:55:21 | PMunch | I'll have to look into it next time I want to use GDB |
09:55:39 | FromDiscord | <ynfle> In reply to @Evrensel Kişilik "`__LINE__` and `__FILE__`": Says invalid token |
09:55:41 | FromDiscord | <Evrensel Kişilik> In reply to @PMunch "I'll have to look": sure feel free to suggest me new things |
09:55:53 | FromDiscord | <mratsim> In reply to @Elegantbeef "Not ideal i gues": we want string -> Tensor[string] not Tensor[char] |
09:55:55 | FromDiscord | <Evrensel Kişilik> In reply to @ynfle "Says invalid token": sure because they are C things xD |
09:56:02 | PMunch | A section on how to use it for Nim in the documentation? :D |
09:56:13 | FromDiscord | <ynfle> In reply to @Evrensel Kişilik "sure because they are": So it doesn't help me |
09:56:14 | FromDiscord | <Elegantbeef> Ah thought you just didnt want string in there↵(@mratsim) |
09:56:22 | FromDiscord | <mratsim> @ynfle see https://github.com/nim-lang/Nim/issues/11689 |
09:56:32 | FromDiscord | <Evrensel Kişilik> In reply to @PMunch "A section on how": sure im planning to make documentation |
09:56:45 | FromDiscord | <Evrensel Kişilik> i just tried it for Nim debugging |
09:56:49 | FromDiscord | <Evrensel Kişilik> it is pretty compatible |
09:57:54 | FromDiscord | <Evrensel Kişilik> In reply to @ynfle "So it doesn't help": i don't think soo cuz you can write C in Nim |
09:58:26 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "i don't think soo": You can even write Cuda, OpenCL or Assembly |
09:59:07 | FromDiscord | <mratsim> Cuda: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/private/p_kernels_interface_cuda.nim#L40-L71 |
09:59:47 | FromDiscord | <Evrensel Kişilik> i still think C and preprocessor is the best for everything xD |
09:59:47 | FromDiscord | <mratsim> compile-time assembler: https://github.com/mratsim/constantine/blob/master/constantine/arithmetic/assembly/limbs_asm_mul_x86_adx_bmi2.nim#L73-L112 |
10:00:12 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "i still think C": https://tenor.com/view/game-of-thrones-i-demand-a-trial-by-combat-tyrion-lannister-gif-16328126 |
10:00:19 | FromDiscord | <Elegantbeef> Preprocessor sucks |
10:00:31 | FromDiscord | <Evrensel Kişilik> buuuuuuut im happy with being your debugger person xD i want to make it more usable for Nim debugging with special features |
10:00:38 | FromDiscord | <Elegantbeef> Do type introspection with preprocessor and i'll guarantee you'd prefer death |
10:01:13 | FromDiscord | <Elegantbeef> Can GDB even print out proper sets/enums/tagged unions? |
10:01:39 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Can GDB even print": sooooo you can use ExpressionEvaluater thing |
10:02:02 | FromDiscord | <Elegantbeef> I know they get turned into C arrays, ints, and unions in C. Dont know if it can get the accurate representation in a Nim environment |
10:02:45 | FromDiscord | <Evrensel Kişilik> this is ExpressionEvaluater https://media.discordapp.net/attachments/371759389889003532/935474759922225162/connected-expressions.png |
10:02:53 | FromDiscord | <Evrensel Kişilik> expressions are connected in that |
10:02:58 | FromDiscord | <mratsim> my eyes, they burn |
10:03:07 | FromDiscord | <mratsim> I took an arrow in the knee |
10:03:13 | FromDiscord | <mratsim> so many arrows |
10:03:24 | FromDiscord | <mratsim> seems interesting though |
10:03:28 | FromDiscord | <Elegantbeef> Yea but i mean `var a = {true, false}` isnt going display as `{true, false}` |
10:03:28 | FromDiscord | <Evrensel Kişilik> In reply to @mratsim "so many arrows": you can turn off them |
10:04:03 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Yea but i mean": soooooooo what is that? `{1, 0}`? |
10:04:13 | FromDiscord | <Elegantbeef> That'd be `0b11` |
10:04:18 | FromDiscord | <Elegantbeef> It's a bit set |
10:04:20 | FromDiscord | <Evrensel Kişilik> soooooooo |
10:04:29 | FromDiscord | <Evrensel Kişilik> is that an auto array? |
10:04:32 | FromDiscord | <Elegantbeef> It'd be the integer 3 |
10:04:34 | FromDiscord | <Elegantbeef> No |
10:04:39 | FromDiscord | <Evrensel Kişilik> huh |
10:04:39 | FromDiscord | <Elegantbeef> It's a bitset |
10:04:44 | FromDiscord | <Evrensel Kişilik> i mean in C |
10:04:45 | FromDiscord | <mratsim> like C flags |
10:04:45 | FromDiscord | <Elegantbeef> You know C bitflags |
10:04:50 | FromDiscord | <Elegantbeef> Where you or constants togethers |
10:04:54 | FromDiscord | <Evrensel Kişilik> soooooooooo |
10:05:00 | FromDiscord | <Elegantbeef> It's an integer in this case |
10:05:01 | FromDiscord | <Evrensel Kişilik> idk what is that in Nim |
10:05:07 | FromDiscord | <Elegantbeef> For larger values it's an array of integers |
10:05:15 | FromDiscord | <mratsim> A = 0b1, B = 0b10, and you have A | B |
10:05:25 | Amun-Ra | for larger values you'd have to use hashset |
10:05:25 | FromDiscord | <mratsim> with A | B = 0b11 |
10:05:31 | FromDiscord | <Tanguy> My Gameboy emulator based on C preprocessor for the instructions↵https://github.com/Menduist/gbmu/blob/master/instructions.c#L223↵https://github.com/Menduist/gbmu/blob/master/opcodes |
10:05:44 | FromDiscord | <Evrensel Kişilik> soooooo what is C source output of `var a = {true, false}`? |
10:05:52 | FromDiscord | <Elegantbeef> an integer |
10:05:53 | FromDiscord | <Elegantbeef> or byte |
10:05:59 | FromDiscord | <Elegantbeef> Whatever you want to call an 8bit integer |
10:06:00 | FromDiscord | <Evrensel Kişilik> can you type it? |
10:06:06 | FromDiscord | <Evrensel Kişilik> the C line |
10:06:29 | FromDiscord | <Evrensel Kişilik> gimme C |
10:06:50 | FromDiscord | <Evrensel Kişilik> i want to C only C |
10:06:51 | FromDiscord | <Evrensel Kişilik> 😱 |
10:06:58 | FromDiscord | <haxscramper> this is a bitset literal |
10:06:58 | FromDiscord | <mratsim> In reply to @Tanguy "My Gameboy emulator based": Nim is prettier: https://github.com/mratsim/glyph/blob/master/glyph/snes/opcodes.nim#L16-L32 😉 |
10:07:06 | FromDiscord | <haxscramper> bool is an enum |
10:07:54 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "can you type it?": do you know the mmap bitflags? https://github.com/mratsim/photon-jit/blob/master/photon_jit/photon_osalloc.nim#L15-L19 |
10:07:59 | FromDiscord | <mratsim> it's similar to this |
10:08:03 | * | [R] joined #nim |
10:08:12 | FromDiscord | <mratsim> or chmod |
10:08:23 | FromDiscord | <mratsim> the base one are power of 2 |
10:08:37 | FromDiscord | <mratsim> and 3 is ProtRead + ProtWrite |
10:08:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/MAl |
10:08:43 | Amun-Ra | mratsim: how does it perform when it comes to speed? |
10:09:05 | FromDiscord | <mratsim> In reply to @Amun-Ra "<@570268431522201601>: how does it": the emulator? Unfortunately I don't have 48 hours per day xD |
10:09:11 | FromDiscord | <Elegantbeef> Wait a minute |
10:09:20 | FromDiscord | <Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3NsI |
10:09:34 | FromDiscord | <Elegantbeef> `N_LIB_PRIVATE tySet_tyBoolVaVACK0bpYmqIQ0mKcHfQQ atest_1 = 3;` |
10:09:37 | FromDiscord | <Elegantbeef> There you go |
10:09:41 | FromDiscord | <Elegantbeef> `typedef NU8 tySet_tyBoolVaVACK0bpYmqIQ0mKcHfQQ;` |
10:09:44 | FromDiscord | <Evrensel Kişilik> are these names unique in the universe? |
10:09:52 | Amun-Ra | mratsim: I wrote Z80 emulator and used typical 256 case switch, that'll probably be converted to jump tables |
10:09:53 | FromDiscord | <mratsim> also speed for a snes meeh, but if you want to optimize a VM here are tricks: https://github.com/status-im/nimbus-eth1/wiki/Interpreter-optimization-resources |
10:09:57 | FromDiscord | <Evrensel Kişilik> it is impossible to be always unique 😱 |
10:09:59 | FromDiscord | <Elegantbeef> They're generated from a language with generics |
10:10:08 | FromDiscord | <mratsim> In reply to @Amun-Ra "<@570268431522201601>: I wrote Z80": use computed gotos. |
10:10:14 | FromDiscord | <Evrensel Kişilik> you are using my dynamic library |
10:10:18 | FromDiscord | <Evrensel Kişilik> and oh |
10:10:25 | FromDiscord | <Evrensel Kişilik> names can conflict |
10:10:38 | Amun-Ra | mratsim: mhm |
10:10:40 | FromDiscord | <Elegantbeef> Generating symbols is kinda required to map to C from Nim |
10:10:40 | FromDiscord | <Evrensel Kişilik> (edit) "can" => "may" |
10:10:46 | FromDiscord | <haxscramper> In reply to @Evrensel Kişilik "are these names unique": They use signature hash for the type IIRC |
10:10:54 | FromDiscord | <haxscramper> md5 digest of the symbol |
10:10:56 | FromDiscord | <Evrensel Kişilik> oh |
10:11:00 | FromDiscord | <Evrensel Kişilik> sooooo |
10:11:12 | FromDiscord | <Evrensel Kişilik> what if our symbols are longer than md5 hashes? |
10:11:17 | Amun-Ra | mratsim: but your code gave me an idea for case optimizations with macros |
10:11:27 | FromDiscord | <Evrensel Kişilik> 😱 THEY WILL REPEAT 😱 |
10:11:28 | FromDiscord | <haxscramper> they are not cryptographically secure in any case, but I doubt you can run into collisions |
10:11:50 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "😱 THEY WILL": it appends a _1 and _2 if there is a collision |
10:11:51 | FromDiscord | <Elegantbeef> Well it'll be fun the day someone does |
10:12:01 | FromDiscord | <mratsim> I did have collisions |
10:12:06 | FromDiscord | <Elegantbeef> Millions of lines of code compiled and no reported collisions yet |
10:12:17 | FromDiscord | <mratsim> because the compiler kept duplicating concept procs |
10:12:20 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Millions of lines of": :BANNED: |
10:12:45 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/935477282573787136/79279951-783f1c80-7eaf-11ea-8d1a-0118f7e62bd8.png |
10:12:53 | FromDiscord | <Evrensel Kişilik> 😱 LEAVE ME ALONE I'M CRYING 😱 |
10:13:03 | FromDiscord | <haxscramper> maybe using the name-based mangling would've been better, but in any case if there are identical symbols they will produce collisions of course |
10:13:06 | FromDiscord | <mratsim> @ElegantBeef : https://github.com/nim-lang/Nim/issues/13982 |
10:13:22 | FromDiscord | <Elegantbeef> Shit you got me |
10:13:48 | FromDiscord | <Evrensel Kişilik> im crying |
10:13:49 | FromDiscord | <mratsim> 457 collisions https://media.discordapp.net/attachments/371759389889003532/935477553592958976/79350704-137bd480-7f38-11ea-8dfc-f3505c79fd17.png |
10:14:00 | FromDiscord | <Elegantbeef> Thought that's not the name mangling and more generating, no? |
10:14:03 | FromDiscord | <Evrensel Kişilik> 😱 |
10:14:28 | FromDiscord | <haxscramper> the procs appear to be identical, right? |
10:14:29 | FromDiscord | <Evrensel Kişilik> why don't we give C names? |
10:14:32 | FromDiscord | <Evrensel Kişilik> 😱 |
10:14:42 | FromDiscord | <Evrensel Kişilik> we can give PREFIXES |
10:14:45 | FromDiscord | <Evrensel Kişilik> oh no |
10:14:47 | FromDiscord | <haxscramper> wrt. to implementation |
10:14:49 | FromDiscord | <Evrensel Kişilik> oh nooooooooooooooooooooooooooooooooooooo |
10:14:51 | FromDiscord | <mratsim> In reply to @haxscramper "the procs appear to": they are, it's co-recursive concepts that caused this. |
10:14:58 | FromDiscord | <Evrensel Kişilik> allow us to give PREFIXES |
10:15:12 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "allow us to give": use {.exportc.} to set the name |
10:15:20 | FromDiscord | <Evrensel Kişilik> lemme add that feature to Nim |
10:15:23 | FromDiscord | <haxscramper> In reply to @Evrensel Kişilik "lemme add that feature": https://nim-lang.org/docs/manual.html#foreign-function-interface-exportc-pragma |
10:15:23 | FromDiscord | <Evrensel Kişilik> gimme the source |
10:15:26 | FromDiscord | <mratsim> use {.exportc:"my_pretty_C_name".} |
10:15:29 | FromDiscord | <haxscramper> `proc p(s: string) {.exportc: "prefix$1".} =` |
10:16:01 | FromDiscord | <Evrensel Kişilik> looooook im here for being your debugger person but you want me to add features to the language |
10:16:05 | FromDiscord | <Evrensel Kişilik> 😱 |
10:16:15 | FromDiscord | <Evrensel Kişilik> In reply to @mratsim "use {.exportc:"my_pretty_C_name".}": what is this? |
10:16:19 | FromDiscord | <Evrensel Kişilik> is it prefix? |
10:16:20 | Amun-Ra | there' nimgdb |
10:16:22 | FromDiscord | <haxscramper> I bet the concept codegen replication was caused by broken generic cache that got triggered for each attempt to process concept |
10:16:29 | FromDiscord | <mratsim> In reply to @Evrensel Kişilik "what is this?": no it's completely replace |
10:16:34 | FromDiscord | <Evrensel Kişilik> 😱 |
10:16:37 | FromDiscord | <haxscramper> that's my hypothesis at least |
10:16:42 | FromDiscord | <Evrensel Kişilik> soooooooooooooooo |
10:16:44 | FromDiscord | <Evrensel Kişilik> we need PREFIXES |
10:16:47 | FromDiscord | <mratsim> use $1 if you want to interpolate the proc name |
10:17:12 | FromDiscord | <mratsim> `{.exportc:"your_ad_here_$1".}` |
10:17:13 | FromDiscord | <Evrensel Kişilik> im gonna go to cry |
10:17:16 | FromDiscord | <Evrensel Kişilik> leave me alone |
10:17:16 | FromDiscord | <haxscramper> if you compile to C++ you can also use `--compileToNamespace=spc` if you want |
10:17:45 | FromDiscord | <Evrensel Kişilik> ALLOW ME TO SEND GIFS |
10:17:45 | FromDiscord | <Evrensel Kişilik> pls |
10:17:49 | FromDiscord | <Evrensel Kişilik> bots |
10:17:52 | Amun-Ra | no |
10:18:00 | FromDiscord | <Evrensel Kişilik> In reply to @Amun-Ra "no": :BANNED: |
10:18:25 | FromDiscord | <Evrensel Kişilik> 😭 |
10:18:34 | FromDiscord | <Elegantbeef> Anyway the point was more talking about sets 😀 |
10:18:35 | FromDiscord | <Elegantbeef> Nim has ergonomic methods of creating bitsets which map into 8bit integers in C, using each bit as a flag just like bit flags. I dont know if GDB can support pretty printing that |
10:18:46 | FromDiscord | <mratsim> or 16-bit |
10:19:04 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Nim has ergonomic methods": looooooooooooooooook i will add special things to debugger for Nim |
10:19:12 | FromDiscord | <mratsim> maybe the pascal extension can 😉 |
10:19:16 | FromDiscord | <Evrensel Kişilik> but i need to list them first |
10:20:46 | FromDiscord | <Elegantbeef> Does nim's gdb script print sets nicely? |
10:20:57 | FromDiscord | <Elegantbeef> I'm a complete fool when it comes to debuggers |
10:21:32 | FromDiscord | <mratsim> I use backtrace and a lot of imagination |
10:21:46 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Does nim's gdb script": you mean that to not handle them not as C things? |
10:21:50 | FromDiscord | <Evrensel Kişilik> instead Nim things |
10:21:51 | FromDiscord | <Evrensel Kişilik> ummmmmmmmmmmm |
10:22:06 | FromDiscord | <mratsim> set are special, the rest the repr matches C |
10:22:08 | FromDiscord | <Evrensel Kişilik> (edit) "not" => "" |
10:22:17 | FromDiscord | <Evrensel Kişilik> lemme check |
10:22:19 | FromDiscord | <Evrensel Kişilik> gimme code |
10:22:29 | FromDiscord | <Elegantbeef> `var a = {true, false}` |
10:22:37 | FromDiscord | <Elegantbeef> It's going to be `3` |
10:22:37 | FromDiscord | <mratsim> true false is a bad example |
10:22:39 | FromDiscord | <mratsim> use colors |
10:22:57 | FromDiscord | <Elegantbeef> `{'a'..'z'}` |
10:23:02 | FromDiscord | <Elegantbeef> Is that better mratsim |
10:23:15 | FromDiscord | <Rika> Where are the colours smh |
10:23:19 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3NsK |
10:23:25 | FromDiscord | <haxscramper> @Evrensel Kişilik for quick testing of the genrated code you can run nim compiler with `nim c --stacktrace=off --gc=arc --linetrace=off --nimcache=cache file.nim` and it will generate relatively clean code in the `cache` directory |
10:23:35 | FromDiscord | <haxscramper> and then you can inspect how different types are represented |
10:23:39 | FromDiscord | <Evrensel Kişilik> In reply to @haxscramper "<@!359071052397281280> for quick testing": oh |
10:23:40 | FromDiscord | <mratsim> Red is assigned 0, Blue 1 and Green 3, and so the set will be 0b11 as internal repr |
10:23:45 | FromDiscord | <Elegantbeef> why not just `-c` |
10:23:56 | FromDiscord | <mratsim> (edit) "3," => "2," |
10:24:15 | FromDiscord | <mratsim> and {Red, BLue, Green} will be 0b111 |
10:24:20 | FromDiscord | <mratsim> (edit) "BLue," => "Blue," |
10:25:33 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3NsM |
10:25:43 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/935480547118047232/unknown.png |
10:25:46 | FromDiscord | <Evrensel Kişilik> this |
10:25:55 | FromDiscord | <Evrensel Kişilik> what should this look like? |
10:26:12 | FromDiscord | <haxscramper> you can set specific values of the enum elements, this affects layout, you can also set `{.bitsize.}` for enum, it might also affect representation |
10:27:02 | FromDiscord | <Elegantbeef> It should look like `{Red, Blue}` ideally |
10:27:26 | FromDiscord | <Elegantbeef> `3` isnt a useful value for a collection of flags |
10:27:28 | FromDiscord | <haxscramper> there is an additional RTTI for the types IIRC in the genrated code |
10:27:29 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "It should look like": soooooooooooooo |
10:28:01 | FromDiscord | <Evrensel Kişilik> you mean `{Red, Blue}` only? |
10:28:05 | FromDiscord | <Evrensel Kişilik> not expandable? |
10:28:07 | FromDiscord | <Elegantbeef> Yes |
10:28:11 | FromDiscord | <Evrensel Kişilik> ok |
10:28:21 | FromDiscord | <Evrensel Kişilik> let me looooook |
10:28:28 | FromDiscord | <Elegantbeef> It should be the set that it'd have been declared in Nim |
10:29:26 | FromDiscord | <Evrensel Kişilik> sooooooo since it is a C source actually, how could i understand it is a special Nim thing indeed? |
10:29:54 | FromDiscord | <Elegantbeef> Not a clue, there is apparently RTTI one can use |
10:30:33 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Not a clue, there": what is RTII? |
10:31:07 | FromDiscord | <haxscramper> runtime type information, and no apparently it is not present for sets |
10:31:29 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/935482001752997928/unknown.png |
10:31:30 | FromDiscord | <Elegantbeef> Ah nice 😀 |
10:31:36 | FromDiscord | <Elegantbeef> So no can make them nice |
10:31:43 | FromDiscord | <Evrensel Kişilik> In reply to @haxscramper "runtime type information, and": how can i get that? |
10:32:35 | FromDiscord | <mratsim> I think it's fine to say that item 0, 1, 2, 12, 42 in the enum are present in the set. |
10:32:41 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/935482296981655592/unknown.png |
10:33:08 | FromDiscord | <Evrensel Kişilik> soooooo |
10:33:15 | FromDiscord | <Elegantbeef> I guess printing it as binary or a group of which bits are on is the best one can do with what's given |
10:33:17 | FromDiscord | <Evrensel Kişilik> i need to get Nim-specific information about symbols |
10:33:43 | FromDiscord | <Evrensel Kişilik> is there something in memory |
10:33:43 | FromDiscord | <Evrensel Kişilik> or |
10:33:56 | FromDiscord | <Evrensel Kişilik> some file that includes these informations? |
10:34:32 | FromDiscord | <Evrensel Kişilik> soooo i could interpret them as Nim things |
10:39:38 | FromDiscord | <mratsim> nop, it's all optimized away so it can be fast |
10:39:53 | FromDiscord | <mratsim> but it's named tySet_tyEnum |
10:40:05 | FromDiscord | <Evrensel Kişilik> oh no |
10:40:13 | FromDiscord | <Evrensel Kişilik> 😱 THE NAME 😱 |
10:40:15 | FromDiscord | <mratsim> unless they are renamed via {.exportc:....} |
10:40:17 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py#L413-L443 |
10:40:17 | FromDiscord | <Elegantbeef> Supposedly the `nim-gdb.py` can support it |
10:40:36 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/blob/devel/tools/ni": yes |
10:40:40 | FromDiscord | <Evrensel Kişilik> THE NAMEEEEEEEEE |
10:40:52 | FromDiscord | <Evrensel Kişilik> 😱 |
10:41:04 | FromDiscord | <Evrensel Kişilik> then |
10:41:09 | FromDiscord | <Evrensel Kişilik> i will check names |
10:41:11 | FromDiscord | <Evrensel Kişilik> xd |
10:41:22 | FromDiscord | <Evrensel Kişilik> soooooooooooooooooooooooo |
10:41:30 | FromDiscord | <Evrensel Kişilik> you will see Nim things in evaluater |
10:41:44 | FromDiscord | <mratsim> :banana_dance: |
10:41:58 | FromDiscord | <Evrensel Kişilik> 😱 |
10:42:09 | FromDiscord | <Evrensel Kişilik> GIMME GIFS |
10:42:16 | FromDiscord | <Evrensel Kişilik> BOTS |
10:42:28 | FromDiscord | <Elegantbeef> Bots are too dumb for that |
10:42:39 | FromDiscord | <mratsim> ElegantGIF |
10:42:47 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Bots are too dumb": bad bots |
10:42:49 | FromDiscord | <Evrensel Kişilik> i dont love you |
10:42:57 | FromDiscord | <Elegantbeef> Good no one does |
10:45:21 | FromDiscord | <mratsim> mic drop |
10:45:48 | FromDiscord | <Evrensel Kişilik> soooooooooooooooooooooooooooooooooooo |
10:45:53 | FromDiscord | <Evrensel Kişilik> i will let you know when i do it |
10:49:19 | FromDiscord | <Phil> In reply to @Elegantbeef "Good no one does": I only love the things you create that save me work |
10:49:34 | FromDiscord | <Evrensel Kişilik> In reply to @Isofruit "I only love the": don't love it |
10:49:35 | FromDiscord | <Evrensel Kişilik> it is a bot |
10:49:54 | FromDiscord | <Phil> My love is free! |
10:49:58 | FromDiscord | <Phil> Viva la revolution! |
10:50:43 | FromDiscord | <Phil> Sidenote, the element client to access discord is alright, not sure I'd get used to it though |
10:50:58 | FromDiscord | <Evrensel Kişilik> In reply to @Isofruit "Sidenote, the element client": what is that? |
10:51:27 | FromDiscord | <isofruitus> This is that↵(@Evrensel Kişilik) |
10:51:54 | FromDiscord | <Phil> It's matrix's front end if I understood it in the 30 seconds I took to read over the webpage |
10:51:55 | FromDiscord | <Evrensel Kişilik> In reply to @isofruitus "This is that (<@359071052397281280>)": 😱 oh noooo i don't want more BOTS 😱 |
10:52:43 | FromDiscord | <Evrensel Kişilik> how do they know Discord protocol? |
10:52:48 | FromDiscord | <Evrensel Kişilik> reverse engineering? |
10:52:55 | arkanoid | mycstring[^1] will be last char or null char? |
10:53:35 | FromDiscord | <Evrensel Kişilik> In reply to @arkanoid "mycstring[^1] will be last": if it is a `cstring` i think it must be a NULL char |
10:54:18 | FromDiscord | <Evrensel Kişilik> otherwise that syntatic sugar must be giving the last char |
10:54:22 | FromDiscord | <Evrensel Kişilik> before NULL char |
10:54:24 | FromDiscord | <Evrensel Kişilik> i have no idea |
10:54:28 | FromDiscord | <Evrensel Kişilik> i would make it like this |
10:54:57 | FromDiscord | <Phil> In reply to @Evrensel Kişilik "reverse engineering?": The power of love and computermagivs |
10:54:59 | FromDiscord | <Phil> (edit) "computermagivs" => "computermagics" |
10:55:01 | FromDiscord | <Phil> or sth |
10:56:01 | arkanoid | apparently csting type doesn't support backward index |
10:56:49 | FromDiscord | <mratsim> In reply to @arkanoid "apparently csting type doesn't": they can't since to know the length of a cstring you need to iterate first |
10:57:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3NsS |
10:57:08 | arkanoid | yes, it makes sense, I just had to wrap my head around it |
10:57:11 | FromDiscord | <mratsim> the length isn't stored in the string. |
10:57:17 | FromDiscord | <Phil> In reply to @arkanoid "mycstring[^1] will be last": If you can tell me how to instantiate a cstring I can check in inim |
10:57:21 | FromDiscord | <mratsim> they are very inefficient. |
10:57:38 | FromDiscord | <mratsim> everyone is avoiding them everywhere except for printf xD |
10:57:50 | FromDiscord | <Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3NsT |
10:58:03 | FromDiscord | <Evrensel Kişilik> gimme more 😱 |
10:58:06 | FromDiscord | <Phil> If cstrings are that terrible, why do we even bother dealing with them? What are they good for? Efficient copying? |
10:58:22 | arkanoid | because C give you cstrings |
10:58:47 | arkanoid | and shitload of existing software uses null character to terminate string |
10:59:21 | arkanoid | a lot of software that hates to iterate strings backwards efficiently |
11:02:28 | PMunch | @Phil, they're efficient in terms of memory usage if all you need to do is print them out to a terminal or something |
11:03:21 | FromDiscord | <Rika> Not by much |
11:03:40 | PMunch | I mean a Nim string like "Hello" is 8 bytes for the size, 8 bytes for the capacity of the underlying buffer, and 6 bytes for the null terminated string, that's 42 bytes of memory for storing 5 bytes of data |
11:04:03 | PMunch | A cstring would be 6 bytes of data |
11:04:46 | PMunch | This doesn't matter a whole lot to us living in the gigabytes of ram and terabytes of hard-drive world, but to early programmers that would've been seen as a crazy amount of data to just throw awy |
11:05:24 | FromDiscord | <Phil> Makes sense. I mean for some small devices it might actually still make a difference |
11:06:44 | PMunch | Definitely! I'm programming micro-controllers and there you count every single byte |
11:07:30 | Amun-Ra | small string are often stored in registers as a value in some implementationss |
11:07:47 | Amun-Ra | strings* |
11:08:28 | PMunch | I've considered trying to implement alternative encodings in order to save bytes for those devices |
11:08:39 | FromDiscord | <Rika> Back then it sure mattered but it’s not great that it’s stil relied on now |
11:08:45 | PMunch | Amun-Ra, those would have to be some tiny strings |
11:09:01 | PMunch | @Rika, oh for sure, I was just giving some historical context |
11:09:06 | Amun-Ra | PMunch: yes |
11:09:41 | Amun-Ra | PMunch: gcc does this for strings up to 7 chars (storing it inside uint64_t) |
11:11:20 | arkanoid | my nick won't fit :( |
11:11:30 | arkanoid | I feel fat |
11:12:55 | FromDiscord | <Phil> I feel your pain |
11:13:51 | Amun-Ra | arkanoid: just wait for 128-bit cpus |
11:14:07 | FromDiscord | <Phil> ~~for another 50 years~~ |
11:16:02 | arkanoid | better turn into a quantum nick |
11:20:05 | * | Gustavo6046 quit (Quit: Leaving) |
11:26:37 | FromDiscord | <mratsim> In reply to @PMunch "<@180601887916163073>, they're efficient in": their is no difference, a byte vs an int or an int32. |
11:27:19 | FromDiscord | <mratsim> and in the past lengths were stored in a byte anyway |
11:27:59 | FromDiscord | <Rika> ? |
11:27:59 | FromDiscord | <mratsim> In reply to @Amun-Ra "<@210739784761475072>: just wait for": 128-bit isn't really useful. We are only using ~48-bit for memory addressing nowadays. |
11:44:02 | PMunch | @mratsim, not sure I get what you're trying to say |
11:44:42 | PMunch | Length as a byte limits you to 256 character long strings though. Fine for log messages and such though |
11:45:46 | * | szahid quit (Quit: leaving) |
12:00:03 | FromDiscord | <ynfle> In reply to @mratsim "<@!767093711112241162> see https://github.com/nim-l": I don't get it. Doesn't work in regular procs? |
12:00:49 | * | jmdaemon quit (Ping timeout: 256 seconds) |
12:01:55 | FromDiscord | <Yardanico> no |
12:03:16 | FromDiscord | <ynfle> So is there any solution for regular procs? Can I emit c code `FILE` and `LINE` and have `--debuginfo` for the compiler? |
12:04:27 | FromDiscord | <mratsim> In reply to @PMunch "<@570268431522201601>, not sure I": that Pascal strings can be as space efficient as C string |
12:04:40 | FromDiscord | <mratsim> if you store lengthas a byte |
12:04:50 | FromDiscord | <mratsim> for microcontrollers |
12:05:19 | FromDiscord | <mratsim> and way faster because no need to iterate to fetch the length all the time |
12:12:17 | PMunch | Sure, but if you never need to check length that serial send loop is now tracking and decrementing a pointer instead of just comparing the byte it just loaded from memory to null before sending it. So if the only thing you need to do is sending strings byte-by-byte C strings should still be faster/smaller |
12:12:52 | PMunch | Well, might depend on the CPU architecture |
12:13:39 | PMunch | My point was just that keeping data small is still a concern in some domains |
12:14:07 | PMunch | And the domain that C strings was designed for is closer to that than to modern computers |
12:15:40 | FromDiscord | <mratsim> In reply to @PMunch "Sure, but if you": You often need to preallocate a buffer before sending anything, for that you need the length |
12:17:25 | PMunch | Not on the sender side? At least for AVR you just set a register to the byte you want to send and wait for another register to go to the "ready" state before assigning another byte. |
12:17:30 | PMunch | No pre-allocation required |
12:19:21 | * | oddish joined #nim |
12:27:38 | FromDiscord | <claude> did anyone else know about this? does this differ for Nim across backends? https://media.discordapp.net/attachments/371759389889003532/935511227017351168/Screenshot_20220125_145804_org.mozilla.firefox.jpg https://media.discordapp.net/attachments/371759389889003532/935511227235463198/Screenshot_20220125_145156_org.mozilla.firefox.jpg |
12:31:24 | FromDiscord | <ynfle> That isn't in nim |
12:33:15 | FromDiscord | <ynfle> Can someone answer some questions about the internals of the compiler for me? I'm trying to do a bug fix |
12:33:25 | PMunch | I think he meant if you wrote the equivalent Nim code and compiled it for C and JS, would you see the same difference of output |
12:36:54 | FromDiscord | <ynfle> After testing, yes |
12:43:51 | PMunch | Well that's not great |
12:45:58 | PMunch | What is JS actually doing there though? |
12:48:21 | PMunch | Is it some kind of variable scoping rule? |
12:49:40 | FromDiscord | <ynfle> In reply to @PMunch "Is it some kind": Probably |
13:08:35 | FromDiscord | <ynfle> Any guidance on this bug would be much appreciated https://github.com/nim-lang/Nim/issues/19446 |
13:15:32 | * | szahid joined #nim |
13:30:00 | * | keypey joined #nim |
13:35:57 | * | keypey quit (Quit: Leaving) |
13:36:17 | * | keypey joined #nim |
14:16:57 | FromDiscord | <Benjamin> Isn't it just that JS has different semantics for \`+=\`? I.e., looking up the value of the left-hand side before evaluating the right-hand side. |
14:28:44 | FromDiscord | <Evrensel Kişilik> Unity is making me crazy |
14:28:49 | FromDiscord | <Evrensel Kişilik> gimme Godot |
14:30:22 | FromDiscord | <Rika> there is a nim godot binding |
14:31:14 | FromDiscord | <hmmm> can we unity stuff on nim yet? 🤔 |
14:31:53 | FromDiscord | <Evrensel Kişilik> In reply to @Rika "there is a nim": oh no im happy with GDScript |
14:32:01 | FromDiscord | <xflywind> And there is a plan rewrite binding to support godot 4.0; see https://discord.com/channels/371759389889003530/845770858470965258/897354249405616139 |
14:32:03 | FromDiscord | <Rika> LOL |
14:32:44 | FromDiscord | <xflywind> (edit) "And there is a plan ... rewrite4.0" added "to" | "4.0;" => "4.0 (gdextension);" |
14:33:19 | FromDiscord | <hmmm> how can you be fine with that fake python noodle lang when you can use num 🧐 |
14:33:28 | FromDiscord | <hmmm> nim |
14:33:51 | FromDiscord | <Evrensel Kişilik> In reply to @hmmm "can we unity stuff": C################### |
14:34:46 | FromDiscord | <mratsim> In reply to @hmmm "can we unity stuff": I remember Unreal Engine: https://github.com/pragmagic/nimue4 |
14:34:59 | FromDiscord | <mratsim> and plenty of other engines |
14:35:08 | FromDiscord | <mratsim> it's like a competition to make game engine bindings in Nim |
14:45:35 | * | arkurious joined #nim |
14:48:55 | FromDiscord | <Phil> ~~Why can't we have a competition of making the perfect nim orm so that my life becomes easier~~ |
14:49:17 | PMunch | You bring the price money, I'll bring the competition |
14:50:56 | PMunch | Oh well, gotta go |
14:50:57 | * | PMunch quit (Quit: leaving) |
14:55:32 | * | keypey quit (Quit: Leaving) |
14:56:43 | FromDiscord | <Phil> ... I'm willing to throw in 50-100€... which is basically nothing but I'm not rich yet |
14:58:29 | FromDiscord | <hmmm> I'll throw in a lemon flavoured ice cream 🍋 |
15:04:21 | FromDiscord | <haolian9 (高浩亮)> hi all, i was reading nim for [python programmer](https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#Sets), and i found the proc's naming convention changed to camel in nim 1.6.2 `to_table -> toTable`; does the doc needs an updation? |
15:04:41 | FromDiscord | <Rika> nim supports either convention |
15:04:48 | FromDiscord | <Rika> preferred is camel |
15:04:59 | FromDiscord | <Rika> i dont know if docs should reflect the preferred |
15:09:29 | FromDiscord | <enthus1ast> Imho they should |
15:14:23 | FromDiscord | <huantian> Having differing casing in the docs is probably just unnecessarily confusing |
15:14:36 | FromDiscord | <huantian> ~~or displeasing to the eye~~ |
15:18:51 | FromDiscord | <xflywind> In official docs, camel cases are enforced. As for that wiki article which is managed by the community, snake cases are all over there, which are consistent with the Python version. |
15:34:18 | FromDiscord | <konsumlamm> In reply to @haolian9 (高浩亮) "hi all, i was": the naming convention didn't change in 1.6.2, it always was camelCase |
15:38:17 | FromDiscord | <haolian9 (高浩亮)> thank you, seems i just need to read more doc, like https://nim-lang.org/docs/nep1.html |
15:57:23 | FromDiscord | <ajusa> Nim's pretty close to hitting 2k open issues, big milestone coming up |
16:02:29 | FromDiscord | <huantian> Time to make up some bugs |
16:08:49 | FromDiscord | <konsumlamm> no need to make them up, just run all tests in the VM |
16:18:32 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
16:31:12 | FromDiscord | <mratsim> There was a time, must have been prehistory, when we wanted to squash all bugs and go beyond 1k |
16:31:26 | FromDiscord | <mratsim> iirc it was 2018 and Nim had 1.1 or 1.2 open bugs. |
16:50:18 | FromDiscord | <Patitotective> Uuh, I'm tired of my parser, the comments sometimes not work, and when I fix them, the indentation stuff breaks 😭 |
16:50:43 | * | rockcavera joined #nim |
16:50:43 | * | rockcavera quit (Changing host) |
16:50:43 | * | rockcavera joined #nim |
16:53:26 | FromDiscord | <leorize> maybe your parser is too complex \:p |
16:53:59 | FromDiscord | <Patitotective> In reply to @leorize "maybe your parser is": how do i simplify it? ;-; |
16:54:15 | FromDiscord | <leorize> how are you writing your parser? |
16:54:20 | FromDiscord | <Patitotective> _npeg_ |
16:54:31 | FromDiscord | <Patitotective> `peg` macro |
16:54:33 | FromDiscord | <leorize> yea... that's a problem \:p |
16:55:11 | FromDiscord | <Patitotective> and some other `grammar` macros to parse strings and numbers |
16:55:26 | FromDiscord | <Patitotective> In reply to @leorize "yea... that's a problem": is there a better way? |
16:55:40 | FromDiscord | <leorize> I guess it really depends on how you're structuring your grammar |
16:57:40 | FromDiscord | <leorize> are you composing them from tokens? |
16:58:18 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Nva |
16:58:35 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3Nva" => "https://paste.rs/YnB" |
16:59:10 | FromDiscord | <Patitotective> I remove the code block captures |
16:59:11 | FromDiscord | <Patitotective> (edit) "remove" => "removed" |
17:00:09 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3Nvf" => "https://play.nim-lang.org/#ix=3Nve" |
17:00:25 | FromDiscord | <Patitotective> `number` and `str` are the other `grammar`s |
17:00:52 | FromDiscord | <Patitotective> (edit) "other `grammar`s" => "`grammar` macros" |
17:00:56 | FromDiscord | <leorize> looks like your paser tokenize and try to make sense of them at the same time |
17:02:00 | FromDiscord | <Patitotective> So, I should only tokenize it? |
17:02:07 | FromDiscord | <Patitotective> (edit) "So, ... I" added "should" | removed "should" |
17:02:12 | FromDiscord | <leorize> maybe what you should be looking at is to first tokenize, then produce groupings of them, then interpret that |
17:02:14 | FromDiscord | <Patitotective> (edit) "it?" => "it in the `peg` macro?" |
17:02:31 | FromDiscord | <leorize> ie. `indent` can be a token |
17:03:16 | FromDiscord | <leorize> then you run your parser on the token stream to compress indent into semantic meaning |
17:03:42 | FromDiscord | <Patitotective> In reply to @leorize "maybe what you should": when you say produce groupings you mean objects? like nim nodes? |
17:05:09 | FromDiscord | <leorize> yea, things like that |
17:05:14 | FromDiscord | <leorize> nim nodes are very memory inefficient, but they are a good start |
17:05:32 | FromDiscord | <Patitotective> do you have any article or video about it? :p |
17:05:47 | * | PMunch joined #nim |
17:06:45 | FromDiscord | <Patitotective> https://www.youtube.com/watch?v=bxpc9Pp5pZM ? lol |
17:09:11 | FromDiscord | <leorize> https://craftinginterpreters.com/scanning.html |
17:09:34 | FromDiscord | <leorize> it's about writing a programming language but much of the stuff in here can be reused to parse any complex structured language |
17:10:00 | FromDiscord | <Patitotective> 👍 |
17:10:01 | FromDiscord | <Patitotective> thanks |
17:10:02 | FromDiscord | <Patitotective> 🙃 |
17:10:20 | FromDiscord | <leorize> you should only need the concepts from this and not the implementations |
17:10:47 | FromDiscord | <leorize> npeg is pretty capable of parsing just about anything, even custom token streams |
17:12:19 | PMunch | npeg is a gem of library |
17:18:52 | FromDiscord | <eyecon> I'm a zealot for honeycomb, I find it much more intuitive |
17:19:02 | FromDiscord | <eyecon> Just wrote a duration parser in that |
17:19:23 | FromDiscord | <eyecon> In early stages for sure but I find the definitions readable |
17:20:10 | FromDiscord | <eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3Nvn |
17:23:25 | * | vicfred joined #nim |
17:24:51 | * | kayabaNerve joined #nim |
17:27:40 | * | vicfred quit (Client Quit) |
17:59:20 | Zevv | you guys should see Xpeg, that's even nicer |
18:05:20 | Amun-Ra | not to mention the jpeg |
18:10:27 | * | jmdaemon joined #nim |
18:20:24 | FromDiscord | <lpha3ch0> Can anyone help with good resources for learning concurrency in Nim? I looked at "Nim in Action" but it just wasn't enough. |
18:22:47 | * | neceve joined #nim |
18:23:46 | Zevv | ha |
18:24:12 | Zevv | araq will have a talk at fosdem next week about just that subject, i believe |
18:26:54 | * | neurocyte0917090 joined #nim |
18:32:32 | FromDiscord | <Patitotective> In reply to @leorize "you should only need": actually the implementations look easier than _npeg_ hehe |
18:36:15 | * | NimEventer quit (Remote host closed the connection) |
18:42:31 | * | NimEventer joined #nim |
18:42:37 | * | NimEventer quit (Remote host closed the connection) |
18:42:45 | * | NimEventer joined #nim |
18:45:35 | FromDiscord | <gcao> sent a code paste, see https://play.nim-lang.org/#ix=3NvQ |
18:47:18 | * | NimEventer quit (Ping timeout: 250 seconds) |
18:47:48 | * | NimEventer joined #nim |
18:50:58 | FromDiscord | <mratsim> In reply to @Patitotective "So, should I only": separate the Lexer and the Parser |
18:51:12 | FromDiscord | <mratsim> that would be easier to debug and test. |
18:52:06 | FromDiscord | <mratsim> Then if you want to interleave them for efficiency of what not, you can use the great COBOL trick that accelerated their compilers by 70x more than 50 years ago: coroutines (or closure iterators in Nim). |
18:53:29 | FromDiscord | <mratsim> In reply to @gcao "hi how do I": yes |
18:54:21 | FromDiscord | <mratsim> In reply to @lpha3ch0 "Can anyone help with": Nim asyncdispatch is very similar to Python async/await |
18:55:04 | FromDiscord | <mratsim> Basically, when you call an async function, you are given a handle called a Future, that will allow you to retrieve the result. |
18:55:28 | FromDiscord | <lpha3ch0> In reply to @mratsim "Nim asyncdispatch is very": I never learned asyc programming in Python. As I said, I've only done concurrency in Golang, once, and just managed to make a simple example work. |
18:55:30 | FromDiscord | <mratsim> you do whatever, and at an appropriate place you `await` the future. |
18:56:01 | FromDiscord | <mratsim> or `waitFor` if you are in a normal function (not `async`). |
18:56:14 | FromDiscord | <gcao> In reply to @mratsim "yes": Thank you. But I'm getting error that indicates that what I passed in is not treated as a varargs.↵index 1 not in 0 .. 0 |
18:56:26 | FromDiscord | <gcao> In my seq there are two values. |
18:56:33 | FromDiscord | <mratsim> what happens in the background when you wall await is that if it's still not ready, it will proceed with other stuff. |
18:57:16 | FromDiscord | <gcao> (edit) "values." => "values.↵BTW I'm actually passing in a slice of seq." |
18:57:41 | FromDiscord | <mratsim> In reply to @gcao "In my seq there": can you try with a seq[int] just to rule out your string being interpreted as a seq[char] |
19:03:40 | FromDiscord | <demotomohiro> @lpha3ch0 Here is tutorial to learn asyncnet: https://xmonader.github.io/nimdays/day15_tcprouter.html |
19:09:12 | FromDiscord | <lpha3ch0> In reply to @demotomohiro "<@275045322705862656> Here is tutorial": thank you |
19:10:56 | * | Figworm quit (Quit: Figworm) |
19:11:57 | * | krux02 joined #nim |
19:16:16 | * | unmatched-paren joined #nim |
19:23:57 | * | jmdaemon quit (Ping timeout: 256 seconds) |
19:34:33 | FromDiscord | <Shiba> what is incremental compiling |
19:34:35 | FromDiscord | <Shiba> (edit) "compiling" => "compiling?" |
19:36:16 | FromDiscord | <Patitotective> In reply to @mratsim "separate the Lexer and": hmmm, and should i use a library for the lexer? |
19:36:39 | FromDiscord | <Patitotective> or from scratch? |
19:44:29 | unmatched-paren | hello! i'm adding nim support to Guix, which builds packages from source in a chroot in /tmp. obviously, this means that I can't use libraries conventionally; i'll have to figure out how to vendor dependencies instead of downloading them from nimble (the chroot intentionally has no internet access.) but before i do that, i have to get nimble working, which means vendoring std. is there a flag or env var that can set the location o |
19:44:29 | unmatched-paren | like the one that can set the search path for packages? (i understand from the manual that std and packages use separate search paths; correct me if i'm wrong.) |
19:45:52 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Nw9 |
20:00:09 | * | jmdaemon joined #nim |
20:10:17 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Nwg |
20:23:58 | * | jjido joined #nim |
20:27:41 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Nwo |
20:28:42 | FromDiscord | <mratsim> In reply to @IsaacPaul "Any way to do": np |
20:28:47 | FromDiscord | <mratsim> (edit) "np" => "no" |
20:29:00 | FromDiscord | <IsaacPaul> aw I was excited for a moment |
20:29:44 | FromDiscord | <mratsim> tbh if you use an {.inline.} proc the compiler will be able to do constant-folding at compile-time |
20:30:01 | FromDiscord | <IsaacPaul> ah good to know |
20:30:40 | FromDiscord | <mratsim> both Nim and GCC/LLVM |
20:31:10 | FromDiscord | <mratsim> here the costliest part is probably dereferencing the this.data pointer. |
20:31:35 | FromDiscord | <mratsim> the computation on the right hand side can be done while waiting for this dereference at the instruction level |
20:40:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:51:33 | unmatched-paren | nvm, i've found it: --lib:foo |
20:52:36 | * | noeontheend joined #nim |
20:59:57 | * | Colt quit (Quit: Leaving) |
21:01:25 | * | jmdaemon quit (Ping timeout: 256 seconds) |
21:08:37 | FromDiscord | <ynfle> In reply to @IsaacPaul "Any way to do": Why don't you use `uint8` whose max is 255? |
21:12:23 | FromDiscord | <IsaacPaul> I'm still working on the api. That could work for major but not minor and revision https://gist.github.com/izackp/3f6e43b153a750410492b242bbc7fe5d |
21:14:11 | FromDiscord | <IsaacPaul> I gotta play around with it some more. |
21:14:41 | FromDiscord | <mratsim> In reply to @ynfle "Why don't you use": the issue is that how do you deal with overflow. |
21:14:55 | FromDiscord | <mratsim> it's like people saying unsigned integer should be used for length |
21:15:22 | FromDiscord | <mratsim> suddenly you can't write if `a < len-1` because what if lenth == 0 |
21:15:33 | FromDiscord | <mratsim> (edit) "lenth" => "`length" | "0" => "0`" |
21:17:27 | FromDiscord | <IsaacPaul> yea that's the usual problem. |
21:19:44 | * | jmdaemon joined #nim |
21:19:52 | FromDiscord | <nekojes> Hey, I'm writing a .so in nim and I'm having trouble running tests with it? I'm getting `execution of an external program failed` cause my tests are also being compiled to a .so and can't run |
21:20:46 | Amun-Ra | then you need another thing to load that shared library and run |
21:21:28 | Amun-Ra | nekojes: why do you need to have tests as shared libs? |
21:21:42 | FromDiscord | <nekojes> No I mean, I don't want them to be shared libs |
21:21:51 | FromDiscord | <xx_ns> In reply to @nekojes "Hey, I'm writing a": tests are run on the code, not on the compiled binary? |
21:22:04 | FromDiscord | <xx_ns> it doesn't matter if it's a linkable elf or what |
21:23:08 | FromDiscord | <nekojes> Guess I'm confused. I'm just not sure what I need to set in order to get tests to run on my library. |
21:23:23 | FromDiscord | <xx_ns> how are you currently trying to run your tests |
21:23:28 | FromDiscord | <mratsim> don't use --app:lib |
21:23:40 | Amun-Ra | mhm |
21:25:31 | FromDiscord | <nekojes> But I need --app:lib to compile it to a library when I'm not testing? I'm also using nimterop to link in a .c file. If I remove the --app:lib then I get undefined references |
21:26:40 | FromDiscord | <mratsim> so you need a binary to link to that .so and calls your public API then. |
21:26:48 | FromDiscord | <mratsim> (edit) "calls" => "call" |
21:27:17 | FromDiscord | <mratsim> If you want to test from Nim you need to {.importc.} your public procedures. |
21:27:54 | * | unmatched-paren quit (Quit: ERC 5.4 (IRC client for GNU Emacs 28.0.90)) |
21:29:15 | Amun-Ra | tbh nimble should create binaries in tests/ and not shared libs in that case |
21:31:04 | FromDiscord | <nekojes> I think ideally I'd like it so when I'm not testing it compiles to a .so, but when I am testing it compiles otherwise, but in that case I'm not sure how to link the nimterop'd .c file |
21:32:47 | FromDiscord | <nekojes> and I'm not sure how to have it switch between --app:lib and not depending if I'm running `nimble test` or `nimble build` |
21:35:07 | Amun-Ra | will setting app type in config.nims in tests directory work? |
21:35:30 | FromDiscord | <mratsim> In reply to @nekojes "I think ideally I'd": {.compile:"foo.c".} |
21:35:36 | FromDiscord | <mratsim> (edit) "{.compile:"foo.c".}" => "`{.compile:"foo.c".}`" |
21:36:09 | FromDiscord | <nekojes> I have a `cCompile("foo.c")` |
21:36:34 | FromDiscord | <nekojes> in the nim file that the test is importing |
22:05:54 | FromDiscord | <nekojes> Looks like the pragma is working rather than cCompile. I mean, I'm getting a segfault but that's probably a different issue. Still not sure how to have it build a library when not testing tho? |
22:48:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
22:50:32 | * | neceve quit (Ping timeout: 240 seconds) |
22:56:31 | FromDiscord | <nekojes> \o/ got it running. Besides the don't compile to library when testing bit |
23:03:18 | * | jjido joined #nim |
23:08:05 | * | jjido quit (Client Quit) |
23:20:58 | arkanoid | what's wrong with my "iterator items[T]" call syntax? https://play.nim-lang.org/#ix=3Nxa |
23:21:09 | arkanoid | the typedesc version works nicely |
23:21:49 | FromDiscord | <Elegantbeef> `items[int]()` |
23:21:57 | FromDiscord | <Elegantbeef> You were not calling it |
23:24:56 | arkanoid | Elegantbeef, ok, right, but now I have another question on same topic, let me prepare a minimal case |
23:25:30 | arkanoid | but long story short: aa.items(openArray[byte]) works, but aa.items[:openArray[byte]]() doesn't |
23:25:53 | FromDiscord | <Elegantbeef> Well i await the min case |
23:38:14 | arkanoid | Elegantbeef, here you have two different behaviors. I'm experiencing same issues in my code, where I'm actually dealing with real data and not using openArray[T].default |
23:38:16 | arkanoid | https://play.nim-lang.org/#ix=3Nxe |
23:40:47 | * | noeontheend joined #nim |
23:42:09 | FromDiscord | <Elegantbeef> Yea there is no `low` for `openArray[T]` |
23:42:17 | FromDiscord | <Elegantbeef> So give me one minute |
23:42:35 | arkanoid | I'm wrapping another minimal example using real data |
23:42:43 | FromDiscord | <Elegantbeef> Actually nvm there is no default 😀 |
23:43:37 | FromDiscord | <Elegantbeef> Eh I see there is an issue so i'll see if i can get a work around for you |
23:45:14 | FromDiscord | <Elegantbeef> It's a generic issue afaict |
23:50:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
23:53:43 | FromDiscord | <ynfle> Beef do you have a moment for the compiler bug from yesterday? |
23:55:59 | FromDiscord | <Elegantbeef> I seen the comment but i dont have much to say |
23:56:27 | arkanoid | Elegantbeef, does your previous syntax fix apply here too? https://play.nim-lang.org/#ix=3Nxg |
23:56:27 | FromDiscord | <Elegantbeef> Trying to solve it as lazy as possible is the best, but depending on the case it doesnt work |
23:56:49 | FromDiscord | <Elegantbeef> Well it works but it shows a generic issue |
23:57:14 | FromDiscord | <Patitotective> In my parser should I start counting lines and columns from zero or from one? 🧐 |
23:57:29 | arkanoid | do you think I should open an issue about it? |
23:58:42 | FromDiscord | <Elegantbeef> Probably, though it's a generic sammich issue so probably will be fixed in eons |
23:59:59 | arkanoid | well, yes :D but at least theres a minimal example to test against |