00:00:48 | FromDiscord | <evoalg> Beefy when will I be able to compile in nimskull? |
00:01:06 | FromDiscord | <Elegantbeef> You can now |
00:01:38 | FromDiscord | <evoalg> with libs like strutils and slicerator? |
00:03:14 | FromDiscord | <tandy> `Error: expression 'await validateToken(lb, token)' has no type (or is ambiguous)` |
00:03:14 | FromDiscord | <tandy> oh im a dumb dumb |
00:03:17 | FromDiscord | <tandy> redefined the proc didnt i |
00:03:17 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3NX3 |
00:03:33 | FromDiscord | <Elegantbeef> Yes Nimskull is mostly compatible with Nim since it's a fork |
00:03:47 | FromDiscord | <evoalg> is there a nimskull channel? |
00:04:16 | FromDiscord | <tandy> https://matrix.to/#/!alsWvZtOfWkQlHwcHC:envs.net?via=libera.chat&via=matrix.org&via=envs.net |
00:14:41 | * | jmdaemon joined #nim |
00:16:47 | * | l1x quit (Quit: Connection closed for inactivity) |
00:20:01 | * | lumo_e quit (Quit: Quit) |
01:11:28 | FromDiscord | <ynfle> How can I get where paramTypesMatch is trying to match in the source file? I don't mind random `warning` hacks or whatever |
01:41:01 | FromDiscord | <ynfle> In reply to @ynfle "How can I get": `echo $lineInfoToStr(config(m.c), arg.info)` kinda works |
01:41:08 | FromDiscord | <ynfle> (edit) "$lineInfoToStr(config(m.c)," => "lineInfoToStr(config(m.c)," |
01:49:32 | termer_ | Is there a way to create a Table that can contain any key type? |
01:49:37 | FromDiscord | <ynfle> In reply to @ynfle "`echo lineInfoToStr(config(m.c), arg.info)` kinda": Doesn't get the first frame in the stack. |
01:49:49 | termer_ | I need some way to store mixed data in a table, and not JSON |
01:49:54 | termer_ | or something similar to a table |
01:50:02 | FromDiscord | <Elegantbeef> Make a `Table[Hash, T]`↵(<@709044657232936960_termer_=5b=49=52=43=5d>) |
01:50:11 | FromDiscord | <ynfle> In reply to @termer_ "Is there a way": Not one table instance. Unless you use variant object |
01:50:12 | termer_ | That would be a single type though |
01:50:28 | FromDiscord | <Elegantbeef> No it'd work with any key type |
01:50:34 | FromDiscord | <ynfle> In reply to @termer_ "I need some way": Why would JSON not work? |
01:50:52 | termer_ | JSON can hold types that my design is not supposed to |
01:51:03 | termer_ | specifically, it can hold nested arrays which would be a problem |
01:51:15 | FromDiscord | <ynfle> In reply to @termer_ "JSON can hold types": So build on the design |
01:51:58 | termer_ | Maybe I should look how the JSON implementation holds it |
01:52:40 | termer_ | JsonNode is just an object that holds every possible type for a node, right? |
01:52:49 | FromDiscord | <ynfle> In reply to @termer_ "JsonNode is just an": Yup |
01:52:59 | termer_ | well that's pretty inefficient |
01:53:22 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3NXo |
01:53:29 | FromDiscord | <Elegantbeef> Can use multiple Key types fine |
01:53:55 | termer_ | @Elegantbeef I'm not looking to hold multiple key types |
01:54:01 | termer_ | I'm looking to hold multiple value types |
01:54:09 | FromDiscord | <Elegantbeef> Well you should've said that |
01:54:16 | termer_ | I thought I did, my bad |
01:54:21 | termer_ | Interesting, JsonNode has a switch-case in the object definition |
01:54:23 | termer_ | didn't know you could do that |
01:54:30 | FromDiscord | <Elegantbeef> Object variants are the best way |
01:55:06 | FromDiscord | <Elegantbeef> Yes that's an object variant it's the most memory efficient method of doing this as the type size is the largest branch |
01:55:06 | termer_ | All right, thanks |
01:55:25 | FromDiscord | <Elegantbeef> You can also look at https://github.com/alaviss/union |
01:55:40 | FromDiscord | <Elegantbeef> Manual for object variants https://nim-lang.org/docs/manual.html#types-object-variants |
02:13:03 | FromDiscord | <kevin> Anyone know how callback functions work for async code? |
02:14:12 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=3NXs |
02:17:33 | * | rienske quit (Quit: WeeChat 3.4) |
02:17:52 | * | rienske joined #nim |
02:17:54 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/asyncdispatch.html#Callback |
02:20:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NXu |
02:21:01 | FromDiscord | <Elegantbeef> One could make a template to convert `proc()` into a closure |
02:23:39 | FromDiscord | <Elegantbeef> for instance |
02:23:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/M2U |
02:56:27 | * | rienske quit (Quit: WeeChat 3.4) |
02:56:48 | * | rienske joined #nim |
02:57:37 | * | rienske quit (Client Quit) |
02:57:56 | * | rienske joined #nim |
03:03:19 | FromDiscord | <Bung> @ElegantBeef hey , get news to me ? |
03:05:02 | FromDiscord | <Elegantbeef> I cannot fix the packages |
03:05:24 | FromDiscord | <Elegantbeef> if you want to use a package make an issue on the package's repo about not being usable in VM |
03:06:00 | FromDiscord | <Elegantbeef> If you cannot import it using `nim e ./my.nims` i cannot do anything |
03:06:40 | FromDiscord | <Bung> how to do that , it seems it's a error during parsing |
03:06:53 | FromDiscord | <Elegantbeef> What do you mean |
03:07:01 | FromDiscord | <Elegantbeef> The issue was with stacktrace |
03:07:05 | FromDiscord | <Bung> I tried use when nimvm but it will throw before that |
03:07:06 | FromDiscord | <Elegantbeef> nimscript doesnt have stacktrace |
03:08:49 | FromDiscord | <Elegantbeef> I'd like a solution but Nimscripter isnt the problem afaik |
03:12:18 | FromDiscord | <Bung> I tried `when not defined(release) and not nimvm:` not work. |
03:12:37 | FromDiscord | <Elegantbeef> nimvm is special |
03:12:45 | FromDiscord | <Elegantbeef> do `and not defined(nimscript)` |
03:16:10 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
03:16:53 | * | noeontheend joined #nim |
03:17:14 | FromDiscord | <Bung> oh, that's work |
03:20:35 | FromDiscord | <Bung> `Script Error: /users/bung/.choosenim/toolchains/nim-1.6.2/lib/system/sets.nim:21:19 undeclared identifier: 'countBits64'` finally I get this |
03:22:10 | FromDiscord | <Elegantbeef> I assume same thing is the issue |
03:22:26 | FromDiscord | <Elegantbeef> They use `countBits64` which is a exported procedure only in Nim |
03:24:07 | FromDiscord | <Elegantbeef> Nimscript is a subset of Nim so not everything will work |
03:29:46 | * | arkurious quit (Quit: Leaving) |
03:33:27 | FromDiscord | <Bung> what I can do for support it |
03:33:58 | FromDiscord | <Elegantbeef> Use libraries that support compile time code is generally it really |
03:34:08 | FromDiscord | <Elegantbeef> I imagine a lot of treeform's libraries will work |
03:35:14 | FromDiscord | <Elegantbeef> Anything that relies on lower level logic that doesnt handle nimscript will require changes |
03:39:24 | FromDiscord | <Rika> treeform makes networking and other libraries too, i imagine its not "a lot" |
03:39:57 | FromDiscord | <Elegantbeef> I suppose |
03:40:32 | FromDiscord | <Bung> found it occurs in set in operator |
03:47:42 | FromDiscord | <BhamidipatiNikhil> I have no idea Why is this error occuring? https://media.discordapp.net/attachments/371759389889003532/937192323404681216/unknown.png |
03:48:24 | FromDiscord | <Rika> stdin is a File |
03:48:24 | FromDiscord | <Elegantbeef> `readLine` also has a file impl |
03:48:26 | FromDiscord | <Rika> not a Stream |
03:49:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NXG |
03:49:58 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/io.html#readLine%2CFile is what you were calling prior |
03:51:49 | FromDiscord | <Elegantbeef> Overloads are magic |
03:56:24 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
03:57:19 | FromDiscord | <BhamidipatiNikhil> sent a code paste, see https://play.nim-lang.org/#ix=3NXI |
03:57:36 | FromDiscord | <Elegantbeef> Id did indeed! |
03:57:38 | FromDiscord | <Elegantbeef> it\ |
03:57:53 | FromDiscord | <Elegantbeef> `readUint8` reads the next character as a byte |
03:58:25 | FromDiscord | <Elegantbeef> You want to read until you hit a space then parse that as an int |
03:58:40 | FromDiscord | <BhamidipatiNikhil> In reply to @Elegantbeef "You want to read": Yes, exactly! |
03:58:57 | FromDiscord | <Elegantbeef> So then do that 😀 |
04:00:36 | FromDiscord | <BhamidipatiNikhil> In reply to @Rika "stdin is a File": readLine(stdin) is valid, while readUint8(stdin) is invalid although in the manual both take (s: stream) as input in their definitions and i was thinking that stdin is a stream so it should work for both |
04:00:54 | * | Onionhammer joined #nim |
04:01:40 | * | xiamx quit (K-Lined) |
04:01:41 | * | cheer[m] quit (K-Lined) |
04:01:44 | * | happycorsair[m] quit (K-Lined) |
04:01:44 | * | zgasma[m]1 quit (K-Lined) |
04:01:44 | * | nixfreaknim[m] quit (K-Lined) |
04:02:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3NXL |
04:03:59 | FromDiscord | <Elegantbeef> That'll allow inputing values on new lines, altogether, character seperated, whatever |
04:08:41 | FromDiscord | <Rika> In reply to @BhamidipatiNikhil "readLine(stdin) is valid, while": again, as beef said, there is also a readLine(f: File) proc |
04:08:46 | FromDiscord | <Rika> nim has overloading |
04:08:56 | FromDiscord | <Elegantbeef> I am bot what i say is wrong! |
04:14:07 | termer_ | How can I store a type in an object property? |
04:14:09 | termer_ | is it possible? |
04:14:21 | FromDiscord | <Elegantbeef> You cannot types are compile time only |
04:14:29 | termer_ | All right, that's what I figured |
04:14:54 | FromDiscord | <BhamidipatiNikhil> In reply to @Rika "again, as beef said,": Oh yeah! you are right!! |
04:14:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
04:23:07 | FromDiscord | <evoalg> I'm trying to figure out this code ... it seems to run without end? |
04:23:27 | FromDiscord | <Elegantbeef> `mySeq.add` adds a value |
04:23:43 | FromDiscord | <Rika> ? yes it does, what does that have to do with |
04:23:57 | FromDiscord | <Elegantbeef> `while mySeq.len < N:` is the condition |
04:24:02 | FromDiscord | <Rika> yes indeed |
04:24:09 | FromDiscord | <Rika> add value, wait for len to exceed N, end |
04:24:19 | FromDiscord | <Rika> so now why does it run forever? |
04:24:26 | FromDiscord | <evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3NXS |
04:24:50 | FromDiscord | <Rika> do you hit the invalid input? |
04:24:51 | FromDiscord | <Rika> or what |
04:25:32 | FromDiscord | <evoalg> I'm just so confused |
04:25:38 | * | cheer[m] joined #nim |
04:26:11 | FromDiscord | <Elegantbeef> I have seemed to mess something up |
04:26:11 | * | happycorsair[m] joined #nim |
04:26:23 | * | zgasma[m] joined #nim |
04:26:35 | * | xiamx joined #nim |
04:26:35 | * | nixfreaknim[m] joined #nim |
04:26:51 | FromDiscord | <Elegantbeef> `buff.add stdin.readChar` is the issue |
04:27:21 | FromDiscord | <Elegantbeef> that should be `ch` but I was being silly and missed it |
04:27:44 | FromDiscord | <Rika> oh yeah true it does a double-ask |
04:27:58 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/937202454351712317/image.png |
04:28:00 | FromDiscord | <Elegantbeef> Works properly with that |
04:28:19 | FromDiscord | <Rika> nvim test.nim |
04:28:34 | FromDiscord | <Elegantbeef> Yea was in my history hit up too many times 😛 |
04:30:11 | FromDiscord | <Elegantbeef> Anyway it was just an example it's not production code! |
04:30:23 | * | fowl joined #nim |
04:31:11 | FromDiscord | <evoalg> works ... I was just trying to understand it ... I don't even know why they wanted a seq of uint8's? |
04:31:11 | FromDiscord | <Elegantbeef> There should be a check on the result of `parseInt` to ensure it's in 0..255 |
04:31:30 | FromDiscord | <Elegantbeef> I'm not a guessologist i dont know |
04:33:59 | FromDiscord | <Elegantbeef> Also evo did you ever go to the dev docs to stare at your added docs 😛 |
04:34:36 | FromDiscord | <evoalg> my added docs? |
04:34:40 | * | fowl quit (Quit: cya pals) |
04:34:49 | FromDiscord | <Elegantbeef> The example to the ctrl C hook 😀 |
04:35:04 | FromDiscord | <evoalg> oooo let me look |
04:36:51 | * | fowl joined #nim |
04:36:59 | FromDiscord | <evoalg> it has the example, nice! |
04:47:30 | * | nixfreaknim[m] quit (Quit: Client limit exceeded: 20000) |
04:47:38 | FromDiscord | <BhamidipatiNikhil> IT worked like magic... Thanks a ton @ElegantBeef .... You are a genius!! https://media.discordapp.net/attachments/371759389889003532/937207405522083860/unknown.png |
04:47:53 | * | nixfreaknim[m] joined #nim |
04:48:43 | * | cheer[m] quit (Quit: Client limit exceeded: 20000) |
04:48:49 | * | happycorsair[m] quit (Quit: Client limit exceeded: 20000) |
04:49:51 | * | zgasma[m] quit (Quit: Client limit exceeded: 20000) |
04:50:32 | * | xiamx quit (Quit: Client limit exceeded: 20000) |
04:52:02 | * | dtomato quit (Ping timeout: 252 seconds) |
04:52:29 | FromDiscord | <evoalg> why does BhamidipatiNikhil's message appear on discord but not matrix? |
04:52:42 | FromDiscord | <evoalg> (their latest msg) |
04:52:50 | * | cheer[m] joined #nim |
04:53:04 | * | happycorsair[m] joined #nim |
04:53:18 | * | zgasma[m] joined #nim |
04:53:30 | * | xiamx joined #nim |
04:55:03 | FromDiscord | <Elegantbeef> Bridge issue perhaps |
04:57:11 | FromDiscord | <evoalg> It may filter out compliments to you beefy, as you've been getting so many of them that they're now flagged as spam |
04:57:32 | FromDiscord | <Elegantbeef> Probably |
04:57:35 | * | fowl quit (Quit: cya pals) |
04:57:50 | FromDiscord | <Elegantbeef> Most sensible solutiion |
04:58:10 | * | fowl joined #nim |
05:05:44 | FromDiscord | <evoalg> In reply to @BhamidipatiNikhil "IT worked like magic...": beefy said "There should be a check on the result of parseInt to ensure it's in 0..255" ... if it's above that I think it will wrap, and you might not want that? |
05:07:42 | FromDiscord | <BhamidipatiNikhil> In reply to @evoalg "beefy said "There should": Yes sure! |
05:32:27 | termer_ | How would I go about converting a uint64 containing its max value to an int64? |
05:32:47 | termer_ | or vise-versa |
05:32:59 | FromDiscord | <Elegantbeef> You want the bit signature? |
05:32:59 | FromDiscord | <evoalg> How would one go about reading input from the keyboard without it being entered with the return key? |
05:33:04 | FromDiscord | <Elegantbeef> `cast[int](yourUint)` |
05:33:24 | FromDiscord | <Elegantbeef> `getCh` or using a library that automates it |
05:33:35 | FromDiscord | <Elegantbeef> `getCh` is blocking |
05:34:04 | termer_ | Thanks |
05:34:26 | termer_ | cast does it properly |
05:34:42 | termer_ | I forgot about that, I was just doing a literal cast with (uint64) |
05:34:46 | FromDiscord | <evoalg> gotcha ok thx I can work with that I think ... if I want to create a game then I'll think about a using a lib |
05:35:02 | FromDiscord | <evoalg> would it be some sort of async lib? |
05:35:15 | FromDiscord | <Elegantbeef> cast is a bit siganture cast, the other is a type conversion |
05:35:42 | FromDiscord | <Elegantbeef> Depends on the library and what you're doing |
05:37:24 | FromDiscord | <Elegantbeef> illwill/ncurses for instance let your read keys like a game engine |
05:37:28 | FromDiscord | <evoalg> I guess I was pretending that I was able to create a space invaders game where left & right & fire would be acted upon, but in the mean time I still want the baddies to march down |
05:37:40 | FromDiscord | <evoalg> nice thx |
05:37:58 | FromDiscord | <Elegantbeef> You could use Nico for space incaders |
05:38:16 | FromDiscord | <Elegantbeef> It's easy to work with and allows you to draw proper graphics |
05:38:21 | FromDiscord | <Elegantbeef> Plus you can annoy impbox |
05:38:57 | FromDiscord | <evoalg> I was just curious but I'll store this in my notes - thanks! |
05:39:26 | FromDiscord | <Elegantbeef> Ncurses is how you'd probably want to do it otherwise |
05:39:36 | FromDiscord | <Elegantbeef> or illwill(pure Nim so clearly better) |
05:39:49 | FromDiscord | <evoalg> ahh nice |
05:44:05 | FromDiscord | <Rika> i would not say that |
05:44:31 | FromDiscord | <Rika> it is less robust and less battle tested. if a wrapper is made well it would be better than a pure nim solution |
05:44:40 | FromDiscord | <Elegantbeef> Not say what? |
05:44:48 | FromDiscord | <Elegantbeef> I was joking |
05:45:00 | FromDiscord | <Rika> evo may not have understood that |
05:45:28 | FromDiscord | <evoalg> ahhh I didn't understand - thanks Rika! |
05:47:49 | FromDiscord | <evoalg> I think beefy has faith that I'm smarter than I am sometimes |
05:49:28 | FromDiscord | <Elegantbeef> There is a benefit of pure nim though in that it doesnt require an other dependencies, minor benefit but alas |
05:49:55 | FromDiscord | <evoalg> and it might be easier for the community to maintain |
05:50:07 | FromDiscord | <evoalg> or adjust |
05:50:21 | FromDiscord | <Elegantbeef> With external libraries you either use dynamic libraries(shipped aside the binary or on the system) or static linked (compiled into the binary) |
05:50:33 | FromDiscord | <Elegantbeef> Yea it's nicer to have pure libraries due to being written in the language you're using but the question was of quality |
05:51:35 | FromDiscord | <evoalg> dynamic libs, eg written in c, and nim can import those fine (I think I read that on here) |
05:51:49 | FromDiscord | <Bung> anyone could give me some idea to improve my parser https://github.com/bung87/scorper/blob/8e22995ac2bb9a6f489bbc742a5b03d22631a0a2/src/scorper/http/multipartparser.nim#L266 |
05:51:52 | FromDiscord | <Elegantbeef> Nim can use both dynamic and static |
05:52:08 | FromDiscord | <evoalg> nice! |
05:52:16 | FromDiscord | <Bung> I do some search on Boyer–Moore but am using buffered string |
05:57:24 | FromDiscord | <Elegantbeef> I'd give advice but i dont know the domain 😀 |
06:10:43 | FromDiscord | <Bung> it's about find http multipart form boundary , you see now I search boundary by loop every char |
06:17:00 | FromDiscord | <Bung> when found boundary the content part is finished so I can save it to disk , the hard part is I use buffered string so I may read part of boundary, current implementation works but code looks very dumb |
06:37:36 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
06:37:54 | * | jmdaemon joined #nim |
06:44:23 | * | jmdaemon quit (Read error: Connection reset by peer) |
06:48:30 | * | jmdaemon joined #nim |
06:55:13 | * | kobi7 joined #nim |
06:56:07 | kobi7 | hi |
06:56:20 | FromDiscord | <Rika> hello |
07:01:10 | kobi7 | Has anyone tried the classes package? |
07:02:11 | FromDiscord | <Elegantbeef> I know impbox has used https://github.com/Glasses-Neo/OOlib |
07:03:43 | FromDiscord | <Rika> thats a dope graphic wow |
07:03:58 | FromDiscord | <Elegantbeef> lol |
07:15:53 | * | Gustavo6046 joined #nim |
07:41:49 | kobi7 | I am trying to use translate_v2 of the gcplat package. It is a generated openapi, but it has compile errors. |
07:44:44 | kobi7 | do I have to use disruptek's openapi generator? I assumed the generated part is self contained |
07:51:27 | kobi7 | I think I see now.. |
08:45:21 | FromDiscord | <Tetralux> In reply to @Elegantbeef "Nim can use both": That also true with libc? |
08:46:04 | FromDiscord | <Elegantbeef> Shit venturing into territory I'm 99.9% ignorant in |
08:46:15 | FromDiscord | <Elegantbeef> I mean i imagine so given musl stuff |
08:50:31 | FromDiscord | <Rika> Pretty much |
08:50:41 | FromDiscord | <Rika> You need to configure Nim to use musl |
08:57:42 | * | pro joined #nim |
09:00:21 | FromDiscord | <Tetralux> In reply to @Rika "You need to configure": How does one do that though? |
09:00:46 | FromDiscord | <Rika> https://github.com/kaushalmodi/hello_musl https://scripter.co/nim-deploying-static-binaries/ |
09:03:15 | kobi7 | btw, if you use musl for static libs, well, some things like regular expressions based on PCRE, won't work. other dlopen libs that are dynamically linked won't work as well, as far as i understand |
09:05:25 | madprops | seems there's no python's mutagen nim alternative |
09:05:33 | madprops | for read/writing audio file tags |
09:05:55 | FromDiscord | <Tetralux> Hmm. I think that using Zig as the C compiler would actually be all that's needed - at least in a basic sense.↵Unfortunately, I cannot ask Nim to do that, seemingly. |
09:06:12 | FromDiscord | <Tetralux> In reply to @Tetralux "How does one do": Hmm. I think that using Zig as the C compiler would actually be all that's needed - at least in a basic sense.↵Unfortunately, I cannot ask Nim to do that, seemingly. |
09:07:07 | FromDiscord | <Elegantbeef> To use Zig you'd need to use a shell file due to `zig cc` being how you call it |
09:07:13 | FromDiscord | <Elegantbeef> It's documented in places |
09:09:15 | FromDiscord | <Tetralux> Yeah - I saw that, but I couldn't figure out what command I needed to make it use it. `--cc` wasn't it. |
09:09:28 | FromDiscord | <Tetralux> (edit) "wasn't" => "didn't want to accept" |
09:09:32 | * | MrSyabro joined #nim |
09:10:07 | FromDiscord | <Tetralux> It seems like I can trick it with `--gcc.exe:zigcc.bat --gcc.linkerexe:zigcc.bat`. 🤔 |
09:10:15 | FromDiscord | <Rika> Make a shell file “zcc” and put “zig cc $1” in it |
09:10:18 | FromDiscord | <Rika> Yes |
09:10:21 | FromDiscord | <Rika> Pretty much that |
09:10:40 | FromDiscord | <Tetralux> In reply to @Tetralux "It seems like I": Mentioning `gcc` in this seems... backwards, to say the least. 😄 |
09:10:48 | FromDiscord | <Tetralux> Nothing I want involves GCC. 🤔 |
09:10:58 | FromDiscord | <Tetralux> But it seems to work, at least. |
09:13:14 | kobi7 | here's a new nim file i just finished, sort of finished u know: suncalc |
09:13:27 | kobi7 | https://github.com/kobi2187/suncalc-nim |
09:14:23 | kobi7 | by the way I want to recommend the commandant package. it's an argument parser for command line usage. It works really great. supports subcommands as well |
09:14:40 | FromDiscord | <Elegantbeef> Should `DEFAULT_TIMES` be a `const`? |
09:14:59 | kobi7 | yeah, this is just a remnant of the python codee |
09:15:14 | FromDiscord | <Elegantbeef> Ah |
09:15:16 | kobi7 | they are sun angles and their description |
09:15:25 | FromDiscord | <Elegantbeef> Didnt know if `DateTIme` could be a `const` |
09:15:39 | kobi7 | i want to separate it better, build from below instead of above |
09:15:53 | FromDiscord | <Elegantbeef> To reeeee at you like rika used to you dont do `a: type` consistently |
09:16:03 | FromDiscord | <Elegantbeef> used to me, you\ |
09:16:11 | kobi7 | i mean, handle one, than do many, instead of how it's written in python, but for now it works and i am already time limited anyway |
09:16:19 | FromDiscord | <Elegantbeef> Also put your example inside a `when isMainModule:` 😀 |
09:16:28 | kobi7 | thanks |
09:16:40 | FromDiscord | <Elegantbeef> No problem |
09:18:14 | * | jjido joined #nim |
09:19:12 | kobi7 | porting from python is almost straight forward. I am an advocator for transpilers and automated porting. I think pylib is really cool and should be contributed to. |
09:19:31 | * | jmdaemon quit (Ping timeout: 245 seconds) |
09:20:05 | kobi7 | since devs are invested in their languages, the best way is to have a porting effort. since projects change and improve so fast these days, it's better to have automated tools for porting. |
09:20:52 | kobi7 | for example, see nuget.org (dot net's package manager) |
09:21:00 | kobi7 | it has 292,169 unique packages... |
09:21:20 | FromDiscord | <Elegantbeef> Yea automated porting is harder from languages without similar conventions though |
09:21:56 | FromDiscord | <Elegantbeef> C to Nim could be done for the most part automatically but it's not a fun thing |
09:22:20 | kobi7 | python has a lot, and other trending languages as well. I am currently interested in dart, and there are other clean languages, rust etc. to port a high level language is safer, and with nim its performance will be better. |
09:23:46 | kobi7 | I wrote a tool to do cs to nim, but even there, the languages are different. The proper way is to have an intermediate language, that has all the constructs imaginable, and knows how to translate them to a "lesser" language (lesser meaning a simpler one) |
09:24:08 | kobi7 | but it's a lot of effort. much more complicated than it seems at first |
09:25:03 | kobi7 | even with the tool i wrote, i do not handle c# annotations, reflection, and any other code generation or macro-like |
09:25:38 | kobi7 | if porting from python, you cannot use any runtime eval etc. unless you use python in runtime like nimpy. |
09:25:45 | FromDiscord | <Elegantbeef> Yea languages with vastly different conventions is just going to be hell to machine transpile |
09:26:05 | kobi7 | and there is the problem of Dynamic type, and Array of Object - stuff like that, which Nim doesn't directly support |
09:26:40 | FromDiscord | <Elegantbeef> I mean it kinda does but yea |
09:27:36 | kobi7 | Nim can be regarded a superset sometimes, so it's possible. and with macros, we have things like the classes package and other things that can enable the use case. |
09:27:54 | kobi7 | Right, nim does have variant kinds, which can mimic Object |
09:28:03 | FromDiscord | <Elegantbeef> I mean without any magic |
09:28:04 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3NYC |
09:28:19 | kobi7 | https://github.com/Carpall/nobject |
09:28:52 | kobi7 | yes, but add an int, or string to that list... |
09:28:57 | FromDiscord | <Elegantbeef> It doesnt work on all types only `ref RootObj` but it's atleast there |
09:29:07 | FromDiscord | <Elegantbeef> That was the "kinda" |
09:29:18 | kobi7 | :) actually i almost forgot that it can. |
09:44:08 | FromDiscord | <Evrensel Kişilik> i hate all of damn things |
09:44:12 | FromDiscord | <Evrensel Kişilik> damn framework hells |
09:53:53 | * | pro quit (Quit: pro) |
09:54:22 | * | kobi7 quit (Ping timeout: 260 seconds) |
09:55:44 | * | pro joined #nim |
10:07:20 | * | MrSyabro quit (Quit: Quit) |
10:08:15 | * | Gustavo6046 quit (Quit: Leaving) |
10:10:06 | * | vicecea quit (Remote host closed the connection) |
10:10:36 | * | vicecea joined #nim |
10:15:40 | FromDiscord | <Goel> I'm looking at the System module, but i can't find the proc to get the max value that can be stored by an int (corrisponding by its Type, in my case int32) |
10:17:48 | FromDiscord | <BhamidipatiNikhil> In reply to @Goel "I'm looking at the": https://media.discordapp.net/attachments/371759389889003532/937290490708127774/unknown.png |
10:18:15 | FromDiscord | <Elegantbeef> `high(int)`↵(@Goel) |
10:18:27 | FromDiscord | <Elegantbeef> `high(int32)` |
10:33:04 | * | pro quit (Ping timeout: 256 seconds) |
10:36:39 | FromDiscord | <BhamidipatiNikhil> @ElegantBeef I applied similar strategy to what you suggested to input an integer too... I am struggling to understand why it failed? https://media.discordapp.net/attachments/371759389889003532/937295234415607838/unknown.png |
10:37:35 | FromDiscord | <Elegantbeef> If you're reading a single int why not just `parseInt(stdin.readLine)`? |
10:40:48 | FromDiscord | <Elegantbeef> It looks like you're on windows so change `ch != '\n'` to `ch notin Whitespace` |
10:41:02 | FromDiscord | <Elegantbeef> iirc Windows uses two characters for a newline |
10:43:21 | FromDiscord | <BhamidipatiNikhil> In reply to @Elegantbeef "It looks like you're": Genius!! I forgot, i read about this in the official tutorials... Thx @ElegantBeef ! |
10:57:21 | FromDiscord | <Rika> Beware windows uses \r\n lol |
10:57:56 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:26:09 | FromDiscord | <xx_ns> aye, window uses CRLF and most other systems just LF if you want to google it\ |
11:26:11 | FromDiscord | <xx_ns> (edit) "it\" => "it" |
11:32:24 | * | jjido joined #nim |
11:43:54 | FromDiscord | <tandy> how do i make my computer use my nim fork? |
11:44:16 | FromDiscord | <tandy> i made a pr but i dont want to wait till its merged and released to use it |
11:49:44 | FromDiscord | <xx_ns> what OS? |
11:50:54 | FromDiscord | <tandy> linux |
11:51:38 | FromDiscord | <tandy> oh i just did choosenim . |
11:51:45 | FromDiscord | <tandy> nice |
11:55:52 | FromDiscord | <BhamidipatiNikhil> How do i create a matrix of sequence? I tried to do it through arrays as shown in official tutorial 1, but the problem is that the size of the matrix is not known at compile time.... https://media.discordapp.net/attachments/371759389889003532/937315174040358952/unknown.png |
11:58:13 | FromDiscord | <BhamidipatiNikhil> How to create a matrix whose size is not known at compile time?? |
11:58:54 | FromDiscord | <tandy> nvm, lots of broken shit here.. |
11:59:31 | FromDiscord | <Bung> seq[seq[int]] |
12:00:17 | FromDiscord | <Bung> newSeq is constructor |
12:03:27 | FromDiscord | <Waldecir Santos> In reply to @BhamidipatiNikhil "<@!145405730571288577> I applied similar": May I ask what the theme do you use ? |
12:04:25 | FromDiscord | <BhamidipatiNikhil> In reply to @Bung "seq[seq[int]]": Yes, but wouldn't it allocate too much space to it.... I wanted to conserve space.... https://media.discordapp.net/attachments/371759389889003532/937317321083584512/unknown.png |
12:05:24 | FromDiscord | <BhamidipatiNikhil> In reply to @Waldecir Santos "May I ask what": This Theme is called CyberPunk... I am using it in VSCode editor https://media.discordapp.net/attachments/371759389889003532/937317571382882304/unknown.png |
12:07:38 | FromDiscord | <BhamidipatiNikhil> In reply to @Waldecir Santos "May I ask what": https://marketplace.visualstudio.com/items?itemName=max-SS.cyberpunk |
12:08:52 | FromDiscord | <Waldecir Santos> In reply to @BhamidipatiNikhil "https://marketplace.visualstudio.com/items?itemName": Perfect, thank you/ |
12:09:18 | FromDiscord | <Waldecir Santos> Does nim have any vscode extension that integrates with the testing features ? like Testing Explorer ? |
12:18:31 | FromDiscord | <Rika> In reply to @BhamidipatiNikhil "Yes, but wouldn't it": seq can be allocated w/ specific space with `newSeqOfCap` but you do not put that in the type definition |
12:22:19 | FromDiscord | <demotomohiro> @BhamidipatiNikhil Define matrix type `type Matrix[T] = object x: seq[T]` and define proc `[]`[T](m: Matrix[T]; row, column: int): T = |
13:03:26 | * | PMunch joined #nim |
13:11:02 | FromDiscord | <coldfussion> sent a code paste, see https://paste.rs/oah |
13:35:22 | PMunch | Hmm, I'm guessing Nim doesn't involve the shell with `gorge` |
13:35:28 | PMunch | So it tries to run that as a single command |
13:35:53 | PMunch | Try to replace it with `nimble dump --json ..` |
13:37:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:02:11 | PMunch | @coldfussion ^ |
14:02:32 | FromDiscord | <pmunch> [coldfussion](https://matrix.to/#/@coldfussion:ru-matrix.org)\: ^ |
14:02:52 | PMunch | Huh, I thought tagging people worked.. |
14:03:02 | PMunch | Oh wait, do I not add the @? |
14:03:05 | PMunch | coldfusion ^ |
14:03:09 | PMunch | Hmm, nope |
14:11:38 | FromDiscord | <Rika> they are a matrix user |
14:12:53 | PMunch | Aha, and tagging only works for Discord? |
14:13:16 | FromDiscord | <Rika> not sure |
14:13:18 | FromDiscord | <Rika> prolly |
14:13:23 | PMunch | @Rika |
14:13:38 | FromDiscord | <Rika> or the matrix bridge doesnt work when the irc bridge posts a ping |
14:13:39 | PMunch | Seems like it |
14:13:55 | PMunch | It even added a @ to the nick even though I didn't put it there |
14:16:38 | FromDiscord | <ynfle> Is this a bug, or "just add it to the pile of generics bugs"? |
14:16:54 | FromDiscord | <ynfle> https://play.nim-lang.org/#ix=3O0U |
14:17:26 | FromDiscord | <coldfussion> Oh, this worked! Thank you. Though it's strange ; worked on Linux...↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
14:22:39 | FromDiscord | <ynfle> In reply to @ynfle "https://play.nim-lang.org/#ix=3O0U": Never mind. Don't think it's a bug |
14:26:44 | FromDiscord | <BhamidipatiNikhil> In reply to @demotomohiro "<@764483963422375946> Define matrix type": What should i do next? https://media.discordapp.net/attachments/371759389889003532/937353140334899200/unknown.png |
14:30:04 | FromDiscord | <BhamidipatiNikhil> I am facing a lot of problems creating a matrix of sequence... https://media.discordapp.net/attachments/371759389889003532/937353980902801468/unknown.png |
14:31:21 | FromDiscord | <Rika> you cannot index an empty seq, instead you use `add` |
14:40:40 | PMunch | @coldfussion, probably just a difference in how `staticExec`/`gorge` is implemented between the two platforms |
14:41:31 | * | carce joined #nim |
14:41:34 | PMunch | Or you can do `var am = newSeq[seq[int]](3)` to create a sequence of length three, and then you can assign the three entries like you do in your code |
14:56:28 | * | arkurious joined #nim |
15:02:44 | FromDiscord | <auxym> Is there a way to declare a `const` array that uses an enum index? |
15:03:48 | FromDiscord | <auxym> nvm I just rtfm'd |
15:04:41 | FromDiscord | <Rika> lol |
15:05:32 | * | pro joined #nim |
15:05:48 | FromDiscord | <auxym> just had to use the correct enum order in the literal with colon syntax |
15:06:52 | FromDiscord | <Rika> yeah would be weird to be able to define index 1 before index 0 |
15:12:11 | * | pro quit (Quit: pro) |
15:12:30 | * | pro joined #nim |
15:28:45 | PMunch | Colon syntax? |
15:31:10 | * | NimEventer quit (Ping timeout: 268 seconds) |
15:38:43 | * | carce quit (Remote host closed the connection) |
15:41:37 | FromDiscord | <Rika> [0: val, 1: val2 ...] |
15:44:10 | PMunch | Wait what? |
15:49:04 | * | NimEventer joined #nim |
15:52:28 | * | dv^_^ quit (Read error: Connection reset by peer) |
15:54:21 | * | dv^_^ joined #nim |
15:58:10 | FromDiscord | <BhamidipatiNikhil> In reply to @PMunch "Or you can do": Yes, this worked... Thx @pmun |
15:58:20 | FromDiscord | <BhamidipatiNikhil> (edit) "@pmun" => "@PMunch" |
15:59:08 | FromDiscord | <BhamidipatiNikhil> https://media.discordapp.net/attachments/371759389889003532/937376390376992818/unknown.png |
16:00:19 | FromDiscord | <Szahid> Fastests grx car in GT Sport? |
16:00:29 | FromDiscord | <Szahid> Not here |
16:00:30 | FromDiscord | <Szahid> Sorry |
16:09:11 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3O1L |
16:09:13 | FromDiscord | <auxym> https://nim-lang.org/docs/manual.html#types-array-and-sequence-types |
16:09:42 | * | jjido joined #nim |
16:19:18 | PMunch | Huh, I didn't know that was a thing |
16:23:01 | PMunch | Hmm, that appears to create a weird type out of it |
16:23:46 | PMunch | https://play.nim-lang.org/#ix=3O1T |
16:24:32 | PMunch | There is another way of doing it, which means that it is an error to not declare all the types, and that you can only use a `Values` enum value to get data from the array |
16:24:40 | PMunch | But that kinda seems to be the case for you as well |
16:25:51 | PMunch | It says that it is `array[0..1, string]`, but I believe it is actually `array[valA..valC, string]` or put a different way `array[Values(0..1), string]` |
16:26:14 | PMunch | But the error message you get when you do `lookupTable[0]` is super confusing |
16:36:17 | anddam | PMunch: hi there |
16:36:51 | anddam | I watched the presentation about the keyboard firmware in nim, pretty cool |
16:37:57 | PMunch | Hi anddam, glad you liked it |
16:38:30 | PMunch | I'm actually holding a presentation during FOSDEM which is about making a framework out of the stuff I wrote for that |
16:41:11 | pro | whenn is fosdem ? |
16:46:44 | * | carce joined #nim |
16:47:03 | anddam | PMunch: will look forward to it |
16:47:42 | anddam | btw is FOSDEM still held in physical presence? |
16:48:03 | anddam | (not that I am going to attend, but still) |
16:50:03 | PMunch | pro, FOSDEM is the 5th and 6th of February |
16:50:32 | anddam | PMunch: IIRC when Yardanico helped me out with nimgl/imgui you also suggested a C library "autowrapper" that you wrote |
16:50:33 | PMunch | anddam, FOSDEM last year and this year where both virtual conferences. Hopefully we'll be back to physical ones next year (but who knows, we said that last year as well) |
16:50:43 | PMunch | anddam, ah yes, Futhark |
16:50:57 | anddam | PMunch: yep, COVID was kinda the black swan event of gatherings |
16:59:42 | anddam | I'll reask my question: why do examples at https://github.com/marcomq/nimview/tree/main/examples import ../src/webgui rather than just webgui? |
17:00:02 | anddam | I mean once the package is installed with nimble the latter should be an available package, shouldn't it? |
17:04:58 | * | stkrdknmibalz joined #nim |
17:07:17 | PMunch | It's common practice, that way you can clone the repository and run the examples without installing it |
17:07:43 | PMunch | And if you have installed an older version and clone the repository the examples are guaranteed to run with the version they actually belong to |
17:16:37 | * | rp1 quit (Ping timeout: 240 seconds) |
17:18:41 | * | rp1 joined #nim |
17:30:08 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:41:31 | * | noeontheend joined #nim |
18:07:08 | * | PMunch quit (Quit: leaving) |
18:07:33 | FromDiscord | <yumi> hello, can i ask for some help? |
18:09:40 | FromDiscord | <yumi> im a nim beginner (wrote two utilities at https://github.com/egor4ka), and im trying to rewrite my mpv server folder utility that parses an html to get the file paths and tries to play all the files with mpv, but i cant figure out how to parse html (i've tried parsexml and parsehtml but i couldnt figure out how to do it) |
18:12:35 | FromDiscord | <PMunch> This example from the html parser module should be quite easy to adapt to what you want to do: https://nim-lang.org/docs/htmlparser.html#examplecolon-transforming-hyperlinks |
18:13:13 | FromDiscord | <yumi> it started spitting errors about findAll for some reason |
18:13:15 | FromDiscord | <yumi> tried that |
18:13:56 | FromDiscord | <yumi> let me try to do it real quick... |
18:14:05 | FromDiscord | <yumi> and show you the code |
18:14:48 | * | jjido joined #nim |
18:15:04 | * | jmdaemon joined #nim |
18:19:42 | FromDiscord | <yumi> https://media.discordapp.net/attachments/371759389889003532/937411770476273674/mpv-url-folder.nim |
18:19:44 | FromDiscord | <yumi> here |
18:20:02 | FromDiscord | <yumi> yeah ik about the no hyphens stuff |
18:20:35 | FromDiscord | <yumi> i usually change the name when i copy it over |
18:21:41 | FromDiscord | <yumi> wait i forgot a discard |
18:21:45 | FromDiscord | <yumi> brb |
18:22:26 | FromDiscord | <huantian> what I immediately see is that you're trying to `add` to an immutable variable `files` too |
18:22:36 | FromDiscord | <yumi> oh wait yeah |
18:22:40 | FromDiscord | <yumi> forgot bout that |
18:23:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
18:23:59 | FromDiscord | <yumi> here https://media.discordapp.net/attachments/371759389889003532/937412845447028746/mpvurlfolder.nim |
18:24:43 | FromDiscord | <yumi> i get a bunch of errors about undeclared stuff |
18:25:48 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3O2x |
18:27:02 | * | termer_ is now known as termer |
18:32:43 | * | jmd_ joined #nim |
18:33:27 | * | jmdaemon quit (Ping timeout: 250 seconds) |
18:34:00 | FromDiscord | <yumi> In reply to @yumi "i get a bunch": i seriously have no idea what the fuck does it mean |
18:36:03 | FromDiscord | <dom96> In reply to @TurtleP "Hey, I keep getting": how did lovebrew-0.5.4 get installed? |
18:36:19 | FromDiscord | <TurtleP> locally |
18:36:20 | FromDiscord | <dom96> if nimblemeta.json doesn't exist in it then it sounds like some other tool put it there improperly |
18:36:44 | FromDiscord | <TurtleP> I ran `nimble install` on my project |
18:36:52 | FromDiscord | <TurtleP> which is lovebrew |
18:37:19 | * | carce quit (Remote host closed the connection) |
18:37:30 | FromDiscord | <dom96> is there a nimblemeta.json file in `C:\Users\jpost\.nimble\pkgs\lovebrew-0.5.4\` if you `nimble install` it? |
18:38:00 | FromDiscord | <TurtleP> yes |
18:38:54 | * | jmd_ quit (Ping timeout: 250 seconds) |
18:38:55 | FromDiscord | <dom96> hm, then that's odd. I guess it's complaining about \dist\lovebrew.exe being missing |
18:39:08 | FromDiscord | <dom96> maybe the error is poor and it expects that file to have been installed, but it wasn't |
18:39:56 | NimEventer | New thread by Cybersecdo: Cryptography , see https://forum.nim-lang.org/t/8854 |
18:40:44 | FromDiscord | <TurtleP> which it does exist |
18:40:49 | FromDiscord | <TurtleP> but that's in the project directory |
18:43:09 | FromDiscord | <yumi> hmm |
18:45:12 | * | jmdaemon joined #nim |
18:46:44 | FromDiscord | <TurtleP> and if I got to the filesystem directory and delete the folder it complains about, the error goes away |
18:46:48 | FromDiscord | <TurtleP> @dom96 |
18:47:55 | FromDiscord | <dom96> hard to say what the problem is, could be a Nimble bug |
18:48:01 | FromDiscord | <dom96> depends what this `dist` directory is |
18:48:11 | * | nixfreaknim[m] quit (Quit: Bridge terminating on SIGTERM) |
18:48:11 | * | cheer[m] quit (Quit: Bridge terminating on SIGTERM) |
18:48:11 | * | happycorsair[m] quit (Quit: Bridge terminating on SIGTERM) |
18:48:12 | * | zgasma[m] quit (Quit: Bridge terminating on SIGTERM) |
18:48:12 | * | xiamx quit (Quit: Bridge terminating on SIGTERM) |
18:48:17 | FromDiscord | <dom96> and whether you do some fancy stuff with it during Nimble install 🙂 |
18:48:43 | FromDiscord | <TurtleP> it's just a directory where the resulting binary goes |
18:49:04 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3O3V |
18:51:15 | FromDiscord | <yumi> trying to nim check the mpvurlfolder.nim file, i get the output in the nimcheckoutput.txt file https://media.discordapp.net/attachments/371759389889003532/937419705113788496/mpvurlfolder.nim https://media.discordapp.net/attachments/371759389889003532/937419705310912532/nimcheckoutput.txt |
18:51:25 | FromDiscord | <yumi> any ideas? |
18:52:33 | * | cheer[m] joined #nim |
18:59:09 | FromDiscord | <yumi> okay nvm i screwed something up in my fs |
18:59:10 | * | happycorsair[m] joined #nim |
18:59:10 | FromDiscord | <yumi> brb |
18:59:22 | * | zgasma[m] joined #nim |
18:59:37 | * | xiamx joined #nim |
18:59:37 | * | nixfreaknim[m] joined #nim |
18:59:43 | FromDiscord | <yumi> hmm |
18:59:45 | FromDiscord | <auxym> `import xmltree` maybe? findAll on XmlNode is defined in xmltree |
18:59:50 | FromDiscord | <yumi> oh |
18:59:51 | FromDiscord | <yumi> okay |
18:59:57 | FromDiscord | <yumi> ill try that |
19:00:03 | FromDiscord | <yumi> but termux is kinda screwed |
19:00:04 | FromDiscord | <yumi> brb |
19:00:22 | FromDiscord | <yumi> (yeah im coding on a phone) |
19:00:36 | FromDiscord | <rishavs (Rishav Sharan)> Need some advice. I am trying to create a parser combinator in nim, and will need to mutate a source string "in-situ" a lot for this. Would something like strutils/ continuesWith or delete procs be good for this. I really don't want to create a new string everytime but just truncate a few characters from the start of the string. |
19:04:53 | FromDiscord | <yumi> sent a code paste, see https://play.nim-lang.org/#ix=3O42 |
19:05:53 | FromDiscord | <huantian> `files.add(splitFile(a.attrs["href"]))`, `splitFile(a.attrs["href"])` returns a `tuple[dir: string, name: string, ext: string]`, nto a string |
19:05:59 | FromDiscord | <huantian> (edit) "`files.add(splitFile(a.attrs["href"]))`, `splitFile(a.attrs["href"])`" => "`files.add(splitFile(a.attrs["href"]))`↵`splitFile(a.attrs["href"])`" |
19:06:06 | FromDiscord | <huantian> (edit) "`files.add(splitFile(a.attrs["href"]))`↵`splitFile(a.attrs["href"])`" => "`files.add(splitFile(a.attrs["href"]))`↵`splitFile()`" |
19:06:09 | FromDiscord | <huantian> (edit) "nto" => "not" |
19:13:19 | FromDiscord | <yumi> uh |
19:13:25 | FromDiscord | <yumi> so what do i change it to? |
19:14:35 | FromDiscord | <huantian> if you only want the filename use `extractFilename()` |
19:14:42 | FromDiscord | <huantian> not sure why you're splitFile-ing |
19:14:54 | FromDiscord | <yumi> uh |
19:14:55 | FromDiscord | <yumi> what |
19:15:02 | FromDiscord | <yumi> i just want to get the value of the href |
19:15:13 | FromDiscord | <huantian> then I don't think you need splitFile at all |
19:15:21 | FromDiscord | <yumi> what do i use then? |
19:15:36 | FromDiscord | <huantian> `files.add((a.attrs["href"])` |
19:15:39 | FromDiscord | <huantian> (edit) "`files.add((a.attrs["href"])`" => "`files.add(a.attrs["href"])`" |
19:15:44 | FromDiscord | <yumi> oh okay thanks |
19:16:31 | * | cyraxjoe quit (Quit: I'm out!) |
19:16:32 | FromDiscord | <yumi> wooo it works |
19:16:33 | FromDiscord | <yumi> thanks |
19:16:53 | FromDiscord | <Rika> Where did the split file thing come from? Why did you use it I mean |
19:18:19 | * | cyraxjoe joined #nim |
19:19:33 | FromDiscord | <yumi> i copied it from the docs |
19:19:56 | * | nixfreaknim[m] quit (Quit: Client limit exceeded: 20000) |
19:23:20 | * | cheer[m] quit (Quit: Client limit exceeded: 20000) |
19:23:35 | * | happycorsair[m] quit (Quit: Client limit exceeded: 20000) |
19:25:01 | FromDiscord | <yumi> hmmm |
19:25:02 | * | cheer[m] joined #nim |
19:25:09 | FromDiscord | <yumi> now getting runtime errors |
19:25:17 | * | happycorsair[m] joined #nim |
19:25:30 | * | nixfreaknim[m] joined #nim |
19:26:49 | FromDiscord | <yumi> ./mpvurlfolder https://duckykutya.cf/kat/↵/data/data/com.termux/files/home/mpvurlfolder.nim(3) mpvurlfolder↵/data/data/com.termux/files/usr/lib/nim/lib/system/fatal.nim(53) sysFatal↵Error: unhandled exception: index 1 not in 0 .. 0 [IndexDefect] https://media.discordapp.net/attachments/371759389889003532/937428659667611668/mpvurlfolder.nim |
19:27:04 | FromDiscord | <yumi> uh |
19:27:05 | FromDiscord | <yumi> wait |
19:27:47 | FromDiscord | <yumi> (edit) "./mpvurlfolder https://duckykutya.cf/kat/↵/data/data/com.termux/files/home/mpvurlfolder.nim(3) mpvurlfolder↵/data/data/com.termux/files/usr/lib/nim/lib/system/fatal.nim(53) sysFatal↵Error: unhandled exception: index 1 not in 0 .. 0 [IndexDefect] https://media.discordapp.net/attachments/371759389889003532/937428659667611668/mpvurlfolder.nim" => "sent a long message, see http://ix.io/3O47" |
19:27:54 | FromDiscord | <yumi> i dont understand |
19:28:25 | FromDiscord | <dom96> sent a code paste, see https://paste.rs/SND |
19:31:19 | FromDiscord | <yumi> In reply to @yumi "~ $ ./mpvurlfolder https://duckykutya.cf/kat/": i run curl from the script but nothing |
19:32:45 | FromDiscord | <yumi> hmm |
19:34:58 | FromDiscord | <yumi> fixed the issue L |
19:35:02 | FromDiscord | <yumi> (edit) "L" => "LOL" |
19:35:17 | FromDiscord | <yumi> i shouldve declared the html variable AFTER the curl |
19:35:21 | FromDiscord | <yumi> i am an idiot |
19:39:40 | FromDiscord | <yumi> thanks for the help guys! |
19:53:09 | FromDiscord | <yumi> by the way, how can i silence the output of a proc in nim? |
19:53:30 | FromDiscord | <yumi> sent a code paste, see https://paste.rs/Mqk |
19:57:44 | FromDiscord | <ajusa> In reply to @yumi "i need to silence": what's the full command? did you try `curl -s`? |
19:58:06 | FromDiscord | <yumi> i tried curl -LO {file} {url} |
19:58:12 | FromDiscord | <yumi> there is an -s param? |
19:59:18 | FromDiscord | <ajusa> I see the code you posted earlier, if you are on a UNIXy system `curl -LO {file} {url} > /dev/null` should work. |
20:00:00 | FromDiscord | <ajusa> alternatively you could do `curl -L {url} > {file}`, that might work as well. |
20:00:26 | FromDiscord | <yumi> but > doesnt work with execShellCmd |
20:00:32 | FromDiscord | <yumi> lemme try -s |
20:00:39 | * | zgasma[m] left #nim (#nim) |
20:01:01 | FromDiscord | <ajusa> In reply to @yumi "but > doesnt work": oh really? my bad, thought it just used the normal system shell |
20:01:09 | FromDiscord | <yumi> i dont think so |
20:01:41 | FromDiscord | <yumi> https://github.com/egor4ka/mpvurlfolder here is the repo btw |
20:15:25 | * | jmdaemon quit (Read error: Connection reset by peer) |
20:15:48 | * | jmdaemon joined #nim |
20:25:39 | FromDiscord | <hethir> how can I deep copy a `ref object`? |
20:27:28 | FromDiscord | <konsumlamm> using `deepCopy` |
20:28:59 | FromDiscord | <rishavs (Rishav Sharan)> sent a code paste, see https://play.nim-lang.org/#ix=3O4n |
20:33:23 | FromDiscord | <Markz> Hello, I see two Nim extensions for VSCode. Which one should I use? |
20:33:56 | FromDiscord | <Arizu> How can I have file Inter Process Communication? |
20:36:40 | * | neurocyte0917090 joined #nim |
20:38:52 | FromDiscord | <Elegantbeef> @Markz\: nimsaem's is the best |
20:39:03 | FromDiscord | <Markz> In reply to @Elegantbeef "<@264065313316798474>\: nimsaem's is the": Thank you. |
20:39:11 | FromDiscord | <Elegantbeef> [rishavs (Rishav Sharan)](https://matrix.to/#/@rishavs-58046952d73408ce4f2ebf0c:gitter.im)\: do `chr("hello", 'h')` |
20:39:14 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
20:39:23 | FromDiscord | <Elegantbeef> [Arizu](https://matrix.to/#/@nizoneko:snug.moe)\: memfiles, sockets both exist |
20:40:29 | * | cyraxjoe joined #nim |
20:41:51 | FromDiscord | <rishavs (Rishav Sharan)> Still getting the error↵https://play.nim-lang.org/#ix=3O4s |
20:41:52 | FromDiscord | <Elegantbeef> Oh i'm blind |
20:41:52 | FromDiscord | <Elegantbeef> It's `Option[string]` not `Option(string)` |
20:44:28 | * | pro quit (Quit: pro) |
20:47:32 | FromDiscord | <rishavs (Rishav Sharan)> damn it! me and my stupid mistakes \>.\>↵Thanks @elegantbeef\:matrix.org for catching that |
20:48:12 | FromDiscord | <Elegantbeef> No problem |
21:31:37 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:46:42 | FromDiscord | <Waldecir Santos> is there a way to run unitests with a "failfast" option so the test stops on the first error ? |
21:57:18 | FromDiscord | <Elegantbeef> Pmunch you about? |
22:00:02 | FromDiscord | <Elegantbeef> Or i suppose if anyone is around that knows how to get kate to do error reporting |
22:03:46 | * | jjido joined #nim |
22:25:25 | FromDiscord | <ynfle> In reply to @Waldecir Santos "is there a way": https://nim-lang.org/docs/unittest.html#abortOnError See docs on this `var` |
22:27:02 | FromDiscord | <Waldecir Santos> Awesome thank you |
22:30:37 | FromDiscord | <treeform> In reply to @creikey "does anybody happen to": It does not flip images, 0,0 is top left. Its very easy to flip though just call flip: https://nimdocs.com/treeform/pixie/pixie/images.html#flipVertical%2CImage |
22:30:59 | FromDiscord | <treeform> In reply to @Isofruit "The tooling obviously isn't": thank you for using jsony! |
22:31:44 | FromDiscord | <Phil> In reply to @treeform "thank you for using": You're welcome, but how come the message? |
22:32:37 | FromDiscord | <Phil> (edit) "welcome," => "welcome (or rather: Thank you for making the lib!)," |
22:33:12 | FromDiscord | <Phil> Oh! As a sidenote though, a question! I stumbled into a scenario where I wasn't sure how to solve it with jsony |
22:33:33 | FromDiscord | <treeform> do you have a small test case for that? |
22:34:04 | FromDiscord | <Phil> Not quite, I'm not sure how to make that understandable without providing context of the usecase |
22:35:28 | FromDiscord | <treeform> I messaged you because I did search for my lib names and your msg came up, so I replied. |
22:36:04 | FromDiscord | <treeform> In reply to @creikey "why are the functions": What functions name you don't like? |
22:37:24 | FromDiscord | <treeform> In reply to @Isofruit "Oh! As a sidenote": All most all jsony solution require a parseHook of some sort. |
22:37:44 | FromDiscord | <Waldecir Santos> How in nim can I override the object constructor when using OOP ? |
22:39:05 | FromDiscord | <Elegantbeef> You dont override the object constructor you make your own constructor |
22:39:10 | FromDiscord | <Phil> sent a long message, see http://ix.io/3O4O |
22:39:45 | FromDiscord | <ynfle> In reply to @Waldecir Santos "How in nim can": There are no constructors. You can define an `init` or `new` proc (depeneding on ref vs. regular object) or `initMyTypeName` or `newMyTypeName`. depending on your fancy |
22:39:45 | FromDiscord | <Phil> (edit) "http://ix.io/3O4O" => "http://ix.io/3O4P" |
22:40:04 | FromDiscord | <Elegantbeef> I mean there is `Type()` that's a constructor |
22:40:09 | FromDiscord | <Phil> Wait, as I typed it out the answer hit me in the face |
22:41:41 | FromDiscord | <Phil> I keep forgetting nim has type aliasing |
22:41:47 | FromDiscord | <Waldecir Santos> In reply to @ynfle "There are no constructors.": Got it thank you. |
22:42:17 | FromDiscord | <ynfle> In reply to @Elegantbeef "I mean there is": You're right. No overridable constructors. I don't get to define them |
22:42:53 | FromDiscord | <Elegantbeef> If you're a lazy sod like me you may enjoy https://github.com/beef331/constructor |
22:43:08 | FromDiscord | <Phil> +1 for constructor |
22:43:23 | FromDiscord | <Phil> I'm using it myself in nimstoryfont, saves me so many lines of code |
22:43:45 | FromDiscord | <Phil> Every time I thought I found a bug it turns out I only found my own lies |
22:44:17 | FromDiscord | <Phil> ~~Meaning I had no proper understanding on when it generates initObject proc and when newObject proc~~ |
22:47:26 | FromDiscord | <Phil> It became pretty much one of those things I auto-include nowadays the second I smell an object becoming part of my project |
22:58:04 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3O4U |
22:58:35 | FromDiscord | <ynfle> (edit) "https://play.nim-lang.org/#ix=3O4U" => "https://play.nim-lang.org/#ix=3O4V" |
22:58:41 | FromDiscord | <ynfle> (edit) "https://play.nim-lang.org/#ix=3O4V" => "https://play.nim-lang.org/#ix=3O4W" |
23:02:26 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:13:27 | FromDiscord | <keks> sent a code paste, see https://play.nim-lang.org/#ix=3O53 |
23:13:39 | FromDiscord | <keks> (edit) |
23:13:39 | FromDiscord | <creikey> In reply to @treeform "It does not flip": I thought they were being flipped because I had accidentally swapped the `top` and `bottom` parameters of the ortho projection, so everything was being flipped |
23:14:58 | FromDiscord | <Elegantbeef> you need `proc initVec[N: static int, T](a: array[N, T]): Vector[N, T] =`↵(@keks) |
23:15:38 | FromDiscord | <creikey> In reply to @treeform "What functions name you": I just have never heard the term reactor before, apparently it's standard though |
23:15:49 | FromDiscord | <creikey> (edit) "In reply to @treeform "What functions name you": I just have never heard the term reactor before, ... apparently" added "like in `newReactor`," |
23:16:58 | FromDiscord | <keks> In reply to @Elegantbeef "you need `proc initVec[N:": Ohhh! Thank you, I wouldn't have guessed it myself for sure. |
23:19:29 | FromDiscord | <Elegantbeef> That's why they keep me around, i have a good understanding of what causes issues 😛 |
23:19:54 | FromDiscord | <treeform> In reply to @Isofruit "A lot of it": you can put json nodes into your objects see docs: https://github.com/treeform/jsony#full-support-for-json-in-json |
23:20:07 | FromDiscord | <treeform> "Sometimes your json objects could contain arbitrary json structures, maybe event user defined." |
23:21:10 | FromDiscord | <treeform> In reply to @creikey "I just have never": Yeah its pretty common even has its own Wikipedia page: https://en.wikipedia.org/wiki/Reactor_pattern |
23:22:57 | FromDiscord | <creikey> In reply to @treeform "Yeah its pretty common": yeah makes sense as a term then |
23:31:07 | NimEventer | New thread by Xigoi: Nim's autoformatter situation, see https://forum.nim-lang.org/t/8855 |
23:44:19 | FromDiscord | <keks> In reply to @Elegantbeef "That's why they keep": I'm feeling slightly scared of "those" who are keeping you here 😄 |
23:52:11 | FromDiscord | <Elegantbeef> Lol |