00:05:41 | FromGitter | <rayman22201> slightly off topic, but this is damn cool: https://www.youtube.com/watch?v=mOtKD7ml0NU |
00:06:10 | FromGitter | <rayman22201> How close to linear types can you get with Nim macros and typedesc? |
00:06:27 | FromGitter | <rayman22201> *philosophical question hat |
00:31:37 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:50:32 | * | CcxWrk quit (Ping timeout: 250 seconds) |
00:58:49 | bozaloshtsh | what would be a good way to make an async proc 'atomic'? Meaning that it will wait if another instance of it is running. |
00:59:11 | bozaloshtsh | the last word 'running' means 'waiting for a async call within it to finish' |
01:06:36 | * | lritter quit (Ping timeout: 252 seconds) |
01:07:17 | * | lritter joined #nim |
01:08:45 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:22:09 | * | CcxWrk joined #nim |
01:31:02 | FromGitter | <rayman22201> @bozaloshtsh I'm not sure If I understand the question? You can do https://nim-lang.org/docs/asyncdispatch.html#waitFor%2CFuture[T], or check the status of a future with https://nim-lang.org/docs/asyncfutures.html#finished%2C |
01:34:21 | FromGitter | <rayman22201> If I understand you correctly, what you are asking kind of defeats the purpose of async. What you really want is something like locks: https://nim-lang.org/docs/locks.html |
01:37:27 | bozaloshtsh | rayman22201: Here is a more concrete exa |
01:37:32 | bozaloshtsh | example* |
01:37:59 | * | NimBot joined #nim |
01:38:10 | bozaloshtsh | A will be called repeatedly, but I don't want any calls to B from separate calls to A to be interleaved. |
01:38:57 | * | vlad1777d quit (Remote host closed the connection) |
01:39:23 | bozaloshtsh | I'm not defeating the purpose of async; I want the event loop to continue running between calls to B, just calls to A have to wait. |
01:39:58 | bozaloshtsh | locks don't work because they block the main thread |
01:40:33 | FromGitter | <rayman22201> locks won't block the main thread. They will block whatever thread is running B() |
01:40:47 | leorize | you can just poll until B() is finished |
01:41:04 | * | vlad1777d joined #nim |
01:41:59 | bozaloshtsh | rayman22201: I assume B() is running in the same thread as everything else. I don't use threads, only asyncdispatch which I understand to be single-threaded. |
01:42:15 | bozaloshtsh | leorize: like asyncdispatch's poll proc? Doesn't that also block the main thread? |
01:42:24 | FromGitter | <rayman22201> poll blocks |
01:42:38 | FromGitter | <rayman22201> You are going to have to block somehow to get those semantics |
01:42:57 | leorize | you can set a timeout for `poll()` |
01:43:05 | leorize | it's 500ms by default I think |
01:44:56 | bozaloshtsh | leorize: where do you propose this poll call be placed? Inside of A? |
01:46:25 | bozaloshtsh | rayman22201: I don't think so. It can be done with a queue and some async magic |
01:46:57 | FromGitter | <rayman22201> A queue is a form of blocking :-P |
01:47:05 | bozaloshtsh | yeah, but only calls to A are blocked |
01:47:16 | bozaloshtsh | that's perfectly fine, I just don't want other things that are happening to be blocked |
01:47:45 | bozaloshtsh | and ideally, I want this to be baked into the future that A() returns |
01:49:56 | FromGitter | <rayman22201> The naive thing you could do would be something like: ⏎ let b_fut = B() ⏎ while (true): ⏎ if(b_fut.finished()): ⏎ ... [https://gitter.im/nim-lang/Nim?at=5c09d1c44808192b03f8b30e] |
01:50:17 | FromGitter | <rayman22201> inside of A() |
01:51:00 | bozaloshtsh | yep, but the while true blocks everything else |
01:51:11 | FromGitter | <rayman22201> that's why you sleepAsync |
01:51:35 | FromGitter | <rayman22201> that returns control to the event loop. Sorry for the crappy formatting, that sleepAsync is inside the while loop |
01:51:37 | bozaloshtsh | and if sleepAsync entertains a call to A again? |
01:51:50 | bozaloshtsh | remember, A is triggered asynchronously as well. |
01:52:37 | FromGitter | <rayman22201> hrmmm. yes. you are right. That won't work. You have to make b_fut be "global" or at least keep that as state somewhere |
01:52:41 | bozaloshtsh | I think the standard library has nothing for me here, I'm going to have to roll my own async lock |
01:52:59 | FromGitter | <rayman22201> you are correct, there is nothing built in to Nim for this |
01:53:29 | FromGitter | <rayman22201> also, the sleepAsync solution makes it super not performant / bad impl imo |
01:54:03 | FromGitter | <rayman22201> You could wrap B() in helper that keeps the state / keeps a queue. |
01:55:00 | FromGitter | <rayman22201> You are essentially re-implementing condition variables for async. |
01:55:22 | bozaloshtsh | rayman22201: yep, it seems that's what I'm doing right now |
01:55:34 | FromGitter | <rayman22201> there be dragons 🐉 |
02:06:18 | FromDiscord_ | <Virepri> Ok so, I must be stupid. Is it possible to have variables in a seperate nim file? I'm just not able to figure out how to reference one. |
02:06:31 | FromDiscord_ | <Virepri> this is my directory structure |
02:06:31 | FromDiscord_ | <Virepri> https://cdn.discordapp.com/attachments/371759389889003532/520420810331127827/unknown.png |
02:06:49 | FromDiscord_ | <Virepri> and I'm trying to reference `day1.input`, but it just can't seem to find its existence |
02:08:47 | FromDiscord_ | <Virepri> like, what _should_ my file structure look like? |
02:10:48 | FromGitter | <rayman22201> did you add the `*` character to export the variable? https://nim-lang.org/docs/manual.html#procedures-export-marker |
02:11:03 | FromDiscord_ | <Virepri> oh |
02:11:33 | FromDiscord_ | <Virepri> yup, that did it, as a matter of fact |
02:11:36 | FromGitter | <rayman22201> lol. np. It's a common mistake. |
02:11:46 | FromDiscord_ | <Virepri> thanks! Sorry if I ask a buncha dumb questions, I'm just totally new to nim |
02:11:58 | FromGitter | <rayman22201> no worries. glad to have you |
02:17:57 | * | virepri joined #nim |
02:18:17 | * | virepri quit (Remote host closed the connection) |
02:19:55 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
02:25:28 | * | theelous3_ quit (Ping timeout: 246 seconds) |
02:26:32 | FromDiscord_ | <technicallyagd> Does anyone here use https://github.com/zero-functional/zero-functional ? |
02:27:12 | FromDiscord_ | <technicallyagd> It looks really neat, but I can't get nimsuggest to provide auto-complete for its routines |
02:29:12 | FromDiscord_ | <technicallyagd> @Virepri Welcome! always glad to see more people start using nim |
02:29:39 | FromDiscord_ | <Virepri> @technicallyagd ty! |
02:35:50 | bozaloshtsh | rayman22201: https://hastebin.com/raw/ikevipetaf |
02:36:04 | bozaloshtsh | this is what I came up with, and it seems to solve my synchronization problem |
02:39:19 | * | zachk quit (Quit: Leaving) |
02:41:19 | * | a_chou joined #nim |
02:59:57 | * | dddddd quit (Remote host closed the connection) |
03:02:11 | * | a_chou quit (Remote host closed the connection) |
03:02:30 | * | a_chou joined #nim |
03:03:14 | FromGitter | <m4d3bug> How to design the parameters when a function accepts one more key-value pairs in the Nim? |
03:07:43 | * | banc quit (Quit: Bye) |
03:09:40 | FromGitter | <m4d3bug> such as echo |
03:21:41 | FromDiscord_ | <technicallyagd> https://nim-lang.org/docs/manual.html#types-varargs |
03:21:51 | FromDiscord_ | <technicallyagd> do you mean varargs? |
03:24:10 | * | banc joined #nim |
03:28:14 | FromGitter | <m4d3bug> It seems good choice |
03:30:37 | * | a_chou quit (Quit: a_chou) |
03:31:22 | FromDiscord_ | <technicallyagd> That's how echo does it |
03:39:49 | FromGitter | <m4d3bug> what If I need them to consist key-value pairs? @technicallyagd |
03:55:25 | FromGitter | <gogolxdong> Is there a way to parse php in Jester? |
04:12:28 | FromDiscord_ | <technicallyagd> @m4d3bug I am not sure, maybe use tables? https://nim-lang.org/docs/tables.html |
04:14:50 | * | vlad1777d quit (Ping timeout: 268 seconds) |
04:35:54 | FromGitter | <zacharycarter> sweet |
04:36:30 | FromGitter | <zacharycarter> my lock-free work stealing job system is working in my engine :D with bgfx :D |
04:42:44 | FromGitter | <zacharycarter> the render thread is tied to the main thread and then I can toss jobs at a scheduler |
04:43:27 | FromGitter | <zacharycarter> each job executes on its own thread and I can pass data to jobs as pointers to data living on the shared heap |
04:43:44 | * | nsf joined #nim |
04:50:34 | * | narimiran joined #nim |
04:51:10 | FromGitter | <zacharycarter> https://github.com/zacharycarter/zeal/tree/JobScheduler |
04:57:37 | * | endragor joined #nim |
05:03:38 | * | lritter quit (Remote host closed the connection) |
05:04:30 | FromGitter | <rayman22201> @bozaloshtsh cool. good stuff. It's small but it would be useful as a nimble pkg. Speaking of which, I just discovered there already is a nimble package with a similar implementation by cheatface: https://github.com/cheatfate/asynctools. I always forget about https://nimble.directory/ |
05:06:37 | FromGitter | <rayman22201> also @zacharycarter congrats. looks like you are making a lot of progress. That's awesome. |
05:13:40 | FromGitter | <zacharycarter> thanks! |
05:52:22 | FromGitter | <gogolxdong> @zacharycarter Is your hyperHTML going on ? |
05:53:43 | FromGitter | <zacharycarter> @gogolxdong - no I haven't been doing much web dev lately |
05:54:02 | FromGitter | <zacharycarter> I have to do too much of that at work for it to be fun outside of it |
06:06:11 | FromGitter | <xmonader> I wrote down the good, and pain points of using Nim in production https://xmonader.github.io/nim/2018/12/06/nim-good-ok-hard.html as an enduser of the technology |
06:09:24 | narimiran | @xmonader do you have twitter? will you post a link there too? |
06:10:05 | bozaloshtsh | rayman22201: oh, cool, thanks for digging this up. That implementation is quite simple to what I wrote but I can tell that there's been many more hours of debugging behind it. |
06:10:15 | bozaloshtsh | s/simple/similar/ |
06:15:12 | FromGitter | <xmonader> @narimiran I do have one @xmonader (not very active) and just posted the link there |
06:25:55 | narimiran | retwitted :) |
06:26:34 | FromGitter | <xmonader> oh thank you! I hope it doesn't reflect bad on the hard parts though |
06:31:20 | * | anamok joined #nim |
06:31:22 | anamok | hi |
06:31:33 | anamok | How do you remove a given element from a seq? |
06:33:05 | FromGitter | <xmonader> not .delete? |
06:33:36 | FromGitter | <xmonader> if by index i guess .delete if by the actual object you should move go table instead of a sequence |
06:34:18 | anamok | I want to delete by value |
06:34:44 | bozaloshtsh | so I'm trying to figure out why my program is so slow |
06:34:48 | leorize | anamok: use `find()` to look for the index then `del()` |
06:35:05 | bozaloshtsh | I start up nimprof and the stack overflows lol |
06:35:10 | bozaloshtsh | this doesn't bode well |
06:39:09 | anamok | leorize, if you want to keep the order, use delete() |
06:39:40 | leorize | yep |
06:39:45 | anamok | del() moves the last element to the position of the element you want to delete, thus it's O(1), but the order will mess up |
06:39:54 | leorize | actually, you could also use `sequtils.filterIt` |
06:40:46 | anamok | I found what I need: a = @[5, 7, 9] ; a.delete(a.find(5)) ; echo a -> @[7, 9] . Thanks. |
06:42:40 | FromGitter | <data-man> @anamok: Something like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0a166028907a3c7bdf24f7] |
06:45:55 | * | narimiran quit (Ping timeout: 268 seconds) |
07:09:35 | anamok | Dmitry @data-man: thanks |
07:09:46 | * | krux02 joined #nim |
07:43:25 | * | stefanos82 joined #nim |
07:57:38 | * | stefanos82 quit (Remote host closed the connection) |
08:18:07 | FromGitter | <m4d3bug> what is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0a2cbf8d4f3a2a7c8387cc] |
08:22:59 | FromGitter | <narimiran> @m4d3bug show us your code |
08:24:53 | FromDiscord_ | <Virepri> is there something akin to a nim tour? I've found it super easy to learn D and golang because of them |
08:26:42 | FromGitter | <narimiran> @Virepi: maybe this will do? https://nim-by-example.github.io/getting_started/ |
08:27:35 | FromGitter | <narimiran> @Virepri ^ |
08:29:00 | FromGitter | <alehander42> I think @PMunch was working on Nim tour |
08:32:36 | FromGitter | <m4d3bug> `````` [https://gitter.im/nim-lang/Nim?at=5c0a30245e409525032ac17b] |
08:32:52 | FromGitter | <m4d3bug> @narimiran |
08:32:55 | anamok | bye |
08:32:58 | * | anamok quit (Remote host closed the connection) |
08:34:18 | FromGitter | <narimiran> "Nim to Rust is on the roadmap." https://news.ycombinator.com/item?id=18622233 |
08:34:18 | FromGitter | <m4d3bug> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0a308a1e86c308233ce985] |
08:34:26 | FromGitter | <narimiran> anybody knows more about it? |
08:35:32 | FromGitter | <narimiran> @m4d3bug `array[string,string]` is the problem. the first parameter must be ordinal, e.g. integer |
08:36:10 | FromGitter | <narimiran> @m4d3bug maybe you're looking for `strtabs` module? |
08:37:36 | FromGitter | <m4d3bug> great |
08:39:44 | FromGitter | <alehander42> is today's aoc interesting |
08:40:54 | FromGitter | <m4d3bug> but how to use varargs and newStringTable together? @narimiran |
08:41:21 | FromGitter | <narimiran> @alehander42 it is (i haven't solved part2 yet, i need to re-do my part1 first) |
08:44:07 | FromGitter | <narimiran> @m4d3bug looking at your input, can't you just pass to function `varargs[string]`? |
08:44:51 | livcd | narimiran: early 1st of April ? :D |
08:45:18 | FromDiscord_ | <Virepri> @narimiran This is actually what I'm currently running off. It gets the job done but I liked the tours because they were very interactive in nature. Idk, maybe I'll build one at some point. |
08:45:25 | FromGitter | <m4d3bug> I can't,it is difference parameter |
08:47:28 | FromGitter | <m4d3bug> I want to treat them differently in next step |
08:48:07 | FromGitter | <m4d3bug> But they are always passed in pairs unknownly |
08:48:55 | livcd | Nim chooses unreadable symbols %* and $$ over clear names like dumps or loads :( <- yeah I also do not like weird symbols and sigils |
08:55:27 | * | Vladar joined #nim |
08:58:36 | * | floppydh joined #nim |
09:16:54 | FromGitter | <alehander42> this is cool https://github.com/mattaylor/elvis |
09:18:24 | FromDiscord_ | <technicallyagd> And there I was, writing `toBool` converters |
09:18:34 | FromDiscord_ | <technicallyagd> This is indeed nice |
09:18:59 | FromGitter | <mratsim> toBool converters are the door to C madness `if 0` |
09:20:06 | FromDiscord_ | <technicallyagd> I know it's dangerous! it's just for AoC |
09:39:09 | FromGitter | <alehander42> converters are useful sometimes, toBool sounds dangerous tho |
09:40:43 | * | PMunch joined #nim |
10:00:18 | Araq | there are no "sigils", there are unary operators |
10:01:06 | Araq | it's fine to not know all this programming jargon, but don't use words you don't understand :P |
10:11:52 | FromGitter | <xmonader> Guys I did a quick update on `nim doc` and added it to the good parts with a note on threadpool:on required flag -_- |
10:12:45 | PMunch | narimiran, how did you meassure the time of your day5 aoc run? |
10:18:12 | FromGitter | <alehander42> are there any other flow-breaking constructs |
10:18:17 | FromGitter | <alehander42> except return, break, continue |
10:19:06 | PMunch | quit? |
10:19:15 | PMunch | Technically flow breaking :P |
10:19:25 | PMunch | raise can be counted as well I guess |
10:20:07 | PMunch | narimiran[m], optimized my day 5 a bit http://ix.io/1vr3/Nim |
10:25:02 | * | dom96_w joined #nim |
10:25:25 | FromGitter | <alehander42> eh I hope quit is compiled to something like ugh |
10:25:27 | FromGitter | <alehander42> no idea |
10:25:33 | FromGitter | <alehander42> probably there is a magic about that |
10:25:53 | FromGitter | <alehander42> because there was somethinmg like "dead code after .." |
10:26:42 | PMunch | Well I think there is a callback you can set that will always run on quit |
10:27:01 | FromGitter | <narimiran> PMunch: i run it 100 times and then divide the measured time by 100 :) |
10:27:50 | FromGitter | <alehander42> yeah its nkRaiseStmt too |
10:27:59 | FromGitter | <alehander42> in semstmts |
10:28:12 | FromGitter | <alehander42> @PMunch yep, no, I was trying to analyze code |
10:28:18 | FromGitter | <alehander42> but yeah addQuitProc is cool |
10:28:29 | FromGitter | <alehander42> btw I remember yglukhov wanted one for compile time |
10:28:42 | FromGitter | <alehander42> (after all the macros are invoked) |
10:29:22 | FromGitter | <yglukhov> yes, that would be cool. But I'm not sure about the exact semantics. |
10:29:44 | FromGitter | <narimiran> PMunch: i've tried running your code and i get index error |
10:29:59 | FromGitter | <yglukhov> What would also be cool is to allow a definition to grow while macros are invoked. |
10:30:05 | FromGitter | <mratsim> the only weird thing about addQuitProc is that you need to tag {.noconv.} |
10:31:04 | * | Snircle joined #nim |
10:31:09 | FromGitter | <narimiran> PMunch here's my input, try it yourself: http://ix.io/1vr5 |
10:31:20 | PMunch | narimiran[m], 0.85ms on average over 100 runs. Not bad. That's only for part1 though |
10:31:44 | FromGitter | <alehander42> @yglukhov yeah, so you want to have access to a non-invocation code location in a macro |
10:32:23 | FromGitter | <alehander42> i wanted that for defining types based on macro invocations too |
10:32:40 | FromGitter | <alehander42> but it might be excessive |
10:32:41 | PMunch | narimiran[m], works fine for me. But takes 2.47ms for some reason |
10:32:47 | PMunch | What's your answer for that one? |
10:33:19 | FromGitter | <narimiran> 10132 |
10:33:30 | PMunch | Yeah okay, so it's doing the right thing |
10:34:16 | FromGitter | <alehander42> can I add a magic to a method ? |
10:34:30 | FromGitter | <narimiran> PMunch: now, why your code raises an error on my computer and works on yours? |
10:34:32 | FromGitter | <yglukhov> @alehander42 I wanted that for registries, and constants and strings so that a registry would not require runtime initialization. But types, and even function bodies would be cool too. |
10:34:40 | FromGitter | <alehander42> oh yeah i can , thats gonna be coo |
10:35:08 | PMunch | narimiran, Nim version? |
10:35:20 | PMunch | And what is the error specifically? |
10:35:37 | FromGitter | <narimiran> Nim Compiler Version 0.19.9 [Linux: amd64]; Compiled at 2018-11-30 |
10:35:50 | FromGitter | <narimiran> Error: unhandled exception: index out of bounds [IndexError] |
10:36:00 | FromGitter | <narimiran> line 13 |
10:36:05 | PMunch | Huh, mine is slightly newer, but that shouldn't matter.. |
10:36:28 | PMunch | Wait, line 13? |
10:36:44 | FromGitter | <narimiran> yes, line 13. happens on stable too. now i'm updating my devel |
10:37:11 | PMunch | Huh, so it seems to jump out of the sequence |
10:38:11 | PMunch | The way it works is that whenever it deletes something it leaves a pointer for how many bytes to skip |
10:38:27 | PMunch | That code is responsible for jumping back through the polymer and finding the first non-deleted thing |
10:40:31 | FromGitter | <narimiran> same error on the latest devel |
10:42:41 | FromGitter | <alehander42> huh isnt it about steps |
10:42:44 | FromGitter | <alehander42> this time |
10:44:37 | PMunch | Slight further optimization and now does 100 runs: http://ix.io/1vr6/Nim |
10:46:24 | PMunch | alehander42, yes this is still day5 :P |
10:47:18 | PMunch | narimiran, you can try to manually type in a polymer and see if that also fails |
10:47:22 | PMunch | A bit easier to debug |
10:52:44 | federico3 | https://lobste.rs/s/yocd3p/nim_good_ok_hard any reply to this? |
10:55:23 | FromGitter | <mratsim> https://www.youtube.com/watch?v=dcUAIpZrwog ? (just joking :P) |
10:55:47 | FromGitter | <mratsim> “How do lobsters grow" |
11:14:49 | Araq | https://www.cs.utexas.edu/users/wcook/papers/OOPvsADT/CookOOPvsADT90.pdf must read for every programmer |
11:19:10 | Zevv | Where do I find documentation about {.multisync.}? |
11:20:22 | Araq | asyncmacro.multisync |
11:20:56 | FromGitter | <alehander42> oh finally part 1 done |
11:45:15 | * | dom96_w quit (Changing host) |
11:45:15 | * | dom96_w joined #nim |
11:45:27 | dom96_w | wow, amazed by the negativity around Rust's new website: https://old.reddit.com/r/programming/comments/a3q3e2/rust_131_and_rust_2018/eb92xqh/ |
11:49:02 | dom96_w | Araq: where is 0.19.2? I generated release notes for it weeks ago |
11:54:58 | * | theelous3_ joined #nim |
12:07:34 | livcd | dom96_w: it reminds me of RoR sites from the old RoR days |
12:08:27 | * | platoff joined #nim |
12:22:55 | * | theelous3_ quit (Ping timeout: 246 seconds) |
12:27:38 | * | dddddd joined #nim |
12:29:18 | * | elb_ joined #nim |
12:32:15 | FromGitter | <narimiran> idiomatic way of checking if all elements of a container A are in a container B? |
12:38:30 | FromGitter | <alehander42> a.allIt(it in b) ⏎ (set(a) - set(b)).card == 0 ⏎ ? |
12:39:16 | FromGitter | <alehander42> toSet(a) - toSet(b) * |
12:39:39 | FromGitter | <narimiran> ok, my idea was to use all(it) |
12:40:15 | FromGitter | <alehander42> probably makes sense to at least toSet b |
12:40:21 | FromGitter | <alehander42> if there are many many iterations |
12:44:11 | M379229[m] | a.toSet <= b.toSet |
12:44:11 | M379229[m] | ? |
12:45:52 | FromGitter | <narimiran> ok, i'll see what will work best for my case. thanks, guys |
12:46:13 | FromGitter | <alehander42> b.toSet.incl(a.toSet) indeed , thank you @M37.. |
12:46:18 | FromGitter | <alehander42> complicated name. |
12:49:00 | M379229[m] | AoC name :) |
12:52:39 | * | M379229[m] left #nim ("User left") |
12:53:15 | * | stefanos82 joined #nim |
12:53:42 | * | M37[m] joined #nim |
12:54:47 | M37[m] | Fixed. |
12:56:38 | FromGitter | <alehander42> hahaha nice |
12:56:39 | FromGitter | <alehander42> sorry |
13:00:50 | M37[m] | Nah, you're right. This is better. It's like having a haircut. |
13:02:10 | FromGitter | <alehander42> Araq: in `new(stuff)` |
13:02:16 | FromGitter | <alehander42> why doesnt it have |
13:02:52 | FromGitter | <alehander42> oh I wrote new(Type) pff, the magic mNew is there normally otherwise |
13:05:58 | FromGitter | <zacharycarter> @xmonader - FYI - the linking problem is specific to linux |
13:06:07 | FromGitter | <zacharycarter> liking dylibs on macOS is simple |
13:06:13 | FromGitter | <zacharycarter> and on windows as well |
13:13:50 | * | nsf quit (Quit: WeeChat 2.3) |
13:25:16 | * | Vladar quit (Remote host closed the connection) |
13:37:56 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:48:46 | * | zahary joined #nim |
13:51:46 | endragor | Is it intended that you can no longer import modules in a `static` block? It was allowed before 0.19 and now it errors out with "'import' is only allowed at top level". Importing in static context was a valid use case, I think |
13:55:05 | * | PMunch quit (Remote host closed the connection) |
13:55:23 | * | PMunch joined #nim |
13:56:37 | PMunch | endragor, yeah I was wondering about that myself the other day |
13:57:40 | * | vegax87 quit (Ping timeout: 252 seconds) |
13:57:52 | * | platoff joined #nim |
14:02:16 | * | endragor quit (Remote host closed the connection) |
14:22:24 | * | vegax87 joined #nim |
14:26:40 | * | vlad1777d joined #nim |
14:31:26 | * | floppydh quit (Quit: WeeChat 2.3) |
14:42:35 | * | endragor joined #nim |
14:47:00 | * | endragor quit (Ping timeout: 246 seconds) |
14:52:42 | * | kungtotte quit (Ping timeout: 252 seconds) |
14:54:56 | * | vlad1777d quit (Ping timeout: 268 seconds) |
14:59:45 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:04:26 | * | kungtotte joined #nim |
15:15:11 | * | PrimHelios joined #nim |
15:15:47 | Araq | it is intended, there are no 'static' imports, an import is always a compiletime statement to begin with |
15:17:39 | PMunch | Yeah but importing in a static block would hide those identifiers from the rest of the scope |
15:17:51 | FromGitter | <arnetheduck> for documenting fields and having the tool pick it up, there's the after-the-field style ⏎ ⏎ ```type Object = ⏎ field: int ## here``` ⏎ ⏎ it's a bit constrained space-wise and promotes useless field docs that repeat the field name and not much else - @timotheecour have you been thinking of anything for this? I think there's some alternate style as well doing `##\` which is kind of ugly.. |
15:17:51 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5c0a8f1ff4880a60a240232d] |
15:18:07 | PMunch | Which meant you could avoid e.g. identifier collision between compile-time and runtime code |
15:18:39 | Araq | that was never done. |
15:18:40 | FromGitter | <arnetheduck> I know you can simply just put the docs whereever you like, but I'm looking for something that has a chance of being picked up by smart tools etc |
15:19:01 | Araq | what previously happened was that 'static' didn't even open a new scope |
15:19:44 | Araq | in the compiler there is one "<imported symbols here>" scope. Not two, not three and they don't nest |
15:20:28 | Araq | arnetheduck, field: type ## \ |
15:20:31 | Araq | ## long comment here |
15:20:38 | Araq | is what should be used |
15:20:56 | Araq | or the new'ish long doc comments |
15:21:03 | Araq | field: type ##[ stuff |
15:21:06 | Araq | more |
15:21:10 | Araq | ]## |
15:22:27 | FromGitter | <arnetheduck> @Araq yeah, I've tried using that on occasion but it's kind of hard to remember and ugly.. also, it's a bit strange that it's about the only place where `\` is needed.. any reason why for example `##` on the line following the field isn't used? that seems consistent with other docs |
15:23:05 | FromGitter | <arnetheduck> alternatively, `##` indented on the next line would "feel" nim-ish too |
15:23:47 | Araq | true and maybe we can make the parser accept it |
15:24:06 | Araq | in a perfect world somebody cleans up the doc comment mess |
15:24:28 | Araq | would also save 8 bytes per PNode |
15:24:45 | FromGitter | <arnetheduck> how so? |
15:25:18 | Araq | currently it has a 'comment: string' field, that's not required if "doc comments can only occur in certain places in the AST" |
15:25:52 | FromGitter | <arnetheduck> ie you'd stick it in `sons`? |
15:26:05 | Araq | yup |
15:26:56 | Araq | there are only ~3 node kinds where it occur really, nkIdentDefs, nkEnumField or free standing in an nkStmtList |
15:27:16 | FromGitter | <arnetheduck> yeah, that sounds kind of reasonable.. though truth to tell, `sons` is a bit unwieldy to work with at times, hard to remember which node has what information at what index |
15:27:31 | Araq | and we already have the "optional stuff is nkEmpty" paradigm |
15:28:00 | Araq | it's unwiedly, yes, but it is consistent and easier to handle than |
15:28:20 | Araq | "there is nkIdentsTypeValue, nkIdentsValue, nkIdentsType..." |
15:30:02 | * | ng0 joined #nim |
15:31:15 | FromGitter | <alehander42> yeah, honestly once I wrote a toy compiler with custom fields for each kind and it was very annoying https://github.com/alehander42/roswell/blob/master/ast.nim#L9 |
15:31:27 | FromGitter | <alehander42> but partly because of the lack of shared fields |
15:32:14 | FromGitter | <alehander42> since then I use `children` usually |
15:35:32 | FromGitter | <arnetheduck> well, other ast's I've seen tend to use some sort of hierarchy to make that more manageable... I wonder if it would help to have constructors for each node type or something, or maybe sons it behind accessors that would consistently get used throughout the compiler |
15:35:52 | FromGitter | <alehander42> but in a patty-like variant macro I'd include both: ⏎ e.g. ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5c0a935811bb5b25047a7c9c] |
15:36:36 | FromGitter | <arnetheduck> I think for nkFuncDef there's a bunch of constants defined (namepos or whatever) |
15:36:44 | FromGitter | <alehander42> so the macro will create `init` constructors for each kind and `[]` will work for kinds where the "special" fields are all the same `T` |
15:39:10 | FromGitter | <alehander42> basically, its very useful to have the ability to iterate through/index all the "children", and it's nice to have property names for some of them, so automating this in the definitions seems best |
15:39:39 | * | krux02 quit (Remote host closed the connection) |
15:40:38 | Araq | arnetheduck: yeah, the lack of accessors is biting us, but I'll introduce them soon'ish |
15:41:32 | Araq | because then I can also play more easily with alternative AST representations in memory, as I keep saying, I want to try an approach inspired by my packedjson project |
15:42:12 | * | narimiran joined #nim |
15:45:31 | dom96_w | Araq: 0.19.2? What's the status? |
15:47:39 | FromGitter | <arnetheduck> neat |
16:02:17 | * | Vladar joined #nim |
16:03:29 | * | platoff joined #nim |
16:13:34 | * | Trustable joined #nim |
16:21:31 | * | snowolf quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
16:25:02 | * | PMunch quit (Remote host closed the connection) |
16:28:35 | * | Tyresc joined #nim |
16:30:23 | * | snowolf joined #nim |
16:46:00 | * | rockcavera quit (Remote host closed the connection) |
16:50:01 | * | rockcavera joined #nim |
17:06:06 | * | hzx joined #nim |
17:07:21 | hzx | Hey! Is there anything in the osproc that is similar to win32 api ShellExecute? |
17:17:47 | shashlick | How about poEvalCommand |
17:21:34 | PrimHelios | what does prepending "$" to a variable name do? |
17:21:45 | narimiran | PrimHelios: converts it to a string |
17:23:17 | PrimHelios | is there a reason that cmp($someString, "a string") returns non-zero (assuming someString="a string") then? |
17:24:10 | hzx | I have no command. I just want to pass the filename to the OS and have it start the associated program. Like ShellExecute with the "open" parameter. |
17:27:35 | PrimHelios | hzx: couldn't you use "cmd /C start <filename>"? |
17:28:31 | narimiran | PrimHelios: show us a short snippet of your code |
17:29:04 | hzx | thanks, it seems to work |
17:30:58 | PrimHelios | narimiran: huh, weird, it's working now. might've been because i was originally grabbing the string from JSON? |
17:31:47 | narimiran | it's hard for me to tell |
17:34:37 | PrimHelios | yeah i understand, trying to find the original code |
17:37:04 | * | Nandraj left #nim (#nim) |
17:37:40 | PrimHelios | this was the original code iirc https://hastebin.com/mebotorufo.md |
17:40:42 | * | kungtotte quit (Quit: leaving) |
17:43:53 | * | Vladar quit (Remote host closed the connection) |
17:45:40 | FromGitter | <alehander42> Araq: if A is ref not nil and B is ref not nil and ⏎ a has a B field and b has a (child<=>parent) ⏎ ⏎ how are we supposed to init them? ⏎ a = A(b: B(a: cant pass a)) [https://gitter.im/nim-lang/Nim?at=5c0ab1c411bb5b25047b4f8a] |
17:45:53 | FromGitter | <alehander42> a = A(b: B()) ⏎ a.b = B(a: a) ? |
17:46:41 | FromGitter | <alehander42> a = A(b: B(a: A())); a.b.a = a # fixed |
17:47:17 | FromGitter | <cabhishek> Hi - Is anyone having trouble comping Nim from devel? Step `sh build_all.sh` fails with error `lib/system.nim(2195, 46) Error: type expected`. Any ideas? |
17:47:59 | FromGitter | <alehander42> hm that would be impossible |
17:48:10 | FromGitter | <alehander42> the init thing, nvm me @cabhishek |
17:48:55 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:50:33 | FromGitter | <alehander42> hmm I have to just `var a: A` `var b: B` because of the warning escape hatch |
17:57:15 | * | nsf joined #nim |
18:06:21 | stefanos82 | @cabhishek: I fetched the latest updates yesterday and compiled it just fine. |
18:15:16 | FromGitter | <cabhishek> @ stefanos82 Ok thanks. Lets take a closer look then :/ |
18:15:31 | stefanos82 | sure thing |
18:18:26 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:23:27 | stefanos82 | @cabhishek: try to re-fetch everything from repo under a newly created directory and try to build it again with "sh build_all.sh" |
18:34:39 | FromGitter | <citycide> PrimHelios: with JSON you have to use `getStr` and friends to extract the value, otherwise you get a JsonNode |
18:34:52 | FromGitter | <citycide> https://nim-lang.org/docs/json.html#dynamically-retrieving-fields-from-json |
18:34:59 | FromGitter | <cabhishek> @ stefanos82 yes, sure thing |
18:38:51 | PrimHelios | citycide: Really? It works just fine without getStr /shrug |
18:45:05 | FromGitter | <alehander42> why doesnt the A = ref object not nil ⏎ stuff |
18:45:12 | FromGitter | <alehander42> syntax actually works o.O |
18:45:25 | FromGitter | <alehander42> work* |
18:50:27 | * | theelous3_ joined #nim |
18:51:44 | * | hzx quit (Quit: Going offline, see ya! (www.adiirc.com)) |
18:52:17 | stefanos82 | thanks to @alehander_42 that reminded me how badly I need to fully understand how Nim works, I share here my future book wish list for Nim: Effective Nim, Nim in Depth, Nim Internals, Microservices in Nim, Compiler Design in Nim, Virtual Machines in Nim, Mastering Nim, Machine Learning and Deep Learning using Nim |
18:52:23 | stefanos82 | the list could go on and on! |
18:52:35 | narimiran | no Fluent Nim? |
18:52:49 | stefanos82 | *definitely*! |
18:52:56 | narimiran | (Fluent Python is one of the best Python books you can read) |
18:53:02 | stefanos82 | I have read it |
18:53:09 | stefanos82 | and I planned to read it again |
18:53:12 | stefanos82 | ...and again |
18:53:20 | stefanos82 | I simply loved it |
18:53:30 | narimiran | well worth it, it is great |
18:53:34 | stefanos82 | true true |
18:54:00 | stefanos82 | Design Patterns in Nim |
18:54:05 | stefanos82 | even the title is sexy lol |
18:54:28 | stefanos82 | Algorithms in Nim |
18:54:34 | narimiran | ok, we have titles, now: who is gonna write them? |
18:55:02 | stefanos82 | the future generation lol |
18:55:51 | FromGitter | <zacharycarter> Effective Nim - `Don't write microservices` |
18:55:56 | FromGitter | <zacharycarter> done |
18:56:06 | FromGitter | <zacharycarter> Microservices in Nim - `` |
18:56:08 | FromGitter | <zacharycarter> done |
18:56:37 | stefanos82 | someone "loves" microservices with a passion :D |
18:57:24 | FromGitter | <zacharycarter> microservices are cool until you work with microservices |
18:57:27 | FromGitter | <zacharycarter> then they're not so cool |
18:58:38 | stefanos82 | so, some hate using monolithic apps, others hate microservices, others getting goosebumps and throw desks and chairs just for hearing the word "docker" |
18:58:41 | stefanos82 | what else? |
18:59:15 | FromGitter | <zacharycarter> its not that I hate microservices - I just don't think they make anything simpler |
18:59:30 | FromGitter | <zacharycarter> and a well-designed monolith is much better than a bunch of poorly-designed microservices |
19:00:07 | stefanos82 | don't get me wrong, I'm a monolithic supporter myself :D |
19:00:07 | FromGitter | <zacharycarter> and it's easy to end up with a horrible microservice architecture |
19:00:27 | stefanos82 | yeah, I have read some horror stories from HN comments :S |
19:00:36 | stefanos82 | always it's the management that mess things up |
19:00:59 | FromGitter | <zacharycarter> I think there are enough books about how to do random buzzword topic in language A |
19:01:31 | FromGitter | <zacharycarter> plus Nim is very close to C in terms of style - so if you can read C/C++ it's quite easy to figure out how to do something with Nim, just using Nim's ecosystem instead (if support for a topic exists) |
19:01:34 | FromGitter | <xmonader> @zacharycarter Well, Linux is a firstclass OS for developers (actually dynamic linking is still the way to go for most of the linux distros) |
19:02:09 | FromGitter | <zacharycarter> @xmonader - I know - just pointing out that it's only a linux issue |
19:02:25 | FromGitter | <zacharycarter> or an issue on linux |
19:02:29 | FromGitter | <zacharycarter> is probably a better way to word that |
19:03:25 | FromGitter | <zacharycarter> rather than books - I think we need more libraries to support all of those subjects |
19:03:30 | FromGitter | <xmonader> Nim has many unique points and different views on things (definitely seeing compiler design with nim patterns and facilities is something I want to read about) testing and mocking is totally different when it comes to Nim, Effective Nim or Concurrency patterns book is also very much appreciated too |
19:03:56 | FromGitter | <zacharycarter> well - you can read about concurrency patterns without reading about Nim |
19:04:02 | FromGitter | <zacharycarter> and all of that info still applies |
19:04:11 | FromGitter | <zacharycarter> you just have to understand Nim's memory management |
19:04:30 | FromGitter | <zacharycarter> nim's concurrency = async or parallelism via threads |
19:04:45 | FromGitter | <zacharycarter> and each thread has it's own local heap |
19:05:21 | FromGitter | <zacharycarter> there is also a shared heap that can be accessed by all threads - but you need to still be aware of synchronization |
19:05:47 | FromGitter | <zacharycarter> so there are locks and conds |
19:06:00 | FromGitter | <zacharycarter> and support for atomics |
19:06:03 | FromGitter | <xmonader> @zacharycarter did you check the pain points in the last article? I don't want to see ptrs, casting and such while using channels or at least provide us with good reasons to wrap our heads about how to think about it |
19:06:15 | FromGitter | <zacharycarter> there are also channels for passing data between threads |
19:06:16 | stefanos82 | still though I believe the aforementioned list is necessary, if nothing else as an advertisement for the language itself *and* a confirmation that it's not just a new language, but a very well-designed one that can do some serious and professional job as well |
19:06:50 | FromGitter | <zacharycarter> you don't need to use pointers with channels |
19:06:52 | FromGitter | <xmonader> I used lots of concurrency with Go and goroutines and sync package, it's at least 5x easier (primitives wise) and highly documented |
19:06:57 | FromGitter | <zacharycarter> unless you want to avoid the boxing / unboxing |
19:07:27 | FromGitter | <zacharycarter> so use async then - don't use threads |
19:07:34 | FromGitter | <rayman22201> @xmonader I enjoyed your article. Thank you for writing it. It does seem like a lot of your concerns are related to ecosystem immaturity and providing higher level abstractions? |
19:08:04 | FromGitter | <rayman22201> My real question is, if you were to start over from scratch, would you choose Nim again? |
19:08:11 | FromGitter | <mratsim> seems fun: https://repl.it/site/blog/multi |
19:08:51 | FromGitter | <rayman22201> @mratsim seems good for job interviews? lol |
19:09:07 | FromGitter | <zacharycarter> or use async + threads |
19:09:35 | FromGitter | <mratsim> Dunno, never did live coding/whiteboard coding for job interviews :P |
19:10:04 | FromGitter | <rayman22201> You are lucky. It's terrible. I have been on both sides of whiteboard interviews. |
19:10:51 | FromGitter | <xmonader> @zacharycarter channels aren't supposed to be used with spawn and in threads u should pass references (imagine the cluttering in ur head i'm taking reference here and casting there to achieve very minimum) I can live with that IF i know the reasons why, but currently nim assumes you really knows the whole thing inside out to use it |
19:11:35 | FromGitter | <xmonader> and what is worse is there's no good starting point or good docs on that |
19:12:53 | FromGitter | <zacharycarter> well - my point is - these aren't Nim specific things |
19:13:02 | FromGitter | <zacharycarter> or concepts |
19:13:23 | FromGitter | <zacharycarter> and there are good starting points and docs - but they're not using Nim as the programming language |
19:13:49 | FromGitter | <xmonader> @rayman22201 Thanks, I hope it helps Nim to move forward! ⏎ ⏎ During the development of this very simple app (that took lots of effort) I had doubts from my colleagues like (we really went that far `writing redis client`)? should we drop the whole thing .. our customers want just one binary file they don't want to mess with setup or installing libraries or else... which is also painful |
19:13:54 | FromGitter | <zacharycarter> also - you only use spawn with Nim's threadpool, which isn't required for threads |
19:15:55 | FromGitter | <xmonader> so my answer to your question is if the static linking is non negotiable I won't be using nim, if the time isn't a factor, i'd rather to give nim another shot, because I really like nim |
19:16:02 | FromGitter | <mratsim> @rayman22201 it’s because I wasn’t a dev. |
19:16:08 | stefanos82 | @xnomader: that's why I prefer Go for concurrency when I have to deal with heavy network stuff |
19:17:47 | FromGitter | <xmonader> @zacharycarter I know the concepts too, but I can't do it in some language without bridging that gap, for example from my knowledge in other language primitives i was using spawn with channels, but in the nim way that wasn't correct because channels aren't meant to be used with spawn |
19:18:31 | FromGitter | <xmonader> If these things aren't pointed at, explained "heavily" provided with examples. then every one will keep suffering or go to annoy Araq |
19:19:09 | FromGitter | <xmonader> If I've to ask then it means the documentation is vague or isn't there, and concurrency is a major selling point for any language |
19:20:15 | narimiran | 2019 is the year of nim documentation! |
19:20:26 | FromGitter | <xmonader> another point `dependency free binary` stated in the nim website, how to achieve that? this exact sentence was one of the reasons I choosed nim for my application and had to do tons of experimentations and tons of questions to the nice people here, and i didn't manage to deliver it. |
19:20:42 | stefanos82 | not only that @xmonader, there are certain flags that have no documentation with thorough explanation |
19:20:48 | FromGitter | <rayman22201> In some ways I feel like Golang spoiled people on both concurrency and dep free dependencies :-P |
19:21:05 | * | nsf quit (Quit: WeeChat 2.3) |
19:21:11 | stefanos82 | that was their objective |
19:21:25 | FromGitter | <rayman22201> @narimiran woot +1 to year of nim docs next year! |
19:22:05 | stefanos82 | basically they had a valid argument: they logged a C++ library that had nothing to do with the binary they were compiling and it was called 35K times |
19:22:11 | FromGitter | <zacharycarter> @xmonader - golang goroutines and channels are higher-level abstractions |
19:22:14 | FromGitter | <xmonader> @stefanos82 i'm sure they're all useful flags, but I think we should settle on those that matters to `enduser` developers who just want easy to use and to manage |
19:22:15 | narimiran | no, seriously, i plan to work on it. but any help from the community is more than welcome |
19:22:19 | FromGitter | <zacharycarter> you can implement them in Nim if you want to |
19:22:58 | stefanos82 | @xmonader: it's from an end-user's point of view that I commented on the flags issue |
19:22:59 | FromGitter | <zacharycarter> the reason people pass pointers between channels is to avoid the deepCopying that has to happen otherwise |
19:23:50 | FromGitter | <xmonader> @rayman22201 go lang is simple primitive language but sold all of the points correctly, concurrency and static linking? everyone wants that. I wish nim could deliver that easily [it's more expressive and pleasant to work with] |
19:24:26 | FromGitter | <zacharycarter> also - unless you need Nim's RT gc |
19:24:29 | FromGitter | <zacharycarter> you can use golang's GC |
19:24:38 | FromGitter | <zacharycarter> nim does have static inking |
19:24:41 | FromGitter | <zacharycarter> linking |
19:24:51 | FromGitter | <zacharycarter> I think most of your issues are that you don't understand how to do these things with Nim |
19:25:08 | FromGitter | <xmonader> @zacharycarter that's exactly my point, these notes, these points should be written down |
19:25:25 | FromGitter | <zacharycarter> well - my point is - if you learn how to do these things with C/C++ |
19:25:26 | stefanos82 | I feel you @xmonader |
19:25:32 | FromGitter | <zacharycarter> then you won't have a problem doing them with Nim |
19:25:33 | FromGitter | <alehander42> I guess that for people that like channels, maybe some kind of a safer/saner API can be done on top of the existing stuff for concurrency |
19:25:43 | FromGitter | <zacharycarter> you're coming from a higher level of understanding |
19:25:45 | FromGitter | <xmonader> I spend 2 days getting static linking with pcre, and ssl and i managed to do that. that's not like `go build` and voila |
19:25:46 | FromGitter | <zacharycarter> that's your issue |
19:25:54 | stefanos82 | @zacharycarter: the reason people want to use Nim is because they don't want to deal with or touch C or C++ |
19:26:03 | narimiran | no, that's nim issue too |
19:26:31 | FromGitter | <zacharycarter> you can look at things the opposite way too |
19:26:32 | narimiran | i don't want to have "oh, you want to do XY in Nim? well, go read C/C++ documentation about it" |
19:26:36 | FromGitter | <xmonader> I don't want to touch C++ code nor understand it. I hate the language. If i'm going to an older language i'd just pick pascal |
19:26:54 | FromGitter | <zacharycarter> there are probably lot of annoying workarounds you have to do in Go that you can do in Nim - regarding unsafe / lower level features |
19:26:57 | FromGitter | <xmonader> @narimiran I'd love to help you out with documentation when everI've time |
19:27:11 | FromGitter | <zacharycarter> my point is - you're learning Nim from a higher level of understanding vs a lower level one |
19:27:24 | FromGitter | <zacharycarter> I faced many of the same problems you did when learning Nim - I still do |
19:27:38 | FromGitter | <zacharycarter> but I figure out the answers by looking at how things are done in C/C++ |
19:27:44 | FromGitter | <rayman22201> Doc search is still a project I want to work on. I'm very much on board with getting docs in Nim better in all respects. |
19:28:32 | FromGitter | <xmonader> @zacharycarter maybe you can help us getting a decent `nim concurrency 101` |
19:28:33 | FromGitter | <zacharycarter> narimiran: well you can't expect Nim's docs to explain how to achieve higher level abstractions in Nim |
19:28:41 | narimiran | somebody already mentioned solving problems by asking here on IRC. but that solves a problem for that one person. if that was in the documentation, everybody would benefit |
19:29:09 | FromGitter | <xmonader> I don't want deep internals I want to fire things and communicate and orchestrate that flow. I want the language to help me with that [not just me] |
19:30:34 | FromGitter | <rayman22201> Go solved the static binary problem by just including everything and the kitchen sink with every binary and baking that into their build system. It worked for them, and it's an interesting trade-off, but Nim made different decisions there. (That being said, making a "fat binary" build mode easy to do is maybe something worth maintaining) |
19:31:28 | FromGitter | <rayman22201> it's a hard thing to maintain with a small team though |
19:31:52 | FromGitter | <rayman22201> Go brute forced it by being a simple language and throwing a lot of money at the problem lol |
19:32:11 | FromGitter | <zacharycarter> @xmonader - I'd start by reading something like https://slikts.github.io/concurrency-glossary/ |
19:34:49 | FromGitter | <zacharycarter> again - you don't have to use pointers with channels |
19:34:58 | FromGitter | <zacharycarter> you don't have to use Nim's threadpol module with threads |
19:35:18 | FromGitter | <zacharycarter> you don't even have to use channels - but unless you understand the underlying concepts - I don't think you're going to have much success with any of it |
19:35:34 | FromGitter | <zacharycarter> at least that's what I've found personally |
19:35:38 | FromGitter | <rayman22201> Threadpool always has been half baked. Araq has said so himself. It tried to be too clever and the kinks were never fully worked out. |
19:36:04 | FromGitter | <rayman22201> threadpool + spawn |
19:36:40 | FromGitter | <xmonader> I'm familiar with the most of that, but you're still not seeing my problems, why the languages are spending efforts on that? compare to crystal for instance almost same age as nim and they focused on channels and spawn it it works beautifully |
19:37:08 | FromGitter | <rayman22201> Nim focused on different things |
19:37:42 | FromGitter | <rayman22201> the Crystal community is also bigger than Nim (sadly) |
19:37:47 | FromGitter | <xmonader> these higher level primitives should work out of the box just fine, yeah you should always provide the low level primitives but don't expect ppl to be using or know how to use that without loads of questions in case of insufficient docs |
19:38:32 | stefanos82 | we need more test cases around cons and pros of Nim |
19:39:03 | FromGitter | <xmonader> @rayman22201 and I appreciate that really, but to make people adapt your language you should sell it to them giving them what they need unless u want it to be a research language |
19:39:20 | FromGitter | <zacharycarter> http://web.mit.edu/6.005/www/fa15/classes/19-concurrency/ |
19:39:22 | FromGitter | <zacharycarter> is another good resource |
19:39:49 | FromGitter | <alehander42> @xmonader their concurrency might be nice, but there are many things crystal cant do well at all in which Nim is better |
19:39:50 | FromGitter | <zacharycarter> well - the community can also build and provider higher level abstractions |
19:40:08 | FromGitter | <alehander42> my point is: there are 20 of "areas" where Nim tries to improve |
19:40:11 | FromGitter | <zacharycarter> agreed - Nim can do things that Go and Crystal can not |
19:40:17 | FromGitter | <rayman22201> I have to agree with you though @xmonader. Nim has historically had a problem of too many cool features that get to the proof of concept phase but never get the proper testing to be a usable feature by end users. I think this is getting better recently though, with the push to Nim 1.0 and more money behind Nim. |
19:41:16 | FromGitter | <alehander42> and sometimes some of those areas might seem less developed, it's inevitable, but this doesn't mean less effort is spent overally for improving the language |
19:42:14 | FromGitter | <alehander42> e.g. concurrency: we have async/await, we have channels(?), there are even actor libs: for 1.0 we can hope that one of those works great |
19:42:56 | FromGitter | <zacharycarter> channels and threads work fine now tbh |
19:43:22 | FromGitter | <zacharycarter> I'm not really sure what the complaint there is - other than the performance hit for the deepCopy - which you can work around at the cost of more complexity |
19:43:26 | * | kungtotte joined #nim |
19:43:29 | FromGitter | <alehander42> I guess so |
19:43:37 | FromGitter | <alehander42> but no, I agree that probably a nicer lib/api might make them a bit easier for users |
19:44:41 | * | enthus1ast quit (Ping timeout: 268 seconds) |
19:44:50 | FromGitter | <rayman22201> @zacharycarter I think you might be having trouble seeing the forest through the trees here. I think his issue was ease of use / lack of clear documentation. Channels / threads were just an example. |
19:45:00 | FromGitter | <alehander42> however I wouldn't blame Nim pre-1.0 on not focusing on channels, if it already focused on async/await: it would be the same as asking elixir or go: "why dont you have nice async/awaitlike libs" |
19:45:34 | FromGitter | <alehander42> if people manage to improve/document it even more or build a cool lib on top of it, that would be great |
19:46:04 | FromGitter | <xmonader> @zacharycarter the example i got in the post (was based on a search in the forums) not the documentation itself and after asking couple of times here and finally was answered by Araq |
19:46:15 | FromGitter | <zacharycarter> @rayman22201 - I'm hearing that but I think the docs on threads and channels are sufficient tbh - there are clear examples and the docs explain that channels are to be used with threads |
19:46:35 | FromGitter | <rayman22201> @alehander42 Also very true. It's awesome that Nim can support both (very different) forms of concurrency models. This already makes Nim more powerful than those languages, but as a community, we kind of chose async as the model we like better. |
19:46:38 | FromGitter | <xmonader> well, then why was I mislead to use spawn with channels? @zacharycarter |
19:46:58 | FromGitter | <zacharycarter> I'm not sure who instructed you to do that / where you read that |
19:47:18 | FromGitter | <xmonader> @alehander42 I'd love to see that, i'd love to see people writing more about their daily use of nim and how they fix certain problems they face |
19:47:51 | FromGitter | <xmonader> @zacharycarter it was because that's the obvious `choice` same model in countless languages crystal go .. etc |
19:47:52 | FromGitter | <zacharycarter> I don't disagree that the docs could use improvement - it's just we need working language / stabilized language features first |
19:48:15 | FromGitter | <rayman22201> Y not both? lol |
19:48:22 | narimiran | no need to wait with documentation for language to stabilize, IMO |
19:48:25 | FromGitter | <zacharycarter> it's hard to do both at the same time |
19:48:28 | FromGitter | <zacharycarter> with a moving target |
19:48:32 | FromGitter | <zacharycarter> and things in flux |
19:48:52 | FromGitter | <zacharycarter> you write docs today - they're out of date tomorrow and then need updating - I'm not say you can't have both |
19:49:01 | FromGitter | <zacharycarter> but if you're conflating goroutines with Nim's concurrency primitives |
19:49:14 | FromGitter | <zacharycarter> then what you're asking for is Nim to go out of the say to explain the difference between them |
19:49:17 | FromGitter | <alehander42> @xmonader me too, but my point was again: the most popular model in nim seems to be async: it's not so surprising that there is not so much info about channels. it's a bit like you going to the crystal channel and saying "why no actor libs"? |
19:49:28 | FromGitter | <zacharycarter> and that's asking a lot for a language that hasn't reached maturity yet |
19:49:35 | * | zakora joined #nim |
19:49:59 | FromGitter | <zacharycarter> and my point still stands - you could go learn about these concepts outside of a nim context |
19:50:09 | FromGitter | <zacharycarter> and then you'd have a better understanding of Nim's concurrency model |
19:50:14 | FromGitter | <alehander42> so the comparison with "this is the same model in many langs" is not too fair, as it's the main model in those langs |
19:50:15 | FromGitter | <xmonader> @alehander42 I didn't know async await was the way to go (they just fixed catching exceptions in it lately correct) ? |
19:50:53 | FromGitter | <alehander42> @xmonader I am not sure if it's the way to go, channels *with improved docs* might be equally great, but they seem way more used |
19:51:12 | FromGitter | <alehander42> and I think the core team focused a bit more on async (e.g. @dom96 ) |
19:51:47 | FromGitter | <rayman22201> Yeah, the core team has been all in on async for a while. That hasn't necessarily been well communicated to the rest of the world though. |
19:52:03 | * | Vladar joined #nim |
19:52:05 | FromGitter | <alehander42> yes, I think the status guys also fix a lot of stuff related to async, not sure if its upstream tho |
19:52:11 | FromGitter | <rayman22201> I wouldn't know it if I didn't hang out on gitter all the time. |
19:52:23 | FromGitter | <alehander42> but they use it a lot ( @mratsim ? ^) |
19:52:42 | narimiran | https://github.com/status-im/nim-asyncdispatch2 |
19:53:04 | FromGitter | <rayman22201> Yeah, the status people have an alternate async runtime even... Though I'm with Dom in that they really should have ported their fixes back to the main-line instead of hard forking like that. |
19:53:14 | FromGitter | <xmonader> well, communicating that would be great, having more social impact also would be nice to see article weekly? or even monthly by the core developers telling us updates or even reddit AMA |
19:53:36 | FromGitter | <mratsim> the async bugs are raised to the Nim bug tracker |
19:53:39 | FromGitter | <xmonader> here's an example of an effort in haskell ⏎ https://a-tour-of-go-in-haskell.syocy.net/en_US/index.html |
19:53:54 | narimiran | monthly-something is one of my ideas for 2019 too |
19:54:25 | FromGitter | <rayman22201> @narimiran maybe a personal question, but did you get hired by Nim? are you official? |
19:54:28 | FromGitter | <rayman22201> lol |
19:54:47 | FromGitter | <mratsim> These are some of the bugs that we needed to hard fork for: ⏎ ⏎ https://github.com/nim-lang/Nim/issues/7758 ⏎ https://github.com/nim-lang/Nim/issues/7197 ⏎ https://github.com/nim-lang/Nim/issues/7193 ... [https://gitter.im/nim-lang/Nim?at=5c0ad007f992693c7a3a7a9b] |
19:54:58 | * | platoff joined #nim |
19:55:04 | FromGitter | <xmonader> @narimiran It'd be amazing to create a Poll or something asking about the most needed areas to improve |
19:55:10 | narimiran | @rayman22201 i'll start in january :) |
19:55:22 | FromGitter | <rayman22201> congrats! I'm very jealous lol |
19:55:22 | FromGitter | <xmonader> yay! @narimiran congrats!! |
19:55:31 | FromGitter | <zacharycarter> congrats narimiran :) |
19:55:47 | FromGitter | <rayman22201> I hope I didn't let the cat out of the bag too early :-P |
19:56:16 | narimiran | @xmonader: there is the yearly nim survey, and documentation is frequently mentioned. so this is something that bothers a lot of people and we should deal with it |
19:56:21 | narimiran | thanks, guys! |
19:56:47 | FromGitter | <rayman22201> @mratsim Is there plans to backport fixes for these things / or attempt to merge your hard fork back? |
19:56:56 | narimiran | well, i didn't want to say anything until then, but it has been already mentioned on IRC several days ago so i guess i can talk about it now :) |
19:57:25 | FromGitter | <zacharycarter> @xmonader - I'd encourage you to read those resources I linked - it will help you to gain an understanding of Nim's concurrency primitives |
19:57:55 | FromGitter | <zacharycarter> goroutines are not threads and go channels are not Nim channels |
19:58:14 | * | enthus1ast joined #nim |
19:58:20 | FromGitter | <xmonader> @narimiran yeah I took that survey this year do you have roadmap? do you plan to do more social networking too for community feedback |
19:58:30 | FromGitter | <zacharycarter> goroutines are an abstraction that golang included in its language design - basically allowing for async / await style coding across a number of threads handled by the language runtime |
19:58:38 | FromGitter | <xmonader> @zacharycarter I'll do for sure |
19:59:00 | FromGitter | <xmonader> @zacharycarter with the exception of not being limited to one core |
19:59:00 | FromGitter | <zacharycarter> also - if you don't want to deal with Nim's memory model - just use a different GC |
19:59:27 | FromGitter | <zacharycarter> well yes - that's the `a number of threads` part |
20:00:22 | narimiran | @xmonader it is too early to tell exactly what is the plan. i have some ideas about the areas where we can improve when it comes to 'community' (it is hard to put it under one name) |
20:00:45 | FromGitter | <alehander42> @narimiran congrats! |
20:00:52 | FromGitter | <zacharycarter> Nim has partial support for coroutines - so like green threads or fibers |
20:01:01 | narimiran | my hope is that in one year from now we won't be having the same talks we have today :) |
20:01:02 | FromGitter | <zacharycarter> but this only works for windows and linux I think? |
20:01:13 | narimiran | thanks @alehander42! |
20:01:24 | FromGitter | <zacharycarter> macOS doesn't even have fiber support - you have to use GrandCentralDispatch for context switching |
20:01:27 | FromGitter | <alehander42> our new nimirian steve klabnik |
20:02:43 | narimiran | :) |
20:03:16 | FromGitter | <xmonader> @narimiran I'm sure you will manage to deliver GREAT things |
20:03:46 | FromGitter | <zacharycarter> I do want to try to play around with GCD + Nim |
20:03:49 | narimiran | no pressure, huh? :D |
20:03:59 | FromGitter | <zacharycarter> maybe ressurect the coro module |
20:04:06 | FromGitter | <xmonader> @zacharycarter I think writing that down in a blog post or even hosted article on nim website would be amazing to read |
20:04:13 | FromGitter | <xmonader> @narimiran not at all, we got your back :) |
20:04:54 | FromGitter | <xmonader> you seem very familiar with other languages concepts so bridging that to Nim in simple way would be amazing |
20:04:56 | FromGitter | <zacharycarter> @xmonader - I'm neck deep atm in my new game engine - but it features a lock free work-stealing job system written in Nim |
20:05:17 | FromGitter | <zacharycarter> once I have the editor working - at least the GUI starting to be rendered - I will write a blog post on it |
20:05:25 | FromGitter | <alehander42> work-stealing, is it called mexico, you filthy democrat |
20:05:25 | FromGitter | <zacharycarter> or maybe a series talking about the engine architecture |
20:05:28 | FromGitter | <zacharycarter> :P |
20:05:37 | FromGitter | <rayman22201> https://media.giphy.com/media/l3vR45NrUz168PcNa/giphy.gif |
20:05:48 | FromGitter | <rayman22201> Sorry. I couldn't help myself :-P |
20:05:51 | FromGitter | <zacharycarter> hahaha |
20:05:53 | FromGitter | <xmonader> more interesting things to read in 2019 then :) |
20:06:43 | FromGitter | <alehander42> i love mexico, sorry ⏎ sounds very good seriously, what game is it for |
20:07:49 | FromGitter | <zacharycarter> I don't really have a game design nailed down yet - but I am leaning towards some sort of strategy game - war based |
20:08:21 | FromGitter | <zacharycarter> I really liked Sid Meier's Gettysburg growing up - and I've always liked tactical wwii games and tabletop war games |
20:08:27 | FromGitter | <zacharycarter> so something in the strategy vein |
20:09:48 | FromGitter | <alehander42> wow so strange to hear sid meyer |
20:09:50 | FromGitter | <alehander42> and not civ |
20:09:58 | FromGitter | <alehander42> i didnt even know he has other games |
20:10:02 | FromGitter | <zacharycarter> :P |
20:10:41 | FromGitter | <zacharycarter> civ is great though |
20:11:13 | FromGitter | <alehander42> i am a fan too, I even dreamed of a more uh social-heavy civ, like something where you can have way deeper economy/social policies and their effects |
20:11:31 | * | narimiran quit (Remote host closed the connection) |
20:11:32 | FromGitter | <alehander42> also loving alt history games |
20:11:32 | FromGitter | <zacharycarter> that'd be neat |
20:14:08 | FromGitter | <zacharycarter> the thing is @xmonader - doing things like lock free multi-threaded job systems still requires relying on things like pointers and atomics if you're going to use Nim's default GC |
20:14:29 | FromGitter | <zacharycarter> there really is no getting away from it - you're going to need lock free data structures |
20:14:44 | FromGitter | <zacharycarter> so you're going to need atomic operations |
20:15:43 | FromGitter | <zacharycarter> https://github.com/zacharycarter/zeal/blob/JobScheduler/src/zealpkg/core/shared_deque.nim - for instance |
20:24:22 | FromGitter | <rayman22201> some people want Nim to be a better / faster python, i.e. they don't want to worry about pointers and atomics etc... Some people want Nim to be an easier to use C++ or Rust. The reality is that Nim is somewhere in the middle lol. |
20:29:41 | * | wildlander joined #nim |
20:30:20 | kungtotte | There's no reason it can't be both. There are two main things that people like about Python: an extensive library repository and being as easy to write as pseudocode. |
20:32:25 | * | UxerUospr joined #nim |
20:32:28 | FromGitter | <alehander42> yeah I also think for many applications the kinda-like-python-subset is absolutely enough |
20:33:39 | kungtotte | Rust is already improving a lot on C++ when it comes to readability, though they still favour special characters in their syntax too much, and of course they have that whole borrow checker thing going on which is quite different from anyone else. |
20:40:16 | * | revere quit (Ping timeout: 246 seconds) |
20:45:06 | * | revere joined #nim |
20:48:37 | * | Vladar quit (Remote host closed the connection) |
20:52:24 | FromGitter | <xmonader> @zacharycarter in go i know how to use atomics and my code doesn't seem frightening like the code you sent, maybe it's because you understand the lowlevel parts better, but i don't see myself writing that in general. |
20:53:28 | * | revere quit (Ping timeout: 264 seconds) |
20:53:28 | FromGitter | <xmonader> @alehander42 I totally agree with that! |
20:54:47 | * | matti quit (Ping timeout: 240 seconds) |
20:57:22 | * | revere joined #nim |
20:58:01 | dom96 | narimiran[m]: regarding your question about the forum: just switch the "moderated" users to "user" (as long as they aren't posting spam) |
21:04:05 | * | rockcavera quit (Remote host closed the connection) |
21:20:34 | FromGitter | <mratsim> @rayman22201 sorry didn’t see. I think most of the issues where fixed as apparently they are closed now. For now there is no plan to merge them back because not enough time and we need to consolidate our transport and P2P needs. |
21:21:55 | FromGitter | <rayman22201> That's understandable. It would be nice to reconcile eventually though :-) |
21:23:04 | FromDiscord_ | <Virepri> kungtotte I honestly dislike Rust's syntax as a whole, despite how much I like golang's syntax |
21:30:11 | * | Trustable quit (Remote host closed the connection) |
21:32:38 | * | vegax87 quit (Changing host) |
21:32:38 | * | vegax87 joined #nim |
21:32:38 | * | vegax87 quit (Changing host) |
21:32:38 | * | vegax87 joined #nim |
21:34:17 | * | UxerUospr quit (Quit: Lost terminal) |
21:34:25 | FromGitter | <zacharycarter> @xmonader i dont see any difference from golang atomics. You generally dont need atomic ops unless youre actively avoiding locks |
21:34:58 | FromGitter | <zacharycarter> And generally, you dont even need multiple threads, it just adds complexity |
21:39:04 | * | zakora quit (Quit: WeeChat 2.2) |
21:41:39 | * | kapil____ quit (Quit: Connection closed for inactivity) |
21:58:58 | * | vlad1777d joined #nim |
22:11:59 | FromGitter | <arnetheduck> @alehander42 I'll take one lib that works over 3 that don't.. the first time I tried channels in a simple app (testament, imagine that - nothing fancy, just a simple channel consumed by a few threads), they crashed on some garbage collection issue - doesn't inspire confidence.. likewise with async - we forked async at status because we have a product to build and can't afford the roundtrip times of coordinating |
22:11:59 | FromGitter | ... upstreaming and discussing every little bugfix and change - the sources are all there in the open, nothing prevents the community from porting them to upstream if there's interest to do so (I for one believe that the other way around makes more sense, that asyncdispatch is removed from the std lib and moved into its ... [https://gitter.im/nim-lang/Nim?at=5c0af02f3de4e816e22735b0] |
22:15:35 | FromGitter | <arnetheduck> forking also gives us the freedom to modify the API at will to fit our needs, again without breaking anything for anybody - once it settles down and we have a working app, again, nothing prevents interested parties to port the changes to upstream |
22:18:19 | FromGitter | <alehander42> @arnetheduck I was defending exactly that: its improbable to expect something else than async to work well before 1.0 |
22:18:38 | FromGitter | <alehander42> and I am also a fan of the "evolve stuff" as 3rd package idea |
22:18:54 | * | rockcavera joined #nim |
22:19:12 | FromGitter | <alehander42> where the stdlib is the goverment program and 3rd party apis/libs compete in a free market |
22:20:10 | FromGitter | <arnetheduck> yeah, I think we're aligned :) stdlib can set the tone for infrastructure so the universal stuff doesn't get fragmented, but the rest.. |
22:21:09 | FromGitter | <alehander42> yeah, kinda thought a bit more on that distinction after some of your discussions |
22:24:04 | FromGitter | <alehander42> well, that's kinda the problem: what is "essential" infrastructure is the thin line (in languages and in the state too ) |
22:24:05 | * | vlad1777d quit (Remote host closed the connection) |
22:24:07 | FromGitter | <rayman22201> @arnetheduck I understand your point, you have products to ship. I get that. But concurrency primitives are kind of core to the language. And the problem with doing massive hard fork on something so core, is that there is little incentive to port it back afterwards. It's silly to assume the community will just magically push it back to mainline eventually. This has happened many times in other domains. The fork |
22:24:07 | FromGitter | ... rarely gets pushed back. Instead you get a fractured ecosystem. |
22:25:18 | * | vlad1777d joined #nim |
22:25:19 | FromGitter | <rayman22201> I'm all for many small libs and the free market. But There has to be some "government funded projects" to use @alehander42's analogy. |
22:29:15 | FromGitter | <rayman22201> That being said, I completely understand why you forked. Especially considering when Status started using Nim. It was a chicken and egg problem, and you took the "lesser of two evils". And because of that, and the resulting investment from Status, Nim is better in general now. |
22:30:10 | FromGitter | <rayman22201> I am going crazy with the analogies today. sorry for any non-native English speakers lol |
22:30:40 | FromGitter | <arnetheduck> er, let's not get ahead of ourselves here, it's a fancy socket library .. and I'd argue that it works the other way around - the freestanding libraries are an excellent place to start a language standardization process - this does wonders for quality, it's the ultimate peer review process |
22:31:53 | dom96 | Nice to see someone sharing my concerns with regards to the asyncdispatch fork |
22:33:10 | FromGitter | <rayman22201> I've never seen a successful standardization process work that way @arnetheduck. The free market is good for many things, but not standardization. There is no incentive for that. In free market economics, you need incentive. |
22:33:55 | dom96 | It's a real shame to see such fragmentization. I'm still not sure why the fork occurred |
22:33:58 | FromGitter | <arnetheduck> I guess you're not a C++ programmer :) or a rust programmer :) or a java programmer :) |
22:34:02 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:34:17 | FromGitter | <arnetheduck> or a python programmer :) want me to keep going? |
22:34:26 | dom96 | Like, what issues did you find with asyncdispatch that couldn't have just been a simple PR? |
22:35:51 | FromGitter | <rayman22201> Every single one of those languages has a strong internal standardization process, independent of the wider ecosystem. I don't see your point at all |
22:38:42 | FromGitter | <zacharycarter> I think both cases can be argued |
22:38:42 | stefanos82 | dom96: I have reported the bug. When you are going to PR, can you edit the README as well? it mentions multiple times the use of build_all.sh |
22:39:02 | dom96 | stefanos82: of course |
22:39:11 | stefanos82 | awesome |
22:39:13 | FromGitter | <zacharycarter> Nim is changing - quite rapidly - if you're building a product on top of Nim and need a stable implementation for a certain feature, hard forking could be a sensible option |
22:39:29 | FromGitter | <rayman22201> C++ is a freaking mess of fragmentation. C++ does have Boost as a kind of "blessed" testing ground for new std lib features, but even that is kind of a mess. I want a better world for Nim lol |
22:39:42 | FromGitter | <zacharycarter> it's also not an incentive for you - to contribute that hard fork back |
22:40:07 | FromGitter | <arnetheduck> each and every single one of those languages has a strong tradition of using freestanding libraries as a breeding ground for standardization - half of the std c++ lib comes from boost which is build from free-market libraries - java is an even better example, they take a successful market library (logging, xml, web frameworks etc etc etc) and put an interface on them so that multiple implementations can coexist - |
22:40:08 | FromGitter | ... and where do you think python libraries come from? |
22:40:30 | FromGitter | <zacharycarter> it does suck that the hard fork occurred - but I agree with @arnetheduck - it's unrealistic to expect a company to wait on a peer-reviewed change management process for their product(s) |
22:41:08 | FromGitter | <zacharycarter> and if the community decides asyncdispatch2 is a superior implementation - then why can't that just become the official implementation? |
22:41:16 | FromGitter | <zacharycarter> don't we go through this experimentation process anyway with Nim constantly? |
22:41:42 | FromGitter | <zacharycarter> some feature of Nim is constantly in an experimental phase or being re-worked and it either makes it into the ecosystem or it doesn't |
22:41:50 | FromGitter | <zacharycarter> err language rather |
22:41:50 | dom96 | arnetheduck: can you explain why you decided to fork? |
22:42:33 | dom96 | ugh, should testament be rebuilding the compiler? |
22:42:38 | FromGitter | <arnetheduck> > likewise with async - we forked async at status because we have a product to build and can't afford the roundtrip times of coordinating upstreaming and discussing every little bugfix and change - the sources are all there in the open, nothing prevents the community from porting them to upstream if there's interest to do so (I for one believe that the other way around makes more sense, that asyncdispatch is removed |
22:42:38 | FromGitter | ... from the std lib and moved into its own package so it can either be developed in a more agile fashion or wither away unused if it doesn't reach the quality needed for it to be useful) ⏎ ⏎ @dom96 |
22:43:04 | dom96 | argh, I wish you guys would use IRC |
22:43:25 | FromGitter | <arnetheduck> > forking also gives us the freedom to modify the API at will to fit our needs, again without breaking anything for anybody - once it settles down and we have a working app, again, nothing prevents interested parties to port the changes to upstream ⏎ ⏎ @dom96 |
22:43:43 | dom96 | Yes, I read that. I want specific reasons why you've decided to fork |
22:43:47 | FromGitter | <zacharycarter> we could just consolidate around one chat medium |
22:43:50 | dom96 | What issues did you run into with asyncdispatch that needed fixing? |
22:44:13 | FromGitter | <zacharycarter> and get rid of the bridge |
22:44:46 | FromGitter | <arnetheduck> @mratsim listed a bunch earlier up in the chat, but really, those are just examples and not the core reason |
22:44:48 | FromGitter | <rayman22201> But I like Gitter. It's easier lol |
22:45:01 | FromGitter | <zacharycarter> Gitter could be the medium :P |
22:45:23 | FromGitter | <zacharycarter> although I know a lot of people hate gitter |
22:45:25 | FromGitter | <alehander42> The bridges are fine |
22:45:26 | FromGitter | <rayman22201> I don't want to force everyone to use my preference ;-) free market |
22:45:32 | FromGitter | <zacharycarter> I'd be up for just moving everything to discord |
22:45:55 | dom96 | I mean, I've read the differences listed here: https://github.com/status-im/nim-asyncdispatch2#core-differences-between-asyncdispatch-and-asyncdispatch2 |
22:46:03 | dom96 | But they really don't seem to warrant a hard fork to me |
22:46:57 | FromGitter | <alehander42> I feel a part of the problem is async dispatch and asyncdispatch2 are not different libs, 2 is just like a patch fkr the default one, so it doesn't |
22:47:25 | FromGitter | <alehander42> Nvm my message got sent while being WIP |
22:47:45 | FromGitter | <rayman22201> The most successful hard fork model I have seen is the linux Kernel. Many hardware companies hard fork linux to create new drivers etc..., but the onus is always on the company to patch back to upstream. The community doesn't do it. |
22:49:23 | dom96 | Really? I would think that's not always the case |
22:49:32 | dom96 | If something is very valuable the community will step in |
22:50:59 | FromGitter | <rayman22201> It's true that it isn't always the case, it's more common in with the kernel than other places though. Linux is also a weird case in that the community and the businesses are often the same people or at least closely aligned. |
22:51:26 | FromGitter | <rayman22201> The company want's their drivers in upstream, otherwise nobody will use their hardware. |
22:51:41 | FromGitter | <zacharycarter> dom96: an earlier message from @mratsim mentions some issues that he describes as being reasons for the hard fork - nim-lang/Nim#7758 ⏎ nim-lang/Nim#7197 ⏎ nim-lang/Nim#7193 ⏎ nim-lang/Nim#7192 ⏎ nim-lang/Nim#6846 ... [https://gitter.im/nim-lang/Nim?at=5c0af97c5e409525033003cf] |
22:51:56 | FromGitter | <arnetheduck> er, linux was the prime driver for git, a tool that exists solely to make forking easy.. hmm.. |
22:52:45 | dom96 | so now that these are all fixed, can we get rid of asyncdispatch2 for the sake of harmonization? |
22:53:03 | dom96 | (well, almost all, but come on, that last one is surely just a PR away) |
22:54:04 | dom96 | It honestly pains me to see it. I can't use your amazing packages because they depend on asyncdispatch2 |
22:54:11 | dom96 | It's really a shame |
22:54:25 | FromGitter | <rayman22201> that also goes back to my point, where that kind of easy forking is most successful when the community and the enterprise is incentivized to merge back. |
22:59:04 | FromGitter | <arnetheduck> @rayman22201 you still haven't answered though how specifically all of c++, java, rust and python have failed to attract quality libraries? you mentioned c++'s vibrant ecosystem of competing alternatives and boost as an extra step which fits C++ well due to the enormous impact adding something to C++ has - for Nim in particular, I'm really glad we gained experimental, which is a nice and lightweight step appropriate |
22:59:04 | FromGitter | ... for the size of the language and development stage its in - ie more lightweight than c++, but a nod towards the higher bar features have to have before they're worthy of being included |
23:00:34 | FromGitter | <rayman22201> I'm all for experimental. Rust does the same, and I think it's a good idea. |
23:01:52 | * | martin1_ joined #nim |
23:02:29 | martin1_ | hi everyone! how can i iterate mutable over a collection of rows in a csv parser? |
23:03:31 | dom96 | martin1_: What type is your collection? |
23:03:57 | FromGitter | <arnetheduck> yeah, and look at how they're seeding their socket lib in - ie they develop tokio and mio completely on the side and slowly let "infrastructure" level features seep into rust as they gain quality |
23:05:36 | FromGitter | <rayman22201> That's fair. But both of those projects have core language developers deeply involved in the process. This keeps the communication / merge barrier low. The did not "let the community" merge these features back by themselves. |
23:05:54 | martin1_ | dom96: it's just a CsvRow (seq[string]) |
23:06:01 | FromGitter | <rayman22201> Core language devs on the projects, and driving the merging of features back. |
23:06:22 | FromGitter | <rayman22201> Status hard forked and seems to have no plans to help seal the rift. That is not what is happening with Rust |
23:06:27 | dom96 | martin1_: for item in mitems(row): # should work |
23:06:38 | FromGitter | <rayman22201> And a similar story is true for Boost and C++ |
23:07:53 | martin1_ | brilliant! thanks! |
23:08:35 | FromGitter | <arnetheduck> c++ doesn't have any "core devs" really - it's an open community you can join at any time - in fact, that's where its recent networking library come from as well (standalone -> boost -> std) |
23:10:02 | FromGitter | <arnetheduck> rust, likewise - the fact that the core devs work on libraries too has several good side effects: the core devs dogfood the tooling surrounding library management, those that want the latest can choose to use them, the core of the language is stable and of high and consistent quality - win-win... |
23:11:32 | dom96 | So will, or won't Status eventually try to bridge the gap between asyncdispatch2 and stdlib? |
23:12:22 | FromGitter | <rayman22201> The point is that in both of those examples people writing the libraries are driving the merge back to mainline. They didn't just leave it to the community to do so. |
23:18:26 | FromGitter | <rayman22201> I'm all for experimenting outside of the std, and slowly merging things in as they stabilize. This is a good model. But that process can't solely belong to the core devs or the community. The feature authors must also share some responsibility here. |
23:20:42 | FromGitter | <zacharycarter> well, otherwise I think it should at least be more explicit that you should be wary building on top of the fork |
23:22:05 | FromGitter | <zacharycarter> the name of the library is asyncdispatch2 - so people may very well think it's a experimental implementation that may make its way into the stdlib |
23:22:29 | dom96 | This^ |
23:22:31 | FromGitter | <zacharycarter> not saying that's not the case - but if it is - I could see the naming causing confusion |
23:28:41 | * | elb_ quit (Quit: WeeChat 2.3) |
23:29:09 | FromGitter | <zacharycarter> maybe that's exactly why it's named asyncdispatch2 - because their intention all along has been to merge, and cheatfate / status expected us to be ready for a present in the future and we're worried about nothing. |
23:29:57 | FromGitter | <zacharycarter> and they really like surprises |
23:30:00 | FromGitter | <rayman22201> lol |
23:38:59 | * | stefanos82 quit (Remote host closed the connection) |
23:42:06 | * | fthe joined #nim |
23:43:17 | fthe | hi. Just wondering if there's something like argmax/argmin built-in? (index of max/min element of seq/array) |
23:44:46 | FromGitter | <rayman22201> `high` and `low` I believe |
23:45:16 | FromGitter | <rayman22201> https://nim-lang.org/docs/manual.html#types-array-and-sequence-types |
23:47:12 | FromGitter | <mratsim> argmin/max returns the index of the first minimum/maximum value encountered |
23:48:09 | FromGitter | <mratsim> argmax exists in Arraymancer: https://github.com/mratsim/Arraymancer/blob/4c114fed3af9298070a1127d26f2cc263692296f/src/tensor/aggregate.nim#L131-L187 |
23:48:28 | FromGitter | <mratsim> Argmin is just a PR away ;) |
23:49:14 | FromGitter | <arnetheduck> er, I think this is spiralling out of control a bit.. @dom96, the simple answer is that we'll do it if we feel it's in our interest to do so - you want to make that more probable? help out and make it a smoother process, for example by porting some of the work... seriously, we took some existing code, adapted it for our use case and kept it open so that the community would benefit should should there be any benefit |
23:49:14 | FromGitter | ... to be had.. if it's truly better and useful for the larger community, it, or the ideas behind it, will make it to the right place eventually - that's the point of an open development process |
23:50:19 | FromGitter | <mratsim> @dom96 I don’t think any of us is closed to contributing back either the whole ad2 or patches to the stdlib. But we need something we can control. Networking is the core of our product. |
23:50:56 | FromGitter | <mratsim> Also this is why apart from transport, the {.async.} {.await.} usage is the same. |
23:51:17 | FromGitter | <mratsim> @fthe ^ (argmax/argmin) |
23:52:16 | fthe | @mratsim: thanks :) I guessed it existed in Arraymancer, as it does in numpy... just wondered if there was something for built-in seqs/arrays |
23:52:36 | FromGitter | <arnetheduck> @rayman22201 there's no such thing as responsibility - we're all operating on a consensus model - in such a place, coercive measures such as voting or "should" and "has" have no meaning or place - all you can do is argue your case eloquently and hope that you come to a shared understanding and aligned incentives |
23:52:46 | fthe | I do need to get around to trying out arraymancer some time, the README makes it sounds very nice |
23:52:47 | * | martin1_ quit (Ping timeout: 240 seconds) |
23:52:56 | FromGitter | <rayman22201> sorry @fthe I misread your question lol. Yeah. arraymancer is the way to go for that. |
23:53:06 | FromGitter | <mratsim> Given the time I spent on the README I hope so :D |
23:53:21 | FromGitter | <arnetheduck> (where "eloquently" most often means "doing the work" or "writing the code" and "being useful to others") |
23:53:24 | FromGitter | <mratsim> though I need to get more docs and example out there |
23:53:47 | fthe | It shows :) |
23:53:57 | fthe | (the readme I mean, very polished) |
23:54:25 | FromGitter | <mratsim> btw, if you need to often loop on collections, be sure to check loop-fusion: https://github.com/numforge/loop-fusion |
23:54:44 | FromGitter | <mratsim> Or zero functional if you prefer a functional approach: https://github.com/zero-functional/zero-functional |
23:55:00 | FromGitter | <rayman22201> @arnetheduck that's not entirely true. Money plays a big roll. Those "eloquent" things like "doing the work" usually is paid for by somebody. Open Source is still very much controlled by money, despite some of the more idealistic rhetoric about it. |
23:55:52 | FromGitter | <mratsim> I would say, in case of Nim, it’s controlled by time. |
23:56:05 | fthe | cool, I did not know about those. Nim is not super easy to google for, but there does seem to be a food ecosystem of good-quality libs out there |
23:56:25 | FromGitter | <mratsim> probably easier than Go, and not sure about Rust :P |
23:56:41 | FromGitter | <rayman22201> time = money lol |
23:57:02 | FromGitter | <mratsim> I started Arraymancer without money and just time ;) |
23:57:11 | FromGitter | <rayman22201> but your time is valuable |
23:57:19 | FromGitter | <rayman22201> whether you actually received money for it or not |
23:57:42 | FromGitter | <rayman22201> I'm getting into the weeds here with economic theory. |
23:58:05 | FromGitter | <mratsim> you still have some margin |