00:07:57 | * | OrganicAnywhere quit (Ping timeout: 252 seconds) |
00:08:14 | ee7[m] | Gotta go. Thanks guys. See ya. |
00:31:44 | kinkinkijkin | I 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:55 | kinkinkijkin | sorry for not pasted code |
00:32:03 | kinkinkijkin | had to put my cursor on what the fix was |
00:32:09 | kinkinkijkin | can you figure out the error ? |
00:32:30 | kinkinkijkin | "type mismatch" because implicit values don't work inside seqs |
00:32:38 | kinkinkijkin | or tuples |
00:33:03 | kinkinkijkin | i had another place in this program where i had a similar issue |
00:33:20 | kinkinkijkin | which made a much uglier piece of code than this |
00:35:06 | kinkinkijkin | that is, this monstrosity https://cdn.discordapp.com/attachments/392518258399379457/527645317839978496/notes.png |
00:35:30 | kinkinkijkin | this 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:40 | leorize | kinkinkijkin: you should paste your code inside a pastebin then post it here |
01:54:55 | * | zachk quit (Quit: Leaving) |
02:08:45 | shashlick | leorize: wanted to run this by you |
02:09:04 | shashlick | per your earlier suggestion to use distinct int in place of enums for nimterop |
02:09:13 | shashlick | http://ix.io/1utw <= simpler implementation |
02:09:22 | shashlick | https://ptpb.pw/SFks/nim is your original suggestion |
02:09:31 | shashlick | curious if you see any concerns |
02:16:42 | leorize | it looks fine enough to me |
02:17:00 | leorize | the simpler implementation actually avoids some pitfall that mine causes |
02:20:05 | shashlick | thanks, will implement in nimterop |
02:20:47 | shashlick | got 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:12 | FromGitter | <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:46 | FromGitter | <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:41 | FromDiscord_ | <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:04 | FromGitter | <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:23 | FromGitter | <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:52 | FromGitter | <gogolxdong> to avoid global GC'ed |
07:58:14 | * | narimiran joined #nim |
08:09:32 | * | xet7 joined #nim |
08:15:48 | FromGitter | <gogolxdong> var dbPool: array[1, AsyncMysqlClient] ⏎ var db = dbPool[0] |
08:16:33 | FromGitter | <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:07 | FromGitter | <alehander42> hm, when is 0.20 scheduled to be |
09:40:32 | * | azuri5 quit (Quit: azuri5) |
09:42:37 | FromGitter | <gogolxdong> sorry, I'm wrong. |
09:46:12 | FromGitter | <gogolxdong> It seems working in my gc:regions and channel context. |
09:47:40 | FromGitter | <gogolxdong> then what does fixed array multithreading access mean? |
09:51:28 | FromGitter | <gogolxdong> need to maintain one global asyncmysql client in multithreading context. |
09:52:21 | Araq | alehander42: unfortunately our nkExportDoc changes caused some really disturbing regressions |
09:53:58 | * | endragor joined #nim |
09:57:44 | dom96 | Tay: 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:31 | dom96 | huh, did Deque change to disallow indexing by BackwardsIndex? |
10:46:52 | dom96 | Actually, I bet BackwardsIndex was introduced and Deque never got the `[]` for it |
10:49:26 | FromGitter | <Clyybber> @shashlick: What are you implementing using distinct ints? |
10:51:49 | dom96 | Araq: Can we merge https://github.com/nim-lang/Nim/pull/10000 ? |
10:54:04 | FromGitter | <Clyybber> dom96 Is it because 64 bit integers overflow in js? |
10:54:17 | dom96 | yep |
10:54:19 | FromGitter | <Clyybber> So times.getTime() doesnt work in js? |
11:01:42 | FromGitter | <Clyybber> Araq: Why do we have `sfSideEffect` ? Isn't it implied by not having `sfNoSideEffect` ? |
11:01:53 | dom96 | the JS crashes on a call to randomize |
11:04:51 | FromGitter | <Clyybber> Is it hard to fix the underlying issue? |
11:05:08 | FromGitter | <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:07 | Araq | alehander42: yup and in the worst possible ways, silent code breakage |
12:27:30 | * | kapil____ quit (Quit: Connection closed for inactivity) |
12:30:03 | FromGitter | <alehander42> yeah, and no easy way to automatically fix stuff related to this api change |
12:37:00 | FromGitter | <Clyybber> Araq: Why do we have `sfSideEffect` ? Isn't it implied by not having `sfNoSideEffect` ? |
12:39:16 | * | kapil____ joined #nim |
12:43:02 | FromGitter | <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:02 | FromGitter | ... 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:49 | FromGitter | <mratsim> `toStrLit` can do that already |
12:47:04 | FromGitter | <mratsim> though you get the gensym’ed idents |
12:50:26 | FromGitter | <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:30 | FromGitter | <Clyybber> @dom96 Shouldn't we reopen #9999 ? |
12:57:30 | dom96 | Why? |
12:57:54 | Araq | arnetheduck: There is a far simpler solution for this. |
12:57:55 | * | Snircle joined #nim |
12:59:04 | Araq | use 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:54 | Araq | the old AST where every node could have a comment field was about this "precise" knowledge and it never worked out. |
13:01:36 | FromGitter | <Clyybber> @dom96 It is not fixed? Adding int64's in js still overflows. |
13:02:29 | dom96 | oh yeah. I'm not sure if that should work in the first place |
13:03:12 | FromGitter | <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:07 | FromGitter | <Clyybber> Or this: https://github.com/broofa/node-int64 |
13:05:07 | FromGitter | <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:09 | Araq | nimpretty is reformatting source code, refactorings cannot easily be done on it as it only parses, it does no semcheck |
13:07:06 | Araq | and semcheck mutates the AST anyway. the best is to use n.info field for refactorings, maybe followed or preceeded by nimpretty invocations |
13:07:54 | Araq | "divide and conquer" works in this case, no need to make the AST more complex |
13:08:37 | * | Vladar joined #nim |
13:09:17 | FromGitter | <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:02 | FromGitter | <arnetheduck> divide, yes - but also divide the code so that the pieces are orthogonal |
13:12:12 | Araq | "pretty tangled" is much better than 2 separate lexers and parsers |
13:12:13 | FromGitter | <Clyybber> Hmm, that doesn't seem right: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c24cfad6649aa1f82dac58b] |
13:13:22 | Araq | and it's not clear how your "fullinfo AST" would change anything of that |
13:15:17 | Araq | it'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:09 | FromGitter | <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:42 | FromGitter | <alehander42> ok, how is this solved in other compilers? probably there is a good choice of well tested different approaches |
13:20:43 | Araq | nimpretty 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:53 | Araq | ;-) |
13:25:28 | Araq | "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:06 | Araq | maybe the problem itself is harder than we all would like it to be. |
13:26:08 | FromGitter | <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:38 | FromGitter | <alehander42> btw offtopic, can I somehow "return" early in an iterator |
13:28:11 | Araq | "nimpretty isn't used very much" -- we had 0 releases that ship with it |
13:28:13 | FromGitter | <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:37 | Araq | "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:40 | FromGitter | <alehander42> https://www.sciencealert.com/an-amoeba-has-solved-an-exponentially-complex-problem-in-linear-time |
13:40:47 | FromGitter | <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:12 | FromGitter | <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:06 | Araq | I don't see any "iteration" proposed here, only your usual radicalism |
13:49:22 | Araq | bbl |
13:52:50 | * | narimiran quit (Ping timeout: 268 seconds) |
14:03:48 | * | sdfjh[m] joined #nim |
14:05:56 | FromGitter | <zacharycarter> @alehander42 - amoeba article was fascinating |
14:07:02 | FromGitter | <Clyybber> I don't understand how they encoded the distance between the cities for the amobae to understand |
14:08:23 | FromGitter | <zacharycarter> it is lacking in details lik that |
14:08:37 | FromGitter | <zacharycarter> Clyybber - are you working on a Nim game project? |
14:08:41 | FromGitter | <Clyybber> Yeah |
14:09:06 | FromGitter | <zacharycarter> I saw`.engine` in some sample code you pasted earlier and it caught my eye |
14:09:14 | FromGitter | <zacharycarter> cool - what libs are you using? |
14:09:27 | FromGitter | <zacharycarter> I'm working on my renderer right now for my new project |
14:09:28 | FromGitter | <Clyybber> Only my own vulkan wrapper and glfw |
14:09:33 | FromGitter | <zacharycarter> ooo vulkan |
14:09:35 | FromGitter | <Clyybber> Oh, cool I am too |
14:09:40 | FromGitter | <Clyybber> I assume you use bgfx? |
14:09:49 | FromGitter | <zacharycarter> I am using it for this project - yes |
14:10:12 | FromGitter | <zacharycarter> I've heard some not-so-wonderful experience re: buggy vulkan drivers |
14:10:17 | FromGitter | <gogolxdong> swapchain is from Vulkan |
14:10:30 | FromGitter | <zacharycarter> which doesn't make me want to rush to use it |
14:10:40 | FromGitter | <zacharycarter> for instance - Roblox is ditching vulkan and going back to GLES for their android targets |
14:10:57 | FromGitter | <zacharycarter> I'm not sure how much the situation has improved since I read this update from them |
14:11:11 | FromGitter | <zacharycarter> but I think it's the main reason the author of BGFX doesn't feel the need to rush vulkan support |
14:11:44 | FromGitter | <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:50 | FromGitter | <Clyybber> It's mostly new extensions that don't get implemented properly in the driver |
14:11:53 | FromGitter | <zacharycarter> but for hobbyist stuff - I think vulkan is fine, especially if you want to learn |
14:11:58 | FromGitter | <Clyybber> Yeah |
14:12:18 | FromGitter | <Clyybber> I switched from bgfx to vulkan |
14:12:23 | FromGitter | <zacharycarter> I'm having enough fun learning about PBR pipelines without adding Vulkan on top :P |
14:12:38 | FromGitter | <zacharycarter> well - I think bgfx is higher level than vulkan |
14:12:50 | FromGitter | <Clyybber> Yeah definitely |
14:13:10 | FromGitter | <zacharycarter> also BGFX comes with some extra goodies out of the box |
14:13:15 | FromGitter | <zacharycarter> that you're left to implement yourself otherwise |
14:13:31 | FromGitter | <Clyybber> Yeah, main reason I switched was that I need compute shaders |
14:13:37 | FromGitter | <zacharycarter> ah |
14:13:51 | FromGitter | <zacharycarter> I'm not sure what I'd use compute shaders for |
14:13:56 | FromGitter | <zacharycarter> https://github.com/ConfettiFX/The-Forge |
14:13:56 | FromGitter | <Clyybber> because openCL is a buggy dying mess |
14:14:10 | FromGitter | <Clyybber> and CUDA is proprietary NVIDIA only bs |
14:14:14 | FromGitter | <gogolxdong> Do you have your example running? |
14:14:28 | FromGitter | <Clyybber> Am in some big refactoring |
14:14:53 | FromGitter | <Clyybber> Ah, you meant @zacharycarter |
14:15:44 | FromGitter | <zacharycarter> @gogolxdong - example of what? bgfx? |
14:15:47 | FromGitter | <gogolxdong> We have a working example of Vulkan tutorial example |
14:15:52 | FromGitter | <zacharycarter> oh |
14:16:05 | * | gangstacat quit (Quit: Ĝis!) |
14:16:11 | FromGitter | <gogolxdong> the colorful triangle. |
14:16:48 | FromGitter | <Clyybber> Oh I had that implemented too some time ago |
14:17:15 | FromGitter | <gogolxdong> Vulkan APIs are generated with macros from its documentation. |
14:17:33 | FromGitter | <Clyybber> Yeah, but the xml is just wrapped C essentially |
14:18:52 | FromGitter | <Clyybber> @gogolxdong The nimious vulkan wrapper is outdated, and uses nim enums for C enums, which doesn't work that well |
14:19:00 | FromGitter | <gogolxdong> technicallyagd did that actually, he is about to dive into GPU memory management next step. |
14:19:05 | FromGitter | <zacharycarter> btw @Clyybber - I think bgfx does have compute shader support |
14:19:11 | FromGitter | <Clyybber> Oh, nice |
14:19:30 | FromGitter | <zacharycarter> https://bkaradzic.github.io/bgfx/examples.html#nbody |
14:20:22 | FromGitter | <gogolxdong> from this doc https://github.com/KhronosGroup/Vulkan-Docs/blob/master/xml/vk.xml, right? |
14:20:28 | FromGitter | <Clyybber> Yeah |
14:20:55 | * | gangstacat joined #nim |
14:21:12 | FromGitter | <gogolxdong> you are doing similiar job. |
14:21:45 | * | dddddd joined #nim |
14:21:52 | FromGitter | <Clyybber> I'm generating a wrapper using a patched c2nim |
14:21:54 | FromGitter | <zacharycarter> I think if anyone really wants a large project to tackle in GPU programming |
14:22:05 | FromGitter | <zacharycarter> it's to build a library like BGFX/ gfx-rs entirely in native Nim |
14:22:35 | FromGitter | <gogolxdong> Why do you need compute shader? |
14:22:49 | FromGitter | <zacharycarter> although - I think these projects are demonstrating how difficult it is to achieve such a design |
14:22:53 | FromGitter | <zacharycarter> with the more modern gfx apis |
14:23:18 | FromGitter | <Clyybber> @gogolxdong I need it for my map generation algorithm |
14:23:30 | FromGitter | <Clyybber> Which is too slow on CPU |
14:23:41 | FromGitter | <zacharycarter> have you tried using SIMD instructions? |
14:23:56 | FromGitter | <Clyybber> That isn't the problem, its NP-problem |
14:23:59 | FromGitter | <zacharycarter> ah |
14:24:13 | FromGitter | <Clyybber> It's essentially a more generalised version of WFC |
14:24:39 | FromGitter | <Clyybber> I had it implemented in lua, but it was way too slow |
14:24:48 | FromGitter | <zacharycarter> interesting |
14:24:56 | FromGitter | <Clyybber> So I implemented it in C, which I didn't finish |
14:25:02 | FromGitter | <zacharycarter> I haven't played with WFC yet |
14:25:14 | FromGitter | <mratsim> How is Vulkan Compute btw. so far I’m really skeptical on their generalisation to tensors |
14:25:37 | FromGitter | <Clyybber> So I tried to do it in openCL, which is fairly unsupported/outdated on a lot of drivers |
14:39:41 | FromGitter | <Clyybber> @mratsim It's great, I'm essentially just writing opengl shaders |
14:40:03 | FromGitter | <mratsim> Shaders are not powerful enugh for machine learning :/ |
14:40:15 | FromGitter | <Clyybber> Yeah |
14:41:47 | FromGitter | <zacharycarter> @Clyybber / @gogolxdong - that theforge project I linked to might be of interest to you |
14:41:53 | FromGitter | <zacharycarter> although I'm not sold on it |
14:41:56 | FromGitter | <Clyybber> I saw it |
14:42:01 | FromGitter | <Clyybber> Looks interesting |
14:42:05 | FromGitter | <Clyybber> but kinda inactive |
14:42:24 | FromGitter | <zacharycarter> I think they're active - but how active is a good question |
14:42:35 | FromGitter | <zacharycarter> also it doesn't seem to have much of a community beyond a twitter account |
14:43:18 | FromGitter | <zacharycarter> https://github.com/hugoam/mud - is a neat project too |
14:43:21 | FromGitter | <Clyybber> @mratsim I think SPIRV has the capabilities, its just that its not used yet |
14:44:56 | FromGitter | <Clyybber> Also there is https://github.com/google/clspv |
14:46:49 | FromGitter | <zacharycarter> @Clyybber - what kind of game are you making? |
14:46:53 | FromGitter | <zacharycarter> obviously it has a procedural component |
14:47:20 | FromGitter | <Clyybber> Takes place on a procedural space station |
14:47:28 | FromGitter | <Clyybber> Top down 2d |
14:47:30 | * | kapil____ quit (Quit: Connection closed for inactivity) |
14:47:53 | FromGitter | <Clyybber> And for the gameplay, imagine taking alien isolation and trying to make it 2d |
14:48:07 | FromGitter | <Clyybber> Or Prey 2017 |
14:48:51 | FromGitter | <Clyybber> And I would like to someday use arraymancer to provide some lstm based onboard AI |
14:48:58 | FromGitter | <zacharycarter> cool |
14:49:15 | FromGitter | <Clyybber> Also I love systemshock, so hopefully that will show eventually |
14:49:20 | FromGitter | <zacharycarter> so I did this proc gen project a while ago where I was generating the interior of spaceships |
14:49:32 | FromGitter | <zacharycarter> and the spaceships themselves actually |
14:49:36 | FromGitter | <zacharycarter> it was 2d top down |
14:49:40 | FromGitter | <Clyybber> Oh, do you have screenshots? |
14:49:49 | FromGitter | <Clyybber> That looks pretty interesting |
14:49:52 | FromGitter | <zacharycarter> I think I deleted most of them - but I do have some of the proc gen code ported to Nim |
14:49:58 | FromGitter | <zacharycarter> I also added lock and key zelda puzzles to them |
14:50:04 | FromGitter | <Clyybber> Nice |
14:50:14 | FromGitter | <zacharycarter> generating those was difficult but fun |
14:50:24 | FromGitter | <Clyybber> I imagine |
14:50:44 | FromGitter | <zacharycarter> https://github.com/zacharycarter/NimRL |
14:50:57 | FromGitter | <Clyybber> Oh, nims error messages are broken when declaring a variable with the same identifier as an imported module |
14:50:58 | FromGitter | <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:11 | FromGitter | <Clyybber> So it was room based? |
14:52:14 | FromGitter | <zacharycarter> mmhmm |
14:52:29 | FromGitter | <zacharycarter> it wasn't very realistic |
14:52:56 | FromGitter | <Clyybber> My approach will be to create parts of the space station and use the algorithm to assemble them |
14:53:18 | FromGitter | <zacharycarter> yeah - I think that can work too |
14:54:00 | FromGitter | <zacharycarter> this was another fun project I worked on several years ago - https://github.com/zacharycarter/mapgen |
14:54:07 | FromGitter | <zacharycarter> or a couple I guess |
14:54:13 | FromGitter | <zacharycarter> this was right before I switched to Nim |
14:54:44 | FromGitter | <Clyybber> That looks really cool |
14:54:50 | FromGitter | <zacharycarter> thanks |
14:54:50 | FromGitter | <zacharycarter> https://imgur.com/a/CoLac |
14:54:55 | FromGitter | <zacharycarter> I really like the gif at the top of that album |
14:55:05 | FromGitter | <zacharycarter> I added height maps and a shader to fake lighting over the map |
14:55:24 | FromGitter | <Clyybber> Do the heights affect the clouds? |
14:55:48 | FromGitter | <zacharycarter> the clouds were actually just another shader I ran on top of everything else |
14:55:59 | FromGitter | <zacharycarter> I had the height data in memory so if I had wanted to do something like that eventually I could have |
14:56:08 | FromGitter | <Clyybber> Ah |
14:56:22 | FromGitter | <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:56 | FromGitter | <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:30 | FromGitter | <Clyybber> Oh boi im still into roguelikes |
14:57:30 | FromGitter | <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:31 | FromGitter | <Clyybber> and 2d |
14:57:49 | FromGitter | <zacharycarter> it's a fun hole to get into :) |
14:57:55 | FromGitter | <Clyybber> @zacharycarter You have so many projects :D |
14:58:02 | FromGitter | <Clyybber> Inspiring |
14:58:18 | FromGitter | <alehander42> that's interesting, i've always liked proced generation |
14:58:26 | FromGitter | <alehander42> i've played with the idea of city generation |
14:58:30 | FromGitter | <zacharycarter> haha thanks! none of them really have reached a significant level of maturity - just little toy examples / experiments |
14:58:33 | FromGitter | <Clyybber> I made a small roguelike in racket in highscool during class |
14:58:40 | FromGitter | <alehander42> i remember i found some very interesting approaches on twitter |
14:58:43 | FromGitter | <alehander42> but can't find them anymore |
14:58:45 | FromGitter | <zacharycarter> but I hope to make an actual game this time |
14:58:54 | * | nsf quit (Quit: WeeChat 2.3) |
14:59:20 | FromGitter | <zacharycarter> it seems that lritter on twitter is building his new engine specifically geared towards procgen |
14:59:26 | FromGitter | <zacharycarter> with his programming language scopes |
14:59:46 | FromGitter | <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:58 | FromGitter | <zacharycarter> but he had all sorts of crazy libraries I hadn't heard of in his project |
15:00:10 | FromGitter | <zacharycarter> and it seemed like most of them were specifically geared towards his procgen efforts |
15:01:21 | FromGitter | <zacharycarter> https://bitbucket.org/duangle/tukan/wiki/Home |
15:01:53 | FromGitter | <zacharycarter> https://bitbucket.org/duangle/tukan/src/556310272637d67525f5821a22549800e0b646d4/externals/?at=default |
15:02:21 | FromGitter | <Clyybber> @alehander42 URR has some very cool city generation |
15:03:22 | FromGitter | <zacharycarter> https://github.com/memononen/libtess2 |
15:04:15 | FromGitter | <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:33 | FromGitter | <alehander42> @Clyybber URR looks pretty interesting conceptually, thanks |
15:04:36 | FromGitter | <zacharycarter> https://ccrma.stanford.edu/software/stk/ |
15:06:16 | FromGitter | <zacharycarter> there were some others too I think |
15:06:43 | FromGitter | <zacharycarter> Tukan seems like an interesting engine project to dig through |
15:06:54 | FromGitter | <zacharycarter> I don't find scopes to terribly hard to read |
15:08:59 | * | xace joined #nim |
15:13:23 | FromGitter | <zacharycarter> this is neat - https://interplayoflight.wordpress.com/2018/03/05/porting-gpu-driven-occlusion-culling-to-bgfx/ |
15:16:51 | shashlick | @Clyybber: am now generating distinct int when wrapping C enums in nimterop - pushed the changes last night |
15:17:35 | shashlick | So unordered enums can now be managed automatically instead of requiring edits |
15:17:36 | FromGitter | <Clyybber> I did the same thing for c2nim |
15:18:12 | FromGitter | <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:10 | FromGitter | <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:49 | shashlick | Vulkan has some crazy enums, if I remember correctly |
15:23:26 | shashlick | I still don't handle expressions but it's easy to enhance |
15:24:19 | shashlick | Will 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:18 | FromGitter | <Clyybber> shashlick: I have a macro that generates `+` and `-` for those distinct ints |
15:46:31 | FromGitter | <Clyybber> If you need it |
15:49:49 | * | nsf joined #nim |
15:51:11 | * | smitop joined #nim |
15:52:46 | FromGitter | <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:26 | shashlick | Thanks folks - @Clyybber please share |
15:59:29 | FromGitter | <Clyybber> shashlick: Its the beginning of this file: https://github.com/Clyybber/vulkanim/blob/master/vulkan.nim |
15:59:32 | shashlick | @arnetheduck: I still remember your challenge to wrap llvm |
15:59:52 | FromGitter | <arnetheduck> oh right, there was a 🍺 staked! |
16:00:06 | shashlick | ;) |
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:12 | dom96 | JS backend doesn't seem to show stack traces? |
16:42:28 | dom96 | had to "Pause on exceptions" in the debugger to get the stack trace |
16:43:05 | shashlick | @arnetheduck: rebuild.sh looks quite straight forward |
16:43:14 | shashlick | Did you do any manual edits of llvm |
16:44:05 | FromGitter | <arnetheduck> @shashlick yeah - that's not documented but I have to comment out some parts for c2nim to run |
16:44:16 | FromGitter | <sheerluck> hi. I can not find Associative array aka map aka dict in Nim, please help |
16:44:20 | FromGitter | <arnetheduck> in a perfect world, the script would take care of that :) |
16:45:03 | FromGitter | <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:42 | FromGitter | <SolitudeSF> @sheerluck https://nim-lang.org/docs/tables.html |
16:45:49 | FromGitter | <SolitudeSF> aka table |
16:45:53 | FromGitter | <sheerluck> Thank you |
16:56:01 | * | craigger quit (Quit: bye) |
16:58:35 | * | vlad1777d joined #nim |
16:58:49 | shashlick | @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:46 | shashlick | I think the macro generated functions is the main obstacle right now |
17:02:22 | shashlick | I'll have to see if gcc has a way to show that |
17:02:44 | shashlick | Nimterop uses gcc to get all relevant #defines |
17:03:00 | shashlick | Works well mostly |
17:03:14 | shashlick | But again, only limited testing |
17:03:48 | shashlick | The advantage, in my mind, is that nimterop will wrap everything it recognizes and moves on |
17:04:19 | shashlick | So you can still get partial wrapping without any source file edits |
17:04:51 | shashlick | So if you want to use nimterop to convert just the enums in vulkan, it is possible |
17:08:16 | shashlick | Baby steps |
17:33:21 | shashlick | So while the Nim forum is great, it would be better if questions were managed on stack overflow |
17:33:41 | shashlick | That way, when Nim is measured there, it is large enough |
17:35:28 | FromGitter | <sheerluck> @SolitudeSF nice https://github.com/SolitudeSF/adventOfCode btw |
17:51:06 | shashlick | https://stackoverflow.com/help/product-support |
17:58:05 | FromDiscord_ | <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:35 | FromDiscord_ | <LimeBlack> Hey guys, any idea how to move data ( seq[string] ) from compileTime to runTime without write it into a file? |
18:13:20 | FromDiscord_ | <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:40 | FromGitter | <Clyybber> There is a way |
18:13:46 | FromGitter | <Clyybber> Im doing that for shaders |
18:13:55 | FromGitter | <Clyybber> I'll look up the exact code |
18:14:06 | FromDiscord_ | <LimeBlack> cool thx 😃 |
18:17:24 | dom96 | hotdog: I think you can call redraw() |
18:18:33 | FromGitter | <Clyybber> @LimeBlack You basically create a `const` variable and set that to your compileTime data |
18:19:16 | FromDiscord_ | <LimeBlack> sounds logical, i'll try |
18:19:22 | FromGitter | <Clyybber> Because `const` variables are created at compile time but available at run time |
18:22:16 | FromDiscord_ | <LimeBlack> i need to create a macro which creates my const right?, or is there a shorter way? |
18:22:59 | FromDiscord_ | <LimeBlack> sorry iam new to this compileTime stuff 😊 |
18:24:14 | FromGitter | <Clyybber> No need for a macro |
18:25:20 | FromGitter | <Clyybber> Just do: ⏎ ⏎ ```const test = compileTimeStuff ⏎ doSomethingThatTakesRuntimeStuff(test)``` [https://gitter.im/nim-lang/Nim?at=5c25191009b8066849734029] |
18:26:33 | FromDiscord_ | <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:26 | FromDiscord_ | <hotdog> @dom96 that worked, thanks! |
18:29:26 | * | OrganicAnywhere joined #nim |
18:39:44 | * | vlad1777d quit (Remote host closed the connection) |
18:42:11 | OrganicAnywhere | How do I create a pointer? |
18:42:15 | * | vlad1777d joined #nim |
18:44:36 | dom96 | OrganicAnywhere: addr variable |
18:45:14 | FromGitter | <Clyybber> And for immutable variables do `unsafeAddr variable` |
18:48:15 | dom96 | (but be careful) |
18:49:02 | dom96 | Yay. Snake is now updated to the latest and greatest version compiled with Nim devel. |
18:49:09 | dom96 | Plus I implemented replays: https://picheta.me/snake/ |
18:49:13 | dom96 | (Just press 'r') |
18:49:37 | dom96 | (Also, flags work again!) |
18:49:44 | * | dorelix joined #nim |
18:50:12 | OrganicAnywhere | Could you give me a syntax example? Let's say I want to create a pointer to an int. |
18:51:30 | FromGitter | <Clyybber> ```var somePointer: ptr int``` |
18:51:45 | FromGitter | <Clyybber> That was the declaration |
18:52:26 | FromGitter | <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:39 | OrganicAnywhere | What's the difference between the two? |
18:55:57 | OrganicAnywhere | Other than that in the second one you say "point to this specific address" |
18:56:56 | FromGitter | <Clyybber> In the first example the pointer points to nothing |
18:57:10 | FromGitter | <Clyybber> In the second it actually points to somewhere |
18:57:32 | FromGitter | <Clyybber> The first is called a nullptr in other languages such as C++ or NULL in C |
18:57:47 | FromGitter | <Clyybber> or nil in Nim or lua |
18:57:53 | OrganicAnywhere | Ok, as I thought. |
18:58:28 | OrganicAnywhere | Is there away to print (echo) the address that a pointer points to? I remember doing that in C. |
18:59:46 | FromGitter | <Clyybber> I think you can do `$somePointer` |
19:00:00 | FromGitter | <Clyybber> 1) `echo $somePointer` |
19:00:49 | OrganicAnywhere | Hmm... didn't work. |
19:01:13 | FromGitter | <coffeepots> `echo somePointer.repr` |
19:01:21 | FromGitter | <Clyybber> Yeah, repr always works |
19:02:33 | OrganicAnywhere | That works. |
19:02:47 | * | skelett joined #nim |
19:03:07 | OrganicAnywhere | I 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:59 | Zevv | imho "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:30 | Zevv | for the pointer part, you can also cast explicitly: echo cast[int](somePointer) |
19:24:27 | dom96 | OrganicAnywhere: 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:51 | OrganicAnywhere | dom96: 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:27 | Zevv | dom96: 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:59 | dom96 | Zevv: I believe I've got a PR open for that |
19:40:09 | Zevv | ok |
19:43:43 | Zevv | oh 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:29 | dom96 | Zevv: Good timing :) |
20:06:32 | OrganicAnywhere | dom96: 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:44 | FromGitter | <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:04 | FromGitter | <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:30 | OrganicAnywhere | coffeepots: That site is... very useful. Thank you! |
20:32:35 | FromGitter | <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:39 | OrganicAnywhere | FromGitter: I read that... I didn't find it very useful... |
20:32:39 | FromGitter | OrganicAnywhere, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
20:32:59 | OrganicAnywhere | Oh, nvm |
20:33:00 | OrganicAnywhere | hah |
20:33:24 | OrganicAnywhere | Yes, there is quite enough there to keep me occupied for a while :) |
20:33:31 | Zevv | dom96: while speaking about the async stuff |
20:33:46 | Zevv | what is the rationale for having a separate asyncfd and asyncsocket subsystem? |
20:34:02 | Zevv | they share so much of the functionality, why is there not just one? |
20:34:05 | dom96 | efficiency, asyncsocket is a relatively heavy object |
20:34:42 | Zevv | but without asyncsocket I can not bind a port, even if I wanted to use asyncfds instead |
20:35:28 | Zevv | or is it mainly becasue of all the buffering that is done in the object |
20:37:35 | Zevv | there is accept in asyncfd, but no bind or connect. It caused me some confusion in my first nim days |
20:45:17 | dom96 | there is accept IIRC |
20:45:26 | dom96 | it's all defined in asyncdispatch |
20:45:34 | dom96 | this is also roughly how net/nativesockets works |
20:48:44 | Zevv | ok, 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:54 | Zevv | thanks |
20:51:02 | dom96 | I 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:22 | dom96 | (that is the selectors module) |
20:52:41 | Zevv | ok, that makes sense |
20:53:17 | * | kungtotte joined #nim |
20:55:36 | Zevv | leaves me with one question: what is the typical use case for asyncfd then? |
20:55:55 | Zevv | because 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:58 | dom96 | It's mainly a low-level implementation |
21:12:46 | Zevv | ok, 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:46 | hogeland | [I/1 |
22:39:50 | hogeland | whoops |
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:00 | FromGitter | <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:45 | FromGitter | <rayman22201> https://nim-lang.org/docs/system.html#createShared%2Ctypedesc maybe? |