<< 05-04-2022 >>

00:01:53*vicfred quit (Quit: Leaving)
00:05:09FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Ul8
00:05:21FromDiscord<Elegantbeef> Yea it's like only for calls duuuuude
00:05:48FromDiscord<Elegantbeef> Sorry couldnt help myself
00:06:03FromDiscord<creikey> In reply to @Elegantbeef "Creikey did you see": just the pings here I'll try to filter for your username
00:06:34FromDiscord<creikey> In reply to @Elegantbeef "Is it just the": some of the calls in a chunk of code, like it's doing some logic and draw calls
00:06:55FromDiscord<Elegantbeef> And what's wrong with `std/with` or the `with` on nimble?
00:07:03FromDiscord<creikey> I want the convenient feeling of a global drawing context but while passing the `d` drawing context parmeter around
00:07:26FromDiscord<creikey> In reply to @Elegantbeef "And what's wrong with": let me make the playground example
00:07:35FromDiscord<creikey> hold on I was supposed to join a class 7 minutes ago
00:08:17*meowray quit (Remote host closed the connection)
00:08:27*\u joined #nim
00:08:50*NimEventer quit (Read error: Connection reset by peer)
00:09:14*NimEventer joined #nim
00:12:39*mal`` quit (Ping timeout: 256 seconds)
00:13:47*Ekho quit (Ping timeout: 256 seconds)
00:14:49*mal`` joined #nim
00:17:20NimEventerNew Nimble package! parsepage - Automatically extracts the data of sites, see https://gitlab.com/lurlo/parsepage
00:20:06*Ekho joined #nim
00:40:10FromDiscord<abdu> In reply to @Elegantbeef "Do they have sub": ok↵How to have `echo` not output nl (newline) so next echo is in par line
00:40:32FromDiscord<Elegantbeef> `stdout.write`
00:41:02FromDiscord<abdu> In reply to @Elegantbeef "`stdout.write`": how is its syntax?
00:41:07*kayabaNerve quit (Ping timeout: 260 seconds)
00:41:49FromDiscord<Elegantbeef> https://nim-lang.org/docs/io.html#write%2CFile%2Cstring
01:04:31FromDiscord<creikey> In reply to @Elegantbeef "And what's wrong with": https://play.nim-lang.org/#ix=3Uli
01:04:33FromDiscord<creikey> how do I make this work
01:05:03FromDiscord<Elegantbeef> Ah have you considered `byaddr`?
01:05:08FromDiscord<Elegantbeef> Ah nvm
01:05:18FromDiscord<Elegantbeef> You really cant handle this
01:05:39FromDiscord<Elegantbeef> Actually.... hmmm
01:05:57FromDiscord<Elegantbeef> We can actually do this give me a moment
01:14:30FromDiscord<Elegantbeef> @creikey\: here you go https://play.nim-lang.org/#ix=3Ull
01:16:06FromDiscord<creikey> In reply to @Elegantbeef "<@180866243819995136>\: here you go": interesting
01:16:08FromDiscord<creikey> thanks
01:17:01*neurocyte861449 joined #nim
01:17:11FromDiscord<Elegantbeef> ah it shouldnt be `proc` it should be typed like so https://play.nim-lang.org/#ix=3Ulm
01:17:25FromDiscord<Elegantbeef> This properly adds the parameter in the first position if there is an overload that takes it
01:17:41FromDiscord<Elegantbeef> You could make it more intelligent and look if any are missing and insert it there, but that's hell on earth to reason imo
01:18:41FromDiscord<creikey> In reply to @Elegantbeef "You could make it": yeah this is not really necessary either
01:18:46FromDiscord<creikey> this is really useful though
01:19:06FromDiscord<creikey> makes a lot of code nicer
01:19:26FromDiscord<creikey> In reply to @Elegantbeef "ah it shouldnt be": can I like paypal you $20 for this
01:19:26*neurocyte86144 quit (Ping timeout: 268 seconds)
01:19:26*neurocyte861449 is now known as neurocyte86144
01:19:50FromDiscord<Elegantbeef> Lol
01:21:16FromDiscord<creikey> is there an easy way to make it so you can do like `with d, p:` and it checks for both on the first arg
01:21:54FromDiscord<creikey> it seems like it's just make arg a seq and add a for loop over it on line 36
01:21:57FromDiscord<Elegantbeef> It's a bit harder due to the `applyIfNeeds` logic
01:23:21FromDiscord<creikey> In reply to @Elegantbeef "It's a bit harder": you can call applyIfNeeds on each object passed to with though right
01:23:36FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/UL6
01:23:52FromDiscord<Elegantbeef> needscall would be the `applyIfNeeds` `let need =` logic inside a macro
01:24:22FromDiscord<Elegantbeef> Generating the above i think would be the easiest
01:24:40FromDiscord<Elegantbeef> This reminds me that I need to support when inside micros
01:26:15*xet7 joined #nim
01:34:49*yoyojambo joined #nim
01:39:08*SamuelMarks joined #nim
01:39:10SamuelMarkshi
01:39:19FromDiscord<Elegantbeef> Hello
01:59:48FromDiscord<Elegantbeef> @creikey\: this uses my abstractions but this is how you'd probably want to do it https://github.com/beef331/micros/blob/master/tests/tapply.nim#L6-L37
02:03:39SamuelMarksHmm actually it shouldn't be too difficult for me to write my own flat CST ("T") for C. I think I'll do that. Probably won't take longer than 24 hours… here we go!
02:04:32FromDiscord<Elegantbeef> CST?
02:06:17*rockcavera quit (Remote host closed the connection)
02:08:40*rockcavera joined #nim
02:08:40*rockcavera quit (Changing host)
02:08:40*rockcavera joined #nim
02:08:48*rockcavera quit (Remote host closed the connection)
02:09:33*rockcavera joined #nim
02:09:33*rockcavera quit (Changing host)
02:09:33*rockcavera joined #nim
02:09:38*Goodbye_Vincent1 joined #nim
02:09:53*rockcavera quit (Remote host closed the connection)
02:10:21*rockcavera joined #nim
02:10:21*rockcavera quit (Changing host)
02:10:21*rockcavera joined #nim
02:10:47*def-- joined #nim
02:11:05*Goodbye_Vincent quit (Ping timeout: 256 seconds)
02:11:05*Goodbye_Vincent1 is now known as Goodbye_Vincent
02:12:13*def- quit (Ping timeout: 256 seconds)
02:12:13*def-- is now known as def-
02:15:00*arkurious quit (Quit: Leaving)
02:16:54FromDiscord<demotomohiro> @creikey Another implementation: https://play.nim-lang.org/#ix=3Uls
02:17:08*LuxuryMode quit (Quit: Connection closed for inactivity)
02:17:21FromDiscord<demotomohiro> With multiple objects support
02:20:08FromDiscord<Elegantbeef> Hmm i probably should use compiles more, i just dislike the premise of asking if something compiles
02:23:23FromDiscord<Rika> Beef knows his code won’t compile anyway
02:23:30FromDiscord<Elegantbeef> True
02:25:19FromDiscord<huantian> In reply to @Elegantbeef "CST?": I think it’s concrete syntax tree
02:25:52FromDiscord<huantian> From that one time I looked at that one python package
02:27:08FromDiscord<Rika> What’s the difference with an AST?
02:27:15FromDiscord<huantian> Because I think most python for matters use CST for formatting
02:27:20FromDiscord<spoon> ayo, used standard library and got using a single nimscript interpreter to work by ~~plagiarizing~~ a nimconf
02:27:26FromDiscord<huantian> Uh I think it includes more information if I remember correctly
02:27:52FromDiscord<spoon> now am i able to restrict certain language features for security reasons in nimscript?
02:28:15FromDiscord<Rika> In reply to @spoon "now am i able": In what context/method are you calling the code?
02:28:17FromDiscord<spoon> the embedding talk by pmunch btw
02:28:19FromDiscord<Elegantbeef> Most unsafe things dont exist but there is the vmopsdanger flag iirc
02:28:44FromDiscord<Elegantbeef> Well when you want to interop steal my vmconversion code to save braincells
02:29:29FromDiscord<spoon> In reply to @Rika "In what context/method are": right now i just have an object that contains a string with nimscript code, and i am just feeding it to an interpreter whenever it needs to run
02:29:35FromDiscord<huantian> I can’t remember exactly sure what the difference is tbh, at least in python I think it includes more information on the exact syntax used to make the code!
02:29:42FromDiscord<huantian> (edit) "code!" => "code?"
02:29:56*Gustavo6046 quit (Read error: Connection reset by peer)
02:30:10FromDiscord<Elegantbeef> All the unsafe operations are by default disabled iirc
02:30:12FromDiscord<spoon> In reply to @Elegantbeef "Most unsafe things dont": is there any documentation on it?
02:30:21FromDiscord<spoon> see one from 2020 where it's experimental
02:30:31FromDiscord<Elegantbeef> Nope read the code is all i can say
02:30:38FromDiscord<Elegantbeef> If you have questions i might be able to help
02:30:48FromDiscord<Rika> In reply to @huantian "I can’t remember exactly": Okay, wonder what the dude meant about the CST then
02:31:14FromDiscord<spoon> i mean i guess since it's a string i can try processing away all of the imports i don't like, but people will find a way around that most likely
02:31:17FromDiscord<Elegantbeef> Also how is this any better than Nimscripter's API?
02:31:32FromDiscord<Elegantbeef> You just dont ship unsafe modules
02:31:41FromDiscord<Elegantbeef> Like it's that simple
02:31:47FromDiscord<Elegantbeef> Cannot access code you dont have
02:31:57FromDiscord<Elegantbeef> And then again most modules cant be used
02:32:01FromDiscord<huantian> In reply to @huantian "I can’t remember exactly": don't quote me but it might be like untyped vs typed in nim? ↵but like for python CST contains thigns like whitespace, comments, parentahthes, which I'd assume get lost in ast
02:32:04FromDiscord<Elegantbeef> You cannot open a socket with nimscript
02:32:11FromDiscord<Elegantbeef> You cannot write to a file with nimscript
02:32:20FromDiscord<Rika> Nim AST never has comments
02:32:27FromDiscord<Rika> except for doc ones
02:32:41FromDiscord<Rika> That makes sense though
02:32:48FromDiscord<Elegantbeef> Yea that stuff is lost in AST
02:33:00FromDiscord<Elegantbeef> It's one reason we have expanded macro calls in error messages
02:33:31FromDiscord<Rika> Maybe I should make a toy parser for this kinda shit
02:34:09FromDiscord<huantian> Yeah like if you wanted to make a formatter, you wouldn't want to lose info like comments
02:35:07FromDiscord<Rika> I was planning on creating a formatter and maybe a linter in the future
02:35:13FromDiscord<huantian> hm yeah it might be useful to have something like this in nim if one wanted to make a ~~actually good~~ formatter
02:35:39FromDiscord<Rika> If I were to make a serious one I’d just use the compiler API
02:35:44FromDiscord<Rika> “Oh wait.”
02:36:02*Gustavo6046 joined #nim
02:36:59FromDiscord<huantian> hm what would be a good nim formatter name
02:37:11*Gustavo6046 quit (Max SendQ exceeded)
02:37:12FromDiscord<Rika> Are you gonna make one as welll
02:37:22FromDiscord<huantian> probably not lol↵I just like thinking of names
02:37:32FromDiscord<huantian> even though I can never think of good ones
02:37:40*Gustavo6046 joined #nim
02:38:02FromDiscord<spoon> probably would end up being "formatty"
02:38:37FromDiscord<Rika> I wouldn’t
02:38:46FromDiscord<Rika> I’m not a fan, and tree has that for himself
02:38:48*Gustavo6046 quit (Remote host closed the connection)
02:39:06FromDiscord<spoon> yea, saw some repos that borrowed from his nimtemplate that had the same name scheme
02:39:07*Gustavo6046 joined #nim
02:39:08FromDiscord<Rika> If he beats me to the punch so be it
02:39:25FromDiscord<huantian> how about "shape carpet"
02:39:55FromDiscord<spoon> alignymnt
02:40:03FromDiscord<spoon> (edit) "alignymnt" => "alignimnt"
02:40:08FromDiscord<spoon> aligniment
02:40:14FromDiscord<Rika> No
02:40:18FromDiscord<spoon> eh, i tried
02:40:24FromDiscord<Rika> No names with “Nim” shoehorned for me lol
02:40:31FromDiscord<aph> `nim-formatter`, straightforward but lame
02:40:46FromDiscord<Rika> Why are y’all thinking of names assuming I’ll be making this in time xd
02:40:52FromDiscord<spoon> every nim project has to have the nim shoehorned into the name though
02:40:55FromDiscord<spoon> that's an unspoken rule
02:40:57FromDiscord<huantian> what about "while stuff"
02:41:03FromDiscord<Rika> I’ll probably give it a Japanese name knowing me
02:41:25FromDiscord<Rika> In reply to @huantian "what about "while stuff"": Two words makes it annoying to deal with when I make a file name though lol
02:41:44SamuelMarksElegantbeef - CST as in Concrete Syntax Tree. Though mine tend to be super flat. As in 1D
02:42:03FromDiscord<Elegantbeef> Also spoon what was the issue with Nimscripter?
02:42:31SamuelMarksRika an AST won't be able to recreate the source exactly as it found it, as it omits comments and whitespace
02:42:51FromDiscord<spoon> just couldn't find a way to get it to work without either creating or destroying an interpreter each time it needed to run, given that there are a bunch of objects that would need to handle scripts
02:42:59FromDiscord<spoon> or finding some big workaround using tables
02:43:12FromDiscord<spoon> might be a method, just haven't found it
02:43:40FromDiscord<Elegantbeef> Ah i see, not much I can really happily change then
02:44:03FromDiscord<huantian> the things one has to do for hot reloading
02:44:16FromDiscord<Rika> What’s the CST for? I don’t remember you mentioning anything
02:44:59SamuelMarksRika - So I can parse in C code, modify it [sanely], then emit it back. Also so I can create C code from nothing (just these API constructs), modify it, and emit it fresh.
02:46:04FromDiscord<Elegantbeef> Well spoon if you can figure out a way to extend nimscripter for this i'd accept a PR, the logic you're talking about is in the single file
02:46:21FromDiscord<Elegantbeef> That's if you want to of course
02:46:27FromDiscord<Rika> C parsing, may God bless you
02:46:39FromDiscord<spoon> aight, really just needs one method like "evaluateSream" or something
02:47:06FromDiscord<spoon> eh, maybe there's a bit more to it
02:47:16FromDiscord<huantian> In reply to @Rika "C parsing, may God": is it that bad?
02:47:17SamuelMarks=D
02:47:29SamuelMarkshuantian - it's kinda ambiguous
02:48:09FromDiscord<Rika> In reply to @huantian "is it that bad?": Haha depends on the era of time you’re dealing with
02:48:17FromDiscord<Rika> And the compilers you’re dealing with
02:48:39FromDiscord<Rika> You usually leave it to a compiler to do the parsing but you can’t really in this case
02:49:02SamuelMarksYeah, also LLVM doesn't actually support writing an AST from scratch in its API
02:49:21SamuelMarksIt wants some actual code to parse first, then it can sort-of modify things but not cleanly like Python can
02:49:46FromDiscord<Rika> Man really you’re in for hell
02:50:01FromDiscord<Rika> Well, I guess you can ignore a whole number of things but still
02:50:09SamuelMarksI still think for my purposes it's something I can achieve within the next 24 hours
02:50:18FromDiscord<Elegantbeef> Hey for parsing they can atleast use something like libclang
02:50:34FromDiscord<Rika> Didn’t we just say he couldn’t
02:50:41SamuelMarksIgnore everything that I don't care about and get something that solves my immediate problem, open-source everything, and if others find it useful they'll fill in the bit I don't use to make it fully compliant
02:50:51FromDiscord<Rika> Sounds like a good plan
02:51:03FromDiscord<Elegantbeef> I said for parsing rika
02:51:41SamuelMarksElegantbeef - Nah libclang ppl said they'll have this API maybe at the end of the year, they told me this morning: https://discourse.llvm.org/t/create-and-emit-ast-for-struct-clang-recorddecl/61383/2
02:52:13FromDiscord<Rika> Yeah I don’t see your point beef
02:55:14FromDiscord<Elegantbeef> We'll just go with my pointful as a circle
02:55:25FromDiscord<Elegantbeef> with my point is as pointful\
02:57:02FromDiscord<Rika> A circle has infinite points
02:57:29FromDiscord<Rika> Wait you mean sharp tips
02:58:04FromDiscord<spoon> pointy?
02:58:54FromDiscord<Rika> Oh my god wait this is hilarious
02:59:02FromDiscord<Rika> What if I name my formatter “aster”
03:00:34FromDiscord<huantian> Yes
03:16:52*SamuelMarks quit (Ping timeout: 260 seconds)
03:19:52*yiggityswaps joined #nim
03:23:23*yoyojambo quit (Ping timeout: 268 seconds)
03:32:37*kayabaNerve joined #nim
03:41:10FromDiscord<aph> sent a code paste, see https://play.nim-lang.org/#ix=3UlB
03:41:18FromDiscord<aph> should i install nightlies and dump there?
03:41:54FromDiscord<aph> sent a code paste, see https://play.nim-lang.org/#ix=3UlC
03:42:36FromDiscord<Elegantbeef> i've never installed koch to my path so dont know why
03:42:52FromDiscord<Elegantbeef> `./koch temp c myFile` is what i generally do, where `./` is a cloned `Nim`
03:43:10FromDiscord<Elegantbeef> If you show the code i can probably guess the issue 😛
03:43:18FromDiscord<aph> In reply to @Elegantbeef "If you show the": lol true
03:43:27FromDiscord<aph> In reply to @Elegantbeef "`./koch temp c myFile`": time to switch to powershell if it resolves anything
03:44:16FromDiscord<Elegantbeef> It wont you're calling it, it looks locally for the path iirc
03:44:57FromDiscord<aph> `./koch` not found
03:44:59FromDiscord<aph> :P
03:45:46FromDiscord<aph> dumps https://media.discordapp.net/attachments/371759389889003532/960747048548851772/reader.nim
03:47:09FromDiscord<aph> oh nvm, it doesn't seem to be the code's issue
03:47:15FromDiscord<aph> my nim compiler just didn't work lol
03:54:04FromDiscord<aph> reinstalled nim! resolved!
03:54:17FromDiscord<demotomohiro> build_at.bat/build_all.sh builds nim from c source before calling koch.
03:58:03FromDiscord<aph> hmm
04:00:09FromDiscord<Elegantbeef> Make your code smarter just take in a `Stream`
04:00:37FromDiscord<aph> okie :>
04:00:43FromDiscord<Elegantbeef> then you can have a `initPMXFile` that takes a string 😛
04:01:01FromDiscord<Elegantbeef> Of course disregard me given you didnt ask for suggestions
04:02:07FromDiscord<Elegantbeef> your `readVec` will not work
04:02:21FromDiscord<aph> oh i thought it'll work like a list comp
04:02:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UlD
04:02:58FromDiscord<Elegantbeef> `array[amount, float]` \
04:03:13FromDiscord<Elegantbeef> And of course you can make a `proc readVec(s: FileStream, size: int): seq[float]`
04:03:14FromDiscord<aph> ohh
04:03:33FromDiscord<Elegantbeef> Finally you dont need to return result
04:03:38FromDiscord<Elegantbeef> result is already implicitly returned
04:04:28FromDiscord<Elegantbeef> Why are you `include`ing `pmxTypes`?
04:04:55FromDiscord<aph> In reply to @Elegantbeef "Why are you `include`ing": not sure, `import` didn't get the types
04:05:01FromDiscord<aph> i think the issue is in that file instead
04:05:18FromDiscord<aph> whoops
04:05:20FromDiscord<aph> kinda spammy
04:05:20FromDiscord<aph> sent a code paste, see https://play.nim-lang.org/#ix=3UlE
04:05:43FromDiscord<aph> i'm trying to make my code NEP1ish, later 😛
04:06:12FromDiscord<aph> or maybe again it's not the code
04:07:05FromDiscord<Elegantbeef> Cause you didnt export types
04:07:21FromDiscord<Elegantbeef> You can only access fields/types with `` on them
04:07:54FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/HKv
04:08:03FromDiscord<aph> ohh
04:08:06FromDiscord<aph> ty!
04:08:06FromDiscord<Elegantbeef> `array` is a generic
04:08:14FromDiscord<Elegantbeef> you cannot do `myField: array`
04:08:20FromDiscord<Elegantbeef> In that case it means "all arrays"
04:08:24FromDiscord<Elegantbeef> you need a size and type
04:08:36FromDiscord<Elegantbeef> If it's arbitrary size you do `seq[MyType]`
04:08:50FromDiscord<aph> time to go for seq
04:08:52FromDiscord<aph> :)
04:09:05FromDiscord<Elegantbeef> Also you can declare these all in a single typedef 😛
04:09:38FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/mwI
04:10:03FromDiscord<aph> woww
04:10:06FromDiscord<Elegantbeef> Also worth noting instead of `array[3, float]` i'd use `type Vec3 = array[3, float]`
04:10:25FromDiscord<Elegantbeef> Less tedious typing
04:10:39FromDiscord<aph> i didn't know i could do that
04:10:40FromDiscord<aph> wow
04:11:30FromDiscord<Elegantbeef> The latter thing is a type alias
04:11:43FromDiscord<Elegantbeef> Also `float` is 64 bit btwe
04:11:49FromDiscord<Elegantbeef> If you want 32bit it's float32
04:11:59FromDiscord<aph> ohh
04:12:12FromDiscord<aph> you got me ohhing this morning
04:12:53FromDiscord<Elegantbeef> And for an ooh
04:14:17FromDiscord<Elegantbeef> `result.position = s.readVec(3)` can be written `s.read(result.position)` assuming it's a value type
04:14:59FromDiscord<Elegantbeef> and also assuming they're the same size, in this case the data is 12 bytes and you have an `array[3, float32]`
04:15:29FromDiscord<aph> i have a `Vec3`
04:15:30FromDiscord<aph> :)
04:15:50FromDiscord<Elegantbeef> I mean `Vec3` is just an alias so it's the same thing
04:16:00FromDiscord<Elegantbeef> If the dest is 12bytes and the source is 12 bytes it'll work
04:17:51FromDiscord<aph> wow `.read` is cool
04:18:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UlH
04:20:24*rockcavera quit (Read error: Connection reset by peer)
04:20:49*rockcavera joined #nim
04:20:49*rockcavera quit (Changing host)
04:20:49*rockcavera joined #nim
04:21:14FromDiscord<aph> nim is k00l ngl
04:21:26*Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected])
04:21:30FromDiscord<Elegantbeef> Write less not more is my view, and you can do it a lot with Nim
04:30:15*rockcavera quit (Remote host closed the connection)
04:40:39FromDiscord<aph> In reply to @Elegantbeef "You can even use": vscode angry at me https://media.discordapp.net/attachments/371759389889003532/960760856675749948/unknown.png
04:40:40FromDiscord<aph> 😢
04:40:58FromDiscord<Elegantbeef> Compiler errors are more helpful
04:41:47FromDiscord<aph> it has no issues compiling though lol
04:41:57FromDiscord<Elegantbeef> Ah
04:42:36FromDiscord<Elegantbeef> What does the extension say?
04:43:04FromDiscord<aph> spams: `undeclared field: '...'`
04:43:18FromDiscord<Elegantbeef> Odd
04:44:30FromDiscord<aph> oh nvm
04:44:38FromDiscord<aph> i was compiling the wrong files
04:44:42FromDiscord<aph> heh
04:44:45*slowButPresent quit (Quit: leaving)
04:44:51FromDiscord<aph> i forgot to add that little star after attributes
04:52:30FromDiscord<spoon> ye, i use coderunner and end up wasting time compiling code that does nothing
04:52:31*yoyojambo joined #nim
04:53:06FromDiscord<spoon> pretty sure theres a way to configure coderunner in workspaces and get it to use nimble
04:54:17*yiggityswaps quit (Ping timeout: 248 seconds)
04:56:12FromDiscord<huantian> coderunner? Why not just vscode launch profiles
04:59:52FromDiscord<spoon> because i dont know how to use computers
05:00:10FromDiscord<Elegantbeef> Does anyone really?
05:01:04FromDiscord<Rika> Especially you beef
05:01:30FromDiscord<Elegantbeef> Always encouraging me to be a better person, see isnt rika a nice person
05:02:20FromDiscord<Rika> I’m betting a tonne of newbies absolutely hate me now lol
05:03:02FromDiscord<Elegantbeef> if they dont get banter, uhh how will they last here
05:04:30FromDiscord<Rika> Hard to tell what’s banter and what’s argument when you’ve just joined
05:26:49*yoyojambo quit (Ping timeout: 248 seconds)
06:24:16*fowl2 joined #nim
06:25:53*fowl quit (Ping timeout: 246 seconds)
06:25:53*fowl2 is now known as fowl
06:58:24*PMunch joined #nim
07:01:40*SamuelMarks joined #nim
07:06:01*SamuelMarks quit (Ping timeout: 248 seconds)
07:11:21*SamuelMarks joined #nim
07:16:19*SamuelMarks quit (Ping timeout: 260 seconds)
07:26:14*koltrast_ joined #nim
07:26:26*koltrast quit (Ping timeout: 246 seconds)
07:32:32FromDiscord<aph> sent a code paste, see https://paste.rs/SvC
07:32:37*jjido joined #nim
07:41:49*koltrast_ quit (Ping timeout: 240 seconds)
07:50:26FromDiscord<demotomohiro> @aph https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT
07:50:39FromDiscord<aph> In reply to @demotomohiro "<@611418694245154847> https://nim-lang.org/docs/ite": thanks!
07:51:13FromDiscord<aph> i need to spend some time in the docs from now on!
07:51:41FromDiscord<Elegantbeef> There's a lot there so take a weekend 😛
07:52:00FromDiscord<aph> heh might take me a month
07:52:08FromDiscord<aph> i still haven't finished the tutorials in the web
07:52:53FromDiscord<demotomohiro> Or use this inside macro: https://nim-lang.org/docs/macros.html#getTypeImpl%2CNimNode
07:53:36FromDiscord<aph> thanks 2x!
07:54:45*koltrast joined #nim
08:06:19PMunch@Phil, sorry I didn't respond yesterday. That sounds similar to what I want to do, but I want to do it statically with types instead of passing procedures around
08:06:33FromDiscord<jmgomez> can nim derive a class defined in cpp?
08:07:20PMunchEssentially if you take a type User in your route then you need to define a proc that takes a request and returns a User object somewhere.
08:07:33PMunch@jmgomez, I think so
08:08:45FromDiscord<Elegantbeef> What are you guys talking about pmunch?
08:08:56PMunch@Elegantbeef, who?
08:09:10FromDiscord<Elegantbeef> About what you'd do
08:09:16PMunchPhil and I?
08:09:21FromDiscord<Elegantbeef> Yes
08:09:29PMunchAh, web frameworks
08:09:52PMunchHe wants something Django-esque, and I want something with type-safe routes
08:10:34FromDiscord<Phil> In reply to @PMunch "<@180601887916163073>, sorry I didn't": Currently at work, but once I'm off I'd love to chat a bit around your idea, because I can only imagine that through passing procs around
08:10:49FromDiscord<Phil> Tomorrow some time? Today my day is super packed
08:10:59PMunchI'm also at work :P
08:11:15FromDiscord<Elegantbeef> Typesafe routes that means less than you'd imagine to me
08:11:21FromDiscord<Phil> Yeh, but I can't do deep thinking an pseudo-pay-attention to meetings at the same time
08:11:24PMunchBut I'm available most of the day (at least now that my ankle is f-ed)
08:11:39FromDiscord<Phil> And payment processes
08:11:41FromDiscord<Phil> Fuck payment processes
08:11:44FromDiscord<Phil> They're the worst
08:11:47PMunchI'm lucky enough to not have a lot of meetings :P
08:11:58PMunchWhat do you work with?
08:11:58FromDiscord<Phil> If payment processes were a programming language they'd make brainfuck look easy
08:12:08PMunchHaha :P
08:12:45PMunchNot even sure what you mean by payment processes, but the little experience I have with finance-related stuff I wholehearthedly agree that it all seems like a massive clusterfuck
08:12:54FromDiscord<Phil> Subscription based service, but it's only kinda subscription based.↵You buy a yearly membership but it's sold to you like a monthly one with minimum contract duration of a year that can auto-renew after the year
08:13:28FromDiscord<Phil> And when you're in the auto-renewal state the conditions to which you can quit the contract are fundamentally different than during the initial yearly membership in so many ways it's ridiculous
08:14:03PMunchSounds like a lot of fun to implement /s
08:14:34FromDiscord<Phil> We don't even fully understand what we need to implement because we're the people designing the process in the first place as well while in meetings with finance people
08:14:56PMunchI got so annoyed the other day, I wanted to cancel a service, and according to the website the only way to cancel it was to call them. But their phones where swamped so I couldn't get through..
08:16:24FromDiscord<Phil> Though to be more nim specific
08:16:44FromDiscord<Phil> I think what Pmunch meant with type safe routes was, yknow, in a webapplication every URL is associated with a proc
08:16:45FromDiscord<jmgomez> In reply to @PMunch "<@726017160115126333>, I think so": do you know how? the compiler it's telling me that it must inherit from RootOfObj not sure if Im doing something wrong though
08:16:56FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=
08:17:15FromDiscord<Elegantbeef> mark your `TestCppNim` with `{.inheritable, pure.}`
08:18:36FromDiscord<Phil> And if you have a parameter in your url the proc that handles requests to that URL should receive the parameters and only these parameters
08:18:52FromDiscord<Phil> And if it wants to have additional parameters that aren't in the URL then the compiler should scream
08:18:56FromDiscord<Elegantbeef> Ah so a parser/validator with procedures
08:19:09FromDiscord<Phil> Sort of, I want sth like that in prologue at least
08:19:17FromDiscord<Elegantbeef> Well the compiler wouldnt scream it just wouldnt work
08:19:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Umd
08:20:24FromDiscord<Phil> The main problem this has is that at compile time, I do not know that the handler proc created by `createReadByIdHandler` will only use the ID_PATTERN param
08:21:04FromDiscord<Phil> Like, it should be possible, I know the proc that will be used with that URL at compile time and I know the URL itself at compile time
08:21:27FromDiscord<Phil> But currently the created handler could be expecting a parameter "walumba" and it'd only explode at runtime
08:21:43FromDiscord<Phil> (edit) "But currently the created handler could be expecting a ... parameter" added "string/int/bool"
08:22:32PMunchI just don't like having to implement route-parsing logic in my route handler
08:22:48FromDiscord<Elegantbeef> Ah yea i'd be partial to `proc creatureRoute(a: int) {.route:"/creature/$i",.}`
08:22:54PMunchI also want to support headers and bodies though of course
08:23:05PMunchThat's the idea @Elegantbeef :)
08:23:09FromDiscord<Phil> My main hope is that by understanding Pmunch's approach I could comprehend a possible solution
08:23:28FromDiscord<Elegantbeef> Well my nettyrpc does something similar just for network packets instead of routes
08:23:39FromDiscord<Elegantbeef> It's the same idea, i really should make that more pluggable to other areas
08:24:31PMunchBut I'd do `proc creatureRoute(a: CreatureId) {.route:"/creature/$i".}` and then have a `proc to(req: Request, typedesc[CreatureId]): CreatureId` proc that is responsible for getting the CreatureId out of the route
08:25:00FromDiscord<Elegantbeef> Eh fuck that
08:25:11FromDiscord<Elegantbeef> `proc creatureRoute(a: CreatureId) {.route:"/creature/$a"}`
08:25:57PMunchOr I could just do `proc creatureRoute(a: Creature) {.route:"/creature/$i".}` and my `to` proc would grab the ID, look it up in the Creature table, and pass me the object. With all the not-found logic and such in the to proc and my route just dealing with proper requests
08:26:19FromDiscord<Elegantbeef> Ah i see i thought it was about parsing
08:26:25FromDiscord<Phil> How do you assure at compile time that it explodes if you do `proc creatureRoute(a: Creature, b: string) {.route:"/creature/$i".}` ?
08:26:40FromDiscord<Elegantbeef> you dont use b so it errors?
08:26:45PMunchNot really, it's about moving the logic of understanding requests out into separate procedures
08:27:13FromDiscord<Phil> Wait, no, I'm an idiot
08:27:27FromDiscord<Phil> I mixed two very separate issues because my mind is scrambled with too many complicated problems atm
08:27:40PMunch@Phil, well it wouldn't, as long as there is a `to(req: Request, b: typedesc[string]): string` procedure
08:27:47FromDiscord<Phil> One is having extensible handlers, this is completely separate from what I do above
08:28:00FromDiscord<Phil> That's what Pmunch and I were talking about regarding Django like stuff
08:28:30FromDiscord<Elegantbeef> I should just go to my hidey hole 😛
08:28:52FromDiscord<Elegantbeef> So pmunch you got 10000 stars on your project due to TMWN right? 😛
08:28:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Ume
08:29:19FromDiscord<Phil> Ignore all my crap about wanting compile time guarantees for url having the correct params for the handler
08:29:32FromDiscord<Phil> That's entirely separate from the conversation
08:30:19PMunchMy idea is that the router would match the route to whatever comes in, then it will try to run all the `to` procs in try/catch blocks which returns nice errors (and potentially goes on to other routes), then if everything is able to be extracted from the current HTTP request then it will call the route body.
08:30:21FromDiscord<Phil> Somehow my brain jumped from "Pmunch has a thing with typesafe" to be a solution for the compile-time-guarantee problem rather than the Django-Like-extensible-Handler-Proc problem
08:30:41FromDiscord<xflywind> You can try adding a macro wrapping `addRoute`.
08:30:50PMunchYour route also just returns a single type, and it would be able to format this return type in different ways, similar to how autotemplates works
08:30:53FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3Umg
08:31:39PMunch@xflywind, yes that was my idea. Basically don't write my own web-framework, just a new router that can output either Prologue or Jester routes
08:32:08FromDiscord<Phil> Shit, macros, my weakpoint that I'm procrastinating on solving
08:32:20FromDiscord<Elegantbeef> Hey micros is progressing
08:32:43PMunch@Phil don't worry about it, macros are basically dark magic, not a lot of people master them :P
08:33:30PMunch@Elegantbeef, oh wow, just checked futhark and it has indeed gotten a nice boost in stars
08:33:34FromDiscord<Elegantbeef> Micros makes life a bit easier, just have to continue abstracting code
08:34:05PMunchhttps://star-history.com/#PMunch/futhark&Date
08:34:13FromDiscord<jmgomez> When importing types you can specify a raw pointer or the actual type, at least in clang in windows if you specify the raw pointer you cant inherit. Is there a way in nim to get a pointer of a type that's compatible with cpp raw pointers?
08:34:18FromDiscord<Phil> I'm at a point where I think a solid 40-50% of my code is generics
08:34:32FromDiscord<Phil> I'm getting to that "continue to abstract"
08:34:48FromDiscord<Elegantbeef> I've never dealt with C++ much but you can try `byref`
08:35:00FromDiscord<Elegantbeef> Good generic code is reusable code 🙂
08:36:00PMunch@Elegantbeef, so apparently the Gnome gitlab is back up
08:36:12FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/tests/test1.nim#L38-L50 cmon phil you can clearly read this
08:36:21FromDiscord<Elegantbeef> Yea pmunch i found a bundler so i got dynamic building working
08:36:24PMunchI remember I was trying to install something to try to build something for you, but I don't remember what it was I was trying to build :P
08:36:31PMunchAh right
08:36:50FromDiscord<Elegantbeef> 50MB package for 30 loc
08:37:11FromDiscord<Elegantbeef> GTK dynamic is a fucking joke for windows 😛
08:37:44PMunchHaha, yeah I remember doing something like that
08:38:02FromDiscord<Elegantbeef> No clue how small static is
08:38:08FromDiscord<Elegantbeef> Probably much much smaller
08:38:49PMunchA short Python script, couple hundred lines, and I needed to bundle it for Windows. Had to bundle in a standalone Python thing, and standalone Gtk stuff. Hundreds of files and plenty of megabytes to run some super simple logic.
08:39:10FromDiscord<Phil> Okay, g2g, need full attention on payment processes
08:39:25PMunchWell I guess with static you'd only be shipping parts of Gtk and not the whole thing
08:39:33FromDiscord<Elegantbeef> Yea
08:39:39FromDiscord<Elegantbeef> Compiler strips a ton of code
08:39:48FromDiscord<Elegantbeef> You only ship what you use type deal
08:40:13FromDiscord<Elegantbeef> Only issue is have 0 intent on testing since debian doesnt ship the libraries
08:40:25FromDiscord<Elegantbeef> Prebuild dynamic and static would be nice, but dont exist
08:40:30FromDiscord<Elegantbeef> Not even on third party repos
08:40:42FromDiscord<Elegantbeef> Debian using programmers are like "What's mingw-gtk"
08:45:56FromDiscord<jmgomez> In reply to @Elegantbeef "I've never dealt with": you prefix the type with ref? or using something else? If the former, how it differs from ptr? Also how can you dereference it?
08:46:22FromDiscord<Elegantbeef> `type MyType {.byref, pure inheritable ,... }`
08:46:27FromDiscord<jmgomez> ohh
08:46:32FromDiscord<jmgomez> thanks!
08:46:39FromDiscord<Elegantbeef> `byref` pases it by reference to procedures
08:46:46FromDiscord<Elegantbeef> It might not be what you want i guess
08:46:58FromDiscord<Elegantbeef> Like i said have never touched C++ interop so no clue what's required
08:47:14FromDiscord<jmgomez> Not sure, Im just evaluating options. Im glad that's an option because otherwise too many copies
08:47:34FromDiscord<Elegantbeef> Eh Nim passes by ref when it should for performance anyway
08:48:27FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/La2
08:48:36FromDiscord<jmgomez> I mean when doing interop with cpp
08:48:44FromDiscord<Elegantbeef> Or i guess `MyCppType = ptr MyCppType`
08:48:53FromDiscord<Elegantbeef> `MyCppType = ptr object`
08:49:18FromDiscord<Elegantbeef> I'm mostly speaking out my arse, so dont hold me accountable if any of this doesnt work
08:49:36*koltrast quit (Ping timeout: 268 seconds)
08:49:40FromDiscord<jmgomez> Okay, I appreciate it. Do you know how to travel from Object to Ptr and back?
08:49:55FromDiscord<Elegantbeef> `[]` to dereference and `addr` to get the address
08:52:52FromDiscord<jmgomez> addr got working but where the [] supposed to be? doesnt seem to work as prefix
08:53:00FromDiscord<Elegantbeef> postfix
08:53:24FromDiscord<jmgomez> ohh a bit odd but that works!
08:53:39FromDiscord<Elegantbeef> Eh it's consistent imo
08:53:56FromDiscord<Elegantbeef> array indexing is pointer dereferencing, sequence dereferencing is you guessed it a form of pointer dereferencing 😛
08:54:13FromDiscord<jmgomez> that's true
08:54:21FromDiscord<Elegantbeef> It's better than `` i think
08:54:36FromDiscord<Elegantbeef> though nim is nothing if not extensible so could always have a `deref(a)`
08:54:54*koltrast joined #nim
08:55:03FromDiscord<jmgomez> maybe it is, but I and assume most people are used to it
08:55:15FromDiscord<jmgomez> yeah, that's the second major selling point of nim
08:55:31FromDiscord<Elegantbeef> Hey if you came from pascal you'd expect `^`
08:57:16FromDiscord<jmgomez> unrelated question, when doing FFI in other langs (i.e. rust) you have to call the deallocator in the lang that did the allocation. I assume in nim, as long as you use it in the same lang as target, it isnt the case?
08:57:54FromDiscord<Elegantbeef> Uhh no clue like i said I havent interoped with C++
08:57:59FromDiscord<Elegantbeef> I imagine you dont
08:58:19FromDiscord<Elegantbeef> C you very much dont have automatic memory management and JS is well GC'd
08:58:39FromDiscord<jmgomez> 👍
08:58:47FromDiscord<ShalokShalom (ShalokShalom)> > unrelated question, when doing FFI in other langs (i.e. rust) you have to call the deallocator in the lang that did the allocation. I assume in nim, as long as you use it in the same lang as target, it isnt the case?↵If you are looking for a language to interop with Rust, I recommend you to look for Gluon.
08:58:57FromDiscord<Elegantbeef> That's not what they asked
08:59:15FromDiscord<Elegantbeef> Nim does have destructors if that isnt the case you can map to the proper ones if need be
08:59:36FromDiscord<ShalokShalom (ShalokShalom)> You can call Rust functions natively https://github.com/gluon-lang/gluon#gluon=
08:59:41FromDiscord<jmgomez> Thank but nope, Im looking at lang to interop with Cpp. Rust does not does a good job there
08:59:48FromDiscord<jmgomez> (it does with c though)
08:59:58FromDiscord<Elegantbeef> D and Nim are like the only ones that do C++ interop
09:00:08FromDiscord<ShalokShalom (ShalokShalom)> Ah, I see.
09:00:18FromDiscord<ShalokShalom (ShalokShalom)> Lua? 😛
09:00:44FromDiscord<Elegantbeef> We'll say sure but that's not a system language so you're getting a D
09:00:47FromDiscord<ShalokShalom (ShalokShalom)> Yeah, I think Nim is great for that use case.
09:01:30*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:02:26FromDiscord<jmgomez> I think so! Just evaluating it so far. One concern though is on the headers files that I will need to include in the cpp side, didnt reach that point yet. But for consuming cpp is crazy good so far
09:03:00PMunchAt some point I hope to add C++ support to Futhark
09:03:13FromDiscord<Elegantbeef> What a brave soul
09:03:40NimEventerNew thread by JPLRouge: Impure libraries ???, see https://forum.nim-lang.org/t/9074
09:04:21FromDiscord<lily & violet> Hi. I'm having trouble passing flags to `nim` from `nimble`, is there a way to do it without having to call manually `nim`?
09:04:32FromDiscord<Elegantbeef> make a config.nims
09:04:33FromDiscord<jmgomez> In reply to @PMunch "At some point I": didnt know about Futhark, seems really good
09:05:21FromDiscord<lily & violet> In reply to @Elegantbeef "make a config.nims": How am I supposed to use it for my case?
09:05:29FromDiscord<Elegantbeef> What do you mean?
09:05:37*ltriant_ joined #nim
09:05:47FromDiscord<lily & violet> Where do I put the file, and what do I put in it? :o
09:05:53FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/6vG
09:06:01FromDiscord<Elegantbeef> Put it next to your `.nimble`
09:06:08FromDiscord<lily & violet> Okay
09:06:28FromDiscord<Elegantbeef> long form command line arguments will work int
09:06:52*ltriant quit (Ping timeout: 268 seconds)
09:07:37FromDiscord<lily & violet> Running `nimble run` doesn't change the `nim` invocation tho
09:07:50FromDiscord<lily & violet> even with `config.nims` right beside the .nimble file
09:07:53PMunch@jmgomez, it's fantastic, I've wrapped multiple libraries with it and for most of them it just works
09:08:25FromDiscord<Elegantbeef> it should run with the arguments iin the nims file
09:09:01FromDiscord<Elegantbeef> What does your config look like
09:09:20FromDiscord<lily & violet> sent a code paste, see https://play.nim-lang.org/#ix=3Umy
09:10:27FromDiscord<Solitude> place config.nims in the same directory as your main nim file.
09:10:55FromDiscord<Elegantbeef> I guess with a weird structure it can be at the root?
09:11:02FromDiscord<lily & violet> those two flags still doesn't show up
09:11:16FromDiscord<Elegantbeef> can't\
09:11:37FromDiscord<lily & violet> My folder structure is the default one after calling nimble init tho
09:12:15FromDiscord<Elegantbeef> Odd
09:13:15FromDiscord<Elegantbeef> Full output of `nimble run --verbose`?
09:14:10FromDiscord<lily & violet> :NLRfacepalmpicard:
09:14:14FromDiscord<lily & violet> It works
09:14:24FromDiscord<lily & violet> The flags are just not added to the command line apparently
09:14:43FromDiscord<lily & violet> Thanks for the help
09:15:36FromDiscord<Elegantbeef> No problem
09:20:32FromDiscord<jmgomez> can nim generate a cpp library (not c, but cpp, so no extern)
09:20:39FromDiscord<jmgomez> (edit) "extern)" => "extern)?"
09:21:00FromDiscord<Elegantbeef> I dont think so
09:22:04FromDiscord<jmgomez> so you can only embed it into a cpp either by the C library path or by adding the generated cpp (files which arent supposed to be used)?
09:22:29FromDiscord<Elegantbeef> I believe so, i could be wrong
09:22:49FromDiscord<Elegantbeef> You could do something like genny and emit C++ headers i think
09:24:24FromDiscord<jmgomez> ok, will check it out
09:25:19FromDiscord<Elegantbeef> There's also the forum which will probably get more concrete answers
09:26:10FromDiscord<Elegantbeef> I mention it as i'm going to sleep now 😛
09:26:41FromDiscord<jmgomez> hahah thanks!
09:34:10FromDiscord<lily & violet> I'm using VSCode with the Nim extension (v0.6.6, by Konstantin Zaitsev). Is it normal if i'm not getting any autocompletion from 3rd party packages?
09:34:43FromDiscord<lily & violet> It apparently uses NimSuggest
09:39:45FromDiscord<Solitude> anything wrong happening with nimsuggest is normal, but you could also try another extension by saem
09:41:00FromDiscord<lily & violet> Yes okay, thanks
09:41:45*jmdaemon quit (Ping timeout: 248 seconds)
10:21:19FromDiscord<TryAngle> hello,↵is there a function to read memory of a process?
10:27:58FromDiscord<Zoom> This gets Cringe of the Day award↵(@ShalokShalom)
10:29:04PMunch@TryAngle, probably have to call some C procedure to do that
10:30:37FromDiscord<TryAngle> In reply to @PMunch "<@147447489316913152>, probably have to": 🥲
10:30:54FromDiscord<TryAngle> alright, I also looked through winim and coulnd't find memoryapi or this specific function there
10:32:10FromDiscord<Zoom> @TryAngle\: https://github.com/khchen/winim/blob/b7b32603f4ef672bc34405bc6200e8aab2c366b1/winim/inc/winbase.nim#L1871
10:32:33FromDiscord<TryAngle> In reply to @Zoom "<@147447489316913152>\: https://github.com/khchen/w": 🥺 ↵omg thank u
10:32:43FromDiscord<TryAngle> how did u find it?
10:32:53FromDiscord<TryAngle> github search functionality never works for me
10:33:02FromDiscord<TryAngle> (edit) "github search functionality never works for me ... " added "😐"
10:34:29FromDiscord<Zoom> I used human-assisted search.
10:44:27FromDiscord<aph> ~~meanwhile discord:~~ https://media.discordapp.net/attachments/371759389889003532/960852411390525490/unknown.png
10:44:32FromDiscord<aph> lol
10:45:10FromDiscord<Rika> Here we go again
10:54:04PMunch@Rika, haha I think they just found it funny that someone with the bot tag said they used human-assisted search
10:54:19PMunchBut yeah, I wish we could add some kind of disclaimer for Discord users :P
10:57:00FromDiscord<Zoom> That was insulting. I'm not on Discord.↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
10:57:32PMunch@Zoom, no I meant @aph, who appears to be on Discord
10:57:51PMunchA lot of Discord users come in here and complains that they only get answers from bots :P
10:58:37PMunchHmm, I'm trying to wrap a nice wrapper for Coap
10:58:46FromDiscord<Zoom> Ah, sorry. My jokes rarely fly due to me being not-quite-sharp...
10:59:23PMunchThe coap library requires you to call `coap_startup()` and then later you do `var ctx = coap_new_context()`
10:59:41FromDiscord<Zoom> So, what syntax would you guys use to take a set of key-value pairs as a program argument? Please, don't say "use a config file".
11:00:17PMunchNow `coap_startup()` has a simply check to see if it has already been started, so I'm considering to just throw it into my `newContext` procedure as it would likely only be called once anyways
11:00:20PMunchThoughts?
11:00:42PMunchThe problem is that you also have coap_cleanup..
11:01:02PMunchAnd calling that from the context destructor might mess things up..
11:02:48FromDiscord<Rika> In reply to @Zoom "So, what syntax would": “Use a config file”
11:03:04FromDiscord<Rika> I mean what else would you want
11:03:20FromDiscord<Rika> If you want to take in command line arguments you can go to the simplicity of key=value
11:03:29FromDiscord<Rika> Or environment variables
11:03:38FromDiscord<Rika> If you’re extra caveman
11:05:09PMunchOh huh, the coap_new_context actually calls the coap_startup thing itself..
11:10:17FromDiscord<TryAngle> I'm having huge issues with c libraries 😭↵I'm on windows↵I use nimgui, a dear Imgui wrapper library that uses c imgui
11:10:30FromDiscord<TryAngle> (edit) "nimgui," => "nimgl/imgui,"
11:10:48FromDiscord<TryAngle> i'm getting the error: `could not load: cimgui.dll`
11:12:18FromDiscord<TryAngle> here is the definition of cimgui in that project https://github.com/nimgl/imgui/tree/master/src/imgui/private
11:12:41FromDiscord<TryAngle> but how would I make this work 🥺 I have 0 clue
11:17:25FromDiscord<Rika> Get the dll and put it by the binary
11:18:28PMunch@TryAngle, switch to an OS with proper library handling
11:18:41PMunchOr just put the DLL in the same folder as the binary
11:19:07PMunchAlthough I highly recommend the first option, slightly painful to begin with, but so worth it
11:22:37FromDiscord<Rika> Doubt it’s in his control
11:34:37FromDiscord<TryAngle> In reply to @PMunch "<@147447489316913152>, switch to an": I want, I'm already expereinced with linux↵but I play video games that are not available on linux 😦↵so I waint until I have a second gpu so I can passthrough
11:35:50FromDiscord<Solitude> In reply to @PMunch "<@147447489316913152>, switch to an": you are lucky araq is not in this chat
11:37:06PMunch@TryAngle, you should give it a try with Proton, it's surprisingly good. I was able to play Elden Ring the same week it came out
11:37:22PMunch@Solitude, haha I'd be banned for hate speech
11:43:26FromDiscord<TryAngle> In reply to @PMunch "<@147447489316913152>, you should give": league of legends 😦
11:44:07PMunchHaven't tried it
11:44:35FromDiscord<Solitude> man, league works perfectly fine on linux
11:45:45FromDiscord<TryAngle> In reply to @Solitude "man, league works perfectly": 😳
11:45:47FromDiscord<TryAngle> how ?
11:45:48FromDiscord<TryAngle> lol
11:46:08FromDiscord<TryAngle> Wine?
12:01:06FromDiscord<Zoom> I am and proudly so.↵I'll go with `--arg=a:1,b:foo,c:42`↵(@Rika)
12:03:38*koltrast quit (Ping timeout: 260 seconds)
12:06:26*zeus-supreme joined #nim
12:08:14FromDiscord<jmgomez> hey guys, In mac it seems to work fine but in windows there is no intellisense? Any idea of what can be going on? https://media.discordapp.net/attachments/371759389889003532/960873496542593024/unknown.png
12:09:21FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Un2
12:09:37FromDiscord<Zoom> Please, if you think screenshots are necessary, at least crop them to the relevant bit. Thanks a lot.
12:09:59FromDiscord<jmgomez> Sure
12:10:14FromDiscord<Zoom> Len returns the bytes, basically, not the UTF runes↵(@hmmm)
12:10:21FromDiscord<hmmm> oh
12:10:30FromDiscord<hmmm> hmmm
12:11:00FromDiscord<hmmm> so the à bytes are doubly the fat of the q bytes?
12:11:13FromDiscord<enthus1ast> you can try to use https://nim-lang.org/docs/unicode.html#runeLen%2Cstring
12:11:38FromDiscord<hmmm> that's what I wanted! ty enthy
12:11:42FromDiscord<hmmm> and zoom
12:14:26FromDiscord<konsumlamm> note that `runeLen` is slower than `len`, as it has to iterate over the whole string
12:15:13FromDiscord<hmmm> noted
12:18:16FromDiscord<Zoom> !eval echo "qqqà".toSeq()↵(@hmmm)
12:18:18NimBotCompile failed: /usercode/in.nim(1, 13) Error: attempting to call undeclared routine: 'toSeq'
12:19:48FromDiscord<enthus1ast> @['q', 'q', 'q', '\\xC3', '\\xA0']
12:20:53FromDiscord<Zoom> Yeah, though prelude is imported by default
12:26:05PMunch@hmmm, UTF-8 is pretty neat. One byte can typically only hold 256 characters, but the unicode standard has 1,112,064 code points, so how does that work? Essentialy if the first bit of the character is 1 then it needs to read more bytes. You know how many bytes to read by the amount of 1's before the first 0. For two bytes the number starts with 110, for three it starts with 1110 and for four it starts with 11110. Then the following bytes all start with 10. The
12:26:05PMunchrest of the bits are the data used for the character.
12:26:48FromDiscord<Zoom> @hmmm\: read this https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/
12:27:12FromDiscord<Zoom> and Rust had a nice chapter on UTF strings. Just skip the part about slicing and all
12:27:17PMunchThis of course means that in order to read the length of a UTF-8 string you need to iterate over the entire string character by character and decide how many characters to not count.
12:28:04FromDiscord<hmmm> or use runelen that does that for you right? 🤔
12:28:17PMunchYes, that is what runeLen does
12:28:59FromDiscord<Zoom> https://doc.rust-lang.org/book/ch08-02-strings.html#internal-representation - Rust's string is basically a seq of Runes, not a seq of Chars, like Nim's string.
12:29:35FromDiscord<hmmm> so it's fatter but it's len and runelen are the same thing?
12:30:31FromDiscord<enthus1ast> the (byte) len is already stored in a nim string and can therefore just returned, the runelen must be computed for the call
12:31:02FromDiscord<hmmm> oh that's cool I didn't know a string had len built in
12:31:02FromDiscord<Zoom> It's not fatter, it just more abstract and doesn't support treating itself like a plain sequence every time.↵(@hmmm)
12:31:23FromDiscord<Rika> There’s no reason you can’t make a string that’s Unicode by default and stores the rune length internally, no one has done it is all
12:31:23FromDiscord<enthus1ast> len and \\0
12:31:33FromDiscord<enthus1ast> like if pascal and c had a baby
12:31:37FromDiscord<Zoom> That's because Nim's string is currently just a seq, and seq has a length as a field↵(@hmmm)
12:31:43PMunchOf course it gets a bit more complicated than that if you need to know things like how many glyphs will be displayed, because unicode also has what's called a zero-width joiner. This is how it supports emojis with multiple people and interactions. Skin colour for emoji is another thing that counts as another code-point but doesn't take up a glyph of its own.
12:32:21FromDiscord<Zoom> Programming sucks - even strings are hard. /s
12:32:53FromDiscord<enthus1ast> languages are hard
12:32:59FromDiscord<enthus1ast> human interaction
12:33:53FromDiscord<Rika> Abolish all languages
12:34:03FromDiscord<Rika> Go back to never interacting with each other
12:35:05FromDiscord<lpha3ch0> sent a code paste, see https://play.nim-lang.org/#ix=3Un7
12:35:34FromDiscord<lpha3ch0> I'm guessing that malicious actors are using wAuto for malware.
12:36:36FromDiscord<Rika> Wouldn’t be surprised
12:38:02PMunch@lpha3ch0, please report these as false positives to the antivirus vendor. That's the only way this will eventually get better
12:38:54PMunchMalicious actors are using Nim for malware, and honestly I don't even blame them, it's a very good fit for malware. But it means that most antivirus vendors have started to aggressively fingerprint almost everything written in Nim as a virus..
12:42:43FromDiscord<Phil> Out of curiosity. I've heard of "null-terminated strings". What are the actually used alternatives to those?
12:43:02FromDiscord<Phil> non-terminated strings?
12:44:55PMunch@Phil, well length delimited characters are the most common alternative
12:45:28FromDiscord<Solitude> In reply to @lpha3ch0 "It's getting harder and": delete windose
12:45:37FromDiscord<Recruit_main707> In reply to @PMunch "Malicious actors are using": Any low-as-c level language is just as good for malware isn't it?↵The reason they go for niche languages is they are relatively unused
12:45:49PMunchThe DNS protocol for example stores play.nim-lang.org as `<4>play<8>nim-lang<3>org`
12:46:32FromDiscord<Phil> Hmmm interesting, so null-terminated strings save you a byte on storing a length
12:46:52FromDiscord<Rika> not really
12:46:52FromDiscord<Phil> And I guess are more flexible because you can just move the null-terminator back
12:46:58FromDiscord<Rika> since theres the null terminator byte 🙂
12:47:08FromDiscord<Phil> Ah, fair,hmm
12:47:24PMunch@Phil, and Nim of course stores the length of a string as well as null terminating. The .len operator in Nim just returns the length of the string (and can contain more null characters), but the null termination is kept in place to make .cstring essentially just be a dereference operation (otherwise the string would need to be copied over to a 1 byte larger memory region with an extra null byte).
12:47:42FromDiscord<Solitude> In reply to @Isofruit "And I guess are": thats just as flexible as decrementing length field
12:48:25PMunchNull terminated strings made a lot of sense back when memory was super scarce and storing a 16 or 32 bit length for each string was seen as too much waste
12:49:04FromDiscord<Phil> I assume C has both types of strings?
12:49:07PMunchIt also makes a lot of sense with how arrays in C work
12:49:10FromDiscord<Rika> they make sense if your strings were under 256 character length lol otherwise just use a byte for the length man...
12:49:15PMunchNope, C doesn't really have a string type
12:49:17FromDiscord<Rika> In reply to @Isofruit "I assume C has": yes
12:49:19FromDiscord<Rika> technically
12:49:23FromDiscord<Rika> in common use yes
12:49:40PMunchIt uses a pointer to a character as a string, and then the convention is to read until it finds a null byte.
12:50:16PMunchBut since this can be very insecure it is common to have a length field as part of the signature of any function which uses a string argument
12:50:37PMunchBut it doesn't have one common length-delimited string type
12:54:21FromDiscord<federico3> "it" being C? I know
12:54:50FromDiscord<lpha3ch0> In reply to @Solitude "delete windose": I tried to delete Windows, but my laptop hardware is very new and I couldn't get everything working on Linux even after spending days tweaking everything. The last straw before switching back to Windows was my wireless connection would randomly stop working while still showing connected. I would have to disable and reenable wifi to resume working.
13:00:10FromDiscord<Zoom> There was a time when you could just swap that wifi card for one with working drivers. I suppose now it's all soldered in.
13:00:42PMunchThat's the scariest thing about buying a laptop nowadays
13:00:58PMunchTrying to find one that works well with Linux without being able to test it out first
13:01:18FromDiscord<Rika> lenovo has laptops that ship with linux lol
13:01:31FromDiscord<enthus1ast> the one i sent is a linux notebook manufacturer
13:01:41FromDiscord<enthus1ast> tuxedocomputers.com
13:02:47PMunch@Rika, which is why my laptop is a Thinkbook
13:02:57PMunch@enthus1ast, I assumed as much when I saw that name :P
13:03:05FromDiscord<lpha3ch0> Thinkbooks and System76 are usually a good bet for Linux compatibility.
13:03:20FromDiscord<Rika> ive a thinkpad but i dont have linux on it... yet
13:03:21FromDiscord<lpha3ch0> But in my case I had to take what I was issued for the work laptop.
13:03:39FromDiscord<lpha3ch0> ... even if I was allowed to reimage with whatever I wanted.
13:03:53PMunchOf course I also use Dvorak, so the Thinkpad track-nub is a bit of a nuisance..
13:04:08PMunch@lpha3ch0, you ask for permission?
13:05:30FromDiscord<Zoom> Well, if it's free for you and the only issue is wifi, I'd just used a dongle.↵(@lpha3ch0)
13:06:11FromDiscord<lpha3ch0> In reply to @PMunch "<@275045322705862656>, you ask for": No
13:07:10FromDiscord<enthus1ast> I would love to have a Lenovo T60 with modern hardware
13:07:37FromDiscord<enthus1ast> best overall machines i've used so far
13:08:42FromDiscord<enthus1ast> but lenovo lost my trust with their strange "press down as hard as you can" touchpads
13:09:20FromDiscord<Phil> In reply to @lpha3ch0 "I tried to delete": Ohhh what's your wireless card? Intel? Or ... was the other one Realtek or sth?
13:11:00PMunch@enthus1ast, press down as hard as you can touchpads?
13:11:47FromDiscord<enthus1ast> they thought it would be a good idea to have a touchpad, that instead of "touching" you had to press like a big button
13:12:19PMunchOh right, I actually kind of like that (on my T480s), gives a nice feedback
13:12:24FromDiscord<Phil> Work provided me a Thinkbook that came out... a year ago? 1.5? Something like that, ubuntu is doing surprisingly well on that one.↵Thus I'd be curious what hardware you have just so I can be aware which HW tends to have issues
13:12:50FromDiscord<TryAngle> In reply to @Rika "Get the dll and": hmmm to get the .dll I think I have to "make" the project
13:13:02PMunchThe T480s works perfectly
13:13:55FromDiscord<enthus1ast> the drivers back then where so bad, they sometimes moved the mouse to the upper right corner and pressed the mouse button 3 times. (for example when you put your palm on it). Lost a bunch of work because of this bug.↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
13:14:51FromDiscord<Vindaar> tapping on touchpads to click is the absolute worst imo
13:14:59FromDiscord<Vindaar> physical click all day
13:15:12FromDiscord<enthus1ast> gave me 3 Month "holidays"↵(@Vindaar)
13:15:19FromDiscord<enthus1ast> because of RSI syndrom
13:16:43PMunchTBH I mostly use the track-nub anyways
13:16:49PMunchOr just keyboard shortcuts
13:20:20NimEventerNew thread by ErikWDev: Changing order of templates causes compilation error. Why in this case?, see https://forum.nim-lang.org/t/9075
13:22:53FromDiscord<Vindaar> In reply to @enthus1ast "gave me 3 Month": sorry to hear that, but that sounds like wrong tool for the job
13:24:50*rockcavera joined #nim
13:24:50*rockcavera quit (Changing host)
13:24:50*rockcavera joined #nim
13:25:34FromDiscord<enthus1ast> sure it was, but back then i had no other choice, lenovo was kfc standart
13:25:36FromDiscord<enthus1ast> had never heard about RSI before it hit me though \:)
13:39:11FromDiscord<TryAngle> anybody here knows how to compile libraries via make to .dll so nim can use them? 🥺
13:39:20FromDiscord<TryAngle> I'm too stupid to understand c ecosystem
13:41:30PMunchIt all depends on what the Makefile contains
13:42:22PMunchThe make program is just a way to run tasks laid out in a Makefile. And Makefiles themselves are essentially just a bunch of recipes to create files
13:42:55*SamuelMarks joined #nim
13:43:54FromDiscord<TryAngle> https://github.com/nimgl/cimgui#compilation
13:44:06FromDiscord<TryAngle> I used GnuWin32 to compile it via make
13:44:18FromDiscord<TryAngle> (edit) "GnuWin32" => "GnuWin32's make" | removed "via make"
13:44:35FromDiscord<TryAngle> but I get this error: `could not load: cimgui.dll`
13:44:55FromDiscord<TryAngle> https://media.discordapp.net/attachments/371759389889003532/960897827670724628/unknown.png
13:48:42FromDiscord<Rika> how do you run the exe
13:48:51FromDiscord<TryAngle> In reply to @Rika "how do you run": nimble run
13:49:18FromDiscord<Rika> can you try running the exe directly
13:49:35FromDiscord<TryAngle> same error
13:49:54FromDiscord<Anuke> I get the following error when attempting to compile the vscode-nim extension:↵> `elrpc.nim(6, 18) Error: cannot open file: nimsuggest/sexp`↵How do I install nimsuggest sources correctly? It's not a standard nimble package. Nim was installed through choosenim on my machine.
13:50:15FromDiscord<enthus1ast> has the dll the same bitwitdh?
13:50:30FromDiscord<enthus1ast> 32/64
13:50:32FromDiscord<enthus1ast> ?
13:50:42FromDiscord<TryAngle> In reply to @enthus1ast "has the dll the": how do I know that?
13:50:55FromDiscord<enthus1ast> i mean, you compiled both \:)
13:52:14FromDiscord<TryAngle> I literally have 0 clue 😭
13:52:29FromDiscord<TryAngle> I did ↵`make -IMGUI_STATIC` in cimgui directory and took the generated dll
13:52:45PMunchThat's definitely not correct
13:52:46FromDiscord<TryAngle> on my nim project I do `nimble run`
13:53:02PMunchSTATIC probably means it's meant for static linking
13:53:14PMunchThe fact that that even produced a dll is a bit surprising
13:53:36PMunch@Anuke, nimble install compiler perhaps?
13:53:53FromDiscord<TryAngle> In reply to @PMunch "STATIC probably means it's": I thought that's what I have to do o_O
13:54:03FromDiscord<Rika> its not
13:54:08FromDiscord<Rika> dlls are for dynamic linking
13:54:09FromDiscord<Anuke> In reply to @PMunch "<@123539225919488000>, nimble install compiler": That worked, thanks.
13:55:32FromDiscord<TryAngle> In reply to @Rika "dlls are for dynamic": ok I just did only `make` took the dll and same error 😭
13:56:32FromDiscord<enthus1ast> 1. check if the dll hase same bittness like your nim app\:↵↵`file the.dll`↵`file the.exe`
13:56:33FromDiscord<Rika> did you make on mingw
13:57:03FromDiscord<TryAngle> In reply to @Rika "did you make on": http://gnuwin32.sourceforge.net/packages/make.htm↵I used this
13:57:08FromDiscord<enthus1ast> 2. check where your application searches the dll\:↵↵`strace the.exe`and look for open and or the dll name
13:57:24FromDiscord<Rika> can you use mingw instead
13:58:55FromDiscord<TryAngle> In reply to @enthus1ast "1. check if the": how do I do that o_O https://media.discordapp.net/attachments/371759389889003532/960901353436221500/unknown.png
13:59:04FromDiscord<TryAngle> In reply to @Rika "can you use mingw": I will look up that
13:59:57FromDiscord<enthus1ast> yes that looks good↵(@TryAngle)
14:00:00FromDiscord<TryAngle> In reply to @Rika "can you use mingw": what mingw do u use? do u even use windows for that?
14:00:05FromDiscord<enthus1ast> now try the strace
14:00:09FromDiscord<Rika> what do you mean "what mingw"
14:00:27PMunchIs there a particular reason why you're trying to use it as a DLL? I thought imgui was the kind of library you just compiled into your program
14:00:28FromDiscord<Rika> try what en is telling you first
14:00:40FromDiscord<Rika> cimgui is not
14:00:44FromDiscord<Rika> well
14:00:45FromDiscord<Rika> it can
14:00:48FromDiscord<TryAngle> In reply to @PMunch "Is there a particular": I want to use nimgl
14:00:52FromDiscord<Rika> i guess he didnt use it here tho
14:01:30FromDiscord<TryAngle> In reply to @TryAngle "I want to use": https://github.com/nimgl/nimgl/blob/master/examples/timgui.nim↵I try to run this example
14:02:19FromDiscord<TryAngle> In reply to @Rika "what do you mean": msys2, cygwin, mingw-w64 builds, llvm-mingw
14:03:37FromDiscord<TryAngle> In reply to @Rika "i guess he didnt": waht do you mean 🤔
14:04:47*arkurious joined #nim
14:10:50FromDiscord<enthus1ast> can you also post the output of`strace the.exe`↵?↵Then we know if the application at least pick up the dll
14:12:58*PMunch quit (Quit: Leaving)
14:13:46FromDiscord<enthus1ast> should then look like this\:`--- Process 22032 loaded C:\Users\david\projects\nimSubmission\src\tmpls.dll at 0000000064c40000 `
14:14:05FromDiscord<TryAngle> In reply to @enthus1ast "can you also post": hmmm I tried strace on linux but it doesn't work 🤔
14:14:54FromDiscord<TryAngle> https://media.discordapp.net/attachments/371759389889003532/960905374179942460/unknown.png
14:15:34FromDiscord<enthus1ast> is this msys?
14:15:46FromDiscord<TryAngle> In reply to @enthus1ast "is this msys?": i'm doing that command from wsl
14:17:33FromDiscord<enthus1ast> git for windows also ships with strace
14:17:47FromDiscord<enthus1ast> in a bash it must be\:↵↵strace ./your.exe
14:18:02FromDiscord<TryAngle> I don't have strace on windows
14:18:21FromDiscord<TryAngle> In reply to @enthus1ast "in a bash it": that woks though on wsl
14:18:37FromDiscord<enthus1ast> its harder to see though
14:18:47FromDiscord<enthus1ast> but you should see an open call to the dll
14:19:36FromDiscord<enthus1ast> or several tries, then you know where the exe is searching for the dll
14:19:54FromDiscord<TryAngle> sent a code paste, see https://paste.rs/aTi
14:20:10FromDiscord<enthus1ast> before this somewhere
14:21:58FromDiscord<TryAngle> In reply to @enthus1ast "before this somewhere": there is no other `cimgu`, `cimgui`, `dll`
14:26:43FromDiscord<enthus1ast> yes it seems the wsl strace does not work
14:30:22*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
14:31:28FromDiscord<TryAngle> anyways, thanks for trying to help me enthusiast rika and pmunch,↵but I seem to lack intelligence to work with anything c / c++ related↵I quit.
14:32:15FromDiscord<enthus1ast> or, get the strace from git 4 win (all the tools in this git distro, are worth it any way), the find out more \:)
14:32:20*Lord_Nightmare joined #nim
14:32:24FromDiscord<enthus1ast> then
14:38:23FromDiscord<enthus1ast> i've tried wtrace from here\: https://github.com/lowleveldesign/wtrace/releases/tag/3.2-fix_chocolatey
14:38:40FromDiscord<enthus1ast> it outputs this for my test\:↵16\:37\:03.6621 server (31016.39280) FileIO/Create 'C\:\\Users\\david\\projects\\nimSubmission\\src\\tmpls.dll' disposition\: OPEN\_EXISTING, options\: 0x200000 -\> SUCCESS
14:42:40FromDiscord<tandy> https://github.com/tandy-1000/api-binding-template
14:42:46FromDiscord<tandy> if anyone needs to make API bindings in Nim...
14:51:23*koltrast joined #nim
15:14:23*SamuelMarks quit (Ping timeout: 246 seconds)
15:19:17Amun-Ratandy: I was expecting Tandy 1000 emulator somewhere in those repos ;>
15:27:54FromDiscord<tandy> lol
15:28:06Amun-Raso dissapointed ;>
15:28:19Amun-Rahmm, disappointed* ;>
15:41:10*SamuelMarks joined #nim
15:42:59FromDiscord<jmgomez> hey guys, can you call a nims file from a nimble task?
15:43:08FromDiscord<jmgomez> (edit) "nims" => ".nims"
15:43:33*PMunch joined #nim
15:43:47FromDiscord<exelotl> you can by invoking `nim e`, for example: `selfExec "e myfile.nims"`
15:44:28FromDiscord<exelotl> it's a bit slow though since it has to start up another `nim` process (I think)
15:45:03FromDiscord<exelotl> or at least, the overhead of initialising the vm is high
15:45:37*slowButPresent joined #nim
15:45:55*SamuelMarks quit (Ping timeout: 260 seconds)
15:45:56FromDiscord<exelotl> oh, as a _nimble_ task I'm not 100% certain but I think what I mentioned should still work
15:46:36FromDiscord<exelotl> alternatively, you could maybe `include` the file to run it in-place
15:47:10FromDiscord<jmgomez> okay, thanks!
15:52:34PMunch@exelotl, yes initialising the VM is a bit slow, but the execution is relatively quick. So if you want to run multiple things I'd recommend using something like nimscripter
15:53:44*jjido joined #nim
15:56:02FromDiscord<exelotl> for my project I use the `include` approach so I can just run `nim build` and it executes a bunch of scripts without needing to spin up the VM for each one
15:56:13FromDiscord<exelotl> uhh here's where I posted about it: https://forum.nim-lang.org/t/8826#57556
15:56:35FromDiscord<Rika> https://fglt.nl/guides/visual-novels-on-gnu-linux.html
15:56:38FromDiscord<Rika> fuuuuuuck
15:56:43FromDiscord<Rika> wrong send 🙂
16:04:42*zeus-supreme1 joined #nim
16:07:55*zeus-supreme quit (Read error: Connection reset by peer)
16:15:27*SamuelMarks joined #nim
16:15:56FromDiscord<jmgomez> does --outdir:DIR supposed to work with app:lib?
16:19:01NimEventerNew thread by Archnim: Managing binary data, see https://forum.nim-lang.org/t/9076
16:19:13FromDiscord<jmgomez> it does, I had the order misplaced
16:20:09*SamuelMarks quit (Ping timeout: 248 seconds)
16:29:04*xet7 quit (Remote host closed the connection)
16:33:27*xet7 joined #nim
16:35:03NimEventerNew thread by Archnim: My history on Nim forum, see https://forum.nim-lang.org/t/9077
16:42:24*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
16:47:36*jmdaemon joined #nim
16:56:20*ozzz is now known as om3ga
16:58:08*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
16:58:26*jmdaemon joined #nim
17:23:51*Gustavo6046 joined #nim
17:25:28*Gustavo6046 quit (Remote host closed the connection)
17:25:52*Gustavo6046 joined #nim
17:37:41PMunchHmm, is there a way to manually alloc and dealloc a table?
17:45:53*SamuelMarks joined #nim
17:52:51*PMunch quit (Quit: leaving)
17:59:23FromDiscord<demotomohiro> `initTable` proc has `initialSize` parameter to specifiy initial internal heap size.
18:02:37*jjido joined #nim
18:03:35FromDiscord<demotomohiro> And there is `clear` proc for table.
18:04:56*Gustavo6046 quit (Remote host closed the connection)
18:05:50*Gustavo6046 joined #nim
18:11:20NimEventerNew thread by Jocker: Threading SIGSEGV in HttpClient with SSL, see https://forum.nim-lang.org/t/9078
18:15:13*vicfred joined #nim
18:28:41Amun-Rais there an equivalent of python's raise StopIteration? as in: https://play.nim-lang.org/#ix=3Up6
18:29:48FromDiscord<Rika> you usually store `next` in a var and query `next.finished` to see if it has finished
18:30:13Amun-Raoh
18:30:23FromDiscord<Rika> or you could just use `for i in next(): ` too i believe
18:30:43FromDiscord<Rika> yup
18:30:56Amun-RaI need to call it once or twice during one loop pass
18:31:20FromDiscord<Rika> wait here then
18:31:25FromDiscord<Rika> im gonna test something
18:31:44Amun-RaI could make a state machine but that way is easier
18:31:55FromDiscord<Rika> no no, i just checked you dont need to store next in a var
18:32:01FromDiscord<Rika> `next.finished`
18:32:15Amun-Ranice, thanks
18:32:34FromDiscord<Rika> i JUST noticed next is a var which is why it worked
18:32:40FromDiscord<Rika> i thought it was an iterator decl
18:32:41FromDiscord<Rika> so xd
18:32:41FromDiscord<Rika> yeah
18:33:54Amun-Ra:>
18:36:03Amun-Rait still returns one 0 before setting finished
18:36:28FromDiscord<Rika> break at the start haha
18:36:32FromDiscord<Rika> not the end of the loop
18:37:03FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Upa
18:37:25Amun-RaRika: https://play.nim-lang.org/#ix=3Up6
18:37:46FromDiscord<Rika> you sent the same link haha
18:38:04Amun-Rahmm
18:38:29Amun-RaRika: https://play.nim-lang.org/#ix=t%20wr
18:38:45FromDiscord<Rika> uhhhhhhh
18:38:47FromDiscord<Rika> link broke
18:38:53FromDiscord<Rika> might need to regenerate the link
18:39:01FromDiscord<demotomohiro> In reply to @jmgomez "Hey guys, any idea": Can you run that command with `--listcmd` that shows how Nim call gcc and linker.
18:39:57Amun-RaRika: https://play.nim-lang.org/#ix=3Upc (tested ;)
18:40:40FromDiscord<Rika> hmm i remember there being docs on this
18:40:45FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Upd
18:41:12FromDiscord<Rika> https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators
18:41:14FromDiscord<Rika> here amun-ra
18:41:23FromDiscord<Rika> read down "Note that system.finished is error prone to use...:
18:41:24FromDiscord<Rika> (edit) "use...:" => "use..."
18:41:25FromDiscord<demotomohiro> In reply to @jmgomez "Hey guys, any idea": Nim call `ar` command to build static but do you have `ar` in binutils? Can you run `where ar`?
18:42:02FromDiscord<jmgomez> first time I heard about ar TBH
18:42:26Amun-RaRika: right, I think I'll go with an exception to reduce the number of checks
18:42:33FromDiscord<Rika> its for static libs usually with file ext `.a` which is an old archive format
18:42:38FromDiscord<Rika> ar is for extracting it
18:42:47Amun-Raand creating it too
18:43:01FromDiscord<Rika> okay, whichever you think is best
18:43:04FromDiscord<Rika> i dont like the system either
18:43:47FromDiscord<jmgomez> got it, so I need to have it installed. Odd that vcc doesnt have it there already
18:44:31FromDiscord<jmgomez> using clang did work
18:44:33FromDiscord<demotomohiro> binutils contains binary tools like `ld`, `as`, `ar`, etc. some of them are used by gcc.
18:44:53FromDiscord<jmgomez> but I imagine I cant mix something compiled with clang and vcc right?
18:45:18FromDiscord<jmgomez> In reply to @demotomohiro "binutils contains binary tools": that's on the nim installation folder?
18:45:33FromDiscord<demotomohiro> In reply to @jmgomez "got it, so I": binutils is usually installed when you install gcc.
18:45:35Amun-Ravcc as in msvc?
18:45:53FromDiscord<jmgomez> yes
18:46:02FromDiscord<demotomohiro> In reply to @jmgomez "that's on the nim": No, binutils are not included in Nim.
18:46:03FromDiscord<jmgomez> I think by default they use it on windows
18:46:09Amun-RaI don't thinks it will work
18:46:12Amun-Rathink*
18:46:23FromDiscord<jmgomez> aggh
18:46:46FromDiscord<demotomohiro> Nim dont use vcc in default even if it is installed. You need to set --cc:vcc option to use vcc backend.
18:46:47FromDiscord<jmgomez> thing is that a dynamic library does not seem to link in ue
18:46:50Amun-Ramsvc uses .lib for static libs
18:47:01Amun-Ra.a comes from posix world
18:47:39Amun-RaI'd be surprised if mixing clang and msvc objects worked
18:47:51FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Upg
18:48:07FromDiscord<jmgomez> I think I can get rid of that one
18:48:08FromDiscord<jmgomez> thanks
18:49:28FromDiscord<demotomohiro> `vccexe.exe` is a tool shipped with Nim that try to find `cl` in visual studio and call it.
18:50:26FromDiscord<jmgomez> what do you mean with cl?
18:50:52Amun-Racl.exe, ms compiler executable
18:50:57FromDiscord<demotomohiro> `cl.exe` is a c/c++ compiler in visual studio.
18:51:05*SamuelMarks quit (Ping timeout: 248 seconds)
18:51:06FromDiscord<jmgomez> 👍
18:51:38FromDiscord<jmgomez> so I will make sure vccexe.exe is on PATH that should do it, right?
18:53:15FromDiscord<demotomohiro> Yes. If I remember correctly, vccexe.exe is in same directory as nim.exe.
18:53:25FromDiscord<jmgomez> does vccexe.exe suppose to live inside .nimble/bin?
18:53:40FromDiscord<jmgomez> nim is there but I cant see it
18:56:21*vicecea quit (Remote host closed the connection)
18:56:22*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:56:49*vicecea joined #nim
19:01:11FromDiscord<demotomohiro> `https://nim-lang.org/download/nim-1.6.4_x64.zip` has `vccexe.exe` in nim-1.6.4/bin directory.
19:01:27*jjido joined #nim
19:02:05FromDiscord<jmgomez> ohh, I was compiling the sources
19:02:28FromDiscord<jmgomez> it just finished and output it, test again with it in bin and did work. Thanks a ton for your help!
19:04:13*toulene quit (Ping timeout: 260 seconds)
19:04:52FromDiscord<jmgomez> one noob question, if you have a static lib for one platform can you use it to link for another platform?
19:07:42FromDiscord<demotomohiro> I don't think so.
19:08:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:09:06FromDiscord<demotomohiro> Nim generates C code that works only on specific OS and specific CPU arch.
19:09:56FromDiscord<jmgomez> ok but is it due just to the nim code or the nature of static libs too?
19:10:11FromDiscord<jmgomez> I know dyn wont work for sure but not sure about statics one
19:12:28FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Upq
19:12:44FromDiscord<demotomohiro> A static library are made of object files. Object files generated by GCC are machine code.
19:14:00FromDiscord<Rika> In reply to @d4rckh "Hello! Why can't I": Do you have $ defined for execution step
19:15:02FromDiscord<demotomohiro> In reply to @d4rckh "Hello! Why can't I": `ref` types dont have `$` proc in default.
19:15:07*neurocyte861449 joined #nim
19:15:56FromDiscord<demotomohiro> try `echo myseq.repr` or define `$` proc for `executionStep` type.
19:16:08*neurocyte86144 quit (Ping timeout: 268 seconds)
19:16:40FromDiscord<d4rckh> what should the `$` proc do?
19:16:55FromDiscord<Rika> Convert to string
19:17:09FromDiscord<Rika> It’s a “to string” function
19:17:17FromDiscord<d4rckh> oh
19:19:38FromDiscord<d4rckh> .. how should i do that? 😂
19:19:42FromDiscord<d4rckh> (edit) removed "😂"
19:20:12FromDiscord<Rika> Someone else help, I have to go lol
19:22:20FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Upv
19:26:31FromDiscord<Daan Breur> huh
19:26:52FromDiscord<Daan Breur> sometimes this server is less helpful then StackOverflow
19:30:21FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Upw
19:40:55NimEventerNew question by Sergey Python: nim, how to get the result of multithreading execution immediately, without any delay?, see https://stackoverflow.com/questions/71757503/nim-how-to-get-the-result-of-multithreading-execution-immediately-without-any
20:08:10*SamuelMarks joined #nim
20:19:39*SamuelMarks quit (Ping timeout: 268 seconds)
20:20:09*Gustavo6046 quit (Ping timeout: 248 seconds)
20:21:03*Gustavo6046 joined #nim
20:43:45*SamuelMarks joined #nim
20:49:25FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3UpL
20:49:33FromDiscord<creikey> (edit) "https://play.nim-lang.org/#ix=3UpL" => "https://play.nim-lang.org/#ix=3UpM"
20:49:40FromDiscord<creikey> (edit) "https://play.nim-lang.org/#ix=3UpM" => "https://play.nim-lang.org/#ix=3UpN"
20:51:50FromDiscord<demotomohiro> How about to use try expression: https://nim-lang.org/docs/manual.html#exception-handling-try-expression
21:03:50NimEventerNew thread by SergeyPython: Why multithreading execition take time almost equal to single thread execution?, see https://forum.nim-lang.org/t/9079
21:09:52FromDiscord<Elegantbeef> try expressions are so lovely
21:38:27FromDiscord<Zoom> Wait, does `threadpool` not work with orc? I get reads from nil. Not with arc.
21:38:40FromDiscord<Elegantbeef> I think it should
21:42:55*wyrd quit (Ping timeout: 240 seconds)
21:45:06*wyrd joined #nim
21:52:04FromDiscord<Zoom> Also, `blockUntilAny` is strange
22:10:42*mn3m0n1c quit (Quit: Connection closed for inactivity)
22:29:19FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Uq8
22:32:25FromDiscord<demotomohiro> How it is defined?
22:32:38FromDiscord<demotomohiro> Or declared?
22:33:40FromDiscord<demotomohiro> !eval var refreshTaste = 1; refreshTaste = 2; echo refreshTaste
22:33:42NimBot2
22:34:02*zeus-supreme joined #nim
22:34:03FromDiscord<hmmm> hmm
22:34:04FromDiscord<Recruit_main707> !eval let refreshTaste = 1; refreshTaste = 2; echo refreshTaste
22:34:05NimBotCompile failed: /usercode/in.nim(1, 23) Error: 'refreshTaste' cannot be assigned to
22:34:29FromDiscord<Recruit_main707> !eval refreshTaste = 2; echo refreshTaste
22:34:30NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'refreshTaste'
22:36:51*zeus-supreme1 quit (Read error: Connection reset by peer)
22:43:04FromDiscord<Zoom> You'd think there should have been at least a hint you need to cast stuff to make blockUntilAny even compile, not even work \:P
22:44:11FromDiscord<Zoom> Looks like it never returns `-1`
22:59:05*rawrrr quit (Quit: Connection closed for inactivity)
23:04:47*SamuelMarks quit (Ping timeout: 246 seconds)
23:45:20FromDiscord<Elegantbeef> [Zoom](https://matrix.to/#/@Zoom:matrix.org)\: got some example code?