<< 06-10-2021 >>

00:01:51*nrds quit (Remote host closed the connection)
00:08:45*nrds joined #nim
00:36:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
01:46:46*Gustavo6046 joined #nim
01:59:58*stkrdknmibalz joined #nim
02:00:34*arkurious quit (Quit: Leaving)
02:21:59*krux02 quit (Remote host closed the connection)
02:26:40*Gustavo6046 quit (Remote host closed the connection)
02:27:03*Gustavo6046 joined #nim
03:07:31FromDiscord<Hamid Bluri> hey
03:07:46FromDiscord<Hamid Bluri> `nimble install` gives me
03:07:59FromDiscord<Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3AY4
03:08:34FromDiscord<Hamid Bluri> is there any specefic reason for this?
03:09:07FromDiscord<Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3AY5
03:09:12*xet7 quit (Ping timeout: 268 seconds)
03:09:14FromDiscord<Hamid Bluri> here's my `package.nimble`
03:10:48FromDiscord<Hamid Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3AY8
03:11:00FromDiscord<Hamid Bluri> (edit) "https://play.nim-lang.org/#ix=3AY8" => "https://play.nim-lang.org/#ix=3AY9"
03:16:09*meowray quit (Remote host closed the connection)
03:16:19*meowray joined #nim
03:19:06*happycorsair[m] quit (Ping timeout: 265 seconds)
03:19:13FromDiscord<xflywind> In reply to @hamidb80 "hey": hello, https://discord.com/channels/371759389889003530/764946138109050893/893868412734951455
03:19:31FromDiscord<xflywind> It seems that you need to clear .nimble/pkg
03:19:54FromDiscord<xflywind> > afraid you need to clear your /home/tandy/.nimble/pkgs/
03:22:34*xet7 joined #nim
03:23:02*rockcavera quit (Remote host closed the connection)
03:38:25FromDiscord<Elegantbeef> Well if anyone is keeping track, my interop now handles overloaded procedures! 🙂
03:38:56FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3AYb for those weirdos that like my spam
03:41:16FromDiscord<Rika> no thanks
03:41:31*happycorsair[m] joined #nim
03:41:47FromDiscord<Elegantbeef> Damn i'll remove you from the mailing list
03:43:20FromDiscord<Rika> has always been going to spam anyway
03:43:32FromDiscord<Elegantbeef> Rightfully so
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:07:05*stkrdknmibalz quit (Ping timeout: 246 seconds)
04:13:50*meowray quit (Changing host)
04:13:50*meowray joined #nim
04:28:39*stkrdknmibalz joined #nim
04:34:27*stkrdknmibalz quit (Excess Flood)
04:35:19FromDiscord<Gumber> I'll love it when the vm goes brrrrrrrrrrrrr
04:49:59FromDiscord<Hamid Bluri> In reply to @Gumber "I'll love it when": brrrrrrr ?
04:50:06FromDiscord<Gumber> fast
04:54:18FromDiscord<Hamid Bluri> In reply to @Elegantbeef "<@714152700920594493>\: i know it's": what version?
04:54:38FromDiscord<Hamid Bluri> do you mean can i use it in `static` context?
04:54:57FromDiscord<Elegantbeef> What?
04:55:06FromDiscord<Hamid Bluri> (edit) "do you mean ... can" added "i" | removed "i"
04:55:41FromDiscord<Hamid Bluri> as far as i know the code in the `static` is block executed by VM
04:55:49FromDiscord<Elegantbeef> Yes?
04:56:12FromDiscord<Rika> ?
04:56:42FromDiscord<Elegantbeef> This makes it's own interpreter, you cannot extend the builtin nimVm without using libcffi or manually adding code to the compiler
04:57:11FromDiscord<Hamid Bluri> and it's not capable of using some features like ref, or ...↵and it means you can't use `json` stdlib in compile time
04:57:35FromDiscord<Elegantbeef> it can use ref/json
04:58:23FromDiscord<Elegantbeef> I dont think you realize the above is for runtime scripting not compile time scripting
04:58:40FromDiscord<Elegantbeef> It enables stuff like this https://streamable.com/oerlmi
05:02:47FromDiscord<Hamid Bluri> In reply to @Elegantbeef "It enables stuff like": that's so cool 😄
05:04:27FromDiscord<Hamid Bluri> (edit) "😄" => "XD"
05:04:35FromDiscord<Hamid Bluri> (edit) removed "XD"
05:31:38FromDiscord<impbox [ftsf]> @ElegantBeef very nice!
05:32:19FromDiscord<impbox [ftsf]> full nico support now?
05:32:50FromDiscord<Elegantbeef> Who knows 😀
05:33:00FromDiscord<tourist> Hello guys I am new to nim
05:33:18FromDiscord<Elegantbeef> Hello new to nim
05:33:30FromDiscord<Hamid Bluri> In reply to @Elegantbeef "Hello new to nim": 😄 😄
05:33:34FromDiscord<Elegantbeef> But yea impbox it'll be much easier to support Nico
05:33:48FromDiscord<Elegantbeef> Typedefs are the last thing i need to support again
05:34:14FromDiscord<tourist> But I am just very confused between nim, rust , crystal, Julia ,Dlang, golang
05:34:25FromDiscord<tourist> Idk what to choose as programming language for my life
05:34:26FromDiscord<impbox [ftsf]> @tourist welcome!
05:34:29FromDiscord<Elegantbeef> First on the list must mean it's first in your mind
05:34:42FromDiscord<Elegantbeef> Well we'll almost certainly suggest Nim
05:34:48FromDiscord<Rika> What's your goal in learning a new programming language
05:34:48FromDiscord<Elegantbeef> So do that one
05:34:49FromDiscord<Hamid Bluri> In reply to @impbox "<@!489496602868842498> welcome!": do not choose anything for your life
05:35:02FromDiscord<Rika> If it's to get hired then this isn't really the right language
05:35:06FromDiscord<tourist> @Rika I already know python,C and ocaml
05:35:17FromDiscord<tourist> @Rika I want to develop games
05:35:23FromDiscord<tourist> With it , pygame is too slow
05:35:24FromDiscord<impbox [ftsf]> well well well!
05:35:27FromDiscord<Rika> Then sure this sounds like the right one
05:35:42FromDiscord<Hamid Bluri> pygame is ahhhhh
05:35:48FromDiscord<impbox [ftsf]> nim is pretty rad for games, though the stuff is still young
05:35:59FromDiscord<impbox [ftsf]> I use nim for games a lot
05:36:07FromDiscord<tourist> @impbox [ftsf] yes, are there any game libraries for nim
05:36:18FromDiscord<impbox [ftsf]> i wouldn't use anything else unless i'm forced to for work
05:36:30FromDiscord<tourist> But Nim really has potential to take the crown from python and Julia
05:36:31FromDiscord<impbox [ftsf]> I develop one of them called Nico, there's a bunch of others too
05:36:44FromDiscord<Hamid Bluri> In reply to @impbox "I use nim for": did you published any games on the internet?
05:36:48FromDiscord<Hamid Bluri> (edit) "published" => "publish"
05:36:52FromDiscord<impbox [ftsf]> https://github.com/ftsf/nico/
05:36:54nrds<R2D299> itHub: 7"a Game Framework in Nim inspired by Pico-8."
05:37:03FromDiscord<impbox [ftsf]> https://impbox.itch.io/ yeah
05:37:32FromDiscord<Elegantbeef> Both impbox and i have used nico to make games!
05:37:40FromDiscord<impbox [ftsf]> nico is great if you want to do 2d pixel art games
05:37:48FromDiscord<tourist> @impbox [ftsf] wow I designed your own library for making games
05:37:50FromDiscord<impbox [ftsf]> but if you're more into 3D stuff there's other things
05:37:57FromDiscord<tourist> (edit) "I" => "you"
05:37:58FromDiscord<impbox [ftsf]> for 3D I use SDL2+opengl
05:38:48FromDiscord<Hamid Bluri> In reply to @impbox "https://impbox.itch.io/ yeah": wow, they are so many
05:39:25FromDiscord<impbox [ftsf]> some people are using nim+godot
05:39:42FromDiscord<Elegantbeef> Others are looking at the machinary + nim
05:39:50*max22- joined #nim
05:40:18FromDiscord<impbox [ftsf]> almost all of those games on my itch.io are made in nim+nico
05:40:37FromDiscord<impbox [ftsf]> https://jbeetham.itch.io/linerino @ElegantBeef made this cool puzzle game
05:40:40FromDiscord<Elegantbeef> Quick ask impbox what the best game made with Nico is
05:41:01FromDiscord<impbox [ftsf]> Vektor 2089 is the most commercially successful =p
05:41:01FromDiscord<Elegantbeef> Jokes jokes, they're all shit you can see the pixels
05:41:17FromDiscord<impbox [ftsf]> Smalltrek is the most critically acclaimed
05:41:38FromDiscord<impbox [ftsf]> Bushfire Rescue Tactics is the most newsworthy
05:41:50FromDiscord<Elegantbeef> My hypothesis is that a few copies sold would make it the most comercially successful 😛
05:42:39FromDiscord<Elegantbeef> Anywho back to the actual conversation
05:42:55FromDiscord<Elegantbeef> Nim is a fantastic language for game dev as it's very readable and very performant
05:43:03FromDiscord<impbox [ftsf]> yup, would recommend
05:43:12FromDiscord<Hamid Bluri> In reply to @impbox "https://jbeetham.itch.io/linerino <@!14540573057128": @ElegantBeef how did you make a android installable file `apk` for this game
05:43:25FromDiscord<Elegantbeef> Nico supports building to android
05:43:59FromDiscord<Elegantbeef> A few Nim flags in your project and as impbox would say bob's your uncle 😛
05:44:16FromDiscord<Rika> Has anyone used DrNim seriously?
05:44:23FromDiscord<Hamid Bluri> bobs your uncke
05:44:26FromDiscord<Hamid Bluri> (edit) "uncke" => "uncle"
05:44:30FromDiscord<Hamid Bluri> :/
05:44:32FromDiscord<Hamid Bluri> (edit) ":/" => "😕"
05:44:33FromDiscord<impbox [ftsf]> @Rika never heard of them
05:44:43FromDiscord<Rika> Formal proving for nim
05:44:54FromDiscord<Elegantbeef> Given that drnim only does index checking it's not overly fantastic presently
05:45:18FromDiscord<Rika> It only does that automatically, it can do more can't it?
05:45:31FromDiscord<Rika> Isn't that why there are the condition pragmas
05:45:45FromDiscord<Hamid Bluri> In reply to @Rika "Formal proving for nim": https://media.discordapp.net/attachments/371759389889003532/895185039594258452/unknown.png
05:45:48FromDiscord<Elegantbeef> It might be capable, there isnt much in the way of documentation for it
05:46:02FromDiscord<Elegantbeef> https://nim-lang.org/docs/drnim.html
05:46:04FromDiscord<Elegantbeef> For context
05:46:14FromDiscord<NullCode> In reply to @hamidb80 "": yes
05:46:19FromDiscord<Rika> Yeah that doesn't sound like "not much" to me
05:46:21FromDiscord<NullCode> nim clothes v3
05:46:41FromDiscord<xflywind> drnim is rarely maintained
05:46:43FromDiscord<impbox [ftsf]> I got the same result =p
05:48:54FromDiscord<impbox [ftsf]> @ElegantBeef nimscripter ready for me to mess with it?
05:49:21FromDiscord<Elegantbeef> If you want, there is no documentation or tests for the new changes yet
05:49:33FromDiscord<Elegantbeef> I dont forsee massive changes now
05:49:40FromDiscord<Elegantbeef> Mostly just small things to enable more stuff
05:50:12FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/tree/bigrewrite the branch you'll want to use
05:52:31FromDiscord<impbox [ftsf]> sweet
05:53:45FromDiscord<Elegantbeef> I do want to look into storing globals on save and reload them after loading
06:00:50FromDiscord<Elegantbeef> and of course please mention issues or additions that you'd like
06:01:40FromDiscord<impbox [ftsf]> aye, will give it a try
06:04:40FromDiscord<xflywind> regression
06:04:45FromDiscord<xflywind> !eval type CharSet = array
06:04:46NimBotCompile failed: Error: internal error: invalid kind for lastOrd(tyGenericParam)
06:25:01FromDiscord<Rika> Is that even legal
06:25:54FromDiscord<Elegantbeef> Aliasing a typeclass should be
06:26:21FromDiscord<xflywind> !eval type CharSet = set
06:26:24NimBot<no output>
06:26:35FromDiscord<Rika> So it is
06:26:45FromDiscord<xflywind> yeah
06:27:07FromDiscord<xflywind> https://github.com/nim-lang/Nim/issues/3367
06:49:16*PMunch joined #nim
06:57:15*jjido joined #nim
07:03:04*neurocyte013288 joined #nim
07:03:04*neurocyte013288 quit (Changing host)
07:03:04*neurocyte013288 joined #nim
07:29:10*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
07:43:09FromDiscord<tandy> do `choosenim update self`↵(@Hamid Bluri)
07:43:27FromDiscord<tandy> oh this too↵(@xflywind)
07:58:16*neurocyte013288 quit (Read error: Connection reset by peer)
07:59:04*neurocyte013288 joined #nim
07:59:05*neurocyte013288 quit (Changing host)
07:59:05*neurocyte013288 joined #nim
08:05:14*neurocyte013288 quit (Read error: Connection reset by peer)
08:06:01*neurocyte013288 joined #nim
08:06:01*neurocyte013288 quit (Changing host)
08:06:01*neurocyte013288 joined #nim
08:08:02*neurocyte013288 quit (Read error: Connection reset by peer)
08:08:39*neurocyte013288 joined #nim
08:08:39*neurocyte013288 quit (Changing host)
08:08:39*neurocyte013288 joined #nim
08:09:41FromDiscord<impbox [ftsf]> say I remove a nimble package and replace it with a newer version, when I run nim why does it still try to open the file of the old version that's gone and get an IOError? How do I tell it to forget about the old version
08:10:27FromDiscord<impbox [ftsf]> does nim store the nimble package versions it's using somewhere?
08:10:48*neurocyte0132889 joined #nim
08:10:49*neurocyte0132889 quit (Changing host)
08:10:49*neurocyte0132889 joined #nim
08:12:22*neurocyte0132889 quit (Read error: Connection reset by peer)
08:12:41FromDiscord<Elegantbeef> It uses the youngest version that fits your nimble if none the first i finds i think, eitherway assuming i know what package you want i'd just suggest cloning the repo and using `nimble develop` until I release it properly
08:13:04FromDiscord<Elegantbeef> That way you can just do `git pull` inside that directory and it'll update it
08:13:11FromDiscord<impbox [ftsf]> yeah, i just did that, but instead of using the develop one it's using one that I deleted
08:13:18*neurocyte013288 quit (Ping timeout: 265 seconds)
08:13:24FromDiscord<Elegantbeef> Odd
08:13:28FromDiscord<impbox [ftsf]> indeed
08:13:43FromDiscord<impbox [ftsf]> i just set the nimcache to a different path and now it works, so i guess it's something to do with nimcache
08:19:19*neurocyte0132889 joined #nim
08:19:19*neurocyte0132889 quit (Changing host)
08:19:19*neurocyte0132889 joined #nim
08:24:49FromDiscord<konradmb> Is there file watcher for Nim that recompiles and reruns project on change like "npm watch" or "gow"?
08:30:15FromDiscord<impbox [ftsf]> @konradmb not that i know of, but you could implement your own easily with a script. though there is hotcodereloading
08:30:20FromDiscord<impbox [ftsf]> https://nim-lang.org/docs/hcr.html
08:31:39FromDiscord<Rika> hot code reloading is not the same though
08:32:08FromDiscord<impbox [ftsf]> nope, but might be useful for the same use case
08:32:26FromDiscord<impbox [ftsf]> depending on what you're trying to do
08:54:27*jjido joined #nim
09:16:07FromDiscord<dom96> In reply to @flywind "> afraid you need": you went too far in that exchange, the first thing they need to do is downgrade nimble 🙂
09:30:09*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:06:54FromDiscord<NullCode> whats an `if defer` statement?
10:07:00FromDiscord<NullCode> (edit) "statement?" => "statement in nim?"
10:07:45FromDiscord<Rika> Example
10:07:55FromDiscord<Rika> Those are two decoupled constructs
10:08:48FromDiscord<impbox [ftsf]> defer lets you make something happen at the end of the function
10:09:06FromDiscord<NullCode> sent a code paste, see https://paste.rs/t4v
10:09:07FromDiscord<NullCode> kanged from `winim`
10:09:15FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3AZs
10:09:37FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3AZt
10:09:43FromDiscord<Rika> That’s just an if and then a defer after
10:09:48FromDiscord<NullCode> oh
10:09:53FromDiscord<NullCode> i thought it was together
10:09:56FromDiscord<Rika> In reply to @impbox "defer lets you make": Here’s what defer does
10:10:05FromDiscord<NullCode> but this isn't inside a proc
10:10:07FromDiscord<NullCode> https://github.com/khchen/winim/blob/b7b32603f4ef672bc34405bc6200e8aab2c366b1/examples/fileopendialog.nim#L15
10:10:31FromDiscord<impbox [ftsf]> it's in the "main" ... proc?
10:10:36FromDiscord<impbox [ftsf]> not sure what you call it
10:10:47FromDiscord<Rika> Entry point function ?
10:10:48FromDiscord<impbox [ftsf]> but statements in global scope get called
10:11:17FromDiscord<NullCode> what
10:11:30FromDiscord<NullCode> main proc?
10:11:50FromDiscord<impbox [ftsf]> stuff outside any proc gets called immediately on start
10:11:56FromDiscord<NullCode> yes
10:12:03FromDiscord<impbox [ftsf]> you can kind of think of it as a proc
10:12:05FromDiscord<Rika> You can imagine that as the main proc
10:12:06FromDiscord<NullCode> oh so all those things are in a proc?
10:12:13FromDiscord<Rika> Technically
10:12:13FromDiscord<NullCode> "imagine" got it
10:12:35FromDiscord<Rika> But a defer outside any block actually doesn’t work afaik
10:12:48FromDiscord<Rika> So in that case it runs the code at the end of the try block
10:12:51FromDiscord<NullCode> so defer means the `CoBlaBlaBla` will happen at the very end?
10:12:56FromDiscord<impbox [ftsf]> i think it's technically different in some ways, but you could put it all in a proc main() and then call main() at the end if you wanted
10:13:31FromDiscord<NullCode> yeah understood
10:13:37FromDiscord<NullCode> a lil like the main proc in python
10:13:49FromDiscord<NullCode> (edit) "main proc" => "`def main()`"
10:14:42FromDiscord<NullCode> anyway i was looking at `winim` because i wanna hide and show console at will
10:16:21FromDiscord<NullCode> a lil like `ShowWindow(window, 0);` in <windows.h>
10:16:25FromDiscord<impbox [ftsf]> console?
10:16:44FromDiscord<NullCode> you know, this https://media.discordapp.net/attachments/371759389889003532/895253227921084426/unknown.png
10:16:46FromDiscord<impbox [ftsf]> as in a windows terminal, or something else?
10:16:53FromDiscord<impbox [ftsf]> or cmd
10:16:53FromDiscord<NullCode> yeah that
10:17:21FromDiscord<impbox [ftsf]> ok, i guess you'd just createprocess
10:17:22FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3AZw
10:17:32FromDiscord<impbox [ftsf]> ahh you want to hide/show an existing terminal
10:17:52FromDiscord<NullCode> thanks, I'm dumb
10:17:53FromDiscord<NullCode> (edit) "https://play.nim-lang.org/#ix=3AZy" => "https://paste.rs/hEv"
10:17:54FromDiscord<NullCode> sent a code paste, see https://paste.rs/LSV
10:18:06FromDiscord<NullCode> where can i learn more about nim tho
10:18:27FromDiscord<impbox [ftsf]> right here
10:18:41FromDiscord<NullCode> yeah but I'm just like
10:18:47FromDiscord<NullCode> asking for help and getting answers
10:18:51FromDiscord<impbox [ftsf]> did you read the book yet?
10:18:57FromDiscord<NullCode> by learn i wanna hardcode this shit into my brain
10:19:00FromDiscord<NullCode> like python
10:19:06FromDiscord<NullCode> In reply to @impbox "did you read the": https://media.discordapp.net/attachments/371759389889003532/895253824221102090/unknown.png
10:19:07FromDiscord<impbox [ftsf]> learn by doing
10:19:13FromDiscord<NullCode> yeah I finished reading this
10:19:18FromDiscord<NullCode> nim basics book
10:19:46FromDiscord<NullCode> In reply to @impbox "learn by doing": i feel like I'm bothering others when i ask questions
10:19:54FromDiscord<impbox [ftsf]> nah, some of us have no life
10:19:55FromDiscord<NullCode> so yeah not a fan
10:20:01FromDiscord<NullCode> In reply to @impbox "nah, some of us": lmfao
10:20:16FromDiscord<NullCode> my kinda situation
10:20:37FromDiscord<enthus1ast> @NullCode\: read the docs of modules you wanna use; read the code of modules you wanna use
10:20:42FromDiscord<impbox [ftsf]> and some of us have lives but procrastinate them by answering questions here
10:20:46FromDiscord<enthus1ast> at least skim through the code
10:21:01FromDiscord<NullCode> In reply to @enthus1ast "<@360748438784180225>\: read the docs": some modules have extremely convulated docs
10:21:06FromDiscord<NullCode> (winim and nimbass for example)
10:21:06FromDiscord<enthus1ast> this way you see how others have solved the stuff
10:21:18FromDiscord<NullCode> In reply to @enthus1ast "at least skim through": yes i do that as a last resort
10:21:22FromDiscord<impbox [ftsf]> sometimes reading the source is nicer than the docs
10:21:35FromDiscord<impbox [ftsf]> tbh i usually just read the README then jump into the source
10:21:41FromDiscord<enthus1ast> winim is "just" a wrapper for the winapi, so the docs should be msdn i think
10:21:55FromDiscord<NullCode> but isn't msdn for c
10:21:56FromDiscord<NullCode> not for nim
10:22:00FromDiscord<NullCode> (edit) "c" => "c/cpp"
10:22:03FromDiscord<impbox [ftsf]> but the API is the same
10:22:10FromDiscord<impbox [ftsf]> well the nim one is based on the C one
10:22:18FromDiscord<NullCode> windows.h?
10:22:19FromDiscord<impbox [ftsf]> so i you understand the C one then the nim one will make sense
10:22:23FromDiscord<impbox [ftsf]> just the syntax is different
10:22:30FromDiscord<NullCode> oh i see
10:22:45FromDiscord<impbox [ftsf]> but same functions and arguments generally
10:22:49FromDiscord<enthus1ast> and winim tries to be very similar to c names
10:24:04FromDiscord<impbox [ftsf]> ` proc CreatePropertySheetPage(constPropSheetPagePointer: LPCPROPSHEETPAGEA): HPROPSHEETPAGE {.winapi, stdcall, dynlib: "comctl32", importc: "CreatePropertySheetPageA".}`↵eg the bit that says "import:" tells you what the C function is called
10:24:09FromDiscord<impbox [ftsf]> (edit) ""import:"" => ""importc:""
10:24:29FromDiscord<impbox [ftsf]> winim's `CreatePropertySheetPage` -> `CreatePropertySheetPageA` in C
10:24:47FromDiscord<enthus1ast> and the dynlib part tells you from which dlls this function is loaded
10:25:01FromDiscord<impbox [ftsf]> yup
10:26:40FromDiscord<enthus1ast> what i always forget and must read on winim's docs is how the various winapi strings (chaos) map to nim types
10:27:50FromDiscord<NullCode> In reply to @impbox "` proc CreatePropertySheetPage*(constPropSheetPage": oh so i can search for that function on msdn
10:27:56FromDiscord<NullCode> interesting
10:28:36FromDiscord<impbox [ftsf]> yeah, or search in msdn for what you want to do then you can probably find the matching nim function for it
10:28:52FromDiscord<NullCode> In reply to @enthus1ast "and the dynlib part": i see
10:29:12FromDiscord<NullCode> In reply to @impbox "yeah, or search in": yeah
10:41:16NimEventerNew thread by Sdmcallister: Nim js Geolocation API, see https://forum.nim-lang.org/t/8482
11:09:07*krux02 joined #nim
11:26:49*xet7 quit (Remote host closed the connection)
11:27:54*xet7 joined #nim
11:57:14*jjido joined #nim
11:59:35*max22- quit (Ping timeout: 246 seconds)
12:05:38*stkrdknmibalz joined #nim
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:10:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:14:27*Vladar joined #nim
12:18:28*rockcavera joined #nim
12:18:28*rockcavera quit (Changing host)
12:18:28*rockcavera joined #nim
12:20:50FromDiscord<enthus1ast> is there a better way to create an array than to alloc and cast ?
12:21:03FromDiscord<enthus1ast> dynamically i mean
12:21:08FromDiscord<Rika> you alloc and cast arrays?
12:21:11FromDiscord<Rika> thats wrong is it not
12:21:50FromDiscord<enthus1ast> for c interopt i do something like\:↵↵var foo = alloc(1024)
12:22:33FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3B0h
12:22:54FromDiscord<enthus1ast> but what i originally want, is an array
12:23:04FromDiscord<enthus1ast> but i do not know the size beforehand
12:23:12FromDiscord<Rika> just use a seq?
12:23:22FromDiscord<enthus1ast> mh
12:23:46FromDiscord<enthus1ast> yeah i could do this
12:24:05FromDiscord<Rika> if you want a `ptr T` you can just do theSeq[0].addr
12:24:14FromDiscord<enthus1ast> yes i know
12:25:32*arkurious joined #nim
12:27:06FromDiscord<enthus1ast> the thing is, while this work fine, i would rather prefer array semantics
12:27:37FromDiscord<enthus1ast> alloc cast dealloc works, but 1. more to type, 2. manual dealloc
12:30:06FromDiscord<Rika> In reply to @enthus1ast "the thing is, while": what does this mean?
12:30:23FromDiscord<Rika> what specific semantics are differnet between array and seq
12:30:34FromDiscord<enthus1ast> i can pass an array to a f func without addr for example
12:30:48FromDiscord<enthus1ast> and withouth [0]
12:31:15FromDiscord<Rika> and you lose indexing and everything else?
12:31:23FromDiscord<enthus1ast> yes
12:31:24PMunchtemplate carray[T](x: seq[T]): ptr T = x[0].addr
12:31:37PMunchThat's your C interop :P
12:31:47FromDiscord<enthus1ast> yes \:)
12:49:16FromDiscord<Goel> What is the `self` aprameter into a proc? I don't remember where i've seen it yesterday, but i don't think that was a parameter name, but a `keyword`?
12:49:22FromDiscord<Goel> (edit) "aprameter" => "parameter"
12:51:26FromDiscord<impbox [ftsf]> nothing special about it, just a convention
12:52:22PMunchWell, unless you use {.this: self.} or whatever that pragma was called
12:52:38FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3B0z
12:52:59FromDiscord<impbox [ftsf]> yeah `{.this:self.}` is deprecated, not sure if it's removed yet. but even then "self" is just a common convention
12:53:07FromDiscord<impbox [ftsf]> you can use whatever name
12:53:11FromDiscord<Goel> I might be wrong but i though it was like `proc name(self) =`
12:53:42FromDiscord<Goel> (edit) "though" => "think" | "thinkit was like `proc name(self) =` ... " added "If i find it again i'll be sure to check it"
12:55:47FromDiscord<Rika> probably a `using`
12:55:50FromDiscord<Rika> above in the file
12:55:59FromDiscord<Rika> `using self: ...`
12:56:00FromDiscord<Rika> i think
13:06:48*NeoCron joined #nim
13:16:24FromDiscord<gnu+linux user> @Araq please take a look at <https://github.com/nim-lang/csources_v1/pull/3>
13:24:37FromDiscord<Gumber> Openindiana huh....
13:25:41FromDiscord<Gumber> I feel like thre are enough random ass obscure unix OSs that we can learn about a new one every day of the year and not run out
13:30:12FromDiscord<gnu+linux user> typical gumber reaction to a normie mentioning pull requests
13:31:47nrds<Prestige99> What's openindiana 🤔
13:32:13nrds<Prestige99> Obscure indeed
13:42:54FromDiscord<Gumber> In reply to @richard stallmen(crazy GNU guy) "typical gumber reaction to": Huh?
13:43:21FromDiscord<Gumber> I don't really care about the PR I'm just not really shocked it's another Unix OS I've never heard of before
13:43:38FromDiscord<Gumber> If you're offended by that I'm sorry but I think that's more of your problem than mine
13:44:07FromDiscord<Gumber> I didn't mean any offense with my comment it was just kind of a joke or a jab at how many random ass Unix operating systems are out there
13:44:16FromDiscord<Gumber> I use Windows as my daily driver so you really shouldn't care what I think to be honest
13:45:58*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
14:05:15*max22- joined #nim
14:12:51FromDiscord<gnu+linux user> i would like to react but that would get me banned 😏
14:13:07*PMunch quit (Quit: Leaving)
14:14:00FromDiscord<sealmove> @gnu+linux user hey
14:14:16FromDiscord<sealmove> haven't seen any Hacktoberfest labels yet :\
14:14:26FromDiscord<Rika> its october....
14:14:32FromDiscord<Rika> what happened to this year
14:14:38FromDiscord<sealmove> yeah right!
14:14:47FromDiscord<sealmove> people losing track of time
14:14:53FromDiscord<Rika> year feels both long and short at the same time
14:14:59nrds<Prestige99> about to be 2022, wow
14:15:11FromDiscord<sealmove> mostly felt long for me
14:15:14nrds<Prestige99> Feels like a futuristic year number
14:15:40FromDiscord<Yardanico> imagine what would we feel in 2077
14:15:46FromDiscord<Rika> oh yeah isnt that two's day year
14:15:49FromDiscord<Yardanico> If someone from this chat will be alive by then
14:15:54nrds<Prestige99> hopefully better than the game
14:16:00FromDiscord<Yardanico> xd
14:16:08FromDiscord<Rika> In reply to @Yardanico "If someone from this": bruh im pretty sure we've got a few 2000s people here incl me
14:16:20nrds<Prestige99> :o
14:16:20FromDiscord<Rika> HOPEFULLY i live to 77
14:16:25FromDiscord<Rika> would be fucked if i didnt
14:16:26FromDiscord<Yardanico> but you shouldn't exclude external factors
14:16:36FromDiscord<Yardanico> like ww3, but that's more for offtopic
14:16:40nrds<Prestige99> I'm hoping technology gets me to 2100 but we'll see
14:16:49nrds<Prestige99> :P
14:16:56FromDiscord<sealmove> why 77? :P
14:17:04FromDiscord<Rika> im hoping technology grants us any pleasure we want by 2050 xd 1/2jk
14:21:53FromDiscord<Schelz> Hi, can someone translate this from python to nim please.
14:21:54FromDiscord<Schelz> response = requests.get("https://raw.githubusercontent.com/jprichardson/node-jsonfile/master/package.json").json()↵dwEntityList = str(response["repository"]["url"])
14:22:09FromDiscord<Schelz> (edit) "requests.get("https://raw.githubusercontent.com/jprichardson/node-jsonfile/master/package.json").json()↵dwEntityList" => "requests.get("https://raw.githubusercontent.com/jprichardson/node-jsonfile/master/package.json").json()↵model"
14:23:31FromDiscord<haxscramper> https://nim-lang.org/docs/httpclient.html#get%2CAsyncHttpClient%2Cstring with `parseJson()` from `std/json`
14:23:50FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3B15
14:24:00FromDiscord<Schelz> nice thanks
14:24:36FromDiscord<haxscramper> You can also use treeform/jsony and parse your request directly into data structure, if you will be extracting lots of fields from it
14:54:38FromDiscord<NullCode> In reply to @รєคɭ๓๏שє "mostly felt long for": here i am thinking how it went from april to october in 5 days
14:55:10FromDiscord<NullCode> tbh there should be a `py2nim`
14:56:40FromDiscord<Rika> guess what
14:56:45FromDiscord<Rika> theres a project regards that
14:57:16FromDiscord<haxscramper> https://forum.nim-lang.org/t/8379
14:58:37FromDiscord<NullCode> In reply to @Rika "theres a project regards": fr?
14:58:46FromDiscord<NullCode> wait checking forum
14:58:48FromDiscord<Rika> hax just sent it
14:58:56FromDiscord<NullCode> (edit) "wait checking ... forumlink" added "hax's" | "hax'sforum ... " added "link"
15:04:00FromDiscord<NullCode> theres quite a lot of py2nim libs on github tho
15:04:19FromDiscord<NullCode> (edit) removed "tho"
15:05:37FromDiscord<haxscramper> Making py2nim in general is an impossible task because there is so much about python code that is never written anywhere
15:05:55FromDiscord<haxscramper> All of those implicit assumptions about what it the type of the variable, where it is first declared
15:05:57FromDiscord<haxscramper> And so on
15:06:05FromDiscord<haxscramper> But simple syntactic translation is possible
15:06:18FromDiscord<haxscramper> If you add tons of unsafe hacks you cane make it close to python
15:06:48FromDiscord<haxscramper> Because python is unsafe as it gets, with no type checking anywhere, except for some codebases that use optional type annotations
15:06:57FromDiscord<NullCode> In reply to @haxscramper "Making py2nim in general": yes
15:07:06FromDiscord<Rika> and theyre just annotations as well
15:07:14FromDiscord<Rika> no enforcement xd
15:07:31FromDiscord<NullCode> well one way to do it would be to force users to write Cython code
15:07:34FromDiscord<NullCode> and then transpile that
15:07:49FromDiscord<NullCode> cython has static typing iirc
15:08:06FromDiscord<haxscramper> At this point you can just write nim directly
15:08:17FromDiscord<NullCode> true
15:45:54FromDiscord<Goel> Is it possible to have a `Table` as field type of an `object`?
15:46:40FromDiscord<Rika> yes?
15:46:49FromDiscord<Rika> what issues are you getting exactly
15:47:44FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=3B1v
15:48:04FromDiscord<enthus1ast> you must define what the table can store
15:48:14FromDiscord<enthus1ast> Table[string, Color] maybe
15:48:22FromDiscord<enthus1ast> or whatever you wanna store
15:48:23FromDiscord<Goel> oh i see
15:48:37FromDiscord<enthus1ast> the first one is the type of the key though
15:48:37FromDiscord<Rika> table is a generic like array and seq
15:53:07*def- quit (Quit: -)
15:56:03*def- joined #nim
16:13:26*vicfred joined #nim
16:20:11*neurocyte0132889 joined #nim
16:20:12*neurocyte0132889 quit (Changing host)
16:20:12*neurocyte0132889 joined #nim
17:06:05*PMunch joined #nim
17:35:41*jjido joined #nim
17:54:35nixfreak_nim[m]1Hey guys good morning , I wanted to get some feedback from the chan about slowly migrating away from python/shell scripts to nim
17:55:05nixfreak_nim[m]1I would like to start doing this on staging systems first then production systems
17:55:43nixfreak_nim[m]1Does anyone have any experience with this ?
18:02:05supakeenYes, what do you want to know?
18:17:56FromDiscord<el__maco> I suppose there isn't a somewhat less ceremonial way to ignore return value from a function 🤔
18:18:26FromDiscord<el__maco> writing tons of ``discard`` everywhere feels like an overkill
18:19:03nrds<Prestige99> Not that I know of
18:19:21nrds<Prestige99> I think it's actually a good thing to acknowledge that you're throwing away a return value
18:21:11FromDiscord<haxscramper> there is a not recommended workaround - adding `{.discardable.}` to the procedure declaration
18:21:31FromDiscord<haxscramper> But generally it is not recommended to use, since explicitly annotating discarded value is better overall
18:22:22FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3B2j
18:22:59FromDiscord<el__maco> idk... one major appeal to me in this language is the signal-to-noise ratio compared to many other languages. The syntax is just so clean without any extra fluff. Discard in particular seems in the "noisy" side, if I ignore the return value I probably don't care about the return value 🤷‍♂️
18:23:44FromDiscord<el__maco> definitely trying this discardable specifier, thanks for the tip
18:24:32FromDiscord<el__maco> it seems to work, beautiful
18:25:56FromDiscord<enthus1ast> maybe the api is flawed when you have a ton of discards
18:26:15FromDiscord<Elegantbeef> Or is a C api
18:26:22FromDiscord<haxscramper> sent a long message, see http://ix.io/3B2k
18:26:29FromDiscord<enthus1ast> true
18:27:42FromDiscord<haxscramper> So it is either API misdesign or misuse, and ignoring return codes sometimes amounts to horrible bugs where system you are interfacing with is not in valid state
18:28:31FromDiscord<haxscramper> That is - if half of the code is in discard statements all over
18:28:31FromDiscord<el__maco> many APIs feel obliged to return something from every function
18:42:31FromDiscord<haxscramper> `#!/usr/bin/env -S nim r`
18:43:29FromDiscord<haxscramper> I find it good for writing small automation scripts, and you can also make your own helper library for that purpose.
18:44:32FromDiscord<haxscramper> And there are libraries like cligen if you need to make the script usable as a CLI tool
18:50:17nrds<Prestige99> There are some libraries that return the same object you passed to it so you can chain function calls, that's usually the only time I use discard
19:11:04FromDiscord<qb> umm, Is there an xor assignment operator in nim?
19:21:36*Gustavo6046 quit (Read error: Connection reset by peer)
19:21:48*Gustavo6046 joined #nim
19:32:28FromDiscord<Elegantbeef> There is not but you can always make one if you want it
19:32:37FromDiscord<Elegantbeef> wouldnt be named `xor=` though
19:34:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3B2F
19:46:59FromDiscord<Goel> SDL library does that too, returns a -1 almost on all procs to check if it succeeded or not, and in the end it means a lot of ugly `discard` everywhere. Fortunatly `{.discardable.}` cleans it by a lot
19:48:05nrds<Prestige99> I usually use that return 'code' then display the sdl error message
19:48:19FromDiscord<Goel> (edit) "lot" => "lot. But in the end is about priority. For example the `-1` on `init()` or other main procs are a must have, while others are not needed at all and just overkill"
19:50:06nixfreak_nim[m]1supakeen: did you start porting from shell and python?
19:55:28supakeenno, i started the rule that any program that could be rewritten within a working day was allowed to be written in any language a programmer likes
19:55:48supakeenwhich did indeed mostly involve small shell scripts and assorted tidbits
19:58:51FromDiscord<sealmove> another perfect use case for Nim seems to be devops
19:59:39supakeenwe mostly had a bunch of small forwarding or information gathering programs that run on a lot of virtual machines, those were historically written in python
19:59:51supakeenthose small programs were easily ported to nim and RES savings were very good :)
20:00:43supakeenlosing 50MB here or there on daemons that run on all VMs is a lot of memory saved even with dedup
20:17:23FromDiscord<Yardanico> dedup?
20:17:38FromDiscord<Yardanico> what kind of software allows you to have ram deduplication?
20:19:16FromDiscord<leorize> linux's ksm can dedup ram
20:20:07FromDiscord<Yardanico> how well does that work 🤔
20:30:41supakeenKSM works 'ok'
20:34:19FromDiscord<no name fits> I forgot how to find the bleeding edge docs 😓
20:38:04FromDiscord<el__maco> hmm↵``fatal error C1001: Internal compiler error.↵(compiler file 'd:\A01\_work\12\s\src\vctools\Compiler\Utc\src\p2\main.c', line 213)``
20:39:04FromDiscord<el__maco> sent a code paste, see https://paste.rs/Mak
20:39:28FromDiscord<no name fits> nvm I found them, srry
20:39:29FromDiscord<Yardanico> uh
20:39:38FromDiscord<Yardanico> @elmaco you hit a visual studio internal bug :D
20:39:53FromDiscord<qb> I've had a website which compares simple python code and on the other end the nim code. Was it on github? Could someone tell me where I can find it?
20:40:08FromDiscord<Yardanico> c1001 is a compiler crash basically
20:40:29FromDiscord<Yardanico> a visual studio compiler crash, not nim compiler crash
20:41:22FromDiscord<qb> nvm, got it https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers`
20:41:55FromDiscord<Yardanico> @qb just saying, this page isn't really official
20:42:33FromDiscord<Goel> You can check it out this too, it is helpfull at timesfor comparison even if some examples are very old or not all of them are covered @qb ↵http://rosettacode.org/wiki/Category:Programming_Languages
20:43:29FromDiscord<Yardanico> too sad that rosettacode is still using this ancient engine and way of sharing code
20:43:47FromDiscord<Yardanico> there's an announcement from a year ago about "modernizing rosetta code infrastructure", but so far nothing really has come out of it
20:45:14FromDiscord<Goel> It also says "connection is not secure to this website" probably they forgot to renew their security certificates 😱
20:46:12FromDiscord<Yardanico> no
20:46:25FromDiscord<Yardanico> @Goel that's the way modern browsers say that website doesn't use http
20:46:25FromDiscord<Yardanico> (edit) "http" => "https"
20:46:38FromDiscord<Yardanico> rosettacode has https though, but there's no automatic redirect
20:46:38FromDiscord<Yardanico> https://rosettacode.org/wiki/Category:Programming_Languages
20:47:30FromDiscord<Yardanico> if the website has an expired certificate any modern browser will first display a big red warning and _only_ if you say that you're certain that it's safe, the browser will let you see the website
20:48:25*PMunch quit (Quit: leaving)
20:51:29FromDiscord<Goel> Thats good, smart browsers 😄 By the way Yardanico, earlier i was having a look around github new programming languages and i was curious about one of them called Arturo. I checked it and i was surprized to notice it was made `Nim 56.4%`!
20:54:54FromDiscord<Yardanico> there are a lot of smallish proglangs made in nim
21:07:32FromDiscord<tandy> what can you replace `copyMem` and `zeroMem` with for the js backend?
21:09:05FromDiscord<Yardanico> check out https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/streams.nim for some examples
21:09:31FromDiscord<tandy> ty
21:10:32FromDiscord<tandy> looks like `cast`?
21:11:11FromDiscord<el__maco> I updated msvc but it keeps crashing(?). Only if --opt:speed is provided, e.g. --opt:size is fine 🤔↵do I really have to install gcc 🥺
21:14:22*neurocyte0132889 quit (Ping timeout: 265 seconds)
21:27:07*Gustavo6046 quit (Remote host closed the connection)
21:27:35*Gustavo6046 joined #nim
21:28:54*jafarlihi joined #nim
21:29:57*Vladar quit (Quit: Leaving)
21:30:22FromDiscord<no name fits> Choosenim does that for you I'm pretty sure
21:31:32FromDiscord<no name fits> What's a good data structure to use when I have several keys that map to the same value?
21:34:17FromDiscord<IsaacPaul> I'd just use a dictionary or hashmap
21:35:06*NeoCron quit (Quit: Leaving)
21:35:26FromDiscord<IsaacPaul> if memory is an issue id make a dictionary with the content hashed and use that as the key.
21:35:27*NeoCron joined #nim
21:36:16FromDiscord<IsaacPaul> if you need several keys to match that 1 key then (dictionary again) lol. If you're asking if there's a well known structure that already does this then "shrug"
21:36:21FromDiscord<IsaacPaul> (edit) ""shrug"" => "idk 🤷‍♂️"
21:38:44FromDiscord<IsaacPaul> https://www.quora.com/What-is-the-best-data-structure-for-mapping-multiple-keys-to-the-same-value↵> One reasonable option is to use a pair of hash tables. The first one maps keys to standardized keys, and the second one maps standardized keys to values.↵Seems like that's what is recommended
21:39:12FromDiscord<no name fits> I see, thanks
21:41:25FromDiscord<no name fits> I was hoping there was some weird tree structure or something that fixed it really cleanly. Good old dictionary
21:42:45nrds<Prestige99> Why are there keys mapping to the same value a lot?
21:43:04nrds<Prestige99> almost sounds like the map is inverted
21:53:36*max22- quit (Quit: Leaving)
21:54:31FromDiscord<rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3B36
22:10:07FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3B39
22:18:42FromDiscord<Elegantbeef> Hmm i can probably help!
22:18:42FromDiscord<geekrelief> hmm look like my issue might be because the dot operator is inside a macro.
22:19:11FromDiscord<geekrelief> In reply to @Elegantbeef "Hmm i can probably": Hey beef, you talking to me?
22:19:20FromDiscord<Elegantbeef> Yes
22:19:26FromDiscord<geekrelief> I'm think it's something up with the `cOverride` macro from nimterop.
22:19:37FromDiscord<geekrelief> (edit) "I'm" => "I"
22:20:08FromDiscord<Elegantbeef> The first block works fine
22:20:35FromDiscord<geekrelief> yeah it appears to compile
22:22:29FromDiscord<geekrelief> hmm it's gotta be something with nimterop then 🥲
22:23:30FromDiscord<geekrelief> I'm starting to wonder if it's even worth it using nimterop now lol
22:28:55FromDiscord<geekrelief> maybe it's too soon to jump to that conclusion.
22:54:52*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:06:09*NeoCron quit (Quit: Leaving)
23:14:41*jafarlihi quit (Quit: WeeChat 3.3)
23:26:44FromDiscord<el__maco> how does one go from ``newSeq[cchar]`` to ``string``
23:27:01FromDiscord<el__maco> (edit) "``newSeq[cchar]``" => "``seq[cchar]``"
23:29:37*Zevv quit (Ping timeout: 252 seconds)
23:30:05FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3B3m
23:30:06FromDiscord<Elegantbeef> Two methods
23:32:15FromDiscord<el__maco> ``cast[string]`` seems to work, thanks
23:56:04FromDiscord<ynfle (ynfle)> @el\_\_maco I wouldn't rely on it. That's an implementation detail. `cast` in nim is a bit cast not a type cast