00:05:45 | rockcavera | mratsim thanks for confirming |
00:17:33 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:58:23 | * | Hideki_ joined #nim |
01:07:55 | * | notcreative quit (Ping timeout: 260 seconds) |
01:14:58 | * | steshaw joined #nim |
01:41:29 | * | btop joined #nim |
01:46:26 | * | btop quit (Ping timeout: 240 seconds) |
02:08:48 | * | sealmove joined #nim |
02:29:25 | * | Hideki_ quit (Remote host closed the connection) |
02:31:09 | * | Hideki_ joined #nim |
02:35:50 | * | Hideki_ quit (Ping timeout: 276 seconds) |
03:09:03 | * | Hideki_ joined #nim |
03:19:38 | * | theelous3 joined #nim |
03:19:58 | * | Hideki_ quit (Ping timeout: 268 seconds) |
03:24:20 | * | steshaw quit (Quit: Connection closed for inactivity) |
03:26:33 | * | chemist69 quit (Ping timeout: 245 seconds) |
03:28:30 | * | chemist69 joined #nim |
03:29:35 | * | btop joined #nim |
03:34:59 | * | btop quit (Ping timeout: 276 seconds) |
03:44:25 | * | btop joined #nim |
04:13:05 | * | arecaceae quit (Remote host closed the connection) |
04:13:28 | * | arecaceae joined #nim |
04:34:01 | * | thomasross quit (Remote host closed the connection) |
04:34:27 | * | thomasross joined #nim |
04:36:49 | * | thomasross quit (Read error: Connection reset by peer) |
04:37:17 | * | thomasross joined #nim |
04:42:58 | * | sealmove quit (Quit: WeeChat 2.6) |
04:44:49 | * | dddddd quit (Remote host closed the connection) |
04:46:33 | * | theelous3 quit (Ping timeout: 245 seconds) |
05:04:14 | * | snooptek joined #nim |
05:10:23 | * | owl_000 quit (Ping timeout: 246 seconds) |
05:22:58 | * | owl_000 joined #nim |
05:25:51 | FromGitter | <zacharycarter> shashlick: can nimterop clone mercurial repos too? or just git? |
05:27:42 | * | thomasross quit (Remote host closed the connection) |
05:28:34 | FromGitter | <zacharycarter> eh nevermind it's not important - I'm just using a file instead |
05:30:16 | FromGitter | <zacharycarter> it doesn't look like nimterop auto extracts `.tar.bz2` files? |
05:30:17 | FromGitter | <zacharycarter> ugh |
05:36:48 | FromGitter | <zacharycarter> well - maybe it can, it wasn't working because I didn't have it in the static block |
05:37:04 | FromGitter | <zacharycarter> the curl command to get the file doesn't work on windows |
05:37:14 | FromGitter | <zacharycarter> so I guess I'm stuck placing the source files in my project |
05:51:53 | FromGitter | <zacharycarter> weird - I'm getting: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d7c7ff972fe125111a08560] |
05:52:04 | FromGitter | <zacharycarter> but I only see the PHYSFS_stat type defined once |
05:54:56 | FromGitter | <zacharycarter> but doing what was suggested fixed it - so \o/ |
06:01:04 | * | solitudesf joined #nim |
06:11:38 | * | btop quit (Ping timeout: 276 seconds) |
06:12:19 | * | solitudesf quit (Remote host closed the connection) |
06:12:43 | * | solitudesf joined #nim |
06:14:43 | * | gangstacat quit (Quit: Ĝis!) |
06:16:39 | * | narimiran joined #nim |
06:17:06 | * | solitudesf quit (Ping timeout: 265 seconds) |
06:30:02 | * | absolutejam1 joined #nim |
06:38:19 | * | gangstacat joined #nim |
06:43:37 | * | blu quit (Remote host closed the connection) |
06:46:35 | * | absolutejam1 quit (Ping timeout: 265 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:49 | * | gmpreussner joined #nim |
07:05:12 | * | gangstacat quit (Quit: Ĝis!) |
07:06:32 | * | gangstacat joined #nim |
07:16:36 | * | Hideki_ joined #nim |
07:20:43 | * | Hideki_ quit (Ping timeout: 245 seconds) |
07:23:15 | * | steshaw_ joined #nim |
07:23:38 | * | actuallybatman quit (Ping timeout: 240 seconds) |
07:28:54 | FromGitter | <alehander42> so |
07:29:08 | FromGitter | <alehander42> i have to use withData |
07:29:13 | FromGitter | <alehander42> as a select loop? right? |
07:30:55 | FromGitter | <alehander42> or should i directly loop? |
07:31:08 | FromGitter | <alehander42> i guess they should be similar, ill see! |
07:39:30 | * | Trustable joined #nim |
07:41:09 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
07:43:39 | * | laaron joined #nim |
07:48:28 | * | laaron quit (Remote host closed the connection) |
07:50:54 | * | laaron joined #nim |
07:57:37 | * | steshaw_ is now known as steshaw |
07:59:12 | FromGitter | <kdheepak> `pacman -S nim` installs 0.18.0 |
07:59:29 | FromGitter | <kdheepak> Does anyone know why it does not install a more recent version? |
08:00:31 | FromGitter | <zacharycarter> package probably hasn't been updated in the repo |
08:02:23 | * | absolutejam1 joined #nim |
08:03:26 | * | owl_000 quit (Ping timeout: 265 seconds) |
08:07:06 | narimiran | @kdheepak because the arch maintainer is lazy |
08:07:28 | FromGitter | <kdheepak> That's unfortunate |
08:07:32 | narimiran | i contacted them, but no luck |
08:08:00 | narimiran | manjaro had the same problem, but they fixed it by maintaining nim package by themselves now, so it is updated |
08:08:34 | narimiran | much much nicer community over at manjaro than on arch |
08:09:38 | FromGitter | <alehander42> do we have |
08:09:46 | FromGitter | <alehander42> up to date .deb packages |
08:09:55 | narimiran | iirc, yes |
08:09:58 | FromGitter | <alehander42> how often are they released? on each 0.x? |
08:10:46 | narimiran | when i mentioned that debian has the newest nim, and arch is 2 major releases behind, i was basically told by arch community to fuck off |
08:11:01 | FromGitter | <alehander42> hm, strange |
08:11:22 | FromGitter | <alehander42> do they prefer to keep older stuff as a "protection" against bleeding-edgeness |
08:11:35 | FromGitter | <alehander42> like, i guess some distros are somehow conservative |
08:11:38 | narimiran | and in the same time they are "hurr durrr, manjaro holds off some packages for a week or two" |
08:11:53 | narimiran | "we are the one true bleeding edge" |
08:11:56 | FromGitter | <alehander42> i totally dont know those communities, i am a simple ubuntu user |
08:12:19 | FromGitter | <alehander42> hm, well there must've been misunderstanding then |
08:12:31 | narimiran | no, they prefer to be as bleeding as possible. unless when they don't. |
08:13:18 | narimiran | usually it is "the new version of package xyz was released 2 hours ago, you can get it on arch" |
08:13:35 | FromGitter | <alehander42> wow, i found a "nalimilan>" in the julia channel |
08:13:43 | FromGitter | <alehander42> you have a unknown brother there :P |
08:13:53 | narimiran | hehe, yeah, i know about him :) |
08:14:58 | FromGitter | <alehander42> yeah, well, who is responsible to release new versions |
08:15:19 | FromGitter | <alehander42> on arch? only the individual maintainer, or should the distro maintainers also approve it |
08:15:27 | FromGitter | <alehander42> like, can't nim org take over |
08:16:31 | narimiran | after my recent experience with them, i don't want to have any more business with them. |
08:17:05 | narimiran | it feels like a bunch of nerdy 15 year olds, trying to sound very smart. no thanks. |
08:17:40 | FromGitter | <alehander42> ok, i am sure somebody will find a way to fix it soon |
08:17:58 | FromGitter | <alehander42> what i want is more |
08:18:25 | FromGitter | <alehander42> compiler explorer support |
08:18:31 | FromGitter | <alehander42> i saw zig have it now as well |
08:19:00 | FromGitter | <alehander42> https://github.com/mattgodbolt/compiler-explorer/issues/206 |
08:19:02 | * | absolutejam1 quit (Ping timeout: 276 seconds) |
08:19:11 | FromGitter | <alehander42> it seems they had to wait after 0.20? |
08:19:30 | narimiran | soon? 0.19 was released almost exactly one year ago. they are still on 0.18. (remember, the distro that is very proud to have new packages in a matter of hours) |
08:19:49 | narimiran | yeah, godbolt support would be great!! |
08:20:11 | FromGitter | <alehander42> but what is missing |
08:20:26 | * | owl_000 joined #nim |
08:21:05 | narimiran | there was some attempt, i think by Rayman, but i don't know the exact details |
08:22:53 | * | crem quit (Ping timeout: 246 seconds) |
08:22:58 | FromGitter | <alehander42> pinging rayman22201 |
08:23:01 | FromGitter | <alehander42> just in case |
08:25:25 | * | crem joined #nim |
08:52:50 | * | nsf joined #nim |
09:17:30 | * | Vladar joined #nim |
09:31:29 | * | steshaw quit (Quit: Connection closed for inactivity) |
09:31:43 | FromGitter | <mratsim> There is even a Stefan Karpinski (hidden Stefan Salewski in Julia) |
09:31:55 | FromGitter | <mratsim> Strange regarding arch. I can flag it outdated or raise it in the forum |
09:32:14 | FromGitter | <alehander42> hm, i found out select is what i need to use |
09:32:46 | FromGitter | <mratsim> I met some of the arch trusted users and maintainers at FOSDEM and they were nice folks |
09:34:33 | narimiran | @mratsim maybe wait a bit, so you can ping them about nim 1.0 ;) |
09:50:02 | * | laaron quit (Remote host closed the connection) |
09:52:45 | * | laaron joined #nim |
09:57:41 | * | ng0 joined #nim |
09:59:46 | huj123[m] | I find it ironic that Arch has an older version of Nim than Fedora |
10:00:38 | huj123[m] | Fedora has 0.19.6, which isn't the newest but hey it's the updates repository. they have krita and kdenlive versions which are about 1 year old at this point in time |
10:06:45 | leorize | Arch has an older version of Nim than Haiku :p |
10:29:39 | * | dddddd joined #nim |
10:37:06 | * | krux02 joined #nim |
10:56:18 | FromGitter | <moigagoo> Hi! Just asked in Telegram, reposting here for @Araq and other core developers. ⏎ ⏎ Is it at all possible to have a pair programming session with some of the core developers? Maybe make it a paid service (I'll be the first to pay!)? |
10:58:23 | FromGitter | <moigagoo> I'm having trouble understanding what happens with args being passed into macros. Apparently, their values get replaced with their reprs. I want to understand why that happens and what can be done about it. I believe having a 30 minute call with a person who thoroughly knows the subject may be the quickest way to learn. |
10:58:27 | * | Hideki_ joined #nim |
10:59:07 | * | laaron quit (Remote host closed the connection) |
11:03:14 | * | Hideki_ quit (Ping timeout: 265 seconds) |
11:04:41 | * | laaron joined #nim |
11:16:04 | * | krux02 quit (Remote host closed the connection) |
11:37:23 | * | Hideki_ joined #nim |
11:39:45 | huj123[m] | moigagoo: you don't pass values to the macros. you pass their syntax trees. basically, when you pass an argument to a macro, the argument is left as a NimNode, eg. `2` doesn't turn into an `int`, it's just a `NimNode` |
11:40:12 | huj123[m] | iirc `typed` arguments had different semantics but I never really tried |
11:41:14 | * | narimiran quit (Ping timeout: 240 seconds) |
11:54:00 | * | laaron quit (Remote host closed the connection) |
11:56:37 | * | laaron joined #nim |
12:08:32 | FromGitter | <moigagoo> @huj123[m] I'm dealing with typed args here. I'm passing args with concrete types like `seq[SqlQuery]` to a template, then getting its AST with getAst. Right before the getAst call the type is correct, at the first line of the template it's `array[0..3, string]`. |
12:12:45 | * | krux02 joined #nim |
12:22:08 | Araq | http://blog.marcocantu.com/blog/2018-october-Delphi-ARC-directions.html ARC is dead for Delphi. Quite a surprise |
12:28:29 | * | tyrion[m] joined #nim |
12:30:56 | * | Hideki_ quit (Remote host closed the connection) |
12:31:26 | FromGitter | <deech> Are there any compile time reflection functions that can search scope for all `distinct` types that match? So, eg. given `10` I want it to find `type MyInt = distinct int` for me. There are procs like `distinctBase` but they go the other way. |
12:32:27 | Araq | no. macros are top down by design, they don't get to query the symbols outside the macro invokation |
12:39:37 | * | huj123[m] is now known as lqdev[m] |
12:40:37 | * | tyrion[m] is now known as tyrion-mx |
12:43:06 | FromGitter | <deech> It would be a useful type system exploration tool. In general being able to look around query static information from the current scope would be very powerful. |
12:43:07 | * | krux02 quit (Remote host closed the connection) |
12:44:04 | * | laaron quit (Remote host closed the connection) |
12:44:44 | * | sealmove joined #nim |
12:46:28 | sealmove | hi, is it possible to use unittest but spread tests in multiple files? |
12:46:32 | * | tyrion-mx left #nim ("User left") |
12:47:32 | lqdev[m] | oh nice, seems that the matrix irc bridge is so damn buggy it literally bridges my nickname from another room to this room |
12:47:35 | lqdev[m] | how great |
12:47:39 | lqdev[m] | Node.JS™ |
12:48:36 | lqdev[m] | and I set the nickname with /myroomname so this should've never happened. |
12:54:35 | * | laaron joined #nim |
12:57:35 | Araq | deech: planned for v2, maybe |
13:03:09 | FromGitter | <deech> I suppose I can fake it now by using the compiler as a library? Idk, never tried it. |
13:08:50 | Araq | possible |
13:28:18 | * | actuallybatman joined #nim |
13:42:00 | FromGitter | <YiyuanGH> When I first glanced at the system module, I found the styles of type names are mixture. Some were in lower case like int8 and others in PascalCase like Ordinal. Also, the type openArray is in camelCase. The Nim style guide just told me that Type identifiers should be in PascalCase. Until I have read the discussions (https://forum.nim-lang.org/t/4770#29816), I didn't know there were some exceptions. I think it will |
13:42:00 | FromGitter | ... be better to add some explicit declarations in tutorial or manual to remove the confusions of newbies. |
13:42:36 | FromGitter | <YiyuanGH> https://forum.nim-lang.org/t/4770#29816 |
13:43:45 | leorize | builtin types starts with lowercase |
13:46:04 | sealmove | how to write a statement macro `addCodeToString(where, what)`? |
14:10:53 | * | NimBot joined #nim |
14:20:23 | FromGitter | <zacharycarter> @YiyuanGH - that's pretty similar to a lot of programming languages |
14:20:27 | FromGitter | <zacharycarter> like C |
14:20:29 | leorize | sealmove: uhmmm, what are you trying to do? |
14:20:32 | FromGitter | <zacharycarter> and C++ |
14:20:55 | FromGitter | <zacharycarter> the fact is Nim is style insensitive, so you can name your types however you please |
14:21:33 | sealmove | zacharycarter: Pass a block to a macro and insert that into a string. I managed to do it. |
14:21:45 | FromGitter | <zacharycarter> PascalCase is just a recommendation, you can use snake_case for all NIm cares |
14:21:53 | FromGitter | <zacharycarter> sealmove: I think you meant to ping leorize :P |
14:22:10 | sealmove | yes, sorry |
14:22:15 | FromGitter | <zacharycarter> no worries |
14:22:17 | disruptek | well, the first character of an identifier is significant as far as capitalization goes. Foo != foo. |
14:22:46 | leorize | the best hack to get rid of pascal-style T prefix :P |
14:35:14 | * | nsf quit (Quit: WeeChat 2.5) |
14:46:33 | shashlick | @zacharycarter I've added gz support in v020 branch |
14:47:04 | shashlick | You need tar or 7z or 7za in your path |
14:47:13 | shashlick | Downloading is also improved |
14:47:16 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
14:47:29 | FromGitter | <zacharycarter> I just plugged the other project's source into a libs folder in mine |
14:48:03 | * | laaron joined #nim |
14:49:07 | * | NimBot joined #nim |
14:50:26 | shashlick | What are you wrapping |
14:51:54 | owl_000 | https://github.com/yglukhov/nimpy is great, but the creator maybe in vacation not repling in issue. i want to pass python PIL image data to nimpy and do some operation in nim and return to python again. or is there any good nim image library? |
14:52:39 | FromGitter | <zacharycarter> well - the wrapper seems to be working now with Nimterop |
14:52:43 | disruptek | owl_000: this might work for you: https://github.com/SolitudeSF/imageman |
14:52:48 | FromGitter | <zacharycarter> but - https://icculus.org/physfs/ |
14:53:46 | Araq | owl_000: fwiw I talked with its creator 3 days ago |
14:54:30 | owl_000 | thanks, but i have some tif file, so i need to convert it before to use in imageman. |
14:56:31 | owl_000 | nimpy is a great tool to combine nim and python (like a dream). i loved it. |
15:02:41 | shashlick | Do you need to compile it? Or just wrap |
15:06:20 | FromGitter | <zacharycarter> I'm compiling it |
15:06:36 | shashlick | Ok there's support for cmake also now |
15:06:46 | shashlick | So should be even easier |
15:06:55 | shashlick | Share your wrapper when you can |
15:07:19 | FromGitter | <zacharycarter> I will |
15:07:22 | FromGitter | <alehander42> @moigagoo btw i did something |
15:07:30 | FromGitter | <alehander42> like that with your norm |
15:07:32 | FromGitter | <alehander42> in my framework |
15:10:26 | FromGitter | <alehander42> https://github.com/alehander42/http/blob/master/src/http.nim |
15:10:38 | FromGitter | <alehander42> a workaround to define models in differetn files |
15:10:59 | FromGitter | <alehander42> i just use this to say thanks for the orm lib |
15:11:19 | FromGitter | <alehander42> i remember you added something like that, i guess now i can directly define those models in new files with the new version? |
15:11:44 | FromGitter | <alehander42> scroll to macro norm |
15:12:18 | FromGitter | <zacharycarter> does anyone have a recommendation for config files / parsing them as far as libraries go |
15:12:30 | FromGitter | <zacharycarter> I see a few options on nimble.directory - but looking for someone that actually has experiencing using one and liking it |
15:13:01 | Araq | stdlib's parsecfg is ok. |
15:13:30 | Araq | there are probably also some crazy metaprogramming packages out there that do the same |
15:13:58 | FromGitter | <zacharycarter> yeah - maybe I'll just use parsecfg |
15:14:03 | Araq | but these are all misguided :P |
15:14:38 | * | NotCreative joined #nim |
15:15:01 | Araq | because the declarative nature of it is (key, action) pairs where key is a string and Nim's case statement works on strings, so there, no need for meta programming this time. |
15:19:21 | shashlick | @Araq I have this config.nims - https://github.com/genotrance/nimarchive/blob/nimterop/config.nims |
15:19:38 | shashlick | If I put it in the nimarchive sub directory, it doesn't work |
15:20:11 | shashlick | The values are not present |
15:20:24 | shashlick | Any idea if I'm doing something wrong? |
15:20:41 | Araq | do we claim we pick up configs in subdirs? |
15:20:59 | Araq | I hate this config system mess :-/ |
15:21:02 | shashlick | But I'm importing archive.nim in that subdir |
15:21:21 | Araq | the config system doesn't care about your imports |
15:21:27 | shashlick | I've tried nim.cfg as well |
15:21:43 | shashlick | Oh so it has to be next to the main module? |
15:22:04 | shashlick | Or in the execution directory? |
15:22:57 | Araq | next to the main module |
15:26:51 | disruptek | at least the solution is simple. |
15:26:57 | disruptek | simply don't use it. |
15:27:40 | Araq | disruptek: the config system? |
15:28:38 | shashlick | I need a bunch of defines |
15:28:47 | shashlick | Cannot do it in the Nim file since imports don't see it |
15:28:57 | shashlick | Same old request for a define pragma |
15:32:42 | shashlick | Hopefully we import configs for nimble packages |
15:33:07 | * | NotCreative quit (Ping timeout: 260 seconds) |
15:36:37 | lqdev[m] | shashlick: while you're here, https://github.com/nimterop/nimterop/issues/141 |
15:37:23 | lqdev[m] | in my attempts of troubleshooting why nimterop + soundio doesn't work on windows, I stumbled upon this issue |
15:37:49 | lqdev[m] | how hard would it be to add this in? |
15:39:05 | * | snooptek quit (Remote host closed the connection) |
15:42:53 | shashlick | Shouldn't be too hard but just need to see how other compilers behave |
15:43:12 | Araq | shashlick: usually you can use consts and 'when myConst' instead of 'when defined(mysymbol)' |
15:43:16 | shashlick | But for starters, need to change gcc to $CC everywhere |
15:43:16 | * | disruptek quit (Ping timeout: 258 seconds) |
15:43:40 | * | disruptek joined #nim |
15:44:39 | shashlick | The main question is how the preprocessor behaves and if it is possible to access that data like gcc -E offers |
15:45:18 | shashlick | But if I define a const in a file, you cannot check for it in a module that was imported in the file |
15:48:14 | shashlick | Last line for @Araq, others for @lqdev |
15:48:37 | Araq | just ... don't use 'gcc -E' :P |
15:51:22 | * | krux02 joined #nim |
15:58:06 | FromGitter | <zacharycarter> how do I get around having to use `-d:nimOldCaseObjects` ? |
15:58:28 | FromGitter | <zacharycarter> like what exactly is causing this in - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d7d0e24ba12e064486dbd9c] |
16:03:03 | FromGitter | <zacharycarter> or is it in the declaration of the discriminated type? |
16:03:05 | * | nc-x joined #nim |
16:03:13 | FromGitter | <zacharycarter> I'm looking at - https://nim-lang.org/docs/manual.html#types-object-variants |
16:03:29 | FromGitter | <zacharycarter> and I don't see the difference b/w what I'm doing and the example there |
16:03:51 | nc-x | @zacharycarter use entry(kind: cekInt, i = parseInt(e.value)) etc instead of what you are doing |
16:03:52 | nc-x | IIRC |
16:04:04 | FromGitter | <zacharycarter> thanks |
16:04:44 | nc-x | sorry i mean entry = objectname(...), i.e. the object constructor syntax |
16:04:54 | FromGitter | <zacharycarter> gotcha |
16:06:43 | FromGitter | <zacharycarter> that got rid of the error, thanks nc-x! |
16:07:54 | nc-x | 😉👍 |
16:07:58 | * | nc-x quit (Remote host closed the connection) |
16:12:29 | Zevv | Q: what would be the reason for "cannot generate code for: mDeepCopy" when trying to do a deepcopy at compile time? |
16:13:15 | Zevv | I want to copy the full contents of a ref variant object |
16:15:16 | dom96 | magic not supported in the VM |
16:15:35 | FromGitter | <deech> Dumb noob question, is there a way of assigning a `ref object` to an `object` in one line, right now I'm doing: ⏎ ⏎ ```let r : ref A ⏎ r[] = A(...)``` [https://gitter.im/nim-lang/Nim?at=5d7d1227577fc14c7fc42a6d] |
16:16:00 | * | nc-x joined #nim |
16:17:10 | Zevv | so the solution is to make a proc that knows for each variant how to copy it? |
16:17:40 | dom96 | deech: in general doing that kind of thing isn't recommended, what are you trying to do? |
16:18:07 | FromGitter | <deech> @dom96 I want to create an empty `ref` and fill it in. |
16:18:12 | * | owl_000 quit (Ping timeout: 246 seconds) |
16:18:25 | FromGitter | <deech> Why is it not recommended? |
16:19:32 | dom96 | Either make your type a `ref` or use `var T` |
16:20:03 | * | nc-x quit (Remote host closed the connection) |
16:21:16 | FromGitter | <deech> I understand I can do this but is there a reason why my approach is not recommended? |
16:26:30 | dom96 | Mainly because it's a non-standard way of doing this. You will likely run into annoyances because the language hasn't really been designed with this approach in mind. |
16:30:45 | * | exelotl joined #nim |
16:32:18 | exelotl | is the discord bridge still down? |
16:32:34 | * | krux02 quit (Remote host closed the connection) |
16:34:05 | * | solitudesf joined #nim |
16:37:01 | exelotl | I have a problem: I want to emit a const struct of an object type that I've defined in Nim. I annotated it with {.exportc.} but the module doesn't actually use the struct, it just defines it. So there's no way to guarantee that the type will make it into the generated C code. |
16:38:28 | * | nc-x[m] joined #nim |
16:38:40 | exelotl | previously I worked around this by doing `discard sizeof(MyType)` to trick the compiler into defining the whole type in the generated C. But this doesn't seem to work now :( |
16:41:05 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
16:43:25 | exelotl | is there some way to say 'Yo, I *need* this type to be available in the generated C for this module, even if it looks like I'm not using it' |
16:43:29 | * | laaron joined #nim |
16:51:31 | ehmry | exelotl: {.exportc.}? |
16:51:49 | ehmry | sorry, I should read more scrollback |
16:55:57 | Araq | exelotl: var someFakeVar {.exportc.}: TypeYouCareAbout |
16:57:32 | sealmove | question: Nim is not in this list, https://docs.travis-ci.com/user/languages/, so how do you use Travis with Nim code? |
17:01:46 | FromGitter | <zacharycarter> looking for some help w/ https://gist.github.com/zacharycarter/9853400e0b55fae708b1a21b0625a342 |
17:01:58 | * | tiorock joined #nim |
17:01:58 | * | tiorock quit (Changing host) |
17:01:58 | * | tiorock joined #nim |
17:01:58 | * | rockcavera is now known as Guest35824 |
17:01:58 | * | Guest35824 quit (Killed (karatkievich.freenode.net (Nickname regained by services))) |
17:01:58 | * | tiorock is now known as rockcavera |
17:02:19 | FromGitter | <zacharycarter> I guess e.value is always a string? |
17:02:54 | FromGitter | <zacharycarter> is there a way to tell if a string is actually an integer? |
17:03:37 | sealmove | you mean parse it?> |
17:04:27 | FromGitter | <zacharycarter> no - I know parseInt exists |
17:04:49 | FromGitter | <zacharycarter> oh I guess parseInt raises a value error |
17:05:09 | FromGitter | <zacharycarter> alright, nevermind then :) |
17:05:34 | sealmove | ^_- |
17:06:32 | sealmove | so for travis + nim you need custom docker image? |
17:08:36 | FromGitter | <zacharycarter> that still doesn't solve my problem though |
17:08:48 | FromGitter | <zacharycarter> I'm still getting an error about `i` being inaccessible |
17:11:19 | FromGitter | <zacharycarter> oh I think it's because the format of my cfg file is screwed up |
17:12:02 | FromGitter | <zacharycarter> yup - sorry for wasting time :P |
17:12:29 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
17:15:03 | Zevv | Is this a bug? https://play.nim-lang.org/#ix=1V9I I have a pretty trivial proc that is ok at runtime but seems to mess up at compile time |
17:16:36 | exelotl | Araq: thanks, well that's gonna result in a *lot* of dummy vars but it does fix it |
17:17:24 | Araq | exelotl: alternatively write the header file manually, Nim is not a header file generator |
17:17:59 | sealmove | Zevv: interesting |
17:18:31 | exelotl | hm yeah that's fair |
17:19:05 | Zevv | funny, right? |
17:19:21 | sealmove | maybe it has to do with doAssert, the order in which is executed |
17:19:24 | * | narimiran joined #nim |
17:19:31 | Zevv | no, it's really like that, pretty sure |
17:19:33 | sealmove | sorry, I mean echo |
17:19:51 | Zevv | i've been hunting for this for some time in a different program, and minimized to this |
17:20:15 | Zevv | it seems that the refs get messed up at compile time so that b1 and b2 alias |
17:23:10 | sealmove | well, some things can't be evaluated in compile time |
17:23:29 | sealmove | for example if you try to wrap the whole test() body in a `static` block it won't compile |
17:23:42 | sealmove | so it's normal to mess-up the aliases in compile-time |
17:23:48 | sealmove | since it can't calculate them |
17:24:36 | sealmove | of course ideally it shouldn't print 4 4 4, but rather exit with error |
17:24:36 | Zevv | hm compiles for me in a static block, can you show me on the playground? |
17:25:31 | sealmove | https://play.nim-lang.org/#ix=1V9O |
17:26:37 | * | nsf joined #nim |
17:27:10 | Zevv | right. I keep getting bitten. Every now and then I use refs for simple stuff and that just works |
17:27:15 | Zevv | so I forget that I shouldnt |
17:28:03 | Zevv | but some stuff clearly *does* work at compile time |
17:30:46 | sealmove | "some stuff" is a little too general :P |
17:31:12 | sealmove | from this snipet in playground I suppose you can't even create a ref in compile-time... |
17:31:54 | exelotl | hm yeah that's fair |
17:32:02 | exelotl | oops wrong window lmao |
17:32:08 | Zevv | well, npeg is full of it, I totally got used to using refs :/ |
17:49:58 | * | nsf quit (Quit: WeeChat 2.5) |
17:56:01 | leorize | sealmove: check Nim's wiki on github |
17:56:05 | leorize | there's a config for travis |
17:56:18 | sealmove | oh great, thanks |
17:57:37 | * | nsf joined #nim |
18:08:33 | Zevv | is it safe to say that refs are usable at compile time, as long as nothing is aliasing? |
18:09:23 | * | ng0 joined #nim |
18:17:17 | Araq | they do work for aliasing IME |
18:17:34 | Araq | but it's very hard for the VM to get the semantics right :-/ |
18:17:46 | Araq | however, a ref must not end up in a const section |
18:18:20 | Zevv | that makes sense, but how wrong is https://play.nim-lang.org/#ix=1V9I then? |
18:19:32 | Araq | very wrong? |
18:19:40 | Zevv | :) |
18:19:52 | Araq | you use both ref and the deref [] operator to create a copy |
18:20:09 | Araq | and that's where the VM gives up, nobody used that one before :P |
18:20:18 | Zevv | fair enough :) |
18:20:39 | Araq | so 'ref' works fine but don't deref it and expect to get a copy :P |
18:20:43 | Zevv | all I wanted was a deepcopy for variants without having to code them out for each case |
18:20:49 | Araq | dunno how hard is it to fix |
18:20:57 | Araq | could be simple... |
18:28:48 | Araq | https://getkerf.wordpress.com/2016/03/30/the-best-algorithm-no-one-knows-about/ can somebody explain this algorithm to me? |
18:28:52 | Araq | I don't even understand the problem |
18:31:54 | * | natrys joined #nim |
18:36:42 | Araq | ah never mind |
18:44:37 | FromGitter | <moigagoo> @alehander42 thanks for using Norm! Yes, I've added the ability to split models across different modules. You still glue them together in one place though with dbFromTypes macro. |
18:50:10 | FromGitter | <moigagoo> @alehander42 your project looks very interesting. Is it an attempt to create a full stack framework like RoR? Would be a killer, wish you all the luck! Also, I'll look into your code probably, because I see you're generating Nim code, and I’m currently thinking about implementing migrations and automatic migration generation for Norm, so I'll have to learn to do that. |
18:50:37 | FromGitter | <moigagoo> In fact, this issue with arg types in macros is what blocks me. |
18:55:27 | Araq | huh? issue number? |
19:02:46 | FromGitter | <moigagoo> @Araq I believe this one https://github.com/nim-lang/Nim/issues/7375 ⏎ ⏎ I'm not sure though. My problem is that arg types inside macro bodyare different from the ones declared in its signature. seq[SqlQuery] is replaced with array[0..3, string], Table is replaced with its repr. Pls see an example in this thread: https://forum.nim-lang.org/t/5188 |
19:03:34 | Araq | that bug only affects bool and enums |
19:04:09 | FromGitter | <moigagoo> I think I'm just misunderstanding something in how Nim macros work. That's why I'm requesting this pair programming session with someone with greater expertise. Like you 😄 |
19:04:48 | FromGitter | <moigagoo> > that bug only affects bool and enums ⏎ ⏎ Well then it's a different issue ¯\_(ツ)_/¯ |
19:21:49 | Zevv | araq: should I file a bug for that compile-time-poor-mans-copy-by-ref thing? |
19:25:21 | * | absolutejam1 joined #nim |
19:46:43 | sealmove | leorize: I didn't find the config for travis, can you please link? |
19:47:46 | leorize | https://github.com/nim-lang/Nim/wiki/BuildServices |
19:48:05 | leorize | it's on the sidebar :P |
19:49:35 | * | narimiran quit (Ping timeout: 265 seconds) |
19:51:57 | FromGitter | <moigagoo> @alehander42 FYI Article.getOne("id=?", id) can be replaced with Article.getOne(id) if id is int (and it looks like it is, in your code example from Readme). |
19:53:57 | FromGitter | <alehander42> thanks |
19:54:04 | FromGitter | <alehander42> yeah i wanted to do something like RoR |
19:54:08 | FromGitter | <alehander42> but dont have much time |
19:54:40 | FromGitter | <alehander42> that would be good |
19:54:45 | FromGitter | <alehander42> i wrote a library for migrations |
19:54:53 | FromGitter | <alehander42> and i think i used it with this `http` |
19:54:59 | FromGitter | <alehander42> but not sure if it got open sourced |
19:55:03 | FromGitter | <alehander42> it's still a bit rough |
19:55:10 | FromGitter | <alehander42> and i am not very happy with how i wrote it |
19:55:31 | FromGitter | <alehander42> because you still have to auto-build stuff currently while migrations run, as they are nim code |
19:56:07 | FromGitter | <alehander42> but if you're into that, i might open it if you want to compare implementations |
19:56:34 | FromGitter | <alehander42> i would love to see your migration project |
19:58:40 | FromGitter | <alehander42> yeah, that would be a good fix |
20:03:40 | FromGitter | <moigagoo> I don't have any implementation yet :-) I'm still not sure how to do it best. Also, I got sidetracked with this types-in-macro-body issue. ⏎ ⏎ Anyway, I'll put anything new I have in this area on Nimble and announce it in the Norm thread on the forum. |
20:07:19 | FromGitter | <alehander42> i know, but i mean future impl: one thing that i wondered was that maybe if |
20:07:31 | FromGitter | <alehander42> my migration dsl-s and model dsl-s are shared |
20:07:39 | FromGitter | <alehander42> i can make things very DIy |
20:08:01 | FromGitter | <alehander42> but this might be too much and for a framework i preferred things to be pluggable (so one can use migrations with different orm) |
20:08:46 | sealmove | leorize: God bless you, helping blind people |
20:10:25 | * | natrys quit (Quit: natrys) |
20:17:09 | * | abm joined #nim |
20:24:56 | * | abm quit (Quit: Leaving) |
20:40:40 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
20:41:31 | * | laaron joined #nim |
21:09:01 | * | couven92 joined #nim |
21:14:29 | * | absolutejam1 quit (Ping timeout: 276 seconds) |
21:19:26 | * | nif_ quit (Quit: ...) |
21:19:42 | * | nif joined #nim |
21:27:57 | * | absolutejam1 joined #nim |
21:32:57 | * | solitudesf quit (Ping timeout: 245 seconds) |
21:35:50 | * | Trustable quit (Remote host closed the connection) |
21:36:02 | * | Vladar quit (Remote host closed the connection) |
21:44:51 | * | absolutejam1 quit (Ping timeout: 240 seconds) |
22:31:12 | * | nsf quit (Quit: WeeChat 2.5) |
22:35:43 | * | exelotl quit (Ping timeout: 245 seconds) |
22:39:11 | * | rockcavera quit (Remote host closed the connection) |
22:41:14 | * | actuallybatman quit (Ping timeout: 240 seconds) |
22:45:22 | * | couven92 quit (Quit: Client Disconnecting) |
23:02:06 | * | sagax quit (Ping timeout: 246 seconds) |
23:06:44 | FromGitter | <awr1> @deech i had run into that problem with `ref T` when i first started to use nim - "i wish there were more concise ctors for refs" - and eventually came to the conclusion its an overrated desire |
23:07:20 | FromGitter | <awr1> i came to like how that default ctors in Nim are relatively constricted |
23:07:38 | FromGitter | <awr1> you can do something like this but I can't say that i approve https://play.nim-lang.org/#ix=1VbI |
23:07:48 | * | exelotl joined #nim |
23:27:09 | * | sagax joined #nim |
23:35:53 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
23:36:14 | * | pbb joined #nim |
23:43:23 | * | actuallybatman joined #nim |