00:10:57 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:30:27 | * | NeoCron quit (Remote host closed the connection) |
00:35:11 | * | vicfred quit (Quit: Leaving) |
00:39:43 | * | vicfred joined #nim |
00:48:19 | * | vicfred quit (Quit: Leaving) |
01:25:44 | * | Gustavo6046 quit (Remote host closed the connection) |
01:27:52 | * | Gustavo6046 joined #nim |
02:05:07 | * | rockcavera quit (Remote host closed the connection) |
02:11:01 | * | rockcavera joined #nim |
02:11:02 | * | rockcavera quit (Changing host) |
02:11:02 | * | rockcavera joined #nim |
03:12:20 | * | arkurious quit (Quit: Leaving) |
03:27:33 | * | xet7 quit (Quit: Leaving) |
03:54:41 | * | rockcavera quit (Remote host closed the connection) |
04:03:06 | NimEventer | New thread by Geekrelief: Suggestion on wrapping C union with anonymous struct?, see https://forum.nim-lang.org/t/8486 |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:03 | FromDiscord | <gogolxdong (liuxiaodong)> https://github.com/hypercore-protocol/hypercore |
04:06:04 | nrds | <R2D299> itHub: 7"Hypercore is a secure, distributed append-only log." |
04:06:31 | * | supakeen joined #nim |
04:26:41 | * | xet7 joined #nim |
04:28:16 | FromDiscord | <Rika> In reply to @gogolxdong (liuxiaodong) "https://github.com/hypercore-protocol/hypercore": ? |
05:09:02 | FromDiscord | <gogolxdong (liuxiaodong)> https://github.com/beakerbrowser/beaker |
05:09:03 | nrds | <R2D299> itHub: 7"An experimental peer-to-peer Web browser" |
05:09:21 | FromDiscord | <gogolxdong (liuxiaodong)> We need these! |
05:09:23 | FromDiscord | <Rika> ?? |
05:09:24 | FromDiscord | <Rika> Oh |
05:09:45 | FromDiscord | <Rika> Well first we need a robust distributed framework library |
05:10:03 | FromDiscord | <Rika> Or components of such like message passing and coordination |
06:10:23 | FromDiscord | <NullCode> wtf LMFAO |
06:10:25 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/895916019145642024/unknown.png |
06:10:41 | nrds | <Prestige99> Lol |
06:10:42 | nrds | <Prestige99> context? |
06:10:59 | FromDiscord | <NullCode> "windows declared but not used"↵"undeclared identifier: windows" |
06:11:10 | FromDiscord | <NullCode> In reply to @nrds "<Prestige> context?": context: im trying to get nim working on linux |
06:11:17 | FromDiscord | <NullCode> (edit) "In reply to @nrds "<Prestige> context?": context: im trying to get ... nimtool" added "a" | "anim ... working" added "tool" |
06:11:23 | FromDiscord | <impbox [ftsf]> they may be in different scopes |
06:11:25 | nrds | <Prestige99> Can you show the code? |
06:12:39 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3Baw |
06:12:53 | FromDiscord | <NullCode> heres the jist of thigns |
06:12:56 | nrds | <Prestige99> ah yes |
06:12:57 | FromDiscord | <NullCode> (edit) "thigns" => "things" |
06:13:09 | FromDiscord | <impbox [ftsf]> `when defined(windows):` |
06:13:16 | FromDiscord | <impbox [ftsf]> doesn't create a new scope |
06:13:20 | FromDiscord | <impbox [ftsf]> if creates a new scope |
06:13:37 | FromDiscord | <impbox [ftsf]> if you use `let` inside an if block it only exists within that block |
06:13:47 | FromDiscord | <NullCode> oh on |
06:13:53 | FromDiscord | <NullCode> (edit) "on" => "no" |
06:14:03 | FromDiscord | <NullCode> man i feel stupid |
06:14:06 | FromDiscord | <impbox [ftsf]> `when defined(windows):`↵is the correct way to do different stuff depending on OS |
06:17:32 | FromDiscord | <NullCode> thank |
06:22:10 | FromDiscord | <NullCode> ` |
06:22:32 | FromDiscord | <NullCode> i dont understand this |
06:22:33 | FromDiscord | <NullCode> (edit) "`" => "sent a code paste, see https://play.nim-lang.org/#ix=3Bax" |
06:22:43 | FromDiscord | <NullCode> whats a dso |
06:25:01 | FromDiscord | <Rika> The pthread dynamic shared object is missing |
06:25:08 | FromDiscord | <Rika> Do you use threading |
06:25:17 | FromDiscord | <NullCode> nope |
06:26:01 | FromDiscord | <impbox [ftsf]> compile with `--threads:on` ? |
06:26:25 | FromDiscord | <impbox [ftsf]> miniaudio whatever it is probably uses threads |
06:27:04 | FromDiscord | <NullCode> why didnt i need that on windows? |
06:27:26 | FromDiscord | <NullCode> on win i just did `nim c file.nim` for test builds |
06:27:40 | FromDiscord | <impbox [ftsf]> pthreads is a linux thing |
06:28:00 | FromDiscord | <impbox [ftsf]> (may not be entirely true) |
06:28:07 | FromDiscord | <impbox [ftsf]> pretty sure you can use pthreads on other things |
06:28:31 | FromDiscord | <NullCode> In reply to @impbox "pthreads is a linux": oh |
06:52:39 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
06:54:16 | * | Gustavo6046 joined #nim |
07:23:51 | * | PMunch joined #nim |
07:35:51 | FromDiscord | <Schelz> What's in nim (try:... except:...) ? |
07:35:59 | PMunch | try: catch: |
07:36:13 | FromDiscord | <Schelz> thx |
07:36:18 | PMunch | And finally: |
07:36:35 | FromDiscord | <Elegantbeef> Are you ok pmunch? https://nim-lang.org/docs/manual.html#exception-handling-except-clauses |
07:37:04 | PMunch | Wait.. shit |
07:37:29 | PMunch | I assumed it wasn't except since he asked |
07:37:54 | PMunch | But I guess now that his question might've been "what does try: except: mean in Nim", to which my answer still applies :P |
07:52:57 | * | jjido joined #nim |
07:54:46 | FromDiscord | <Rika> Lol |
08:07:19 | * | max22- joined #nim |
08:16:06 | nrds | <Prestige99> Is there a way to alias a package name? E.g. I have `chipmunk7` but I want to `import chipmunk` |
08:16:37 | FromDiscord | <impbox [ftsf]> import chipmunk7 as chipmunk |
08:17:06 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/manual.html#modules-module-names-in-imports |
08:17:24 | nrds | <Prestige99> Sorry I meant globally |
08:17:36 | FromDiscord | <impbox [ftsf]> what do you mean by globally? |
08:17:55 | FromDiscord | <impbox [ftsf]> import is as global as it gets |
08:17:55 | nrds | <Prestige99> like I could just `import chipmunk` instead of `import x as y` |
08:18:08 | nrds | <Prestige99> maybe I'll just symlink in my nimble cache |
08:18:09 | FromDiscord | <impbox [ftsf]> rename chipmunk7 to chipmunk? |
08:18:19 | FromDiscord | <impbox [ftsf]> but that'll be problematic for other users |
08:18:44 | nrds | <Prestige99> basically - I had to change change chipmunk to chipmunk7 because of nimble having chipmunk as an alias to chipmunk6 |
08:18:54 | nrds | <Prestige99> https://github.com/nim-lang/packages/pull/2018 |
08:19:08 | nrds | <Prestige99> but locally I don't want to deal with the 7 |
08:19:18 | FromDiscord | <impbox [ftsf]> why not? |
08:19:29 | FromDiscord | <impbox [ftsf]> chipmunk7 is the name of the package |
08:19:58 | nrds | <Prestige99> Idk maybe I'm weird - I want chipmunk to be the most recent chipmunk version, instead of chipmunk version 6 |
08:20:22 | FromDiscord | <impbox [ftsf]> you can have a `common.nim` which does `import chipmunk7 as chipmunk; export chipmunk` then `import common.nim` |
08:20:39 | nrds | <Prestige99> Hm that's better, thanks |
08:20:39 | FromDiscord | <impbox [ftsf]> or call it chipmunk.nim if you like |
08:21:49 | nrds | <Prestige99> Isn't there a way to sort of inject an import in all files with config.nims? |
08:22:12 | nrds | <Prestige99> ah yes, switch("import", "./foo") |
08:31:18 | PMunch | Hmm, I have a bit of a conundrum |
08:31:51 | PMunch | I have a DLL that sends me requests, so my code generally only runs when it gets called |
08:32:12 | PMunch | But I want to handle the requests as fast as possible, so I keep a cache of some web resources |
08:32:21 | PMunch | But I also need to refresh this cache |
08:33:08 | FromDiscord | <impbox [ftsf]> what's the invalidation criteria? |
08:33:30 | PMunch | They are invalidated by a 404 from the server |
08:33:50 | FromDiscord | <Rika> You need a different criteria |
08:33:58 | PMunch | But I re-check them in a round-robin fashion so that I check every entry every 24 hours |
08:34:07 | FromDiscord | <impbox [ftsf]> so you get a request to tell your it's invalid? |
08:34:39 | PMunch | Let's say I have 24 entries in my cache, that means I check one entry every hour. If I get a 404 back I invalidate it from the cache |
08:34:58 | FromDiscord | <Rika> Refresh after serving the last request |
08:35:11 | PMunch | The last request? |
08:35:19 | FromDiscord | <Rika> So on a request you serve then check if you need to refresh |
08:35:36 | PMunch | Hmm, that would be a lot of refreshes |
08:35:52 | FromDiscord | <impbox [ftsf]> well not if you have 24, but if it's 240000 maybe |
08:35:57 | FromDiscord | <Rika> The data may be staler than if you had a long running process but i don’t know a better way |
08:36:09 | FromDiscord | <impbox [ftsf]> cache invalidation is hard |
08:36:15 | PMunch | I might have 24 entries in my cache, but I get about 500k requests a day IIRC |
08:36:22 | FromDiscord | <Rika> In reply to @PMunch "Hmm, that would be": I mean put the “refresh cache” after serving a request |
08:36:49 | PMunch | That would mean that instead of refreshing 24 hours a day I now refresh 500k times a day.. |
08:36:57 | PMunch | 24 times a day * |
08:36:57 | FromDiscord | <Rika> No |
08:37:07 | FromDiscord | <Rika> You have to check if it’s after 24 hours still of course |
08:37:42 | PMunch | Ah right |
08:37:42 | FromDiscord | <Rika> So: ↵Serve↵Check if invalidated↵If so, refresh |
08:37:51 | FromDiscord | <impbox [ftsf]> how often do these things become invalid? |
08:37:59 | PMunch | Very infrequently |
08:38:00 | FromDiscord | <impbox [ftsf]> if ever? |
08:38:00 | FromDiscord | <Rika> He did just say 24 hours |
08:38:09 | PMunch | Hence why 24 hours is chosen |
08:38:35 | FromDiscord | <impbox [ftsf]> how bad is it if someone gets a stale entry? |
08:38:40 | FromDiscord | <Rika> What is priority, fresh data or latency? |
08:38:47 | PMunch | latency for sure |
08:39:07 | FromDiscord | <Rika> Then yeah the refresh after serve should be good |
08:39:37 | FromDiscord | <impbox [ftsf]> oh the source data can change? |
08:39:40 | PMunch | The entries are keys which only get invalidated manually. So it's more a question about how much time after deactivation is it acceptable that they can still connect |
08:47:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:50:06 | PMunch | In a perfect world I would have a cache that I could share between the two threads |
08:50:37 | PMunch | The thread needing the entries just getting them, and the updating thread just adding them |
09:23:01 | FromDiscord | <Clonkk> Is there a way to use importcpp on C++ constexpr variable ? |
10:52:23 | * | jjido joined #nim |
10:57:42 | FromDiscord | <tandy> juancarlos says cstring does work on js↵(<@709044657232936960_krux02=5b=49=52=43=5d>) |
10:58:38 | PMunch | Hmm, I have a macro in Futhark. I want to get the version of the Futhark library it comes from. How can I do that? |
10:59:54 | FromDiscord | <haxscramper> Is it a nim macro or C macro? |
10:59:59 | PMunch | Nim macro |
11:01:04 | FromDiscord | <tandy> apparently you just need to check if the cstring is nil first |
11:02:48 | FromDiscord | <haxscramper> I'm not sure what do you mean by "version of the library macro comes from". |
11:02:49 | FromDiscord | <haxscramper> You can add some defines so macro knows a version |
11:02:49 | FromDiscord | <haxscramper> but there is no built-in way to do this |
11:03:29 | PMunch | Ah okay, thanks |
11:09:44 | PMunch | Hm, can't I import things into a Nimble file? |
11:10:02 | FromDiscord | <haxscramper> you can, but you need a hack with realtive paths |
11:10:07 | PMunch | I tried to create a file with `const VERSION* = "0.3.0"` |
11:10:14 | PMunch | Aha, which hack? |
11:11:13 | FromDiscord | <haxscramper> `when exists("src"): import src/XXX else: import XXX` |
11:11:59 | PMunch | Hmm, still doesn't work |
11:12:47 | PMunch | http://ix.io/3BbA/ |
11:12:52 | PMunch | Got a different error though |
11:13:33 | PMunch | Before it complained that `Error: expression 'version' has no type (or is ambiguous)` |
11:16:23 | FromDiscord | <haxscramper> image.png https://media.discordapp.net/attachments/371759389889003532/895993019243827240/image.png |
11:16:35 | FromDiscord | <haxscramper> i'm sorry, but this is unreadable |
11:16:45 | PMunch | Just remove the last / from the url |
11:19:23 | FromDiscord | <haxscramper> `import std/os`, `existsDir` then |
11:19:37 | FromDiscord | <haxscramper> I forgot that https://nim-lang.org/docs/nimscript.html#exists%2Cstring exists in nimscript is a completely different thing |
11:19:52 | PMunch | Aha :P |
11:19:59 | PMunch | I was wondering about that |
11:21:36 | PMunch | Error: expression 'version' has no type (or is ambiguous) |
11:21:37 | PMunch | Hmm |
11:22:01 | FromDiscord | <tandy> ok i think i did it a bit better now but, when i run my md5.js in the browser it says `charCodeAt` is not a function? |
11:22:16 | FromDiscord | <tandy> https://github.com/nim-lang/Nim/issues/14157 |
11:22:17 | FromDiscord | <tandy> is it this bug? |
11:22:41 | FromDiscord | <tandy> https://github.com/tandy-1000/Nim/commit/6b9fe865053e3705c20181c54ce21967c6efa71f |
11:22:44 | FromDiscord | <tandy> my code |
11:23:49 | FromDiscord | <haxscramper> You have `VERSION` screamcase const↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:24:04 | FromDiscord | <haxscramper> and `version` is a module |
11:24:29 | PMunch | Ah shit |
11:24:33 | PMunch | Of course |
11:24:37 | FromDiscord | <haxscramper> Though I would suggest you use `futhartMajorVer = 0`, `futharkMinorVer = 3` etc |
11:24:50 | FromDiscord | <haxscramper> So users can actually use this without having to parse and re-parse |
11:25:12 | PMunch | There we go |
11:27:42 | PMunch | Hmm, still a bit broken |
11:28:00 | PMunch | It seems to have cached the old file somehow |
11:29:12 | PMunch | As you can see it says "Installing [email protected]" even though the versionFile is updated |
11:29:14 | PMunch | http://ix.io/3BbI |
11:29:27 | FromDiscord | <tandy> strange thing is, im not modifying a cstring, but i am modifying an aray... |
11:32:13 | FromDiscord | <haxscramper> because nimble uses git tabs↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:32:16 | FromDiscord | <haxscramper> tags\ |
11:32:54 | FromDiscord | <haxscramper> also, please, please, is it that hard to update version manually? |
11:33:07 | FromDiscord | <haxscramper> You just went from manifest that can be statically parsed |
11:33:14 | FromDiscord | <haxscramper> to a one that requires whole compiler to read |
11:33:29 | FromDiscord | <haxscramper> because you need to resolve imports, read external files, resolve constants and so on |
11:33:32 | PMunch | I just don't want to forget to update it |
11:33:47 | PMunch | And if you're trying to statically read nimble files you're doing it wrong anyways.. |
11:33:55 | PMunch | They are supposed to be read as NimScript |
11:34:10 | FromDiscord | <haxscramper> no, I'm not doing it wrong |
11:34:11 | FromDiscord | <haxscramper> "wrong" t |
11:34:21 | FromDiscord | <FastnFree> You think nim will someday be a major player for game dev like lua or other languages are? |
11:34:31 | FromDiscord | <haxscramper> almost all metadata in nimble manifest can be statically evaluated |
11:35:24 | FromDiscord | <haxscramper> Well, to be precise \~99.2%+ of all metadata fields in the ecosystem |
11:35:59 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/398#issuecomment-874681058 |
11:36:18 | PMunch | It can be, but it shouldn't |
11:36:29 | FromDiscord | <haxscramper> why it shouldn't be? |
11:36:43 | PMunch | Same reason I'm using libclang to read C files, because reading C files statically is wrong |
11:37:00 | FromDiscord | <haxscramper> Is it that bad to expect my tooling to not reach for the whole compiler infrastructure when reading data that is almost univers |
11:37:04 | FromDiscord | <haxscramper> haha funny↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:37:16 | FromDiscord | <haxscramper> C is not the same as .`nimble`, and we both know it |
11:37:27 | FromDiscord | <haxscramper> so this comparison makes absolutely no sense |
11:37:33 | PMunch | Well, it's not far from it |
11:37:38 | PMunch | .nimble files are NimScript |
11:37:45 | PMunch | And should be treated as NimScript |
11:37:47 | FromDiscord | <haxscramper> I'm trying to read strictly defined set of `key = value` assignments |
11:37:59 | FromDiscord | <haxscramper> vs parsing whole langauge with 50 years of hacks and API misuses |
11:38:01 | FromDiscord | <haxscramper> yeah, pretty close |
11:38:22 | PMunch | Throw on the Nimble header and a footer that exports all the fields to JSON or something and pass it through `nim e` if you want to read the data out |
11:38:26 | NimEventer | New thread by Jorjun_arch: Block-chain binary certification, see https://forum.nim-lang.org/t/8487 |
11:38:33 | FromDiscord | <FastnFree> Does zetashift still come here? |
11:38:33 | PMunch | But don't try to read them without using the compiler |
11:39:02 | PMunch | .nimble files are probably touring complete, don't treat them like text |
11:39:13 | FromDiscord | <haxscramper> Number of nimble files that cannot be statically evaluated is within a margin of error |
11:39:32 | FromDiscord | <haxscramper> there are at most tens of them, and overwhelming majority of those use version hack |
11:40:16 | FromDiscord | <haxscramper> Like yeah, they might not be supposed to be read statically fully, but I'm not talking about doing it fully |
11:40:20 | PMunch | Still, they aren't text files, and shouldn't be read as text files |
11:40:26 | FromDiscord | <haxscramper> I'm talking about begin able to read `version = "string"` |
11:40:36 | FromDiscord | <haxscramper> that's all I'm talking about |
11:40:54 | PMunch | Sure if you want to read a format that looks like a Nim file but isn't really a Nim file, knock yourself out |
11:40:57 | FromDiscord | <haxscramper> `version = "string"` and some strictly defined set of metadata fields |
11:41:13 | PMunch | But if you want to read Nimble files then read Nimble files and not your own imagined text format |
11:41:48 | FromDiscord | <haxscramper> This is not "my own imagined text format", that's how everyone writes their nimble files |
11:41:54 | FromDiscord | <haxscramper> I'm not imagining anything |
11:42:04 | PMunch | It's like reading ASCII only because "most text doesn't need UTF-8" |
11:42:09 | PMunch | It's just a flawed logic |
11:43:05 | FromDiscord | <haxscramper> I'm saying that it is not that controversial to expect my tooling to be able to statically read metadata that needs to be static in the first place |
11:43:13 | PMunch | Hmm @FastnFree, haven't seen them in a while |
11:43:15 | FromDiscord | <haxscramper> Without jumping into whole code evaluation |
11:43:22 | FromDiscord | <haxscramper> there was a package whose version depended on a time of the day |
11:43:27 | FromDiscord | <haxscramper> or some other random crap |
11:43:54 | FromDiscord | <tandy> is there any reason not to do this?↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:44:00 | PMunch | I have written nimble files in the past that grabbed the version from Git tags |
11:44:05 | FromDiscord | <haxscramper> And I don't understand how this can be extended to "it is the same as using libclang for C" or "same as using ASCII instead of UTF8" |
11:44:18 | PMunch | @tandy, sorry on IRC I can't see what you replied to |
11:44:42 | FromDiscord | <tandy> > ↵> Throw on the Nimble header and a footer that exports all the fields to JSON or something and pass it through nim e if you want to read the data out↵> |
11:44:49 | PMunch | Because you're trying to read a complex thing assuming it's a simple thing |
11:45:01 | FromDiscord | <haxscramper> Is there any reason to prefer static subset of turing-complete language for your configuration? |
11:45:10 | FromDiscord | <haxscramper> well, I don't know |
11:45:13 | PMunch | @tandy, ah, no there isn't really a reason not to do that |
11:45:29 | FromDiscord | <haxscramper> It is not a complex thing↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:45:57 | FromDiscord | <haxscramper> I'm talking specifically about strictly defined set of `key = "value"` pairs |
11:45:58 | FromDiscord | <haxscramper> nothing more |
11:46:01 | FromDiscord | <haxscramper> that's it |
11:46:10 | FromDiscord | <haxscramper> everyone already writes it this way |
11:46:22 | PMunch | Of course, there is an argument to be made for whether Nimble files should use NimScript or not, but as it is now they are NimScript files and should be treated as NimScript files |
11:46:27 | PMunch | Anything else is simply incorrect |
11:46:39 | FromDiscord | <haxscramper> and by everyone I mean actually everyone as my nimble package analysis shows |
11:46:58 | PMunch | Yeah as I said, if you want to parse a format that looks like a Nimble file, but isn't a Nimble file be my guest |
11:47:08 | PMunch | But if you want to actually read Nimble files, then do it properly |
11:47:40 | FromDiscord | <haxscramper> well, there is a question about what is "properly" https://github.com/nim-lang/RFCs/issues/398#issuecomment-874681058 |
11:47:56 | FromDiscord | <haxscramper> and I think "properly" would be a static `key = value` |
11:48:37 | PMunch | Linking to your own proposal on "improvements" for Nimble isn't proving anything |
11:49:54 | FromDiscord | <haxscramper> If I just copied it to you directly then, would it change something? |
11:50:17 | FromDiscord | <haxscramper> There is a stats in the main proposal with more elaborate explanation |
11:50:23 | FromDiscord | <haxscramper> And concrete numbers |
11:50:38 | PMunch | Yes, but it's still a proposal |
11:50:42 | FromDiscord | <haxscramper> And lengthy suggestion how it should function |
11:50:48 | FromDiscord | <haxscramper> and how it is going to be implemneted |
11:50:49 | FromDiscord | <haxscramper> and so on |
11:51:12 | PMunch | Sure, but I can write the same thing for having Nimble files be written in Brainfuck |
11:51:33 | PMunch | Doesn't make it less true that you should treat the current Nimble format as NimScript files |
11:52:01 | FromDiscord | <haxscramper> well, so your point is basically "for now I don't care" |
11:52:33 | FromDiscord | <haxscramper> and it does not matter unless this better solution would be actually accepted? |
11:53:09 | FromDiscord | <tandy> i think pmunch just wants stuff to work even in edge cases |
11:53:10 | FromDiscord | <tandy> where ppl do dum stuf |
11:53:33 | FromDiscord | <haxscramper> And I want to scale back edge cases so ecosyste would not end up in the infinite mantainance mode |
11:53:38 | PMunch | No, my point is that when faced with a file that has a well-defined format you should read that file according to the well defined format instead of making up your own rules |
11:53:48 | FromDiscord | <haxscramper> where we are forced to keep backward compat for \~20 ppl who use this "feature" |
11:54:14 | FromDiscord | <haxscramper> If you think that nimble is a well-defined format↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:54:29 | PMunch | Unless you're planning on killing NimScript any time soon there isn't really all that much to maintain |
11:54:29 | FromDiscord | <haxscramper> I mean there is no format |
11:54:36 | PMunch | It's NimScript |
11:54:41 | FromDiscord | <haxscramper> there is a way to just read it in a way that supposedly works |
11:54:57 | FromDiscord | <haxscramper> and nimble itself does multistage copy-paste-eval-read-back routine |
11:55:17 | FromDiscord | <haxscramper> just to read `version = "version"` |
11:57:32 | PMunch | https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/nimscriptwrapper.nim#L80-L120 <- how you should handle Nimble files |
11:58:02 | FromDiscord | <haxscramper> What current approach promotes is just a backwards data flow, where package manager manifest cannot be used as a single source of truth |
11:58:38 | FromDiscord | <haxscramper> and the only real use case I've seen (that is used more than couple of times at least) for this is a version hack |
11:59:16 | FromDiscord | <haxscramper> there was a suggestion to deprecate version fields entirely actually |
11:59:23 | FromDiscord | <haxscramper> because it also duplicates information |
12:00:00 | FromDiscord | <Rika> In reply to @haxscramper "there was a suggestion": i'd like this but then again that would lock-in to git i assume |
12:00:11 | PMunch | Probably |
12:00:31 | PMunch | Now the question becomes, is locking the version number into a Version Control System a bad idea? |
12:00:44 | FromDiscord | <Rika> idk if subversion or mercurial or w/e other vcs nim supports has tags, not sure if its a git only thing actly |
12:00:55 | FromDiscord | <Rika> In reply to @PMunch "Now the question becomes,": id say it is yeah |
12:00:58 | FromDiscord | <haxscramper> we only support mercurial |
12:01:09 | FromDiscord | <haxscramper> nimble can only work with git and mercurial |
12:01:13 | FromDiscord | <Rika> i mean i gues stheyre an extreme minority |
12:01:20 | FromDiscord | <Rika> mercurial users, i mean |
12:01:33 | FromDiscord | <haxscramper> I would actually suggest using libgit |
12:01:44 | FromDiscord | <haxscramper> instead of relying on the git binary |
12:02:17 | PMunch | Why don't you just read the .git folder yourself directly and parse it statically? Instead of reading the format the way it's supposed to be read? :P |
12:02:37 | PMunch | Sorry, just messing with you |
12:03:32 | PMunch | I mean you can use `nimble dump` in order to get your nice statically readable list of data from a Nimble file |
12:03:36 | FromDiscord | <haxscramper> if .git was just as simple as `key = value` for 99% of cases and actually had specified format then why not? |
12:04:02 | * | max22- quit (Ping timeout: 265 seconds) |
12:04:19 | PMunch | Probably works for both .nimble and the old .ini format as well |
12:04:52 | FromDiscord | <haxscramper> well, nimble first tries to parse it as `.ini` |
12:04:59 | FromDiscord | <haxscramper> if there is an exception it tries to eval it as nimscript |
12:05:08 | FromDiscord | <haxscramper> and both formats can be store in the `.babel` |
12:05:11 | FromDiscord | <haxscramper> `.nimble` |
12:05:27 | PMunch | But if you just want to read simple static keys, just use `nimble dump` |
12:05:38 | PMunch | It handles all the logic of Nimble for you |
12:05:46 | PMunch | In the way it is supposed to be handled |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:07 | FromDiscord | <haxscramper> if you think I'm trying to find a way to read nimble file metadaa |
12:06:19 | FromDiscord | <haxscramper> I'm not |
12:06:29 | FromDiscord | <haxscramper> And I'm aware of all ways to do this |
12:06:31 | * | supakeen joined #nim |
12:06:34 | FromDiscord | <haxscramper> including `nimble dump --json` |
12:07:07 | FromDiscord | <haxscramper> where `--json` is undocumented as of 1.4.8 at least, but I think that's what you probably meant by how it supposed to be handled? |
12:07:44 | FromDiscord | <haxscramper> you know' static evaluation still implies I have to parse it, and this part can be done by compiler etc. |
12:07:58 | FromDiscord | <haxscramper> so I'm not going to run around with ad-hoc regexes |
12:08:45 | FromDiscord | <haxscramper> Araq also used compiler to parse nimble files in the atlas tool |
12:09:04 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/pull/18497/files#diff-8c33f91f01f7d86206dba0344835180d03954f29def8fd72197cb59b1f7d1f8a |
12:09:30 | FromDiscord | <haxscramper> so I'm not sure even about "supposed" part, I'd rather say that's just how it was implemented |
12:09:53 | FromDiscord | <haxscramper> and nobody exploits this anyway |
12:10:11 | FromDiscord | <haxscramper> also I'm not trying to take away precious `task` evaluation and try to substitute it with something else |
12:10:20 | FromDiscord | <haxscramper> and before/after hooks |
12:13:15 | FromDiscord | <haxscramper> So "supposed" is questionable, even if it wasn't (i.e. it was the original design goal, which is apparently not the case judging by generally welcome response when static toplevel was discussed) I would still question its necessity based on the real-world data (only extremely small minority of users actually exploit this) and general idea that static way of storing metadata is preferable to the one which requires whole compiler to eva |
12:15:06 | PMunch | This is all besides the point I was arguing though. I don't have a horse in the race for what .nimble files should look like. But the fact of the matter is that right now they are NimScript files and should be treated as such by anyone interfacing with them. |
12:15:57 | FromDiscord | <haxscramper> guess I need to make a PR into compiler then to fix atals |
12:15:58 | PMunch | And since a new spec would effectively introduce a third format I would still expect people to use something like `nimble dump --json` to actually read any data out of it |
12:16:57 | FromDiscord | <haxscramper> that one I have no argument against |
12:17:24 | FromDiscord | <haxscramper> I just object to making changes that force whole compiler infrastructure in the configuration file reading |
12:17:39 | FromDiscord | <haxscramper> make it mandatory\ |
12:18:11 | PMunch | That's not a change though, that is how Nimble files already are |
12:18:30 | PMunch | You're a couple years late to object to that change :P |
12:19:20 | FromDiscord | <haxscramper> again, looking at the ecosystem, it is clear that I'm not late |
12:19:38 | FromDiscord | <haxscramper> since there is almost nobody who exploits this |
12:20:16 | FromDiscord | <haxscramper> so I won't break anything |
12:20:18 | FromDiscord | <dom96> In reply to @haxscramper "I would actually suggest": I saw a tweet recommending against libgit just today 🙂 |
12:20:29 | FromDiscord | <haxscramper> in favor of git binary? |
12:20:32 | FromDiscord | <dom96> yes |
12:20:41 | FromDiscord | <dom96> apparently libgit is subtly crappier than git binary |
12:20:47 | FromDiscord | <haxscramper> well, it is easier to package at least, or something |
12:20:58 | FromDiscord | <haxscramper> well, it is a C library |
12:21:14 | FromDiscord | <haxscramper> certainly harder to use than `git` with some subcommands |
12:21:37 | FromDiscord | <dom96> meh, we're using `git` already, it works fine |
12:21:59 | FromDiscord | <dom96> btw PMunch, Nimble defines a `NIMBLE_VERSION` constant. |
12:22:03 | FromDiscord | <dom96> which you can use |
12:22:17 | FromDiscord | <haxscramper> it does? |
12:22:38 | PMunch | Yeah, but that is only when compiling the module right? |
12:22:55 | PMunch | So I can't use it from my macro, because that would pull the version of the project you're in |
12:23:32 | FromDiscord | <haxscramper> by the way, why do your macro need to know library version? |
12:23:55 | FromDiscord | <dom96> oh, you want library version, I see |
12:24:17 | PMunch | Because it caches its own output, and to ensure it gets rebuilt when you need to it hashes all the inputs and attaches that to the cache filename |
12:24:57 | FromDiscord | <dom96> sounds like you might want to use the path of the module |
12:25:00 | FromDiscord | <dom96> it'll include the version |
12:25:07 | FromDiscord | <dom96> (if it's installed via Nimble) |
12:25:26 | PMunch | So I would like to also add the version of the library because that obviously means the output might be different |
12:25:48 | PMunch | Yeah, problem is if it isn't installed via Nimble.. |
12:26:00 | PMunch | I tried to create a version.nim file that exported a constant |
12:26:14 | PMunch | And then import than in both the nimble file and the file with the macro |
12:26:26 | PMunch | Which is the way I would expect it to work |
12:27:04 | PMunch | But since installing it flattens the library it was surprisingly tricky.. |
12:28:42 | PMunch | I gave up when I had installed a version 0.3.0, updated the file to say 0.3.1 and trying to update and it said that 0.3.0 was already installed and saying yes to overwrite threw an error |
12:29:13 | PMunch | I guess I could get the module path and then go looking for the nimble file |
12:32:56 | FromDiscord | <dom96> maybe Nimble should also define a `NIMBLE_FUTHARK_VERSION` (and the same for each package) lol |
12:33:56 | FromDiscord | <dom96> but some people don't want to compile using `nimble` anyway which means this doesn't get defined |
12:34:15 | FromDiscord | <dom96> hm, could go into the nim.cfg file just like the --path's now though |
12:35:11 | PMunch | Doesn't nim.cfg have the same issue as the .nimble file? |
12:35:37 | FromDiscord | <dom96> what issue is that? |
12:36:07 | PMunch | That it would read the nim.cfg of the project you're building and not that of Futhark |
12:38:34 | FromDiscord | <dom96> well no, Nimble would add `NIMBLE_FUTHARK_VERSION` in there |
12:39:25 | PMunch | Ooh, so you're talking about having nimble add that when you're installing, and then the macro could grab it when it's run? |
12:41:05 | FromDiscord | <dom96> sure |
12:41:39 | FromDiscord | <dom96> When you compile with Nimble it calls `nim` with the `--path` and `-d:NimblePkgVersion=ver` |
12:42:21 | FromDiscord | <dom96> Now since some people don't want to use `nimble` to compile their code, the proposed solution was to just have Nimble put these flags into nim.cfg |
12:42:32 | FromDiscord | <dom96> (or .nims, can't remember where they go now tbh) |
12:42:43 | FromDiscord | <dom96> and Nimble now supports this when it's in a special mode |
12:42:46 | * | Guest67 joined #nim |
12:42:53 | Guest67 | hello :) |
12:42:59 | FromDiscord | <dom96> so I think putting the defines in there would make sense too |
12:43:15 | Guest67 | Anyways where can i learn nim? |
12:43:23 | PMunch | But what do you do if you already have a .nims file? |
12:43:23 | Guest67 | also you guys have discord? |
12:43:40 | PMunch | Yup, there is a Discord, but it's all linked to this IRC channel |
12:44:06 | PMunch | Here is a nice list of learning resources: https://nim-lang.org/documentation.html |
12:44:24 | Guest67 | thanks |
12:44:55 | Guest67 | nim is underrated dont you agree? |
12:45:32 | PMunch | Definitely! |
12:45:43 | PMunch | Well around here it's rated pretty well :P |
12:45:54 | FromDiscord | <NullCode> yeah lmfao |
12:45:58 | Guest67 | its also good for hacking ngl |
12:46:05 | FromDiscord | <NullCode> but aside from the nim underworld, very underrated |
12:46:11 | PMunch | What kind of hacking? |
12:46:23 | Guest67 | making malware since usually it is undetectable |
12:46:31 | PMunch | Hacking like "haha, got your password" or hacking like "look at this cool thing I made" |
12:46:35 | PMunch | Ah right |
12:47:09 | PMunch | Yeah it has seen some utilization there, which unfortunately means that Nim an Nimble now sometimes gets flagged as a virus when people install it |
12:47:20 | PMunch | Because of poor fingerprinting |
12:48:46 | Guest67 | where is it being flagged as a virus? |
12:49:13 | FromDiscord | <haxscramper> windows |
12:49:29 | Guest67 | hmm |
12:49:38 | FromDiscord | <haxscramper> It has been a recurssing problem since someone wrote a malware in nim seveal months ago |
12:49:38 | Guest67 | oh right anyways i gotta learn nim |
12:50:09 | FromDiscord | <haxscramper> Windows defender and other 10^9 IQ antivirus vendors flag it (and nimble/choosenim) as a malware |
12:50:27 | PMunch | https://forum.nim-lang.org/t/7830 |
12:50:43 | FromDiscord | <impbox [ftsf]> so it may not be as undetectable as you might imagine |
12:50:53 | FromDiscord | <impbox [ftsf]> but it is a great language |
12:51:23 | Guest67 | hmm, yea but still its not as well known compared to other programming languages |
12:51:25 | PMunch | That's the problem though, I'm 99% sure that people writing malware in Nim could apply some sort of avoidance scheme.. |
12:51:32 | Guest67 | so making a malware on it is a good idea |
12:51:39 | Guest67 | haha not that i encourage it |
12:53:02 | Guest67 | FonderElite#1366 |
12:53:07 | Guest67 | discord |
12:53:30 | PMunch | I never really got that argument. I mean Nim does make a perfect language for writing malware, easy to use, small binaries, down to the metal, fast, flexible, etc. but the "hard to detect because it's not commonly used" isn't really that strong of an argument |
12:53:56 | FromDiscord | <NullCode> In reply to @Guest67 "making malware since usually": nah |
12:54:04 | FromDiscord | <NullCode> it was undetectable before i did my thing |
12:54:08 | FromDiscord | <NullCode> 3 detects back in the day |
12:54:21 | FromDiscord | <NullCode> now it's gotten to the point where fucking nim is being false +'d |
12:54:34 | FromDiscord | <haxscramper> what thing↵(@NullCode) |
12:54:51 | FromDiscord | <NullCode> yes |
12:55:32 | Guest67 | Hmm so maybe obfuscating it will do the trick or encoding it in base64 then program it to decode itself |
12:55:37 | FromDiscord | <NullCode> In reply to @Guest67 "oh right anyways i": you shouldnt learn a language just because you wanna hack |
12:55:41 | FromDiscord | <NullCode> just some advice |
12:55:47 | FromDiscord | <NullCode> hacking isn't good |
12:56:09 | Guest67 | hacking depends on the person, i use it for research purposes |
12:56:14 | FromDiscord | <NullCode> In reply to @Guest67 "Hmm so maybe obfuscating": obf idk but base64 hella detects |
12:56:17 | Guest67 | learn more about computer |
12:56:23 | Guest67 | *Computers* |
12:56:26 | FromDiscord | <NullCode> base64 in any program will land you detects |
12:56:33 | FromDiscord | <NullCode> In reply to @Guest67 "*Computers*": yes definitely |
12:56:41 | FromDiscord | <NullCode> research purposes lmfao |
12:56:50 | Guest67 | What? |
12:57:01 | FromDiscord | <NullCode> (edit) "base64 ... inlanguage" added "the program" | "program" => "language" |
12:57:08 | FromDiscord | <NullCode> (edit) "base64" => "base64'ing" |
12:57:13 | FromDiscord | <NullCode> nothing |
12:57:26 | FromDiscord | <NullCode> anyway i like editing a lot |
12:57:29 | FromDiscord | <NullCode> how does it look in irc |
12:57:37 | FromDiscord | <NullCode> (edit) "anyway i like editing ... a" added "messages in discord" |
12:57:43 | Guest67 | cool |
12:57:54 | Guest67 | ```py |
12:57:57 | FromDiscord | <NullCode> like, am i spamming the entire chat in irc land |
12:58:08 | FromDiscord | <NullCode> bridges are weird |
12:58:28 | Guest67 | anyways whats your discord username? |
12:58:57 | FromDiscord | <NullCode> NullCode#0187 |
12:59:37 | * | arkurious joined #nim |
12:59:59 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:01:00 | FromDiscord | <Rika> you two sus |
13:01:07 | FromDiscord | <NullCode> no |
13:01:11 | FromDiscord | <NullCode> wait, how am i sus |
13:01:27 | FromDiscord | <NullCode> I'm already glowing |
13:01:30 | FromDiscord | <Rika> mr "i have malware on my github but i totally didnt write it" or whatever your awful excuse was |
13:01:32 | Guest67 | wrong username? |
13:01:52 | FromDiscord | <NullCode> In reply to @Guest67 "wrong username?": no https://media.discordapp.net/attachments/371759389889003532/896019563077050378/unknown.png |
13:02:04 | FromDiscord | <NullCode> In reply to @Rika "mr "i have malware": i was just fucking around are you serious |
13:02:16 | FromDiscord | <NullCode> lmfao |
13:02:28 | FromDiscord | <dom96> In reply to @NullCode "it was undetectable before": 🧐 |
13:02:29 | FromDiscord | <Rika> dafuq do you even mean |
13:02:38 | FromDiscord | <NullCode> In reply to @Rika "dafuq do you even": i was kidding when i said that |
13:02:40 | Guest67 | eh you have to add me lol |
13:02:53 | FromDiscord | <Rika> ah yes that excuse too |
13:03:00 | FromDiscord | <NullCode> which one |
13:03:23 | FromDiscord | <NullCode> In reply to @Guest67 "eh you have to": sent req |
13:03:24 | FromDiscord | <Rika> i seriously cant trust you when you've made so many remarks that would easily point to "ive tried making malware" |
13:03:32 | * | Guest67 is now known as FonderElite |
13:03:50 | FromDiscord | <NullCode> ok so |
13:03:52 | FromDiscord | <NullCode> listen up |
13:04:02 | FromDiscord | <NullCode> no need to believe "I've tried making malware" |
13:04:10 | FromDiscord | <NullCode> i have made stuff, and theres no denying that |
13:04:13 | FromDiscord | <NullCode> it's on my github ffs |
13:04:26 | FromDiscord | <NullCode> i was just messing around when i said "oh i didn't do it" etc |
13:04:34 | FromDiscord | <dom96> tbf I've made some "hacking" tools too |
13:04:40 | FromDiscord | <NullCode> like? |
13:05:09 | FromDiscord | <dom96> 🙊 |
13:05:26 | PMunch | https://github.com/nim-lang/packages/pull/2025 |
13:05:33 | FromDiscord | <NullCode> In reply to @dom96 "🙊": guess we shall never know |
13:05:45 | FromDiscord | <Rika> okay |
13:05:53 | FromDiscord | <Rika> then what reason did you have for the malware |
13:06:03 | FromDiscord | <NullCode> um so |
13:06:04 | FromDiscord | <Rika> were you pentesting or what |
13:06:11 | FromDiscord | <NullCode> can't say here dm |
13:06:14 | FromDiscord | <Rika> what |
13:06:15 | FromDiscord | <Rika> why |
13:06:17 | FromDiscord | <Rika> why not |
13:06:18 | FromDiscord | <Rika> ratehr |
13:06:20 | FromDiscord | <Rika> (edit) "ratehr" => "rather" |
13:06:29 | FromDiscord | <dom96> In reply to @NullCode "guess we shall never": it is on my github, I'll leave it to you to find 😛 |
13:06:33 | FromDiscord | <Rika> if you cant say here then just dont tell me |
13:06:55 | FromDiscord | <NullCode> ok won't tell you then |
13:07:02 | FromDiscord | <NullCode> In reply to @dom96 "it is on my": alright I'm on it |
13:07:13 | FromDiscord | <NullCode> too curious now |
13:07:19 | FromDiscord | <dom96> In reply to @NullCode "can't say here dm": Russian contract eh? 😄 |
13:07:25 | FromDiscord | <NullCode> XD |
13:07:36 | FromDiscord | <NullCode> hired by the remnants of the soviet union |
13:07:48 | FromDiscord | <NullCode> with plans to take control of the world using NullCode Malware™️ |
13:07:54 | FromDiscord | <dom96> Yes Comrade, bring us back to our former glory |
13:08:26 | FromDiscord | <NullCode> wait are you russian |
13:08:33 | PMunch | By the way NullCode, editing Discord messages looks pretty disgusting in the IRC chat :P |
13:08:35 | FromDiscord | <Rika> no |
13:08:42 | FromDiscord | <dom96> lol no |
13:08:44 | FromDiscord | <NullCode> In reply to @PMunch "By the way NullCode,": oh no i was scared of that |
13:09:07 | FromDiscord | <dom96> Not too far off though |
13:09:24 | FromDiscord | <NullCode> I see |
13:09:26 | PMunch | I mean it's not super terrible: https://irclogs.nim-lang.org/08-10-2021.html#12:57:01 |
13:09:39 | PMunch | But it's not great |
13:09:47 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/896021550552211456/unknown.png |
13:09:48 | FromDiscord | <NullCode> my god thats gross |
13:09:56 | FromDiscord | <NullCode> literally chat flooding lmfao |
13:10:06 | PMunch | Yup |
13:10:21 | PMunch | At least the bridge creates pastes from long messages now :P |
13:10:31 | PMunch | Always fun when someone pasted code into Discord.. |
13:10:37 | FromDiscord | <dom96> come on, it ain't even that bad |
13:10:48 | FromDiscord | <dom96> props to @Yardanico for implementing it |
13:10:58 | PMunch | Oh for sure, it's not that bad |
13:11:18 | PMunch | But if you're changing a single letter or something I'd say it's best to just leave it |
13:11:29 | FromDiscord | <NullCode> is there an irc web client |
13:11:30 | FromDiscord | <Yardanico> In reply to @NullCode "": yeah, there are no edits on IRC, although there was a discussion about it |
13:11:34 | FromDiscord | <Yardanico> In reply to @NullCode "is there an irc": yes, multiple |
13:11:40 | PMunch | Then again, on IRC I can see ages back in the history without scrolling |
13:11:47 | FromDiscord | <Yardanico> also you can use matrix which might be a better experience if you've only used modern apps like discord or telegram |
13:11:58 | FromDiscord | <NullCode> i like old stuff lmao |
13:12:01 | * | max22- joined #nim |
13:12:06 | FromDiscord | <dom96> yeah, we need irc logs for the other channels |
13:12:12 | FromDiscord | <dom96> really need to set that up |
13:12:13 | PMunch | First message on my screen right now is my comment saying I don't get the argument about the undetectability of Nim |
13:12:24 | FromDiscord | <NullCode> matrix is also alright, but I'd rather experiment with everything there is |
13:12:38 | FromDiscord | <impbox [ftsf]> I gave matrix a try, but it seemed suboptimal |
13:12:45 | FromDiscord | <NullCode> In reply to @PMunch "First message on my": your text gotta be hella small then |
13:12:46 | FromDiscord | <impbox [ftsf]> at least for this |
13:12:54 | PMunch | Oh yeah, always annoying when I need to reference something we discussed in #nim-offtopic :P |
13:13:03 | PMunch | Nah, not really |
13:13:26 | PMunch | Inconsolata at font size 13 |
13:13:40 | FromDiscord | <Rika> 13 on what screen dpu] |
13:13:41 | FromDiscord | <Rika> (edit) "dpu]" => "dpi" |
13:13:42 | PMunch | My client just doesn't add a bunch of silly whitespace everywhere |
13:13:53 | PMunch | And this is a pretty big 4K monitor :P |
13:14:15 | PMunch | But it's perfectly legible from like a meter away |
13:14:16 | FromDiscord | <NullCode> yikes https://media.discordapp.net/attachments/371759389889003532/896022686743003156/unknown.png |
13:14:30 | FromDiscord | <NullCode> am i legally blind, or is this hard to read |
13:14:38 | FromDiscord | <NullCode> In reply to @PMunch "And this is a": oh makes sense |
13:14:49 | FromDiscord | <dom96> Yeah, I was just about to say |
13:14:51 | FromDiscord | <Rika> its hard to read |
13:14:56 | FromDiscord | <dom96> Discord supports condensed mode |
13:15:01 | FromDiscord | <Rika> but its not good |
13:15:01 | FromDiscord | <dom96> which is basically the same as IRC |
13:15:09 | FromDiscord | <dom96> It's good enough |
13:15:16 | FromDiscord | <Rika> its not |
13:15:18 | FromDiscord | <Rika> imo |
13:15:29 | FromDiscord | <NullCode> In reply to @Rika "but its not good": it works if you don't set it to 14 font scaling |
13:15:31 | FromDiscord | <dom96> although I do find it funny that it doesn't have a central margin like XChat |
13:15:41 | FromDiscord | <dom96> I remember trying to implement that myself in GTK for my own IRC client |
13:15:50 | FromDiscord | <dom96> and now I'm using Discord without it |
13:15:56 | FromDiscord | <NullCode> lmao |
13:17:10 | PMunch | Yeah those nicks being all over the place isn't great |
13:17:23 | FromDiscord | <NullCode> yeah |
13:17:32 | PMunch | I kinda want to create an IRC client that allows you to apply custom parsers to nicks |
13:17:52 | PMunch | So I could pull out the <dom96> part of the FromDiscord bot message and use that as the nick |
13:18:46 | FromDiscord | <dom96> you can easily do that with an XChat plugin |
13:18:56 | FromDiscord | <dom96> (and I'm guessing other IRC clients support it too) |
13:18:58 | FromDiscord | <NullCode> aight so what irc webclient should i use |
13:19:04 | FromDiscord | <dom96> wouldn't be surprised if plugins exist for this already |
13:20:05 | * | happycorsair[m] quit (Read error: Connection reset by peer) |
13:20:08 | * | nixfreak_nim[m]1 quit (Read error: Connection reset by peer) |
13:20:08 | * | Theodore[m] quit (Read error: Connection reset by peer) |
13:21:02 | FromDiscord | <tandy> use element.io with libera chat \:&)↵(@NullCode) |
13:21:34 | FromDiscord | <NullCode> oh i use element for matrix |
13:21:39 | FromDiscord | <NullCode> it has irc too? |
13:22:25 | * | nixfreak_nim[m] joined #nim |
13:23:11 | FromDiscord | <Yardanico> @NullCode matrix has had a network-wide IRC bridge for a long time (so Matrix people appear as `Nick[m]` in IRC and IRC people appear as `Nick` in Matrix) |
13:23:18 | FromDiscord | <Yardanico> and after the freenode stuff they switched the bridge to libera.chat |
13:23:20 | * | rockcavera joined #nim |
13:23:20 | * | rockcavera quit (Changing host) |
13:23:20 | * | rockcavera joined #nim |
13:23:22 | * | happycorsair[m] joined #nim |
13:23:34 | * | Theodore[m] joined #nim |
13:24:12 | FromDiscord | <Yardanico> ah actually they have multiple, yes |
13:24:28 | FromDiscord | <NullCode> oh |
13:24:39 | FromDiscord | <NullCode> so tandy's telling me to just use matrix? |
13:24:54 | FromDiscord | <Yardanico> yes |
13:24:59 | FromDiscord | <tandy> yes heheh |
13:41:39 | PMunch | Hmm XChat looks suspiciously much like HexChat |
13:41:57 | PMunch | Ah "HexChat is an IRC client based on XChat" |
13:42:04 | * | krux02 quit (Remote host closed the connection) |
13:42:10 | FromDiscord | <dom96> indeed |
13:42:23 | * | krux02 joined #nim |
13:42:31 | PMunch | Hmm, apparently it is highly scriptable |
13:42:50 | PMunch | I guess I can just write a plug-in to HexChat then if it doesn't exist yet |
13:50:59 | PMunch | Hmm, can't find one |
13:51:27 | PMunch | Maybe this is what I should stream. Using Futhark to wrap the HexChat C plug-in library and create an .so addon that fixes nicks |
13:59:17 | * | krux02 quit (Remote host closed the connection) |
14:04:22 | * | bkay quit (Quit: Leaving) |
14:07:30 | * | PMunch quit (Quit: Leaving) |
14:07:47 | * | PMunch joined #nim |
14:08:17 | PMunch | Think I might've found a plug-in that does it |
14:08:25 | PMunch | Someone from Discord, could you say something? |
14:09:01 | FromDiscord | <dom96> Foo |
14:09:16 | PMunch | Hmm, damn it. Didn't work |
14:11:04 | PMunch | Might've been an incorrect config. Could you try again? |
14:11:29 | FromDiscord | <pointystick> Bar |
14:11:39 | PMunch | Still no luc |
14:11:41 | PMunch | luck* |
14:11:53 | PMunch | Eh, I'll have to look at it later |
14:11:55 | FromDiscord | <Rika> stiww no wuck huh |
14:11:57 | PMunch | gotta go |
14:11:59 | * | PMunch quit (Client Quit) |
14:12:02 | FromDiscord | <Rika> go where |
14:19:25 | FromDiscord | <tandy> lol |
14:34:22 | NimEventer | New Nimble package! futhark - Zero-wrapping C imports in Nim, see https://github.com/PMunch/futhark |
14:34:22 | NimEventer | New Nimble package! chipmunk7 - Bindings for Chipmunk, a fast and lightweight 2D game physics library., see https://github.com/avahe-kellenberger/nim-chipmunk |
14:34:24 | nrds | <R2D299> itHub: 7"Automatic wrapping of C headers in Nim" |
14:34:25 | nrds | <R2D299> itHub: 7"Nim bindings to Chipmunk, a fast and lightweight 2D game physics library" |
14:43:43 | FromDiscord | <NullCode> whats the best way to convert string to int? |
14:43:56 | FromDiscord | <NullCode> there are 2 modules with parseint |
14:45:34 | FromDiscord | <Rika> whichever fits your needs more |
14:45:38 | FromDiscord | <Rika> one time? strutils |
14:45:44 | FromDiscord | <Rika> for parsing? parseutils |
14:45:48 | FromDiscord | <enthus1ast> the one in parseutils is better when writing a parser imho |
14:46:03 | FromDiscord | <enthus1ast> for normal stuff i use the one in strutils |
14:46:36 | FromDiscord | <enthus1ast> its better for parsers because it hase the same interface as the other procs from parseutils |
14:46:42 | FromDiscord | <NullCode> oh i just wanted to convert a tainted str to int |
14:46:47 | FromDiscord | <NullCode> ill just go with strutils then |
14:47:00 | FromDiscord | <Rika> taint mode is deprecated |
14:47:15 | FromDiscord | <NullCode> execCmdEx still does it idk |
14:47:35 | FromDiscord | <NullCode> osproc modul |
14:47:37 | FromDiscord | <NullCode> (edit) "modul" => "module" |
14:48:07 | FromDiscord | <NullCode> dishes out a taintedstr instead of str |
14:48:34 | FromDiscord | <Yardanico> In reply to @NullCode "dishes out a taintedstr": TaintedString is just string |
14:48:40 | FromDiscord | <Yardanico> unless you use taintMode which is deprecated |
14:49:01 | FromDiscord | <NullCode> what does this tainted mode do tho |
14:49:23 | FromDiscord | <Yardanico> it forces you to handle strings from external sources properly |
14:49:26 | FromDiscord | <Rika> nothing that matters now |
14:49:29 | FromDiscord | <Yardanico> but yeah |
14:49:43 | FromDiscord | <NullCode> aight got it |
14:51:06 | FromDiscord | <enthus1ast> i actually liked the idea of tainted string, but in practice i was just converting them to str all the time \:) |
15:11:13 | FromDiscord | <gerwy> Hi hmm i tried using nimx, i wanted to try samples that they are and i just cloned the repo and run nake but i always get this error ↵`nimx/nimx/perform_on_main_thread.nim(83, 12) Error: cannot open file: sdl2` |
15:11:46 | FromDiscord | <gerwy> and i do have sdl2 installed |
15:14:04 | FromDiscord | <Yardanico> In reply to @Life Sucks "and i do have": which one |
15:14:21 | FromDiscord | <gerwy> hmm actually i it doesn't import it at all, even in some test script |
15:14:22 | FromDiscord | <gerwy> hmm |
15:14:29 | FromDiscord | <gerwy> In reply to @Yardanico "which one": both↵sdl2 and sdl2_nim |
15:14:36 | FromDiscord | <Yardanico> you can't have "both" |
15:14:39 | FromDiscord | <Yardanico> they overwrite files |
15:14:39 | FromDiscord | <gerwy> oh |
15:14:50 | FromDiscord | <gerwy> so remove the sdl2 and leave sdl2_nim? |
15:15:10 | FromDiscord | <Yardanico> other way |
15:15:27 | FromDiscord | <Yardanico> remove sdl2_nim and reinstall sdl2 |
15:15:33 | FromDiscord | <gerwy> okaay |
15:15:46 | FromDiscord | <Yardanico> and don't forget to run nimble install to install all dependencies - https://github.com/yglukhov/nimx/blob/master/nimx.nimble |
15:16:09 | FromDiscord | <gerwy> In reply to @Yardanico "and don't forget to": yep did that, there is a lot of deps lol |
15:16:13 | FromDiscord | <gerwy> (edit) "is" => "are" |
15:17:30 | FromDiscord | <gerwy> okay after reinstalling it works thaanks :> also a question, because i didn't had luck with web app guis for nim, like neel or nimview, does nimx has ability to do like drag and drop for files?↵or is there a way to have file as input? |
15:19:42 | FromDiscord | <gerwy> doesn't look like it |
15:25:36 | * | neurocyte0132889 joined #nim |
15:25:36 | * | neurocyte0132889 quit (Changing host) |
15:25:36 | * | neurocyte0132889 joined #nim |
15:38:20 | FromDiscord | <FastnFree> Does nim have the ability to run scripts without compiling first? |
15:38:42 | FromDiscord | <Rika> nimscript only |
15:39:08 | FromDiscord | <Rika> or do you mean "without seeing the compiling part" |
15:39:29 | FromDiscord | <enthus1ast> nim r yourScript.nim |
15:39:31 | FromDiscord | <Rika> you can do `nim r <the nim file>` and it'll just compile and run |
15:39:38 | FromDiscord | <Rika> binary wont be in the dir |
15:39:45 | FromDiscord | <Rika> feels like a script |
15:42:30 | FromDiscord | <enthus1ast> and also\:↵↵nim e yourScript.nim |
15:43:02 | FromDiscord | <enthus1ast> r compiles and runs it, e evaluates it with nim vm, but e is limited |
15:49:35 | FromDiscord | <sebbe> Which language does nim compare to |
15:49:41 | FromDiscord | <sebbe> I know it’s a broad question |
15:54:00 | FromDiscord | <gerwy> In reply to @sebbe "Which language does nim": Pascal? If you mean by syntax, or python by some people↵In speed probably around C++, slower than Rust |
15:54:22 | FromDiscord | <Yardanico> "In speed probably around C++, slower than Rust" this is not really a good thing to say |
15:54:27 | FromDiscord | <Yardanico> comparing native language performance is hard |
15:54:30 | FromDiscord | <gerwy> But idk what langs you compare it with, they all have their own goals and they are used in different regions |
15:54:38 | FromDiscord | <Yardanico> they're all in the same ballpark |
15:54:44 | FromDiscord | <Yardanico> c/c++/nim/rust/zig |
15:54:45 | FromDiscord | <Yardanico> etc |
15:55:13 | FromDiscord | <gerwy> In reply to @Yardanico "comparing native language performance": Hehe just to clarify↵Its data from benchmarks↵Obviously real world examples may be different but it all depends on your skill |
15:55:39 | FromDiscord | <Yardanico> what benchmarks specifically? curious to check them out |
15:56:59 | FromDiscord | <gerwy> Hmm i saw one benchmark on github that had a few langs, comparing them in like 4 types of script but i need to find it on my pc and im on my phone now |
15:57:58 | FromDiscord | <gerwy> The other one was public project to try and make counting prime numbers script for popular languages and compare the results, with a lot of data and be able to reproduce it easily |
15:59:22 | FromDiscord | <dom96> Benchmarks are all just a function of how much time the person implementing the benchmark has |
15:59:24 | FromDiscord | <Yardanico> In reply to @Life Sucks "Hmm i saw one": You mean https://github.com/kostya/benchmarks ? Nim there is pretty close to Rust |
15:59:26 | nrds | <R2D299> itHub: 7"Some benchmarks of different languages" |
15:59:46 | FromDiscord | <dom96> A language has an effect on the time it takes to create a solution that wins benchmarks |
15:59:52 | FromDiscord | <dom96> but it always is all down to time |
16:00:02 | FromDiscord | <Yardanico> In reply to @dom96 "Benchmarks are all just": some benchmark repos have pretty strict rules on how benchmarks have to be implemented |
16:00:05 | FromDiscord | <dom96> important to keep that in mind |
16:00:27 | FromDiscord | <dom96> all rules can be bent |
16:00:39 | FromDiscord | <dom96> again, down to how much time the person has to look for ways to bend them 🙂 |
16:01:00 | FromDiscord | <Yardanico> well yeah, some of these benchmarks even in kostya's repo are stupid |
16:01:06 | FromDiscord | <Yardanico> https://github.com/kostya/benchmarks/blob/master/brainfuck/bf.rs |
16:01:15 | FromDiscord | <Yardanico> like wtf is thisd https://media.discordapp.net/attachments/371759389889003532/896064705062387772/unknown.png |
16:01:16 | FromDiscord | <gerwy> In reply to @Yardanico "You mean https://github.com/kostya/benchmarks ?": Yes!↵And the other one is from that video↵https://www.youtube.com/watch?v=tQtFdsEcK_s |
16:01:18 | nrds | <R2D299> outube: 7"E01: What is the FASTEST Computer Language? 45 Languages Tested!" |
16:01:19 | FromDiscord | <Yardanico> (edit) "thisd" => "this" |
16:01:30 | FromDiscord | <Yardanico> normal rust isn't written like that |
16:01:48 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
16:02:09 | FromDiscord | <gerwy> In reply to @dom96 "Benchmarks are all just": Thats why i like the other benchmark because people are allowed to make their own solutions and nim has 3 |
16:03:01 | * | neurocyte0132889 joined #nim |
16:03:01 | * | neurocyte0132889 quit (Changing host) |
16:03:01 | * | neurocyte0132889 joined #nim |
16:03:37 | FromDiscord | <dom96> and what if nobody bothered to spend time on the 3 benchmarks? |
16:03:43 | FromDiscord | <dom96> you'd think Nim was slow |
16:06:23 | FromDiscord | <gerwy> I wouldn't but you can see how high nim is in those benchmarks↵Pretty interesting what you can pump out of it |
16:07:37 | FromDiscord | <dom96> yes, but a lot of it is to do with luck, Nim is lucky to have someone that knows how to write such highly efficient code |
16:07:55 | FromDiscord | <dom96> and I recall that person saying that it can be done in other languages too |
16:08:12 | FromDiscord | <dom96> maybe it's not as easy but it can be done, and then you'll see another language above Nim and think "oh, I guess Nim is slower" |
16:08:25 | FromDiscord | <dom96> and not know that this person spent a month full-time optimising their benchmark |
16:08:28 | FromDiscord | <dom96> vs. 1 week for Nim |
16:09:03 | FromDiscord | <gerwy> I checked Rust's solution source code and compared with Nim's one and well yeah i need to say Rust one looks like it required much less work |
16:09:25 | FromDiscord | <gerwy> And is still a little quicker |
16:10:06 | FromDiscord | <Yardanico> In reply to @dom96 "and not know that": yeah in this case (primes benchmark) I agree |
16:10:21 | FromDiscord | <Yardanico> as I said, generally native languages are in the same ballpark |
16:10:35 | FromDiscord | <dom96> yep |
16:10:36 | FromDiscord | <Yardanico> and for nim this is a big advantage as it feels like a scripting language |
16:13:17 | FromDiscord | <gerwy> Btw can someone on linux help me with this?↵I wanted to use nimqml and i need to have dotherside for that↵The problem is that there are no binaries for dotherside for linux, only for windows↵And i tried to compile it multiple times and always failed, even using their dockerfile.... |
16:13:21 | FromDiscord | <gerwy> https://github.com/filcuc/dotherside |
16:13:23 | nrds | <R2D299> itHub: 7"C language library for creating bindings for the Qt QML language" |
16:13:46 | FromDiscord | <Yardanico> In reply to @Life Sucks "Btw can someone on": how did you compile it? |
16:13:50 | FromDiscord | <Yardanico> it was really easy for me, I can try now again |
16:15:11 | FromDiscord | <IsaacPaul> Yea some benchmarks require you to do x a certain way unless it's builtin like an arena allocator in rust. So of course rust is going to out perform any language where you are not allowed to avoid allocations in the rules. |
16:15:27 | FromDiscord | <gerwy> I mean i just have errors all the time and if anyone could provide me with binary i would be soo thankful |
16:15:44 | FromDiscord | <IsaacPaul> (edit) "any" => "~~any~~ some" |
16:15:45 | FromDiscord | <Yardanico> @gerwy i can provide the binary, but it's much better if you actually fix compilation on your end |
16:15:48 | FromDiscord | <Yardanico> what's the error message? |
16:16:14 | FromDiscord | <IsaacPaul> (edit) "language" => "languages" |
16:16:19 | FromDiscord | <gerwy> Ugh im still on my phone, but i have a history of me ranting that it doesnt work i will look for it, im in store now |
16:16:22 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Bdi |
16:17:16 | FromDiscord | <gerwy> In reply to @Yardanico "The build process is": Of course im not a moron, i always check for building instructions and do them exactly like they say ↵I think it was something with cmake |
16:17:23 | FromDiscord | <Yardanico> Of course you need Qt installed (with dev libraries), the compiler environment, and cmake itself |
16:17:34 | FromDiscord | <Yardanico> what distro are you on? |
16:21:17 | FromDiscord | <gerwy> I have Qt installed i thought it could be the problem too |
16:21:28 | FromDiscord | <gerwy> In reply to @Yardanico "what distro are you": PopOS, so basically Ubuntu |
16:21:31 | FromDiscord | <Yardanico> not just Qt, but Qt with development libraries |
16:21:45 | FromDiscord | <Yardanico> debian-based distros have separate packages for binaries and headers (for development) of packages |
16:22:08 | FromDiscord | <Yardanico> So yeah, when you get home, try `sudo apt-get install qtbase5-dev` and compiling again |
16:23:02 | FromDiscord | <Yardanico> Also might need `qtdeclarative5-dev` |
16:23:16 | FromDiscord | <gerwy> In reply to @Yardanico "not just Qt, but": Yeah, the one with -dev suffix |
16:23:30 | FromDiscord | <gerwy> In reply to @Yardanico "So yeah, when you": I will try thanks ! |
16:23:41 | FromDiscord | <gerwy> In reply to @Yardanico "Also might need `qtdeclarative5-dev`": Thats more likely for me |
16:25:18 | * | neurocyte0132889 quit (Ping timeout: 260 seconds) |
16:32:54 | FromDiscord | <gerwy> Oh btw i found my rant about it and what didnt worked |
16:32:58 | FromDiscord | <gerwy> Can i paste it? |
16:33:14 | FromDiscord | <gerwy> Or screenshot it |
16:34:05 | FromDiscord | <Yardanico> sure |
16:36:07 | FromDiscord | <gerwy> https://media.discordapp.net/attachments/371759389889003532/896073481328930876/Screenshot_2021-10-08-18-35-58-20.jpg |
16:40:35 | FromDiscord | <gerwy> So can be qt lib i guess |
16:40:45 | FromDiscord | <gerwy> (edit) "So can be qt ... lib" added "dev" |
16:41:09 | nixfreak_nim[m] | is there a js backend repl for nim ? |
16:44:47 | FromDiscord | <Rika> no |
16:48:07 | * | jjido joined #nim |
16:49:39 | nixfreak_nim[m] | ok thanks |
17:00:46 | FromDiscord | <Yardanico> In reply to @Life Sucks "": you need to install qtbase-dev itself for this command, yeah |
17:01:10 | FromDiscord | <gerwy> i installed qtdeclarative5-dev and it failed to cmake |
17:01:16 | FromDiscord | <gerwy> installing qtbase-dev now |
17:01:55 | FromDiscord | <gerwy> already installed |
17:02:08 | FromDiscord | <Yardanico> qtbase5-dev ? |
17:02:14 | FromDiscord | <gerwy> qtbase5-dev yeah |
17:02:23 | FromDiscord | <gerwy> so i guess its not that |
17:02:27 | FromDiscord | <gerwy> but i found something |
17:02:38 | FromDiscord | <Yardanico> can you show a screenshot of full error message |
17:02:47 | FromDiscord | <Yardanico> also yeah, you need to remove the cmake files so it's not cached |
17:02:49 | FromDiscord | <gerwy> it has github workflows and there is linux section, there are packages that this CI uses |
17:02:59 | FromDiscord | <gerwy> `sudo apt-get install -y build-essential cmake qt5-default qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev qml-module-qtquick2 qml-module-qtquick-controls2 qml-module-qtquick-window2 xvfb lcov ` |
17:03:18 | FromDiscord | <Yardanico> try this I guess, but you don't need xvfb |
17:03:27 | FromDiscord | <Yardanico> i assume you also already have build-essential installed |
17:04:06 | FromDiscord | <gerwy> okay trying to install them |
17:04:22 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:04:27 | FromDiscord | <gerwy> cmake without any errors 😳 |
17:04:50 | FromDiscord | <gerwy> unless it used the previous one, i will delete everything in dir and try again |
17:05:34 | FromDiscord | <gerwy> 😳 |
17:06:33 | FromDiscord | <gerwy> okay i did everything |
17:06:56 | FromDiscord | <gerwy> and it looks like it works... i mean it built and installed |
17:08:06 | FromDiscord | <gerwy> so i guess it was that↵thanks Yardanico! idk what i would do without you<3 and i wish this line of deps will be helpful for someone who will work with dotherside, because why put those deps in readme :) when you can hide them in CI |
17:15:12 | FromDiscord | <gerwy> okay i think everything is now good, it don't want to load a lib but its sure is just i didn't included it in PATH |
17:22:21 | FromDiscord | <gerwy> okay no i still have a problem |
17:34:31 | * | FonderElite quit (Ping timeout: 256 seconds) |
17:35:45 | FromDiscord | <IsaacPaul> In reply to @Life Sucks "so i guess it": Wait until you run into tools that only use CI for builds and have 0 support for doing it yourself. xD |
17:41:49 | FromDiscord | <gerwy> i made it work :DDD↵it was a lot of pain, installing Qt modules, searching for them but i made it work |
17:42:21 | FromDiscord | <NullCode> In reply to @IsaacPaul "Wait until you run": lmfao ikr |
17:43:00 | FromDiscord | <gerwy> now my only problems are↵-How to link libs statically, because i want to take the binary with me without needing libs↵-How to compile to Windows and compile it statically (fortunately i don't think to compile it again i think because they distribute dll files, at least i think so) |
17:43:25 | FromDiscord | <Rika> Static compilation is a pain in windows |
17:43:51 | FromDiscord | <gerwy> In reply to @IsaacPaul "Wait until you run": im still amazed that their own dockerfile didn't worked with it xD↵also i think the examples for that repo are so old they used `random()` function instead of `rand()` which i fixed |
17:44:34 | FromDiscord | <gerwy> In reply to @Rika "Static compilation is a": if i will be forced too... can i always do like, copy the .so or dll file into the same directory where binary is and make it use it? |
17:49:29 | FromDiscord | <NullCode> In reply to @Life Sucks "if i will be": yes |
17:49:36 | FromDiscord | <NullCode> but they need to be like |
17:49:40 | FromDiscord | <NullCode> right beside each other |
17:49:44 | FromDiscord | <NullCode> (aka same dir) |
17:49:45 | FromDiscord | <NullCode> to work |
17:49:59 | FromDiscord | <NullCode> I've wanted to static link some stuff myself tbh |
17:50:13 | FromDiscord | <NullCode> but found it was easier to just use pure Nim alternatives |
17:53:55 | FromDiscord | <gerwy> yeah i can have binary in the same dir as lib on windows its not a problem |
17:54:50 | * | neurocyte0132889 joined #nim |
17:56:37 | FromDiscord | <gerwy> but i will in future need to know if i can use it like that |
17:56:47 | FromDiscord | <gerwy> other than that im done thank youuu for your precious time |
18:27:35 | * | max22- quit (Ping timeout: 260 seconds) |
18:48:47 | * | tiorock joined #nim |
18:48:47 | * | tiorock quit (Changing host) |
18:48:47 | * | tiorock joined #nim |
18:48:47 | * | rockcavera is now known as Guest6566 |
18:48:48 | * | Guest6566 quit (Killed (sodium.libera.chat (Nickname regained by services))) |
18:48:48 | * | tiorock is now known as rockcavera |
18:56:49 | * | max22- joined #nim |
19:02:29 | * | vicfred joined #nim |
19:17:17 | * | PMunch joined #nim |
19:28:16 | * | kayabaNerve quit (Remote host closed the connection) |
19:28:34 | * | kayabaNerve joined #nim |
19:50:58 | * | Gustavo6046 quit (Remote host closed the connection) |
19:51:25 | * | Gustavo6046 joined #nim |
20:20:59 | FromDiscord | <DMisener> sent a code paste, see https://play.nim-lang.org/#ix=3Beq |
20:33:15 | FromDiscord | <auxym> You need to create your nodes as `NodeRef` rather than `Node` |
20:34:23 | FromDiscord | <auxym> You can't create a ref to an existing value type |
20:40:17 | FromDiscord | <DMisener> Thanks.. I’ll give that as a try… seems like a shame that such a conversion or idiomatic scheme is not available. Would you happen to know why? |
20:40:48 | FromDiscord | <DMisener> (edit) removed "as" |
21:03:10 | FromDiscord | <Elegantbeef> It's simple memory allocation @DMisener Nodes are stack allocated so if you make a reference to them and they go out of scope you've now got either nil or pointers pointing at bad memory |
21:03:30 | FromDiscord | <Elegantbeef> But if you use reference nodes, you now have heap allocated objects which are not reliant on the scope state to be valid |
21:04:09 | * | PMunch quit (Quit: leaving) |
21:04:13 | FromDiscord | <Elegantbeef> If you know it's safe to use pointers you can do `ptr Node` and `link = node1.addr` but that's only if you know it's actually safe |
21:04:50 | NimEventer | New post on r/nim by zemja_: What's the point in `ref object`?, see https://reddit.com/r/nim/comments/q46sc5/whats_the_point_in_ref_object/ |
21:07:04 | FromDiscord | <DMisener> Are all local var stored on the stack ... and is it safe to assume their lifetime will last until the exit of the proc stack frame?? |
21:07:21 | FromDiscord | <haxscramper> They have a point about function argument mutability↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>) |
21:08:02 | FromDiscord | <Elegantbeef> I think it's generally safe to assume all that |
21:09:06 | FromDiscord | <Elegantbeef> They have some sort of point, but given strict funcs and what a mutable ref is i dont follow |
21:10:34 | FromDiscord | <haxscramper> If you don't enable strict funcs ref argument can be either mutable or not |
21:10:46 | FromDiscord | <haxscramper> And strict funcs are experimental |
21:11:06 | FromDiscord | <haxscramper> So I'm pretty sure they don't know about it, and even if they do this still makes code unclear |
21:11:06 | FromDiscord | <Elegantbeef> The reference isnt mutable, what it points to is |
21:11:16 | FromDiscord | <Elegantbeef> Which is what i meant |
21:12:34 | FromDiscord | <haxscramper> Strict funcs turn this upside down anyway, but I guess that's how nim's version of constT vs const T looks like |
21:12:52 | FromDiscord | <Elegantbeef> But anywho my oddities aside, someone should provide a nice comment 😛 |
21:13:06 | FromDiscord | <haxscramper> Rtfm |
21:13:31 | FromDiscord | <Elegantbeef> There's that heart warming attitude we've grown to expect 🙂 |
21:13:59 | FromDiscord | <haxscramper> This is the best advice I can come up, at least considering long-term effects |
21:32:28 | FromDiscord | <DMisener> In reply to @NimEventer "New post on r/nim": Re: New post on r/nim by zemja_: What's the point in ref object?, see https://reddit.com/r/nim/comments/q46sc5/whats_the_point_in_ref_object/↵↵Same basic question as I had... but not replies/comments yet 😦 |
21:33:26 | FromDiscord | <DMisener> (edit) "not" => "no" |
21:35:03 | * | xet7 quit (Remote host closed the connection) |
21:36:02 | * | xet7 joined #nim |
21:59:29 | * | vicfred quit (Ping timeout: 245 seconds) |
22:03:22 | FromDiscord | <auxym> I find ref objects mostly useful to model many-to-one relationships, where you want many objects to hold a reference to a given object |
22:05:04 | FromDiscord | <auxym> If you're used to java/python/etc, everything there is a ref (or almost), so you can use ref objects everywhere if you want to replicate this behavior. |
22:05:33 | FromDiscord | <auxym> Thus nim's OOP features (inheritance, methods) are based on ref objects |
22:27:58 | * | max22- quit (Quit: Leaving) |
22:49:11 | * | resumin joined #nim |
22:49:52 | * | resumin quit (Read error: Connection reset by peer) |
23:58:39 | * | Gustavo6046 quit (Remote host closed the connection) |
23:58:59 | * | Gustavo6046 joined #nim |