<< 09-02-2017 >>

00:01:34cheatfate_with 1 worker `japronto` is equal in benchmark with `asynchttpserver`
00:03:52*gokr quit (Ping timeout: 240 seconds)
00:22:23*Jesin joined #nim
00:33:32*Ven quit (Ping timeout: 255 seconds)
00:37:30*Ven joined #nim
00:49:07*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:51:59*brson joined #nim
01:00:21*PMunch quit (Quit: leaving)
01:06:34*carterza joined #nim
01:08:15*chemist69 quit (Ping timeout: 245 seconds)
01:10:58*chemist69 joined #nim
01:12:52*devted joined #nim
01:20:44*kulelu88 joined #nim
01:20:59kulelu88Is recursion possible with Nim?
01:22:07*aziz quit (Quit: Ex-Chat)
01:33:03ftsf_kulelu88, sure
01:33:20kulelu88I just realized I should use a for loop for incrementing
01:36:58*gangstacat quit (Quit: Ĝis)
01:45:02kulelu88okay a for loop won't work
01:52:43ftsf_kulelu88, what are you trying to do?
01:53:39kulelu88ftsf_: a program that checks for an odd number, then divides the odd number by other odd numbers until I get an int back
01:53:50*krux02 joined #nim
01:54:03ftsf_why can't you use a for loop?
01:54:15ftsf_but sounds like you want a while loop
01:54:42kulelu88ftsf_: cause the odd value can be 1293234343553333
01:54:57FromGitter<krux02> that is not very precise
01:55:28kulelu88yeah perhaps a while loop that increments the odd divider by 2
01:55:33FromGitter<krux02> everything that can be modeled with recursion can also be modeled with a for loop, it is just sometimes nicer with recursion
01:56:08FromGitter<krux02> if you want to implement recursion with a for loop you might need a stack structure with push and pop, but it is all possible
01:56:55krux02kulelu88: I still don't understand your use case
01:57:17krux02what do you want to do with your division result
01:57:19kulelu88krux02: it's just experimental code learning Nim
02:06:30*Kingsquee joined #nim
02:06:35*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:07:09*chemist69 quit (Ping timeout: 252 seconds)
02:17:33*dddddd quit (Remote host closed the connection)
02:18:07*dashed joined #nim
02:20:20*brson quit (Quit: leaving)
02:21:11*chemist69 joined #nim
02:33:23*arnetheduck quit (Ping timeout: 264 seconds)
02:33:49*arnetheduck joined #nim
02:37:35*bungoman quit (Ping timeout: 255 seconds)
02:57:08*carterza_ joined #nim
02:59:57*carterza quit (Ping timeout: 252 seconds)
02:59:57*mounty quit (Ping timeout: 252 seconds)
02:59:58*carterza_ is now known as carterza
03:00:12*mounty joined #nim
03:05:46*shashlick joined #nim
03:21:54*arnetheduck quit (Ping timeout: 260 seconds)
03:23:03carterzahttp://imgur.com/a/c1l2v
03:28:04FromGitter<krux02> looks interesting
03:28:59carterzathanks
03:29:25FromGitter<krux02> is that the roguelike?
03:29:34carterzaright now I’m just working on engine level stuff
03:29:39carterzabut eventually yes
03:31:48krux02yes, from my experience I can tell you, that it is really easy to get lost in detail on a project like that
03:32:01*devted quit (Quit: Sleeping.)
03:32:20carterzafor sure :D
03:32:25carterzaI already prototype a lot in Java though
03:32:29carterzagameplay wise
03:32:37carterzalots of procedural generation goodness
03:32:45krux02I used to prototype in BlitzBasic and later processing
03:32:54carterzaah nice
03:32:59krux02processing is java, so yes I did prototype in java
03:33:07carterzayup I’ve used processing before
03:33:11krux02but processing doesn't scale
03:33:12carterzaI mainly use libgdx for prototyping now
03:33:17carterzadefinitely not
03:33:27carterzaI mostly need to find a or multiple artists
03:33:32krux02I looked at libgdx
03:33:39krux02there is something, I just can't stand
03:33:46krux02it's a detail, but it ruins my experience
03:33:56carterzaah yeah
03:34:02carterzait’s opinionated for sure
03:34:24carterzaand quite ugly
03:34:48carterzarough around the edges is a better descriptor I guess
03:36:56krux02I just couldn't live with the Matrix/Vector type
03:37:07carterzaah yeah
03:38:11krux02glsl glm does it right. Java is forced to do it wrong, because of the memory model, but the introduction of a Plane and Point type is just nonsense
03:38:15krux02but anyway
03:39:17carterzaI don’t use it for 3d
03:39:20carterzamuch anyway
03:39:31krux02ok, maybe then it works better, I don't know
03:39:33carterzaso it’s not a huge issue for me, but I could understand why it is
03:40:03krux02I do this project: https://github.com/krux02/opengl-sandbox
03:40:18krux02weird 3D stuff
03:40:26carterzait’s a cool project :D I’ve been watching it
03:40:38krux02that's cool
03:40:51krux02at some point I would really like to see someone using it for something
03:41:23krux02it is meant to be used as a library, it is not an engine, and certainly does not try to take over your rendering loop
03:41:31krux02and it can do 2D, too.
03:41:37krux02it just can't do Mac
03:42:00carterzayeah that’s what I’m developing on at the moment :/
03:42:31krux02do you have the opengl extension ARB_direct_state_access
03:42:57krux02it requires opengl 2.0, and then it is just a driver thing
03:44:08carterzaI don’t think so - I can’t install the nvidia drivers that support that extension
03:44:12carterzaI tried
03:44:29carterzaonly drivers I have access to are the standard ones mac puts out
03:45:46*Trioxin joined #nim
03:45:57Trioxinhow do I access the response code of getContent?
03:46:07Trioxinof what getContent returns
03:46:21krux02what is getContent?
03:46:51Trioxinin httpclient
03:46:53krux02yes, so my support for apple devices would be, to first install Linux and then run the application
03:49:35carterzaright
03:53:17*dyson joined #nim
03:53:28krux02have to go bye
03:53:33*krux02 quit (Quit: Leaving)
03:54:32*Trioxin quit (Ping timeout: 255 seconds)
03:56:29*dyson is now known as Trioxin
04:06:36Trioxinnvm, just had to handle exception
04:12:17Trioxindon't like nim docs
04:13:59Trioxinmaybe someday I'll pump a bunch of money into nim
04:14:25Trioxinit deserves it
04:15:50*Trioxin left #nim ("Konversation terminated!")
04:18:50*ftsf_ quit (Ping timeout: 255 seconds)
04:25:23FromGitter<vegansk> @Trioxin, you can use ``get`` for that
04:26:09FromGitter<vegansk> and then response.code
04:30:36*ftsf_ joined #nim
04:30:53*yglukhov joined #nim
04:36:06*yglukhov quit (Ping timeout: 240 seconds)
04:45:59*kulelu88 quit (Quit: Leaving)
04:48:59*chemist69 quit (Ping timeout: 264 seconds)
05:08:12shashlicknewbie question: trying to open a Windows registry key with nim-registry, but get undeclared identifier samRead, even though I've imported registry which declares it]
05:14:30ftsf_shashlick, there's no samRead proc defined in nim-registry?
05:14:51shashlickit is part of an enum: http://miere.ru/docs/registry/
05:15:01ftsf_it's private, not exported
05:15:24*chemist69 joined #nim
05:15:47shashlickthat's how it's documented - https://github.com/miere43/nim-registry
05:15:52ftsf_unless you included the private/winregistry
05:16:59ftsf_could be a bug
05:17:24shashlicklet me try with the hardcoded value
05:17:28ftsf_do the tests work?
05:20:46shashlickhow does a module export its symbols?
05:21:35shashlickeven the function signature is not recognized - the open() proc for example
05:22:09ftsf_proc foo*() exports foo
05:22:13*def-pri-pub quit (Quit: leaving)
05:22:19ftsf_any type or proc without a * is not exported
05:22:30ftsf_unless it uses export foo
05:23:09ftsf_looks like open is exported
05:26:59shashlicktests pass
05:27:33ftsf_mmm i see, problem is the tests are running in the same file which imports private
05:28:07ftsf_registry.nim should add `export RegKeyRights`
05:31:30ftsf_imported things are not automatically exported
05:31:57ftsf_so if foo imports bar and bar imports baz, foo doesn't know about stuff exported by baz unless bar exports them
05:32:15shashlickokay before I handle that, how do you do multiple string formats using %?
05:32:24shashlick var keypath = "$#\\$#" % hkey, wow
05:32:40ftsf_I'm not sure, never used that feature
05:32:49shashlick var keypath = "$#\\$#" % (hkey, wow)
05:33:05shashlickthat's how Python is, and I've gotten $# to work for one parameter but not more than that
05:33:06ftsf_I've been using hkey & "\\" & wow
05:34:57shashlickwell even if I put in export RegKeyRights into registry.nim, it doesn't recognize samRead
05:35:03ftsf_% takes an openarray
05:35:20ftsf_"$1 eats $2." % ["The cat", "fish"]
05:35:24ftsf_https://nim-lang.org/docs/strutils.html#%,string,openArray[string]
05:35:51shashlickneat thanks!
05:36:43shashlickwell, i'm still unable to figure out this RegKeyRights
05:36:55ftsf_i'm not sure (can't test since i'm not on windows)
05:37:03ftsf_does it work if you use the number value directly?
05:37:19shashlickno it doesn't match the proc signature then
05:37:36ftsf_I see
05:38:36ftsf_sorry, i'm wrong about it importing private/winregistry, it's actually "including" it, which is different
05:39:09ftsf_i've never used includes, but i think it's similar to #include in C
05:39:20ftsf_what is the exact error you're getting?
05:40:20shashlickRegKeyRights also has a * in private\winregistry.nim
05:40:28ftsf_yes
05:40:43shashlickvar key = open("$#\\$#" % [hkey, wow], samRead)
05:40:50ftsf_so what i was saying about it being exported isn't valid since it's included rather than imported
05:40:52shashlickwhere hkey and wow are both just strings
05:41:14shashlickI just get Error: undeclared identifier: 'samRead'
05:41:21Araqshashlick: there is also lib/windows/registry.nim in the stdlib
05:42:02shashlickwoot!
05:42:14ftsf_i'm not sure why samRead isn't visible =\
05:43:24shashlickAraq: I believe I'm using the same registry module
05:44:25ftsf_well that's likely you're problem
05:44:36ftsf_you're looking at the internal registry module, but looking at the docs for another module
05:45:58shashlickwell it is mentioned at https://nim-lang.org/docs/lib.html, under unofficial packages
05:46:17shashlickclick it and it takes you to the same github i mentioned, installed with nimble install registry
05:46:30ftsf_yes, but that's different to what Araq is talking about
05:49:58shashlickwell, I don't know where to look then
05:50:20Araqlook into $nim/lib/windows/registry.nim
05:50:35Araqit's different from the nimble package because it's part of the Nim core
05:50:41*avsej quit (Ping timeout: 240 seconds)
05:51:11*zama quit (Ping timeout: 240 seconds)
05:52:17*avsej joined #nim
05:52:17*avsej quit (Changing host)
05:52:17*avsej joined #nim
05:58:47shashlickthanks Araq, looks like it cannot enumerate subkeys so I'll have to extend it to do that
06:01:00*zama joined #nim
06:01:51Araqwell nim-registry code looks like the author knows what he is doing
06:02:11Araqwhat's wrong with it again?
06:02:48shashlickthe winregistry.nim code is in a private directory and is imported by registry.nim
06:03:24shashlickthe RegKeyRights enum declared within winregistry.nim is not visible
06:03:51shashlickso compiler complains that it is an undeclared identifier
06:03:57Araqyes, you're not supposed to use it externally
06:04:24shashlickbut the open() function requires samRead / samWrite as a parameter
06:04:44shashlicksince samRead / samWrite are declared within RegKeyRights, i cannot invoke the open()
06:05:55Araqyeah looking at its docs now
06:06:01Araqjust create a PR
06:06:15Araqmuch less work than patching the stdlib
06:06:44shashlicki'll do that
06:06:46Araqi only wrote the stdlib module for "finish.nim" anyway, it's very barebones
06:07:39shashlickwell all I really need to do is declare RegEnumKeyEx()
06:07:52shashlickif i understand C imports correctly
06:17:49*avsej quit (Ping timeout: 240 seconds)
06:18:20*avsej joined #nim
06:18:20*avsej quit (Changing host)
06:18:20*avsej joined #nim
06:21:25shashlickwhat's this "call" syntax
06:21:35shashlickcall procname - what does it do?
06:26:44Araqit passed 'procname' to 'call'
06:27:15Araq'call' is declared somewhere
06:27:31Araqit's not a Nim keyword or builtin
06:27:56*nsf joined #nim
06:29:28shashlickoh it's a template you've declared, i didn't see that, very nice
06:33:09*chemist69 quit (Ping timeout: 240 seconds)
06:34:13*chemist69 joined #nim
06:44:11FromGitter<Varriount> Why do we have such a template?
06:44:27FromGitter<Varriount> (Or rather, what does it do that normal syntax does not)
06:51:50*Jesin quit (Ping timeout: 255 seconds)
06:53:12shashlickjust a shortcut Araq used in registry.nim
06:53:12shashlicktemplate call(f) =
06:53:12shashlick let err = f
06:53:12shashlick if err != 0:
06:53:12shashlick raiseOSError(err.OSErrorCode, astToStr(f))
06:54:16FromGitter<Varriount> Ah. I thought that it was a system-wide template.
06:56:43*Arrrr joined #nim
06:56:43*Arrrr quit (Changing host)
06:56:43*Arrrr joined #nim
07:04:44FromGitter<vegansk> @Araq, hi. Is there any function in the compiler that finds recursively all the node's children with concrete type?
07:06:04Araqnah, sounds slow
07:08:09FromGitter<vegansk> Ok, then I'll write my own :-) The problem in #5355 is that nkRecCase nodes can contain another nkRecCase nodes, recursive variant objects :-) So I must find all nkSym nodes recursively
07:08:59*ftsf_ quit (Quit: :q!)
07:09:23Araqthat's not "children with concrete type"
07:09:30Araqthat's "children of kind nkSym"
07:13:36FromGitter<vegansk> oh, yes
07:16:51shashlickso update on the windows registry topic
07:16:51shashlickI cannot use the stdlib registry module since most of the symbols aren't exported
07:17:22shashlickas far as nim-registry, no matter what i try (rename, move winregistry.nim, etc), I cannot get the code to compile if it is in nimble's pkgs directory
07:17:42shashlickif I instead move the entire code to my code dir and import it there, it works as is
07:18:02shashlicki don't understand how nimble pkgs are added to nim compile path
07:19:31shashlicki'm opening a PR on nim-registry for now, though will help to understand why it doesn't work thru nimble but is fine as a local module
07:21:18shashlickhttps://github.com/miere43/nim-registry/issues/3
07:21:54*PurpleCow joined #nim
07:22:36PurpleCow#elementary-dev
07:23:23*filcuc joined #nim
07:34:54*Jesin joined #nim
07:35:57FromGitter<vegansk> @Araq, one more question please. Can I check, if the node has sons using ``n.safeLen() > 0`` or maybe there is a better way to do that?
07:37:09Araqusually you should know whether it's an atom or not.
07:37:25Araqfor non-atoms use n.len directly
07:41:17FromGitter<vegansk> Ok. Then what is better, to make generic function ``proc findNodeChildrenOfKinds(children: var seq[PNode], n: PNode, kinds: set[TNodeKind], recursive = false)``, or should I do concrete search for the fields in case of #5354?
07:53:43*Andris_zbx joined #nim
08:00:14*rokups joined #nim
08:02:19*PurpleCow quit (Quit: Leaving)
08:03:55*Matthias247 joined #nim
08:09:20*gokr joined #nim
08:10:47rokupsAraq: i need reliable and consistent timing function that is not affected by changing system time. system/timers.nim as suggested by cheatfate_ has getTicks() but these are not exported and seem to be reserved for internal use. Then there is getStartMilsecs() which is deprecated. any ideas what i could use or is there nothing really?
08:13:34Araqsystem/timers.nim needs to become an official module -.- I use it frequently too
08:14:07Araqinclude "$stdlib/system/timers" works though
08:14:49rokupsit needs some love however. that distinct ticks type is really annoying as it breaks many math operations
08:17:21Araqwell it doesn't support math operations
08:17:41Araqthat distinct type keeps you from making mistakes
08:18:51rokupsits 64bit integer, how number can not support math operations
08:20:37Araqhttps://github.com/nim-lang/Nim/issues/5146
08:20:52Araqeven with the distinct type people got it wrong :-)
08:21:49Araqvegansk: do a concrete search please
08:22:07FromGitter<vegansk> @Araq, ok
08:24:05*yglukhov joined #nim
08:36:14*Kingsquee quit (Ping timeout: 255 seconds)
08:43:55rokupsAraq: timers module is weird. subtracting Ticks produces Nanos. that is so very counter intuitive :\ why is it done this way?
08:44:29Araqwhat should it produce instead?
08:44:51FromGitter<barcharcraz> oh wow nimscript is really cool
08:45:04rokupsusually math operations produce same type, thats why this case is confusing
08:55:35FromGitter<Varriount> rokup: But time-math isn't exactly like regular math.
08:55:51FromGitter<Varriount> You get this in date calculations too.
08:56:11FromGitter<Varriount> timestamp_a - timestamp_b = time_interval
08:57:05*jinshil joined #nim
08:57:35*Kingsquee joined #nim
08:59:30FromGitter<Varriount> And since a tick is a timestamp (albeit one with a fixed start point), subtracting it with another tick will get you the time inbetween ticks, not another tick (again, for all we know ticks start at 255, and as such a tick of 1 is invalid).
09:01:30rokupsnow this is confusing once again. it is pretty obvious to me that subtracting two numbers yields a difference of those two numbers. what those numbers represent is irrelevant
09:04:54FromGitter<andreaferretti> every date library handles instants and intervals differently
09:05:07FromGitter<andreaferretti> the difference of two instants is an interval
09:05:25rokupswe arent talking about date here however
09:05:41FromGitter<andreaferretti> well, time is mostly the same
09:06:07FromGitter<Varriount> Date is just time on a more granular scale.
09:06:48rokupsmaybe i am confused because i have never seen a need for difference of two monotonic clock timestamps producing another point in time
09:07:26FromGitter<Varriount> rokups: Lets say the processor starts ticks at 256, and goes up each second.
09:08:11FromGitter<Varriount> We get two ticks at different points in a program. tick_a = 300, tick_b = 400
09:08:30FromGitter<Varriount> tick_b - tick_a == 100
09:08:43FromGitter<Varriount> But as stated previously, ticks start at 256
09:09:29FromGitter<Varriount> So the result of `tick_b - tick_a` cannot itself be a valid tick.
09:09:41rokupsbut that is not a point in time, but how long passed between ticks
09:10:20FromGitter<Varriount> Exactly. Hence why subtracting two ticks in Nim produces a Nano, rather than another tick.
09:11:01rokupsah now that you put it this way it starts to make sense. Tick is point in time and Nano is timespan
09:11:29FromGitter<Varriount> rokups: I never mentioned date in the example.
09:11:58FromGitter<Varriount> For all we know, subtracting two ticks could cause the number to wrap around.
09:13:12FromGitter<Varriount> I mean, even if tick_a is captured before tick_b, tick_a isn't always less than tick_b
09:13:29*yglukhov_ joined #nim
09:14:17rokupsreally? hows that?
09:14:29*yglukhov quit (Ping timeout: 255 seconds)
09:15:00cheatfate_rokups, just take the code, adopt it and use it, make coroutine as nimble module because this nanotick theory looks like warp theory
09:16:13FromGitter<Varriount> rokups: If the processor uses 64-bit unsigned integers, what happens when a tick equal max_value_for_uint_64?
09:16:35FromGitter<Varriount> It rolls over.
09:16:38rokupsah that case, its not a problem when values are subtracted
09:17:04rokupsbeen doing it since forever on windows with GetTickCount()
09:17:28FromGitter<Varriount> rokups: Yep.
09:17:48FromGitter<Varriount> Another reason why subtracting ticks gets you a different data type.
09:18:44*yglukhov_ quit (Remote host closed the connection)
09:19:18*yglukhov joined #nim
09:19:38*couven92 joined #nim
09:19:41rokupscheatfate_: is it me or you just sounded like mr-know-it-all? :\
09:22:26FromGitter<Varriount> cheatfate_ just wants is to stop filling the channel with nonsense.
09:22:30FromGitter<Varriount> :P
09:23:01FromGitter<Varriount> Or he's really anxious and wants coroutines done
09:23:26rokupswell if something is not clear to me i am not afraid to say it. much better than pretending to know it all and mess up in the process
09:23:47*yglukhov quit (Ping timeout: 264 seconds)
09:23:58rokupsadded that xmm/ymm saving stuff btw, gonna commit soon
09:24:46*jinshil quit (Quit: Good-bye!)
09:26:04cheatfate_Varriount: why you just not started with `overflow`?
09:27:11Araqvarriount: overflow is a problem, we pretend it doesn't exist here. that's not the reason for the types though
09:27:37Araqit won't overflow until the sun burns out anyway
09:27:38FromGitter<Varriount> cheatfate_: Didn't think to mention it, as it's an implementation detail
09:28:10cheatfate_Varriount: and yeah i'm interested in finishing `coroutines`, but only for research reason `is async approach with coroutines gives us any benefits in speed`, otherwise this coroutines are useless crap
09:28:30*yglukhov joined #nim
09:29:36FromGitter<Varriount> cheatfate_: Ouch.
09:30:08*ibk joined #nim
09:30:21cheatfate_Varriount: of course there maybe more reasons why you need to run single-threaded code with timeouts?
09:30:51rokupsin some sensitive environments coroutines could be only option for multitasking because threads are simply too unsafe. pretty useless yes
09:31:03FromGitter<Varriount> I hardly think all of rokups' work is useless.
09:31:11*fredrik92 joined #nim
09:31:43*fredrik92 quit (Client Quit)
09:32:17Araqcheatfate_: you could be a bit friendlier.
09:32:44cheatfate_Araq, i was friendlier, before people starts blame me
09:33:49Araqoh yeah rokups could have been a bit friendlier too
09:34:06Araqthe only mr-know-it-all here is Araq.
09:34:09FromGitter<endragor> game logic in pretty much every notable game makes use of coroutines. because games have logic in 1 thread and the scripts are basically like 1) moveAndPlayAnimation 2) thenPlayAnotherAnimation 3) thenSomeAnotherTimedEvent. Without coroutines that is hell to manage. Since Nim is a great language to base a game on, coroutines module would be very useful.
09:34:20rokupscheatfate_: to be honest you started this nonsense with me by bursting into anger becase i called your questions "random" while not meaning any offense. people are not out to get you. we should all relax here and stop fighting like little children
09:34:52rokupsgreat, now i offended Araq ;)
09:35:18*yglukhov quit (Remote host closed the connection)
09:35:22Araqnah, software offends me, people rarely do.
09:35:54*yglukhov joined #nim
09:37:24*gangstacat joined #nim
09:39:01cheatfate_rokups, my memory is not so long as yours, i even not remember `random` questions, until you mentioned it, also if you don't understand question maybe you need to ask for some help, before call it `random`?
09:40:12FromGitter<Varriount> -_-
09:40:32rokupsdidnt know word random is inherently offensive. are there any other things we should not be saying here?
09:40:35*yglukhov quit (Ping timeout: 264 seconds)
09:41:06Araqstop it guys or I will silence you for a short period of time.
09:41:17FromGitter<Varriount> God help us if programmers ever get put in positions of power. The squabbling will never end.
09:42:03rokups:)
09:43:07rokupsit gets better. i love reading those anti-systemd posts on phoronix ^^ so Varriount you are so right about this.. ;)
09:43:27*tankfeeder joined #nim
09:43:45Araqoh I read an intesting thing about that
09:45:08Araqhttps://www.agwa.name/blog/post/how_to_crash_systemd_in_one_tweet
09:46:38rokupsyeah, bugs do happen everywhere. plenty of software (and even linux kernel) get worse bugs but most triggered people are antisystemd crowd
09:49:15FromGitter<Varriount> And of course you have the rust promoters saying how it would have never happened if it was implemented in rust
09:50:10FromGitter<Varriount> Completely ignoring Python, Java, C#, and the fact that nothing can completely prevent logic bugs
09:50:45rokupshaha yeah these people.. someone should do analysis about development costs every language incurs. i somehow have a feeling that rust is not that wallet-friendly
09:51:20rokupsimo they have outdone c++ in complexity. exactly what we needed
09:51:54rokupsim getting political. time to go do some work instead heh
09:54:10*bjz joined #nim
09:58:20*yglukhov joined #nim
10:03:19*MyMind joined #nim
10:06:10*filcuc quit (Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/)
10:08:43*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:13:44*byte512 joined #nim
10:17:18*gokr soldering pins on my ESP32...
10:17:20*tankfeeder quit (Quit: Leaving)
10:17:26cheatfate_Varriount: what is `subexes` module, is it part of stdlib?
10:18:37FromGitter<Varriount> cheatfate_: https://nim-lang.org/docs/subexes.html
10:19:00FromGitter<barcharcraz> is that new?
10:19:07FromGitter<Varriount> Nope. Been present for a while.
10:19:19*cheatfate_ is now known as cheatfate
10:19:25FromGitter<Varriount> Personally, I'd prefer it to be merged with strutils, but Araq is the one who wrote it originally.
10:19:32cheatfateVarriount: thanks
10:19:47FromGitter<Varriount> There's no need to have two different string formatting procedures in the standard library.
10:19:58FromGitter<barcharcraz> isnt there a format proc (and `%`s) in strutils
10:20:24FromGitter<Varriount> @barcharcraz Yes, but it does simple substitution on.
10:20:26FromGitter<Varriount> *only
10:23:17*arnetheduck joined #nim
10:24:01*literal_ is now known as literal
10:24:56*Vladar joined #nim
10:26:21*gokr quit (Ping timeout: 256 seconds)
10:28:04*bjz joined #nim
10:36:37*tankfeeder joined #nim
10:45:09*Kingsqueee joined #nim
10:46:53*Kingsquee quit (Ping timeout: 240 seconds)
10:50:19*dashed quit (Quit: Connection closed for inactivity)
10:58:57*yglukhov quit (Remote host closed the connection)
10:59:29*yglukhov joined #nim
11:03:40*yglukhov quit (Ping timeout: 245 seconds)
11:05:49*PMunch joined #nim
11:09:24*filcuc joined #nim
11:09:24FromGitter<dom96> > game logic in pretty much every notable game makes use of coroutines. [...]Since Nim is a great language to base a game on, coroutines module would be very useful. ⏎ ⏎ @endragor Aren't closure iterators enough for this? What do real coroutines gain you?
11:10:04FromGitter<Varriount> @dom96 possibly a performance increase?
11:12:09*filcuc quit (Read error: Connection reset by peer)
11:15:59FromGitter<vegansk> @Araq, when I initialized GC via setupForeignThreadGc, how can I deinitialize it before my foreign thread is finished?
11:22:58Araqoh you need to expose osDeallocAllPages or something for that
11:29:14rokupsVarriount coroutines will likely be slower than closure iterators. iterators dont do any kind of context switching right?
11:30:34rokupsspeaking of string formatting.. string interpolation using local scope variables could be a great feature :p
11:35:28*yglukhov joined #nim
11:35:49*vlad1777d quit (Remote host closed the connection)
11:36:35*tankfeeder quit (Quit: Leaving)
11:36:55*ok joined #nim
11:37:10*ok is now known as Guest48471
11:38:12PMunchIs this the expected way that nimble should fail in this case: http://ix.io/1SUe ?
11:42:10*Guest48471 left #nim ("Leaving")
11:42:12FromGitter<Varriount> rokups: closure iterators are composed of a function pointer and a pointer to a structure containing the closures state.
11:43:03rokupsant it does not store/restore registers on every yield so to me it seems they would still be faster
11:43:21FromGitter<Varriount> Well, it depends.
11:44:02FromGitter<Varriount> A function call, especially one that used cdecl, pushes/pops registers
11:45:14rokupssure, but suppose if setjmp/longjmp were used for closure iterators they would still need to push/pop yielded values in addition to context switching done by setjmp/longjmp
11:45:35rokupswhich on windows x64 is twice as expensive too due to xmm registers
11:45:47rokupsPMunch: it says package is not found
11:46:04PMunchYeah I know
11:46:18FromGitter<Varriount> Hm. I'd be interested in real-world performance comparisons
11:46:21PMunchI just found it weird that it first fails with a message, then by what looks like a crash
11:46:58rokupsPMunch: i agree, error message should not be that scary
11:48:47*Arrrr quit (Quit: Leaving.)
11:50:50*Kingsqueee quit (Quit: https://i.imgur.com/qicT3GK.gif)
11:51:09FromGitter<dom96> rokups: then what's the advantage that coroutines bring?
11:51:47FromGitter<dom96> PMunch: Did you compile it in release mode?
11:51:57FromGitter<barcharcraz> can iterators call each other
11:51:57FromGitter<dom96> Well, I know the answer to that.
11:52:32FromGitter<dom96> Nimble only shows those stack traces when it's compiled in debug mode.
11:54:38PMunchNot sure to be honest dom96
11:54:41rokupsdom96 that would be cooperative multitasking without threads. we suddenly no longer need to care about thread synchronization which simplifies code a lot. another thing is that we can write "threaded" code in linear fashion. and then (probably most useful one) is that we can exploit coroutines for doing other work when waiting on IO, now here indeed some
11:54:41rokupsspeedups can be gained but not because coroutines are somehow faster than simple linear code but because waiting on IO is slow.
11:54:42PMunchBut I don't think I did
11:55:12PMunchOn this machine it's probably just a "koch tools" or whatever the command is
11:55:27rokupskoch nimble
11:55:36rokupswe probably should have added -d:release as well
11:55:44FromGitter<dom96> rokups: but we already do that with closure iterators, that's how async await works in Nim.
11:55:53*couven92 quit (Quit: Client disconnecting)
11:56:21rokupsdom96 but is it possible to yield from arbitrary possition deep down the callstack?
11:56:48FromGitter<dom96> rokups: nope. And that's the main advantage that I see with coroutines.
11:56:57FromGitter<dom96> Although this wasn't a problem for me so far.
11:57:46FromGitter<dom96> But please keep in mind that I don't want to discourage you. Just curious what coroutines are good at.
11:58:30FromGitter<dom96> PMunch: perhaps ``koch nimble`` doesn't compile in release mode. That's a ``koch`` bug then :)
11:58:48rokupsnah i understand :p i want coroutines for my own purposes, which is that cooperative multitasking without multithreading. same thing that games need. they would certainly not be able to exploit iterators as they are now due to not being able to yield from somewhere deep within callstack
11:59:24rokupspython had something similar done, and then they added `yield from` to mitigate this same limitation
11:59:50rokupsso every call that was yielded from needed to be prepended with `yield from`, again not very practical..
12:01:46*sz0 joined #nim
12:02:28*Snircle joined #nim
12:02:48FromGitter<endragor> @dom96 yeah so rokups answered it. I think closure iterators cover like 95%+ of use cases, and e.g. Unity's (C#'s) coroutines provide similar capabilities to Nim's asyncdispatch. More advanced versions (Lua's and I think what rokups is doing) allow yielding from arbitrary positions, including callbacks. And coroutines are not as invasive as async. If you use async all your "stack" must be async, with coroutines you just use procs and can
12:02:48FromGitter... yield from anywhere.
12:03:37rokupssounds like python's `yield from`
12:04:28cheatfatedom96, some probability exists, that coroutines with context switch based on async like poll() can be a little bit faster, also it will be much easier to debug and no need in `callSoon`.
12:04:59cheatfatedom96, but of course main flaw is `fixed uncontrollable stack`.
12:05:10*bjz_ joined #nim
12:05:13FromGitter<dom96> I dunno, all this ASM seems like it will be rather difficult to debug.
12:06:09cheatfatedom96, all this ASM is only for `context switch` you don't need to debug it
12:06:26FromGitter<barcharcraz> but even with true coroutiens you still need some kind of handle to resume them from (and to call select on).
12:06:57FromGitter<barcharcraz> the asm is not that bad afaik
12:07:01*bjz quit (Ping timeout: 240 seconds)
12:07:51cheatfatebarcharcraz: problem with ASM is that you need to implement such procedures for all architectures nim supports, because current coroutines supports only `intel`.
12:08:15FromGitter<barcharcraz> I think you can implement most of it in nim
12:08:24FromGitter<barcharcraz> but the actual context switching probably not
12:08:36FromGitter<barcharcraz> sec
12:09:08*filcuc joined #nim
12:09:34flyxso what's happening with the bountysource money? we've had no updates for two months and no statement whatsoever about how it is used. I'd really like to have the feeling that it isn't just uselessly lying around somewhere.
12:09:45rokupsfor context switching platform provides setjmp/longjmp if there was choice to depend on that. though this stuff seems to be broken on mingw64. there are few other pain points as well
12:10:10rokupswe could probably manage to switch stack without asm, but nim gc needs to inspect registers as well..
12:10:35rokupsit used something else for this though, but that thing is deprecated
12:10:51FromGitter<dom96> flyx: yeah, I need to write an update. Sorry.
12:11:19FromGitter<barcharcraz> I'm not sure you can do it with sjlj
12:12:04rokupsisnt that c++ exceptions?
12:12:14FromGitter<barcharcraz> no
12:12:23FromGitter<barcharcraz> again that's still one thread of control
12:12:28FromGitter<barcharcraz> you can't switch between stacks
12:12:56*couven92 joined #nim
12:13:21PMunchIs there a way to install a nimble package from a local directory?
12:15:06FromGitter<dom96> PMunch: ``cd dir/ && nimble install``
12:15:20FromGitter<barcharcraz> fibres (for windows) and ucontext for posix
12:15:21FromGitter<barcharcraz> https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/x86_64/getcontext.S
12:15:31rokupsA method based on setjmp/longjmp (SJLJ). SJLJ-based EH is much slower than DW2 EH (penalising even normal execution when no exceptions are thrown), but can work across code that has not been compiled with GCC or that does not have call-stack unwinding information.
12:15:38rokupssounds like c++ exceptions alright
12:15:53PMunchAaah, without the name :)
12:16:06PMunchI tried to do "nimble install 'name'"
12:16:55rokupsucontext.h is deprecated though
12:21:59FromGitter<barcharcraz> not for a good reason though
12:22:15FromGitter<barcharcraz> and the machenery for context switching should still work
12:23:49rokupsahh now i see. nim gc uses not ucontext but c_setjmp(registers) # To fill the C stack with registers.
12:24:01rokupsand i implemented custom function because glibc mangles some registers
12:24:26rokupsbut now i wonder if there even was a point..
12:24:55PMunchhttp://ix.io/1SUr what am I doing wrong here?
12:25:13FromGitter<barcharcraz> it's actually not clear if using full cooperative tasks is much benifit over many threads all waiting on one CV
12:26:42FromGitter<dom96> PMunch: Your `examples` directory will be installed, so the user will be able to `import examples/callbacks`
12:26:56FromGitter<dom96> i.e. your package encroaches on another package's namespace
12:27:38FromGitter<dom96> The suggestion that Nimble gives is spot on.
12:27:44FromGitter<dom96> Add the ``skipDirs`` option
12:28:03PMunchAs you can see from the cat mqtt.nimble part I already have that in there..
12:28:10PMunchBut maybe in the wrong spot?
12:28:54FromGitter<dom96> Oh, I missed that sorry
12:29:24FromGitter<dom96> You're using the old ini .nimble format
12:29:38FromGitter<dom96> I'm surprised that parses correctly
12:29:54FromGitter<dom96> best thing to do is move to the new format
12:30:31FromGitter<dom96> Example here: https://github.com/nim-lang/nimble#creating-packages
12:30:48PMunchYeah, it's an old package from two years ago which I'm trying to see if I can get working :P
12:31:17PMunchThanks for the link. I'll look into it :)
12:31:21*devted joined #nim
12:41:39rokupsbarcharcraz usermode context switch is cheaper than kernelmode context switch. also tasks on same thread do not need to care about synchronization like threads do so it simplifies code and eliminates source of bugs. for me personally this is big. idk why people dont use coroutines as much :p
12:42:30rokupsAraq: it was said that nim is trying to get rid of msvcrt dependency on windows. what will this be replaced with? if c_setjmp(registers) == 0'i32: # To fill the C stack with registers.
12:42:30*Arrrr joined #nim
12:43:06Araqrokups: well it will replaced with your inline assembler of course
12:43:11Araq*will be
12:43:46rokupsbut it adds constraints on supported platforms. i was wondering maybe you have some great idea how to avoid that ^_^
12:44:14FromGitter<barcharcraz> rokups, pull the assembly from an existing libc
12:45:41rokupswell that would be one way i guess. alright then, just was making sure if that platform specific asm is wanted at all. obviously if we could get rid of it completely it would be only a good thing
12:47:43*tankfeeder joined #nim
12:51:11FromGitter<barcharcraz> you need to use assembly to do sjlj afaik
12:51:22FromGitter<barcharcraz> I mean for one you need to actually read the whole register file
12:51:41FromGitter<barcharcraz> also different architectures tend to allow access to the program counter in different ways
12:52:02Araqrokups: well msvcrt dep is only an issue for Windows, so only Windows needs to use inline asm
12:52:33Araqthough that's 3-4 cpu archs, so not much gained
12:54:40FromGitter<barcharcraz> also I'm not sure sjlj is sufficient for coroutines, you need multiple stacks
13:00:06cheatfateAraq, i think windows coroutines can use fibers (to avoid assembler)
13:05:13*tankfeeder quit (Ping timeout: 240 seconds)
13:08:43*carterza quit (Quit: carterza)
13:09:33*yglukhov quit (Remote host closed the connection)
13:13:35FromGitter<barcharcraz> yeah
13:13:44FromGitter<barcharcraz> and on unix they should probably use ucontext
13:25:58*yglukhov joined #nim
13:33:28*tankfeeder joined #nim
13:33:30*byte512 quit (Ping timeout: 276 seconds)
13:35:48rokupswell ucontext is deprecated so not sure its wise to get in bed with something that is uncertain to exist in the future
13:36:09FromGitter<barcharcraz> it will exist
13:36:22rokupscheatfate: i think we could indeed use fibers, they are pretty much same thing anyway. and most likely we can abuse them for grabbing registers for gc
13:36:38rokupsone thing i do not like is setjmp use for getting registers with glibc
13:36:42rokupsir mangles rbp register
13:36:51rokupspossible memleak there?
13:37:47rokupsas for ucontext: http://duriansoftware.com/joe/PSA:-avoiding-the-%22ucontext-routines-are-deprecated%22-error-on-Mac-OS-X-Snow-Leopard.html
13:38:02rokupskind of not pretty stuff honestly
13:39:52*bjz joined #nim
13:40:07*gokr joined #nim
13:40:08*bjz_ quit (Ping timeout: 255 seconds)
13:40:10FromGitter<barcharcraz> ugh, maybe they have their own api
13:40:13FromGitter<barcharcraz> not sure
13:46:39cheatfate{.passC:"-D_XOPEN_SOURCE".}
13:58:50*yglukhov quit (Remote host closed the connection)
13:59:50*yglukhov joined #nim
14:03:38*filcuc quit (Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/)
14:06:38FromGitter<Varriount> rokups: Hrm, I'd research fibers a bit before implementing coroutines on top of them. https://blogs.msdn.microsoft.com/oldnewthing/20100226-00/?p=14793/
14:07:17*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:07:37rokupswill read. i used them for similar thing in c++ and they worked ok though
14:07:43FromGitter<Varriount> rokups: Also https://blogs.msdn.microsoft.com/oldnewthing/20080215-00/?p=23443#comment-601293
14:08:17*nsf quit (Quit: WeeChat 1.7)
14:10:16rokupsohh i remember why i didnt do fibers from the start. nim gc needs to be aware of the stacks and fiber api manages stacks without exposing them
14:11:01*carterza joined #nim
14:11:02rokupssecond link - detailed problems probably true for setjmp as well
14:14:14*sz0 quit (Quit: Connection closed for inactivity)
14:57:10*devted quit (Quit: Sleeping.)
15:00:27*Arrrr quit (Ping timeout: 252 seconds)
15:07:59*devted joined #nim
15:08:57*devted quit (Read error: Connection reset by peer)
15:12:44FromGitter<Varriount> Hm. I imagine the work required to make closures support "yield from" would include some sort of sequence/map of (procedure, cookie) pairs, and added logic around yield
15:13:26FromGitter<Varriount> Might be interesting to implement as an experiment, to see what strategy is more performant.
15:17:11*tankfeeder quit (Quit: Leaving)
15:22:09*shashlick quit (Quit: Connection closed for inactivity)
15:26:38*nsf joined #nim
15:27:25*rauss joined #nim
15:27:36FromGitter<dom96> The main PITA with closure iterators is that you cannot yield inside a try/except statement. Will coroutines support that?
15:28:33*jivank quit (Ping timeout: 276 seconds)
15:30:36raussoops ^
15:30:38demi-so, i starting to write a tool to automate the creation of porting objc headers into nim using libclang, and i'm almost curious to know if this was ever considered when implementing c2nim
15:33:52*yglukhov quit (Remote host closed the connection)
15:39:06*jivank joined #nim
15:46:24*Sentreen quit (Read error: Connection reset by peer)
15:51:31*yglukhov joined #nim
15:52:05*gokr left #nim (#nim)
16:00:23FromGitter<Varriount> demi-: You're asking about whether c2nim was ever meant to port objective C?
16:00:34*Sentreen joined #nim
16:00:53demi-no, i'm asking if c2nim ever considered using existing tooling for parsing C instead of writing its own C lexer
16:01:08demi-and if it did, why did it not choose to use existing tooling
16:05:26Araqdemi-: simple. c2nim predates libclang by years.
16:07:34demi-gotcha, makes sense. if i were to make such a tool that did use libclang, would it be considered to be adopted as part of the nim-lang org?
16:08:40Araqyup
16:08:50AraqI'm not married to c2nim either
16:09:01Araqyou could replace its custom parser by libclang
16:09:35Araqa couple of people promised to do that, never got a line of code from them though ;-)
16:09:56Araq"talk is cheap, show me the code" and all that
16:10:12demi-ok, well i'm going to give this an honest attempt because i would like to have some nice generated headers for Cocoa on OS X
16:13:51Araqyeah well, if you care about Cocoa chances are high you don't handle C++
16:14:26Araqc2nim can deal with a large subset of C++ too, so your tool would be an addition, not a replacement.
16:14:36Araqnothing wrong with that, of course.
16:14:44demi-i explicitly avoid it infact, however someone is welcome to opening a PR on this code to support the C++ parsing in libclang :P
16:15:01Araqparsing is the easier step.
16:15:12Araqyou need to map the C++ constructs to Nim constructs :P
16:15:52demi-yeah I don't plan on doing much of that, since none of apple's public APIs are written in c++, and the code that is gets wrapped with C interfaces for public use
16:16:08*tankfeeder joined #nim
16:16:31Araqthat doesn't hold for libclang itself, does it? ;-)
16:16:54*Sentreen_ joined #nim
16:17:06*heinrich5991 quit (Ping timeout: 240 seconds)
16:17:25demi-the libclang interfaces are all C, and someone already wrote that (conveniently) :)
16:17:36*Sentreen quit (Ping timeout: 240 seconds)
16:19:35*arnetheduck quit (Ping timeout: 264 seconds)
16:27:32*heinrich5991 joined #nim
16:31:47FromGitter<Varriount> I've used GCC's preprocessor mode along with regex find/replace to process macro-heavy code.
16:32:07Araqhttps://nim-lang.org/download/nim-0.16.1_x32.zip
16:32:20Araqhttps://nim-lang.org/download/nim-0.16.1_x64.zip
16:32:26*Arrrr joined #nim
16:32:26*Arrrr quit (Changing host)
16:32:26*Arrrr joined #nim
16:32:31demi-yay!
16:32:33Araqwould be nice if somebody could test these
16:32:40Araqin particular the finish.exe tool
16:32:52Araqdemi-: sorry, Windows only.
16:33:00demi-awww
16:33:05Araqthe other OSes have working C compilers out of the box :P
16:33:11FromGitter<Varriount> I might be able to quickly test the case where no mingw is present
16:33:34Araqvarriount: finish can download and unzip
16:33:48FromGitter<Varriount> Araq: What about android? We need a Nim installer for that. :P
16:34:25AraqI know nothing about Android, cannot prepare releases for it
16:41:00cheatfateAraq, i thought release must 0.16.2?
16:41:19cheatfatewhy it only 0.16.1
16:44:13*brson joined #nim
16:46:23*Trustable joined #nim
16:50:08Araqit's not a release
16:50:22Araqit's just so that more people test it before it becomes 0.16.2
16:52:59rokupsAraq: whats the oldest supported vcc compiler?
16:59:46*Trustable quit (Remote host closed the connection)
17:00:31*tankfeeder quit (Quit: Leaving)
17:03:16*nsf quit (Quit: WeeChat 1.7)
17:19:30PMunchHmm, why can't I do getCurrentException().trace?
17:26:21*Andris_zbx quit (Remote host closed the connection)
17:32:33*yglukhov quit (Remote host closed the connection)
17:33:28dom96PMunch: good question
17:34:01dom96There might be room for improvement here
17:34:32AraqgetStackTrace(e) exists
17:34:32dom96Another thing that I would like is the ability to get the stack trace as something more easily analysable, i.e. an object
17:35:07*yglukhov joined #nim
17:35:39dom96Araq: but getStackTrace accesses the .trace field
17:35:39*yglukhov quit (Read error: Connection reset by peer)
17:38:09Araqso? it's private for a reason
17:38:11*yglukhov joined #nim
17:38:39dom96Yes, I guessed that. But I am curious what that reason is
17:38:49dom96I guess it's to prevent people setting it
17:40:31*carterza quit (Quit: carterza)
17:41:24*carterza joined #nim
17:42:11*yglukhov quit (Ping timeout: 240 seconds)
17:48:45*carterza quit (Quit: carterza)
17:49:44PMunchDefine a procedure trace(e:Exception): string ?
17:49:58PMunchInstead of getStackTrace
17:50:15PMunchWell, I guess getStackTrace is fine
17:53:34*carterza joined #nim
18:03:28*PMunch quit (Quit: leaving)
18:04:39FromGitter<Varriount> Hm, but why not let trace be redefined? Might be useful for macros.
18:05:09*MyMind quit (Ping timeout: 240 seconds)
18:07:36*nsf joined #nim
18:17:15demi-when working with a C-style context pointer, is it possible to pass a ref to a nim type? whenever i try (addr foo) tells me "expression has no address"
18:19:41*yglukhov joined #nim
18:20:07FromGitter<Varriount> demi-: Could you paste a code example?
18:20:27demi-sure, sec
18:23:34demi-https://gist.github.com/4fcedb841f744558aea2c4256ffa67cd
18:24:13demi-where, instead of "string" i would ideally like to use an object i define
18:24:19*yglukhov quit (Ping timeout: 260 seconds)
18:24:46Vladardemi-: replace let with var
18:24:59demi-on `foo`?
18:25:14Vladaryes, let has no address
18:27:44demi-rad, thank you Vladar
18:28:00Vladarnp
18:32:09*gokr joined #nim
18:36:06*ibk quit (Quit: Connection closed for inactivity)
18:49:12*PMunch joined #nim
18:54:02*yglukhov joined #nim
18:55:44*vlad1777d joined #nim
19:36:28*yglukhov quit (Remote host closed the connection)
19:36:59*gokr quit (Ping timeout: 255 seconds)
19:49:23*yglukhov joined #nim
19:53:03Araqrokups: I don't know
19:53:10AraqVS 2013?
19:55:10*yglukhov quit (Remote host closed the connection)
20:05:57*tankfeeder joined #nim
20:06:42*MyMind joined #nim
20:08:03*couven92 quit (Quit: Client disconnecting)
20:11:15*gokr joined #nim
20:19:51*tankfeeder quit (Quit: Leaving)
20:20:24*MyMind quit (Ping timeout: 276 seconds)
20:27:56*MyMind joined #nim
20:31:40*Arrrr quit (Quit: Leaving.)
20:39:27*couven92 joined #nim
20:53:16*carterza quit (Quit: carterza)
20:59:24*filcuc joined #nim
20:59:48filcucAraq: ping
21:00:02Araqs
21:00:13filcucAraq: i'm playing with nimsuggest
21:00:33filcucand i'm don't get what's the project.nim file meaning
21:01:07filcucgiven that i have to pass a filename in the sug command
21:01:28filcucfor specifying a suggestion for a particular file
21:01:38filcucdoes it have a special meaning?
21:03:13*bjz joined #nim
21:03:46filcuc:)
21:05:20Araqhave you ever used an IDE?
21:05:42Araqname me a single one that doesn't have a notion of a "Project"
21:06:01Araqwhy is that?
21:06:04FromGitter<Varriount> filcuc: It's the main Nim file for whatever project you're looking at.
21:06:18FromGitter<Varriount> It's used to gather imports correctly
21:06:28filcucAraq: yes but i don't get why it should be necessary for nimsuggest
21:06:49filcucAraq: honestly i would have thought to just spawn a service and be done with it
21:07:06FromGitter<Varriount> filcuc: You can usually get away with making it either an empty file, or the same for you're getting suggestions from
21:07:08filcucAraq: and asking for a particular file suggestion by using "sug filename:row:col"
21:07:49filcucVarriount: ok but it seems like a workaround...
21:08:15*xet7 joined #nim
21:08:21demi-filcuc: this is the same question i had the other day, it is signified by having a .nim.cfg or .nimble file with the same name
21:09:05filcucdemi-: ok that makes sense
21:09:21filcucdemi-: Araq that what's i was asking for
21:09:22demi-it is the file that you compile that will ultimately build the whole project, most IDEs have a different type of file as their "project file" but with nim it is the one that matches the .nim.cfg/.nimble
21:09:57Araqwell for a start
21:10:10Araqthe 'sug' command can refer to an include file
21:10:38Araqand the compiler needs to know where it's included from to be able to suggest anything meaningful
21:11:12Araqand that's what it does, it knows the module that includes it and compiles that instead
21:12:07Araqor another example: it needs to know the configuration, like the --paths you setup
21:13:07filcucAraq: so in the case the *IDE* enables the user to dynamically change the "main" .nim file i should spawn multiple nimsuggests
21:13:30filcucAraq: for example if the user would like to run some test in a particular .nim file (that's not the main file)
21:13:50filcucAraq: initially i would have thought having only one nimsuggest instance
21:14:18filcucAraq: what i read so far suggest that it's not true: i should have multiple nimsuggest instances one for each "main" file
21:14:50Araqyup. though there is support for
21:15:05filcucAraq: for example in the QtCreator plugin the user can change through a ComboBox it's "main" file
21:15:05Araq"sug new_file_not_part_of_the_project"
21:15:35filcuc:|
21:16:22filcucAraq: so if i create an empty.nim file as use that as the nimsuggest project file and later use "sug other.nim:12:32" it works?
21:16:42Araqyeah it should
21:16:52Araqbut I have no test case for it :-)
21:16:57Araqshould write one.
21:17:02filcucAraq: if yes..why not simply add an option to launch nimsuggest without a project file
21:17:11*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:17:27filcucAraq: and force the user to use "sug path_to_.nim:row:col"
21:18:06Araqbecause it's stupid. more often than not it needs to know your configuration. is it a JS project? what's in the --path?
21:18:50filcucAraq: :|
21:19:21filcucAraq: and why can't do the same thing it does at beginning with (nimsuggest project.nim) everytime i use "sug other.nim"
21:19:32filcucAraq: eventually caching some info
21:19:34Araqyou don't need to highlight me every single time
21:19:56filcucsorry
21:22:31*yglukhov joined #nim
21:23:26Araqbecause that means every "module graph" internally has a different set of config options
21:23:42*yglukhov quit (Remote host closed the connection)
21:23:53Araqthe compiler wasn't written with this idea in mind. though every compiler refactoring makes it better
21:23:56*yglukhov joined #nim
21:24:14Araqand less dependent on global state
21:25:16Araqthat said, if I open a random .cpp file with visual studio, I get no intellisense whatsoever, since the file is not part of the solution.
21:26:48filcucAraq: i do understand your point, i'm just reflecting
21:27:11filcucand clarifying myself by asking questions
21:27:24filcucand for integrating correctly nimsuggest
21:27:37Araqand just fyi I'm watching Interstellar and it's so boring it makes me aggressive
21:28:13Araq:-)
21:28:29filcuci somewhat sensed it
21:28:33filcuc:P
21:35:41*vlad1777d quit (Remote host closed the connection)
21:38:24*gangstacat quit (Quit: Ĝis)
21:40:17*xet7 quit (Quit: Leaving)
21:41:28demi-i feel that there should be a solution/project file that isn't a source file, but i don't how i would envision that -- the current solution is elegant in simplicity
21:43:26*shashlick joined #nim
21:48:00*carterza joined #nim
21:51:05*Vladar quit (Remote host closed the connection)
21:58:35*filcuc quit (Ping timeout: 264 seconds)
21:58:47*shashlick quit ()
22:00:44*shaslick joined #nim
22:02:08*rokups quit (Quit: Connection closed for inactivity)
22:09:31PMunchdom96, Araq: how does graphics work?
22:09:37PMunchhttps://github.com/nim-lang/graphics
22:09:42PMunchThat one specifically
22:09:56dom96https://github.com/nim-lang/graphics/blob/master/graphics.nim#L504
22:09:59PMunchWould be nice with a minimal example file to show setup and stuff
22:10:15dom96it needs to be ported to sdl2
22:10:18dom96PRs welcome )
22:10:19dom96:)
22:10:19PMunchAaah
22:14:57*yglukhov quit (Remote host closed the connection)
22:15:29*MyMind quit (Ping timeout: 240 seconds)
22:18:57*yglukhov joined #nim
22:19:01*yglukhov quit (Remote host closed the connection)
22:19:37*yglukhov joined #nim
22:23:22*carterza quit (Read error: Connection reset by peer)
22:23:44*carterza joined #nim
22:24:01*yglukhov quit (Ping timeout: 240 seconds)
22:24:23*shaslick quit (Ping timeout: 264 seconds)
22:26:15*shaslick joined #nim
22:26:24*Matthias247 quit (Read error: Connection reset by peer)
22:28:16*rauss quit (Quit: WeeChat 1.7)
22:40:22*shaslick left #nim ("Leaving")
22:45:46*nsf quit (Quit: WeeChat 1.7)
22:57:14*Sembei quit (Ping timeout: 255 seconds)
22:58:36*Pisuke joined #nim
23:02:49*couven92 quit (Read error: Connection reset by peer)
23:09:21*abruanese joined #nim
23:11:31*shashlick joined #nim
23:13:40*demi- quit (Ping timeout: 245 seconds)
23:16:39*Calinou quit (Remote host closed the connection)
23:17:28*demi- joined #nim
23:18:56*Calinou joined #nim
23:36:56*def-pri-pub joined #nim
23:46:43shashlickhow do you update nimble? and nim for that matter? uninstall/reinstall?
23:51:45shashlickI did "koch nimble" and it did a full build on Windows, but it's still at 0.8.2, even though the repo says it is at 0.8.4
23:55:14shashlickchecking out of github and building gives me 0.8.4