00:20:34 | FromDiscord | <cyberlis (cyber_lis)> I tried to add `sink` to `createThread` with `not void`. It worked, but I had to add `sink` to `Thread`'s `dataFn`↵It doesn't work well with backwards compatibility.I guess it can be done via some build flag like `-d:sinkThreadArgs`. But I don't think Araq will be happy to see such PR \:) |
00:21:08 | FromDiscord | <Elegantbeef> Yea it's not ideal |
00:21:42 | FromDiscord | <Elegantbeef> Pre 2.0 there wasnt really much of "Giving up resources" though, so making nim 2.x better is a nice path |
00:32:18 | FromDiscord | <Elegantbeef> Likely best to make your own library if you really want this API |
00:32:35 | * | beholders_eye quit (Ping timeout: 255 seconds) |
00:38:35 | FromDiscord | <cyberlis (cyber_lis)> Interesting idea. Maybe I will try |
00:58:10 | arkanoid | I have a very large object (the object representing the context of a scientific simulation) that needs to be accessed by the main loop of the simulation, that needs to run as fast as possible. I can take that large object to the main loop function as a ref object by parameter, or as a global, or as a non-var stack parameter. Which of these is better/faster in your opinion? |
01:02:48 | FromDiscord | <Elegantbeef> Just take it as the type |
01:02:53 | FromDiscord | <Elegantbeef> `proc doThing(bleh: Type)` |
01:03:29 | arkanoid | ok, but this takes in 2 of the 3 options above. Type is a ref type, or lives on the stack? |
01:03:49 | FromDiscord | <Elegantbeef> It doesnt matter |
01:04:05 | FromDiscord | <Elegantbeef> If you do not care about the stack implications and do not copy it it couldnt matter leess |
01:04:10 | FromDiscord | <Elegantbeef> less\ |
01:04:11 | arkanoid | is a non var param always an hidden pointer? |
01:04:27 | FromDiscord | <Elegantbeef> When the size is large enough(\> 3 floats) |
01:04:48 | arkanoid | ok, thanks |
01:05:25 | arkanoid | this stack+hidden ref vs ref type thing alwasy confuse me |
01:05:40 | FromDiscord | <Elegantbeef> It shouldnt |
01:05:41 | arkanoid | Nim makes like you don't need the heap |
01:05:46 | NimEventer | New Nimble package! stackclosures - Allocate closures on stack, see https://github.com/guibar64/stackclosures |
01:05:52 | FromDiscord | <Elegantbeef> In Nim if you need reference semantics you don't use `ref` |
01:06:24 | FromDiscord | <Elegantbeef> I mean if you need them 😄 |
01:06:24 | FromDiscord | <Elegantbeef> Otherwise you should not need `ref` |
01:07:06 | arkanoid | it makes me feel noob after months of writing nim not having a very clear picture of "when I need reference semantics" |
01:08:17 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/8426#54529 |
01:10:26 | arkanoid | this is gold, thanks again |
01:13:04 | FromDiscord | <Elegantbeef> It's at most silver |
01:17:07 | arkanoid | even better, cheaper and always beats rust |
01:17:14 | arkanoid | ba-dum-tss |
01:20:35 | FromDiscord | <Elegantbeef> Anyway in Nim with Arc/Orc there is very little reason to use `ref` unless you want to have a many to 1 relation or are using inheritance |
01:20:38 | FromDiscord | <Elegantbeef> There is a caveat, but meh |
01:23:56 | FromDiscord | <michaelb.eth> I have a `type Foo = Table[string, seq[int]]`. I'm using arc and when looking up a value in instance of Foo, how can I avoid copying the sequence? |
01:24:22 | FromDiscord | <Elegantbeef> modifying tables to return a `lent T` |
01:24:26 | FromDiscord | <Elegantbeef> Which has been done in tables iirc |
01:25:53 | FromDiscord | <michaelb.eth> I'm still seeing copy behavior in both 2.0 and devel, at least I think I am re: `--expandArc` |
01:26:09 | FromDiscord | <Elegantbeef> Yea it's not `lent` in 2.0 |
01:26:11 | FromDiscord | <Elegantbeef> It's lent in devel |
01:26:15 | FromDiscord | <michaelb.eth> I mean I expect it in 2.0, like you say, but in devel shouldn't it be lent? |
01:26:20 | FromDiscord | <michaelb.eth> right |
01:26:40 | FromDiscord | <Elegantbeef> I might be misremembering but yea |
01:27:17 | arkanoid | to ensure you're not copying you can disable the relevant hook procs on that type, then you get compile error |
01:27:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Kcq |
01:28:10 | FromDiscord | <Elegantbeef> whoops `tables.[](t.addr[], key)` |
01:28:50 | FromDiscord | <michaelb.eth> https://github.com/nim-lang/Nim/pull/22812/files |
01:28:55 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "You could define your": will try, thanks |
01:33:56 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/19572 that's not really a bug, right? SslContext just doesn't have a destructor and instead has an explicit `destroyContext` proc, so if anything, this issue is about getting a default destructor and not a memory leak per se? |
01:35:27 | FromDiscord | <Elegantbeef> Seems like it to me, nim2.x feature request 😄 |
01:46:19 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "whoops `tables.[](t.addr[], key)`": thanks so much, shaved like 200ms off a big run |
01:48:34 | FromDiscord | <Yardanico> also maybe `withValue` can help? |
01:48:49 | FromDiscord | <Yardanico> it essentially does the same (takes an addr) and just provides a nicer template sugar over that |
01:49:15 | FromDiscord | <Yardanico> it's also a way to check if a value exists and get it without checking if a key is in the table twice |
01:49:56 | FromDiscord | <michaelb.eth> good idea, and actually using that already, this is a different case where I'm trying to shave off time in lookups where I know 100% that the key is there |
01:50:21 | FromDiscord | <Yardanico> hmm |
02:31:34 | FromDiscord | <michaelb.eth> tried to answer my own question by experimenting, but... I have `type Foo = object` and from `seq[Foo]` I'd like to return `lent Foo` instead of copying |
02:31:55 | FromDiscord | <michaelb.eth> I tried similar to what was suggested and works for Table above |
02:32:24 | FromDiscord | <michaelb.eth> but I couldn't get my proc to run, i.e. not seeing the debugEcho I stuck in there to make sure it's what was being used |
02:35:12 | FromDiscord | <Elegantbeef> huh? |
02:39:45 | FromDiscord | <michaelb.eth> so I've got this `let foos = ...` that's a `seq[Foo]` and currently I store some non-copying references via `ptr Foo`. Maybe that's the best I can do, wasn't sure if I could override `[]` with return of `lent Foo` so I don't have to explicitly use addr/ptr |
02:40:03 | FromDiscord | <michaelb.eth> but that may be a misunderstanding of what lent can do for me |
02:40:28 | FromDiscord | <Elegantbeef> `let a = ...` always copies |
02:40:41 | FromDiscord | <Elegantbeef> Nim does not have any borrow checking as such there is no safe way to take a reference |
02:41:10 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Nim does not have": i mean, don't views have it in a very early phase? |
02:41:14 | FromDiscord | <Yardanico> although you have to explicitly enable them |
02:43:46 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "`let a = ...`": no I meant the the seq[Foo] is already setup with let, but I want to reference members of the seq elsewhere |
02:44:20 | FromDiscord | <michaelb.eth> ptr works, it's fine, I just was experimenting after reducing copying overhead with help of lent for my table |
02:44:24 | FromDiscord | <Elegantbeef> Views do exist, but let's be honest it'll explode in your face 9/10 times |
02:45:18 | FromDiscord | <Yardanico> true |
02:46:40 | FromDiscord | <Elegantbeef> Oh right `[]` cannot be overidden for `seq`/`array`/`openArray` iirc |
02:47:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4KcE |
02:50:41 | FromDiscord | <Elegantbeef> Though replacing with `[]` does not cause a error |
03:01:43 | FromDiscord | <michaelb.eth> tried it, still seeing `=copy` in --expandArc output, though I'm doing like `b = a{1}` |
03:01:56 | FromDiscord | <michaelb.eth> so maybe I can't avoid it in that situation because it's assignment? |
03:10:28 | FromDiscord | <Elegantbeef> Like i said |
03:10:36 | FromDiscord | <Elegantbeef> Any variable assignment requires a copy |
03:10:57 | FromDiscord | <michaelb.eth> got it |
03:13:14 | FromDiscord | <michaelb.eth> beef, would you like me to give credit in an `@` mention when I submit the PR that makes use of the table lent thing? |
03:13:25 | FromDiscord | <michaelb.eth> (edit) "beef, would you like me to give ... credit" added "you" |
03:13:40 | FromDiscord | <Elegantbeef> I couldn't care less |
03:14:17 | FromDiscord | <michaelb.eth> okay, just didn't want to do it if you don't want me to |
03:14:41 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4KcM |
03:15:04 | FromDiscord | <takemichihanagaki3129> What should I do? |
03:16:07 | FromDiscord | <intellij_gamer> Make it be `config.nims` instead of `test.nims` so that it gets automatically loaded |
03:16:23 | FromDiscord | <takemichihanagaki3129> In reply to @intellij_gamer "Make it be `config.nims`": Hmmm, thank you a lot! |
03:17:16 | FromDiscord | <Elegantbeef> name it `config.nims` |
03:20:25 | FromDiscord | <takemichihanagaki3129> Worked! But, is it possible to mix `task`s with optional arguments? |
03:20:45 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4KcO |
03:25:22 | FromDiscord | <Elegantbeef> Think you have to manually parse |
03:28:50 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "Think you have to": Yes! I'll try to create my own `task`-like template to it. Thanks again! |
05:09:23 | * | CO2 quit (Quit: WeeChat 4.1.0) |
05:14:28 | FromDiscord | <nasuray> In reply to @takemichihanagaki3129 "Yes! I'll try to": I've used something similar to this in a custom `build` task. https://stackoverflow.com/a/74919237 |
05:18:17 | * | jkl joined #nim |
05:18:22 | FromDiscord | <0_archkubi_0> sent a code paste, see https://paste.rs/e8119 |
05:19:02 | FromDiscord | <0_archkubi_0> (edit) "https://play.nim-lang.org/#ix=4Kdi" => "https://play.nim-lang.org/#ix=4Kdh" |
05:20:41 | FromDiscord | <0_archkubi_0> broo my computer slow now why ? |
05:23:42 | FromDiscord | <0_archkubi_0> helloooooo somone tell me why this is use too much cpu ? |
05:27:38 | FromDiscord | <0_archkubi_0> helooooooo why only ouput is Downloading https://github.com/nim-lang/Nim.git using git and still say Downloading https://github.com/nim-lang/Nim.git using git ? and use %100 cpu what is this gta 5 ? help me please ? |
05:32:01 | FromDiscord | <0_archkubi_0> i hope my cpu not dead ... still Downloading https://github.com/nim-lang/Nim.git using git |
05:34:35 | FromDiscord | <demotomohiro> When Nim compile Nim code, Nim calls gcc and gcc calls cc1. |
05:34:54 | FromDiscord | <0_archkubi_0> and old legends say still Downloading https://github.com/nim-lang/Nim.git using git |
05:35:48 | FromDiscord | <0_archkubi_0> my computer never be slow i install software in arch linux aur from source |
05:36:45 | FromDiscord | <0_archkubi_0> why here is no progress output for this ? |
05:38:13 | FromDiscord | <demotomohiro> I don't know what you are compiling, but if you are compiling Nim from source, it takes long time and calls gcc at same time and uses many cores. |
05:39:05 | FromDiscord | <0_archkubi_0> if i can see % something left this is can be good |
05:39:21 | FromDiscord | <demotomohiro> I guess there is no progress output because it is very hard to predict how long time it takes. |
05:40:28 | FromDiscord | <0_archkubi_0> anything better than this Downloading https://github.com/nim-lang/Nim.git using git zero output. finish now finaly |
05:44:04 | FromDiscord | <0_archkubi_0> Unable to find nimlangserver, trying to install it via '/usr/bin/nimble install nimlangserver --accept' nice |
05:46:38 | FromDiscord | <0_archkubi_0> https://tenor.com/view/%E7%9A%849-gif-27299608 |
05:47:09 | FromDiscord | <0_archkubi_0> i jut want to autocomplete in vscode bruh |
05:50:26 | FromDiscord | <0_archkubi_0> The Nim Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. bruh |
05:52:45 | NimEventer | New thread by dwhall256: How to get rid of "_ZL10nimZeroMemPvl" in an embedded target?, see https://forum.nim-lang.org/t/10576 |
06:07:36 | FromDiscord | <0_archkubi_0> sent a code paste, see https://play.nim-lang.org/#ix=4Kdq |
06:31:34 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4Kdu |
06:36:41 | FromDiscord | <0_archkubi_0> sent a code paste, see https://play.nim-lang.org/#ix=4Kdv |
06:36:53 | FromDiscord | <0_archkubi_0> i hope this is right works but |
06:38:32 | FromDiscord | <0_archkubi_0> I tried to guess this value like type something like |
06:56:55 | FromDiscord | <ingo_61476> sent a code paste, see https://play.nim-lang.org/#ix=4Kdz |
07:37:35 | FromDiscord | <0_archkubi_0> sent a code paste, see https://play.nim-lang.org/#ix=4KdI |
08:01:18 | FromDiscord | <0_archkubi_0> sent a code paste, see https://play.nim-lang.org/#ix=4KdT |
08:25:32 | FromDiscord | <0_archkubi_0> invalid type: 'object' in this context: 'seq[object]' for var how i do that ? |
08:26:03 | FromDiscord | <0_archkubi_0> sent a code paste, see https://play.nim-lang.org/#ix=4KdY |
08:26:37 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4KdZ |
08:27:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ke0 |
08:27:08 | * | krobelus joined #nim |
08:27:50 | FromDiscord | <Phil> In this particular instance it's that `seq[object]` is not a valid type because it's not specific. |
08:27:51 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4Ke1 |
08:28:29 | FromDiscord | <Phil> Types in nim must be specific unless you're getting into generics, which you haven't been so far and I'd only recommend getting into generics once you've understood the basics |
08:28:37 | krobelus | I created a binary module with "nimble init" but "nimble build" does not seem to work and there is no intelligible error message. See https://github.com/kak-lsp/kak-lsp/issues/695#issuecomment-1784000940 |
08:29:01 | krobelus | It just says "Error: Build failed for the package: nim", no reason |
08:29:18 | * | Qaziquza joined #nim |
08:29:19 | FromDiscord | <0_archkubi_0> i just want finish my game nim is to hard language c easy than nim |
08:30:34 | krobelus | My goal is to set up a minimal working Nim project |
08:30:42 | FromDiscord | <nnsee> In reply to @krobelus "It just says "Error:": wild guess - maybe use another project name |
08:30:43 | FromDiscord | <Phil> That isn't really the case given the memory gymnastics C requires at even medium proficiency. |
08:31:13 | FromDiscord | <nnsee> maybe there's a dependency clusterfuck if you name it `nim` |
08:31:48 | FromDiscord | <Phil> What you're running into is the difference between C's "who knows" type system and nim's static type system for the most part.↵The latter of which allows you to notice certain issues at compiletime so you don't have to figure them out at runtime |
08:31:53 | FromDiscord | <nnsee> In reply to @0_archkubi_0 "i just want finish": as with any language, you need to learn the syntax to use it |
08:32:22 | FromDiscord | <nnsee> and nim's syntax is not exactly hard to learn |
08:32:31 | FromDiscord | <0_archkubi_0> i don't know what language make list to hard you gimve example for this |
08:32:32 | krobelus | nnsee: you're right, thanks so much! |
08:32:42 | FromDiscord | <Elegantbeef> I mean they've explicitly said "Quick just fix my code" that's a sign that they don't want to learn |
08:33:12 | FromDiscord | <nnsee> In reply to @krobelus "<@961485620075720734>: you're right, thanks": great! glad you got it working |
08:33:13 | FromDiscord | <0_archkubi_0> (edit) "gimve" => "give me" |
08:33:19 | * | Qaziquza quit (Client Quit) |
08:34:29 | FromDiscord | <cephonaltera> In reply to @0_archkubi_0 "i don't know what": my dude, object is a keyword, its like typeing `struct[100]` |
08:34:38 | FromDiscord | <cephonaltera> (edit) "typeing" => "typing" |
08:34:52 | FromDiscord | <0_archkubi_0> okay what type i need for this ? |
08:35:04 | FromDiscord | <Elegantbeef> Then bitching that C is harder than ASM\ |
08:35:06 | FromDiscord | <cephonaltera> the type you defined, `AstroObject` |
08:35:08 | FromDiscord | <nnsee> In reply to @0_archkubi_0 "okay what type i": i literally told you my friend |
08:35:34 | FromDiscord | <nnsee> In reply to @nnsee "If you want a": here |
08:35:56 | FromDiscord | <0_archkubi_0> i'm little tired you know i'm not sleep 27 hour |
08:36:11 | FromDiscord | <nnsee> er, maybe you should take a break |
08:36:19 | FromDiscord | <Phil> Please just work your ways through the tutorials to learn nim syntax basics.↵And yeah, sleep. |
08:36:49 | * | cnx quit (Remote host closed the connection) |
08:37:08 | FromDiscord | <0_archkubi_0> i just write game nim/raylib thats it nim not for me |
08:37:36 | FromDiscord | <Elegantbeef> You went 0-100 writing a game inside Nim without learning Nim |
08:37:37 | * | cnx joined #nim |
08:38:13 | FromDiscord | <0_archkubi_0> i finish simple gameplay in c,python,rust,go and nim finish i hope |
08:38:24 | FromDiscord | <nnsee> writing a game in any language is hard, but it's infinitely harder without knowing the language's syntax |
08:39:04 | FromDiscord | <Elegantbeef> I've been rolling a dice for every character I type in my games |
08:39:05 | FromDiscord | <Elegantbeef> Worked so far |
08:39:20 | FromDiscord | <0_archkubi_0> nice |
08:39:30 | FromDiscord | <nnsee> In reply to @nnsee "writing a game in": like trying to write a novel in a language you can't speak |
08:39:57 | FromDiscord | <Elegantbeef> Die red car was very blitz |
08:40:18 | FromDiscord | <0_archkubi_0> i know c,python little go and rust i never write code like nim |
08:40:37 | FromDiscord | <Elegantbeef> This is just a lie now |
08:40:53 | FromDiscord | <Elegantbeef> In rust you declare a struct then would do `vec<StructName>` |
08:40:55 | FromDiscord | <0_archkubi_0> i can show you my language scripts |
08:41:05 | FromDiscord | <Elegantbeef> I mean Rust and Nim are not disimilar |
08:41:05 | FromDiscord | <0_archkubi_0> i'm noob in rust |
08:41:20 | FromDiscord | <Phil> In reply to @Elegantbeef "I've been rolling a": For you? Makes sense |
08:42:14 | FromDiscord | <Phil> The difference here is I roll 2 d100's for entire words to glue together, much more readable |
08:42:49 | FromDiscord | <Elegantbeef> 200 words? Hardly can count with that few |
08:43:25 | FromDiscord | <Phil> My dude, 2d100's is 100^2 possibilities! |
08:44:20 | FromDiscord | <Phil> Wait, fuck, that's dungeons and dragons dice notation, I forgot that's not wide-spread |
08:44:29 | FromDiscord | <Phil> 2d200 = two dice with 100 sides |
08:44:37 | FromDiscord | <cephonaltera> I can see the confusion if he maybe learned something like Java first. is `new Object[]();` valid in Java or is Object abstract? |
08:44:43 | FromDiscord | <Phil> (edit) "2d200" => "2d100" |
08:45:04 | FromDiscord | <Phil> You would never ever ever ever ever do new Object() |
08:45:08 | FromDiscord | <Phil> (edit) "You would never ever ever ever ever do new Object() ... " added "in java" |
08:45:17 | FromDiscord | <cephonaltera> oh but i would, im daring like that |
08:45:30 | FromDiscord | <Phil> It's possible, but you would always make an explicit type with the fields you need and a constructor |
08:45:46 | FromDiscord | <Phil> An object on its own is basically useless, can't even be used as a data vehicle |
08:46:33 | FromDiscord | <Phil> Similarly in java you wouldn't do `List<Object>`, you would do `List<ExplicitType>` or `List<SomeInterface>` |
08:47:20 | FromDiscord | <Elegantbeef> Object boxes all types in Java so yea you'd never do that 😄 |
08:47:50 | FromDiscord | <Elegantbeef> Oh wait that's `Object[]` 😄 |
08:47:58 | FromDiscord | <Elegantbeef> I can read |
08:48:19 | FromDiscord | <Elegantbeef> read, reid, reed, read |
08:49:12 | FromDiscord | <gyatsoyt> Okay so I am using a library python chess through nimpy so I already have a chess engine made in python which is ridiculously slow so I tried making it in nim but can you tell me I am still using the same library but the algorithms the engine has is all written in nim so will this make the engine faster cz algorithms are written in nim like minimax l,alpha-beta pruning and stuffs . Or it will have the same performance as python. |
08:49:15 | FromDiscord | <0_archkubi_0> sent a long message, see http://ix.io/4Ke5 |
08:49:48 | FromDiscord | <Elegantbeef> I mean if you want it faster writing it in Nim will likely be faster |
08:50:00 | FromDiscord | <0_archkubi_0> i'm not lier bro |
08:50:07 | FromDiscord | <Elegantbeef> No one called you a liar |
08:50:09 | FromDiscord | <0_archkubi_0> but yes i'm dumb |
08:50:23 | FromDiscord | <Elegantbeef> We just said your saying "Nim is not like the others" is absolute bullshite |
08:50:37 | krobelus | On a minimal nim binary project, I run "nimsuggest totallynotnim.nimble --v3 --autobind" but it just exits with status 1, no indication of what's wrong |
08:50:54 | FromDiscord | <Elegantbeef> In C you'd never do `struct` you'd do `MyStruct` in Rust you'd do `vec<MyStruct>`, .... |
08:51:16 | FromDiscord | <0_archkubi_0> In reply to @Elegantbeef "This is just a": 🙄 |
08:51:39 | FromDiscord | <Elegantbeef> > i never write code like nim |
08:51:44 | krobelus | same if I pass src/*.nim instead of the nimble file |
08:51:44 | FromDiscord | <Phil> In reply to @gyatsoyt "Okay so I am": Could you rephrase that? I'm not entirely sure I get what you're writing.↵So basically you used a python lib for chess, then swapped to nim and are still calling the python lib and want to ask if that's faster?↵Likely yes, but only the parts of the code that are nim will execute faster than their python counterparts |
08:51:45 | FromDiscord | <Elegantbeef> you wrote Rust and C |
08:51:53 | FromDiscord | <Elegantbeef> Those are both like Nim |
08:52:30 | FromDiscord | <0_archkubi_0> there is no var astros: seq[AstroObject]↵astros = @[] this is rust or c ? |
08:53:08 | FromDiscord | <Elegantbeef> Lol |
08:53:14 | FromDiscord | <0_archkubi_0> let mut astros: Vec<AstroObject> = Vec::new(); |
08:53:25 | FromDiscord | <Elegantbeef> `let mut astros = vec<AstroObject>()` seems very similar |
08:53:31 | FromDiscord | <Elegantbeef> Like shockingly similar |
08:53:38 | FromDiscord | <Phil> `var astros: seq[AstroObject] = @[]` |
08:53:59 | FromDiscord | <Elegantbeef> Or `AstroObject astros = 0;` |
08:54:04 | FromDiscord | <Elegantbeef> Damn these are all similar |
08:54:14 | FromDiscord | <Elegantbeef> or rather `{}` |
08:54:18 | FromDiscord | <0_archkubi_0> let mut astros: Vec<AstroObject> = Vec::new(); this and var astros: seq[AstroObject] = @[] how similar you guys know better than me |
08:54:26 | FromDiscord | <cephonaltera> sent a long message, see http://ix.io/4Ke6 |
08:54:39 | FromDiscord | <cephonaltera> In reply to @0_archkubi_0 "let mut astros: Vec<AstroObject>": yes these are identical |
08:54:41 | FromDiscord | <Elegantbeef> Let's see both Nim and Rust have generics |
08:54:47 | FromDiscord | <Elegantbeef> You do not use `vec<struct>` |
08:54:49 | FromDiscord | <Elegantbeef> You use `vec<AstroObject>` |
08:55:20 | FromDiscord | <0_archkubi_0> seq is vec? |
08:55:28 | FromDiscord | <Elegantbeef> It's just so inane to act like they're vastly different |
08:55:34 | FromDiscord | <Phil> ... why wouldn't it be? |
08:55:46 | FromDiscord | <Elegantbeef> How did you even stumble on `seq` if you didn't read about it being a dynamic array |
08:56:28 | FromDiscord | <0_archkubi_0> i watch youtube tutorial |
08:56:37 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut1.html |
08:56:59 | FromDiscord | <Elegantbeef> https://nim-lang.org/documentation.html |
08:57:18 | FromDiscord | <Phil> sent a long message, see http://ix.io/4Ke7 |
08:57:24 | FromDiscord | <Phil> (edit) "http://ix.io/4Ke7" => "http://ix.io/4Ke8" |
08:57:38 | FromDiscord | <Phil> The above basically describe vectors |
08:57:43 | FromDiscord | <Elegantbeef> https://www.nimprogrammingbook.com/book/nimprogramming_rouge_molokai.html |
08:57:54 | FromDiscord | <Phil> Okay that link looks exotic |
08:57:56 | FromDiscord | <Elegantbeef> There you go, have yourself a merry little christmas with good tutorials |
08:58:34 | FromDiscord | <Elegantbeef> That's Salewski's book |
08:58:51 | FromDiscord | <Phil> Huh, I could've sworn I found it under a different URL way back when |
08:58:51 | FromDiscord | <Elegantbeef> https://www.nimprogrammingbook.com/ actual site has a bunch of things to choose from |
08:59:15 | FromDiscord | <Elegantbeef> Themes for Html, PDF, a place to order it |
09:00:35 | FromDiscord | <0_archkubi_0> i read doc later i'm go sleep thanks for help |
09:00:54 | FromDiscord | <Elegantbeef> Though given that he's started using chatgpt for generating things I'm a bit weary about suggesting the book anymore |
09:02:02 | FromDiscord | <0_archkubi_0> bro chatgpt is bad i watch video anyway good day |
09:02:15 | FromDiscord | <Elegantbeef> Don't watch videos to learn |
09:02:44 | FromDiscord | <Elegantbeef> There is very little reason to watch a video to learn a programming language |
09:04:15 | FromDiscord | <Phil> I like talks for architecture talks about programming languages |
09:04:28 | FromDiscord | <Phil> Still love Raymond Hattinger talk videos |
09:04:40 | FromDiscord | <Elegantbeef> Right but no one should ever sit through "How to program in X" |
09:04:51 | FromDiscord | <Phil> "Let the pattern discover itself" is maxime I still use |
09:04:59 | FromDiscord | <Phil> (edit) ""Let the pattern discover itself" is ... maxime" added "a" |
09:05:18 | FromDiscord | <Elegantbeef> Here I thought I invented that 😛 |
09:06:08 | FromDiscord | <nnsee> In reply to @isofruit "An object on its": as a pentester, it's not useless to me - it can be used to reach `(java.lang.Runtime).getRuntime().exec()` 😅 |
09:07:58 | FromDiscord | <Phil> In reply to @Elegantbeef "Here I thought I": You're too much of a youngin for that 😛 |
09:08:39 | FromDiscord | <Elegantbeef> Eh people throw darts and generally go into many ranges of ages |
09:08:40 | FromDiscord | <Elegantbeef> So perhaps I'm not a zoomer afterall |
09:18:17 | * | aa204 joined #nim |
09:25:03 | * | aa204 quit (Quit: Client closed) |
09:54:25 | * | junaid_ joined #nim |
10:00:09 | FromDiscord | <Phil> At this point I need to write myself a memo given how often I forget and look up again how to read in a file |
10:00:53 | FromDiscord | <Phil> Oh wow, stab in the dark `readFile("<filePath>")` was it already |
10:01:01 | FromDiscord | <Phil> Now I also remember why I never write myself a memo |
10:06:13 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kew |
10:06:15 | FromDiscord | <gyatsoyt> Any idea |
10:06:27 | * | CO2 joined #nim |
10:08:22 | FromDiscord | <inventormatt> sent a code paste, see https://play.nim-lang.org/#ix=4Kex |
10:17:12 | * | junaid_ quit (Remote host closed the connection) |
10:17:12 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kez |
10:18:10 | FromDiscord | <Phil> Always remember:↵Python code returns pyobjects, to get a useable "nim-type" out of that you got to convert via `.to(<nimtype>)` |
10:18:54 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KeA |
10:19:21 | FromDiscord | <gyatsoyt> I mean in python we can define functions anywhere in the code and it still works but here It seems to be a little problematic |
10:20:26 | FromDiscord | <Phil> In reply to @gyatsoyt "I have a proc": Yeah in nim a proc can only access things that came before it.↵To escape that you can engage in what's called "forward declarations" |
10:20:47 | FromDiscord | <gyatsoyt> In reply to @isofruit "Yeah in nim a": I would likely wanna know about forward declarations |
10:20:55 | FromDiscord | <Phil> Gimme a sec to cook up examples |
10:21:06 | FromDiscord | <inventormatt> sent a code paste, see https://play.nim-lang.org/#ix=4KeB |
10:22:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KeC |
10:22:14 | FromDiscord | <Phil> A forward declaration is basically just a copy-paste of the proc signature without the `=` at the end |
10:22:30 | FromDiscord | <Phil> Note that the order of forward declarations is completely irrelevant |
10:23:59 | FromDiscord | <Phil> A forward declaration tells the compiler "These procs will exist". So the compiler may not yet know what they'll do, but it'll know that they exist, so it doesn't throw errors when you reference a proc that hasn't yet been defined since it knows "Wait, he told me before that it'll be there" |
10:24:26 | FromDiscord | <Phil> However if you then fail to provide an implementation for a proc you forward declared the compiler will find you and it will complain |
10:24:48 | FromDiscord | <gyatsoyt> Ohk understand |
10:25:04 | FromDiscord | <gyatsoyt> So it's like declaring empty variables in python |
10:25:11 | FromDiscord | <gyatsoyt> And then using it whenever we want |
10:25:13 | FromDiscord | <gyatsoyt> Understood |
10:25:14 | FromDiscord | <Phil> Kinda |
10:25:22 | FromDiscord | <gyatsoyt> Thankss |
10:25:43 | FromDiscord | <Phil> Happy to help, I mean I learned how to actually make use of forward declarations like a week ago myself 😛 |
10:26:16 | FromDiscord | <Phil> I prefer reordering my code and only use them where some procs cross-reference each other in certain ways |
10:28:56 | FromDiscord | <gyatsoyt> In reply to @isofruit "I prefer reordering my": Oh |
10:32:12 | * | junaid_ joined #nim |
10:33:55 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KeK |
10:33:56 | FromDiscord | <gyatsoyt> I might be a bit annoying 💀 |
10:35:46 | * | krobelus left #nim (WeeChat 2.8) |
10:35:57 | * | junaid_ quit (Remote host closed the connection) |
10:38:38 | FromDiscord | <Phil> I mean, it helps if you copy paste the text in a codeblock rather than screenshot it 😛 |
10:39:03 | FromDiscord | <gyatsoyt> In reply to @isofruit "I mean, it helps": Sure lemme do it |
10:39:34 | FromDiscord | <Phil> In reply to @gyatsoyt "Sure lemme do it": chess.PAWN is a PyObject |
10:39:37 | FromDiscord | <Phil> got to convert it back to int |
10:39:49 | FromDiscord | <gyatsoyt> So |
10:39:54 | FromDiscord | <gyatsoyt> .to(int) |
10:39:58 | FromDiscord | <Phil> Always remember that everything comming out of chess is a PyObject |
10:40:09 | FromDiscord | <Phil> yeah, that should do it |
10:40:18 | FromDiscord | <Phil> You may get a runtime error if it doesn't |
10:41:04 | FromDiscord | <gyatsoyt> In reply to @isofruit "You may get a": /home/runner/Engine/evaluate.nim:125:21 Error: type mismatch: got '(string, int)' for 'pieceValue[to(getAttr(chess, "PAWN"), int)]' but expected 'float' |
10:41:05 | FromDiscord | <gyatsoyt> This |
10:41:18 | FromDiscord | <gyatsoyt> (edit) "In reply to @isofruit "You may get a": /home/runner/Engine/evaluate.nim:125:21 Error: type mismatch: got '(string, int)' for 'pieceValue[to(getAttr(chess, "PAWN"), int)]' but expected 'float'" => "sent a code paste, see https://play.nim-lang.org/#ix=4KeL" |
10:42:21 | FromDiscord | <Phil> I mean, that one's almost obvious |
10:42:51 | FromDiscord | <Phil> Of your prior error message, read the first line, that tells you the type that is inside of the array |
10:43:08 | FromDiscord | <Phil> And then ask yourself if that can be converted into a float willy nilly or if you need to do something 😛 |
10:50:08 | FromDiscord | <Phil> Honestly for your own sanity I'd recommend not doing so much in a single line of code |
10:50:15 | FromDiscord | <Phil> Makes debugging and reading easier |
10:50:49 | FromDiscord | <gyatsoyt> In reply to @isofruit "Honestly for your own": Umm |
10:51:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KeO |
10:51:43 | FromDiscord | <Phil> Would be a different way of writing the same, assuming that even works |
10:53:57 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KeP |
10:53:58 | FromDiscord | <gyatsoyt> What is the problem with tis |
10:53:59 | FromDiscord | <gyatsoyt> This |
10:54:08 | FromDiscord | <gyatsoyt> It wants float so I am giving it a float |
10:54:13 | FromDiscord | <gyatsoyt> It still seems to give error |
10:54:59 | FromDiscord | <Phil> I dunno what piecevalue does |
10:55:12 | FromDiscord | <gyatsoyt> In reply to @isofruit "I dunno what piecevalue": Its a constant value |
10:55:36 | FromDiscord | <gyatsoyt> Thus |
10:55:37 | FromDiscord | <Phil> In that case chess.PAWN is still a PyObject |
10:55:39 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KeR |
10:55:44 | FromDiscord | <gyatsoyt> (edit) "Thus" => "This" |
10:56:12 | FromDiscord | <Phil> What you need is a string |
10:56:21 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4KeS |
10:56:33 | FromDiscord | <gyatsoyt> Uhm |
10:56:54 | FromDiscord | <gyatsoyt> What can I do then |
10:57:08 | FromDiscord | <Phil> make it a table |
10:57:34 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KeT |
10:57:46 | FromDiscord | <Phil> You were basically only like 20 characters or so off the finish line ^^ |
10:57:52 | FromDiscord | <Phil> (edit) "You were basically only like 20 characters or so off the finish line ... ^^" added "for that particular thing" |
10:58:19 | FromDiscord | <Phil> Tables are roughly similar to python dictionaries |
10:58:33 | FromDiscord | <Phil> They have some limitations that python dictionaries don't have by virtue of being statically typed |
10:58:37 | FromDiscord | <gyatsoyt> Phl |
10:59:46 | FromDiscord | <Phil> I don't think that will fully resolve your problem though because chess.PAWN is still a pyobject.↵I honestly have no clue what is in that value, if you can `to(int)` or `to(string)` it and what it will pump out in each scenario |
10:59:58 | FromDiscord | <Phil> And I don't want to set up a virtual environment to find out |
11:04:34 | FromDiscord | <gyatsoyt> The errors are annoying me now ngl |
11:05:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KeW |
11:06:27 | FromDiscord | <Phil> Note: Chances are you'll get a runtime error for either of those |
11:11:01 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KeX |
11:13:28 | FromDiscord | <Phil> The second one likely means you're only getting ints out of there.↵Could you run the echo command for me please though? |
11:13:39 | FromDiscord | <Phil> I want to see the exact value this spits out |
11:14:27 | FromDiscord | <Phil> If I'm right it should return "1" |
11:14:43 | FromDiscord | <gyatsoyt> echo doesn't show anything |
11:14:48 | FromDiscord | <gyatsoyt> It directly shows this error |
11:15:19 | FromDiscord | <Phil> ... Fine I look into how to set up a damn virtual env |
11:15:54 | FromDiscord | <gyatsoyt> Sorry for the inconveniences |
11:16:11 | FromDiscord | <gyatsoyt> If you want I can give the whole evaluate.nim file |
11:17:30 | FromDiscord | <Phil> Just confirm to me that this is the lib https://python-chess.readthedocs.io/en/latest/core.html |
11:18:30 | FromDiscord | <Phil> And hand me the pyimport statement |
11:18:47 | FromDiscord | <gyatsoyt> In reply to @isofruit "Just confirm to me": Yes it is |
11:19:10 | FromDiscord | <gyatsoyt> Here you go |
11:19:12 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KeZ |
11:20:36 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kf1 |
11:20:53 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kf2 |
11:21:34 | FromDiscord | <gyatsoyt> Yes |
11:22:32 | FromDiscord | <Phil> Trying to access a table with string keys with an int is not in the cards.↵I'm not seeing how you'd get the string value from the python lib as apparently not even the `str` function returns `"PAWN"` |
11:22:51 | FromDiscord | <gyatsoyt> So can I do |
11:24:06 | FromDiscord | <gyatsoyt> ? |
11:24:07 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kf4 |
11:24:17 | FromDiscord | <gyatsoyt> Now I am not using strings at all |
11:25:26 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kf5 |
11:25:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kf6 |
11:25:41 | FromDiscord | <Phil> Well, need to adjust pieceVAlue |
11:26:25 | FromDiscord | <odexine> You don’t need the table anymore |
11:26:34 | FromDiscord | <odexine> Remove the table part and use [] instead of {} |
11:26:45 | FromDiscord | <odexine> Then replace the strings with the enum values |
11:26:49 | FromDiscord | <Phil> Actually fair, I forget that for enums basically always |
11:27:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kf8 |
11:27:56 | FromDiscord | <Phil> Note that a fair bit of magic happens in `chess.PAWN.to(Piece)` in one go |
11:28:34 | FromDiscord | <Phil> It takes chess.PAWN (PyObject), converts it to int (int, value 1) and then for the compiler converts it to the enum-value whose implicit value (based on the order of the enum) is 1, which is Pawn |
11:29:02 | FromDiscord | <Phil> (edit) "It takes chess.PAWN (PyObject), converts it to int (int, value 1) and then for the compiler converts it to the enum-value whose implicit ... value" added "associated int" |
11:30:21 | FromDiscord | <Phil> Actually this makes me wonder why implicit int-values associated with enums start at 1 and not at 0 |
11:30:54 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4Kfa |
11:31:00 | FromDiscord | <odexine> In reply to @isofruit "Actually this makes me": They do? |
11:31:35 | FromDiscord | <Phil> Oh woops, they don't |
11:31:38 | FromDiscord | <Phil> I just didn't read the terminal output correctly |
11:33:13 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kfb |
11:34:27 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4Kfb" => "https://play.nim-lang.org/#ix=4Kfc" |
11:34:44 | FromDiscord | <Phil> The python... enum? Something starts at 1, in nim they start at 0.↵You can adjust that as I have above |
11:35:03 | FromDiscord | <Phil> (edit) "above" => "above.↵The previous version I gave you returned `Rook` for `chess.PAWN`" |
11:47:48 | FromDiscord | <0ffh> Okay, explicitly hinting the type for concat solved it. |
11:50:04 | FromDiscord | <0ffh> At least the error message is gone. |
11:50:18 | FromDiscord | <Chronos [She/Her]> Hey @treeform do you know what to do about the test on MySQL failing specifically? The tests I added related to `dumpHook` instead of `$` would fail on all of the supported dbs before |
11:50:56 | FromDiscord | <Chronos [She/Her]> Should I just exclude MySQL from the tests? It feels a bit bad to do that but I don't know how to even go about fixing that |
11:51:53 | FromDiscord | <gyatsoyt> Its so hard to use python and nim at the same time 😞 |
11:52:07 | FromDiscord | <gyatsoyt> There is no specified Library like python-chess |
11:52:17 | FromDiscord | <gyatsoyt> (edit) "There is no specified Library like python-chess ... " added "in nim" |
11:52:27 | FromDiscord | <gyatsoyt> But python is very slow for the development I want to do |
11:52:36 | FromDiscord | <gyatsoyt> And merging both just doesn't work out |
11:52:48 | FromDiscord | <gyatsoyt> Any other way I can do this |
11:53:04 | FromDiscord | <gyatsoyt> And please don't say to write whole python chess library into nim |
11:53:29 | FromDiscord | <gyatsoyt> I cannot do it by myself because a Library with 150+ contributors and a dev team |
11:53:42 | FromDiscord | <gyatsoyt> Cannot be easily made |
11:53:58 | FromDiscord | <Phil> I mean for the most part it's a lot of typing because essentially it's writing first a "glue" layer so you can easily call the python procs from nim without needing to think about PyObject all the time |
11:54:24 | FromDiscord | <gyatsoyt> Elaborate? |
11:55:17 | FromDiscord | <gyatsoyt> I heard about py2nim is it a real thing? Like does it really change python code into nim or python projects into nim |
11:57:23 | FromDiscord | <Phil> Basically you make a "bindings" module similar to what one does when wrapping C-code.↵You basically write e.g. a `move` proc that accepts nim types, converts them to the necessary PyObject types and calls the python `move` function from there.↵And then in your actual code you only work with those "wrapper" procs and types |
11:59:46 | arkanoid | why https://play.nim-lang.org/#ix=4Kfh prints "foo.bar: foo.bar = 42" instead of "foo.bar = 42" ? |
11:59:54 | FromDiscord | <Phil> I haven't used py2nim so I can't say anythinga bout it |
12:03:44 | FromDiscord | <Phil> In reply to @arkanoid "why https://play.nim-lang.org/#ix=4Kfh prints "foo.": I mean, depends on the dumpToString implementation:↵To me it looks like it just follows the pattern of `<statement that is being dumped> : <statement with variables swapped out for values> = <value of statement >` |
12:04:00 | FromDiscord | <Phil> (edit) "values>" => "values / expanded>" |
12:04:51 | FromDiscord | <Phil> Which makes sense since foo.bar "expands" to foo.bar I guess, there are no variables to replace, the value of that is 42 in the end |
12:08:25 | arkanoid | mmm, ok |
12:15:16 | FromDiscord | <Chronos [She/Her]> In reply to @gyatsoyt "And please don't say": That's basically the only thing you can do, you're probably better off writing it in Python otherwise imo |
12:23:03 | FromDiscord | <Phil> In reply to @gyatsoyt "Its so hard to": Note, if you're fine with implicit conversion you can reduce the typing with converters |
12:23:15 | FromDiscord | <Phil> Note that that will make some things harder to debug because it'll not be obvious what was when called |
12:24:13 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kfq |
12:26:02 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4Kfq" => "https://play.nim-lang.org/#ix=4Kfr" |
12:56:06 | FromDiscord | <gyatsoyt> Is anyone interested in developing chess engine in nim 😞 |
12:57:56 | FromDiscord | <Chronos [She/Her]> Not really aha |
12:58:36 | FromDiscord | <gyatsoyt> In reply to @chronos.vitaqua "Not really aha": As expected |
13:00:21 | FromDiscord | <gyatsoyt> If only nim had libraries like python has |
13:00:31 | FromDiscord | <gyatsoyt> I would have completed the engine till now |
13:00:46 | FromDiscord | <gyatsoyt> Atleast a working engine |
13:06:04 | NimEventer | New thread by icedquinn: Stack-walking variables and Dependency Injection, see https://forum.nim-lang.org/t/10577 |
13:10:05 | FromDiscord | <hotdog6666> In reply to @gyatsoyt "Is anyone interested in": https://www.chessprogramming.org/Nalwald |
13:16:53 | FromDiscord | <gyatsoyt> Well |
13:16:57 | FromDiscord | <gyatsoyt> I have no words |
13:17:11 | FromDiscord | <gyatsoyt> I have to do it myself |
13:17:43 | FromDiscord | <Phil> On the one hand yeah, on the other the python community is like 3 or 4 orders of magnitude larger than nim's |
13:18:52 | FromDiscord | <Chronos [She/Her]> Hm, if you could find a C library you could always make a binding to that? |
13:19:41 | FromDiscord | <Phil> Would even be a ton faster since no python code were involved.↵It does however mean dealing with C and learning about C for a decent part |
13:31:15 | FromDiscord | <Chronos [She/Her]> Yeah |
13:44:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KfH |
13:44:34 | NimEventer | New post on r/nim by itsmekalisyn: For all the Nim devs here, What's a "killer feature" for you in nim?, see https://reddit.com/r/nim/comments/17j3833/for_all_the_nim_devs_here_whats_a_killer_feature/ |
13:46:43 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4KfI |
13:50:14 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Why a tuple?": Context is owlkettle. ↵It's easier to assign that way |
13:50:33 | FromDiscord | <Chronos [She/Her]> Hm fair |
13:52:09 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KfJ |
13:52:26 | FromDiscord | <Phil> Particularly since you likely do not give a fuck about the type that I use under the hood |
13:52:41 | FromDiscord | <Phil> (edit) "Particularly since you ... likely(as" added "(as a lib user)" | "(as a lib user)likely do not give a fuck about the type that I ... use" added "(as the person providing the widget)" |
14:00:28 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KfM |
14:05:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4KfQ |
14:05:22 | FromDiscord | <Chronos [She/Her]> Rn I'm wondering if using pubkeys as IDs for servers is a smart thing to do hm... |
14:05:44 | FromDiscord | <Phil> Time to aaaaaaaask jtv |
14:05:56 | FromDiscord | <Phil> or mratsim |
14:06:23 | FromDiscord | <Phil> What you're trying to do seems to me like it's in their domain, with the entire "should not be easily spoofable" |
14:06:43 | FromDiscord | <Chronos [She/Her]> This is what I have for the auth flow https://media.discordapp.net/attachments/371759389889003532/1168189172587180042/Initial_Authentication.png?ex=6550dbf2&is=653e66f2&hm=964520e9cf606eed0fc4719bce2c0d62f782ebe941e3e9f96ef981cdd13b4f30& |
14:06:52 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Time to aaaaaaaask jtv": Idk how to ping them lol |
14:07:10 | FromDiscord | <Phil> insert blinking person gif |
14:07:18 | FromDiscord | <Phil> Why would it be different for them than for any other user? |
14:07:23 | FromDiscord | <Chronos [She/Her]> Idk what platform they use tho? |
14:07:29 | FromDiscord | <Phil> both use discord |
14:07:34 | FromDiscord | <Chronos [She/Her]> Oh then easy |
14:07:56 | FromDiscord | <Chronos [She/Her]> Ah but who wouldn't mind being bothered- |
14:08:53 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4KfR |
14:34:09 | FromDiscord | <odexine> In reply to @chronos.vitaqua "This is what I": why? |
14:34:34 | FromDiscord | <odexine> are you using HTTPS? if not why? if so then there isnt much reason to do that no? |
14:48:07 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "are you using HTTPS?": Need a way to ban entire instances of users |
14:48:44 | FromDiscord | <odexine> i fail to see how that system solves your problem |
14:49:12 | FromDiscord | <gyatsoyt> In reply to @isofruit "I mean, what's the": I am using the old approach |
14:49:28 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "i fail to see": It means even if the domain or IP they're using changes, they can still keep an instance banned |
14:49:50 | FromDiscord | <gyatsoyt> In reply to @gyatsoyt "I am using the": But with the enum stuff |
14:49:55 | FromDiscord | <odexine> yes but what difference does it make from using HTTPS and just sending IDs |
14:50:02 | FromDiscord | <Chronos [She/Her]> Though it doesn't really help if they change their pub and private key, I can keep it the same |
14:50:02 | FromDiscord | <Phil> Always show code. |
14:50:49 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "yes but what difference": Anyone with a Serverspace can grab an ID and then send it at any time |
14:51:02 | FromDiscord | <Chronos [She/Her]> While pretendon to be a Userspace |
14:51:25 | FromDiscord | <odexine> with HTTPS? |
14:51:39 | FromDiscord | <odexine> well sure that makes sense, so just add a nonce |
14:54:01 | FromDiscord | <Chronos [She/Her]> Nonce? |
14:57:20 | FromDiscord | <odexine> unique value sent on request |
14:57:29 | FromDiscord | <odexine> if it is reused it is invalid |
14:58:00 | FromDiscord | <odexine> i'm not too sure how you've structured your system |
15:08:36 | * | disso-peach joined #nim |
15:09:57 | * | disso-peach quit (Client Quit) |
15:27:50 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "if it is reused": I don't get how that helps with unique identification |
15:28:30 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "i'm not too": Userspace = Auth server↵Serverspace = Chat server ig?↵↵Serverspaces can have users from multiple Userspaces join |
15:31:54 | FromDiscord | <odexine> i see what you mean then |
15:32:05 | FromDiscord | <odexine> how do you verify that the key pairs are authentic? |
15:36:09 | FromDiscord | <.aingel.> In reply to @chronos.vitaqua "It means even if": You want the user to be able to keep an instance banned? |
15:36:17 | FromDiscord | <.aingel.> Or the server to keep a user banned |
15:37:01 | FromDiscord | <treeform> In reply to @chronos.vitaqua "Hey <@107140179025735680> do you": Try to do less in one PR and make sure it works. I don't like the exclude MYSQL define |
15:38:10 | FromDiscord | <Chronos [She/Her]> In reply to @.aingel. "Or the server to": Serverspace to keep a Userspace banned |
15:38:28 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Try to do less": That's fine, I can also rollback the previous changes too so it's not all bunched together |
15:39:40 | FromDiscord | <Chronos [She/Her]> But this is a major issue in the library too tbh, because before it was objectively wrong behaviour since `$` is very different from how it's stored in the db |
15:40:35 | FromDiscord | <treeform> Yeah, lets tackle one problem at a time |
15:40:36 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Userspace = Auth server": idk, but if you ban a single "userspace", what prevents that server from creating a different key pair and registering itself again as a different "userspace" then registering its users into the "serverspace" again |
15:41:03 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Yeah, lets tackle one": Alright 👍 |
15:41:13 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "idk, but if you": Will also have to allow IP bans too |
15:41:22 | FromDiscord | <Chronos [She/Her]> Not sure how else to go about this tbh :p |
15:41:37 | FromDiscord | <odexine> so then we're back to square one? and IP bans are kinda getting less useful aint they, due to NAT? |
15:41:59 | FromDiscord | <odexine> and of course VPNs |
15:49:11 | FromDiscord | <Chronos [She/Her]> Yeah |
15:50:52 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Yeah, lets tackle one": Okay, you should be able to merge now, CI on my fork is running and succeeds↵Though, I wish the tests for PostgreSQL, SQLite and MySQL were seperated into different tasks, would show what the tests are failing for, specifically |
15:51:07 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kgm |
15:51:11 | FromDiscord | <Chronos [She/Her]> Wait crap forgot something |
15:51:28 | * | derpydoo joined #nim |
15:51:52 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4Kgn |
15:51:55 | FromDiscord | <Chronos [She/Her]> Sorry... 😓 it should be done now |
15:52:25 | FromDiscord | <gyatsoyt> In reply to @odexine "i think you keep": Yes the problem is which nim type |
15:52:41 | FromDiscord | <odexine> if statements take `bool`s |
15:52:46 | FromDiscord | <odexine> `or` also takes `bool`s |
15:53:17 | FromDiscord | <odexine> `isNone` sounds like a function that would return a `bool` |
15:53:23 | FromDiscord | <gyatsoyt> I tried using `.to(bool) but it doesn't fix the error |
15:53:30 | FromDiscord | <gyatsoyt> (edit) "`.to(bool)" => "`.to(bool)`" |
15:53:35 | FromDiscord | <odexine> did the error change or is it the same |
15:53:42 | FromDiscord | <gyatsoyt> In reply to @odexine "did the error change": It changed |
15:53:54 | FromDiscord | <odexine> then it's likely a different issue? |
15:54:07 | FromDiscord | <odexine> well whats the new error after adding .to(bool) |
15:55:56 | FromDiscord | <gyatsoyt> In reply to @odexine "well whats the new": This https://media.discordapp.net/attachments/371759389889003532/1168216655248232448/Screenshot_2023_1029_212531.png?ex=6550f58b&is=653e808b&hm=e16a6b04c34d41d679b6a548ccb7a92da30c077aa06750d0193510f96daa6354& |
15:56:19 | FromDiscord | <gyatsoyt> I don't think it will be bool |
15:56:39 | FromDiscord | <odexine> no |
15:56:41 | FromDiscord | <␀ Array> is there a nim matrix sdk or binding?↵i want to create bots using nim |
15:56:44 | FromDiscord | <takemichihanagaki3129> Is there a way to convert a procedure to a `NimNode`?↵↵I'm trying to use `extractDocCommentsAndRunnables` to get the documentation from a generic procedure. |
15:56:47 | FromDiscord | <odexine> i know what your issue |
15:56:49 | FromDiscord | <odexine> (edit) "i know what your issue ... " added "is" |
15:57:05 | FromDiscord | <odexine> or rather an informed guess ig |
15:57:05 | FromDiscord | <odexine> you named your variable `to` |
15:57:14 | FromDiscord | <gyatsoyt> In reply to @odexine "you named your variable": Yes |
15:57:16 | FromDiscord | <odexine> probably not a good idea since there's the `to` function as well |
15:57:30 | FromDiscord | <odexine> name clash i'd assume? doesnt make too much sense to me though |
15:57:36 | FromDiscord | <odexine> what code did you write |
15:58:15 | FromDiscord | <gyatsoyt> That |
15:58:17 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kgp |
15:58:44 | FromDiscord | <odexine> no thats not what i meant |
15:59:03 | FromDiscord | <gyatsoyt> So what do you mean? |
15:59:15 | FromDiscord | <odexine> remove the .to(bool) you wrote, and move it `to.isNone().to(bool)` |
15:59:24 | FromDiscord | <gyatsoyt> Ohk |
16:00:13 | FromDiscord | <gyatsoyt> Yah fixed that error |
16:07:57 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4Kgt |
16:08:12 | FromDiscord | <takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4Kgt" => "https://play.nim-lang.org/#ix=4Kgu" |
16:22:49 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4Kgz |
16:24:05 | * | derpydoo quit (Ping timeout: 240 seconds) |
16:26:13 | FromDiscord | <treeform> In reply to @chronos.vitaqua "Okay, you should be": what about nested it? https://github.com/treeform/debby/pull/5/commits/2ddd5c88ddb45f16412d92b06e61eabad74ddd13 |
16:27:17 | FromDiscord | <Chronos [She/Her]> Ah, I haven't checked for that, I'll add that when I get back on my PC |
16:27:55 | FromDiscord | <Chronos [She/Her]> Ah you did it |
16:29:20 | FromDiscord | <treeform> Do you think that completes the calling stuff? |
16:29:37 | FromDiscord | <treeform> Then lets move onto the string $ things |
16:32:45 | FromDiscord | <Chronos [She/Her]> It should, I've also responded to the comments on the code |
16:34:26 | FromDiscord | <gyatsoyt> sent a code paste, see https://paste.rs/L9HQy |
16:34:32 | FromDiscord | <odexine> sent a code paste, see https://paste.rs/HWRFW |
16:34:38 | FromDiscord | <gyatsoyt> I am already changing it to int still it gives error |
16:34:42 | FromDiscord | <odexine> you are not |
16:34:50 | FromDiscord | <gyatsoyt> Ummm |
16:34:52 | FromDiscord | <odexine> do you remember how to change a pyobject into another type |
16:34:57 | FromDiscord | <odexine> with the |
16:34:58 | FromDiscord | <gyatsoyt> .to? |
16:35:00 | FromDiscord | <odexine> yes\ |
16:35:09 | FromDiscord | <gyatsoyt> So you mean |
16:35:17 | FromDiscord | <odexine> to.piece_type.to(int) |
16:37:16 | FromDiscord | <gyatsoyt> In reply to @odexine "to.piece_type.to(int)": I get this after the change https://media.discordapp.net/attachments/371759389889003532/1168227057050857472/Screenshot_2023_1029_220653.png?ex=6550ff3b&is=653e8a3b&hm=0ffd6139536b1886983dc360720f7597537893cc18422934151659ffa86d2a22& |
16:38:20 | FromDiscord | <odexine> okay now i have no idea what's wrong |
16:39:31 | FromDiscord | <gyatsoyt> Ehm |
16:45:22 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Do you think that": It should complete it all yeah |
16:50:40 | FromDiscord | <treeform> In reply to @chronos.vitaqua "It *should* complete it": Ok I see the name issue now, thank you! I added more tests for that: https://github.com/treeform/debby/pull/5/files |
16:51:01 | FromDiscord | <that_dude.> In reply to @gyatsoyt "Ehm": I do suggest renaming the `to` var to something else. Overload symbols like that are way more likely to cause issues that are harder to decipher. A common convention is to use src and dest instead |
16:51:01 | FromDiscord | <treeform> I am using app.database to test that I don't reply on global db name |
16:52:44 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Then lets move onto": As for this, I'm not too sure how to go about it tbh... Tbh |
16:52:52 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Ok I see the": Epic! |
16:53:56 | FromDiscord | <treeform> The $ is tricky because for binary: you found a mysql issue, sqlite takes a pointer, pg wants it encoded with base16... |
16:54:09 | FromDiscord | <treeform> Every db wants some thing different |
16:54:52 | FromDiscord | <treeform> i'll try making it a non string thing and waiting as far as possible until the prepare statements, which are per db, and maybe it sort it out then? |
16:56:51 | FromDiscord | <gyatsoyt> In reply to @that_dude. "I do suggest renaming": I changed it to `too` |
16:56:55 | FromDiscord | <gyatsoyt> And I get this |
16:57:48 | FromDiscord | <gyatsoyt> sent a code paste, see https://play.nim-lang.org/#ix=4KgD |
17:00:01 | FromDiscord | <that_dude.> Is `too` a pyobject? |
17:01:00 | FromDiscord | <that_dude.> Because I don't think there is a `piece_type` proc defined for it that returns an int |
17:02:39 | FromDiscord | <that_dude.> But if it's supposed to be a pyobject, don't you need to convert the returned pyobject to an int vio `to` (I think)? |
17:03:28 | FromDiscord | <that_dude.> `too.piece_type.to(int) is int` |
17:04:19 | FromDiscord | <that_dude.> `to(too.piece_type, int) is int` |
17:04:45 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "The $ is tricky": Aah... During my own testing though, PostgreSQL and SQLite both passed the tests even with binary data, so I'd imagine it's just a MySQL issue? |
17:05:05 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "i'll try making it": That sounds good to me 👍 |
17:06:28 | FromDiscord | <Chronos [She/Her]> Also, any remaining changes you want me to make in my PR?↵And tbh, I think that you should replace `$` with `sqlDump` anyway for now, because otherwise custom dump hooks are ignored during comparison which I had a test for too |
17:07:25 | FromDiscord | <treeform> yeah i'll do that next |
17:07:31 | FromDiscord | <treeform> trying to clean up the warnings in another PR |
17:09:10 | FromDiscord | <Chronos [She/Her]> Alright 👍 |
17:09:55 | FromDiscord | <Chronos [She/Her]> If I can be of any help, please let me know! |
17:10:51 | FromDiscord | <treeform> Your PR is very helpful |
17:10:53 | FromDiscord | <treeform> thank you |
17:12:34 | FromDiscord | <Chronos [She/Her]> Unrelated question, but does anyone know if it's possible to override a function defined in another library? |
17:12:48 | FromDiscord | <Chronos [She/Her]> (Not overload, specifically overriding it) |
17:14:31 | Amun-Ra | patchFile |
17:15:34 | FromDiscord | <Chronos [She/Her]> Oh that's useful! But that seems to be for the whole file sadly, oh well it works well enough |
17:15:40 | Amun-Ra | I had to patch cmdline to test my getopt parser: |
17:15:42 | Amun-Ra | patchFile("stdlib", "cmdline", "patches/cmdline") |
17:15:57 | Amun-Ra | yes |
17:16:05 | Amun-Ra | it's either all or nothing |
17:16:15 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "patchFile("stdlib", "cmdline", "patches/cmdline")": Oh? What did you have to patch it for? |
17:16:20 | FromDiscord | <treeform> In reply to @chronos.vitaqua "If I can be": Thoughts on warning removal: https://github.com/treeform/debby/pull/8/files |
17:16:56 | Amun-Ra | Chronos: yes, to inject my own cli args for testing |
17:17:17 | FromDiscord | <.lithiumfrost> Quick question: What's recommended for connecting to mssql these days from nim? |
17:17:41 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Thoughts on warning removal:": It looks good to me 👍 |
17:17:57 | FromDiscord | <.lithiumfrost> There was an coffeepots/odbc library, but that hasn't seen a commit in a few years |
17:20:04 | FromDiscord | <treeform> In reply to @.lithiumfrost "There was an coffeepots/odbc": I have written a wrapper for mysql, sqlite and pg... I say just use the C dll api directly if you want mssql? |
17:20:05 | FromDiscord | <nasuray> In reply to @chronos.vitaqua "Unrelated question, but does": You could just not import the function |
17:21:04 | FromDiscord | <.lithiumfrost> In reply to @treeform "I have written a": Ok, thanks |
17:21:26 | FromDiscord | <Chronos [She/Her]> Oh Treeform, do you think it'd be possible to separate tests into their own tasks or jobs is possible? Not sure how it works exactly but, I'm suggesting this so it's clearer at a glance about what test is failing specifically |
17:21:55 | FromDiscord | <Chronos [She/Her]> In reply to @nasuray "You could just not": It's not for the user-facing code, it's for code within another library, I want to override that so the behaviour there is different |
17:23:51 | NimEventer | New thread by GyatsoYT: Error: type mismatch: got 'PyObject' for 'getAttr(to,"piece_type")' but expected 'int', see https://forum.nim-lang.org/t/10579 |
17:33:40 | FromDiscord | <nasuray> In reply to @chronos.vitaqua "It's not for the": Ah I see. Could always maintain a soft-fork of the library with your patch |
17:34:32 | FromDiscord | <Chronos [She/Her]> True |
17:57:40 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=4Kh0 |
18:03:36 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Wow mysql is very": Ah, so that was the issue? |
18:03:50 | FromDiscord | <Chronos [She/Her]> I'm guessing you need to special case it for other types too? Like binary types? |
18:07:10 | * | xet7 joined #nim |
18:26:16 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kh5 |
18:36:38 | FromDiscord | <treeform> I basically need to know what the type is before knowing what the type is? |
18:36:50 | FromDiscord | <treeform> I tried a complex dump with type, but that seems to not work too. |
18:37:52 | FromDiscord | <treeform> This PR works for everything https://github.com/treeform/debby/pull/9/files but mysql requires a stupid hack to check if input looks json enough. I don't like it! |
18:45:30 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "This PR works for": Does it work for binary types though? |
19:05:09 | FromDiscord | <treeform> it works for complex types |
19:05:27 | FromDiscord | <treeform> it appears to work for binary types too as I have test for that and it passes |
19:05:36 | FromDiscord | <Chronos [She/Her]> Hm alright then, that's great! |
19:05:48 | FromDiscord | <Chronos [She/Her]> I wonder why MySQL does things differently yhough |
19:05:55 | FromDiscord | <Chronos [She/Her]> (edit) "yhough" => "though" |
19:05:56 | FromDiscord | <treeform> Because its mysql |
19:06:02 | FromDiscord | <Chronos [She/Her]> Seems like a weird design choice |
19:06:02 | FromDiscord | <treeform> all of them do some thing differently |
19:06:08 | FromDiscord | <Chronos [She/Her]> Fair |
19:06:13 | FromDiscord | <treeform> would not be the first time 🙂 |
19:06:35 | FromDiscord | <treeform> I think I solved the problem please review: https://github.com/treeform/debby/pull/9/files |
19:06:38 | FromDiscord | <Chronos [She/Her]> Fair haha, I don't know much when it comes to the dbs themselves really, besides a basic understanding |
19:07:12 | FromDiscord | <treeform> I create special `Argument` that carries around its type, then do `args: varargs[Argument, toArgument]` |
19:07:29 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "I think I solved": I've compiled my code agsinst the dev branch on your repo and it seems to work great for me, so I'd think it's doing fine |
19:08:08 | FromDiscord | <Chronos [She/Her]> Looks fine to me! |
19:11:44 | FromDiscord | <treeform> I am going to add your a complex test as well: https://github.com/treeform/debby/pull/9 |
19:12:32 | FromDiscord | <Chronos [She/Her]> Epic! |
19:13:18 | FromDiscord | <Chronos [She/Her]> It passes the tests, very nice |
19:14:24 | FromDiscord | <treeform> Ok, done for now. Happy bug hunting! |
19:14:48 | FromDiscord | <treeform> I started working on a sort of lightweight admin |
19:15:05 | FromDiscord | <treeform> Kind of like django admin |
19:15:11 | FromDiscord | <Chronos [She/Her]> Haha, I'll report them as I encounter them, though I won't be doing much really |
19:15:23 | FromDiscord | <treeform> Maybe check it out? |
19:15:25 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Kind of like django": I've never used Django tbh |
19:15:47 | FromDiscord | <treeform> My hope is that you just use the same objects to create an admin. |
19:15:58 | FromDiscord | <treeform> A little user interface to see whats in the db |
19:15:58 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "Maybe check it out?": I've checked out the code and it looks good to me and I can't see any obvious issues |
19:16:03 | FromDiscord | <Chronos [She/Her]> Aah |
19:16:52 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/1168267221705957396/image.png?ex=655124a3&is=653eafa3&hm=1ccb22e4ea510543f03c06b797e1b50d54b86842b0d78a519ec1855a078e84f1& |
19:17:42 | FromDiscord | <Chronos [She/Her]> Oh that's good! I don't think that'd work with inputting binary data though? |
19:17:49 | FromDiscord | <treeform> nope |
19:17:54 | FromDiscord | <treeform> but most data isn't binary |
19:17:55 | FromDiscord | <Chronos [She/Her]> Yeah thought so aha |
19:18:09 | FromDiscord | <Chronos [She/Her]> In reply to @treeform "but most data isn't": Fair, looks good to me! |
19:18:25 | FromDiscord | <Chronos [She/Her]> May be useful during testing for me |
19:20:54 | * | neceve joined #nim |
19:25:16 | Amun-Ra | treeform: thanks to your debby project I found out about github.io, thanks! :) |
19:26:02 | Amun-Ra | and I was looking for a place to store ma APIs |
19:42:51 | * | krux02 joined #nim |
19:54:11 | FromDiscord | <treeform> In reply to @Amun-Ra "<@107140179025735680>: thanks to your": Cool I am glad you found it useful! |
19:59:33 | Amun-Ra | ;> |
19:59:46 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "and I was looking": Do you mean docs? :p |
20:00:20 | * | beholders_eye joined #nim |
20:05:24 | Amun-Ra | yes |
20:11:21 | FromDiscord | <Chronos [She/Her]> Ah |
20:11:52 | FromDiscord | <Chronos [She/Her]> I have a slightly modified version of Treeform's GitHub Action for docs if you want it :p |
20:12:56 | Amun-Ra | I have nimble task for that :) |
20:13:18 | FromDiscord | <Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/NULID/blob/main/.github/workflows/docs.yml |
20:13:21 | FromDiscord | <Chronos [She/Her]> Oh nice then! |
20:14:22 | Amun-Ra | Chronos: https://pastebin.com/0xVzKj2r |
20:15:05 | FromDiscord | <Chronos [She/Her]> Ah, my Action also includes the tag name so that the docs always line up with the source of the release |
20:15:35 | FromDiscord | <Chronos [She/Her]> That's one thing that frustrated me with that Action, as well as the fact the repo name has to be the package name exactly :p |
20:16:08 | Amun-Ra | I use github only as a mirror |
20:28:43 | FromDiscord | <Chronos [She/Her]> `/home/chronos/Projects/Nim/NULID/src/nulid/private/constants.nim(11, 26) Error: invalid pragma: hint[UnusedImport]: off`↵This is a pain oof |
20:28:56 | FromDiscord | <Chronos [She/Her]> In reply to @Amun-Ra "I use github only": Oh? What do you host on, then↵? |
20:34:40 | FromDiscord | <Chronos [She/Her]> Ah, it's a warning not a hint |
20:34:49 | Amun-Ra | Chronos: https://about.gitea.com/ on one of my vpses |
20:36:04 | FromDiscord | <Chronos [She/Her]> Oh Gitea is cool! Iirc people are switching to Forgejo tho since it went for profit |
20:36:35 | Amun-Ra | forgejo? that's the name I've never heard of |
20:36:50 | Amun-Ra | thanks for the info |
20:37:11 | FromDiscord | <Chronos [She/Her]> Np! |
20:37:44 | FromDiscord | <Chronos [She/Her]> https://forgejo.org/ this is the site btw |
20:38:10 | Amun-Ra | I'm going to try that out |
20:41:09 | FromDiscord | <Chronos [She/Her]> Epic! |
20:43:54 | FromDiscord | <ElegantBeouf> @takemichihanagaki3129 https://play.nim-lang.org/#ix=4KhA guess the matrix bridge dieded 😄 |
20:45:38 | FromDiscord | <takemichihanagaki3129> In reply to @elegantbeef "<@890300313729400832> https://play.nim-lang.org/#ix": You're the best! 🙂 |
20:46:16 | FromDiscord | <nnsee> In reply to @Amun-Ra "Chronos: https://about.gitea.com/ on one": are you me? |
20:46:46 | FromDiscord | <nnsee> have https://git.dog running for myself and just use GitHub as a mirror |
20:47:04 | Amun-Ra | ;) |
20:47:37 | FromDiscord | <nnsee> Amun-Ras |
20:47:56 | FromDiscord | <nnsee> actually, you probably won't get that joke because IRC shows my username, not my nick |
20:48:06 | FromDiscord | <nnsee> (but it's Ras) |
20:48:57 | FromDiscord | <takemichihanagaki3129> In reply to @elegantbeef "<@890300313729400832> https://play.nim-lang.org/#ix": This's very clear now to me! |
20:50:14 | Amun-Ra | nnsee: right :P |
20:53:50 | FromDiscord | <Chronos [She/Her]> Wish I could shut the `UnusedImport` warning off in my project without affecting every project using it oof |
20:56:50 | Amun-Ra | add --hint[UnusedImport]:off in config.nims, it shouldn't populate outside the projects |
20:56:55 | Amun-Ra | project* |
21:05:05 | Amun-Ra | Chronos: try this: https://play.nim-lang.org/#ix=4KhJ |
21:13:49 | * | neceve quit (Ping timeout: 255 seconds) |
21:25:37 | FromDiscord | <Chronos [She/Her]> Oh? Is that only for a specific file then? |
21:29:43 | Amun-Ra | yes |
21:30:29 | FromDiscord | <Chronos [She/Her]> Epic! |
21:59:05 | FromDiscord | <Chronos [She/Her]> New release of https://github.com/Yu-Vitaqua-fer-Chronos/NULID :D |
21:59:27 | FromDiscord | <Chronos [She/Her]> It, in theory, should support the Nim VM, but I'm not sure how to test that rn |
22:00:01 | FromDiscord | <Chronos [She/Her]> It could also support the JS backend, but the issue with that is the fact that `nint128` doesn't support that currently :p |
22:00:26 | FromDiscord | <Chronos [She/Her]> Yes I am procrastinating a lot lol |
22:02:41 | Amun-Ra | you could wrap BigInt for JS target |
22:05:56 | FromDiscord | <Chronos [She/Her]> Oh? I could tbf |
22:06:19 | FromDiscord | <Chronos [She/Her]> https://nim-lang.org/docs/jsbigints.html Oh this exists |
22:07:46 | Amun-Ra | nim 2 uses bigint for integer types under the hood |
22:08:12 | Amun-Ra | js integer type is "special" |
22:11:13 | FromDiscord | <Chronos [She/Her]> Aaah okay |
22:11:30 | FromDiscord | <Chronos [She/Her]> Good to know! I'll implement it some day but not today aha |
22:12:24 | Amun-Ra | :) |
22:16:19 | FromDiscord | <kerplunkx> Is there some extra steps you need to do when importing glm? I get: `Error: cannot open file: glm` |
22:16:35 | * | krux02 quit (Ping timeout: 240 seconds) |
22:17:02 | Amun-Ra | nimble installglm? |
22:17:07 | Amun-Ra | nimble install glm |
22:17:52 | FromDiscord | <kerplunkx> Nope, already tried that |
22:18:21 | FromDiscord | <Phil> JS integer type is basically float64 |
22:18:30 | FromDiscord | <Phil> Because there are no js ints |
22:18:32 | FromDiscord | <kerplunkx> Just trying to run a nimgl example |
22:21:18 | Amun-Ra | it should work ootb |
22:23:07 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Because there are no": I mean fair |
22:23:37 | FromDiscord | <Phil> In reply to @chronos.vitaqua "I mean fair": You missspelled "terrible idea" |
22:23:40 | FromDiscord | <Phil> (edit) "missspelled" => "misspelled" |
22:24:47 | FromDiscord | <Chronos [She/Her]> 🤷♀️ |
22:27:06 | * | beholders_eye quit (Quit: WeeChat 3.6) |
22:45:35 | FromDiscord | <kerplunkx> In reply to @Amun-Ra "it should work ootb": I forgot to add the requirement to the nimble file 🤦♂️ |
22:45:39 | FromDiscord | <kerplunkx> Thanks for the help |
23:03:36 | FromDiscord | <Chronos [She/Her]> https://play.nim-lang.org/#ix=4Kk8 this gives `/usercode/in.nim(1, 22) Error: illegal context for 'nimvm' magic`, isn't that a bit dumb? :p |
23:04:15 | FromDiscord | <Elegantbeef> no |
23:04:22 | FromDiscord | <Elegantbeef> Nimvm can only be used inside a `when nimvm` block |
23:04:41 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement |
23:05:57 | FromDiscord | <Chronos [She/Her]> But why? I don't understand that |
23:06:19 | FromDiscord | <Chronos [She/Her]> Since sometimes you want code that only runs on JS or the Nim VM (as rare as that is) |
23:06:22 | FromDiscord | <Elegantbeef> Cause it's for adding runtime and compiletime support for a proc |
23:06:58 | FromDiscord | <Chronos [She/Her]> Aaaah okay I get it now |
23:07:01 | FromDiscord | <Elegantbeef> `when nimvm` is when you are using a native backend but want different code to run in the VM |
23:07:07 | FromDiscord | <Chronos [She/Her]> Does `nimscript` function the same or? |
23:07:22 | FromDiscord | <Chronos [She/Her]> `define(nimscript)` |
23:07:26 | FromDiscord | <Elegantbeef> `defined(nimscript)` will work when the backend is nimscript |
23:08:20 | FromDiscord | <Chronos [She/Her]> Alright then, nice |
23:09:07 | * | derpydoo joined #nim |
23:09:20 | FromDiscord | <Elegantbeef> But if you are using native code and call your code at CT you will want the nimvm stuff |
23:10:17 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/json.nim#L1269-L1276 an example how you might do what you want |
23:33:37 | FromDiscord | <Chronos [She/Her]> Ah thanks! |