00:00:17 | * | tk quit (Quit: Well, this is unexpected.) |
00:00:42 | * | tk joined #nim |
00:04:22 | FromDiscord | <m4ul3r> til that godbolt supported nim, very cool |
00:06:51 | Amun-Ra | https://www.youtube.com/watch?v=kBAMtM5xNkM |
00:06:53 | Amun-Ra | ah, sorry |
00:07:05 | Amun-Ra | wrong window, not nim related |
00:07:39 | FromDiscord | <Elegantbeef> Interesting video selection 😛 |
00:08:39 | Amun-Ra | that was something I was going to add to my to watch list but messed up the dest. tab |
00:13:51 | Amun-Ra | hmm, I guess I've found a bug in nim compiler |
00:15:02 | FromDiscord | <Elegantbeef> Hey i love nim compiler bugs |
00:16:14 | Amun-Ra | it's my third one, now I have to force myself to make a test case |
00:16:28 | FromDiscord | <Elegantbeef> Well i'll take a look at it if it's not too complex |
00:17:01 | Amun-Ra | it popped in a quite large project |
00:18:48 | FromDiscord | <Elegantbeef> What's it related to? |
00:19:16 | Amun-Ra | function pointers set to nil in const objects |
00:21:20 | * | Zectbumo joined #nim |
00:21:21 | Amun-Ra | gimme sec |
00:23:42 | Amun-Ra | and the test case compiles |
00:26:08 | Amun-Ra | Elegantbeef: https://dpaste.com/HKV2XVZLP |
00:27:44 | Amun-Ra | I'll have to copy all the project and keep only relevant code |
00:29:18 | FromDiscord | <Elegantbeef> Oh a codegen error |
00:29:44 | FromDiscord | <Elegantbeef> How are you generating these objects? |
00:33:33 | Amun-Ra | Elegantbeef: https://dpaste.com/EC9DVMEXG |
00:36:35 | Amun-Ra | I'll make a test case tomorrow and keep you posted |
00:38:00 | * | noeontheend joined #nim |
00:58:32 | FromDiscord | <kipukun> hello all, im getting a `Permission Denied` error with nim on freebsd 13.0. this is in the context of an HTTP request. i traced the syscalls down to a `sendto` call |
00:58:40 | * | kipukun left #nim (Leaving) |
00:58:56 | FromDiscord | <Elegantbeef> Sounds like user permission issues perhaps |
01:00:05 | FromDiscord | <Elegantbeef> If you run the program with elevated permissions does it work? |
01:00:24 | FromDiscord | <Elegantbeef> Dont know BSD much, so just extrapolating Linux knowledge |
01:01:58 | FromDiscord | <kipukun> thats what i thought at first, but according to the man page `sendto` returns EACCES if the destination is a broadcast address. |
01:04:41 | FromDiscord | <Elegantbeef> You're doing a TCP request so it's the other part |
01:05:03 | FromDiscord | <Elegantbeef> > Write permission is denied on the destination socket file, or search permission is denied for one of the directories the path prefix. |
01:05:23 | FromDiscord | <Elegantbeef> Though that's 'UNIX domaiin sockets' |
01:05:55 | FromDiscord | <kipukun> i think it actually has to do with the call to redis, then it might be a permission denied on that socket. |
01:06:11 | NimEventer | New thread by Solomonthewise: Confusing behavior do to overloading of and for binary and, as well as logical and., see https://forum.nim-lang.org/t/9052 |
01:10:19 | * | Onionhammer quit (Read error: Connection reset by peer) |
01:11:04 | * | noeontheend quit (Ping timeout: 272 seconds) |
01:12:10 | * | Onionhammer joined #nim |
01:16:12 | NimEventer | New thread by Solomonthewise: Parseint not defined for char., see https://forum.nim-lang.org/t/9053 |
02:01:23 | FromDiscord | <Bubblie> How do I update nim |
02:01:28 | FromDiscord | <Bubblie> Do I just |
02:01:31 | FromDiscord | <Bubblie> Re install or |
02:01:45 | FromDiscord | <Elegantbeef> Ideally you use choosenim and then just do `choosenim update stable` |
02:02:01 | FromDiscord | <Bubblie> Oh alright let me get choosenim |
02:02:09 | FromDiscord | <Bubblie> I kinda did everything manually |
02:02:15 | FromDiscord | <Elegantbeef> Uninstall your installation before you get it |
02:02:24 | FromDiscord | <Bubblie> Also msvc is giving me a terrible time atm I hate windows |
02:02:27 | FromDiscord | <Bubblie> In reply to @Elegantbeef "Uninstall your installation before": Alright |
02:02:57 | FromDiscord | <Bubblie> Once I get the msvc thing actually working for futhark ill make a pr cause idk if its my machine or windows being a pain in thebass |
02:03:01 | FromDiscord | <Bubblie> (edit) "thebass" => "the ass" |
02:03:15 | FromDiscord | <Bubblie> Or my dev environment |
02:03:26 | FromDiscord | <Bubblie> Its most likely windows |
02:36:45 | FromDiscord | <Girvo> Hi all! |
02:37:32 | FromDiscord | <Girvo> @ElegantBeef There is something odd with the Nim VSCode extension and choosenim on Windows haha. It doesn't pick up the compiler/tooling properly. Its weird as. |
02:37:59 | FromDiscord | <Girvo> sent a code paste, see https://paste.rs/vG8 |
02:38:24 | FromDiscord | <Elegantbeef> Does it require resetting the editor?↵(@Girvo) |
02:38:44 | FromDiscord | <creikey> after choosenim updating nim all binaries are getting "the application was unable to start correctly" on windows, any way I can fix this without completely reinstalling nim? |
02:38:46 | FromDiscord | <Girvo> @ElegantBeef Nah, I've reset everything, even a completely fresh install triggers it. Some others have run into as well |
02:39:20 | FromDiscord | <Girvo> @ElegantBeef I worked aruond it by installing Nim directly myself instead, setting PATH to it, and the extension picked it up no worries |
02:40:08 | FromDiscord | <Girvo> https://github.com/saem/vscode-nim/issues/75 |
02:40:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TEX |
02:40:46 | FromDiscord | <Girvo> Oh neat! |
02:40:47 | FromDiscord | <Girvo> Cheers |
02:41:22 | FromDiscord | <Girvo> I have 512 addresses to 1-byte storage segments of EEPROM and have all the joy of trying to store a "queue" of sorts in it lol |
02:43:07 | FromDiscord | <Elegantbeef> I totally follow yes i totally do, this is not a facetious statement |
02:43:21 | FromDiscord | <Girvo> hahaha |
02:44:08 | FromDiscord | <Elegantbeef> I'm assuming you have 512 bytes off EEPROM and you want to queue 1 byte acctions onto it |
02:44:46 | FromDiscord | <Girvo> Effectively, though the access/storage of it is... idiosyncratic 🙂 |
02:45:06 | FromDiscord | <Elegantbeef> Interesting |
02:45:59 | FromDiscord | <spoon> ah nim vscode |
02:46:05 | FromDiscord | <creikey> I think my nim install is doomed |
02:46:06 | FromDiscord | <spoon> i had to switch to a different version of that |
02:46:46 | FromDiscord | <Girvo> @spoon Yeah one downside is there are two completely different extensions, too, and Saem's is superior lol. But has some bugs, of course, complicated stuff |
02:47:02 | FromDiscord | <morgan> i've been using saem's |
02:47:16 | FromDiscord | <spoon> yeah i'm using saem's too |
02:47:17 | FromDiscord | <morgan> made a few changes that got PR'd in for better regexes |
02:47:40 | FromDiscord | <spoon> why's there one above it in search |
02:48:00 | FromDiscord | <huantian> because algorithm |
02:48:43 | FromDiscord | <kipukun> @ElegantBeef to follow up, running the program as root gives the same error. |
02:48:50 | FromDiscord | <spoon> i don't think it's maintained anymore, right? |
02:48:51 | FromDiscord | <kipukun> i haven't checked the strace output yet though. |
02:50:09 | FromDiscord | <morgan> also anyone used nim before for audio plugins? there are existing c++ projects for that so one could use them with nim. curious bc if someone has done it already that could get me going faster with this. i didn't find any results with a search earlier and there's too many results for plugin on this discord for me to look thru them all. ping me if you respond |
02:51:38 | FromDiscord | <Elegantbeef> @Girvo\: what's the idiosyncratic method of accessing/pushing? |
02:52:32 | FromDiscord | <Elegantbeef> @morgan\: probably the best you're going to get https://github.com/search?q=language%3Anim+audio |
02:53:27 | FromDiscord | <Girvo> @ElegantBeef Well aside from the fact that there is about 5 different ways of approaching the same "storage", the ESP32 api's are both too high-level in terms its read/write APIs, but too low level to build nice data structures on top of it |
02:53:55 | FromDiscord | <Elegantbeef> `too low level` doubt we have Nim |
02:54:07 | FromDiscord | <Girvo> So I'm ditching most of it, aside from its "read/write blob" and handling the data myself 🙂 hence why I wanna try and pack a FIFO queue |
02:54:30 | FromDiscord | <Girvo> (edit) "So I'm ditching most of it, aside from its "read/write blob" and handling the data myself 🙂 hence why I wanna try and pack a FIFO queue ... " added "of (sentinel value) integers and work it it myself instead" |
02:57:25 | FromDiscord | <Girvo> now, to work out how to use a C-level attribute macro in Nim lol |
02:57:44 | FromDiscord | <Girvo> `RTC_NOINIT_ATTR uint32_t rtc_noinit_data;` |
02:58:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TEY |
02:58:49 | FromDiscord | <Elegantbeef> sorry latter should be `pop` |
02:58:51 | FromDiscord | <morgan> In reply to @Elegantbeef "<@277133333773811712>\: probably the best": ok so looks like nobody has done what i’m looking for |
02:59:08 | FromDiscord | <Elegantbeef> If they have they havent uploaded it publicly to github |
03:00:29 | FromDiscord | <Elegantbeef> Oh you said sentinel value so i guess that makes that reundant and it's just a `array[512 div T, T]` and iterate to find `0` |
03:01:43 | FromDiscord | <Elegantbeef> Ah guess that is very naive |
03:01:48 | FromDiscord | <Girvo> @ElegantBeef Yeah pretty much 🙂 It's basically an array of ints that are the "packet type" that the modem thread iterates over, that needs to surive a crash/reboot |
03:01:51 | FromDiscord | <Elegantbeef> Since eeprom seems to be persistent storage |
03:02:12 | FromDiscord | <Girvo> Indeed! Though it turns out I don't need it in EEPROM per-se (though it will work), but in RTC Slow memory lol |
03:02:28 | FromDiscord | <Girvo> Which is literally like RAM that happens to survive a reset. Which is wild |
03:02:51 | FromDiscord | <Elegantbeef> You say that like ram cant survive a reset |
03:03:21 | FromDiscord | <Elegantbeef> Non volatile ram goes brrr, oh wait no one uses it |
03:03:27 | FromDiscord | <Girvo> haha |
03:03:54 | FromDiscord | <Girvo> NVRAM actually _does_ get used for embedded stuff sometimes |
03:04:14 | FromDiscord | <Girvo> Specifically as an EEPROM alternative! |
03:04:57 | * | LuxuryMode joined #nim |
03:05:30 | FromDiscord | <Girvo> I'm guessing to use the `RTC_NOINIT_ATTR` C attribute macro in Nim, the simplest way would be to write a small amount of C that uses it, and bind _those_ C variables in Nim? |
03:05:55 | FromDiscord | <Elegantbeef> What is the actual macro? |
03:05:59 | LuxuryMode | I am new to Nim and wondering what people use for unit testing. I was a bit confused from the docs whether people use unittest (also saw unittest2) or testament. Also, related question: how do I import a function I've defined elsewhere into my test? |
03:06:17 | FromDiscord | <Girvo> Testament is the go-to |
03:06:33 | LuxuryMode | thanks |
03:06:33 | FromDiscord | <Girvo> I still use `unittest` but thats because I have some weird requirements working in embedded stuff |
03:06:37 | FromDiscord | <Elegantbeef> Testament, unittest and balls are the 3 most used |
03:06:50 | FromDiscord | <Elegantbeef> Eh i use unit test for my stuff though it's small stuff |
03:06:57 | FromDiscord | <Elegantbeef> > how do I import a function I've defined elsewhere into my test |
03:06:59 | FromDiscord | <Girvo> Yeah I still really like it for really simple things |
03:07:03 | FromDiscord | <Elegantbeef> You cant |
03:07:14 | FromDiscord | <Elegantbeef> If it's inside a `test` block it's gensymd and not accessible |
03:07:40 | FromDiscord | <Elegantbeef> You can work around that by using a global variable and assigning that to the proc if you want |
03:08:06 | FromDiscord | <huantian> balls is fun because balls |
03:08:07 | FromDiscord | <LuxuryMode> I see everyone's on discord so I'm here now 🙂 |
03:08:26 | FromDiscord | <Elegantbeef> I'm not on discord |
03:08:26 | FromDiscord | <huantian> well not everyone is on discord |
03:08:27 | FromDiscord | <Elegantbeef> Huan isnt on discord |
03:08:27 | FromDiscord | <Elegantbeef> There is only a single discord user presently |
03:08:37 | FromDiscord | <Elegantbeef> The fucking Australian doesnt get the memo |
03:08:39 | FromDiscord | <LuxuryMode> oh |
03:08:44 | FromDiscord | <LuxuryMode> back to IRC then lol |
03:08:53 | FromDiscord | <Elegantbeef> No go to matrix! |
03:08:53 | FromDiscord | <Elegantbeef> 😛 |
03:09:01 | FromDiscord | <Elegantbeef> Use what ever you prefer |
03:09:19 | FromDiscord | <Girvo> `#define RTC_NOINIT_ATTR _SECTION_ATTR_IMPL(".rtc_noinit", COUNTER)` |
03:09:25 | FromDiscord | <Girvo> @ElegantBeef ^^ |
03:10:00 | FromDiscord | <Elegantbeef> you could make a template that gensyms it that way so you'd do somethiing like `var myVar {.rtcNoInit.} = 10` |
03:10:20 | FromDiscord | <Elegantbeef> Not that i really get what that does |
03:10:22 | FromDiscord | <Girvo> Neat, yeah I'll take a crack at it |
03:10:36 | LuxuryMode | gensym = generate symbol? |
03:10:37 | FromDiscord | <Elegantbeef> code gens it that way |
03:10:41 | FromDiscord | <Elegantbeef> That's what i meant |
03:10:42 | FromDiscord | <Elegantbeef> Yes |
03:10:55 | LuxuryMode | I can't just import a proc I've written? |
03:11:03 | FromDiscord | <Girvo> Haha it's an attribute that basically tells the ESP32 to store _that_ variable in some special memory on the real-time-clock instead of in actual RAM |
03:11:03 | FromDiscord | <Elegantbeef> `{.pragma: codegendecl"yourgenstatement here".}` |
03:11:06 | FromDiscord | <Elegantbeef> What's your code luxury |
03:11:22 | FromDiscord | <Elegantbeef> It's hard to say the issue without the code |
03:11:41 | FromDiscord | <Elegantbeef> Yea like i said a macro or pragma is the best here |
03:11:48 | FromDiscord | <Girvo> Yeah I think you're right |
03:11:50 | FromDiscord | <Girvo> Cheers! |
03:12:02 | FromDiscord | <Elegantbeef> It'll let you annotate it, and aslong as you import that C file that declares it you're fine |
03:12:12 | LuxuryMode | Right now I literally have a single proc at the top level in a file: `proc countWords(s: string): int =...` and then I have a separate `tests/` directory where I'd like to write my tests. |
03:12:22 | FromDiscord | <Elegantbeef> ah |
03:12:27 | FromDiscord | <Elegantbeef> `countWords` |
03:12:31 | FromDiscord | <Elegantbeef> You need to export procedures in Nim |
03:12:37 | FromDiscord | <Girvo> The `` marks it as exported 🙂 |
03:12:52 | FromDiscord | <Elegantbeef> I thought you were talking about having a procedure declared inside a test and accessing it from other tests |
03:13:09 | LuxuryMode | hah no no |
03:13:28 | FromDiscord | <Elegantbeef> Well that solves that issue in a way that isnt a hack 😛 |
03:14:01 | LuxuryMode | I assume you mean *? That symbol doesn't show up coming from Discord |
03:14:29 | FromDiscord | <Elegantbeef> Yea it's a bridge bug |
03:14:38 | FromDiscord | <Elegantbeef> it appears as greater than or equal to iirc |
03:14:50 | LuxuryMode | shows up as a blank square for me |
03:14:56 | FromDiscord | <Elegantbeef> Ah |
03:15:07 | LuxuryMode | but ok so just `proc myProc*..(arg1, arg2)...`? |
03:15:15 | FromDiscord | <Elegantbeef> Yep |
03:15:25 | LuxuryMode | didn't mean the dots before (arg1) whoops |
03:15:41 | FromDiscord | <Elegantbeef> well if you have generic params or a constrain |
03:15:47 | FromDiscord | <Elegantbeef> It's sensible accidently |
03:15:49 | LuxuryMode | that's a pretty elegant way to mark procs as public |
03:15:58 | LuxuryMode | Love that I can just look at the function and tell from itself |
03:15:58 | FromDiscord | <Elegantbeef> It's the same for all symbols |
03:16:27 | FromDiscord | <Elegantbeef> Any top level symbol can be exported with the export marker, and for objects you need to apply it to the fields you want visible outside the file |
03:16:43 | LuxuryMode | right ok |
03:17:00 | LuxuryMode | and for another noob question: how do I import it now in the test file? |
03:18:46 | FromDiscord | <Elegantbeef> `import myfilename` |
03:19:19 | FromDiscord | <Elegantbeef> assuming you have a `config.nims` that does `switch("path", "$projectDir/../src")` inside your `tests` folder |
03:19:42 | LuxuryMode | I don't :) |
03:19:57 | LuxuryMode | will add one |
03:21:23 | LuxuryMode | `Success: All tests passed` Woot!! |
03:23:41 | FromDiscord | <Elegantbeef> You're now a leet Nim programmer |
03:23:59 | FromDiscord | <huantian> I thought that happens when you write a macro |
03:24:15 | LuxuryMode | hehe indeed. Thanks for all the help |
03:24:42 | FromDiscord | <Elegantbeef> Seems like someone is doing their implementation of countwords to go against that benchmark 😛 |
03:26:02 | LuxuryMode | lol no, I don't even know what that refers to. I'm just implementing some unix commands as a way to learn Nim |
03:26:32 | FromDiscord | <Elegantbeef> Ah there is a common benchmark of languages that uses countwords as the task |
03:27:01 | FromDiscord | <huantian> which benchmark is this? I only remember the times people benchmark nim against rust \:P |
03:27:06 | LuxuryMode | Right, I may have come across that recently. Showed Nim and Rust neck in neck IIRC |
03:27:27 | FromDiscord | <Elegantbeef> https://benhoyt.com/writings/count-words/ i think is the common one |
03:27:49 | FromDiscord | <Elegantbeef> Nim is 4th on there |
03:28:37 | FromDiscord | <huantian> grep is too good |
03:29:43 | LuxuryMode | Beats Rust handily |
03:30:15 | LuxuryMode | I assume there are all sorts of debates as to whether the benchmarks are fair, with people arguing you can optimize the X language implementation by doing whatever... |
03:30:39 | FromDiscord | <Elegantbeef> yea it's circlekerky |
03:30:43 | FromDiscord | <Elegantbeef> jerky even |
03:31:37 | LuxuryMode | :P |
03:32:50 | FromDiscord | <Elegantbeef> languages at the level of nim give the same performance if you have a brain |
03:33:13 | FromDiscord | <Elegantbeef> The question is the ease of doing it |
03:33:56 | FromDiscord | <huantian> I didn't check the nim code, didi t just use `CountTable`? |
03:34:08 | FromDiscord | <Elegantbeef> dont recall, think so |
03:34:21 | LuxuryMode | https://github.com/benhoyt/countwords/blob/master/optimized.nim |
03:34:32 | LuxuryMode | `from tables import initCountTable,` |
03:35:12 | FromDiscord | <huantian> from imports? is this python smh |
03:35:58 | LuxuryMode | ha didn't even notice that. Did not know you could do from imports in Nim |
03:36:11 | LuxuryMode | Is there another way to import a specific type or proc? |
03:36:45 | FromDiscord | <Elegantbeef> They're dumb generally |
03:36:53 | FromDiscord | <Elegantbeef> Idiomatic Nim just does `import module` |
03:37:12 | FromDiscord | <huantian> and uses `import module except conflict` if there's any conflicting symbols |
03:37:30 | FromDiscord | <Elegantbeef> and when importing system modules you do `std/strutils` for instance |
03:40:45 | * | arkurious quit (Quit: Leaving) |
03:42:11 | * | jmdaemon quit (Ping timeout: 268 seconds) |
03:43:30 | LuxuryMode | I see |
03:45:15 | * | jmdaemon joined #nim |
03:45:52 | FromDiscord | <Elegantbeef> Despite appearances Nim and Python should be written differently 😛 |
03:50:32 | FromDiscord | <Girvo> I almost reckon the common-ish statement of "It's like python, but fast and with a proper type system" does Nim a bit of a disservice haha |
03:50:59 | FromDiscord | <Girvo> Though that used to be more common back in the pre 1.0 days I think |
03:51:02 | FromDiscord | <Elegantbeef> A few people say that i'm not one of them |
03:51:53 | FromDiscord | <enthus1ast> i'll try to create a minimal test case, currently its quite a big codebase↵(@xflywind) |
03:53:31 | FromDiscord | <xflywind> In reply to @enthus1ast "i'll try to create": what's problem? |
03:57:40 | FromDiscord | <enthus1ast> the SIGSEGV when useing prologue |
03:58:32 | FromDiscord | <enthus1ast> but yeah i'll try to create a small testcase, have not documented the crash anywhere yet |
03:58:54 | FromDiscord | <xflywind> I see |
04:02:39 | FromDiscord | <Girvo> @ElegantBeef Whats the best reference/doc for C-level codegen? Ensuring it gets the RTC_NOINIT_ATTR attribute macro put in front of a variable statement? |
04:03:02 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma |
04:03:08 | FromDiscord | <Girvo> Champion |
04:03:52 | FromDiscord | <Girvo> My google-fu is weak today |
04:04:04 | FromDiscord | <Elegantbeef> Just ctrl + f the manual for random keywords 😛 |
04:04:09 | FromDiscord | <Elegantbeef> Nim isnt very good to search |
04:04:32 | FromDiscord | <Girvo> Haha you're not wrong. I found some good stuff in the forum but it still wasn't quite what I was after |
04:05:04 | FromDiscord | <huantian> can't wait until in five years nim becomes the dominant programming language and google searches will be easier |
04:06:34 | FromDiscord | <Elegantbeef> Just have 8000 writeups hosted on the website problem solved |
04:07:03 | FromDiscord | <Girvo> Ah hah! It works. I have crash-proof RTC "slow" memory working 😄 |
04:07:22 | FromDiscord | <Elegantbeef> I assume you're just using a pragma pragma |
04:09:06 | * | rockcavera quit (Remote host closed the connection) |
04:11:51 | FromDiscord | <Girvo> At the moment yeah |
04:11:53 | FromDiscord | <huantian> pragma pragma pragma? pragma |
04:12:06 | FromDiscord | <Girvo> `RTC_NOINIT_ATTR NI tmain_46;` |
04:12:25 | FromDiscord | <Girvo> Pragma is grammatically the same as Buffalo, true story (note: not actually a true story) |
04:12:49 | * | slowButPresent quit (Quit: leaving) |
04:14:44 | FromDiscord | <huantian> pragma is such a funny word I don't know why |
04:17:00 | FromDiscord | <Girvo> Just tested it: working perfectly. I can now store variables in the ESP32's RTC memory to survive crashes/esp_restart calls. Awesome |
04:29:08 | FromDiscord | <Girvo> `result[4].add [ident"codegenDecl"]` |
04:29:31 | FromDiscord | <Girvo> How would one pass the `: "blah arguments here"` to this macro to build the pragma? |
04:29:49 | FromDiscord | <Elegantbeef> `macros.dumptree` is your friend |
04:30:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TF7 |
04:30:58 | FromDiscord | <Elegantbeef> Need to work on micros more |
04:31:07 | FromDiscord | <Elegantbeef> This is as good as a time as any |
04:31:35 | FromDiscord | <Girvo> Dope |
04:31:38 | FromDiscord | <Girvo> Cheers |
04:32:50 | FromDiscord | <Elegantbeef> Now if only Kate was updated on my package repository |
04:34:33 | FromDiscord | <huantian> maybe just download a deb manually for now |
04:34:44 | FromDiscord | <Elegantbeef> It doesnt have any |
04:34:56 | FromDiscord | <Elegantbeef> It has appimages that have bugs it seems |
04:35:14 | FromDiscord | <huantian> that's fun |
04:35:45 | * | tinystoat quit (*.net *.split) |
04:35:49 | * | anddam quit (*.net *.split) |
04:35:49 | * | dv2 quit (*.net *.split) |
04:35:54 | * | tinystoat joined #nim |
04:36:20 | * | anddam joined #nim |
04:36:29 | FromDiscord | <huantian> yk I might actually switch to kate for quick editing instead of notepadqq |
04:36:39 | FromDiscord | <huantian> since I am using KDE |
04:38:18 | FromDiscord | <huantian> also notepadqq is buggy |
04:38:49 | FromDiscord | <Elegantbeef> kate + lsp is lovely for Nim so far |
04:38:54 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=3TF8 |
04:38:57 | FromDiscord | <Girvo> This is definitely not right hey lol |
04:39:15 | FromDiscord | <Elegantbeef> remove the `[]` |
04:39:28 | FromDiscord | <huantian> does nimslp have semantic highlighting? |
04:39:48 | FromDiscord | <Girvo> Ah! |
04:39:50 | FromDiscord | <Girvo> Perfect cheers |
04:40:02 | FromDiscord | <Elegantbeef> Dont think it does huan |
04:43:39 | FromDiscord | <Girvo> Hm I've still done something not right. Alright time for some macro debugging lol |
05:23:02 | FromDiscord | <Elegantbeef> @Girvo\: still debugging macro? |
06:26:32 | * | PMunch joined #nim |
06:29:57 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
06:32:44 | * | jjido joined #nim |
06:38:55 | * | Lord_Nightmare joined #nim |
06:40:17 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3TFi |
06:40:52 | FromDiscord | <Elegantbeef> Well yea |
06:41:03 | FromDiscord | <enthus1ast> yea? |
06:41:05 | FromDiscord | <Elegantbeef> Yes |
06:41:13 | FromDiscord | <Elegantbeef> Gensym happens inside the compiler to the symbol |
06:41:22 | FromDiscord | <enthus1ast> it should generate nimjaTmplVar\_someRandomStuff or? |
06:41:31 | FromDiscord | <enthus1ast> s |
06:41:32 | FromDiscord | <Elegantbeef> You can or you can just use the generated symbol |
06:41:41 | FromDiscord | <Elegantbeef> What're you trying to do verbatim |
06:44:49 | FromDiscord | <enthus1ast> i need a unique variable, and its name. To create nimja templatates that does not store the result in `result` but in the generated variable.↵I need this because i've created "shorthand" templates, that does not need to be wrapped in a proc. For this i use a template that injects this random variable in the outer scope.↵But i do not want to pollute the sourrounding with a variable |
06:45:16 | FromDiscord | <enthus1ast> hard times to explain lol |
06:45:26 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/FxA |
06:45:43 | FromDiscord | <enthus1ast> (its rubbish i know) |
06:46:16 | FromDiscord | <Elegantbeef> I dont quite get why you need a gensym for this |
06:46:52 | FromDiscord | <enthus1ast> how would you generate a variable with a random name and also get the variable name as a string? |
06:47:26 | FromDiscord | <enthus1ast> so that it does not pollute the outer scope? |
06:47:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TFk |
06:49:15 | FromDiscord | <enthus1ast> so it is already unique o.0 |
06:49:22 | FromDiscord | <Elegantbeef> Templates are hygenic |
06:49:30 | FromDiscord | <enthus1ast> even if i do {.inject.} |
06:49:38 | FromDiscord | <Elegantbeef> No inject makes them non hygenic |
06:49:43 | FromDiscord | <Elegantbeef> That's the entire point of inject |
06:50:04 | FromDiscord | <enthus1ast> the problem is jester in fact |
06:50:14 | FromDiscord | <enthus1ast> @"foo" is not available in the proc |
06:50:22 | FromDiscord | <enthus1ast> ok let my just try it |
06:50:39 | FromDiscord | <enthus1ast> maybe i'm overthinking this |
06:50:46 | FromDiscord | <Elegantbeef> Perhaps |
06:56:17 | FromDiscord | <enthus1ast> mh no, it needs to be injected |
06:56:32 | FromDiscord | <enthus1ast> withouth this the nimja macros cannot see the var |
06:56:40 | FromDiscord | <Elegantbeef> `block:`? |
06:57:03 | FromDiscord | <enthus1ast> mhh |
06:57:22 | FromDiscord | <enthus1ast> ah, then i must use the gensymed name of. |
06:57:39 | FromDiscord | <Elegantbeef> I dont fully see the issue, so cant help much |
06:58:23 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3TFm |
06:58:44 | FromDiscord | <enthus1ast> tmpls is a shortcut for compiling the template directly withouh wrapping in an extra proc |
06:59:07 | FromDiscord | <enthus1ast> jester does some magic to `@"name"` so its not a global |
06:59:39 | FromDiscord | <enthus1ast> so i need to change `tmpls` to a template (was a proc first) |
07:01:04 | FromDiscord | <enthus1ast> to solve this, i made the nimja macros accept an additional parameter, to set the variable name that is appended to (could be something other then `result` for example |
07:01:37 | FromDiscord | <enthus1ast> i thought the best way is to generate a unique variable name, and give this name to the nimja procs |
07:04:29 | FromDiscord | <Elegantbeef> So the issue is that jester takes an untyped statement and as such `@name` isnt replaced? |
07:04:55 | FromDiscord | <enthus1ast> `@"name"` is then not known in the nimja macros |
07:05:03 | FromDiscord | <Elegantbeef> So you need something like `templs("<h1>$#</h1>", @name)`? |
07:05:39 | FromDiscord | <enthus1ast> this could be an option, but its a semantic i do not want currently |
07:06:33 | FromDiscord | <Elegantbeef> Well you can always make you `templs` emit an overload which is what i suggested |
07:07:31 | FromDiscord | <Elegantbeef> then you just do `$1`, `$2`... inside your string and use the Nim strutils `%` at compile time |
07:07:38 | FromDiscord | <Elegantbeef> Or runtime rather |
07:07:53 | FromDiscord | <enthus1ast> tmpls compiles nimja templates |
07:07:58 | * | gsalazar joined #nim |
07:08:09 | FromDiscord | <Elegantbeef> I dont get how you can compile the template without the symbol in scope |
07:08:14 | FromDiscord | <Elegantbeef> So i guess i'll shush |
07:08:52 | FromDiscord | <enthus1ast> i think i cannot explain my issue correctly \:) , i'll play with it and report |
07:10:20 | FromDiscord | <Elegantbeef> Well have fun, i cannot understand a lick of the issue |
07:15:39 | FromDiscord | <enthus1ast> (i'll play with it == have to go to work first then i can play with it....) |
07:19:46 | * | reversem3[m] quit (Quit: Bridge terminating on SIGTERM) |
07:25:13 | * | reversem3[m] joined #nim |
07:35:54 | * | yiggityswaps quit (Quit: Leaving) |
07:52:06 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:23:25 | PMunch | @enthus1ast, what you want is something like this: https://play.nim-lang.org/#ix=3TFu |
08:24:28 | PMunch | Essentially converting the genSym to a string (at least without repr) removes the hidden random part of the identifier. In general it's always better to generate Nim AST directly and not do it through building strings |
08:26:51 | PMunch | For the tmpls thing I believe you want something like this: https://play.nim-lang.org/#ix=3TFv |
08:27:36 | FromDiscord | <Elegantbeef> I have 0 clue how you've got to that answer pmunch 😛 |
08:30:09 | PMunch | What do you mean? |
08:30:23 | FromDiscord | <Elegantbeef> I still dont get the problem |
08:30:48 | FromDiscord | <Elegantbeef> Also dont know if you seen but the issue with kate was just an outdate version of Kate on the ubuntu repository |
08:30:54 | FromDiscord | <Elegantbeef> So i guess it's time i move to a proper distro |
08:31:01 | PMunch | Aaah, that makes sense :P |
08:31:08 | PMunch | But no, I hadn't seen that |
08:31:16 | FromDiscord | <enthus1ast> ive fixed it during the train ride \:) |
08:31:27 | FromDiscord | <Elegantbeef> Imagine having trains |
08:31:36 | PMunch | Trains are neat |
08:32:02 | PMunch | Nice combination of comfort and speed |
08:32:12 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=3TFw |
08:33:08 | PMunch | Why do you need the name as a string? |
08:33:11 | FromDiscord | <Elegantbeef> Isnt that just an elaborate `asttoStr nimjaTmplsVar`? |
08:33:32 | FromDiscord | <enthus1ast> i use the string in the parser to generate code |
08:33:42 | PMunch | That sounds like a bad idea |
08:34:02 | FromDiscord | <enthus1ast> i tried to just use a NimNode but i could not have `result` as a parameter |
08:34:15 | FromDiscord | <Elegantbeef> Why cant you? |
08:34:34 | FromDiscord | <enthus1ast> its unknown |
08:35:28 | FromDiscord | <enthus1ast> yep |
08:35:30 | FromDiscord | <enthus1ast> its asttostr |
08:35:32 | FromDiscord | <enthus1ast> thank you |
08:35:43 | FromDiscord | <Elegantbeef> I suggested that earlier |
08:35:47 | FromDiscord | <Elegantbeef> You ignored me |
08:35:53 | FromDiscord | <Elegantbeef> Shame on you! |
08:36:05 | FromDiscord | <enthus1ast> what?? |
08:36:08 | FromDiscord | <enthus1ast> lemme scroll up |
08:36:21 | FromDiscord | <enthus1ast> ah ye |
08:36:22 | FromDiscord | <enthus1ast> s |
08:36:25 | FromDiscord | <Elegantbeef> Literally my first example is what you used |
08:36:28 | FromDiscord | <enthus1ast> yes |
08:36:43 | FromDiscord | <enthus1ast> sorry, i read it but not read it correclty |
08:38:27 | * | jmdaemon quit (Ping timeout: 252 seconds) |
08:46:56 | PMunch | Hmm, maybe I should support both nimja and onionhammer templates in autotemplates |
08:47:21 | FromDiscord | <Elegantbeef> autotemplates? |
08:47:43 | PMunch | One of my small experiments I'm considering to make into an actual library |
08:48:07 | PMunch | https://github.com/PMunch/autotemplate |
08:49:37 | PMunch | The meat of the experiment being here: https://github.com/PMunch/autotemplate/blob/master/src/autotemplates.nim |
08:50:19 | FromDiscord | <Elegantbeef> `t.kind == nnkBracketExpr and t[0].repr == "typeDesc"` `t.typeKind == ntyTypeDesc` |
08:50:40 | PMunch | Oh right :P |
08:50:51 | PMunch | I wrote all of that in a hurry just to test if it would work |
08:51:02 | FromDiscord | <enthus1ast> nimja is onionhammer templates on steroids |
08:51:07 | FromDiscord | <Elegantbeef> also `newLit t.typeKind == ntyTypeDesc` 😛 |
08:51:15 | * | Gustavo6046 joined #nim |
08:51:30 | FromDiscord | <enthus1ast> I've used onionhammers templates before i build nimja |
08:51:50 | PMunch | What where the things you ran into with onionhammer templates that made you write Nimja? |
08:52:09 | FromDiscord | <Elegantbeef> I dont know what these templaters are for so i'll just nod |
08:52:20 | FromDiscord | <enthus1ast> no comments |
08:52:24 | FromDiscord | <enthus1ast> strange syntax |
08:52:36 | FromDiscord | <enthus1ast> porting issues (was porting stuff from jinja2 and twig) |
08:52:43 | FromDiscord | <enthus1ast> no exends |
08:52:49 | FromDiscord | <enthus1ast> extends |
08:53:07 | FromDiscord | <enthus1ast> strange syntax is of. opinonated |
08:53:09 | PMunch | @Elegantbeef, it's just a way to drop code snippets inside a static document. Mostly to split the markdown and the content logic |
08:53:34 | PMunch | Extends is nice |
08:53:53 | PMunch | And I've only done the most trivial things, so haven't really gotten anything to say on syntax |
08:54:19 | PMunch | One thing I noticed is that Nimja seems to require more special characters than onionhammers |
08:54:42 | FromDiscord | <enthus1ast> i mean its modeled after jinja twig django templates etc |
08:54:55 | FromDiscord | <enthus1ast> i know its quite verbose, but a well known syntax |
08:55:23 | FromDiscord | <enthus1ast> so if you know one of the big template engines, you can just start with nimja |
08:55:35 | PMunch | Aah, that is probably a big pluss |
09:14:52 | * | Zectbumo quit (Remote host closed the connection) |
09:23:06 | PMunch | Hmm, for autotemplates it would be nice if it called `toHtml` for all subtypes recursively instead of just calling $ |
09:23:27 | PMunch | Tried something like: https://play.nim-lang.org/#ix=3TFF |
09:23:41 | PMunch | But that fails because it just gets resolved recursively |
09:25:05 | PMunch | Ah nice, this works: https://play.nim-lang.org/#ix=3TFG |
09:25:20 | FromDiscord | <Elegantbeef> Fuck you're silly |
09:25:25 | PMunch | Silly? |
09:25:43 | FromDiscord | <Elegantbeef> Ah nvm i guess `system.$` isnt always what you want |
09:26:04 | PMunch | Haha, no I thought of that as well |
09:26:38 | PMunch | I mean the goal is to turn `SomeName.ext` into `proc toExt(x: SomeName): string` |
09:26:51 | FromDiscord | <vindaar> PMunch\: feel free to ping me here of course for the plotly use case you have. Might be easier |
09:27:28 | PMunch | @vindaar, well basically I just wanted an easy way to get all the stuff I would need for embedding a plotly plot into a website |
09:27:51 | PMunch | Without having to reverse engineer the display functions |
09:27:58 | FromDiscord | <Elegantbeef> Hmm pmunch cant you just dp `proc toHtml(x: auto): string = $x`? |
09:28:18 | FromDiscord | <Elegantbeef> Then any type that overrides that would be dispatch upon since it'd be specialized |
09:28:37 | PMunch | @Elegantbeef, I could, but the problem is that the templating engine calls `$` |
09:29:39 | PMunch | So I need to bind `$` to `toHtml` if `toHtml` is defined for an arbitrary type, otherwise to the previously defined `$` |
09:31:27 | FromDiscord | <Rika> Your $ will only be called if nothing more specific is defined so you technically don’t need to check if to html compiles or not |
09:32:15 | PMunch | Well I need to check if `toHtml` exists for that type |
09:33:53 | FromDiscord | <Rika> What I mean is ↵$ exists -> your $ isn’t called↵Otherwise, to html exists -> calls to html↵Otherwise -> error out duh to html doesn’t exist |
09:33:56 | FromDiscord | <Rika> Right? |
09:34:33 | FromDiscord | <Rika> If to html doesn’t exist then you call $, but it’s not needed since if $ exists then your $ isn’t called |
09:34:58 | FromDiscord | <Rika> So inside your function, if to html doesn’t exist then $ doesn’t exist either so error out |
09:35:04 | PMunch | This is closer to what the actual library would look like: https://play.nim-lang.org/#ix=3TFI |
09:35:18 | FromDiscord | <Elegantbeef> Rika is right though |
09:35:26 | FromDiscord | <Elegantbeef> the generic `$` inside `toHtml` will not be used |
09:35:48 | FromDiscord | <Elegantbeef> Wait it seems like it is |
09:35:49 | FromDiscord | <Elegantbeef> That's odd |
09:36:18 | FromDiscord | <Elegantbeef> Ah nvm it is i was dumb |
09:37:12 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3TFM there |
09:37:38 | FromDiscord | <Elegantbeef> Not that this really matters, but yea |
09:37:58 | FromDiscord | <Elegantbeef> If `$` is defined for the type the `$` isnt called |
09:38:08 | FromDiscord | <Elegantbeef> Well the allias isnt needed |
09:38:33 | PMunch | Ah.. |
09:38:34 | PMunch | Damn it.. |
09:38:47 | FromDiscord | <Rika> Now praise me and my big brain! |
09:38:52 | FromDiscord | <Elegantbeef> You just need to specialize your `$` |
09:39:19 | FromDiscord | <vindaar> PMunch\: just put a more detailed explanation into that issue |
09:40:33 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3TFN here pmunch |
09:41:54 | PMunch | Ix isn't working for me right now and I have to go to lunch |
09:41:55 | FromDiscord | <Rika> Woah didn’t know you could shadow function declarations |
09:42:04 | PMunch | This is basically what I want to have happen: https://pastebin.com/M6nji0Dx |
09:46:09 | FromDiscord | <Elegantbeef> What i just provided should give that |
09:46:55 | FromDiscord | <Elegantbeef> we alias `$` only if `toHtml` exists and if an instance is a proc for our type |
09:47:09 | FromDiscord | <Elegantbeef> Otherwise we use `$` |
09:47:35 | * | jjido joined #nim |
09:49:06 | FromDiscord | <Elegantbeef> Atleast i think it does |
09:49:47 | * | jjido quit (Client Quit) |
10:00:34 | * | ltriant joined #nim |
10:00:57 | * | ltriant_ quit (Ping timeout: 252 seconds) |
10:19:03 | PMunch | @Elegantbeef, the problem with your version is that I need to know all the types beforehand |
10:20:59 | PMunch | Is there any way I can undefine $? |
10:22:00 | FromDiscord | <Rika> Not without importing with exclude, and even then you will have difficulty dealing with system |
10:22:12 | PMunch | Hmm |
10:22:40 | PMunch | So there's no way I can override all $ calls in a block of code? |
10:22:49 | FromDiscord | <Rika> You should probably just change whatever template library you’re using to use to html instead of $ |
10:23:08 | PMunch | That is an option.. |
10:23:09 | FromDiscord | <Rika> You could probably if wrapped in a macro? Perhaps with extreme difficulty |
10:23:19 | FromDiscord | <Rika> In reply to @PMunch "That is an option..": It’s surely the easiest option |
10:23:44 | PMunch | But I kinda wanted to be able to use any templating library |
10:23:59 | PMunch | I don't really want to write my own.. |
10:24:08 | FromDiscord | <Rika> Then those libraries shouldn’t use $ I’d say |
10:24:39 | PMunch | One thing I could do is to use a macro to traverse the object and generate all the `$` procedure overloads |
10:30:55 | FromDiscord | <Rika> If a type already has $ defined then you might hit an issue unless wrapped in a proc or a block perhaps? |
10:31:56 | PMunch | Well that's not an issue |
10:32:03 | PMunch | It will always be wrapped in a proc |
10:32:33 | PMunch | Basically I want to auto-generate toX given a type and a set of templates for different X's |
10:32:56 | PMunch | But if an object has a field I want that to call toHtml recursively |
10:33:01 | PMunch | Or toX rather |
11:05:29 | * | reversem3[m] quit (Quit: User was banned) |
11:41:47 | FromDiscord | <Zoom> Hey guys on Arch and derivatives! I'm writing a PKGBUILD for my program. Is it ok to `nimble -y install` for the dependencies? It forcefully overwrites the current versions this way and potentially may affect users who rely on `nimble develop` for hacking on those depencencies. |
11:44:32 | FromDiscord | <Zoom> Although, if the user didn't issue `nimble develop` directly in the nimble cache dir, the only damage is the soft links, as far a I can tell. |
11:49:02 | FromDiscord | <auxym> good question. maybe you could setup a temporary nimble path for your build? not sure if nimble supports that, lemme look |
11:50:26 | FromDiscord | <Rika> dont aur packs usually get built in fake roots anyway |
11:54:06 | FromDiscord | <auxym> yeah nimble doesn't seem to have that feature :/ |
11:55:40 | FromDiscord | <auxym> would be useful to be able to set the NIMBLE_PACKAGES_DIR environment variable or something like that |
11:56:32 | PMunch | Yeah packages on Arch should be built in a fakeroot and then everything is copied over |
11:57:00 | PMunch | I believe you will get errors saying that file X already exists in filesystem if it would overwrite something |
11:57:59 | PMunch | But does your program have a runtime dependency from a Nimble package? |
12:00:28 | FromDiscord | <Zoom> It looks like does, but as far as I can tell, nimble packages got overwritten in the main cache dir.↵(@Rika) |
12:01:09 | FromDiscord | <Zoom> Runtime dependency? Nope, only build dependency↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
12:02:18 | FromDiscord | <Zoom> So, from what I'm seeing, nimble installs from PKBUILD `build` section (where they belong) are happening before makepkg enters fakeroot |
12:04:39 | FromDiscord | <Zoom> The other issue is with explicit version requirements in PKBUILD (i.e. `makedepends=('nim>1.4.2')`) IF nim is installed not with Pacman, but choosenim for example. The system doesn't know the version and fails to build. |
12:08:02 | PMunch | Hmm, that sounds strange |
12:09:33 | PMunch | Okay @Elegantbeef, I've got it working now |
12:10:22 | PMunch | Now it generates `toHtml`, `toCSS` etc. for the various file types you have in your folder |
12:10:56 | PMunch | And generations happens recursively, and you're able to overload with custom procedures |
12:11:45 | PMunch | Now the next big question. I want to make it easy to do something in Jester where you would return different types based on something in the query. |
12:12:07 | PMunch | Imagine we have .html and .xml files for example, or maybe .html and .rss |
12:12:54 | PMunch | I want to write something in Jester that allows me to return .html or .rss based on either the Accept header or a . postfix on the url |
12:25:30 | FromDiscord | <auxym> In reply to @Zoom "The other issue is": here's an option: enforce the dependency on system nim and then call nim using the full path like `/usr/bin/nim` or whatever |
12:36:53 | FromDiscord | <Rika> choosenim installs to ~/.nimble/bin/nim which is a shim binary (i think) to ~/.choosenim/toolchains/nim-{version}/bin/nim |
12:42:28 | FromDiscord | <Zoom> @auxym wdym? Call nim to check the version manually? |
12:43:34 | FromDiscord | <Zoom> If I drop the version info from the PKGBUILD it works fine, from what I can tell, makepkg just can't get the version info if nim was installed in some other way besides pacman |
12:44:25 | * | rockcavera joined #nim |
12:44:25 | * | rockcavera quit (Changing host) |
12:44:25 | * | rockcavera joined #nim |
12:44:30 | FromDiscord | <Zoom> [dom96](https://matrix.to/#/@dom96:matrix.org)\: do you have any thoughts on this? |
12:49:14 | FromDiscord | <auxym> In reply to @Zoom "@auxym wdym? Call nim": nah. use makedepends to make sure nim is installed at the system level, then use the full path to call the system-nim and not choosenim-nim |
12:50:24 | * | reversem3[m] joined #nim |
12:50:25 | FromDiscord | <Rika> what would that solve? |
12:51:25 | FromDiscord | <auxym> it allows you to enforce the nim version as a dependency in PKGBUILD, whether the user has choosenim or not |
12:51:50 | FromDiscord | <auxym> and it shouldn't break the user's choosenim setup as long as the choosenim path is before the system stuff in PATH, which it should |
12:56:24 | * | tinystoat quit (Remote host closed the connection) |
12:57:13 | NimEventer | New thread by FabienPRI: Dynamic shared libs, see https://forum.nim-lang.org/t/9054 |
12:57:27 | FromDiscord | <Zoom> Hm, in case of Arch this may be ok, since all versions (arch32, archlinuxarm) actually include `nim` as a package. But↵● system version of the compiler potentially taking precedence over choosenim↵● measly program requiring installing the compiler from the distro repo even though Nim community recommends using choosenim↵does concern me. |
13:03:12 | FromDiscord | <auxym> yeah, it's a compromise, but I don't think you can do much else and still keep a fully-automatic build |
13:04:24 | FromDiscord | <Zoom> That's not as important as the other problem with deps overwrites. At least the `nimble install` will fail as the package has a requirement for the nim version. |
13:05:11 | FromDiscord | <auxym> the alternative I guess is have a bash script that: checks the version of system nim if any, else checks for presence of choosenim, install / choose the nim version in choosenim (which is persistent, not ideal), if neither system nim or choosenim is present then install nim via pacman |
13:06:05 | FromDiscord | <auxym> doesn't the fakeroot thing mentioned by rika and pmunch solve the nimble issue? not familiar with that tbh |
13:06:12 | FromDiscord | <Zoom> Currently I'm still trying to understand where does the `makepkg` script get the version info |
13:06:39 | FromDiscord | <Zoom> https://gitlab.archlinux.org/pacman/pacman/-/blob/master/scripts/makepkg.sh.in |
13:07:48 | FromDiscord | <Zoom> Nope, you're supposed to handle the dependenies in the `build()` section of the PKGBUILD file, but it enters the fakeroot only on issuing the `install`↵(@auxym) |
13:09:45 | * | neurocyte0917090 joined #nim |
13:10:34 | * | neurocyte0917090 is now known as neurocyte |
13:10:56 | FromDiscord | <auxym> well you could make your `nimble install` calls in install() no? |
13:15:56 | FromDiscord | <Zoom> If I move all the nimble stuff into the `package` part of the PKGBUILD, from what I'm seeing, makepkg informs `Entering fakeroot environment...` but nimble still reports that it overwrites the libs. |
13:27:25 | * | dtomato quit (Read error: Connection reset by peer) |
13:27:55 | * | dtomato joined #nim |
13:30:15 | FromDiscord | <Zoom> You know what, I'm being silly here. The core of the issue is that I'm installing deps explicitly with `nimble install` before issuing `nimble build` anyway, which does its thing to satisfy the dependencies. However, were I to not using `nimble build` for actually building the program, I'd have no way of ensuring the deps are there without overwriting them just using `nimble`. So I'm going to file an issue with nimble to add this functionali |
13:32:29 | * | tinystoat joined #nim |
13:40:05 | PMunch | @Elegantbeef, pushed my changes now: https://github.com/PMunch/autotemplate |
13:40:27 | PMunch | Now I guess I should rip out the Jester part and make it a library.. |
13:51:57 | FromDiscord | <Solitude> In reply to @Zoom "You know what, I'm": why arent you using nimbleDir? |
13:58:44 | * | arkurious joined #nim |
14:02:25 | FromDiscord | <Zoom> Wouldn't it be nice to reuse packages already present in the system? We don't aim to make a reproducible clean-slate build. |
14:03:26 | FromDiscord | <Solitude> but then you get screwed by `#HEAD` pacakges installed on user system |
14:03:50 | FromDiscord | <Solitude> pretty saving a megabyte of traffic isnt worth it |
14:03:53 | FromDiscord | <Solitude> pretty sure |
14:04:26 | FromDiscord | <Solitude> and you still can reuse them on rebuilds |
14:04:27 | * | PMunch quit (Quit: Leaving) |
14:08:31 | FromDiscord | <auxym> In reply to @Solitude "why arent you using": is there a way to set nimbleDir without overwriting the user's nimble.ini? |
14:08:39 | FromDiscord | <Zoom> May be it's the way. What's the most bulletproof way to issue `mkdtemp` inside `TMPDIR` on arch to set `nimbleDir` |
14:09:02 | FromDiscord | <Zoom> Yep `--nimbleDir`\: https://github.com/nim-lang/nimble#nimbles-folder-structure-and-packages |
14:09:26 | FromDiscord | <Zoom> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/958004697564860437): May be it's the way. What's the most bulletproof way to issue `mkdtemp` inside `TMPDIR` on arch to set `nimbleDir`? |
14:09:35 | FromDiscord | <Solitude> In reply to @auxym "is there a way": as a cmdline parameter |
14:10:29 | FromDiscord | <auxym> damn, that was my first idea, but nimble's README didn't mention that option, so didn't think it was possible |
14:10:36 | FromDiscord | <auxym> I do agree that is the best way |
14:11:55 | FromDiscord | <auxym> actually it is mentioned, I just suck at ctrl-f apparently |
14:13:17 | * | rockcavera quit (Remote host closed the connection) |
14:23:57 | FromDiscord | <Zoom> So, do you think we should recommend this for all package maintainers? In case of arch, you can just set the `--nimbleDir="$srcdir"` This will lead to every Nim package having it's own nimble directory with a separate `packages_official.json` and `package_temp.json` totaling over 1.2MB. That's not counting duplicate package directories. |
14:24:25 | FromDiscord | <Zoom> No bueno, in my book |
14:34:10 | FromDiscord | <auxym> no worse than node's node_modules, or python having no way to install different package versions concurrently |
14:34:20 | FromDiscord | <auxym> not sure how go/rust handle it though |
14:43:18 | FromDiscord | <Solitude> In reply to @Zoom "So, do you think": thats literally nothing |
14:45:49 | FromDiscord | <Rika> In reply to @auxym "no worse than node's": way less worse than node_modules xddd |
14:47:19 | FromDiscord | <Zoom> I don't support this attitude. 640K should be enough for everything. In all seriousness, there should be a valid reason for wastefulness.↵(@Solitude) |
14:52:51 | FromDiscord | <huantian> In reply to @Zoom "So, do you think": Are you not supposed to do that? I’ve always done this for my Nim pkgbuild a |
14:52:55 | FromDiscord | <huantian> (edit) "pkgbuild a" => "pkgbuilds" |
14:54:33 | * | slowButPresent joined #nim |
14:54:47 | FromDiscord | <auxym> In reply to @Zoom "I don't support this": the valid reason is predictable build in the presence of an arbitrary, unknown config on the user's machine |
14:56:47 | * | noeontheend joined #nim |
14:56:56 | FromDiscord | <Zoom> Ok, I'm convinced. Do you think a transient mount should be used then, and not package manager's cache for the unique nimble directory? |
14:57:40 | FromDiscord | <huantian> Mmmm I don’t know I just kinda copied how node packages did it, redirecting the node cache to srcdir |
15:04:41 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
15:04:44 | FromDiscord | <huantian> Though thinking about it, does that mean one should use a different Nim cache location? |
15:27:18 | FromDiscord | <Zoom> sent a code paste, see https://paste.rs/tQU |
15:36:52 | FromDiscord | <Solitude> In reply to @Zoom "I don't support this": arch is wasteful at every corner, you're just being consistent |
15:38:11 | nrds | <Prestige99> Everything is wasteful nowadays |
15:42:59 | * | noeontheend quit (Ping timeout: 250 seconds) |
16:19:07 | FromDiscord | <Forest> Has someone managed to convert all of CPython to Nim somehow with an automated tool? |
16:19:28 | FromDiscord | <Rika> no? why? |
16:19:33 | FromDiscord | <Forest> Is that even possible to do without a ton of manual tweaking? |
16:19:36 | FromDiscord | <Forest> Just curious |
16:21:16 | FromDiscord | <Rika> probably not? |
16:22:07 | FromDiscord | <Forest> Hm |
16:22:38 | FromDiscord | <Solitude> try it and tell us |
16:32:52 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
16:34:45 | * | Lord_Nightmare joined #nim |
16:38:18 | * | jmdaemon joined #nim |
16:43:19 | FromDiscord | <auxym> it's almost certainly impossible to convert all python to nim, with all the dynamic stuff, monkey patching, etc |
16:43:55 | FromDiscord | <auxym> In reply to @Solitude "arch is wasteful at": yes, I love that pacman by defaults never cleans its cache, slowly filling up your disk for yeas |
16:43:58 | FromDiscord | <auxym> years |
16:51:16 | FromDiscord | <tandy> anyone familiar with emit / importjs ? |
16:52:16 | FromDiscord | <tandy> i need to generate the following code\:↵`import { Platform, Client, LoadStatus, createNavigation, createRouter, RoomViewModel, TimelineView } from "hydrogen-view-sdk";`↵where `{ Platform, Client, LoadStatus, createNavigation, createRouter, RoomViewModel, TimelineView }` and `hydrogen-view-sdk` are parameters |
16:53:51 | FromDiscord | <tandy> my current code\:↵`func importFromModule(module, library: cstring) {.importjs: "import # from #".}`generates the following with excess quotes on the first parameter\:↵`import "{ Platform, Client, LoadStatus, createNavigation, createRouter, RoomViewModel, TimelineView }" from "hydrogen-view-sdk";` |
16:54:13 | FromDiscord | <tandy> is there a way to get rid of the quotes? |
16:54:16 | FromDiscord | <tandy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/958046272927985724): my current code\:↵`func importFromModule(module, library: cstring) {.importjs: "import # from #".}`generates the following with excess quotes on the first parameter\:↵`import "{ Platform, Client }" from "hydrogen-view-sdk";` |
17:08:04 | * | rockcavera joined #nim |
17:08:05 | * | rockcavera quit (Changing host) |
17:08:05 | * | rockcavera joined #nim |
17:11:59 | * | Guest46 joined #nim |
17:12:10 | * | Guest46 quit (Client Quit) |
17:18:29 | * | pro joined #nim |
17:38:36 | * | Zectbumo joined #nim |
17:43:33 | FromDiscord | <Phil> I'll answer you anything you could ever want to know about prologue. Nim-js conversion is just a bit beyond me |
17:53:20 | * | noeontheend joined #nim |
18:17:10 | FromDiscord | <tandy> hehe |
18:17:28 | FromDiscord | <tandy> i figured out how to use nim with vite, so now i just have to figure out how to generate proper js |
18:28:19 | FromDiscord | <tandy> sent a code paste, see https://paste.rs/Uod |
18:31:52 | * | noeontheend quit (Ping timeout: 260 seconds) |
18:43:49 | * | vicfred joined #nim |
18:54:19 | FromDiscord | <Forest> What's be the best format for storing level data? |
18:55:02 | FromDiscord | <Forest> It'd need to be flexible so it can be generated with a tool (a level editor) but it also needs to be able to support complex logic (stuff that moves and can perhaps use JS to do stuff maybe?) |
19:06:53 | FromDiscord | <Rika> ~~json?~~ |
19:11:22 | FromDiscord | <spoon> ldtk level editor uses json too |
19:13:51 | FromDiscord | <spoon> and rpgmaker, think it's a solid choice |
19:20:23 | FromDiscord | <Schelz> Does someone knows how to resolve this error for webgui library ? https://media.discordapp.net/attachments/371759389889003532/958083148418281472/unknown.png |
19:22:15 | FromDiscord | <pmunch> @Forest\: if you're looking at embedding logic into the file I guess Nimscript would be a good choice |
19:22:20 | FromDiscord | <pmunch> With macros and stuff it's flexible enough to give you pretty much any syntax you want for your normal variables. And with nimscripter it's fairly easy to throw code in there which can be called on runtime |
19:22:46 | FromDiscord | <pmunch> Certainly easier than somehow embedding a JavaScript interpreter |
19:34:35 | * | pro quit (Quit: pro) |
19:36:43 | FromDiscord | <Forest> Hm okay then, thanks! |
19:41:03 | FromDiscord | <exelotl> In reply to @Schelz "Does someone knows how": it's trying to add something to the end of something but the parent is null... that's all I've got 😅 |
19:47:12 | FromDiscord | <Schelz> ik its frustrating cause i did same as in the examples doc but for me it shows this error |
19:48:18 | FromDiscord | <Schelz> sent a code paste, see https://play.nim-lang.org/#ix=3TJi |
19:49:20 | FromDiscord | <spoon> lol flatty and supersnappy are really cool for storing objects, but i guess it makes sense that it would break if you tried to store an object with a proc |
19:49:56 | FromDiscord | <Schelz> ? |
19:50:18 | FromDiscord | <spoon> i'm testing object serialization |
19:50:31 | FromDiscord | <Schelz> oh tehe |
19:56:48 | * | kenran joined #nim |
20:06:09 | FromDiscord | <spoon> hard to tell if it's just not anticipated use or if it's just impossible with the way the compiler works, but i'd imagine the latter |
20:06:31 | FromDiscord | <spoon> maybe i can get it working if i got it to use nimscript instead of a proc |
20:10:07 | FromDiscord | <auxym> yeah I don't think that's going to be possible: serialization aims to be portable between architectures, so you can eg send some data from a windows x86 machine to a mac M1 over the network. procs are executable code so won't be portable. |
20:11:34 | FromDiscord | <auxym> not sure why you need the serialization (persistence on disk, or multiplayer gaming?) but maybe reconsider the architecture |
20:13:10 | FromDiscord | <spoon> right now it's just a fun experiment, but i'm eventually planning on using the same sort of stuff for save games |
20:15:53 | FromDiscord | <spoon> (and since i want to have objects with unique abilities and scripting/modability, objects with procedures are part of that) |
20:17:14 | FromDiscord | <auxym> yeah I have no experience in game dev, but you can ask in #gamedev |
20:20:10 | FromDiscord | <Elegantbeef> The biggest issue with supersnappy/flatty is they lack versioning imo |
20:20:44 | FromDiscord | <Recruit_main707> In reply to @spoon "(and since i want": i dont have much information but it sounds you would be better off using methods rather than objects with procedures as part of them |
20:20:45 | FromDiscord | <Elegantbeef> As such i've got a small toy i've written that makes it a bit more sensible though there are some potholes |
20:21:39 | FromDiscord | <Elegantbeef> Object variants with named procedures or methods would probably be the best |
20:21:59 | * | fowl quit (Quit: cya pals) |
20:22:09 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Tfi skip to line 80 here to see what my silly versioned data is like |
20:23:50 | * | fowl joined #nim |
20:41:28 | nrds | <Prestige99> Beef do you use Nim at work? |
20:45:57 | * | LuxuryMode joined #nim |
21:01:27 | NimEventer | New thread by Arrrrrx2: Did nimc become faster?, see https://forum.nim-lang.org/t/9056 |
21:09:15 | FromDiscord | <Phil> In reply to @spoon "(and since i want": Out of curiosity, why store procs in an object like that?↵It sounds like you're recreating java objects, thus my question. |
21:11:05 | FromDiscord | <Forest> Would it be practical to make bindings for Nimscripter to other languages? |
21:11:40 | FromDiscord | <spoon> In reply to @Isofruit "Out of curiosity, why": mostly for supporting nimscript, i want certain scriptable objects, like a sword that has a unique scripted function like teleport to random spot on hit for example |
21:12:13 | FromDiscord | <Forest> Also how fast is Nimscript now? From what i remember before apparently it was horribly slow |
21:12:43 | FromDiscord | <spoon> not entirely sure, cant say i've done a lot with it |
21:12:56 | FromDiscord | <spoon> if its horrible i might have to go the lua route |
21:13:20 | FromDiscord | <Phil> In reply to @spoon "not entirely sure, cant": Is there a limitation with normal module procs that you run into (e.g. can't import the module to where it'd be needed)? Or is this more for the syntax of `object.someproc()`? |
21:13:55 | FromDiscord | <spoon> my attack function runs object.onHit(enemy) for special weapons |
21:14:46 | FromDiscord | <Phil> Ah, so you'd have different instances of weapon that deal different damage despite being of the same type |
21:15:07 | FromDiscord | <Phil> So you'd want to attach individual damage procs to each weapon instance? |
21:16:31 | FromDiscord | <Phil> Hmmm, never encountered this type of problem to solve before, it seems like an interesting solution for hyper invididual behaviour of objects that share types |
21:16:41 | FromDiscord | <Phil> (edit) "types" => "type" |
21:16:51 | FromDiscord | <exelotl> In reply to @Forest "Also how fast is": runtime performance is decent (similar performance to Python iirc), it's just the startup time which sucks... at least if you're using the Nim compiler to run the scripts (e.g. `nim e`), I'm not sure if it's the same for embedded Nimscript |
21:17:37 | FromDiscord | <Forest> Ah okay, thanks! |
21:17:49 | FromDiscord | <Forest> In reply to @spoon "not entirely sure, cant": Fair |
21:19:13 | * | xet7 joined #nim |
21:20:20 | FromDiscord | <spoon> In reply to @Isofruit "Hmmm, never encountered this": yea, my goal down the line is to make an ss13-like where a gm is able to quickly prototype stuff, but that depends on how secure i think i can get nimscript |
21:20:30 | FromDiscord | <Forest> In reply to @Forest "Would it be practical": Anyone? :P |
21:20:45 | FromDiscord | <spoon> right now i'm testing a lot of what i think i'll be doing with a roguelike |
21:21:02 | FromDiscord | <Forest> In reply to @spoon "yea, my goal down": Isn't Nimscript really flexible? Also if Nimscript doesn't fit, Lua is also a good choice |
21:21:11 | * | kenran quit (Quit: WeeChat info:version) |
21:21:12 | FromDiscord | <spoon> yea, luas my backup option |
21:21:13 | FromDiscord | <Forest> Or Wren, which is another small embeddable language |
21:21:21 | FromDiscord | <Forest> Though that's more like Java |
21:21:24 | FromDiscord | <Forest> In reply to @spoon "yea, luas my backup": Fair |
21:21:40 | FromDiscord | <spoon> ive been able to do a lot of that in gmod with luapad |
21:22:14 | FromDiscord | <Phil> If you want webstuff about prologue, I'm your man.↵Connection pooling, architecture, making generic CRUD, no problem.↵Nimscript, not so much. |
21:22:14 | FromDiscord | <spoon> but its not built to have weapons/stuff inserted mid-game |
21:22:29 | FromDiscord | <Phil> (edit) "CRUD," => "CRUD API endpoints," |
21:22:41 | * | Jjp137 quit (Quit: Leaving) |
21:23:15 | FromDiscord | <Phil> (edit) "If you want webstuff about prologue, I'm your man.↵Connection pooling, architecture, making generic CRUD API endpoints, no problem.↵Nimscript, not so much. ... " added "(Directed at Forest)" |
21:24:31 | FromDiscord | <Phil> Hmm for that kind of thing, particularly also with randomizing items, I think the approach of storing the desired behaviour for a given instance in the object might be a good one |
21:24:53 | FromDiscord | <spoon> ye |
21:24:56 | FromDiscord | <Phil> Have you contemplated random constructors? |
21:25:12 | FromDiscord | <spoon> cant say i've heard of them |
21:25:46 | FromDiscord | <Phil> Not a specific construct, just a proc that returns a constructor with random attribute chosen from attribute lists |
21:26:03 | FromDiscord | <Phil> Like, make a seq of available damage procs, other seqs for other behaviour procs and then write a constructor proc that builds an instance with a random entry from each. |
21:26:25 | FromDiscord | <Phil> That's assuming you do random items that can have whatever behaviour |
21:26:38 | FromDiscord | <Phil> (edit) "behaviour" => "behaviour/ be a mixture of any set of X attributes" |
21:27:20 | FromDiscord | <Phil> Eh, I think I should shut up, you'll know what you want, I was just thinking out loud |
21:31:54 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
21:32:05 | FromDiscord | <spoon> nah was just driving home |
21:32:13 | * | jmdaemon joined #nim |
21:32:54 | FromDiscord | <spoon> do you mean having a sequence of preset effects having a sequence of them? |
21:36:25 | FromDiscord | <Phil> Yeah, you can have `var damageProcs: seq[proc(weaponInstance: WeaponType)]` |
21:36:32 | FromDiscord | <Phil> And then randomly select from that |
21:36:40 | FromDiscord | <Phil> Repeat for various procs and attributes of an item |
21:36:48 | FromDiscord | <Phil> (edit) "item" => "item, optionally associated with probabilities" |
21:40:14 | FromDiscord | <spoon> yea, will probably have that since it'd probably be more efficient than getting nimscript involved just to add a status effect in thats gonna be repeated 50 times |
21:42:55 | * | wyrd quit (Ping timeout: 240 seconds) |
21:44:06 | FromDiscord | <Recruit_main707> reallocating will usually be faster than deallocating and allocating again right? |
21:45:01 | * | wyrd joined #nim |
21:55:34 | * | ltriant quit (Ping timeout: 272 seconds) |
21:56:14 | FromDiscord | <Elegantbeef> Prestige how many times to we go over this, i'm not a professional developer |
21:56:53 | nrds | <Prestige99> I don't believe you |
21:57:00 | FromDiscord | <Elegantbeef> Why? |
21:57:08 | nrds | <Prestige99> You'll slip up one day and tell me the truth :P |
21:57:23 | FromDiscord | <Elegantbeef> I'm an unemployed self taught schmuck |
21:58:28 | FromDiscord | <Elegantbeef> Why dont you believe me? |
21:58:34 | nrds | <Prestige99> Well I'm sure you could get a programming job somewhere if you wanted tbh |
21:58:43 | nrds | <Prestige99> Because you're a good programmer |
21:59:27 | FromDiscord | <Elegantbeef> I'm also fantastically bad at working on a single thing |
22:06:19 | nrds | <Prestige99> eh, same |
22:06:58 | FromDiscord | <Phil> In reply to @Elegantbeef "I'm also fantastically bad": You say that, but I'm still in love with constructor |
22:07:36 | FromDiscord | <Elegantbeef> Constructor is kinda my point 😛 |
22:07:44 | FromDiscord | <Elegantbeef> I have like 30000 different small project repos |
22:08:24 | * | oprypin quit (Quit: Bye) |
22:08:28 | nrds | <Prestige99> My biggest long-term project was nimdow but I sort of did that out of necessity |
22:09:29 | FromDiscord | <Elegantbeef> Oh prestige did i ever show traitor to you? |
22:09:37 | nrds | <Prestige99> I don't think so |
22:09:52 | nrds | <Prestige99> but also I'm an old man and forget things |
22:09:56 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor#what-does-it-do |
22:10:10 | FromDiscord | <Phil> If I ever finish my backend I'm feeling sorely tempted to make a package that is pretty much norm, prologue and tinypool glued together with some additions only possible if you have an orm bundled into a web-framework, like generic CRUD endpoints, generic repositories, signal systems etc. |
22:10:38 | * | ltriant joined #nim |
22:11:46 | nrds | <Prestige99> That's cool beef |
22:11:47 | FromDiscord | <Elegantbeef> Runtime interfaces backed by new concepts(though could be replaced with just a macro) |
22:11:51 | * | Jjp137 joined #nim |
22:12:17 | nrds | <Prestige99> 2 questions, 1. "# Objects smaller than 24 bytes need `{.byref.}`" is that different than just making it a ref object? |
22:12:27 | nrds | <Prestige99> and 2. what does emitconverters do? |
22:19:14 | FromDiscord | <Elegantbeef> Anywho how goes your 2D engine prestige |
22:19:30 | FromDiscord | <Elegantbeef> Yes |
22:19:55 | FromDiscord | <Elegantbeef> I need to get around to fixing that requirement, just need to emit an aliased procedure |
22:20:02 | FromDiscord | <Elegantbeef> 2. it emits converters to that collection of types |
22:20:22 | FromDiscord | <Elegantbeef> I dont feel like doing all combinations of types on completion of their implementations |
22:20:26 | FromDiscord | <Elegantbeef> It's just a fucking hassle if you ask me |
22:21:23 | FromDiscord | <Elegantbeef> Imagine you have `Clickable, Draggable, Fireable....` that's a lot of compile time code generated that you might not need |
22:21:29 | FromDiscord | <Elegantbeef> So slows down compilation and is just complicated logically |
22:22:02 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor/blob/master/tests/test.nim#L19-L48 showcases the logic kinda |
22:22:18 | FromDiscord | <Elegantbeef> That makes it so you can convert to `DuckObject` `BoundObject` and the union of the two |
22:22:50 | nrds | <Prestige99> ah, okay |
22:22:51 | FromDiscord | <exelotl> Prestige: the byref pragma just forces "passing by reference" which means that procedures receive a pointer to the object, instead of a copy of the object. |
22:23:07 | FromDiscord | <exelotl> meanwhile `ref` types in Nim are reference-counted |
22:23:11 | nrds | <Prestige99> my engine is going well, last thing I really need is the collision broad phase.. but all else is working well |
22:23:13 | FromDiscord | <Elegantbeef> I just need to generate a hidden alias procedure for that, i just havent got around to it |
22:23:22 | nrds | <Prestige99> https://github.com/avahe-kellenberger/shade#clone-and-setup if you want to try out the examples Elegantbeef |
22:23:47 | nrds | <Prestige99> exelotl hmm interesting |
22:24:26 | FromDiscord | <Elegantbeef> like it should do a `proc hiddenImplOnClick(radio: ptr Radio)` that copies the body of the `onClick` |
22:24:52 | FromDiscord | <Elegantbeef> Which is only used for the dynamic dispatch, otherwise it uses your version |
22:28:11 | * | ltriant_ joined #nim |
22:29:08 | * | ltriant quit (Ping timeout: 272 seconds) |
22:30:04 | nrds | <Prestige99> hm I have my engine setting up sdl and other deps via git submodules, building them inside the engine repo, and adding them to the user's PATH. This works well for development inside the repo, but not if someone uses `nimble develop` and tries to use it in their own project |
22:30:33 | nrds | <Prestige99> Need a way to keep that exported path, or to also use the library's config.nims for projects that use it as a dep |
22:30:35 | FromDiscord | <Elegantbeef> Also generally useless on \nix |
22:30:49 | nrds | <Prestige99> wdym? |
22:31:35 | FromDiscord | <Elegantbeef> I'd personally rather use my package manager to fetch the dev libraries than have to build them from source |
22:32:01 | FromDiscord | <Elegantbeef> II guess with gpu it makes sense as it's not shipped commonly on package repos |
22:32:20 | nrds | <Prestige99> yeah |
22:32:31 | nrds | <Prestige99> and some are not up to date enough, like ubuntu's SDL2 |
22:32:35 | FromDiscord | <Elegantbeef> But with ttf and sdl2 they're in my package repo |
22:34:09 | FromDiscord | <Elegantbeef> Pmunch i do not get why you said my solution wouldnt work |
22:36:18 | FromDiscord | <Elegantbeef> This does remind me it's time to move distro |
22:36:21 | FromDiscord | <Elegantbeef> Just gotta figure out which |
22:36:43 | nrds | <Prestige99> What are you looking for? |
22:37:00 | FromDiscord | <Elegantbeef> Something that doesnt piss me off with outdate packages 😛 |
22:37:10 | nrds | <Prestige99> Arch :P |
22:37:13 | FromDiscord | <Elegantbeef> Perhaps thinking about doing debian |
22:37:29 | FromDiscord | <Elegantbeef> Eh i'm lazy |
22:37:43 | nrds | <Prestige99> me too, arch is easy after you get it set up |
22:37:55 | FromDiscord | <Elegantbeef> "get it setup" is the issue |
22:37:56 | FromDiscord | <spoon> manjaro then |
22:38:05 | nrds | <Prestige99> manjaro is a dumpster fire |
22:38:07 | FromDiscord | <spoon> manjaro is plug and play like ubuntu |
22:38:09 | FromDiscord | <Elegantbeef> Endeavour before manjaro |
22:38:26 | FromDiscord | <spoon> hate apt though |
22:38:33 | FromDiscord | <Elegantbeef> Prestige i'm so lazy i'm using regolith cause i couldnt be arsed to setup i3wm and just keep my .files |
22:40:28 | FromDiscord | <Ayy Lmao> Are `type` and `typeof` essentially the same thing? |
22:40:34 | nrds | <Prestige99> I mean it's pretty easy to set up, hell arch even has an installer now |
22:40:36 | FromDiscord | <Elegantbeef> yes |
22:41:03 | FromDiscord | <Elegantbeef> Eh i'm probably just going to go with deb to stick to something i'm somewhat familiar with |
22:41:11 | FromDiscord | <Ayy Lmao> Sweet, thanks! |
22:41:21 | FromDiscord | <Elegantbeef> Generally it's suggested now to use `typeof` |
22:41:28 | FromDiscord | <Elegantbeef> It's more clear than `type` |
22:42:39 | FromDiscord | <Elegantbeef> Might also try btrfs finally |
22:43:12 | FromDiscord | <spoon> is there a way to check if an object is either of the type or inherits from the type? |
22:43:21 | FromDiscord | <Elegantbeef> `if x of Y` |
22:43:31 | nrds | <Prestige99> I hear about issues with btrfs occasionally, I'm sticking with ext4 for a long while |
22:44:01 | nrds | <Prestige99> But yeah, try out arch or endeavour or garuda maybe |
22:44:17 | FromDiscord | <Elegantbeef> Prestige disregarding me, name a more common event |
22:44:45 | FromDiscord | <Elegantbeef> "Think i'm going to go with debian".... prestige\: "I'll pretend I didnt see that" |
22:44:50 | nrds | <Prestige99> oh I missed that message :P |
22:44:53 | nrds | <Prestige99> haha |
22:44:55 | FromDiscord | <huantian> In reply to @Elegantbeef "Might also try btrfs": I’ve heard good stuff about that |
22:44:58 | FromDiscord | <huantian> And it’s fun to say |
22:45:01 | FromDiscord | <huantian> Cus butter |
22:45:07 | nrds | <Prestige99> I thought deb's packages were like very out of date |
22:45:27 | nrds | <Prestige99> well stable at least, I guess they have a rolling release distro |
22:45:28 | FromDiscord | <huantian> Not if you use whatever debians rolling release version they have is called |
22:45:34 | FromDiscord | <Elegantbeef> rolling debian |
22:45:40 | nrds | <Prestige99> tumbleweed? icr |
22:46:03 | FromDiscord | <huantian> Ah yeah that’s what it’s called |
22:46:15 | * | oprypin joined #nim |
22:46:32 | FromDiscord | <huantian> Haha I get it |
22:46:44 | FromDiscord | <Elegantbeef> Debian's is sid not tumbleweed! |
22:46:57 | nrds | <Prestige99> who is tumbleweed, suse? |
22:47:08 | FromDiscord | <Elegantbeef> Yea |
22:47:39 | FromDiscord | <Elegantbeef> Now to quickly see if i have any toy projects that need uploaded 😛 |
22:49:38 | FromDiscord | <huantian> Names are hard why don’t they just call it Debian but rolling |
22:50:56 | * | oprypin quit (Client Quit) |
22:51:16 | * | oprypin joined #nim |
22:51:32 | FromDiscord | <Elegantbeef> Rollbian |
22:51:56 | FromDiscord | <Elegantbeef> Though it's mostly just different package sources so it's just debian but unstable 😛 |
22:52:51 | nrds | <Prestige99> Hm, how am I going to add this dir to the user's PATH... |
22:52:56 | FromDiscord | <Elegantbeef> Well later i need to go ruin my day |
22:53:00 | FromDiscord | <auxym> yeah sid is basically debian's "devel" branch |
22:53:05 | FromDiscord | <huantian> You mean Debian but usable |
22:53:11 | FromDiscord | <huantian> Bye beef 🌊 |
22:53:12 | nrds | <Prestige99> Updating with `putEnv` only persists during execution of the program/script it seems |
22:53:28 | nrds | <Prestige99> Well said huantain |
22:53:46 | FromDiscord | <huantian> In reply to @nrds "<Prestige> Updating with `putEnv`": That is how shell envs work |
22:53:57 | FromDiscord | <auxym> why do you want to fuck with people's path? |
22:54:17 | nrds | <Prestige99> dependencies for my library |
22:54:22 | FromDiscord | <huantian> Just manually add it to their bash rc I’m sure they won’t notice |
22:54:30 | nrds | <Prestige99> Lol |
22:54:56 | nrds | <Prestige99> I just need the deps added while someone is using my game engine, essentially |
22:55:44 | nrds | <Prestige99> If you look at https://github.com/avahe-kellenberger/shade/blob/master/config.nims it's using a local `.usr` dir, which is where the submodules build and place their .so files |
22:57:58 | FromDiscord | <auxym> so it's for .so files, not for calling executables? |
22:58:06 | nrds | <Prestige99> Yeah |
22:58:53 | FromDiscord | <auxym> i don't remember the exact flag but you can pass in extra library lookup paths on the command line |
23:00:07 | FromDiscord | <huantian> `LD_LIBRARY_PATH`? |
23:01:27 | nrds | <Prestige99> yeah that's one of the things I'm setting |
23:01:48 | nrds | <Prestige99> but can only seem to be able to set it inside my local repo, not one that's using my lib as a dependency |
23:02:13 | FromDiscord | <auxym> I was thinking `--clibdir` actually |
23:02:36 | FromDiscord | <auxym> but it probably has the same effect |
23:02:55 | nrds | <Prestige99> but then how do I set it up so that a project using my game engine will have that configured? |
23:02:58 | nrds | <Prestige99> That's what I'm stuck on |
23:04:10 | FromDiscord | <auxym> maybe `.link.` or `.passL` pragma? |
23:04:41 | FromDiscord | <auxym> or just provide a project template / tell people to add the `clibdir` switch to their config.nims |
23:06:10 | FromDiscord | <auxym> I believe `{.passL: "-L/path/to/your/libs"}` would have the same effect as clibdir |
23:07:17 | nrds | <Prestige99> hm I'd need to like find the path that nimble puts the project in, maybe |
23:08:33 | FromDiscord | <auxym> yeah not sure if you can make it a relative path |
23:22:07 | * | Jjp137 quit (Ping timeout: 250 seconds) |
23:22:26 | * | Jjp137 joined #nim |
23:27:07 | nrds | <Prestige99> wonder if anyone has tried this before |
23:33:00 | FromDiscord | <salt> sent a code paste, see https://play.nim-lang.org/#ix=3TK5 |
23:33:57 | FromDiscord | <exelotl> I guess cause `ord` is generic or has several overloads, so it doesn't know what version of `ord` to use |
23:35:31 | FromDiscord | <salt> i'll try to remember this, thanks |
23:36:13 | FromDiscord | <huantian> look at the error: `Error: 'ord' cannot be passed to a procvar` |
23:37:17 | FromDiscord | <exelotl> ah I guess I'm wrong and it's because `ord` is compiler magic? |
23:40:29 | FromDiscord | <exelotl> wow https://play.nim-lang.org/#ix=3TK9 |
23:41:06 | FromDiscord | <exelotl> I'm impressed that the compiler is smart enough to do this |
23:42:16 | FromDiscord | <exelotl> In reply to @salt "i'll try to remember": now you have to un-remember it because it was wrong xD |
23:43:15 | FromDiscord | <thadeudepaula> sent a long message, see http://ix.io/3TK8 |
23:44:16 | FromDiscord | <salt> In reply to @exelotl "now you have to": lol |
23:45:08 | FromDiscord | <salt> In reply to @huantian "look at the error:": yeah, the error doesn't let me know why i can't pass it, i thought maybe it was an obvious reason to those familiar with the language |
23:46:24 | FromDiscord | <spoon> i wish i could use compiler magic 😢 when do i get to define my own "xor" operator and get to put them between two variables like and |
23:46:49 | Zectbumo | like in lisp? |
23:47:23 | FromDiscord | <salt> i'm rewriting a python project in nim and there are parts of it that feel like even less boilerplate even with a compiled language, it's really nice |
23:48:32 | FromDiscord | <spoon> lisp better metaprogramming than nin wtf? |
23:49:08 | FromDiscord | <salt> maybe, but harder (to (look at)) |
23:49:40 | Zectbumo | :)))))))))) |
23:56:54 | nrds | <Prestige99> Maybe someone like @dom96 would know |
23:56:59 | nrds | <Prestige99> regarding my above question |
23:57:28 | nrds | <Prestige99> maybe I should just bootstrap it in my module's main file.. hmm |
23:58:16 | FromDiscord | <auxym> Prestige: where are these so files you want to link coming from? Are you distributing prebuilt so files with your nimble package? |
23:58:54 | FromDiscord | <auxym> If not, and the user is building them, then why are they in the nimble dir and not in your build output dir? |
23:58:56 | nrds | <Prestige99> sort of, there's a nimble task named "setup" that builds them into a local directory |
23:59:55 | FromDiscord | <auxym> ok, then I suggest that this local directory be a subdir of the user's project dir, like "build" or "PrestigeLibraryBuild" or whatever |