00:03:01 | * | krux02 quit (Remote host closed the connection) |
00:24:28 | libman | Wow, lots of comments on my r/Python pitch - https://redd.it/6gwv4a |
00:29:21 | libman | A big complaint seems to be the default import of all modules into the root namespace. (Ref https://nim-lang.org/docs/manual.html#modules-import-statement ) |
00:34:26 | libman | I think Nim's import behavior is better than Python's, and there's `from module import nil` and the {.pure.} pragma for enums, but perhaps there could be a cleaner syntax for requiring qualifying module members... |
00:43:41 | * | yglukhov joined #nim |
00:48:08 | * | yglukhov quit (Ping timeout: 246 seconds) |
00:49:22 | libman | I would use import_v and enum_v keywords (v for verbose). But that's just IMHO. |
00:52:08 | * | skrylar quit (Ping timeout: 240 seconds) |
00:56:08 | ftsf | tbh result can be problematic, if you forget to set it. would be nice to have an error if result is never set. |
01:06:38 | * | Nobabs27 quit (Quit: Leaving) |
01:36:38 | * | yingjun joined #nim |
01:44:16 | * | yingjun quit (Ping timeout: 260 seconds) |
01:44:59 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:54:11 | captainkraft | re pure pragma: I think pure should be the default and impure should need the pragma. |
01:54:42 | * | yingjun joined #nim |
01:58:39 | * | chemist69 joined #nim |
02:17:29 | * | def-pri-pub joined #nim |
02:19:11 | ftsf | woo, got nico games running on android \o/ |
02:19:28 | ftsf | need to work out controls though |
02:24:35 | ftsf | and resuming |
02:25:11 | libman | Switching the pure/inpure behavior would break all the existing code. But it could be a compiler option. |
02:26:07 | * | Jesin joined #nim |
02:26:47 | libman | I don't know if {.pure.} is the best word, but I think it should work with imports as well. Then we have an easy answer to critics. |
02:27:44 | FromGitter | <zacharycarter> ftsf: I'm working on a modular 3d renderer ala Horde3d w/ bgfx |
02:28:05 | FromGitter | <zacharycarter> congrats on android I know firsthand what a pita it is |
02:28:48 | ftsf | zacharycarter nice =) |
02:29:01 | ftsf | i started a 3d engine for my next project, it's coming together ok |
02:29:10 | FromGitter | <zacharycarter> I'm not building an engine |
02:29:16 | FromGitter | <zacharycarter> kind of done with that I think |
02:29:58 | FromGitter | <zacharycarter> ftsf: maybe you'll be able to incorporate the renderer I build into a future project - I hope to make it plug and play like horde3d |
02:29:59 | libman | This is interesting news on the embedded database library front - https://redd.it/6hbrrp - SQLite all the things! :D |
02:30:10 | FromGitter | <zacharycarter> you just specify the pipeline and resources |
02:30:22 | ftsf | zacharycarter seems the bgfx dependency is a big hassle though |
02:30:27 | FromGitter | <zacharycarter> I'm interested to see your 3d work though I know you made a lot of progress |
02:30:42 | FromGitter | <zacharycarter> ftsf: I think having the abstraction for vulkan / metal / directx 12 is worth it |
02:30:45 | ftsf | http://static.impbox.net/tmp/screenshot-1497254455.695464.png using deferred rendering and hdr and ssao so far, no shadows yet |
02:31:05 | FromGitter | <zacharycarter> wait - ssao is shadows I thought |
02:31:11 | ftsf | but got skeletal animation working now |
02:31:14 | FromGitter | <zacharycarter> oh |
02:31:20 | ftsf | ssao is the little dark bits on the edges |
02:31:23 | FromGitter | <zacharycarter> oh screen space ambient occlusion my bad |
02:31:23 | FromGitter | <zacharycarter> right |
02:31:30 | ftsf | but not based on the light direction |
02:31:35 | FromGitter | <zacharycarter> right |
02:31:55 | FromGitter | <zacharycarter> I don't think bgfx is a big dependency if the engine is built right |
02:32:19 | FromGitter | <zacharycarter> lots of engines depend on other libraries and it's not a thing |
02:32:50 | FromGitter | <zacharycarter> bgfx will be abstracted away anyway by the rendering engine |
02:32:51 | ftsf | yeah, i'm depending on sdl2, but that seems very light weight compared to bgfx |
02:33:13 | FromGitter | <zacharycarter> yeah I've thought about that but what about when you want to switch to Vulkan or Metal or whatever? |
02:33:19 | ftsf | i can't remember the specifics but i had a bit of hassle getting it up and running for building frag |
02:33:27 | ftsf | yeah i have no plans for those |
02:33:29 | ftsf | happy with opengl |
02:33:33 | FromGitter | <zacharycarter> I'd like to automate it with an installer |
02:34:08 | FromGitter | <zacharycarter> or just offer nightly builds of my rendering engine |
02:34:29 | FromGitter | <zacharycarter> with the library included for whatever platform |
02:34:34 | libman | Since everyone else is talking about games: anyone ever consider using SQLite to store game assets? |
02:34:54 | FromGitter | <zacharycarter> sounds horribly inefficient |
02:34:59 | ftsf | libman, seems an odd choice for assets |
02:35:26 | FromGitter | <zacharycarter> I know where your head is at - blobs |
02:35:44 | FromGitter | <zacharycarter> but you're moving file IO to database IO essentially |
02:36:01 | ftsf | would be more likely to use redis |
02:36:13 | FromGitter | <zacharycarter> you'd be better off compressing your files into a binary format |
02:36:15 | libman | Well, it's multi-platform, faster in many cases (see link above), you can store additional attributes with the blobs, and makes things easier to tinker with since everyone already knows SQLite. |
02:36:28 | * | pilne quit (Quit: Quitting!) |
02:36:57 | libman | And you can distribute updates via sqldiff. |
02:37:35 | FromGitter | <zacharycarter> imo you're aiming for the smallest asset size possible |
02:37:41 | FromGitter | <zacharycarter> especially when dealing with mobile |
02:38:01 | FromGitter | <zacharycarter> I've always thought compression is the way to go - you won't always have access to a sqlite database or the resources to run one |
02:38:30 | FromGitter | <zacharycarter> I suppose it can work though and probably has advantages in certain circumstances as you've described |
02:38:46 | libman | SQLite shouldn't be any different than ZIP size-wise. Of course you can get better compression by concatenating all the BLOBs together (like TAR), but that seems rare for games and would use a lot more RAM. |
02:39:13 | ftsf | a lot of games just use a zero compression zip file |
02:40:28 | ftsf | but it's not much of an issue for me since reading assets isn't much of a bottleneck. YAGNI |
02:40:30 | libman | SQLite is essentially a zip file with extra columns you can query by, index, set up relational rules, etc. |
02:45:38 | * | yglukhov joined #nim |
02:49:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:56:23 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:21:55 | * | gangstacat quit (Quit: Δis!) |
03:30:17 | * | gangstacat joined #nim |
03:43:43 | * | bahtiyar joined #nim |
04:00:59 | * | yingjun quit (Remote host closed the connection) |
04:01:09 | * | yingjun joined #nim |
04:02:41 | * | yingjun quit (Remote host closed the connection) |
04:03:22 | * | bahtiyar quit (Remote host closed the connection) |
04:28:09 | * | bahtiyar joined #nim |
04:29:38 | * | def-pri-pub quit (Quit: leaving) |
04:47:39 | * | yglukhov joined #nim |
04:51:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
05:02:22 | * | bahtiyar quit (Ping timeout: 260 seconds) |
05:03:08 | * | yingjun joined #nim |
05:06:58 | * | bahtiyar joined #nim |
05:07:36 | * | yingjun quit (Ping timeout: 255 seconds) |
05:14:39 | * | yingjun joined #nim |
05:20:50 | * | yingjun quit (Read error: Connection reset by peer) |
05:36:50 | * | bahtiyar quit (Ping timeout: 240 seconds) |
05:47:12 | * | vlad1777d joined #nim |
06:03:36 | * | Vladar joined #nim |
06:04:18 | * | rauss quit (Quit: WeeChat 1.8) |
06:27:29 | * | vendethiel quit (Quit: q+) |
06:38:42 | * | nsf joined #nim |
06:49:42 | * | yglukhov joined #nim |
06:54:06 | * | yglukhov quit (Ping timeout: 258 seconds) |
06:57:24 | * | vlad1777d quit (Ping timeout: 255 seconds) |
06:57:55 | * | xet7 joined #nim |
06:58:02 | * | vlad1777d joined #nim |
07:09:39 | * | beatmox quit (Remote host closed the connection) |
07:19:02 | * | libman quit (Quit: Connection closed for inactivity) |
07:20:40 | * | vlad1777d_ joined #nim |
07:21:50 | * | vlad1777d quit (Ping timeout: 240 seconds) |
07:31:29 | * | bahtiyar joined #nim |
07:57:35 | * | gokr joined #nim |
07:58:15 | * | Andris_zbx joined #nim |
08:05:39 | * | Arrrr joined #nim |
08:11:54 | * | Trustable joined #nim |
08:14:44 | * | bahtiyar quit (Ping timeout: 268 seconds) |
08:28:16 | * | bahtiyar joined #nim |
08:41:17 | FromGitter | <dandevelop> Here is an interesting article on SQLite: https://www.sqlite.org/fasterthanfs.html |
08:48:54 | * | yglukhov joined #nim |
08:53:22 | * | yglukhov quit (Ping timeout: 260 seconds) |
08:57:05 | * | Neomex joined #nim |
09:02:29 | FromGitter | <ephja> c2nim turns this "#ifndef FREETYPE_H_ #define FREETYPE_H_ ..." into a "when not defined(FT_FREETYPE_H):" block without any statements. this has not always been the case, right? |
09:09:28 | * | vlad1777d_ quit (Ping timeout: 240 seconds) |
09:09:51 | FromGitter | <ephja> those aren't even the same symbols -.- well, just a small amount of preprocessing left then |
09:10:09 | * | yglukhov joined #nim |
09:17:51 | Araq | sounds like a regression, I wonder what would cause this |
09:18:05 | Araq | FT_FREETYPE_H ? wtf |
09:19:01 | FromGitter | <andreaferretti> @ephja you can use `#def FREETYPE_H` in c2nim and it will skip the `#ifndef` block |
09:19:24 | FromGitter | <andreaferretti> or if you don't want to define it, use `#assumedef FREETYPE_H` |
09:19:40 | FromGitter | <andreaferretti> but yes, sometimes generated blocks are empty |
09:19:53 | FromGitter | <andreaferretti> there should be a postprocessing pass to remove empty blocks |
09:20:35 | FromGitter | <ephja> I was not being clear enough. I did solve it with "#def FT_FREETYPE_H". both FREETYPE_H_ and FT_FREETYPE_H appears, in that order, and I failed to distinguish them |
09:36:08 | * | skrylar joined #nim |
09:41:26 | * | Neomex_ joined #nim |
09:44:07 | * | bahtiyar quit (Ping timeout: 260 seconds) |
09:45:07 | * | Neomex quit (Ping timeout: 240 seconds) |
09:55:12 | * | Snircle joined #nim |
10:00:45 | * | yglukhov quit (Remote host closed the connection) |
10:01:12 | * | yglukhov joined #nim |
10:05:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
10:07:56 | * | Parashurama joined #nim |
10:08:03 | * | Parashurama quit (Client Quit) |
10:08:14 | * | Parashurama joined #nim |
10:13:31 | Parashurama | @Araq: There is an incoherence in the manual for enums: |
10:13:31 | Parashurama | the manual mentions that enums with holes are not Ordinal (no inc, dec, etc..) |
10:13:31 | Parashurama | yet in devel, those clearly available, even for enum with holes. |
10:14:08 | Araq | Parashurama: known issue but I dunno how to resolve it :-) |
10:14:36 | Araq | holes are just an artifact of C interop and usually C interop means type unsafe bullshit |
10:15:01 | Araq | but how is the programmer served by not having 'inc' for these? |
10:19:59 | * | yglukhov joined #nim |
10:32:35 | Parashurama | Araq: I'm tackling the performance issues with reprEnum, parseEnum and maybe MyEnum.items, so I wanted to be sure. |
10:35:02 | Araq | ok :-) |
10:46:54 | Parashurama | Araq: btw, what's the best way to make an iterator compiler magic? |
10:48:26 | Araq | we have a wiki article for that iirc |
10:48:49 | * | krux02 joined #nim |
10:48:56 | Araq | but magic iterators are hard we have no infrastructure in place for this |
10:55:53 | * | Trioxin joined #nim |
10:56:10 | Trioxin | despite my best efforts, I still can't whip up a proper damn HTTP post |
10:59:55 | Araq | ping krux02 |
11:03:30 | FromGitter | <zacharycarter> Nim port of horde3d going well so far :D |
11:03:54 | FromGitter | <zacharycarter> using bgfx as the renderer |
11:06:15 | skrylar | iterators also hate fun |
11:06:39 | skrylar | i posted a bug report where iterators returning closures which are called confuse nim in to emitting empty C references :B |
11:08:27 | euantor | Trioxin what's wrong? What's the code you've tried and what's wrong with it? |
11:24:32 | Arrrr | I remember a 'Sep' const but i can't find it. Would hold os dependant path separator character |
11:24:56 | Arrrr | Maybe i was dreaming |
11:26:58 | Arrrr | Ah, ok, `DirSep`, but now is included in ospaths |
11:33:34 | * | arnetheduck joined #nim |
11:51:07 | krux02 | pong: Araq |
11:53:26 | krux02 | Araq: I have a paper deadline today, so maybe I will be able to fix the last remaining problem with the sizeof/alignof implementation tomorrow. |
11:54:31 | krux02 | Well also the glm package is broken in the new Nim version |
12:02:30 | ftsf | krux02, i think there's a PR that fixes it |
12:02:32 | Araq | ok, we can talk later, no problem. wanted to discuss NEP-2 with you |
12:03:32 | krux02 | Araq: can we please have a release canditate before the next version of Nim is released, so that we don't have such a mess like the last release? |
12:04:22 | krux02 | I don't have a problem with breaking changes as long as they improve the overall quality of the code but with the last one I did not have that impression. |
12:05:27 | Araq | I agree with that but "release" candidate implies a release cycle we don't have |
12:06:00 | Araq | I would love to have tick-tocks but it doesn't always work out this way. |
12:07:22 | dom96 | Anyone want to help with this? https://www.reddit.com/r/nim/comments/6h8lhf/rroguelikedev_is_running_a_summer_devalong/ maybe zacharycarter? :) |
12:07:33 | krux02 | well with release candidate I mean instead of "new version of Nim realeased", "a release canditae of Nim has released". Then I can try my projects if something horrible has happend and if nobody (in this case I) don't complain within two weeks or something the RC becomes automatically the release |
12:08:39 | krux02 | dom96: Who is playing all those roguelikes that are being developed everywhere? I feel like rogue likes are games for the developer only |
12:08:56 | dom96 | dunno, I only really play nethack |
12:09:03 | krux02 | sure the idea of rogue likes is to be fun for the developer, too |
12:09:21 | krux02 | well brogue is pretty good, too. |
12:09:42 | krux02 | (very simple and accessable, but still challenging and interesting) |
12:09:47 | FromGitter | <andreaferretti> @krux02 for what it's worth, 0.17 was the smoothest version upgrade I got - I had to change a single line in twelve libraries |
12:10:35 | krux02 | I failed to play nethack, I struggled with Dwarf Fortress (feels like a huge time sink), brogue was the only one that really felt I understood what I was doing |
12:11:33 | krux02 | andreaferretti: https://github.com/nim-lang/Nim/issues/5845 |
12:11:41 | krux02 | and that are the problems in one project only |
12:12:25 | krux02 | that pattern was used by me almost every time I used `quote` |
12:12:44 | krux02 | and I program Nim, because it has macros, therefore I use it excessively |
12:13:14 | krux02 | and `quote` is for me the most important function in the macros library. |
12:14:06 | dom96 | Does that mean that the example here doesn't work? https://nim-lang.org/docs/macros.html#quote,typed,string |
12:14:09 | krux02 | problems also occured in one tensor library that I have written, and the glm library |
12:14:16 | ftsf | dom96, sounds cool |
12:15:26 | krux02 | dom96: well that example still works, because it is just an assignment |
12:15:44 | krux02 | but ``result.add quote do: ...`` doesn't work anymore |
12:16:26 | krux02 | And that is something I did often when I called quote for example from a loop |
12:16:34 | dom96 | what does `res = head quote do:` even mean? What is 'head' in this case? |
12:16:53 | krux02 | head is something I I defined on my own |
12:17:13 | krux02 | proc head(arg: NimNode): NimNode = arg[0 |
12:17:15 | krux02 | ] |
12:17:44 | dom96 | hrm, it looks like I am using it like this only here: https://github.com/nim-lang/Nim/blob/devel/lib/pure/json.nim#L1720 |
12:17:58 | krux02 | I did define it, because it was a very easy way to remove the enclosing StmtList from a quote result |
12:18:02 | arnetheduck | Araq, ping? any problems with https://github.com/nim-lang/Nim/pull/5818? |
12:18:03 | dom96 | and I instinctively put parens around it |
12:18:10 | * | adeohluwa joined #nim |
12:18:13 | krux02 | and it was so nicely composable before the quote statement |
12:18:39 | * | Trioxin2 joined #nim |
12:18:43 | * | Trioxin quit (Ping timeout: 260 seconds) |
12:19:24 | dom96 | To be honest I think the new behaviour is fine. |
12:19:30 | krux02 | dom96: that is where I would have used. result.add head quote do: |
12:19:34 | krux02 | no parens at all ;) |
12:19:42 | krux02 | because parens are evil |
12:19:44 | dom96 | There is too many spaces in your code and too little parens. |
12:19:49 | krux02 | they are for C programmers only |
12:20:25 | krux02 | well I have a consistent style that does not match the style of the Nim compiler itself |
12:21:07 | * | PMunch joined #nim |
12:21:16 | krux02 | but within my projects it is consistent and after getting used to it, it doesn't feel ambiguous, it feel clean because of very little visual noise |
12:21:48 | dom96 | Fair enough. It makes me feel uncomfortable though :) |
12:22:05 | krux02 | yea only when you are not used to it |
12:22:15 | krux02 | it made be feel a bit uncomfortable in the beginning, too |
12:22:41 | krux02 | but then I tested the limits of the language and tried to understand the parsing rules to write the cleanest code possible |
12:23:16 | krux02 | and after a while I really liket that I can prepend single argument functions without parens |
12:23:26 | krux02 | foo bar baz arg |
12:23:33 | krux02 | I really like it |
12:23:45 | krux02 | it is like arg.baz.bar.foo |
12:23:50 | krux02 | I also like that one |
12:25:28 | krux02 | I like when I have the option not to put parens around a block of code |
12:27:45 | Araq | it's what makes 'await' nice to look at |
12:30:17 | FromGitter | <andreaferretti> @krux02 I understand yuor pain points, but never having use that style myself, I did not have any problems at all |
12:30:27 | FromGitter | <andreaferretti> In general, I try not to push the parser |
12:30:51 | FromGitter | <andreaferretti> I experiment more with the type checker :-P |
12:31:43 | dom96 | This sort of thing worries me a bit because we might end up with incredibly varying code styles, that in some cases are difficult to decipher. |
12:33:59 | Araq | dom96: I think we're on the edge here, it's just right, but we must not push the syntactic flexibility any further |
12:34:17 | dom96 | Agreed |
12:49:52 | krux02 | well there are tiny things where I wuolld like the syntex to be extended: http://ix.io/xwa |
12:50:02 | krux02 | I think those things should parse identical |
12:51:12 | * | bahtiyar joined #nim |
12:51:27 | krux02 | I think I mentioned that pretty early when I started with nim, because that is something that I did in scala and I did like it |
12:51:54 | krux02 | I don't a good reason not to support it, unless it would be hard to implement |
13:03:04 | dom96 | Yeah, I agree. That would be nice.] |
13:09:41 | * | Vladar quit (Quit: Leaving) |
13:17:49 | * | skrylar quit (Ping timeout: 258 seconds) |
13:18:59 | captainkraft | dom96: who is on the cover of Nim in Action? |
13:20:01 | FromGitter | <andreaferretti> I am doing a little issue triaging here and there checking what bugs are not relevant anymore |
13:20:09 | FromGitter | <andreaferretti> I hope this is not an issue |
13:20:42 | FromGitter | <andreaferretti> Just wanted to cut down the number of open bugs, because some are just no more applicable (if they were in the first palce) |
13:26:29 | FromGitter | <TiberiumN> What would be the fastest way to parse a long string like this: β "1|2.5|51.3|4,2|3.41|5.2|3," β so many entries, each entry is int|float|float|int |
13:26:35 | FromGitter | <TiberiumN> no newlines |
13:26:40 | FromGitter | <TiberiumN> commas instead of newlines |
13:29:14 | FromGitter | <TiberiumN> Firstly I just splitted a long line, and splitted each entry. β Second try - using "scanf" from strscans - gave me 7ms speed boost (there was 9941 entries in this long line) |
13:32:48 | * | kunev quit (Ping timeout: 260 seconds) |
13:33:51 | * | kunev joined #nim |
13:37:45 | euantor | I was going to suggest strscans |
13:37:57 | captainkraft | dom96: I assume the dude on the cover is this guy? https://en.wikipedia.org/wiki/Nimrod |
13:38:06 | dom96 | captainkraft: no |
13:38:07 | krux02 | can I explicitly say that a variable is uninitualized? |
13:38:09 | dom96 | It's just some random dude |
13:39:01 | FromGitter | <TiberiumN> oh, preallocating a sequence gave 2ms speed boost (I'm adding all items to a sequence after parsing) |
13:39:53 | FromGitter | <TiberiumN> ok, good speed for me then :) just parsing game replay |
13:40:08 | krux02 | TiberiumN: Nothing personal, but I think your question is not very Nim specific at all. |
13:40:44 | FromGitter | <TiberiumN> also thanks for some random guy who ported python "struct" module to Nim |
13:40:44 | FromGitter | <TiberiumN> https://github.com/OpenSystemsLab/struct.nim |
13:40:48 | FromGitter | <ephja> krux02: yes, with the noInit pragma https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
13:41:04 | krux02 | ephja: thanks I test it |
13:41:58 | euantor | TiberiumN: how does this do? https://glot.io/snippets/eqtxo27oqp |
13:42:52 | krux02 | well even with the noinit pragma I still get he warning: Cannot prove that 'evt' is initialized. This will become a compile time error in the future. [ProveInit] |
13:43:09 | krux02 | that is a bit stupid considering if you ask me |
13:43:18 | euantor | Or rather https://glot.io/snippets/eqtxplga61 |
13:44:02 | * | Arrrr quit (Ping timeout: 268 seconds) |
13:44:04 | FromGitter | <ephja> https://github.com/transfuturist/freetype/blob/master/freetype.nim I might as well use that |
13:44:59 | * | bahtiyar quit (Remote host closed the connection) |
13:45:32 | * | vlad1777d joined #nim |
13:46:17 | * | PMunch quit (Quit: leaving) |
13:47:26 | * | Vladar joined #nim |
13:48:35 | * | FromGitter quit (Ping timeout: 255 seconds) |
13:55:04 | * | xet7 quit (Quit: Leaving) |
13:55:37 | * | xet7 joined #nim |
13:56:28 | * | xet7 quit (Client Quit) |
14:00:19 | * | rauss joined #nim |
14:14:28 | * | sz0 joined #nim |
14:36:34 | * | Andris_zbx quit (Remote host closed the connection) |
14:37:58 | * | chrisheller joined #nim |
14:43:18 | * | dave24 joined #nim |
14:45:55 | captainkraft | dom96: haha, even better |
14:47:16 | captainkraft | I get that init warning when using the SDL2 bindings and initializing an event to sdl2.defaultEvent |
14:47:26 | captainkraft | Haven't looked into why yet, v0v |
14:52:24 | Araq | yay, just lost 5 minutes because writeStackTrace() writes to stderr |
14:52:34 | Araq | fuck stderr |
14:53:29 | Araq | I never do >&2 or whatever bizarre syntax is required to redirect it. |
14:56:06 | * | couven92 joined #nim |
15:19:27 | * | Trioxin2 quit (Ping timeout: 240 seconds) |
15:28:08 | * | yglukhov quit (Remote host closed the connection) |
15:28:11 | krux02 | how to I get the path of the current executable? |
15:28:17 | krux02 | I have resources relative to the binary |
15:29:48 | * | yglukhov joined #nim |
15:32:27 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
15:33:09 | chrisheller | getAppDir() in os module |
15:33:50 | * | yglukhov quit (Ping timeout: 240 seconds) |
15:38:05 | * | yglukhov joined #nim |
15:42:07 | * | yglukhov quit (Ping timeout: 240 seconds) |
15:42:51 | * | PMunch joined #nim |
15:43:37 | * | ofelas joined #nim |
15:43:39 | chrisheller | Anyone know how to use startProcess and redirect stdout/stderr to a file? |
15:46:20 | chrisheller | I can read the stdout handle from the Process object and write it to the file myself, but I'd rather just give the process a filehandle to write to if I can. |
15:46:57 | Araq | you need to do it on your own, I'm afraid |
15:47:12 | krux02 | chrisheller: thank you that was what I was looking for |
15:47:59 | chrisheller | Would you consider a PR that allows passing a filehandle in for stdout (and stderr)? |
15:48:52 | chrisheller | I'm porting some Python code that takes advantage of that feature in Python's subprocess module. |
15:51:00 | Araq | such a PR is welcome if it comes with a test case :-) |
15:51:36 | PMunch | Speaking of test cases Arak |
15:51:40 | PMunch | Araq* |
15:52:31 | PMunch | For the codeRepr thing. I already asked about this but what would you expect from a test-case? I have looked at the other repr procedures and haven't found anything particularly useful. |
15:53:24 | Araq | well just a test that uses it and has an 'output' section where one can see what codeRepr is supposed to output, nothing fancy |
15:53:49 | Araq | the point is to not break it if somebody refactors it or changes it slightly |
15:55:17 | PMunch | Ah, I see |
15:59:21 | dave24 | how would I call the Shell_NotifyIcon winapi function from nim? |
16:02:15 | Araq | dave24 look at browsers.nim, it calls shellExecute |
16:06:27 | dave24 | hmm, but that does not involve wrapping anything or passing a struct. I can't really work it out from that. |
16:06:48 | dave24 | Shell_NotifyIcon is not in winlean, and it needs to be passed a struct which contains a union |
16:07:17 | Araq | depending on your needs you only need to pass an object on the stack that's big enough |
16:07:39 | Araq | inner unions etc are usually irrelevant |
16:09:30 | dave24 | how do I make sure the object is big enough and be able to access its fields? |
16:12:12 | Araq | well you can c2nim _NOTIFYICONDATA |
16:12:16 | * | arnetheduck quit (Ping timeout: 260 seconds) |
16:14:38 | * | Arrrr joined #nim |
16:14:38 | * | Arrrr quit (Changing host) |
16:14:38 | * | Arrrr joined #nim |
16:14:47 | * | couven92 quit (Remote host closed the connection) |
16:16:06 | dave24 | Araq: nice, thats a good step forwards. Thanks! |
16:18:48 | * | nsf quit (Quit: WeeChat 1.7.1) |
16:22:54 | Araq | be aware though that I myself cannot translate it because TCHAR is either a byte or a word |
16:23:21 | Araq | I suppose you can assume word (16bits) nowadays but it looks like a poorly thought-out API |
16:28:01 | * | yglukhov joined #nim |
16:32:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
16:37:15 | * | toddWannaCode joined #nim |
16:40:06 | * | yglukhov joined #nim |
16:40:56 | toddWannaCode | Hey |
16:41:20 | toddWannaCode | I am a noob trying to learning programming |
16:41:50 | PMunch | Welcome! :) |
16:42:06 | toddWannaCode | I have been learning Python and someone recommended me that I should learn Nim if I wanna dive into lower level stuff |
16:42:50 | toddWannaCode | Is there anything I should be aware of before starting? |
16:43:15 | PMunch | Hmm, well it's a bit different to Python |
16:43:25 | PMunch | In Python you don't really use types, which you do in Nim |
16:43:37 | PMunch | That's probably the biggest difference you would notice right of the bat |
16:45:02 | toddWannaCode | Nah I started learning with C, so I have a little familarity with static typing |
16:45:08 | PMunch | Ah right |
16:45:42 | PMunch | https://learnxinyminutes.com/docs/nim/ |
16:45:49 | PMunch | You could have a look at that |
16:46:09 | PMunch | Shows many of the neat features in Nim |
16:47:48 | PMunch | Hmm, Araq. Is there a way to execute the string I get from astGenRepr and then get the resulting AST? |
16:48:00 | toddWannaCode | Oh nice. I just started with the Nim by example from the documentation. I will take a look at that. |
16:48:58 | PMunch | The learnxinyminutes examples are generally quite good for showing off the neat features of a language |
16:52:02 | toddWannaCode | For multiline comments do I need to start it with discard? |
16:52:31 | PMunch | That's a bit dated. You can use #[ Comments ]# |
16:52:38 | PMunch | Which can span multiple lines |
16:54:07 | toddWannaCode | Oh noice. |
16:58:01 | * | beatmox joined #nim |
17:01:23 | * | mwbrown quit (Quit: Exiting) |
17:02:21 | * | pilne joined #nim |
17:02:37 | * | libman joined #nim |
17:03:48 | * | mwbrown joined #nim |
17:10:05 | * | Matthias247 joined #nim |
17:23:19 | dave24 | How do i get the instance handle in a windows gui application? |
17:25:17 | PMunch | Araq, is there a way to compare two ASTs? |
17:27:21 | Araq | getApplicationInstance() |
17:27:36 | Araq | PMunch, sameTree perhaps? don't remember |
17:28:36 | PMunch | In the macros module? |
17:33:02 | * | Neomex_ is now known as Neomex |
17:38:17 | dave24 | I can't find getApplicationInstance() anywhere |
17:43:08 | chrisheller | dave24: Are you trying to get the process handle? Or the main hwnd for the app? |
17:45:04 | dave24 | I'm trying to get the hInstance you get in WinMain |
17:45:04 | PMunch | Hmm Araq, I've got a string from my repr. Now I want to execute that string as code and get the AST it creates. Is this even possible? |
17:46:55 | * | rauss quit (Ping timeout: 258 seconds) |
17:48:17 | * | skrylar joined #nim |
17:48:21 | chrisheller | dave24: You can call getCurrentProcess from the winlean module |
17:48:55 | * | rauss joined #nim |
17:48:56 | dave24 | chrisheller: Thanks, not sure how I missed that. |
17:49:44 | chrisheller | You can also compile with --nomain and use {.emit.} to take more control of the initialization. |
17:50:10 | dave24 | oh I see, thanks. I might try that. |
17:50:29 | chrisheller | Search the forum for nomain and you'll see some examples |
17:50:41 | * | couven92 joined #nim |
17:52:25 | * | rauss quit (Client Quit) |
17:54:48 | PMunch | I'm trying this: http://ix.io/xwY but it complains that dumpastgen.nim(7, 3) Error: cannot generate VM code for macro test(i: NimNode): untyped = result = i |
17:54:59 | * | couven92 quit (Client Quit) |
17:57:05 | * | dave24 quit (Ping timeout: 240 seconds) |
18:17:12 | * | nsf joined #nim |
18:18:19 | * | couven92 joined #nim |
18:19:40 | * | skrylar quit (Ping timeout: 260 seconds) |
18:23:22 | * | skrylar joined #nim |
19:09:08 | * | Arrrr quit (Quit: Leaving.) |
19:30:13 | * | toddWannaCode quit (Quit: Leaving) |
19:48:57 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
20:04:59 | * | dave24 joined #nim |
20:06:31 | * | Vladar quit (Quit: Leaving) |
20:15:17 | * | nsf quit (Quit: WeeChat 1.7.1) |
20:42:41 | * | skrylar quit (Ping timeout: 246 seconds) |
20:47:04 | PMunch | Anyone? |
20:50:20 | subsetpark | dom96: is there a way to use private github repositories in a custom nimble package list? |
20:51:42 | dom96 | PMunch: Why the macro nesting? |
20:52:04 | PMunch | I was trying to use getAst |
20:52:05 | dom96 | subsetpark: You should be able to just specify the Git URL |
20:52:08 | PMunch | Which required a macro |
20:52:55 | PMunch | Optimally I would like to write a test that checks if the output of astGenRepr, when executed, generates the AST given to it. |
20:56:46 | dom96 | I'm just guessing here, but have you tried moving the macro to the top-level? |
20:57:02 | subsetpark | Hm dom96 I am getting a 'cannot read from file' error |
20:57:24 | subsetpark | I have a PackageList entry in my .config/nimble/nimble.ini file, which points to a json URL |
20:57:35 | subsetpark | I am able to curl the json successfully |
20:57:51 | dom96 | subsetpark: at which stage is it failing? `nimble refresh`? |
20:58:48 | subsetpark | ah I didn't know that was necessary :) |
20:59:19 | dom96 | that error is a bug though, so please report it if you can :) |
20:59:21 | PMunch | Hmm, that worked. But getAst didn't do what I hoped it would in this context :( |
21:02:21 | PMunch | I want to compile and run the code from the string I've generated.. |
21:03:08 | subsetpark | dom96: will do. Is it possible to use a local packages.json while developing? |
21:04:04 | dom96 | sure, just copy it into ~/.nimble/packages.json (or whatever the path is) |
21:04:06 | subsetpark | would it be as simple as inserting a new packages_*.json directly into ~/.nimble? |
21:04:09 | subsetpark | word, ok |
21:04:23 | dom96 | yeah, you can give it a name after the underscore IIRC |
21:04:32 | dom96 | they all get merged as far as I remember |
21:04:52 | dom96 | Is refresh not working? |
21:05:38 | subsetpark | it is - I just am still developing my .json file, and I don't have a great way to quickly update it remotely right now |
21:06:05 | dom96 | ahh :) |
21:06:15 | PMunch | So dom96 if I have a string containing code. Is there any way to execute it on compile time? |
21:06:56 | subsetpark | though that said - it doesn't look like simply inserting packages_local.json into ~/.nimble gets it seen |
21:07:15 | dom96 | PMunch: https://nim-lang.org/docs/macros.html#parseStmt,string |
21:07:16 | subsetpark | or for that matter calling it packages.json |
21:08:05 | subsetpark | which is odd because i don't see anywhere that i could register it with nimble |
21:08:49 | dom96 | oh, I think it needs to be in your config |
21:08:54 | PMunch | dom96, yeah I use parseStmt to get a stmt from the string. But I want to add that string to a macro and run it |
21:09:03 | dom96 | Judging by this code: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageinfo.nim#L235 :) |
21:09:17 | dom96 | https://github.com/nim-lang/nimble#configuration |
21:09:29 | dom96 | If you just add a dummy with a fake URL it should work |
21:09:55 | dom96 | PMunch: macro foo(x: string): untyped = parseStmt(x) ? |
21:10:42 | * | sz0 quit (Quit: Connection closed for inactivity) |
21:11:41 | subsetpark | @dom96 got it. Seems like it wouldn't be too hard to make that an official feature |
21:11:51 | subsetpark | Would you be interested if I opened a PR? |
21:12:25 | PMunch | dumpastgen.nim(3, 49) Error: type mismatch: got (NimNode) but expected one of: proc parseStmt(s: string): NimNode |
21:12:54 | dom96 | subsetpark: sure :) |
21:13:25 | dom96 | PMunch: parseStmt(x.strVal) |
21:13:46 | PMunch | Error: field 'strVal' cannot be found |
21:13:57 | PMunch | macro foo(x: string): untyped = parseStmt(x.strVal) |
21:15:02 | dom96 | import macros? |
21:15:50 | PMunch | I've done that.. |
21:16:06 | PMunch | Since the thing I'm writing this test for is in the macros module :P |
21:19:09 | PMunch | The thing I want to do: |
21:19:29 | dom96 | at the bottom of the macros module? |
21:19:34 | PMunch | Macro 1: Takes an AST and returns a string that has code to generate that AST when put in a macro |
21:19:52 | PMunch | Using Macro 1 parse the string into code and run it. |
21:20:29 | PMunch | The output of that, i.e. the ast generated by the code in the string, should be checked against the initial AST |
21:22:59 | PMunch | macro foo(x: string): untyped = |
21:22:59 | PMunch | echo x.type.name |
21:23:05 | PMunch | That echos NimNode |
21:24:06 | PMunch | x.kind = nnkSym |
21:29:56 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:30:23 | PMunch | http://ix.io/xxj |
21:30:26 | PMunch | Minimal example |
21:30:31 | PMunch | Outputs string and NimNode |
21:31:43 | PMunch | So it passes the symbol "myTestString" to the macro, and not the actual string? |
21:34:03 | PMunch | If I pass it a string literal it works fine |
21:39:59 | PMunch | Meh, I can't figure this out |
21:40:02 | PMunch | I'm going to bed |
21:40:03 | * | PMunch quit (Quit: leaving) |
21:44:06 | * | nsf joined #nim |
21:45:32 | * | skrylar joined #nim |
21:46:34 | * | ofelas quit (Quit: shutdown -h now) |
21:48:19 | * | krux02 quit (Remote host closed the connection) |
22:00:48 | subsetpark | @dom96 here's another weird nimble question: |
22:01:13 | subsetpark | Actually I think I'm just being stupid :) |
22:04:05 | * | skrylar quit (Ping timeout: 240 seconds) |
22:08:12 | * | Parashurama quit (Remote host closed the connection) |
22:08:42 | subsetpark | ok, i'm not being stupid. Is there a way to do parallel execution in a nimble task? |
22:08:57 | subsetpark | Say, start a jester server, run a test file against it, then kill the jester server? |
22:13:03 | * | skrylar joined #nim |
22:14:50 | * | skrylar quit (Remote host closed the connection) |
22:15:06 | * | skrylar joined #nim |
22:20:07 | * | skrylar quit (Ping timeout: 260 seconds) |
22:33:27 | chrisheller | Looks like --gc:stack and --threads:on seems to work well for having multiple Nim .DLL plugins in a single multi-threaded process. |
22:34:39 | chrisheller | I had mentioned on here before that I was getting some GC crashes in some callbacks before, but that combination seems to work well. |
22:34:49 | dom96 | subsetpark: maybe you can do some clever with things with the shell |
22:37:20 | * | nsf quit (Quit: WeeChat 1.7.1) |
22:47:02 | * | Trustable quit (Remote host closed the connection) |
23:09:07 | * | dave24 quit (Ping timeout: 240 seconds) |
23:09:47 | * | dave24 joined #nim |
23:13:46 | * | skrylar joined #nim |
23:14:56 | * | couven92 quit (Quit: Client Disconnecting) |
23:17:24 | * | krux02 joined #nim |
23:37:20 | * | krux02 quit (Remote host closed the connection) |
23:42:18 | * | Neomex_ joined #nim |
23:42:33 | * | Neomex_ quit (Read error: Connection reset by peer) |
23:46:16 | * | Neomex quit (Ping timeout: 255 seconds) |
23:59:09 | skrylar | i'm guessing there's no easy ways to identify closures |
23:59:11 | skrylar | unfortunate |