00:00:14 | FromDiscord | <demotomohiro> If they have different number of parameters or different type of parameters, it just works. |
00:01:45 | FromDiscord | <demotomohiro> If they still have same parameters, you can add module name to disambiguate call like `moduleA.getDb()` or `moduleB.getDb()`. |
00:03:59 | FromDiscord | <krab4t> like in Go (always module, well package, name) |
00:04:00 | FromDiscord | <demotomohiro> Nim has overloading procs but go doesn't have? |
00:04:48 | FromDiscord | <krab4t> no |
00:05:26 | FromDiscord | <krab4t> well with different number of parameters |
00:05:51 | FromDiscord | <krab4t> you have to name them differently iirc |
00:06:55 | FromDiscord | <demotomohiro> I didn't know that.↵In Nim, one module can have many overloaded procedures with same name. |
00:07:24 | FromDiscord | <krab4t> well only if you write func for Generic |
00:08:27 | FromDiscord | <krab4t> even then its one func with `funcName` |
00:10:48 | FromDiscord | <graveflo> are you asking if procs will overload on different signatures in different modules or are you asking if you can fully qualify a proc name to use a specific version defined in a specific module? |
00:11:11 | FromDiscord | <krab4t> so i want to split dbWorker.nim file from main.nim |
00:11:36 | FromDiscord | <krab4t> im asking if i can split files and access procs with `module.procName` |
00:11:58 | FromDiscord | <graveflo> I believe so. Its easy to test that though |
00:13:24 | FromDiscord | <graveflo> well I know you can bc I've done it there is just no reason to do that unless there is a binding issue like shadowing or using templates |
00:14:32 | FromDiscord | <krab4t> so you say nim its just plain bash |
00:14:43 | FromDiscord | <graveflo> ? |
00:15:16 | FromDiscord | <krab4t> i don't want access everything from any place |
00:15:38 | FromDiscord | <voidwalker> I tried to insert a binary file in sqlite, using allographer, and stumbled upon this: https://github.com/nim-lang/db_connector/issues/12 |
00:15:40 | FromDiscord | <graveflo> okay I see what yo are saying. You want something like named scopes for organizational purposes |
00:16:01 | FromDiscord | <graveflo> kind of like classes LOL |
00:16:09 | FromDiscord | <krab4t> vs code extension says everything here is fine https://i.imgur.com/5hydNkt.png but its not |
00:16:39 | FromDiscord | <graveflo> `when(isMainModule)` |
00:16:42 | FromDiscord | <krab4t> yeah like scuffed packages in go which more like namespaces than classes |
00:16:54 | FromDiscord | <graveflo> yea you just use files for that in nim |
00:16:57 | FromDiscord | <krab4t> no `dbConn` its not imported |
00:17:00 | FromDiscord | <huantian> nim is not built with named scopes for modules as it's main priority, because of its UFC syntax |
00:17:12 | FromDiscord | <huantian> you usually import everything into the global scope |
00:17:26 | FromDiscord | <krab4t> `norm` imported in `dbModel` |
00:17:38 | FromDiscord | <krab4t> into global mess! |
00:17:41 | FromDiscord | <krab4t> like bash |
00:18:51 | FromDiscord | <huantian> there's measure in place to stop you if there's any name collisions, which happen rarely in the first place because of proc overloading |
00:19:23 | FromDiscord | <graveflo> I'm all for the hierarchical organizations. Maybe someone has made a library that will allow you to make new scopes. You can always just use the file system itself for this though. files in folders can be your hierarchical structure |
00:19:37 | FromDiscord | <graveflo> (edit) "new" => "named" |
00:20:14 | FromDiscord | <huantian> I'm not sure if that's relevant though, in this case we're simply talking about module importing |
00:20:26 | FromDiscord | <voidwalker> in 6 years the sqlite blob issue not fixed ? :\ |
00:20:56 | FromDiscord | <graveflo> In reply to @huantian "I'm not sure if": module importing is the same as scope management. They have explicitly said they are looking to make scope hierarchies |
00:22:41 | FromDiscord | <huantian> Right but you’re talking about scope hierarchies in general in your example |
00:22:52 | FromDiscord | <huantian> Whereas modules are a specific instance ig |
00:23:17 | FromDiscord | <graveflo> is there an alternative? |
00:23:25 | FromDiscord | <huantian> Ie you wouldn’t use modules to do what you said |
00:23:34 | FromDiscord | <huantian> Wait nvm |
00:23:38 | FromDiscord | <huantian> I misread your message |
00:23:41 | FromDiscord | <huantian> Disregard |
00:25:53 | FromDiscord | <huantian> In reply to @krab4t "like bash": but going back to this, nim does this because it isn't bash, it's a compiled and statically typed language |
00:27:26 | FromDiscord | <huantian> https://narimiran.github.io/2019/07/01/nim-import.html |
00:27:46 | FromDiscord | <graveflo> I think they didn't post enough info to properly help them use qualified names to reference things LOL they might be long gone |
00:30:16 | FromDiscord | <krab4t> https://pastebin.com/SnpFvTB6 can i do stuff like that around `db()` and `var dbc` in nim? |
00:31:55 | FromDiscord | <huantian> That looks fine but I’m not sure about norm syntax |
00:31:58 | FromDiscord | <huantian> Does it compile? |
00:32:14 | FromDiscord | <graveflo> is `createTables` public? |
00:32:22 | FromDiscord | <huantian> (edit) "syntax" => "syntax, and I also just glanced at it" |
00:32:34 | FromDiscord | <huantian> I’d assume that’s a norm function? |
00:34:11 | FromDiscord | <krab4t> it compiles main.nim its just `import dbModel` and `dbModel.createTables()` |
00:34:56 | FromDiscord | <krab4t> but i can drop `dbModel` before `createTables()` and i hate it that way ... |
00:35:28 | FromDiscord | <huantian> In reply to @huantian "https://narimiran.github.io/2019/07/01/nim-import.h": Read this article, it can explain why that’s the case better than I can |
00:46:34 | FromDiscord | <krab4t> in that `complex.complex` section go would have something like `complex.NewComplex` and `complex.NewComplex64` etc |
00:46:50 | FromDiscord | <krab4t> which is not ugly at all. |
00:50:37 | FromDiscord | <JJ> i think it's ugly: you have types, why not use them? |
00:52:49 | FromDiscord | <JJ> neither the compiler nor the programmer need the `complex` prefix |
00:55:17 | FromDiscord | <JJ> note also that if you're writing code and you forgot which namespace a function comes from, the language server will tell you if you hover over it |
00:57:01 | FromDiscord | <krab4t> but they not types but constructors from package complex 😄 |
00:58:32 | FromDiscord | <krab4t> well go actually has type `complex` its just an example |
00:59:20 | FromDiscord | <JJ> hmm i'm not sure what you mean |
00:59:41 | FromDiscord | <JJ> the types of the parameter in constructors/functions tell you unambiguously which one is which |
01:04:27 | FromDiscord | <krab4t> so here https://github.com/ba0f3/telebot.nim/blob/master/src/telebot.nim#L11 what is `result` inside? |
01:04:35 | FromDiscord | <krab4t> inside new() |
01:17:43 | FromDiscord | <huantian> It’s a `TeleBot` |
01:18:15 | FromDiscord | <huantian> It’s the return type of the proc |
01:21:32 | * | krux02_ quit (Remote host closed the connection) |
01:23:47 | * | beholders_eye joined #nim |
01:52:13 | * | beholders_eye quit (Remote host closed the connection) |
02:28:24 | FromDiscord | <krab4t> how to handle exception but do nothing? just except NotFoundError: discard? |
02:29:31 | FromDiscord | <huantian> Mhm |
02:48:25 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4xSy |
03:12:06 | FromDiscord | <kcvinker> sent a code paste, see https://play.nim-lang.org/#ix=4xSA |
03:13:27 | * | Batzy quit (Read error: Connection reset by peer) |
03:16:34 | * | Batzy joined #nim |
03:21:39 | * | rockcavera quit (Read error: Connection reset by peer) |
03:22:00 | * | rockcavera joined #nim |
03:22:00 | * | rockcavera quit (Changing host) |
03:22:00 | * | rockcavera joined #nim |
03:23:18 | * | oldpcuser quit (Remote host closed the connection) |
03:23:38 | * | oldpcuser joined #nim |
03:38:51 | FromDiscord | <Elegantbeef> Echo making it work sounds like some sort of race condition does `sleep(1)` work in it's place? |
03:45:37 | FromDiscord | <arathanis> that is an excellent point, beef |
04:03:26 | FromDiscord | <kcvinker> Oh I see. Since this code is working from a dll, it's a separate thread. Caller is in another thread. |
04:48:25 | * | oldpcuser quit (Quit: Windows was compiled with GCC) |
04:51:27 | * | oldpcuser joined #nim |
05:05:14 | * | qwestion quit (Ping timeout: 268 seconds) |
05:07:12 | FromDiscord | <xTrayambak> In reply to @voidwalker "yeah same old story": Hello! I'm the author and main developer of ferus and ferushtml. Currently all my efforts are going into making ferushtml implement more basic HTML. Another thing I'm doing is deprecating the FSM parser in favour of a consume-char parser. I mostly had some schoolwork to clear out which is why both the projects were a bit inactive. |
05:11:21 | * | oldpcuser is now known as oldpcuser_afk |
05:18:44 | * | oldpcuser_afk is now known as oldpcuser |
05:27:22 | * | rockcavera quit (Remote host closed the connection) |
06:06:09 | * | def- quit (Quit: -) |
06:18:46 | FromDiscord | <krab4t> how easy its to unmarshal json/xml into struct in nim? in go you simply annotate struct fields with json keys and then `xml.NewDecoder` or just `xml.Unmarshal` |
06:21:15 | FromDiscord | <graveflo> https://github.com/treeform/jsony↵https://nim-lang.org/docs/json.html↵https://nim-lang.org/docs/parsexml.html↵I'm not sure about automatically unmarshalling xml but these are where I would start |
06:21:33 | FromDiscord | <graveflo> there is also a marshal lib in nim std |
06:25:46 | * | def- joined #nim |
06:30:19 | FromDiscord | <krab4t> hmm should i go back to `go` then ... |
06:48:41 | * | def- quit (Quit: -) |
06:49:13 | * | def- joined #nim |
07:02:36 | FromDiscord | <graveflo> sounds like you got go on the mind my friend but will go take you back? |
07:22:10 | FromDiscord | <odexine> up to you |
07:23:37 | FromDiscord | <krab4t> No, i hate go because of insane amount of `if err != nil` on left and right, 100 times per file. But goland is very fast ide and it has proper debugging. |
07:25:28 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
07:25:39 | * | xet7 joined #nim |
07:26:10 | FromDiscord | <krab4t> And also slices in go worlds first worst builtin type you can ever discover in a language. |
07:26:48 | * | antranigv joined #nim |
07:27:02 | FromDiscord | <odexine> slices are good but theyre strange in go iirc |
07:27:18 | FromDiscord | <odexine> nim is slowly developing support for slices |
07:28:45 | * | krux02 quit (Remote host closed the connection) |
07:29:36 | FromDiscord | <krab4t> look at this https://stackoverflow.com/questions/37334119/how-to-delete-an-element-from-a-slice-in-golang all answers with `[index+1:]...)` in it are wrong it will panic if element is last. |
07:30:39 | FromDiscord | <krab4t> Still nobody cares, 100 google results with same copy pasta. |
07:39:10 | FromDiscord | <xTrayambak> In reply to @odexine "slices are good but": the character slices are absolute carpal tunnel prevention machines |
07:39:41 | * | xet7 quit (Quit: Leaving) |
07:39:59 | FromDiscord | <xTrayambak> In reply to @voidwalker ""wild" ones : D": std/xmlparser is pretty good for that, I'll probably use it for implementing XML in ferushtml |
07:43:23 | FromDiscord | <krab4t> And google already copied slices functions from experimental package into main source tree, these just panic on out of bounds access not exceptions no errors |
07:43:37 | FromDiscord | <krab4t> For 1.21 release |
07:48:12 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
07:48:29 | FromDiscord | <xTrayambak> By the way, are exceptions the only way to "gracefully" crash a program? Are there any equivalent to Rust's `panic!` macro? |
07:48:37 | FromDiscord | <xTrayambak> (edit) "equivalent" => "equivalents" |
07:54:28 | * | antranigv joined #nim |
07:56:47 | FromDiscord | <mratsim> In reply to @xTrayambak "By the way, are": `--panics:on`↵`quit 1` |
07:56:54 | FromDiscord | <krab4t> Unmarshaling /marshaling xml/json/yaml in nim should be as easy as in go via pragmas. (Annotations in go). |
07:57:26 | FromDiscord | <mratsim> `quit "Oh I'm f********` |
07:57:32 | FromDiscord | <mratsim> (edit) "f********`" => "f********"`" |
08:03:23 | * | xet7 joined #nim |
08:09:07 | * | xet7 quit (Remote host closed the connection) |
08:16:13 | FromDiscord | <odexine> In reply to @krab4t "Unmarshaling /marshaling xml/json/yaml in": whats wrong with jsony? |
08:18:23 | * | xet7 joined #nim |
08:28:53 | FromDiscord | <krab4t> In reply to @odexine "whats wrong with jsony?": It doesnt support xml? |
08:33:21 | * | xet7 quit (Remote host closed the connection) |
08:34:54 | * | derpydoo quit (Ping timeout: 268 seconds) |
08:47:13 | * | junaid_ joined #nim |
08:52:04 | FromDiscord | <Zoom> nimyaml worked for me, providing both yaml and json.↵(@krab4t) |
09:06:28 | * | azimut joined #nim |
09:07:53 | FromDiscord | <voidwalker> this is not merged, right ? https://github.com/nim-lang/Nim/commit/6fa82a5b3afbe644eef3fb41647a341d8e9b21c4 |
09:30:41 | * | junaid_ quit (Remote host closed the connection) |
09:31:38 | * | blackbeard420 quit (Ping timeout: 268 seconds) |
09:32:22 | * | blackbeard420 joined #nim |
09:38:05 | FromDiscord | <filipemtx> Has anyone here experienced trouble with the virus wacatac.h!ml?↵It's the second time I compile a nim script and windows defender finds that trojan on the executable |
09:38:43 | FromDiscord | <filipemtx> I'm thinking twice before distributing a nim application... =\ |
09:42:02 | FromDiscord | <filipemtx> https://forum.nim-lang.org/t/7885 |
09:42:08 | FromDiscord | <filipemtx> I found this link |
09:51:18 | * | xet7 joined #nim |
09:56:23 | FromDiscord | <graveflo> Yes this has been an ongoing issue |
10:09:48 | * | derpydoo joined #nim |
10:55:04 | NimEventer | New thread by alexeypetrushin: Cast to subtype without knowing it?, see https://forum.nim-lang.org/t/10264 |
11:57:10 | * | disso-peach joined #nim |
12:11:17 | FromDiscord | <heysokam> how do you add an escape character to a string? im getting escaped escapes if I add more than one, and it doesn't seem to want to stick to being an actual `\` |
12:12:44 | FromDiscord | <heysokam> usecase is to parse the output of some bash commands, that end lines with `\` but the text in the next is meant to also be part of the previous line |
12:12:55 | FromDiscord | <demotomohiro> !eval echo "\\" |
12:13:15 | FromDiscord | <heysokam> that escapes the second " |
12:13:55 | NimBot | Compile failed: <no output> |
12:14:04 | FromDiscord | <demotomohiro> "\\" become single backslash |
12:14:29 | FromDiscord | <heysokam> that's the first thing i tried. but compiler says no |
12:14:30 | FromDiscord | <demotomohiro> '\\\\" |
12:15:09 | FromDiscord | <demotomohiro> Discord removes backslash 😦 |
12:15:38 | FromDiscord | <heysokam> not ifyou get them in `\` |
12:16:05 | FromDiscord | <heysokam> so \`\ `\ |
12:16:22 | FromDiscord | <heysokam> (edit) "`\" => "`" |
12:16:51 | FromDiscord | <demotomohiro> Putting 2 backslashes in "" or '' should work. |
12:19:42 | FromDiscord | <heysokam> `"\\"` worked, don't know why it was failing before. i guess i didn't try it correctly |
12:19:59 | FromDiscord | <heysokam> it doesn't match the text.... but it worked |
13:13:55 | FromDiscord | <exxjob> hi, for cpp bindings should i use git submodule? how is it packaged into nimble |
13:34:28 | * | derpydoo quit (Ping timeout: 265 seconds) |
13:41:27 | NimEventer | New question by IvanS: How to make this pipe communication non-blocking?, see https://stackoverflow.com/questions/76446472/how-to-make-this-pipe-communication-non-blocking |
13:42:08 | * | ntat joined #nim |
14:02:34 | * | derpydoo joined #nim |
14:54:31 | FromDiscord | <demotomohiro> This supports non-blocking pipe but that question uses Windows API directly.↵https://github.com/cheatfate/asynctools |
15:22:55 | FromDiscord | <Zoom> Any ideas? |
15:48:47 | * | oldpcuser quit (Remote host closed the connection) |
15:49:16 | * | oldpcuser joined #nim |
16:08:58 | FromDiscord | <System64 ~ Flandre Scarlet> Is there some things I can do to improve performances such as flags I can enable? |
16:12:49 | FromDiscord | <odexine> other than release and lto? |
16:14:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "other than release and": lto? |
16:14:30 | FromDiscord | <odexine> i dont remember the flags for LTO |
16:14:33 | FromDiscord | <demotomohiro> lto = Link time optimization |
16:14:44 | FromDiscord | <odexine> tomohiro does your site have it |
16:14:52 | FromDiscord | <demotomohiro> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#optimization-which-compiler-option-generate-smallest-executableqmark |
16:14:53 | FromDiscord | <System64 ~ Flandre Scarlet> How can I enable this? |
16:15:36 | FromDiscord | <demotomohiro> `--passC:-flto --passL:-flto` enables it |
16:15:51 | FromDiscord | <demotomohiro> If you use gcc as backend compiler |
16:15:58 | FromDiscord | <odexine> lto can improve speed of binary but not always |
16:16:11 | FromDiscord | <odexine> as usual it depends on a lot of things |
16:16:21 | FromDiscord | <odexine> just experiment with it, see if it helps |
16:17:11 | FromDiscord | <System64 ~ Flandre Scarlet> and --opt:speed? |
16:18:56 | FromDiscord | <odexine> already by default when you -d:release |
16:19:24 | FromDiscord | <System64 ~ Flandre Scarlet> oh alright |
16:19:47 | FromDiscord | <odexine> i have to wake up in 6 hours, good night |
16:19:58 | FromDiscord | <demotomohiro> good night |
16:20:08 | FromDiscord | <System64 ~ Flandre Scarlet> Good night! |
16:20:09 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4xUQ |
16:21:08 | FromDiscord | <demotomohiro> it seems good. |
16:21:40 | FromDiscord | <System64 ~ Flandre Scarlet> And I can disable runtime checks too? |
16:22:32 | FromDiscord | <demotomohiro> `-d:danger` disables runtime checks. |
16:23:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @demotomohiro "`-d:danger` disables runtime checks.": It disables GC too? |
16:23:18 | FromDiscord | <demotomohiro> No |
16:23:45 | FromDiscord | <System64 ~ Flandre Scarlet> Nice |
16:44:55 | * | derpydoo quit (Read error: Connection reset by peer) |
16:59:50 | FromDiscord | <voidwalker> is it possible to read the memory of another process, running under the same user, in windows, without admin priviliges ? Would that trigger windows defender (if it gets past it in the first place because of simply being a nim program that is) ? |
17:29:48 | * | cm quit (Ping timeout: 240 seconds) |
17:29:54 | * | ntat quit (Quit: Leaving) |
17:30:52 | * | cm joined #nim |
17:33:03 | Amun-Ra | have you tried ReadProcessMemory? |
17:49:48 | * | derpydoo joined #nim |
17:56:32 | FromDiscord | <voidwalker> no I didn't try anyhting, I just thought to ask if it's possible in the first place, without explicitly giving admin access to the process |
17:56:54 | FromDiscord | <graveflo> yes |
17:57:55 | FromDiscord | <graveflo> there are some boundaries that are protected but you can read and write other processes memory. I haven't tried in a long time but you used to be able to use "createremotethreadex" to run code in another process without any privs either |
17:59:26 | FromDiscord | <voidwalker> https://github.com/byt3bl33d3r/OffensiveNim/blob/master/src/fork_dump_bin.nim |
18:00:25 | FromDiscord | <krisp0> sent a code paste, see https://play.nim-lang.org/#ix=4xVi |
18:00:52 | FromDiscord | <krisp0> though its a bit of a bad example since we know the key already but what if we dont know and say if the table is large |
18:01:01 | FromDiscord | <krisp0> (edit) "though its a bit of a bad example since we know the key already but what if we dont know and say if the table is large ... " added "like 200 messages" |
18:01:23 | FromDiscord | <graveflo> its not going to be optimized unless you make a two way table |
18:10:07 | FromDiscord | <krisp0> In reply to @graveflo "its not going to": what would the code be using that then? |
18:11:32 | FromDiscord | <graveflo> There are several ways to make a two way table structure, but most simply you would just make two tables. When you add or remove an element make sure you keep the second table up to date |
18:12:06 | FromDiscord | <krisp0> oh just the reverse table basically |
18:12:43 | FromDiscord | <graveflo> yea if one table is `key->value` just make another one that is `value->key` and keep then in sync |
18:12:53 | FromDiscord | <huantian> and make sure both tables are one to one |
18:13:25 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4xVl |
18:16:26 | FromDiscord | <that_dude.> Pretty sure that datastruct already exists in a nimble package |
18:24:09 | * | junaid_ joined #nim |
18:26:36 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4xVq |
18:48:55 | * | junaid_ quit (Remote host closed the connection) |
19:07:54 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xVx |
19:19:01 | FromDiscord | <guttural666> can I make this untyped block optional as well? otherwise I think I'll have to provide all the defaulted parameters every time and discard the block as well I think: https://media.discordapp.net/attachments/371759389889003532/1117171073788682240/image.png https://media.discordapp.net/attachments/371759389889003532/1117171074002596015/image.png |
19:19:35 | FromDiscord | <graveflo> you can just overload it with templates |
19:22:32 | FromDiscord | <guttural666> hmm, not sure if I get it, do you mean just copying the whole template and providing two apis? would maybe want to avoid maintaining two almost identical versions (except the additional block) |
19:23:22 | FromDiscord | <guttural666> or nested templates and pull out the common part? |
19:23:45 | FromDiscord | <graveflo> you can either split the functionality into two versions that have the untyped block and dont or keep it all in one place. The overloads have different parameters and one calls the other |
19:24:57 | FromDiscord | <guttural666> ah, think I get it, will try something |
19:24:57 | FromDiscord | <guttural666> thanks |
19:37:33 | FromDiscord | <guttural666> I think keeping just one beefy template doesn't work because the block has to be in the middle of that template, so it would also have to accept a block |
19:38:04 | FromDiscord | <guttural666> thinking about this as a possible solution: https://media.discordapp.net/attachments/371759389889003532/1117175871502037062/image.png |
19:39:18 | FromDiscord | <guttural666> noop(str: string) actually |
20:18:38 | * | Guest20 joined #nim |
20:18:56 | * | Guest20 quit (Client Quit) |
20:19:15 | * | Guest20 joined #nim |
20:19:50 | * | Guest20 quit (Client Quit) |
20:57:22 | * | oldpcuser quit (Read error: Connection reset by peer) |
20:57:42 | * | oldpcuser joined #nim |
21:03:39 | FromDiscord | <voidwalker> does anyone have a fully working implementation of a ReadProcessMemory proc, that takes a pid int and returns all the memory of the process ? |
21:03:50 | FromDiscord | <krab4t> how you make non blocking task queue probably in another thread that just waits for task object and do only one at the time ... |
21:03:53 | FromDiscord | <krab4t> any libs |
21:12:04 | FromDiscord | <graveflo> In reply to @voidwalker "does anyone have a": I've never tried this but you can try and use a winapi library https://github.com/khchen/winim |
21:12:22 | FromDiscord | <voidwalker> yeah that's what I meant, a higher level proc for that one : ) |
21:12:44 | FromDiscord | <voidwalker> I think I just need to figure out where to get the starting address of the process memory |
21:21:43 | FromDiscord | <voidwalker> https://github.com/treeform/hottie/blob/87ce027ebbe07ae34a7cb9b677e740f38e131624/src/hottie/windows.nim#L52 |
21:21:45 | FromDiscord | <voidwalker> this code was useful |
21:22:05 | FromDiscord | <voidwalker> how do you find the end address though ? |
21:31:29 | FromDiscord | <graveflo> it looks like `VirtualQueryEx` is used for this in a trail an error method |
21:32:31 | FromDiscord | <graveflo> other places seem to use a similar method. The win api can be a pain the butt. If you dont know how to do something you're going to have to read a lot of websites or some code that someone else figured out:↵https://stackoverflow.com/questions/55803328/how-to-identify-what-parts-of-the-allocated-virtual-memory-a-process-is-using |
21:33:28 | FromDiscord | <voidwalker> blah 😦 |
21:33:49 | FromDiscord | <voidwalker> why can't we have a proc readMem(pid: int): string |
21:36:58 | FromDiscord | <graveflo> you basically can you just need to know the bounds of its memory regions. Its not as straight forward as reading a proc file like on linux but thats windows for you |
21:37:20 | FromDiscord | <voidwalker> I know we can, why didn't anyone make it, that's what I meant |
21:37:39 | FromDiscord | <voidwalker> I'm not interested in learning windows api for hacking, just want that piece of memory |
21:38:26 | FromDiscord | <graveflo> well there might be an easier way to get it. I've written small scripts that interact with a processes memory. Usually you just have to know the static address or pointer map to get to where you want |
21:38:37 | FromDiscord | <graveflo> and then its as simple as calling `ReadProcessMemory` |
21:39:10 | FromDiscord | <graveflo> but it depends on what you are trying to do. Reading an entire processes memory might be overkill for your needs |
21:40:23 | FromDiscord | <voidwalker> well I have to read it all to first find where I must look for the interesting bits |
21:41:09 | FromDiscord | <graveflo> try using something like cheat engine. If it fits your use case its easy |
22:26:49 | FromDiscord | <heysokam> how do you get the name of an enum in string representation, when the enum contains a string as its value? 🤔 |
22:28:33 | FromDiscord | <voidwalker> the enum's string value ? |
22:28:58 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xWq |
22:31:36 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4xWs |
22:32:06 | FromDiscord | <heysokam> no, i mean having access to both `"x86"` and `"i386"` in some way |
22:32:35 | FromDiscord | <heysokam> if i use the $enum, it becomes the inner string. but i want both, because the goal is to compare them |
22:32:40 | FromDiscord | <voidwalker> parseEnum[EnumType](theStrVal) gives you the enum value |
22:32:52 | FromDiscord | <heysokam> (edit) "compare them" => "get the name based on the inner string" |
22:34:28 | FromDiscord | <heysokam> maybe im misunderstanding something, let me do some quick test |
22:36:40 | FromDiscord | <graveflo> https://nim-lang.org/docs/enumutils.html#symbolName%2CT |
22:37:32 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4xWu |
22:38:03 | FromDiscord | <graveflo> `symbolName` and `$` should be what you need |
22:38:14 | FromDiscord | <heysokam> yeah symbolName! tyty |
22:38:28 | FromDiscord | <heysokam> didn't know that thing existed |
22:46:43 | FromDiscord | <krab4t> https://github.com/indiscipline/cozytaskpool nim has channels? |
22:59:11 | FromDiscord | <graveflo> I havent done anything w/ concurrency yet but I have heard people talk about hem |
22:59:17 | FromDiscord | <graveflo> (edit) "hem" => "them" |
23:05:53 | FromDiscord | <arathanis> In reply to @graveflo "Anyone know whats going": i've been toying with what is going on here, very weird |
23:06:31 | * | xet7 quit (Ping timeout: 240 seconds) |
23:06:52 | FromDiscord | <voidwalker> is it not possible to have a const array of an object without writing the object type and object fields, like this one here ? https://github.com/arvidn/libtorrent/blob/c2012b084c6654d681720ea0693d87a48bc95b14/src/identify_client.cpp#L148 |
23:07:06 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4xWH |
23:07:07 | FromDiscord | <voidwalker> any shorter syntax possible? |
23:07:11 | FromDiscord | <graveflo> In reply to @arathanis "i've been toying with": yea me too. I've decided to start figuring out how to work with the compiler bc I keep running into issues |
23:09:20 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xWI |
23:09:31 | FromDiscord | <graveflo> In reply to @voidwalker "any shorter syntax possible?": I dont see how it can get any shorter. You dont have to state the type if it is implicit. You dont have to supply values if you dont want. |
23:09:45 | FromDiscord | <voidwalker> well it's a const, I need to supply values |
23:10:06 | FromDiscord | <graveflo> I mean they could be default.. maybe you can have a static function.. im not sure |
23:10:35 | FromDiscord | <voidwalker> yeah I noticed I can skip the type definition, it gets both length and type from the array definition |
23:10:52 | FromDiscord | <arathanis> i need beef to explain these type shenanigans to me, i am confused now |
23:10:53 | FromDiscord | <voidwalker> but other than that, it's a hassle. why can c++ do it an nim not ? "\ |
23:12:26 | FromDiscord | <arathanis> @voidwalker do you mean w/o an initializer? |
23:12:49 | FromDiscord | <voidwalker> I mean without having to specify object type and field names on each element |
23:13:04 | FromDiscord | <graveflo> In reply to @arathanis "probably something weird in": Yea that is really odd too LOL. Nim does not like these parameterized expressions with inheritance. |
23:13:34 | FromDiscord | <arathanis> In reply to @graveflo "Yea that is really": as soon as its used in the generic the inheritance seems to reverse |
23:13:41 | FromDiscord | <arathanis> i was expecting both to be false since the first one was |
23:13:45 | FromDiscord | <arathanis> but the second one is true? |
23:13:48 | FromDiscord | <arathanis> it has to be a bug |
23:14:29 | FromDiscord | <arathanis> In reply to @voidwalker "I mean without having": oh you mean like the c++ `{}` constructor syntax? |
23:14:49 | FromDiscord | <voidwalker> I don't know what it's called, but probably that, the { } syntax I linked |
23:14:50 | FromDiscord | <arathanis> i guess its called initializer syntax |
23:14:56 | FromDiscord | <arathanis> or something like that |
23:15:13 | FromDiscord | <arathanis> you could make a macro that does this 😎 |
23:15:25 | FromDiscord | <arathanis> but no i dont think there is a way for Nim to do it that way, its more explicit. |
23:15:27 | FromDiscord | <voidwalker> I couldn't |
23:15:35 | FromDiscord | <arathanis> ive always hated that form of initializer in C++ |
23:15:49 | FromDiscord | <voidwalker> I haven't written the word macro yet in nim, I barely touched templates : P |
23:15:58 | FromDiscord | <arathanis> looks like character noise gobbledygook |
23:16:11 | FromDiscord | <arathanis> In reply to @voidwalker "I haven't written the": ahh, well it would let you do some facimile of this |
23:19:39 | * | xet7 joined #nim |
23:23:22 | FromDiscord | <Elegantbeef> Inheritance↵(@arathanis) |
23:23:57 | FromDiscord | <voidwalker> well, found the fix, use a tuple instead of an object, and I dont have to do object constructor syntax |
23:24:06 | FromDiscord | <Elegantbeef> Also generics do not abide by converters |
23:26:08 | FromDiscord | <graveflo> sometimes he speaks in riddles |
23:33:34 | FromDiscord | <arathanis> In reply to @Elegantbeef "Inheritance (<@136570191038513152>)": i don't understand how inheritance explains the situation with Bar in that example |
23:33:40 | FromDiscord | <arathanis> am I just not seeing it? |
23:34:28 | FromDiscord | <arathanis> a `ref Child` is a `ref Parent`, but a `Bar[ref Child]` is not a `Bar[ref Parent]` and the reverse is instead true? |
23:36:51 | FromDiscord | <graveflo> I think beef is smart enough to know its not correct. He is just being dismissive. One of the issues is that the type is not `Bar[ref Child]` its `Bar[Bar.T]` which is nonsense. Perhaps related to type resolution in conjunction with "converters" as he mentioned |
23:36:54 | FromDiscord | <odexine> In reply to @voidwalker "well, found the fix,": You lose nominal typing in that case, if it matters for you |
23:38:58 | FromDiscord | <voidwalker> the name fields or what ? I can have named tuple |
23:39:32 | FromDiscord | <odexine> You can have a tuple with no named fields match it |
23:39:40 | FromDiscord | <odexine> Even if it’s logically a different type |
23:45:55 | FromDiscord | <Elegantbeef> No i just mean inheritance type matching is funny↵(@graveflo) |
23:49:32 | FromDiscord | <Elegantbeef> The issue seems to be mainly that some of those types are invalid |
23:49:38 | FromDiscord | <Elegantbeef> `Bar[ref Child]` is incorrect |
23:50:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/AhkSE |
23:51:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xWM |
23:51:51 | FromDiscord | <graveflo> so constraints on types dont work the same way as constraints on procs? |
23:52:05 | FromDiscord | <Elegantbeef> This is in a similar vein of `seq[Child] is not seq[Parent]` |
23:52:31 | FromDiscord | <Elegantbeef> It seems that way |
23:52:41 | FromDiscord | <graveflo> well that should be the case because they are not refs. If they were refs I would say that should work |
23:52:43 | FromDiscord | <Elegantbeef> No clue if this is intended or a bug |
23:53:10 | FromDiscord | <graveflo> It makes more sense why this is happening from that.. but now it looks like the change would need to be much more drastic |
23:53:49 | FromDiscord | <Elegantbeef> No you do not want to make `seq[Child]` convertible to `seq[Parent]` |
23:53:50 | FromDiscord | <Elegantbeef> It works only in that instance |
23:53:50 | FromDiscord | <Elegantbeef> Anywhere else it becomes more complicated |
23:54:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/5ejZq |
23:55:11 | FromDiscord | <graveflo> yea you would have to use the methods that work on disambiguating with inheritance. That form doesn't work iirc |
23:55:33 | FromDiscord | <graveflo> I think you have to do use `if` but that has always been the case for that type of abstraction |
23:56:01 | FromDiscord | <Elegantbeef> I mean if `seq[Child] is seq[Parent]` you have so many 'wrong' assumptions in the type system |
23:56:26 | FromDiscord | <Elegantbeef> Generic type parameters do not do conversions for good reason 😄 |
23:56:58 | FromDiscord | <graveflo> makes sense. not 100% there yet |
23:57:46 | FromDiscord | <graveflo> I'll put it this way, help a dummy out. Why would that assumption be bad for ref types of `RootObj` |
23:58:00 | FromDiscord | <Elegantbeef> I have some ramblings here https://forum.nim-lang.org/t/10072#66559 |
23:58:59 | FromDiscord | <graveflo> I can see how it might lead to data loss but you get that anyway in procs and other mechs. Its just something you have to know when using a lang like this. I'll read |