00:08:10 | * | hexeme is now known as ldlework |
00:42:00 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:45:50 | * | GnuYawk quit (Quit: GnuYawk) |
00:46:13 | * | GnuYawk joined #nim |
01:05:30 | FromDiscord | <Isofruit> Happy new year! |
01:06:02 | FromDiscord | <Isofruit> So on the one hand, I finished celebrating with the fam, it's like 2 am, I'm on a mildly fucked up sleep cycle because I overdid it yesterday and I've written up a response on a github issue |
01:06:19 | FromDiscord | <Isofruit> On the other, that would be posting a response to a github issue at 2 am on new years |
01:06:41 | FromDiscord | <Isofruit> Life choices are difficult |
01:07:37 | FromDiscord | <Elegantbeef> It's not 2am everywhere 😜 |
01:08:50 | FromDiscord | <Isofruit> Ah yes, the good old "It's always 4pm somewhere"-excuse! |
01:09:47 | FromDiscord | <Isofruit> Well, to be fair, what might be seen as weird is the fact that this issue did not let my brain go until I wrote up a response, even on new years eve, less the posting of it. So given that, I already did the weird thing, not much saving now other than pretending ... 😐 |
01:26:18 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
01:41:15 | * | noeontheend joined #nim |
01:52:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
02:21:49 | FromDiscord | <macintacos> In reply to @leorize "unfortunately testament is one": Following up on this - what’s the tool to use for unit testing in Nim in that case, if it’s not really meant to be used in anything other than the compiler? |
02:22:50 | FromDiscord | <Rika> There’s another package that said it’s deprecated but in reality it isn’t |
02:22:59 | FromDiscord | <Rika> Think it’s called unit test or so |
02:59:39 | FromDiscord | <macintacos> This? https://nim-lang.org/docs/unittest.html |
02:59:52 | FromDiscord | <macintacos> The second section says to use testament lol |
03:01:08 | FromDiscord | <Rika> Again yes it’s really not the case |
03:01:33 | FromDiscord | <Rika> Most people still use it |
03:06:13 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
03:07:14 | FromDiscord | <leorize> https://github.com/disruptek/balls \<- this is a good one to use |
03:07:46 | * | Gustavo6046 joined #nim |
03:08:43 | FromDiscord | <macintacos> Oh that’s nice, I’ll give it a try, thanks! |
03:09:02 | FromDiscord | <huantian> Balls? Balls are good |
03:09:43 | FromDiscord | <macintacos> Lmao |
03:10:25 | FromDiscord | <macintacos> Is there any mocks with this, or perhaps some other lib? (Should probably look around before asking this but I mean might as well 🙂 ) |
03:11:26 | FromDiscord | <macintacos> Rather like, is there a straightforward way to build mocks and all that - coming from pytest I feel like that’s one habit I’ll need to work around 🤔 |
03:16:38 | * | noeontheend joined #nim |
03:24:13 | * | noeontheend quit (Ping timeout: 240 seconds) |
03:25:05 | FromDiscord | <Isofruit> Turns out jsony drops part of your string from `<myCustomType>.toJson()` if `myCustomType` contains a field with a distinct custom DateTime type. Github issue is open.↵Well that's slightly annoying... |
03:25:14 | FromDiscord | <Isofruit> (edit) "annoying..." => "annoying =/" |
03:26:22 | FromDiscord | <Elegantbeef> Did you make a `parseHook` for your custom DateTime? |
03:26:53 | FromDiscord | <Elegantbeef> parse and dump hooks rather |
03:28:52 | FromDiscord | <Isofruit> sent a code paste, see https://paste.rs/dxk |
03:29:22 | FromDiscord | <Elegantbeef> you're doing `s =` not `s.add` |
03:29:26 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3KhR" => "https://play.nim-lang.org/#ix=3KhQ" |
03:30:12 | FromDiscord | <Isofruit> sonofa |
03:30:17 | FromDiscord | <Rika> Lol |
03:31:04 | FromDiscord | <Elegantbeef> Really that should be a distinct `JsonString` so you have to manually convert unless using `add` |
03:31:15 | FromDiscord | <Elegantbeef> Some people just dont use distincts enough |
03:33:33 | FromDiscord | <sOkam!> what's the default size for floats in nim? |
03:33:40 | FromDiscord | <Elegantbeef> `float` is 64bit |
03:34:13 | FromDiscord | <Elegantbeef> That API is very unsafe can nuke or remove values unintentionally |
03:35:03 | FromDiscord | <Elegantbeef> Plus using a distinct means all you'd have to do is `s.add yourString` and it could quote it automatically |
03:36:32 | * | GnuYawk quit (Excess Flood) |
03:37:08 | * | GnuYawk joined #nim |
03:38:33 | FromDiscord | <Isofruit> Wouldn't that still run me into issues with the fact I need that distinct DateTime for getting my DateTime data out of my sqlite db with norm? |
03:38:57 | FromDiscord | <Elegantbeef> Did you read my comments |
03:39:02 | FromDiscord | <Elegantbeef> It's all about the json hook's unsafety |
03:39:29 | FromDiscord | <Elegantbeef> I was suggesting a `type JsonString = distinct string` for the jsony hook API |
03:40:01 | FromDiscord | <Isofruit> Ohhhh, I read but there's the distinct barrier between "word in" and "word comprehend" |
03:40:06 | FromDiscord | <Elegantbeef> Which would've solved this problem before you even faced it since the compiler would've said "you're attempting to assign a string to a JsonString" |
03:40:15 | * | noeontheend joined #nim |
03:41:26 | FromDiscord | <Elegantbeef> Basically it'd prevent this error from ever happening unless you went `s = JsonString(yourString)` 😛 |
03:42:28 | FromDiscord | <sOkam!> In reply to @Elegantbeef "`float` is 64bit": do you know if there's fixed point floats implemented?↵or is that an external library required thing? |
03:42:39 | FromDiscord | <sOkam!> (edit) "floats" => "arithmetic" |
03:42:58 | FromDiscord | <Elegantbeef> https://nimble.directory/search?query=fixed+point there is no fixed point in the stdlib iirc |
03:44:47 | FromDiscord | <sOkam!> oh nice, its a libfixmath wrapper |
03:45:28 | FromDiscord | <IsaacPaul> There is also https://gist.github.com/planetis-m/c13529cac44b4a9de3f073de502315ee |
03:45:57 | FromDiscord | <IsaacPaul> I haven't add any time to compare and contrast them tho |
03:46:31 | FromDiscord | <IsaacPaul> (edit) "I haven't add any time to compare and contrast them tho ... " added "(so no recommendations)" |
03:50:31 | FromDiscord | <Isofruit> In reply to @Elegantbeef "Basically it'd prevent this": I'll take this as another very clear sign I've been awake too long, sleep once more.↵Thanks for the explanation! |
03:50:52 | FromDiscord | <Elegantbeef> No problem |
03:51:02 | FromDiscord | <Elegantbeef> I heavily abuse distinct so it's almost always my solution 😛 |
03:52:29 | FromDiscord | <sOkam!> fastmath is very solid. would only need to be extended with a wrapper for 64 and matrices |
03:52:37 | FromDiscord | <sOkam!> (edit) "fastmath is very solid. would only need to be extended with a wrapper for ... 64libs" added "the" | "the64 and matrices ... " added "libs" |
03:52:47 | FromDiscord | <sOkam!> (edit) "fastmath" => "libfixmath" |
03:53:12 | FromDiscord | <sOkam!> the og is really well made |
04:01:53 | * | arkurious quit (Quit: Leaving) |
04:56:37 | * | cornfeedhobo_ is now known as cornfeedhobo |
05:28:14 | * | noeontheend quit (Ping timeout: 260 seconds) |
06:05:37 | NimEventer | New thread by Oyster: My notes on NPOI+Nim, see https://forum.nim-lang.org/t/8758 |
08:39:38 | * | Gustavo6046 quit (Quit: Leaving) |
09:24:17 | * | bkay joined #nim |
09:25:25 | * | beshr quit (Ping timeout: 268 seconds) |
10:02:39 | FromDiscord | <Isofruit> Wait a minute, treeform is in this discord? |
10:02:48 | FromDiscord | <Isofruit> neat! |
10:02:49 | FromDiscord | <Rika> Yes |
10:02:53 | FromDiscord | <Rika> Has been for a long time |
10:09:49 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Kjl |
10:10:22 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3Kjl" => "https://play.nim-lang.org/#ix=3Kjm" |
10:12:20 | FromDiscord | <Solitude> perhaps |
10:15:36 | * | neurocyte0132889 joined #nim |
10:15:36 | * | neurocyte0132889 quit (Changing host) |
10:15:36 | * | neurocyte0132889 joined #nim |
10:58:29 | * | neurocyte0132889 quit (Ping timeout: 252 seconds) |
11:59:40 | * | jjido joined #nim |
12:33:37 | * | rp3 quit (Ping timeout: 240 seconds) |
12:34:26 | * | rp3 joined #nim |
12:39:25 | * | rp3 quit (Ping timeout: 240 seconds) |
12:41:35 | * | rp3 joined #nim |
12:46:27 | FromDiscord | <WhyDee> Hey everyone Im trying to use the following function:↵https://github.com/juancarlospaco/psutil-nim/blob/master/src/psutil/psutil_windows.nim#L324 |
12:49:51 | Amun-Ra | https://github.com/juancarlospaco/psutil-nim/blob/master/src/psutil/psutil_windows.nim#L331-L332 |
12:49:53 | Amun-Ra | heh |
12:50:35 | FromDiscord | <WhyDee> Hey everyone Im trying to use the following function:↵https://github.com/juancarlospaco/psutil-nim/blob/master/src/psutil/psutil_windows.nim#L324↵Get user name who own a process, but get error with LookupAccountSidW https://media.discordapp.net/attachments/371759389889003532/926819693174599690/Screenshot_2022-01-01_144921.png |
12:52:02 | FromDiscord | <WhyDee> In reply to @Amun-Ra "https://github.com/juancarlospaco/psutil-nim/blob/m": I mistakenly sent an unfinished message before, sorry. |
12:53:40 | Amun-Ra | WhyDee: I was just referring to those two lines |
12:54:55 | FromDiscord | <Yardanico> In reply to @WhyDee "Hey everyone Im trying": well, the code is incorrect as the two types aren't compatible, so you have to cast |
12:55:04 | FromDiscord | <Yardanico> i wonder if you need addr here or not though |
12:55:13 | FromDiscord | <Yardanico> ah yeah you do |
12:55:20 | FromDiscord | <Yardanico> i don't know how it worked before (if it ever did) |
12:55:42 | Amun-Ra | WhyDee: I'm not a windows user, check whether casting wcUser to LPWSTR works |
12:56:16 | FromDiscord | <WhyDee> I tried to cast wcUser and wcDomain it didnt solve the problem😩 |
12:57:03 | FromDiscord | <WhyDee> https://media.discordapp.net/attachments/371759389889003532/926821321034305537/unknown.png |
12:57:11 | FromDiscord | <Yardanico> yes, you need addr too |
12:57:22 | FromDiscord | <WhyDee> cast[LPWSTR](wcUser.addr) |
12:57:24 | FromDiscord | <WhyDee> ?? |
12:57:29 | FromDiscord | <Yardanico> yes |
12:57:39 | FromDiscord | <Yardanico> also, what's the reason you want to use that module? |
12:58:39 | Amun-Ra | well, that's why I always hide raw function implementations and use nim types only for function args |
12:58:54 | FromDiscord | <Yardanico> that's exactly that was done there |
12:58:57 | FromDiscord | <Yardanico> the error is inside the function itself |
12:59:04 | FromDiscord | <Yardanico> that code is incorrect, it should've never worked |
12:59:09 | FromDiscord | <Yardanico> idk if it ever did |
12:59:45 | FromDiscord | <Yardanico> they were passing wcUser itself (array of characters) to a Windows API function that expects a pointer to a string (array of characters) to write the username to |
13:01:23 | FromDiscord | <WhyDee> In reply to @Yardanico "the error is inside": Maybe you right I had a similar code that do the same, but I had problem too with the following function so I searched for more implementations |
13:01:34 | FromDiscord | <Yardanico> also why are you trying to use a fork if it doesn't have any new commits? |
13:01:38 | FromDiscord | <Yardanico> it's the same as the base repo which is https://github.com/johnscillieri/psutil-nim |
13:02:50 | FromDiscord | <WhyDee> I can send you my implementation but it also fail with the following function |
13:03:01 | FromDiscord | <Yardanico> so did adding addr fix it or not? |
13:03:13 | FromDiscord | <Yardanico> and please reply to "also, what's the reason you want to use that module?", just curious |
13:03:28 | FromDiscord | <Yardanico> what specific functionality do you want to use? |
13:03:35 | FromDiscord | <WhyDee> In reply to @Yardanico "it's the same as": https://github.com/johnscillieri/psutil-nim/blob/e94c423b78a5fe1806643926a30a7e02d49124d3/doc/windows/functions/try_pid_user.md there is no different, the fork just came first on google haha |
13:04:00 | FromDiscord | <Yardanico> yeah that code is wrong |
13:04:01 | FromDiscord | <WhyDee> In reply to @Yardanico "and please reply to": I can tell you in private channel |
13:04:11 | FromDiscord | <Yardanico> sure, you can DM me then |
13:16:05 | FromDiscord | <apahl> Hi, I have a project in which I want to use two different libraries.↵One uses the cpp backend, because it is a binding to a C++ toolkit, the other uses the c backend.↵Using either cpp or c as backend in my project gives me an error in the library that requires the other backend.↵Is there a way to make this work (other than writing a C wrapper for the C++ toolkit)? |
13:17:15 | FromDiscord | <Yardanico> In reply to @apahl "Hi, I have a": what's the error when you compile with the C++ backend? and can you share the C lib in question? |
13:18:57 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
13:22:01 | FromDiscord | <apahl> sent a long message, see http://ix.io/3Kkl |
13:23:01 | FromDiscord | <apahl> (edit) "http://ix.io/3Kkl" => "http://ix.io/3Kkm" |
13:24:01 | FromDiscord | <apahl> Using either of the two libraries only does work. |
13:25:20 | FromDiscord | <apahl> I should maybe mention the platform as well, this is on Ubuntu Linux. |
13:29:27 | FromDiscord | <Yardanico> yeah, the error is indeed weird, but can you try some stub code just using webview without using your lib? |
13:29:40 | FromDiscord | <Yardanico> i think it will error out with the C backend as well because that error doesn't look C++ specific |
13:30:34 | FromDiscord | <apahl> You mean just using Webview with the cpp backend? Good idea, let me try. |
13:30:43 | FromDiscord | <Yardanico> even with the C backend, just to see if it works |
13:32:08 | FromDiscord | <apahl> Webview with c definitely does work. I tried that before I started. |
13:32:51 | FromDiscord | <apahl> But the strange thing is, just Webview with cpp does also work (just checked), so the problem must lie somewhere else. |
13:33:49 | FromDiscord | <apahl> Thanks for the pointer, that gives me some hope that it's fixable. I even have an idea. It might be related to the modification of LD_LIBRARY_PATH. |
13:34:39 | FromDiscord | <apahl> The modification is needed only for the RDkit part. |
13:37:42 | FromDiscord | <apahl> Yepp, the reason is indeed the LD_LIBRARY_PATH bit. ↵Thank you again, I can work on this. |
13:37:59 | FromDiscord | <Yardanico> no problem, although I didn't really help much :) |
13:43:30 | FromDiscord | <Shiba> new year , new hello world program compiled https://media.discordapp.net/attachments/371759389889003532/926833011373248512/Capture.PNG |
13:43:49 | FromDiscord | <Rika> ? |
13:44:06 | FromDiscord | <Shiba> does quad core make difference |
13:44:12 | FromDiscord | <Yardanico> for the C compilation yes |
13:44:14 | FromDiscord | <Rika> Should for C |
13:44:24 | FromDiscord | <Rika> Fuck you yardanico dammit |
13:44:51 | FromDiscord | <Solitude> no, it wont help |
13:45:13 | FromDiscord | <Yardanico> In reply to @Solitude "no, it wont help": :forsenDespair: |
13:45:27 | FromDiscord | <Shiba> higher frequency? |
13:45:39 | FromDiscord | <Rika> Probably |
13:45:47 | FromDiscord | <Yardanico> In reply to @Shiba "higher frequency?": cores will help as rika said |
13:45:53 | FromDiscord | <Yardanico> frequency too |
13:46:06 | FromDiscord | <Yardanico> but core count won't improve nim speeds while higher freq does |
13:46:09 | FromDiscord | <Yardanico> but again, as I said before, use an SSD |
13:46:17 | FromDiscord | <Yardanico> i think it'll help you more than a faster CPU really |
13:46:22 | FromDiscord | <Solitude> how would it help |
13:46:28 | FromDiscord | <Yardanico> In reply to @Solitude "how would it help": he's using an HDD |
13:46:32 | FromDiscord | <Solitude> and? |
13:46:32 | FromDiscord | <Yardanico> compilation is a lot of small random files |
13:46:34 | FromDiscord | <Shiba> In reply to @Yardanico "but again, as I": i made 200mb hardisk from ram |
13:46:35 | FromDiscord | <Yardanico> IO time is noticeable |
13:46:47 | FromDiscord | <Yardanico> In reply to @Shiba "i made 200mb hardisk": but did you put both nim and the C compiler to it? |
13:46:50 | FromDiscord | <Yardanico> with all the stdlib? |
13:47:09 | FromDiscord | <Yardanico> even if you have your program's code on the ramdisk all standard code still comes from the HDD |
13:47:30 | FromDiscord | <Solitude> In reply to @Yardanico "compilation is a lot": its not a lot of files |
13:47:42 | FromDiscord | <Rika> ?? |
13:47:58 | FromDiscord | <Solitude> compile whatever thing and tell me how many nim files it processed |
13:48:38 | FromDiscord | <Rika> And then how many C files does the C compiler then process |
13:48:51 | FromDiscord | <Solitude> same amount |
13:48:57 | FromDiscord | <Rika> Really |
13:50:06 | FromDiscord | <Yardanico> hm |
13:50:18 | FromDiscord | <Yardanico> yes, solitude is right about the amount of files that are actually compiled |
13:51:21 | FromDiscord | <Yardanico> but nim compiler for example checks all nimble packages directories for imports |
13:51:30 | FromDiscord | <Yardanico> but i guess normal FSes have that in metadata which is contiguous |
13:52:34 | FromDiscord | <Shiba> In reply to @Yardanico "but did you put": yes didnt't change much , and suddently my laprop turned off |
13:52:41 | FromDiscord | <Shiba> (edit) "laprop" => "laptop" |
13:55:09 | FromDiscord | <Shiba> the one iam compiling and doing stuff on it right isn't mine , the one i have is broken (screen) , with an i5 2560M quad core base clock 2.5 ghz boost to 3, ram 6gb DDR3 |
13:55:52 | FromDiscord | <Shiba> and so iam forced to use this pentium until it's fixed |
13:56:04 | FromDiscord | <Shiba> (edit) "and so iam forced to use this pentium ... until" added "laptop" |
13:56:13 | FromDiscord | <Yardanico> In reply to @Shiba "the one iam compiling": but you can just install linux on it and SSH onto it |
13:56:18 | FromDiscord | <Yardanico> or even on windows connect with remote desktop |
13:57:22 | FromDiscord | <Shiba> i guess that will work , iam gonna try that |
14:00:01 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:01:38 | * | jjido joined #nim |
14:02:34 | FromDiscord | <Shiba> i also have a raspberryb pi 3B |
14:02:41 | FromDiscord | <Shiba> (edit) "raspberryb" => "raspberry" |
14:03:21 | FromDiscord | <Yardanico> i doubt it'll be much faster than your pentium CPU |
14:04:00 | FromDiscord | <Shiba> In reply to @Yardanico "i doubt it'll be": dual core 2.13 ghz vs quad core 1.2 ghz ? |
14:04:08 | FromDiscord | <Yardanico> In reply to @Shiba "dual core 2.13 ghz": ARM |
14:04:11 | FromDiscord | <Shiba> ahhh |
14:04:15 | FromDiscord | <Yardanico> frequency doesn't matter by itself |
14:38:50 | FromDiscord | <Isofruit> God I love the fact that you can leverage jsony to save yourself the entire hassle of writing serializers for objects |
14:46:15 | * | arkurious joined #nim |
15:07:20 | FromDiscord | <kaddkaka> sent a long message, see http://ix.io/3Klw |
15:09:23 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:10:13 | * | jjido joined #nim |
15:21:04 | FromDiscord | <deech> Is there an existing flattening template in the standard library? eg. `flatten(1,2,3,@[4,5,6])` => `@[1,2,3,4,5,6]`? |
15:25:16 | FromDiscord | <Solitude> In reply to @kaddkaka "I'm getting my feet": no, because its not a regular procedure, its a compiler magic↵https://github.com/nim-lang/Nim/blob/devel/lib/system/comparisons.nim#L141 |
15:26:09 | FromDiscord | <kaddkaka> In reply to @Solitude "no, because its not": ok 👍 |
15:29:48 | FromDiscord | <el__maco> hold on, how is `{.global.}` supposed to work. I thought it was supposed to be like `static` is in C, you could make locally defined variables that don't live in the local stack frame |
15:30:52 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3Km3 |
15:32:15 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:37:36 | FromDiscord | <el__maco> ok, it seems `--gc:arc` does this. If I remove that from the config it probably isn't initialized every time anymore |
15:37:44 | FromDiscord | <el__maco> what a magnificent footgun? |
15:39:13 | FromDiscord | <el__maco> I only noticed this by chance, because the performance went to crap. Of course it did, because I'm now creating a new frame buffer object every frame instead of reusing 😓 |
15:46:55 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3Kmk |
15:47:24 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kmm |
15:47:50 | FromDiscord | <kaddkaka> (edit) |
15:48:47 | FromDiscord | <el__maco> In reply to @Solitude "does this fit the": I think so yes. That's how I figured out to try without --gc:arc |
15:50:28 | FromDiscord | <Solitude> In reply to @kaddkaka "This function is not": declare them with `const` |
15:51:20 | FromDiscord | <kaddkaka> In reply to @Solitude "declare them with `const`": which one? |
15:51:42 | FromDiscord | <Solitude> the ones that count as sideeffect |
15:52:02 | FromDiscord | <IsaacPaul> > "risking" side effects↵Also rename the functions↵> which one?↵all_numbers obviously |
15:52:09 | FromDiscord | <kaddkaka> In reply to @Solitude "the ones that count": the global state or the local one? |
15:52:10 | FromDiscord | <IsaacPaul> (edit) "functions↵>" => "function↵>" |
15:52:13 | FromDiscord | <Solitude> global |
15:52:18 | FromDiscord | <Solitude> why would local state be a sideeffect |
15:52:29 | FromDiscord | <kaddkaka> hmm |
15:53:10 | FromDiscord | <kaddkaka> I thought `let` already made certain that it's unmodifiable? |
15:54:04 | FromDiscord | <Solitude> yes, its still a sideffect, because result of a function differs because of it at runtime |
15:54:13 | FromDiscord | <kaddkaka> In reply to @IsaacPaul "> "risking" side effects": what name do you want? the function has obvious bogus functionality 😛 |
15:54:45 | FromDiscord | <kaddkaka> In reply to @Solitude "yes, its still a": I don't understand this, what does that mean? |
15:54:55 | FromDiscord | <IsaacPaul> filterBy102030↵filterMagic lol |
15:55:08 | FromDiscord | <IsaacPaul> (edit) "lol" => "lol↵filterByAllNumbers" |
15:56:15 | FromDiscord | <kaddkaka> 🙂 |
15:56:18 | FromDiscord | <kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Kmv |
15:56:21 | FromDiscord | <IsaacPaul> Perfect |
15:57:36 | FromDiscord | <Solitude> In reply to @kaddkaka "I don't understand this,": your function is influenced by global non-static state. so it result between invocations can be different with the same inputs. |
15:59:51 | FromDiscord | <IsaacPaul> `let` allows you to modify the contents of the obj? I may be mistaken tho |
16:00:18 | FromDiscord | <Solitude> no, it doesnt... |
16:01:30 | FromDiscord | <kaddkaka> In reply to @Solitude "your function is influenced": Right, thanks! |
16:01:54 | FromDiscord | <kaddkaka> the description `side-effects` confused me, but perhaps that's the terminology |
16:02:23 | FromDiscord | <Solitude> https://nim-lang.org/docs/manual.html#effect-system-side-effects |
16:02:29 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3KmH |
16:03:00 | FromDiscord | <Solitude> yes, let guards that you dont modify the reference, not contents of dereferenced object |
16:32:19 | * | kayabaNerve joined #nim |
16:49:00 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3KnS |
16:57:29 | FromDiscord | <el__maco> I wonder what is this language construct even called in Nim, which looks like a constructor `var foo=Bar(x:10)` is that an actual function call? What happens if you don't specify any parameters (like I did there previously)? If the variable is declared at the top level, then when does that call/operation get executed? I kinda assumed the top level stuff got executed at the beginning, in the order they appear in the code, but now I'm not |
17:03:46 | * | jjido joined #nim |
17:08:33 | FromDiscord | <Solitude> In reply to @el__maco "I wonder what is": https://nim-lang.org/docs/manual.html#types-object-construction |
17:08:48 | FromDiscord | <Solitude> In reply to @el__maco "I wonder what is": it is executed at the "beginning" |
17:15:09 | FromDiscord | <el__maco> I see, but that doesn't really answer the question. Based on cursory look at generated code, it seems that maybe the constructor syntax isn't a function call maybe. Its kinda hard to read the intermediate code however |
17:16:12 | FromDiscord | <el__maco> its unclear to me what changes if I just declare the object without constructor, or if I invoke a constructor but don't specify any fields to initialize |
17:19:03 | NimEventer | New thread by Arnetheduck: `Result` update, see https://forum.nim-lang.org/t/8759 |
17:23:02 | FromDiscord | <el__maco> seems its the empty "constructor" which wrecks the program. If I specify any fields to initialize, even with zero values, it starts working again |
17:29:31 | FromDiscord | <el__maco> hold on, if I remove the constructor also `{.global.}` seems to start working again |
17:34:00 | FromDiscord | <el__maco> both empty and non-empty constructor breaks the `{.global.}` property, but a variable without a constructor seems to behave |
17:34:56 | FromDiscord | <el__maco> at a global scope the empty constructor seems to wreak havoc |
17:44:17 | FromDiscord | <demotomohiro> Nim initialize everything with zero in default. So object construction without arguments initialize an object with zero. |
17:51:51 | FromDiscord | <enthus1ast> does a try except has a performance impact when the code never excepted ? |
17:53:17 | FromDiscord | <leorize> the cost is that of an `if` |
17:53:30 | FromDiscord | <leorize> at least on `arc` |
17:54:05 | FromDiscord | <enthus1ast> so it might make more sense to try except instead of a table.hasKey ? |
17:54:13 | FromDiscord | <enthus1ast> will benchmark |
17:57:30 | FromDiscord | <enthus1ast> ok no |
17:57:36 | FromDiscord | <enthus1ast> table.hasKey is way faster |
18:10:17 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:14:11 | FromDiscord | <hmmm> you can use table.haskey as a substitute for try except? 🤔 |
18:14:42 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/Q9c |
18:14:44 | FromDiscord | <enthus1ast> stupid example |
18:14:58 | FromDiscord | <enthus1ast> but hasKey is orders of magnitude faster |
18:16:00 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3KpK |
18:16:10 | * | vicecea quit (Remote host closed the connection) |
18:16:41 | * | vicecea joined #nim |
18:17:06 | FromDiscord | <hmmm> hmm |
18:17:17 | FromDiscord | <hmmm> makes sense to me |
18:17:33 | FromDiscord | <hmmm> try except is added machinery on top of the cake 🤔 |
18:19:58 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3KpP |
18:21:15 | FromDiscord | <el__maco> In reply to @demotomohiro "Nim initialize everything with": I know. I'm just wondering why `var foo=Bar()` is busted, and `var foo:Bar` is all good. It would seem to me that both should be the same |
18:26:00 | * | jjido joined #nim |
19:11:17 | NimEventer | New thread by JPLRouge: Good news for the beginning of 2022, see https://forum.nim-lang.org/t/8760 |
19:13:25 | FromDiscord | <Solitude> In reply to @el__maco "I know. I'm just": if you have isolated snippet, you should submit the issue. |
19:14:12 | FromDiscord | <treeform> like enthus1ast, I also have a table perf question, one can add key to a table with `table[k] = v` but if your `v` is a largish object it will have a big copy. That's slow. Is there a way to kind of says "table make me a slot at k and return it" then I can mess with the `k` slot without doing a copy. Some thing like `v = table.init(k)` where `proc init[K, V](t: Table[K, V] , k: K): var V` ? |
19:16:35 | FromDiscord | <el__maco> In reply to @Solitude "if you have isolated": the bug manifests itself in such a random place, isolating a minimal repro case might be very hard sadly |
19:17:16 | FromDiscord | <el__maco> might not be even compiler bug, could be mine too, but its really weird |
19:22:17 | * | bkay quit (Ping timeout: 252 seconds) |
19:24:21 | * | noeontheend joined #nim |
19:28:13 | FromDiscord | <Solitude> In reply to @treeform "like enthus1ast, I also": form that you suggest is not possible in current nim, because assigning to `v` will perform a copy, but you could workaround that with `table.init(k).yourMutatingFunction`. |
19:30:31 | FromDiscord | <konsumlamm> it won't perform a copy when the return type is `var ...`, no? |
19:30:42 | FromDiscord | <Solitude> it will |
19:30:46 | FromDiscord | <Solitude> just tested |
19:30:51 | FromDiscord | <konsumlamm> rip |
19:33:47 | * | beshr joined #nim |
19:34:26 | FromDiscord | <Solitude> it will only not copy with `{.experimental: "views".}` and if you declare `v` as `var v: var V` |
19:42:13 | FromDiscord | <Shiba> i know that we closed the subject of "compile speed" , but iam curious why does chaning a single char in a nim script makes the compiling slower again |
19:42:33 | FromDiscord | <Shiba> (edit) "chaning" => "changing" |
19:43:32 | FromDiscord | <Shiba> (edit) "i know that we closed the subject of "compile speed" , but iam ... curiouson" added "still" | "stillcurious ... why" added "on" |
19:45:46 | FromDiscord | <konsumlamm> depends on the char |
19:46:52 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:14:04 | * | Gustavo6046 joined #nim |
20:24:39 | * | lumo_e joined #nim |
20:44:35 | FromDiscord | <SecureThisShit> Can someone tell me how to echo LPSTR contents? I tried appending it into a string, casting to char, grabbing each char and append them which all failed. |
20:59:52 | * | jjido joined #nim |
21:06:58 | FromDiscord | <0ffh> Does `$` not work? |
21:34:26 | FromDiscord | <kaddkaka> Custom numerical literals are neat 🙂 |
21:35:07 | FromDiscord | <Solitude> yas |
21:37:04 | FromDiscord | <evoalg> In reply to @Shiba "i know that we": large chunks (not all) of the "behind the scenes" stuff will need to be done again |
21:38:40 | * | lumo_e quit (Remote host closed the connection) |
21:39:13 | * | lumo_e joined #nim |
21:40:49 | * | Gustavo6046 quit (Quit: Leaving) |
21:53:27 | * | joast joined #nim |
21:58:05 | * | vicecea quit (Remote host closed the connection) |
21:58:36 | * | vicecea joined #nim |
22:17:25 | * | Gustavo6046 joined #nim |
22:20:10 | FromDiscord | <gibson> Anyone familiar with tcc? I'm making a shared lib for python to load and not sure what all args nim needs to pass. Works with gcc/default.↵`nim c --cc:tcc -t:"-fPIC" -l:"-fPIC -rdynamic" --app:lib -o:pycache/nimfunc.so nimfunc.nim` |
22:20:37 | * | lumo_e quit (Quit: Quit) |
22:21:00 | FromDiscord | <gibson> (edit) "nimfunc.nim`" => "nimfunc.nim`↵python loads the .so and segfaults when so is built with tcc." |
22:29:17 | FromDiscord | <creikey> how scuffed are nim threads on a scale of 1 to 10? |
22:30:55 | FromDiscord | <Elegantbeef> They're abstracted over OS threads and depending on what you're doing super easy to use |
22:30:58 | FromDiscord | <Elegantbeef> Channels are nice in my experience |
22:31:41 | nrds | <Prestige99> Agreed |
22:35:06 | FromDiscord | <Elegantbeef> There is also https://github.com/mratsim/weave |
22:37:31 | FromDiscord | <Elegantbeef> @gibson\: i'm feeling like an idiot cause i cannot get it to even load the `.so` |
22:37:32 | FromDiscord | <Elegantbeef> dynlib sitting in the same directory as i'm working, and it cannot find it even with ld lib path set 😀 |
22:39:31 | FromDiscord | <gibson> @ElegantBeef I'm using nimporter/nimpy. Turns out I can't even get tcc to build an executable, but it will make an o or so file just fine. "Invalid Relocation Entry" errors, that look like repeats of prior bugs in tcc. Still trying to figure out if this is my problem (how I built tcc?...) or a tcc inherent bug. |
22:39:57 | FromDiscord | <Elegantbeef> I'm using TCC from the ubuntu repository and it works fine for making executables |
22:40:31 | FromDiscord | <gibson> I'm jealous! I'm on solus, built it from scratch. Maybe I'll look if the ubuntu package contains build instructions in it.. |
22:41:25 | FromDiscord | <Elegantbeef> I did manually move my lib to my lib folder and did get it to run but had a `cannot find fabs` issue |
22:42:52 | FromDiscord | <Elegantbeef> Oh got it to run now |
22:43:07 | FromDiscord | <Elegantbeef> All i had to do was `nim c --app:lib ./myLibFile` |
22:43:23 | FromDiscord | <Elegantbeef> Still had to move it to `/lib/` but that's just cause i havent used dynlib before |
22:44:12 | FromDiscord | <gibson> Nice! Thanks for the verification that I shouldn't have to add anything crazy. That's a big help. |
22:44:48 | FromDiscord | <Elegantbeef> I guess i left out `--cc:tcc` 😛 |
22:45:03 | FromDiscord | <gibson> Oh, does that work? |
22:45:11 | FromDiscord | <Elegantbeef> Oh compiling the main program with tcc causes a shit fit |
22:45:25 | FromDiscord | <creikey> is there a nim iterator to count the size of an iterator? I can't find one |
22:45:26 | FromDiscord | <Elegantbeef> So the shared lib works with tcc but main lib in my test complains about lack of `fabs` |
22:45:34 | FromDiscord | <creikey> trying to count the number of keys in a loaded json |
22:45:47 | FromDiscord | <Elegantbeef> You'd need to iterate over it and count steps |
22:45:55 | FromDiscord | <creikey> just like that |
22:45:59 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Ksr |
22:46:00 | FromDiscord | <Elegantbeef> `std/enumerate` allows you to take an iterator and add `1` |
22:46:14 | FromDiscord | <Elegantbeef> "add 1" is my dumb way of saying add an index |
22:46:31 | FromDiscord | <Elegantbeef> You could make a `count` template |
22:46:56 | FromDiscord | <creikey> I have to put all of the values of the keys into a seq anyways so might as well just let seq dynamically stretch to the size of the keys necessary |
22:47:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Kss |
22:47:11 | FromDiscord | <creikey> iterate over the keys and using `games.add` |
22:48:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Kst |
22:48:12 | FromDiscord | <creikey> lol sugar |
22:48:16 | FromDiscord | <Elegantbeef> Or even `import std/sequtils` `yourIter.toSeq` |
22:48:38 | * | nac4 joined #nim |
22:48:42 | FromDiscord | <creikey> std/json can already convert the keys into an OrderedTable I think |
22:49:02 | * | noeontheend quit (Ping timeout: 240 seconds) |
22:49:08 | FromDiscord | <creikey> yeah https://media.discordapp.net/attachments/371759389889003532/926970325273554944/unknown.png |
22:49:21 | FromDiscord | <creikey> not sure if ordered table has a count |
22:49:26 | FromDiscord | <creikey> I think just len |
22:49:36 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:49:38 | FromDiscord | <Elegantbeef> Same thing |
22:50:17 | * | nac quit (Ping timeout: 256 seconds) |
22:50:17 | * | nac4 is now known as nac |
22:50:28 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Ksu |
22:50:56 | FromDiscord | <Elegantbeef> Templates in Nim are hygenic which means they only emit accessible variables when you tell theem |
22:51:35 | FromDiscord | <Isofruit> Ohhh alright, so if I give a template an output type, I can... do result = lalala and that template will return "lalala" as if it were a proc? |
22:51:40 | FromDiscord | <Isofruit> (edit) "lalala" => ""lalala"" |
22:51:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ksw |
22:52:00 | FromDiscord | <Isofruit> Ah! Inject pragma I see you once more! |
22:52:06 | FromDiscord | <Elegantbeef> No templates do not have a `result` hence why i use create `res` manually |
22:52:41 | FromDiscord | <Isofruit> What does the type that you put at the end of the template do, given that it's not a result? |
22:52:49 | FromDiscord | <Isofruit> the int in this case |
22:53:59 | * | noeontheend joined #nim |
22:54:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ksy |
22:55:29 | * | thomasross joined #nim |
22:58:02 | * | thomasross quit (Remote host closed the connection) |
22:58:26 | * | thomasross joined #nim |
22:58:27 | * | noeontheend quit (Remote host closed the connection) |
23:00:53 | * | noeontheend joined #nim |
23:01:51 | FromDiscord | <Isofruit> sent a code paste, see https://paste.rs/Pqu |
23:02:04 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3KsD" => "https://play.nim-lang.org/#ix=3KsE" |
23:02:07 | FromDiscord | <Elegantbeef> Yep you can even do `--expandMacro:count` |
23:02:10 | * | noeontheend quit (Remote host closed the connection) |
23:02:18 | FromDiscord | <Elegantbeef> actually no |
23:02:36 | FromDiscord | <creikey> the word macro shivers my timbers |
23:02:36 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3KsE" => "https://play.nim-lang.org/#ix=3KsH" |
23:02:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/rNa |
23:02:48 | FromDiscord | <Elegantbeef> Eh i love macros so take it back |
23:03:46 | FromDiscord | <Isofruit> I can't really interpret the above unless I assume the part after `let x = ` executes as if it were in a proc, just that the way you return out of it is different |
23:04:19 | FromDiscord | <Elegantbeef> In Nim "everything" can be an expression |
23:04:33 | FromDiscord | <Isofruit> Ohhhh |
23:04:34 | FromDiscord | <Elegantbeef> For instance |
23:04:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3KsK |
23:04:41 | FromDiscord | <Isofruit> So it reads the entire code block as if it were an expression |
23:04:58 | FromDiscord | <Elegantbeef> Well it is one |
23:05:04 | FromDiscord | <Isofruit> Which means the last value in that code block is what that expression evaluates into |
23:05:18 | FromDiscord | <Elegantbeef> Yes |
23:06:14 | FromDiscord | <Isofruit> Hmmm and I can't use functions from outside of the template inside of the template if I understood documentation correctly so far |
23:06:40 | FromDiscord | <Elegantbeef> You can call functions in the templater |
23:06:42 | FromDiscord | <Elegantbeef> template\ |
23:07:20 | FromDiscord | <Elegantbeef> Templates are just code substitution so you can do a lot with them |
23:08:25 | FromDiscord | <creikey> https://docs.python.org/3/library/collections.html#collections.Counter Is there anything like this? |
23:08:29 | FromDiscord | <creikey> (edit) "this?" => "this in nim std?" |
23:08:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3KsO |
23:09:30 | FromDiscord | <Isofruit> Assume showcaseMagic is in file a.nim and doThing is in file b.nim and the assert statement is in file c.nim |
23:09:31 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tables.html#CountTable |
23:09:40 | FromDiscord | <creikey> In reply to @Elegantbeef "https://nim-lang.org/docs/tables.html#CountTable": nice |
23:09:41 | FromDiscord | <Isofruit> c.nim needs to import a.nim and b.nim and that#s it? |
23:10:00 | FromDiscord | <Elegantbeef> The point is that `doThing` is written after the template and resolved at `showcaseMagic()` |
23:10:15 | FromDiscord | <Elegantbeef> Which means you can override the logic at callsite unlike generics |
23:11:07 | FromDiscord | <Elegantbeef> Generics generate code on first instantiation so if you have a `proc showcaseMagic[T]` instead of the template when i first call `showcaseMagic[string]` any place that calls that procedure will get the same proc call |
23:11:13 | FromDiscord | <Elegantbeef> It makes sense but depending what you're doing it's odd |
23:13:05 | FromDiscord | <Isofruit> I've been trying to abstract away my interactions with my database through norm into a repository module and wanted to generalize that since I'll have very similar CRUD interactions where the only thing differes is the types I use.↵Generics had some weird behaviour that I didn't expect regarding what I needed to import where, so I'm trying to figure out whether I can make it work with templates, hmmmm |
23:14:44 | FromDiscord | <Isofruit> I think I've got enough of a grasp to play around with some code concepts, see them fail and then think about why they failed, so I'll be tackling that for now |
23:14:51 | FromDiscord | <Isofruit> (edit) "I think I've got enough of a grasp ... to" added "now" |
23:16:35 | FromDiscord | <Elegantbeef> Eh you can use `mixin` and `bind` with generics aswell |
23:16:49 | FromDiscord | <Elegantbeef> So you probably just need to plop a `mixin` in your generic |
23:17:09 | FromDiscord | <evoalg> In reply to @Elegantbeef "Generics generate code on": I don't understand this bit ... are you saying templates are always substituted into code at compile time, but generics are expanded to different proc's at CT ? |
23:17:55 | FromDiscord | <Elegantbeef> Well once the first proc is generated for a generic it's used for all instances of the generic regardless of the scope |
23:19:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3KsS |
23:20:09 | FromDiscord | <Elegantbeef> the call in `modb` is the same as the on in `moda` regardless of the `doThing` since the first instantiation of a generic is the one always used |
23:20:50 | FromDiscord | <evoalg> oh gotcha thx! |
23:20:53 | FromDiscord | <Elegantbeef> generics are only generate based of scope of the first instantiation |
23:20:54 | FromDiscord | <Elegantbeef> But if you replaced that with a template it'd call the `doThing` in scope |
23:21:27 | FromDiscord | <evoalg> nice 🙂 🙂 |
23:25:20 | FromDiscord | <kaddkaka> sent a long message, see https://paste.rs/oTk |
23:25:34 | FromDiscord | <Elegantbeef> There is sadly no `all` |
23:26:11 | FromDiscord | <kaddkaka> In reply to @Elegantbeef "There is sadly no": Sure, I'm not even sure if `all` would make sense. |
23:26:12 | FromDiscord | <Elegantbeef> Distincts i think are exactly what you're after you can make this easier on yourself though |
23:27:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Kt3 |
23:27:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Kt4 |
23:28:06 | FromDiscord | <Isofruit> OH! Man that took a while until I understand between your comment and the docu what mixin is |
23:28:36 | FromDiscord | <Elegantbeef> The simple description is "Mixin forces symbols to be resolved at callsite instead of declaration" |
23:28:41 | FromDiscord | <Isofruit> So mixin tells it "Ignore the fact that within the file that this generic is in you don't know what this function/variable means, that'll be available from the context of whatever function will call you" |
23:29:07 | FromDiscord | <Elegantbeef> It does also consider any symbol accessible in the scope of the generic if it matches, but indeed |
23:29:18 | FromDiscord | <Elegantbeef> It's a "forced open symbol" which means it'll figure it out when it needs to |
23:30:20 | FromDiscord | <Isofruit> Could it be that this comes at a performance penalty? |
23:30:26 | FromDiscord | <Elegantbeef> Nope |
23:30:33 | FromDiscord | <Elegantbeef> it's all compile time reasoned |
23:30:40 | FromDiscord | <Elegantbeef> Nim's procedure calls are all statically dispatched |
23:31:09 | FromDiscord | <Isofruit> Right, right, I'm not doing methods, so no dynamic dispatch |
23:31:17 | FromDiscord | <Elegantbeef> Indeed |
23:31:17 | FromDiscord | <kaddkaka> sent a code paste, see https://paste.rs/EXc |
23:31:19 | FromDiscord | <Elegantbeef> No problem |
23:32:31 | FromDiscord | <Isofruit> for my own import reasoning as well:↵NIm only does relative imports of other modules, right?↵I've seen a SO answer that claimed you can also give absolute paths, but I've tried all variations of that that I could think of in one of my files and that did not work whatsoever |
23:32:45 | FromDiscord | <Elegantbeef> It does relative yes |
23:33:20 | FromDiscord | <Elegantbeef> no problem, templates solve many problems! 😀↵(@kaddkaka) |
23:33:48 | FromDiscord | <Elegantbeef> If your code is in a package and it's installed using nimble you can do it relative to the package root↵(@Isofruit) |
23:34:13 | FromDiscord | <Elegantbeef> So `import yourPackage/someDir/module` |
23:35:47 | FromDiscord | <creikey> hey uh I ctrl cd `nim r` mid running and now I can't delete a file in the nim cache because it's "still open" |
23:35:53 | FromDiscord | <creikey> (edit) "hey uh I ctrl cd `nim r` mid running and now I can't delete a file in the nim cache because it's "still open" ... " added "so nothing will compile" |
23:36:00 | FromDiscord | <creikey> (edit) "cd" => "c" |
23:36:54 | FromDiscord | <Elegantbeef> `killall -9 nim` if you're on \nix |
23:37:11 | FromDiscord | <Isofruit> First as a sidenote:↵Mixins solved my initial problem, which means I've resolved my silly import issue in that regard |
23:37:20 | FromDiscord | <Elegantbeef> Nice |
23:37:46 | FromDiscord | <Isofruit> Regarding imports... I'll need to setup a test project, It's not giving me absolute import paths whatsoever so I'm convinced it's something dumb on my end |
23:37:53 | FromDiscord | <creikey> In reply to @Elegantbeef "`killall -9 nim` if": back and fixed it had to restart windwos |
23:37:55 | FromDiscord | <creikey> (edit) "windwos" => "windows" |
23:38:15 | FromDiscord | <Elegantbeef> Ah |
23:38:19 | FromDiscord | <Elegantbeef> Figured it was winblows 😛 |
23:38:41 | FromDiscord | <Elegantbeef> is your package `nimble develop`'d?↵(@Isofruit) |
23:38:52 | FromDiscord | <Elegantbeef> Atleast assuming you want absolute to the root |
23:39:17 | FromDiscord | <Isofruit> I... err I executed `nimble init nimstoryfont` |
23:39:38 | FromDiscord | <Elegantbeef> Yea that still doesnt throw it in your package list |
23:39:39 | FromDiscord | <Isofruit> which gave me a binary-executing project in a folder "nimstoryfont" with a src folder and a `nimstoryfont.nim` file |
23:39:59 | FromDiscord | <Elegantbeef> `nimble develop` currently symlinks it to your package registry |
23:39:59 | FromDiscord | <Elegantbeef> Which means it's "installed" |
23:40:17 | FromDiscord | <Isofruit> I read from the SO answer that "relative to main package" is possible, I just never "got" how it determines the main package |
23:40:47 | FromDiscord | <Isofruit> Anyway, I'll try the nimble develop way, I think that'll make my life significantly easier |
23:41:30 | FromDiscord | <Elegantbeef> It should indeed |
23:41:59 | FromDiscord | <Isofruit> Ah, nimble develop doesn't really do it for you if you want to go for a binary, does it? |
23:42:19 | FromDiscord | <Isofruit> > Tip: 1 messages have been suppressed, use --verbose to show them.↵> Error: Cannot develop packages that are binaries only. |
23:42:27 | FromDiscord | <Elegantbeef> I guess not |
23:43:29 | FromDiscord | <Elegantbeef> So i guess relative paths for you |
23:43:40 | FromDiscord | <Isofruit> Living the relative life |
23:44:15 | FromDiscord | <Elegantbeef> Actually if you add a `config.nims` with `switch("path", "$projectDir/../src")` it should work |
23:44:19 | FromDiscord | <Isofruit> Ohhhh and with `bind` I can go into my generic and bind a function from another package there so I don't have to import that package everywhere I go |
23:44:27 | FromDiscord | <Elegantbeef> Indeed |
23:44:34 | FromDiscord | <Elegantbeef> Welcome to generic control! |
23:44:58 | FromDiscord | <Elegantbeef> I could be wrong about it working |
23:45:03 | FromDiscord | <Isofruit> Is there a best practice whether to write mixin at the top of a function or directly before it's being used? |
23:45:29 | FromDiscord | <Elegantbeef> No clue really, it's not a common thing to see 😀 |
23:45:46 | FromDiscord | <Isofruit> I'm busy enough comprehending what's all happening and resolving that in my head, I'm running into a wall trying to contemplate what would be the most "readable" |
23:46:14 | FromDiscord | <Elegantbeef> I think at the top, might make the most sense as you can see what's getting mixin'd/bind'd |
23:46:25 | FromDiscord | <Isofruit> Yeh, makes sense to me |