00:00:33 | FromDiscord | <Phil> (edit) "Because turns out that no, no peek proc ... " added "or equivalent" |
00:02:23 | FromDiscord | <Phil> It is kinda satisfying to just bonk down those asan stacktraces |
00:02:43 | FromDiscord | <Phil> And get what I previously thought impossible - a clean billl of health from asan |
00:03:07 | FromDiscord | <leorize> time for tsan! |
00:03:30 | FromDiscord | <Phil> Honestly that abbreviation reminds me of a name from the dragonrider of pern books |
00:03:59 | FromDiscord | <Phil> However, the time for tsan is tomorrow |
00:04:08 | FromDiscord | <Phil> For today asan has been defeated and its 1am |
00:04:27 | FromDiscord | <Elegantbeef> let me make a program that uses the md5 of a program to randomly point at N lines and say something is wrong |
00:04:27 | FromDiscord | <Elegantbeef> Phil would have so much fun |
00:04:52 | FromDiscord | <Phil> That might just be enough to make me want to find out where you live and book a ticket |
00:05:04 | FromDiscord | <Phil> New year, new vacation days |
00:05:18 | FromDiscord | <Phil> (edit) "New year, new ... vacation" added "budget of" |
00:05:33 | FromDiscord | <Elegantbeef> Leo how does nimskull handle thread globals, does it emit a `proc() = =destroy(theGlobal)`? |
00:05:34 | FromDiscord | <leorize> that's the plan |
00:05:36 | FromDiscord | <Elegantbeef> Just book a flight to "near bumfuck nowhere Canada" |
00:05:50 | FromDiscord | <leorize> we already have them emitted for globals |
00:06:08 | FromDiscord | <leorize> so should just be a simple filter to catch threadvar and group it to its own thing |
00:06:22 | FromDiscord | <Phil (he/him)> ~~Beef, that's all of Canada, that doesn't narrow it down~~ |
00:06:29 | FromDiscord | <Elegantbeef> Nah there are places with people |
00:06:37 | FromDiscord | <Phil (he/him)> All 5 of them |
00:07:03 | FromDiscord | <Elegantbeef> I mean there are nearly 40 million people |
00:07:06 | FromDiscord | <Elegantbeef> That's like half a germany |
00:07:18 | FromDiscord | <Phil (he/him)> For what.... 3 times the size? |
00:07:31 | FromDiscord | <Elegantbeef> You think germany is that big? |
00:07:47 | FromDiscord | <Elegantbeef> My province is the pretty much the same area as france and has 4 million in it |
00:08:03 | FromDiscord | <Phil (he/him)> Holy shit that's a lot of difference |
00:08:31 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1192620609818079352/image.png?ex=65a9bd7f&is=6597487f&hm=089feb11e03767cf5ea08414814b6f90928b83172c780d61869a72d7f90b3f35& |
00:08:37 | FromDiscord | <Elegantbeef> Only a small margin of error you have there |
00:08:38 | FromDiscord | <Phil (he/him)> I tend to underestimate northern nations because I over-estimate the effect that flattening the world map has on enlargening northern countries |
00:09:01 | FromDiscord | <Elegantbeef> Mercator is a hell of a projection |
00:09:09 | FromDiscord | <ezquerra> https://brilliantmaps.com/half-canada/ |
00:09:36 | FromDiscord | <Elegantbeef> Of course most Canadians live 300km from the border |
00:09:48 | FromDiscord | <Elegantbeef> Who wants to live where it regularly gets -40 in the winter 😛 |
00:09:51 | FromDiscord | <Phil (he/him)> And then there's willy, deep in the woods |
00:10:54 | FromDiscord | <leorize> just go underground, you can't get cold if the cold can't touch you |
00:11:09 | FromDiscord | <Elegantbeef> Let me introduce you to cold cellars |
00:12:02 | FromDiscord | <Phil (he/him)> ... wasn't the idea of holes in the ground in a room to let the cold air sink into it to have warmer air remaining in the upper areas where the people are? |
00:12:36 | FromDiscord | <leorize> that sounds like fiction to me |
00:12:39 | FromDiscord | <Elegantbeef> Cellars were meant for storing food in a cold environment |
00:12:47 | FromDiscord | <Elegantbeef> Circulation would make your theory pointless |
00:13:04 | FromDiscord | <Elegantbeef> For any amount of cold air that falls hot air would rise |
00:13:08 | FromDiscord | <leorize> and like, once the volume increases, more air would come in |
00:13:12 | FromDiscord | <Elegantbeef> Circulating the room |
00:13:51 | FromDiscord | <Elegantbeef> If you have sufficient cooling in the floor you might be able to make a free 'fan' |
00:14:07 | FromDiscord | <Elegantbeef> But something tells me the scale you'd need is crazy |
00:14:09 | FromDiscord | <leorize> that reminds me of that passively cooled mini pc thing |
00:14:37 | FromDiscord | <Elegantbeef> I can only think of those solid state 'fans' at the moment |
00:14:54 | FromDiscord | <Elegantbeef> No clue if you're just talking about a minipc with a massive heatsink |
00:15:14 | FromDiscord | <leorize> https://fit-iot.com/web/products/airtop3/ |
00:15:37 | FromDiscord | <leorize> looks like they took down the consumer pages |
00:15:50 | FromDiscord | <Phil> It's actually how igloos work. Wow I carried that knowledge with me for like 15years to finally have it be useful |
00:15:58 | FromDiscord | <Phil> Or in part how they work rather |
00:15:59 | FromDiscord | <Phil> https://wardsworld.wardsci.com/home/igloos-the-chillest-form-of-engineering-plus-activity |
00:16:27 | FromDiscord | <leorize> but their marketing used to have this examples of a pinwheel spinning from the rising air |
00:58:17 | * | edr quit (Quit: Leaving) |
01:05:25 | * | jmdaemon joined #nim |
01:47:12 | * | nazgulsenpai quit (Ping timeout: 252 seconds) |
01:57:46 | * | nazgulsenpai joined #nim |
02:25:23 | FromDiscord | <4zv4l> why is https://nim-lang.org/docs/syncio.html#readLines.t%2Cstring↵deprecated ? its really useful to slurp a file easily |
02:32:02 | FromDiscord | <4zv4l> also is it possible to importc without caring about the `main` function in the file ? |
02:33:56 | FromDiscord | <huantian> In reply to @4zv4l "why is https://nim-lang.org/docs/syncio.html#readLi": wdym? this overload only reads one line |
02:36:03 | FromDiscord | <huantian> you can just copy exactly what it does yourself |
02:36:26 | FromDiscord | <Elegantbeef> > also is it possible to importc without caring about the main function in the file ?↵What? |
02:42:01 | FromDiscord | <4zv4l> In reply to @huantian "wdym? this overload only": it does not↵`template readLines(filename: string): seq[string]` |
02:42:07 | FromDiscord | <4zv4l> it reads the file into a seq of line |
02:42:10 | FromDiscord | <4zv4l> I just used it |
02:42:22 | FromDiscord | <4zv4l> but it says its deprecated and needs to specify the number of line to read |
02:42:32 | FromDiscord | <huantian> am i tripping? https://media.discordapp.net/attachments/371759389889003532/1192659367149977610/image.png?ex=65a9e197&is=65976c97&hm=38cf3aec5e3191939702ac2feb413589c5d85a0dd39a1bc621d97a071ee20445& |
02:43:00 | FromDiscord | <4zv4l> In reply to @Elegantbeef "> also is it": if I `importc` from a `.c` file which contains a `main` function, then it is annoyed during compile time since there are two main functions |
02:43:03 | FromDiscord | <4zv4l> In reply to @huantian "am i tripping?": what |
02:43:29 | FromDiscord | <Elegantbeef> The c file should have a `#ifndef lib`↵(@4zv4l) |
02:44:10 | FromDiscord | <4zv4l> so if I wanna read the whole file, how do I do ? |
02:44:17 | FromDiscord | <4zv4l> why they made the one without a line number deprecated ? |
02:44:39 | FromDiscord | <4zv4l> In reply to @Elegantbeef "The c file should": will do, thanks for the tips ~ |
02:44:59 | FromDiscord | <4zv4l> In reply to @Elegantbeef "The c file should": Nim will define `lib` when using `importc` ? |
02:45:23 | FromDiscord | <huantian> In reply to @4zv4l "so if I wanna": `filename.lines.toSeq` is what I usually do i can't remember if theres a different way |
02:45:34 | FromDiscord | <Elegantbeef> No |
02:45:43 | FromDiscord | <huantian> In reply to @4zv4l "why they made the": no idea probably because the default value of reading 1 line was bad |
02:45:43 | FromDiscord | <Elegantbeef> Your C file should define that it does not need main if it's built as a lib |
02:45:49 | FromDiscord | <Elegantbeef> Why are you importing a C file with a `main` |
02:45:53 | FromDiscord | <huantian> (edit) "bad" => "unintuitive" |
02:46:18 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Why are you importing": small project without a header file |
02:46:52 | FromDiscord | <Elegantbeef> so then wrap your C main with `#ifdef myprojectlib` |
02:46:56 | FromDiscord | <4zv4l> In reply to @huantian "`filename.lines.toSeq` is what I": I need to import sequtils to get `toSeq` right ? |
02:47:16 | FromDiscord | <Elegantbeef> rather `#ifndef myprojectlib` |
02:47:47 | FromDiscord | <huantian> In reply to @4zv4l "I need to import": yes |
02:47:47 | FromDiscord | <Elegantbeef> Then from Nim you can do `{.compile("myproject.c", "-Dmyprojectlib").}` |
02:48:16 | FromDiscord | <Elegantbeef> Your project layout sounds hellish though |
02:48:48 | FromDiscord | <4zv4l> thats a very small project |
02:48:52 | FromDiscord | <4zv4l> one file project |
02:49:09 | FromDiscord | <4zv4l> just wanted to show a friend how easy it is to move some part of the code from C to Nim and vice versa |
02:49:17 | FromDiscord | <Elegantbeef> Well like I said wrap the main in C with |
02:49:20 | FromDiscord | <Elegantbeef> the def\ |
02:49:30 | FromDiscord | <Elegantbeef> For Nim -\> C do I have a possible toy project for you |
02:49:38 | FromDiscord | <Elegantbeef> https://github.com/beef331/seeya |
02:50:03 | FromDiscord | <Elegantbeef> https://github.com/beef331/seeya/blob/master/tests/mylib.nim generates↵https://github.com/beef331/seeya/blob/master/tests/mylib.h |
02:50:53 | FromDiscord | <auxym> In reply to @Elegantbeef "<@882793909246369864> is clearly": I basically rewrote everything having to do with descriptors in pure nim for this: https://github.com/auxym/nim-tinyusb |
02:51:21 | FromDiscord | <Elegantbeef> Still a better person than I 😛 |
02:51:23 | FromDiscord | <auxym> it was, uhm, a lot of reading the USB spec |
02:52:23 | FromDiscord | <auxym> that thing should work, if anyone is interested. I had tested it on the pico. |
02:52:29 | FromDiscord | <auxym> for CDC and HID at least |
02:54:53 | FromDiscord | <4zv4l> In reply to @Elegantbeef "For Nim -\> C": thanks ! |
02:55:29 | FromDiscord | <4zv4l> yeah I never did the reverse step actually↵just did C- > Nim, never Nim -> C |
02:56:13 | FromDiscord | <auxym> for nim -> C there's also https://github.com/treeform/genny |
02:56:36 | FromDiscord | <auxym> also does nim -> python and nim -> node.js infact |
02:57:43 | FromDiscord | <4zv4l> In reply to @4zv4l "yeah I never did": ooh actually I did but since the Nim code was a dll, didnt have issue to make the C program that calls it |
02:57:50 | FromDiscord | <4zv4l> (edit) "calls" => "load" |
02:59:56 | FromDiscord | <Elegantbeef> Well you should be compiling your C into a dll or static library aswell |
03:00:02 | FromDiscord | <Elegantbeef> Just cause Nim can compile C directly does not mean you should 😄 |
03:00:34 | FromDiscord | <4zv4l> I meant Nim -> DLL↵C loads the dll and use it↵so I didnt have to link anything special to my C program |
03:00:57 | FromDiscord | <Elegantbeef> Atleast for a single file without a build system there is not much reason not to build the C code into a library |
03:02:13 | FromDiscord | <4zv4l> In reply to @4zv4l "I meant Nim ->": that was for another project |
03:02:24 | FromDiscord | <4zv4l> In reply to @Elegantbeef "Atleast for a single": I didnt need to make it into a library but yeah I see |
03:42:33 | * | hernan quit (Remote host closed the connection) |
03:48:31 | * | azimut quit (Ping timeout: 240 seconds) |
03:59:31 | * | ehmry quit (Ping timeout: 245 seconds) |
04:57:06 | FromDiscord | <kdot_227> nim is very cool 👍 |
05:10:34 | * | jkl quit (Quit: Gone.) |
05:11:58 | * | jkl joined #nim |
05:36:47 | FromDiscord | <lorangeve_24442> sent a long message, see <!doctype html> |
05:37:16 | FromDiscord | <lorangeve_24442> (edit) |
06:11:57 | * | flouer__ joined #nim |
06:11:58 | * | flouer quit (Read error: Connection reset by peer) |
06:16:33 | NimEventer | New thread by Freeways1234: Can't run nim, see https://forum.nim-lang.org/t/10851 |
06:25:55 | * | xet7 joined #nim |
06:27:29 | FromDiscord | <lorangeve_24442> 🥺 |
06:57:14 | * | wheatengineer joined #nim |
07:02:07 | * | rockcavera quit (Remote host closed the connection) |
07:05:20 | * | PMunch joined #nim |
07:05:51 | FromDiscord | <4zv4l> In reply to @lorangeve_24442 "Hello guys, I would": what is the code ? |
07:06:52 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
07:13:04 | FromDiscord | <4zv4l> it works on my side↵did you do like this ? https://media.discordapp.net/attachments/371759389889003532/1192727445611216996/image.png?ex=65aa20fe&is=6597abfe&hm=a477854f2dfd1a9abb35ba228d6b5f5924ed6ea69dc7e67eab9dbecb9df8377a& |
07:16:11 | FromDiscord | <lorangeve_24442> sent a code paste, see https://play.nim-lang.org/#ix=html> |
07:18:25 | FromDiscord | <lorangeve_24442> The compiled command line is like this, the same as the official website https://media.discordapp.net/attachments/371759389889003532/1192728795124355102/image.png?ex=65aa2240&is=6597ad40&hm=44c04d0f68b12c2a077e2003132a2084a52ab0b8a8a00654fe9212fae9b3dae3& |
07:21:19 | FromDiscord | <4zv4l> the website shows this `nim c --debuginfo --linedir:on adder.nim` |
07:22:38 | FromDiscord | <4zv4l> right they also say that `--debugger:native` is the same |
07:22:44 | FromDiscord | <4zv4l> let me try |
07:23:26 | FromDiscord | <4zv4l> In reply to @4zv4l "it works on my": weird since it breaks at line 3 but doesnt readline at line 2 |
07:23:45 | FromDiscord | <4zv4l> I need to `next` |
07:26:31 | FromDiscord | <4zv4l> `2017` so it seems old |
07:28:04 | FromDiscord | <pmunch> In reply to @auxym "I basically rewrote everything": Holy shit, this is great! this has been on my projects list for a while now |
07:28:18 | FromDiscord | <pmunch> Maybe I can finally do my Attiny85 keyboard now |
07:34:26 | FromDiscord | <albassort> the problem with not running DDR3 in 2024 is that maybe it was cheaper to not buy a new DDR4 cpu in 2018, but now its way too expensive to by an extra 8gb |
07:34:36 | FromDiscord | <albassort> (edit) removed "not" |
07:39:21 | FromDiscord | <lorangeve_24442> sent a code paste, see https://play.nim-lang.org/#ix=html> |
07:42:01 | FromDiscord | <demotomohiro> In reply to @lorangeve_24442 "Please allow me to": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#community-how-to-post-nim-code-with-syntax-highlight-on-discordqmark |
07:43:24 | FromDiscord | <4zv4l> In reply to @4zv4l "`2017` so it seems": it seems breakpoint at line 3 doesnt execute line 2 even when reaching the breakpoint↵and when analyzing the string it isnt like on the website so yeah idk xD |
07:43:30 | FromDiscord | <lorangeve_24442> sent a code paste, see https://play.nim-lang.org/#ix=html> |
07:44:50 | FromDiscord | <4zv4l> so yeah↵- need to step↵- string isnt that easy I guess https://media.discordapp.net/attachments/371759389889003532/1192735441678512259/image.png?ex=65aa2871&is=6597b371&hm=d350f2345b954e983767bc1bdec41b72746863e3aae9af7a3a0640f4a8130ce3& |
07:45:37 | FromDiscord | <Elegantbeef> Wonder if the pretty printer works with orc strings |
07:46:09 | FromDiscord | <Elegantbeef> Nim strings changed so that expr is not right |
07:49:46 | * | advesperacit joined #nim |
07:52:03 | FromDiscord | <4zv4l> oh woaw debugging in Zig is surprisingly easier than what I thought it would be xD |
07:52:39 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1192737411021672448/image.png?ex=65aa2a46&is=6597b546&hm=8949689271494a26f20bbd438724bded7c51420f4e8014fbea39684bcfe25acb& |
07:52:39 | FromDiscord | <lorangeve_24442> In reply to @4zv4l "so yeah - need": Debugging in nim is really difficult. In comparison, debugging in c language is more convenient.🥺 https://media.discordapp.net/attachments/371759389889003532/1192737407150338079/image.png?ex=65aa2a45&is=6597b545&hm=60944b90a7cfe3117a3f8f04c0ba7a9a341d68b81e86b43ba8923f33c8e705f4& |
07:53:35 | FromDiscord | <Elegantbeef> I for one rarely use a debugger |
07:56:02 | FromDiscord | <Elegantbeef> But yea Nim's debug information is lacking |
07:56:56 | FromDiscord | <lorangeve_24442> In reply to @Elegantbeef "I for one rarely": Then what other methods can be used to monitor variables? Another method I saw from the official website is to use dump, but I feel that it would be better if there is a debugger. |
07:57:20 | FromDiscord | <4zv4l> debugging is a must really |
07:57:23 | FromDiscord | <Elegantbeef> Also you should use `nim_gdb` afaik |
07:58:04 | FromDiscord | <pmunch> Yeah there is a Python script shipped with Nim which is supposed to make the output better |
07:58:10 | FromDiscord | <pmunch> But it was broken last I tried it |
07:58:45 | FromDiscord | <Elegantbeef> It's lacking a lot of support |
07:58:50 | FromDiscord | <pmunch> I'm currently using Gdb over a JLink to debug an embedded thing though, so it's definitely possible to debug with a debugger in Nim |
07:58:52 | FromDiscord | <Elegantbeef> `set`s do not print nicely, variants do not work, local variables are mangled iirc |
07:59:22 | FromDiscord | <graveflo> learning how to use a debugger is life changing. It's not something that can be swept under the rug |
07:59:36 | FromDiscord | <graveflo> and nims debugging is non-existent |
08:00:20 | FromDiscord | <Elegantbeef> I'll just put a nice echo on that line |
08:00:26 | FromDiscord | <Elegantbeef> I'm a leet developer! |
08:00:34 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:00:34 | FromDiscord | <4zv4l> xD |
08:01:06 | FromDiscord | <Phil> unnecessary charcters, `echo myVar.repr` |
08:01:24 | FromDiscord | <Elegantbeef> Unneeded call `echo myvar` |
08:01:43 | FromDiscord | <Phil> Not if myvar has no `$` which happens occasionally |
08:01:57 | FromDiscord | <Elegantbeef> So conver to string 😄 |
08:02:10 | FromDiscord | <Phil> That'd mean writing more code when I just wanna debug |
08:02:54 | FromDiscord | <Elegantbeef> The compiler does need to generate some nice `debug` procs that you can call with `typeinfo` afaik |
08:02:59 | PMunch | Better GDB support would be pretty nice though |
08:03:04 | FromDiscord | <Elegantbeef> I do not know how it's supposed to work but that's what i'd do 😄 |
08:03:07 | FromDiscord | <4zv4l> @Phil, every time I see your pp I wanna believe it is a penguin with glasses and red nose↵but everytime it isnt |
08:04:27 | FromDiscord | <graveflo> I think that GDB support is a waste of time |
08:04:43 | FromDiscord | <Elegantbeef> I mean any debugger is fine! |
08:04:56 | FromDiscord | <lorangeve_24442> What is afaik? This is the first time I heard about it.🥺 |
08:05:01 | FromDiscord | <graveflo> In reply to @Elegantbeef "I mean any debugger": you just said you don't use them why would you say that? |
08:05:02 | PMunch | graveflo, huh? I thought you liked debuggers? |
08:05:28 | PMunch | lorangeve_24442, afaik = As Far As I Know |
08:05:31 | FromDiscord | <Elegantbeef> > you just said you don't use them why would you say that?↵Reread what I originally said |
08:05:43 | FromDiscord | <Elegantbeef> "rarely use a debuggerr" |
08:05:48 | FromDiscord | <graveflo> Yea but Nim has potential to have a much more robust debugging system then GDB. Plus GDB is kinda shit. Plus it only would only work for certain back ends |
08:05:49 | FromDiscord | <Elegantbeef> Not "do not use debuggers" |
08:07:26 | FromDiscord | <Phil> In reply to @lorangeve_24442 "What is afaik? This": afaik = as far as I know↵Also afaict = as far as I can tell |
08:07:44 | FromDiscord | <graveflo> Nim doesn't need a debugger that is yet another cancer lump growing off of GDB. It just needs a way to inspect the value changes and call graphs |
08:08:59 | FromDiscord | <graveflo> if the debugger is implemented correctly, it should be much easier to make a system that enables GDB debugging anyway. GDB as the target is a bad idea. We can do better then that |
08:11:52 | FromDiscord | <Elegantbeef> Yea any sound debugging needs the compiler to emit information that can be accessed |
08:13:13 | FromDiscord | <Elegantbeef> Well mostly cause Nim has a lot of abstractions |
08:13:20 | FromDiscord | <Elegantbeef> Looks at `seq[T]` |
08:13:29 | FromDiscord | <Elegantbeef> `set[T]`\ |
08:15:28 | PMunch | graveflo, well GDB is already integrated in a lot of places. The amount of work to make Nim work in GDB is probably orders of magnitude less than building a debugger from scratch |
08:17:19 | FromDiscord | <lorangeve_24442> In reply to @isofruit "afaik = as far": It's syntax that I don't understand🥲 . |
08:17:31 | FromDiscord | <graveflo> maybe, but it would be worth the extra effort to make a debugging system that is robust enough to stand on it's own. It doesn't have to have a client interface, that can be left up to specific needs. Basically, I think the debugging system should be something that is meant to be built upon. If you can GDB you make a Nim debugger -> GDB translator |
08:18:03 | FromDiscord | <lorangeve_24442> What you mean is that there is no such thing yet, right?🥲 |
08:19:22 | FromDiscord | <Phil> There's a way to make GDB work with VsCode, but I couldn't tell you it, I don't use it myself.↵@.kanaxa had a setup working though |
08:21:48 | FromDiscord | <lorangeve_24442> 如果你说的是这个的话 https://media.discordapp.net/attachments/371759389889003532/1192744745080987728/image.png?ex=65aa311b&is=6597bc1b&hm=afe9e760259c2b865409779b2fc04274e877c724f0ffb71a5602cc5c8e2334a1& |
08:22:01 | FromDiscord | <lorangeve_24442> (edit) "如果你说的是这个的话" => "If that's what you're talking about" |
08:23:20 | FromDiscord | <lorangeve_24442> It's not much better than nothing, and I don't know why this can be used normally. This uses the gdb that comes with nim, and the version is lower. |
08:24:03 | FromDiscord | <Elegantbeef> is `nim_gdb` in your path? |
08:24:03 | FromDiscord | <Phil> Kanaxa would need to answer you this as I couldn't tell you, I just know that he made something debugger related work |
08:24:33 | FromDiscord | <Phil> Is this another place where no-omit-stack thingy flags would help? |
08:24:54 | FromDiscord | <Phil> I mean they help with the traces for asan |
08:25:00 | FromDiscord | <drunkenalcoholic> Hi, just wanting to know if anyone can help me out as new nim user, I am basically trying nim to retrieve online Json data, while this part is no problems, I seem to have issues(no compiler errors) when using parseJson to my created objects, its just no happening, and im not sure if its me not interpreating the json string to objects correctly or the parseJson function. anyone willing to take a look and maybe give me some clues |
08:25:04 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/vscode-nim#setting-up generally worked imo |
08:25:22 | FromDiscord | <lorangeve_24442> In reply to @Elegantbeef "is `nim_gdb` in your": I added an environment variable https://media.discordapp.net/attachments/371759389889003532/1192745640111902720/image.png?ex=65aa31f0&is=6597bcf0&hm=f5694a3b943ebd19507231af85fc76b810ecb9854c06277c3d09ab311c9f1068& |
08:25:33 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:25:49 | FromDiscord | <Phil> If that even does anything on windows |
08:25:49 | FromDiscord | <Elegantbeef> not `gdb` `nim_gdb` it's a python script used for pretty printing |
08:26:35 | FromDiscord | <Phil> In reply to @drunkenalcoholic "Hi, just wanting to": You can respond to what I wrote you in #appdev here then we can have it all in one place and others might chime in 😄 |
08:26:36 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/tools/debug/nim-gdb.py this should be somewhere |
08:26:38 | FromDiscord | <drunkenalcoholic> https://media.discordapp.net/attachments/371759389889003532/1192745961982808074/image.png?ex=65aa323d&is=6597bd3d&hm=22db625588827758c4ce6b94a23c217d2da10e479a46a7d706695e4051fba698& |
08:27:00 | FromDiscord | <Elegantbeef> First look at this kitty user! |
08:27:06 | FromDiscord | <Elegantbeef> Secondly what's the error? |
08:27:28 | FromDiscord | <drunkenalcoholic> no errors just throwing the exception and no parsed data |
08:27:33 | FromDiscord | <Elegantbeef> That's an error |
08:27:42 | FromDiscord | <drunkenalcoholic> no errors in compiling |
08:27:43 | PMunch | Kitty user? |
08:27:50 | FromDiscord | <Elegantbeef> Kitty terminal |
08:27:51 | FromDiscord | <Phil> In reply to @drunkenalcoholic "": While nice, copy pasting into a codeblock is nicer for copy pasting into a playground.↵You can spawn a background with 3 backticks↵\`\`\`nim↵\`\`\` |
08:27:58 | FromDiscord | <Phil> (edit) "background" => "codeblock" |
08:28:17 | FromDiscord | <Phil> (edit) "In reply to @drunkenalcoholic "": While nice, copy pasting into a codeblock is nicer for ... copyand" added "us since it allows us easy" | "into a playground.↵You" => "and playing around with the code↵You" |
08:29:09 | PMunch | How did you spot that they use Kitty? (I also use it by the way) |
08:29:25 | FromDiscord | <lorangeve_24442> In reply to @Elegantbeef "not `gdb` `nim_gdb` it's": This version of my gdb should not support python |
08:29:36 | FromDiscord | <Elegantbeef> The window decorator icon |
08:30:00 | PMunch | Oh yeah! Well spotted! :P |
08:30:02 | FromDiscord | <Elegantbeef> Well if your gdb does not support pretty printers uhhh.... |
08:30:03 | FromDiscord | <drunkenalcoholic> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:30:18 | FromDiscord | <that_dude.> Just double checking, any compiler crash is a bug report right? |
08:30:25 | FromDiscord | <Elegantbeef> Yes |
08:30:28 | FromDiscord | <that_dude.> Thanks |
08:30:45 | PMunch | @drunkenalcoholic, might want to remove those ID/KEY data? |
08:30:55 | FromDiscord | <drunkenalcoholic> yeah i just seen that |
08:30:58 | FromDiscord | <drunkenalcoholic> opps |
08:31:48 | FromDiscord | <drunkenalcoholic> (edit) |
08:32:27 | FromDiscord | <lorangeve_24442> In reply to @Elegantbeef "Well if your gdb": It is really difficult to find a convenient and quick way to view variables. In comparison, dump may be faster.😂 |
08:33:18 | FromDiscord | <Elegantbeef> `echo` is really quick which is why people usue it |
08:34:00 | PMunch | Maybe you could use `call` in Gdb to call a Nim defined pretty printer? |
08:34:07 | PMunch | The name might be mangled though.. |
08:34:44 | FromDiscord | <Elegantbeef> If the `$` exists you can do just that |
08:34:48 | FromDiscord | <Elegantbeef> and you have the type name |
08:35:05 | FromDiscord | <Elegantbeef> The issue is you need the typename and the proc not to be removed |
08:35:51 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:36:04 | FromDiscord | <Phil> Or rather first your problem, then the advice |
08:36:24 | FromDiscord | <Elegantbeef> Something like emitting an extern `debug_type_name` procedure for all types would be beneficial but it'd also require knowing all types of all stack/heap data you want to use it on |
08:36:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:37:11 | FromDiscord | <drunkenalcoholic> display e.msg instead? |
08:37:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:37:44 | FromDiscord | <lorangeve_24442> In reply to @PMunch "Maybe you could use": Very good idea, I'll try it:nimpride: |
08:37:58 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:38:11 | FromDiscord | <drunkenalcoholic> nice I will do that, hopefully that will give some indication od the actual error |
08:38:22 | FromDiscord | <drunkenalcoholic> I did do -d:SSL on compile time |
08:38:27 | FromDiscord | <Phil> Ahhh check |
08:38:32 | FromDiscord | <Phil> That's where I was going next linking to https://nim-lang.org/docs/httpclient.html#sslslashtls-support |
08:39:17 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:39:19 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/tools/debug/nim-gdb.py#L150-L185 atleast is how nim-gdb.py can call those `$` procs |
08:40:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:40:39 | FromDiscord | <drunkenalcoholic> yes I had an valid API key |
08:40:59 | FromDiscord | <Phil> Ah check, in that case you'll need to copy paste your own error here because without one I'm stuck at this point 😄 |
08:41:08 | FromDiscord | <Phil> You honestly can just delete the try-catch for now and run your code without |
08:41:15 | FromDiscord | <drunkenalcoholic> I suspected the the Json string might not have matched my object types |
08:41:18 | FromDiscord | <Phil> The error message printed to the console will be far nicer looking |
08:41:24 | FromDiscord | <drunkenalcoholic> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:41:49 | FromDiscord | <drunkenalcoholic> testing it now |
08:41:56 | FromDiscord | <lorangeve_24442> sent a long message, see <!doctype html> |
08:44:38 | FromDiscord | <drunkenalcoholic> yeap reult.time.time not found |
08:44:52 | * | xet7 quit (Remote host closed the connection) |
08:45:26 | FromDiscord | <xrfez> this formatting looks wrong to me? nph didnt like it, but nim seems to compile it?↵https://github.com/elcritch/figuro/blob/bb7fa06f50184dc720aed3dcc1f473cc71a5a0b5/figuro/renderer/opengl/fontutils.nim#L76C11-L80 |
08:45:29 | FromDiscord | <Phil> In reply to @drunkenalcoholic "yeap reult.time.time not found": ahhhhahahahahahahaha, JSON format error my friend xD |
08:45:39 | FromDiscord | <Phil> I know those way too welll |
08:46:08 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:46:23 | FromDiscord | <drunkenalcoholic> Thanks Phil, I originally suspected as much, but I can't see it fromt he Json string as it looks correct {"status":"success","result":[{"time":{"time":"2024-01-05T06:41:16.461393Z","secondsAgo":49},"temperature":28.2,"humidity":62.9,"feelsLike":30.1,"rssi":-73}]} |
08:46:38 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:46:47 | FromDiscord | <Phil> Or rather a seq |
08:47:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:48:12 | FromDiscord | <lorangeve_24442> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/blob/devel/tools/de": I can't find gdb lib 🥲 https://media.discordapp.net/attachments/371759389889003532/1192751393493241866/image.png?ex=65aa374c&is=6597c24c&hm=7967a8ab77c45a86e8c772818050c87f02599f4a0b3ae6757642e801ce768e3c& |
08:48:38 | FromDiscord | <Phil> Damn, been a while but JSON having a list somewhere you don't expect or an object with 1 field where you expected a value directly is one of those things that just catches you off guard every time |
08:49:18 | FromDiscord | <drunkenalcoholic> Phil, Bammmm that worked a treat |
08:49:53 | FromDiscord | <4zv4l> In reply to @drunkenalcoholic "": maybe an ignorant question but since you `await` every future, why need async in this case ? |
08:50:04 | FromDiscord | <drunkenalcoholic> @Phil many thanks its greatly appreciated, and I learned something(a few things) |
08:50:59 | FromDiscord | <Phil> In reply to @drunkenalcoholic "<@180601887916163073> many thanks": Happy to help 😄↵Just to make sure, you're aware of what a seq is? |
08:51:09 | FromDiscord | <Phil> Since that may otherwise stump you in the future |
08:51:27 | FromDiscord | <Phil> (Also you can make your example a lot easier by ditching async here) |
08:52:15 | FromDiscord | <drunkenalcoholic> im thinking seq[] is an array? |
08:53:13 | FromDiscord | <Phil> Async is very useful once you want to run multiple HTTP requests in parallel (Careful! There's a known trap there https://stackoverflow.com/questions/75127488/cannot-await-combined-future-of-multiple-async-requests-proc-hangs-when-doing-s) or if you want to do some heavy computation while the HTTP request is waiting, but for a single HTTP request that you just do stuff before you can just do sync. Makes it easier to debug as well. |
08:53:43 | FromDiscord | <drunkenalcoholic> Thanks for that info Phil |
08:53:46 | FromDiscord | <Phil> In reply to @drunkenalcoholic "im thinking seq[] ": Only kind of.↵Arrays are fixed-size.↵Sequences are not.↵They are more akin to Java's "ArrayList" or the like |
08:53:56 | FromDiscord | <drunkenalcoholic> Dynamic array |
08:54:04 | FromDiscord | <Phil> Yeah, that one I'll agree to |
08:54:17 | FromDiscord | <Phil> It's a distinction because nim has arrays |
08:54:54 | FromDiscord | <Phil> Which are used in e.g. more high performance scenarios or where you actually want a fixed-size list |
08:57:09 | FromDiscord | <drunkenalcoholic> I haven't gotten into all the different nim types and operators, but I will definitely keep playing around and learning nim, so far I am finding it more flexible than Delphi/Pascal |
08:57:27 | FromDiscord | <Phil> If nim is one thing, flexible is among them |
08:57:57 | FromDiscord | <drunkenalcoholic> as silly as it sounds but, "let" was a game changer for me, |
08:58:23 | FromDiscord | <Phil> Fully agree. The distinction between mutable and immutable, once you get into it, makes such a difference |
09:06:09 | FromDiscord | <gyatsoyt> how do i calculate bit_length of an integer in nim...↵python has `int.bit_length()` for it |
09:08:27 | FromDiscord | <Phil> Yeah I got no clue on that one↵Anything in here might possibly help: https://nim-lang.org/docs/bitops.html |
09:14:21 | FromDiscord | <Phil> Otherwise, this could be a very decent forum question |
09:18:53 | FromDiscord | <gyatsoyt> In reply to @isofruit "Otherwise, this could be": i guess i should go to the forum and submit this |
09:19:03 | FromDiscord | <graveflo> `sizeof` |
09:21:52 | FromDiscord | <graveflo> In reply to @gyatsoyt "i guess i should": and for the "minimum number of bits" thing I think you can do `ceil(log2(n))` |
09:22:40 | FromDiscord | <graveflo> (edit) "`ceil(log2(n))`" => "`ceil(log2(n)) + 1`" |
09:23:26 | FromDiscord | <graveflo> ah wait no you round it down bc of the +1 LOL |
09:23:40 | FromDiscord | <graveflo> (edit) "`ceil(log2(n))" => "`floor(log2(n))" |
09:25:22 | FromDiscord | <graveflo> or you can shift right until the value == 0 |
09:27:03 | FromDiscord | <albassort> @Phil hows the memory, are you winning son |
09:27:24 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:27:38 | FromDiscord | <Phil> In reply to @albassort "<@180601887916163073> hows the memory,": I am, by brutalizing threadvars set by nim std libs |
09:28:13 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:28:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:28:38 | FromDiscord | <Phil> I assume a proc that returns e.g. `1` for the number `1`, `2`for the number 2 and 3 etc. |
09:28:40 | FromDiscord | <albassort> like in nim it might be sizeof(x)7 |
09:28:42 | FromDiscord | <albassort> (edit) "sizeof(x)7" => "sizeof(x)8" |
09:28:55 | FromDiscord | <albassort> that would be the bit size of a given object's type |
09:28:57 | FromDiscord | <Phil> (edit) "number `1`, `2`for" => "numbers `0, 1`, `2` for" | "number 2" => "numbers `2`" | "3" => "`3`" |
09:29:09 | FromDiscord | <gyatsoyt> In reply to @albassort "what exactly is bit_length": calculates the length of bits of an integer |
09:29:40 | FromDiscord | <Phil> In reply to @gyatsoyt "calculates the length of": I mean just for reference, every integer takes up 64 bits (32 bits on some systems) |
09:29:40 | FromDiscord | <albassort> yeah sizeof(x)8 covers all primitive int types but this seems like a bad idea |
09:29:42 | FromDiscord | <gyatsoyt> like The bit length of 12345 is 16 |
09:29:57 | FromDiscord | <albassort> thats the minimum bit length |
09:30:08 | FromDiscord | <albassort> not its actual size |
09:30:35 | FromDiscord | <albassort> its alloced to bit an int8, int16, int32, int64, etc |
09:30:39 | FromDiscord | <albassort> all different types in nim |
09:30:45 | FromDiscord | <albassort> (edit) "bit" => "be" |
09:31:00 | FromDiscord | <albassort> (edit) "int32, int64, etc" => "int32 or int64" |
09:31:11 | FromDiscord | <albassort> (edit) "its alloced to be an int8, int16, int32 or int64 ... " added "(int128? i forget if thats real)" |
09:31:33 | FromDiscord | <albassort> https://nim-lang.org/1.6.12/compiler/int128.html ITS REAL |
09:31:55 | FromDiscord | <Phil> "You thought there were big ints" |
09:32:04 | FromDiscord | <Phil> "Now there are really big ints" |
09:32:26 | FromDiscord | <Phil> And yep, that is available |
09:33:08 | FromDiscord | <albassort> i like how its just uint32's bitand'd together |
09:33:15 | FromDiscord | <albassort> (edit) "uint32's" => "4 uint32'd" |
09:33:31 | FromDiscord | <albassort> int128 is just smaller ints in a trench coat |
09:34:16 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:34:17 | FromDiscord | <Elegantbeef> All ints are just contiguous `int1`s |
09:34:27 | FromDiscord | <albassort> In reply to @Elegantbeef "All ints are just": not in an array tho |
09:34:32 | FromDiscord | <nnsee> how the fuck do you fit an int128 into a register |
09:34:39 | FromDiscord | <gyatsoyt> The bit_length() function in Python returns the number of bits required to represent an integer in binary, excluding the sign and leading zeros. For example, the bit_length of the integer 10 is 4, because 10 in binary is 1010, which requires 4 bits to represent.↵↵according to google^^^ |
09:34:41 | FromDiscord | <albassort> by making it 4 uint32s |
09:34:59 | FromDiscord | <nnsee> i can't fit 4 uint32s into any of my registers |
09:35:00 | FromDiscord | <Elegantbeef> Using simd 😛↵(@nnsee) |
09:35:03 | FromDiscord | <nnsee> touche |
09:35:10 | FromDiscord | <Elegantbeef> If you have simd you can certainly! |
09:35:17 | FromDiscord | <albassort> idk what simd is |
09:35:19 | FromDiscord | <albassort> must google |
09:35:40 | FromDiscord | <albassort> https://tenor.com/view/ratatouille-ratatouille-chef-ratatouille-reading-shocked-gif-23517636 |
09:35:46 | FromDiscord | <albassort> In reply to @albassort "https://tenor.com/view/ratatouille-ratatouille-chef": me rn |
09:36:10 | FromDiscord | <gyatsoyt> In reply to @albassort "anyway idk what you're": well i am trying to translate some old python code into nim to boost its performance |
09:36:27 | FromDiscord | <Phil> In reply to @albassort "int128 is just smaller": Beautiful metaphor |
09:36:59 | FromDiscord | <Elegantbeef> isn't msb just `log2(num)`? |
09:37:37 | FromDiscord | <albassort> In reply to @gyatsoyt "The bit_length() function in": there is nothing like that in nim because are static but the minimum number of bits required would be equal to log2(num) |
09:38:06 | FromDiscord | <Elegantbeef> Well if they want variable size integers there are packages |
09:38:12 | FromDiscord | <albassort> (edit) "log2(num)" => "log2(num), then you rize it up" |
09:38:26 | FromDiscord | <albassort> (edit) "rize" => "round" | "up" => "to the nearest 2 power of 2 upward" |
09:38:35 | FromDiscord | <Elegantbeef> https://github.com/status-im/nim-stint https://github.com/nim-lang/bigints |
09:38:37 | FromDiscord | <albassort> (edit) removed "2" |
09:39:09 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
09:40:36 | FromDiscord | <Elegantbeef> Shouldn't that be `if x in 0..1: return 1`? 😄 |
09:41:19 | FromDiscord | <graveflo> actually it should prob be a conversion to uint and then a `<` |
09:42:18 | FromDiscord | <Elegantbeef> I can count on 2^65 hands how many times I wanted large ints |
09:42:40 | * | azimut joined #nim |
09:42:59 | FromDiscord | <albassort> but can you do it in japanese |
09:43:11 | FromDiscord | <Elegantbeef> I can hardly do it in english |
09:52:22 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
10:00:54 | FromDiscord | <Elegantbeef> Hey that's `0..1` |
10:01:06 | FromDiscord | <graveflo> prove it |
10:01:23 | FromDiscord | <Elegantbeef> Negatives do not exist |
10:01:41 | FromDiscord | <graveflo> are you this happy all the time? |
10:01:53 | FromDiscord | <Elegantbeef> Indeed |
10:24:54 | FromDiscord | <lukol.> Hi, i have maybe stupid question, but is there any simple way except dll injecting how to work with subversion repository? Google did not offer any NIM integration for loading data from SVN repo. Any hint where should i look or what library to use? |
10:26:03 | FromDiscord | <albassort> In reply to @lukol. "Hi, i have maybe": If its written in C, you can load the DLL and use {importc} |
10:26:24 | FromDiscord | <albassort> otherwise cpp you can do cpp integration but its more annoyin g |
10:26:25 | FromDiscord | <albassort> (edit) "annoyin g" => "annoying" |
10:27:37 | FromDiscord | <lukol.> but dll load on linux would be little problematic 🤷♂️ thats why i want to avoid any dll load |
10:28:01 | FromDiscord | <graveflo> you can still use `importc` and the subversion C API |
10:29:33 | FromDiscord | <albassort> In reply to @lukol. "but dll load on": its not native, you have no other option |
10:29:58 | FromDiscord | <albassort> its not that bad, you'll be fine, its only a ticking time bomb and installation headaches for arch users |
10:30:27 | FromDiscord | <Phil> Why would you bully me like that? |
10:30:50 | FromDiscord | <albassort> also idk what you mean by "dll" and "linux" here, do you mean you're using Windows .dll files on linux? |
10:30:53 | FromDiscord | <Elegantbeef> Like svn is going to change suddenly |
10:30:56 | FromDiscord | <albassort> if so then you may need wine |
10:31:05 | FromDiscord | <Elegantbeef> They likely think that there are only `dll`s and linux does not have any |
10:31:29 | FromDiscord | <albassort> ah, oops all static binaries |
10:31:45 | FromDiscord | <albassort> mom can we have dlls?↵we have dlls at home:↵.so |
10:31:48 | FromDiscord | <Phil> TBF I am on Linux and even I don't recall the file-ending of DLLs on linux |
10:31:58 | FromDiscord | <albassort> .so? |
10:32:03 | FromDiscord | <Elegantbeef> So what? |
10:32:07 | FromDiscord | <graveflo> so dont use dlls |
10:32:08 | FromDiscord | <albassort> >:( |
10:32:16 | FromDiscord | <Phil> 3 people making the same joke |
10:32:18 | FromDiscord | <Phil> 😛 |
10:32:21 | FromDiscord | <Elegantbeef> Phil just `nim c --app:lib myprog.nim` |
10:32:31 | FromDiscord | <Elegantbeef> Comedy happens in 3s |
10:32:46 | FromDiscord | <Elegantbeef> The third world war is going to be hilarious |
10:32:47 | FromDiscord | <graveflo> anyway maybe it would be more helpful to let them know how to import either a dll or a so depending on the os |
10:32:55 | FromDiscord | <graveflo> oh already did it I see |
10:32:57 | FromDiscord | <lukol.> dll is windows ending. on linux it would be probably .so but injecting to library isnt so easy on linux |
10:33:27 | FromDiscord | <graveflo> are you drying to do dynamic module injection? |
10:33:36 | FromDiscord | <graveflo> or are you just calling dynamic linking injection? |
10:33:47 | FromDiscord | <albassort> do you dynamic injection to an actively running process |
10:33:54 | FromDiscord | <albassort> 🤨 |
10:34:03 | FromDiscord | <albassort> what you up to there buddy |
10:34:05 | FromDiscord | <graveflo> sussy |
10:34:16 | FromDiscord | <albassort> better be a memory profiler 😠 |
10:34:18 | FromDiscord | <graveflo> they're writing a debugger surely |
10:34:27 | FromDiscord | <albassort> surely\ |
10:34:29 | FromDiscord | <albassort> (edit) "surely\" => "surely" |
10:34:38 | FromDiscord | <Elegantbeef> totally not malware that concerns itself with svn repos |
10:35:03 | FromDiscord | <albassort> (edit) "do you ... dynamic" added " mean" |
10:35:08 | FromDiscord | <graveflo> that sounds a lot worse then what I was thinking |
10:35:12 | FromDiscord | <lukol.> at first i dont even know if there is any dynamic module for SVN. it is from apache then it might be. but i was hoping that somebody already did something like that to see at least some POC |
10:35:43 | FromDiscord | <graveflo> I didn't see any wrapping for svn api when I searched |
10:36:08 | FromDiscord | <albassort> i remember looking this up, theres a way to do it but i forgor |
10:36:36 | FromDiscord | <albassort> strace will show you when the program access a dynamicly linked binary |
10:36:40 | FromDiscord | <lukol.> i didnt see as well. i hoped that i just googled wrong |
10:36:54 | FromDiscord | <albassort> (edit) "access" => "accesses" |
10:37:05 | FromDiscord | <Elegantbeef> Well debian has libsvn so they do exist |
10:37:37 | FromDiscord | <Elegantbeef> Throw futhark at the headers |
10:38:24 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=html> |
10:38:40 | FromDiscord | <albassort> (edit) "code paste," => "long message," | "https://play.nim-lang.org/#ix=html>" => "<!doctype html> <html lang=en> <head> <meta charset=utf-8> <title> </title> </head> <style> body { font-family: monospace; margin: 2em; } </style> <body> <p>ix.io is taking a break 🍻</p> <img src="/underconstruction.gif" width="200px"> </body> </html>" |
10:38:41 | FromDiscord | <Elegantbeef> > 0xDEADBEEF↵Wait no |
10:39:03 | FromDiscord | <graveflo> has a nice ring to it |
10:39:05 | FromDiscord | <albassort> so you need to talk to the kernel and tell it to use your .so file |
10:39:27 | FromDiscord | <albassort> this? i forget |
10:39:29 | FromDiscord | <albassort> (edit) "this? i forget ... " added "how to do" |
10:39:36 | FromDiscord | <albassort> im sure its easy |
10:39:42 | FromDiscord | <albassort> :) |
10:40:07 | FromDiscord | <albassort> I know windows has a whole api for it and its really good and totally hasn't caused billions of dollars in damages from keyloggers |
10:40:26 | FromDiscord | <lukol.> In reply to @albassort "im sure its easy": if you are root then maybe yes but as user with limited rights it won't be so easy |
10:40:41 | FromDiscord | <albassort> i will no longer if you my assistance |
10:43:40 | FromDiscord | <albassort> @beef whats your thoughts on this |
10:43:49 | FromDiscord | <albassort> this is pretty sus |
10:48:56 | FromDiscord | <Elegantbeef> Use a library if you want to use svn from Nim |
10:48:57 | FromDiscord | <Elegantbeef> Otherwise what the hell |
10:55:45 | FromDiscord | <fowl.mouth> On windows we use that injection method to fix old games keep them running on windows 10+, maybe its not entirely legitimate because it’s some other companies exe that we fiddle with but they’ve been out of business for over 10 years so. Is that considered bad? |
10:58:25 | FromDiscord | <albassort> there is no... reason to fuck with svn |
10:58:28 | FromDiscord | <albassort> it has an api |
10:58:56 | FromDiscord | <albassort> and if you're trying to work around not having root then its like 99.9% chance its malware |
10:59:49 | FromDiscord | <graveflo> what are you talking about messing around with the kernels load library function? It sounds like you are talking about installing a hook? I don't get what this is even about at this point. Are they trying to load a "customized" dynamic library into a remote process to mess with it? |
11:00:26 | FromDiscord | <albassort> they wanna do dynamic loading injection, a MTM attack |
11:00:36 | FromDiscord | <graveflo> right okay LOL |
11:00:47 | FromDiscord | <albassort> which happens all the time and has legitimate uses |
11:00:56 | FromDiscord | <albassort> not seemingly here though |
11:01:13 | FromDiscord | <graveflo> yea I get that but it's not how I would have interpreted the initial inquiries |
11:02:58 | FromDiscord | <albassort> light for example, theres this spelunky thing you can use to inject LUA into the C++ engine |
11:03:06 | FromDiscord | <albassort> it uses window's APIV \ |
11:03:08 | FromDiscord | <albassort> (edit) "APIV \" => "API" |
11:03:21 | FromDiscord | <albassort> or DFHACK for dwarf fortress is also runtime dll injection iirc |
11:03:38 | FromDiscord | <albassort> (edit) "light" => "like" |
11:03:38 | FromDiscord | <graveflo> I mean I get that you are talking about making a dynamic library that has the same module info as another one and having the remote process load that one instead to hook functions |
11:04:20 | FromDiscord | <graveflo> I just don't understand how you figured that they were talking about that from what they said. Doesn't matter anyway |
11:16:16 | * | TheLink7 joined #nim |
11:17:48 | * | TheLink quit (Ping timeout: 256 seconds) |
11:17:48 | * | TheLink7 is now known as TheLink |
11:19:55 | FromDiscord | <lukol.> I am afraid, that there is some misunderstanding. I have some subversion repository. I need to read data from it. Then process them.↵I was considering Nim, because it should be possible for both Windows and Linux. It will be used also on AWS where all our apps are having their own user/group with limited permissions. Root is only devops and they definitely won't allow to run anything under highest priviledge.↵so no malware or MTM or an |
11:57:31 | PMunch | So why are you talking about DLL/so injection? Sounds like you just need libsvn.. |
12:05:30 | FromDiscord | <Phil> Can you actually have memory leaks under sth like refc? |
12:05:43 | PMunch | Sure, `alloc(100)` |
12:05:45 | FromDiscord | <Phil> Like the entire thread-var saga, does that also apply to refc? |
12:05:50 | PMunch | Boom, memory leak |
12:06:33 | FromDiscord | <Phil> No I mean more stuff like what I was fighting the last 2-3 days:↵thread-variables of ref-types that don't get cleaned up upon the thread ending and joining with the main-thread. |
12:06:54 | FromDiscord | <Phil> Would refc take care of those automatically? |
12:07:59 | PMunch | Huh, didn't even know that was a thing |
12:08:24 | FromDiscord | <Phil> I have come to know that problem rather intimately |
12:08:32 | PMunch | Try boehm |
12:09:06 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:09:36 | FromDiscord | <Phil> In reply to @PMunch "Try boehm": I support arc orc and ideally also refc, never used boehm.↵The question was more whether I should even mention refc etc. in my FAQ about memory leaks with my lib |
12:09:51 | FromDiscord | <Phil> because if refc takes care of threadvars like this then I don't need to mention it |
12:12:41 | * | rockcavera joined #nim |
12:13:19 | PMunch | Judging by how refc does with threads in general I'd assume not |
12:13:27 | PMunch | But who knows |
12:14:21 | FromDiscord | <leorize> just link the nim issue to your faq |
12:14:30 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
12:15:05 | FromDiscord | <Phil> Already doing that |
12:15:14 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:16:07 | * | pbsds joined #nim |
12:16:35 | FromDiscord | <leorize> have you tried to integrate your message queue with asyncdispatch? |
12:17:25 | FromDiscord | <Phil> I don't think I understand |
12:17:41 | FromDiscord | <Phil> Like send async events to another thread to work on them? |
12:18:18 | FromDiscord | <leorize> no, like having the queue signals asyncdispatch so you don't have to do your odd time slicing |
12:18:40 | FromDiscord | <fosster> hi guys! I wanted to ask, do you know any good and easy-to-use audio synthesis library in nim? |
12:19:25 | FromDiscord | <fosster> just some higher level library were one can easily generate synth sounds and manipulate them |
12:19:56 | FromDiscord | <Phil> ... time slicing?↵You mean me nilling the thread-variables? |
12:20:08 | FromDiscord | <Phil> timezone |
12:20:11 | FromDiscord | <Phil> (edit) "timezone ... " added "thread-variables" |
12:21:30 | FromDiscord | <Phil> In reply to @fosster "hi guys! I wanted": I'm not familiar with the domain.↵You could try searching through the package repositories either on nimble.directory or via your cli (`nimble search sound` for example). |
12:21:48 | FromDiscord | <Phil> (edit) "domain.↵You" => "problem domain of sound stuff.↵You" |
12:23:16 | FromDiscord | <leorize> basically removing the `sleep` in your runServerProc↵(@Phil) |
12:23:46 | FromDiscord | <Phil> Ohhhh like putting every message on the async loop |
12:23:51 | FromDiscord | <Phil> I have not |
12:24:27 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
12:25:20 | FromDiscord | <leorize> pointing to `reset` is probably better |
12:27:40 | FromDiscord | <Phil> ...not just probably, deinit is not findable in the general docs so... yeah |
12:27:54 | FromDiscord | <leorize> reset works on everything, except those without destructors like `File` ofc |
12:28:18 | FromDiscord | <leorize> oh... socket aren't auto closables either |
12:28:52 | FromDiscord | <Phil> I mean, if they have a destructor you can just call that directly |
12:29:04 | FromDiscord | <Phil> Or do you mean `reset` over suggesting to call the destructor? |
12:29:09 | FromDiscord | <leorize> yep |
12:29:36 | FromDiscord | <leorize> it works on refs as well |
12:33:05 | FromDiscord | <Phil> Where are the docs for the all pragma? |
12:36:18 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#pragmas |
12:37:48 | FromDiscord | <Phil> That doesn't even mention the all pragma though |
12:37:52 | FromDiscord | <Phil> I did go through that list first |
12:50:02 | FromDiscord | <demotomohiro> Then, open manual page and search "{." |
12:51:28 | FromDiscord | <fosster> hm thanks anyway↵(@Phil) |
12:54:14 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
12:54:25 | FromDiscord | <Phil> (edit) |
12:55:49 | * | dtomato quit (Ping timeout: 255 seconds) |
12:55:51 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "It's not mentioned in": It's probably a magic pragma |
12:55:52 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
12:56:24 | FromDiscord | <Phil> No clue where I'd find those |
12:56:34 | FromDiscord | <Phil> (Directed at Robyn) |
12:57:25 | FromDiscord | <Robyn [She/Her]> No idea either, sorry :P |
13:05:15 | FromDiscord | <mratsim> In reply to @isofruit "I support arc orc": refc is imco,patible weith threads |
13:05:49 | FromDiscord | <Phil> I can understand everything except for "weith" |
13:07:01 | FromDiscord | <nnsee> refc is incompatible with threads |
13:08:01 | FromDiscord | <Phil> Ohhhhh |
13:08:03 | FromDiscord | <Phil> Wait it si? |
13:08:06 | FromDiscord | <Phil> (edit) "si?" => "is?" |
13:08:20 | FromDiscord | <Phil> Did we just not do multithreading before arc/orc? |
13:21:18 | FromDiscord | <nnsee> lol we did |
13:21:22 | FromDiscord | <4zv4l> easy way to convert `array[char]` to `array[uint8]` ? |
13:21:51 | FromDiscord | <4zv4l> why isnt `char` and `uint8` the same anyway ? |
13:22:07 | FromDiscord | <nnsee> but iirc you couldn't have things like shared memory etc with refc |
13:22:17 | FromDiscord | <nnsee> In reply to @4zv4l "easy way to convert": `cast` |
13:22:36 | FromDiscord | <odexine> In reply to @4zv4l "why isnt `char` and": it... kinda is? |
13:22:41 | FromDiscord | <4zv4l> it is |
13:22:44 | FromDiscord | <4zv4l> but not for Nim lol |
13:22:52 | FromDiscord | <odexine> it isnt for c either IIRC |
13:22:53 | FromDiscord | <nnsee> In reply to @4zv4l "why isnt `char` and": same implementation, different interface |
13:23:05 | FromDiscord | <nnsee> and char isn't always explicitly 8 bits wide |
13:23:33 | FromDiscord | <odexine> its only "at least" 8 bits |
13:23:41 | FromDiscord | <odexine> well, for c |
13:23:46 | FromDiscord | <odexine> for nim i think its defined to be 8 bits |
13:24:11 | FromDiscord | <odexine> but anyway they represent different "kinds of data" |
13:24:13 | FromDiscord | <Phil> In reply to @nnsee "lol we did": But then refc isn't incompatible with multithreading generally, just with threading/channels which lead to shared memory, no? |
13:24:17 | FromDiscord | <4zv4l> In reply to @nnsee "`cast`": can you show me an example ?↵I try to cast an `openArray` but it says it cannot, if I cast to `array` do I need to give the size as well ? |
13:24:26 | FromDiscord | <odexine> In reply to @4zv4l "can you show me": yes you do need the size as well |
13:24:35 | FromDiscord | <4zv4l> thats so annoying |
13:25:07 | FromDiscord | <nnsee> well platforms that don't have 8-bit chars are esoteric and it's a reasonable assumption that it's 8 bits, but it technically isn't "guaranteed" and in case nim code is changed in the future to accommodate such platforms, old code doesn't break |
13:25:51 | FromDiscord | <nnsee> how are you defining your uint8 array? |
13:25:53 | FromDiscord | <odexine> iirc it is guaranteed by specification tho |
13:26:08 | FromDiscord | <nnsee> maybe you can get away with using seq |
13:26:34 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:27:32 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:27:38 | FromDiscord | <odexine> cursed |
13:27:52 | FromDiscord | <odexine> whats wrong about the digest |
13:27:53 | FromDiscord | <nnsee> any reason you're not just reading into a string? that's a seq |
13:28:06 | FromDiscord | <odexine> probably for allocation reasons |
13:28:16 | FromDiscord | <odexine> though i dont really understand the reasoning |
13:28:18 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1192821880424501398/image.png?ex=65aa78f1&is=659803f1&hm=43469bffdcb6f0bf4df3efdabe38c52e3b2d1594a52a2ffaf750584c19372ff4& |
13:28:21 | FromDiscord | <4zv4l> they dont have the same result |
13:28:41 | FromDiscord | <4zv4l> In reply to @odexine "probably for allocation reasons": indeed |
13:28:52 | FromDiscord | <nnsee> does it work if you pass exactly 1024 or 2048 chars |
13:29:05 | FromDiscord | <odexine> md5update is likely reading the extra 0 bytes in the last chunk |
13:29:17 | FromDiscord | <odexine> since it doesnt take in a length |
13:30:00 | FromDiscord | <odexine> `buff[0..len-1]` probably also doesnt return an array but a seq so the cast is invalid |
13:30:19 | FromDiscord | <nnsee> ah yes, that's a slice |
13:30:56 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:31:14 | FromDiscord | <odexine> no, best not to cast at all |
13:31:35 | FromDiscord | <4zv4l> but then it complains |
13:31:38 | FromDiscord | <4zv4l> because char isnt uint8 |
13:31:43 | FromDiscord | <4zv4l> and update asks for uint8 |
13:32:33 | FromDiscord | <4zv4l> oh wait |
13:32:35 | FromDiscord | <4zv4l> I can use readBytes |
13:32:37 | FromDiscord | <odexine> then cast to a `seq[uint8]` |
13:33:42 | FromDiscord | <4zv4l> but it will allocate memory |
13:33:47 | FromDiscord | <4zv4l> why would I allocate memory for that ? |
13:35:48 | FromDiscord | <4zv4l> well well well https://media.discordapp.net/attachments/371759389889003532/1192823766829506631/image.png?ex=65aa7ab3&is=659805b3&hm=ac632996b2271aabf0442c04437326a5778ffffbac9dcf92edf58eea46ae2d25& |
13:35:50 | FromDiscord | <4zv4l> I dont get it |
13:35:50 | FromDiscord | <4zv4l> xD |
13:36:08 | FromDiscord | <4zv4l> so much easier in C lol |
13:36:52 | FromDiscord | <odexine> In reply to @4zv4l "but it will allocate": you already are no matter what |
13:37:09 | FromDiscord | <odexine> the mere usage of md5Update will allocate memory |
13:37:18 | FromDiscord | <odexine> wait no |
13:37:30 | FromDiscord | <odexine> i mean, the usage of that indexing `[]` |
13:37:34 | FromDiscord | <4zv4l> it reads the right bytes number https://media.discordapp.net/attachments/371759389889003532/1192824212608524388/image.png?ex=65aa7b1d&is=6598061d&hm=daf392f9535b5884c5cae8c72d8d7bdc80216d2a63a8d7fc2a5954999e8c06df& |
13:38:13 | FromDiscord | <4zv4l> In reply to @odexine "the mere usage of": yeah but I wont re implement that↵but for my buffer I dont need to allocate |
13:38:29 | FromDiscord | <odexine> In reply to @4zv4l "it reads the right": this looks more correct to me |
13:38:32 | FromDiscord | <4zv4l> In reply to @odexine "i mean, the usage": yeah crazy that slicing allocate memory |
13:38:47 | FromDiscord | <4zv4l> In reply to @odexine "this looks more ": yeah but the hash isnt the same 🥹 |
13:40:13 | FromDiscord | <odexine> you dont call md5Init? |
13:40:59 | FromDiscord | <odexine> before the while loop `md5Init(ctx) |
13:41:01 | FromDiscord | <odexine> (edit) "`md5Init(ctx)" => "`md5Init(ctx)`" |
13:41:11 | FromDiscord | <4zv4l> I just added it now |
13:41:14 | FromDiscord | <4zv4l> but yeah didnt change much xD |
13:41:33 | FromDiscord | <4zv4l> ok |
13:41:35 | FromDiscord | <4zv4l> now yeah |
13:41:37 | FromDiscord | <4zv4l> okok cool finally |
13:41:38 | FromDiscord | <4zv4l> xD |
13:42:02 | FromDiscord | <odexine> "didnt change much" lol |
13:42:25 | FromDiscord | <4zv4l> I changed the len↵why do I need to add `len-1` ? |
13:42:26 | FromDiscord | <4zv4l> https://nim-lang.org/docs/syncio.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural |
13:42:30 | FromDiscord | <4zv4l> why not len |
13:42:47 | FromDiscord | <4zv4l> I need to read the 5 bytes so why do I give 4 as length ? |
13:42:56 | FromDiscord | <4zv4l> oh wait |
13:43:00 | FromDiscord | <4zv4l> no okok my bad |
13:43:02 | FromDiscord | <4zv4l> sorry tired |
13:43:02 | FromDiscord | <4zv4l> xD |
13:43:19 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1192825656459931770/image.png?ex=65aa7c76&is=65980776&hm=dba7965ea143d81025e25bdc0aa95657d7d738a845bd2244885c6142f1d62a03& |
13:44:34 | FromDiscord | <odexine> congrats |
13:47:36 | FromDiscord | <4zv4l> thanks xD |
13:47:47 | FromDiscord | <4zv4l> finally can try to implement my C project into Nim xD |
13:48:02 | FromDiscord | <4zv4l> I find using raw bytes/array in Nim so much more complex than in C |
13:48:13 | FromDiscord | <4zv4l> like if Nim didnt want you to use array that way |
13:59:19 | * | azimut quit (Ping timeout: 240 seconds) |
14:09:31 | * | rockcavera quit (Remote host closed the connection) |
14:11:11 | FromDiscord | <nnsee> In reply to @4zv4l "I find using raw": because C is a lot more lax about types than Nim? |
14:14:22 | * | rockcavera joined #nim |
14:18:20 | * | hernan joined #nim |
14:19:32 | * | lucasta joined #nim |
14:31:29 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
14:47:25 | * | azimut joined #nim |
14:49:12 | arkanoid | this is trending on HN now https://gist.github.com/FeepingCreature/5dff669aad380a123b15659e195fb96c . Just out of curiosity, is this the reason why Nim compiler passes objects by hidden pointer if they are larger than X bytes (don't remember the exact number, but it may well be 16bytes) |
15:03:04 | * | Batzy_ joined #nim |
15:06:10 | * | Batzy quit (Ping timeout: 256 seconds) |
15:11:31 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=html> |
15:13:01 | * | PMunch quit (Quit: Leaving) |
15:50:21 | FromDiscord | <Phil> The time has come... for tsan |
15:53:10 | FromDiscord | <Phil> Aaaaaan tsan immediately starts crying foul |
15:55:25 | FromDiscord | <Phil> .... it complains about a data race when I log something on startup/shutdown? |
15:55:32 | FromDiscord | <Phil> what? |
15:59:50 | FromDiscord | <Phil> Does tsan notice my set of threads constantly polling their own channels and just shouts "That's a data race" ? |
16:00:03 | FromDiscord | <Phil> (edit) "Does tsan notice my set of threads constantly polling their own channels and ... just" added "sending messages back and forth and" |
16:08:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:08:27 | FromDiscord | <Phil> (edit) |
16:09:02 | FromDiscord | <Phil> (edit) |
16:10:23 | FromDiscord | <Phil> Is this what you're trying to teach me here with tsan leorize? That my setup leads to tsan complaining about pseudo data-races that aren't any?↵↵Because from what I'm seeing it's just complaining about me sending a message from A to B with a setup of continuously polling the channel and then sleeping a bit before polling again. |
16:10:34 | FromDiscord | <Phil> (edit) "any?↵↵Because" => "real?↵↵Because" |
16:15:31 | FromDiscord | <Phil> It's kinda hilarious how I'm treading the path that Zevv walked before me. |
16:15:57 | FromDiscord | <Phil> And at this point I think I'm still sticking with it because I like my DSL and mental model better than annotating a single proc and using "hatch" |
16:17:49 | FromDiscord | <Phil> Huh, they just use deques directly, not stuff like loony, Channels or Chan |
16:19:59 | FromDiscord | <Phil> Hmm basically every actor contains a field with its own channel and by having the actor itself you have its channel.↵Their approach seems to significantly decouple actor instances and which thread works on them more than mine. |
16:21:04 | * | lucasta quit (Remote host closed the connection) |
16:22:20 | FromDiscord | <Phil> Is Zevv even still active here? |
16:25:36 | FromDiscord | <Phil> Man, now I want to chat with the guy so bad |
16:26:36 | FromDiscord | <gyatsoyt> How do I efficiently translate my python code into nim it's fully written in python doesn't use many packages all of them are standard (almost). I mean writing all the code from python into nim is exhausting |
16:29:50 | FromDiscord | <inventormatt> Depending on how much code there is you could ask chatgpt to translate parts of it for you. I've had moderate successes doing that |
16:31:07 | FromDiscord | <inventormatt> In reply to @isofruit "Is Zevv even still": I've seen him show up from time to time here and on the forum. Be is largely not actually in the nim community anymore |
16:32:04 | FromDiscord | <nnsee> if using chatgpt be prepared for it to hallucinate stuff and getting you to import nim packages that don't exist |
16:33:33 | FromDiscord | <danvenn> Has anyone managed to bind a .dll file in futhark? I'm struggling! |
16:33:50 | FromDiscord | <Phil> PMunch has! |
16:34:01 | FromDiscord | <Phil> This is me guessing but I'm sure he did that at one point |
16:34:03 | FromDiscord | <danvenn> https://github.com/cozodb/cozo/blob/main/cozo-lib-c/example.c↵want to get this going |
16:34:59 | FromDiscord | <danvenn> how do I link a dll? the same way as a .lib? |
16:35:08 | FromDiscord | <danvenn> {.passL: "-Llib/dyn -llibcozo_c".}? |
16:35:19 | FromDiscord | <pengwyns> I did something cursed. |
16:35:21 | NimEventer | New thread by aSmallFrog: Help with linking DLLs/ Futhark Bindings, see https://forum.nim-lang.org/t/10852 |
16:35:21 | FromDiscord | <Phil> I would assume so.↵Generally you might want to refer what demotomohirot wrote about that |
16:35:27 | FromDiscord | <pengwyns> I made npm's everything, but for nim. |
16:35:40 | FromDiscord | <danvenn> In reply to @NimEventer "New thread by aSmallFrog:": that's me |
16:35:44 | FromDiscord | <Phil> https://internet-of-tomohiro.netlify.app/nim/clibrary.en.html#sharedslashdynamicminuslink-library |
16:35:58 | FromDiscord | <danvenn> Thanks Phil I'll take a look |
16:36:09 | FromDiscord | <Phil> Ribbit Ribbit my friend |
16:36:20 | FromDiscord | <nnsee> In reply to @pengwyns "I made npm's everything,": now do `nimble install -d` and report back |
16:36:22 | FromDiscord | <pengwyns> oh god, its actually downloading every nimble package ever. |
16:36:24 | FromDiscord | <gyatsoyt> In reply to @inventormatt "Depending on how much": I have significant amount of code almost 10+ files |
16:36:41 | FromDiscord | <gyatsoyt> In reply to @nnsee "if using chatgpt be": Yes I have seen those |
16:36:51 | FromDiscord | <Phil> ... for reference, 10 files is the starting point for a medium sized project |
16:37:02 | FromDiscord | <Phil> Still on the smaller side ^^ |
16:37:31 | FromDiscord | <nnsee> files is so arbitrary, i started a Deno project today that is 20 files currently but each file is tiny |
16:37:42 | FromDiscord | <nnsee> LOC is a better (but still pretty bad) indicator |
16:38:01 | FromDiscord | <Phil> ~~It works for me because my files almost always end up 50-400 loc~~ |
16:38:04 | FromDiscord | <pengwyns> I sure hope no one inserted any malware into the install tasks of these packages. |
16:38:17 | FromDiscord | <pengwyns> Wait is it even possible? |
16:38:20 | FromDiscord | <danvenn> In reply to @isofruit "https://internet-of-tomohiro.netlify.app/nim/clibra": Hmm frustratingly he skips the dll part |
16:38:25 | FromDiscord | <nnsee> In reply to @pengwyns "I sure hope no": they will now |
16:38:38 | FromDiscord | <Phil> In reply to @pengwyns "I sure hope no": At this point I'd more say "Sure hope you're not running this on your raw machine" |
16:38:48 | FromDiscord | <Phil> In reply to @danvenn "Hmm frustratingly he skips": Hmmm |
16:38:49 | FromDiscord | <pengwyns> You know that would be a better idea. |
16:38:50 | FromDiscord | <nnsee> and it will be pushed before nimble gets to those deps |
16:38:50 | FromDiscord | <gyatsoyt> If I were to guess the total lines of code in all the files included it probably will be around 4k to 5k |
16:39:01 | FromDiscord | <gyatsoyt> Which is too much to translate to nim |
16:39:02 | FromDiscord | <gyatsoyt> Ngl |
16:39:04 | FromDiscord | <nnsee> that's not too much |
16:39:20 | FromDiscord | <gyatsoyt> In reply to @nnsee "that's not too much": For me it is |
16:39:33 | FromDiscord | <gyatsoyt> That's why I was searching for a faster method to do it ... |
16:39:40 | FromDiscord | <Phil> In reply to @danvenn "Hmm frustratingly he skips": I only used linux dlls so far.↵As in, .so files, not windows dlls, I'm not entirely sure if the syntax is the same there |
16:39:51 | FromDiscord | <gyatsoyt> Like I have only translated 2 files till now |
16:39:52 | FromDiscord | <Phil> I was binding a ton of gtk procs by hand |
16:40:29 | * | wheatengineer quit (Quit: Leaving) |
16:40:42 | FromDiscord | <inventormatt> In reply to @gyatsoyt "That's why I was": There are also a couple of py2nim projects that can search for but I have no idea how they successful they are |
16:41:08 | FromDiscord | <Phil> I'm only aware of py2nim directly |
16:41:36 | FromDiscord | <danvenn> In reply to @isofruit "I only used linux": did you use loadLib() |
16:42:36 | FromDiscord | <gyatsoyt> In reply to @inventormatt "There are also a": It doesn't works for me I installed it through nimble install py2nim then tried running py2nim I always get py2nim is not found as a terminal command |
16:42:45 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:42:54 | FromDiscord | <Phil> In the case above those were libadwaita bindings |
16:43:05 | FromDiscord | <Phil> The procs then look sth like this:↵` proc adw_expander_row_new(): GtkWidget` |
16:43:10 | FromDiscord | <inventormatt> In reply to @gyatsoyt "It doesn't works for": Have you tried adding the exe to your path? |
16:43:22 | FromDiscord | <danvenn> In reply to @isofruit "I did not use": I think the bindings part is working, but I'm trying to actually load the binary at compile time I think |
16:43:23 | FromDiscord | <Phil> GtkWidget being a distinct pointer in that case |
16:43:37 | FromDiscord | <Phil> In reply to @danvenn "I think the bindings": You mean you want to include the lib into your binary? |
16:43:40 | FromDiscord | <Phil> That would be static linking |
16:43:42 | FromDiscord | <danvenn> no |
16:43:56 | FromDiscord | <danvenn> but I have no idea how nim deals with .dll files is the problem - its not very clear in the manual |
16:44:09 | FromDiscord | <danvenn> I know theres a pragma for individual procs |
16:44:13 | FromDiscord | <Phil> I don't think I understand what you're trying to do anymore ^^' |
16:44:15 | FromDiscord | <danvenn> but is there a way to load the dll fully |
16:44:21 | FromDiscord | <gyatsoyt> In reply to @inventormatt "Have you tried adding": umm which exe? |
16:44:41 | FromDiscord | <danvenn> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:45:14 | FromDiscord | <Phil> You're on linux? |
16:45:31 | FromDiscord | <danvenn> windows (but I think its probably only a matter of a file type) |
16:45:51 | FromDiscord | <danvenn> https://nim-lang.org/1.6.4/dynlib.html |
16:46:12 | FromDiscord | <danvenn> I'm guessing i use this |
16:47:20 | FromDiscord | <Phil> It should be a matter of just knowing the lib name and using passL without static |
16:47:44 | FromDiscord | <danvenn> I just get an unexplained fail to run |
16:47:47 | FromDiscord | <danvenn> when I do that |
16:48:27 | FromDiscord | <inventormatt> In reply to @gyatsoyt "umm which exe?": I'm not sure which py2nim you are using but in order for something to be called from the command line you usually need an exe file. It might be in the nimble folder you installed |
16:48:29 | FromDiscord | <Phil> I mean, is the dll file in your path? |
16:48:41 | FromDiscord | <danvenn> that's what big -L is for though right |
16:49:07 | FromDiscord | <gyatsoyt> In reply to @inventormatt "I'm not sure which": I am using Py2nim not py2nim... ↵This is confusing btw |
16:49:09 | FromDiscord | <danvenn> I don't think this practice of keeping shared libraries for many apps makes sense in the world of TB hard drives |
16:49:17 | FromDiscord | <danvenn> just causes huge headaches |
16:49:19 | FromDiscord | <Phil> > -l option links specified library. For example, -lvector3 searchs directories for libvector3.a (vector3.lib on Windows). -lm option links the library that provides functions in math.h. |
16:49:36 | FromDiscord | <danvenn> -L is different to -l |
16:49:43 | FromDiscord | <danvenn> because programmers are annoying like that 😉 |
16:50:06 | FromDiscord | <Phil> Ah there we go, -L adds dirs to the Path, check |
16:50:26 | FromDiscord | <danvenn> it should be -libpath |
16:50:32 | FromDiscord | <danvenn> but that's too many letters |
16:50:46 | FromDiscord | <Phil> So basically you're looking for your file in the directory lib/static and in there should be the file libcozo_c |
16:50:48 | FromDiscord | <inventormatt> In reply to @gyatsoyt "I am using Py2nim": I'd look in the nimble folder where it was installed and check to see if there is a .exe file there |
16:50:59 | FromDiscord | <danvenn> yeah that works fine |
16:51:01 | FromDiscord | <gyatsoyt> In reply to @inventormatt "I'd look in the": Okie |
16:51:12 | FromDiscord | <danvenn> it tries to link statically , but some other failure occurs |
16:51:42 | FromDiscord | <danvenn> the lack of clarity might force me to ditch nim really, even though it seems v powerful |
16:51:57 | FromDiscord | <danvenn> trying to do the same thing with a dll just fails |
16:52:02 | FromDiscord | <Phil> Do you have a dll file (for windows) in that dir? |
16:52:13 | FromDiscord | <danvenn> i change the path to lib/dyn (where the dll is) |
16:55:43 | FromDiscord | <whisperecean> is there somewhere an easy setup to have nim with ssl + zig for crossplatform compiling? |
16:56:01 | FromDiscord | <Phil> In reply to @whisperecean "is there somewhere an": For easy usage of zig sure, ssl should just be -d:ssl |
16:56:27 | FromDiscord | <Phil> -l option links specified library. For example, -lvector3 searchs directories for libvector3.a (vector3.lib on Windows). -lm option links the library that provides functions in math.h. |
16:56:30 | FromDiscord | <Phil> (edit) "-l option links specified library. For example, -lvector3 searchs directories for libvector3.a (vector3.lib on Windows). -lm option links the library that provides functions in math.h." => "https://github.com/enthus1ast/zigcc" |
16:56:55 | FromDiscord | <Phil> Also: https://stackoverflow.com/questions/73345643/how-to-use-the-zig-compiler-in-order-to-compile-nim-code |
16:59:03 | FromDiscord | <whisperecean> Thanks I am gonna try that. Hopefully its setup is not painful |
17:00:07 | * | azimut quit (Ping timeout: 240 seconds) |
17:00:18 | FromDiscord | <Phil> In reply to @danvenn "i change the path": I think I'm lacking the futhark knowledge here.↵For manual wrapping I'm your guy, futhark you'll need to wait for PMunch, who is the most experienced person for the job |
17:01:24 | * | azimut joined #nim |
17:02:27 | FromDiscord | <danvenn> In reply to @isofruit "I think I'm lacking": I've just posted an issue in the github so he'll see it 🙂 |
17:02:37 | FromDiscord | <danvenn> Thanks for trying though! |
17:02:42 | FromDiscord | <Phil> In reply to @danvenn "I've just posted an": Oh believe me he'll come here on his own 😄 |
17:03:26 | * | zgasma joined #nim |
17:03:29 | FromDiscord | <whisperecean> What kind of http server should I use by default on linux and are there any nice libs to execute function periodically (cron like style?) |
17:04:56 | FromDiscord | <Phil> sent a long message, see <!doctype html> |
17:05:20 | FromDiscord | <Phil> (edit) |
17:05:31 | FromDiscord | <whisperecean> No, I just want to server karax single page app for visualization and execute a function periodically |
17:05:38 | FromDiscord | <whisperecean> the whole project will be 2 lines of nim and karax probably |
17:05:53 | FromDiscord | <Phil> ohhhhhhhh okay you just need a server to serve the karax app |
17:05:56 | FromDiscord | <Phil> Then yeah, personally nginx |
17:06:01 | FromDiscord | <whisperecean> (edit) "lines" => "files" |
17:06:09 | FromDiscord | <whisperecean> But I dont want to use nginx |
17:06:16 | FromDiscord | <whisperecean> I want it to be a self-contained app |
17:06:37 | FromDiscord | <odexine> not exactly recommended to do so |
17:06:47 | FromDiscord | <whisperecean> It wont be internet facing |
17:06:57 | FromDiscord | <Phil> So you want to serve sth on localhost |
17:06:59 | FromDiscord | <whisperecean> it will run as a pod in k8s |
17:07:07 | FromDiscord | <Phil> Ah, intranet |
17:07:24 | FromDiscord | <whisperecean> it will run some calculation and the karax page will be just for visual debugging |
17:08:44 | FromDiscord | <Phil> If you want to write 2 projects (a tiny http server that only serves a file and your karax app) then you could try your luck with asynchttpserver?↵Honestly I'd still default to nginx & friends simply because they're "standard" |
17:08:52 | FromDiscord | <Phil> (edit) "If you want to write 2 projects (a tiny http server that only serves a file and your karax app) then you could try your luck with asynchttpserver?↵Honestly I'd still default to nginx & friends simply because they're "standard" ... " added "for file serving etc." |
17:09:02 | FromDiscord | <Phil> (edit) "asynchttpserver?↵Honestly" => "std/asynchttpserver?↵Honestly" |
17:09:07 | FromDiscord | <Phil> https://nim-lang.org/docs/asynchttpserver.html |
17:09:48 | FromDiscord | <Phil> There's an implicit cost associated with using non-standard things, even if they're overkill |
17:13:37 | NimEventer | New thread by nimaoth: Absytree: Text editor (and tree based language framework) in Nim, see https://forum.nim-lang.org/t/10853 |
17:17:16 | FromDiscord | <leorize> I don't have any such intentions lol. I just thought that polling that way is too inefficient↵(@Phil) |
17:17:45 | FromDiscord | <Phil> I mean, it is, but the alternative (push) would require a queue that I register a callback with that the queue then calls, no? |
17:18:09 | FromDiscord | <Phil> I don't think any of the queue's I've integrated provide that so far |
17:19:51 | FromDiscord | <Phil> The only way to do that would be to write my own queue |
17:20:06 | FromDiscord | <Phil> Or find a project that does provide that and ditch all the queues I've provided so far |
17:20:16 | FromDiscord | <Phil> (edit) "provided" => "implemented support for" |
17:20:52 | FromDiscord | <Phil (he/him)> Bridge deded |
17:21:07 | FromDiscord | <leorize> you don't need anything that fancy... |
17:21:31 | FromDiscord | <Phil (he/him)> Why a known buggy pattern?↵It's just 2 threads entirely independently existing alongside one another, then during one of its loops thread A sends a message and thread B eventually reads it from its queue. Where's the conceptual bug? |
17:22:46 | FromDiscord | <Phil (he/him)> The pattern seemed stable enough to me that I dismissed the report from tsan as a false positive honestly |
17:23:40 | FromDiscord | <leorize> hmm I'm trying to understand the report |
17:24:32 | FromDiscord | <Phil> Want the code of the 2 loops that run? |
17:24:54 | FromDiscord | <leorize> it seems that you really have a race, but saved by the sleep, which is why it was complaining |
17:25:22 | FromDiscord | <leorize> see https://github.com/google/sanitizers/wiki/ThreadSanitizerReportFormat |
17:25:54 | FromDiscord | <leorize> > It is added in the following situation. Thread 1 had done the first conflicting memory access. Then thread 2 had executed some sleep function (sleep(), usleep(), nanosleep(), etc), and then had done the second conflicting access. The stack trace can be useful, because tests frequently "synchronize" this way. |
17:27:05 | FromDiscord | <Phil> But that's just "Thread A read from channel, then sleeps, while it sleeps Thread B writes to channel, now Thread A reads from channel again" |
17:27:25 | FromDiscord | <Phil> That's not a bug, that's the design.↵It's interpreting the continuous polling as the datarace then |
17:27:47 | FromDiscord | <Phil> (edit) "That's not a bug, that's the design.↵It's interpreting the continuous polling ... as" added "with "hotspin-prevention-sleep"" |
17:28:16 | FromDiscord | <leorize> I don't think so, but ig try using a different channel and see if it's still complaining |
17:28:32 | FromDiscord | <leorize> I think threading have a different implementation? |
17:29:48 | FromDiscord | <Phil (he/him)> You'll be laughing, that was threading |
17:29:59 | FromDiscord | <Phil (he/him)> I can try with loony if you think that's safer |
17:30:13 | FromDiscord | <leorize> though fwiw the pattern is bad in the first place, not because of races but because of the arbitrary wait time↵(@Phil) |
17:31:06 | FromDiscord | <Phil (he/him)> Is this why you wanted me to go for putting things in the async-queue? |
17:31:13 | FromDiscord | <leorize> there's a couple tricks to handling this, but I'll have to check if they're safe real quick |
17:31:26 | FromDiscord | <leorize> pretty much |
17:32:21 | FromDiscord | <Phil (he/him)> But i mean I'd still need to check with "hasPendingOperations()"↵Because there may be scenarios where no message is coming and the queue is empty, calling poll on that empty queue would just error out then |
17:33:27 | FromDiscord | <Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html> |
17:33:49 | * | rockcavera quit (Remote host closed the connection) |
17:34:02 | FromDiscord | <Phil (he/him)> Or I guess the try-catch block would be moved to be somewhere else |
17:35:57 | FromDiscord | <leorize> don't worry, the way I'm thinking of won't leave you with an empty queue, ever |
17:36:05 | FromDiscord | <leorize> a trick I have in mind is to use an eventfd from asyncdispatch |
17:36:52 | FromDiscord | <leorize> you then spawn an another thread that receives message to a memory location |
17:37:12 | FromDiscord | <leorize> once the message is received, signal it via the event token |
17:37:23 | FromDiscord | <leorize> and it will be pushed to asyncdispatch queue |
17:37:25 | FromDiscord | <leorize> stuff like that |
17:38:15 | FromDiscord | <Phil (he/him)> So now I have 3 threads?↵Main thread, helper thread pushing things into asyncfd and "poll" just perpetually tries to read events from asyncfd? |
17:38:56 | FromDiscord | <Phil (he/him)> Or I guess the main thread would push stuff to asyncfd |
17:39:44 | FromDiscord | <leorize> pretty much, you can implement this however |
17:39:52 | FromDiscord | <Phil (he/him)> Btw. is zevv in the cyo discord? Or active at all in any distantly related nim community? |
17:40:35 | * | rockcavera joined #nim |
17:42:53 | NimEventer | New thread by Strinnityk: How to mock overloaded function, see https://forum.nim-lang.org/t/10855 |
17:43:21 | FromDiscord | <Phil (he/him)> I mean, I don't know said corner and I'd be happy to chat assuming the fact that I mostly want to talk tech and mostly plan to remain on nim is not a problem (?) |
17:43:21 | FromDiscord | <Phil (he/him)> Thank! |
17:43:21 | FromDiscord | <leorize> I'll pm you the matrix |
17:43:23 | FromDiscord | <leorize> actually it might be faster for you to just join CPS channel\: [#cps\:matrix.org](https://matrix.to/#/#cps:matrix.org) |
17:45:20 | FromDiscord | <leorize> zevv is on the IRC side of that place, so if you ping him he should answer |
17:45:40 | FromDiscord | <asakura44> where to ask for help ? |
17:45:52 | FromDiscord | <leorize> disruptek's corner is doing LLM shenanigans so it's kinda spammy rn |
17:45:53 | FromDiscord | <Phil> This is the channel for general nim question |
17:45:55 | FromDiscord | <Phil> s |
17:46:14 | FromDiscord | <asakura44> https://media.discordapp.net/attachments/371759389889003532/1192886789254434856/214.PNG?ex=65aab565&is=65984065&hm=4170424c0d1b58bbbf9344f3bd78a3d38ed9c5160e3b72fe4c5c01cb16b30cc8& |
17:46:20 | FromDiscord | <asakura44> what is the issue here ? |
17:46:56 | FromDiscord | <pengwyns> You know what, installing every package ever is a great way to find broken packages quickly |
17:47:10 | FromDiscord | <asakura44> yeah |
17:47:26 | FromDiscord | <asakura44> can you help mate ? |
17:48:18 | FromDiscord | <khazakar> Did you installed needed package? |
17:48:23 | FromDiscord | <asakura44> yes |
17:48:32 | FromDiscord | <asakura44> nimble install nigui |
17:48:35 | FromDiscord | <asakura44> successful |
17:48:42 | FromDiscord | <pengwyns> Are you trying to build this program via nimble? |
17:48:54 | FromDiscord | <pengwyns> If so then you might have to insert your dependency into the .nimble file |
17:48:58 | FromDiscord | <asakura44> no i ran the source file from vscode |
17:49:22 | FromDiscord | <asakura44> how am i suppose to build the program ? |
17:49:48 | FromDiscord | <pengwyns> I typically build using the nimble tool but, try running just the import statement via vscode. |
17:50:00 | FromDiscord | <pengwyns> Maybe vscode isn't able to find the nigui library |
17:50:16 | FromDiscord | <asakura44> nimble build codes.nim ? |
17:51:14 | FromDiscord | <pengwyns> No, thats not the way you use nimble normally. You can also try just building using nim: "nim c -d:release codes.nim" |
17:51:17 | FromDiscord | <pengwyns> maybe that will work |
17:51:48 | FromDiscord | <asakura44> https://media.discordapp.net/attachments/371759389889003532/1192888192479805513/6354.PNG?ex=65aab6b3&is=659841b3&hm=5c8b900948dbe2a45ae7944e538b3199086784d7974bf46344bcbf4e1d06cb6b& |
17:52:45 | FromDiscord | <asakura44> same error |
17:52:46 | FromDiscord | <asakura44> https://media.discordapp.net/attachments/371759389889003532/1192888431815176202/214.PNG?ex=65aab6ec&is=659841ec&hm=68b8e560e94e10f9cf34b21829ca1abbd54a20bbea5f9f258436debd925dc1ff& |
17:52:52 | FromDiscord | <asakura44> to this |
17:52:56 | FromDiscord | <asakura44> i tried with cmd |
17:53:05 | FromDiscord | <pengwyns> Strange... |
17:53:17 | FromDiscord | <asakura44> https://media.discordapp.net/attachments/371759389889003532/1192888564556501073/312.PNG?ex=65aab70c&is=6598420c&hm=55ef7a26ceea8ed52cc85c68debd266a3a1d91296da95414c7d2b5e6c133320a& |
17:54:10 | FromDiscord | <khazakar> Check docs for version you have installed. I will test it on my side as well when I will be back at home |
17:54:31 | FromDiscord | <asakura44> In reply to @khazakar "Check docs for version": thanks mate i appreciate your comment |
17:55:35 | FromDiscord | <khazakar> https://github.com/simonkrauter/NiGui/blob/master/examples/example_01_basic_app.nim |
17:55:44 | FromDiscord | <khazakar> Run this one first |
17:58:55 | FromDiscord | <asakura44> awwwww |
17:58:58 | FromDiscord | <asakura44> it works |
17:59:06 | FromDiscord | <asakura44> https://media.discordapp.net/attachments/371759389889003532/1192890030746775633/3131313.PNG?ex=65aab86a&is=6598436a&hm=c40ad892ebc47208798b836d29910cd61a73b28246a7146b62d21029895d4fd9& |
17:59:14 | FromDiscord | <asakura44> hhhhh |
17:59:16 | FromDiscord | <asakura44> awesome |
17:59:25 | FromDiscord | <asakura44> 😃 |
18:00:35 | FromDiscord | <asakura44> so coool |
18:18:41 | * | jmdaemon quit (Ping timeout: 260 seconds) |
19:17:06 | FromDiscord | <griffith1deadly> the biggest reason I love nim so much is the macros :p |
19:19:16 | FromDiscord | <srabb> In reply to @leorize "disruptek's corner is doing": what app are the bot guys using to chat |
19:21:08 | FromDiscord | <Phil (he/him)> I use fractal when I'm on matrix |
19:21:26 | FromDiscord | <Phil (he/him)> Because god damn do I love the GTK feel and how it maximized the screenspace usage |
19:21:32 | FromDiscord | <srabb> what is fractal and what is matrix |
19:21:54 | FromDiscord | <Phil (he/him)> Okay so have you ever heard of mastodon? |
19:22:00 | FromDiscord | <Phil (he/him)> Or lemmy? |
19:22:08 | FromDiscord | <srabb> ive heard of mastodon |
19:22:14 | FromDiscord | <srabb> i think its like a twitter alternative |
19:22:22 | FromDiscord | <srabb> but you host your own communities |
19:22:45 | FromDiscord | <Phil (he/him)> Matrix is to discord roughly what mastodon is to X/Twitter etc.Instead of one central server, matrix is a bunch of different servers that are easy to self-host that can talk to one another. |
19:23:00 | Amun-Ra | srabb: and there are several IRC clients |
19:23:05 | FromDiscord | <srabb> im gonna try it out |
19:23:18 | FromDiscord | <srabb> and how do i join the nim server |
19:23:20 | FromDiscord | <srabb> from matric |
19:23:24 | Amun-Ra | I'm using https://weechat.org/about/screenshots/ |
19:23:39 | FromDiscord | <leorize> [#nim\:envs.net](https://matrix.to/#/#nim:envs.net) |
19:23:42 | FromDiscord | <srabb> In reply to @Amun-Ra "I'm using https://weechat.org/about/screenshots/": vim |
19:23:44 | FromDiscord | <Phil (he/him)> It is easy to start up your own instance of mastodon/lemmy/matrix that can communicate with other instances to chat. Though you definitely do not need to, you can just join somebody else's instance that can communicate with the instance where the nim rooms are on |
19:24:08 | FromDiscord | <Phil (he/him)> image.png https://media.discordapp.net/attachments/371759389889003532/1192911427372069014/image.png?ex=65aacc57&is=65985757&hm=f55e4b459ababc63d52a7554e84f8414372b60168c0954845965ad06a5e07477& |
19:24:23 | FromDiscord | <srabb> In reply to @Phil (he/him) "image.png": is that cinny? |
19:24:26 | FromDiscord | <srabb> what client do you use |
19:24:27 | FromDiscord | <Phil (he/him)> Fractal btw\: |
19:24:34 | FromDiscord | <srabb> oh yeah |
19:24:39 | FromDiscord | <leorize> https://servers.joinmatrix.org/ \<- for picking a server |
19:24:55 | FromDiscord | <Phil (he/him)> Nope, fractal. Cinny is nice, but imo blocks too much when loading a server |
19:25:16 | FromDiscord | <Phil (he/him)> Fractal does not do that (as much) and the gtk base is more pleasant to use (for me, as a Gnome user that likes the DE) |
19:25:17 | FromDiscord | <leorize> cinny is dead slow somehow |
19:25:20 | FromDiscord | <srabb> what the hell is a flatpakref https://media.discordapp.net/attachments/371759389889003532/1192911728661512203/image.png?ex=65aacc9f&is=6598579f&hm=cad6bff14f6aea72d10d17e48b6cf75a5b014093f23f6ee1cb09629891475813& |
19:25:45 | FromDiscord | <srabb> oh yeah i use windows btw |
19:25:46 | FromDiscord | <Phil (he/him)> Are you on windows or on Linux? |
19:25:59 | FromDiscord | <Phil (he/him)> Well, the best client might be element anyway overall |
19:27:52 | FromDiscord | <Phil (he/him)> But I just like fractal's design |
19:27:52 | FromDiscord | <leorize> element or fluffychat are the two better ones there |
19:27:54 | FromDiscord | <leorize> I use element on desktop and fluffy on mobile |
19:27:55 | FromDiscord | <Phil (he/him)> Element on mobile and fractal on desktop |
19:27:55 | FromDiscord | <leorize> though i'd use element x if my home server can do sliding sync |
19:27:55 | FromDiscord | <Phil (he/him)> Though for moderating fractal sadly is ass, so I jump over to the element webpage when that comes up |
19:27:56 | FromDiscord | <leorize> since you're on matrix.org @[Phil (he/him)], try element x |
19:27:57 | FromDiscord | <leorize> it's the fastest client I've ever used |
19:27:58 | FromDiscord | <Phil (he/him)> element x ? |
19:28:12 | FromDiscord | <Phil (he/him)> I know element, but x? |
19:28:14 | FromDiscord | <leorize> yea it's a part of the matrix 2.0 initiative |
19:28:22 | FromDiscord | <leorize> you can find it in app stores |
19:28:26 | FromDiscord | <srabb> hi |
19:28:38 | FromDiscord | <srabb> hi |
19:29:18 | FromDiscord | <srabb> why cant i see my own messages on matrix |
19:32:41 | FromDiscord | <srabb> ok, i can there is just an unbearable delay |
19:32:41 | FromDiscord | <Phil (he/him)> You can, the bridge connecting matrix and discord is just slow sometimes |
19:32:42 | FromDiscord | <srabb> can i make voice calls through matrix? |
19:32:42 | FromDiscord | <leorize> that's what happens when you use a bridge that's also used by 100+ other rooms |
19:32:42 | FromDiscord | <leorize> yes you can |
19:32:43 | FromDiscord | <srabb> cool \:P |
19:35:12 | FromDiscord | <Phil (he/him)> element x looks a lot more like stuff like signal |
19:35:15 | FromDiscord | <Phil (he/him)> huh |
19:52:26 | FromDiscord | <pengwyns> My .nimble/ folder has reached 278 megabytes, and has 236 unique packages.' |
19:52:42 | FromDiscord | <pengwyns> This was a bad idea. |
19:57:41 | Amun-Ra | speaking of nimble, is there an easy way of puging old package versions? |
19:58:46 | FromDiscord | <pengwyns> Im not sure to be honest |
20:00:22 | Amun-Ra | I think I'll write a script for this |
20:04:54 | FromDiscord | <Phil (he/him)> No direct command. You could just delete the pkgs folder in your nimble dir↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
20:05:15 | Amun-Ra | that's also the way to do it :) |
20:05:28 | Amun-Ra | s/the/a/ |
20:08:33 | FromDiscord | <leorize> I use nimble in localdeps mode all the time to avoid this |
20:11:09 | Amun-Ra | hmm |
20:15:08 | FromDiscord | <graveflo> In reply to @NimEventer "New thread by Strinnityk:": I was just talking about doing this the other day |
21:25:58 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:31:39 | FromDiscord | <graveflo> does it return a tuple of `(bool, string)` ? `: bool {.noSideEffect.}, string` looks weird |
21:32:11 | FromDiscord | <aintea> Nope, returns a tuple of a func and a string |
21:32:27 | FromDiscord | <graveflo> ok the seq contains tuple of of `proc` and `string` |
21:33:06 | FromDiscord | <aintea> yes |
21:33:36 | FromDiscord | <aintea> I tried adding parenthesis in case the nim compiler didn't understand well the seq type but it still doesn't works |
21:33:40 | FromDiscord | <aintea> (edit) "works" => "work" |
21:34:06 | FromDiscord | <graveflo> I'll try some stuff but i have to boot up my dev env |
21:34:24 | FromDiscord | <aintea> no problem, if you find something could you please ping me ? |
21:37:09 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:37:48 | FromDiscord | <aintea> already looks good if that works |
21:38:06 | FromDiscord | <aintea> But thanks for answering that fast |
21:38:07 | FromDiscord | <Phil> You're running into closure issues |
21:38:18 | FromDiscord | <aintea> What are closure issues ? |
21:39:21 | FromDiscord | <Phil> Essentially, it's expecting `seq[(proc (n: int): bool{.closure, noSideEffect.}, string)`↵As the return type.↵That is because proc-types by default are assumed to be closures in nim and thus the pragma implicitly gets added.↵Your procs aren't closures though, so it blows up |
21:39:32 | FromDiscord | <Phil> A "normal" proc like you have is nimcall |
21:39:45 | FromDiscord | <aintea> Ohhhhh |
21:40:04 | FromDiscord | <aintea> So what would be the non problematic way ? |
21:40:16 | FromDiscord | <Phil> Currently fiddling around there regarding that |
21:40:43 | FromDiscord | <graveflo> you can just add the `closure` pragma to the types |
21:40:55 | FromDiscord | <graveflo> but I don't like that tbh |
21:41:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
21:41:14 | FromDiscord | <Phil> Or make it all nimcall |
21:41:32 | FromDiscord | <leorize> or you can just use inference |
21:41:33 | FromDiscord | <Phil> (edit) |
21:41:40 | FromDiscord | <aintea> With auto ? |
21:41:41 | FromDiscord | <Phil> Don't even need the inner nimcalls that I previously added there |
21:41:53 | FromDiscord | <aintea> Or the auto keyword equivalent in nim |
21:42:24 | FromDiscord | <Phil> Auto exists in nim and does the same |
21:42:33 | FromDiscord | <Phil> It's one of like 3-4 ways of making a generic |
21:43:37 | FromDiscord | <aintea> Then thank you guys, looks like my problem is solved, thanks for answering this fast$ |
21:43:39 | FromDiscord | <aintea> (edit) "fast$" => "fast" |
21:43:48 | FromDiscord | <graveflo> the bare `proc` generic that I orginally posted would be the most idiomatic way of doing "auto" liek generics here I think |
21:44:11 | FromDiscord | <Phil> Yeah, I agree on that one |
21:44:45 | FromDiscord | <Phil> The entire closure problem is just one @aintea will slam into so very often (because I certainly did) that I thought it would make sense to elaborate on it |
22:37:19 | * | azimut quit (Ping timeout: 240 seconds) |
22:51:01 | FromDiscord | <Elegantbeef> @graveflo Awww I was too optimistic with beneficial your changes would be to my GUI code. I still require procedures to call the implementation procs |
22:51:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:52:17 | FromDiscord | <Elegantbeef> But then again I'm the schmuck that made statically typed GUI framework |
22:57:21 | FromDiscord | <graveflo> hmmm. How does this work exactly? |
22:57:30 | FromDiscord | <graveflo> looks kinda weird |
22:57:47 | FromDiscord | <Elegantbeef> Generics, lots and lots of generics |
22:58:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html> |
22:58:57 | FromDiscord | <albassort> beef you just made gtk but native nim |
22:59:07 | FromDiscord | <Elegantbeef> Element is a concept as is UI state |
22:59:30 | FromDiscord | <albassort> i guess in gtk its less generic |
22:59:38 | FromDiscord | <albassort> onExit would be a signal and not a state |
22:59:47 | FromDiscord | <Elegantbeef> Sadly the dispatcher does not consider `proc onEnter[Base, T](slider: HorizontalSliderBase[Base, T], uiState: var UiState)` as more of a match than the double generic |
22:59:56 | FromDiscord | <albassort> (edit) "signal and not a state" => "signal->proc" |
23:00:01 | FromDiscord | <Elegantbeef> I mean this was made for game UI so it's nothing like gtk |
23:00:03 | FromDiscord | <albassort> (edit) "signal->proc" => "signal- enum>proc" |
23:00:12 | FromDiscord | <albassort> i meant typing wise |
23:00:43 | FromDiscord | <albassort> game ui? just uhh idk |
23:00:43 | FromDiscord | <albassort> dont |
23:01:42 | FromDiscord | <Elegantbeef> Eh being able to make game UI is a nice thing to have |
23:01:52 | FromDiscord | <Elegantbeef> Whether using the system I used was intelligent is another |
23:03:30 | FromDiscord | <graveflo> if you can constrain `T` it might work.. but that is weird |
23:04:16 | FromDiscord | <Elegantbeef> It's not that weird, it's just silliness of my code design |
23:04:47 | FromDiscord | <graveflo> well maybe, but that doesn't mean much unless you want it to LOL |
23:05:10 | FromDiscord | <graveflo> maybe it has something to do with `Element` being a concept. oh well |
23:05:33 | FromDiscord | <albassort> https://www.eurogamer.net/when-the-developers-of-dwarf-fortress-die-a-museum-gets-the-game#:~:text=When%20the%20developers%20of%20Dwarf%20Fortress%2C%20one%20of%20the%20most,creator%20Tarn%20Adams%20told%20Eurogamer. |
23:05:40 | FromDiscord | <Elegantbeef> I mean I am afterall doing `type HorizontalSliderBase[Base, T] = ref object of Element[T]` 😄 |
23:05:40 | FromDiscord | <Elegantbeef> Or whateve |
23:06:17 | FromDiscord | <Elegantbeef> Sorry that's `ref object of Base` |
23:06:20 | FromDiscord | <leorize> elm-style state manipulation is probably the key here |
23:06:41 | FromDiscord | <Elegantbeef> Those are words |
23:07:45 | FromDiscord | <graveflo> I still want to propose a change to generic inheritance but I haven't worked up the audacity to make an RFC yet |
23:17:46 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
23:18:15 | FromDiscord | <Elegantbeef> https://github.com/beef331/gooey/blob/master/example/sdlimpl.nim#L191-L197 |
23:18:23 | FromDiscord | <Elegantbeef> I do not have a min example |
23:21:24 | FromDiscord | <Elegantbeef> I think it's safe to say I shall never be given a type system |
23:27:18 | FromDiscord | <auxym> In reply to @pmunch "Maybe I can finally": It's bindings to tinyusb, which doesn't support anything AVR, unfortunately (https://docs.tinyusb.org/en/latest/reference/supported.html#supported-mcus). I just re-implemented the descriptors in Nim (bunch of constants and object types) in Nim, because TinyUSB heavily uses a mess of C macros for those. |
23:28:03 | FromDiscord | <auxym> I guess you'd need bindings to V-USB rather, since attiny doesn't have USB hardware peripheral |
23:28:13 | * | advesperacit quit () |
23:29:11 | * | azimut joined #nim |
23:29:20 | FromDiscord | <pmunch> Ah crap, I mixed up my libraries |
23:29:49 | FromDiscord | <srabb> how do i do syntax highlighting on matrix |
23:30:07 | FromDiscord | <Elegantbeef> Depends on your client, but you just use normal markdown |
23:30:27 | FromDiscord | <srabb> i use element |
23:30:28 | FromDiscord | <Elegantbeef> so three backticks before and after and the language after the first three |
23:30:31 | FromDiscord | <Elegantbeef> Though element infers language |
23:31:45 | FromDiscord | <srabb> sent a code paste, see https://play.nim-lang.org/#ix=html> |
23:31:45 | FromDiscord | <srabb> oh it works |
23:31:48 | FromDiscord | <Elegantbeef> Indeed |
23:47:22 | FromDiscord | <graveflo> In reply to @Elegantbeef "https://github.com/beef331/gooey/blob/master/exampl": did you intentionally re-declare `Element` in both `gooey.nim` and `sdlimpl.nim` ? |
23:49:45 | FromDiscord | <Elegantbeef> Yes |
23:50:05 | FromDiscord | <graveflo> ok just checking bc you said it a concept but linked a module where it isn't a concept |
23:50:39 | FromDiscord | <Elegantbeef> Right cause sdlimpl implements |
23:50:50 | FromDiscord | <Elegantbeef> Gooey is agnostic |
23:50:58 | FromDiscord | <Elegantbeef> sdlimpl solidifies that agnosticism |
23:51:24 | FromDiscord | <Elegantbeef> I guess it's more correct to say it removes that agnosticism |
23:51:31 | FromDiscord | <Elegantbeef> Given what "agnostic" means 😄 |
23:54:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |