00:01:16 | FromDiscord | <abenedic (Alex Benedict)> Thank you, would I try returning an `nnkOfBranch`? |
00:01:39 | FromDiscord | <Elegantbeef> No you need to return an entire case statement at once with the of branches filled |
00:02:13 | FromDiscord | <abenedic (Alex Benedict)> Ah, so I can't return a partial case statement. |
00:02:26 | FromDiscord | <Elegantbeef> Indeed |
00:02:35 | FromDiscord | <abenedic (Alex Benedict)> Awesome, thank you very much |
00:35:59 | FromDiscord | <Patitotective> What is a https://nim-lang.org/docs/typetraits.html#HoleyEnum ? 😕 |
00:36:44 | FromDiscord | <konsumlamm> an enum where the values of the vstiants are not continuous |
00:37:15 | FromDiscord | <konsumlamm> sent a code paste, see https://play.nim-lang.org/#ix=3Omm |
00:37:18 | FromDiscord | <Patitotective> oooh, Ok |
00:37:18 | FromDiscord | <Patitotective> thanks |
00:38:27 | FromDiscord | <Elegantbeef> A alias for easily figuring out if an enum has assigned values that are not contiguous |
00:43:47 | FromDiscord | <demotomohiro> When do you need to define HoleyEnum? I guess when you need to use C library that contain holy enum. |
00:44:01 | FromDiscord | <Elegantbeef> When you want to hurt people |
00:44:18 | FromDiscord | <Patitotective> How do I reverse a set? |
00:44:59 | FromDiscord | <demotomohiro> There is no order in set |
00:45:14 | FromDiscord | <Elegantbeef> I think they want the complement |
00:45:30 | FromDiscord | <Elegantbeef> `import std/setutils; echo complement({'a'..'b'}` |
00:46:06 | FromDiscord | <Patitotective> In reply to @demotomohiro "There is no order": Then why does `for i in {1, 2}` print `1 2` |
00:46:30 | FromDiscord | <Elegantbeef> Cause the order is defined in the bit signature |
00:47:04 | FromDiscord | <Elegantbeef> Each bit represents a single value from the `range.low` to `range.high` |
00:47:21 | FromDiscord | <Elegantbeef> So you'd iterate that range backward checking if it's in the set |
00:47:26 | FromDiscord | <Patitotective> so `for i in {2, 1}` would print `1 2` as well? |
00:47:31 | FromDiscord | <Elegantbeef> Yes |
00:47:41 | FromDiscord | <Patitotective> perfect thanks 👍 |
00:49:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Omn |
00:50:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Omo |
00:55:25 | * | krux02 quit (Remote host closed the connection) |
01:13:31 | termer | Does asyncnet use async streams or are the procs for interacting with async socks just specific to them? |
01:19:24 | FromDiscord | <Patitotective> sent a code paste, see https://paste.rs/2h7 |
01:19:31 | FromDiscord | <Elegantbeef> Sure but there is no other way |
01:19:55 | FromDiscord | <Elegantbeef> You have a collection of bits you need to iterate over them all to yield the collection in reverse |
01:20:04 | FromDiscord | <Elegantbeef> How do you think the iteration works anyway |
01:20:51 | FromDiscord | <demotomohiro> Even if you just iterate forward, you need to check every bits, isn't it? |
01:20:59 | FromDiscord | <Elegantbeef> Indeed |
01:21:11 | FromDiscord | <Elegantbeef> You only have bits |
01:23:20 | FromDiscord | <demotomohiro> So, if you have a large range set contains few elements, iterating seq that have same value might faster. |
01:28:34 | FromDiscord | <Patitotective> Are there reverse slices? |
01:29:19 | FromDiscord | <Rika> You can’t slice sets |
01:29:25 | FromDiscord | <Rika> It doesn’t really make sense |
01:29:47 | FromDiscord | <Patitotective> not sets |
01:30:11 | FromDiscord | <Patitotective> a seq |
01:30:14 | FromDiscord | <Patitotective> (edit) "seq" => "sequence" |
01:30:25 | FromDiscord | <Rika> Don’t think so |
01:30:55 | FromDiscord | <Patitotective> 😕 |
01:31:45 | FromDiscord | <Patitotective> Then how do I reverse a seq? |
01:32:07 | FromDiscord | <Elegantbeef> You can make iterators you know? |
01:33:12 | FromDiscord | <demotomohiro> Why do you want to reverse seq or set? |
01:33:13 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L37-L45 |
01:33:59 | FromDiscord | <Patitotective> In reply to @demotomohiro "Why do you want": https://github.com/nim-lang/Nim/pull/19480#discussion_r796866159 |
01:39:38 | FromDiscord | <demotomohiro> There is reverse proc in algorithm module https://nim-lang.org/docs/algorithm.html#reverse%2CopenArray%5BT%5D |
01:43:41 | FromDiscord | <Patitotective> :o |
01:46:12 | * | noeontheend joined #nim |
01:47:29 | * | tiorock joined #nim |
01:47:30 | * | rockcavera quit (Killed (calcium.libera.chat (Nickname regained by services))) |
01:47:30 | * | tiorock is now known as rockcavera |
01:59:32 | * | noeontheend quit (Ping timeout: 250 seconds) |
02:07:44 | * | rockcavera quit (Remote host closed the connection) |
02:15:29 | * | noeontheend joined #nim |
02:16:26 | * | neurocyte0917090 quit (Ping timeout: 250 seconds) |
02:35:34 | * | rockcavera joined #nim |
02:35:34 | * | rockcavera quit (Changing host) |
02:35:34 | * | rockcavera joined #nim |
02:58:02 | * | noeontheend quit (Ping timeout: 250 seconds) |
03:11:24 | * | arkurious quit (Quit: Leaving) |
04:21:14 | * | rockcavera quit (Remote host closed the connection) |
05:36:09 | * | Gustavo6046 joined #nim |
05:38:12 | * | blackbeard420 quit (*.net *.split) |
05:38:12 | * | kayabaNerve quit (*.net *.split) |
05:38:12 | * | FromDiscord quit (*.net *.split) |
05:38:12 | * | fowl quit (*.net *.split) |
05:38:12 | * | mahlon quit (*.net *.split) |
05:38:12 | * | syl quit (*.net *.split) |
05:38:12 | * | drewr quit (*.net *.split) |
05:38:12 | * | [R] quit (*.net *.split) |
05:38:12 | * | def- quit (*.net *.split) |
05:38:12 | * | tinystoat quit (*.net *.split) |
05:38:12 | * | flynn quit (*.net *.split) |
05:38:12 | * | GreaseMonkey quit (*.net *.split) |
05:38:12 | * | oprypin quit (*.net *.split) |
05:38:12 | * | notchris quit (*.net *.split) |
05:38:12 | * | NimEventer quit (*.net *.split) |
05:38:12 | * | joast quit (*.net *.split) |
05:38:12 | * | lain quit (*.net *.split) |
05:38:12 | * | cornfeedhobo quit (*.net *.split) |
05:38:12 | * | toothlessgear quit (*.net *.split) |
05:38:12 | * | ormiret quit (*.net *.split) |
05:38:12 | * | lucerne quit (*.net *.split) |
05:38:13 | * | rb quit (*.net *.split) |
05:38:13 | * | Mister_Magister quit (*.net *.split) |
05:38:13 | * | dv^_^ quit (*.net *.split) |
05:38:13 | * | Onionhammer quit (*.net *.split) |
05:38:13 | * | nrds quit (*.net *.split) |
05:38:13 | * | haakon quit (*.net *.split) |
05:38:13 | * | mal`` quit (*.net *.split) |
05:38:13 | * | oz quit (*.net *.split) |
05:42:27 | * | stkrdknmibalz quit (Ping timeout: 250 seconds) |
05:51:14 | * | Mister_Magister joined #nim |
05:51:14 | * | dv^_^ joined #nim |
05:51:14 | * | Onionhammer joined #nim |
05:51:14 | * | nrds joined #nim |
05:51:14 | * | haakon joined #nim |
05:51:14 | * | mal`` joined #nim |
05:52:44 | * | GreaseMonkey joined #nim |
05:52:44 | * | oprypin joined #nim |
05:52:44 | * | notchris joined #nim |
05:52:44 | * | NimEventer joined #nim |
05:52:44 | * | joast joined #nim |
05:52:44 | * | lain joined #nim |
05:52:44 | * | cornfeedhobo joined #nim |
05:52:44 | * | toothlessgear joined #nim |
05:52:44 | * | ormiret joined #nim |
05:52:44 | * | lucerne joined #nim |
05:52:44 | * | rb joined #nim |
05:53:35 | * | blackbeard420 joined #nim |
05:53:35 | * | kayabaNerve joined #nim |
05:53:35 | * | FromDiscord joined #nim |
05:53:35 | * | fowl joined #nim |
05:53:35 | * | mahlon joined #nim |
05:53:35 | * | syl joined #nim |
05:53:35 | * | drewr joined #nim |
05:53:35 | * | [R] joined #nim |
05:53:35 | * | def- joined #nim |
05:53:35 | * | tinystoat joined #nim |
05:53:35 | * | flynn joined #nim |
05:54:13 | * | Gustavo6046 quit (Remote host closed the connection) |
05:54:28 | * | Gustavo6046 joined #nim |
05:54:51 | * | oz joined #nim |
06:04:19 | * | Gustavo6046 quit (Quit: Leaving) |
06:12:30 | * | Gustavo6046 joined #nim |
06:13:48 | * | Gustavo6046 quit (Remote host closed the connection) |
06:14:09 | * | Gustavo6046 joined #nim |
06:58:11 | * | jjido joined #nim |
07:32:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:35:03 | * | jjido joined #nim |
07:41:47 | NimEventer | New Nimble package! mt - A simple TLDR pages client, see https://codeberg.org/eqf0/mt/ |
07:46:36 | * | PMunch joined #nim |
07:51:19 | * | neurocyte0917090 joined #nim |
08:17:23 | PMunch | Hmm, once again I meet the lack of support for jsondocs.. |
08:18:44 | PMunch | I guess I should make an RFC for getting the compiler to only output JSON and then have a program called to turn that JSON into HTML and LaTeX.. |
08:19:36 | * | neurocyte0917090 quit (Ping timeout: 256 seconds) |
08:21:49 | * | neurocyte0917090 joined #nim |
08:33:10 | FromDiscord | <Hamid_Bluri> In reply to @demotomohiro "Why do you want": beef you're genius |
08:33:25 | FromDiscord | <Elegantbeef> I'm? |
08:35:07 | FromDiscord | <Hamid_Bluri> yes you are |
08:36:41 | PMunch | https://github.com/nim-lang/RFCs/issues/447 |
08:37:07 | * | enyc joined #nim |
08:39:25 | FromDiscord | <Hamid_Bluri> In reply to @hamidb80 "beef you're genius": i replied wrong msg |
08:39:44 | FromDiscord | <Hamid_Bluri> In reply to @Elegantbeef "https://github.com/beef331/slicerator/blob/master/s": i wanted to reply this |
08:39:54 | FromDiscord | <Hamid_Bluri> (edit) "In reply to @Elegantbeef "https://github.com/beef331/slicerator/blob/master/s": i wanted to reply ... this" added "to" |
08:41:08 | FromDiscord | <Elegantbeef> Ah |
08:54:45 | FromDiscord | <demotomohiro> @PMunch Nim have parsed RST data as `PRstNode`. So I think you can get the json data by serializig the `PRstNode` with marshal module. Then your program can get the `PRstNode` by deserializing it. |
08:55:56 | PMunch | Haha, I was actually just sitting here reading the RST module right now |
08:56:11 | PMunch | But yeah, something like that should be possible |
08:57:04 | PMunch | I mean this shouldn't be hard, but it might be a bit time-consuming because every part of the existing system is built around outputting HTML |
08:58:02 | FromDiscord | <Phil> Say I have a package with dependencies. To make that installable, do I have to enter all my package dependencies with their version to the nimble file by hand? Is there a command for that? Is the nimble file even the correct place for it?↵I thought nimble lock was the thing to do, but I just discovered that according to `nimble --help` that no longer exists |
08:58:41 | FromDiscord | <Phil> (edit) "installable," => "installable with `nimble install`," |
08:58:42 | FromDiscord | <Elegantbeef> You just use requires for now |
08:59:15 | FromDiscord | <Elegantbeef> Lock files are coming but the nimble update that introduced them caused issues for people so they were pulled back and will be readded soon tm |
08:59:50 | FromDiscord | <Phil> Check, so I have to write them by hand? |
08:59:59 | FromDiscord | <Phil> (for now) |
09:00:08 | FromDiscord | <Elegantbeef> Yes you need to write your requires by hand presently |
09:00:54 | FromDiscord | <Phil> That might explain why my nimstoryfont project didn't compile for Waldecir, I had forgotten writing 3 of the dependencies in there |
09:01:14 | FromDiscord | <Phil> Thanks! |
09:02:28 | * | vicecea quit (Remote host closed the connection) |
09:02:58 | * | vicecea joined #nim |
09:20:01 | * | jmdaemon quit (Ping timeout: 256 seconds) |
09:26:28 | * | fowl quit (Ping timeout: 256 seconds) |
09:29:16 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:30:36 | * | rp1 joined #nim |
09:31:31 | FromDiscord | <Phil> In reply to @Elegantbeef "Yes you need to": Just so I'm on the safe side in terms of understanding constructor:↵The second parameter of the `implDefaults` macro is optional, correct? |
09:31:48 | FromDiscord | <Elegantbeef> It's not optional |
09:31:55 | FromDiscord | <Elegantbeef> Atleast with the new version |
09:32:05 | FromDiscord | <Phil> That |
09:32:20 | FromDiscord | <Phil> explains why my project didn't compile for Waldecir |
09:32:40 | FromDiscord | <Phil> What does genFlags do? what's it for? |
09:33:12 | FromDiscord | <Elegantbeef> https://github.com/beef331/constructor/blob/master/src/constructor/defaults.nim#L5-L7 |
09:37:46 | FromDiscord | <Phil> so defExported allows the proc to be exported (just adds a ) and defTypeConstr...I don't think I get what the result of defTypeConstr is |
09:38:16 | FromDiscord | <Elegantbeef> https://github.com/beef331/constructor/blob/master/tests/tdefaults.nim#L25-L29 |
09:39:15 | FromDiscord | <Phil> So instead of a `newMyModel()` it generates a `new(t: typedesc[MyModel])` |
09:39:26 | FromDiscord | <Elegantbeef> Yes |
09:39:35 | FromDiscord | <Phil> Mind if I add that to the readme in a PR? |
09:39:47 | FromDiscord | <Elegantbeef> Feel free |
09:40:18 | FromDiscord | <Elegantbeef> the runnable examples also need fixed iirc |
09:40:56 | FromDiscord | <Elegantbeef> I might have a fix to make it an optional parameter |
09:42:21 | FromDiscord | <Phil> Is that even possible in macros? I mean, it would be neat for the API if I don't want to have to think about this |
09:42:42 | FromDiscord | <Elegantbeef> Yea i think so |
09:43:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OoF |
09:43:54 | FromDiscord | <Elegantbeef> There most recent version 😛 |
09:45:26 | FromDiscord | <Phil> In reply to @Elegantbeef "There most recent version": yay! |
09:57:25 | * | jjido joined #nim |
10:33:25 | FromDiscord | <Phil> ... I do not comprehend github |
10:33:27 | FromDiscord | <Phil> Or git |
10:33:30 | FromDiscord | <Phil> One of these two |
10:33:43 | FromDiscord | <Elegantbeef> What;s the problem? |
10:33:48 | FromDiscord | <Phil> Beef, I can see your flag-code on github, it's nice, it's there, it exists |
10:33:58 | FromDiscord | <Phil> Yet it's not in my fork |
10:34:05 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:34:07 | FromDiscord | <Phil> and I can't sync, it claims everything is up to date |
10:34:42 | FromDiscord | <Phil> And if I locally pull from your git-repo into my local repo, I still don't see iiiiiiiiit wait am I on the right branch locally |
10:35:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/gDs |
10:35:27 | FromDiscord | <Elegantbeef> Then you just add to the docs push and PR |
10:35:47 | FromDiscord | <Phil> Ahhh there it is, git pull beef upstream (I named the remote to your repo "beef") gave me what I was looking for |
10:36:45 | FromDiscord | <Phil> (edit) "upstream" => "master" |
10:37:03 | FromDiscord | <Elegantbeef> Well sleepy sleepy for me i'll look at your PR tomorrow |
10:37:17 | FromDiscord | <xx_ns> In reply to @Isofruit "And if I locally": recommend getting an indicator for that in your shell |
10:37:25 | FromDiscord | <xx_ns> i use something like this https://media.discordapp.net/attachments/371759389889003532/938382592158335016/unknown.png |
10:37:42 | FromDiscord | <xx_ns> it fetches the status async so it doesn't reduce prompt load times |
10:38:03 | FromDiscord | <Phil> One day I might! ... but not now because lazy |
10:38:13 | FromDiscord | <Phil> I use vscode so the shell would be bash |
10:38:22 | FromDiscord | <Phil> And I've never tinkered with bash so far outside of setting some env variables |
10:38:30 | FromDiscord | <xx_ns> i personally use zsh |
10:38:35 | FromDiscord | <xx_ns> here's my status script |
10:38:36 | FromDiscord | <xx_ns> https://github.com/nnsee/.shincludes/blob/master/zsh/git-status.sh |
10:39:27 | FromDiscord | <Phil> In reply to @Elegantbeef "Well sleepy sleepy for": Sleep well! |
10:55:05 | FromDiscord | <haxscramper> In reply to @PMunch "But yeah, something like": current documentation generator does not have any intermediate representation implemented for any part of the code |
10:55:44 | PMunch | Oh trust me, I know.. |
10:55:46 | FromDiscord | <haxscramper> everything is written out as the documentor pass traverses the code, and things are substituted directly into string interpolation |
10:56:07 | PMunch | It does invoke the RST parser for comments though |
10:56:31 | PMunch | Which is what we where talking about there |
10:56:52 | PMunch | Basically to make this work you'd also need to write a RST -> JSON part |
10:57:23 | PMunch | Which also does highlighting of Nim code and references as JSON |
10:57:55 | FromDiscord | <haxscramper> Ideally this thing should just collect list of documentable entries that can be written later on |
10:58:07 | PMunch | But I've looked at the source code for these parts (I've modified some of them as well), and while it is a bit of work it shouldn't be all that hard |
10:58:14 | FromDiscord | <haxscramper> json is just a representation, there is no need to even discuss it for the inner part of the docgen |
10:58:49 | FromDiscord | <haxscramper> but that's probably a more extreme opinion on the implementation, extending json and removing html/latex might seem easier at the start |
10:59:07 | PMunch | Ah you want to have types internally and build some internal documentation representation and then just convert that to JSON for the final output? |
10:59:36 | FromDiscord | <haxscramper> yes, that's what I find reasonable style of implementing stuff like this |
10:59:40 | FromDiscord | <haxscramper> collect the data |
10:59:44 | FromDiscord | <haxscramper> render the data |
11:00:11 | PMunch | The problem is that parts of the code like the highlighter and RST parser are separate modules, the RST parer in particular just spits out a string (with HTML) |
11:00:38 | PMunch | So these packages (which are available to import into your project without importing the whole compiler), would also know how to deal with this internal format |
11:01:02 | PMunch | Or it would need to have some kind of callback functionality so that you can hook it onto your own format when you call it |
11:02:57 | FromDiscord | <haxscramper> idk, maybe wrap rst ast into json as well? |
11:03:21 | PMunch | Ie. look at `genComment` (compiler/docgen.nim:222) which calls `renderRstToOut` (lib/packages/docutils/rstgen.nim:995) |
11:03:23 | FromDiscord | <haxscramper> parse rst, resolve all links, generate data and render it later |
11:04:00 | PMunch | I guess `renderRstToOut` could be moved into `compiler/docgen` though |
11:04:21 | PMunch | I agree that it's a much better way of doing it though |
11:04:38 | PMunch | But it would be trickier to actually do because of how the current system is built.. |
11:05:15 | FromDiscord | <haxscramper> the documentation generator either continues to be a half-assed solution, or it needs a nontrivial rework |
11:05:52 | FromDiscord | <haxscramper> the fact you can't even see fields in `when` properly, or any types in `when` |
11:06:28 | FromDiscord | <haxscramper> with proper IR you can just make a pre-sem visitation that collects a possible list of the documentable entries, and then clarify it in post-sem |
11:06:36 | FromDiscord | <haxscramper> without proper IR you are just dead |
11:13:38 | FromDiscord | <haxscramper> For example, I still can't find where the enum generation happens |
11:14:13 | FromDiscord | <haxscramper> or rather, I tried to uncover the mess that field generation for enums is |
11:16:11 | FromDiscord | <haxscramper> In reply to @haxscramper "with proper IR you": https://github.com/nim-works/nimskull/pull/214 |
11:16:29 | FromDiscord | <haxscramper> changes in depends.nim |
11:18:18 | FromDiscord | <haxscramper> this is a proof-of-concept, but the differenence in "before" and "after" graphs should illustrate just how many important things are missing when the documentation is generated |
11:18:46 | * | m5zs7k quit (Ping timeout: 260 seconds) |
11:18:54 | FromDiscord | <haxscramper> and with proper IR you can even go into more sophisticated analysis, like compiling with different GCs or defines, and merging mutliple documentable entry databases |
11:19:44 | * | m5zs7k joined #nim |
11:44:37 | PMunch | Yeah it is a bit unfortunate that `when` statements have to be resolved, but on the other hand you could easily create a scenario in which it would be impossible to solve for all when statements |
11:45:11 | PMunch | Of course `when defined` might be easier to evaluate |
11:45:37 | * | jjido joined #nim |
12:04:10 | FromDiscord | <Shiba> how can i stop the process of checking of changes in modulses and specify the modules where i made changes |
12:04:17 | FromDiscord | <Shiba> (edit) "modulses" => "modules" |
12:04:22 | FromDiscord | <Shiba> (edit) "changes" => "changes?" |
12:04:44 | * | l1x joined #nim |
12:05:26 | FromDiscord | <haxscramper> In reply to @PMunch "Yeah it is a": you don't need to resolve all `when` statements, you just need to know that some procs might be available only on js backend, or only on C backend |
12:05:31 | FromDiscord | <haxscramper> same for fields |
12:06:14 | FromDiscord | <haxscramper> this dives deeper into general program analysis, gut current `genDepend` is very misleading for example, for system it shows only fraction of the complexity |
12:06:30 | FromDiscord | <haxscramper> docgen and genDepend are pretty similar after all, they allow you to understand code better |
12:06:45 | PMunch | Not really, `when defined(windows): import "C:\\somefile.nim"` |
12:06:57 | FromDiscord | <haxscramper> what "not really"? |
12:07:19 | PMunch | I mean that simple example won't be possible to evaluate on Linux |
12:07:24 | PMunch | Because that path doesn't exist |
12:07:42 | PMunch | Trivial and silly example, but it's not hard to come up with a more realistic one |
12:07:52 | FromDiscord | <haxscramper> ok, yes, and you also can't document imports generated from macros |
12:08:25 | FromDiscord | <haxscramper> but you know, the point is providing as good of a solution as possible, instead of giving up on the whole endeavor just because someone might write this weird nonsense |
12:08:44 | PMunch | I mean that's why Nim goes the route of "lets just compile the project with all your flags and such, and generate the documentation for this particular build as we come across it"-route |
12:09:21 | FromDiscord | <haxscramper> yes, that documents a single combination of flags, gc, and backend |
12:09:29 | PMunch | It's not that weird, I think maybe even Futhark would break what you're proposing |
12:09:38 | FromDiscord | <haxscramper> it doesn't document the project as a whole, just a project as seen by t |
12:09:45 | PMunch | Correct |
12:09:49 | FromDiscord | <haxscramper> by the compiler |
12:10:28 | FromDiscord | <haxscramper> In reply to @PMunch "It's not *that* weird,": you think I don't understand that pre-sem analysis can be broken by macros? |
12:10:49 | FromDiscord | <haxscramper> I"m proposing to do a multistage information gathering, on both pre and pos-sem code versions |
12:11:07 | FromDiscord | <haxscramper> I'm not trying to propose documentation generator that operates purely on pre-sem data |
12:11:46 | FromDiscord | <haxscramper> I'm saying that post-sem data can be further enhanced if we don't discard the knowledge about the code that we found before semantic analysis |
12:13:22 | PMunch | Oh yeah, I*m just pointing out that it's hard |
12:13:28 | PMunch | I'm not saying we shouldn't do it |
12:13:35 | FromDiscord | <haxscramper> well, quality tooling is hard, right |
12:13:44 | FromDiscord | <haxscramper> not to be honest it is not that hard to do |
12:13:53 | FromDiscord | <haxscramper> given correct data model of course |
12:14:13 | PMunch | Although I guess you could potentially get a better picture if you generate the documentation for different combination of flags/platforms and then ingest them into the same system and combine them after the fact |
12:14:34 | FromDiscord | <haxscramper> `TLineInfo` is a good enough disambiguator for that sort of interactions IMO, maybe there are some additional heuristics that can be dispatched on top |
12:14:59 | FromDiscord | <haxscramper> In reply to @PMunch "Although I guess you": yes that would be an ideal solution, although a more expensive one to implement |
12:15:13 | PMunch | I mean with my jsondoc changes you could easily take both a Linux build and a Windows build and ingest them into a system which would then give you a dropdown to select platform or show the different implementations of similar procedures etc. |
12:15:18 | FromDiscord | <haxscramper> just merge two documentation database |
12:15:34 | PMunch | I mean this is the kind of stuff I want to do with my jsondoc RFC |
12:16:00 | PMunch | Basically build a database of the documentation, and then we can create a more dynamic representation of the documentation |
12:16:10 | PMunch | It could even support user comments/examples |
12:16:45 | PMunch | And you could have docs for different versions, showing the differences and such |
12:17:14 | FromDiscord | <haxscramper> crazy how much things you can do if the tools you work with can actually output data, right |
12:17:20 | FromDiscord | <haxscramper> instead of pretty-printed nonsense |
12:20:18 | PMunch | Data is pretty neat |
12:23:32 | FromDiscord | <haxscramper> put the advertisement for the possibilities on the RFC |
12:26:43 | FromDiscord | <haxscramper> also pre-sem visitation is just about the only way to list defines that project can react to |
12:26:57 | FromDiscord | <haxscramper> aside from hooking into sem layer of course |
12:33:51 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:42:37 | * | jjido joined #nim |
12:43:30 | * | jjido quit (Client Quit) |
12:44:50 | FromDiscord | <Waldecir Santos> I'd like to implement a table that works transparent for the user, for exemple if the table receives a string it convets to the proper ContextValue, but seems like I'm calling the parent function that dosen't accept my type, how can I archive that ? here it is my example |
12:44:57 | FromDiscord | <Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/938414686662172692/unknown.png |
12:49:39 | * | rockcavera joined #nim |
12:49:39 | * | rockcavera quit (Changing host) |
12:49:39 | * | rockcavera joined #nim |
12:58:43 | * | fvs joined #nim |
13:02:54 | PMunch | You need to make your Context either a wrapper object or a distinct object and then convert it back |
13:03:22 | PMunch | The problem here is that at line 17 it triggers the procedure at line 15 again, but now V is a ContextValue |
13:04:51 | PMunch | Well, maybe you don't need a distinct value, but you need to use something like `tables.\`[]=\`(this, key, ContextValue(<...>)` in order to call the correct []= proc from the tables module and not the one you just created |
13:05:13 | PMunch | It would be much easier to show this to you if you had shared you code via the playground instead of as a screenshot: play.nim-lang.org |
13:05:51 | FromDiscord | <Waldecir Santos> Oh I see what you mean but let me share it |
13:06:29 | FromDiscord | <Waldecir Santos> https://play.nim-lang.org/#ix=3Oqm |
13:09:54 | PMunch | This works: https://play.nim-lang.org/#ix=3Oqn |
13:10:14 | PMunch | Note that I also had to make `Context` into a `var` |
13:10:45 | PMunch | Since we're mutating it |
13:16:31 | * | Gustavo6046 quit (Quit: Leaving) |
13:18:01 | FromDiscord | <enthus1ast> @Waldecir Santos\: and before you try to long to use multiple "value" attributes with the same name in a case object, they this is not allowed |
13:18:22 | FromDiscord | <enthus1ast> @Waldecir Santos\: and before you try too long to use multiple "value" attributes with the same name in a case object, this is not allowed |
13:26:37 | * | jjido joined #nim |
13:36:17 | FromDiscord | <Waldecir Santos> Oh I see that is sad, but fine, thanks for pointing this up |
13:38:44 | * | sagax joined #nim |
13:43:50 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:01:17 | * | noeontheend joined #nim |
14:08:30 | * | fowl joined #nim |
14:34:31 | * | noeontheend quit (Ping timeout: 256 seconds) |
14:36:26 | FromDiscord | <ache of head> In reply to @Waldecir Santos "": hey, i'm actually kinda curious now, what font is that? |
14:36:54 | FromDiscord | <ache of head> i feel like i know it but i can't recall the name or where i've seen it before |
14:37:36 | FromDiscord | <Waldecir Santos> https://www.monolisa.dev |
14:38:46 | FromDiscord | <ache of head> oh right! |
14:38:52 | FromDiscord | <ache of head> thanks |
14:40:11 | * | rockcavera quit (Remote host closed the connection) |
14:42:24 | * | arkurious joined #nim |
14:43:31 | FromDiscord | <--HA--> Hello. I'm doing C interop. I'm passing a string allocated like this `var s = newString(MAX_LEN)` to a C function via `s.cstring`. The C function writes a string but I do not know it's length other than it being <= MAX_LEN. How can I best set the length of `s` to the length till the first zero byte? Or how should I do this differently? |
14:44:32 | FromDiscord | <--HA--> I do get a string back fine but it is filled with `\x0` till the cap |
14:48:35 | FromDiscord | <demotomohiro> Are there any C function that return the length of that string? |
14:49:19 | PMunch | Are you sure the C function doesn't return the length of the string? It's fairly common in C |
14:49:37 | PMunch | But otherwise you could probably do `s.setLen(s.cstring.len)` |
14:50:44 | FromDiscord | <tandy> is there a way to check if a type/object is null? |
14:50:56 | FromDiscord | <tandy> for objects you can do `isNil`, but that doesnt work for strings or ints |
14:51:05 | FromDiscord | <demotomohiro> Your C library just says the C function doesn't write more than MAX_LEN? |
14:51:20 | * | rockcavera joined #nim |
14:51:20 | * | rockcavera quit (Changing host) |
14:51:20 | * | rockcavera joined #nim |
14:51:31 | FromDiscord | <demotomohiro> string or int is not a pointer. They never nil. |
14:51:47 | FromDiscord | <Rika> Strings and ints cannot be null |
14:51:55 | FromDiscord | <demotomohiro> ref object can be nil but object never nil. |
14:52:08 | FromDiscord | <Rika> Pointers can too |
14:52:21 | FromDiscord | <Rika> But only those, pretty much |
14:52:27 | FromDiscord | <tandy> is there a way to check if they havent been initialised then?↵(@Rika) |
14:52:36 | FromDiscord | <demotomohiro> If I remember collectly, string or seq can be nil before version 1.0 |
14:52:41 | FromDiscord | <Rika> Check if they’re == default(Type)? |
14:52:53 | FromDiscord | <Rika> In reply to @demotomohiro "If I remember collectly,": Before 0.20 |
14:52:54 | FromDiscord | <tandy> hmm |
14:52:57 | FromDiscord | <tandy> maybe |
14:53:11 | FromDiscord | <enthus1ast> and its a godsent↵(@demotomohiro) |
14:53:14 | FromDiscord | <tandy> maybe i just need to use options |
14:53:15 | FromDiscord | <Rika> Of course that means you reject empty string or 0 even if it was explicitly initialised |
14:53:18 | * | tiorock joined #nim |
14:53:18 | * | tiorock quit (Changing host) |
14:53:18 | * | tiorock joined #nim |
14:53:19 | * | rockcavera is now known as Guest5423 |
14:53:19 | * | tiorock is now known as rockcavera |
14:53:27 | FromDiscord | <tandy> yeah..↵(@Rika) |
14:53:46 | FromDiscord | <Rika> If you control the type use {.requiresInit.} on the type definition |
14:53:53 | FromDiscord | <Rika> I believe that would require initialisation |
14:54:09 | FromDiscord | <--HA--> In reply to @PMunch "But otherwise you could": `s.cstring.len` works perfectly, thank you |
14:54:53 | FromDiscord | <--HA--> The C function returns an error code but not the length. I guess that is why they have that MAX_LEN constant. |
14:55:34 | FromDiscord | <Rika> Tandy, I don’t know what your use case is. It might help saying what it is |
14:56:30 | * | Guest5423 quit (Ping timeout: 250 seconds) |
14:59:08 | FromDiscord | <tandy> thanks rika, i just made things simpler lol |
15:00:05 | PMunch | Making things simpler is often a good idea |
15:05:09 | PMunch | Hmm, is it possible to set things like `cpu` and `os` build flags from within Nim? |
15:05:12 | FromDiscord | <Waldecir Santos> I'm trying to overload the table retrieve operator but I:m receiving a strange error (I still newbie 😄 ) can someone give me an idea on what is the problem, ps nim-play is broken :omg: |
15:05:15 | FromDiscord | <Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/938449992899788800/unknown.png |
15:05:22 | PMunch | Or must those be placed in the cfg file? |
15:05:59 | PMunch | @Waldecir_Santos, https://play.nim-lang.org/#ix=3Or1 |
15:06:15 | FromDiscord | <Waldecir Santos> it was lol |
15:06:16 | FromDiscord | <Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/938450250987864175/unknown.png |
15:06:38 | PMunch | That just tells you that `V` can't be guessed from the call |
15:06:40 | FromDiscord | <Waldecir Santos> ok here it is: https://play.nim-lang.org/#ix=3Or2 |
15:06:56 | FromDiscord | <demotomohiro> In reply to @PMunch "Making things simpler is": I never saw any pragma that allows setting os or cpu in nim file. I think you need to set them in cfg or .nims or compiler parameter. |
15:06:56 | PMunch | If you change `V` to ContextValue as the return type it should work |
15:07:37 | FromDiscord | <Waldecir Santos> I tried that same error |
15:07:50 | PMunch | Works fine for me: https://play.nim-lang.org/#ix=3Or3 |
15:08:06 | PMunch | I'm guessing you left the `V` in the generic parameters? |
15:08:11 | FromDiscord | <Waldecir Santos> OH my god the proc was wrong |
15:08:26 | FromDiscord | <Waldecir Santos> I had [K,V] and it should be [K] |
15:08:30 | PMunch | Mhm |
15:09:00 | FromDiscord | <Waldecir Santos> I got this example from tables.nim 🤔 |
15:09:03 | PMunch | @demotomohiro, that's what I was afraid of |
15:09:16 | FromDiscord | <Waldecir Santos> https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/tables.nim#L339 |
15:09:47 | PMunch | @Waldecir_Santos, yes because B there is used in the Table definition |
15:09:53 | PMunch | So it is able to find it |
15:10:00 | FromDiscord | <Waldecir Santos> I wonder why there works with "`[]`[A, B]" |
15:10:08 | FromDiscord | <Waldecir Santos> Got it |
15:11:34 | FromDiscord | <demotomohiro> In reply to @PMunch "<@288750616510201856>, that's what I": There is `passC`, `localPassc` or `passL` pragma, but I cannot find pragma to set os or cpu |
15:25:47 | * | jjido joined #nim |
15:26:55 | * | jjido quit (Client Quit) |
15:31:17 | * | ssiyad joined #nim |
15:39:14 | * | ssiyad quit (Quit: WeeChat 3.4) |
16:41:33 | * | noeontheend joined #nim |
17:16:12 | * | cyraxjoe joined #nim |
17:16:22 | * | MightyJoe quit (Ping timeout: 268 seconds) |
17:24:11 | * | neurocyte0917090 quit (Ping timeout: 256 seconds) |
17:25:05 | * | noeontheend quit (Ping timeout: 256 seconds) |
18:23:32 | * | cyraxjoe quit (Ping timeout: 252 seconds) |
18:30:41 | FromDiscord | <tandy> when is the next nim devel release? |
18:31:38 | FromDiscord | <tandy> i want to know when i can use my pull request https://github.com/nim-lang/Nim/pull/19473 |
18:38:15 | FromDiscord | <mratsim> In reply to @tandy "when is the next": nightlies are every night |
18:38:43 | FromDiscord | <mratsim> requires Nim 1.7 in Nimble |
18:53:01 | * | rightbrace joined #nim |
18:53:28 | * | cyraxjoe joined #nim |
18:57:34 | * | rightbrace quit (Quit: Lost terminal) |
19:05:11 | FromDiscord | <Josef> I have a pretty basic question, I would be very appreciative if anyone could help. I'm using a wrapper for a C library, and I notice that I cannot `deepCopy` wrapped structs (the object just gets a zero value). I couldn't find anything relevant in the manual or elsewhere online. What is the reason / what am I doing wrong? |
19:06:31 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
19:06:40 | * | MightyJoe joined #nim |
19:14:45 | * | fowl quit (Read error: Connection reset by peer) |
19:15:22 | * | fowl joined #nim |
19:19:01 | * | MightyJoe quit (Ping timeout: 240 seconds) |
19:21:48 | * | cyraxjoe joined #nim |
19:26:23 | * | vicfred joined #nim |
19:28:18 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
19:45:32 | NimEventer | New thread by Tcheran: Zlib.h: No such file or directory error on Windows, see https://forum.nim-lang.org/t/8861 |
19:59:39 | * | cyraxjoe joined #nim |
20:06:14 | * | tiorock joined #nim |
20:06:14 | * | tiorock quit (Changing host) |
20:06:14 | * | tiorock joined #nim |
20:06:14 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
20:06:14 | * | tiorock is now known as rockcavera |
20:08:51 | * | cyraxjoe quit (Ping timeout: 256 seconds) |
20:16:51 | * | fvs left #nim (WeeChat 3.4) |
20:18:19 | * | ssiyad joined #nim |
20:24:01 | FromDiscord | <pmunch> @Josef\: that sounds very strange. Do you have any code you can share? |
20:30:22 | * | krux02 joined #nim |
20:33:38 | * | jmdaemon joined #nim |
20:34:54 | FromDiscord | <oldteen> Hello, what tool do you use to edit your code and is there a recommended server language? |
20:35:17 | FromDiscord | <kaddkaka> In reply to @oldteen "Hello, what tool do": I use Neovim with pylsp language server |
20:35:36 | FromDiscord | <kaddkaka> In reply to @oldteen "Hello, what tool do": Or what do you mean by "server language"? |
20:39:41 | * | jmdaemon quit (Ping timeout: 250 seconds) |
20:40:53 | * | cyraxjoe joined #nim |
20:42:52 | * | jmdaemon joined #nim |
20:46:32 | FromDiscord | <tandy> i see, thank you↵(@mratsim) |
20:46:32 | PMunch | Maybe they meant library? |
20:46:56 | PMunch | Anyways, I use Vim to edit Nim, but I think most people use VSCode |
20:47:22 | FromDiscord | <Josef> sent a code paste, see https://paste.rs/U6S |
20:48:36 | PMunch | Ah, try changing those variables around |
20:48:48 | PMunch | deepCopy is (to, from) |
20:49:25 | FromDiscord | <Josef> Is `v2.deepCopy v1` not "copy v1 into v2"? |
20:49:36 | PMunch | Oh wait, yeah you're right |
20:49:51 | PMunch | Hmm, that's strange |
20:57:37 | PMunch | Very strange indeed |
21:00:41 | PMunch | That's definitely a bug, but why are you trying to use deepCopy anyways? |
21:00:49 | PMunch | You can just `var v2 = v1` |
21:11:45 | * | oz quit (*.net *.split) |
21:11:45 | * | blackbeard420 quit (*.net *.split) |
21:11:45 | * | kayabaNerve quit (*.net *.split) |
21:11:45 | * | FromDiscord quit (*.net *.split) |
21:11:45 | * | mahlon quit (*.net *.split) |
21:11:45 | * | syl quit (*.net *.split) |
21:11:45 | * | drewr quit (*.net *.split) |
21:11:45 | * | [R] quit (*.net *.split) |
21:11:45 | * | def- quit (*.net *.split) |
21:11:45 | * | tinystoat quit (*.net *.split) |
21:11:45 | * | flynn quit (*.net *.split) |
21:11:45 | * | rp1 quit (*.net *.split) |
21:11:46 | * | GreaseMonkey quit (*.net *.split) |
21:11:46 | * | oprypin quit (*.net *.split) |
21:11:46 | * | notchris quit (*.net *.split) |
21:11:46 | * | NimEventer quit (*.net *.split) |
21:11:46 | * | joast quit (*.net *.split) |
21:11:46 | * | lain quit (*.net *.split) |
21:11:46 | * | cornfeedhobo quit (*.net *.split) |
21:11:46 | * | toothlessgear quit (*.net *.split) |
21:11:46 | * | ormiret quit (*.net *.split) |
21:11:46 | * | lucerne quit (*.net *.split) |
21:11:46 | * | rb quit (*.net *.split) |
21:11:46 | * | ssiyad quit (*.net *.split) |
21:11:46 | * | Mister_Magister quit (*.net *.split) |
21:11:46 | * | dv^_^ quit (*.net *.split) |
21:11:46 | * | Onionhammer quit (*.net *.split) |
21:11:46 | * | nrds quit (*.net *.split) |
21:11:46 | * | haakon quit (*.net *.split) |
21:11:46 | * | mal`` quit (*.net *.split) |
21:11:46 | * | jmdaemon quit (*.net *.split) |
21:11:46 | * | cyraxjoe quit (*.net *.split) |
21:11:46 | * | krux02 quit (*.net *.split) |
21:11:47 | * | fowl quit (*.net *.split) |
21:11:47 | * | arkurious quit (*.net *.split) |
21:11:47 | * | vicecea quit (*.net *.split) |
21:11:47 | * | xiamx quit (*.net *.split) |
21:11:47 | * | crem1 quit (*.net *.split) |
21:11:47 | * | GnuYawk quit (*.net *.split) |
21:11:47 | * | l1x quit (*.net *.split) |
21:11:47 | * | Yardanico_ quit (*.net *.split) |
21:11:47 | * | robertmeta quit (*.net *.split) |
21:11:47 | * | rockcavera quit (*.net *.split) |
21:11:47 | * | vicfred quit (*.net *.split) |
21:11:47 | * | m5zs7k quit (*.net *.split) |
21:11:47 | * | Ekho quit (*.net *.split) |
21:11:47 | * | arkanoid quit (*.net *.split) |
21:11:47 | * | jkl quit (*.net *.split) |
21:11:48 | * | PMunch quit (*.net *.split) |
21:11:48 | * | happycorsair[m] quit (*.net *.split) |
21:11:48 | * | Jjp137 quit (*.net *.split) |
21:11:48 | * | ehmry quit (*.net *.split) |
21:11:48 | * | mjsir911 quit (*.net *.split) |
21:11:48 | * | averell quit (*.net *.split) |
21:11:48 | * | meowray quit (*.net *.split) |
21:11:48 | * | nixfreaknim[m] quit (*.net *.split) |
21:11:48 | * | k0mpjut0r quit (*.net *.split) |
21:11:48 | * | koltrast quit (*.net *.split) |
21:11:48 | * | LyndsySimon quit (*.net *.split) |
21:11:48 | * | greyrat_ quit (*.net *.split) |
21:11:48 | * | Schnouki quit (*.net *.split) |
21:11:48 | * | dv2 quit (*.net *.split) |
21:11:48 | * | redj quit (*.net *.split) |
21:11:48 | * | dom96 quit (*.net *.split) |
21:11:48 | * | adium quit (*.net *.split) |
21:11:49 | * | cheer[m] quit (*.net *.split) |
21:11:49 | * | ecs quit (*.net *.split) |
21:11:49 | * | xet7 quit (*.net *.split) |
21:11:49 | * | tk quit (*.net *.split) |
21:11:49 | * | szahid quit (*.net *.split) |
21:11:49 | * | nisstyre quit (*.net *.split) |
21:11:49 | * | sagax quit (*.net *.split) |
21:11:49 | * | Amun-Ra quit (*.net *.split) |
21:11:49 | * | Zevv quit (*.net *.split) |
21:11:49 | * | gshumway quit (*.net *.split) |
21:11:49 | * | madprops quit (*.net *.split) |
21:11:49 | * | djanatyn quit (*.net *.split) |
21:11:50 | * | ldlework quit (*.net *.split) |
21:11:50 | * | termer quit (*.net *.split) |
21:11:50 | * | euantorano quit (*.net *.split) |
21:11:50 | * | oisota quit (*.net *.split) |
21:11:50 | * | anddam quit (*.net *.split) |
21:11:50 | * | Nuc1eoN quit (*.net *.split) |
21:11:50 | * | enyc quit (*.net *.split) |
21:11:50 | * | om3ga quit (*.net *.split) |
21:12:23 | * | jkl joined #nim |
21:12:23 | * | arkanoid joined #nim |
21:12:23 | * | Ekho joined #nim |
21:12:23 | * | m5zs7k joined #nim |
21:12:23 | * | vicfred joined #nim |
21:12:23 | * | rockcavera joined #nim |
21:12:23 | * | jmdaemon joined #nim |
21:12:23 | * | cyraxjoe joined #nim |
21:12:23 | * | krux02 joined #nim |
21:12:25 | * | sagax joined #nim |
21:12:25 | * | Amun-Ra joined #nim |
21:12:25 | * | Zevv joined #nim |
21:12:25 | * | gshumway joined #nim |
21:12:25 | * | madprops joined #nim |
21:12:25 | * | djanatyn joined #nim |
21:12:52 | * | ssiyad joined #nim |
21:12:52 | * | Mister_Magister joined #nim |
21:12:52 | * | dv^_^ joined #nim |
21:12:52 | * | Onionhammer joined #nim |
21:12:52 | * | nrds joined #nim |
21:12:52 | * | haakon joined #nim |
21:12:52 | * | mal`` joined #nim |
21:13:07 | * | PMunch joined #nim |
21:13:07 | * | happycorsair[m] joined #nim |
21:13:07 | * | Jjp137 joined #nim |
21:13:07 | * | ehmry joined #nim |
21:13:07 | * | mjsir911 joined #nim |
21:13:07 | * | averell joined #nim |
21:13:07 | * | meowray joined #nim |
21:13:26 | * | enyc joined #nim |
21:13:26 | * | Nuc1eoN joined #nim |
21:13:26 | * | ldlework joined #nim |
21:13:26 | * | termer joined #nim |
21:13:26 | * | euantorano joined #nim |
21:13:26 | * | oisota joined #nim |
21:13:26 | * | anddam joined #nim |
21:13:26 | * | om3ga joined #nim |
21:13:30 | * | fowl joined #nim |
21:13:30 | * | arkurious joined #nim |
21:13:30 | * | vicecea joined #nim |
21:13:30 | * | xiamx joined #nim |
21:13:30 | * | crem1 joined #nim |
21:13:30 | * | GnuYawk joined #nim |
21:13:52 | * | blackbeard420 joined #nim |
21:13:52 | * | kayabaNerve joined #nim |
21:13:52 | * | FromDiscord joined #nim |
21:13:52 | * | mahlon joined #nim |
21:13:52 | * | syl joined #nim |
21:13:52 | * | drewr joined #nim |
21:13:52 | * | [R] joined #nim |
21:13:52 | * | def- joined #nim |
21:13:52 | * | tinystoat joined #nim |
21:13:52 | * | flynn joined #nim |
21:13:54 | PMunch | @Josef, created an issue for you: https://github.com/nim-lang/Nim/issues/19482 |
21:14:06 | * | nixfreaknim[m] joined #nim |
21:14:06 | * | k0mpjut0r joined #nim |
21:14:06 | * | koltrast joined #nim |
21:14:06 | * | LyndsySimon joined #nim |
21:14:06 | * | greyrat_ joined #nim |
21:14:06 | * | Schnouki joined #nim |
21:14:06 | * | dv2 joined #nim |
21:14:06 | * | redj joined #nim |
21:14:32 | * | rp1 joined #nim |
21:14:32 | * | GreaseMonkey joined #nim |
21:14:32 | * | oprypin joined #nim |
21:14:32 | * | notchris joined #nim |
21:14:32 | * | NimEventer joined #nim |
21:14:32 | * | joast joined #nim |
21:14:32 | * | lain joined #nim |
21:14:32 | * | cornfeedhobo joined #nim |
21:14:32 | * | toothlessgear joined #nim |
21:14:32 | * | ormiret joined #nim |
21:14:32 | * | lucerne joined #nim |
21:14:32 | * | rb joined #nim |
21:14:49 | * | l1x joined #nim |
21:14:49 | * | Yardanico_ joined #nim |
21:14:49 | * | robertmeta joined #nim |
21:15:01 | * | dom96 joined #nim |
21:15:01 | * | adium joined #nim |
21:15:02 | * | oz joined #nim |
21:15:02 | * | nixfreaknim[m] quit (Ping timeout: 240 seconds) |
21:15:08 | * | happycorsair[m] quit (Ping timeout: 252 seconds) |
21:15:17 | * | cheer[m] joined #nim |
21:15:17 | * | ecs joined #nim |
21:15:17 | * | xet7 joined #nim |
21:15:17 | * | tk joined #nim |
21:15:17 | * | szahid joined #nim |
21:15:17 | * | nisstyre joined #nim |
21:15:18 | * | cheer[m] quit (Ping timeout: 245 seconds) |
21:15:29 | FromDiscord | <Josef> In reply to @PMunch "<@385801366779723786>, created an issue": Ah, thank you - I didn't realize you meant a language error I thought maybe there was something wrong with the wrapper |
21:15:57 | PMunch | Nah, that should work. I mean you don't have to deepCopy, but it seems like an issue that it doesn't work |
21:16:18 | PMunch | For your case you can just assign it to a new variable and that makes a copy |
21:18:54 | * | xiamx quit (Ping timeout: 260 seconds) |
21:18:59 | FromDiscord | <Josef> My vectors are a few object ref's away from where I need to do the copy though (ie I have a Object, which has a Renderable field, which has a path field, which is a sequence of vectors). Is the solution for me to write a copy method for every object that has vectors or other imported structs in it somewhere? |
21:22:32 | * | noeontheend joined #nim |
21:23:56 | PMunch | Hmm, that makes it a bit trickier |
21:24:22 | PMunch | Do you absolutely need to deepCopy it? |
21:27:40 | FromDiscord | <Josef> Yeah, or do if by copying all the fields over individually |
21:32:55 | * | nixfreaknim[m] joined #nim |
21:33:25 | * | noeontheend quit (Ping timeout: 250 seconds) |
21:33:37 | * | jmdaemon quit (Ping timeout: 256 seconds) |
21:39:36 | * | xiamx joined #nim |
21:48:44 | FromDiscord | <Elegantbeef> Does nigui have any API for dragging, looked into it and seems no, but might've missed it? |
21:49:02 | FromDiscord | <michaelb> sent a code paste, see https://play.nim-lang.org/#ix=3Otq |
21:49:53 | FromDiscord | <Elegantbeef> `bars: ptr UncheckedArray[Bar]` |
21:50:31 | FromDiscord | <Elegantbeef> `Foo(bars: bars.addr` |
21:50:39 | FromDiscord | <Elegantbeef> Also what's with the lowercase type names 😀 |
21:50:55 | FromDiscord | <michaelb> thanks |
21:52:09 | * | jmdaemon joined #nim |
21:53:23 | FromDiscord | <michaelb> In reply to @Elegantbeef "Also what's with the": in the module directly wrapping the C stuff, I tend to use names that are an exact match for what's being wrapped↵↵in the module/s providing a nicer (or "higher level", or however you want to describe it) I follow the usual conventions and Status Nim style guid |
21:53:28 | FromDiscord | <michaelb> (edit) "guid" => "guide" |
21:53:51 | FromDiscord | <michaelb> (edit) "In reply to @Elegantbeef "Also what's with the": in the module directly wrapping the C stuff, I tend to use names that are an exact match for what's being wrapped↵↵in the module/s providing a nicer (or "higher level", or however you want to describe it) ... I" added "Nim API" |
21:54:01 | FromDiscord | <michaelb> (edit) "API" => "API," |
22:01:00 | * | jjido joined #nim |
22:11:55 | FromDiscord | <michaelb> sent a code paste, see https://play.nim-lang.org/#ix=3Otx |
22:11:58 | * | PMunch quit (Quit: leaving) |
22:12:33 | FromDiscord | <Elegantbeef> Make a proc or template |
22:24:17 | FromDiscord | <Phil> Beef, question, if you wanted to store procs with completely different signatures in a seq, would it be possible to store their pointers as a `seq[pointer]` ? |
22:24:37 | FromDiscord | <Phil> And then somehow dereference those pointers to get the actual proc back? |
22:25:11 | FromDiscord | <Phil> I'm asking to see whether I'm understanding the idea behind an implementation of an event system |
22:25:25 | * | jmdaemon quit (Ping timeout: 256 seconds) |
22:26:22 | FromDiscord | <Elegantbeef> You could but it makes more sense to use an object variant so there is no guessing |
22:27:02 | FromDiscord | <Phil> an object variant? |
22:27:16 | FromDiscord | <Phil> Employing google fu |
22:27:20 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-object-variants |
22:28:10 | FromDiscord | <Phil> That would be in case I know all variations of procs ahead of time |
22:28:15 | FromDiscord | <Phil> Which strictly speaking I do |
22:28:43 | FromDiscord | <Elegantbeef> Well you cannot call a procedure you dont know 😛 |
22:28:48 | FromDiscord | <Phil> But it would also be a massive PITA |
22:29:18 | FromDiscord | <Elegantbeef> You could also do `proc(data: string)` which calls the internal procedure |
22:29:20 | * | jmdaemon joined #nim |
22:29:22 | FromDiscord | <Elegantbeef> It's what I do for an RPC |
22:30:00 | FromDiscord | <Phil> With converting data back to the type you'd actually want and going from there? Hmmm |
22:30:12 | * | cheer[m] joined #nim |
22:30:47 | FromDiscord | <Elegantbeef> Yes using a macro to emit the inbetween |
22:31:06 | FromDiscord | <Elegantbeef> Nim being static meaning arbitrary stuff isnt fun |
22:31:29 | FromDiscord | <Phil> Wouldn't JsonNode be the somewhat perfect type for this given that converting to and from it is literally built into stdlib? |
22:31:45 | FromDiscord | <Phil> Or am I overlooking a caveat somewhere? |
22:31:51 | FromDiscord | <Elegantbeef> It's slow and not binary |
22:32:00 | FromDiscord | <Phil> The worst caveat |
22:32:16 | FromDiscord | <Waldecir Santos> How can a singleton be implemented in nim in a thread safe mannar ? |
22:32:20 | FromDiscord | <Waldecir Santos> (edit) "mannar" => "maner" |
22:32:34 | FromDiscord | <Elegantbeef> global variables with properties that use locks |
22:34:13 | FromDiscord | <Waldecir Santos> Like sharedtables ? |
22:34:35 | FromDiscord | <Elegantbeef> I dont think anyone suggests those they're pretty deprecated iirc |
22:34:54 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/N5B |
22:35:04 | FromDiscord | <Elegantbeef> Indeed |
22:35:12 | FromDiscord | <Elegantbeef> I mean you can do `typeOf(globalMyType)()` |
22:35:20 | FromDiscord | <Elegantbeef> But yea generally speaking you cannot |
22:36:56 | FromDiscord | <Elegantbeef> Pmunch you still about? |
22:37:50 | FromDiscord | <Elegantbeef> Just wanted to show him my level editor since he thought i was crazy at first! |
22:42:29 | * | happycorsair[m] joined #nim |
22:46:48 | FromDiscord | <Phil> sent a long message, see http://ix.io/3OtG |
22:46:50 | FromDiscord | <Phil> But also the most amount of code maintenance |
22:47:01 | FromDiscord | <Phil> Hmmmm |
22:47:17 | FromDiscord | <Phil> Any other pros/cons you see between those two? |
22:47:40 | FromDiscord | <Elegantbeef> You can always use macros to do everything automated so not really |
22:50:34 | FromDiscord | <Phil> I wish I could just have a macro that automatically scanned my entire project and gave me an enum that always have an enumType for all types that inherit from `Model` |
22:51:03 | FromDiscord | <Waldecir Santos> AST magic |
22:51:05 | FromDiscord | <Phil> (edit) "always have" => "has" | "all types" => "every type" | "inherit" => "inherits" |
22:51:17 | FromDiscord | <Phil> That's AST magic so deep I think it might be unmaintainable |
22:51:23 | FromDiscord | <Elegantbeef> Wait until you learn you can do it somewhat↵(@Phil) |
22:51:24 | FromDiscord | <Elegantbeef> 😛 |
22:51:30 | FromDiscord | <Phil> If it's even possible without |
22:51:34 | FromDiscord | <Phil> squints |
22:51:45 | FromDiscord | <Phil> Is this some sort of usecase for nimscript or sth? |
22:51:50 | FromDiscord | <Elegantbeef> You'd need manually subscribe it but yea it'd be possible to do stuff with |
22:52:01 | FromDiscord | <Elegantbeef> Nope |
22:52:20 | FromDiscord | <Elegantbeef> I only condone using nimscript for when you want a scriptable environment |
22:52:43 | FromDiscord | <Phil> I'm not even sure what exactly nimscript is, I'll be honest |
22:52:50 | FromDiscord | <Phil> It was a scripting language to manipulate code I think? |
22:53:00 | FromDiscord | <Elegantbeef> It's a subset of Nim |
22:53:07 | FromDiscord | <Elegantbeef> An interpreted scripting language |
22:53:23 | FromDiscord | <Elegantbeef> Mainly used for static evaluation and macros |
22:55:24 | FromDiscord | <Phil> I think I'll, for the sake of maintainability unless there's a package for it, do my "ModelEnum" by hand and maintain it by hand. Not that I think it'll actually change |
22:59:11 | FromDiscord | <keks> Is there a way in NIM to iterate over an array at compile time - something like a static for loop in D? This should be possible because the length of an array is known at compile time. |
22:59:44 | FromDiscord | <Elegantbeef> Do you mean loop unrolling or running a static expression? |
23:00:47 | FromDiscord | <Elegantbeef> Also it's "Nim" 😛 |
23:04:16 | FromDiscord | <keks> In reply to @Elegantbeef "Do you mean loop": Yes, loop unrolling at compile time. I'm still trying to do this automatic conversion of various array expressions at compile time |
23:04:57 | FromDiscord | <keks> sent a code paste, see https://play.nim-lang.org/#ix=3OtR |
23:05:48 | FromDiscord | <keks> I'm trying to convert float64 arrays to float32 arrays. I could do it for array literals, but this won't generalise to general variables of type array[N, float64]. |
23:06:12 | FromDiscord | <keks> And I'm too lazy to implement the entire for loop as a macro. |
23:06:59 | FromDiscord | <Elegantbeef> you can use `static` if you want to run code at compile time, other wise you'll need a macro to unroll the loop |
23:07:55 | * | jmdaemon quit (Ping timeout: 256 seconds) |
23:09:29 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3OtS |
23:09:57 | * | anddam quit (Quit: WeeChat 3.4) |
23:10:47 | FromDiscord | <Elegantbeef> If you want it unrolled for runtime it can also be done with a macro of course |
23:13:45 | FromDiscord | <keks> that works, but this is with the use of const. I want a generic solution that can work both on array literals of type float64 as well as any variable of type array[N, float64] |
23:13:53 | * | anddam joined #nim |
23:14:17 | FromDiscord | <Elegantbeef> I'm writing as fast as i can! |
23:18:34 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3OtX |
23:18:43 | FromDiscord | <Elegantbeef> There you go loop unrolled float64 -\> float32 |
23:18:55 | FromDiscord | <Phil> ... a casual 29 models, all of which need to go into the enum, all of which I need to consider for the object variant |
23:19:00 | FromDiscord | <Phil> God, life is pain and a typi mess |
23:19:21 | FromDiscord | <Elegantbeef> What are these procedures like? |
23:19:31 | FromDiscord | <Elegantbeef> Are they all the same but different first parameter? |
23:19:38 | FromDiscord | <Elegantbeef> If so, use dynamic dispatch you drongo |
23:20:01 | FromDiscord | <Phil> Essentially it's all proc[T: Model](connection: DbConn, modelInstance: T) |
23:20:19 | FromDiscord | <Phil> If I could store generics anyway |
23:20:36 | FromDiscord | <Elegantbeef> So basically you're saying `method doThing(myInstance: Model, conn: DbConn)` |
23:20:41 | FromDiscord | <Phil> There are some bits and bobs that differ for some of the 29 |
23:20:45 | FromDiscord | <Phil> But the general proc signature is the above |
23:21:04 | FromDiscord | <Elegantbeef> Use dynamic dispatch and solve your problem simpler |
23:21:22 | FromDiscord | <keks> In reply to @Elegantbeef "I'm writing as fast": woow, I need time to process this.. Thanks a lot! |
23:21:51 | FromDiscord | <Phil> I think I've been through so many different solution iterations I actually need to get my head out of the entire event system thinky and try to think on how I could apply dynamic dispatch to it |
23:22:16 | FromDiscord | <Phil> Which... okay no idea, I've really not used and thus not thought in dynamically dispatched functions in nim yet |
23:22:27 | FromDiscord | <Phil> I've seen them used in norm though |
23:22:34 | FromDiscord | <Elegantbeef> They work like normal OOP functions |
23:22:42 | FromDiscord | <Elegantbeef> You define a base then override it for all your inheriting children |
23:23:26 | FromDiscord | <Phil> Is that also possible when I don't own the code that defines the Model type? |
23:24:11 | FromDiscord | <Phil> What am I talking about, I can just define that... I think `func` was the keyword? Where I need it |
23:24:35 | FromDiscord | <Elegantbeef> I think so |
23:24:56 | FromDiscord | <Elegantbeef> As long as the type is in the scope and you define a base method that the other methods can see and the call site can see |
23:25:27 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3OtZ |
23:25:28 | FromDiscord | <Elegantbeef> `method` is the keyword |
23:25:28 | FromDiscord | <Elegantbeef> `func` is a pure function like in FP |
23:25:34 | FromDiscord | <Phil> Ah, check |
23:30:10 | FromDiscord | <Phil> Then I can just do a `type TableModel = <List of 29 models separated with '|'>` and use that as parameter in my `sendSignal(signal: SignalType, modelInstance: TableModel)` proc. |
23:30:48 | FromDiscord | <Elegantbeef> Why would you need to make a typedesc |
23:31:00 | FromDiscord | <Elegantbeef> `[T: Model]` is composite typeclass that is all inheriting children |
23:31:49 | FromDiscord | <Phil> Still too mentally trapped in previous approaches I think and its late |
23:33:04 | FromDiscord | <Phil> I'll go to sleep I think and look at this with fresh eyes |
23:33:19 | FromDiscord | <Phil> And see whether that way I can implement an event system and at the same time get rid of a circular dependency I'm running into |
23:33:47 | FromDiscord | <Phil> Well, less event system |
23:33:55 | FromDiscord | <Phil> More something that works akin to Django's Signal system |
23:34:10 | * | jmdaemon joined #nim |
23:34:44 | FromDiscord | <Phil> Oh wait, no I don't think that approach works, I have to store seq[proc]! |
23:34:58 | FromDiscord | <Phil> Because one event can have trigger multiple follow up actions |
23:35:31 | FromDiscord | <Phil> Like deleting an image can trigger as a follow up action that its contents from the search table are removed as well as deleting the actual image file |
23:36:19 | FromDiscord | <Phil> Boah screw my brain, tomorrow is also time |
23:36:54 | FromDiscord | <Phil> (edit) removed "have" |