00:07:22 | * | Trustable quit (Remote host closed the connection) |
00:09:23 | * | wildlander quit (Quit: Konversation terminated!) |
00:16:55 | * | fthe quit (Ping timeout: 250 seconds) |
00:21:54 | shashlick | @mratsim: that screenshot of the performance per proc is nifty |
00:22:03 | shashlick | How'd they get that |
00:22:33 | shashlick | You looks like |
00:25:22 | shashlick | edcragg: list.head is not a ref object |
00:36:04 | FromGitter | <mratsim> @shashlick, Apple Instruments |
00:36:26 | FromGitter | <mratsim> it’s the time profiler |
00:38:53 | * | zachk quit (Quit: Leaving) |
00:45:21 | shashlick | Mac only then |
00:46:10 | FromGitter | <mratsim> Intel VTune can give the same data |
00:46:15 | shashlick | Nim devel is still broken with nimble packages |
00:46:17 | FromGitter | <mratsim> and `perf` as well |
00:46:23 | shashlick | Will check it out |
01:00:55 | edcragg | shashlick: ah yes, indeed, thanks |
01:03:15 | * | ng0 quit (Remote host closed the connection) |
01:03:50 | shashlick | I don't know if it's possible to get a ref to an existing object |
01:04:13 | * | ng0 joined #nim |
01:08:21 | * | Notkea joined #nim |
01:17:20 | * | smt quit (Quit: Leaving) |
02:06:07 | * | lritter joined #nim |
02:14:33 | * | rayman22201 quit (Ping timeout: 256 seconds) |
02:16:17 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
02:18:59 | * | kapil____ quit (Quit: Connection closed for inactivity) |
02:23:41 | * | kapil____ joined #nim |
02:30:21 | FromGitter | <deech> What is the difference between `let i {.compileTime.} : int = 0` and `const i : int = 0`? |
02:31:23 | shashlick | If compile time only then i won't be present at runtime |
02:31:41 | shashlick | const i will be present at runtime |
02:32:12 | shashlick | That's my experience at least |
02:33:33 | FromGitter | <deech> So the following `echo ...` is be a compile time error? ⏎ ⏎ ```let i {.compileTime.} = 0 ⏎ echo i``` [https://gitter.im/nim-lang/Nim?at=5c15b97cc428e9539d461c9f] |
03:08:48 | * | banc quit (Quit: Bye) |
03:17:05 | shashlick | looks like you found a bug |
03:17:21 | shashlick | it compiles fine in Nim but the resulting C code doesn't compile |
03:24:54 | * | Tyresc quit (Quit: WeeChat 2.3-dev) |
03:25:00 | FromGitter | <deech> I reported it. https://github.com/nim-lang/Nim/issues/9970. I was going to take a shot at fixing it and wanted to know if it was supported behavior. |
03:25:00 | * | banc joined #nim |
03:25:38 | shashlick | i'm not really sure if it's a regression or not |
03:26:22 | shashlick | if you try `static: echo i` it will print at compile time |
03:33:12 | FromGitter | <deech> Is there ever a time when the `{.compileTime.}` does something different from`static: ...`?. |
03:54:18 | * | onionhammer quit (Quit: WeeChat 1.9.1) |
04:28:11 | * | rayman22201 joined #nim |
04:32:06 | * | theelous3 quit (Ping timeout: 250 seconds) |
04:35:08 | * | abm quit (Ping timeout: 250 seconds) |
04:38:39 | * | banc quit (Ping timeout: 250 seconds) |
04:45:22 | * | banc joined #nim |
04:48:08 | * | lritter quit (Ping timeout: 250 seconds) |
04:48:58 | * | lritter joined #nim |
04:52:08 | FromGitter | <timotheecour> @araq @nc-x @kaushalmodi @narimiran I fixed the nims regression here: https://github.com/nim-lang/Nim/pull/10007 |
05:01:23 | * | gmpreussner_ joined #nim |
05:01:43 | * | gmpreussner quit (Ping timeout: 245 seconds) |
05:31:52 | * | dddddd quit (Remote host closed the connection) |
05:34:34 | FromDiscord_ | <exelotl> yeet https://i.imgur.com/YcpoABl.png |
05:39:53 | shashlick | @timotheecour: does it fix the nimble issue as well? |
05:42:11 | * | nc-x joined #nim |
05:45:12 | nc-x | @timotheecour haven't looked at your changes, but they seem wrong because https://travis-ci.org/nim-lang/Nim/builds/468568083 travis has been going for 2 hours. |
05:47:56 | nc-x | But travis should have timed out by now. |
05:48:04 | nc-x | So no idea what is going on here. |
05:48:15 | FromGitter | <zacharycarter> exelotl: nice |
05:49:19 | nc-x | shashlick: most probably not. Because nimble isn't broken due to nimscript changes. |
05:50:50 | nc-x | Anyone having access to nim-lang travis account? I think they should stop the above mentioned travis build. |
05:51:25 | nc-x | Araq, dom96, narimiran ^^^ |
05:52:00 | FromGitter | <timotheecour> @nc-x but my local travis succeeded: https://travis-ci.com/timotheecour/Nim/builds/94882738 |
05:53:03 | FromGitter | <timotheecour> > I think they should stop the above mentioned travis build. ⏎ ⏎ IIRC travis already has a timeout feature |
05:55:20 | nc-x | No idea then what is going on here. |
05:56:45 | FromGitter | <timotheecour> @nc-x also, you’re looking at the wrong travis for a past commit (which was updated since) |
05:57:33 | FromGitter | <timotheecour> the one for the correct commit (that succeeded on my local travis) is still queued: https://travis-ci.org/nim-lang/Nim/builds/468574011?utm_source=github_status&utm_medium=notification |
05:59:24 | nc-x | Yes this commit no longer exists because you force-pushed |
06:00:15 | FromGitter | <timotheecour> Yup; i could try to kill travis for old travis job but is that really needed? (it’ll timeout as per usual) |
06:01:28 | FromGitter | <timotheecour> @shahlick @nc-x regarding nimble issue, whats the link again? |
06:01:29 | nc-x | The timeout is 50 (or 60) minutes AFAIK but it has been going for 2 hours. |
06:01:42 | * | narimiran joined #nim |
06:02:03 | nc-x | @timotheecour https://github.com/nim-lang/Nim/issues/9991 |
06:02:42 | FromGitter | <timotheecour> the please submit a bug report regarding fact that travis didn’t timeout (even if u immediately close that bug report, we’ll have a placeholder to investigate) |
06:03:45 | FromGitter | <timotheecour> just checked: nimble issue not fixed by my PR, its a separate issue |
06:15:55 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:16:05 | nc-x | Well, i don't know whether to open the bug in travis repo on nim repo. It could very well be a travis bug. Travis also timeouts if there is no output for 10 minutes.Here it has been stuck with no new output for a very long time.' |
06:17:39 | FromGitter | <timotheecour> its probably a travis bug but it affects us, so maybe open and close, so we have a placeholder for further discussion |
06:18:16 | FromGitter | <timotheecour> and we can also report to travis but theyre extremely unresponsive from multiple past experiences |
06:18:56 | FromGitter | <zacharycarter> will destructors work with gc:none ? |
06:19:02 | FromGitter | <zacharycarter> I take it no? |
06:22:24 | nc-x | They should work I think |
06:22:48 | nc-x | But right now they are behind --gc:destructors AFAIK |
06:23:03 | nc-x | Once the work will be completed, they should work with every gc |
06:23:08 | nc-x | That's my guess |
06:24:36 | FromGitter | <zacharycarter> yeah - they definitely don't seem to |
06:24:50 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c15efb2ae1ab5539ef346d6] |
06:24:54 | FromGitter | <zacharycarter> prints 0 |
06:25:20 | FromGitter | <zacharycarter> and doesn't compile with `--gc:destructors` |
06:26:09 | nc-x | @timotheecour https://github.com/nim-lang/Nim/issues/10013 |
06:26:57 | nc-x | zacharycarter: I think cdome/cooldome uses destructors a lot. He or Araq might be able to answer your questions better. |
06:26:59 | * | anamok joined #nim |
06:27:01 | anamok | hello |
06:27:08 | FromGitter | <zacharycarter> I guess I could potentially use `gc:none` and instead of destructors, implement my own destroy method on all my objects |
06:27:11 | FromGitter | <zacharycarter> but it sounds very hacky |
06:27:27 | FromGitter | <zacharycarter> nc-x: from my understanding they're not ready... |
06:27:31 | anamok | Can we store functions in an array? |
06:27:42 | FromGitter | <zacharycarter> you can store pointers to them in an array |
06:28:31 | FromGitter | <zacharycarter> meh - I'll just continue on my C++ journey |
06:28:35 | nc-x | In --gc:destructors, gc is only run for refs AFAIK, so that should work fine instead of --gc:none. But, that is, if you think they are ready enough. |
06:28:38 | FromGitter | <zacharycarter> at least there I'm making progress |
06:29:51 | anamok | zacharycarter: Do you have an example? Let's take this function: `func twice(n: int) = 2 * n`. How to store it in an array? Then how to use it from the array? |
06:32:29 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c15f17d539aca60b21951ac] |
06:33:18 | FromGitter | <zacharycarter> sorry |
06:33:23 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c15f1b30a86bc6f8db60b8f] |
06:34:16 | * | kungtotte joined #nim |
06:34:32 | FromGitter | <zacharycarter> nc-x: well `gc:detructors` won't compile on 0.19.0 or devel - so IME it's not worth exploring |
06:35:59 | * | nsf quit (Quit: WeeChat 2.3) |
06:39:27 | anamok | zacharycarter: Thanks! |
06:39:37 | FromGitter | <zacharycarter> sure thing |
06:40:35 | shashlick | I don't see why it is stuck |
06:40:37 | shashlick | i can kill it |
06:41:50 | nc-x | zacharycarter: Ah! In that case, yeah, either you will have to wait some time. Or write in some other language. Or do without destructors. |
06:42:01 | nc-x | shashlick: Okay. Thank you. |
06:43:32 | FromGitter | <zacharycarter> well I need both destructors and hot code reloading heh |
06:43:59 | FromGitter | <zacharycarter> so yeah - C++ it is |
06:44:00 | shashlick | nc-x: should I restart it? |
06:45:38 | nc-x | shashlick: Nope |
06:45:47 | nc-x | That commit is no longer in use anywhere |
06:46:03 | shashlick | okay cool |
06:46:32 | nc-x | @zacharycarter: 👍 |
06:50:21 | nc-x | Looks like a travis bug to me. No new build is being started. https://travis-ci.org/nim-lang/Nim/pull_requests. |
06:52:07 | * | ftsf joined #nim |
06:55:59 | * | vlad1777d joined #nim |
07:06:40 | * | nc-x quit (Quit: Page closed) |
07:18:55 | * | vlad1777d quit (Ping timeout: 246 seconds) |
08:02:07 | * | narimiran quit (Ping timeout: 240 seconds) |
08:16:02 | anamok | zacharycarter: When I call a function from an array, is there a way to figure out the function's name (from inside the function)? |
08:16:52 | anamok | So I call a function from an array, and I want to know the name of the function that was just called. |
08:17:10 | FromGitter | <zacharycarter> at runtime? |
08:17:17 | anamok | Yes. |
08:17:45 | FromGitter | <zacharycarter> in a debug build you can use `getFrame().procname` - but that won't be available in a release build |
08:18:27 | FromGitter | <zacharycarter> if you're calling the function - don't you already know its name? |
08:18:39 | FromGitter | <zacharycarter> I'm not sure what you're trying to do - that's why I'm asking questions |
08:19:06 | FromGitter | <zacharycarter> can you do this in C? |
08:20:05 | anamok | I have an array that contains lots of function pointers. I call each of them with some input and if the return value satisfies a condition, I want to know which function produced the good output. |
08:20:41 | * | dorelix quit (Remote host closed the connection) |
08:21:12 | anamok | I have a workaround idea. |
08:21:33 | anamok | I build another array with function names as strings. |
08:21:34 | FromGitter | <zacharycarter> okay |
08:21:49 | FromGitter | <zacharycarter> it sounds like you need an associative array |
08:21:52 | FromGitter | <zacharycarter> or a map |
08:22:08 | FromGitter | <zacharycarter> in Nim's case - a table |
08:22:31 | anamok | thanks, now I can proceed |
08:23:45 | FromGitter | <zacharycarter> sure thing |
08:52:08 | * | xet7 quit (Ping timeout: 245 seconds) |
08:53:16 | * | stefanos82 joined #nim |
08:58:14 | * | xet7 joined #nim |
08:59:25 | * | azuri5 joined #nim |
09:31:03 | * | rockcavera quit (Read error: Connection reset by peer) |
09:31:52 | * | rockcavera joined #nim |
09:31:52 | * | rockcavera quit (Changing host) |
09:31:52 | * | rockcavera joined #nim |
09:48:42 | * | nsf joined #nim |
09:49:15 | * | azuri5 quit (Quit: azuri5) |
09:49:58 | * | narimiran joined #nim |
10:09:36 | anamok | bye |
10:09:43 | * | anamok quit (Remote host closed the connection) |
11:00:48 | * | lritter quit (Ping timeout: 250 seconds) |
11:05:42 | * | azuri5 joined #nim |
11:06:36 | * | azuri5 quit (Client Quit) |
11:09:04 | * | endragor joined #nim |
11:17:18 | * | vlad1777d joined #nim |
11:18:59 | * | kapil____ quit (Quit: Connection closed for inactivity) |
11:20:25 | * | endragor quit (Remote host closed the connection) |
11:21:15 | FromGitter | <mratsim> @zacharycarter gc:destructors is only implemented for seq and strings by default, otherwise you need to create your own object type with =destroy. |
11:21:33 | FromGitter | <mratsim> gc:none prevents you from using any ref, seq string |
11:21:44 | FromGitter | <mratsim> gc:destructor will fallback to ref counting for ref. |
11:22:42 | * | endragor joined #nim |
11:26:02 | * | ng0 joined #nim |
11:30:18 | * | nc-x joined #nim |
11:34:51 | nc-x | Araq: Regarding nimscript stuff -> I think the best way forward is to have a cleaned up mini-system.nim, There are too many arguments that the compiler can take, so it is pretty difficult to test them all. Also, `cmdlinehelper.nim` would become a mess if we keep putting all the hacks there. |
11:36:55 | * | azuri5 joined #nim |
11:46:59 | * | vlad1777d quit (Remote host closed the connection) |
11:48:54 | * | vlad1777d joined #nim |
11:49:07 | * | ftsf quit (Ping timeout: 240 seconds) |
11:50:11 | * | kapil____ joined #nim |
11:58:11 | * | Perkol joined #nim |
11:58:56 | nc-x | And it would probably be a good time to split up system.nim into multiple parts so that mini-system.nim can use some of those parts. Else there will be too much code duplication. |
11:59:51 | * | nc-x quit (Quit: Page closed) |
12:12:18 | * | Perkol quit (Ping timeout: 250 seconds) |
12:18:12 | * | endragor quit (Remote host closed the connection) |
12:19:52 | * | endragor joined #nim |
12:21:12 | Araq | nc-x: agreed. The common stuff can be put into an include file |
12:24:21 | * | endragor quit (Ping timeout: 246 seconds) |
12:25:04 | * | dddddd joined #nim |
12:30:19 | FromGitter | <Clyybber> Araq: Can we use concepts in the stdlibrary/system.nim yet? |
12:35:23 | * | elrood joined #nim |
12:48:19 | * | nc-x joined #nim |
12:50:09 | nc-x | @Clyybber Currently concepts lead to slow compile times https://github.com/nim-lang/Nim/issues/9422, and so some people are against using concepts in the compiler/stdlib till (atleast) this is fixed. |
12:50:53 | * | nc-x quit (Client Quit) |
13:11:38 | FromGitter | <Clyybber> Oh, so no progress on that :( |
13:13:55 | * | fthe joined #nim |
13:22:47 | * | azuri5 quit (Quit: azuri5) |
13:27:09 | FromDiscord_ | <Fumbleforce> How can I get the string value of an enum? |
13:27:39 | * | theelous3 joined #nim |
13:28:41 | FromGitter | <Clyybber> Have you tried `$`? |
13:29:28 | * | azuri5 joined #nim |
13:29:45 | FromDiscord_ | <Fumbleforce> Um, I totally forgot about that operator! thanks! |
13:31:38 | FromGitter | <Clyybber> Np |
13:33:03 | * | nsf quit (Quit: WeeChat 2.3) |
13:35:54 | * | elrood quit (Remote host closed the connection) |
13:39:47 | FromGitter | <GULPF> @Araq Does `{.push debugger:off.}` still have a purpose in the stdlib or can it be removed? Newer modules don't have it. |
13:47:55 | * | ftsf joined #nim |
13:55:48 | * | slug_ joined #nim |
14:06:51 | * | slug_ quit (Ping timeout: 256 seconds) |
14:08:57 | FromDiscord_ | <PusiteGA> are there securewebsockets in nim |
14:10:32 | FromGitter | <zacharycarter> @mratsim - that's what I'm after, so I can introduce RAII semantics |
14:10:34 | FromGitter | <zacharycarter> and custom allocators |
14:11:05 | FromGitter | <zacharycarter> and I don't want to deal with thread local storage |
14:11:21 | FromGitter | <zacharycarter> not sure if gc:destructors get me there or not - I guess if I just don't use any refs? |
14:14:05 | * | NimBot joined #nim |
14:22:53 | * | Snircle joined #nim |
14:35:07 | fthe | man, AOC day 12 (pt2) is killing me |
14:38:07 | narimiran | fthe: day 12 was the most boring for me |
14:39:13 | fthe | My plants are growing by 1 to the right every generation, so while I got pt1, with pt2 my plant array/string is growing towards 50bn... |
14:44:51 | * | abm joined #nim |
14:46:37 | fthe | narimiran: I'm actually reading your solution, but I really don't get that early exit trick you are using |
14:48:38 | narimiran | fthe: try to print for example 200th, 201st, 202nd generation |
14:48:47 | narimiran | you'll notice a pattern |
14:49:55 | fthe | I see. Wow. I guess you really have to figure out that the automaton will "stabilize" at one point |
14:51:15 | narimiran | fthe: that 'figure out' part is why i find that task meh |
14:51:50 | narimiran | well, at least i've solved it, unlike day15, which i didn't even bother to read till the end |
14:52:26 | edcragg | the last few have been very, lets say, long-winded |
14:53:10 | narimiran | edcragg: yeah, but at least day16 (today) was kinda fun |
14:54:12 | edcragg | yeah, the "let's make a VM" tasks, they've had them i think the last two years too iirc |
14:54:37 | edcragg | always kinda fun |
14:55:09 | narimiran | yup, so called 'assembunny', they have it every year |
14:55:21 | edcragg | haha, that's it yeah :D |
14:56:29 | * | azuri5 quit (Quit: azuri5) |
15:02:11 | * | ftsf quit (Ping timeout: 246 seconds) |
15:05:38 | FromGitter | <Clyybber> Is it possible to create a macro that overwrites existing proc definitions |
15:05:43 | FromGitter | <Clyybber> ? |
15:06:33 | edcragg | narimiran: this one, where part 2 is basically compiler optimisation, hmm https://adventofcode.com/2017/day/23 |
15:07:36 | narimiran | edcragg: i liked that one, solved it "manually", by writing on paper what's going on |
15:09:56 | fthe | well, nailed day12 with narimiran's trick, thanks. Pretty sure it would have taken me weeks to figure it out :\ |
15:11:18 | * | endragor joined #nim |
15:14:28 | * | edcragg has a feeling the "trick" could be the only practical way to solve it :) |
15:15:38 | narimiran | fthe: btw, who are you on our leaderboard? |
15:18:51 | fthe | didn't register, since I'm really not doing it competitively (ie still on day 12) |
15:19:31 | narimiran | fthe: doesn't matter, lots of players who are not up to date. join the fun ;) |
15:20:38 | fthe | edcragg: I have a feeling you are correct. I guess the "50 billion" number should be a hint towards that |
15:22:40 | * | endragor quit (Remote host closed the connection) |
15:23:06 | fthe | narimiran: alright, just joined as auxym (I lost my freenode password for that nick a while ago). #41, not too bad |
15:23:20 | * | narimiran thumbs up |
15:25:04 | * | azuri5 joined #nim |
15:30:18 | * | fthe quit (Remote host closed the connection) |
15:30:40 | * | fthe joined #nim |
15:32:12 | FromGitter | <Clyybber> It really sucks that nimble doesn't work with devel nim atm |
15:35:40 | * | wildlander joined #nim |
15:37:30 | * | azuri5 quit (Quit: azuri5) |
15:41:35 | * | azuri5 joined #nim |
15:42:15 | * | azuri5 quit (Client Quit) |
15:42:56 | * | azuri5 joined #nim |
15:48:59 | * | nsf joined #nim |
16:00:11 | FromDiscord_ | <exelotl> if I'm importing a struct type from C, and that struct has some alignment attributes specified, can things go wrong when I try to use it from Nim? |
16:03:25 | * | Vladar joined #nim |
16:04:42 | edcragg | would that just be handled by the c compiler, and the nim bindings just refer to structs by field names at an abi level? (i'm a nim noob so don't know, but interesting question) |
16:05:47 | FromDiscord_ | <exelotl> it looks like it's OK according to this issue: https://github.com/nim-lang/Nim/issues/1930 |
16:06:43 | FromDiscord_ | <exelotl> I can just use header and importc and the nim compiler won't try to make any assumptions about the size or layout of the struct |
16:17:05 | narimiran | pushed my day16 solution. here's a thank you to Zevv for the enum idea! |
16:29:28 | edcragg | is there a way to assign an array from a seq? casting it appears to do some odd things |
16:32:40 | FromGitter | <zacharycarter> well yes - I don't think casting would work |
16:33:05 | FromGitter | <zacharycarter> I would think you would have to iterate over the sequence and assign its contents to the array |
16:33:12 | FromGitter | <zacharycarter> but there might be some shortcut - I'm just not aware of one |
16:34:25 | narimiran | edcragg: what are you trying to do? |
16:34:51 | narimiran | or to put it differently: why do you need that? |
16:35:17 | FromGitter | <zacharycarter> edcragg: see https://forum.nim-lang.org/t/3991 |
16:36:23 | FromGitter | <zacharycarter> and it's a good idea to read all the way through - because the initial suggestion results in a size increase for the resulting binary |
16:38:40 | * | l1x joined #nim |
16:38:51 | l1x | hi |
16:38:59 | narimiran | l1x: hi |
16:39:17 | l1x | what is the way of exporting a function in nim? I am trying to use jester as a module |
16:39:27 | narimiran | l1x: funcname* |
16:39:47 | l1x | https://gist.github.com/l1x/cacc2c63c11ea3af61ca7141336875e8 |
16:40:14 | l1x | runForever() is the function |
16:40:25 | l1x | narimiran: I wanted to ask what is *? |
16:40:34 | l1x | something* < what does this mean? |
16:40:47 | narimiran | it's a flag that the function is exported/public |
16:40:55 | edcragg | narimiran: i have objects which contain fields which are lists of values, of known length. for that a fixed array would suffice, but i have processing that results in a seq and i just want to copy from the seq to the array by value. I'm hesitant from putting a seq in an object for performance reasons, since i assumed they would be dynamically allocated, though i guess in practice it's probably not that bad |
16:41:14 | l1x | narimiran: thanks |
16:41:25 | l1x | and runForever() can be export? |
16:41:33 | FromGitter | <zacharycarter> it already is exported |
16:41:52 | FromGitter | <zacharycarter> I think there is conflation going on here |
16:42:04 | l1x | zacharycarter[m4: not sure what you mean |
16:42:16 | FromGitter | <zacharycarter> there is a difference between exporting an identifier and exposing it |
16:42:24 | l1x | ahh |
16:42:27 | FromGitter | <zacharycarter> so for instance `var foo* = 1` |
16:42:30 | FromGitter | <zacharycarter> is not the same as |
16:42:39 | FromGitter | <zacharycarter> `var foo = 1; export foo;` |
16:43:19 | FromGitter | <zacharycarter> in fact - the second example is probably invalid |
16:43:24 | FromGitter | <zacharycarter> the second example should look like |
16:43:29 | narimiran | edcragg: now for the stupid question: can you change your processing to output an array? |
16:43:33 | l1x | zacharycarter[m4: so what is the idiomatic way of using jester with runForever() called from the other file? |
16:43:48 | FromGitter | <zacharycarter> ```type Foo = object ⏎ export foo``` [https://gitter.im/nim-lang/Nim?at=5c1680c472f31355cd653c8b] |
16:44:13 | FromGitter | <zacharycarter> l1x: `runForever` doesn't reside in Jester - it resides in the stdlib module `asyncdispatch` |
16:44:19 | FromGitter | <zacharycarter> so what you're looking for is - |
16:44:36 | FromGitter | <zacharycarter> ```import runForever from asyncdispatch ⏎ ⏎ export runForever``` [https://gitter.im/nim-lang/Nim?at=5c1680f4039551387fa9721b] |
16:44:51 | FromGitter | <l1x> hmm, interestng |
16:45:08 | FromGitter | <l1x> let me check this |
16:45:09 | narimiran | is `import foo from bar` valid syntax? it should be `from bar import foo`, AFAIK |
16:45:12 | FromGitter | <zacharycarter> https://github.com/nim-lang/Nim/blob/master/lib/pure/asyncdispatch.nim#L1646 |
16:45:23 | FromGitter | <zacharycarter> yeah - you're right narimiran |
16:45:36 | edcragg | narimiran: hehe, well, for some reason, my nice neat `array.map(parseInt)` seems to return a seq |
16:45:37 | * | Trustable joined #nim |
16:45:40 | FromGitter | <zacharycarter> sorry - I'm forgetting Nim already since the switch to cpp :P |
16:46:03 | narimiran | edcragg: hehe, i thougth it might be something from sequtils :) |
16:46:47 | edcragg | makes sense actually :P |
16:47:03 | FromGitter | <zacharycarter> one nice thing I missed about C++ is - there's so much already-existing code out there, it's quite easy to get the core of a game engine cobbled together in a couple of days |
16:47:12 | FromGitter | <zacharycarter> https://github.com/zacharycarter/zeal |
16:47:43 | FromGitter | <zacharycarter> I plan on using Nim for the editor - and other tools, and I plan on supporting game code residing in shared libraries, so you'll be able to use Nim to write gameplay code |
16:47:51 | * | endragor joined #nim |
16:48:48 | * | Arch joined #nim |
16:49:33 | edcragg | narimiran: it just seems to me that it could be easier than it seems to be to convert between the two types, certainly if a seq is implemented anything like, a c++ vector, for example |
16:49:36 | * | Arch quit (Client Quit) |
16:50:20 | FromGitter | <l1x> @zacharycarter https://github.com/LambdaInsight/tillage/blob/master/nimrod/src/http.nim https://github.com/LambdaInsight/tillage/blob/master/nimrod/src/http.nim |
16:50:47 | narimiran | edcragg: in the mean time, instead of map, you can do for-loop in a block (give me a minute for an example) |
16:51:04 | FromGitter | <l1x> ... http.nim(2, 8) Error: cannot open file: runForever |
16:51:11 | FromGitter | <zacharycarter> remove the http. |
16:51:20 | FromGitter | <zacharycarter> also - you don't need to surround your module name in quotes in the import statement |
16:51:55 | FromGitter | <l1x> @zacharycarter done |
16:52:11 | FromGitter | <zacharycarter> did that fix it? |
16:52:18 | FromGitter | <l1x> still ... http.nim(2, 8) Error: cannot open file: runForever |
16:52:47 | FromGitter | <zacharycarter> oh... sorry l1x - I thought you had seen narimiran's message |
16:52:54 | FromGitter | <zacharycarter> I got the syntax wrong on the import from statement |
16:53:03 | FromGitter | <zacharycarter> it should be - `from asyncdispatch import runForever` |
16:53:08 | FromGitter | <zacharycarter> my bad |
16:53:23 | narimiran | edcragg: http://ix.io/1w9d/nim (not as clean as `map`, i know) |
16:54:14 | FromGitter | <l1x> @zacharycarter excellent this works |
16:54:25 | FromGitter | <zacharycarter> 👍 |
16:55:39 | FromGitter | <l1x> hmm the only problem that the http server starts automatically |
16:57:15 | Araq | GULPF: it has no point |
16:58:47 | FromGitter | <zacharycarter> l1x that's because you have `runForever()` at the entry point of your application |
16:59:09 | FromGitter | <l1x> even if I remove it it is called somewhere implicitly |
16:59:14 | FromGitter | <zacharycarter> that's going to start the polling loop |
16:59:24 | FromGitter | <zacharycarter> probably by Jester I imagine? |
17:00:10 | FromGitter | <l1x> yes |
17:01:30 | FromGitter | <zacharycarter> the routes macro starts up the server |
17:01:40 | FromGitter | <zacharycarter> https://github.com/dom96/jester/blob/master/jester.nim#L1323 |
17:02:28 | edcragg | narimiran: thanks, interesting :) block is a new keyword for me... seems like a neat way of doing rust-like expression evaluation, which is something i have been yearning for in nim actually |
17:03:02 | FromGitter | <l1x> @zacharycarter thanks! |
17:03:09 | FromGitter | <zacharycarter> np! |
17:03:19 | FromGitter | <l1x> can Jester be used as a proper lib with explicit start? |
17:03:26 | FromGitter | <l1x> maybe it is not even supported |
17:04:41 | FromGitter | <zacharycarter> well the serve proc is exposed by the jester module - https://github.com/dom96/jester/blob/master/jester.nim#L444 |
17:04:51 | FromGitter | <zacharycarter> so yes, but then you'd have to figure out how to live without the routes macro |
17:05:01 | FromGitter | <l1x> well |
17:05:13 | narimiran | edcragg: i usually wrote procedures for these kinds of stuff, before i discovered `block` :) |
17:05:15 | FromGitter | <l1x> maybe I flip the thing and put jester in the main and call everything before that |
17:06:00 | FromGitter | <zacharycarter> that's an idea |
17:06:26 | FromGitter | <zacharycarter> orrrr you could issue a RFC / PR to Jester to ask for a way to still leverage the routes macro and not have the httpserver started as a side effect |
17:07:44 | FromGitter | <zacharycarter> but then you need to convince the author, and possibly others, that the change is worth it |
17:07:46 | * | azuri5 quit (Quit: azuri5) |
17:13:08 | * | azuri5 joined #nim |
17:14:33 | dom96 | You can create routes without jester implicitly adding the `runForever` |
17:14:43 | dom96 | try: routes myRouteName: ... |
17:17:44 | FromGitter | <zacharycarter> no that's not the problem dom96 |
17:17:50 | FromGitter | <zacharycarter> he's worried about the implicit http.serve |
17:17:54 | FromGitter | <zacharycarter> via routes |
17:18:45 | dom96 | yeah, that should also be prevented if he gives his route a name |
17:18:47 | * | narimiran quit (Remote host closed the connection) |
17:19:28 | FromGitter | <zacharycarter> @l1x ^ |
17:28:39 | * | narimiran joined #nim |
17:40:47 | * | fthe quit (Ping timeout: 240 seconds) |
17:45:08 | * | Vladar quit (Remote host closed the connection) |
17:45:49 | * | abm quit (Quit: Leaving) |
17:51:41 | * | Trustable quit (Remote host closed the connection) |
17:53:08 | * | stefanos82 quit (Read error: Connection reset by peer) |
18:00:45 | xace | is there a nim equivalent of the `static` from C? or should i use `var persistentVariable {.global.}` ? |
18:01:10 | xace | (I need the function to remember the value from previous executions) |
18:02:29 | * | stefanos82 joined #nim |
18:03:49 | * | endragor quit (Remote host closed the connection) |
18:04:03 | FromGitter | <zacharycarter> xace: yes - you need the global pragma for that |
18:04:20 | FromGitter | <zacharycarter> Nim's `static` is not C's `static` |
18:05:03 | FromGitter | <zacharycarter> https://nim-lang.org/docs/manual.html#statements-and-expressions-static-statementslashexpression |
18:05:18 | xace | thanks ill check it out |
18:05:26 | FromGitter | <zacharycarter> sure thing |
18:10:32 | * | narimiran quit (Remote host closed the connection) |
18:40:19 | * | theelous3 quit (Ping timeout: 244 seconds) |
18:43:13 | FromGitter | <deech> Anyone know of any Nim communities in the US? Maybe even the Midwest? |
18:44:37 | FromGitter | <kinkinkijkin> I think the entire nim community is online |
18:45:31 | FromGitter | <deech> haha! But you people are all real humans, right? :) |
18:45:41 | FromGitter | <l1x> @dom96 is there any reason to use this many implicit in Jester? |
18:46:27 | FromGitter | <l1x> I mean, I would rather not have to figure out that route macros has 2 different behaviours based on named or unnamed routes |
18:46:35 | sendell[m] | is there a nim lib for reading exif data from files? couldn't find one |
18:48:53 | FromGitter | <zacharycarter> @deech - Nim users are very scattered, a lot of the core contributors are not US based |
18:49:03 | FromGitter | <zacharycarter> or core devs rather |
18:49:30 | FromGitter | <zacharycarter> there are a few users in VA, and then a bunch scattered across the US, but the only meetups / conferences I've seen Nim featured at have been Europe based |
18:49:59 | FromGitter | <kinkinkijkin> I've yet to see another québecois who uses nim |
18:50:04 | FromGitter | <zacharycarter> @l1x - dom doesn't always use gitter, best to try just pinging him with his irc handle dom96 |
18:50:14 | FromGitter | <zacharycarter> in case you didn't know - gitter and IRC are bridged together |
18:50:57 | FromGitter | <kinkinkijkin> where again is the irc ? freenode ? gitter slows down the computer I'm on right now quite a bit but irc does not |
18:53:12 | Araq | freenode, yes |
18:53:33 | FromGitter | <deech> @zacharycarter That makes sense. I don't see much representation in US tech circles. |
18:53:50 | * | kinkinkijkin joined #nim |
18:54:23 | FromGitter | <zacharycarter> well - I don't think many tech companies have become Nim adopters yet, for varying reasons I suppose |
18:54:26 | kinkinkijkin | alright, thanks |
18:54:52 | FromGitter | <zacharycarter> or at least, not many companies are using it as their primary language that they develop software in |
18:55:42 | kinkinkijkin | I think of programming in a mix of nim and C#, but this is not a common case |
19:03:45 | shashlick | @deech: I'm in the midwest timezone at least |
19:05:57 | FromGitter | <deech> @zacharycarter It has a lot to offer. |
19:06:31 | FromGitter | <zacharycarter> it does - but it has a ways to go to be better or even a viable alternative to the competition in certain areas |
19:06:46 | shashlick | dom96: I seem to have found a bug with nimble - when you install nimterop, nimble installs its dependencies (treesitter_c) just fine but compile fails since nimble points to the temp directory where treesitter_c was installed from instead of the ~/.nimble/pkgs dir |
19:06:48 | dom96 | l1x: mainly because most of the time it's what you want to do and also it's how Sinatra works and Jester emulates it |
19:07:05 | shashlick | i suspect it is because treesitter modules are subdirs but have no evidence yet |
19:07:10 | FromGitter | <deech> @zacharycarter Oh absolutely. |
19:07:20 | l1x | @dom96 thanks for the explanation |
19:08:08 | shashlick | dom96: --path:"C:\Users\gt\AppData\Local\Temp\nimble_4336\githubcom_genotrancenimtreesitter_0.1.0\treesitter_c" shows up in the compile path |
19:08:29 | shashlick | if I try nimble install again, it works since packages are already installed |
19:11:11 | dom96 | sounds like an edge case that only your package runs into because it generates the modules at install time? |
19:11:39 | shashlick | well, everything is in place in the pkgs directory but nimble still points to the temp directory |
19:15:22 | * | littleli joined #nim |
19:22:34 | * | Vladar joined #nim |
19:22:42 | * | mr_yogurt quit (Quit: quit) |
19:33:06 | FromGitter | <Clyybber> @deech Did you do a presentation of ATS sometime? |
19:42:00 | FromGitter | <deech> Yes |
19:48:24 | livcd | treeform: are you around ? |
19:49:36 | * | narimiran joined #nim |
19:54:56 | * | nsf quit (Quit: WeeChat 2.3) |
20:00:03 | * | thomasross quit (Ping timeout: 268 seconds) |
20:04:02 | FromGitter | <Clyybber> @deech Cool, really good talk! |
20:06:05 | * | azuri5 quit (Quit: azuri5) |
20:06:58 | * | azuri5 joined #nim |
20:15:57 | FromGitter | <zacharycarter> \o/ project is building again |
20:28:27 | * | Tyresc joined #nim |
20:29:06 | * | druonysus quit (Quit: druonysus) |
20:31:30 | * | thomasross joined #nim |
20:33:39 | * | azuri5 quit (Ping timeout: 264 seconds) |
20:34:41 | * | istvan joined #nim |
20:36:20 | * | istvan quit (Client Quit) |
20:37:50 | * | miran joined #nim |
20:40:13 | * | narimiran quit (Ping timeout: 250 seconds) |
20:48:58 | * | fthe joined #nim |
20:54:47 | * | fthe quit (Remote host closed the connection) |
21:03:48 | * | nograve joined #nim |
21:04:48 | * | nograve quit (Client Quit) |
21:05:14 | * | miran quit (Remote host closed the connection) |
21:06:01 | * | thomasross quit (Quit: Leaving) |
21:06:19 | * | thomasross joined #nim |
21:12:40 | * | Vladar quit (Remote host closed the connection) |
21:13:28 | FromGitter | <deech> @Clyybber Thanks! |
21:28:59 | * | kapil____ quit (Quit: Connection closed for inactivity) |
21:32:58 | * | littleli quit (Read error: Connection reset by peer) |
21:38:59 | * | fthe joined #nim |
22:48:42 | kinkinkijkin | I can't seem to find this and unfortunately forgot, how do I iterate over the items of a seq ? |
22:49:10 | kinkinkijkin | i havent actually programmed in a few months |
22:50:42 | shashlick | for i in seq: |
22:51:20 | kinkinkijkin | thanks |
22:51:36 | shashlick | Or for i in 0 .. seq.len-1: seq[i] |
22:51:36 | FromDiscord_ | <exelotl> oh, fug |
22:51:57 | FromDiscord_ | <exelotl> I can't do sizeof on types that are imported from C |
23:07:35 | * | theelous3 joined #nim |
23:08:01 | * | rayman22201 quit (Ping timeout: 256 seconds) |
23:11:27 | FromGitter | <zacharycarter> exelotol: ``` ⏎ {.emit: """/*TYPESECTION*/ ⏎ typedef struct{ ⏎ float a; float b; ⏎ } Foo; ... [https://gitter.im/nim-lang/Nim?at=5c16db9fb4c74555ccdb7b1f] |
23:11:53 | FromGitter | <zacharycarter> sorry |
23:11:56 | FromGitter | <zacharycarter> that didn't format properly |
23:12:00 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c16dbc0c428e9539d4cd636] |
23:22:26 | FromDiscord_ | <exelotl> zacharycarter: ah I see, the problem isn't what I thought then |
23:22:42 | FromDiscord_ | <exelotl> but rather, it's not possible to use sizeof at compile time, at all |
23:23:25 | FromDiscord_ | <exelotl> at least not for object types |
23:36:42 | kinkinkijkin | how long is a "very long" string, to be considerable for using a rope instead of a string ? |
23:39:30 | kinkinkijkin | im going to be using one or the other to store loaded code of essentially a compression-based macro language |
23:40:42 | kinkinkijkin | the average file would be maybe 70 lines of 50-100 chars per line |
23:47:32 | FromGitter | <zacharycarter> kinkinkijkin: I think ropes are mostly used for building long strings |
23:47:42 | FromGitter | <zacharycarter> where you need lots of concatenation |
23:47:55 | FromGitter | <zacharycarter> you ultimately end up converting them to Nim strings anyay |
23:48:00 | FromGitter | <zacharycarter> anyway* |
23:50:31 | * | stefanos82 quit (Remote host closed the connection) |
23:52:01 | kinkinkijkin | ah |
23:56:48 | * | fthe quit (Remote host closed the connection) |
23:57:02 | FromGitter | <zacharycarter> if you search for usages of the ropes module in the stdlib, you'll see they're used substantially in the compiler code |
23:57:43 | FromGitter | <zacharycarter> well I guess the compiler isn't the std - but just search in the Nim sources in general |
23:57:52 | FromGitter | <zacharycarter> and you can get a gist of how they're being used |