<< 15-06-2017 >>

00:03:01*krux02 quit (Remote host closed the connection)
00:24:28libmanWow, lots of comments on my r/Python pitch - https://redd.it/6gwv4a
00:29:21libmanA 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:26libmanI 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:22libmanI 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:08ftsftbh 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:11captainkraftre 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:11ftsfwoo, got nico games running on android \o/
02:19:28ftsfneed to work out controls though
02:24:35ftsfand resuming
02:25:11libmanSwitching 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:47libmanI 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:44FromGitter<zacharycarter> ftsf: I'm working on a modular 3d renderer ala Horde3d w/ bgfx
02:28:05FromGitter<zacharycarter> congrats on android I know firsthand what a pita it is
02:28:48ftsfzacharycarter nice =)
02:29:01ftsfi started a 3d engine for my next project, it's coming together ok
02:29:10FromGitter<zacharycarter> I'm not building an engine
02:29:16FromGitter<zacharycarter> kind of done with that I think
02:29:58FromGitter<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:59libmanThis is interesting news on the embedded database library front - https://redd.it/6hbrrp - SQLite all the things! :D
02:30:10FromGitter<zacharycarter> you just specify the pipeline and resources
02:30:22ftsfzacharycarter seems the bgfx dependency is a big hassle though
02:30:27FromGitter<zacharycarter> I'm interested to see your 3d work though I know you made a lot of progress
02:30:42FromGitter<zacharycarter> ftsf: I think having the abstraction for vulkan / metal / directx 12 is worth it
02:30:45ftsfhttp://static.impbox.net/tmp/screenshot-1497254455.695464.png using deferred rendering and hdr and ssao so far, no shadows yet
02:31:05FromGitter<zacharycarter> wait - ssao is shadows I thought
02:31:11ftsfbut got skeletal animation working now
02:31:14FromGitter<zacharycarter> oh
02:31:20ftsfssao is the little dark bits on the edges
02:31:23FromGitter<zacharycarter> oh screen space ambient occlusion my bad
02:31:23FromGitter<zacharycarter> right
02:31:30ftsfbut not based on the light direction
02:31:35FromGitter<zacharycarter> right
02:31:55FromGitter<zacharycarter> I don't think bgfx is a big dependency if the engine is built right
02:32:19FromGitter<zacharycarter> lots of engines depend on other libraries and it's not a thing
02:32:50FromGitter<zacharycarter> bgfx will be abstracted away anyway by the rendering engine
02:32:51ftsfyeah, i'm depending on sdl2, but that seems very light weight compared to bgfx
02:33:13FromGitter<zacharycarter> yeah I've thought about that but what about when you want to switch to Vulkan or Metal or whatever?
02:33:19ftsfi can't remember the specifics but i had a bit of hassle getting it up and running for building frag
02:33:27ftsfyeah i have no plans for those
02:33:29ftsfhappy with opengl
02:33:33FromGitter<zacharycarter> I'd like to automate it with an installer
02:34:08FromGitter<zacharycarter> or just offer nightly builds of my rendering engine
02:34:29FromGitter<zacharycarter> with the library included for whatever platform
02:34:34libmanSince everyone else is talking about games: anyone ever consider using SQLite to store game assets?
02:34:54FromGitter<zacharycarter> sounds horribly inefficient
02:34:59ftsflibman, seems an odd choice for assets
02:35:26FromGitter<zacharycarter> I know where your head is at - blobs
02:35:44FromGitter<zacharycarter> but you're moving file IO to database IO essentially
02:36:01ftsfwould be more likely to use redis
02:36:13FromGitter<zacharycarter> you'd be better off compressing your files into a binary format
02:36:15libmanWell, 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:57libmanAnd you can distribute updates via sqldiff.
02:37:35FromGitter<zacharycarter> imo you're aiming for the smallest asset size possible
02:37:41FromGitter<zacharycarter> especially when dealing with mobile
02:38:01FromGitter<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:30FromGitter<zacharycarter> I suppose it can work though and probably has advantages in certain circumstances as you've described
02:38:46libmanSQLite 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:13ftsfa lot of games just use a zero compression zip file
02:40:28ftsfbut it's not much of an issue for me since reading assets isn't much of a bottleneck. YAGNI
02:40:30libmanSQLite 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:17FromGitter<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:29FromGitter<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:51FromGitter<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:51Araqsounds like a regression, I wonder what would cause this
09:18:05AraqFT_FREETYPE_H ? wtf
09:19:01FromGitter<andreaferretti> @ephja you can use `#def FREETYPE_H` in c2nim and it will skip the `#ifndef` block
09:19:24FromGitter<andreaferretti> or if you don't want to define it, use `#assumedef FREETYPE_H`
09:19:40FromGitter<andreaferretti> but yes, sometimes generated blocks are empty
09:19:53FromGitter<andreaferretti> there should be a postprocessing pass to remove empty blocks
09:20:35FromGitter<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:31Parashurama@Araq: There is an incoherence in the manual for enums:
10:13:31Parashuramathe manual mentions that enums with holes are not Ordinal (no inc, dec, etc..)
10:13:31Parashuramayet in devel, those clearly available, even for enum with holes.
10:14:08AraqParashurama: known issue but I dunno how to resolve it :-)
10:14:36Araqholes are just an artifact of C interop and usually C interop means type unsafe bullshit
10:15:01Araqbut how is the programmer served by not having 'inc' for these?
10:19:59*yglukhov joined #nim
10:32:35ParashuramaAraq: I'm tackling the performance issues with reprEnum, parseEnum and maybe MyEnum.items, so I wanted to be sure.
10:35:02Araqok :-)
10:46:54ParashuramaAraq: btw, what's the best way to make an iterator compiler magic?
10:48:26Araqwe have a wiki article for that iirc
10:48:49*krux02 joined #nim
10:48:56Araqbut magic iterators are hard we have no infrastructure in place for this
10:55:53*Trioxin joined #nim
10:56:10Trioxindespite my best efforts, I still can't whip up a proper damn HTTP post
10:59:55Araqping krux02
11:03:30FromGitter<zacharycarter> Nim port of horde3d going well so far :D
11:03:54FromGitter<zacharycarter> using bgfx as the renderer
11:06:15skrylariterators also hate fun
11:06:39skrylari posted a bug report where iterators returning closures which are called confuse nim in to emitting empty C references :B
11:08:27euantorTrioxin what's wrong? What's the code you've tried and what's wrong with it?
11:24:32ArrrrI remember a 'Sep' const but i can't find it. Would hold os dependant path separator character
11:24:56ArrrrMaybe i was dreaming
11:26:58ArrrrAh, ok, `DirSep`, but now is included in ospaths
11:33:34*arnetheduck joined #nim
11:51:07krux02pong: Araq
11:53:26krux02Araq: 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:31krux02Well also the glm package is broken in the new Nim version
12:02:30ftsfkrux02, i think there's a PR that fixes it
12:02:32Araqok, we can talk later, no problem. wanted to discuss NEP-2 with you
12:03:32krux02Araq: 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:22krux02I 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:27AraqI agree with that but "release" candidate implies a release cycle we don't have
12:06:00AraqI would love to have tick-tocks but it doesn't always work out this way.
12:07:22dom96Anyone want to help with this? https://www.reddit.com/r/nim/comments/6h8lhf/rroguelikedev_is_running_a_summer_devalong/ maybe zacharycarter? :)
12:07:33krux02well 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:39krux02dom96: Who is playing all those roguelikes that are being developed everywhere? I feel like rogue likes are games for the developer only
12:08:56dom96dunno, I only really play nethack
12:09:03krux02sure the idea of rogue likes is to be fun for the developer, too
12:09:21krux02well brogue is pretty good, too.
12:09:42krux02(very simple and accessable, but still challenging and interesting)
12:09:47FromGitter<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:35krux02I 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:33krux02andreaferretti: https://github.com/nim-lang/Nim/issues/5845
12:11:41krux02and that are the problems in one project only
12:12:25krux02that pattern was used by me almost every time I used `quote`
12:12:44krux02and I program Nim, because it has macros, therefore I use it excessively
12:13:14krux02and `quote` is for me the most important function in the macros library.
12:14:06dom96Does that mean that the example here doesn't work? https://nim-lang.org/docs/macros.html#quote,typed,string
12:14:09krux02problems also occured in one tensor library that I have written, and the glm library
12:14:16ftsfdom96, sounds cool
12:15:26krux02dom96: well that example still works, because it is just an assignment
12:15:44krux02but ``result.add quote do: ...`` doesn't work anymore
12:16:26krux02And that is something I did often when I called quote for example from a loop
12:16:34dom96what does `res = head quote do:` even mean? What is 'head' in this case?
12:16:53krux02head is something I I defined on my own
12:17:13krux02proc head(arg: NimNode): NimNode = arg[0
12:17:15krux02]
12:17:44dom96hrm, 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:58krux02I did define it, because it was a very easy way to remove the enclosing StmtList from a quote result
12:18:02arnetheduckAraq, ping? any problems with https://github.com/nim-lang/Nim/pull/5818?
12:18:03dom96and I instinctively put parens around it
12:18:10*adeohluwa joined #nim
12:18:13krux02and 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:24dom96To be honest I think the new behaviour is fine.
12:19:30krux02dom96: that is where I would have used. result.add head quote do:
12:19:34krux02no parens at all ;)
12:19:42krux02because parens are evil
12:19:44dom96There is too many spaces in your code and too little parens.
12:19:49krux02they are for C programmers only
12:20:25krux02well I have a consistent style that does not match the style of the Nim compiler itself
12:21:07*PMunch joined #nim
12:21:16krux02but 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:48dom96Fair enough. It makes me feel uncomfortable though :)
12:22:05krux02yea only when you are not used to it
12:22:15krux02it made be feel a bit uncomfortable in the beginning, too
12:22:41krux02but then I tested the limits of the language and tried to understand the parsing rules to write the cleanest code possible
12:23:16krux02and after a while I really liket that I can prepend single argument functions without parens
12:23:26krux02foo bar baz arg
12:23:33krux02I really like it
12:23:45krux02it is like arg.baz.bar.foo
12:23:50krux02I also like that one
12:25:28krux02I like when I have the option not to put parens around a block of code
12:27:45Araqit's what makes 'await' nice to look at
12:30:17FromGitter<andreaferretti> @krux02 I understand yuor pain points, but never having use that style myself, I did not have any problems at all
12:30:27FromGitter<andreaferretti> In general, I try not to push the parser
12:30:51FromGitter<andreaferretti> I experiment more with the type checker :-P
12:31:43dom96This 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:59Araqdom96: I think we're on the edge here, it's just right, but we must not push the syntactic flexibility any further
12:34:17dom96Agreed
12:49:52krux02well there are tiny things where I wuolld like the syntex to be extended: http://ix.io/xwa
12:50:02krux02I think those things should parse identical
12:51:12*bahtiyar joined #nim
12:51:27krux02I 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:54krux02I don't a good reason not to support it, unless it would be hard to implement
13:03:04dom96Yeah, I agree. That would be nice.]
13:09:41*Vladar quit (Quit: Leaving)
13:17:49*skrylar quit (Ping timeout: 258 seconds)
13:18:59captainkraftdom96: who is on the cover of Nim in Action?
13:20:01FromGitter<andreaferretti> I am doing a little issue triaging here and there checking what bugs are not relevant anymore
13:20:09FromGitter<andreaferretti> I hope this is not an issue
13:20:42FromGitter<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:29FromGitter<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:35FromGitter<TiberiumN> no newlines
13:26:40FromGitter<TiberiumN> commas instead of newlines
13:29:14FromGitter<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:45euantorI was going to suggest strscans
13:37:57captainkraftdom96: I assume the dude on the cover is this guy? https://en.wikipedia.org/wiki/Nimrod
13:38:06dom96captainkraft: no
13:38:07krux02can I explicitly say that a variable is uninitualized?
13:38:09dom96It's just some random dude
13:39:01FromGitter<TiberiumN> oh, preallocating a sequence gave 2ms speed boost (I'm adding all items to a sequence after parsing)
13:39:53FromGitter<TiberiumN> ok, good speed for me then :) just parsing game replay
13:40:08krux02TiberiumN: Nothing personal, but I think your question is not very Nim specific at all.
13:40:44FromGitter<TiberiumN> also thanks for some random guy who ported python "struct" module to Nim
13:40:44FromGitter<TiberiumN> https://github.com/OpenSystemsLab/struct.nim
13:40:48FromGitter<ephja> krux02: yes, with the noInit pragma https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement
13:41:04krux02ephja: thanks I test it
13:41:58euantorTiberiumN: how does this do? https://glot.io/snippets/eqtxo27oqp
13:42:52krux02well 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:09krux02that is a bit stupid considering if you ask me
13:43:18euantorOr rather https://glot.io/snippets/eqtxplga61
13:44:02*Arrrr quit (Ping timeout: 268 seconds)
13:44:04FromGitter<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:55captainkraftdom96: haha, even better
14:47:16captainkraftI get that init warning when using the SDL2 bindings and initializing an event to sdl2.defaultEvent
14:47:26captainkraftHaven't looked into why yet, v0v
14:52:24Araqyay, just lost 5 minutes because writeStackTrace() writes to stderr
14:52:34Araqfuck stderr
14:53:29AraqI 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:11krux02how to I get the path of the current executable?
15:28:17krux02I have resources relative to the binary
15:29:48*yglukhov joined #nim
15:32:27*adeohluwa quit (Quit: Connection closed for inactivity)
15:33:09chrishellergetAppDir() 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:39chrishellerAnyone know how to use startProcess and redirect stdout/stderr to a file?
15:46:20chrishellerI 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:57Araqyou need to do it on your own, I'm afraid
15:47:12krux02chrisheller: thank you that was what I was looking for
15:47:59chrishellerWould you consider a PR that allows passing a filehandle in for stdout (and stderr)?
15:48:52chrishellerI'm porting some Python code that takes advantage of that feature in Python's subprocess module.
15:51:00Araqsuch a PR is welcome if it comes with a test case :-)
15:51:36PMunchSpeaking of test cases Arak
15:51:40PMunchAraq*
15:52:31PMunchFor 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:24Araqwell 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:49Araqthe point is to not break it if somebody refactors it or changes it slightly
15:55:17PMunchAh, I see
15:59:21dave24how would I call the Shell_NotifyIcon winapi function from nim?
16:02:15Araqdave24 look at browsers.nim, it calls shellExecute
16:06:27dave24hmm, but that does not involve wrapping anything or passing a struct. I can't really work it out from that.
16:06:48dave24Shell_NotifyIcon is not in winlean, and it needs to be passed a struct which contains a union
16:07:17Araqdepending on your needs you only need to pass an object on the stack that's big enough
16:07:39Araqinner unions etc are usually irrelevant
16:09:30dave24how do I make sure the object is big enough and be able to access its fields?
16:12:12Araqwell 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:06dave24Araq: nice, thats a good step forwards. Thanks!
16:18:48*nsf quit (Quit: WeeChat 1.7.1)
16:22:54Araqbe aware though that I myself cannot translate it because TCHAR is either a byte or a word
16:23:21AraqI 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:56toddWannaCodeHey
16:41:20toddWannaCodeI am a noob trying to learning programming
16:41:50PMunchWelcome! :)
16:42:06toddWannaCodeI have been learning Python and someone recommended me that I should learn Nim if I wanna dive into lower level stuff
16:42:50toddWannaCodeIs there anything I should be aware of before starting?
16:43:15PMunchHmm, well it's a bit different to Python
16:43:25PMunchIn Python you don't really use types, which you do in Nim
16:43:37PMunchThat's probably the biggest difference you would notice right of the bat
16:45:02toddWannaCodeNah I started learning with C, so I have a little familarity with static typing
16:45:08PMunchAh right
16:45:42PMunchhttps://learnxinyminutes.com/docs/nim/
16:45:49PMunchYou could have a look at that
16:46:09PMunchShows many of the neat features in Nim
16:47:48PMunchHmm, Araq. Is there a way to execute the string I get from astGenRepr and then get the resulting AST?
16:48:00toddWannaCodeOh nice. I just started with the Nim by example from the documentation. I will take a look at that.
16:48:58PMunchThe learnxinyminutes examples are generally quite good for showing off the neat features of a language
16:52:02toddWannaCodeFor multiline comments do I need to start it with discard?
16:52:31PMunchThat's a bit dated. You can use #[ Comments ]#
16:52:38PMunchWhich can span multiple lines
16:54:07toddWannaCodeOh 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:19dave24How do i get the instance handle in a windows gui application?
17:25:17PMunchAraq, is there a way to compare two ASTs?
17:27:21AraqgetApplicationInstance()
17:27:36AraqPMunch, sameTree perhaps? don't remember
17:28:36PMunchIn the macros module?
17:33:02*Neomex_ is now known as Neomex
17:38:17dave24I can't find getApplicationInstance() anywhere
17:43:08chrishellerdave24: Are you trying to get the process handle? Or the main hwnd for the app?
17:45:04dave24I'm trying to get the hInstance you get in WinMain
17:45:04PMunchHmm 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:21chrishellerdave24: You can call getCurrentProcess from the winlean module
17:48:55*rauss joined #nim
17:48:56dave24chrisheller: Thanks, not sure how I missed that.
17:49:44chrishellerYou can also compile with --nomain and use {.emit.} to take more control of the initialization.
17:50:10dave24oh I see, thanks. I might try that.
17:50:29chrishellerSearch 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:48PMunchI'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:04PMunchAnyone?
20:50:20subsetparkdom96: is there a way to use private github repositories in a custom nimble package list?
20:51:42dom96PMunch: Why the macro nesting?
20:52:04PMunchI was trying to use getAst
20:52:05dom96subsetpark: You should be able to just specify the Git URL
20:52:08PMunchWhich required a macro
20:52:55PMunchOptimally I would like to write a test that checks if the output of astGenRepr, when executed, generates the AST given to it.
20:56:46dom96I'm just guessing here, but have you tried moving the macro to the top-level?
20:57:02subsetparkHm dom96 I am getting a 'cannot read from file' error
20:57:24subsetparkI have a PackageList entry in my .config/nimble/nimble.ini file, which points to a json URL
20:57:35subsetparkI am able to curl the json successfully
20:57:51dom96subsetpark: at which stage is it failing? `nimble refresh`?
20:58:48subsetparkah I didn't know that was necessary :)
20:59:19dom96that error is a bug though, so please report it if you can :)
20:59:21PMunchHmm, that worked. But getAst didn't do what I hoped it would in this context :(
21:02:21PMunchI want to compile and run the code from the string I've generated..
21:03:08subsetparkdom96: will do. Is it possible to use a local packages.json while developing?
21:04:04dom96sure, just copy it into ~/.nimble/packages.json (or whatever the path is)
21:04:06subsetparkwould it be as simple as inserting a new packages_*.json directly into ~/.nimble?
21:04:09subsetparkword, ok
21:04:23dom96yeah, you can give it a name after the underscore IIRC
21:04:32dom96they all get merged as far as I remember
21:04:52dom96Is refresh not working?
21:05:38subsetparkit 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:05dom96ahh :)
21:06:15PMunchSo dom96 if I have a string containing code. Is there any way to execute it on compile time?
21:06:56subsetparkthough that said - it doesn't look like simply inserting packages_local.json into ~/.nimble gets it seen
21:07:15dom96PMunch: https://nim-lang.org/docs/macros.html#parseStmt,string
21:07:16subsetparkor for that matter calling it packages.json
21:08:05subsetparkwhich is odd because i don't see anywhere that i could register it with nimble
21:08:49dom96oh, I think it needs to be in your config
21:08:54PMunchdom96, 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:03dom96Judging by this code: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/packageinfo.nim#L235 :)
21:09:17dom96https://github.com/nim-lang/nimble#configuration
21:09:29dom96If you just add a dummy with a fake URL it should work
21:09:55dom96PMunch: macro foo(x: string): untyped = parseStmt(x) ?
21:10:42*sz0 quit (Quit: Connection closed for inactivity)
21:11:41subsetpark@dom96 got it. Seems like it wouldn't be too hard to make that an official feature
21:11:51subsetparkWould you be interested if I opened a PR?
21:12:25PMunchdumpastgen.nim(3, 49) Error: type mismatch: got (NimNode) but expected one of: proc parseStmt(s: string): NimNode
21:12:54dom96subsetpark: sure :)
21:13:25dom96PMunch: parseStmt(x.strVal)
21:13:46PMunchError: field 'strVal' cannot be found
21:13:57PMunchmacro foo(x: string): untyped = parseStmt(x.strVal)
21:15:02dom96import macros?
21:15:50PMunchI've done that..
21:16:06PMunchSince the thing I'm writing this test for is in the macros module :P
21:19:09PMunchThe thing I want to do:
21:19:29dom96at the bottom of the macros module?
21:19:34PMunchMacro 1: Takes an AST and returns a string that has code to generate that AST when put in a macro
21:19:52PMunchUsing Macro 1 parse the string into code and run it.
21:20:29PMunchThe output of that, i.e. the ast generated by the code in the string, should be checked against the initial AST
21:22:59PMunchmacro foo(x: string): untyped =
21:22:59PMunch echo x.type.name
21:23:05PMunchThat echos NimNode
21:24:06PMunchx.kind = nnkSym
21:29:56*Matthias247 quit (Read error: Connection reset by peer)
21:30:23PMunchhttp://ix.io/xxj
21:30:26PMunchMinimal example
21:30:31PMunchOutputs string and NimNode
21:31:43PMunchSo it passes the symbol "myTestString" to the macro, and not the actual string?
21:34:03PMunchIf I pass it a string literal it works fine
21:39:59PMunchMeh, I can't figure this out
21:40:02PMunchI'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:48subsetpark@dom96 here's another weird nimble question:
22:01:13subsetparkActually 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:42subsetparkok, i'm not being stupid. Is there a way to do parallel execution in a nimble task?
22:08:57subsetparkSay, 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:27chrishellerLooks like --gc:stack and --threads:on seems to work well for having multiple Nim .DLL plugins in a single multi-threaded process.
22:34:39chrishellerI 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:49dom96subsetpark: 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:09skrylari'm guessing there's no easy ways to identify closures
23:59:11skrylarunfortunate