00:10:12 | * | abm quit (Quit: Leaving) |
00:17:15 | * | stefanos82 quit (Remote host closed the connection) |
00:56:08 | * | cyberjpn joined #nim |
01:36:35 | FromGitter | <arnetheduck> thanks for those fixes clyybber |
01:47:49 | * | dddddd quit (Remote host closed the connection) |
02:00:16 | * | banc quit (Quit: Bye) |
02:13:47 | * | cyberjpn quit (Ping timeout: 246 seconds) |
02:17:15 | * | rnrwashere joined #nim |
02:22:35 | * | deech joined #nim |
02:22:40 | * | banc joined #nim |
03:00:05 | * | I_Right_I joined #nim |
03:02:41 | * | rnrwashere quit (Remote host closed the connection) |
03:06:22 | I_Right_I | hey all, I have been away for a while how's the new runtime coming along? |
03:25:49 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:32:17 | * | kapilp joined #nim |
03:33:40 | * | rnrwashere joined #nim |
03:35:36 | * | rnrwashere quit (Remote host closed the connection) |
03:36:18 | * | rnrwashere joined #nim |
03:40:30 | * | cyberjpn joined #nim |
03:40:32 | * | rnrwashere quit (Ping timeout: 252 seconds) |
03:49:59 | * | cyberjpn quit (Ping timeout: 258 seconds) |
04:02:24 | * | cyberjpn joined #nim |
04:31:14 | * | nsf joined #nim |
04:39:02 | * | deech quit (Ping timeout: 246 seconds) |
04:43:01 | * | cyberjpn quit (Ping timeout: 246 seconds) |
05:09:46 | * | narimiran joined #nim |
05:36:57 | * | cyberjpn joined #nim |
05:58:35 | * | solitudesf joined #nim |
06:07:15 | * | krux02 joined #nim |
06:18:55 | FromGitter | <kayabaNerve> Anyone online who knows concepts? |
06:19:28 | FromGitter | <kayabaNerve> I'm trying to redo an object hierarchy with a case statement to remove casting. That said, I want to be able to differentiate in my function arguments. |
06:19:47 | FromGitter | <kayabaNerve> I figured if I used a concept, I could have a master object with a case, but concepts for each `of`. |
06:20:09 | FromGitter | <kayabaNerve> ```type Sub* = concept e ⏎ e is Entry ⏎ e.descendant == EntryType.Sub``` [https://gitter.im/nim-lang/Nim?at=5cd51819da34620ff9172f7d] |
06:20:37 | FromGitter | <kayabaNerve> The first line (e is Entry) works fine. The second line says non matching candidates for == |
06:20:44 | FromGitter | <kayabaNerve> (EntryType is an enum) |
06:21:08 | FromGitter | <kayabaNerve> I tried running ord, but then it said int didn't have a matching candidate, but it did suggest an enum compatible == |
06:21:20 | FromGitter | <kayabaNerve> Going back to the enum version, no enum == shows up as an hint |
06:21:57 | FromGitter | <kayabaNerve> So is there a way to name my subtypes yet remove casting? |
06:25:07 | * | PMunch joined #nim |
06:27:35 | FromGitter | <kayabaNerve> Does Nim just not detect well enough that a case variable in a type is static? |
06:30:58 | FromGitter | <kayabaNerve> Ah. You can only set a case field once, but it doesn't have to be set when you issue the object. Plus, this is a runtime check anyways. My bad. |
06:34:39 | PMunch | You're playing with concepts kayabaNerve? |
06:37:46 | FromGitter | <kayabaNerve> Not anymore; now trying static generics and when statements |
06:38:10 | PMunch | Aha, what problem are you actually trying to solve? |
06:38:12 | FromGitter | <kayabaNerve> I don't care how I do it; I just want hierarchical objects and named subtypes |
06:38:53 | FromGitter | <kayabaNerve> But of course, this lib I use for access safety doesn't support when statements in types... |
06:38:54 | * | I_Right_I quit (Read error: Connection reset by peer) |
06:38:57 | FromGitter | <kayabaNerve> Casualty of war? |
06:39:55 | PMunch | Wait, what do you mean with when statements? |
06:40:41 | PMunch | It sounds like you want to do something like the JSON module does? |
06:40:43 | FromGitter | <kayabaNerve> https://pastebin.com/86MpvNYV |
06:41:38 | FromGitter | <kayabaNerve> I must say, I hate pure. It no longer does what it used to do, which I wish it did, BUT it still does something. I have code that refuses to compile without it. |
06:41:52 | FromGitter | <kayabaNerve> Eh. May be fixed by now. I wrote this code during 0.18/0 |
06:41:59 | PMunch | Yeah.. I agree, pure should've been kept as is |
06:42:19 | FromGitter | <kayabaNerve> That said, I have a Mint field in my enum, and I now can't name a type Mint = Entry[EntryType.Mint] |
06:42:20 | PMunch | So why don't you just have a descendant field and a case statement? |
06:42:32 | FromGitter | <kayabaNerve> Because then I can't name the subtypes |
06:42:32 | PMunch | Ooh |
06:42:34 | PMunch | I see |
06:42:35 | PMunch | Yeah |
06:42:46 | FromGitter | <kayabaNerve> So I tried concepts, but I realize how it's runtime |
06:42:52 | FromGitter | <kayabaNerve> So now I' |
06:43:05 | FromGitter | <kayabaNerve> *I'm trying Generics, but now my enum has scope issues |
06:44:12 | FromGitter | <kayabaNerve> I had an enum value of mint, and a type named mint, which worked fine. Doesn't anymore. |
06:44:36 | FromGitter | <kayabaNerve> May be because I removed some wrapper code, but said wrapper code broke when I added the when statements. |
06:45:12 | FromGitter | <kayabaNerve> I'll likely rewrite said lib next week. Friend did it as a favor months ago and he's maintained it faithfully, but he has school and all that. |
06:45:18 | FromGitter | <kayabaNerve> Has saved me quite a few times, ngl |
06:47:18 | * | cyberjpn quit (Ping timeout: 244 seconds) |
06:47:26 | FromGitter | <kayabaNerve> PMunch: So I did solve that problem, but I have another one if you have a sec |
06:47:46 | FromGitter | <kayabaNerve> I do think this is impossible though. Can I save the enum value used to create in a generic? |
06:48:20 | FromGitter | <kayabaNerve> Like if I create a type which is a generic, which takes in a static int, can I later retrieve said int without reverse calculating it? |
06:48:38 | FromGitter | <kayabaNerve> I rather not randomly test fields until I figure out what I'm dealing with. |
06:49:34 | PMunch | kayabaNerve: http://ix.io/1Iz5/Nim |
06:50:09 | PMunch | Just something I tried to test your initial thing |
06:50:22 | PMunch | It seems like you can pass in the value of a field as a generic parameter |
06:52:58 | PMunch | Ah wait.. |
06:53:14 | PMunch | That was just because the descendants was defaulted to 0 -> Mint |
06:54:12 | PMunch | Confusingly this also compiles: http://ix.io/1Iz6/Nim |
06:54:35 | PMunch | The first echo prints 0, the second prints [0, 0, 0, 0, 0, 0] |
06:54:43 | FromGitter | <kayabaNerve> Yeah, I think you have to reverse calculate it or double set it |
06:54:48 | PMunch | So myInt is both a field and a variable in this context :S |
06:55:20 | FromGitter | <kayabaNerve> `case descendant: EntryType = descendant` RFC? |
06:55:44 | FromGitter | <kayabaNerve> Save generic variables to a field in the generic? |
06:55:52 | FromGitter | <kayabaNerve> As we've demonstrated, this is a valid feature |
06:55:57 | PMunch | Hmm, I think it's possible to get those |
06:56:01 | FromGitter | <kayabaNerve> There are reasons to use it |
06:56:18 | FromGitter | <kayabaNerve> I think you have to reverse engineer, double set, or macro that expands to a double set |
06:56:26 | FromGitter | <kayabaNerve> For now, I'm just going to double set |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:03:05 | Mister_Magister | can i install package using nimble directly from github? aka changes that aren't yet in next release |
07:03:35 | Araq | yeah via 'nimble develop' |
07:04:01 | Mister_Magister | thank you! |
07:04:47 | * | gmpreussner joined #nim |
07:06:10 | * | jjido joined #nim |
07:06:25 | FromGitter | <kayabaNerve> PMunch: Want to hear something ironic? |
07:06:53 | FromGitter | <kayabaNerve> I actually have a function which takes in an Entry, regardless of its subtype, so I think I need a concept to match the master type |
07:07:20 | FromGitter | <kayabaNerve> Am I using Nim correctly? |
07:07:38 | * | jjido quit (Client Quit) |
07:07:52 | PMunch | Haha, yeah it seems like you're trying to do something that's not supposed to work |
07:08:55 | narimiran | Mister_Magister: `nimble install packagename@#head` |
07:09:19 | Mister_Magister | also thanks |
07:09:51 | FromGitter | <kayabaNerve> I think I'm trying to do something reasonable that Nim tries to make easy on the individual part level, but not with the complex interactions I'm requiring |
07:10:06 | FromGitter | <kayabaNerve> Which is cast-less named sub-types that don't destroy the master type |
07:10:56 | FromGitter | <kayabaNerve> We have cast-less sub-types with no names but the master type, cast-less named-subtypes which destroy the master type... |
07:11:02 | FromGitter | <kayabaNerve> C++ would just yell CAST! and walk away |
07:13:53 | Araq | instead of |
07:14:08 | Araq | of enumValue: fieldA, fieldB: T |
07:14:10 | Araq | use |
07:14:26 | Araq | of enumValue: s: Subobject |
07:14:49 | Araq | and when the proc only accepts Subobject, well you can then write that down |
07:15:09 | FromGitter | <kayabaNerve> I'm not using case at all right now. I moved on to Generics. |
07:15:22 | FromGitter | <kayabaNerve> But thank you for the input :D |
07:15:32 | Araq | ok, well now you know |
07:15:45 | FromGitter | <kayabaNerve> That said, now my Generic is saying it can't generate code, and I don't know when that started.... :thinking: |
07:16:10 | FromGitter | <kayabaNerve> It's not that I want to merge fields. It's that my entries into my DB have different fields depending on their types. |
07:16:19 | FromGitter | <kayabaNerve> Taking in a subtype on its own would be meaningless to me. |
07:20:53 | Araq | well if in doubt, use more json :P |
07:21:38 | FromGitter | <kayabaNerve> I'm not using any here actually :thinking: Maybe that's my problem. |
07:22:01 | FromGitter | <kayabaNerve> The concept won't let me generate code. I think I need a case statement object with inlined getters. |
07:22:19 | FromGitter | <kayabaNerve> If this succeeds, I think I unlock some chakra and become the next Buddha. |
07:23:46 | * | dddddd joined #nim |
07:24:08 | Araq | the 'case object' quickly becomes another json, esp in the context of "databases" |
07:26:26 | FromGitter | <kayabaNerve> It's a RAM cache saved to a key/value integrated DB known as LMDB |
07:27:40 | FromGitter | <kayabaNerve> So a concept doesn't work. I tried EntryWrapper with a case statement, and that saves potentially any Entry, but you still need a switch at that switch still needs to call get. Is a get any less ugly than a cast? |
07:28:05 | FromGitter | <kayabaNerve> And Nim won't let me write a generic get, as it shouldn't. |
07:28:16 | FromGitter | <kayabaNerve> And as these are run time values, I can't write a macro. |
07:30:32 | FromGitter | <mratsim> if you have a static int in a type say type Foo\[N: static int\] = object you can retrieve it with x.N |
07:31:08 | FromGitter | <mratsim> you have plenty of example in our libraries like Stint where we parametrize types with "bits" |
07:31:38 | FromGitter | <kayabaNerve> Yet you can also declare a field in Foo of N without causing an error? |
07:31:51 | FromGitter | <kayabaNerve> I assume the field takes precedence based on PMunch and I's tests? |
07:31:51 | FromGitter | <mratsim> https://github.com/status-im/nim-stint/blob/6853ebe97c21426952ce64c2df6278514797dc3f/tests/test_io.nim#L150-L158 |
07:32:11 | FromGitter | <mratsim> ah seems like you should raise a bug |
07:39:35 | * | cyberjpn joined #nim |
07:44:19 | narimiran | any last wishes for some fix to be included in v0.19.6? |
07:44:35 | * | solitudesf quit (Ping timeout: 258 seconds) |
07:55:59 | FromGitter | <mratsim> we can always have 0.19.8 next week ;) |
07:56:35 | FromGitter | <mratsim> where is the tentative branch? |
07:58:28 | FromGitter | <mratsim> I guess 0.20 is at least in a month: https://github.com/nim-lang/Nim/issues/7041 |
08:01:37 | narimiran | https://github.com/nim-lang/Nim/commits/version-0-19 |
08:02:18 | narimiran | (two more backports need to be pushed, i've just backported them) |
08:05:46 | * | stefanos82 joined #nim |
08:08:10 | * | clyybber joined #nim |
08:08:24 | FromGitter | <mratsim> There are some VM int/uint computations that are wrong and I believe are in the backports |
08:10:40 | FromGitter | <mratsim> I think this is quite important but actually not in a PR :/ https://github.com/nim-lang/Nim/issues/11138 |
08:11:47 | FromGitter | <mratsim> so yeah nothing much but fixing that bug warrants an 0.19.8 later |
08:12:11 | narimiran | isn't that something for 0.20? |
08:13:31 | FromGitter | <mratsim> different result between runtime and compile-time is backport worthy for me |
08:19:11 | * | cyberjpn quit (Ping timeout: 246 seconds) |
08:22:38 | * | traviss quit (Quit: Leaving) |
08:42:18 | Mister_Magister | im writting bot for telegram and i'm starting to fell in love with nim |
08:42:55 | * | xet7 joined #nim |
08:46:07 | * | cyberjpn joined #nim |
08:49:04 | Mister_Magister | simple echo bot in nim compared to bot in python is like 100x lighter |
08:50:01 | dom96 | :D |
08:50:29 | dom96 | Please share this far and wide via twitter/blog posts or otherwise :) |
08:51:17 | Mister_Magister | ya bet i will |
08:51:40 | Mister_Magister | question "photo*: Option[seq[PhotoSize]]" what is seq? |
08:51:57 | narimiran | Mister_Magister: similar to python's list |
08:52:09 | narimiran | Mister_Magister: but it can't be heterogeneous |
08:52:12 | Mister_Magister | i don't know python so that's not helpful |
08:52:16 | Mister_Magister | array? |
08:52:36 | narimiran | ah, i though you're coming from python, based on that comment couple of minutes ago, sorry |
08:53:26 | FromGitter | <mratsim> seq is sequence, it's variable size container with all elements of the same type |
08:53:27 | narimiran | Mister_Magister: https://narimiran.github.io/nim-basics/#_sequences |
08:53:32 | FromGitter | <mratsim> an array is fixed sized |
08:53:49 | Mister_Magister | narimiran: nah i understand |
08:53:52 | Mister_Magister | so is it like array? |
08:54:02 | FromGitter | <mratsim> similar except that it can be resized |
08:54:08 | Mister_Magister | ah |
08:54:09 | narimiran | Mister_Magister: i would recommend you to go through the whole Nim Basics, based on the questions you asked yesterday and today |
08:54:10 | Mister_Magister | so like vector in c++ |
08:54:15 | FromGitter | <mratsim> yes |
08:54:15 | Mister_Magister | or QList |
08:54:25 | Mister_Magister | narimiran: sorry |
08:54:33 | FromGitter | <mratsim> implementation and perf is similar to std::vector |
08:55:05 | FromGitter | <mratsim> but interface has better name than "emplace_back" and all that jazz :p |
08:55:26 | narimiran | Mister_Magister: no need to be sorry :) i just think you'll find there answers for some of your questions, and it might clear some things up |
08:56:20 | Mister_Magister | okay o7 |
09:04:51 | * | laaron quit (Remote host closed the connection) |
09:06:34 | * | laaron joined #nim |
09:07:08 | * | cyberjpn quit (Ping timeout: 245 seconds) |
09:11:30 | FromGitter | <sheerluck> hi all, is there some page about blocker bugs preventing release? https://i.imgur.com/HWwriN7.png |
09:12:08 | Araq | yup, these are called 'showstopper' bugs and are tagged as such |
09:19:00 | FromGitter | <sheerluck> @Araq single 'showstopper' https://github.com/nim-lang/Nim/issues/9825 appears to be fixed in 0.19.4 |
09:21:54 | * | laaron quit (Remote host closed the connection) |
09:24:27 | * | laaron joined #nim |
09:26:27 | dom96 | If you guys need help with the release this weekend, I can commit /some/ time to it |
09:30:04 | Araq | you all like discussing package managers, don't you, so please give me some feedback: https://github.com/nim-lang/nimble/issues/653 |
09:30:21 | Araq | I'm sure I've overlooked some potiential issues |
09:30:51 | Araq | for example, what if the git repo hosts multiple nimble packages? |
09:31:23 | Araq | not sure if that's even supported though |
09:31:28 | narimiran | dom96: nice, i'll ping you if necessary |
09:33:08 | narimiran | @mratsim nice to hear that the 8-char outlier is only on my machine! |
09:33:29 | FromDiscord_ | <exelotl> woww I just lost a lot of time because I assumed del and delete were synonymous :'( |
09:33:35 | dom96 | Araq, it is |
09:34:18 | narimiran | but, just to make sure, in your script you have `StringSize = 9` — you tested it also with `StringSize = 8`, right? |
09:34:26 | FromGitter | <mratsim> yes of course |
09:34:49 | narimiran | @mratsim i never know with you and off-by-one errors :P :D |
09:35:03 | FromGitter | <mratsim> @narimiran that was off-by-2 :p |
09:35:23 | FromGitter | <mratsim> @dom96 interesting, do you have an example of multi-nimble package in one repo? |
09:35:25 | narimiran | exelotl: that is now even highlighted in the overview https://nim-lang.github.io/Nim/system.html#system-module-seqs :) |
09:36:13 | narimiran | @mratsim i hope you realize i'll ride that horse for quite some time, because this is my once-in-a-lifetime chance to do it :) |
09:37:10 | FromGitter | <mratsim> it's not once in a lifetime, I often got off-by-one when implementing division for bigints :/ |
09:37:48 | FromGitter | <mratsim> this was super tricky: https://github.com/status-im/nim-stint/blob/master/stint/private/uint_div.nim#L146-L152 |
09:38:08 | narimiran | might be, but usually all i can do when i look at your code is: shut up and learn from it |
09:38:21 | FromDiscord_ | <exelotl> narimiran ah thanks, it's good to see how the new docs are shaping up x) |
09:40:11 | FromGitter | <mratsim> by the way, when timing the hash, if the proc is fast you should use a template or enforce {.nimcall.} if you pass it to a proc |
09:40:33 | FromGitter | <mratsim> sometimes you get closures and their construction will mess up your benchmark |
09:41:14 | FromGitter | <mratsim> hash is slow so it's fine but if you wanted to time addition, you need template for sure |
09:43:47 | leorize[m] | should the compiler be able to detect automatically if a closure is needed? |
09:44:23 | Araq | the compiler does that |
09:54:01 | dom96 | narimiran: Those docs are beautiful! |
10:01:27 | Mister_Magister | !eval var sth = "e"; var s = sth & "\n" |
10:01:29 | NimBot | <no output> |
10:01:35 | Mister_Magister | hmm |
10:02:05 | Araq | !eval var sth = "e"; var s = sth & "\n"; echo s |
10:02:07 | NimBot | e↵ |
10:04:15 | * | Vladar joined #nim |
10:05:04 | Zevv | narimiran: you should move those nim-basics CSS's into the normal nim docs |
10:22:05 | * | abm joined #nim |
10:26:45 | clyybber | !eval var sth = @[2, 2]; echo repr sth |
10:26:47 | NimBot | 0x7fd6ae4f2048[2, 2]↵ |
10:27:01 | clyybber | huh, I really thought it would emit |
10:27:03 | clyybber | @ |
10:27:59 | clyybber | !eval var sth: seq[int]; sth.add 1; echo repr sth |
10:28:01 | NimBot | 0x7f4644868048[1]↵ |
10:41:27 | * | xet7 quit (Read error: Connection reset by peer) |
10:45:53 | * | abm quit (Quit: Leaving) |
10:46:34 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
10:46:48 | * | laaron- joined #nim |
10:48:54 | * | avsej quit (Quit: Quit) |
10:49:03 | * | avsej joined #nim |
10:49:03 | * | avsej quit (Changing host) |
10:49:03 | * | avsej joined #nim |
10:55:01 | Zevv | repr doesn't |
10:56:54 | Zevv | clyybber: http://p.zevv.nl/?bb0a :) |
10:58:10 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
10:58:51 | Mister_Magister | question. if i want to receive and parse simple json from url what is the simplest way of doing it? |
10:59:39 | Zevv | Mister_Magister: https://nim-lang.org/docs/httpclient.html |
11:00:14 | Mister_Magister | Thanks another question. If i want to get random line from file? |
11:00:23 | * | laaron joined #nim |
11:00:40 | Mister_Magister | without loading whole file into memory ofc |
11:01:11 | Zevv | Read lines, and for each line make a random choice of 1/lineno to keep the new line |
11:01:42 | Mister_Magister | but how do i get number of lines |
11:01:50 | Mister_Magister | or i don't follow |
11:05:47 | Zevv | You don not need the number of lines in advance, it's a simple statistics thing |
11:05:54 | Zevv | Mister_Magister: http://p.zevv.nl/?dd04 |
11:07:02 | Mister_Magister | interesting |
11:09:18 | clyybber | Zevv: I see, somehow deech's comment really confused me |
11:09:40 | Mister_Magister | Zevv: but it's possible that result of that will be none |
11:09:59 | Zevv | then I have a off by one error somehwere, I didn't test it properly |
11:10:21 | Zevv | The algorithm is basically: on the first line, you should have 100% chance to keep it. On the second 50%, third 33%, etc |
11:11:15 | Zevv | Mister_Magister: one sec, I'll fix it |
11:13:08 | Zevv | http://p.zevv.nl/?3174 fixed |
11:14:00 | Zevv | clyybber: maybe a good idea to fix repr for this, the @ is the expected behaviour imho |
11:15:15 | Mister_Magister | so it will overwrite everytime it's 0 |
11:16:06 | narimiran | dom96: thanks :) |
11:16:30 | narimiran | Zevv: "you should move those nim-basics CSS's into the normal nim docs" -> i'll take that as a compliment :) |
11:16:56 | Zevv | it is :) |
11:17:12 | Zevv | it's modern and looks sexy |
11:17:29 | Mister_Magister | yeee |
11:17:42 | Mister_Magister | as a web developer i aproove |
11:18:41 | narimiran | thank you :) (and i'm complete newbie in those kinds of things) |
11:19:25 | Mister_Magister | i have another "you should read docs" question. if i read file using readFile and have tainedstring how do i count lines in it |
11:19:27 | Zevv | clyybber: https://github.com/nim-lang/Nim/pull/11224 |
11:19:30 | narimiran | btw, the previous version of nim docs CSS was such a monstrosity (NHF to anyone). currently is....... a bit smaller monstrosity :) |
11:20:17 | Zevv | Mister_Magister: that kind of depends on what you define a 'line' as. Generally, it's a sequeonce of zero or more characters separated by '\r' or '\r\n' |
11:20:36 | Mister_Magister | so i have to count all "\n" |
11:21:00 | Zevv | plus one |
11:21:11 | narimiran | Mister_Magister: `readFile(file).splitlines` |
11:21:26 | Mister_Magister | narimiran: what is that |
11:21:39 | narimiran | the solution :) |
11:21:52 | Zevv | *a* solution |
11:21:58 | Zevv | he wants to *count* lines |
11:22:01 | FromGitter | <jrfondren> adding one assumes that the last line doesn't have a newline, which is uncommon ... but not rare? depends on editors. I'd say, count all \n and add one if there's anything after the last \n |
11:22:05 | Mister_Magister | ah splits string lines into sequence |
11:22:20 | Mister_Magister | Zevv: good enough i just need to get count of sequence |
11:22:22 | Mister_Magister | and random number |
11:22:27 | FromGitter | <jrfondren> this is also the number you would get from a simple split |
11:23:01 | Zevv | Yeah. Minus the overhead of creating a zillion strings that you throw away |
11:24:42 | Mister_Magister | one last question. how do i get number of elements in sequence? can't find docs |
11:24:50 | Zevv | .len |
11:24:52 | Zevv | or len() |
11:25:16 | Mister_Magister | thanks |
11:25:48 | Zevv | it is in the docs: https://nim-lang.github.io/Nim/manual.html#types-array-and-sequence-types says: "The length may be received by len()" |
11:27:14 | Mister_Magister | jokes[rand(jokes.len)] |
11:27:21 | Mister_Magister | gets random element |
11:28:02 | Zevv | that's *old*. In the 70's they got that on unix systems, its called "fortune" :) |
11:28:47 | FromGitter | <jrfondren> !eval rand("hello") |
11:28:48 | NimBot | Compile failed: in.nim(1, 1) Error: undeclared identifier: 'rand' |
11:28:57 | FromGitter | <jrfondren> !eval import random; rand("hello") |
11:28:59 | NimBot | Compile failed: in.nim(1, 20) Error: expression 'rand("hello")' is of type 'char' and has to be discarded |
11:29:19 | FromGitter | <jrfondren> geez. well as you can see there's already a random defined for openArray[T] |
11:30:10 | Mister_Magister | whaat? |
11:30:10 | Zevv | Mister_Magister: jokes.rand() also works for you |
11:30:15 | Mister_Magister | oh! whoa |
11:31:57 | narimiran | Mister_Magister: `jokes[rand(jokes.len)]` -> no, use this: https://nim-lang.github.io/Nim/random.html#sample%2CopenArray%5BT%5D |
11:32:14 | FromGitter | <jrfondren> line counting with npeg: https://gist.github.com/jrfondren/1da4a801cf635c810b23ca9cef5266cd |
11:32:24 | Zevv | talking about overkill :) |
11:32:46 | narimiran | Zevv: talking about https://en.wikipedia.org/wiki/XY_problem ;) |
11:33:02 | * | zahary joined #nim |
11:33:16 | Zevv | hehe |
11:33:54 | FromGitter | <jrfondren> that'd be slightly nicer if I could inc result, but it works for garbage after the last line. the real problem with it is the readFile |
11:34:19 | * | cgfuh joined #nim |
11:34:35 | FromGitter | <jrfondren> it's only not quite twice as slow as wc -l :p |
11:34:58 | FromGitter | <jrfondren> wc -l gets the wrong answer though. doesn't count the final line if it lacks a \n |
11:35:52 | FromGitter | <jrfondren> oh with -d:release it's only 1.3 times as slow as wc -l |
11:36:02 | FromGitter | <jrfondren> so there you go, use npeg to count lines. |
11:36:15 | Zevv | wc must be pretty bad code then |
11:36:39 | FromGitter | <alehander42> obviously a version of `.count` should be able to do this |
11:36:45 | FromGitter | <alehander42> something like `.count(Newlines)` |
11:36:50 | FromGitter | <jrfondren> well the readFile might be helping slightly with the small file I have |
11:38:08 | FromGitter | <alehander42> the pag solution is cool, but there really should be a more optimal/simple way |
11:38:17 | FromGitter | <alehander42> doesn't count accept a set of chars? |
11:38:56 | FromGitter | <jrfondren> sure, strutils has a count |
11:39:04 | FromGitter | <alehander42> !NimBot test |
11:39:10 | Zevv | Fastest would be to iterate memory in 128 bit steps and use the appropriate SIMD instructions to find newlines |
11:39:53 | FromGitter | <jrfondren> file.count('\n') + int(file[^1] != '\n') |
11:40:03 | narimiran | !eval echo "@alehander42, use !eval ;)" |
11:40:05 | NimBot | @alehander42, use !eval ;) |
11:40:22 | FromGitter | <alehander42> :P |
11:41:12 | FromGitter | <jrfondren> !eval import strutils; echo "a\nb\nc".count('\n') + int("a\nb\nc"[^1] != '\n') |
11:41:15 | NimBot | 3 |
11:41:23 | Mister_Magister | hmm worst part is that i'm getting "Error: unhandled exception: Can't obtain a value from a `none`" and no info about line ;-; |
11:41:44 | FromGitter | <jrfondren> try whatever you're doing without -d:release |
11:43:02 | FromGitter | <alehander42> you have to check if your value is none |
11:43:12 | FromGitter | <alehander42> before trying to getValue from it |
11:43:22 | Mister_Magister | well i know that |
11:43:25 | Mister_Magister | but on what line lol |
11:43:32 | FromGitter | <jrfondren> oh yeah the npeg version is literally a thousand times slower than wc on a 400MB log. again readFile might be involved. |
11:43:34 | Mister_Magister | @jrfondren sadly backtrace is in libs |
11:43:52 | FromGitter | <jrfondren> well start from where you invoke the first lib in the backtrace |
11:43:54 | narimiran | Mister_Magister: it must tell you the line in your file |
11:44:05 | FromGitter | <alehander42> ah ok, yeah use `--debugger:native` or `--debugInfo --lineDir:on` |
11:44:09 | narimiran | read the top-most line :P |
11:44:20 | Mister_Magister | narimiran: it doesn't |
11:44:29 | Mister_Magister | top line is ../.choosenim/toolchains/nim-#devel/lib/pure/options.nim(181) get |
11:44:43 | narimiran | share your code snippet please: https://play.nim-lang.org/index.html |
11:44:54 | Mister_Magister | i will go back to old good echo debugigng |
11:45:04 | Mister_Magister | ah is there debugger for nim? |
11:45:29 | narimiran | Mister_Magister: lets first see why you don't see the line in your file. that's very unexpected |
11:45:30 | Zevv | nim-gdb. it's a wrapper around gdb with support for pretty printing |
11:47:36 | clyybber | Mister_Magister: Compile without --d:release and a better stack trace should appear |
11:48:48 | Mister_Magister | i got this thanks |
11:49:22 | narimiran | "i got this thanks" - famous last words |
11:49:54 | Mister_Magister | narimiran: i mean i fixed it :P |
11:50:08 | Mister_Magister | clyybber: that doesn't give lines tho |
11:50:25 | narimiran | do you use verbosity:0 or something like that? |
11:51:03 | Mister_Magister | no |
11:51:10 | Mister_Magister | it gives a lot of text but not lines |
11:51:33 | * | Mister_Magister plays with nim at work instead of doing work. |
11:51:36 | * | Mister_Magister is a bad boi |
11:52:11 | narimiran | here is how errors look on my end: `filename.nim(8, 6) Error: undeclared identifier: 'a'` |
11:52:28 | narimiran | you're saying you don't have parentheses? |
11:52:44 | Mister_Magister | i think |
11:54:00 | FromGitter | <alehander42> --linetrace:on ? |
11:54:16 | Mister_Magister | http://paste.opensuse.org/view//0ce45c46 |
11:54:35 | narimiran | bot.nim(220) |
11:54:42 | narimiran | there you go, line 220 |
11:54:57 | FromGitter | <alehander42> ahh |
11:55:20 | Mister_Magister | whoa |
11:55:40 | Mister_Magister | i don't think it was 220 tho |
11:55:48 | Mister_Magister | 220 is declaration of object |
11:55:59 | narimiran | at least you see lines which you claimed you didn't see :P |
11:56:38 | Mister_Magister | i don't see the line in which accessing null variable occurs |
11:57:57 | FromGitter | <jrfondren> that's the last line, asyncfutures.nim(353) read |
11:58:10 | Mister_Magister | and that's outside of project |
11:58:11 | Mister_Magister | in lib |
11:58:17 | FromGitter | <jrfondren> that's just not the error, since you're using asyncfeatures.nim a way that leads the null access |
11:59:02 | Mister_Magister | hm? |
11:59:05 | FromGitter | <jrfondren> suppose a lib has a `func getfifth(str: string): char = str[4]` and you call it with an empty string. you're going to get an error in this lib. |
11:59:23 | FromGitter | <jrfondren> so use the traceback to find your getfifth() call in your code and look at why you're passing it an empty string |
11:59:24 | Mister_Magister | nah i didn't just check isSome |
11:59:41 | * | narimiran facepalms |
11:59:45 | Mister_Magister | ? |
11:59:55 | Mister_Magister | am i understanding something wrong? |
12:00:10 | * | Mister_Magister runs |
12:00:18 | narimiran | https://irclogs.nim-lang.org/10-05-2019.html#11:43:02 |
12:00:24 | narimiran | "well i know that" |
12:00:58 | Mister_Magister | yeah i read that |
12:01:01 | FromGitter | <alehander42> hehe, but he needed the line info |
12:01:04 | FromGitter | <alehander42> now its all good |
12:01:07 | Mister_Magister | the thing is you need to find where you don't check it |
12:01:29 | Mister_Magister | cause i use options many times |
12:01:37 | Mister_Magister | so without lines it's hard to find |
12:01:50 | Mister_Magister | and backtrace doesn't say where |
12:01:59 | Mister_Magister | so it's guessing game time |
12:02:40 | narimiran | https://irclogs.nim-lang.org/10-05-2019.html#11:59:23 |
12:03:26 | Mister_Magister | im using that functions also many times, still guessing |
12:04:11 | Mister_Magister | I have another question if i didn't annoy you enough. I want to put text/image on another image. how can i achieve that? |
12:05:09 | narimiran | ask in some other channel which is better suited for that? :D :D |
12:05:13 | FromGitter | <jrfondren> imagemagick or similar. look at 'nimble search image'. imageman might do that. |
12:05:58 | * | Snircle joined #nim |
12:06:32 | FromGitter | <alehander42> yea |
12:06:56 | FromGitter | <alehander42> btw guys when you debug, do you want to sometimes filter your traceback, e.g. not seeing some system/builtin functions |
12:07:14 | Mister_Magister | thanks |
12:07:45 | narimiran | Zevv: https://github.com/nim-lang/Nim/issues/9677 i also cannot reproduce it with nim devel, can you re-test it on your end? |
12:10:16 | Zevv | wow that's long ago |
12:10:46 | narimiran | yeah and i would like to close it ;) |
12:10:53 | Zevv | well, close it then |
12:11:33 | narimiran | so on your end you also get more helpful message now? |
12:11:45 | Zevv | I changed my code |
12:12:03 | Zevv | I was trying to handle audio callbacks from an SDL-created thread |
12:12:53 | Zevv | I now do only a C memcpy() and SDL things in my callback, so there is no Nim-managed memory used from there, an nod foreignThreadGC needed |
12:12:55 | narimiran | now i see in playground that the error is like you reported on v0.19.4; but it is fixed on devel so i'm closing it |
12:14:05 | Zevv | \o/ |
12:14:48 | Mister_Magister | flippy sounds nice for job |
12:15:32 | FromGitter | <alehander42> Araq, why would my config.projectPath be == $HOME |
12:15:35 | narimiran | @alehander42 how would you decide what is (not) important? |
12:15:37 | FromGitter | <alehander42> is it possible |
12:16:00 | FromGitter | <alehander42> well, maybe config |
12:16:57 | FromGitter | <alehander42> or maybe at least color differently e.g. "my code", "stdlib code" and 3rd party code |
12:17:03 | FromGitter | <alehander42> parts of stack trace |
12:17:17 | FromGitter | <alehander42> just trying to think of cool possible custom ideas |
12:17:35 | FromGitter | <alehander42> i noticed python had several times custom traceback libs which seemed popular |
12:20:37 | narimiran | nimble RFC: https://github.com/nim-lang/nimble/issues/653 - share your opinions |
12:22:13 | livcd | How can I do something like this ? readFile a resource to embed it into the binary, when the binary gets executed that assets gets dumped into a specific location and reloaded (read,evaluate) by the same binary? |
12:22:49 | Zevv | read it in a const |
12:23:06 | Zevv | and at run time, write/read to the file |
12:24:33 | * | laaron quit (Remote host closed the connection) |
12:25:23 | narimiran | also, if anybody could run this on their machine just to confirm there's no anomaly when you set line 38 to `StringSize = 8`? https://gist.github.com/mratsim/e5a2d1d74adc2763ab7b080a7c40ef1e |
12:26:04 | Zevv | define 'no anomaly' |
12:26:18 | * | laaron joined #nim |
12:26:27 | narimiran | try it with sizes 7, 8 and 9. |
12:26:49 | Zevv | it runs in all cases ,but the output differs |
12:27:17 | Zevv | oh it's timing |
12:27:19 | Zevv | no wonder |
12:27:22 | narimiran | for 7 you should get almost the same last number; for 8 and 9 the number before --- should be larger than the number in the last line |
12:28:00 | narimiran | if you hit for 8 that the number above --- is ~40% higher than the number in the last line - that's anomaly |
12:28:24 | Zevv | if(v1 > v2*0.4) echo "Anomaly" |
12:28:41 | Zevv | looks ok here |
12:28:44 | narimiran | Zevv: oh cmon |
12:28:47 | narimiran | that's wrong |
12:28:53 | narimiran | if(v1 > v2*1.4) |
12:28:57 | Zevv | haha |
12:29:10 | narimiran | and lose the parentheses there ;) |
12:29:18 | Zevv | Typing C all day |
12:29:20 | Zevv | sorry |
12:32:24 | livcd | Zevv: hmm I am not sure how... |
12:32:40 | Zevv | livcd: which part? |
12:33:40 | livcd | const script = "foo.ps1"; let res = staticRead(script); -> how do i write it then ? |
12:33:54 | livcd | sorry readFile(...) |
12:34:23 | Zevv | You want to write at runtime, right? |
12:35:04 | Zevv | writeFile(fname, res) should do? |
12:35:10 | Zevv | Or am I missing something obvious? |
12:35:33 | livcd | sorry i did not read properly the docs |
12:35:33 | clyybber | const script = staticRead("foo.ps1") |
12:35:34 | livcd | it works now |
12:35:44 | clyybber | kk |
12:36:14 | Zevv | const script = readFile() should also work since 0.19.4 |
12:36:23 | Zevv | but staticRead is ok |
12:40:19 | FromGitter | <mratsim> @alehander42 yeah distinction between system, third party and own lib would be nice |
12:42:36 | * | laaron quit (Remote host closed the connection) |
12:44:21 | FromGitter | <kaushalmodi> @mratsim may be I am saying in wrong context, but `import std/terminal` would ensure using the terminal from stdlib |
12:45:12 | * | laaron joined #nim |
12:45:44 | FromGitter | <alehander42> @mratsim i am not sure if that would be better in a 3rd party optional traceback lib tho |
12:45:48 | FromGitter | <alehander42> i wouldnt write a rfc yet |
12:47:11 | * | Kaivo joined #nim |
12:50:25 | clyybber | kaushalmodi: We are talking about stacktraces, so how to differentiate where an error came from visually |
12:55:09 | livcd | http://ix.io/1IAR/nim am i not doing the interpolation wrong ? |
12:58:07 | FromGitter | <kaushalmodi> clyybber: oops! Thanks :) |
12:59:56 | * | rnrwashere joined #nim |
13:03:05 | * | nsf quit (Quit: WeeChat 2.4) |
13:03:59 | * | rnrwashere quit (Remote host closed the connection) |
13:08:36 | * | rnrwashere joined #nim |
13:11:51 | FromGitter | <sheerluck> how come there are "1674 commits to devel since this tag" after both 0.19.4 and 0.19.6 -- https://i.imgur.com/i5pE4Dk.png |
13:14:04 | FromGitter | <alehander42> love you people |
13:14:07 | FromGitter | <alehander42> 1674 is huge |
13:15:16 | * | natrys joined #nim |
13:24:45 | narimiran | sheerluck there could be three things: 1. coincidence, 2. github shows wrong number, 3. i fucked up something |
13:27:05 | narimiran | ah, i think i know what this is |
13:27:06 | Zevv | So, what will be the main release notes for 0.19.6? |
13:27:34 | narimiran | "0.19.6, even more boring release than 0.19.4, and that's good" |
13:28:10 | Zevv | That'll get an upvote storm going on HN I guess |
13:28:34 | narimiran | sheerluck since commits are backported this creates V-shape split in git history, and the root of that spit was 1674 commits ago |
13:28:56 | narimiran | Zevv: 0.20's job is to take the spotlight |
13:29:45 | Zevv | if that's where the new runtime goes, sure! |
13:30:10 | narimiran | even without it, 0.20 brings a lots of goodies to the table |
13:30:40 | narimiran | sheerluck see https://github.com/nim-lang/Nim/tree/b6d96cafc8bcad1f3d32f2910b25cd11a93f7751 vs https://github.com/nim-lang/Nim/tree/c6f601d48ec81e0d6e052ba0d19a195b55cc68f2, you'll see different number of commits |
13:31:57 | shashlick | 0.19.6 is a big deal - it means Nim is committed to stability |
13:32:59 | federico3 | uh? |
13:33:06 | shashlick | zero corporates are interested in the bleeding edge |
13:33:14 | federico3 | sure |
13:33:40 | narimiran | shashlick: just the man i was looking for! now that we have 0.19.6 tag - does this trigger nightlies automatically, and if not - can it be done manually? |
13:34:02 | narimiran | and even arch isn't interested in bleeding edge when it comes to nim ;) |
13:34:14 | shashlick | nightlies will run per usual on the version-0-19 branch |
13:34:24 | shashlick | but we can kick it off right now if needed |
13:35:31 | narimiran | shashlick: CI is still running for the latest commit/tag https://github.com/nim-lang/Nim/commits/version-0-19, but if that is not a problem then yeah, creating them now (and not in 12+ hours) would be nice |
13:35:54 | shashlick | cool, let me know when CI passes and i can kick off a new build |
13:36:11 | narimiran | https://www.archlinux.org/packages/?sort=&q=nim |
13:36:21 | shashlick | if you have access, you can also trigger a build when you are ready - https://travis-ci.org/nim-lang/nightlies |
13:36:47 | narimiran | oh, i just do 'restart build'? |
13:37:14 | shashlick | no trigger build in drop down on the right i think |
13:37:49 | shashlick | under More Options |
13:38:17 | narimiran | nope, i don't have that. i guess you'll be the one pressing the button :) |
13:42:30 | shashlick | okay cool |
13:48:35 | * | solitudesf joined #nim |
13:50:08 | clyybber | Araq: Is there already a way to somehow get the set of all global Syms? Would be pretty handy to enhance the aliasing detection and also for fixing destructors getting called too early on globals |
13:51:58 | Araq | it's theoretically possible but bad design, modularity would suffer |
13:54:03 | clyybber | Araq: per-module would be good enough |
13:54:38 | clyybber | and would suffice for fixing overly eager global destructors |
13:57:10 | * | PMunch quit (Remote host closed the connection) |
13:57:15 | * | zahary quit (Ping timeout: 248 seconds) |
14:03:37 | clyybber | nevermind, theres no need for that. |
14:14:29 | * | rnrwashere quit (Remote host closed the connection) |
14:20:19 | * | zahary joined #nim |
14:25:11 | * | Trustable joined #nim |
14:33:06 | shashlick | @Araq - just replied to the nimble RFC, i'm still confused 🙂 |
14:37:16 | Araq | shashlick, why? |
14:41:03 | * | rnrwashere joined #nim |
14:42:35 | FromGitter | <arnetheduck> I understand it as pretty straightforward: don't screw around with the directory structure already in the repo |
14:43:44 | * | rnrwashere quit (Remote host closed the connection) |
14:44:34 | * | rnrwashere joined #nim |
14:44:41 | FromGitter | <arnetheduck> which sounds like a step in the right direction.. I don't mind that there's a convention that the tool supports (and no other), even removing the srcdir config and supporting only one convention is better (for example, only supporting sources in `src` which is sane, because it doesn't cost anything when the package is small and you'll thank the tool when the project grows and you also want a doc, tests etc folder.. |
14:45:29 | FromGitter | <arnetheduck> convention over configuration and all that |
14:45:30 | Araq | shashlick, ok, I understand your remarks |
14:47:21 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
14:47:25 | shashlick | Concern is primarily backwards compatibility |
14:47:33 | * | laaron- joined #nim |
14:47:54 | shashlick | We can break everyone and force a change |
14:48:04 | shashlick | Will make the design simple |
14:48:20 | shashlick | But then packages might not work with older versions of Nim |
14:48:35 | shashlick | And that's a headache for package maintainers |
14:54:02 | * | NimBot joined #nim |
14:55:50 | Araq | shashlick, Nim (not Nimble) would read the .nimble file to see srcDir |
14:56:01 | Araq | and imports work as they work today |
14:56:18 | Araq | backwards compatible and we don't need to deprecate it either |
14:56:57 | Araq | we *could* deprecate it to remove some logic later from the compiler but I don't care, it's already pretty complex and mostly Nimble specific code |
14:59:54 | clyybber | why do we have nimble specific code in the compiler anyway? couldn't nimble just use --path ? |
15:00:23 | clyybber | or is there functionality which *requires* nimble specific code in the compiler? |
15:00:48 | FromGitter | <jrfondren> open a random file and put "import blah" in it. Does that work? It works if the user or Nim does something. The latter is easy. |
15:01:08 | FromGitter | <jrfondren> the former is just $PATH or similar in an environment variable. |
15:01:33 | * | zahary quit (Quit: Leaving.) |
15:02:21 | FromGitter | <jrfondren> You can also choose to make it not work. Users should "import full/path/to/file/ending/in/dotnim". That doesn't seem desirable though. |
15:03:26 | Araq | clyybber, 'nimble c p.nim' builds p by giving nim the exact --path, but 'nim c p.nim' also works and uses the latest version of all the involved packages |
15:03:26 | FromGitter | <jrfondren> The connection to nimble is that it puts files where Nim independently knows where to look for them. |
15:03:54 | clyybber | Araq: Oh, I didn't know that. |
15:04:09 | clyybber | jrfonden: I see, thanks |
15:10:08 | FromGitter | <brentp> does anyone have an updated valgrind suppression file? this one: https://github.com/nim-lang/Nim/issues/3063#issuecomment-118594928 is insufficient |
15:17:08 | Araq | brentp: no but you can tell valgrind to produce a suppression file for you |
15:18:29 | FromGitter | <brentp> @Araq wow. thanks. didn't know about that option. on it. |
15:24:39 | * | abm joined #nim |
15:26:18 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:30:44 | * | vivus joined #nim |
15:31:33 | disruptek | what if nimble were replaced by a group of smaller, unix-cli-style-do-one-thing-and-do-it-well tools that actually integrated with the environments that users actually have? ie. we don't create the whole environment (nimble) but we extend and integrate into whatever we find. |
15:32:16 | vivus | hello all |
15:32:36 | vivus | in this example: https://nim-lang.org/docs/parsecsv.html |
15:32:37 | disruptek | we can just wrap things like git so that we can be introspected and twiddled by the user's git workflows and tools. |
15:33:06 | vivus | what would I replace for `tabs` here: `echo "##", col, ":", p.rowEntry(col), "##"` |
15:33:10 | * | laaron joined #nim |
15:33:33 | disruptek | !eval echo "##", col, ":", p.rowEntry(col), "##" |
15:33:35 | NimBot | Compile failed: in.nim(1, 12) Error: undeclared identifier: 'col' |
15:33:50 | disruptek | !eval echo "##\t##\t##" |
15:33:52 | NimBot | ## ## ## |
15:35:25 | * | laaron quit (Client Quit) |
15:35:43 | Mister_Magister | so if nim compiles (can compile) to C it's possible to program atmega using it right |
15:35:53 | disruptek | as another example, we can perform edits to nim.cfg or even .nim files, generate .nim programs that perform a build, a test, or dependency analysis. |
15:36:02 | * | laaron joined #nim |
15:36:58 | disruptek | Mister_Magister: basically, anything you can code in C (ergo asm) you can code in nim. |
15:37:13 | Mister_Magister | disruptek: ye ye that's what i thought |
15:37:19 | Mister_Magister | so it should be possible to program atmega using it |
15:37:24 | disruptek | sure. |
15:37:29 | Mister_Magister | can nim compile to 8/16 bit? |
15:37:32 | Araq | disruptek, I doubt it would work out. Keep in mind that Nimble starts with a dependency graph that is otherwise not available at all |
15:37:57 | Mister_Magister | why did i even ask xd https://disconnected.systems/blog/nim-on-adruino/ |
15:38:47 | disruptek | Araq: i don't understand. if nimble was created, and i'm sure it was, then that means we can do no worse. |
15:39:11 | disruptek | Mister_Magister: there are a few folks in here who code against microcontrollers. |
15:39:29 | Mister_Magister | nice |
15:39:39 | Mister_Magister | that makes me happy |
15:39:47 | Araq | er, that's mildly offensive |
15:39:49 | * | laaron quit (Client Quit) |
15:40:39 | disruptek | i'm not disparaging nimble; it seemed like you were saying that we cannot achieve was has already been achieved in nimble. |
15:40:41 | vivus | hmmm, that didn't help |
15:41:26 | disruptek | Araq: but, as i said, i don't understand. |
15:42:02 | * | laaron joined #nim |
15:42:44 | Araq | disruptek, me neither. the problems I have with Nimble are written down and eventually will be solved |
15:46:11 | disruptek | the problems you have with nimble seem solvable with a 5-line shell script, as is basically any other task for a package manager, honestly. |
15:46:45 | * | laaron quit (Ping timeout: 256 seconds) |
15:46:52 | Araq | and you can say that because you "don't understand" my problems? :P |
15:47:18 | disruptek | what i don't understand is your comment to me at 11:37. |
15:47:29 | disruptek | or whatever passes for 11 in your timezone... ;-) |
15:48:07 | disruptek | i guess what i'm saying is, i don't understand why we cannot implement nimble in shell. |
15:48:45 | FromGitter | <alehander42> Programming in shall is not nice |
15:48:58 | * | laaron joined #nim |
15:49:35 | disruptek | you don't /have/ to program in shell. it's a thought experiment. |
15:50:56 | disruptek | let me put it this way: it might be easier to write a shell, or a repl for build process, than it is write a package manager. |
15:51:58 | vivus | so this is what my CSV file looks like: https://dpaste.de/jQRR |
15:53:09 | vivus | when I try: `echo "##", col, "\t", p.rowEntry(col), "##"` it shows blank results |
15:53:26 | clyybber | disruptek: You don't use nimble, and apparently have no use for it. FYI nimble uses nimscript. |
15:53:53 | FromGitter | <alehander42> Hmm I am not sure I get the example |
15:54:00 | FromGitter | <alehander42> But it sounds interesting |
15:54:23 | clyybber | disruptek: But packagemanagers have dependency resolving. This is the most complex thing about package managers. |
15:54:32 | FromGitter | <mratsim> Shell management is a hack .... |
15:54:55 | clyybber | it works, but not for complex dependencies |
15:54:58 | disruptek | shells are bad but repls are good. |
15:55:00 | FromGitter | <mratsim> I'm glad I don't have shell based init, nor shell based package manager in Arch |
15:55:23 | disruptek | it's a topsy turvy world out there. |
15:56:38 | clyybber | disruptek: a shell is a repl, no? |
15:57:14 | FromGitter | <jrfondren> @vivus, that's a tab-separated value. so you're opening it with a separator of '\t', yes? |
15:57:16 | disruptek | my dudes, the point is that when i think about the tasks of a package manager, i see them as units not unlike small scripts. i use the term *script* to indicate a targeted operation, an implicitly conceptually simple or high-level program that connects code to data. |
15:57:35 | disruptek | clyybber: a shell is a repl. |
15:57:42 | FromGitter | <jrfondren> I'm not sure there's a point in the point |
15:58:03 | FromGitter | <jrfondren> nimble has a bunch of subcommands. obviously each of those could be a command in a package-management repl. |
15:58:14 | vivus | @jrfondren when I use `\t` as the separator, all results come back blank |
15:58:57 | disruptek | the point is that other package managers are opinionated on what your workflow is. what if nim could let you declare your opinions, either with shell, or nimscript, or nim. we provide a framework from which you can arrange your projects however you please. |
15:58:59 | shashlick | Package management isn't easy, many have tried, it's not wise to trivialize it |
15:59:28 | disruptek | i agree, and that's why i've used gentoo for the last decade. |
16:00:20 | FromGitter | <jrfondren> once that's done, what would actually change? What would people actually do differently? What would documentation suggest as an alternate workflow? Why not target that instead of a design that might facilitate it? |
16:00:54 | clyybber | disruptek: what leads you to believe that nimble can't let you define arbitrary build tasks? |
16:00:59 | disruptek | because being opinionated means taking a stand on how everyone is going to work, as opposed to letting people choose. |
16:01:01 | clyybber | because it can |
16:01:35 | FromGitter | <jrfondren> f.e., if you want npm-style dependencies local to your project, you could completely rework nimble and have a repl of scriptable commands... or you could add a localinstall subcommand to nimble |
16:01:40 | disruptek | as a result, people are literally worrying about whether source code lives in a src subdirectory. |
16:01:43 | * | disruptek boggles. |
16:02:01 | * | laaron quit (Remote host closed the connection) |
16:02:16 | vivus | @jrfondren okay I figured it out, partially |
16:02:16 | FromGitter | <mratsim> That's orthogonal to having a shell script or a package manager written in Nim |
16:02:42 | FromGitter | <jrfondren> this worry is happening because someone did something wrong once, and was annoyed by it. People are going to make more mistakes and be more annoyed when there's no clear way to manage packages because you're supposed to figure it out yourself. |
16:03:15 | clyybber | disruptek: gentoo or literally any packagemanager on linux also is opinionated. Every binary is in usr/bin etc. |
16:03:37 | disruptek | there can be a clear way, but what's clearly a problem is that people want the system fractured on different points. |
16:03:37 | FromGitter | <jrfondren> @vivus, what was it? |
16:04:07 | disruptek | i'm suggesting that maybe the solution is to fracture it more fully and let people edit the pieces before reassembly. |
16:04:08 | vivus | `for val in items(p.row): echo "##", val, "##"` |
16:04:15 | FromGitter | <mratsim> Well right now there is are 2 ways and anything in betweeen doesn't work |
16:04:37 | vivus | now I am trying to figure out how to tell the parser what the separator is |
16:05:06 | * | rnrwashere quit (Remote host closed the connection) |
16:05:09 | disruptek | great, and more than two ways is too hard to render in shell? |
16:05:35 | disruptek | i mean, what are we actually talking about here. can we not let the user make the determination about how they want resolution to work? |
16:05:37 | FromGitter | <mratsim> either with everything in "src" or "project.nim" at root and everything in "project/". In the src case what nimble installs has not the same structure as what the dev intended |
16:05:45 | FromGitter | <jrfondren> @vivus, p.open("file.csv", separator='\t') |
16:05:59 | FromGitter | <jrfondren> @vivus, that example assumes you have a header row as well. |
16:06:10 | disruptek | i see, you can explain the problem in one sentence, but none of us can solve it in any amount of nim. /that/ makes sense. |
16:06:14 | vivus | yeah I just realized I didn't have a header |
16:06:22 | FromGitter | <mratsim> The whole point is that nimble does not respect what the dev intend in once case, but does in the other |
16:06:23 | vivus | haven't coded in a while |
16:06:29 | vivus | so it's like relearning stuff |
16:06:48 | disruptek | preaching to the choir, my man. |
16:07:25 | FromGitter | <mratsim> but nimble could be a shell tool, we would also have this issue (which is social not tech) |
16:07:39 | * | laaron joined #nim |
16:08:16 | FromGitter | <mratsim> Being opinionated can be a good thing because people expect stuff at a certain place, that's also why we now put nimcache in .cache instead of polluting people's projects |
16:08:24 | vivus | @jrfondren that seems to cause each item to display on its own row |
16:08:33 | FromGitter | <mratsim> there is still an option to not do that |
16:08:37 | FromGitter | <jrfondren> @vivus, that's how the example's written. you can just do something different |
16:08:48 | disruptek | so you're telling me that making location or dependency optional is harder than choosing correctly once. |
16:08:50 | FromGitter | <jrfondren> @vivus, you also don't need to add a header if you just want to refer to columns by number |
16:09:31 | FromGitter | <mratsim> I don't understand what you mean sorry |
16:09:48 | disruptek | because it seems clear that people have opinions on what that first choice should have been. and despite us only believing that there is one possible, ideal, path, it seems clear that we are batting .000 so far -- we thought there was only one way, and now we're convinced there are only two. |
16:10:06 | FromGitter | <mratsim> I only said that nimble should not remove the src folder if the devs wanted to use it because it breaks everything that rely on paths |
16:11:11 | disruptek | i understand what you're saying. i agree with you. when you lack the language to describe intent, intent becomes ambiguous. nothing new here. |
16:11:20 | disruptek | my point was more meta. |
16:12:45 | * | rnrwashere joined #nim |
16:13:55 | FromGitter | <jrfondren> all this time nimble has been "breaking everything that relies on paths" but somehow I can still install packages and use them. Nimble "doesn't respect devs intentions" but the humiliated, unrespected devs get work done somehow. All that talking like this does is make it hard to understand what the actual problem is. It's good for getting attention but after you've got attention you should calm down and speak clearly. |
16:14:23 | vivus | @jrfondren can you reproduce this error for me please: (CSV data): https://dpaste.de/xLOg (code+error): https://dpaste.de/Vk0b |
16:14:57 | FromGitter | <jrfondren> @vivus, you should be telling it to use \t still |
16:15:01 | FromGitter | <jrfondren> p.open("file.csv", separator='\t') |
16:15:41 | dom96 | +1 to what jrfondren said |
16:15:41 | FromGitter | <jrfondren> @vivus, I don't get an error with your code after making that change |
16:15:55 | disruptek | the actual problem is as simple as "i can't find my code". it's ridiculous. |
16:16:03 | disruptek | i mean, truly ridiculous. |
16:16:13 | vivus | what does your output show? does it show each item being output on its own line? |
16:16:16 | disruptek | ln -s src . |
16:16:35 | FromGitter | <mratsim> The problem is "users can't find my code" |
16:16:53 | FromGitter | <jrfondren> @vivus, I get "new row:" and then "##206 deu Theoretisch mache ich gerade Mathe. kroko \N 2010-10-14 14:36:23", two lines, one for each row in the file |
16:17:32 | vivus | for me, it outputs each entry onto its own line |
16:18:23 | FromGitter | <jrfondren> oh I thought you were mainly concerned with the error. are you wanting to print each column separately? |
16:19:08 | FromGitter | <jrfondren> eh I ran this without the separator set somehow. |
16:20:05 | vivus | @jrfondren for me, when I ran it without the separator, it give me an error on the same line: 1511 eng "To tell you the truth, I am scared of heights." "You are a coward!" Nero \N 2011-02-06 20:40:33 |
16:20:15 | vivus | ```1511 eng "To tell you the truth, I am scared of heights." "You are a coward!" Nero \N 2011-02-06 20:40:33``` |
16:20:18 | Zevv | vivus: add `separator='\t'` to your open call |
16:20:36 | vivus | Zevv: when I do that, it prints each item on its own row |
16:20:38 | vivus | let me show you |
16:20:57 | FromGitter | <jrfondren> @vivus, https://gist.github.com/jrfondren/0f27b58670a9902d83b0b0181f5ed9c7 <- a modified version of your code, with separator set, with input, and the output |
16:21:06 | Zevv | yes, that is what your code does. You split a row into fields, and then you print each field with '##' in front |
16:21:25 | vivus | https://dpaste.de/tTHV |
16:21:43 | vivus | brb |
16:21:53 | FromGitter | <jrfondren> yeah if you want to change the output, the thing to change is your loop. the file is still fundamentally \t-separated and the parser needs to know that regardless of what work you want to do |
16:22:11 | disruptek | the problem is, people think finding code is hard for people and machines. |
16:22:53 | FromGitter | <jrfondren> @mratsim is that still a problem, that users can't find your code? |
16:22:54 | dom96 | mratsim: That problem should have been caught by testing |
16:25:16 | disruptek | if you ask me, /problem/ is too strong a word. |
16:27:39 | FromGitter | <jrfondren> @vivus, how about this example? https://gist.github.com/jrfondren/0c2a033dd9c77f592556efe363b8f371 |
16:28:50 | * | rnrwashere quit (Remote host closed the connection) |
16:33:15 | clyybber | Araq: Is there a better way to find the main module, than just checking for sfMainModule? |
16:33:57 | FromGitter | <mratsim> @dom96 As I said yesterday, I had CI running on both windows and linux |
16:34:13 | FromGitter | <mratsim> CI was green so I assume everything worked |
16:34:31 | FromGitter | <mratsim> it didn't because nimble changes path upon install so I can't rely on CI for that |
16:34:48 | shashlick | Is the only problem that src gets removed? That's far more limited than saying nimble is too involved in package structure |
16:35:57 | FromGitter | <mratsim> The fact that you can't rely on what you have on your dev system being deployed on the user system is a problem |
16:36:07 | FromGitter | <jrfondren> CI starting with a "nimble install" would ensure that nimble stuff works. after all you could have a bad .nimble file even if all of your code is fine. |
16:36:29 | FromGitter | <mratsim> you can't because nimble install doesn't copy your test directory as well |
16:36:43 | Zevv | and your docs, and your examples |
16:37:38 | FromGitter | <jrfondren> yeah I'd prefer to have that stuff. "nimble test some-installed-package" to run the tests would help confirm that the bug isn't in my code for example. |
16:38:59 | FromGitter | <jrfondren> so would that be a PR that also fixes nimble for you, "make it possible to run tests on an installed package"? |
16:39:10 | * | rnrwashere joined #nim |
16:39:50 | FromGitter | <mratsim> being able to run tests after nimble install would be nice. |
16:40:04 | dom96 | I'm pretty sure no package manager installs tests when installing a package |
16:40:21 | FromGitter | <mratsim> bazel does |
16:40:36 | FromGitter | <mratsim> but they do install examples |
16:40:42 | FromGitter | <jrfondren> CPAN runs tests on the user's machine whenever you install packages, as a normal procedure. It's kind of soothing. |
16:41:04 | * | rnrwashere quit (Remote host closed the connection) |
16:41:14 | dom96 | Also, you *can* test installed packages |
16:41:17 | FromGitter | <mratsim> And in Archlinux at build time you have tests running in many packages like GMP |
16:41:42 | * | rnrwashere joined #nim |
16:41:59 | dom96 | I really don't want tests to run every time I install a package |
16:42:16 | FromGitter | <mratsim> cargo also has tests available |
16:42:55 | FromGitter | <jrfondren> since it doesn't happen now nobody will miss it, but if there's a flag to do that it might help with stuff like using "nimble install" in CI |
16:43:04 | dom96 | Did relative imports not raise any alarm bells? https://github.com/mratsim/Arraymancer/blob/master/tests/tests_cpu.nim#L16 |
16:43:42 | FromGitter | <mratsim> Why would it? |
16:44:52 | dom96 | because users of your code will not write imports this way |
16:44:53 | * | sacredfrog joined #nim |
16:45:47 | * | rnrwashere quit (Ping timeout: 248 seconds) |
16:45:52 | FromGitter | <mratsim> assuming I want the structure package/src/mycode and package/tests, what do you recommend for testing? |
16:47:06 | FromGitter | <mratsim> Nimble also hardcode src here: https://github.com/nim-lang/nimble/blob/master/tests/tester.nim#L10 |
16:47:55 | dom96 | I usually do this: https://github.com/dom96/nim-jsonrpc/blob/master/tests/nim.cfg |
16:48:00 | dom96 | Although I also consider this sub-optimal |
16:48:32 | dom96 | Nowadays IIRC Nimble will pass this `path` to the Nim compiler when you run ``nimble test`` |
16:49:08 | federico3 | dom96: running tests at package build time on all architectures is the default in Debian |
16:49:54 | federico3 | unfortunately Nimble doesn't have a concept of building/uploading/downloading a source package |
16:50:23 | FromGitter | <mratsim> So I was about 3 months in Nim, I looked into all those packages and nimble readme on how to package things, I did see the .cfg but though it was suboptimal, I saw some people using src, some people using the package name without src. |
16:51:06 | FromGitter | <mratsim> I choose to have a src, but didn't realize that nimble remove that directory upon install. |
16:51:33 | * | cspar joined #nim |
16:51:37 | FromGitter | <mratsim> That's was not highlighted in the doc, and it still not is. |
16:51:47 | cspar | @search taran |
16:52:02 | * | cspar quit (Client Quit) |
16:52:09 | FromGitter | <mratsim> with init at least it's much better than before |
16:52:36 | FromGitter | <mratsim> but still, reducing friction for new people is something we should strive for |
16:52:41 | dom96 | Nimble doesn't "remove" it. It installs the "srcDir" |
16:53:06 | FromGitter | <mratsim> When I develop a package, I expect the package manager to install the package |
16:53:18 | FromGitter | <mratsim> expectation vs reality |
16:53:57 | FromGitter | <mratsim> There are areas where we can give surprises, because we are innovating in those areas (say static, macros) |
16:57:41 | * | xet7 joined #nim |
16:59:03 | vivus | ty for that awesome alternative gist @jrfondren |
16:59:48 | * | rockcavera quit (Remote host closed the connection) |
17:00:52 | federico3 | mratsim: yes, Nimble is not explicit at all about what it's going to install |
17:01:58 | * | vivus quit (Remote host closed the connection) |
17:14:43 | FromGitter | <arnetheduck> Yeah the point here was to be clear |
17:32:40 | * | rnrwashere joined #nim |
17:34:00 | * | rnrwashe_ joined #nim |
17:34:10 | * | rnrwashere quit (Read error: Connection reset by peer) |
17:37:49 | * | rnrwashe_ quit (Remote host closed the connection) |
17:38:15 | * | rnrwashere joined #nim |
17:38:18 | * | rnrwashere quit (Remote host closed the connection) |
17:43:23 | * | rnrwashe_ joined #nim |
17:47:43 | * | rnrwashe_ quit (Ping timeout: 246 seconds) |
17:53:14 | * | sacredfrog quit (Ping timeout: 255 seconds) |
17:55:10 | * | rnrwashere joined #nim |
17:56:16 | shashlick | Ok rereading all this clarifies one thing - the RFC is overkill if the issue is simply retaining directory structure |
17:57:03 | shashlick | Seems the change is simply to remove the srcDir feature and not exclude install of all folders |
17:57:32 | shashlick | We shouldn't mess with namespace introduction since that's not what people are complaining about |
17:58:29 | * | rnrwashere quit (Read error: Connection reset by peer) |
17:58:52 | * | rnrwashere joined #nim |
18:01:12 | Araq | ??? |
18:01:52 | * | sacredfrog joined #nim |
18:02:24 | Araq | can't say I agree. Simplicity is nice to strive for and I don't see how tasks like 'nimble test/doc' can work with an "installed" Nimble package |
18:03:20 | shashlick | i am still on that square - all I'm saying is that adding $project to `$nimbleDir/pkgs/package-x.y.z/$project` is unwarranted if the primary issue is loss of package structure |
18:03:21 | * | rnrwashere quit (Ping timeout: 246 seconds) |
18:03:43 | shashlick | cause that breaks all existing import statements and introduces the challenge of backwards compatibility and all that |
18:04:11 | shashlick | if we keep the namespace issue aside, then we can focus on the package structure topic |
18:04:20 | shashlick | where src shouldn't go away, tests, docs shouldn't be excluded, etc. |
18:04:59 | shashlick | the namespace issue is basically that two packages can have the same file.nim and nim will pick the first one it finds rather than the one you want - that cannot be solved without adding the $project prefix |
18:05:06 | shashlick | but it is mixing two different issues into the same discussion |
18:05:35 | shashlick | and it is partly my fault cause I threw that $project in there 😄 |
18:05:39 | * | jjido joined #nim |
18:10:29 | Araq | shashlick, the "enforced" structure is overkill for tiny projects and wouldn't work for bigger projects like the Nim compiler itself. |
18:10:55 | shashlick | i agree and i am for changing that |
18:11:21 | shashlick | i just want to remove $project from the install path so that it doesn't introduce an additional backwards compatibility challenge |
18:11:36 | shashlick | i am looking at the code to see how srcDir is handled today |
18:11:55 | shashlick | @mratsim - does `src` get removed if you don't set `srcDir = "src"`? |
18:11:56 | Araq | and this is not only my personal opinion, there is also big wrappers like Godot that struggle with the setup |
18:12:26 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:12:29 | shashlick | i hate the fact that nimble is picky about files - it has broken my nimgen workflow since the beginning and continues to bother nimterop |
18:12:44 | Araq | there are also mixed language environments where you simply *cannot* follow whatever Nimble dictates you should do |
18:12:59 | shashlick | i cannot download upstream source files since nimble doesn't scan them, and if i do it after the fact, nimble doesn't uninstall since they weren't installed by nimble |
18:13:37 | FromGitter | <mratsim> src doesn't get removed, but I don't remember why I had to have srcDir in there |
18:14:01 | Araq | Nimble with its Nimscript/task integration makes a really good build and packaging tool, in theory. |
18:14:15 | Araq | and then it falls short with this picky structure it tries to enforce |
18:14:25 | shashlick | @mratsim - in some sense, simply removing srcDir from your nimble file should fix you then |
18:14:26 | FromGitter | <mratsim> Ah no, I just followed blindly nimble advice: https://github.com/mratsim/Arraymancer/commit/72e8093f6631ed61aed9bf362ae62e74075849b2 |
18:15:20 | shashlick | well, i too had to play some games looks like - https://github.com/nimterop/nimterop/blob/master/nimterop.nimble#L11 |
18:15:52 | FromGitter | <mratsim> ah no it wouldn't work, if you don't put srcDir it only install the folder with the exact name as your package.nim |
18:16:16 | Araq | shashlick, I don't understand what you mean by $package |
18:18:22 | shashlick | @Araq: in your RFC, you describe packages A and B with the same utils file |
18:18:59 | shashlick | that's the namespace issue, what i'm saying is that that issue has nothing to do with the fact that nimble is picky about the files it installs |
18:19:25 | shashlick | so if we can separate that out as a separate RFC/discussion/feature and defer that for now, we can figure out the packaging issues in a cleaner fashion |
18:25:00 | federico3 | +1 |
18:26:49 | FromGitter | <arnetheduck> shashlick, sure, backwards compat is fine, but first establish where you want to go - a structured approach or one that swallows anything? the latter gives plenty of (meaningless?) options, the latter allows building convenient tooling that makes use of the conventions to keep complexity down at the expense of loss of theoretical freedom |
18:27:30 | * | rnrwashere joined #nim |
18:29:41 | FromGitter | <arnetheduck> fwiw, I think nimcache could easily go in the project structure as well.. just collect all outputs in a single `out` folder - cache, binaries etc |
18:30:13 | FromGitter | <arnetheduck> no magic global `$HOME/.whoknowswhere` thing that people must learn to clear for every dep resolution bug in the compiler |
18:30:55 | shashlick | i think there's only two real changes - one is to get rid of srcDir and all installX directives, second is to install everything in the folder to $nimbleDir/pkgs |
18:31:11 | shashlick | we can leave skipX directives so that users can skip installing stuff they don't think should be installed |
18:31:50 | shashlick | i think that should solve the confusion and enable nimble test/doc X |
18:31:55 | * | rnrwashere quit (Ping timeout: 248 seconds) |
18:32:23 | shashlick | the problem is that srcDir is recommended and that causes confusion, and without it, you need installDir to get your stuff in which is unnatural |
18:32:48 | * | Jesin quit (Quit: Leaving) |
18:33:04 | shashlick | in short, there's no structure or swallowing, just pass through everything unless you don't want to with skip |
18:33:20 | dom96 | I don't think installing everything is a good idea |
18:33:29 | dom96 | Who knows what users will have in there |
18:33:40 | dom96 | I routinely have huge csv files and other crap that I don't want installe |
18:33:42 | dom96 | *installed |
18:33:59 | shashlick | wysiwyg since the directory structure will reflect what the imports will look like |
18:34:38 | FromGitter | <arnetheduck> I don't think installing is a good idea :) |
18:34:49 | FromGitter | <arnetheduck> cloning into package repo seems much more sustainable |
18:34:53 | shashlick | well, then as a package manager, you should skip it rather than having nimble be so conservative |
18:35:37 | shashlick | if you put junk in your users' pkg dirs then users will push back and complain |
18:35:44 | shashlick | users here being devs who are discerning |
18:36:21 | shashlick | @arnetheduck - that's RFC #3 🙂 |
18:36:30 | * | Jesin joined #nim |
18:37:24 | shashlick | so #1 is wysiwig - don't mess with my files #2 is namespace concerns (not sure how big an issue this is) and #3 is Git it |
18:37:56 | shashlick | making these changes into small bites will make them achievable |
18:38:22 | FromGitter | <arnetheduck> by pkg dir I mean locally inside the package, in the `out` folder somewhere, along with `nimcache` and everything else belonging to that package, so you can have a single location to wipe out and multiple projects side by side.. simple, isolated, no fuss.. |
18:40:45 | FromGitter | <arnetheduck> #2 is a big issue for us that are developing a slightly larger app and looking to reuse code - the latter gets very fragile with everything sharing namespace |
18:42:05 | shashlick | do you mean across packages? |
18:43:08 | Araq | 1. there is the '-f' switch to force full recompiles, ignoring nimcache. |
18:43:11 | FromGitter | <arnetheduck> across, within, whatever, we run into all flavors |
18:43:31 | Araq | 2. there are no known "deb resolution bugs" |
18:43:57 | FromGitter | <arnetheduck> Araq, "wipe nimcache" is the known, tried and tested solution to any such issues, and it doesn't risk hitting bugs in `-f` |
18:44:11 | Araq | there are no known bugs in -f |
18:44:40 | FromGitter | <arnetheduck> no, but I trust `rm -rf` more, due to its relative simplicity :) |
18:45:02 | Araq | <insert war story here where 'rm -rf' nuked everything> |
18:45:16 | shashlick | hate to force the issue but i want to focus on the RFC for now if possible |
18:45:34 | FromGitter | <arnetheduck> you also once said there are no known bugs in dependency/rebuild scanning, and yet here we are, regularly seeing "wipe nimcache fixed all my issues" |
18:45:37 | shashlick | do folks agree that there's 3 separate improvements at this point |
18:46:20 | Araq | arnetheduck: there are indeed no bugs in "rebuild scanning", it works as documented |
18:46:55 | Araq | you misuse it, that's ok but that it in direct violation of the whole "only support some well defined subset for tooling axiom" |
18:47:00 | FromGitter | <arnetheduck> I don't know how it's documented, but when working with `{.compile.}`, I regularly have to wipe nimcache. |
18:47:44 | Araq | well .compile is not meant for C(++) code development |
18:47:53 | shashlick | well that's cause compile doesn't look at dependencies changing |
18:48:03 | Araq | .compile assumes that the code that you seek to compile is static |
18:48:05 | FromGitter | <arnetheduck> I suspect the bug is this: if I have file.nim that contains `compile x.c` and `file.c` doesn't need recompile, it will also not recompile `x.c` |
18:48:22 | FromGitter | <arnetheduck> or something along those lines, not sure |
18:48:34 | disruptek | that's arguably a bug, arguably a missing feature. |
18:48:49 | disruptek | where is the expectation set? |
18:48:52 | FromGitter | <arnetheduck> I'm always busy with something else when I run into that (like solving an an actual problem), and "wipe nimcache" just works :) |
18:48:53 | Araq | and project specific nimcache dirs have been tried, the community wanted them to go away |
18:49:16 | shashlick | that's already in the issue tracker - https://github.com/nim-lang/Nim/issues/10441 |
18:49:26 | disruptek | what's bad about per-project cache? |
18:49:46 | FromGitter | <arnetheduck> well, if you collect all outputs in a single folder it's a different story. the problem right now is that binaries and end up littering your git repo so you can't have a clean `git status` |
18:49:52 | Araq | it "pollutes" everything with build artifacts and most people are happy and never have to look at the produced C code |
18:50:25 | disruptek | it's always achievable with the compiler, right, so whatever... |
18:50:40 | Araq | well indeed there is --nimcache and --out |
18:50:45 | FromGitter | <arnetheduck> if you have an `out` and `out/bin` there's also no cost to having `out/cache`, in terms of littering, and you can gitignore a single folder and be happy |
18:51:10 | FromGitter | <arnetheduck> does that work with `nim.cfg` now btw? |
18:51:20 | disruptek | and i use it and i'm happy. it's pretty handy for llvm bytecode stuff. |
18:52:11 | FromGitter | <arnetheduck> I can set both those options from there? because even if the defaults are wrong (litter global unknown location instead of local known) at least it's simple to remedy.. though I remember at first there were issues |
18:52:27 | disruptek | i don't use it in nim.cfg, but i suppose i might if you can. |
18:53:38 | FromGitter | <arnetheduck> well, defaults are important because that's the first thing people try.. if the first thing they try turns out to be poorly thought out, disappointment ensues |
18:54:17 | * | ng0 joined #nim |
18:54:45 | * | ng0 quit (Client Quit) |
18:55:11 | disruptek | it works in nim.cfg. |
18:55:16 | dom96 | shashlick, thank you for separating these issues into 3. We really are bad at getting side tracked by off-topic things and having a single focused RFC should help with that |
18:55:29 | dom96 | This is also why I mentioned to Araq to maybe remove his statement about git from his RFC |
18:56:59 | shashlick | i guess it's okay putting all three in the RFC but need clear separation so that they can be solved individually |
18:57:06 | shashlick | otherwise it will take too long to achieve this |
18:57:45 | shashlick | focusing on #1 seems achievable near term |
18:57:53 | shashlick | did you have any concerns with my proposal for #1? |
18:59:09 | narimiran | sorry to interrupt, but: shashlick, can you trigger building of 0.19.6 nightlies? :) |
19:00:10 | shashlick | just kicked it off |
19:00:22 | narimiran | thumbs up |
19:00:42 | dom96 | Araq, I don't believe I got a vote for moving away from project-specific caches :P |
19:01:13 | dom96 | but I don't mind |
19:01:28 | FromGitter | <arnetheduck> and all this stuff about developer experience and so on is part of the reason why it makes some sense to think of it in two parts - a compiler that compiles, and a pm/build tool that delivers a convenient and conventions-based DX |
19:01:31 | dom96 | shashlick, what is your proposal? Did you write it up in an RFC? |
19:01:46 | shashlick | i commented on Araq's RFC |
19:02:01 | shashlick | and after some more thinking, i felt splitting out namespaces was warranted |
19:03:33 | shashlick | my proposal for #1 is basically https://irclogs.nim-lang.org/10-05-2019.html#18:30:55 |
19:08:05 | dom96 | There is a lot of questions in your comment shashlick |
19:09:07 | shashlick | yes, cannot always have answers 🙂 what i don't know i ask |
19:09:38 | dom96 | Makes it hard for me to know what I'm actually agreeing to or not though :) |
19:10:17 | shashlick | it also goes to say that all concerns need to be addressed before we have a real design that works |
19:11:08 | dom96 | This RFC is already too noisy for my taste, I wonder if we could take the comment you've linked above and work from that |
19:11:27 | dom96 | Maybe GitHub issues just aren't productive for this kind of thing |
19:11:39 | dom96 | Maybe we should start doing things like pros and have meetings |
19:12:09 | dom96 | or use some other tool |
19:12:50 | shashlick | i agree, at my work, most time is spent in design |
19:13:05 | federico3 | +1 on meetings |
19:13:52 | disruptek | maybe some kinda discord-like system where people can +/- comments and thread them more readily. could be a step in-between real-time systems. |
19:14:37 | disruptek | not discord, disqus. |
19:14:39 | federico3 | that's not expressive enough compared to a decision matrix where you can put weights |
19:15:47 | disruptek | that sounds more like an app for sketching out the problem domains and weighting different points within. |
19:15:59 | federico3 | I wish there was one |
19:16:08 | disruptek | weighted mindmap. is that a thing? |
19:17:01 | disruptek | kialo is pretty cool, i wonder if that could be a good platform to use. |
19:18:17 | federico3 | https://rationalize.io/ is a poor attempt |
19:19:38 | disruptek | i think kialo is much better; it lets you both hash out and simplify, iteratively, with ownership, every pro/con of a decision. |
19:20:13 | federico3 | did it implement weighting and scoring? |
19:20:45 | disruptek | there's voting, which should be enough. |
19:22:05 | FromGitter | <mratsim> But assuming we vote and arrive at a decision, if we want to revisit a year later, is there a way to export that to a Gist or something? |
19:24:12 | * | sacredfrog quit (Ping timeout: 246 seconds) |
19:24:38 | disruptek | where would it go otherwise? |
19:26:04 | FromGitter | <mratsim> it would stay on a website that may or may not disappear in a year |
19:27:31 | disruptek | what would be an acceptable archival medium? |
19:28:28 | Mister_Magister | https://build.opensuse.org/request/show/702054 i'm helping :( |
19:28:30 | Mister_Magister | :)* |
19:29:13 | Mister_Magister | and i added nim to one more OS https://build.merproject.org/package/show/home:mister/nim |
19:29:32 | FromGitter | <alehander42> but how is this different to |
19:29:51 | FromGitter | <alehander42> having github issue voting and archiving it directly inplace so people can easily see the discussion |
19:30:12 | federico3 | disruptek: it's not enough |
19:30:30 | shashlick | what's preferred is the main RFC is updated based on comments and feedback further down |
19:30:39 | shashlick | so that the final requirement is clear from the first comment |
19:30:45 | * | arecaceae quit (Remote host closed the connection) |
19:30:55 | shashlick | strike out stuff that's obsoleted |
19:30:58 | disruptek | the way you condense and restate arguments polishes them until they are most accurate, most precise, most succinct. and, they weigh them against each other in a proper hierarchy. |
19:31:07 | * | natrys quit (Quit: natrys) |
19:31:08 | FromGitter | <alehander42> i feel like a discord-like chat with +/- might be cool |
19:31:12 | * | arecaceae joined #nim |
19:32:23 | disruptek | what's cool about this isn't archival, it's the idea that a rational for decisions is "live" and new or old people can find it, read it, understand the pros/cons, etc. |
19:32:26 | dom96 | shashlick, this is why I think some projects have RFC repos, someone writes a markdown document and creates a PR. Then people argue about its contents and make amendments until it's agreeable |
19:32:36 | dom96 | That way you at least know what the latest spec is at all times |
19:32:43 | dom96 | Updating the main text could work too |
19:33:17 | disruptek | those changes could simply be PRs against a set of docs. we have that now. |
19:33:24 | * | sacredfrog joined #nim |
19:34:45 | shashlick | or maybe use the wiki |
19:35:16 | FromGitter | <mratsim> RFCs repo with PR to track amendment sounds good |
19:35:31 | FromGitter | <mratsim> plus with PR everyone can comment the exact line |
19:36:26 | disruptek | and it associates the changes with the areas of the spec that they change, for easy reference. free github integration, too. |
19:37:28 | FromGitter | <arnetheduck> is it *really* a tooling issue? |
19:37:51 | disruptek | only if you want a way to programmatically document or define the spec. |
19:42:36 | * | kapilp quit (Quit: Connection closed for inactivity) |
19:43:06 | livcd | anyone atm working on a desktop app ? |
19:45:29 | FromGitter | <arnetheduck> here's one I did as a weekend hack: https://discuss.status.im/t/hello-stratus-toying-around-with-nimbus-and-qml/905 |
19:47:39 | * | sacredfrog quit (Ping timeout: 248 seconds) |
19:47:46 | livcd | nice |
19:51:18 | shashlick | @livcd - i'm working on a text editor - https://github.com/genotrance/feud |
19:53:04 | shashlick | Ok so what are the next steps - which repo do we use for this nimble RFC |
19:54:36 | clyybber | mratsim: do you mainly develop on os x ? |
19:57:35 | FromGitter | <mratsim> not anymore, linux mainly now |
19:57:42 | livcd | is there a torrent library ? |
19:58:02 | FromGitter | <mratsim> nim/RFCs? |
19:58:38 | clyybber | mratsim: Nice, was wondering because apparently nim does threadvar emulation on OS X and I thought that would bother you, seeing that you like HPC |
19:58:50 | livcd | i found some libtorrent wrapper hmm |
19:58:59 | FromGitter | <mratsim> I use OpenMP for multithreading |
19:59:03 | dom96 | livcd, write a torrent lib in Nim :D |
19:59:16 | livcd | dom96: if i would know how.. |
19:59:40 | dom96 | livcd, read the spec, look at other implementations, and do it :) |
19:59:46 | FromGitter | <mratsim> Also most of the multithreading in HPC space is stateless |
20:01:30 | FromGitter | <mratsim> I have a macro for the tricky cases when I need a state per thread: https://github.com/numforge/laser/blob/master/examples/ex05_tensor_parallel_reduction.nim#L25 |
20:02:20 | clyybber | ha, nice. laser is like a cave full of HPC treasures |
20:02:40 | clyybber | thank you for all your work. |
20:04:15 | FromGitter | <mratsim> not ready for prime yet :/ too much stuff to do and zero tests (though when I switch it should instantly profit from the tests in Arraymancer) |
20:22:00 | FromGitter | <zacharycarter> Was going to do some more work for work this evening, but I left my work laptop in the office and I can't remember the URLs to our slack or confluence, plus I don't know how to check mail remotely yet. |
20:22:06 | FromGitter | <zacharycarter> Guess I'm going to write some Nim instead :) |
20:28:26 | clyybber | how "unfortunate" :p |
20:30:01 | * | bars0 joined #nim |
20:30:24 | FromGitter | <zacharycarter> hehe |
20:31:06 | clyybber | wait, so {.global.} doesn't actually break scoping :) |
20:31:40 | clyybber | nice. |
20:35:54 | FromDiscord_ | <treeform> Is it possible to do some thing like this in nim: `var (projectId, datasetId, tableId) = destTable.split(".", 3)` |
20:37:01 | clyybber | what would the destTable be? A string? |
20:37:07 | FromDiscord_ | <treeform> yes |
20:37:18 | FromDiscord_ | <treeform> this is what I do now: ``` arr = destTable.split(".") |
20:37:18 | FromDiscord_ | <treeform> projectId = arr[0] |
20:37:18 | FromDiscord_ | <treeform> datasetId = arr[1] |
20:37:18 | FromDiscord_ | <treeform> tableId = arr[2]``` |
20:37:49 | narimiran | treeform tuple unpacking doesn't work for seqs |
20:37:53 | narimiran | but i have something for you |
20:38:04 | clyybber | you can do var (projectId, datasetId, tableId) = (arr[0], arr[1], arr[2]) |
20:38:10 | narimiran | https://github.com/technicallyagd/unpack |
20:38:42 | FromGitter | <dom96> GitHub package registry huh |
20:39:00 | FromDiscord_ | <treeform> unpack is neat will try it |
20:39:44 | narimiran | i've used it for some of my stuff and i really like it |
20:40:23 | FromGitter | <dom96> Sounds like a great thing to integrate nimble into |
20:46:12 | shashlick | [d2, e2] <-- someSeq should have been someSeq <-- [d2, e2] |
20:46:47 | narimiran | um, no |
20:47:07 | narimiran | it's unpack, not pack :P |
20:47:49 | shashlick | oh okay, nevermind |
20:48:01 | * | krux02 quit (Remote host closed the connection) |
20:49:33 | * | Trustable quit (Remote host closed the connection) |
20:50:41 | shashlick | i like it - seems stdlib worthy |
20:51:30 | FromGitter | <dom96> For those that probably have no idea what I'm talking about: |
20:51:46 | FromGitter | <dom96> https://github.com/features/package-registry |
20:55:18 | * | Vladar quit (Remote host closed the connection) |
20:58:31 | shashlick | sounds cool |
21:04:45 | FromDiscord_ | <kodkuce> @treeform you making some game, i wanted to use udp and shared memory , just thinked to w8 for this new runtime to be happyer , anyway did you fallow that gaffer of games thingy or just made pure from your head |
21:09:15 | * | abm quit (Ping timeout: 248 seconds) |
21:09:15 | * | Kaivo quit (Quit: WeeChat 2.4) |
21:09:18 | clyybber | dom96: Ugh, more dependency on github is not a good thing IMO |
21:09:44 | * | nsf joined #nim |
21:10:08 | * | djellemah joined #nim |
21:14:49 | * | kapilp joined #nim |
21:18:39 | FromGitter | <mratsim> Seems like Gitlab as something similar: https://docs.gitlab.com/ee/administration/packages.html |
21:19:10 | FromGitter | <mratsim> or not, doesn't seem as polished |
21:25:04 | * | jjido joined #nim |
21:27:07 | * | sacredfrog joined #nim |
21:31:33 | * | nsf quit (Quit: WeeChat 2.4) |
21:34:30 | * | sacredfrog quit (Ping timeout: 252 seconds) |
21:35:26 | * | Kaivo joined #nim |
21:38:17 | FromDiscord_ | <treeform> @kodkuce Yes I am making a game. I am using mostly of my own libraries. |
21:39:05 | FromDiscord_ | <treeform> I am using udp, but not shared memory. I don't know about gaffer. |
21:47:34 | shashlick | @narimiran - all 0.19.6 builds are ready if you didn't notice already |
21:55:08 | FromDiscord_ | <exelotl> does intset provide any guarantees about the iteration order? |
21:56:49 | FromGitter | <jrfondren> @exelotl it uses hashes, so I'd expect not |
21:57:48 | narimiran | shashlick: i did, thanks |
22:00:02 | * | solitudesf quit (Ping timeout: 245 seconds) |
22:00:04 | FromGitter | <mratsim> One day will have the BTrees Araq promised (and already wrote) and we can have efficent "SortedSet" and "SortedTable" |
22:04:52 | FromDiscord_ | <exelotl> wow using IntSet to store color palettes is super efficient it seems :) |
22:05:02 | shashlick | i'm testing the armv7a build for nightlies since someone was interested |
22:05:14 | * | cgfuh quit (Quit: WeeChat 2.3) |
22:11:03 | shashlick | Looks like armv7a works just as well - will add to nightlies soon |
22:11:10 | clyybber | mratsim: AFAIK so far the BTrees arent faster (yet?) |
22:11:18 | clyybber | than a normal hashSet |
22:11:28 | FromGitter | <mratsim> but they are much more efficient to keep sorted |
22:12:15 | clyybber | ah, right. you were talkin about SortedSet sorry :p |
22:12:26 | * | rnrwashere joined #nim |
22:19:39 | * | djellemah quit (Ping timeout: 248 seconds) |
22:21:57 | * | abm joined #nim |
22:22:27 | * | sz0 quit (Quit: Connection closed for inactivity) |
22:23:35 | * | narimiran quit (Ping timeout: 258 seconds) |
22:26:16 | * | PrimHelios quit (Max SendQ exceeded) |
22:26:36 | * | PrimHelios joined #nim |
22:34:37 | * | rnrwashere quit (Remote host closed the connection) |
22:42:32 | * | rnrwashere joined #nim |
22:58:20 | * | cyberjpn joined #nim |
23:02:26 | * | rnrwashere quit (Remote host closed the connection) |
23:27:32 | clyybber | good night |
23:27:34 | * | clyybber quit (Quit: WeeChat 2.4) |
23:55:25 | FromGitter | <zacharycarter> treeform: do you have any screenshots? |
23:59:09 | * | djellemah joined #nim |