00:02:23 | Araq_ | ldlework: Rust does the same ... I've never heard that Rust is full of implicit stuff, quite the contrary |
00:02:36 | ldlework | dom96: #reddit-gamedev |
00:03:12 | ldlework | I forgot how much continuous type casting there is in nim |
00:09:11 | * | ^aurora^ joined #nim |
00:10:01 | dom96 | Such a mature channel. |
00:17:05 | Araq_ | it's reddit, what did you expect? |
00:37:06 | * | brson quit (Ping timeout: 240 seconds) |
00:43:12 | ldlework | dom96: its a mixed bag for sure |
00:43:22 | ldlework | Can someone help me write a weighted choice function? |
00:45:11 | ldlework | like lets say I have some sort of mapping structure that maps arbitrary ints to procs |
00:45:21 | ldlework | And I want to call a proc randomly based on the associated weights |
00:56:46 | ldlework | Can you have procs as table values? |
00:58:17 | ldlework | dom96: poke |
01:06:40 | dom96 | Table[string, proc ()] might work |
01:06:46 | dom96 | I need to go, see you later |
01:14:31 | * | brson joined #nim |
01:20:17 | * | vikaton joined #nim |
01:38:08 | * | ^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
01:40:00 | * | Jesin joined #nim |
01:56:34 | ldlework | why is abs not in the math module? |
02:48:52 | Araq_ | it's in system.nim |
02:51:54 | ldlework | Araq_: can you help me with some nim thinking? |
02:52:18 | ldlework | well actually I'm onto something maybe I don't need that |
02:52:21 | Araq_ | if it can be done in 8 minutes |
02:53:03 | ldlework | hehe dunno, I'll just keep at it |
02:59:17 | ldlework | hmm am I dumb? How do I sort a sequence? |
02:59:47 | ldlework | ah, random stdlib module |
03:01:28 | ldlework | I wonder if I can just do values.sort(cmp) |
03:02:34 | Araq_ | import algorithm |
03:03:05 | ldlework | map = initTable[float, proc()] |
03:03:23 | ldlework | Error: 'initTable' cannot be passed to a procvar |
03:03:42 | ldlework | not sure what that means |
03:04:52 | ldlework | anyone around know how to create a table to procs? |
03:05:35 | ldlework | :/ |
03:06:16 | ldlework | def-: you around? |
03:06:33 | Araq_ | initTable[float, proc()]() |
03:06:48 | Araq_ | you need to call it. create an issue we can easily improve the error message |
03:06:55 | Araq_ | and now I have to sleep sorry. |
03:08:39 | ldlework | map[rn] = redColor |
03:08:47 | ldlework | maxnoise.nim(46, 6) Error: could not resolve: map[rn] |
03:12:15 | * | vendethiel joined #nim |
03:13:03 | Araq_ | import tables |
03:15:04 | ldlework | Araq_: I did |
03:15:57 | ldlework | here's the snippet, https://gist.github.com/dustinlacewell/4799028d8c145386e6ae |
03:17:47 | ldlework | here's the whole file: https://gist.github.com/dustinlacewell/54ded16bfaabbb9a7de9 |
03:18:47 | ldlework | nim communityyyyyyyy |
03:19:00 | ldlework | halp, I'm trying the simple act of making a float->callable hash mapppp |
03:22:08 | ldlework | BlaXpirit: any chance you can help me out |
03:23:41 | ldlework | onionhammer: you around maybe? |
03:23:44 | Araq_ | ldlework: it's strange, I'm looking at it |
03:27:34 | Araq_ | ah ok |
03:27:56 | ldlework | phew |
03:28:07 | Araq_ | map = initTable[float, proc(diff:float): Color]() |
03:28:17 | Araq_ | your proc types are incompatible |
03:28:28 | Araq_ | it needs to have the proper return type |
03:28:33 | Araq_ | good night. |
03:29:53 | ldlework | thank youuuuu |
03:30:45 | ldlework | it seems strange that it needs the name of the argument to the proc |
03:30:47 | ldlework | ie 'diff' |
03:35:18 | * | brson quit (Ping timeout: 256 seconds) |
03:36:06 | * | vendethiel quit (Ping timeout: 265 seconds) |
03:47:56 | Araq_ | from future import `->` |
03:56:06 | * | pregressive joined #nim |
03:59:31 | ldlework | how do you specify return type with => ? |
03:59:59 | ldlework | oh |
04:00:13 | ldlework | woah I crashed gcc |
04:19:20 | * | vqrs quit (Ping timeout: 255 seconds) |
04:23:11 | * | vqrs joined #nim |
04:37:50 | onionhammer | ldlework what's up? |
04:38:40 | onionhammer | oh good u resolved it ;) |
04:38:43 | onionhammer | bbl |
05:30:02 | ldlework | :( https://gist.github.com/dustinlacewell/9a9bf21cdc8ee5bf8e9b |
05:30:55 | ldlework | oh |
05:31:11 | ldlework | nice |
05:31:28 | ldlework | not sure why it can't infer the type of 'd' there though |
05:33:44 | * | darkf joined #nim |
05:42:28 | ldlework | hi darkf |
05:44:06 | darkf | hello |
05:47:53 | ldlework | :) |
05:47:59 | * | BitPuffin|osx quit (Ping timeout: 255 seconds) |
05:50:34 | ldlework | how do I iterate over a sequence of generic objects? |
05:54:07 | reactormonk | ldlework, what's a "generic" object? |
05:54:16 | ldlework | an instance of a generic type |
05:54:30 | ldlework | but I'm guessing you just do "for i in sequence" and it infers |
05:54:32 | reactormonk | What do you know about this generic? |
05:54:49 | ldlework | everything I guess |
05:55:16 | reactormonk | What does the compiler know about this generic - no constraits, so I assume nothing? |
05:57:00 | ldlework | its just a "type Foo[T] = object attr: T" like thing |
06:05:49 | ldlework | wat, Error: type mismatch: got (typedesc[Biome[getBiomeValue.T]]) but expected 'typedesc[Biome[getBiomeValue.T]]' |
06:07:21 | ldlework | on this line: proc getBiomeValue[T](x, y: int, biomes: @[Biome[T]]): T = |
06:07:39 | ldlework | reactormonk: what might be wrong here? |
06:07:43 | ldlework | I can paste the whole file if needed |
06:08:27 | reactormonk | I don't know, looks good to me. |
06:08:34 | ldlework | :( |
06:09:26 | ldlework | reactormonk: I wonder if the parens around the first part of the error means anything |
06:09:33 | ldlework | no idea what that could be though.. |
06:10:08 | reactormonk | btw, I'd put the binomes first in the argument list, so you can go binomes.getBinomeValue(x, y) |
06:10:23 | reactormonk | also, [] might be a simpler name here |
06:10:23 | * | def- quit (Ping timeout: 264 seconds) |
06:10:24 | ldlework | oh |
06:10:33 | ldlework | reactormonk: what do you mean |
06:11:03 | reactormonk | You could call your method `[]`, so you can binomes[x, y] |
06:11:09 | reactormonk | ... IIRC that's how it works |
06:11:14 | ldlework | huh |
06:11:37 | ldlework | would that be |
06:11:51 | ldlework | biomes[x,y][Color] ? |
06:11:56 | ldlework | since I need to specify the type? |
06:13:01 | reactormonk | I think then you'd have to do binomes.`[]`[Color](x, y) |
06:13:10 | reactormonk | but you don't really need to specify the type |
06:15:04 | ldlework | reactormonk: mind if I gist the file? |
06:15:10 | * | def- joined #nim |
06:16:01 | reactormonk | Can't promise to take a look |
06:17:01 | ldlework | well, if you change your mind, https://gist.github.com/dustinlacewell/a63e69ab20bd4c802ab3 |
06:22:11 | ldlework | baffling |
06:24:21 | ldlework | def-: ever seen anything like this? |
06:26:51 | * | ldlework pokes onionhammer |
06:29:27 | ldlework | solved it |
06:29:32 | ldlework | I think? |
06:32:02 | ldlework | cool segfault |
06:32:04 | ldlework | :D |
06:32:48 | ldlework | yay |
06:32:50 | ldlework | it works |
06:35:26 | * | nastavnic joined #nim |
06:48:06 | * | vikaton quit (Quit: Connection closed for inactivity) |
06:53:35 | * | nastavnic quit (Ping timeout: 240 seconds) |
06:54:49 | * | buMPnet quit (Quit: No Ping reply in 180 seconds.) |
06:56:02 | * | buMPnet joined #nim |
06:58:08 | * | nastavnic joined #nim |
07:06:37 | * | desophos quit (Read error: Connection reset by peer) |
07:18:24 | * | krux02 quit (Remote host closed the connection) |
07:55:10 | * | nastavnic quit (Ping timeout: 276 seconds) |
07:55:50 | * | Demon_Fox quit (Quit: Leaving) |
07:56:30 | * | Demon_Fox joined #nim |
08:00:02 | * | nastavnic joined #nim |
08:12:23 | * | yglukhov joined #nim |
08:52:42 | * | yglukhov quit (Remote host closed the connection) |
08:53:21 | * | yglukhov joined #nim |
08:57:35 | * | yglukhov quit (Ping timeout: 240 seconds) |
09:02:36 | * | zepolen quit (Read error: Connection reset by peer) |
09:03:11 | * | zepolen joined #nim |
09:12:35 | * | nastavnic quit (Ping timeout: 240 seconds) |
09:16:55 | * | coffeepot joined #nim |
09:19:47 | * | Demon_Fox quit (Quit: Leaving) |
09:34:41 | * | darkf quit (Read error: Connection reset by peer) |
09:35:23 | * | darkf joined #nim |
09:50:04 | * | jaco60 quit (Ping timeout: 250 seconds) |
09:56:14 | * | octoploid quit (Quit: WeeChat 1.3-rc1) |
09:57:33 | * | octoploid joined #nim |
09:58:13 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
09:58:42 | * | coffeepot joined #nim |
10:03:55 | * | jaco60 joined #nim |
10:04:28 | * | yglukhov joined #nim |
10:05:14 | * | themagician quit (Ping timeout: 250 seconds) |
10:08:46 | * | yglukhov quit (Ping timeout: 240 seconds) |
10:32:52 | * | yglukhov joined #nim |
10:40:35 | * | jaco60 quit (Ping timeout: 240 seconds) |
10:41:04 | * | jaco60 joined #nim |
10:57:52 | * | ephja joined #nim |
10:58:15 | * | jaco60 quit (Ping timeout: 240 seconds) |
10:58:40 | * | jaco60 joined #nim |
11:02:10 | * | pregressive quit (Remote host closed the connection) |
11:20:33 | * | Sornaensis quit (Max SendQ exceeded) |
11:21:06 | * | Sornaensis joined #nim |
11:30:36 | * | jaco60 quit (Ping timeout: 250 seconds) |
11:31:03 | * | jaco60 joined #nim |
11:34:41 | * | drewsrem joined #nim |
11:42:11 | * | exebook joined #nim |
11:47:56 | drewsrem | Are there compiler options in nim that help me cross-compiling on a linux-system producing windows executables? |
11:56:13 | * | yglukhov_ joined #nim |
11:56:14 | * | yglukhov quit (Read error: Connection reset by peer) |
11:58:10 | drewsrem | nvm. just saw --os |
11:58:15 | * | jaco60 quit (Ping timeout: 260 seconds) |
11:59:11 | * | jaco60 joined #nim |
12:03:12 | * | Gonzih quit (Quit: WeeChat 1.3) |
12:05:42 | * | jaco60 quit (Ping timeout: 250 seconds) |
12:09:59 | * | xet7 quit (Ping timeout: 276 seconds) |
12:18:13 | * | lcm quit (Quit: Page closed) |
12:24:55 | * | xet7 joined #nim |
12:36:08 | * | yglukhov_ quit (Remote host closed the connection) |
12:44:59 | * | zepolen quit (Read error: Connection reset by peer) |
12:45:48 | * | zepolen joined #nim |
13:09:15 | * | Guest10472 quit (Changing host) |
13:09:15 | * | Guest10472 joined #nim |
13:09:15 | * | Guest10472 quit (Changing host) |
13:09:15 | * | Guest10472 joined #nim |
13:09:22 | * | Guest10472 is now known as Heartmender |
13:22:42 | * | themagician joined #nim |
13:27:33 | * | BitPuffin joined #nim |
13:49:12 | * | BlaXpirit quit (Quit: Bye) |
14:10:39 | * | ephja quit (Quit: WeeChat 1.3) |
14:14:52 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
14:15:02 | * | coffeepot joined #nim |
14:21:17 | * | yglukhov joined #nim |
14:25:35 | * | yglukhov quit (Ping timeout: 260 seconds) |
14:28:41 | * | BlaXpirit joined #nim |
14:49:22 | * | kerze joined #nim |
14:56:50 | * | BlaXpirit quit (Quit: Bye) |
14:59:19 | * | doxavore joined #nim |
14:59:49 | * | BlaXpirit joined #nim |
15:00:33 | * | BlaXpirit quit (Client Quit) |
15:01:04 | * | BlaXpirit joined #nim |
15:04:26 | * | drewsrem quit (Quit: Leaving) |
15:19:18 | federico3 | sounds like theduke disappeared and never came back - we lost another one - again. |
15:40:11 | dom96 | It happens unfortunately. You don't know though, maybe theduke will come back. Maybe theduke is just busy. |
15:51:28 | * | AckZ quit (Ping timeout: 250 seconds) |
15:52:19 | * | AckZ joined #nim |
16:04:50 | * | jaco60 joined #nim |
16:23:39 | * | BlaXpirit left #nim ("Bye") |
16:23:41 | * | BlaXpirit joined #nim |
16:33:34 | * | Jesin quit (Quit: Leaving) |
16:42:32 | * | zepolen quit (Remote host closed the connection) |
16:46:06 | coffeepot | just looked at the github updates - is assert begin changed to doAssert? |
16:46:34 | coffeepot | if so, how come? |
16:46:35 | * | brson joined #nim |
16:47:16 | coffeepot | just curious |
16:58:04 | * | nastavnic joined #nim |
17:07:41 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:13:47 | * | nastavnic quit (Ping timeout: 255 seconds) |
17:24:40 | * | Jesin joined #nim |
17:32:05 | dom96 | coffeepot: No. doAssert and assert are similar but slightly different |
17:32:13 | dom96 | the latter is removed in release mode |
18:14:36 | * | gmpreussner quit (Ping timeout: 264 seconds) |
18:19:27 | * | brson quit (Quit: leaving) |
18:19:53 | * | gmpreussner joined #nim |
18:35:44 | * | BitPuffin quit (Ping timeout: 256 seconds) |
18:39:13 | * | krux02 joined #nim |
18:41:00 | krux02 | Araq_: I've problems implementing a getTypeImpl, but getType2 works pretty solid |
18:41:49 | Araq_ | krux02: yay. now what does that mean? |
18:42:33 | krux02 | I've tried a lot, but I'haven't found a way, where getTypeImpl, always goes exactly one level deeper |
18:42:43 | * | darkf quit (Quit: Leaving) |
18:43:25 | krux02 | Simple structures work very good, but as far as I define something like this: |
18:44:04 | krux02 | type MyName = MyGeneric[T], it creates problems |
18:44:57 | krux02 | A call to getType2 should resolve MyName, if the variable is declared with that name |
18:45:12 | krux02 | getTypeImpl should return MyGeneric[T] |
18:46:30 | krux02 | I could make my function work on that case, that it would return MyGeneric, but not without destroying a case that worked so far |
18:47:51 | krux02 | I've tried a lot, but each fix broke something else in a circulating way |
18:49:02 | krux02 | can send you what I've done so far, maybe you can see it better than me, because you are more familiar with the nim type system. |
18:49:03 | * | pregressive joined #nim |
18:51:01 | * | vendethiel joined #nim |
18:52:56 | Araq_ | sure |
18:55:10 | krux02 | https://github.com/krux02/Nim/blob/3816513d4705c3b2a853fc1dc3502a9cb9e8f0d4/tests/macros/tgettype.nim |
18:55:38 | krux02 | that's the test file |
18:56:42 | krux02 | Araq_: https://github.com/krux02/Nim/blob/3816513d4705c3b2a853fc1dc3502a9cb9e8f0d4/compiler/vmdeps.nim |
18:57:28 | krux02 | at the end is opMapTypeToAst2, that's the function I implemented |
19:03:55 | * | aziz joined #nim |
19:04:46 | * | asterite joined #nim |
19:16:12 | * | kerze quit (Remote host closed the connection) |
19:18:05 | * | Demon_Fox joined #nim |
19:30:06 | * | gunn_ joined #nim |
19:31:52 | * | BlaXpirit_ joined #nim |
19:32:56 | * | nastavnic joined #nim |
19:34:12 | * | nastavnic quit (Client Quit) |
19:34:15 | * | BlaXpirit quit (Killed (verne.freenode.net (Nickname regained by services))) |
19:34:15 | * | BlaXpirit_ is now known as BlaXpirit |
19:37:12 | * | Lea2 joined #nim |
19:37:18 | * | SirCmpwn_ joined #nim |
19:38:34 | * | SirCmpwn quit (*.net *.split) |
19:38:34 | * | Learath2 quit (*.net *.split) |
19:38:34 | * | gunn quit (*.net *.split) |
19:42:15 | * | NimBot joined #nim |
19:44:36 | * | ray- joined #nim |
19:45:19 | * | SirCmpwn_ is now known as SirCmpwn |
19:58:43 | * | M-max quit (Ping timeout: 265 seconds) |
20:00:56 | * | M-max joined #nim |
20:01:56 | * | ray- quit (Ping timeout: 250 seconds) |
20:04:27 | * | ray- joined #nim |
20:23:03 | * | xet7 quit (Read error: Connection reset by peer) |
20:40:58 | * | nsf quit (Quit: WeeChat 1.3) |
20:47:46 | * | M-max quit (Ping timeout: 256 seconds) |
20:49:10 | * | M-Quora quit (Ping timeout: 250 seconds) |
20:55:10 | * | ^aurora^ joined #nim |
20:59:33 | * | brson joined #nim |
21:09:15 | * | M-Quora joined #nim |
21:23:40 | * | M-Quora quit (Quit: node-irc says goodbye) |
21:28:36 | * | Jesin quit (Quit: Leaving) |
21:31:44 | * | M-Quora joined #nim |
21:33:43 | * | Trustable joined #nim |
21:34:00 | * | yglukhov joined #nim |
21:35:06 | * | desophos joined #nim |
21:39:52 | * | M-Quora quit (Ping timeout: 250 seconds) |
21:50:15 | * | ray- quit (*.net *.split) |
21:50:16 | * | aziz quit (*.net *.split) |
21:50:16 | * | dv- quit (*.net *.split) |
21:51:34 | * | ray- joined #nim |
21:51:34 | * | aziz joined #nim |
21:51:34 | * | dv- joined #nim |
21:59:59 | * | desophos quit (Remote host closed the connection) |
22:00:52 | * | bigfondue quit (Ping timeout: 256 seconds) |
22:03:11 | * | bigfondue joined #nim |
22:13:55 | Araq_ | krux02: can you create a PR from that please? I will clean up and merge it if you ask for it |
22:16:53 | krux02 | yes I can do it, but I have to clean a bit up by myself before that |
22:24:05 | * | desophos joined #nim |
22:32:44 | * | Trustable quit (Remote host closed the connection) |
22:34:47 | * | desophos quit (Remote host closed the connection) |
22:37:17 | * | pregressive quit (Remote host closed the connection) |
22:58:46 | * | xet7 joined #nim |
23:15:13 | * | desophos joined #nim |
23:17:13 | * | desophos_ joined #nim |
23:20:32 | * | Demon_Fox quit (Ping timeout: 255 seconds) |
23:21:46 | * | Jesin joined #nim |
23:21:54 | * | desophos_ quit (Ping timeout: 256 seconds) |
23:22:21 | * | Demon_Fox joined #nim |
23:24:53 | ldlework | I'm going to try to port my JS data-driven entity system to Nim today. I'm nervous :( |
23:25:13 | * | ldlework has never had great luck doing data-driven anything in statically typed languages. |
23:36:45 | * | M-max joined #nim |
23:38:41 | ldlework | is there a working repl |
23:40:00 | * | vendethiel quit (Ping timeout: 260 seconds) |
23:43:18 | * | brson quit (Ping timeout: 272 seconds) |