<< 27-08-2022 >>

00:43:39*CyberTailor quit (Excess Flood)
00:47:32*CyberTailor joined #nim
01:27:32*arkurious quit (Quit: Leaving)
02:04:26*CyberTailor quit (Excess Flood)
02:06:20*CyberTailor joined #nim
02:59:20FromDiscord<sealmove> does `ptr var` make sense as parameter modifier?
03:00:04FromDiscord<Rainbow Asteroids> like `proc foo(x: ptr var T)`? no
03:00:11FromDiscord<Rainbow Asteroids> `var` is already a wrapped pointer
03:00:20FromDiscord<sealmove> yes
03:00:27FromDiscord<Rika> no
03:00:34FromDiscord<Rika> as of now it doesnt make sense
03:01:12FromDiscord<sealmove> for some reason it looks like I can't update the value where the pointer points to
03:01:37FromDiscord<Elegantbeef> No
03:01:37FromDiscord<Elegantbeef> `ptr` are implicitly mutable
03:02:30FromDiscord<Rainbow Asteroids> In reply to @รєคɭ๓๏שє "for some reason it": so you want `x: var ptr T`, because you want your proc to manipulate a variable with the type `ptr T`
03:03:38FromDiscord<huantian> In reply to @Forest "https://github.com/Mythical-Forest-Collective/Nim2I": computercraft poggers
03:04:06FromDiscord<huantian> I wonder if I target nim for risc-v if i can get it to run on opencomputers II
03:05:09FromDiscord<Elegantbeef> If you want to change where the pointer points you need `var ptr T`
03:05:09FromDiscord<Elegantbeef> Cause the `ptr T` is mutable
03:24:59FromDiscord<Mr.Ender> sent a code paste, see https://play.nim-lang.org/#ix=48LL
03:29:49*CyberTailor quit (Quit: Konversation terminated!)
03:30:33*CyberTailor joined #nim
03:31:42*CyberTailor quit (Client Quit)
03:32:02*CyberTailor joined #nim
03:39:55FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48LM
03:43:12FromDiscord<Mr.Ender> It seems to be doing something but output doesnt appear to have it and its getting these errors in the terminal↵"warning: icon.res: linker input file unused because linking not done"
03:43:24FromDiscord<Mr.Ender> (edit) "It seems to be doing something but output doesnt appear to have it and its getting these errors in the terminal↵"warning: icon.res: linker input file unused because linking not ... done"" added "done"↵"gcc.exe: warning: icon.res: linker input file unused because linking not"
03:43:48FromDiscord<!Patitotective> `--passL:"icon.res"` :P
03:43:49FromDiscord<!Patitotective> (edit) ":P" => ":p"
03:43:54FromDiscord<Mr.Ender> ok
03:44:46FromDiscord<Mr.Ender> sent a long message, see http://ix.io/48LO
03:45:09FromDiscord<Mr.Ender> (edit) "long message," => "code paste," | "http://ix.io/48LO" => "https://play.nim-lang.org/#ix=48LO"
03:45:32FromDiscord<!Patitotective> nothing else?
03:46:23FromDiscord<Mr.Ender> icon.res: file not recognized: file format not recognized
03:46:35FromDiscord<Mr.Ender> it displays fine in icon viewer
03:46:43FromDiscord<Mr.Ender> (edit) "it displays fine in icon viewer ... " added "so it is a correct icon"
03:46:50FromDiscord<Rika> well whats the format
03:46:51FromDiscord<Mr.Ender> (edit) "icon.res: file not recognized: file format not recognized" => "sent a code paste, see https://play.nim-lang.org/#ix="
03:47:00FromDiscord<Mr.Ender> I tried ico and res
03:47:05FromDiscord<!Patitotective> perhaps https://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable
03:47:05FromDiscord<Mr.Ender> (edit) "I tried ... ico" added "both"
03:52:50*jmdaemon joined #nim
03:56:12*jmdaemon quit (Client Quit)
04:16:23*jmdaemon joined #nim
04:33:01*CyberTailor quit (Quit: Konversation terminated!)
04:33:43*CyberTailor joined #nim
04:40:18*CyberTailor quit (Quit: Konversation terminated!)
04:40:42*CyberTailor joined #nim
04:50:12FromDiscord<Mr.Ender> Ok I got it working thanks
06:01:03FromDiscord<Bung> you can use https://github.com/electron/rcedit
06:36:30*jmd_ joined #nim
06:37:26*jmdaemon quit (Ping timeout: 260 seconds)
06:40:07FromDiscord<SouperZ> sent a code paste, see https://paste.rs/W71
06:40:13FromDiscord<SouperZ> (edit)
06:41:22FromDiscord<Elegantbeef> Manually?
06:41:50FromDiscord<Rika> I don’t know what you mean by best way
06:42:04FromDiscord<SouperZ> c2nim generates error filled code
06:42:17FromDiscord<Rika> Then do it manually
06:42:33FromDiscord<SouperZ> well thanks
06:42:35FromDiscord<Rika> In reply to @SouperZ "c2nim generates error filled": That tool doesn’t generate perfect Nim code
06:42:42FromDiscord<Rika> You have to fix the errors after
06:42:58FromDiscord<Rika> If you think it’s better to do it from scratch then okay
06:43:30FromDiscord<Elegantbeef> It's like 8 lines of code, is a machine really needed to get involved
06:44:43FromDiscord<Rika> If you’re lazy enough sure
06:44:59FromDiscord<Elegantbeef> I impatiently wait for the machine not to understand that `vram` is an array
06:48:28*jmd_ quit (Ping timeout: 268 seconds)
06:48:29*jmdaemon joined #nim
06:50:28*rockcavera quit (Remote host closed the connection)
06:55:10*jmd_ joined #nim
06:55:17*jmdaemon quit (Ping timeout: 268 seconds)
07:12:53FromDiscord<Forest> In reply to @huantian "computercraft poggers": Yeah it's great
07:12:59FromDiscord<Forest> In reply to @huantian "I wonder if I": Oh definitely
07:17:06*jmdaemon joined #nim
07:17:41*jmd_ quit (Ping timeout: 260 seconds)
07:19:44*sagax quit (Remote host closed the connection)
07:22:11*jmd_ joined #nim
07:23:31*jmdaemon quit (Ping timeout: 260 seconds)
07:26:20*CyberTailor quit (Quit: Konversation terminated!)
07:27:02*CyberTailor joined #nim
07:31:42*CyberTailor quit (Client Quit)
07:32:01*CyberTailor joined #nim
07:35:21*jmdaemon joined #nim
07:35:29*jmd_ quit (Ping timeout: 252 seconds)
07:38:11*mahlon quit (Ping timeout: 248 seconds)
07:38:49*CyberTailor quit (Quit: Konversation terminated!)
07:39:11*CyberTailor joined #nim
07:41:14FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=48MB
07:42:54FromDiscord<aruZeta> In reply to @EyeCon "Go you! Is it": https://github.com/aruZeta/QRgen↵it's not finished, since iirc there was one thing left to do, interleaving the ecc codewords, and the checking all version amd ec levels work. (and it's alot of testing, the test file for drawings os lile 80KB large)↵Also I have to write the README and thr docs, then I will make a release and publish in nimble
07:44:00FromDiscord<aruZeta> (edit) "os" => "is" | "large)↵Also" => "large lol)↵Also"
07:48:42FromDiscord<Rika> In reply to @4zv4l "shouldn't it be a": No because https://nim-lang.org/docs/strutils.html#repeat%2Cstring%2CNatural
07:54:05FromDiscord<Elegantbeef> I might be wrong rika but they want a `` operator that runs 5 times calling the left hand
07:54:11FromDiscord<Elegantbeef> Cause apparently a for loop is too verbose
07:54:32*CyberTailor quit (Quit: Konversation terminated!)
07:55:42FromDiscord<Rika> What
07:55:46FromDiscord<Rika> Why
07:59:14FromDiscord<Elegantbeef> Dont ask me
08:00:03FromDiscord<Rika> You could make it I guess
08:07:57*jmd_ joined #nim
08:09:17*jmdaemon quit (Ping timeout: 268 seconds)
08:09:41FromDiscord<Forest> Would that even be hard to do with macros? Lmao
08:12:26FromDiscord<Elegantbeef> You dont even need a macro
08:13:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48ML
08:16:46FromDiscord<Rika> Parentheses needed because of parsing rules if you wonder
08:17:17*jmd_ quit (Ping timeout: 252 seconds)
08:17:57*jmdaemon joined #nim
08:18:57FromDiscord<Forest> Huh neat
08:30:26*mahlon joined #nim
08:31:24*wallabra_ joined #nim
08:32:42*wallabra quit (Ping timeout: 268 seconds)
08:33:11*wallabra_ is now known as wallabra
08:45:48*jmd_ joined #nim
08:46:54*jmdaemon quit (Ping timeout: 268 seconds)
08:52:54NimEventerNew thread by Drkameleon: Where do nimErr's comes from?, see https://forum.nim-lang.org/t/9413
08:58:00FromDiscord<sealmove> How to inject code in the init function in the resulting c code?
08:59:10FromDiscord<sealmove> The one that runs before main
08:59:29FromDiscord<Elegantbeef> You cant that i know of
09:28:54FromDiscord<aruZeta> In reply to @aruZeta "https://github.com/aruZeta/QRgen it's not finished,": finished with ec interleaving, now this works https://media.discordapp.net/attachments/371759389889003532/1013017250271350845/unknown.png
09:29:20FromDiscord<aruZeta> now let's add 100 more tests 😔
09:29:49FromDiscord<aruZeta> (edit) "now let's add 100 more tests 😔 ... " added "( and fix the ones broken for the new ec calculations )"
09:30:32FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Nv
09:44:14*jmd_ quit (Ping timeout: 268 seconds)
09:44:36*jmdaemon joined #nim
10:52:40FromDiscord<b1rdf00d> In reply to @รєคɭ๓๏שє "<@145405730571288577> hello =) in": here's mine which I modified from either beef or treeform (looks like I stole it from beef) https://github.com/danielclarke/nature-of-nim-raylib/blob/main/config.nims
10:53:09FromDiscord<sealmove> omg thanks!
10:53:57FromDiscord<b1rdf00d> this is for a raylib project so you won't need some stuff (unless you're using raylib)
10:55:36FromDiscord<b1rdf00d> reading the "Roadmap for Nim" rfc, this one has me excited↵↵"Find a way of allowing a syntax like of Value(let x, var y) and embrace an official pattern matching solution that makes use of this syntax."
11:02:13FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "How to inject code": I think I need this after all
11:03:46FromDiscord<b1rdf00d> what are you trying to do?
11:09:48FromDiscord<sealmove> sent a long message, see http://ix.io/48Oi
11:15:06*jmdaemon quit (Ping timeout: 260 seconds)
11:21:54FromDiscord<b1rdf00d> ah okay, I really only use wasm to run my code in the browser and ignore the js/wasm interface↵↵but won't there be some api you need to implement for the service to call your code?
11:22:15*arkurious joined #nim
11:23:05FromDiscord<sealmove> the api is generated automatically by wit-bindgen (that's c files) and I only have to wrap it
11:23:16FromDiscord<sealmove> but that api does not support argv/argc
11:25:04FromDiscord<Nalmyth> Anyone have any ideas about threadsafe (cross-thread) memory pooling? https://media.discordapp.net/attachments/371759389889003532/1013046484264030238/Screenshot_2022-08-27_at_15.24.34.png
11:25:10FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Ol
11:32:59FromDiscord<Nalmyth> Or is sharing memory between nim threads impossible without using pointers?
11:33:38FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Oq
11:34:20FromDiscord<sealmove> In reply to @Nalmyth "Or is sharing memory": memory is managed per thread
11:35:04FromDiscord<Nalmyth> In reply to @รєคɭ๓๏שє "memory is managed per": Even when using locks?
11:35:27FromDiscord<sealmove> I mean the garbage collector is thread-local
11:35:42FromDiscord<sealmove> with locks you implement your own mm
11:36:27FromDiscord<Nalmyth> Yea, however looking at the above image nim is always complaining about global memory not being thread safe even when I've tagged it (I think) correctly 🙁
11:39:26FromDiscord<sealmove> well the error says `pending_response` is managed by GC (thread-local)
11:40:18FromDiscord<sealmove> i don't know your code or goal but for example if `pending_response` was using unmanaged memory, then this error would go away
11:40:54FromDiscord<Nalmyth> In reply to @รєคɭ๓๏שє "i don't know your": Hmm, is there a way to tag that memory as unmanaged?
11:41:15FromDiscord<sealmove> how do you allocate it?
11:41:34FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=48Or
11:41:46FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48Os" => "https://paste.rs/9KS"
11:41:52FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=48Or" => "https://paste.rs/8rf"
11:41:53FromDiscord<sealmove> use `new`, it gives you unmanaged memory iirc
11:42:08FromDiscord<Nalmyth> Wow ok I will try that 🤩
11:42:55FromDiscord<Nalmyth> So `new Table[uint64, QueueItem]`
11:43:28FromDiscord<sealmove> <searching for reference in Nim Manual>
11:44:28*buster_blue[m] joined #nim
11:45:55FromDiscord<sealmove> I was wrong
11:46:03FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Ou
11:46:36FromDiscord<sealmove> `new` just gives you reference semantics, the memory it gives you is still managed/traced by the GC
11:46:50FromDiscord<sealmove> https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types
11:47:58FromDiscord<Nalmyth> So something like this maybe https://media.discordapp.net/attachments/371759389889003532/1013052245526462464/Screenshot_2022-08-27_at_15.47.51.png
11:49:43madpropsim learning some ruby
11:49:47madpropsseems ok so far
11:50:35FromDiscord<Nalmyth> https://media.discordapp.net/attachments/371759389889003532/1013052906234183721/Screenshot_2022-08-27_at_15.50.29.png
11:51:35FromDiscord<Nalmyth> @sealmove seems to be working 👍
11:51:43FromDiscord<sealmove> great =)
11:51:45FromDiscord<Nalmyth> I guess using pointers is the only way to cross-thread boundry
11:51:53FromDiscord<Nalmyth> That should probably be specifically documented somewhere
11:52:01FromDiscord<Nalmyth> It's really really hard to find any info on it
11:53:05FromDiscord<sealmove> not sure if this is the case with arc
11:53:51FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Ox
11:54:25FromDiscord<sealmove> if i am not mistaken nim is trying aggressively to default to arc
11:56:36FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Oy
11:57:00FromDiscord<sealmove> and here are more details: https://nim-lang.org/docs/refc.html
12:35:03FromDiscord<Rika> There’s a proc called “create” in system that pretty much does alloc then cast
13:11:49*crem quit (Read error: Connection reset by peer)
13:17:44*crem joined #nim
13:21:36*wallabra_ joined #nim
13:23:10*wallabra quit (Ping timeout: 268 seconds)
13:23:45*wallabra_ is now known as wallabra
13:55:49FromDiscord<sealmove> hmm how do you test if a pointer points to an object?
13:56:00FromDiscord<sealmove> `... == nil` doesn't work
13:56:22FromDiscord<sealmove> (edit) "`..." => "~~`..." | "work" => "work~~"
13:56:27FromDiscord<sealmove> (edit) "hmm" => "~~hmm" | "object?" => "object?~~"
13:56:31FromDiscord<sealmove> sorry nvm
14:01:44FromDiscord<Rika> Lol
14:05:35*xet7 joined #nim
14:40:23FromDiscord<sealmove> too much programming 😅
15:10:54FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=48PK
15:12:40FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=48PL
15:21:43FromDiscord<sealmove> is `&path` correct? what is its type?
15:22:44FromDiscord<sealmove> if `&path` is a `string` then the first argument should be `unsafeAddr path[0]`.
15:22:57FromDiscord<sealmove> (edit) "if `&path` is a `string` then the first argument ... should" added "of `copyMem`"
15:23:00FromDiscord<Bung> it's wstring
15:23:13FromDiscord<Bung> & is winim defined
15:24:13FromDiscord<sealmove> ok so... wstring is wide character
15:24:21FromDiscord<sealmove> I think it's 2 bytes for each character
15:24:22FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=48PP
15:24:35FromDiscord<sealmove> so maybe you need `2 userDataDir.len` ?
15:25:26FromDiscord<sealmove> I think copyMem doesn't take into account pointer type
15:25:30FromDiscord<sealmove> not sure though
15:26:11FromDiscord<sealmove> documentation says "Exactly size bytes will be copied"
15:26:14FromDiscord<Bung> it's all done in bytes , so no need multiple size
15:26:31FromDiscord<sealmove> (edit) "size" => "`size`"
15:27:00FromDiscord<sealmove> are you sure? https://khchen.github.io/winim/winstr.html#wstring
15:27:26FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48PQ
15:27:43FromDiscord<Bung> .size is count in bytes
15:28:09FromDiscord<Bung> userDataDir is just string , so copy just bytes to bytes
15:28:10FromDiscord<sealmove> https://khchen.github.io/winim/winstr.html#len%2Cwstring
15:28:13FromDiscord<sealmove> this is not in bytes
15:28:36FromDiscord<Bung> userDataDir is string
15:28:37FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48PR
15:28:54FromDiscord<sealmove> alright so you see
15:29:15FromDiscord<sealmove> you are copying a string into a wide string
15:29:51FromDiscord<Bung> oh yes, I should use method 2
15:30:00FromDiscord<Bung> but it still does not work out
15:30:01FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48PT
15:30:18FromDiscord<sealmove> method 2?
15:30:31FromDiscord<Bung> in comment above
15:31:44FromDiscord<sealmove> I think you need to convert `userDataDir` to wstring, then use copyMem
15:31:47FromDiscord<sealmove> (edit) "copyMem" => "`copyMem`"
15:32:30FromDiscord<sealmove> otherwise you are malforming `path` by writing 2 ascii in each 1 unicode character
15:32:35*jmdaemon joined #nim
15:32:42FromDiscord<Bung> method 2 does this way
15:33:56FromDiscord<sealmove> don't know what u mean by method 2 ^_^
15:35:01FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=48PW
15:44:52FromDiscord<treeform> we use wide strings a ton in windy when interfacing with windows: https://github.com/treeform/windy/blob/master/src/windy/platforms/win32/utils.nim#L3-L47↵maybe that can help you out?
15:47:01FromDiscord<treeform> here is use: https://github.com/treeform/windy/blob/master/src/windy/platforms/win32/platform.nim#L1265-L1271
15:52:25FromDiscord<trevor> Hey folks, is there a way to see the nim source after macros have been expanded? I'm porting a nim library to another language and I've hit a particularly macro heavy section and it would be great if I could just inspect the entire file with all macros expanded and evaluate the source that way.
15:54:02FromDiscord<Bung> In reply to @treeform "we use wide strings": looks same like https://khchen.github.io/winim/winstr.html#L.t%2Cstring does
15:54:43FromDiscord<aruZeta> finished testing encoding + interleaving ECC, and it's quite fast↵also fixed some issues with both, so I think i'm done with testing and the lib is fully functional, will see if I can scan all 40 versions https://media.discordapp.net/attachments/371759389889003532/1013114344655044678/unknown.png
15:58:13FromDiscord<Bung> I wonder how would that happend even I set length to 1000
15:59:11FromDiscord<Rainbow Asteroids> would you say it's... 🚀 blazingly fast 🚀 ?
16:00:38FromDiscord<aruZeta> LMAO
16:04:03FromDiscord<Professor Actual Factual> In reply to @trevor "Hey folks, is there": Does this help https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped
16:04:39FromDiscord<lantos> In reply to @Rainbow Asteroids "would you say it's...": BLAZINGLY FAST
16:04:54FromDiscord<lantos> (edit) "In reply to @Rainbow Asteroids "would you say it's...": ... BLAZINGLY🚀" added "🚀" | "🚀BLAZINGLY FAST ... " added "🚀"
16:06:20FromDiscord<aruZeta> i think this is like version 29 and im not able to scan it LMAO https://media.discordapp.net/attachments/371759389889003532/1013117267233484820/unknown.png
16:06:47FromDiscord<Rainbow Asteroids> aruZeta made a missingno generator. neat
16:06:49FromDiscord<trevor> In reply to @Professor Actual Factual "Does this help https://nim-lang.org/docs/macros.htm": Yeah I've been trying that out, the source I'm working through I think has macros in macros, but I may also just be misreading the source. So I'm hunting through expanding what I find and it would be neat to just expand ALL OF IT. But I realize the expanded code relies on some calling context too so that may not be possible.
16:07:52FromDiscord<aruZeta> In reply to @Rainbow Asteroids "aruZeta made a missingno": ha! wait to see the last version, version 40!
16:08:15FromDiscord<aruZeta> i mean ... who the hell needs a version 40 qr code
16:09:10FromDiscord<aruZeta> In reply to @aruZeta "i think this is": finally scanned it ...
16:09:40FromDiscord<Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=48Qg
16:09:44FromDiscord<Rainbow Asteroids> I had to invert the colors
16:09:45FromDiscord<aruZeta> yh
16:10:06FromDiscord<aruZeta> In reply to @Rainbow Asteroids "I had to invert": yh, and it's not full black and white either
16:10:25FromDiscord<aruZeta> not gonna change my terminals colors for this shit lol
16:10:43FromDiscord<Professor Actual Factual> In reply to @trevor "Yeah I've been trying": Ya not sure if that command is recursive or not. However since it does spit out valid nim code. You can always iteratively expand it yourself.↵But yes i agree that function would be more helpful if it worked the way you suggested.
16:11:27FromDiscord<Rainbow Asteroids> How much data is stored in a version 29 qr code?
16:13:57FromDiscord<aruZeta> this being a ecc H one ... 701
16:14:18FromDiscord<aruZeta> if it was ecc L 1631
16:14:23FromDiscord<aruZeta> and then all the ecc
16:14:38FromDiscord<aruZeta> (edit) "ecc H" => "ecH"
16:14:44FromDiscord<aruZeta> (edit) "ecc L" => "ecL"
16:15:01FromDiscord<aruZeta> https://media.discordapp.net/attachments/371759389889003532/1013119451090133092/unknown.png
16:16:08FromDiscord<Rainbow Asteroids> what does one need 1.8k bytes in a QR code for?
16:16:19FromDiscord<aruZeta> my same question
16:16:29FromDiscord<Rainbow Asteroids> 50-100 bytes max
16:16:56FromDiscord<aruZeta> the actual most you can have is 7089 character of numeric mode (numbers only)
16:17:11FromDiscord<aruZeta> in byte mode (all ascii) 2953
16:17:37FromDiscord<aruZeta> there is also byte mode with utf8, but not all scanners support it, and why would you even want it
16:17:48FromDiscord<Rainbow Asteroids> people must be trying to send ROMs over QR codes or something
16:17:57FromDiscord<aruZeta> lol
16:18:44FromDiscord<Rainbow Asteroids> fill up a binder with printed QR codes, and scan them with your phone to play a game
16:19:10FromDiscord<aruZeta> i remember a video on trying to fit a game on a qr code
16:19:14FromDiscord<aruZeta> (edit) "on" => "in"
16:19:21FromDiscord<Rainbow Asteroids> same
16:19:37FromDiscord<Rainbow Asteroids> https://www.youtube.com/watch?v=ExwqNreocpg&t=181s
16:19:37FromDiscord<aruZeta> well, after a lot of trying I can assure all versions work ... which is impresive
16:19:40FromDiscord<Rainbow Asteroids> (edit) "https://www.youtube.com/watch?v=ExwqNreocpg&t=181s" => "https://www.youtube.com/watch?v=ExwqNreocpg"
16:19:58FromDiscord<Rainbow Asteroids> time to prepare your nimconf talk on it
16:21:14FromDiscord<aruZeta> let's see how fast this is on generating all 40 versions with lorem ipsum using largest error correction level
16:23:15FromDiscord<Forest> How do i make a field nil or a type
16:23:30FromDiscord<Forest> is `options` the only way?
16:23:43FromDiscord<aruZeta> https://media.discordapp.net/attachments/371759389889003532/1013121643578675230/unknown.png
16:23:48FromDiscord<aruZeta> 250ms nice
16:24:47FromDiscord<Rainbow Asteroids> `ref T` can be assigned to nil. If you mean something allocated on the stack, then you'd have to use something like std/options or unions
16:24:58FromDiscord<aruZeta> 228ms on -d:danger
16:30:37*jmd_ joined #nim
16:30:49*jmdaemon quit (Ping timeout: 252 seconds)
16:33:29FromDiscord<aruZeta> now I just need to document quite a lot of stuff ... and publish to nimble https://media.discordapp.net/attachments/371759389889003532/1013124098840350730/unknown.png
16:36:20FromDiscord<Forest> In reply to @Rainbow Asteroids "`ref T` can be": Unions?
16:37:38FromDiscord<Rainbow Asteroids> I'm referring to this github repo↵https://github.com/alaviss/union
16:37:40FromDiscord<Forest> May have to use a ref type hm
16:38:07FromDiscord<Forest> Yeah i'll use ref objects, thanks anyway aha
16:45:08*jmd_ quit (Read error: Connection reset by peer)
16:46:19*jmdaemon joined #nim
16:50:21FromDiscord<sealmove> In reply to @aruZeta "i think this is": What are u making?
16:50:39FromDiscord<aruZeta> In reply to @รєคɭ๓๏שє "What are u making?": it's a qr code generator fully written in nim
16:52:07*jmd_ joined #nim
16:52:50*jmdaemon quit (Ping timeout: 268 seconds)
16:52:57FromDiscord<aruZeta> when I searched for qr code generators in nim I fond 3, 2 are a wrapper of one made in C and the other one uses an API on the web
17:21:30*jmd_ quit (Quit: ZNC 1.8.2 - https://znc.in)
17:31:52*vicecea quit (Remote host closed the connection)
17:33:33*vicecea joined #nim
17:44:46FromDiscord<tandy> you made a pure nim qr code generator?↵(@aruZeta)
17:44:56FromDiscord<aruZeta> yep
17:45:15FromDiscord<pim pimling> Hi 👋 ↵↵How do I make a nimble package?
17:45:16FromDiscord<tandy> code link?
17:45:18FromDiscord<aruZeta> fully working now
17:45:19FromDiscord<tandy> i wanna use it in my project \:)
17:45:31FromDiscord<tandy> its a js karax app
17:45:34FromDiscord<Rainbow Asteroids> In reply to @pim pimling "Hi 👋 ": `nimble init`
17:45:35FromDiscord<aruZeta> i still need to publish in nimble
17:45:46FromDiscord<Rainbow Asteroids> `nimble publish `
17:45:48FromDiscord<aruZeta> i want to first write the docs
17:45:57FromDiscord<Rainbow Asteroids> (edit) "publish `" => "publish`"
17:46:01FromDiscord<tandy> is the source available anywhere?↵(@aruZeta)
17:46:05FromDiscord<aruZeta> oh yh
17:46:06FromDiscord<aruZeta> https://github.com/aruZeta/QRgen
17:46:14FromDiscord<pim pimling> In reply to @Rainbow Asteroids "`nimble init`": Well yes, but with things like `npm` you usually have to a `package.json` file, so... is there something like that?
17:46:24FromDiscord<tandy> nice thanks
17:46:30FromDiscord<aruZeta> default branch will be changed to main when I made the first release
17:46:31FromDiscord<sealmove> how to learn react? T_T i hate js
17:46:39FromDiscord<pim pimling> In reply to @รєคɭ๓๏שє "how to learn react?": https://reactjs.org
17:46:49FromDiscord<sealmove> was a rhetorical question
17:46:50FromDiscord<aruZeta> you wolud just need to import QRgen
17:47:01FromDiscord<pim pimling> In reply to @รєคɭ๓๏שє "was a rhetorical question": 🛤️
17:47:10FromDiscord<aruZeta> the api should not change when making the first release too
17:47:16FromDiscord<Rainbow Asteroids> `nimble init` generates the `{projectName}.nimble` file for you. You just need to add dependencies as needed with the `requires` macro
17:47:34FromDiscord<pim pimling> In reply to @Rainbow Asteroids "`nimble init` generates the": Ah ok.
17:47:35FromDiscord<pim pimling> Thanks
17:47:50FromDiscord<Rainbow Asteroids> https://github.com/nim-lang/nimble/blob/master/readme.markdown
17:48:01FromDiscord<aruZeta> and until I make the docs, here is a working example @tandy
17:48:11FromDiscord<aruZeta> (edit) "and until I make the docs, here is a working example ... @tandy" added "https://github.com/aruZeta/QRgen/blob/develop/tests/testQRGen.nim"
17:48:35FromDiscord<aruZeta> (edit) removed "@tandy"
17:48:48FromDiscord<aruZeta> (i think i did ping another tandy lol sry)
17:49:34FromDiscord<pim pimling> bruh im so stupid how do I make a function
17:49:52FromDiscord<aruZeta> ah and also qr codes can only be shown in a terminal, need to add more options 😓, I will try first making svgs
17:49:52FromDiscord<tandy> nice, are you able to export as an image?↵(@aruZeta)
17:50:01FromDiscord<tandy> im wondering how i would show on the html page
17:50:06FromDiscord<sealmove> In reply to @aruZeta "and until I make": now u can have your wifi printed on your wall with a nim taste :D
17:50:09FromDiscord<tandy> ah yes↵(@aruZeta)
17:50:10FromDiscord<aruZeta> an svg maybe
17:50:28FromDiscord<tandy> you can try pixie maybe
17:50:35NimEventerNew thread by BigFloofyDog: How to make a Nim package?, see https://forum.nim-lang.org/t/9414
17:50:59FromDiscord<Rainbow Asteroids> In reply to @pim pimling "bruh im so stupid": https://nim-lang.org/docs/tut1.html#procedures
17:51:20FromDiscord<aruZeta> i will have to see how pixie works
17:51:32*pro joined #nim
17:51:35FromDiscord<aruZeta> since the way I store a drawed qr code is ... interesting
17:51:50FromDiscord<tandy> lol
17:52:05FromDiscord<aruZeta> it's a 1D `seq[uint8]` lol
17:52:36FromDiscord<Rainbow Asteroids> technically everything is just a `seq[byte]`
17:52:50FromDiscord<aruZeta> byte is uint8 right?
17:52:54FromDiscord<Rainbow Asteroids> yeaj
17:53:02FromDiscord<Rainbow Asteroids> (edit) "yeaj" => "yeah"
17:53:07FromDiscord<tandy> do you have any plan to make fancy qr codes?
17:53:15FromDiscord<aruZeta> prefer using uint8 notation tbh
17:53:23FromDiscord<tandy> like with images inside, or with curved edges etc
17:53:33FromDiscord<tandy> maybe that is something to try with pixie also
17:53:34FromDiscord<aruZeta> curved edges do look interesting
17:53:37FromDiscord<aruZeta> yh
17:54:12FromDiscord<aruZeta> for the moment I want to document everything, and write a README with what the api has to offer
17:54:18FromDiscord<aruZeta> then I will add more formats
17:54:31FromDiscord<aruZeta> and then the 'fancy' stuff, if it's possible
17:54:49FromDiscord<tandy> il star your repo
17:55:09FromDiscord<aruZeta> ty 🥰
17:55:27FromDiscord<tandy> heres my project btw \:) https://github.com/Listen2gether/Listen2gether.github.io/projects/1#card-82258553
17:55:56FromDiscord<aruZeta> looking at that, I should maybe make a project table with to do's
17:56:08FromDiscord<tandy> yeah its nice
18:01:56FromDiscord<pim pimling> if statement?
18:02:05FromDiscord<Rainbow Asteroids> read what I sent
18:02:10FromDiscord<ravinder387> i want to send json data to jester then it'll return json data.. how can i do it in jester
18:02:47FromDiscord<Yardanico> @ravinder387 as get or post?
18:02:57FromDiscord<ravinder387> post
18:04:04FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=48QF
18:04:07FromDiscord<Yardanico> of course here I'm not doing anything with `reqData`, you'd probably want to do something with it
18:06:41FromDiscord<pim pimling> is there something similar to f strings
18:07:45FromDiscord<pim pimling> sent a code paste, see https://play.nim-lang.org/#ix=48QH
18:08:54FromDiscord<huantian> https://nim-lang.org/docs/strformat.html
18:12:58FromDiscord<sealmove> let's say we have a library which defines a top level var of type proc. Is it possible to import this library and then update its value at compile time?
18:13:15FromDiscord<sealmove> (edit) "its" => "the" | "thevalue ... at" added "of the variable"
18:15:16FromDiscord<sealmove> this is one idea. in general i need a way to define a proc _for_ the library i am importing (the library will call my proc)
18:16:31FromDiscord<EyeCon> You can just call a function with the proc as the argument?
18:16:40FromDiscord<Rainbow Asteroids> This seems like a design smell. Use polymorphism or use a process as an argument
18:16:47FromDiscord<EyeCon> There's even special syntax for it with the colon
18:16:59FromDiscord<Rainbow Asteroids> (edit) "process" => "proc"
18:17:12FromDiscord<sealmove> This is what I tried but it doesn't work. Sadly I don't control the entry point. And the entry point is where my proc must be called...
18:17:33FromDiscord<EyeCon> What doesn't work?
18:18:00FromDiscord<sealmove> In reply to @EyeCon "You can just call": This, because that proc will be called after the code that calls my function
18:18:11FromDiscord<sealmove> (edit) "function" => "proc"
18:19:31FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=48QK
18:20:03FromDiscord<EyeCon> (edit) "https://play.nim-lang.org/#ix=48QK" => "https://play.nim-lang.org/#ix=48QL"
18:20:10FromDiscord<EyeCon> Sorry, edited the example, I hope I got the `do` syntax right
18:22:17FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48QM
18:22:24FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48QM" => "https://play.nim-lang.org/#ix=48QN"
18:24:54FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48QO
18:25:16FromDiscord<sealmove> (edit) "https://play.nim-lang.org/#ix=48QO" => "https://play.nim-lang.org/#ix=48QP"
18:25:40FromDiscord<sealmove> but it doesn't work because `handleHttpRequest` runs before `handler` is updated, that is... before user code.
18:28:16FromDiscord<EyeCon> I'm not sure if it'll work, but did you try `modulename.handler = myHandlerProc` assuming you'd name your own proc `myHandlerProc`?
18:28:17FromDiscord<domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=48QQ
18:28:30FromDiscord<sealmove> oh `static`... let me try
18:29:01FromDiscord<sealmove> In reply to @EyeCon "I'm not sure if": I think this won't compile
18:31:49FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48QR
18:32:19FromDiscord<sealmove> maybe if I mark the variable as static during declaration... hmm
18:35:21FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=48QS
18:35:42FromDiscord<EyeCon> Then `nim r test1` results in:↵> Test1↵> Test2↵> Test3
18:37:08FromDiscord<sealmove> @EyeCon it works because in the first file you are calling `thingDoer` at the end. This is not possible in my case.
18:37:29FromDiscord<sealmove> This is what I tried as well in the beginning
18:37:52FromDiscord<sealmove> in your example imagine `thingDoer` being the entry point of your binary
18:38:53FromDiscord<EyeCon> I don't really understand your problem. Can you show a minimal example? How can it be the entry point of my binary if I'm the one trying to use the library?
18:40:35FromDiscord<sealmove> Well it's complicated. I am making a wasi _Reactor_
18:41:16FromDiscord<sealmove> The wasm binary I produce doesn't even have an entry function
18:42:07FromDiscord<sealmove> And there is an external program that triggers the `spin_http_handle_http_request` function (see my example, I am `exportcing it`).
18:42:23FromDiscord<sealmove> (edit) "`exportcing it`)." => "`exportc`ing it)."
18:43:13FromDiscord<sealmove> I found out there is no way in Nim to write setup code
18:43:25FromDiscord<sealmove> For example Golang has the `init()` function
18:44:43FromDiscord<sealmove> So the equivalent sdk in Golang does what you are describing with `test2.handler = myProc` in the `init()` function
18:45:10FromDiscord<EyeCon> I have like a thousand questions about your description but seeing that this is way above my paygrade I'll leave it to the experts
18:46:34FromDiscord<sealmove> No go ahead and ask ^^' I am no expect either, by no means (only 1 year professional experience (not nim, in general))
18:48:03FromDiscord<EyeCon> So you're writing something like a plugin more or less, there's a certain binary that uses your exported code, and there will be people who would use your thing, but need to customize parts of the behavior, am I right so far?
18:49:26FromDiscord<EyeCon> If that's the case, the only real possibility that I see is that you construct the code that it relies on another code, normally a dynlib like a DLL or .so file which would then be called
18:49:29FromDiscord<pruno> sent a code paste, see https://play.nim-lang.org/#ix=48QW
18:49:56FromDiscord<EyeCon> Which is then supplied by the party that needs to change the behavior
18:50:10FromDiscord<EyeCon> A plugin for your plugin, if you will
18:51:05FromDiscord<EyeCon> (edit) "If that's the case, the only real possibility that I see is that you construct the code ... that" added "so"
18:52:18FromDiscord<Rainbow Asteroids> In reply to @pruno "Is it possible to": defined is not a keyword. It is a proc
18:52:48FromDiscord<Rainbow Asteroids> `when defined(option1) or defined(option2)`
18:53:22FromDiscord<sealmove> sent a long message, see http://ix.io/48QX
18:53:36FromDiscord<pruno> In reply to @Rainbow Asteroids "`when defined(option1) or defined(option2)`": Indeed, thank you !
18:55:40FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "Almost. I am writing": I am searching for:↵- either a way to run code (that resides in that binary) before `spin_http_handle_http_request` runs↵- generate the user code at compile-time (so this is of course before `spin_http_handle_http_request` runs)
18:55:52FromDiscord<sealmove> (edit) "In reply to @รєคɭ๓๏שє "Almost. I am writing": I am searching for:↵- either a way to run code (that resides in that binary) before `spin_http_handle_http_request` runs↵- ... generate" added "or"
18:56:50FromDiscord<EyeCon> But you are the one generating `spin_http_handle_http_request`, isn't that right? Search for the user code, and call it if supplied at the beginning
18:57:29FromDiscord<sealmove> "Search for the user code", how to do this? :D
18:57:43FromDiscord<EyeCon> Look for a file named in a certain way
18:57:50FromDiscord<EyeCon> And if found, load and execute it?
18:57:54FromDiscord<Forest> Hm wonder how simple it'd be to port a WASM implementation to pure Nim
18:58:07FromDiscord<EyeCon> Alternatively, use an environment variable to point at a DLL
18:58:11FromDiscord<Forest> Wasm3 should be... Relatively to easy to port?
18:58:12FromDiscord<EyeCon> I can think of a thousand ways
18:58:22FromDiscord<EyeCon> Use a configuration file which the user edits
18:58:46FromDiscord<EyeCon> Then once found, load and execute the code: spin_http_handle_http_request
18:58:57FromDiscord<EyeCon> (edit) "spin_http_handle_http_request" => "https://nim-lang.org/docs/dynlib.html#examples-loading-a-simple-c-function"
18:59:12FromDiscord<EyeCon> ...if it's a dynlib
18:59:22FromDiscord<EyeCon> Or else, if an executable, run it directly
18:59:26FromDiscord<sealmove> this would work yes, but I need portable single-file wasm
18:59:37FromDiscord<sealmove> it works like a container at this point
18:59:49FromDiscord<sealmove> that's the idea
19:00:05FromDiscord<sealmove> it shouldn't rely on external code probably
19:00:51FromDiscord<EyeCon> But however you would be generating the `spin_http_handle_http_request`, you would be able to insert user-supplied code in it if you know what the code is at compile time?
19:01:07FromDiscord<EyeCon> If it's not known at compile time, there's no way of inserting it
19:01:20FromDiscord<sealmove> yeah that's what I need, to inject it in there at compile time, that would be ideal
19:01:33FromDiscord<sealmove> it is known at compile-time
19:02:08FromDiscord<EyeCon> Then, I don't know, copy it at the beginning of the proc definition? I'm sure I'm missing something big here at this point
19:02:16FromDiscord<sealmove> the sdk is .nim files so... the user compiles the whole thing
19:02:41FromDiscord<sealmove> In reply to @EyeCon "Then, I don't know,": ah, well, imagine you installing the sdk with `nimble install`
19:02:49FromDiscord<sealmove> then you want to use it and supply your function
19:03:01FromDiscord<sealmove> you don't want to have to modify the sdk
19:04:36FromDiscord<EyeCon> I am not completely sure, but you ought to be able to look for a file's existence and import it at compile time
19:05:17FromDiscord<EyeCon> Make the user write a file with a certain name, and detect it at compile time, importing and calling it if it exists?
19:05:40FromDiscord<sealmove> It's one idea... kinda hacky but could work I think
19:06:09FromDiscord<EyeCon> Write a custom nimble task that works the user-supplied code into yours?
19:06:23FromDiscord<EyeCon> Or enables/disables the code overriding
19:08:09*pro quit (Quit: pro)
19:08:21FromDiscord<sealmove> I'll keep this idea, thanks. Not ideal but maybe there is no better way? I suppose the best way would be to be able to control _something_ that runs before `spin_http_handle_http_request`, but this needs knowledge about wasm format and emscripten
19:10:26FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=48R2
19:12:12*jafarlihi joined #nim
19:12:40jafarlihiI've got an regular object with string field. When I try to do this.string = param in method it says it cannot be assigned to. How come?
19:13:47FromDiscord<sealmove> is your object var?
19:13:51FromDiscord<Rika> There is a lot of reasons, which reason is easier to tell with more code
19:14:30FromDiscord<sealmove> (edit) "is your ... objectdefined" added "variable of the" | "var?" => "defined with `var`?"
19:15:07jafarlihiere it is: https://pastebin.com/WxnDrh01 Line 54
19:15:41FromDiscord<Rika> Yeah, this is not var
19:15:51FromDiscord<Rika> this: var Layer
19:16:09jafarlihiOk, thanks
19:17:22FromDiscord<sealmove> another way is to give your type reference semantics
19:17:55FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48R3
19:20:57FromDiscord<Rika> I don’t recommend it if you don’t need it
19:23:02jafarlihiCan you have forward declaration for object types?
19:26:03FromDiscord<Yardanico> yes, but it doesn't work well in practice from what I heard
19:26:23FromDiscord<Yardanico> you're welcome to try :P https://nim-lang.org/docs/manual_experimental.html#package-level-objects
19:27:23jafarlihiHow do you create a Regex of std/re from a string?
19:28:18jafarlihiOh, "re" proc
19:28:21FromDiscord<d4rckh> can i use `defined` in if statements?
19:28:27FromDiscord<d4rckh> i want to run the check at run time
19:28:34FromDiscord<sealmove> sure
19:30:41FromDiscord<Yardanico> In reply to @d4rckh "i want to run": that won't really make sense
19:30:52FromDiscord<Yardanico> you can't change the behaviour of `defined` so that something returns false at compile-time but true at runtime
19:31:04FromDiscord<Yardanico> it's only meant to be run at compile-time as you can't add new variables at runtime (since nim is compiled)
19:31:11FromDiscord<Yardanico> maybe you're thinking of doing something else actually?
19:31:43FromDiscord<pim pimling> sent a code paste, see https://play.nim-lang.org/#ix=48R4
19:31:48FromDiscord<pim pimling> Why does it not show the text in red?
19:32:01FromDiscord<d4rckh> In reply to @Yardanico "maybe you're thinking of": It's just temporarily
19:32:02FromDiscord<Yardanico> because of difference between `fmt` and `&`
19:32:11FromDiscord<Yardanico> In reply to @d4rckh "It's just temporarily": but anyway, `defined` doesn't make sense to be defined in a if
19:32:22FromDiscord<EyeCon> In reply to @pim pimling "Why does it not": Do yourself a favor and use `terminal`
19:32:36FromDiscord<pim pimling> In reply to @EyeCon "Do yourself a favor": wdym
19:32:44FromDiscord<Yardanico> In reply to @Yardanico "but anyway, `defined` doesn't": i mean, the only case I can think of when you want to use it with an `if` is when you want to save 1 line of code
19:33:06FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=48R5
19:33:15FromDiscord<d4rckh> I just want to restrict a value to an argument when I am not on windows ↵↵if ( not defined(windows) ) and something:
19:33:20FromDiscord<EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=48R6
19:33:31FromDiscord<EyeCon> (edit) "https://play.nim-lang.org/#ix=48R6" => "https://play.nim-lang.org/#ix=48R7"
19:33:32FromDiscord<d4rckh> Yeah I'll do that
19:33:35FromDiscord<Yardanico> In reply to @d4rckh "I just want to": yeah then it's fine if you want to save that 1 line of code, the compiler will optimize the value away :)
19:33:59FromDiscord<pim pimling> sent a code paste, see https://play.nim-lang.org/#ix=48R8
19:39:21FromDiscord<sealmove> @EyeCon
19:39:28FromDiscord<sealmove> I think it's possible with these stuff https://nim-lang.org/docs/manual.html#pragmas-compiletime-pragma
19:40:12FromDiscord<sealmove> see `{.registerProc.}` looks like exactly this use case
19:41:00FromDiscord<pim pimling> user input?
19:41:00FromDiscord<EyeCon> If you're going into macro territory you can also replace code but I'm not a big fan of macros except as a last resort
19:43:44FromDiscord<pim pimling> In reply to @pim pimling "user input?": nvm
19:43:46*jafarlihi quit (Ping timeout: 260 seconds)
19:47:22FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Ra
19:47:33FromDiscord<Elegantbeef> Cause there is no `$` for ref objects
19:47:44FromDiscord<!Patitotective> :[
19:47:45FromDiscord<Elegantbeef> of course `data[]` wouldnt work it's not a reference
19:48:23FromDiscord<pim pimling> guys i found the compiler code https://media.discordapp.net/attachments/371759389889003532/1013173150776832161/compiler.c
19:48:37FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Rb
19:48:51FromDiscord<Elegantbeef> Have fun with all the nil refs↵(@!Patitotective)
19:48:59FromDiscord<Elegantbeef> Do you even need a ref type here?
19:48:59FromDiscord<!Patitotective> not :p
19:49:04FromDiscord<pim pimling> sent a code paste, see https://play.nim-lang.org/#ix=48Rc
19:49:14FromDiscord<!Patitotective> In reply to @Elegantbeef "Do you even need": for my lexer tokens there is recursion
19:49:22FromDiscord<Elegantbeef> Also patito that'd call itself recursively
19:50:16FromDiscord<Elegantbeef> A recursive lexer, interesting
19:50:26FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Rd
19:50:27FromDiscord<EyeCon> sent a code paste, see https://paste.rs/NY7
19:50:33FromDiscord<EyeCon> Almost the same 😄
19:50:50FromDiscord<!Patitotective> In reply to @Elegantbeef "A recursive lexer, interesting": yea, doesnt really make sense
19:51:34FromDiscord<!Patitotective> i just didnt want to do `Identifier EqualSign Number` i was trying to do `(Identifier, Token)`
19:51:36FromDiscord<!Patitotective> :p
19:52:07FromDiscord<!Patitotective> also i decided i was going to use npeg :ppppppp
19:53:46FromDiscord<Elegantbeef> This still is recursive↵(@!Patitotective)
19:53:52FromDiscord<Elegantbeef> you need `system.`$`(x[])`
19:53:58FromDiscord<Elegantbeef> Ah nvm you have `ref T`
19:54:15FromDiscord<!Patitotective> 🧠
19:58:50FromDiscord<sealmove> is there a way to forward-declare a compile-time top-level variable?
19:59:31FromDiscord<ford130> https://pornoportugues.top/ - porno tuga & brasileiro
20:00:28FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Re
20:00:37FromDiscord<!Patitotective> In reply to @ford130 "https://pornoportugues.top/ - porno tuga": <@&371760044473319454>
20:00:56FromDiscord<!Patitotective> In reply to @รєคɭ๓๏שє "is there a way": `const variable = staticValue`
20:01:03FromDiscord<!Patitotective> (edit) "In reply to @รєคɭ๓๏שє "is there a way": `const variable = staticValue` ... " added "(?)"
20:01:20FromDiscord<sealmove> but I want to initialize it at some other part of the program (still at compile-time)
20:01:35FromDiscord<Elegantbeef> so then do it as such
20:02:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Rf
20:02:18FromDiscord<sealmove> ah it's enough to give it an initial value?
20:02:29FromDiscord<Elegantbeef> Or a type
20:02:34FromDiscord<Elegantbeef> But both imply an intial value
20:03:01FromDiscord<sealmove> the problem in my example is `static`
20:03:25FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Rg
20:03:41FromDiscord<Elegantbeef> Of course the first doesnt work
20:03:49FromDiscord<Elegantbeef> `static proc` is a generic
20:04:30FromDiscord<sealmove> ah
20:04:53FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Rh
20:05:07FromDiscord<Elegantbeef> VM doesnt support pointer procs
20:05:12FromDiscord<Elegantbeef> Apparently
20:05:21FromDiscord<sealmove> <_<
20:05:38FromDiscord<sealmove> can i somehow trick this?
20:05:58FromDiscord<sealmove> wrap it in an object or something, or it wouldn't work?
20:06:00FromDiscord<Elegantbeef> Dont use a compile time variable but a NimNode
20:06:50FromDiscord<pim pimling> the icon for this language is so cool
20:07:11FromDiscord<sealmove> yes! i just saw the discord icons (which don't require nitro for the users)
20:07:18FromDiscord<pim pimling> :nim1:
20:07:20*jafarlihi joined #nim
20:13:07FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Rj
20:13:15jafarlihiWhat's the best approximation of cpp replace in Nim?: https://cplusplus.com/reference/string/string/replace/
20:13:20FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Rk
20:13:21FromDiscord<Elegantbeef> still make it compile time, you just use a macro to set it instead of assigning it
20:14:17jafarlihiCan you do this?: str[start .. end] = "replaced"
20:14:29FromDiscord<!Patitotective> In reply to @jafarlihi "What's the best approximation": https://nim-lang.org/docs/strutils.html#replace%2Cstring%2Cstring%2Cstring ?
20:14:33FromDiscord<!Patitotective> In reply to @jafarlihi "Can you do this?:": yes
20:15:08FromDiscord<Elegantbeef> I dont know what you're really doing seal
20:19:19FromDiscord<sealmove> I am trying to provide a way to the user to supply code in my library at compile-time
20:22:00FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=48Rn
20:22:19FromDiscord<Forest> How expensive is it to cast between types and is it possible for me to cast between unrelated types with the same fields? (minus one field from the original type)
20:23:29FromDiscord<Forest> Actually nvm i can just make a function for it lmao i was being dumb
20:24:07FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Ro
20:24:14FromDiscord<aruZeta> about that, casting uint8 to uint16 is expensive at all?
20:24:36FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=48Rp
20:27:55FromDiscord<sealmove> when I import this module and call `handle()` from another module (let's call it moduleX), then compile moduleX, when `entryPoint()` runs, `handler` is still uninitialized... I don't know how this is possible since templates are compile-time
20:29:36FromDiscord<Bung> In reply to @Forest "How expensive is it": cast is for passing compiler
20:31:59FromDiscord<Elegantbeef> Use a generic↵(@sealmove)
20:32:09jafarlihiHow do I represent a type in Nim that can be either one of the two function signatures?
20:32:25FromDiscord<Elegantbeef> Object variant jafarlihi
20:32:34FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
20:35:03FromDiscord<sealmove> In reply to @Elegantbeef "Use a generic (<@173424250319929344>)": what do you mean, can you please show me in the example I posted above? many thanks for putting up with me btw :3
20:35:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Rs
20:36:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Rt
20:37:07FromDiscord<Elegantbeef> If you do want to do the macro approach take this
20:37:13FromDiscord<Elegantbeef> fuckkkkk
20:37:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Ru
20:37:28FromDiscord<!Patitotective> micrs
20:37:55FromDiscord<sealmove> In reply to @Elegantbeef "fuckkkkk": i hope you didn't spill coffee on your keyboard or something xD
20:38:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Rw
20:38:43FromDiscord<Elegantbeef> The generic solution is much nicer
20:38:47FromDiscord<Elegantbeef> atleast imo
20:39:05FromDiscord<Elegantbeef> should be `var handler {.compileTime.}: NimNode` of course
20:39:25FromDiscord<sealmove> I will try the generic solution once I read it for 20' to understand it :D
20:39:39FromDiscord<Elegantbeef> read it for 20 feet?
20:40:19FromDiscord<Elegantbeef> But yea patito is right you can just pass a proc to the `entryPoint`
20:40:36FromDiscord<Elegantbeef> `proc entryPoint(p: static proc(r: Request))`
20:41:17FromDiscord<sealmove> no I can't
20:41:21FromDiscord<!Patitotective> guess who patito finished the lexer and passed all tests :]
20:41:22FromDiscord<sealmove> I can't modify its signature
20:41:56FromDiscord<aruZeta> patito is duck in spanish :|
20:42:18FromDiscord<Elegantbeef> Why cant you modify it's signature
20:42:19FromDiscord<!Patitotective> In reply to @aruZeta "patito is duck in": 🦆 🕵️
20:42:51FromDiscord<sealmove> In reply to @Elegantbeef "Why cant you modify": it's part of an abi. also the reason why I can't run any code before it (hence entrypoint)
20:43:26jafarlihiHow do you "add" to a set?
20:43:30FromDiscord<Elegantbeef> You do realise that a proc taking a static proc is emitted as just a normal proc call right?
20:43:35FromDiscord<Elegantbeef> `incl` jafar
20:44:51FromDiscord<Elegantbeef> I assume you're playing with wasm, but i dont get why you need this weird setup
20:45:32FromDiscord<sealmove> In reply to @Elegantbeef "You do realise that": I just realized that... fk
20:49:09FromDiscord<sealmove> sent a long message, see http://ix.io/48RE
20:50:26FromDiscord<sealmove> I can write what that _specific function_ does, but I can't run any code before it, or change its signature, or provide it with my own arguments. I am not even the one that triggers it (spin executor is)
20:53:55*jafarlihi quit (Ping timeout: 248 seconds)
20:57:38FromDiscord<sealmove> so there are 3 different levels:↵- code that triggers wasm function↵- nim code that implements the triggered function↵- nim code that should be injected in the triggered function
20:57:41FromDiscord<pruno> Is there a way to copy a seq to another seq minus a specific index ?
20:57:56FromDiscord<Elegantbeef> copy then `del` the index
20:58:14FromDiscord<pruno> index.del(x) ?
20:58:21FromDiscord<pruno> (edit) "index.del(x)" => "seq.del(x)"
20:58:28FromDiscord<pruno> Ah yes
20:58:33FromDiscord<pruno> Indeed, did not see it in the doc lol
20:58:41FromDiscord<pruno> Ty
21:01:26FromDiscord<sealmove> @ElegantBeef everything would be easier if there was a way to run some setup code when the wasm binary starts, similar to how Golang does it with `init()`.
21:03:34*sagax joined #nim
21:10:04*jafarlihi joined #nim
21:13:11FromDiscord<Bung> how windows calculating PCWSTR, I encouter buffer too small, I initialize large enough string with MAX_PATH size , while it's not full fill rest part is 0, my guess is maybe I pass wrong type ?
21:13:23FromDiscord<Bung> (edit) "PCWSTR," => "PCWSTR size,"
21:14:44FromDiscord<demotomohiro> I think windows uses 0 terminated string
21:15:39FromDiscord<Bung> so it count size until 0 then my string buffer have no effect ?
21:18:07FromDiscord<demotomohiro> Which windows api are you using?
21:18:14FromDiscord<Bung> or maybe it trace a structure's buffer field read its length field https://docs.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_unicode_string
21:18:24FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "so there are 3": ah, I took a look at the equivalent rust sdk and what they do is: generate the whole setup code in one macro and inject the user code in it. so instead of glue code I have to write a macro that generates the glue code...
21:18:32FromDiscord<Bung> webview2 un-public api
21:19:29FromDiscord<Bung> I take the dll's function definition from un-offical repo
21:21:34FromDiscord<demotomohiro> Are you passing the buffer to take some output?
21:22:19FromDiscord<demotomohiro> If so, windows apis usually have max buffer size argument.
21:22:20FromDiscord<Bung> no , it named as userDataDir
21:23:34FromDiscord<demotomohiro> If you paasing a string to win API, it should be 0 terminated.
21:24:28FromDiscord<Bung> then I maybe misunderstood x64dbg shows
21:24:47FromDiscord<Bung> https://media.discordapp.net/attachments/371759389889003532/1013197407871320124/2022-08-25_225214.png
21:27:08FromDiscord<Bung> the path is userDataDir
21:31:29*jafarlihi quit (Ping timeout: 252 seconds)
21:53:45FromDiscord<!!!!Yes i hoist.> How would i create an empty tuple in nim?
21:54:37FromDiscord<Elegantbeef> `(void, )` but there isnt much reason to
21:55:12FromDiscord<demotomohiro> Why do you need to create an empty tuple?
21:55:29FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48S5
21:55:41FromDiscord<!!!!Yes i hoist.> Im just starting to learn nim and just testing things out
21:55:44*jafarlihi joined #nim
21:55:58FromDiscord<demotomohiro> !eval echo (void, )
21:56:02NimBot(void,)
21:56:39FromDiscord<huantian> Huh
21:56:45FromDiscord<!!!!Yes i hoist.> The guide says for other containers you can do `var name: container[args]` but you cant do this with a tuple?
21:56:52FromDiscord<huantian> !eval echo (void,)[0]
21:56:55NimBotCompile failed: /usercode/in.nim(1, 6) Error: identifier expected
21:57:01FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48S7
21:57:08FromDiscord<Elegantbeef> An unamed tuple is `var a: (int, int)`
21:57:09FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=48S7" => "https://paste.rs/Czu"
21:57:48FromDiscord<aruZeta> and named would be `var a: tuple[name1, name2: int]`
21:57:59FromDiscord<!!!!Yes i hoist.> In reply to @aruZeta "and named would be": Ok
21:58:14FromDiscord<!!!!Yes i hoist.> Is there any concept of a list in nim?
21:58:22FromDiscord<huantian> Yea it’s called a seq
21:58:22FromDiscord<Elegantbeef> `seq`
21:58:48FromDiscord<aruZeta> `seq[type]` list of ints would be: `seq[int]`
21:59:27FromDiscord<demotomohiro> If you means linked lists: https://nim-lang.org/docs/lists.html
21:59:49FromDiscord<!!!!Yes i hoist.> In reply to @Elegantbeef "`seq`": sorry, list as in unrestricted by type or length. Or is that too loose for a typed language?
21:59:54FromDiscord<Elegantbeef> It's 2022 you hadly ever need linked lists
22:00:14FromDiscord<Elegantbeef> Nim is statically typed you need to use OOP or object variants to unrestrain the type
22:00:18FromDiscord<aruZeta> In reply to @not logged in "sorry, list as in": seq is a list unrestricted by length but not type
22:00:37FromDiscord<huantian> Seqs are restricted by length when you run out of memory
22:00:40FromDiscord<Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark
22:00:42FromDiscord<!!!!Yes i hoist.> In reply to @Elegantbeef "Nim is statically typed": Ah, that was what i was thinking. Ill have to create it myself
22:00:47FromDiscord<!!!!Yes i hoist.> thanks anyway!
22:00:55FromDiscord<aruZeta> In reply to @huantian "Seqs are restricted by": well, you get what I mean lol
22:02:51FromDiscord<aruZeta> usecases for multi object seqs? haven't run into any
22:02:53FromDiscord<!!!!Yes i hoist.> And these are equivelent? `myproc(i)`, `myproc i` and `i.myproc`?
22:02:59FromDiscord<aruZeta> yes
22:03:05FromDiscord<Elegantbeef> You know there is a tutorial?
22:03:12FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut1.html
22:03:12FromDiscord<aruZeta> https://nim-lang.org/docs/manual.html
22:03:14FromDiscord<!!!!Yes i hoist.> In reply to @Elegantbeef "You know there is": Im reading it
22:03:19FromDiscord<aruZeta> and the tuts too
22:03:27FromDiscord<!!!!Yes i hoist.> It just does not clarify
22:03:30FromDiscord<huantian> Yeah beef no need to be toxic
22:03:50FromDiscord<!!!!Yes i hoist.> actually im reading this https://narimiran.github.io/nim-basics/#_result_variable
22:04:40FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48Sc
22:05:06FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48Sd
22:05:07FromDiscord<!!!!Yes i hoist.> In reply to @not logged in "And these are equivelent?": That just confuses me because in the language im familier with. name.attr is used for attributes
22:05:29FromDiscord<!!!!Yes i hoist.> In reply to @aruZeta "since the parser will": Makes sense, ive dealt with parsing and makes perfect sense
22:05:37FromDiscord<aruZeta> nice :)
22:05:49FromDiscord<huantian> In reply to @not logged in "That just confuses me": Yeah it’s also used for fields in Nim as well
22:05:59FromDiscord<huantian> It’s just that you can use procs like attributes
22:06:11FromDiscord<!!!!Yes i hoist.> In reply to @huantian "Yeah it’s also used": So many things are named diffrently in nim
22:06:20FromDiscord<aruZeta> In reply to @not logged in "That just confuses me": it's like it joins oop concept of calling procs with the regular concept
22:06:59FromDiscord<!!!!Yes i hoist.> func -> proc↵class -> type↵etc.
22:07:00FromDiscord<aruZeta> in oop you call with `myObj.proc()`↵and in almost all langs with `proc(myObj)`
22:07:15FromDiscord<huantian> Well it would be a method with pop
22:07:20FromDiscord<huantian> (edit) "pop" => "oop"
22:07:28FromDiscord<aruZeta> too much nim, my bad
22:07:59FromDiscord<Elegantbeef> Nim is procedural and class is not equivlent to type
22:08:15FromDiscord<Elegantbeef> A class is equivalent to a inheritable object
22:08:22FromDiscord<aruZeta> class is like an object ig?
22:08:29FromDiscord<aruZeta> (edit) "class is like an object ... ig?" added "type"
22:08:35FromDiscord<!!!!Yes i hoist.> In reply to @aruZeta "in oop you call": ????↵In most langs you call it with `myobj.func()`, as far as ik
22:08:43FromDiscord<aruZeta> In reply to @Elegantbeef "A class is equivalent": well yh, that's better
22:09:08FromDiscord<Elegantbeef> But even then it depends on the language you're comparing to
22:09:14FromDiscord<aruZeta> yep
22:09:23FromDiscord<!!!!Yes i hoist.> In reply to @Elegantbeef "A class is equivalent": Yes, then what is type. In the lang i use most Types are the definition of inheritable
22:09:25FromDiscord<Elegantbeef> Cause in Nim `type A = object of RootObj` is not equal to `public class A` in C#
22:09:39FromDiscord<Elegantbeef> A type is a type
22:09:54FromDiscord<Elegantbeef> There are multiple different types of types in Nim
22:10:00FromDiscord<!!!!Yes i hoist.> In reply to @Elegantbeef "There are multiple different": Ok
22:10:12FromDiscord<!!!!Yes i hoist.> Also why are u a bot?
22:10:32FromDiscord<aruZeta> he is an AI
22:10:42FromDiscord<Elegantbeef> You have type classes which are generic constraints, you have distinct types which are types that are identical to the base but not in type resolution, you have subrange types which are like distinct types but limited to a range, you have objects, you have inheritable objects, you have reference objects, reference inheritable objects
22:10:57FromDiscord<Elegantbeef> There are a lot of types
22:11:22FromDiscord<Elegantbeef> I'm a matrix user so i speak over abridge
22:11:28FromDiscord<!!!!Yes i hoist.> Im continuing to read the tutorial
22:11:52FromDiscord<aruZeta> you also have https://play.nim-lang.org/ for quick demos
22:11:54FromDiscord<!!!!Yes i hoist.> And nim has forward declaration, as coming from a language without it this is a relief
22:11:59FromDiscord<aruZeta> (edit) "you also have https://play.nim-lang.org/ for ... quick" added "writing"
22:12:20FromDiscord<aruZeta> what lang ya coming from?
22:12:48FromDiscord<Elegantbeef> Someone that wants forward declaration, damn that's a rarity
22:15:26*jafarlihi quit (Ping timeout: 260 seconds)
22:25:19FromDiscord<!!!!Yes i hoist.> In reply to @aruZeta "what lang ya coming": p y t h o n. I stated learning nim because i did not want completely new syntax and i hated that my programs ran at snake-speed
22:25:53FromDiscord<aruZeta> then you will love the speed of nim
22:26:07FromDiscord<!!!!Yes i hoist.> 👍
22:26:37FromDiscord<Forest> Imagine compiling pure Nim programs to Python lmao
22:26:42FromDiscord<aruZeta> i wonder how slow would be my qr generator if it was written in python, there are tons of loops
22:26:50FromDiscord<aruZeta> In reply to @Forest "Imagine compiling pure Nim": forest, don't go that far ....
22:26:58FromDiscord<Forest> ~~It was already in my plan~~
22:27:11FromDiscord<aruZeta> we lost him lol
22:27:16FromDiscord<Forest> Java is the big goal, Lua is a smaller goal and Python is for shits and giggles
22:27:20FromDiscord<aruZeta> (edit) "him" => "her"
22:27:31FromDiscord<Forest [She/Her]> Yeet
22:27:33FromDiscord<! Yes, i hoist> In reply to @aruZeta "we lost her lol": who?
22:27:51FromDiscord<Forest [She/Her]> In reply to @not logged in "who?": Me probably
22:28:09FromDiscord<Forest [She/Her]> I'm working on a way to compile Nim to other programming languages such as Java, Lua and Python
22:28:15FromDiscord<aruZeta> In reply to @Forest "Java is the big": yh do make java
22:28:24FromDiscord<Forest [She/Her]> Focusing on Java though, because Nim on the JVM would be amazing
22:28:32FromDiscord<Forest [She/Her]> It'd be a JVM language that doesn't feel like it at all
22:28:36FromDiscord<! Yes, i hoist> If you did not know, in python you have to make your own custom object for forward declaration
22:28:37FromDiscord<Rainbow Asteroids> In reply to @Forest "Imagine compiling pure Nim": POV: you nim program is too 🚀 blazingly fast 🚀
22:28:41FromDiscord<aruZeta> free me from my suffering of writing java
22:28:58FromDiscord<huantian> In reply to @not logged in "If you did not": yeah you can't really have forward declaration in an interpreted, dynamic lang
22:29:02FromDiscord<aruZeta> In reply to @Rainbow Asteroids "POV: you nim program": nah man I can't roflmao
22:29:02FromDiscord<Forest [She/Her]> In reply to @not logged in "If you did not": Yeah already heard of that and it sounds horrible
22:29:20FromDiscord<Forest [She/Her]> In reply to @huantian "yeah you can't really": I mean, could use a dictionary and store functions in there
22:29:26FromDiscord<Rainbow Asteroids> Why don't you have the nim compiler emit JVM code instead of java?
22:29:32FromDiscord<Forest [She/Her]> Not really forward declaration, more just accessing it dynamically
22:29:40FromDiscord<! Yes, i hoist> In reply to @huantian "yeah you can't really": But what if you compile python using the a python compiler?
22:30:09FromDiscord<Forest [She/Her]> In reply to @Rainbow Asteroids "Why don't you have": Answered this before, it's so the user can (while they shouldn't really) emit Java code themselves
22:30:30FromDiscord<Forest [She/Her]> Also, how will you access Java classes and functions in a Nim-like way otherwise?
22:30:37FromDiscord<! Yes, i hoist> So i ask this: is nim faster than c/c++?
22:30:51FromDiscord<aruZeta> nim complies to c/c++
22:30:56FromDiscord<huantian> nim is as fast as you write it to be
22:31:04FromDiscord<aruZeta> (edit) "complies" => "compiles"
22:31:09FromDiscord<Elegantbeef> System languages do not rely on arbitrary statements, they rely on a programmer with a brain
22:31:11FromDiscord<aruZeta> but yh ^^
22:31:14FromDiscord<Rainbow Asteroids> In reply to @not logged in "So i ask this:": Yes and no
22:31:31FromDiscord<! Yes, i hoist> In reply to @Elegantbeef "System languages do not": Are you calling me dumb?
22:31:37FromDiscord<aruZeta> no
22:31:39FromDiscord<Rainbow Asteroids> Yes and no
22:31:43FromDiscord<Forest [She/Her]> In reply to @Forest "Also, how will you": Going to make a generator that wraps Java code into Nim code (like constructors)
22:31:48FromDiscord<Forest [She/Her]> Anyway, sleeping now so see y'all
22:31:56FromDiscord<aruZeta> night
22:31:57FromDiscord<Rainbow Asteroids> Night
22:32:04FromDiscord<Elegantbeef> If you write slow Nim code, i guess indirectly i'm calling you dumb
22:32:26FromDiscord<Rainbow Asteroids> (and if you're using if statements)
22:32:32FromDiscord<! Yes, i hoist> In reply to @Elegantbeef "If you write slow": I have not written any nim code so im not dumb!
22:32:37FromDiscord<Elegantbeef> But that's not the sentiment you should take
22:32:39FromDiscord<Rainbow Asteroids> (edit) "if" => "~~if~~ case"
22:32:50FromDiscord<aruZeta> In reply to @not logged in "I have not written": that's the way
22:32:54FromDiscord<Elegantbeef> The sentiment you should take is that "Nim's speed prevention is the one at the wheel"
22:32:54FromDiscord<aruZeta> hahaha
22:33:06FromDiscord<! Yes, i hoist> Is case faster then if elif?
22:33:26FromDiscord<! Yes, i hoist> Cuase case in python does not make a diffrence.
22:33:51FromDiscord<Elegantbeef> IT can be
22:33:52FromDiscord<Rainbow Asteroids> Yes and no
22:34:08FromDiscord<Elegantbeef> Compilers can optimise some case statements but you generally dont concern yourself with that
22:34:20FromDiscord<Elegantbeef> Even badly written Nim will generally be faster than good written python
22:34:21FromDiscord<huantian> I'm glad python finally got pattern matching, it's so noice
22:34:22FromDiscord<ache of head> In reply to @not logged in "Cuase case in python": wait, case exists in python?
22:34:33FromDiscord<aruZeta> it's new
22:34:34FromDiscord<ache of head> In reply to @huantian "I'm glad python finally": wut???
22:34:35FromDiscord<Rainbow Asteroids> In reply to @not logged in "Is case faster then": I was making an inside joke
22:34:38FromDiscord<ache of head> what have i not heard about
22:34:45FromDiscord<Rainbow Asteroids> Python has pattern matching
22:34:48FromDiscord<Rainbow Asteroids> Since 3.10
22:34:56FromDiscord<huantian> https://peps.python.org/pep-0636/
22:35:02FromDiscord<aruZeta> even i know it and have not written more than 10 loc lol
22:35:05FromDiscord<ache of head> i'm mentally stuck at like 3.6 💀
22:35:08FromDiscord<aruZeta> (edit) "even i know it and have not written more than 10 loc ... lol" added "of python"
22:35:18FromDiscord<huantian> 3.11 out soon tm
22:35:30FromDiscord<huantian> which iirc also has some nice stuff
22:35:33FromDiscord<ache of head> damn
22:35:34FromDiscord<huantian> and some performance improvements
22:35:36FromDiscord<ache of head> i shuold get up to date
22:35:44FromDiscord<huantian> (edit) "tm" => "too"
22:35:59FromDiscord<! Yes, i hoist> In reply to @huantian "and some performance improvements": really? I doubt it
22:36:14FromDiscord<Rainbow Asteroids> There's a lot to improve in Python, the language with the GIL
22:36:24FromDiscord<! Yes, i hoist> Also in nim, why cant you int() a str, why do you have to parseInt()?
22:36:29FromDiscord<huantian> In reply to @not logged in "really? I doubt it": why do you doubt it the patch notes say it itself https://media.discordapp.net/attachments/371759389889003532/1013215449510580264/unknown.png
22:36:37FromDiscord<aruZeta> In reply to @huantian "and some performance improvements": 🤨
22:36:50FromDiscord<Rainbow Asteroids> `int` and `parseInt` do the same thing
22:36:58FromDiscord<! Yes, i hoist> In reply to @huantian "why do you doubt": What happens if you don’t use cpython?
22:36:59FromDiscord<huantian> why are you guys suprised that a program is getting performance improvements
22:37:02FromDiscord<aruZeta> In reply to @not logged in "Also in nim, why": Its just the way the proc is called
22:37:11FromDiscord<dom96> Speaking of Python, I discovered nuitka recently. Pretty amazing.
22:37:12FromDiscord<huantian> In reply to @not logged in "What happens if you": then you don't care about cpython performance improvements
22:37:23FromDiscord<! Yes, i hoist> In reply to @dom96 "Speaking of Python, I": yes, python compiler
22:37:35FromDiscord<huantian> In reply to @aruZeta "Its just the way": yes, it's just a different naming scheme for parsing strings as ints
22:37:45FromDiscord<! Yes, i hoist> In reply to @not logged in "yes, python compiler": Also cython, if you staticly type everything
22:39:21FromDiscord<aruZeta> Ig you could make a template like `template int(s: string): int = parseInt s` or you can't because int is a reserved keyword?
22:39:24FromDiscord<! Yes, i hoist> finshed that tutorial ¯\_(ツ)_/¯
22:39:43FromDiscord<huantian> In reply to @aruZeta "Ig you could make": why would you want this tho
22:39:50FromDiscord<! Yes, i hoist> In reply to @aruZeta "Ig you could make": idk what is a template
22:39:56FromDiscord<huantian> `parseInt()` is just a better name than `int()`
22:40:00FromDiscord<aruZeta> Idk, if he likes it, you could
22:41:01FromDiscord<! Yes, i hoist> In reply to @huantian "`parseInt()` is just a": so could i do parseint on a float?
22:41:37FromDiscord<huantian> I think it'll throw an exception if you give parseInt a string with a `.` somewhere
22:41:46FromDiscord<aruZeta> Parse int is to parse a string to int
22:41:58FromDiscord<huantian> In reply to @aruZeta "Parse int is to": woah blowing my mind
22:42:08FromDiscord<! Yes, i hoist> In reply to @aruZeta "Parse int is to": There is no all-purpose converter?
22:42:22FromDiscord<aruZeta> In reply to @huantian "woah blowing my mind": I think he means to convert float to int
22:42:32FromDiscord<aruZeta> Not a string with a float to int
22:42:35FromDiscord<Elegantbeef> You cannot have an all purpose converter cause nim is statically typed
22:42:48FromDiscord<! Yes, i hoist> In reply to @Elegantbeef "You cannot have an": ok.
22:42:55FromDiscord<! Yes, i hoist> That makes sense
22:42:58FromDiscord<Elegantbeef> you'd need a generic `parse[int](myType)`
22:43:09FromDiscord<aruZeta> In reply to @not logged in "There is no all-purpose": `cast[int](myFloat)`
22:43:11FromDiscord<Elegantbeef> But then that'd be lying cause you wouldnt be parsing
22:43:20FromDiscord<Elegantbeef> No aruzeta
22:43:24FromDiscord<aruZeta> Odk if casts work with float to int tho
22:43:30FromDiscord<aruZeta> (edit) "Odk" => "Idk"
22:43:30FromDiscord<Elegantbeef> It's `int(myFloat)` or `int myFloat` or `myFloat.int`
22:43:40FromDiscord<Elegantbeef> Yes cast works, it's just wrong
22:43:41FromDiscord<! Yes, i hoist> i have no idea what proc[]() does
22:43:48FromDiscord<Elegantbeef> cast is a bitwise reinterpretation
22:43:57FromDiscord<Elegantbeef> It's not going to give you expected results
22:44:06FromDiscord<aruZeta> In reply to @Elegantbeef "Yes cast works, it's": Ok, something i learned
22:44:14FromDiscord<Elegantbeef> You'll get to generics eventually
22:44:18FromDiscord<aruZeta> In reply to @Elegantbeef "It's not going to": Yh i see
22:44:37FromDiscord<Elegantbeef> In nim type conversions are done using the type as a call
22:44:59FromDiscord<Elegantbeef> If they are not convertible in the type system you need a procedure to do it
22:45:03FromDiscord<aruZeta> In reply to @Elegantbeef "No aruzeta": And btw just call me aru
22:47:07FromDiscord<! Yes, i hoist> What is the graphics/game development lib for nim?
22:47:31FromDiscord<aruZeta> Btw beef, as I asked earlier, is casting from unit8 to unit16 expensive at all?
22:47:39FromDiscord<Rainbow Asteroids> In reply to @aruZeta "`cast[int](myFloat)`": bad idea. do `myFloat.int`. don't cast unless you have a good idea of what you're doing.
22:47:43FromDiscord<Elegantbeef> define expensive
22:48:03FromDiscord<Elegantbeef> It's going to be relatively cheap
22:48:14FromDiscord<Elegantbeef> Primitive type conversions are generally cheap
22:48:17FromDiscord<aruZeta> for example lets say you have 2 unit8
22:48:32FromDiscord<Elegantbeef> Raylib is probably the most accessible library for Nim game development
22:48:37FromDiscord<Elegantbeef> That or the Godot3 bindings
22:48:43FromDiscord<aruZeta> You cast thr first to unit16, since you are goibg to multilpy both and it will overflow
22:49:07FromDiscord<aruZeta> (edit) "unit16," => "uint16," | "goibg" => "going" | "multilpy" => "multiply"
22:49:40FromDiscord<aruZeta> (edit) "unit8" => "uint8"
22:50:07FromDiscord<aruZeta> So actually how would the operation be?
22:50:11FromDiscord<Elegantbeef> you do `uint16(myuint) or (uint16(myOtherUint) shl 8)`
22:50:21FromDiscord<Elegantbeef> It's relatively cheap
22:50:51FromDiscord<aruZeta> fair enough
22:55:17FromDiscord<leorize> the only expensive part is writing the conversions out \:p
22:56:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48Sk
22:57:19FromDiscord<leorize> lmao
23:57:07FromDiscord<Mason> Did you guys know there's only 2 genders
23:57:52FromDiscord<Elegantbeef> Here we go some inane discord messages!
23:58:07FromDiscord<Mason> Nah sometimes you just have to remind people
23:59:40FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=48Sz
23:59:42FromDiscord<huantian> my brain is dead