<< 10-12-2021 >>

00:00:39arkanoidbecause of federation?
00:01:03arkanoidI mean, I think the point is that I can be logged on server X and talk to room that is shared between server X and Y
00:01:24arkanoidbecause room doesn't exists on the server but on the federation as a whole
00:03:10FromDiscord<Elegantbeef> I still think the home server means that even with federation you can have multiple rooms with the same name since there is still information to diferentiate
00:03:57FromDiscord<Elegantbeef> So yes if you have multiple home servers you may have multiple `X` room but you can join a specific one without confusion afaik
00:04:31arkanoidwell, so the <roomname> doesn't remain constant across federated servers
00:05:09arkanoidthere might be aliases of same room on different servers
00:05:16FromDiscord<Elegantbeef> Isnt the homeserver apart of the roomname?
00:05:53FromDiscord<Elegantbeef> Sure
00:08:45arkanoidwell, my matrix server is up, time to reverse proxy
00:28:28FromDiscord<TryAngle> is there a library to parse math input like↵`sin(4.328) + tan((3/2)pi) - 2e^(4)`↵into a "math expression" that may or may not be modified and then be evaluated?
00:31:56FromDiscord<Sabena Sema> well std.macros parseExpr can kinda do that
00:32:01FromDiscord<Sabena Sema> what are you actually trying to do?
00:32:37FromDiscord<Sabena Sema> if it's the "statement expression" thing that some C++ libraries do that's not really something you need to do in nim
00:34:28FromDiscord<Rika> https://github.com/Yardanico/nim-mathexpr
00:34:39FromDiscord<Rika> @TryAngle
00:37:38FromDiscord<TryAngle> In reply to @Sabena Sema "if it's the "statement": I want to add math support to my discord bot
00:39:16*src quit (Quit: Leaving)
00:40:16FromDiscord<TryAngle> In reply to @Rika "https://github.com/Yardanico/nim-mathexpr": not all what I want but enough and looks easy to expand, so a good start, thanks!
00:40:40FromDiscord<Rika> Why not all?
00:41:31FromDiscord<TryAngle> mainly linalg and some constants
00:41:34*vicfred quit (Quit: Leaving)
00:42:26FromDiscord<Rika> Eh I would have said it’s out of scope
00:44:57FromDiscord<TryAngle> ah I see, that's what I mean then.↵ofc. I wouldn't expect any library to have 1:1 what I want / need, that would be way too specific XD
00:46:12FromDiscord<TryAngle> what I like with this one, I only have to add a custom parseFactor procedure and the additions I like and it should all still work 🤔
00:50:31arkanoidhow can I set a const that is a type? I want a const like "const myType = int64" to use later multiple times like in "cast[myType](...)"
00:51:40FromDiscord<Rika> `type MyType = int64`
00:52:33arkanoidyeah I've just found the same and I feel stupid
00:52:36arkanoidthanks
00:53:53FromDiscord<TryAngle> what is the recommended way to use a .env file?
00:54:22FromDiscord<TryAngle> I tried std/os getEnv(<key>), but it seems to not work?
00:54:54FromDiscord<Sabena Sema> yeah that will only get env vars from the actual environment
00:55:00FromDiscord<Rika> That’s not for files
00:55:07FromDiscord<Sabena Sema> use an ini parser type thing
00:55:27FromDiscord<TryAngle> or wait does a TOML parser exist, I would prefre that actually
00:55:34FromDiscord<Sabena Sema> environment variables actually don't generally have any format besides "sequence of zero terminated strings"
00:55:43FromDiscord<Rika> Honestly I don’t understand why no one has made a shim program that loads the environment file and runs the program with the environment
00:55:56FromDiscord<Sabena Sema> what environment file?
00:56:07FromDiscord<Sabena Sema> oh, just some environment
00:56:07FromDiscord<Rika> Or rather why they aren’t popular
00:56:15FromDiscord<Rika> .env file
00:57:04FromDiscord<Sabena Sema> well, that's what `env` does
00:57:33FromDiscord<Sabena Sema> also, the whole reason people use envvars is the parent-to-child inheritance
00:57:51FromDiscord<Sabena Sema> so running a process with a static, predefined, environment block isn't that useful
00:58:00FromDiscord<Rika> env can load files?
00:58:09FromDiscord<Rika> I was under the impression that it did not
00:58:16FromDiscord<Rika> Ah I guess you can just cat it no
00:58:21FromDiscord<Rika> Is that safe
00:58:49FromDiscord<Rika> In reply to @Sabena Sema "so running a process": I was going to say merged but I thought that was already implied
00:58:51FromDiscord<Sabena Sema> I'm not sure what kind of parsing it does
00:59:37FromDiscord<Sabena Sema> but if it's merging it has to split the keys from the values (meaning potential problems if you are passing an arbitrary blob that could contain '=')
01:00:12FromDiscord<TryAngle> tbh TOML with parsetoml is actually pretty decent for envs
01:00:43FromDiscord<Rika> I don’t think we know what the other means
01:01:00FromDiscord<Rika> That’s not what I mean and I don’t know what you mean
01:01:06FromDiscord<Rika> It’s whatever at this point
01:08:21*krux02 quit (Remote host closed the connection)
01:12:16FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3Hxz
01:12:29FromDiscord<Sabena Sema> 10000 bytes is enough for anyone
01:28:24FromDiscord<TryAngle> I'm trying to run the examples from dimscord but they just error↵using nimble, it tells me -d:ssl is missing, using nim running with -d:ssl, a fatal error occures from asyncfutures where the discord client gets started
01:29:30FromDiscord<Elegantbeef> It wasnt suggested but https://github.com/PMunch/stacklang does exist if you want to support maths
01:29:48FromDiscord<Rika> That would require you to use an unconventional syntax
01:29:56FromDiscord<Rika> In reply to @TryAngle "I'm trying to run": Well what is the error
01:30:45FromDiscord<TryAngle> In reply to @Rika "Well what is the": https://media.discordapp.net/attachments/371759389889003532/918676072529297458/message.txt
01:31:38FromDiscord<Rika> Wow helpful exception, probably raised by the library
01:32:47FromDiscord<TryAngle> this happens with↵`nim r -d:ssl src/kassacord.nim`↵with nimble run I just get "missing -d:ssl error"
01:33:00FromDiscord<TryAngle> (edit) "r" => "c -r"
01:33:01FromDiscord<impbox [ftsf]> you'll definitely need -d:ssl
01:33:19FromDiscord<TryAngle> I get same errors on WSL Ubuntu and Windows
01:33:22FromDiscord<Elegantbeef> make a `config.nims` with `-d:ssl` in your project's root
01:33:33FromDiscord<impbox [ftsf]> I have been using dimscord
01:33:57FromDiscord<impbox [ftsf]> but maybe different version or different nim version
01:34:26FromDiscord<TryAngle> In reply to @Elegantbeef "make a `config.nims` with": ok now I can run with nimble thanks,↵But sadly I get the same error now as when using nim c -r -d:ssl src/kassacord.nim
01:34:32FromDiscord<impbox [ftsf]> there is a dimscord discord server you could ask for help in
01:34:48FromDiscord<impbox [ftsf]> https://discord.gg/paXRAtvn
01:35:15FromDiscord<TryAngle> ah totally forgot about that, sadly this server looks a bit inactive but I try thanks
01:45:38FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3HxD
01:45:45FromDiscord<impbox [ftsf]> any idea what this error means, and how to work around it?
01:46:28FromDiscord<impbox [ftsf]> why is it trying to evaluate `cursor` at compile time?
01:49:34FromDiscord<Elegantbeef> Need more code to say
01:50:10arkanoidwhat would result in echo type(X) -> "void", what is a void? ptr object?
01:50:12FromDiscord<Elegantbeef> Nevermind i understand
01:50:21FromDiscord<Elegantbeef> void is void
01:50:24FromDiscord<Rika> Void is just void
01:50:25FromDiscord<Elegantbeef> It means "nothing"
01:50:35arkanoidis there type "void"?
01:50:40FromDiscord<Rika> Technically
01:50:46FromDiscord<Rika> Not really but it “exists”
01:51:25FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3HxG
01:51:40arkanoidrunning type on this guy results in void https://github.com/yglukhov/nimpy/blob/2f09d0fd934f6c93425f416e9c095608aac2017a/nimpy/py_lib.nim#L133
01:52:55FromDiscord<Elegantbeef> What is the second `[]` for impbox?
01:53:10FromDiscord<impbox [ftsf]> to index the tuple
01:53:14FromDiscord<impbox [ftsf]> (edit) "to index the ... tuple" added "ChainRow"
01:53:16FromDiscord<Elegantbeef> There you go
01:53:25FromDiscord<Elegantbeef> Tuple indexes need to be static
01:53:45FromDiscord<impbox [ftsf]> ohh
01:54:03FromDiscord<Elegantbeef> Didnt notice `ChainRow` was a tuple 😀
01:54:04FromDiscord<impbox [ftsf]> thanks, dang!
01:54:22FromDiscord<impbox [ftsf]> I guess I'll make it an array with an enum index or something
01:55:16FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3HxI
01:55:24FromDiscord<impbox [ftsf]> it's an operating system thing
01:55:38FromDiscord<impbox [ftsf]> at runtime
01:55:50FromDiscord<impbox [ftsf]> on linux an environment variable can be used
01:55:51FromDiscord<IsaacPaul> bah ok probably some sort of environment variable then?
01:55:55FromDiscord<impbox [ftsf]> not sure about macos
01:55:59arkanoidis it possible to get from which module a symbol come from?
01:56:34FromDiscord<impbox [ftsf]> https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/UsingDynamicLibraries.html
01:57:14FromDiscord<IsaacPaul> I see that's it
01:57:37FromDiscord<IsaacPaul> thanks.. was getting tunnel vision lol
01:58:52FromDiscord<impbox [ftsf]> maybe i can cast to array =\
01:59:14FromDiscord<impbox [ftsf]> since otherwise tuple behaviour is desired
02:07:45FromDiscord<Elegantbeef> impbox it's not great but https://play.nim-lang.org/#ix=3HxM
02:08:04FromDiscord<Elegantbeef> Yes it's possible ark
02:09:33FromDiscord<Rika> You could just simulate field access with templates and [] on arrays?
02:09:48FromDiscord<Elegantbeef> You can
02:10:00FromDiscord<Rika> So I don’t know why you insist on tuples
02:10:26FromDiscord<Elegantbeef> I hate tuples so i dont i was just showing impbox how one could
02:11:05FromDiscord<impbox [ftsf]> yeah, ok, i'll just use arrays
02:11:19FromDiscord<impbox [ftsf]> thanks <3
02:11:29FromDiscord<Rika> 👌
02:13:47arkanoidhow does https://nim-lang.github.io/fusion/src/fusion/smartptrs.html#SharedPtr sharedPtr works in nim? is atomicCounter increased/decreased automatically?
02:13:57arkanoidI'm working with ARC
02:17:48FromDiscord<Elegantbeef> Here you go ark https://play.nim-lang.org/#ix=3HxO
02:19:13arkanoidwhoa! seems complicated. Thanks
02:20:34FromDiscord<Elegantbeef> Though i think there is an issue with overloads
02:25:35*arkurious quit (Quit: Leaving)
02:30:21FromDiscord<Sabena Sema> yeah smartpointers basically work like the c++ ones
02:30:37FromDiscord<Sabena Sema> using a ref is _usually_ better
02:31:47FromDiscord<Rika> What case would the former be better then
02:56:50FromDiscord<Sabena Sema> interop comes to mind
02:57:17FromDiscord<Sabena Sema> more immediate refcount ops / frees
03:02:29FromDiscord<IsaacPaul> sent a long message, see http://ix.io/3HxZ
03:03:44FromDiscord<IsaacPaul> (edit) "http://ix.io/3HxZ" => "http://ix.io/3Hy0"
03:05:44FromDiscord<IsaacPaul> For release apps you will need to provide a proper .app package with the dynamic file inside.
03:20:16arkanoidwhat's the advantage of useMalloc or not?
03:20:46arkanoidI'm using it to enable valgrind profiling, but apart from that, is there a reason why I should use useMalloc?
03:21:22FromDiscord<Elegantbeef> Embedded is one reason
03:21:24FromDiscord<Rika> When you’re using a custom allocator that shims malloc?
03:22:19FromDiscord<hieu.nt> is there any tutorial to upload file to google drive using nim. I found this on nim website https://nim-lang.org/docs/httpclient.html
03:22:32FromDiscord<hieu.nt> but i dont know how to handle the authentication process with nim
03:23:04FromDiscord<Elegantbeef> https://github.com/treeform/googleapi/blob/master/src/googleapi/drive.nim
03:23:34FromDiscord<Elegantbeef> Wait it only has list 😀
03:23:56FromDiscord<Elegantbeef> Either way it shows how
03:25:09FromDiscord<theSherwood> Is there any way to do hot module reloading in nim?
03:25:38FromDiscord<Elegantbeef> There is https://nim-lang.org/docs/hotcodereloading.html but i hear the experience isnt great
03:25:57FromDiscord<Elegantbeef> You could also use a plugin system
03:27:04FromDiscord<theSherwood> Are there any libraries in the ecosystem that can handle that automagically?
03:27:05FromDiscord<Elegantbeef> I guess teh better thing would be to link https://nim-lang.org/docs/hcr.html
03:27:44FromDiscord<Elegantbeef> https://nimble.directory/search?query=plugin there are a few plugin systems
03:28:01FromDiscord<theSherwood> Cheers!
03:28:03FromDiscord<Elegantbeef> Why are you after hot code reloading if i may ask?
03:28:31FromDiscord<theSherwood> I'm a web dev and I've grown accustomed to a rapid feedback cycle during development.
03:29:05*xet7 joined #nim
03:29:50FromDiscord<Elegantbeef> Well to make it a bit faster you can use TCC to get the c compiler time down
03:30:16*xet7 quit (Remote host closed the connection)
03:30:31FromDiscord<theSherwood> Is that a compiler option I can set?
03:31:00FromDiscord<Elegantbeef> If you have the TCC compiler in your path you can d `--cc:tcc`
03:31:13FromDiscord<Elegantbeef> Yes i realize `TCC compiler` is redundant
03:31:29FromDiscord<Elegantbeef> I guess that assumes you're doing C compiled Nim and not JS/C++ compiled
03:33:53FromDiscord<theSherwood> Yeah, C-compiled-Nim. At the moment I'm just playing around with building a toy terminal editor.
03:34:48FromDiscord<theSherwood> Thanks for the help, @ElegantBeef
03:34:55FromDiscord<Elegantbeef> No problem
03:42:41FromDiscord<hieu.nt> i also want to ask is there a way to share variables between 2 modules or 2 nim file without circular dependency
03:42:59FromDiscord<hieu.nt> for example partial class in C#
03:48:27FromDiscord<Elegantbeef> You might be able to if you properly position imports but it requires though to where you import
03:48:34FromDiscord<Elegantbeef> Generally it's just suggested you dont design code that way
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:07:52FromDiscord<ajusa> In reply to @ajusa "3ds": Just got this working - Nim's sdl bindings lightly tweaked running fine on a 3DS. Going to work on adding =destroy hooks to make the SDL resources get cleaned up automatically.
04:10:53FromDiscord<IsaacPaul> Awesome. Looking forward to seeing your progress
04:28:07FromDiscord<ajusa> For some reason I can't get it to work on my computer though lol, the mp3 plays on the 3DS but it doesn't work normally. I'm probably messing up some dynamic library thing with Nim and the existing SDL bindings
04:30:00*rockcavera quit (Remote host closed the connection)
04:30:35FromDiscord<Sabena Sema> In reply to @theSherwood "I'm a web dev": you can have a hook that recompiles your code on changes and just restarts the whole thing
04:30:52FromDiscord<Sabena Sema> doing actual hot code reloading without a jit or interpreter is super hard
04:31:53FromDiscord<Sabena Sema> In reply to @hieu.nt "i also want to": you can use importc and exportc
04:35:04FromDiscord<Sabena Sema> actually .... does nim have a way (besides {.emit.}) to get selectany behavior on a symbol, where the linker is told to just throw out all but one
04:36:38FromDiscord<Sabena Sema> eagh it's so linker / exe format specific I'd expect not
04:43:40FromDiscord<demotomohiro> In reply to @hieu.nt "i also want to": Just declare variables with export marker `` in a module and import it in a module you want to use the variable:↵https://wandbox.org/permlink/qUkkV1FrZPjoHUX1
04:58:22FromDiscord<Michal58> In reply to @ni-max "... continued from our": created a PR: https://github.com/nim-lang/Nim/pull/19233
05:02:58FromDiscord<Sabena Sema> why is that even undefined?
05:03:39FromDiscord<Sabena Sema> like addLast(result, item) where both result and item have types dependent on T should pull in addLast even if it was defined after toDeque
05:03:46FromDiscord<Sabena Sema> unless my understanding of how generics work is very wrong
05:17:57FromDiscord<Elegantbeef> It needs to have a valid symbol that matches the signature for it to work
05:18:05FromDiscord<Elegantbeef> So it's odd that it didnt cause an issue before
05:18:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Hyq
05:31:33FromDiscord<Michal58> In reply to @Sabena Sema "like addLast(result, item) where": I don't understand what you are saying
05:31:40FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Hyt
05:34:32FromDiscord<Sabena Sema> In reply to @Michal58 "I don't understand what": typically generics will look up function names where the result of overload resolution could depend on type parameters in the instantiation context
05:35:14FromDiscord<Michal58> In reply to @Sabena Sema "typically generics will look": I understand that, but don't udnerstand how it is relevant here.
05:39:38FromDiscord<Schelz> Anyone know how to compile subhook nim file with cpp ? Please ping me..
05:48:02FromDiscord<Sabena Sema> In reply to @Michal58 "I understand that, but": well, the result of overload resolution for addLast could well depend on T
05:48:26FromDiscord<Sabena Sema> oh I see
05:48:28FromDiscord<Sabena Sema> you need at least one
07:01:37FromDiscord<Xzight> any users of `dimscord` here? I can't get the quick example from the readme to work lol
07:03:25FromDiscord<Elegantbeef> What's the issue you're having
07:03:27FromDiscord<Elegantbeef> That makes life easier
07:05:02FromDiscord<Xzight> Well I assume the problems are specific to the package but I am getting an "Illformed AST" and "Template/generic instantiation of "event" from here
07:05:10FromDiscord<Xzight> (edit) "here" => "here""
07:07:08FromDiscord<Elegantbeef> remove `some` on line 29 and it solves it
07:07:22FromDiscord<Elegantbeef> The issue was a type mismatch so the error output says the exact issue
07:12:39FromDiscord<Xzight> Ohh thank you!
07:32:14*PMunch_ is now known as PMunch
07:42:31FromDiscord<retkid> nim is a system lang and this is off topic (?) but i would just like to say that frontend sucks
07:42:40FromDiscord<retkid> that is all
07:45:01FromDiscord<Rika> It's harder for regular programmers
07:45:15FromDiscord<Rika> You'd prolly be closer to a designer for front end to be easy
08:14:11FromDiscord<valerga> how can I do `for i, m in needed` in reverse?
08:14:41FromDiscord<valerga> i should be the index of the item
08:16:53FromDiscord<valerga> do i need to reverse the seq first?
08:17:35FromDiscord<retkid> In reply to @Rika "You'd prolly be closer": i can make music, i can program, i can make some kinds of art
08:17:41FromDiscord<retkid> but this kinda just sucks
08:18:18FromDiscord<retkid> In reply to @valerga "how can I do": so you can do 1 or 2 things:
08:18:24FromDiscord<retkid> you c an iterate over len()-1
08:18:27FromDiscord<retkid> (edit) "c an" => "can"
08:18:41FromDiscord<retkid> (edit) "len()-1" => "-(len()-1)"
08:18:45FromDiscord<Rika> Three things actually, you can make a reverse iterator
08:18:48FromDiscord<retkid> or you can reverse it
08:18:51FromDiscord<retkid> or make a reverse iterator
08:18:57FromDiscord<ni-max> In reply to @valerga "how can I do": maybe: `for i in countdown(needed.high, 0)`
08:19:02FromDiscord<valerga> what about reversed(x) from algorithm?
08:19:10FromDiscord<Rika> That is reversing the sequence
08:19:19FromDiscord<retkid> countdown is in the stdlib
08:19:30FromDiscord<retkid> In reply to @valerga "what about reversed(x) from": well, it that works then do it
08:19:34FromDiscord<retkid> but
08:19:39FromDiscord<valerga> reversing the iterator sounds better
08:20:03FromDiscord<retkid> (edit) "it" => "if"
08:20:20FromDiscord<retkid> i mean, if you really care, the only differences is readability and speed
08:20:40FromDiscord<retkid> also guys should i be using .high or be using .len()-1
08:21:41FromDiscord<Rika> Speed is pretty important
08:21:52FromDiscord<Rika> Use high as much as possible if you are using them as indexes
08:21:58FromDiscord<Rika> Indexes indices whichever the word
08:22:06FromDiscord<retkid> w3ell
08:22:09FromDiscord<retkid> (edit) "w3ell" => "well"
08:22:38FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/918779728045948928/unknown.png
08:23:02FromDiscord<retkid> theres like another project not on this partition where i did it like 20 times and it caused so many reability problems
08:23:06FromDiscord<retkid> (edit) "reability" => "readability"
08:23:19FromDiscord<Rika> That’s why there is high
08:23:32FromDiscord<Rika> In reply to @ni-max "maybe: `for i in": Also better to use low over 0 haha
08:23:40FromDiscord<retkid> really
08:23:41FromDiscord<retkid> why?
08:23:53FromDiscord<retkid> isn't 0 faster?
08:24:07FromDiscord<Rika> It’s not always correct
08:24:21FromDiscord<Rika> Arrays can start at any number
08:24:32FromDiscord<Rika> That matters if you’re using a generic iterator
08:24:35FromDiscord<Rika> Or making one
08:24:43FromDiscord<retkid> i dont usually use arrays
08:24:44FromDiscord<Rika> If not, I’d still recommend using it
08:25:07FromDiscord<Rika> Maybe in the future Nim will get sequences that start at arbitrary numbers
08:25:21FromDiscord<Rika> Less work to fix your code in the future
08:25:35FromDiscord<retkid> i dont like that
08:25:52FromDiscord<retkid> i like just doing [0] and getting the first indice
08:26:19FromDiscord<Rika> Likewise I don’t like that 🙂
08:26:36FromDiscord<Rika> Do what you want really
08:26:42FromDiscord<retkid> we must fight do the death
08:27:13FromDiscord<Rika> Do you want to fight someone trained in martial arts 😛 I’m joking
08:27:31FromDiscord<ni-max> 😆
08:27:33FromDiscord<Rika> Not about the martial arts thing though
08:28:27FromDiscord<ni-max> anyone? https://discordapp.com/channels/371759389889003530/371759389889003532/918601071872602152
08:29:05FromDiscord<Rika> Didn’t someone reply to you
08:29:53FromDiscord<ni-max> Micheal opened a pull request for workaround but I'm not sure what's going on here
08:31:02FromDiscord<ni-max> I think there's some magic with generics causing this
08:32:21FromDiscord<ni-max> no problem without generics
08:33:56FromDiscord<ni-max> also compiles if we re import `deques` in `n.nim`
08:37:46FromDiscord<ni-max> and already merged by Araq in devel branch↵but I'm afraid It will get us again somewhere...
08:38:15*jjido joined #nim
08:55:26FromDiscord<Sabena Sema> I still think it'
09:00:18FromDiscord<Sabena Sema> I still don't quite understand why such a dependent function needs to be declared before the declaration context of the generic
09:00:35FromDiscord<Sabena Sema> how are you even supposed to declare such a function that you expect users to add more overloads of?
09:01:20FromDiscord<Sabena Sema> (C++ kinda does this too, wherin qualified dependent functions are not required to have a definition but unqualified ones that resolve via ADL are)
09:04:44FromDiscord<Sabena Sema> it's likely I just have c++ brainworms tho
09:05:18FromDiscord<Sabena Sema> oh yeah
09:05:19FromDiscord<Sabena Sema> I do
09:06:18FromDiscord<Sabena Sema> wait, so a function has to _actually be overloaded_ for dependent references to it to be open in generics?
09:06:44FromDiscord<Sabena Sema> or if it's actually overloaded (in the definition context of the generic) then it's open no matter if it's dependent or not
09:11:05FromDiscord<ni-max> I thinks this is the case, Is it ok?
09:11:12FromDiscord<ni-max> (edit) "thinks" => "think"
09:12:45FromDiscord<Sabena Sema> I mean it's unexpected (for me) but is probably fine
09:13:07FromDiscord<Sabena Sema> it's a little odd that adding a second overload of something before a generic definition can cause symbols to become open
09:17:41FromDiscord<ni-max> I'm still very new to Nim. Guess I should re-evaluate after I work more with templates/generics in Nim
09:17:56FromDiscord<n00nehere> how can i use proxy with authentication in nim?
09:18:02FromDiscord<Sabena Sema> tbh this is just me assuming that nim features have the same semantics as c++ ones
09:18:09FromDiscord<Sabena Sema> and tbh they do tend to be very close
09:19:22FromDiscord<Sabena Sema> the overload resolution rules are essentially identical (aside from I think not having partial ordering by constraints I think)
09:19:26FromDiscord<Sabena Sema> (edit) "constraints I think)" => "constraints)"
09:20:30FromDiscord<ni-max> In reply to @n00nehere "how can i use": `std/httpclient` has support for http/https proxies: https://nim-lang.org/docs/httpclient.html#autolink-3819
09:22:21FromDiscord<ni-max> (edit) "https://nim-lang.org/docs/httpclient.html#autolink-3819" => "https://nim-lang.org/docs/httpclient.html#proxy"
09:24:33FromDiscord<ni-max> @Sabena Sema oh by the way in this case that addLast func is also a generic function!
09:24:37FromDiscord<hieu.nt> hi guys
09:24:44FromDiscord<hieu.nt> so install some package in nim
09:24:55FromDiscord<hieu.nt> (edit) "nim" => "nimble"
09:25:27FromDiscord<hieu.nt> but my project doesnt have something like package-lock.json
09:26:12FromDiscord<hieu.nt> how do other computer get this dependencies when they pull the project
09:26:30FromDiscord<Sabena Sema> they resolve the dependencies themselves
09:26:33PMunchIf you define them in your .nimble file then `nimble build` will install them
09:26:38FromDiscord<Sabena Sema> lock files are an insane default imo
09:27:01FromDiscord<Sabena Sema> you can use `nimble lock` if you really need one
09:28:35FromDiscord<hieu.nt> In reply to @PMunch "If you define them": so i have to make a .nimble file then commit them along the project right ? Is there any way to create this file automatically
09:29:14FromDiscord<Sabena Sema> `nimble init`
09:29:25FromDiscord<Sabena Sema> the nimble file is the metadata file for your project
09:29:38FromDiscord<Sabena Sema> like `package.json`
09:30:33FromDiscord<hieu.nt> thanks @Sabena Sema let me try
09:31:06PMunchYou can also define tasks in it
09:32:36FromDiscord<Sabena Sema> generally you should need to do _much_ less build system scripting than in C/C++, since the compiler itself has built in support for doing most things (and automatically handles dependency info in those cases) but it's there if ya need it
09:32:51PMunchIt's a mix between a project definition, a dependency list, and a makefile
09:35:03FromDiscord<hieu.nt> I try and it a bit more complex than my need. Really just want a much more simple and straightforward way to list some of the nimble package that i install on my work machine
09:35:22FromDiscord<Sabena Sema> in that case ... just list them
09:35:25FromDiscord<hieu.nt> so other machine can auto pull these package when they pull the project
09:35:37FromDiscord<hieu.nt> (edit) "machine" => "machines" | "package" => "packages"
09:36:07FromDiscord<Rika> It isn't complex
09:36:11FromDiscord<Rika> You initialise the project
09:36:11FromDiscord<hieu.nt> nimble doesnt seem to install the dependencies in the project folder so i cannot commit them as well.
09:36:18FromDiscord<Rika> You edit the file to have the dependencies
09:36:20FromDiscord<Rika> Then that's it
09:36:52FromDiscord<Sabena Sema> if you want something like python's requirements.txt just write someting that looks like it and do: `xargs -a requirements.txt nimble install` or similar
09:37:34FromDiscord<hieu.nt> In reply to @Sabena Sema "if you want something": its actually a good idea
09:37:56FromDiscord<Sabena Sema> but ... really just write a .nimble file
09:38:09FromDiscord<Rika> It's not much different
09:38:36FromDiscord<Sabena Sema> sidenote: python's requirements.txt thing is _completely_ nuts
09:38:49FromDiscord<Rika> Why so? I don't remember much about it
09:38:53FromDiscord<Rika> Tried not to remember
09:39:29FromDiscord<Sabena Sema> if you have a setuptools package there's no great way to share the dependency info between requirements.txt and the setuptools package, esp if you want to use the setup.cfg/pyproject.toml format
09:39:54FromDiscord<Sabena Sema> and thus if you are using those formats it's basically impossible to install the dependencies of a project _without_ installing the project itself
09:40:36FromDiscord<Sabena Sema> the only way to do it "right" is to use setup.py and run `python setup.py egg-info` then you get like `.egg-info/requirements` that you can pass to pip
09:41:06FromDiscord<Rika> I don't even follow anymore
09:41:19FromDiscord<Rika> I don't know what some of these terms are
09:42:42FromDiscord<Sabena Sema> I'm not actually 100% sure if nimble supports installing all the deps of a package without also installing the package itself
09:42:58FromDiscord<Sabena Sema> but build will do it
09:43:37FromDiscord<Sabena Sema> and I bet the nimble maintainers would actually accept such a feature, instead of the setuptools maintainers who basically couldn't imagine why that could ever be useful
09:44:23FromDiscord<Rika> In reply to @Sabena Sema "and I bet the": So it's a maintainer issue, great
09:44:56FromDiscord<Sabena Sema> The other issue is that it's muddled with requirements.txt
09:45:15FromDiscord<Sabena Sema> and requirements.txt is _way_ more than just a list of version specifications
09:45:54FromDiscord<Rika> It is?
09:46:13FromDiscord<Sabena Sema> yeah
09:46:23FromDiscord<Sabena Sema> there's a bunch of pip manipulations you can do
09:46:43FromDiscord<Sabena Sema> like list some deps, then change the install prefix to a different site-packages, then list more deps
09:46:45FromDiscord<Sabena Sema> that kinda stuf
09:46:46FromDiscord<Sabena Sema> (edit) "stuf" => "stuff"
09:46:58FromDiscord<ni-max> In reply to @Sabena Sema "it's a little odd": I found a relative docs: https://nim-lang.org/docs/manual.html#generics-symbol-lookup-in-generics
09:47:09FromDiscord<Sabena Sema> yeah, I read that but need to play around
09:47:22FromDiscord<Sabena Sema> also the example for delegated binding might be misleading
09:48:00FromDiscord<Rika> That's scary, the requirements file one
09:48:58FromDiscord<Sabena Sema> yeah, it really is basically a list of command line args
09:49:04FromDiscord<Sabena Sema> and pip's command line interface is really complex
10:05:03FromDiscord<pmunch> No it's not↵(@hieu.nt)
10:06:59PMunchJust do it the way the ecosystem you're using expects it to be done. Don't try to force a solution based on something from a different ecosystem when we already have a solution for this. It's bound to just create confusion and headaches for everyone.
10:08:01PMunchAnd why would you want to commit all your packages anyways? That's not how you're supposed to do it in any language that I'm aware of
10:08:21FromDiscord<Elegantbeef> Git submodules goes brr↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
10:08:51FromDiscord<Elegantbeef> I may or may not have dumbly hit reply on that message
10:12:45PMunchI don't really see which message you replied to
10:12:55PMunchI just see @709044657232936960_=50=4dunch=5b=49=52=43=5d
10:13:52FromDiscord<Elegantbeef> It was your most recent message
10:14:06FromDiscord<Elegantbeef> I just dumbly clicked reply
10:38:30FromDiscord<dom96> In reply to @Sabena Sema "if you want something": Yeah. Please don’t do this.
10:38:50FromDiscord<dom96> Grab the new nimble and help us test the lock files
10:40:33FromDiscord<Sabena Sema> yeah, it's probably not a good idea but it does what he asked for
10:41:10FromDiscord<Sabena Sema> I can see it being useful in cases where nimble isn't running the show I guess
10:41:27FromDiscord<Sabena Sema> OK looking at https://nim-lang.org/docs/manual.html#generics-delegating-bind-statements and the whole section just ... makes no sense
10:41:59FromDiscord<Sabena Sema> the examples don't compile for unrelated reasons (B doesn't import A, so can't write `genericA(x)` no matter what it does with the `init` symbol
10:42:24FromDiscord<Sabena Sema> also `init` takes a `var O` and the `T` in `genericB` isn't going to bind to that
10:42:51FromDiscord<Sabena Sema> if those issues are corrected then the bind statement isn't required to make things work
10:43:19FromDiscord<Sabena Sema> even if B stops importing C and the type definition for O moves to B things _still_ work
10:44:00FromDiscord<Sabena Sema> is this just a relic from an era where generic symbol binding was insane or is there a real problem here that I'm not able to see
10:44:11FromDiscord<Sabena Sema> if the first should this whole section be deleted from the docs?
10:47:50FromDiscord<Sabena Sema> like this all only makes sense to me if the "instantiation context" of genericA is the "_definition_ context" of genericB, but, because the `genericA(x)` function call is dependent it seems to be open (even though there's no overloading involved here)
10:48:14FromDiscord<Sabena Sema> and, since it's open you'd think the instantiation context would be in `main`
11:21:45FromDiscord<Araq> create an issue about it
11:24:02FromDiscord<Araq> but sometimes the manual tries to explain a concept without giving complete, fully compilable examples
11:55:52FromDiscord<Sabena Sema> yeah, if the solution was just “its old info” id make a pr removing it too
11:56:04FromDiscord<Sabena Sema> but it seems like an issue will be helpful
11:56:26FromDiscord<Sabena Sema> Ill create one tomorrow
12:03:07FromDiscord<Southern_Cross_Au> In reply to @Southern_Cross_Au "": I've solved the issue with the GCC compiler. turns out I had another language installed that also used the same compiler - I think it was Hax or something. After I cleared those Path bindings and uninstalled NIM is working perfectly
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:15:05FromDiscord<Rika> It shouldn't have matteres
12:15:07FromDiscord<Rika> Mattered
12:17:37PMunchMaybe the other language had created a gcc wrapper or something
12:31:19FromDiscord<hmmm> yo how do I get a seq of all the keys in a std/table
12:39:30FromDiscord<evoalg> `t.keys.toSeq` ?
12:53:43FromDiscord<hmmm> seems reasonable
12:56:19NimEventerNew Nimble package! spfun - Special Functions of Stats & Physics, see https://github.com/c-blake/spfun
13:02:31*lumo_e joined #nim
13:10:41*rockcavera joined #nim
13:10:41*rockcavera quit (Changing host)
13:10:41*rockcavera joined #nim
13:10:41FromDiscord<gogolxdong (liuxiaodong)> Is while true + async = memory leaks
13:14:51FromDiscord<gogolxdong (liuxiaodong)> Will cps avoid this, and how?
13:16:30FromDiscord<hmmm> so I have been wanting to ask for a while...if I keep defining procs with the [T] thingy, how is that even different from writing python
13:16:57FromDiscord<hmmm> I mean, it's possibly something that shouldn't be done excessively right?
13:17:19FromDiscord<hmmm> 🤔
13:17:40FromDiscord<konsumlamm> what does that have to do with python?
13:17:49FromDiscord<hmmm> python has no type checks
13:18:17PMunchNot quite
13:18:25PMunchI mean the T will get a type at some point
13:18:43PMunchSo you still won't have runtime errors from calling + 10 on a string for example
13:18:45FromDiscord<hmmm> I mean the entire reason we annotate the types is that we want the compiler to make the checks right
13:19:16FromDiscord<gogolxdong (liuxiaodong)> memory grows fast
13:20:08PMunchSure, but T is essentially a way of saying "this procedure can take many types, if you try a type and it doesn't work you'll get an error from within it". But in general you only use T for things like seq[T] for example
13:20:31FromDiscord<hmmm> I see yea
13:20:49PMunchLike `proc add[T](x: var seq[T], y: T)`. That should obviously work for all T's
13:21:02PMunchYou can also constrict T
13:21:23PMunch`proc test[T: int or string](x: T)` for example
13:21:27FromDiscord<hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=3HAs
13:22:00PMunchYes, this ^
13:22:01FromDiscord<hmmm> yea yea now I get it, so it's ok to abuse T to make the procs as general as possible when it makes sense
13:22:13PMunchOf course, that's what it is for
13:22:24FromDiscord<hmmm> I see 😃
13:22:37FromDiscord<vindaar> the "when it makes sense" really is the important bit here
13:22:43PMunchIf you only pass your procedure along to a container or to a procedure for example it's totally fine
13:23:21PMunchgogolxdong_(liuxiaodong), while true + async isn't inherently memory leaks. But you certainly need to manage your async pool
13:24:02PMunchLike if you don't want to call `runForever` you need to somehow call the async runtime to make sure your stuff completes
13:24:23PMunchIf you just schedule a bunch of tasks but never let the runtime run it will pile up memory
13:29:45FromDiscord<gogolxdong (liuxiaodong)> you mean the cps pattern?
13:40:34PMunchI don't believe so
13:40:42PMunchWhat are you currently doing?
13:41:28FromDiscord<gogolxdong (liuxiaodong)> runing multiple of this process, memory grows fast, wonder how
13:44:57PMunchHard to tell without knowing what you're doing
13:53:04*src joined #nim
14:04:45*arkurious joined #nim
14:05:11*terminalpusher joined #nim
14:16:37FromDiscord<0xc45> sent a code paste, see https://play.nim-lang.org/#ix=3HAP
14:17:14*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:18:25*CyberTailor joined #nim
14:19:05CyberTailori can't build nimble from source :(
14:19:08CyberTailorsha1hashes.nim(37, 10) Error: undeclared identifier: 'isValidSha1Hash'
14:22:49PMunchThe Nimble devel branch probably requires the Nim devel branch to build
14:23:01PMunchTry `choosenim devel`
14:23:43PMunchAs you can see `isValidSha1Hash` was introduced to support lock files in Nimble, and I don't think that has been merged into a stable release yet: https://github.com/nim-lang/Nim/blame/46275126b89218e64844eee169e8ced05dd0e2d7/lib/std/sha1.nim#L279
14:27:51*terminalpusher quit (Remote host closed the connection)
14:32:14FromDiscord<gogolxdong (liuxiaodong)> I'm listening on 14 of our accounts to transfer BNB if any available , someone else is trying to charge gas fee to claim our rewards, they can transfer ours if we charge.
14:36:40FromDiscord<gogolxdong (liuxiaodong)> the most important is processes run steady and could let us sleep tight without worrying OOM, otherwise we will probably lose money.
14:49:23FromDiscord<gogolxdong (liuxiaodong)> use process instead of thread because the bug post previously.
14:50:13PMunchThat didn't really make it any clearer to me what you're actually doing in your code
14:55:56*pch quit (Ping timeout: 268 seconds)
14:59:59*PMunch quit (Quit: Leaving)
15:02:36CyberTailorPMunch: i've built devel branch of nim, now i get this error:
15:02:38CyberTailorError: cannot open file: compiler/nimblecmd
15:05:11*lumo_e quit (Ping timeout: 268 seconds)
15:12:01arkanoidI have to cluster a folder of man made text files into groups according to the file header. The headers share some similarities but due to being man made in not possible to just consider it a segnature. Possibly a quasi-signature, or fuzzy signature. How would you tackle this?
15:13:02FromDiscord<gogolxdong (liuxiaodong)> It generally creates web3 connection and keeps sending transaction .
15:14:49FromDiscord<gogolxdong (liuxiaodong)> Does it work if replace await with waitFor?
15:16:54FromDiscord<TryAngle> how do I downgrade nim for a project?
15:17:03FromDiscord<TryAngle> I would like to use nim 1.5 for one
15:17:31FromDiscord<Rika> nim 1.5 is not a stable version just fyi
15:18:12FromDiscord<TryAngle> the dimscord bot seems to not work on 1.6.0 but should work on prior versions as far as I understood
15:18:40FromDiscord<Rika> use 1.4 then (choosenim 1.4 i think)
15:18:44FromDiscord<Rika> (edit) "(choosenim 1.4" => "(`choosenim 1.4`"
15:19:43CyberTailorsubmitting nimble PR without testing feels wrong, but i can't test it :(
15:25:03FromDiscord<hmmm> hey boiz since our sqlite module was complaining about not finding sqlite_64.dll I went to the official site and downloaded it. But apparently their dll is named sqlite.dll without the _64 part. I ended up renaming it and slapping it in the folder of my nim file but feels like pretty dumb. Should I just make a dedicated folder and add to the PATH?
15:25:17*lumo_e joined #nim
15:26:08FromDiscord<hmmm> or there is an approved way of installing sqlite I don't know of
15:27:34FromDiscord<gogolxdong (liuxiaodong)> Is there any solution for this code?
15:43:28FromDiscord<TryAngle> In reply to @Rika "use 1.4 then (`choosenim": ok works ty
15:51:48*CyberTailor quit (Remote host closed the connection)
15:52:39*CyberTailor joined #nim
17:16:26FromDiscord<retkid> is there any convenient way to wasm compile?
17:44:31*xet7 joined #nim
18:00:09FromDiscord<TryAngle> what would be the default way to deserialize a type to json?
18:01:18FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3HCo
18:46:02*advesperacit joined #nim
19:08:26FromDiscord<hmmm> woa I was fighting an entire afternoon vs db_sqlite when we have the vastly superior tiny_sqlite. After this and JSON -> jsony, my faith in std is shaken. I heard Araq wants to unbundle all the stuff, I thing he is right, we need to use the fresh stuff 🧐
19:12:32*lumo_e quit (Remote host closed the connection)
19:12:53*lumo_e joined #nim
19:16:18*krux02 joined #nim
19:23:41*lumo_e quit (Ping timeout: 250 seconds)
19:38:40NimEventerNew question by Netsu: How to get user ID by username/mention - Telegram bot api, see https://stackoverflow.com/questions/70309590/how-to-get-user-id-by-username-mention-telegram-bot-api
19:40:42FromDiscord<spotlessapple> sent a code paste, see https://play.nim-lang.org/#ix=3HCM
19:41:10FromDiscord<spotlessapple> (edit) "https://play.nim-lang.org/#ix=3HCM" => "https://play.nim-lang.org/#ix=3HCN"
19:42:27FromDiscord<hmmm> maybe this: https://github.com/technicallyagd/unpack
19:45:45FromDiscord<spotlessapple> In reply to @hmmm "maybe this: https://github.com/technicallyagd/unpac": Thanks @hmmm ! I did see that, but I believe that focuses mainly on destructuring into predefined variables. I'm more looking for the case of passing an unknown number of variables from a sequence as arguments to a proc/func
19:46:53*PMunch joined #nim
19:50:57FromDiscord<hmmm> hmm I don't know then. Maybe people more skilled than me can craft a macro for it 😃
20:03:02FromDiscord<geekrelief> In reply to @spotlessapple "Thanks <@887269570765791243> ! I": Here's a macro to do it: https://play.nim-lang.org/#ix=3HCU
20:05:13FromDiscord<geekrelief> actually looks like like there's a bug when I pass in variable that's an array as opposed to a literal
20:05:29advesperacitis there any way to remove async traceback output?
20:09:18*terminalpusher joined #nim
20:19:13FromDiscord<geekrelief> In reply to @spotlessapple "Thanks <@887269570765791243> ! I": This should work now https://play.nim-lang.org/#ix=3HCZ
20:20:19FromDiscord<spotlessapple> In reply to @geekrelief "This should work now": Excellent, thanks for the help @geekrelief !
20:20:44FromDiscord<geekrelief> np, I've been meaning to write this anyway 🙂 I'll put it up on gist
20:21:53FromDiscord<geekrelief> https://gist.github.com/geekrelief/d786f01f89d20090f30e4d7ef2325a8e
20:27:14*vicecea quit (Remote host closed the connection)
20:27:45*vicecea joined #nim
20:28:14FromDiscord<geekrelief> In reply to @spotlessapple "Excellent, thanks for the": pushed an update to the gist to also handle seq
20:30:40FromDiscord<geekrelief> ahh.. I should handle tuples too
20:35:32FromDiscord<hmmm> and suddenly it became a library 😆
20:36:15FromDiscord<hmmm> should be named the helping relief 🤔
20:36:44FromDiscord<geekrelief> haha yeah
20:36:48FromDiscord<geekrelief> it handles tuples now
20:38:23FromDiscord<hmmm> damn macros look hard to write
20:38:56*krux02 quit (Remote host closed the connection)
20:39:00FromDiscord<geekrelief> In reply to @hmmm "damn macros look hard": at first, it seems hard, but once you understand the tools to do it, it's addicting
20:39:20nrds<Prestige99> They're pretty unreadable though
20:39:24FromDiscord<geekrelief> basically use `dumpAstGen` and `astGenRepr` to figure out the structure of what you want to create
20:39:29PMunchYeah macros look tricky, but they're not that hard to write
20:39:33FromDiscord<geekrelief> In reply to @nrds "<Prestige> They're pretty unreadable": nah
20:39:40PMunch@geekrelief, glad to see that my tools are actually getting used :)
20:39:45FromDiscord<geekrelief> anyone comfortable writing macros can read them
20:39:54PMunchEhhm
20:40:06PMunchI can barely even read my own macros :P
20:40:06FromDiscord<hmmm> what's the absolute novice macro primer on shooting your foot with macros?
20:40:21FromDiscord<geekrelief> I've jumped into some crazy looking macros in godot-nim
20:40:34FromDiscord<geekrelief> "readable" to me is debuggable
20:40:49PMunch@hmmm, I wrote this https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html
20:41:05FromDiscord<geekrelief> for the most part if I don't understand something I can drop in an `echo node.astGenRepr` and go from there
20:41:08PMunchTakes you from a small program, to a small program with macros
20:41:21PMunchOh yeah, that's true
20:42:19PMunchBut I mean, look at this and tell me it's readable :P https://github.com/PMunch/protobuf-nim/blob/master/src/protobuf.nim#L555
20:43:14FromDiscord<geekrelief> For anyone scared of macros, don't be. Just take it slow. The NimNodes are a tree, each with a `kind` field. From there you just need to know that each kind of node has a certain number of children that expect to be certain kinds of nodes.
20:43:29FromDiscord<geekrelief> The docs cover it well.
20:43:39FromDiscord<geekrelief> The rest is experimentaton
20:43:57PMunchI tried to write macroutils to make macros a bit more readable
20:44:11*lumo_e joined #nim
20:44:26PMunchUnfortunately haven't had much of a possibility to use it yet..
20:45:06FromDiscord<geekrelief> yeah things could definitely be easier, but I seem to be doing fine without additional utilities. I just use `astGenRepr` everywhere. 🙂
20:47:06PMunchTo be fair astGenRepr didn't exist when I started out writing macros :P
20:47:12PMunchWhich is why I wrote it :)
20:47:17nrds<Prestige99> I hardly ever run into cases where I'd want to use a macro
20:47:41PMunchPrestige, you're just not hooked yet
20:47:52PMunchJust wait until you get your first macro high, there's no going back
20:48:01FromDiscord<Solitude> In reply to @geekrelief "yeah things could definitely": i believe in treeRepr supremacy 🙏
20:48:28FromDiscord<geekrelief> without macros, some code is just way more painful to write
20:49:09PMunchNot to mention read
20:50:57nrds<Prestige99> PMunch I think I'm just not creative enough maybe
20:54:40nrds<Prestige99> I think i've only ever used a macro once
20:54:54nrds<Prestige99> and it probably could have been a template lol
20:55:06FromDiscord<geekrelief> I've been experimenting with this macro lately: https://github.com/geekrelief/genit
20:56:45FromDiscord<hmmm> oh that's quite nice geeky bro, I like robot code, that's how I write anyway lol
20:57:10PMunch@geekrelief, oh wow, that looks really neat
20:57:25FromDiscord<hmmm> give me nice repetitive ordered blocky code and I feel at home
20:57:41PMunchSo many times I've thought "there has to be a better way" for this code of problem. But there are just too many different names
20:57:45FromDiscord<geekrelief> thanks, guys. I wanted something like a templating language for nim. I feels like something between a template and macro
20:57:55PMunchBut with `something it` you can do it really easily!
20:58:09FromDiscord<geekrelief> the implementation is a bit of a mess since I was just experimenting
20:58:19FromDiscord<geekrelief> but I'm planning on rewriting it at some point.
20:59:45FromDiscord<geekrelief> I want to improve the performance and expand on it more. I'm pretty much using it all over my TM binding.
21:17:25*terminalpusher quit (Remote host closed the connection)
21:18:17PMunchStream is live for day 10 of AoC: https://www.twitch.tv/pmunche
21:21:17*xet7 quit (Quit: Leaving)
21:23:17*xet7 joined #nim
21:31:31*vicfred joined #nim
21:58:24*vicfred quit (Quit: Leaving)
21:59:32FromDiscord<Sabena Sema> In reply to @hmmm "yea yea now I": so its not horrible to do this (and nims module system removes some of the codegen spam that can result) using generics everywhere will defer compile errors util the point where you use (instantiate) the generic. this can result in poor diagnostics. Also you cant form a pointer to a generic proc, only a specific instance
22:01:19FromDiscord<Elegantbeef> You say that like one should be able to have a pointer to a generic proc 😀
22:01:25*jjido joined #nim
22:05:18FromDiscord<Sabena Sema> well there are ways to implement generics that allow stuff lime that in some cases
22:06:54FromDiscord<Sabena Sema> (edit) "lime" => "like"
22:07:42FromDiscord<TryAngle> In reply to @hmmm "woa I was fighting": did u make tinysqlite work?↵I don't understand how to filter select
22:08:32*rockcavera quit (Remote host closed the connection)
22:09:48*krux02 joined #nim
22:29:33FromDiscord<Sabena Sema> OK so the docs are actually right on the basics of when symbols are open
22:30:09FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HDJ
22:30:11FromDiscord<Sabena Sema> the first prints "4" the second prints "5"
22:30:23FromDiscord<Sabena Sema> surprising, but a nice simple rule
22:30:49FromDiscord<Sabena Sema> although....
22:31:02FromDiscord<Sabena Sema> I wonder if that happens if `bark(x:float):float` comes from another module
22:31:16FromDiscord<Sabena Sema> that does seem a bit questionable to me, but also has some nice effects
22:33:59FromDiscord<Elegantbeef> It should bind properly, assuming it's an open symbol(it should be in a generic)
22:35:16FromDiscord<Sabena Sema> the point here is that adding the float overload of bark turns bark from a closed to an open symbol in the generic
22:36:39FromDiscord<Elegantbeef> Yea i'd argue proc calls that depend on something derived from the generic should be always open
22:36:55FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HDM
22:37:03FromDiscord<Sabena Sema> yeah, that was my first instinct
22:37:10FromDiscord<Sabena Sema> but that's not actually true in c++ oddly
22:37:22FromDiscord<Sabena Sema> a dependent function call _that is fully qualified_ is open
22:37:31FromDiscord<Sabena Sema> but function calls subject to adl need at lease one overload
22:37:55FromDiscord<Elegantbeef> But luckily we can just do `mixin bark`
22:38:17FromDiscord<Sabena Sema> yes
22:40:38FromDiscord<Sabena Sema> yeah the multi-module one does NOT force the symbol open (which is good, otherwise the openness would depend on import order)
22:40:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3HDO
22:40:55FromDiscord<Sabena Sema> oh, neat
22:41:07FromDiscord<Elegantbeef> That makes sense as the symbol openess is based off the declaration site not instantiation
22:41:18FromDiscord<Elegantbeef> If it was based off instantiation site it'd always be open in most cases
22:44:14FromDiscord<Elegantbeef> Hmm i feel like having closed symbols if there is only a single overload in the generic scope just wrong
22:44:26FromDiscord<Elegantbeef> Wonder what breaks if i were to make them all open
22:45:25FromDiscord<Sabena Sema> anyway https://github.com/nim-lang/Nim/issues/19240 submitted on the "Delegating bind statement" section being nonsense
22:46:12FromDiscord<Sabena Sema> I think there are advantages to doing it that way (having it closed with only a single overload)
22:46:42FromDiscord<Elegantbeef> I mean the benefit is you dont export the procedure that it closely bound to
22:47:08FromDiscord<Sabena Sema> no, the benefit is that random other stuff can't break your code
22:47:09FromDiscord<Elegantbeef> But in the case it's open and you dont add an override the proc you call should still be that one assuming the override matches
22:47:29FromDiscord<Elegantbeef> I mean that's what i was eluding to
22:47:43FromDiscord<Elegantbeef> It binds tightly to that proc so nothing can break 😀
22:47:52FromDiscord<Elegantbeef> overload matches\
22:48:04FromDiscord<Sabena Sema> also, when the binding is closed the compiler can emit diagnostics immediately
22:48:14FromDiscord<Sabena Sema> so it makes it easier to write correct generic code
22:48:31FromDiscord<Elegantbeef> In the case that it's infact supposed to be a closed symbol
22:49:10FromDiscord<Elegantbeef> Really i'd argue all closed symbols in generics should emit a hint "closedSymbol X bound to Y"
22:49:54FromDiscord<Elegantbeef> Cause to me a closed symbol is very much the opposite of what you want in most generic code unless it's constrained to a specific type
22:50:10FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HDT
22:50:16FromDiscord<Sabena Sema> whereas if you uncomment the float overload the compiler can't emit that error
22:50:49FromDiscord<Elegantbeef> I personally dont care about early diagnostics for generics
22:51:11FromDiscord<Elegantbeef> Concepts should be used to constrain generics if they're supposed to match a signature
22:51:50FromDiscord<Sabena Sema> if you open all symbols than concepts still can't provide diagnostics at the point of definition
22:51:59FromDiscord<Elegantbeef> Like i said i dont care
22:52:07FromDiscord<Sabena Sema> because concepts are not exhaustive (it's not like rust, it's like C++)
22:52:21*krux02 quit (Remote host closed the connection)
22:52:24FromDiscord<Sabena Sema> I actually kinda like this rule a lot
22:52:43FromDiscord<Sabena Sema> because it avoids having to deal with what's a "dependent expression" or whatever
22:52:55*krux02 joined #nim
22:53:10FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HDU
22:53:13FromDiscord<Sabena Sema> has the same behavior as before
22:53:41NimEventerNew thread by Cnerd: Httpbeast failed to compile on Android arm device, see https://forum.nim-lang.org/t/8699
22:55:31FromDiscord<Elegantbeef> I think most people dont want closed symbols in generics so this causes more issues than it solves
22:55:55FromDiscord<Elegantbeef> I could be wrong, but i just dont see the benefits being that great
22:57:17FromDiscord<Elegantbeef> If all generics are forced open by default then closed symbols are explicit `bind` behaviour, which means it's very opaque where you want closed symbols is my view atleast
22:58:35FromDiscord<Sabena Sema> making all symbols open is a huge nightmare for maintaining anything
22:59:03FromDiscord<Sabena Sema> (edit) "maintaining anything" => "long term maintenance"
22:59:25FromDiscord<Elegantbeef> I dont know that i agree simply cause it's generally desired for non constrained types
23:02:23FromDiscord<Sabena Sema> only for dependent expressions
23:03:14FromDiscord<Elegantbeef> Thta's what i'm talking about
23:04:01FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HE1
23:04:24FromDiscord<Sabena Sema> (btw I think zig _does_ make literally everything open, and it's one reason why I'm skeptical of doing big projects in zig)
23:04:31FromDiscord<Sabena Sema> I have to test it out though
23:04:42FromDiscord<Elegantbeef> I mean i didnt mean literally every symbol
23:04:53FromDiscord<Elegantbeef> I meant any symbol that depends on the generic type
23:05:04FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HE2
23:05:07FromDiscord<Sabena Sema> but
23:05:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3HE3
23:05:52FromDiscord<Elegantbeef> Without `bind bark` and without the float overload it'd shoulbe be an open symbol imo
23:06:39FromDiscord<Sabena Sema> well, `bark(i)` is not dependent on any generic parameters
23:06:55FromDiscord<Sabena Sema> so you get this kinda brittle dynamic scoping of functions that leads to lots of breakage over time
23:07:48FromDiscord<Elegantbeef> I copied the wrong code 😀
23:07:49FromDiscord<Sabena Sema> it also means that it's far more likely different instantiations of a generic will result in like, actually different code
23:07:51FromDiscord<Sabena Sema> which is bad
23:10:11FromDiscord<Elegantbeef> Like i said `bark(i)` wouldnt be dependant on open/closed symbols it'd be bound to `bark(int or var int)`
23:10:34FromDiscord<Elegantbeef> I'm not an idiot i just copied the wrong code
23:10:34FromDiscord<Sabena Sema> so it's closed
23:10:48FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=3HE4
23:10:56FromDiscord<Sabena Sema> oh no
23:11:02FromDiscord<Sabena Sema> you're saying it should be open
23:11:07FromDiscord<Elegantbeef> It's not dependant on the generic parameters
23:11:13FromDiscord<Elegantbeef> i'm certainly not
23:11:22FromDiscord<Sabena Sema> but again, if it binds to int or var int that's what open means
23:11:32FromDiscord<Elegantbeef> I mean that depends on overloads
23:11:39FromDiscord<Elegantbeef> Whatever is declared above this generic instantiation it matches
23:11:44FromDiscord<Sabena Sema> if it's closed it can't bind to the var int one because that function is not declared when the generic is parsed
23:11:47FromDiscord<Elegantbeef> In this case it'd bind to `bark int`
23:11:51FromDiscord<Sabena Sema> OK so closed
23:12:10FromDiscord<Elegantbeef> Well not technically closed but yes
23:12:16FromDiscord<Elegantbeef> It'd just be a bound symbol in this casee
23:12:44FromDiscord<Sabena Sema> I mean that's what closed means
23:13:00FromDiscord<Elegantbeef> No there is actually a difference between closed/sym in the compiler
23:13:17FromDiscord<Elegantbeef> In this case it'd not be labelled a closed sym but semantically the same thing
23:13:44FromDiscord<Elegantbeef> Anyway only procedures that derive from generic parameters is what i'm saying should be forced open unless using bind
23:14:00FromDiscord<Elegantbeef> It makes the most sense i think as closed sym seems to very much be a thing of "I know i want this bound tightly"
23:14:17FromDiscord<Sabena Sema> bind forces an identifier closed
23:14:33FromDiscord<Sabena Sema> no, closed symbols should be the default when possible
23:14:36FromDiscord<Elegantbeef> Can you stop explaining things to me like i dont know what it does thanks
23:14:46FromDiscord<Sabena Sema> sorry
23:15:20FromDiscord<Sabena Sema> yeah I think we agree
23:15:26FromDiscord<Elegantbeef> I'm very much the opposite boat cause i really think in the general case you rarely want closed symbols
23:15:29FromDiscord<Sabena Sema> dependent calls open, non-dependent closed
23:15:46FromDiscord<Elegantbeef> Well non dependant cannot be open that makes 0 sense 😛
23:15:51FromDiscord<Sabena Sema> no
23:15:52FromDiscord<Sabena Sema> they can
23:16:08*advesperacit quit (Quit: advesperacit)
23:16:14FromDiscord<Elegantbeef> shouldnt\
23:17:36FromDiscord<Sabena Sema> yeah, it is sometimes useful to make them open, though
23:17:53FromDiscord<Sabena Sema> but yeah, I think we basically agree
23:18:21FromDiscord<Sabena Sema> but, the rules nim uses are much simpler than having to figure out what qualifies as a type dependent (or value dependent) expression
23:20:40FromDiscord<Elegantbeef> I dont imagine it's that complicated to resolve though, just check everycall if any type has `tyGenericParam` inside it's body and if so make it an openSym if not
23:20:40FromDiscord<Elegantbeef> if not `bind`ed\
23:20:40FromDiscord<Elegantbeef> I mean the mechanism is clearly already there, so just slight switch of logic for more sensible generics
23:20:54FromDiscord<Elegantbeef> Though since it'd be a breaking change i reason it wont be accept it
23:23:54FromDiscord<Sabena Sema> I really doubt that's why, this is more subtle than that
23:25:53FromDiscord<evil> is there a library for dealing with jsonc files? the comments really mess up the std json parser
23:30:00FromDiscord<Elegantbeef> There is a json5 implementation not the same as jsonc but allows comments
23:33:00*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:46:25*src quit (Quit: Leaving)
23:55:13*src joined #nim