<< 27-02-2022 >>

00:00:38FromDiscord<Elegantbeef> make a second span that takes no arguments
00:00:55FromDiscord<Elegantbeef> or do `default(array[0, (string, string)]`
00:01:37FromDiscord<ajusa> thanks, default is what I was missing!
00:01:55FromDiscord<Elegantbeef> You can also do `array[0, (string, string)([])`
00:02:06FromDiscord<Elegantbeef> Or any other form fof that
00:02:15FromDiscord<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:23FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3QRI
00:02:33FromDiscord<Elegantbeef> Yep nice and clean now
00:02:49FromDiscord<b4mbus> thanks a lot
00:03:02FromDiscord<b4mbus> now lets figure out how to use threads in this language :p
00:04:23FromDiscord<Elegantbeef> There are a bunch of different ways to do it 😀
00:04:44FromDiscord<b4mbus> probably, how would you do it?
00:04:52FromDiscord<Elegantbeef> No clue what you're writing
00:06:16FromDiscord<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:44FromDiscord<Elegantbeef> You have the standard lib's channels and basic threads, Weave, taskpools, and more 😀
00:06:50FromDiscord<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:21FromDiscord<Elegantbeef> So this is just for testing logger?
00:07:33FromDiscord<b4mbus> not sure wym by `testing logger`
00:07:42FromDiscord<Elegantbeef> Well why do you need threads
00:07:54FromDiscord<b4mbus> it's public only for testing purposes, but Itll be private finally
00:08:03FromDiscord<b4mbus> In reply to @Elegantbeef "Well why do you": not for the logger, for the whole app
00:08:11FromDiscord<Elegantbeef> And what's the app?
00:09:32FromDiscord<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:47FromDiscord<b4mbus> the discord part uses threads itself for shards
00:09:48FromDiscord<Elegantbeef> Ok so then the basic Nim threads will probably be fine for you
00:10:30FromDiscord<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:43FromDiscord<b4mbus> I was just testing a bit I havent gotten to the implementation phase where I actually use threads
00:10:56FromDiscord<Elegantbeef> `--threads:on`
00:11:19FromDiscord<b4mbus> .. yeah I actually did forgot to include that in my config file
00:11:23FromDiscord<Elegantbeef> Nim has threads disabled by default, which will change with 2.0
00:11:54FromDiscord<b4mbus> it doesnt follow ZOA?
00:11:56FromDiscord<Elegantbeef> The reason you dont import it is cause it's imported with that flag
00:12:00FromDiscord<b4mbus> (edit) "ZOA?" => "ZCA?"
00:12:04FromDiscord<Elegantbeef> ZOA?
00:12:27FromDiscord<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:37FromDiscord<Elegantbeef> TLS
00:12:42FromDiscord<b4mbus> (edit) "be paying" => "pay"
00:12:44FromDiscord<b4mbus> TLS?
00:13:13FromDiscord<b4mbus> like the protocol?
00:13:31FromDiscord<Elegantbeef> thread local storage emulation has performance cost presently afaik, but Nim 2.0 will have threads enabled by default
00:14:14FromDiscord<b4mbus> I see
00:14:21FromDiscord<b4mbus> makes sense then
00:16:42FromDiscord<ShalokShalom> I did a little program, that simply executes three command line binaries
00:17:00FromDiscord<ShalokShalom> when I compile it, it says: Error: expression expected, but found '[EOF]'
00:17:26FromDiscord<Elegantbeef> You have a procedure or statement that expects something
00:17:27FromDiscord<Elegantbeef> Show code
00:19:43FromDiscord<ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QRS
00:20:17FromDiscord<Elegantbeef> No quotes
00:20:28FromDiscord<ShalokShalom> around?
00:20:40FromDiscord<Elegantbeef> the right hand of `exec`
00:21:06FromDiscord<Elegantbeef> What `exec` are you even using?
00:21:41FromDiscord<tracy> sent a code paste, see https://play.nim-lang.org/#ix=3QRT
00:22:02FromDiscord<ShalokShalom> thanks
00:22:12FromDiscord<tracy> np
00:25:44FromDiscord<Elegantbeef> forgot to mention `import os` 🙂
00:28:30*Gustavo6046 quit (Ping timeout: 268 seconds)
00:37:19FromDiscord<$ tracy> discord keep locking my accs bro
00:38:03nrds<Prestige99> For phone numbers?
00:39:29FromDiscord<$ tracy> yh
00:41:04FromDiscord<Elegantbeef> Time to use something aside from discord 😛
00:42:52FromDiscord<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:34FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3QS2
00:44:15FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/PkQ
00:45:08FromDiscord<Elegantbeef> The issue here is the `openArray` you need your own
00:45:50FromDiscord<ajusa> what's wrong with the openarray? do I need a more concrete type?
00:46:09FromDiscord<Elegantbeef> Openarray is a runtime type that requires conversion so `untyped` is more exact
00:47:20FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/CHe
00:48:34FromDiscord<ajusa> that's some wizardry right there. are there are options without concepts (just curious)
00:49:07FromDiscord<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:08FromDiscord<Rika> spooky concepts
00:56:12FromDiscord<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:55FromDiscord<Patitotective> how can i know if a variable is var, let or const?
01:13:00FromDiscord<Rika> from a macro?
01:13:06FromDiscord<Patitotective> nvm
01:13:07FromDiscord<Patitotective> hehe
01:13:15FromDiscord<Elegantbeef> It's a simple macro
01:13:20FromDiscord<Patitotective> how to modify a nested value from a table?
01:13:32FromDiscord<Patitotective> like, it was working when it wasn't nested 🤷‍♂️
01:13:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QS5
01:13:52FromDiscord<Elegantbeef> Jeez i messd that up
01:13:57FromDiscord<Rika> wasnt working as in how?
01:14:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QS6
01:14:33FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QS7
01:15:14FromDiscord<Patitotective> an i guess it's because it's not `var`
01:15:17FromDiscord<Rika> no?
01:15:36FromDiscord<Rika> whats the error
01:16:46FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QS9
01:17:13FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3QS9" => "https://paste.rs/MZY"
01:17:25FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3QSb" => "https://paste.rs/alf"
01:18:38FromDiscord<Rika> is the `prefs` variable a var
01:18:44FromDiscord<Rika> it might be a var thing now yes
01:18:51FromDiscord<Patitotective> yep `var prefs = initPrefs(defaultPrefs, "settings.niprefs")`
01:19:16FromDiscord<Rika> what are the procs you have for `[]` for the prefsnode type
01:20:11FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QSd
01:20:12FromDiscord<Elegantbeef> `(prefs.table["scheme"]["font"]["size"]) = 20.toPrefs`?
01:20:58FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QSe
01:21:03FromDiscord<Rika> In reply to @Elegantbeef "`(prefs.table["scheme"]["font"]["size"]) = 20.toPre": requires a `[]` that returns a var T
01:21:14FromDiscord<Rika> same with the first error
01:21:16FromDiscord<Elegantbeef> return var
01:22:29FromDiscord<Patitotective> In reply to @Elegantbeef "return var": do you mean that i should make the `[]` procedures return a var?
01:22:33FromDiscord<Patitotective> (edit) "var?" => "var type?"
01:23:36FromDiscord<Rika> yes
01:23:52FromDiscord<Rika> if one of the types are also var, that is
01:23:56FromDiscord<Elegantbeef> well i mean make them return var if the node is var
01:24:08FromDiscord<Rika> example here https://nim-lang.org/docs/tables.html#%5B%5D%2COrderedTable%5BA%2CB%5D%2CA_2
01:24:12FromDiscord<Patitotective> In reply to @Elegantbeef "well i mean make": oh, that makes sense
01:24:44FromDiscord<Elegantbeef> Yea you dont have a var accessor
01:24:44FromDiscord<Elegantbeef> you need two `[]` procs one for var and one for non varf
01:24:56FromDiscord<Elegantbeef> It's semi-annoying but it's what's required for mutable/immutable types
01:25:28FromDiscord<Patitotective> thank you guys ❤️ i ll try it tomorrow :D
01:57:09nrds<Prestige99> Hm yeah I think something is up with these bindings @ElegantBeef - scratching my head still
01:58:42FromDiscord<Elegantbeef> Yea i didnt see an issue there, so do not know
03:09:38*Lord_Nightmare joined #nim
03:16:25FromDiscord<ajusa> is there an easy way to print out the nim code after templates have expanded?
03:17:06FromDiscord<Elegantbeef> `--expandMacro: name` or `macros.expandmacros`
03:20:19FromDiscord<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:42FromDiscord<Elegantbeef> what about `--expandMacro`?
03:24:36FromDiscord<ajusa> that works, thanks!
03:26:14*arkurious quit (Quit: Leaving)
03:26:41*Gustavo6046 joined #nim
03:26:48FromDiscord<Pandasdontfly> would anybody reccomend the nim in action book
03:28:05FromDiscord<Elegantbeef> A fair bit of people read it and like it, I've never read it
03:30:16*ltriant joined #nim
03:31:50FromDiscord<Rika> I bought it but I never read it in depth but I still think it’s a good resource
03:33:04FromDiscord<Elegantbeef> I'm too dumb to read so i've never got it
03:34:00FromDiscord<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:16FromDiscord<abdu> sent a long message, see http://ix.io/3QSH
03:51:41FromDiscord<abdu> (edit) "http://ix.io/3QSH" => "http://ix.io/3QSI"
03:53:09FromDiscord<huantian> You can’t hold on to an openArray like that iirc
03:53:28FromDiscord<Elegantbeef> Openarray is only for parameters presently
03:53:55FromDiscord<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:13FromDiscord<abdu> Ok
04:06:01*supakeen quit (Quit: WeeChat 3.4)
04:06:31*supakeen joined #nim
04:08:05FromDiscord<sheldon> How to clean nimble test cached files?
04:08:39FromDiscord<sheldon> or is it the same to forceBuild when nimble test
04:10:26FromDiscord<Elegantbeef> Nimble doesnt handle the cache of the files so a force build will work
04:11:30FromDiscord<demotomohiro> @abdu https://nim-lang.org/docs/system.html#toOpenArray%2Ccstring%2Cint%2Cint
04:12:28FromDiscord<sheldon> How to make nimble test force build 😅
04:12:51FromDiscord<Elegantbeef> does `nimble test -f` work?
04:24:01FromDiscord<sheldon> I think it should work
04:24:43FromDiscord<sheldon> I'm trying with https://github.com/marcomq/nimview
04:34:16*ltriant quit (Ping timeout: 272 seconds)
04:51:02FromDiscord<sheldon> Playing with Flutter recently, seems nimview targets the same goal.
05:14:57*slowButPresent quit (Quit: leaving)
05:28:45FromDiscord<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:18FromDiscord<Elegantbeef> Wasnt it added in 1.6 ?
05:29:57FromDiscord<Rika> Experiments aren’t back ported no?
05:30:05FromDiscord<Elegantbeef> They are not
05:32:10FromDiscord<Bung> oh, thanks ! I think I create a issue to @haxscramper
05:32:53FromDiscord<haxscramper> What experimental feature is this
05:33:54FromDiscord<Bung> strictEffects
05:34:50FromDiscord<haxscramper> Nim 1.4.8 is not supported
05:34:56FromDiscord<Bung> https://github.com/haxscramper/hmisc/issues/10 I create one
05:35:13FromDiscord<haxscramper> Hmisc only supports latest nim
05:35:49FromDiscord<Bung> requires "nim >= 1.4.8" should change
05:35:52FromDiscord<Rika> In reply to @haxscramper "Nim 1.4.8 is not": The nimble dependency file says otherwise i think
05:36:39FromDiscord<haxscramper> Ok, I will update that
05:40:42FromDiscord<Bung> please also update version
05:56:46*rockcavera quit (Remote host closed the connection)
06:55:11FromDiscord<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:33FromDiscord<haxscramper> it seems like someone actually uses my failed message suggestion generator
07:33:37FromDiscord<haxscramper> I'm surprised
07:35:00FromDiscord<haxscramper> In reply to @Bung "please also update version": done
08:00:42FromDiscord<Bung> In reply to @haxscramper "I'm surprised": hmm, I searched hmisc source maybe it wrongly parse nimble arguments
08:01:22FromDiscord<haxscramper> I parse nimble arguments somewhere?
08:02:59FromDiscord<Bung> stringMismatchMessage(/algo/clformat.nim) -> other/hargparse.nim or other/cliparse.nim
08:05:45FromDiscord<haxscramper> this is a general CLI parser
08:27:48FromDiscord<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:06FromDiscord<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:41FromDiscord<⎝⪩﹏⪨⎠> Yay, the parser is able to at least sum two numbers :) https://media.discordapp.net/attachments/371759389889003532/947419203315589150/unknown.png
09:07:36FromDiscord<Rika> In reply to @⎝⪩﹏⪨⎠ "Yay, the parser is": “Nim?”
09:08:08FromDiscord<⎝⪩﹏⪨⎠> In reply to @Rika "“Nim?”": Because I wasn't sure if I wanted to learn Nim in that time.
09:08:19FromDiscord<Rika> No it’s funny lmao
09:08:34FromDiscord<Rika> It kinda reads like you don’t know if the code is Nim or not lol
09:08:39FromDiscord<Bung> https://github.com/haxscramper/hnimast/blob/e62725ae033d4c832f0e2106c634c87a4351b259/src/hnimast/hast_common.nim#L859 @haxscramper where is noneOfIt importing from ?
09:09:02FromDiscord<⎝⪩﹏⪨⎠> 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:41FromDiscord<Rika> Your choice, dunno what’s keeping you from choosing
09:10:58FromDiscord<⎝⪩﹏⪨⎠> 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:36FromDiscord<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:37FromDiscord<haxscramper> you can use it
09:14:36FromDiscord<haxscramper> what exactly do you use hmisc for?
09:17:02FromDiscord<haxscramper> and I will be moving to nimskull in the future anyway, so you might want to consider looking for the alternatives
09:17:56FromDiscord<Bung> https://github.com/bung87/slim I try to update
09:18:56FromDiscord<Bung> but seems hnimast and hmisc breaking
09:19:32FromDiscord<haxscramper> hnimast already uses nimskull
09:19:55FromDiscord<haxscramper> I think I should just take all my repos from nimble
09:20:21FromDiscord<haxscramper> because I don't think I'm really fit for supporting the libraries myself, so
09:20:34FromDiscord<haxscramper> to not give people unnecessary expectations
09:25:15FromDiscord<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:43FromDiscord<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:57NimEventerNew 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:32FromDiscord<ShalokShalom> In reply to @⎝⪩﹏⪨⎠ "C++: too complex for": Oh yeah 🙄
11:30:58FromDiscord<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:35FromDiscord<Rika> In reply to @ShalokShalom "I have never seen": Lua?
12:05:26*shalokshalom joined #nim
12:05:37FromDiscord<ShalokShalom> No, Nim
12:05:53FromDiscord<abdu> Try to get one character input... just like in Bash read -n1 ?
12:06:02*supakeen quit (Quit: WeeChat 3.4)
12:06:12FromDiscord<abdu> (edit) "read -n1" => "`read -n1`"
12:06:27FromDiscord<ShalokShalom> idk about Lua. But it seems so simply, I could live with less documentation there.
12:06:32*supakeen joined #nim
12:06:36FromDiscord<ShalokShalom> (edit) "simply," => "simple,"
12:07:00FromDiscord<Rika> The docs to me have been largely helpful but I don’t know I’m a strange fellow I imagine
12:08:07FromDiscord<haxscramper> "nim doc has received many improvements over the years"
12:13:29FromDiscord<ShalokShalom> Yeah, I dont think they are bad for experienced users.
12:15:39FromDiscord<enthus1ast> i also like the nim docs, not so bad as its reputation imho
12:16:33FromDiscord<ShalokShalom> How many people do you have, who are new to programming?
12:16:54FromDiscord<ShalokShalom> The language is simpler than Python, and has an equivalent lower amount of newbies.
12:17:05FromDiscord<ShalokShalom> I think thats a clear language towards its documentation.
12:17:08FromDiscord<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:45FromDiscord<exelotl> This is like the 1 thing that PHP does well xD
12:27:30FromDiscord<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:43FromDiscord<planetis> something like the index?
12:34:41FromDiscord<enthus1ast> documentation generation
12:36:49FromDiscord<haxscramper> https://github.com/nim-lang/RFCs/issues/447
12:37:00FromDiscord<haxscramper> there is an RFC
12:38:47FromDiscord<enthus1ast> ok so it's not THAT easy currently
12:39:15FromDiscord<haxscramper> docgen is easy if you come to it with the right approach
12:40:11FromDiscord<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:31FromDiscord<enthus1ast> yes i see your effort in nimskull
12:42:24FromDiscord<haxscramper> This is a proof-of-concept implementation right now
12:42:57FromDiscord<haxscramper> and I actually would prefer docgen to be a tool that uses compiler API
12:43:02FromDiscord<haxscramper> instead of a built-in compiler feature
12:43:30FromDiscord<enthus1ast> yes it would be much more approachable for non compiler devs
12:43:36FromDiscord<enthus1ast> (like me)
12:44:42FromDiscord<haxscramper> speaking of, since this is a POC I should probably use your templating engine to generate everything
12:46:17FromDiscord<haxscramper> or at least that's how the whole design should be structured - `docgen -> intermediate.sqlite -> website`
12:46:31FromDiscord<enthus1ast> yes
12:47:01FromDiscord<enthus1ast> maybe not even sqlite, its quite an heavy dependency
12:47:06FromDiscord<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:24FromDiscord<haxscramper> it is very convenient for the data model I came up with
12:48:01FromDiscord<haxscramper> and since it is shipped in the stdlib by default I think it is quite reasonable "weight"-wise
12:54:09FromDiscord<enthus1ast> yes if its a robust choice then why not
13:22:36FromDiscord<enthus1ast> can i test in a template, if the sourrounding block is an iterator or a normal proc (that has result)
13:23:12FromDiscord<enthus1ast> my template should yield if the surrounding is an iterator, but result.add when the sourrounding is a proc
13:34:03FromDiscord<enthus1ast> ok this seems to work\:↵↵when compiles(result.add body)
13:34:37FromDiscord<enthus1ast> and in the else block, i just yield
13:35:06FromDiscord<enthus1ast> its not the best but works, any better ideas are welcome \:)
13:41:25FromDiscord<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:11FromDiscord<auxym> Nim in Action sort of does that, starts with a chat app using async and http, etc
13:49:07perrovery practical
13:49:47perrodom did a good job with that
13:52:00FromDiscord<enthus1ast> also this\: https://ssalewski.de/nimprogramming.html
13:56:45FromDiscord<haxscramper> https://nim-lang.org/documentation.html
13:56:45FromDiscord<haxscramper> https://xmonader.github.io/nimdays/book_intro.html↵(@ShalokShalom)
14:11:50FromDiscord<ShalokShalom> thanks a lot
14:12:06FromDiscord<ShalokShalom> In reply to @auxym "Nim in Action sort": isnt that already pretty outdated?
14:17:31Amun-RaI have a template problem, what am I doing wrong here? https://play.nim-lang.org/#ix=3QUG
14:19:21NimEventerNew 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:22FromDiscord<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:56shalokshalomhnn
16:17:16FromDiscord<System64 ~ Flandre Scarlet> https://github.com/WohlSoft/SDL-Mixer-X↵Is there a Nim module for that please?
16:36:07FromDiscord<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:32FromDiscord<System64 ~ Flandre Scarlet> ah alright, thanks
17:27:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:53:44FromDiscord<dom96> In reply to @perro "dom did a ": Thanks 🙂
18:34:23NimEventerNew 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:48FromDiscord<chancy> sent a code paste, see https://play.nim-lang.org/#ix=3QW7
18:53:42*ltriant quit (Ping timeout: 272 seconds)
19:00:19FromDiscord<haxscramper> https://ssalewski.de/nimprogramming.html is on the HN front page
19:08:39*rockcavera quit (Remote host closed the connection)
19:13:27FromDiscord<Phil> Question
19:13:41FromDiscord<Phil> I don't understand why anyone stores json in databases
19:13:55FromDiscord<Phil> (edit) "databases" => "databases. So why?"
19:15:21FromDiscord<Phil> (edit) "I don't understand why anyone stores json in ... databases." added "relational"
19:16:17FromDiscord<ynfle> In reply to @Isofruit "I don't understand why": Why not?
19:19:31FromDiscord<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:51FromDiscord<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:49FromDiscord<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:17FromDiscord<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:41FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QWv
20:24:22FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3QWy
20:35:50FromDiscord<demotomohiro> If your procedure returns modifable `object` type, return type need to be `var PrefsNode`.
20:36:29*mahlon joined #nim
20:39:02FromDiscord<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:08FromDiscord<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:49FromDiscord<demotomohiro> https://github.com/xflywind/awesome-nim#image
20:48:23FromDiscord<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:07FromDiscord<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:34FromDiscord<Elegantbeef> I think the issue is that fieldpairs is an unrolled for loop, and as such doesnt yield like collect expects
21:06:48FromDiscord<TryAngle> You are returning something in your for loop
21:07:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QWS
21:07:14FromDiscord<Elegantbeef> That's how collect is used tryangle 😛
21:07:56FromDiscord<Waldecir Santos> ohh so `fieldPairs` is a macro, is that what you mean ?
21:08:05FromDiscord<Elegantbeef> Well it's magic
21:08:19FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3QWT
21:08:20FromDiscord<Elegantbeef> Works fine
21:08:55FromDiscord<Waldecir Santos> Sure I can do that, but that is not "List Comprehensions" right ?
21:09:01FromDiscord<Waldecir Santos> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#list-comprehensions
21:09:13FromDiscord<Waldecir Santos> I was trying to replicate this ☝️
21:09:14FromDiscord<Elegantbeef> I mean who cares what it's called
21:09:18FromDiscord<Elegantbeef> It solves your problem
21:09:44FromDiscord<Waldecir Santos> Right ? I agree but the error message dosen't help much lol
21:10:08FromDiscord<Waldecir Santos> At least not for me as new to nim run.....
21:10:17FromDiscord<Elegantbeef> Well it's a macro, so it's expanded, kinda hard to get a good error message there in that case
21:10:26FromDiscord<Waldecir Santos> True
21:10:50FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3QWU
21:10:53FromDiscord<Elegantbeef> Here is the collect way then
21:11:20FromDiscord<Waldecir Santos> https://tenor.com/view/perfection-perfect-flawless-ultimate-spotless-gif-13993155
21:11:38FromDiscord<Waldecir Santos> Thank you Elegantbeef !
21:14:57FromDiscord<Elegantbeef> `fieldpairs` and `fields` rely on loop unrolling to function due to what they do
21:15:24FromDiscord<Elegantbeef> They can yield heterogeneous types so magic is involved
21:15:37FromDiscord<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:24FromDiscord<Patitotective> In reply to @demotomohiro "If your procedure returns": 🤯
21:34:28FromDiscord<Patitotective> thanks ❤️
21:34:31FromDiscord<Patitotective> 🙃
21:41:32*ltriant joined #nim
21:53:33*jjido joined #nim
21:56:16FromDiscord<Waldecir Santos> So if I need a "dict/map" of string/[any type] is that possible with Nim?
21:59:34FromDiscord<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:58FromDiscord<Waldecir Santos> I remember this one too https://github.com/nim-appkit/values but seems "staled"
22:04:45FromDiscord<Elegantbeef> Nim doesnt have dynamic typing so you'd need to make an object variant something like the `JsonNode`
22:05:15FromDiscord<demotomohiro> Why do you need such a type?
22:06:11FromDiscord<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:54FromDiscord<Elegantbeef> Then you could have a `Table[string, RootObj]` or `RootRef`
22:07:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QX7
22:09:39FromDiscord<Waldecir Santos> Got it, yeah I think norm does something similar to this.
22:10:51FromDiscord<Waldecir Santos> They encapsulate `DbValue`
22:43:26FromDiscord<ynfle> Beef, out of curiousity, shouldn't this work https://play.nim-lang.org/#ix=3QXe?
22:43:28FromDiscord<ynfle> (edit) "https://play.nim-lang.org/#ix=3QXe?" => "https://play.nim-lang.org/#ix=3QXe ?"
22:47:02nrds<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:16FromDiscord<ynfle> In reply to @nrds "<Prestige> Anyone know why": Are you accessing it in nim?
22:48:33nrds<Prestige99> Yeah
22:49:21nrds<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:46nrds<Prestige99> https://i.imgur.com/4n89HbW.png
22:51:42nrds<Prestige99> Hm it's actually specifically the y component, the x does not crash it
22:54:42nrds<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:06FromDiscord<ynfle> How is it initialized?
22:59:09FromDiscord<ynfle> In the nim code?
22:59:10nrds<Prestige99> aha I found the problem finally
22:59:22FromDiscord<ynfle> Nice
22:59:24FromDiscord<ynfle> What is it?
22:59:27nrds<Prestige99> Bindings were missing a property in the struct that owned the camera
22:59:34nrds<Prestige99> so everything was off ab it
22:59:36nrds<Prestige99> a bit*
23:06:03FromDiscord<ynfle> Ah
23:12:28*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:39:25FromDiscord<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:45FromDiscord<Elegantbeef> @ynfle\: https://play.nim-lang.org/#ix=3QXg