<< 13-03-2022 >>

00:05:16FromDiscord<huantian> In reply to @Elegantbeef "It might just be": looking at the readme for nimlsp, I'd assume the "selector" option does this?
00:07:30FromDiscord<Ayy Lmao> What's confusing to me is that the selector option is something you set in the lsp settings, and doesn't seem like a project specific setting. It would be a drag to have to change that all the time.
00:07:30FromDiscord<Elegantbeef> Yea it seems so
00:08:12FromDiscord<Elegantbeef> Does sublime text not have project specific settings?
00:11:29FromDiscord<Ayy Lmao> Not that I know of. I'm a noob with it though. Looking through the other lsp clients they all seem to have `source.something` as well.
00:12:00FromDiscord<Ayy Lmao> sent a code paste, see https://paste.rs/rhD
00:12:10FromDiscord<Elegantbeef> The selector might just be a pattern for files
00:12:15FromDiscord<Elegantbeef> `source` being akin to ``
00:12:33FromDiscord<Ayy Lmao> Yeah that's what I'm thinking
00:13:13FromDiscord<Ayy Lmao> I just don't know how to tell it to not boot up a separate language server for each file.
00:13:24FromDiscord<Elegantbeef> I think it's down to nimlime then
00:13:45FromDiscord<Elegantbeef> Or sublime's lsp implementation
00:14:06FromDiscord<Elegantbeef> With your project opened you do have multiple NimLsp's open in your task manager eh?
00:16:11FromDiscord<Ayy Lmao> It looks like there's only one actually
00:16:39FromDiscord<Elegantbeef> That's odd given the behaviour
00:53:11FromDiscord<michaelb.eth> I have a situation where calling `alloc` or `alloc0`, or `allocShared`, or `allocShared0` always crashes with SIGSEGV after a particular number of previous calls succeeded. This only happens with Nim 1.2, is working fine with Nim 1.4 and Nim 1.6
00:53:25FromDiscord<michaelb.eth> (edit) "is" => "it's"
00:54:19FromDiscord<michaelb.eth> seems like it's probably a bug with Nim 1.2, but I'm not sure how to dig into it further, did go hunting in the issue tracker on GitHub and the forum
00:54:41FromDiscord<Rika> Sounds like the time to use bisect on the compiler then
01:01:35FromDiscord<Elegantbeef> You also can look at the generated code to see if it's sensible with `-d:danger` to reduce noise
01:03:52FromDiscord<Elegantbeef> Do you have a min repro?
01:07:21FromDiscord<ajusa> Is there a way to get the name and type of a variable that is passed into a template?
01:07:45FromDiscord<Elegantbeef> `astToStr()` for name and `typeof()`
01:07:59FromDiscord<ajusa> typeof is what I was missing, thanks!
01:08:14FromDiscord<Elegantbeef> you can do `template doThing(a: untyped{sym})` to force it to only accept symbols
01:08:19FromDiscord<Elegantbeef> Though that's subject to be removed
02:04:39*lucerne quit (Read error: Connection reset by peer)
02:07:50*lucerne joined #nim
02:24:16FromDiscord<ajusa> I'm starting to realize that I try to time when I work on Nim code to when Elegantbeef is online
02:25:51FromDiscord<Elegantbeef> I'm always on
02:25:58*ox is now known as oz
02:25:58*wyrd quit (Remote host closed the connection)
02:26:11*wyrd joined #nim
02:54:35FromDiscord<Bung> whats opposite operation of `nimble develop` ?
03:19:02FromDiscord<huantian> Remove it like any other package
03:28:55FromDiscord<Bung> that's not proper way I think, It assuming I dont have any comments on that dir
03:30:10*arkurious quit (Quit: Leaving)
03:32:20FromDiscord<Rika> Uninstall
03:32:25FromDiscord<Rika> Use the uninstall sub command
03:32:42FromDiscord<Rika> Specify @#head if need be
03:36:50FromDiscord<Bung> okay, that's make sense, thank you
03:52:10FromDiscord<elaykph> where's the docs for builtins :/
03:52:15FromDiscord<elaykph> I can't seem to find it
03:52:31FromDiscord<elaykph> maybe it's just me blind again as usual
03:53:44FromDiscord<Elegantbeef> Do you mean keywords?
03:53:51FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords
03:54:59FromDiscord<Bung> `command line(1, 2) Error: invalid command line option: '--css'` I face this when use karax's karun
03:55:39FromDiscord<Bung> it used to work monthes ago
03:57:49FromDiscord<Bung> oh found I provide extro arg `-s`
04:10:59*lucerne quit (Remote host closed the connection)
04:11:50*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
04:12:37*lucerne joined #nim
04:15:17*Lord_Nightmare joined #nim
04:47:02FromDiscord<elaykph> In reply to @Elegantbeef "https://nim-lang.org/docs/manual.html#lexical-analy": works thx
04:47:30FromDiscord<Elegantbeef> Very few keywords cannot be overridden so it's hardly a concern
05:56:17*sagax quit (Quit: Konversation terminated!)
06:12:13*jmdaemon quit (Read error: Connection reset by peer)
06:13:04*jmdaemon joined #nim
06:15:18*vicecea quit (Remote host closed the connection)
06:15:48*vicecea joined #nim
07:04:12FromDiscord<Bung> is there cross platform , event based file watcher ?
07:08:35*slowButPresent quit (Quit: leaving)
07:10:18FromDiscord<Bung> @xflywind macos support has been done ? https://github.com/xflywind/fsnotify
07:16:47FromDiscord<baalajimaestro> sent a code paste, see https://paste.rs/vGX
07:42:06*lucerne quit (Remote host closed the connection)
07:49:26*lucerne joined #nim
08:10:19*toulene quit (Read error: Connection reset by peer)
08:12:19*toulene joined #nim
08:12:51*toulene quit (Read error: Connection reset by peer)
08:16:41*toulene joined #nim
08:25:36FromDiscord<rakgew> is there a way to retrieve fields directly from a typedesc? (without macro?) similar to .fieldPairs of an instantiated object, but just for the field names?
08:26:11FromDiscord<Elegantbeef> `for name, _ in obj.fieldPairs` 😛
08:30:38FromDiscord<rakgew> on a typedesc?
08:30:51FromDiscord<rakgew> I get type mismatch for that..
08:31:12FromDiscord<Elegantbeef> i resolved it you need `Type()`
08:31:13FromDiscord<rakgew> aahh wait. ok you instantiated it. I see.
08:34:26FromDiscord<Elegantbeef> you will probably want a variant that does `func doThing(myType: typedesc[ref object])` and `func doThing(myType: typedesc[object])`
08:36:31FromDiscord<dilawar (Dilawar Singh)> `fileExsits` seems like case-sensitive on Windows?!
08:37:07FromDiscord<xflywind> In reply to @Bung "<@!658563905425244160> macos support has": no
08:37:27FromDiscord<Elegantbeef> It calls https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileattributesa so i doubt it is
08:37:57FromDiscord<rakgew> instantiating works well. if I wanted to access a field value of the object with a string is there an equivalent to python's getttr? like\: `getattr(Type, "field_name")` ?
08:38:24FromDiscord<Elegantbeef> I mean it doesnt make sense in Nim since it's static
08:38:30FromDiscord<Elegantbeef> So field access has to be done statically
08:39:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S6k
08:40:03FromDiscord<rakgew> I would like to loop over type and fill the values with user input..
08:40:19FromDiscord<Elegantbeef> Ok so then why do you need to access by name
08:40:37FromDiscord<rakgew> so I ask them with stdin and then fill the value.. (if type matches)
08:41:29FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/dfs
08:41:36FromDiscord<Elegantbeef> Then you can call this recursively
08:42:08FromDiscord<rakgew> ahh right - we have the field anyways! sry, I should have seen that.
08:42:11FromDiscord<rakgew> thank you!!
08:42:21FromDiscord<Elegantbeef> No problem
08:43:10FromDiscord<Elegantbeef> Really though i'd suggest a `proc getFromInput(val: var T)` so you can heavily customize this without manually dispatching
08:43:28FromDiscord<Elegantbeef> then inside you'd just do `getFromInput(field)`
08:43:46FromDiscord<rakgew> yes, that sound good!
08:44:47FromDiscord<Elegantbeef> If unclear `T` is just your type
08:45:24FromDiscord<rakgew> yes. luckily I currently only have string and int.. \:-D
08:45:30FromDiscord<Elegantbeef> So by default you'd implement it for all primitives, then just use `proc getFromInput(val: var object)` as the entry for default
08:45:38FromDiscord<Elegantbeef> Ah
08:45:48FromDiscord<Elegantbeef> Well if you ever want more it makes life easier
08:46:12FromDiscord<rakgew> exactly - I like the extendebility of that approach.
08:48:12FromDiscord<Elegantbeef> I love how simple it is but how extensible it is
08:50:39FromDiscord<dilawar (Dilawar Singh)> false alarm. I misread `walkDirRec` docs and assumed by default it only returns directory. Logic error from here on. All well now!
08:50:56FromDiscord<Elegantbeef> Would be odd to fix the windows directory system
08:51:35FromDiscord<dilawar (Dilawar Singh)> Thanks for reassurance. motivated me to dig a little deeper.
08:51:46FromDiscord<Elegantbeef> No problem
08:52:00FromDiscord<Elegantbeef> Looking at the source is always the best solution
08:58:42FromDiscord<rakgew> when I loop over an instantiated type via fieldPairs, I can `echo fieldName, fieldValue` but not with strformat\: `echo fmt"{fieldName} - {fieldValue}"`. it says `error generic instantiation of 'fmt'` is there another way needed to use fmt here?
09:00:30FromDiscord<Elegantbeef> name doesnt exist in the end, which is the problem
09:01:12FromDiscord<rakgew> ah? I thought it would be an empty string on generic instantiation?
09:01:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S6q
09:01:49FromDiscord<rakgew> I actually instantiated it before the loop
09:01:52FromDiscord<Elegantbeef> Nah the `field`/`fieldPairs` is unrolled so `name`/`field` dont really exist
09:02:45FromDiscord<rakgew> hmm.. why does it exist for echo then?
09:02:56FromDiscord<rakgew> but not for fmt?
09:03:15FromDiscord<Elegantbeef> Cause `name`/`field` are replaced by the compiler in that case
09:03:39FromDiscord<Elegantbeef> But the compiler cannot replace symbols it doesnt think exist since `fmt "{name}"` hides that the `name` is inside `fmt`
09:04:20FromDiscord<rakgew> ah ok, so optimizations behind the scenes? well fair enough.
09:04:25FromDiscord<Elegantbeef> No
09:04:28FromDiscord<Elegantbeef> Fmt is a macro
09:04:43FromDiscord<Elegantbeef> It's due to how fmt works and how the loop works
09:05:15FromDiscord<rakgew> ok, so the macro tries to use it, but the compiler says it does not exist.
09:06:01FromDiscord<Elegantbeef> Yea cause of how the unroll works there is no `name` or `field` variable so when fmt is expanded it's attempting to access a variable that doesnt exist
09:06:49FromDiscord<rakgew> I see. thank you so much! \:-D
09:07:00FromDiscord<Elegantbeef> No problem
09:07:17FromDiscord<Elegantbeef> It's a bit of a annoying problem, but not much of a solution really
09:08:25FromDiscord<rakgew> right, just from looking on my code, would have been nice to use fmt there.
09:08:43FromDiscord<rakgew> but it is not a biggie..
09:09:26FromDiscord<Elegantbeef> you can also just do echo `name, ": ", field`
09:10:11FromDiscord<rakgew> yes, this is what I am now using..
09:12:23FromDiscord<Elegantbeef> "This has been redundant information with Beef"
09:14:55*jjido joined #nim
09:34:18*brocc left #nim (#nim)
09:39:21FromDiscord<rakgew> is there way to somehow prefill a default string value when showing `stdin.readLine`?
09:39:39FromDiscord<Elegantbeef> What do you mean?
09:40:25FromDiscord<rakgew> I currently fall back to a default, when the user does not enter anything, but if the default text could be pre-entered it would be obvious what they get.
09:40:51FromDiscord<rakgew> like I use today's date if they do not enter anything for date
09:41:14FromDiscord<Elegantbeef> I'd personally output it like `Enter a date (13/03/22):`
09:41:21FromDiscord<rakgew> could today's date be 'pre-typed in'?
09:42:49FromDiscord<rakgew> right, I could put into the question as well.
09:44:02FromDiscord<Elegantbeef> You might be able to write to stdin but i dont know how
09:44:41FromDiscord<rakgew> ok, thx.
09:49:57*jmdaemon quit (Ping timeout: 272 seconds)
09:55:22*Gustavo6046 quit (Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world. <screw you aloo_shu my old line was better and more creative!>)
10:46:15NimEventerNew thread by Mardiyah: Inserting single if statement into template, see https://forum.nim-lang.org/t/9004
10:52:22FromDiscord<Bung> how to write -d:x=y in nims file ?
10:52:51FromDiscord<planetis> you need "" around the arguments I think
10:54:16FromDiscord<Bung> `switch("define", "release")` `proc switch(key: string; val = "")`
10:56:32FromDiscord<planetis> -d\:"foo" works too
10:58:51FromDiscord<Bung> hmm, `Error: undeclared identifier: 'd'` I think it works in .cfg
11:00:53FromDiscord<planetis> https://nim-lang.github.io/Nim/nims.html
11:01:10FromDiscord<planetis> sorry it's --define\:"x"
11:02:22FromDiscord<Bung> where do i put value
11:07:33FromDiscord<Bung> hmm works now, thanks
11:08:30FromDiscord<S3cur3Th1sSh1t> How would you port the following to Nim? `#define RVA(type, base_addr, rva) (type)(ULONG_PTR)((ULONG_PTR) base_addr + rva)`
11:12:55FromDiscord<Rika> do we assume `type` is a `typedesc`, `base_addr` is a `pointer`, and `rva` is an `int`?
11:13:13FromDiscord<Rika> what is ULONG_PTR?
11:14:00FromDiscord<Rika> a pointer represented as a ULONG? what length is this ULONG exactly? same as in 64 bit arch?
11:25:41FromDiscord<S3cur3Th1sSh1t> sent a long message, see http://ix.io/3S71
11:27:47FromDiscord<S3cur3Th1sSh1t> sent a long message, see http://ix.io/3S72
11:28:28FromDiscord<S3cur3Th1sSh1t> I cannot use untyped here for the values, this would only be possible for macros - from reading the docs.
11:28:38FromDiscord<Rika> proc no
11:28:51FromDiscord<Rika> ah well i guess it works
11:29:18FromDiscord<Rika> im not a windows programmer so i do not know these types
11:29:42FromDiscord<Rika> that works
11:29:48FromDiscord<S3cur3Th1sSh1t> How would I use this function as macro?
11:29:54FromDiscord<Rika> you dont need to
11:30:05FromDiscord<S3cur3Th1sSh1t> sent a long message, see http://ix.io/3S73
11:30:08FromDiscord<Rika> thats wrong
11:30:10FromDiscord<Rika> use a template in that case
11:30:22FromDiscord<Rika> the proc works as any other proc except that the `atype` must be determined on compile time (of course)
11:30:38FromDiscord<S3cur3Th1sSh1t> sent a long message, see https://paste.rs/upt
11:31:06FromDiscord<Rika> im not sure if stropping works properly in templates so maybe
11:31:10FromDiscord<Rika> it probably does
11:31:48FromDiscord<S3cur3Th1sSh1t> What does stropping mean? I'm only hobbyist programmer 🙂
11:31:54*ltriant quit (Ping timeout: 272 seconds)
11:32:11FromDiscord<Rika> the `` around type
11:32:24FromDiscord<S3cur3Th1sSh1t> Ah, yeah I already used that. It's just ignored ^^
11:32:31FromDiscord<S3cur3Th1sSh1t> Usable like a normal variable
11:32:34FromDiscord<Rika> ok
11:32:37FromDiscord<Rika> then its working yes
11:34:18*ltriant joined #nim
11:37:50FromDiscord<Bung> is nims broken , I get "\n none"' ,"\n 0"'
11:38:03FromDiscord<Rika> ?
11:38:54*ltriant quit (Ping timeout: 250 seconds)
11:39:13FromDiscord<Bung> sent a code paste, see https://paste.rs/Ymx
11:39:48FromDiscord<Bung> when I get these values from nim
11:59:24FromDiscord<soda> Is it really not possible to pass primitives by reference? đŸ€”
12:00:05FromDiscord<soda> what about a string?
12:00:52FromDiscord<konsumlamm> it is possible, via `var`
12:01:02FromDiscord<konsumlamm> but why exactly do you need to pass them by reference?
12:01:18FromDiscord<soda> What is the syntax for passing a reference to a proc?
12:01:58FromDiscord<konsumlamm> the paramater has to be a `var SomeType`
12:02:09FromDiscord<konsumlamm> then you just pass the argument like you normally would
12:03:27FromDiscord<soda> hmm
12:03:56FromDiscord<soda> doesn't seem to be right
12:05:34FromDiscord<soda> you mean ↔proc someProc(str: var string) ?
12:05:39FromDiscord<konsumlamm> yes
12:05:47FromDiscord<soda> đŸ€”
12:06:08FromDiscord<soda> ah okay i understand
12:08:31FromDiscord<soda> So a custom object initialized as a ref is always heap allocated
12:09:02FromDiscord<soda> Are vars then all stack allocated?
12:09:34FromDiscord<Rika> a var object is stack
12:09:40FromDiscord<Rika> a var ref object is naturally still heap
12:10:08FromDiscord<Rika> but you can then edit the ref object being pointed to as well
12:10:34FromDiscord<soda> hmm okay makes sense
12:23:46FromDiscord<Phil> actually... wait, for my web-projects signal system I create a hashmap full of pointers to functions on start-up that may get called during runtime.↔Since pointers are untraced references... do I have to manually deallocate these pointers manually on shutdown?
12:27:39FromDiscord<Rika> `pointers to functions` as in `proc()`s? or literal `ptr`s?
12:27:53FromDiscord<Rika> `proc()` is ok, dont worry about those, i believe its no issue
12:28:16*lucerne quit (Read error: Connection reset by peer)
12:28:58FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3S7c
12:29:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3S7d
12:29:56FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3S7d" => "https://play.nim-lang.org/#ix=3S7e"
12:31:06FromDiscord<Rika> Did you allocate anything
12:31:11FromDiscord<Rika> Like, anything at all
12:31:18FromDiscord<Rika> If no then nothing is there to free
12:31:32FromDiscord<Phil> You mean with calling "alloc" ? Then no
12:31:52FromDiscord<Rika> How do you set these pointers then
12:34:30FromDiscord<Phil> sent a code paste, see https://paste.rs/yfY
12:34:57FromDiscord<Phil> Called like this:↔`connect(SignalType.stPostCreate, DiaryEntry, diaryEntryCreateSignal)`
12:36:11FromDiscord<Phil> Which is why I was under the impression that the underlying nim magic has some memory allocated somewhere to store the proc in, and then a second area of memory allocated for the Table of Pointer-Hashsets
12:36:36FromDiscord<Phil> (edit) "Which is why I was under the impression that the underlying nim magic has some memory allocated somewhere to store the proc ... in,(STORE)." added "(diaryEntryCreateSignal)" | "(diaryEntryCreateSignal)in, and then a second area of memory allocated for the Table of Pointer-Hashsets ... " added "(STORE)."
12:36:54FromDiscord<Phil> And I thought that maybe I have to dellocate the memory that the pointers take up or sth
12:37:02FromDiscord<Phil> (edit) "dellocate" => "deallocate"
12:58:12*dtomato quit (Quit: The Lounge - https://thelounge.chat)
12:59:48*dtomato joined #nim
13:23:47FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/952557587373641749/imissyou.nim
13:23:52FromDiscord<retkid> discords nim parser
13:23:57FromDiscord<retkid> doesn't like """ """
13:24:58*lucerne joined #nim
13:50:27FromDiscord<retkid> Ok so i have a really stupid problem right
13:50:50FromDiscord<retkid> ugh i know the aner
13:50:51FromDiscord<retkid> (edit) "aner" => "anwer"
13:50:57FromDiscord<retkid> its just a pita
13:51:05FromDiscord<retkid> (edit) "anwer" => "answer"
13:51:10FromDiscord<retkid> nevermind 🙄
13:51:49FromDiscord<enthus1ast> the nim html parser is not that great
13:51:54FromDiscord<enthus1ast> html/xml
13:52:06FromDiscord<enthus1ast> if you want to use this i would clean the html beforehand
13:52:50FromDiscord<enthus1ast> eg with html tidy
13:56:52FromDiscord<enthus1ast> or use the "html tokens" way araq describes in the forum (i cannot find the post....)
13:57:55*ltriant joined #nim
14:03:54*ltriant quit (Ping timeout: 272 seconds)
14:20:18FromDiscord<retkid> In reply to @enthus1ast "the nim html parser": well im using Q to avoid it
14:21:48FromDiscord<Rika> What is Q
14:22:20FromDiscord<retkid> q
14:22:38FromDiscord<retkid> https://github.com/OpenSystemsLab/q.nim
14:48:28FromDiscord<Patitotective> In reply to @retkid "doesn't like """ """": multiline comments neither
14:50:02*arkurious joined #nim
14:50:06FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/952579311389528074/unknown.png
14:50:21FromDiscord<retkid> isn't that so readable
15:08:38FromDiscord<enthus1ast> @retkid\: q uses the default nim stuff
15:08:50FromDiscord<retkid> ah
15:08:51FromDiscord<enthus1ast> xmltree htmlparser
15:08:59FromDiscord<retkid> should we rise up and make our own parsser
15:09:01FromDiscord<retkid> (edit) "parsser" => "parser"
15:09:29FromDiscord<enthus1ast> It would be nice to have a really good html parser
15:09:38FromDiscord<retkid> in that script i was parsing twitches verbose fuck you randomly generated JS content
15:09:39FromDiscord<enthus1ast> But a big task imho
15:09:55*fowl quit (Quit: cya pals)
15:10:07FromDiscord<retkid> they didn't change the start of the header i needed tho >:)
15:10:07*lucerne quit (Remote host closed the connection)
15:10:12FromDiscord<retkid> (edit) "header" => "class"
15:10:38FromDiscord<enthus1ast> Maybe identify issues, create small test cases and open issues in the nim parsers
15:11:11FromDiscord<retkid> i wanna grow up and start developing for the community because treeform inspires me a lot
15:11:22FromDiscord<retkid> but im also busy and wanna do weirds hit
15:11:24FromDiscord<retkid> (edit) "weirds hit" => "weird shit"
15:11:26FromDiscord<retkid> 😔
15:12:20FromDiscord<enthus1ast> Same, stupid work all the time đŸ˜­â†”(@retkid)
15:12:25FromDiscord<soda> Prioritize weirdness at all times
15:13:20*lucerne joined #nim
15:13:23FromDiscord<retkid> also due to life issues and depression productivity went:â†”đŸ“‰ (whistle bomb noise)
15:17:52*fowl joined #nim
15:22:35FromDiscord<soda> what's a cool project?
15:22:46FromDiscord<soda> something to make to further solidify my understanding of nim
15:23:09FromDiscord<soda> lookin for ideas
15:23:54FromDiscord<retkid> In reply to @soda "something to make to": i hoard my ideas for myselfg
15:23:55FromDiscord<retkid> (edit) "myselfg" => "myself"
15:23:56FromDiscord<retkid> >:)
15:24:29FromDiscord<auxym> in my experience side projects only work if you're really interested in them, so it's highly personal
15:24:45FromDiscord<retkid> nah man
15:24:50FromDiscord<retkid> im obsessive
15:24:58FromDiscord<retkid> i complete projects if they are possible to complete
15:25:01FromDiscord<auxym> if you're just looking for something to do though, do advent of code maybe?
15:25:10FromDiscord<soda> In reply to @auxym "if you're just looking": oh good idea
15:25:11FromDiscord<retkid> i find it very very very stressful to have a project unfinished
15:25:18FromDiscord<retkid> for some reason
15:25:45FromDiscord<auxym> eh, I get obsessive when I'm really into something. At the opposite end I have many half-finished projects that I have fully lost interest in.
15:26:08FromDiscord<retkid> I have an unfinished project that im really sad about
15:26:19FromDiscord<Rika> then do it and be not sad about it
15:26:19FromDiscord<soda> In reply to @retkid "i hoard my ideas": Non-free license ur ideas
15:26:22FromDiscord<retkid> Im pretty sure I've come to the conclusion its mathematically impossible
15:26:34FromDiscord<Rika> u dont know that until u formally prove it
15:26:41FromDiscord<soda> personally i don't really associate programming with emotions lol
15:26:51FromDiscord<soda> motivation and interest doesn't really have much to do with it
15:26:52FromDiscord<soda> maybe weird
15:27:02FromDiscord<Rika> In reply to @retkid "Im pretty sure I've": dont let ur conjectures be conjectures
15:27:16FromDiscord<retkid> In reply to @Rika "u dont know that": OK Its practically mathematically impossible. It got to a point where it was it was 3 weeks of just trying new ideas to no better rseults
15:27:18FromDiscord<retkid> (edit) "rseults" => "results\"
15:27:19FromDiscord<auxym> In reply to @soda "oh good idea": Yeah, in addition to improving your Nim, you'll learn about ds/algos. Highly recommend looking into other people's nim solution once you're done, too, so you can see patterns that you might no know about
15:27:37*toulene quit (Read error: Connection reset by peer)
15:27:48FromDiscord<Rika> In reply to @retkid "OK Its practically mathematically": my point still stands, just because you think you cant do it doesnt mean its impossible to do; you have to be able to explain why it cant be done
15:27:57FromDiscord<auxym> In reply to @Rika "u dont know that": per the incompleteness theorem, it might be impossible to prove 🙂
15:28:01FromDiscord<soda> In reply to @auxym "Yeah, in addition to": I've done a lot of this stuff in C++ which makes it a good idea to re-attempt stuff in nim
15:28:09FromDiscord<soda> already have a point of comparison
15:28:17FromDiscord<retkid> In reply to @Rika "my point still stands,": I guess it can be done but not efficiently. My objectives where extremely hard to do
15:28:23FromDiscord<Rika> In reply to @auxym "per the incompleteness theorem,": well then we just get another np complete problem and you can set a bounty xd
15:28:43FromDiscord<Rika> In reply to @retkid "I guess it can": well now most of us are probably morbidly curious what you were trying to do
15:29:07FromDiscord<soda> btw, is there a way to have '->' instead if ':' for proc return declarations? Like with lambdas?
15:29:08FromDiscord<retkid> N o p e
15:29:15*toulene8 joined #nim
15:29:22FromDiscord<auxym> In reply to @soda "btw, is there a": check out the sugar module
15:29:29FromDiscord<soda> In reply to @auxym "check out the sugar": i don't work with normal proc afaik
15:29:34FromDiscord<soda> (edit) "i" => "it"
15:29:44FromDiscord<soda> just closures
15:30:01FromDiscord<Rika> then no
15:30:02FromDiscord<retkid> In reply to @Rika "well now most of": I will tell you after I get out my brute force hammer and databases of data and show you that I cant find any correlation in these numbers to calculate the values in a fast way without gpu acceleration
15:30:09FromDiscord<Rika> you can prolly make a macro for that
15:30:19FromDiscord<soda> oh yeh hmm
15:30:24FromDiscord<soda> haven't looked into macros at all yet
15:30:27FromDiscord<soda> err
15:30:29FromDiscord<Rika> i will condemn you if you do
15:30:38FromDiscord<soda> err unless you're not talking to me?
15:30:44FromDiscord<retkid> they are
15:30:45FromDiscord<Rika> i am talking to you
15:30:51FromDiscord<soda> why would u condemn it?
15:30:53FromDiscord<retkid> macros are the cool stuff that -> are
15:31:05FromDiscord<retkid> (or are they templates?)
15:32:13FromDiscord<Rika> In reply to @soda "why would u condemn": because its cursed and unnecessary imo
15:32:30FromDiscord<auxym> https://siraben.dev/2022/03/01/tree-sitter.html anyone feel like writing a neovim treesitter grammar for nim?
15:32:38FromDiscord<Rika> nope
15:32:41FromDiscord<Rika> no thanks
15:32:59FromDiscord<auxym> same, hence why I'm trying to lure others into doing it
15:33:08FromDiscord<Rika> someone already tried and died trying
15:33:11FromDiscord<Rika> we dont need more casualties
15:33:19FromDiscord<soda> In reply to @auxym "https://siraben.dev/2022/03/01/tree-sitter.html any": maybe an emacs package
15:34:23FromDiscord<auxym> tried emacs a couple times, could never get into it. first time spacemacs on linux w/ nim package, crashed often, second time doom on windows, is slow as a dog
15:34:33FromDiscord<soda> doom emacs
15:34:39FromDiscord<Rika> he just said that
15:34:45FromDiscord<Rika> "second time doom on windows"
15:34:57FromDiscord<soda> yep
15:35:02FromDiscord<soda> just saying what i use
15:35:09FromDiscord<soda> you gotta run it as a client
15:35:20FromDiscord<soda> but i only know how to do it on windows, then it's very fast
15:35:26FromDiscord<auxym> yeah, apparently emacs being super-slow on windows is a known thing. If I'm going to invest time into learning a complex editor, it has to work well cross-platform. neovim is quite fine on linux and windows
15:36:41FromDiscord<Rika> In reply to @soda "you gotta run it": what does this mean?
15:36:50FromDiscord<Rika> is this related to the emacs is an os meme
15:36:54FromDiscord<Rika> does emacs secretly run a server
15:36:54FromDiscord<soda> emac --daemon
15:37:00FromDiscord<soda> (edit) "emac --daemon" => "emacs--daemon"
15:37:02FromDiscord<Rika> thats fuckin cursed id say
15:37:06FromDiscord<soda> (edit) "emacs--daemon" => "emacs --daemon"
15:37:11FromDiscord<soda> no it's got nothing to do with that
15:37:24FromDiscord<Rika> okay
15:37:30FromDiscord<soda> it just lets you load your emacs config only once and spawn clients quickly
15:37:34FromDiscord<Rika> okay
15:37:37FromDiscord<Rika> i see
15:45:40FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/952593293756203018/unknown.png
15:45:58FromDiscord<retkid> I hope if anyone finds my repo and they see this, they giggle as much as I did
15:53:43*toulene8 quit (Read error: Connection reset by peer)
15:55:07*toulene joined #nim
15:55:25*slowButPresent joined #nim
15:59:06*krux02 joined #nim
16:06:30FromDiscord<auxym> do nim seqs ever shrink the internal buffer? eg if you pop out half the items? Or they only grow?
16:17:21*ltriant joined #nim
16:22:17FromDiscord<michaelb.eth> sent a long message, see http://ix.io/3S8d
16:22:29*ltriant quit (Ping timeout: 252 seconds)
16:23:14FromDiscord<soda> Oh nice. tbh doom's got a few hundred more packages that it needs
16:24:38FromDiscord<Rika> In reply to @auxym "do nim seqs ever": only grow
16:25:30FromDiscord<michaelb.eth> prelude’s been around longer I think (I’ve been using it since 2013 iirc), and while it’s evolved over the years the maintainer has stuck to his principles of keeping it lightweight
16:25:57*dtomato quit (Quit: The Lounge - https://thelounge.chat)
16:26:26*dtomato joined #nim
16:26:32FromDiscord<soda> I will def check it out
16:26:52FromDiscord<soda> been considering going with vanilla emacs and adding my own packages, but this might be a nice alternative
16:32:57FromDiscord<michaelb.eth> sent a long message, see https://paste.rs/urW
16:33:08FromDiscord<soda> oh absolutely
16:33:11FromDiscord<michaelb.eth> (edit) "http://ix.io/3S8g" => "https://paste.rs/d5t"
16:33:17FromDiscord<soda> it's by far the best git fronted i've used
16:33:27FromDiscord<michaelb.eth> (edit) "https://paste.rs/4VD" => "https://paste.rs/M3q"
16:33:29FromDiscord<soda> (edit) "fronted" => "frontend"
16:33:34FromDiscord<soda> i also really like org mode and elfeed
16:35:38FromDiscord<soda> sent a code paste, see https://paste.rs/9bn
16:35:41FromDiscord<soda> dude this is so nice
16:36:10FromDiscord<Rika> your return statements are unnecessary, you can use implicit return
16:36:18FromDiscord<soda> yeah i just used to it
16:36:24FromDiscord<Rika> ok
16:36:25FromDiscord<soda> but noted
16:36:50FromDiscord<soda> probably a good idea to write nim in the nim way
16:37:01FromDiscord<Rika> well theres not really a nim way thats the thing
16:37:14FromDiscord<soda> yea true with the metaprogramming stuff especially
16:37:37FromDiscord<soda> but omitting the return statement does give a more accurate way of how the code transpiles i think
16:39:16FromDiscord<Rika> eh i dont see how
16:39:28FromDiscord<Rika> ~~btw people will get mad at you if you call it transpiling~~
16:40:21FromDiscord<soda> hmm. well i assume the cost of the function pointer is omitted by literally replacing it with contents of the proc block, but i may be wrong
16:40:26FromDiscord<soda> In reply to @Rika "~~btw people will get": lol why is that
16:41:09FromDiscord<soda> (edit) "hmm. well i assume the cost of the function pointer is omitted by literally replacing it with contents of the proc block, ... but" added "making the 'return' not mean anything beyond serving programmer, "
16:41:19FromDiscord<Rika> negative connotation of the word really
16:41:48FromDiscord<soda> hmm okay
16:41:54FromDiscord<soda> also noted
16:42:03FromDiscord<Rika> In reply to @soda "hmm. well i assume": procedures arent usually inlined unless the compiler deems it should
16:42:23FromDiscord<soda> i see
16:42:47FromDiscord<retkid> sent a code paste, see https://paste.rs/i9E
16:43:16FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3S8j
16:43:23FromDiscord<konsumlamm> transpiling implies that the compiler just does source-to-source translation without optimizing anything or checking much, which isn't true for Nim
16:43:28FromDiscord<retkid> I could write one easily, but it should be in sugar right?
16:44:07FromDiscord<soda> In reply to @konsumlamm "transpiling implies that the": So what's the more accurate alternative?
16:44:37FromDiscord<konsumlamm> "compiling"
16:45:31FromDiscord<soda> okay
16:47:02FromDiscord<soda> Do i need an external package to work with opengl?
16:47:22FromDiscord<michaelb.eth> re: return, see https://status-im.github.io/nim-style-guide/language.result.html↔↔The top part could be worded better: “pros” is “pros of using result”, “cons” is “cons of using result”.
16:49:59FromDiscord<retkid> looks like there isn't
16:49:59FromDiscord<retkid> ugh
16:50:52FromDiscord<soda> In reply to @retkid "looks like there isn't": sorry i dont know any js
16:51:04FromDiscord<retkid> basically
16:51:08FromDiscord<retkid> .some(x=>)
16:51:18FromDiscord<retkid> returns a bool if any criteria is met in an array
16:52:04FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3S8o
16:52:05FromDiscord<retkid> prints true
16:52:27FromDiscord<michaelb.eth> std/sequtils any, I think
16:52:47FromDiscord<michaelb.eth> https://nim-lang.org/docs/sequtils.html#any%2CopenArray%5BT%5D%2Cproc%28T%29
16:52:51FromDiscord<retkid> 😭 it hid under my nose
17:05:29*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
17:11:05FromDiscord<retkid> anyone got a cleaner way to do this
17:11:24FromDiscord<retkid> sent a code paste, see https://paste.rs/am2
17:13:07FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3S8B
17:13:08FromDiscord<retkid> thats more compact but less readable idk
17:13:10FromDiscord<huantian> start = x== 0
17:13:27FromDiscord<huantian> ending = x == endy
17:13:54FromDiscord<retkid> I like the way you think
17:13:57FromDiscord<huantian> (edit) "x==" => "x =="
17:14:39FromDiscord<retkid> though I think thats less readable
17:14:55FromDiscord<retkid> but its very smart
17:15:15FromDiscord<huantian> Perhaps a different variable name would help
17:15:18FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/952615850551181352/unknown.png
17:15:25FromDiscord<retkid> i see we had a similar childhood
17:15:52FromDiscord<huantian> Heh modded mc eh?
17:16:11FromDiscord<retkid> i watched him like 1.6.4-1.8.9
17:16:18FromDiscord<retkid> rip witchery 😭
17:16:31FromDiscord<huantian> Witchery was cool
17:16:48FromDiscord<retkid> its cool how many modders can tolerate java
17:17:08FromDiscord<retkid> I would have appreciated more mods as a kid if i wasn't coding in lua
17:18:43FromDiscord<huantian> Heh java is just fine imo
17:18:54FromDiscord<huantian> Heard good stuff about kotlin tho
17:19:01FromDiscord<retkid> Kotlin is cool
17:19:06FromDiscord<retkid> its much more freeing
17:20:30FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/952617158989447198/unknown.png
17:21:17FromDiscord<huantian> I don’t understand how people make large projects in lua though, that’s something I probably could not do
17:22:15FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3S8D
17:22:24FromDiscord<retkid> comment will remind me when i forget tomorrow
17:22:26FromDiscord<retkid> >:)
17:23:58FromDiscord<huantian> Perhaps you can assign the two comparisons to a variable with a name that can remind you what they are
17:24:15FromDiscord<retkid> this makes sense to me
17:24:17FromDiscord<huantian> isFirstElement↔isLastElement
17:24:40FromDiscord<retkid> perhaps
17:24:45FromDiscord<retkid> đŸ€”
17:25:15FromDiscord<huantian> I mean the current setup is fine if you like it lol
17:25:34FromDiscord<retkid> I shall consume grilled cheese like a child and come back
17:25:41FromDiscord<retkid> it will enlighten me
17:48:50FromDiscord<sOkam!> In reply to @retkid "": those do be facts
17:49:12FromDiscord<sOkam!> goes both ways 😄
18:02:03FromDiscord<huantian> Botania is a QoL mod
18:02:17NimEventerNew question by pietroppeter: How to implement a macro to apply a template repeatedly with some common and some varying arguments, see https://stackoverflow.com/questions/71459423/how-to-implement-a-macro-to-apply-a-template-repeatedly-with-some-common-and-som
18:28:03FromDiscord<S3cur3Th1sSh1t> One more noobie question from my side. I'm often facing the situation, that procs which are defined later in the same file cannot be resolved when compiling. Are there any flags or something so that the order of the procs is ignored?
18:31:18FromDiscord<soda> prob not↔use a forward declaration
18:34:31FromDiscord<S3cur3Th1sSh1t> I have the problem that one calls another which calls the first đŸ€”
18:35:09FromDiscord<S3cur3Th1sSh1t> They call each other in some cases so both need the other one to be declared first.
18:35:26*retronav joined #nim
18:36:09FromDiscord<soda> sent a code paste, see https://paste.rs/g9v
18:36:16FromDiscord<soda> a forward declaration would fix this issue
18:36:35FromDiscord<S3cur3Th1sSh1t> Ah, okay. Now I understand it.
18:36:41FromDiscord<soda> but whatever you are doing could probably be re-written to avoid this
18:36:54FromDiscord<soda> it's usually not a good idea to have cyclic dependencies like that
18:40:25Amun-RaS3cur3Th1sSh1t: there is experimental feature "codeReordering"
18:40:34Amun-Raif won't help with cyclic dependencies tho
18:42:33FromDiscord<S3cur3Th1sSh1t> In reply to @soda "it's usually not a": Thank you! 🙂 I'll also re-think about the implementation
18:44:14Amun-RaS3cur3Th1sSh1t: you can have forward proc declarations in nim
18:46:14Amun-RaS3cur3Th1sSh1t: https://play.nim-lang.org/#ix=3S90
18:46:57Amun-Raand if that's a mutual dependency of two types in one type block - that's builtin
18:52:25*Figworm quit (Quit: Figworm)
18:53:29FromDiscord<planetis> Man new concepts work for me!
18:53:49FromDiscord<planetis> about freaking time something works first try
19:20:53FromDiscord<michaelb.eth> is there a writeup on what's changed in concepts? when you say "new concepts" is that something that's in 1.6 or not released yet?
19:23:50Amun-Ranew syntax is the only thing I know that changed (apart from Self)
19:36:18FromDiscord<planetis> nope
19:36:47FromDiscord<planetis> and I kind of take it back, I can't have openarray[MyConcept] that doesn't compile
19:37:30FromDiscord<planetis> it's mostly two rfcs https://github.com/nim-lang/RFCs/issues/168 and another one about serializing json
19:37:35FromDiscord<planetis> there are mostly unimplemented
19:44:51FromDiscord<planetis> https://play.nim-lang.org/#ix=3S9i
19:54:06FromDiscord<planetis> I figured out I can have both seq[float32] and float32 match for ShaderV so it works
19:54:22FromDiscord<planetis> but it's not how I wanted to express that
20:18:55*ltriant joined #nim
20:23:05FromDiscord<soda> In reply to @michaelb.eth "Emacs Prelude is another": Thanks for this. Been looking for something like it for a while now.
20:23:40*ltriant quit (Ping timeout: 250 seconds)
20:24:03FromDiscord<michaelb.eth> glad you like it, has certainly served me well, and it's easy to customize, whether modifying prelude itself or putting `.el`modules in `personal/` dir
20:31:59FromDiscord<soda> Yeah trying to get the hang of it. Doom emacs has some features i would like to emulate, but i really appreciate how minimal it is.
20:46:36*jjido joined #nim
21:07:59NimEventerNew thread by Planetis: Naylib - yet another raylib wrapper becomes available, see https://forum.nim-lang.org/t/9005
21:19:25FromDiscord<Forest> Does anyone have an example of a physics engine implemented in Nim? (Preferably with it being simple to use another engine)
21:42:35*wyrd quit (Ping timeout: 240 seconds)
21:44:42*wyrd joined #nim
21:48:55*ltriant joined #nim
22:30:02*jmdaemon joined #nim
22:49:32*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
22:50:12*ltriant quit (Ping timeout: 272 seconds)
23:00:59FromDiscord<michaelb.eth> is there a way at compile-time in a normal `.nim` file (i.e. not NimScript) to get the path for the nimcache dir?
23:02:33FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/UXj
23:04:03*vicecea quit (Remote host closed the connection)
23:04:34*vicecea joined #nim
23:05:05FromDiscord<Elegantbeef> Think that module is 1.6 so as you're probably on 1.2(damn status 😛 ) you may just have to assume it all and do `getCacheDir() / "nim"` with `getProjectPath` from `macros`
23:09:54FromDiscord<michaelb.eth> thanks!
23:09:56*jjido joined #nim
23:10:05FromDiscord<auxym> hey beef, do you have docs or a quick getting started example for micros? Or still wip? I'm looking into implementing a tiny dsl with a macro and micros seems like it could help.
23:10:26FromDiscord<michaelb.eth> for many projects lately (e.g. standalone libs) we test against 1.2, 1.4, and 1.6
23:10:38FromDiscord<michaelb.eth> (edit) "for many projects lately (e.g. standalone libs) ... we" added "at Status"
23:10:39FromDiscord<Elegantbeef> Tests are the best way to see how to use micros
23:11:13FromDiscord<auxym> thanks, I'll have a look
23:11:14FromDiscord<Elegantbeef> The API is rather ok, some things might change slightly, but for the most part i have tests for the API which should show how to use i t
23:12:24FromDiscord<Elegantbeef> I do need to make a case statement macro still so i can allow dispatching on the NimNode
23:14:09FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/XD6
23:14:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S9Y
23:15:11FromDiscord<Elegantbeef> Hey i was just joking, dont bring facts here!↔(@michaelb)
23:15:22FromDiscord<michaelb.eth> lol
23:17:44FromDiscord<Elegantbeef> And auxym feel free to PR anything to micros that expands the API, it's relatively simple to expand
23:17:55FromDiscord<michaelb.eth> hey, nice, it's working the same on 1.2.18, 1.4.8 and 1.6.4
23:18:02FromDiscord<michaelb.eth> that makes life simpler
23:18:15FromDiscord<Elegantbeef> I basically just want to get away from `myNimNode[1][3][0][3]` shit
23:18:20FromDiscord<Elegantbeef> Congrats
23:18:21*arkurious quit (Quit: Leaving)
23:19:16FromDiscord<Elegantbeef> Cause this API is nice and nifty 😛 https://github.com/beef331/micros/blob/master/tests/test1.nim#L66-L86
23:24:24FromDiscord<Elegantbeef> @auxym\: if you have any questions feel free to ask
23:25:10FromDiscord<auxym> ty!
23:26:07FromDiscord<auxym> and yes, I'm looking to get away from manually checking if every nimnode passed in is what I expected, and using {.error.} everywhere
23:26:48FromDiscord<Elegantbeef> Ah yea the `utils` module has some helpful templates
23:27:10FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/definitions/routines.nim#L13-L20 for an api usage of them
23:27:45FromDiscord<Elegantbeef> You can also do like `n.checkit 1..3, {nnkStmtList, nnkIdent, nnkIntLit}` for instance
23:30:45*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
23:31:43*Gustavo6046 joined #nim
23:33:06FromDiscord<Elegantbeef> What's the DSL for anyway?
23:42:36FromDiscord<auxym> toying around with a macro that generates a cooperative scheduler (/ event queue-ish thing) for embedded applications
23:43:08FromDiscord<Elegantbeef> Ah
23:59:51*vicfred joined #nim