<< 20-04-2022 >>

00:12:35*lumo_e quit (Quit: Quit)
00:15:02FromDiscord<Zoom> Nah, it's too late and I can't make it work. Looks like it wants `initFromJson` which would take `proc (x: Time): ZonedTime`
00:15:30FromDiscord<Elegantbeef> Define a hook for your object and use `parseTime` and `format` instead of the json parser
00:17:36FromDiscord<Zoom> Why not just a hook for DateTime?
00:17:45FromDiscord<Elegantbeef> Cause it'd override it globally
00:18:53FromDiscord<Zoom> What will override what? \:P
00:18:53FromDiscord<Elegantbeef> I mean you can of course do it but after first instantiation all hooks will use it
00:19:52FromDiscord<Elegantbeef> I mean it's a minor issue but the first usage of `toJson(dateTime)` will instantiate a version of the proc which will be used everywhere, so in theory you could have a library that defines it's own and expects it's own but doesnt use it
00:20:15FromDiscord<Elegantbeef> So then you break it's parser, i mean it's highly unlikey and you can just override the `DateTime` object
00:20:30FromDiscord<Elegantbeef> Just something to be cognisant about
00:21:23*Zectbumo quit (Remote host closed the connection)
00:22:18FromDiscord<Elegantbeef> You're probably fine to override it, just disregard me 😛
00:22:51FromDiscord<Zoom> Eh, not a problem, I guess. I can't make it parse a single DateTime field.
00:23:05FromDiscord<Elegantbeef> What?
00:30:34FromDiscord<!Patitotective> @huantian i-..i was downloading `feed.json` for all downloads... D:
00:30:54FromDiscord<huantian> Good job 👏
00:30:54FromDiscord<Elegantbeef> Smart
00:32:02FromDiscord<Zoom> [Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org) https://play.nim-lang.org/#ix=3VA3
00:32:15FromDiscord<Elegantbeef> You also need a tojsonhook
00:33:06FromDiscord<Elegantbeef> Oh wait no
00:33:13FromDiscord<Elegantbeef> you need to do `toJson` for jsonhooks
00:33:15FromDiscord<Zoom> Why and how can you understand it from the effing docs
00:33:35FromDiscord<!Patitotective> In reply to @huantian "Good job 👏": but now https://media.discordapp.net/attachments/371759389889003532/966134497844277268/Screenshot_from_2022-04-19_19-31-36.png
00:33:36FromDiscord<Elegantbeef> sorry it's `jsonTo`
00:33:44FromDiscord<Zoom> I don't wan't `to`, I want from \:D
00:34:13FromDiscord<huantian> I tried to understand std json then I gave up and used jsony
00:34:20FromDiscord<huantian> In reply to @Patitotective "but now": Niceeee
00:34:25FromDiscord<Elegantbeef> `to` doesnt work with Json hooks only `jsonTo` does
00:34:26FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3VA3
00:34:34FromDiscord<Elegantbeef> I mean stdlib json isnt that hard
00:34:58FromDiscord<Elegantbeef> if you dont need hooks you use `json` if you need hooks you use `jsonutils` and `jsonTo`/`toJson`
00:37:25FromDiscord<!Patitotective> can i display a svg using opengl?
00:38:26FromDiscord<Zoom> I don't get it still. And you linked the same link I sent here
00:38:41FromDiscord<Elegantbeef> replace `to` with `jsonTo`
00:38:50FromDiscord<Elegantbeef> Playground didnt upload it for whatever reason
00:40:41FromDiscord<huantian> reminder to remind [pmunch](https://matrix.to/#/@pmunch:fosdem.org) for playground thing
00:41:09FromDiscord<Zoom> Well, at least there was nothing in the docs that made it clear. Thanks Beef
00:41:56FromDiscord<Elegantbeef> "PRs Welcome"
00:42:44*vicfred quit (Quit: Leaving)
00:43:32FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/JDc
00:51:40*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
00:54:50FromDiscord<!Patitotective> beef, whats the non-monster way of finding where this fails? https://play.nim-lang.org/#ix=3VAb↵i want to modify pixie's code adding echos 💀 ↵(i mean, what makes it go here https://github.com/treeform/pixie/blob/master/src/pixie/fileformats/svg.nim#L602)
00:56:52FromDiscord<Elegantbeef> `echo getCurrentExceptionMessage()` before it raises
01:07:03FromDiscord<!Patitotective> seems like inkscape's svgs dont have `viewBoc` attr 😕
01:07:17FromDiscord<!Patitotective> may i create an issue? 🤔
01:07:33FromDiscord<Elegantbeef> I think you legally can yes
01:17:25FromDiscord<!Patitotective> https://github.com/treeform/pixie/issues/412 👀
01:18:43*hexeme is now known as ldlework
01:26:55FromDiscord<m4ul3r> I'm wanting to execute a bash shell command with `execCmdEx` and it stores the output as a return value. Is there a way I can have the output print to stdout while it is running in my nim program?
01:28:54FromDiscord<Elegantbeef> I'd say use `startProcess` then `waitForExit` and then do `myProcess.outputStream.readAll` to get the output
01:31:04FromDiscord<Elegantbeef> Actually nevermind
01:31:06FromDiscord<Elegantbeef> I'm dumb
01:37:38*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
01:40:53*Ekho- joined #nim
01:41:07*blackbeard420_ joined #nim
01:41:24*Ekho- is now known as Ekho
01:41:27*blackbeard420_ quit (Remote host closed the connection)
01:41:59*redj_ joined #nim
01:42:17*redj quit (Ping timeout: 272 seconds)
01:42:17*blackbeard420 quit (Ping timeout: 272 seconds)
01:43:18*redj_ is now known as redj
01:43:33*lumidify_ quit (Ping timeout: 272 seconds)
01:44:15*lumidify joined #nim
01:53:58FromDiscord<m4ul3r> No that's pretty helpful I've found this link https://forum.nim-lang.org/t/1886 and I might be able to adjust it that way.↵How do I use poEvalCommand as a process option with start process?
01:54:23FromDiscord<Elegantbeef> `options = {poEvalCommand}`
01:57:50FromDiscord<m4ul3r> Thank you, the `set[ProcessOption]` was confusing to me. I'll see if this works out
02:03:28FromDiscord<m4ul3r> I used the solution from that link, it feels janky, but it works. startProcess was the way. Thanks!
02:06:06*noeontheend quit (Ping timeout: 276 seconds)
02:13:57FromDiscord<Mike> Hey is there anything in the standard library that will generate an RFC 4122 UUID for me?
02:14:05FromDiscord<Mike> Can't seem to find anything
02:14:20FromDiscord<Elegantbeef> Dont think so
02:14:48FromDiscord<Elegantbeef> https://github.com/pragmagic/uuids/ does though
02:15:01FromDiscord<Elegantbeef> as does https://github.com/vtbassmatt/nim-uuid4
02:16:16FromDiscord<Mike> cool cool, both of those look good. Just thought it might be a standard library thing somewhere
02:16:21FromDiscord<Mike> Thank you
02:32:33FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VAA
02:35:42FromDiscord<Elegantbeef> This is why we statically type everything!
02:37:19FromDiscord<!Patitotective> i dont want to imagine what error id be getting if i still programmed in python
02:37:53FromDiscord<Elegantbeef> Tables were a mistake
02:38:33FromDiscord<!Patitotective> why? i thought you didnt like indexes
02:38:55FromDiscord<Elegantbeef> What?
02:39:41FromDiscord<!Patitotective> why are tables a mistake? :(↵they make my code easier to read
02:39:57FromDiscord<Elegantbeef> Tables are a dynamic
02:40:09FromDiscord<Elegantbeef> are dynamic\ 😄
02:40:27FromDiscord<!Patitotective> but what should i use instead? :[
02:40:43FromDiscord<Elegantbeef> I'm slightly kidding
02:40:54FromDiscord<Elegantbeef> What's the data though
02:40:59FromDiscord<Elegantbeef> I'd personally use an object where possible
02:41:58FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VAF
02:42:30FromDiscord<Elegantbeef> Ok so what's the point of a table here
02:44:11FromDiscord<!Patitotective> 🤔
02:44:12FromDiscord<!Patitotective> nvm
02:44:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VAG
02:44:27FromDiscord<Elegantbeef> There we go
02:44:59FromDiscord<Elegantbeef> And then really i'd usue an object variant and use `.to`
02:45:51FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/FVE
02:46:03FromDiscord<!Patitotective> but i could just use variables, right?
02:46:08FromDiscord<Elegantbeef> Ok so then return `("", "")`
02:46:16FromDiscord<Elegantbeef> Of course you can
02:46:48FromDiscord<!Patitotective> should i? 🤔
02:47:13NimEventerNew Nimble package! govee - A Nim wrapper for the Govee API., see https://github.com/nonimportant/nim-govee
02:47:21FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/8EE
02:47:31FromDiscord<Elegantbeef> Of course you should use something other then a table for variable aliasing
02:47:46FromDiscord<Elegantbeef> Tables are for well KVP data not silly "I dont know how to alias variables"
02:49:00FromDiscord<!Patitotective> KVP: kilovoltage peak? lmfao
02:49:10FromDiscord<Elegantbeef> Key value pair
02:50:20FromDiscord<!Patitotective> i dont understand how they made their website using this horribly inconsistent data↵https://appimage.github.io/feed.json
02:50:27FromDiscord<!Patitotective> why are there apps with no download link?
02:51:12FromDiscord<Elegantbeef> No clue
02:51:32FromDiscord<huantian> this is why Option[] exists!
02:51:49FromDiscord<Elegantbeef> Yep
02:52:04FromDiscord<Elegantbeef> You can represent your json data as an object then dont have anymanual parsing
02:52:30FromDiscord<!Patitotective> how? jsony or something?
02:52:35FromDiscord<Elegantbeef> stdlib
02:56:26*nsyd joined #nim
03:01:00FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3VAK @!Patitotective
03:01:01FromDiscord<Elegantbeef> there you go\\
03:01:08FromDiscord<Elegantbeef> QED no manual parsing
03:02:18FromDiscord<!Patitotective> :DDDDD↵Thanks 🙃
03:02:50FromDiscord<Elegantbeef> Also firefox's json renderer is fantastic
03:03:36FromDiscord<!Patitotective> In reply to @Elegantbeef "Also firefox's json renderer": ~~sublime = orange~~↵~~firefox = orange~~
03:04:04FromDiscord<huantian> In reply to @Elegantbeef "Also firefox's json renderer": Yesssss it’s so good
03:04:08FromDiscord<!Patitotective> In reply to @Elegantbeef "Also firefox's json renderer": just make sure to never click _Exapnd All (slow)_ with big data
03:04:10FromDiscord<huantian> You can even view response headers
03:04:16FromDiscord<!Patitotective> (edit) "_Exapnd" => "_Expand"
03:04:27FromDiscord<huantian> Without opening up dev tools
03:04:42FromDiscord<Elegantbeef> Anyway point is you dont need to manually navigate
03:16:50*arkurious quit (Quit: Leaving)
03:21:32FromDiscord<!Patitotective> now the final question, should i make `Option[Feed]` to detect when its not loaded? 💀
03:26:25FromDiscord<Yardanico> if you know that you'll never get an empty string in case it didn't load, you can just check for empty string :)
03:26:31FromDiscord<Yardanico> but if you want a "fancier" solution, then use Option
04:20:18*slowButPresent quit (Quit: leaving)
04:40:19*Zectbumo joined #nim
05:10:23*rockcavera quit (Remote host closed the connection)
05:13:35FromDiscord<kiell> anyone have recommendations for db libraries? im looking at allographer currently
05:13:49FromDiscord<Rika> ...what are you looking for
05:37:42FromDiscord<Solitude> In reply to @Elegantbeef "Also firefox's json renderer": seen jless?
05:53:27NimEventerNew post on r/nim by k8sguy: Nim Use Cases, see https://reddit.com/r/nim/comments/u7pjnf/nim_use_cases/
06:36:35*jjido joined #nim
06:36:56*fredrikhr joined #nim
06:48:07*PMunch joined #nim
07:25:14*gsalazar joined #nim
07:59:32NimEventerNew Nimble package! bamboo_websocket - This is a simple implementation of a WebSocket server with 100% Nim., see https://github.com/obemaru4012/bamboo_websocket
08:02:02FromDiscord<Rika> Oh cool
08:02:31FromDiscord<Rika> Why bamboo I do wonder though
08:03:49FromDiscord<Elegantbeef> Seems they're devs that love pandas
08:09:43*nsyd quit (Quit: WeeChat 3.5)
08:16:54FromDiscord<hmmm> hay broskis, is there a way to make a table to map some keys to procs or do I need to construct a giant if boat for every key
08:17:39FromDiscord<Rika> If the procs have the same signature
08:19:22FromDiscord<hmmm> they might. I have a list of keys a, b, c and will have aproc, bproc, cproc. I wanted to avoid making a giant, if a: aproc(thing), if b: ... etc
08:19:51FromDiscord<Rika> Well if they don’t then the if is the only simple way xdddd
08:20:02FromDiscord<hmmm> hehe
08:20:16FromDiscord<hmmm> and what if they had the same signature?
08:20:24FromDiscord<Elegantbeef> Array or table
08:20:34FromDiscord<hmmm> hmmm
08:20:59FromDiscord<hmmm> but I don't get how to activate the proc from the table
08:21:12FromDiscord<Elegantbeef> `myTable[myKey](myArgs)`
08:21:31FromDiscord<hmmm> oh thats cool
08:21:33FromDiscord<hmmm> I can do that?
08:21:34FromDiscord<Elegantbeef> Procs are procs in Nim there is nothing special just cause they're in a collection
08:21:51FromDiscord<Elegantbeef> No i lied to you since it'd be fun
08:21:53FromDiscord<Solitude> In reply to @hmmm "I can do that?": no, you cant
08:21:55FromDiscord<hmmm> haha
08:22:02FromDiscord<Rika> In reply to @Solitude "no, you cant": Lol
08:22:02FromDiscord<hmmm> beefy u ol doggy
08:22:13FromDiscord<Elegantbeef> I'm not even that old
08:22:26FromDiscord<Rika> Nah beef is like
08:22:27FromDiscord<Rika> 70
08:22:29FromDiscord<Rika> He’s pretty old
08:22:32FromDiscord<Elegantbeef> Give or take
08:24:01FromDiscord<hmmm> hmm I was wondering, is python able to do it with different signatures since they don't have restrictions on type? 🤔
08:24:35FromDiscord<Elegantbeef> You mean overloading?
08:24:37FromDiscord<Elegantbeef> No clue
08:24:42FromDiscord<Elegantbeef> Doubtful
08:24:45FromDiscord<hmmm> I mean mapping keys to procs
08:24:57FromDiscord<Elegantbeef> Probably
08:25:01FromDiscord<hmmm> hmm
08:25:22FromDiscord<Rika> Python does not have overloading
08:25:28FromDiscord<Elegantbeef> I mean you can do it in Nim relatively easily just not much reason to
08:25:46FromDiscord<hmmm> you would make the giant if construct beefy san?
08:25:51FromDiscord<Elegantbeef> `Table[KeyType, pointer]` is the easiest way of doing
08:25:54FromDiscord<Rika> Python doesn’t have mixed type issues because they only need to manage artist
08:25:56FromDiscord<Rika> Arity
08:26:10FromDiscord<Elegantbeef> You havent described the problem so no fucking clue
08:26:44FromDiscord<hmmm> hmm I don't even know, I'm starting a new thingy and trying to figure out how I want to set it up
08:27:11FromDiscord<Elegantbeef> So you have no clue what you're doing but know you need a event table
08:27:19FromDiscord<Elegantbeef> That makes like -10 sense
08:27:21FromDiscord<hmmm> lol, something like that
08:27:49FromDiscord<Elegantbeef> If it's a named event type thing i'd use an enum indexed array
08:28:00FromDiscord<Elegantbeef> Otherwise it'd use a table probably
08:28:30FromDiscord<hmmm> that sounds pretty cool, do you have a example of enum indexed array structure somewhere to look up
08:28:58FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/9106
08:32:55PMunchYou can do a little something like this: https://play.nim-lang.org/#ix=3VBq
08:33:54PMunchOr if you want to do it with a table: https://play.nim-lang.org/#ix=3VBr
08:34:06PMunch@hmmm, ^
08:34:09FromDiscord<Elegantbeef> Now do the untyped variant
08:34:34FromDiscord<Elegantbeef> where you cast it to a distinct pointer and use templates to get it back 😛
08:34:47FromDiscord<hmmm> wot is dis munchie {.nimcall.}
08:36:03FromDiscord<hmmm> anyway the table thingy was a big progess, didn't know you could do that
08:36:07PMunchnimcall is the default calling convention for Nim procedures, but when you place procedure signatures in something like an array Nim assumes it uses the closure calling convention. So we need to force it back to nimcall
08:48:36PMunchSomething like this @Elegantbeef? https://play.nim-lang.org/#ix=3VBy
08:49:12PMunchThat newIdentNode nonsense could easily be replaced with an initialiser
08:50:18FromDiscord<Elegantbeef> Interesting solution
08:51:38PMunchNice and type safe :)
08:52:21PMunchOnly works on compile-time though, so not sure how useful it would be :P
08:52:24FromDiscord<Rika> Not useful for
08:52:25FromDiscord<Rika> Yeah
08:52:32FromDiscord<Rika> Was going to say that
08:52:50FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3VBz the big boy solution 😛
08:53:06PMunchCould easily create a macro that took a non-static ProcEnum and a bunch of arguments and generated a case statement out of it
08:53:58FromDiscord<Rika> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=3VBz the big boy": Seems fragile to signature mismatches
08:54:13FromDiscord<Elegantbeef> of course
08:54:19FromDiscord<Elegantbeef> It's 100% typeless
08:55:16FromDiscord<hmmm> thats a big doggy solution, when I see nnk I know I should stay away for my sanity
08:56:14PMunchJust import macroutils and you can remove all the nnks :P
08:56:43FromDiscord<Elegantbeef> Or micros when it gets further 😛
09:03:55FromDiscord<Elias> sent a code paste, see https://paste.rs/o1R
09:04:10FromDiscord<Elegantbeef> clang is used for parsing the C code
09:04:12FromDiscord<Elegantbeef> So you need clang
09:04:17FromDiscord<Yardanico> yeah, as beef said
09:04:21FromDiscord<Elias> ok
09:04:28FromDiscord<Elegantbeef> More accurately you need libclang i think
09:04:54FromDiscord<Elegantbeef> Yea as yard said i said↵(@Yardanico)
09:05:12FromDiscord<Yardanico> Futhark also hasn't really been tested on Windows as per readme :)
09:05:17FromDiscord<Yardanico> PMunch does development on Linux
09:05:24FromDiscord<Elegantbeef> Eh people have used it there
09:05:33FromDiscord<Elegantbeef> And pmunch is here to bug 😛
09:05:36FromDiscord<Elias> In reply to @Yardanico "PMunch does development on": wise
09:05:40FromDiscord<Yardanico> ah yeah I see ". To install clang on Windows you need to install LLVM (you probably want to grab the LLVM-13.0.1-win64.exe version)."
09:05:45FromDiscord<Yardanico> https://releases.llvm.org/download.html
09:05:59FromDiscord<Yardanico> https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.1
09:06:07FromDiscord<Yardanico> https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/LLVM-13.0.1-win64.exe
09:06:35FromDiscord<Elias> Thanks, think Ill make a script for this
09:07:36PMunchYeah Futhark on Windows is a bit wonky, it works, but paths are apparently a nightmare..
09:07:59PMunchI need to find someone who knows enough Windows and Nim to help me test it on Windows :P
09:09:19FromDiscord<Elias> Ok, for now Ill just add the extra setup to my python script that manages my project
09:09:37PMunch@Elegantbeef, @Rika, @hmmm, here we go: https://play.nim-lang.org/#ix=3VBB
09:09:55PMunchNow it has runtime support though the `call` macro
09:10:30FromDiscord<Elegantbeef> Cmon pmunch merge ours together
09:19:26FromDiscord<untoreh> sent a code paste, see https://paste.rs/yTw
09:20:03FromDiscord<Elegantbeef> You dont have a type annotation
09:20:03PMunch@Elegantbeef, but yours is unsafe :P
09:20:28FromDiscord<Elegantbeef> I more meant using `()` and `[]`
09:21:22PMunchAh right, instead off call let it use a distinct type and some overloading of `()`
09:21:56FromDiscord<Elegantbeef> Seems threadvar does not work pushed on variables
09:28:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VBG
09:29:51FromDiscord<untoreh> I did write a macro for it, but yours seems a little better 😛
09:30:10FromDiscord<Elegantbeef> Goooood
09:47:18*Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected])
09:54:00*jmdaemon quit (Ping timeout: 248 seconds)
09:54:40NimEventerNew post on r/nim by Familiar_Ad_8919: what nim needs to grow in popularity, see https://reddit.com/r/nim/comments/u7sv4c/what_nim_needs_to_grow_in_popularity/
10:07:31FromDiscord<Elias> In reply to @Elias "Hello. I tried installing": In the end of this output, nimble asks me wether I want to pull the latest from master since the futhark build failed. Is there a switch to disable prompts? (working on my script)
10:10:17PMunchThere is -n and -y
10:10:30PMunchWhich says no and yes to all prompts respectively
10:10:39PMunchAnd there is of course --help which tells you that
10:13:30*xet7 joined #nim
10:15:13FromDiscord<SirElephant> will nim ever get mainstream??
10:15:29FromDiscord<Solitude> yes
10:15:56FromDiscord<Elias> In reply to @PMunch "And there is of": Thanks, should have read more carefully...
10:16:49FromDiscord<dom96> In reply to @SirElephant "will nim ever get": how do you define "mainstream"?
10:16:54FromDiscord<dom96> You could say Nim is already mainstream
10:17:01PMunch@Elias, easy enough to miss :P
10:17:34FromDiscord<SirElephant> In reply to @dom96 "how do you define": like more popular and used in big tech companies
10:17:38FromDiscord<konsumlamm> In reply to @dom96 "You could say Nim": with a very weird definition if mainstream
10:17:46FromDiscord<dom96> In reply to @konsumlamm "with a very weird": 😄
10:17:46FromDiscord<SirElephant> just like rust
10:19:20FromDiscord<dom96> So I would say Nim is mainstream in the developer consciousness, I am always surprised how many people have heard of it. What's missing is indeed adoption. But hey, at least we're not completely unknown 🙂
10:20:01*xet7 quit (Remote host closed the connection)
10:20:31*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:21:07PMunchdom96, that's how it starts. People know about it, now people can try to begin using it without sounding like a crazy person
10:23:11FromDiscord<dom96> exactly
10:27:39FromDiscord<SirElephant> In reply to @dom96 "So I would say": oke
10:30:24FromDiscord<Elias> I find it fun to code in "not mainstream" languages. I often look up a new programming language when I start a project for the fun of learning something new (documentation is a must). But, beeing a more "mainstream" language has its advantages yes. But, again it depends on the definition of mainstream, hehe.
10:32:10FromDiscord<Asbjørn F> I mean I'm trying to sneak in Nim scripts at our org 👀
10:46:17FromDiscord<Elias> nice
10:46:58FromDiscord<SirElephant> i installed nim rn
10:47:06FromDiscord<SirElephant> i extracted the zip file
10:47:16FromDiscord<SirElephant> ran the `nim.exe`
10:47:40FromDiscord<SirElephant> but The term 'nim' is not recognized as a name of a cmdlet, function, script file, or executable program.↵Check the spelling of the name, or if a path was included, verify that the path is correct and try ↵again.
10:47:50FromDiscord<Yardanico> have you added Nim to your system PATH?
10:47:51FromDiscord<Rika> You don’t have the compiler in your path?
10:47:56FromDiscord<SirElephant> (edit) "`nim.exe`" => "`finish.exe`"
10:48:00FromDiscord<SirElephant> idk
10:48:03FromDiscord<Elias> did you run the setup thing?
10:48:11FromDiscord<SirElephant> it had and option to add it to the PATH
10:48:14FromDiscord<Elias> it fixes stuf
10:48:16FromDiscord<Yardanico> @SirElephant also, you have to restart the shell after doing this
10:48:18FromDiscord<Yardanico> to update PATH
10:48:21FromDiscord<Yardanico> i mean restart the cmd
10:48:25FromDiscord<Elias> (edit) "stuf" => "stuff"
10:48:26FromDiscord<SirElephant> not working
10:48:35FromDiscord<Yardanico> try executing finish.exe from the command line to see what it says
10:48:36FromDiscord<SirElephant> wait lemme check
10:48:54FromDiscord<SirElephant> In reply to @Yardanico "try executing finish.exe from": ok
10:49:34FromDiscord<SirElephant> Should it be added to your PATH permanently?
10:49:37FromDiscord<SirElephant> y or n
10:49:51FromDiscord<Yardanico> well, make a guess :P
10:49:52FromDiscord<Yardanico> it's y
10:49:59FromDiscord<SirElephant> not worjing
10:50:08FromDiscord<Yardanico> restarted the cmd afterwards I assume? not sure then
10:50:12FromDiscord<SirElephant> ye
10:50:12FromDiscord<Yardanico> where did you unpack it?
10:50:17FromDiscord<SirElephant> downloads
10:50:23FromDiscord<Yardanico> the whole thing or just finish.exe ?
10:50:29FromDiscord<SirElephant> In reply to @Yardanico "the whole thing or": everything
10:50:56FromDiscord<Yardanico> i mean there's a small chance there can be a problem if your windows username has spaces or is non-ascii, try using some folder that is only ASCII chars without spaces
10:51:00FromDiscord<Yardanico> like C:/nim
10:51:05FromDiscord<Yardanico> but maybe something else
10:51:26FromDiscord<SirElephant> hmmm
10:51:31FromDiscord<SirElephant> i am confused as hell
10:51:46FromDiscord<Yardanico> create C:/nim, unpack the archive to there, and run finish.exe from there
10:51:52FromDiscord<SirElephant> oke
10:52:04FromDiscord<SirElephant> is it ok if i just copy it?
10:52:08FromDiscord<Yardanico> yes
10:52:43FromDiscord<Yardanico> also just to be sure check if you actually have `nim.exe` in `bin` folder of the nim installation, because there can be cases where antiviruses detect it (or nimble or finish.exe) as a false positive and delete
10:52:59FromDiscord<SirElephant> bin foldr?
10:53:02FromDiscord<Yardanico> yes
10:53:09FromDiscord<SirElephant> it is not in it
10:53:12FromDiscord<Yardanico> huh?
10:53:22FromDiscord<SirElephant> sory it is
10:53:24FromDiscord<SirElephant> heheh
10:53:32FromDiscord<SirElephant> got confused with finish and nim
10:53:35FromDiscord<SirElephant> lol
10:56:05*wybpip[m] joined #nim
10:56:06*wybpip[m] left #nim (#nim)
10:57:52FromDiscord<dom96> In reply to @Asbjørn F "I mean I'm trying": I've sneaked Nim into Meta 😄
11:00:30FromDiscord<dom96> It wasn't just me either. But getting it into production is a different ball game.
11:17:01FromDiscord<demotomohiro> Environment variables including `PATH` are per process status and they are not automatically updated until you restart processes. You can see envionment variables from shell with `echo $PATH` on linux or `echo %PATH%` on windows.
11:18:22FromDiscord<demotomohiro> It just print the value of the envionment variable of that process.
11:20:50FromDiscord<hmmm> broskis how do I extract multiple things from a table, like for example all the keys that start with "abc"
11:22:48FromDiscord<demotomohiro> sent a code paste, see https://paste.rs/fDQ
11:23:01FromDiscord<hmmm> demo ty 😊
11:28:52*kayabaNerve_ is now known as kayabaNerve
11:29:06*xet7 joined #nim
11:36:02PMunchdom96, I snuck Nim into production at my job :P
11:36:33PMunch@SirElephant, did you get it working?
11:46:10arkanoidI also have some simple nim programs running in production at work
11:48:31arkanoidI'd have more if GUI would be easy to add for windows.
11:49:18FromDiscord<Yardanico> isn't it though? with wnim
11:49:24FromDiscord<Yardanico> it's windows only, but if that's what you need it should work well enough
11:49:25arkanoidAll options seems one-man projects doomed to bitrot
11:49:44FromDiscord<Yardanico> that's kind of a weird way to judge projects by :)
11:49:59arkanoidWell, bus factor is a thing
11:50:14FromDiscord<Yardanico> you can say the same for Nim, no major difference
11:50:29FromDiscord<Yardanico> so why are you still using nim? :)
11:50:51arkanoidWould you buy a car made by a single artisan who is 70 years old?
11:51:28FromDiscord<Yardanico> my point is that nim's bus factor is also extremely low compared to more "mainstream" languages
11:51:45arkanoidWell, nim itself is not bus factor 1. At least this is what I feed. Not sure about the real amount, but I guess between 3 and 10
11:51:55FromDiscord<Phil> I mean, I'm only using it for free-time-products for a reason.
11:51:58FromDiscord<Yardanico> yes, but isn't that also extremely low @arkanoid
11:52:12FromDiscord<Phil> (edit) "free-time-products" => "free-time-projects"
11:52:36arkanoidIt is, but there's a 800% difference between GUI lib and nim+stdlib
11:52:49*jjido joined #nim
12:07:41FromDiscord<Phil> Got to become Araq Assassing proof
12:07:47FromDiscord<Phil> (edit) "Assassing" => "Assassin"
12:13:30*xet7 quit (Remote host closed the connection)
12:14:31*xet7 joined #nim
12:16:35NimEventerNew question by congusbongus: Check if a string ends with something, case insensitive?, see https://stackoverflow.com/questions/71939488/check-if-a-string-ends-with-something-case-insensitive
12:19:12*slowButPresent joined #nim
12:26:11FromDiscord<ratapenado> Sorry but what's a bus factor ?
12:26:41FromDiscord<Phil> Colloquial for "how many people can get rolled over by a bus before nobody else can work anymore"
12:27:06FromDiscord<Phil> Basically, if dom and Araq go on a drinking tour and an evil bus assassin manages to get them both, the nim language as a whole has a problem.
12:27:11FromDiscord<ratapenado> Ha ok
12:27:16*fredrikhr quit (Read error: Connection reset by peer)
12:27:28FromDiscord<ratapenado> Yeah that's the problem with small languages
12:28:11FromDiscord<Phil> Though I think just Araq himself getting rolled over might already be enough
12:40:41*rockcavera joined #nim
12:40:41*rockcavera quit (Changing host)
12:40:41*rockcavera joined #nim
12:45:11FromDiscord<Solitude> nah
12:46:11*xet7 quit (Remote host closed the connection)
12:52:13FromDiscord<Yardanico> In reply to @Isofruit "Basically, if dom and": dom doesn't do much nim stuff anymore :)
12:52:28FromDiscord<Yardanico> nowadays it's xflywind and timo (although timo has been absent from nim for a few months)
12:54:15FromDiscord<SirElephant> @Yardanico not working bruh
12:54:29FromDiscord<SirElephant> I can use nimble but not nim
12:57:00FromDiscord<Solitude> In reply to @SirElephant "I can use nimble": try harder, nim runs on determination
12:58:10FromDiscord<SirElephant> In reply to @Solitude "try harder, nim runs": Sorry?
12:58:28PMunch@SirElephant, it sounds like it might be your antivirus falsely detecting Nim as a virus and silently deletes it
12:58:47FromDiscord<SirElephant> Yup i always get the message
12:58:57FromDiscord<SirElephant> Might be the case
12:59:03PMunch"The message"?
12:59:17FromDiscord<SirElephant> Eit?
12:59:25FromDiscord<SirElephant> (edit) "Eit?" => "Wut?"
12:59:49PMunchYou said you always get "the message"
12:59:52PMunchWhich message?
13:01:15*Zectbumo quit (Remote host closed the connection)
13:03:28FromDiscord<SirElephant> The microst defenders message
13:03:38FromDiscord<SirElephant> (edit) "microst" => "microsoft"
13:03:38FromDiscord<Yardanico> well that's exactly what it is then
13:03:40FromDiscord<Yardanico> i asked you before
13:03:45FromDiscord<SirElephant> Hmmm
13:03:49FromDiscord<Yardanico> defender is detecting nim.exe as a false positive and deleting it
13:04:16FromDiscord<SirElephant> https://c.tenor.com/0C0NcvbECMEAAAAM/bruh-bruh-meme.gif
13:06:38PMunchYardanico, did you ask them?
13:06:55FromDiscord<Yardanico> not the direct way, so it's part my fault
13:06:56FromDiscord<Yardanico> "also just to be sure check if you actually have nim.exe in bin folder of the nim installation, because there can be cases where antiviruses detect it (or nimble or finish.exe) as a false positive and delete"
13:07:03PMunchI looked at your conversation earlier to see if I should suggest it, that's why I asked if they got it working
13:07:12PMunchAh right
13:07:35FromDiscord<SirElephant> how is a `bot` having a human-like conversation??
13:07:46FromDiscord<Yardanico> it's not a "bot", that's just because discord always shows webhooks this way
13:07:50FromDiscord<Yardanico> they are people from IRC or Matrix
13:07:53FromDiscord<Yardanico> bridged to here
13:08:41FromDiscord<SirElephant> so should i stop windows defender and then try it???
13:09:45FromDiscord<Yardanico> it will work, but instead you should just add C:\nim to your defender exclusion list
13:09:51FromDiscord<Yardanico> so it won't delete nim after you turn it back on
13:10:19FromDiscord<ratapenado> In reply to @SirElephant "so should i stop": Can't you just white list the directory ?
13:10:32FromDiscord<dom96> In reply to @PMunch "<@132595483838251008>, I snuck Nim": Nice!
13:10:33FromDiscord<SirElephant> In reply to @ratapenado "Can't you just white": how do i do dees
13:10:50FromDiscord<Yardanico> open defender (windows security) -> virus & threat protection -> virus & threat protection settings -> manage settings -> scroll to the bottom and "add or remove exclusions"
13:10:56FromDiscord<Yardanico> and then add the folder with nim
13:11:02PMunchdom96, now I'm switching jobs, will be interesting to onboard someone else into this project
13:11:27FromDiscord<Yardanico> although i'm rather surprised it's nim.exe that's getting detected and not nimble.exe
13:11:56FromDiscord<dom96> In reply to @PMunch "<@132595483838251008>, now I'm switching": cool, whereabouts you off to? You can share in DM if you're not comfortable here 🙂
13:12:22PMunchIt's a Norwegian company called Bouvet. Consulting work
13:12:35PMunchTrying something new :)
13:13:49FromDiscord<SirElephant> ok @Yardanico i did it
13:14:02FromDiscord<SirElephant> no should i run the finish.exe again?
13:14:14FromDiscord<Yardanico> you should copy nim into that folder
13:14:28FromDiscord<SirElephant> which nim?
13:14:31FromDiscord<dom96> PMunch: nice, more opportunity to push Nim at different places 😄
13:14:32FromDiscord<SirElephant> what nim?
13:14:59FromDiscord<SirElephant> i just added the folder with all the "stuff"
13:15:21FromDiscord<SirElephant> to the exclusion
13:15:28PMunchdom96, hopefully. I've been able to use it a little bit here, hopefully I'm not forced to do everything in C# or something like that..
13:16:10PMunchTime will tell, if not I guess I have to start my own company :P
13:28:30FromDiscord<Zoom> So, you're getting a job and aren't sure what language you'll have to use?↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
13:31:41*wyrd quit (Remote host closed the connection)
13:32:10PMunch@Zoom, well, kinda
13:32:28PMunchIt depends on the customers requirements what we would be allowed to use
13:34:07*arkurious joined #nim
13:36:56*wyrd joined #nim
13:38:06FromDiscord<Zoom> If I auditioned for a band and didn't know what instrument I'll be playing (and when), I'd ask triple pay \:P
13:38:50FromDiscord<Zoom> On the second thought, I got to jam on the same conditions for a half pint of beer.
13:39:57PMunchWell if you auditioned for a band and you know the flute, drums, and piano and they said you'd be allowed to use either of those, but they weren't sure how much of each it's a bit of a different scenario
13:40:12PMunchIt's not like they'll randomly assign me to a Cobol project :P
13:42:58FromDiscord<Zoom> Sure, I'm just kidding.
13:55:10*PMunch quit (Quit: Leaving)
14:00:29*rockcavera quit (Remote host closed the connection)
14:06:10FromDiscord<Zoom> Is it possible to make a hook for an object field with a basic type while parsing json? I tried to do it via type aliasing/distinct, but the hook doesn't catch.
14:29:46FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VCB
14:29:59FromDiscord<hmmm> broskis if I define an enum north sud ovest est and I get a string "west" how do I convert to the enum
14:30:02FromDiscord<Knedlik> I think it's a native Nim thing, that's why I'm asking here
14:31:30FromDiscord<demotomohiro> @Knedlik https://nim-lang.org/docs/manual.html#types-tuples-and-object-types
14:31:41FromDiscord<Knedlik> Thanks
14:32:11FromDiscord<Knedlik> Oh, so it's basically like class variables?
14:32:12FromDiscord<Solitude> In reply to @hmmm "broskis if I define": give up
14:32:19FromDiscord<hmmm> oh 😦
14:32:38FromDiscord<hmmm> I can't 😊
14:33:04FromDiscord<Solitude> if your "west" is attached to enum already you can just parseEnum it
14:33:13FromDiscord<hmmm> parseEnum! perfect
14:33:35FromDiscord<Solitude> you know that you can write the code yourself by using logic?
14:33:58FromDiscord<Solitude> like, the solution is already in your question
14:34:07FromDiscord<hmmm> hmm
14:34:42FromDiscord<Zoom> [hmmm](https://matrix.to/#/%40_discord_887269570765791243%3At2bot.io) https://play.nim-lang.org/#ix=3VCC
14:35:35FromDiscord<hmmm> zoom do I really need to dirty the enum definition 😦
14:35:47FromDiscord<Solitude> dirty?
14:35:58FromDiscord<Zoom> [Solitude](https://matrix.to/#/%40_discord_104136074569211904%3At2bot.io) c'mon, you can't write code in Logic, it's a apple's DAW
14:36:20FromDiscord<Zoom> You can write beautiful anthems to your intellectual superiority, though
14:36:30FromDiscord<Solitude> In reply to @Zoom "[Solitude](https://matrix.to/#/%40_discord_10413607": i bet tere is some esolang that uses midi events
14:36:41*oprypin quit (Remote host closed the connection)
14:38:08FromDiscord<Knedlik> Just another question - does anyone have experience with the nim classes library?
14:38:25FromDiscord<Knedlik> I'm not sure if they can be interused with tuples
14:38:35*PMunch joined #nim
14:39:25*oprypin joined #nim
14:44:00*PMunch quit (Ping timeout: 276 seconds)
14:44:24*PMunch joined #nim
14:44:45FromDiscord<SolitudeSF> im not arrogant, just permenently mad
14:44:46FromDiscord<Zoom> I, on the other hand, can't trim and parse a f\ng json from a JString to an int.
14:44:47FromDiscord<Zoom> I don't understand what's the problem. You still can use ifs and cases and comparisons and manually parse strings to whatever you like↵(@hmmm)
14:44:47FromDiscord<SolitudeSF> is bridge down?
14:44:47FromDiscord<SolitudeSF> im not arrogant, just permanently mad
14:45:22PMunch@SolitudeSF, I can see what you type in IRC-land
14:46:07FromDiscord<Solitude> its up again
14:46:11FromDiscord<Solitude> matrix and reliability
14:47:18nrds<Prestige99> I hope it gets better.. someday
14:50:33FromDiscord<hmmm> In reply to @Zoom "I don't understand what's": nu I tried your solution and it works perfectly so I'm comfy, ty zoom 😊 I was half expecting some facility like $ for stringify. I see python has something like MyEnum("something")
14:51:19FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3VCG
14:51:47FromDiscord<Zoom> There is `$` for enums, what you asked for works in a reverse direction, though.↵(@hmmm)
14:51:56FromDiscord<hmmm> OH
14:52:06FromDiscord<hmmm> 😅
14:53:08FromDiscord<exelotl> sent a code paste, see https://paste.rs/WtE
14:53:55FromDiscord<sOkam!> sent a code paste, see https://paste.rs/pI4
14:54:14FromDiscord<exelotl> yes, they can't change over the course of the loop though
14:54:28FromDiscord<sOkam!> wdym?
14:55:34FromDiscord<exelotl> sent a code paste, see https://paste.rs/S4i
14:55:48FromDiscord<sOkam!> oh! didn't think about that, true
14:55:54FromDiscord<exelotl> (this would be very confusing though, so not recommended anyways)
14:55:57FromDiscord<sOkam!> will keep that in mind
14:56:11FromDiscord<sOkam!> I wonder why c2nim doesn't do that by default already. its so much simpler
14:56:16FromDiscord<sOkam!> (or it seems)
14:56:37FromDiscord<sOkam!> can you iterate over `cint` instead? I wonder if that's why
14:56:49FromDiscord<exelotl> parsing C is pretty hard and it would take extra work to identify that special case and convert it to a clean `for` loop
14:56:56FromDiscord<exelotl> (edit) "parsing C is pretty hard and it would take extra work to identify that special case and convert it to a clean ... `for`" added "Nim"
14:57:05FromDiscord<sOkam!> i see
14:57:22*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:57:45FromDiscord<exelotl> which I guess isn't worth it since `c2nim` is primarily for generating bindings from header files, not for translating the actual source code of a library
14:58:07FromDiscord<sOkam!> good point, that would explain it
14:58:19FromDiscord<sOkam!> im using it for the latter, so there is the friction explained
15:03:03FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3VCQ
15:04:33FromDiscord<Solitude> In reply to @sOkam! "Would this work correctly?": `for it in 0..<a.cint`
15:05:24FromDiscord<sOkam!> In reply to @Solitude "`for it in 0..<a.cint`": that makes both the range and the `it` variable have :cint type, right?
15:05:28FromDiscord<Knedlik> Hmmm, guys I have a question about the tuples - what exactly are they? I know they are objects, but is there something else which if I passed as a parameter, would be the same (ignoring type naming)?
15:05:54FromDiscord<Solitude> In reply to @sOkam! "that makes both the": there are no range, that makes ..< iterator yield cints
15:06:13FromDiscord<sOkam!> kktyty 🙂
15:06:14FromDiscord<huantian> Tuples aren’t actually objects
15:06:39FromDiscord<huantian> They’re an ordered and optionally named collection of values
15:07:09FromDiscord<huantian> All tuples with the same types are equivalent so you don’t have type safety
15:07:47FromDiscord<huantian> They’re used mostly for returning multiple values from a function, since you can easily use tuple unpacking to assign the values to variables
15:08:16FromDiscord<Knedlik> So just that variable-type array I can't remember the name of
15:08:32FromDiscord<Solitude> In reply to @huantian "All tuples with the": not if they're named
15:09:42FromDiscord<Knedlik> In reply to @Knedlik "So just that variable-type": Found it, so it's just a sequence?
15:10:21FromDiscord<Solitude> In reply to @Knedlik "Found it, so it's": no, its variable-type array
15:11:08NimEventerNew thread by Daef: Static binaries, see https://forum.nim-lang.org/t/9119
15:11:52FromDiscord<Knedlik> I remembered the wrong word, I don't like this
15:12:24*noxnivi joined #nim
15:12:32noxnivigood day
15:17:27FromDiscord<sOkam!> sent a code paste, see https://paste.rs/LKe
15:17:35*noxnivi quit (Remote host closed the connection)
15:18:04FromDiscord<sOkam!> instinct tell me its wrong, but super lost on how to do it 🤔
15:18:31FromDiscord<huantian> i..condition
15:19:44FromDiscord<sOkam!> In reply to @huantian "i..condition": is `i+1..condition` correct?
15:20:15FromDiscord<sOkam!> might be understanding the C loop wrong
15:22:01*jjido joined #nim
15:22:14FromDiscord<Generic> the equivalent Nim codet to the above C code would be
15:23:06FromDiscord<Generic> so yeah
15:23:09FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=3VCT
15:23:30FromDiscord<sOkam!> ty 🧡
15:29:51FromDiscord<sealmove> hello guys
15:30:42FromDiscord<sealmove> what's an easy way to create a structure that support cyclic arithmetic?
16:13:34FromDiscord<Knedlik> ummm... guys what does error `cannot open file: sdl2/sdl` mean when building?
16:24:11PMunch@sealmove, cyclic arithmetic?
16:24:37*v9fk left #nim (WeeChat 3.5)
16:24:47*v9fk joined #nim
16:25:11FromDiscord<sealmove> for example have a range, say 0..5 and `3 + 8` should return `1`
16:25:19FromDiscord<sealmove> (edit) "0..5" => "`0..5`"
16:25:41FromDiscord<sealmove> instead of manually doing `mod`, the structure should handle it
16:26:46PMunchAaah I see
16:27:00PMunchCreate an object with a static generic range field perhaps?
16:27:07PMunchAnd then overload math operations on it
16:43:16FromDiscord<Generic> a distinct int type would work too
16:45:31Amun-Raand numeric literal too
16:46:51*gsalazar quit (Ping timeout: 276 seconds)
16:51:53*pro joined #nim
16:54:33FromDiscord<Rika> It’s usually called modular arithmetic
17:06:06FromDiscord<hmmm> broskybros when using sets instead of if thingy1 in [set] and thingy2 in [set] is there some way of doing if thing1, thingy2 in [set]
17:08:05FromDiscord<Solitude> In reply to @hmmm "broskybros when using sets": https://nim-lang.org/docs/system.html#%3C%3D%2Cset%5BT%5D%2Cset%5BT%5D
17:09:05FromDiscord<hmmm> 😱
17:09:08FromDiscord<hmmm> genius solibro
17:09:47PMunchHmm, I have an epoch time, what's the best way to convert this to an hour/minute string
17:10:24FromDiscord<Yardanico> fromUnix ?
17:10:38FromDiscord<Yardanico> if you don't care about timezones and stuff
17:11:31FromDiscord<Rika> or you could just mod 60 and whatever since 0 seconds is 12mn
17:12:03FromDiscord<Yardanico> `fromUnix(1650474646).format("HH:mm")` is the naive basic solution
17:15:48FromDiscord<exelotl> In reply to @Solitude "https://nim-lang.org/docs/system.html#%3C%3D%2Cset%": lol, I've been writing `foo {flagA, flagB} == {flagA, flagB}` like a fool all this time
17:16:53FromDiscord<Rika> wtf is < for bool??
17:17:30FromDiscord<exelotl> well, more often I end up with like `hit {cfMirror, cfSolid} != {}` as in "does `hit` contain `cfMirror` or `cfSolid`?"
17:18:18FromDiscord<Solitude> !eval echo false < true
17:18:21NimBottrue
17:18:31FromDiscord<Rika> yes but whats the point is my meaning
17:18:43FromDiscord<Solitude> uhhhhhhhhhhhh ummmmmmmmmmmmmmmmmmmmmmm
17:18:56FromDiscord<Solitude> well, booleans are ordinals
17:19:14FromDiscord<Solitude> just to be complete for generics
17:19:30FromDiscord<Rika> ig for sorting
17:19:36FromDiscord<Rika> still would call it cursed though
17:19:40*rockcavera joined #nim
17:19:40*rockcavera quit (Changing host)
17:19:40*rockcavera joined #nim
17:19:57FromDiscord<exelotl> it would be more effort to make `<` _not_ work for `bool`
17:20:13FromDiscord<exelotl> since it's literally an `enum true, false`
17:20:25FromDiscord<exelotl> (edit) "true, false`" => "false, true`"
17:21:31FromDiscord<exelotl> or at least it's an enum in a trenchcoat, https://media.discordapp.net/attachments/371759389889003532/966388153818685480/Screenshot_from_2022-04-20_18-21-25.png
17:22:13FromDiscord<exelotl> wait that's not how that idiom works
17:22:52FromDiscord<exelotl> it's... a compiler magic in an enum-shaped trench coat :P
17:24:47FromDiscord<Solitude> In reply to @exelotl "or at least it's": wow, i didnt even know it had normal body beyond magic
17:31:30PMunchDamn it..
17:31:52PMunchThis is a 32-bit machine, so parseInt isn't able to parse the epoch time..
17:33:18FromDiscord<Yardanico> In reply to @PMunch "This is a 32-bit": parseBiggestInt ?
17:33:27FromDiscord<Yardanico> or is it somewhere in the stdlib? then it's a bug
17:33:52PMunchOooh, parseBiggestInt might work
17:34:02PMunchI was looking for parseInt64 or something like that
17:34:08FromDiscord<Yardanico> yeah biggestint is for that
17:40:17*pro quit (Quit: pro)
17:42:38*xet7 joined #nim
17:57:44*jmdaemon joined #nim
17:58:52*vicfred joined #nim
18:18:41*neceve joined #nim
18:36:12FromDiscord<Knedlik> Hey guys, can someone help me with the error `invalid package name sdl2_nim-head`?
18:36:48FromDiscord<Rika> what did you do to get the error
18:36:58FromDiscord<Knedlik> I tried to build my game
18:37:14FromDiscord<Rika> yes, how
18:37:43PMunchhyphens aren't allowed in package names are they?
18:37:47FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VDE
18:38:07FromDiscord<Rika> no they arent
18:38:14FromDiscord<Rika> what is that file's contents
18:38:18FromDiscord<Rika> `import sdl2_nim-head` is wrong
18:38:24FromDiscord<Knedlik> Of main.nim?
18:38:25FromDiscord<Rika> `import sdl2_nim`
18:38:34FromDiscord<Rika> yeds
18:38:35FromDiscord<Rika> (edit) "yeds" => "yes"
18:39:00FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VDF
18:39:36FromDiscord<Knedlik> Hmmm, I actually have a mistake there I think
18:39:37FromDiscord<Rika> and the other files?
18:41:25FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VDG
18:42:17FromDiscord<Knedlik> and actually I found another mistake, which once again shouldn't affect this
18:42:41FromDiscord<Rika> do you have a nimble file
18:42:52FromDiscord<Rika> though that shouldnt matter
18:42:58FromDiscord<Rika> are these all of the files you've made
18:43:13FromDiscord<Knedlik> Yes, those and my bat files
18:43:30FromDiscord<Knedlik> everything else is just godot-nim bindings and data
18:43:54FromDiscord<Rika> what are your bat files? just the nim c commands
18:43:55FromDiscord<Rika> ?
18:44:13FromDiscord<Knedlik> build for debug and for release, then a dependency downloader
18:44:34FromDiscord<Rika> dependency downloader commands are
18:44:56FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VDJ
18:46:06FromDiscord<Rika> nimgame2's nimble file is malformed `requires "sdl2_nim#head"` should be `requires "sdl2_nim@#head"`
18:48:51FromDiscord<Knedlik> What should I do to change it with effect?
18:49:28FromDiscord<Knedlik> I changed it and it's still the same
18:50:51FromDiscord<Rika> In reply to @Knedlik "What should I do": clone nimgame2 somewhere, change it, `nimble devel` the directory
18:51:04FromDiscord<Rika> then ig install dependencies but idk the command
18:52:08FromDiscord<Knedlik> I don't really know how to work with nimble yet, could you explain the nimble devel and install dependencies?
18:52:32FromDiscord<Knedlik> By install deps, do you mean `nimble install`?
18:54:10FromDiscord<Rika> devel -> develop sorry
18:54:12FromDiscord<Rika> `nimble develop`
18:54:19*Gustavo6046 joined #nim
18:54:21FromDiscord<Rika> then `nimble install -d
18:54:23FromDiscord<Rika> (edit) "-d" => "-d`"
18:55:37FromDiscord<Knedlik> i’m not sure where to do that, is that in the nimgame dir?
18:56:10*neurocyte8614492 joined #nim
18:57:31FromDiscord<Rika> yes
18:58:06*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:03:00FromDiscord<Knedlik> it asked if it should look for SDL on the internet, I said yes and it errored
19:10:41FromDiscord<Knedlik> In reply to @Rika "yes": for some reason when I edit the nimble, it tries to do @@# in the nimble develop
19:10:58FromDiscord<Knedlik> in the nimble it’s only @#
19:11:21FromDiscord<ratapenado> hello, very stupid and basic question but what is the error here ? https://media.discordapp.net/attachments/371759389889003532/966415792210059294/Capture_decran_2022-04-20_210845.png
19:15:28FromDiscord<enthus1ast> imho config is a strtab
19:15:33FromDiscord<enthus1ast> mom
19:16:38FromDiscord<enthus1ast> no its a ordered table
19:16:44FromDiscord<Knedlik> so update: the @ only made it error, because it puts the @ automatically
19:16:46FromDiscord<enthus1ast> so you must ↵import tables
19:17:01FromDiscord<enthus1ast> ^ @ratapenado
19:17:20FromDiscord<enthus1ast> that you have the hasKey proc
19:21:57FromDiscord<ratapenado> In reply to @enthus1ast "so you must ": thanks it worked. I'm coming from python where the functions come with the objects 🙂
19:22:43FromDiscord<enthus1ast> you can check this here\: https://nim-lang.org/docs/parsecfg.html#Config
19:24:28*Zectbumo joined #nim
19:25:32FromDiscord<ratapenado> In reply to @enthus1ast "you can check this": thanks, I'm not really used to nim philosophy
19:51:42NimEventerNew post on r/nim by momoPFL01: Struggling with slices/ranges in for loops, see https://reddit.com/r/nim/comments/u84v6p/struggling_with_slicesranges_in_for_loops/
20:15:13*jjido joined #nim
20:33:39*neceve quit (Ping timeout: 240 seconds)
20:43:35FromDiscord<garuse> is there a key value data structure faster than tables ?
20:44:26FromDiscord<garuse> i am puzzled by a very basic benchmark where luajit is aprox 5 times faster
20:45:15FromDiscord<Generic> if you know your domain than yes
20:45:54FromDiscord<Elegantbeef> Depends what you need you can also use an enum indexed array
20:46:19FromDiscord<Generic> something like this has come up again and again
20:46:33FromDiscord<Generic> when you compare hash table implementations
20:46:57FromDiscord<Generic> where what's tested in a benchmark can skew the results in any direction
20:48:00FromDiscord<Generic> e.g. lots of clustered data, small tables, large tables, specific operations (more insertions, deletions)
20:58:15*jmdaemon quit (Ping timeout: 260 seconds)
20:58:51FromDiscord<Phil> ~~Just write your code so that it fits into L1 cache and you don't even have to care about your algorithm~~
20:59:10FromDiscord<garuse> i feel like luajit is cheating like it cannot be faster but i have not idea what it does
21:00:03FromDiscord<garuse> do you mind if i post the lua code and my nim version?
21:01:26FromDiscord<garuse> for context, i am learning lua and found that benchmark example praising luajit as faster than c and c++
21:01:43*jmdaemon joined #nim
21:01:46FromDiscord<Elegantbeef> Go ahead
21:04:35FromDiscord<garuse> https://media.discordapp.net/attachments/371759389889003532/966444293541724171/test2.lua https://media.discordapp.net/attachments/371759389889003532/966444293801787402/testnim.nim
21:05:23FromDiscord<Elegantbeef> Nim has a `CountTable` btw
21:05:33FromDiscord<Elegantbeef> Not that it's any faster
21:05:53FromDiscord<Elegantbeef> Also you did benchmark this with `-d:release` right?
21:06:34FromDiscord<spoon> two for loops and one nested in nim, and one nested for loop and one not in lua?
21:07:24FromDiscord<Elegantbeef> If not you should, since compiled languages need to have the optimizers turned on, since it slows down compilation
21:11:44FromDiscord<garuse> compiled with -d:danger -d:lto
21:12:38FromDiscord<garuse> belive me i am not bashing nim i love it i just don't get what kind of magic does luajit
21:15:05FromDiscord<garuse> on my (old) desktop the times are: luajit 583ms; nim regular table 2535ms; nim count table 2814ms
21:17:22FromDiscord<Elegantbeef> Are you timing the zeroing of the nim table aswell?
21:17:24FromDiscord<garuse> In reply to @spoon "two for loops and": the first loop in nim is for initialization to avoid an extra check in the second loop (executed 10mil times). is infact an optimization
21:17:40FromDiscord<Elegantbeef> Nim 0 init's memory by default
21:18:00FromDiscord<Elegantbeef> So that table is already 0-init'd
21:18:41FromDiscord<garuse> In reply to @Elegantbeef "Are you timing the": the zeroing should happen only once on init
21:18:52FromDiscord<Elegantbeef> But you're doing it twice
21:19:15FromDiscord<Elegantbeef> atleast with the count table
21:19:33FromDiscord<Elegantbeef> you do not need to do ` = 0` just do `inc word` and it does the same
21:19:45FromDiscord<Elegantbeef> But it's negligable yes
21:20:12FromDiscord<garuse> it has only 19 keys i don't think it matters
21:22:40FromDiscord<Elegantbeef> I wager that luajit stores the hash with the string and just uses that since iirc it uses COW strings
21:25:42FromDiscord<Elegantbeef> Yea i've got it down to 1.6s
21:25:49FromDiscord<Elegantbeef> From \~3
21:26:50FromDiscord<Elegantbeef> With danger it's down to 1.1
21:27:11FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/ptR
21:27:56FromDiscord<Elegantbeef> with `--gc:arc -d:lto -d:danger`
21:27:57*PMunch quit (Quit: leaving)
21:29:11FromDiscord<Elegantbeef> Then there is the question of why even use a table for this it's not a KV relationship
21:30:21FromDiscord<garuse> if the words are not know at compile time and we need to count them what data structure would you recommend?
21:30:43FromDiscord<Elegantbeef> I dont know the most efficient method of that
21:31:04FromDiscord<Elegantbeef> Hashes are relatively expensive but probably the cheapest
21:31:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VEH
21:31:41FromDiscord<Elegantbeef> Yes it's reduced the example a shit ton, but hey it functions the same 😛
21:31:47FromDiscord<garuse> yes your version is much better but gc arc does really make the difference (1.32s). with refcount is twice as slow as the original time (5.7s on my macthine)
21:32:33FromDiscord<Phil> I mean, basically if it's that performance critical, trying to make it all about arrays seems to be where it's at
21:32:37FromDiscord<Elegantbeef> https://benhoyt.com/writings/count-words/ might be interesting
21:32:54FromDiscord<Elegantbeef> Nim scores really high in that example
21:33:37FromDiscord<Elegantbeef> Seems it just uses a counttable
21:33:59FromDiscord<garuse> thanx for the link
21:34:21FromDiscord<Elegantbeef> I think in your benchmark it just demonstrates that luajit has optimisations for tables, especially with literals
21:34:52FromDiscord<Elegantbeef> I wonder if the same output would be achieved if you dynamically made the string/table
21:35:31FromDiscord<Elegantbeef> Perhaps test it with a real file garuse and compare the two
21:36:19FromDiscord<garuse> ok will do this tomorrow. thank you! now it's time to hit the pillow 😴
21:36:32FromDiscord<Elegantbeef> Buh bye
21:36:40FromDiscord<Elegantbeef> It's an issue with benchmarks, making them practical 😄
21:37:22FromDiscord<spoon> woah, zig faster than c?
21:37:34FromDiscord<spoon> nah, optimized is .01 slower
21:37:49FromDiscord<spoon> still impressive
21:39:48FromDiscord<Elegantbeef> The impressive part is the Nim one is done using the stdlib
21:40:11FromDiscord<spoon> oh, do other ones have imports?
21:40:27FromDiscord<spoon> or external dependencies rather
21:40:31FromDiscord<Elegantbeef> https://github.com/benhoyt/countwords/blob/master/optimized.zig
21:40:49FromDiscord<Elegantbeef> Sorry wanted the simple zig
21:40:50FromDiscord<Elegantbeef> https://github.com/benhoyt/countwords/blob/master/simple.zig
21:40:57FromDiscord<Elegantbeef> https://github.com/benhoyt/countwords/blob/master/simple.nim
21:41:44FromDiscord<Elegantbeef> Fuuuuuck i can speed up the nim optimized
21:41:46FromDiscord<spoon> where does zig use external dependencies, they all seem to stem from importing std?
21:42:00FromDiscord<Elegantbeef> I more mean there isnt any extra code really written
21:42:16FromDiscord<spoon> oh yea
21:42:44FromDiscord<spoon> those nodejs-like import statements though
21:43:30FromDiscord<Elegantbeef> I hate that i'm going to do this, but time to optimize Nim's optimized even further
21:44:09FromDiscord<spoon> archived repo rip
21:45:08*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:46:23FromDiscord<Alea> In reply to @Elegantbeef "I hate that i'm": Do it anyway and compare the old vs new results for us :hmmNoted:
21:46:40FromDiscord<ajusa> Yes please I'd be interested
21:48:07FromDiscord<Elegantbeef> The main thing is just making it a count table of `Hash` instead of `string`
21:48:22FromDiscord<Elegantbeef> This gives you a relatively large performance increase as you're already converting it to lowercase as you go
21:49:44FromDiscord<Alea> They need to figure out a better way of benchmarking languages that doesn't involve user programs
21:49:55FromDiscord<Alea> It's so prone to implementation deviation
21:50:14FromDiscord<Elegantbeef> Nah benchmarks are comically bad
21:50:18FromDiscord<Elegantbeef> There is no good way to benchmark
21:50:56FromDiscord<Elegantbeef> The only actual benchmark to me is speed vs. headaches
21:51:30FromDiscord<Alea> I think some way of comparing code gen quality would be useful
21:51:40FromDiscord<spoon> just nest 50 loops into one arithmetic operation and a print statement
21:51:41FromDiscord<Elegantbeef> Pointless though
21:51:55FromDiscord<Elegantbeef> You can write similarly performant code in most languages that give control
21:53:31FromDiscord<Elegantbeef> The ergonomics is the only real metric to me
21:53:39FromDiscord<Alea> It'd be interesting to know how much overhead say rusts memory safety stuff vs nims gc introduces vs plain c or something
21:54:09FromDiscord<Elegantbeef> Rust's memory safety is mostly compile time only
21:56:18GreaseMonkeyoptimising for the time spanning from time-of-save to time-of-execution is actually quite a wonderful thing
22:02:25FromDiscord<Elegantbeef> Assuming this tests for correctness i made it go from .51 to .32
22:03:23FromDiscord<ajusa> Just by changing the way the hash works?
22:03:35FromDiscord<Elegantbeef> By reducing iteration
22:04:19FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3VEL
22:04:35FromDiscord<Elegantbeef> The way it used to do it it hashed each word after already iterating every word
22:04:48FromDiscord<Elegantbeef> So you had each word being iterated twice
22:05:25FromDiscord<Elegantbeef> compare that to the optimized one on the repo to see my changes
22:05:49FromDiscord<ajusa> I see
22:07:31FromDiscord<Elegantbeef> Worth noting that was just \`--gc\:arc -d\:release
22:07:46FromDiscord<Elegantbeef> With `-d:danger -d:lto` we're at `0.24`
22:09:18FromDiscord<Elegantbeef> refc doesnt even change the performance it's also at 0.24 so a gc'd language is close to C/zig
22:09:36FromDiscord<Elegantbeef> Get fucking wrecked manual memory management
22:09:58FromDiscord<Elegantbeef> \Yes i realize there are only a few allocations
22:14:11FromDiscord<Elegantbeef> Thinking about it, it's hilarious that Nim's optimized version is that much faster than other languages they are using string slices which are allocating
22:14:40FromDiscord<darling <3> what does -d:lto mean/do?
22:15:32FromDiscord<Elegantbeef> it's link time optimization
22:15:49FromDiscord<darling <3> ahhh thank you
22:15:52FromDiscord<Elegantbeef> Which enables the linker to do optimisations that can get quite a bit of performance boost
22:17:42FromDiscord<ratapenado> The kotlin version is just a one-liner lol
22:19:14FromDiscord<Elegantbeef> It's also relatively slow
22:19:31FromDiscord<Elegantbeef> They're supposed to use that kotlin thing that's like a iterator
22:20:52*LuxuryMode joined #nim
22:26:42*jjido joined #nim
22:27:30FromDiscord<Recruit_main707> -d:release/danger dont use -d:lto too?
22:27:39FromDiscord<Elegantbeef> Nope
23:10:32*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)