00:01:34 | cheatfate_ | 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:59 | kulelu88 | Is recursion possible with Nim? |
01:22:07 | * | aziz quit (Quit: Ex-Chat) |
01:33:03 | ftsf_ | kulelu88, sure |
01:33:20 | kulelu88 | I just realized I should use a for loop for incrementing |
01:36:58 | * | gangstacat quit (Quit: Ĝis) |
01:45:02 | kulelu88 | okay a for loop won't work |
01:52:43 | ftsf_ | kulelu88, what are you trying to do? |
01:53:39 | kulelu88 | ftsf_: 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:03 | ftsf_ | why can't you use a for loop? |
01:54:15 | ftsf_ | but sounds like you want a while loop |
01:54:42 | kulelu88 | ftsf_: cause the odd value can be 1293234343553333 |
01:54:57 | FromGitter | <krux02> that is not very precise |
01:55:28 | kulelu88 | yeah perhaps a while loop that increments the odd divider by 2 |
01:55:33 | FromGitter | <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:08 | FromGitter | <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:55 | krux02 | kulelu88: I still don't understand your use case |
01:57:17 | krux02 | what do you want to do with your division result |
01:57:19 | kulelu88 | krux02: 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:03 | carterza | http://imgur.com/a/c1l2v |
03:28:04 | FromGitter | <krux02> looks interesting |
03:28:59 | carterza | thanks |
03:29:25 | FromGitter | <krux02> is that the roguelike? |
03:29:34 | carterza | right now I’m just working on engine level stuff |
03:29:39 | carterza | but eventually yes |
03:31:48 | krux02 | yes, 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:20 | carterza | for sure :D |
03:32:25 | carterza | I already prototype a lot in Java though |
03:32:29 | carterza | gameplay wise |
03:32:37 | carterza | lots of procedural generation goodness |
03:32:45 | krux02 | I used to prototype in BlitzBasic and later processing |
03:32:54 | carterza | ah nice |
03:32:59 | krux02 | processing is java, so yes I did prototype in java |
03:33:07 | carterza | yup I’ve used processing before |
03:33:11 | krux02 | but processing doesn't scale |
03:33:12 | carterza | I mainly use libgdx for prototyping now |
03:33:17 | carterza | definitely not |
03:33:27 | carterza | I mostly need to find a or multiple artists |
03:33:32 | krux02 | I looked at libgdx |
03:33:39 | krux02 | there is something, I just can't stand |
03:33:46 | krux02 | it's a detail, but it ruins my experience |
03:33:56 | carterza | ah yeah |
03:34:02 | carterza | it’s opinionated for sure |
03:34:24 | carterza | and quite ugly |
03:34:48 | carterza | rough around the edges is a better descriptor I guess |
03:36:56 | krux02 | I just couldn't live with the Matrix/Vector type |
03:37:07 | carterza | ah yeah |
03:38:11 | krux02 | glsl 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:15 | krux02 | but anyway |
03:39:17 | carterza | I don’t use it for 3d |
03:39:20 | carterza | much anyway |
03:39:31 | krux02 | ok, maybe then it works better, I don't know |
03:39:33 | carterza | so it’s not a huge issue for me, but I could understand why it is |
03:40:03 | krux02 | I do this project: https://github.com/krux02/opengl-sandbox |
03:40:18 | krux02 | weird 3D stuff |
03:40:26 | carterza | it’s a cool project :D I’ve been watching it |
03:40:38 | krux02 | that's cool |
03:40:51 | krux02 | at some point I would really like to see someone using it for something |
03:41:23 | krux02 | it 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:31 | krux02 | and it can do 2D, too. |
03:41:37 | krux02 | it just can't do Mac |
03:42:00 | carterza | yeah that’s what I’m developing on at the moment :/ |
03:42:31 | krux02 | do you have the opengl extension ARB_direct_state_access |
03:42:57 | krux02 | it requires opengl 2.0, and then it is just a driver thing |
03:44:08 | carterza | I don’t think so - I can’t install the nvidia drivers that support that extension |
03:44:12 | carterza | I tried |
03:44:29 | carterza | only drivers I have access to are the standard ones mac puts out |
03:45:46 | * | Trioxin joined #nim |
03:45:57 | Trioxin | how do I access the response code of getContent? |
03:46:07 | Trioxin | of what getContent returns |
03:46:21 | krux02 | what is getContent? |
03:46:51 | Trioxin | in httpclient |
03:46:53 | krux02 | yes, so my support for apple devices would be, to first install Linux and then run the application |
03:49:35 | carterza | right |
03:53:17 | * | dyson joined #nim |
03:53:28 | krux02 | have 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:36 | Trioxin | nvm, just had to handle exception |
04:12:17 | Trioxin | don't like nim docs |
04:13:59 | Trioxin | maybe someday I'll pump a bunch of money into nim |
04:14:25 | Trioxin | it deserves it |
04:15:50 | * | Trioxin left #nim ("Konversation terminated!") |
04:18:50 | * | ftsf_ quit (Ping timeout: 255 seconds) |
04:25:23 | FromGitter | <vegansk> @Trioxin, you can use ``get`` for that |
04:26:09 | FromGitter | <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:12 | shashlick | newbie 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:30 | ftsf_ | shashlick, there's no samRead proc defined in nim-registry? |
05:14:51 | shashlick | it is part of an enum: http://miere.ru/docs/registry/ |
05:15:01 | ftsf_ | it's private, not exported |
05:15:24 | * | chemist69 joined #nim |
05:15:47 | shashlick | that's how it's documented - https://github.com/miere43/nim-registry |
05:15:52 | ftsf_ | unless you included the private/winregistry |
05:16:59 | ftsf_ | could be a bug |
05:17:24 | shashlick | let me try with the hardcoded value |
05:17:28 | ftsf_ | do the tests work? |
05:20:46 | shashlick | how does a module export its symbols? |
05:21:35 | shashlick | even the function signature is not recognized - the open() proc for example |
05:22:09 | ftsf_ | proc foo*() exports foo |
05:22:13 | * | def-pri-pub quit (Quit: leaving) |
05:22:19 | ftsf_ | any type or proc without a * is not exported |
05:22:30 | ftsf_ | unless it uses export foo |
05:23:09 | ftsf_ | looks like open is exported |
05:26:59 | shashlick | tests pass |
05:27:33 | ftsf_ | mmm i see, problem is the tests are running in the same file which imports private |
05:28:07 | ftsf_ | registry.nim should add `export RegKeyRights` |
05:31:30 | ftsf_ | imported things are not automatically exported |
05:31:57 | ftsf_ | so if foo imports bar and bar imports baz, foo doesn't know about stuff exported by baz unless bar exports them |
05:32:15 | shashlick | okay before I handle that, how do you do multiple string formats using %? |
05:32:24 | shashlick | var keypath = "$#\\$#" % hkey, wow |
05:32:40 | ftsf_ | I'm not sure, never used that feature |
05:32:49 | shashlick | var keypath = "$#\\$#" % (hkey, wow) |
05:33:05 | shashlick | that's how Python is, and I've gotten $# to work for one parameter but not more than that |
05:33:06 | ftsf_ | I've been using hkey & "\\" & wow |
05:34:57 | shashlick | well even if I put in export RegKeyRights into registry.nim, it doesn't recognize samRead |
05:35:03 | ftsf_ | % takes an openarray |
05:35:20 | ftsf_ | "$1 eats $2." % ["The cat", "fish"] |
05:35:24 | ftsf_ | https://nim-lang.org/docs/strutils.html#%,string,openArray[string] |
05:35:51 | shashlick | neat thanks! |
05:36:43 | shashlick | well, i'm still unable to figure out this RegKeyRights |
05:36:55 | ftsf_ | i'm not sure (can't test since i'm not on windows) |
05:37:03 | ftsf_ | does it work if you use the number value directly? |
05:37:19 | shashlick | no it doesn't match the proc signature then |
05:37:36 | ftsf_ | I see |
05:38:36 | ftsf_ | sorry, i'm wrong about it importing private/winregistry, it's actually "including" it, which is different |
05:39:09 | ftsf_ | i've never used includes, but i think it's similar to #include in C |
05:39:20 | ftsf_ | what is the exact error you're getting? |
05:40:20 | shashlick | RegKeyRights also has a * in private\winregistry.nim |
05:40:28 | ftsf_ | yes |
05:40:43 | shashlick | var key = open("$#\\$#" % [hkey, wow], samRead) |
05:40:50 | ftsf_ | so what i was saying about it being exported isn't valid since it's included rather than imported |
05:40:52 | shashlick | where hkey and wow are both just strings |
05:41:14 | shashlick | I just get Error: undeclared identifier: 'samRead' |
05:41:21 | Araq | shashlick: there is also lib/windows/registry.nim in the stdlib |
05:42:02 | shashlick | woot! |
05:42:14 | ftsf_ | i'm not sure why samRead isn't visible =\ |
05:43:24 | shashlick | Araq: I believe I'm using the same registry module |
05:44:25 | ftsf_ | well that's likely you're problem |
05:44:36 | ftsf_ | you're looking at the internal registry module, but looking at the docs for another module |
05:45:58 | shashlick | well it is mentioned at https://nim-lang.org/docs/lib.html, under unofficial packages |
05:46:17 | shashlick | click it and it takes you to the same github i mentioned, installed with nimble install registry |
05:46:30 | ftsf_ | yes, but that's different to what Araq is talking about |
05:49:58 | shashlick | well, I don't know where to look then |
05:50:20 | Araq | look into $nim/lib/windows/registry.nim |
05:50:35 | Araq | it'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:47 | shashlick | thanks 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:51 | Araq | well nim-registry code looks like the author knows what he is doing |
06:02:11 | Araq | what's wrong with it again? |
06:02:48 | shashlick | the winregistry.nim code is in a private directory and is imported by registry.nim |
06:03:24 | shashlick | the RegKeyRights enum declared within winregistry.nim is not visible |
06:03:51 | shashlick | so compiler complains that it is an undeclared identifier |
06:03:57 | Araq | yes, you're not supposed to use it externally |
06:04:24 | shashlick | but the open() function requires samRead / samWrite as a parameter |
06:04:44 | shashlick | since samRead / samWrite are declared within RegKeyRights, i cannot invoke the open() |
06:05:55 | Araq | yeah looking at its docs now |
06:06:01 | Araq | just create a PR |
06:06:15 | Araq | much less work than patching the stdlib |
06:06:44 | shashlick | i'll do that |
06:06:46 | Araq | i only wrote the stdlib module for "finish.nim" anyway, it's very barebones |
06:07:39 | shashlick | well all I really need to do is declare RegEnumKeyEx() |
06:07:52 | shashlick | if 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:25 | shashlick | what's this "call" syntax |
06:21:35 | shashlick | call procname - what does it do? |
06:26:44 | Araq | it passed 'procname' to 'call' |
06:27:15 | Araq | 'call' is declared somewhere |
06:27:31 | Araq | it's not a Nim keyword or builtin |
06:27:56 | * | nsf joined #nim |
06:29:28 | shashlick | oh 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:11 | FromGitter | <Varriount> Why do we have such a template? |
06:44:27 | FromGitter | <Varriount> (Or rather, what does it do that normal syntax does not) |
06:51:50 | * | Jesin quit (Ping timeout: 255 seconds) |
06:53:12 | shashlick | just a shortcut Araq used in registry.nim |
06:53:12 | shashlick | template call(f) = |
06:53:12 | shashlick | let err = f |
06:53:12 | shashlick | if err != 0: |
06:53:12 | shashlick | raiseOSError(err.OSErrorCode, astToStr(f)) |
06:54:16 | FromGitter | <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:44 | FromGitter | <vegansk> @Araq, hi. Is there any function in the compiler that finds recursively all the node's children with concrete type? |
07:06:04 | Araq | nah, sounds slow |
07:08:09 | FromGitter | <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:23 | Araq | that's not "children with concrete type" |
07:09:30 | Araq | that's "children of kind nkSym" |
07:13:36 | FromGitter | <vegansk> oh, yes |
07:16:51 | shashlick | so update on the windows registry topic |
07:16:51 | shashlick | I cannot use the stdlib registry module since most of the symbols aren't exported |
07:17:22 | shashlick | as 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:42 | shashlick | if I instead move the entire code to my code dir and import it there, it works as is |
07:18:02 | shashlick | i don't understand how nimble pkgs are added to nim compile path |
07:19:31 | shashlick | i'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:18 | shashlick | https://github.com/miere43/nim-registry/issues/3 |
07:21:54 | * | PurpleCow joined #nim |
07:22:36 | PurpleCow | #elementary-dev |
07:23:23 | * | filcuc joined #nim |
07:34:54 | * | Jesin joined #nim |
07:35:57 | FromGitter | <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:09 | Araq | usually you should know whether it's an atom or not. |
07:37:25 | Araq | for non-atoms use n.len directly |
07:41:17 | FromGitter | <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:47 | rokups | Araq: 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:34 | Araq | system/timers.nim needs to become an official module -.- I use it frequently too |
08:14:07 | Araq | include "$stdlib/system/timers" works though |
08:14:49 | rokups | it needs some love however. that distinct ticks type is really annoying as it breaks many math operations |
08:17:21 | Araq | well it doesn't support math operations |
08:17:41 | Araq | that distinct type keeps you from making mistakes |
08:18:51 | rokups | its 64bit integer, how number can not support math operations |
08:20:37 | Araq | https://github.com/nim-lang/Nim/issues/5146 |
08:20:52 | Araq | even with the distinct type people got it wrong :-) |
08:21:49 | Araq | vegansk: do a concrete search please |
08:22:07 | FromGitter | <vegansk> @Araq, ok |
08:24:05 | * | yglukhov joined #nim |
08:36:14 | * | Kingsquee quit (Ping timeout: 255 seconds) |
08:43:55 | rokups | Araq: timers module is weird. subtracting Ticks produces Nanos. that is so very counter intuitive :\ why is it done this way? |
08:44:29 | Araq | what should it produce instead? |
08:44:51 | FromGitter | <barcharcraz> oh wow nimscript is really cool |
08:45:04 | rokups | usually math operations produce same type, thats why this case is confusing |
08:55:35 | FromGitter | <Varriount> rokup: But time-math isn't exactly like regular math. |
08:55:51 | FromGitter | <Varriount> You get this in date calculations too. |
08:56:11 | FromGitter | <Varriount> timestamp_a - timestamp_b = time_interval |
08:57:05 | * | jinshil joined #nim |
08:57:35 | * | Kingsquee joined #nim |
08:59:30 | FromGitter | <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:30 | rokups | now 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:54 | FromGitter | <andreaferretti> every date library handles instants and intervals differently |
09:05:07 | FromGitter | <andreaferretti> the difference of two instants is an interval |
09:05:25 | rokups | we arent talking about date here however |
09:05:41 | FromGitter | <andreaferretti> well, time is mostly the same |
09:06:07 | FromGitter | <Varriount> Date is just time on a more granular scale. |
09:06:48 | rokups | maybe i am confused because i have never seen a need for difference of two monotonic clock timestamps producing another point in time |
09:07:26 | FromGitter | <Varriount> rokups: Lets say the processor starts ticks at 256, and goes up each second. |
09:08:11 | FromGitter | <Varriount> We get two ticks at different points in a program. tick_a = 300, tick_b = 400 |
09:08:30 | FromGitter | <Varriount> tick_b - tick_a == 100 |
09:08:43 | FromGitter | <Varriount> But as stated previously, ticks start at 256 |
09:09:29 | FromGitter | <Varriount> So the result of `tick_b - tick_a` cannot itself be a valid tick. |
09:09:41 | rokups | but that is not a point in time, but how long passed between ticks |
09:10:20 | FromGitter | <Varriount> Exactly. Hence why subtracting two ticks in Nim produces a Nano, rather than another tick. |
09:11:01 | rokups | ah now that you put it this way it starts to make sense. Tick is point in time and Nano is timespan |
09:11:29 | FromGitter | <Varriount> rokups: I never mentioned date in the example. |
09:11:58 | FromGitter | <Varriount> For all we know, subtracting two ticks could cause the number to wrap around. |
09:13:12 | FromGitter | <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:17 | rokups | really? hows that? |
09:14:29 | * | yglukhov quit (Ping timeout: 255 seconds) |
09:15:00 | cheatfate_ | 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:13 | FromGitter | <Varriount> rokups: If the processor uses 64-bit unsigned integers, what happens when a tick equal max_value_for_uint_64? |
09:16:35 | FromGitter | <Varriount> It rolls over. |
09:16:38 | rokups | ah that case, its not a problem when values are subtracted |
09:17:04 | rokups | been doing it since forever on windows with GetTickCount() |
09:17:28 | FromGitter | <Varriount> rokups: Yep. |
09:17:48 | FromGitter | <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:41 | rokups | cheatfate_: is it me or you just sounded like mr-know-it-all? :\ |
09:22:26 | FromGitter | <Varriount> cheatfate_ just wants is to stop filling the channel with nonsense. |
09:22:30 | FromGitter | <Varriount> :P |
09:23:01 | FromGitter | <Varriount> Or he's really anxious and wants coroutines done |
09:23:26 | rokups | well 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:58 | rokups | added that xmm/ymm saving stuff btw, gonna commit soon |
09:24:46 | * | jinshil quit (Quit: Good-bye!) |
09:26:04 | cheatfate_ | Varriount: why you just not started with `overflow`? |
09:27:11 | Araq | varriount: overflow is a problem, we pretend it doesn't exist here. that's not the reason for the types though |
09:27:37 | Araq | it won't overflow until the sun burns out anyway |
09:27:38 | FromGitter | <Varriount> cheatfate_: Didn't think to mention it, as it's an implementation detail |
09:28:10 | cheatfate_ | 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:36 | FromGitter | <Varriount> cheatfate_: Ouch. |
09:30:08 | * | ibk joined #nim |
09:30:21 | cheatfate_ | Varriount: of course there maybe more reasons why you need to run single-threaded code with timeouts? |
09:30:51 | rokups | in some sensitive environments coroutines could be only option for multitasking because threads are simply too unsafe. pretty useless yes |
09:31:03 | FromGitter | <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:17 | Araq | cheatfate_: you could be a bit friendlier. |
09:32:44 | cheatfate_ | Araq, i was friendlier, before people starts blame me |
09:33:49 | Araq | oh yeah rokups could have been a bit friendlier too |
09:34:06 | Araq | the only mr-know-it-all here is Araq. |
09:34:09 | FromGitter | <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:20 | rokups | cheatfate_: 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:52 | rokups | great, now i offended Araq ;) |
09:35:18 | * | yglukhov quit (Remote host closed the connection) |
09:35:22 | Araq | nah, software offends me, people rarely do. |
09:35:54 | * | yglukhov joined #nim |
09:37:24 | * | gangstacat joined #nim |
09:39:01 | cheatfate_ | 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:12 | FromGitter | <Varriount> -_- |
09:40:32 | rokups | didnt 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:06 | Araq | stop it guys or I will silence you for a short period of time. |
09:41:17 | FromGitter | <Varriount> God help us if programmers ever get put in positions of power. The squabbling will never end. |
09:42:03 | rokups | :) |
09:43:07 | rokups | it 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:45 | Araq | oh I read an intesting thing about that |
09:45:08 | Araq | https://www.agwa.name/blog/post/how_to_crash_systemd_in_one_tweet |
09:46:38 | rokups | yeah, bugs do happen everywhere. plenty of software (and even linux kernel) get worse bugs but most triggered people are antisystemd crowd |
09:49:15 | FromGitter | <Varriount> And of course you have the rust promoters saying how it would have never happened if it was implemented in rust |
09:50:10 | FromGitter | <Varriount> Completely ignoring Python, Java, C#, and the fact that nothing can completely prevent logic bugs |
09:50:45 | rokups | haha 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:20 | rokups | imo they have outdone c++ in complexity. exactly what we needed |
09:51:54 | rokups | im 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:26 | cheatfate_ | Varriount: what is `subexes` module, is it part of stdlib? |
10:18:37 | FromGitter | <Varriount> cheatfate_: https://nim-lang.org/docs/subexes.html |
10:19:00 | FromGitter | <barcharcraz> is that new? |
10:19:07 | FromGitter | <Varriount> Nope. Been present for a while. |
10:19:19 | * | cheatfate_ is now known as cheatfate |
10:19:25 | FromGitter | <Varriount> Personally, I'd prefer it to be merged with strutils, but Araq is the one who wrote it originally. |
10:19:32 | cheatfate | Varriount: thanks |
10:19:47 | FromGitter | <Varriount> There's no need to have two different string formatting procedures in the standard library. |
10:19:58 | FromGitter | <barcharcraz> isnt there a format proc (and `%`s) in strutils |
10:20:24 | FromGitter | <Varriount> @barcharcraz Yes, but it does simple substitution on. |
10:20:26 | FromGitter | <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:24 | FromGitter | <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:04 | FromGitter | <Varriount> @dom96 possibly a performance increase? |
11:12:09 | * | filcuc quit (Read error: Connection reset by peer) |
11:15:59 | FromGitter | <vegansk> @Araq, when I initialized GC via setupForeignThreadGc, how can I deinitialize it before my foreign thread is finished? |
11:22:58 | Araq | oh you need to expose osDeallocAllPages or something for that |
11:29:14 | rokups | Varriount coroutines will likely be slower than closure iterators. iterators dont do any kind of context switching right? |
11:30:34 | rokups | speaking 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:12 | PMunch | Is this the expected way that nimble should fail in this case: http://ix.io/1SUe ? |
11:42:10 | * | Guest48471 left #nim ("Leaving") |
11:42:12 | FromGitter | <Varriount> rokups: closure iterators are composed of a function pointer and a pointer to a structure containing the closures state. |
11:43:03 | rokups | ant it does not store/restore registers on every yield so to me it seems they would still be faster |
11:43:21 | FromGitter | <Varriount> Well, it depends. |
11:44:02 | FromGitter | <Varriount> A function call, especially one that used cdecl, pushes/pops registers |
11:45:14 | rokups | sure, 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:35 | rokups | which on windows x64 is twice as expensive too due to xmm registers |
11:45:47 | rokups | PMunch: it says package is not found |
11:46:04 | PMunch | Yeah I know |
11:46:18 | FromGitter | <Varriount> Hm. I'd be interested in real-world performance comparisons |
11:46:21 | PMunch | I just found it weird that it first fails with a message, then by what looks like a crash |
11:46:58 | rokups | PMunch: 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:09 | FromGitter | <dom96> rokups: then what's the advantage that coroutines bring? |
11:51:47 | FromGitter | <dom96> PMunch: Did you compile it in release mode? |
11:51:57 | FromGitter | <barcharcraz> can iterators call each other |
11:51:57 | FromGitter | <dom96> Well, I know the answer to that. |
11:52:32 | FromGitter | <dom96> Nimble only shows those stack traces when it's compiled in debug mode. |
11:54:38 | PMunch | Not sure to be honest dom96 |
11:54:41 | rokups | dom96 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:41 | rokups | speedups can be gained but not because coroutines are somehow faster than simple linear code but because waiting on IO is slow. |
11:54:42 | PMunch | But I don't think I did |
11:55:12 | PMunch | On this machine it's probably just a "koch tools" or whatever the command is |
11:55:27 | rokups | koch nimble |
11:55:36 | rokups | we probably should have added -d:release as well |
11:55:44 | FromGitter | <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:21 | rokups | dom96 but is it possible to yield from arbitrary possition deep down the callstack? |
11:56:48 | FromGitter | <dom96> rokups: nope. And that's the main advantage that I see with coroutines. |
11:56:57 | FromGitter | <dom96> Although this wasn't a problem for me so far. |
11:57:46 | FromGitter | <dom96> But please keep in mind that I don't want to discourage you. Just curious what coroutines are good at. |
11:58:30 | FromGitter | <dom96> PMunch: perhaps ``koch nimble`` doesn't compile in release mode. That's a ``koch`` bug then :) |
11:58:48 | rokups | nah 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:24 | rokups | python had something similar done, and then they added `yield from` to mitigate this same limitation |
11:59:50 | rokups | so 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:48 | FromGitter | <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:48 | FromGitter | ... yield from anywhere. |
12:03:37 | rokups | sounds like python's `yield from` |
12:04:28 | cheatfate | dom96, 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:59 | cheatfate | dom96, but of course main flaw is `fixed uncontrollable stack`. |
12:05:10 | * | bjz_ joined #nim |
12:05:13 | FromGitter | <dom96> I dunno, all this ASM seems like it will be rather difficult to debug. |
12:06:09 | cheatfate | dom96, all this ASM is only for `context switch` you don't need to debug it |
12:06:26 | FromGitter | <barcharcraz> but even with true coroutiens you still need some kind of handle to resume them from (and to call select on). |
12:06:57 | FromGitter | <barcharcraz> the asm is not that bad afaik |
12:07:01 | * | bjz quit (Ping timeout: 240 seconds) |
12:07:51 | cheatfate | barcharcraz: problem with ASM is that you need to implement such procedures for all architectures nim supports, because current coroutines supports only `intel`. |
12:08:15 | FromGitter | <barcharcraz> I think you can implement most of it in nim |
12:08:24 | FromGitter | <barcharcraz> but the actual context switching probably not |
12:08:36 | FromGitter | <barcharcraz> sec |
12:09:08 | * | filcuc joined #nim |
12:09:34 | flyx | so 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:45 | rokups | for 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:10 | rokups | we could probably manage to switch stack without asm, but nim gc needs to inspect registers as well.. |
12:10:35 | rokups | it used something else for this though, but that thing is deprecated |
12:10:51 | FromGitter | <dom96> flyx: yeah, I need to write an update. Sorry. |
12:11:19 | FromGitter | <barcharcraz> I'm not sure you can do it with sjlj |
12:12:04 | rokups | isnt that c++ exceptions? |
12:12:14 | FromGitter | <barcharcraz> no |
12:12:23 | FromGitter | <barcharcraz> again that's still one thread of control |
12:12:28 | FromGitter | <barcharcraz> you can't switch between stacks |
12:12:56 | * | couven92 joined #nim |
12:13:21 | PMunch | Is there a way to install a nimble package from a local directory? |
12:15:06 | FromGitter | <dom96> PMunch: ``cd dir/ && nimble install`` |
12:15:20 | FromGitter | <barcharcraz> fibres (for windows) and ucontext for posix |
12:15:21 | FromGitter | <barcharcraz> https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/x86_64/getcontext.S |
12:15:31 | rokups | A 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:38 | rokups | sounds like c++ exceptions alright |
12:15:53 | PMunch | Aaah, without the name :) |
12:16:06 | PMunch | I tried to do "nimble install 'name'" |
12:16:55 | rokups | ucontext.h is deprecated though |
12:21:59 | FromGitter | <barcharcraz> not for a good reason though |
12:22:15 | FromGitter | <barcharcraz> and the machenery for context switching should still work |
12:23:49 | rokups | ahh now i see. nim gc uses not ucontext but c_setjmp(registers) # To fill the C stack with registers. |
12:24:01 | rokups | and i implemented custom function because glibc mangles some registers |
12:24:26 | rokups | but now i wonder if there even was a point.. |
12:24:55 | PMunch | http://ix.io/1SUr what am I doing wrong here? |
12:25:13 | FromGitter | <barcharcraz> it's actually not clear if using full cooperative tasks is much benifit over many threads all waiting on one CV |
12:26:42 | FromGitter | <dom96> PMunch: Your `examples` directory will be installed, so the user will be able to `import examples/callbacks` |
12:26:56 | FromGitter | <dom96> i.e. your package encroaches on another package's namespace |
12:27:38 | FromGitter | <dom96> The suggestion that Nimble gives is spot on. |
12:27:44 | FromGitter | <dom96> Add the ``skipDirs`` option |
12:28:03 | PMunch | As you can see from the cat mqtt.nimble part I already have that in there.. |
12:28:10 | PMunch | But maybe in the wrong spot? |
12:28:54 | FromGitter | <dom96> Oh, I missed that sorry |
12:29:24 | FromGitter | <dom96> You're using the old ini .nimble format |
12:29:38 | FromGitter | <dom96> I'm surprised that parses correctly |
12:29:54 | FromGitter | <dom96> best thing to do is move to the new format |
12:30:31 | FromGitter | <dom96> Example here: https://github.com/nim-lang/nimble#creating-packages |
12:30:48 | PMunch | Yeah, it's an old package from two years ago which I'm trying to see if I can get working :P |
12:31:17 | PMunch | Thanks for the link. I'll look into it :) |
12:31:21 | * | devted joined #nim |
12:41:39 | rokups | barcharcraz 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:30 | rokups | Araq: 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:06 | Araq | rokups: well it will replaced with your inline assembler of course |
12:43:11 | Araq | *will be |
12:43:46 | rokups | but it adds constraints on supported platforms. i was wondering maybe you have some great idea how to avoid that ^_^ |
12:44:14 | FromGitter | <barcharcraz> rokups, pull the assembly from an existing libc |
12:45:41 | rokups | well 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:11 | FromGitter | <barcharcraz> you need to use assembly to do sjlj afaik |
12:51:22 | FromGitter | <barcharcraz> I mean for one you need to actually read the whole register file |
12:51:41 | FromGitter | <barcharcraz> also different architectures tend to allow access to the program counter in different ways |
12:52:02 | Araq | rokups: well msvcrt dep is only an issue for Windows, so only Windows needs to use inline asm |
12:52:33 | Araq | though that's 3-4 cpu archs, so not much gained |
12:54:40 | FromGitter | <barcharcraz> also I'm not sure sjlj is sufficient for coroutines, you need multiple stacks |
13:00:06 | cheatfate | Araq, 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:35 | FromGitter | <barcharcraz> yeah |
13:13:44 | FromGitter | <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:48 | rokups | well ucontext is deprecated so not sure its wise to get in bed with something that is uncertain to exist in the future |
13:36:09 | FromGitter | <barcharcraz> it will exist |
13:36:22 | rokups | cheatfate: 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:38 | rokups | one thing i do not like is setjmp use for getting registers with glibc |
13:36:42 | rokups | ir mangles rbp register |
13:36:51 | rokups | possible memleak there? |
13:37:47 | rokups | as for ucontext: http://duriansoftware.com/joe/PSA:-avoiding-the-%22ucontext-routines-are-deprecated%22-error-on-Mac-OS-X-Snow-Leopard.html |
13:38:02 | rokups | kind 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:10 | FromGitter | <barcharcraz> ugh, maybe they have their own api |
13:40:13 | FromGitter | <barcharcraz> not sure |
13:46:39 | cheatfate | {.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:38 | FromGitter | <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:37 | rokups | will read. i used them for similar thing in c++ and they worked ok though |
14:07:43 | FromGitter | <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:16 | rokups | ohh 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:02 | rokups | second 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:44 | FromGitter | <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:26 | FromGitter | <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:36 | FromGitter | <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:36 | rauss | oops ^ |
15:30:38 | demi- | 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:23 | FromGitter | <Varriount> demi-: You're asking about whether c2nim was ever meant to port objective C? |
16:00:34 | * | Sentreen joined #nim |
16:00:53 | demi- | no, i'm asking if c2nim ever considered using existing tooling for parsing C instead of writing its own C lexer |
16:01:08 | demi- | and if it did, why did it not choose to use existing tooling |
16:05:26 | Araq | demi-: simple. c2nim predates libclang by years. |
16:07:34 | demi- | 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:40 | Araq | yup |
16:08:50 | Araq | I'm not married to c2nim either |
16:09:01 | Araq | you could replace its custom parser by libclang |
16:09:35 | Araq | a couple of people promised to do that, never got a line of code from them though ;-) |
16:09:56 | Araq | "talk is cheap, show me the code" and all that |
16:10:12 | demi- | 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:51 | Araq | yeah well, if you care about Cocoa chances are high you don't handle C++ |
16:14:26 | Araq | c2nim can deal with a large subset of C++ too, so your tool would be an addition, not a replacement. |
16:14:36 | Araq | nothing wrong with that, of course. |
16:14:44 | demi- | 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:01 | Araq | parsing is the easier step. |
16:15:12 | Araq | you need to map the C++ constructs to Nim constructs :P |
16:15:52 | demi- | 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:31 | Araq | that 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:25 | demi- | 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:47 | FromGitter | <Varriount> I've used GCC's preprocessor mode along with regex find/replace to process macro-heavy code. |
16:32:07 | Araq | https://nim-lang.org/download/nim-0.16.1_x32.zip |
16:32:20 | Araq | https://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:31 | demi- | yay! |
16:32:33 | Araq | would be nice if somebody could test these |
16:32:40 | Araq | in particular the finish.exe tool |
16:32:52 | Araq | demi-: sorry, Windows only. |
16:33:00 | demi- | awww |
16:33:05 | Araq | the other OSes have working C compilers out of the box :P |
16:33:11 | FromGitter | <Varriount> I might be able to quickly test the case where no mingw is present |
16:33:34 | Araq | varriount: finish can download and unzip |
16:33:48 | FromGitter | <Varriount> Araq: What about android? We need a Nim installer for that. :P |
16:34:25 | Araq | I know nothing about Android, cannot prepare releases for it |
16:41:00 | cheatfate | Araq, i thought release must 0.16.2? |
16:41:19 | cheatfate | why it only 0.16.1 |
16:44:13 | * | brson joined #nim |
16:46:23 | * | Trustable joined #nim |
16:50:08 | Araq | it's not a release |
16:50:22 | Araq | it's just so that more people test it before it becomes 0.16.2 |
16:52:59 | rokups | Araq: 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:30 | PMunch | Hmm, 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:28 | dom96 | PMunch: good question |
17:34:01 | dom96 | There might be room for improvement here |
17:34:32 | Araq | getStackTrace(e) exists |
17:34:32 | dom96 | Another 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:39 | dom96 | Araq: but getStackTrace accesses the .trace field |
17:35:39 | * | yglukhov quit (Read error: Connection reset by peer) |
17:38:09 | Araq | so? it's private for a reason |
17:38:11 | * | yglukhov joined #nim |
17:38:39 | dom96 | Yes, I guessed that. But I am curious what that reason is |
17:38:49 | dom96 | I 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:44 | PMunch | Define a procedure trace(e:Exception): string ? |
17:49:58 | PMunch | Instead of getStackTrace |
17:50:15 | PMunch | Well, I guess getStackTrace is fine |
17:53:34 | * | carterza joined #nim |
18:03:28 | * | PMunch quit (Quit: leaving) |
18:04:39 | FromGitter | <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:15 | demi- | 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:07 | FromGitter | <Varriount> demi-: Could you paste a code example? |
18:20:27 | demi- | sure, sec |
18:23:34 | demi- | https://gist.github.com/4fcedb841f744558aea2c4256ffa67cd |
18:24:13 | demi- | 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:46 | Vladar | demi-: replace let with var |
18:24:59 | demi- | on `foo`? |
18:25:14 | Vladar | yes, let has no address |
18:27:44 | demi- | rad, thank you Vladar |
18:28:00 | Vladar | np |
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:03 | Araq | rokups: I don't know |
19:53:10 | Araq | VS 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:48 | filcuc | Araq: ping |
21:00:02 | Araq | s |
21:00:13 | filcuc | Araq: i'm playing with nimsuggest |
21:00:33 | filcuc | and i'm don't get what's the project.nim file meaning |
21:01:07 | filcuc | given that i have to pass a filename in the sug command |
21:01:28 | filcuc | for specifying a suggestion for a particular file |
21:01:38 | filcuc | does it have a special meaning? |
21:03:13 | * | bjz joined #nim |
21:03:46 | filcuc | :) |
21:05:20 | Araq | have you ever used an IDE? |
21:05:42 | Araq | name me a single one that doesn't have a notion of a "Project" |
21:06:01 | Araq | why is that? |
21:06:04 | FromGitter | <Varriount> filcuc: It's the main Nim file for whatever project you're looking at. |
21:06:18 | FromGitter | <Varriount> It's used to gather imports correctly |
21:06:28 | filcuc | Araq: yes but i don't get why it should be necessary for nimsuggest |
21:06:49 | filcuc | Araq: honestly i would have thought to just spawn a service and be done with it |
21:07:06 | FromGitter | <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:08 | filcuc | Araq: and asking for a particular file suggestion by using "sug filename:row:col" |
21:07:49 | filcuc | Varriount: ok but it seems like a workaround... |
21:08:15 | * | xet7 joined #nim |
21:08:21 | demi- | 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:05 | filcuc | demi-: ok that makes sense |
21:09:21 | filcuc | demi-: Araq that what's i was asking for |
21:09:22 | demi- | 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:57 | Araq | well for a start |
21:10:10 | Araq | the 'sug' command can refer to an include file |
21:10:38 | Araq | and the compiler needs to know where it's included from to be able to suggest anything meaningful |
21:11:12 | Araq | and that's what it does, it knows the module that includes it and compiles that instead |
21:12:07 | Araq | or another example: it needs to know the configuration, like the --paths you setup |
21:13:07 | filcuc | Araq: so in the case the *IDE* enables the user to dynamically change the "main" .nim file i should spawn multiple nimsuggests |
21:13:30 | filcuc | Araq: for example if the user would like to run some test in a particular .nim file (that's not the main file) |
21:13:50 | filcuc | Araq: initially i would have thought having only one nimsuggest instance |
21:14:18 | filcuc | Araq: what i read so far suggest that it's not true: i should have multiple nimsuggest instances one for each "main" file |
21:14:50 | Araq | yup. though there is support for |
21:15:05 | filcuc | Araq: for example in the QtCreator plugin the user can change through a ComboBox it's "main" file |
21:15:05 | Araq | "sug new_file_not_part_of_the_project" |
21:15:35 | filcuc | :| |
21:16:22 | filcuc | Araq: 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:42 | Araq | yeah it should |
21:16:52 | Araq | but I have no test case for it :-) |
21:16:57 | Araq | should write one. |
21:17:02 | filcuc | Araq: 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:27 | filcuc | Araq: and force the user to use "sug path_to_.nim:row:col" |
21:18:06 | Araq | because 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:50 | filcuc | Araq: :| |
21:19:21 | filcuc | Araq: and why can't do the same thing it does at beginning with (nimsuggest project.nim) everytime i use "sug other.nim" |
21:19:32 | filcuc | Araq: eventually caching some info |
21:19:34 | Araq | you don't need to highlight me every single time |
21:19:56 | filcuc | sorry |
21:22:31 | * | yglukhov joined #nim |
21:23:26 | Araq | because 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:53 | Araq | the compiler wasn't written with this idea in mind. though every compiler refactoring makes it better |
21:23:56 | * | yglukhov joined #nim |
21:24:14 | Araq | and less dependent on global state |
21:25:16 | Araq | that 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:48 | filcuc | Araq: i do understand your point, i'm just reflecting |
21:27:11 | filcuc | and clarifying myself by asking questions |
21:27:24 | filcuc | and for integrating correctly nimsuggest |
21:27:37 | Araq | and just fyi I'm watching Interstellar and it's so boring it makes me aggressive |
21:28:13 | Araq | :-) |
21:28:29 | filcuc | i somewhat sensed it |
21:28:33 | filcuc | :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:28 | demi- | 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:31 | PMunch | dom96, Araq: how does graphics work? |
22:09:37 | PMunch | https://github.com/nim-lang/graphics |
22:09:42 | PMunch | That one specifically |
22:09:56 | dom96 | https://github.com/nim-lang/graphics/blob/master/graphics.nim#L504 |
22:09:59 | PMunch | Would be nice with a minimal example file to show setup and stuff |
22:10:15 | dom96 | it needs to be ported to sdl2 |
22:10:18 | dom96 | PRs welcome ) |
22:10:19 | dom96 | :) |
22:10:19 | PMunch | Aaah |
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:43 | shashlick | how do you update nimble? and nim for that matter? uninstall/reinstall? |
23:51:45 | shashlick | I 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:14 | shashlick | checking out of github and building gives me 0.8.4 |