00:00:09 | FromDiscord | <KimJongUnstoppable> yes |
00:00:31 | FromDiscord | <KimJongUnstoppable> I need to load DLL+offset to be able to call the procedure by name, otherwise it never finds the procedure. |
00:00:55 | FromDiscord | <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:01 | FromDiscord | <Elegantbeef> Yep |
00:01:05 | FromDiscord | <KimJongUnstoppable> sigh |
00:01:51 | FromDiscord | <Elegantbeef> `cast[ptr UncheckedArray[proc(){.nimcall.}]](yourSymAddr)[offset]` 😀 |
00:01:56 | FromDiscord | <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:05 | FromDiscord | <KimJongUnstoppable> bless you |
00:02:13 | FromDiscord | <KimJongUnstoppable> I've been trying to figure this out for like an hour or more |
00:02:40 | FromDiscord | <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:48 | FromDiscord | <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:21 | FromDiscord | <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:07 | FromDiscord | <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:36 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> I really should say much on how to do this but i atleast know a bodge solution |
00:19:14 | FromDiscord | <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:19 | FromDiscord | <impbox [ftsf]> bodgebeef |
00:19:28 | FromDiscord | <KimJongUnstoppable> bodge solution > no solution |
00:19:30 | FromDiscord | <KimJongUnstoppable> fwiw |
00:20:24 | FromDiscord | <impbox [ftsf]> @ElegantBeef are your latest changes to nimscripter in bigrewrite? |
00:20:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C5l |
00:20:35 | FromDiscord | <Elegantbeef> Yep |
00:22:10 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3C5m |
00:22:12 | FromDiscord | <impbox [ftsf]> getting this when trying to build for emscripten |
00:22:29 | FromDiscord | <impbox [ftsf]> with latest Nim + nimscripter |
00:22:52 | FromDiscord | <impbox [ftsf]> maybe you had to make changes to the nicoscripter side? |
00:24:14 | FromDiscord | <Elegantbeef> Nah i messed up the `exportTo` for some things |
00:24:15 | FromDiscord | <Elegantbeef> What're you exporting? |
00:24:24 | FromDiscord | <impbox [ftsf]> nico |
00:24:45 | FromDiscord | <Elegantbeef> I mean what's your `exportTo` have in it for functions/symbols |
00:26:17 | FromDiscord | <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:54 | FromDiscord | <Elegantbeef> Hmm you sure you're on most recent commit? |
00:28:27 | * | nrds quit (Remote host closed the connection) |
00:28:42 | FromDiscord | <impbox [ftsf]> your latest commit Added setGlobalValue |
00:29:18 | FromDiscord | <impbox [ftsf]> maybe i'm messed up somewhere >_> |
00:30:24 | FromDiscord | <impbox [ftsf]> ahh using that version of main.nim I'm getting issues with loadScript |
00:30:37 | FromDiscord | <Elegantbeef> Which is to be expected with my changes |
00:30:43 | FromDiscord | <impbox [ftsf]> NimScriptFile/Path |
00:30:44 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3C5r should work |
00:30:48 | * | nrds joined #nim |
00:31:17 | FromDiscord | <Elegantbeef> I really didnt like the optional `isFile`. Felt bad/error prone |
00:32:29 | FromDiscord | <Elegantbeef> There is presently a slight issue with closed/open syms that overlap |
00:32:47 | FromDiscord | <Elegantbeef> So overloads somewhat are issue causing |
00:32:57 | FromDiscord | <impbox [ftsf]> woo, compiling now \o/ |
00:36:38 | FromDiscord | <Elegantbeef> Does it work?! |
00:38:09 | FromDiscord | <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:21 | FromDiscord | <Varriount> Biased reference counting in particular looks like it could apply to Nim. |
00:38:31 | FromDiscord | <Varriount> [0] https://github.com/colesbury/nogil |
00:38:38 | FromDiscord | <Varriount> [1] https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsDFosB5e6BfnXLlejd9l0 |
00:44:08 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5t |
00:46:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C5v |
00:46:54 | FromDiscord | <impbox [ftsf]> @ElegantBeef woo got it working in browser, super cool \o/ |
00:47:47 | FromDiscord | <impbox [ftsf]> now I can make an interactive web based tutorial |
00:48:03 | FromDiscord | <Elegantbeef> Nice! |
00:48:17 | User11 | KimJongUnstoppable, I dont know if this'd help but I'm looking at the same problem also. I dont have |
00:48:17 | User11 | a working solution for this but the theory is that the dll needs to dynamically recompute the fixed addresses |
00:48:17 | User11 | when it is loaded to a new process with a different base address from it's prefer base address. The procedure |
00:48:17 | User11 | then is to looping through the dll's relocation descriptors and resolve the symbol's addresses with pointer maths. |
00:48:56 | FromDiscord | <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:44 | FromDiscord | <Elegantbeef> The way it's presently done is so https://play.nim-lang.org/#ix=3C5w |
00:52:43 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5x |
00:53:02 | FromDiscord | <deech> Is there a flag to keep compile time code from doing IO/making syscalls etc? |
00:57:18 | FromDiscord | <Elegantbeef> I know the VM can be sandboxed but dont recall how |
01:01:14 | FromDiscord | <Elegantbeef> Seems what i recall is https://github.com/nim-lang/Nim/pull/16943 |
01:03:40 | FromDiscord | <Elegantbeef> @geekrelief\: odd considering https://play.nim-lang.org/#ix=3C5B works |
01:03:59 | FromDiscord | <geekrelief> In reply to @geekrelief "If I have a": yeah it is odd |
01:04:18 | FromDiscord | <geekrelief> I'm looking at the C I'm maybe I'm missing something |
01:04:30 | FromDiscord | <geekrelief> (edit) removed "I'm" |
01:05:03 | FromDiscord | <geekrelief> nim isn't complaining it's msvc |
01:05:20 | FromDiscord | <Elegantbeef> Yea i know |
01:05:34 | FromDiscord | <Elegantbeef> Well didnt know it was msvc, but knew it was the C compiler |
01:08:57 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5C |
01:09:43 | FromDiscord | <Elegantbeef> I dont think that's a pointer proc |
01:16:28 | FromDiscord | <Elegantbeef> Here we go https://play.nim-lang.org/#ix=3C5D |
01:16:28 | * | andinus quit (Remote host closed the connection) |
01:17:03 | FromDiscord | <Elegantbeef> dont worry about `noConv` was just a test |
01:17:11 | FromDiscord | <Elegantbeef> But here is a pointer proc https://play.nim-lang.org/#ix=3C5F |
01:18:01 | FromDiscord | <geekrelief> hmm |
01:18:41 | FromDiscord | <geekrelief> weird I already have the importc on the nim side |
01:18:57 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5G |
01:19:11 | FromDiscord | <Elegantbeef> The issue is it's not a pointer proc |
01:19:31 | FromDiscord | <geekrelief> ah |
01:19:42 | FromDiscord | <Elegantbeef> i'm probably wrong but you cannot have a variable of a non pointer proc in C |
01:19:44 | FromDiscord | <geekrelief> hmm so the headers neard to be changed |
01:19:49 | FromDiscord | <geekrelief> (edit) "neard" => "need" |
01:20:44 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5H |
01:21:19 | FromDiscord | <geekrelief> I guess I can only use this for casting purposes. |
01:21:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C5I |
01:22:58 | * | neurocyte0132889 quit (Ping timeout: 268 seconds) |
01:23:06 | FromDiscord | <Elegantbeef> Ask TM if that definition makes any sense, i'm not a C programmer, i'm barely a Nim programmer 😛 |
01:23:31 | FromDiscord | <geekrelief> hehe https://cplayground.com/?p=seahorse-gerbil-dog |
01:23:43 | FromDiscord | <geekrelief> yeah my C is pretty rusty |
01:24:46 | FromDiscord | <geekrelief> seems like that's illegal C, I guess I'll stick to casting the proc |
01:26:05 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3C5K |
01:26:16 | FromDiscord | <Elegantbeef> My C is completely unknown since i havent actually ever learned it |
01:26:34 | FromDiscord | <geekrelief> well I learned it.. about 30 years ago?? |
01:26:43 | FromDiscord | <Elegantbeef> You can make a converter if you want to live dangerously 😛 |
01:27:19 | FromDiscord | <geekrelief> would I have to create a converter for each function type? |
01:27:20 | FromDiscord | <Elegantbeef> Alternatively just have an overload that takes a proc that matches |
01:28:08 | FromDiscord | <geekrelief> ah.. nevermind. This is good enough. 🙂 |
01:28:23 | FromDiscord | <geekrelief> thx beef! |
01:28:36 | FromDiscord | <Elegantbeef> No problem |
01:36:48 | * | arkurious quit (Quit: Leaving) |
02:18:42 | FromDiscord | <exelotl> lol I hit a mysterious VM crash this evening. Updated to 1.6 RC3 and it went away :D |
02:19:04 | FromDiscord | <Elegantbeef> Interesting |
02:20:54 | FromDiscord | <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:20 | FromDiscord | <Elegantbeef> Shame |
02:21:45 | FromDiscord | <Rika> what are you programming |
02:22:07 | FromDiscord | <exelotl> The game boy advance, as usual x) |
02:22:14 | FromDiscord | <Rika> ah i forgot |
02:25:41 | FromDiscord | <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:25 | FromDiscord | <Rika> why wouldnt exceptions work on compile time? |
02:28:30 | FromDiscord | <Rika> why would anything change on compile time |
02:29:19 | FromDiscord | <Elegantbeef> I could see exceptions being disabled with `--gc:none` |
02:29:51 | FromDiscord | <Elegantbeef> Could be a mistake that they're disabled at CT aswell |
02:30:48 | FromDiscord | <Rika> this sounds like the CT issue triggered by -d:danger |
02:31:17 | FromDiscord | <exelotl> Here's the issue I raised for it: https://github.com/nim-lang/Nim/issues/18322 |
03:21:36 | nrds | <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:14 | FromDiscord | <Elegantbeef> Generally for stuff like this you supply a len/pointer to first element |
03:25:04 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3C64 |
03:25:34 | nrds | <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:56 | FromDiscord | <Elegantbeef> Well cause a seq has a ptr to data on the heap |
03:26:04 | FromDiscord | <Elegantbeef> Or might be a pointer to data on the heap |
03:26:07 | nrds | <Prestige99> aha |
03:26:56 | FromDiscord | <Rika> address of array is the actual data because all metadata on it is compile time |
03:26:56 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3C66 for a working version you supplied https://play.nim-lang.org/#ix=3C66 |
03:27:04 | FromDiscord | <Elegantbeef> Jeez overly zealous here |
03:27:12 | FromDiscord | <Rika> address of seq is complicated because of size+capacity metadata |
03:28:14 | FromDiscord | <Elegantbeef> The reason what you did didnt work is you were mutating a copy of the seq cause `var a = someSeq` copies |
03:28:40 | FromDiscord | <Elegantbeef> So if you do `var foo = cast[ptr seq[float](data)` you'd have the same behaviour |
03:28:40 | nrds | <Prestige99> Thanks for the info |
03:33:04 | FromDiscord | <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:13 | FromDiscord | <Rika> They’re easier to understand due to the non overlapping syntax for dereferencing and pointer types xd |
03:35:45 | FromDiscord | <Elegantbeef> There's also no ambiguity between collections and pointers to a single value |
03:39:12 | FromDiscord | <impbox [ftsf]> aye, that's really annoying in C |
03:39:51 | FromDiscord | <Elegantbeef> Yep so annoying that even Zig afaik doesnt have it |
03:45:31 | FromDiscord | <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:34 | madprops | apparently openbsd packages the nim compiler |
04:19:55 | madprops | version 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:30 | FromDiscord | <codic> yeah Zig has `T` for single item pointer, `[]T` for multi-item pointer, `[]T` for multi-item pointer + length |
05:41:53 | FromDiscord | <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:47 | FromDiscord | <j-james> so a couple of questions about templates |
06:34:57 | FromDiscord | <Elegantbeef> A couple of answers |
06:35:44 | FromDiscord | <j-james> they describe themselves as simple substitution mechanisms, but you still need to provide them with arguments? |
06:35:55 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=3C6q |
06:36:17 | FromDiscord | <j-james> where the arguments are lifted from the source implementation of echo |
06:36:19 | FromDiscord | <Elegantbeef> You dont need to |
06:36:33 | FromDiscord | <j-james> oh? 👀 |
06:37:10 | FromDiscord | <haxscramper> varargs[string, $] |
06:37:38 | FromDiscord | <Elegantbeef> A template replaces the call site with the body, there is no requirement of parameters |
06:38:07 | FromDiscord | <Elegantbeef> They're hygienic/typesafe by default though, you cannot do `template someThing(a: int) = discard; someThing(32f)` |
06:38:35 | FromDiscord | <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:00 | FromDiscord | <j-james> alright, so replacing `typed` with `string` now works, but its output is framed in quotes and braces |
06:43:45 | FromDiscord | <Elegantbeef> You're passing an array to echo |
06:44:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C6u |
06:45:53 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> Inside templates/macros varargs are a bracket expression of the values they hold |
06:47:01 | FromDiscord | <j-james> ah |
06:47:02 | FromDiscord | <j-james> thank you |
06:49:04 | FromDiscord | <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:16 | FromDiscord | <j-james> like making an alias to `proc`, or defining a `loop` keyword |
06:49:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C6w |
06:50:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3C6x |
06:50:41 | FromDiscord | <Elegantbeef> Notice in the proc example there is nothing special around `name` |
06:50:58 | FromDiscord | <Elegantbeef> In a template if any identifier matches a parameter name it's replaced by it |
07:00:03 | FromDiscord | <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:01 | FromDiscord | <j-james> @ElegantBeef alright, do you know what's wrong in this example? https://play.nim-lang.org/#ix=3C6z |
07:01:58 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> Yea templates dont work like this |
07:06:57 | FromDiscord | <Elegantbeef> Templates are callable code substitution, they're not magic |
07:09:21 | FromDiscord | <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:47 | PMunch | Unfortunately macro/template invocation isn't flexible enough to get exactly that syntax |
07:14:41 | FromDiscord | <Elegantbeef> you can get that with macro wrapper but it's silly to do 😀 |
07:15:10 | PMunch | You can't really, at least without some syntax rewrites |
07:15:21 | FromDiscord | <Elegantbeef> "with a macro wrapper" |
07:16:18 | FromDiscord | <Elegantbeef> Ah i take it back |
07:16:24 | FromDiscord | <Elegantbeef> I'm a liar and a fool |
07:20:00 | FromDiscord | <j-james> ok, that makes sense |
07:20:31 | FromDiscord | <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:21 | FromDiscord | <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:33 | FromDiscord | <j-james> thanks a bunch for the explanations |
07:21:44 | FromDiscord | <Elegantbeef> Eh nim has string templates so you can just replace `proc` with `function` |
07:21:47 | FromDiscord | <Elegantbeef> Not that it makes any sense to do |
07:25:32 | FromDiscord | <Elegantbeef> Here's the silliest approximation you'll get https://play.nim-lang.org/#ix=3C6I |
07:26:14 | FromDiscord | <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:36 | PMunch | j-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:36 | PMunch | original 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:00 | FromDiscord | <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:24 | PMunch | @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:51 | FromDiscord | <Rika> Well if I do take a good amount of inspiration I shall |
08:07:55 | PMunch | What're you working on? |
08:08:09 | FromDiscord | <Rika> The same thing but there’s some stuff that I want to add |
08:08:31 | FromDiscord | <Rika> And it’s not just an easy “fork your fw and add what I want” |
08:09:34 | PMunch | Cool, what are you adding? |
08:10:25 | FromDiscord | <Rika> A screen and a UI for it xd |
08:10:35 | PMunch | I 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:39 | FromDiscord | <Rika> I don’t think it’s trivial to add |
08:10:47 | PMunch | Hmm, depends |
08:10:58 | PMunch | If it's an i2c screen it should be pretty simple |
08:11:01 | FromDiscord | <Rika> Also different MCU, using an ST one in my case |
08:11:06 | PMunch | And what do you mean UI? |
08:11:09 | FromDiscord | <Rika> The screen part is trivial |
08:11:13 | PMunch | ST? |
08:11:35 | FromDiscord | <Rika> Well, configuration of the board without reflashing or even using the computer could be possible |
08:11:41 | Amun-Ra | STMiroelectronics |
08:11:48 | FromDiscord | <Rika> It’s a gimmick sure but that’s what makes it fun |
08:11:59 | PMunch | Aah I see |
08:12:19 | FromDiscord | <Rika> And people love fun semi functional gimmicks |
08:12:33 | PMunch | Shouldn't be too hard, just need to create the layout arrays dynamically instead of statically compiled into the program |
08:12:43 | PMunch | And then have some interface to change them |
08:12:51 | FromDiscord | <Rika> Yeah I have an idea for such |
08:13:21 | FromDiscord | <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:50 | PMunch | You'd be surprised with how much headroom you have once you've removed all the overhead :P |
08:14:13 | FromDiscord | <Rika> Kinda also wanna put an Easter egg, like Vim embedded into the UI lol |
08:14:20 | FromDiscord | <Rika> Sounds fun |
08:14:32 | FromDiscord | <Rika> What overhead does QMK have actually |
08:15:32 | PMunch | No idea, haven't dived too deep into the codebase |
08:16:00 | PMunch | Part of the reason I wrote Badger was because QMK is such a massive code base and it's hard to get into |
08:17:16 | FromDiscord | <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:53 | PMunch | HAL? |
08:18:02 | FromDiscord | <Rika> Hardware abstraction layer |
08:18:10 | FromDiscord | <Rika> Makes it easier to support many MCUs |
08:18:20 | FromDiscord | <Rika> Of course has a cost |
08:18:26 | FromDiscord | <Rika> As with all abstractions |
08:20:41 | PMunch | Ah I see |
08:21:11 | PMunch | I want to make something completely compile-time based for that in Nim |
08:21:21 | PMunch | The Badger libraries is a start to that |
08:21:46 | FromDiscord | <Rika> Yeah a HAL on compile time would be nice |
08:35:02 | PMunch | You can see how I do it for I2C in the Badger library |
08:35:25 | PMunch | Basically using the type system for what it's worth |
08:36:29 | FromDiscord | <Rika> How do you test your fw by the way |
08:36:42 | FromDiscord | <Rika> I don’t have a keyboard or the screen to test |
08:37:34 | PMunch | I upload it to my keyboard and test it there |
08:38:01 | PMunch | I guess you could see if there is a simulator for your chip |
08:38:25 | FromDiscord | <Rika> Oh I have the chip |
08:38:43 | FromDiscord | <Rika> Just not as a keyboard (nor do I have buttons to use to simulate) |
08:38:57 | PMunch | Hmm, then it might be a bit tough |
08:39:03 | PMunch | I mean you could touch wires |
08:39:24 | PMunch | For a single button |
08:39:33 | PMunch | But it's kinda hard to test layouts and such |
08:39:48 | PMunch | Well, I guess you could have a bunch of wires and connect the right ones for your key.. |
08:40:44 | FromDiscord | <Rika> Hmm |
09:22:23 | FromDiscord | <Rika> I’ll be honest your code looks very messy |
09:26:20 | PMunch | The badger code? |
09:26:44 | FromDiscord | <Rika> Yes |
09:27:05 | FromDiscord | <Rika> Less messy more convoluted I guess |
09:27:12 | PMunch | Hmm, what parts seem messy? |
09:27:47 | FromDiscord | <Rika> What is this MCP file thing doing |
09:27:56 | PMunch | Ah, that is the port expander |
09:28:05 | FromDiscord | <Rika> Ah, okay |
09:28:08 | PMunch | It's an I2C device |
09:28:16 | FromDiscord | <Rika> This is a split keyboard right |
09:28:23 | PMunch | Yes |
09:28:28 | PMunch | Each half has a port expander |
09:28:29 | FromDiscord | <Rika> I see that’s why that’s there |
09:28:34 | FromDiscord | <Rika> This will be useful |
09:28:39 | PMunch | And the chip is completely separate from the rest of the board |
09:29:03 | PMunch | You can see how I use them here: https://github.com/PMunch/badger/blob/final/badger.nim#L4-L14 |
09:29:06 | FromDiscord | <Rika> Yes I had plans on using one too |
09:30:15 | FromDiscord | <Rika> What’s the difference between the master and final branches? |
09:30:41 | FromDiscord | <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:26 | PMunch | @Rika, master is up to date with the last video I made on it |
09:32:29 | FromDiscord | <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:42 | FromDiscord | <Rika> Master says 6 months ago versus final 4 months ago |
09:32:53 | PMunch | Final is the version I cleanup up off-camera where everything works and has a layout I can actually use |
09:33:05 | FromDiscord | <Rika> In reply to @Smarc "Why is this not": Full error needed |
09:33:15 | FromDiscord | <Rika> Okay |
09:33:17 | PMunch | I plan to do a video where I go through the changes and then make master into final |
09:33:21 | FromDiscord | <Rika> Okay |
09:33:41 | PMunch | But suddenly life happened and I haven't streamed anything for apparently 6 months.. |
09:33:46 | FromDiscord | <Rika> I still need to think of how to split the workload between the screen handling code and the polling… |
09:34:13 | FromDiscord | <Rika> Though given that I need to buy the hardware first |
09:35:16 | FromDiscord | <Smarc> In reply to @Rika "Full error needed": Error: type mismatch: got <seq[seq[Piece]], seq[Pawn]> |
09:35:42 | PMunch | Emphasis on the "Full" part |
09:36:21 | FromDiscord | <Smarc> sent a code paste, see https://play.nim-lang.org/#ix=3C72 |
09:37:53 | PMunch | Yeah, first argument is a seq[seq[Piece]] |
09:37:59 | PMunch | So T is seq[Piece] |
09:38:44 | FromDiscord | <Smarc> So shouldnt a seq[seq[Piece]] be able to carry seq[Pawn], seq[Knight] etc.? |
09:38:47 | PMunch | But 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:11 | PMunch | Oh wait, oops |
09:39:24 | PMunch | Sorry I read that error wrang |
09:40:29 | FromDiscord | <Smarc> No worries, I think I just have a little comprehension issue here :) |
09:43:32 | FromDiscord | <Rika> The issue is inheritance doesn’t work through a generic I believe |
09:44:03 | PMunch | Yeah seems like it's something like that.. |
09:44:08 | FromDiscord | <Rika> You can add a Pawn to a seq[Piece] but not a seq[Pawn] to a seq[seq[Piece]] |
09:44:51 | PMunch | Typically you'd use variance objects for this in Nim |
09:46:07 | FromDiscord | <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:21 | FromDiscord | <Rika> Think so |
09:47:00 | FromDiscord | <Smarc> Yep, seems to work. Alright, you learn something new every day, thank you guys once more! |
09:53:10 | PMunch | You can always cast the sequence: https://play.nim-lang.org/#ix=3C78 |
09:53:44 | PMunch | Since these are ref objects they are stored as pointers, so a seq[Piece] and a seq[Pawn] should be identical in memory. |
09:55:06 | FromDiscord | <Smarc> Ah, was trying to cast it beforehand but failed, I think this way it is even more convenient |
09:55:26 | PMunch | You can of course also put that logic in a template |
09:56:05 | FromDiscord | <Smarc> Do you mind giving me a mini-example of that as well? I am not familiar with nim templates yet |
09:56:44 | PMunch | https://play.nim-lang.org/#ix=3C79 |
09:57:03 | PMunch | I mean that could also just be a procedure |
09:57:09 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
09:57:16 | PMunch | It 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:58 | FromDiscord | <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:39 | FromDiscord | <Hamid Bluri> hey, can i pass data to a channel from multiple threads? |
10:44:22 | FromDiscord | <Hamid Bluri> i mean can it cause any problems? or i should use separated channels? |
10:44:50 | FromDiscord | <Rika> Behaviour is undocumented for such case, expect issues |
10:44:55 | FromDiscord | <Rika> Afaik |
10:45:22 | FromDiscord | <Rika> There’s a third party package that implements MCMP queues I believe |
10:45:46 | FromDiscord | <Hamid Bluri> `loony` ? |
10:45:53 | FromDiscord | <Rika> I think so yes |
10:46:05 | FromDiscord | <Rika> May be what you want though what you described is MCSP |
10:46:11 | FromDiscord | <Rika> Wrong order |
10:46:15 | FromDiscord | <Rika> SCMP |
10:46:28 | FromDiscord | <Hamid Bluri> thank u |
10:47:23 | FromDiscord | <Hamid Bluri> SCMP: A Single-Chip Message-Passing Parallel ? |
10:47:28 | FromDiscord | <Hamid Bluri> (edit) removed "A" |
10:48:04 | FromDiscord | <Rika> Oops sorry might have misunderstood what MCMP meant |
10:48:18 | FromDiscord | <Rika> But I meant single consumer multi producer |
10:48:24 | FromDiscord | <Rika> My bad |
10:48:27 | FromDiscord | <Hamid Bluri> ok 👍 |
10:48:28 | FromDiscord | <Rika> I don’t do threading |
10:48:28 | PMunch | Single Consumer Multiple Producer* |
10:48:48 | FromDiscord | <Hamid Bluri> blame google not me 😄 |
10:48:58 | PMunch | Nah you were right @Rika |
10:49:06 | FromDiscord | <Rika> Okay |
10:49:22 | PMunch | @Hamid Bluri just wondered what that was short for and googled, got the first thing which is a different thing |
10:50:55 | FromDiscord | <Rika> Okay |
10:51:12 | FromDiscord | <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:18 | FromDiscord | <Rika> Lol |
10:52:10 | PMunch | MCMP 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:37 | PMunch | I mean MCMP is also Munich Center for Mathematical Philosophy |
10:52:46 | PMunch | But that is obviously not what were talking about |
10:53:43 | PMunch | If you Google MCMP queue you get related results |
10:55:59 | FromDiscord | <Hamid Bluri> my every day programming in Nim is a new journey : D |
10:56:59 | FromDiscord | <Hamid Bluri> im really happy that i found out Nim |
10:58:02 | PMunch | It's a great language :) |
10:59:04 | FromDiscord | <Rika> There are still some things I wish were in Nim but sooner or later they’ll be in I hope |
10:59:28 | FromDiscord | <Rika> Nothing comes closer to ideal than Nim, for me |
10:59:40 | PMunch | Ditto |
10:59:44 | PMunch | Is it perfect? No |
10:59:49 | PMunch | But it's the closest thing I've found |
10:59:58 | FromDiscord | <Hamid Bluri> yeah : D |
11:10:56 | PMunch | Hmm, how can I get the inode number of a file in Nim? |
11:12:26 | FromDiscord | <Rika> Stat? |
11:12:37 | FromDiscord | <Rika> Under posix |
11:12:55 | FromDiscord | <Rika> I think that’s wrong |
11:12:59 | FromDiscord | <Rika> I forgot already asked |
11:13:04 | FromDiscord | <Rika> (edit) removed "asked" |
11:13:12 | FromDiscord | <Rika> My keyboard spat out an extra word for some reason |
11:14:15 | FromDiscord | <Rika> No I’m right I believe |
11:15:25 | FromDiscord | <Rika> Stat, then st_ino |
11:15:57 | FromDiscord | <Rika> PMunch “Stat, then st_ino” |
11:16:33 | PMunch | Aha, st_ino seems like the right thing |
11:17:09 | FromDiscord | <Rika> Referenced from https://man7.org/linux/man-pages/man7/inode.7.html |
11:40:27 | FromDiscord | <NullCode1337> hi |
11:40:32 | FromDiscord | <Rika> Hello |
11:40:36 | FromDiscord | <NullCode1337> so yeah my account is disabled |
11:40:40 | FromDiscord | <NullCode1337> alt time |
11:40:55 | FromDiscord | <NullCode1337> don't tell discord |
11:41:07 | FromDiscord | <NullCode1337> I'd hate it if this gets disabled too |
11:41:16 | PMunch | What'd you do to get your account disabled? |
11:41:25 | FromDiscord | <Rika> He hacked discord |
11:42:13 | FromDiscord | <NullCode1337> In reply to @PMunch "What'd you do to": got into their internal servers and gave myself 99 years of nitro |
11:42:22 | FromDiscord | <NullCode1337> just kidding its because of my github |
11:42:56 | PMunch | Because of your GitHub? |
11:43:22 | FromDiscord | <Rika> The malware repositories I assume |
11:44:36 | PMunch | But why would Discord ban someone for what they do on another platform? |
11:45:59 | FromDiscord | <NullCode1337> the repos are related to discord |
11:46:02 | FromDiscord | <NullCode1337> not in a good way |
11:46:37 | PMunch | Ahh, I see |
11:49:52 | FromDiscord | <Rika> Why did you link your account again |
11:49:54 | FromDiscord | <Rika> On your alt |
11:50:05 | FromDiscord | <Rika> If they banned you for your GitHub account |
11:51:48 | FromDiscord | <NullCode1337> i did? |
11:51:49 | FromDiscord | <NullCode1337> FUCK |
11:52:36 | PMunch | Haha! |
11:52:48 | FromDiscord | <NullCode1337> done |
11:52:52 | FromDiscord | <NullCode1337> removed |
11:53:06 | PMunch | *Swing!* *thump* that's the ban-hammer coming down on you |
11:53:44 | FromDiscord | <NullCode1337> lmfao |
12:00:35 | FromDiscord | <tandy> `seq[(string, string)]` can you index a seq like this by content? |
12:00:42 | FromDiscord | <tandy> im using this seq to store http headers |
12:00:55 | FromDiscord | <tandy> i need to get the `x-ratelimit-reset` header value |
12:01:41 | FromDiscord | <Rika> Just use a table |
12:02:55 | FromDiscord | <tandy> are tables imutable |
12:03:03 | FromDiscord | <Rika> They can be |
12:03:22 | FromDiscord | <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:16 | FromDiscord | <Fancy> I can't compile nim to es6? |
12:31:21 | FromDiscord | <Rika> no |
12:31:37 | FromDiscord | <Rika> afaik only target is es3 |
12:35:59 | FromDiscord | <Fancy> Damn is there any workaround for it? |
12:38:26 | FromDiscord | <Fancy> I am guessing I won't be able to use any es6 modules then |
12:39:24 | FromDiscord | <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:32 | FromDiscord | <Rika> or exportc |
12:40:21 | FromDiscord | <rxx> @tandy#0000 @tandy#0000 @tandy#0000 wtf |
12:41:14 | FromDiscord | <Rika> ? |
12:43:35 | FromDiscord | <Fancy> In reply to @Rika "you can write es6": Do you mean in a separate file? |
12:44:06 | FromDiscord | <Rika> wdym? i dont get what you mean |
12:44:25 | FromDiscord | <Rika> nim code compiled to js will compile to es3, but you can do `{.emit: "js code here".}` to insert js code |
12:45:08 | FromDiscord | <tandy> wat↵(@rxx) |
12:45:22 | FromDiscord | <Fancy> Ahhh sorry I think I misread/misunderstood before |
12:45:48 | FromDiscord | <rxx> @tandy#0000 wtf is happening what bot are you who are you |
12:45:53 | FromDiscord | <Fancy> That is a handy feature |
12:46:32 | FromDiscord | <Rika> he;s on matrix, not a bot |
12:46:39 | FromDiscord | <Rika> another chat protocol |
12:46:42 | FromDiscord | <tandy> lol |
12:46:43 | FromDiscord | <haxscramper> People are blown away by bridgfe |
12:47:13 | FromDiscord | <tandy> i am a sentient noob nim programer bot |
12:47:13 | FromDiscord | <Rika> lol |
12:47:28 | FromDiscord | <Rika> pro gamer |
12:47:42 | FromDiscord | <tandy> lol↵(@Rika) |
12:47:53 | FromDiscord | <rxx> ?ban @tandy#0000 |
12:47:55 | FromDiscord | <Fancy> So what I understand is that I can use emit to insert es6 within the file |
12:48:03 | FromDiscord | <Fancy> Correct? |
12:48:04 | FromDiscord | <Rika> yes |
12:48:05 | FromDiscord | <Rika> yes |
12:48:10 | FromDiscord | <Fancy> Ok great |
12:48:16 | FromDiscord | <Rika> i can say yes one more time if you want |
12:48:23 | FromDiscord | <Rika> 😛 |
12:48:26 | FromDiscord | <Fancy> Hahahahaha |
12:48:29 | FromDiscord | <Fancy> yes |
12:48:32 | FromDiscord | <Fancy> Xd |
12:48:37 | FromDiscord | <Fancy> (edit) "Xd" => "XD" |
12:49:05 | FromDiscord | <tandy> how do you get nimble install `requires` ? ive done a `nimble install -d -Y` but ci stil says deps arent there |
12:49:10 | FromDiscord | <tandy> jsony specificaly.. |
12:49:32 | FromDiscord | <tandy> which is on nimble packages so not sure why it wouldnt work |
12:50:18 | PMunch | Hmm, do you have jsony in your requires? |
12:51:48 | PMunch | And @rxx, why would we ban a user who's on a different network using the official bridges? |
12:52:02 | FromDiscord | <Rika> i think theyre joking |
12:54:07 | PMunch | Not the first time someone suggest kicking the noisy "bot" :P |
12:54:34 | PMunch | Or 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:58 | FromDiscord | <tandy> yep↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:41:35 | FromDiscord | <tandy> oh i didnt have it formated correctly, it needed to be `requires "jsony"` |
13:41:47 | PMunch | Yup, what did you have? |
13:42:14 | PMunch | Hmm, Yardanico would it be possible for the bot to do replies better? |
13:42:37 | PMunch | By the way, got Sciter to work? |
13:44:10 | FromDiscord | <tandy> `requires jsony` lol↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:48:08 | PMunch | Aha :P |
13:48:21 | PMunch | And 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:07 | FromDiscord | <tandy> nop, should i report a bug?↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
14:03:47 | PMunch | Hmm, mine throws an error? http://ix.io/3C8i |
14:04:06 | PMunch | Old Nimble version? Or do you import jsony into your .nimble file or declare it as an identifier anywhere? |
14:05:46 | FromDiscord | <no name fits> sent a code paste, see https://play.nim-lang.org/#ix=3C8j |
14:06:23 | FromDiscord | <no name fits> And the order of the lines is random |
14:06:31 | PMunch | performant: switch, readable: depends, maintainable: depends |
14:06:41 | PMunch | How many different keys do you have? |
14:07:20 | FromDiscord | <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:39 | FromDiscord | <no name fits> Like the one I'm processing right now just has two, but another one has five and so on |
14:08:16 | FromDiscord | <Rika> are they well defined |
14:08:20 | FromDiscord | <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:21 | PMunch | Well for a switch you need to implement the logic in a way that it's all known on compile-time |
14:08:34 | FromDiscord | <Rika> as in can you distinguish which value needs which proc without runtime reading |
14:08:35 | FromDiscord | <no name fits> Yes, they're all predefined |
14:08:35 | PMunch | For a Table you could theoretically have them get registered on runtime |
14:08:38 | FromDiscord | <Rika> okay |
14:08:45 | FromDiscord | <no name fits> I can distinguish at build time |
14:08:46 | FromDiscord | <Rika> then a switch is prolly best |
14:08:51 | FromDiscord | <no name fits> Alright |
14:08:56 | FromDiscord | <no name fits> Thanks for the input |
14:09:08 | FromDiscord | <Rika> you can always easily swap if it gets unwieldy |
14:09:17 | PMunch | But maybe but the switch in a proc or template so you just do key.callProc() or something similar |
14:09:24 | FromDiscord | <no name fits> right, I was just thinking of a giant switch case at the end of it |
14:09:48 | FromDiscord | <no name fits> Do you have an example of that PMunch? I haven't used templates yet |
14:10:18 | PMunch | Just go for a proc then :P |
14:10:24 | FromDiscord | <no name fits> alright 🙂 |
14:10:27 | FromDiscord | <no name fits> thanks again guys |
14:10:33 | PMunch | No problem :) |
14:16:48 | FromDiscord | <tandy> nop↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
14:17:02 | FromDiscord | <tandy> also i update nim with choosenim before running that |
14:43:00 | FromDiscord | <gerwy> Yooo↵fricking nimble page for Qt Creator |
14:43:00 | FromDiscord | <gerwy> https://doc.qt.io/qtcreator/creator-project-nimble.html |
14:43:28 | FromDiscord | <gerwy> It's that easy to use Qt with Nim |
14:43:30 | FromDiscord | <gerwy> (edit) "Nim" => "Nim?" |
14:46:43 | ehmry | how did that happen? |
14:47:17 | nrds | <Prestige99> wow that's cool |
14:48:59 | FromDiscord | <haxscramper> No, we only have qml wrappers for now↵(@gerwy) |
14:49:17 | FromDiscord | <gerwy> Yeah i used that qml wrapper |
14:49:18 | FromDiscord | <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:31 | FromDiscord | <gerwy> really struggled to get it to work but it does |
15:06:32 | FromDiscord | <qb> @lmariscal any plans to add glut to nimgl? |
15:07:59 | NimEventer | New Nimble package! nimfunge98 - A Funge-98 interpreter written in nim, see https://git.adyxax.org/adyxax/nimfunge98 |
15:09:47 | FromDiscord | <Rika> oh my GOD NO |
15:10:38 | FromDiscord | <demotomohiro> If I remember correctly, GLUT is not maintained for long time and deprecated.↵glfw is actively maintained. |
15:20:35 | FromDiscord | <qb> Mkay, I'm still using glut to render fonts using `glutBitmapCharacter` |
15:21:04 | FromDiscord | <qb> (edit) "using" => "with" |
15:21:53 | FromDiscord | <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:09 | FromDiscord | <Jonah> (edit) "error" => "exit" |
15:22:32 | FromDiscord | <lmariscal> Yeah, I feel like glwf already covers most of the important stuff, font rendering being the only one left out |
15:23:45 | FromDiscord | <lmariscal> I don't really see the merit in supporting glut, with it being heavily outdated |
15:27:46 | FromDiscord | <demotomohiro> How about to render text to memory and upload it to texture using boxy or pixie?↵https://github.com/treeform/boxy |
15:29:41 | FromDiscord | <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:52 | FromDiscord | <soupayan> also any good books I can follow or the nim website is enough? |
15:34:47 | FromDiscord | <Rika> `Can anyone let me know if there is anything that nim can't do but rust can` |
15:34:49 | FromDiscord | <Rika> you tell me |
15:34:50 | FromDiscord | <Rika> i dont know |
15:35:10 | FromDiscord | <Rika> rust can make you cry idk |
15:36:18 | FromDiscord | <demotomohiro> Nim can do what C can do. So what is rust can do but C cannot? |
15:37:58 | FromDiscord | <demotomohiro> I have learned Nim mostly with Nim manual and std library reference.↵https://nim-lang.org/docs/manual.html |
15:40:06 | FromDiscord | <soupayan> In reply to @Rika "rust can make you": touche to that.. |
15:48:12 | FromDiscord | <tandy> has anyone written a jsony dumphook for renaming a field? |
15:51:18 | FromDiscord | <soupayan> sent a code paste, see https://play.nim-lang.org/#ix=3C94 |
15:52:27 | Amun-Ra | rust can and will compile anything very slow, nim can't do that |
15:53:19 | Amun-Ra | soupayan: you can pass single argument without parentheses, 5.findMax 6 would work |
15:53:53 | FromDiscord | <soupayan> yes it did, but why not like echo specially when the docs say so |
15:54:37 | Amun-Ra | proc echo(x: varargs[typed, `$`]) {...} |
15:54:44 | Amun-Ra | varargs |
15:54:50 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax↵Please read this |
15:56:02 | FromDiscord | <demotomohiro> > This command invocation syntax also works for expressions, but then only a single argument may follow. |
15:58:29 | FromDiscord | <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:06 | FromDiscord | <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:05 | FromDiscord | <Rika> Amun-Ra nim compilation can be slow depending on if you're torturing the VM with insane macros |
16:10:15 | FromDiscord | <demotomohiro> In reply to @soupayan "ok.. so in this": yes |
16:14:22 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3C9c |
16:18:20 | FromDiscord | <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:44 | FromDiscord | <jfmonty2> like `foo = Foo() {.noInit: Foo.x.}` or something |
16:31:14 | FromDiscord | <Rika> not possible afaik |
16:31:24 | FromDiscord | <Rika> i dont know of any plans either |
16:32:13 | FromDiscord | <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:37 | FromDiscord | <demotomohiro> As Nim initialize object types with memset C function, applying noinit pragma only to specific field might not be efficient. |
16:33:04 | FromDiscord | <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:11 | FromDiscord | <jfmonty2> Yeah, seems to slow it down by a few percent, oh well |
17:17:24 | FromDiscord | <juan_carlos> In reply to @haxscramper "No, we only have": I have a Qt wrapper, just need help to finish it... |
17:17:34 | FromDiscord | <exelotl> interesting bug... 🤔 |
17:17:36 | FromDiscord | <exelotl> https://play.nim-lang.org/#ix=3C9m |
17:18:11 | PMunch | @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:20 | FromDiscord | <exelotl> if you move the {.compile.} block up top, the error goes away |
17:18:51 | PMunch | @exelotl, and what's the error? |
17:19:59 | FromDiscord | <exelotl> Error: Invalid node for enum type `nnkPragmaExpr`! |
17:20:06 | FromDiscord | <exelotl> in the call to parseEnum |
17:20:44 | FromDiscord | <exelotl> seems that the pragmas somehow got attached to the enum's AST nodes when they weren't supposed to |
17:22:25 | FromDiscord | <exelotl> seems to be a regression introduced in Nim 1.4 |
17:22:26 | PMunch | Huh, that's odd |
17:36:30 | FromDiscord | <juan_carlos> If someone interested, ping me. |
18:55:22 | nixfreak_nim[m] | !help |
18:55:34 | nixfreak_nim[m] | !pkcs |
18:57:14 | nixfreak_nim[m] | !package pkcs |
19:00:22 | FromDiscord | <Rika> ? |
19:00:31 | FromDiscord | <Rika> there is no package searcher here |
19:00:43 | FromDiscord | <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:57 | nixfreak_nim[m] | I did and found bearSSL |
20:22:20 | nixfreak_nim[m] | just no documentation so I need to look at source code and bearSSL API I guess |
20:36:18 | FromDiscord | <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:39 | FromDiscord | <iffy (Matt Haggard)> nimble version v0.13.1, nim version 1.4.6 |
20:38:22 | FromDiscord | <Rika> Remove the verbose flag |
20:39:39 | FromDiscord | <iffy (Matt Haggard)> Same result |
20:39:54 | FromDiscord | <iffy (Matt Haggard)> (except it include this line\: "9 messages have been suppressed, use --verbose to show them") \:) |
20:41:45 | FromDiscord | <Rika> So what were the lines that were suppressed |
20:43:33 | FromDiscord | <iffy (Matt Haggard)> http://ix.io/3Caf |
20:44:15 | FromDiscord | <juan_carlos> `nimble refresh` ?. |
20:45:45 | FromDiscord | <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:22 | FromDiscord | <iffy (Matt Haggard)> Nope, that wasn't it. `nimble refresh` doesn't help either |
20:49:42 | * | lenis0012 quit (Quit: Client closed) |
20:49:51 | FromDiscord | <Elegantbeef> why 1.4.6? 😀 |
20:50:05 | FromDiscord | <iffy (Matt Haggard)> No reason, shall I try another version? |
20:50:16 | FromDiscord | <Elegantbeef> Well 1.4.8 is the most recent stable |
20:50:37 | FromDiscord | <Elegantbeef> Not that it'll solve this problem just noting the oddity of installing 1.4.6 😛 |
20:51:00 | FromDiscord | <iffy (Matt Haggard)> Oh, I've been using 1.4.6 up to now. Just reinstalling what I already had. |
20:51:04 | FromDiscord | <iffy (Matt Haggard)> This is odd\: $ nimble list -i \| grep nimble↵nimble [0.12.0] |
20:51:11 | FromDiscord | <iffy (Matt Haggard)> $ nimble --version↵nimble v0.13.1 |
20:51:31 | FromDiscord | <Elegantbeef> You seem to have an old package registry file somehow |
20:51:43 | FromDiscord | <Elegantbeef> Updating your nim version to a more modern version may resolve the issue |
20:52:05 | FromDiscord | <iffy (Matt Haggard)> K, trying 1.4.8 |
20:52:26 | FromDiscord | <iffy (Matt Haggard)> Though isn't `nimble refresh` designed to fix old package registry files? |
20:52:40 | FromDiscord | <Elegantbeef> It should fetch the most recent package |
20:52:49 | FromDiscord | <Elegantbeef> But you may hold a bonkers version of nimble somehow |
20:53:29 | FromDiscord | <iffy (Matt Haggard)> Shall I get rid of `~/.nimble` (move it out of place) and reinstall? |
20:53:57 | FromDiscord | <Elegantbeef> It may work, i'm not the best at resolving nimble related issues |
20:54:02 | FromDiscord | <Elegantbeef> I generally just nuke it and restart 😛 |
20:54:11 | FromDiscord | <iffy (Matt Haggard)> Very elegant. Beef. |
20:54:57 | FromDiscord | <Elegantbeef> The elegant part of my name is a distraction from my utter inelegance |
20:55:41 | nixfreak_nim[m] | If you have choosenim , `choosenim stable` then nimble update |
20:57:26 | nixfreak_nim[m] | I have stable 1.4.8 |
20:57:40 | FromDiscord | <iffy (Matt Haggard)> Deleting everything in `~/.nimble/` except `bin/` didn't work. |
20:57:44 | nixfreak_nim[m] | so try to re-install choosenim again |
20:58:15 | nixfreak_nim[m] | wget -qO - https://nim-lang.org/choosenim/init.sh | sh |
20:58:17 | FromDiscord | <iffy (Matt Haggard)> `choosenim stable` gets me to 1.4.0 (and still has the problem) |
20:58:28 | FromDiscord | <iffy (Matt Haggard)> Isn't this a problem with nimble, though? |
20:59:13 | nixfreak_nim[m] | nim , nimble, and tools get downloaded using choosenim |
20:59:39 | FromDiscord | <exelotl> try `choosenim update stable` |
20:59:41 | nixfreak_nim[m] | I would just reinstall |
21:00:37 | nixfreak_nim[m] | I did to reinstall on all my OS's |
21:01:08 | FromDiscord | <iffy (Matt Haggard)> What's the last package in \~/.nimble/packages\_official.json for y'all? Mine is `listsv` |
21:01:33 | nixfreak_nim[m] | what version of choosenim do you have |
21:01:49 | FromDiscord | <iffy (Matt Haggard)> $ choosenim --version↵choosenim v0.8.2 |
21:02:29 | nixfreak_nim[m] | ok so thats the newest |
21:02:50 | nixfreak_nim[m] | you already deleted ~/.nimble/bin/ right |
21:03:22 | nixfreak_nim[m] | what does nimble update stable say ? |
21:03:56 | FromDiscord | <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:57 | nixfreak_nim[m] | so re-install it |
21:05:49 | nixfreak_nim[m] | wget -qO - https://nim-lang.org/choosenim/init.sh | sh |
21:06:04 | nixfreak_nim[m] | Then do a choosenim update |
21:06:07 | FromDiscord | <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:30 | FromDiscord | <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:18 | nixfreak_nim[m] | * choosenim update stable I think |
21:09:41 | nixfreak_nim[m] | nimble.ini |
21:09:42 | nixfreak_nim[m] | tree ~/.nimble/ [16:08:56]... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/68bdc2878e5e88c62b98df388f7b0eeb50850787) |
21:10:06 | FromDiscord | <iffy (Matt Haggard)> Mine is in `~/.config` not `~/.nimble` |
21:10:38 | FromDiscord | <Elegantbeef> `choosenim update` takes a version to update |
21:10:38 | nixfreak_nim[m] | don't have that either |
21:10:45 | FromDiscord | <Elegantbeef> so you'd have to do `choosenim update stable` |
21:11:12 | FromDiscord | <iffy (Matt Haggard)> okay, thank you for checking |
21:12:12 | FromDiscord | <iffy (Matt Haggard)> Yess!!!!! Moving `~/.config/nimble/nimble.ini` was the solution! It was leftover from running the `nimble` tests. |
21:12:20 | FromDiscord | <iffy (Matt Haggard)> Thank you for your patience! |
21:43:19 | FromDiscord | <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:03 | nrds | <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:31 | nrds | <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:51 | FromDiscord | <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:59 | FromDiscord | <impbox [ftsf]> basically without the {.pure.} it's adding an extra hidden field for the type info because it's inheritable |
23:33:13 | nrds | <Prestige99> ah, okay |
23:58:00 | NimEventer | New thread by RainbowAsteroids: Issues trying to use pattern matching, see https://forum.nim-lang.org/t/8510 |