<< 07-02-2022 >>

00:00:24*tk quit (Quit: Well, this is unexpected.)
00:00:49*tk joined #nim
00:02:53FromDiscord<noow> i gotta get used to half the stdlib's being gotchas
00:03:11FromDiscord<noow> and to half of them modifying things i'm passing as arguments
00:03:23FromDiscord<noow> (edit) "and to half of them modifying things i'm passing as arguments ... " added "instead of returning values based on them"
00:06:22FromDiscord<Yepoleb> no just write your own functions that do things the sane way
00:06:35FromDiscord<Yepoleb> or copy them from somewhere
00:37:05NimEventerNew thread by Nycto: Void as a type in a tuple, see https://forum.nim-lang.org/t/8877
00:42:39FromDiscord<Tuatarian> is there anything i can do about this?
00:42:41FromDiscord<Tuatarian> this code
00:42:54FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=3OTY
00:43:05FromDiscord<Tuatarian> gives an internal error on 1.4.4
00:43:10FromDiscord<Tuatarian> `Error: internal error: proc has no result symbol`
00:43:22FromDiscord<Tuatarian> sorry forgot to include some stuff
00:43:25FromDiscord<Tuatarian> `C:\Program Files\nim-1.4.4\lib\pure\strutils.nim(517, 10) Error: internal error: proc has no result symbol`
00:43:46FromDiscord<Tuatarian> a more split version of the (I think) offending line is
00:44:20FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=3OTZ
00:44:38FromDiscord<Tuatarian> also, I get this warning
00:44:40FromDiscord<Tuatarian> `d:\Scripts\Misc\Nim\Nim\games\sPuzPic\rayutils.nim(1, 67) Warning: imported and not used: 'sequtils' [UnusedImport]`
00:44:47FromDiscord<Tuatarian> even though I have very much used sequtils
00:44:56FromDiscord<Tuatarian> neither of these errors show up in vscode
00:45:11FromDiscord<Tuatarian> wasn't able to do the ./koch c thing, not sure how to
00:49:31FromDiscord<ynfle> @Tuatarian Can you share more of the code?
00:54:53FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3OU0
00:55:30FromDiscord<ynfle> (edit) "https://play.nim-lang.org/#ix=3OU0" => "https://paste.rs/d2H"
00:59:01FromDiscord<Tuatarian> Didn't realize endswith existed, that's super useful
00:59:12FromDiscord<Tuatarian> I'll copy paste the whole file
00:59:25FromDiscord<Tuatarian> onto pasteofcode
00:59:38FromDiscord<noow> sent a code paste, see https://play.nim-lang.org/#ix=3OU2
01:00:13FromDiscord<Tuatarian> main.nim : https://paste.ofcode.org/tdSrfrZ4wAw6nSPgctSmiX
01:00:47FromDiscord<noow> try putting that strformat into its own var and using it
01:00:58FromDiscord<noow> does it still error
01:02:39FromDiscord<Tuatarian> In reply to @noow "this code compiles for": I get an IO error if I run that line in isolation
01:03:20FromDiscord<noow> but that's a runtime error, I thought we were talking about a compiler error
01:03:43FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3OU6
01:03:44FromDiscord<Tuatarian> In reply to @noow "try putting that strformat": yes
01:04:05FromDiscord<Tuatarian> In reply to @ynfle "Just remove strformat and": the thing is appending another path
01:04:25FromDiscord<Tuatarian> can you do it like `"assets" / folders[i]`?
01:04:31FromDiscord<ynfle> In reply to @iWonderAboutTuatara "can you do it": Ya
01:04:32FromDiscord<noow> sent a code paste, see https://play.nim-lang.org/#ix=3OU7
01:04:41FromDiscord<ynfle> Is `.path` a field?
01:04:44FromDiscord<Tuatarian> ok so then the internal error thing is from elsewhere
01:04:45FromDiscord<Tuatarian> yes
01:05:00FromDiscord<ynfle> If you comment out the line it compiles?
01:05:01FromDiscord<Tuatarian> walkdir gives a tuple of kind and path
01:05:17FromDiscord<Tuatarian> no
01:05:28FromDiscord<Tuatarian> ok so the error is elsewhere which is odd
01:06:24FromDiscord<Tuatarian> also, why is it saying that I didn't use sequtils?
01:07:18FromDiscord<ynfle> In reply to @iWonderAboutTuatara "also, why is it": If it doesn't compile properly, so then import may not be used
01:07:22FromDiscord<Tuatarian> ok so the issue is in this function
01:07:26FromDiscord<noow> there's another line with sequtils in it
01:07:30FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=3OU9
01:07:34FromDiscord<Tuatarian> I rewrote the split func to try to identify it
01:07:47FromDiscord<Tuatarian> it gives `internal error: proc has no result symbol`
01:07:54FromDiscord<Tuatarian> not really sure what to make of that
01:08:13FromDiscord<huantian> what is this function supposed to do
01:08:17FromDiscord<Tuatarian> split
01:08:20FromDiscord<Tuatarian> its the split iterator
01:08:40FromDiscord<Tuatarian> can confirm the variable being named result is not the issue, if I rename it the problem persists
01:08:48FromDiscord<huantian> wait why not just use split?
01:09:01FromDiscord<ynfle> Try compile with `--verbosity:2`
01:09:10FromDiscord<noow> is the `in` defined for strings?
01:09:22FromDiscord<Tuatarian> In reply to @huantian "wait why not just": I was using split initally but I copied it over to another file to try to find the issue more easily
01:09:29FromDiscord<Tuatarian> In reply to @noow "is the `in` defined": pretty sure
01:09:36FromDiscord<Tuatarian> almost 100% sure
01:09:39FromDiscord<ynfle> Not for char I don't think
01:09:47FromDiscord<Tuatarian> you can't do char in string?
01:09:54FromDiscord<Tuatarian> the regular split iterator causes the same issue btw
01:10:00FromDiscord<ynfle> Nver mind
01:10:14FromDiscord<Tuatarian> In reply to @ynfle "Try compile with `--verbosity:2`": same error
01:10:29FromDiscord<ynfle> In reply to @iWonderAboutTuatara "same error": I know, but it may give more information
01:10:37FromDiscord<Tuatarian> it didn't I mean
01:10:40FromDiscord<Tuatarian> sorry I phrased that badly
01:10:43FromDiscord<Tuatarian> it gave the same error
01:11:07FromDiscord<noow> sent a code paste, see https://play.nim-lang.org/#ix=3OUa
01:11:11FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=3OUb
01:11:49FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=3OUc
01:11:54FromDiscord<Tuatarian> just copied it over to test
01:12:25FromDiscord<noow> sent a code paste, see https://play.nim-lang.org/#ix=3OUd
01:12:42FromDiscord<noow> wait maybe it's the combination of iterators with toSeq or something
01:13:29FromDiscord<huantian> I mean if you're using toSeq, just use the function version of split
01:13:31FromDiscord<noow> imgtxt[imgid].spsplit("&!&").pairs
01:13:33FromDiscord<noow> you're doing this
01:13:49FromDiscord<noow> lemme try including this as well in my small test
01:13:57FromDiscord<Tuatarian> In reply to @huantian "I mean if you're": there's a funciton version of split?
01:14:04FromDiscord<huantian> https://nim-lang.org/docs/strutils.html#split%2Cstring%2Cchar%2Cint
01:14:10FromDiscord<Tuatarian> also I changed the orignal line to use the proc version of readlines so no split there
01:14:18FromDiscord<Tuatarian> In reply to @huantian "https://nim-lang.org/docs/strutils.html#split%2Cstr": lmao I had no idea
01:14:43FromDiscord<noow> are you sure line 189 is possible to do?
01:14:55FromDiscord<Tuatarian> if shown?
01:15:10FromDiscord<noow> sent a code paste, see https://play.nim-lang.org/#ix=3OUe
01:15:36FromDiscord<Tuatarian> huh
01:15:40FromDiscord<Tuatarian> does that work for normal split?
01:15:51FromDiscord<Tuatarian> gives the same issue for me with normal split
01:15:54FromDiscord<Tuatarian> that's really weird
01:16:34FromDiscord<Tuatarian> ok the error disappears if I dont' use pairs here
01:16:43FromDiscord<noow> pairs is only defined for a few builtin types
01:16:44FromDiscord<noow> https://nim-lang.org/docs/iterators.html#pairs.i%2Ccstring
01:16:51FromDiscord<Tuatarian> placing inx outside the loop and incrementing it manually compiles fine
01:16:52FromDiscord<huantian> this works
01:16:56FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3OUf
01:17:14FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3OUg
01:17:29FromDiscord<huantian> actaully the .pairs is redundant
01:17:37FromDiscord<Tuatarian> ok so split needs to be function not iterator
01:17:44FromDiscord<Tuatarian> but if I put split there it assumes it's iterator not a function
01:17:53FromDiscord<Tuatarian> so you need to manually make it a seq instead of an iterator
01:18:03FromDiscord<Tuatarian> or just count the inx outside and not deal with pairs
01:18:05FromDiscord<noow> if split returns a seq you can also just iterate over seq's
01:18:17FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3OUh
01:19:15FromDiscord<Tuatarian> so enumerate is kind of a generalization of pairs?
01:19:38FromDiscord<Tuatarian> or is it that enumerate takes an iterator?
01:19:39FromDiscord<noow> i think pairs guarantees that the index belongs to the value in case of things like tables?
01:19:47FromDiscord<noow> and pairs is used for data types
01:20:05FromDiscord<Tuatarian> oh I see
01:20:06FromDiscord<noow> (edit) "used" => "an iterator itself"
01:20:11FromDiscord<Tuatarian> and enumerate doesn't guarantee order necessarily
01:20:12FromDiscord<ynfle> In reply to @iWonderAboutTuatara "so enumerate is kind": Ya
01:20:23FromDiscord<Tuatarian> ok thanks guys
01:20:28FromDiscord<ynfle> In reply to @iWonderAboutTuatara "and enumerate doesn't guarantee": It should
01:20:30FromDiscord<Tuatarian> this was a gigantic help
01:20:31FromDiscord<noow> In reply to @iWonderAboutTuatara "and enumerate doesn't guarantee": i think enumerate keeps the order of the iterator passed?
01:20:44FromDiscord<Tuatarian> in the examples enumerate is enumerating over non iterator things also
01:20:50FromDiscord<ynfle> Did you issue get solved?
01:20:54FromDiscord<Tuatarian> yep
01:20:57FromDiscord<Tuatarian> compiling perfectly
01:20:59FromDiscord<ynfle> How?
01:21:07FromDiscord<Tuatarian> I removed pairs
01:21:20FromDiscord<noow> In reply to @iWonderAboutTuatara "in the examples enumerate": it's a macro though, so it should work for anything i think
01:21:22FromDiscord<Tuatarian> am counting inx manually, declared the var prior to the loop and increment each time
01:21:42FromDiscord<Tuatarian> In reply to @noow "it's a macro though,": yeah, if its loopable enumerate should work
01:21:43FromDiscord<ynfle> Please file a bug, internal errors, shouldn't exist
01:22:00FromDiscord<ynfle> Which pairs did you remove?
01:22:24FromDiscord<noow> https://paste.ofcode.org/tdSrfrZ4wAw6nSPgctSmiX line 189
01:22:28FromDiscord<Tuatarian> on line 191
01:22:31FromDiscord<Tuatarian> oh 189?
01:22:37FromDiscord<Tuatarian> ok it's different in my vscode
01:22:42FromDiscord<Tuatarian> not sure how to file a bug report
01:22:52FromDiscord<Tuatarian> it says to run the ./koch thing but I don't really know what to do for that
01:23:17FromDiscord<noow> that's for recompiling the compiler so it shows more info
01:23:27FromDiscord<Tuatarian> you have to import enumerate as std/enumerate
01:23:31FromDiscord<Tuatarian> you can't just do import enumerate
01:23:32FromDiscord<Tuatarian> that's strange
01:23:34FromDiscord<noow> but trying to reduce the issue to a small nim code that also doesn't compile with the same internal error should be enough probably
01:23:57FromDiscord<ynfle> @Tuatarian for the file extension stuff you can use this https://nim-lang.org/docs/os.html#splitFile%2Cstring
01:24:25FromDiscord<Tuatarian> it's recombining not separating
01:24:29FromDiscord<ynfle> In reply to @iWonderAboutTuatara "not sure how to": Open an issue on https://github.com/nim-lang/Nim/issues with a minimal reproducible example
01:24:35FromDiscord<ynfle> In reply to @iWonderAboutTuatara "it's recombining not separating": For the filtering?
01:24:40FromDiscord<Tuatarian> yeah
01:24:50FromDiscord<Tuatarian> &"assets/{folders[i]}"
01:24:59FromDiscord<Tuatarian> folders[i] is a directory in assets
01:25:17FromDiscord<ynfle> No I meant `filterIt(it.path[^4..^1] == ".imdat")`
01:25:31FromDiscord<ynfle> it.splitFile.ext
01:25:42FromDiscord<Tuatarian> does `walkDir(relative=false)` give paths relative to the file or like the system path?
01:25:55FromDiscord<Tuatarian> In reply to @ynfle "No I meant `filterIt(it.path[^4..^1]": oh I see, that's a good idea probably
01:25:59FromDiscord<huantian> In reply to @iWonderAboutTuatara "does `walkDir(relative=false)` give paths": > Walking is not recursive. If relative is true (default: false) the resulting path is shortened to be relative to dir.
01:26:03FromDiscord<Tuatarian> I think there's also an endsWith proc that I could use
01:26:10*jmdaemon joined #nim
01:26:11FromDiscord<noow> what nim version are you using?
01:26:12FromDiscord<ynfle> In reply to @iWonderAboutTuatara "does `walkDir(relative=false)` give paths": Docs say `relative = true` makes the returned paths relative
01:26:18FromDiscord<Tuatarian> relative to the dir it starts walking from right?
01:26:37FromDiscord<ynfle> In reply to @iWonderAboutTuatara "I think there's also": Ya. But may be easier. 🤷‍♂️ Whatever you want
01:26:43FromDiscord<ynfle> In reply to @noow "what nim version are": 1.4.4 from above errors
01:26:52FromDiscord<ynfle> In reply to @iWonderAboutTuatara "relative to the dir": Probably not
01:27:00FromDiscord<huantian> In reply to @ynfle "Ya. But may be": I'd say splitfile is more explicit
01:27:05FromDiscord<noow> yeah it's fixed in latest nim
01:27:06FromDiscord<Tuatarian> ie if it starts walking in `assets/` then you'd get, say, `assets/classic` as `classic`
01:27:21FromDiscord<Tuatarian> using 1.4.4.
01:27:26FromDiscord<noow> i could reproduce the bug in 1.4.4 by just trying to call .pairs on an iterator
01:27:33FromDiscord<noow> but in 1.6.2 it gives you a nice error message
01:27:40FromDiscord<ynfle> In reply to @noow "but in 1.6.2 it": 🥳
01:27:42FromDiscord<Tuatarian> is choosenim working on windows btw?
01:27:46FromDiscord<ynfle> In reply to @iWonderAboutTuatara "is choosenim working on": Ya
01:27:54FromDiscord<Tuatarian> it was broken for the longest time
01:28:54FromDiscord<Tuatarian> epic
01:29:08FromDiscord<Tuatarian> so happy to not have to deal with changing PATH every time I want to update
01:29:25FromDiscord<ynfle> In reply to @iWonderAboutTuatara "it was broken for": From this post https://forum.nim-lang.org/t/8839#57877 it seems like it does
01:30:12FromDiscord<Tuatarian> yeah it worked for me
01:30:52FromDiscord<Tuatarian> though... it did not update PATH
01:30:52FromDiscord<noow> In reply to @ynfle "From this post https://forum.nim-lang.org/t/8839#57": they used the wrong arg no? it wasn't choosenim not working
01:31:05FromDiscord<noow> it doesn't update PATH on linux either
01:31:12FromDiscord<Tuatarian> oh so I have to do it manually?
01:31:22FromDiscord<ynfle> In reply to @noow "they used the wrong": Right, but it seems that that was the only issue
01:31:25FromDiscord<Tuatarian> that was the most painful part of updating lmao
01:31:25FromDiscord<ynfle> In reply to @iWonderAboutTuatara "oh so I have": No
01:31:27FromDiscord<noow> on linux I had to add ~/.nimble/bin to PATH manually once
01:31:44FromDiscord<noow> I don't know where choosenim puts things on win
01:31:56FromDiscord<huantian> yeah you just add `export PATH="$HOME/.nimble/bin:$PATH"` to your rc file
01:32:18FromDiscord<noow> I think they use a "environment variables" program to do that on windows, i'm not sure
01:32:25FromDiscord<noow> (edit) "they" => "people"
01:34:06FromDiscord<Tuatarian> I'm on windows atm
01:34:19FromDiscord<ynfle> Did choosenim work?
01:34:28FromDiscord<Tuatarian> it downloaded it but doesn't seem to have changed path
01:34:44FromDiscord<Tuatarian> export PATH="$HOME/.nimble/bin:$PATH
01:34:47FromDiscord<Tuatarian> I have this in path
01:34:57FromDiscord<Tuatarian> but it still calls nim 1.4.4 compiler
01:35:54FromDiscord<ynfle> What's in your `$HOME/.nimble` dir?
01:36:16FromDiscord<huantian> In reply to @iWonderAboutTuatara "export PATH="$HOME/.nimble/bin:$PATH": I don't thinkt this works on windows
01:36:28FromDiscord<noow> In reply to @iWonderAboutTuatara "export PATH="$HOME/.nimble/bin:$PATH": that was a bash command
01:36:29FromDiscord<huantian> you have to add the path to the folder where choosenim is installed at the end
01:36:39FromDiscord<Tuatarian> II copied this from the path environment vairable
01:36:58FromDiscord<Tuatarian> it shows in the thing as C:/Users/Admin/.nimble\bin
01:37:07FromDiscord<Tuatarian> where is choosenim installed?
01:37:12FromDiscord<noow> that is it
01:38:21FromDiscord<noow> also, you should remove the path to 1.4.4 from PATH
01:38:42FromDiscord<noow> or else if it comes before the .nimble/bin, it will resolve it to 1.4.4
01:38:49FromDiscord<Tuatarian> it's already not there
01:39:18FromDiscord<noow> is C:/Users/Admin/.nimble/bin (i'm not sure if you have to use backslashes or forward slashes) in your PATH?
01:40:41FromDiscord<Tuatarian> my old nim version was in programfiles
01:40:52FromDiscord<Tuatarian> having difficulty deleting it because something is using some files
01:41:02FromDiscord<noow> you don't need to delete the nim install
01:41:07FromDiscord<noow> it's enough to remove the path to it from PATH
01:41:28FromDiscord<Tuatarian> it's installed in `C:\Program Files\nim-1.4.4`
01:41:37FromDiscord<Tuatarian> which I don't think it's supposed to be in right?
01:41:50FromDiscord<noow> what is installed in there
01:41:54FromDiscord<ynfle> Just put choosenim before that in path
01:41:56FromDiscord<Tuatarian> Nim 1.4.4
01:42:01FromDiscord<Tuatarian> that's not in path at all
01:42:05FromDiscord<Tuatarian> but somehow cmd still calls it
01:42:20FromDiscord<Tuatarian> ok now it works
01:42:28FromDiscord<Tuatarian> should I be using i386 or amd64?
01:42:31FromDiscord<ynfle> 👍
01:42:31FromDiscord<noow> you need to close and reopen the cmd to get the updated PATH var
01:42:42FromDiscord<noow> amd64 if your windows is 64 bit
01:42:44FromDiscord<Tuatarian> I thought launching new guake windows from windows terminal counts
01:42:45FromDiscord<ynfle> In reply to @iWonderAboutTuatara "should I be using": Whatever you architechture is
01:42:46FromDiscord<Tuatarian> but apparently not
01:42:56FromDiscord<Tuatarian> I have intel 64
01:43:09FromDiscord<noow> then amd64
01:43:37FromDiscord<Tuatarian> how do I switch it?
01:43:58FromDiscord<noow> no idea how you set it
01:44:12FromDiscord<noow> did choosenim ask you?
01:44:17FromDiscord<Tuatarian> nope
01:44:26FromDiscord<ynfle> It should detech automatically
01:44:31FromDiscord<ynfle> (edit) "detech" => "detect"
01:44:43FromDiscord<Tuatarian> it seems to have botched something then
01:44:48FromDiscord<Tuatarian> my pc is definitely x64
01:45:01FromDiscord<noow> your windows install could be 32 bit
01:45:04FromDiscord<Tuatarian> I have i5 7400
01:45:05FromDiscord<Tuatarian> don't think so
01:45:06FromDiscord<Tuatarian> I
01:45:13FromDiscord<Tuatarian> I've run x64 executables and such before
01:45:18FromDiscord<noow> weird then
01:45:20FromDiscord<Tuatarian> https://media.discordapp.net/attachments/371759389889003532/940060631699177492/unknown.png
01:45:26FromDiscord<Tuatarian> from dxdiag
01:45:53FromDiscord<noow> sorry no idea where you can change it, i don't think we have a 32 bit option on linux
01:46:21FromDiscord<ynfle> How do you know nim insallation is 32?
01:46:49FromDiscord<Tuatarian> when I run nim -v
01:46:55FromDiscord<Tuatarian> Nim Compiler Version 1.6.2 [Windows: i386]
01:47:12FromDiscord<Tuatarian> apparently I need to put mingw64 somewhere annd add it to path
01:48:13FromDiscord<Tuatarian> where do I even download mingw 64?
01:48:58FromDiscord<Tuatarian> https://www.mingw-w64.org/downloads/
01:49:06FromDiscord<Tuatarian> which one of these do I download?
01:49:12FromDiscord<noow> if it has to be in PATH, i'd guess anywhere as long as you add wherever it is to PATH
01:49:33FromDiscord<Tuatarian> lmao my question was even more basic
01:49:43FromDiscord<Tuatarian> like literally where do I download the files
01:49:46FromDiscord<Tuatarian> is it on choco?
01:50:12FromDiscord<noow> MingW-W64-builds i'd guess
01:50:25FromDiscord<huantian> <https://nim-lang.org/install_windows.html>
01:50:29FromDiscord<huantian> there are mingw64 installs here
01:50:41FromDiscord<noow> ah true ^
01:52:08FromDiscord<Tuatarian> thanks
01:52:20FromDiscord<Arathanis> How could you make a decorator that just adds a proc to a sequence of procs? Like handler registration.
01:53:25FromDiscord<Elegantbeef> https://github.com/beef331/nettyrpc/blob/master/src/nettyrpc.nim#L229-L250 shows one way
01:53:28FromDiscord<Elegantbeef> Depending on what you're doing it can be very simple
01:54:19FromDiscord<Arathanis> you have a usage example for it?
01:54:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OUj
01:55:46FromDiscord<Arathanis> ohhhh ok so its being used as a pragma, does that pass the body of the proc to the macro?
01:55:56FromDiscord<Arathanis> or the whole proc?
01:56:09FromDiscord<Elegantbeef> It passes the whole proc
01:57:01FromDiscord<Arathanis> let me chew on this for a while
01:57:01FromDiscord<Arathanis> thank you
01:57:30FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/LuD
01:57:37FromDiscord<Elegantbeef> Whoops
01:58:23FromDiscord<Tuatarian> In reply to @huantian "<https://nim-lang.org/install_windows.html>": worked perfectly, thank you
01:58:28FromDiscord<Tuatarian> had to swap around a bit to reinstall 1.6.2
01:58:34FromDiscord<Tuatarian> but after that I have the x64 version
01:58:36FromDiscord<Tuatarian> also hello beef!
02:00:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OUl
02:00:39FromDiscord<Elegantbeef> There is a simple version of what my nettyrpc does
02:00:51FromDiscord<Elegantbeef> Hello tuatara
02:03:46FromDiscord<Elegantbeef> @Arathanis\: ^ if you left 😛
02:04:28FromDiscord<noow> sent a code paste, see https://play.nim-lang.org/#ix=3OUm
02:04:35FromDiscord<noow> and to compile time add them
02:05:19FromDiscord<noow> also, this means that anyone subscribing has to import the package where procTable and subscribe are defined right
02:05:36FromDiscord<Elegantbeef> Nop
02:06:18FromDiscord<Elegantbeef> `bindSym` means `procTable` can stay private
02:20:20FromDiscord<noow> cool
02:25:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OUn
02:26:55*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
02:27:12FromDiscord<noow> ahh cool
02:27:18NimEventerNew Nimble package! audius - Audius is a simple client library for interacting with the Audius free API., see https://github.com/ceebeel/audius
02:27:35FromDiscord<noow> CacheSeq is something new to me
02:29:44*jmdaemon joined #nim
02:30:13FromDiscord<Elegantbeef> `macrocache` is a cross module cache for nim code, so you can use it to cheat 😀
02:30:46FromDiscord<Elegantbeef> you can subscribe from different modules then do `emitProcArr` and access procedures that are even hidden
02:34:32*rockcavera joined #nim
02:34:32*rockcavera quit (Changing host)
02:34:32*rockcavera joined #nim
02:55:40*arkurious quit (Quit: Leaving)
02:55:59FromDiscord<noow> woah nice
02:56:22FromDiscord<noow> sounds like a great power with great responsibility
04:27:23*rockcavera quit (Remote host closed the connection)
06:39:44*Gustavo6046 quit (Quit: Leaving)
07:10:06*neurocyte0917090 joined #nim
07:18:17*PMunch joined #nim
08:09:24NimEventerNew thread by Kobi: Is there support for a network stream?, see https://forum.nim-lang.org/t/8878
08:36:35NimEventerNew post on r/nim by mavavilj: Nim has made me passionate about programming again., see https://reddit.com/r/nim/comments/smlecb/nim_has_made_me_passionate_about_programming_again/
10:04:44FromDiscord<xx_ns> such a positive post
10:04:54FromDiscord<Hamid_Bluri> hey, how can i convert an `int` to `cuint` (uint32) ?
10:05:29FromDiscord<Elegantbeef> `cuint myInt`
10:06:31FromDiscord<Hamid_Bluri> thanks beef
10:06:34FromDiscord<Hamid_Bluri> you're my hero
10:07:10FromDiscord<Hamid_Bluri> did you get paid to be here and answer questions in community?
10:07:16FromDiscord<Hamid_Bluri> (edit) "did" => "do"
10:07:50FromDiscord<Elegantbeef> Nope
10:09:38FromDiscord<xx_ns> only in exposure
10:09:54FromDiscord<Elegantbeef> not that
10:10:07FromDiscord<Rika> thats lewd
10:11:10FromDiscord<Elegantbeef> thanks rika that's my go to joke about "exposure"
10:12:00PMunch@Hamid_Bluri, of course you can call that any way you like so `cuint(myInt)`, `cuint myInt`, or `myInt.cuint`
10:12:24FromDiscord<Elegantbeef> Pmunch you arent getting paid anymore than me, dont put in the extra effort 😛
10:13:57PMunchI get paid in peers, the more people I can help getting started with Nim the more people I have to discuss Nim with in the future :P
10:14:11FromDiscord<Elegantbeef> Like i said same payment
10:14:25FromDiscord<xx_ns> that's what i said
10:14:27FromDiscord<xx_ns> exposure
10:14:37FromDiscord<xx_ns> ... exposure of Nim to other people
10:14:41FromDiscord<Elegantbeef> No my pants stay on
10:14:46FromDiscord<xx_ns> have it your way
10:47:28FromDiscord<konsumlamm> In reply to @hamidb80 "hey, how can i": note that a `cuint` may not always be 32 bits (it's only guaranteed to be at least 16 bits)
10:48:27FromDiscord<konsumlamm> (and an `int` may not always fit in a `uint32`, at least on 32 bit platforms)
11:17:37FromDiscord<Phil> In reply to @Elegantbeef "`cuint myInt`": these c integer types are always only one letter away from an insult
11:17:41FromDiscord<Phil> That thought keeps me up during work
11:23:26FromDiscord<Rika> good, its not a good idea to sleep at work
11:23:30*billypilgrim joined #nim
11:24:46FromDiscord<Phil> Every line of code I don't write is one that can't be buggy
11:26:28billypilgrimHowdy nimsters
11:26:41FromDiscord<Phil> Chers
11:26:43FromDiscord<Phil> (edit) "Chers" => "Cheers"
11:27:34billypilgrimI'm busy hacking something together which calls a nimscript using the compiler/nimeval package
11:27:59billypilgrimBut the problem is that the methods which are supposed to be present in nimscripts (e.g. cd, exec etc.) don't seem to work
11:28:22billypilgrimEven if I manually add "import nimscript" to the script, calling e.g. exec seems to just be a no-op
11:28:45billypilgrimAm I right in thinking I'd have to pick the compiler apart to get these builtin functions in my interpreter?
11:33:03FromDiscord<zidsal> It's simple let's make a nft of the nim logo and pay helpers in nft. To the moon!
11:41:20PMunch@billypilgrim, not sure if it would solve your problem. But have you tried doing it with nimscripter? https://github.com/beef331/nimscripter
11:42:47PMunch@Phil, haha, we should have a template in Nim `template cunt*(x: varargs[untyped]): untyped = {.error: "What the fuck did you just call me?!".}`
11:43:02PMunchSo if you ever spell it wrong the compiler will seem mad at you
11:43:11FromDiscord<Phil> I support this RFC
11:43:14FromDiscord<Phil> Somebody call ARAQ
11:43:18FromDiscord<Phil> (edit) "ARAQ" => "Araq"
11:43:23NimEventerNew post on r/nim by mavavilj: Any idiomatic ways to do R-style seq in Nim?, see https://reddit.com/r/nim/comments/smo9e7/any_idiomatic_ways_to_do_rstyle_seq_in_nim/
11:44:45billypilgrim@PMunch Thanks! That does look like it could be exactly what I'm looking for :-D
11:52:25*rockcavera joined #nim
11:52:25*rockcavera quit (Changing host)
11:52:25*rockcavera joined #nim
11:55:57*billypilgrim quit (Quit: Konversation terminated!)
11:57:21FromDiscord<Hamid_Bluri> sent a code paste, see https://paste.rs/Q7i
12:00:40FromDiscord<Phil> Defined just means the flag is set I think, so you need the flag value, hmmmm
12:02:31FromDiscord<Phil> I'm reasonably certain that pmunch recalls how to get a flags value
12:03:04FromDiscord<xflywind> In reply to @hamidb80 "how can I check": use `compileOption("threads")`
12:03:18FromDiscord<xflywind> (edit) "`compileOption("threads")`" => "`echo compileOption("threads")`"
12:04:45FromDiscord<Hamid_Bluri> thanks
12:05:13FromDiscord<Phil> The docs: https://nim-lang.org/docs/system.html#compileOption,string,string
12:06:16PMunch@Phil, I didn't remember and @xflywind answered by the time I had looked it up :P
12:07:00*billypilgrim joined #nim
12:07:49FromDiscord<Phil> Impossible!
12:08:02billypilgrim@PMunch: Hmm... after upgrading my nim to v1.6.2 I now get this message when trying to use nimscripter: "Error: cannot open file: compiler/nimeval"
12:08:13billypilgrimDoes choosenim not install the compiler stuff by default?!
12:09:55PMunchHmm, it should
12:11:17FromDiscord<ynfle> In reply to @billypilgrim "Does choosenim not install": It doesn't install the compiler nimble package. Try `nimble install compiler`
12:13:20billypilgrimOhhh that did the trick. Thanks!
12:19:05billypilgrimHeh I'm still running up against my original problem where cd and exec etc. don't actually do anything 🤷
12:25:10FromDiscord<haolian9 (高浩亮)> is there an idomic way to tell whether a file is unix socket or not? like `pathlib.Path("path").is_socket()`;↵i am planning to use `posix_utils.stat`
12:28:21PMunchhaolian9_(高浩亮), you do it the same way you would in C with Posix
12:29:02PMunch`var stat: Stat; discard fstat(myfile, stat); echo S_ISSOCK(stat.mode)`
12:35:59FromDiscord<haolian9 (高浩亮)> thanks, it's sad that i am not familiar with C↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
12:37:05PMunchIn general for the low-level Posix stuff you just do it with the low-level posix constructs. Knowing a little C helps, but it's not really required
12:37:27FromDiscord<Phil> I've only been exposed to C yesterday
12:37:34FromDiscord<Phil> The PTSD development has been steadily going since then
12:40:23PMunchOh come on, it's not that bad
12:41:30FromDiscord<Phil> As far as I can tell, I can't safely distinguish between a pointer to a pointer to a single number and a pointer to a pointer of an array. Both go ptr ptr uint8 as far as I understood yesterday
12:42:38FromDiscord<Phil> Though why on earth I go ptr ptr has still not revealed itself to me
12:43:57PMunchYes, in C an array is essentially just a pointer and the length is up to you to know.
12:44:06PMunchSo `ptr int` and `int[]` is the same thing
12:45:04PMunchAnd `myIntArr[10]` is just shorthand for something like `cast[ptr int](cast[int](myIntArr.addr) + sizeof(int) * 10)[]`
12:45:22PMunchOf course you don't need that casting in C, because you can do arithmetic directly on pointers
12:46:18PMunch`ptr ptr` is generally used where we in Nim would use `var myObject` in a procedure call. You pass in the location of a pointer to something, and the procedure you call can then change the pointer you have for another one.
12:48:47PMunchSo `int myInt; something(&myInt)` where `something(int* x)`, then `something` could change the integer behind the pointer and voila `myInt` has changed after your call. Since C returns everything by value by default this means you don't have to copy large object from the stack frame of `something` into the return field, and you don't have to `malloc` and `free` memory you got from a pointer.
12:49:02PMunchNot sure if that makes any sense :P
12:56:44FromDiscord<demotomohiro> `int` type also used to pass array of `int`. In that case, most of C functions have length parameter.
12:57:11FromDiscord<demotomohiro> And `int` can be used to pass array of pointer to int.
12:57:43FromDiscord<Rika> or the inverse
12:57:48FromDiscord<Rika> or could be double array
12:57:56FromDiscord<Rika> or could just be double pointer too
12:58:04FromDiscord<demotomohiro> So, you have to read refence or manual carefully to use C functions.
12:58:38FromDiscord<Rika> its not a great system but this is what you had to do when your computers had less ram than our current CPU has L3 cache
12:58:53FromDiscord<Rika> (im not sure if that exaggeration is true but i'd bet it is...)
12:59:27FromDiscord<Phil> With AMD L3 caches it is true for sure
13:00:10FromDiscord<Phil> They have triple digits L3 cache
13:00:20FromDiscord<Phil> (edit) "They have triple digits ... L3" added "MB"
13:01:29FromDiscord<Phil> They started out with RAM measured in KB
13:02:16FromDiscord<Phil> We have more L1 cache nowadays than the earliest computers had RAM total
13:02:50PMunchIt's pretty crazy
13:03:10PMunchAlso something which is fun about micro-controller programming. You have to basically fit your program into L1 cache
13:03:29FromDiscord<Phil> One of the things that was crazy for me to learn
13:03:37FromDiscord<Phil> And which I learned before I ever touched C or anything like it
13:03:42FromDiscord<Phil> It doesn't matter how shitty your algo is
13:03:46FromDiscord<Phil> If it fits in L1 cache it's fast
13:04:09FromDiscord<Phil> The sheer scale of difference that the effing cache makes is crazy
13:04:29FromDiscord<Phil> (edit) "It doesn't matter how shitty your algo is ... " added "(baring exponential complexity)"
13:05:42FromDiscord<demotomohiro> Modern CPU has large cache means modern memory is much slow compared to speed of CPU.
13:08:02PMunchhttps://i.stack.imgur.com/a7jWu.png
13:08:19FromDiscord<Rika> wow an L1 ref is half a ns??
13:08:28FromDiscord<Rika> thats honestly fucking insane
13:08:30PMunchYou get about 200 L1 cache lookups for a single main memory reference
13:09:46PMunchThose are numbers from 2010 by the way, not sure if they've gotten faster or slower since then
13:15:34FromDiscord<congusbongus> probably about the same, we got more cores and faster interconnects since then
13:15:43FromDiscord<Phil> There's a pretty decent talk about the difference of caching to algo speed
13:15:51FromDiscord<Phil> I'll have to see if I can find it again
13:17:11FromDiscord<ynfle> In reply to @Isofruit "I'll have to see": I'd be interested in that. thanks
13:19:00FromDiscord<Phil> In reply to @ynfle "I'd be interested in": You're in luck! https://www.youtube.com/watch?v=WDIkqP4JbkE
13:19:07FromDiscord<Phil> Scott Meyers was the presenter
13:20:07FromDiscord<ynfle> In reply to @Isofruit "You're in luck! https://www.youtube.com/watch?v=WDI": Thanks
13:20:10FromDiscord<Phil> It starts with talking about Multithreading
13:20:21FromDiscord<Phil> And why it is to be taken with care and can be useless
13:20:43FromDiscord<Phil> And moves on to why smart optimization for caching can be a more powerful tool to speed up your algo then multithreading
13:21:43FromDiscord<Phil> Starting from 19:00 there's a nice visual representation of cache speeds
13:23:07FromDiscord<Phil> Though it's reoccurring so eh
13:30:26FromDiscord<Phil> God damn 2014 is now almost 8 years ago
13:37:58FromDiscord<Rika> haha shh
13:44:12FromDiscord<Phil> You've got no reason to act like this, you're barely 20!
13:44:22FromDiscord<Phil> You were tiny when Lotr came out!
13:44:42FromDiscord<Phil> Aaaaaaaaand now I feel old
13:44:56FromDiscord<Phil> (edit) removed "you're barely 20!"
13:45:01FromDiscord<Phil> (edit) "this," => "this"
14:06:22FromDiscord<Professor Actual Factual> sent a long message, see http://ix.io/3OWf
14:06:52FromDiscord<Rika> i mean
14:06:58FromDiscord<Rika> what does a benchmark really signify?
14:07:32FromDiscord<Rika> the speed of code right? so you're testing the implementation mainly, not really everything else, thats just external factors
14:07:40FromDiscord<Rika> did someone actually post something to hn?
14:08:51FromDiscord<Professor Actual Factual> I agree with you rika.↵Benchmarks mean very little in this context, but its usually get posted on forums and people can get a bit fanboyish there which i dislike. Lol.↵Ya check hn front page
14:09:00FromDiscord<Rika> i dont want to
14:09:07FromDiscord<Rika> i just wanted to know if someone did
14:10:12FromDiscord<Rika> i cant tell you if either of these are equivalent, but for the most part they seem like they are?
14:11:09FromDiscord<Rika> well whatever, i dont want to care
14:11:50FromDiscord<Professor Actual Factual> Ya i could spend time pointing out the mistakes, but i think your approach might be best about not giving the post attention
14:12:08FromDiscord<Rika> if you want to bring out the big guns maybe ask mratsim to disassemble the whole argument 😛
14:12:13FromDiscord<enthus1ast> can you share the hn post?
14:12:53FromDiscord<Rika> no
14:12:58FromDiscord<enthus1ast> kk
14:12:59FromDiscord<Rika> sharing it is not a good idea
14:13:12FromDiscord<Rika> hn has "safeguards" against those coming from a shared link
14:13:49FromDiscord<Professor Actual Factual> Its number 6 on front page rn. And as expected reading the comments people are confused about the results
14:14:14FromDiscord<enthus1ast> yeah the annual "my lang is faster than your's, since yours is just TRANSPILED" post
14:14:54FromDiscord<enthus1ast> i guess \:)
14:15:54FromDiscord<Rika> if you really want, just ask someone who knows both well
14:16:02FromDiscord<Rika> ive mentioned one person already
14:16:46FromDiscord<Rika> i really shouldnt have read this, i already have a lot on my plate so more stress is not ideal
14:18:09FromDiscord<Phil> For me it's a shame I'm not experienced enough yet to actually write "bollocks" and back it up with knowledge =/
14:18:33FromDiscord<Rika> i dont know rust enough to deliberate the differences
14:18:47FromDiscord<Rika> nor to dispel the statements being made
14:19:09FromDiscord<Professor Actual Factual> Im experienced with performance optimization in nim, but i do not want to bother because i do not like multi lang benchmarks that take themselves too seriously
14:19:11FromDiscord<Rika> then again any statements being made on nim only i could prolly do, then again stress 🙂
14:19:30FromDiscord<Rika> just upvote those that talk about "testing the code and not the language"
14:19:38FromDiscord<Rika> what does it mean to benchmark the language anyway?
14:19:43FromDiscord<Phil> But the entire ` Nim has runtime overhead whereas C and Rust do not. ` I'm not sure how far that is true, but even then I'd argue you can remove that overhead, you have the option
14:19:49FromDiscord<Rika> i could write horrible rust code and amazing nim code then bam easy
14:20:16FromDiscord<Rika> In reply to @Isofruit "But the entire `": runtime overhead like the GC
14:20:24FromDiscord<Rika> you can disable it of course
14:20:28FromDiscord<Phil> Yeah, afaik you can literally disable it
14:20:31FromDiscord<Rika> or turn ARC on, which is more in line with rust
14:20:36FromDiscord<Rika> so would be more """fair"""
14:20:40FromDiscord<Rika> whatever that would mean
14:20:50FromDiscord<Phil> At that point when you have a language that allows you literally anything
14:20:54FromDiscord<Phil> How fair is a comparison?
14:21:01FromDiscord<Rika> well yeah
14:21:04FromDiscord<Phil> I can go full C or not give a shit like in Python
14:21:08FromDiscord<Rika> how do you determine if something is fair or not
14:21:18FromDiscord<Rika> what are the rules of this game
14:21:23FromDiscord<Rika> they are ill defined
14:21:26FromDiscord<Rika> anyway
14:21:50FromDiscord<Phil> I agree, I was approaching it from the point that typically writing insanely complicated memory management code was either part of the language or not
14:21:54FromDiscord<enthus1ast> what runtime overhead btw?
14:22:33FromDiscord<Rika> gc
14:22:37FromDiscord<Phil> Nim is the only language I know (yeah, limited language knowledge on my head) that allows you to choose between both
14:22:39FromDiscord<Rika> thats technically overhead
14:22:43FromDiscord<enthus1ast> yea but with arc and orc?
14:22:50FromDiscord<Rika> i did mention that
14:22:51FromDiscord<enthus1ast> its the same as rust or?
14:22:56FromDiscord<Rika> not exactly for orc
14:23:03FromDiscord<Rika> not sure for arc but i think its close for arc
14:23:09FromDiscord<Rika> not exactly either but closer than orc
14:23:15FromDiscord<Rika> orc is more akin to rust with Rc()
14:23:28FromDiscord<Rika> i guess orc isnt needed for any of these cases though
14:23:33FromDiscord<Rika> guess -> assume
14:23:39FromDiscord<Rika> i didnt read into them too deeply
14:23:44FromDiscord<enthus1ast> yeah
14:24:03FromDiscord<Rika> again, what's fair game for this benchmark?
14:24:07FromDiscord<Rika> defaults?
14:24:10FromDiscord<Rika> code by beginners?
14:24:15FromDiscord<Rika> heavy optimisations?
14:24:22FromDiscord<Rika> as equal to each other as possible?
14:24:32FromDiscord<Rika> theyre all exclusive in one way from each other
14:24:41FromDiscord<Rika> and each combination is valid in some way as well
14:24:48FromDiscord<Rika> again, ill defined
14:34:02FromDiscord<Phil> This kinda reminds me of the time when I went on a masochistic googling spree on what SO thought about java speed
14:34:23FromDiscord<enthus1ast> slow EVERYONE knows this \:D
14:34:56FromDiscord<enthus1ast> (just kidding btw)
14:34:58FromDiscord<Rika> java is pretty w/e
14:35:06FromDiscord<Rika> the gc is still kinda fucked afaik
14:35:18FromDiscord<Rika> gotta swap it to some other kinda gc
14:35:25FromDiscord<Rika> otherwise i think its good
14:35:35FromDiscord<Rika> still, the caveats of it doesnt help
14:37:30FromDiscord<Phil> SO was pretty much "Java is super fast now, it's no longer bad"
14:37:39FromDiscord<Phil> Then you go to Stackexchange.softwaredesign
14:38:04FromDiscord<Phil> "Java has been time and time demonstrated to be fucked up in terms of performance and its GUI libraries are shite"
14:39:55nrds<enyc99> ACTION meows
14:39:59FromDiscord<Phil> It was pretty entertaining
14:42:24FromDiscord<Phil> What I do not comprehend is that java has so much money behind them
14:42:32FromDiscord<Phil> Where is the fundamental flaw that just makes their GC suck?
14:43:17*arkurious joined #nim
14:54:18FromDiscord<--HA--> Is it generally ok to use the `defer` statement? I've been reading about some possible issues with it.
15:01:11*PMunch quit (Quit: Leaving)
15:15:21FromDiscord<ynfle> In reply to @--HA-- "Is it generally ok": What are you using it for?
15:16:38FromDiscord<--HA--> Basically like in the example in the manual. Open a file, defer the close.
15:17:56FromDiscord<--HA--> But if it gets removed in the future I'd rather be using try/finally from the beginning I guess.
15:19:22FromDiscord<Goel> @Professor Actual Factual https://github.com/kostya/benchmarks
15:22:46FromDiscord<Goel> @Phil What about D's GC? I was tempted more then once to give it a try but reading their forum most of their complaints is about their old (80's) design of GC with bad performance and the main devs are not willing to change that, exactly the opposite of was is doing Nim (fortunatly). In my opinion of all the GC prog languages Nim is the most performant
15:23:57FromDiscord<Phil> In reply to @Goel "<@!180601887916163073> What about D's": Never researched anything about D whatsoever
15:23:58FromDiscord<Phil> Sorry
15:24:31FromDiscord<Phil> All I can tell you is that for some reason java manages to live up in performance in select singular cases
15:24:50FromDiscord<Phil> But then when it goes across the board suddenly performance drops back to mid levels as opposed to excellent
15:27:12FromDiscord<Waldecir Santos> Is it possible to define a type and set is values, I've tried this but no luck
15:27:13FromDiscord<Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/940267462585360394/unknown.png
15:31:05FromDiscord<Rika> defaults? no(t yet)
15:33:31*rockcavera quit (Ping timeout: 256 seconds)
15:36:17FromDiscord<Phil> Setting defaults on an object type you say
15:36:27FromDiscord<Phil> Allow me to introduce you to the holy package
15:36:30FromDiscord<Phil> The package to always include
15:36:32FromDiscord<Phil> Constructor
15:37:17FromDiscord<Phil> For I can not be bothered to write construction procs for 40 types with 10 fields each
15:37:19FromDiscord<Phil> https://github.com/beef331/constructor
15:39:00FromDiscord<Phil> Now with really dope flags so you can choose if you want to a) get the generated construction proc exported and b) get signature as new(t: typedesc[MyType]): as opposed to newMyType()
15:39:54FromDiscord<Waldecir Santos> haha nice
15:40:43*rockcavera joined #nim
15:40:43*rockcavera quit (Changing host)
15:40:43*rockcavera joined #nim
15:41:08NimEventerNew thread by Didlybom: Hacker News discussion abou the recently discussed Rust vs Nim performance comparison, see https://forum.nim-lang.org/t/8879
15:46:06*xaltsc joined #nim
15:47:45*tiorock joined #nim
15:47:45*tiorock quit (Changing host)
15:47:45*tiorock joined #nim
15:47:45*rockcavera is now known as Guest1221
15:47:45*tiorock is now known as rockcavera
15:51:05*Guest1221 quit (Ping timeout: 256 seconds)
16:02:59FromDiscord<--HA--> Is it correct to create my own exception like this `type MyException = object of CatchableError`?
16:16:05anddamI installed nimgl package and opengl from https://github.com/nimgl/opengl , then tried tests/test.nim from https://github.com/nimgl/imgui and got "/home/anddam/Development/GUI/nimgl-imgui-git/src/imgui/impl_opengl.nim(11, 23) Error: cannot open file: nimgl/opengl"
16:16:10anddamwhat am I doing wrong?
16:30:31FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3OXf
16:39:38FromDiscord<demotomohiro> @anddam Did you installed it with nimble?
16:42:37*rockcavera quit (Remote host closed the connection)
16:43:58*rockcavera joined #nim
16:43:58*rockcavera quit (Changing host)
16:43:58*rockcavera joined #nim
17:13:27*tiorock joined #nim
17:13:27*tiorock quit (Changing host)
17:13:27*tiorock joined #nim
17:13:27*rockcavera is now known as Guest1059
17:13:27*Guest1059 quit (Killed (zinc.libera.chat (Nickname regained by services)))
17:13:27*tiorock is now known as rockcavera
17:22:13*PMunch joined #nim
17:27:37*tiorock joined #nim
17:27:37*tiorock quit (Changing host)
17:27:37*tiorock joined #nim
17:27:37*rockcavera is now known as Guest566
17:27:37*Guest566 quit (Killed (tantalum.libera.chat (Nickname regained by services)))
17:27:37*tiorock is now known as rockcavera
17:46:48PMunchMy talk is now live: http://bofh.nikhef.nl/events/FOSDEM/2022/D.nim/nim_ngmicrocontrollers.webm
17:54:44*neurocyte0917090 quit (Read error: Connection reset by peer)
17:55:49*neurocyte0917090 joined #nim
18:02:26anddamdemotomohiro: yes I did
18:02:42anddamdemotomohiro: "it" being nimgl/opengl right?
18:02:54anddamtoo bad I cannot tab-complete nicks carried from discord
18:04:18*billypilgrim quit (Quit: Konversation terminated!)
18:07:06PMunchanddam, with a little bit of scripting magic you can ;)
18:07:54PMunchI have this in a script: http://ix.io/3OXI that I load into HexChat
18:08:08PMunchAnd it strips the FromDiscord names and uses those as the nick instead
18:08:21PMunchWhich means I get the nice colours back, and that I can tab complete names :)
18:08:23*PMunch quit (Quit: leaving)
18:08:51FromDiscord<geekrelief> I'm using weave https://github.com/mratsim/weave while going through https://raytracing.github.io/books/RayTracingInOneWeekend.html Is there a way to avoid having to put the `gcsafe` pragma all over my procs?
18:21:04FromDiscord<Phil> Unrelated sidenote as this just occurred to me as something that could be a pretty common need
18:21:29FromDiscord<Phil> Is there a "get" proc or sth like it for the variant field of object variants?
18:21:40FromDiscord<Phil> If not, has anyone ever made a mini lib for that?
18:22:57FromDiscord<vindaar> what would that look like in general? your variant object may have multiple fields in a single branch. And how do you deal with the different types (i.e. the return type of that get procedure) in general?
18:23:16FromDiscord<Phil> Ohhh fair, you can do more than just a single field definition
18:23:21FromDiscord<Phil> I was only considering my own usecases
18:23:36FromDiscord<Phil> I typically only do object variants where every case of an enum defines a single field
18:24:31FromDiscord<Phil> Which means you could have a template (return "untyped") that generates a switch statement over all enum possibilities to return the field defined for that kind
18:24:45FromDiscord<Phil> But as I'm writing this I'm realizing this sounds like macro stuff
18:24:49FromDiscord<vindaar> fair enough for that. I've written that kind of thing get thing before, but it always comes with constraints. So not sure how well that generalizes to be useful
18:25:36FromDiscord<Phil> I mean, I'd save like 50 lines of code... over the course of my project that spans several thousands but still !
18:26:54FromDiscord<Phil> ~~I wonder if beef wants to add constructors for object variants~~
18:27:09FromDiscord<Phil> (edit) "variants~~" => "variants to his constructor package~~"
18:27:33FromDiscord<vindaar> if you go the template route you just end up with your code in multiple branches. You can't return anything from that branch without a type conversion. In addition (in general) you have the problem that you cannot even force a type conversion as `T(foo)` in general↵(@Phil)
18:27:52FromDiscord<geekrelief> In reply to @geekrelief "I'm using weave https://github.com/mratsim/weave": nvm, I must be accessing a global somewhere. Would macros affect the `gcsafe`ness of a proc?
18:28:37FromDiscord<Phil> Not in general, I've got tons of procs (I think) that have macros that are gcsafe. HOWEVER if the macro generates code that does an unsafe thing that'll naturally be unsafe
18:28:49FromDiscord<Phil> (edit) "that" => " andthat"
18:28:53FromDiscord<Phil> (edit) " andthat" => "and that"
18:30:29FromDiscord<geekrelief> right, I guess it'd be nice to have a better way to hunt down why the compiler thinks a proc is unsafe.
18:30:41FromDiscord<Phil> Actually, nevermind the "I think", I know that I have at least some macro usage that is in gcsafe procs
18:30:51FromDiscord<vindaar> this file is a good example of why it's hard to provide something really useful in general\:↵https://github.com/SciNim/Datamancer/blob/master/src/datamancer/column.nimVery few of these templates & procs that `case` could reasonably be confined into some generic "get" thing
18:39:05FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3OXR
18:41:01FromDiscord<Tetralux> In reply to @Isofruit "I typically only do": Can you put the common stuff in the object type, rather that in case statement?
18:41:42FromDiscord<Phil> In reply to @Tetralux "Can you put the": I don't think I follow
18:43:55FromDiscord<Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=3OXV
18:44:08FromDiscord<Tetralux> (edit) "https://play.nim-lang.org/#ix=3OXV" => "https://play.nim-lang.org/#ix=3OXW"
18:45:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3OXX
18:54:07FromDiscord<demotomohiro> @anddam I think "nimgl/opengl" refer to the module in https://github.com/nimgl/nimgl.↵So I think you need to install it with `nimble install nimgl`.↵It contains opengl, imgui and glfw module.
18:58:13anddamdemotomohiro: I installed both, one time opengl first then nimgl, the other time vice-versa
18:58:39anddamI still do not understand the logic of having those "subpackages" not in nibmle as well, seems one could avoid collision (if any) with proper naming
18:58:56anddamor have package nimgl depends on other packages like imgui, opengl and glfw
18:59:41anddamoh PMunch left, I was going to do something like that as well
18:59:51anddamobviously not as structured and not in nim (yet)
19:08:30FromDiscord<demotomohiro> It seems NimGL provides OpenGL, Vulkan, imgui and glfw as one package for convinience. But each of them are maintained in separate repository.
19:09:36anddamyes, but those separate repository (whence I installed nimgl/imgui from) says they have to be installed using "nimble https://reponame" and this is the bit I do not understand
19:09:38anddamanyway
19:09:54anddamas long as I can make this work I am happy, I can grind the details of why things work later
19:11:59FromDiscord<Waldecir Santos> can someone share a good hands on tutorial about Macros ? I've checked some but still black magic to me and I'll need that for "simulating" how django declare models
19:13:37anddamI watched the "Nim nuggets" video, intereseting and all but I think I am missing the point of having (almost) all the language available at compile time
19:14:06anddamto me it seems just like moving execution to another context, and I miss the big advantage the speaker was trying to make
19:14:06FromDiscord<Waldecir Santos> This one https://www.youtube.com/watch?v=d2VRuZo2pdA&t=1301s ?
19:14:25anddamyep
19:15:35NimEventerNew post on r/nim by obfuscate: Nim FOSDEM 2022 videos are up, see https://reddit.com/r/nim/comments/smy766/nim_fosdem_2022_videos_are_up/
19:15:47FromDiscord<Waldecir Santos> Thank you I will check, any other resource ?
19:15:50anddamI figure that makes the macro system powerful, and it allows the C++ interop he was talking about since you have templates
19:16:09anddamWaldecir Santos: are you asking me?
19:16:36anddamyou got it wrong, I am the one making questions, I am almost at the newbiest level here
19:16:57FromDiscord<Waldecir Santos> I'm asking anyone, really.
19:18:36FromDiscord<Waldecir Santos> For me I'd like to mimic `python descriptors` in nim, and seems like macros are the answer but I'm not sure.
19:18:51FromDiscord<demotomohiro> Did you read https://dev.to/beef331/demystification-of-macros-in-nim-13n8
19:18:58FromDiscord<demotomohiro> https://nim-lang.org/docs/tut3.html
19:19:13FromDiscord<Waldecir Santos> I did not, thank you looks awesome
19:19:45FromDiscord<demotomohiro> https://nim-lang.org/docs/macros.html
19:21:07FromDiscord<Waldecir Santos> Yeah I checked that one, but like I said still seems like black magic, maybe the first link you share is what I need
19:37:52*arkurious quit (*.net *.split)
19:37:52*happycorsair[m] quit (*.net *.split)
19:37:52*xiamx quit (*.net *.split)
19:37:52*crem1 quit (*.net *.split)
19:37:52*GnuYawk quit (*.net *.split)
19:38:27FromDiscord<Tetralux> In reply to @Isofruit "Yeah you can do": Maybe I misunderstood, but you mentioned about object variants with common data?
19:39:05FromDiscord<Phil> No common data, more there could be a common need
19:39:27FromDiscord<Phil> As in, it feels like a thing that could be generally useful in a lot of areas for a lot of people
19:40:18FromDiscord<Phil> To just have an object variant (where every kind defines a single field) and be able to get a "get" proc generated for it that just goes through every possible kind and returns the appropriate defined field
19:42:04Amun-Rathe first fosdem video is offline
19:42:25*arkurious joined #nim
19:42:25*happycorsair[m] joined #nim
19:42:25*xiamx joined #nim
19:42:25*crem1 joined #nim
19:42:25*GnuYawk joined #nim
19:43:00FromDiscord<Phil> Nuuuuu
19:43:05FromDiscord<Phil> Why?
19:46:13*cheer[m] quit (Ping timeout: 250 seconds)
19:46:14*nixfreaknim[m] quit (Ping timeout: 240 seconds)
19:46:42*happycorsair[m] quit (Ping timeout: 260 seconds)
19:46:43*xiamx quit (Ping timeout: 260 seconds)
20:17:45*cheer[m] joined #nim
20:23:42*nixfreaknim[m] joined #nim
20:42:44FromDiscord<tandy> the vfio one?↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>)
20:43:04FromDiscord<tandy> isnt this missing a bunch of talks?↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>)
20:46:20Amun-Raconcurrency one
20:46:45Amun-Raoh, it's online now
20:47:40*xiamx joined #nim
21:17:50FromDiscord<Evrensel Kişilik> Unity made me crazy
21:18:00FromDiscord<Evrensel Kişilik> im making the game from stratch with Godot
21:18:08FromDiscord<Evrensel Kişilik> Unity is broken and buggy
21:18:21FromDiscord<Evrensel Kişilik> Netcode doesn't support WebSocket
21:18:42FromDiscord<Evrensel Kişilik> community's WebSocket thing is not usable for WebGL exports
21:18:58FromDiscord<Evrensel Kişilik> Unity's HTML5 export support is broken
21:19:19FromDiscord<Evrensel Kişilik> Godot is 10000000000000000000000x better for everything
21:29:40*jjido joined #nim
21:35:23*nixfreaknim[m] quit (Write error: Connection reset by peer)
21:35:24*cheer[m] quit (Read error: Connection reset by peer)
21:35:25*xiamx quit (Read error: Connection reset by peer)
21:38:39*cheer[m] joined #nim
22:09:11anddamhow many times better?
22:09:18*happycorsair[m] joined #nim
22:09:18*xiamx joined #nim
22:09:18*nixfreaknim[m] joined #nim
22:10:59*jmdaemon quit (Ping timeout: 256 seconds)
22:22:34*jmdaemon joined #nim
22:46:48*vicfred joined #nim
22:53:42FromDiscord<Yepoleb> About twice as good
22:56:23anddamYepoleb: are you from Discord?
22:56:52FromDiscord<Yepoleb> I am using discord
22:57:05anddamgood so the nick-renamer-plugin thingy works
22:57:41anddamhttps://i.ibb.co/VgrgHW2/2022-02-07-235713-465x103-scrot.png
22:57:58anddamback to the nimgl topic
23:17:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:20:40FromDiscord<Evrensel Kişilik> In reply to @anddam "how many times better?": sooooooooooooooooooooooooooooooooooooooooooooooooo many times
23:21:10FromDiscord<Evrensel Kişilik> i saw some games written in Nim with Godot
23:21:22FromDiscord<Evrensel Kişilik> does it worth for performance?
23:22:07FromDiscord<Elegantbeef> Well it's native code so it'd be better than gdscript for performance
23:22:28FromDiscord<Evrensel Kişilik> In reply to @Elegantbeef "Well it's native code": sooooooooooooooooooooooooooooooooooooo
23:22:32FromDiscord<Evrensel Kişilik> i know but
23:22:41FromDiscord<Evrensel Kişilik> GDScript is already very fast
23:22:55FromDiscord<Elegantbeef> Sure but gdscript doesnt have many features that nim has 😜
23:22:56FromDiscord<Evrensel Kişilik> how is Nim debugging with Godot?
23:23:11FromDiscord<Elegantbeef> No clue
23:23:28FromDiscord<Evrensel Kişilik> im waiting for my new keyboard's shipment
23:23:40FromDiscord<Evrensel Kişilik> damn keyboard is still in China
23:25:25FromDiscord<Evrensel Kişilik> https://cdn.shopify.com/s/files/1/0012/4957/4961/files/61_Keys_Compact_Mechanical_Keyboard_wWhite_and_Pink_Color_Keycaps.jpg?v=1631087168
23:25:28FromDiscord<Evrensel Kişilik> this
23:35:28*jmdaemon quit (Ping timeout: 250 seconds)
23:39:40*jmdaemon joined #nim