00:03:49 | FromGitter | <Varriount> zachcarter: You have a use for it? |
00:04:13 | zachcarter | not at the moment, but maybe when / if I ever get back to that Nim spine runtime |
00:04:35 | zachcarter | I have a tough time getting motivated to write that runtime though, since the bindings to the C runtime work |
00:04:47 | FromGitter | <Varriount> But the C runtime has a really odd license. |
00:04:52 | zachcarter | and I have a billion other things I could do |
00:04:52 | zachcarter | true |
00:05:09 | zachcarter | I spoke with someone a little more knowledgeable about that licensing situation than I did |
00:05:18 | zachcarter | err than I am |
00:05:52 | zachcarter | he said not to be too concerned about having to include the spine runtime license, because anyone that uses the product should already own a copy of it / have a copy of the license |
00:06:59 | zachcarter | either way I’m making support for spine totally optional in frag so it’s ultimately up to the user as to whether they want it or not |
00:07:16 | zachcarter | I’m probably not going to be using spine much - I don’t have any artist friends that can produce art for it for me |
00:09:07 | * | chinchilla joined #nim |
00:12:23 | FromGitter | <Varriount> I can do vector art, not sure how good I would be at video game art though. |
00:19:02 | * | Matthias247 quit (Quit: Matthias247) |
00:19:10 | zachcarter | ooo |
00:19:20 | zachcarter | well spine is basically made for vector art |
00:19:31 | zachcarter | not sure how much you like making art ;P |
00:21:00 | zachcarter | spine does seem pretty powerful though |
00:23:11 | * | PMunch quit (Quit: leaving) |
00:25:40 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
00:27:47 | FromGitter | <Varriount> It would probably take practice to "get up to speed" with regards to game art. |
00:28:19 | FromGitter | <Varriount> Although, the thing with Spine is that you only need it if your graphics are at a certain level of complexity. |
00:30:09 | zachcarter | yeah |
00:30:23 | zachcarter | and I imagine with the 3/4 perspective I’m going for, spine isn’t going to buy me much / if anything |
00:30:58 | zachcarter | I dunno art is something I always dance around and never have a good answer to |
00:31:59 | zachcarter | https://media.giphy.com/media/3oz8xBhVpOvJPuB37G/giphy.gif |
00:32:12 | zachcarter | that’s the art I was producing for my last attempt at my game |
00:35:02 | FromGitter | <Varriount> It all depends on the style you're going for. |
00:35:30 | FromGitter | <Varriount> I'm more familier with adventure-game style art, especially the low-res style |
00:35:34 | * | cjbayliss joined #nim |
00:35:56 | * | cjbayliss left #nim (#nim) |
00:36:14 | FromGitter | <Varriount> zacharycarter: Like this - http://www.wadjeteyegames.com/games/blackwell-epiphany/ |
00:46:57 | zachcarter | Varriount: ah yeah spine would work great for something like that |
00:51:02 | FromGitter | <Varriount> zachcarter: No slight intended, but I *love* adventure games. |
00:51:13 | zachcarter | :D |
00:51:26 | zachcarter | I haven’t played any in a while but I do remember liking them a lot back in the day |
00:51:43 | FromGitter | <Varriount> I played a bunch of adventure games targeted at children growing up. |
00:52:03 | zachcarter | yeah, they even make good ones for adults too |
00:52:28 | FromGitter | <Varriount> https://en.wikipedia.org/wiki/Putt-Putt_(series) |
00:52:34 | FromGitter | <Varriount> :3 |
00:52:51 | zachcarter | ahaha |
00:52:54 | zachcarter | never heard of this |
00:53:10 | zachcarter | but yeah I remember playing so many adventure games growing up |
00:53:42 | zachcarter | I guess lately roguelikes have just grabbed my attention because of all the proc gen |
00:54:09 | * | nsf quit (Quit: WeeChat 1.7) |
00:57:07 | zachcarter | speaking of procgen, I’m close to being finished porting the logic of my ship blueprint generator from Java to Nim |
00:57:18 | FromGitter | <Varriount> zachcarter: If you need someone to compose music, I recommend this guy: https://virt.bandcamp.com/music |
00:57:32 | FromGitter | <Varriount> Although, considering the work he's done so far, I doubt he's cheap. |
00:57:54 | zachcarter | yeah |
00:58:00 | zachcarter | he’s good though |
00:58:03 | zachcarter | listening now |
00:58:09 | zachcarter | can crank out some midis haha |
00:58:19 | FromGitter | <Varriount> https://virt.bandcamp.com/album/cat-girl-without-salad-amuse-bouche-extra-crispy-or-original-soundtrack |
00:58:55 | zachcarter | damn yeah he’s good |
01:03:52 | * | libman joined #nim |
01:11:01 | * | bjz joined #nim |
01:31:15 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:36:11 | * | arnetheduck joined #nim |
02:02:14 | * | chemist69 quit (Ping timeout: 246 seconds) |
02:14:43 | * | chemist69 joined #nim |
02:35:19 | zachcarter | Hoping someone can help me with this pretty simple question |
02:35:41 | zachcarter | I have some iteration logic I need to move into a template or something - I’m not sure what the best way to do this is |
02:35:42 | zachcarter | https://gist.github.com/zacharycarter/34aaa1bd5e2877d3ab4f3ad22d0e4d01#file-how_to_repeat-nim-L2-L27 |
02:35:55 | zachcarter | I essentially need to make that check repeatable |
02:36:05 | zachcarter | and then the code beneath it will change depending on the proc called |
02:39:09 | zachcarter | nevermind figured it out |
02:39:16 | zachcarter | discovered iterators :P |
02:45:35 | * | Yuken_ quit (Read error: Connection reset by peer) |
02:50:31 | * | bjz joined #nim |
02:55:22 | * | gangstacat joined #nim |
03:29:50 | * | def-pri-pub quit (Quit: leaving) |
03:59:27 | * | dexterk joined #nim |
04:20:32 | ldlework | template `as` (a, b: untyped): untyped = ((b)a) |
04:28:18 | zachcarter | sweet! |
04:28:23 | ldlework | hehe |
04:28:27 | zachcarter | my spaceship blueprint generator is working |
04:28:37 | zachcarter | well that template is cool too haha |
04:28:44 | ldlework | oh :) |
04:28:50 | zachcarter | http://imgur.com/a/piPCz |
04:29:01 | zachcarter | I guess I should fill that up with more images |
04:29:06 | ldlework | using cellular automata? |
04:29:32 | ldlework | I know the game of life when I see it |
04:29:54 | zachcarter | nope |
04:30:19 | ldlework | ya right |
04:30:47 | zachcarter | http://davebollinger.org/works/pixelspaceships/ |
04:31:01 | zachcarter | it’s essentially CA |
04:31:19 | zachcarter | flipping cells on off |
04:31:29 | zachcarter | but it’s not really random |
04:31:49 | zachcarter | I guess it’s just a specific ruleset |
04:32:16 | zachcarter | I don’t know, I just know I didn’t approach the problem by using CA I just kind of used that algorithm he proposes in that paper |
04:32:29 | ldlework | what paper? |
04:32:37 | zachcarter | or article rather |
04:32:53 | ldlework | I don't even really see an algorithm described here.. |
04:32:56 | zachcarter | blog post |
04:33:45 | zachcarter | I guess he’s just describing a CA ruleset |
04:33:58 | ldlework | like i said, I know it when I see it :D |
04:34:03 | zachcarter | haha yeah |
04:34:19 | ldlework | zachcarter: have you ever read A New Kind of Science? |
04:34:27 | zachcarter | nope |
04:34:36 | ldlework | its brilliant |
04:34:46 | zachcarter | I’ll check it out |
04:34:52 | ldlework | and available for free online, http://www.wolframscience.com/nksonline/toc.html |
04:35:03 | ldlework | but it looks much cooler on my bookshelf :) |
04:35:11 | zachcarter | hahaha |
04:35:14 | zachcarter | they always do |
04:35:18 | ldlework | though its currently out on trade for my co-worker's copy of GEB |
04:36:15 | zachcarter | speaking of which i need to get a C book back from a co-worker |
04:37:19 | ldlework | zachcarter: you should make your spaceship generator a separate library |
04:37:29 | zachcarter | I will |
04:37:36 | zachcarter | well it’s going to be a part of my game |
04:37:44 | zachcarter | but if someone else wants to use it they can |
04:37:49 | zachcarter | it does much more than this though |
04:37:57 | ldlework | what does |
04:38:02 | zachcarter | the generator |
04:38:07 | ldlework | in what sense |
04:38:25 | zachcarter | well this is just a blueprint for a spaceship, I then interpret this bitmap image and generate an actual map from it with corridors and rooms |
04:38:45 | ldlework | Oh sure |
04:38:46 | zachcarter | and then I also generate lock and key puzzles for that layout |
04:38:49 | ldlework | I thought maybe you meant the CA bit |
04:38:57 | zachcarter | ah yeah, I can put that out there too |
04:39:19 | zachcarter | the code is up right now actually |
04:39:30 | ldlework | zachcarter: are you making a no man's sky roguelike |
04:40:22 | zachcarter | I haven’t really played NMS |
04:40:24 | zachcarter | so I’m not sure haha |
04:40:33 | ldlework | certainly you know what it is |
04:40:36 | zachcarter | I guess it has similiarities in that you’re exploring procedurally crafted universes |
04:40:37 | zachcarter | sure |
04:40:49 | zachcarter | but I don’t plan to focus on the same areas of gameplay they did |
04:40:58 | ldlework | well its a roguelike so I'd hope not |
04:41:05 | zachcarter | yeah exactly |
04:41:33 | zachcarter | you said you were working on a roguelike as well? |
04:41:53 | ldlework | yeah |
04:42:10 | zachcarter | DDA clone |
04:42:12 | ldlework | Inspired by cataclysm, but with less focus on sci-fi disaster and more on naturalism |
04:42:14 | zachcarter | oh |
04:42:17 | zachcarter | that’s right |
04:42:25 | ldlework | with some magical realism |
04:42:43 | zachcarter | I read that article last night |
04:42:44 | ldlework | basically you will get stronger as ou age |
04:42:52 | ldlework | until you are getting weaker with age |
04:42:59 | ldlework | eventually you will die from something |
04:43:36 | zachcarter | are you going to do any kind of legacy system? |
04:44:07 | ldlework | haven't thought that far ahead really |
04:44:17 | ldlework | I'm mostly thinking about data structures and stuff |
04:44:21 | zachcarter | right |
04:44:23 | ldlework | I want everything defined by data |
04:44:48 | ldlework | I mean as much as makes sense to do so |
04:45:01 | ldlework | But cataclysm is highly driven through json content rather than new code |
04:45:06 | ldlework | I wanna try to achieve that |
04:45:18 | ldlework | but with super factored nim code |
04:45:21 | ldlework | :P |
04:45:24 | zachcarter | :) |
04:45:36 | ldlework | It seems like we're working on a lot of the same stuff |
04:46:00 | zachcarter | yeah, definitely |
04:46:34 | ldlework | You make me want to build an 1D automata explorer example for Dadren |
04:46:37 | zachcarter | Nim is a good language for game programming and especially data heavy games I think |
04:46:44 | zachcarter | :D |
04:46:44 | ldlework | You should really give A New Kind of Science a go |
04:46:51 | ldlework | Its a brilliant book |
04:46:57 | zachcarter | I just read a few pages of the intro it definitely has my attention |
04:47:08 | ldlework | It really confirmed my materialism |
04:47:42 | ldlework | I really wanna spoil the last few chapters but I wont |
04:47:51 | ldlework | though its a huge book, if you don't end up reading it, tell me and I'll spoil it |
04:47:58 | zachcarter | haha okay :D |
04:49:32 | ldlework | My top 4 non-fiction books to change your life are: Stephen Wolfram's _A New Kind of Science_, Jeff Hawkin's _On Intelligence_, Michael Graziano's _The Social Brain_ and Sam Harris' _Free Will_ |
04:50:36 | zachcarter | I don’t read enough :/ |
04:50:44 | zachcarter | or I read too much nonsense I suppose |
04:51:29 | ldlework | I've been reading like crazy |
04:51:30 | ldlework | I don't know why, its like a fever |
04:51:32 | ldlework | If you want a tiny small book (took me 2 hours to read) to get you back in the mood |
04:51:33 | ldlework | to entice your brain back to the value of books without a huge investment |
04:51:40 | ldlework | The Divine Farce is 10 bucks on amazon and incredibly jam packed with philosophical implications |
04:52:31 | libman | 3 of those 4 are on That Swedish Site. 2 also as audio. ;-) |
04:52:43 | zachcarter | huh sounds interesting, just reading the synopsis |
04:52:50 | ldlework | Its a simple allegory, akin to Dante's The Divine Comedy, but shorter and with simple language |
04:52:51 | ldlework | "Three strangers are condemned to live together in darkness, crushed together in a concrete stall so small that they can never sit down. Liquid food drips down from above. Waste drains through a grid on the floor. So begins one of the strangest, most surreal comments on the human experience, on love and hatred and the human ability to find good in any situation, no matter how difficult. " |
04:52:55 | zachcarter | right |
04:53:02 | ldlework | I think this book can really help one appreciate what they should do in life |
04:53:46 | * | libman reads too much, and writes too little. |
04:55:01 | ldlework | libman: all of sam harris' books should be listened to imo |
04:55:52 | ldlework | great orator |
04:56:28 | ldlework | I try to audiobook when possible. Before sleep in bed, with a sleep timer, and the speed kicked up to about 1.33x :) |
04:56:46 | ldlework | you'd be surprised how many books you can go through that way |
04:56:58 | ldlework | and how clearly you can recieve an author's message when it is the only content of your consciousness |
04:58:29 | libman | I've gotten prothletising atheism out of my system when I was 12. |
04:58:57 | ldlework | None of his books are about athesism in so much that they take it as a premise. |
04:59:07 | ldlework | Besides maybe one book, the end of faith. |
04:59:09 | ldlework | That's it. |
04:59:29 | ldlework | His other books are about mindfulness, spirtuality, and secular ethics. |
04:59:57 | ldlework | Having granted him a material universe, since that's the one he takes and orients his frameworks for thinking. |
05:00:58 | libman | I don't need ethics lessons from apologists for The Almighty Gov. |
05:01:28 | ldlework | okie dokie |
05:04:25 | ldlework | libman: Jan Helfeld is probably more your bag :) |
05:04:44 | ldlework | who is like a superhero who's power is the socratic metho |
05:04:47 | ldlework | d |
05:05:04 | ldlework | https://www.youtube.com/watch?v=tBIKP4W50-I |
05:06:05 | libman | Yup, now there's a rational skeptic. But all this is off-topic for this channel. |
05:07:04 | libman | Except Wolfram. He's always on topic. |
05:52:52 | * | zachcarter quit (Quit: zachcarter) |
06:07:07 | * | yglukhov joined #nim |
06:17:47 | * | Nobabs27 quit (Quit: Leaving) |
06:30:59 | ldlework | Varriount, I have a new challenge if you're interested |
06:31:35 | FromGitter | <Varriount> Oh? |
06:32:11 | * | vlad1777d joined #nim |
06:36:02 | ldlework | ya one second |
06:37:20 | ldlework | Varriount, https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim |
06:37:31 | ldlework | try to change BSPNode.parent to a ParentNode |
06:38:16 | ldlework | (as to avoid casting elsewhere) |
06:41:27 | FromGitter | <Varriount> Apparently one of my dogs doesn't mind having a laptop on top of her |
06:43:58 | ldlework | hehe |
06:48:55 | ldlework | Varriount do you understand the problem? |
06:49:58 | FromGitter | <Varriount> How should I build this? |
06:50:35 | ldlework | Varriount, from inside examples/bsp2/ do cd ../../ && nimble install -y; cd examples/bsp2 && make run |
06:52:04 | FromGitter | <Varriount> I think the example just crashed the graphics driver |
06:53:19 | ldlework | what |
06:54:42 | FromGitter | <Varriount> I ran it, and my screen went black |
06:55:37 | FromGitter | <Varriount> And unlike Windows, OSX doesn't attempt to restart the display driver. :X |
06:56:20 | ldlework | I dunno why it would do that |
06:59:34 | Araq | to refute materialism all you need to do is to cut your finger, but that's offtopic |
07:02:20 | FromGitter | <Varriount> I'm not getting any problem. |
07:05:25 | FromGitter | <Varriount> ldlework: By the way, your makefile refuses to run on OSX |
07:07:00 | FromGitter | <Varriount> It doesn't create the "bin" directory. |
07:08:32 | FromGitter | <Varriount> ldlework: ? |
07:09:27 | Araq | http://physics.stackexchange.com/questions/19647/can-cellular-automata-be-reconcilied-with-quantum-mechanics there, it doesn't work, I saved you the time, you don't need to read the book ;-) |
07:12:10 | FromGitter | <Varriount> ldlework: By the way, you might find a performance increase if you use a sequence base allocation scheme for all the nodes, instead of using references. You'll get better locality of reference. |
07:13:18 | ldlework | Varriount will that sacrifice readability? |
07:13:26 | ldlework | Varriount, were you able to run the example? |
07:14:27 | FromGitter | <Varriount> ldlework: I was able to run the example, even after changing `BSPNode.parent` to type `ParentNode[T]` |
07:14:36 | ldlework | wat |
07:15:04 | ldlework | /home/dlacewell/.nimble/pkgs/dadren-0.1.0/dadren/bsp.nim(31, 9) Error: attempting to call undeclared routine: 'parent=' |
07:15:20 | ldlework | as soon as I change to: parent*: ParentNode[T] |
07:15:23 | FromGitter | <Varriount> did you forget to commit some changes to the repo? |
07:15:47 | ldlework | no |
07:16:03 | ldlework | Varriount, are you using master? |
07:21:09 | FromGitter | <Varriount> Oh wait, stale installation |
07:21:29 | FromGitter | <Varriount> I just ended up using 'nim c --run --path:../../` |
07:21:53 | FromGitter | <Varriount> I get "Error: inheritance only works with non-final objects" |
07:23:49 | ldlework | Varriount, you're on eb2c25ae0aaac251960efc6d2d00fd435fe515d9 ? |
07:24:04 | ldlework | "Change newSibling back to method to clean up split" |
07:24:06 | ldlework | ? |
07:25:01 | FromGitter | <Varriount> Yes. |
07:25:23 | ldlework | dunno why we get different errors |
07:26:30 | ldlework | Varriount what version of Nim do you use? |
07:26:37 | ldlework | 0.16 or devel? |
07:27:55 | FromGitter | <Varriount> I haven't added any conversions/casts. It's choking at line 30, because a value of type `Leaf[T` is being assigned to a value of type `ParentNode[T]` |
07:28:17 | FromGitter | <Varriount> Why do you need that change anyway? |
07:28:40 | ldlework | Varriount, line 30 https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim#L30 |
07:28:56 | ldlework | how is this assigning a Leaf[T] to a ParentNode[T]? |
07:29:08 | ldlework | Varriount, the change is "needed" because that's the correct expression of the program. |
07:29:19 | ldlework | Only ParentNode[T] should ever be assigned as a parent |
07:29:25 | ldlework | if a Leaf[T] was ever assigned it would be broken |
07:29:52 | ldlework | Right now I have to cast from BSPNode[T] to ParentNode[T] anytime I access it |
07:30:14 | ldlework | here: https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim#L134 |
07:30:24 | ldlework | here: https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim#L160 |
07:30:31 | ldlework | here: https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim#L172 |
07:30:39 | ldlework | here: https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim#L177 |
07:33:49 | * | yglukhov quit (Remote host closed the connection) |
07:33:51 | FromGitter | <Varriount> You could have just told me the line numbers. |
07:35:01 | ldlework | we aint paying by the byte, thought it was a convenience |
07:39:00 | FromGitter | <Varriount> Well, I keep getting this: https://gist.github.com/Varriount/d1827ffa7b98bb4121eb76a5c7ef49bf |
07:40:25 | FromGitter | <Varriount> @Araq Any idea why we would be getting the above error with generics? all of them inherit |
07:40:27 | ldlework | Varriount, what version of nim do you use? |
07:40:53 | * | ngc quit (Quit: Leaving) |
07:43:24 | ldlework | Varriount, upgrade to devel, I now get the same error |
07:43:30 | FromGitter | <Varriount> ldlework: cdfcc12 |
07:44:00 | ldlework | ah I just upgraded to latest commit on devel, and I get the same error now |
07:48:45 | FromGitter | <Varriount> ldlework is `Color` final? |
07:49:52 | ldlework | Varriount I'm not exactly sure what that means |
07:49:59 | FromGitter | <Varriount> If I change `Color` to `Color = ref object of RootObj`, the error goes away |
07:50:12 | FromGitter | <Varriount> and I get your old error |
07:50:38 | ldlework | there's really no reason for color to be of rootobj |
07:51:27 | FromGitter | <Varriount> Though, I still think its a compiler error. `Color` isn't being used as something to inherit from. |
07:55:08 | FromGitter | <Varriount> @Araq Should the type argument of a generic cause a inheritance error? |
07:55:34 | FromGitter | <Varriount> ldlework: Your type hierarchy keeps making my head hurt |
07:57:22 | ldlework | Why? Its incredibly simple |
07:57:29 | ldlework | BSPNode -> Leaf |
07:57:36 | ldlework | BSPNode -> ParentNode -> VSplit |
07:57:39 | ldlework | BSPNode -> ParentNode -> HSplit |
07:57:40 | ldlework | that's it |
07:58:44 | FromGitter | <Varriount> It's the fact that they all contain references to each other. |
07:59:53 | Araq | varriount: I don't have enough context and I am busy, sorry. |
08:00:33 | ldlework | Varriount, its a tree |
08:00:36 | ldlework | a binary tree |
08:00:49 | ldlework | the nodes in the tree can either be a binary fork of two children |
08:00:55 | ldlework | or it can be a leaf node, with content |
08:01:14 | * | nightmared quit (Ping timeout: 260 seconds) |
08:01:34 | ldlework | the top node has a region which dictates the sub-regions for all children |
08:01:41 | ldlework | each parent splits the region into 2 |
08:01:44 | ldlework | either horizontally or vertically |
08:02:26 | * | nightmared joined #nim |
08:05:49 | FromGitter | <Varriount> Ok, this is really odd. |
08:06:12 | FromGitter | <Varriount> Somehow the node types are inheriting from `Color` |
08:06:18 | ldlework | lol what |
08:06:51 | FromGitter | <Varriount> ldlework: First, change the definition of `Color` to `Color = ref object of RootObj` |
08:07:32 | ldlework | oh well, we don't want that anyway :P |
08:07:32 | FromGitter | <Varriount> Try to compile. You should get the error `Error: attempting to call undeclared routine: 'parent='` |
08:07:37 | ldlework | ya |
08:07:49 | FromGitter | <Varriount> Now add a `parent` field to `Color` |
08:09:36 | ldlework | heh wtffff |
08:09:49 | ldlework | Error: type mismatch: got (BSPNode[]) but expected 'float' |
08:09:57 | ldlework | (I made parent a float) |
08:10:11 | FromGitter | <Varriount> I know. This is an odd one. |
08:10:30 | FromGitter | <Varriount> None of those definitions inherit from 'T' |
08:11:34 | ldlework | Varriount, since these bugs are so subtle its hard to create sscce for them |
08:12:31 | * | Guest95785 quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) |
08:14:27 | FromGitter | <Varriount> Araq: Final chance to stop us before we lodge another issue and test case. |
08:16:47 | Araq | go ahead. |
08:17:16 | Araq | I don't mind issues in the issue tracker. I mind misusing the issue tracker as a personal todo list and then disappearing |
08:17:39 | cheatfate | lol |
08:17:50 | Araq | https://github.com/nim-lang/Nim/issues/1600 |
08:18:00 | Araq | comes to mind :P |
08:18:06 | FromGitter | <Varriount> :/ |
08:20:54 | FromGitter | <Varriount> ldlework: You want to log the issue? |
08:21:16 | FromGitter | <Varriount> You know more about the program that I do. |
08:21:39 | ldlework | Varriount, again, I just don't see how. We'd need to create an sscce and that just seems unlikely. |
08:21:58 | ldlework | I doubt Araq is going to download my program when addressing the issue. |
08:22:16 | Araq | you would be surprised |
08:24:43 | ldlework | I'll give it a go |
08:28:02 | * | ftsf quit (Remote host closed the connection) |
08:28:07 | * | gokr joined #nim |
08:30:59 | ldlework | Varriount, fail, https://glot.io/snippets/eortrhnd42 |
08:31:00 | ldlework | lol |
08:32:18 | ldlework | damn 900 issues |
08:40:50 | * | nsf joined #nim |
08:54:32 | * | gokr quit (Ping timeout: 252 seconds) |
08:56:33 | * | shashlick quit (Ping timeout: 240 seconds) |
08:58:00 | * | shashlick joined #nim |
08:58:26 | ldlework | Varriount, feel free to edit as you see fit to clarify, https://github.com/nim-lang/Nim/issues/5687 |
09:01:37 | FromGitter | <Varriount> Nope, you hit the nail on the head. |
09:03:30 | dom96 | "The compiler error is now: ..." |
09:03:34 | dom96 | is the second error the same as the first one? |
09:04:57 | ldlework | good catch |
09:05:21 | ldlework | fixed |
09:10:43 | dom96 | also, which compiler are you using? |
09:13:45 | FromGitter | <Varriount> Head |
09:16:19 | dom96 | interesting issue :) |
09:22:39 | ldlework | Maybe its resolution will lead to some general stability to the generics/inheritance mechanisms |
09:24:31 | * | yglukhov joined #nim |
09:25:06 | cheatfate | ldlework, it looks like your issue is not nim's issue but your code issue |
09:25:17 | ldlework | cheatfate: oh? |
09:25:54 | ldlework | do tell :) |
09:30:40 | arnetheduck | Araq, so what's the deal with pure? is it implied by importc? |
09:33:16 | * | nsf quit (Quit: WeeChat 1.7) |
09:33:32 | ldlework | dom96: is there a way to make the while body here a `result=` statement? https://gist.github.com/dustinlacewell/5aefc225d70ada7ba210d5f3f4976087 |
09:33:35 | * | Arrrr joined #nim |
09:33:41 | ldlework | IE, make the if an expression somehow |
09:34:19 | * | yglukhov quit (Remote host closed the connection) |
09:34:38 | dom96 | Why do you need the `if` when the result is the same? |
09:34:46 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:35:22 | dom96 | In any case, it would be: result = if result.backward.contains(x, y): result.backward else: result.backward |
09:35:55 | ldlework | dom96: is there a way to get that on multiple lines? |
09:36:09 | ldlework | also ther esult being the same is just a typo lol |
09:36:12 | dom96 | yes, just indent it like you would normally |
09:36:55 | ldlework | that doesen't work |
09:37:04 | ldlework | oh |
09:37:34 | ldlework | nice |
09:37:56 | ldlework | nice don't even need the result = |
09:39:38 | dom96 | oh indeed |
09:40:00 | dom96 | although that's a bit weird in a while loop |
09:45:59 | * | Matthias247 joined #nim |
09:54:12 | ldlework | the ugliest nim function I've ever written is still not even that bad, https://gist.github.com/dustinlacewell/6f89c59af5a4808450d5cbc67acfb97f |
09:55:32 | dom96 | :) |
09:55:35 | dom96 | I like the `as` actually |
09:55:53 | ldlework | yeah it should be in the language imo |
09:56:04 | ldlework | and it should have higher precedence |
09:56:13 | ldlework | like in C# |
09:56:24 | dom96 | Create an RFC :) |
10:00:01 | ldlework | dom96 you should merge your little gamelib onto dadren |
10:00:41 | * | gokr joined #nim |
10:01:59 | dom96 | Feel free to steal code from it. But I like that it's "light" so I will keep using it as-is. |
10:02:52 | ldlework | dadren is pretty light, have you ever taken a skim over its parts? |
10:04:06 | * | yglukhov joined #nim |
10:06:49 | dom96 | is it renderer agnostic? |
10:07:14 | dom96 | I can see a bunch of imports to sdl2 throughout |
10:07:52 | dom96 | My gamelight library targets the web |
10:10:27 | ldlework | dom96: that's why I want to merge |
10:10:37 | ldlework | dom96: my friend has a nim question |
10:10:49 | ldlework | the table module requires types used as keys to implement eq and hash |
10:10:57 | ldlework | lets say you have a base type that provides both as methods |
10:11:09 | ldlework | is there a way to prevent subtypes from overriding one but not both? |
10:11:14 | ldlework | IE requiring subtypes to override both? |
10:12:15 | dom96 | No idea. I avoid methods as much as I can :) |
10:13:08 | ldlework | Varriount, any idea? |
10:16:25 | * | yglukhov quit (Remote host closed the connection) |
10:16:51 | * | yglukhov joined #nim |
10:20:03 | * | yglukhov quit (Remote host closed the connection) |
10:32:18 | * | Vladar joined #nim |
10:41:44 | ldlework | can someone invent a function that turns an rgb triplet into an integer and another that transforms it back |
10:41:50 | ldlework | so I can use an enum to store colors |
10:44:29 | dom96 | ldlework: did you see the `colors` module? it's in the stdlib |
10:45:19 | ldlework | cool |
10:47:45 | Vladar | ldlework, also https://github.com/Vladar4/sdl2_nim/blob/master/sdl2/private/pixels.nim#L381 and below |
10:48:40 | ldlework | hello Vladar |
10:49:01 | Vladar | hi |
10:49:13 | ldlework | Vladar: you work on anything neat recently? |
10:49:45 | Vladar | updating nimgame2 mostly |
10:50:08 | Vladar | v0.4 soon |
10:51:39 | ldlework | cool |
10:51:55 | * | PMunch joined #nim |
10:52:07 | Vladar | yep, a lot of new neat features |
10:52:16 | ldlework | like what |
10:52:31 | Arrrr | What does your lib that pure sdl cannot do? |
10:52:57 | ldlework | his readme lists what it already does |
10:53:23 | Vladar | ldlework, radiobuttons, palette manipulation, perspective distortion, joysticks support… |
10:53:43 | Vladar | Arrrr, sdl is not a game engine |
10:54:11 | Vladar | for the list of features see https://vladar4.github.io/nimgame2/ |
10:55:57 | Arrrr | I see, it has a lot of utils |
11:11:41 | dom96 | My JSON macro is now in devel. |
11:28:21 | * | zachcarter joined #nim |
11:28:55 | cheatfate | Vladar, how do you render truetype fonts? |
11:29:35 | zachcarter | cheatfate: with https://www.libsdl.org/projects/SDL_ttf/ |
11:31:27 | cheatfate | zachcarter, freetype based, thank you |
11:32:18 | zachcarter | I believe it is freetype based or at least it uses freetype |
11:32:42 | zachcarter | I’ve done font rendering with OpenGL / FreeType but not using the SDL renderer I was writing my own OpenGL code |
11:33:19 | zachcarter | if you’re interested, I may still have the code on my machine / on github somewhere |
11:35:11 | cheatfate | zachcarter, i'm just looking for alternatives... but looks like freetype is the only choice |
11:35:23 | zachcarter | oh I see you want something other than freetype |
11:35:24 | zachcarter | yeah :/ |
11:38:50 | Arrrr | cheatfate https://github.com/nothings/stb/blob/master/stb_truetype.h |
11:51:34 | * | rokups joined #nim |
11:56:23 | * | smt_ joined #nim |
11:57:51 | * | smt quit (Ping timeout: 240 seconds) |
12:13:09 | * | smt_ is now known as smt |
12:15:44 | * | Tiberium joined #nim |
12:39:45 | * | Trustable joined #nim |
12:41:44 | arnetheduck | interesting, travis ci builds a merge of devel and the branch, not the branch itself |
12:43:00 | zachcarter | huh |
12:43:21 | * | antranigv quit (Ping timeout: 240 seconds) |
12:46:39 | * | antranigv joined #nim |
13:17:34 | Tiberium | what do you think guys, is it better to port program to nim from this - https://github.com/Francesco149/oppai/blob/master/beatmap.cc , or from this - https://github.com/TiberiumN/pippy/blob/master/pippy/parser/beatmap.py |
13:23:14 | Tiberium | but yeah, sure I'll port it to Nim from my fork :) |
13:25:36 | zachcarter | whatever language you’re more comfortable with Tiberium, but note - c2nim can handle some C++ I believe |
13:25:40 | zachcarter | not sure what the status of py2nim is |
13:25:59 | Tiberium | zachcarter, but I want to port it fully, not wrap it |
13:26:12 | zachcarter | you can use c2nim on implementation ;) |
13:26:24 | Tiberium | so I can use py2nim Araq's snippet to make some simple things faster |
13:26:28 | Tiberium | like def/proc |
13:27:20 | Tiberium | and yay, I can use parsecfg almost in the same way as "configparser" in python |
13:27:25 | zachcarter | :) |
13:27:28 | zachcarter | I’m using parsecfg too |
13:27:31 | zachcarter | it’s a nice module |
13:27:58 | zachcarter | and the format is so simple I have C code generating my config files |
13:28:20 | zachcarter | question : is it possible to remove and retain an element from a sequence? |
13:29:41 | * | gokr quit (Quit: Leaving.) |
13:40:05 | * | gokr joined #nim |
13:46:08 | dom96 | zachcarter: save it in a variable and then remove it from the sequence? |
13:49:59 | zachcarter | dom96: was just looking for a single op but fair enough thanks |
13:50:33 | demi- | i don't think seqs are supposed to be mutable like that |
13:50:39 | demi- | wouldn't you need an array for that? |
13:50:49 | zachcarter | you’re probably right |
13:50:55 | zachcarter | *are right haha |
13:51:13 | dom96 | seqs are mutable |
13:51:17 | dom96 | arrays aren't |
13:51:29 | dom96 | well, they can't be grown or shrunk |
13:58:46 | Tiberium | maybe he wants something like list.pop() in python |
13:58:55 | Tiberium | it deleted some thing from list and returns it |
13:59:22 | Tiberium | btw, about py2nim: |
13:59:51 | Tiberium | I think we can do some parsing and converting, and then port some part of python's stdlib |
14:01:03 | dom96 | perhaps, Nim has the same thing btw |
14:01:32 | * | eizua joined #nim |
14:12:59 | * | libman has to be the bad / annoying guy and ponder the licensing issues of py2nim'ing code. Does the original license stick? |
14:16:08 | Tiberium | there's still no real py2nim :) |
14:16:24 | Tiberium | only Araq's snippet on forum which can convert some definitions |
14:16:27 | Tiberium | based on regexps |
14:16:30 | FromGitter | <mratsim> Hello there |
14:16:30 | dom96 | Does a binary have the same license as the code it was compiled from? |
14:16:38 | Tiberium | probably |
14:16:46 | Tiberium | ask libman :) |
14:17:09 | dom96 | hello mratsim |
14:18:41 | FromGitter | <mratsim> I’ve been fighting for hours with the type checker, wondering if you can help me |
14:23:50 | FromGitter | <mratsim> I’m starting from this minimum code: https://pastebin.com/dp2ugVd9 |
14:23:57 | FromGitter | <mratsim> (currently paste bin code sample) |
14:25:50 | FromGitter | <mratsim> I’m building a Sequence of Nodes, each Node will contain store 2 props `BackProp` that transforms from Type T to Type U (T and U can be SomeReal, Matrix or Vector from lining) |
14:26:31 | FromGitter | <mratsim> This works: https://pastebin.com/pgm4UULX - Except that T and U are fixed to float32 and Matrix32 |
14:27:13 | * | SusWombat joined #nim |
14:27:47 | FromGitter | <mratsim> And I need Matrix32 -> Matrix32 and float32 -> Matrix32 proc |
14:28:13 | FromGitter | <mratsim> (This is to build a Deep Learning Library) |
14:29:18 | FromGitter | <mratsim> Try 1: wrapping in a “Tensor”. Error “Cannot evaluate at Compile time T - https://pastebin.com/i1AhAaZ2 |
14:31:48 | FromGitter | <mratsim> Try 2: removing the [T, U] generics from “Context”. Error seq[Node] is not a concrete type https://pastebin.com/BFjwuFDG. I tried that for `BackProp`and `Node` but it’s still the same |
14:33:20 | FromGitter | <mratsim> Try 3 is a redo of Try 1 with Tensor = float32 or Matrix32, I get “Cannot instantiate Matrix32" |
14:35:42 | FromGitter | <mratsim> The only solution I see so far is through Object Variant, but I’m not even sure I can type check the various [M, N: static[int], T] inside. ⏎ ⏎ For reference, here is my full code - https://github.com/mratsim/nim-rmad |
14:36:20 | * | PMunch quit (Quit: leaving) |
14:38:01 | FromGitter | <mratsim> s/lining/linalg |
14:51:54 | zachcarter | is there any way to get a sub sequence from a sequence? like elements 1-4 out of a 5 element sequence? |
14:52:07 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:57:18 | Vladar | zachcarter mySeq[1..4] |
14:57:29 | zachcarter | thank you Vladar |
14:57:45 | Vladar | well, [1..3] for 1-4 elements, actually |
15:27:25 | * | SusWombat quit (Remote host closed the connection) |
15:28:18 | FromGitter | <battila7> Question about typing: As long as the compiler can be sure that fields are accessible and methods have correct types duck typing can be used without explicit type constraints (such as Concepts). Is this right? |
15:30:48 | FromGitter | <mratsim> var test = new seq[float32] ⏎ test.add(3) ⏎ ⏎ Error: type mismatch: got (ref seq[float32], int literal(3)) ⏎ but expected one of: ... [https://gitter.im/nim-lang/Nim?at=58ea53aa08c00c092a637a7e] |
15:33:34 | FromGitter | <Varriount> @mratsim Make it 3.0 |
15:34:39 | FromGitter | <Varriount> @battila7 In what context? Generics, or type parameters in general? |
15:35:52 | FromGitter | <battila7> I'd say when using type parameters in general |
15:37:52 | FromGitter | <Varriount> Then yes, you *can* omit type parameters, and the compiler will do its best to infer the type. |
15:38:51 | FromGitter | <Varriount> However, the compiler can throw some odd and misdirecting errors when it can't properly infer the type. |
15:41:15 | FromGitter | <battila7> Yes, I see. But I suppose, this is not the proper Nim way of developing applications, is it? |
15:42:48 | FromGitter | <mratsim> @Varriount it was a reply to @battila7 ;) |
15:43:14 | FromGitter | <Varriount> Well, we have static typing and your parameters for a reason |
15:44:23 | FromGitter | <Varriount> @battila7 does that error occur when the type is "float"? |
15:45:58 | Tiberium | BTW, how to ask compiler to output types he guessed? |
15:46:09 | Tiberium | (when I have some "auto"'s in my code) |
15:46:39 | FromGitter | <battila7> @Varriount still does not compile |
15:48:01 | FromGitter | <Varriount> @battila7 I'm going to say that's because not all integers can be accurately expressed as floats |
15:48:54 | FromGitter | <Varriount> @TiberiumPY You can use `type(expression)` to get the type of an expression or variable. |
15:49:01 | Tiberium | ah, thanks |
15:49:42 | FromGitter | <battila7> It might be silly, but how come that this does not compile as well: ⏎ ~~~~ ⏎ var test = new seq[float64] ⏎ ⏎ test.add(0.0'f64) ... [https://gitter.im/nim-lang/Nim?at=58ea581868bee3091f26655a] |
15:51:05 | Tiberium | Varriount - and how to output it at compile time? |
15:52:07 | FromGitter | <battila7> Using `when`? |
15:53:07 | Tiberium | ah |
15:53:11 | Tiberium | name(type(3)) |
15:53:22 | FromGitter | <Varriount> Tiberium: ```static: \n echo type(expression)``` |
15:53:41 | Tiberium | it doesn't work |
15:54:13 | FromGitter | <Varriount> Woops. Import `typetraits` |
15:54:36 | FromGitter | <Varriount> And use `echo name(type(expression))` |
15:55:08 | Tiberium | works now :) |
15:56:21 | FromGitter | <Varriount> There's probably another way, but that's what I used yesterday |
15:57:27 | FromGitter | <mratsim> @battila7 sorry my example was wrong: ⏎ ⏎ var test:seq[float64] = @[] ⏎ ⏎ test.add(0’f64) ... [https://gitter.im/nim-lang/Nim?at=58ea59e9b52518ed4df55b95] |
15:58:10 | FromGitter | <mratsim> the new seq syntax works for ref object |
15:59:09 | FromGitter | <battila7> Yup, I figured it out by now. I was a bit surprised at first :smile: |
16:00:12 | Tiberium | btw, I think py2nim can start as something like shedskin |
16:00:26 | Tiberium | (shedskin is python to C++ compiler - very restricted) |
16:00:29 | Tiberium | https://github.com/shedskin/shedskin |
16:00:32 | FromGitter | <Varriount> New syntax? |
16:01:55 | FromGitter | <mratsim> Yes: ⏎ ⏎ proc newContext*(T: typedesc[SomeReal]): Context[T] {.noSideEffect.} = ⏎ ## Initialize a context (Tape / Wengert list) ⏎ result.nodes = new seq[Node[T]] ... [https://gitter.im/nim-lang/Nim?at=58ea5af5f22385553d2445c9] |
16:02:37 | FromGitter | <mratsim> Node[T] being an object |
16:03:03 | FromGitter | <mratsim> and Context and ref object |
16:04:11 | * | Ven joined #nim |
16:04:35 | * | Ven is now known as Guest99305 |
16:08:14 | * | Guest99305 quit (Client Quit) |
16:31:15 | FromGitter | <mratsim> Regarding my question previously, I also get the not a concrete type error with an object variant. ⏎ ⏎ > Mamy Ratsimbazafy @mratsim 16:18 ⏎ > I’ve been fighting for hours with the type checker, wondering if you can help me ⏎ > ... [https://gitter.im/nim-lang/Nim?at=58ea61d568bee3091f268bad] |
16:48:13 | FromGitter | <Varriount> @mratsim Once I get home I'll see what I can do. |
16:48:20 | * | nsf joined #nim |
16:49:27 | * | arnetheduck quit (Ping timeout: 255 seconds) |
16:49:59 | FromGitter | <mratsim> @Varriount, terrific ! Otherwise, I probably would have to reimplement my custom type instead of using Andrea’s linalg |
16:56:31 | * | Trustable quit (Remote host closed the connection) |
17:08:19 | FromGitter | <mratsim> @Varriount If I’m not around, you can reply to this github isssue I’ve open in my repo: https://github.com/mratsim/nim-rmad/issues/4 |
17:08:25 | * | nsf quit (Quit: WeeChat 1.7) |
17:13:32 | niv | hello. whats the recommended way to organise unittests, multiple suites, into many files, and then run them all with one command? |
17:15:22 | Tiberium | niv, look at any big project source :) |
17:16:09 | niv | yes, im shopping around and i have ideas, but so far none of them really convince me. i was wondering if there's a recommended/official way i missed. |
17:16:36 | niv | i suppose compiling them all into a single binary isn't the way to go; instead use a testrunner or a glob matcher that runs them all standalone |
17:23:03 | FromGitter | <mratsim> you can do multiple test files, and use include in a single file so that you can run all them at once |
17:23:39 | niv | fair enough. |
17:24:05 | FromGitter | <Varriount> @mratsim Is there a specific branch I should check out, or a file I should run? |
17:24:19 | FromGitter | <mratsim> @niv: https://github.com/vegansk/nimfp/blob/master/tests/fp/test_all.nim |
17:25:11 | FromGitter | <mratsim> @Varriount no, you can check on master. it has the latest code. I put the example code in the Github issue |
17:27:00 | * | Vladar quit (Quit: Leaving) |
17:27:00 | niv | mratsim: yeah, thanks. |
17:27:05 | Tiberium | niv, there's "unittest" module |
17:27:23 | niv | yes, im working with unittest. im just thinking about organising it |
17:31:05 | * | libman quit (Quit: Connection closed for inactivity) |
17:34:08 | FromGitter | <Varriount> @mratsim Just to clear things up.. the problem with the first code sample in that issue is that both T and U can't be a matrix? |
17:34:44 | FromGitter | <Varriount> I'm trying to figure out what it is the problem with the first code sample is. |
17:34:48 | FromGitter | <mratsim> Yes, I will have float32 -> Vector32, Vector32 -> Matrix32, Matrix32 -> Matrix32 |
17:34:58 | FromGitter | <mratsim> the very first works |
17:36:53 | FromGitter | <Varriount> @mratsim So `let ctx = newContext[Matrix32[2,2], Matrix32[2,2]]` fails? |
17:37:18 | FromGitter | <mratsim> in the first example that would work |
17:37:33 | FromGitter | <Varriount> Then what won't work in the first example? |
17:38:05 | FromGitter | <mratsim> the issue is that I would be forced to have only BackProp[Matrix32, Matrix32] in the sequence |
17:38:51 | FromGitter | <mratsim> I need BackProp[float32, Matrix32] BackProp[Vector32, Matrix32] as well |
17:39:18 | FromGitter | <Varriount> You want `Context.nodes` to contain a non-homogenous mixture of data? |
17:39:50 | FromGitter | <mratsim> yes |
17:40:04 | FromGitter | <mratsim> well, those are all closures |
17:41:13 | FromGitter | <Varriount> Generics only deal with compile-time types. Putting `Tensor = float32 or DVector32` just creates a semi-abstract type constraint |
17:41:45 | FromGitter | <mratsim> Yeah I saw, if I only have Tensor = float32 or Tensor = DVector32 it compiles |
17:42:20 | FromGitter | <Varriount> Think of it - if you access Context.nodes[1], how do you know whether the `T` in the returned element is a float, matrix, etc? |
17:42:39 | FromGitter | <Varriount> You have to use a wrapper type or object variant to differentiate |
17:43:17 | FromGitter | <Varriount> ldlework is doing something similar with binary-space-partition trees. |
17:43:21 | FromGitter | <mratsim> By wrapper type, do you mean inheritance or something else ? |
17:43:47 | FromGitter | <Varriount> Inheritance, yes. |
17:44:09 | FromGitter | <Varriount> You would have to wrap Matrix, float32, etc, because those types are already implemented. |
17:44:24 | FromGitter | <Varriount> So, let me come up with something. |
17:45:14 | FromGitter | <Varriount> Another possibility is wrapping the backprop as closures |
17:45:20 | * | ngc joined #nim |
17:45:26 | FromGitter | <mratsim> I tried Object Variant but I had a `Not a concrete type`issue for Vector32: https://gist.github.com/mratsim/2f9d4cd301cd48f15c9789809432dbe8 |
17:45:56 | FromGitter | <mratsim> probably because Vector32 is actually Vector32[M, N: static[int]; T] |
17:46:01 | FromGitter | <Varriount> @mratsim You're putting type names as the members of an enum. That's going to cause problems. |
17:47:29 | FromGitter | <mratsim> I see, I prepended with a T. (still issue with concrete type) |
17:48:02 | * | rauss joined #nim |
17:48:29 | FromGitter | <Varriount> @mratsim Assuming that we did have a non-homogenous sequence, how were you planning to call `()` the elements in `Node.weights`? |
17:48:33 | FromGitter | <mratsim> If I only had to wrap backprop that would be best (it’s actually just a wrapper already) |
17:49:25 | FromGitter | <Varriount> I mean, what did you expect would happen if the wrong type of arguments were passed in? |
17:49:49 | FromGitter | <mratsim> compilation failure |
17:50:03 | FromGitter | <mratsim> call is there: https://github.com/mratsim/nim-rmad/blob/master/src/autograd.nim#L150 |
17:50:04 | FromGitter | <Varriount> But such a thing can't be determined at compile time. |
17:50:51 | FromGitter | <Varriount> Hm. |
17:51:02 | FromGitter | <Varriount> But perhaps a tuple might work? |
17:51:17 | * | ngc quit (Quit: ngc) |
17:51:37 | FromGitter | <mratsim> I tried tuples as well but I couldn’t make it work :/ |
17:52:56 | FromGitter | <Varriount> @mratsim Are the lengths of `Node.weights` and `Node.parents` going to change in the future? |
17:53:41 | FromGitter | <mratsim> no they will always have 2 elements |
17:53:56 | FromGitter | <Varriount> I'm going to come up with a possible solution, and you can tell me if it's satisfactory. |
17:54:16 | FromGitter | <mratsim> Basically I’m building a call graph of unary and binary operations |
17:56:24 | FromGitter | <mratsim> thanks |
17:57:40 | FromGitter | <Varriount> I don't think I'll be able to give you compile-time errors though. |
17:57:49 | FromGitter | <mratsim> btw: I’m trying to find idlework binary space partion tree repo but I can't |
17:58:15 | FromGitter | <Varriount> Because a sequence has a nondeterministic length, access to it can't be checked the same way a tuple can be checked. |
17:58:16 | FromGitter | <mratsim> well that’s fine :), the compile will catch the error in the forward pass |
17:58:22 | FromGitter | <mratsim> compiler* |
18:00:37 | * | Trustable joined #nim |
18:01:12 | FromGitter | <mratsim> If I do a x * y operation, I add [gradient a, gradient b] to the sequence. If it typecheck at that point, it means the backward pass will work. (Obviously I will put proper testing for that). If the user tries not compatible operations (wrong Matrix size say) it will be catched before the program uses the sequence of BackProp |
18:02:20 | FromGitter | <Varriount> The problem is that if you add more types, the number of cases to handle is going to grow very quickly. |
18:03:14 | FromGitter | <Varriount> Does `Node.weights` need to be non-homogenous too? |
18:04:18 | FromGitter | <mratsim> with a Node no |
18:04:59 | FromGitter | <mratsim> within* |
18:05:51 | FromGitter | <Varriount> What are all the types `T` and `U` could be? |
18:06:23 | FromGitter | <mratsim> float32, DMatrix32, Matrix32, DVector32, Vector32 |
18:07:19 | FromGitter | <Varriount> Ugh. @Araq is probably going to kill me for using methods. |
18:07:49 | FromGitter | <mratsim> :D |
18:08:15 | FromGitter | <mratsim> I’ll check the closures or the BackProp wrapper as well |
18:14:18 | FromGitter | <battila7> @Varriount Methods are that evil? |
18:14:37 | FromGitter | <Varriount> @Araq tends to seem them as a sign of moral weakness. .:D |
18:15:38 | Tiberium | hmm, is it for me only? nimx doesnt compile |
18:16:02 | FromGitter | <battila7> Dynamic dispatch can be a code smell, but coming from Groovy one can easily appreciate it |
18:16:04 | FromGitter | <TiberiumPY> /home/tiber/.nimble/pkgs/nimsl-0.2/nimsl/nimsl.nim(75, 60) Error: type mismatch: got (array[0..1, float32]) but expected 'vec2 = vecBase[2, system.float32]' |
18:16:23 | Tiberium | some recent changes in compiler broke nimsl? |
18:18:31 | Tiberium | I think this isn't good, since nimsl powers nimx gui framework |
18:24:31 | * | PMunch joined #nim |
18:24:39 | FromGitter | <stisa> Tiberium I think it's a known issue? https://github.com/nim-lang/Nim/issues/5640 |
18:24:48 | Tiberium | ah yes, sorry |
18:24:52 | FromGitter | <Varriount> @mratsim Instead of `BackProp` being a procedure, couldn't it just hold two values? |
18:25:23 | Tiberium | ah, https://github.com/nim-lang/Nim/pull/5677 seems that zah fixed it |
18:25:55 | FromGitter | <mratsim> @Varriount that’s actually what I have 2 days ago, but it can’t. |
18:26:03 | FromGitter | <mratsim> what I had* |
18:26:19 | FromGitter | <Varriount> @mratsim Your problem is really tricky. |
18:26:43 | FromGitter | <mratsim> @Varriount: here is the reason why I can’t just hold the value: https://github.com/mratsim/nim-rmad/issues/2 |
18:28:39 | FromGitter | <mratsim> @Varriount, if you can’t find a solution. It’s fine, don’t lose your sleep on it |
18:30:18 | FromGitter | <mratsim> I think Multilinear Algebra in general is hard to type check properly. You have functions: Scalar -> Vector, Vector -> Matrix, Matrix -> Matrix, Matrix -> Scalar, that’s one thing. Second is that dimensions must be compatible. |
18:32:52 | Tiberium | yay, nimx compiles with zahary pull request |
18:34:49 | Tiberium | or not |
18:35:15 | Tiberium | oh yeah it does |
18:36:37 | FromGitter | <Varriount> Anyone know if an arbitratry closure has a parent? |
18:40:17 | FromGitter | <Varriount> Also, anyone used the call `.()` operator? |
18:40:31 | Tiberium | wat? you can even overload .() ? |
18:42:31 | FromGitter | <Varriount> https://nim-lang.org/docs/manual.html#special-operators-operator |
18:43:48 | Tiberium | so you have a thing like __setattr__ in python |
18:43:49 | Tiberium | lol |
18:50:53 | FromGitter | <stisa> @Varriount never used `.()` myself, I only know of jsffi (https://github.com/nim-lang/Nim/blob/devel/lib/js/jsffi.nim) that uses `.()` to access fields |
18:51:41 | * | Matthias247 joined #nim |
18:53:50 | demi- | that seems pretty gross imo |
18:55:00 | Tiberium | well, for js it's mandatory |
18:55:11 | Tiberium | so you wouldn't end using ["something"] everywhere |
18:55:46 | demi- | that seems preferable tho |
18:56:59 | FromGitter | <battila7> Great feature in my opinion :) |
18:57:25 | Tiberium | but wait, is it compile-time or runtime? |
18:57:27 | Tiberium | it seems that runtime |
18:57:45 | Tiberium | ah, you can do anything inside `.()` |
19:12:56 | FromGitter | <Varriount> @mratsim I've come up with a solution that almost works, but doesn't compile. |
19:13:17 | ldlework | lol |
19:13:46 | FromGitter | <Varriount> @mratsim I'd post about your problem on the forum. Say that you need a way for `Context.nodes` to contain nodes with different procedures. |
19:14:23 | FromGitter | <mratsim> Thanks! that’s how I don’t sleep. “It almost compile, just one more time” “Hehe, it’s 5AM, how come" |
19:15:05 | FromGitter | <mratsim> I’ll register there then and post, thanks for your help. |
19:22:34 | FromGitter | <battila7> @mratsim Clearly we all share this type of addiction |
19:23:55 | dom96 | Tiberium: It's not mandatory for JS, it's just more convenient. |
19:24:03 | Tiberium | yeah, I know |
19:30:41 | * | nsf joined #nim |
19:42:16 | * | rokups quit (Quit: Connection closed for inactivity) |
19:44:40 | ldlework | zachcarter: does Frag have a windowing system yet? |
19:52:41 | * | Nobabs27 joined #nim |
20:04:03 | * | Arrrr quit (Quit: Leaving.) |
20:20:45 | * | rauss quit (Quit: WeeChat 1.7) |
20:35:56 | ldlework | Varriount, I got another one :( |
20:38:42 | FromGitter | <Varriount> I'm resting at the moment. |
20:42:31 | ldlework | I wish I knew what this error meant, Error: cannot instantiate: 'Point' |
20:42:53 | FromGitter | <mratsim> How long should it takes to get the forum the registration mail ? instant? |
20:44:28 | ldlework | interesting |
20:44:34 | dom96 | mratsim: I'll confirm the account for you |
20:44:48 | dom96 | done |
20:44:51 | ldlework | for making simple data types its slightly better to make tuple aliases because you will get things like hash() for free |
20:46:49 | FromGitter | <mratsim> thanks @dom96 |
20:48:02 | * | Tiberium quit (Remote host closed the connection) |
20:55:13 | * | xtagon joined #nim |
21:04:44 | * | eizua quit (Quit: Leaving) |
21:07:14 | * | vlad1777d quit (Remote host closed the connection) |
21:13:33 | subsetpark | ldlework: I think Araq disagrees; my impression is that if you're not making use of structural typing, you're better off making an object |
21:17:19 | * | xtagon quit () |
21:19:30 | euantor | Super late to the party with regard to dom96's work on the JSON stuff, but it sounds awesome. |
21:19:33 | euantor | "In the future I will probably generalise this macro so that it can be used for other formats." |
21:20:08 | euantor | ^ That would be pretty nice. Would be cool to have something like Rust's Serde https://serde.rs |
21:20:13 | dom96 | euantor: :D |
21:20:41 | euantor | All the interesting discussion seems to happen the I'm away :D |
21:20:54 | FromGitter | <TiberiumPY> What's my best choice for parsing text file? First part of it is simple .ini, and second part contains .ini sections and strings like "0;1;2;3;5:6:7"? |
21:21:36 | FromGitter | <TiberiumPY> I mean if i wild would do simple for line in text.splitlines after parsing first part (normal ini) |
21:21:54 | FromGitter | <TiberiumPY> /s/wild// |
21:22:29 | FromGitter | <Varriount> Nim has parsing modules. You could try those |
21:23:31 | FromGitter | <TiberiumPY> Yeah I will use parsecfg for the first part of file |
21:24:25 | FromGitter | <TiberiumPY> Ah |
21:24:43 | FromGitter | <TiberiumPY> strscans probably |
21:27:50 | FromGitter | <TiberiumPY> Yeah, scanf from strscans would be perfectly fine for me |
21:29:30 | FromGitter | <TiberiumPY> LOL |
21:30:48 | FromGitter | <TiberiumPY> it seems I used termcolor library from github (last update in 2011), and now I see 'terminal' in std |
21:30:58 | FromGitter | <TiberiumPY> Stdlib |
21:39:34 | * | Trustable quit (Remote host closed the connection) |
21:54:10 | * | PMunch quit (Quit: leaving) |
22:10:12 | * | Jesin joined #nim |
22:17:01 | * | Jesin quit (Quit: Leaving) |
22:26:52 | * | zachcarter quit (Read error: Connection reset by peer) |
22:27:11 | * | zachcarter joined #nim |
22:28:51 | * | gokr quit (Quit: Leaving.) |
22:42:56 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:49:02 | * | bjz joined #nim |
23:02:58 | * | Jesin joined #nim |
23:03:03 | * | nsf quit (Quit: WeeChat 1.7) |
23:10:45 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:44:42 | * | shashlick quit (Ping timeout: 252 seconds) |
23:45:47 | * | shashlick joined #nim |