<< 28-03-2022 >>

00:00:17*tk quit (Quit: Well, this is unexpected.)
00:00:42*tk joined #nim
00:04:22FromDiscord<m4ul3r> til that godbolt supported nim, very cool
00:06:51Amun-Rahttps://www.youtube.com/watch?v=kBAMtM5xNkM
00:06:53Amun-Raah, sorry
00:07:05Amun-Rawrong window, not nim related
00:07:39FromDiscord<Elegantbeef> Interesting video selection 😛
00:08:39Amun-Rathat was something I was going to add to my to watch list but messed up the dest. tab
00:13:51Amun-Rahmm, I guess I've found a bug in nim compiler
00:15:02FromDiscord<Elegantbeef> Hey i love nim compiler bugs
00:16:14Amun-Rait's my third one, now I have to force myself to make a test case
00:16:28FromDiscord<Elegantbeef> Well i'll take a look at it if it's not too complex
00:17:01Amun-Rait popped in a quite large project
00:18:48FromDiscord<Elegantbeef> What's it related to?
00:19:16Amun-Rafunction pointers set to nil in const objects
00:21:20*Zectbumo joined #nim
00:21:21Amun-Ragimme sec
00:23:42Amun-Raand the test case compiles
00:26:08Amun-RaElegantbeef: https://dpaste.com/HKV2XVZLP
00:27:44Amun-RaI'll have to copy all the project and keep only relevant code
00:29:18FromDiscord<Elegantbeef> Oh a codegen error
00:29:44FromDiscord<Elegantbeef> How are you generating these objects?
00:33:33Amun-RaElegantbeef: https://dpaste.com/EC9DVMEXG
00:36:35Amun-RaI'll make a test case tomorrow and keep you posted
00:38:00*noeontheend joined #nim
00:58:32FromDiscord<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:56FromDiscord<Elegantbeef> Sounds like user permission issues perhaps
01:00:05FromDiscord<Elegantbeef> If you run the program with elevated permissions does it work?
01:00:24FromDiscord<Elegantbeef> Dont know BSD much, so just extrapolating Linux knowledge
01:01:58FromDiscord<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:41FromDiscord<Elegantbeef> You're doing a TCP request so it's the other part
01:05:03FromDiscord<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:23FromDiscord<Elegantbeef> Though that's 'UNIX domaiin sockets'
01:05:55FromDiscord<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:11NimEventerNew 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:12NimEventerNew thread by Solomonthewise: Parseint not defined for char., see https://forum.nim-lang.org/t/9053
02:01:23FromDiscord<Bubblie> How do I update nim
02:01:28FromDiscord<Bubblie> Do I just
02:01:31FromDiscord<Bubblie> Re install or
02:01:45FromDiscord<Elegantbeef> Ideally you use choosenim and then just do `choosenim update stable`
02:02:01FromDiscord<Bubblie> Oh alright let me get choosenim
02:02:09FromDiscord<Bubblie> I kinda did everything manually
02:02:15FromDiscord<Elegantbeef> Uninstall your installation before you get it
02:02:24FromDiscord<Bubblie> Also msvc is giving me a terrible time atm I hate windows
02:02:27FromDiscord<Bubblie> In reply to @Elegantbeef "Uninstall your installation before": Alright
02:02:57FromDiscord<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:01FromDiscord<Bubblie> (edit) "thebass" => "the ass"
02:03:15FromDiscord<Bubblie> Or my dev environment
02:03:26FromDiscord<Bubblie> Its most likely windows
02:36:45FromDiscord<Girvo> Hi all!
02:37:32FromDiscord<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:59FromDiscord<Girvo> sent a code paste, see https://paste.rs/vG8
02:38:24FromDiscord<Elegantbeef> Does it require resetting the editor?↵(@Girvo)
02:38:44FromDiscord<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:46FromDiscord<Girvo> @ElegantBeef Nah, I've reset everything, even a completely fresh install triggers it. Some others have run into as well
02:39:20FromDiscord<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:08FromDiscord<Girvo> https://github.com/saem/vscode-nim/issues/75
02:40:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TEX
02:40:46FromDiscord<Girvo> Oh neat!
02:40:47FromDiscord<Girvo> Cheers
02:41:22FromDiscord<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:07FromDiscord<Elegantbeef> I totally follow yes i totally do, this is not a facetious statement
02:43:21FromDiscord<Girvo> hahaha
02:44:08FromDiscord<Elegantbeef> I'm assuming you have 512 bytes off EEPROM and you want to queue 1 byte acctions onto it
02:44:46FromDiscord<Girvo> Effectively, though the access/storage of it is... idiosyncratic 🙂
02:45:06FromDiscord<Elegantbeef> Interesting
02:45:59FromDiscord<spoon> ah nim vscode
02:46:05FromDiscord<creikey> I think my nim install is doomed
02:46:06FromDiscord<spoon> i had to switch to a different version of that
02:46:46FromDiscord<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:02FromDiscord<morgan> i've been using saem's
02:47:16FromDiscord<spoon> yeah i'm using saem's too
02:47:17FromDiscord<morgan> made a few changes that got PR'd in for better regexes
02:47:40FromDiscord<spoon> why's there one above it in search
02:48:00FromDiscord<huantian> because algorithm
02:48:43FromDiscord<kipukun> @ElegantBeef to follow up, running the program as root gives the same error.
02:48:50FromDiscord<spoon> i don't think it's maintained anymore, right?
02:48:51FromDiscord<kipukun> i haven't checked the strace output yet though.
02:50:09FromDiscord<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:38FromDiscord<Elegantbeef> @Girvo\: what's the idiosyncratic method of accessing/pushing?
02:52:32FromDiscord<Elegantbeef> @morgan\: probably the best you're going to get https://github.com/search?q=language%3Anim+audio
02:53:27FromDiscord<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:55FromDiscord<Elegantbeef> `too low level` doubt we have Nim
02:54:07FromDiscord<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:30FromDiscord<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:25FromDiscord<Girvo> now, to work out how to use a C-level attribute macro in Nim lol
02:57:44FromDiscord<Girvo> `RTC_NOINIT_ATTR uint32_t rtc_noinit_data;`
02:58:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TEY
02:58:49FromDiscord<Elegantbeef> sorry latter should be `pop`
02:58:51FromDiscord<morgan> In reply to @Elegantbeef "<@277133333773811712>\: probably the best": ok so looks like nobody has done what i’m looking for
02:59:08FromDiscord<Elegantbeef> If they have they havent uploaded it publicly to github
03:00:29FromDiscord<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:43FromDiscord<Elegantbeef> Ah guess that is very naive
03:01:48FromDiscord<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:51FromDiscord<Elegantbeef> Since eeprom seems to be persistent storage
03:02:12FromDiscord<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:28FromDiscord<Girvo> Which is literally like RAM that happens to survive a reset. Which is wild
03:02:51FromDiscord<Elegantbeef> You say that like ram cant survive a reset
03:03:21FromDiscord<Elegantbeef> Non volatile ram goes brrr, oh wait no one uses it
03:03:27FromDiscord<Girvo> haha
03:03:54FromDiscord<Girvo> NVRAM actually _does_ get used for embedded stuff sometimes
03:04:14FromDiscord<Girvo> Specifically as an EEPROM alternative!
03:04:57*LuxuryMode joined #nim
03:05:30FromDiscord<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:55FromDiscord<Elegantbeef> What is the actual macro?
03:05:59LuxuryModeI 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:17FromDiscord<Girvo> Testament is the go-to
03:06:33LuxuryModethanks
03:06:33FromDiscord<Girvo> I still use `unittest` but thats because I have some weird requirements working in embedded stuff
03:06:37FromDiscord<Elegantbeef> Testament, unittest and balls are the 3 most used
03:06:50FromDiscord<Elegantbeef> Eh i use unit test for my stuff though it's small stuff
03:06:57FromDiscord<Elegantbeef> > how do I import a function I've defined elsewhere into my test
03:06:59FromDiscord<Girvo> Yeah I still really like it for really simple things
03:07:03FromDiscord<Elegantbeef> You cant
03:07:14FromDiscord<Elegantbeef> If it's inside a `test` block it's gensymd and not accessible
03:07:40FromDiscord<Elegantbeef> You can work around that by using a global variable and assigning that to the proc if you want
03:08:06FromDiscord<huantian> balls is fun because balls
03:08:07FromDiscord<LuxuryMode> I see everyone's on discord so I'm here now 🙂
03:08:26FromDiscord<Elegantbeef> I'm not on discord
03:08:26FromDiscord<huantian> well not everyone is on discord
03:08:27FromDiscord<Elegantbeef> Huan isnt on discord
03:08:27FromDiscord<Elegantbeef> There is only a single discord user presently
03:08:37FromDiscord<Elegantbeef> The fucking Australian doesnt get the memo
03:08:39FromDiscord<LuxuryMode> oh
03:08:44FromDiscord<LuxuryMode> back to IRC then lol
03:08:53FromDiscord<Elegantbeef> No go to matrix!
03:08:53FromDiscord<Elegantbeef> 😛
03:09:01FromDiscord<Elegantbeef> Use what ever you prefer
03:09:19FromDiscord<Girvo> `#define RTC_NOINIT_ATTR _SECTION_ATTR_IMPL(".rtc_noinit", COUNTER)`
03:09:25FromDiscord<Girvo> @ElegantBeef ^^
03:10:00FromDiscord<Elegantbeef> you could make a template that gensyms it that way so you'd do somethiing like `var myVar {.rtcNoInit.} = 10`
03:10:20FromDiscord<Elegantbeef> Not that i really get what that does
03:10:22FromDiscord<Girvo> Neat, yeah I'll take a crack at it
03:10:36LuxuryModegensym = generate symbol?
03:10:37FromDiscord<Elegantbeef> code gens it that way
03:10:41FromDiscord<Elegantbeef> That's what i meant
03:10:42FromDiscord<Elegantbeef> Yes
03:10:55LuxuryModeI can't just import a proc I've written?
03:11:03FromDiscord<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:03FromDiscord<Elegantbeef> `{.pragma: codegendecl"yourgenstatement here".}`
03:11:06FromDiscord<Elegantbeef> What's your code luxury
03:11:22FromDiscord<Elegantbeef> It's hard to say the issue without the code
03:11:41FromDiscord<Elegantbeef> Yea like i said a macro or pragma is the best here
03:11:48FromDiscord<Girvo> Yeah I think you're right
03:11:50FromDiscord<Girvo> Cheers!
03:12:02FromDiscord<Elegantbeef> It'll let you annotate it, and aslong as you import that C file that declares it you're fine
03:12:12LuxuryModeRight 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:22FromDiscord<Elegantbeef> ah
03:12:27FromDiscord<Elegantbeef> `countWords`
03:12:31FromDiscord<Elegantbeef> You need to export procedures in Nim
03:12:37FromDiscord<Girvo> The `` marks it as exported 🙂
03:12:52FromDiscord<Elegantbeef> I thought you were talking about having a procedure declared inside a test and accessing it from other tests
03:13:09LuxuryModehah no no
03:13:28FromDiscord<Elegantbeef> Well that solves that issue in a way that isnt a hack 😛
03:14:01LuxuryModeI assume you mean *? That symbol doesn't show up coming from Discord
03:14:29FromDiscord<Elegantbeef> Yea it's a bridge bug
03:14:38FromDiscord<Elegantbeef> it appears as greater than or equal to iirc
03:14:50LuxuryModeshows up as a blank square for me
03:14:56FromDiscord<Elegantbeef> Ah
03:15:07LuxuryModebut ok so just `proc myProc*..(arg1, arg2)...`?
03:15:15FromDiscord<Elegantbeef> Yep
03:15:25LuxuryModedidn't mean the dots before (arg1) whoops
03:15:41FromDiscord<Elegantbeef> well if you have generic params or a constrain
03:15:47FromDiscord<Elegantbeef> It's sensible accidently
03:15:49LuxuryModethat's a pretty elegant way to mark procs as public
03:15:58LuxuryModeLove that I can just look at the function and tell from itself
03:15:58FromDiscord<Elegantbeef> It's the same for all symbols
03:16:27FromDiscord<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:43LuxuryModeright ok
03:17:00LuxuryModeand for another noob question: how do I import it now in the test file?
03:18:46FromDiscord<Elegantbeef> `import myfilename`
03:19:19FromDiscord<Elegantbeef> assuming you have a `config.nims` that does `switch("path", "$projectDir/../src")` inside your `tests` folder
03:19:42LuxuryModeI don't :)
03:19:57LuxuryModewill add one
03:21:23LuxuryMode`Success: All tests passed` Woot!!
03:23:41FromDiscord<Elegantbeef> You're now a leet Nim programmer
03:23:59FromDiscord<huantian> I thought that happens when you write a macro
03:24:15LuxuryModehehe indeed. Thanks for all the help
03:24:42FromDiscord<Elegantbeef> Seems like someone is doing their implementation of countwords to go against that benchmark 😛
03:26:02LuxuryModelol 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:32FromDiscord<Elegantbeef> Ah there is a common benchmark of languages that uses countwords as the task
03:27:01FromDiscord<huantian> which benchmark is this? I only remember the times people benchmark nim against rust \:P
03:27:06LuxuryModeRight, I may have come across that recently. Showed Nim and Rust neck in neck IIRC
03:27:27FromDiscord<Elegantbeef> https://benhoyt.com/writings/count-words/ i think is the common one
03:27:49FromDiscord<Elegantbeef> Nim is 4th on there
03:28:37FromDiscord<huantian> grep is too good
03:29:43LuxuryModeBeats Rust handily
03:30:15LuxuryModeI 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:39FromDiscord<Elegantbeef> yea it's circlekerky
03:30:43FromDiscord<Elegantbeef> jerky even
03:31:37LuxuryMode:P
03:32:50FromDiscord<Elegantbeef> languages at the level of nim give the same performance if you have a brain
03:33:13FromDiscord<Elegantbeef> The question is the ease of doing it
03:33:56FromDiscord<huantian> I didn't check the nim code, didi t just use `CountTable`?
03:34:08FromDiscord<Elegantbeef> dont recall, think so
03:34:21LuxuryModehttps://github.com/benhoyt/countwords/blob/master/optimized.nim
03:34:32LuxuryMode`from tables import initCountTable,`
03:35:12FromDiscord<huantian> from imports? is this python smh
03:35:58LuxuryModeha didn't even notice that. Did not know you could do from imports in Nim
03:36:11LuxuryModeIs there another way to import a specific type or proc?
03:36:45FromDiscord<Elegantbeef> They're dumb generally
03:36:53FromDiscord<Elegantbeef> Idiomatic Nim just does `import module`
03:37:12FromDiscord<huantian> and uses `import module except conflict` if there's any conflicting symbols
03:37:30FromDiscord<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:30LuxuryModeI see
03:45:15*jmdaemon joined #nim
03:45:52FromDiscord<Elegantbeef> Despite appearances Nim and Python should be written differently 😛
03:50:32FromDiscord<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:59FromDiscord<Girvo> Though that used to be more common back in the pre 1.0 days I think
03:51:02FromDiscord<Elegantbeef> A few people say that i'm not one of them
03:51:53FromDiscord<enthus1ast> i'll try to create a minimal test case, currently its quite a big codebase↵(@xflywind)
03:53:31FromDiscord<xflywind> In reply to @enthus1ast "i'll try to create": what's problem?
03:57:40FromDiscord<enthus1ast> the SIGSEGV when useing prologue
03:58:32FromDiscord<enthus1ast> but yeah i'll try to create a small testcase, have not documented the crash anywhere yet
03:58:54FromDiscord<xflywind> I see
04:02:39FromDiscord<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:02FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma
04:03:08FromDiscord<Girvo> Champion
04:03:52FromDiscord<Girvo> My google-fu is weak today
04:04:04FromDiscord<Elegantbeef> Just ctrl + f the manual for random keywords 😛
04:04:09FromDiscord<Elegantbeef> Nim isnt very good to search
04:04:32FromDiscord<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:04FromDiscord<huantian> can't wait until in five years nim becomes the dominant programming language and google searches will be easier
04:06:34FromDiscord<Elegantbeef> Just have 8000 writeups hosted on the website problem solved
04:07:03FromDiscord<Girvo> Ah hah! It works. I have crash-proof RTC "slow" memory working 😄
04:07:22FromDiscord<Elegantbeef> I assume you're just using a pragma pragma
04:09:06*rockcavera quit (Remote host closed the connection)
04:11:51FromDiscord<Girvo> At the moment yeah
04:11:53FromDiscord<huantian> pragma pragma pragma? pragma
04:12:06FromDiscord<Girvo> `RTC_NOINIT_ATTR NI tmain_46;`
04:12:25FromDiscord<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:44FromDiscord<huantian> pragma is such a funny word I don't know why
04:17:00FromDiscord<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:08FromDiscord<Girvo> `result[4].add [ident"codegenDecl"]`
04:29:31FromDiscord<Girvo> How would one pass the `: "blah arguments here"` to this macro to build the pragma?
04:29:49FromDiscord<Elegantbeef> `macros.dumptree` is your friend
04:30:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TF7
04:30:58FromDiscord<Elegantbeef> Need to work on micros more
04:31:07FromDiscord<Elegantbeef> This is as good as a time as any
04:31:35FromDiscord<Girvo> Dope
04:31:38FromDiscord<Girvo> Cheers
04:32:50FromDiscord<Elegantbeef> Now if only Kate was updated on my package repository
04:34:33FromDiscord<huantian> maybe just download a deb manually for now
04:34:44FromDiscord<Elegantbeef> It doesnt have any
04:34:56FromDiscord<Elegantbeef> It has appimages that have bugs it seems
04:35:14FromDiscord<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:29FromDiscord<huantian> yk I might actually switch to kate for quick editing instead of notepadqq
04:36:39FromDiscord<huantian> since I am using KDE
04:38:18FromDiscord<huantian> also notepadqq is buggy
04:38:49FromDiscord<Elegantbeef> kate + lsp is lovely for Nim so far
04:38:54FromDiscord<Girvo> sent a code paste, see https://play.nim-lang.org/#ix=3TF8
04:38:57FromDiscord<Girvo> This is definitely not right hey lol
04:39:15FromDiscord<Elegantbeef> remove the `[]`
04:39:28FromDiscord<huantian> does nimslp have semantic highlighting?
04:39:48FromDiscord<Girvo> Ah!
04:39:50FromDiscord<Girvo> Perfect cheers
04:40:02FromDiscord<Elegantbeef> Dont think it does huan
04:43:39FromDiscord<Girvo> Hm I've still done something not right. Alright time for some macro debugging lol
05:23:02FromDiscord<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:17FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3TFi
06:40:52FromDiscord<Elegantbeef> Well yea
06:41:03FromDiscord<enthus1ast> yea?
06:41:05FromDiscord<Elegantbeef> Yes
06:41:13FromDiscord<Elegantbeef> Gensym happens inside the compiler to the symbol
06:41:22FromDiscord<enthus1ast> it should generate nimjaTmplVar\_someRandomStuff or?
06:41:31FromDiscord<enthus1ast> s
06:41:32FromDiscord<Elegantbeef> You can or you can just use the generated symbol
06:41:41FromDiscord<Elegantbeef> What're you trying to do verbatim
06:44:49FromDiscord<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:16FromDiscord<enthus1ast> hard times to explain lol
06:45:26FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/FxA
06:45:43FromDiscord<enthus1ast> (its rubbish i know)
06:46:16FromDiscord<Elegantbeef> I dont quite get why you need a gensym for this
06:46:52FromDiscord<enthus1ast> how would you generate a variable with a random name and also get the variable name as a string?
06:47:26FromDiscord<enthus1ast> so that it does not pollute the outer scope?
06:47:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TFk
06:49:15FromDiscord<enthus1ast> so it is already unique o.0
06:49:22FromDiscord<Elegantbeef> Templates are hygenic
06:49:30FromDiscord<enthus1ast> even if i do {.inject.}
06:49:38FromDiscord<Elegantbeef> No inject makes them non hygenic
06:49:43FromDiscord<Elegantbeef> That's the entire point of inject
06:50:04FromDiscord<enthus1ast> the problem is jester in fact
06:50:14FromDiscord<enthus1ast> @"foo" is not available in the proc
06:50:22FromDiscord<enthus1ast> ok let my just try it
06:50:39FromDiscord<enthus1ast> maybe i'm overthinking this
06:50:46FromDiscord<Elegantbeef> Perhaps
06:56:17FromDiscord<enthus1ast> mh no, it needs to be injected
06:56:32FromDiscord<enthus1ast> withouth this the nimja macros cannot see the var
06:56:40FromDiscord<Elegantbeef> `block:`?
06:57:03FromDiscord<enthus1ast> mhh
06:57:22FromDiscord<enthus1ast> ah, then i must use the gensymed name of.
06:57:39FromDiscord<Elegantbeef> I dont fully see the issue, so cant help much
06:58:23FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3TFm
06:58:44FromDiscord<enthus1ast> tmpls is a shortcut for compiling the template directly withouh wrapping in an extra proc
06:59:07FromDiscord<enthus1ast> jester does some magic to `@"name"` so its not a global
06:59:39FromDiscord<enthus1ast> so i need to change `tmpls` to a template (was a proc first)
07:01:04FromDiscord<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:37FromDiscord<enthus1ast> i thought the best way is to generate a unique variable name, and give this name to the nimja procs
07:04:29FromDiscord<Elegantbeef> So the issue is that jester takes an untyped statement and as such `@name` isnt replaced?
07:04:55FromDiscord<enthus1ast> `@"name"` is then not known in the nimja macros
07:05:03FromDiscord<Elegantbeef> So you need something like `templs("<h1>$#</h1>", @name)`?
07:05:39FromDiscord<enthus1ast> this could be an option, but its a semantic i do not want currently
07:06:33FromDiscord<Elegantbeef> Well you can always make you `templs` emit an overload which is what i suggested
07:07:31FromDiscord<Elegantbeef> then you just do `$1`, `$2`... inside your string and use the Nim strutils `%` at compile time
07:07:38FromDiscord<Elegantbeef> Or runtime rather
07:07:53FromDiscord<enthus1ast> tmpls compiles nimja templates
07:07:58*gsalazar joined #nim
07:08:09FromDiscord<Elegantbeef> I dont get how you can compile the template without the symbol in scope
07:08:14FromDiscord<Elegantbeef> So i guess i'll shush
07:08:52FromDiscord<enthus1ast> i think i cannot explain my issue correctly \:) , i'll play with it and report
07:10:20FromDiscord<Elegantbeef> Well have fun, i cannot understand a lick of the issue
07:15:39FromDiscord<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:25PMunch@enthus1ast, what you want is something like this: https://play.nim-lang.org/#ix=3TFu
08:24:28PMunchEssentially 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:51PMunchFor the tmpls thing I believe you want something like this: https://play.nim-lang.org/#ix=3TFv
08:27:36FromDiscord<Elegantbeef> I have 0 clue how you've got to that answer pmunch 😛
08:30:09PMunchWhat do you mean?
08:30:23FromDiscord<Elegantbeef> I still dont get the problem
08:30:48FromDiscord<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:54FromDiscord<Elegantbeef> So i guess it's time i move to a proper distro
08:31:01PMunchAaah, that makes sense :P
08:31:08PMunchBut no, I hadn't seen that
08:31:16FromDiscord<enthus1ast> ive fixed it during the train ride \:)
08:31:27FromDiscord<Elegantbeef> Imagine having trains
08:31:36PMunchTrains are neat
08:32:02PMunchNice combination of comfort and speed
08:32:12FromDiscord<enthus1ast> https://play.nim-lang.org/#ix=3TFw
08:33:08PMunchWhy do you need the name as a string?
08:33:11FromDiscord<Elegantbeef> Isnt that just an elaborate `asttoStr nimjaTmplsVar`?
08:33:32FromDiscord<enthus1ast> i use the string in the parser to generate code
08:33:42PMunchThat sounds like a bad idea
08:34:02FromDiscord<enthus1ast> i tried to just use a NimNode but i could not have `result` as a parameter
08:34:15FromDiscord<Elegantbeef> Why cant you?
08:34:34FromDiscord<enthus1ast> its unknown
08:35:28FromDiscord<enthus1ast> yep
08:35:30FromDiscord<enthus1ast> its asttostr
08:35:32FromDiscord<enthus1ast> thank you
08:35:43FromDiscord<Elegantbeef> I suggested that earlier
08:35:47FromDiscord<Elegantbeef> You ignored me
08:35:53FromDiscord<Elegantbeef> Shame on you!
08:36:05FromDiscord<enthus1ast> what??
08:36:08FromDiscord<enthus1ast> lemme scroll up
08:36:21FromDiscord<enthus1ast> ah ye
08:36:22FromDiscord<enthus1ast> s
08:36:25FromDiscord<Elegantbeef> Literally my first example is what you used
08:36:28FromDiscord<enthus1ast> yes
08:36:43FromDiscord<enthus1ast> sorry, i read it but not read it correclty
08:38:27*jmdaemon quit (Ping timeout: 252 seconds)
08:46:56PMunchHmm, maybe I should support both nimja and onionhammer templates in autotemplates
08:47:21FromDiscord<Elegantbeef> autotemplates?
08:47:43PMunchOne of my small experiments I'm considering to make into an actual library
08:48:07PMunchhttps://github.com/PMunch/autotemplate
08:49:37PMunchThe meat of the experiment being here: https://github.com/PMunch/autotemplate/blob/master/src/autotemplates.nim
08:50:19FromDiscord<Elegantbeef> `t.kind == nnkBracketExpr and t[0].repr == "typeDesc"` `t.typeKind == ntyTypeDesc`
08:50:40PMunchOh right :P
08:50:51PMunchI wrote all of that in a hurry just to test if it would work
08:51:02FromDiscord<enthus1ast> nimja is onionhammer templates on steroids
08:51:07FromDiscord<Elegantbeef> also `newLit t.typeKind == ntyTypeDesc` 😛
08:51:15*Gustavo6046 joined #nim
08:51:30FromDiscord<enthus1ast> I've used onionhammers templates before i build nimja
08:51:50PMunchWhat where the things you ran into with onionhammer templates that made you write Nimja?
08:52:09FromDiscord<Elegantbeef> I dont know what these templaters are for so i'll just nod
08:52:20FromDiscord<enthus1ast> no comments
08:52:24FromDiscord<enthus1ast> strange syntax
08:52:36FromDiscord<enthus1ast> porting issues (was porting stuff from jinja2 and twig)
08:52:43FromDiscord<enthus1ast> no exends
08:52:49FromDiscord<enthus1ast> extends
08:53:07FromDiscord<enthus1ast> strange syntax is of. opinonated
08:53:09PMunch@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:34PMunchExtends is nice
08:53:53PMunchAnd I've only done the most trivial things, so haven't really gotten anything to say on syntax
08:54:19PMunchOne thing I noticed is that Nimja seems to require more special characters than onionhammers
08:54:42FromDiscord<enthus1ast> i mean its modeled after jinja twig django templates etc
08:54:55FromDiscord<enthus1ast> i know its quite verbose, but a well known syntax
08:55:23FromDiscord<enthus1ast> so if you know one of the big template engines, you can just start with nimja
08:55:35PMunchAah, that is probably a big pluss
09:14:52*Zectbumo quit (Remote host closed the connection)
09:23:06PMunchHmm, for autotemplates it would be nice if it called `toHtml` for all subtypes recursively instead of just calling $
09:23:27PMunchTried something like: https://play.nim-lang.org/#ix=3TFF
09:23:41PMunchBut that fails because it just gets resolved recursively
09:25:05PMunchAh nice, this works: https://play.nim-lang.org/#ix=3TFG
09:25:20FromDiscord<Elegantbeef> Fuck you're silly
09:25:25PMunchSilly?
09:25:43FromDiscord<Elegantbeef> Ah nvm i guess `system.$` isnt always what you want
09:26:04PMunchHaha, no I thought of that as well
09:26:38PMunchI mean the goal is to turn `SomeName.ext` into `proc toExt(x: SomeName): string`
09:26:51FromDiscord<vindaar> PMunch\: feel free to ping me here of course for the plotly use case you have. Might be easier
09:27:28PMunch@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:51PMunchWithout having to reverse engineer the display functions
09:27:58FromDiscord<Elegantbeef> Hmm pmunch cant you just dp `proc toHtml(x: auto): string = $x`?
09:28:18FromDiscord<Elegantbeef> Then any type that overrides that would be dispatch upon since it'd be specialized
09:28:37PMunch@Elegantbeef, I could, but the problem is that the templating engine calls `$`
09:29:39PMunchSo I need to bind `$` to `toHtml` if `toHtml` is defined for an arbitrary type, otherwise to the previously defined `$`
09:31:27FromDiscord<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:15PMunchWell I need to check if `toHtml` exists for that type
09:33:53FromDiscord<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:56FromDiscord<Rika> Right?
09:34:33FromDiscord<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:58FromDiscord<Rika> So inside your function, if to html doesn’t exist then $ doesn’t exist either so error out
09:35:04PMunchThis is closer to what the actual library would look like: https://play.nim-lang.org/#ix=3TFI
09:35:18FromDiscord<Elegantbeef> Rika is right though
09:35:26FromDiscord<Elegantbeef> the generic `$` inside `toHtml` will not be used
09:35:48FromDiscord<Elegantbeef> Wait it seems like it is
09:35:49FromDiscord<Elegantbeef> That's odd
09:36:18FromDiscord<Elegantbeef> Ah nvm it is i was dumb
09:37:12FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3TFM there
09:37:38FromDiscord<Elegantbeef> Not that this really matters, but yea
09:37:58FromDiscord<Elegantbeef> If `$` is defined for the type the `$` isnt called
09:38:08FromDiscord<Elegantbeef> Well the allias isnt needed
09:38:33PMunchAh..
09:38:34PMunchDamn it..
09:38:47FromDiscord<Rika> Now praise me and my big brain!
09:38:52FromDiscord<Elegantbeef> You just need to specialize your `$`
09:39:19FromDiscord<vindaar> PMunch\: just put a more detailed explanation into that issue
09:40:33FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3TFN here pmunch
09:41:54PMunchIx isn't working for me right now and I have to go to lunch
09:41:55FromDiscord<Rika> Woah didn’t know you could shadow function declarations
09:42:04PMunchThis is basically what I want to have happen: https://pastebin.com/M6nji0Dx
09:46:09FromDiscord<Elegantbeef> What i just provided should give that
09:46:55FromDiscord<Elegantbeef> we alias `$` only if `toHtml` exists and if an instance is a proc for our type
09:47:09FromDiscord<Elegantbeef> Otherwise we use `$`
09:47:35*jjido joined #nim
09:49:06FromDiscord<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:03PMunch@Elegantbeef, the problem with your version is that I need to know all the types beforehand
10:20:59PMunchIs there any way I can undefine $?
10:22:00FromDiscord<Rika> Not without importing with exclude, and even then you will have difficulty dealing with system
10:22:12PMunchHmm
10:22:40PMunchSo there's no way I can override all $ calls in a block of code?
10:22:49FromDiscord<Rika> You should probably just change whatever template library you’re using to use to html instead of $
10:23:08PMunchThat is an option..
10:23:09FromDiscord<Rika> You could probably if wrapped in a macro? Perhaps with extreme difficulty
10:23:19FromDiscord<Rika> In reply to @PMunch "That is an option..": It’s surely the easiest option
10:23:44PMunchBut I kinda wanted to be able to use any templating library
10:23:59PMunchI don't really want to write my own..
10:24:08FromDiscord<Rika> Then those libraries shouldn’t use $ I’d say
10:24:39PMunchOne thing I could do is to use a macro to traverse the object and generate all the `$` procedure overloads
10:30:55FromDiscord<Rika> If a type already has $ defined then you might hit an issue unless wrapped in a proc or a block perhaps?
10:31:56PMunchWell that's not an issue
10:32:03PMunchIt will always be wrapped in a proc
10:32:33PMunchBasically I want to auto-generate toX given a type and a set of templates for different X's
10:32:56PMunchBut if an object has a field I want that to call toHtml recursively
10:33:01PMunchOr toX rather
11:05:29*reversem3[m] quit (Quit: User was banned)
11:41:47FromDiscord<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:32FromDiscord<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:02FromDiscord<auxym> good question. maybe you could setup a temporary nimble path for your build? not sure if nimble supports that, lemme look
11:50:26FromDiscord<Rika> dont aur packs usually get built in fake roots anyway
11:54:06FromDiscord<auxym> yeah nimble doesn't seem to have that feature :/
11:55:40FromDiscord<auxym> would be useful to be able to set the NIMBLE_PACKAGES_DIR environment variable or something like that
11:56:32PMunchYeah packages on Arch should be built in a fakeroot and then everything is copied over
11:57:00PMunchI believe you will get errors saying that file X already exists in filesystem if it would overwrite something
11:57:59PMunchBut does your program have a runtime dependency from a Nimble package?
12:00:28FromDiscord<Zoom> It looks like does, but as far as I can tell, nimble packages got overwritten in the main cache dir.↵(@Rika)
12:01:09FromDiscord<Zoom> Runtime dependency? Nope, only build dependency↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
12:02:18FromDiscord<Zoom> So, from what I'm seeing, nimble installs from PKBUILD `build` section (where they belong) are happening before makepkg enters fakeroot
12:04:39FromDiscord<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:02PMunchHmm, that sounds strange
12:09:33PMunchOkay @Elegantbeef, I've got it working now
12:10:22PMunchNow it generates `toHtml`, `toCSS` etc. for the various file types you have in your folder
12:10:56PMunchAnd generations happens recursively, and you're able to overload with custom procedures
12:11:45PMunchNow 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:07PMunchImagine we have .html and .xml files for example, or maybe .html and .rss
12:12:54PMunchI 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:30FromDiscord<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:53FromDiscord<Rika> choosenim installs to ~/.nimble/bin/nim which is a shim binary (i think) to ~/.choosenim/toolchains/nim-{version}/bin/nim
12:42:28FromDiscord<Zoom> @auxym wdym? Call nim to check the version manually?
12:43:34FromDiscord<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:30FromDiscord<Zoom> [dom96](https://matrix.to/#/@dom96:matrix.org)\: do you have any thoughts on this?
12:49:14FromDiscord<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:25FromDiscord<Rika> what would that solve?
12:51:25FromDiscord<auxym> it allows you to enforce the nim version as a dependency in PKGBUILD, whether the user has choosenim or not
12:51:50FromDiscord<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:13NimEventerNew thread by FabienPRI: Dynamic shared libs, see https://forum.nim-lang.org/t/9054
12:57:27FromDiscord<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:12FromDiscord<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:24FromDiscord<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:11FromDiscord<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:05FromDiscord<auxym> doesn't the fakeroot thing mentioned by rika and pmunch solve the nimble issue? not familiar with that tbh
13:06:12FromDiscord<Zoom> Currently I'm still trying to understand where does the `makepkg` script get the version info
13:06:39FromDiscord<Zoom> https://gitlab.archlinux.org/pacman/pacman/-/blob/master/scripts/makepkg.sh.in
13:07:48FromDiscord<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:56FromDiscord<auxym> well you could make your `nimble install` calls in install() no?
13:15:56FromDiscord<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:15FromDiscord<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:05PMunch@Elegantbeef, pushed my changes now: https://github.com/PMunch/autotemplate
13:40:27PMunchNow I guess I should rip out the Jester part and make it a library..
13:51:57FromDiscord<Solitude> In reply to @Zoom "You know what, I'm": why arent you using nimbleDir?
13:58:44*arkurious joined #nim
14:02:25FromDiscord<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:26FromDiscord<Solitude> but then you get screwed by `#HEAD` pacakges installed on user system
14:03:50FromDiscord<Solitude> pretty saving a megabyte of traffic isnt worth it
14:03:53FromDiscord<Solitude> pretty sure
14:04:26FromDiscord<Solitude> and you still can reuse them on rebuilds
14:04:27*PMunch quit (Quit: Leaving)
14:08:31FromDiscord<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:39FromDiscord<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:02FromDiscord<Zoom> Yep `--nimbleDir`\: https://github.com/nim-lang/nimble#nimbles-folder-structure-and-packages
14:09:26FromDiscord<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:35FromDiscord<Solitude> In reply to @auxym "is there a way": as a cmdline parameter
14:10:29FromDiscord<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:36FromDiscord<auxym> I do agree that is the best way
14:11:55FromDiscord<auxym> actually it is mentioned, I just suck at ctrl-f apparently
14:13:17*rockcavera quit (Remote host closed the connection)
14:23:57FromDiscord<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:25FromDiscord<Zoom> No bueno, in my book
14:34:10FromDiscord<auxym> no worse than node's node_modules, or python having no way to install different package versions concurrently
14:34:20FromDiscord<auxym> not sure how go/rust handle it though
14:43:18FromDiscord<Solitude> In reply to @Zoom "So, do you think": thats literally nothing
14:45:49FromDiscord<Rika> In reply to @auxym "no worse than node's": way less worse than node_modules xddd
14:47:19FromDiscord<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:51FromDiscord<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:55FromDiscord<huantian> (edit) "pkgbuild a" => "pkgbuilds"
14:54:33*slowButPresent joined #nim
14:54:47FromDiscord<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:56FromDiscord<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:40FromDiscord<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:44FromDiscord<huantian> Though thinking about it, does that mean one should use a different Nim cache location?
15:27:18FromDiscord<Zoom> sent a code paste, see https://paste.rs/tQU
15:36:52FromDiscord<Solitude> In reply to @Zoom "I don't support this": arch is wasteful at every corner, you're just being consistent
15:38:11nrds<Prestige99> Everything is wasteful nowadays
15:42:59*noeontheend quit (Ping timeout: 250 seconds)
16:19:07FromDiscord<Forest> Has someone managed to convert all of CPython to Nim somehow with an automated tool?
16:19:28FromDiscord<Rika> no? why?
16:19:33FromDiscord<Forest> Is that even possible to do without a ton of manual tweaking?
16:19:36FromDiscord<Forest> Just curious
16:21:16FromDiscord<Rika> probably not?
16:22:07FromDiscord<Forest> Hm
16:22:38FromDiscord<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:19FromDiscord<auxym> it's almost certainly impossible to convert all python to nim, with all the dynamic stuff, monkey patching, etc
16:43:55FromDiscord<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:58FromDiscord<auxym> years
16:51:16FromDiscord<tandy> anyone familiar with emit / importjs ?
16:52:16FromDiscord<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:51FromDiscord<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:13FromDiscord<tandy> is there a way to get rid of the quotes?
16:54:16FromDiscord<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:33FromDiscord<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:10FromDiscord<tandy> hehe
18:17:28FromDiscord<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:19FromDiscord<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:19FromDiscord<Forest> What's be the best format for storing level data?
18:55:02FromDiscord<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:53FromDiscord<Rika> ~~json?~~
19:11:22FromDiscord<spoon> ldtk level editor uses json too
19:13:51FromDiscord<spoon> and rpgmaker, think it's a solid choice
19:20:23FromDiscord<Schelz> Does someone knows how to resolve this error for webgui library ? https://media.discordapp.net/attachments/371759389889003532/958083148418281472/unknown.png
19:22:15FromDiscord<pmunch> @Forest\: if you're looking at embedding logic into the file I guess Nimscript would be a good choice
19:22:20FromDiscord<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:46FromDiscord<pmunch> Certainly easier than somehow embedding a JavaScript interpreter
19:34:35*pro quit (Quit: pro)
19:36:43FromDiscord<Forest> Hm okay then, thanks!
19:41:03FromDiscord<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:12FromDiscord<Schelz> ik its frustrating cause i did same as in the examples doc but for me it shows this error
19:48:18FromDiscord<Schelz> sent a code paste, see https://play.nim-lang.org/#ix=3TJi
19:49:20FromDiscord<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:56FromDiscord<Schelz> ?
19:50:18FromDiscord<spoon> i'm testing object serialization
19:50:31FromDiscord<Schelz> oh tehe
19:56:48*kenran joined #nim
20:06:09FromDiscord<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:31FromDiscord<spoon> maybe i can get it working if i got it to use nimscript instead of a proc
20:10:07FromDiscord<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:34FromDiscord<auxym> not sure why you need the serialization (persistence on disk, or multiplayer gaming?) but maybe reconsider the architecture
20:13:10FromDiscord<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:53FromDiscord<spoon> (and since i want to have objects with unique abilities and scripting/modability, objects with procedures are part of that)
20:17:14FromDiscord<auxym> yeah I have no experience in game dev, but you can ask in #gamedev
20:20:10FromDiscord<Elegantbeef> The biggest issue with supersnappy/flatty is they lack versioning imo
20:20:44FromDiscord<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:45FromDiscord<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:39FromDiscord<Elegantbeef> Object variants with named procedures or methods would probably be the best
20:21:59*fowl quit (Quit: cya pals)
20:22:09FromDiscord<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:28nrds<Prestige99> Beef do you use Nim at work?
20:45:57*LuxuryMode joined #nim
21:01:27NimEventerNew thread by Arrrrrx2: Did nimc become faster?, see https://forum.nim-lang.org/t/9056
21:09:15FromDiscord<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:05FromDiscord<Forest> Would it be practical to make bindings for Nimscripter to other languages?
21:11:40FromDiscord<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:13FromDiscord<Forest> Also how fast is Nimscript now? From what i remember before apparently it was horribly slow
21:12:43FromDiscord<spoon> not entirely sure, cant say i've done a lot with it
21:12:56FromDiscord<spoon> if its horrible i might have to go the lua route
21:13:20FromDiscord<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:55FromDiscord<spoon> my attack function runs object.onHit(enemy) for special weapons
21:14:46FromDiscord<Phil> Ah, so you'd have different instances of weapon that deal different damage despite being of the same type
21:15:07FromDiscord<Phil> So you'd want to attach individual damage procs to each weapon instance?
21:16:31FromDiscord<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:41FromDiscord<Phil> (edit) "types" => "type"
21:16:51FromDiscord<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:37FromDiscord<Forest> Ah okay, thanks!
21:17:49FromDiscord<Forest> In reply to @spoon "not entirely sure, cant": Fair
21:19:13*xet7 joined #nim
21:20:20FromDiscord<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:30FromDiscord<Forest> In reply to @Forest "Would it be practical": Anyone? :P
21:20:45FromDiscord<spoon> right now i'm testing a lot of what i think i'll be doing with a roguelike
21:21:02FromDiscord<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:12FromDiscord<spoon> yea, luas my backup option
21:21:13FromDiscord<Forest> Or Wren, which is another small embeddable language
21:21:21FromDiscord<Forest> Though that's more like Java
21:21:24FromDiscord<Forest> In reply to @spoon "yea, luas my backup": Fair
21:21:40FromDiscord<spoon> ive been able to do a lot of that in gmod with luapad
21:22:14FromDiscord<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:14FromDiscord<spoon> but its not built to have weapons/stuff inserted mid-game
21:22:29FromDiscord<Phil> (edit) "CRUD," => "CRUD API endpoints,"
21:22:41*Jjp137 quit (Quit: Leaving)
21:23:15FromDiscord<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:31FromDiscord<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:53FromDiscord<spoon> ye
21:24:56FromDiscord<Phil> Have you contemplated random constructors?
21:25:12FromDiscord<spoon> cant say i've heard of them
21:25:46FromDiscord<Phil> Not a specific construct, just a proc that returns a constructor with random attribute chosen from attribute lists
21:26:03FromDiscord<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:25FromDiscord<Phil> That's assuming you do random items that can have whatever behaviour
21:26:38FromDiscord<Phil> (edit) "behaviour" => "behaviour/ be a mixture of any set of X attributes"
21:27:20FromDiscord<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:05FromDiscord<spoon> nah was just driving home
21:32:13*jmdaemon joined #nim
21:32:54FromDiscord<spoon> do you mean having a sequence of preset effects having a sequence of them?
21:36:25FromDiscord<Phil> Yeah, you can have `var damageProcs: seq[proc(weaponInstance: WeaponType)]`
21:36:32FromDiscord<Phil> And then randomly select from that
21:36:40FromDiscord<Phil> Repeat for various procs and attributes of an item
21:36:48FromDiscord<Phil> (edit) "item" => "item, optionally associated with probabilities"
21:40:14FromDiscord<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:06FromDiscord<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:14FromDiscord<Elegantbeef> Prestige how many times to we go over this, i'm not a professional developer
21:56:53nrds<Prestige99> I don't believe you
21:57:00FromDiscord<Elegantbeef> Why?
21:57:08nrds<Prestige99> You'll slip up one day and tell me the truth :P
21:57:23FromDiscord<Elegantbeef> I'm an unemployed self taught schmuck
21:58:28FromDiscord<Elegantbeef> Why dont you believe me?
21:58:34nrds<Prestige99> Well I'm sure you could get a programming job somewhere if you wanted tbh
21:58:43nrds<Prestige99> Because you're a good programmer
21:59:27FromDiscord<Elegantbeef> I'm also fantastically bad at working on a single thing
22:06:19nrds<Prestige99> eh, same
22:06:58FromDiscord<Phil> In reply to @Elegantbeef "I'm also fantastically bad": You say that, but I'm still in love with constructor
22:07:36FromDiscord<Elegantbeef> Constructor is kinda my point 😛
22:07:44FromDiscord<Elegantbeef> I have like 30000 different small project repos
22:08:24*oprypin quit (Quit: Bye)
22:08:28nrds<Prestige99> My biggest long-term project was nimdow but I sort of did that out of necessity
22:09:29FromDiscord<Elegantbeef> Oh prestige did i ever show traitor to you?
22:09:37nrds<Prestige99> I don't think so
22:09:52nrds<Prestige99> but also I'm an old man and forget things
22:09:56FromDiscord<Elegantbeef> https://github.com/beef331/traitor#what-does-it-do
22:10:10FromDiscord<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:46nrds<Prestige99> That's cool beef
22:11:47FromDiscord<Elegantbeef> Runtime interfaces backed by new concepts(though could be replaced with just a macro)
22:11:51*Jjp137 joined #nim
22:12:17nrds<Prestige99> 2 questions, 1. "# Objects smaller than 24 bytes need `{.byref.}`" is that different than just making it a ref object?
22:12:27nrds<Prestige99> and 2. what does emitconverters do?
22:19:14FromDiscord<Elegantbeef> Anywho how goes your 2D engine prestige
22:19:30FromDiscord<Elegantbeef> Yes
22:19:55FromDiscord<Elegantbeef> I need to get around to fixing that requirement, just need to emit an aliased procedure
22:20:02FromDiscord<Elegantbeef> 2. it emits converters to that collection of types
22:20:22FromDiscord<Elegantbeef> I dont feel like doing all combinations of types on completion of their implementations
22:20:26FromDiscord<Elegantbeef> It's just a fucking hassle if you ask me
22:21:23FromDiscord<Elegantbeef> Imagine you have `Clickable, Draggable, Fireable....` that's a lot of compile time code generated that you might not need
22:21:29FromDiscord<Elegantbeef> So slows down compilation and is just complicated logically
22:22:02FromDiscord<Elegantbeef> https://github.com/beef331/traitor/blob/master/tests/test.nim#L19-L48 showcases the logic kinda
22:22:18FromDiscord<Elegantbeef> That makes it so you can convert to `DuckObject` `BoundObject` and the union of the two
22:22:50nrds<Prestige99> ah, okay
22:22:51FromDiscord<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:07FromDiscord<exelotl> meanwhile `ref` types in Nim are reference-counted
22:23:11nrds<Prestige99> my engine is going well, last thing I really need is the collision broad phase.. but all else is working well
22:23:13FromDiscord<Elegantbeef> I just need to generate a hidden alias procedure for that, i just havent got around to it
22:23:22nrds<Prestige99> https://github.com/avahe-kellenberger/shade#clone-and-setup if you want to try out the examples Elegantbeef
22:23:47nrds<Prestige99> exelotl hmm interesting
22:24:26FromDiscord<Elegantbeef> like it should do a `proc hiddenImplOnClick(radio: ptr Radio)` that copies the body of the `onClick`
22:24:52FromDiscord<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:04nrds<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:33nrds<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:35FromDiscord<Elegantbeef> Also generally useless on \nix
22:30:49nrds<Prestige99> wdym?
22:31:35FromDiscord<Elegantbeef> I'd personally rather use my package manager to fetch the dev libraries than have to build them from source
22:32:01FromDiscord<Elegantbeef> II guess with gpu it makes sense as it's not shipped commonly on package repos
22:32:20nrds<Prestige99> yeah
22:32:31nrds<Prestige99> and some are not up to date enough, like ubuntu's SDL2
22:32:35FromDiscord<Elegantbeef> But with ttf and sdl2 they're in my package repo
22:34:09FromDiscord<Elegantbeef> Pmunch i do not get why you said my solution wouldnt work
22:36:18FromDiscord<Elegantbeef> This does remind me it's time to move distro
22:36:21FromDiscord<Elegantbeef> Just gotta figure out which
22:36:43nrds<Prestige99> What are you looking for?
22:37:00FromDiscord<Elegantbeef> Something that doesnt piss me off with outdate packages 😛
22:37:10nrds<Prestige99> Arch :P
22:37:13FromDiscord<Elegantbeef> Perhaps thinking about doing debian
22:37:29FromDiscord<Elegantbeef> Eh i'm lazy
22:37:43nrds<Prestige99> me too, arch is easy after you get it set up
22:37:55FromDiscord<Elegantbeef> "get it setup" is the issue
22:37:56FromDiscord<spoon> manjaro then
22:38:05nrds<Prestige99> manjaro is a dumpster fire
22:38:07FromDiscord<spoon> manjaro is plug and play like ubuntu
22:38:09FromDiscord<Elegantbeef> Endeavour before manjaro
22:38:26FromDiscord<spoon> hate apt though
22:38:33FromDiscord<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:28FromDiscord<Ayy Lmao> Are `type` and `typeof` essentially the same thing?
22:40:34nrds<Prestige99> I mean it's pretty easy to set up, hell arch even has an installer now
22:40:36FromDiscord<Elegantbeef> yes
22:41:03FromDiscord<Elegantbeef> Eh i'm probably just going to go with deb to stick to something i'm somewhat familiar with
22:41:11FromDiscord<Ayy Lmao> Sweet, thanks!
22:41:21FromDiscord<Elegantbeef> Generally it's suggested now to use `typeof`
22:41:28FromDiscord<Elegantbeef> It's more clear than `type`
22:42:39FromDiscord<Elegantbeef> Might also try btrfs finally
22:43:12FromDiscord<spoon> is there a way to check if an object is either of the type or inherits from the type?
22:43:21FromDiscord<Elegantbeef> `if x of Y`
22:43:31nrds<Prestige99> I hear about issues with btrfs occasionally, I'm sticking with ext4 for a long while
22:44:01nrds<Prestige99> But yeah, try out arch or endeavour or garuda maybe
22:44:17FromDiscord<Elegantbeef> Prestige disregarding me, name a more common event
22:44:45FromDiscord<Elegantbeef> "Think i'm going to go with debian".... prestige\: "I'll pretend I didnt see that"
22:44:50nrds<Prestige99> oh I missed that message :P
22:44:53nrds<Prestige99> haha
22:44:55FromDiscord<huantian> In reply to @Elegantbeef "Might also try btrfs": I’ve heard good stuff about that
22:44:58FromDiscord<huantian> And it’s fun to say
22:45:01FromDiscord<huantian> Cus butter
22:45:07nrds<Prestige99> I thought deb's packages were like very out of date
22:45:27nrds<Prestige99> well stable at least, I guess they have a rolling release distro
22:45:28FromDiscord<huantian> Not if you use whatever debians rolling release version they have is called
22:45:34FromDiscord<Elegantbeef> rolling debian
22:45:40nrds<Prestige99> tumbleweed? icr
22:46:03FromDiscord<huantian> Ah yeah that’s what it’s called
22:46:15*oprypin joined #nim
22:46:32FromDiscord<huantian> Haha I get it
22:46:44FromDiscord<Elegantbeef> Debian's is sid not tumbleweed!
22:46:57nrds<Prestige99> who is tumbleweed, suse?
22:47:08FromDiscord<Elegantbeef> Yea
22:47:39FromDiscord<Elegantbeef> Now to quickly see if i have any toy projects that need uploaded 😛
22:49:38FromDiscord<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:32FromDiscord<Elegantbeef> Rollbian
22:51:56FromDiscord<Elegantbeef> Though it's mostly just different package sources so it's just debian but unstable 😛
22:52:51nrds<Prestige99> Hm, how am I going to add this dir to the user's PATH...
22:52:56FromDiscord<Elegantbeef> Well later i need to go ruin my day
22:53:00FromDiscord<auxym> yeah sid is basically debian's "devel" branch
22:53:05FromDiscord<huantian> You mean Debian but usable
22:53:11FromDiscord<huantian> Bye beef 🌊
22:53:12nrds<Prestige99> Updating with `putEnv` only persists during execution of the program/script it seems
22:53:28nrds<Prestige99> Well said huantain
22:53:46FromDiscord<huantian> In reply to @nrds "<Prestige> Updating with `putEnv`": That is how shell envs work
22:53:57FromDiscord<auxym> why do you want to fuck with people's path?
22:54:17nrds<Prestige99> dependencies for my library
22:54:22FromDiscord<huantian> Just manually add it to their bash rc I’m sure they won’t notice
22:54:30nrds<Prestige99> Lol
22:54:56nrds<Prestige99> I just need the deps added while someone is using my game engine, essentially
22:55:44nrds<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:58FromDiscord<auxym> so it's for .so files, not for calling executables?
22:58:06nrds<Prestige99> Yeah
22:58:53FromDiscord<auxym> i don't remember the exact flag but you can pass in extra library lookup paths on the command line
23:00:07FromDiscord<huantian> `LD_LIBRARY_PATH`?
23:01:27nrds<Prestige99> yeah that's one of the things I'm setting
23:01:48nrds<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:13FromDiscord<auxym> I was thinking `--clibdir` actually
23:02:36FromDiscord<auxym> but it probably has the same effect
23:02:55nrds<Prestige99> but then how do I set it up so that a project using my game engine will have that configured?
23:02:58nrds<Prestige99> That's what I'm stuck on
23:04:10FromDiscord<auxym> maybe `.link.` or `.passL` pragma?
23:04:41FromDiscord<auxym> or just provide a project template / tell people to add the `clibdir` switch to their config.nims
23:06:10FromDiscord<auxym> I believe `{.passL: "-L/path/to/your/libs"}` would have the same effect as clibdir
23:07:17nrds<Prestige99> hm I'd need to like find the path that nimble puts the project in, maybe
23:08:33FromDiscord<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:07nrds<Prestige99> wonder if anyone has tried this before
23:33:00FromDiscord<salt> sent a code paste, see https://play.nim-lang.org/#ix=3TK5
23:33:57FromDiscord<exelotl> I guess cause `ord` is generic or has several overloads, so it doesn't know what version of `ord` to use
23:35:31FromDiscord<salt> i'll try to remember this, thanks
23:36:13FromDiscord<huantian> look at the error: `Error: 'ord' cannot be passed to a procvar`
23:37:17FromDiscord<exelotl> ah I guess I'm wrong and it's because `ord` is compiler magic?
23:40:29FromDiscord<exelotl> wow https://play.nim-lang.org/#ix=3TK9
23:41:06FromDiscord<exelotl> I'm impressed that the compiler is smart enough to do this
23:42:16FromDiscord<exelotl> In reply to @salt "i'll try to remember": now you have to un-remember it because it was wrong xD
23:43:15FromDiscord<thadeudepaula> sent a long message, see http://ix.io/3TK8
23:44:16FromDiscord<salt> In reply to @exelotl "now you have to": lol
23:45:08FromDiscord<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:24FromDiscord<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:49Zectbumolike in lisp?
23:47:23FromDiscord<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:32FromDiscord<spoon> lisp better metaprogramming than nin wtf?
23:49:08FromDiscord<salt> maybe, but harder (to (look at))
23:49:40Zectbumo:))))))))))
23:56:54nrds<Prestige99> Maybe someone like @dom96 would know
23:56:59nrds<Prestige99> regarding my above question
23:57:28nrds<Prestige99> maybe I should just bootstrap it in my module's main file.. hmm
23:58:16FromDiscord<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:54FromDiscord<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:56nrds<Prestige99> sort of, there's a nimble task named "setup" that builds them into a local directory
23:59:55FromDiscord<auxym> ok, then I suggest that this local directory be a subdir of the user's project dir, like "build" or "PrestigeLibraryBuild" or whatever