00:00:04 | FromGitter | <Obround> Yeah... |
00:00:20 | Yardanico | i wonder what's your use-case |
00:01:35 | FromGitter | <Obround> Oh, I just need to make a nim FFI for a different language that compiles to nim. |
00:01:55 | Yardanico | I doubt you would need to dynamically execute Nim code then |
00:01:59 | Yardanico | if your language compiles to Nim |
00:03:44 | FromGitter | <Obround> Yeah but due to some *difficulties* I am unable to do that :( |
00:05:39 | clyybber | dynamically executing is certainly not the solution to your difficulties :) |
00:06:10 | clyybber | Obround: What difficulties? |
00:06:31 | FromDiscord | <mratsim> of course you can eval just do "import compiler/nimeval" |
00:06:35 | FromDiscord | <mratsim> 😛 |
00:06:47 | FromGitter | <Obround> Hmm... |
00:06:54 | FromDiscord | <mratsim> import compiler/nimeval |
00:06:54 | FromDiscord | <mratsim> echo "before" |
00:06:54 | FromDiscord | <mratsim> execute("echo 1+2") |
00:07:13 | FromGitter | <Obround> I'll look into that... |
00:07:17 | clyybber | mratsim: Not that you should, in a lang that compiles to nim tho. Seems unneccessary |
00:07:28 | FromDiscord | <mratsim> ah sorry it might be the old API: https://github.com/nim-lang/Nim/issues/7567 |
00:07:31 | disbot | ➥ compiler/nimeval execute fails with `Error: cannot open '$PWD/../lib/system.nim'` @11timotheecour; snippet at https://play.nim-lang.org/#ix=23JX |
00:07:53 | FromDiscord | <mratsim> the new one is in the test: https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim |
00:07:56 | * | gmpreussner joined #nim |
00:08:43 | shashlick | Obround which language |
00:09:00 | FromGitter | <Obround> It's a language I am creating... |
00:09:12 | FromGitter | <Obround> nimeval fails: `Error: cannot open file: compiler/nimeval` |
00:09:23 | FromDiscord | <mratsim> nimble install compiler |
00:09:50 | FromDiscord | <mratsim> but if you write a language why do you need a Nim interpreter? |
00:09:56 | shashlick | --path:"$nim" |
00:09:59 | shashlick | Don't need to install compiler |
00:09:59 | FromDiscord | <mratsim> just write an interpreter for your language in Nim? |
00:10:21 | FromGitter | <Obround> Ok... |
00:11:35 | FromGitter | <Obround> Oh, when I run the code after installing compiler I get this error: `Error: undeclared identifier: 'delEnv'` |
00:12:28 | FromDiscord | <mratsim> unfortunaly you are now treading in uncharted waters, Here be dragons |
00:15:32 | shashlick | Which file is complaining |
00:16:12 | FromGitter | <Obround> `C:\Users\Obround\.nimble\pkgs\compiler-0.20.0\compiler\scriptconfig.nim(122, 8)` |
00:17:14 | shashlick | You have an old compiler package, remove it and use $nim |
00:17:46 | shashlick | Bad idea to use an old package and newer Nim executable |
00:18:20 | shashlick | I don't know why there is a compiler package when compiler is right there and $nim exists |
00:18:39 | FromGitter | <Obround> Ok, how do I remove the old package |
00:19:27 | * | sealmove quit (Quit: WeeChat 2.6) |
00:20:40 | disruptek | shashlick: hmm, maybe we should fix that. i've been using compiler, too, and it's annoying. |
00:21:00 | disruptek | can we really rely upon $nim having compiler in it? |
00:21:06 | FromGitter | <Obround> This seems to work: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5deaf072d75ad3721d69158f] |
00:22:43 | FromGitter | <Obround> Compile with: `nim compile --verbosity:0 --hints:off --path:"$nim" -d:nimOldCaseObjects --run "c:\Users\Aditiya\Desktop\Cox\bundle\cox.nim"` |
00:24:52 | shashlick | Nim always ships with compiler |
00:25:07 | shashlick | It was part of the reason I removed compiler from nimble |
00:25:18 | disruptek | nice. |
00:25:22 | shashlick | nimble remove compiler |
00:25:42 | shashlick | I didn't know about $nim then |
00:25:56 | shashlick | Else that would have been the better fix |
00:28:09 | disruptek | wait, what? |
00:28:27 | disruptek | you removed the compiler from nimble because it ships with nim? |
00:38:09 | shashlick | Cause it conflicts with Nim since it could be out of sync |
00:38:25 | shashlick | Now nimble can work with any version of compiler |
00:38:47 | shashlick | In the past, compiler package had to match Nim executable |
00:43:53 | * | clyybber quit (Quit: WeeChat 2.6) |
00:51:31 | FromGitter | <aboisvert> are there pre-built nim (compiler) binaries for Raspberry Pi ? |
00:52:32 | Yardanico | I don't think so :( but you could cross-compile from your PC |
00:52:57 | Yardanico | actually wait |
00:53:00 | Yardanico | I am wrong |
00:54:12 | Yardanico | https://github.com/nim-lang/nightlies/releases |
00:54:37 | * | krux02_ joined #nim |
00:54:42 | Yardanico | Download from there (either latest dev build or a stable release) |
00:54:54 | FromGitter | <aboisvert> yeah i was just looking at that; trying to find stable release, thanks |
00:55:49 | Yardanico | https://github.com/nim-lang/nightlies/releases/tag/2019-11-26-version-1-0-97e0ce3 this is latest stable |
00:55:50 | Yardanico | 1.0.4 |
00:58:21 | FromGitter | <aboisvert> wouldn't it have the hash `c8998c4` based on https://github.com/nim-lang/Nim/tree/v1.0.4 |
00:58:32 | * | krux02 quit (Ping timeout: 268 seconds) |
00:59:03 | Yardanico | well it's almost the same :P |
00:59:27 | FromGitter | <aboisvert> alright, thanks! i'll go with your link, it has the right version number :) |
01:05:27 | FromDiscord | <mratsim> I hate it when untyped macros receive typed symbol :/ |
01:28:02 | rayman22201 | mratsim you are a macro god. Your explicit capture solution is blowing my mind right now! |
01:34:31 | shashlick | https://github.com/nim-lang/nightlies/releases/tag/2019-11-27-version-1-0-c8998c4 is the right one for 1.0.4 |
01:39:14 | FromGitter | <aboisvert> @shashlick ok, thanks for the clarification |
01:56:05 | * | jxy quit (Quit: Lost terminal) |
02:02:40 | * | lritter quit (Ping timeout: 268 seconds) |
02:02:55 | * | lritter joined #nim |
02:12:15 | FromDiscord | <mratsim> @rayman22201 😄 |
02:16:55 | * | Sargun quit (Changing host) |
02:16:55 | * | Sargun joined #nim |
02:26:49 | * | krux02_ quit (Remote host closed the connection) |
02:33:15 | * | sentreen quit (Ping timeout: 250 seconds) |
02:35:00 | * | sentreen joined #nim |
02:46:20 | * | lritter quit (Ping timeout: 265 seconds) |
02:52:56 | * | dwdv quit (Ping timeout: 240 seconds) |
03:46:41 | madprops | is there a nim way to check if a file is a text file? |
03:46:49 | disruptek | nah. |
03:47:03 | madprops | basically to avoid this http://i.imgur.com/ZiUsHdW.png |
03:48:28 | disruptek | the standard heuristic is to look for nulls, but you could just look for printable characters and a few control characters for newlines, tabs, etc. |
03:57:46 | yumaikas | So, I have a question with how one uses templates https://play.nim-lang.org/#ix=23KA |
03:58:38 | yumaikas | Basically, is it possible to write some for of splatting that dumps an object into the AST? |
04:03:38 | yumaikas | (basically, I'd like a macro/template that allows me to splat objects into a parameter list) |
04:07:50 | FromGitter | <mrgaturus> hi everyone, i want to do a PR for add these procs to bitops ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ sometimes someone needs check multiple flags/bits, writing `(v and mask) == mask` everywhere can be a bit awful. before publishing a PR, what do you think about it? [https://gitter.im/nim-lang/Nim?at=5deb2596b065c6433c50e45d] |
04:23:16 | madprops | disruptek: https://play.nim-lang.org/#ix=23KI |
04:23:21 | madprops | wonder if this is too inneficient |
04:24:42 | disruptek | how fast does it need to be? use sets, for one thing. |
04:25:00 | disruptek | {'a'..'z'} is helpful, too. |
04:25:15 | disruptek | i think strutils has some set constants you can use. |
04:25:23 | yumaikas | Anyone here familiar with how macros work? |
04:25:38 | * | rockcavera quit (Remote host closed the connection) |
04:25:57 | disruptek | you can splat objects into parameter lists, sure. |
04:26:21 | yumaikas | disruptek: I'm getting errors when I try to do it |
04:26:30 | disruptek | what kinda errors? |
04:26:45 | yumaikas | "Incorrect indentation" |
04:26:59 | yumaikas | when I try to write a template to do the splatting |
04:27:10 | yumaikas | But, I suspect my understanding of things is off |
04:27:50 | disruptek | i have a macro called `keyValueToHelp` to turns key/value pairs into the {foo: bar} help syntax used by cligen, another macro. |
04:27:56 | disruptek | !repo disruptek/gully |
04:27:57 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 1⭐ 0🍴 |
04:28:13 | disruptek | look at src/gully.nim for keyValueToHelp() |
04:28:47 | disruptek | it might be the opposite direction that you want to go in. there's way, way, more complex macro code in my openapi project. it's almost all macro. |
04:29:12 | disruptek | but it has procedure creation and stuff. |
04:29:16 | yumaikas | I think it is. I want to take one node and turn it into 4 |
04:29:16 | disruptek | !repo disruptek/openapi |
04:29:17 | disbot | https://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 9⭐ 0🍴 |
04:30:04 | disruptek | it's probably simpler than you think. |
04:30:32 | yumaikas | Probably, but that first attempt at using a template to do it doesn't parse |
04:30:48 | disruptek | i don't think you can use a template. |
04:31:11 | yumaikas | Fair enough |
04:33:32 | yumaikas | Is it possible for a macro to grab the parent node (the one around what it's invoked as?) |
04:34:13 | disruptek | by design, no. but there are really ill-advised methods around that. |
04:34:31 | disruptek | like looking up the filename and reading it... |
04:34:47 | madprops | dumb question but, how to i turn a string into a list of bytes? |
04:34:51 | yumaikas | And is that what I'd need to do to splat an object as one part of a varargs list? |
04:35:33 | yumaikas | madprops: Do you need to turn it into a list of bytes? I think strings are already effectively seq[char]? |
04:35:50 | madprops | basically i want to check for nulls .. 0x00 |
04:35:58 | madprops | or whatever null is |
04:36:21 | yumaikas | MyProc(a, b, varg1, splat(obj)) is what I'd like to be able to do |
04:36:42 | madprops | i guess null is \0 |
04:37:06 | yumaikas | and/or char should be castable to some appropriate integral type |
04:37:42 | yumaikas | disruptek: Is it possible to return multiple nodes from a macro? |
04:37:50 | yumaikas | without wrapping them up in a parent node? |
04:54:26 | * | yumaikas spots emit, and is intrigued |
04:59:40 | yumaikas | So... I don't think you can write a splat() that works in the middle of a varargs list... At least from what I can see. |
05:00:19 | yumaikas | Though, writing a template that takes the other args, and then puts all of them a greater list is easy enough |
05:02:45 | * | chemist69 quit (Ping timeout: 250 seconds) |
05:04:37 | * | chemist69 joined #nim |
05:08:15 | FromGitter | <watzon> How would one go about converting an int to a big endian byte array? |
05:08:36 | FromGitter | <watzon> I found `endians.bigEndian64`, but I don't quite get how to use it |
05:08:48 | * | nsf joined #nim |
05:09:48 | yumaikas | watzon: Mask/shift/copy? |
05:11:15 | FromGitter | <watzon> Basically I'm trying to replicate this simple Python code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5deb34725ac7f22fb575b64e] |
05:17:00 | yumaikas | watzon: I think you just get the bytes for that int64, and then swap them around |
05:17:24 | FromGitter | <watzon> Ahh ok, that would make sense. |
05:17:39 | yumaikas | https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/endians.nim#L58 |
05:17:53 | yumaikas | (Well, not that specific line, but reading that source seems instructive) |
05:17:59 | FromGitter | <watzon> Is there a better way to convert an int to a byte sequence than this? ⏎ `cast[seq[byte]](integer)` |
05:18:10 | * | yumaikas checks |
05:18:19 | yumaikas | Is that even legal? |
05:18:58 | FromGitter | <watzon> Lol idk. This is my first day back to nim after almost 2 years. I'm starting to realize I don't remember crap. |
05:19:48 | yumaikas | I don't know nim. I know that C# has methods for getting the encoding of a string and the like |
05:20:34 | yumaikas | Or, rather, I don't know what Nim provides here |
05:21:02 | FromGitter | <watzon> Not much from what I've found |
05:22:08 | yumaikas | What's the context for what you're trying to do? |
05:22:51 | FromGitter | <yumaikas> (Trying from here, for notifications) |
05:23:13 | FromGitter | <watzon> Trying to implement the MTProto protocol |
05:23:25 | FromGitter | <watzon> Which means a lot of byte manipulation |
05:24:37 | FromGitter | <yumaikas> Indeed. At least there should be a decent amount of support for defining operators and procs here. |
05:25:10 | FromGitter | <watzon> Oh definitely |
05:25:46 | FromGitter | <watzon> Nim is an awesome language, we just seem to be missing some of the higher level features that make Python so easy to use |
05:26:02 | FromGitter | <watzon> Which is to be expected, but I thought this would be easier 😂 |
05:27:14 | FromGitter | <yumaikas> Maybe something in streams? Though that will probably be pretty heavy |
05:27:39 | FromGitter | <dumjyl> cast to an `array[sizeof(T), byte]` |
05:28:04 | shashlick | Use UncheckedArray |
05:28:33 | FromGitter | <watzon> Got an example of how to do so shashlick? |
05:29:24 | FromGitter | <yumaikas> One that doesn't throw errors like this one? https://play.nim-lang.org/#ix=23KY |
05:31:02 | FromGitter | <watzon> This seems to work for the cast https://play.nim-lang.org/#ix=23KY |
05:31:12 | FromGitter | <watzon> But what about the endianness? |
05:32:17 | FromGitter | <yumaikas> When I run your link, it crashes in the playground with SIGSEGV |
05:32:27 | FromGitter | <watzon> Weird |
05:33:19 | FromGitter | <yumaikas> https://play.nim-lang.org/#ix=23KZ |
05:33:28 | FromGitter | <yumaikas> There, that should work |
05:34:12 | FromGitter | <watzon> Yeah now I just need to figure out `endians.bigEndian64` |
05:34:57 | FromGitter | <yumaikas> For the endianness, just refer to the source code for the endians module (for now, anyway) |
05:36:52 | FromGitter | <yumaikas> As long as endianess is at the byte level, rather than the nibble level, I think you can reverse the array |
05:38:07 | FromGitter | <yumaikas> That's *if* your program is compiled on a small-endian processor |
05:38:25 | FromGitter | <yumaikas> endians is designed to work with pointers, from what I can tell, not integers |
05:38:27 | FromGitter | <yumaikas> as such |
05:41:49 | shashlick | cast[UncheckedArray[byte]](xyz) |
05:42:17 | shashlick | Advantage is that array has to be fixed size |
05:42:30 | shashlick | But that may not work with C status |
05:42:36 | FromGitter | <yumaikas> shashlick: Why UncheckedArray, rather than just Array[]? |
05:44:18 | FromGitter | <watzon> Hmm idk, I'm giving up for tonight haha. I've been dealing with this headache for too long. |
05:44:41 | FromGitter | <yumaikas> good night. |
05:44:57 | FromGitter | <watzon> In Crystal this is super easy ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5deb3c5832df1245cbf9cef9] |
05:47:26 | FromGitter | <yumaikas> Nim is young, you could make a PR once you figure it out |
05:47:31 | rayman22201 | @yumaikas: https://play.nim-lang.org/#ix=23L2 |
05:48:03 | rayman22201 | lets you put the splat wherever you want |
05:48:32 | rayman22201 | have to hardcode the field names though. I don't like that. I need to figure out how to get untyped and typed to work together |
05:49:27 | FromGitter | <yumaikas> rayman22201: That's kinda neat, though it's from the outside. I ended up going with something less pretty |
05:50:12 | rayman22201 | think of it like a function decorator from python :-P |
05:50:34 | FromGitter | <yumaikas> lol, one that's rather underpowered |
05:51:22 | FromGitter | <yumaikas> I think I'd make a template that returned a tuple, call that splat |
05:51:45 | FromGitter | <yumaikas> And then some name for the macro that flattened tuples in arg lists |
05:52:05 | rayman22201 | I don't see how it's underpowered, it's macros, infinite power :-P |
05:52:25 | FromGitter | <yumaikas> I meant that macro in particular |
05:52:41 | FromGitter | <yumaikas> splat/unpack, I think is how I'd do it |
05:54:03 | rayman22201 | both macros and templates have to return a single node, so that's kind of your limitation there |
05:54:35 | FromGitter | <yumaikas> Yeah, that's what I realized after staring at it all for about an hour or so |
05:55:47 | rayman22201 | there is also this: https://github.com/technicallyagd/unpack |
05:56:53 | shashlick | Array cast needs a length which you might not know at compile time |
05:56:56 | shashlick | Hence unchecked |
05:57:28 | FromGitter | <yumaikas> shashlick: If we're working with integral types, we should know |
05:57:40 | FromGitter | <yumaikas> rayman22201: That looks pretty cool |
06:13:48 | shashlick | Sure yes |
06:18:54 | FromDiscord | <yewpad> https://play.nim-lang.org/#ix=23L5 |
06:30:09 | * | endragor joined #nim |
06:42:12 | rayman22201 | @yumaikas, you are probably asleep now, but I made it better. It now figures out the type automagically: https://play.nim-lang.org/#ix=23L7 |
06:44:02 | rayman22201 | I love writing macros. It's probably my second favorite hobby X.X |
07:01:23 | * | solitudesf joined #nim |
07:01:45 | rayman22201 | Thinking about it more, with a bit more work This macro can decorate any expression. It doesn't have to be just function calls. It's not underpowered at all. |
07:20:39 | Araq | rayman22201: https://github.com/nim-lang/Nim/pull/12823 !!! |
07:20:40 | disbot | ➥ ARC: cycle detector 👑11Araq |
07:28:27 | rayman22201 | Christmas presents ❤️ |
07:31:45 | FromDiscord | <Rika> I read recently that the rust folks are into madoka magica, so I wonder if (founder, don't wanna ping him for something unimportant) is into an anime |
07:35:47 | Araq | does Avatar count? |
07:37:07 | Araq | the last air bender |
07:56:01 | * | dddddd quit (Ping timeout: 268 seconds) |
07:59:06 | * | solitudesf quit (Ping timeout: 268 seconds) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:52 | * | gmpreussner joined #nim |
08:36:00 | FromGitter | <zacharycarter> pbr textures are going to be an interesting problem to solve for my map rendering solution |
08:36:23 | FromGitter | <zacharycarter> if I wasn't trying to support macOS this would be a lot easier |
09:29:23 | * | nif quit (Quit: ...) |
09:29:33 | * | nif joined #nim |
09:30:32 | FromDiscord | <Rika> Good enough of an answer haha |
09:32:54 | FromDiscord | <itmuckel> @Zachary Carter What are you building? |
09:33:23 | FromGitter | <zacharycarter> itmuckel: a 3d RTS game |
09:33:45 | FromDiscord | <itmuckel> |
09:33:45 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/652804931870523402/pikachu.png |
09:33:51 | FromGitter | <zacharycarter> https://i.imgur.com/SC4WiAJ.mp4 |
09:34:01 | FromGitter | <zacharycarter> is my map renderer at the moment |
09:34:37 | FromDiscord | <itmuckel> very nice! 👍 |
09:34:40 | FromGitter | <zacharycarter> right now I'm using textures without mips that you can find on google images |
09:34:41 | FromGitter | <zacharycarter> thanks |
09:34:53 | FromGitter | <zacharycarter> I store them in a 2d texture array and sample from that in my fragment shader |
09:34:59 | FromDiscord | <Rika> macOS sucks because they're deprecating opengl for metal |
09:35:11 | FromDiscord | <itmuckel> @Rika yeah, so funny^^ |
09:35:13 | FromDiscord | <Rika> Which I don't see the reason to |
09:35:26 | FromGitter | <zacharycarter> of course, if I want to support PBR materials - I'm going to have a lot more textures |
09:35:59 | FromGitter | <zacharycarter> so now I'm looking at using texture atlases for each type of texture I will have and store arrays of those |
09:35:59 | FromDiscord | <itmuckel> zachary, is there a github/gitlab-link? |
09:36:09 | FromGitter | <zacharycarter> but if they're too large, I might have to use virtual textures |
09:36:28 | FromGitter | <zacharycarter> sure: https://github.com/zacharycarter/zeal |
09:36:36 | FromGitter | <zacharycarter> I'm using bgfx so on macos I'll be using metal |
09:36:50 | FromGitter | <zacharycarter> this wouldn't be a problem if I just didn't want to target macos - but then I'd just use OpenGL and bindless textures |
09:53:42 | FromGitter | <kayabaNerve> Anyone here know how to resolve a "conflicting types" GCC error when working with Nim's FFI? ⏎ ` 62 | N_NIMCALL(void, BIG_384_58_rcopy)(BIG_384_58 x, BIG_384_58 y);` ⏎ ` 159 | extern void BIG_384_58_rcopy(BIG_384_58 x,const BIG_384_58 y);` ⏎ AFAICT the only difference is one is const. [https://gitter.im/nim-lang/Nim?at=5deb76a5d75ad3721d6ca28e] |
09:53:55 | FromGitter | <kayabaNerve> I also have no idea how to get Nim to use use a const signature. |
09:54:11 | FromGitter | <kayabaNerve> I also thought const didn't matter as it generally doesn't when calling. |
09:57:11 | FromGitter | <kayabaNerve> Eh. Declaring a new type and writing const X in the importc section worked. Just annoying as the two types register as different. |
10:01:03 | Zevv | IS there a stdlib function to convert a hslice to a seq? 5..9 -> @[5, 6, 7, 8, 9] ? |
10:03:24 | Zevv | oh, toSeq :) |
10:05:17 | * | thomasross_ joined #nim |
10:05:17 | * | thomasross is now known as Guest50801 |
10:05:17 | * | thomasross_ is now known as thomasross |
10:07:23 | * | Guest50801 quit (Ping timeout: 250 seconds) |
10:08:09 | FromGitter | <zacharycarter> wtfffff |
10:08:09 | FromGitter | <zacharycarter> https://play.nim-lang.org/#ix=23Lz |
10:10:01 | FromGitter | <zacharycarter> windows is doing weird shit I feel like |
10:13:17 | FromGitter | <zacharycarter> copied values from calculator into vscode and Nim compiler goes bonkers :P |
10:18:38 | lqdev[m] | @zacharycarter time to start using GNU calc ;) |
10:23:27 | * | nc-x joined #nim |
10:23:29 | nc-x | @zacharycarter https://github.com/microsoft/calculator/issues/504 |
10:23:30 | disbot | ➥ Copy paste result contains hidden character @11Cerlancism |
10:25:54 | * | nc-x quit (Remote host closed the connection) |
10:39:10 | FromGitter | <zacharycarter> lol wonderful |
11:13:39 | * | endragor quit (Remote host closed the connection) |
11:22:03 | * | endragor joined #nim |
11:22:55 | * | Trustable joined #nim |
11:24:43 | * | dwdv joined #nim |
11:26:15 | * | endragor quit (Ping timeout: 250 seconds) |
11:31:45 | Araq | yay only 4 test failures, pretty good |
11:33:32 | * | lritter joined #nim |
11:35:25 | FromDiscord | <Rika> Why even use calculator if there's repl |
11:35:42 | FromDiscord | <Rika> (doesn't have to be nim repl; after all, it's just calculations) |
11:40:42 | * | vivus joined #nim |
11:41:56 | * | solitudesf joined #nim |
11:43:42 | * | nif quit (Quit: ...) |
11:43:51 | * | nif joined #nim |
11:52:06 | madprops | wondering if there's a way to avoid using the 'var's here https://play.nim-lang.org/#ix=23LT |
11:52:18 | madprops | like making the stuff inside 'try' part of the outer scope |
11:52:22 | madprops | though maybe that's not a good idea |
11:57:55 | Araq | I think it's impossible but I feel your pain ;-) |
11:58:27 | madprops | probably not impossible, but maybe not advisable |
11:58:46 | madprops | btw, is it actually possible to have some sort of flag to know it's the last iteration of a loop? |
11:58:58 | madprops | if last: do_stuff() something like that |
11:59:00 | madprops | that would be awesome |
11:59:07 | madprops | right now only way is comparing the index |
12:03:30 | Araq | I usually use |
12:03:41 | Araq | if i > 0: s.add(separator) |
12:03:58 | Araq | as the first iteration is easier to detect than the last |
12:04:12 | Araq | but neither first nor last iterations have any shortcuts |
12:09:14 | madprops | guessing that would be too much overhead |
12:12:06 | Araq | it's more a problem like "I have no clue how to implement it" |
12:12:41 | Araq | first iteration is easy, but how the heck do we know in general that it'll be the "last" iteration? |
12:13:33 | madprops | no idea. the compiler is like magic to me |
12:14:49 | Zevv | there actually *is* magic in the compiler! |
12:18:36 | FromDiscord | <Rika> Magic pragma lmao |
12:19:13 | FromDiscord | <Rika> Pragmas are still a mystery to me because the docs for it are scattered around from my experience |
12:19:16 | FromDiscord | <Rika> Maybe I'm just dumb |
12:22:49 | * | BitPuffin quit (Quit: killed) |
12:22:52 | * | macsek1911[m] quit (Quit: killed) |
12:22:53 | * | shashlick[m] quit (Quit: killed) |
12:22:54 | * | LEdoian[m] quit (Quit: killed) |
12:22:54 | * | meff[m] quit (Quit: killed) |
12:23:02 | * | nergal[m]1 quit (Quit: killed) |
12:23:02 | * | isaac[m]1 quit (Quit: killed) |
12:23:06 | * | zacharycarter[m] quit (Quit: killed) |
12:23:06 | * | TheManiac[m] quit (Quit: killed) |
12:23:08 | * | Demos[m] quit (Quit: killed) |
12:23:09 | * | GitterIntegratio quit (Quit: killed) |
12:23:09 | * | lqdev[m] quit (Quit: killed) |
12:23:13 | * | pigmej quit (Quit: killed) |
12:23:17 | * | planetis[m] quit (Quit: killed) |
12:23:17 | * | skrylar[m] quit (Quit: killed) |
12:23:17 | * | salotz[m] quit (Quit: killed) |
12:23:19 | * | xomachine[m] quit (Quit: killed) |
12:23:20 | * | lasso[m] quit (Write error: Connection reset by peer) |
12:23:20 | * | Connor[m] quit (Write error: Connection reset by peer) |
12:23:20 | * | Mike[m]2 quit (Write error: Connection reset by peer) |
12:23:22 | * | Balu[m] quit (Quit: killed) |
12:23:22 | * | Miguelngel[m] quit (Quit: killed) |
12:23:22 | * | Manny8888 quit (Quit: killed) |
12:23:24 | * | nc-x[m] quit (Quit: killed) |
12:23:24 | * | yglukhov[m] quit (Quit: killed) |
12:23:24 | * | spymasterd[m] quit (Quit: killed) |
12:29:45 | FromDiscord | <mratsim> @Rika Puella Magicka Madoka was really nice 🙂 |
12:30:09 | FromDiscord | <yewpad> Yeah, Pragmas really could use better docs |
12:32:14 | FromDiscord | <mratsim> so how does cycle detection work @Araq? Are you painting GC-ed types in different colors and collecting them when you have a rainbow? https://github.com/nim-lang/Nim/pull/12823/files#diff-6ad8f4cae76b10fd19f3d9bddb5a4035R39-R41 |
12:32:16 | disbot | ➥ ARC: cycle detector 👑11Araq |
12:32:50 | FromDiscord | <mratsim> ah, found the paper: https://pdfs.semanticscholar.org/f2b2/0d168acf38ff86305809a55ef2c5d6ebc787.pdf |
12:33:45 | FromDiscord | <mratsim> I'm curious, what does Swift use? |
12:36:08 | FromDiscord | <mratsim> seems like Swift pushed the problem on the dev |
12:48:30 | FromDiscord | <itmuckel> Hey guys! Is there an iterator where I can take the address of the items? |
12:48:30 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/652853940299497473/unknown.png |
12:51:23 | solitudesf | mitems |
12:51:27 | FromDiscord | <exelotl> ^ |
12:56:28 | FromDiscord | <itmuckel> Nice, thx! |
12:58:34 | FromDiscord | <itmuckel> Now how do I get the address of the thing I just added? 🤔 |
12:58:34 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/652856475760459810/unknown.png |
12:59:30 | FromDiscord | <Rika> Do you need the address |
12:59:35 | FromDiscord | <Rika> Or do you just want to change the item |
12:59:44 | FromDiscord | <Rika> mitems stands for mutable items |
12:59:57 | FromDiscord | <Rika> You can change the yielded item itself |
13:00:26 | FromDiscord | <Rika> Does it have to be a pointer too? Can you make it a reference |
13:00:46 | FromDiscord | <Rika> Maybe that last message is pushing it already |
13:00:59 | * | nergal[m]1 joined #nim |
13:00:59 | * | lqdev[m] joined #nim |
13:00:59 | * | Demos[m] joined #nim |
13:01:00 | * | isaac[m]1 joined #nim |
13:01:00 | * | leorize[m] joined #nim |
13:01:00 | * | k0mpjut0r joined #nim |
13:01:00 | * | GitterIntegratio joined #nim |
13:01:01 | * | BitPuffin joined #nim |
13:01:06 | * | meff[m] joined #nim |
13:01:06 | * | pigmej joined #nim |
13:01:06 | * | zacharycarter[m] joined #nim |
13:01:06 | * | spymasterd[m] joined #nim |
13:01:06 | * | salotz[m] joined #nim |
13:01:06 | * | lasso[m] joined #nim |
13:01:06 | * | LEdoian[m] joined #nim |
13:01:06 | * | zielmicha[m]1 joined #nim |
13:01:07 | * | Manny8888 joined #nim |
13:01:07 | * | skrylar[m] joined #nim |
13:01:07 | * | nc-x[m] joined #nim |
13:01:07 | * | shashlick[m] joined #nim |
13:01:07 | * | joachimschmidt55 joined #nim |
13:01:07 | * | Mike[m]2 joined #nim |
13:01:07 | * | Connor[m] joined #nim |
13:01:07 | * | planetis[m] joined #nim |
13:01:07 | * | macsek1911[m] joined #nim |
13:01:07 | * | xomachine[m] joined #nim |
13:01:07 | * | Balu[m] joined #nim |
13:01:07 | * | TheManiac[m] joined #nim |
13:01:07 | * | yglukhov[m] joined #nim |
13:01:07 | * | Miguelngel[m] joined #nim |
13:01:08 | * | d-nice2[m] joined #nim |
13:01:09 | * | thomasross quit (Ping timeout: 250 seconds) |
13:01:25 | Yardanico | matrix<->freenode bridge still sometimes goes down and up? lol |
13:01:44 | FromDiscord | <itmuckel> Well I have a Model that I want to store the textures and multiple Meshes that reference these textures, so I don't store the same texture multiple times. |
13:01:44 | FromDiscord | <itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/652857260887769098/unknown.png |
13:02:07 | Yardanico | @itmuckel why are you using ptr Texture? |
13:02:16 | Yardanico | you should really only use `ptr` when using FFI |
13:02:18 | Yardanico | there's `ref` in Nim |
13:02:22 | FromDiscord | <Rika> Yeah |
13:02:30 | FromDiscord | <Rika> Was gonna ask are you interfacing with C |
13:02:47 | Yardanico | well he's obviously using OpenGL judging by the code |
13:02:47 | FromDiscord | <itmuckel> I do, but not in this section of my code^^ |
13:03:16 | FromDiscord | <Rika> Remake OpenGL in nim :) |
13:04:25 | Yardanico | @itmuckel so you don't really need `ptr` here, do you? :P |
13:05:09 | Yardanico | you can also make your Texture a `ref object` so it will always be a reference to an object without specifying it elsewhere |
13:05:14 | * | thomasross joined #nim |
13:05:35 | FromDiscord | <Rika> Oh yeah Yardanico how did you make test cases for your osu replay parser |
13:05:48 | FromDiscord | <Rika> I'm having difficulty making test cases for my code |
13:07:51 | Yardanico | @Rika I just test on one cookiezi's 817pp play and comparing the fields |
13:08:01 | Yardanico | https://github.com/Yardanico/nim-osureplay/blob/master/tests/tester.nim I'm using Nim's stdlib unittest module |
13:08:35 | FromDiscord | <Rika> So only an integration test... |
13:08:38 | FromDiscord | <Rika> Damn |
13:08:42 | Yardanico | yeah, nothing serious :P |
13:08:50 | FromDiscord | <itmuckel> @Yardanico Uhm, okay, so now I made my Texture a `ref object`. What are the implications? When I assign it to another Texture no copy is made, but the other Texture points to the same Texture, right? |
13:08:54 | FromDiscord | <Rika> I need unit tests ;; |
13:09:04 | FromDiscord | <Rika> Yeah itmuckel |
13:09:20 | FromDiscord | <Rika> I like to think that refs are heap pointers (idk if it's correct) |
13:09:26 | FromDiscord | <itmuckel> Nice, exactly what I needed. 👍 |
13:09:27 | FromDiscord | <Rika> And that assigning is always copy |
13:09:42 | FromDiscord | <Rika> So it copies the heap pointer |
13:09:48 | FromDiscord | <Rika> That's my idea at leadt |
13:09:51 | FromDiscord | <Rika> It works for me |
13:09:57 | FromDiscord | <Rika> Idk if it's correct though |
13:10:05 | FromDiscord | <Rika> Would like corrections if needed |
13:10:18 | FromDiscord | <itmuckel> I think that they resemble Java Objects. They live on the heap and if nothing points to them anymore, then they get garbage collected. |
13:10:32 | FromDiscord | <exelotl> should it be possible to do something like this? `for filePath in walkFiles(root/"fonts"/"*.c|h"):` |
13:10:47 | FromDiscord | <Rika> It looks correct to me |
13:10:56 | FromDiscord | <Rika> Wait |
13:11:07 | FromDiscord | <Rika> The | character is an or? |
13:11:11 | FromDiscord | <Rika> Hmm |
13:11:14 | FromDiscord | <Rika> Don't think so |
13:11:29 | Yardanico | @exelotl from the docs: "On POSIX this uses the glob call. pattern is OS dependent, but at least the "*.ext" notation is supported." |
13:11:41 | Yardanico | so if you're using it for linux then you can just use glob's patterns I guess |
13:11:58 | FromDiscord | <Rika> Won't be portable tho |
13:12:06 | FromDiscord | <exelotl> oh yeah I read that, but I'm on windows and I don't know what's supported there x) |
13:12:21 | FromDiscord | <Rika> Maybe just use an if inside the loop |
13:12:59 | Yardanico | https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/os.nim#L1735 that's what windows implementation uses |
13:13:58 | FromDiscord | <Rika> Almost made the mistake opening github on mobile again |
13:14:18 | * | vivus quit (Quit: Leaving) |
13:16:12 | FromDiscord | <exelotl> oh yeah tbh the directory only contains c and h files so I guess I'm fine anyways |
13:16:48 | * | vivus joined #nim |
13:30:08 | lqdev[m] | @Rika change your browser. |
13:30:22 | lqdev[m] | github mobile only lags on chrome. |
13:30:53 | FromGitter | <auxym> Hm, I have a `func` that does nothing but call another `func`. `func1` compiles fine, then `func2` says it has side effects. Does this sound like a compiler bug? |
13:31:42 | Yardanico | can you show the code? |
13:32:09 | Yardanico | maybe func2 has side effecst? |
13:32:13 | Yardanico | *effects |
13:34:04 | FromDiscord | <Rika> lqdev see I would but I already have uh |
13:34:09 | FromDiscord | <Rika> Maybe 200 tabs in chrome |
13:34:14 | FromDiscord | <Rika> That would be a pain to move |
13:34:22 | FromDiscord | <Rika> Though I use Firefox on my pc |
13:34:37 | FromDiscord | <Rika> (I uh have a tab obsession I guess) |
13:35:19 | FromDiscord | <Rika> Auxym, does func2 return the same type as func1 |
13:35:37 | FromDiscord | <Rika> Assuming 2 is the one inside 1 |
13:36:29 | FromGitter | <auxym> I'll try to put together a minimal example |
13:36:38 | FromGitter | <auxym> working on today's aoc :o |
13:38:23 | * | rockcavera joined #nim |
13:39:22 | FromGitter | <auxym> welp, forget that: I was reading a global from `func2`. moar coffee required. |
13:42:19 | * | njoseph quit (Ping timeout: 250 seconds) |
13:44:05 | * | njoseph joined #nim |
13:54:47 | * | thomasross_ joined #nim |
13:54:47 | * | thomasross quit (Killed (wolfe.freenode.net (Nickname regained by services))) |
13:54:47 | * | thomasross_ is now known as thomasross |
13:59:22 | * | clyybber joined #nim |
14:05:38 | * | nixfreak joined #nim |
14:11:58 | disruptek | what's shakin', nimions? |
14:12:15 | disruptek | need some good news today. |
14:18:16 | livcd | resting on this day |
14:18:31 | livcd | just trying to make old nim and old sciter bindings to work |
14:22:51 | FromGitter | <kayabaNerve> I'm replacing a bad library with a not-bad library. |
14:24:57 | disruptek | oh? |
14:25:38 | disruptek | link? |
14:28:01 | * | tane joined #nim |
14:30:51 | * | thomasross quit (Ping timeout: 250 seconds) |
14:36:56 | * | thomasross joined #nim |
14:46:07 | FromGitter | <kayabaNerve> disruptek: To the bad library or the not so bar library? :P |
14:46:19 | disruptek | yes. 😛 |
14:46:27 | * | Trustable quit (Remote host closed the connection) |
14:46:50 | FromGitter | <kayabaNerve> Lol. The library isn't bad. It just has a lot of design choices I disagree with and I'm not happy with the developer's speed towards resolving issues. |
14:47:19 | FromGitter | <kayabaNerve> You can't use it in Nim without patching. Why? They made the constructors private. Because of that, you can't declare `TYPE x;`, like Nim does. |
14:47:39 | disruptek | oi. |
14:47:42 | FromGitter | <kayabaNerve> So I'm using it with pointers, total mem leak, but it requires a patch to work properly with pointers. |
14:47:56 | FromGitter | <kayabaNerve> https://github.com/chia-network/bls-signatures |
14:48:10 | disruptek | how is private a thing we need to worry about? |
14:48:33 | FromGitter | <kayabaNerve> I don't blame them at all to be clear. They've made certain design decisions for their flow for a library used in their work. I respect that. I just can't use them :P |
14:48:47 | disruptek | yeah, i get it. |
14:49:09 | FromGitter | <kayabaNerve> Nim declares variables in certain circumstances as `TYPE x;`, waiting to do the initialization till later |
14:49:28 | FromGitter | <kayabaNerve> That calls the constructor in C++. |
14:49:55 | FromGitter | <kayabaNerve> If you don't want to call the constructor, you need to make it a pointer. Then when you have the pointer version, you can do your work, except their library doesn't support pointered classes. |
14:50:15 | disruptek | i'm just thinking... maybe we can unprivatize stuff. |
14:50:24 | FromGitter | <kayabaNerve> I literally have a patch file in my Nim repo so it works with Nim. Pretty sure said patch is another mem leak so I never submitted it pack. |
14:50:40 | FromGitter | <kayabaNerve> Multiple users have commented. Nothing's changed. They have their flow |
14:51:03 | FromGitter | <kayabaNerve> I'm moving to a different library called Milagro from Apache. Not as friendly, much better overall. |
14:51:09 | disruptek | their library doesn't support pointered classes? |
14:51:46 | FromGitter | <kayabaNerve> Nah, something about the zeroed memory I'd guess. You need to add a line to recreate one of the fields to the... Clear? function |
14:51:53 | FromGitter | <kayabaNerve> I think that's what they called it. |
14:52:27 | FromGitter | <kayabaNerve> Sorry, you have to add it to the assignment operator. |
14:52:36 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5debbcb326eeb8518f808a0a] |
14:52:59 | disruptek | are you saying that they require zero'd memory? |
14:53:08 | disruptek | 'cause it sounds like you're saying the opposite. |
14:53:25 | FromGitter | <kayabaNerve> No, I'm saying that there's a difference between a malloc'd class instance and one of their class instances and I have no idea what it is. |
14:53:54 | disruptek | ah. and you can't do the alloc yourself. |
14:53:58 | FromGitter | <kayabaNerve> *alloc'd. Wasn't there a whole discussion about alloc != malloc in Nim? |
14:54:21 | FromGitter | <kayabaNerve> My only assumption is because the alloc returns 0'd memory (I at least use alloc0), that must be causing the problem. |
14:54:39 | FromGitter | <kayabaNerve> And because they don't actually provide a way to recover AFAICT... patch file it is |
14:54:48 | FromGitter | <kayabaNerve> I also have never successfully built it on Windows. |
14:54:59 | disruptek | i saw some partial-object-nonzero'd patch go through recently. |
14:55:08 | FromGitter | <kayabaNerve> Wait, nope, I did one time. I just couldn't link it after I built it and verify I built it into an usable lib. |
14:55:10 | disruptek | so i know some prior-0 is now -unzero. |
14:55:54 | disruptek | but i feel like there's probably an easy way around this. |
14:56:03 | FromGitter | <kayabaNerve> Patch file? |
14:56:13 | disruptek | like use their alloc in your own nim memory region, or something. |
14:56:32 | FromGitter | <kayabaNerve> There's also other reasons I'm ditching the lib to be clear |
14:56:52 | disruptek | right, water under the bridge. 😊 |
14:57:08 | FromGitter | <kayabaNerve> A/B can be used interchangably for X/Y. They use A for X and B for Y. I want to use A for Y and B for X. |
14:57:28 | FromGitter | <kayabaNerve> I trust Apache more than I trust them. Apache also offers their lib in multiple other languages. |
14:57:45 | FromGitter | <kayabaNerve> Speed concerns... |
14:58:08 | disruptek | right, so that helps fix bugs. |
14:58:28 | FromGitter | <kayabaNerve> So what are you up to? |
14:58:47 | disruptek | i might implement a Never operator in nimph. |
14:59:03 | disruptek | like version != 1.2.3 |
14:59:53 | FromGitter | <kayabaNerve> Sounds interesting. |
14:59:56 | * | Vladar joined #nim |
15:00:05 | disruptek | i'm still learning how to use linked C stuff with varied memory patterns. |
15:00:21 | disruptek | don't feel like i have a good pattern yet. |
15:00:30 | FromGitter | <kayabaNerve> GL |
15:00:54 | disruptek | i wanna try using the effects system to hint. |
15:01:30 | FromGitter | <kayabaNerve> I don't think I've ever seen anyone do a custom effect |
15:01:42 | FromGitter | <kayabaNerve> I've debated doing them to mark my FFI functions. |
15:02:07 | disruptek | i didn't mess with them because raises[] was an early bane of my existence. |
15:02:25 | * | kungtotte quit (Quit: WeeChat 2.6) |
15:02:28 | disruptek | but it's really an orthogonal problem. |
15:02:31 | FromGitter | <kayabaNerve> I actually love raises lol |
15:02:55 | disruptek | yeah, i think we talked about the problems with it before. didn't you write a macro to fix it? |
15:03:11 | * | vivus quit (Quit: Leaving) |
15:03:23 | FromGitter | <kayabaNerve> A macro where every function must compile with a blank raises if all the raise stmts are commented :P It stops bubble up. |
15:03:34 | disruptek | i just don't want to have to support core language features myself; that feels like a dangerous recipe for disaster. |
15:04:17 | * | thomasross_ joined #nim |
15:04:17 | * | thomasross is now known as Guest71747 |
15:04:17 | * | thomasross_ is now known as thomasross |
15:04:20 | FromGitter | <kayabaNerve> That said, I plan on moving to a Result system that offers the same syntax of Exceptions. I love saying raises/try/except but I have way too many `except Exception` thanks to async. With Result, I could use enums and have Nim's switch force every case be covered. Nothing would drop out of my sight thanks to Exception blindly catching everything... |
15:04:45 | FromGitter | <kayabaNerve> ... ngl, that does. |
15:05:03 | FromGitter | <kayabaNerve> You can always ship a set of patch files with your Nim work! |
15:05:03 | disruptek | i love case. use a ton of enum stuff, ranges, etc. |
15:05:23 | FromGitter | <kayabaNerve> *From experience, I can confirm that's a bad idea* |
15:05:50 | FromGitter | <kayabaNerve> Nim's forced handling of ordinals really lines up with my goals. |
15:05:57 | disruptek | yeah. |
15:06:04 | FromGitter | <kayabaNerve> That said, there's a lot of problems. |
15:06:21 | disruptek | but exceptions... just not what i'm after. |
15:06:23 | * | Guest71747 quit (Ping timeout: 250 seconds) |
15:06:36 | disruptek | i want exceptions to be exceptional. |
15:06:41 | FromGitter | <kayabaNerve> If you want one try catch to cover multiple statements which have different enums, or you want short circuiting (if x and y where if not x, y is not run) |
15:07:23 | disruptek | you can use `of {A, B}:` in case. |
15:07:32 | disruptek | also just `of A, B:` |
15:07:32 | FromGitter | <kayabaNerve> TIL |
15:07:38 | FromGitter | <kayabaNerve> That one I new of |
15:07:44 | disruptek | but the sets make things more interesting. |
15:07:45 | FromGitter | <kayabaNerve> *knew, sorry |
15:07:54 | FromGitter | <kayabaNerve> I'll send you the link to my next iteration of ForceCheck when I do it if you want ;) |
15:08:07 | disruptek | i have it starred in gist. 👍 |
15:11:08 | FromGitter | <kayabaNerve> To think I'd end up siding with arnetheduck after disagreeing so much with him in the past. |
15:12:12 | disruptek | i usually agree with him. 😝 |
15:12:25 | disruptek | he's pretty practical. |
15:16:09 | * | nsf quit (Quit: WeeChat 2.6) |
15:21:15 | FromGitter | <kayabaNerve> I think my main issue was when I said I wanted an Exception thing and his solution was not use Exceptions |
15:21:31 | FromGitter | <kayabaNerve> *don't use. Typos -_- |
15:21:59 | FromGitter | <kayabaNerve> Even now, I still want Exceptions (try/catch). I just want it to actually be results pretending to be exceptions. |
15:22:03 | disruptek | well, yeah. but, i agree that they are rarely the right tool. |
15:22:16 | disruptek | see, i think that's wrong-headed. |
15:22:40 | FromGitter | <kayabaNerve> I think my main issue with raw results would be their verbosity. |
15:22:48 | FromGitter | <kayabaNerve> A switch around every statement? |
15:22:59 | disruptek | sure? |
15:23:20 | FromGitter | <kayabaNerve> Eh. Seems very verbose. |
15:23:22 | disruptek | do you like the way go does it? |
15:23:37 | FromGitter | <kayabaNerve> I think right now I average one try/except per 8 lines of code right now. |
15:23:49 | FromGitter | <kayabaNerve> Probably raise two types of exceptions on averager |
15:24:03 | disruptek | you're bananas. |
15:24:15 | clyybber | quirky excpetions are kinda like results pretending to be exceptions |
15:24:21 | clyybber | they behave in the same way |
15:24:34 | disruptek | most of my exceptions are Defects 😁 |
15:24:51 | disruptek | yeah, quirky i like. i just think it should be default. |
15:24:58 | FromGitter | <kayabaNerve> clybber: Yeah, I actually really liked quirky exceptions. Didn't they not actually do anything though? |
15:25:05 | FromGitter | <kayabaNerve> Like you had to manually call return? |
15:25:07 | disruptek | otherwise, it's not clear how to share code. |
15:25:29 | FromGitter | <kayabaNerve> I've commented before quirky + X would be perfect, and I think X was automatically return. |
15:25:30 | clyybber | kayabaNerve: Exactly, they don't disrupt control flow. You have to manually return |
15:25:44 | FromGitter | <kayabaNerve> Side note, I've never looked into Go's exceptions. |
15:25:52 | FromGitter | <kayabaNerve> So then there's no point in having them IMO |
15:25:58 | FromGitter | <kayabaNerve> Exceptions are meant to be flow breaking |
15:26:00 | lqdev[m] | @kayabaNerve: because they don't exist. lol |
15:26:21 | disruptek | you would like go, i think. |
15:26:29 | lqdev[m] | go uses it's idio~~ma~~tic `if x != nil {}` |
15:26:40 | * | nif quit (Quit: ...) |
15:26:42 | FromGitter | <kayabaNerve> I hate Go from what I seen |
15:26:50 | * | nif joined #nim |
15:26:51 | disruptek | araq threatened to make quirky default. maybe we need to start a petition. 😀 |
15:26:51 | FromGitter | <kayabaNerve> Their function definitions are ultra verbose, especially class methods. |
15:26:59 | FromGitter | <kayabaNerve> I also hate brackets without parentheses. |
15:27:04 | FromGitter | <kayabaNerve> if (x) {} tyvm |
15:27:19 | lqdev[m] | @kayabaNerve but, you can add these brackets |
15:27:23 | FromGitter | <kayabaNerve> If it still controlled flow, I don't think I'd have an issue with it. |
15:27:30 | FromGitter | <kayabaNerve> lqdev[m]: Add the parentheses, right. |
15:27:31 | lqdev[m] | s/brackets/parens |
15:27:44 | FromGitter | <kayabaNerve> I can't yell at other developers to use parens though :( |
15:27:51 | lqdev[m] | one thing I dislike with go is `:=` |
15:27:52 | FromGitter | <kayabaNerve> ... well I technically can |
15:27:59 | lqdev[m] | what dumbass came up with this syntac |
15:28:02 | lqdev[m] | s/syntac/syntax |
15:28:17 | lqdev[m] | it's like python's implicit declaration, but 100x worse |
15:28:27 | clyybber | lqdev[m]: No, its simply inspired by mathematics |
15:28:39 | FromDiscord | <onelivesleft> How come I'm getting a million warnings when I compile when I have `verbosity:0 hints:off`: "Warning: Potential object case transition, instantiate new object instead [CaseTransition]" |
15:28:40 | clyybber | It would actually make sense in nim too |
15:28:44 | lqdev[m] | clyybber: but go isn't a functional language |
15:28:47 | FromDiscord | <onelivesleft> this is in a fork of the devel branch |
15:29:03 | FromGitter | <kayabaNerve> I also support var blocks. |
15:29:20 | Yardanico | @onelivesleft --warnings:off ? |
15:29:25 | clyybber | lqdev[m]: Its like typing `var i: int = 0` but leaving out the type |
15:29:36 | FromGitter | <kayabaNerve> `var i = 0`? |
15:29:43 | lqdev[m] | clyybber: the type and var |
15:29:52 | FromGitter | <kayabaNerve> :P |
15:29:57 | FromDiscord | <onelivesleft> bingo, ty |
15:30:21 | clyybber | lqdev[m]: every language is functional, its all monads :p |
15:30:22 | lqdev[m] | well, I guess this is just my preference. I'm a Nim fanatic ever since I learned about it last year :P |
15:30:28 | clyybber | (im kidding, but it is) |
15:30:34 | FromGitter | <kayabaNerve> Honestly, I'd like Nim much more if it was bracketed instead of indented (and used parentheses for if statements since `if x {` is quite jarring IMO). |
15:30:36 | lqdev[m] | anyways, back to work |
15:30:53 | clyybber | kayabaNerve: use () |
15:30:54 | FromGitter | <kayabaNerve> I've entered a love/hate relationship with Nim. |
15:31:09 | FromGitter | <kayabaNerve> If I could go back in time, I probably would not use it like I have. |
15:31:11 | clyybber | I would hate if nim were bracketed :) |
15:31:28 | FromGitter | <kayabaNerve> Yeah, that'd make it KayabaLang, not Nim |
15:31:54 | clyybber | kayabaNerve: But you can use () to nest stuff |
15:32:31 | FromGitter | <kayabaNerve> So my codebase is just over 20k lines of Nim code right now. I have another 5k lines of Python. |
15:32:44 | * | nif quit (Quit: ...) |
15:32:54 | * | nif joined #nim |
15:33:24 | FromGitter | <kayabaNerve> I would've quit a long time ago if it wasn't in Nim, so I wouldn't tell myself to not use Nim. That said, over my year and a half of using it full times, I've found so many bugs it's been... annoying/frustrating/disappointing... |
15:33:31 | clyybber | kayabaNerve: I mean nothing is preventing you from writing if(x == 3): (let y = x; echo y) |
15:33:40 | FromGitter | <kayabaNerve> It's gotten way better over time, but 0.20 introduced a ton of regressions IIRC which was a pain. |
15:33:53 | FromGitter | <kayabaNerve> I'm also disappointed Nim isn't following semantic versioning from now on but eh. |
15:34:04 | FromGitter | <kayabaNerve> I probably won't use Nim on a project this big for another 5 years. |
15:34:40 | FromGitter | <kayabaNerve> And yes, I fully understand I can add parentheses when languages don't require them and use `if x: ()` in Nim. That wasn't my point :P |
15:35:06 | clyybber | what was the point then? |
15:35:24 | clyybber | I like the fact that nim doesn't force you to do stuff |
15:35:29 | clyybber | like adding paranthees |
15:35:33 | FromGitter | <kayabaNerve> That I prefer non-identation based languages |
15:35:45 | FromGitter | <kayabaNerve> It does force you to use indentation :P |
15:35:53 | FromGitter | <kayabaNerve> *indentation, typo in that first one |
15:36:14 | FromGitter | <kayabaNerve> It's not about brackets. It's about brackets instead of indentation. |
15:36:21 | clyybber | Ah |
15:36:32 | clyybber | kayabaNerve: You could use a source code filter |
15:36:32 | FromGitter | <kayabaNerve> And parentheses with brackets because brackets alone is jarring 0_o |
15:36:41 | FromGitter | <kayabaNerve> That one is literally about brackets, I concede |
15:36:49 | FromGitter | <kayabaNerve> Aren't those being removed? |
15:36:54 | clyybber | no? |
15:37:03 | FromGitter | <kayabaNerve> I think Araq said three versions ago he wanted to remove them at least |
15:37:38 | FromGitter | <kayabaNerve> The only time I've ever seriously been interested in using one is to try file wide macros. Since the SCF parses line by line though, it can't be done. |
15:37:56 | clyybber | Hmm, even if they get removed you could replace them with a bash script |
15:38:02 | FromGitter | <kayabaNerve> (I tried to replace \r\n with \r\n\t or something; not actually \t ofc) |
15:38:13 | FromGitter | <kayabaNerve> I know I can build a language which compiles to Nim :P |
15:38:34 | FromGitter | <kayabaNerve> I'm not that invested. I meant it as an off comment, not something for continued discussion. |
15:39:06 | FromGitter | <kayabaNerve> I was interested in continued discussion on quirky exceptions, which we already kinda had, and Nim in large code bases though :thinking: |
15:39:08 | clyybber | Heh, I actually want to try to make a regex that does that |
15:39:36 | * | sealmove joined #nim |
15:39:49 | clyybber | kayabaNerve: You can try quirky excpetions rn |
15:39:51 | FromGitter | <kayabaNerve> I've learned some basic regexes over the past few weeks to speed up my F+Rs. It's been nice. |
15:39:57 | disruptek | clyybber: why don't you take over my literate pr? |
15:40:06 | FromGitter | <kayabaNerve> Yeah, but I expect exceptions to control flow. |
15:40:16 | FromGitter | <kayabaNerve> Exceptions which don't aren't exceptions IMO. |
15:40:30 | disruptek | !pull author:disruptek literate |
15:40:32 | disbot | https://github.com/nim-lang/Nim/pull/11848 -- 3write markdown amidst nim via a source code filter 🧚11disruptek |
15:40:37 | FromGitter | <kayabaNerve> I could replace every instance of raise with qRaise and have that raise + return though. |
15:40:45 | clyybber | yeah |
15:40:52 | FromGitter | <kayabaNerve> That's a nice bot |
15:41:09 | clyybber | disruptek: I don't entirely understand the purpose |
15:41:22 | clyybber | Ah |
15:41:30 | FromGitter | <kayabaNerve> Didn't someone do this with a blog post on Haskell? |
15:41:41 | FromGitter | <kayabaNerve> It was entertaining but I've never seen any point other than said entertainment |
15:42:15 | disruptek | clyybber: https://cl.ly/LxEu |
15:42:27 | disruptek | i first saw it done well in coffeescript. |
15:42:31 | clyybber | Ah, thanks |
15:42:49 | FromGitter | <kayabaNerve> Anyone here know of that blog post? Bit hard to search for it with generic terms :P |
15:42:54 | clyybber | would really put me off with indentation :p |
15:42:57 | disruptek | not a great demo, since the whole idea is that it's markdown. |
15:43:14 | disruptek | https://gist.github.com/jashkenas/3fc3c1a8b1009c00d9df |
15:43:43 | disruptek | i don't know the haskell post, no. |
15:44:12 | FromGitter | <kayabaNerve> I'm not sure it was Haskell. Some old language though |
15:44:13 | clyybber | TBH I don't particularily like source code filters either |
15:44:23 | clyybber | I don't think its the compilers job to do stuff like that |
15:44:33 | * | joachimschmidt55 quit (Quit: User has been idle for 30+ days.) |
15:44:42 | disruptek | who should do it, then? |
15:44:51 | clyybber | External programs |
15:45:08 | disruptek | yes, but how do you propose it work? |
15:45:12 | clyybber | In the sense that you write the markdown in comments |
15:45:38 | clyybber | disruptek: cat code | externalmagicprogram | markdownreader/firefox |
15:46:01 | clyybber | disruptek: Or if you want to write like that |
15:46:14 | clyybber | cat code | externalmagicprogram | nim c /dev/stdin |
15:46:24 | FromGitter | <kayabaNerve> `externalmagicprogram` I'd run this with sudo if you sent me an executable. It has a very trustworthy name. |
15:46:36 | disruptek | be right there! |
15:47:31 | FromGitter | <kayabaNerve> I think I have a backup somewhere |
15:47:52 | clyybber | rm -rf shuf -n1 /* |
15:48:18 | * | sagax quit (Read error: Connection reset by peer) |
15:48:56 | FromGitter | <kayabaNerve> What does shuf do? |
15:49:09 | disruptek | randomizes input |
15:49:18 | FromGitter | <kayabaNerve> Fun |
15:49:36 | disruptek | not a viable command, but i get the idea. |
15:50:00 | * | shashlick[m] quit (Quit: User has been idle for 30+ days.) |
15:50:10 | FromDiscord | <yewpad> It's not possible to do the cross-target thingy in Nim like you do in Go with "xxx_win.go", "xxx_linux.go" and "xxx_mac.go" right? |
15:50:16 | FromGitter | <kayabaNerve> GitHub doesn't count my Markdown in my repository's language thingy :( Disappointing. |
15:50:26 | disruptek | yewpad: right |
15:50:29 | FromGitter | <kayabaNerve> You just need a C cross compiler. |
15:51:14 | FromDiscord | <yewpad> What a bummer. I really like this way of doing per-platform stuff. All those `when defined` statements get clumsy overtime |
15:51:26 | FromGitter | <kayabaNerve> The way you're asking makes me think Go has a very easy way to do cross compilation. Nim doesn't. That said, you can build Nim executables from any platform for any platform like you can C. |
15:51:43 | clyybber | `tail -f /dev/sda /dev/urandom > /dev/sda` to sprinkle a bit of surprise into life |
15:51:54 | solitudesf | you like file clutter over couple whens? |
15:52:22 | FromGitter | <kayabaNerve> Do you know how long it took me to get this Desktop fixed? |
15:52:31 | FromDiscord | <yewpad> I wouldn't particularly say it is file clutter. Just a !another! way of structuring per-platform code |
15:52:39 | FromGitter | <kayabaNerve> I have so many cursed stories involving it that makes you question all of life's sanity. |
15:52:39 | clyybber | yewpad: nothing is stopping you |
15:52:58 | FromDiscord | <yewpad> clyybber: yewpad: nothing is stopping you |
15:52:59 | FromDiscord | <yewpad> ? |
15:53:01 | clyybber | yewpad `when windows: import xxx_win else: import xxx_unix |
15:53:02 | solitudesf | no one stopping you from making xxx.nim with conditional imports |
15:53:09 | FromGitter | <kayabaNerve> clybber: include |
15:53:14 | FromDiscord | <yewpad> oh |
15:53:20 | FromDiscord | <yewpad> i forgot about conditional imports |
15:53:20 | FromDiscord | <yewpad> omg |
15:53:28 | FromGitter | <kayabaNerve> Eh. import could work but if you want full symbol inclusion do include. |
15:53:40 | FromGitter | <kayabaNerve> If you only care about public symbols, do import. |
15:54:03 | * | sagax joined #nim |
16:02:25 | FromDiscord | <mratsim> @yewpad, Nim handles platform specific stuff in a much cleaner way than C I think |
16:02:47 | FromDiscord | <mratsim> especially the fact that you don't have to do a weird raindance to be able to use multilines #define |
16:05:36 | FromDiscord | <Rika> will `import exclude` allow me to override procs |
16:05:41 | FromDiscord | <Rika> and is there a better way\ |
16:07:00 | FromDiscord | <mratsim> myNiftyModule.myProcNameThatIsNotUnique(x, y) |
16:07:38 | FromDiscord | <mratsim> or from myNiftyModule import myProcNameThatIsNotUnique as theRealProc |
16:07:56 | FromDiscord | <yewpad> `$int(floor(extractedFiles * 100 / discoveredFiles))` can this be optimized? this doesn't feel right |
16:08:31 | FromDiscord | <mratsim> you can remode the int and the floor if you just use div |
16:08:49 | FromDiscord | <mratsim> assuming your number of extracted files and discovered files are positive integers |
16:08:55 | FromDiscord | <yewpad> they are |
16:09:13 | FromDiscord | <mratsim> then `extractedFiles * 100 div discoveredFiles` |
16:09:36 | FromDiscord | <yewpad> genius! |
16:09:37 | FromDiscord | <yewpad> thanks |
16:10:02 | FromDiscord | <Rika> how can files go negative xd |
16:10:11 | FromDiscord | <mratsim> I was thinking of fractional 😉 |
16:10:11 | FromDiscord | <yewpad> xD |
16:12:17 | disruptek | i've known some pretty ill-tempered files. |
16:12:35 | disruptek | they can definitely go negative when pushed. |
16:12:57 | FromDiscord | <Rika> thats some funky file system |
16:13:25 | disruptek | barely escaped with my life, fo' real. |
16:17:46 | * | uu91 quit (Remote host closed the connection) |
16:19:50 | * | Hideki_ joined #nim |
16:33:06 | * | dddddd joined #nim |
16:42:05 | lqdev[m] | https://play.nim-lang.org/#ix=23Oi |
16:42:22 | lqdev[m] | why do I not get a nnkClosedSymChoice for `$`? |
16:43:18 | lqdev[m] | I get one for system.add, though |
16:44:56 | FromGitter | <auxym> hey, anyone want to have a quick look at this one? https://play.nim-lang.org/#ix=23Oj |
16:45:10 | FromGitter | <auxym> `Error: unhandled exception: int128.nim(72, 11) `arg.sdata(2) == 0` out of range [AssertionError]` |
16:45:49 | Araq | auxym: fixed on devel, I hope |
16:46:23 | lqdev[m] | auxym: https://play.nim-lang.org/#ix=23Ok |
16:46:38 | FromGitter | <auxym> @Araq oh neat, I'll try it out. Out of curiosity, is there a github issue |
16:47:56 | Araq | lqdev[m]: excellent question |
16:48:18 | Araq | no idea, but notice that 'typed' ASTs are currently not part of the spec for these reasons |
16:48:56 | FromGitter | <auxym> lqdev[m]: thanks! what exactly is static doing here? |
16:48:57 | lqdev[m] | dang, how can I get all the available overloads of `$` then? It works for other procs. |
16:49:13 | lqdev[m] | auxym: static makes the parameter compile-time |
16:49:51 | FromGitter | <auxym> ah, that works for me! |
16:50:21 | lqdev[m] | I guess a temp fix for my issue would be to create a glue proc that calls my desired `$` overload… man, how painful. |
16:53:54 | Araq | lqdev[m]: I would try a workardound involving typeof(`$`) |
16:55:18 | lqdev[m] | Araq: how would typeof help in that case? |
16:55:58 | Araq | typeof gives some control over the "prefer iterators" behaviour |
17:00:03 | lqdev[m] | can you elaborate? |
17:01:31 | * | smokevadim joined #nim |
17:01:56 | lqdev[m] | I'm not really doing anything with iterators in that case |
17:03:13 | * | nsf joined #nim |
17:04:16 | * | a_chou joined #nim |
17:04:41 | * | smokevadim quit (Remote host closed the connection) |
17:04:57 | * | a_chou quit (Client Quit) |
17:05:22 | * | a_chou joined #nim |
17:06:01 | Araq | lqdev[m]: I know, what I say makes little sense. but I have the feeling something like that is going on |
17:08:01 | lqdev[m] | huh. typeof(`$`) actually returns the thing I need |
17:08:09 | * | smokevadim joined #nim |
17:08:33 | lqdev[m] | this is so confusing |
17:08:41 | disruptek | it's almost like Araq really knows this language well. |
17:09:37 | lqdev[m] | I wonder if this happens for other operators, too |
17:10:43 | lqdev[m] | doesn't seem to be happening for `+` |
17:11:09 | * | nim_noob joined #nim |
17:11:15 | lqdev[m] | I'll just keep a hardcoded list of problematic symbols for now, and update it whenever I see a problem |
17:11:28 | nim_noob | Hello there! |
17:11:36 | lqdev[m] | hi, nim_noob |
17:12:08 | clyybber | lqdev[m]: You should open an issue |
17:12:19 | * | smokevadim quit (Read error: Connection reset by peer) |
17:15:31 | nim_noob | Whenever I try to compile an *.exe from Linux, i get this error: |
17:16:14 | * | smokevadim joined #nim |
17:16:30 | nim_noob | "/usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: unrecognized option '-z' |
17:16:46 | nim_noob | /usr/lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld: use the --help option for usage information |
17:17:05 | nim_noob | collect2: error: ld returned 1 exit status" |
17:18:20 | nim_noob | And here is, "Error: execution of an external program failed: '/usr/bin/x86_64-w64-mingw32-gcc -o .../testWinCompilation.exe .../.cache/nim/testWinCompilation_d/stdlib_formatfloat.nim.c.o .../.cache/nim/testWinCompilation_d/stdlib_io.nim.c.o .../.cache/nim/testWinCompilation_d/stdlib_system.nim.c.o |
17:18:20 | nim_noob | .../.cache/nim/testWinCompilation_d/@mtestWinCompilation.nim.c.o -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'" |
17:18:52 | * | FromGitter quit (Remote host closed the connection) |
17:19:11 | * | FromGitter joined #nim |
17:19:45 | * | thomasross_ joined #nim |
17:19:45 | * | thomasross is now known as Guest70645 |
17:19:45 | * | Guest70645 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
17:19:45 | * | thomasross_ is now known as thomasross |
17:19:52 | nim_noob | What might be the problem? |
17:20:38 | nim_noob | I used this command, "nim c -d:mingw testWinCompilation.nim" |
17:21:44 | nim_noob | I also tried to specify an OS and a CPU architecture |
17:23:02 | * | Vladar quit (Quit: Leaving) |
17:23:20 | nim_noob | The Nim version is 1.0.2 |
17:24:11 | solitudesf | are you sure this is not something from your environment? i can't reproduce. |
17:24:45 | nim_noob | idk |
17:27:55 | * | smokevadim quit (Read error: Connection reset by peer) |
17:27:58 | Araq | ok, my cycle collector works for simple cases |
17:28:13 | Araq | clyybber: now it's your turn. |
17:28:16 | FromDiscord | <yewpad> About to code a little lib for retrieving youtube video urls and downloading the youtube video. even though this somewhat violates yt's tos... who cares |
17:28:22 | FromDiscord | <yewpad> it's actually pretty simple lol |
17:29:10 | Araq | so ... now that we have the best GC in the world how do we market this |
17:29:23 | FromDiscord | <yewpad> the best gc in the world? what have I missed? |
17:29:30 | disruptek | nothing. |
17:30:57 | FromDiscord | <yewpad> someone wanna suggest a nim-ish name for this youtube lib thingy? i like those nim-ish names like "nimpy" and "nimph" etc. |
17:31:13 | Yardanico | nitube xD |
17:31:32 | nim_noob | I couldn't find "-z" flag in "/usr/x86_64-w64-mingw32/bin/ld --help" info |
17:31:59 | FromDiscord | <yewpad> nimtube ( ͡° ͜ʖ ͡°) |
17:32:06 | Yardanico | nimhub |
17:32:12 | Yardanico | oh no |
17:32:27 | FromDiscord | <yewpad> (ノ◕ヮ◕)ノ*:・゚✧ ✧ |
17:32:39 | * | Boko_bdecb joined #nim |
17:33:14 | clyybber | Araq: benchmarks, probably :) |
17:34:47 | * | Boko_bdecb quit (Read error: Connection reset by peer) |
17:34:49 | nim_noob | Can I link '/usr/x86_64-w64-mingw32/bin/ld' to '/usr/bin/ld'? |
17:35:23 | Yardanico | uhh, what for? |
17:35:30 | Yardanico | You want to cross-compile from linux to windows? |
17:35:57 | Yardanico | this code might help you - https://github.com/Yardanico/nickel/blob/master/src/nickel.nims#L16 (from line 16 until the end) |
17:36:27 | * | Boko_baaba joined #nim |
17:36:46 | Yardanico | actually you don't really need findExe for linux, but I added it so it also works on macOS because the binary has a different location there |
17:36:48 | nim_noob | '/usr/bin/ls' has got "-z" flag, mingw's one hasn't |
17:37:01 | lqdev[m] | reported https://github.com/nim-lang/Nim/issues/12831 |
17:37:03 | disbot | ➥ Passing `$` to a `typed` param of a macro yields a single nnkSym instead of a nnkClosedSymChoice @11liquid600pgm; snippet at https://play.nim-lang.org/#ix=23Ow |
17:37:42 | * | Boko_baaba quit (Read error: Connection reset by peer) |
17:42:24 | lqdev[m] | nim_noob: are you using `-d:mingw` for cross-compilation? |
17:42:44 | nim_noob | Yes, indeed |
17:44:35 | * | Boko_aacae joined #nim |
17:45:43 | * | Boko_aacae quit (Read error: Connection reset by peer) |
17:46:03 | clyybber | Araq: So =destroy for refs does the cycle detection now? |
17:46:18 | clyybber | And there is =dispose thats the rawDestroy thing we talked about? |
17:46:53 | * | tane quit (Quit: Leaving) |
17:49:02 | * | uvegbot joined #nim |
17:49:23 | * | nim_noob left #nim (#nim) |
17:49:47 | * | zyklon quit (Quit: Konversation terminated!) |
17:50:09 | * | Boko_baaab joined #nim |
17:58:15 | rayman22201 | Are the async tests passing with gc:arc? If it doesn't work with async then it's not done yet 😝 |
17:59:41 | * | zyklon joined #nim |
18:00:18 | * | uvegbot quit (Ping timeout: 245 seconds) |
18:00:39 | * | Boko_baaab quit (Read error: Connection reset by peer) |
18:02:55 | * | Boko_dbddd joined #nim |
18:04:03 | * | a_chou quit (Ping timeout: 250 seconds) |
18:04:54 | * | clyybber quit (Quit: WeeChat 2.6) |
18:08:03 | * | matic joined #nim |
18:08:33 | Araq | rayman22201: on Unix I got a stress test to be green fwiw |
18:08:38 | * | Boko_dbddd quit (Read error: Connection reset by peer) |
18:08:41 | Araq | but it leaked memory |
18:09:11 | matic | Hi |
18:09:51 | Araq | clyybber: correct |
18:09:55 | Araq | hi matic |
18:10:18 | matic | Any standard library procs for chopping up an int (int16, int32, int64) to an array of uint8? |
18:10:24 | matic | Hey Araq |
18:11:00 | Araq | 'cast' it |
18:13:41 | matic | Ha, that actually works! Thanks Araq |
18:14:10 | disruptek | Araq is on a roll with all these right answers. |
18:15:11 | matic | :) |
18:15:53 | FromGitter | <auxym> Here's a fun one: https://play.nim-lang.org/#ix=23OD add `{.closure.}` to `iterinvoke` creates an infinite loop. It looks like the `yield` call does not advance the inner iterator |
18:17:00 | FromDiscord | <treeform> Is this new cycle thing on the default GC or the new one? |
18:17:09 | Yardanico | @treeform it's the addition for ARC gc |
18:17:20 | Yardanico | https://github.com/nim-lang/Nim/pull/12823 |
18:17:21 | disbot | ➥ ARC: cycle detector 👑11Araq |
18:18:56 | Araq | auxym: that's an old bug, I thought we fixed it... |
18:19:34 | FromGitter | <auxym> @Araq: seems to be happening both on 1.0.4 and latest devel |
18:19:59 | Araq | well 1.0.4 and devel have not diverged that much |
18:20:00 | Yardanico | works on latest devel for me |
18:20:07 | Yardanico | outputs 1 then 2 |
18:21:12 | FromGitter | <auxym> @Yardanico: replace line 7 with `iterator iterinvoke[T](iter: iterator(): T {.closure.}): T {.closure.} =` |
18:21:15 | Yardanico | oh |
18:21:29 | Yardanico | sorry I didn't read your message fully, just opened the link :P |
18:21:32 | FromGitter | <auxym> Didn't want to link straight to a playground with an infinite loop :) |
18:22:11 | Yardanico | yeah you're right |
18:22:18 | FromGitter | <auxym> @Araq should I create a new issue then? |
18:31:06 | Araq | sure |
18:32:16 | FromGitter | <auxym> alright, will do |
18:35:54 | * | a_chou joined #nim |
18:46:34 | * | nsf quit (Quit: WeeChat 2.6) |
18:52:39 | FromDiscord | <Rika> hello, me dumb, dont know if overriding a proc is possible; from what i tried it isnt. what are the alternatives |
18:52:48 | Yardanico | yes, it's entirely possible |
18:53:03 | * | NimBot joined #nim |
18:53:45 | Yardanico | what do you exactly want to do? maybe you need something like interface (you can use tuples in Nim for that, like streams module does) or multimethods |
18:54:32 | FromDiscord | <yewpad> somebody got any idea how to decode x-www-form-urlencoded in Nim? Is there something I can use? |
18:55:44 | * | matic quit (Read error: Connection reset by peer) |
18:55:46 | Yardanico | @yewpad maybe https://nim-lang.org/docs/uri.html#decodeUrl%2Cstring ? |
18:56:09 | * | matic joined #nim |
18:57:42 | * | a_chou quit (Quit: a_chou) |
18:58:13 | * | solitudesf quit (Ping timeout: 245 seconds) |
19:01:41 | * | rockcavera quit (Remote host closed the connection) |
19:02:34 | FromGitter | <zacharycarter> so this is fun... in my fragment shader I'm sampling from the textures of neighbor tiles to do blending |
19:03:04 | FromGitter | <zacharycarter> so for each fragment I pass down indices of the textures in neighbor vertices, and I use those indices to do a lookup into my 2d texture array so I can do the color blending |
19:03:28 | FromGitter | <zacharycarter> however - if I'm packing all of these textures into an altas / virtual texture - I have no effing clue how to do the mapping in the shader |
19:03:54 | FromGitter | <matrixbot> `aeverr` it is I, Rika from Discord |
19:03:58 | FromGitter | <matrixbot> `aeverr` Discord is dying right now |
19:05:31 | Yardanico | You don't need matrix to gitter bridge btw :) matrix is directly connected to freenode - https://github.com/matrix-org/matrix-appservice-irc/wiki/Guide:-How-to-use-Matrix-to-participate-in-IRC-rooms |
19:05:52 | FromGitter | <yewpad> (https://files.gitter.im/nim-lang/Nim/SAFF/grafik.png) |
19:05:54 | FromGitter | <yewpad> @Yardanico Thank you! This actually worked quite well |
19:06:08 | FromGitter | <yewpad> (And this link works too: https://r4---sn-j5caxn0g4-umal.googlevideo.com/videoplayback?expire=1575766778&ei=mvbrXYbnDpaD8gO0iJxQ&ip=46.128.100.132&id=o-AEDTnmMCoZI2fRDxibVE2OO77VvkTL0VBvlZ9Rv_--lr&itag=251&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-j5caxn0g4-umal%2Csn-4g5e6nzs&ms=au%2Crdu&mv=m&mvi=3&pl=18&initcwndbps=1225000&mime=audio%2Fwebm&gir=yes&clen=14308543&dur=845.321&lm |
19:06:08 | FromGitter | ... t=1573308452453495&mt=1575745059&fvip=4&keepalive=yes&fexp=23842630%2C23860862&c=WEB&txp=5431432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIgE2ygBA9ymGoJlID7HF7DHzmp_5ssoWTePPnxLov9lGcCIQD4znklYm6dH17aUy87mtUKf1GeMz56EaKfF1EjCIpb9w%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&l ... [https://gitter.im/nim-lang/Nim?at=5debf8206a85195b9e163752] |
19:06:13 | FromGitter | <yewpad> Exciting |
19:06:18 | * | solitudesf joined #nim |
19:06:39 | Yardanico | @yewpad that link is kinda too big :P |
19:06:46 | FromGitter | <yewpad> ya i know |
19:06:52 | FromGitter | <yewpad> can't do anything about that though |
19:06:54 | Yardanico | especially in IRC |
19:07:08 | FromGitter | <yewpad> ssrryyyy |
19:07:34 | FromGitter | <matrixbot> `aeverr` Yardanico, im on matrix |
19:07:42 | FromGitter | <matrixbot> `aeverr` im not using gitter |
19:07:53 | FromGitter | <matrixbot> `aeverr` huh double sending now it seems |
19:08:02 | FromGitter | <matrixbot> `aeverr` everything i use is broken! |
19:08:17 | Yardanico | @aeverr you're using matrix<-> gitter bridge :P |
19:08:28 | FromGitter | <matrixbot> `aeverr` i dont know what im using |
19:08:50 | FromGitter | <matrixbot> `aeverr` i cant be assed to open my irc client if thats what i need to do |
19:10:58 | * | aeverr[m] joined #nim |
19:10:59 | * | solitudesf quit (Client Quit) |
19:11:20 | * | solitudesf joined #nim |
19:11:20 | FromGitter | <zacharycarter> interesting - apparently I use another texture to do this |
19:11:22 | aeverr[m] | test |
19:11:24 | Yardanico | oh no https://github.com/nim-lang/Nim/issues/12833 XD |
19:11:26 | disbot | ➥ json decode is slow than go! @11zhuxiujia; snippet at https://play.nim-lang.org/#ix=23OT |
19:11:31 | Yardanico | these people again :( |
19:12:02 | lqdev[m] | ah shit, here we go again |
19:12:15 | aeverr[m] | nice |
19:12:38 | aeverr[m] | whos gonna point to the nimble libraries |
19:12:38 | FromGitter | <zacharycarter> he should go fucking use go then |
19:13:39 | FromGitter | <zacharycarter> lol - I love the issue description too |
19:13:43 | FromGitter | <zacharycarter> it outputs the wrong string |
19:14:14 | disruptek | that's just the template. |
19:14:38 | FromGitter | <zacharycarter> yeah well the whole issue is fucked |
19:14:45 | FromGitter | <zacharycarter> he's complaining about runtime but refers to it as compile time |
19:15:22 | FromGitter | <zacharycarter> again, I think he should just go use go |
19:15:32 | Yardanico | "go use go" :D |
19:15:41 | aeverr[m] | go2go |
19:16:18 | FromGitter | <zacharycarter> hope he / she enjoys how terrible Go is |
19:17:23 | FromGitter | <zacharycarter> this is blowing my mind though... now I need to figure out how to compose a texture |
19:17:45 | FromGitter | <zacharycarter> I guess I'm supposed to store - ⏎ ⏎ ```x position in the cache (stored in .r) ⏎ y position (in .g) ⏎ mipmap level (in .b).``` [https://gitter.im/nim-lang/Nim?at=5debfad9c3d6795b9f3ee959] |
19:17:58 | aeverr[m] | zacharycarter is super triggered it seems |
19:18:19 | Araq | zacharycarter: way beyond my knowledge |
19:19:29 | FromGitter | <zacharycarter> I'm working towards virtual / mega textures but I want to make simple texture atlases work first |
19:20:08 | FromGitter | <zacharycarter> I just don't know how to store data in a specific channel - I guess I need to look at the format for png and figure out how the data is laid out |
19:22:10 | FromGitter | <zacharycarter> http://www.renaudpradenc.com/?tag=sparse-virtual-texture |
19:23:40 | Araq | we could put some effort into optimizing the stdlib though |
19:24:40 | federico3 | +1 |
19:26:52 | federico3 | or maybe finish your faster JSON parser and ship it in stdlib |
19:30:48 | Araq | 1. it is finished. |
19:31:06 | Araq | 2. it is a different API and cannot have the same API. |
19:34:39 | aeverr[m] | add a note to docs regards the speed |
19:46:35 | Araq | it's not surprising Go's implementation is faster, they deserialize directly into the struct |
19:46:51 | Araq | which we could also do but don't |
19:48:24 | Araq | problem is that Go's implementation is also full of stuff where I can trigger pathological behaviour, you can't just "write a fast JSON library". what if the JSON has a 10GB string literal inside? what if it has object fields with 1000 entries? |
19:49:19 | Araq | JSON is used for **everything** and so you need to protect against so many different things and then once you did, it's kinda slow for the general case |
19:50:01 | lqdev[m] | gosh, that's why I stick to raw binary data. |
19:50:15 | lqdev[m] | 1. it's streamable |
19:50:20 | lqdev[m] | 2. it's fast to decode |
19:50:27 | lqdev[m] | problem solved. |
19:52:00 | lqdev[m] | anyways, the problem also lies within how the JSON is deconstructed into objects |
19:52:33 | lqdev[m] | because it's not parsed and unmarshalled immediately, it's first parsed into a tree and then that tree is unmarshaled |
19:52:42 | Araq | exactly |
19:54:57 | disruptek | could use some nimph testing; just added automatic git repo rolling to match requirements. |
20:00:46 | Araq | lqdev[m]: +1 for binary data |
20:03:23 | aeverr[m] | oh what the hell matrix has seen by indicators thats cool |
20:03:40 | lqdev[m] | aeverr: and they even work on people using IRC! isn't that amazing! |
20:03:50 | aeverr[m] | definitely is |
20:03:52 | lqdev[m] | too bad their homeserver sucks |
20:04:06 | aeverr[m] | rip |
20:04:26 | lqdev[m] | it often experiences outages and slowdowns, which can be really annoyinh |
20:04:31 | lqdev[m] | s/annoyinh/annoying/ |
20:05:31 | aeverr[m] | raw binary data has the issue of portability between languages right? |
20:06:12 | disruptek | and once you crack the seal it has to be refrigerated. |
20:06:29 | Araq | wtf, Go's JSON lexer is terrible |
20:06:54 | Araq | and we're beaten by this piece of junk? that's personally offending me |
20:07:08 | aeverr[m] | are you inclined to make json quicker now :V |
20:07:18 | sealmove | terrible how? |
20:07:22 | Araq | too bad I'm busy spending my time on the world's best GC. |
20:07:49 | aeverr[m] | also yeah how is it terrible |
20:08:27 | sealmove | world's best GC == araqsgc (https://github.com/Araq/araqsgc) ? |
20:08:33 | Yardanico | sealmove: ARC |
20:08:46 | sealmove | gc:arc, ok |
20:08:53 | Yardanico | idk what arc means though, maybe it means "araqsgc" :P |
20:09:01 | aeverr[m] | what does arc stand for |
20:09:05 | Araq | it's terrible because it uses an indirect function call for every processed byte |
20:09:08 | sealmove | arc = (something) reference counting |
20:09:15 | aeverr[m] | im guessing rc is reference counting or smth |
20:09:18 | aeverr[m] | called it |
20:09:29 | aeverr[m] | internet is just shite over here |
20:10:01 | sealmove | automatic |
20:11:07 | Araq | thinking about it ... it makes some sense |
20:11:48 | Araq | need to sleep over this idea. |
20:12:32 | sealmove | Araq: I am a bit confused about Nim's future. Since you are working on GC, does it mean we are not going for owned refs? |
20:13:33 | sealmove | Or maybe arc GC can help on implementing owned refs? |
20:14:16 | Araq | sealmove: it's actually laid out in our RFCs/plan for 2020 |
20:14:31 | sealmove | great, i'll go check it out |
20:15:11 | Araq | I view these things as a continuum |
20:15:45 | Araq | and both ARC and 'owned ref' use the same codebase anyway, I fix one bug for ARC, it also fixes a bug for 'owned' |
20:16:47 | sealmove | nice, makes sense |
20:20:23 | sealmove | nim is progressing so fast that I can't even keep up with RFCs and blog posts :D |
20:39:26 | * | PMunch joined #nim |
20:39:50 | Zevv | where can I find araqs latest writeup then? |
20:40:11 | disruptek | !rfcs author:araq |
20:40:12 | disbot | https://github.com/nim-lang/RFCs/issues/178 -- 3lent/var/openArray inside objects/containers 👑11Araq |
20:40:12 | disbot | https://github.com/nim-lang/RFCs/issues/177 -- 3Unify Nim's GC/memory management options 👑11Araq |
20:40:12 | disbot | https://github.com/nim-lang/RFCs/issues/175 -- 5Conversion to unsigned integers shall not produce range checks 👑11Araq 7& 9 more... |
20:47:35 | * | tklohna joined #nim |
20:53:09 | * | filcuc joined #nim |
21:08:49 | * | nixfreak quit (Read error: Connection reset by peer) |
21:12:13 | * | nsf joined #nim |
21:13:02 | * | nixfreak joined #nim |
21:16:44 | Zevv | closure iterator question: http://ix.io/23PA |
21:22:13 | * | ehmery quit (Remote host closed the connection) |
21:29:51 | Araq | closure iterators are weird |
21:29:59 | Araq | you can do |
21:30:01 | Araq | let x = it |
21:30:03 | Araq | x() |
21:30:07 | Araq | to call it a single time |
21:30:25 | Araq | the name of the closure iterator creates the state it needs |
21:34:36 | Zevv | hm weird indeed |
21:42:24 | FromDiscord | <demotomohiro> I think I can see closure iterator `it` as a proc that return closure iterator. |
21:42:24 | FromDiscord | <demotomohiro> So defining `it` closure iterator implicitly create a proc `it` that return closure iterator. |
21:43:09 | FromDiscord | <demotomohiro> But I cannot call it like `it()`. |
21:45:17 | disruptek | i kinda like that. |
21:45:27 | Zevv | I'm still struggling with these things every time and again. I'm always hoping to mold them into Lua corouines, but the semantics are just different enough so I can't |
21:45:30 | disruptek | it makes it easier to reason about where the state is. |
21:45:51 | Zevv | true |
21:49:56 | Araq | Zevv: there have been proposals to change it but it's expensive to change given that async uses it heavily |
21:51:31 | disruptek | how should nimph handle branches in your dependencies? |
21:51:45 | * | Jesin quit (Quit: Leaving) |
21:53:18 | * | Jesin joined #nim |
21:58:11 | Araq | what do you mean? |
22:01:18 | disruptek | i need to setup remote tracking so that when you fork something or clone one of your own repos, your remotes point to the right branches. |
22:01:27 | disruptek | !search changes to remotes |
22:01:28 | disbot | https://github.com/disruptek/nimph/issues/22 -- 3changes to remotes should also add missing tracking branches 🧚11disruptek 7& 4 more... |
22:01:56 | disruptek | but it begs the question, what should i assume with respect to branches. |
22:02:48 | disruptek | maybe i shouldn't fix versions in branches that aren't master, for example. or maybe branches that aren't available at the upstream project. |
22:12:34 | * | zyklon quit (Quit: Konversation terminated!) |
22:12:50 | * | zyklon joined #nim |
22:19:17 | * | solitudesf quit (Ping timeout: 250 seconds) |
22:21:16 | PMunch | Hmm, are there any compile-time image libraries out there |
22:22:48 | * | matic quit (Quit: Leaving) |
22:23:37 | lqdev[m] | why do I get an undeclared identifier here, even though the template param is `untyped`? https://play.nim-lang.org/#ix=23PT |
22:25:56 | lqdev[m] | hmm, changing the name from `connect` to `withSocket` fixed it |
22:29:26 | Araq | connect already exists and so OR kicks in and destroys your 'untyped' |
22:29:37 | Araq | did I mention that I have a better design for 'untyped'? |
22:33:32 | lqdev[m] | I'm getting an `Address already in use` error when binding a unix socket, what does that mean? |
22:33:44 | lqdev[m] | afaik the file exists and is not in use |
22:34:38 | lqdev[m] | I suppose I forgot to `close` it |
22:34:43 | lqdev[m] | what can I do in that case? |
22:35:11 | disruptek | there's a reuse flag. |
22:36:44 | lqdev[m] | ah, forgot about that |
22:37:05 | disruptek | actually, i don't remember if it has a reuse. |
22:37:19 | disruptek | crazy that i can't recall. |
22:37:48 | disruptek | doesn't exist on linux. |
22:38:15 | lqdev[m] | crap |
22:38:29 | disruptek | rename it or remove it and recreate. |
22:38:30 | lqdev[m] | well, this seems to happen even if I change the file name |
22:38:40 | disruptek | probably have to unlink it. |
22:39:17 | lqdev[m] | doesn't help |
22:39:43 | disruptek | did this work, ever? |
22:39:55 | lqdev[m] | nope. |
22:39:58 | disruptek | because you can get that error message for other reasons. |
22:40:09 | lqdev[m] | for instance? |
22:40:20 | disruptek | simple misconfiguration. |
22:40:26 | disruptek | !repo swayipc |
22:40:27 | disbot | https://github.com/disruptek/swayipc -- 9swayipc: 11swayipc (i3ipc) for Nim 15 3⭐ 0🍴 |
22:40:35 | disruptek | has a good example. |
22:41:31 | * | nsf quit (Quit: WeeChat 2.6) |
22:42:28 | lqdev[m] | yeah, but you're connecting to an existing socket in this case |
22:43:48 | lqdev[m] | does addQuitProc work on SIGINT? |
22:44:08 | lqdev[m] | nvm seems to wor |
22:44:11 | lqdev[m] | s/wor/work |
22:46:11 | * | tklohna quit (Ping timeout: 252 seconds) |
22:47:18 | * | tklohna joined #nim |
23:03:03 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
23:05:08 | * | ng0 joined #nim |
23:13:05 | * | cornfeedhobo joined #nim |
23:17:42 | sealmove | are nested case objects supported? |
23:21:02 | * | tklohna quit (Ping timeout: 276 seconds) |
23:32:13 | * | tklohna joined #nim |
23:50:56 | PMunch | sealmove, IIRC yes |
23:51:56 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:53:00 | * | PMunch quit (Quit: leaving) |
23:53:05 | * | filcuc quit (Ping timeout: 268 seconds) |
23:53:05 | * | lritter quit (Ping timeout: 268 seconds) |