00:01:13 | FromDiscord | <auxym> In reply to @om3ga "what you think, is": yes, it's possible to create a basic UI for linux, using bare x11 if that's what you want |
00:03:12 | FromDiscord | <auxym> any reason why you don't want to use nimx, wxnim, owlkettle, gintro, ui/uing, nimgui, nim-nuklear, nimqml, etc? |
00:13:55 | om3ga | auxym, sorry for the misunderstanding, I mean Graphic desktop environment |
00:14:32 | om3ga | something like pantheonUI, xfce, but more primitive and beautyful |
00:15:35 | om3ga | I mean it should have window app support, spawning new windows, dock like macos has and taskbar with basic stuff |
00:16:44 | om3ga | if that could be written in nim, that can make give many people more freedom to develop it in future, and we will have better alternative to existing things |
00:17:36 | FromDiscord | <auxym> ah. well nimdow and worm exist |
00:17:45 | om3ga | I just fantasize, since of course I understand how non trivial can be |
00:17:56 | om3ga | oh! I missed that |
00:18:28 | FromDiscord | <auxym> not to discourage you from making your own if that's what you feel like doing ofc1 |
00:18:49 | om3ga | nimdow looks very nice! |
00:19:09 | om3ga | awesome that somebody made this |
00:21:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "just the path you": Oh alright |
00:22:31 | om3ga | worm needs better design, reminds me old times |
00:30:03 | * | jmdaemon joined #nim |
00:56:22 | FromDiscord | <etra> so, this sdk has an init function and a close function, and you can get things in between but for you have to delete all these things before closing the sdk, how could represent that in nim? is there something like `with` ala python? |
00:58:17 | * | zgasma quit (Quit: leaving) |
00:58:49 | FromDiscord | <auxym> ARC destructors, `defer` (which is sugar for try/finally), or write your own macro maybe |
01:00:36 | FromDiscord | <jmgomez> sent a long message, see http://ix.io/4pQK |
01:03:03 | * | onetwo quit (Ping timeout: 255 seconds) |
01:03:59 | * | onetwo joined #nim |
01:13:01 | FromDiscord | <Haze System (they/them)> does the ^ in `array[^1]` mean the last index? |
01:26:02 | FromDiscord | <Elegantbeef> `^x` creates a BackwardsIndex |
01:26:03 | FromDiscord | <Elegantbeef> So yes |
01:27:00 | FromDiscord | <demotomohiro> !eval echo [10, 20, 30][^1] |
01:27:06 | NimBot | 30 |
01:34:21 | FromDiscord | <etra> In reply to @auxym "ARC destructors, `defer` (which": what do you mean with macro? |
01:34:26 | FromDiscord | <etra> like, how could it help? |
01:36:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSs |
01:37:31 | FromDiscord | <etra> oh that's cool |
01:42:02 | * | tiorock joined #nim |
01:42:03 | * | tiorock quit (Changing host) |
01:42:03 | * | tiorock joined #nim |
01:42:03 | * | rockcavera quit (Killed (copper.libera.chat (Nickname regained by services))) |
01:42:03 | * | tiorock is now known as rockcavera |
01:58:48 | * | cyraxjoe quit (Quit: I'm out!) |
01:59:02 | * | azimut quit (Quit: ZNC - https://znc.in) |
01:59:47 | * | azimut joined #nim |
02:00:44 | * | cyraxjoe joined #nim |
02:01:48 | * | xet7 joined #nim |
02:05:54 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSv |
02:06:36 | FromDiscord | <Elegantbeef> That's a path |
02:06:48 | FromDiscord | <Elegantbeef> Also not calling this code in top level scope would work 😛 |
02:09:32 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSx |
02:09:54 | FromDiscord | <Elegantbeef> Ah i see |
02:10:14 | FromDiscord | <Elegantbeef> Is sdk a pointer type? |
02:11:09 | FromDiscord | <Elegantbeef> I'm just curious if we could add a `ref` to the Sdk in the types |
02:11:30 | FromDiscord | <Elegantbeef> I assume it's a C api so all cameras are passed by reference |
02:11:36 | FromDiscord | <etra> SDK is just `type Sdk = object`, I used initially to make sure you'd need to have the sdk initializated before doing stuff, but since now I have the block... I guess I could remove it? |
02:12:17 | FromDiscord | <etra> I can push the repo if you're curious, be warned though, as I said, I'm very new at nim lol |
02:12:26 | FromDiscord | <etra> I accept grow advice though :) |
02:12:38 | FromDiscord | <Elegantbeef> Yea i'll take a look |
02:13:00 | FromDiscord | <etra> okey, let me comment it a bit to make more sense out of it |
02:23:05 | FromDiscord | <etra> Elegantbeef: https://github.com/etra0/fujiset |
02:23:13 | FromDiscord | <etra> I'm afraid there's no redistributables for linux, though |
02:24:03 | FromDiscord | <Elegantbeef> Par for the course with imaging equipment |
02:26:48 | FromDiscord | <Elegantbeef> So what I'd do is make `SDK` a `ref object` then store that inside of `CameraObj` |
02:27:10 | FromDiscord | <Elegantbeef> That way you do not need to ever worry about having funky destructors or templates |
02:27:14 | FromDiscord | <Elegantbeef> It's just pure ref counting |
02:28:14 | FromDiscord | <Elegantbeef> Though sdl and friends just expect the user to call `init` and `close` properly |
02:28:20 | FromDiscord | <etra> oh nice, I thought on doing that but I wasn't sure it'd work |
02:29:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSB |
02:29:28 | FromDiscord | <Elegantbeef> Which is better is between you and your deity |
02:30:37 | FromDiscord | <etra> if you were my deity, which one would you chose, I like the idea of the ref object because that way the user wouldn't even have to call anything externally :ferrisThink: |
02:30:42 | FromDiscord | <etra> (edit) "chose," => "chose?" |
02:31:04 | FromDiscord | <etra> I mean, apart for at least the init function |
02:31:48 | FromDiscord | <Elegantbeef> Well depends on what your concerns are |
02:33:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSC |
02:35:15 | FromDiscord | <etra> In reply to @Elegantbeef "Well depends on what": my only concert is that the SDK cannot be deinit before explicitly destroying the object otherwise a weird messagebox will appear which I'd guess it's hardcoded in the DLL |
02:35:19 | FromDiscord | <etra> (edit) "concert" => "concern" |
02:35:25 | FromDiscord | <etra> (edit) "object" => "objects" |
02:35:40 | FromDiscord | <Elegantbeef> Well then the ref object seems fine |
02:35:50 | FromDiscord | <Elegantbeef> You do not even need to expose the deinit procedure |
02:36:08 | FromDiscord | <Elegantbeef> Also for the love of all things good, do not use include like you are |
02:36:27 | FromDiscord | <Elegantbeef> Just friggin import the module and export all the symbols you want exported |
02:36:59 | FromDiscord | <etra> is include discouraged? I didn't know :laugh: |
02:37:34 | FromDiscord | <Elegantbeef> include is only used in rare situations, like where you want to seperate files but due to cyclical relationships need to include |
02:37:58 | FromDiscord | <Elegantbeef> `import` works properly with only public symbols usable `include` works like C where it pastes the file where it's called |
02:39:16 | FromDiscord | <etra> how do I re-export a symbol? if I have something defined in `fuji/defines.nim` but I want to use it in `fujiset.nim`? |
02:39:48 | FromDiscord | <Elegantbeef> `export defines` for exporing modules |
02:40:04 | FromDiscord | <Elegantbeef> same can be done for all symbols |
02:40:11 | FromDiscord | <Elegantbeef> but you can also use the export marker on a symbol or field |
02:40:15 | FromDiscord | <Elegantbeef> `var myVar: int` |
02:41:17 | FromDiscord | <Elegantbeef> I say you can `export defines` to export a module, but that works with any symbol aswell |
02:42:14 | FromDiscord | <etra> yeah but for example, fujiset.nim uses only `fuji.nim`, I don't want to expose `fuji/defines.nim` entirely, is there a way I can re-export something from the defines in the `fuji.nim`, or am I asking for something I shouldn't bother |
02:42:32 | FromDiscord | <Elegantbeef> What do you want to export? |
02:43:07 | FromDiscord | <Elegantbeef> do you want to export all that `fuji` exports? |
02:43:09 | FromDiscord | <etra> for example I cannot longer use `ConnectionType` from `fujiset.nim` |
02:43:14 | FromDiscord | <Elegantbeef> If so you can do `export fuji` inside `fujiset` |
02:43:19 | FromDiscord | <etra> (edit) "`fujiset.nim`" => "`defines.nim`" |
02:43:38 | FromDiscord | <Elegantbeef> Inside fuji you can `export ConnectionType` if you want |
02:44:07 | FromDiscord | <etra> oh okey, yeah, that worked! |
02:44:07 | FromDiscord | <Elegantbeef> Then inside `fujiset` you can `export fuji` to expose all of it's exposed symbols |
02:46:40 | FromDiscord | <etra> if I do `type Sdk = ref object`, in the init function I do have to do `result = new object`? or is that implicit? |
02:46:57 | FromDiscord | <Elegantbeef> Nope you need to allocate |
02:47:06 | FromDiscord | <Elegantbeef> so you either need `new result` or the more sensible `Sdk()` |
02:55:39 | FromDiscord | <etra> huh: https://play.nim-lang.org/#ix=4pSF |
02:55:59 | FromDiscord | <etra> the destroy for the SDK is not getting called if I use `ref object` apparently? |
02:56:20 | FromDiscord | <Elegantbeef> You're using playground to tesT? |
02:56:31 | FromDiscord | <etra> locally didn't work either |
02:56:42 | FromDiscord | <etra> i did a repro to check if I was doing something wrong |
02:57:42 | FromDiscord | <Elegantbeef> This is odd |
03:01:16 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSH |
03:01:38 | FromDiscord | <etra> oh wait, if I do destroy, do I have to manually destroy all its fields? |
03:04:52 | FromDiscord | <Elegantbeef> Yes |
03:04:58 | FromDiscord | <Elegantbeef> That's the problem 😄 |
03:08:04 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSI |
03:10:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSJ |
03:12:14 | FromDiscord | <etra> ok yeah that works in my pc but not in playground, weird |
03:13:02 | FromDiscord | <Elegantbeef> Playground uses refc |
03:14:26 | FromDiscord | <etra> aah gotchu |
03:15:23 | FromDiscord | <etra> man, seeing this main compared to calling the raw c api makes me happy |
03:15:27 | FromDiscord | <etra> it's so much pretty lol |
03:16:20 | FromDiscord | <etra> going from left to right makes me happy https://media.discordapp.net/attachments/371759389889003532/1081414793413541949/image.png https://media.discordapp.net/attachments/371759389889003532/1081414793660993556/image.png |
03:17:45 | FromDiscord | <etra> this is kinda funny to me https://media.discordapp.net/attachments/371759389889003532/1081415151560962168/image.png |
03:44:26 | FromDiscord | <etra> I have a function that gives me `seq[SomeEnum]`, how can I convert it to `set[SomeEnumFlags]`? |
03:44:47 | FromDiscord | <etra> (edit) "`set[SomeEnumFlags]`?" => "`set[SomeEnum]`?" |
03:44:56 | FromDiscord | <Elegantbeef> `toSet` inside `std/setutils` |
03:50:17 | FromDiscord | <etra> lmao I did all this effort for the wrapper and apparently my camera doesn't support the API I need :crypalm: |
03:50:42 | FromDiscord | <etra> I guess we go back to ImHex and the backup file :godwhy: |
04:32:40 | * | azimut quit (Remote host closed the connection) |
04:34:12 | * | azimut joined #nim |
05:56:05 | * | arkurious quit (Quit: Leaving) |
07:01:41 | * | azimut quit (Ping timeout: 255 seconds) |
08:34:20 | * | rockcavera quit (Ping timeout: 268 seconds) |
08:34:28 | FromDiscord | <Enigmanark> sent a code paste, see https://play.nim-lang.org/#ix=4pTp |
08:35:29 | FromDiscord | <Enigmanark> Or rather, how I can make it mutable? 🤔 |
08:36:41 | FromDiscord | <Rika> for i in coins.mitems: |
08:37:12 | FromDiscord | <Rika> for uses the immutable `items` iterator implicitly |
08:37:29 | FromDiscord | <Rika> explicitly specify `mitems` to use the mutable version |
08:37:53 | FromDiscord | <Enigmanark> Oh okay, thanks 😄 Simple |
08:38:06 | FromDiscord | <Rika> this also naturally means `coins` must be mutable |
08:38:16 | FromDiscord | <Enigmanark> Yeah |
08:40:05 | FromDiscord | <Enigmanark> Nice, now I just need to dynamically spawn more coins and the simple experiment will be finished. 🙂 |
09:09:55 | FromDiscord | <FurryP> sent a long message, see http://ix.io/4pTx |
09:33:13 | * | filcuc joined #nim |
09:35:33 | Zevv_ | Can anyone explain to me how nimble is supposed to work these days, I feel stupid as it has not worked for me over the last month |
09:35:44 | FromDiscord | <Rika> In reply to @FurryP "Is there an alternative": The issue you mention specifies that it is broken when the search string is empty |
09:35:48 | Zevv_ | I am developing a package. I used to do `nimble develop` so that the global nimble repo gets a symlink to my pacakge |
09:35:54 | FromDiscord | <Rika> You ask about the replace string being empty |
09:36:06 | Zevv_ | that does not work anymore. I do nimble develop, but then my package can still not be found when I import it. |
09:36:40 | FromDiscord | <Elegantbeef> you now need to do `nimble develop -g packagename` |
09:36:41 | FromDiscord | <Elegantbeef> I believe |
09:36:48 | FromDiscord | <Elegantbeef> With nimble 0.14+ |
09:37:04 | Zevv_ | then it downloads the package from the internets and does not use my local package |
09:37:22 | Zevv_ | fuck all this, I'm just switching to --path in my nim.cfg |
09:37:24 | FromDiscord | <Elegantbeef> I think you can use it in your package directory |
09:37:25 | Zevv_ | i should have long ago |
09:39:26 | FromDiscord | <Elegantbeef> Yea this develop change is the most annoying change |
09:39:39 | Zevv_ | yeah sorry, was not snapping at you |
09:46:08 | FromDiscord | <firasuke> how do you extract a file name from a url? do you treat it as a regular path and use `std/os`? |
09:47:03 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/uri.html#Uri + and std/os |
09:47:55 | FromDiscord | <Elegantbeef> Do not know if there is a better tool |
10:00:32 | FromDiscord | <Phil> Is this notation of `x'123'` something general that is known outside of sqlite? |
10:01:02 | FromDiscord | <Phil> I'm trying to wrap my head around what it does, apparently `x'313233'` is `"123"` and I don't really get it |
10:01:24 | FromDiscord | <Phil> Context are Blobs stored in sqlite |
10:01:43 | FromDiscord | <Rika> Looks like he’s |
10:01:45 | FromDiscord | <Rika> Hex |
10:01:59 | FromDiscord | <Rika> Hex 31 32 33 match ASCII 123 |
10:03:21 | FromDiscord | <Phil> Ohhhh |
10:03:38 | FromDiscord | <Phil> I still don't immediately recognize hex whenever I see it |
10:03:42 | FromDiscord | <Phil> Thanks! |
10:07:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pTI |
10:07:54 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4pTI" => "https://play.nim-lang.org/#ix=4pTJ" |
10:08:16 | FromDiscord | <Phil> Hmm wait that's sqlite behaviour, less so lowdb behaviour |
10:09:05 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/5Do |
10:13:16 | FromDiscord | <Phil> Still wonder what `x''` does |
10:15:07 | FromDiscord | <Phil> > BLOB literals are string literals containing hexadecimal data and preceded by a single "x" or "X" character. Example: X'53514C697465' ↵↵So a "Blob" literal |
10:20:43 | FromDiscord | <FurryP> In reply to @Rika "You ask about the": Correct, the replace string being empty does not work either. |
10:21:10 | FromDiscord | <FurryP> (edit) "does" => "is" | "work" => "allowed" |
10:21:31 | FromDiscord | <FurryP> (edit) "either." => "either in multiReplace()" |
10:23:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pTM |
10:27:20 | FromDiscord | <Phil> How that gets converted into the actual blob-string is also super weird in the test that makes use of that query |
10:28:33 | FromDiscord | <FurryP> In reply to @Rika "You ask about the": Yes correct, but just tested it again. Was probably something else I did why the replace did not work as expected. |
10:29:00 | FromDiscord | <theSherwood> Anyone know the right way to get a value from a `TomlValueRef` using the toml_serialization library? I've tried a few things, `val.<key>`, `val[<key>]`, `val.tableVal[<key>]`. I'm sure I'm missing something simple. |
10:29:54 | FromDiscord | <Phil> Ref sounds like it's a ref type, you sure you don't need to unref-it first using `[]` ? |
10:33:08 | FromDiscord | <theSherwood> Oh. I didn't know that was a thing. `val[]` doesn't bother the compiler. But I still seem unable to get anything from that value. |
10:37:24 | FromDiscord | <Phil> It's a ref TomlValue, here's the type-definition:↵https://github.com/status-im/nim-toml-serialization/blob/b189c104f7eeb2c8c2cdc9d103415dc7a6a36037/toml_serialization/types.nim#L95↵↵Seems like you can use `$` on TomlValueRef, or you unref the type and make a case-statement over the various TomlValueKinds |
10:37:32 | FromDiscord | <Phil> (edit) "TomlValueKinds" => "TomlKinds" |
10:39:38 | FromDiscord | <theSherwood> I was looking at these lines in the tests:↵https://github.com/status-im/nim-toml-serialization/blob/b189c104f7eeb2c8c2cdc9d103415dc7a6a36037/tests/test_features.nim#L196-L197 |
10:41:03 | FromDiscord | <theSherwood> Also this file where there seem to be a lot of procs for getting values:↵https://github.com/status-im/nim-toml-serialization/blob/b189c104f7eeb2c8c2cdc9d103415dc7a6a36037/toml_serialization/value_ops.nim#L128-L132 |
10:41:24 | FromDiscord | <theSherwood> It looks like that file may not be exported from the main module though. |
10:44:27 | * | filcuc quit (Ping timeout: 256 seconds) |
10:54:10 | FromDiscord | <Phil> In reply to @theSherwood "It looks like that": That shouldn't discourage you from just importing it through if you want to use it that way |
10:54:41 | FromDiscord | <theSherwood> I can import that file directly? What does that look like? |
10:55:21 | FromDiscord | <Phil> `import tomlserialization/<path-to-module>` |
10:55:30 | FromDiscord | <Phil> or whatever the name of the package is |
10:55:47 | FromDiscord | <Phil> path is relative to the main module nim file |
10:57:47 | FromDiscord | <theSherwood> Well, that's an easy solution. Thanks, PHil |
12:01:09 | FromDiscord | <Phil> Wait, is `"\0x\0"` the hex representation of 0? |
12:01:11 | * | filcuc joined #nim |
12:02:11 | FromDiscord | <Phil> (edit) "the hex" => "some kind of" |
12:10:06 | FromDiscord | <Rika> What? |
12:10:49 | * | filcuc quit (Ping timeout: 252 seconds) |
12:20:50 | FromDiscord | <Phil> It literally dawned on me that the previous test description of ndb was literally lying to me |
12:23:10 | FromDiscord | <Phil> Basically, sqlite has a Blob datatype.↵When you run `SELECT x'007800'` it generate a Blob that can be represented by the ASCII string `"\0x\0"`↵I'm trying to figure out what either of those are about |
12:23:22 | FromDiscord | <Phil> is `\0x\0` some kind of `nil` representation or something? |
12:25:29 | FromDiscord | <Rika> What? |
12:25:42 | FromDiscord | <Rika> I don’t see the connection with null |
12:28:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pUb |
12:31:41 | FromDiscord | <Rika> I can’t see anything about that value being connected with null |
12:32:29 | FromDiscord | <Phil> Man, imagine giving your tests comprehensive names instead of cryptic ones |
12:35:40 | FromDiscord | <Phil> Wait, could it be that 0x0 stands for the memory address "null" ? |
12:43:31 | FromDiscord | <Phil> Hmm or maybe that test is just to make sure that surrounding a value with hex-nulls doesn't affect the internal value somehow |
12:44:32 | * | PMunch_ joined #nim |
12:53:59 | FromDiscord | <firasuke> how to convert a hash to string? `echo` is outputting it just fine, but I don't know how to compare it against other strings and such |
13:02:01 | PMunch_ | `$` is the "to string" operator in Nim |
13:02:16 | PMunch_ | echo applies `$` on each argument passed to it |
13:02:40 | * | PMunch_ is now known as PMunch |
13:02:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pUk |
13:03:07 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4pUk" => "https://play.nim-lang.org/#ix=4pUm" |
13:04:13 | PMunch | @Phil: https://nim-lang.org/1.0.0/manual.html#lexical-analysis-string-literals |
13:04:47 | FromDiscord | <Phil> Ohhh so that's a nim thing? |
13:05:11 | FromDiscord | <Phil> "Interpret the following 2 characters as hex-numbers, not as characters" |
13:05:19 | FromDiscord | <Phil> That's why that works, ahhhhh |
13:06:36 | PMunch | Yup |
13:08:09 | * | derpydoo quit (Quit: derpydoo) |
13:08:21 | * | jmdaemon quit (Ping timeout: 255 seconds) |
13:16:24 | Zevv_ | PMunch: i need some input from npeg users for a possible api change |
13:16:38 | Zevv_ | code blocks always make an implicit capture, $0 or captures[0] |
13:16:40 | PMunch | Fire away |
13:16:41 | FromDiscord | <Phil> How do we do parameterized tests in nim? |
13:16:46 | Zevv_ | but in the matjority of my parsers i never use that myself |
13:16:57 | Zevv_ | is that something you do, or are your captures always >explicit |
13:17:18 | Zevv_ | there's quiet a bit of overhead in capture handling compared to the basic parser inner loop |
13:17:29 | Zevv_ | so i'd love to drop those implicits because they usually run for nada |
13:19:07 | PMunch | Hmm, I think I've used it for debugging purposes, but I don't think I actually ever use it for anything |
13:19:24 | Zevv_ | right, thanks |
13:19:33 | PMunch | I do use `captures.len` quite a bit though, and I'm guessing I'll have to decrease all those numbers by one with this change? |
13:19:37 | Zevv_ | i might just go forward on this, until now 100% of the respondands don't use this |
13:19:54 | Zevv_ | yeah that's a good question. I coudl just put an empty "" in captures[0] |
13:19:57 | * | PMunch is now known as Zevv |
13:19:57 | Zevv_ | although that's kind of silly |
13:20:14 | Zevv | Did you leave an IRC client running somewhere by the way? |
13:20:17 | * | Zevv is now known as PMunch |
13:20:32 | Zevv_ | oh probably I usually have more than one |
13:20:57 | Zevv_ | i'm flattered by your need to be me |
13:21:33 | Zevv_ | it's one of the quirks of IRC that I always loved; it never gave the impression the internet is safe in any way. |
13:21:37 | PMunch | Just by the way, you can use /msg NickServ ghost Zevv to kick the other client off your nick |
13:21:43 | PMunch | I assume you already know that though |
13:21:57 | PMunch | Haha, that's a good point actually |
13:22:00 | Zevv_ | your identity can be hijacked in a second. any service that says it prevents that is lying to you |
13:22:45 | PMunch | Why is grabbing the 0 capture so expensive by the way? |
13:22:57 | Zevv_ | any capture is relatively expensive |
13:23:36 | Zevv_ | it's an alloc and two stack operations, the least |
13:23:44 | PMunch | Fair enough |
13:23:45 | Zevv_ | well no, not an alloc anymore, I changed that |
13:23:58 | Zevv_ | oh hell it *is* an alloc I now see |
13:24:08 | Zevv_ | well, it shouldn't |
13:24:16 | PMunch | You could make it a deferred system. Leave an empty string as the first capture. Then make captures a distinct and implement `len` and `[]`. In `[]` check if idx == 0 and captures[idx].len == 0, then grab the capture and store it |
13:24:36 | Zevv_ | they are distinct already |
13:24:55 | Zevv_ | there's basically an dummy object wrapper for them because I want to be able to generate proper errors instead of indexerror |
13:25:18 | * | azimut joined #nim |
13:25:22 | Zevv_ | but the .len will still still messy. 1 for zero captures. |
13:25:27 | Zevv_ | i hadn;t thought of that yet |
13:41:45 | PMunch | Aah right |
13:43:12 | Zevv_ | that's a thoughie |
13:53:34 | FromDiscord | <Phil> Ah yes, test suite of name `getRow()` with name `empty`, how informative |
13:55:29 | PMunch | Crap.. I'm trying to build something for a Teensy 2.0, and for some reason Ratel doesn't seem to work any longer.. |
13:57:51 | PMunch | I'm able to build, and upload |
13:58:01 | PMunch | But it doesn't get out of the bootloader.. |
14:03:01 | Zevv_ | well, go blink some leds then |
14:08:56 | PMunch | I tried just a simple blink.. Still no dice |
14:09:24 | FromDiscord | <firasuke> In reply to @PMunch_ "echo applies `$` on": ok thanks |
14:09:56 | PMunch | Oh wait.. |
14:10:03 | PMunch | Blinking LED does actually work |
14:12:30 | PMunch | Hmm |
14:12:43 | PMunch | It seems like it's just the serial TTY which doesn't work.. |
14:14:20 | PMunch | It doesn't even show up in lsusb.. |
14:29:44 | FromDiscord | <auxym> what usb stack does that teensy use? or it it an external ftdi type ic? |
14:29:59 | PMunch | Oh god damn it.. |
14:30:11 | PMunch | I completely forgot that it has it's own USB serial thingy.. |
14:33:56 | PMunch | @auxym, the Teensy 2.0 is just an ATmega 32u4 |
15:14:51 | * | filcuc joined #nim |
15:22:23 | FromDiscord | <auxym> 32u4 has its own USB controller I think? I was thinking usb stack as in what USB library software, but I guess it uses Microchip's own libs |
15:22:50 | FromDiscord | <auxym> ps. dont discount a bad USB cable or flaky/bad USB ports on the computer, I've had both happen recently :S |
15:23:14 | PMunch | Oh yeah, the problem was just that I was writing out over the normal serial and not the USB serial :P |
15:23:43 | PMunch | It has its own controller yeah, and Teensy has a usb_serial library to run serial over it |
15:29:51 | FromDiscord | <auxym> weird that it wasnt showing up in lsusb though |
15:31:10 | PMunch | Well I never called usbInit |
15:31:19 | PMunch | So it never sent a "hello" message over USb |
15:36:19 | PMunch | Hmm, not quite sure what's going on, but it doesn't work |
15:36:57 | PMunch | I'm doing the same thing I do in Badger, but waiting for the USB configuration never completes |
15:39:24 | PMunch | I guess it's time to get out my logic analyzer and inspect the USB communication.. |
15:40:26 | FromDiscord | <djazz> and its not something silly like upgrading linux kernel without rebooting? 😅 |
15:44:31 | PMunch | Nope, it works if I program it in Arduino |
15:44:38 | FromDiscord | <djazz> kk |
15:52:51 | PMunch | Hmm, I think the error is actually that Nim is messing up my progmem stuff again.. |
15:53:34 | FromDiscord | <Enigmanark> sent a code paste, see https://play.nim-lang.org/#ix=4pVo |
15:59:00 | FromDiscord | <I have 50GB of nothing on my PC> when are compilation time imporvements (so, mostly, IC) planned for now? |
16:00:16 | PMunch | Seems like I was right, it's basically just sending 0s instead of the data I intended to send. Probably an issue with progmem.. |
16:00:47 | * | azimut quit (Ping timeout: 255 seconds) |
16:01:04 | FromDiscord | <auxym> In reply to @I have 50GB of nothing on my PC "when are compilation time": https://github.com/nim-lang/RFCs/issues/503 |
16:01:21 | * | derpydoo joined #nim |
16:07:00 | * | filcuc quit (Ping timeout: 255 seconds) |
16:09:08 | Zevv_ | PMunch: so what was the problem with the bootloader |
16:13:02 | PMunch | Bootloader? |
16:14:33 | FromDiscord | <Enigmanark> 🤔 So...I got it to compile and run. And all I did was import the file that contained Sprite? I guess that...kind of makes sense? I assumed it would be defined considering it's imported into the file that contains player. xD |
16:19:33 | Zevv_ | PMunch: your atmel thingy not booting |
16:19:51 | PMunch | I had an atmel which wasn't booting? |
16:21:01 | FromDiscord | <auxym> microchip (formerly atmel) 😉 |
16:21:23 | FromDiscord | <Hourglass [She/Her]> I should probably work on redoing my plugin system a bit |
16:21:34 | Zevv_ | PMunch: dude |
16:21:40 | Zevv_ | your ratel thingy didn't boot earlier today |
16:22:00 | Zevv_ | are you pulling my leg or am i stupid today |
16:22:55 | PMunch | Oh :P |
16:22:58 | FromDiscord | <auxym> as an occasional user of plugin systems, im pretty sure they are very hard to get right |
16:23:01 | PMunch | That's the thing I'm still working on |
16:23:23 | PMunch | It did actually boot, I just hadn't set up the USB properly |
16:23:32 | Zevv_ | and you didn't realize waht I was talking about |
16:23:33 | Zevv_ | haha |
16:23:53 | PMunch | And apparently Nim has broken how progmem works, again, so it's just sending null bytes.. |
16:24:31 | Zevv_ | again |
16:24:37 | Zevv_ | put it in CI |
16:25:39 | Zevv_ | it's cool having 16 targets for your language |
16:25:43 | Zevv_ | but hard if you test only 2 or 34 |
16:25:45 | Zevv_ | 3 |
16:26:30 | * | rockcavera joined #nim |
16:27:22 | PMunch | Nice, this was a bug I had already fixed in Badger |
16:27:29 | PMunch | Guess I should port that fix to Ratel. |
16:27:46 | PMunch | But first I need to cook some dinner.. |
16:34:44 | FromDiscord | <Hourglass [She/Her]> In reply to @auxym "as an occasional user": The only issue mine is having rn is that `AsyncSocket` dislikes me calling `send` from a shared library |
16:35:04 | FromDiscord | <Hourglass [She/Her]> It refuses to send anything to the socket after numerous attempts |
16:36:44 | FromDiscord | <Hourglass [She/Her]> It seems to be a bug so I've reported it now |
16:40:25 | * | filcuc joined #nim |
16:44:15 | * | arkurious joined #nim |
16:45:10 | * | junaid_ joined #nim |
16:57:57 | * | filcuc quit (Ping timeout: 255 seconds) |
17:18:10 | * | azimut joined #nim |
17:20:00 | FromDiscord | <Nilts> I keep on getting 403 Forbidden when trying to access a static svg file in jester. |
17:20:07 | FromDiscord | <Nilts> why does this happen? |
17:32:38 | FromDiscord | <jmgomez> The vm with ORC is so bugged in 1.6.10 that you cant even do `$` or even `split` over a string :/ Anyone faced this before? |
17:36:06 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4pVF |
17:49:15 | FromDiscord | <Nilts> In reply to @not logged in "I keep on getting": just realized, i probably need to change the perms |
17:50:57 | FromDiscord | <Nilts> Ok, `chmod o+r` fixed it |
17:55:46 | FromDiscord | <jmgomez> In reply to @etra "if I have an": not sure if there is another way but you con traverse the fields and see if 2 is a valid permutation if you want to support bitmask or just a valid value if you dont |
17:58:58 | FromDiscord | <pmunch> Oh cool, Nim is a featured language for "Mechanical March" over on Exercism\: https://youtu.be/_PPXEJZ7gOg |
18:36:59 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pVP |
18:38:01 | FromDiscord | <Nilts> (edit) "https://play.nim-lang.org/#ix=4pVP" => "https://play.nim-lang.org/#ix=4pVQ" |
18:38:15 | FromDiscord | <Nilts> (edit) "https://play.nim-lang.org/#ix=4pVQ" => "https://play.nim-lang.org/#ix=4pVR" |
18:51:12 | FromDiscord | <hotdog> In reply to @not logged in "Can someone please help": What’s the code? |
18:54:08 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pVS |
18:56:32 | * | derpydoo quit (Ping timeout: 248 seconds) |
19:00:51 | FromDiscord | <Nilts> First one is in a async proc |
19:01:26 | arkanoid | why global vars change address when using inside an async proc? |
19:02:19 | arkanoid | for example var "running" in https://play.nim-lang.org/#ix=4pVU |
19:10:20 | Zevv_ | you are not printing the address of running |
19:10:41 | Zevv_ | you are printing the address of a copy of `running` on the stack that gets passed to `echoAddress` |
19:10:57 | Zevv_ | and async fucks with the stack, the stack is not a stack |
19:11:06 | Zevv_ | which is why the address changes |
19:11:16 | Zevv_ | make your `echoAddress()` a template to see the real address of `running` |
19:12:52 | Zevv_ | does that make sense? |
19:13:41 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pVZ |
19:14:23 | FromDiscord | <Phil> (db is an sqlite db connection that gets created before the test |
19:14:25 | FromDiscord | <Phil> (edit) "test" => "test)" |
19:17:54 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pW0 |
19:18:17 | FromDiscord | <Phil> But it doesn't check for anything |
19:18:24 | FromDiscord | <Phil> It doesn't even check if an exception is thrown or a defect occurs |
19:18:42 | FromDiscord | <Phil> Like, even as test for causing exceptions that's a bad test |
19:20:11 | FromDiscord | <guttural666> how do I mutably loop over a collection with for again? chatGPT is letting me down |
19:20:41 | Zevv_ | mitems / mpairs |
19:20:41 | FromDiscord | <Phil> In reply to @guttural666 "how do I mutably": mItems iterator? |
19:20:52 | FromDiscord | <guttural666> yes thank you |
19:21:26 | FromDiscord | <guttural666> I will inform chatGPT |
19:24:22 | FromDiscord | <Nilts> sent a code paste, see https://paste.rs/1Tk |
19:24:28 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/Z78 |
19:25:05 | FromDiscord | <Phil> (edit) "https://paste.rs/adF" => "https://play.nim-lang.org/#ix=4pW4" |
19:25:14 | * | sagax joined #nim |
19:27:48 | * | Notxor joined #nim |
19:27:53 | arkanoid | Zevv_: it makes sense! thanks! |
19:34:05 | FromDiscord | <tfp> qq, why isn't the dtor called for this type? |
19:34:07 | FromDiscord | <tfp> https://media.discordapp.net/attachments/371759389889003532/1081660864521834686/image.png |
19:34:12 | FromDiscord | <tfp> i thought that this would work |
19:34:16 | FromDiscord | <tfp> actually does nim playground not use ORC? |
19:34:37 | FromDiscord | <tfp> ah yeah it uses refc |
19:34:41 | FromDiscord | <tfp> how can i make it use ORC? |
19:35:08 | Zevv_ | you can't |
19:35:26 | Zevv_ | it doesn't run devel |
19:35:44 | FromDiscord | <tfp> o |
19:36:12 | FromDiscord | <tfp> well ok nvm it works with orc on local so |
19:36:13 | FromDiscord | <tfp> all good |
19:38:23 | FromDiscord | <tfp> also is there any way to just have the dtor directly on Foo instead of having the FooValue thing? |
19:38:44 | Zevv_ | nope |
19:39:15 | FromDiscord | <tfp> ok |
19:39:18 | FromDiscord | <tfp> thx |
19:41:52 | arkanoid | do iterators have something like environment as closures? how do they keep state between calls? |
19:42:11 | Zevv_ | these are hidden for view, you can't access these\ |
19:42:42 | Zevv_ | s/for/from/ |
19:43:22 | Zevv_ | but yes, there are closure like things involved where the state lives, but unfortunately there is no other way to interact with these than for loops |
19:43:29 | Zevv_ | you can't "manually" iterate an iterator |
19:44:14 | FromDiscord | <tfp> https://media.discordapp.net/attachments/371759389889003532/1081663408929263686/image.png |
19:44:27 | FromDiscord | <tfp> does anybody know what this comment from https://github.com/nim-lang/Nim/issues/18421 means |
19:44:42 | arkanoid | and where does this environment lives? is it on the stack or on the heap? |
19:44:53 | Zevv_ | heap |
19:44:57 | arkanoid | thanks |
19:44:57 | Zevv_ | which is logical, if you think about it |
19:45:13 | Zevv_ | because the normal stack-based control flow is broken |
19:45:20 | arkanoid | yes, I was betting on it, I just wanted to ask |
19:45:50 | Zevv_ | tfp: if you override a destructor, you should make sure it actually destructs what you pass in |
19:46:14 | Zevv_ | the snippet on top does not detroy the `name` member of the object in the `=destroy()` proc, I guess that's what ar4q ment |
19:46:31 | Zevv_ | arkanoid: if you feel brave and want to have much more control, take a peek at CPS |
19:46:37 | Zevv_ | it offers what iterators offer, but on steroids |
19:49:52 | arkanoid | Zevv_: I'm very curious about CPS, I discovered the concept with Nim, I went reading some papers about them but I got lost. Async is already spending all my IQ points I guess |
19:51:01 | Zevv_ | well, the thing with CPS is, the basic idea is actually very simply. You get to see and touch all the mechanics involved. There is no hidden magic. |
19:51:40 | Zevv_ | it's like vim I guess, the learning curve is somewhat steep |
19:51:49 | Zevv_ | but once you take the hurdle, it might be worth it |
19:52:16 | Zevv_ | this kind of sums it all up: https://raw.githubusercontent.com/nim-works/cps/master/docs/cps.svg |
19:52:18 | PMunch | Wohoo, this message is written on a membrane keyboard from an old laptop connected to a Teensy 2.0 with custom firmware written in Nim! |
19:52:58 | Zevv_ | prove it. |
19:53:06 | Zevv_ | it looks the same as any of your other messages. |
19:55:05 | PMunch | Hello Zevv! |
19:55:09 | Zevv_ | PMunch: where's the source, I'd like to see your nim usb stack |
19:56:24 | PMunch | Currently the source is just on my machine :P |
19:56:37 | Zevv_ | quick, make a backup! |
19:56:49 | PMunch | It uses the same USB stuff as Badger though |
19:57:25 | PMunch | https://github.com/PMunch/badger/blob/final/keyboard.nim |
19:57:53 | PMunch | That's the keyboard stuff, and here is the actual Badger firmware: https://github.com/PMunch/badger/blob/final/badger.nim |
19:58:01 | Zevv_ | aaah that explains |
19:58:49 | Zevv_ | is USB done in software or is the chip hw or ROM doing the hard work for you? |
19:59:36 | Zevv_ | ah I see, the chip has proper USB support |
19:59:40 | Zevv_ | that's nice |
19:59:44 | PMunch | And here's your damn proof! https://youtu.be/zMSLCPasjsg |
20:00:06 | PMunch | Yeah, it's the Atmega32u4 which has built in USB |
20:00:13 | Zevv_ | Yes, signature verified I saw what you were typing there |
20:00:27 | Zevv_ | nice toy |
20:00:44 | Zevv_ | the shirt came in btw: https://libera.ems.host/_matrix/media/v3/download/matrix.org/HbBhRivXHqWCBKXjKacotEAd/ima_1bc9159.jpeg |
20:01:33 | PMunch | Haha, that is magnificent :P |
20:02:26 | PMunch | The keyboard will be put back in the laptop with a single board computer, batteries, charging circuitry, and ePaper screen :) |
20:02:46 | PMunch | Just need to get the trackpoint working and I think I'm good to assembly everything! |
20:02:52 | Zevv_ | cool stuff |
20:05:47 | FromDiscord | <guttural666> @PMunch are the error messages of nimlsp completely distinct from the compiler or how does that work? |
20:06:01 | PMunch | Yeah, looking forward to finally have it done. Has taken way longer than I expected :P |
20:06:16 | PMunch | @guttural666, nimlsp is basically just nimsuggest with an LSP frontend |
20:06:35 | PMunch | And nimsuggest is basically just the compiler, but instead of compiling code it just gathers information |
20:06:46 | FromDiscord | <guttural666> okay okay |
20:06:51 | FromDiscord | <Elegantbeef> nimlsp uses nimsuggest which is practically a slightly modified compiler |
20:06:52 | FromDiscord | <Elegantbeef> The optimisations nimsuggest uses apparently can cause tooling issues |
20:06:58 | FromDiscord | <Phil> @amadan wanna do a lowdb bugfix for me? |
20:07:32 | FromDiscord | <Phil> Has nothing to do with any code you submitted, I'm just currently refactoring and stumbled over what I think might be a pretty bad bug |
20:07:32 | FromDiscord | <guttural666> so I can blame whoever wrote nimsuggest or the compiler for useless error messages? 😄 |
20:07:41 | FromDiscord | <Phil> (edit) "bug" => "bug↵That I really don't want to deal with." |
20:07:50 | FromDiscord | <Elegantbeef> Just blame nimsuggest and carry on 😄 |
20:08:54 | FromDiscord | <guttural666> this kind of stuff, I have no clue what is wrong here, I just see a middle finger and "go find out yourself" 😄 https://media.discordapp.net/attachments/371759389889003532/1081669618193670144/image.png |
20:09:14 | FromDiscord | <Elegantbeef> If the tooling fails, just use the compiler |
20:09:28 | FromDiscord | <guttural666> I'll try |
20:10:08 | * | cyraxjoe quit (Ping timeout: 248 seconds) |
20:10:24 | * | cyraxjoe joined #nim |
20:13:39 | FromDiscord | <tfp> In reply to @Zevv_ "tfp: if you override": oh you have to manually destroy stuff? i guess because you "overrode" the normal dtor? |
20:13:44 | FromDiscord | <tfp> is there a way to call the old dtor? |
20:13:52 | FromDiscord | <Elegantbeef> nope |
20:14:04 | FromDiscord | <guttural666> yeah, should have done this earlier, the compiler knows de way, fixed my problem, thanks! |
20:14:07 | FromDiscord | <tfp> huh |
20:14:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pWj |
20:17:55 | FromDiscord | <tfp> i just don't like how there's all this trivia around it |
20:18:08 | FromDiscord | <Elegantbeef> PRs welcome |
20:18:11 | FromDiscord | <Elegantbeef> \:d |
20:18:57 | FromDiscord | <tfp> mmmmmm |
20:19:02 | FromDiscord | <tfp> maybe one day |
20:19:45 | Zevv_ | well, what's a typical use case for this stuff |
20:20:24 | Zevv_ | for me it's usually only for something RAII involving os resources |
20:20:39 | Zevv_ | or making atomic RCs to make nim behave in a multithreaded env |
20:20:59 | Zevv_ | but in practice, when do you even need your own destructors? |
20:21:20 | FromDiscord | <Elegantbeef> Custom collections |
20:21:34 | Zevv_ | but yeah beef, it's crappy that we can't call the original one dude. |
20:21:38 | Zevv_ | who wrote this shit |
20:21:44 | FromDiscord | <Nilts> In reply to @not logged in "Can someone please help": Can anyone help? |
20:21:50 | FromDiscord | <Elegantbeef> I do not disagree |
20:22:07 | Zevv_ | i never thought about that, actually, having the original one at hand |
20:22:13 | FromDiscord | <Elegantbeef> The real trick is to make your base type, then make your real type a distinct type |
20:22:14 | Zevv_ | I can see it might come handy sometimes |
20:22:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pWn |
20:23:07 | Zevv_ | sure, but it's all boilerplating |
20:23:13 | FromDiscord | <Elegantbeef> Just like that you now have the default constructor and your own |
20:23:16 | FromDiscord | <tfp> In reply to @Zevv_ "but in practice, when": RAII |
20:23:43 | Zevv_ | I guess for some people, destroctors should be something simple in which you can 'hook' your code that gets called when something gets destroyed, without having to care about the destroying itself |
20:23:47 | FromDiscord | <tfp> i was planning on using it for loads of stuff in my game engine-- everything from pooling DB handles, to cleaning up Observable handlers, etc |
20:24:03 | FromDiscord | <tfp> cleaning up resource handles with a LRU cache |
20:24:14 | FromDiscord | <tfp> but all of that kicked off by the last reference going out of scope |
20:24:23 | Zevv_ | well, you *can*, right |
20:24:23 | FromDiscord | <Elegantbeef> Hmph maybe it's better to use inheritance for this problem.... |
20:24:35 | Zevv_ | but destructors are pretty low level things in nim |
20:24:37 | FromDiscord | <Elegantbeef> Ideally the compiler has a `callDefaultDestructor` but alas |
20:24:45 | Zevv_ | you basically get control, but you get responsibilities with it |
20:25:04 | FromDiscord | <tfp> i will probably wrap it with a macro to just make it easier |
20:25:07 | * | jmdaemon joined #nim |
20:25:12 | FromDiscord | <tfp> i was planning on using nim as a scripting language for my game too |
20:25:39 | Zevv_ | and ship the compiler VM with your game to run the scripting? |
20:25:39 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pWo |
20:25:52 | FromDiscord | <tfp> scripts would be compiled AoT, just loaded as wasm modules |
20:26:05 | FromDiscord | <Phil> Because it should work, I have functioning test-suites in packages that use this package that work, but on my machine it doesn't |
20:26:12 | FromDiscord | <Elegantbeef> Ah the chadiest Nim scripting 😄 |
20:26:46 | FromDiscord | <tfp> the cope is that one day i'll just replace nim with my own language and solve all the nitpicks |
20:26:56 | FromDiscord | <tfp> but i'll probably never even get to the point of finishing the game so |
20:26:56 | Zevv_ | yeah that's what we all do |
20:27:10 | FromDiscord | <Phil> By using the macro system to its extreeeeeeme |
20:27:20 | FromDiscord | <Phil> All built atop of micros |
20:27:50 | FromDiscord | <Elegantbeef> Wait you're using micros? |
20:28:02 | Zevv_ | what, aren't you? |
20:28:06 | FromDiscord | <tfp> sent a code paste, see https://paste.rs/4KM |
20:28:08 | Zevv_ | we are all using micros here? didn't you know? |
20:28:21 | FromDiscord | <Elegantbeef> Hey do not gaslight me |
20:28:41 | FromDiscord | <Elegantbeef> https://github.com/PhilippMDoerner/lowdb tfp link |
20:28:42 | Zevv_ | oh shit sorry I thought I was still on #micros |
20:28:50 | FromDiscord | <Phil> In reply to @Elegantbeef "Wait you're using micros?": Not yet, still had no moment where I had to use macros and recently it was all about documentation |
20:29:02 | FromDiscord | <Phil> On every level ever |
20:29:08 | FromDiscord | <Phil> So much flipping documentation |
20:29:22 | FromDiscord | <Hourglass [She/Her]> Rip |
20:29:24 | FromDiscord | <Phil> Now I'm refactoring a test-suite which is also a kind of documentation |
20:29:28 | FromDiscord | <Elegantbeef> What's "documentation"? |
20:29:52 | FromDiscord | <Phil> Things that transfer knowledge from you to other people via funny shapes on your screen |
20:30:04 | FromDiscord | <tfp> i tried running ur thing phil |
20:30:13 | FromDiscord | <tfp> sent a code paste, see https://play.nim-lang.org/#ix=4pWr |
20:30:14 | FromDiscord | <tfp> i installed it |
20:30:15 | FromDiscord | <tfp> i swear |
20:30:26 | FromDiscord | <tfp> oh does nimble install not add it to your nimble file |
20:30:27 | FromDiscord | <tfp> aha |
20:30:28 | FromDiscord | <Phil> That is super weird |
20:30:39 | FromDiscord | <Phil> That is correct |
20:30:49 | FromDiscord | <tfp> ok there we go |
20:31:00 | FromDiscord | <tfp> sent a code paste, see https://play.nim-lang.org/#ix=4pWs |
20:31:07 | FromDiscord | <Phil> Okay, you have the same issue |
20:31:23 | FromDiscord | <Phil> That is various degrees of bad, I just don't know which level |
20:31:41 | FromDiscord | <tfp> :^) |
20:32:05 | FromDiscord | <Elegantbeef> Atleast -273.15 |
20:32:08 | FromDiscord | <Phil> At least I know that it was not me that introduced the issue |
20:33:00 | FromDiscord | <Phil> Which doesn't help much because I still didn't write the majority of the code so that still means digging through the majority of the code to see what went wrong |
20:36:46 | * | junaid_ quit (Remote host closed the connection) |
20:38:11 | FromDiscord | <Nilts> Can someone help me or am i doing something wrong in asking a question... |
20:39:31 | FromDiscord | <amadan> In reply to @Isofruit "<@259999449995018240> wanna do": Sure, hopefully it isn't too difficult lol |
20:41:58 | FromDiscord | <Elegantbeef> You're attempting to await a `JsObject` |
20:44:07 | FromDiscord | <Nilts> In reply to @Elegantbeef "You're attempting to await": It returns future, not jsobject though, and there is no await await |
20:44:26 | FromDiscord | <Elegantbeef> Show the code |
20:45:44 | FromDiscord | <Nilts> In reply to @Elegantbeef "Show the code": more of it? |
20:46:10 | FromDiscord | <Elegantbeef> You didnt show any you provided an error |
20:46:10 | FromDiscord | <Elegantbeef> Show the line that's erroring |
20:46:17 | FromDiscord | <guttural666> In reply to @Elegantbeef "Atleast -273.15": paid attention to physics class |
20:46:32 | FromDiscord | <Nilts> In reply to @Elegantbeef "Show the line that's": I did already: https://discord.com/channels/371759389889003530/371759389889003532/1081658398367563866 |
20:46:37 | FromDiscord | <Elegantbeef> I just have a good memory for numbers |
20:46:52 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4pWt |
20:46:58 | FromDiscord | <Nilts> (edit) "https://discord.com/channels/371759389889003530/371759389889003532/1081658398367563866" => "https://discord.com/channels/371759389889003530/371759389889003532/1081650790348894388" |
20:47:00 | FromDiscord | <guttural666> In reply to @Elegantbeef "I just have a": that is one i too remembered from class |
20:48:53 | FromDiscord | <Phil> In reply to @amadan "Sure, hopefully it isn't": Would be lovely, I'm tweaking around in the test-suite and by the time I could get to this quite some time will likely have passed |
20:49:41 | FromDiscord | <Elegantbeef> You do not annotate the procedure as async |
20:49:45 | FromDiscord | <Elegantbeef> That might be the issue i do not know |
20:49:45 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pWv |
20:50:07 | FromDiscord | <Nilts> In reply to @Elegantbeef "You do not annotate": what do you mean annotate? |
20:50:20 | FromDiscord | <Elegantbeef> you do not use the `async` pragma on the procedure |
20:50:52 | FromDiscord | <Elegantbeef> I do not know much about js async + ffi |
20:51:15 | FromDiscord | <Nilts> In reply to @Elegantbeef "you do not use": which procedure? The js native one does not use it. |
20:51:39 | FromDiscord | <Elegantbeef> `watchTextFile` should be annotated async i believe |
20:51:42 | FromDiscord | <Elegantbeef> I do not know with js ffi |
20:52:53 | FromDiscord | <amadan> In reply to @Isofruit "Would be lovely, I'm": Good news! Doesn't look to be a bug with lowdb |
20:53:00 | FromDiscord | <Phil> ? |
20:53:05 | FromDiscord | <Phil> Test issue then? |
20:53:20 | FromDiscord | <amadan> Test issue? |
20:53:59 | FromDiscord | <Nilts> In reply to @Elegantbeef "`watchTextFile` should be annotated": It does not work. Idk what to do |
20:54:04 | FromDiscord | <amadan> I've tested it and found two ways to fix it↵Looks like it was just a user error with SQLite |
20:54:35 | FromDiscord | <Nilts> (edit) "In reply to @Elegantbeef "`watchTextFile` should be annotated": It does not work. Idk what to ... doyou" added "do," | "do,do ... " added "you know anyone skilled in nim jsffi?" |
20:56:12 | FromDiscord | <hotdog> @Nilts sorry just stepped out for a bit. Should the type of watchers not be JsObject? |
20:57:26 | FromDiscord | <Nilts> In reply to @hotdog "<@910899642236043294> sorry just stepped": it should be, but i am never awaiting the watchers var |
20:58:40 | FromDiscord | <hotdog> I mean in the watchTextFile definition |
20:59:06 | FromDiscord | <Nilts> In reply to @hotdog "I mean in the": it should be jsobject in the def, yes |
20:59:29 | FromDiscord | <auxym> In reply to @auxym "anyone have a tip": That's a compiler exception right? How do I build a debug compiler again? 1.6.10 is no crashing actually, just devel |
20:59:32 | FromDiscord | <hotdog> In reply to @not logged in "it should be jsobject": Does that change the error? |
21:00:33 | * | derpydoo joined #nim |
21:00:37 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pWz |
21:01:56 | FromDiscord | <Phil> In reply to @amadan "Test issue?": As in, did I write that test wrong.↵The reason this popped up was because during refactoring the test-suite I noticed that insertID didn't add the ID to the row |
21:02:03 | FromDiscord | <jmgomez> A PoC of the NimVM inside UE 😄 https://media.discordapp.net/attachments/371759389889003532/1081682994244362270/Untitled_Project.mp4 |
21:02:34 | FromDiscord | <Phil> Or rather, the only reason I noticed that was because I noticed it wasn't tested anywhere that insertID actually did anything other than return a number |
21:02:46 | FromDiscord | <Phil> (edit) "Or rather, the only reason I noticed that was because I noticed it wasn't tested anywhere that insertID actually did anything other than return a number ... " added "and thus added tests of my own to properly cover that" |
21:03:04 | FromDiscord | <guttural666> In reply to @jmgomez "A PoC of the": what the fuck is this sound |
21:03:28 | FromDiscord | <amadan> In reply to @Isofruit "As in, did I": Yeah the test is wrong.↵In postgres there is a `SERIAL` which works as expected, but it doesn't exist in SQLite |
21:03:38 | FromDiscord | <guttural666> (edit) "sound" => "sound, seems like cock and ball torture is going on in the background" |
21:03:55 | FromDiscord | <jmgomez> In reply to @guttural666 "what the fuck is": haha the keyboard being to close to the mic, sorry about that lol |
21:04:02 | FromDiscord | <guttural666> hahahahaha |
21:04:05 | FromDiscord | <Phil> So in sqlite there's no expectation that it does anything other than return an id? |
21:04:41 | FromDiscord | <amadan> It can return 0 if it errors iirc |
21:05:47 | FromDiscord | <Phil> What the heck is that proc |
21:07:17 | FromDiscord | <amadan> https://www.sqlite.org/c3ref/last_insert_rowid.html↵I'm talking about the internal function it uses sorry (I've just woken up and bit sleep lol 😅)↵I think lowdb converts that 0 to an error last I remember looking at it |
21:07:25 | FromDiscord | <amadan> (edit) "sleep" => "sleepy" |
21:07:37 | FromDiscord | <Phil> Either way, I think this explains why I'm only encountering the error in lowdb and not in norm |
21:07:40 | FromDiscord | <Phil> The SERIAL bit I mean |
21:07:54 | FromDiscord | <Phil> I'll just change that to int in the test |
21:10:52 | FromDiscord | <Phil> Thanks for digging into that! |
21:11:21 | FromDiscord | <hotdog> In reply to @not logged in "I did not change": Oh I see. What does the generated code look like? |
21:11:40 | FromDiscord | <hotdog> For the line that’s erroring |
21:13:34 | FromDiscord | <Nilts> In reply to @hotdog "Oh I see. What": I tired expand macros, but it expands after the type check that is causing the error |
21:15:38 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pWI |
21:16:03 | FromDiscord | <Phil> Seems like it's always defaulting to A and that's why it initially passed |
21:18:55 | FromDiscord | <amadan> Least it was caught 😄 ↵I'll fix that up |
21:21:44 | FromDiscord | <Phil> Leave the test-suite for that up to me, I'll merge that into my test-suite-refactor branch either way |
21:25:42 | * | ltriant quit (Ping timeout: 255 seconds) |
21:25:52 | FromDiscord | <Phil> Nobody ever complain over long test-names again when I use given-when-then pattern, ever |
21:26:17 | FromDiscord | <hotdog> In reply to @not logged in "I tired expand macros,": If you can create a small reproduction I’ll be able to take a look later. Hard to tell exactly what’s happening on the phone |
21:26:49 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pWK |
21:27:06 | FromDiscord | <hotdog> And reducing it to a smaller version may make the error more obvious too |
21:39:27 | FromDiscord | <Phil> I swear I need to write some nimibook...docs...after I'm... god damnit |
21:39:39 | FromDiscord | <Phil> Docs getting me once again |
21:42:17 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pWO |
21:45:57 | FromDiscord | <Nilts> wait nvm |
21:46:48 | FromDiscord | <sigmasd> maybe you should just use importjjs |
21:49:03 | FromDiscord | <Nilts> I fixed it, i was setting f again to something wack earlier in the async function, but thanks to all who helped! |
21:53:35 | * | azimut quit (Ping timeout: 255 seconds) |
21:56:32 | FromDiscord | <Nilts> New problem! I am sure good at coming across these, how do i disable CORS on static files in jester? |
22:04:17 | FromDiscord | <Nilts> Like add a header to all static serves |
22:04:58 | * | azimut joined #nim |
22:08:48 | arkanoid | is "ptr ptr cschar" == "cstring" ? |
22:09:36 | FromDiscord | <Elegantbeef> Nope it's `cstringarray likely` |
22:09:38 | FromDiscord | <Elegantbeef> Whoops |
22:09:43 | FromDiscord | <Elegantbeef> `cstringarray` likely |
22:11:06 | arkanoid | I am failing to create something compatible with "ptr UncheckedArray[ptr ptr cschar]". I'm trying with "allocCStringArray([]).unsafeAddr", but it doesn't like it |
22:11:40 | arkanoid | first time using https://nim-lang.org/docs/system.html#cstringArray |
22:11:48 | FromDiscord | <Elegantbeef> Jesus that's a cursed type |
22:11:59 | FromDiscord | <Elegantbeef> That's 3 pointer indirection |
22:12:07 | FromDiscord | <Elegantbeef> That's not a cstring array |
22:12:17 | FromDiscord | <Elegantbeef> a cstring array is `ptr cstring` or `ptr ptr char` |
22:13:23 | arkanoid | It should be "char *argv[]" |
22:13:46 | FromDiscord | <Elegantbeef> That's a `ptr UncheckedArray[cstring]` |
22:14:31 | arkanoid | no, sorry, should be &"char *argv[]" |
22:14:48 | FromDiscord | <Phil> In reply to @amadan "Least it was caught": Fun fact, lowdb/ndb defines a custom `?` operator that turns`?3` into the DbValue equivalent, it's basically like `dbValue(3)` |
22:15:06 | arkanoid | wait I can pass the C code: https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c , I'm trying to call "gst_init (&argc, &argv);" |
22:15:39 | arkanoid | futhark created for me "proc gstinit*(argc: ptr cint; argv: ptr UncheckedArray[ptr ptr cschar]): void {.cdecl, importc: "gst_init".}" |
22:16:21 | PMunch | Isn't that UncheckedArray one pointer too deep? |
22:16:54 | FromDiscord | <Elegantbeef> Write that'd be a `var int, var ptr UncheckedArray[cstring]` |
22:16:57 | FromDiscord | <Elegantbeef> Right\ |
22:17:05 | FromDiscord | <Elegantbeef> Well `var cint` |
22:17:24 | FromDiscord | <hotdog> In reply to @not logged in "New problem! I am": Haven’t used jester in a long time I’m afraid. there might be a solution here https://forum.nim-lang.org/t/4903 |
22:18:22 | arkanoid | PMunch: hey! Thanks for the futhark update! I'm playing with 0.9.0 feature right now |
22:18:33 | PMunch | Glad you like it :) |
22:18:43 | PMunch | Which feature are you playing with? |
22:20:26 | arkanoid | well, I'm just trusting what clang/futhark is suggesting me. The original function signature is "void gst_init(int *argc, char **argv[]);" -> "proc gstinit*(argc: ptr cint; argv: ptr UncheckedArray[ptr ptr cschar]): void {.cdecl, importc: "gst_init".}" |
22:20:48 | arkanoid | PMunch: I like outputPath a lot! :) |
22:21:26 | PMunch | Does Futhark generate UncheckedArray? |
22:21:28 | arkanoid | the define-based compile logic is much easier for me to think with. |
22:21:50 | arkanoid | yes, the line I pasted is exactly what futhark generated for me |
22:21:57 | PMunch | Huh |
22:24:17 | arkanoid | futhark generated a 55k lines nim file for a very large lib like gstreamer just by importc: "gst/gst.h", impressive |
22:24:48 | PMunch | It kinda feels like magic |
22:25:18 | arkanoid | it is, you dark wizard |
22:26:16 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Write that'd be a": Hey beef posted a video above with the vm interoping with UE. There are issues when compiling it with ORC but got around then by avoiding generic stuff. What I wanted to do definitely can be done, thanks again for the help! |
22:26:28 | FromDiscord | <Elegantbeef> No problem |
22:28:19 | FromDiscord | <Elegantbeef> https://streamable.com/90r58l such an upgrade from 😛 |
22:28:45 | PMunch | Hmm, is there a way to have `bycopy` applied to procedures instead of types? |
22:29:08 | FromDiscord | <Elegantbeef> Nope it's mainly just for C interop |
22:29:40 | PMunch | Yeah I know |
22:30:04 | arkanoid | PMunch: do you think the futhark-generated type is wrong for "void gst_init(int *argc, char **argv[]);" ? |
22:30:06 | PMunch | But I want Futhark to pass objects by copy to C procedures, but allow Nim to optimise passing of the object internally.. |
22:30:16 | PMunch | arkanoid, no that looks correct |
22:31:11 | PMunch | Ah well, I think it should actually be `ptr ptr UncheckedArray[ptr cschar]` or `ptr ptr UncheckedArray[cstring]` |
22:32:14 | FromDiscord | <Elegantbeef> Well given it uses `&` i'd argue it should be `var ptr UncheckedArray[cstring]` but yea C/C++ sucks |
22:32:40 | PMunch | Sure, var would be better |
22:32:55 | PMunch | Of course for Futhark there's no way to know the intended semantic |
22:35:36 | arkanoid | PMunch: sure, beyond two indirections it's also impossible for me, too :P |
22:43:22 | arkanoid | will nim consider type "ptr UncheckedArray[ptr ptr cschar]" compatible with "ptr ptr UncheckedArray[ptr cschar]" or I need to explicit this semantic / cast? |
22:43:47 | PMunch | I doubt so, but you should be able to use the Futhark retype functionality to change the type |
22:45:24 | arkanoid | PMunch: yes, I was reading about that right now |
22:48:20 | arkanoid | it seems to be used just for retyping object fields. I need to retype a function argument (char **argv[]) so I think here I just have to use defines? |
22:49:24 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pX1 |
22:49:40 | PMunch | Oh right.. |
22:49:41 | PMunch | Hmm |
22:49:53 | PMunch | Yeah I guess I should add a way to retype procedure arguments |
22:50:10 | arkanoid | np |
22:50:31 | PMunch | Hmm, for tomorrow I'm going to try and get my Teensy to behave as a USB mouse with the trackpoint device |
22:50:59 | PMunch | Then I need to figure out how to behave as both a USB keyboard, and a USB mouse at the same time.. |
22:53:04 | arkanoid | PMunch: like those pesky usb dongles for wireless keyboard+mouse? |
22:53:13 | PMunch | Pretty much |
22:54:02 | arkanoid | I remember doing so using usb-gadget mode of pi zero |
22:54:17 | arkanoid | surely nothing like writing it into a microcontroller :P |
22:57:22 | PMunch | Hmm, it appears like it should be fairly simple actually |
23:03:50 | PMunch | However I'm out of pins on the Teensy.. |
23:04:00 | PMunch | So I have to do some trickery.. |
23:05:51 | PMunch | Hmm, I wonder if having it connected to the keyboard matrix would mess with the analog signal |
23:06:03 | PMunch | Maybe I can just dual purpose some pins |
23:06:37 | PMunch | Oh well, that's for tomorrow to figure out |
23:06:40 | PMunch | Good night |
23:06:41 | * | PMunch quit (Quit: leaving) |
23:09:52 | FromDiscord | <auxym> In reply to @PMunch "Then I need to": the tinyusb repo has HID descriptor samples for combined kb/mouse/gamepad device, IIRC |
23:10:08 | FromDiscord | <auxym> writing HID descriptors from scratch is, uh, not fun |
23:11:38 | arkanoid | btw it seems that futhark failed to found most of cstrings in this context, for example "ptr cschar" is not turned into a cstring argument |
23:13:01 | FromDiscord | <auxym> but i do have a nim macro to write HID report descriptors, in case that interests anyone. currently in the process of attempting to document it, if I could just get nim doc to cooperate https://github.com/auxym/nim-tinyusb/blob/master/src/tinyusb/class/hid.nim#L970 |
23:18:12 | FromDiscord | <tsoj> Is there a (posix) Nim way to lock a file? |
23:19:11 | arkanoid | what's the difference from a "cstring" and a "ptr cschar" ? |
23:22:23 | FromDiscord | <auxym> In reply to @tsoj "Is there a (posix)": do you know which C function that would be? I'm not super familiar with posix, but there are lots of bindings here: https://nim-lang.org/docs/posix.html (eg there is `lockf` is that is what you're after) |
23:23:36 | FromDiscord | <tsoj> lockf might work, I was looking for flock and didn't find it |
23:23:51 | FromDiscord | <auxym> In reply to @arkanoid "what's the difference from": IIRC, the signedness of `char` (cstring = `char`) in C is implementation-defined. I assume `cschar` means you're explicitly specifying `signed char ` |
23:24:42 | FromDiscord | <Rika> flock is a bsd unix thing |
23:24:45 | FromDiscord | <Rika> Not posix |
23:24:50 | FromDiscord | <auxym> In reply to @tsoj "lockf might work, I": should be pretty easy to bind it with `importc`, you can use the stuff in the posix as an example |
23:25:30 | Amun-Ra | tsoj: and flockfile? |
23:26:03 | FromDiscord | <tsoj> lol flockfile flock lockf fcntl too many choices |
23:26:13 | Amun-Ra | ah, it's in std/io but not exportable, proc flockfile(f: File) {.importc, nodecl.} |
23:26:22 | FromDiscord | <Rika> Only lockf and fcntl is posix iirc |
23:26:41 | Amun-Ra | flockfile is posix, too |
23:27:33 | FromDiscord | <Rika> That one i wasnt aware of haha |
23:28:11 | FromDiscord | <tsoj> In reply to @Amun-Ra "ah, it's in std/io": what do you mean it's in std/io? I can't find it |
23:29:09 | Amun-Ra | tsoj: I mean it's in io.nim but it's not marked with * |
23:29:19 | FromDiscord | <tsoj> ah okay |
23:29:26 | Amun-Ra | add proc flockfile(f: File) {.importc, nodecl.} to your code, et voila |
23:30:40 | * | Batzy quit (Ping timeout: 246 seconds) |
23:35:21 | * | ltriant joined #nim |
23:39:14 | * | Notxor quit (Remote host closed the connection) |
23:39:43 | * | ltriant quit (Ping timeout: 248 seconds) |
23:58:40 | arkanoid | auxym, thanks |