<< 02-09-2022 >>

00:16:02*disso_peach quit (Quit: Leaving)
00:19:01*disso_peach joined #nim
00:35:30FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=49pw
00:35:57FromDiscord<!&luke> (edit) "https://play.nim-lang.org/#ix=49pw" => "https://play.nim-lang.org/#ix=49px"
00:36:25FromDiscord<Elegantbeef> Something is a jobject
00:36:27FromDiscord<!&luke> (edit) "https://play.nim-lang.org/#ix=49px" => "https://play.nim-lang.org/#ix=49py"
00:36:43FromDiscord<!&luke> well what should it be
00:37:00FromDiscord<Elegantbeef> `echo redditJsonData["data"]["url_overidden_by_dest"].kind`
00:37:15FromDiscord<Elegantbeef> if you're `getStr` on it it should be a `JString`
00:37:26FromDiscord<!&luke> In reply to @Elegantbeef "`echo redditJsonData["data"]["url_overidden_by_dest": it should be a string or null
00:37:27FromDiscord<Elegantbeef> also `redditJsonData["data"]["url_overridden_by_dest"].getStr() in ["", "null"]`
00:37:41FromDiscord<Elegantbeef> You're getting an error from calling something on a jobject
00:37:47FromDiscord<Elegantbeef> if you look at your stack it'll show your exactly where
00:38:16FromDiscord<!&luke> In reply to @Elegantbeef "if you look at": what
00:38:22FromDiscord<Elegantbeef> Look at the entire stack trace
00:38:25FromDiscord<Elegantbeef> It'll show the callsite
00:38:32FromDiscord<!&luke> no...
00:38:41FromDiscord<Elegantbeef> Yes it does
00:38:50FromDiscord<!&luke> oh its on line 9
00:38:57FromDiscord<Elegantbeef> Run the program again and show the output
00:39:03FromDiscord<!&luke> which is line with if
00:39:05FromDiscord<Elegantbeef> Nevermind
00:39:16FromDiscord<!&luke> (edit) "if" => "`if`"
00:40:58FromDiscord<Elegantbeef> The issue is likely that the json from the nested index is a jobject and you need a specific field from it
00:41:17FromDiscord<!&luke> bro its a string
00:41:28FromDiscord<Elegantbeef> It's kind is jstring?
00:41:59FromDiscord<!&luke> https://0x0.st/opt5.png
00:42:07FromDiscord<!&luke> it should be
00:42:32FromDiscord<Elegantbeef> Well ensure each node in that tree you're indexing is an object
00:42:43FromDiscord<Elegantbeef> either `data` isnt an object or the last node isnt
00:42:56FromDiscord<!&luke> hmm give me a second
00:44:18FromDiscord<!&luke> ahh i see the problem
00:44:26FromDiscord<!&luke> data is in a nameless array
00:44:47FromDiscord<!&luke> how could i get the first element in that array?
00:45:36FromDiscord<Elegantbeef> How do you normally get an element in an array
00:45:48FromDiscord<!&luke> ive never done it in json
00:46:38FromDiscord<!Patitotective> indexing
00:46:49FromDiscord<!Patitotective> like a normal array
00:47:10FromDiscord<!&luke> can u send the example code
00:47:29FromDiscord<!Patitotective> `node[0]` (?)
00:47:32FromDiscord<Elegantbeef> https://nim-lang.org/docs/json.html#%5B%5D%2CJsonNode%2Cint
00:47:42FromDiscord<Elegantbeef> Here comes the airplane
00:47:50FromDiscord<!&luke> In reply to @Patitotective "`node[0]` (?)": oh thx
00:47:55FromDiscord<!&luke> In reply to @Elegantbeef "Here comes the airplane": lmaoooo
00:48:35FromDiscord<Elegantbeef> Like if you went to the json docs and typed index after my comment you'd have found it
00:49:29FromDiscord<!Patitotective> In reply to @Elegantbeef "Like if you went": docs? what is that?
00:49:36FromDiscord<Elegantbeef> No clue
00:49:44FromDiscord<Elegantbeef> RTFM is too hard
00:50:18FromDiscord<!Patitotective> it would be really cool if there was a !rtfm command↵so you can do `!rtfm std/json`
00:51:34*wallabra quit (Ping timeout: 268 seconds)
00:51:50FromDiscord<Elegantbeef> Yea i dont know, i just wish people would take 30 seconds to look at the docs for the library they're trying to use
00:53:42NimEventerNew thread by Turmoil: Hot reload & Alternatives - Mac Support (ARM and x86), see https://forum.nim-lang.org/t/9429
00:57:38FromDiscord<!&luke> In reply to @Elegantbeef "Like if you went": what makes this funnier is that i have std/json docs open in a new tab
00:57:50FromDiscord<!&luke> (edit) "new" => "different"
02:09:35NimEventerNew Nimble package! ndup - Near-Duplicate File Detection, see https://github.com/c-blake/ndup
02:11:50*arkurious quit (Quit: Leaving)
02:34:58FromDiscord<! Nilts> Is there a code scanner for nim?
02:36:28FromDiscord<Rika> "code scanner"?
02:36:45FromDiscord<! Nilts> In reply to @Rika ""code scanner"?": code analysis, kinda like CodeQl
02:37:00FromDiscord<Rika> dont think so
02:39:28*wallabra joined #nim
02:40:32FromDiscord<!Patitotective> i think the lexer is done :]↵https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/new_lexer.nim
02:43:10FromDiscord<!Patitotective> now gotta make the parser
02:43:20FromDiscord<Elegantbeef> Is it better than using regex? 🙂
02:43:31FromDiscord<!Patitotective> indeed
02:43:59FromDiscord<!Patitotective> oh, and i need to bench mark std/unicode and `openarray[char]`-unicode
02:44:02*LuxuryMode quit (Quit: Connection closed for inactivity)
02:44:02FromDiscord<!Patitotective> (edit) "bench mark" => "benchmark"
02:47:04FromDiscord<Elegantbeef> Seems pointless
02:47:22FromDiscord<Elegantbeef> If you use `toOpenarray` you will be faster
02:48:10FromDiscord<!Patitotective> okeeeeeeeeeeeeeeeeeeeeey
02:50:43FromDiscord<!Patitotective> uuuh, i need to use regex to make the replacements because i dont want to replace string for openarray in the return type
02:52:02FromDiscord<Elegantbeef> What?
02:52:36FromDiscord<!Patitotective> i need to replace `proc foo(arg: string): string` for `proc foo(arg: openArray[char]): string`, right?
02:55:23FromDiscord<!Patitotective> `\\(((\w(: ?\w)?( ?= ?\w)?)(, )?)+\)` :[
02:56:27FromDiscord<Elegantbeef> Ah i reread it like 10 times to understand
02:56:52FromDiscord<!Patitotective> In reply to @Elegantbeef "The issue is the": .
03:26:03FromDiscord<tandy> `var newListen = listen`↵listen is a ref object, how do i only copy by value?
03:27:20FromDiscord<Elegantbeef> You want to copy it's fields?
03:27:32FromDiscord<Elegantbeef> Or do you want the internal struct
03:30:40FromDiscord<tandy> fields
03:33:08FromDiscord<tandy> oh deepCopy
03:39:08FromDiscord<Elegantbeef> Yep
04:06:36*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
04:08:27*wallabra joined #nim
06:47:02*PMunch joined #nim
06:48:59*crem quit (Read error: Connection reset by peer)
06:52:22*crem joined #nim
06:58:14FromDiscord<d4rckh> easiest way to add to pointers in nim?
06:58:20FromDiscord<d4rckh> (edit) "to" => "2"
07:00:15FromDiscord<Rika> The easiest way is to not
07:00:25FromDiscord<Rika> What are you doing exactly to warrant adding pointers
07:00:34FromDiscord<d4rckh> parsing an object file
07:01:00FromDiscord<Rika> I don’t know why that would warrant adding pointers
07:01:39FromDiscord<d4rckh> i want to get to the relocations of each section
07:01:47PMunchJust pushed a new version of Notificatcher, now supporting close notifications and pid in format :) https://github.com/pmunch/notificatcher
07:01:51FromDiscord<d4rckh> and the section headers contain a pointer to them
07:02:16PMunchAll these features essentially just makes it easier to use other graphical programs to actually show the notifications
07:02:48FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=49qQ
07:03:00FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=49qR
07:03:12FromDiscord<Rika> If you really need to then https://github.com/kaushalmodi/ptr_math
07:03:17FromDiscord<d4rckh> but im getting the wrong values for the relocation entry 🤔
07:03:21PMunch@d4rckh, you essentially just cast both pointers to int and then add those together
07:03:23FromDiscord<Rika> But I think there’s a better way
07:04:18FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=49qS
07:04:18FromDiscord<d4rckh> dont know the values i get seem to be wrong
07:04:58FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=49qT
07:05:55*m5zs7k quit (Ping timeout: 252 seconds)
07:08:35FromDiscord<d4rckh> argh. found the issue
07:08:37FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/1015156277099376671/unknown.png
07:08:40FromDiscord<d4rckh> forgot to add packed to my structs
07:10:14*m5zs7k joined #nim
07:11:55*rockcavera quit (Remote host closed the connection)
08:00:02*Vladar joined #nim
08:26:40FromDiscord<Tuatarian> not sure why I'm getting this error
08:26:48FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=49r7
08:26:55FromDiscord<Tuatarian> this happens with even just "Hello World"
08:27:05FromDiscord<Tuatarian> (edit)
08:27:25madpropshow are you compiling the program?
08:27:27FromDiscord<Elegantbeef> nim -v?
08:27:37FromDiscord<Tuatarian> (edit)
08:27:46FromDiscord<Tuatarian> compiling nim c --gc:orc -r renderer.nim
08:27:55FromDiscord<Tuatarian> 1.7.1
08:28:04FromDiscord<Elegantbeef> Do you have any static arrays?
08:28:16FromDiscord<Tuatarian> yes, but even if I replace the whole program with Hello World this happens
08:28:29FromDiscord<enthus1ast> sounds like a cache issue to me,↵try to use -f↵(@Tuatarian)
08:28:34FromDiscord<Tuatarian> static array meaning array as opposed to seq right?
08:28:34FromDiscord<Rika> Then you probably got a borked devel version?
08:28:59FromDiscord<Elegantbeef> No static means compile time constant
08:29:30FromDiscord<Tuatarian> no compile time arrays
08:30:08FromDiscord<Tuatarian> In reply to @enthus1ast "sounds like a cache": didn't seem to do anything
08:30:36FromDiscord<Elegantbeef> Update your compiler or try 1.6.6
08:30:45FromDiscord<Tuatarian> same thing for 1.6.6
08:33:02PMunch`rm -rf ~/.cache/nim/project_d`
08:33:18PMunchI guess that would be renderer_d in your case
08:35:51FromDiscord<Tuatarian> using `rm -recurse -force ~/.cache/nim/renderer_d`
08:35:52FromDiscord<Tuatarian> path doesn't exist
08:36:04FromDiscord<Tuatarian> wait of course it doesn't lmao
08:36:07FromDiscord<Tuatarian> where is the nim cache on windows
08:36:33FromDiscord<enthus1ast> i meant\:↵nim c -f yourfile.nim↵(@Tuatarian)
08:37:39FromDiscord<Tuatarian> In reply to @enthus1ast "i meant\: nim c": same issue
08:38:11FromDiscord<Elegantbeef> `nim c --nimCache:"somefolderhere" -r yourFile.nim`
08:38:35PMunchJust pushed deriveable types to GitHub: https://github.com/PMunch/deriveables
08:38:46FromDiscord<Elegantbeef> Congrats
08:38:51FromDiscord<Elegantbeef> I still dont understand a lick of it
08:38:56PMunchHaha
08:39:01PMunchYou even helped in writing it :P
08:39:12FromDiscord<Elegantbeef> I know
08:40:56PMunchThe goal is to be able to take a procedure and tag it with `{.route: "GET users/@id/posts".}` for example and then use deriveable types to create a proc which only takes `Request` and calls to whatever arguments you have and to use autotemplates to generate the output based on whatever type you return.
08:41:10FromDiscord<ECHO> anyone else having problems with VSC's code completion?
08:41:15FromDiscord<Tuatarian> In reply to @Elegantbeef "`nim c --nimCache:"somefolderhere" -r": same issue
08:41:19FromDiscord<ECHO> yes i just joined to ask this
08:41:28FromDiscord<Elegantbeef> Use nimsaems extension
08:41:39FromDiscord<Elegantbeef> If that doesnt help ensure you set the project in your config
08:41:44FromDiscord<Elegantbeef> If that doesnt help, welcome to Nim tooling
08:42:02FromDiscord<Elegantbeef> tuatara sounds like something wrong with your compiler
08:42:21FromDiscord<ECHO> could this be the problem? https://media.discordapp.net/attachments/371759389889003532/1015179863482699816/unknown.png
08:42:36FromDiscord<Elegantbeef> Change the configuration to not use nimlangserver
08:43:19FromDiscord<Elegantbeef> https://github.com/saem/vscode-nim#nim-lanugage-server-integration-experimental ensure you dont have this set
08:43:59FromDiscord<Elegantbeef> I'm now reminded of earlier today realising "Oh shit my lsp isnt running" and spending 20 minutes to learn some update broke how kate's home path is evaluated
08:45:03FromDiscord<ECHO> didnt KDE kill kate?
08:45:11FromDiscord<Elegantbeef> Nope
08:45:18FromDiscord<Elegantbeef> They've made it better and better
08:45:24FromDiscord<Elegantbeef> It's a full on code editor experience now
08:45:35FromDiscord<ECHO> ig ill check if kate works
08:45:41FromDiscord<enthus1ast> Even with this i have some troubles btw (i accepted for now that the nim vscode tooling is mediocre)
08:45:57FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1015180769678852136/image.png
08:45:58FromDiscord<Elegantbeef> Full on code editor here, it's magic
08:46:15FromDiscord<ECHO> is that visual studio?
08:46:20FromDiscord<Elegantbeef> That's Kate
08:46:25FromDiscord<ECHO> ah
08:46:41FromDiscord<Elegantbeef> Kate does require Nimlsp to be installed
08:46:51FromDiscord<ECHO> i havent looked into kde programs since i switched from plasma to i3
08:47:04FromDiscord<Elegantbeef> Yea i dont use KDE but still use kate
08:47:06FromDiscord<Elegantbeef> It's a pretty good editor
08:47:53PMunchWho'da thunk Kate would become a proper editor
08:48:08FromDiscord<Elegantbeef> Really no one
08:48:09PMunchLast time I used it it was merely a slightly fancy notepad
08:48:17FromDiscord<Elegantbeef> Yea same
08:48:43FromDiscord<Elegantbeef> I was like "Why the hell does this toy editor have LSP support" opened and it's a fully usable text editor now
08:48:47FromDiscord<Elegantbeef> And gets better each update
08:49:02FromDiscord<Elegantbeef> There are some oddities like multi-cursor
08:49:14FromDiscord<Elegantbeef> I do not know if there is way to do multicursor with only the keyboard
08:49:23FromDiscord<Elegantbeef> So multi line editing is not fun
08:52:57PMunchWait, you need to involve the mouse to do multicursor?
08:53:23FromDiscord<Elegantbeef> Yea cause my DE was blocking that input apparently
08:53:49FromDiscord<Elegantbeef> I looked into again now and yea there a key shortcut but my DE was blocking it so i figured it didnt do anything
08:54:25PMunchHaha, sounds like you have configured your DE or Kate poorly :P
08:54:37FromDiscord<Elegantbeef> It's default settings for both
08:54:41FromDiscord<Elegantbeef> The DE just sucks
08:55:13PMunchWhat're you using at the moment?
08:55:20FromDiscord<Elegantbeef> Gnome
08:55:34FromDiscord<Elegantbeef> Misclicked on install months ago and havent got to changing it
08:55:41PMunchAh, haven't used Gnome in ages
08:55:43PMunchHaha :P
08:55:53PMunchWhat where you meaning to install?
08:56:20FromDiscord<Elegantbeef> I was using xfce before
08:56:47FromDiscord<Elegantbeef> But now i'm using a wayland DE so feel like i should stay here
08:57:07FromDiscord<Elegantbeef> Though I dislike parts of all TWM so i just cry
08:58:28FromDiscord<Elegantbeef> But i've had a few issues with wayland now so X might be where it's at
09:02:01FromDiscord<aruZeta> i like TWM since they are rly simple
09:02:26FromDiscord<Elegantbeef> I like them a lot but i dislike how a lot of them operate
09:03:33FromDiscord<aruZeta> tbh I usually don't even have more than 1 window in each workspace
09:03:39FromDiscord<Elegantbeef> I just want each monitor to have a carousel that i can easily iterate through on each monitor
09:04:07FromDiscord<aruZeta> so I don't need all the clutter and unnecessary stuff DE's bring
09:04:12FromDiscord<Elegantbeef> My "wm" did that, but X is so tedious i dont think it's properly usable
09:04:37FromDiscord<aruZeta> In reply to @Elegantbeef "I just want each": what would the carousel have?
09:04:54FromDiscord<aruZeta> the currently using workspaces?
09:04:56FromDiscord<Elegantbeef> It's just a workspace like in i3wm
09:05:18FromDiscord<Elegantbeef> But instead of tags or numbers you just move up/down a stack of your workspaces
09:05:39FromDiscord<Shiba> i3 is
09:05:45FromDiscord<Shiba> goot
09:05:55FromDiscord<aruZeta> hmmm
09:06:05FromDiscord<Elegantbeef> https://streamable.com/hottcl
09:06:58FromDiscord<aruZeta> have you tried sway?
09:07:10FromDiscord<Elegantbeef> The idea is each monitor just has a linear groups of monitors you can just hit like `super + 1 + up` to go up on monitor 1
09:07:16FromDiscord<Elegantbeef> No it's not dynamic tiling
09:08:16FromDiscord<Elegantbeef> Manual tiling window managers make 0 sense to me
09:08:56FromDiscord<Elegantbeef> "You know it really sucks that windows appear randomly and take up a random amount of space, how about we share it equally.... but you have to manually alternate directions when opening a window"
09:09:39PMunchDamn, just tried Vosk to transcribe a small part of audio I just mumbled into my headset outside. And it worked perfectly
09:10:04FromDiscord<Elegantbeef> Nice
09:10:34FromDiscord<Elegantbeef> Home automation related?
09:11:21PMunchNot really.. I've been thinking of setting up a small system which watches a folder, then runs OCR and audio transcription on stuff in the folder and generates Notable compatible markdown files that attaches the original file with the transcript
09:11:42PMunchThat way I can take audio notes, do screenshots, etc. and have them all searchable :)
09:12:02FromDiscord<Elegantbeef> Ah
09:12:10PMunchBut Vosk has a microphone version as well, that streams the results, so it could definitely be used for home-automation..
09:12:20PMunchNow I kinda want to do that as well
09:12:33FromDiscord<Elegantbeef> Except the model is 50mb 😛
09:12:46PMunch50Mb is tiny
09:12:52PMunchThey have a 16Gb model as well :P
09:13:30FromDiscord<Elegantbeef> Anyway after that TWM rambling, i'm outta here 😄
09:13:44PMunchThat's another of my projects, a window manager which does a non-overlapping layout
09:14:12PMunchBasically all windows open at the size they want, but the WM makes sure they can't overlap at all
09:15:06PMunchSo it places windows cleverly to avoid that, and allows you to expand a window to take up more space
09:18:20FromDiscord<sealmove> The UI in gnome/kde/windows is getting good though. You can tile windows and everything
09:20:52PMunchAre they keyboard shortcuts for that stuff in Windows?
09:20:59FromDiscord<sealmove> yup
09:21:02FromDiscord<sealmove> nowdays yes
09:21:24FromDiscord<aruZeta> win+arrow key you mean?
09:21:36FromDiscord<sealmove> and also wsl has great intergation (for instance with vscode)
09:21:46FromDiscord<srozb> Hey, I'm having hard time to understand how could I pass the cstring to proc to have it overwritten by callee. I've created minimal example and I really need to pass a pointer to cstring somehow because of compatibility with the C function I'm interfacing. Could anybody point me to a good way to do this? https://media.discordapp.net/attachments/371759389889003532/1015189784672616499/unknown.png
09:21:47FromDiscord<sealmove> so you can have a real hybrid of windows and linux
09:24:10FromDiscord<sealmove> In reply to @srozb "Hey, I'm having hard": `ptr cstring`
09:24:14FromDiscord<srozb> of course I've googled first and read good explanation by PMunch here: https://forum.nim-lang.org/t/8179 still don't understand why this is not working
09:24:33FromDiscord<sealmove> `var` gives you gc-managed memory
09:24:39FromDiscord<srozb> oh
09:25:23FromDiscord<sealmove> you `system.alloc` just like you use `malloc` in c
09:25:29FromDiscord<sealmove> (edit) "you" => "use"
09:25:53PMunchWhy do people insist on sharing screenshots..
09:26:10PMunchI mean there's a "Share to ix" button right there, in the screenshot!
09:26:12FromDiscord<srozb> well this way you don't need to open another tab clicking
09:26:20PMunchOh yes I do..
09:26:27FromDiscord<srozb> https://play.nim-lang.org/#ix=49rp
09:26:33PMunchOn IRC screenshots just come through as links
09:26:49FromDiscord<srozb> ok, sorry for that
09:27:03FromDiscord<sealmove> you can also wrap code in "\`\`\`" (in discord at least)
09:27:21FromDiscord<sealmove> (edit) ""\`\`\`"" => ""\`\`\`nim""
09:27:23PMunchAnd even if you want to have it inline in the chat, paste a code block, at least that way people can edit and share the results back to you without having to type the entire thing in again
09:27:34FromDiscord<srozb> ok ok, got it
09:27:45FromDiscord<sealmove> PMunch how does editing work in IRC?
09:28:03FromDiscord<sealmove> I remember ppl complaining for discord edits, that in IRC they resend messages
09:30:11FromDiscord<srozb> but if I pass a pointer it will be immutable and I won't be able to assign a value there, right? how should I declare the proc arguments?
09:30:47FromDiscord<sealmove> actually judging from your example, you don't have to manage the memory yourself, do you?
09:30:52PMunch@sealmove, yes when you edit things there is a small message that says "edit: <changes>"
09:30:57FromDiscord<sealmove> Your cast is just wrong
09:31:12PMunchYeah that cast won't work
09:31:12FromDiscord<sealmove> In reply to @PMunch "<@173424250319929344>, yes when you": oh like a diff?
09:31:24PMunchAnd I don't think you can assign anything to a var cstring
09:31:47FromDiscord<sealmove> but it can be a pointer
09:31:55FromDiscord<sealmove> which can be pointed to a new cstring
09:31:58PMunchEssentially a var cstring is a ptr ptr char, so what you're doing by assigning is creating a new pointer
09:32:20PMunchWhat you want to do is copyMem the data into the original string
09:33:22FromDiscord<srozb> I see, I thought that cstring is already a pointer to a place where I can freely write unless the buffer is not too small
09:33:37FromDiscord<srozb> and therefore I could simply pass it (without any cast)
09:33:56PMunchWell you can, the error is actually in the assignment
09:34:08PMunchWell that and casting to a string
09:34:13PMunchGotta go, lunch
09:34:19FromDiscord<sealmove> bon appetit!
09:34:27FromDiscord<srozb> ok, thank you and enjoy your meal\
09:43:50FromDiscord<sealmove> @srozb how about this? cstring
09:44:01FromDiscord<sealmove> (edit) "cstring" => "https://play.nim-lang.org/#ix=49ru"
09:46:07FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=49rv
10:16:34madpropshello nim
10:18:31PMunchHello
10:23:24PMunch@srozb, do you need for the callee proc to take a cstring argument?
10:24:34FromDiscord<srozb> yes because I want to remain the same API as it was used by C library, so you can simply compile a dll and replace the original
10:24:56FromDiscord<srozb> this worked for me
10:24:59FromDiscord<srozb> sent a code paste, see https://play.nim-lang.org/#ix=49rG
10:25:22FromDiscord<srozb> though I rather use string.len instead of sizeof
10:25:32PMunchJust make cst a string instead
10:25:42FromDiscord<srozb> that's right
10:25:42PMunchAnd then use cst.cstring in the copyMem
10:25:46FromDiscord<srozb> that what I did
10:25:57FromDiscord<srozb> work like a charm
10:26:23PMunchThis is what I'd do: https://play.nim-lang.org/#ix=49rH
10:27:25PMunchKeep in mind though that you never set outString.len, so it is still 1024
10:27:52PMunchAnd Nim strings can include 0 characters, while C strings can't
10:28:28FromDiscord<srozb> This is exactly what I did, as for the buffer length I already have a function that recommends the max length that I need to allocate - this is also a C lib design
10:29:11FromDiscord<srozb> I'm rewriting the whole PE library to pare executables
10:29:31PMunchSomething like this can be used to properly set the string length: https://play.nim-lang.org/#ix=49rI
10:29:55PMunchPE library?
10:30:24FromDiscord<srozb> yep, portable executable parsing
10:30:50FromDiscord<srozb> I really wanted to grep the whole windows/system32 directory looking for specific import or export
10:31:18FromDiscord<srozb> so I though I could write a tool for myself and have fun learning nim
10:32:14FromDiscord<srozb> at first I simply wrapped the library and it worked perfect on linux and mac but had strange deadlocks on Windows
10:33:07FromDiscord<srozb> debugger showed me that cpu was inside the infinite loop while the cygwins strdup() was called (probably the loop was somewhere inside cygwin implementation of malloc/calloc)
10:33:51FromDiscord<srozb> so I ended up rewriting the whole library to nim and actually i'm almost done
10:34:05FromDiscord<srozb> now I don't need cygwin1.dll or other libs
10:34:17FromDiscord<srozb> that's my story
10:35:01PMunchHuh, that's actually pretty cool
10:35:18PMunchYou should release it and post it to This Month With Nim
10:36:41FromDiscord<srozb> sure, it's on the github but definately not ready to show as the code is messy and not documented
10:37:04FromDiscord<srozb> as soon as I'll polish the edges I will publish info
10:37:14PMunchI mean if it's messy but it works
10:38:06FromDiscord<Rika> pmunch do you perhaps know of an implementation of a trie data structure in nim
10:39:37FromDiscord<srozb> sent a code paste, see https://play.nim-lang.org/#ix=49rN
10:41:14PMunchPfft, you have better test coverage than my projects combined. I'd say ship it :P
10:42:26PMunch@Rika, there's this: https://github.com/status-im/nim-eth-trie
10:42:42FromDiscord<Rika> dont think thats exactly what i want, ive seen it too
10:48:26FromDiscord<aruZeta> rounded alignment patterns do look nice eh https://media.discordapp.net/attachments/371759389889003532/1015211593899987044/unknown.png
10:49:14PMunch@aruZeta, but how well do they scan?
10:49:22FromDiscord<aruZeta> perfectly
10:49:28PMunchThe circle as well?
10:49:35FromDiscord<aruZeta> ye
10:49:46FromDiscord<aruZeta> at least the qr scanner I have does
10:50:05PMunchHuh
10:50:14FromDiscord<Rika> scans perfectly for me too
10:50:27FromDiscord<Rika> you have to know that qr scanners are surprisingly resilient to funky stuff
10:50:39FromDiscord<aruZeta> ive seen them like that before, and someone asked me to implement it
10:50:49FromDiscord<Rika> you could prolly even curve the qr data itself and itll still scan
10:50:55FromDiscord<aruZeta> yes
10:51:20FromDiscord<aruZeta> https://media.discordapp.net/attachments/371759389889003532/1015212326296768612/unknown.png
10:51:48FromDiscord<aruZeta> that was what the one asking to implement the rounded patterns showed me
10:52:17FromDiscord<aruZeta> and yh that qr works
11:00:33PMunchYeah they are surprisingly resiliant (fun fact, the center image isn't a supported part of QR codes, it's just obscuring data, but it still works because of redundancy)
11:01:24PMunchAnnoyingly this means that most QR codes just use some kind of link shortener to make the code less noisy, so it's not always obvious what it links to
11:01:41PMunchI wonder if there's a speed penalty to it though
11:02:11FromDiscord<aruZeta> In reply to @PMunch "Yeah they are surprisingly": yh, it works because of the damn ECC
11:02:16PMunchI've definitely had more trouble with QR codes that have say an image or some other funkiness to them when they are also damaged or obscured by dirt
11:02:38FromDiscord<aruZeta> yep it affects speed
11:03:37FromDiscord<aruZeta> since the scanner will need to read the ECC which is the last part of the data and calculate some polynomials to "fix" the missing data codewords
11:47:18FromDiscord<Forest [She/Her]> Question, what's the correct way to check if an object is not of MyTypeChildOne or MyTypeChildTwo?
11:49:32FromDiscord<Forest [She/Her]> Is it `if object of MyTypeChildOne or object of MyTypeChildTwo:`?
11:49:48FromDiscord<Forest [She/Her]> (edit) "Is it `if object ... of" added "not"
11:49:58FromDiscord<Forest [She/Her]> (edit) "Is it `if object not of MyTypeChildOne or object ... of" added "not"
11:50:58FromDiscord<Rika> `not of and not of` or `not (of or of)`, gotta love demorgan
11:51:12FromDiscord<Rika> oh, i noticed this too
11:51:25FromDiscord<Rika> `object not of MyTypeChildOne` is invalid, i think it has to be `not object of MyTypeChildOne`
11:51:36FromDiscord<Forest [She/Her]> Oh yeah
11:51:42FromDiscord<Forest [She/Her]> That should really be a thing ngl
12:15:16FromDiscord<aruZeta> expected that `notof` existed, like `notin` does
12:18:17FromDiscord<Forest [She/Her]> It doesn't
12:24:06FromDiscord<Phil> In reply to @aruZeta "expected that `notof` existed,": TIL, and I will immediately forget that this exists because it seems nonintuitive
12:41:31FromDiscord<Forest [She/Her]> Lmao fair
12:48:02*ggsx joined #nim
12:51:01FromDiscord<Forest [She/Her]> In reply to @Rika "`not of and not": Wait so
12:51:24FromDiscord<Forest [She/Her]> `if not obj of MyTypeChildOne or of MyTypeChildTwo`?
12:52:35FromDiscord<Rika> `if not (obj of MyTypeChildOne or obj of MyTypeChildTwo)`
12:52:51FromDiscord<Rika> idk if op precedence is ok here tho
12:53:47PMunchNeat, I've set up a small script on my server now. It watches a folder that is synced with my phone through Syncthing and it's where my audio recorder sends it's recordings. The script then runs Vosk on the files, and writes up a small Notable-compatible markdown file with the transcription, moves the recording into the Notable attachments folder, and puts a link to that file in the transcript. So now I can record snippets of audio on my phone, and by the time
12:53:47PMunchI'm back at my PC I have a transcribed version of it already synced into my notables folder
12:54:27FromDiscord<aruZeta> neat
12:56:42FromDiscord<ShalokShalom> Anyone here, who used the QML binding?
12:57:31FromDiscord<Forest [She/Her]> Aight thanks ^^
12:58:04*ggsx quit (Quit: Client closed)
12:58:51FromDiscord<Forest [She/Her]> Hm for some reason the if statement is still running?
12:59:38*ggsx joined #nim
12:59:55FromDiscord<Forest [She/Her]> In reply to @PMunch "Neat, I've set up": `if not (variable.jparent of JavaMethodDeclaration or variable.jparent of JavaBlock)` still returns true hm
13:00:07FromDiscord<Forest [She/Her]> Didn't mean to reply to that sorry ^^
13:01:02*arkurious joined #nim
13:02:31*Vladar quit (Remote host closed the connection)
13:03:48FromDiscord<Forest [She/Her]> Oh it was my code
13:03:55FromDiscord<Rika> lol
13:04:00FromDiscord<aruZeta> lol
13:04:13FromDiscord<aruZeta> i was about to prove that it does https://media.discordapp.net/attachments/371759389889003532/1015245766484299808/unknown.png
13:16:37PMunchHmm, I guess next step for me would be to add a screenshot/image ingest point as well for this system
13:27:40*ggsx quit (Quit: Client closed)
13:29:41*ggsx joined #nim
13:30:49FromDiscord<auxym> hm `nimcacheDir()` only seems to work in nimscript and not in macros/consts at compiletime. Any alternative? I seem to remember a way to get compiler options...
13:44:42*luis_ joined #nim
13:45:27FromDiscord<auxym> ah, the stuff in std/compilesettings is what I had in mind, seems to work
14:02:12*PMunch quit (Quit: Leaving)
14:13:44FromDiscord<auxym> hey @PMunch btw if you're still thinking about abstractions for ratel, this might be interesting food for thought: https://embeddedartistry.com/blog/2022/07/11/how-our-approach-to-abstract-interfaces-has-changed-over-the-years/
14:13:52*ggsx quit (Ping timeout: 252 seconds)
14:35:43*rockcavera joined #nim
14:35:43*rockcavera quit (Changing host)
14:35:43*rockcavera joined #nim
14:35:47FromDiscord<d4rckh> how can i call a function pointer?
14:36:04FromDiscord<Rika> what do you have as code rn
14:36:19FromDiscord<d4rckh> one sec
14:37:36FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=49sN
14:39:08FromDiscord<Rika> im not sure how you would call a pointer from not-nim because theres a lot to it
14:39:16FromDiscord<Rika> calling convention, the signature of the function, etc
14:40:13FromDiscord<enthus1ast> @d4rckh\: define a nim proc, and cast the pointer to this proc
14:40:18FromDiscord<d4rckh> got it
14:40:19FromDiscord<d4rckh> thanks
15:02:37qwrnot knowing context - in pure nim code you just use function type instead pointer and don't cast anything
15:15:04*derpydoo joined #nim
15:39:41FromDiscord<srozb> @PMunch It's alive: https://github.com/srozb/peni btw: thanks for nancy & termstyle that are being used there
15:53:29FromDiscord<voidwalker> Anyone familiar with the distributed/decentralized databases landscape ? I am looking for something easy to work with, that I can use in nim. So something that has REST/gRPC API, even just cli tool, although not ideal.
15:55:40FromDiscord<Rika> why the REST/gRPC api if you're looking for a database
15:56:48FromDiscord<voidwalker> well how else are you going to talk to it, since there are no wrappers for nim for any such database?
15:57:39FromDiscord<voidwalker> (edit) "well how else are you going to talk to it, since there are no ... wrappers" added "nim ports or"
15:57:51FromDiscord<Rika> most distributed databases i know are drop ins for my/postgres
15:58:10FromDiscord<Rika> not that i know manyt
15:58:11FromDiscord<Rika> (edit) "manyt" => "many"
15:58:19FromDiscord<voidwalker> ah, the ones I found so far, the "web 3.0" ones, mostly in js, don't have sql interface
15:58:45FromDiscord<auxym> web3, as in, blockchain?
15:58:46FromDiscord<Rika> so there's tidb and cockroachdb, the ones i know are "mainstream" in some sense
15:58:47FromDiscord<auxym> ugh
15:58:56FromDiscord<Rika> not sure if thats what you want
15:58:57FromDiscord<voidwalker> orbitDB is just perfect, but has fallen to bitrot, only works with ancient ipfs versions, and its http api is also buggy/outdated
15:59:11FromDiscord<Rika> do you want specifically decentralised
15:59:22FromDiscord<Rika> becaise the ones i mention are just distributed
15:59:46FromDiscord<voidwalker> I want something that requires minimal setup, that can talk to each other with almost no config
16:02:11*luis_ quit (Quit: luis_)
16:04:31FromDiscord<voidwalker> yeah, i'd rather have it centralised. don't want to spend much time now researching the perfecrt solution that I will use, that will be good at scale. just want something to get going quickly with close to zero setup, so that I can release v0.01 of my project
16:04:46FromDiscord<voidwalker> (edit) "centralised." => "decentralised."
16:06:04FromDiscord<Shiba> is there any pure game dev frameworks or graphics libaries
16:07:40FromDiscord<Rika> hows this https://github.com/amark/gun
16:07:45FromDiscord<Rika> not you shiba
16:10:29NimEventerNew Nimble package! libfuzzy - libfuzzy/ssdeep wrapper, see https://github.com/srozb/nim-libfuzzy
16:10:49FromDiscord<voidwalker> yeah that gun thing, does not have its own http api. there is a project implementing it, but very limited functionality, no examples, no docs
16:11:08FromDiscord<voidwalker> it's meant for js bullshit
16:13:23FromDiscord<Rika> cant help then
16:13:37*neceve joined #nim
16:16:29NimEventerNew Nimble package! autotemplate - Small library to automatically generate type-bound templates from files, see https://github.com/PMunch/autotemplate
16:16:29NimEventerNew Nimble package! deriveables - Small library to generate procedures with a type derivation system, see https://github.com/PMunch/deriveables
16:16:57FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=49tj
16:17:05FromDiscord<Forest [She/Her]> (of course, I'd use `$` instead of toString)
16:17:13FromDiscord<Forest [She/Her]> (This is just an example of wrapping Java methods)
16:18:14FromDiscord<Rika> i dont understand the question
16:19:21FromDiscord<Forest [She/Her]> For context, I'm making a crappy way to build Java code within Nim, I'm trying to figure out a way to create 'bindings' in a semi-clean way for the user
16:20:21FromDiscord<Forest [She/Her]> There's also the issue of static methods too tbh
16:28:20*fallback quit (*.net *.split)
16:28:20*oisota quit (*.net *.split)
16:28:21*blackbeard420 quit (*.net *.split)
16:28:21*koltrast quit (*.net *.split)
16:28:21*lumidify quit (*.net *.split)
16:28:34*blackbeard420 joined #nim
16:29:03*lumidify joined #nim
16:29:10*oisota joined #nim
16:29:25*koltrast joined #nim
16:31:18FromDiscord<retkid> https://gitlab.com/CAlbassort/arbitraryfilevideoencoder
16:31:19FromDiscord<retkid> heres code
16:31:22FromDiscord<retkid> rip it to shreads
16:31:28FromDiscord<retkid> if thou wilt
16:32:08FromDiscord<retkid> madprops irc wanted to see it
16:32:17FromDiscord<retkid> In reply to @madprops "link?": . scroll up
16:33:12FromDiscord<ShalokShalom> In reply to @Forest "For context, I'm making": Äaahm, why not using Graal?
16:34:20FromDiscord<ShalokShalom> It supports Nim via LLVM and has native polyglot support with tons of language's ↵↵https://www.graalvm.org/
16:35:16*vicecea quit (Remote host closed the connection)
16:35:44*vicecea joined #nim
16:37:08*fallback joined #nim
16:37:39FromDiscord<Forest [She/Her]> In reply to @ShalokShalom "Äaahm, why not using": Because then it'd be more messy, using LLVM with Graal is GraalVM-specific and also a pain to do in C
16:38:00FromDiscord<Forest [She/Her]> And plus, with this code generation library, i have the goal of making a full-blown Java backend for Nim
16:38:15FromDiscord<ShalokShalom> Aha
16:38:19FromDiscord<Forest [She/Her]> (Java source code instead of JVM bytecode because emitting Java code is definitely useful to have)
16:38:27FromDiscord<ShalokShalom> Well, Graal is already a full blown Java backend for Nim xD
16:38:40FromDiscord<ShalokShalom> Ah, that you mean.
16:39:12FromDiscord<Forest [She/Her]> Not really a full backend, of course it can run LLVM but you can't interop with Java code easily, can you?
16:39:21FromDiscord<ShalokShalom> Yes, you can
16:39:25FromDiscord<Forest [She/Her]> Of course you can, but you have to write the structure up yourself
16:39:32FromDiscord<Forest [She/Her]> In reply to @ShalokShalom "Yes, you can": How?
16:40:03FromDiscord<ShalokShalom> https://www.graalvm.org/22.2/reference-manual/polyglot-programming/
16:41:10FromDiscord<ShalokShalom> I guess it makes sense to use this↵↵https://github.com/arnetheduck/nlvm
16:43:10FromDiscord<Forest [She/Her]> In reply to @ShalokShalom "https://www.graalvm.org/22.2/reference-manual/polyg": Yeah I've seen that but, how would i go about making, for example, a Minecraft mod?
16:43:22FromDiscord<Forest [She/Her]> Also, it won't run on the stock JDK (LLVM)
16:44:15*luis_ joined #nim
16:55:54*luis_ quit (Ping timeout: 244 seconds)
16:57:42FromDiscord<auxym> sooo, `staticExec("echo aaa > file.txt")` is turning out to be a PITA. any other ideas to write a file at compiletime? Ideally, OS-independent at supported multiline content?
17:00:40FromDiscord<auxym> huh, apparently plain old `writeFile` works at compiletime. Why do we have staticread again?
17:01:05FromDiscord<aruZeta> does `std/io` work at compiletime?
17:01:44FromDiscord<aruZeta> asking if you tried
17:01:45FromDiscord<auxym> yeah apparently. Don't know why, I remembered it didn't, and that's why we had staticread.
17:02:03FromDiscord<auxym> yeah just did, it works
17:02:43FromDiscord<auxym> should have tried it yesterday though 😓
17:03:01FromDiscord<aruZeta> haha
17:06:07FromDiscord<aruZeta> I thought `import ../[foo, bar]` worked huh
17:06:21FromDiscord<ShalokShalom> In reply to @Forest "Also, it won't run": Well, you can compile a single file binary 🤷🏻‍♂️
17:06:30FromDiscord<aruZeta> i knew `import ./[foo, bar]` didn't but did not expect `..` to not work too
17:06:59FromDiscord<ShalokShalom> And I guess you would need to run Minecraft on GraalVM, throw Nim into the mix and compile it then
17:07:14FromDiscord<ShalokShalom> But yeah, that would be a wildly different approach
17:07:53FromDiscord<ShalokShalom> But I guess for a Minecraft mod would you still need to create a binding or something for Minecraft specifically?
17:08:38FromDiscord<huantian> locking on graal probably isn't the best idea↵what if I want to use ZGC :togn
17:08:42FromDiscord<huantian> (edit) ":togn" => "😛"
17:10:05FromDiscord<Forest [She/Her]> In reply to @ShalokShalom "Well, you can compile": Yeah
17:10:14FromDiscord<Forest [She/Her]> In reply to @ShalokShalom "But I guess for": Yup that's the idea
17:19:22FromDiscord<Rika> In reply to @aruZeta "I thought `import ../[foo,": needs quoting
17:19:29FromDiscord<Rika> ".."/[foo, bar] afaik will work
17:20:06FromDiscord<aruZeta> ohhh
17:20:09FromDiscord<aruZeta> lemme try
17:20:50FromDiscord<aruZeta> ty rika it does!
17:20:57FromDiscord<aruZeta> this is sooo much better now to look at
17:48:54FromDiscord<ShalokShalom> In reply to @Elegantbeef "My "wm" did that,": You know the KDE WM KWin has three different tiling extensions and supports Wayland?
18:01:53FromDiscord<Forest [She/Her]> In reply to @Forest "Question, if i wanted": Anyway, anyone have any ideas?
18:02:02FromDiscord<Forest [She/Her]> Or would there be a better way to do it?
18:04:03FromDiscord<Forest [She/Her]> Also, does anyone think doing `proc staticMethod(statCls:typedesc[JavaObject])` is alright for static methods or would there be a better way of doing it?
18:15:33NimEventerNew thread by Alexeypetrushin: UI with WebView without JS?, see https://forum.nim-lang.org/t/9431
18:44:42FromDiscord<sealmove> In reply to @Forest "Anyway, anyone have any": Hmm you want to mimic the syntax of the class declaration?
18:45:05FromDiscord<sealmove> If so, I think only macros can help you
18:45:20*termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
18:45:35FromDiscord<sealmove> If not, then nim does have `method`
18:45:43*termer joined #nim
18:47:20FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "Hmm you want to": not declaration, just accessing them
18:47:52FromDiscord<creikey> is there a serializing library that allows me to add new fields to the serialized objects and still use old serialized data
18:48:01FromDiscord<Forest [She/Her]> I realised i may not even need to use macros, since 'bindings' to Java classes will be automatically generated
18:49:09*derpydoo quit (Quit: derpydoo)
18:49:47FromDiscord<sealmove> In reply to @creikey "is there a serializing": Nim is statically typed so no
18:50:58FromDiscord<creikey> In reply to @รєคɭ๓๏שє "Nim is statically typed": capnproto offers this though and is also statically typed
18:51:11FromDiscord<sealmove> Hmm
18:51:21FromDiscord<sealmove> Like how?
18:51:34FromDiscord<creikey> In reply to @รєคɭ๓๏שє "Like how?": https://capnproto.org/
18:52:08FromDiscord<sealmove> Without embedding them?
18:52:45FromDiscord<creikey> In reply to @รєคɭ๓๏שє "Without embedding them?": what do you mean embedding?
18:53:34FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=49tV
18:53:53FromDiscord<creikey> sent a long message, see http://ix.io/49tW
18:54:58FromDiscord<sealmove> Ok I don't know if there is a library with such a feature. But it's a good idea for binarylang =)
18:56:43FromDiscord<creikey> it's very nice, it lets you actually use it to save data as your program changes
18:57:14FromDiscord<sealmove> Hmm how? It generates new types?
18:57:34FromDiscord<creikey> In reply to @รєคɭ๓๏שє "Hmm how? It generates": what do you mean new type?
18:58:09FromDiscord<sealmove> Is it a runtime thing?
18:58:19FromDiscord<creikey> In reply to @รєคɭ๓๏שє "Is it a runtime": no it's compile time
18:59:00FromDiscord<creikey> in capnproto you define your data in a "capnproto-lang" schema, then at compile time it generates code in whatever language you want to use the data in
18:59:30FromDiscord<sealmove> Yes I know, I've worked on kaitai struct which is similar
19:00:02FromDiscord<dom96> There is a capnp implementation in Nim
19:00:11FromDiscord<dom96> https://github.com/zielmicha/capnp.nim
19:00:12FromDiscord<creikey> In reply to @dom96 "There is a capnp": capnproto is so much added complexity though
19:00:34FromDiscord<creikey> I want binny, but just I can add more fields
19:00:37FromDiscord<sealmove> In reply to @dom96 "There is a capnp": Ohhh nice!
19:01:03FromDiscord<creikey> and maybe I annotate the number
19:01:05FromDiscord<dom96> looks like it's used in a real project too so probably works quite well
19:01:06FromDiscord<creikey> (edit) "binny," => "flatty,"
19:01:44FromDiscord<sealmove> I still don't get the feature. So you just _extend_ your types with more fields? You can write a macro which generates a new types with the added fields.
19:01:54FromDiscord<dom96> I use capnp a lot at work now so really cool to see it's already supported by Nim
19:01:58FromDiscord<sealmove> I don't know about backwards compatibility though, how it would work
19:02:16FromDiscord<sealmove> Maybe inheritance?
19:02:18FromDiscord<dom96> I guess creikey wants backwards compat
19:02:20FromDiscord<creikey> In reply to @dom96 "I use capnp a": yeah capnproto is great
19:02:27FromDiscord<creikey> In reply to @dom96 "I guess creikey wants": I don't see how you don't have backwards compat in a serialized program
19:02:28FromDiscord<sealmove> Inheritance fits the case
19:02:39FromDiscord<creikey> like who doesn't change their structs over time as you improve your program?
19:02:52FromDiscord<dom96> true
19:02:54FromDiscord<sealmove> You can add, not change
19:03:02FromDiscord<sealmove> To be backwards compatible
19:03:39FromDiscord<creikey> I can't add fields with flatty, looking for alternative that isn't a giant parser + separate schema language + giant generated C++ which is what capnproto has
19:04:03FromDiscord<sealmove> Use inheritance
19:05:33FromDiscord<sealmove> I don't know flatty, if it doesn't mix well, u cam extend flatty to support this feature through inheritance
19:05:34FromDiscord<creikey> In reply to @รєคɭ๓๏שє "Use inheritance": how would this solve the problem I have?
19:05:40FromDiscord<sealmove> Shouldn't be hard
19:06:02FromDiscord<sealmove> (edit) "cam" => "can"
19:06:02emerycreikey: do you want to add new fields to your serialized data or to your nim types?
19:06:15FromDiscord<creikey> In reply to @emery "<@180866243819995136>: do you want": to my nim types, then be able to load old serialized data
19:06:30FromDiscord<sealmove> When u inherit u get flat layout
19:07:12emerycreikey: i recently did a serializer/deserializer but I explicity made this not work :(
19:07:39FromDiscord<creikey> In reply to @emery "<@180866243819995136>: i recently did": flatty is really nice, but I just can't use it to save program state because I need to change my object over time
19:08:10FromDiscord<creikey> add more fields when necessary
19:08:23FromDiscord<creikey> if there was a way to "upgrade" an object by writing some helper function I would be willing to do that ever revisoin
19:08:25FromDiscord<creikey> (edit) "revisoin" => "revision"
19:08:38FromDiscord<creikey> it needs to be binary because I have a lot of binary blobs in my data
19:08:51emeryah, I hadn't thought about state serialization
19:09:40emerylast I heard that's still an unsolved problem in computer science
19:09:59FromDiscord<creikey> In reply to @emery "last I heard that's": capnproto works really well, it's just annoying to have the codegen step
19:12:48emerycreikey: if you are going to roll your own solution then hasCustomPragma and getCustomPragmaVal are your friends
19:14:22FromDiscord<creikey> wonder if I should use bson
19:16:55emerythere is this preserves thing but the binary encoding spec isn't finalized - https://git.syndicate-lang.org/ehmry/preserves-nim https://git.syndicate-lang.org/ehmry/syndicate-nim#preserves-schema
19:19:00FromDiscord<creikey> In reply to @emery "there is this preserves": I wonder if I could just extend flatty to have the struct field version numbers capnproto has
19:19:10FromDiscord<dom96> In reply to @creikey "capnproto works really well,": You’re always going to have it though, no? The only way you’re not is if you are willing to pay a runtime price on efficiency
19:20:24FromDiscord<creikey> In reply to @dom96 "You’re always going to": Structs being backward compatible is definitely an efficiency price in storage and speed of read/write, but sometimes it's wanted like when working with a program that runs for awhile and while it's stimulating you add new fields to the object over time
19:21:37emeryit sounds like you need self-describing dictionaries/maps
19:21:44FromDiscord<creikey> In games before I've used json, and I wrote the version number, then whenever I changed the data I expected I wrote a converter function that upgraded it to the most current object
19:21:57FromDiscord<creikey> I think I could do the same with flatty, maybe that's the best idea
19:48:20FromDiscord<Elegantbeef> @creikey\: https://github.com/beef331/nimtrest/blob/master/vershun.nim#L80-L93 is the way to go 😄
19:48:58FromDiscord<Elegantbeef> Statically typed and migrated versioned data
19:49:47FromDiscord<creikey> In reply to @Elegantbeef "<@180866243819995136>\: https://github.com/beef331/": dude this is so good
19:49:53FromDiscord<creikey> isn't that just object variants though?
19:49:55FromDiscord<creikey> it's better
19:50:01FromDiscord<Elegantbeef> It's not object variants no
19:50:06FromDiscord<Elegantbeef> It's statically typed
19:50:16FromDiscord<creikey> I can just do that with flatty right
19:50:18FromDiscord<creikey> and write the version number
19:50:40FromDiscord<Elegantbeef> You use the static version number to specify the type then you can iterate the version until you get to `Version.high` calling `migrate`
19:50:57FromDiscord<creikey> I read the docs and still don't understand what mixin does https://media.discordapp.net/attachments/371759389889003532/1015348121695440926/unknown.png
19:51:03FromDiscord<Elegantbeef> Yea i mean you just replicate `saveData` and `loadDaat` then just need to unpack it
19:51:16FromDiscord<Elegantbeef> `mixin` says "we will resolve this symbol at instantiation"
19:51:35FromDiscord<creikey> In reply to @Elegantbeef "`mixin` says "we will": interesting?
19:51:36FromDiscord<Elegantbeef> Cause when you have generii interfaces you want to have `migrate` be user definable
19:51:40FromDiscord<Elegantbeef> generic\
19:51:52FromDiscord<creikey> In reply to @Elegantbeef "Yea i mean you": so you read the version number right
19:51:58FromDiscord<creikey> but how do you use that to decide which static function to use
19:52:01FromDiscord<creikey> just a switch statement?
19:52:03FromDiscord<creikey> that returns the tyep
19:52:04FromDiscord<creikey> (edit) "tyep" => "type"
19:52:16FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/vershun.nim#L43
19:52:31FromDiscord<creikey> I cannot read macros unfortunately
19:52:44FromDiscord<creikey> that generates what I was describing I see
19:52:48FromDiscord<Elegantbeef> Yes
19:53:01FromDiscord<Elegantbeef> It calls migrate until it gets to `MyData[Version.high]`
19:53:20FromDiscord<creikey> interesting
19:53:23FromDiscord<creikey> I like this other than the macro
19:53:35FromDiscord<Elegantbeef> I mean the macro is important
19:53:35FromDiscord<creikey> I just cannot understand macros the variable names don't make sense
19:53:45FromDiscord<creikey> In reply to @Elegantbeef "I mean the macro": it is yeah, I might just manually type out what the macro generates
19:53:57FromDiscord<creikey> I think what the macro generates for this file is shorter than the actual macro
19:54:06FromDiscord<Elegantbeef> Just copy the file then compile with `--expandMacros:unpackToData`
20:09:18FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=49uh
20:09:19FromDiscord<Elegantbeef> What's the error?
20:09:31FromDiscord<tandy> `/home/tandy/Programming/nim/website/src/views/db.nim(23, 16) Error: cannot instantiate: 'T'`
20:09:51FromDiscord<Elegantbeef> How are you calling it?
20:10:40FromDiscord<tandy> ` let clients: Table[cstring, Client] = await db.getTable(CLIENT_DB_STORE)`
20:10:52FromDiscord<Elegantbeef> `db.getTable[YourTypeHere](ClientDbStore)`
20:11:53FromDiscord<Elegantbeef> sorry that should be `[: Client]`
20:12:10FromDiscord<Elegantbeef> Nim doesnt have return type inference
20:12:16FromDiscord<tandy> ahhh i see
20:22:43FromDiscord<Require Support> anyone have experience with switching from `asyncdispatch` to `chronos` for async and http stuff? basically im trying to see if the process will take me days or years :/
20:23:51FromDiscord<ShalokShalom> Is there an opinionated web framework, like Rails?
20:24:08FromDiscord<ShalokShalom> Or something html over the wire, or MVU like?
20:24:16FromDiscord<Patitotective> In reply to @Require Support "anyone have experience with": i was going to do it but i realized i had to implement m own download procedure and i was lazy↵but it should be hard at all, seems to have the same procedures
20:24:43FromDiscord<dom96> what's your motivation for switching?
20:25:20FromDiscord<Patitotective> ssl certificates and dlls for me ;p
20:25:21FromDiscord<Patitotective> (edit) ";p" => ":p"
20:27:08FromDiscord<Rainbow Asteroids> If all you needed was a download procedure, why didn't you try puppy?
20:27:51FromDiscord<dom96> puppy isn't async is it?
20:28:17FromDiscord<Patitotective> nope, it isnt
20:28:54FromDiscord<Q-Master> @dom96\: can you plz tell me how can I understand why I continiously getting Unhandled exception\: No handles or timers registered in dispatcher. [ValueError] even when there are 2 working network IOs and several sleepAsync?
20:29:20FromDiscord<dom96> what are "network IOs"?
20:29:35FromDiscord<dom96> that error happens when you don't have any FDs in the event loop
20:29:53FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=49uk
20:30:00FromDiscord<Require Support> In reply to @dom96 "what's your motivation for": I dont wanna use the openssl dll
20:30:07FromDiscord<Q-Master> sending and receiving via socket.↵(@dom96)
20:30:12FromDiscord<Elegantbeef> `[: Client]` is only for method call syntax
20:30:29FromDiscord<Q-Master> That's impossible.↵(@dom96)
20:30:42FromDiscord<dom96> well you must not have any fds in there
20:30:52FromDiscord<ajusa> PMunch's deriveables looks pretty neat
20:30:58FromDiscord<tandy> oh
20:31:00FromDiscord<dom96> feel free to add echos into the code that raises that exception
20:31:04FromDiscord<dom96> to see how many FDs there are
20:31:04FromDiscord<tandy> but it still says without that
20:31:21FromDiscord<dom96> In reply to @Require Support "I dont wanna use": ahh, makes sense
20:31:22FromDiscord<tandy> nvm
20:31:39FromDiscord<Require Support> In reply to @Patitotective "i was going to": https://github.com/bung87/scorper/blob/devel/src/scorper/http/streamclient.nim might be helpful for your case
20:31:49FromDiscord<Q-Master> ok.↵(@dom96)
20:32:13FromDiscord<dom96> In reply to @Q-Master "ok. (<@132595483838251008>)": In general I would recommend not being afraid to dive into the async code to see what is actually going on
20:32:18FromDiscord<dom96> it will help your understanding a lot
20:33:32FromDiscord<Q-Master> I definitely will do this to understand why the FD is eventually disappear.↵(@dom96)
20:34:04FromDiscord<dom96> btw as an aside it's funny to me how many are happy to use bearssl when its own website states that it's "beta-quality" software
20:34:25FromDiscord<Q-Master> @dom96\: BTW, withTimeout is very unsafe to use with reading and writing to sockets.
20:34:41FromDiscord<dom96> In reply to @Q-Master "<@132595483838251008>\: BTW, withTimeout is": yep, because it doesn't cancel operations
20:35:10FromDiscord<Require Support> In reply to @dom96 "btw as an aside": TIL
20:36:36FromDiscord<dom96> also last release was in 2018 0_0 https://www.bearssl.org/todo.html
20:36:55FromDiscord<dom96> how is Status using this in prod without it being a massive security nightmare?
20:37:16FromDiscord<Q-Master> It's fixable easily. I think I'll make a bugfix later. I've already fixed it in my networkutils, just don't have enough time to make a real fix.↵(@dom96)
20:37:56FromDiscord<dom96> In reply to @Q-Master "It's fixable easily. I": Is it? Didn't you already create a PR that attempted to fix it and it turned out much more difficult?
20:38:01FromDiscord<Q-Master> The fix is only for network ops.
20:38:07FromDiscord<Forest [She/Her]> sent a code paste, see https://paste.rs/eqR
20:38:24FromDiscord<dom96> I think `withTimeout` should at the very least have a big warning in its docs
20:38:31FromDiscord<Forest [She/Her]> (edit) "https://play.nim-lang.org/#ix=49um" => "https://play.nim-lang.org/#ix=49un"
20:38:37FromDiscord<Q-Master> yep
20:38:42FromDiscord<dom96> but what you can do to cancel operations is just close the FD
20:39:22FromDiscord<Patitotective> In reply to @Forest "If i have the": yes it will echo `Father heeeelp`
20:39:31FromDiscord<Q-Master> Just adding timeout to send and recv operations like in std/net is enough.↵(@dom96)
20:39:41FromDiscord<Forest [She/Her]> In reply to @Patitotective "yes it will echo": Even for `b.wow()`?
20:39:57FromDiscord<Patitotective> only for `b`, `a` will call the other proc
20:40:06FromDiscord<aruZeta> In reply to @Forest "If i have the": why not test it yourself 😄 https://media.discordapp.net/attachments/371759389889003532/1015360488298790962/unknown.png
20:40:20FromDiscord<Patitotective> if you want dynamic dispatch see https://nim-lang.org/docs/manual.html#methods
20:40:47FromDiscord<Forest [She/Her]> In reply to @aruZeta "why not test it": I just realised that playground existed just before you said this lmao
20:40:51FromDiscord<Forest [She/Her]> but thanks!
20:40:52FromDiscord<aruZeta> hahaha
20:40:55FromDiscord<aruZeta> np :)
20:41:15FromDiscord<aruZeta> love the playground for this kind of things
20:41:21FromDiscord<Forest [She/Her]> So it favours procs with the same type as the type being called even if imherited, good to know
20:41:33FromDiscord<Forest [She/Her]> In reply to @aruZeta "love the playground for": It is great ngl
20:41:49FromDiscord<Forest [She/Her]> Also, my thing for making Java code is nearly usable :)
20:43:09FromDiscord<Rainbow Asteroids> last commit was 3 months ago↵https://www.bearssl.org/gitweb/?p=BearSSL;a=summary
20:43:21FromDiscord<aruZeta> In reply to @Forest "So it favours procs": take a look here maybe you find smth https://nim-lang.org/docs/manual.html#overload-resolution
20:43:51FromDiscord<aruZeta> as you can see the preference is exact match
20:43:55FromDiscord<aruZeta> so yh
20:45:33FromDiscord<dom96> In reply to @Rainbow Asteroids "last commit was 3": sure, but development seems to be slow and it's unclear what level of support it has
20:46:13FromDiscord<Forest [She/Her]> Using `typedesc[MyType]` feels so hacky but works for static fields that are unchangeable
20:46:32FromDiscord<dom96> in any case, IMO all operating systems should provide SSL functionality natively
20:46:45FromDiscord<dom96> I know that Windows kinda does
20:49:31FromDiscord<Forest [She/Her]> On a scale of one to ten, how messy is this code? https://play.nim-lang.org/#ix=49uo
20:49:32FromDiscord<Forest [She/Her]> :p
20:52:25FromDiscord<Superstart033> In reply to @Forest "On a scale of": Java/20
20:53:01FromDiscord<kevin> Anyone use winim CreateThread with a Nim function?
20:53:34FromDiscord<kevin> wondering what the cast is to convert `proc start(lpParameter: LPVOID)` to `LPTHREAD_START_ROUTINE`
20:54:22FromDiscord<Forest [She/Her]> In reply to @Superstart033 "Java/20": Lmao, it's only this trash rn because i'm making an initial wrapper in Nim with my codegen lib to see the before and after (also to catch things i may of missed in the code)
20:54:36FromDiscord<domosokrat> the createDir part can be simplified to `createDir("com/foc/codewrapper")`
20:55:05FromDiscord<domosokrat> I mean lines 66-71
20:55:23FromDiscord<Forest [She/Her]> Oh it can? sweet
20:55:31*neceve quit (Ping timeout: 248 seconds)
20:55:55FromDiscord<Forest [She/Her]> Thanks!
20:56:42FromDiscord<Bung> In reply to @kevin "wondering what the cast": why not use built-in function ?
20:59:27FromDiscord<kevin> In reply to @Bung "why not use built-in": Nim dll's don't support threading natively
20:59:53FromDiscord<kevin> I'll use winim CreateThread until Nim's threading is mature enough that it supports threads
20:59:57FromDiscord<kevin> (edit) "threads" => "DLLs"
21:00:33FromDiscord<kevin> In reply to @Bung "why not use built-in": or do you mean there's a built in function to get the proc's address
21:21:13FromDiscord<Bung> In reply to @kevin "or do you mean": I use threads.createThread , haven't use thread and dll same time, what's the problem
21:25:01FromDiscord<Forest [She/Her]> Using Nim to generate Java code to generate Nim code-
21:25:06FromDiscord<Forest [She/Her]> Ah yes, minimalism
21:27:01FromDiscord<Patitotective> why?
21:33:25FromDiscord<Forest [She/Her]> I wanna compare how verbose generating the code in Nim was with just using codegen lib directly, and then using 'bindings'
21:33:51FromDiscord<Forest [She/Her]> Java needs to be used to make bindings (since reflection and portability)
21:41:18NimEventerNew post on r/nim by Ruri: Call Function in Windows DLL by Ordinal rather than Function Name?, see https://reddit.com/r/nim/comments/x4d9t1/call_function_in_windows_dll_by_ordinal_rather/
21:42:59FromDiscord<Forest [She/Her]> For anyone curious about the currently outputted java code: https://hastebin.com/qawazeguwo.java
21:43:38FromDiscord<Forest [She/Her]> With the current Nim code that generates said java code: https://hastebin.com/wafitoxako.properties
21:43:52FromDiscord<Forest [She/Her]> I struggled to write the code for the last bit lol
21:51:13*greaser|q quit (Changing host)
21:51:13*greaser|q joined #nim
21:51:30*greaser|q is now known as GreaseMonkey
21:53:47FromDiscord<aruZeta> https://media.discordapp.net/attachments/371759389889003532/1015379035477512322/2022-09-02_23-53-08.mp4
21:54:12FromDiscord<Patitotective> 👀
21:54:14FromDiscord<aruZeta> svg truly can do some stuff huh
22:25:53FromDiscord<Tuatarian> guys my file still seems to not be compiling
22:25:57FromDiscord<Tuatarian> how do I flush the cache for that file?
22:25:58FromDiscord<voidwalker> what to look for opening a file with the default program associated with that file's extension on the system ?
22:26:19FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=49uD
22:26:42FromDiscord<Elegantbeef> I mean you should've cleared the cache with `-f` or `--nimcache:...`
22:26:53FromDiscord<Tuatarian> neither of those seemed to work
22:27:09FromDiscord<Tuatarian> sent a long message, see http://ix.io/49uE
22:27:11FromDiscord<Elegantbeef> Well then go to the windows equivlent of `.cache` and remove the nim folder
22:27:22FromDiscord<Tuatarian> yes, I don't know where the nim cache is on windows
22:28:23FromDiscord<Elegantbeef> `C;\users\name\Temp\` it seems
22:28:29FromDiscord<Elegantbeef> Actually wrong thing
22:28:47FromDiscord<Elegantbeef> `user\AppData\Local`
22:31:02FromDiscord<Tuatarian> where in local?
22:31:21FromDiscord<Elegantbeef> `C:\users\$USERNAME\AppData\Local`
22:31:38FromDiscord<Elegantbeef> It should be named nim
22:31:46FromDiscord<Tuatarian> I don't have any folder named nim in local...
22:31:58FromDiscord<Elegantbeef> Well then the windows output isnt the same as Linux
22:32:08FromDiscord<Elegantbeef> So i dont know search your HDD for "nim"
22:39:42FromDiscord<auxym> default nimcache on windows is `C:\Users\you\nimcache`
22:41:23FromDiscord<Tuatarian> got it, thanks
22:43:45FromDiscord<Tuatarian> ok so `renderer_d` is simply not present in nimcahc
22:43:51FromDiscord<Tuatarian> nor is anything that looks like it
22:44:03FromDiscord<Tuatarian> so I'm running into some sort of strange compiler bug
23:41:19FromDiscord<dom96> > wolfSSL supports industry standards up to the current TLS 1.3 and DTLS 1.3, is up to 20 times smaller than OpenSSL, offers a simple API, an OpenSSL compatibility layer
23:41:26FromDiscord<dom96> Anyone wanna get wolfssl into Nim's stdlib? :D
23:41:34FromDiscord<dom96> (edit) ":D" => "😃"