<< 18-10-2021 >>

00:00:09FromDiscord<KimJongUnstoppable> yes
00:00:31FromDiscord<KimJongUnstoppable> I need to load DLL+offset to be able to call the procedure by name, otherwise it never finds the procedure.
00:00:55FromDiscord<KimJongUnstoppable> I imagine based on the way you asked that, I can just add the offset to the pointer, and if that's the case I'm going to feel pretty dumb
00:01:01FromDiscord<Elegantbeef> Yep
00:01:05FromDiscord<KimJongUnstoppable> sigh
00:01:51FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[proc(){.nimcall.}]](yourSymAddr)[offset]` 😀
00:01:56FromDiscord<KimJongUnstoppable> wait, actually, the offset would be where I'd call the symaddr from - the dll has a virtual function table and that's preventing me from calling the function by name
00:02:05FromDiscord<KimJongUnstoppable> bless you
00:02:13FromDiscord<KimJongUnstoppable> I've been trying to figure this out for like an hour or more
00:02:40FromDiscord<Elegantbeef> That assumes you have the address to the first proc, and it's sequential, if either of those arent true uhhh, keep searching 😛
00:03:48FromDiscord<KimJongUnstoppable> I'm pretty sure I can figure out the address for the first procedure, and I'm 99% sure they're sequential - I guess I'll find out shortly lol
00:07:21FromDiscord<KimJongUnstoppable> is there any way to enumerate through the procedures in a DLL? or am I stuck using like OleView or IDA for that
00:10:07FromDiscord<Elegantbeef> I think that'd require doing stuff like dumpbin might work, dont think there is a standard way of doing "What does this Dll exposes"
00:17:36FromDiscord<KimJongUnstoppable> OleView is telling me the virtual function table that has the procedure I want is at the entry point of the dll + 0x7360. but the issue I'm having a hard time wrapping my brain around is how to load the DLL at that offset instead of the entry point, so that I can call the procedure by name. I'm not even sure that can be done now that I've typed it out
00:18:52FromDiscord<Elegantbeef> I really should say much on how to do this but i atleast know a bodge solution
00:19:14FromDiscord<Elegantbeef> given that you know the entry point from `loadLib` you can just offset it by `7360` and assign that to variable afaict
00:19:19FromDiscord<impbox [ftsf]> bodgebeef
00:19:28FromDiscord<KimJongUnstoppable> bodge solution > no solution
00:19:30FromDiscord<KimJongUnstoppable> fwiw
00:20:24FromDiscord<impbox [ftsf]> @ElegantBeef are your latest changes to nimscripter in bigrewrite?
00:20:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C5l
00:20:35FromDiscord<Elegantbeef> Yep
00:22:10FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3C5m
00:22:12FromDiscord<impbox [ftsf]> getting this when trying to build for emscripten
00:22:29FromDiscord<impbox [ftsf]> with latest Nim + nimscripter
00:22:52FromDiscord<impbox [ftsf]> maybe you had to make changes to the nicoscripter side?
00:24:14FromDiscord<Elegantbeef> Nah i messed up the `exportTo` for some things
00:24:15FromDiscord<Elegantbeef> What're you exporting?
00:24:24FromDiscord<impbox [ftsf]> nico
00:24:45FromDiscord<Elegantbeef> I mean what's your `exportTo` have in it for functions/symbols
00:26:17FromDiscord<impbox [ftsf]> should be the same as what I sent you before, https://github.com/ftsf/nico/blob/nicoscripter/examples/nicoscripter/src/main.nim
00:27:54FromDiscord<Elegantbeef> Hmm you sure you're on most recent commit?
00:28:27*nrds quit (Remote host closed the connection)
00:28:42FromDiscord<impbox [ftsf]> your latest commit Added setGlobalValue
00:29:18FromDiscord<impbox [ftsf]> maybe i'm messed up somewhere >_>
00:30:24FromDiscord<impbox [ftsf]> ahh using that version of main.nim I'm getting issues with loadScript
00:30:37FromDiscord<Elegantbeef> Which is to be expected with my changes
00:30:43FromDiscord<impbox [ftsf]> NimScriptFile/Path
00:30:44FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3C5r should work
00:30:48*nrds joined #nim
00:31:17FromDiscord<Elegantbeef> I really didnt like the optional `isFile`. Felt bad/error prone
00:32:29FromDiscord<Elegantbeef> There is presently a slight issue with closed/open syms that overlap
00:32:47FromDiscord<Elegantbeef> So overloads somewhat are issue causing
00:32:57FromDiscord<impbox [ftsf]> woo, compiling now \o/
00:36:38FromDiscord<Elegantbeef> Does it work?!
00:38:09FromDiscord<Varriount> @Araq Have you seen this "nogil" fork of Python[0]? Its design document[1] is quite interesting. It mentions some very creative mechanisms for dealing with threading in a reference-counting context.
00:38:21FromDiscord<Varriount> Biased reference counting in particular looks like it could apply to Nim.
00:38:31FromDiscord<Varriount> [0] https://github.com/colesbury/nogil
00:38:38FromDiscord<Varriount> [1] https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsDFosB5e6BfnXLlejd9l0
00:44:08FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5t
00:46:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C5v
00:46:54FromDiscord<impbox [ftsf]> @ElegantBeef woo got it working in browser, super cool \o/
00:47:47FromDiscord<impbox [ftsf]> now I can make an interactive web based tutorial
00:48:03FromDiscord<Elegantbeef> Nice!
00:48:17User11KimJongUnstoppable, I dont know if this'd help but I'm looking at the same problem also. I dont have
00:48:17User11a working solution for this but the theory is that the dll needs to dynamically recompute the fixed addresses
00:48:17User11when it is loaded to a new process with a different base address from it's prefer base address. The procedure
00:48:17User11then is to looping through the dll's relocation descriptors and resolve the symbol's addresses with pointer maths.
00:48:56FromDiscord<Elegantbeef> `saveState`/`loadState` only work with the most recent nim commit(which didnt get backported) so if you want that functionality do build with that version of Nim
00:49:44FromDiscord<Elegantbeef> The way it's presently done is so https://play.nim-lang.org/#ix=3C5w
00:52:43FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5x
00:53:02FromDiscord<deech> Is there a flag to keep compile time code from doing IO/making syscalls etc?
00:57:18FromDiscord<Elegantbeef> I know the VM can be sandboxed but dont recall how
01:01:14FromDiscord<Elegantbeef> Seems what i recall is https://github.com/nim-lang/Nim/pull/16943
01:03:40FromDiscord<Elegantbeef> @geekrelief\: odd considering https://play.nim-lang.org/#ix=3C5B works
01:03:59FromDiscord<geekrelief> In reply to @geekrelief "If I have a": yeah it is odd
01:04:18FromDiscord<geekrelief> I'm looking at the C I'm maybe I'm missing something
01:04:30FromDiscord<geekrelief> (edit) removed "I'm"
01:05:03FromDiscord<geekrelief> nim isn't complaining it's msvc
01:05:20FromDiscord<Elegantbeef> Yea i know
01:05:34FromDiscord<Elegantbeef> Well didnt know it was msvc, but knew it was the C compiler
01:08:57FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5C
01:09:43FromDiscord<Elegantbeef> I dont think that's a pointer proc
01:16:28FromDiscord<Elegantbeef> Here we go https://play.nim-lang.org/#ix=3C5D
01:16:28*andinus quit (Remote host closed the connection)
01:17:03FromDiscord<Elegantbeef> dont worry about `noConv` was just a test
01:17:11FromDiscord<Elegantbeef> But here is a pointer proc https://play.nim-lang.org/#ix=3C5F
01:18:01FromDiscord<geekrelief> hmm
01:18:41FromDiscord<geekrelief> weird I already have the importc on the nim side
01:18:57FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5G
01:19:11FromDiscord<Elegantbeef> The issue is it's not a pointer proc
01:19:31FromDiscord<geekrelief> ah
01:19:42FromDiscord<Elegantbeef> i'm probably wrong but you cannot have a variable of a non pointer proc in C
01:19:44FromDiscord<geekrelief> hmm so the headers neard to be changed
01:19:49FromDiscord<geekrelief> (edit) "neard" => "need"
01:20:44FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5H
01:21:19FromDiscord<geekrelief> I guess I can only use this for casting purposes.
01:21:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C5I
01:22:58*neurocyte0132889 quit (Ping timeout: 268 seconds)
01:23:06FromDiscord<Elegantbeef> Ask TM if that definition makes any sense, i'm not a C programmer, i'm barely a Nim programmer 😛
01:23:31FromDiscord<geekrelief> hehe https://cplayground.com/?p=seahorse-gerbil-dog
01:23:43FromDiscord<geekrelief> yeah my C is pretty rusty
01:24:46FromDiscord<geekrelief> seems like that's illegal C, I guess I'll stick to casting the proc
01:26:05FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5K
01:26:16FromDiscord<Elegantbeef> My C is completely unknown since i havent actually ever learned it
01:26:34FromDiscord<geekrelief> well I learned it.. about 30 years ago??
01:26:43FromDiscord<Elegantbeef> You can make a converter if you want to live dangerously 😛
01:27:19FromDiscord<geekrelief> would I have to create a converter for each function type?
01:27:20FromDiscord<Elegantbeef> Alternatively just have an overload that takes a proc that matches
01:28:08FromDiscord<geekrelief> ah.. nevermind. This is good enough. 🙂
01:28:23FromDiscord<geekrelief> thx beef!
01:28:36FromDiscord<Elegantbeef> No problem
01:36:48*arkurious quit (Quit: Leaving)
02:18:42FromDiscord<exelotl> lol I hit a mysterious VM crash this evening. Updated to 1.6 RC3 and it went away :D
02:19:04FromDiscord<Elegantbeef> Interesting
02:20:54FromDiscord<exelotl> Sadly I'm still stuck with --os:standalone --gc:none because simply having malloc present causes me to run out of RAM 🙃
02:21:20FromDiscord<Elegantbeef> Shame
02:21:45FromDiscord<Rika> what are you programming
02:22:07FromDiscord<exelotl> The game boy advance, as usual x)
02:22:14FromDiscord<Rika> ah i forgot
02:25:41FromDiscord<exelotl> The trouble with --os:standalone now is that exceptions don't work at compile time anymore. Fortunately the only thing that this broke for me was a few strformat calls in macros, which I could replace with old-style `%` string interpolation
02:28:25FromDiscord<Rika> why wouldnt exceptions work on compile time?
02:28:30FromDiscord<Rika> why would anything change on compile time
02:29:19FromDiscord<Elegantbeef> I could see exceptions being disabled with `--gc:none`
02:29:51FromDiscord<Elegantbeef> Could be a mistake that they're disabled at CT aswell
02:30:48FromDiscord<Rika> this sounds like the CT issue triggered by -d:danger
02:31:17FromDiscord<exelotl> Here's the issue I raised for it: https://github.com/nim-lang/Nim/issues/18322
03:21:36nrds<Prestige99> Along the same lines as earlier, why does this not work/how could it be done? https://play.nim-lang.org/#ix=3C62
03:24:14FromDiscord<Elegantbeef> Generally for stuff like this you supply a len/pointer to first element
03:25:04FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3C64
03:25:34nrds<Prestige99> oh you gave it the addr of the first element, alright. Curious why that'd be different than the addr of the seq
03:25:56FromDiscord<Elegantbeef> Well cause a seq has a ptr to data on the heap
03:26:04FromDiscord<Elegantbeef> Or might be a pointer to data on the heap
03:26:07nrds<Prestige99> aha
03:26:56FromDiscord<Rika> address of array is the actual data because all metadata on it is compile time
03:26:56FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3C66 for a working version you supplied https://play.nim-lang.org/#ix=3C66
03:27:04FromDiscord<Elegantbeef> Jeez overly zealous here
03:27:12FromDiscord<Rika> address of seq is complicated because of size+capacity metadata
03:28:14FromDiscord<Elegantbeef> The reason what you did didnt work is you were mutating a copy of the seq cause `var a = someSeq` copies
03:28:40FromDiscord<Elegantbeef> So if you do `var foo = cast[ptr seq[float](data)` you'd have the same behaviour
03:28:40nrds<Prestige99> Thanks for the info
03:33:04FromDiscord<Elegantbeef> All i can say is pointers are fun and Nim's one of the better ways to learn of this fun imo 🙂
03:35:13FromDiscord<Rika> They’re easier to understand due to the non overlapping syntax for dereferencing and pointer types xd
03:35:45FromDiscord<Elegantbeef> There's also no ambiguity between collections and pointers to a single value
03:39:12FromDiscord<impbox [ftsf]> aye, that's really annoying in C
03:39:51FromDiscord<Elegantbeef> Yep so annoying that even Zig afaik doesnt have it
03:45:31FromDiscord<Rika> Lol
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:15:31*mahlon quit (Remote host closed the connection)
04:15:43*mahlon joined #nim
04:18:34madpropsapparently openbsd packages the nim compiler
04:19:55madpropsversion 1.2.0
04:30:37*oprypin quit (*.net *.split)
04:30:37*syl quit (*.net *.split)
04:30:46*oprypin joined #nim
04:38:58*syl joined #nim
05:17:28*rockcavera quit (Remote host closed the connection)
05:32:34*User11 quit (Remote host closed the connection)
05:41:30FromDiscord<codic> yeah Zig has `T` for single item pointer, `[]T` for multi-item pointer, `[]T` for multi-item pointer + length
05:41:53FromDiscord<codic> much clearer than just one conflated type, even if it is at machine level the same, then why have types at all by that reasoning?
06:14:24*PMunch joined #nim
06:34:47FromDiscord<j-james> so a couple of questions about templates
06:34:57FromDiscord<Elegantbeef> A couple of answers
06:35:44FromDiscord<j-james> they describe themselves as simple substitution mechanisms, but you still need to provide them with arguments?
06:35:55FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=3C6q
06:36:17FromDiscord<j-james> where the arguments are lifted from the source implementation of echo
06:36:19FromDiscord<Elegantbeef> You dont need to
06:36:33FromDiscord<j-james> oh? 👀
06:37:10FromDiscord<haxscramper> varargs[string, $]
06:37:38FromDiscord<Elegantbeef> A template replaces the call site with the body, there is no requirement of parameters
06:38:07FromDiscord<Elegantbeef> They're hygienic/typesafe by default though, you cannot do `template someThing(a: int) = discard; someThing(32f)`
06:38:35FromDiscord<Elegantbeef> Hygenic refers to the fact variables declared inside them by default cannot be referenced
06:38:51*Gustavo6046 quit (Ping timeout: 245 seconds)
06:39:22*Gustavo6046 joined #nim
06:43:00FromDiscord<j-james> alright, so replacing `typed` with `string` now works, but its output is framed in quotes and braces
06:43:45FromDiscord<Elegantbeef> You're passing an array to echo
06:44:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C6u
06:45:53FromDiscord<Elegantbeef> inside the template the varargs is an array of strings, what unpackvarargs does is add that to an `echo()` so it gets the nodes held internally
06:46:33FromDiscord<Elegantbeef> Inside templates/macros varargs are a bracket expression of the values they hold
06:47:01FromDiscord<j-james> ah
06:47:02FromDiscord<j-james> thank you
06:49:04FromDiscord<j-james> so on a similar note how would templates for something that doesn't classically have parameters but still has arguments work?
06:49:16FromDiscord<j-james> like making an alias to `proc`, or defining a `loop` keyword
06:49:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C6w
06:50:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C6x
06:50:41FromDiscord<Elegantbeef> Notice in the proc example there is nothing special around `name`
06:50:58FromDiscord<Elegantbeef> In a template if any identifier matches a parameter name it's replaced by it
07:00:03FromDiscord<Araq> @Varriount I'm familiar with "biased RC" and "deferred RC" techniques but I'm sold on Isolated[T] + gc:orc for Nim
07:01:01FromDiscord<j-james> @ElegantBeef alright, do you know what's wrong in this example? https://play.nim-lang.org/#ix=3C6z
07:01:58FromDiscord<j-james> based on your example i'd expect i'd have to add parameters for the proc's parameters and return type but it seems a couple things are wrong
07:03:10FromDiscord<Elegantbeef> Yea templates dont work like this
07:06:57FromDiscord<Elegantbeef> Templates are callable code substitution, they're not magic
07:09:21FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3C6H this is pretty much the extent of what you can do with templates + proc definitions afaik
07:13:47PMunchUnfortunately macro/template invocation isn't flexible enough to get exactly that syntax
07:14:41FromDiscord<Elegantbeef> you can get that with macro wrapper but it's silly to do 😀
07:15:10PMunchYou can't really, at least without some syntax rewrites
07:15:21FromDiscord<Elegantbeef> "with a macro wrapper"
07:16:18FromDiscord<Elegantbeef> Ah i take it back
07:16:24FromDiscord<Elegantbeef> I'm a liar and a fool
07:20:00FromDiscord<j-james> ok, that makes sense
07:20:31FromDiscord<j-james> so templates and macros work within the language but are way more flexible about what kind of data they can take and use
07:21:21FromDiscord<j-james> i suppose if i really want to do that an external preprocessor would work, but that indeed would be a silly thing to do
07:21:33FromDiscord<j-james> thanks a bunch for the explanations
07:21:44FromDiscord<Elegantbeef> Eh nim has string templates so you can just replace `proc` with `function`
07:21:47FromDiscord<Elegantbeef> Not that it makes any sense to do
07:25:32FromDiscord<Elegantbeef> Here's the silliest approximation you'll get https://play.nim-lang.org/#ix=3C6I
07:26:14FromDiscord<Elegantbeef> The parser/lexer really dont like when they're attempted to be abused so silly stuff like this works, but again why would you want to
08:00:36PMunchj-james, yes templates and macros work within the language. The Nim parser first parses everything, so code still needs to be sytactically correct (although Nim has a pretty flexible syntax so this is less of a problem than you might think). They then do substitutions and manipulations respectively to this parsed syntax (they are parsed into a tree structure called the Abstract Syntax Tree). Then this structure is returned and put into the
08:00:36PMunchoriginal syntax tree before the whole tree gets compiled down into C code by the compiler. So what you return from your macro or template needs to not only be syntactically correct, but also semantically correct.
08:02:55*tinytoast joined #nim
08:03:03*pch_ joined #nim
08:03:19*tinystoat quit (Read error: Connection reset by peer)
08:03:26*notchris quit (Ping timeout: 245 seconds)
08:03:26*LyndsySimon quit (Ping timeout: 245 seconds)
08:03:49*notchris joined #nim
08:03:50*LyndsySimon joined #nim
08:03:51*euantorano quit (Ping timeout: 245 seconds)
08:04:14*euantorano joined #nim
08:05:00FromDiscord<Rika> PMunch do I need to attribute you if I look at your keyboard firmware code and take inspiration from it? Licenses are difficult to understand
08:05:31*pch quit (Ping timeout: 245 seconds)
08:07:24PMunch@Rika, well I haven't really added a license to Badger. But I typically license my stuff with MIT, so you don't need to attribute me. But I always appreciate a shoutout :)
08:07:51FromDiscord<Rika> Well if I do take a good amount of inspiration I shall
08:07:55PMunchWhat're you working on?
08:08:09FromDiscord<Rika> The same thing but there’s some stuff that I want to add
08:08:31FromDiscord<Rika> And it’s not just an easy “fork your fw and add what I want”
08:09:34PMunchCool, what are you adding?
08:10:25FromDiscord<Rika> A screen and a UI for it xd
08:10:35PMunchI mean most of the work in Badger was just getting everything to work on the controller without any libraries and creating a simple layout DSL
08:10:39FromDiscord<Rika> I don’t think it’s trivial to add
08:10:47PMunchHmm, depends
08:10:58PMunchIf it's an i2c screen it should be pretty simple
08:11:01FromDiscord<Rika> Also different MCU, using an ST one in my case
08:11:06PMunchAnd what do you mean UI?
08:11:09FromDiscord<Rika> The screen part is trivial
08:11:13PMunchST?
08:11:35FromDiscord<Rika> Well, configuration of the board without reflashing or even using the computer could be possible
08:11:41Amun-RaSTMiroelectronics
08:11:48FromDiscord<Rika> It’s a gimmick sure but that’s what makes it fun
08:11:59PMunchAah I see
08:12:19FromDiscord<Rika> And people love fun semi functional gimmicks
08:12:33PMunchShouldn't be too hard, just need to create the layout arrays dynamically instead of statically compiled into the program
08:12:43PMunchAnd then have some interface to change them
08:12:51FromDiscord<Rika> Yeah I have an idea for such
08:13:21FromDiscord<Rika> The interface part I don’t know how intensive that would be on a processor but the one I’m using is kinda overkill for a regular keyboard so I’m assuming it’s enough
08:13:50PMunchYou'd be surprised with how much headroom you have once you've removed all the overhead :P
08:14:13FromDiscord<Rika> Kinda also wanna put an Easter egg, like Vim embedded into the UI lol
08:14:20FromDiscord<Rika> Sounds fun
08:14:32FromDiscord<Rika> What overhead does QMK have actually
08:15:32PMunchNo idea, haven't dived too deep into the codebase
08:16:00PMunchPart of the reason I wrote Badger was because QMK is such a massive code base and it's hard to get into
08:17:16FromDiscord<Rika> I’m probably gonna need to rely on a HAL as well like the MK fws because I want to be at least competitive…
08:17:53PMunchHAL?
08:18:02FromDiscord<Rika> Hardware abstraction layer
08:18:10FromDiscord<Rika> Makes it easier to support many MCUs
08:18:20FromDiscord<Rika> Of course has a cost
08:18:26FromDiscord<Rika> As with all abstractions
08:20:41PMunchAh I see
08:21:11PMunchI want to make something completely compile-time based for that in Nim
08:21:21PMunchThe Badger libraries is a start to that
08:21:46FromDiscord<Rika> Yeah a HAL on compile time would be nice
08:35:02PMunchYou can see how I do it for I2C in the Badger library
08:35:25PMunchBasically using the type system for what it's worth
08:36:29FromDiscord<Rika> How do you test your fw by the way
08:36:42FromDiscord<Rika> I don’t have a keyboard or the screen to test
08:37:34PMunchI upload it to my keyboard and test it there
08:38:01PMunchI guess you could see if there is a simulator for your chip
08:38:25FromDiscord<Rika> Oh I have the chip
08:38:43FromDiscord<Rika> Just not as a keyboard (nor do I have buttons to use to simulate)
08:38:57PMunchHmm, then it might be a bit tough
08:39:03PMunchI mean you could touch wires
08:39:24PMunchFor a single button
08:39:33PMunchBut it's kinda hard to test layouts and such
08:39:48PMunchWell, I guess you could have a bunch of wires and connect the right ones for your key..
08:40:44FromDiscord<Rika> Hmm
09:22:23FromDiscord<Rika> I’ll be honest your code looks very messy
09:26:20PMunchThe badger code?
09:26:44FromDiscord<Rika> Yes
09:27:05FromDiscord<Rika> Less messy more convoluted I guess
09:27:12PMunchHmm, what parts seem messy?
09:27:47FromDiscord<Rika> What is this MCP file thing doing
09:27:56PMunchAh, that is the port expander
09:28:05FromDiscord<Rika> Ah, okay
09:28:08PMunchIt's an I2C device
09:28:16FromDiscord<Rika> This is a split keyboard right
09:28:23PMunchYes
09:28:28PMunchEach half has a port expander
09:28:29FromDiscord<Rika> I see that’s why that’s there
09:28:34FromDiscord<Rika> This will be useful
09:28:39PMunchAnd the chip is completely separate from the rest of the board
09:29:03PMunchYou can see how I use them here: https://github.com/PMunch/badger/blob/final/badger.nim#L4-L14
09:29:06FromDiscord<Rika> Yes I had plans on using one too
09:30:15FromDiscord<Rika> What’s the difference between the master and final branches?
09:30:41FromDiscord<Smarc> Why is this not working, since Pawn etc. are inheriting from the Piece type, shouldn't a seq[Piece] be able to carry all of the sub-types? Coming from Java :s https://media.discordapp.net/attachments/371759389889003532/899590296646582302/Screenshot_20211016_145604.png
09:32:26PMunch@Rika, master is up to date with the last video I made on it
09:32:29FromDiscord<Smarc> Why is this not working? Since Pawn and all other types are inheriting from the Piece type, should a seq[seq[Piece]] be able to carry seq[Pawn], seq[Knight] etc? Coming from Java. https://media.discordapp.net/attachments/371759389889003532/899590748440264704/Screenshot_20211016_145604.png
09:32:42FromDiscord<Rika> Master says 6 months ago versus final 4 months ago
09:32:53PMunchFinal is the version I cleanup up off-camera where everything works and has a layout I can actually use
09:33:05FromDiscord<Rika> In reply to @Smarc "Why is this not": Full error needed
09:33:15FromDiscord<Rika> Okay
09:33:17PMunchI plan to do a video where I go through the changes and then make master into final
09:33:21FromDiscord<Rika> Okay
09:33:41PMunchBut suddenly life happened and I haven't streamed anything for apparently 6 months..
09:33:46FromDiscord<Rika> I still need to think of how to split the workload between the screen handling code and the polling…
09:34:13FromDiscord<Rika> Though given that I need to buy the hardware first
09:35:16FromDiscord<Smarc> In reply to @Rika "Full error needed": Error: type mismatch: got <seq[seq[Piece]], seq[Pawn]>
09:35:42PMunchEmphasis on the "Full" part
09:36:21FromDiscord<Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3C72
09:37:53PMunchYeah, first argument is a seq[seq[Piece]]
09:37:59PMunchSo T is seq[Piece]
09:38:44FromDiscord<Smarc> So shouldnt a seq[seq[Piece]] be able to carry seq[Pawn], seq[Knight] etc.?
09:38:47PMunchBut the second argument is not openArray[T] (which would be seq[seq[Pawn]])
09:38:54*neurocyte0132889 joined #nim
09:38:54*neurocyte0132889 quit (Changing host)
09:38:54*neurocyte0132889 joined #nim
09:39:11PMunchOh wait, oops
09:39:24PMunchSorry I read that error wrang
09:40:29FromDiscord<Smarc> No worries, I think I just have a little comprehension issue here :)
09:43:32FromDiscord<Rika> The issue is inheritance doesn’t work through a generic I believe
09:44:03PMunchYeah seems like it's something like that..
09:44:08FromDiscord<Rika> You can add a Pawn to a seq[Piece] but not a seq[Pawn] to a seq[seq[Piece]]
09:44:51PMunchTypically you'd use variance objects for this in Nim
09:46:07FromDiscord<Smarc> hm okay, so if I unwrap the seq[Pawn] and add every element singlehanded into a seq[Piece] it should work like this?
09:46:21FromDiscord<Rika> Think so
09:47:00FromDiscord<Smarc> Yep, seems to work. Alright, you learn something new every day, thank you guys once more!
09:53:10PMunchYou can always cast the sequence: https://play.nim-lang.org/#ix=3C78
09:53:44PMunchSince these are ref objects they are stored as pointers, so a seq[Piece] and a seq[Pawn] should be identical in memory.
09:55:06FromDiscord<Smarc> Ah, was trying to cast it beforehand but failed, I think this way it is even more convenient
09:55:26PMunchYou can of course also put that logic in a template
09:56:05FromDiscord<Smarc> Do you mind giving me a mini-example of that as well? I am not familiar with nim templates yet
09:56:44PMunchhttps://play.nim-lang.org/#ix=3C79
09:57:03PMunchI mean that could also just be a procedure
09:57:09*neurocyte0132889 quit (Read error: Connection reset by peer)
09:57:16PMunchIt will 99% sure be inlined by the compiler anyways
09:57:54*neurocyte0132889 joined #nim
09:57:54*neurocyte0132889 quit (Changing host)
09:57:54*neurocyte0132889 joined #nim
10:00:25*arkurious joined #nim
10:04:58FromDiscord<Smarc> Thanks a lot!
10:14:55*neurocyte0132889 quit (Read error: Connection reset by peer)
10:15:43*neurocyte0132889 joined #nim
10:15:43*neurocyte0132889 quit (Changing host)
10:15:43*neurocyte0132889 joined #nim
10:21:44*neurocyte0132889 quit (Ping timeout: 258 seconds)
10:25:56*neurocyte0132889 joined #nim
10:25:56*neurocyte0132889 quit (Changing host)
10:25:56*neurocyte0132889 joined #nim
10:41:39FromDiscord<Hamid Bluri> hey, can i pass data to a channel from multiple threads?
10:44:22FromDiscord<Hamid Bluri> i mean can it cause any problems? or i should use separated channels?
10:44:50FromDiscord<Rika> Behaviour is undocumented for such case, expect issues
10:44:55FromDiscord<Rika> Afaik
10:45:22FromDiscord<Rika> There’s a third party package that implements MCMP queues I believe
10:45:46FromDiscord<Hamid Bluri> `loony` ?
10:45:53FromDiscord<Rika> I think so yes
10:46:05FromDiscord<Rika> May be what you want though what you described is MCSP
10:46:11FromDiscord<Rika> Wrong order
10:46:15FromDiscord<Rika> SCMP
10:46:28FromDiscord<Hamid Bluri> thank u
10:47:23FromDiscord<Hamid Bluri> SCMP: A Single-Chip Message-Passing Parallel ?
10:47:28FromDiscord<Hamid Bluri> (edit) removed "A"
10:48:04FromDiscord<Rika> Oops sorry might have misunderstood what MCMP meant
10:48:18FromDiscord<Rika> But I meant single consumer multi producer
10:48:24FromDiscord<Rika> My bad
10:48:27FromDiscord<Hamid Bluri> ok 👍
10:48:28FromDiscord<Rika> I don’t do threading
10:48:28PMunchSingle Consumer Multiple Producer*
10:48:48FromDiscord<Hamid Bluri> blame google not me 😄
10:48:58PMunchNah you were right @Rika
10:49:06FromDiscord<Rika> Okay
10:49:22PMunch@Hamid Bluri just wondered what that was short for and googled, got the first thing which is a different thing
10:50:55FromDiscord<Rika> Okay
10:51:12FromDiscord<Hamid Bluri> did you google it ? ↵SCMP =>for me=> South China Morning Post↵scmp in computer => A Single-Chip Message-Passing Parallel Computer
10:51:18FromDiscord<Rika> Lol
10:52:10PMunchMCMP is Multiple Consumer, Multiple Producer which is the more common acronym. @Rika just rewrote it to be what you're trying to do
10:52:37PMunchI mean MCMP is also Munich Center for Mathematical Philosophy
10:52:46PMunchBut that is obviously not what were talking about
10:53:43PMunchIf you Google MCMP queue you get related results
10:55:59FromDiscord<Hamid Bluri> my every day programming in Nim is a new journey : D
10:56:59FromDiscord<Hamid Bluri> im really happy that i found out Nim
10:58:02PMunchIt's a great language :)
10:59:04FromDiscord<Rika> There are still some things I wish were in Nim but sooner or later they’ll be in I hope
10:59:28FromDiscord<Rika> Nothing comes closer to ideal than Nim, for me
10:59:40PMunchDitto
10:59:44PMunchIs it perfect? No
10:59:49PMunchBut it's the closest thing I've found
10:59:58FromDiscord<Hamid Bluri> yeah : D
11:10:56PMunchHmm, how can I get the inode number of a file in Nim?
11:12:26FromDiscord<Rika> Stat?
11:12:37FromDiscord<Rika> Under posix
11:12:55FromDiscord<Rika> I think that’s wrong
11:12:59FromDiscord<Rika> I forgot already asked
11:13:04FromDiscord<Rika> (edit) removed "asked"
11:13:12FromDiscord<Rika> My keyboard spat out an extra word for some reason
11:14:15FromDiscord<Rika> No I’m right I believe
11:15:25FromDiscord<Rika> Stat, then st_ino
11:15:57FromDiscord<Rika> PMunch “Stat, then st_ino”
11:16:33PMunchAha, st_ino seems like the right thing
11:17:09FromDiscord<Rika> Referenced from https://man7.org/linux/man-pages/man7/inode.7.html
11:40:27FromDiscord<NullCode1337> hi
11:40:32FromDiscord<Rika> Hello
11:40:36FromDiscord<NullCode1337> so yeah my account is disabled
11:40:40FromDiscord<NullCode1337> alt time
11:40:55FromDiscord<NullCode1337> don't tell discord
11:41:07FromDiscord<NullCode1337> I'd hate it if this gets disabled too
11:41:16PMunchWhat'd you do to get your account disabled?
11:41:25FromDiscord<Rika> He hacked discord
11:42:13FromDiscord<NullCode1337> In reply to @PMunch "What'd you do to": got into their internal servers and gave myself 99 years of nitro
11:42:22FromDiscord<NullCode1337> just kidding its because of my github
11:42:56PMunchBecause of your GitHub?
11:43:22FromDiscord<Rika> The malware repositories I assume
11:44:36PMunchBut why would Discord ban someone for what they do on another platform?
11:45:59FromDiscord<NullCode1337> the repos are related to discord
11:46:02FromDiscord<NullCode1337> not in a good way
11:46:37PMunchAhh, I see
11:49:52FromDiscord<Rika> Why did you link your account again
11:49:54FromDiscord<Rika> On your alt
11:50:05FromDiscord<Rika> If they banned you for your GitHub account
11:51:48FromDiscord<NullCode1337> i did?
11:51:49FromDiscord<NullCode1337> FUCK
11:52:36PMunchHaha!
11:52:48FromDiscord<NullCode1337> done
11:52:52FromDiscord<NullCode1337> removed
11:53:06PMunch*Swing!* *thump* that's the ban-hammer coming down on you
11:53:44FromDiscord<NullCode1337> lmfao
12:00:35FromDiscord<tandy> `seq[(string, string)]` can you index a seq like this by content?
12:00:42FromDiscord<tandy> im using this seq to store http headers
12:00:55FromDiscord<tandy> i need to get the `x-ratelimit-reset` header value
12:01:41FromDiscord<Rika> Just use a table
12:02:55FromDiscord<tandy> are tables imutable
12:03:03FromDiscord<Rika> They can be
12:03:22FromDiscord<tandy> i dont want imutable, thats cool then
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:18:00*rockcavera joined #nim
12:18:00*rockcavera quit (Changing host)
12:18:00*rockcavera joined #nim
12:25:16FromDiscord<Fancy> I can't compile nim to es6?
12:31:21FromDiscord<Rika> no
12:31:37FromDiscord<Rika> afaik only target is es3
12:35:59FromDiscord<Fancy> Damn is there any workaround for it?
12:38:26FromDiscord<Fancy> I am guessing I won't be able to use any es6 modules then
12:39:24FromDiscord<Rika> you can write es6 in the file, its just that code will compile into es3 (you can use emit to insert js code)
12:39:32FromDiscord<Rika> or exportc
12:40:21FromDiscord<rxx> @tandy#0000 @tandy#0000 @tandy#0000 wtf
12:41:14FromDiscord<Rika> ?
12:43:35FromDiscord<Fancy> In reply to @Rika "you can write es6": Do you mean in a separate file?
12:44:06FromDiscord<Rika> wdym? i dont get what you mean
12:44:25FromDiscord<Rika> nim code compiled to js will compile to es3, but you can do `{.emit: "js code here".}` to insert js code
12:45:08FromDiscord<tandy> wat↵(@rxx)
12:45:22FromDiscord<Fancy> Ahhh sorry I think I misread/misunderstood before
12:45:48FromDiscord<rxx> @tandy#0000 wtf is happening what bot are you who are you
12:45:53FromDiscord<Fancy> That is a handy feature
12:46:32FromDiscord<Rika> he;s on matrix, not a bot
12:46:39FromDiscord<Rika> another chat protocol
12:46:42FromDiscord<tandy> lol
12:46:43FromDiscord<haxscramper> People are blown away by bridgfe
12:47:13FromDiscord<tandy> i am a sentient noob nim programer bot
12:47:13FromDiscord<Rika> lol
12:47:28FromDiscord<Rika> pro gamer
12:47:42FromDiscord<tandy> lol↵(@Rika)
12:47:53FromDiscord<rxx> ?ban @tandy#0000
12:47:55FromDiscord<Fancy> So what I understand is that I can use emit to insert es6 within the file
12:48:03FromDiscord<Fancy> Correct?
12:48:04FromDiscord<Rika> yes
12:48:05FromDiscord<Rika> yes
12:48:10FromDiscord<Fancy> Ok great
12:48:16FromDiscord<Rika> i can say yes one more time if you want
12:48:23FromDiscord<Rika> 😛
12:48:26FromDiscord<Fancy> Hahahahaha
12:48:29FromDiscord<Fancy> yes
12:48:32FromDiscord<Fancy> Xd
12:48:37FromDiscord<Fancy> (edit) "Xd" => "XD"
12:49:05FromDiscord<tandy> how do you get nimble install `requires` ? ive done a `nimble install -d -Y` but ci stil says deps arent there
12:49:10FromDiscord<tandy> jsony specificaly..
12:49:32FromDiscord<tandy> which is on nimble packages so not sure why it wouldnt work
12:50:18PMunchHmm, do you have jsony in your requires?
12:51:48PMunchAnd @rxx, why would we ban a user who's on a different network using the official bridges?
12:52:02FromDiscord<Rika> i think theyre joking
12:54:07PMunchNot the first time someone suggest kicking the noisy "bot" :P
12:54:34PMunchOr be astounded by how clever our bots are when they get their questions answered :P
13:02:15*kayabaNerve_ joined #nim
13:04:43*kayabaNerve quit (Ping timeout: 252 seconds)
13:40:58FromDiscord<tandy> yep↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
13:41:35FromDiscord<tandy> oh i didnt have it formated correctly, it needed to be `requires "jsony"`
13:41:47PMunchYup, what did you have?
13:42:14PMunchHmm, Yardanico would it be possible for the bot to do replies better?
13:42:37PMunchBy the way, got Sciter to work?
13:44:10FromDiscord<tandy> `requires jsony` lol↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
13:48:08PMunchAha :P
13:48:21PMunchAnd that didn't throw an error?
13:49:39*Guest84 joined #nim
13:51:24*rockcavera quit (Remote host closed the connection)
13:55:01*Guest84 quit (Quit: Client closed)
13:55:02*neurocyte0132889 quit (Read error: Connection reset by peer)
13:55:41*neurocyte0132889 joined #nim
13:55:41*neurocyte0132889 quit (Changing host)
13:55:41*neurocyte0132889 joined #nim
13:56:52*neurocyte0132889 quit (Read error: Connection reset by peer)
13:57:24*neurocyte0132889 joined #nim
13:57:24*neurocyte0132889 quit (Changing host)
13:57:24*neurocyte0132889 joined #nim
14:01:07FromDiscord<tandy> nop, should i report a bug?↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
14:03:47PMunchHmm, mine throws an error? http://ix.io/3C8i
14:04:06PMunchOld Nimble version? Or do you import jsony into your .nimble file or declare it as an identifier anywhere?
14:05:46FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=3C8j
14:06:23FromDiscord<no name fits> And the order of the lines is random
14:06:31PMunchperformant: switch, readable: depends, maintainable: depends
14:06:41PMunchHow many different keys do you have?
14:07:20FromDiscord<no name fits> It's different from file to file, and the amount of keys might increase, which is why I thought of a table
14:07:39FromDiscord<no name fits> Like the one I'm processing right now just has two, but another one has five and so on
14:08:16FromDiscord<Rika> are they well defined
14:08:20FromDiscord<no name fits> And I thought about running them through a generic proc, but sometimes the value is a string, or a list of strings or something else
14:08:21PMunchWell for a switch you need to implement the logic in a way that it's all known on compile-time
14:08:34FromDiscord<Rika> as in can you distinguish which value needs which proc without runtime reading
14:08:35FromDiscord<no name fits> Yes, they're all predefined
14:08:35PMunchFor a Table you could theoretically have them get registered on runtime
14:08:38FromDiscord<Rika> okay
14:08:45FromDiscord<no name fits> I can distinguish at build time
14:08:46FromDiscord<Rika> then a switch is prolly best
14:08:51FromDiscord<no name fits> Alright
14:08:56FromDiscord<no name fits> Thanks for the input
14:09:08FromDiscord<Rika> you can always easily swap if it gets unwieldy
14:09:17PMunchBut maybe but the switch in a proc or template so you just do key.callProc() or something similar
14:09:24FromDiscord<no name fits> right, I was just thinking of a giant switch case at the end of it
14:09:48FromDiscord<no name fits> Do you have an example of that PMunch? I haven't used templates yet
14:10:18PMunchJust go for a proc then :P
14:10:24FromDiscord<no name fits> alright 🙂
14:10:27FromDiscord<no name fits> thanks again guys
14:10:33PMunchNo problem :)
14:16:48FromDiscord<tandy> nop↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
14:17:02FromDiscord<tandy> also i update nim with choosenim before running that
14:43:00FromDiscord<gerwy> Yooo↵fricking nimble page for Qt Creator
14:43:00FromDiscord<gerwy> https://doc.qt.io/qtcreator/creator-project-nimble.html
14:43:28FromDiscord<gerwy> It's that easy to use Qt with Nim
14:43:30FromDiscord<gerwy> (edit) "Nim" => "Nim?"
14:46:43ehmryhow did that happen?
14:47:17nrds<Prestige99> wow that's cool
14:48:59FromDiscord<haxscramper> No, we only have qml wrappers for now↵(@gerwy)
14:49:17FromDiscord<gerwy> Yeah i used that qml wrapper
14:49:18FromDiscord<haxscramper> It has been this way for the last five years IIRC, someone just wrote a Nim plugin for qt creator↵(<@709044657232936960_ehmry=5b=49=52=43=5d>)
14:49:31FromDiscord<gerwy> really struggled to get it to work but it does
15:06:32FromDiscord<qb> @lmariscal any plans to add glut to nimgl?
15:07:59NimEventerNew Nimble package! nimfunge98 - A Funge-98 interpreter written in nim, see https://git.adyxax.org/adyxax/nimfunge98
15:09:47FromDiscord<Rika> oh my GOD NO
15:10:38FromDiscord<demotomohiro> If I remember correctly, GLUT is not maintained for long time and deprecated.↵glfw is actively maintained.
15:20:35FromDiscord<qb> Mkay, I'm still using glut to render fonts using `glutBitmapCharacter`
15:21:04FromDiscord<qb> (edit) "using" => "with"
15:21:53FromDiscord<Jonah> `quit(message)` prints to stderr instead of stdout like `echo` does unless you're in nimscript. the docs say↵> A shorthand for `echo(errormsg); quit(errorcode)`.↵is this intentional? seems like it should use stdout on success error code and stderr for anything else
15:22:09FromDiscord<Jonah> (edit) "error" => "exit"
15:22:32FromDiscord<lmariscal> Yeah, I feel like glwf already covers most of the important stuff, font rendering being the only one left out
15:23:45FromDiscord<lmariscal> I don't really see the merit in supporting glut, with it being heavily outdated
15:27:46FromDiscord<demotomohiro> How about to render text to memory and upload it to texture using boxy or pixie?↵https://github.com/treeform/boxy
15:29:41FromDiscord<soupayan> Hi Members, I am a new joinee... I am learning nim and feels great.. Can anyone let me know if there is anything that nim can't do but rust can?
15:32:52FromDiscord<soupayan> also any good books I can follow or the nim website is enough?
15:34:47FromDiscord<Rika> `Can anyone let me know if there is anything that nim can't do but rust can`
15:34:49FromDiscord<Rika> you tell me
15:34:50FromDiscord<Rika> i dont know
15:35:10FromDiscord<Rika> rust can make you cry idk
15:36:18FromDiscord<demotomohiro> Nim can do what C can do. So what is rust can do but C cannot?
15:37:58FromDiscord<demotomohiro> I have learned Nim mostly with Nim manual and std library reference.↵https://nim-lang.org/docs/manual.html
15:40:06FromDiscord<soupayan> In reply to @Rika "rust can make you": touche to that..
15:48:12FromDiscord<tandy> has anyone written a jsony dumphook for renaming a field?
15:51:18FromDiscord<soupayan> sent a code paste, see https://play.nim-lang.org/#ix=3C94
15:52:27Amun-Rarust can and will compile anything very slow, nim can't do that
15:53:19Amun-Rasoupayan: you can pass single argument without parentheses, 5.findMax 6 would work
15:53:53FromDiscord<soupayan> yes it did, but why not like echo specially when the docs say so
15:54:37Amun-Raproc echo(x: varargs[typed, `$`]) {...}
15:54:44Amun-Ravarargs
15:54:50FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax↵Please read this
15:56:02FromDiscord<demotomohiro> > This command invocation syntax also works for expressions, but then only a single argument may follow.
15:58:29FromDiscord<jfmonty2> Is it possible to apply the noInit pragma to just one field of an object? Or can it only be applied to a whole variable at once?
16:01:06FromDiscord<soupayan> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#procedures-co": ok.. so in this case it is parsed as echo(findMax(5),6) and thus the error
16:07:05FromDiscord<Rika> Amun-Ra nim compilation can be slow depending on if you're torturing the VM with insane macros
16:10:15FromDiscord<demotomohiro> In reply to @soupayan "ok.. so in this": yes
16:14:22FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3C9c
16:18:20FromDiscord<jfmonty2> Right, that was what I was running into. But I didn't know if there was a different way to specify it that I was just missing.
16:18:44FromDiscord<jfmonty2> like `foo = Foo() {.noInit: Foo.x.}` or something
16:31:14FromDiscord<Rika> not possible afaik
16:31:24FromDiscord<Rika> i dont know of any plans either
16:32:13FromDiscord<jfmonty2> ok, fair enough. It's an edge case anyway, I guess I'll just have to make the whole thing uninitialized and then selectively initialize some fields but not others.
16:32:37FromDiscord<demotomohiro> As Nim initialize object types with memset C function, applying noinit pragma only to specific field might not be efficient.
16:33:04FromDiscord<jfmonty2> ah, that was my concern. Well, I guess I'll have to see.
16:33:51*rockcavera joined #nim
16:33:51*rockcavera quit (Changing host)
16:33:51*rockcavera joined #nim
16:37:11FromDiscord<jfmonty2> Yeah, seems to slow it down by a few percent, oh well
17:17:24FromDiscord<juan_carlos> In reply to @haxscramper "No, we only have": I have a Qt wrapper, just need help to finish it...
17:17:34FromDiscord<exelotl> interesting bug... 🤔
17:17:36FromDiscord<exelotl> https://play.nim-lang.org/#ix=3C9m
17:18:11PMunch@soupayan, Nim can compile to JS as well. Not sure if Rust can do that. Basically Nim targets C and JS, which mean you can run natively pretty much everywhere.
17:18:20FromDiscord<exelotl> if you move the {.compile.} block up top, the error goes away
17:18:51PMunch@exelotl, and what's the error?
17:19:59FromDiscord<exelotl> Error: Invalid node for enum type `nnkPragmaExpr`!
17:20:06FromDiscord<exelotl> in the call to parseEnum
17:20:44FromDiscord<exelotl> seems that the pragmas somehow got attached to the enum's AST nodes when they weren't supposed to
17:22:25FromDiscord<exelotl> seems to be a regression introduced in Nim 1.4
17:22:26PMunchHuh, that's odd
17:36:30FromDiscord<juan_carlos> If someone interested, ping me.
18:55:22nixfreak_nim[m]!help
18:55:34nixfreak_nim[m]!pkcs
18:57:14nixfreak_nim[m]!package pkcs
19:00:22FromDiscord<Rika> ?
19:00:31FromDiscord<Rika> there is no package searcher here
19:00:43FromDiscord<Rika> use nimble.directory or github or something
19:04:46*xet7 quit (Remote host closed the connection)
19:05:49*xet7 joined #nim
19:41:03*lenis0012 joined #nim
19:43:58*koltrast_ joined #nim
19:44:45*koltrast quit (Ping timeout: 265 seconds)
20:21:57nixfreak_nim[m]I did and found bearSSL
20:22:20nixfreak_nim[m]just no documentation so I need to look at source code and bearSSL API I guess
20:36:18FromDiscord<iffy (Matt Haggard)> What am I doing wrong? `nimble install pixie --verbose` produces Error\: Package not found. What can I do to debug this?
20:36:39FromDiscord<iffy (Matt Haggard)> nimble version v0.13.1, nim version 1.4.6
20:38:22FromDiscord<Rika> Remove the verbose flag
20:39:39FromDiscord<iffy (Matt Haggard)> Same result
20:39:54FromDiscord<iffy (Matt Haggard)> (except it include this line\: "9 messages have been suppressed, use --verbose to show them") \:)
20:41:45FromDiscord<Rika> So what were the lines that were suppressed
20:43:33FromDiscord<iffy (Matt Haggard)> http://ix.io/3Caf
20:44:15FromDiscord<juan_carlos> `nimble refresh` ?.
20:45:45FromDiscord<iffy (Matt Haggard)> oh... I think I was working on nimble itself and may have installed my own (broken) version. I'm reinstalling 1.4.6 and I think I'll get the right nimble now.
20:49:22FromDiscord<iffy (Matt Haggard)> Nope, that wasn't it. `nimble refresh` doesn't help either
20:49:42*lenis0012 quit (Quit: Client closed)
20:49:51FromDiscord<Elegantbeef> why 1.4.6? 😀
20:50:05FromDiscord<iffy (Matt Haggard)> No reason, shall I try another version?
20:50:16FromDiscord<Elegantbeef> Well 1.4.8 is the most recent stable
20:50:37FromDiscord<Elegantbeef> Not that it'll solve this problem just noting the oddity of installing 1.4.6 😛
20:51:00FromDiscord<iffy (Matt Haggard)> Oh, I've been using 1.4.6 up to now. Just reinstalling what I already had.
20:51:04FromDiscord<iffy (Matt Haggard)> This is odd\: $ nimble list -i \| grep nimble↵nimble [0.12.0]
20:51:11FromDiscord<iffy (Matt Haggard)> $ nimble --version↵nimble v0.13.1
20:51:31FromDiscord<Elegantbeef> You seem to have an old package registry file somehow
20:51:43FromDiscord<Elegantbeef> Updating your nim version to a more modern version may resolve the issue
20:52:05FromDiscord<iffy (Matt Haggard)> K, trying 1.4.8
20:52:26FromDiscord<iffy (Matt Haggard)> Though isn't `nimble refresh` designed to fix old package registry files?
20:52:40FromDiscord<Elegantbeef> It should fetch the most recent package
20:52:49FromDiscord<Elegantbeef> But you may hold a bonkers version of nimble somehow
20:53:29FromDiscord<iffy (Matt Haggard)> Shall I get rid of `~/.nimble` (move it out of place) and reinstall?
20:53:57FromDiscord<Elegantbeef> It may work, i'm not the best at resolving nimble related issues
20:54:02FromDiscord<Elegantbeef> I generally just nuke it and restart 😛
20:54:11FromDiscord<iffy (Matt Haggard)> Very elegant. Beef.
20:54:57FromDiscord<Elegantbeef> The elegant part of my name is a distraction from my utter inelegance
20:55:41nixfreak_nim[m]If you have choosenim , `choosenim stable` then nimble update
20:57:26nixfreak_nim[m]I have stable 1.4.8
20:57:40FromDiscord<iffy (Matt Haggard)> Deleting everything in `~/.nimble/` except `bin/` didn't work.
20:57:44nixfreak_nim[m]so try to re-install choosenim again
20:58:15nixfreak_nim[m]wget -qO - https://nim-lang.org/choosenim/init.sh | sh
20:58:17FromDiscord<iffy (Matt Haggard)> `choosenim stable` gets me to 1.4.0 (and still has the problem)
20:58:28FromDiscord<iffy (Matt Haggard)> Isn't this a problem with nimble, though?
20:59:13nixfreak_nim[m]nim , nimble, and tools get downloaded using choosenim
20:59:39FromDiscord<exelotl> try `choosenim update stable`
20:59:41nixfreak_nim[m]I would just reinstall
21:00:37nixfreak_nim[m]I did to reinstall on all my OS's
21:01:08FromDiscord<iffy (Matt Haggard)> What's the last package in \~/.nimble/packages\_official.json for y'all? Mine is `listsv`
21:01:33nixfreak_nim[m]what version of choosenim do you have
21:01:49FromDiscord<iffy (Matt Haggard)> $ choosenim --version↵choosenim v0.8.2
21:02:29nixfreak_nim[m]ok so thats the newest
21:02:50nixfreak_nim[m]you already deleted ~/.nimble/bin/ right
21:03:22nixfreak_nim[m]what does nimble update stable say ?
21:03:56FromDiscord<iffy (Matt Haggard)> no, I tried that, but then `nimble` wouldn't work \:) What do y'all have in `~/.config/nimble/nimble.ini` -- I think that's what got messed up
21:04:57nixfreak_nim[m]so re-install it
21:05:49nixfreak_nim[m]wget -qO - https://nim-lang.org/choosenim/init.sh | sh
21:06:04nixfreak_nim[m]Then do a choosenim update
21:06:07FromDiscord<iffy (Matt Haggard)> I've reinstalled Nim and nimble already. I don't know how to reinstall that config file. Choosenim controls that config file?
21:07:30FromDiscord<iffy (Matt Haggard)> Resintalled choosenim; `choosenim update` doesn't work (it wants a command). Can someone please just tell me what's in their `~/.config/nimble/nimble.ini` file?
21:07:57*PMunch quit (Quit: leaving)
21:08:18nixfreak_nim[m]* choosenim update stable I think
21:09:41nixfreak_nim[m]nimble.ini
21:09:42nixfreak_nim[m]tree ~/.nimble/ [16:08:56]... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/68bdc2878e5e88c62b98df388f7b0eeb50850787)
21:10:06FromDiscord<iffy (Matt Haggard)> Mine is in `~/.config` not `~/.nimble`
21:10:38FromDiscord<Elegantbeef> `choosenim update` takes a version to update
21:10:38nixfreak_nim[m]don't have that either
21:10:45FromDiscord<Elegantbeef> so you'd have to do `choosenim update stable`
21:11:12FromDiscord<iffy (Matt Haggard)> okay, thank you for checking
21:12:12FromDiscord<iffy (Matt Haggard)> Yess!!!!! Moving `~/.config/nimble/nimble.ini` was the solution! It was leftover from running the `nimble` tests.
21:12:20FromDiscord<iffy (Matt Haggard)> Thank you for your patience!
21:43:19FromDiscord<dom96> pro-tip: use `--debug` with Nimble commands to see what it's doing
22:00:07*kayabaNerve_ is now known as kayabaNerve
22:18:03nrds<Prestige99> Can someone comment as to why this pure pragma would be needed? https://forum.nim-lang.org/t/8509#55092 I read the manual about the pure proc but don't fully understand it, outside its use for enums
22:18:31nrds<Prestige99> It seems to change the behavior of my game at least, not 100% sure why/how
22:28:51*rockcavera quit (Read error: Connection reset by peer)
22:30:11*rockcavera joined #nim
22:30:11*rockcavera quit (Changing host)
22:30:11*rockcavera joined #nim
23:01:51FromDiscord<impbox [ftsf]> "An object type can be marked with the pure pragma so that its type field which is used for runtime type identification is omitted. This used to be necessary for binary compatibility with other compiled languages."↵you're trying to map to a C api, so you don't want nim's RTTI data included in the object which will throw off the field addressing
23:02:59FromDiscord<impbox [ftsf]> basically without the {.pure.} it's adding an extra hidden field for the type info because it's inheritable
23:33:13nrds<Prestige99> ah, okay
23:58:00NimEventerNew thread by RainbowAsteroids: Issues trying to use pattern matching, see https://forum.nim-lang.org/t/8510