<< 05-06-2021 >>

00:00:28*mjsir911 quit (Quit: Goodbye, World!)
00:02:10*mjsir911 joined #nim
00:02:39*mjsir911 quit (Remote host closed the connection)
00:03:05*mjsir911 joined #nim
00:03:55*sunphlox_ joined #nim
00:04:06*sunphlox_ quit (Remote host closed the connection)
00:09:06*bung joined #nim
00:09:39FromDiscord<codic> why does nimble ignore nim.cfg and config.nims?
00:13:33*bung quit (Ping timeout: 248 seconds)
00:17:29FromDiscord<codic> like I want to compile my code with threads:on how do I tell nimble to do that?
00:20:48FromDiscord<ElegantBeef> `switch("threads", "on")`
00:28:38*hrw[m]1 joined #nim
00:29:09*hrw[m]1 quit (Remote host closed the connection)
00:57:28*nphg joined #nim
00:58:45FromDiscord<System64 ~ Flandre Scarlet> @ElegantBeef I did some progress, I don't have errors but the weird thing is when I try to display a tilemap, nothing is displayed, not sure it's normal,do you know how can I fix that please?
00:59:19FromDiscord<ElegantBeef> Are you doing the same as you would from C?
00:59:24*nphg1 quit (Ping timeout: 252 seconds)
00:59:38FromDiscord<System64 ~ Flandre Scarlet> Normally yeah, I can send you my file if you want
01:00:00FromDiscord<ElegantBeef> As varriount mentioned would be best if it was on a git repo πŸ˜„
01:00:14FromDiscord<System64 ~ Flandre Scarlet> alright wait a second
01:03:56*Gamah4 joined #nim
01:04:38*Gamah4 quit (Remote host closed the connection)
01:13:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "As varriount mentioned would": https://github.com/system64MC/NimTilengine
01:16:02FromDiscord<ElegantBeef> Gotta compile tile engine so give me second πŸ˜„
01:17:43FromDiscord<System64 ~ Flandre Scarlet> why compiling it? The dll is already there
01:17:49FromDiscord<ElegantBeef> Linux
01:18:00FromDiscord<System64 ~ Flandre Scarlet> Aaaah! Alright
01:18:15FromDiscord<System64 ~ Flandre Scarlet> I can send it if you want I think I have a Linux version
01:19:30FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850544329779838996/libTilengine.so
01:22:57FromDiscord<codic> In reply to @ElegantBeef "`switch("threads", "on")`": huh thats what I was using in config.nims but it magically works now
01:25:05*NimBot joined #nim
01:27:47FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oMx
01:27:54FromDiscord<ElegantBeef> your pragma is before the return type
01:31:22FromDiscord<ElegantBeef> @System64 ~ Flandre Scarlet your bindings are not the same as the internal C code as so things arent working the same causing the issue, what's the output of that tutorial supposed to be?
01:33:15FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oMy
01:33:45FromDiscord<ElegantBeef> Ah my present output πŸ˜„ https://media.discordapp.net/attachments/371759389889003532/850547912692989972/unknown.png
01:35:12FromDiscord<codic> beautiful
01:36:39FromDiscord<System64 ~ Flandre Scarlet> So we have a problem no?
01:36:48FromDiscord<ElegantBeef> Yes the bindings arent identical it seems
01:37:05FromDiscord<System64 ~ Flandre Scarlet> ah, weird!↡How can I fix that?
01:37:41FromDiscord<ElegantBeef> Well like `setLayer` doesnt have a nilable second parameter but in the example it does
01:41:05FromDiscord<ElegantBeef> `typedef struct Tileset TLN_Tileset;` Like this in the C, i dont get it, there is no Tileset type
01:42:37FromDiscord<System64 ~ Flandre Scarlet> Defined there https://media.discordapp.net/attachments/371759389889003532/850550144075694110/unknown.png
01:42:48FromDiscord<ElegantBeef> In the C
01:43:16FromDiscord<ElegantBeef> It's a `Tileset` which is a pointer to `Tileset` but `Tileset` isnt an existing type that i can see
01:45:37FromDiscord<System64 ~ Flandre Scarlet> ah weird
01:46:11FromDiscord<ElegantBeef> Is that just a ptr to an empty struct, seems so
01:48:10FromDiscord<System64 ~ Flandre Scarlet> WTF↡So what should I do?
01:48:41FromDiscord<ElegantBeef> I'm testing stuf now, i just turned all of those `type Name {.bycopy.} = object` into `type Name = ptr object`
01:48:57FromDiscord<System64 ~ Flandre Scarlet> alright
01:50:05FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oMC
01:50:22FromDiscord<ElegantBeef> Yea it seems it's just an alias for a ptr to make it more readable
01:50:44FromDiscord<ElegantBeef> ehhhh https://media.discordapp.net/attachments/371759389889003532/850552181912633424/unknown.png
01:52:47FromDiscord<ElegantBeef> There you go, got a PR sitting at your doorstep
01:55:25FromDiscord<System64 ~ Flandre Scarlet> Oh nice!↡what did you changed to be precise?
01:55:40FromDiscord<ElegantBeef> You have a PR
01:55:54FromDiscord<System64 ~ Flandre Scarlet> Oh alright, I'll accept it
01:56:00FromDiscord<ElegantBeef> I mean https://github.com/system64MC/NimTilengine/pull/1/files
01:56:04FromDiscord<ElegantBeef> The diff is here
01:56:33FromDiscord<ElegantBeef> The important thing might be using `nil` instead of` ""`
01:57:32FromDiscord<ElegantBeef> Nvm it's the ptrs + using `""` instead of nil i guess
01:58:05FromDiscord<System64 ~ Flandre Scarlet> How can I accept a PR please?
01:58:29FromDiscord<ElegantBeef> Should say "Merge PR" or similar here https://github.com/system64MC/NimTilengine/pull/1
01:59:54FromDiscord<System64 ~ Flandre Scarlet> I was disconnected, that's why I didn't find it, woops
02:00:15FromDiscord<System64 ~ Flandre Scarlet> Done! Thanks!
02:00:22FromDiscord<ElegantBeef> Now your goal is to remove all instances of `tln_` on names
02:00:40FromDiscord<ElegantBeef> This isnt C we dont need that shit πŸ˜›
02:01:34FromDiscord<System64 ~ Flandre Scarlet> WTF https://media.discordapp.net/attachments/371759389889003532/850554911594250270/unknown.png
02:03:00FromDiscord<ElegantBeef> Never seen that before
02:05:03FromDiscord<ElegantBeef> Seems a program is holding it
02:07:25*bung joined #nim
02:11:57*bung quit (Ping timeout: 248 seconds)
02:13:57*arkurious quit (Quit: Leaving)
02:20:29*Th0mas_26 joined #nim
02:20:53*Th0mas_26 quit (Remote host closed the connection)
02:21:30*Jucato27 joined #nim
02:21:31*Jucato27 quit (Remote host closed the connection)
02:23:49*gadget joined #nim
02:24:03*gadget is now known as Guest6486
02:24:21*Guest6486 quit (Remote host closed the connection)
02:27:51*bung joined #nim
02:32:13*bung quit (Ping timeout: 248 seconds)
02:33:25FromDiscord<System64 ~ Flandre Scarlet> That works! Nice!
02:40:42*lain quit (Quit: brb)
02:43:50*lain joined #nim
02:47:18FromDiscord<codic> how can I get all the environment variables present (to pass to std/posix.execve) in the current environment? something like the non-standard envp in C
02:47:52FromDiscord<codic> https://nim-lang.org/docs/os.html#envPairs.i might work
02:48:06FromDiscord<codic> but how do I do that with a cstringarray πŸ€”
02:48:14*bung joined #nim
02:49:41FromDiscord<ElegantBeef> join them into `key=value` and make a seq to hold that then send to cstringarrayalloc or something like that? Idk what cstringarray is even for πŸ˜„
02:53:11*bung quit (Ping timeout: 260 seconds)
03:11:28*lain quit (Quit: brb again)
03:16:52*lain joined #nim
03:35:24*jwbernin joined #nim
03:35:34*jwbernin quit (Remote host closed the connection)
03:52:21*spiderstew_ joined #nim
03:53:22*spiderstew quit (Ping timeout: 245 seconds)
03:54:54*bung joined #nim
04:15:14FromGitter<gogolxdong> What does this error mean , it used to compile ⏎ ⏎ ```Error: unhandled exception: over- or underflow [OverflowDefect] ⏎ FAILURE``` [https://gitter.im/nim-lang/Nim?at=60bafa525e3ef60161e47656]
04:16:32FromGitter<gogolxdong> recent nim failed to compile more often than before.
04:17:58FromDiscord<ElegantBeef> What's the code causing this error?
04:18:56FromGitter<gogolxdong> build_all.bat
04:19:21FromGitter<gogolxdong> Nim Compiler Version 1.5.1 [Windows: amd64] ⏎ Compiled at 2021-06-05 ⏎ Copyright (c) 2006-2021 by Andreas Rumpf ⏎ ⏎ git hash: a2b60812568b5b90af9bb15c50873a726dd49b94 ... [https://gitter.im/nim-lang/Nim?at=60bafb489cc69444a01f576b]
04:19:50FromDiscord<codic> In reply to @ElegantBeef "join them into `key=value`": just char it looks like
04:20:38FromDiscord<Rainbow Asteroids> trying to build the compiler caused the error?
04:21:32FromDiscord<ElegantBeef> Seems like you might hold a broken compiler but idk
04:33:01*pingjocky0 joined #nim
04:33:35*pingjocky0 quit (Remote host closed the connection)
04:40:27*desdes3 joined #nim
04:40:54*desdes3 quit (Remote host closed the connection)
05:06:23*neelpandeya[m|gr joined #nim
05:06:50*neelpandeya[m|gr quit (Remote host closed the connection)
05:08:50*narimiran joined #nim
05:23:39*jwashin1 joined #nim
05:23:46*jwashin1 quit (Remote host closed the connection)
05:30:16ForumUpdaterBotNew Nimble package! libfuzzer - Thin interface for libFuzzer, an in-process, coverage-guided, evolutionary fuzzing engine., see https://github.com/planetis-m/libfuzzer
05:41:04*Landryl joined #nim
05:41:31*Landryl quit (Remote host closed the connection)
05:51:33*daaniel4 joined #nim
05:52:08*daaniel4 quit (Remote host closed the connection)
05:58:09*Lil_BRATgrl_xXx1 joined #nim
05:58:52*Lil_BRATgrl_xXx1 quit (Remote host closed the connection)
06:00:44FromDiscord<Varriount> Araq: Will using mimalloc affect plans for "transferring" ownership of objects/refs between threads?
06:09:46FromDiscord<Varriount> In reply to @Rainbow Asteroids "trying to build the": What C compiler are you using, and which architecture does it target (32-bit or 64-bit\)?↡\or if you prefer, x86 or x86-64
06:10:31FromDiscord<Rainbow Asteroids> I was asking if the guy on gitter was having that issue because he was being vauge.
06:10:43FromDiscord<Rainbow Asteroids> The compiler compiles fine
06:10:48FromDiscord<Varriount> Oh, woops. Sorry, I misread
06:10:49FromDiscord<Rainbow Asteroids> (edit) "The compiler compiles fine ... " added "for me"
06:13:48*eddyb[legacy] joined #nim
06:13:59FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNG
06:14:15*eddyb[legacy] quit (Remote host closed the connection)
06:16:35FromDiscord<Rika> can you try echoing what pid's type is?
06:16:39FromDiscord<Rika> before the case
06:16:45*bomb-on joined #nim
06:16:48FromDiscord<ElegantBeef> It's an imported type so that might play with the abillities?
06:17:00*bomb-on quit (Remote host closed the connection)
06:17:08FromDiscord<codic> found the issue, it thought that `pid` was a function pointer to posix.fork
06:17:13FromDiscord<codic> because `pid = posix.fork()` works
06:17:19FromDiscord<codic> and the cast was totally doing it wrong lol
06:17:29FromDiscord<codic> ufcs can bite you sometimes
06:19:54FromDiscord<ElegantBeef> Ufcs didnt do it, your usage of a qualified proc call did πŸ˜„
06:21:20FromDiscord<Rika> that was totally not UFCS's fault
06:21:31FromDiscord<codic> hmm
06:21:36FromDiscord<Rika> even if you did something similar in python it would do the same thing
06:22:00FromDiscord<ElegantBeef> well to be fair UFCS/command syntax does mean you can get a proc call without `()`
06:22:07FromDiscord<codic> in an ideal language for me that would error
06:22:09FromDiscord<Rika> only with an argument
06:22:19FromDiscord<Rika> no language with first-class functions would error
06:22:29FromDiscord<codic> (edit) "in an ideal language for me that would error ... " added "right there, the assignment, if I wanted the function pointer I would do x.addr etc"
06:22:31FromDiscord<codic> fair
06:22:49FromDiscord<Rika> that already disqualifies a whole bunch of languages so
06:23:22FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNK
06:23:39FromDiscord<Rika> make a tempvar
06:24:07FromDiscord<Rika> like just make one, i dont know of any language that lets you do it in one line and no semicolons/"line break emulators"
06:24:21FromDiscord<Varriount> In reply to @codic "https://nim-lang.org/docs/posix.html#Pid Pid is def": Ooo, making a shell?
06:28:35FromDiscord<codic> Playing around with writing an init system
06:29:26FromDiscord<Varriount> In reply to @codic "Playing around with writing": This might be useful to you: https://github.com/Varriount/commandant/blob/master/commandant/subprocess.nim#L162
06:30:29FromDiscord<codic> interesting, thanks!
06:30:50FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNO
06:31:22FromDiscord<ElegantBeef> `"we're in the parent"` phrasing
06:31:34FromDiscord<codic> lol
06:31:43FromDiscord<codic> `if were in parent: `
06:31:48FromDiscord<Rika> "we're in child"
06:31:59FromDiscord<codic> `else if werein child`
06:32:06FromDiscord<codic> (edit) "werein" => "were in"
06:32:59FromDiscord<Varriount> I think my subprocess code is the part of my toy shell that I'm the most proud of. Despite the fact that (I think?) I translated the implementation from C.
06:33:16FromDiscord<Varriount> (edit) removed "(I think?)"
06:33:37FromDiscord<Varriount> I cleaned up the translation quite a bit though. With, you know, actual utility functions and such.
06:37:33FromDiscord<codic> interesting
06:38:18FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNR
06:38:58FromDiscord<codic> oh, it only happens when I give it time to run
06:39:08FromDiscord<codic> like an infinite loop (which I'll replace with an event loop later)
06:47:25*Carlynne-t joined #nim
06:48:01*Carlynne-t quit (Remote host closed the connection)
06:54:25*dcoutts__4 joined #nim
06:54:42*dcoutts__4 quit (Remote host closed the connection)
06:54:59FromDiscord<codic> valid in arc?
06:55:01FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNX
06:55:01FromDiscord<codic> or is it cyclic?
06:55:12FromDiscord<Rika> you will be warned if it is
06:55:23FromDiscord<codic> (edit) "https://play.nim-lang.org/#ix=3oNX" => "https://play.nim-lang.org/#ix=3oNY"
06:55:33FromDiscord<Rika> and no i think it is not
06:55:45FromDiscord<Rika> since client is stack-based
06:55:53FromDiscord<codic> yep no warnings
06:56:01FromDiscord<codic> but if it is a ref object then I need to bring in `orc`?
06:56:20FromDiscord<Rika> you can mark it as acyclic if you know it is acyclkic
06:59:24FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oO0
07:00:04FromDiscord<Rika> cyclic means a Node that points to itself, or has something that points to itself
07:00:12FromDiscord<Rika> N1 -> N2 -> N1 is cyclic
07:00:16FromDiscord<Rika> a tree is not cyclic
07:00:52FromDiscord<Rika> ref types dont necessarily mean cycles
07:00:59FromDiscord<Rika> just a possibility to
07:01:27FromDiscord<Rika> (and its hard to detect it in some cases i believe)
07:01:29FromDiscord<Rika> which is why you can mark acyclic
07:05:22FromDiscord<ElegantBeef> Yea the compiler doesnt check to make sure it's cyclical, you have to know it's not
07:07:13FromDiscord<codic> got it
07:37:07*affix joined #nim
07:37:37*affix quit (Remote host closed the connection)
07:59:45FromDiscord<Varriount> Anyone know what the practical difference is between `type X = object of Y` and `type X = Y` , assuming `Y` is an object? And would it be different if both X and Y were refs?
08:01:04*bung quit (Ping timeout: 252 seconds)
08:03:49FromDiscord<Varriount> (I know what they mean semantically, but behavior-wise I'm a bit fuzzy)
08:04:18FromDiscord<ElegantBeef> Well in the first case you can append fields onto the X, it just gets all of Y's, so without added fields it's like `X = distinct Y` afaik
08:06:02FromDiscord<ElegantBeef> Both being refs without added fields is pretty much just an alias afaik, except for methods i guess?
08:07:40FromDiscord<ElegantBeef> Ah it's weirder than i imagined and everything i said is wrong, smokebomb πŸ˜„
08:08:02*narimiran quit (Ping timeout: 252 seconds)
08:14:52Zevvalso using the `of` adds a header with run time type info before the struct
08:15:05Zevvobject
08:15:22FromDiscord<ElegantBeef> Ah someone that actually knows something
08:15:57Zevvlook at the C code for details
08:16:59FromDiscord<ElegantBeef> You cannot spell scary without C
08:17:04*bung joined #nim
08:19:58Zevvyou cant spell unimpressed without nim
08:21:36*bung quit (Ping timeout: 252 seconds)
08:26:55*SebastianM joined #nim
08:28:33FromDiscord<sealmove> Whats the state of nlvm?
08:37:31*bung joined #nim
08:41:59*bung quit (Ping timeout: 258 seconds)
08:57:49*bung joined #nim
09:02:18*bung quit (Ping timeout: 252 seconds)
09:07:51*oprypin quit (Quit: Bye)
09:17:23FromDiscord<Randall> Hey. I'm looking into the docgen code. Is there a reason why xhtml1 is generated, rather than html5?
09:20:22FromGitter<bung87> Related libs does not have multiple versions support
09:20:51FromDiscord<Randall> I noticed the same with htmlparser which doesn't actually parse html5 but rather xhtml
09:21:11FromDiscord<haxscramper> In reply to @รєคɭ๓๏שє "Whats the state of": I don't think it is actively developed, but from readme/occasional forum posts I could say it is pretty usably
09:21:30*ZoomZoomZoom joined #nim
09:21:31FromDiscord<haxscramper> (edit) "usably" => "usable"
09:22:00FromDiscord<haxscramper> But it is not a main focus now or in the future since we have C backend and LLVM does not seem to bring any immediate advantage
09:23:56FromDiscord<sealmove> Hmm, it doesn't?
09:25:15FromDiscord<ElegantBeef> Well it's a nice backend that enables cross platform and portable compilation, did i just describe C + gcc πŸ˜„
09:26:23FromDiscord<haxscramper> It also makes interop more complicated
09:35:05*SebastianM quit (Quit: -a- Bye Bye)
09:43:33FromDiscord<mlokis> i made compiler crash with this exit code: -1073741571, hmmmmmm
09:44:57FromDiscord<mlokis> i guess using `var T` as return value is unstable, i ll just use ptr
09:53:32FromDiscord<haxscramper> Using `var T` as return value is stable as long as you are not returning local variable
09:53:42*jcostabile[m|gr] joined #nim
09:53:48*jcostabile[m|gr] quit (Remote host closed the connection)
09:53:57FromDiscord<haxscramper> With if you do you would just get random segfaults if you switch to `ptr`
09:54:03FromDiscord<haxscramper> (edit) "With if" => "If"
09:56:02FromDiscord<exelotl> The compiler certainly shouldn't crash though, if you can find a minimal repro it would be good to file a bug report on the Nim repo
10:07:49*bung joined #nim
10:22:27*SebastianM joined #nim
10:23:34SebastianMHey guys, Could anyone point me to place where I can find how while is implemented? Thank you
10:25:27FromDiscord<demotomohiro> https://godbolt.org/↡You can see how Nim's while loop compiled to asm
10:25:36FromDiscord<haxscramper> you mean parse/semcheck/codegen?
10:26:09FromDiscord<haxscramper> and there are two really different codegen implementations - for VM (register-based opcodes) and for compilation (direct codegen in C)
10:28:09SebastianMi'm looking through files in nim distribution and can't find it...
10:28:31FromDiscord<haxscramper> which part specifically are interested in?
10:30:51SebastianMhexscramper: Just how does it look. is it a template or macro...
10:30:56FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/devel/compiler/ccgstmts.nim#L588↡https://github.com/nim-lang/Nim/blob/devel/compiler/parser.nim#L1586↡https://github.com/nim-lang/Nim/blob/devel/compiler/semstmts.nim#L85↡https://github.com/nim-lang/Nim/blob/devel/compiler/vmgen.nim#L325
10:31:09FromDiscord<haxscramper> oh, how does it work
10:31:22FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-while-statement
10:31:30FromDiscord<Varriount> In reply to @SebastianM "i'm looking through files": Do you want to know:↡ - How the compiler represents a while loop internally or↡ - How the compiler generates code for a while loop.
10:31:31FromDiscord<demotomohiro> while is not template or macro
10:31:50FromDiscord<haxscramper> there are no special interactions between `while` and `template/macro`
10:32:08FromDiscord<haxscramper> `while` in macro implementation works the same way as regular code too
10:32:25ForumUpdaterBotNew thread by Drkameleon: Change rune at given position, in Unicode string, see https://forum.nim-lang.org/t/8085
10:33:28FromDiscord<haxscramper> And it general it is not different from any language construct. For AST you can see https://nim-lang.org/docs/macros.html#statements-while-statement
10:40:24SebastianMhaxscramper, demotomohiro: Thank you for links and information.
10:41:09*SebastianM quit (Quit: -a- Bye Bye)
10:56:06*activecat[m|gr] joined #nim
10:56:11*activecat[m|gr] quit (Remote host closed the connection)
11:07:59*ppolo9914 joined #nim
11:08:25*ppolo9914 quit (Remote host closed the connection)
11:11:46FromDiscord<System64 ~ Flandre Scarlet> have functions that return a bool need a variable?↡For exemple, do I need to do↡var myFuncThatReturnABool() ?
11:11:53FromDiscord<System64 ~ Flandre Scarlet> (edit) "have functions that return a bool need a variable?↡For exemple, do I need to do↡var ... myFuncThatReturnABool()" added "a = "
11:14:03FromDiscord<haxscramper> Procedure return values must either be used or explicitly discarded via `discard` statement
11:14:29FromDiscord<haxscramper> E.g. `proc test(): SomeType` can be called as `discard test()` or `let a = test()`
11:18:00FromDiscord<Varriount> Or the routine can use the `discardable` pragma.
11:18:35*defusq joined #nim
11:19:13*defusq quit (Remote host closed the connection)
11:38:41FromDiscord<System64 ~ Flandre Scarlet> oh alright!
11:39:21FromDiscord<System64 ~ Flandre Scarlet> So discard = "I throw the output in the recycle bin" ?
11:42:08FromDiscord<kintrix> discard means you just do not care about a value \:P
11:42:18FromDiscord<kintrix> `discard 1` -> does nothing
11:42:33FromDiscord<kintrix> `discard "Hello World"` -> does nothing as well
11:42:54FromDiscord<kintrix> and if you call a procedure for its side-effects
11:43:03FromDiscord<kintrix> but do not want to store its return value
11:43:19FromDiscord<kintrix> you can just `discard procedureWithSideEffects()`
11:44:30FromDiscord<kintrix> so it literally just does nothing
11:44:33FromDiscord<kintrix> sent a code paste, see https://play.nim-lang.org/#ix=3oPe
11:50:16FromDiscord<System64 ~ Flandre Scarlet> And with Γ©cho Γ  ?
11:51:36*GNU\colossus joined #nim
11:51:39FromDiscord<haxscramper> `echo` itself does not have a return type, so you can't discard it
11:51:50FromDiscord<haxscramper> !eval discard echo "123"
11:51:51NimBotCompile failed: /usercode/in.nim(1, 14) Error: expression 'echo ["123"]' has no type (or is ambiguous)
11:52:06*GNU\colossus quit (Remote host closed the connection)
11:53:39FromDiscord<System64 ~ Flandre Scarlet> oh interesting
11:58:30*PMunch joined #nim
11:58:43ForumUpdaterBotNew thread by B3liever: Using Clang LibFuzzer coverage-guided fuzzing engine with Nim, see https://forum.nim-lang.org/t/8086
12:00:27*xet7 quit (Remote host closed the connection)
12:00:30*sundbry_ joined #nim
12:00:36*sundbry_ quit (Remote host closed the connection)
12:01:21*xet7 joined #nim
12:04:00*ZoomZoomZoom quit (Ping timeout: 258 seconds)
12:22:01*Duns_Scrotus24 joined #nim
12:22:06*arkurious joined #nim
12:22:07*Duns_Scrotus24 quit (Remote host closed the connection)
12:32:39*Guest94576 joined #nim
12:43:46*bung quit (Ping timeout: 252 seconds)
12:44:14*tane joined #nim
12:52:40FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=3oPu
12:52:54FromDiscord<KnorrFG> dtn.rect has x and y attribs
12:53:04FromDiscord<KnorrFG> (edit) "y" => "w"
12:58:57*Vladar joined #nim
12:59:44*bung joined #nim
13:01:24*Guest94576 left #nim (#nim)
13:04:31*bung quit (Ping timeout: 260 seconds)
13:05:00*bung joined #nim
13:09:15*ZoomZoomZoom joined #nim
13:14:59ForumUpdaterBotNew thread by Ingo: Proc in array, ...but is it the solution?, see https://forum.nim-lang.org/t/8087
13:25:26*narimiran joined #nim
13:27:34*ZoomZoomZoom quit (Ping timeout: 258 seconds)
13:29:14*myndzi4 joined #nim
13:29:46*myndzi4 quit (Remote host closed the connection)
13:46:05FromDiscord<dom96> Seems trojan searches are now leading people to our forum https://media.discordapp.net/attachments/371759389889003532/850732207672918016/unknown.png
13:47:45PMunchSeems like a lot of people are having issues with this..
13:51:38Zevvbad publicity is still publicity
13:52:13FromDiscord<Rika> we need to balance how much bad publicity we get otherwise we get fucked over by negative opinion
14:00:13PMunchCan we lock a topic to the top of the forum? If so maybe we should make a virus false-positive PSA there?
14:01:42*SebastianM joined #nim
14:07:17*narimiran quit (Quit: leaving)
14:13:12FromDiscord<System64 ~ Flandre Scarlet> 19MB of RAM used for a Tilengine demo? Isn't it a bit a lot? https://media.discordapp.net/attachments/371759389889003532/850739035454177280/unknown.png
14:19:42*SebastianM quit (Quit: SebastianM)
14:20:11*jpds_ joined #nim
14:20:18*jpds_ quit (Remote host closed the connection)
14:38:08FromDiscord<Anuke> Initializing a window & creating a rendering context uses up several MB regardless of which language you're using
14:38:13FromDiscord<Anuke> (edit) "Initializing a window & creating a rendering context uses up several MB ... regardless" added "of RAM"
14:41:29FromDiscord<Anuke> A completely empty C + GLFW window with no OpenGL functions loaded and no rendering uses 7mb by itself
14:41:54FromDiscord<System64 ~ Flandre Scarlet> ah alright so no worry
14:42:02FromDiscord<System64 ~ Flandre Scarlet> it's SDL's "fault" so
14:42:09FromDiscord<Rika> worry once you hit a few hundred πŸ˜›
14:43:41FromDiscord<System64 ~ Flandre Scarlet> Yeah lol, it will be hard
14:44:06FromDiscord<System64 ~ Flandre Scarlet> but I'm more worried about 2 things
14:44:34FromDiscord<Rika> ? which
14:44:48FromDiscord<System64 ~ Flandre Scarlet> when I call a C proc I have to put myVar.cint, is there a way to avoid puttinc cint? https://media.discordapp.net/attachments/371759389889003532/850746984113504276/unknown.png
14:46:19FromDiscord<haxscramper> you can write a wrapper that uses `int` argument
14:46:37FromDiscord<haxscramper> Additional layer of indirection on top of raw C bindings
14:47:12FromDiscord<haxscramper> You can also clean up names, remove `cint` return value etc.
14:47:27FromDiscord<System64 ~ Flandre Scarlet> that may cause problems no?
14:47:36FromDiscord<haxscramper> For example `proc setLayerPosition(a,b,c: int) = discard tLN_SetLayerPosition(a,b,c)`
14:47:44FromDiscord<haxscramper> In reply to @System64 "that may cause problems": What kind of problems?
14:48:02FromDiscord<System64 ~ Flandre Scarlet> when passed to the dll
14:48:48FromDiscord<haxscramper> I'm not sure if I follow. You just define helper proc with more convenient interface, that's all.
14:49:02FromDiscord<System64 ~ Flandre Scarlet> ah alright
14:49:49FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oPZ
14:52:12FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oQ1
14:53:01FromDiscord<haxscramper> Technically this is not different from wrapping procedure as `int` argument in the first place, but this might cause problems in edge cases anyway, because nim `int` is not guaranteed to be the same as C's `int`
14:53:07FromDiscord<haxscramper> `cint` does have this guarantee
14:53:28FromDiscord<haxscramper> Not that it really matters for the most case, but I do prefer to be explicit about what I wrap and how it is called
14:53:51FromDiscord<System64 ~ Flandre Scarlet> is there a way to auto transtype to cint ?
14:54:31FromDiscord<Rika> its not ideal
14:54:39FromDiscord<haxscramper> Yes, though I woudl advise aginst implicit type conversions. The distinction is there for a reason
14:54:40FromDiscord<Rika> you can, but its not recommended
14:54:58FromDiscord<System64 ~ Flandre Scarlet> okay so I won't do that so
14:55:16FromDiscord<System64 ~ Flandre Scarlet> and it's just a .cint thing, not a lot of work lol
14:55:34FromDiscord<Rika> ive never heard of it
14:55:34FromDiscord<Rika> sent a code paste, see https://paste.rs/Itx
14:55:41FromDiscord<haxscramper> I meant `inline`
14:55:46FromDiscord<Rika> lol
14:55:47FromDiscord<Rika> okay
14:56:03FromDiscord<System64 ~ Flandre Scarlet> and making it auto-discard if not saved in a variable?
14:56:26FromDiscord<Rika> not recommended either
14:56:36FromDiscord<kintrix> You can just remove `discard`, then↡And give it a return value
14:56:42FromDiscord<haxscramper> ideally I woudl check return codes and `raise` on invalid ones
14:56:57FromDiscord<haxscramper> Because we do have exceptions so
14:56:57FromDiscord<kintrix> In reply to @kintrix "You can just remove": oh wait...↡I misunderstood the question πŸ˜…
14:56:59FromDiscord<System64 ~ Flandre Scarlet> I just want auto-discard some procs that returns a bool
14:57:20FromDiscord<Rika> auto-discard is really not recommended ever
14:57:23FromDiscord<kintrix> yep
14:57:28FromDiscord<haxscramper> Again - they return `bool` for a reason, so you might not want to just discard everything
14:57:33FromDiscord<kintrix> discard is needed for a reason
14:57:55FromDiscord<haxscramper> Because you will be throwing again potential error indications that must not be ignored
14:58:18FromDiscord<haxscramper> it returns `0` for "ok" and `1` for "not ok"?
14:58:49FromDiscord<System64 ~ Flandre Scarlet> the thing is in a lot of programming language, some functions return true or false to say if it ran well or not, but often used for tests↡So I can use a bool function like a void funtion
14:59:18FromDiscord<haxscramper> It depends on the API
14:59:25FromDiscord<haxscramper> OF the particular library and particular function
15:00:01FromDiscord<System64 ~ Flandre Scarlet> That returns a bool but it's used as a void function in the C demo https://media.discordapp.net/attachments/371759389889003532/850750815311233035/unknown.png
15:00:51FromDiscord<Rika> then convert the "raw function" into a function that returns void but raises when the raw function returns false
15:01:02FromDiscord<Rika> convert -> create a wrapper for
15:01:15FromDiscord<haxscramper> https://github.com/megamarc/SuperMarioClone/blob/e36e54612c6075034c007350617cd185486ec458/Tilengine.cs#L978 C# wrappers seem to treat return value for this function as success code
15:01:25FromDiscord<haxscramper> Though documentation does not say much about it
15:01:38FromDiscord<haxscramper> sent a code paste, see https://paste.rs/E0E
15:02:20FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oQi
15:02:34FromDiscord<Rika> nim is not c
15:02:56FromDiscord<System64 ~ Flandre Scarlet> so I guess it's better to Discard manually
15:03:16FromDiscord<Rika> either discard manually or as ive said make a wrapper function that doesnt return anything but raises
15:03:17FromDiscord<haxscramper> no, the best way is to chec & raise in additional wrapper
15:04:03FromDiscord<System64 ~ Flandre Scarlet> what does raises means?
15:04:22FromDiscord<Rika> exception raising
15:04:24FromDiscord<kintrix> It's also called throwing an error
15:04:28FromDiscord<kintrix> in many languages
15:04:56FromDiscord<System64 ~ Flandre Scarlet> Aaah yeah exception
15:05:34*Galihom18 joined #nim
15:05:50*Galihom18 quit (Remote host closed the connection)
15:06:00FromDiscord<System64 ~ Flandre Scarlet> and how can I enable the GC please? Or is it enabled by default?
15:06:08FromDiscord<Rika> enabled by default
15:06:20FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oQt
15:06:40FromDiscord<haxscramper> So you can check `checkRet` on all your low-level C functions and they will be automatically wrapped in code check + exception raise
15:07:06FromDiscord<haxscramper> (edit) "https://play.nim-lang.org/#ix=3oQt" => "https://paste.rs/94e"
15:07:43FromDiscord<System64 ~ Flandre Scarlet> wow seems a bit complex
15:08:02FromDiscord<Rika> yes but you'll learn over time
15:09:57FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oQA
15:10:16FromDiscord<System64 ~ Flandre Scarlet> isn't it what I did?
15:10:23FromDiscord<haxscramper> (edit) "https://play.nim-lang.org/#ix=3oQA" => "https://play.nim-lang.org/#ix=3oQB"
15:10:38FromDiscord<haxscramper> no, I used `tlnProc("TLN_SetLayerPosition")` istead of `cdecl, importc:`
15:10:38FromDiscord<Rika> no
15:10:58FromDiscord<haxscramper> And it is supposed to do what you did + my example with `checkRet`, all in one go
15:13:52FromDiscord<System64 ~ Flandre Scarlet> Oh I see
15:14:21FromDiscord<System64 ~ Flandre Scarlet> and seems I don't need pointers to interact with this lib
15:15:30FromDiscord<System64 ~ Flandre Scarlet> I should try to wrap the GameMusicEmu lib too
15:19:03FromDiscord<Rainbow Asteroids> us there a way to test if something is in a subrange? `t in range[T]` doesn't work
15:19:21FromDiscord<Rika> wdym?
15:19:24FromDiscord<Rika> what is t?
15:19:33FromDiscord<Rika> if its a number you do `t in 0..3`?
15:19:56FromDiscord<haxscramper> in `low(range[T]) .. high(range[T])`
15:41:00FromDiscord<System64 ~ Flandre Scarlet> I have a problem, in my Tilengine.nim, I have an enum with the input keys, but I have an error there, but TLN_Input is declared https://media.discordapp.net/attachments/371759389889003532/850761128422408202/unknown.png
15:41:38FromDiscord<Rika> can you show the definition of TLN_Input
15:41:49FromDiscord<haxscramper> btw you don't have to write `tLN_Init`, `tlnInit` will work fine too
15:42:05FromDiscord<haxscramper> Due to nim style insensetivity
15:45:23FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850762229279752192/unknown.png
15:45:46FromDiscord<haxscramper> You need to export it, `TLN_Input`
15:47:10FromDiscord<Rika> same with the consts if you want
15:48:32FromDiscord<System64 ~ Flandre Scarlet> isn't the "" a pointer?
15:48:46FromDiscord<haxscramper> we are not in C
15:49:09FromDiscord<haxscramper> `` is a export marker - https://nim-lang.org/docs/manual.html#procedures-export-marker
15:51:15FromDiscord<System64 ~ Flandre Scarlet> Wow! The compiler yells a lot! https://media.discordapp.net/attachments/371759389889003532/850763706035732540/unknown.png
15:53:22FromDiscord<haxscramper> I'm not sure, but it might have something to do with wrapper procedures not being exported
15:55:00*bung quit (Quit: Lost terminal)
15:57:54FromDiscord<kintrix> sent a long message, see http://ix.io/3oQO
15:58:28FromDiscord<kintrix> (edit) "http://ix.io/3oQO" => "http://ix.io/3oQP"
15:58:28FromDiscord<System64 ~ Flandre Scarlet> but they're C errors no?
15:58:33FromDiscord<kintrix> nope
15:58:52FromDiscord<kintrix> if you are replying to me \:P↡Nope, they weren't C errors
15:59:02FromDiscord<System64 ~ Flandre Scarlet> No I reply to hax
15:59:11FromDiscord<kintrix> Oh, alright πŸ˜…
15:59:57FromDiscord<kintrix> In reply to @kintrix "so, this was mentioned": Should I rather ask this in #internals?
16:01:06FromDiscord<haxscramper> In reply to @System64 "but they're C errors": They are C errors about `typedef` `extern` of the nim procedures
16:01:48FromDiscord<haxscramper> In reply to @kintrix "so, this was mentioned": Do you have nim installed in your system correctly
16:03:02FromDiscord<haxscramper> And there is some weird magic going on with stdlib imports, so It might be expected
16:03:50FromDiscord<kintrix> In reply to @haxscramper "Do you have nim": I already have nim 1.4.8 installed
16:03:54FromDiscord<kintrix> and in the PATH
16:04:19*NinjaX21 joined #nim
16:04:27*NinjaX21 quit (Remote host closed the connection)
16:04:53FromDiscord<haxscramper> `PATH` has nothing to do with import paths. Can you compile `lib/pure/strutils.nim` on it's own?
16:06:00FromDiscord<kintrix> Yeah, I was just referring to that I have Nim correctly set up, and in the PATH, but it's not the same version as the one in the devel branch
16:06:30FromDiscord<kintrix> And yes, I can compile it on its own, it seems
16:06:34FromDiscord<kintrix> well
16:06:34FromDiscord<haxscramper> Then you need to specify `--path:` to refere to correct version of the stdlib
16:06:43FromDiscord<kintrix> if I add the `--path:".."`
16:06:48FromDiscord<kintrix> without it, it does not
16:07:28FromDiscord<haxscramper> Cloned nim installation has different stdlib (devel version), but `1.4.8` uses installed one, the errors
16:07:48FromDiscord<kintrix> Wait, no, I take it back, it compiles πŸ˜…
16:07:52FromDiscord<haxscramper> (edit) "" => "that is the reaso for"
16:08:17FromDiscord<kintrix> In reply to @haxscramper "Cloned nim installation has": Ah...
16:09:00FromDiscord<kintrix> I'll just add the newly compiled one to the PATH, and then it will use that, right?
16:10:21*Gustavo6046 quit (Ping timeout: 248 seconds)
16:11:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @haxscramper "They are C errors": How can I fix that please?
16:35:04*ZoomZoomZoom joined #nim
16:39:30*artmdl26 joined #nim
16:40:06*artmdl26 quit (Remote host closed the connection)
16:40:15*zimmedon joined #nim
16:40:38*zimmedon quit (Remote host closed the connection)
16:50:54*ZoomZoomZoom quit (Ping timeout: 252 seconds)
17:04:05FromDiscord<System64 ~ Flandre Scarlet> SOLVED!
17:06:41*stefantalpalaru_ joined #nim
17:08:08*stefantalpalaru quit (Ping timeout: 252 seconds)
17:12:14FromDiscord<haxscramper> What was the reason for the this error?
17:12:46*stefantalpalaru_ left #nim (#nim)
17:13:01FromDiscord<System64 ~ Flandre Scarlet> instead of ``.importc: "TLN_Input"`` I had to put ``.size: sizeof(cint).``
17:13:13*stefantalpalaru joined #nim
17:21:25FromDiscord<System64 ~ Flandre Scarlet> is there a main function on Nim?
17:21:49FromDiscord<Rainbow Asteroids> the file itself is the main function
17:21:55FromDiscord<Rainbow Asteroids> like in Python or JavaScript
17:23:10FromDiscord<Rainbow Asteroids> there is `when isMainModule` if you want to separate a file's public API and the code it runs
17:26:32FromDiscord<System64 ~ Flandre Scarlet> Oh I see so main = the file I compile so
17:41:45*xet7 quit (Remote host closed the connection)
17:44:20*xet7 joined #nim
18:03:52*Gustavo6046 joined #nim
18:08:21ForumUpdaterBotNew thread by Margin: NimVM eventually get replaced? , see https://forum.nim-lang.org/t/8088
18:22:14FromDiscord<haxscramper> How I can speed up removal of "Moderated" status for my nim forum account? I managed to re-register as @haxscramper , but after two days it is still "Moderated"
18:30:11*cde[m|gr] joined #nim
18:30:20*cde[m|gr] quit (Remote host closed the connection)
18:32:44*NeTvoyNeTvoy-t24 joined #nim
18:32:46*NeTvoyNeTvoy-t24 quit (Remote host closed the connection)
18:43:24*blaze-M joined #nim
18:44:00*blaze-M quit (Remote host closed the connection)
19:38:50FromDiscord<Unaimend> Does someone have a few nice examples on how to use fusion/matching with optionals in nim?
19:46:07FromDiscord<haxscramper> By optionals you mean `std/options.Option`?
19:53:01FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oS5
19:53:13FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oS6
19:53:29FromDiscord<haxscramper> `(b: opt @noneCapture2 or "default") := optFields` requires lastest fusion as my PR was merged only yesterday
20:04:44FromDiscord<System64 ~ Flandre Scarlet> is there a notion of static function?
20:07:25FromDiscord<ElegantBeef> I believe that'd just be a normal proc, depends on your definition of `static`
20:07:51FromDiscord<System64 ~ Flandre Scarlet> likes C
20:08:10FromDiscord<System64 ~ Flandre Scarlet> I don't even know what static means in C
20:08:50FromDiscord<ElegantBeef> > static function in C is a function that has a scope that is limited to its object file.↡So just an unexported procedure in Nim
20:10:35FromDiscord<hamidb80> is there any way to set cookie in `htttpclient` ?
20:10:41FromDiscord<hamidb80> (edit) "in" => "on"
20:11:35FromDiscord<hamidb80> btw do we have to set cookie manually or ...
20:11:53FromDiscord<hamidb80> (edit) "btw do we have to set cookie manually or ... ... " added "? πŸ˜•"
20:13:25*ZoomZoomZoom joined #nim
20:13:42*morci14 joined #nim
20:14:17*morci14 quit (Remote host closed the connection)
20:14:42*WhyNot-POR joined #nim
20:15:08*WhyNot-POR quit (Remote host closed the connection)
20:16:08FromDiscord<hamidb80> any idea?
20:21:59*Vladar quit (Quit: Leaving)
20:26:06*tane quit (Ping timeout: 260 seconds)
20:30:07FromDiscord<System64 ~ Flandre Scarlet> I try to set a callback but it doesn't work, why? https://media.discordapp.net/attachments/371759389889003532/850833883241906216/unknown.png
20:30:35FromDiscord<ElegantBeef> Your proc doesnt have `{.decl.}`
20:30:39FromDiscord<ElegantBeef> (edit) "`{.decl.}`" => "`{.cdecl.}`"
20:30:57FromDiscord<ElegantBeef> Also someone actually using `()` for "braces" πŸ˜„
20:30:59FromDiscord<Randall> Also looks like `int` vs `cint` ?
20:31:12FromDiscord<ElegantBeef> Yah that aswell
20:31:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Also someone actually using": I read Nim supports that so I do it lol
20:32:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Your proc doesnt have": You mean the raster proc?
20:33:08FromDiscord<ElegantBeef> yes
20:33:23FromDiscord<ElegantBeef> Read the error, type mismatch, it expects a `proc(cint){.cdecl.}`
20:33:31*leprechau7 joined #nim
20:33:31*leprechau7 quit (Remote host closed the connection)
20:34:27FromDiscord<System64 ~ Flandre Scarlet> It says invalid pragma https://media.discordapp.net/attachments/371759389889003532/850834978459746304/unknown.png
20:34:46FromDiscord<ElegantBeef> Cause you added it to the stmtlist and not the procedure `proc raster(lin: cint){.cdecl.}`
20:35:34FromDiscord<haxscramper> God, this formatting
20:36:24FromDiscord<ElegantBeef> Like i suggest you should remove `tln` from all procedures/type names to make your life easier
20:37:06FromDiscord<System64 ~ Flandre Scarlet> yeah I should do that
20:40:24FromDiscord<System64 ~ Flandre Scarlet> Nice! https://media.discordapp.net/attachments/371759389889003532/850836477658660874/unknown.png
20:52:35*Sembei joined #nim
21:08:26*siinamon left #nim ("Oops, I parted!")
21:27:39*Sembei quit (Quit: WeeChat 3.0)
21:29:40FromDiscord<Recruit_main707> Cool
21:40:52ForumUpdaterBotNew thread by Mantielero: UPlot - plotting library, see https://forum.nim-lang.org/t/8089
21:49:34FromDiscord<codic> how do I create and detach a thread in Nim?
21:51:29FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oSE
21:54:16FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oSF
21:54:59FromDiscord<codic> yeah
21:55:17*burn joined #nim
21:55:32*burn quit (Remote host closed the connection)
21:57:10FromDiscord<ElegantBeef> I believe threads are started detached if i understand what that does properly, so simply make a proc annotated with `{.thread.}` and do `creatThread` with it
22:12:48*FisHlaBsoMAN-t8 joined #nim
22:12:52*FisHlaBsoMAN-t8 quit (Remote host closed the connection)
22:17:45FromDiscord<codic> and after createThread do I have to do something special to detach it or should I consider it detached? (i.e. I never have to join it)
22:19:29FromDiscord<codic> oh I just read what you wrote
22:22:08FromDiscord<codic> what's the first parameter of createThread?
22:39:47FromDiscord<ElegantBeef> A generic `Thread[T]` where T is your thread proc's input parameter
22:39:52FromDiscord<ElegantBeef> (edit) "`Thread[T]`" => "`var Thread[T]`"
22:41:25FromDiscord<ElegantBeef> @codic https://nim-lang.org/docs/threads.html#examples does show the basics of using threads/locks
22:42:30FromDiscord<codic> looks to work
22:42:37FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3oSX
22:43:05*natinso| joined #nim
22:43:10FromDiscord<codic> yes perfec
22:43:11FromDiscord<codic> (edit) "yes" => "tyes"
22:43:13FromDiscord<codic> (edit) "tyes perfec" => "yes perfect"
22:43:20*natinso| quit (Remote host closed the connection)
22:44:28FromDiscord<codic> https://man7.org/linux/man-pages/man3/pthread_detach.3.html this is what i meant with detatch btw
22:45:52*Gustavo6046 quit (Ping timeout: 245 seconds)
22:47:35FromDiscord<ElegantBeef> Yea i'm uncertain if that's required πŸ˜„
22:48:00ForumUpdaterBotNew Nimble package! redismodules - A new awesome nimble package, see https://github.com/luisacosta828/redismodules
22:51:52FromDiscord<brainproxy> Just getting started with Nim macros, have implemented a couple successfully that really helped cut down on some boilerplate, fun stuff.↡↡I'm writing one currently that I want to use as a pragma, and I need it to support arguments, which of course pragmas can, but I'm wondering about default values for parameters. Is it possible somehow?
22:54:31PMunchShould be possible
22:54:37PMunchWorst case scenario you can create a template
22:55:28FromDiscord<ElegantBeef> Well it's not exactly possible to have default parameters afaik, since you probably want them to be static
22:56:16FromDiscord<ElegantBeef> Is how i handle parameters https://github.com/beef331/kashae/blob/master/src/kashae.nim#L204-L220
22:56:32FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3oT2
22:57:31FromDiscord<brainproxy> but interestingly, the passed `body` ends up being slightly different if you print with `treeRepr body` than if you use the `foo` that takes 3 arguments.
22:57:53FromDiscord<brainproxy> In reply to @ElegantBeef "Is how i handle": looking
22:57:54FromDiscord<ElegantBeef> I believe it gets typed in that case which is odd but what happens
23:00:06FromDiscord<brainproxy> so using your approach the "gets typed" doesn't happen?
23:02:09FromDiscord<ElegantBeef> If you're getting `sym`s yea it will not happen
23:06:22FromDiscord<System64 ~ Flandre Scarlet> Nim doesn't have the Double type?
23:06:27FromDiscord<ElegantBeef> float64
23:06:46FromDiscord<System64 ~ Flandre Scarlet> it's double?
23:06:59FromDiscord<ElegantBeef> It's 64 bits which is what most languages that have double call doubles
23:07:18FromDiscord<System64 ~ Flandre Scarlet> Oh I see
23:16:57FromDiscord<System64 ~ Flandre Scarlet> btw, is it possible to make a Nimble plugin?
23:20:25FromDiscord<ElegantBeef> plugin?
23:24:31FromDiscord<LuKol> In reply to @System64 "btw, is it possible": do you mean library which you include to your program?
23:25:36FromDiscord<System64 ~ Flandre Scarlet> yeah my Tilengine binding
23:26:10FromDiscord<ElegantBeef> Well you make a nimble package throw it on github and you're golden to just `requires "https://github.com/name/repo"`
23:26:49FromDiscord<System64 ~ Flandre Scarlet> Oh I see
23:27:18FromDiscord<System64 ~ Flandre Scarlet> I want to make a binding for GameMusicEmu too
23:29:06FromDiscord<ElegantBeef> Yea well you still havent finished the tilengine bindings imo πŸ˜›
23:29:27FromDiscord<System64 ~ Flandre Scarlet> yeah I have to cleanup the TLN_xxx thing
23:29:48FromDiscord<ElegantBeef> Remove that barbaric `tln` and add some helper functions for ints -> cints (or if lazy converters)
23:30:40*fputs quit (Remote host closed the connection)
23:31:20FromDiscord<ElegantBeef> I do have to ask, how'd you find nim, games from scratch?
23:31:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @ElegantBeef "I do have to": Yeah
23:34:06FromDiscord<ElegantBeef> Ah nice, now just if you stick around and write idiomatic code πŸ˜›
23:36:19FromDiscord<System64 ~ Flandre Scarlet> I didn't understood very well there
23:36:54FromDiscord<ElegantBeef> Joking about using `: void` and `()` for bracing logic
23:37:23FromDiscord<System64 ~ Flandre Scarlet> aaaah yeah lol↡I comes from the Java World lol
23:39:27FromDiscord<System64 ~ Flandre Scarlet> But aren't the TLN_ prefix supposed to indicate it comes from Tilengine?
23:39:46*fputs joined #nim
23:39:55FromDiscord<ElegantBeef> That's not a concern in Nim
23:40:15FromDiscord<LuKol> In reply to @ElegantBeef "I do have to": looking for alternative to python with compilation possibility
23:40:16FromDiscord<ElegantBeef> It doesnt care about where symbols come from just that they're imported πŸ˜„
23:41:09FromDiscord<ElegantBeef> It makes the UFCS much nicer without it
23:41:16FromDiscord<LuKol> only thing i cannot learn properly is whitespace instead of brackets
23:41:20FromDiscord<System64 ~ Flandre Scarlet> UFCS?
23:41:32FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
23:43:24FromDiscord<System64 ~ Flandre Scarlet> ah yeah so I can do Tilengine.aProc instead of Tilengine.TLN_aProc?
23:43:28FromDiscord<ElegantBeef> Yes
23:43:37FromDiscord<System64 ~ Flandre Scarlet> yeah seems it's much cleaner
23:43:38FromDiscord<ElegantBeef> But generally that's only used for ambigious calls
23:43:50FromDiscord<ElegantBeef> Normally you just do `aProc`
23:43:58FromDiscord<System64 ~ Flandre Scarlet> yeah with import
23:44:33FromDiscord<System64 ~ Flandre Scarlet> I dunno why, but VS Code doesn't display all possibilities
23:44:44FromDiscord<ElegantBeef> What do you mean "all possibillities"?
23:44:54FromDiscord<System64 ~ Flandre Scarlet> the autocompletion
23:47:33*fputs_ joined #nim
23:49:33*ZoomZoomZoom quit (Remote host closed the connection)
23:49:50*ZoomZoomZoom joined #nim
23:50:05*fputs quit (Ping timeout: 248 seconds)
23:57:24FromDiscord<System64 ~ Flandre Scarlet> the thing where you press TAB and it completes what you want to write
23:57:54FromDiscord<ElegantBeef> Yea i know what you mean, problem is probably just either nimsuggest being dumb or your project not being a proper one
23:58:33FromDiscord<System64 ~ Flandre Scarlet> the syntax is detected correctly
23:59:15*macinsight joined #nim
23:59:24*macinsight is now known as Guest89321
23:59:27FromDiscord<System64 ~ Flandre Scarlet> And Installed this https://media.discordapp.net/attachments/371759389889003532/850886565374066759/unknown.png
23:59:46*Guest89321 quit (Remote host closed the connection)
23:59:47FromDiscord<ElegantBeef> Try nimsaem's might be better
23:59:54FromDiscord<ElegantBeef> But it's probably just nimsuggest