00:13:27 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:13:47 | * | njoseph joined #nim |
00:33:57 | FromDiscord | <treeform> Oh sorry you are using benchy with a bug, please update |
00:34:18 | FromDiscord | <treeform> Benchy code gets optimized away in this version |
00:35:11 | FromDiscord | <ElegantBeef> Ah yea that better |
00:36:53 | FromDiscord | <treeform> I forgot to try lto |
00:37:09 | FromDiscord | <treeform> I'll try it when I get back |
00:37:19 | FromDiscord | <ElegantBeef> `.xyz` is around 1.5 times faster and `[]=` is about .4ms faster |
00:37:42 | FromDiscord | <treeform> Ok |
00:37:51 | FromDiscord | <ElegantBeef> So yea arr is still slower |
00:38:07 | FromDiscord | <treeform> But obj.arr is not |
00:38:26 | FromDiscord | <treeform> Why having array wrapped in an object makes it faster? |
00:38:51 | FromDiscord | <ElegantBeef> time to comment out alll the tests and profile that single case |
00:39:07 | FromDiscord | <treeform> Should nim always wrap array in structs? |
00:40:27 | FromDiscord | <treeform> Post you runtimes |
00:40:28 | FromDiscord | <ElegantBeef> I dont see how it's any different since it's still allocated the same, or atleast should be |
00:40:38 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/841112458515972146/unknown.png |
00:41:27 | FromDiscord | <treeform> On mine the objarr is always faster |
00:41:32 | FromDiscord | <treeform> Or the same |
00:42:17 | FromDiscord | <ElegantBeef> I assume in some cases the casts i do are more easily optimized so some are better |
00:49:33 | FromDiscord | <ElegantBeef> So just found a weird behaviour doing all 4 tests in a single file results in it taking 8 ms, doing it alone results in 1.2ms |
00:51:24 | FromDiscord | <ElegantBeef> Seems that is actually mostly to do with the gc |
00:55:26 | * | oddp quit (Quit: Quit) |
00:55:54 | FromDiscord | <ElegantBeef> And now i'm hitting ` stack smashing detected : terminated` |
01:35:04 | FromDiscord | <treeform> Oh |
01:35:17 | FromDiscord | <treeform> I did not try separate files |
01:39:13 | FromDiscord | <ElegantBeef> Oh i didnt use seperate files i was talking about in order |
01:39:36 | FromDiscord | <ElegantBeef> Like test 1 had 4 go, test 2 had only 1 |
01:39:59 | FromDiscord | <ElegantBeef> When ran all together they're consistent but doing the slow ones alone seems to be different |
01:51:54 | * | Tanger joined #nim |
02:03:30 | * | vicfred_ joined #nim |
02:05:51 | * | vicfred quit (Ping timeout: 252 seconds) |
02:09:09 | * | wasted_youth2 quit (Ping timeout: 245 seconds) |
02:09:52 | * | vicfred_ quit (Quit: Leaving) |
02:10:47 | * | wasted_youth2 joined #nim |
03:00:57 | * | thomasross quit (Ping timeout: 260 seconds) |
03:04:01 | * | krux02 quit (Remote host closed the connection) |
03:28:42 | ForumUpdaterBot | New thread by Halloleo: How to catch DOM exception in Nim code?, see https://forum.nim-lang.org/t/7958 |
03:46:58 | * | NimBot joined #nim |
04:49:46 | * | letto quit (Quit: Konversation terminated!) |
04:50:26 | * | letto joined #nim |
05:08:07 | * | vicfred joined #nim |
05:12:54 | * | narimiran joined #nim |
05:33:32 | * | a_chou joined #nim |
05:33:35 | * | a_chou quit (Remote host closed the connection) |
05:41:34 | * | nekits07 quit (Ping timeout: 268 seconds) |
06:13:01 | ForumUpdaterBot | New thread by Pietroppeter: Visualizing Garbage Collector Algorithms (2014), see https://forum.nim-lang.org/t/7959 |
06:18:20 | * | voltist quit (Quit: The Lounge - https://thelounge.chat) |
06:21:24 | * | voltist joined #nim |
06:27:21 | ForumUpdaterBot | New Nimble package! owoifynim - Turning your worst nightmare into a Nim package. This is a Nim port of mohan-cao's owoify-js, which will help you turn any string into nonsensical babyspeak similar to LeafySweet's infamous Chrome extension., see https://github.com/deadshot465/owoifynim |
06:47:06 | ForumUpdaterBot | New thread by Halloleo: Can I create a string stream from its own data?, see https://forum.nim-lang.org/t/7960 |
07:00:53 | * | PMunch joined #nim |
07:23:35 | * | wasted_youth2 quit (Quit: Leaving) |
07:34:45 | FromDiscord | <Nisha's alt> Is it possible to compile a Nim file/project with a default pragma? |
07:35:04 | FromDiscord | <Nisha's alt> So for example, adding `{.exportc.}` to everything for use in C |
07:35:09 | FromDiscord | <Nisha's alt> Probably not lol |
07:35:59 | FromDiscord | <ElegantBeef> you can make a file that is just `{.push exportc.}` then do `--include:exporter.nim` |
07:36:06 | FromDiscord | <ElegantBeef> but no clue if that'll work propeprly |
07:36:08 | FromDiscord | <ElegantBeef> (edit) "propeprly" => "properly" |
07:38:05 | FromDiscord | <Nisha's alt> Oh okay |
07:38:21 | FromDiscord | <Nisha's alt> Is there also a way to use Nim types in C? :P |
07:39:13 | FromDiscord | <Nisha's alt> And my final question is!- How do i compile an entire Nim project to a .so file or a .h file if it'd possible :p |
07:39:30 | FromDiscord | <Nisha's alt> (Nim types as in stuff like Int, or Str) |
07:39:31 | FromDiscord | <haxscramper> Depends on what you mean by "use in C". nim compiles to C, so you can use everything, technically |
07:40:10 | FromDiscord | <Nisha's alt> Well, i wanna use the Nim string type in C (mainly being able to access and be able to read the value) |
07:40:26 | FromDiscord | <Nisha's alt> And using cstring isn't an option here |
07:42:36 | FromDiscord | <haxscramper> In reply to @Hitoshi Shinsou|π»β "And my final question": https://github.com/haxscramper/hack/blob/master/testing/nim/c_interop/nim_clib/build.sh to header file and compile C app with this library |
07:42:43 | FromDiscord | <DumbMahreeo> In reply to @DumbMahreeo "Yes, sorry for not": @Rika how did you achieve that? |
07:43:41 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mmW |
07:43:41 | FromDiscord | <haxscramper> I think |
07:43:53 | FromDiscord | <haxscramper> But it is different for new runtime etc., |
07:44:33 | FromDiscord | <haxscramper> So you can't really work with it, unless you are willing to wrap everything in some sort of macro metaprogramming to check for which string implementation is used |
07:45:29 | FromDiscord | <haxscramper> In reply to @haxscramper "nim's `string` representation in": See `stdlib_system_nim.c(pp)` in compilation cache, it has all built-in types compiled |
07:45:44 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mmX |
07:46:00 | FromDiscord | <haxscramper> But again - this is an implementation detail |
07:46:02 | FromDiscord | <Rika> In reply to @DumbMahreeo "<@!259277943275126785> how did you": i dont use lsp xd |
07:46:12 | FromDiscord | <haxscramper> No guarantees about the structure, availability etc. |
07:46:43 | FromDiscord | <haxscramper> In reply to @Hitoshi Shinsou|π»β "And using cstring isn't": btw, why can't you use `cstring` in the first place? |
07:46:58 | FromDiscord | <Nisha's alt> In reply to @haxscramper "https://github.com/haxscramper/hack/blob/master/tes": Thanks! |
07:47:07 | FromDiscord | <Nisha's alt> In reply to @haxscramper "So you can't really": Ah okay |
07:48:11 | FromDiscord | <Nisha's alt> In reply to @haxscramper "See `stdlib_system_nim.c(pp)` in compilation": Ah alright |
07:48:48 | FromDiscord | <Nisha's alt> In reply to @haxscramper "btw, why can't you": Pre-existing lib and it would take too much time changing all the Nim types to the C types |
07:51:01 | FromDiscord | <haxscramper> Can't you just `exportc` wrappers for working with nim `string` too? |
07:51:19 | FromDiscord | <Nisha's alt> Wdym? |
07:51:36 | FromDiscord | <haxscramper> you need to work with nim string at `C` side, correct? |
07:51:51 | FromDiscord | <haxscramper> then write functions for working with nim string and `exportc` them |
07:52:19 | FromDiscord | <haxscramper> like `proc nim_strcmp(a, b: string): bool {.exportc.} = a == b` |
07:52:23 | FromDiscord | <haxscramper> And use it in C code |
07:52:46 | FromDiscord | <Nisha's alt> Oh okay! |
07:52:47 | FromDiscord | <haxscramper> boilerplate, yes, but I don't think there is any other sane way of doing so |
07:52:52 | FromDiscord | <Nisha's alt> That actually makes sense lol |
07:53:54 | FromDiscord | <haxscramper> You lose some things like `[]` access for characters, and have to add disambiguation prefix for exportc-ed functions to avoid name clashes on C side |
07:53:59 | FromDiscord | <Nisha's alt> sent a code paste, see https://play.nim-lang.org/#ix=3mmZ |
07:54:14 | FromDiscord | <Nisha's alt> Ah okay |
07:54:21 | FromDiscord | <haxscramper> well, don't see why it shouldn't work |
07:54:27 | FromDiscord | <Nisha's alt> Thanks! Lol |
07:59:50 | FromDiscord | <haxscramper> Though I don't really know how this would work wrt. to garbage collector. Maybe you would have to manually manage nim strings |
08:00:27 | FromDiscord | <haxscramper> But simple example is working correctly |
08:00:30 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/l50 |
08:04:10 | FromDiscord | <demotomohiro> Using Nim string in C code sounds like "To boldly go where no man has gone before!" |
08:05:10 | FromDiscord | <haxscramper> tbh I would rather use nim strings than C ones |
08:05:54 | FromDiscord | <haxscramper> especially considering you can convert a lot of types to strings, and have cheap strlen etc., while in C you are left with `printf` |
08:05:59 | FromDiscord | <haxscramper> and `strlen` |
08:06:04 | FromDiscord | <Nisha's alt> Hm |
08:08:26 | FromDiscord | <Nisha's alt> Can i just like, replace every reference of `string` to `cstring` and `int` to `cint`? Lol |
08:09:29 | FromDiscord | <demotomohiro> sizeof(int) and sizeof(cint) can be different |
08:09:38 | * | MarderIII joined #nim |
08:09:43 | FromDiscord | <Nisha's alt> Oh? |
08:10:01 | FromDiscord | <demotomohiro> !eval echo int.sizeof, cint.sizeof |
08:10:05 | NimBot | 84 |
08:10:11 | * | spiderstew joined #nim |
08:10:30 | FromDiscord | <Nisha's alt> !eval echo int.sizeof |
08:10:32 | NimBot | 8 |
08:10:36 | FromDiscord | <Nisha's alt> !eval echo cint.sizeof |
08:10:38 | NimBot | 4 |
08:10:47 | FromDiscord | <Nisha's alt> Huh. |
08:11:00 | FromDiscord | <Nisha's alt> !eval echo cint8.sizeof |
08:11:02 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared identifier: 'cint8' |
08:11:56 | Amun_Ra | Nisha's alt: https://nim-lang.org/docs/system.html#clong |
08:14:12 | FromDiscord | <demotomohiro> In Nim, sizeof(int) is same to sizeof(pointer), but in C sizeof(int) can be 4 bytes even on 64bit cpu |
08:14:36 | Amun_Ra | Nim's c*types are only for non-fixed width (long/short/int/β¦) or implementation-defined C types |
08:16:59 | FromDiscord | <Nisha's alt> Oh okay! |
08:17:28 | Amun_Ra | so it's just int8, uint8, etc. |
08:19:42 | FromDiscord | <Nisha's alt> Ah okay then |
08:19:49 | FromDiscord | <Nisha's alt> Is there a cfloat? Lol |
08:19:56 | FromDiscord | <Nisha's alt> !eval echo cfloat |
08:19:56 | Amun_Ra | yes |
08:19:57 | NimBot | cfloat |
08:20:03 | FromDiscord | <Nisha's alt> Nice |
08:20:22 | Amun_Ra | look at that system.html for complete types reference |
08:21:12 | FromDiscord | <Nisha's alt> Alright then, thanks! |
08:26:39 | FromDiscord | <Nisha's alt> !eval echo cbool |
08:26:41 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared identifier: 'cbool' |
08:26:45 | FromDiscord | <Nisha's alt> Wait |
08:26:58 | FromDiscord | <Nisha's alt> Why tf am i not checking the docs lol |
08:30:45 | FromDiscord | <ElegantBeef> If you have a bool that isnt 1 byte, you're writing Java |
08:32:30 | Amun_Ra | _Bool can be larger than 1 byte according to C standard |
08:33:04 | FromDiscord | <demotomohiro> !eval bool.sizeof |
08:33:06 | NimBot | Compile failed: /usercode/in.nim(1, 5) Error: expression '1' is of type 'int' and has to be used (or discarded) |
08:33:33 | FromDiscord | <demotomohiro> !eval echo bool.sizeof |
08:33:35 | NimBot | 1 |
08:33:43 | FromDiscord | <Rika> it said in the error xd |
08:33:55 | FromDiscord | <Rika> `...expression '1' is...` |
08:34:54 | FromDiscord | <demotomohiro> I didn't read error |
08:43:10 | * | Tanger quit (Quit: Leaving) |
08:44:39 | * | krux02 joined #nim |
08:53:49 | * | aeverr quit (Quit: Konversation terminated!) |
08:53:55 | FromDiscord | <Nisha's alt> In reply to @ElegantBeef "If you have a": Lol |
09:01:47 | FromDiscord | <jtiai> Now since I've stared few hours a C code is there in nim something that would equal to `#define`. Templates maybe? |
09:02:16 | FromDiscord | <Rika> Not exactly but theyβre close yes |
09:02:29 | FromDiscord | <Rika> In some cases you can just use const as well |
09:02:47 | FromDiscord | <haxscramper> `const a = 123`, `when a == 333: ....` |
09:02:54 | * | aeverr joined #nim |
09:03:35 | FromDiscord | <haxscramper> @Nisha's alt after some diffing it seems like `--header` is deprecated and https://github.com/nim-lang/Nim/commit/279df834bae8b6972af6cbcbdd57c1d53e1df9c7 |
09:03:46 | FromDiscord | <haxscramper> and I'm not sure what is the other way |
09:03:48 | FromDiscord | <ElegantBeef> And if you're after macros, we have type safe macros |
09:04:28 | FromDiscord | <ElegantBeef> Yea it's odd that it doesnt anymore, would be nice if it was possible |
09:04:46 | * | Vladar joined #nim |
09:04:59 | FromDiscord | <haxscramper> In reply to @haxscramper "and I'm not sure": https://forum.nim-lang.org/t/5809 says β΅`> "Also and more importantly, --header is unsupported, write your header files manually or extract them via a 3rd party tool."` |
09:05:09 | FromDiscord | <haxscramper> but anyway |
09:05:12 | FromDiscord | <haxscramper> it works for now |
09:05:18 | FromDiscord | <jtiai> How macros do differ from templates? |
09:05:28 | FromDiscord | <jtiai> All examples I have seen looks very complex. |
09:05:30 | FromDiscord | <ElegantBeef> macros can do introspection and generate AST directly |
09:05:37 | FromDiscord | <ElegantBeef> templates are basic code subsitution |
09:06:39 | FromDiscord | <haxscramper> most importantly macros can execute arbitrary logic |
09:06:54 | FromDiscord | <haxscramper> arbitary code |
09:06:57 | FromDiscord | <Nisha's alt> Ah okay |
09:07:46 | FromDiscord | <jtiai> Wonder what is practical use case for macro... |
09:08:24 | FromDiscord | <ElegantBeef> Wanting to make a DSL, or do something that requires introspection |
09:08:45 | FromDiscord | <ElegantBeef> https://github.com/beef331/constructor here is a whole list of them if you want to see some more simple ones |
09:09:19 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3mno |
09:09:23 | FromDiscord | <haxscramper> boilerplate reduction |
09:09:36 | FromDiscord | <haxscramper> complex type introspection is also possible with macros |
09:09:45 | FromDiscord | <ElegantBeef> Dont write code a lot, have a macro write code for you |
09:09:52 | FromDiscord | <haxscramper> writing custom serializers |
09:10:14 | FromDiscord | <ElegantBeef> Aslong as it's not changing the syntax, you can probably implement what you want in a macro |
09:10:46 | FromDiscord | <ElegantBeef> Still a little sad after learning term rewritting macros are after semantic checking, cannot add object unpacking with them π |
09:11:09 | FromDiscord | <haxscramper> In reply to @jtiai "Wonder what is practical": https://github.com/mratsim/photon-jit/blob/747ae2db3698e1b814e78fded175d08a778fada9/photon_jit/x86_64/x86_64_op_generator.nim#L14 |
09:11:13 | FromDiscord | <haxscramper> might be interesting for you |
09:15:27 | FromDiscord | <jtiai> Now given that familiar assembler stuff I was able to understand part of it. So yes I could write my Z80 emulator with macros as well but I'll I use more straightforward approach first to make sure it even works. |
09:26:42 | Oddmonger | string are immutable, even when adressed with a pointer ? |
09:27:00 | PMunch | Oddmonger, strings aren't immutable.. |
09:27:38 | Oddmonger | yes my bas, i was testing from a nimscript |
09:28:15 | Oddmonger | with nimscript, this one : https://play.nim-lang.org/#ix=3mnw prints Β« bug mug Β» |
09:28:24 | Oddmonger | and not Β« mug mug Β» as expected |
09:29:11 | Oddmonger | but i've read somewhere that nim script had issues with pointers (in fact, it's read-only ptr, a new concept :ΓΎ ) |
09:29:36 | FromDiscord | <ElegantBeef> Not really a new concept, we have `lent` in the language π |
09:32:44 | Oddmonger | https://nim-lang.org/docs/destructors.html#lent-type seems intricate (for me) |
09:33:32 | Oddmonger | i will learn it next year, when i'm graduated for current newb session |
09:35:33 | Oddmonger | sink and lent seem to be nim concept (i didn't found a broader explaination on g**gle) |
09:37:18 | Oddmonger | but wait β¦ i remember to have seen Β« sink Β» in Β« programming in lua Β» |
09:38:03 | FromDiscord | <haxscramper> I think `sink` is C++ `rvalue` |
09:38:09 | FromDiscord | <haxscramper> `&&` references |
09:39:51 | Oddmonger | && ? really ? (boolean and ?) |
09:40:02 | Oddmonger | i know & for reference |
09:41:13 | FromDiscord | <haxscramper> https://en.cppreference.com/w/cpp/language/reference |
09:45:20 | Oddmonger | ok it's new to C++11 . I know it's not the place, but i don't understand the difference between a pointer and a simple ref (&) when declaring lvalue (i've used references only in functions parameters, for avoiding the horrible ** ) |
10:05:29 | * | vicfred quit (Ping timeout: 246 seconds) |
10:08:45 | FromDiscord | <Nisha's alt> Has someone written an MC server in Nim yet? Lol |
10:18:34 | FromDiscord | <jtiai> In reply to @Hitoshi Shinsou|π»β "Has someone written an": You probably would be the first... π |
10:26:56 | FromDiscord | <Nisha's alt> That'd be SO cool- |
10:27:01 | FromDiscord | <Nisha's alt> But too much effort lol |
10:27:12 | FromDiscord | <Nisha's alt> I'll definitely attempt it once 1.17 comes out, but no promises lol |
10:30:54 | PMunch | Wait, a complete Nim re-implementation of the Minecraft server. Or simply the front-end bit? |
10:37:22 | FromDiscord | <Rika> Likely the former |
10:39:30 | FromDiscord | <Nisha's alt> Depends what you mean lol |
10:40:56 | FromDiscord | <Nisha's alt> PMunch (unless you're already talking lol) |
10:41:25 | PMunch | What do you mean by server |
10:41:58 | FromDiscord | <Nisha's alt> Like the server software lol |
10:42:11 | PMunch | I mean the Minecraft server is quite complex isn't it? Keeping track of all the mobs, block states, and players. You'd basically need to recreate all the rules of the game to write a new server |
10:42:35 | FromDiscord | <Nisha's alt> Fair lol |
10:42:43 | PMunch | But on top of that is the interface where you can type commands, manage players, etc. which is a lot easier I'd imagine |
10:42:45 | FromDiscord | <Nisha's alt> But I'm looking for more of a minimal implementation |
10:43:06 | FromDiscord | <Nisha's alt> That provides the basic functionality like joining and disconnecting from the server lol |
10:43:21 | FromDiscord | <Rika> but then is it really minecraft |
10:44:02 | PMunch | I think either I'm misunderstanding what you want to do, or you have no idea what a Minecraft server is :P |
10:44:30 | FromDiscord | <Rika> or maybe nisha has no idea what a minecraft server is |
10:44:33 | FromDiscord | <Rika> oh |
10:44:35 | FromDiscord | <Rika> misread |
10:44:43 | FromDiscord | <Rika> i thought you said "i have no..." |
10:46:06 | FromDiscord | <Nisha's alt> Basically something like https://github.com/Minestom/Minestom but in Nim :p |
10:46:31 | FromDiscord | <Nisha's alt> I need the core functionality so i can expand upon it |
10:51:35 | PMunch | Oh, you actually want to create the whole thing |
10:58:09 | PMunch | Hmm, looking at Minestom to try and get an idea of how much is done server side in Minecraft |
10:58:28 | PMunch | They have like a goals system for the AI |
10:58:43 | PMunch | But it's not obvious to me if this is a Minecraft concept or a Minestom one |
11:01:46 | FromDiscord | <Nisha's alt> In reply to @PMunch "Hmm, looking at Minestom": Alright then, thanks! |
11:02:32 | * | hyiltiz quit (Ping timeout: 246 seconds) |
11:02:34 | PMunch | Huh? |
11:02:49 | FromDiscord | <Rika> maybe misunderstanding |
11:04:03 | FromDiscord | <rb3> sent a code paste, see https://paste.rs/ypb |
11:04:43 | FromDiscord | <rb3> Like C++ `::thing` or Dlang's `.thing`? |
11:04:43 | FromDiscord | <Yardanico> you shadow the global `thing` with this code |
11:04:49 | FromDiscord | <Yardanico> in your proc |
11:04:50 | PMunch | I think you can do `<module name>.thing` |
11:04:56 | FromDiscord | <Yardanico> oh, that might work |
11:05:54 | PMunch | Yup, it works: https://play.nim-lang.org/#ix=3mnR |
11:06:04 | FromDiscord | <rb3> Ah, so let's say a template called in `stuff` that wants to refer to `thing` will need to know the name of the module it expands in? |
11:06:28 | PMunch | (The playground stores the Nim code in a file in.nim, so the module name is `in` which turns out to be a keyword, hence the backticks) |
11:06:59 | PMunch | You could use instantiationInfo to get that |
11:07:28 | FromDiscord | <rb3> Got it, thanks PMunch. I might make a utility template for this |
11:08:36 | * | hyiltiz joined #nim |
11:08:36 | * | hyiltiz quit (Changing host) |
11:08:37 | * | hyiltiz joined #nim |
11:14:59 | PMunch | Hmm, not as easy as I thought.. |
11:15:12 | PMunch | https://play.nim-lang.org/#ix=3mnU |
11:15:17 | PMunch | Not quite sure why that doesn't work |
11:17:21 | PMunch | This works though: https://play.nim-lang.org/#ix=3mnW |
11:18:03 | * | MarderIII quit (Quit: Leaving) |
11:18:32 | FromDiscord | <rb3> Ah nice, thanks for this PMunch. Couldn't get mine to work haha |
11:33:16 | FromDiscord | <willyboar> can i switch off all outputs when building? |
11:34:22 | FromDiscord | <haxscramper> you mean `nimble build` or regular `nim c`? |
11:34:44 | FromDiscord | <willyboar> regular nim c or nim js |
11:34:57 | FromDiscord | <haxscramper> `--verbosity:0 --hints:off` |
11:36:12 | FromDiscord | <willyboar> Thank you @haxscramper |
11:45:27 | FromDiscord | <no name fits> Have any of you guys implemented float compare? If yes, can i see? |
11:45:45 | FromDiscord | <no name fits> Because i have it working, but my algorithm is so ugly and makes me cry |
11:47:37 | FromDiscord | <no name fits> Here is my ugly https://play.nim-lang.org/#ix=3lYR |
11:54:07 | * | xet7 quit (Remote host closed the connection) |
11:56:07 | * | xet7 joined #nim |
11:56:42 | FromDiscord | <Vindaar> @no name fits there is `almostEqual` in the stdlib nowadays: https://nim-lang.github.io/Nim/math.html#almostEqual%2CT%2CT%2CNatural |
11:57:21 | FromDiscord | <Vindaar> aside from that I have one that predates the stdlib one here: https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/dataframe/value.nim#L327-L342 |
12:02:46 | FromDiscord | <no name fits> No way |
12:02:51 | FromDiscord | <no name fits> I feel so dumb |
12:03:06 | FromDiscord | <no name fits> I could've sworn i looked through the docs |
12:04:21 | FromDiscord | <no name fits> Thanks |
12:08:30 | giaco | what's the best way to understand how nim work under the hood and understand better what's happening (find answers on my own) without asking to community? I know there might not be a general answer, but I've not found a "troubleshoot manual" or general tip&tricks when things goes wrong |
12:10:35 | FromDiscord | <no name fits> Do you mean the compilation? There is the manual that goes through it step-by-step |
12:10:40 | FromDiscord | <no name fits> If that's what you mean? |
12:12:18 | FromDiscord | <haxscramper> https://gitlab.com/pmetras/nim0 https://nim-lang.org/docs/intern.html and source code itself |
12:12:59 | FromDiscord | <haxscramper> `Nim0` is not exactly related, but since nim is a wirth language it might have some similarities, and the project itself is much smaller |
12:13:29 | FromDiscord | <haxscramper> But source code for nim compiler itself is a best reference of course |
12:15:14 | giaco | no name fits, is there a compilation step-by-step into the manual? I might have missed it |
12:15:47 | giaco | thanks! |
12:27:59 | FromDiscord | <no name fits> Compiler user guide: <https://nim-lang.org/docs/nimc.html>β΅Internal docs: <https://nim-lang.org/docs/intern.html>β΅Lang manual: <https://nim-lang.org/docs/manual.html> |
12:28:24 | FromDiscord | <no name fits> I find the lang manual to be plenty for me |
13:01:30 | FromGitter | <dilawar> Is there a way to integrate nim with cmake. I am compiling a C library using cmake and would be cool if I can integrate nim flow into CMake. I can write custom targets but would love to avoid it. |
13:11:47 | FromDiscord | <no name fits> something-something `add_custom_command` add nim as a command, run nim as a shell command from CMake |
13:12:36 | FromDiscord | <no name fits> You could also do it the other way around, and make Nim execute the CMake |
13:12:52 | FromDiscord | <no name fits> But i have no idea how that would work |
13:20:45 | Oddmonger | i see : proc `<%`(x, y: int8): bool {...} , and i understand i can use it as : Β« a <% b Β» |
13:21:33 | Oddmonger | and so it is, but how can this be possible ? I know the syntax: proc fx(a,b) which can be called like this : a.fx(b) |
13:22:10 | Oddmonger | so, <% could be called like this: a.<% (b) |
13:22:47 | Oddmonger | but i don't understand how the working Β« a <% b Β» is possible with the proc definition (or may be a template under the hood ?) |
13:25:42 | FromDiscord | <Rika> certain characters in a proc name will make that proc operator-like |
13:27:34 | leorize[m] | it's in the manual, compositions of "operator" characters will enable a proc to be called like an operator |
13:28:39 | Oddmonger | ahhh i was thinking `` was only for using reserved characters, thank you |
13:29:00 | Oddmonger | very interesting feature |
13:29:20 | FromGitter | <haxscramper> @dilawar I had to do something like that and ended up writing `FindNIM.cmake`: β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=609935304d0065337e643173] |
13:29:31 | leorize[m] | you can use backticks with anything, but there aren't many reasons to do so when you don't have to :p |
13:30:28 | FromGitter | <haxscramper> And the cmake file itself (for building nim application that uses bullet C++ library): β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=609935740845c416dcd58ca4] |
13:37:12 | FromDiscord | <carpal> hi, is there a way to move specific operations from the cpu to the gpu in nim? |
13:37:55 | Oddmonger | there are bindings for opencl in nimble |
13:39:28 | FromGitter | <dilawar> Thanks @haxscramper. Really helpful. |
14:04:32 | FromDiscord | <hamidb80> just why??!?! https://media.discordapp.net/attachments/371759389889003532/841314765288898640/unknown.png |
14:08:59 | FromDiscord | <hamidb80> https://play.nim-lang.org/#ix=3moL |
14:11:41 | FromDiscord | <no name fits> Because a seq is a linked-list if I remember? |
14:12:06 | FromDiscord | <haxscramper> Seq is not a linked list |
14:12:11 | FromDiscord | <no name fits> I was wrong |
14:12:29 | FromDiscord | <Rika> lmao |
14:12:30 | FromDiscord | <hamidb80> i pass the same var to those procs |
14:12:40 | FromDiscord | <hamidb80> (edit) "the" => ""the" | "var" => "var"" |
14:12:55 | FromDiscord | <no name fits> In reply to @Rika "lmao": it do be like that sometimes |
14:14:01 | FromDiscord | <no name fits> But if I recall they're allocated on the heap regardless of mutability |
14:14:22 | FromDiscord | <no name fits> (I better not have that wrong) |
14:14:36 | FromDiscord | <no name fits> And heap is slow |
14:15:13 | FromDiscord | <haxscramper> It does not matter where it allocated because it the same var |
14:15:20 | FromDiscord | <haxscramper> But you iterate in different order |
14:15:23 | FromDiscord | <no name fits> Oh right |
14:15:35 | FromDiscord | <Rika> lmao.repeat(2) |
14:16:02 | FromDiscord | <no name fits> In reply to @Rika "lmao.repeat(2)": One day I'll say something correct... One day |
14:18:04 | * | Jesin quit (Ping timeout: 252 seconds) |
14:20:18 | FromDiscord | <haxscramper> it looks like `seq` compiles to additional level of indirection https://media.discordapp.net/attachments/371759389889003532/841318733221724170/unknown.png |
14:20:45 | FromDiscord | <haxscramper> `s[x]` for openarray vs `(s)->data[x]` for seq |
14:21:03 | FromDiscord | <haxscramper> which is strange |
14:21:31 | FromDiscord | <haxscramper> Because `openarray` as a parameter is supposed to be an implicit generic IIRC |
14:23:21 | FromDiscord | <haxscramper> Now I'm also curious what is going on here |
14:28:06 | FromDiscord | <Rika> In reply to @no name fits "One day I'll say": you just did... or did you? |
14:35:49 | FromDiscord | <no name fits> In reply to @haxscramper "Now I'm also curious": https://xkcd.com/356/ |
14:46:40 | FromGitter | <bung87> how to seek file cross platform? |
15:02:02 | FromDiscord | <hamidb80> In reply to @haxscramper "Because `openarray` as a": i don't understand anything, but if you could fix it, it's ok π |
15:03:03 | FromDiscord | <hamidb80> (edit) "ok" => "fine" |
15:06:16 | FromDiscord | <haxscramper> I don't think I can fix this |
15:07:02 | FromDiscord | <hamidb80> In reply to @haxscramper "it looks like `seq`": try to compile with `-d:release` |
15:07:17 | FromDiscord | <haxscramper> no changes |
15:07:41 | FromDiscord | <haxscramper> and it is not related to release/debug node in any way |
15:11:41 | * | PMunch quit (Quit: leaving) |
15:41:01 | * | fredrikhr joined #nim |
15:42:37 | * | xace quit (Ping timeout: 252 seconds) |
15:49:08 | narimiran | NimConf 2021 registration deadline is this Sunday! For more details, see: https://forum.nim-lang.org/t/7863 |
15:59:36 | FromDiscord | <dom96> Keep reminding us. I think it's easy to miss these deadlines π |
15:59:46 | FromDiscord | <dom96> Still not sure whether to submit a talk or not |
16:06:57 | FromDiscord | <treeform> In reply to @narimiran "NimConf 2021 registration deadline": I missed it, but I could do another talk. |
16:07:08 | narimiran | @dom96 is this the part when we say to you "of course, you should submit it"? |
16:07:08 | FromDiscord | <treeform> Thanks registered |
16:17:35 | * | Jesin joined #nim |
16:20:38 | * | tane joined #nim |
16:23:30 | * | whitefly joined #nim |
16:29:41 | * | narimiran quit (Ping timeout: 240 seconds) |
17:19:13 | FromDiscord | <hamidb80> In reply to @haxscramper "and it is not": can we implement something like `openArray` with `concept`s? |
17:20:24 | FromDiscord | <haxscramper> Yes, `Indexable[T]` with requirements for existence of items, [] and len should give your the same API |
17:20:50 | FromDiscord | <haxscramper> Technically, thought I don't know what state concepts currently are in |
17:25:54 | FromDiscord | <Rika> New style concepts are partially implemented |
17:35:04 | Oddmonger | what are the rules for user defined operators ? |
17:35:53 | Oddmonger | `%%` is ok, `%b%` isn't |
17:36:14 | Oddmonger | it seems [a-zA-Z] is forbidden |
17:39:20 | FromDiscord | <konsumlamm> ye, only symbols |
17:44:35 | Oddmonger | maybe i could try ascii art then :) |
17:49:55 | ForumUpdaterBot | New post on r/nim by h234sd: Invisible DB Driver / ORM without a single cool feature [experiment], see https://reddit.com/r/nim/comments/n9bb7a/invisible_db_driver_orm_without_a_single_cool/ |
17:51:26 | Oddmonger | do you think it's abusing of nim -> template %[T]( a:T,b:T) :T = a mod b |
17:55:34 | * | vicfred joined #nim |
17:56:25 | FromDiscord | <haxscramper> if you want you can write own `%`, but I would advise to just use `mod` instead |
17:57:06 | Oddmonger | ok , i think i stick to mod then |
17:57:29 | Oddmonger | you know how it is, when you find a new shining toy, you want to use it everywhere |
17:57:51 | Oddmonger | thinking i have not even began to play with AST and real macros⦠|
18:02:46 | FromDiscord | <hamidb80> me too |
18:06:25 | FromDiscord | <Varriount> Did we have a Skrylar here at some point? |
18:13:43 | FromDiscord | <Vindaar> @Varriount yep, we did (or still do?) |
18:32:00 | FromDiscord | <arnetheduck> @Varriount https://github.com/nim-lang/Nim/issues/17855#issuecomment-837047221 - β΅> it's understood that some people prefer to use result - this warning is not for them (it can be disabled by default). |
18:37:17 | ForumUpdaterBot | New thread by LeFF: VSCode extension?, see https://forum.nim-lang.org/t/7961 |
18:44:13 | * | Jesin quit (Ping timeout: 240 seconds) |
19:16:45 | * | narimiran joined #nim |
19:26:00 | * | wasted_youth2 joined #nim |
19:26:11 | FromDiscord | <brainproxy> If I have a nim `string` that contains multi-byte utf-8 characters like π₯³ , what is the correct way to have ncurses print it to the screen. If |
19:26:32 | FromDiscord | <brainproxy> (edit) "If I have a nim `string` that contains multi-byte utf-8 characters like π₯³ , what is the correct way to have ncurses print it to the screen. If ... " added "I naively do `printw(mystring)` then I get garbage in the terminal" |
19:26:40 | FromDiscord | <brainproxy> (edit) "screen." => "screen?" |
19:26:43 | FromDiscord | <ElegantBeef> It depends on if the font + terminal emulator supports it |
19:28:25 | FromDiscord | <ElegantBeef> For instance top is gnome terminal and bottom is kitty https://media.discordapp.net/attachments/371759389889003532/841396276662894632/unknown.png |
19:28:49 | FromDiscord | <brainproxy> https://media.discordapp.net/attachments/371759389889003532/841396375391830080/unknown.png |
19:28:56 | FromDiscord | <brainproxy> good point re: font + terminal |
19:29:13 | FromDiscord | <brainproxy> mine is iTerm2 on macOS |
19:29:55 | FromDiscord | <ElegantBeef> All nim does it output the string, it's up to whatever renders it to get it right |
19:31:08 | FromDiscord | <brainproxy> in this pic, I have my nim+ncurses program running and I input π https://media.discordapp.net/attachments/371759389889003532/841396955727921182/unknown.png |
19:31:16 | FromDiscord | <brainproxy> (edit) "pic," => "screeenshot," |
19:31:41 | FromDiscord | <brainproxy> however, in the logfile for the program, I see the nim code does have the expected string, it's not garbled in the log |
19:34:34 | FromDiscord | <ElegantBeef> Hmm seems ncurses has a ncursesw version which supports wide characters |
19:35:41 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3mqP |
19:36:32 | FromDiscord | <brainproxy> ah wait, actually maybe it's linking to one that ships with the OS and I need to be more explicit to use the one installed with `brew` |
19:37:02 | FromDiscord | <brainproxy> yep |
19:37:07 | FromDiscord | <ElegantBeef> you can try `--passL:lncursesw` but idk if that'd work |
19:37:34 | * | rockcavera joined #nim |
19:38:00 | FromDiscord | <ElegantBeef> Oh it's looking for `libncurses.dylib` on mac |
19:40:30 | FromDiscord | <ElegantBeef> But yea cannot help much more π |
19:50:31 | FromDiscord | <Varriount> Anyone know how one would implement something like https://docs.python.org/3/library/functools.html#functools.lru_cache in Nim? |
19:52:18 | FromDiscord | <Varriount> @Vindaar Hah, because I just noticed that he and I "crossed paths" in a non-Nim issue a while ago: https://github.com/pyinvoke/invoke/issues/752 |
19:52:37 | FromDiscord | <Varriount> (edit) "he" => "they" |
19:53:42 | FromDiscord | <checkersai> Is it possible to unpack arrays in a similar manner to tuples? I figure it should be possible since the length of arrays is known at compile time |
19:54:02 | FromDiscord | <ElegantBeef> I mean each function you add that to would have a table and it'd add to at the end of a calculation it'd check before the calculation |
19:54:07 | FromDiscord | <ElegantBeef> Yes there are macros that do it |
19:54:13 | FromDiscord | <ElegantBeef> (edit) "it" => "it, hell there are macros that unpack seqs" |
19:54:15 | FromDiscord | <checkersai> For example: `var (a,b,c) = [1,2,3]` |
19:54:22 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3mqQ |
19:54:52 | FromDiscord | <ElegantBeef> You cannot change that behaviour checker, but there are macros that allow `(a, b, c) := [1, 2, 3]` |
19:55:34 | FromDiscord | <brainproxy> however, even though now I'm (statically) linked to the correct ncurses lib, I still get garbage output |
19:56:39 | FromDiscord | <ElegantBeef> @checkersai https://hlaaftana.github.io/assigns/assigns.html#examples |
19:57:14 | FromDiscord | <checkersai> Sweet, thanks |
19:57:51 | FromDiscord | <checkersai> Also, I'm guessing it's then possible to convert an array type into a tuple type with macros? |
19:58:03 | FromDiscord | <ElegantBeef> if you can write the code manuall, you can do it in macros |
19:58:09 | FromDiscord | <ElegantBeef> (edit) "manuall," => "manually," |
19:59:32 | FromDiscord | <checkersai> sent a code paste, see https://play.nim-lang.org/#ix=3mqS |
19:59:43 | FromDiscord | <checkersai> And I would prefer that it return a tuple so that I can unpack it |
20:01:29 | * | kenran joined #nim |
20:02:49 | FromDiscord | <ElegantBeef> In reply to @Varriount "Anyone know how one": And yea doesnt seem too complicated with an ordered table, same restriction that all parameters would have to be hashable |
20:04:55 | FromDiscord | <ElegantBeef> I might throw together an implementation later, but idk |
20:07:45 | FromDiscord | <exelotl> is there a one liner to map over a fixed length array? |
20:08:06 | FromDiscord | <ElegantBeef> you mean map over an array and return an array? |
20:08:10 | FromDiscord | <exelotl> yeah |
20:08:14 | FromDiscord | <Varriount> @ElegantBeef I'm not too puzzled on how to implement a cache, but rather how to easily wrap a function without performance loss. |
20:08:23 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3mqX |
20:09:03 | FromDiscord | <ElegantBeef> Well do it in a block expr and convert it to an array after π |
20:10:36 | FromDiscord | <exelotl> that's a 5 liner ;_; |
20:10:48 | FromDiscord | <ElegantBeef> Make a new array `mapIt` |
20:11:46 | * | narimiran quit (Ping timeout: 240 seconds) |
20:12:12 | FromDiscord | <ElegantBeef> The only way i can see the logic/cache be done is to insert a table check, if it has the key return the value, otherwise do the calculation and if the table is equal to max size remove the first element from the ordered table and insert the new one |
20:14:36 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3mqY |
20:20:28 | FromDiscord | <Varriount> In reply to @ElegantBeef "The only way i": Are you replying to me, or exelotl? |
20:22:02 | FromDiscord | <exelotl> probably you x) |
20:22:27 | FromDiscord | <exelotl> except for the "mapit" thing |
20:34:11 | FromDiscord | <Varriount> sent a long message, see http://ix.io/3mr4 |
20:43:19 | * | Jesin joined #nim |
20:44:20 | * | Vladar quit (Quit: Leaving) |
20:53:03 | leorize[m] | I don't see how decorators free you from writing a macro |
20:56:36 | * | fredrikhr quit (Ping timeout: 260 seconds) |
21:12:05 | FromDiscord | <ElegantBeef> I was replying to you |
21:12:30 | FromDiscord | <Varriount> In reply to @leorize "I don't see how": They wouldn't, I guess. I guess I just wish there was an easy, frictionless, suitable equivalent in Nim |
21:13:53 | FromDiscord | <ElegantBeef> Yea i dont see the issue with pragmas as decorators, it's the same thing to me |
21:14:27 | FromDiscord | <ElegantBeef> Some amount of code will replace the proc definition or appended to it |
21:16:55 | * | thomasross joined #nim |
21:18:19 | * | ronny joined #nim |
21:18:34 | ronny | hi |
21:18:56 | FromDiscord | <ElegantBeef> In the case of the cache, it can be a gensym'd name and you can write `clearCache()` and insert the code in the macro to clear it |
21:19:27 | FromDiscord | <ElegantBeef> That means the only way to mutate the cache is by calling that, or with the emitted code |
21:19:29 | FromDiscord | <ElegantBeef> Hello ronny |
21:20:24 | ronny | im looking for away to have nim declare c structs in a very particular manner, as i'd like to export tem to cpython and hpy in a nice manner |
21:20:39 | FromDiscord | <ElegantBeef> `{.exportc.}`? |
21:20:41 | ronny | as far as i can tell of hand, the python integrations for num lack that side |
21:21:21 | ronny | problem is they need to include stucts from a c header, and i think im m issing the detail here |
21:23:00 | FromDiscord | <Varriount> In reply to @ronny "as far as i": In what particular way? Exported name, bit size...? |
21:23:11 | FromDiscord | <Varriount> @ronny |
21:24:03 | ronny | structurally what i'd like to do is declare cpython and hpy extension types/methods so specific header structs have to be included, and static data has to be put into the c level |
21:26:20 | * | xet7 quit (Remote host closed the connection) |
21:27:16 | ronny | so i'd really like to find any docs on doing something like that, so far i havent, and the python integrations that exist simply dont manage that part as far as i can tell |
21:30:22 | ronny | Current what i think i need to be able to integrate hpy/cpython is something like being able to make the resulting c code invoke extra macros, and declare c types in a specific way, |
21:30:22 | ronny | in addition, also it might be nice to have a new kind of type thats "pythongc" instead of ref (and invokes the backends gc helpers/helper macros automatically) |
21:30:23 | * | xet7 joined #nim |
21:32:00 | * | tane quit (Quit: Leaving) |
21:33:09 | FromDiscord | <ElegantBeef> You could use the nim destructors to call the "backend"'s destructors for the object i imagine, though i dont know what you're after for the first part |
21:35:14 | ronny | i want to make tools to declare python classes/methods in nim and have nim shed out c that integrates as well as possible wit the python ecosystem (which would inlclude using the python memory allocation/gc api( |
21:35:16 | FromDiscord | <ElegantBeef> Also you can look at https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma for the "declaring structs in a specific way" but without an example i'm uncertain |
21:35:52 | * | kenran quit (Quit: leaving) |
21:38:23 | ronny | basically i want to be able to emmit stuff like https://docs.python.org/3/extending/newtypes_tutorial.html#the-basics |
21:43:17 | FromDiscord | <ElegantBeef> I'm uncertain if that's possible, so i'll shush |
22:31:58 | FromDiscord | <Varriount> It's possible |
22:33:59 | FromDiscord | <Varriount> ronny: I'm not 100% clear on how using Python's allocator would work, but you can definitely interface with Python and create types. I think there is at least 1 nimble package that does that. |
22:34:56 | FromDiscord | <ElegantBeef> Also i couldnt help myself and implemented the cached procedure calling |
22:41:48 | FromDiscord | <ElegantBeef> On the off chance someone is curious on what it looks like https://play.nim-lang.org/#ix=3mrA |
23:00:45 | * | xace joined #nim |
23:09:13 | FromGitter | <ynfle> @ElegantBeeft, That's really cool! I've have been looking for something like that in nim! Python has lru_cache |
23:09:25 | FromGitter | <ynfle> *ElegantBeef |
23:09:53 | FromDiscord | <ElegantBeef> Yea that's where it came from, varriount was talking about python's so felt like emulating it |
23:12:30 | FromGitter | <ynfle> ```code paste, see link``` β β Can someone make sense of this error? [https://gitter.im/nim-lang/Nim?at=6099bddd93ac573bba9720b6] |
23:13:41 | FromDiscord | <ElegantBeef> If you're not using `int128` it's probably a compiler error |
23:19:35 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=3mrG Here's the code if it makes a difference. I tried doing some interesting overload. Not sure if it's allowed |
23:27:01 | FromDiscord | <ElegantBeef> I dont feel like going through each to test which causes the issue π |
23:27:19 | FromGitter | <ynfle> You think its a test? |
23:29:22 | FromDiscord | <ElegantBeef> Well it's a function call to one of them, and i cannot be arsed to reason which one |
23:29:48 | FromDiscord | <ElegantBeef> So if you could minify it to just each function being called that'd be great π |
23:48:19 | FromDiscord | <zetashift> sent a code paste, see https://play.nim-lang.org/#ix=3mrN |
23:48:21 | FromDiscord | <zetashift> How would I mark f as `noSideEffect`? |
23:50:28 | FromDiscord | <checkersai> In reply to @zetashift "How would I mark": To my knowledge you'd have to write `f: proc(s:string): Either {.noSideEffect.}` |
23:51:20 | FromDiscord | <checkersai> Because there's no syntax sugar for `func` types and `func` isn't allowed in type descriptions |
23:51:50 | FromDiscord | <zetashift> ah that breaks all my existing func signatures |
23:52:30 | FromDiscord | <ElegantBeef> I believe that is right and i think there is an RFC or PR out in the wild to allow it |
23:52:42 | FromDiscord | <zetashift> I could use a cast pragma to override it and use sugar/funcs |
23:52:44 | FromDiscord | <checkersai> It's annoying and I tried to work on that issue but I quickly got lost because I haven't worked on the compiler before |
23:52:48 | FromDiscord | <clyybber> In reply to @ElegantBeef "I believe that is": RFC but no PR afaik |
23:53:12 | FromDiscord | <checkersai> https://github.com/nim-lang/Nim/issues/11518 |
23:54:10 | FromDiscord | <checkersai> It'd be super cool if someone actually fixed this |
23:54:25 | FromDiscord | <clyybber> I'll take a look tomorrow |
23:56:08 | FromDiscord | <ElegantBeef> Oh clyybber you taking orders? π |
23:56:19 | FromDiscord | <zetashift> Could `->` even be "overloaded" for func types? |
23:56:28 | FromDiscord | <ElegantBeef> ~~Looks at the implict + explict generics failing to compile~~ |
23:57:32 | FromDiscord | <checkersai> In reply to @zetashift "Could `->` even be": You could write a custom macro |
23:58:03 | FromDiscord | <ElegantBeef> I had to try the cache stuff on fib(50) https://media.discordapp.net/attachments/371759389889003532/841464129508081694/unknown.png |
23:59:31 | FromDiscord | <zetashift> In reply to @checkersai "You could write a": ah I see |
23:59:39 | FromDiscord | <checkersai> I tried to get sugar for func types merged a while back but got rejected, but you can still adapt the code |
23:59:39 | FromDiscord | <checkersai> https://github.com/nim-lang/Nim/pull/13948/files |