<< 20-05-2020 >>

00:14:49zacharycarter@mratsim: hmmm... I don't remember this haha
00:15:01zacharycarterbut that's a very cool example
00:20:57*clemens3 quit (Ping timeout: 265 seconds)
00:23:41*clemens3 joined #nim
00:29:41FromDiscord<Zed> a path tracer from what i recall is the same as a ray tracer except it has a bounce limit, whereas a ray tracer will keep bouncing rays until it reaches the light source or something
00:30:56zacharycarteroh I just meant I don't remember sharing one with him
00:31:37FromDiscord<Zed> well it was a couple of weeks ago 😛
00:31:52zacharycarterthis is true
00:32:05FromDiscord<Zed> @mratsim You have some amazing stuff on your github!
00:36:03*Senny joined #nim
00:49:24*marquisdefalbala joined #nim
00:56:15*Tlanger joined #nim
00:58:31*Tongir quit (Ping timeout: 246 seconds)
01:01:40*dddddd quit (Ping timeout: 246 seconds)
01:08:19*lritter quit (Ping timeout: 246 seconds)
01:09:10*lritter joined #nim
01:10:13*Senny quit (Quit: WeeChat 2.8)
01:12:22*Senketsu joined #nim
01:12:33skrylar[m]tested replacing cbor for ebml in my little derpy game engine. something interesting i noticed is that there's a lot less code for that
01:13:07skrylar[m]probably because of all the missing type checking rofl
01:15:31*krux02_ quit (Remote host closed the connection)
01:15:48skrylar[m]in cbor there's some type testing flags (it has rich typing) for booleans/integers of various sizes and whatnot, then multiple segments of reading (the size of len field is part of the header).. in ebml they just sort of steal a couple bits off the int for the field size, and i slapped the zigzag encoder from protobuf in there just to see
01:26:18*chemist69_ joined #nim
01:29:37*chemist69 quit (Ping timeout: 264 seconds)
01:33:42*Satomi-Kowa quit (Quit: Connection closed)
01:56:26*minnr joined #nim
01:58:04minnrProbably an obvious answer, but is there a simple way to have a for loop without an identifier? I just want to do something 50 times but I don't need access to the counter value...
01:58:36Yardanicominnr: use "_"
01:58:40Yardanicofor _ in 0 .. 50:
01:58:48zedeusthats 51 times :)
01:58:53Yardanicoi know :P
01:59:16FromDiscord<Elegant Beef> eh that's within a reasonable error margin, good enough for space
01:59:29minnrAh, when I did that VSCode said "_" was of type int so I assumed it was using it as a unicode char. Thanks!
01:59:32FromDiscord<Elegant Beef> 50 +- 2%
01:59:50zedeusI've mostly narrowed down the async issue now, it crashes when receiving the html from a local server
01:59:55Yardanicook I'm done with making a graph for all nimble pkgs btw
02:00:00Yardanicocurrently playing with dot for nice output
02:00:04zedeussick
02:00:36Yardanicojust for a teaser: https://i.imgur.com/EYSU9pq.png
02:01:00FromDiscord<Elegant Beef> So this is dependancy hell
02:01:01zedeusbeautiful
02:02:07Yardanicogood news - there's quite a lot of nimble packages which don't depend on other packages
02:02:50Yardanico~878 packages
02:02:54Yardanicoyes, that many
02:03:04Yardanicoout of ~1.27k
02:03:48FromDiscord<Elegant Beef> damn ~ 66% that's pretty good
02:03:48YardanicoI also thought about making a special node "<nothing>"
02:03:49yumaikascligen tho
02:03:51Yardanicoto show all packages without deps
02:04:00*minnr quit (Quit: Leaving)
02:05:56Yardanicooops
02:06:02Yardanicodot: maze.c:313: chkSgraph: Assertion `np->cells[1]' failed.
02:06:06Yardanicocrashed graphviz
02:06:17FromDiscord<Elegant Beef> Clearly it should be "Strong independant module"
02:06:32YardanicoI really like to look at these
02:07:13Yardanicohttps://i.imgur.com/flv4usT.png like their own smol worlds :P
02:10:02Yardanicothis is the tree of all packages which depend on others (and these other packages themselves of course), so no packages which don't have any dependencies and no package depends on them https://i.imgur.com/RqFHawk.png
02:10:49Yardanicoquite a lot of pkgs depend on zip btw
02:11:52Yardanicothis is how it looks if I have the nothing node
02:11:54Yardanicohttps://i.imgur.com/WCAyX7P.png
02:12:55zedeuswhats in the middle
02:12:59Yardanico<nothing>
02:13:10zedeusoh
02:13:17zedeusnice, actually
02:13:19Yardanicook did it without that nothing node but still keeping the packages
02:13:34Yardanicohttps://i.imgur.com/oVN375w.png
02:13:37Yardanicolike an ocean of packages
02:13:40Yardanicowith some island in the middle :D
02:13:59FromDiscord<Elegant Beef> Who needs a island generator when you have that
02:14:05Yardanicoyeah ikr
02:14:19Yardanicoit only took me a few hours and 2.7gb of cloned repos (yes I cloned repos of ALL packages in nimble)
02:14:27FromDiscord<Elegant Beef> Damn
02:14:34YardanicoI did it with --depth=1 tho
02:14:41Yardanicoso it's just a few repos which are fat
02:14:44Yardanicoidk which ones yet
02:20:51Yardanicoso ok I made a png file
02:21:01Yardanico5kx5k pixels
02:21:17FromDiscord<Elegant Beef> Make it a SVG instead dumb dumb 😛
02:21:23YardanicoI can
02:21:24Yardanicoeasily
02:21:29Yardanicobut you won't be able to view it easily
02:21:34Yardanicoat least not in the browser
02:21:58FromDiscord<Elegant Beef> Wikipedia says "Try me bitch"↵https://upload.wikimedia.org/wikipedia/commons/1/1b/Linux_Distribution_Timeline.svg
02:22:32Yardanicohttps://raw.githubusercontent.com/gist/Yardanico/4d25f7395af01b06cf9035c8024f02c6/raw/192dca7c9cb2747e5ab2030baab08a59748434f3/graph.svg
02:23:19Yardanicoalso btw
02:23:24Yardanicoall names are minimized and _ is removed
02:23:28Yardanicobecause nimble does that too btw
02:23:32shashlickNice to see nimterop getting some dependents
02:23:45Yardaniconimgen has more :D
02:23:52Yardanicobecause all treesitter pkgs depend on it
02:24:09FromDiscord<Elegant Beef> This now needs colour
02:24:30shashlickHehe I think most are because of me
02:24:58shashlickI should convert tree sitter to nimterop as well
02:30:20*sz0 quit (Quit: Connection closed for inactivity)
02:32:56*NimBot joined #nim
02:34:34*waleee-cl quit (Quit: Connection closed for inactivity)
02:37:08*madpata joined #nim
02:38:23*muffindrake quit (Ping timeout: 265 seconds)
02:40:22*madpata_ quit (Ping timeout: 246 seconds)
02:40:32*muffindrake joined #nim
02:45:20Yardanicobtw, don't forget to vote on https://github.com/github/linguist/pull/4866 if you agree with changes :P
02:45:33Yardanico(you can do a thumbs down if you don't agree too)
02:49:10*dadada quit (Ping timeout: 256 seconds)
02:54:28*B4s1l3 is now known as opDispatch
02:54:45Yardanicobtw I parsed all requires from .nimble (both nims and ini style) and .babel files with npeg
02:54:51Yardanicorequires <- i"requires" * *nl * ?':' * *nl * ?'(' * *(entry * ?',' * *nl) * ?')' * *nl
02:55:28Yardanicoentry <- '"' * >*(Print - '"') * '"'
02:58:48*JustASlacker quit (Ping timeout: 256 seconds)
03:02:53*ftsf joined #nim
03:09:59*sasamba joined #nim
03:10:18sasambaHi! How can i make parallel async HTTP requests, wait for all to complete and gather responses?
03:10:56FromDiscord<Rika> asyncdispatch and httpclient's asynchttpclient?
03:11:15zedeusyou can do `var futs: Future[Request]` then add the futures returned by asynchttpclient.get, and `await all(futs)`
03:11:29zedeuser I meant `seq[Future[Request]]`
03:18:31FromDiscord<Elegant Beef> Rika is my readme any better? 😄
03:18:32FromDiscord<Elegant Beef> https://github.com/beef331/constructor
03:19:09Yardanicowell yeah it's just a small sugar thing
03:19:14Yardanicoto write less code
03:19:16YardanicoI mean it's ok
03:19:35FromDiscord<Elegant Beef> Yea rika said it wasnt clear the last time i posted it so...
03:19:40Yardanicobut I don't like code formatting :D
03:19:52FromDiscord<Elegant Beef> Huh?
03:20:00zedeusyou could also use tuples
03:20:11FromDiscord<Elegant Beef> Yea it supports both
03:20:14Yardanicothe preferred style almost universally in most languages is something like "var a: int = 5"
03:20:18Yardanicono space after "a"
03:20:27Yardanicobut space after ":"
03:20:35FromDiscord<Rika> hey let him do whatever
03:20:37Yardanicotry to run nimpretty on your code
03:20:38zedeusvar a :int= 5
03:20:39Yardanico@Rika I know
03:20:42Yardanicozedeus: :(((
03:20:43FromDiscord<Rika> nims literally "have whatever except tabs as indent"
03:20:51*nsf joined #nim
03:20:52Yardanico@Rika uhh
03:20:56zedeuswell, you can do that
03:20:59zedeusbut you shouldn't
03:21:18Yardanico!eval vAR a: iNT = 5; eChO a
03:21:20NimBot5
03:21:36zedeususe tabs and your code automatically gets indented with 8 beautiful spaces by github
03:21:43Yardanico(yes keywords are partially case insensitive too)
03:21:43FromDiscord<Elegant Beef> Yum
03:21:45FromDiscord<Elegant Beef> My favourite
03:22:03sasambaSo I need to make 1 client = 1 future or i can use one client for many futures?
03:22:06FromDiscord<Rika> keywords are just special idents why would they not be style insens
03:22:11sasambaIf I use one client it crashes
03:22:11Yardanicoshashlick: 1 client = 1 future
03:22:20Yardanicodon't worry, it won't really affect performance
03:22:27zedeussasamba: one client per request, it's a little strange but yeah, no performance hit
03:22:29Yardanicounless you want to do millions of requests per second :D
03:22:38zedeusin which case you can use a pool
03:22:47sasambaOh
03:22:49sasambaThx!
03:23:11Yardanico.good night
03:23:48zedeusfor my nitter project a new client is created for every request, and I serve hundreds of thousands every day
03:23:55FromDiscord<Elegant Beef> buh bye yard
03:23:59zedeusI should probably use a pool.. but it's fine
03:24:03FromDiscord<Elegant Beef> I hate you for hating my formatting
03:24:23zedeusgn, thanks for helping with troubleshooting
03:24:39FromDiscord<Rika> zedeus what server specs tho 👀
03:24:51zedeus2 core vps at hetzner
03:25:06zedeusruns two instances of the program for load balancing
03:25:11FromDiscord<Yardanico> 6 euro one?
03:25:15zedeusyep
03:25:18FromDiscord<Yardanico> Amazing
03:25:21FromDiscord<Yardanico> I have it too
03:25:31FromDiscord<Yardanico> (the 6 euro one too)
03:25:34zedeus8.5 million redis commands processed in the past few days
03:25:38FromDiscord<Rika> damn, 2 cores and how many people use nitter
03:25:49zedeuslast I checked 17k unique users daily
03:25:55FromDiscord<Yardanico> Bruh
03:25:59FromDiscord<Rika> daaaaamn
03:26:05FromDiscord<Rika> thats an efficient program
03:26:12FromDiscord<Yardanico> Nim
03:26:14zedeus^
03:26:26zedeusthe only bottleneck is waiting for Twitter requests
03:26:32FromDiscord<Rika> you just said good night yardanico go to sleep damn it
03:26:33FromDiscord<Rika> xd
03:26:35zedeuswhen I cache everything, full timelines are served in 10 ms
03:26:51FromDiscord<Yardanico> How much ram does nitter use btw? Single instance
03:26:58FromDiscord<Yardanico> The binary itself
03:27:17*opDispatch quit (Quit: Konversation terminated!)
03:27:36zedeusdue to large spikes it uses a lot, both instances typically grow to 1.5 gb before getting OOM'd unless i kill them myself first
03:27:59FromDiscord<Yardanico> Ok now good night for real
03:28:11zedeusbut that's with fetching and parsing ~4 MB html requests every time
03:28:22zedeusworking on using the new json api, way more efficient
03:28:26FromDiscord<Rika> zedeus: no swap?
03:28:42zedeusnope, but I feel like that would be a bad idea
03:28:52zedeuseasier to just let nitter die and restart, there's no state
03:30:59FromDiscord<Technisha Circuit> How would i make a proc called `__import__`?
03:31:06zedeusyou cannot
03:31:11FromDiscord<Technisha Circuit> I have to have this exact name
03:31:14FromDiscord<Technisha Circuit> Damn
03:31:25zedeusdouble underscore is specifically banned
03:31:34FromDiscord<Technisha Circuit> Why?
03:31:38zedeushttps://nim-lang.github.io/Nim/manual.html#lexical-analysis-identifiers-amp-keywords
03:32:06*fredrikhr joined #nim
03:32:07zedeusI think it's to avoid clashing with C preprocessor stuff, not sure
03:32:16FromDiscord<Technisha Circuit> Hm
03:32:29zedeusbut it wouldn't make sense anyway as underscores are ignored
03:32:31FromDiscord<Technisha Circuit> Can i somehow bypass this with macros?
03:32:42zedeusa_b is the same as ab
03:33:01FromDiscord<Elegant Beef> Why does it have to be `__import__``?
03:33:05FromDiscord<Elegant Beef> (edit) '`__import__``?' => '`__import__`?'
03:33:20FromDiscord<Technisha Circuit> I'm attempting to start implementing a python transpiler in Nim
03:33:33FromDiscord<Yardanico> Check out py2nin
03:33:39FromDiscord<Yardanico> (I'm sleeping btw)
03:33:42FromDiscord<Elegant Beef> Ah
03:33:58FromDiscord<Elegant Beef> Damn yard is smarter asleep than me when im awake
03:34:31FromDiscord<Technisha Circuit> Haha thanks
03:34:52FromDiscord<Yardanico> https://github.com/metacraft-labs/py2nim_deprecated/
03:35:40*marquisdefalbala quit (Quit: Konversation terminated!)
03:36:53FromDiscord<Elegant Beef> I still dont understand why one would transpile python to nim, when they could just write nim 😄
03:37:09*sasamba quit (Ping timeout: 245 seconds)
03:37:14FromDiscord<Elegant Beef> *Spoken like a true person that's never really used pythong*
03:37:19FromDiscord<Elegant Beef> (edit) 'pythong*' => 'python*'
03:37:33*rockcavera quit (Remote host closed the connection)
03:37:34FromDiscord<Technisha Circuit> Haha
03:38:37*sasamba joined #nim
03:38:43sasambaAnd damn why it gives me an error like this in random places: template/generic instantiation of `routes` from here
03:39:04zedeusnimsuggest doesn't like async very much
03:39:58sasambaUhh
03:39:59sasambaK
03:40:00sasambaThx!
03:40:03*sasamba left #nim (#nim)
03:46:05FromDiscord<Rika> @Elegant Beef can you make it make `initObj` for regular objects and `newObj` for ref?
03:46:13FromDiscord<Rika> wait
03:46:17FromDiscord<Rika> are you the right person
03:46:19FromDiscord<Rika> yes
03:46:22FromDiscord<Elegant Beef> yes
03:46:28FromDiscord<Elegant Beef> I suppose i could
03:50:21FromDiscord<Elegant Beef> Seems it doesnt even work for refs so yay!
03:51:14FromDiscord<Rika> lmao
03:51:20FromDiscord<Rika> the syntax should be the same
03:52:44FromDiscord<Elegant Beef> well i was taking only objects/distincts
03:52:51FromDiscord<Rika> @Elegant Beef your readme is also broken lmao
03:53:04FromDiscord<Rika> 2nd example has coolInt as 10 in the macro but 11 generated
03:53:23FromDiscord<Elegant Beef> lol
03:53:25FromDiscord<Elegant Beef> i cant read
04:03:49FromDiscord<Elegant Beef> Well now your wish has been granted
04:04:08FromDiscord<Elegant Beef> Init for stack and new for heap
04:04:16FromDiscord<Elegant Beef> Now it's garuenteed to be broken
04:04:19FromDiscord<Elegant Beef> But dont ask about that
04:04:55FromDiscord<Rika> guaranteed to be broken?
04:05:00FromDiscord<Rika> oh the readme?
04:05:26FromDiscord<Elegant Beef> Nah i just feel that i probably missed a case where this can be used and will crash
04:05:30FromDiscord<Elegant Beef> I am a numpty afterall 😛
04:05:47FromDiscord<Rika> a ref ref objet
04:05:50FromDiscord<Rika> xd
04:05:55FromDiscord<Rika> are those even possible i wonder
04:06:00FromDiscord<Rika> rather
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:05FromDiscord<Elegant Beef> A super managed object
04:06:05FromDiscord<Rika> possible as a "type"
04:06:15FromDiscord<Rika> like `type something = ref ref object`
04:06:27FromDiscord<Elegant Beef> It compiles
04:06:33FromDiscord<Rika> !eval type something = ref ref ref ref object
04:06:35NimBot<no output>
04:06:39FromDiscord<Rika> it compiles...
04:06:44*supakeen joined #nim
04:06:47FromDiscord<Rika> horror right here
04:07:02FromDiscord<Rika> who needs double indirection when theres quadruple indirection
04:07:05leorize[m]!eval echo repr (ref ref ref ref ref ref RootObj)()
04:07:06NimBotCompile failed: /usercode/in.nim(1, 44) Error: object constructor needs an object type
04:07:39leorize[m]!eval echo repr new(ref ref ref ref ref ref RootObj)
04:07:40FromDiscord<Rika> !eval type something = ref ref ref ref object; echo repr new new new new something
04:07:42NimBotCompile failed: /usercode/in.nim(1, 64) Error: type mismatch: got <something>
04:07:43NimBotref 0x7f84a4295048 --> nil↵
04:07:49FromDiscord<Rika> oh lord
04:07:57FromDiscord<Elegant Beef> lol
04:08:14FromDiscord<Rika> this is horror
04:08:21FromDiscord<Elegant Beef> We're super high IQ now, we can do quantum mechanics by hand without any thinking
04:21:29FromDiscord<Elegant Beef> Now if only there was a good place to put this without creating dependancy hell 😄
04:23:39*sasamba joined #nim
04:23:56sasambaHow can I interrupt endless cycle in asyncChecked proc? :)
04:24:14FromDiscord<Elegant Beef> We need a `communitysugar` module that has all these small sugar macros as sub files so there is a reason to post it to nimble 😄
04:24:39leorize[m]that's like, fusion
04:24:53FromDiscord<Elegant Beef> Ah
04:24:56FromDiscord<Elegant Beef> Nice
04:32:49*disruptek sighs.
04:33:22FromDiscord<Elegant Beef> Dies.
04:35:36FromDiscord<Rika> flies.
04:40:57*Senketsu quit (Ping timeout: 260 seconds)
04:41:01*bebarker quit (Ping timeout: 264 seconds)
04:44:16*bbarker joined #nim
04:58:56*narimiran joined #nim
05:08:21*Jesin quit (Read error: Connection reset by peer)
05:10:04*Jesin joined #nim
05:25:43*Tongir joined #nim
05:25:45*ftsf_ joined #nim
05:25:47*Tlanger quit (Read error: Connection reset by peer)
05:28:50*ftsf quit (Ping timeout: 265 seconds)
05:31:18*liblq-dev quit (Quit: WeeChat 2.8)
05:37:03*solitudesf joined #nim
05:47:27*lritter quit (Remote host closed the connection)
05:59:39*sasamba quit (Ping timeout: 245 seconds)
06:00:36*Satomi-Kowa joined #nim
06:03:54*fredrikhr quit (Remote host closed the connection)
06:04:11*fredrikhr joined #nim
06:11:52*Senketsu joined #nim
06:18:20*Trustable joined #nim
06:26:42skrylar[m]arguably quantum computing is just using floats instead of bits, and then you only ever get uniqueptrs xD
06:57:49*solitudesf quit (Ping timeout: 264 seconds)
06:58:27*PMunch joined #nim
07:00:14PMunchHmm, does `{.threadvar.}` work even if it isn't Nim who's creating the threads?
07:02:14*JustASlacker joined #nim
07:13:05*Senketsu quit (Ping timeout: 252 seconds)
07:18:28PMunch@Technisha Circuit, I was looking through the IRC logs and saw you asking about embedding Python in Nim. I've seen it done in a C program so I think it should be fairly doable.
07:19:10ZevvI guess so - it just emits __thread on your variable
07:19:22Zevvit's the compiler doing the work here, not Nim
07:19:22PMunchHmm
07:19:51PMunchI'm getting this annoying segfault in my program, but it doesn't tell me where..
07:19:59*Zevv sings the valgrind song
07:20:12PMunchYeah I guess I could try gdb/valgrind..
07:20:18PMunchBut it's inside a docker container..
07:20:26Zevvthat's your own fault, not mine
07:20:34PMunchHaha, true :P
07:20:54PMunchHmm, I guess I can run it without the container now that I think about it
07:21:04Zevvso much masochism in the world today. docker galore
07:21:22ZevvI had sooo much fun. My $customer needed IPv6 in kubernetes.
07:21:29ZevvBut in 2020, its kind of a no-no
07:21:29Zevvto do that
07:22:07PMunchWhat?
07:22:16PMunchIPv6 should be standard everywhere..
07:22:50Zevvyeah, that was kind of my point. This is so ridiculous
07:23:13ZevvI know next to nothing about all that kubernetes stuff and docker and all
07:23:20FromGitter<sheerluck> so we should implement kubernetes in Nim, right?
07:23:32PMunchNimberenetes
07:23:50Zevvbut I do know my drills about ipv6 and containerezation, so I'm perfectly able to get something working with low level networking stuff. But there is hardly an adminisrative way to do this in k8s
07:23:59PMunchWell I find docker great for being able to build a container that contains all the libraries and systems required
07:24:18PMunchSo I can just push the docker image and our ops team can deploy it on our servers
07:24:34ZevvI stopped having opinions about this stuff.
07:24:40ZevvI'm an old grunt I guess
07:24:42PMunchNo need for me to tell them to read the README where I describe the dependencies and file structure required
07:24:56FromDiscord<Elegant Beef> Well i mean doesnt that also apply to appimage?
07:25:32FromDiscord<Elegant Beef> I've never used containerized environments outside of snap/appimages 😄
07:25:34Zevvso much administrative and mental overhead in all that stuff.
07:25:38PMunchHmm, I haven't really used appimage, but maybe
07:25:44livcdI find docker great for one thing
07:26:50FromGitter<bung87> mostly ops get benefit
07:27:51ZevvI hate it so much. I have this app I need to run in docker and it emits verbose logging of all GL commands happening in an AOSP container. That's quite a bit. Usually loading up a log file of 100mb in less or vi happens in an instant. But no, `docker-compose logs' needs 25 seconds to get my log out
07:27:56ZevvWhy the hell?!
07:28:16livcdyou dont see the big picture!
07:28:24livcdyou are not supposed to view the logs that way
07:28:25ZevvAnd really, IPv6 *that* hard? And then still I need to do IPv6 masquerading! Ha!
07:28:32livcdYou have to collect them in splunk & friends
07:29:35PMunchZevv: https://www.youtube.com/watch?v=y8OnoxKotPQ
07:29:50Zevvand now I have these kids running around talking about calilo, pods, ipam, configmap, EKS, AKS, GKE and kubeadm
07:29:56Zevvand I see them writing yaml config files with json in there
07:30:01Zevvit really hurts, it hurts so much
07:30:44ZevvPMunch: yes, sooo yes
07:30:56FromGitter<sheerluck> so basically you are saying I need to `ssh` to host with VirtualBox with Lubuntu to run doker to run python script to use IPv6 in Nim to download some yaml config files
07:31:13ZevvI don't know. I gave up on "IT"
07:31:40ZevvI am now demoted to the beard. I debug and fix stuff and do the plumbing.
07:31:49Zevvworks just fine for me.
07:32:41Zevvthe other 50% of the time I spend argueing with architects. So my next business card will say "architectural plumber"
07:32:45Zevvand proud of it
07:32:59PMunchHaha :P
07:34:18Zevvbtw, I yesterday whipped up a somewhat crude VM profiler for shashlik. I'm not sure if it is suitable to make a PR for because I'm a bit ashamed, but it seems waste to just throw it away. Does someone feel this is worth making into something?
07:34:56Zevvthis is what it looks like: http://ix.io/2mMG
07:34:59AraqZevv, it's only worth doing when you blog about it afterwards
07:35:17ZevvThen I might as well stop doing anything at all.
07:35:30PMunchHaha
07:35:43ZevvI tried that a few times, but it just doesn't work for me.
07:37:39PMunchHmm, does finalisers work with markandsweep?
07:42:05Zevvwell, do they?
07:42:21PMunchI dunno
07:43:08PMunchI think I've tracked by crash back to my cache
07:43:35PMunchAnd it does two things, use global memory (woops) and use finalisers
07:43:44PMunchWith thredavar it was still crashing
07:44:38PMunchOh well, gotta walk the dog
07:45:48Zevvthat what dogs are for, right
07:46:13FromDiscord<Elegant Beef> nah they take humans for walks very rarely the other way around
07:47:37*liblq-dev joined #nim
07:47:59Zevvthat's the whole point of me having a dog
07:48:03Zevvit's taking me off my couch
07:48:33*bebarker joined #nim
07:49:41skrylar[m]i thought that was cats
07:50:17*Satomi-Kowa quit (Ping timeout: 260 seconds)
07:51:54*bbarker quit (Ping timeout: 265 seconds)
07:53:01FromDiscord<Elegant Beef> Well cats just make you leave the house not be active
07:53:15FromDiscord<Elegant Beef> No one wants to hear meowing at 4am for no reason
07:55:28livcdthe whole `devops` bullshit is just that... `bullshit`
07:57:49*dadada joined #nim
07:58:13*dadada is now known as Guest150
08:06:57*Trustable quit (Remote host closed the connection)
08:11:41alehander92morning
08:11:49alehander92pmunch wow
08:11:52alehander92you have a dog
08:11:57alehander92does it like snow
08:13:43livcd:D..you know it looks funny...at least to me..I already had 2 beers
08:17:46*zedeus quit (Ping timeout: 246 seconds)
08:19:41*zedeus joined #nim
08:36:17skrylar[m]i was always told devops was just programmers who were made to run the servers
08:37:34skrylar[m]i will also admit there's one or two very specific setups that seemed kinda interesting; mostly the ones where you had a nomad/terraform config or a nixos config as text and then you could put those in phabricator where all the audit/code review lived, and then you just kinda have the one forum-like place where all the crap is sourced from.
08:37:43PMunchalehander92, it's not really my dog unfortunately. There is a "wilderness experience centre" close to where I live. Since they don't have any tourists anymore they have been asking for people if they want to keep one of their dogs for a while. They're all sledding dogs, and so he loves snow. He's used to sleeping outside in it :P And yes Zevv, it's great for getting me out of the house. Without him I would just be sat at my desk all day..
08:38:06*xace quit (Ping timeout: 260 seconds)
08:41:20*neceve joined #nim
08:42:27PMunchHmm, removing the global cache didn't seem to fully eliminate the problem.. I got a stack smashing error from select in my Http get call.
08:42:46PMunch(every time I need to get something I create a new client, so it's not a shared client)
08:46:47PMunchNow I got a SIGABRT: http://ix.io/2mN1
08:47:00PMunchAh no, it's the same: http://ix.io/2mN2
08:49:56*xace joined #nim
08:51:04*krux02 joined #nim
08:53:00PMunchI even have that section in a lock..
08:53:18PMunchSo only one thread at a time uses it..
08:53:30PMunchIs HttpClient not possible to use from multiple threads?
08:57:37alehander92is it somehow possible to gdb it
08:58:04PMunchYeah I guess I can
08:58:20alehander92otherwise, impressive, i hope it likes the summer too now :D
09:03:11PMunchTBH he seems pretty happy no matter what's going on
09:03:15PMunchExcept from getting into the car
09:03:29PMunchHe doesn't mind driving, or being in the car, but getting in he hates..
09:05:08alehander92he doesnt mind driving
09:05:21alehander92he's not so fond of all the formula1 years
09:05:24alehander92a bit exhausting
09:05:57alehander92but just driving around, eating a bone while donutting on the ice rink
09:06:15alehander92still reminds him of the happy years as volvo tester dog
09:12:41PMunchHaha
09:13:33PMunchHe did try to jump in my lap once when I was driving
09:13:47PMunchAnd considering he's quite a big dog that wasn't a great scenario
09:14:49alehander92:))
09:15:08alehander92can he have a belt on
09:16:08PMunchI guess he could, but as he's not wearing pants I don't really see the point
09:16:32FromDiscord<willyboar> 1-1
09:16:42PMunchHaha :P
09:16:50alehander92well, a seatbelt :D
09:16:57alehander92otherwise, he can wear pants
09:17:40PMunchI don't think seatbelts would work for a dog unfortunately
09:17:41alehander92but only if they match his sled
09:17:54PMunchAt least not the normal one
09:18:12PMunchI tend to tie him down in the back of the car
09:18:29alehander92i think you need a teacher for him
09:18:40PMunchTo teach him what?
09:18:47PMunchHe's not the brightest..
09:18:49alehander92a friend of mine says his dog learned how to not bother him during driving
09:18:53*fanta1 joined #nim
09:18:56alehander92well get him a lamp
09:19:40PMunchHmm, when not running in docker it takes a while and then I get a "Device or resource busy"
09:29:58skrylar[m]heh. reading some of these compression libs
09:30:26skrylar[m]it amuses me how many sloc are behind some of these compressors, and then something like fastlz or density are barely any code and they're almost as good
09:30:40skrylar[m]zstd is huge
09:31:47skrylar[m]https://github.com/ariya/FastLZ/blob/master/fastlz.c entire thing is ~500 and i'd guess a bit of that is c cruft. https://github.com/facebook/zstd/blob/dev/lib/decompress/zstd_decompress.c this isn't even the entire decompressor and its already ~3x that
09:32:41*solitudesf joined #nim
09:35:21*marquisdefalbala joined #nim
09:36:02ZevvPMunch: strace?
09:36:22PMunchHold on, I'm tracking what I think might be the bug..
09:38:45dom96PMunch, Snow puppers? :O
09:38:55dom96You're really making me want to move to Norway
09:39:19dom96Sounds like I should visit that experience center at least to support them via my own tourism :D
09:40:34PMunchYou can go dog sledding there, it's pretty fun
09:40:34*Vladar joined #nim
09:40:49PMunchWould it help if I said I still have over a meter of snow in my garden?
09:41:01dom96Yes :D
09:41:12dom96Where is this picture of that pupper, can't see it
09:42:27PMunchI didn't send one :P
09:42:51PMunchHere you go: https://photos.app.goo.gl/Ezt44RGoM3gmk8Nu6
09:43:05dom96oh I guess you just talked about the dog
09:43:08PMunch(he get's a bit suspicious when I take photos of him :P)
09:43:10dom96I skimmed the IRC logs :)
09:43:56FromGitter<sheerluck> oh so you are Peter Munch-Ellingsen
09:44:01dom96Awww, looks like he needs lots of snacks
09:44:48PMunchsheerluck, you say that like you know who I am? :P
09:45:54alehander92ohh nice dog
09:45:55alehander92indeed
09:49:01*abm joined #nim
09:56:28*Trustable joined #nim
10:05:09*brainbomb joined #nim
10:05:48FromGitter<jorjun_twitter> Can anybody summarise the nim news so far or tell me where to get it? I am generation X so there is no implied irony or self-deprecation or satyrical aim.
10:06:53PMunchNim news since when=
10:06:56FromGitter<jorjun_twitter> My point of view is scripter who wants to take advantage of collossal machine power we now have as commodity. Either on Web or iOT or a gaming
10:08:02FromGitter<jorjun_twitter> Just a brief. Like should I try and make a native version of SDL or chip in with some random github project? How do I help ? Who is sponsoring. Are they evil? Can I ta
10:08:27FromGitter<jorjun_twitter> Can I/ should I take a punt on this new stack. I know right now it is incredibly niche. But I was like this with Python in 1996
10:10:22FromGitter<jorjun_twitter> I drop in from time to time and just get a sense that good beavering is happening and there is no spare resource for communication which is natural and expected. I love the tech. I trained a bit. How should i get further in.. should I just get more app dev experience and shut up?
10:12:45FromGitter<jorjun_twitter> Perhaps the project is more private for now than a public free-for-all
10:15:09PMunchIt's definitely not private
10:15:13FromGitter<jorjun_twitter> me? I ultra small family business we run one web site that makes ad revenue income. Otherwise we’re doing speculative product dev., currently targetting a small IoT venture. and web dev.
10:15:23skrylar[m]well its stable now (1.2) at least
10:15:45PMunchI think the best way to get into Nim is to just try to make some small stuff with it
10:16:10FromGitter<jorjun_twitter> the js compiler output I saw looked so bloated wasn't sure if I could gain from moving to nim
10:17:36FromGitter<sheerluck> @jorjun_twitter try it and you will fall in love with Nim
10:17:55FromGitter<jorjun_twitter> PMunch + Andrew, thanks. Already have, had great experience so far.
10:18:59PMunchDon't worry about the JS output
10:19:02FromGitter<jorjun_twitter> But it is all entirely discarnate entity, the founder is quite easy to see - public persona. Not many others. No sense of community yet. I am going to need to collaborate to get the geeky specifics I need, I think
10:19:03PMunchIt's efficient
10:19:14FromGitter<jorjun_twitter> good to know...
10:19:59FromGitter<jorjun_twitter> I just wrote a small webRTC thing in typescript which would be much better expressed in Nim. Was astonished at speed of js. I can make simple realtime effect filters.
10:22:04FromGitter<jorjun_twitter> But if I want to make a fast game / something. Immediately I am up against established libraries, something-GL for web or SDL for other platforms. There aren’t enough full-native options. Hoping that will change I guess. There’s an immediate impedance mismatch for noobs not used to native interfacing
10:23:10FromGitter<jorjun_twitter> I could have gone down native code route, but C++ completely turned me off. I did compiler stuff for ten years but only on commercial platforms. So, it’s conflicting feeling to love a new language and then immediately have to try to contend with all that C and C++ shit that you tried to escape from.
10:24:10skrylar[m]well most js code ends up bundled with jquery or similar, so the overhead nims runtime bloats up the js output is comparable to normal javascript
10:24:13FromGitter<jorjun_twitter> Nearly all the difficulty surrounds memory management, I suppose. Staying with Nim it is mostly a non-issue. But we can't
10:25:21FromGitter<jorjun_twitter> I am going to run a trial next then Skrylar, I have some webRTC code which will show me if there are performance issues quickly. thanks. Guys. Will drop in another time. And leave you be. Bon chance.
10:26:09dom96@jorjun_twitter let us know what you find, many of us are using the JS backend and would love to see benchmarks
10:26:51skrylar[m]i dont think the js code is any slower than normal; there's just some rtl cruft that makes it look scary if your scripts are small
10:28:11skrylar[m]having said that i just tried to compile something to js and crashed the compiler ._.;
10:28:21PMunchHmm, might have some load-time penalties though since it wouldn't be possible to cache it
10:28:47skrylar[m]why wouldn't you be able to cache nimjs
10:30:05PMunchIs it a separate file?
10:30:18PMunchI thought it all got bundled into one script
10:31:25skrylar[m]sure, it's not modular. but the blob is still cachable
10:32:18PMunchWhat I meant was that either your browser or some local node will have jquery cached
10:32:31PMunchSo loading a small script that uses jquery only needs to load the small script
10:32:45skrylar[m]sure but don't you end up paying to init all of jquery constantly since it doesn't get dead code elim'd
10:32:56PMunchTrue
10:33:06PMunchDepends on network speed I guess
10:33:28dom96I did some webasm benchmarks and was very unimpressed
10:33:38dom96which makes me wonder what the hype is about
10:33:58skrylar[m]did you test against assemblyscript
10:34:16skrylar[m]i've never seen emscripten output that was all that satisfying
10:34:24dom96I didn't use emscripten
10:34:40dom96I implemented fib myself
10:34:44dom96+ used Rust's output
10:35:01dom96and also looked at a benchmarking site which had a fib benchmark
10:35:09dom96for wasm vs. js
10:35:15skrylar[m]native client was nice.. but they killed it :\
10:35:31dom96but I bet most of the slowness I saw was due to JS<->WASM communication
10:35:53skrylar[m]possibly. it probably varies between fox and chrome too
10:36:21dom96https://takahirox.github.io/WebAssembly-benchmark/
10:36:22skrylar[m]i saw some crypto people get decent performance out of wasm but it was because they used a wasm->llvm->dll layer and were transpiling it, which the browsers dont do
10:37:02dom96huh, on my laptop webasm wins
10:37:05dom96but on my desktop it doesn't
10:37:33skrylar[m]Result (average [ms]) JavaScript: 990.0000 WebAssembly: 810.0000 JavaScript/WebAssembly: 1.2222
10:37:58skrylar[m]that is a horrifying margin considering
10:38:13dom96JS still wins collision detection on my laptop though
10:38:23skrylar[m]isn't wasm even static typed and no-gc
10:38:41dom96yep
10:39:09*skrylar[m] is confuzzled.
10:39:33dom96maybe the JS JIT'ing really is just that good
10:39:59dom96they had many years to optimise it and lots of reason to after all
10:40:17FromGitter<jorjun_twitter> dom96 Really did not expect to be able to grab real time video frame and mess with them and put the result back on a canvas
10:40:36alehander92i think js<->wasm was slow
10:40:39alehander92at one point
10:40:56skrylar[m]https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-%F0%9F%8E%89/ looks like theres a lot of crap between the vms
10:41:21dom96In case you want to try the benchmark I did: https://gist.github.com/dom96/b9d613396f3cdedd9e45438ce23f7d04
10:42:00dom96IIRC it was 22mil ops/s for WASM and 44mil ops/s for JS
10:42:42alehander92please try on firefox as well
10:44:14alehander92and are you sure any of the console logs dont happen somehow inside this time
10:44:15*Tlanger joined #nim
10:44:29dom96This was in Firefox
10:44:57dom96what console logs?
10:45:03dom96There are no console logs during the benchmark
10:46:09alehander92ah i am just not sure
10:46:15alehander92how the api of this suite works, sorry
10:46:34*Tongir quit (Ping timeout: 240 seconds)
10:49:18alehander92then, you're right, strange
10:49:26dom96give it a try :)
10:49:57dom96I think it is still a bit unfair, because JS<->WASM certainly will always have some significant overhead
10:50:17alehander92yeah, i tried :)
10:50:20dom96Ideally I would need to measure time in WASM and JS
10:50:25alehander92the browser one, not yours
10:50:51alehander92but yeah once there is direct access to browser from wasm
10:50:53alehander92it would be good
10:51:36PMunchHmm, so I really need the cache, but I can't keep it global because the VM freaks out
10:51:44PMunchs/VM/GC
10:53:06*neceve quit (Ping timeout: 256 seconds)
10:56:14alehander92can't you put locks
10:56:17alehander92around accesses
10:57:37PMunchI already have
10:58:18alehander92isn't sharedtable for
10:58:20alehander92cases like that
10:59:07PMunchI guess
10:59:14PMunchBut my cache is a bit more complicated than that
10:59:30alehander92btw why http://web.mit.edu/nim-lang_v0.16.0/
11:06:03*madpata quit (Quit: Lost terminal)
11:12:40PMunchIt's a bit odd that threadvar didn't work though isn't it?
11:16:55PMunchRealised I had put the initCache call in the global initialiser still..
11:17:34*xace quit (Ping timeout: 240 seconds)
11:17:36PMunchSeems stable so far with "if pubKeyCache == nil: pubKeyCache = initCache()"
11:17:43PMunchIn the operate procedure
11:22:09PMunchMemory consumption seems stable as well
11:25:56*brainbomb quit (Quit: Leaving.)
11:30:26*xace joined #nim
11:30:46*solitudesf quit (Quit: Leaving)
11:31:31PMunchHoly shit, NimLSP is using a solid 300MB of RAM..
11:31:34PMunchThat's not good
11:31:54PMunchI'm guessing that's nimsuggests fault?
11:47:03*solitudesf joined #nim
11:56:01*rockcavera joined #nim
11:58:22*sz0 joined #nim
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:42*supakeen joined #nim
12:27:14*fredrikhr quit (Ping timeout: 256 seconds)
12:34:37*Vladar quit (Quit: Leaving)
12:53:19*Guest150 quit (Ping timeout: 258 seconds)
12:55:02*dadada joined #nim
12:55:26*dadada is now known as Guest87103
12:59:49*dcmertens joined #nim
13:01:01dcmertensHere's a question about language design philosophy and nim
13:01:08dcmertensI am reading through Nim in Action
13:01:10dcmertensit's nice!
13:01:21dcmertensnim's handling of modules is quite nice
13:01:41dcmertensbut when we import threadpool, we have to compile with --threads:on
13:02:02dcmertensis there any reason that the importing of the module itself doesn't turn this on for us?
13:02:33dcmertensI know I can put the configuration into a .nims file, but this is philosophically different from what you get with scripting languages
13:02:52dcmertenswhere (nearly) all of the configuration is in the software itself
13:03:20FromDiscord<Rika> ~~because this isnt a scripting language~~
13:03:38dom96because --threads:on is a global flag, rather than a per-module flag
13:03:38dcmertensindeed, and that is what I like about nim. :-)
13:03:45FromDiscord<Clyybber> yeah, automatically turning --threads:on might not be a stupid idea
13:03:49dcmertensdom96, thanks
13:03:52FromDiscord<Clyybber> or making it the default rather
13:04:19FromGitter<zetashift> why is it not the default?
13:04:45FromGitter<zetashift> Maybe there was/is a reason behind it :O
13:04:45FromDiscord<Rika> maybe it has overhead somehow
13:04:57PMunchPerformance I'm guessing
13:05:26dcmertenshow many globals are handled by nim? When we use threads, does it have to copy all of them?
13:05:28PMunchSome modules might have a switch to check if threads are on and only then lock access to things
13:05:55FromDiscord<mratsim> Nim can handle up to 3200 globals
13:06:06dcmertensIn Perl, spawning a thread is costly because it has to copy the entire interpreter state.
13:06:06FromDiscord<Clyybber> dcmertens: There are globals, and there are threadvars
13:06:27dcmertensto be clear, I'm not talking about user-defined globals, I mean nim's execution state
13:06:31FromDiscord<mratsim> --threads:on has overhead especially on memory allocation as the GC now uses locks
13:06:50FromDiscord<Clyybber> ah
13:07:39dcmertenswell, thanks all for discussing my question. :-)
13:08:39dom96--threads:on also adds dependencies which I've seen cause problems
13:11:24CcxWrkChanging the process to multithreaded modifies behaviour of some POSIX functions IIRC. So simple programs generally avoid it there.
13:11:24FromGitter<jorjun_twitter> gotta convert this TS: `navigator.mediaDevices ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ` [https://gitter.im/nim-lang/Nim?at=5ec52c7c5ad7623956f455ef]
13:12:05FromGitter<jorjun_twitter> should I use the sugar import and try to match it close as poss?
13:12:09PMunchdcmertens, I don't think Nim has a lot of state it needs to copy over
13:12:23PMunchBut threads are still expensive to create because of the OS
13:12:41PMunchBut expensive =/= expensive
13:13:16dcmertensPMunch, right
13:13:50dcmertensjorjun_twitter, what is "TS"?
13:13:57FromGitter<jorjun_twitter> typescript
13:14:01PMunchTypeScript I'm guessing
13:14:18dcmertensah, thanks
13:16:35dcmertensActually, coming back to my original question: is there any circumstance in which a programmer would import threadpool and *not* want --threads:on?
13:16:55Yardanicothreadpools requires --threads:on anyway :D
13:17:17dcmertensCan a module turn this on, or just a nimscript file?
13:18:02FromDiscord<mratsim> only the nim.cfg file or nimscript file
13:18:03FromDiscord<Clyybber> only a nimscript file, or .cfg file
13:18:07Yardanicolol
13:18:15FromDiscord<Clyybber> since when the module is processed it might be too late to turn threads:on
13:18:32dcmertensClyybber, true, but nim supports some level of compile-time code execution
13:18:47FromDiscord<Clyybber> yes
13:18:55FromDiscord<mratsim> it's beyond "some level" but not up to compiler flags 😉
13:18:55FromDiscord<Clyybber> But that doesn't change the order problem
13:19:06FromDiscord<mratsim> the C compiler flags yes though
13:19:39dcmertensmratsim, got it. Some day I hope to know enough about nim to understand why that is the case
13:19:47FromDiscord<Clyybber> dcmertens: You would have to follow all imports first, look for threads, turn it on and then reprocess all of them
13:19:54dcmertensbut for now, I'll just patiently read Nim in Action
13:20:03FromDiscord<Clyybber> because other modules might change their behaviour depending on wether --threads is on or off
13:20:07dcmertensClyybber, yeah, that's what I would have expected
13:20:08FromDiscord<Clyybber> with locks and such
13:21:00dcmertensI would have expected nim too process the entire import dependency chain before compilation
13:21:04*fredrikhr joined #nim
13:21:57FromDiscord<Clyybber> it gets done during compilation
13:22:03FromDiscord<Clyybber> because you can have conditional imports
13:22:23FromDiscord<Clyybber> like `when condition: import somemodule`
13:22:55Yardanicoah btw guys I completed making the graph yesterday, although didn't visualize it in a good way yet https://gist.githubusercontent.com/Yardanico/4d25f7395af01b06cf9035c8024f02c6/raw/192dca7c9cb2747e5ab2030baab08a59748434f3/graph.svg
13:23:05Yardanicoalmost all packages in nimble are there with their dependencies
13:23:23FromDiscord<Clyybber> @Yardanico Btw are you not in #test ?
13:23:34YardanicoI only use #test when testing ircord :P
13:23:39FromDiscord<Clyybber> ah alright
13:23:40Yardanicoother times it's not bridged
13:24:21FromDiscord<Rika> Yardanico: whys there one package with the full url
13:24:26FromDiscord<Rika> actually many
13:24:41*dcmertens looks up treesitter
13:24:51Yardanico@Rika they're the ones which are not in nimble
13:25:06Yardanicoor just specified as github urls in the nimble file
13:25:15Yardanicoyou know you don't have to specify *only* nimble pkgs, right?
13:25:22Yardanicoyou can specify any git/hg url
13:25:32PMunchAnd what would you do if one module tried to turn threads off and another tried to turn them on?
13:25:37dom96Yardanico, wow, that's cool
13:26:28Yardanicoright now I lowercase all packages and remove _
13:26:37Yardanicobecause ast_pattern_matching is the same as astpatternmatching :P
13:26:50PMunchSo an arrow means that the package depends on what it is pointing at right?
13:26:53Yardanicoyes
13:26:57Yardanicono arrows - no dependencies
13:27:11Yardanicodom96: btw I did the parsing for all different .babel and .nimble (both ini and nims) with npeg :DD
13:27:19dcmertensPMunch, isn't that going to be a problem no matter what?
13:27:21Yardanicoone thing though is that if a package has test dependencies - they'll be included as normal ones here
13:27:38PMunchdcmertens, why?
13:27:55Yardanicohttps://play.nim-lang.org/#ix=2mNM that's the parser
13:28:02PMunchI mean one of the packages would now output an error saying it can't run with threads, and the other would say that it required threads
13:28:02dcmertensPMunch, if a module doesn't like threads, and you're trying to use them, you're out of luck, right?
13:28:05Yardanicoof course I also do some other stuff later like remove version specifiers
13:28:10PMunchDepending on how you switch the threads:on switch
13:28:16dom96Yardanico, whyyy not just use Nimble?
13:28:23Yardanicodom96: for 1.3k repos? :)
13:28:26YardanicoI cloned them all locally
13:28:34*ftsf_ quit (Ping timeout: 246 seconds)
13:28:36PMunchI mean the compiler could have an error message for this, something like "conflicting switching of threads" or something
13:28:46dcmertensPMunch, right
13:28:50FromDiscord<Rika> dcmertens: there's a difference between a module not liking threads and a module explicitly disabling them
13:28:52dom96Yardanico, yeah? Why not? Too slow?
13:29:06Yardanicowell how can I tell nimble to show me package dependencies without installing them?
13:29:13PMunchYardanico, could you tell dot to make the graph prettier?
13:29:22PMunchLike not overlap the arrows over nodes
13:29:25YardanicoPMunch: well I experimented a bit but still haven't found anything nice
13:29:28YardanicoI can do -Goverlap=scale
13:29:30dom96Yardanico, I mean use Nimble's code
13:29:31Yardanicobut then the graph is HUGE
13:29:34dom96to parse the .nimble file
13:29:43Yardanicodom96: well it was easier to just do this with npeg :D less code
13:30:07PMunchYardanico, do you have the .dot file? I can try to see if I can find something
13:30:11*couven92 joined #nim
13:30:11Yardanicoyeah
13:30:13PMunchCan't remember the flag I use
13:30:38*fredrikhr quit (Disconnected by services)
13:30:38*couven92 is now known as fredrikhr
13:30:40YardanicoPMunch: https://transfer.sh/16iU1i/deps_nothing.dot
13:30:53*couven92 joined #nim
13:31:01Yardanicoit's the most plain simple .dot file just like the nim compiler makes
13:32:06bebarkerso far my understanding of Nim is that an object can't have both immutable and mutable members: it is either completely immutable or completely mutable, is that right?
13:32:24Yardanicowell you can do mixed if you use getters/setters
13:32:43Yardanicolike don't export the fields of an object and only export getters for all fields and setters for fields you want to be mutable
13:32:53bebarkerYardanico, ah right
13:35:07Yardanicodom96: btw around 66% nimble packages don't have any dependencies :P
13:35:18FromGitter<jorjun_twitter> found this: https://github.com/nim-lang/Nim/wiki/Nim-for-TypeScript-Programmers
13:36:50PMunchYardanico, what are you using now?
13:36:57YardanicoPMunch: what do you mean?
13:37:05PMunchTo generate the graph
13:37:09PMunchWhat arguments
13:37:21*raskol joined #nim
13:37:21*raskol quit (Client Quit)
13:37:29YardanicoI think it was sfdp
13:38:02Yardanicoand almost no args, only -Goverlap=prism and -Gpack=false I think
13:38:03Yardanicographviz is confusing :D
13:38:20*raskol joined #nim
13:38:20*raskol quit (Client Quit)
13:39:43YardanicoThis is how I do parsing btw (yes it's not that pretty but it works and fast :P) https://github.com/Yardanico/nim-snippets/blob/master/pkgraph/parse.nim
13:41:23*raskol joined #nim
13:41:23*raskol quit (Client Quit)
13:42:01*raskol joined #nim
13:42:01*raskol quit (Client Quit)
13:43:39Yardanicobtw after cloning like 1k repos github limited my download speed so I had to use a VPN :D
13:43:53YardanicoI did shallow clones though
13:44:27*couven92 quit (Ping timeout: 256 seconds)
13:44:37dom96no reason to clone it to be honest
13:44:57dom96just request projectName.nimble file :P
13:45:17disruptekthat won't work for all packages, sadly.
13:46:24*NimBot joined #nim
13:48:52*couven92 joined #nim
13:55:36PMunchYardanico, add -Gsplines=true
13:55:50PMunchAnd listen to your computer trying to fly away for a little while :P
13:56:27FromDiscord<Technisha Circuit> > @Technisha Circuit Circuit, I was looking through the IRC logs and saw you asking about embedding Python in Nim. I've seen it done in a C program so I think it should be fairly doable.↵Instead of Python I'd want to do it with NimScript because NimScript ftw
13:56:40*raskol joined #nim
13:57:40FromDiscord<Technisha Circuit> (edit) 'NimScript' => 'Nim'
13:58:20PMunchAnd Yardanico you should generate a colour for each package based on its name and colour the node and the lines going to it in that colour
13:58:28YardanicoPMunch: yes I know
13:58:33YardanicoI did that in the past for compiler dep graph
13:58:44Yardanicohttps://i.imgur.com/nETUyzK.png
13:58:48Yardanicothat's from start of february
13:59:07Yardanicoits too complicated :D
13:59:10PMunchHaha, that looks a bit crazy :P
13:59:26PMunchI mean if the lines weren't straight it would probably be easier to read..
13:59:36PMunchAnd I think nimble packages aren't as connected as the compiler
13:59:44*solitudesf- joined #nim
13:59:45disruptekjust have the graph shuffle stuff around.
13:59:49FromDiscord<Rika> that lonely package outside the hell box though
13:59:52disruptekit's trivial to do in graphviz.
13:59:58Yardanicohow? :)
14:00:24*JustASlacker quit (Ping timeout: 258 seconds)
14:00:36PMunch@Rika, osseps or system?
14:00:48FromDiscord<Rika> is
14:00:50FromDiscord<Rika> osseps*
14:01:05FromDiscord<Rika> system isnt that lonely, it has some packages around it
14:01:08PMunchYardanico, the compiler one should have grouped by folder by the way
14:01:20Yardanicowdym folder
14:01:21PMunch@Rika, most of those are in the "system" folder
14:01:25Yardanicothere's only one folder for the compiler
14:01:25PMunchDirectory
14:01:35FromDiscord<Rika> its a joke T_T
14:01:49PMunchHuh, you're right
14:01:52PMunchI was thinking of stdlib
14:02:37*solitudesf quit (Ping timeout: 265 seconds)
14:04:02*raskol quit (Quit: Lost terminal)
14:05:12Yardanicoalso another version https://i.imgur.com/J2XjRwT.png
14:05:30FromDiscord<Rika> spaced out as fuuuck
14:05:47Yardanico-Goverlap=scale
14:05:49Yardanicoso nothing overlaps
14:05:53dom96Yardanico, you should turn this into a live interactive website
14:06:00dom96would be a cool way to discover packages :)
14:06:28Zevvpoor osseps
14:06:31Zevvnobody loves him
14:06:38*kungtotte quit (Read error: Connection reset by peer)
14:06:49Zevvyour dot graphs have the funniest spacing
14:07:11PMunchWith splines they get a lot better :P
14:07:12*raskol joined #nim
14:07:12*raskol quit (Client Quit)
14:07:32*kungtotte joined #nim
14:08:34*abm quit (Read error: Connection reset by peer)
14:09:22FromGitter<jorjun_twitter> if a monkey stole your face...
14:09:37PMunchWhat?
14:11:29PMunchThat would be one odd looking monkey
14:11:38PMunchEven though I do have a bit of a beard going at the moment
14:12:47alehander92yardanico
14:12:49alehander92awesome
14:12:58alehander92i wanted to do stuff like that for functions
14:13:00alehander92and modules
14:14:53YardanicoPMunch: well splines help a bit
14:15:08PMunchA bit? Now all the labels are readable :P
14:15:18*raskol joined #nim
14:15:30YardanicoPMunch: https://gist.githubusercontent.com/Yardanico/194f832818f636721b8054e70c0b50a2/raw/5763a6f1ec29f38cf2a1f19dca9ae1d85a804759/fa.svg
14:17:19PMunchYeah, that looks similar to what I got
14:17:49PMunchThe reason I wanted colours, because it's a tad hard to see exactly where arrows point to
14:18:19Yardanicowell yeah I did that in february
14:18:26YardanicoI manually added random colors
14:18:31Yardanicowell manually I mean with nim program
14:18:41Yardanicopost-processing :P
14:19:04bebarkerIt seems like let-declared references can still be assigned to unlike non-ref values (by dereferencing with []), which I guess makes a certain sense; does this mean there is no difference between let x = ref ... and var x = ref ...?
14:19:14Yardanicobebarker: there is
14:19:19alehander92one thing one can do is
14:19:45alehander92graphing all the modules/functions of nim program after compilation
14:19:48Yardanicobebarker: if you make a ref object as "let", you can't mutate the reference
14:19:55Yardanicoand that makes perfect sense
14:20:09Yardanicosince with "ref object" you're actually declaring the reference itself as immutable
14:20:12Yardaniconot the underlying data
14:20:25alehander92very easy to analyze e.g. how coupled stuff is
14:20:46bebarkerYardanico, hmm, that's kinda what i was wanting to achieve but maybe I did something wrong, let me post my example
14:21:39bebarkerYardanico, https://gist.github.com/bbarker/903ff7608e20bdcac09656b2803fa76c
14:21:59*JustASlacker joined #nim
14:22:20Yardanicobebarker: in your example you're not changing the reference itself, it stays the same
14:22:25Yardanicoyou're changing the underlying data
14:22:35bebarkerah, right
14:22:49bebarkeri see what you mean
14:26:56FromDiscord<slymilano> The string in Rust seem pretty gnarly and hard to work with for "mere mortals" does Nim abstract this away from us? https://news.ycombinator.com/item?id=23246908
14:27:29FromDiscord<slymilano> Been working with Nim a bit and haven't run into any issues like that, I can just use good old string
14:27:30bebarkerMaybe a better approach would be to make a ref object and overload [] to allow setting on that, then I think you would have an array where individual indices could be altered but the entire array couldn't be assigned to. Better yet, I think i could use distinct so that set ([]) only works on the distinct type
14:28:29PMunchslymilano, yeah strings are about as easy as they get in Nim
14:29:27dom96Nim has `string` and `cstring` and that's it
14:29:41*dddddd joined #nim
14:29:43PMunchYou have string and cstring, where the latter is just the same as "char *" and used for C interop.
14:29:45dom96(And `TaintedString` but don't worry about that :))
14:29:56PMunchHaha, oh yes TaintedString
14:30:09Yardaniconobody likes TaintedString :(
14:30:21PMunchI really like the idea of TaintedString, but I've never done anything but .string on one...
14:32:17dom96It's okay, let's just forget it exists :)
14:35:05*nekits quit (Read error: Connection reset by peer)
14:35:42*nekits joined #nim
14:36:08FromDiscord<mratsim> strings are easy until you want to do time critical string processing (but same problem in any non-garbage collected language)
14:40:28FromDiscord<Rika> `given how frictionless Rust otherwise tends to be.` ?????
14:43:43shashlickhow do you wrap c++ reference params in nim
14:45:12FromDiscord<mratsim> You should ask genotrance, he is the specialist of wrapping 😉
14:45:15*raskol quit (Ping timeout: 258 seconds)
14:45:21FromDiscord<mratsim> (irony :P)
14:45:58FromDiscord<mratsim> https://github.com/numforge/agent-smith/blob/master/third_party/ale_wrap.nim#L111
14:46:05FromDiscord<Rika> when will we get to a sufficient enough size where we dont need to direct people to specific people for certain tasks
14:46:36FromDiscord<mratsim> genotrance == shashlick
14:47:26disruptekmratsim: any idea why your rt demo crashes with larger constants?
14:47:54shashlickthanks m
14:48:02FromDiscord<Rika> > genotrance == shashlick↵holy fuck you just made my mind melt
14:48:46disrupteki thought i'd run it for awhile but i think it segvs after 10-15m.
14:49:00shashlick@mratsim: am looking at some C++ to see how it would map to nim for nimterop
14:49:03shashlickhttps://github.com/ocornut/imgui/blob/master/imgui.h#L305
14:49:13shashlickthere, ImVec2& pos
14:49:33zacharycarteruse a pointer Shashlick
14:49:34shashlickbut ImVec2 is just a struct
14:49:36zacharycarterNim doesn't have ref parameters
14:49:53FromDiscord<mratsim> @disruptek no idea, I think Weave transformation to send tasks to threads prevent tail call optimization and the "radiance" function is recursive
14:50:03shashlickso C++ refs can be mapped to Nim ptr?
14:50:18zacharycarteror ref types
14:50:37zacharycarterbut ImVec2 is a struct
14:50:43zacharycarterso you'd pass a pointer in this case
14:50:44FromDiscord<mratsim> no pointer not ref
14:50:53shashlickbut the same type could be used as an object and a ref
14:51:02zacharycarternot if you make it a ref type
14:51:08zacharycarterso yeah, use pointer
14:51:18FromDiscord<mratsim> if you gdb you see that it crashes at 4480 depth of the radiance function: https://github.com/mratsim/weave/blob/master/demos/raytracing/smallpt.nim#L134-L136
14:51:47disruptekyeah but..
14:51:53disruptek😀
14:52:30disruptekwhat's developing that we don't expect to develop...
15:02:53*s4mu3lbk joined #nim
15:02:59Yardanicobtw, about colors
15:03:03Yardanicobefore - https://i.imgur.com/EWxTOsp.png
15:03:05Yardanicoafter - https://i.imgur.com/Bz5TvxK.png
15:03:14Yardanico(that's how it would look if they merge it)
15:03:50FromDiscord<Rika> i dont know if i like the similarity to JS
15:04:06Yardanicolemme try to find a repo with both nim and js
15:04:07Yardanicoto compare
15:05:26Yardanicoa bit oof but who cares about JS right? :D (I manually modified width so it's 50/50)
15:05:26Yardanicohttps://i.imgur.com/U3KcqYY.png
15:05:38YardanicoI still can just close the PR but there's almost no discussion
15:06:13FromDiscord<Rika> yeah as a colorblind motherfucker i cannot see the difference
15:06:16Yardanicolmao
15:06:28shashlick@zacharycarter - why not use var instead of ptr - passing by reference is just for that right
15:07:47shashlick`proc SetNextWindowSize(size: var ImVec2, cond: ImGuiCond = 0)` for `void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0);`
15:09:48*s4mu3lbk quit (Quit: Leaving)
15:10:15*s4mu3lbk joined #nim
15:11:53FromDiscord<willyboar> ~stream
15:11:54disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat)
15:12:00Yardanicoyep join mumble
15:12:13FromDiscord<Generic> I didn't expect to recognise these github colors so well
15:12:35FromDiscord<Generic> but yes, yellow has already burned in an association with js
15:12:43Yardanicowell give your suggestions :P
15:12:50Yardanicohttps://github.github.io/linguist/ to see all current colours on github
15:13:14alehander92eh green is ok
15:13:18FromDiscord<Generic> Nim is quite a unique color
15:13:53FromDiscord<Generic> C# is probably the most popular thing with a similar color
15:14:21FromDiscord<Generic> but atleast I can easily separate them
15:14:24FromDiscord<Clyybber> or maybe make it a bit darker
15:14:27FromDiscord<Clyybber> so that its orange
15:14:35FromDiscord<Clyybber> like arnetheducks avatar
15:14:50FromDiscord<Generic> tbh I don't really see the point in changing it
15:15:02FromDiscord<Clyybber> there is no point
15:15:08FromDiscord<Clyybber> but it would then fit with the website
15:15:12FromDiscord<Clyybber> and the logo
15:15:12FromDiscord<Generic> the colors for the popular languages are mostly chosen without any association
15:15:16dom96yeah, sucks a little that it's so close to JS :(
15:15:22dom96since JS is so popular
15:15:36FromDiscord<Clyybber> recolor js
15:15:37FromDiscord<Clyybber> haha
15:15:56dom96the JS yellow is pretty gross though
15:16:27FromDiscord<Generic> Java is the worst with it's ugly brown
15:16:41FromDiscord<Generic> which doesn't match it's branding btw
15:16:52FromDiscord<Generic> that would be orange/red
15:16:55FromDiscord<Rika> well its ugly so it still kinda does
15:17:12FromDiscord<Generic> I held that joke back 🙂
15:17:41FromDiscord<Rika> me? hold jokes back?
15:17:57FromDiscord<Generic> well I associated it more than once with feces
15:18:03FromDiscord<Rika> fitting.
15:18:13FromDiscord<Generic> but I thought that was too much
15:22:25disruptekanother good demo of nimph today.
15:22:53FromDiscord<Rika> congrats
15:23:14disruptekjust making a note for the video.
15:24:27shashlickdisruptek: have the nimterop changes made life better in nimph
15:24:31FromDiscord<Yardanico> changed discord server structure a bit
15:24:33FromDiscord<Yardanico> added #rules
15:24:46disruptekshashlick: dunno; i cannot build nimph.
15:24:55shashlick?
15:25:11FromDiscord<Lantos> https://media.discordapp.net/attachments/371759389889003532/712687371111628860/unknown.png
15:25:36Yardanicowhat hex code is that?
15:25:42Yardanicoso I can chech color proximity
15:27:42FromDiscord<Lantos> https://media.discordapp.net/attachments/371759389889003532/712688006145900614/unknown.png
15:28:40FromDiscord<Lantos> #ffcb00
15:28:55*solitudesf- is now known as solitudesf
15:28:56FromDiscord<Lantos> still our yellow but just more royal with cheese
15:29:17Yardaniconah, can't use that
15:29:21Yardanico"The following 1 languages have failing color thresholds. Please modify the hex color. - Parrot (#f3ca0a) is too close to ["ffcb00", "f3ca0a"]"
15:29:44FromDiscord<Lantos> shame
15:29:46FromDiscord<willyboar> #c0b752
15:30:21FromDiscord<Lantos> whats the closes we can get just outside thesholds
15:31:14Yardanico@willyboar that one is fine but imo it's a bit too darkish
15:31:44ZevvYardanico: where can I find all these parsers of yours
15:31:45FromDiscord<willyboar> well how many projects are build with nim and js only?
15:32:14YardanicoZevv: it's not that nice but here it is https://github.com/Yardanico/nim-snippets/blob/master/pkgraph/parse.nim
15:32:24YardanicoI could've also tried to do the version stripping in npeg but I was too lazy :D
15:32:31Zevvit's like bowel surgery, it's never nice, but sometimes you need it.
15:32:41FromDiscord<Lantos> #dfb316
15:32:45Yardanicoin fetch.nim you need to do execProcesses instead of just echoing cmds
15:32:49Yardanico(yes I cloned _all_ nim repos)
15:32:55Yardanicoand pkgs.json is packages.json from packages repo
15:37:00dcmertensIs it correct to think of variant types as defining a family of structs with identical heads but differing tails?
15:37:11dcmertens(in the parlance of C, that is)
15:37:39dcmertensand this would be why "assignment to discriminant changes object branch" is an exception
15:39:00*JustASlacker quit (Ping timeout: 272 seconds)
15:39:10FromDiscord<Clyybber> dcmertens: They could have different heads, but identical tails too
15:39:14Zevvright
15:39:16Yardanicodcmertens: nim object variant is just like a union struct in C :P
15:39:17Zevvand different inbetweens
15:39:21FromDiscord<Clyybber> Its best to think of them as a part of the object being an union
15:39:25Zevvthe 'case' part is implemented by an union inside a struct
15:39:55Yardanicodcmertens: https://gist.github.com/Yardanico/495a87da26c08c441509267f98b60864
15:40:04*dcmertens reads
15:40:18Zevvdcmertens: gimme a sec
15:40:44dcmertensZevv, Yardanico has a good example
15:40:56dcmertensgot it, thanks
15:41:03ZevvMe too :) https://play.nim-lang.org/#ix=2mOs
15:41:09dcmertenshahaha
15:41:33Zevvdang are we helpful or what
15:41:53Yardanicoxd
15:42:33dcmertensawesome, thanks
15:43:18dcmertensI must say, I like that Nim provides simple facilities for "tricky" things in C
15:43:49Yardanicofor JS backend too :P
15:44:13dcmertensYardanico, I'll have to take your word for it. I know nothing about JS
15:44:29Yardanicodcmertens: I mean Nim's JS backend basically supports all nim language features (except the backend specific ones)
15:44:34Yardanicoincluding case objects of course
15:44:43Yardanicobut in JS it's simpler
15:44:54dcmertenssure, but I was saying that I've seen this union trick in C before
15:45:08Yardanicoin JS it compiles to
15:45:09Yardanico"var a_11612014 = {kind: 0, data: makeNimstrLit("hello"), test: 0, ok: 0.0};"
15:45:17Yardanicosince js doesn't have types, so it's just an object
15:45:37dcmertensWell sure, I'm not surprised that a simple JS implementation exists
15:45:59dcmertensI'm just saying that this is a somewhat common idiom in C, but sufficiently rare in my use that I never used it
15:46:09Yardanicoyeah I know it's quite common in C
15:46:11dcmertensand so I'd have to think carefully about it before trying it in C
15:46:33dcmertensnim makes it easier, so I'm more likely to use it
15:46:37alehander92i'd really compare
15:46:41alehander92case objects to ADT-s
15:47:06alehander92i know they are a bit more general in some extent, but i think that's also a good comparison
15:47:33dcmertensalehander92, right, but the nuts-and-bolts implementation of ADTs in C is defined by the programmer using bit fields or flags and union types
15:47:49alehander92yeah
15:48:09alehander92but one can have even a more haskell/rust-like ADT definition in nim e.g. with macro
15:48:31dcmertenswell, I haven't gotten to those yet. :-)
15:48:45alehander92but whatever is comfortable
15:59:30dcmertensJudging by testanything.org, it looks like nim doesn't have a module for TAP tests?
16:00:00dcmertensComing from Perl, I've come to really like TAP.
16:00:04*dcmertens puts that on to-do list
16:00:25FromDiscord<mratsim> you can even simulate a class + inheritance via ADTs + macros
16:00:41FromDiscord<mratsim> (I have one already written, super useful to avoid heap allocation)
16:01:00FromGitter<kaushalmodi> I came across an interesting user error today
16:01:20FromGitter<kaushalmodi> I have a nim wrapper that dyn links to .so separately compiled using g++
16:01:22FromGitter<kaushalmodi> and it works great
16:01:38FromGitter<kaushalmodi> the g++ compiled .so's were compiled using version 6.3.0
16:01:47dcmertensmratsim, thanks
16:01:57FromGitter<kaushalmodi> but the nim wrapper got compiled using g++ 8.4.0 by mistake
16:02:17FromGitter<kaushalmodi> and I got that "unable to find the linked .so" error
16:02:37FromGitter<kaushalmodi> can Nim improve that error in any way?
16:03:17FromGitter<kaushalmodi> just by chance it occurred that may be I should check the gcc versions used for compiling the nim wrapper vs the linked .so, and I realized that I need to used the same g++ versions on both ends
16:03:37FromDiscord<mratsim> that seems like the same error we have in unix when you try to execute a non-executable file
16:03:42FromDiscord<mratsim> "file not found"
16:03:59FromDiscord<mratsim> instead of permission error
16:04:19FromGitter<kaushalmodi> 1 min.. let me paste the exact error.. it's not that unix "file not found" error
16:04:40alehander92mratsim is right, case objects widely used in imo
16:04:50alehander92otherwise i am not sure about TAP
16:04:56alehander92i thought its a perl thing
16:05:01*s4mu3lbk quit (Ping timeout: 264 seconds)
16:05:34dcmertensalehander92, it is mostly a Perl thing
16:05:41FromGitter<kaushalmodi> @mratsim : ⏎ ⏎ ```could not load: external_lib_64.so ⏎ compile with -d:nimDebugDlOpen for more information``` [https://gitter.im/nim-lang/Nim?at=5ec555553d81ad775847b8f6]
16:05:58dcmertensbut I've really come to like it. Compact output if you want it, verbose descriptive output if you want it.
16:05:59alehander92how can it be used in nim
16:06:03alehander92with the correct output?
16:06:05FromGitter<kaushalmodi> the cause of that error was that I was building nim wrapper with g++ 8.4.0 while that external_lib_64.so was built with 6.3.0
16:06:06FromGitter<bung87> @alehander92 I add a simple analyzer to my tool.
16:06:17alehander92bung87 oh sounds good
16:06:19alehander92how does it work
16:06:35bebarkeris it possible and are there examples to overload [] (surround-fix?) for objects that behave like arrays?
16:06:37FromGitter<kaushalmodi> compiling with `-d:nimDebugDlOpen` did not help either
16:07:22Yardanicobebarker: yes it's actually quite easy
16:07:27FromGitter<bung87> it use typescript compiler , collect all symbols to a list ,then I can find closest symbol when I need
16:07:31Yardanicoproc `[]`(a: MyObj, b: idx): MyType = stuff
16:07:50Yardanicoif it's generic, do proc `[]`[T](a: MyObj[T], b: int): T = stuff
16:08:00bebarkernice, ty, Yardanico
16:08:27FromGitter<bung87> so if(a) if(isNil(a)) now is possible.
16:08:40*waleee-cl joined #nim
16:09:23FromGitter<bung87> I havenot cover all case, just done one unit test.
16:19:29alehander92hm, do those symbols come with a type bung87
16:20:50FromGitter<bung87> yes, that's why need a analyzer.
16:23:46FromGitter<bung87> I havnt test a solution do trace, node or n8, so I cant get c type.
16:26:16FromDiscord<mratsim> @bebarker a custom tensor type I created for a metaprogramming challenge against Julia: https://github.com/SimonDanisch/julia-challenge/blob/master/nim/nim_sol_mratsim.nim#L8-L68
16:26:35FromGitter<kaushalmodi> I have asked about that g++ version issue on https://forum.nim-lang.org/t/6357
16:31:39PrestigeLooking into launching external programs from my WM written in Nim - I found startProcess but I'm not sure if this is what I want. I'll have to manage the started processes and close them at some point?
16:31:53disruptekthat /is/ what you want.
16:32:13dcmertensmratsim, what was the result of the Julia Challenge?
16:32:44Prestigedisruptek: so say they open a browser and close it themselves later, I'll still have to handle that?
16:36:08*nsf quit (Quit: WeeChat 2.8)
16:39:00FromDiscord<mratsim> The result is that I've proven that yes metaprogramming is very interesting for numerical algorithm and adapt the language to a domain and provide convenient domain-like data structures seamlessly in the language
16:39:20FromDiscord<mratsim> but Julia is not the only language to provide that
16:39:32*raskol joined #nim
16:39:32*raskol quit (Quit: Lost terminal)
16:39:50FromDiscord<mratsim> which was the premise the author wanted counterexamples of: https://nextjournal.com/sdanisch/the-julia-challenge
16:40:38FromDiscord<mratsim> Also, it seems liek what the author wanted was super confusing for most, so I guess when I explain features of my code I also need to be aware of that :p
16:40:49FromDiscord<mratsim> (because it was super clear to me 😉 )
16:40:50dcmertensmratsim, I skimmed the page, I thought the author was also going for benchmarks
16:41:14FromDiscord<mratsim> benchmarks where the icing, having a matrix-like syntax was the key
16:41:47FromDiscord<mratsim> i.e. being able to do A * B and A[i, j, k] *= 10 (and broadcast 10 to the whole tensor)
16:42:12FromDiscord<mratsim> also it took me less than a day between the announce and my code 😉
16:42:29Yardanicopeople think their language is cool
16:42:32Yardanicountil they see Nim
16:44:55dcmertensmratsim, did the author ever analyze the published results according to his own winning criteria?
16:45:04FromDiscord<mratsim> Regarding speed I have a faster implementation in Laser for strided iteration (for example resulting from slicing or even reversing some dimensions)↵https://github.com/numforge/laser/blob/master/benchmarks/loop_iteration/iter_bench.nim#L141-L175
16:45:14FromDiscord<mratsim> in the PR you have comments
16:45:59FromDiscord<mratsim> in the benchmark, the 49.648 milliseconds result is the code I used for the julia challenge,↵and the 30.583ms is the code I cooked up as an improvement
16:46:26FromDiscord<mratsim> but it's way harder to follow: https://github.com/numforge/laser/blob/master/benchmarks/loop_iteration/iter05_fusedpertensor.nim#L9-L143
16:47:04*dcmertens reads the pull request
16:47:49FromDiscord<mratsim> but basically instead of having iterating on i, j, k --> feeding that to A[i, j, k] and B[i, j, k], I have each tensor maintaining their own iteration state
16:48:35FromDiscord<mratsim> so that you don't recompute i\*strideA + j\*strideA + k\*strideA
16:50:15FromDiscord<mratsim> and it improves on the syntax by reusing the "for"-loop like syntax https://github.com/numforge/laser/blob/master/benchmarks/loop_iteration/iter05_fusedpertensor.nim#L165-L167
16:50:31FromDiscord<mratsim> with any number of tensors
16:51:51shashlickmratsim - byref is on the type but the type could be used by ref or normally in procs
16:52:01shashlickhow about using var instead?
16:52:06shashlicklooking for a generic way to do this
16:52:37bebarkermratsim, ooh, thanks will definitely make a note to check that out
16:54:19FromDiscord<mratsim> @shashlick yes you can use var, just pay attention to arrays, they have weird semantics in C++
16:54:53FromDiscord<mratsim> Example to wrap the C stdlib, I needed some compat shim for C++: https://github.com/mratsim/weave/pull/150/commits/5286ca0b2060f3fdcdb9f9220bd19e8953613c45
16:56:22shashlickokay good - i know who to bother to enable C++ wrapping in nimterop
16:56:32shashlicklooks like you've dabbled around with this quite a bit
16:56:41FromDiscord<mratsim> Also one thing that might cause issue is when C++ classes are returning (mutable) references. The var return type works for trivial types but at least for arrays it's all kind of broken, it might be tricky for tuples as well
16:57:27*abm joined #nim
16:57:30FromDiscord<mratsim> I had to to use CUDA :/
16:57:57*fanta1 quit (Quit: fanta1)
16:58:38*JustASlacker joined #nim
17:02:49FromDiscord<mratsim> what are you working on @bebarker?
17:04:05bebarkermratsim, just trying to prototype a simple API for converting between immutable and mutable arrays (freeze and thaw)
17:04:20*couven92 quit (Ping timeout: 256 seconds)
17:05:23bebarkermratsim, that code you shared was already helpful, realized i need to implement []=
17:05:33*couven92 joined #nim
17:06:46*JustASlacker quit (Ping timeout: 256 seconds)
17:07:30FromDiscord<mratsim> I yes I remember using haskell vectors
17:07:58bebarkermratsim, yeah that was sort of what I had in mind, though not trying to reproduce it 100%
17:07:58FromDiscord<mratsim> here you go: https://github.com/numforge/laser/blob/master/laser/tensor/datatypes.nim#L12-L14
17:08:13FromDiscord<mratsim> and: https://github.com/numforge/laser/blob/master/laser/tensor/datatypes.nim#L104-L111
17:08:25FromDiscord<mratsim> this was to allow safe pointer accesses
17:08:50bebarkermratsim, oh and hi - thanks for your comment on github issues, just haven't had a chance to digest it all yet
17:09:04FromDiscord<mratsim> so when taking a pointer of a tensor, if it was mutable you get a RawMutablePtr with []= defined
17:09:35FromDiscord<mratsim> and if it was an immutable tensor, you get a pointer that prevents you from mutating the data
17:10:14FromDiscord<mratsim> though one thing I can't do yet is preventing the user from escaping with the pointer if the tensor was only local
17:10:36FromDiscord<mratsim> that would need some escape analysis
17:10:48FromDiscord<mratsim> i.e. t's a poor man's write tracking system: https://nim-lang.org/araq/writetracking.html
17:11:42*Vladar joined #nim
17:13:23FromDiscord<dom96> did the person that wrote the Julia Challenge ever write up a follow up to declare the winner?
17:14:22FromDiscord<mratsim> I don't think so, maybe there is a wrapup on Reddit or Hacker news or the julia forum
17:15:10FromDiscord<mratsim> for example there is a huge Nim thread on Julia forum: https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/47
17:17:27bebarkermratsim, I tried doing this, which seems to work as expected (haven't tested the last note on line 39): https://gist.github.com/bbarker/903ff7608e20bdcac09656b2803fa76c#file-makerefarray-nim-L22-L41
17:17:52bebarkernot sure of the performance implications of wrapping an array in a ref object though
17:18:30FromDiscord<mratsim> it depends, if you do that in a loop, it's bad
17:18:43*audiofile joined #nim
17:18:44FromDiscord<mratsim> if it's once before heavy processing it's the same as stack
17:18:48audiofilehello my favourite people
17:18:54FromDiscord<mratsim> hello there
17:19:00audiofile:D
17:19:04audiofilehow goes it
17:19:23FromDiscord<mratsim> good and you?
17:19:35bebarkermratsim, cool, i'll look at your code more soon as well
17:19:42audiofileawesome, im feeling pretty good about today =)
17:19:59FromDiscord<mratsim> the main question with ref array is whether you want separate copies on assignment or if you want assignement to share the same data
17:22:24*go|dfish quit (Remote host closed the connection)
17:22:47bebarkermratsim, yeah i've been thinking of that as well - a way to compose mutable operations on an array for instance
17:23:26bebarkerwell, i haven't thought about it much yet! I should say i need to think about it
17:23:41FromDiscord<mratsim> did you read about the `dup` macro?
17:23:48*go|dfish joined #nim
17:23:51*Satomi-Kowa joined #nim
17:24:11FromDiscord<mratsim> See https://nim-lang.org/blog/2020/04/03/version-120-released.html grep for "dup"
17:24:39*couven92 quit (Read error: Connection reset by peer)
17:24:40bebarkermratsim, i had the sugar page open just now and saw it when you mentioned it - nice
17:25:03*couven92 joined #nim
17:27:13*JustASlacker joined #nim
17:27:25*Jesin quit (Quit: Leaving)
17:29:50FromDiscord<mratsim> meh, the documentation of "dup" is better in the release notes
17:30:54*Jesin joined #nim
17:36:19*JustASlacker quit (Ping timeout: 260 seconds)
17:39:08*jasper_ joined #nim
17:47:33FromDiscord<Jondice> Yes, I see. I wonder if going the other way (automatically detecting where operations that sequentially modify and return a copy) could be detected in the compiler as an optimization (or is already).
17:47:36FromDiscord<Rika> 😮 bebarker on discord
17:50:06*cornfeedhobo_ joined #nim
17:50:19*cornfeedhobo quit (Ping timeout: 260 seconds)
17:50:20*cornfeedhobo_ is now known as cornfeedhobo
17:54:55FromGitter<bung87> does vscode nim has format feature? I face error for a while when I run format document command.
17:55:09FromDiscord<Rika> yes it shouldhave
17:55:12FromDiscord<Rika> (edit) 'shouldhave' => 'should have'
17:55:43FromDiscord<Rika> it only works if the nim file is valid syntactically afaik?
17:56:00FromGitter<bung87> hmm I can't remember when it becoming not avaliable.
17:56:48FromGitter<bung87> `Command 'Format Document' resulted in an error (An unknown error occurred. Please consult the log for more details.)`
17:57:06FromGitter<bung87> just note here, check it later
17:58:07*hoijui joined #nim
17:58:25*fredrikhr quit (Ping timeout: 264 seconds)
18:00:59*audiophile joined #nim
18:01:53*theelous3 joined #nim
18:04:19*audiofile quit (Ping timeout: 260 seconds)
18:04:23*neceve joined #nim
18:04:23*audiophile is now known as audiofile
18:05:22FromDiscord<Rika> holy shit i just read through more of the concepts documentation
18:05:29FromDiscord<Rika> its pretty insane this thing
18:11:23FromGitter<bung87> using concept will make me like debuger not programer.
18:13:57FromDiscord<Rika> what
18:14:56*jasper_ quit (Quit: Lost terminal)
18:15:01FromGitter<zetashift> he debugs more using concepts than actually programming because they are still experimental?
18:15:39Guest87103VM does not support 'cast' from tyPointer to tyRef
18:15:46*Guest87103 is now known as dadada
18:16:06dadadaso this happened, built my code around the wrong assumption that type casts like that are possible
18:18:03FromDiscord<Rika> no since ref is managed and casting changes merely the representation of the memory
18:18:14FromDiscord<Rika> i assume refs have more data associated to it than just pointers
18:21:04*Jesin quit (Quit: Leaving)
18:23:07*Jesin joined #nim
18:26:26FromDiscord<mratsim> you can cast ref to pointer, until it doesn't work because the GC moved memory
18:26:42*hoijui quit (Quit: Leaving)
18:26:47FromDiscord<mratsim> casting pointer to ref is wrong 😛
18:35:37FromDiscord<Clyybber> dadada: I think you don't want to cast it
18:35:42FromDiscord<Clyybber> You want to do this:
18:35:46FromDiscord<Clyybber> addr myRef[]
18:40:04*jwm224 quit (Ping timeout: 246 seconds)
18:42:06*jwm224 joined #nim
18:55:44*audiophile joined #nim
18:56:08rockcaveraIs there a reason why the net.parseIPv4Address and net.parseIPv6Address procs are not marked (*) for export?
18:59:23*audiofile quit (Ping timeout: 260 seconds)
18:59:29*audiophile is now known as audiofile
19:01:23FromDiscord<mratsim> Can we add a feature to the forum that automatically recase NIM to Nim? it burns my eyes?
19:01:47FromDiscord<dom96> lol
19:07:30leorize[m]well NIM stands for New Improved Modula 3 :P
19:07:31*couven92 quit (Read error: Connection reset by peer)
19:08:13alehander92Rika why is it insane
19:08:17leorize[m]@mratsim I might be wrong but I'm pretty sure refc don't move memory?
19:09:38FromDiscord<mratsim> they do :/ I allocated 1000 of NN layers in Arraymancer and then I realized that somehow when going back to the parent (which were ptr casted from ref) somehow I ended up skipping a lot of layers
19:09:51FromDiscord<mratsim> and when I changed the ptr back to ref, it was fixed
19:09:59FromDiscord<Rika> alehander insane as in "crazy powerful"
19:11:00FromDiscord<mratsim> so i had to rollback this change: https://github.com/mratsim/Arraymancer/pull/180/commits/e892715f5473a35b6fdde9a84e2936fa08e0b59c
19:11:02disbotAutograd no cyclic strong ref
19:11:46*fredrikhr joined #nim
19:12:03FromDiscord<mratsim> there: https://github.com/mratsim/Arraymancer/pull/329/commits/30749e58a0c8fb4d933d2be6e448b2b5dbe1bdf1
19:12:07disbotShakespeare text generator + numerous fixes
19:12:32*couven92 joined #nim
19:12:38Araqmratsim: no GC that Nim uses moves memory around. but too early reclamation and use-after-free can maybe make you think that it does
19:13:24Araqhowever, assuming a moving GC is good for hygiene
19:13:29FromDiscord<mratsim> that's strange because it was a DAG and the parent couldn't be reclaimed before the children was reclaimed
19:15:32FromDiscord<mratsim> anyway, yes I just assume a moving GC
19:16:42*dcmertens quit (Quit: Leaving)
19:17:15*liblq-dev quit (Quit: WeeChat 2.8)
19:27:35*natrys joined #nim
19:29:21FromDiscord<Clyybber> dadada: Did it work?
19:35:59*FromDiscord quit (Remote host closed the connection)
19:36:12*FromDiscord joined #nim
19:46:05FromGitter<bung87> when choose proc as inline?
19:52:32leorize[m]when it's small
19:53:10Yardanico@bung87 you only really need to think about inlining if you really care about performance and already did the profiling :)
19:53:19YardanicoC compiler itself can do some inlining automatically if deemed neccesary
19:54:01Yardanicothe way inline pragma works is that it duplicates the proc body in each c file where it's called so that the C compiler fill (almost surely) inline it
19:54:03FromGitter<bung87> if call multiple times make code larger
19:54:30FromGitter<bung87> so main purpose is reduce the call routes?
19:54:40Yardanicothe main purpose is make the performance better
19:54:45Yardanicono function call overhead
19:55:37FromGitter<bung87> ok, then I choose no extro pragma , make code simple clean
19:56:14leorize[m]the main purpose of the `{.inline.}` pragma in Nim is so that the code can be inlined across modules
19:56:15Yardanicoyeah for most code out there you don't really need to care about that pragma :P
19:57:35*lritter joined #nim
19:57:46FromGitter<kaushalmodi> Is there a need for a `getVersion` proc?: http://ix.io/2mQa/nim
19:58:01FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec58bc93d81ad77584854e4]
19:58:39FromGitter<kaushalmodi> If someone is interested, they can help me make it a bit more robust.. support across different apps
19:59:52FromGitter<bung87> leorize in that case the proc not emit any code in the module where it is?
20:00:22*Vladar quit (Quit: Leaving)
20:02:01FromGitter<bung87> I think I can create new PR now, thank your both nice explanation
20:22:28FromDiscord<mratsim> the inline pragma is easy:↵- you profiled that inline gives better performance↵- the resulting file size is acceptable (you can check with Google bloaty)
20:23:11Yardanicogoogle bloaty? hmm
20:23:17FromDiscord<mratsim> in general functions that are less than 3 lines of code always benefits from inlining because making a function call also requires moving parameters
20:23:37FromDiscord<mratsim> literally Google BLoaty: https://github.com/google/bloaty
20:23:41Yardanicoyeah I found it :)
20:24:32FromDiscord<willyboar> @Yardanico does 1.2.2 containing asynchttpserver fix?
20:24:41Yardanico@willyboar it should for sure
20:24:49Yardanicolemme check
20:26:14Yardanicoyeah it's in 1.2
20:26:18Yardanicohttps://github.com/nim-lang/Nim/commit/c4dfdb71f4d2b1b9bd284fd58464524917d32718
20:26:31YardanicoI mean backported to 1.2 branch so it will be in 1.2.2
20:26:42FromDiscord<willyboar> nice
20:27:15narimiranspeaking of which, 1.2.2-beta is out and ready for y'all to test it: https://github.com/nim-lang/nightlies/releases/tag/2020-05-20-version-1-2-7800fa3
20:27:33Yardaniconarimiran: I already put it into announcements on discord btw :)
20:28:10FromDiscord<Elegant Beef> Is there some way of doing this? https://play.nim-lang.org/#ix=2mQj
20:28:17FromDiscord<Elegant Beef> Or do i just use a seq of procs?
20:28:48Yardanicojust use a seq of procs
20:28:56Yardanicoi mean what other way would there be? :P
20:29:16FromDiscord<Elegant Beef> Idk there could've been a type i didnt know about in one of the modules 😄
20:29:19Yardanico@willyboar for all commits in 1.2.2 you can use this https://github.com/nim-lang/Nim/compare/7e83adff84be5d0c401a213eccb61e321a3fb1ff...7800fa394f26e9a5a6cb30964ba005512199be58
20:29:30Yardanicodiff between 1.2 and 1.2.2
20:30:36*Satomi-Kowa quit (Ping timeout: 256 seconds)
20:50:23FromDiscord<willyboar> thank you
20:50:42Yardanicodevel had much more interesting stuff than 1.2.2 btw :)
20:54:07*nimskull joined #nim
20:57:39nimskullI'm coming to nim from a python/numpy experience. I am trying to do some basic geometry stuff (hopefully faster than python). For starters I'm trying to make a random nx3 matrix and calculate the euclidean norm... I can do this with seq[array[3, float]], and if I fix n I can use an arraymancer Tensor. But how do I make a procedure that is flexible
20:57:40nimskullwrt n?
20:59:20PMunchDepends on how flexible you want it
20:59:47PMunchYou can make it generic which means it will still be an array of static size, but you can call the procedure with different sized arrays
20:59:49FromDiscord<Technisha Circuit> Nice https://media.discordapp.net/attachments/371759389889003532/712771586809397298/Screenshot_20200520_215942.jpg
21:00:09FromDiscord<Technisha Circuit> Nice makeover
21:00:27Yardanicoyeah @Lantos proposed something like that
21:00:34FromDiscord<Technisha Circuit> So how would i make an android app in Nim?
21:00:38*narimiran quit (Ping timeout: 256 seconds)
21:00:42Yardanicosdl2
21:00:57FromDiscord<Technisha Circuit> Any simple lib for it then?
21:01:18FromDiscord<Technisha Circuit> (@codic i don't have to manually interface with Java like you said(
21:01:20nimskullwhat would that look like PMunch? proc [N] randnorm(): array[N, float) =
21:01:23FromDiscord<Technisha Circuit> (edit) 'said(' => 'said)'
21:01:33*samuelb joined #nim
21:01:35nimskullwould that be the proc signature (is that the nim word for that even)
21:02:14*s4mu3lbk joined #nim
21:03:04*samuelb left #nim (#nim)
21:03:34*samuelb joined #nim
21:03:38*samuelb left #nim (#nim)
21:03:52PMunchnimskull, yeah we call it the signature :) And almost it would be `proc randnorm[N: static[int]](): array[N, float]
21:04:00PMunch`
21:04:13PMunchThat would only be 1 dimension though
21:05:35nimskulland I can refer to that N within the scope of the proc?
21:05:43PMunch@Technisha Circuit, an approach like this could work: https://github.com/cnlohr/rawdrawandroid
21:05:46PMunchnimskull, yes
21:06:14FromDiscord<Technisha Circuit> Nice
21:06:17PMunchAnd since it's `static` (meaning it's compile-time) you can use `when N > 3:` for example instead of if
21:06:27PMunchAnd those branches will get evaluated at compile-time
21:07:50nimskullthank you very much PMunch
21:08:51FromGitter<bung87> does seq[byte] more closer to the blob word ?
21:09:08Yardanicostring is a sequence of bytes too
21:09:22FromGitter<bung87> `if SQLITE_OK != ps.bindBlob(idx,cast[ptr seq[byte]](v.getPointer)):`
21:09:30Yardanicouh
21:09:35Zevvsequence of characters, techincally
21:09:36FromGitter<bung87> I am doing db string, not sure which one is good
21:09:42PMunchnimskull, no problem
21:09:46Yardanico@bung87 what's the C definition of bindBlob ?
21:10:08PMunchbung87, that very likely won't work..
21:10:22YardanicoI'd suggest you to use an UncheckedArray[char] here
21:10:22FromGitter<bung87> oh it only need pointer
21:10:48PMunchA seq[byte] is essentialy a length: int, capacity: int, data: ptr T
21:11:17PMunchUncheckedArray on the other hand might work
21:11:31FromGitter<bung87> hmm, oh yes, that's the problem
21:13:21FromDiscord<mratsim> seq[byte] for binary blobs yes
21:13:41FromDiscord<mratsim> UncheckedArray[byte] if you are interfacing with a void *
21:13:53FromDiscord<mratsim> or a char * of non-ASCII
21:13:55FromDiscord<Elegant Beef> Now to seem like a complete idiot, how does one pass a proc to a macro as the proc and not a AST?
21:14:09FromDiscord<mratsim> everything in a macro is AST
21:14:22FromGitter<bung87> I just try using `UncheckedArray[char] `
21:14:29FromDiscord<Elegant Beef> the docs clearly state static works for primitives
21:15:00FromGitter<bung87> first I cant get it from Any time, second I can't get its len..
21:15:08FromDiscord<mratsim> byte and char are physically equivalent but semantically distinct
21:15:10FromGitter<bung87> `Any` type
21:15:15Yardanico@bung87 you get len from the C side usually
21:15:16lqdev[m]@bung87 use `ptr UncheckedArray[char]`, just using UncheckedArray doesn't work afaik
21:15:18FromDiscord<mratsim> Any shouldn't be used
21:15:24YardanicobindBlob should return a length too
21:15:42FromDiscord<mratsim> @Elegant Beef what do you want to do with this proc?
21:15:52FromGitter<bung87> but the c binding need prefill a len param.
21:15:52FromDiscord<Elegant Beef> make an enum,proc LUT
21:16:09Yardanico@bung87 which C function are you calling?
21:16:28Yardanicoint sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); ?
21:16:29FromGitter<bung87> sqlite3_bind_blob
21:16:30FromDiscord<mratsim> and this LUT is compile-time or runtime?
21:16:39FromDiscord<Elegant Beef> It's for runtime
21:16:55FromDiscord<mratsim> but constructed at compile-time?
21:16:59FromDiscord<Elegant Beef> that's the goal
21:17:23PMunchSo just take the name of the proc as AST and output that in you LUT?
21:17:25FromDiscord<Elegant Beef> I've made a lut like this before but that was for a int, Typedesc
21:18:12FromDiscord<mratsim> here you go: https://github.com/status-im/nimbus/blob/master/nimbus/vm/interpreter/gas_costs.nim#L455
21:18:36FromDiscord<mratsim> ah mayb not exactly
21:19:05FromDiscord<mratsim> but it's not too hard, the first requirement is that all procs have the same signature
21:19:10FromGitter<bung87> `seq[char]` seems more closer
21:19:13FromDiscord<mratsim> or you will need to cast them
21:19:15FromGitter<kaushalmodi> what would be an strscans pattern for the regex `v?[0-9]+\.[0-9]+\.[0-9]+`?
21:19:15FromDiscord<Elegant Beef> Yea that's clear
21:20:01FromDiscord<Elegant Beef> How does the name of the proc from the AST help pmunch?
21:20:06FromGitter<kaushalmodi> is there an optional match pattern in strscans?
21:21:17Yardanico@kaushalmodi well you can implement your own matches in strscans, they also have scanp macro
21:21:23Yardanicoand what is that regex supposed to mean? :P
21:21:43*solitudesf quit (Ping timeout: 260 seconds)
21:21:50FromGitter<kaushalmodi> Yardanico: matches "v1.1.1" or "1.1.1" as an example
21:21:51PMunch@Elegant beef, isn't that what you want to return?
21:21:52FromDiscord<mratsim> sent a code paste, see http://ix.io/2mQB
21:22:13FromGitter<kaushalmodi> Yardanico: Looks like I need to learn the scanp syntax.. will have a look
21:22:47FromDiscord<Elegant Beef> I mean i want to be able to call the proc so i just assume the name doesnt help 😄
21:22:50FromDiscord<mratsim> and the table can be a simple array
21:22:59*marquisdefalbala quit (Quit: Konversation terminated!)
21:23:20FromDiscord<mratsim> is that clear enough or o you need a runnable example?
21:23:21FromDiscord<Elegant Beef> Yea i know it could be sized of the enum values and just convert to int
21:23:22PMunchYardanico, zero or one 'v' followed by one or more characters in the range 0-9, followed by a literal dot, a new group of digits, another literal dot, and another group of digits
21:24:08PMunch@Elegant beef, well it's not so much the name and more the identifier. You can simply generate a nnkCall with that as the first argument and you're fine
21:24:21PMunchIt's not the name as a string or anything
21:24:22FromDiscord<mratsim> AFAIk it's just a dispatch
21:24:26FromDiscord<mratsim> there is no generation to do
21:24:41FromGitter<kaushalmodi> the PEG thing looks crazy complicated.. will have to put it off for another day
21:25:38Yardanicotry npeg
21:28:37FromDiscord<Elegant Beef> Ok so i guess i do need a runnable example since i dont see how to convert routine to the proc required
21:29:19FromDiscord<mratsim> lol I managed to crash the C compiler: https://play.nim-lang.org/#ix=2mQE
21:29:32Yardanicowhich version ? :D
21:29:45Yardanicoor you mean you got the codegen error?
21:30:25FromDiscord<mratsim> here you go: https://play.nim-lang.org/#ix=2mQE
21:30:30FromGitter<kaushalmodi> Yardanico: npeg has its own syntax.. :)
21:30:36Yardanico@kaushalmodi it's not that hard
21:30:39Yardanicoand the readme is really good
21:30:41FromDiscord<mratsim> https://play.nim-lang.org/#ix=2mQG
21:30:49FromDiscord<mratsim> you don't even need macro
21:30:58FromGitter<bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ec5a1913be96c0df995b081]
21:31:39FromDiscord<mratsim> @Elegant Beef is that more clear?
21:31:46FromGitter<bung87> I ' ll test it now.
21:32:32FromDiscord<Elegant Beef> Yea
21:32:46FromDiscord<Elegant Beef> *does having a return type fuck with this?*'
21:33:08FromDiscord<mratsim> the const Foo = static(FooCT) solves issues with object variants and tables.
21:33:11FromDiscord<mratsim> no it doesn't
21:34:03FromDiscord<Elegant Beef> `type mismatch: got <None> but expected 'proc (): Level'`
21:34:04FromDiscord<Elegant Beef> Hmm
21:34:38FromDiscord<mratsim> all same return type?
21:34:59nimskulldoes anyone here have a recommendation for a plotting tool? I've seen some suggestions for nim-plotly
21:35:09FromDiscord<Elegant Beef> Yea
21:35:10Yardanicoggplotnim - nim-native
21:35:15Yardaniconim-plotly - with plotly
21:35:29nimskulldoes discord see IRC or is it a one-way mirror
21:35:40Yardanicolol
21:35:43Yardanicowe see each other :)
21:35:46Yardanico!status
21:35:46FromDiscordUptime - 1 hour, 59 minutes, 45 seconds, 556 milliseconds, 981 microseconds, and 210 nanoseconds
21:35:47FromDiscord<Elegant Beef> Nah i cant see it
21:35:52FromDiscord<mratsim> I don't want to see Yardanico
21:37:26FromDiscord<mratsim> otherwise Arraymancer has a rudimentary plotting tool for debugging https://github.com/mratsim/Arraymancer/blob/master/tools/visualize_tensor_csv.py see https://github.com/mratsim/Arraymancer/pull/205
21:37:28disbotTensor csv export
21:38:02PMunch@Elegant Beef: https://play.nim-lang.org/#ix=2mQJ
21:38:57FromDiscord<speckledlemon> @mratsim If I'd like to contribute to <https://github.com/mratsim/Arraymancer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aeasy> again, is there a particular issue of interest?
21:39:03FromDiscord<Elegant Beef> I want modules to subscribe a function to a LUT so that doesnt exactly solve my issue
21:39:59PMunch@Elegent Beef, with return type: https://play.nim-lang.org/#ix=2mQL
21:40:36PMunch(Note that this depends on implicit return since it doesn't use `return`)
21:41:58FromDiscord<mratsim> @Elegant Beef can you post the return type bug you are stuck with?
21:43:00FromDiscord<Elegant Beef> https://hatebin.com/zvhssljsyz
21:43:46FromDiscord<Elegant Beef> Is it cause it's a getter and this val doesnt exist at compile time?
21:46:10FromDiscord<mratsim> @speckledlemon the Conv2D one is probably the easiest to get started with and test: https://github.com/mratsim/Arraymancer/issues/288
21:46:12disbot[NN DSL] Convolution not taking account custom strides
21:46:28FromDiscord<speckledlemon> cool, thank you
21:46:46FromDiscord<mratsim> if you like front end, this is something I don't do well at all: https://github.com/mratsim/Arraymancer/issues/169
21:46:48disbot[Docs, CSS FrontEnd, Responsive] Improve drop-down menu on small width
21:47:36FromDiscord<mratsim> ah it may not be that easy, you need some macro knowledge
21:47:53FromDiscord<speckledlemon> I do computational science and cannot design anything
21:48:03FromDiscord<mratsim> lol OK
21:48:16FromDiscord<speckledlemon> and have only done simple templates, no full-blown macros
21:48:19FromDiscord<mratsim> actually it's really easy
21:48:31FromDiscord<mratsim> hint, it should be a one-line change here: https://github.com/mratsim/Arraymancer/blob/master/src/nn_dsl/dsl_forwardsugar.nim#L13
21:48:58FromDiscord<speckledlemon> ok
21:49:49FromDiscord<mratsim> otherwise you can always add new stuff that you find useful
21:50:13FromDiscord<mratsim> in general things related to Numpy, Scipy or scikit learn are OK
21:50:38FromDiscord<mratsim> and there is the SciNim gitter if you want to discuss with the other science people in the Nim community
21:50:51FromDiscord<mratsim> @Yardanico maybe we can add a bridge to SciNim?
21:51:19FromDiscord<mratsim> https://gitter.im/SciNim/community
21:51:36Yardanicowell FromGitter isn't mine :D
21:51:49FromDiscord<mratsim> add Gitter support :p
21:52:00*audiophile joined #nim
21:52:37FromDiscord<speckledlemon> I was trying to do a very simple autograd example to compare against Python libs (outside the context of a network or training anything) and just could not figure it out in a reasonable amount of time...might revisit that at some point
21:54:51*audiofile quit (Ping timeout: 260 seconds)
21:54:54*audiophile is now known as audiofile
21:55:02Yardanico@mratsim well yeah I already had the idea to try to add gitter to ircord :P
21:59:50*jwm224 quit (Ping timeout: 260 seconds)
22:00:46*clemens3 quit (Read error: No route to host)
22:01:36*neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
22:02:04*neceve joined #nim
22:02:49*jwm224 joined #nim
22:07:06*lritter quit (Quit: Leaving)
22:07:34FromDiscord<Elegant Beef> So weirdly doing `fileName.getLevel` resolved my issue
22:07:56FromDiscord<Elegant Beef> Even though the only other getLevel has the same exact signature
22:08:00*jwm224 quit (Ping timeout: 256 seconds)
22:08:05FromDiscord<Elegant Beef> Thanks @mratsim
22:08:46dadadaClyybber: no, I need to cast something first to a pointer, and then back to a ref... to store values of different types in one data structure
22:09:05FromDiscord<mratsim> @speckledlemon that was my first project in Nim actually: https://github.com/mratsim/nim-rmad
22:09:10*jwm224 joined #nim
22:09:13dadadaClyybber: it does work at runtime, not at compiletime
22:09:50FromDiscord<mratsim> basically I was learning NN through this JS tutorial, but doing it in Nim: https://karpathy.github.io/neuralnets/
22:10:09FromDiscord<mratsim> and then when I had 40 lines of gradient, I just gave up on the tutorial and did an autograd
22:10:32FromDiscord<speckledlemon> I should have clarified, I was trying to use autograd in Arraymancer...couldn't figure out the context stuff
22:10:39FromDiscord<mratsim> ah
22:10:55FromDiscord<mratsim> context is just some place that records operations
22:11:24FromDiscord<mratsim> it's a blackbox
22:11:26FromDiscord<mratsim> see https://github.com/mratsim/Arraymancer/blob/master/examples/ex03_simple_two_layers.nim#L17-L33
22:11:28FromDiscord<Clyybber> dadada: What do you cast to a pointer?
22:11:52dadadaClyybber: ref object, but could also be NimNode to be honest
22:11:58*neceve quit (Ping timeout: 256 seconds)
22:12:01dadadabasically anything :D
22:13:03FromDiscord<Clyybber> Hmm, casting a ref to a pointer and back is not a good idea in general though
22:13:21FromDiscord<Clyybber> Since when you don't guarantee that the ref isn't going to die in between
22:13:24FromDiscord<Clyybber> its unsafe
22:13:32FromDiscord<speckledlemon> hm, quite a simple example. I can't remember exactly what my confusion was other than it seemed as though I needed to define a network
22:13:35FromGitter<bung87> `Error: unhandled exception: value out of range: 3 notin -2147483648 .. 2147483647 [RangeError]`
22:13:54FromGitter<bung87> how does this happened?
22:15:10FromDiscord<Clyybber> bung87: Not sure, but there was a csize bug about that
22:15:15FromDiscord<Clyybber> You should report it if possible
22:15:26FromDiscord<Clyybber> But try on devel first if possible
22:16:01FromGitter<bung87> hmm, I cant narrow the problem where is.
22:18:02*abm quit (Quit: Leaving)
22:18:34dadadayeah, I've thought of that, what happens if I cast a Object[T] where t is string to a Object[T] where T is int, and then recast it to Object[T] where T is string, will it 1) work and will the string value still be the same as originally? ... I assume this will not even compile/work... but I'm grasping for solutions
22:18:39dadada@ clyybber
22:19:10nimskullI'm trying to make a flexible 2D array with default dimensions. I can use [M = 3, N: static[int]] as a generic type. I thought M was being explicitly given the static[int] type but when I changed to M=3, N=10: static[int] the compiler complained "expected ']', but got: ':'"
22:19:18dadadabasically I've a list of Object[T] and I do not want a separate list for each type T can be
22:19:34nimskullin the original version, is M being given the static[int] type implicitly, or some other type the compiler infers?
22:19:58nimskullif I remove the ': static[int]' from the second, what types are inferred?
22:20:36FromGitter<bung87> `val.len.int32` val is a cstring ,this causes
22:20:46FromDiscord<Clyybber> dadada: Its a bad idea
22:20:59FromDiscord<Clyybber> dadada: And will not work with gc:arc
22:21:00FromDiscord<mratsim> @nimskull, it's pretty old but this is the codebase i used as reference when learning Nim: https://github.com/unicredit/linear-algebra/blob/master/linalg/private/types.nim#L14-L23
22:21:34FromDiscord<mratsim> (and yes it's from the biggest Italian bank ;))
22:21:49FromDiscord<Clyybber> dadada: Its likely to fail with the GC too, since the refcount of the string will change to 0 and it will get collected
22:21:50nimskull@mratsim I don't immediately see any default generic types...
22:21:53FromGitter<kaushalmodi> toy project of the day: https://github.com/kaushalmodi/get_version
22:22:14FromDiscord<Elegant Beef> Is it possible to import all nim files in a directory?
22:22:25FromDiscord<mratsim> ah no, you can't have default generic
22:22:41Yardanico@Elegant yes
22:22:42nimskull@mratsim: it compiles...
22:22:42Yardanicowith a macro
22:22:44FromDiscord<Clyybber> dadada: If you want to do a kind of duck typing, I think its a better idea to generate case objects, or cast the address of what you want to use to a pointer.
22:22:50FromDiscord<Elegant Beef> Ah
22:22:53FromDiscord<mratsim> @speckledlemon you can have a context without a network, the network were added after, but it's quite tedious to use
22:23:14FromGitter<bung87> I insert blob to sqlite memory db, when I get back the value the repr second part inconstant , is it right?
22:23:31FromDiscord<mratsim> before: https://github.com/mratsim/Arraymancer/blob/master/benchmarks/ex01_xor.nim#L17-L25, after: https://github.com/mratsim/Arraymancer/blob/master/benchmarks/ex01_xor_dsl.nim#L17-L23
22:23:51Yardanico@Elegant actually I found my macro
22:23:53Yardanicofrom my old project
22:23:55PMunchmratsim, wait, are you telling me that the bank UniCredit uses Nim?
22:24:03FromDiscord<Elegant Beef> Ah nice i was just about to start on mine 😄
22:24:37FromDiscord<mratsim> @PMunch you would have to ask Andrea Ferretti about that
22:24:37FromDiscord<Elegant Beef> It
22:24:43FromDiscord<Elegant Beef> (edit) 'It' => 'It's super simple'
22:24:45FromDiscord<Elegant Beef> Which is nice
22:24:50dadadaClyybber: if I could cast this pointer back so that I could use it again like the original object, it would be fine, but this is exactly what I can't do in Nimscript, or my code was wrong, but it worked at runtime is all I can say, ..., for the most part I love Nim, really love it, but then things like this that should be simple are seemingly impossible
22:25:35PMunchdadada, there aren't pointers in NimScript..
22:25:46FromDiscord<Clyybber> dadada: What you want to do is cast ptr T to pointer to ptr A and so on
22:25:57FromDiscord<Clyybber> But yeah may not work at compile time
22:25:58Yardanico@Elegant I just quickly translated comments into english, you'll have to adapt to your own project https://gist.github.com/Yardanico/60e3de6af76ee70d6023e1f6256fdf6b
22:26:01FromDiscord<Clyybber> Maybe it does tho
22:26:14FromDiscord<Clyybber> pointer support at compile time has gotten better
22:26:24Yardanicoand then you call that macro
22:26:29PMunchOh, are there actually pointers on compile-time now?
22:26:29Yardanicoin the place where you want to import all files
22:26:31FromDiscord<Elegant Beef> Yea i got it
22:26:32YardanicoPMunch: yep
22:26:41PMunchHuh, TMYK
22:26:45FromDiscord<Elegant Beef> *I know how macros work* when dealing with the AST
22:27:08PMunch@Elegant Beef, "I know how macros work" that's a bold statement :P
22:27:11FromDiscord<Elegant Beef> Eh i think i might just make my own that takes a str to path
22:27:16dadadaClyybber: ah, thanks for the clue, I'll try that
22:27:22FromDiscord<Elegant Beef> Hey i have constructor doneish so that makes me an expert!
22:27:27FromDiscord<Elegant Beef> (edit) 'expert!' => 'expertish!'
22:27:29PMunchdadada, what are you trying to do?
22:28:27dadadaPMunch: storing Object[T] for all types T can be in a common datastructure
22:28:43PMunchAnd by the way for you comment "for the most part I love Nim [...] but then things like this that should be possible are seemingly impossible", remember that most languages can barely do anything at compile-time :P
22:29:05PMunchdadada, ah that is indeed a bit tricky
22:29:13PMunchSimply because Object[T] can have different lengths
22:29:20FromDiscord<Elegant Beef> For the most part i love nim but the lack of official tab support is absurd 😛
22:29:37dadadaPMunch: you're absolutely right! I just sometimes hit a hard wall (like now), and it sucks especially if you were productive in the days before that
22:30:03PMunchSo you either need to use an invariant object (which will always be the biggest possible size), or you need to use pointers and rely on some runtime logic to figure out what to cast them to.
22:30:45dadadawell, I had that runtime logic, but it still failed at compile time, while it worked at runtime ,,,
22:31:08dadadaI'll now try to use the tricks of casting from casts to casts that Clyybber mentioned
22:31:13PMunchdadada, for sure, I've been there. Everything seems to go fine then bam! But it gets easier the more you get used to it. And it always reminds me that I'm actually pretty close to hardware in Nim, which is what a lot of these "hard" things stem from.
22:31:16Yardanico@Elegant I also did a really simple logging implementation I used in that project
22:31:17Yardanicohttps://gist.github.com/Yardanico/61c1d7bd2cf59ceeff872b9803c44343
22:31:36nimskullwell! it accepts the definition, and you can use the procedure if you specify the value, but the default values don't work: https://play.nim-lang.org/#ix=2mRa
22:32:08nimskullactually you can specify the values, but they're ignored!! this is not good
22:32:11PMunchHmm, I wish there was an easier way to define an invariant object for T
22:32:21PMunchInstead of having to list all the cases manually
22:32:49PMunchHave Nim build the invariant object based on whichever types it required, similar to how generic procedures work.
22:33:06dadadaPMunch: that's if you have cases, but what if if you want to allow for any possible T...
22:33:09PMunchBut I guess that would require runtime type information..
22:33:22PMunchdadada, yeah I know
22:36:37FromDiscord<mratsim> "pointer at compile-time" wait what?
22:36:45Yardanico yes
22:36:52Yardanicohttps://nim-lang.org/docs/nims.html
22:36:57Yardanico"ptr operations are are hard to emulate with the symbolic representation the VM uses. They are available and tested extensively but there are bugs left."
22:37:11FromDiscord<mratsim> @nimskull, the fact that default are accepted is probably a bug, there is not even default for classic types
22:37:12Yardanico"ref ref int" wouldn't work tho
22:38:08FromDiscord<mratsim> if you want to do a default generic do it like this↵proc newMatrix(M: static int = 3, N: static int = 3): Matrix[M, N]
22:38:31FromDiscord<mratsim> or initMatrix if those are value types
22:38:37FromDiscord<mratsim> (Nim convention)
22:39:25*NimBot joined #nim
22:42:07FromDiscord<mratsim> you're trying to cast a string ...
22:42:16FromDiscord<mratsim> even at runtime that's sketchy
22:42:24FromDiscord<Elegant Beef> Well yard i just hardcoded the path cause it's just for levels and fuck people with different organization to mine
22:43:36FromDiscord<Elegant Beef> Toyed around with nico a bit and found the that you'd have to do levels appalling so cleaned it up so each level can be it's own self contained logic, and doesnt use a hideously large main file
22:44:15PMunch@mratsim, sure, but at least on runtime it works
22:44:55PMunchAnd it's actually the line with the int that fails
22:45:08PMunchChanging it to a more basic type yields the same error: https://play.nim-lang.org/#ix=2mRe
22:45:44PMunch@Elegant Beef, reminds me of a gamejam I did in Nim. I think the entire game was just one long file :P
22:45:53FromDiscord<Elegant Beef> Yea i dont like that one bit
22:45:59FromDiscord<Elegant Beef> My main file is 36 lines of code now
22:46:32FromDiscord<Elegant Beef> There is a "scene manager" which basically just a level which is the init,update, and draw procs
22:46:37FromDiscord<Elegant Beef> It's so much nicer to look at imo
22:47:13PMunchOh don't get me wrong, I don't like it either :P
22:47:22PMunchBut it's only so much you can do in 48 hours..
22:47:25PMunchhttps://github.com/PMunch/TromsoGameJam2017/blob/master/src/sgtest.nim
22:47:31PMunchThe file is even called test -_-
22:47:32FromDiscord<Elegant Beef> Yea i get it
22:48:16PMunchFavourite part has to be this: https://github.com/PMunch/TromsoGameJam2017/blob/master/src/sgtest.nim#L305
22:49:06FromDiscord<Elegant Beef> oh god
22:49:08FromDiscord<Elegant Beef> https://github.com/beef331/nico-helper/blob/master/src/levels/title.nim
22:49:11FromDiscord<Elegant Beef> Look at that though
22:49:13FromDiscord<Elegant Beef> It's beautiful
22:49:14PMunchThat line is 1276 characters long, and is a formula for calculating where the middle point of a cable with slack in it would be :P
22:49:36Yardanicojesuis
22:49:48PMunchThat is actually pretty beautiful
22:50:18FromDiscord<Elegant Beef> Well im actually debating using nico so really wanted to make it maintainable
22:50:24PMunch(by the way, that formula was basically me setting up some formulas and passing it through WolframAlpha to solve for y)
22:50:26FromDiscord<Elegant Beef> Default nico is like fuck you and maintainabllity 😄
22:51:11PMunchMan.. It's been way to long since I've done a gamejam..
22:51:36PMunch2017...
22:51:38FromDiscord<Elegant Beef> I did one not too long ago and continue to delay polishing it further
22:51:45FromDiscord<Elegant Beef> I've done quite a bit
22:51:55PMunchOh yeah, I always do that
22:52:07*jwm224 quit (Quit: WeeChat 2.9-dev)
22:52:10FromDiscord<Elegant Beef> <https://jbeetham.itch.io/cords> one in question
22:52:17PMunchCome out of it thinking "with a bit of polish this would actually be a pretty good game", then years later *crickets*
22:52:30FromDiscord<Elegant Beef> I mean i've polished a bit
22:52:31nimskullwhat is nico?
22:52:38FromDiscord<Elegant Beef> pico but for nim
22:52:46FromDiscord<Elegant Beef> Basically best way to describe it
22:52:50nimskullpico the editor?
22:52:53FromDiscord<Elegant Beef> pico8
22:52:58FromDiscord<Elegant Beef> The fantasy retro console
22:53:12FromDiscord<Elegant Beef> Nico isnt locked down as much as nico which is nice
22:53:16FromDiscord<Elegant Beef> You arent locked to 128x128
22:53:28FromDiscord<Elegant Beef> *atleast i think pico is locked*
22:53:38FromDiscord<Elegant Beef> (edit) 'nico' => 'pico'
22:53:41*jwm224 joined #nim
22:54:11nimskullyou're lucky nim is case sensitive to first character or that would be ambiguous
22:54:40FromDiscord<Elegant Beef> what?
22:54:41PMunchAraq, didn't you say this was a regression? https://github.com/nim-lang/Nim/commit/6b39b47abcf5c528dbaf84ca75b693d1fc4da004
22:54:55PMunchOr is that just a fix to patch it over until the regression is fixed?
22:55:09FromDiscord<Elegant Beef> Hell pmunch i started on a unity build system in nim over polishing cords
22:55:13FromDiscord<Elegant Beef> It's comical 😄
22:55:38FromDiscord<Elegant Beef> But hey i can now make desktop builds async so it's like <1min for 3 builds
22:55:45FromDiscord<Elegant Beef> Instead of doing them one by one
22:55:55*gxt joined #nim
22:56:41PMunchHaha, I had to go to the bottom of page 2 of my repositories to even find the code for that project..
22:56:53PMunchSo it's not like I've done nothing for the past 3 years :P
22:57:30PMunchnimskull, he's on Discord so for him that was just an edit
22:57:44PMunchHe doesn't see the (edit) 'nico' => 'pico' bit
22:58:01nimskullconfusing
22:58:22PMunchWelcome to the world of bridges
22:58:36PMunchWere everyone can talk to each other, but there is still a river of abstraction between us
22:58:53nimskull(edit) 'Were' => 'Where'
22:59:01dadadait annoys me to no end that the terminal in vscode disappears when going back into the source code, and there seems to be no setting for it
22:59:04PMunchHaha :P
22:59:10dadadaor I'm blind
22:59:23PMunchdadada, that laugh wasn't meant for you by the way :P
22:59:42PMunchJoin the dark side, use a terminal editor :)
22:59:44dadadaPMunch: I'm glad you clarified, but I still felt like it was deserved
23:00:03Yardanicodadada: ctrl+`
23:00:26Yardanico` is backtick (the key where you have ` and ~)
23:00:30nimskullI can't use my terminal IRC here because XftOpenFont breaks on the crown in the title
23:00:35PMunchCtrl+Z to send the editor to the background, boom terminal. Done with the terminal? Write fg<enter> and boom you're right back where you left off in your editor.
23:01:07PMunchYardanico, I hate ` as a shortcut key with passion..
23:01:12Yardanicoyou can change it
23:01:16PMunchI know
23:01:17PMunchBut still
23:01:18dadadaYardanico: what's supposed to happen there? nothing here
23:01:23Yardanicodadada: termina will open
23:02:25PMunchHmm, maybe I should write a "Why I use terminal editors" article..
23:02:41dadadaYardanico: ah, ctrl+shift+` works!
23:02:46Yardanicohuh
23:02:50Yardanicoi think you can rebind it
23:06:51nimskullthe arraymancer documentation has a really annoyingly sensitive menu that I can't even access all of
23:09:11PMunchIs there anything special I should do to speed up embedded NimScript speed?
23:09:51PMunchWith "-d:release -d:danger --gc:markandsweep" a simple echo "Hello from NimScript" is 10x slower than Python.
23:10:04PMunchGranted, Python has a lot more optimisation going on that NimScript
23:10:07PMunchBut still, 10x?
23:10:20nimskullhow to fill an arraymancer tensor with rand(1.0)? I can loop over each dimension but surely there's a better way
23:10:27Yardanicohmm
23:10:27dadadaPMunch: I just wanted to say, especially with simple stuff like string manipulation python apparently can be very fast
23:10:43dadadaPMunch: don't worry too much :D
23:11:08Yardanicocan you guys check if that crashes for you? https://gist.github.com/Yardanico/194ef43f8dcfd1ada8eb379de6abaee9
23:11:09dadadabetter help me to figure out why the casting that works at runtime fails at compiletime and then let's fix that
23:11:32FromDiscord<Elegant Beef> Now to try to clean this up further, can macros add to enums?
23:12:36nimskullYardanico SIGSEGV: Illegal storage access. (Attempt to read from nil?)
23:12:41Yardanicothanks
23:12:49dadadawell, it doesn't necessarily have to be simple, but I mean the common stuff
23:13:44PMunch@Elegant Beef, define "add to"
23:13:58PMunchIt can't add to an existing enum if that's what you're asking
23:14:24FromDiscord<Elegant Beef> Yea that's what i was asking
23:14:51PMunchI don't worry :P I was just curious if I was doing something silly :P
23:15:00*fredrikhr quit (Quit: Client Disconnecting)
23:16:42*natrys quit (Quit: natrys)
23:17:35*krux02 quit (Remote host closed the connection)
23:21:17PMunchCuriously it's creating the interpreter that takes most of the time: http://ix.io/2mRj
23:21:43PMunchActually executing a routine from the script is virtually free
23:22:46nimskullIs there a good profiler for nim?
23:23:13PMunchvalgrind?
23:24:07*Trustable quit (Remote host closed the connection)
23:26:53Yardanicook seems like I found some kind of GC regression between 1.0.6 and 1.2.0
23:27:54Yardanicoguess I'll have to use git bisect :P
23:29:36PMunchhttps://github.com/nim-lang/Nim/issues/14409
23:32:19Yardanicohttps://github.com/nim-lang/Nim/issues/14410
23:32:21YardanicoXD
23:32:58Yardanicotime to git bisect
23:34:15PMunch"Additional Information: Works with --gc:arc"
23:34:19PMunchWelcome to the future!
23:35:17Yardanicoyep
23:38:11Yardanicofunny how I found this regression in my old project :D
23:38:58skrylar[m]i've started testing arc a little
23:39:14skrylar[m]hm. i wonder if anything stupid happens with nim code used as a plugin
23:39:27Yardanicowith arc - nothing bad should happen
23:39:28skrylar[m]there were weird rules for writing vsts because of how everything gets loaded in the address spaces
23:39:29zacharycarterI'm already using Nim code in plugins
23:39:41zacharycarterw/ arc
23:39:52zacharycarterhttps://github.com/zacharycarter/frag
23:39:54skrylar[m]more worried about if the rtl will step on itself
23:40:16skrylar[m]with vsts you cant use like, gtk2 and gtk3, because if the host loads gtk3 and a plugin tries to load gtk2 the symbols clash
23:40:47skrylar[m]so if one plugin is nim 1.2 and another is nim 1.3, will they work or will they kill each other
23:40:55skrylar[m]:mysteryghost:
23:41:21zacharycarterprobably if you're using the stdlib
23:42:19skrylar[m]i guess we should talk about decoupling strings/seqs from the stdlib
23:42:42skrylar[m]i know obj-c does something weird like this; if you try to use an objc compiler without openstep or cocoa it just whines that a bunch of magic classes aren't implemented
23:43:25skrylar[m]i dunno if the segment is large enough but the vst stuff has like, no variety. you get c++ and probably juce, and that's about it
23:43:26PMunchHmm, interesting
23:44:36PMunchI set it up to use my local branch of Nim, and now I'm 10ms off-of Python performance for the simple "Hello world" script test
23:46:10PMunchInstead of 10x off
23:46:30PMunch(Which was about 300ms)
23:50:45PMunchCuriously it also compiles with arc/orc, but fails on running the script
23:50:54YardanicoPMunch: yeah I know about that
23:51:01Yardaniconimsuggest fails too, the compiler can compile but fails too
23:51:11Yardanicoruntime bugs are the worst ones ;P
23:52:48Yardanicotime to git bisect
23:55:55leorize[m]skrylar[m]: plugins compiled with different versions of Nim will work fine
23:56:18leorize[m]they will die if you try to pass `ref`s between them though
23:58:28*ftsf joined #nim