00:01:55 | FromDiscord | <Forest> Is it possible to use asynchronous code and multiprocessing at once? Would it be better to stick to one or would utilising both be a good idea? I'm working on a (small) implementation of an MC server that should be as fast as possible |
00:05:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
00:28:00 | FromDiscord | <Elegantbeef> You can use async with multithreading though it might make it more annoying to debug |
00:42:35 | FromDiscord | <IsaacPaul> damn std/wrapnils is .... meh |
00:43:25 | FromDiscord | <Elegantbeef> What's meh about it? |
00:44:02 | FromDiscord | <Forest> Ah okay, thanks! |
00:48:44 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3J53 |
00:49:54 | FromDiscord | <Elegantbeef> I mean the default should be an optional |
00:50:08 | FromDiscord | <Elegantbeef> But i dont really see the issue with the syntax |
00:50:32 | FromDiscord | <Elegantbeef> I also dont use references much so i'm the wrong person 😀 |
00:52:20 | FromDiscord | <IsaacPaul> from the docs it seems like its not an optional unless assigned to one.. I would rather it just not work lmbo |
00:52:45 | FromDiscord | <Elegantbeef> I more mean "It should've been default to begin with" |
00:52:59 | FromDiscord | <Elegantbeef> there is the `??` variant which returns an optional |
00:54:54 | FromDiscord | <IsaacPaul> yea that variant for my use case.. still not happy with syntax lol like I said meh |
00:55:00 | FromDiscord | <IsaacPaul> works |
00:56:45 | FromDiscord | <Elegantbeef> Suppose it could be done using `[?]` since we cannot do prefix 😀 |
00:56:59 | FromDiscord | <Elegantbeef> Postifx i mean |
00:59:33 | FromDiscord | <Elegantbeef> Perhaps not |
01:00:50 | FromDiscord | <IsaacPaul> hmm it doesn't seem to work for optionally calling functions. Perhaps I'm just misinterpreting it's usecase |
01:06:28 | FromDiscord | <Elegantbeef> `??` returns an optional over the entire tree so if any is nil it returns none else true |
01:07:20 | FromDiscord | <Elegantbeef> I'm abusing unicode to achieve the funny impl https://play.nim-lang.org/#ix=3J5c |
01:13:20 | FromDiscord | <IsaacPaul> hmm |
01:13:40 | FromDiscord | <IsaacPaul> This basically tells me I know nothing about macros lol |
01:14:27 | FromDiscord | <Elegantbeef> Lol |
01:14:37 | FromDiscord | <Elegantbeef> There isnt any reason to use a macro here |
01:15:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J5d |
01:15:17 | FromDiscord | <Elegantbeef> Anyway it's a silly toy really, i was just wanting to see if there was a way to get `[?]` to work |
01:15:35 | FromDiscord | <Elegantbeef> But since `?` is an operator you cannot use it inside `[]` or have a type named it |
01:16:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J5e |
01:17:39 | FromDiscord | <IsaacPaul> honestly if I can get `a.child?.child?.child` to work or `a.child?.childProc()` I'd be happy |
01:18:16 | FromDiscord | <Elegantbeef> Nim doesnt have postfix operators so sadly that cannot |
01:18:25 | FromDiscord | <Elegantbeef> Which is why `?` is prefix |
01:19:37 | FromDiscord | <Elegantbeef> The only postfix operators in nim are `[]``{}` and `` and the last can only be used in exporting |
01:20:18 | FromDiscord | <IsaacPaul> ah so that's why your stuff works |
01:20:40 | FromDiscord | <Elegantbeef> Yep |
01:22:42 | FromDiscord | <Elegantbeef> Oh actually |
01:26:48 | FromDiscord | <Elegantbeef> Thought maybe `?.` might be usable as you want but i think not |
01:29:04 | FromDiscord | <IsaacPaul> I'm playing around with your example.. just to see |
01:29:27 | FromDiscord | <Elegantbeef> It's very much a toy so there be dragons 😛 |
01:35:00 | * | krux02 quit (Remote host closed the connection) |
01:50:48 | FromDiscord | <Elegantbeef> So it seems that type of syntax is possible https://play.nim-lang.org/#ix=3J5o so if you want to make wrap nils like the others it's possible it seems |
02:05:27 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3J5s |
02:05:44 | FromDiscord | <TurtleP> (edit) "https://play.nim-lang.org/#ix=3J5s" => "https://play.nim-lang.org/#ix=3J5t" |
02:06:01 | FromDiscord | <TurtleP> (edit) "https://play.nim-lang.org/#ix=3J5t" => "https://play.nim-lang.org/#ix=3J5u" |
02:15:48 | * | arkurious quit (Quit: Leaving) |
02:59:29 | FromDiscord | <Leonardo da Vinci> Hello!! |
03:02:02 | FromDiscord | <Elegantbeef> Hello |
03:03:22 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "Hello": Are you human? |
03:04:25 | FromDiscord | <that_dude> sent a code paste, see https://play.nim-lang.org/#ix=3J5z |
03:04:36 | FromDiscord | <Elegantbeef> I'm only human on days that end with Y |
03:05:22 | FromDiscord | <Elegantbeef> try `[modify.addr]` |
03:06:05 | FromDiscord | <Elegantbeef> What's the entire error? |
03:06:08 | FromDiscord | <that_dude> same error |
03:06:23 | FromDiscord | <Elegantbeef> Oh did you not `import std/tables`? |
03:06:49 | FromDiscord | <Elegantbeef> If the module calling this doesnt have `tables` imported it'll error |
03:06:59 | FromDiscord | <that_dude> I do have tables imported |
03:07:08 | FromDiscord | <Elegantbeef> Full error then |
03:07:10 | FromDiscord | <that_dude> sent a code paste, see https://play.nim-lang.org/#ix=3J5A |
03:07:15 | FromDiscord | <Elegantbeef> Yea it's a tables import issue |
03:07:28 | FromDiscord | <Elegantbeef> inside this module do you have `std/tables` imported? |
03:07:31 | FromDiscord | <that_dude> Yeah |
03:07:31 | * | rockcavera quit (Remote host closed the connection) |
03:07:39 | FromDiscord | <Elegantbeef> The one calling or the one with the macro? |
03:07:48 | FromDiscord | <that_dude> The one with the macro |
03:07:58 | FromDiscord | <Elegantbeef> do `export tables` in that module |
03:08:15 | FromDiscord | <that_dude> where should I put it? |
03:08:31 | FromDiscord | <Elegantbeef> Anywhere after you import tables |
03:08:31 | FromDiscord | <that_dude> right under the import? |
03:08:39 | FromDiscord | <Elegantbeef> That's preferable |
03:09:06 | FromDiscord | <Elegantbeef> The issue is that you dont have `[]` in the module that imports this so it doesnt know how to do `table[key]` |
03:09:27 | FromDiscord | <that_dude> I think I understand |
03:09:47 | FromDiscord | <that_dude> could this also have been fixed if I imported tables in the other module? |
03:09:52 | FromDiscord | <Elegantbeef> Yes |
03:10:00 | FromDiscord | <Elegantbeef> Afterall that's what you're doing |
03:11:24 | * | stosby joined #nim |
03:11:25 | FromDiscord | <that_dude> Cool. |
03:11:28 | FromDiscord | <that_dude> Will prob be back |
03:11:37 | FromDiscord | <Elegantbeef> This is the second import issue today |
03:11:49 | FromDiscord | <Elegantbeef> Seems to be common recently |
03:12:38 | FromDiscord | <that_dude> Well from what I could understand, the error said that the method to get the value doesn't exist, but I had already done the correct import |
03:13:15 | * | stosby quit (Read error: Connection reset by peer) |
03:13:20 | FromDiscord | <that_dude> I'm assuming it's because its a macro specific thing that tried to put code that required tables in the file that doesn't have them |
03:13:20 | FromDiscord | <Elegantbeef> The issue is cause of where the code is emitted |
03:13:39 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "I'm only human on": I don't understand Mr bot |
03:13:46 | FromDiscord | <Elegantbeef> I'm not a robot |
03:13:53 | FromDiscord | <Elegantbeef> I'm a human using the matrix bridge |
03:14:02 | FromDiscord | <impbox [ftsf]> that's just what a robot would say |
03:14:14 | FromDiscord | <that_dude> He's a robot, but a damn good one |
03:14:17 | FromDiscord | <Elegantbeef> Impbox more like shitbox amirite! |
03:14:24 | FromDiscord | <impbox [ftsf]> better than human |
03:14:39 | FromDiscord | <impbox [ftsf]> rude bot! |
03:14:48 | FromDiscord | <Elegantbeef> Bad bot bad? |
03:14:54 | FromDiscord | <Rika> unplug him! |
03:16:09 | FromDiscord | <Elegantbeef> I have internal batteries something about mitochondria being the powerhouse of the cell |
03:16:37 | FromDiscord | <Rika> remove his mitochondria! |
03:17:10 | FromDiscord | <Elegantbeef> We're going to be here for a while |
03:17:45 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3J5D |
03:18:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J5E |
03:18:33 | FromDiscord | <Elegantbeef> Though that allocates so not ideal |
03:18:55 | FromDiscord | <Rika> i mean its the smae |
03:18:56 | FromDiscord | <Rika> same |
03:19:13 | FromDiscord | <Rika> its close enough i mean |
03:19:28 | FromDiscord | <Elegantbeef> Yea if you care about allocations then you'll need your own |
03:19:29 | FromDiscord | <TryAngle> does it also allocates in use with arrays? |
03:19:30 | FromDiscord | <Rika> if you want an iterator beef is probably typing one up rioght now |
03:19:39 | FromDiscord | <Elegantbeef> Lol |
03:19:45 | FromDiscord | <Elegantbeef> I could be but i wasnt at the moment |
03:19:49 | FromDiscord | <Elegantbeef> So many libraries offer it i reason |
03:19:54 | FromDiscord | <Rika> never know with you you code monkey |
03:20:01 | FromDiscord | <Rika> smh |
03:20:35 | FromDiscord | <Elegantbeef> Yea i do write a lot of stupid code |
03:20:41 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3J5F |
03:20:43 | FromDiscord | <Elegantbeef> And then there's the code i share here |
03:20:45 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Yea i do write": don't we all 😔 |
03:21:04 | FromDiscord | <Elegantbeef> Ugh i'm trying herbsluftwm now and oh boy is it an experience |
03:21:05 | FromDiscord | <Rika> yeah given that attitude |
03:21:14 | FromDiscord | <Rika> you're trying what |
03:21:31 | FromDiscord | <Elegantbeef> A dynamic tiling window manager 😛 |
03:21:32 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Ugh i'm trying herbsluftwm": oh, what is it like, I want to switch to that exact wm when I finally build my new pc next month |
03:21:40 | FromDiscord | <TryAngle> heard only good things |
03:21:47 | FromDiscord | <Elegantbeef> It's pretty nifty so far i like some of the things it has |
03:21:57 | FromDiscord | <Elegantbeef> I3wm always pissed me off with it's static tiling |
03:22:03 | FromDiscord | <TryAngle> I had bspwm before but had some issues |
03:22:17 | FromDiscord | <Elegantbeef> Bspwm takes too much setup from my brief toying |
03:22:27 | FromDiscord | <Rika> me, still using a floater: |
03:22:27 | FromDiscord | <Elegantbeef> Also following in pmunch's path using xlunch a s my launcher |
03:22:39 | FromDiscord | <Elegantbeef> Herbs has some cool floating functionality |
03:22:50 | FromDiscord | <Rika> ~~though to be fair i am blind as fuck so i need to make everything fullscreen~~ |
03:22:53 | FromDiscord | <TryAngle> I saw a lot of herbstluft on r/unixporn |
03:22:55 | FromDiscord | <Elegantbeef> You can move floating windows to corners with the keyboard and grow them out |
03:23:14 | FromDiscord | <Rika> im not good at sizing things with a keyboard, best i can do is just swapping things |
03:23:31 | FromDiscord | <Rika> i really rather the precision of a mouse when i resize things |
03:24:54 | FromDiscord | <Elegantbeef> Ah i dont often float but when i do i want it out of my way |
03:25:25 | FromDiscord | <Rosen> herbstluftwm is so cool! |
03:25:38 | FromDiscord | <Rosen> The built in hooks shit was fun to use to build a custom bar using lemonbar |
03:26:35 | FromDiscord | <Elegantbeef> I still need to theme mine and setup a better status bar, but this is what i'm talking about rika https://streamable.com/wanhge |
03:27:01 | FromDiscord | <TryAngle> In reply to @Elegantbeef "I still need to": do u use a compositor too? |
03:27:04 | FromDiscord | <Rika> oh interesting, logarithmic sizing |
03:27:15 | FromDiscord | <Elegantbeef> Using picom yes |
03:27:20 | * | noeontheend joined #nim |
03:27:30 | FromDiscord | <Elegantbeef> I like my transparent windows |
03:27:35 | FromDiscord | <TryAngle> nvidia gpu? |
03:27:41 | FromDiscord | <Elegantbeef> Amd |
03:27:45 | FromDiscord | <TryAngle> ah I see |
03:28:12 | FromDiscord | <Elegantbeef> There are some weird things like the way tags work |
03:28:22 | FromDiscord | <Elegantbeef> I havent figured out how to open a window where my mouse is |
03:28:34 | FromDiscord | <Elegantbeef> On an empty tag i should say |
03:33:05 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3J5H |
03:33:30 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3J5H" => "https://play.nim-lang.org/#ix=3J5I" |
03:33:35 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3J5I" => "https://play.nim-lang.org/#ix=3J5J" |
03:39:57 | FromDiscord | <TryAngle> nvm fixed it forgot a decimal point... |
03:40:38 | FromDiscord | <TryAngle> wait it doesn't fix it 🤔 |
03:40:54 | FromDiscord | <Rika> i'd love to switch but i like fancy animations so xd dont think im moving away from kde any time soon |
03:41:03 | FromDiscord | <Rika> what issue are we talking about |
03:41:59 | FromDiscord | <TryAngle> I deleted bc I thought I fixed it but I didn't lol |
03:43:03 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/y6B |
03:43:25 | FromDiscord | <Rika> `for (neuronWeights, neuronBias) in zip(weights, biases):` |
03:43:27 | FromDiscord | <Rika> how about now |
03:43:32 | FromDiscord | <Rika> same with the other zip |
03:43:48 | FromDiscord | <Elegantbeef> just do `zip(weight, biases).pairs` |
03:44:30 | FromDiscord | <TryAngle> ah I see thanks u two both ways work 👍 |
03:47:02 | FromDiscord | <Elegantbeef> Actually pairs might not work |
03:47:13 | FromDiscord | <Elegantbeef> Since that's what it implicitly called |
03:47:41 | FromDiscord | <TryAngle> how do I run a nim project in release?↵`nimble run -release`↵? |
03:47:55 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Since that's what it": it gave no syntax error highlight at least |
03:47:56 | FromDiscord | <Rika> i dont know how nimble run works |
03:48:01 | FromDiscord | <Rika> try -d:release nonetheless |
03:48:25 | FromDiscord | <Rika> In reply to @TryAngle "it gave no syntax": well because its a logic error, which isnt usually caught 😛 |
03:48:31 | FromDiscord | <TryAngle> how do I know if it works ?xd↵use a when one time? |
03:48:43 | FromDiscord | <Rika> In reply to @TryAngle "how do I know": it should say that its a release build |
03:49:09 | FromDiscord | <TryAngle> https://media.discordapp.net/attachments/371759389889003532/923059556593053756/unknown.png |
03:49:19 | FromDiscord | <Rika> i dont know |
03:49:23 | FromDiscord | <Rika> i dont build with nimble |
03:50:45 | FromDiscord | <TryAngle> 🤔 |
03:51:22 | FromDiscord | <Elegantbeef> `nimble run` makes a release |
03:52:03 | FromDiscord | <TryAngle> ah wow didn't expect that bc compile time is so fast o_O |
03:52:43 | FromDiscord | <Elegantbeef> Well if you want the full compile time do `nimble run -f` |
03:52:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
03:53:25 | FromDiscord | <Rika> would be funny if its still considered fast to them |
03:54:07 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Well if you want": that didnt' do anything o.o |
03:56:45 | FromDiscord | <Elegantbeef> Should've force a recompilation, so maybe nimble doesnt take all commands |
04:03:05 | FromDiscord | <TryAngle> well its a small programm and I'm used to rust |
04:03:12 | FromDiscord | <TryAngle> (edit) "well its a small programm and I'm used to rust ... " added "compile times" |
04:19:27 | * | noeontheend joined #nim |
04:22:16 | FromDiscord | <Roundlay> Trying to write a wrapper for some stuff in a TypeScript API. Anyone know of any examples demonstrating how to do this? Specifically wrapping classes? |
04:24:44 | FromDiscord | <TryAngle> In reply to @Roundlay "Trying to write a": https://github.com/saem/vscode-nim/tree/main/src/platform↵not sure if this applies to your case but the vscode-nim plugin from saem wrapped parts of vscode api |
04:26:46 | FromDiscord | <Roundlay> In reply to @TryAngle "https://github.com/saem/vscode-nim/tree/main/src/pl": Thank you very much |
04:26:48 | FromDiscord | <Roundlay> Looks good |
04:29:49 | FromDiscord | <TryAngle> how do I export a module that the module has to be called explicitly? |
04:30:15 | FromDiscord | <Elegantbeef> Uhh what? |
04:30:24 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3J5N |
04:30:38 | FromDiscord | <TryAngle> because if I export A, I export all contents of A |
04:30:50 | FromDiscord | <Elegantbeef> You can export selective parts |
04:33:12 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3J5O |
04:33:23 | FromDiscord | <TryAngle> something like that |
04:33:43 | FromDiscord | <TryAngle> so I can ignore module3 in some parts, but import it in other modules for example |
04:34:10 | FromDiscord | <Elegantbeef> make library import all modules then just make the user do `library/[module1, module2]` for selective |
04:34:47 | FromDiscord | <TryAngle> ah so if I don't export I can still import? |
04:36:32 | FromDiscord | <TryAngle> hmm doesn't work 🤔 |
04:36:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J5P |
04:37:05 | FromDiscord | <Elegantbeef> Then for importing selectively you just do `import library/[module1, module2]` |
04:38:23 | FromDiscord | <Elegantbeef> Hopefully i understood the question |
04:40:22 | FromDiscord | <Elegantbeef> Or are you after forcing namespaces? |
04:42:23 | FromDiscord | <Elegantbeef> You cannot fake import paths so you just need the package structure to match your import want, hopefully i dont drone on about non-issues 😀 |
04:43:33 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Or are you after": kinda |
04:43:47 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Then for importing selectively": hmmm I still get file not found error 🤔 |
04:45:01 | FromDiscord | <Elegantbeef> Is this on a repo? |
04:46:14 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Is this on a": not yet but I can quickly make it one |
04:46:39 | FromDiscord | <Elegantbeef> Also what type of API are you after when using this, cause i'm lost |
04:59:27 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Also what type of": well basically I want to make a personal science library where I can implement things I learned in university or that interest me personally so I can reuse them etc.↵For example when I add an alignment algorithm under the module library/bio, I'd like to import it via library/bio↵because in that library I also implement concepts and procs for abstract algebra under library/algebra which |
05:01:29 | FromDiscord | <Elegantbeef> I feel like that's what the `from X import Y` is for |
05:01:44 | FromDiscord | <Elegantbeef> Export everything you want and if you want selective imports, import selectively |
05:01:54 | FromDiscord | <Elegantbeef> Or you can make a file that only exports what you want as an intermediate |
05:02:08 | FromDiscord | <TryAngle> but wouldn't that require me to import every type and function that one algorithm under bio uses? |
05:02:17 | FromDiscord | <TryAngle> (edit) "uses?" => "uses manually?" |
05:02:37 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Or you can make": that sounds good |
05:03:14 | FromDiscord | <TryAngle> In reply to @Elegantbeef "What i'd suggest is": but the weird thing is, I tried that here but I get an error that library/module1 does not exist |
05:03:24 | FromDiscord | <TryAngle> does it not work for tests? |
05:03:58 | FromDiscord | <Elegantbeef> It's hard to say what's wrong |
05:04:15 | FromDiscord | <Elegantbeef> I can only imagine your package isnt installed or your tests dont move to that path |
05:05:19 | FromDiscord | <TryAngle> hmmm I try from other nimble project then |
05:05:28 | FromDiscord | <TryAngle> (edit) "hmmm I try ... from" added "that" |
05:05:35 | FromDiscord | <TryAngle> (edit) "hmmm I try that from other nimble project then ... " added "instead of the tests folder" |
05:06:11 | FromDiscord | <TryAngle> but hahha anaother thing I don't know and couldn't find 🥲 ↵what would be the way to import a local nimble project into another nimble project? |
05:06:14 | FromDiscord | <Elegantbeef> does your test folder have a `config.nims`? |
05:07:03 | FromDiscord | <TryAngle> In reply to @Elegantbeef "does your test folder": .... |
05:07:04 | FromDiscord | <Elegantbeef> I generally just do `nimble develop` in the nimble library I want then just use it as it's there |
05:07:04 | FromDiscord | <TryAngle> ... |
05:07:06 | FromDiscord | <TryAngle> .... |
05:07:08 | FromDiscord | <TryAngle> that was the issue |
05:07:12 | FromDiscord | <TryAngle> the config.nims |
05:07:14 | FromDiscord | <TryAngle> XD |
05:07:41 | FromDiscord | <TryAngle> so it was correct all along 😅 |
05:07:42 | FromDiscord | <Elegantbeef> `nimble develop` symlinks a package in your installed packages to that folder |
05:07:46 | FromDiscord | <Elegantbeef> Indeed |
05:11:29 | FromDiscord | <TryAngle> thanks for helping me once again 👍 |
05:11:37 | FromDiscord | <Elegantbeef> No problem |
05:28:59 | FromDiscord | <Sabena Sema> why is there no anon inline object defn syntax (like for tuples) |
05:29:06 | FromDiscord | <Sabena Sema> does having that break something? |
05:29:30 | FromDiscord | <Elegantbeef> You can define them in any scope so it's not a big deal |
05:29:33 | FromDiscord | <Elegantbeef> Or atleast most scopes |
05:29:42 | FromDiscord | <IsaacPaul> In reply to @Elegantbeef "It's very much a": I got something semi-semi-working https://play.nim-lang.org/#ix=3J5Z though garbage collection crashes on the cpp backend.. I would work on it more but I gotta sleep. ✌️ |
05:29:44 | FromDiscord | <Sabena Sema> well, they need a name |
05:30:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J60 |
05:30:23 | FromDiscord | <Sabena Sema> and you cant define them inside another object defn, or as a return type |
05:30:48 | FromDiscord | <Sabena Sema> ofc since they dint structurally convert doing them as a return type would be… not so useful |
05:30:55 | FromDiscord | <Sabena Sema> (edit) "dint" => "dont" |
05:31:51 | FromDiscord | <Elegantbeef> Leorize's union does anonymous objects similar to this so if interested could look there |
05:32:27 | FromDiscord | <Sabena Sema> link? |
05:34:03 | FromDiscord | <Elegantbeef> https://github.com/alaviss/union |
05:34:28 | FromDiscord | <Elegantbeef> It uses a template/macro to generate and reference the type |
05:38:05 | FromDiscord | <ajusa> anyone here used https://github.com/jart/cosmopolitan/? |
05:38:46 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3J62 |
05:43:00 | FromDiscord | <Elegantbeef> @IsaacPaul\: dont forget to pass the node to `error` to be even more helpful https://play.nim-lang.org/#ix=3J64 |
05:45:03 | FromDiscord | <IsaacPaul> Ah I didn’t know that |
05:46:26 | FromDiscord | <Elegantbeef> It gives the lineinfo of the nimnode to things like nimcheck |
05:46:26 | FromDiscord | <Elegantbeef> So it's great for things like codelens with vscode |
05:50:42 | * | mahlon quit (Ping timeout: 256 seconds) |
05:54:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
06:00:26 | NimEventer | New Nimble package! mcu_utils - Utilities and simple helpers for programming with Nim on embedded MCU devices, see https://github.com/EmbeddedNim/mcu_utils |
06:07:18 | FromDiscord | <that_dude> sent a code paste, see https://play.nim-lang.org/#ix=3J69 |
06:07:25 | FromDiscord | <that_dude> (edit) "https://play.nim-lang.org/#ix=3J69" => "https://play.nim-lang.org/#ix=3J6a" |
06:07:32 | FromDiscord | <that_dude> (edit) |
06:07:41 | FromDiscord | <Elegantbeef> `pointer` is a typeless pointer |
06:07:50 | FromDiscord | <Elegantbeef> You need to decay that pointer for that array |
06:08:12 | FromDiscord | <that_dude> How would I do that? |
06:08:21 | FromDiscord | <Rika> Cast |
06:08:22 | FromDiscord | <Sabena Sema> you can cast it |
06:08:32 | FromDiscord | <that_dude> but to what? just pointer? |
06:08:36 | FromDiscord | <Sabena Sema> yeah |
06:08:55 | FromDiscord | <that_dude> something like `cast[pointer](var)` |
06:08:57 | FromDiscord | <that_dude> (edit) "`cast[pointer](var)`" => "`cast[pointer](var)`?" |
06:09:13 | FromDiscord | <Sabena Sema> yep |
06:09:19 | FromDiscord | <that_dude> Cool |
06:09:19 | FromDiscord | <Sabena Sema> `ptr` alone is a typeclass! |
06:09:29 | FromDiscord | <Sabena Sema> kinda confusing, indeed |
06:11:03 | FromDiscord | <Elegantbeef> You an just do `pointer yourPtrT` |
06:11:23 | FromDiscord | <Sabena Sema> as a dot style cast? |
06:11:38 | FromDiscord | <Elegantbeef> Yes |
06:11:40 | FromDiscord | <Sabena Sema> is that more restrictive |
06:11:45 | FromDiscord | <Elegantbeef> Cleaner |
06:11:54 | FromDiscord | <Sabena Sema> definitely |
06:14:24 | FromDiscord | <that_dude> Why (ast wise) is there a distinction between call, command, infix, and the sort? |
06:14:44 | FromDiscord | <that_dude> Just curious |
06:15:00 | FromDiscord | <that_dude> They seem to be formatted and behave the same |
06:17:09 | FromDiscord | <Rika> Same semantics different syntax |
06:17:19 | FromDiscord | <Rika> Abstract syntax tree |
06:18:01 | FromDiscord | <Elegantbeef> The difference is mostly just at a parser level |
06:18:10 | FromDiscord | <that_dude> I guess, but I though it goes user code -> ast -> compiler. And the compiler doesn't really need to make a distinction if they behave the same |
06:18:34 | FromDiscord | <that_dude> I guess it doesn't matter as long as it works |
06:18:52 | FromDiscord | <Elegantbeef> it's like expressions vs statements |
06:19:31 | FromDiscord | <Sabena Sema> yeah, and when codegen happens I'm sure each node calls the same codegen function |
06:19:43 | FromDiscord | <Sabena Sema> (edit) "calls" => "causes" | "causesthe same codegen function ... " added "to be called" |
06:19:49 | FromDiscord | <Elegantbeef> I can confirm |
06:20:45 | FromDiscord | <Sabena Sema> there are some differences between the syntaxes too, you can overload `.` |
06:21:02 | FromDiscord | <Sabena Sema> and do dirty, dirty syntax dependent things with trmacros |
06:21:19 | FromDiscord | <Elegantbeef> Hey dont call it dirty! |
06:21:29 | FromDiscord | <Sabena Sema> they are useful |
06:23:23 | FromDiscord | <Sabena Sema> Plutonium is useful too, but I don't wanna handle it day-to-day |
06:23:38 | FromDiscord | <Elegantbeef> Let's be honest no one is really using TRM |
06:23:41 | FromDiscord | <Elegantbeef> As cool as they're |
06:24:11 | FromDiscord | <Sabena Sema> They are just soooo dangerous |
06:24:33 | FromDiscord | <Sabena Sema> and a good indication a feature might best live in the compiler itself 😄 |
06:24:34 | FromDiscord | <that_dude> Lol "With great power comes great responibility" |
06:24:37 | FromDiscord | <Elegantbeef> And they're going to get ripped out in Nim2.0 apparently |
06:25:11 | FromDiscord | <that_dude> (edit) "responibility"" => "responsibility"" |
06:34:30 | FromDiscord | <that_dude> What are the benefits to using `func` instead of `proc`? I get it's more limited by marking it with no side effects ie can't access variables outside of the parameters, but what does it gain in exchange for this? |
06:35:00 | FromDiscord | <Elegantbeef> Having an easier tested api, that you know doesnt rely on external data |
06:35:26 | FromDiscord | <Sabena Sema> in theory better optimization |
06:35:34 | FromDiscord | <Sabena Sema> but ... in theory |
06:35:59 | FromDiscord | <Sabena Sema> it'll cause a compile error if any of the called functions change to start messing with external data |
06:36:27 | FromDiscord | <that_dude> So to simplify procs to make them easier to think about/test. But not much else is gained right? |
06:37:03 | FromDiscord | <that_dude> fair enough |
06:40:18 | FromDiscord | <Elegantbeef> It's more "pure" and as the name implies functional |
06:43:39 | FromDiscord | <Yardanico> https://forums.swift.org/t/a-roadmap-for-improving-swift-performance-predictability-arc-improvements-and-ownership-control/54206 a lot of similar stuff to Nim :) |
06:44:19 | FromDiscord | <Yardanico> they changed to lexical lifetimes, added `move`, `consuming` for me looks like `sink` |
06:46:15 | FromDiscord | <Yardanico> and more stuff |
06:54:59 | FromDiscord | <impbox [ftsf]> In reply to @that_dude "So to simplify procs": nice thing about funcs is that you can be sure that caching the input->output is safe |
06:55:24 | FromDiscord | <impbox [ftsf]> same inputs will always give the same outputs |
06:55:49 | FromDiscord | <that_dude> I see |
06:56:14 | FromDiscord | <Yardanico> unless you have `var T` arguments in your func, but they're explicit so it's easy to see them |
06:56:33 | FromDiscord | <Yardanico> or some types that are `ref object`, but with `strictFuncs` nim also checks for deep immutability with refs |
06:57:08 | FromDiscord | <impbox [ftsf]> hmm yeah I guess that's not true for a ref type where what the object the ref points to might have changed between calls |
06:57:44 | FromDiscord | <Elegantbeef> Eh it's true with strict funcs |
06:58:09 | FromDiscord | <Elegantbeef> Cannot mutate any part of a reference that is passed in as immutable when strict funcs is on |
06:58:54 | FromDiscord | <impbox [ftsf]> no but it might have been mutated between calls |
06:59:24 | FromDiscord | <Elegantbeef> How does that change anything |
07:01:20 | FromDiscord | <Yardanico> In reply to @impbox "no but it might": that's not the point of funcs :) |
07:01:36 | FromDiscord | <Yardanico> and it doesn't really apply to refs, it applies to everything |
07:01:53 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3J6g |
07:01:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J6h |
07:02:07 | FromDiscord | <Elegantbeef> The thing about function is they're pure, the same input data, gives you the same output data |
07:02:35 | FromDiscord | <Elegantbeef> The fact they dont give the same values doesnt matter, it's like having a mathematical formula and applying it to random numbers |
07:02:53 | FromDiscord | <Elegantbeef> The output will be different but if you pass the same number you'll always get the same output |
07:16:09 | FromDiscord | <KatrinaKitten> What's the best way to track down potential memory leaks? `valgrind` reports my unit tests leaking about 4kb, but it's hard to tell where from. |
07:17:05 | FromDiscord | <Elegantbeef> You did compile with `-d:useMalloc` right? |
07:17:20 | FromDiscord | <Elegantbeef> Or are you doing manual memory management |
07:17:33 | FromDiscord | <Elegantbeef> Guess eitherway using malloc helps |
07:18:10 | FromDiscord | <KatrinaKitten> `nim c -d:release -d:useMalloc --opt:speed tests/test.nim` |
07:18:17 | FromDiscord | <KatrinaKitten> Same leak reported with or without `useMalloc` |
07:18:45 | FromDiscord | <Elegantbeef> pass `--debugger:native` aswell |
07:19:14 | FromDiscord | <sigmasd> nimsuggest 1.6.2 `nimsuggest --autobind --address:localhost` fails with `Additional info: Name does not resolve [OSError]` it works after removing `--address:localhost`nimsuggest 1.4.8 the same line used to workIs this a known issue? |
07:19:17 | FromDiscord | <Elegantbeef> That will hopefully give atleast some line information |
07:21:05 | FromDiscord | <Elegantbeef> Wonder if there was a change in a library which broke localhost, does "127.0.0.1" work in it's stead? |
07:21:09 | FromDiscord | <Elegantbeef> Guess i could test 😀 |
07:21:55 | FromDiscord | <Elegantbeef> Hmm mine doesnt error |
07:22:10 | FromDiscord | <Elegantbeef> What OS are you on and are you sure your `nimsuggest -v` is 1.6.2? |
07:25:46 | FromDiscord | <Elegantbeef> Just noticed my nimsuggest is built in danger so probably just ignores that error |
07:26:56 | FromDiscord | <Elegantbeef> Actually that's an `OsError` not a defect, maybe i'll be a smart person one day |
07:27:05 | FromDiscord | <Elegantbeef> Anywho cannot reproduce here |
07:30:06 | FromDiscord | <Solitude> In reply to @Sabena Sema "so why copy them": they dont, i made a mistake in a benchmark |
07:30:28 | FromDiscord | <Sabena Sema> phew |
07:30:30 | FromDiscord | <Sabena Sema> saved |
07:30:38 | FromDiscord | <Sabena Sema> I'll still make the full benchmark at some point |
07:31:05 | FromDiscord | <Sabena Sema> good opertunity to learn how to gather that kind of benchmark data on non-intel systems (where vtune doesn't really work) |
07:32:56 | FromDiscord | <sigmasd> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: arch linux, and yes I'm sure about the version, I noticied this when the vim extension stopped working |
07:33:26 | FromDiscord | <Sabena Sema> I'd bet money something changed in your sd-resolved conf |
07:33:43 | FromDiscord | <Sabena Sema> there's several places where localhost can get turned into your actual IP |
07:33:57 | FromDiscord | <KatrinaKitten> sent a code paste, see https://play.nim-lang.org/#ix=3J6r |
07:34:31 | FromDiscord | <KatrinaKitten> There are also a few from `unittest` that don't even show my library in the trace. |
07:34:32 | FromDiscord | <Sabena Sema> top level compiled regex? |
07:34:52 | FromDiscord | <Sabena Sema> in general I'm not sure if nim bothers freeing top level allocations when NimMain exits |
07:35:00 | FromDiscord | <Sabena Sema> I think there's an option to tell it to make valgrind happy |
07:35:02 | FromDiscord | <Sabena Sema> one sec |
07:35:32 | FromDiscord | <Sabena Sema> (you generally don't want to free memory right before exiting, it's much more efficient to just let the OS deal with it |
07:35:34 | FromDiscord | <Sabena Sema> (edit) "it" => "it)" |
07:35:51 | FromDiscord | <Elegantbeef> Time to use the better pure Nim regex 😛 |
07:35:54 | FromDiscord | <sigmasd> Just to explain more, the arch linux package manager uses nim-sugesst 1.4.8 so I had no issue, but then I noticed that nim-doc doesn't play well with this structure (it looks for in-existant files under /usr/doc (its a known issue)) so I removed that nim installation, and installed thorough choosenim which makes nim-docs work now, but it uses this recent version of nimsuggest which has this issue |
07:36:20 | FromDiscord | <Elegantbeef> I oddly cannot reproduce it, does the 1.4.8 through choosenim work? |
07:36:32 | FromDiscord | <sigmasd> also if I strace it, it errors right after reading /etc/resolv.conf |
07:36:54 | FromDiscord | <sigmasd> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: I'll check that |
07:37:58 | FromDiscord | <Sabena Sema> https://github.com/nim-lang/Nim/issues/3063 |
07:38:10 | FromDiscord | <Solitude> In reply to @treeform "Do you have benchmarks": benchmarks i did prove that small objects dont have a meaningful impact even when passed by copy, and passing by reference or using reference type doesnt bring meaningful speedup. and that would make sense. |
07:38:47 | FromDiscord | <Sabena Sema> it is easy to accidentally get copies in like, actual assignment statements |
07:39:02 | FromDiscord | <Sabena Sema> but the semantics are wildly different between ref assignment and value assignment |
07:39:40 | FromDiscord | <Sabena Sema> `ref object` is just my little hobby horse, I need one in each language I learn 😄 |
07:39:44 | FromDiscord | <sigmasd> Same error with 1.4.8 via choosenim |
07:40:07 | FromDiscord | <sigmasd> Well if its not reproducible its not a big deal I guess, since it works after removing those arguments |
07:40:32 | FromDiscord | <Sabena Sema> I bet your dns config is kinda broken in any case |
07:40:41 | FromDiscord | <Sabena Sema> localhost really should resolve |
07:41:01 | FromDiscord | <sigmasd> Ah wait 1.4.8 shows the error if installed via choosenim |
07:41:07 | FromDiscord | <sigmasd> but if installed via arch it works |
07:41:10 | FromDiscord | <Sabena Sema> what does `getent hosts localhosts` print |
07:41:20 | FromDiscord | <sigmasd> so its not about the version ,, more about where its installed from |
07:41:29 | FromDiscord | <Sabena Sema> that's extremely odd |
07:41:42 | FromDiscord | <Sabena Sema> unless there's a bunch of patching going on |
07:41:44 | FromDiscord | <sigmasd> getent hosts localhosts -\> print nothing |
07:42:07 | FromDiscord | <sigmasd> getent hosts localhost -\> print \:\:1 localhost |
07:42:15 | FromDiscord | <Sabena Sema> sorry: `getent hosts localhost` |
07:42:19 | FromDiscord | <Sabena Sema> no s on the end |
07:42:42 | * | sagax quit (Ping timeout: 260 seconds) |
07:43:02 | FromDiscord | <Sabena Sema> also what does `ls -l /etc/resolv.conf` print |
07:44:22 | FromDiscord | <Sabena Sema> and what's the hosts line in /etc/nsswitch.conf |
07:44:29 | FromDiscord | <sigmasd> .rw-r--r-- 45 root 22 Sep 16\:59 /etc/resolv.conf |
07:44:37 | FromDiscord | <sigmasd> hosts\: wins |
07:44:39 | FromDiscord | <Sabena Sema> it should be something like `files myhostname resolve [!UNAVAIL=return] dns` |
07:44:53 | FromDiscord | <Sabena Sema> that's ... pretty broken |
07:44:58 | FromDiscord | <sigmasd> the arch pkg have some patches https://github.com/archlinux/svntogit-community/blob/packages/nim/trunk/PKGBUILD maybe one of them is relevant |
07:45:14 | FromDiscord | <Sabena Sema> in that configuration `gethostbyname` will _never_ make dns lookups |
07:46:15 | FromDiscord | <Sabena Sema> I see no patches there |
07:46:23 | FromDiscord | <Sabena Sema> but ... fix you're resolver config |
07:47:20 | FromDiscord | <sigmasd> Doesnt explain why it works with everything else and with nim when installed through arch |
07:47:41 | FromDiscord | <sigmasd> But thanks I see your points tough I'll search a bit more |
07:47:50 | FromDiscord | <Elegantbeef> Ponders if the installed arch nim has some elevation |
07:47:53 | FromDiscord | <Sabena Sema> run a trace to see how the working one is resolving the name |
07:48:20 | FromDiscord | <Sabena Sema> also check if it's linked to some bizarre c library or something |
07:48:31 | FromDiscord | <Sabena Sema> that means that nss config isn't used |
07:48:46 | FromDiscord | <Sabena Sema> frankly I'm surprised much more isn't broken |
07:49:11 | FromDiscord | <Sabena Sema> do you have the dns resolver running on 127.0.0.53? |
07:49:20 | FromDiscord | <Sabena Sema> what is the actual content of `/etc/resolv.conf` |
07:50:14 | FromDiscord | <valerga> arch's nim is outdated |
07:50:27 | FromDiscord | <Elegantbeef> That's established 😛 |
07:50:34 | FromDiscord | <Elegantbeef> It's outdated pretty much everywhere |
07:50:54 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=3J6t |
07:50:56 | FromDiscord | <Sabena Sema> ugh |
07:51:00 | FromDiscord | <Sabena Sema> cursed |
07:51:16 | FromDiscord | <Sabena Sema> not as cursed as that nss config though |
07:51:27 | FromDiscord | <Elegantbeef> Nim on ubuntu's repo is 1.4.6, damn really outdated |
07:51:51 | FromDiscord | <valerga> is there any disadvantage on just using choosenim? |
07:51:58 | FromDiscord | <Sabena Sema> not really |
07:52:05 | FromDiscord | <Sabena Sema> but it's nice to have distro packages |
07:52:14 | FromDiscord | <Sabena Sema> it's just they are not that maintained= |
07:52:15 | FromDiscord | <Sabena Sema> (edit) "maintained=" => "maintained" |
07:52:52 | FromDiscord | <Elegantbeef> The annoying part about using your system package manager is that you dont always want to run a set version |
07:52:56 | FromDiscord | <sigmasd> I was surpirsed its outdated on arch, they should just keep it on the aur if its not getting their attention |
07:53:21 | FromDiscord | <Sabena Sema> well, you should mark it as outdated and help get it updated |
07:53:27 | FromDiscord | <Sabena Sema> I should do the same for fedora's package |
07:53:28 | FromDiscord | <Sabena Sema> I won't |
07:53:31 | FromDiscord | <Sabena Sema> but I _should_ |
07:54:02 | FromDiscord | <sigmasd> Its already marked |
07:56:10 | FromDiscord | <valerga> the guy who maintains it on arch maintains like 150 other packages so... |
07:57:20 | FromDiscord | <Sabena Sema> package maintainers do tend to be overworked |
07:57:31 | FromDiscord | <Sabena Sema> and nim stuff tends to be leaves with few downstream dependents |
07:57:42 | FromDiscord | <Sabena Sema> the solution is to write more linux userspace in nim |
07:57:51 | FromDiscord | <sigmasd> The problem with this is the information doesn't get through, with arch you really assume that if its an official pkg its updated, when I install through pacman It would be great if a flagged pkg appears as flagged outdated at least |
07:57:55 | FromDiscord | <Sabena Sema> and to maintain more nim packages |
07:59:33 | FromDiscord | <Leonardo da Vinci> hello |
07:59:40 | FromDiscord | <Elegantbeef> Hello again |
07:59:45 | FromDiscord | <Leonardo da Vinci> In reply to @valerga "the guy who maintains": what is the best distro? |
08:00:12 | * | PMunch joined #nim |
08:01:38 | FromDiscord | <Leonardo da Vinci> for gaming |
08:01:58 | FromDiscord | <valerga> I don't have trouble recommending linux mint |
08:02:17 | FromDiscord | <Leonardo da Vinci> i use mx, but it doesn't do well with gaming |
08:02:24 | FromDiscord | <Leonardo da Vinci> (edit) "mx," => "mx linux," |
08:04:12 | FromDiscord | <Michal58> When defining generics, how can I make `MyCollection[N]` behave the same as `MyCollection[range[0..<N]]` as it is with arrays? |
08:04:37 | FromDiscord | <Anis Taluqdar> Windows 😅↵(@Leonardo da Vinci) |
08:04:53 | FromDiscord | <Leonardo da Vinci> In reply to @Anis Taluqdar "Windows 😅 (<@873527032645042266>)": I am not installing that again, never |
08:05:42 | FromDiscord | <Leonardo da Vinci> In reply to @Anis Taluqdar "Windows 😅 (<@873527032645042266>)": My religion forbids the installation of windows |
08:05:45 | FromDiscord | <Anis Taluqdar> What makes you hate that? 😆. I need to use it because not all software is present in Linux.↵(@Leonardo da Vinci) |
08:06:07 | FromDiscord | <Anis Taluqdar> 😅😅😅 amazing↵(@Leonardo da Vinci) |
08:06:19 | FromDiscord | <sigmasd> Ok I fixed the issue I had a weird /etc/hosts file, I restored it to normal and now it works |
08:07:17 | FromDiscord | <sigmasd> Thanks for your help |
08:07:43 | FromDiscord | <sigmasd> This is just a symptom of an old arch installation, I just need to install fedora oneday |
08:08:32 | FromDiscord | <sigmasd> Not arch issue , but Its that I changed a lot of stuff over the time and I keep hitting issues where I forgot what I did xD |
08:10:53 | FromDiscord | <Elegantbeef> Yay we helped! (Mostly sabena) 😛 |
08:11:03 | FromDiscord | <sigmasd> thanks! |
08:12:06 | PMunch | @Leonardo_da_Vinci, I use Arch and Manjaro. Both seem to work fine for gaming |
08:12:19 | PMunch | With Steam and Proton most stuff "just works" nowadays |
08:12:58 | FromDiscord | <Elegantbeef> Oh hay pmunch just the man i want to talk to 😀 |
08:13:11 | PMunch | Uh oh |
08:13:16 | PMunch | What have I done this time |
08:13:17 | FromDiscord | <Elegantbeef> Is there any utillity in xlunch to rebuild the `dsv`?! |
08:13:37 | FromDiscord | <Elegantbeef> I didnt see how to rebuild it so i cloned the repo again and ran `make test` |
08:14:16 | PMunch | Ah yes |
08:14:25 | PMunch | There is the genentries script |
08:14:39 | PMunch | Another thing I've been meaning to rewrite in Nim actually |
08:15:07 | FromDiscord | <Elegantbeef> Ah i moved to herbsluftwm to try something new today so though "why not try that utillity pmunch is using" |
08:15:15 | PMunch | I don't think the original maintainer would approve of a Nim solution, he tries to keep it super minimal, but I could distribute that separately |
08:15:22 | FromDiscord | <Leonardo da Vinci> In reply to @PMunch "@Leonardo_da_Vinci, I use Arch": Cool, gotta get Manjaro then |
08:15:28 | FromDiscord | <Elegantbeef> RRIN 😛 |
08:15:34 | PMunch | @Elegantbeef, cool! |
08:15:36 | PMunch | RRIN? |
08:15:41 | FromDiscord | <Elegantbeef> RIIN\ |
08:16:02 | FromDiscord | <Elegantbeef> Rewrite it in Nim 😛 |
08:16:06 | PMunch | Let me know if you run into any issues or have any questions, I think I've modified almost every single line of that project over the years :P |
08:16:07 | FromDiscord | <Leonardo da Vinci> In reply to @PMunch "With Steam and Proton": is wine good there? |
08:16:09 | PMunch | Aha :P |
08:16:24 | FromDiscord | <Leonardo da Vinci> i can't make anything work in MX Linux |
08:16:29 | FromDiscord | <Elegantbeef> Proton and lutris make life so simple that most games do work like pmunch said |
08:16:31 | PMunch | @Leonardo_da_Vinci, haven't had any Manjaro/Arch specific complaints about it at least |
08:16:38 | FromDiscord | <Elegantbeef> I'm on an ubuntu derived and it works well |
08:16:52 | PMunch | And since it's bleeding edge that means you don't get a year old Wine version you have to replace anyways :P |
08:16:52 | FromDiscord | <sigmasd> Would someone review my first nim try https://github.com/sigmaSd/nimcolor/blob/master/src/color.nim I just want to know if this is idiomatic that I didn't miss anything obvious |
08:17:32 | PMunch | @Elegantbeef, I did consider rewriting xlunch in Nim. It's quite a simple program, but the C code is a horrible mess :P |
08:17:33 | FromDiscord | <Leonardo da Vinci> In reply to @PMunch "And since it's bleeding": Sounds really cool |
08:17:39 | FromDiscord | <Elegantbeef> Anyway to make the first entry the selected one like if i type "stea" and steam is the first i want enter to select it |
08:17:51 | PMunch | It is shadow-selected |
08:18:03 | PMunch | So if you just hit enter it will open the first thing |
08:18:11 | FromDiscord | <Michal58> In reply to @Michal58 "When defining generics, how": Anynone knows? |
08:18:18 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=3J6A |
08:18:29 | FromDiscord | <Elegantbeef> `for x in A..C`? |
08:19:08 | PMunch | @Michal58, I believe arrays have defined a [] operator that takes a HSlice |
08:19:09 | FromDiscord | <Solitude> In reply to @Michal58 "Anynone knows?": can you give a bit more context? |
08:19:26 | FromDiscord | <Elegantbeef> Enum's are an ordinal so work as a Range |
08:19:29 | PMunch | Along with the one that takes an integer index |
08:19:31 | FromDiscord | <Elegantbeef> You can also do `for x in MyEnum` |
08:19:31 | FromDiscord | <Elegantbeef> Atleast iirc |
08:21:20 | FromDiscord | <sigmasd> Nice! but it gives intergers, I think I saw a method that convert those to the enum varaint name |
08:21:50 | FromDiscord | <Elegantbeef> Ew, but it'd be `for x in MyEnum.low.ord .. MyEnum.high.ord` |
08:21:59 | FromDiscord | <Elegantbeef> I dont know if there is a sugar for it |
08:22:02 | FromDiscord | <Elegantbeef> You can always make one |
08:22:42 | FromDiscord | <Michal58> In reply to @PMunch "<@431798919719288832>, I believe arrays": this is not at all about the indeces, it is about the type itself |
08:23:22 | FromDiscord | <Michal58> sent a code paste, see https://play.nim-lang.org/#ix=3J6C |
08:23:29 | PMunch | Oh you want to be able to define it like arrays with the array[5..10, int] thing? |
08:23:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/nj4 |
08:24:37 | FromDiscord | <Elegantbeef> Probably should be `typedesc[enum and Ordinal]` |
08:25:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J6E |
08:26:12 | FromDiscord | <Elegantbeef> I'm very dumb today |
08:27:04 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3J6F here is a proper solution, and i'll quite spammin |
08:27:50 | PMunch | @Michal58, not quite sure TBH |
08:28:11 | FromDiscord | <Elegantbeef> So the want is to have an integer and a range? |
08:28:22 | FromDiscord | <sigmasd> xD I actually want the result to be A,B,C R,Z,W |
08:28:24 | FromDiscord | <Michal58> In reply to @PMunch "Oh you want to": Is `array[3,int]` some special syntax that is not possible to achieve with user defined types? |
08:28:37 | FromDiscord | <Elegantbeef> So then just `for x in MyEnum` ? |
08:28:49 | FromDiscord | <sigmasd> it also returns intergers |
08:28:58 | FromDiscord | <Elegantbeef> I dont follow |
08:29:25 | FromDiscord | <Elegantbeef> Does it return `(0, A)`? |
08:29:48 | FromDiscord | <sigmasd> type MyEnum = enum A,B,C↵for x in MyEnum\:↵ echo $x # returns 1,2,3 instead of A,B,C |
08:29:55 | PMunch | @Michal58, I mean it's defined as Magic: https://nim-lang.org/docs/system.html#array |
08:30:11 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3J6G |
08:30:12 | FromDiscord | <Elegantbeef> No it doesnt |
08:30:30 | FromDiscord | <sigmasd> hmm, let me check again |
08:30:30 | FromDiscord | <Elegantbeef> Michal are you after a range or a int as the base value? |
08:30:45 | FromDiscord | <Elegantbeef> I'll assume range for now |
08:31:53 | FromDiscord | <Michal58> @ElegantBeef wdym |
08:32:16 | FromDiscord | <Elegantbeef> What do you want the typedef to be? |
08:32:43 | FromDiscord | <Michal58> I want a type that can be parametrized with an integer value rather than with a type |
08:32:57 | FromDiscord | <Michal58> just like arrays are |
08:33:02 | FromDiscord | <Elegantbeef> `type A[T static: int]` |
08:33:15 | FromDiscord | <Elegantbeef> Jesus i cannot type |
08:33:22 | FromDiscord | <Elegantbeef> `type A[T: static[int]]` |
08:33:30 | FromDiscord | <Elegantbeef> There you go |
08:34:10 | FromDiscord | <sigmasd> Oh my bad I overrided `$` |
08:34:26 | FromDiscord | <Elegantbeef> makes sense i was going to suggest to check that |
08:35:11 | FromDiscord | <sigmasd> Is there a way to access the original version, I kind of want the override, but I can do without it |
08:35:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J6H |
08:35:45 | FromDiscord | <apahl> In reply to @IsaacPaul "damn std/wrapnils is ....": Did you have a look at https://github.com/status-im/questionable ? |
08:35:48 | FromDiscord | <Elegantbeef> It's ugly but it's how explicit calls work |
08:36:20 | FromDiscord | <Elegantbeef> Isnt that a package for options and not nils? |
08:36:57 | FromDiscord | <Elegantbeef> They're after getting nicer nil checked statements/calls |
08:37:03 | FromDiscord | <sigmasd> it outputs M Y E N U M |
08:37:24 | FromDiscord | <Elegantbeef> What? |
08:37:54 | FromDiscord | <Rika> Your terminal is broken then |
08:38:04 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3J6J |
08:38:09 | FromDiscord | <sigmasd> https://play.nim-lang.org/#ix=3J6K |
08:38:30 | FromDiscord | <Elegantbeef> Well yea |
08:38:34 | FromDiscord | <sigmasd> Ah you mean like that xD |
08:38:37 | FromDiscord | <Elegantbeef> you're iterating over a string |
08:39:56 | FromDiscord | <Michal58> In reply to @Elegantbeef "There you go": Thanks. Can we make it support both range and int as in arrays? |
08:40:08 | FromDiscord | <Elegantbeef> I'm on it |
08:43:25 | FromDiscord | <Elegantbeef> Ugh cannot use `..` |
08:43:28 | FromDiscord | <Elegantbeef> Even with my bodge |
08:43:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3J6L |
08:45:51 | * | neurocyte0132889 joined #nim |
08:45:51 | * | neurocyte0132889 quit (Changing host) |
08:45:51 | * | neurocyte0132889 joined #nim |
08:47:40 | FromDiscord | <Michal58> sent a code paste, see https://play.nim-lang.org/#ix=3J6M |
08:47:45 | FromDiscord | <Michal58> I was able to create this workaround |
08:49:32 | FromDiscord | <Michal58> I don't understand your code |
08:49:49 | FromDiscord | <sigmasd> sent a code paste, see https://paste.rs/MAy |
08:50:16 | FromDiscord | <Elegantbeef> What dont you understand I'm more than happy to explain |
08:50:22 | FromDiscord | <Elegantbeef> The `: typdesc` was me being dumb |
08:50:42 | FromDiscord | <Elegantbeef> All the usages of `typedesc` was me being in the writing code zone and not thinking zone |
08:51:04 | FromDiscord | <Elegantbeef> Wait nvm i use them as parameters |
08:51:04 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3J6O |
08:51:17 | FromDiscord | <Elegantbeef> Think it's a bug with slices |
08:53:30 | FromDiscord | <Michal58> In reply to @Elegantbeef "What dont you understand": What does it mean when the body is `discard`? |
08:53:41 | FromDiscord | <Elegantbeef> It's a no op |
08:53:51 | FromDiscord | <Elegantbeef> It's just an empty proc that doesnt do anything but return the default value |
08:54:12 | FromDiscord | <Elegantbeef> `discard` is nim's `pass` if you're a python user |
08:54:22 | FromDiscord | <Michal58> oh I dumb |
08:54:52 | FromDiscord | <Michal58> Ik discard but didn't realise the point is to return default value |
08:55:40 | FromDiscord | <Elegantbeef> Yea solitude it just seems static objects field's arent accessible |
08:55:47 | FromDiscord | <Elegantbeef> So i guess we've found me something to work on |
08:55:52 | FromDiscord | <Elegantbeef> Cheers 🙂 |
08:55:57 | FromDiscord | <Solitude> mmmmm ,cringe |
08:57:42 | FromDiscord | <Michal58> In reply to @Elegantbeef "What dont you understand": Also, how does the return type depend on the arguments? That feels like magic |
08:58:09 | FromDiscord | <Elegantbeef> The arguments are static so they can be used |
08:58:33 | FromDiscord | <Elegantbeef> `typedesc` is a static and has to be known at compile time as is a `range` and `static Natural` |
08:58:51 | FromDiscord | <Elegantbeef> hey fixing that bug will be nice↵(@Solitude) |
08:59:07 | FromDiscord | <Elegantbeef> The question is will I be able to fix it or is it a fucky thing |
09:03:39 | FromDiscord | <Elegantbeef> Ah i see the isssue |
09:03:45 | FromDiscord | <Michal58> Thank you so much @ElegantBeef ! |
09:03:45 | FromDiscord | <Elegantbeef> It's the same thing as arrays |
09:03:56 | * | neurocyte0132889 quit (Ping timeout: 256 seconds) |
09:05:42 | PMunch | This HTMX stuff is really neat |
09:06:34 | FromDiscord | <Elegantbeef> Ugh this bug will probably be another one that haunts me |
09:08:13 | * | neurocyte0132889 joined #nim |
09:08:13 | * | neurocyte0132889 quit (Changing host) |
09:08:13 | * | neurocyte0132889 joined #nim |
09:15:57 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "I'm on an ubuntu": which one? Mint? |
09:16:13 | FromDiscord | <Elegantbeef> Regolith |
09:17:48 | FromDiscord | <Leonardo da Vinci> @ElegantBeef I will install Mint and Manjaro↵Ubuntu-derived and arch-derived. that should cover almost everything? |
09:17:53 | FromDiscord | <Michal58> Is there a proc for inserting into a sorted seq or should I just do `insert` with `algorithm.binarySearch`? |
09:18:06 | FromDiscord | <Elegantbeef> Why do you need more than one distro |
09:18:23 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "Why do you need": Because sometimes some program doesn't exist in one distro |
09:19:01 | FromDiscord | <Elegantbeef> Probably the best michal |
09:19:32 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "Probably the best michal": what is a michal? |
09:21:37 | FromDiscord | <Rika> In reply to @Michal58 "Is there a proc": This person is called Michal |
09:22:26 | FromDiscord | <Sabena Sema> In reply to @Leonardo da Vinci "Because sometimes some program": have you seen mkosi? Its handy for this kinda stuff |
09:25:34 | FromDiscord | <Leonardo da Vinci> In reply to @Sabena Sema "have you seen mkosi?": i don't know what is mkosi |
09:25:56 | FromDiscord | <Sabena Sema> https://github.com/systemd/mkosi |
09:25:57 | PMunch | @Michal58, `for i in 0..mySeq.high: if mySeq[i] > x: mySeq.insert(x, i); break` |
09:26:26 | FromDiscord | <Michal58> In reply to @PMunch "<@431798919719288832>, `for i in": Oof that is not very efficient |
09:26:48 | FromDiscord | <Michal58> (edit) "efficient" => "efficient↵I think I'll use the binarysearch 😉" |
09:27:00 | PMunch | Well it's O(n) |
09:27:18 | FromDiscord | <Sabena Sema> itll setup a linux distro, install the packages, and do final “initial setup” stuff into an image of various sorts (even just a directory)↵↵you can then use systemd-nspawn to enter the image (or even boot it for real/kexec into it) |
09:27:30 | PMunch | Binary search would work as well, but you'd have to tweak it to find essentially two spots (one below and one above yours) |
09:28:10 | FromDiscord | <Elegantbeef> To add to that pmunch you can sample the middle and the start/end and cut the search to `O(n/2)` |
09:28:28 | FromDiscord | <Michal58> In reply to @PMunch "Binary search would work": Binary search returns an index at which the searched value should be present |
09:28:39 | FromDiscord | <Leonardo da Vinci> In reply to @Sabena Sema "itll setup a linux": Its a linux installer? |
09:28:44 | FromDiscord | <Sabena Sema> yeah sorta |
09:28:49 | FromDiscord | <Michal58> I mean it still is O(n) because of the insert op |
09:28:51 | FromDiscord | <Sabena Sema> but for every distro |
09:28:59 | FromDiscord | <valerga> no need to do fancy stuff when most stuff is on flatpak now anyway |
09:29:07 | FromDiscord | <valerga> like steam and lutris |
09:29:15 | FromDiscord | <Michal58> (edit) "In reply to @PMunch "Binary search would work": Binary search returns an index at which the searched value should be present ... " added "no tweaking needed" |
09:29:25 | FromDiscord | <Sabena Sema> using flatpak to setup libs for testing is extremely annoying |
09:29:26 | PMunch | @Michal58, oh right, I'm being dumb. The binary search would give you the position it's supposed to be in :P |
09:29:46 | FromDiscord | <Sabena Sema> flatpak is only really for applications |
09:29:55 | FromDiscord | <valerga> ah yeah, we were talking about linux for gaming earlier |
09:30:04 | FromDiscord | <Sabena Sema> ah, yeah |
09:30:09 | FromDiscord | <Sabena Sema> I use the steam flatpak |
09:30:14 | FromDiscord | <Sabena Sema> in fedora |
09:30:17 | FromDiscord | <Sabena Sema> works wellp |
09:30:42 | FromDiscord | <Michal58> In reply to @PMunch "<@431798919719288832>, oh right, I'm": Hmm, except `algorithm.binarySearch` doesn't... it just returns -1 if it is not present :/ |
09:30:47 | FromDiscord | <Sabena Sema> I only really play factorio on my laptop tho |
09:30:58 | FromDiscord | <Michal58> I'll just write my own version than |
09:31:06 | FromDiscord | <Michal58> (edit) "than" => "then" |
09:31:35 | PMunch | @Michal58, well that's a bummer. I guess for a typical search that is what you'd expect though.. |
09:31:58 | PMunch | You can probably just copy the one from algorithm and then remove the last little check |
09:32:12 | FromDiscord | <Michal58> In reply to @PMunch "<@431798919719288832>, well that's a": I mean binarySearch is often use exactly for finding the position to insert in so both versions are useful |
09:32:26 | PMunch | I'm guessing it just has something like `if data[i] == x: i else: -1` at the end |
09:32:55 | PMunch | Too bad we don't have a generic version of ropes (https://nim-lang.org/docs/ropes.html) |
09:33:04 | PMunch | That would make your insert O(1) as well |
09:33:12 | FromDiscord | <Sabena Sema> btrees |
09:33:17 | FromDiscord | <Sabena Sema> always btrees |
09:33:22 | FromDiscord | <Sabena Sema> as far as the eye can see |
09:33:53 | FromDiscord | <Michal58> In reply to @PMunch "I'm guessing it just": it does |
09:34:17 | PMunch | Problem is that a tree structure can totally wreck your cache-efficiency.. |
09:35:14 | FromDiscord | <Leonardo da Vinci> @Sabena Sema thanks for telling me, i will try it |
09:37:14 | * | mahlon joined #nim |
09:37:14 | PMunch | If you want efficiency I guess you could keep a long seq as the backing memory. Then have a btree with indices. To begin with the seq will be sorted and the only index would be to the start. Then if you insert in the middle you simply split the seq into three, left part, right part, and new part. The original halves stay put in memory, while the new part is added at the end. The indices b-tree will point you to where you need to go to find your element |
09:37:25 | PMunch | Should be fairly efficient |
09:37:32 | FromDiscord | <Elegantbeef> Tiime to just use a linked list 😛 |
09:37:52 | FromDiscord | <Leonardo da Vinci> I am learning C |
09:37:56 | FromDiscord | <Leonardo da Vinci> Because i hate OOP |
09:38:14 | FromDiscord | <Elegantbeef> Nim exists |
09:38:19 | PMunch | @Elegantbeef, same problem as a b-tree, and you don't get the sorted benefit :P |
09:38:24 | FromDiscord | <Leonardo da Vinci> Nim is not OOP |
09:38:29 | PMunch | Exactly |
09:38:36 | FromDiscord | <Leonardo da Vinci> Based language xd |
09:38:53 | FromDiscord | <Leonardo da Vinci> In reply to @PMunch "Exactly": wait, can i use the word based here? |
09:39:17 | PMunch | I mean you can, I have no idea what you mean by it, but you're free to use whatever words you like |
09:39:36 | PMunch | It does xorxz communications a bit though |
09:39:37 | FromDiscord | <Elegantbeef> Welcome to boomerhood pmunch |
09:39:45 | FromDiscord | <Leonardo da Vinci> In reply to @PMunch "I mean you can,": Do you know another procedural language? |
09:39:52 | FromDiscord | <Elegantbeef> Odin, Zig |
09:39:53 | PMunch | @Elegantbeef :D I've been here a while :P |
09:40:03 | PMunch | C |
09:40:08 | FromDiscord | <Elegantbeef> Pascal, Oberon, Modula, Ada ... |
09:40:23 | FromDiscord | <Leonardo da Vinci> With cute Syntaxis? |
09:40:26 | PMunch | JavaScript is also procedural isn't it? |
09:40:40 | FromDiscord | <Elegantbeef> nah it's protypal or something like that |
09:40:48 | FromDiscord | <Elegantbeef> It's a weird OOP/functional mix |
09:40:49 | FromDiscord | <Leonardo da Vinci> (edit) "Syntaxis?" => "syntaxis?" |
09:41:13 | FromDiscord | <Elegantbeef> I'm going to bash my head into a wall since this bug is the same as the array one i've ran into before just in the `set` version |
09:41:22 | FromDiscord | <Elegantbeef> I mean `range` version |
09:41:22 | FromDiscord | <KatrinaKitten> Prototypal yes. Think functional imitating OOP, despite syntactically trying to appear the other way around. |
09:41:36 | FromDiscord | <Leonardo da Vinci> I found Nim because i wanted a compiled language with a syntax clean just like Python |
09:41:57 | PMunch | @Leonardo_da_Vinci, so why are you looking for something else then? |
09:42:04 | PMunch | Sounds like you've found the perfect match |
09:42:25 | FromDiscord | <Leonardo da Vinci> Because i want to find the best |
09:42:34 | FromDiscord | <Leonardo da Vinci> before marrying a language |
09:42:40 | FromDiscord | <KatrinaKitten> Though technically most OOP is also procedural anyway, as is functional... but that gets into the fact that the opposite of procedural is actually declarative, not OOP or functional or what have you. |
09:43:21 | FromDiscord | <Leonardo da Vinci> In reply to @Leonardo da Vinci "I found Nim because": and it compiles to C!!!! |
09:43:30 | FromDiscord | <Elegantbeef> Look at the language nerd |
09:44:31 | FromDiscord | <Leonardo da Vinci> I hate OOP, i was helping a friend, and they teach that in college |
09:44:40 | FromDiscord | <Leonardo da Vinci> 🤮 |
09:44:57 | FromDiscord | <qb> How would I `scanf` the license (MIT) out of ` license: MIT` ? My results always require some temp variable since `$` also matches and gets grouped |
09:44:59 | FromDiscord | <KatrinaKitten> Language geek, tyvm /j |
09:45:04 | FromDiscord | <Leonardo da Vinci> I used C++. |
09:45:08 | FromDiscord | <Leonardo da Vinci> Python |
09:45:27 | FromDiscord | <Leonardo da Vinci> I am learning now C, and learning to use the SDL graphics library |
09:45:56 | FromDiscord | <Leonardo da Vinci> In reply to @KatrinaKitten "Language geek, tyvm /j": what is tyvm/j? |
09:46:24 | FromDiscord | <Leonardo da Vinci> btw, are you a vtuber? @KatrinaKitten |
09:46:29 | FromDiscord | <Anis Taluqdar> If you know c++ what is the benefits of learning c over it?↵(@Leonardo da Vinci) |
09:47:07 | FromDiscord | <KatrinaKitten> In reply to @Leonardo da Vinci "what is tyvm/j?": Tyvm is thank you very much, and /j is a tone marker (short for "joking) https://tonetags.carrd.co |
09:47:08 | FromDiscord | <Leonardo da Vinci> In reply to @Anis Taluqdar "If you know c++": I like C |
09:47:19 | FromDiscord | <KatrinaKitten> (edit) ""joking)" => ""joking")" |
09:48:03 | FromDiscord | <KatrinaKitten> In reply to @Leonardo da Vinci "btw, are you a": I suppose technically, I use a Vtuber avatar on some of my streams, but I don't do it seriously or as a job. |
09:48:05 | FromDiscord | <qb> In reply to @qb "How would I `scanf`": nvm, `$slicense:$s$w$.` |
09:48:17 | FromDiscord | <Leonardo da Vinci> In reply to @KatrinaKitten "I suppose technically, I": I see |
09:48:31 | FromDiscord | <Leonardo da Vinci> I C |
09:49:04 | FromDiscord | <Anis Taluqdar> Why u like c over c++?↵(@Leonardo da Vinci) |
09:50:23 | FromDiscord | <Leonardo da Vinci> In reply to @Anis Taluqdar "Why u like c": Good question |
09:52:06 | PMunch | One thing I was concerned about for the HTMX based playground was to keep support for the JSON interface (that e.g. NimBot uses), but this seems to work fine http://ix.io/3J70/nim |
09:52:40 | PMunch | Then I just have hx-headers defined on the <html> element in my index file to set the accept type to HTML and voila |
09:52:42 | FromDiscord | <Leonardo da Vinci> In reply to @Anis Taluqdar "Why u like c": I just like writting code in a procedural style, write once, debug less |
09:57:37 | PMunch | Hmm, the only tone marker I've ever seen before is /s. Didn't know it was actually part of a system |
09:59:09 | FromDiscord | <Elegantbeef> Nice i have a possible fix for that `range` bug |
10:01:23 | FromDiscord | <KatrinaKitten> @Pmunch /s is definitely the most well known, but a few others such as /j are fairly well used; that site documents a lot I've never seen in practice. It's a bigger thing in neurodivergency-heavy communities, among others. |
10:02:43 | FromDiscord | <Leonardo da Vinci> In reply to @KatrinaKitten "@Pmunch /s is definitely": Why are they used? |
10:03:18 | FromDiscord | <Elegantbeef> Poe's law |
10:03:48 | FromDiscord | <Schelz> Can somebody provide me a documentation of how to wrap up some module for nim ? |
10:03:58 | FromDiscord | <Schelz> (edit) removed "a" |
10:04:26 | FromDiscord | <KatrinaKitten> In reply to @Leonardo da Vinci "Why are they used?": A huge portion of face to face communication is nonverbal, things like expressions and tone of voice, but you don't get that with text. Tone tags can help more clearly indicate your intended tone, so you don't come across as angry or upset unintentionally, for example. |
10:04:38 | PMunch | @Leonardo_da_Vinci, sarcasm. You typically see it a lot on Reddit |
10:04:43 | FromDiscord | <Leonardo da Vinci> In reply to @KatrinaKitten "A huge portion of": Sounds good to me |
10:04:47 | FromDiscord | <Elegantbeef> What do you mean "wrap up"↵(@Schelz) |
10:05:07 | FromDiscord | <Leonardo da Vinci> In reply to @KatrinaKitten "A huge portion of": I have autism, but i trained myself a lot to detect stuff |
10:05:12 | FromDiscord | <Schelz> How to use cpp or C code in nim |
10:05:23 | FromDiscord | <Elegantbeef> For some reason i'm viewed as a jaded asshole, i just dont get it 😛↵(@KatrinaKitten) |
10:05:38 | FromDiscord | <Solitude> In reply to @KatrinaKitten "A huge portion of": why are there no tags if i want to come across as angry or upset? |
10:06:42 | FromDiscord | <Elegantbeef> Throw a few cunts in there it'll get the message across ya dumb cunt 😉 |
10:06:50 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "For some reason i'm": Some people are todo sensitive |
10:07:07 | FromDiscord | <Leonardo da Vinci> (edit) "todo" => "too" |
10:07:10 | FromDiscord | <amadan> In reply to @Elegantbeef "Throw a few cunts": Might confuse Australians though wouldn't it? |
10:07:17 | FromDiscord | <Solitude> In reply to @Elegantbeef "Throw a few cunts": okay /mad |
10:07:23 | FromDiscord | <Elegantbeef> I dont speak boomerang sorry |
10:07:42 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "Throw a few cunts": Okay /laughing |
10:09:14 | FromDiscord | <KatrinaKitten> In reply to @Solitude "why are there no": Honest answer, probably because they're primarily used to defuse situations that could otherwise cause a misunderstanding and spiral, as opposed to ensuring a situation does spiral. It's easy enough to communicate that you're ticked off with other methods, but sometimes subtler things like sarcasm or a light hearted jab can fly under the radar, which is why the system was originally create |
10:09:32 | FromDiscord | <Elegantbeef> That's one long way of writing "poes law" 😛 |
10:09:39 | FromDiscord | <KatrinaKitten> Yeah, basically lol |
10:09:55 | FromDiscord | <KatrinaKitten> But most people probably aren't familiar with that either, so |
10:10:37 | FromDiscord | <Elegantbeef> Get learneded |
10:10:45 | FromDiscord | <Leonardo da Vinci> In reply to @KatrinaKitten "Honest answer, probably because": Okay /confused |
10:11:14 | FromDiscord | <KatrinaKitten> TLDR they're shorthand for "I'm not mad, I'm just <insert intended tone>" |
10:11:34 | FromDiscord | <Leonardo da Vinci> I am installing manjaro now /anxious |
10:11:44 | FromDiscord | <Elegantbeef> We're really going long down this path of one `/j` |
10:11:52 | FromDiscord | <Elegantbeef> I personally just use `/j` to sign off |
10:12:17 | FromDiscord | <Leonardo da Vinci> In reply to @Elegantbeef "We're really going long": Join us!!! /join the trend |
10:18:16 | FromDiscord | <Anis Taluqdar> Yeah, I was used to it. It's best. But I need to leave for windows 😭😭↵(@Leonardo da Vinci) |
10:19:06 | FromDiscord | <Elegantbeef> Sucks to suck |
10:19:37 | FromDiscord | <Anis Taluqdar> Maybe suck to sucks 😅 |
10:27:26 | PMunch | Hmm, I have this weird long-standing issue with one of my Nim script where it compiles fine but just doesn't work in release mode. Works fine in debug though |
10:29:19 | FromDiscord | <Elegantbeef> Do we guess the issue or is it sharable? |
10:30:04 | * | krux02 joined #nim |
10:30:33 | PMunch | Haha, give me a sec |
10:31:30 | PMunch | This is the script: http://ix.io/3J7m/nim |
10:32:01 | FromDiscord | <Elegantbeef> Uploaded with raw new lines? |
10:32:02 | PMunch | But by itself it isn't very useful as it calls out to some external scripts |
10:32:23 | PMunch | Just remove the /nim from the URL |
10:32:33 | PMunch | Sometimes ix messes up when it tries to syntax highlight.. |
10:33:00 | FromDiscord | <Elegantbeef> Well there's your problem 300 indent levels 😛 |
10:33:34 | PMunch | It's just a hacky little script :P |
10:34:15 | PMunch | The problem is with the nimSHA2 library that libkeepass uses |
10:34:32 | PMunch | Or nimAES, I don't remember |
10:34:43 | PMunch | It fails to decrypt when it's compiled in release mode |
10:34:50 | FromDiscord | <Elegantbeef> Odd |
10:35:06 | FromDiscord | <Elegantbeef> Well i cant look into it right now i need to sleep |
10:35:27 | FromDiscord | <Elegantbeef> If i remember i might take a look at it and see if there's an issue, but i probably cant be arsed 😛 |
10:40:56 | PMunch | Lazy sod |
10:41:16 | PMunch | :P |
10:45:14 | FromDiscord | <Leonardo da Vinci> In reply to @Anis Taluqdar "Yeah, I was used": I installed Ubuntu once, and it did broke somehow, i prefer just work, stable distros |
10:46:40 | PMunch | I used to use Ubuntu |
10:47:02 | PMunch | But I always ended up breaking it when I tried to install a newer package than what it offered for some task |
10:47:29 | PMunch | So then I switched to Manjaro (because it had an i3 community flavour at the time) and I haven't reinstalled that machine since |
10:49:11 | FromDiscord | <valerga> last ubuntu i had was a kde neon transformed to kubuntu transformed to tiling wm setup |
10:49:17 | FromDiscord | <valerga> it worked for a few years |
10:49:44 | FromDiscord | <valerga> suddenly some weird audio problem and I kinda blame the proprietary programs I ran |
10:50:24 | PMunch | I had Xubuntu transformed to i3 |
10:50:33 | FromDiscord | <Leonardo da Vinci> What is i3? |
10:50:40 | PMunch | Tiling window manager |
10:51:04 | FromDiscord | <Leonardo da Vinci> does mandado break easily? |
10:51:18 | PMunch | But Manjaro i3 flavour just had a bunch of nice little scripts that made the i3 integration smoother |
10:51:22 | FromDiscord | <Leonardo da Vinci> (edit) "mandado" => "manjaro" |
10:51:49 | PMunch | Well, it is a bleeding edge distro. But it is a month behind Arch I believe. So the worst errors should be weeded out |
10:52:19 | PMunch | I have broken it a couple times, but nothing I wasn't able to fix |
10:52:41 | PMunch | And the community used to be super helpful back when I first got into it, but I haven't been in there for ages |
10:52:52 | PMunch | Also helps that you can use the Arch wiki more or less directly |
10:55:49 | FromDiscord | <Leonardo da Vinci> Ubuntu got broken in 1 day |
10:56:48 | FromDiscord | <Moregon> manjaro breaks very easily, I thought Ubuntu was supposed to be more of a just work distro too |
10:57:01 | FromDiscord | <Leonardo da Vinci> In reply to @Moregon "manjaro breaks very easily,": Noooo |
10:57:18 | FromDiscord | <Moregon> You should avoid manjaro over all else imo |
10:57:37 | FromDiscord | <Leonardo da Vinci> I just installed manjaro |
10:57:48 | FromDiscord | <Moregon> rip |
10:57:55 | FromDiscord | <Leonardo da Vinci> i amor gonna try, and if it breaks, i will delete it just like ubuntu |
10:58:13 | FromDiscord | <Moregon> ok |
10:58:33 | FromDiscord | <Leonardo da Vinci> (edit) "amor" => "am" | "try," => "try it" | "breaks," => "breaks" |
10:59:33 | FromDiscord | <Moregon> If it breaks I was happy with openSUSE tumbleweed when I used it for a bit and Fedora is pretty good just works distro I think |
11:00:22 | FromDiscord | <Leonardo da Vinci> In reply to @Moregon "ok": What do you recommend me for a gaming, just works? |
11:03:33 | FromDiscord | <Clonkk> Pop OS! is prob. best distro for gaming |
11:05:16 | FromDiscord | <hmmm> oh dear I just realized I have two procs: datecheck and checkdate that do the same thing: call parse from datetime lol. The first works on seq[T] and the second on string. Any chance I can compact those ugly ducklings in a beautiful flamethrower err swan |
11:05:48 | FromDiscord | <Leonardo da Vinci> In reply to @Clonkk "Pop OS! is prob.": Can i use it with XFCE? |
11:11:43 | FromDiscord | <Rika> In reply to @Leonardo da Vinci "Can i use it": Likely not |
11:11:58 | FromDiscord | <Rika> In reply to @hmmm "oh dear I just": Rename them to the same thing |
11:12:06 | FromDiscord | <Rika> Overloading, baby |
11:12:10 | FromDiscord | <hmmm> wut |
11:12:11 | FromDiscord | <hmmm> it works? |
11:12:30 | FromDiscord | <hmmm> this might be the coolest thing I learned today rika san |
11:13:04 | FromDiscord | <Rika> I mean if the types are different then it should work |
11:13:13 | FromDiscord | <hmmm> I'll let you know |
11:15:03 | FromDiscord | <enthus1ast> check is one of the worst proc names btw 😉 |
11:15:10 | FromDiscord | <hmmm> nu! |
11:15:37 | FromDiscord | <hmmm> I find it beautiful and my little brain can find ease in the simple concept of checking |
11:15:39 | FromDiscord | <enthus1ast> Why not parseDatetime ? |
11:15:51 | FromDiscord | <hmmm> it's ugly as sin enthy |
11:16:14 | FromDiscord | <enthus1ast> Then overload it for a string and a seq |
11:19:09 | FromDiscord | <enthus1ast> I mean, what does it "check"? It does not even return bool, it is clearly a parseDatetime, and if it would return a bool it must be named isDatetime. |
11:19:38 | FromDiscord | <enthus1ast> My bank would prolly have a check function |
11:19:40 | FromDiscord | <hmmm> nunu both are checkers and return bool |
11:23:23 | FromDiscord | <enthus1ast> Ahh now i get you\:↵"checkers[note 1] (American English) is a group of strategy board games for two players" |
11:23:55 | FromDiscord | <hmmm> hey do not make fun of my ugly ducklings 🤨 |
11:27:09 | FromDiscord | <hmmm> is there something I should know about 'things' inside bigger "things". Like in "this is a 'thing', bro" |
11:27:28 | FromDiscord | <hmmm> I have the feeling I should escape the little guys |
11:27:32 | FromDiscord | <hmmm> but maybe they work |
11:28:27 | FromDiscord | <Anis Taluqdar> 🙄🙄 |
11:32:54 | FromDiscord | <Rika> In reply to @enthus1ast "My bank would prolly": No your bank would have a cheque function 😉 |
11:33:15 | FromDiscord | <enthus1ast> i've learned english very late |
11:33:36 | FromDiscord | <enthus1ast> or never actually ;) |
11:35:49 | * | xet7 quit (Remote host closed the connection) |
11:43:26 | FromDiscord | <Rika> No it’s a joke, cheque is British and check is American |
11:48:46 | FromDiscord | <hmmm> yay overloading work'd |
11:49:06 | FromDiscord | <hmmm> now I must choose what I like more between datecheck and checkdate 😦 |
11:54:58 | FromDiscord | <sigmasd> Anyone uses nvim with nim? I'm using https://github.com/alaviss/nim.nvim and I'm currently mainly missing auto completion |
11:55:17 | FromDiscord | <sigmasd> Anyone uses nvim +coc with nim? I'm using https://github.com/alaviss/nim.nvim and I'm currently mainly missing auto completion |
11:55:30 | FromDiscord | <Rika> You need an autocomplete engine |
11:55:43 | FromDiscord | <Rika> You also then need to register such plugin with the engine |
11:55:53 | FromDiscord | <Rika> There is instructions on the read me of that plugin |
11:56:31 | FromDiscord | <sigmasd> I'm using coc and the one recommended on the extension page (prabirshrestha/asyncomplete.vim) conflicts with it apparently |
12:12:48 | * | arkurious joined #nim |
12:36:32 | * | rockcavera joined #nim |
12:36:33 | * | rockcavera quit (Changing host) |
12:36:33 | * | rockcavera joined #nim |
12:37:28 | FromDiscord | <Rika> Yes because those are two autocomplete engines |
13:03:27 | * | sagax joined #nim |
13:12:16 | FromDiscord | <keks> Hi all! I'm new to NIM and still figuring things out. I'm trying to apply a map() function to an iterator, but it seems it only works with sequences. Is it intentional? I expect that map() should work on all kinds of iterables, i.e. not only on the sequences. |
13:19:22 | FromDiscord | <IsaacPaul> In reply to @apahl "Did you have a": Thanks will definitely take a look. Seems like what I’m looking for |
13:35:42 | qwr | keks: there is mapIt macro that is often better choice to use |
13:38:57 | qwr | keks: thought there is also map definition for iterators |
13:42:04 | qwr | hm i'm wrong, the simple map don't work, but mapIt works |
14:00:06 | FromDiscord | <keks> In reply to @qwr "hm i'm wrong, the": Thank you! Though mapIt doesn't seem to work either "echo "0101001110".items.mapIt(parseInt($it))" |
14:01:18 | FromDiscord | <Solitude> omit `items` |
14:01:29 | FromDiscord | <keks> I found that there is an "iterutils" package that seems to provide map/reduce/filter for iterators, but it is really weird that it wouldn't work on iterators. |
14:01:39 | FromDiscord | <keks> (edit) "iterators." => "iterators in the standard library." |
14:02:25 | FromDiscord | <keks> In reply to @Solitude "omit `items`": Brilliant, thanks a ton! |
14:03:10 | FromDiscord | <keks> Though this separation between sequences and iterators is weird. In Python or D algorithms from the standard library work on both arrays and iterators/ranges. |
14:03:28 | FromDiscord | <Rika> nim iterators are inlined |
14:03:32 | FromDiscord | <Solitude> yeah, everything sucks |
14:03:42 | FromDiscord | <Rika> though i assume |
14:03:48 | FromDiscord | <Rika> whoops, i hit enter by accidenta |
14:03:49 | FromDiscord | <Rika> (edit) "accidenta" => "accident" |
14:04:53 | FromDiscord | <Rika> it being inlined means there isnt something to pass into a function |
14:05:29 | FromDiscord | <Rika> i guess there could be an automatic inline->closure to "ensure" first class iterators without losing too much performance? but yeah, closure iterators are apparently much slower |
14:05:34 | FromDiscord | <Rika> too much slower to be a default |
14:07:36 | FromDiscord | <keks> It's been a while since I looked at ranges in D, but I'm sure they are equally well optimised. |
14:09:19 | FromDiscord | <keks> but ranges in D are quite a bit different to the yield-based iterators in Nim.. |
14:09:34 | FromDiscord | <Rika> well i'd like to know |
14:14:36 | qwr | some languages like haskell can optimise normal function usage by inlining pretty much away, but it means more work for the compiler (and the pure no-sideeffects language also helps) |
14:15:35 | FromDiscord | <ajusa> man why are linking issues impossible to debug |
14:15:39 | FromDiscord | <Rika> nim kinda does that too for regular functions but iterators are just by default always inlined |
14:15:57 | FromDiscord | <Rika> there isnt any real special sauce thats used to make it fast in a smarter way |
14:16:25 | FromDiscord | <retkid> how do i know when something is a good candidate for async and not threads |
14:16:26 | FromDiscord | <Rika> i guess its kinda sad but i can imagine it being one hell of a task to do |
14:16:44 | FromDiscord | <Rika> In reply to @retkid "how do i know": when your bottleneck is networking or reading files or so |
14:16:48 | FromDiscord | <retkid> my program currently maxes out each thread its on doing all its math |
14:16:48 | qwr | and python is just slow :) |
14:17:01 | FromDiscord | <retkid> so i assume |
14:17:04 | FromDiscord | <Rika> In reply to @retkid "my program currently maxes": then thats not an async task |
14:17:04 | FromDiscord | <retkid> threading is applicable |
14:17:08 | FromDiscord | <Rika> keep on using threads |
14:17:09 | FromDiscord | <Rika> yes |
14:17:18 | * | Vladar joined #nim |
14:17:23 | FromDiscord | <retkid> well, im not using threads lol, i meant any thread it randomly spawns upon |
14:17:24 | FromDiscord | <Rika> you need more threads it feels like lol |
14:17:29 | FromDiscord | <Rika> wdym? |
14:17:44 | FromDiscord | <retkid> whenever a thread is allocated to the process it goes from 0.7% to 100 |
14:18:11 | FromDiscord | <Rika> idk then lol |
14:18:14 | FromDiscord | <retkid> also my memory goes from 4 gb to 8 gb then it just dies L |
14:18:16 | FromDiscord | <retkid> (edit) "L" => ":(" |
14:18:25 | FromDiscord | <Rika> youre prolly doing something wrong? idk |
14:18:26 | FromDiscord | <enthus1ast> sounds like a bug \:) |
14:18:27 | FromDiscord | <keks> In reply to @Rika "nim *kinda* does that": well, chaining map/filter on the iterators could be unrolled into a big for loop, no? |
14:18:36 | FromDiscord | <Rika> In reply to @keks "well, chaining map/filter on": i know |
14:18:38 | FromDiscord | <retkid> no im not its just bad memory managment |
14:18:41 | FromDiscord | <Rika> and thats exactly what zerofunctional does |
14:18:42 | FromDiscord | <retkid> (edit) "managment" => "management" |
14:18:48 | FromDiscord | <Rika> but i dont know why its not like that from the getgo |
14:19:40 | FromDiscord | <retkid> now that i think about it, maybe this is wrong? |
14:19:50 | FromDiscord | <retkid> ah im not deallocing it |
14:20:17 | FromDiscord | <Rika> lol |
14:20:58 | FromDiscord | <retkid> nah that doesn't solve anything, the tables are just super big |
14:21:32 | FromDiscord | <Rika> so you just literally dont have enough memory to do the task |
14:21:41 | FromDiscord | <retkid> likely |
14:21:51 | FromDiscord | <retkid> are orderedtable less efficient than just tables? |
14:22:00 | FromDiscord | <Rika> no |
14:22:03 | FromDiscord | <Rika> well |
14:22:07 | FromDiscord | <Rika> i didnt check |
14:22:19 | FromDiscord | <Rika> it probably is by a small bit? but afaik the representations seem the same... |
14:23:28 | FromDiscord | <retkid> they're much smaller |
14:24:03 | FromDiscord | <retkid> by maybe 30% |
14:24:39 | FromDiscord | <retkid> at least for my tables of 2073600 entries |
14:24:46 | FromDiscord | <retkid> (edit) "2073600" => "2073600+" |
14:25:29 | FromDiscord | <retkid> hmmm |
14:25:37 | FromDiscord | <retkid> each one should be 5 mbs doing the math |
14:25:42 | FromDiscord | <retkid> maybe I should just use a sequence |
14:26:09 | FromDiscord | <retkid> (edit) "math" => "math, here they're like 500 mb" |
14:33:42 | FromDiscord | <enthus1ast> Do you need the table for your calculation? |
14:34:01 | FromDiscord | <retkid> i need it to organize the data but after that I can just use a sequence |
14:34:18 | FromDiscord | <enthus1ast> If no then just don't store it in memory but dump it to your mass storage |
14:34:55 | FromDiscord | <retkid> yea thats the next step of optimization but im concerned for some weird race condition if i thread it |
14:34:58 | FromDiscord | <retkid> if that makes sesne |
14:39:29 | FromDiscord | <retkid> alright so i've got near the 5 mb goal by storing everything as joined |
14:39:34 | FromDiscord | <retkid> (edit) "joined" => "strings" |
14:39:39 | FromDiscord | <retkid> tables => seq => string |
14:48:33 | FromDiscord | <ajusa> Currently getting a `/usr/bin/ld.bfd: errno: TLS reference in /usr/lib64/libm-2.34.a(w_pow.o) mismatches non-TLS reference in /home/ajusa/.cache/nim/main_r/stdlib_io.nim.c.o` with cosmonim, anyone here understand linkers? |
15:19:09 | FromDiscord | <Smarc> Hey guys, I have a confusing little issue with https://github.com/Smarcy/nim_chess especially with 'nimble test'.↵If I run 'nimble test' as it is right now, it works fine and every test is green. But if I insert 'b.draw' above L461 in 'test_move.nim' it draw the board correct and the tests are still green. If I insert 'b.draw' right after L461 the test crashes. I just don't understand how this behaviour is able to happen. Would really app |
16:01:56 | FromDiscord | <Smarc> Nobody any clue? Or should I provide any more information? :( |
16:04:14 | FromDiscord | <qb> Is there no `readAll` for `osproc`? |
16:05:54 | * | PMunch quit (Quit: Leaving) |
16:09:30 | Amun-Ra | Smarc: that test case is kinda largish |
16:17:28 | nrds | <Prestige99> qb what are you trying to do? |
16:20:51 | FromDiscord | <IsaacPaul> In reply to @Smarc "Nobody any clue? Or": Do you really need to draw during a test? If I had to _guess_ it maybe because of echo. I'm not sure how tests are run.. if they are ran in parallel then accessing a single resource (echo) from multiple places definitely will cause issues. ↵↵Perhaps an out of bounds error or accessing a nil somewhere? xD |
16:21:14 | FromDiscord | <IsaacPaul> Comment pieces out of draw until it starts working |
16:21:27 | FromDiscord | <IsaacPaul> (edit) "pieces" => "lines" |
16:21:53 | FromDiscord | <IsaacPaul> Comment lines |
16:36:22 | * | xet7 joined #nim |
16:44:51 | FromDiscord | <lytedev> am I dumb or is there no `parseInt` for `int64`? |
16:46:15 | FromDiscord | <Solitude> "1".parseInt.int64 |
16:46:48 | FromDiscord | <lytedev> would that not fail for >32bit int strings? |
16:47:28 | FromDiscord | <Solitude> !eval echo "9223372036854775807".parseInt |
16:47:29 | NimBot | Compile failed: /usercode/in.nim(1, 27) Error: undeclared field: 'parseInt' for type system.string [type declared in /playground/nim/lib/system.nim(34, 3)] |
16:47:47 | FromDiscord | <Solitude> !eval import strutils; echo "9223372036854775807".parseInt |
16:47:50 | NimBot | 9223372036854775807 |
16:48:51 | FromDiscord | <lytedev> Ah so int _is_ an int64 on 64-bit platforms, then? I should certainly have expected that I suppose. Thank you! |
16:49:05 | FromDiscord | <lytedev> Presumably, that would fail on 32-bit platforms, though, no? |
16:49:15 | FromDiscord | <Solitude> probably |
16:49:27 | FromDiscord | <lytedev> 👍 thank you |
16:51:21 | Amun-Ra | there's parseBiggestInt |
16:51:26 | FromDiscord | <Saptak> sent a code paste, see https://play.nim-lang.org/#ix=3J9r |
16:51:36 | FromDiscord | <Saptak> sent a code paste, see https://play.nim-lang.org/#ix=3J9s |
16:52:02 | FromDiscord | <Solitude> !eval var name:int |
16:52:04 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: invalid token: (\29) |
16:52:23 | FromDiscord | <demotomohiro> In reply to @Saptak "is this valid?": What do you want to do with that code? |
16:52:35 | FromDiscord | <Saptak> In reply to @demotomohiro "What do you want": i need a pointer |
16:52:52 | FromDiscord | <demotomohiro> You need to write `var name: ptr int`. |
16:52:55 | FromDiscord | <lytedev> `Pint`? |
16:53:14 | FromDiscord | <Saptak> In reply to @demotomohiro "You need to write": ok |
16:53:43 | FromDiscord | <Solitude> In reply to @Saptak "i need a pointer": https://nim-lang.github.io/Nim/tut1.html#advanced-types-reference-and-pointer-types |
16:54:08 | FromDiscord | <Saptak> thanks |
16:57:04 | FromDiscord | <qb> In reply to @nrds "<Prestige> qb what are": I just want a the whole output of a process as one string instead of a seq[string] |
17:02:43 | FromDiscord | <qb> `outputStream.readAll()` did it |
17:06:33 | FromDiscord | <demotomohiro> There is asynchronous version of osproc. |
17:06:34 | FromDiscord | <demotomohiro> https://github.com/cheatfate/asynctools |
17:06:57 | FromDiscord | <demotomohiro> But I never used it. |
17:21:02 | * | freevryheid left #nim (WeeChat 3.4) |
18:27:57 | * | tinytoast is now known as tinytim |
18:44:24 | * | ldlework joined #nim |
18:45:31 | ldlework | I just had a silly idea to pass along; People painstakingly clean-room reverse engineered the Ocarina of Time 64 source-code to C. It would be funny to strip down the C source to what's minimally required to compile a valid ROM. Then port it to Nim to set the stage for Nim N64 homebrew scene. ^_^ |
18:53:15 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
18:54:26 | * | neurocyte0132889 joined #nim |
18:54:26 | * | neurocyte0132889 quit (Changing host) |
18:54:26 | * | neurocyte0132889 joined #nim |
18:54:55 | * | rb quit (Read error: Connection reset by peer) |
18:55:06 | * | rwb joined #nim |
18:55:47 | * | Vladar quit (Quit: Leaving) |
18:57:00 | * | rwb is now known as rb |
19:45:21 | perro | it's not a bad idea |
19:45:34 | perro | kind of a very specialized mini console |
19:45:43 | perro | retro* |
19:46:00 | * | tinytim is now known as typnoking |
20:04:33 | GreaseMonkey | a minimal ROM typically starts with a blob to talk to the given 3rd-party lockout chip or something like that, and then it jumps to the actual program which can be as simple as setting up the video mode then memcpy()ing to the framebuffer |
20:05:27 | GreaseMonkey | RSP is completely optional here although i do believe the blob copies at least part of itself to RSP RAM in order to initialise the 4 or 8 MB of RDRAM |
20:06:53 | GreaseMonkey | erm did i say memcpy() i meant to say memset() to force it to... some colour |
20:07:14 | GreaseMonkey | but memcpy() can work too if you don't count data as being part of the "minimal" part ;) |
20:08:48 | GreaseMonkey | anyway, long story short: there is no point in stripping down some C code to a minimal base when one can instead start from nothing and put whatever one needs to into the thing, and as an added bonus, this has already been done in assembly plenty of times |
20:10:43 | GreaseMonkey | oh and if anyone's tempted to say "what about the gigaleak? would that help?": the N64 scene has had "interestingly-obtained" documentation from back when the N64 was still seeing new games coming out (and yet N64 emulators are still beyond complete embarassment) |
20:12:39 | GreaseMonkey | but those docs were leaked out of SGI, so that ends up covering the RDP (the GPU) and the RSP (the secondary CPU, or as emulators treat it, the GPU), but not the PIF interface (so you still need unofficial docs for how to interface e.g. controllers and their paks and possibly also the save memory inside of the cartridge), and not the RDRAM interface |
20:13:11 | FromDiscord | <retkid> is there anyway to use del but have t be a specific value |
20:13:29 | * | vicfred joined #nim |
20:13:30 | FromDiscord | <retkid> ive found a time in my life where i need to remove values from a sequence but keep it the same length |
20:13:46 | GreaseMonkey | the lack of RDRAM controller docs is evident in one of the actually good but still not fast enough emulators, where it spoofs the behaviour to get the boot ROM to finish, and then depending on the lockout chip used it dumps the RAM size into a given location in RAM |
20:16:21 | * | SebastianM joined #nim |
20:31:38 | FromDiscord | <hmmm> yo doods if I have two seqs A [a,b,c,d,e] and B [a,b,c] and want another seq with all the elements of A that are not in B should I use set stuff or is there some nifty "not in" keyword |
20:32:27 | FromDiscord | <lytedev> sounds like you want a set - any reason you need a seq? |
20:32:44 | FromDiscord | <hmmm> I need to loop it later |
20:33:02 | FromDiscord | <lytedev> you can iterate over the set -- if you need to preserve order, there's even an ordered set |
20:33:30 | FromDiscord | <hmmm> hmm no handy shortcuts from keywords or sequtils? 😦 |
20:33:37 | FromDiscord | <hmmm> I guess it's a fairly common operation |
20:33:44 | FromDiscord | <lytedev> what is? |
20:34:00 | FromDiscord | <hmmm> taking as a seq all the items from A not in B |
20:34:20 | FromDiscord | <lytedev> yeah that's a set thing, not really a seq thing |
20:34:51 | FromDiscord | <lytedev> you could do it, of course, but it definitely sounds like you've got the wrong data structure 😉 |
20:35:04 | FromDiscord | <hmmm> well that's a given lol |
20:35:50 | FromDiscord | <geekrelief> Just use a filter |
20:36:22 | FromDiscord | <hmmm> eh I might try, it's handier than the sets? |
20:37:03 | FromDiscord | <lytedev> but... why not use sets? they're not scary, I promise |
20:37:31 | FromDiscord | <hmmm> I wanted a one liner lol, I can feel in my bones that it's easy stuff that people do all the time with a oneline lol |
20:37:55 | FromDiscord | <lytedev> if you must, you can even `for sharedElement in (mySeq.toHashSet - myOtherSeq.toHashSet):` |
20:38:44 | FromDiscord | <hmmm> hmm hash set is what people commonly refer to set? |
20:38:58 | FromDiscord | <lytedev> docs here: https://nim-lang.org/docs/sets.html#incl%2CHashSet%5BA%5D%2CA |
20:39:05 | FromDiscord | <lytedev> (edit) "https://nim-lang.org/docs/sets.html#incl%2CHashSet%5BA%5D%2CA" => "https://nim-lang.org/docs/sets.html" |
20:39:16 | FromDiscord | <geekrelief> A.filterit(it notin B) |
20:39:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jau |
20:39:35 | FromDiscord | <Elegantbeef> If it's a settable type (any ordinal with a range smaller that 2^16) |
20:39:39 | FromDiscord | <hmmm> yay we got a bunch of oneliners |
20:39:43 | FromDiscord | <hmmm> 🥳 |
20:41:07 | FromDiscord | <lytedev> TIL: std/setutils! thanks |
20:41:26 | FromDiscord | <Elegantbeef> You're welcome it's got some nice stuff some idiot made |
20:41:29 | FromDiscord | <Elegantbeef> Shit that was me |
20:41:36 | FromDiscord | <Elegantbeef> 😛 |
20:42:26 | FromDiscord | <lytedev> why in `std/setutils` and not just in `std/sets`? |
20:42:41 | FromDiscord | <Solitude> because std/sets are hashsets |
20:42:53 | FromDiscord | <Solitude> and this is for builtin sets |
20:42:57 | FromDiscord | <lytedev> ah I see |
20:48:32 | FromDiscord | <Solitude> wait until you find about jsonutils |
20:50:55 | * | audiophile_ joined #nim |
20:52:18 | * | SebastianM quit (Quit: Bye) |
21:00:23 | FromDiscord | <Sabena Sema> ugh I have thoughts on araq’s proposal to add ADL to nim |
21:00:32 | FromDiscord | <Sabena Sema> I should write them up |
21:02:38 | FromDiscord | <retkid> is there any cools sugar way to organize a sequence into a squence of sequences |
21:02:42 | FromDiscord | <retkid> (edit) "squence" => "sequence" |
21:03:34 | FromDiscord | <retkid> oooh i can use chunks again! |
21:11:16 | FromDiscord | <retkid> i got it <3 |
21:11:29 | FromDiscord | <michaelb> if I have `proc foo(x: varargs[uint]): uint`, in the body of `foo` how can I forward `x` to `bitops.bitor`? |
21:12:36 | FromDiscord | <Solitude> just as a regular argument |
21:12:43 | FromDiscord | <retkid> im a cylcepath |
21:13:23 | FromDiscord | <retkid> wait im gonna show you why |
21:15:00 | FromDiscord | <TryAngle> how do I import a local nimble project that is not (yet?) published on nimble? |
21:15:10 | FromDiscord | <retkid> var full = unorganized.organizeRow(width).map(x => x.join().splitHex((pad+1)6)).map(x => x.map(y => cutString(y))) |
21:15:15 | FromDiscord | <retkid> (edit) "var full = unorganized.organizeRow(width).map(x => x.join().splitHex((pad+1)6)).map(x => x.map(y => cutString(y)))" => "sent a code paste, see https://play.nim-lang.org/#ix=" |
21:15:35 | FromDiscord | <michaelb> sent a code paste, see https://play.nim-lang.org/#ix=3JaH |
21:15:41 | FromDiscord | <Solitude> In reply to @TryAngle "how do I import": nimble develop |
21:16:09 | FromDiscord | <michaelb> (edit) "https://play.nim-lang.org/#ix=3JaH" => "https://play.nim-lang.org/#ix=3JaI" |
21:16:15 | FromDiscord | <Solitude> and import it like any other package |
21:16:42 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JaJ |
21:18:15 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3JaK |
21:18:24 | FromDiscord | <TryAngle> so I can require it in projectB |
21:19:24 | FromDiscord | <Solitude> yes |
21:19:31 | FromDiscord | <TryAngle> ah I see thanks |
21:19:35 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3JaK" => "https://play.nim-lang.org/#ix=3JaL" |
21:20:34 | FromDiscord | <retkid> can i filter a list for its length |
21:20:53 | FromDiscord | <retkid> if slice mod 4 != 0: remove |
21:23:52 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3JaM |
21:23:58 | FromDiscord | <michaelb> 😿 |
21:24:09 | FromDiscord | <Solitude> yep, generics are buggy as hell |
21:24:24 | FromDiscord | <michaelb> I guess I can try a reduce or loop |
21:31:25 | FromDiscord | <Elegantbeef> Brain what's the real code? |
21:31:37 | FromDiscord | <Elegantbeef> `varargs` are converted to arrays internally so you'd need to index it |
21:33:50 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3JaP |
21:34:52 | FromDiscord | <Elegantbeef> Interesting |
21:44:27 | FromDiscord | <Sabena Sema> uint of int? |
21:44:54 | FromDiscord | <Sabena Sema> it seems zah got distracted with blorkchain a few years ago 😦 |
21:44:59 | FromDiscord | <Elegantbeef> `uint` apparently is just broke |
21:45:04 | FromDiscord | <Sabena Sema> most of these bugs are nit actually that had to fix tho |
21:45:18 | FromDiscord | <Elegantbeef> Indeed |
21:45:22 | FromDiscord | <Sabena Sema> (edit) "nit" => "not" |
21:45:23 | FromDiscord | <Elegantbeef> So start helping 😛 |
21:45:30 | nrds | <Prestige99> wat |
21:45:33 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix= |
21:45:37 | nrds | <Prestige99> why echo T and not echo i? |
21:45:38 | FromDiscord | <retkid> kinda proud of this |
21:45:46 | FromDiscord | <Sabena Sema> wants the type |
21:45:51 | FromDiscord | <Sabena Sema> bot the value |
21:45:52 | FromDiscord | <Elegantbeef> They want to see the type that is bounded |
21:45:56 | nrds | <Prestige99> o |
21:46:17 | FromDiscord | <Sabena Sema> in any event it is hard to forward parameters through generics |
21:46:28 | FromDiscord | <Sabena Sema> easier to do with a macro or template |
21:46:41 | FromDiscord | <retkid> still dont understand macros |
21:47:10 | nrds | <Prestige99> beef link your dev.to post |
21:47:12 | nrds | <Prestige99> :P |
21:47:45 | FromDiscord | <Elegantbeef> It's a bit outdated with `genast` |
21:47:54 | FromDiscord | <Elegantbeef> But if you want me to https://dev.to/beef331/demystification-of-macros-in-nim-13n8 |
21:48:05 | nrds | <Prestige99> update it ;) |
21:51:51 | FromDiscord | <Elegantbeef> Nah gotta see why the above generic doesnt concretely bind to `uint` |
21:53:17 | FromDiscord | <retkid> elegant way to flatten a list |
21:55:00 | FromDiscord | <retkid> (edit) "list" => "sequence" |
21:56:12 | FromDiscord | <retkid> to the person who gave me itertools |
21:56:15 | FromDiscord | <retkid> my life will never be the same |
21:56:40 | FromDiscord | <retkid> reminds me to continue my Ocaml quest |
22:22:37 | FromDiscord | <Ricky Spanish> are there pre-compiled releases of nim i can download directly from a url to integrate into my ci system without running a script? i.e just the folder as is containing the binary for my platform |
22:24:08 | FromDiscord | <IsaacPaul> https://nim-lang.org/install.html |
22:24:21 | FromDiscord | <Solitude> i tried to reduce your problem and i cant reproduce it at all, varargs are forwarded as expected... |
22:24:53 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3Jb2 |
22:25:11 | FromDiscord | <michaelb> hmm |
22:25:16 | FromDiscord | <michaelb> what Nim version are you using? |
22:25:28 | FromDiscord | <Solitude> devel |
22:25:33 | FromDiscord | <michaelb> btw, I ended up using a `for` loop over the varargs, works fine |
22:25:45 | FromDiscord | <Solitude> yeah, but it should just work... |
22:25:47 | FromDiscord | <michaelb> I'm using v1.6.2, so not sure what's up |
22:26:33 | FromDiscord | <Solitude> it was erroring for me too, magical |
22:27:28 | FromDiscord | <Solitude> In reply to @brainproxy "I'm using v1.6.2, so": wait, can you show me the body of this proc? |
22:28:00 | FromDiscord | <Ricky Spanish> the link tells me to use brew on mac or choosenim, the tarballs are for linux or a src archive is there a pre-compiled macos release? @IsaacPaul |
22:28:16 | FromDiscord | <IsaacPaul> There are not |
22:28:45 | FromDiscord | <Ricky Spanish> ah ok ill just write someting to compile it from the src tar i guess, thanks anyway |
22:31:19 | FromDiscord | <IsaacPaul> yea currently its just windows and linux |
22:31:34 | FromDiscord | <IsaacPaul> and that's what choosenim uses otherwise its builds from source |
22:41:19 | FromDiscord | <Ricky Spanish> yeh understandable its always a big like this for mac to be fair 😆 makes it a nightmare trying to automate mac builds internally |
22:42:00 | FromDiscord | <Ricky Spanish> (edit) "big" => "bit" |
22:44:07 | FromDiscord | <Elegantbeef> So solitude that issue you've showed today of `proc a[T: uint](i: T)` I think is caused because any literal smaller than the type is considered the same type, and as such the generic says "Yep this works" |
22:44:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jb5 |
22:45:12 | FromDiscord | <Elegantbeef> So i guess it's a case of "Dont allow this logic for generics" |
22:45:41 | FromDiscord | <Elegantbeef> Oh shit that applies to even normal types, this is just wrong |
22:46:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jb6 |
22:56:07 | FromDiscord | <Solitude> damn |
22:56:43 | FromDiscord | <Elegantbeef> Which means there is just an issue with integer type relations |
22:57:10 | FromDiscord | <michaelb> sent a code paste, see https://play.nim-lang.org/#ix=3Jb8 |
22:58:14 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3Jb9 |
23:00:18 | FromDiscord | <Solitude> In reply to @Elegantbeef "Which means there is": I get why it would allow to pass smaller sized number, but mixing signed/unsigned.... |
23:01:08 | FromDiscord | <Elegantbeef> It doesnt work with signed/unsigned |
23:01:22 | FromDiscord | <Elegantbeef> The reason your example works is it's a int literal and it says "yes this is valid" |
23:02:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Jbe |
23:06:18 | FromDiscord | <michaelb> In reply to @Solitude "Oh, like that, thats": can you enlighten me? |
23:11:58 | FromDiscord | <Solitude> In reply to @brainproxy "can you enlighten me?": it wont help you in your case. without a macro, at least. you can pass vararg argument to another vararg parameter, but not make varargs magically fill required parameters. without a macro. |
23:21:37 | * | audiophile_ quit (Ping timeout: 240 seconds) |
23:37:55 | FromDiscord | <qb> I'm looking for `split` which doesn't replaces the split separator. https://play.nim-lang.org/#ix=3Jbo |
23:37:59 | FromDiscord | <qb> anything done for this task? |
23:49:22 | FromDiscord | <qb> https://play.nim-lang.org/#ix=3Jbq |