00:12:20 | oculux | which platform and setup are developers using for nim development? is there some sort of template like vagrant to bring up a ready development environment? |
00:13:00 | oculux | i mean nimlang development - ie the platform and language itself |
00:13:21 | shashlick | folks use Windows, Linux and OSX in the core dev team itself |
00:13:49 | shashlick | and work off of a git clone of the repo, but there's packages posted online for each OS if preferred |
00:19:07 | oculux | to your knowledge are there "works on my machine" type issues at all? |
00:19:30 | oculux | i'd like to get a setup that is as close to core devs as possible to minimise issues |
00:20:58 | oculux | after my time crypto mining I have two machines now ready to serve me in my next projects - hopefully with much nim |
00:23:13 | shashlick | no i've personally had minimal such issues |
00:23:30 | shashlick | there's elaborate testing and regression done across OS to ensure reliability |
00:26:09 | shashlick | what OS are you working on |
00:42:10 | * | Sentreen quit (Ping timeout: 244 seconds) |
00:57:48 | * | xace quit (Read error: Connection reset by peer) |
00:57:57 | * | xace_ joined #nim |
01:09:17 | * | zachk quit (Quit: Leaving) |
01:09:45 | * | a__b__m joined #nim |
01:13:18 | * | a_b_m quit (Ping timeout: 250 seconds) |
01:13:46 | * | Marumoto quit (Remote host closed the connection) |
01:15:52 | * | a_b_m joined #nim |
01:17:14 | * | abm joined #nim |
01:19:27 | * | a__b__m quit (Ping timeout: 240 seconds) |
01:20:14 | * | a_b_m quit (Ping timeout: 250 seconds) |
01:43:56 | * | a_b_m joined #nim |
01:46:26 | * | abm quit (Ping timeout: 240 seconds) |
02:01:44 | * | Cthalupa quit (Ping timeout: 244 seconds) |
02:02:45 | * | Cthalupa joined #nim |
02:13:15 | * | darithorn quit (Quit: Leaving) |
02:27:00 | * | ghost64 quit (Quit: See you!) |
02:29:49 | * | darithorn joined #nim |
02:31:04 | * | darithorn quit (Client Quit) |
02:31:23 | * | ghost64 joined #nim |
02:35:57 | * | darithorn joined #nim |
02:43:29 | FromGitter | <irskep> How can I check if an object is of a certain type, and cast it to that type if so? |
02:43:41 | FromGitter | <irskep> e.g. in swift it would be "let x = y as? Foo" |
02:47:25 | FromGitter | <irskep> Alternatively, can I enforce a generic parameter to be a descendent of a certain object type? |
02:48:03 | FromGitter | <irskep> another swift example being, "let myDict = Dictionary<String, Foo>()" |
02:49:37 | FromGitter | <irskep> I guess a better swift example would be "func doFooeyThing<T: Foo>(x: T) { x.foomethod() }" |
02:51:41 | * | plushie joined #nim |
02:52:32 | FromDiscord_ | <exelotl> I really like the way kotlin does it https://kotlinlang.org/docs/reference/typecasts.html |
02:54:57 | leorize | irskep: `proc doFooeyThing[T: Foo](x: T)`? |
02:56:22 | leorize | and we don't have `as?`, but you can also do: `let x = if y is Foo: Foo(y)` |
02:57:13 | leorize | if you found yourself using that a lot then you can make a `as?` template? |
02:58:34 | * | theelous3 joined #nim |
03:02:24 | * | banc quit (Quit: Bye) |
03:05:37 | * | seni quit (Quit: Leaving) |
03:17:53 | plushie | irkskep: maybe something like this https://gist.github.com/qxxxb/7dcdbf9497480be4c2e756951dab618d |
03:23:07 | * | banc joined #nim |
03:25:31 | * | darithorn quit (Quit: Leaving) |
03:26:17 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
03:26:33 | FromGitter | <irskep> Thanks, that all helps! Trying things... |
03:36:41 | FromGitter | <irskep> Well, I got something that compiles, but now I'm getting a segfault and can't remember how to get a traceback for it :-) |
03:37:16 | leorize | compile without `-d:release` :) |
03:39:01 | FromGitter | <irskep> Not currently using that flag |
03:39:35 | leorize | try `import segfaults` in your project then |
03:39:42 | FromGitter | <irskep> Oh huh, this might be a compiler rash |
03:39:43 | leorize | it'll install an event handler |
03:39:48 | leorize | oh |
03:40:06 | leorize | what version of the compiler are you on? |
03:40:18 | FromGitter | <irskep> 1) 19.2 |
03:41:44 | leorize | can you make a small snippet that can crash the compiler? |
03:43:59 | FromGitter | <irskep> Maybe when I climb a couple levels out of a yak shave |
03:46:54 | leorize | well, what were you trying to do? |
03:47:23 | leorize | we might be able to give you an alternative that won't crash :) |
03:47:33 | FromGitter | <irskep> at a super high level, an entity-component system |
03:49:15 | FromGitter | <irskep> Here's a base type for a System which stores Component descendant types in a critbit tree https://github.com/irskep/nimrl/blob/master/src/rules/ecs_base.nim |
03:49:25 | FromGitter | <irskep> I just pushed what I had so it doesn't compile at the moment :-) |
03:49:54 | FromGitter | <irskep> Here's a descendant type of System for a specific Component https://github.com/irskep/nimrl/blob/master/src/rules/ecs_actor.nim |
03:50:26 | FromGitter | <irskep> I think what I'm trying to do at the type level is a bit much for where nim is at with generics |
03:52:11 | FromGitter | <irskep> The specific thing I've been trying to achieve since I started talking in this channel is to get `proc set(system, entity, component)` to automatically set `component.entity = entity` because it knows its component parameter is a Component |
03:55:38 | leorize | if you're using inheritance, you wouldn't need to use generics |
03:56:06 | FromGitter | <irskep> Each inherited System type is associated with a different Component type, so I think I do, if I don't want to copy-paste all the methods for each system |
03:56:16 | leorize | just put Component as the type for the last parameter of `set` |
03:56:32 | leorize | well, I'll try to debug your code |
03:57:06 | FromGitter | <irskep> I'll push up something that compiles then |
03:57:53 | * | a_b_m quit (Ping timeout: 246 seconds) |
03:58:29 | leorize | so what's crashing? |
03:58:52 | leorize | I see, ecs.nim is crashing |
03:59:08 | FromGitter | <irskep> I just pushed the problem I actually would like solved, at a high level, if that helps |
03:59:18 | FromGitter | <irskep> The compiler isn't crashing anymore |
04:00:57 | leorize | and you should use the built-in `result` variable |
04:01:17 | FromGitter | <irskep> isn't that just a style choice? |
04:01:36 | leorize | nope, the `result` variable does some return value optimization |
04:04:47 | leorize | well, `return val` is equal to `result = val; return` |
04:04:55 | leorize | but using result directly avoids copying |
04:05:18 | FromGitter | <irskep> I'll remember that when I'm writing performance sensitive code :-) |
04:06:34 | FromGitter | <irskep> The thing I can't understand right now, is I have a type with a generic parameter, System[T], and an inherited type `ActorSystem = ref object of System[ActorComponent]`, and yet `proc get*T (system: System[T], entity: Entity): Option[T]` doesn't return an `ActorComponent` when called on an `ActorSystem` |
04:07:29 | FromGitter | <irskep> LOL - figured out my issue |
04:07:52 | leorize | `ActorSystem = System[ActorComponent]` would solves all of your problem :P |
04:07:58 | FromGitter | <irskep> get() returns an Option, so I have to call get() on it. π€¦ββοΈ |
04:08:07 | FromGitter | <irskep> I was doing precisely that already |
04:08:20 | FromGitter | <irskep> That's why I was so confused |
04:08:30 | FromGitter | <irskep> But I forgot that System.get(...) returned an Option[T], not a T |
04:09:13 | leorize | :) |
04:09:18 | leorize | https://nim-lang.github.io/Nim/nep1#introduction-naming-conventions |
04:09:36 | leorize | ^ I'd recommend naming your functions based on that guide |
04:09:56 | FromGitter | <irskep> Which rule did I violate here? |
04:10:03 | FromGitter | <irskep> using get() instead of []? |
04:10:03 | leorize | `get()` |
04:10:06 | leorize | yea :P |
04:10:22 | leorize | for your use case `[]` seemed more appropriate |
04:11:19 | FromGitter | <irskep> Yeah, I'm still working through keeping nim in working memory |
04:12:59 | leorize | maybe you should rename the `all` iterator to `items` |
04:13:19 | leorize | that will let you do: `for i in System` |
04:13:28 | FromGitter | <irskep> Funny how Nim doesn't have "interfaces" but it does need things like that |
04:13:53 | leorize | not really imo |
04:14:43 | leorize | well, vtref was in development, but seemed like the idea was dropped |
04:16:27 | FromGitter | <irskep> thanks for your help and tips, btw |
04:18:07 | leorize | np :) |
04:19:10 | FromGitter | <irskep> if you ever actually got my program building, I would be kind of amazed, since I haven't really tried to set it up for other people |
04:23:23 | leorize | nimterop head is not building for me atm, but that's not your fault :P |
04:23:46 | FromGitter | <irskep> I asked the maintainer to make tagged releases a while ago and the response was basically "...nah" :-) |
04:24:18 | leorize | shashlick: ^ |
04:25:20 | FromGitter | <irskep> I'd tell you the hash I'm using but I don't think nimble stores that |
04:26:01 | leorize | yea, it doesn't :P |
04:29:54 | * | oculux quit (Quit: blah) |
04:30:27 | leorize | irskep: and I don't think you'd need a Makefile? |
04:30:39 | leorize | you can just add a new task to nimble :) |
04:33:17 | * | a_b_m joined #nim |
04:38:07 | FromGitter | <irskep> Yeah my makefile is totally redundant, I don't use it anymore |
04:38:27 | FromGitter | <irskep> although it does handle the occasional situation where I already have an instance running and kills the old one form e |
04:39:13 | FromGitter | <irskep> I did try to "do it right" through the whole project, so in theory it shouldn't be hard to get building, but it for sure only works on macOS because I didn't include the static binary for raylib for windows or linux |
04:39:25 | leorize | and you can write a task for nimble :) |
04:41:24 | * | plushie quit (Quit: WeeChat 1.9.1) |
04:44:51 | * | oculux joined #nim |
04:45:11 | * | oculux quit (Client Quit) |
04:45:41 | * | oculux joined #nim |
04:54:44 | * | a_b_m quit (Ping timeout: 250 seconds) |
05:04:51 | shashlick | We will be tagging, it's early times that's all |
05:05:20 | shashlick | What issue you seeing leorize |
05:07:13 | leorize | http://ix.io/1zSp |
05:10:06 | shashlick | checking |
05:12:31 | shashlick | what OS / nim version? |
05:13:09 | leorize | git hash: 07553034de5bd9ffa89df303bf789664f9cb8ed8 |
05:13:26 | leorize | i'm running gentoo |
05:20:32 | shashlick | just tested with that hash - worked for me |
05:20:38 | shashlick | but i'm on ubuntu |
05:21:23 | leorize | this is my nimble hash: e60ab125494a231c6db3c7cd5122868a0d204b58 |
05:22:32 | shashlick | seems like mkdir didn't work |
05:25:05 | FromGitter | <timotheecour> NIMBLE_DIR=$HOME/.nimble_fake6 nimble install nimterop |
05:48:32 | shashlick | figured it out |
05:48:57 | shashlick | quoteShell causing trouble |
05:49:33 | * | leorize quit (Ping timeout: 252 seconds) |
06:02:31 | shashlick | pushed a fix leorize, please let me know if you still have an issue |
06:22:29 | * | vlad1777d joined #nim |
06:30:01 | * | gangstacat quit (Quit: Δis!) |
06:51:59 | * | gangstacat joined #nim |
06:56:04 | * | nsf joined #nim |
07:20:27 | * | leorize joined #nim |
07:20:33 | * | theelous3 quit (Ping timeout: 268 seconds) |
07:39:40 | * | narimiran joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:36 | * | gmpreussner joined #nim |
08:06:08 | * | Trustable joined #nim |
08:35:02 | * | Trustable quit (Remote host closed the connection) |
08:43:30 | * | nsf quit (Quit: WeeChat 2.3) |
08:44:53 | * | dddddd quit (Read error: Connection reset by peer) |
08:53:14 | * | NimBot joined #nim |
09:46:28 | * | regtools quit (Quit: leaving) |
10:00:02 | * | regtools joined #nim |
10:21:08 | * | lritter joined #nim |
10:34:26 | * | Cthalupa quit (Ping timeout: 240 seconds) |
10:35:55 | * | nsf joined #nim |
10:36:35 | * | Cthalupa joined #nim |
10:41:23 | * | kapil____ joined #nim |
10:46:17 | * | stefanos82 joined #nim |
10:59:30 | * | nutfan joined #nim |
11:41:28 | * | nutfan quit (Remote host closed the connection) |
11:46:57 | * | Sentreen joined #nim |
11:48:33 | * | Zevv quit (Quit: Lost terminal) |
11:53:37 | * | Zevv joined #nim |
12:05:53 | FromGitter | <Clyybber> I can't seem to find uptodate nim docker images |
12:06:13 | FromGitter | <Clyybber> Or is this up to date? https://github.com/status-im/nim-docker |
13:04:56 | * | aguspiza joined #nim |
13:30:07 | * | kapil____ quit (Quit: Connection closed for inactivity) |
13:34:45 | * | Vladar joined #nim |
13:52:45 | * | narimiran quit (Ping timeout: 268 seconds) |
14:01:52 | * | dddddd joined #nim |
14:34:22 | FromGitter | <couven92> Uhm... since we're at FOSDEM, I actually tried to compile Nim from source again... On Windows, using VCC it still fails... -.- β `msgs.nim(85, 39) Error: ambiguous call; both tables. (t: var Table[[].A, [].B], key: A)[declared in ..\lib\pure\collections\tables.nim(372, 6)] and tables. (t: Table[[].A, [].B], key: A)[declared in ..\lib\pure\collections\tables.nim(349, 6)] match for: (Table[system.string, |
14:34:23 | FromGitter | ... lineinfos.FileIndex], string)` |
14:35:15 | FromGitter | <couven92> https://github.com/nim-lang/Nim/issues/6229 |
15:06:13 | * | a_b_m joined #nim |
15:17:03 | * | narimiran joined #nim |
15:27:30 | FromDiscord_ | <exelotl> Here's my weird poor-man's coroutines/async/await library https://github.com/exelotl/ecolo |
15:47:46 | * | vlad1777d quit (Ping timeout: 250 seconds) |
16:21:03 | * | Marshallazora joined #nim |
16:21:11 | * | Marshallazora left #nim (#nim) |
16:33:08 | * | vlad1777d joined #nim |
16:52:01 | * | hoijui joined #nim |
16:52:13 | shashlick | @exelotl: nice - will check out |
17:05:24 | * | so quit (Ping timeout: 246 seconds) |
17:10:11 | * | so joined #nim |
17:16:35 | * | Vladar quit (Remote host closed the connection) |
17:18:20 | FromDiscord_ | <exelotl> it's pretty barebones but it's exactly the machinery I need to get nice dialog/cutscene scripting in my gameboy advance game |
17:38:04 | shashlick | Do you need nimrtl.dll when using a Nim dll from a Nim program? |
17:55:11 | Zevv | I believe you do |
18:00:04 | shashlick | thanks - I guess i'll run into some crash once I start allocating/deallocating stuff in the plugin |
18:17:14 | * | hoijui quit (Remote host closed the connection) |
18:23:37 | * | kobi7 joined #nim |
18:24:33 | kobi7 | Hello, I am facing an issue with a library I'm using. "Error: can raise an unlisted exception:" but then there is nothing afterwards. |
18:24:54 | * | Tyresc joined #nim |
18:25:32 | kobi7 | if I remove the exception types in the raises pragma, it tells me of two types missing. but when I add them, I get the above msg |
18:25:53 | kobi7 | not sure if it's a bug in the compiler |
18:27:00 | kobi7 | but anyway it prevents compilation, and there is no hint if I did something to trigger it, because it didn't happen previously |
18:31:51 | shashlick | snippet might help |
18:32:05 | shashlick | but one of the procs you are calling is raising an exception not in your list |
18:32:17 | shashlick | so it isn't just the exceptions you raise but those of your callees too |
18:33:18 | kobi7 | so only within the relevant proc, right? |
18:33:42 | kobi7 | "underneath" the raises pragma |
18:35:11 | kobi7 | shashlick: but why doesn't it mention the name of the exception if it can find something? |
18:35:33 | kobi7 | I will try to make a small testcase |
18:37:16 | shashlick | i thought it did, but don't have detailed understanding onit |
18:39:25 | kobi7 | can I msg you privately for you to try on your computer? |
18:40:36 | * | Ven`` joined #nim |
18:41:07 | * | lritter quit (Ping timeout: 240 seconds) |
18:42:07 | kobi7 | basically nimble install yaml, then make a domain object, and a corresponding yaml file. then do: var fs = newFileStream(yamlFile) ; var x:YourDomainType and use the load* proc, load(fs, x) |
18:42:54 | kobi7 | I get: /home/kobi7/.nimble/pkgs/yaml-#head/yaml/serialization.nim(159, 15) template/generic instantiation from here |
18:43:02 | kobi7 | /home/kobi7/.nimble/pkgs/yaml-#head/yaml/serialization.nim(146, 33) Error: can raise an unlisted exception: |
18:44:32 | kobi7 | removing an exception type from the raises pragma (one that it raises) will tell me which exception. but adding it back and it still fails to compile. |
18:50:11 | shashlick | that is a bug with yaml then |
18:52:56 | shashlick | best to post here since others can also help |
18:53:43 | shashlick | what version of nim are you using |
18:56:30 | kobi7 | latest nim |
18:56:33 | * | Vladar joined #nim |
18:56:59 | kobi7 | Compiled at 2019-02-02 |
18:58:28 | kobi7 | I thought that since Nim is statically typed, the libs get checked, and there is no issue of sometimes triggering lib code that doesn't compile. |
18:59:12 | shashlick | it is checking the lib that's why you are seeing the errr |
18:59:50 | kobi7 | will it error if I just import the lib but not use it? |
19:00:51 | shashlick | i think so |
19:02:07 | kobi7 | I mean, it worked before, but I changed the format a little, and it fails now. it tries to build an object from the yaml, like a parser would |
19:02:15 | kobi7 | maybe it's some template magic. |
19:03:08 | kobi7 | the issue is that the compiler error message is not useful |
19:03:50 | kobi7 | well, I'll work on something else, til I think straight :) |
19:16:55 | * | junland_ quit (Quit: Disconnected.) |
19:17:38 | * | junland joined #nim |
19:19:13 | * | kobi7 quit (Quit: Leaving) |
19:35:25 | * | vendethiel- joined #nim |
19:37:08 | * | Ven`` quit (Ping timeout: 245 seconds) |
19:43:27 | * | aguspiza quit (Ping timeout: 240 seconds) |
19:52:09 | * | vlad1777d quit (Remote host closed the connection) |
19:53:15 | * | vlad1777d joined #nim |
19:56:27 | * | nsf quit (Quit: WeeChat 2.3) |
20:31:16 | * | aguspiza joined #nim |
21:03:38 | * | theelous3 joined #nim |
21:16:39 | * | theelous3 quit (Remote host closed the connection) |
21:19:06 | * | Snircle joined #nim |
21:27:14 | * | aguspiza quit (Ping timeout: 268 seconds) |
21:37:28 | * | vendethiel- quit (Ping timeout: 246 seconds) |
21:44:47 | * | a__b__m joined #nim |
21:48:05 | * | leb joined #nim |
21:48:44 | * | a_b_m quit (Ping timeout: 250 seconds) |
21:52:31 | FromGitter | <MisterBianco> I would like to use syntax like: |
21:52:54 | FromGitter | <MisterBianco> `````` |
21:53:20 | FromGitter | <MisterBianco> If var: echo var |
21:53:40 | FromGitter | <MisterBianco> Is there a way to test "truthiness" of a variable? |
21:55:04 | narimiran | what is var? int? |
21:56:34 | narimiran | you can use converters (https://nim-lang.github.io/Nim/manual.html#converters), but it might be better to be explicit |
21:57:10 | FromGitter | <MisterBianco> That looks good, can you explain the explicit comment? |
21:58:20 | narimiran[m] | expicit: 'if int > 0', implicit: 'if int' |
22:01:18 | * | narimiran quit (Ping timeout: 245 seconds) |
22:05:55 | * | a_b_m joined #nim |
22:09:12 | * | a__b__m quit (Ping timeout: 246 seconds) |
22:13:05 | * | Vladar quit (Remote host closed the connection) |
22:14:50 | FromDiscord_ | <juan_carlos> var x = (try: 2 finally: echo 2) |
22:15:15 | FromDiscord_ | <juan_carlos> It echo the variable if Ok, get the error if error. That for debug only. |
22:17:32 | FromDiscord_ | <juan_carlos> var o = (try: 2 finally: echo"Variable is OK") |
22:42:45 | FromGitter | <riddl_gitlab> Hi again, short question. Is `[]` the only way to dereference a c pointer? |
22:53:08 | Tyresc | hi, I am trying to display a 32 bit integer in binary form, right now I am using fmt"{int:#b}" to convert it but I am not getting the expected length any ideas? |
23:15:10 | * | leb__ joined #nim |
23:15:15 | * | leb quit (Read error: Connection reset by peer) |
23:19:36 | FromGitter | <riddl_gitlab> https://glot.io/snippets/f95p5tcbx0 β why for statement doesnt work with uints |
23:57:10 | * | vlad1777d quit (Ping timeout: 272 seconds) |