00:00:35 | * | krux02 quit (Read error: Connection reset by peer) |
00:00:36 | * | krux02_ joined #nim |
00:01:54 | FromGitter | <mratsim> you can use write only locks |
00:02:50 | FromGitter | <mratsim> there are plenty of more fine-grained locks: https://en.wikipedia.org/wiki/Readers–writer_lock |
00:03:04 | FromGitter | <mratsim> without going into lock-free and wait free data structure |
00:03:23 | FromGitter | <mratsim> (please note that I have absolutely no experience in those, everytime I tried I failed miserably :D) |
00:03:32 | * | krux02_ quit (Remote host closed the connection) |
00:04:39 | * | krux02 joined #nim |
00:14:05 | FromGitter | <arnetheduck> queues (lock-free or not) are harder to shoot yourself in the foot with thus better for most people, but even if you know how to use locking (which is rare), you'll quickly run into fundamental limitations like the lack of synchronization, the need to cover more than only the collection with the same lock etc.. take a hint from `java` that started strong with `Vector` only to go back to unlocked collections |
00:14:47 | FromGitter | <arnetheduck> lock-free queues are not that tricky once you learn the general principle of how they operate - they're just a little unusual compared you your everyday programming tasks |
00:21:10 | * | fthe joined #nim |
00:24:40 | FromGitter | <zacharycarter> gotcha - thank you for the explanations |
00:30:35 | fthe | any of you use nim-mode in emacs? |
00:34:32 | FromGitter | <zacharycarter> maybe krux02 |
00:34:52 | FromGitter | <zacharycarter> https://www.schneems.com/2017/06/28/how-to-write-a-lock-free-queue/ - article I just stumbled upon while googling |
00:44:50 | * | abm quit (Quit: Leaving) |
00:52:38 | * | jakob0094 quit (Remote host closed the connection) |
00:54:11 | * | ftsf joined #nim |
00:57:22 | * | zachk quit (Quit: Leaving) |
01:06:21 | FromGitter | <zacharycarter> took a look at the hcr stuff - still not sure how to use it all :P looks neat though |
01:06:37 | FromGitter | <zacharycarter> if anyone needs a guinea pig to play around with the feature - I'd be more than willing :D |
01:06:48 | FromGitter | <zacharycarter> I just would need a little bit of hand holding initally |
01:09:45 | * | Tyresc quit (Remote host closed the connection) |
01:13:14 | * | krux02 quit (Remote host closed the connection) |
01:16:40 | FromGitter | <zacharycarter> can't get it to compile anymore either - get some strformat cannot 'importc' variable at compile time error |
01:24:38 | * | fthe quit (Ping timeout: 250 seconds) |
01:59:00 | * | gangstacat quit (Ping timeout: 252 seconds) |
02:15:06 | * | gangstacat joined #nim |
02:36:59 | * | snowolf quit (Ping timeout: 268 seconds) |
02:37:41 | * | snowolf joined #nim |
02:52:47 | * | kapil____ joined #nim |
03:08:44 | * | banc quit (Quit: Bye) |
03:11:38 | * | sagax joined #nim |
03:12:08 | * | snowolf quit (Ping timeout: 268 seconds) |
03:18:13 | * | d10n-work quit (Quit: Connection closed for inactivity) |
03:18:54 | * | snowolf joined #nim |
03:25:36 | * | banc joined #nim |
03:45:27 | * | dddddd quit (Remote host closed the connection) |
03:53:16 | * | literal quit (Ping timeout: 250 seconds) |
03:58:23 | * | ghost64 quit (Ping timeout: 245 seconds) |
04:01:10 | * | literal joined #nim |
04:03:52 | FromGitter | <gogolxdong> I found nim extension of vscode could format code layout automatically by accident. When did it take effect? |
04:04:10 | FromGitter | <gogolxdong> or I missed it all the time? |
04:05:36 | * | ghost64 joined #nim |
04:15:45 | * | endragor joined #nim |
04:24:09 | * | nsf joined #nim |
04:38:30 | FromGitter | <gogolxdong> Html compiled with karax hints ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0f3f468b656e2b04f60d4d] |
04:39:12 | FromGitter | <gogolxdong> which used to work |
04:50:14 | FromGitter | <gogolxdong> new compiled js has this issue . |
04:58:33 | * | lritter quit (Ping timeout: 244 seconds) |
04:59:14 | * | lritter joined #nim |
05:01:45 | * | kapil____ quit (Quit: Connection closed for inactivity) |
05:13:25 | * | gangstacat quit (Ping timeout: 246 seconds) |
05:28:59 | * | gangstacat joined #nim |
05:35:54 | FromGitter | <gogolxdong> ah, karax plays with Nim stable version |
05:49:05 | * | lritter quit (Remote host closed the connection) |
05:50:59 | * | miran joined #nim |
06:18:12 | FromGitter | <zacharycarter> this works with the c backend, but not the cpp backend - https://gist.github.com/zacharycarter/cc0e1f40fd5f7df6c8d683c1543f7fdc |
06:18:26 | FromGitter | <zacharycarter> tried changing the importc pragma to an importcpp pragma |
06:18:33 | FromGitter | <zacharycarter> still not working |
06:18:37 | FromGitter | <zacharycarter> just segfaults |
06:19:38 | FromGitter | <zacharycarter> guessing it has something to do with 2 Nim GC's running |
06:21:51 | FromGitter | <zacharycarter> can't use `-d:useNimRtl` with the cpp backend either - I get some error about `getMemCounters` |
06:47:40 | * | shpx joined #nim |
06:49:49 | * | snowolf quit (Ping timeout: 268 seconds) |
06:54:03 | * | snowolf joined #nim |
07:03:32 | * | miran quit (Remote host closed the connection) |
07:07:03 | * | krux02 joined #nim |
07:07:05 | * | snowolf quit (Ping timeout: 268 seconds) |
07:07:37 | * | snowolf joined #nim |
07:11:47 | * | snowolf quit (Ping timeout: 250 seconds) |
07:14:12 | * | snowolf joined #nim |
07:33:43 | Araq | gogolxdong: can you report this regression? |
07:50:11 | * | snowolf quit (Ping timeout: 260 seconds) |
07:53:08 | FromGitter | <gogolxdong> ok |
07:59:22 | * | ftsf quit (Read error: Connection reset by peer) |
07:59:48 | * | ftsf joined #nim |
08:05:40 | * | ftsf quit (Ping timeout: 268 seconds) |
08:08:30 | * | zama_ joined #nim |
08:09:11 | FromGitter | <alehander42> Araq, I remember you agreed that adding `if` to variants would be a good solution for https://github.com/nim-lang/Nim/issues/3629 |
08:10:35 | * | zama quit (Ping timeout: 250 seconds) |
08:10:51 | * | zama_ quit (Changing host) |
08:10:51 | * | zama_ joined #nim |
08:10:58 | * | zama_ is now known as zama |
08:11:24 | Zevv | Funny, I've been using Nim for a few months, but AoC is really getting me all through the language and touch parts I never touched before. Never needed 'parallel/spawn' before |
08:13:09 | FromGitter | <alehander42> AoC 11? |
08:16:39 | Zevv | yeah |
08:17:04 | Zevv | "needed" |
08:17:54 | Zevv | brute forcing goes faster on a lot of cpus :) |
08:25:44 | * | shpx quit (Ping timeout: 244 seconds) |
08:26:45 | FromGitter | <narimiran> hah, i didn't even thought about using parallel — i've been thinking how to solve it in less brutish way :) |
08:28:14 | FromDiscord_ | <technicallyagd> My first attempt was just brute forcing it while going to pee |
08:28:25 | FromDiscord_ | <technicallyagd> it took 140s in total |
08:28:54 | FromGitter | <narimiran> hey @technicallyagd! i've been waiting to tell you yesterday — i've used 'unpack' for day10! it was such a joy to just do `<-` |
08:29:07 | FromDiscord_ | <technicallyagd> Noice! |
08:29:15 | FromGitter | <narimiran> hmm, my brute force day11 takes 22 seconds!? |
08:29:26 | FromDiscord_ | <technicallyagd> I am glad it's actually useful in some way |
08:29:45 | FromGitter | <narimiran> [spoilers] see here: https://github.com/narimiran/AdventOfCode2018/blob/master/nim/day10.nim |
08:30:44 | FromDiscord_ | <technicallyagd> yeah that's how I used it as well. |
08:32:26 | FromDiscord_ | <technicallyagd> I wished I had nested unpacking for day10 though |
08:37:52 | FromDiscord_ | <technicallyagd> @narimiran hmm, I wonder what made your day11 solution so much faster than mine o.o? did you go from 1x1 to 300x300? |
08:42:03 | FromGitter | <narimiran> @technicallyagd yes, that's my outer-most loop, followed by ys, then xs |
08:45:37 | FromDiscord_ | <technicallyagd> @narimiran haha, I think I found the culprit of mine. |
08:48:07 | FromDiscord_ | <technicallyagd> yeah, now it finishes in 40s. |
08:48:22 | FromGitter | <narimiran> do tell |
08:49:24 | FromDiscord_ | <technicallyagd> I was accidentally constructing sequence of indices within the inner most loop |
08:51:09 | FromDiscord_ | <technicallyagd> not a good idea at all |
09:02:44 | * | floppydh joined #nim |
09:15:43 | Zevv | but you're still brute forcing, right? |
09:17:11 | Zevv | Ah ok, my flat version runs in 26 seconds, adding parallel/spawn reduces to 5 |
09:22:59 | * | PMunch joined #nim |
09:23:43 | Zevv | narimiran: I like the [x, y, vx, vy] <- line.findAll(re"-?\d+").map(parseInt) |
09:28:47 | * | ng0 joined #nim |
09:35:50 | * | whaletechno quit (Quit: ha det bra) |
09:40:54 | * | voice_ftp joined #nim |
09:52:41 | PMunch | Yay, my AoC repo is up: https://github.com/PMunch/aoc2018 |
09:56:40 | ldlework | :) |
09:58:23 | FromGitter | <narimiran> @Zevv yeah, i like it too :) we can use it thanks to @technicallyagd |
09:59:36 | FromGitter | <narimiran> @PMunch why are you separating the parts in two different files? |
09:59:48 | PMunch | Why not? |
10:00:28 | PMunch | I've noticed that part2 often requires changes to what I did in part1, so to keep both I copy the file :) |
10:06:34 | FromGitter | <narimiran> ok, i get the logic. mine is reversed: ok, let's improve my initial code so now it works for both parts. |
10:06:47 | * | Vladar joined #nim |
10:07:06 | FromGitter | <narimiran> and for some tasks, all it takes is to add 3 lines to the original code |
10:07:24 | PMunch | Yeah that's fair |
10:20:40 | * | sagax quit (Ping timeout: 250 seconds) |
10:24:42 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0f906a26de6f0822b80fd1] |
10:27:30 | FromGitter | <gogolxdong> http://ix.io/1vMD |
10:27:43 | FromGitter | <gogolxdong> Is this going to work? |
10:52:29 | * | snowolf joined #nim |
10:55:14 | * | dddddd joined #nim |
11:15:40 | * | stefanos82 joined #nim |
11:16:31 | * | nc-x joined #nim |
11:29:18 | nc-x | Araq: you there? |
11:31:00 | Araq | nc-x, hi |
11:31:26 | nc-x | The reason for https://github.com/pragmagic/karax/issues/80 is the change in this function https://github.com/nim-lang/Nim/pull/9411/files#diff-255aac99e5eed78cd98b01e25c647f86L870 |
11:32:01 | nc-x | I have a fix https://github.com/nc-x/Nim/commit/685a5544c4f319667c811b04128dc3f8f33a4230 but I have no idea if that is correct or not. Can you please take a look before I create a PR. |
11:32:22 | Araq | looks good |
11:32:26 | nc-x | My fix does fix the problem though and also does not fail any js tests. |
11:32:34 | nc-x | Okay thanks. I will create a PR then. |
11:32:43 | Araq | ok, thank you |
11:33:15 | Araq | yay git does a GC run. and that hangs |
11:33:41 | Araq | interesting how a man with a hate for GCs can come up with a system that collects garbage |
11:34:36 | nc-x | Done https://github.com/nim-lang/Nim/pull/9929 |
11:34:42 | * | nc-x quit (Quit: Page closed) |
11:35:20 | FromGitter | <alehander42> :D |
12:27:12 | FromGitter | <zacharycarter> I've given up (again) on trying to get any type of plugin system working |
12:27:37 | FromGitter | <zacharycarter> `useNimRtl` doens't work - and I can get shard libs compiled in cpp using the custom namespace option to work either |
12:27:40 | PMunch | zacharycarter, with Nim <-> nim plugins? |
12:27:46 | FromGitter | <zacharycarter> yes |
12:27:55 | PMunch | Yeah, it's been broken for a while |
12:28:50 | PMunch | github.com/nim-lang/Nim/issues/6886 |
12:29:59 | FromGitter | <zacharycarter> think I'm going to pause on working on any project until hot code reloading / destructors are in working order |
12:30:36 | FromGitter | <zacharycarter> can't implement some of the things i wanted to try this time around |
12:33:38 | FromGitter | <zacharycarter> time to dust off C :P |
12:33:44 | FromGitter | <zacharycarter> or maybe I'll play with scheme some more |
12:34:41 | PMunch | So no more zeal :( I was looking forward to play with it |
12:35:51 | FromGitter | <zacharycarter> I'm just not looking forward to writing it without destructor support then having to add destructor support later |
12:36:12 | FromGitter | <zacharycarter> and if I can't find a way to load plugins / hot load code - I can't make the compile server idea work |
12:36:21 | FromGitter | <zacharycarter> or user plugins either |
12:36:45 | FromGitter | <zacharycarter> I guess there's a lot of it I can still write - but I seem to be fighting the language more than anything else right now |
12:40:59 | Araq | plugin systems are like distributed systems. |
12:41:10 | Araq | the trick is to not build them. |
12:42:29 | FromGitter | <zacharycarter> I know you don't like them :P |
12:42:35 | FromGitter | <zacharycarter> but we should still be able to build them |
12:43:20 | FromGitter | <zacharycarter> will the destructor runtime help alleviate the troubles Nim shared libs have with the gc Araq? |
12:43:33 | FromGitter | <zacharycarter> or does there need to be still another solution figured out for thoat |
12:43:48 | Araq | I dunno, the DLL tests are green |
12:43:57 | Araq | and use the GC. |
12:44:11 | FromGitter | <zacharycarter> well - I can get my example code to work using the C backend |
12:44:16 | FromGitter | <zacharycarter> it's the CPP backend where things fallapart |
12:44:35 | Araq | destructors will help but bugfixes are always easier |
12:44:41 | Araq | bbs |
12:44:43 | FromGitter | <zacharycarter> and I was using the CPP backend - because of the C backend and the issue with static methods that rely on the GC |
12:49:08 | FromGitter | <zacharycarter> most modern game engines have plugin systems that users extend the engine in some way, and many of the engines use plugins internally |
12:49:16 | FromGitter | <zacharycarter> UE4 does this - I know Unity and Godot at least offer support for use plugins |
12:49:17 | FromGitter | <arnetheduck> @mratsim @zacharycarter http://www.1024cores.net/home/lock-free-algorithms and Dmitry Vyukov is the go-to resource for lock-free stuff |
12:49:41 | FromGitter | <zacharycarter> thanks @arnetheduck ! |
12:51:08 | FromGitter | <mratsim> For lock-free inspiration I always look into the Crossbeam repo: https://github.com/crossbeam-rs/crossbeam |
12:51:53 | FromGitter | <mratsim> For example: https://aturon.github.io/blog/2015/08/27/epoch/ |
12:53:29 | FromGitter | <mratsim> but it seems like they are back to using a GC :P - https://github.com/crossbeam-rs/rfcs/blob/master/text/2017-05-23-epoch-gc.md |
12:53:43 | FromGitter | <mratsim> (and a thread local one) |
12:54:41 | FromGitter | <arnetheduck> ah yeah, seen that.. the 1024 site is more educational, in the sense that it classifies and goes over the problems you typically have to deal with.. |
12:54:53 | FromGitter | <mratsim> cool. |
12:55:26 | FromGitter | <mratsim> That’s one thing I’ve been always wondering to do distributed tree data structure updates. |
12:55:49 | FromGitter | <arnetheduck> that's possible? :) |
12:55:59 | FromGitter | <mratsim> In go (the game) they are dozens of papers about “leaf parallelism”, “tree paralellism”, “trunk parallelism" |
12:56:06 | FromGitter | <mratsim> depends on what your tree is used for |
12:56:36 | FromGitter | <mratsim> I was talking about monte-carol tree search, which builds a tree of probability that some play is a good play. |
12:56:41 | FromGitter | <mratsim> So it’s append only. |
12:56:50 | FromGitter | <mratsim> carlo* |
12:57:04 | FromGitter | <arnetheduck> well yeah, specially for probabilistic approaches, anything goes :) |
12:57:23 | FromGitter | <zacharycarter> searching for examples of `gc:none` on github - there are very few |
12:57:24 | FromGitter | <mratsim> and even if they are concurrent update, as long as it’s not in the exact same part of the tree, it does not matter. |
12:57:44 | FromGitter | <zacharycarter> and I don't see many - if any - of them doing much as far as memory allocation goes |
12:57:47 | FromGitter | <alehander42> are traditional go engines still heavily used, or neural network-based ones are the new mode? |
12:57:53 | FromGitter | <mratsim> people are always asking about gc:none, gc:regions ad c:stack, maybe write a wiki article about it ;) |
12:58:09 | FromGitter | <mratsim> @alehander42 ugh, NN go engine are the plague now. |
12:58:31 | FromGitter | <mratsim> People at the top amateur level started cheating so you cannot hold online competitions anymore. |
12:58:38 | * | Vladar quit (Remote host closed the connection) |
12:58:41 | FromGitter | <alehander42> I see, so it's like chess: we have an alphazero open source copy, called leela which is the most promising one |
12:58:53 | FromGitter | <mratsim> and you can have a bot in your phone, so now in live competition, you have to leave yourphone on the table if you get up. |
12:59:00 | * | Vladar joined #nim |
12:59:10 | FromGitter | <zacharycarter> @mratsim - well gc:regions and stack are the same thing |
12:59:19 | FromGitter | <mratsim> before you could just rise, walk around, take a coffee, and come back |
12:59:20 | FromGitter | <alehander42> hm, doesn't go have something like blitz? in online chess, people play mostly blitz and its harder to cheat for a very limited control |
12:59:29 | FromGitter | <zacharycarter> and I've gone through those now to try to work through the issues I've been running into |
12:59:43 | FromGitter | <mratsim> Blitz is usually seen as cheap and I agree |
12:59:48 | FromGitter | <zacharycarter> resorting to trying gc:none now - and everyone points to nimkernel |
12:59:53 | FromGitter | <zacharycarter> but I don't see much of anything there |
13:00:34 | FromGitter | <mratsim> I probably should give about 6 initial moves as handicap to my Blitz selft to balance the chance of victory :P |
13:00:36 | FromGitter | <alehander42> in traditional chess competitions too, but online the strongest playerbase is usually on blitz(exactly because of that): the other options are paid sites where you can make sure you play with actual humans/GM-s etc |
13:00:57 | FromGitter | <alehander42> but those are mostly for excellent players |
13:01:29 | FromGitter | <mratsim> In go you usually have fast time settings, about 1min/move, 30s is quite fast, 15s and below/move is blitz |
13:01:58 | FromGitter | <alehander42> yeah, blitz is problematic, but even the world championship is resolved by rapid(a bit slower blitz) last two times, so its getting more and more important |
13:02:08 | FromGitter | <alehander42> (rapid tiebreak) |
13:03:52 | FromGitter | <alehander42> in chess blitz you have usually 5min+3sec increment on move, so thats even less (around 10s for avg 40move game). but classical can take 7 hours |
13:05:30 | PMunch | Araq, krux02 actually disabled the GC part of the DLL test 13 days ago |
13:07:06 | FromGitter | <mratsim> In the past Go games used to be done over days or even months |
13:07:21 | FromGitter | <mratsim> You even had “best-of-30” games :P |
13:08:51 | FromGitter | <alehander42> yeah, it was the same with chess, later they became mostly containable in a day, but you had first-with-6 wins: and many draws. ⏎ so kasparov and karpov played like 40 games and finally karpov was too exhausted to continue |
13:10:04 | * | fthe joined #nim |
13:10:53 | FromGitter | <alehander42> actually he didn't want to stop, but the federation put a halt to it, however basically today you can have max 12 games and the last one had 12 draws: so this is prob'ly the biggest issue with it, go is better at the draw thing :D |
13:17:26 | * | dom96_w joined #nim |
13:24:09 | FromDiscord_ | <technicallyagd> @Zevv yeah, that was my first attempt. I then found out about https://en.wikipedia.org/wiki/Summed-area_table on reddit |
13:24:40 | FromDiscord_ | <technicallyagd> https://www.reddit.com/r/adventofcode/comments/a53r6i/2018_day_11_solutions/ebjogd7/ |
13:25:14 | FromDiscord_ | <technicallyagd> now my taks2 finishes in 8ms with `-d:release` |
13:36:35 | stefanos82 | this latest update with hash 9bc4208706495a84808f779e3da58583328a112c is so slow |
13:36:39 | stefanos82 | I wonder why |
13:39:04 | FromGitter | <arnetheduck> I use gc:none extensively while developing nlvm - just to get rid of that blob of gc code when analyzing bugs in generated code :) also, I've got 32gb of ram, 95% of all little command line applications I run would actually work fine without any deallocation |
13:39:53 | FromGitter | <zacharycarter> I think I'm just going to simplify my project to better fit Nim's default GC |
13:40:10 | FromGitter | <zacharycarter> so no plugins and will toss away the job / threading / hot code reloading stuff for now |
13:40:15 | stefanos82 | this simple program http://paste.debian.net/1055328/ takes 3.50 seconds to execute |
13:40:17 | stefanos82 | why?! |
13:40:40 | FromGitter | <zacharycarter> are you compiling in release mode? |
13:40:47 | stefanos82 | no, in debug mode |
13:40:53 | FromGitter | <arnetheduck> > as long as it’s not in the exact same part of the tree, it does not matter ⏎ ⏎ that's cheating :) |
13:41:36 | PMunch | stefanos82, on my machine it was instant.. |
13:41:42 | PMunch | In debug mode as well |
13:41:50 | * | fthe quit (Ping timeout: 246 seconds) |
13:42:01 | stefanos82 | PMunch: I have no idea why this happens... |
13:42:23 | PMunch | Nim version? |
13:42:31 | * | endragor quit (Remote host closed the connection) |
13:42:59 | stefanos82 | PMunch: the latest HEAD with hash 9bc4208706495a84808f779e3da58583328a112c |
13:45:42 | * | endragor joined #nim |
13:46:27 | PMunch | Hmm, I'm on devel as well. Not quite that new though (and I'm afraid to try it now :P) |
13:49:14 | FromGitter | <zacharycarter> I'm about to try |
13:49:43 | FromGitter | <zacharycarter> I just updated to latest devel via choosenim |
13:49:53 | * | endragor quit (Ping timeout: 246 seconds) |
13:49:57 | FromGitter | <zacharycarter> ran instantly |
13:50:49 | stefanos82 | I have no idea what's going on... |
13:51:44 | FromGitter | <zacharycarter> what os are you on? |
13:52:01 | FromGitter | <zacharycarter> and you're using the C backend - correct? |
13:52:02 | stefanos82 | Debian testing 64-bit |
13:52:06 | stefanos82 | yep |
13:52:16 | FromGitter | <zacharycarter> very strange... |
13:52:17 | stefanos82 | it used to run instantly |
13:52:26 | * | snowolf quit (Ping timeout: 260 seconds) |
13:52:31 | FromGitter | <zacharycarter> have you tried restarting your machine? |
13:52:43 | stefanos82 | nope |
13:53:01 | stefanos82 | I have never had this issue before |
13:53:11 | FromGitter | <zacharycarter> not sure - it doesn't really make sense |
13:53:19 | FromGitter | <zacharycarter> you can always look at the C code that was generated |
13:53:31 | FromGitter | <zacharycarter> to make sure nothing fishy is going on - but it sounds like it's an environment specific hting |
13:54:07 | FromGitter | <zacharycarter> Araq: I'm focusing on strategy games for this engine btw |
13:54:28 | FromGitter | <zacharycarter> and I'm going to go with your suggestion - at least initially - and make the editor in-game |
13:54:40 | FromGitter | <alehander42> stefanos82, profile it |
13:54:54 | stefanos82 | I have tested a simple echo "hello" in https://play.nim-lang.org/ |
13:54:56 | stefanos82 | Hint: operation successful (11716 lines compiled; 1.471 sec total; 22.293MiB peakmem; Debug Build) [SuccessX] |
13:54:58 | FromGitter | <zacharycarter> good idea |
13:55:11 | FromGitter | <zacharycarter> that's using a super old version of Nim I'm pretty sure |
13:55:24 | FromGitter | <zacharycarter> like 0.18.0 |
13:55:37 | stefanos82 | how to profile it then? |
13:55:46 | stefanos82 | I have tried --hints:on --verbosity:2 |
13:55:50 | FromGitter | <zacharycarter> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html |
13:55:55 | FromGitter | <zacharycarter> you can use nimprof - if it works |
13:56:01 | FromGitter | <zacharycarter> or install valgrind and use that |
13:56:12 | FromGitter | <alehander42> oh man, i've used for i, e in children in Python and wondering 10 minutes why doesnt it work.. starting to forget I need `enumerate` there |
13:56:55 | FromGitter | <alehander42> @zacharycarter I've only used perf(not very experienced at profiling), is valgrind nicer for that? (i mostly know of its memory stuff) |
13:57:16 | * | snowolf joined #nim |
13:59:05 | stefanos82 | I got this ../../../../../GIT_CODES/Nim/lib/system/profiler.nim(91, 23) Error: undeclared identifier: 'framePtr' |
13:59:19 | FromGitter | <zacharycarter> @alehander42 - I'm not sure - I just know it can profile |
13:59:37 | FromGitter | <zacharycarter> valgrind doesn't work well for me on macOS - and I haven't really been profiling much, mostly debugging memory issues with asan etc |
13:59:58 | FromGitter | <zacharycarter> valgrind might work fine for profiling on mac - memcheck doesn't work well though |
14:00:14 | FromGitter | <zacharycarter> stefanos82: you got that now? by using nimprof? |
14:00:20 | stefanos82 | yes |
14:00:26 | FromGitter | <zacharycarter> okay so try valgrind |
14:00:31 | FromGitter | <zacharycarter> I'm not sure if nimprof works currently |
14:12:55 | FromGitter | <zacharycarter> so I know Nim has no `goto` - but how do you achieve the pattern where you have a set of common calls |
14:13:07 | stefanos82 | @zacharycarter: any example to share if you don't mind about how to use valgrind? |
14:13:28 | FromGitter | <zacharycarter> like for instance in some init code - multiple if / else branches could potentially casuse you to want to terminate the app and call some cleanup logic |
14:13:43 | FromGitter | <zacharycarter> and traditionally - in C/C++ - you'd use a `goto` potentially |
14:13:52 | PMunch | block and break might help |
14:14:14 | FromGitter | <zacharycarter> PMunch: but those can only be used inside some sort of looping construct right? |
14:14:21 | PMunch | Nope |
14:14:55 | FromGitter | <zacharycarter> stefanos82: sure - step 1) compile the program you want to profile like so: `nim c --debugger:native --compileOnly foo.nim` |
14:15:18 | FromGitter | <zacharycarter> `valgrind --tool=callgrind -v ./foo` |
14:15:43 | stefanos82 | @zacharycarter: I used nim --d:debug --lineDir:on --debuginfo --debugger:native c src/foo.nim |
14:15:47 | PMunch | zacharycarter, http://ix.io/1vNS/Nim |
14:16:08 | FromGitter | <zacharycarter> well --debugger:native I'm pretty sure takes care of --debuginfo and lineDir:on |
14:16:16 | stefanos82 | cool |
14:16:38 | FromGitter | <zacharycarter> PMunch: I'm more interested in something like this though - |
14:18:36 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/bde2ea52c99be079214ff6e374ce38c5 |
14:19:00 | FromGitter | <zacharycarter> stefanos to inspect valgrind output, you may also want to install KCacheGrind |
14:19:57 | FromGitter | <zacharycarter> PMunch: I think Nim could use something like this |
14:20:48 | FromGitter | <zacharycarter> I guess I can just importc setjmp? |
14:21:52 | PMunch | This is how you do that in Nim: http://ix.io/1vNU/Nim |
14:22:14 | PMunch | I asked Araq about this once, he said that it would make control-flow analysis much harder |
14:22:23 | FromGitter | <alehander42> but the point is that you'll get to after bar anyway |
14:22:30 | PMunch | Which is (at least one of the reasons) why Nim doesn't have it |
14:22:40 | FromGitter | <alehander42> but I agree with Araq, flow analysis sucks with goto, so happy I didnt have to fight it |
14:22:44 | PMunch | alehander42, so? You do that with goto as well.. |
14:23:05 | stefanos82 | @zacharycarter: I have generated a callground.out.<xxxx> file and opened it with kcachegrind |
14:23:12 | stefanos82 | I have no idea what to look lol |
14:23:13 | FromGitter | <alehander42> yeah, my point is that you porbably also set a flag in both cases anyway |
14:24:33 | FromGitter | <alehander42> and if you think about it, in this case, why use block and break at all.. |
14:24:43 | FromGitter | <alehander42> I think the point of block/break is when you have several nested loops |
14:24:59 | FromGitter | <alehander42> to easily break on top |
14:25:02 | FromGitter | <zacharycarter> yeah - that's where I see it being useful |
14:25:05 | FromGitter | <zacharycarter> breaking out of a nested loop |
14:25:15 | FromGitter | <zacharycarter> I'm looking for like - you have a bunch of init logic |
14:25:48 | FromGitter | <zacharycarter> and certain calls during that init logic can produce unrecoverable errors - and when one of those is encountered - you want to go to a common section of code to execute some shutdown logic - like closing file handles or something |
14:26:05 | PMunch | Well you can use defer |
14:26:07 | FromGitter | <zacharycarter> and you don't want to have to re-write that shutdown logic in every place where you've encountered an unrecoverable error |
14:26:16 | FromGitter | <zacharycarter> never |
14:26:17 | FromGitter | <zacharycarter> :P |
14:26:22 | FromGitter | <alehander42> well, you can always .. raise a custom exception which you only handle on top level I guess? |
14:26:28 | PMunch | Or do something like this: http://ix.io/1vNY/Nim |
14:27:31 | FromGitter | <zacharycarter> I guess I need to get on board with exceptions |
14:27:35 | FromGitter | <zacharycarter> the template idea isn't bad either |
14:28:00 | FromGitter | <narimiran> @stefanos re: "Error: undeclared identifier: 'framePtr'" this is because of some .nims file you have in that folder |
14:28:27 | FromGitter | <alehander42> @PMunch that's nice |
14:28:30 | FromGitter | <narimiran> see here: https://github.com/nim-lang/Nim/issues/8991 |
14:28:37 | FromGitter | <alehander42> but still what about different calls |
14:28:51 | FromGitter | <alehander42> is there a reason to not use exceptions for your usecase @zacharycarter |
14:28:58 | stefanos82 | @nariniran: ah I see |
14:29:06 | FromGitter | <zacharycarter> I just am not used to / don't like them |
14:29:23 | FromGitter | <alehander42> you want to bubble up an error and do stuff on top level based on it: that's literally where they excell |
14:29:24 | FromGitter | <zacharycarter> I'm used to handling errors in a C style |
14:29:33 | FromGitter | <zacharycarter> yeah - sounds like I need them |
14:29:50 | * | snowolf quit (Ping timeout: 250 seconds) |
14:29:53 | FromGitter | <zacharycarter> I used them when I programmed in Java - which I try to actively not do anymore |
14:29:54 | FromGitter | <alehander42> well, you can still use error results, but use an exception only for "fatal" errors |
14:30:00 | FromGitter | <alehander42> similar to go |
14:30:03 | FromGitter | <zacharycarter> good idea |
14:30:59 | * | krux02_ joined #nim |
14:31:36 | * | krux02 quit (Read error: Connection reset by peer) |
14:34:07 | stefanos82 | @narimiran: the .nims file contains switch("out", "bin/foo"), but I used to generate "bin/foo" with nim.cfg; can you remind me the option please? |
14:34:14 | stefanos82 | so I can remove the .nims file? |
14:39:51 | stefanos82 | nevermind, I figure it out |
14:40:07 | stefanos82 | now, how to profile based on the generated .ndi files? |
14:43:25 | stefanos82 | lol I'm losing my mind here...be right back |
14:47:59 | FromGitter | <zacharycarter> stefanos82: might be a good idea to read a tutorial on valgrind |
14:48:12 | FromGitter | <zacharycarter> it's not the easiest of tools to use - especially if you're new to software profiling |
14:49:50 | * | krux02_ is now known as krux02 |
14:56:27 | * | snowolf joined #nim |
14:57:24 | stefanos82 | @zacharycarter: yeah, I haven't profiled anything before |
14:58:04 | stefanos82 | anyway, I'm off for now with Nim; I cannot figure out what's going on |
14:59:03 | FromGitter | <zacharycarter> stefanos82: ping me when you're back around and maybe I can help some more |
14:59:25 | FromGitter | <zacharycarter> might be difficult without access to a debian box but I can always create a vm |
14:59:27 | FromGitter | <zacharycarter> maybe... |
14:59:29 | FromGitter | <narimiran> @stefanos82: doesn't it work when you remove .nims file? what is the problem? |
15:00:51 | * | snowolf quit (Ping timeout: 252 seconds) |
15:03:17 | stefanos82 | @narimiran: I have managed to generate ndi files but profiling them generates an empty results text file |
15:04:05 | stefanos82 | all I want is to see what causes delay on compilation and execution of a binary file |
15:04:12 | stefanos82 | it used to do such thing instantly |
15:04:53 | PMunch | Is there a way to have overlap between two branches of an object variant? |
15:04:56 | FromGitter | <narimiran> wait, are you using nimprof or something else? |
15:06:12 | PMunch | I have three cases, which are almost a standard Venn diagram of fields |
15:06:59 | FromGitter | <alehander42> @PMunch what is your usecase |
15:08:00 | PMunch | Trying to represent this: web3js.readthedocs.io/en/1.0/glossary.html#glossary-json-interface |
15:09:36 | PMunch | So function and constructor share all but the "name" field, and event share type and name, but is otherwise different |
15:09:49 | FromGitter | <alehander42> @PMunch, honestly I think shared fields might be the best solution(if I understand correctly) |
15:10:09 | PMunch | So function and event share the type and name field |
15:10:16 | PMunch | Shared fields? |
15:10:45 | FromGitter | <alehander42> https://github.com/nim-lang/Nim/issues/3629 |
15:10:58 | FromGitter | <alehander42> I just asked Araq today about it, I also want to have it for other goals |
15:13:52 | FromGitter | <alehander42> so e.g. you'll define `type` for the three of them, `name` for function and event, and the other fields for function and constructor |
15:14:31 | FromGitter | <alehander42> (I prefer the other way, where you define `function`: fields `event`: fields(some overlapping) etc , but Araq doesnt like it for some reason ) |
15:14:53 | PMunch | I prefer Araq's syntax |
15:15:13 | PMunch | But Varriount has a point that it diverges from the normal case statement.. |
15:16:24 | stefanos82 | @narimiran: I used both nimprof and then valgrind |
15:16:32 | FromGitter | <alehander42> yes, also if you think about how adt-s work in most languages, the other syntax makes more sense, e.g. its almost like Function(type, name, b) Event(type, name, c) Other(type, other, e) |
15:17:18 | FromGitter | <alehander42> but I don't care, Araq's ordering is fine (one can always have a custom macro for that) |
15:17:20 | FromGitter | <zacharycarter> is there any way to get targetOS and targetCPU at compile time? like inside of a nimble file? |
15:17:43 | FromGitter | <alehander42> @PMunch also, he proposed to use `if` instead of `case` for such shared cases for that reason |
15:17:51 | FromGitter | <alehander42> but not in the issue |
15:18:02 | FromGitter | <mratsim> @zacharycarter there are hostCPU const |
15:18:12 | FromGitter | <mratsim> and for OS you have to use when defined |
15:18:25 | FromGitter | <mratsim> there are wiki pages about it but incomplete |
15:18:37 | FromGitter | <mratsim> for example I couldn’t find how Nim detects iOS |
15:18:53 | FromGitter | <zacharycarter> thank you @mratsim |
15:19:54 | * | snowolf joined #nim |
15:24:43 | * | tribly is now known as und |
15:25:11 | * | und is now known as tribly |
15:26:58 | dom96_w | Someone just sent me a lot of Nim stickers because they didn't need them :O |
15:27:50 | PMunch | Didn't need them? Where did they get them from in the first place :P |
15:29:34 | FromGitter | <mratsim> Just in time for FOSDEM |
15:31:15 | stefanos82 | in other words, they are rejecting the language? |
15:33:13 | FromGitter | <alehander42> I just imagine dom96 going back in his home and opening the door to be smashed by a mountain of stickers (like the old "letters after 5 years" scenes in movies) |
15:33:34 | stefanos82 | lol |
15:33:38 | stefanos82 | that was a good one |
15:34:45 | * | nsf quit (Quit: WeeChat 2.3) |
15:38:31 | PMunch | Hmm, I should start looking at plane tickets to FOSDEM |
15:39:19 | FromGitter | <mratsim> I should start to look for train tickets but with my French luck there will be a strike :D |
15:40:25 | PMunch | Hmm, I wish we had trains |
15:40:35 | PMunch | They really are the most comfortable way to travel |
15:40:43 | PMunch | Would take forever to get anywhere from here though :P |
15:41:20 | Araq | alehander42: again, if we support sum types like the others, we can use the same syntax. |
15:41:35 | Araq | but we don't support them like the others so the syntax should be different |
15:42:02 | FromGitter | <alehander42> @mratsim french trains were great, jealous! |
15:42:16 | FromGitter | <alehander42> Araq, is this only because of no full compile time field checking? |
15:42:38 | FromGitter | <mratsim> how do you do compile-time type checking with run time types? :D |
15:43:28 | FromGitter | <alehander42> eh, you require `.<kindField> == ` or `<kindField> in ` or `init with this kind` |
15:43:35 | FromGitter | <alehander42> and narrow the type in the branch |
15:43:42 | FromGitter | <alehander42> the same as with nilable types |
15:43:42 | Araq | yes, "only because" we do it completely differently |
15:44:05 | Araq | unguarded field access is bad but the compiler uses it *everywhere* |
15:44:54 | * | kapil____ joined #nim |
15:46:18 | FromGitter | <alehander42> Araq, eh, I guess it mostly uses it when it passes a node to another function which doesn't check the field again? |
15:48:15 | Araq | who knows. your words make sense but it could also be more complex invariants |
15:51:25 | Araq | and I don't mind {.fixCaseObjects: on.} or {.notNilWorksNow: on.} but fixing what we have is more important than adding more of the broken stuff like "if in object declarations" |
15:52:23 | FromGitter | <alehander42> well, fixing notnil or similar is "fixing what we have" |
15:52:34 | Araq | yes, exactly |
15:52:40 | Araq | but we don't have "if in objects" |
15:53:06 | FromGitter | <alehander42> well, it can be just `case` |
15:53:17 | FromGitter | <alehander42> one can always argue that case objects also require fixing |
15:53:36 | FromGitter | <alehander42> everybody that uses them sooner or later tries to share fields |
15:54:00 | Araq | really? how so? Rust doesn't support field sharing |
15:54:07 | Araq | nor ML, Haskell... |
15:54:16 | Araq | or any other language with ADTs |
15:54:49 | FromGitter | <mratsim> Haskell allows fields of th same name |
15:54:49 | FromGitter | <alehander42> eh, they all do |
15:54:54 | FromGitter | <alehander42> but its like |
15:55:03 | FromGitter | <alehander42> they usually dont require actual field names |
15:55:27 | Araq | field of the same name != field sharing |
15:55:54 | dom96_w | PMunch: mratsim: now that I live in London I'll be able to take the train too :D |
15:55:56 | FromGitter | <alehander42> ah, so by field sharing, you mean literal field memory sharing |
15:56:07 | FromGitter | <alehander42> I never `reset` so I don't care for that one |
15:56:08 | Araq | this discussion suffers from a total confusion of terminology |
15:56:09 | FromGitter | <mratsim> I think people requested to be able to use the same name |
15:56:16 | FromGitter | <mratsim> fields of* |
15:56:20 | dom96_w | stefanos82: no, they aren't rejecting Nim. They just bought a lot of stickers and didn't have a need for them all |
15:56:24 | FromGitter | <mratsim> I didn’t see any mention of field sharing |
15:56:37 | stefanos82 | dom96_w: ah I see |
15:56:42 | Araq | mratsim: The original RFC was about real field sharing iirc |
15:56:46 | FromGitter | <alehander42> Araq, you said `you can easily see the "shared" aspect of the fields.` |
15:56:56 | FromGitter | <alehander42> so I probably used sharing incorrectly after that |
15:56:59 | FromGitter | <alehander42> but that's what I meant |
15:57:10 | dom96_w | Strangely the stickers look higher quality than the ones I bought a while ago... and they are from the same company |
15:57:18 | Araq | well I always assumed people want real field sharing, not merely using the same name for different field offsets |
15:57:41 | FromGitter | <alehander42> hm, I doubt it |
15:57:54 | Araq | otherwise it's just a minor annoyance, you have to come up with unique names |
15:58:03 | FromGitter | <alehander42> but this sucks so much |
15:58:08 | FromGitter | <alehander42> why would the language make me do it |
15:58:14 | FromGitter | <alehander42> when it's very easy to support it |
15:58:22 | Araq | ^^ becaues the field accesses can be unguarded |
15:58:35 | Araq | echo obj.ambiguousFieldNameHere |
15:58:48 | Araq | I dunno what's hard to understand about it |
15:59:22 | Araq | and what is easy to support about that? we have to change how obj.field works |
15:59:46 | dom96_w | Didn't we already decide what will happen with this? |
16:00:03 | dom96_w | i.e. same names are allowed as long as their types don't change between branches |
16:00:07 | Araq | "You can only use 'field' in a pattern matching context here because it is ambiguous. Too bad we don't have pattern matching in the language." |
16:00:10 | FromGitter | <alehander42> well, if there is ambuguity AND the field is unguarded, this is an error |
16:00:19 | FromGitter | <alehander42> and you require the user to guard it |
16:00:37 | FromGitter | <alehander42> this wouldnt affect the compiler |
16:00:41 | FromGitter | <alehander42> for example |
16:00:46 | FromGitter | <alehander42> and all existing variant objects |
16:01:04 | FromGitter | <mratsim> I agree with dom, same name as long as the same type is used. |
16:01:15 | FromGitter | <mratsim> though in terms of memory layout I don’t know what is happening. |
16:01:20 | PMunch | How do you get the string name of an identifier in a template again? |
16:01:30 | Araq | astToStr(), PMunch |
16:01:45 | PMunch | Ah thanks |
16:01:53 | FromGitter | <mratsim> only works in template by the way, otherwise you get your parameter ident |
16:02:59 | FromGitter | <alehander42> Araq, you dont have to include `pattern matching` in the error message, `have to check for <kind field name> before using it with if` is sufficient |
16:03:19 | Araq | dom96_w, following this path implies never to have ML-like union types |
16:03:31 | Araq | so the discussion is open again |
16:03:34 | FromGitter | <alehander42> or another option is to share it directly in the object indeed: |
16:03:50 | FromGitter | <alehander42> is the issue here that it might make the object size bigger |
16:03:55 | dom96_w | Araq: is that what we want? Nim hasn't been designed to be ML-like and it might be too late to steer it that way |
16:04:29 | Araq | dom96_w, well many people seem to really want that. |
16:04:37 | dom96_w | Surely some clever macro can be created to get ML-like unions ;) |
16:05:11 | Araq | yeah but that arguments cuts both ways |
16:05:11 | Zevv | dom96_w: should I file a new issue for the "let a = [ int ]" -> Unhandled exception |
16:05:33 | dom96_w | Zevv: if the compiler crashes then of course |
16:05:51 | * | narimiran joined #nim |
16:05:53 | Araq | I can also say "If you need field name sharing, use a macro" |
16:08:08 | Araq | and why would I want to use the same name for two different things? |
16:08:10 | PMunch | http://ix.io/1vOm/Nim <- "Solution" |
16:08:29 | dom96_w | It's never two different things |
16:08:55 | dom96_w | There are often cases where I want a field to be part of multiple "kinds" except one |
16:08:58 | dom96_w | I can't do that |
16:09:11 | dom96_w | I can only share it with one kind or all of them |
16:09:24 | Araq | ok but then you argue for field sharing, not merely field *name* sharing |
16:09:46 | dom96_w | field name sharing is a good compromise, for now at least |
16:09:55 | Araq | but how so? :-) |
16:10:21 | Araq | I think it only leads to confusing code |
16:11:38 | krux02 | arnetheduck: process killing is a form of GC |
16:12:02 | krux02 | eh, again, wrong scrolling and I made an out of context comment |
16:12:04 | krux02 | sorry |
16:12:23 | FromGitter | <alehander42> so basically field sharing wouldn't be optimal for a: A only if for all unions ⏎ A > sizeof(A_Union_with_A) - size(A) ⏎ A > sizeof(A_Union_other) |
16:13:59 | FromGitter | <alehander42> no, bollocks, it's always optimal |
16:14:19 | FromGitter | <alehander42> well in this case I agree, direct field sharing might be also ok |
16:24:07 | * | floppydh quit (Quit: WeeChat 2.3) |
16:27:36 | FromGitter | <alehander42> well obviously there is some overhead in some cases, i am horrible at math |
16:27:49 | FromGitter | <alehander42> btw Araq: I have another idea |
16:28:34 | FromGitter | <alehander42> does the compiler optimize away some branches at least locally (I guess maybe gcc does it?) |
16:29:11 | FromGitter | <alehander42> so e.g. if you have ⏎ if a.kind == ..: ⏎ .. ⏎ .. # not touching a.kind ⏎ ..... if a.kind == the same: ... [https://gitter.im/nim-lang/Nim?at=5c0fe5d728907a3c7b034db3] |
16:30:05 | FromGitter | <alehander42> (the same with case a.kind / switch in C) |
16:31:52 | FromGitter | <alehander42> if such an optimization happens somewhere, one can have a template that expands `aSharedName` to `aSharedName<id>` which will actually be equally fast in most cases (and if it's not, it will be equivalent to a much needed assert) |
16:35:04 | Araq | the C backends do these optimizations |
16:36:22 | FromGitter | <alehander42> if that's so, I can have a macro which maps `aFieldName` to several internal fields and exposes a template for accessing it |
16:42:26 | Araq | yup |
16:43:44 | Araq | but where is the fun in that? Let's instead push for more RFCs, more language features and more regressions |
16:43:51 | Araq | ;-) |
16:45:55 | FromGitter | <alehander42> well, I always knew that, but I didn't realize in many cases it wouldn't actually lead to slower access |
16:46:33 | FromGitter | <alehander42> it still seems as a feature that should be builtin tho: but that's always a subjective language design decision |
16:48:23 | PMunch | Hmm, issue with my "fix" it won't see the field as a var. And as such can't call eg. add on it.. |
16:49:53 | * | PMunch quit (Remote host closed the connection) |
16:55:54 | FromGitter | <zah> I think the preferences of the ML-crowd are misguided. The extra flexibility in case objects is useful sometimes |
16:58:03 | FromGitter | <alehander42> what is extra flexible in case objects? |
16:59:38 | FromGitter | <zah> the shared fields you were discussing |
17:01:14 | FromGitter | <alehander42> I love shared fields, I think the original issue was for "partially" shared fields tho: fields that are available e.g. only in A and A0 cases, but not in A1 |
17:01:38 | FromGitter | <zah> that's what I meant too |
17:02:08 | FromGitter | <alehander42> well, this is not directly possible right now |
17:02:51 | FromGitter | <alehander42> that's less flexible |
17:03:53 | FromGitter | <zah> yes, and I meant that allowing these partially shared fields is useful |
17:04:47 | FromGitter | <alehander42> ah, I always thought this is the more ML-like opinion |
17:08:44 | * | Ven`` joined #nim |
17:13:12 | * | Ven`` quit (Ping timeout: 250 seconds) |
17:13:15 | * | Trustable joined #nim |
17:19:39 | * | nc-x joined #nim |
17:20:10 | FromGitter | <arnetheduck> what's the status of `{.pure.}` and enums? manual says they make a difference but @mratsim mentioned they had been.. made noops? |
17:23:38 | FromGitter | <alehander42> something like this(adapted patty's macro, but applicable to more traditional case-like macro) would be the metaprog alternative for shared names https://gist.github.com/alehander42/0ca59871568568540a899bfac4a0adfc |
17:24:05 | * | Tyresc joined #nim |
17:25:14 | FromGitter | <mratsim> @arnetheduck https://github.com/nim-lang/Nim/issues/8066#issuecomment-415323980 |
17:25:18 | FromGitter | <mratsim> enjoy the read |
17:26:11 | FromGitter | <mratsim> oh maybe it does something: https://github.com/nim-lang/Nim/commit/2f7b979e384ff6cc750e123939401a72c3f59093#diff-8af935b2312d6a0974d7f32b58bda4f2R981 |
17:26:23 | FromGitter | <mratsim> but that something changed and I thought it was removed altogether? |
17:26:24 | nc-x | narimiran: all the known issue regarding the nims file would be fixed soon. The problem was that when you have a nims file compiler adds the define for nimscript and tries to execute the nims file. But along with it, it also passed other arguments like --profiler:on to the nimscript execution. Now the codebase is filled with when defined(nimscript) and when defined(profiler) and both are mostly exclusive cases that is can't be run togethe |
17:27:11 | nc-x | So the compiler was choking on the nims file and never reached to compile the nim file |
17:27:29 | nc-x | same case is with -d:nodejs as reported on some github issue |
17:27:40 | nc-x | nodejs and nimscript can't be together |
17:28:47 | nc-x | So the best fix I found is to undefine these problematic defines if they are passed as arguments while processing nimscript and later during processing of nim file use those arguments |
17:29:07 | nc-x | I have a fix almost ready. Will complete it tomorrow. |
17:30:08 | nc-x | Araq: does the fix sound good to you? or is there a better way it should/could be done? |
17:30:49 | FromGitter | <arnetheduck> @mratsim I'm kind of not a fan of every enum value being prefixed (`abcXxx`, `abcYyy`) - which is the practical outcome of enums not having their own scope - though in truth, I put `pure` there yesterday because the surrounding code had it :) |
17:31:53 | FromGitter | <mratsim> you only have to qualify if it’s unclear now. In the past {.pure.} forced qualifications |
17:32:13 | FromGitter | <mratsim> I still think it should be renamed to {.qualified.} or removed. |
17:32:34 | FromGitter | <mratsim> and import qualified foo is clearer than from foo import nil |
17:32:50 | FromGitter | <mratsim> when we want to force module namespace |
17:33:51 | FromGitter | <arnetheduck> yeah, but that stinks because it means if I add an import, code breaks.. more importantly, if someone adds something to their unrelated module, my code breaks.. not a good situation if you want a thriving eco-system of library code reuse |
17:35:27 | * | snowolf quit (Ping timeout: 264 seconds) |
17:37:10 | narimiran[m] | nc-x great to hear you already have the fix! |
17:37:53 | * | vlad1777d joined #nim |
17:45:38 | * | stefanos82 quit (Remote host closed the connection) |
17:47:17 | * | jjido joined #nim |
17:53:51 | Araq | nc-x, sounds good. We could also give nimscript its own system.nim ... |
17:56:23 | Araq | arnetheduck: a new version of a library always means some effort on your part. I don't see a way around it that doesn't amount to fooling oneself. |
17:57:05 | Araq | for example, the proc foo that used could have grown a new default parameter. Not too bad, right? Except when you used the proc as a first class object. |
17:57:32 | FromGitter | <arnetheduck> no it doesn't, as long as it only adds stuff (which is a pretty common scenario). unless of course, the language makes it impractical to insulate yourself from additions |
17:57:40 | Araq | solution: Remove default parameters from the language (?) |
17:58:27 | Araq | overloading has similar problems. so lets better remove that feature too. |
17:59:22 | Araq | and if I add new public fields to an object that too can break user's code |
18:00:20 | FromGitter | <arnetheduck> well, what you're basically saying is "there are no safe spaces in nim that allow frictionless upgrades" - which is in line with what I said: it hampers the development of a thriving library eco-system |
18:01:51 | Araq | a property that Nim shares with most other languages out there. |
18:02:05 | FromGitter | <arnetheduck> but for enums, it's kind of minor.. I find it more annoying with `import` |
18:05:21 | * | nc-x quit (Ping timeout: 256 seconds) |
18:07:07 | Araq | I have yet to experience any problems with it. |
18:20:04 | * | nsf joined #nim |
18:33:53 | * | kapil____ quit (Quit: Connection closed for inactivity) |
18:46:01 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:12:17 | * | zachk joined #nim |
19:13:03 | * | zachk quit (Changing host) |
19:13:03 | * | zachk joined #nim |
19:35:20 | * | jjido quit (Ping timeout: 250 seconds) |
19:39:36 | * | snowolf joined #nim |
19:44:21 | * | PMunch joined #nim |
19:50:08 | * | nsf quit (Quit: WeeChat 2.3) |
20:04:47 | * | voice_ftp quit (Ping timeout: 240 seconds) |
20:06:13 | * | voiceftp joined #nim |
20:06:38 | * | Trustable quit (Remote host closed the connection) |
20:34:17 | * | shpx joined #nim |
20:35:32 | * | banc quit (Quit: Bye) |
20:37:16 | * | snowolf quit (Ping timeout: 260 seconds) |
20:39:05 | * | snowolf joined #nim |
20:45:26 | Zevv | Why does asyncHttpServer demand my handle proc is gcsafe, even when threads are not enabled? |
20:45:52 | Araq | mostly because we want --threads:on to become the default |
20:45:55 | Zevv | it's a bit of a nuisance, either I get warnings all of the time, or I have to declare any data that is used by the http handler as thraedvar |
20:46:12 | Araq | well yes. or you pass your data around via parameters |
20:46:12 | Zevv | I understand, but the semantings of handling things like http in a threaded context is a pita |
20:46:24 | Araq | which is almost universally regarded good style |
20:46:33 | * | banc joined #nim |
20:47:33 | * | narimiran quit (Ping timeout: 245 seconds) |
20:47:55 | Zevv | good style if you are doing threads. But in a context where I know everything is single threaded async, isn't it bettery style to just have things the obvious and simple way? |
20:48:49 | Zevv | I'm getting tangled up mixing channels and async stuff |
20:49:06 | * | lritter joined #nim |
20:49:33 | Zevv | anywas, having threads enabled by default is indeed a good reason |
20:49:38 | Zevv | so I'll have to cope with that. |
21:02:45 | * | Snircle_ joined #nim |
21:03:28 | * | Snircle quit (Read error: Connection reset by peer) |
21:05:08 | * | snowolf quit (Ping timeout: 268 seconds) |
21:18:55 | * | Vladar quit (Remote host closed the connection) |
21:23:09 | * | voiceftp quit (Read error: Connection reset by peer) |
21:23:30 | * | voiceftp joined #nim |
21:26:32 | FromGitter | <arnetheduck> @Zevv https://github.com/nim-lang/Nim/issues/9878 is the place to raise concerns.. I'm almost surprised it got that much support ;) |
21:28:24 | Zevv | I'm all for it. If there are any issues arising from using threads it is better to catch and solve those early then to postpone and hide them in single threaded systems. |
21:28:57 | Zevv | :thumbs-up:++ |
21:29:15 | * | PMunch quit (Remote host closed the connection) |
21:30:23 | Zevv | Funny side note: I wondered how handling shared data is done in Jester, so I took Dom's example from the Nim book. Guess what warning came up :) |
22:09:18 | dom96 | heh, just replied to your issue :) |
22:09:28 | dom96 | Delegating to Araq, nothing interesting :P |
22:11:23 | * | ng0 quit (Remote host closed the connection) |
22:49:53 | * | noonien joined #nim |
22:58:24 | * | snowolf joined #nim |
23:00:02 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:05:11 | * | ftsf joined #nim |
23:09:59 | * | fthe joined #nim |
23:13:16 | * | shpx joined #nim |
23:21:26 | * | fthe quit (Ping timeout: 246 seconds) |
23:39:13 | * | fthe joined #nim |
23:46:36 | * | krux02 quit (Remote host closed the connection) |