<< 22-12-2022 >>

00:05:52FromDiscord<Elegantbeef> Afaik nimble can work with local repositories so when you download Nim you could also download the most recent nimble packages for those and then bring them with your own distribution of nim
00:10:26*Guest98 joined #nim
00:13:54*Guest98 quit (Client Quit)
00:24:22FromDiscord<elcritch> You can also set the nimble path, and then add it to the repo. Probably not ideal, but it works.
00:27:54*rlitp joined #nim
00:46:13*om3ga quit (Quit: Bye)
00:46:25*om3ga joined #nim
01:02:39*blackbeard420 joined #nim
01:02:58*byanka joined #nim
01:03:29*byanka_ joined #nim
01:04:34*byanka_ quit (Client Quit)
01:06:26FromDiscord<nqeron> I have a sequence with a custom type, and it doesn't seem to let me use add on it - is there a way I can implement this?
01:06:46FromDiscord<Elegantbeef> Declare your seq as a var
01:06:52FromDiscord<jtv> Any pointers to help me figure out how to debug, when using concepts, the obtuse error: "cannot instantiate: 'somefunc[seq[int]]'"?? There is NO diagnostic info other than that.
01:07:12FromDiscord<Elegantbeef> Best diagnostic is a proc that takes the type
01:07:12*blackbeard420 quit (Client Quit)
01:08:55FromDiscord<jtv> I don't understand that, can you explain to me specifically? Write a different concrete function for the type being instantiated? Because there's definitely a match for the generic function
01:09:31FromDiscord<Elegantbeef> Yes make a procedure that takes the concept
01:09:42*blackbeard420 joined #nim
01:14:07FromDiscord<jtv> That helped, though it doesn't help me figure out how to lazily generate types to decompose types 🙂
01:18:34FromDiscord<jtv> In the simplest form, I'm trying to statically serialize seqs that may be arbitrarily nested, but will only contain primitive types, where the full type of such seqs is known at compile time. But if I try to add a 'type' assignment to the concept that will ACTUALLY let me access the item type more than one layer deep. Some ways I've tried it works the one layer, everything else just blows up.
01:20:23FromDiscord<jtv> I feel like I've been fighting this forever, I'm about to give up and carry run-time type info with me :/
01:28:46FromDiscord<Elegantbeef> What's your present concept/usage?
01:35:15FromDiscord<jtv> sent a long message, see http://ix.io/4jeN
01:38:36FromDiscord<Elegantbeef> What makes up a boxable item?
01:38:47FromDiscord<Elegantbeef> It's a sequence or string or value type?
01:39:33FromDiscord<jtv> For the moment, just sequences of int64, float64, string
01:39:43FromDiscord<jtv> Or other sequences of those things
01:40:51FromDiscord<jtv> Though the language does have dictionaries as well, I'm just trying to get something static working w/o that additional pain
01:41:06FromDiscord<jtv> So my box type for the moment is simply:
01:41:16FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4jeO
01:43:34FromDiscord<jtv> Trying to basically define a Boxable concept that will accept just those primitive types based on having a pack(x) -> Box and an unpack(Box, var x), but then since I statically know the whole src or dst type I want to be able to essentially have, say, an unpack() that, if the object is a nested list, removes all the layers of boxing
01:45:35FromDiscord<jtv> Or, if I know I've got an array of array of strings, that I want to box, would want to essentially recursively box each layer. Part of the reason for all this is that the language DOES allow one case where I might have to stop at a special "mixed" list, where the type checking DOES go dynamic.
01:48:42FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4jeP does this help any?
01:51:16FromDiscord<jtv> Probably, will play around with it, thanks very much. Took me a minute to confirm, I had to reload the link it was showing me something else that was some React related code
01:52:17FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4jeQ to expand it a bit further
01:55:00FromDiscord<Elegantbeef> Using procedures like that ime is a fantastic way of introspecting types
01:58:56FromDiscord<jtv> Okay, thanks. This is definitely helpful. I am going to try to figure out why what I was doing was problematic, I feel like if I can figure that out, I might be up for writing some documentation to better elucidate. I have found the little docs there are on concepts don't even show instantiation, so some of the basics are not too obvious
01:59:25FromDiscord<Bung> am trying to update my project to devel, try to fix the warning `Warning: catch a more precise Exception deriving from CatchableError or Defect` , however when I change one Exception to CatchableError , shows `close(currentDisposition(parser).file) can raise an unlisted exception: Exception`
02:00:08FromDiscord<Elegantbeef> Well remember concepts are not really instantiated they're just type classes
02:00:38FromDiscord<Elegantbeef> It's a constraint that instantiates it for the given type that passes
02:01:48FromDiscord<jtv> Sure, but the aliases I was making within the class would be available from within the generic functions I was writing where it was a parameter
02:04:18FromDiscord<jtv> But I get why it was going to put the type solver into an infinite loop if it's not doing lazy evaluation. At some point, I will reconstruct what I was trying that failed to explain better, but right now I'm marching forward with this, so thank you
02:05:20FromDiscord<Elegantbeef> No problem
02:09:03*yolo joined #nim
02:09:52yolonew to nim, does nim always convert to some other language(e.g. c) first then it invokes that compiler(e.g. gcc) to build the final binary?
02:10:08FromDiscord<Elegantbeef> Yes
02:10:49yolois there a default language(e.g. c, or c++)?
02:11:22FromDiscord<Elegantbeef> It targets C by default
02:11:27yoloread the 2.0 rc1 news and plan to learn nim in the holiday break and see how far I can go
02:11:35FromDiscord<Elegantbeef> It also has a C++ backend
02:11:40yoloThanks! first step is nim-by-example for me
02:11:42FromDiscord<Elegantbeef> And a JS backend
02:12:05yoloit looks like python, i thought it has a python backend...
02:12:14FromDiscord<Elegantbeef> Nope
02:12:27FromDiscord<Elegantbeef> Aside from passing similarities it's unrelated to python
02:12:36FromDiscord<Elegantbeef> There is an ecosystem to support python
02:12:49FromDiscord<Elegantbeef> https://github.com/yglukhov/nimpy exists
02:15:24yolothanks!
02:16:05yoloit seems easier than rust, maturer than zig, safer than c/c++, it should take off like a rocket years ago
02:16:37yolobut, i need write 50 small programs to tell if the above is true, wait and see
02:17:03FromDiscord<Elegantbeef> I'd say all of that is true
02:17:30FromDiscord<Elegantbeef> Though you can easily make it as safe as C/C++ so maybe it's not 😄
02:17:36FromDiscord<Elegantbeef> There is no unsafe keyword here
02:18:01yolowhat's the discord link, though I use irc more often
02:18:16yoloi will google it. thanks
02:18:35FromDiscord<Elegantbeef> Uhh i dont have the discord link, i'm actually on matrix
02:19:04yoloirc says "FromDiscord <Elegantbeef>"
02:19:08yolointeresting
02:19:25FromDiscord<Elegantbeef> Yea it goes Matrix -\> discord -\> irc
02:19:32FromDiscord<Elegantbeef> It's nothing but bridges
02:19:41yoloi c
02:19:44FromDiscord<Rika> Me about to burn the matrix bridge
02:24:46*Figworm joined #nim
02:25:25FromDiscord<Elegantbeef> Matrix bridge is burning down, burning down
02:26:29FromDiscord<Rika> I don’t even need to do anything for it to burn down :baqua:
02:26:51FromDiscord<Elegantbeef> Eh t2bot runs an old version of the brdige
02:26:53FromDiscord<Elegantbeef> bridge even
02:26:58FromDiscord<Elegantbeef> Probably better upstream
02:46:53yolook so nim can export the same code base to c|c++|js, the goal is "one (expressive) code base for 3 languages"? what's the major selling point
02:49:52FromDiscord<Elegantbeef> You can write front end and backend in a single language with a shared code base is the point of js atleast
02:50:11FromDiscord<Elegantbeef> The reason it emits C/C++ is for interop and it's more portable than LLVM
02:51:11FromDiscord<answer> oh so i was wondering about this the other day, because i'm trying to do js interop with a library that exports a certain AST.↔the thing that sucks about it though is like... it has 4 potential values, `undefined`, a string value, an array, or an object describing some structure↔so i was wondering like... how can i properly detect the types in nim, and if there's anything special i need to do for undefined
02:51:19*Guest34 joined #nim
02:51:24FromDiscord<answer> (edit) "values," => "values:"
02:51:32FromDiscord<answer> (edit) "oh so i was wondering about this the other day, because i'm trying to do js interop with a library that exports a certain AST.↔the thing that sucks about it though is like... it has 4 potential values: `undefined`, a string value, an array, or an object describing some structure↔so i was wondering like... how can i properly detect the types in nim, and if there's anything special i need to do for undefined ... " added "or i
02:52:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jeZ
02:53:15FromDiscord<Elegantbeef> https://nim-lang.org/docs/jsffi.html has some helper methods for this
02:53:21*Guest34 quit (Client Quit)
02:53:27yolois zig similar, in that it emits to c|c++|etc first? did not look into it
02:53:36FromDiscord<Elegantbeef> Nope
02:53:38FromDiscord<Elegantbeef> Zig targets the llvm
02:54:05FromDiscord<answer> ah nice, i should've looked closer at that, thanks
03:07:21FromDiscord<darth> In reply to @yolo "it seems easier than": i like this comparison, tho I'm not sure about zig even after it matures, it feels so unfun to write - nim feels a bit like ... idk, I'm still huge noob to tell properly, but "as productive as rust, maybe more?" ... maybe it's cuz I've spent too much time in rust, but these days I feel I write rust faster than python lol
03:08:16FromDiscord<Rika> It’s really a subjective thing
03:08:45FromDiscord<Rika> I cannot stomach Rust, I’m somewhat repulsed by Zig, Nim is pretty good, etc
03:08:47FromDiscord<darth> I'm curious if anyone noticed this too, or how they feel about switching to nim fully ... rust feels like it should be slow but it's so fast for certain things with the stdlib/itertools and stuff just kinda flows, unlike in some other languages :<
03:09:04FromDiscord<darth> haha "repulsed by zig" is how I feel too about their allocators lol
03:09:14FromDiscord<darth> or even just "how to print to stdout"
03:09:33FromDiscord<Rika> It’s likely that I should give it more time but eh
03:09:40FromDiscord<Rika> Hard sell
03:09:58FromDiscord<darth> I wish rust didn't have such a good/fast LSP, makes it harder to compare to languages with worse tooling :< ... like in some ways I feel the tooling is carrying my productivity, not the language
03:10:13FromDiscord<Rika> That’s because it pretty much is I guess
03:10:33FromDiscord<Rika> For me I’m a bit of a masochist who can program with no extra tooling at all aside from the compiler of course
03:10:44FromDiscord<Rika> No plugin no problem
03:10:46FromDiscord<darth> hehe that would explain why you can't stomach rust
03:10:54FromDiscord<Rika> True
03:10:56FromDiscord<darth> I used to write python like that years ago, but python was fine for it
03:10:56FromDiscord<Rika> Could be
03:11:18FromDiscord<Rika> If it’s annoying to program in it with my keyboard alone then yeah
03:11:47FromDiscord<darth> do you find nim the most productive overall in that setting? or just most useful overall
03:12:28FromDiscord<Rika> One of the more productive languages because there isn’t much you need to keep on writing just to get something working
03:12:37FromDiscord<Rika> I guess that’s called boilerplate
03:13:07FromDiscord<darth> yeah :< i keep hopping between stuff and every time I hop back to rust because "it works" but then I'm mad at all the bullshit it requires me to do
03:13:22FromDiscord<darth> and then i get mad at other languages for not being productive in them even without the rust bullshit lol
04:13:55*yolo left #nim (#nim)
04:16:58FromDiscord<nqeron> current issue: I have a object with generic type that has a sub object (array) with the same generic type , but when I try to reference something like `type.sub[0][1]` it tries to break it down into just type.sub and 0, rather than getting sub and applying [0][1]
04:17:30FromDiscord<Elegantbeef> `typeof(sub[0][1])`?
04:19:43FromDiscord<Elegantbeef> Concrete code is better than wordy sentences
04:20:20FromDiscord<nqeron> I believe typeof(sub[0][1]) == Tile
04:21:04FromDiscord<nqeron> oh - I see what I triggered in the bot
04:21:28FromDiscord<Elegantbeef> I'm not a bot
04:21:36FromDiscord<huantian> that's what a bot would say
04:21:50FromDiscord<nqeron> given the bot tag
04:21:55FromDiscord<Elegantbeef> huantian more like tuantan
04:22:29FromDiscord<Elegantbeef> Yes I use matrix
04:23:07FromDiscord<Elegantbeef> Provide the code that causes the issue or the compiler error
04:23:11FromDiscord<Elegantbeef> It makes life much easier
04:23:51FromDiscord<nqeron> `result = game.board[square.column][square.row]`
04:24:21FromDiscord<nqeron> more specifically, `proc `[]`(game: var Game, square: Square): Tile =↔ result = game.board[square.column][square.row]`
04:24:43FromDiscord<Elegantbeef> Do you mean to return `var Tile`?
04:25:12FromDiscord<nqeron> I'm not sure if it needs to be var
04:25:28FromDiscord<Elegantbeef> Well what's the actual issue?
04:26:35FromDiscord<nqeron> this might help: https://play.nim-lang.org/#ix=4jf9
04:26:36FromDiscord<Elegantbeef> `a.fieldAcces[0][1]` does `[]([](a.fieldAccess, 0), 1)`
04:27:08FromDiscord<nqeron> hmm...
04:27:52FromDiscord<Elegantbeef> `Board[N: static uint8]`
04:32:32FromDiscord<huantian> to elaborate, `Board[N: uint8]` means `N` is always the type `uint8`
04:32:58FromDiscord<huantian> if you do `Board[N: static uint8]`, that means `N` is an instance of `uint8` known at compile time
04:43:58FromDiscord<nqeron> bit of fiddling, but that seems to have helped - thanks!
04:57:43FromDiscord<nqeron> last question before I go to bed - I'm working in VSCode on windows and I keep getting frustrating interactions with the autocomplete. What's the recommended extension to use for Nim?
04:58:00FromDiscord<huantian> the nim extension by saem
04:58:16FromDiscord<huantian> though unfortunately, nim tooling is still quite imprefect
05:00:05NimEventerNew post on r/nim by shassard: Nim 2.0 release candidate is available, see https://reddit.com/r/nim/comments/zscs8w/nim_20_release_candidate_is_available/
05:04:02NimEventerNew Nimble package! htest - Simple library to make tests on html string using css query selectors, see https://github.com/Yandall/HTest/
05:54:01FromDiscord<Bung> what's the syntax inject untyped argument to proc name in template ?
05:55:23FromDiscord<Elegantbeef> It's just stropping both with a space
05:55:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jfe
05:56:14FromDiscord<huantian> meh proc
05:56:16FromDiscord<huantian> it's on fire
05:56:48FromDiscord<Bung> oh , i see, I was trying `proc a`p\`\`
05:56:49FromDiscord<ShalokShalom> In reply to @huantian "though unfortunately, nim tooling": Do you already know this: https://discord.com/channels/371759389889003530/371759389889003532/1054117863125958716
05:57:59FromDiscord<huantian> I dsaw it rq but idk what my current settings are
05:58:11FromDiscord<huantian> I think it's just broken rn and I'm not getting any suggestions or errors at all
05:58:16FromDiscord<huantian> but I'm too lazy to fix that
05:58:30FromDiscord<ShalokShalom> I considered testing this
05:58:39FromDiscord<ShalokShalom> And if it works, I would send a pull
05:58:49FromDiscord<ShalokShalom> Might fix it for everyone.
05:59:02FromDiscord<ShalokShalom> You could be a hero 😄
06:00:10FromDiscord<Elegantbeef> All it does is provide errors in that case
06:25:18*LuxuryMode quit (Quit: Connection closed for inactivity)
06:40:41*madprops quit (Remote host closed the connection)
06:41:58*madprops joined #nim
06:41:58*madprops quit (Changing host)
06:41:58*madprops joined #nim
07:27:17FromDiscord<ShalokShalom> You mean for you?
07:27:30FromDiscord<ShalokShalom> It seems to work for this person?
07:29:38*ltriant quit (Ping timeout: 272 seconds)
07:29:59FromDiscord<HitBlast> I've just reset my Mac and am attempting to install choosenim using the provided shell command. However, it says bad CPU architecture in the error prompt while trying to run the commane. Thoughts? https://media.discordapp.net/attachments/371759389889003532/1055386704661458944/Screenshot_2022-12-22_at_1.28.56_PM.png
07:30:03FromDiscord<HitBlast> (edit) "commane." => "command."
07:30:57FromDiscord<ShalokShalom> Is it a M1 or M2?
07:32:58FromDiscord<ShalokShalom> If yes, Araq has one to double check↔https://github.com/nim-lang/Nim/pull/18772
07:34:09FromDiscord<huantian> Iirc choosenim itself doesn’t have apple silicon support
07:34:26FromDiscord<Elegantbeef> That's correct afaik
07:44:11FromDiscord<HitBlast> In reply to @ShalokShalom "Is it a M1": It's an M1
07:44:15NimEventerNew thread by Araq: Atlas -- the package cloner, see https://forum.nim-lang.org/t/9748
07:45:23FromDiscord<amadan> https://github.com/asdf-community/asdf-nim↔Have used that for managing Nim on a rasp pi, not too sure how well it works with macs
08:00:36FromDiscord<Phil> In reply to @NimEventer "New Nimble package! htest": @Yandall Congratz about the initial release!↔Happy you made it!
08:01:12FromDiscord<Phil> Now to start implementing testing in snorlogue with this because I really ignored frontend testing precisely because HTML testing was inconvenient
08:02:25FromDiscord<Slava0135> In reply to @darth "I wish rust didn't": rust also have nicest error messages
08:04:30FromDiscord<Phil> In reply to @darth "I'm curious if anyone": I never got the impression Rust was particularly slow in anything, I just find my eyes glazing over at how the syntax looks not as pretty as I like
08:04:53FromDiscord<Phil> So if I can have nicer syntax with similar performance if I so choose to have it, I'm sold
08:05:02FromDiscord<Slava0135> and in my experience Nim error messages are lacking. Try to mutate `let` variable and it won't tell you you should use `var`
08:05:29FromDiscord<Phil> In reply to @Elegantbeef "I'm not a bot": That's what a chatgpt bot would say... the fact this can be a legit answer now is scary
08:07:20FromDiscord<Phil> Argh, caught myself again, the rust discussion is more appropriate for offtopic as it's less about nim syntax
08:11:34FromDiscord<ShalokShalom> In reply to @Slava0135 "and in my experience": Nimskull improved on that
08:45:13*PMunch joined #nim
09:22:34FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jfN
09:26:13FromDiscord<kaddkaka> This is the error message for `t`:↔`Error: type mismatch: got '(proc (a: int): int{.noSideEffect, gcsafe, locks: 0.},)' fo↔r '(op,)' but expected 'S = tuple[operation: proc (i0: int): int{.closure.}]'`↔so the type/proc signature seems perhaps more strict for tuples? I feel dumb 😒
09:32:47FromDiscord<Bung> they mismatched at call converstation one is nimcall another is closure
09:38:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jfP
09:39:18FromDiscord<Phil> sent a code paste, see https://paste.rs/Iqa
09:39:31FromDiscord<Phil> I definitely do not use tuples enough it seems, may have screwed up the assignment code on my end
09:39:40*fallback quit (Ping timeout: 260 seconds)
09:40:22FromDiscord<ringabout> In reply to @Isofruit "I definitely do not": You need a comma to complete the tuple
09:40:33FromDiscord<ringabout> Try `(op,)` instead
09:40:46FromDiscord<Phil> Huh, yeah, fair play
09:40:48FromDiscord<Phil> Keep forgetting that
09:41:15FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jfQ
09:41:29FromDiscord<Phil> You need to turn your proc into a closure
09:41:35FromDiscord<Phil> You can use the closure pragma for that
09:42:20FromDiscord<Phil> You don't strictly speaking need the assignment to `procTuple` , that was just me trying things out and writing my code in smaller steps as per my preference
09:45:05FromDiscord<Phil> Out of curiosity, what is the usecases for tuples for you guys?
09:49:05FromDiscord<kaddkaka> In reply to @Bung "they mismatched at call": In my case it was grouping data (and procs)
09:49:22FromDiscord<kaddkaka> In reply to @Isofruit "Out of curiosity, what": In my case it was grouping data (and procs)
09:50:43FromDiscord<Phil> In reply to @kaddkaka "In my case it": Given what I've seen from you your style is more functional, correct?↔Disclaimer: I have no proper functional knowledge, thus my questions.↔Does functional programming in general use tuples to do this kind of thing? Because that sounds like OOP to me (grouping data with methods acting on the data)
09:50:55FromDiscord<kaddkaka> complicated stuff, I dont see the reason why the closure specification is needed just because I put it inside a tuple, But I also dont know any details about Nim.
09:52:17FromDiscord<kaddkaka> That might be my problem, I'm not doina either style full out. Instead I make strange mix 😆
09:52:24FromDiscord<kaddkaka> (edit) "doina" => "doing"
09:55:55FromDiscord<Phil> Ahhh check. I'm never passing up an opportunity to learn if I can find the time đŸ˜›â†”As for this, chances are that because it's in a tuple and that tuple can go anywhere, that nim demands that the proc be self-contained. IIRC the normal calling conventions do not apply to this.↔But I haven't developed much deeper knowledge into that, I typically just write procs that generate procs and that's it
09:57:16FromDiscord<kaddkaka> This particular questiong was spawned by AoC day11
09:57:20FromDiscord<kaddkaka> (edit) "questiong" => "question"
10:11:44FromDiscord<Elegantbeef> Phil is wrong @kaddkaka you dont need to use closure inside of a type
10:11:56FromDiscord<Phil> You don't?
10:11:58FromDiscord<Elegantbeef> The issue is that proc types by default are closures so you need to specify that it's a nimcall
10:12:01FromDiscord<Elegantbeef> You do not
10:12:30FromDiscord<Elegantbeef> Works just fine
10:12:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jfT
10:12:37FromDiscord<kaddkaka> I was thinking that it implicitly has a closure because it's using a local variable (but perhaps that not the case either).
10:12:45FromDiscord<kaddkaka> Hmm, so I better read up on nimcall perhaps
10:14:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jfU
10:14:35*attah quit (Ping timeout: 246 seconds)
10:15:03FromDiscord<kaddkaka> (Minor issue with nim manual is that the search box doesn't find things like `nimcall`)↔So, if nimcall is the default calling convention, why do I need to explicitly specify it?
10:15:05FromDiscord<Elegantbeef> In this case you do need a closure as you have an environment you want
10:15:05FromDiscord<Elegantbeef> but you will need to use `capture i` to make it work as you want
10:15:05FromDiscord<Elegantbeef> sugar has a `capture` macro for this case
10:15:07*attah joined #nim
10:15:26FromDiscord<Elegantbeef> Nim is the default call convention on procedures not on types
10:15:29FromDiscord<Elegantbeef> On types `closure` is
10:15:47FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4jfW
10:15:55FromDiscord<Elegantbeef> An example of how capture helps
10:17:56FromDiscord<kaddkaka> I see ... the manual also states "This is needed because Nim's default calling convention for procedures is fastcall to improve speed."↔So .. is fastcall the default calling convention as well? In som cases?
10:18:29FromDiscord<Elegantbeef> It's Nimcall but nimcall is an alias to fastcall where it's valid
10:19:27FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Ugo
10:19:33FromDiscord<Elegantbeef> Works just fine minus the fact `op` isnt capturing as one expects
10:20:44FromDiscord<Elegantbeef> Unrelated but this is down a bad path for a solution to day11 😄
10:20:56FromDiscord<kaddkaka> so the type works out, but `i` will be using the global `i` without creating separate closures?
10:21:26FromDiscord<Elegantbeef> Without capture each instance gets the same variable
10:21:35FromDiscord<Elegantbeef> So when you call it at the end of the iteration they're all the same
10:21:49FromDiscord<Elegantbeef> You very much do want a closure for your code, but i was just correcting phil
10:21:57FromDiscord<Elegantbeef> You can have pointer procs without nimcall
10:22:02FromDiscord<Elegantbeef> Or with nimcall rather
10:22:28FromDiscord<Elegantbeef> You can even have a pointer proc that is a cdecl or any other calling convention aside from `inline`
10:22:42FromDiscord<Elegantbeef> Actually dont know about inline, i imagine you cannot
10:23:00FromDiscord<kaddkaka> inline is not that special though, right?
10:23:05FromDiscord<Elegantbeef> Ah you can
10:23:08FromDiscord<Elegantbeef> Just defeats the inline part
10:23:18FromDiscord<kaddkaka> are you sure?
10:23:24FromDiscord<kaddkaka> I mean inline never gives any guarantees
10:24:13FromDiscord<Elegantbeef> I just tested, so yes
10:24:17FromDiscord<Elegantbeef> Sure but adding that calling convention to a pointer proc is like wearing socks ontop of your shoes
10:25:25FromDiscord<Elegantbeef> Though if i ever get my PR functioning we'll have anyConvention -\> {Nimcall, Closure}
10:26:40FromDiscord<Phil> In reply to @Elegantbeef "Sure but adding that": That's a beautiful analogy
10:26:56FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/SbK
10:27:01FromDiscord<Elegantbeef> But since your loop was global it was valid
10:29:02FromDiscord<Elegantbeef> And making it a named proc also probably instantiates it once, but i dont know i never tested that
10:30:17FromDiscord<Elegantbeef> Thanks i thought long and hard↔(@Phil)
10:30:40FromDiscord<Elegantbeef> Then i looked down and seen my socks were dirty and my shoes clean
10:31:46FromDiscord<Elegantbeef> No i dont wear shoes inside, i'm not a fucking gremlin
10:31:49FromDiscord<Bung> is there force cast without check ?
10:31:58FromDiscord<Elegantbeef> copyMem is closest you get
10:32:35FromDiscord<Bung> hmm, I only want pass type check
10:33:05FromDiscord<Elegantbeef> Well you can do `cast[ptr T](mydata.addr)[]`
10:33:11FromDiscord<Elegantbeef> But there be dragons with aliasing rules
10:34:25FromDiscord<Bung> oh, that works
10:34:51FromDiscord<Elegantbeef> And with that i'm off
10:37:03FromDiscord<Bung> well, still seems cast doesn't work in compiler proc
10:37:22FromDiscord<Bung> get nil access error
10:39:42FromDiscord<kaddkaka> I guess `{.closure.}` doesn't automatically capture variables, gotta try out the `capture` sugar
10:42:59FromDiscord<kaddkaka> Props for capture 👍 easy to understand and use
10:44:54*attah quit (Ping timeout: 268 seconds)
10:45:49*attah joined #nim
10:55:24*oddish joined #nim
11:12:05FromDiscord<arkanoid> Lol
11:19:42PMunchIs there really no way to push a custom pragma?
11:20:11PMunchI tried to just push the macro, didn't work, tried to use {.pragma.} to define a pragma proper, didn't work
11:20:41PMunchI was just trying to replace every instance of `echo` in a file with my own custom version of echo..
11:22:49PMunchHmm, I guess maybe patchFile would work..
11:35:38NimEventerNew thread by domogled: Ormin example chat - websocket failed, see https://forum.nim-lang.org/t/9749
11:44:07*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
12:17:27FromDiscord<blaze_arch> hi everyone \:3
12:22:01FromDiscord<Phil> Cheers
12:25:10FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jgq
12:27:18FromDiscord<Phil> In reply to @kaddkaka "I'm not sure if": You mean why must it be Table[int, int]?
12:27:36FromDiscord<Phil> Ohhh no, why toTable needs the addition of a type
12:31:39*ltriant joined #nim
12:32:09FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jgs
12:32:35FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=4jgt
12:33:17FromDiscord<kaddkaka> (disregard the tuple syntax in the 2 latter examples)
12:33:30FromDiscord<Phil> To me this makes sense because in my head the 2 statements (1: Instantiating the table, 2: Instantiating the tuple with the table) happen separately one after another.
12:33:47FromDiscord<albassort> does
12:34:17FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4jgu
12:34:38FromDiscord<albassort> idk why you'd do this tbh
12:34:44FromDiscord<kaddkaka> @albassort yes
12:35:08FromDiscord<Phil> It first creates the table with `toTable[int, int]({:})`, to do so it needs to know the type, but within its own statement it can't find the type information it needs to do so. The information is outside.
12:35:19FromDiscord<Phil> In reply to @kaddkaka "<@217459674700578816> yes": You using nim 1.6? Because it does not on nim devel
12:35:26FromDiscord<kaddkaka> @albassort assigning a table?
12:35:28FromDiscord<Phil> (which is future nim 2.0)
12:35:36FromDiscord<albassort> your mom is future nim 20.0
12:35:40FromDiscord<albassort> (edit) "20.0" => "2.0"
12:35:44FromDiscord<kaddkaka> I use `1.6.6`
12:35:51FromDiscord<albassort> which is stable
12:36:06FromDiscord<Phil> Let me see in 1.6.6, sec
12:36:12FromDiscord<albassort> phil how can i downgrade from 1.9.4 to 1.7.7
12:36:19FromDiscord<albassort> 1.9.4 is pretty buggy
12:36:26FromDiscord<Phil> .... choosenim 1.7.7?
12:36:30FromDiscord<albassort> damn
12:36:32FromDiscord<albassort> that simple huh
12:36:39FromDiscord<Phil> I assume, I never tried
12:36:52FromDiscord<Phil> I typically only jump between devel and stable releasess
12:36:59FromDiscord<Phil> Never tried to jump to a particular unstable release
12:37:22FromDiscord<albassort> orc has some bugs in stable which i need fixed
12:37:49FromDiscord<Phil> Okay, now I am massively confused
12:38:00FromDiscord<kaddkaka> In reply to @Isofruit "You using nim 1.6?": do you think it should, or should not work?
12:38:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jgv
12:39:20FromDiscord<Phil> In reply to @kaddkaka "do you think it": From what I'm seeing, it shouldn't work and always require the type information in the `toTable` call because as far as I'm aware that proc is not that great at looking "outside" of itself for type information
12:40:19FromDiscord<kaddkaka> wth now it doesn't work me either ...
12:40:48FromDiscord<Phil> You might have just had weird compiler-cache problems
12:40:50FromDiscord<kaddkaka> I must have been blind or done something else..
12:40:54FromDiscord<Phil> Meaning it never should've worked
12:40:58FromDiscord<kaddkaka> probably just blind 👍
12:41:08FromDiscord<Phil> Brain-cache-problems then 😛
12:41:31FromDiscord<kaddkaka> yes 😛
12:56:25FromDiscord<albassort> @Phil i'll pay you $5 to do a pre-release code review
12:56:42FromDiscord<Phil> No you won't, but I'll skim over it anyway 😛
12:56:55FromDiscord<albassort> if you lived near me I'd buy you a coffee
12:57:14FromDiscord<Phil> Convenient for you that I don't 😛
12:57:27FromDiscord<albassort> do i give the impression that im cheap?
12:57:33FromDiscord<albassort> because that'd be correct
12:59:33FromDiscord<Phil> Cheap vibes transferring over the internet đŸ˜›â†”Anyway, what am I supposed to skim through?
12:59:54*kenran joined #nim
13:00:35*kenran quit (Remote host closed the connection)
13:03:04FromDiscord<albassort> like 2000 lines of code
13:04:38FromDiscord<Phil> Yeah skim is definitely the right word
13:38:06PMunchIs there an easy interpolation library in Nim?
13:38:22PMunchI have data at DateTime points and want to interpolate it
13:51:43FromDiscord<ajusa> Nearly done porting over a tiny language interpreter I wrote in Lua a few years back:↔Lua version is 116 lines and Nim version is at 135. Not bad at all since 30 of the lines in the Nim version are just type definitions, which Lua doesn't have.
13:52:48FromDiscord<ezquerra> In reply to @PMunch "Is there an easy": Maybe ask in #science? Worst case you could use nimFFT to do an FFT / zero padding / IFFT / scaling

13:57:39FromDiscord<vindaar> pmunch\: `numericalnim` has multiple interpolation routines
13:58:51PMunchHmm, they're so complicated to use though..
13:59:11FromDiscord<Vindaar> huh?
13:59:21PMunchI just wanted something like `interpolate(myTimestamps, myData, point)`
14:02:52FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jgQ
14:05:06FromDiscord<Rika> Looks complicated to just set up yeah
14:06:12FromDiscord<vindaar> a single `newCubicSpline` line is complicated now?
14:07:06PMunchWhat's a df? linspace?
14:07:22PMunchAnd how can I get a specific value?
14:07:39FromDiscord<vindaar> the whole fluff around is just to show that it's actually working and plotting it for you to see (if you want).
14:07:46FromDiscord<vindaar> `df` = DataFrame
14:08:01FromDiscord<vindaar> `linspace` = takes beginning, end, number of points and creates a linear grid
14:08:20FromDiscord<vindaar> getting a specific value\: in that `mapIt` call the `interp.eval`
14:08:36FromDiscord<Rika> In reply to @vindaar "a single `newCubicSpline` line": If that’s all that’s needed if there’s already data then okay, sounds fine
14:08:56FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jgS
14:09:18FromDiscord<Rika> Sounds good
14:09:21PMunchRight.. So linspace creates the points to sample, and interp.eval does the actual interpolation. The df is just for plotting?
14:09:40FromDiscord<vindaar> yeah
14:09:43PMunchRight, yeah that's actually pretty simple
14:09:45FromDiscord<luteva> Hi! Is there something like lunatic in nim?↔https://github.com/lunatic-solutions/lunatic↔so an erlang inspired environment with "micro" processes and a supervision tree, eassy intra- and interprocess communication (e.g. channel based)...
14:10:12FromDiscord<hugogranstrom> sent a code paste, see https://paste.rs/Okl
14:10:32FromDiscord<hugogranstrom> (edit) "https://play.nim-lang.org/#ix=4jgU" => "https://play.nim-lang.org/#ix=4jgT"
14:12:31FromDiscord<Yandall> In reply to @Isofruit "<@376485432805949443> Congratz about": Thanks for the help
14:34:15PMunchHmm, @vindaar do you know of any good way to interpolate angles?
14:35:18FromDiscord<vindaar> can you expand on that?
14:35:37PMunchWell I'm working with windspeed, and it's given as speed and angle
14:36:09PMunchBasically I have a forecast with hour precision, and I want to be able to get forecast windspeed for arbitrary times
14:36:59FromDiscord<vindaar> do you have an excerpt of what your data looks like?
14:37:42FromDiscord<vindaar> is your problem that angles are modulo 360° or that interpolation shouldn't be linear in some sense?
14:38:14PMunchhttps://api.met.no/weatherapi/locationforecast/2.0/#!/data/get_compact
14:38:34PMunchThe problem is the modulo 360 thing
14:39:24PMunchYou can try with this coordinate if you want: 69.6899724,18.9276432 (random point in Norway)
14:40:33PMunchI grab the properties.timeseries[].time and properties.timeseries[].data.wind_from_direction and wind_speed
14:40:46PMunchThe timestamp is converted to a Unix timestamp
14:40:48*PMunch quit (Quit: Leaving)
14:45:20FromDiscord<vindaar> I'm not entirely sure, from the top of my head. I suppose it will depend a bit on which timescales you want to apply an interpoelation. Maybe you could do a preprocessing step in which you check whether you have a wrap \>360° -\> 0° or \<0° -\> 360° and in that case fix the angles by artificially correcting them (i.e. going over 360° or into negative). Then perform the interpolation and for the result revert the artificial extension?
14:52:36FromDiscord<ezquerra> Maybe you could consider the (speed, angle) pairs as polar coordinates. Then you could convert them to Cartesian coordinates, and treating them as complex numbers, interpolate on those and then go back to polar?
14:52:55FromDiscord<ezquerra> Also maybe this discussion belongs to the #science channel
15:10:38FromDiscord<vindaar> Hmm, having looked at the data my suggestion is very problematic given how sparse the data is. The jumps in the angles are huge sometimes O(\> 100°)
15:11:12FromDiscord<Phil> In reply to @Yandall "Thanks for the help": Any plans on what you want to do next?↔Still interested in github pipelines, writing another package or writing an application and wanting to play around with a package in that regard?
15:14:02FromDiscord<Yandall> Still interested in github pipelines but maybe not for this one just because is very small package
15:14:24FromDiscord<Yandall> I still want to learn more about nim writing another package
15:22:53FromDiscord<Phil> sent a long message, see http://ix.io/4jht
15:23:08FromDiscord<Phil> (edit) "http://ix.io/4jht" => "https://paste.rs/UMJ"
15:24:05FromDiscord<Phil> And for that one the #security channel would be a really good idea to frequent (can't say I look into that one)
15:25:57FromDiscord<Phil> Like, for reference, this is the only piece in terms of hashing I'm aware of and that I use myself (it replicates the default hashing algorithm from Django):↔https://stackoverflow.com/questions/70716906/how-do-i-re-build-djangos-password-hashing-in-nim
15:27:12FromDiscord<Phil> If that goes a bit too far it might make sense to write a small application first, maybe a CLI one
15:28:01FromDiscord<Phil> Or since you know webdev you could of course also do a small web-application, there I can help since I have somewhat of an overview over the packages nim has available
15:29:00FromDiscord<Yandall> Yeah, a small web application would give me a better understanding of nim
15:29:11FromDiscord<Yandall> For that I have some ideas
15:33:09FromDiscord<Phil> sent a long message, see https://paste.rs/Zyj
15:33:42FromDiscord<Phil> (edit) "http://ix.io/4jhw" => "http://ix.io/4jhv"
15:34:48FromDiscord<Phil> For ORM I'd recommend either norm or if you want absolutely no abstraction of SQL, use `std/db_sqlite` together with `nisane` to parse the values it returns to you into your own object-types.
15:35:18FromDiscord<Phil> (edit) "For ORM I'd recommend either norm ... or" added "(also comes with connection pooling nowadays, supports sqlite and postgres)"
15:35:27FromDiscord<Phil> (edit) "`std/db_sqlite`" => "`std/db_sqlite/db_postgres/db_mysql`"
15:36:02FromDiscord<Yandall> And there is a lib for mongo?
15:36:04FromDiscord<Phil> A package I generally recommmend taking a look at would be constructor, as it can save you a fair bit of typing if you want auto-generated constructor procs
15:36:18FromDiscord<Phil> There likely is, I just never used mongo with nim, but one sec
15:36:50FromDiscord<Phil> https://nimble.directory/search?query=mongo↔There's 4 + 1 specifically for jester
15:37:04FromDiscord<Phil> Though I'm not entirely sure what would be jester-specific there
15:37:08FromDiscord<Phil> đŸ€·â€â™‚ïž
15:38:29FromDiscord<Yandall> Well, I'll just see which one is better for my use case
15:38:46FromDiscord<Phil> If you want to just write a API that deals with JSON I recommend jsony, as it is faster than std/json (and imo easier to reason about and extend)
15:39:35FromDiscord<Phil> If you want to generate HTML, use nimja as it does a fair bit of stuff at compile-time (e.g. it pulls your HTML templates into the binary, meaning when you deploy the server you won't have to push an HTML folder around. Also means you need to recompile the project if you change a HTML file)
15:39:45FromDiscord<Phil> (edit) "If you want to generate ... HTML," added "and serve"
15:40:52FromDiscord<Phil> And other than that for bells and whistles you can use `zippy` to compress your response, typically reduces the size of the response by 50-80% for me (Those were JSON responses)
15:41:30FromDiscord<Phil> There isn't yet a package for Signals the same way Django signals work, but they aren't hard to implement so I can help there
15:42:10FromDiscord<Phil> But yeah, that's what I can provide in terms of knowledge so far.
15:43:20FromDiscord<Phil> (edit) "work," => "work (so procs that get triggered automatically when an entry is added/updated/deleted from a table/collection),"
15:43:26FromDiscord<Yandall> Thanks, you're awesome
15:43:47FromDiscord<Phil> Happy to help
15:44:27FromDiscord<Phil> I can't believe I've been shilling for Elegantbeef's constructor package for almost a year now
15:44:45FromDiscord<Phil> And I shall continue to do so as even nim 2.0 doesn't yet support distinct datetime types in default intialization 😛
15:45:00FromDiscord<ambient> how do you define .low and .high for a custom type?
15:45:24FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4jhE
15:45:35FromDiscord<Phil> Not to me, sorry
15:47:13FromDiscord<jmgomez> np, There is a reference to it in the compiler.. not sure if it's a genAst issue
15:47:36FromDiscord<Phil> There also is a closed issue about sth like it:↔https://github.com/nim-lang/Nim/issues/9476
15:52:02FromDiscord<0x454d505459> sent a code paste, see https://play.nim-lang.org/#ix=4jhG
15:52:46FromDiscord<ambient> sent a code paste, see https://paste.rs/7Xt
15:56:32FromDiscord<0x454d505459> In reply to @0x454d505459 "Simple question I wasn't": nvm find out I think
16:01:28*sagax quit (Remote host closed the connection)
16:05:03FromDiscord<JeysonFlores> I'm writing a small lib with some CLI utilities but I need to check user's keyboard input. I saw that the easiest way to do this in Nim is using the illwill library. I've tried it and works OK but it seems this lib is more than just a keyboard input abstraction and it has many API drawbacks I would like to avoid (like "initializing" and "de-initializing" IllWill contexts and stuff)
16:05:11FromDiscord<JeysonFlores> Is there any other option?
16:06:31FromDiscord<auxym> maybe https://github.com/ansiwave/nimwave ?
16:10:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jhM
16:10:41*fallback joined #nim
16:11:35FromDiscord<ambient> yeah but I don't have an object, just a type
16:11:47FromDiscord<Phil> Don't need an object to define procs for it
16:12:08FromDiscord<Phil> As long as you can infer the low/high values from a value of that type you're good
16:12:09FromDiscord<ambient> in your example, I would need A.low and A.high
16:12:42FromDiscord<Phil> Ahhh you mean you don't have an instance, just a type definition, now I get it
16:13:41FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=4jhP
16:14:03FromDiscord<Phil> What value would you assume that "low" should return for the Coords2D type?
16:14:21FromDiscord<ambient> (int.low, int.low)
16:15:20FromDiscord<Phil> then why not `proc low(t: typedesc[Coords2D]): Coords2D = (int.low, int.low)`?
16:16:17FromDiscord<ambient> In reply to @Isofruit "then why not `proc": https://github.com/amb/aoc2022/blob/master/aoc.nim#L146 stuff I'm doing, may be smart approach or not
16:16:58FromDiscord<Phil> One sec, you want "low" defined for `Hashset[Coord2D]`?
16:17:15FromDiscord<auxym> just aoc stuff 😄
16:17:15FromDiscord<Phil> (Since you wanted those procs for Coords2D, not Coord2D)
16:17:30FromDiscord<ambient> it was an example
16:18:02FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=4jhQ
16:18:14FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=4jhR
16:18:28FromDiscord<ambient> and it should pick either 2D or 3D depending on the context
16:19:46FromDiscord<ambient> although can Nim match function signature based on just what it returns if everything else is the same?
16:36:43FromDiscord<vindaar> pmunch\: I wasted a bit of time now playing around with this https://gist.github.com/Vindaar/1e50a8515e87058033de30b2ceb92fa5#file-weather_wind_interpolation-nim↔As @ezquerra mentioned, treating the data as polar coordinates makes it somewhat possible. I don't literally treat them as complex numbers in the cartesian domain and just pretend I can interpolate each separately. It more or less works, but I wouldn't call it elegant 🙈
16:37:45*oz left #nim (WeeChat 3.7.1)
16:37:51*oz joined #nim
17:29:31*pusewicz joined #nim
17:36:34*pusewicz is now known as pusewicz|away
17:50:40FromDiscord<@thatrandomperson5-6310e3b26da03> How would i set a default for a `var` proc argument
17:59:08FromDiscord<@thatrandomperson5-6310e3b26da03> nvm, i found std/options
18:00:32FromDiscord<@thatrandomperson5-6310e3b26da03> Wait, it says get cannot be assinged to! Arggghh
18:01:14*pusewicz|away quit (Quit: My MacBook has gone to sleep. ZZZzzz
)
18:02:06FromDiscord<@thatrandomperson5-6310e3b26da03> > How would i set a default for a `var` proc argument↔How would i make this optional
18:02:36*jmdaemon joined #nim
18:15:18FromDiscord<@thatrandomperson5-6310e3b26da03> like \`\`\`
18:16:52FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4jid
18:22:08FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jif
18:22:20FromDiscord<@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4jig
18:23:27FromDiscord<vindaar> uhh
18:43:46FromDiscord<@thatrandomperson5-6310e3b26da03> .
18:45:31FromDiscord<@thatrandomperson5-6310e3b26da03> Never mind it does not work. i want it optional, if it does not exist i will not set to it.
18:48:38FromDiscord<@thatrandomperson5-6310e3b26da03> My solution right now is to use overloads, if you have any better ideas please let me know
18:57:06FromDiscord<vindaar> optional in what sense though? You explicitly want an `Option[T]` type or you just want a proc taking a `var` argument, which you sometimes can also just not give?
19:20:47*pro joined #nim
19:26:14*pro left #nim (#nim)
19:30:57FromDiscord<gcao> hi, what's the reason that channels should not be used by threads created by createThread? What are the differences between threads in threadpool and threads created by the user?
19:31:21FromDiscord<gcao> (edit) "threads created by createThread?" => "spawn?"
19:53:58FromDiscord<c4ulmu> Hey. I asked a question on the nim forum and my question has crossed eye and hint `Thread is noderated`. What does it mean? Is something wrong with my question or it just waits moderator to approve it?
20:10:51FromDiscord<thindil> c4ulmu\: Hey, if it is your first topic on the forum, it just awaits for moderators approval. From my experience, it should be approved very soon (TM). 😉
20:11:44FromDiscord<c4ulmu> Oh, thanks. Yes it is the first question on the forum
20:23:42FromDiscord<vindaar> approved your account đŸ‘ïž
20:24:42NimEventerNew thread by c4UlMu: Use multithreading without channel and threadpool, see https://forum.nim-lang.org/t/9750
20:30:11*ltriant quit (Ping timeout: 246 seconds)
20:31:24FromDiscord<Yandall> @Phil Can you help me? I'm running in some error when trying to make a release build with prologue
21:07:25*kenran joined #nim
21:08:30FromDiscord<kaddkaka> I'm trying to add to a sequence of tables, but for some reason it looks like I have TableRefs that I'm trying to add?↔`Error: type mismatch: got <seq[Table[system.int, system.int]], TableRef[system.int, system.int]>`↔How should I think
21:09:05FromDiscord<vindaar> did you type `newTable` somewhere?
21:09:48FromDiscord<kaddkaka> Yes, I used collect with newTable! 😼
21:10:22FromDiscord<vindaar> that constructs a `TableRef`. You need to use `initTable` \:)
21:11:22FromDiscord<kaddkaka> thanks 👍
21:12:49*kenran quit (Remote host closed the connection)
21:37:24FromDiscord<kaddkaka> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)Segmentation fault (core dumped)` T_T
21:38:10FromDiscord<Phil> In reply to @Yandall "<@180601887916163073> Can you help": Back and available, what up?
21:39:01FromDiscord<Phil> Sidenote, it's always more efficient to just ask here in chat or the webdev channel directly, rather than asking to ask or waiting for someone specific
21:39:19FromDiscord<Phil> 😄
21:39:58FromDiscord<Yandall> I followed the guide in the docs on how to deploy but I get an error en when compiling with the option `-d:lto`
21:40:10FromDiscord<Yandall> In reply to @Isofruit "😄": Yeah, you're right
21:40:21FromDiscord<Yandall> (edit) removed "en"
21:41:00FromDiscord<Phil> What error and what's the exact compile command?
21:42:04FromDiscord<Phil> Just for reference, this is what I use to build my side project with musl for alpine containers : https://github.com/PhilippMDoerner/NimStoryFont/blob/44e0bc1a7b1d031e320c0deb9324ef07cec03eed/nimstoryfont.nimble#L33
21:42:12FromDiscord<Yandall> sent a code paste, see https://play.nim-lang.org/#ix=4jja
21:42:32FromDiscord<Phil> The exact compiler command?
21:42:48FromDiscord<Phil> And are you on Windows?
21:43:22FromDiscord<Yandall> I'm on mac
21:43:35FromDiscord<Phil> Check. Compiler command?
21:44:11FromDiscord<Yandall> sent a code paste, see https://paste.rs/zpF
21:44:22FromDiscord<Phil> --define
21:44:49FromDiscord<Phil> -d and --define are identical, -d is just the short form
21:45:06FromDiscord<Yandall> In reply to @Isofruit "--define": My bad. But still have the same error
21:45:12FromDiscord<Phil> But the long form must have 2 minuses
21:45:29FromDiscord<Phil> And the short form 1.↔Same error? Hmm
21:46:11FromDiscord<Phil> Does clang maybe not have an lto option?
21:46:24FromDiscord<Phil> The guide was written with GCC in mind tbh
21:46:41FromDiscord<Yandall> The option in clang is `-flto`
21:46:50FromDiscord<Phil> Does that work?
21:47:08FromDiscord<Yandall> Nah, that's the option in clang that causes the error
21:47:24FromDiscord<Yandall> When I remove it, it compiles just fine
21:47:47*ltriant joined #nim
21:48:21FromDiscord<Phil> Alrighty. For reference you're not giving up much by not having it, it's just "free performance" for slightly longer compile times on gcc
21:48:33FromDiscord<Phil> But the fact it's problematic is strange
21:49:04FromDiscord<Phil> I think ringabout is also on Mac(?)
21:49:29FromDiscord<Phil> I know araq is but chances are he is sleeping atm
21:50:57FromDiscord<Yandall> I couldn't find any reference for the error. Just to have installed llvm
21:53:29*ltriant quit (Ping timeout: 246 seconds)
21:54:44FromDiscord<Phil> @ringabout are you familiar whether anything changed with clang regarding -d:lto?
21:55:13FromDiscord<Yandall> Or maybe is something in my enviroment that is missing?
21:55:35FromDiscord<Phil> I'll be back home in A bit and play around with clang , should still have it installed somewhere
21:55:52FromDiscord<Elegantbeef> for clang you need to d `--passC:"-flto" --passL:"-flto"`
21:56:47FromDiscord<Phil> If you're on Mac and clang is your default compiler, does it not do that for you automatically?
21:56:48FromDiscord<Elegantbeef> It's better to just do that in general for crossplatform/compiler purposes
21:57:05FromDiscord<Phil> I thought that was a Linux thing since our default compiler was gcc
21:57:13FromDiscord<Elegantbeef> Nope `-d:lto` afaik doesnt work with clang properly
21:58:28FromDiscord<Phil> That is really good to know... I guess I should add that to the prologue deployment docs
21:59:12FromDiscord<Yandall> So I just add those options and remove `-d:lto`?
21:59:17FromDiscord<Phil> Aye
21:59:57FromDiscord<Phil> Compilers really are arcane knowledge
22:00:40FromDiscord<Yandall> Well, it compiled just fine. thanks @ElegantBeef
22:11:24*pusewicz joined #nim
22:24:09FromDiscord<Goel> > The definition of “strict funcs” changed and is now considered to be stable enough to become the default in later versions.↔What's that?
22:25:59FromDiscord<Goel> (edit) "> The definition of “strict funcs” changed and is now considered to be stable enough to become the default in later versions.↔What's that? ... " added "Means the `func` keyword used instead of the `proc` or something else?↔And its definition changed how exactly?"
22:27:38FromDiscord<Phil> Alrighty, commit with adjustment to deployment docs is out
22:34:36FromDiscord<Elegantbeef> Strict funcs now just prevent writing to `ptr` or `ref`↔(@Goel)
22:36:23FromDiscord<Phil> So you can now have side-effects in functions, but they can't be manipulating data in references?
22:36:40FromDiscord<Elegantbeef> No funcs still are funcs
22:36:54FromDiscord<Elegantbeef> But the new definition of strict funcs is you cannot write to ref/ptr
22:46:13*ltriant joined #nim
22:49:06FromDiscord<user2m> sent a code paste, see https://paste.rs/JBz
22:50:50FromDiscord<Elegantbeef> Cause in Nim arrays are static sized
22:50:55FromDiscord<Elegantbeef> And that size is apart of the type
22:52:32FromDiscord<user2m> ahh ok so Idx is a built in keyword and not user defined
22:52:40FromDiscord<Elegantbeef> Nope
22:52:44FromDiscord<Elegantbeef> It's a generic parameter
22:53:07FromDiscord<Elegantbeef> Also works
22:53:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jjo
22:53:27FromDiscord<Elegantbeef> It's just a generic parameter it could be anything but `array[size, type]` is what you need
22:53:46FromDiscord<user2m> gotcha! very helpful thanks!
23:02:45OnionhammerSo when we moving nim-template to the nim-lang org? 😉
23:06:07FromDiscord<Elegantbeef> What?
23:07:37Onionhammerhttps://github.com/onionhammer/nim-templates
23:08:52FromDiscord<Phil> What is the benefit of this over strformat?
23:18:34*pusewicz is now known as pusewicz|away
23:19:38*oprypin quit (Ping timeout: 272 seconds)
23:20:10*pusewicz|away quit (Quit: My MacBook has gone to sleep. ZZZzzz
)
23:23:51FromDiscord<deech> Is there a generalized interspersing function on `openArray`, a `join` that works on any `T` not just strings, eg. `@[1,2,3].intersperse(20)` -> `@[1,20,2,20,3]`
23:44:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jjy
23:46:40FromDiscord<nqeron> sent a long message, see http://ix.io/4jjz
23:47:08FromDiscord<nqeron> I'm trying to allow the user to set the value of N, so obviously that can't be done at compile time
23:47:21FromDiscord<nqeron> but if I stop using the static variable other things break
23:50:54FromDiscord<huantian> switch to a `seq` instead of `array` ig
23:53:38FromDiscord<huantian> other than doing what you have above, I'm not sure if there's a better way, because like you said the size is set by the user at runtime
23:54:08FromDiscord<nqeron> I was hoping to take advantage of array optimizations - but I guess that would work
23:56:05FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=4jjD