00:00:38 | FromDiscord | <Elegantbeef> make a second span that takes no arguments |
00:00:55 | FromDiscord | <Elegantbeef> or do `default(array[0, (string, string)]` |
00:01:37 | FromDiscord | <ajusa> thanks, default is what I was missing! |
00:01:55 | FromDiscord | <Elegantbeef> You can also do `array[0, (string, string)([])` |
00:02:06 | FromDiscord | <Elegantbeef> Or any other form fof that |
00:02:15 | FromDiscord | <ajusa> there's no way to give a default argument for an untyped parameter, right? I've got an overload for that, but curious if there's a way to remove the overload |
00:02:23 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3QRI |
00:02:33 | FromDiscord | <Elegantbeef> Yep nice and clean now |
00:02:49 | FromDiscord | <b4mbus> thanks a lot |
00:03:02 | FromDiscord | <b4mbus> now lets figure out how to use threads in this language :p |
00:04:23 | FromDiscord | <Elegantbeef> There are a bunch of different ways to do it 😀 |
00:04:44 | FromDiscord | <b4mbus> probably, how would you do it? |
00:04:52 | FromDiscord | <Elegantbeef> No clue what you're writing |
00:06:16 | FromDiscord | <b4mbus> the default nim logger does not color the output so Im writing a very simple logger that does basically what `ConsoleLogger` does, but colors the ouput for `INFO`, `WARNING`, `ERROR` and `FATAL` like so https://media.discordapp.net/attachments/371759389889003532/947283454377197568/unknown.png |
00:06:44 | FromDiscord | <Elegantbeef> You have the standard lib's channels and basic threads, Weave, taskpools, and more 😀 |
00:06:50 | FromDiscord | <b4mbus> this func is responsible for taking a format string and returning it BUT with an ansi color code prependend and asci color code that resets appended |
00:07:21 | FromDiscord | <Elegantbeef> So this is just for testing logger? |
00:07:33 | FromDiscord | <b4mbus> not sure wym by `testing logger` |
00:07:42 | FromDiscord | <Elegantbeef> Well why do you need threads |
00:07:54 | FromDiscord | <b4mbus> it's public only for testing purposes, but Itll be private finally |
00:08:03 | FromDiscord | <b4mbus> In reply to @Elegantbeef "Well why do you": not for the logger, for the whole app |
00:08:11 | FromDiscord | <Elegantbeef> And what's the app? |
00:09:32 | FromDiscord | <b4mbus> A discord bot, consisting of an error handler, a logger and a discord "service" (that part that actually registers commands, registers interaction callbacks etc) |
00:09:47 | FromDiscord | <b4mbus> the discord part uses threads itself for shards |
00:09:48 | FromDiscord | <Elegantbeef> Ok so then the basic Nim threads will probably be fine for you |
00:10:30 | FromDiscord | <b4mbus> yeah I guess so, but system/threads says "DONT IMPORT CUZ WE SAY SO", some articles online use `createThread` which errors on me, bla, bla |
00:10:43 | FromDiscord | <b4mbus> I was just testing a bit I havent gotten to the implementation phase where I actually use threads |
00:10:56 | FromDiscord | <Elegantbeef> `--threads:on` |
00:11:19 | FromDiscord | <b4mbus> .. yeah I actually did forgot to include that in my config file |
00:11:23 | FromDiscord | <Elegantbeef> Nim has threads disabled by default, which will change with 2.0 |
00:11:54 | FromDiscord | <b4mbus> it doesnt follow ZOA? |
00:11:56 | FromDiscord | <Elegantbeef> The reason you dont import it is cause it's imported with that flag |
00:12:00 | FromDiscord | <b4mbus> (edit) "ZOA?" => "ZCA?" |
00:12:04 | FromDiscord | <Elegantbeef> ZOA? |
00:12:27 | FromDiscord | <b4mbus> ZCA, sorry, Zero Cost Abstraction - what you dont use you should not be paying for. I see no other reason to disable threads by default tbh |
00:12:37 | FromDiscord | <Elegantbeef> TLS |
00:12:42 | FromDiscord | <b4mbus> (edit) "be paying" => "pay" |
00:12:44 | FromDiscord | <b4mbus> TLS? |
00:13:13 | FromDiscord | <b4mbus> like the protocol? |
00:13:31 | FromDiscord | <Elegantbeef> thread local storage emulation has performance cost presently afaik, but Nim 2.0 will have threads enabled by default |
00:14:14 | FromDiscord | <b4mbus> I see |
00:14:21 | FromDiscord | <b4mbus> makes sense then |
00:16:42 | FromDiscord | <ShalokShalom> I did a little program, that simply executes three command line binaries |
00:17:00 | FromDiscord | <ShalokShalom> when I compile it, it says: Error: expression expected, but found '[EOF]' |
00:17:26 | FromDiscord | <Elegantbeef> You have a procedure or statement that expects something |
00:17:27 | FromDiscord | <Elegantbeef> Show code |
00:19:43 | FromDiscord | <ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QRS |
00:20:17 | FromDiscord | <Elegantbeef> No quotes |
00:20:28 | FromDiscord | <ShalokShalom> around? |
00:20:40 | FromDiscord | <Elegantbeef> the right hand of `exec` |
00:21:06 | FromDiscord | <Elegantbeef> What `exec` are you even using? |
00:21:41 | FromDiscord | <tracy> sent a code paste, see https://play.nim-lang.org/#ix=3QRT |
00:22:02 | FromDiscord | <ShalokShalom> thanks |
00:22:12 | FromDiscord | <tracy> np |
00:25:44 | FromDiscord | <Elegantbeef> forgot to mention `import os` 🙂 |
00:28:30 | * | Gustavo6046 quit (Ping timeout: 268 seconds) |
00:37:19 | FromDiscord | <$ tracy> discord keep locking my accs bro |
00:38:03 | nrds | <Prestige99> For phone numbers? |
00:39:29 | FromDiscord | <$ tracy> yh |
00:41:04 | FromDiscord | <Elegantbeef> Time to use something aside from discord 😛 |
00:42:52 | FromDiscord | <ajusa> is there a way to have a template that has two overloads: one with a single argument of type string, and another with a single argument of type untyped? And use the first one if the type is string, and the second one if the type isn't? |
00:43:34 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3QS2 |
00:44:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/PkQ |
00:45:08 | FromDiscord | <Elegantbeef> The issue here is the `openArray` you need your own |
00:45:50 | FromDiscord | <ajusa> what's wrong with the openarray? do I need a more concrete type? |
00:46:09 | FromDiscord | <Elegantbeef> Openarray is a runtime type that requires conversion so `untyped` is more exact |
00:47:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/CHe |
00:48:34 | FromDiscord | <ajusa> that's some wizardry right there. are there are options without concepts (just curious) |
00:49:07 | FromDiscord | <Elegantbeef> The concept is the best option, you'd otherwise need a way to say `array[auto, T]` which i dont think is valid |
00:56:08 | FromDiscord | <Rika> spooky concepts |
00:56:12 | FromDiscord | <Rika> im jokin |
00:58:31 | * | ltriant joined #nim |
01:00:41 | * | shalokshalom quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
01:03:16 | * | ltriant quit (Ping timeout: 245 seconds) |
01:11:55 | FromDiscord | <Patitotective> how can i know if a variable is var, let or const? |
01:13:00 | FromDiscord | <Rika> from a macro? |
01:13:06 | FromDiscord | <Patitotective> nvm |
01:13:07 | FromDiscord | <Patitotective> hehe |
01:13:15 | FromDiscord | <Elegantbeef> It's a simple macro |
01:13:20 | FromDiscord | <Patitotective> how to modify a nested value from a table? |
01:13:32 | FromDiscord | <Patitotective> like, it was working when it wasn't nested 🤷♂️ |
01:13:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QS5 |
01:13:52 | FromDiscord | <Elegantbeef> Jeez i messd that up |
01:13:57 | FromDiscord | <Rika> wasnt working as in how? |
01:14:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QS6 |
01:14:33 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QS7 |
01:15:14 | FromDiscord | <Patitotective> an i guess it's because it's not `var` |
01:15:17 | FromDiscord | <Rika> no? |
01:15:36 | FromDiscord | <Rika> whats the error |
01:16:46 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QS9 |
01:17:13 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3QS9" => "https://paste.rs/MZY" |
01:17:25 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=3QSb" => "https://paste.rs/alf" |
01:18:38 | FromDiscord | <Rika> is the `prefs` variable a var |
01:18:44 | FromDiscord | <Rika> it might be a var thing now yes |
01:18:51 | FromDiscord | <Patitotective> yep `var prefs = initPrefs(defaultPrefs, "settings.niprefs")` |
01:19:16 | FromDiscord | <Rika> what are the procs you have for `[]` for the prefsnode type |
01:20:11 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QSd |
01:20:12 | FromDiscord | <Elegantbeef> `(prefs.table["scheme"]["font"]["size"]) = 20.toPrefs`? |
01:20:58 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QSe |
01:21:03 | FromDiscord | <Rika> In reply to @Elegantbeef "`(prefs.table["scheme"]["font"]["size"]) = 20.toPre": requires a `[]` that returns a var T |
01:21:14 | FromDiscord | <Rika> same with the first error |
01:21:16 | FromDiscord | <Elegantbeef> return var |
01:22:29 | FromDiscord | <Patitotective> In reply to @Elegantbeef "return var": do you mean that i should make the `[]` procedures return a var? |
01:22:33 | FromDiscord | <Patitotective> (edit) "var?" => "var type?" |
01:23:36 | FromDiscord | <Rika> yes |
01:23:52 | FromDiscord | <Rika> if one of the types are also var, that is |
01:23:56 | FromDiscord | <Elegantbeef> well i mean make them return var if the node is var |
01:24:08 | FromDiscord | <Rika> example here https://nim-lang.org/docs/tables.html#%5B%5D%2COrderedTable%5BA%2CB%5D%2CA_2 |
01:24:12 | FromDiscord | <Patitotective> In reply to @Elegantbeef "well i mean make": oh, that makes sense |
01:24:44 | FromDiscord | <Elegantbeef> Yea you dont have a var accessor |
01:24:44 | FromDiscord | <Elegantbeef> you need two `[]` procs one for var and one for non varf |
01:24:56 | FromDiscord | <Elegantbeef> It's semi-annoying but it's what's required for mutable/immutable types |
01:25:28 | FromDiscord | <Patitotective> thank you guys ❤️ i ll try it tomorrow :D |
01:57:09 | nrds | <Prestige99> Hm yeah I think something is up with these bindings @ElegantBeef - scratching my head still |
01:58:42 | FromDiscord | <Elegantbeef> Yea i didnt see an issue there, so do not know |
03:09:38 | * | Lord_Nightmare joined #nim |
03:16:25 | FromDiscord | <ajusa> is there an easy way to print out the nim code after templates have expanded? |
03:17:06 | FromDiscord | <Elegantbeef> `--expandMacro: name` or `macros.expandmacros` |
03:20:19 | FromDiscord | <ajusa> that almost does what I want - I want to see code right before C codegen happens, as with expandMacros I can see a bunch of unused templates that I don't want to see |
03:20:42 | FromDiscord | <Elegantbeef> what about `--expandMacro`? |
03:24:36 | FromDiscord | <ajusa> that works, thanks! |
03:26:14 | * | arkurious quit (Quit: Leaving) |
03:26:41 | * | Gustavo6046 joined #nim |
03:26:48 | FromDiscord | <Pandasdontfly> would anybody reccomend the nim in action book |
03:28:05 | FromDiscord | <Elegantbeef> A fair bit of people read it and like it, I've never read it |
03:30:16 | * | ltriant joined #nim |
03:31:50 | FromDiscord | <Rika> I bought it but I never read it in depth but I still think it’s a good resource |
03:33:04 | FromDiscord | <Elegantbeef> I'm too dumb to read so i've never got it |
03:34:00 | FromDiscord | <Elegantbeef> I have read parts stefan salewski's and it is pretty good https://ssalewski.de/nimprogramming.html |
03:44:20 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
03:51:16 | FromDiscord | <abdu> sent a long message, see http://ix.io/3QSH |
03:51:41 | FromDiscord | <abdu> (edit) "http://ix.io/3QSH" => "http://ix.io/3QSI" |
03:53:09 | FromDiscord | <huantian> You can’t hold on to an openArray like that iirc |
03:53:28 | FromDiscord | <Elegantbeef> Openarray is only for parameters presently |
03:53:55 | FromDiscord | <Elegantbeef> It's an abstraction over `seq[T] or array[any, T]` to allow any indexed array and sequence to go through the same procedure |
03:54:13 | FromDiscord | <abdu> Ok |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
04:08:05 | FromDiscord | <sheldon> How to clean nimble test cached files? |
04:08:39 | FromDiscord | <sheldon> or is it the same to forceBuild when nimble test |
04:10:26 | FromDiscord | <Elegantbeef> Nimble doesnt handle the cache of the files so a force build will work |
04:11:30 | FromDiscord | <demotomohiro> @abdu https://nim-lang.org/docs/system.html#toOpenArray%2Ccstring%2Cint%2Cint |
04:12:28 | FromDiscord | <sheldon> How to make nimble test force build 😅 |
04:12:51 | FromDiscord | <Elegantbeef> does `nimble test -f` work? |
04:24:01 | FromDiscord | <sheldon> I think it should work |
04:24:43 | FromDiscord | <sheldon> I'm trying with https://github.com/marcomq/nimview |
04:34:16 | * | ltriant quit (Ping timeout: 272 seconds) |
04:51:02 | FromDiscord | <sheldon> Playing with Flutter recently, seems nimview targets the same goal. |
05:14:57 | * | slowButPresent quit (Quit: leaving) |
05:28:45 | FromDiscord | <Bung> experimental strictEffects is in nim 1.4 ? I got `/home/runner/.nimble/pkgs/hmisc-0.14.5/hmisc/algo/hseq_distance.nim(1, 17) Error: unknown experimental feature↵` am runing on nim 1.4.8 |
05:29:18 | FromDiscord | <Elegantbeef> Wasnt it added in 1.6 ? |
05:29:57 | FromDiscord | <Rika> Experiments aren’t back ported no? |
05:30:05 | FromDiscord | <Elegantbeef> They are not |
05:32:10 | FromDiscord | <Bung> oh, thanks ! I think I create a issue to @haxscramper |
05:32:53 | FromDiscord | <haxscramper> What experimental feature is this |
05:33:54 | FromDiscord | <Bung> strictEffects |
05:34:50 | FromDiscord | <haxscramper> Nim 1.4.8 is not supported |
05:34:56 | FromDiscord | <Bung> https://github.com/haxscramper/hmisc/issues/10 I create one |
05:35:13 | FromDiscord | <haxscramper> Hmisc only supports latest nim |
05:35:49 | FromDiscord | <Bung> requires "nim >= 1.4.8" should change |
05:35:52 | FromDiscord | <Rika> In reply to @haxscramper "Nim 1.4.8 is not": The nimble dependency file says otherwise i think |
05:36:39 | FromDiscord | <haxscramper> Ok, I will update that |
05:40:42 | FromDiscord | <Bung> please also update version |
05:56:46 | * | rockcavera quit (Remote host closed the connection) |
06:55:11 | FromDiscord | <Bung> https://github.com/bung87/scorper/runs/5348802366?check_suite_focus=true I got `Did you mean to use 'quiet'? (silent -> quiet)` when run `slim --silent test` on macosx and linux , slim is my nimble package before, now it becoming other binary I think ? |
07:33:33 | FromDiscord | <haxscramper> it seems like someone actually uses my failed message suggestion generator |
07:33:37 | FromDiscord | <haxscramper> I'm surprised |
07:35:00 | FromDiscord | <haxscramper> In reply to @Bung "please also update version": done |
08:00:42 | FromDiscord | <Bung> In reply to @haxscramper "I'm surprised": hmm, I searched hmisc source maybe it wrongly parse nimble arguments |
08:01:22 | FromDiscord | <haxscramper> I parse nimble arguments somewhere? |
08:02:59 | FromDiscord | <Bung> stringMismatchMessage(/algo/clformat.nim) -> other/hargparse.nim or other/cliparse.nim |
08:05:45 | FromDiscord | <haxscramper> this is a general CLI parser |
08:27:48 | FromDiscord | <Bung> I tred to find will it calls , havn't found yet, theres only silent in slim and nimble source, I dont know why it suggest quiet |
08:28:06 | FromDiscord | <Bung> (edit) "will" => "where" |
08:30:55 | * | jjido joined #nim |
08:31:04 | * | ltriant joined #nim |
08:36:09 | * | ltriant quit (Ping timeout: 256 seconds) |
09:05:41 | FromDiscord | <⎝⪩﹏⪨⎠> Yay, the parser is able to at least sum two numbers :) https://media.discordapp.net/attachments/371759389889003532/947419203315589150/unknown.png |
09:07:36 | FromDiscord | <Rika> In reply to @⎝⪩﹏⪨⎠ "Yay, the parser is": “Nim?” |
09:08:08 | FromDiscord | <⎝⪩﹏⪨⎠> In reply to @Rika "“Nim?”": Because I wasn't sure if I wanted to learn Nim in that time. |
09:08:19 | FromDiscord | <Rika> No it’s funny lmao |
09:08:34 | FromDiscord | <Rika> It kinda reads like you don’t know if the code is Nim or not lol |
09:08:39 | FromDiscord | <Bung> https://github.com/haxscramper/hnimast/blob/e62725ae033d4c832f0e2106c634c87a4351b259/src/hnimast/hast_common.nim#L859 @haxscramper where is noneOfIt importing from ? |
09:09:02 | FromDiscord | <⎝⪩﹏⪨⎠> And still, I don't know if keep learning it or stick with Lua and C++ (although, I think I'll keep with Nim). |
09:09:41 | FromDiscord | <Rika> Your choice, dunno what’s keeping you from choosing |
09:10:58 | FromDiscord | <⎝⪩﹏⪨⎠> In reply to @Rika "Your choice, dunno what’s": C++: too complex for me (at least, the libraries)↵Lua: lack of documentations for some libraries and not compiled↵Nim: lack of good tutorials |
09:13:36 | FromDiscord | <haxscramper> In reply to @Bung "https://github.com/haxscramper/hnimast/blob/e62725a": https://github.com/haxscramper/hmisc/search?q=noneOfIt github has search |
09:13:37 | FromDiscord | <haxscramper> you can use it |
09:14:36 | FromDiscord | <haxscramper> what exactly do you use hmisc for? |
09:17:02 | FromDiscord | <haxscramper> and I will be moving to nimskull in the future anyway, so you might want to consider looking for the alternatives |
09:17:56 | FromDiscord | <Bung> https://github.com/bung87/slim I try to update |
09:18:56 | FromDiscord | <Bung> but seems hnimast and hmisc breaking |
09:19:32 | FromDiscord | <haxscramper> hnimast already uses nimskull |
09:19:55 | FromDiscord | <haxscramper> I think I should just take all my repos from nimble |
09:20:21 | FromDiscord | <haxscramper> because I don't think I'm really fit for supporting the libraries myself, so |
09:20:34 | FromDiscord | <haxscramper> to not give people unnecessary expectations |
09:25:15 | FromDiscord | <haxscramper> so you can just copy everything you need directly (I'm pretty sure you don't use every single part of the library) |
09:26:43 | FromDiscord | <Bung> yeah, I think so , I may use my fork version , I only use small part of your libraries |
09:39:18 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:15:37 | * | jmdaemon quit (Ping timeout: 256 seconds) |
10:40:57 | NimEventer | New thread by Mardiyah: To prompt one character input only, see https://forum.nim-lang.org/t/8961 |
11:22:20 | * | ltriant joined #nim |
11:27:50 | * | ltriant quit (Ping timeout: 272 seconds) |
11:29:32 | FromDiscord | <ShalokShalom> In reply to @⎝⪩﹏⪨⎠ "C++: too complex for": Oh yeah 🙄 |
11:30:58 | FromDiscord | <ShalokShalom> I have never seen a software project with such comprehensive, but still useless documentation. No offense, it just seems the docs got largely generated by a computer, and somebody thinks this is all that is useful. Particular to newbies, I consider the docs virtually not in existence. Sadly. |
11:33:35 | FromDiscord | <Rika> In reply to @ShalokShalom "I have never seen": Lua? |
12:05:26 | * | shalokshalom joined #nim |
12:05:37 | FromDiscord | <ShalokShalom> No, Nim |
12:05:53 | FromDiscord | <abdu> Try to get one character input... just like in Bash read -n1 ? |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:12 | FromDiscord | <abdu> (edit) "read -n1" => "`read -n1`" |
12:06:27 | FromDiscord | <ShalokShalom> idk about Lua. But it seems so simply, I could live with less documentation there. |
12:06:32 | * | supakeen joined #nim |
12:06:36 | FromDiscord | <ShalokShalom> (edit) "simply," => "simple," |
12:07:00 | FromDiscord | <Rika> The docs to me have been largely helpful but I don’t know I’m a strange fellow I imagine |
12:08:07 | FromDiscord | <haxscramper> "nim doc has received many improvements over the years" |
12:13:29 | FromDiscord | <ShalokShalom> Yeah, I dont think they are bad for experienced users. |
12:15:39 | FromDiscord | <enthus1ast> i also like the nim docs, not so bad as its reputation imho |
12:16:33 | FromDiscord | <ShalokShalom> How many people do you have, who are new to programming? |
12:16:54 | FromDiscord | <ShalokShalom> The language is simpler than Python, and has an equivalent lower amount of newbies. |
12:17:05 | FromDiscord | <ShalokShalom> I think thats a clear language towards its documentation. |
12:17:08 | FromDiscord | <enthus1ast> what could be nice, is some "php style" documentation, so auto create pages for every func proc etc, then allow users to add examples "wiki style" |
12:19:45 | FromDiscord | <exelotl> This is like the 1 thing that PHP does well xD |
12:27:30 | FromDiscord | <exelotl> I generally dislike Nim docs, whenever they're helpful it's usually in spite of their structure (e.g. when someone puts a little table at the top linking to the most commonly used functions) - they really need the ability to group related symbols under custom headings |
12:31:43 | FromDiscord | <planetis> something like the index? |
12:34:41 | FromDiscord | <enthus1ast> documentation generation |
12:36:49 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/447 |
12:37:00 | FromDiscord | <haxscramper> there is an RFC |
12:38:47 | FromDiscord | <enthus1ast> ok so it's not THAT easy currently |
12:39:15 | FromDiscord | <haxscramper> docgen is easy if you come to it with the right approach |
12:40:11 | FromDiscord | <haxscramper> at least my experience in writing and then re-writing analyser part clearly shown it can be greatly simplified if you thing the design from start to end instead of piling up global mutable state with weird hacks for a decade |
12:40:31 | FromDiscord | <enthus1ast> yes i see your effort in nimskull |
12:42:24 | FromDiscord | <haxscramper> This is a proof-of-concept implementation right now |
12:42:57 | FromDiscord | <haxscramper> and I actually would prefer docgen to be a tool that uses compiler API |
12:43:02 | FromDiscord | <haxscramper> instead of a built-in compiler feature |
12:43:30 | FromDiscord | <enthus1ast> yes it would be much more approachable for non compiler devs |
12:43:36 | FromDiscord | <enthus1ast> (like me) |
12:44:42 | FromDiscord | <haxscramper> speaking of, since this is a POC I should probably use your templating engine to generate everything |
12:46:17 | FromDiscord | <haxscramper> or at least that's how the whole design should be structured - `docgen -> intermediate.sqlite -> website` |
12:46:31 | FromDiscord | <enthus1ast> yes |
12:47:01 | FromDiscord | <enthus1ast> maybe not even sqlite, its quite an heavy dependency |
12:47:06 | FromDiscord | <haxscramper> and people who know how to actually make decent-looking html/websites don't have to be burdened with learning whole compiler internals |
12:47:24 | FromDiscord | <haxscramper> it is very convenient for the data model I came up with |
12:48:01 | FromDiscord | <haxscramper> and since it is shipped in the stdlib by default I think it is quite reasonable "weight"-wise |
12:54:09 | FromDiscord | <enthus1ast> yes if its a robust choice then why not |
13:22:36 | FromDiscord | <enthus1ast> can i test in a template, if the sourrounding block is an iterator or a normal proc (that has result) |
13:23:12 | FromDiscord | <enthus1ast> my template should yield if the surrounding is an iterator, but result.add when the sourrounding is a proc |
13:34:03 | FromDiscord | <enthus1ast> ok this seems to work\:↵↵when compiles(result.add body) |
13:34:37 | FromDiscord | <enthus1ast> and in the else block, i just yield |
13:35:06 | FromDiscord | <enthus1ast> its not the best but works, any better ideas are welcome \:) |
13:41:25 | FromDiscord | <ShalokShalom> In reply to @enthus1ast "what could be nice,": I would think more about a tutorial, that explains step by step "how-to-program" simply programs, like an editor, command-line program and so on... |
13:42:14 | * | slowButPresent joined #nim |
13:47:11 | FromDiscord | <auxym> Nim in Action sort of does that, starts with a chat app using async and http, etc |
13:49:07 | perro | very practical |
13:49:47 | perro | dom did a good job with that |
13:52:00 | FromDiscord | <enthus1ast> also this\: https://ssalewski.de/nimprogramming.html |
13:56:45 | FromDiscord | <haxscramper> https://nim-lang.org/documentation.html |
13:56:45 | FromDiscord | <haxscramper> https://xmonader.github.io/nimdays/book_intro.html↵(@ShalokShalom) |
14:11:50 | FromDiscord | <ShalokShalom> thanks a lot |
14:12:06 | FromDiscord | <ShalokShalom> In reply to @auxym "Nim in Action sort": isnt that already pretty outdated? |
14:17:31 | Amun-Ra | I have a template problem, what am I doing wrong here? https://play.nim-lang.org/#ix=3QUG |
14:19:21 | NimEventer | New question by itil memek cantik: Nim must be able to get one character input just like in Bash, see https://stackoverflow.com/questions/71285476/nim-must-be-able-to-get-one-character-input-just-like-in-bash |
14:24:24 | * | pro joined #nim |
14:27:51 | * | arkurious joined #nim |
14:46:38 | * | ltriant joined #nim |
14:51:46 | * | ltriant quit (Ping timeout: 272 seconds) |
14:54:40 | * | rockcavera joined #nim |
15:30:44 | * | Gustavo6046 joined #nim |
15:37:51 | * | neurocyte0917090 joined #nim |
15:48:00 | * | evilkhaoskat joined #nim |
15:52:51 | * | evilkhaoskat quit (Client Quit) |
15:57:22 | FromDiscord | <auxym> In reply to @ShalokShalom "isnt that already pretty": So parts, most of it I think not. Araq has committed to not breaking anything in the book in nim v1.x |
16:02:56 | shalokshalom | hnn |
16:17:16 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/WohlSoft/SDL-Mixer-X↵Is there a Nim module for that please? |
16:36:07 | FromDiscord | <auxym> you could write a wrapper for it. Or base yourself on https://github.com/nim-lang/sdl2 |
16:37:23 | * | pro quit (Quit: pro) |
16:40:43 | * | jjido joined #nim |
16:46:32 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright, thanks |
17:27:25 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:53:44 | FromDiscord | <dom96> In reply to @perro "dom did a ": Thanks 🙂 |
18:34:23 | NimEventer | New thread by Haoliang: Cstring has different behavior in different MM mode, see https://forum.nim-lang.org/t/8962 |
18:39:42 | * | jjido joined #nim |
18:48:13 | * | ltriant joined #nim |
18:52:48 | FromDiscord | <chancy> sent a code paste, see https://play.nim-lang.org/#ix=3QW7 |
18:53:42 | * | ltriant quit (Ping timeout: 272 seconds) |
19:00:19 | FromDiscord | <haxscramper> https://ssalewski.de/nimprogramming.html is on the HN front page |
19:08:39 | * | rockcavera quit (Remote host closed the connection) |
19:13:27 | FromDiscord | <Phil> Question |
19:13:41 | FromDiscord | <Phil> I don't understand why anyone stores json in databases |
19:13:55 | FromDiscord | <Phil> (edit) "databases" => "databases. So why?" |
19:15:21 | FromDiscord | <Phil> (edit) "I don't understand why anyone stores json in ... databases." added "relational" |
19:16:17 | FromDiscord | <ynfle> In reply to @Isofruit "I don't understand why": Why not? |
19:19:31 | FromDiscord | <Phil> In reply to @ynfle "Why not?": I means a lot more hassle. ↵To directly interact with it via SQL it needs special new functionality and it makes parsing more complicated than having a traditional table setup. But yet, e.g. the Sqlite authors took it upon themselves to implement new functions in sqlite that allow you to interact and manipulate that json. So there has to be some usecase/benefit to it, I just don't get what that's supposed t |
19:25:51 | FromDiscord | <chancy> In reply to @Isofruit "I means a lot": I'd say "laziness", in the programming sense, would be one case. If you may not know or care about the entire schema from some other source and you need to shove the data somewhere temporarily without having an entirely orthogonal storage system. |
19:26:01 | * | Jjp137 quit (Quit: Leaving) |
19:26:49 | FromDiscord | <ajusa> it can be more performant for certain access patterns to dump a json string into a field than to do the whole sql table + join |
19:30:17 | FromDiscord | <chancy> In reply to @chancy "What's the appropriate way": using a regular `object` instead of `ref object` seems to work for me here. |
19:43:41 | * | mahlon quit (Ping timeout: 256 seconds) |
20:22:41 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QWv |
20:24:22 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QWy |
20:35:50 | FromDiscord | <demotomohiro> If your procedure returns modifable `object` type, return type need to be `var PrefsNode`. |
20:36:29 | * | mahlon joined #nim |
20:39:02 | FromDiscord | <TryAngle> Hello, I'm back with an odd question 😅↵I would like to replace colors in an image. May you guys give me a direction of how to do this in Nim? |
20:41:08 | FromDiscord | <TryAngle> I have a template image with a set of colors and I basically want to create variances of that image with different color sets.↵In Java I have Buffered Image I could use for this. What would be the nim equivalent? |
20:43:49 | FromDiscord | <demotomohiro> https://github.com/xflywind/awesome-nim#image |
20:48:23 | FromDiscord | <TryAngle> Omg been so long I forgot about this page. Thank you |
20:56:56 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:04:07 | FromDiscord | <Waldecir Santos> I'm playing with list comprehensions bit I'm getting this error `Error: expression '"first_name"' is of type 'string' and has to be used (or discarded)` code: https://play.nim-lang.org/#ix=3QWQ |
21:06:34 | FromDiscord | <Elegantbeef> I think the issue is that fieldpairs is an unrolled for loop, and as such doesnt yield like collect expects |
21:06:48 | FromDiscord | <TryAngle> You are returning something in your for loop |
21:07:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QWS |
21:07:14 | FromDiscord | <Elegantbeef> That's how collect is used tryangle 😛 |
21:07:56 | FromDiscord | <Waldecir Santos> ohh so `fieldPairs` is a macro, is that what you mean ? |
21:08:05 | FromDiscord | <Elegantbeef> Well it's magic |
21:08:19 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3QWT |
21:08:20 | FromDiscord | <Elegantbeef> Works fine |
21:08:55 | FromDiscord | <Waldecir Santos> Sure I can do that, but that is not "List Comprehensions" right ? |
21:09:01 | FromDiscord | <Waldecir Santos> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#list-comprehensions |
21:09:13 | FromDiscord | <Waldecir Santos> I was trying to replicate this ☝️ |
21:09:14 | FromDiscord | <Elegantbeef> I mean who cares what it's called |
21:09:18 | FromDiscord | <Elegantbeef> It solves your problem |
21:09:44 | FromDiscord | <Waldecir Santos> Right ? I agree but the error message dosen't help much lol |
21:10:08 | FromDiscord | <Waldecir Santos> At least not for me as new to nim run..... |
21:10:17 | FromDiscord | <Elegantbeef> Well it's a macro, so it's expanded, kinda hard to get a good error message there in that case |
21:10:26 | FromDiscord | <Waldecir Santos> True |
21:10:50 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3QWU |
21:10:53 | FromDiscord | <Elegantbeef> Here is the collect way then |
21:11:20 | FromDiscord | <Waldecir Santos> https://tenor.com/view/perfection-perfect-flawless-ultimate-spotless-gif-13993155 |
21:11:38 | FromDiscord | <Waldecir Santos> Thank you Elegantbeef ! |
21:14:57 | FromDiscord | <Elegantbeef> `fieldpairs` and `fields` rely on loop unrolling to function due to what they do |
21:15:24 | FromDiscord | <Elegantbeef> They can yield heterogeneous types so magic is involved |
21:15:37 | FromDiscord | <Elegantbeef> Dont know if there are any more |
21:30:46 | * | neurocyte0917090 quit (Read error: Connection reset by peer) |
21:32:13 | * | neurocyte0917090 joined #nim |
21:34:24 | FromDiscord | <Patitotective> In reply to @demotomohiro "If your procedure returns": 🤯 |
21:34:28 | FromDiscord | <Patitotective> thanks ❤️ |
21:34:31 | FromDiscord | <Patitotective> 🙃 |
21:41:32 | * | ltriant joined #nim |
21:53:33 | * | jjido joined #nim |
21:56:16 | FromDiscord | <Waldecir Santos> So if I need a "dict/map" of string/[any type] is that possible with Nim? |
21:59:34 | FromDiscord | <Waldecir Santos> Maybe with typeinfo `var beatles = initTable[string, Any]()`? |
21:59:59 | * | shalokshalom quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:00:58 | FromDiscord | <Waldecir Santos> I remember this one too https://github.com/nim-appkit/values but seems "staled" |
22:04:45 | FromDiscord | <Elegantbeef> Nim doesnt have dynamic typing so you'd need to make an object variant something like the `JsonNode` |
22:05:15 | FromDiscord | <demotomohiro> Why do you need such a type? |
22:06:11 | FromDiscord | <Waldecir Santos> I'm playing with the idea of making a "django like" ORM and I need this for storing the filters/where clause. |
22:07:54 | FromDiscord | <Elegantbeef> Then you could have a `Table[string, RootObj]` or `RootRef` |
22:07:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QX7 |
22:09:39 | FromDiscord | <Waldecir Santos> Got it, yeah I think norm does something similar to this. |
22:10:51 | FromDiscord | <Waldecir Santos> They encapsulate `DbValue` |
22:43:26 | FromDiscord | <ynfle> Beef, out of curiousity, shouldn't this work https://play.nim-lang.org/#ix=3QXe? |
22:43:28 | FromDiscord | <ynfle> (edit) "https://play.nim-lang.org/#ix=3QXe?" => "https://play.nim-lang.org/#ix=3QXe ?" |
22:47:02 | nrds | <Prestige99> Anyone know why c bindings to a typedef struct would cause an Illegal storage access error on the first component, as a float? |
22:48:16 | FromDiscord | <ynfle> In reply to @nrds "<Prestige> Anyone know why": Are you accessing it in nim? |
22:48:33 | nrds | <Prestige99> Yeah |
22:49:21 | nrds | <Prestige99> There's a wrapper for the sdl_gpu library, and if I try accessing the x component of the Camera type, there's an illegal storage access error. But I can access variables delcared later in the type |
22:49:46 | nrds | <Prestige99> https://i.imgur.com/4n89HbW.png |
22:51:42 | nrds | <Prestige99> Hm it's actually specifically the y component, the x does not crash it |
22:54:42 | nrds | <Prestige99> It seems like zoomX and zoomX actually move the camera like x and y should. y, z, and angle, all crash the program if you try changing their values |
22:59:06 | FromDiscord | <ynfle> How is it initialized? |
22:59:09 | FromDiscord | <ynfle> In the nim code? |
22:59:10 | nrds | <Prestige99> aha I found the problem finally |
22:59:22 | FromDiscord | <ynfle> Nice |
22:59:24 | FromDiscord | <ynfle> What is it? |
22:59:27 | nrds | <Prestige99> Bindings were missing a property in the struct that owned the camera |
22:59:34 | nrds | <Prestige99> so everything was off ab it |
22:59:36 | nrds | <Prestige99> a bit* |
23:06:03 | FromDiscord | <ynfle> Ah |
23:12:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:39:25 | FromDiscord | <sOkam!> When you create a binding to from some C code to Nim with futhark/c2nim/etc:↵- What happens to static functions that are not declared in any header file,↵... but are used by other functions that are declared? 🤔 |
23:46:45 | FromDiscord | <Elegantbeef> @ynfle\: https://play.nim-lang.org/#ix=3QXg |