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:39 | FromDiscord | <codic> why does nimble ignore nim.cfg and config.nims? |
00:13:33 | * | bung quit (Ping timeout: 248 seconds) |
00:17:29 | FromDiscord | <codic> like I want to compile my code with threads:on how do I tell nimble to do that? |
00:20:48 | FromDiscord | <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:45 | FromDiscord | <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:19 | FromDiscord | <ElegantBeef> Are you doing the same as you would from C? |
00:59:24 | * | nphg1 quit (Ping timeout: 252 seconds) |
00:59:38 | FromDiscord | <System64 ~ Flandre Scarlet> Normally yeah, I can send you my file if you want |
01:00:00 | FromDiscord | <ElegantBeef> As varriount mentioned would be best if it was on a git repo π |
01:00:14 | FromDiscord | <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:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "As varriount mentioned would": https://github.com/system64MC/NimTilengine |
01:16:02 | FromDiscord | <ElegantBeef> Gotta compile tile engine so give me second π |
01:17:43 | FromDiscord | <System64 ~ Flandre Scarlet> why compiling it? The dll is already there |
01:17:49 | FromDiscord | <ElegantBeef> Linux |
01:18:00 | FromDiscord | <System64 ~ Flandre Scarlet> Aaaah! Alright |
01:18:15 | FromDiscord | <System64 ~ Flandre Scarlet> I can send it if you want I think I have a Linux version |
01:19:30 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850544329779838996/libTilengine.so |
01:22:57 | FromDiscord | <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:47 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oMx |
01:27:54 | FromDiscord | <ElegantBeef> your pragma is before the return type |
01:31:22 | FromDiscord | <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:15 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oMy |
01:33:45 | FromDiscord | <ElegantBeef> Ah my present output π https://media.discordapp.net/attachments/371759389889003532/850547912692989972/unknown.png |
01:35:12 | FromDiscord | <codic> beautiful |
01:36:39 | FromDiscord | <System64 ~ Flandre Scarlet> So we have a problem no? |
01:36:48 | FromDiscord | <ElegantBeef> Yes the bindings arent identical it seems |
01:37:05 | FromDiscord | <System64 ~ Flandre Scarlet> ah, weird!β΅How can I fix that? |
01:37:41 | FromDiscord | <ElegantBeef> Well like `setLayer` doesnt have a nilable second parameter but in the example it does |
01:41:05 | FromDiscord | <ElegantBeef> `typedef struct Tileset TLN_Tileset;` Like this in the C, i dont get it, there is no Tileset type |
01:42:37 | FromDiscord | <System64 ~ Flandre Scarlet> Defined there https://media.discordapp.net/attachments/371759389889003532/850550144075694110/unknown.png |
01:42:48 | FromDiscord | <ElegantBeef> In the C |
01:43:16 | FromDiscord | <ElegantBeef> It's a `Tileset` which is a pointer to `Tileset` but `Tileset` isnt an existing type that i can see |
01:45:37 | FromDiscord | <System64 ~ Flandre Scarlet> ah weird |
01:46:11 | FromDiscord | <ElegantBeef> Is that just a ptr to an empty struct, seems so |
01:48:10 | FromDiscord | <System64 ~ Flandre Scarlet> WTFβ΅So what should I do? |
01:48:41 | FromDiscord | <ElegantBeef> I'm testing stuf now, i just turned all of those `type Name {.bycopy.} = object` into `type Name = ptr object` |
01:48:57 | FromDiscord | <System64 ~ Flandre Scarlet> alright |
01:50:05 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oMC |
01:50:22 | FromDiscord | <ElegantBeef> Yea it seems it's just an alias for a ptr to make it more readable |
01:50:44 | FromDiscord | <ElegantBeef> ehhhh https://media.discordapp.net/attachments/371759389889003532/850552181912633424/unknown.png |
01:52:47 | FromDiscord | <ElegantBeef> There you go, got a PR sitting at your doorstep |
01:55:25 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice!β΅what did you changed to be precise? |
01:55:40 | FromDiscord | <ElegantBeef> You have a PR |
01:55:54 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, I'll accept it |
01:56:00 | FromDiscord | <ElegantBeef> I mean https://github.com/system64MC/NimTilengine/pull/1/files |
01:56:04 | FromDiscord | <ElegantBeef> The diff is here |
01:56:33 | FromDiscord | <ElegantBeef> The important thing might be using `nil` instead of` ""` |
01:57:32 | FromDiscord | <ElegantBeef> Nvm it's the ptrs + using `""` instead of nil i guess |
01:58:05 | FromDiscord | <System64 ~ Flandre Scarlet> How can I accept a PR please? |
01:58:29 | FromDiscord | <ElegantBeef> Should say "Merge PR" or similar here https://github.com/system64MC/NimTilengine/pull/1 |
01:59:54 | FromDiscord | <System64 ~ Flandre Scarlet> I was disconnected, that's why I didn't find it, woops |
02:00:15 | FromDiscord | <System64 ~ Flandre Scarlet> Done! Thanks! |
02:00:22 | FromDiscord | <ElegantBeef> Now your goal is to remove all instances of `tln_` on names |
02:00:40 | FromDiscord | <ElegantBeef> This isnt C we dont need that shit π |
02:01:34 | FromDiscord | <System64 ~ Flandre Scarlet> WTF https://media.discordapp.net/attachments/371759389889003532/850554911594250270/unknown.png |
02:03:00 | FromDiscord | <ElegantBeef> Never seen that before |
02:05:03 | FromDiscord | <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:25 | FromDiscord | <System64 ~ Flandre Scarlet> That works! Nice! |
02:40:42 | * | lain quit (Quit: brb) |
02:43:50 | * | lain joined #nim |
02:47:18 | FromDiscord | <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:52 | FromDiscord | <codic> https://nim-lang.org/docs/os.html#envPairs.i might work |
02:48:06 | FromDiscord | <codic> but how do I do that with a cstringarray π€ |
02:48:14 | * | bung joined #nim |
02:49:41 | FromDiscord | <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:14 | FromGitter | <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:32 | FromGitter | <gogolxdong> recent nim failed to compile more often than before. |
04:17:58 | FromDiscord | <ElegantBeef> What's the code causing this error? |
04:18:56 | FromGitter | <gogolxdong> build_all.bat |
04:19:21 | FromGitter | <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:50 | FromDiscord | <codic> In reply to @ElegantBeef "join them into `key=value`": just char it looks like |
04:20:38 | FromDiscord | <Rainbow Asteroids> trying to build the compiler caused the error? |
04:21:32 | FromDiscord | <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:16 | ForumUpdaterBot | New 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:44 | FromDiscord | <Varriount> Araq: Will using mimalloc affect plans for "transferring" ownership of objects/refs between threads? |
06:09:46 | FromDiscord | <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:31 | FromDiscord | <Rainbow Asteroids> I was asking if the guy on gitter was having that issue because he was being vauge. |
06:10:43 | FromDiscord | <Rainbow Asteroids> The compiler compiles fine |
06:10:48 | FromDiscord | <Varriount> Oh, woops. Sorry, I misread |
06:10:49 | FromDiscord | <Rainbow Asteroids> (edit) "The compiler compiles fine ... " added "for me" |
06:13:48 | * | eddyb[legacy] joined #nim |
06:13:59 | FromDiscord | <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:35 | FromDiscord | <Rika> can you try echoing what pid's type is? |
06:16:39 | FromDiscord | <Rika> before the case |
06:16:45 | * | bomb-on joined #nim |
06:16:48 | FromDiscord | <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:08 | FromDiscord | <codic> found the issue, it thought that `pid` was a function pointer to posix.fork |
06:17:13 | FromDiscord | <codic> because `pid = posix.fork()` works |
06:17:19 | FromDiscord | <codic> and the cast was totally doing it wrong lol |
06:17:29 | FromDiscord | <codic> ufcs can bite you sometimes |
06:19:54 | FromDiscord | <ElegantBeef> Ufcs didnt do it, your usage of a qualified proc call did π |
06:21:20 | FromDiscord | <Rika> that was totally not UFCS's fault |
06:21:31 | FromDiscord | <codic> hmm |
06:21:36 | FromDiscord | <Rika> even if you did something similar in python it would do the same thing |
06:22:00 | FromDiscord | <ElegantBeef> well to be fair UFCS/command syntax does mean you can get a proc call without `()` |
06:22:07 | FromDiscord | <codic> in an ideal language for me that would error |
06:22:09 | FromDiscord | <Rika> only with an argument |
06:22:19 | FromDiscord | <Rika> no language with first-class functions would error |
06:22:29 | FromDiscord | <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:31 | FromDiscord | <codic> fair |
06:22:49 | FromDiscord | <Rika> that already disqualifies a whole bunch of languages so |
06:23:22 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNK |
06:23:39 | FromDiscord | <Rika> make a tempvar |
06:24:07 | FromDiscord | <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:21 | FromDiscord | <Varriount> In reply to @codic "https://nim-lang.org/docs/posix.html#Pid Pid is def": Ooo, making a shell? |
06:28:35 | FromDiscord | <codic> Playing around with writing an init system |
06:29:26 | FromDiscord | <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:29 | FromDiscord | <codic> interesting, thanks! |
06:30:50 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNO |
06:31:22 | FromDiscord | <ElegantBeef> `"we're in the parent"` phrasing |
06:31:34 | FromDiscord | <codic> lol |
06:31:43 | FromDiscord | <codic> `if were in parent: ` |
06:31:48 | FromDiscord | <Rika> "we're in child" |
06:31:59 | FromDiscord | <codic> `else if werein child` |
06:32:06 | FromDiscord | <codic> (edit) "werein" => "were in" |
06:32:59 | FromDiscord | <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:16 | FromDiscord | <Varriount> (edit) removed "(I think?)" |
06:33:37 | FromDiscord | <Varriount> I cleaned up the translation quite a bit though. With, you know, actual utility functions and such. |
06:37:33 | FromDiscord | <codic> interesting |
06:38:18 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNR |
06:38:58 | FromDiscord | <codic> oh, it only happens when I give it time to run |
06:39:08 | FromDiscord | <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:59 | FromDiscord | <codic> valid in arc? |
06:55:01 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oNX |
06:55:01 | FromDiscord | <codic> or is it cyclic? |
06:55:12 | FromDiscord | <Rika> you will be warned if it is |
06:55:23 | FromDiscord | <codic> (edit) "https://play.nim-lang.org/#ix=3oNX" => "https://play.nim-lang.org/#ix=3oNY" |
06:55:33 | FromDiscord | <Rika> and no i think it is not |
06:55:45 | FromDiscord | <Rika> since client is stack-based |
06:55:53 | FromDiscord | <codic> yep no warnings |
06:56:01 | FromDiscord | <codic> but if it is a ref object then I need to bring in `orc`? |
06:56:20 | FromDiscord | <Rika> you can mark it as acyclic if you know it is acyclkic |
06:59:24 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oO0 |
07:00:04 | FromDiscord | <Rika> cyclic means a Node that points to itself, or has something that points to itself |
07:00:12 | FromDiscord | <Rika> N1 -> N2 -> N1 is cyclic |
07:00:16 | FromDiscord | <Rika> a tree is not cyclic |
07:00:52 | FromDiscord | <Rika> ref types dont necessarily mean cycles |
07:00:59 | FromDiscord | <Rika> just a possibility to |
07:01:27 | FromDiscord | <Rika> (and its hard to detect it in some cases i believe) |
07:01:29 | FromDiscord | <Rika> which is why you can mark acyclic |
07:05:22 | FromDiscord | <ElegantBeef> Yea the compiler doesnt check to make sure it's cyclical, you have to know it's not |
07:07:13 | FromDiscord | <codic> got it |
07:37:07 | * | affix joined #nim |
07:37:37 | * | affix quit (Remote host closed the connection) |
07:59:45 | FromDiscord | <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:49 | FromDiscord | <Varriount> (I know what they mean semantically, but behavior-wise I'm a bit fuzzy) |
08:04:18 | FromDiscord | <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:02 | FromDiscord | <ElegantBeef> Both being refs without added fields is pretty much just an alias afaik, except for methods i guess? |
08:07:40 | FromDiscord | <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:52 | Zevv | also using the `of` adds a header with run time type info before the struct |
08:15:05 | Zevv | object |
08:15:22 | FromDiscord | <ElegantBeef> Ah someone that actually knows something |
08:15:57 | Zevv | look at the C code for details |
08:16:59 | FromDiscord | <ElegantBeef> You cannot spell scary without C |
08:17:04 | * | bung joined #nim |
08:19:58 | Zevv | you cant spell unimpressed without nim |
08:21:36 | * | bung quit (Ping timeout: 252 seconds) |
08:26:55 | * | SebastianM joined #nim |
08:28:33 | FromDiscord | <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:23 | FromDiscord | <Randall> Hey. I'm looking into the docgen code. Is there a reason why xhtml1 is generated, rather than html5? |
09:20:22 | FromGitter | <bung87> Related libs does not have multiple versions support |
09:20:51 | FromDiscord | <Randall> I noticed the same with htmlparser which doesn't actually parse html5 but rather xhtml |
09:21:11 | FromDiscord | <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:31 | FromDiscord | <haxscramper> (edit) "usably" => "usable" |
09:22:00 | FromDiscord | <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:56 | FromDiscord | <sealmove> Hmm, it doesn't? |
09:25:15 | FromDiscord | <ElegantBeef> Well it's a nice backend that enables cross platform and portable compilation, did i just describe C + gcc π |
09:26:23 | FromDiscord | <haxscramper> It also makes interop more complicated |
09:35:05 | * | SebastianM quit (Quit: -a- Bye Bye) |
09:43:33 | FromDiscord | <mlokis> i made compiler crash with this exit code: -1073741571, hmmmmmm |
09:44:57 | FromDiscord | <mlokis> i guess using `var T` as return value is unstable, i ll just use ptr |
09:53:32 | FromDiscord | <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:57 | FromDiscord | <haxscramper> With if you do you would just get random segfaults if you switch to `ptr` |
09:54:03 | FromDiscord | <haxscramper> (edit) "With if" => "If" |
09:56:02 | FromDiscord | <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:34 | SebastianM | Hey guys, Could anyone point me to place where I can find how while is implemented? Thank you |
10:25:27 | FromDiscord | <demotomohiro> https://godbolt.org/β΅You can see how Nim's while loop compiled to asm |
10:25:36 | FromDiscord | <haxscramper> you mean parse/semcheck/codegen? |
10:26:09 | FromDiscord | <haxscramper> and there are two really different codegen implementations - for VM (register-based opcodes) and for compilation (direct codegen in C) |
10:28:09 | SebastianM | i'm looking through files in nim distribution and can't find it... |
10:28:31 | FromDiscord | <haxscramper> which part specifically are interested in? |
10:30:51 | SebastianM | hexscramper: Just how does it look. is it a template or macro... |
10:30:56 | FromDiscord | <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:09 | FromDiscord | <haxscramper> oh, how does it work |
10:31:22 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-while-statement |
10:31:30 | FromDiscord | <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:31 | FromDiscord | <demotomohiro> while is not template or macro |
10:31:50 | FromDiscord | <haxscramper> there are no special interactions between `while` and `template/macro` |
10:32:08 | FromDiscord | <haxscramper> `while` in macro implementation works the same way as regular code too |
10:32:25 | ForumUpdaterBot | New thread by Drkameleon: Change rune at given position, in Unicode string, see https://forum.nim-lang.org/t/8085 |
10:33:28 | FromDiscord | <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:24 | SebastianM | haxscramper, 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:46 | FromDiscord | <System64 ~ Flandre Scarlet> have functions that return a bool need a variable?β΅For exemple, do I need to doβ΅var myFuncThatReturnABool() ? |
11:11:53 | FromDiscord | <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:03 | FromDiscord | <haxscramper> Procedure return values must either be used or explicitly discarded via `discard` statement |
11:14:29 | FromDiscord | <haxscramper> E.g. `proc test(): SomeType` can be called as `discard test()` or `let a = test()` |
11:18:00 | FromDiscord | <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:41 | FromDiscord | <System64 ~ Flandre Scarlet> oh alright! |
11:39:21 | FromDiscord | <System64 ~ Flandre Scarlet> So discard = "I throw the output in the recycle bin" ? |
11:42:08 | FromDiscord | <kintrix> discard means you just do not care about a value \:P |
11:42:18 | FromDiscord | <kintrix> `discard 1` -> does nothing |
11:42:33 | FromDiscord | <kintrix> `discard "Hello World"` -> does nothing as well |
11:42:54 | FromDiscord | <kintrix> and if you call a procedure for its side-effects |
11:43:03 | FromDiscord | <kintrix> but do not want to store its return value |
11:43:19 | FromDiscord | <kintrix> you can just `discard procedureWithSideEffects()` |
11:44:30 | FromDiscord | <kintrix> so it literally just does nothing |
11:44:33 | FromDiscord | <kintrix> sent a code paste, see https://play.nim-lang.org/#ix=3oPe |
11:50:16 | FromDiscord | <System64 ~ Flandre Scarlet> And with Γ©cho Γ ? |
11:51:36 | * | GNU\colossus joined #nim |
11:51:39 | FromDiscord | <haxscramper> `echo` itself does not have a return type, so you can't discard it |
11:51:50 | FromDiscord | <haxscramper> !eval discard echo "123" |
11:51:51 | NimBot | Compile 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:39 | FromDiscord | <System64 ~ Flandre Scarlet> oh interesting |
11:58:30 | * | PMunch joined #nim |
11:58:43 | ForumUpdaterBot | New 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:40 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=3oPu |
12:52:54 | FromDiscord | <KnorrFG> dtn.rect has x and y attribs |
12:53:04 | FromDiscord | <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:59 | ForumUpdaterBot | New 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:05 | FromDiscord | <dom96> Seems trojan searches are now leading people to our forum https://media.discordapp.net/attachments/371759389889003532/850732207672918016/unknown.png |
13:47:45 | PMunch | Seems like a lot of people are having issues with this.. |
13:51:38 | Zevv | bad publicity is still publicity |
13:52:13 | FromDiscord | <Rika> we need to balance how much bad publicity we get otherwise we get fucked over by negative opinion |
14:00:13 | PMunch | Can 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:12 | FromDiscord | <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:08 | FromDiscord | <Anuke> Initializing a window & creating a rendering context uses up several MB regardless of which language you're using |
14:38:13 | FromDiscord | <Anuke> (edit) "Initializing a window & creating a rendering context uses up several MB ... regardless" added "of RAM" |
14:41:29 | FromDiscord | <Anuke> A completely empty C + GLFW window with no OpenGL functions loaded and no rendering uses 7mb by itself |
14:41:54 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright so no worry |
14:42:02 | FromDiscord | <System64 ~ Flandre Scarlet> it's SDL's "fault" so |
14:42:09 | FromDiscord | <Rika> worry once you hit a few hundred π |
14:43:41 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah lol, it will be hard |
14:44:06 | FromDiscord | <System64 ~ Flandre Scarlet> but I'm more worried about 2 things |
14:44:34 | FromDiscord | <Rika> ? which |
14:44:48 | FromDiscord | <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:19 | FromDiscord | <haxscramper> you can write a wrapper that uses `int` argument |
14:46:37 | FromDiscord | <haxscramper> Additional layer of indirection on top of raw C bindings |
14:47:12 | FromDiscord | <haxscramper> You can also clean up names, remove `cint` return value etc. |
14:47:27 | FromDiscord | <System64 ~ Flandre Scarlet> that may cause problems no? |
14:47:36 | FromDiscord | <haxscramper> For example `proc setLayerPosition(a,b,c: int) = discard tLN_SetLayerPosition(a,b,c)` |
14:47:44 | FromDiscord | <haxscramper> In reply to @System64 "that may cause problems": What kind of problems? |
14:48:02 | FromDiscord | <System64 ~ Flandre Scarlet> when passed to the dll |
14:48:48 | FromDiscord | <haxscramper> I'm not sure if I follow. You just define helper proc with more convenient interface, that's all. |
14:49:02 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
14:49:49 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oPZ |
14:52:12 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oQ1 |
14:53:01 | FromDiscord | <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:07 | FromDiscord | <haxscramper> `cint` does have this guarantee |
14:53:28 | FromDiscord | <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:51 | FromDiscord | <System64 ~ Flandre Scarlet> is there a way to auto transtype to cint ? |
14:54:31 | FromDiscord | <Rika> its not ideal |
14:54:39 | FromDiscord | <haxscramper> Yes, though I woudl advise aginst implicit type conversions. The distinction is there for a reason |
14:54:40 | FromDiscord | <Rika> you can, but its not recommended |
14:54:58 | FromDiscord | <System64 ~ Flandre Scarlet> okay so I won't do that so |
14:55:16 | FromDiscord | <System64 ~ Flandre Scarlet> and it's just a .cint thing, not a lot of work lol |
14:55:34 | FromDiscord | <Rika> ive never heard of it |
14:55:34 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/Itx |
14:55:41 | FromDiscord | <haxscramper> I meant `inline` |
14:55:46 | FromDiscord | <Rika> lol |
14:55:47 | FromDiscord | <Rika> okay |
14:56:03 | FromDiscord | <System64 ~ Flandre Scarlet> and making it auto-discard if not saved in a variable? |
14:56:26 | FromDiscord | <Rika> not recommended either |
14:56:36 | FromDiscord | <kintrix> You can just remove `discard`, thenβ΅And give it a return value |
14:56:42 | FromDiscord | <haxscramper> ideally I woudl check return codes and `raise` on invalid ones |
14:56:57 | FromDiscord | <haxscramper> Because we do have exceptions so |
14:56:57 | FromDiscord | <kintrix> In reply to @kintrix "You can just remove": oh wait...β΅I misunderstood the question π
|
14:56:59 | FromDiscord | <System64 ~ Flandre Scarlet> I just want auto-discard some procs that returns a bool |
14:57:20 | FromDiscord | <Rika> auto-discard is really not recommended ever |
14:57:23 | FromDiscord | <kintrix> yep |
14:57:28 | FromDiscord | <haxscramper> Again - they return `bool` for a reason, so you might not want to just discard everything |
14:57:33 | FromDiscord | <kintrix> discard is needed for a reason |
14:57:55 | FromDiscord | <haxscramper> Because you will be throwing again potential error indications that must not be ignored |
14:58:18 | FromDiscord | <haxscramper> it returns `0` for "ok" and `1` for "not ok"? |
14:58:49 | FromDiscord | <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:18 | FromDiscord | <haxscramper> It depends on the API |
14:59:25 | FromDiscord | <haxscramper> OF the particular library and particular function |
15:00:01 | FromDiscord | <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:51 | FromDiscord | <Rika> then convert the "raw function" into a function that returns void but raises when the raw function returns false |
15:01:02 | FromDiscord | <Rika> convert -> create a wrapper for |
15:01:15 | FromDiscord | <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:25 | FromDiscord | <haxscramper> Though documentation does not say much about it |
15:01:38 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/E0E |
15:02:20 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oQi |
15:02:34 | FromDiscord | <Rika> nim is not c |
15:02:56 | FromDiscord | <System64 ~ Flandre Scarlet> so I guess it's better to Discard manually |
15:03:16 | FromDiscord | <Rika> either discard manually or as ive said make a wrapper function that doesnt return anything but raises |
15:03:17 | FromDiscord | <haxscramper> no, the best way is to chec & raise in additional wrapper |
15:04:03 | FromDiscord | <System64 ~ Flandre Scarlet> what does raises means? |
15:04:22 | FromDiscord | <Rika> exception raising |
15:04:24 | FromDiscord | <kintrix> It's also called throwing an error |
15:04:28 | FromDiscord | <kintrix> in many languages |
15:04:56 | FromDiscord | <System64 ~ Flandre Scarlet> Aaah yeah exception |
15:05:34 | * | Galihom18 joined #nim |
15:05:50 | * | Galihom18 quit (Remote host closed the connection) |
15:06:00 | FromDiscord | <System64 ~ Flandre Scarlet> and how can I enable the GC please? Or is it enabled by default? |
15:06:08 | FromDiscord | <Rika> enabled by default |
15:06:20 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oQt |
15:06:40 | FromDiscord | <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:06 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3oQt" => "https://paste.rs/94e" |
15:07:43 | FromDiscord | <System64 ~ Flandre Scarlet> wow seems a bit complex |
15:08:02 | FromDiscord | <Rika> yes but you'll learn over time |
15:09:57 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oQA |
15:10:16 | FromDiscord | <System64 ~ Flandre Scarlet> isn't it what I did? |
15:10:23 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3oQA" => "https://play.nim-lang.org/#ix=3oQB" |
15:10:38 | FromDiscord | <haxscramper> no, I used `tlnProc("TLN_SetLayerPosition")` istead of `cdecl, importc:` |
15:10:38 | FromDiscord | <Rika> no |
15:10:58 | FromDiscord | <haxscramper> And it is supposed to do what you did + my example with `checkRet`, all in one go |
15:13:52 | FromDiscord | <System64 ~ Flandre Scarlet> Oh I see |
15:14:21 | FromDiscord | <System64 ~ Flandre Scarlet> and seems I don't need pointers to interact with this lib |
15:15:30 | FromDiscord | <System64 ~ Flandre Scarlet> I should try to wrap the GameMusicEmu lib too |
15:19:03 | FromDiscord | <Rainbow Asteroids> us there a way to test if something is in a subrange? `t in range[T]` doesn't work |
15:19:21 | FromDiscord | <Rika> wdym? |
15:19:24 | FromDiscord | <Rika> what is t? |
15:19:33 | FromDiscord | <Rika> if its a number you do `t in 0..3`? |
15:19:56 | FromDiscord | <haxscramper> in `low(range[T]) .. high(range[T])` |
15:41:00 | FromDiscord | <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:38 | FromDiscord | <Rika> can you show the definition of TLN_Input |
15:41:49 | FromDiscord | <haxscramper> btw you don't have to write `tLN_Init`, `tlnInit` will work fine too |
15:42:05 | FromDiscord | <haxscramper> Due to nim style insensetivity |
15:45:23 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/850762229279752192/unknown.png |
15:45:46 | FromDiscord | <haxscramper> You need to export it, `TLN_Input` |
15:47:10 | FromDiscord | <Rika> same with the consts if you want |
15:48:32 | FromDiscord | <System64 ~ Flandre Scarlet> isn't the "" a pointer? |
15:48:46 | FromDiscord | <haxscramper> we are not in C |
15:49:09 | FromDiscord | <haxscramper> `` is a export marker - https://nim-lang.org/docs/manual.html#procedures-export-marker |
15:51:15 | FromDiscord | <System64 ~ Flandre Scarlet> Wow! The compiler yells a lot! https://media.discordapp.net/attachments/371759389889003532/850763706035732540/unknown.png |
15:53:22 | FromDiscord | <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:54 | FromDiscord | <kintrix> sent a long message, see http://ix.io/3oQO |
15:58:28 | FromDiscord | <kintrix> (edit) "http://ix.io/3oQO" => "http://ix.io/3oQP" |
15:58:28 | FromDiscord | <System64 ~ Flandre Scarlet> but they're C errors no? |
15:58:33 | FromDiscord | <kintrix> nope |
15:58:52 | FromDiscord | <kintrix> if you are replying to me \:Pβ΅Nope, they weren't C errors |
15:59:02 | FromDiscord | <System64 ~ Flandre Scarlet> No I reply to hax |
15:59:11 | FromDiscord | <kintrix> Oh, alright π
|
15:59:57 | FromDiscord | <kintrix> In reply to @kintrix "so, this was mentioned": Should I rather ask this in #internals? |
16:01:06 | FromDiscord | <haxscramper> In reply to @System64 "but they're C errors": They are C errors about `typedef` `extern` of the nim procedures |
16:01:48 | FromDiscord | <haxscramper> In reply to @kintrix "so, this was mentioned": Do you have nim installed in your system correctly |
16:03:02 | FromDiscord | <haxscramper> And there is some weird magic going on with stdlib imports, so It might be expected |
16:03:50 | FromDiscord | <kintrix> In reply to @haxscramper "Do you have nim": I already have nim 1.4.8 installed |
16:03:54 | FromDiscord | <kintrix> and in the PATH |
16:04:19 | * | NinjaX21 joined #nim |
16:04:27 | * | NinjaX21 quit (Remote host closed the connection) |
16:04:53 | FromDiscord | <haxscramper> `PATH` has nothing to do with import paths. Can you compile `lib/pure/strutils.nim` on it's own? |
16:06:00 | FromDiscord | <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:30 | FromDiscord | <kintrix> And yes, I can compile it on its own, it seems |
16:06:34 | FromDiscord | <kintrix> well |
16:06:34 | FromDiscord | <haxscramper> Then you need to specify `--path:` to refere to correct version of the stdlib |
16:06:43 | FromDiscord | <kintrix> if I add the `--path:".."` |
16:06:48 | FromDiscord | <kintrix> without it, it does not |
16:07:28 | FromDiscord | <haxscramper> Cloned nim installation has different stdlib (devel version), but `1.4.8` uses installed one, the errors |
16:07:48 | FromDiscord | <kintrix> Wait, no, I take it back, it compiles π
|
16:07:52 | FromDiscord | <haxscramper> (edit) "" => "that is the reaso for" |
16:08:17 | FromDiscord | <kintrix> In reply to @haxscramper "Cloned nim installation has": Ah... |
16:09:00 | FromDiscord | <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:17 | FromDiscord | <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:05 | FromDiscord | <System64 ~ Flandre Scarlet> SOLVED! |
17:06:41 | * | stefantalpalaru_ joined #nim |
17:08:08 | * | stefantalpalaru quit (Ping timeout: 252 seconds) |
17:12:14 | FromDiscord | <haxscramper> What was the reason for the this error? |
17:12:46 | * | stefantalpalaru_ left #nim (#nim) |
17:13:01 | FromDiscord | <System64 ~ Flandre Scarlet> instead of ``.importc: "TLN_Input"`` I had to put ``.size: sizeof(cint).`` |
17:13:13 | * | stefantalpalaru joined #nim |
17:21:25 | FromDiscord | <System64 ~ Flandre Scarlet> is there a main function on Nim? |
17:21:49 | FromDiscord | <Rainbow Asteroids> the file itself is the main function |
17:21:55 | FromDiscord | <Rainbow Asteroids> like in Python or JavaScript |
17:23:10 | FromDiscord | <Rainbow Asteroids> there is `when isMainModule` if you want to separate a file's public API and the code it runs |
17:26:32 | FromDiscord | <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:21 | ForumUpdaterBot | New thread by Margin: NimVM eventually get replaced? , see https://forum.nim-lang.org/t/8088 |
18:22:14 | FromDiscord | <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:50 | FromDiscord | <Unaimend> Does someone have a few nice examples on how to use fusion/matching with optionals in nim? |
19:46:07 | FromDiscord | <haxscramper> By optionals you mean `std/options.Option`? |
19:53:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oS5 |
19:53:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3oS6 |
19:53:29 | FromDiscord | <haxscramper> `(b: opt @noneCapture2 or "default") := optFields` requires lastest fusion as my PR was merged only yesterday |
20:04:44 | FromDiscord | <System64 ~ Flandre Scarlet> is there a notion of static function? |
20:07:25 | FromDiscord | <ElegantBeef> I believe that'd just be a normal proc, depends on your definition of `static` |
20:07:51 | FromDiscord | <System64 ~ Flandre Scarlet> likes C |
20:08:10 | FromDiscord | <System64 ~ Flandre Scarlet> I don't even know what static means in C |
20:08:50 | FromDiscord | <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:35 | FromDiscord | <hamidb80> is there any way to set cookie in `htttpclient` ? |
20:10:41 | FromDiscord | <hamidb80> (edit) "in" => "on" |
20:11:35 | FromDiscord | <hamidb80> btw do we have to set cookie manually or ... |
20:11:53 | FromDiscord | <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:08 | FromDiscord | <hamidb80> any idea? |
20:21:59 | * | Vladar quit (Quit: Leaving) |
20:26:06 | * | tane quit (Ping timeout: 260 seconds) |
20:30:07 | FromDiscord | <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:35 | FromDiscord | <ElegantBeef> Your proc doesnt have `{.decl.}` |
20:30:39 | FromDiscord | <ElegantBeef> (edit) "`{.decl.}`" => "`{.cdecl.}`" |
20:30:57 | FromDiscord | <ElegantBeef> Also someone actually using `()` for "braces" π |
20:30:59 | FromDiscord | <Randall> Also looks like `int` vs `cint` ? |
20:31:12 | FromDiscord | <ElegantBeef> Yah that aswell |
20:31:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Also someone actually using": I read Nim supports that so I do it lol |
20:32:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "Your proc doesnt have": You mean the raster proc? |
20:33:08 | FromDiscord | <ElegantBeef> yes |
20:33:23 | FromDiscord | <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:27 | FromDiscord | <System64 ~ Flandre Scarlet> It says invalid pragma https://media.discordapp.net/attachments/371759389889003532/850834978459746304/unknown.png |
20:34:46 | FromDiscord | <ElegantBeef> Cause you added it to the stmtlist and not the procedure `proc raster(lin: cint){.cdecl.}` |
20:35:34 | FromDiscord | <haxscramper> God, this formatting |
20:36:24 | FromDiscord | <ElegantBeef> Like i suggest you should remove `tln` from all procedures/type names to make your life easier |
20:37:06 | FromDiscord | <System64 ~ Flandre Scarlet> yeah I should do that |
20:40:24 | FromDiscord | <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:40 | FromDiscord | <Recruit_main707> Cool |
21:40:52 | ForumUpdaterBot | New thread by Mantielero: UPlot - plotting library, see https://forum.nim-lang.org/t/8089 |
21:49:34 | FromDiscord | <codic> how do I create and detach a thread in Nim? |
21:51:29 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oSE |
21:54:16 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3oSF |
21:54:59 | FromDiscord | <codic> yeah |
21:55:17 | * | burn joined #nim |
21:55:32 | * | burn quit (Remote host closed the connection) |
21:57:10 | FromDiscord | <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:45 | FromDiscord | <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:29 | FromDiscord | <codic> oh I just read what you wrote |
22:22:08 | FromDiscord | <codic> what's the first parameter of createThread? |
22:39:47 | FromDiscord | <ElegantBeef> A generic `Thread[T]` where T is your thread proc's input parameter |
22:39:52 | FromDiscord | <ElegantBeef> (edit) "`Thread[T]`" => "`var Thread[T]`" |
22:41:25 | FromDiscord | <ElegantBeef> @codic https://nim-lang.org/docs/threads.html#examples does show the basics of using threads/locks |
22:42:30 | FromDiscord | <codic> looks to work |
22:42:37 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3oSX |
22:43:05 | * | natinso| joined #nim |
22:43:10 | FromDiscord | <codic> yes perfec |
22:43:11 | FromDiscord | <codic> (edit) "yes" => "tyes" |
22:43:13 | FromDiscord | <codic> (edit) "tyes perfec" => "yes perfect" |
22:43:20 | * | natinso| quit (Remote host closed the connection) |
22:44:28 | FromDiscord | <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:35 | FromDiscord | <ElegantBeef> Yea i'm uncertain if that's required π |
22:48:00 | ForumUpdaterBot | New Nimble package! redismodules - A new awesome nimble package, see https://github.com/luisacosta828/redismodules |
22:51:52 | FromDiscord | <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:31 | PMunch | Should be possible |
22:54:37 | PMunch | Worst case scenario you can create a template |
22:55:28 | FromDiscord | <ElegantBeef> Well it's not exactly possible to have default parameters afaik, since you probably want them to be static |
22:56:16 | FromDiscord | <ElegantBeef> Is how i handle parameters https://github.com/beef331/kashae/blob/master/src/kashae.nim#L204-L220 |
22:56:32 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3oT2 |
22:57:31 | FromDiscord | <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:53 | FromDiscord | <brainproxy> In reply to @ElegantBeef "Is how i handle": looking |
22:57:54 | FromDiscord | <ElegantBeef> I believe it gets typed in that case which is odd but what happens |
23:00:06 | FromDiscord | <brainproxy> so using your approach the "gets typed" doesn't happen? |
23:02:09 | FromDiscord | <ElegantBeef> If you're getting `sym`s yea it will not happen |
23:06:22 | FromDiscord | <System64 ~ Flandre Scarlet> Nim doesn't have the Double type? |
23:06:27 | FromDiscord | <ElegantBeef> float64 |
23:06:46 | FromDiscord | <System64 ~ Flandre Scarlet> it's double? |
23:06:59 | FromDiscord | <ElegantBeef> It's 64 bits which is what most languages that have double call doubles |
23:07:18 | FromDiscord | <System64 ~ Flandre Scarlet> Oh I see |
23:16:57 | FromDiscord | <System64 ~ Flandre Scarlet> btw, is it possible to make a Nimble plugin? |
23:20:25 | FromDiscord | <ElegantBeef> plugin? |
23:24:31 | FromDiscord | <LuKol> In reply to @System64 "btw, is it possible": do you mean library which you include to your program? |
23:25:36 | FromDiscord | <System64 ~ Flandre Scarlet> yeah my Tilengine binding |
23:26:10 | FromDiscord | <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:49 | FromDiscord | <System64 ~ Flandre Scarlet> Oh I see |
23:27:18 | FromDiscord | <System64 ~ Flandre Scarlet> I want to make a binding for GameMusicEmu too |
23:29:06 | FromDiscord | <ElegantBeef> Yea well you still havent finished the tilengine bindings imo π |
23:29:27 | FromDiscord | <System64 ~ Flandre Scarlet> yeah I have to cleanup the TLN_xxx thing |
23:29:48 | FromDiscord | <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:20 | FromDiscord | <ElegantBeef> I do have to ask, how'd you find nim, games from scratch? |
23:31:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @ElegantBeef "I do have to": Yeah |
23:34:06 | FromDiscord | <ElegantBeef> Ah nice, now just if you stick around and write idiomatic code π |
23:36:19 | FromDiscord | <System64 ~ Flandre Scarlet> I didn't understood very well there |
23:36:54 | FromDiscord | <ElegantBeef> Joking about using `: void` and `()` for bracing logic |
23:37:23 | FromDiscord | <System64 ~ Flandre Scarlet> aaaah yeah lolβ΅I comes from the Java World lol |
23:39:27 | FromDiscord | <System64 ~ Flandre Scarlet> But aren't the TLN_ prefix supposed to indicate it comes from Tilengine? |
23:39:46 | * | fputs joined #nim |
23:39:55 | FromDiscord | <ElegantBeef> That's not a concern in Nim |
23:40:15 | FromDiscord | <LuKol> In reply to @ElegantBeef "I do have to": looking for alternative to python with compilation possibility |
23:40:16 | FromDiscord | <ElegantBeef> It doesnt care about where symbols come from just that they're imported π |
23:41:09 | FromDiscord | <ElegantBeef> It makes the UFCS much nicer without it |
23:41:16 | FromDiscord | <LuKol> only thing i cannot learn properly is whitespace instead of brackets |
23:41:20 | FromDiscord | <System64 ~ Flandre Scarlet> UFCS? |
23:41:32 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
23:43:24 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah so I can do Tilengine.aProc instead of Tilengine.TLN_aProc? |
23:43:28 | FromDiscord | <ElegantBeef> Yes |
23:43:37 | FromDiscord | <System64 ~ Flandre Scarlet> yeah seems it's much cleaner |
23:43:38 | FromDiscord | <ElegantBeef> But generally that's only used for ambigious calls |
23:43:50 | FromDiscord | <ElegantBeef> Normally you just do `aProc` |
23:43:58 | FromDiscord | <System64 ~ Flandre Scarlet> yeah with import |
23:44:33 | FromDiscord | <System64 ~ Flandre Scarlet> I dunno why, but VS Code doesn't display all possibilities |
23:44:44 | FromDiscord | <ElegantBeef> What do you mean "all possibillities"? |
23:44:54 | FromDiscord | <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:24 | FromDiscord | <System64 ~ Flandre Scarlet> the thing where you press TAB and it completes what you want to write |
23:57:54 | FromDiscord | <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:33 | FromDiscord | <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:27 | FromDiscord | <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:47 | FromDiscord | <ElegantBeef> Try nimsaem's might be better |
23:59:54 | FromDiscord | <ElegantBeef> But it's probably just nimsuggest |