<< 25-10-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:00:22*apahl joined #nim
00:03:20*junland joined #nim
00:18:38*vicfred joined #nim
00:28:49PrestigeI'm having some trouble figuring out why this isn't compiling https://github.com/avahe-kellenberger/astroships/blob/2-Architecture/tests/api/tlayer.nim#L10 "Unhandled exception: invalid object conversion [ObjectConversionError]"
00:29:22PrestigeTestEntity is an extension of Entitiy, so I thought I could cast it. Is there a way to do this?
00:32:25PrestigeOr do I need to implement a new proc to create an instance of a "subclass", even though I just want to execute to behavior of the super class
00:35:48jonjitsu[m]What IDE+plugins gives the best intellisense?
00:38:38Prestigevscode and vim both have decent plugins
00:42:50FromDiscord<Yardanico> neovim
00:42:52*opal joined #nim
00:42:58FromDiscord<Yardanico> (adding to the above (
00:43:21FromDiscord<Yardanico> @jonjitsu most plugins rely on nimlsp or nimsuggest, so the quality of autocompletion will mostly be the same
00:44:04FromDiscord<nikki> working through dom's book and am at the twitter one now. just to check -- do other people also have nimlsp have trouble in jester route macros?
00:51:53*mbomba quit (Quit: WeeChat 2.9)
01:01:05*Axiomatic quit (Remote host closed the connection)
01:06:32*krux02 quit (Remote host closed the connection)
01:23:13*abm quit (Quit: Leaving)
01:46:04leorize[m]1Prestige: sadly, yes, you need a new proc for the subclass
01:51:10Prestigeleorize[m]1: dang, okay
01:56:15*maxrazer joined #nim
01:56:17*maxrazer left #nim ("Leaving")
02:12:20disruptekgyllou: pretty sure weave's channels are custom.
02:12:34disruptekping @gyllou
02:12:41disruptekour channels are simple memcpy.
02:13:37disruptekwhich is to say, the buffer may be shared, but it requires a copy to move stuff from one thread to another via the channel.
02:21:57*apahl quit (Ping timeout: 260 seconds)
02:23:37*apahl joined #nim
03:06:23*opal quit (Ping timeout: 240 seconds)
03:06:38*bung quit (Read error: Connection reset by peer)
03:10:16*opal joined #nim
03:23:12*muffindrake quit (Ping timeout: 260 seconds)
03:25:01*muffindrake joined #nim
03:35:53FromDiscord<nikki> is there some template / macro to embed the bytes of a file as a string at compile time
03:36:11FromDiscord<nikki> eg. to embed a '.png' file that you're gonna display. obv. you can have the file nearby at runtime and read it. but embedding is kinda nice some times.
03:45:47FromGitter<iffy> I'm trying to use asyncdispatch stuff on Android. https://nim-lang.org/docs/selectors.html says that Android isn't fully supported. This issue https://github.com/nim-lang/Nim/issues/5094 makes me think that modern versions of Android (i.e. those with `signalfd.h`) should work fine. And in fact, when I compile my Nim-generated C with Android NDK, Android v14 fails to build for lack of epoll, but Android v21 builds fine.
03:45:48FromGitter... Does the "(except for Android)" part on the selectors docs need to be clarified?
03:45:48disbotโžฅ Android support for upcoming/asyncdispatch
03:46:29FromGitter<iffy> And should this line change? https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/selectors.nim#L37
03:49:21FromDiscord<hobbledehoy> @nikki I've always used readFile with a const variableโ†ตdon't know how well it would work for image files though since readFile only returns a string
03:49:57Prestigewa
03:50:00Prestigewoops
04:04:01FromDiscord<hobbledehoy> (edit) @nikki I've always used readFile with a const variable (you could just use a static block instead I think)โ†ตdon't know how well it would work for image files though since readFile only returns a string
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:34*supakeen joined #nim
04:12:03FromDiscord<ElegantBeef> @nikki `staticRead` or `slurp`
04:14:28FromDiscord<ElegantBeef> @hobbledehoy it works completely fine as strings are afterall just fancy byte sequences
04:21:49FromDiscord<hobbledehoy> Ah okโ†ตWhat does slurp do that's different to readFile? Is it the checking that it ran at compile time only?
04:22:04FromDiscord<ElegantBeef> It's a staticRead alias
04:22:22*waleee-cl quit (Quit: Connection closed for inactivity)
04:23:58FromDiscord<hobbledehoy> Misread the docs, thought it was the other way around
05:10:54FromDiscord<nikki> nice, thanks folks ๐Ÿ˜ฎ
05:19:59FromDiscord<ElegantBeef> Damn hitting VM iteration limits ๐Ÿ˜ฆ
05:20:42*mbomba joined #nim
05:24:07*vicfred quit (Ping timeout: 246 seconds)
05:24:40leorize[m]1disruptek: I got this working if you wanna try: https://github.com/alaviss/setup-nim
05:25:03leorize[m]1my test matrix is somehow even bigger than nightlies build matrix :P
05:26:45FromDiscord<flywind> I find `Karax` is not as flexible as `React` when constructing UI library,
05:27:22FromDiscord<flywind> But it is acceptable I guess.
05:27:30FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2BUs
05:29:39FromDiscord<shashlick> @leorize I might be your first user
05:32:34leorize[m]1I would appreciate it :)
05:33:41leorize[m]1fun fact, I build nimterop as part of the test suite
05:47:18*oculuxe joined #nim
05:48:22*oculux quit (Ping timeout: 256 seconds)
05:56:00PrestigeI'm looking at examples of concepts, curious about how this example works witih generics https://gist.github.com/honewatson/583135c1b191119a3b3be3fdbfe8607b
05:56:23PrestigeWhy doesn't toString[T] complain about data.name and data.kind?
05:59:48*solitudesf joined #nim
05:59:51mipriit doesn't know anything about data except that it's some kind of type, so it accepts it
06:00:11PrestigeInteresting. I thought it would be more strict
06:00:25miprino, concepts are about adding that strictness
06:01:15PrestigeI mean, it seems you could compile toString on any object with that generic proc, but would just fail at runtime. Is that right?
06:01:40miprino, it still fails at compile time
06:02:08FromDiscord<ElegantBeef> Generics only generate code when they're called, so when you call it it'll error
06:02:27PrestigeHm, cool
06:02:58FromDiscord<ElegantBeef> It's ducktyping in action where you can use any kind that has name/kind
06:03:24PrestigeI need to start using concepts
06:03:39FromDiscord<ElegantBeef> Yea generics/concepts are nice
06:08:06Yardanico!status
06:08:08FromDiscordUptime - 4 days, 10 hours, and 31 minutes
06:12:51PrestigeHm okay maybe they are more limited than I had hoped
06:13:40FromDiscord<ElegantBeef> What's your issue?
06:15:18PrestigeI created an `Entity` concept with a few procs, then tried using a seq[Entity] to iterate over them and invoke their procs
06:15:34Prestigegetting type mismatch: got <Entity> but expected 'Entity'
06:15:55FromDiscord<ElegantBeef> Is entity a concept?
06:15:59PrestigeYes
06:16:05FromDiscord<ElegantBeef> Concepts cannot be used at runtime
06:16:17FromDiscord<ElegantBeef> They're a compiletime construct
06:16:18Prestigeah
06:17:15miprisay you write `proc foo[T](n: T): T = n + n`, and you also define + over strings. then you can call this proc with a string. But if the proc accepts a concept instead of anything, then the concept can require other operations than + so you get a compile error even though string addition works
06:17:49miprior even just `NotString = concept x`, `x is not string`
06:18:03FromDiscord<ElegantBeef> Yea concepts are fantastic tools to abstract across multiple objects dynamically
06:18:24miprithey're additional checks. and one benefit is that you get a failure earlier than later. It's not the C++ sprawl of "something very deep inside this rat's nest of templates didn't like that"
06:19:55mipriand maybe the name of the concept is a better hint than "something couldn't eventually couldn't add these two things"
06:21:47FromDiscord<ElegantBeef> Prestige i assume you trying to get interfaces?
06:22:41PrestigeYeah pretty much. It's fine though, I have another way I was going to use anyway
06:22:51Prestigejust wondered if concepts would work
06:22:59FromDiscord<ElegantBeef> There is the streams way
06:23:10PrestigeStreams?
06:23:52FromDiscord<ElegantBeef> The way that streams makes an interface is having `readDataImpl` and `setDataImpl` which are assigned when you call `newStringStream` or any other constructor to the one they're supposed to be
06:24:25PrestigeThat's interesting
06:24:28FromDiscord<ElegantBeef> A quick visible example is this lotsa boilerplate but a macro could make it nicer https://play.nim-lang.org/#ix=2BxR
06:24:43FromDiscord<ElegantBeef> Also there are modules for quick interfaces
06:24:48FromDiscord<ElegantBeef> Interfaced is one i know of
06:25:11FromDiscord<ElegantBeef> https://github.com/slangmgh/interfaced
06:25:35PrestigeIf I get the time I really want to try creating my implementation of MI with macros. I don't even know if it's possible though
06:26:37FromDiscord<ElegantBeef> I dont think you can due to the branches converging and you can only have a single parent, although you can just make a new object of that parent so instead of a diamond you get sibling of the two you want to inherit from
06:28:17PrestigeHave you read the paper 4raq linked on my RFC? I think most of it could be implemented, but having to read the code that's already written as a "method", idk if you can do that
06:28:35PrestigeHaven't looked into it
06:28:36FromDiscord<ElegantBeef> I've not
06:28:56PrestigeIt's only 6 pages I think, was a good read
06:32:31*mal`` quit (Quit: Leaving)
06:34:31FromDiscord<ElegantBeef> Ah the twin objects is sorta what i was describing
06:35:13FromDiscord<ElegantBeef> I said make it a single container which wouldnt work, but shhhh ๐Ÿ˜„
06:39:57PrestigeHehe
06:40:16PrestigeCool idea though, I think this implementation would be great
06:40:35PrestigeWe'd get pretty cheap & useful MI
06:41:06PrestigeI just have almost no experience with macros, is the problem
06:41:55FromDiscord<ElegantBeef> I do have experience with them... but do i really want to make MI
06:43:59*Prestige says yes
06:44:02*mal`` joined #nim
06:44:13PrestigeIf only my jedi mind tricks worked on beef
06:44:17FromDiscord<ElegantBeef> I mean it's evil incarnate
06:44:56PrestigeI think it's great in the right application. It would be very powerful
06:45:12FromDiscord<ElegantBeef> So is a tank
06:45:22FromDiscord<ElegantBeef> Doesnt mean i'm going to code using a tank
06:46:11FromDiscord<ElegantBeef> Also we create so many objects really quickly if i understand it properly
06:46:40PrestigeYeah that seems to be the premise of that implementation
06:47:20FromDiscord<ElegantBeef> Cause if you have A, B ,C and you have D = B | C you now hoave DB DC, then if you do E = D | A you have EDCA, EDBA
06:50:06Prestigewait but don't B and C extend A
06:50:16FromDiscord<ElegantBeef> Not in my example
06:50:23Prestigeoh ok
06:52:29*Axiomatic joined #nim
06:52:33*Axi0matic joined #nim
06:52:37*Axi0matic quit (Remote host closed the connection)
06:54:42FromDiscord<ElegantBeef> Using an object variant is the least objectionable imo
06:55:24Prestigefor an implementation of MI?
06:55:32FromDiscord<ElegantBeef> Yes
06:55:49PrestigeHow would that work?
06:55:59FromDiscord<ElegantBeef> It means you have to define the entire inheritance structure inside a single DSL ๐Ÿ˜›
06:57:41FromDiscord<ElegantBeef> In essence it's not 100% MI ๐Ÿ˜›
06:58:26PrestigeI think the implementation described in the paper would be fine tbh
06:58:42FromDiscord<ElegantBeef> I really dont like the absurd amount of types generated
06:59:39FromDiscord<ElegantBeef> Can you represent it with 3 types in nim code?
07:00:20FromDiscord<ElegantBeef> IE C = A | b
07:00:45Prestigeoh, hm well mostly. I can created a representation but not a working example
07:00:51Prestigecreate*
07:01:02FromDiscord<ElegantBeef> Quickly throw it together
07:02:28PrestigeI mean what do you want to see? It would just be a recreation of the examples in the paper
07:02:51FromDiscord<ElegantBeef> Just the type definition of an C inheritance A and B
07:03:01FromDiscord<ElegantBeef> "a C" even ๐Ÿ˜„
07:03:49Prestige..just the type definition? like, type C = ref object of A, B?
07:04:56FromDiscord<ElegantBeef> I mean the implementation that the MI would require
07:05:07FromDiscord<ElegantBeef> Just curious of this is it https://play.nim-lang.org/#ix=2BUK
07:05:16FromDiscord<ElegantBeef> Guess i could've wrote that out ๐Ÿ˜„
07:05:41FromDiscord<ElegantBeef> Forgot the important part actualy https://play.nim-lang.org/#ix=2BUL
07:07:03Prestigeanother thing mentioned in the paper is that you don't need CA and CB, you can have A or B hold the reference to C
07:07:26FromDiscord<ElegantBeef> Doesnt that mean you're adding noise to the Typdefs?
07:07:43Prestigenah just one less object
07:08:04FromDiscord<ElegantBeef> Uhh
07:08:06Prestigethat's what this is about https://i.imgur.com/17sUUu8.png
07:08:28FromDiscord<ElegantBeef> How does removing the CA/CB work though?
07:09:08PrestigeYou don't need CA since CB has a reference to A, which has a reference to C
07:09:52PrestigeI fucking love water
07:09:54FromDiscord<ElegantBeef> "is that you don't need CA and CB, you can have A or B hold the reference to C"โ†ตMade it sound like you were suggesting to add a `c:C` field to the parent classes
07:10:13*Axiomatic quit (Remote host closed the connection)
07:10:31PrestigeI just meant what that diagram is showing, how A has a ref to C
07:10:46FromDiscord<ElegantBeef> Yea i see how CA is redundant
07:10:52FromDiscord<ElegantBeef> Just that phrasing was confusing
07:11:50Prestigesorry haha. It's late
07:23:10*arecacea1 quit (Remote host closed the connection)
07:24:01*arecacea1 joined #nim
07:30:28*mbomba quit (Quit: WeeChat 2.9)
07:36:11*NimBot joined #nim
07:41:54*natrys joined #nim
07:43:15*xet7 quit (Remote host closed the connection)
07:43:17*mfiano joined #nim
07:44:28*xet7 joined #nim
07:52:59FromDiscord<ElegantBeef> There prestige i've implemented the basis ๐Ÿ˜„ https://play.nim-lang.org/#ix=2BUS
07:55:58Prestigeinteresting
07:56:07PrestigeI'll need to look over this when I'm more awake haha
08:01:02FromDiscord<ElegantBeef> Still need a bunch of things though, like being able to do `CB.a` to get a value from it, which can just be a proc
08:01:15FromDiscord<ElegantBeef> But ehh it's not too hard to do imo
08:02:34PrestigeThe hard part is implementing the section I explained about the diamond
08:06:46FromDiscord<ElegantBeef> Uncertan what that is ๐Ÿ˜„
08:07:21FromDiscord<ElegantBeef> Reading is for peopl that actually...want to learn
08:10:05Prestigehaha. well it's the part I'm worried about implementing in macros
08:12:45*tane joined #nim
08:26:28*lritter joined #nim
08:32:03*Vladar joined #nim
08:57:23lbarthey... why can't I build csource?
08:57:23lbart./koch csource
08:57:23lbart> .../Nim/compiler/msgs.nim(13, 19) Error: cannot open file: std/private/miscdollars
08:57:23lbartError: call to nim compiler failed
08:57:33lbart(on mac and freebsd)
08:57:43lbartdevel and 1.4
09:09:45Yardanicowell csource building is not really tested I think
09:09:49Yardanicobecause they're frozen at 0.20 in the repo
09:10:00Yardanicoyou can open an issue
09:10:59lbartok, I'm trying to add more platform for netbsd and openbsd so I need to regenerate csource
09:14:25*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:19:41*mfiano quit (Quit: WeeChat 2.9)
09:19:57*mfiano joined #nim
09:19:59*mfiano quit (Client Quit)
09:21:42*mfiano joined #nim
09:23:26leorize[m]1Yardanico: it's always tested, nightlies bundles the csources of the same conpiler version
09:23:34Yardanicooh right
09:23:36leorize[m]1compiler*
09:28:44*mfiano quit (Quit: WeeChat 2.9)
09:29:30lbartYardanico: I found the problem...
09:29:48lbartkoch used nim installed
09:30:29lbartif I remove nim package, I can generate the source with the nim version compiled from scratch
09:31:58ZevvIs this a bug, and if yes, how can something like this creep in? https://play.nim-lang.org/#ix=2BVK
09:33:11ZevvOr this one, annotated: https://play.nim-lang.org/#ix=2BVM
09:33:20*mfiano joined #nim
09:35:16YardanicoZevv: weird bug indeed
09:35:22Yardanicobut you can workaround it relatively easily
09:35:28Yardanicoproc foo[A: SomeNumber, B: SomeNumber](a: A, b: B) =
09:37:17Zevvyeah but it is really nasty because it is so obviously wrong
09:37:36Zevvand has been since ever
09:39:12ZevvI'm not even sure what to put in the title for the issue
09:52:30ZevvOh wait it is in the manual, dang
09:53:16ZevvI did not expect this behaviour
09:53:43Zevvalso `proc foo(a: int|float, b: int|float)` is just fine
09:55:32FromDiscord<lqdev> imagine not using type propagation
09:56:08Yardanicothanks for using italics
09:56:34FromDiscord<lqdev> yard did you add formatting support to the bridge?
09:56:35Yardanicoimagine imagining
09:56:40Yardanicoyes but it's a bit buggy
09:56:46Yardanicobut it can convert irc->md and md->irc
09:56:54FromDiscord<lqdev> cool
09:56:55Yardanicobut buggy
10:04:49FromDiscord<tomck> sent a long message, see https://paste.rs/lhO
10:09:31FromDiscord<lqdev> which lib do you want to load?
10:09:37FromDiscord<lqdev> glfw? cimgui?
10:09:53FromDiscord<lqdev> the DLLs are defined here https://github.com/nimgl/nimgl/blob/master/src/nimgl/glfw.nim#L16
10:11:53FromDiscord<tomck> glfw - so how do i point it to a specific dll?
10:12:00FromDiscord<tomck> Or do i just need a dll with that name in the root dir?
10:12:19Yardanicowell you can see the code
10:12:30Yardanico-d:glfwDLL and then just put the dll into the same dir as the binary on windows
10:12:36Yardanicoif you're on windows*
10:13:24Yardanicoand the dll should be named glfw3.dll
10:15:33FromDiscord<tomck> I can pass that -d:glfwDLL flag to `nimble run` right? Or do i need to target defines to a specific package?
10:16:44ee7[m]I'm about to create an issue for this: https://play.nim-lang.org/#ix=2BVU . (And I know it works with `newSeq` rather than `newSeqOfCap`). Can somebody give me a nice issue title?
10:21:58FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2BW8
10:22:12FromDiscord<tomck> (edit) "https://play.nim-lang.org/#ix=2BW8" => "https://play.nim-lang.org/#ix=2BW9"
10:22:48FromDiscord<tomck> other than that it's working, picking up the right dll too
10:23:13FromDiscord<tomck> i'm on linux with a master build of glfw
10:23:47FromDiscord<dom96> @tomck that should work fine
10:23:51FromDiscord<Recruit_main707> nimgl uses an specific glfw version
10:24:04FromDiscord<Recruit_main707> i guess thats why it errors
10:24:13FromDiscord<dom96> it sounds like you need a newer glfw dll
10:24:28FromDiscord<Recruit_main707> wrappers wont magically update by using the latest dll
10:24:38FromDiscord<tomck> I don't think it's possible to go newer, this is the latest glfw build
10:24:54FromDiscord<Recruit_main707> you have to go with an older afaik
10:25:26FromDiscord<tomck> i see - could i just import the C header & get rid of nimgl for glfw altogether?
10:25:46FromDiscord<Recruit_main707> not really
10:27:07FromDiscord<Recruit_main707> if you really need to use the latest glfw version, you can try updating the things that changed locally
10:27:46FromDiscord<Recruit_main707> but thats gonna be more painful than just using whatever version it is supposed to use
10:28:10FromDiscord<Recruit_main707> there was a nimterop wrapper though
10:28:33FromDiscord<Recruit_main707> it might use the latest version of glfw
10:31:31FromDiscord<Recruit_main707> https://github.com/jyapayne/nim-glfw
10:31:37FromDiscord<Recruit_main707> i think it does
10:33:22FromDiscord<tomck> So what's the issue with updating the wrapper? I thought nim had some cool c -> nim translation capability for C headers?
10:33:33FromDiscord<tomck> is glfw just a special case where that doesn't work?
10:33:58FromDiscord<Recruit_main707> its not a capability, its an external tool
10:34:23FromDiscord<Recruit_main707> its called c2nim, but it doesnt usually work magically first try and you will need to do some work
10:34:37FromDiscord<dom96> the code also needs to be changed not to use `glfwRawMouseMotionSupported`
10:34:53FromDiscord<Recruit_main707> nimterop is similar to c2nim, and seems to have potential to substitute it
10:35:22FromDiscord<Recruit_main707> (if only i could install it, but it should work fine in your pc)
10:35:44FromDiscord<tomck> i'm testing out the nimterop version now, why can't you install?
10:35:53FromDiscord<tomck> @dom96 what do you mean?
10:36:06FromDiscord<dom96> I guess something in nimgl is trying to use that function?
10:36:07FromDiscord<Recruit_main707> i get weird errors because something is fucked up in mu computer apparently
10:36:16FromDiscord<dom96> you could probably get away with avoiding it if possible
10:36:23FromDiscord<dom96> unless it's necessary and the new glfw has an alternative
10:36:24FromDiscord<tomck> no i'm trying to use that function
10:36:35FromDiscord<dom96> tbh it's pretty weird that a newer version would just remove a function like that
10:36:35FromDiscord<tomck> i think nimgl is out of date
10:36:41FromDiscord<Recruit_main707> a bit, yeah
10:36:55FromDiscord<Recruit_main707> i told you it uses an specific glfw version
10:37:13FromDiscord<dom96> does every glfw version break everything? lol
10:37:23FromDiscord<tomck> so you're saying the newer glfw DLL i have removes the rawmousesupport function?
10:37:33FromDiscord<tomck> i'm 99% sure that's not the case
10:38:02FromDiscord<dom96> Yeah, actually that error may be misleading
10:38:05FromDiscord<Recruit_main707> no, but either it is renamed, or the parameters change or something esle
10:38:26FromDiscord<dom96> Nim might just be failing to load the DLL and that is the first function it happens to try loading
10:38:38FromDiscord<dom96> Are you sure the DLL you have matches the arch of your exe?
10:38:41FromDiscord<dom96> i.e. both 64bit?
10:38:48FromDiscord<tomck> no, the program loads when i remove that function
10:38:48FromDiscord<Recruit_main707> try the nimterop wrapper, it will even install the latest glfw version for you
10:38:55FromDiscord<tomck> yeah i just compiled it
10:39:18FromDiscord<tomck> Can i make the nimterop version use a specific glfw? I have a forked version
10:39:31FromDiscord<Recruit_main707> maybe
10:40:19FromDiscord<dom96> @tomck are you using other functions from glfw in your program though?
10:40:26FromDiscord<dom96> if not then the DLL won't even get loaded
10:40:37FromDiscord<Recruit_main707> i dont know how, you will have to mess with the source code of the wrapper
10:40:39FromDiscord<dom96> so certainly it'll load
10:41:40FromDiscord<tomck> Yes, i'm using a bunch of glfw stuff
10:42:22FromDiscord<tomck> when i comment out thecall to the rawmousesupported stuff, it loads, BUT the constant 'GLFW_RAW_MOUSE_MOTION' is an incorrect value [since glfw errors at runtime & whines about the value]
10:42:35FromDiscord<tomck> so i'm guessing the glfw header changed? not sure why that causes the function to fail to import
10:42:52FromDiscord<tomck> As in, i'm guessing the RAW_MOUSE_MOTION constant value changed in the header
10:43:01FromDiscord<tomck> All this stuff WAS working before i swapped out the DLL
10:43:12FromDiscord<Recruit_main707> @tomck do you have a released dll in your glfw fork?
10:43:19FromDiscord<tomck> a released dll?
10:43:54FromDiscord<tomck> what like an officially built one? No i'm building it, i didn't even realise they distributed prebuilt binaries
10:44:57FromDiscord<Recruit_main707> if you want to use your fork, you will have to change this urls:โ†ตtry changing this url to yours, but
10:45:08FromDiscord<Recruit_main707> thats not the right paste :P
10:45:12FromDiscord<Recruit_main707> https://github.com/jyapayne/nim-glfw/blob/master/src/glfw/glfw.nim#L30-L45
10:46:18FromDiscord<tomck> oh so i'll need to fork the nimterop stuff too?
10:46:27FromDiscord<tomck> then point that to my custom glfw version
10:46:39FromDiscord<Recruit_main707> nononono
10:46:49FromDiscord<Recruit_main707> change it locally
10:47:00FromDiscord<Recruit_main707> in your .nimble directory
10:47:04FromDiscord<tomck> what in the cached packages? or clone it?
10:47:12FromDiscord<Recruit_main707> i mean, you can fork it if you want to
10:47:13FromDiscord<dom96> pretty sure that shouldn't be necessary
10:47:18FromDiscord<tomck> right okay
10:47:30FromDiscord<dom96> nimterop will load the DLL too, no?
10:48:02FromDiscord<dom96> or does your glfw fork have some changes to the header files? (If so, why would you need that?)
10:48:53FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BWj
10:49:18FromDiscord<tomck> No i just have a new DLL build @dom96
10:49:19FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BWk
10:49:44FromDiscord<dom96> @enthus1ast Does SOCKS_VERSION(bt) not work?
10:49:55FromDiscord<enthus1ast> lemme try @dom96
10:50:24*solitudesf- joined #nim
10:50:34*tane quit (Ping timeout: 260 seconds)
10:50:53*solitudesf quit (Read error: Connection reset by peer)
10:51:36FromDiscord<enthus1ast> yes that errors out on invalid value
10:51:45FromDiscord<enthus1ast> thank you @dom96
10:59:24*solitudesf joined #nim
10:59:25*solitudesf- quit (Ping timeout: 260 seconds)
11:10:01*h14u joined #nim
11:23:47FromDiscord<tomck> My GLFW is in /usr/local/XXX rather than /usr/XXX, I'm trying to use the -d:glfwStd define with nimterop to make it fetch my local copy of glfw, but it's still downloading from git every time - do i need to install glfw into usr/XX rather than usr/local/XXX?
11:33:14*Jesin quit (Ping timeout: 260 seconds)
11:39:32*shad0w_ joined #nim
11:40:01*NimBot joined #nim
11:42:31*krux02 joined #nim
11:56:11FromDiscord<tomck> aaargh i don't understand, can i not just point a nimterop wrapper to a dll to use??
11:57:07FromDiscord<tomck> Even after using a custom nim-glfw nimterop where i remove the glfw3Git define in setDefines, then use -d:glfw3Std, it seems to complain about no build files being found in ~/.cache/nim/nimterop/...
12:01:00FromDiscord<lqdev> just opened my first ever RFC, thoughts? https://github.com/nim-lang/RFCs/issues/277
12:01:03disbotโžฅ Extend call-with-block syntax to allow for passing more than one argument to procedures ; snippet at 12https://play.nim-lang.org/#ix=2BWr
12:05:53*opposite228 joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:46*supakeen joined #nim
12:07:01opposite228hi
12:07:30opposite228HI
12:07:45opposite228!!!!
12:07:57FromDiscord<Yardanico> hello
12:08:04opposite228hi
12:09:56opposite228who am i
12:10:39opposite228??
12:10:53mipriyou're either 822 or -228, depending on what you mean by 'opposite'
12:11:25YardanicoHe's at least a web chat user
12:11:37opposite228yes
12:11:37YardanicoWhich is already pretty rare and rings some bells ;)
12:12:14opposite228is there any good Windows irc clients?
12:12:42opposite228and how to connect to Nim's discord server
12:12:50Yardanicono, it's fine to use web chat, just ignore what I said
12:13:00Yardanicohttps://discord.gg/nim
12:13:05opposite228thx
12:13:29*opposite228 quit (Quit: opposite228)
12:13:42FromDiscord<ITR> so far my only runtime bugs have been because i check one variable, but modify a different one than the one i checked
12:14:22FromDiscord<ITR> is there some kind of template i could use to stop me from doing that? i prefer static testing, lol
12:15:56FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BWx
12:15:58FromDiscord<haxscramper> Something like that might work
12:17:17FromDiscord<haxscramper> Well, actually it does copy, so you probably want to annotate things with `{.bycopy.}`
12:17:54*shad0w_ quit (Remote host closed the connection)
12:18:01FromDiscord<ITR> oo, there's a body parameter
12:18:13FromDiscord<Yardanico> It's not a special construct
12:18:21FromDiscord<Yardanico> You can name it anything else
12:18:56FromDiscord<Yardanico> @haxscramper it probably wouldn't make a copy with arc/orc because of cursor inference
12:19:04FromDiscord<Yardanico> and maybe you can use view types on 1.4 too
12:20:47FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2BWA
12:21:28FromDiscord<Yardanico> Yeah byaddr is good too
12:21:43FromDiscord<Yardanico> Why a macro though?
12:21:46FromDiscord<haxscramper> Yeah, maybe that will work too, I just haven't touched view types except for single bug report with `Option[]`
12:22:24FromDiscord<haxscramper> @Yardanico There is some weird interaction with `byaddr` inside of template/`quote do` without interpolation that makes it "undeclared identifier"
12:22:49FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BWB
12:23:11FromDiscord<haxscramper> Probably because of identifier mangling or something like that, I'm not sure if this is a bug
12:23:23FromDiscord<alehander42> how
12:23:25FromDiscord<alehander42> are you guyss
12:23:32FromDiscord<alehander42> blessed day!
12:24:10FromDiscord<alehander42> today i have to work a bit on non nil
12:24:16FromDiscord<haxscramper> @Yardanico And I just wanted to ask - do you think view types are stable enough so that I used pattern them in pattern matching? To completely avoid copies (or at least reduce to necessary minimum)?
12:24:32FromDiscord<haxscramper> When I tried I stubmled upon bug with `Option[lent int]` & codegen
12:24:33FromDiscord<alehander42> sounds as a good idea!
12:24:35FromDiscord<Yardanico> I'm not sure, I haven't had enough experience with them either :)
12:25:39miprialt: https://play.nim-lang.org/#ix=2BWD
12:26:31FromDiscord<haxscramper> Alright, I made a PR with whatever garbage I wrote - https://github.com/nim-lang/fusion/pull/33 . @alehander42 I added test suite from gara to pattern matching, I hope this is okay? Just some syntax modifications, but otherwise most of your tests passed with minor changes
12:26:32disbotโžฅ Pattern matching implementation
12:26:42FromDiscord<alehander42> no problme
12:26:46FromDiscord<alehander42> coool
12:28:56FromDiscord<alehander42> i lik `:=` ๐Ÿ™‚
12:33:58federico3aargh
12:34:41FromDiscord<Yardanico> rghaa?
12:34:44federico3nim doc is trying to do network traffic due to a runnable example inlib/pure/httpclient.nim
12:35:31federico3having this kind of side effects while generating docs is quite bad
12:40:57FromDiscord<haxscramper> Now, just general question on life, universe and everyting: any recommendations of debugging codegen errors? matching test suite passes for nim 1.2.0+ but fails with 1.0.0 on C compilation
12:43:06FromDiscord<tomck> printf & prayers, same as all bugs
12:46:14FromDiscord<alehander42> @haxscramper hmm
12:46:20FromDiscord<alehander42> btw there was
12:46:26FromDiscord<alehander42> a nimscript debugger attmept
12:46:27FromDiscord<alehander42> i started
12:46:32FromDiscord<alehander42> i have it in some branch
12:46:37FromDiscord<alehander42> very basic
12:46:53FromDiscord<alehander42> but print and debugging should also work
12:47:02FromDiscord<alehander42> prayers are generally useful in life โค๏ธ
13:08:13*tane joined #nim
13:11:22FromDiscord<LordPoseidon> They aren't but atleast they'll help your conscience
13:13:42FromDiscord<Rika> theyre useful to certain people
13:14:39FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BWP
13:14:50FromDiscord<Yardanico> no, macros can't change Nim syntax
13:15:00FromDiscord<Rika> not unless you wrap it in a macro
13:15:03FromDiscord<Yardanico> although people can misunderstand this statement
13:15:10FromDiscord<Rika> that doesnt seem to change anything about nims syntax i dont think
13:15:18FromDiscord<Yardanico> it does
13:15:18FromDiscord<Rika> but you have to wrap it in a macro call
13:15:41FromDiscord<Yardanico> well I mean if you wanted it to correctly parse, you would have to modify Nim syntax
13:15:54FromDiscord<Yardanico> But I'm not sure exactly
13:16:11FromDiscord<haxscramper> Well, I think you can /technically/ write this as a macro, but it will be just unholy mess of term rewriting crap piled on top of each other
13:16:24FromDiscord<ITR> so not worth it then, lol
13:16:45FromDiscord<Rika> you're gonna spend more time on the macro than needed
13:19:29FromDiscord<ITR> I assume it's gonna be slower compile time too
13:19:43FromDiscord<ITR> spending longer on the macro doesn't really matter if I can save hours of debugging with it, lol
13:20:28FromDiscord<alehander42> @LordPoseidon welcome to the channel! if prayers don't get anywhere, conscience wouldn't really matter
13:20:37FromDiscord<alehander42> yeah
13:20:52FromDiscord<alehander42> reader macros are not really idiomatic
13:20:55FromDiscord<alehander42> i think
13:24:08FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BWT
13:24:22FromDiscord<ITR> IMO at least
13:24:23FromDiscord<Rika> well you don tneed to do that
13:25:09FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2BWU
13:26:44FromDiscord<haxscramper> Another alternative to `{.byaddr.}` and view types is to rewrite body/expression and substitute all ocurrencies of `it` with variable name
13:26:54FromDiscord<19> hello, i get these [GcMem] warnings with --gc:none but it's hard to detect where in my code they are referring to: https://i.imgur.com/9oYqLls.png
13:27:07FromDiscord<ITR> oh, interesting, that works
13:27:16FromDiscord<Recruit_main707> whats because gc:none cant use most of the stdlib
13:27:24FromDiscord<ITR> nim never fails to surprise me with delightful features
13:28:43FromDiscord<ITR> hmm, if I use the macro twice in the same scope it complains about it being redefined
13:28:56FromDiscord<19> oh okay, imma stick to arc
13:29:21FromDiscord<19> just wanted to see exactly where it was to learn more
13:30:05FromDiscord<Recruit_main707> what are you trying to do?
13:30:46FromDiscord<Rika> the (ref exceptn)(msg: ...) stuff seems to be from `newException()` calls or so
13:30:59FromDiscord<19> nothing, just want to see where those points are to read the std lib and learn more how it works
13:32:09FromDiscord<Rika> maybe uise --exceptions:quirky or smth
13:32:53FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BWW
13:33:37FromDiscord<Rika> needs a separate macro call i assume
13:34:21FromDiscord<ITR> what do you mean?
13:36:58FromDiscord<LordPoseidon> @alehander42 thank you! I didn't get started quite yet with nim, but loving the concept. Will do soon
13:37:02*Jesin joined #nim
13:37:33mipriITR: https://play.nim-lang.org/#ix=2BX0
13:37:37FromDiscord<LordPoseidon> As for conscience mattering, nothing does.
13:38:23FromDiscord<alehander42> nothing does matter?
13:39:13FromDiscord<ITR> ahh, block there, thank you very much mipri ^^
13:40:07FromDiscord<LordPoseidon> Well, on the scale of the universe, does human life mean anything
13:41:21FromDiscord<LordPoseidon> I'm pretty nihilistic yeah
13:41:25FromDiscord<LordPoseidon> nvm me
13:41:38FromDiscord<alehander42> so Ecclesiastes
13:41:48FromDiscord<alehander42> nihilism is an interesting phase
13:42:10FromDiscord<alehander42> lacks a lot, tho
13:42:30FromDiscord<Rika> ~~nihilism isnt a phase just like christianity isnt~~
13:47:58FromDiscord<alehander42> apples and oranges
13:48:03miprihere you go, in Nim: https://play.nim-lang.org/#ix=2BX3
13:48:57FromDiscord<Yardanico> You can just write x isnot x
13:49:04FromDiscord<alehander42> the Bible literally has nihilistic literature inside
13:49:37mipriYardanico: Meaning: type expected, but got symbol 'x' of kind 'Var'
13:49:45FromDiscord<Yardanico> I know
13:49:53FromDiscord<Yardanico> but no need for typeog
13:49:55FromDiscord<Yardanico> typeof
13:50:12mipriwith typeof, I get a concept fail error instead of an unrelated error
13:51:28FromDiscord<Rika> > the Bible literally has nihilistic literature insideโ†ตi know, i wasnt serious about my statement
13:51:40FromDiscord<Rika> i tend to cross out stuff im not serious about
13:53:43FromDiscord<alehander42> ๐Ÿ™‚
13:53:47FromDiscord<alehander42> i plan on streaming a bit
13:55:58FromDiscord<ITR> ah, if I use byaddr I can't use it on immutable values, hmm
13:56:18mipriwhen are you going to .inc one of those though?
13:57:46FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BX5
13:58:10FromDiscord<ITR> but accidentally use the wrong variable instead of pos
13:58:52FromDiscord<ITR> I guess I could have two different macros for when the argument I don't want to be wrong is supposed to be mutated or not
14:00:10FromDiscord<LordPoseidon> Ehh
14:00:26FromDiscord<LordPoseidon> I'm not even sure what's a phase and what's not anymore
14:01:28FromDiscord<LordPoseidon> @alehander42 doubt
14:01:53FromDiscord<Rika> lets move that discussion to #offtopic
14:01:56FromDiscord<LordPoseidon> It's the book literally claiming the universe has been created for man
14:01:58FromDiscord<LordPoseidon> Thanks
14:02:03FromDiscord<LordPoseidon> Was about to suggest that
14:03:00FromDiscord<haxscramper> @ITR you can try to use `typed` argument for macro, then `getType` on it to maybe determine whether or not variable is mutable, or wrap everything in `when compiles(myVar = myVar)` (can only assign to mutable variables) etc.
14:03:29FromDiscord<haxscramper> Or have to different macros - one for mutable and other for immutable
14:03:42FromDiscord<alehander42> read Ecclesiastes and some other : it's a collction of at least 66 books, mate, so don't oversimpify it
14:04:55FromDiscord<alehander42> (continued)
14:06:43FromDiscord<ITR> when compiles works perfectly, now to finally use this macro x D
14:06:51FromDiscord<ITR> thanks for all the help everyone ^^
14:29:45FromDiscord<Chaz Ashley> sent a code paste, see https://play.nim-lang.org/#ix=2BXd
14:36:28ForumUpdaterBotNew thread by Ggibson: ListFiles() at compile time?, see https://forum.nim-lang.org/t/6984
14:38:33FromDiscord<enthus1ast> @Chaz Ashley can you also try with `--danger`
14:38:38FromDiscord<Rika> d:danger
14:38:51FromDiscord<enthus1ast> (edit) "`--danger`" => "`-d:danger`"
14:39:03FromDiscord<Rika> i assume its just JITs being good at this kinda stuff again though
14:39:15FromDiscord<Rika> (thouugh i dont have much experience on this kinda stuff so eh)\
14:39:28FromDiscord<Chaz Ashley> with danger it took 25 seconds
14:39:54FromDiscord<enthus1ast> are both outputs correct?
14:40:12FromDiscord<Chaz Ashley> yep, the number of items is the same
14:41:03FromDiscord<Rika> if we're gonna be kinda pedantic use `import std/monotimes`, keep `import times`, and replace `now()` with `getMonoTime()`
14:41:36FromDiscord<Chaz Ashley> oh come on, it can't add so many seconds
14:41:49FromDiscord<enthus1ast> yeah now() is not in hot loop
14:41:58FromDiscord<Rika> did yall not read the start of the sentence
14:42:00FromDiscord<Rika> sm
14:42:01FromDiscord<Rika> h'
14:42:06FromDiscord<Chaz Ashley> it's probably because of the sequence thing
14:42:16FromDiscord<Chaz Ashley> my eng is just bad sry lol @Rika
14:43:14FromDiscord<Rika> `var simples = newSeqOfCap[int](upperlimit div 2); simples.add(2)` then
14:44:36FromDiscord<Chaz Ashley> same ~25sec
14:45:23FromDiscord<Rika> then analyze the binary with amd's uprof or intel's v something i dont remember
14:45:38FromDiscord<Rika> see what actually is bottlenecking you or so
14:45:50FromDiscord<Chaz Ashley> maybe one day ๐Ÿ‘Œ
14:49:45FromDiscord<alehander42> can you paste the js one
14:50:02FromDiscord<alehander42> otherwise, it's hard to compare ๐Ÿ™‚
14:51:04FromDiscord<enthus1ast> int32
14:51:08FromDiscord<enthus1ast> gave me 6 seconds
14:51:12FromDiscord<enthus1ast> from 25 seconds
14:51:36FromDiscord<alehander42> huh
14:51:47FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BXk
14:51:50FromDiscord<Rika> did not change much for me
14:52:36FromDiscord<alehander42> wait, you have a newSeq with initial capacity as well
14:52:42FromDiscord<alehander42> but also cant be that much
14:52:55FromDiscord<alehander42> but @Chaz Ashley node code
14:53:01FromDiscord<alehander42> is what is need to find out any differencees
14:53:03FromDiscord<alehander42> (edit) "differencees" => "differences"
14:53:11FromDiscord<alehander42> (edit) "is what is need to find out any differences ... " added "(javascript code) ๐Ÿ˜„"
14:55:04FromDiscord<enthus1ast> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2BXn
14:55:47FromDiscord<enthus1ast> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2BXo
14:56:58FromDiscord<Rika> uprof is pointing me to the `if (i mod simples[j]) == 0:` line being a hot spot
14:57:10FromDiscord<Rika> makes sense, this is in the double loop
14:59:10*arecacea1 quit (Remote host closed the connection)
15:00:25FromDiscord<Rika> though its probably a different story on your machine
15:00:53*arecacea1 joined #nim
15:12:46FromDiscord<Chaz Ashley> sent a code paste, see https://play.nim-lang.org/#ix=2BXs
15:15:45*npgm_ quit (Ping timeout: 240 seconds)
15:16:12FromDiscord<Chaz Ashley> it's 7sec for me, still twice as fast, but how does it work? doesn't int32 just mean that each number takes up less space?
15:16:24FromDiscord<Chaz Ashley> @enthus1ast
15:16:39*d10n-work quit (Read error: Connection reset by peer)
15:17:09*npgm_ joined #nim
15:17:15*d10n-work joined #nim
15:17:41FromDiscord<Chaz Ashley> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2BXv
15:18:09FromDiscord<Rika> yes and potentially is faster if you're on 32 bit but i believe there is no benefit for 64 bit machines
15:18:43FromDiscord<Chaz Ashley> i'm on 64 bit machine
15:18:51FromDiscord<Rika> node takes the same amount of time (roughly, +-200 ms) as nim for me
15:18:53FromDiscord<Rika> 10 seconds each
15:19:06FromDiscord<Chaz Ashley> sent a code paste, see https://play.nim-lang.org/#ix=2BXx
15:20:59FromDiscord<Rika> yeah i dont know how you're getting so much slower on your laptop
15:23:46FromDiscord<alehander42> huh for me
15:23:50FromDiscord<alehander42> the node version is slower
15:24:28FromDiscord<alehander42> it's like 19 seconds
15:25:27FromDiscord<Rika> basically: consistency is hard
15:26:53FromDiscord<alehander42> to 14-17 secs
15:26:54FromDiscord<alehander42> for nim
15:28:07FromGitter<timotheecour> ok to merge https://github.com/nim-lang/Nim/pull/15718 to unbreak CI ?
15:28:08disbotโžฅ workaround #15713 disable freebsd tssl.nim
15:28:59FromDiscord<alehander42> ~12 secs with danger
15:29:00disbotno footnotes for `12`. ๐Ÿ™
15:29:07FromDiscord<alehander42> i think
15:29:16FromDiscord<alehander42> jit-ing such code is not hard
15:29:23FromDiscord<alehander42> so probably v8 does it very well
15:29:27FromDiscord<alehander42> (if node uses v8)
15:29:34FromDiscord<Chaz Ashley> it does
15:29:35FromDiscord<alehander42> and in those cases the algo is what matters
15:29:48FromDiscord<alehander42> and nim with danger/release seems a bit faster
15:29:52FromDiscord<alehander42> which is probably expected
15:31:33FromDiscord<alehander42> but indeed int64 version is dramatically slower
15:31:39FromDiscord<alehander42> so int32 vs int64 matters
15:34:09FromDiscord<Rika> for me neither was significantly slower or faster
15:42:07disrupteklqdev: maybe the style guide needs to be updated.
15:42:43disruptekZevv: i don't want to talk about poontang right now.
15:44:10FromDiscord<Chaz Ashley> do you have a 32bit machine? @Rika
15:45:26FromDiscord<Rika> no
15:45:35FromDiscord<Chaz Ashley> ok, ty for the info
15:58:52FromDiscord<enthus1ast> i can only guess @Chaz Ashley but it could be that the cpu can vectorize 2x32 bit values (or even more depending on the instruction set) into their register and do more operations per cylce
16:00:15FromDiscord<enthus1ast> or its something else completely ๐Ÿ™‚
16:00:16*guelosk[m] quit (Quit: Idle for 30+ days)
16:01:11*xet7 quit (Quit: Leaving)
16:01:15FromDiscord<enthus1ast> the best way to find out, i guess, is to profile the code and run gcc with the "optimization miss" logs enabled, to see where cache misses are etc..
16:01:57FromDiscord<Chaz Ashley> Ok, Iโ€™m gonna ask some guys who do asm and other low lvl stuff, Iโ€™ll let you know if they know the answer
16:03:24FromDiscord<enthus1ast> (i mean this and friends `gcc -O3 -fopt-info-missed=missed.all` )
16:06:35*hnOsmium0001 joined #nim
16:10:47*hecanjog quit (Quit: WeeChat 1.9.1)
16:35:01FromDiscord<Chaz Ashley> it seems to be connected to the cache of the processor, it can store more int32 than int64 or something like thisโ†ตso it means if we want to achieve the best results we should check for processor's cache, I think we have kinda similar CPUs while Rika has something else
16:39:33FromDiscord<Rika> i got a ryxen 7 2700x
16:39:37FromDiscord<Rika> ryzen
16:47:57FromDiscord<Chaz Ashley> sent a long message, see http://ix.io/2BXZ
16:50:28*natrys quit (Ping timeout: 246 seconds)
16:52:12*junland quit (Quit: %ZNC Disconnected%)
16:53:14*tefter quit (Quit: WeeChat 2.9)
16:54:22Zevvdisruptek: i dont know what that is
16:54:29Zevvand im too lazy to look it up
16:54:43disruptekaight.
16:55:00*junland joined #nim
16:55:32*lritter quit (Ping timeout: 260 seconds)
16:56:47*TomDotTom joined #nim
17:12:02FromGitter<deech> Is there a way to make a set of `proc`'s or `func`'s that cannot be overloaded? While overloading is useful it's sometimes nice to have globally unique implementations like Haskell typeclasses.
17:14:13FromDiscord<haxscramper> You mean globally unique by name? E.g. there can be only one `implementationProcForThisType` regardless of what signature it has?
17:17:46*natrys joined #nim
17:19:48FromGitter<deech> Right, for example, `matrix1.mul(matrix2)` has a unique `mul` so there you can't do `matrix1.mul(matrix2, 1, 2, "hello world")`, if you want a different semantics you have have `distinct` matrices and implement `mul` on those.
17:21:54FromDiscord<haxscramper> No, that is not possible to do AFAIK. You might try to get creative and just make overloads for all other functions, likeโ†ต`proc mul[T1, T2, T3](m: Matrix, t1: T1, t2: T2, t3: T3) = {.error: "Only one overload for mul can exist".}`
17:22:07FromDiscord<haxscramper> But that is just a hack
17:22:56FromDiscord<haxscramper> And repeat this for function with 2-20 parameters
17:24:49FromGitter<deech> Wonder if I could mask it off with `template mul(m1:Matrix,m2:Matrix,rest: varargs[untyped]): untyped = {.error "...".}`.
17:25:41FromDiscord<haxscramper> You can probably write macro for that
17:34:10FromDiscord<haxscramper> ~macro
17:34:10disbotno footnotes for `macro`. ๐Ÿ™
17:42:33*gmaggior joined #nim
17:45:13*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
17:45:31*bozaloshtsh joined #nim
17:45:31*bozaloshtsh quit (Changing host)
17:45:31*bozaloshtsh joined #nim
17:49:58*natrys quit (Ping timeout: 246 seconds)
17:51:00*TomDotTom quit (Ping timeout: 258 seconds)
17:52:49*xet7 joined #nim
18:01:01ZevvAbout this latest forum post
18:01:15leorize[m]1turns out you can use Nim to bootstrap Nim as long as you compile the entire thing to JS: https://github.com/alaviss/setup-nim/tree/ng
18:01:50leorize[m]1shashlick: ^
18:01:54Zevvwait what
18:02:09leorize[m]1so... should I rewrite the rest of my github actions to Nim?
18:04:10leorizeapparently nodejs can be treated like python nowadays
18:16:50*h14u quit (Quit: Leaving)
18:17:11*natrys joined #nim
18:21:55*waleee-cl joined #nim
18:22:52*nyaayaya joined #nim
18:25:24*abm joined #nim
18:34:39ForumUpdaterBotNew post on r/nim by skoink: How do I install the included nim tools from source?, see https://www.reddit.com/r/nim/comments/jhyey0/how_do_i_install_the_included_nim_tools_from/
18:40:36FromDiscord<shashlick> @leorize nice idea - where are you going to store the precompiled code
18:41:43leorize[m]1@shashlick it's in the 'dist' folder. Apparently that's standard practice so that you got all dependency inlined
18:41:53FromDiscord<shashlick> We could also consider shipping a distro that doesn't need to compile Nim at all - nodejs would be the only dep
18:42:42leorize[m]1if you wanna play with that just clone it, `npm install` and `npm run build`
18:46:43disruptekshh, we don't support nodejs.
18:48:02disruptekdeech: you could probably do it with term rewriting macros, but this is pretty gnarly.
18:55:07FromDiscord<shashlick> npm install nim will be fun
18:55:25FromDiscord<shashlick> Will it create binaries and call gcc as expected
19:00:02FromDiscord<Rika> cursed
19:12:24FromDiscord<neow> any update on the 48h nim jam?
19:14:00disruptekit's an idea i've been kicking around for months; you won't miss it when it goes off.
19:14:12FromDiscord<neow> oh okay thanks
19:14:44disruptekwe will probably need to do a fair amount of experimentation before we ask people to invest a couple days on it.
19:14:55supakeenwhat are you organising?
19:15:30disrupteki wanted to develop a jam format where we remotely coordinate rapid nim development of stuff.
19:15:48disruptekand lately i'm thinking about screen sharing, or really, terminal sharing.
19:15:56disruptekbut we stream the shared terminals.
19:16:22disruptekso it's, like, live pair programming with 4-6 people at a time.
19:16:34supakeenoh interesting idea sure
19:16:41supakeeni thought you were talking more along the lines of sprints :)
19:17:01disruptekwell, that might happen, too. we'll see how it works.
19:17:16supakeeni have some experience from volunteering at europython for the sprints parts
19:17:19supakeenthey're always fun :)
19:17:25supakeen(we did them online last edition as well)
19:17:35disrupteknice, you should be in charge.
19:17:40supakeenlolno
19:17:44disruptekwhy not?
19:18:02supakeenbecause i'm not much of an organiser but pretty good at doing what other people tell me so i usually just help :)
19:18:12disruptekmaybe you just need practice.
19:18:31disrupteki, for one, have no experience, so i'd just be asking you all the itme.
19:18:33disruptektime, too.
19:18:40supakeenheh i guess that's true too
19:18:53disruptekso what do we need to do first?
19:19:32supakeenif you are to do sprints you need a bunch of project maintainers who setup their projects for easy contribution (so some text on how to make a pr/etc and a bunch of tickets that can be done in < a few hours)
19:19:43supakeenthough the same applies if you want to sprint on nim itself :)
19:21:03supakeenyou provide some sort of video chatting/voice chatting thing (discord works fine, we used that as well) and if you wish you do like an introduction and a lunch/end-of-day recap with everyone there so everyone can present what they've done
19:21:29supakeeni know for me personally i like to go to the sprints after conferences because there's always some tickets i'm good at!
19:22:03supakeenlast europython i implemented map scrolling and collissions for a little game someone was making and i made configuration file logic for some api tester
19:24:02disruptekright, but think "pair programming".
19:24:12disruptekthat's the twist we want to play with.
19:24:24supakeenyea i think that's a cool idea too
19:31:49*Cthalupa quit (Ping timeout: 260 seconds)
19:32:31*Cthalupa joined #nim
19:35:50FromDiscord<krisppurg> what does `block:` do in Nim?
19:36:25FromDiscord<krisppurg> (edit) "do in Nim?" => "do?"
19:37:24FromDiscord<haxscramper> Creates new lexical scope. With `block someName:` you can also break iteration from particular block, like `break someName`
19:38:02FromDiscord<haxscramper> Can also be used to convert list of statements into expression
19:38:17FromDiscord<krisppurg> example?
19:38:36*Guest94576 joined #nim
19:38:42*Guest94576 quit (Read error: Connection reset by peer)
19:38:50FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BYY
19:39:05FromDiscord<krisppurg> ah
19:39:19FromDiscord<krisppurg> thank you.
19:45:20federico3"Warning: Package 'compiler' has an incorrect structure."
19:45:52federico3sigh, nimble complains even about the compiler
19:45:57Zevv"Do as I say, not as I do"
19:48:51disruptekthe compiler package should be removed, imo.
19:49:07federico3this is not a package but the compiler itself
19:49:19disrupteki know.
19:56:37*Vladar quit (Quit: Leaving)
19:58:48disruptek~disruptek is unsafe at any speed.
19:58:49disbotdisruptek: 11unsafe at any speed.
19:58:49disbotdisruptek: 11:disruptek:
19:58:49disbotdisruptek: 11an unsafe nil deref
20:01:38Avatarfighter[m]:disruptek: moment
20:07:25disruptekfinished the bot, fighter?
20:16:09*luis_ joined #nim
20:18:26*luis_ quit (Client Quit)
20:20:25FromDiscord<neow> perhaps a lot of new documentation could be added in those 2 days
20:21:00disrupteki dunno if anyone wants to watch 6 people write documentation, though.
20:21:41FromDiscord<neow> I see
20:22:57disruptekshashlick always has tickets ready for fixing. maybe he can recommend a list or even outline getting nimterop to wrap c++. that would be a huge feat.
20:24:00FromDiscord<haxscramper> The problem with documentation is that everyone says it is bad, but does not point things like "std/macros might need more documentation for mixin statement limitations" or the like
20:24:58FromDiscord<haxscramper> Because it is really easy to fix docs actually - this channel is basically 24/7 support for this - asking questions is just filling in lacking parts in documentation
20:25:02FromDiscord<haxscramper> Generally speaking
20:25:12mipriexcept that the answers don't get written down.
20:25:17disruptekscramper where are you located?
20:25:53disruptekthe answers are written down, but it needs to be easier to search the irc logs for questions.
20:25:54FromDiscord<Avatarfighter> disruptek: i am working on supporting half the fucking internet with this bot
20:26:00FromDiscord<haxscramper> chuckles im in danger
20:26:07disruptekyou said it would take a day, tops.
20:26:19FromDiscord<Avatarfighter> yes
20:26:23disruptekwell.
20:26:23FromDiscord<Avatarfighter> For 1 site
20:26:24*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
20:26:36disruptekonly 1 site matters for launch.
20:26:37FromDiscord<Avatarfighter> i am almost done which is nice
20:26:37FromDiscord<haxscramper> What bot are you talking about?
20:26:46disrupteksexbot.
20:26:51FromDiscord<Avatarfighter> Im making a bot to buy stuff for someone
20:26:54FromDiscord<Avatarfighter> yes
20:26:56FromDiscord<Avatarfighter> sexbot
20:27:10disruptekdisbot: want sex?
20:27:11disbotyep. ๐Ÿ˜Š
20:27:21disruptekaight, brb.
20:27:21FromDiscord<Avatarfighter> oh wow
20:27:33FromDiscord<haxscramper> ~macro is "Are you really sure you need this?"
20:27:34disbotmacro: 11"Are you really sure you need this?"
20:28:00FromDiscord<Avatarfighter> hate to say guys but my programming hoodie and socks are on, you all better watch out >:) https://media.discordapp.net/attachments/371759389889003532/770020858470596658/image0.jpg
20:28:42FromDiscord<Avatarfighter> wow i look ugly actually
20:29:03FromDiscord<ElegantBeef> Python hoodies make you look atleast 80% uglier, statistically proven
20:29:08FromDiscord<Avatarfighter> wow
20:29:15disrupteki see dead people.
20:29:33FromDiscord<Avatarfighter> as a certified Pythonista I take that as an attack to my religion @ElegantBeef
20:29:42*luis_ joined #nim
20:30:07FromDiscord<lqdev> sir this is the nim channel
20:30:16FromDiscord<Avatarfighter> lmao
20:30:19FromDiscord<lqdev> we throw python off the cliff here
20:30:38FromDiscord<ElegantBeef> I throw all dynamically typed langauges off the cliff regardless of where i am
20:32:18FromDiscord<Avatarfighter> When is the Nimion merch available on nim-lang.org ๐Ÿค”
20:33:22*hyiltiz quit (Quit: hyiltiz)
20:43:23*natrys quit (Quit: natrys)
20:43:26*ConfuzzledPython joined #nim
20:44:06ConfuzzledPythonAnyone know how to handle sockets in Nim? I'm coming from python and bashing my head into a wall a wee bit.
20:44:27supakeenThe BSD socket API is about the same between Python and Nim, which bits are confusing?
20:45:33ConfuzzledPython(Note I'm not super familiar with sockets in python either) I've got a socket address to connect to at wss://socket.polygon.io/stocks but when I pass that into the socket.connect funct I get an error.
20:45:56ConfuzzledPython"nodename nor servname provided, or not known" [OSError]
20:46:09*ehmry joined #nim
20:46:11disruptekcompile with ssl.
20:46:28ConfuzzledPythonIt is compiled with ssl.
20:46:57FromDiscord<Avatarfighter> are you passing the wss address to the connect proc?
20:47:21supakeenSpecifically, wss indicates that it's a websocket; these are not normal BSD sockets.
20:47:24disruptekyou're writing a ws driver?
20:47:35supakeenYou'd be looking for a way to use *web*sockets :)
20:47:48FromDiscord<Avatarfighter> if youโ€™re trying to do websocket stuff have you considered using a websocket library
20:47:51FromDiscord<Avatarfighter> !repo ws
20:47:52disbothttps://github.com/treeform/ws -- 9ws: 11Simple WebSocket library for nim. 15 110โญ 10๐Ÿด 7& 6 more...
20:48:02disruptek!repo goatlicker
20:48:03disbothttps://github.com/Goatlicker690/Goatlicker690.github.io -- 9Goatlicker690.github.io: 11 15 0โญ 0๐Ÿด & 1 more...
20:48:13ConfuzzledPythonOkay thank god.
20:48:15FromDiscord<Avatarfighter> ๐Ÿ˜
20:48:20ConfuzzledPythonI didn't realize there were libraries for it.
20:48:28Prestigegoatlicker.. lol
20:48:32ConfuzzledPythonI was looking at the stdlib and dying inside trying to figure it out lol.
20:48:38supakeenSure but also don't confuse *web*sockets with sockets (they're like java and javascript) :)
20:48:39FromDiscord<Avatarfighter> Ahaha
20:49:06FromDiscord<Avatarfighter> Welcome to nim ๐Ÿ˜œ ConfuzzledPython
20:49:16ConfuzzledPythonOkay for a relative programming newb, I know what websockets are kinda, but what are sockets?
20:49:25*hyiltiz joined #nim
20:49:25*hyiltiz quit (Client Quit)
20:49:31ConfuzzledPythonLol thank you, I enjoy it a lot better than Python, but still getting used to the landscape.
20:49:41*hyiltiz joined #nim
20:49:42*hyiltiz quit (Changing host)
20:49:42*hyiltiz joined #nim
20:49:42*hyiltiz quit (Client Quit)
20:50:36supakeen`sockets` usually refer to BSD sockets which is a sort of standardized API to do network communications.
20:50:50supakeenwebsockets are a higher protocol that is implemented over http which are implemented on top of sockets.
20:51:20supakeenYou tend to not want to muck with such low level primitives (same in Python tbh) because then you need to handle all the implementation tidbits yourself :)
20:51:41*bung joined #nim
20:52:50FromDiscord<dom96> It depends what your goals are
20:53:27supakeenIf your goal is to send data back and forth reliably it's not a good plan, if your goal is to learn how to write a reliable library for that then maybe.
20:53:37FromDiscord<dom96> If you want to learn and like learning the hard way, then trying to create an implementation from scratch is a great learning experience ๐Ÿ™‚
20:54:14supakeenBut networking is like crypto in a sense of 'I cant break it!' because something doesn't occur on your network!
20:54:52supakeenYou could likely write your entire library without ever running into a short send.
20:56:07FromDiscord<dom96> What's a short send?
20:56:21FromGitter<jrfondren> try to send 10 bytes, only send 8
20:56:47supakeenA common thing is for `send()` to not be able to copy all data into the sndbuf so it copies less bytes and you need to handle copying the rest.
20:56:57supakeenIf your network is all fast enough you ain't going to run into it (probably).
20:57:26supakeenMy most important argument is always that you're going to implement a protocol on top of your `sockets` *anyways* might as well work on that part :)
20:57:37*hyiltiz joined #nim
20:57:37*hyiltiz quit (Changing host)
20:57:37*hyiltiz joined #nim
20:57:43*arecacea1 quit (Remote host closed the connection)
20:57:59FromDiscord<dom96> I mean.. there are different levels here
20:58:16FromDiscord<dom96> You don't have to write a whole sockets library to get a good learning experience
20:58:19*luis_ quit (Quit: luis_)
20:58:40FromDiscord<dom96> Either your sockets block or the async library takes care of the sends for you
20:58:44supakeenSure but you also don't need to write a sockets library to learn a bit about sockets.
20:58:47*solitudesf quit (Ping timeout: 260 seconds)
20:59:07*hyiltiz quit (Client Quit)
20:59:17*hyiltiz joined #nim
20:59:17*hyiltiz quit (Changing host)
20:59:18*hyiltiz joined #nim
20:59:28*arecacea1 joined #nim
20:59:50*sschwarzer joined #nim
21:00:08supakeenHaving done loads of it I don't feel like I'm better at higher level networking because I think I understand BSD sockets at least!
21:00:56FromDiscord<Avatarfighter> ConfuzzledPython: I hope you got the answer you were looking for and are enjoying the history of sockets ๐Ÿ˜›
21:01:07supakeenSorry yea, tangent.
21:01:12FromDiscord<Avatarfighter> hahaa
21:01:29ConfuzzledPythonLol no I did enjoy that, now just trying to get ws to work for me. :
21:01:50sschwarzerHi, I have a problem with creating a (part of a) macro with `quote do:`. Some code is here: https://play.nim-lang.org/#ix=2BZk . I suspect I use the backticks wrong. In the proc definition I want to use the same names as in the tuple in the for loop (before the "in")
21:02:19sschwarzerI wonder how I need to write this instead.
21:03:13sschwarzerOf course, an alternative would be to create the `proc` tree as an AST (nested nodes), but I wonder if this can be done in a simpler way.
21:05:40sschwarzer(The actual body in the usage example shouldn't be relevant.)
21:10:30sschwarzerOuch, I think the macro actually works. The error was in the compilation of the return value of the macro (tree is undefined).
21:10:59sschwarzerLet me try the macro in some real code (unit tests) ...
21:11:38ConfuzzledPythonKind of annoying that I'm getting an error from the WS library while following the code.
21:11:52*kinkinkijkin quit (Ping timeout: 260 seconds)
21:12:33ConfuzzledPythonvar ws = await newWebSocket(url)echo await ws.receiveStrPacket()socket.close()
21:13:01ConfuzzledPythonThat code gets me an error for await being undeclared.
21:13:37supakeenConfuzzledPython: Make sure you `import asyncdispatch`
21:14:15sschwarzerYes, seems to work. Sorry for the confusion.
21:14:16ConfuzzledPythonYep I checked that.
21:14:26FromDiscord<dom96> your code needs to be in an async proc
21:16:02ConfuzzledPythonThank you.
21:17:11*ConfuzzledPython quit (Remote host closed the connection)
21:19:33FromDiscord<Gyllou> does anyone have any experience dealing with SVE2
21:29:58sschwarzerIs there a way to dump a tree (AST) if I already have a node object? (`dumpTree` prints the tree for a Nim code block, but I already have a node.)
21:30:40FromDiscord<haxscramper> `treeRepr()`, `lispRepr()` or `astGenRepr()`
21:31:20sschwarzerhaxscramper: thanks! :-)
21:34:06*tane quit (Quit: Leaving)
21:44:08*arecacea1 quit (Remote host closed the connection)
21:44:48*arecacea1 joined #nim
21:45:06*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
21:46:49*pbb joined #nim
21:47:03bunghttps://github.com/bung87/amysql/issues/8 anyone could give some clues?
21:47:04disbotโžฅ buffered connection
21:51:26sschwarzerI'm trying to do some error checking in the macro and want to print an {.error ... .} . Here's an example, https://play.nim-lang.org/#ix=2BZL . However, although I can evaluate the tuple length in line 21 and 24, I get a compiler error in line 28: "Error: cannot evaluate at compile time: varTupleLen" .
21:51:53*liblq-dev joined #nim
21:52:07*liblq-dev quit (Client Quit)
21:52:38*liblq-dev joined #nim
21:53:08*liblq-dev quit (Client Quit)
21:53:46FromDiscord<lqdev> just use `error("message")` or `error("message", node)`
21:54:41bungyou should turn your if branch to generated code, .len is computed on runtime right ?
21:56:15bungin your macro you can get nimnode length but not tuple's length
21:57:07sschwarzerbung: My understanding is that the `len` in the macro is computed at compile time. The `echo` after `let varTupleLen = varTuple.len()` works and is executed for every place where the macro is used.
21:58:08sschwarzerbung: Getting the Nim node length is almost as good. It's only different by one and _if_ I can subtract one, I'd have the tuple length.
21:59:15bungget nim node length then you code will work as you expected
21:59:56sschwarzerlqdev: That's odd, when I use {.error: "invalid tuple length ", varTuple .} , it only prints the string "invalid tuple length", but nothing about the node.
22:00:51sschwarzerbung: But isn't that what I'm doing in line 21 ? (For clarification, varTuple is the node for the tuple.)
22:02:29bungdont know if the tuple's length match the tuple's node length
22:02:31*vicfred joined #nim
22:02:34sschwarzerAnyway, I wonder how to go about error checking in macros. For example, if I write `for (node, level, order, nonsense) in processXml(tree)` instead of `for (node, level, order) in processXml(tree)`, the code still compiles; it just ignores the extra tuple item (which is no surprise from the current macro implementation)
22:03:26sschwarzerbung: The node has a length 4, the tuple in the code (where the macro is used) has length 3. There's an extra node `Empty` in the tuple node.
22:03:39*vicfred quit (Max SendQ exceeded)
22:03:55sschwarzerWith tuple length in the code I mean the `for (node, level, order) ...`
22:03:59bungdefine the tuple as a cutstom type would be simpler I guess
22:04:17FromDiscord<lqdev> sschwarzer: `error("invalid tuple length: " & varTuple.repr, varTuple)`
22:04:19FromDiscord<lqdev> or somethin
22:04:26*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:05:17sschwarzerbung: may be a good idea. That would prevent mistakes because the user gets the order in the tuple wrong.
22:05:34*pbb joined #nim
22:06:27sschwarzerbung: may be a good idea. That would prevent mistakes because the user gets the order in the tuple wrong.
22:06:32sschwarzeroops
22:07:55sschwarzerlqdev: "Error: string literal expected
22:07:57sschwarzer"
22:08:01sschwarzer*sigh* ;-)
22:09:54sschwarzerlqdev: it seems {.error: ... .} accepts only string constants
22:10:31sschwarzerThat would explain the error message I got before even though I could calculate the node length during compilation
22:14:14sschwarzerI think there's some confusing between "compile time" as in "during macro expansion" and some other concept of "compile time". :-D I'm not sure.
22:15:19sschwarzerI saw that I _can_ use {.error: "foo " & $3 .} , so it seems {.error.} works with a constant expression.
22:16:04sschwarzerHowever, the tuple length is potentially different for every macro expansion.
22:17:01sschwarzerAlthough the macro expansion happens at compile time, that's not what {.error.} wants. ;-)
22:17:38sschwarzer{.error.} wants something that could be a `const` (my interpretation at least)
22:18:45Prestigetut2 says --multimethods:on is required for compilation when using them, but I've been compiling without that and it's been working. Is this expected?
22:19:12FromDiscord<shashlick> @disruptek I've tabled c++ support since @haxscramper has been working on his clang based stuff
22:19:42sschwarzerbung: I'm actually a bit torn about the macro usage here. On the one hand, it's super nice that it looks like a regular iteration. On the other hand, it does something completely different behind the scenes, which makes me slightly uneasy.
22:21:45sschwarzerbung: Regarding that, I also wonder if using the object will make the macro much more complicated, but I'll think about it and make experiments.
22:22:30sschwarzerIt's now too late for me to think about this. :)
22:22:49sschwarzerThanks for your help anyway, and lqdev, too.
22:23:03FromDiscord<alehander42> disruptek sharing sounds good
22:24:58*sschwarzer quit (Quit: leaving)
22:28:41*hyiltiz quit (Ping timeout: 260 seconds)
22:30:37disrupteksharon's alright, but her sister susan is incredible.
22:33:02*xet7 quit (Quit: Leaving)
22:37:03*xet7 joined #nim
22:57:00*hyiltiz joined #nim
22:57:00*hyiltiz quit (Changing host)
22:57:00*hyiltiz joined #nim
23:10:45*hyiltiz quit (Ping timeout: 240 seconds)
23:12:44*hyiltiz joined #nim
23:12:44*hyiltiz quit (Changing host)
23:12:44*hyiltiz joined #nim
23:30:27*gmaggior quit (Quit: Leaving)
23:40:25FromGitter<timotheecour> any objection to me merging https://github.com/nim-lang/Nim/pull/15718 to unbreak nim CI ?
23:40:26disbotโžฅ workaround #15713 disable freebsd tssl.nim