<< 03-04-2021 >>

00:08:14ForumUpdaterBotNew thread by Masiarek2: Nim program name with spaces, see https://forum.nim-lang.org/t/7741
00:50:33*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:50:53*njoseph joined #nim
01:10:59FromDiscord<ilkxy_y> In reply to @Yardanico "nice spam,": lmfao
01:41:10*wasted_youth2 quit (Quit: Leaving)
01:44:10*waleee-cl quit (Quit: Connection closed for inactivity)
01:49:23FromDiscord<JSONBash> Anyone know why my mongoDB connection takes ~30s on startup? Using anonimongo
02:16:21leorize[m]@zetashift I added a configuration for nim.nvim: `let g:nim_highlight_wait = v:true` which would delay the highlighter update
02:16:58leorize[m]the delay will be `updatetime` (see `:h updatetime`)
02:48:43FromGitter<bung87> how to handle chronos hint `cannot raise 'Defect'` ?
02:49:39FromGitter<bung87> I update from chronos 2.6.1 to 3.0 can't run my program now `rror: type mismatch: got 'proc (udata`gensym105: pointer){.closure, locks: <unknown>.}' for 'proc (udata`gensym105: pointer) {.raises: [Defect].} = try: ⏎ if not finished(nameIterVar`gensym105):`
03:35:34*spiderstew_ joined #nim
03:35:47FromDiscord<Tuatarian> In reply to @Yardanico "nice spam,": loll who on a programming forum is falling for this?
03:35:55FromDiscord<Yardanico> ?
03:36:00FromDiscord<Tuatarian> the scam
03:36:11FromDiscord<Yardanico> idk really, but nim forum is moderated anyway
03:36:14FromDiscord<Tuatarian> nnevermind it's not a scam
03:36:17FromDiscord<Tuatarian> it's just some guy memeing
03:36:23FromDiscord<Tuatarian> that's even funnier
03:36:31FromDiscord<Yardanico> just a new account, that's not memeing, that's just useless spam
03:36:40*spiderstew quit (Ping timeout: 258 seconds)
03:36:50FromDiscord<Tuatarian> spam yeah but at least it doesn't seem to be a scam
03:36:59FromDiscord<Tuatarian> maybe they reply to comments with the links to the scam
03:37:21FromDiscord<Tuatarian> quite funny ty for posting
03:50:36*shmorgle quit (Quit: [TalkSoup] via NEXTSPACE)
03:53:59*shmorgle joined #nim
04:01:03*gpanders quit (Ping timeout: 268 seconds)
04:47:38*vicfred_ joined #nim
04:49:58*vicfred quit (Ping timeout: 240 seconds)
04:51:13*vicfred_ quit (Client Quit)
04:57:42*vicfred joined #nim
05:08:46*aeverr quit (Ping timeout: 260 seconds)
06:06:42*letto quit (Quit: Konversation terminated!)
06:18:14*narimiran joined #nim
06:23:18*hoijui joined #nim
06:25:55*ee7[m] joined #nim
06:26:45*vicfred quit (Quit: Leaving)
07:23:36*hoijui quit (Ping timeout: 246 seconds)
07:41:58*Vladar joined #nim
07:48:45*letto joined #nim
07:49:42*letto quit (Client Quit)
07:50:20*letto joined #nim
08:08:29saemSadly, I don't think I can improve the display of object variants with the nim-gdb.py script.
08:20:38*hoijui joined #nim
08:27:37*haxscramper joined #nim
08:45:51*lritter joined #nim
08:51:22*haxscram` joined #nim
08:53:37*haxscram` left #nim (#nim)
08:53:43*haxscramper quit (Ping timeout: 265 seconds)
08:56:26*hoijui quit (Quit: Leaving)
09:02:33*waleee-cl joined #nim
09:27:56FromDiscord<XxDiCaprioxX> now this may sound dumb but how can I get a char at position i of a string?
09:29:29FromDiscord<XxDiCaprioxX> is it `string(i)` ?
09:30:06FromDiscord<haxscramper> !eval echo "werwer"[0]
09:30:10NimBotw
09:30:18FromDiscord<sealmove> is there a way to access the first field of an object without using its name?
09:30:20FromDiscord<XxDiCaprioxX> okay thanks
09:30:22FromDiscord<XxDiCaprioxX> got it
09:30:41FromDiscord<haxscramper> In reply to @รєคɭ๓๏שє "is there a way": You can try https://nim-lang.org/docs/iterators.html#fields.i%2CT
09:31:11FromDiscord<haxscramper> The other option is to use `getTypeImpl` for object and just directly get first field
09:31:50FromDiscord<sealmove> great, thanks
09:49:15*Vladar quit (Remote host closed the connection)
10:05:48FromGitter<bung87> https://github.com/bung87/scorper/blob/devel/tests/trange.nim I use chronos that test multiple requests , it randomly fails, am wondering is it address binding time gap ?
10:14:33FromDiscord<KnorrFG> sent a long message, see http://ix.io/2UTo
10:38:20*PMunch joined #nim
11:03:33Zoom[m]@KnorrFG can't really help you with the problem in your code, but a nice task to get the day started. Do you need to consider illegal boards?
11:04:03FromDiscord<KnorrFG> 😄 I just assumed no ^^
11:05:55FromDiscord<Rika> ~~next goal after this is to determine the winner of a chess board~~
11:05:59FromDiscord<Rika> I kid of course
11:07:05*filcuc joined #nim
11:07:29PMunch@KnorrFG, what's the issue you have with that code?
11:08:29FromDiscord<KnorrFG> In reply to @PMunch "<@689821975463460892>, what's the issue": /usercode/in.nim(56, 12) template/generic instantiation from here↵/usercode/in.nim(21, 19) Error: cannot instantiate: 'B'
11:09:19FromDiscord<Rika> How do I test the AST output of a macro
11:09:21PMunchHmm, not too familiar with the sugar syntax. What does f => f(field) mean?
11:09:28PMunch@Rika, define test
11:09:40FromDiscord<Rika> Check against a premade AST
11:09:59FromDiscord<KnorrFG> basically that line and the commented lines that follow should all be identical, in my mind. they yield different error messages, but none of them works
11:10:00FromDiscord<Rika> So I guess pattern matching applies here
11:10:24PMunch@Rika, this might help: https://uploads.peterme.net/macroutils.html#verifying-dsl-trees
11:10:43PMunch@KnorrFG, but what is f there?
11:10:44FromDiscord<Rika> Can I do that without editing the original macro
11:11:08FromDiscord<KnorrFG> one of the functions in the list that is the second argument to firstSome
11:11:34Zoom[m]Sorry for not answering the question again. Guess this is not functional enough. https://play.nim-lang.org/#ix=2UTB
11:11:46PMunchUhm
11:12:30FromDiscord<haxscramper> In reply to @Rika "So I guess pattern": https://nim-lang.github.io/fusion/src/fusion/matching.html#tree-matching
11:14:17FromDiscord<KnorrFG> In reply to @PMunch "Uhm": Each of these functions checks one win condition, and returns a winner, or none. if a winner is returned, firstSome returns the winner, else it calls the next function
11:14:27FromDiscord<Rika> Now how do I get the AST output of a macro lol
11:14:36FromDiscord<Rika> Without editing the macro
11:15:11PMunch@KnorrFg, but he's not calling them
11:15:28FromDiscord<haxscramper> In reply to @Rika "Without editing the macro": I doubt it is possible. you can try and wrap call into `typed` argument, but that would not give you resulting AST
11:15:37PMunchSo he passes in a sequence of functions
11:15:45FromDiscord<Rika> Okay
11:15:51PMunchOr he passes in a function and a sequence of functions
11:17:23FromDiscord<KnorrFG> think of firstSome as a map that has the restriction, that the mapping function must map to an option type, and instead of the sequence it returns the first some result
11:17:49FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2UTF
11:18:41FromDiscord<KnorrFG> the idea is: "is there a winner among the rows? if not: is there ar winner among cols? ... etc"
11:18:49FromDiscord<KnorrFG> just expression functionally
11:19:29PMunchI don't think closures can recurse like that..
11:19:58FromDiscord<KnorrFG> and the function that is the first argument to firstSome is just calling the functions that are the second argument, with the field object as argument
11:21:40FromDiscord<KnorrFG> In reply to @Zoom "Sorry for not answering": i like your solution. still want to get mine to work
11:22:11*filcuc quit (Ping timeout: 240 seconds)
11:23:40FromDiscord<KnorrFG> In reply to @PMunch "I don't think closures": this is a very unsattisfying answer xD But thanks for looking at it ^^
11:24:15Zoom[m]Thanks. Of course! Hope you'll get to the bottom of it. I was under impression functional style is not considered the first-class citizen with Nim so I stopped looking into it for a while, at least until the situation improves.
11:26:04FromDiscord<KnorrFG> In reply to @Zoom "Thanks. Of course! Hope": can I use urs in the blog post too when I write it? Ofc, ill mention you. But the view count will probably stay below 20 anyway 😄
11:29:49*liblq-dev < https://matrix.org/_matrix/media/r0/download/matrix.org/oqYnGniTNeJpEXtZmoZuLXXT/message.txt >
11:30:00liblq-devnice 👌👌💯
11:30:36PMunchHmm @Zoom[m] tried to create a non-generic version of firstSome and managed to get it to work
11:33:04PMunch@Zoom[m] okay this works: http://ix.io/2UTK
11:35:03FromDiscord<KnorrFG> Ok, great. thanks but, this looks like the only reason that it didnt work before was that nim does not automatically assume {.nimcall.}?
11:35:12FromDiscord<KnorrFG> no offense, but: WHAT THE FUCK?
11:35:14PMunchCorrect
11:35:32PMunchI mean it assumes {.closure.}
11:36:01FromDiscord<KnorrFG> are those incompatible?
11:36:13FromDiscord<KnorrFG> I havent rly looked into these pragmas yet
11:36:21PMunchApparently
11:36:50PMunchhttps://forum.nim-lang.org/t/6117 <- this might clear it up for you
11:36:54FromDiscord<KnorrFG> but if you add nimcall, it still is a closure, even if it does not have that pragma anymore
11:37:03FromDiscord<KnorrFG> as it grabs field from the scope
11:37:12PMunchBut the TLDR is that closure carries a scope along with it, while nimcall is what the top-level procedures are
11:37:33PMunchYeah the outer proc is closure
11:37:45PMunchBut it takes a proc that is not a closure as its argument
11:38:20FromDiscord<KnorrFG> ahh, i see
11:38:56FromDiscord<KnorrFG> but shouldnt that be derivable form the list arguments?
11:39:08FromDiscord<KnorrFG> i mean the list of functions that is passed to firstSome
11:41:04*krux02 joined #nim
11:41:07PMunchWell that is the problem
11:42:10PMunchSince f: A -> Option[B] is the first argument A is determined there to be {.closure.} because f => f(field) apparently creates a closure. Then it gets a list of {.nimcall.} and throws an error
11:42:18FromDiscord<KnorrFG> should I open a bug report for that?
11:43:08FromDiscord<KnorrFG> ah. hmm. yeah makes sense.
11:44:50FromDiscord<KnorrFG> so ideally, the => macro should only create a closure function if something is actually grabbed from the scope
11:45:33FromDiscord<KnorrFG> or even better, nimcall and closures should be compatible.
11:45:53FromDiscord<KnorrFG> i mean from a user pov its both functions. the code that uses them looks the same
11:47:41PMunchHmm, I tried to flip the arguments in firstSome but that didn't work..
11:48:59*wasted_youth2 joined #nim
11:50:58PMunchBut now I can't even get it to work by adding {.nimcall.}
11:52:47FromDiscord<KnorrFG> I also just noticed: on play nim, if use the line where you introduced nimcall, it works, if i do that on my pc i get an error: lock levels differ. But I do use the latest stable, so my pc and play nom should run the same version
11:54:14PMunchHmm, are you on Windows?
11:54:22FromDiscord<KnorrFG> wsl2
11:54:37FromDiscord<KnorrFG> with ubuntu
11:54:39PMunchHmm, the playground uses Linux. So that might be it
11:54:55PMunchIt shouldn't matter though..
11:55:38PMunchHmm, is there an easy way to get a byte array of an object on compile-time?
11:56:08PMunchI'm trying to work around this: https://github.com/nim-lang/Nim/issues/17497
12:01:18FromDiscord<vieru> hi
12:01:59FromDiscord<vieru> can anyone help me run this ?
12:02:00FromDiscord<vieru> https://github.com/khchen/winim/blob/master/examples/com/threads/thread1.nim
12:02:22FromDiscord<vieru> the example just gives me this error
12:02:23FromDiscord<vieru> 'thread' is not GC-safe as it calls 'get'
12:02:28FromDiscord<vieru> (edit) "'thread'" => "`'thread'" | "'get'" => "'get'`"
12:03:10liblq-devPMunch, idk, https://github.com/disruptek/frosty ?
12:05:32FromDiscord<zetashift> In reply to @leorize "<@77574388035100672> I added a": Thanks!! Great plugin and thank you for your work
12:08:14FromDiscord<vieru> are there any winim devs on atm ?
12:08:22FromDiscord<vieru> (edit) "on" => "online"
12:09:25Zoom[m]<FromDiscord "<KnorrFG> In reply to @Zoom "Tha"> Of course, my pleasure!
12:10:40Zoom[m]Is there a difference between `setLen(0)` and `== ""` for strings?
12:10:43FromDiscord<KnorrFG> In reply to @Zoom "<FromDiscord "<KnorrFG> In reply": wanna give me any link to a profile of yours?
12:12:14Zoom[m]I guess it's https://github.com/ZoomRmc/
12:12:20PMunch@Zoom[m], not sure TBH
12:12:39PMunchI think setLen(0) won't touch the underlying string data
12:12:52Zoom[m]PMunch: Both are some Magic stuff
12:17:10liblq-devZoom: yes, there is a difference. s.setLen(0) will clear the contents of the string, and s == "" will return whether the string is empty
12:17:40liblq-devunless you meant to type a single `=`
12:17:42Zoom[m]lqdev: I mistyped `= ""` sorry
12:17:46liblq-devah
12:17:59liblq-devthen presumably it'll clear the internal buffer of the string
12:18:10liblq-devbut i suppose the compiler can optimize that away if it's smart enough
12:18:24liblq-devi'd go with s.setLen(0) just to be sure
12:19:11Zoom[m]I just want to reuse allocated memory and start pushing to the string anew
12:22:15liblq-devso yeah go with s.setLen(0)
12:23:47*mmohammadi9812 joined #nim
12:31:18*gpanders joined #nim
12:34:50FromDiscord<haxscramper> Is there any benchmarking library that is available on playground? And if no, can https://github.com/treeform/benchy be added there?
12:38:18FromDiscord<flywind> feel free to make a PR
12:38:31FromDiscord<flywind> https://github.com/PMunch/nim-playground/pull/3
12:38:35FromDiscord<flywind> ^
12:53:07FromDiscord<vieru> In reply to @vieru "are there any winim": anyone ?
12:57:06PMunch@haxscramper, here is the list of all packages on the playground: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
12:58:19PMunch@vieru, I'd love to help but I'm not a Windows user so not very familiar with winim. The way you're trying to use threads though looks very sketchy
12:59:01FromDiscord<haxscramper> PMunch: yes, I've already made a PR https://github.com/PMunch/nim-playground/pull/7
12:59:37PMunchKeep in mind that the playground has a run time limit and is very limited on CPU and memory time
12:59:44PMunchSo not exactly a great place to benchmark stuff
13:00:24FromDiscord<haxscramper> yes, but benchy stops after 60 seconds. And that is too long I can probably make a PR in order to make it configurable somehow
13:01:25FromDiscord<haxscramper> But that is mostly for simple comparison purposes, only to show X vs Y speeds
13:02:24FromDiscord<vieru> PMunch: i just want to make https requests from a thread to not interrupt my app, using the default nim procs for https requests add openssl as dep and i cant get it to link statically on windows
13:02:38PMunchThe container runs for 20s before it's aborted
13:05:23FromDiscord<vieru> i think ill just wait and reply to myself until someone can help me
13:05:32FromDiscord<vieru> thanks pmunch
13:05:38*aeverr joined #nim
13:06:06PMunch@vieru, it sounds like what you actually want is async
13:06:14PMunchIf you're doing http
13:06:23PMunchBut not sure if winim works with async
13:06:31PMunchSo you might need a thread after all
13:06:44FromDiscord<vieru> yeah thats why
13:07:07PMunchBut essentially threads in Nim have their own heap. So you can't just pass a dictionary from one thread to another and expect that to work out well
13:07:08FromDiscord<vieru> async would be great
13:07:21PMunch(Although not sure what the `com` type is)
13:07:56FromDiscord<flywind> it's a ref object
13:10:52PMunchHmm, that entire example seems a bit dubious
13:11:00PMunchNot sure if that ever could've worked properly
13:12:14PMunchI mean you could possibly be able to do it with async
13:12:28FromDiscord<vieru> basically i just need to call methods from winim/com in a thread but i cant because there's something in the winim code https://media.discordapp.net/attachments/371759389889003532/827893310215028746/unknown.png
13:12:46FromDiscord<vieru> line 999 com.nim
13:13:02FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUc
13:13:03PMunchYeah, they try to access globally GC-ed memory
13:13:05PMunchWhich isn't allowed
13:13:27PMunchBut it has never been allowed, so I'm not sure how he wrote those examples..
13:14:15FromDiscord<vieru> the problem is there arent any global variables
13:14:23FromDiscord<vieru> inside
13:14:36FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUd
13:14:44FromDiscord<vieru> thats line 826
13:14:51FromDiscord<vieru> (edit) "826" => "926"
13:15:17FromDiscord<vieru> you find the definition for excep
13:15:26FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUe
13:15:51FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2UUf
13:16:18FromDiscord<vieru> this is the code https://media.discordapp.net/attachments/371759389889003532/827894276116578364/unknown.png
13:17:38FromDiscord<vieru> https://media.discordapp.net/attachments/371759389889003532/827894614899032104/unknown.png
13:17:51FromDiscord<vieru> if you wonder whats that underline about
13:18:16PMunchHmm, that looks weird
13:19:24FromDiscord<vieru> ill try nim 1.2.8 mby there's a bug in 1.4.4
13:23:51FromDiscord<vieru> yeah nim 1.2.8 doesnt give any errors
13:24:00FromDiscord<vieru> whats all of this about
13:24:02FromDiscord<vieru> i dont get it
13:25:56FromDiscord<Rika> its git bisect time
13:27:34FromDiscord<vieru> lol its like every time i get back to nim i discover a new bug
13:31:58PMunchThat just means you're pushing ever further into what Nim can do :)
13:35:21FromDiscord<vieru> its just really a headache
13:36:22PMunchUnless I'm missing something obvious there I don't really see how that could've worked before..
13:36:31PMunchHave you tried with --gc:arc by the way?
13:36:36FromDiscord<haxscramper> PMunch: actually benchy does always run for 60 seconds, but insead runs no longer than 60 seconds if execution of each test devaites too much. So it can finish in less than a second
13:36:50PMunchNot sure if that enables/disables any checks, but it should be better for threading
13:36:51FromDiscord<haxscramper> And it won't run more than a thousand times for a test
13:37:37PMunchAah I see
13:38:01PMunchSo you don't want to make any PRs?
13:40:37FromDiscord<haxscramper> I will open issue in benchy to discuss possible ways how it can be configured (because right now it is just simple `timeIt` template that has 60s hardcoded)
13:41:18FromDiscord<haxscramper> Maybe treeform doesn't want to make it extra-configurable (keep it simple `timeIt` without any extra complexity)
13:42:20FromDiscord<haxscramper> Although if you want you can merge my PR now
13:42:40FromDiscord<haxscramper> And I will work out other details later
13:43:01PMunchSure, it just involves a little bit of manual work to actually rebuild an image every time I add a package
13:43:14PMunchSo I didn't want to merge it if you were going to make a small PR very soon
13:45:52FromDiscord<haxscramper> You mean you have to rebuild the image after I make edits to benchy itsel too?
13:48:44PMunchYup
13:49:08PMunchIt rebuilds automatically when new versions of Nim are released, but not when I approve PRs to the packages list
13:50:31FromDiscord<haxscramper> It is not urgent anyway, so if you want to delay it until I sort out 60s execution cap it is not a big deal
13:54:30*Cadey quit (Quit: WeeChat 3.0.1)
13:58:07FromGitter<bung87> is there a nimble flag turn off verify packages and download when `nimble build`? when my nimble file requires packages as url , it always download from GitHub
13:58:28FromDiscord<haxscramper> no
13:59:15FromGitter<bung87> that's very weird behaviour for me .
13:59:16FromDiscord<haxscramper> Package verification and download is coded together with dependency resolution, so it is not possible to my knowledge
14:00:26FromGitter<bung87> I think it only needed when installation, dont know why that nimble run also do same thing.
14:01:22FromGitter<bung87> no like any other language package manager run scripts.
14:03:01FromGitter<bung87> just because it doesn't have registry and lock file ,I guess
14:03:35FromDiscord<haxscramper> https://forum.nim-lang.org/t/7671
14:05:57*shodan45 quit (Remote host closed the connection)
14:06:40*kitech1 quit (Remote host closed the connection)
14:06:58*kitech1 joined #nim
14:08:03*Xe joined #nim
14:08:05*shodan45 joined #nim
14:08:41*Xe is now known as Cadey
14:17:20*dddddd quit (Quit: dddddd)
14:17:23*filcuc joined #nim
14:18:40FromDiscord<jseb> with nimble, what about git packages ? For exemple, godot package is installed on my PC on version 0.8.1. There has been updates on the github since my installation, but if i want to update the package (`nimble install godot`) it says the package is already up-to-date (no version change, i don't know what are the criteria for this). So if i answer «yes», i guess it's updated to the last commit ?
14:21:32FromGitter<bung87> if you dont specify the version , it will get local package from install directory
14:22:00FromGitter<bung87> your nimble package installed as <packageName>@version
14:22:54FromGitter<bung87> if it requires install it will check GitHub tags compare versions then decide to whether download
14:26:15*filcuc quit (Ping timeout: 265 seconds)
14:28:57*xet7 quit (Quit: Leaving)
14:29:18*filcuc joined #nim
14:29:24*xet7 joined #nim
14:29:36FromDiscord<jseb> so no update , then ? If the github tag doesn't change
14:33:15*filcuc quit (Client Quit)
14:33:21*filcuc_ joined #nim
14:33:42FromDiscord<vieru> hi again
14:33:46FromDiscord<vieru> quick question
14:33:53FromDiscord<vieru> `2021-04-03T14:06:36.053789Z`
14:33:58FromDiscord<vieru> what date format is this ?
14:34:12FromDiscord<vieru> im confused by the part after the dot
14:34:43FromDiscord<vieru> parse("2021-04-03T14:06:36.053789Z", "yyyy-MM-dd'T'HH:mm:ss.ffffff'Z'")
14:34:52FromDiscord<vieru> (edit) "parse("2021-04-03T14:06:36.053789Z", "yyyy-MM-dd'T'HH:mm:ss.ffffff'Z'")" => "`parse("2021-04-03T14:06:36.053789Z", "yyyy-MM-dd'T'HH:mm:ss.ffffff'Z'")`"
14:35:02PMunchISO8601
14:37:51FromDiscord<vieru> so what would be the correct way for the format ?
14:37:59FromDiscord<vieru> i cant get it to work
14:38:23FromDiscord<vieru> (edit) "what would be" => "whats" | "way" => "format" | "the format ?" => "parse"
14:42:39FromDiscord<vieru> nevermind
14:42:44FromDiscord<vieru> i got it to work
14:42:49FromDiscord<vieru> `"yyyy-MM-dd'T'HH:mm:ss'.'ffffff'Z'"`
14:42:57FromDiscord<dom96> @jseb nimble installs the latest tagged version by default
14:42:57FromDiscord<vieru> thanks for the tip tho
14:43:10FromDiscord<dom96> if you want latest commit you can install via `nimble install godot@#head`
14:47:26*filcuc_ quit (Ping timeout: 240 seconds)
14:52:09FromDiscord<jseb> ok i understand now, thank you for the answers
14:58:14PMunch@vieru, technically that Z is the timezone. Z is Zulu time, or UTC. It can also be something like `-04:30`
15:01:36PMunchHmm, is there a way to get Nim to create a UTF16 literal from a normal string literal?
15:08:59PMunchSomething like `L"Hello"`
15:09:17*mmohammadi9812 quit (Remote host closed the connection)
15:12:10liblq-devi mean you can make a macro that does conversion from UTF-8 to UTF-16
15:12:16liblq-devmaybe even a template if you're brave enough ;)
15:12:16PMunchSure
15:12:27PMunchNot sure that would work in this case
15:12:41liblq-devwhat's your "case"
15:13:13*Vladar joined #nim
15:13:33PMunchThe string must pass through a PROGMEM macro that converts it to be stored in the flash memory of a microcontroller
15:13:43PMunchIt's for implementing the USB HID spec
15:24:00FromDiscord<KnorrFG> sent a long message, see http://ix.io/2UUG
15:28:05*rockcavera joined #nim
15:48:58*filcuc_ joined #nim
15:50:04PMunchHmm, that looks weird indeed
16:37:14*filcuc_ quit (Ping timeout: 265 seconds)
16:47:55*filcuc_ joined #nim
16:55:11*filcuc_ quit (Ping timeout: 240 seconds)
16:55:59FromDiscord<JSONBash> Anyone know why my mongoDB connection takes ~30s on startup? Using anonimongo
16:57:06*m4r35n357 quit (Ping timeout: 240 seconds)
16:57:42*m4r35n357 joined #nim
17:10:43FromDiscord<DavidKunz> sent a code paste, see https://play.nim-lang.org/#ix=2UVg
17:12:23FromDiscord<ElegantBeef> make a block statement, and have the last statement be `yourReturnObject`
17:12:51FromDiscord<DavidKunz> Thanm you @ElegantBeef , will try that!
17:12:52FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/BaK
17:12:59FromDiscord<DavidKunz> (edit) "Thanm" => "Thank"
17:13:30FromDiscord<ElegantBeef> If the last statement in each branch is a non-null value and the same type it's returned to the left hand of `=`
17:13:38FromDiscord<ElegantBeef> non-void
17:14:20FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2UVm
17:16:42FromDiscord<DavidKunz> sent a code paste, see https://play.nim-lang.org/#ix=2UVn
17:17:18FromDiscord<ElegantBeef> can you throw it on here? https://play.nim-lang.org/
17:17:22FromDiscord<DavidKunz> sure!
17:17:55FromDiscord<DavidKunz> let me create a minimal example first
17:18:00FromDiscord<Yardanico> https://therecord.media/github-investigating-crypto-mining-campaign-abusing-its-server-infrastructure/
17:20:56FromDiscord<DavidKunz> https://play.nim-lang.org/#ix=2UVq
17:21:13FromDiscord<ElegantBeef> Ah
17:21:27FromDiscord<ElegantBeef> wrap it in`newLit(MyObj(...))`
17:22:34FromDiscord<DavidKunz> It worked! Thank you very much @ElegantBeef 🙂
17:22:45FromDiscord<DavidKunz> Made my day
17:22:48FromDiscord<ElegantBeef> If this is all you're doing you dont need the `block:`
17:22:57FromDiscord<DavidKunz> Got it! Thank you
17:24:11FromDiscord<DavidKunz> In case others are interested, this is the working solution: https://play.nim-lang.org/#ix=2UVr
17:25:00FromDiscord<ElegantBeef> Helping lurkers... wild 😛
17:28:15*algun joined #nim
17:29:10algunHello everyone. Just picked up Nim today. And now I'm "attempting to call routine: 'walkDir'". Why doesn't nim want me to do that?
17:30:27FromDiscord<ElegantBeef> It's an iterator
17:31:07FromDiscord<ElegantBeef> so you need to `import std/os` and do `for dir in walkDir("path/to/walk")`
17:31:55algunSo the functional approach is out of the question? I was thinking it would return an iterator, and I could toSeq it
17:32:01algun(at least)
17:32:40FromDiscord<ElegantBeef> ah you can `import std/sequtils` then do `toSeq(walkDir(args, ...))`
17:33:08FromDiscord<ElegantBeef> Presently iterators do not abide by the UFCS, so you have to pretend it's C with them
17:35:44algunThanks ElegantBeef, that fixes that!
17:35:59algunBut now I get "Error: typeless parameters are obsolete". Does nim not have type inference?
17:36:44FromDiscord<ElegantBeef> It does have type inference just not extreme backtracking inference
17:38:31FromDiscord<ElegantBeef> So you need to specify parameter types/return types
17:38:48FromDiscord<Solitude> and thats a good thing
17:38:52algunElegantBeef: Does it have structural deconstruction?
17:38:54FromDiscord<ElegantBeef> I agree
17:39:05FromDiscord<ElegantBeef> Through macros yes
17:39:07algunWhy? You value compilation time over convenience?
17:39:46FromDiscord<Solitude> i value looking at function and understanding what data it manipulates
17:39:57FromDiscord<ElegantBeef> I like having static function signatures that dont change cause i changed a function that was called internally
17:40:27algunSolitude: I'm just trying to process pairs with filter proc(first, second) = ..
17:40:29FromDiscord<Solitude> and overloading needs types
17:41:24algunC# does overloading and allows me to .Where((first, second) => ...) just the same
17:41:41algun(for just one)
17:41:52FromDiscord<Solitude> can you show a failing snippet
17:43:10algunactually, I'm not sure it does, its tuple implementation is new and lacking
17:43:15algunok, sec
17:43:37algunhttps://play.nim-lang.org/#ix=2UVw
17:44:24algunu,v,w hehe 🧒
17:44:42algun(i just added type annotations at line 24)
17:46:39FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2UVx
17:46:42FromDiscord<ElegantBeef> Atleast how i'd do it
17:47:07FromDiscord<ElegantBeef> It does have tuple destructuring
17:47:39algunok :(
17:49:58FromDiscord<ElegantBeef> Well `filter` takes a `proc(x: T)` so you need to do that
17:50:11FromDiscord<ElegantBeef> You could use `filterIt` and have it not use that anonymous procedure
17:50:57FromDiscord<ElegantBeef> Or you could use `sugar.collect`
17:51:08FromDiscord<Unaimend> Regarding the nimble project structure, is it allowed to have subfolders? I am having problems importing a src file which is in a subfolder in another package.
17:51:33FromDiscord<ElegantBeef> should be `packagename/subfile`
17:51:42FromDiscord<ElegantBeef> If it's a properly made nimble package
17:52:24FromDiscord<Unaimend> so `src/<packagename>/<subfolder>` is not allowed?
17:52:48FromDiscord<Unaimend> only `src/<packagename>/<subfile>`
17:53:16FromDiscord<ElegantBeef> You can have a subfolder
17:54:19FromDiscord<Unaimend> Ok, I am trying to import the files from io subfolder from this package at cant get it to work↵https://github.com/kerrycobb/PhylogeNi/tree/main/src/phylogeni
17:54:38FromDiscord<Yardanico> how are you doing it?
17:54:46FromDiscord<ElegantBeef> should just be `import phylogeni/io/newick`
17:55:04FromDiscord<ElegantBeef> or prefixed with `pkg/` if you live that life
17:55:37FromDiscord<Unaimend> In reply to @Yardanico "how are you doing": import phylogeni/io/newick
17:55:57FromDiscord<Unaimend> nvm. works.
17:56:01FromDiscord<Unaimend> I have to check sth
17:56:11FromDiscord<Yardanico> @ElegantBeef what if someone publishes a nim package called "pkg" :D
17:56:19FromDiscord<Yardanico> or "std"
17:57:55algunElegantBeef: "untyped" scares me a bit
17:57:57FromDiscord<Unaimend> Because in this package it doesnt work ↵https://github.com/kerrycobb/nim-dna-seq/tree/main/src
17:58:14FromDiscord<Unaimend> maybe there is sth. wrong with my locale copy of it
17:58:15alguneven though the code is much cleaner
17:58:33FromDiscord<haxscramper> there is nothing wrong with `untyped`
17:59:09FromDiscord<haxscramper> I.e. almost no debugging-resistant gotchas that you have to watch out for
18:01:25FromDiscord<Yardanico> @algun nim's "untyped" is only related to compile time
18:01:40FromDiscord<Yardanico> and it doesn't make the nim compiler not check the types, all types are still checked in the end
18:01:48algunYardanico: that's the only time that matters ;)
18:02:18alguni'm not really joking really
18:03:17algunthat sounds suspicious so let me be clear about what I think: Whatever can be handled compile time, should be handled compile time. Except if it takes a monad to do it.
18:04:01FromDiscord<Yardanico> yes, that's true
18:04:09FromDiscord<Yardanico> untyped is only related to compile time and it's only needed for templates/macros
18:04:22FromDiscord<Yardanico> when you don't want the compiler to do type checking on the code that is being passed to a template/macro
18:04:31FromDiscord<Yardanico> the code is still type checked in the end (after all transformations), so it's not unsafe
18:04:42FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters
18:05:14FromDiscord<Yardanico> by saying "untyped" you say to the compiler "don't do semantic checking for the code that is being passed to a template/macro"
18:05:39algunbecause the template does it?
18:05:59FromDiscord<Yardanico> ?
18:06:02alguni don't know anything about templates
18:06:04FromDiscord<Yardanico> because the compiler does it after it evaluates the template
18:06:07FromDiscord<Yardanico> or the macro
18:06:14algunso then it is compile time, is it not?
18:06:22FromDiscord<Yardanico> yes, did I say that it's not?
18:06:28FromDiscord<Yardanico> you might not unterstand all of the things, but as I said, the compiler still checks all the code in the end
18:06:35FromDiscord<Yardanico> after all macro/template/etc transformations
18:06:58algunok, I was afraid you meant it would be checked at run-time
18:07:14algunsome dynamic typing affectionados like to point that out for some reason
18:07:27FromDiscord<Yardanico> again, nim is a statically compiled language
18:07:27algunno offense to dynamic typing affectionados
18:07:45algunYardanico, no escape hatch?
18:07:46FromDiscord<zidsal> sent a long message, see http://ix.io/2UVK
18:07:57FromDiscord<Yardanico> you can do type erasure with pointers if you want of course
18:07:58FromDiscord<Yardanico> but why?
18:08:19FromDiscord<Yardanico> In reply to @zidsal "I have a weird": is == your own defined operator?
18:08:22FromDiscord<zidsal> yes
18:08:25FromDiscord<zidsal> for a ref type
18:08:32FromDiscord<Yardanico> maybe it's the difference of comparing references and their underlying data
18:08:42algunYardanico, I wouldn't want to, I'm just forming a picture
18:09:35algunin any case thanks ElegantBeef and Yardanico for the chat, let me see if I can finish my prog now...
18:14:31*PMunch quit (Quit: leaving)
18:20:55*PMunch joined #nim
18:30:54PMunchMore keyboard shenanigans, it's finally time for a nice layout DSL! https://www.twitch.tv/pmunche
18:41:17algunI haven yet to tested it, but I reckon this will be it: https://play.nim-lang.org/#ix=2UVT
18:46:26FromDiscord<Yardanico> now go and rewrite that to use sugar.collect or https://github.com/zero-functional/zero-functional
18:46:37FromDiscord<Yardanico> :P
18:47:06FromDiscord<Unaimend> Do we have sth. like mathplotlib?
18:47:15FromDiscord<Yardanico> matplotlib? yes
18:47:22FromDiscord<Yardanico> https://github.com/Vindaar/ggplotnim
18:47:26FromDiscord<Unaimend> In reply to @Yardanico "matplotlib*? yes": yeah, upsi
18:47:27FromDiscord<Unaimend> thx
18:47:35FromDiscord<Yardanico> and https://github.com/brentp/nim-plotly for plotly
18:47:44FromDiscord<Yardanico> ggplotnim is native nim though
18:47:49algunfixed: https://play.nim-lang.org/#ix=2UVX
18:48:48algunYardanico: What's the advantage? Is it "iterable"?
18:49:04FromDiscord<Yardanico> sugar.collect is more nim-stylke
18:49:06FromDiscord<Yardanico> (edit) "nim-stylke" => "nim-style"
18:49:14algunMore than the standard lib?
18:49:15FromDiscord<Yardanico> and zero functional is more efficient than sequtils
18:49:15algunWeird
18:49:21FromDiscord<Yardanico> sugar.collect is from the stdlib as well
18:49:29FromDiscord<Yardanico> https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped
18:50:02FromDiscord<Yardanico> also you don't really need regexes in your program, although they allow for a bit less code
18:50:30algunPlease explain
18:50:54FromDiscord<Yardanico> you can do same string checks and captures via normal string operations
18:50:55FromDiscord<Yardanico> or strscans
18:51:01FromDiscord<Yardanico> https://nim-lang.org/docs/strscans.html
18:51:12algunI'm doing this program for a windows user, if I rewrite it in sugar.collections, will it compile just as well?
18:51:19FromDiscord<Yardanico> of course?
18:51:22FromDiscord<Yardanico> that's a nim stdlib module
18:51:41FromDiscord<Yardanico> and it's really better to rewrite regexes into strscans
18:51:49FromDiscord<Yardanico> because otherwise you'll have to ship pcre dll with your binary on windows
18:52:23algunouch
18:52:36FromDiscord<Yardanico> can you show an example of what your program does so I can test it ?
18:52:40algunwill do both then I guess :|
18:53:25leorize[m]there's also nim-regex if you want a native regex implementation
18:53:32FromDiscord<Yardanico> true
18:54:47algunEh, it's a bit specialized. Basically, when you save a site, you get .html and images/. The prog finds all occurrences of image_N.EXT in the html, and then in the other in which it finds them, it copies them from images/ to images_ordered/, naming them sequentially (ie in order they appear on the site). Help provides a hint.
18:55:15algun*int the order
18:57:29leorize[m]htmlparser should get you the document tree which then you can just dig in to get all img tags
18:58:05algunis it stdlib? does it have dependencies?
18:58:10FromDiscord<Yardanico> it is stdlib
18:58:18FromDiscord<Yardanico> and why are you so resilent about using non-stdlib modules?
18:58:29FromDiscord<Yardanico> nim modules are compiled statically in the binary anyway
18:58:37algunah, k
18:58:40FromDiscord<Yardanico> as long as they don't sure some dll dependencies (which most libraries don't)
18:58:44FromDiscord<Yardanico> (edit) "sure" => "use"
18:58:52algunexcept the stdlib regex ones ;)
18:59:06FromDiscord<Yardanico> yes, we have modules in the stdlib that use DLLs, but it's jusified :)
18:59:09FromDiscord<Yardanico> (edit) "jusified" => "justified"
18:59:14FromDiscord<Yardanico> like db_mysql
18:59:29algunmysql in the stdlib :S
18:59:46FromDiscord<Yardanico> why not?
18:59:47FromDiscord<Yardanico> https://nim-lang.org/docs/db_mysql.html
19:00:10FromDiscord<Yardanico> we have four db_ modules which offer almost the same API
19:00:14FromDiscord<Yardanico> so they can be swapped more-or-less easily
19:00:15algunhardly seems a "standard" thing
19:01:50algunI could understand an ORM with perhaps a SQLLite backend and other interchangable backends, but not shipping mysql/postgresql support. Surely seems an overkill.
19:02:14FromDiscord<Yardanico> don't see your point here honestly
19:02:20FromDiscord<Yardanico> it's not like we ship the mysql DLL
19:06:15FromDiscord<Yardanico> @algun i'm not sure if this is works as I don't know how to export the website that way, but here - https://play.nim-lang.org/#ix=2UW4
19:06:25FromDiscord<Yardanico> with collect macro and nim-regex (install via `nimble install regex`)
19:06:35FromDiscord<Yardanico> or, if your app is a nimble package, add requires "regex" in your nimble file
19:07:09FromDiscord<Yardanico> ah, right, forgot to remove the "re" import, it's not needed
19:07:26FromDiscord<Yardanico> also sequtils is no longer needed
19:08:04FromDiscord<Yardanico> you can actually make your source_image_names an iterator so it will copy images as it finds them
19:09:36FromDiscord<Yardanico> https://play.nim-lang.org/#ix=2UW5 this uses the small enumerate stdlib package to add index as you seem to use it
19:11:35algunthe for loop returns a seq? nice
19:11:48FromDiscord<Yardanico> with the collect macro - yes
19:11:57FromDiscord<Yardanico> with an iterator, the iterator's body is "inlined" into the loop
19:14:14alguni didn't quite get the way you put it, but yielding-returning for enumerators is a thing in C# too. That's why the first thing caught my eye
19:14:32FromDiscord<Yardanico> with both enumerate and the iterator inlined that loop will become something like this (rough approximation):
19:14:49FromDiscord<Yardanico> sent a code paste, see https://paste.rs/k7R
19:15:42FromDiscord<Yardanico> enumerate just adds the `i` variable
19:15:58FromDiscord<Yardanico> but generally you don't need to care about those internal details :P
19:31:57algunhow do I acquire pkg/regex?
19:35:11liblq-devnimble install regex
19:38:34algunthanks, it was findAll that I need to change into findAndCaptureAll actually (i've decided to go with my code I'm afraid Yardanico)
19:39:26algun(liblq-dev that is, i did do nimble install regex, but the API difference didn't allow me to compile)
20:03:08*algun quit (Ping timeout: 265 seconds)
20:09:07*haxscramper joined #nim
20:09:08*haxscramper quit (Read error: Connection reset by peer)
20:15:59FromDiscord<Yardanico> @algun well my code had that changed already too
20:16:18FromDiscord<Yardanico> and there's not much difference between your and my code, I just generally pointed you to sugar.collect :)
20:17:29*kenran joined #nim
20:17:46*jess quit (Quit: updates)
20:18:23*Gustavo6046 quit (Ping timeout: 250 seconds)
20:28:09ForumUpdaterBotNew post on r/nim by JellyFish_AZ: Difference between creating objects via functions, see https://reddit.com/r/nim/comments/mjgkeu/difference_between_creating_objects_via_functions/
20:28:56*algun joined #nim
20:31:19*narimiran quit (Quit: leaving)
20:34:34FromDiscord<ElegantBeef> Nim has a rather batteries included stdlib so the general view is if it's an "important" package it should be easily accessed
20:34:47FromDiscord<ElegantBeef> Hell until recently C# didnt even have json in their stdlib
20:36:30FromDiscord<ElegantBeef> I think that if it's a commonly used library it makes sense to add to the stdlib, but ymmv 😄
20:38:55*Gustavo6046 joined #nim
20:38:57*Gustavo6046 quit (Remote host closed the connection)
20:39:35*Gustavo6046 joined #nim
20:43:54FromDiscord<Conifer> Been studying Nim for a while and have to say I like where its going. Albeit not the biggest fan of indentations, but it's matter of getting used to it I guess.
20:51:25FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2UWw
20:52:38FromDiscord<mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2UWy
20:57:21FromDiscord<mattrb> Turns out I can reduce it to just those 3 procs and it still behaves as described above https://play.nim-lang.org/#ix=2UWz
20:58:13FromDiscord<mattrb> If you just swap the type of the `bits` parameter on line 3 to `SomeInteger`, you can observe the same behavior in the playground
21:03:03*kenran quit (Remote host closed the connection)
21:12:17FromDiscord<ElegantBeef> In reply to @Yoshiharu "Been studying Nim for": Eh indentation wasnt cool before either, but Nim's isnt dumb like python's and you're going to write code the same way without indentation as with
21:13:12FromDiscord<ElegantBeef> @mattrb it's a bug with typeclasses and generics atm
21:13:37FromDiscord<mattrb> Is there an issue I can track?
21:14:34FromDiscord<ElegantBeef> Uhh i think there is a similar bug i can link you to in a moment, but the work around is `[immediate: static bool, I: SomeInteger]` afaik
21:15:10FromDiscord<ElegantBeef> I think it's the same isue as this one https://github.com/nim-lang/Nim/issues/17212
21:16:01FromDiscord<mattrb> Awesome, ty!
21:17:18*jess joined #nim
21:17:38FromDiscord<ElegantBeef> Saem and I investigated it a bit(him mostly) and it just turned out the generics were getting evaluated weirdly when using inferred generics + explict
21:18:23*algun quit (Ping timeout: 246 seconds)
21:24:44saem(suddenly a wild Saem appears)
21:25:06FromDiscord<ElegantBeef> I woke you up checking on what you were working on 😄
21:25:07FromDiscord<mattrb> sent a code paste, see https://paste.rs/MGv
21:25:21FromDiscord<ElegantBeef> Yea like i said inferred generic the `SomeInteger` type class + explicit doesnt plaay well
21:25:32FromDiscord<ElegantBeef> You can make that just `b: bool` and i think it still fails
21:25:43FromDiscord<mattrb> Yep, just wanted to post a reduced example 👍
21:25:48saemI'm trying to figure out if I can figure out the branches of an object variant at runtime via NTI, in gdb land.
21:26:03saemit is not going well
21:26:42FromDiscord<G-force 4760> Hey People↵My name is Gonçalo and I'm form Portugal.↵I'm looking for a new language to learn and I just installed Nim on linux to give it a try.↵I'm interested in Scientific computing (Data Science, ML, AI and simulations), automation and Generative art.
21:26:58*algun joined #nim
21:28:41*leorize joined #nim
21:33:28FromDiscord<ElegantBeef> Ah you can just say you're a nerd 😛 (Jokes aside we've got stuff for that)
21:34:03FromDiscord<G-force 4760> In reply to @ElegantBeef "Ah you can just": I am indeed
21:34:49FromDiscord<G-force 4760> what do you guys recommend for generative art? I've seen bindings for p5js↵https://github.com/belamenso/p5.nim
21:35:05FromDiscord<ElegantBeef> More aimed towards games, but nico can do similar
21:36:40saemhmm, I thought there were some docs about run time type information.
21:37:00FromDiscord<ElegantBeef> saem this is it https://nim-lang.org/docs/typeinfo.html#runtime-type-information_1
21:37:17saemthanks
21:37:29FromDiscord<ElegantBeef> I mean dont say it until you read it
21:37:45FromDiscord<G-force 4760> I found nim when looking for gba stuff lol↵It seems to me like python and rust had a baby, and then (Game of thrones style) you found out that C and Bash were also involved in that relationship hahaha↵https://www.youtube.com/watch?v=sZUM7MhWr88&t=496s
21:38:06FromDiscord<ElegantBeef> I always say it's just a modern wirth language, but yea
21:38:36FromDiscord<Yardanico> @G-force 4760 just FYI, Nim is older than Rust :)
21:38:51FromDiscord<G-force 4760> In reply to @Yardanico "<@!391274926541373441> just FYI, Nim": had no idea
21:39:12FromDiscord<ElegantBeef> It just has relatively little funding compared and as such is mostly a community language
21:39:43FromDiscord<konsumlamm> almost as if Nim was heavily inspired by wirth languages...
21:40:00saemnow... I gotta figure out what if any of this I can use in gdb land. 🤔
21:40:01FromDiscord<ElegantBeef> I mean that's the point
21:40:04FromDiscord<Yardanico> New Indented Modula
21:40:26FromDiscord<ElegantBeef> People say it's like python but aside from the indentation it's vastly different
21:41:34FromDiscord<G-force 4760> I just want to learn a language I can have fun with (JS does not make the cut for me) and since I'm going to be forced to learn c++ in Uni I need to learn a "fun" lower level language
21:41:45FromDiscord<ElegantBeef> Well then Nim sounds like the place
21:42:28FromDiscord<ElegantBeef> Plus you can always learn C++ by using the C++ backend and interop with it
21:43:45FromDiscord<G-force 4760> Nico also seems cool (since I've used pico8 before, but lua's tables starting at 1 is a bit weird lol)
21:44:05FromDiscord<Yardanico> nim arrays can start at whatever number you want
21:44:29FromDiscord<ElegantBeef> I dont like you pointing it out but yes
21:44:41FromDiscord<Yardanico> @ElegantBeef XD
21:44:44FromDiscord<Yardanico> sent a code paste, see https://paste.rs/Bbc
21:44:46FromDiscord<Yardanico> need to add it to lesser known nim features
21:44:50FromDiscord<Yardanico> forgot to add it before
21:44:52FromDiscord<G-force 4760> lol
21:44:56FromDiscord<ElegantBeef> "You can fuck with your users"
21:45:02FromDiscord<ElegantBeef> Though that's useful for enum slices
21:45:08FromDiscord<G-force 4760> I guess that it may be useful sometimes
21:45:18FromDiscord<ElegantBeef> Especially since we have enum indexed arrays
21:45:41FromDiscord<G-force 4760> I need to go to bed, tomorrow I will dive deeper into nim thx for the help guys
21:45:42FromDiscord<ElegantBeef> No they arent hashtables
21:45:57FromDiscord<ElegantBeef> The amount of times i have to explain they arent fucking hashtables to people hurts
21:46:00FromDiscord<G-force 4760> (edit) "guys" => "guys/girls"
21:46:16FromDiscord<ElegantBeef> No problem buh bye and hurry back the indoctrination starts tomorrow
21:46:18FromDiscord<konsumlamm> you have to explain that arrays aren't ahsh tables?
21:46:18FromDiscord<ElegantBeef> I mean learning
21:46:29FromDiscord<konsumlamm> (edit) "ahsh" => "hash"
21:46:38FromDiscord<ElegantBeef> For some reason people think enum indexed arrays are some mad hashtables
21:46:59FromDiscord<ElegantBeef> Possibly due to the `enumVal: 10` syntax i guess
21:47:17FromDiscord<Yardanico> In reply to @ElegantBeef "The amount of times": ??????
21:47:42FromDiscord<Yardanico> never seen someone thinking that enum indexed arrays are hash tables
21:47:44FromDiscord<Yardanico> in this chat at least
21:47:50FromDiscord<Yardanico> do you have a lot of people that you teach nim to?
21:47:57FromDiscord<Yardanico> private lessons?
21:48:02FromDiscord<ElegantBeef> Yea when i was making dusty with other people making a sand sim a fair bit of people thought it was a hash table
21:48:28FromDiscord<ElegantBeef> Nah i just write nim code occasionally to showcase it's features to people in another discord
21:49:06FromDiscord<ElegantBeef> Also to just mock the C++ code i see
21:56:21*algun quit (Ping timeout: 260 seconds)
22:03:51saemusing private implementation in stdlib... what could go wrong?
22:04:19FromDiscord<ElegantBeef> What're you using?
22:04:38saemtypeinfo.selectBranch
22:11:31PMunchDamn, this keyboard firmware code is getting pretty cool. Now I have layouts with macro buttons and that just takes 2342 bytes :D Compared to QMK which takes 12220 with all extra features disabled, or 21340 with the default config
22:13:51PMunchMy firmware is less than 1/5th the size of the smallest QMK firmware, and that is while supporting some features that would be disabled in that configuration of QMK
22:14:08PMunchAnd the code is obviously nice and tidy :)
22:14:42FromDiscord<Yardanico> showing ther power of macros for embedded devices :)
22:15:03PMunchYup!
22:15:18FromDiscord<ElegantBeef> Nice i still havent wrangled with tinyusb enough to actually get it to compile 😄
22:15:29FromDiscord<ElegantBeef> but hey atleast linerino has colorful portals finally
22:15:53PMunchOf course I'll have to write a really headline-grabbing article about this when it is all done
22:16:11PMunchMaybe we'll got some more people interested in using Nim on microcontrollers :)
22:16:22PMunch@ElegantBeef, ooh nice!
22:16:28*filcuc_ joined #nim
22:16:29FromDiscord<Yardanico> and post it on sunday evening ETC
22:16:33FromDiscord<Yardanico> (edit) "ETC" => "EST"
22:16:37FromDiscord<Yardanico> for max hackernews points
22:16:58FromDiscord<ElegantBeef> Hey a fair bit of people starred the picotemplate/sdk repo, so already got some people interested
22:18:33PMunch@Yardanico, is that the best time?
22:18:47FromDiscord<Yardanico> some article from 2019 claims this
22:18:53FromDiscord<Yardanico> you better ask some people who know HN better than me :P
22:19:55PMunch@ElegantBeef, now they're almost too colourful
22:20:03FromDiscord<ElegantBeef> Jeez
22:20:10FromDiscord<ElegantBeef> Banned pmunch from playing linerino
22:20:15FromDiscord<dom96> just post it, if it doesn't hit the front page post again a few days later
22:20:18PMunchHaha :P
22:20:19FromDiscord<Yardanico> lol
22:20:29FromDiscord<Yardanico> just post it every day :)
22:21:22FromDiscord<Yardanico> @ElegantBeef why backspace instead of R to restart? 🤔
22:21:28FromDiscord<Yardanico> to not hit accidentally?
22:21:40FromDiscord<Yardanico> I mean reset
22:21:43FromDiscord<Yardanico> oh there's no key for that
22:21:51FromDiscord<ElegantBeef> `x`
22:21:58FromDiscord<Yardanico> undocumented
22:22:02FromDiscord<Yardanico> :D
22:41:38FromDiscord<Conifer> In reply to @ElegantBeef "Eh indentation wasnt cool": Yeah, I can only hope so. It was one of the reasons why I was thrown off from Python.↵↵I suppose I can assume one wouldn’t have much trouble even following some Python based projects and remake them in Nim without much of a sweat/issue.
22:41:43*lritter quit (Quit: Leaving)
22:41:56*filcuc_ quit (Read error: Connection reset by peer)
22:42:12*filcuc_ joined #nim
22:42:30*filcuc_ quit (Read error: Connection reset by peer)
22:42:42*filcuc_ joined #nim
22:43:57FromDiscord<Yardanico> people overestimate nim's similarness to python
22:44:12FromDiscord<Yardanico> nim has almost nothing in common with python except the indentation
22:45:40FromDiscord<dom96> Nim is a better Python
22:46:55FromDiscord<Yardanico> maybe, but still, advertising nim as compiled python is not a good idea
22:47:56*filcuc_ quit (Quit: Konversation terminated!)
22:48:05FromDiscord<checkersai> In reply to @Yardanico "people overestimate nim's similarness": True
22:48:12*filcuc_ joined #nim
22:48:32PMunchGoing back to Python from Nim it just feels so clunky now
22:50:02FromDiscord<ElegantBeef> what you dont like `\`?
22:50:04FromDiscord<Valor> how do i uninstall choosenim
22:50:13*filcuc_ quit (Read error: No route to host)
22:50:16FromDiscord<Valor> their gcc steupt is conflicting with my own
22:50:27*filcuc_ joined #nim
22:51:49FromDiscord<ElegantBeef> Should be as simple as removing it from your path, but am curious to what the interaction causing this issue is
22:52:10FromDiscord<Valor> choose nim is ...
22:52:13FromDiscord<Valor> not in my path
22:53:00FromDiscord<dom96> In reply to @Yardanico "maybe, but still, advertising": Why?
22:53:17FromDiscord<Yardanico> In reply to @dom96 "Why?": because it has much less similarities to python than people think
22:53:27FromDiscord<Yardanico> and if we advertise it as such, they'll think that it's "almost like" python
22:53:30FromDiscord<Yardanico> which it is totally not
22:53:37FromDiscord<Yardanico> it has been discussed on the forum a lot already
22:53:41FromDiscord<Valor> ok i think ill need to unintsall nim in general, how do i do that/
22:53:47FromDiscord<Valor> both nim and choose nim
22:54:02FromDiscord<dom96> @Valor if you installed via choosenim then: remove ~/.choosenim and ~/.nimble
22:54:21FromDiscord<ElegantBeef> Syntax aside how is it similar to python
22:54:26FromDiscord<dom96> In reply to @Yardanico "because it has much": it has enough similarities to warrant the comparison
22:54:30FromDiscord<Yardanico> a good quote from the forum:
22:54:32FromDiscord<Yardanico> That is, you shouldn't approach Nim as a "compiled, statically typed Python", but rather more as a "C/C++ replacement with modern syntax, package system, metaprogramming and much more". Essentially, Nim is not to Python what Crystal is to Ruby.
22:54:43FromDiscord<Yardanico> https://forum.nim-lang.org/t/4128#25718
22:55:31*filcuc_ quit (Quit: Konversation terminated!)
22:55:36PMunchHmm, the USB HID specification has a definition for a Golf club..
22:55:39FromDiscord<Valor> also to contribute to this convo, people are going to think it looks like python ... cuz it syntatically looks like pythn, lol
22:55:42*filcuc_ joined #nim
22:55:57FromDiscord<dom96> imports, exceptions, iterators and a lot of the syntax are enough similarities to make it usable as a "compiled python"
22:56:52FromDiscord<Yardanico> I'm not gonna argue any further, I get your point, but I still disagree :) sorry
22:57:31FromDiscord<dom96> The argument is "we shouldn't advertise it as a compiled Python"
22:57:37FromDiscord<dom96> I think we very much should
22:57:58FromDiscord<dom96> Even if we agree that the similarities are just on the surface
22:58:08FromDiscord<Yardanico> I don't like lying
22:58:21PMunchPorque no los dos?
22:58:51FromDiscord<dom96> There is at least one person that has found Nim because they were looking for a compiled Python (me)
22:58:52PMunchAdvertise it as a fast alternative to Python to Python people, and a more modern C++ to C++ people
22:58:59FromDiscord<dom96> so it's hardly a lie
22:59:13FromDiscord<dom96> and I bet you I'm not the only one
22:59:19FromDiscord<ElegantBeef> I mean advertise it as a statically typed compiled language with syntax reminiscent to python
22:59:33FromDiscord<fenrave> It arguably sets a bad standard to call the language something that it isn't trying to be simply because it shares similar syntax. Its not exactly a compiled python alternative as much as its a C/C++ alternative. Advertising a different goal to different people can lead to serious confusion and create an identity crisis within the language itself as it really wouldn't know what it wants to be.
22:59:51FromDiscord<Yardanico> araq said that he's writing his nim vision document :)
23:00:40*filcuc_ quit (Read error: Connection reset by peer)
23:00:42PMunchI mean I think we can all agree that we shouldn't advertise Nim as "compiled Python" then people will imagine it as Cython or something like that with 1:1 syntax and stdlib
23:00:43FromDiscord<dom96> Nim is definitely closer to Python than C/C++ in my eyes
23:00:52*filcuc_ joined #nim
23:00:59FromDiscord<Yardanico> @PMunch exactly
23:01:05FromDiscord<fenrave> Nython
23:01:06PMunchIt's closer to Python in syntax and "feel", but it's closer to C++ in speed and capabilities
23:01:18FromDiscord<ElegantBeef> A dynamically typed language that uses programmer contracts instead of actualy static safety?
23:01:20FromDiscord<Yardanico> We could call nim a compiled python if it was like crystal is to ruby, but it is totally not
23:01:27FromDiscord<dom96> PMunch: I just said that I think we should advertise it as a "compiled Python"...
23:01:46FromDiscord<dom96> So no, we can't all agree 😛
23:01:46PMunch@fenrave, all sorts of things are advertised differently to different groups of people. It's all about setting it a context they recognise and understand
23:02:07PMunchWell, then I disagree with you :P
23:02:31FromDiscord<ElegantBeef> I mean if someone said to me "Hey this is compiled python" i'd have went off on rant about how bad python is then stuck carrots in my ears walking down a hill to my death
23:02:32PMunchI thought you meant we should advertise it as a compiled replacement to Python, which I can agree with
23:02:36FromDiscord<dom96> That's fine, but you know, Rust and Golang are currently the languages filling the "compiled Python" niche
23:02:44PMunchI mean it isn't compiled python, calling it that would just be a lie
23:02:54FromDiscord<fenrave> Its a fair bit different, this is a programming language that needs to be something consistent and concise, not an identity crisis
23:03:02FromDiscord<dom96> Marketing is rarely 100% accurate
23:03:17FromDiscord<fenrave> Makes you wonder why so many people have ad blocks then
23:03:32PMunchYes but calling gasoline for frying oil isn't going to go down well..
23:04:06PMunchI don't think it would cause an identity crisis, just attract people who come at the language from different angles
23:04:10FromDiscord<dom96> It all depends how you do it
23:04:21FromDiscord<dom96> and attracting more people to the language is always a good thing
23:04:23PMunchI mean depending on what you do Nim can look very different
23:04:46FromDiscord<fenrave> It would really depend on people understanding that Nim isn't purely a python alternative and that its a compiled language first and foremost
23:04:53FromDiscord<fenrave> which i imagine they would
23:04:55PMunchI have a slide in one of my presentations that compares some low level C interfacing code to some high level web code. Barely looks like the same language
23:05:05FromDiscord<fenrave> programmers are smarter than other places where it would become a problem
23:05:46FromDiscord<dom96> yeah
23:05:50PMunchI mean it's all about getting people interested in learning Nim. And you do that by showing them that it can be used in place of whatever they are using at the moment for some kind of benefit
23:06:02FromDiscord<dom96> and "compiled Python" can mean different things to different people
23:06:13*filcuc_ quit (Read error: No route to host)
23:06:17PMunchIf a Pythonista is looking for speed and sees "This is how I sped up my Python program 4x by writing it in Nim" they are sure to check it out
23:06:30*filcuc_ joined #nim
23:07:26PMunchSimilarly if a C programmer sees an article with "This Nim code is 1/5th the size, the same speed, and easier to read than my C code" they might well be piqued to read it
23:08:40FromDiscord<dom96> I already see a lot of people writing "Have you checked out Nim?" to posts asking for a compiled Python
23:09:05FromDiscord<dom96> I think we can all agree that we shouldn't discourage people from doing this
23:09:12FromDiscord<dom96> That's all I want 🙂
23:10:14PMunchOh no, I'm fine with that
23:10:33PMunchAdvertising it to people looking for a compiled alternative to Python is a good idea
23:10:54PMunchAdvertising it as a compiled Python is a bad idea IMO
23:10:59*filcuc_ quit (Read error: Connection reset by peer)
23:11:12*filcuc_ joined #nim
23:11:34PMunchMaybe someone should write a "Nim is not compiled Python, and here's why that's a good thing"
23:12:08FromDiscord<ElegantBeef> I think it's akin to saying C# is a compiled JS, meanwhile they're fairly different aside from the C-style syntax
23:14:41FromDiscord<ElegantBeef> "compiled alternative to python" is less misinforming than "compiled python"
23:15:07FromDiscord<ElegantBeef> But anywho
23:15:15FromDiscord<ElegantBeef> People can do what they want i'm just a numpty
23:16:11*filcuc_ quit (Quit: Konversation terminated!)
23:16:23*filcuc_ joined #nim
23:21:21*filcuc_ quit (Quit: Konversation terminated!)
23:21:36*filcuc_ joined #nim
23:21:46FromDiscord<checkersai> In reply to @dom96 "Nim is definitely closer": The only similarity is the indentation-based syntax. Python is a dynamically typed interpreted language, and Nim is a statically typed, compiled language.
23:21:56FromDiscord<checkersai> In reply to @fenrave "programmers are smarter than": doubt
23:23:35FromDiscord<dom96> In reply to @checkersai "The only similarity is": Like I wrote above, those aren't the only similarities
23:24:39FromDiscord<dom96> Another example: tuples
23:26:08*filcuc_ quit (Ping timeout: 246 seconds)
23:28:26*Vladar quit (Remote host closed the connection)
23:28:45*leorize quit (Ping timeout: 240 seconds)
23:34:25*leorize joined #nim
23:49:38*krux02 quit (Remote host closed the connection)