<< 27-12-2018 >>

00:07:57*OrganicAnywhere quit (Ping timeout: 252 seconds)
00:08:14ee7[m]Gotta go. Thanks guys. See ya.
00:31:44kinkinkijkinI was having a really weird type mismatch error writing this, cursor is on the fix https://cdn.discordapp.com/attachments/392518258399379457/527644483584655361/treebuild2.png
00:31:55kinkinkijkinsorry for not pasted code
00:32:03kinkinkijkinhad to put my cursor on what the fix was
00:32:09kinkinkijkincan you figure out the error ?
00:32:30kinkinkijkin"type mismatch" because implicit values don't work inside seqs
00:32:38kinkinkijkinor tuples
00:33:03kinkinkijkini had another place in this program where i had a similar issue
00:33:20kinkinkijkinwhich made a much uglier piece of code than this
00:35:06kinkinkijkinthat is, this monstrosity https://cdn.discordapp.com/attachments/392518258399379457/527645317839978496/notes.png
00:35:30kinkinkijkinthis time it's an image because hexchat would send it as multiple lines
00:47:36*kapil____ quit (Quit: Connection closed for inactivity)
00:52:08*abm joined #nim
01:26:16*Notkea quit (Ping timeout: 250 seconds)
01:31:19*Notkea joined #nim
01:52:40leorizekinkinkijkin: you should paste your code inside a pastebin then post it here
01:54:55*zachk quit (Quit: Leaving)
02:08:45shashlickleorize: wanted to run this by you
02:09:04shashlickper your earlier suggestion to use distinct int in place of enums for nimterop
02:09:13shashlickhttp://ix.io/1utw <= simpler implementation
02:09:22shashlickhttps://ptpb.pw/SFks/nim is your original suggestion
02:09:31shashlickcurious if you see any concerns
02:16:42leorizeit looks fine enough to me
02:17:00leorizethe simpler implementation actually avoids some pitfall that mine causes
02:20:05shashlickthanks, will implement in nimterop
02:20:47shashlickgot to impress @zacharycarter for https://github.com/floooh/sokol
02:28:56*craigger quit (Quit: bye)
02:31:24*craigger joined #nim
02:33:54*smitop quit (Quit: Connection closed for inactivity)
02:35:16*craigger quit (Client Quit)
02:37:37*craigger joined #nim
02:39:12FromGitter<zetashift> How would I go about doing a `for.. else` like in python in Nim? Currently trying out block labels but doesn't seem to work
02:41:46FromGitter<zetashift> was using block labels wrong gotit
03:00:08*banc quit (Quit: Bye)
03:01:04*Tyresc quit (Quit: WeeChat 2.4-dev)
03:01:29*quipa joined #nim
03:12:32*kinkinkijkin left #nim ("Leaving")
03:12:42*kinkinkijkin joined #nim
03:16:05*banc joined #nim
03:29:26*steshaw quit (Quit: Connection closed for inactivity)
03:43:27*dddddd quit (Remote host closed the connection)
03:43:47*quipa quit (Read error: Connection reset by peer)
03:48:34*kapil____ joined #nim
04:40:07*abm quit (Ping timeout: 240 seconds)
05:23:58*kinkinkijkin quit (Quit: Leaving)
05:26:47*xace quit (Ping timeout: 240 seconds)
06:03:24*Vladar joined #nim
06:10:08*nsf joined #nim
06:14:13*endragor joined #nim
06:18:49*endragor quit (Ping timeout: 250 seconds)
06:32:48*stefanos82 joined #nim
06:44:41FromDiscord_<Tay> I kinda can't get over how easy async is in Nim. A pragma and a few keywords and it just works
07:26:58*azuri5 joined #nim
07:40:02*azuri5 quit (Quit: azuri5)
07:49:20*azuri5 joined #nim
07:51:04FromGitter<gogolxdong> wrote a channel helper http://ix.io/1wSO
07:51:51*narimiran joined #nim
07:54:30*narimiran quit (Remote host closed the connection)
07:55:23FromGitter<gogolxdong> fixed size array for multithreading is astonishing. Like putting a global async client in an array say dbPool and call from threads using dbPool[0].xxx
07:57:52FromGitter<gogolxdong> to avoid global GC'ed
07:58:14*narimiran joined #nim
08:09:32*xet7 joined #nim
08:15:48FromGitter<gogolxdong> var dbPool: array[1, AsyncMysqlClient] ⏎ var db = dbPool[0]
08:16:33FromGitter<gogolxdong> calls db.exec() from threads.
08:27:26*kinkinkijkin joined #nim
08:33:37*azuri5 quit (Quit: azuri5)
08:36:29*azuri5 joined #nim
08:42:13*azuri5 quit (Quit: azuri5)
08:57:48*azuri5 joined #nim
09:39:07FromGitter<alehander42> hm, when is 0.20 scheduled to be
09:40:32*azuri5 quit (Quit: azuri5)
09:42:37FromGitter<gogolxdong> sorry, I'm wrong.
09:46:12FromGitter<gogolxdong> It seems working in my gc:regions and channel context.
09:47:40FromGitter<gogolxdong> then what does fixed array multithreading access mean?
09:51:28FromGitter<gogolxdong> need to maintain one global asyncmysql client in multithreading context.
09:52:21Araqalehander42: unfortunately our nkExportDoc changes caused some really disturbing regressions
09:53:58*endragor joined #nim
09:57:44dom96Tay: yay! That's the intention, glad you find it easy :)
09:58:27*endragor quit (Ping timeout: 244 seconds)
10:12:25*azuri5 joined #nim
10:46:31dom96huh, did Deque change to disallow indexing by BackwardsIndex?
10:46:52dom96Actually, I bet BackwardsIndex was introduced and Deque never got the `[]` for it
10:49:26FromGitter<Clyybber> @shashlick: What are you implementing using distinct ints?
10:51:49dom96Araq: Can we merge https://github.com/nim-lang/Nim/pull/10000 ?
10:54:04FromGitter<Clyybber> dom96 Is it because 64 bit integers overflow in js?
10:54:17dom96yep
10:54:19FromGitter<Clyybber> So times.getTime() doesnt work in js?
11:01:42FromGitter<Clyybber> Araq: Why do we have `sfSideEffect` ? Isn't it implied by not having `sfNoSideEffect` ?
11:01:53dom96the JS crashes on a call to randomize
11:04:51FromGitter<Clyybber> Is it hard to fix the underlying issue?
11:05:08FromGitter<alehander42> @Araq nkExportDoc affects macros too I guess? (it's mapped to nnkExportDoc ?)
11:19:16*Vladar quit (Remote host closed the connection)
11:25:22*Trustable joined #nim
11:47:02*azuri5 quit (Ping timeout: 268 seconds)
12:12:43*stephenwithav quit (Remote host closed the connection)
12:23:07Araqalehander42: yup and in the worst possible ways, silent code breakage
12:27:30*kapil____ quit (Quit: Connection closed for inactivity)
12:30:03FromGitter<alehander42> yeah, and no easy way to automatically fix stuff related to this api change
12:37:00FromGitter<Clyybber> Araq: Why do we have `sfSideEffect` ? Isn't it implied by not having `sfNoSideEffect` ?
12:39:16*kapil____ joined #nim
12:43:02FromGitter<arnetheduck> Araq, since / if you'll be doing the ast breakage, it would be a really good time to consider an option to make it contain enough information that you can recreate the original source from it, 100% - that would make it useful to build tools that do transformations and refactorings - a trivial one for example is that we could provide a practical solution to people that are annoyed about the style insensitvity - a
12:43:02FromGitter... tool that restyles the code to a single style or to the style of the identifier declarations.. there's a myriad of these little things that could be done once the ast has that power
12:46:49FromGitter<mratsim> `toStrLit` can do that already
12:47:04FromGitter<mratsim> though you get the gensym’ed idents
12:50:26FromGitter<arnetheduck> the alternative is actually to create a separate tooling ast - that's actually not a bad option either, because it can be more free in its interpretation of the language so as not to choke on small errors
12:51:25*kinkinkijkin quit (Remote host closed the connection)
12:51:37*kinkinkijkin joined #nim
12:56:30FromGitter<Clyybber> @dom96 Shouldn't we reopen #9999 ?
12:57:30dom96Why?
12:57:54Araqarnetheduck: There is a far simpler solution for this.
12:57:55*Snircle joined #nim
12:59:04Araquse the n.info line information to patch the code in the files/buffers precisely. that's what the old 'nimfix' tool did, no friction for refactorings where suddenly the whitespace is messed up etc
13:00:54Araqthe old AST where every node could have a comment field was about this "precise" knowledge and it never worked out.
13:01:36FromGitter<Clyybber> @dom96 It is not fixed? Adding int64's in js still overflows.
13:02:29dom96oh yeah. I'm not sure if that should work in the first place
13:03:12FromGitter<Clyybber> JS has no native int64 afaik, but there is stuff like https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes/js-ctypes_reference/Int64
13:04:07FromGitter<Clyybber> Or this: https://github.com/broofa/node-int64
13:05:07FromGitter<arnetheduck> Araq, agree that a comment field doesn't solve anything - however, a mode that captures all the stuff would be usefol, so it's not just doc comments but also normal comments - maybe that needs a `nkCommentBlock` - or whatever else the parser throws away - the point is that just having gaps there isn't really enough - you might want the tool to reflow comments to fit 80 chars or do a spell check for example..
13:06:09Araqnimpretty is reformatting source code, refactorings cannot easily be done on it as it only parses, it does no semcheck
13:07:06Araqand semcheck mutates the AST anyway. the best is to use n.info field for refactorings, maybe followed or preceeded by nimpretty invocations
13:07:54Araq"divide and conquer" works in this case, no need to make the AST more complex
13:08:37*Vladar joined #nim
13:09:17FromGitter<arnetheduck> yeah, nimpretty does the job because it compiles the ast with a magic flag that includes enough information - but it's not very clear what's going on, it's pretty tangled, making it hard to improve nimpretty itself
13:10:02FromGitter<arnetheduck> divide, yes - but also divide the code so that the pieces are orthogonal
13:12:12Araq"pretty tangled" is much better than 2 separate lexers and parsers
13:12:13FromGitter<Clyybber> Hmm, that doesn't seem right: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c24cfad6649aa1f82dac58b]
13:13:22Araqand it's not clear how your "fullinfo AST" would change anything of that
13:15:17Araqit's not even about parsing and ASTs all that much, lexing alone is complex, a compiler wants "\L" and "\10" to be the same and a source code formatter needs to keep string literals intact
13:16:09FromGitter<arnetheduck> not necessarily worse with 2 separate ones - allows each to become specialized and good at what it does, and progress at its own pace.. then similarities can be brought back together
13:17:42FromGitter<alehander42> ok, how is this solved in other compilers? probably there is a good choice of well tested different approaches
13:20:43Araqnimpretty is my second or third attempt on this problem, it is well tested but there are bugs. Obvious solution: Arnetheduck didn't write it so it horseshit and should be rewritten.
13:20:53Araq;-)
13:25:28Araq"the code is harder to read than I would like" is not an argument for a massive amount of code duplication in the form of keeping two separate parsers around
13:26:06Araqmaybe the problem itself is harder than we all would like it to be.
13:26:08FromGitter<arnetheduck> I'm more looking at the fact that `nimpretty` isn't used very much and that several tooling integrators have mentioned that they're looking to pursue other options
13:27:38FromGitter<alehander42> btw offtopic, can I somehow "return" early in an iterator
13:28:11Araq"nimpretty isn't used very much" -- we had 0 releases that ship with it
13:28:13FromGitter<arnetheduck> hard to read means hard to improve, generally.. you want to fix one small thing in nimpretty and you get 20 test failures for some compiler stuff
13:29:37Araq"hard to read" is not objective, code is inherently hard to read, the trick is to slow down and not to assume the author was an ameba
13:30:40FromGitter<alehander42> https://www.sciencealert.com/an-amoeba-has-solved-an-exponentially-complex-problem-in-linear-time
13:40:47FromGitter<arnetheduck> haha, it usually takes a number of iterations express something clearly - code is no different - and once you get there, you recognize the quality
13:44:12FromGitter<arnetheduck> "It would be extremely hard to write down the detailed requirements that make up a great memo. Nevertheless, I find that much of the time, readers react to great memos very similarly. They know it when they see it. The standard is there, and it is real, even if it’s not easily describable." - https://www.sec.gov/Archives/edgar/data/1018724/000119312518121161/d456916dex991.htm (Jeff Bezos)
13:49:06AraqI don't see any "iteration" proposed here, only your usual radicalism
13:49:22Araqbbl
13:52:50*narimiran quit (Ping timeout: 268 seconds)
14:03:48*sdfjh[m] joined #nim
14:05:56FromGitter<zacharycarter> @alehander42 - amoeba article was fascinating
14:07:02FromGitter<Clyybber> I don't understand how they encoded the distance between the cities for the amobae to understand
14:08:23FromGitter<zacharycarter> it is lacking in details lik that
14:08:37FromGitter<zacharycarter> Clyybber - are you working on a Nim game project?
14:08:41FromGitter<Clyybber> Yeah
14:09:06FromGitter<zacharycarter> I saw`.engine` in some sample code you pasted earlier and it caught my eye
14:09:14FromGitter<zacharycarter> cool - what libs are you using?
14:09:27FromGitter<zacharycarter> I'm working on my renderer right now for my new project
14:09:28FromGitter<Clyybber> Only my own vulkan wrapper and glfw
14:09:33FromGitter<zacharycarter> ooo vulkan
14:09:35FromGitter<Clyybber> Oh, cool I am too
14:09:40FromGitter<Clyybber> I assume you use bgfx?
14:09:49FromGitter<zacharycarter> I am using it for this project - yes
14:10:12FromGitter<zacharycarter> I've heard some not-so-wonderful experience re: buggy vulkan drivers
14:10:17FromGitter<gogolxdong> swapchain is from Vulkan
14:10:30FromGitter<zacharycarter> which doesn't make me want to rush to use it
14:10:40FromGitter<zacharycarter> for instance - Roblox is ditching vulkan and going back to GLES for their android targets
14:10:57FromGitter<zacharycarter> I'm not sure how much the situation has improved since I read this update from them
14:11:11FromGitter<zacharycarter> but I think it's the main reason the author of BGFX doesn't feel the need to rush vulkan support
14:11:44FromGitter<zacharycarter> which IMO is smart - it's like buying the first generation of an iPhone and then finding issues with it - always best to let a tech sit and mature for a while
14:11:50FromGitter<Clyybber> It's mostly new extensions that don't get implemented properly in the driver
14:11:53FromGitter<zacharycarter> but for hobbyist stuff - I think vulkan is fine, especially if you want to learn
14:11:58FromGitter<Clyybber> Yeah
14:12:18FromGitter<Clyybber> I switched from bgfx to vulkan
14:12:23FromGitter<zacharycarter> I'm having enough fun learning about PBR pipelines without adding Vulkan on top :P
14:12:38FromGitter<zacharycarter> well - I think bgfx is higher level than vulkan
14:12:50FromGitter<Clyybber> Yeah definitely
14:13:10FromGitter<zacharycarter> also BGFX comes with some extra goodies out of the box
14:13:15FromGitter<zacharycarter> that you're left to implement yourself otherwise
14:13:31FromGitter<Clyybber> Yeah, main reason I switched was that I need compute shaders
14:13:37FromGitter<zacharycarter> ah
14:13:51FromGitter<zacharycarter> I'm not sure what I'd use compute shaders for
14:13:56FromGitter<zacharycarter> https://github.com/ConfettiFX/The-Forge
14:13:56FromGitter<Clyybber> because openCL is a buggy dying mess
14:14:10FromGitter<Clyybber> and CUDA is proprietary NVIDIA only bs
14:14:14FromGitter<gogolxdong> Do you have your example running?
14:14:28FromGitter<Clyybber> Am in some big refactoring
14:14:53FromGitter<Clyybber> Ah, you meant @zacharycarter
14:15:44FromGitter<zacharycarter> @gogolxdong - example of what? bgfx?
14:15:47FromGitter<gogolxdong> We have a working example of Vulkan tutorial example
14:15:52FromGitter<zacharycarter> oh
14:16:05*gangstacat quit (Quit: Ĝis!)
14:16:11FromGitter<gogolxdong> the colorful triangle.
14:16:48FromGitter<Clyybber> Oh I had that implemented too some time ago
14:17:15FromGitter<gogolxdong> Vulkan APIs are generated with macros from its documentation.
14:17:33FromGitter<Clyybber> Yeah, but the xml is just wrapped C essentially
14:18:52FromGitter<Clyybber> @gogolxdong The nimious vulkan wrapper is outdated, and uses nim enums for C enums, which doesn't work that well
14:19:00FromGitter<gogolxdong> technicallyagd did that actually, he is about to dive into GPU memory management next step.
14:19:05FromGitter<zacharycarter> btw @Clyybber - I think bgfx does have compute shader support
14:19:11FromGitter<Clyybber> Oh, nice
14:19:30FromGitter<zacharycarter> https://bkaradzic.github.io/bgfx/examples.html#nbody
14:20:22FromGitter<gogolxdong> from this doc https://github.com/KhronosGroup/Vulkan-Docs/blob/master/xml/vk.xml, right?
14:20:28FromGitter<Clyybber> Yeah
14:20:55*gangstacat joined #nim
14:21:12FromGitter<gogolxdong> you are doing similiar job.
14:21:45*dddddd joined #nim
14:21:52FromGitter<Clyybber> I'm generating a wrapper using a patched c2nim
14:21:54FromGitter<zacharycarter> I think if anyone really wants a large project to tackle in GPU programming
14:22:05FromGitter<zacharycarter> it's to build a library like BGFX/ gfx-rs entirely in native Nim
14:22:35FromGitter<gogolxdong> Why do you need compute shader?
14:22:49FromGitter<zacharycarter> although - I think these projects are demonstrating how difficult it is to achieve such a design
14:22:53FromGitter<zacharycarter> with the more modern gfx apis
14:23:18FromGitter<Clyybber> @gogolxdong I need it for my map generation algorithm
14:23:30FromGitter<Clyybber> Which is too slow on CPU
14:23:41FromGitter<zacharycarter> have you tried using SIMD instructions?
14:23:56FromGitter<Clyybber> That isn't the problem, its NP-problem
14:23:59FromGitter<zacharycarter> ah
14:24:13FromGitter<Clyybber> It's essentially a more generalised version of WFC
14:24:39FromGitter<Clyybber> I had it implemented in lua, but it was way too slow
14:24:48FromGitter<zacharycarter> interesting
14:24:56FromGitter<Clyybber> So I implemented it in C, which I didn't finish
14:25:02FromGitter<zacharycarter> I haven't played with WFC yet
14:25:14FromGitter<mratsim> How is Vulkan Compute btw. so far I’m really skeptical on their generalisation to tensors
14:25:37FromGitter<Clyybber> So I tried to do it in openCL, which is fairly unsupported/outdated on a lot of drivers
14:39:41FromGitter<Clyybber> @mratsim It's great, I'm essentially just writing opengl shaders
14:40:03FromGitter<mratsim> Shaders are not powerful enugh for machine learning :/
14:40:15FromGitter<Clyybber> Yeah
14:41:47FromGitter<zacharycarter> @Clyybber / @gogolxdong - that theforge project I linked to might be of interest to you
14:41:53FromGitter<zacharycarter> although I'm not sold on it
14:41:56FromGitter<Clyybber> I saw it
14:42:01FromGitter<Clyybber> Looks interesting
14:42:05FromGitter<Clyybber> but kinda inactive
14:42:24FromGitter<zacharycarter> I think they're active - but how active is a good question
14:42:35FromGitter<zacharycarter> also it doesn't seem to have much of a community beyond a twitter account
14:43:18FromGitter<zacharycarter> https://github.com/hugoam/mud - is a neat project too
14:43:21FromGitter<Clyybber> @mratsim I think SPIRV has the capabilities, its just that its not used yet
14:44:56FromGitter<Clyybber> Also there is https://github.com/google/clspv
14:46:49FromGitter<zacharycarter> @Clyybber - what kind of game are you making?
14:46:53FromGitter<zacharycarter> obviously it has a procedural component
14:47:20FromGitter<Clyybber> Takes place on a procedural space station
14:47:28FromGitter<Clyybber> Top down 2d
14:47:30*kapil____ quit (Quit: Connection closed for inactivity)
14:47:53FromGitter<Clyybber> And for the gameplay, imagine taking alien isolation and trying to make it 2d
14:48:07FromGitter<Clyybber> Or Prey 2017
14:48:51FromGitter<Clyybber> And I would like to someday use arraymancer to provide some lstm based onboard AI
14:48:58FromGitter<zacharycarter> cool
14:49:15FromGitter<Clyybber> Also I love systemshock, so hopefully that will show eventually
14:49:20FromGitter<zacharycarter> so I did this proc gen project a while ago where I was generating the interior of spaceships
14:49:32FromGitter<zacharycarter> and the spaceships themselves actually
14:49:36FromGitter<zacharycarter> it was 2d top down
14:49:40FromGitter<Clyybber> Oh, do you have screenshots?
14:49:49FromGitter<Clyybber> That looks pretty interesting
14:49:52FromGitter<zacharycarter> I think I deleted most of them - but I do have some of the proc gen code ported to Nim
14:49:58FromGitter<zacharycarter> I also added lock and key zelda puzzles to them
14:50:04FromGitter<Clyybber> Nice
14:50:14FromGitter<zacharycarter> generating those was difficult but fun
14:50:24FromGitter<Clyybber> I imagine
14:50:44FromGitter<zacharycarter> https://github.com/zacharycarter/NimRL
14:50:57FromGitter<Clyybber> Oh, nims error messages are broken when declaring a variable with the same identifier as an imported module
14:50:58FromGitter<zacharycarter> the last little image in that repo's readme is a small example of what the spaceships tended to look like
14:51:14*gangstacat quit (Quit: Ĝis!)
14:52:11FromGitter<Clyybber> So it was room based?
14:52:14FromGitter<zacharycarter> mmhmm
14:52:29FromGitter<zacharycarter> it wasn't very realistic
14:52:56FromGitter<Clyybber> My approach will be to create parts of the space station and use the algorithm to assemble them
14:53:18FromGitter<zacharycarter> yeah - I think that can work too
14:54:00FromGitter<zacharycarter> this was another fun project I worked on several years ago - https://github.com/zacharycarter/mapgen
14:54:07FromGitter<zacharycarter> or a couple I guess
14:54:13FromGitter<zacharycarter> this was right before I switched to Nim
14:54:44FromGitter<Clyybber> That looks really cool
14:54:50FromGitter<zacharycarter> thanks
14:54:50FromGitter<zacharycarter> https://imgur.com/a/CoLac
14:54:55FromGitter<zacharycarter> I really like the gif at the top of that album
14:55:05FromGitter<zacharycarter> I added height maps and a shader to fake lighting over the map
14:55:24FromGitter<Clyybber> Do the heights affect the clouds?
14:55:48FromGitter<zacharycarter> the clouds were actually just another shader I ran on top of everything else
14:55:59FromGitter<zacharycarter> I had the height data in memory so if I had wanted to do something like that eventually I could have
14:56:08FromGitter<Clyybber> Ah
14:56:22FromGitter<zacharycarter> but this was all 2d anyway - 3d would have been the way to go IMO if I wanted to really expand on this idea
14:56:56FromGitter<zacharycarter> but I was very into roguelikes at the time and was experimenting with world generation and how I could generate world overlay maps
14:57:30FromGitter<Clyybber> Oh boi im still into roguelikes
14:57:30FromGitter<zacharycarter> I already had a planet generator working and I was going for some kind of space exploration game where you'd land on planets and explore them - but the design wasn't cohesive / well thought out enough
14:57:31FromGitter<Clyybber> and 2d
14:57:49FromGitter<zacharycarter> it's a fun hole to get into :)
14:57:55FromGitter<Clyybber> @zacharycarter You have so many projects :D
14:58:02FromGitter<Clyybber> Inspiring
14:58:18FromGitter<alehander42> that's interesting, i've always liked proced generation
14:58:26FromGitter<alehander42> i've played with the idea of city generation
14:58:30FromGitter<zacharycarter> haha thanks! none of them really have reached a significant level of maturity - just little toy examples / experiments
14:58:33FromGitter<Clyybber> I made a small roguelike in racket in highscool during class
14:58:40FromGitter<alehander42> i remember i found some very interesting approaches on twitter
14:58:43FromGitter<alehander42> but can't find them anymore
14:58:45FromGitter<zacharycarter> but I hope to make an actual game this time
14:58:54*nsf quit (Quit: WeeChat 2.3)
14:59:20FromGitter<zacharycarter> it seems that lritter on twitter is building his new engine specifically geared towards procgen
14:59:26FromGitter<zacharycarter> with his programming language scopes
14:59:46FromGitter<zacharycarter> I actually got his engine project building - although it won't run because he's already started migrating it to version 0.4 of scopes, which isn't out yet
14:59:58FromGitter<zacharycarter> but he had all sorts of crazy libraries I hadn't heard of in his project
15:00:10FromGitter<zacharycarter> and it seemed like most of them were specifically geared towards his procgen efforts
15:01:21FromGitter<zacharycarter> https://bitbucket.org/duangle/tukan/wiki/Home
15:01:53FromGitter<zacharycarter> https://bitbucket.org/duangle/tukan/src/556310272637d67525f5821a22549800e0b646d4/externals/?at=default
15:02:21FromGitter<Clyybber> @alehander42 URR has some very cool city generation
15:03:22FromGitter<zacharycarter> https://github.com/memononen/libtess2
15:04:15FromGitter<zacharycarter> one of those libs I'd never heard of but must be being used for some procgen related task
15:04:15*abm joined #nim
15:04:33FromGitter<alehander42> @Clyybber URR looks pretty interesting conceptually, thanks
15:04:36FromGitter<zacharycarter> https://ccrma.stanford.edu/software/stk/
15:06:16FromGitter<zacharycarter> there were some others too I think
15:06:43FromGitter<zacharycarter> Tukan seems like an interesting engine project to dig through
15:06:54FromGitter<zacharycarter> I don't find scopes to terribly hard to read
15:08:59*xace joined #nim
15:13:23FromGitter<zacharycarter> this is neat - https://interplayoflight.wordpress.com/2018/03/05/porting-gpu-driven-occlusion-culling-to-bgfx/
15:16:51shashlick@Clyybber: am now generating distinct int when wrapping C enums in nimterop - pushed the changes last night
15:17:35shashlickSo unordered enums can now be managed automatically instead of requiring edits
15:17:36FromGitter<Clyybber> I did the same thing for c2nim
15:18:12FromGitter<Clyybber> But haven't done a PR yet, because I removed the ability to generate nim enums in the process :P
15:19:07*gangstacat joined #nim
15:19:10FromGitter<Clyybber> Unordered enums weren't a problem for me, but I did it to make enums with duplicate values possible
15:22:01*abm quit (Remote host closed the connection)
15:22:26*abm joined #nim
15:22:49shashlickVulkan has some crazy enums, if I remember correctly
15:23:26shashlickI still don't handle expressions but it's easy to enhance
15:24:19shashlickWill be great if the community tries nimterop out and provides feedback
15:26:07*abm quit (Remote host closed the connection)
15:26:32*abm joined #nim
15:32:07*abm quit (Ping timeout: 240 seconds)
15:38:00*abm joined #nim
15:46:18FromGitter<Clyybber> shashlick: I have a macro that generates `+` and `-` for those distinct ints
15:46:31FromGitter<Clyybber> If you need it
15:49:49*nsf joined #nim
15:51:11*smitop joined #nim
15:52:46FromGitter<arnetheduck> shashlick, I don't have time to try it now, but you can look at https://github.com/arnetheduck/nlvm/tree/master/llvm if you need a slightly hairy example of c headers being imported
15:57:23*whaletechno quit (Quit: ha det bra)
15:58:26shashlickThanks folks - @Clyybber please share
15:59:29FromGitter<Clyybber> shashlick: Its the beginning of this file: https://github.com/Clyybber/vulkanim/blob/master/vulkan.nim
15:59:32shashlick@arnetheduck: I still remember your challenge to wrap llvm
15:59:52FromGitter<arnetheduck> oh right, there was a 🍺 staked!
16:00:06shashlick;)
16:09:54*sdfjh[m] left #nim ("User left")
16:20:32*narimiran joined #nim
16:25:17*Ven`` joined #nim
16:31:09*quipa joined #nim
16:42:12dom96JS backend doesn't seem to show stack traces?
16:42:28dom96had to "Pause on exceptions" in the debugger to get the stack trace
16:43:05shashlick@arnetheduck: rebuild.sh looks quite straight forward
16:43:14shashlickDid you do any manual edits of llvm
16:44:05FromGitter<arnetheduck> @shashlick yeah - that's not documented but I have to comment out some parts for c2nim to run
16:44:16FromGitter<sheerluck> hi. I can not find Associative array aka map aka dict in Nim, please help
16:44:20FromGitter<arnetheduck> in a perfect world, the script would take care of that :)
16:45:03FromGitter<arnetheduck> there's a part where they use a macro to generate function signatures for different targets based on a list.. something like initX86, initArm etc where the X86 part is taken from a list
16:45:42FromGitter<SolitudeSF> @sheerluck https://nim-lang.org/docs/tables.html
16:45:49FromGitter<SolitudeSF> aka table
16:45:53FromGitter<sheerluck> Thank you
16:56:01*craigger quit (Quit: bye)
16:58:35*vlad1777d joined #nim
16:58:49shashlick@arnetheduck - you need to check out nimgen :)
16:58:54*craigger joined #nim
16:59:39*Ven`` quit (Read error: Connection reset by peer)
16:59:48*onionhammer quit (Ping timeout: 272 seconds)
17:00:39*Ven`` joined #nim
17:01:37*onionhammer joined #nim
17:01:46shashlickI think the macro generated functions is the main obstacle right now
17:02:22shashlickI'll have to see if gcc has a way to show that
17:02:44shashlickNimterop uses gcc to get all relevant #defines
17:03:00shashlickWorks well mostly
17:03:14shashlickBut again, only limited testing
17:03:48shashlickThe advantage, in my mind, is that nimterop will wrap everything it recognizes and moves on
17:04:19shashlickSo you can still get partial wrapping without any source file edits
17:04:51shashlickSo if you want to use nimterop to convert just the enums in vulkan, it is possible
17:08:16shashlickBaby steps
17:33:21shashlickSo while the Nim forum is great, it would be better if questions were managed on stack overflow
17:33:41shashlickThat way, when Nim is measured there, it is large enough
17:35:28FromGitter<sheerluck> @SolitudeSF nice https://github.com/SolitudeSF/adventOfCode btw
17:51:06shashlickhttps://stackoverflow.com/help/product-support
17:58:05FromDiscord_<hotdog> Anyone know a way to force a re-render in Karax? I'm listening to keyboard input events on the main window/document but karax doesn't update as it's not using the wrapped event handlers (I think)
17:59:26*M37[m] left #nim ("User left")
18:11:35FromDiscord_<LimeBlack> Hey guys, any idea how to move data ( seq[string] ) from compileTime to runTime without write it into a file?
18:13:20FromDiscord_<hotdog> @LimeBlack I don't think there is a way to do it directly, you'll need to generate code that constructs the seq when your app starts. I might be wrong about that though
18:13:40FromGitter<Clyybber> There is a way
18:13:46FromGitter<Clyybber> Im doing that for shaders
18:13:55FromGitter<Clyybber> I'll look up the exact code
18:14:06FromDiscord_<LimeBlack> cool thx 😃
18:17:24dom96hotdog: I think you can call redraw()
18:18:33FromGitter<Clyybber> @LimeBlack You basically create a `const` variable and set that to your compileTime data
18:19:16FromDiscord_<LimeBlack> sounds logical, i'll try
18:19:22FromGitter<Clyybber> Because `const` variables are created at compile time but available at run time
18:22:16FromDiscord_<LimeBlack> i need to create a macro which creates my const right?, or is there a shorter way?
18:22:59FromDiscord_<LimeBlack> sorry iam new to this compileTime stuff 😊
18:24:14FromGitter<Clyybber> No need for a macro
18:25:20FromGitter<Clyybber> Just do: ⏎ ⏎ ```const test = compileTimeStuff ⏎ doSomethingThatTakesRuntimeStuff(test)``` [https://gitter.im/nim-lang/Nim?at=5c25191009b8066849734029]
18:26:33FromDiscord_<LimeBlack> i have a static block in my example, if i create a const there i cannot access .......... oh yeah iam dump 😛 sry i just need to create the const outside of my static code block... scoping...
18:29:26FromDiscord_<hotdog> @dom96 that worked, thanks!
18:29:26*OrganicAnywhere joined #nim
18:39:44*vlad1777d quit (Remote host closed the connection)
18:42:11OrganicAnywhereHow do I create a pointer?
18:42:15*vlad1777d joined #nim
18:44:36dom96OrganicAnywhere: addr variable
18:45:14FromGitter<Clyybber> And for immutable variables do `unsafeAddr variable`
18:48:15dom96(but be careful)
18:49:02dom96Yay. Snake is now updated to the latest and greatest version compiled with Nim devel.
18:49:09dom96Plus I implemented replays: https://picheta.me/snake/
18:49:13dom96(Just press 'r')
18:49:37dom96(Also, flags work again!)
18:49:44*dorelix joined #nim
18:50:12OrganicAnywhereCould you give me a syntax example? Let's say I want to create a pointer to an int.
18:51:30FromGitter<Clyybber> ```var somePointer: ptr int```
18:51:45FromGitter<Clyybber> That was the declaration
18:52:26FromGitter<Clyybber> ```var someInt = 0 ⏎ var somePointer = addr someInt``` ⏎ ⏎ That's creating an actual pointer to an integer [https://gitter.im/nim-lang/Nim?at=5c251f6992cf4d224202f82f]
18:53:55*kapil____ joined #nim
18:55:39OrganicAnywhereWhat's the difference between the two?
18:55:57OrganicAnywhereOther than that in the second one you say "point to this specific address"
18:56:56FromGitter<Clyybber> In the first example the pointer points to nothing
18:57:10FromGitter<Clyybber> In the second it actually points to somewhere
18:57:32FromGitter<Clyybber> The first is called a nullptr in other languages such as C++ or NULL in C
18:57:47FromGitter<Clyybber> or nil in Nim or lua
18:57:53OrganicAnywhereOk, as I thought.
18:58:28OrganicAnywhereIs there away to print (echo) the address that a pointer points to? I remember doing that in C.
18:59:46FromGitter<Clyybber> I think you can do `$somePointer`
19:00:00FromGitter<Clyybber> 1) `echo $somePointer`
19:00:49OrganicAnywhereHmm... didn't work.
19:01:13FromGitter<coffeepots> `echo somePointer.repr`
19:01:21FromGitter<Clyybber> Yeah, repr always works
19:02:33OrganicAnywhereThat works.
19:02:47*skelett joined #nim
19:03:07OrganicAnywhereI think I might keep asking questions... can I find this stuff anywhere in the manual? There's nothing on this in the tutorials.
19:05:46*skelett quit (Client Quit)
19:07:32*skelett joined #nim
19:07:37*Tyresc joined #nim
19:09:47*skelett quit (Client Quit)
19:10:28*skelett joined #nim
19:18:59Zevvimho "repr" deserves a place high in the manuals and tutorials. Its a game changer if you come from a world where there is no introspection that you just can ask your statically, compiled language to print a readable interpretation of any data type
19:19:30Zevvfor the pointer part, you can also cast explicitly: echo cast[int](somePointer)
19:24:27dom96OrganicAnywhere: This stuff is considered unsafe and only necessary for very specific use cases, hence why it's not really shown in the tutorials
19:25:51OrganicAnywheredom96: I understand. I'm mostly doing this to learn more about this stuff. I could use C to learn this and then go back to Nim.
19:27:16*skelett quit (Quit: WeeChat 2.1)
19:28:16*skelett joined #nim
19:39:27Zevvdom96: do you happen to have anything lying around to fix the todo in asynchttpserver over upgrade/closing behaviour? If not, I could fix something for that, as I am currently bitten by that
19:39:59dom96Zevv: I believe I've got a PR open for that
19:40:09Zevvok
19:43:43Zevvoh indeed, I just found that. Only 19 hours of age
19:46:11*abm quit (Ping timeout: 268 seconds)
19:46:23*abm joined #nim
19:51:47*a_b_m joined #nim
19:52:03*a_b_m quit (Remote host closed the connection)
19:52:04*abm quit (Ping timeout: 272 seconds)
19:54:29dom96Zevv: Good timing :)
20:06:32OrganicAnywheredom96: I'm looking at some tutorials about common algorithms and data structures. I want to implement them in Nim as an exercise. I've glanced at some of the source code in C and noticed that they use pointers in some of the data structures. For example, if I want to implement a linked list.
20:13:44*abm joined #nim
20:20:44FromGitter<coffeepots> @OrganicAnywhere take a look at some examples here if you haven't already https://rosettacode.org/wiki/Category:Nim There are a few linked list examples in Nim there. Rather than use pointers, you can use references (which are like garbage collected, safer pointers)
20:31:04FromGitter<coffeepots> I don't know how much you've picked up already, but if you've not seen this already the tutorial goes into references/pointers https://nim-lang.org/docs/tut1.html#advanced-types-reference-and-pointer-types
20:31:30OrganicAnywherecoffeepots: That site is... very useful. Thank you!
20:32:35FromGitter<coffeepots> Glad to help :) Bear in mind some of the rosetta examples may be a little old, alrhough I think they might have been updated recently. Should still give you plenty to digest :)
20:32:39OrganicAnywhereFromGitter: I read that... I didn't find it very useful...
20:32:39FromGitterOrganicAnywhere, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
20:32:59OrganicAnywhereOh, nvm
20:33:00OrganicAnywherehah
20:33:24OrganicAnywhereYes, there is quite enough there to keep me occupied for a while :)
20:33:31Zevvdom96: while speaking about the async stuff
20:33:46Zevvwhat is the rationale for having a separate asyncfd and asyncsocket subsystem?
20:34:02Zevvthey share so much of the functionality, why is there not just one?
20:34:05dom96efficiency, asyncsocket is a relatively heavy object
20:34:42Zevvbut without asyncsocket I can not bind a port, even if I wanted to use asyncfds instead
20:35:28Zevvor is it mainly becasue of all the buffering that is done in the object
20:37:35Zevvthere is accept in asyncfd, but no bind or connect. It caused me some confusion in my first nim days
20:45:17dom96there is accept IIRC
20:45:26dom96it's all defined in asyncdispatch
20:45:34dom96this is also roughly how net/nativesockets works
20:48:44Zevvok, clear, I was just wondering. I like my socket bindings lean and close to native, but AsyncFd just misses some essentials. I'm able to build those easily mixing asyncfd and net, so I'm fine.
20:48:54Zevvthanks
20:51:02dom96I would strongly encourage you to use asyncnet. If you really want to use the low-level details then just use selectors like httpbeast does
20:51:22dom96(that is the selectors module)
20:52:41Zevvok, that makes sense
20:53:17*kungtotte joined #nim
20:55:36Zevvleaves me with one question: what is the typical use case for asyncfd then?
20:55:55Zevvbecause selectors and asyncnet gives me about all I need, I guess
21:06:51*skelett quit (Quit: WeeChat 2.1)
21:07:14*skelett joined #nim
21:11:58dom96It's mainly a low-level implementation
21:12:46Zevvok, all clear now
21:31:27*shpx joined #nim
21:45:07*xet7 quit (Remote host closed the connection)
21:52:58*whaletechno joined #nim
21:56:57*quipa_ joined #nim
21:59:32*quipa quit (Ping timeout: 250 seconds)
21:59:32*ghost64 quit (Read error: Connection reset by peer)
22:01:16*narimiran quit (Ping timeout: 272 seconds)
22:04:34*ghost64 joined #nim
22:12:43*rayman22201 joined #nim
22:12:54*kapil____ quit (Quit: Connection closed for inactivity)
22:14:11*Vladar quit (Remote host closed the connection)
22:29:04*nsf quit (Quit: WeeChat 2.3)
22:38:03*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:39:46hogeland[I/1
22:39:50hogelandwhoops
22:44:00*quipa_ quit (Remote host closed the connection)
22:44:28*quipa_ joined #nim
22:48:11*quipa_ quit (Max SendQ exceeded)
22:48:41*quipa_ joined #nim
22:49:01*shpx joined #nim
22:51:41*shpx quit (Client Quit)
22:56:27*stefanos82 quit (Remote host closed the connection)
23:02:46*Ven`` quit (Read error: Connection reset by peer)
23:05:48*Ven`` joined #nim
23:12:45*Trustable quit (Remote host closed the connection)
23:30:00FromGitter<gogolxdong> how to avoid global GC'ed memory with one global initialized variable and accessing?
23:45:28*zachk joined #nim
23:46:22*zachk quit (Changing host)
23:46:22*zachk joined #nim
23:46:45FromGitter<rayman22201> https://nim-lang.org/docs/system.html#createShared%2Ctypedesc maybe?