<< 04-03-2023 >>

00:01:13FromDiscord<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:12FromDiscord<auxym> any reason why you don't want to use nimx, wxnim, owlkettle, gintro, ui/uing, nimgui, nim-nuklear, nimqml, etc?
00:13:55om3gaauxym, sorry for the misunderstanding, I mean Graphic desktop environment
00:14:32om3gasomething like pantheonUI, xfce, but more primitive and beautyful
00:15:35om3gaI mean it should have window app support, spawning new windows, dock like macos has and taskbar with basic stuff
00:16:44om3gaif 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:36FromDiscord<auxym> ah. well nimdow and worm exist
00:17:45om3gaI just fantasize, since of course I understand how non trivial can be
00:17:56om3gaoh! I missed that
00:18:28FromDiscord<auxym> not to discourage you from making your own if that's what you feel like doing ofc1
00:18:49om3ganimdow looks very nice!
00:19:09om3gaawesome that somebody made this
00:21:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "just the path you": Oh alright
00:22:31om3gaworm needs better design, reminds me old times
00:30:03*jmdaemon joined #nim
00:56:22FromDiscord<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:49FromDiscord<auxym> ARC destructors, `defer` (which is sugar for try/finally), or write your own macro maybe
01:00:36FromDiscord<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:01FromDiscord<Haze System (they/them)> does the ^ in `array[^1]` mean the last index?
01:26:02FromDiscord<Elegantbeef> `^x` creates a BackwardsIndex
01:26:03FromDiscord<Elegantbeef> So yes
01:27:00FromDiscord<demotomohiro> !eval echo [10, 20, 30][^1]
01:27:06NimBot30
01:34:21FromDiscord<etra> In reply to @auxym "ARC destructors, `defer` (which": what do you mean with macro?
01:34:26FromDiscord<etra> like, how could it help?
01:36:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSs
01:37:31FromDiscord<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:54FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSv
02:06:36FromDiscord<Elegantbeef> That's a path
02:06:48FromDiscord<Elegantbeef> Also not calling this code in top level scope would work 😛
02:09:32FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSx
02:09:54FromDiscord<Elegantbeef> Ah i see
02:10:14FromDiscord<Elegantbeef> Is sdk a pointer type?
02:11:09FromDiscord<Elegantbeef> I'm just curious if we could add a `ref` to the Sdk in the types
02:11:30FromDiscord<Elegantbeef> I assume it's a C api so all cameras are passed by reference
02:11:36FromDiscord<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:17FromDiscord<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:26FromDiscord<etra> I accept grow advice though :)
02:12:38FromDiscord<Elegantbeef> Yea i'll take a look
02:13:00FromDiscord<etra> okey, let me comment it a bit to make more sense out of it
02:23:05FromDiscord<etra> Elegantbeef: https://github.com/etra0/fujiset
02:23:13FromDiscord<etra> I'm afraid there's no redistributables for linux, though
02:24:03FromDiscord<Elegantbeef> Par for the course with imaging equipment
02:26:48FromDiscord<Elegantbeef> So what I'd do is make `SDK` a `ref object` then store that inside of `CameraObj`
02:27:10FromDiscord<Elegantbeef> That way you do not need to ever worry about having funky destructors or templates
02:27:14FromDiscord<Elegantbeef> It's just pure ref counting
02:28:14FromDiscord<Elegantbeef> Though sdl and friends just expect the user to call `init` and `close` properly
02:28:20FromDiscord<etra> oh nice, I thought on doing that but I wasn't sure it'd work
02:29:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSB
02:29:28FromDiscord<Elegantbeef> Which is better is between you and your deity
02:30:37FromDiscord<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:42FromDiscord<etra> (edit) "chose," => "chose?"
02:31:04FromDiscord<etra> I mean, apart for at least the init function
02:31:48FromDiscord<Elegantbeef> Well depends on what your concerns are
02:33:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSC
02:35:15FromDiscord<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:19FromDiscord<etra> (edit) "concert" => "concern"
02:35:25FromDiscord<etra> (edit) "object" => "objects"
02:35:40FromDiscord<Elegantbeef> Well then the ref object seems fine
02:35:50FromDiscord<Elegantbeef> You do not even need to expose the deinit procedure
02:36:08FromDiscord<Elegantbeef> Also for the love of all things good, do not use include like you are
02:36:27FromDiscord<Elegantbeef> Just friggin import the module and export all the symbols you want exported
02:36:59FromDiscord<etra> is include discouraged? I didn't know :laugh:
02:37:34FromDiscord<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:58FromDiscord<Elegantbeef> `import` works properly with only public symbols usable `include` works like C where it pastes the file where it's called
02:39:16FromDiscord<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:48FromDiscord<Elegantbeef> `export defines` for exporing modules
02:40:04FromDiscord<Elegantbeef> same can be done for all symbols
02:40:11FromDiscord<Elegantbeef> but you can also use the export marker on a symbol or field
02:40:15FromDiscord<Elegantbeef> `var myVar: int`
02:41:17FromDiscord<Elegantbeef> I say you can `export defines` to export a module, but that works with any symbol aswell
02:42:14FromDiscord<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:32FromDiscord<Elegantbeef> What do you want to export?
02:43:07FromDiscord<Elegantbeef> do you want to export all that `fuji` exports?
02:43:09FromDiscord<etra> for example I cannot longer use `ConnectionType` from `fujiset.nim`
02:43:14FromDiscord<Elegantbeef> If so you can do `export fuji` inside `fujiset`
02:43:19FromDiscord<etra> (edit) "`fujiset.nim`" => "`defines.nim`"
02:43:38FromDiscord<Elegantbeef> Inside fuji you can `export ConnectionType` if you want
02:44:07FromDiscord<etra> oh okey, yeah, that worked!
02:44:07FromDiscord<Elegantbeef> Then inside `fujiset` you can `export fuji` to expose all of it's exposed symbols
02:46:40FromDiscord<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:57FromDiscord<Elegantbeef> Nope you need to allocate
02:47:06FromDiscord<Elegantbeef> so you either need `new result` or the more sensible `Sdk()`
02:55:39FromDiscord<etra> huh: https://play.nim-lang.org/#ix=4pSF
02:55:59FromDiscord<etra> the destroy for the SDK is not getting called if I use `ref object` apparently?
02:56:20FromDiscord<Elegantbeef> You're using playground to tesT?
02:56:31FromDiscord<etra> locally didn't work either
02:56:42FromDiscord<etra> i did a repro to check if I was doing something wrong
02:57:42FromDiscord<Elegantbeef> This is odd
03:01:16FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSH
03:01:38FromDiscord<etra> oh wait, if I do destroy, do I have to manually destroy all its fields?
03:04:52FromDiscord<Elegantbeef> Yes
03:04:58FromDiscord<Elegantbeef> That's the problem 😄
03:08:04FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pSI
03:10:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pSJ
03:12:14FromDiscord<etra> ok yeah that works in my pc but not in playground, weird
03:13:02FromDiscord<Elegantbeef> Playground uses refc
03:14:26FromDiscord<etra> aah gotchu
03:15:23FromDiscord<etra> man, seeing this main compared to calling the raw c api makes me happy
03:15:27FromDiscord<etra> it's so much pretty lol
03:16:20FromDiscord<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:45FromDiscord<etra> this is kinda funny to me https://media.discordapp.net/attachments/371759389889003532/1081415151560962168/image.png
03:44:26FromDiscord<etra> I have a function that gives me `seq[SomeEnum]`, how can I convert it to `set[SomeEnumFlags]`?
03:44:47FromDiscord<etra> (edit) "`set[SomeEnumFlags]`?" => "`set[SomeEnum]`?"
03:44:56FromDiscord<Elegantbeef> `toSet` inside `std/setutils`
03:50:17FromDiscord<etra> lmao I did all this effort for the wrapper and apparently my camera doesn't support the API I need :crypalm:
03:50:42FromDiscord<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:28FromDiscord<Enigmanark> sent a code paste, see https://play.nim-lang.org/#ix=4pTp
08:35:29FromDiscord<Enigmanark> Or rather, how I can make it mutable? 🤔
08:36:41FromDiscord<Rika> for i in coins.mitems:
08:37:12FromDiscord<Rika> for uses the immutable `items` iterator implicitly
08:37:29FromDiscord<Rika> explicitly specify `mitems` to use the mutable version
08:37:53FromDiscord<Enigmanark> Oh okay, thanks 😄 Simple
08:38:06FromDiscord<Rika> this also naturally means `coins` must be mutable
08:38:16FromDiscord<Enigmanark> Yeah
08:40:05FromDiscord<Enigmanark> Nice, now I just need to dynamically spawn more coins and the simple experiment will be finished. 🙂
09:09:55FromDiscord<FurryP> sent a long message, see http://ix.io/4pTx
09:33:13*filcuc joined #nim
09:35:33Zevv_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:44FromDiscord<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:48Zevv_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:54FromDiscord<Rika> You ask about the replace string being empty
09:36:06Zevv_that does not work anymore. I do nimble develop, but then my package can still not be found when I import it.
09:36:40FromDiscord<Elegantbeef> you now need to do `nimble develop -g packagename`
09:36:41FromDiscord<Elegantbeef> I believe
09:36:48FromDiscord<Elegantbeef> With nimble 0.14+
09:37:04Zevv_then it downloads the package from the internets and does not use my local package
09:37:22Zevv_fuck all this, I'm just switching to --path in my nim.cfg
09:37:24FromDiscord<Elegantbeef> I think you can use it in your package directory
09:37:25Zevv_i should have long ago
09:39:26FromDiscord<Elegantbeef> Yea this develop change is the most annoying change
09:39:39Zevv_yeah sorry, was not snapping at you
09:46:08FromDiscord<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:03FromDiscord<Elegantbeef> https://nim-lang.org/docs/uri.html#Uri + and std/os
09:47:55FromDiscord<Elegantbeef> Do not know if there is a better tool
10:00:32FromDiscord<Phil> Is this notation of `x'123'` something general that is known outside of sqlite?
10:01:02FromDiscord<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:24FromDiscord<Phil> Context are Blobs stored in sqlite
10:01:43FromDiscord<Rika> Looks like he’s
10:01:45FromDiscord<Rika> Hex
10:01:59FromDiscord<Rika> Hex 31 32 33 match ASCII 123
10:03:21FromDiscord<Phil> Ohhhh
10:03:38FromDiscord<Phil> I still don't immediately recognize hex whenever I see it
10:03:42FromDiscord<Phil> Thanks!
10:07:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pTI
10:07:54FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4pTI" => "https://play.nim-lang.org/#ix=4pTJ"
10:08:16FromDiscord<Phil> Hmm wait that's sqlite behaviour, less so lowdb behaviour
10:09:05FromDiscord<Phil> sent a code paste, see https://paste.rs/5Do
10:13:16FromDiscord<Phil> Still wonder what `x''` does
10:15:07FromDiscord<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:43FromDiscord<FurryP> In reply to @Rika "You ask about the": Correct, the replace string being empty does not work either.
10:21:10FromDiscord<FurryP> (edit) "does" => "is" | "work" => "allowed"
10:21:31FromDiscord<FurryP> (edit) "either." => "either in multiReplace()"
10:23:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pTM
10:27:20FromDiscord<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:33FromDiscord<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:00FromDiscord<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:54FromDiscord<Phil> Ref sounds like it's a ref type, you sure you don't need to unref-it first using `[]` ?
10:33:08FromDiscord<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:24FromDiscord<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:32FromDiscord<Phil> (edit) "TomlValueKinds" => "TomlKinds"
10:39:38FromDiscord<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:03FromDiscord<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:24FromDiscord<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:10FromDiscord<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:41FromDiscord<theSherwood> I can import that file directly? What does that look like?
10:55:21FromDiscord<Phil> `import tomlserialization/<path-to-module>`
10:55:30FromDiscord<Phil> or whatever the name of the package is
10:55:47FromDiscord<Phil> path is relative to the main module nim file
10:57:47FromDiscord<theSherwood> Well, that's an easy solution. Thanks, PHil
12:01:09FromDiscord<Phil> Wait, is `"\0x\0"` the hex representation of 0?
12:01:11*filcuc joined #nim
12:02:11FromDiscord<Phil> (edit) "the hex" => "some kind of"
12:10:06FromDiscord<Rika> What?
12:10:49*filcuc quit (Ping timeout: 252 seconds)
12:20:50FromDiscord<Phil> It literally dawned on me that the previous test description of ndb was literally lying to me
12:23:10FromDiscord<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:22FromDiscord<Phil> is `\0x\0` some kind of `nil` representation or something?
12:25:29FromDiscord<Rika> What?
12:25:42FromDiscord<Rika> I don’t see the connection with null
12:28:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pUb
12:31:41FromDiscord<Rika> I can’t see anything about that value being connected with null
12:32:29FromDiscord<Phil> Man, imagine giving your tests comprehensive names instead of cryptic ones
12:35:40FromDiscord<Phil> Wait, could it be that 0x0 stands for the memory address "null" ?
12:43:31FromDiscord<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:59FromDiscord<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:01PMunch_`$` is the "to string" operator in Nim
13:02:16PMunch_echo applies `$` on each argument passed to it
13:02:40*PMunch_ is now known as PMunch
13:02:53FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pUk
13:03:07FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4pUk" => "https://play.nim-lang.org/#ix=4pUm"
13:04:13PMunch@Phil: https://nim-lang.org/1.0.0/manual.html#lexical-analysis-string-literals
13:04:47FromDiscord<Phil> Ohhh so that's a nim thing?
13:05:11FromDiscord<Phil> "Interpret the following 2 characters as hex-numbers, not as characters"
13:05:19FromDiscord<Phil> That's why that works, ahhhhh
13:06:36PMunchYup
13:08:09*derpydoo quit (Quit: derpydoo)
13:08:21*jmdaemon quit (Ping timeout: 255 seconds)
13:16:24Zevv_PMunch: i need some input from npeg users for a possible api change
13:16:38Zevv_code blocks always make an implicit capture, $0 or captures[0]
13:16:40PMunchFire away
13:16:41FromDiscord<Phil> How do we do parameterized tests in nim?
13:16:46Zevv_but in the matjority of my parsers i never use that myself
13:16:57Zevv_is that something you do, or are your captures always >explicit
13:17:18Zevv_there's quiet a bit of overhead in capture handling compared to the basic parser inner loop
13:17:29Zevv_so i'd love to drop those implicits because they usually run for nada
13:19:07PMunchHmm, I think I've used it for debugging purposes, but I don't think I actually ever use it for anything
13:19:24Zevv_right, thanks
13:19:33PMunchI 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:37Zevv_i might just go forward on this, until now 100% of the respondands don't use this
13:19:54Zevv_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:57Zevv_although that's kind of silly
13:20:14ZevvDid you leave an IRC client running somewhere by the way?
13:20:17*Zevv is now known as PMunch
13:20:32Zevv_oh probably I usually have more than one
13:20:57Zevv_i'm flattered by your need to be me
13:21:33Zevv_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:37PMunchJust by the way, you can use /msg NickServ ghost Zevv to kick the other client off your nick
13:21:43PMunchI assume you already know that though
13:21:57PMunchHaha, that's a good point actually
13:22:00Zevv_your identity can be hijacked in a second. any service that says it prevents that is lying to you
13:22:45PMunchWhy is grabbing the 0 capture so expensive by the way?
13:22:57Zevv_any capture is relatively expensive
13:23:36Zevv_it's an alloc and two stack operations, the least
13:23:44PMunchFair enough
13:23:45Zevv_well no, not an alloc anymore, I changed that
13:23:58Zevv_oh hell it *is* an alloc I now see
13:24:08Zevv_well, it shouldn't
13:24:16PMunchYou 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:36Zevv_they are distinct already
13:24:55Zevv_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:22Zevv_but the .len will still still messy. 1 for zero captures.
13:25:27Zevv_i hadn;t thought of that yet
13:41:45PMunchAah right
13:43:12Zevv_that's a thoughie
13:53:34FromDiscord<Phil> Ah yes, test suite of name `getRow()` with name `empty`, how informative
13:55:29PMunchCrap.. 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:51PMunchI'm able to build, and upload
13:58:01PMunchBut it doesn't get out of the bootloader..
14:03:01Zevv_well, go blink some leds then
14:08:56PMunchI tried just a simple blink.. Still no dice
14:09:24FromDiscord<firasuke> In reply to @PMunch_ "echo applies `$` on": ok thanks
14:09:56PMunchOh wait..
14:10:03PMunchBlinking LED does actually work
14:12:30PMunchHmm
14:12:43PMunchIt seems like it's just the serial TTY which doesn't work..
14:14:20PMunchIt doesn't even show up in lsusb..
14:29:44FromDiscord<auxym> what usb stack does that teensy use? or it it an external ftdi type ic?
14:29:59PMunchOh god damn it..
14:30:11PMunchI completely forgot that it has it's own USB serial thingy..
14:33:56PMunch@auxym, the Teensy 2.0 is just an ATmega 32u4
15:14:51*filcuc joined #nim
15:22:23FromDiscord<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:50FromDiscord<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:14PMunchOh yeah, the problem was just that I was writing out over the normal serial and not the USB serial :P
15:23:43PMunchIt has its own controller yeah, and Teensy has a usb_serial library to run serial over it
15:29:51FromDiscord<auxym> weird that it wasnt showing up in lsusb though
15:31:10PMunchWell I never called usbInit
15:31:19PMunchSo it never sent a "hello" message over USb
15:36:19PMunchHmm, not quite sure what's going on, but it doesn't work
15:36:57PMunchI'm doing the same thing I do in Badger, but waiting for the USB configuration never completes
15:39:24PMunchI guess it's time to get out my logic analyzer and inspect the USB communication..
15:40:26FromDiscord<djazz> and its not something silly like upgrading linux kernel without rebooting? 😅
15:44:31PMunchNope, it works if I program it in Arduino
15:44:38FromDiscord<djazz> kk
15:52:51PMunchHmm, I think the error is actually that Nim is messing up my progmem stuff again..
15:53:34FromDiscord<Enigmanark> sent a code paste, see https://play.nim-lang.org/#ix=4pVo
15:59:00FromDiscord<I have 50GB of nothing on my PC> when are compilation time imporvements (so, mostly, IC) planned for now?
16:00:16PMunchSeems 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:04FromDiscord<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:08Zevv_PMunch: so what was the problem with the bootloader
16:13:02PMunchBootloader?
16:14:33FromDiscord<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:33Zevv_PMunch: your atmel thingy not booting
16:19:51PMunchI had an atmel which wasn't booting?
16:21:01FromDiscord<auxym> microchip (formerly atmel) 😉
16:21:23FromDiscord<Hourglass [She/Her]> I should probably work on redoing my plugin system a bit
16:21:34Zevv_PMunch: dude
16:21:40Zevv_your ratel thingy didn't boot earlier today
16:22:00Zevv_are you pulling my leg or am i stupid today
16:22:55PMunchOh :P
16:22:58FromDiscord<auxym> as an occasional user of plugin systems, im pretty sure they are very hard to get right
16:23:01PMunchThat's the thing I'm still working on
16:23:23PMunchIt did actually boot, I just hadn't set up the USB properly
16:23:32Zevv_and you didn't realize waht I was talking about
16:23:33Zevv_haha
16:23:53PMunchAnd apparently Nim has broken how progmem works, again, so it's just sending null bytes..
16:24:31Zevv_again
16:24:37Zevv_put it in CI
16:25:39Zevv_it's cool having 16 targets for your language
16:25:43Zevv_but hard if you test only 2 or 34
16:25:45Zevv_3
16:26:30*rockcavera joined #nim
16:27:22PMunchNice, this was a bug I had already fixed in Badger
16:27:29PMunchGuess I should port that fix to Ratel.
16:27:46PMunchBut first I need to cook some dinner..
16:34:44FromDiscord<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:04FromDiscord<Hourglass [She/Her]> It refuses to send anything to the socket after numerous attempts
16:36:44FromDiscord<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:00FromDiscord<Nilts> I keep on getting 403 Forbidden when trying to access a static svg file in jester.
17:20:07FromDiscord<Nilts> why does this happen?
17:32:38FromDiscord<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:06FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pVF
17:49:15FromDiscord<Nilts> In reply to @not logged in "I keep on getting": just realized, i probably need to change the perms
17:50:57FromDiscord<Nilts> Ok, `chmod o+r` fixed it
17:55:46FromDiscord<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:58FromDiscord<pmunch> Oh cool, Nim is a featured language for "Mechanical March" over on Exercism\: https://youtu.be/_PPXEJZ7gOg
18:36:59FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pVP
18:38:01FromDiscord<Nilts> (edit) "https://play.nim-lang.org/#ix=4pVP" => "https://play.nim-lang.org/#ix=4pVQ"
18:38:15FromDiscord<Nilts> (edit) "https://play.nim-lang.org/#ix=4pVQ" => "https://play.nim-lang.org/#ix=4pVR"
18:51:12FromDiscord<hotdog> In reply to @not logged in "Can someone please help": What’s the code?
18:54:08FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pVS
18:56:32*derpydoo quit (Ping timeout: 248 seconds)
19:00:51FromDiscord<Nilts> First one is in a async proc
19:01:26arkanoidwhy global vars change address when using inside an async proc?
19:02:19arkanoidfor example var "running" in https://play.nim-lang.org/#ix=4pVU
19:10:20Zevv_ you are not printing the address of running
19:10:41Zevv_you are printing the address of a copy of `running` on the stack that gets passed to `echoAddress`
19:10:57Zevv_and async fucks with the stack, the stack is not a stack
19:11:06Zevv_which is why the address changes
19:11:16Zevv_make your `echoAddress()` a template to see the real address of `running`
19:12:52Zevv_does that make sense?
19:13:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pVZ
19:14:23FromDiscord<Phil> (db is an sqlite db connection that gets created before the test
19:14:25FromDiscord<Phil> (edit) "test" => "test)"
19:17:54FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pW0
19:18:17FromDiscord<Phil> But it doesn't check for anything
19:18:24FromDiscord<Phil> It doesn't even check if an exception is thrown or a defect occurs
19:18:42FromDiscord<Phil> Like, even as test for causing exceptions that's a bad test
19:20:11FromDiscord<guttural666> how do I mutably loop over a collection with for again? chatGPT is letting me down
19:20:41Zevv_mitems / mpairs
19:20:41FromDiscord<Phil> In reply to @guttural666 "how do I mutably": mItems iterator?
19:20:52FromDiscord<guttural666> yes thank you
19:21:26FromDiscord<guttural666> I will inform chatGPT
19:24:22FromDiscord<Nilts> sent a code paste, see https://paste.rs/1Tk
19:24:28FromDiscord<Phil> sent a code paste, see https://paste.rs/Z78
19:25:05FromDiscord<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:53arkanoidZevv_: it makes sense! thanks!
19:34:05FromDiscord<tfp> qq, why isn't the dtor called for this type?
19:34:07FromDiscord<tfp> https://media.discordapp.net/attachments/371759389889003532/1081660864521834686/image.png
19:34:12FromDiscord<tfp> i thought that this would work
19:34:16FromDiscord<tfp> actually does nim playground not use ORC?
19:34:37FromDiscord<tfp> ah yeah it uses refc
19:34:41FromDiscord<tfp> how can i make it use ORC?
19:35:08Zevv_you can't
19:35:26Zevv_it doesn't run devel
19:35:44FromDiscord<tfp> o
19:36:12FromDiscord<tfp> well ok nvm it works with orc on local so
19:36:13FromDiscord<tfp> all good
19:38:23FromDiscord<tfp> also is there any way to just have the dtor directly on Foo instead of having the FooValue thing?
19:38:44Zevv_nope
19:39:15FromDiscord<tfp> ok
19:39:18FromDiscord<tfp> thx
19:41:52arkanoiddo iterators have something like environment as closures? how do they keep state between calls?
19:42:11Zevv_these are hidden for view, you can't access these\
19:42:42Zevv_ s/for/from/
19:43:22Zevv_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:29Zevv_you can't "manually" iterate an iterator
19:44:14FromDiscord<tfp> https://media.discordapp.net/attachments/371759389889003532/1081663408929263686/image.png
19:44:27FromDiscord<tfp> does anybody know what this comment from https://github.com/nim-lang/Nim/issues/18421 means
19:44:42arkanoidand where does this environment lives? is it on the stack or on the heap?
19:44:53Zevv_heap
19:44:57arkanoidthanks
19:44:57Zevv_which is logical, if you think about it
19:45:13Zevv_because the normal stack-based control flow is broken
19:45:20arkanoidyes, I was betting on it, I just wanted to ask
19:45:50Zevv_tfp: if you override a destructor, you should make sure it actually destructs what you pass in
19:46:14Zevv_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:31Zevv_arkanoid: if you feel brave and want to have much more control, take a peek at CPS
19:46:37Zevv_it offers what iterators offer, but on steroids
19:49:52arkanoidZevv_: 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:01Zevv_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:40Zevv_it's like vim I guess, the learning curve is somewhat steep
19:51:49Zevv_but once you take the hurdle, it might be worth it
19:52:16Zevv_this kind of sums it all up: https://raw.githubusercontent.com/nim-works/cps/master/docs/cps.svg
19:52:18PMunchWohoo, 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:58Zevv_prove it.
19:53:06Zevv_it looks the same as any of your other messages.
19:55:05PMunchHello Zevv!
19:55:09Zevv_PMunch: where's the source, I'd like to see your nim usb stack
19:56:24PMunchCurrently the source is just on my machine :P
19:56:37Zevv_quick, make a backup!
19:56:49PMunchIt uses the same USB stuff as Badger though
19:57:25PMunchhttps://github.com/PMunch/badger/blob/final/keyboard.nim
19:57:53PMunchThat's the keyboard stuff, and here is the actual Badger firmware: https://github.com/PMunch/badger/blob/final/badger.nim
19:58:01Zevv_aaah that explains
19:58:49Zevv_is USB done in software or is the chip hw or ROM doing the hard work for you?
19:59:36Zevv_ah I see, the chip has proper USB support
19:59:40Zevv_that's nice
19:59:44PMunchAnd here's your damn proof! https://youtu.be/zMSLCPasjsg
20:00:06PMunchYeah, it's the Atmega32u4 which has built in USB
20:00:13Zevv_Yes, signature verified I saw what you were typing there
20:00:27Zevv_nice toy
20:00:44Zevv_the shirt came in btw: https://libera.ems.host/_matrix/media/v3/download/matrix.org/HbBhRivXHqWCBKXjKacotEAd/ima_1bc9159.jpeg
20:01:33PMunchHaha, that is magnificent :P
20:02:26PMunchThe keyboard will be put back in the laptop with a single board computer, batteries, charging circuitry, and ePaper screen :)
20:02:46PMunchJust need to get the trackpoint working and I think I'm good to assembly everything!
20:02:52Zevv_cool stuff
20:05:47FromDiscord<guttural666> @PMunch are the error messages of nimlsp completely distinct from the compiler or how does that work?
20:06:01PMunchYeah, looking forward to finally have it done. Has taken way longer than I expected :P
20:06:16PMunch@guttural666, nimlsp is basically just nimsuggest with an LSP frontend
20:06:35PMunchAnd nimsuggest is basically just the compiler, but instead of compiling code it just gathers information
20:06:46FromDiscord<guttural666> okay okay
20:06:51FromDiscord<Elegantbeef> nimlsp uses nimsuggest which is practically a slightly modified compiler
20:06:52FromDiscord<Elegantbeef> The optimisations nimsuggest uses apparently can cause tooling issues
20:06:58FromDiscord<Phil> @amadan wanna do a lowdb bugfix for me?
20:07:32FromDiscord<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:32FromDiscord<guttural666> so I can blame whoever wrote nimsuggest or the compiler for useless error messages? 😄
20:07:41FromDiscord<Phil> (edit) "bug" => "bug↵That I really don't want to deal with."
20:07:50FromDiscord<Elegantbeef> Just blame nimsuggest and carry on 😄
20:08:54FromDiscord<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:14FromDiscord<Elegantbeef> If the tooling fails, just use the compiler
20:09:28FromDiscord<guttural666> I'll try
20:10:08*cyraxjoe quit (Ping timeout: 248 seconds)
20:10:24*cyraxjoe joined #nim
20:13:39FromDiscord<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:44FromDiscord<tfp> is there a way to call the old dtor?
20:13:52FromDiscord<Elegantbeef> nope
20:14:04FromDiscord<guttural666> yeah, should have done this earlier, the compiler knows de way, fixed my problem, thanks!
20:14:07FromDiscord<tfp> huh
20:14:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pWj
20:17:55FromDiscord<tfp> i just don't like how there's all this trivia around it
20:18:08FromDiscord<Elegantbeef> PRs welcome
20:18:11FromDiscord<Elegantbeef> \:d
20:18:57FromDiscord<tfp> mmmmmm
20:19:02FromDiscord<tfp> maybe one day
20:19:45Zevv_well, what's a typical use case for this stuff
20:20:24Zevv_for me it's usually only for something RAII involving os resources
20:20:39Zevv_or making atomic RCs to make nim behave in a multithreaded env
20:20:59Zevv_but in practice, when do you even need your own destructors?
20:21:20FromDiscord<Elegantbeef> Custom collections
20:21:34Zevv_but yeah beef, it's crappy that we can't call the original one dude.
20:21:38Zevv_who wrote this shit
20:21:44FromDiscord<Nilts> In reply to @not logged in "Can someone please help": Can anyone help?
20:21:50FromDiscord<Elegantbeef> I do not disagree
20:22:07Zevv_i never thought about that, actually, having the original one at hand
20:22:13FromDiscord<Elegantbeef> The real trick is to make your base type, then make your real type a distinct type
20:22:14Zevv_I can see it might come handy sometimes
20:22:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pWn
20:23:07Zevv_sure, but it's all boilerplating
20:23:13FromDiscord<Elegantbeef> Just like that you now have the default constructor and your own
20:23:16FromDiscord<tfp> In reply to @Zevv_ "but in practice, when": RAII
20:23:43Zevv_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:47FromDiscord<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:03FromDiscord<tfp> cleaning up resource handles with a LRU cache
20:24:14FromDiscord<tfp> but all of that kicked off by the last reference going out of scope
20:24:23Zevv_well, you *can*, right
20:24:23FromDiscord<Elegantbeef> Hmph maybe it's better to use inheritance for this problem....
20:24:35Zevv_but destructors are pretty low level things in nim
20:24:37FromDiscord<Elegantbeef> Ideally the compiler has a `callDefaultDestructor` but alas
20:24:45Zevv_you basically get control, but you get responsibilities with it
20:25:04FromDiscord<tfp> i will probably wrap it with a macro to just make it easier
20:25:07*jmdaemon joined #nim
20:25:12FromDiscord<tfp> i was planning on using nim as a scripting language for my game too
20:25:39Zevv_and ship the compiler VM with your game to run the scripting?
20:25:39FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pWo
20:25:52FromDiscord<tfp> scripts would be compiled AoT, just loaded as wasm modules
20:26:05FromDiscord<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:12FromDiscord<Elegantbeef> Ah the chadiest Nim scripting 😄
20:26:46FromDiscord<tfp> the cope is that one day i'll just replace nim with my own language and solve all the nitpicks
20:26:56FromDiscord<tfp> but i'll probably never even get to the point of finishing the game so
20:26:56Zevv_yeah that's what we all do
20:27:10FromDiscord<Phil> By using the macro system to its extreeeeeeme
20:27:20FromDiscord<Phil> All built atop of micros
20:27:50FromDiscord<Elegantbeef> Wait you're using micros?
20:28:02Zevv_what, aren't you?
20:28:06FromDiscord<tfp> sent a code paste, see https://paste.rs/4KM
20:28:08Zevv_we are all using micros here? didn't you know?
20:28:21FromDiscord<Elegantbeef> Hey do not gaslight me
20:28:41FromDiscord<Elegantbeef> https://github.com/PhilippMDoerner/lowdb tfp link
20:28:42Zevv_oh shit sorry I thought I was still on #micros
20:28:50FromDiscord<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:02FromDiscord<Phil> On every level ever
20:29:08FromDiscord<Phil> So much flipping documentation
20:29:22FromDiscord<Hourglass [She/Her]> Rip
20:29:24FromDiscord<Phil> Now I'm refactoring a test-suite which is also a kind of documentation
20:29:28FromDiscord<Elegantbeef> What's "documentation"?
20:29:52FromDiscord<Phil> Things that transfer knowledge from you to other people via funny shapes on your screen
20:30:04FromDiscord<tfp> i tried running ur thing phil
20:30:13FromDiscord<tfp> sent a code paste, see https://play.nim-lang.org/#ix=4pWr
20:30:14FromDiscord<tfp> i installed it
20:30:15FromDiscord<tfp> i swear
20:30:26FromDiscord<tfp> oh does nimble install not add it to your nimble file
20:30:27FromDiscord<tfp> aha
20:30:28FromDiscord<Phil> That is super weird
20:30:39FromDiscord<Phil> That is correct
20:30:49FromDiscord<tfp> ok there we go
20:31:00FromDiscord<tfp> sent a code paste, see https://play.nim-lang.org/#ix=4pWs
20:31:07FromDiscord<Phil> Okay, you have the same issue
20:31:23FromDiscord<Phil> That is various degrees of bad, I just don't know which level
20:31:41FromDiscord<tfp> :^)
20:32:05FromDiscord<Elegantbeef> Atleast -273.15
20:32:08FromDiscord<Phil> At least I know that it was not me that introduced the issue
20:33:00FromDiscord<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:11FromDiscord<Nilts> Can someone help me or am i doing something wrong in asking a question...
20:39:31FromDiscord<amadan> In reply to @Isofruit "<@259999449995018240> wanna do": Sure, hopefully it isn't too difficult lol
20:41:58FromDiscord<Elegantbeef> You're attempting to await a `JsObject`
20:44:07FromDiscord<Nilts> In reply to @Elegantbeef "You're attempting to await": It returns future, not jsobject though, and there is no await await
20:44:26FromDiscord<Elegantbeef> Show the code
20:45:44FromDiscord<Nilts> In reply to @Elegantbeef "Show the code": more of it?
20:46:10FromDiscord<Elegantbeef> You didnt show any you provided an error
20:46:10FromDiscord<Elegantbeef> Show the line that's erroring
20:46:17FromDiscord<guttural666> In reply to @Elegantbeef "Atleast -273.15": paid attention to physics class
20:46:32FromDiscord<Nilts> In reply to @Elegantbeef "Show the line that's": I did already: https://discord.com/channels/371759389889003530/371759389889003532/1081658398367563866
20:46:37FromDiscord<Elegantbeef> I just have a good memory for numbers
20:46:52FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4pWt
20:46:58FromDiscord<Nilts> (edit) "https://discord.com/channels/371759389889003530/371759389889003532/1081658398367563866" => "https://discord.com/channels/371759389889003530/371759389889003532/1081650790348894388"
20:47:00FromDiscord<guttural666> In reply to @Elegantbeef "I just have a": that is one i too remembered from class
20:48:53FromDiscord<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:41FromDiscord<Elegantbeef> You do not annotate the procedure as async
20:49:45FromDiscord<Elegantbeef> That might be the issue i do not know
20:49:45FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pWv
20:50:07FromDiscord<Nilts> In reply to @Elegantbeef "You do not annotate": what do you mean annotate?
20:50:20FromDiscord<Elegantbeef> you do not use the `async` pragma on the procedure
20:50:52FromDiscord<Elegantbeef> I do not know much about js async + ffi
20:51:15FromDiscord<Nilts> In reply to @Elegantbeef "you do not use": which procedure? The js native one does not use it.
20:51:39FromDiscord<Elegantbeef> `watchTextFile` should be annotated async i believe
20:51:42FromDiscord<Elegantbeef> I do not know with js ffi
20:52:53FromDiscord<amadan> In reply to @Isofruit "Would be lovely, I'm": Good news! Doesn't look to be a bug with lowdb
20:53:00FromDiscord<Phil> ?
20:53:05FromDiscord<Phil> Test issue then?
20:53:20FromDiscord<amadan> Test issue?
20:53:59FromDiscord<Nilts> In reply to @Elegantbeef "`watchTextFile` should be annotated": It does not work. Idk what to do
20:54:04FromDiscord<amadan> I've tested it and found two ways to fix it↵Looks like it was just a user error with SQLite
20:54:35FromDiscord<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:12FromDiscord<hotdog> @Nilts sorry just stepped out for a bit. Should the type of watchers not be JsObject?
20:57:26FromDiscord<Nilts> In reply to @hotdog "<@910899642236043294> sorry just stepped": it should be, but i am never awaiting the watchers var
20:58:40FromDiscord<hotdog> I mean in the watchTextFile definition
20:59:06FromDiscord<Nilts> In reply to @hotdog "I mean in the": it should be jsobject in the def, yes
20:59:29FromDiscord<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:32FromDiscord<hotdog> In reply to @not logged in "it should be jsobject": Does that change the error?
21:00:33*derpydoo joined #nim
21:00:37FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pWz
21:01:56FromDiscord<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:03FromDiscord<jmgomez> A PoC of the NimVM inside UE 😄 https://media.discordapp.net/attachments/371759389889003532/1081682994244362270/Untitled_Project.mp4
21:02:34FromDiscord<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:46FromDiscord<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:04FromDiscord<guttural666> In reply to @jmgomez "A PoC of the": what the fuck is this sound
21:03:28FromDiscord<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:38FromDiscord<guttural666> (edit) "sound" => "sound, seems like cock and ball torture is going on in the background"
21:03:55FromDiscord<jmgomez> In reply to @guttural666 "what the fuck is": haha the keyboard being to close to the mic, sorry about that lol
21:04:02FromDiscord<guttural666> hahahahaha
21:04:05FromDiscord<Phil> So in sqlite there's no expectation that it does anything other than return an id?
21:04:41FromDiscord<amadan> It can return 0 if it errors iirc
21:05:47FromDiscord<Phil> What the heck is that proc
21:07:17FromDiscord<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:25FromDiscord<amadan> (edit) "sleep" => "sleepy"
21:07:37FromDiscord<Phil> Either way, I think this explains why I'm only encountering the error in lowdb and not in norm
21:07:40FromDiscord<Phil> The SERIAL bit I mean
21:07:54FromDiscord<Phil> I'll just change that to int in the test
21:10:52FromDiscord<Phil> Thanks for digging into that!
21:11:21FromDiscord<hotdog> In reply to @not logged in "I did not change": Oh I see. What does the generated code look like?
21:11:40FromDiscord<hotdog> For the line that’s erroring
21:13:34FromDiscord<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:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pWI
21:16:03FromDiscord<Phil> Seems like it's always defaulting to A and that's why it initially passed
21:18:55FromDiscord<amadan> Least it was caught 😄 ↵I'll fix that up
21:21:44FromDiscord<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:52FromDiscord<Phil> Nobody ever complain over long test-names again when I use given-when-then pattern, ever
21:26:17FromDiscord<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:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pWK
21:27:06FromDiscord<hotdog> And reducing it to a smaller version may make the error more obvious too
21:39:27FromDiscord<Phil> I swear I need to write some nimibook...docs...after I'm... god damnit
21:39:39FromDiscord<Phil> Docs getting me once again
21:42:17FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pWO
21:45:57FromDiscord<Nilts> wait nvm
21:46:48FromDiscord<sigmasd> maybe you should just use importjjs
21:49:03FromDiscord<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:32FromDiscord<Nilts> New problem! I am sure good at coming across these, how do i disable CORS on static files in jester?
22:04:17FromDiscord<Nilts> Like add a header to all static serves
22:04:58*azimut joined #nim
22:08:48arkanoidis "ptr ptr cschar" == "cstring" ?
22:09:36FromDiscord<Elegantbeef> Nope it's `cstringarray likely`
22:09:38FromDiscord<Elegantbeef> Whoops
22:09:43FromDiscord<Elegantbeef> `cstringarray` likely
22:11:06arkanoidI 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:40arkanoidfirst time using https://nim-lang.org/docs/system.html#cstringArray
22:11:48FromDiscord<Elegantbeef> Jesus that's a cursed type
22:11:59FromDiscord<Elegantbeef> That's 3 pointer indirection
22:12:07FromDiscord<Elegantbeef> That's not a cstring array
22:12:17FromDiscord<Elegantbeef> a cstring array is `ptr cstring` or `ptr ptr char`
22:13:23arkanoidIt should be "char *argv[]"
22:13:46FromDiscord<Elegantbeef> That's a `ptr UncheckedArray[cstring]`
22:14:31arkanoidno, sorry, should be &"char *argv[]"
22:14:48FromDiscord<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:06arkanoidwait 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:39arkanoidfuthark created for me "proc gstinit*(argc: ptr cint; argv: ptr UncheckedArray[ptr ptr cschar]): void {.cdecl, importc: "gst_init".}"
22:16:21PMunchIsn't that UncheckedArray one pointer too deep?
22:16:54FromDiscord<Elegantbeef> Write that'd be a `var int, var ptr UncheckedArray[cstring]`
22:16:57FromDiscord<Elegantbeef> Right\
22:17:05FromDiscord<Elegantbeef> Well `var cint`
22:17:24FromDiscord<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:22arkanoidPMunch: hey! Thanks for the futhark update! I'm playing with 0.9.0 feature right now
22:18:33PMunchGlad you like it :)
22:18:43PMunchWhich feature are you playing with?
22:20:26arkanoidwell, 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:48arkanoidPMunch: I like outputPath a lot! :)
22:21:26PMunchDoes Futhark generate UncheckedArray?
22:21:28arkanoidthe define-based compile logic is much easier for me to think with.
22:21:50arkanoidyes, the line I pasted is exactly what futhark generated for me
22:21:57PMunchHuh
22:24:17arkanoidfuthark generated a 55k lines nim file for a very large lib like gstreamer just by importc: "gst/gst.h", impressive
22:24:48PMunchIt kinda feels like magic
22:25:18arkanoidit is, you dark wizard
22:26:16FromDiscord<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:28FromDiscord<Elegantbeef> No problem
22:28:19FromDiscord<Elegantbeef> https://streamable.com/90r58l such an upgrade from 😛
22:28:45PMunchHmm, is there a way to have `bycopy` applied to procedures instead of types?
22:29:08FromDiscord<Elegantbeef> Nope it's mainly just for C interop
22:29:40PMunchYeah I know
22:30:04arkanoidPMunch: do you think the futhark-generated type is wrong for "void gst_init(int *argc, char **argv[]);" ?
22:30:06PMunchBut I want Futhark to pass objects by copy to C procedures, but allow Nim to optimise passing of the object internally..
22:30:16PMuncharkanoid, no that looks correct
22:31:11PMunchAh well, I think it should actually be `ptr ptr UncheckedArray[ptr cschar]` or `ptr ptr UncheckedArray[cstring]`
22:32:14FromDiscord<Elegantbeef> Well given it uses `&` i'd argue it should be `var ptr UncheckedArray[cstring]` but yea C/C++ sucks
22:32:40PMunchSure, var would be better
22:32:55PMunchOf course for Futhark there's no way to know the intended semantic
22:35:36arkanoidPMunch: sure, beyond two indirections it's also impossible for me, too :P
22:43:22arkanoidwill 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:47PMunchI doubt so, but you should be able to use the Futhark retype functionality to change the type
22:45:24arkanoidPMunch: yes, I was reading about that right now
22:48:20arkanoidit 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:24FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4pX1
22:49:40PMunchOh right..
22:49:41PMunchHmm
22:49:53PMunchYeah I guess I should add a way to retype procedure arguments
22:50:10arkanoidnp
22:50:31PMunchHmm, for tomorrow I'm going to try and get my Teensy to behave as a USB mouse with the trackpoint device
22:50:59PMunchThen I need to figure out how to behave as both a USB keyboard, and a USB mouse at the same time..
22:53:04arkanoidPMunch: like those pesky usb dongles for wireless keyboard+mouse?
22:53:13PMunchPretty much
22:54:02arkanoidI remember doing so using usb-gadget mode of pi zero
22:54:17arkanoidsurely nothing like writing it into a microcontroller :P
22:57:22PMunchHmm, it appears like it should be fairly simple actually
23:03:50PMunchHowever I'm out of pins on the Teensy..
23:04:00PMunchSo I have to do some trickery..
23:05:51PMunchHmm, I wonder if having it connected to the keyboard matrix would mess with the analog signal
23:06:03PMunchMaybe I can just dual purpose some pins
23:06:37PMunchOh well, that's for tomorrow to figure out
23:06:40PMunchGood night
23:06:41*PMunch quit (Quit: leaving)
23:09:52FromDiscord<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:08FromDiscord<auxym> writing HID descriptors from scratch is, uh, not fun
23:11:38arkanoidbtw 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:01FromDiscord<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:12FromDiscord<tsoj> Is there a (posix) Nim way to lock a file?
23:19:11arkanoidwhat's the difference from a "cstring" and a "ptr cschar" ?
23:22:23FromDiscord<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:36FromDiscord<tsoj> lockf might work, I was looking for flock and didn't find it
23:23:51FromDiscord<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:42FromDiscord<Rika> flock is a bsd unix thing
23:24:45FromDiscord<Rika> Not posix
23:24:50FromDiscord<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:30Amun-Ratsoj: and flockfile?
23:26:03FromDiscord<tsoj> lol flockfile flock lockf fcntl too many choices
23:26:13Amun-Raah, it's in std/io but not exportable, proc flockfile(f: File) {.importc, nodecl.}
23:26:22FromDiscord<Rika> Only lockf and fcntl is posix iirc
23:26:41Amun-Raflockfile is posix, too
23:27:33FromDiscord<Rika> That one i wasnt aware of haha
23:28:11FromDiscord<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:09Amun-Ratsoj: I mean it's in io.nim but it's not marked with *
23:29:19FromDiscord<tsoj> ah okay
23:29:26Amun-Raadd 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:40arkanoidauxym, thanks