00:02:23 | * | endragor joined #nim |
00:02:41 | * | endragor quit (Remote host closed the connection) |
00:03:19 | * | endragor joined #nim |
00:07:56 | madprops | ok seems tables can't do that |
00:10:26 | * | abm quit (Quit: Leaving) |
00:11:00 | FromGitter | <alehander92> you might be able to override `.` |
00:11:03 | FromGitter | <alehander92> with a macro |
00:11:08 | FromGitter | <alehander92> look at jsgen |
00:11:16 | madprops | thing is this would be user facing |
00:11:21 | FromGitter | <alehander92> i wouldnt do it tho, it seems confusing imo |
00:11:21 | madprops | the user would have to do that |
00:11:35 | madprops | i can just do p["name"] but that's a bit verbose |
00:11:39 | FromGitter | <alehander92> jsffi* |
00:12:03 | FromGitter | <alehander92> but it makes it obvious its a table |
00:18:26 | madprops | hmm im iterating through a list of objects |
00:18:33 | madprops | can't seem to change a property of one |
00:18:49 | disruptek | use mitems or mpairs. |
00:19:59 | disruptek | m as in mutable. |
00:20:51 | * | endragor quit (Remote host closed the connection) |
00:24:02 | disruptek | i like you, madprops. i hope you stick with nim. |
00:28:20 | * | norm_ quit (Quit: Leaving) |
00:34:10 | * | nif quit (Quit: ...) |
00:34:20 | * | nif joined #nim |
00:37:58 | madprops | not sure how to do this https://play.nim-lang.org/#ix=1Y3N |
00:38:07 | madprops | and an enum doesn't seem would work |
00:38:28 | disruptek | try to use variant objects instead. |
00:38:42 | madprops | i just want a function that can return different kinds of types, so i just return one of the NapValue variants as a NapValue |
00:39:16 | disruptek | try to use variant objects instead; nim doesn't do method dispatch upon return type. |
00:41:12 | madprops | oh i see what those are now |
00:43:24 | disruptek | they work better in nim. |
00:49:48 | FromDiscord | <krab4t> disruptek ive found your brother https://github.com/ducdetronquito/express |
00:50:16 | disruptek | my MAN! |
00:52:59 | madprops | i dont' get the point of object variants if the field has to have a different name |
00:53:07 | madprops | i was hoping to just use "value" on each variant |
00:53:27 | disruptek | because they are a single type that holds arbitrarily disparate values. |
00:54:14 | FromDiscord | <exelotl> don't tell anyone, but I'm overloading `.` for the entity system in my gba game |
00:54:23 | disruptek | you're an animal. |
00:55:21 | FromDiscord | <exelotl> got really tired of writing self.data.foo, when 90% of the good stuff is in data, but self is the object of interest |
00:55:32 | FromDiscord | <exelotl> so now I just write self.foo :P |
01:02:56 | madprops | is there something like Cat(super::name:"Mike") ? |
01:03:32 | disruptek | procCall |
01:07:25 | madprops | procCall seems to be a way to call procs |
01:07:31 | madprops | not sure if i can use it for instantiation |
01:08:51 | disruptek | it's for super() calls. |
01:09:02 | disruptek | what are you trying to do? |
01:09:55 | madprops | basically i just want to return either int, float, string, or bool |
01:10:02 | madprops | from a proc |
01:10:40 | madprops | object variants are not that good because the user would have to use a specific property for each type |
01:11:09 | disruptek | you could have a proc that returns the value depending on the discriminator. |
01:11:34 | disruptek | but again, you cannot dispatch on return type. |
01:29:57 | FromDiscord | <yewpad> any optimizations recommendations? https://play.nim-lang.org/#ix=1Ygs |
01:38:07 | * | Kevin5 joined #nim |
01:43:01 | * | endragor joined #nim |
01:43:04 | * | vsantana joined #nim |
01:43:32 | * | endragor_ joined #nim |
01:47:17 | * | endragor quit (Ping timeout: 240 seconds) |
01:55:57 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:56:51 | zedeus | yewpad: https://play.nim-lang.org/#ix=1YmY |
01:57:18 | FromDiscord | <yewpad> nice! thank you |
02:09:10 | * | u9898287 joined #nim |
02:10:19 | u9898287 | Hi. I want to use a constant defined inside C's <errno.h>. How can I tell the compiler to compile and make errno.h symbols available? |
02:10:59 | u9898287 | to be more precise, I want to use EADDRINUSE (http://man7.org/linux/man-pages/man3/errno.3.html) |
02:11:03 | * | seni quit (Quit: Leaving) |
02:14:32 | stefantalpalaru | Go ahead and use it. It's already defined and exported in OS-specific modules: https://github.com/nim-lang/Nim/search?q=EADDRINUSE&unscoped_q=EADDRINUSE |
02:17:32 | u9898287 | `var EADDRINUSE* {.importc: "EADDRINUSE", header: "<errno.h>".}: cint` works thank you |
02:17:36 | * | u9898287 quit (Quit: u9898287) |
02:25:05 | * | vsantana quit (Remote host closed the connection) |
02:26:14 | * | u9898287 joined #nim |
02:32:23 | * | vsantana joined #nim |
02:32:38 | FromDiscord | <demotomohiro> u9898287, you can use `EADDRINUSE` just with `import posix` |
02:34:56 | * | ponyrider quit (Quit: WeeChat 2.6) |
02:40:26 | * | ponyrider joined #nim |
02:48:02 | * | lritter quit (Ping timeout: 240 seconds) |
02:49:01 | * | lritter joined #nim |
03:03:23 | zedeus | hmm, having trouble building devel using choosenim |
03:03:25 | zedeus | Error: unhandled exception: 'alignment' is not accessible using discriminant 'kind' of type 'TSym' [FieldError] |
03:04:32 | FromGitter | <iffy> I'm implementing a JSON interface with Nim, and I'd like to generate TypeScript typings from it. I was thinking of having the generating of typings be part of the compilation process (e.g. in static: blocks). Is there something like the opposite of `slurp` for writing to a file? Do you have a recommendation for a different way to generate the typings? |
03:08:20 | * | theelous3 quit (Read error: Connection reset by peer) |
03:09:17 | disruptek | iffy: you can writeFile in compile-time code. |
03:09:27 | disruptek | macros, static: etc. |
03:09:44 | FromGitter | <iffy> I thought I tried that... oh, maybe I did open(filename) |
03:10:54 | FromGitter | <iffy> Sure enough! Thank you, disruptek |
03:11:06 | leorize | zetashift, nisstyre: if you use vim then my plugin won't work :P |
03:11:30 | nisstyre | leorize: yeah I figured |
03:11:36 | nisstyre | I could just use nvim only for nim |
03:11:43 | nisstyre | that's not out of the question for me |
03:11:57 | leorize | or you could switch to nvim altogether :p |
03:12:45 | leorize | also YCM is a terrible plugin IMO |
03:12:52 | leorize | nowadays with LSP you can use clangd instead |
03:13:01 | * | theelous3 joined #nim |
03:21:20 | Tanger | Hey folks, with macros, is there a way to see what genSym is creating? |
03:21:28 | * | thomasross quit (Read error: Connection reset by peer) |
03:21:31 | * | thomasross_ joined #nim |
03:21:31 | * | thomasross_ is now known as thomasross |
03:22:08 | Tanger | dumptree gets me what it's calling behind the scenes, but I'd like to see the result and see what's up with that, I guess |
03:40:37 | * | rockcavera quit (Remote host closed the connection) |
04:05:08 | * | u9898287 quit (Quit: u9898287) |
04:15:46 | FromGitter | <iffy> expandMacros: maybe? |
04:22:38 | * | u9898287 joined #nim |
04:34:37 | * | Kevin5 quit (Ping timeout: 240 seconds) |
04:39:38 | * | nsf joined #nim |
04:44:53 | * | chemist69 quit (Ping timeout: 250 seconds) |
04:46:51 | * | chemist69 joined #nim |
04:52:17 | * | haldean joined #nim |
04:53:07 | haldean | hey there! probably an easy question but I'm a noob: if I have a C function I'm calling from nim, how do I pass it a null pointer? I tried passing 0 and pointer(0) and the first complains about types not matching and the second claims that 0 can't be converted to a pointer |
04:54:04 | haldean | technically I'm calling a function that's declared in a library (an OpenGL wrapper) and it wants an argument of type "pointer" |
04:59:57 | mipri | haldean: https://play.nim-lang.org/#ix=21Ah |
05:00:32 | haldean | oh perfect. thanks mipri! |
05:03:17 | * | u9898287 quit (Quit: u9898287) |
05:13:10 | * | Kevin5 joined #nim |
05:18:55 | * | nif quit (Quit: ...) |
05:19:04 | * | nif joined #nim |
05:29:34 | * | uu91 quit (Read error: Connection reset by peer) |
05:29:51 | * | uu91 joined #nim |
05:30:59 | * | haldean quit (Quit: Leaving) |
05:31:43 | * | uu91 quit (Read error: Connection reset by peer) |
05:31:59 | * | uu91 joined #nim |
05:38:13 | * | bacterio joined #nim |
05:46:02 | FromGitter | <Vindaar> @mratsim About that c/cpp 2x perf difference: not sure that was me. But I remember some forum post (?) about something like this |
05:46:23 | * | NimBot joined #nim |
06:01:57 | * | theelous3 quit (Ping timeout: 240 seconds) |
06:08:28 | * | Hexeratops joined #nim |
06:14:43 | * | ltriant_ quit (Ping timeout: 265 seconds) |
06:17:31 | * | Hexeratops quit (Quit: Leaving) |
06:19:58 | * | narimiran joined #nim |
06:26:28 | * | uu91 quit (Read error: Connection reset by peer) |
06:26:44 | * | uu91 joined #nim |
06:52:26 | * | vsantana quit (Remote host closed the connection) |
06:53:05 | * | vsantana joined #nim |
07:17:48 | Tanger | thanks Iffy! |
07:20:27 | * | solitudesf joined #nim |
07:26:16 | * | PMunch joined #nim |
07:32:52 | * | tane joined #nim |
07:33:59 | * | dddddd quit (Remote host closed the connection) |
07:37:22 | * | krux02 joined #nim |
07:41:38 | PMunch | Hmm, I want to delete 1/10th of the keys in a Table randomly. What would be the most efficient way of doing it? I was thinking either myTable.shuffle[0..myTable.size div 10] or for i in 0..(myTable.size div 10): myTable.del(myTable.keys.sample()) |
07:42:26 | Zevv | does the second recalculate the table size for each iteration then? |
07:43:20 | Zevv | and I'm pretty sure the del is more efficient then shuffling the whole thing. You either move 100% of the elements or only 10% of them |
07:44:10 | PMunch | Well I was thinking of grabbing the size before the loop |
07:44:14 | Zevv | oh wait I misread, you sample, but that seems like the right choice |
07:44:16 | PMunch | That was just an illustration :P |
07:44:34 | Zevv | yeah i see now, but i was reading while hopping on the train so |
07:46:35 | PMunch | Wait.. I can't get all the keys easily.. |
07:46:37 | PMunch | Hmm |
07:47:38 | tane | PMunch, get the keys once |
07:48:45 | tane | the random module could use a partialShuffle :) |
07:48:59 | tane | it's good for your usecase |
07:49:50 | lqdev[m] | guess what |
07:49:58 | lqdev[m] | termux, that terminal app for android, has nim 1.0.2 |
07:50:08 | lqdev[m] | in the repos |
07:50:14 | lqdev[m] | while arch is stuck at 0.18 |
07:51:15 | narimiran | lqdev[m]: it is too early to trigger me like that :P |
07:51:55 | Zevv | wow you're right. I can now stare at my phone for 43 seconds while it is munching away at hello world! |
07:52:33 | PMunch | Haha |
07:53:07 | Zevv | ph it was only 2.1, not that bad |
07:53:11 | PMunch | Wait, why does the Nim arch package depend on Python? https://www.archlinux.org/packages/community/x86_64/nim/ |
07:53:55 | * | Hideki_ joined #nim |
07:55:16 | Araq | must resist... |
07:55:33 | PMunch | Huh, never knew that Nim used Python for stuff |
07:56:09 | FromGitter | <zacharycarter> I ended up using NESM for my map de/serialization |
07:56:28 | FromGitter | <zacharycarter> pretty nice library |
07:56:36 | narimiran | for those of you who have missed it yesterday: https://i.imgflip.com/3g6z16.jpg |
07:56:55 | FromGitter | <zacharycarter> lolol |
07:57:55 | Araq | PMunch: it doesn't use Python for anything |
07:58:33 | * | Hideki_ quit (Ping timeout: 268 seconds) |
07:59:31 | narimiran | ahem, tools/nim-gdb.py, lib/pure/unidecode/gen.py :D |
07:59:46 | PMunch | What is lib/pure/unidecode/gen.py used for then? |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:02 | narimiran | "# Generates the unidecode.dat module" |
08:00:20 | narimiran | "# (c) 2010 Andreas Rumpf" :) |
08:00:46 | PMunch | I mean I guess the .dat module is also checked in |
08:00:58 | PMunch | So it's just there if it needs to be regenerated |
08:04:57 | * | gmpreussner joined #nim |
08:05:55 | Araq | narimiran: GDB requires Python, not nim |
08:06:50 | Araq | unidecode/gen.py is usually not run as PMunch said |
08:07:53 | narimiran | wait, let me report that to the very welcoming adult arch community |
08:08:02 | Araq | look, you cannot "package" random software without understanding it and hint the authors usually understand it best. which is why Linux's idea of PM is completely and utterly flawed |
08:10:13 | PMunch | Nothing stops us from packaging it and getting it into AUR though.. |
08:10:32 | PMunch | Or if we created a package script that could be run to package it properly that would probably be used instead |
08:10:40 | Araq | yeah that would work if there weren't 5 trillion different distros |
08:10:59 | Araq | and we have the script, it's 'koch distrohelper' |
08:12:18 | PMunch | There are many distros, but fewer discrete package formats |
08:12:31 | PMunch | Hmm, Error: cannot evaluate 'sizeof' because its type is not defined completely |
08:13:00 | PMunch | What does that mean? |
08:13:38 | * | lritter quit (Ping timeout: 240 seconds) |
08:13:56 | FromDiscord | <kodkuce> appimage it |
08:14:13 | FromDiscord | <kodkuce> or use void linux it better |
08:22:19 | PMunch | Hmm, the posix module seems to have a bug: http://ix.io/21AA |
08:22:20 | disbot | ^ play at https://play.nim-lang.org/#ix=21AA 😏 |
08:22:37 | PMunch | disruptek, can you fix your bot please.. |
08:22:58 | PMunch | Not everything that's an ix.io paste is a playground link.. |
08:24:30 | Araq | PMunch, maybe you used and .incompleteStruct |
08:24:34 | Araq | *an |
08:24:54 | * | livcd joined #nim |
08:25:03 | PMunch | I was trying to do sizeof(Sockaddr_storage) |
08:25:37 | PMunch | This thing: https://github.com/nim-lang/Nim/blob/version-1-0/lib/posix/posix_other.nim#L407 |
08:25:45 | Araq | meh probably caused by .importc then |
08:26:55 | Araq | er this looks really incomplete |
08:27:05 | PMunch | What do you mean? |
08:27:30 | Araq | I'm sure it's bigger than just 'ss_family' |
08:27:45 | Araq | so it's good that you cannot take its sizeof, maybe |
08:28:00 | Araq | if you try to use it at compiletime |
08:29:31 | PMunch | Oh wait, that was from posix_other. This is the one that is actually used on my system: https://github.com/nim-lang/Nim/blob/version-1-0/lib/posix/posix_linux_amd64.nim#L432 |
08:34:33 | PMunch | Hmm, but what about the error.. |
08:34:36 | PMunch | That's worse.. |
08:39:07 | PMunch | Throwing a {.importc: "__ss_padding".} in the struct definition works fine |
08:41:59 | * | sealmove quit (Quit: WeeChat 2.6) |
08:44:12 | * | clyybber joined #nim |
08:47:31 | lqdev[m] | I'm seriously considering learning to use micro full-time to develop code, lol. not sure if it'll bring any real benefits over vscode (apart from being lightweight, of course) |
08:47:48 | PMunch | Micro? |
08:48:24 | lqdev[m] | https://micro-editor.github.io/ |
08:50:44 | livcd | lqdev[m]: rewrite in Nim :F |
08:51:14 | mipri | https://github.com/fox0430/moe is getting pretty good. last I looked the undo wasn't that pleasant. |
08:51:19 | clyybber | lqdev[m]: It uses tcell as a library. I'm considering porting that to nim |
08:51:20 | narimiran | "Does micro support Vi keybindings? No, if you want to use Vim then use Vim." -- thanks for making this easy for me :) |
08:52:02 | * | floppydh joined #nim |
08:52:11 | FromDiscord | <exelotl> Would be good to allow the {.size.} pragma to work with things bigger than 8 bytes e.g. imported C structures |
08:53:07 | clyybber | solitudesf: This is the lritter thats here on IRC btw: https://bitbucket.org/duangle/scopes/commits/all |
08:53:18 | PMunch | Araq, created a PR that fixes the issue I was having, but if this is the way to fix it there is probably a bit more work to do in order to make it better: https://github.com/nim-lang/Nim/pull/12655 |
08:53:25 | clyybber | Since I follow you on GH I saw you followed an lritter, but thats a different one |
08:53:50 | FromDiscord | <exelotl> Right now I can't do sizeof(oamMem) even though I know it has 128 items and I know how big an oam struct should be |
08:54:11 | FromDiscord | <exelotl> (at compile time that is) |
08:56:16 | FromDiscord | <mratsim> very nice: https://forum.nim-lang.org/t/5509 |
08:57:12 | PMunch | Hmm, moe and micro looks interesting lqdev[m] and mipri. Have any of you tried kakoune by the way? |
08:57:57 | PMunch | mratsim, oh wow, that's really cool |
09:04:12 | solitudesf | clyybber, thanks, i figured that was wrong one |
09:05:33 | solitudesf | PMunch, nimlsp + kakoune is pretty pleasant combo. |
09:06:17 | leorize | PMunch: if you're an arch user then you can ask them on arch-dev mailing list to release the nim package back to AUR as it's maintainer don't appear to have any interest at actually maintaining it |
09:06:21 | PMunch | I tried out kakoune a while ago, but that was right after I had set up my Vim environment properly and didn't want to give up some of the features (that I now don't use anyways). |
09:06:31 | clyybber | I concur, kakoune is great (though I don't use lsp yet) |
09:06:35 | solitudesf | but i wouldn't recommend kakoune to anyone who has no signs of turboautism |
09:06:46 | clyybber | lol |
09:06:52 | PMunch | Haha turboautism? |
09:07:03 | PMunch | leorize, yeah I guess I should |
09:07:25 | PMunch | Really though we should just get it removed and create a choosenim package if it doesn't exist yet. |
09:07:52 | PMunch | Maybe even just call that package Nim, but actually just install choosenim and stable. |
09:08:45 | leorize | please, no |
09:09:01 | leorize | if you want choosenim, make it choosenim |
09:09:19 | leorize | and some actually like having packages installed from one source |
09:09:36 | zedeus | speaking of choosenim, does `choosenim update devel` work for you? |
09:09:49 | zedeus | mine fails at the end with this: |
09:09:50 | zedeus | Error: unhandled exception: 'alignment' is not accessible using discriminant 'kind' of type 'TSym' [FieldError] |
09:09:59 | clyybber | ha |
09:10:02 | leorize | probably a devel pug |
09:10:05 | leorize | bug* |
09:10:31 | FromGitter | <zacharycarter> I wish kak worked on windows natively - using WSL and then compiling with cl is annoying |
09:10:45 | FromGitter | <zacharycarter> I think for windows vscode is the best option |
09:11:22 | clyybber | zacharycarter: Fear not: https://github.com/71/dance |
09:11:32 | clyybber | Those are kakoune like keybindings for VSC |
09:12:11 | Araq | zedeus, I have a fix for that, but in an unmergable PR |
09:12:16 | Araq | :-( |
09:12:19 | zedeus | aw |
09:12:27 | leorize | I like kakoune but I still love my semantic highlighting :P |
09:12:44 | FromGitter | <zacharycarter> ah cool |
09:12:58 | leorize | does they have highlighting for trailing whitespace yet? |
09:13:17 | clyybber | Should be pretty easy to do |
09:13:43 | leorize | last time I checked they have it for *all* whitespace but not trailing |
09:13:47 | PMunch | What is the difference between `system.createU` and `system/ansi_c.c_malloc` |
09:14:10 | clyybber | leorize: Just append \n to the regex highlighter, I think |
09:14:53 | clyybber | leorize: But it doesn't matter much since kakoune removes trailing whitespace anyways afaik |
09:15:20 | leorize | still not merged :( https://github.com/mawww/kakoune/pull/2256 |
09:16:16 | PMunch | Ah okay, looking at the implementation, not much: https://github.com/nim-lang/Nim/blob/version-1-0/lib/system.nim#L2424 |
09:18:38 | PMunch | Hmm, where is dealloc implemented? I tried to use it to free a pointer I got from some C code, but that didn't work and I had to use ansi_c.c_free |
09:18:55 | PMunch | But `create` seems to be exactly the same as `alloc` |
09:19:40 | leorize | just use `free` |
09:19:49 | leorize | create is just a wrapper for `alloc` |
09:20:01 | leorize | use `dealloc` I mean |
09:20:21 | PMunch | It didn't work though |
09:20:25 | PMunch | Just gave me an error |
09:20:57 | FromGitter | <zacharycarter> will dealloc work with memory that wasn't created using alloc? |
09:21:01 | FromGitter | <zacharycarter> or reserved rather |
09:21:03 | FromGitter | <zacharycarter> I doubt it |
09:21:38 | FromGitter | <zacharycarter> if the C code made the allocation I think you'd need to use free |
09:21:40 | Araq | alloc != malloc |
09:21:45 | Araq | dealloc != free |
09:21:51 | FromGitter | <zacharycarter> yeah exaclty |
09:21:57 | Araq | all hell breaks lose if you mix them, don't. |
09:22:48 | clyybber | Yeah, I can make the jack server crash from a client by doing that :) |
09:23:12 | leorize | that sounds a bit wrong :p |
09:23:46 | clyybber | lol |
09:24:56 | PMunch | So I shouldn't use `create` either? |
09:25:14 | PMunch | I should use `c_malloc` from ansi_c` |
09:25:40 | clyybber | PMunch: What do you want to do again? |
09:26:13 | PMunch | Allocate some memory and pass it back to the C program that loaded my DLL who will then free it down the road |
09:26:24 | clyybber | Yeah, use c_malloc then |
09:26:42 | FromDiscord | <Stuffe> I would like to create a webserver where each page is defined in just one file (PHP style). The best way I can think of would be to import all files from a directory on compile time and then find a way to call the procs in the files by string name. Is this possible in NIM? |
09:27:17 | clyybber | Yeah |
09:27:28 | PMunch | I did something like that here Stuffe: https://github.com/PMunch/webexperiment |
09:27:48 | FromDiscord | <Stuffe> @ PMunch ok thanks, I will check out your link |
09:28:04 | PMunch | It compiles every page into a DLL, then when it gets a request it passes it to the DLL that listens to that route |
09:28:23 | PMunch | And then it checks if your Nim code has updated and will re-compile the DLL |
09:29:05 | FromDiscord | <Stuffe> So the main file compiles a separate .so file on compile time and then imports it right after? |
09:29:15 | FromDiscord | <Stuffe> Or do you have to run several commands? sorry if its a dumb question |
09:31:36 | FromDiscord | <Stuffe> * DLL not .so |
09:32:51 | clyybber | You should be able to achieve the same a bit easier with hotcodereloading |
09:34:58 | PMunch | clyybber, yeah this was written right before that became a thing :P |
09:35:06 | PMunch | Or right after when no-one knew how it worked |
09:35:48 | PMunch | But Stuffe, not quite. The test.nim file is all that is initially compiled IIRC, then that compiles the so files when they are needed |
09:36:28 | PMunch | https://github.com/PMunch/webexperiment/blob/master/test.nim#L30 |
09:37:20 | PMunch | As the name of that repo implies, it is very experimental |
09:37:30 | FromDiscord | <Stuffe> Ok, I see, thanks guys. I will check out both things |
09:37:53 | PMunch | And it only works on Linux IIRC, but that's just because of some flags and string names and such I think |
09:38:09 | FromDiscord | <Stuffe> I was also considering just having one script run first to just generate the source code and then just call that |
09:39:04 | FromDiscord | <Stuffe> but that feels a bit dirty |
09:40:12 | PMunch | I mean if you don't want the dynamic nature of PHP where you can edit files while the page is live without manually recompiling you can just use source code filters: https://nim-lang.org/docs/filters.html |
09:40:43 | PMunch | Like this: https://nim-lang.org/docs/filters.html#available-filters-stdtmpl-filter |
09:41:29 | PMunch | Then in your main router you just call the generateHTMLPage of the applicable page (or do something similar like what I do in the autorouter of the webexperiment |
09:42:50 | PMunch | Or some other scheme |
09:43:16 | PMunch | Traverse the path and find the deepest file that matches and run that with the rest of the path as arguments perhaps |
09:43:45 | lqdev[m] | PMunch: I tried it, but I don't really like vi/vim-based editors |
09:44:03 | lqdev[m] | I may write my own CLI editor at some point, though |
09:44:22 | PMunch | kakoune isn't really vim-based though |
09:44:30 | * | letto quit (Quit: Konversation terminated!) |
09:45:06 | * | letto joined #nim |
09:45:14 | lqdev[m] | it uses a similar approach with modes |
09:45:25 | lqdev[m] | which is what I don't like about vim |
09:45:30 | * | Vladar joined #nim |
09:45:37 | PMunch | Ah rgiht |
09:47:11 | lqdev[m] | I'm fine with commands like :w but having to press esc to change the mode is annoying. also, I'm not used to these commands used for manipulating text |
09:47:16 | lqdev[m] | I prefer a classic editing experience |
09:47:46 | PMunch | Rebinding Esc to CapsLock is almost required to use Vim IMO |
09:47:49 | lqdev[m] | there's one library I wanted to try, and that library is illwill |
09:47:59 | PMunch | Just makes it 100x more practical |
09:48:13 | lqdev[m] | writing some small editor using that might be a fun project. |
09:48:24 | Araq | capslock? that key that shouldn't exist? |
09:48:30 | PMunch | What do you mean by commands used for manipulating text? |
09:48:31 | Araq | that's what you want to pess all the time? |
09:48:47 | PMunch | Araq, exactly, that's what makes it so nice to rebind to an actual useful key |
09:49:05 | Araq | a total alien thought for me, but ok |
09:49:07 | FromDiscord | <mratsim> Thanks to Vim users, the new Macbooks will have an escape key: https://news.ycombinator.com/item?id=21524088 |
09:49:13 | lqdev[m] | PMunch: these arcane key commands you use for moving and editing and such |
09:49:20 | PMunch | I mean it's the function of the key, not its placement that's the issue |
09:49:42 | lqdev[m] | @mratsim wait. did macs not have an esc key? |
09:49:45 | FromDiscord | <mratsim> I rebind caps lock to compose usually |
09:49:54 | FromDiscord | <mratsim> yep, the Touchbar mac had no escape keys |
09:50:01 | Araq | mratsim: this is ... I miss the DEL key |
09:50:08 | lqdev[m] | ah, it's the touchbar ones. |
09:50:17 | PMunch | Araq, I have loads of weird keybindings. Caps is escape, unless held down, then its Ctrl. Tab is tab, unless held down, then it's Meta |
09:50:22 | FromDiscord | <mratsim> what you're on mac now? |
09:50:30 | PMunch | And of course my entire keyboard is Dvorak :P |
09:50:44 | PMunch | Araq, wait, you don't have a del key? |
09:50:55 | FromDiscord | <mratsim> Macs have no del keys |
09:51:10 | FromDiscord | <mratsim> you need to do Fn+backspace |
09:51:22 | Araq | macs don't have shit and only survived because of massive stupid fanboism |
09:51:24 | PMunch | That's just stupid.. |
09:51:45 | lqdev[m] | Araq: so true |
09:52:01 | FromDiscord | <mratsim> my next laptop will probably be a Lenovo, their keyboard is really good, though their touchpad quality is going down |
09:52:35 | PMunch | mratsim, don't need a touchpad when you've got that excellent track-nub :) |
09:52:53 | lqdev[m] | paying thousands of dollars for a machine that'll last for maybe a year and then having apple tell you to fuck yourself and buy a new one is just ridiculous |
09:52:55 | PMunch | I barely ever use the touchpad on my Thinkpad |
09:52:56 | FromDiscord | <mratsim> maybe I'll learn how to use it, but I want a backup |
09:53:12 | lqdev[m] | and of course, their overall design weirdnesses |
09:53:17 | PMunch | I grew up using that, works well once you're used to it |
09:53:44 | FromDiscord | <mratsim> I've got my mac since 2015. Still good though the keyboard doesn't register all keypresses and it has been victim of the Retina Staingate |
09:54:06 | FromDiscord | <mratsim> I think 2020 would be a nice time to change, 5 years of service |
09:54:55 | PMunch | But it is not without it's oddities either. Ctrl and Fn are swapped (so Fn is bottom left), but that can be fixed in the BIOS. But it also has a print screen key right between AltGr and right Ctrl, so I think I have about a thousand screenshots of random things.. |
09:55:04 | lqdev[m] | I'm planning on buying a laptop at some point in the future, but it's not a priority |
09:55:35 | FromDiscord | <mratsim> I'm waiting for 2020 for the new CPUs with crypto primitives and deep learning primitives |
09:55:53 | PMunch | I mean, it's not impossible to rebind that as well though |
09:57:24 | clyybber | lqdev[m]: I'm also considering using illwill |
10:01:33 | Araq | mratsim: are you kidding or are these coming? |
10:02:27 | clyybber | not kidding |
10:02:37 | FromDiscord | <mratsim> not kidding |
10:02:51 | * | CcxWrk quit (Ping timeout: 240 seconds) |
10:02:56 | Araq | what's a "deep learning primitive"? |
10:04:06 | FromDiscord | <mratsim> https://en.wikipedia.org/wiki/AVX-512#New_instructions_in_AVX-512_VNNI |
10:04:15 | FromDiscord | <mratsim> AVX512 VNNI (Vector Neural Instruction) |
10:04:25 | FromDiscord | <mratsim> they also have 8x8 int8 matmul |
10:05:13 | FromDiscord | <mratsim> and for crypto: IFMA (integer fused mul add) and GFNI (Galois Field instruction, an Elliptic Curve is a Galois Field) |
10:05:44 | FromDiscord | <mratsim> Thankfully Nim has alignment support now 😉 |
10:06:09 | FromDiscord | <mratsim> aligned allocator would be nice as well (takes only 10 lines) |
10:08:35 | Araq | PRs are always welcome |
10:09:04 | Araq | I was against this feature because of the allocator issue |
10:09:20 | Araq | yes we can fix our allocator. but we also support -d:useMalloc |
10:09:34 | FromDiscord | <mratsim> useMalloc doesn't do alignment |
10:09:40 | Araq | exactly |
10:09:59 | FromDiscord | <Chiqqum_Ngbata> Link to detail on alignment support? |
10:10:02 | Araq | and it's not just 'malloc', alignment is still a niche feature |
10:10:05 | FromDiscord | <mratsim> Here is my aligned allocator: https://github.com/numforge/laser/blob/d1e6ae6106564bfb350d4e566261df97dbb578b3/laser/tensor/allocator.nim#L17-L29 |
10:10:26 | krux02 | https://linux.die.net/man/3/aligned_alloc |
10:10:30 | krux02 | https://docs.microsoft.com/de-de/cpp/c-runtime-library/reference/aligned-malloc?view=vs-2019 |
10:11:02 | FromDiscord | <mratsim> It's not "still" it's it "became" |
10:11:15 | FromDiscord | <mratsim> before SIMD didn't have unaligned loads and stores |
10:11:29 | FromDiscord | <mratsim> and even on some platforms you can't do unaligned load/stores |
10:11:45 | Araq | http://developer.download.nvidia.com/compute/cuda/2_3/toolkit/docs/online/group__CUDART__MEMORY_gc63ffd93e344b939d6399199d8b12fef.html |
10:11:52 | Araq | " The allocated memory is suitably aligned for any kind of variable. " |
10:11:58 | Araq | aka not under your control |
10:12:15 | FromDiscord | <mratsim> Comone, it's a GPU allocator |
10:12:18 | Araq | and mratsim, your 10 lines are terribly broken |
10:12:21 | FromDiscord | <mratsim> Come on* |
10:12:52 | Araq | my point is, when we support something we better support it properly |
10:13:07 | * | ng0 joined #nim |
10:13:10 | FromDiscord | <mratsim> ah sorry my alignment code is here: https://github.com/numforge/laser/blob/master/laser/private/memory.nim#L8-L20 |
10:13:19 | FromDiscord | <Chiqqum_Ngbata> Arm neon when |
10:13:38 | Araq | mratsim: ah ok. |
10:14:19 | FromDiscord | <mratsim> @Chiqqum_Ngbata Nim already supports Neon |
10:14:49 | FromDiscord | <mratsim> You wrap it like I do for x86 here: https://github.com/numforge/laser/blob/master/laser/simd.nim#L6 |
10:15:05 | FromDiscord | <mratsim> One day i'll have the time to do that, ... in a year or so 😛 |
10:17:26 | Araq | what about 'realloc'? does it remember the malloc'ed alignment? |
10:17:35 | Araq | do we have a realloc that takes an alignment? |
10:18:21 | FromDiscord | <mratsim> C++ standard lib provides an aligned_alloc() proc that takes a buffer, an alignment and returns a pointer in the buffer with the proper alignment |
10:18:21 | Araq | so many problems, so little gain. A library solution would have been better than a language extension |
10:18:44 | FromDiscord | <mratsim> @narimiran, since you removed mapIt I think you should close this: https://github.com/nim-lang/Nim/issues/12639 |
10:18:47 | disbot | ^ `mapIt` can't be chained when used to generated func-s |
10:18:47 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21AL 😏 |
10:18:54 | clyybber | PMunch: The only thing I'm really missing with kakoune is code folding |
10:19:35 | krux02 | clyybber: kakoune has Nim support now? |
10:20:02 | clyybber | krux02: It had nim highlighting for a long time, but with nim-lsp and kak-lsp it also has completion support and stuff |
10:20:24 | krux02 | cool |
10:22:00 | narimiran | @mratsim the error message is still the same |
10:22:22 | krux02 | lsp seems to pay off eventually for new editors to become possible. |
10:22:41 | clyybber | Yeah, even though I think the protocol is kinda messy |
10:23:07 | krux02 | I think the entire concept "a server" is bonkers. |
10:23:22 | clyybber | yeah |
10:23:28 | * | filcuc joined #nim |
10:23:40 | Araq | I think it's quite inevitable |
10:24:17 | clyybber | hmm, otoh how would you do completion without it? |
10:25:56 | krux02 | I think a uniform API for shared libraries would have done the same as well. Yea maybe it would have made it harder to write backends in Java/C#/Javascipt/python but at the same time, I don't want those backends anyway. |
10:26:20 | krux02 | anyway |
10:26:27 | * | u9898287 joined #nim |
10:27:12 | krux02 | Araq: regarding your comment in my PR: "makeCString does not do the same thing..." |
10:27:23 | Araq | yes? |
10:27:25 | krux02 | can you elaborate a bit more? |
10:27:45 | Araq | when I wrote the code I knew about makeCString and I wanted something else |
10:27:56 | krux02 | yea ... |
10:27:59 | krux02 | any example? |
10:28:07 | Araq | asm """ |
10:28:11 | Araq | mov rax, 3 |
10:28:12 | Araq | """ |
10:28:25 | Araq | needs "" around every single line for GCC |
10:28:34 | krux02 | should work with makeCString |
10:28:34 | Araq | Nim doesn't require this |
10:29:09 | krux02 | makeCString converts every newline in "\n" |
10:29:16 | krux02 | works flawlessly |
10:29:51 | PMunch | clyybber code folding is a feature that I've barely ever used |
10:29:58 | krux02 | you could argue that the generated inline assembly is less readable with "\n", but it is generated code anyway. |
10:30:14 | Araq | exactly, it's less readable |
10:30:27 | Araq | I mean ok |
10:30:41 | Araq | we don't optimize the C code for readability anyway |
10:30:43 | clyybber | PMunch: Me neither, because kakoune doesn't have it :P But when working on compiler code or some other big nested code I really long it |
10:31:01 | Araq | but why make it worse deliberately |
10:31:31 | clyybber | krux02: Where does the "\n" end up? |
10:31:41 | Araq | what concerns me more is this though: |
10:31:55 | krux02 | I did not want to have yet another variant of makeCString |
10:31:59 | Araq | are these actually read C string literals or is that a GCC extension |
10:32:03 | Araq | *real |
10:32:13 | Araq | that happens to look like C string literals |
10:32:28 | Araq | for example, we translate ? into \? |
10:32:35 | Araq | because of trigraphs |
10:33:55 | krux02 | you can have the same arguments for other literals that come from tripleStrLit nodes. |
10:34:24 | Araq | https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#AssemblerTemplate |
10:35:13 | Araq | read the "Special format strings" section |
10:36:18 | Araq | but I suppose we don't want to transform % into %% |
10:37:45 | Araq | unless maybe it's inside a string literal inside the asm string literal |
10:40:10 | Araq | which is what your PR tried to fix... why do we need string literal support in the assembler? and if we support it do we want to translate % into %% for GCC? Does GCC even need this? |
10:40:29 | Araq | the documentation isn't clear |
10:41:50 | krux02 | well, % is translated into %, because % isn't a special character in string literals. |
10:41:57 | u9898287 | Hi. Is there any convenience function to get a (little/big/native endian) byte representation of int64 in the standard library? Something similar to https://doc.rust-lang.org/std/primitive.i64.html#method.to_ne_bytes |
10:42:21 | krux02 | that means %% in the nim asm stmt means the exact same thing as it means in the backed gcc arm statement. |
10:42:49 | Araq | krux02, don't tell me, add it to your test case |
10:43:17 | krux02 | Araq, I provided a test case with an example where a string literals inside the asm string is required. |
10:44:00 | Araq | .incbin "../testdata/string.txt" |
10:44:05 | Araq | ^ no % in there |
10:44:13 | krux02 | that is what you want |
10:45:22 | Araq | yes, because when you read it |
10:45:23 | Araq | > In addition to the tokens described by the input, output, and goto operands |
10:45:36 | Araq | it means inside the string literal there are "tokens" |
10:45:55 | Araq | and it's not clear where a string literal is a token of its own |
10:46:09 | Araq | and if that means % is a literal % |
10:46:23 | Araq | it's a reasonable asumption though, so test it please |
10:46:58 | krux02 | pleas specify the behavior first. |
10:48:45 | Araq | I have "a%b" inside a string literal *inside* the asm string literal |
10:49:00 | krux02 | you want `%` to be translated to `%`, or do yo want it to be escaped so that the gcc % feature can't be used? |
10:49:00 | Araq | and it should mean 'a followed by a single % followed by b' |
10:49:45 | Araq | I want to ensure that GCC is somewhat reasonable about string literals inside asm code |
10:50:33 | Araq | but if it isn't, maybe we still want to be compatible with it |
10:50:38 | tane | howdy, quick question: can I transform a `ptr T` and a length into an openArray[T]? |
10:50:49 | Araq | or maybe we'll say "screw this, use an .emit statement" |
10:51:53 | clyybber | No, please. The asm statement should be as good as possible |
10:57:08 | krux02 | Araq: I just tested it locally, a % inside string literals inside the asm statement is just a regular character, no special treatment. |
10:58:36 | krux02 | So should I add a test that ensures that future Araq won't introduce escaping of % characters and therefore break string literals again? |
10:58:45 | Araq | krux02, alright, very well. clyybber happy too? |
10:59:03 | Araq | krux02, nah local testing was sufficient as far as I'm concerned |
10:59:41 | clyybber | clyybber happy |
11:00:37 | Araq | krux02, now it's still a breaking change :P |
11:00:52 | krux02 | not really |
11:00:55 | Araq | because previously asm was smart |
11:00:58 | Araq | "smart" |
11:00:59 | Araq | if x[j] in {'"', ':'}: |
11:00:59 | Araq | # don't modify the line if already in quotes or |
11:00:59 | Araq | # some clobber register list: |
11:00:59 | Araq | add(result, x); add(result, "\L") |
11:01:05 | Araq | so I can have both |
11:01:06 | Araq | """ |
11:01:11 | Araq | mov rax, 0 |
11:01:12 | Araq | """ |
11:01:15 | Araq | as well as |
11:01:17 | Araq | """ |
11:01:21 | Araq | "mov rax, 0" |
11:01:22 | Araq | """ |
11:01:27 | Araq | and they used to be the same :P |
11:01:34 | krux02 | yea |
11:01:46 | clyybber | IMO, we should only support |
11:01:47 | krux02 | I wonder why |
11:01:49 | clyybber | """ |
11:01:53 | clyybber | mov rax, 0 |
11:01:54 | clyybber | """ |
11:01:56 | clyybber | Anyways |
11:02:18 | clyybber | bbl |
11:02:19 | * | clyybber quit (Quit: WeeChat 2.6) |
11:02:48 | krux02 | I don't think the double quotes inside the tripple quotes do have any example or test case. |
11:03:07 | Araq | krux02, convenience. we started with requiring the "" around every line and then it became annoying and we supported both ways |
11:03:35 | krux02 | interesting, that explains a lot. |
11:03:43 | krux02 | but why did you require the ""? |
11:04:09 | Araq | not sure, I think it worked like .emit |
11:04:26 | Araq | and so GCC required the "" everywhere |
11:05:21 | krux02 | well, c++ has now the multiline string literals |
11:12:07 | * | Kevin5 quit (Quit: Leaving) |
11:15:37 | FromGitter | <mratsim> I use this to have multiline asm: https://github.com/mratsim/weave/blob/master/picasso/instrumentation/timers.nim#L46-L53 |
11:16:05 | FromGitter | <mratsim> Nim multiline literals are very ugly |
11:16:30 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
11:17:25 | FromGitter | <mratsim> either you align everything on the left, or you need to strip tabs/spaces but then it's a pain to control indentation |
11:20:03 | * | solitudesf quit (Ping timeout: 240 seconds) |
11:32:59 | * | Hideki_ joined #nim |
11:36:04 | * | tklohna joined #nim |
11:36:56 | krux02 | Araq: I found some dead code in Nim that still uses the old asm statement syntax |
11:37:05 | krux02 | lib/systm/arithm.nim |
11:37:21 | krux02 | I don't know what to do with it. Should I delete it? |
11:37:28 | krux02 | It is dead. |
11:37:35 | * | Hideki_ quit (Ping timeout: 265 seconds) |
11:38:10 | * | filcuc quit (Read error: Connection reset by peer) |
11:39:03 | * | rockcavera joined #nim |
11:52:50 | * | narimiran quit (Ping timeout: 240 seconds) |
11:53:37 | * | u9898287 quit (Quit: u9898287) |
11:53:54 | * | u9898287 joined #nim |
11:56:37 | * | u9898287 quit (Client Quit) |
11:56:52 | * | u9898287 joined #nim |
12:07:45 | Araq | and then what? everything is fine with your PR because nobody ever used the 'asm' keyword in Nim? |
12:09:05 | FromGitter | <alehander92> i think for those things |
12:09:16 | FromGitter | <alehander92> we can have some tooling |
12:09:20 | Araq | mratsim: that's your opinion, I prefer the asm """ where I don't have to put "" around every line |
12:09:28 | FromGitter | <alehander92> which can generate suggested autofixes |
12:09:41 | FromGitter | <alehander92> similarly to how we have old behavior switches |
12:09:54 | Araq | alehander92: ridiculous, tooling is not a substitute for professional bugfixes |
12:09:54 | FromGitter | <alehander92> i agree it might be pretty complicated in some cases |
12:09:57 | FromGitter | <alehander92> just an idea |
12:10:13 | FromGitter | <alehander92> well, i am talking more about stuff where |
12:10:19 | FromGitter | <alehander92> it should be possible to fix it mechanically |
12:10:27 | Araq | if you want to fix a bug, fix the bug, don't alter the behaviour at the same time because it's less work |
12:10:38 | FromGitter | <alehander92> simple syntax tweaks etc |
12:11:29 | Araq | Nim version 1.2: we changed the asm statement because previously krux02 personally didn't use it |
12:11:53 | * | seni joined #nim |
12:11:53 | Araq | that's not a development process. |
12:12:13 | Araq | it's utterly unprofessional and not acceptable. |
12:13:55 | krux02 | sorry? |
12:14:04 | krux02 | but the asm statement was broken? |
12:14:24 | Araq | so fix it. Without changing the behaviour. |
12:14:32 | Araq | it's possible. |
12:14:36 | krux02 | if the asm statement would not have been broken, I would not be forced to fix it |
12:14:48 | Araq | your fix breaks it. |
12:15:18 | krux02 | you don't have a test for it. |
12:16:00 | Araq | yeah so I read the code and compared the solutions and figured out it's a breaking change. |
12:16:14 | krux02 | If you would have a spec and a test, I would make an RFC. Without it, there is no defined behavior that is broken. |
12:16:45 | Araq | nope, wrong, not everything that is not covered by a spec can broken nillywilly |
12:17:25 | krux02 | it not just not covered by a spec in is neither speced nor tested |
12:17:37 | * | nsf quit (Quit: WeeChat 2.6) |
12:17:59 | krux02 | And the comment in the code is hard to anderstand as well. |
12:18:14 | Araq | I managed to understand it. |
12:18:23 | krux02 | But I will add a lagacy fag for the compiler |
12:18:29 | krux02 | you wrote it? |
12:18:30 | Araq | no, just fix the bug |
12:18:39 | Araq | or let it be |
12:18:48 | Araq | but don't break somebody's code when you're at it |
12:28:39 | FromGitter | <Willyboar> RIP awesome-nim |
12:31:18 | * | endragor_ quit (Remote host closed the connection) |
12:33:16 | FromDiscord | <mratsim> well someone can fork and adopt it |
12:34:22 | FromGitter | <Willyboar> I believe awesome-nim must stay alive |
12:46:50 | * | Hideki_ joined #nim |
12:51:10 | * | livcd quit (*.net *.split) |
12:51:11 | * | bacterio quit (*.net *.split) |
12:51:12 | * | rayman22201 quit (*.net *.split) |
12:51:12 | * | lbart quit (*.net *.split) |
12:51:12 | * | uvegbot quit (*.net *.split) |
12:51:12 | * | nixfreak quit (*.net *.split) |
12:51:14 | * | JStoker quit (*.net *.split) |
12:51:14 | * | Amun_Ra quit (*.net *.split) |
12:51:14 | * | Sargun quit (*.net *.split) |
12:51:14 | * | zama quit (*.net *.split) |
12:51:15 | * | FromDiscord quit (*.net *.split) |
12:51:15 | * | SunDwarf quit (*.net *.split) |
12:51:16 | * | r4vi quit (*.net *.split) |
12:51:16 | * | odc quit (*.net *.split) |
12:51:16 | * | jken quit (*.net *.split) |
12:51:16 | * | EastByte quit (*.net *.split) |
12:53:55 | * | livcd joined #nim |
12:53:55 | * | bacterio joined #nim |
12:53:55 | * | rayman22201 joined #nim |
12:53:55 | * | lbart joined #nim |
12:53:55 | * | uvegbot joined #nim |
12:53:55 | * | nixfreak joined #nim |
12:53:55 | * | jken joined #nim |
12:53:55 | * | JStoker joined #nim |
12:53:55 | * | Amun_Ra joined #nim |
12:53:55 | * | Sargun joined #nim |
12:53:55 | * | zama joined #nim |
12:53:55 | * | FromDiscord joined #nim |
12:53:55 | * | SunDwarf joined #nim |
12:53:55 | * | odc joined #nim |
12:53:55 | * | r4vi joined #nim |
12:53:55 | * | EastByte joined #nim |
12:54:51 | dom96 | Thank you Araq for enforcing our backwards compatibility promises. |
12:56:52 | * | FromDiscord quit (Read error: Connection reset by peer) |
12:58:15 | * | FromDiscord joined #nim |
12:59:29 | * | Hideki_ quit (Ping timeout: 268 seconds) |
13:09:07 | * | abm joined #nim |
13:15:41 | * | u9898287 quit (Quit: u9898287) |
13:19:48 | FromDiscord | <kodkuce> vscode users, does it troll you, i am constantly getting unused warnings even i am using it ? |
13:24:58 | Araq | dunno, mine is always silent |
13:27:33 | PMunch | Hmm, when I'm building my so with --threads:on it segfaults randomly in "lowGauge" |
13:27:45 | PMunch | From lib/system/avltree.nim |
13:31:10 | * | tklohna quit (Ping timeout: 265 seconds) |
13:31:24 | PMunch | The backtrace from gdb: http://ix.io/21Bh |
13:31:25 | disbot | ^ play at https://play.nim-lang.org/#ix=21Bh 😏 |
13:31:39 | PMunch | I'm seriously considering to kick this bot.. |
13:31:46 | FromGitter | <alehander92> i like it |
13:31:50 | FromGitter | <alehander92> what's the problem with it |
13:31:57 | PMunch | Click the link it created |
13:32:04 | PMunch | Does that look like Nim to you? |
13:32:09 | FromGitter | <alehander92> well, it should just improve the nim detection |
13:32:14 | Zevv | "that is a bug" was the last thing I heard about that |
13:32:16 | PMunch | Yeah.. |
13:32:17 | Zevv | well FIX IT |
13:32:33 | PMunch | I have nothing against the concept of the bot |
13:32:35 | Zevv | if compiles(content): post_link() |
13:32:36 | FromGitter | <alehander92> if only we lived in a open source world |
13:32:42 | PMunch | But the current implementation is just annoying |
13:32:56 | Zevv | considered "/ignore disbot" ? |
13:33:19 | FromGitter | <alehander92> exactly |
13:35:11 | FromDiscord | <mratsim> just ping @disruptek |
13:35:18 | dom96 | I'd like it to post links to GitHub issues, that would be useful :) |
13:35:47 | FromDiscord | <mratsim> Gitter already does that for you though |
13:36:10 | FromDiscord | <mratsim> If it could post a link when someone adds a RFC also |
13:36:39 | dom96 | Yeah, but Gitter is a slow and buggy web app that as far as I can tell hasn't received an update in years |
13:38:17 | shashlick | Hard to detect Nim cause most pastes here will be for broken code |
13:38:43 | PMunch | Compiled with --debugger:native and got this: http://ix.io/21Bk |
13:38:43 | disbot | ^ play at https://play.nim-lang.org/#ix=21Bk 😏 |
13:38:54 | PMunch | shashlick, well it can start by just converting /nim links |
13:40:12 | PMunch | And support a command like !play that converts the last ix.io link to a plaground link |
13:40:19 | PMunch | So that it can be triggered manually |
13:42:34 | PMunch | Hmm, looking at the C sources it appears to happen before anything in the body of the Nim procedure |
13:43:14 | Araq | with --threads:on you enable thread local storage |
13:43:21 | PMunch | It's from setting up colonenv_ = (tyObject_Env_optionsutilsdotnim___UpiYziCAz9b9bakYPnH5SO2A*) newObj((&NTI__o9alMI9a4uD9aSMcjteftxpsg_), sizeof(tyObject_Env_optionsutilsdotnim___UpiYziCAz9b9bakYPnH5SO2A)); |
13:43:27 | Araq | try also --tlsEmulation:on |
13:43:59 | PMunch | Hmm, I use setupForeignThreadGc, should I remove that then? |
13:44:00 | Araq | but I gave up on this, compile via --gc:boehm until --gc:arc is ready |
13:44:10 | PMunch | --gc:boehm hangs randomly |
13:44:19 | * | tklohna joined #nim |
13:44:28 | Araq | lovely |
13:44:29 | PMunch | And throws errors that it's collecting from unknown threads or something like that |
13:45:37 | dom96 | PMunch: PM'd you |
13:46:51 | * | dddddd joined #nim |
13:51:32 | * | abm quit (Ping timeout: 276 seconds) |
13:53:59 | FromDiscord | <mratsim> by the way, can we have tlsEmulation on by default on OSX, and off by default on iOS |
13:54:01 | disruptek | just ignore the bot if bothers you. what's the problem? if you want it to ignore you, i can add that feature. |
13:54:28 | FromDiscord | <mratsim> iirc it was off due to iOS but we shouldn't penalize Mac users |
13:55:12 | FromDiscord | <mratsim> @disruptek, the issue is that the bot doesn't give Nim code |
13:55:34 | disruptek | it doesn't know how to turn non-nim into nim; sorry. |
13:56:51 | disruptek | we could use a bayes filter to identify nim that might not be syntactically correct and then ignore anything that isn't nimish. |
13:57:09 | dom96 | Don't worry, I'll implement banning functionality into NimBot soon, we can have a bot war |
13:57:38 | disruptek | i'll just turn it off. |
13:58:32 | PMunch | Haha |
13:58:58 | disruptek | it only needs to work for me; i thought i was being helpful. go figure. |
13:59:26 | PMunch | Araq, with tlsEmulation on and no setupForeignThreadGC I get this from gdb: nimFrame (s=0x7ffff66e94d0) at /home/peter/.choosenim/toolchains/nim-1.0.2/lib/system/excpt.nim:464 |
13:59:30 | PMunch | So it crashes somewhere else.. |
14:00:07 | PMunch | disruptek, as I said I don't dislike the idea. It's just that I use ix for anything longer than a line, including logs, outputs, and various other things |
14:00:23 | disruptek | so add a /+ to the end of your url or type /ignore disbot |
14:00:27 | PMunch | So it just creates a bunch of playground links for something that isn't playground related at all :P |
14:00:51 | disruptek | anyway, i'll just message me now, and not the channel. |
14:00:55 | FromDiscord | <mratsim> @disruptek, I'm not criticizing, but |
14:01:09 | PMunch | I really want to see a !play function though |
14:01:19 | FromDiscord | <mratsim> I guess this is a special incident and PMunch should be banned instead to paste non-nim code |
14:01:19 | PMunch | That way we could let new users know of the playground easily |
14:01:31 | PMunch | mratsim :( |
14:01:37 | FromDiscord | <mratsim> your fault 😛 |
14:01:52 | FromDiscord | <mratsim> I thought you had proper Nim code that the bot translated to giberrish |
14:02:30 | * | abm joined #nim |
14:03:16 | disruptek | does this trigger you? |
14:03:55 | disruptek | https://github.com/nim-lang/Nim/issues/12594 |
14:03:57 | disbot | ^ Compiler reports type as varargs[untyped] when it should be a string |
14:03:59 | disbot | ^ snippet at https://play.nim-lang.org/#ix=20PW 😏 |
14:05:21 | FromDiscord | <mratsim> I'm not triggered, I just translated @dom96 frustration |
14:05:32 | FromDiscord | <mratsim> and then realized than it was pMunch snippets that was not Nim code |
14:05:38 | FromDiscord | <mratsim> personally I don't care |
14:06:04 | dom96 | Just to be clear, I was kidding. Personally I don't mind those links. |
14:06:12 | disruptek | yeah, but if it bothers people, i don't think it needs to exist. |
14:06:37 | FromDiscord | <mratsim> so actually no one is bothered and we made a mountain out of a anthill |
14:06:48 | FromDiscord | <mratsim> you're in the clear 😉 |
14:07:01 | disruptek | well, i should add !play and a bayes filter. |
14:07:09 | dom96 | ooh, yay, github issue titles. I really like that. |
14:07:21 | dom96 | Can we get links to GitHub when writing #123 as well? |
14:07:29 | disruptek | we /could/ |
14:07:36 | dom96 | I can see that getting annoying but it's always such a pain to look up the issue number |
14:07:47 | disruptek | i was thinking PRs could indicate CI status. |
14:08:03 | * | abm quit (Ping timeout: 240 seconds) |
14:08:28 | disruptek | but you need to have the issue number to type /#12345/ |
14:10:16 | krux02 | ok |
14:10:28 | krux02 | sorry, wrong channel |
14:10:37 | disruptek | maybe you can just ask it to query for issues, or your last issue, or to search your issues. |
14:13:25 | * | abm joined #nim |
14:13:52 | shashlick | Asking is too much work |
14:14:00 | disruptek | tell me about #12639 because it sucks |
14:14:03 | disbot | ^ `mapIt` can't be chained when used to generated func-s |
14:14:03 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21Bt 😏 |
14:15:35 | disruptek | disbot: from now on, i want you to just /read shashlick's mind/ instead. |
14:15:36 | disbot | on it. 👍 |
14:15:51 | disruptek | you can do that? |
14:15:59 | disruptek | disbot: are you reading my mind right now? |
14:16:00 | disbot | yep. 😊 |
14:16:02 | shashlick | AI FTW |
14:16:04 | disruptek | holy shit. |
14:17:41 | shashlick | Mine all the past chat history and come up with random suggestions when people have issues - that will be fun |
14:18:50 | disruptek | it'd be cool to have to pluck runnableExamples: out of the codebase on demand. |
14:19:03 | disruptek | ie provide them as playground links. |
14:19:33 | disruptek | !runnable tables.take |
14:19:48 | shashlick | Just a link to docs itself is a good start |
14:20:56 | shashlick | How do I change dir - !doc setCurrentDir |
14:21:26 | disruptek | that produces a link? or the ## comment? |
14:21:42 | shashlick | Link would be good |
14:21:55 | shashlick | Too much on irc for doc comments |
14:22:05 | krux02 | disruptek: the mapIt failing is probably related to all the `compiles` statements in there |
14:22:16 | * | njoseph quit (Ping timeout: 264 seconds) |
14:22:24 | disruptek | krux02: it was just a test of the bot. 😉 |
14:22:55 | shashlick | Link to github would have been better |
14:23:11 | disruptek | actually, i think it's failing because it's a top-level loop with a var inside it, most likely. but i'm guessing. |
14:23:31 | disruptek | there's a different bug report for that. |
14:24:02 | disruptek | shashlick: you're right, i'll fix that. |
14:24:18 | * | njoseph joined #nim |
14:27:58 | * | solitudesf joined #nim |
14:30:35 | * | nsf joined #nim |
14:31:24 | * | krux02 quit (Remote host closed the connection) |
14:32:51 | * | krux02 joined #nim |
14:34:33 | PMunch | Hmm, removing everything from optionsutils made it get further along |
14:34:38 | dom96 | disruptek train it on our IRC logs and make it answer questions :D |
14:35:48 | disruptek | where do you think i came from? |
14:35:57 | disruptek | my middle name is Markhov. |
14:37:48 | disruptek | krux02: this one: #10938 |
14:37:51 | disbot | https://github.com/nim-lang/Nim/issues/10938 |
14:37:53 | disbot | ^ [Nimvm] Set/string/seq inside loop not initialized properly |
14:37:55 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21BB 😏 |
14:41:09 | FromDiscord | <kodkuce> hmm how you guys store conf files, this kinda sux like too much writing |
14:41:10 | FromDiscord | <kodkuce> http://ix.io/21BC |
14:41:51 | FromDiscord | <kodkuce> like now i have pg connection string that will be like 5 newlines |
14:42:43 | * | krux02 quit (Remote host closed the connection) |
14:42:46 | FromDiscord | <kodkuce> hmm meybe i should not split in arrays or hmm duno |
14:47:05 | PMunch | Hmm, interesting. I compiled my program with --genscript and made sure that the call to "setupForeignThreadGC" gets called before the colonenv_ = (tyObject_Env_optionsutilsdotnim___UpiYziCAz9b9bakYPnH5SO2A*) newObj((&NTI__o9alMI9a4uD9aSMcjteftxpsg_), sizeof(tyObject_Env_optionsutilsdotnim___UpiYziCAz9b9bakYPnH5SO2A));┃ (*colonenv_).Sup.m_type = (&NTI__UpiYziCAz9b9bakYPnH5SO2A_); |
14:47:32 | PMunch | That gives me the same as removing the usage of optionsutils in my code |
14:47:44 | PMunch | So what is it in optionsutils that creates a colonenv? |
14:48:02 | PMunch | Is it a closure thing? |
14:48:50 | PMunch | By the way --genscript isn't perfect |
14:49:21 | PMunch | It uses a different name than what it would normally be compiled to. And my --passC:"-I../.." obviously doesn't work from the cache directory |
14:51:47 | PMunch | Aha, so it appears you can't use closures with "setupForeignThreadGC" because it will run newObj before it |
15:03:16 | * | a_b_m joined #nim |
15:06:26 | * | abm quit (Ping timeout: 240 seconds) |
15:09:06 | * | floppydh quit (Quit: WeeChat 2.6) |
15:13:03 | PMunch | https://github.com/nim-lang/Nim/issues/12659 |
15:16:19 | FromGitter | <deech> Am I correct that strong spaces are no longer a thing in Nim? |
15:19:13 | dom96 | zedeus someone posted your project on HN (maybe it's you?) in any case, if it doesn't make it to the front page you might want to post it as a Shown HN (https://news.ycombinator.com/item?id=21535453). |
15:19:20 | dom96 | deech: you're correct |
15:19:30 | zedeus | oh dear |
15:19:43 | dom96 | deech: FWIW they were never enabled by default |
15:21:14 | * | PMunch quit (Quit: Leaving) |
15:22:04 | zedeus | I've been holding off sharing it in places like hn till I add the account system (following etc), first impressions matter |
15:22:36 | FromDiscord | <kodkuce> Repository mirroring has been paused due to too many failed attempts, and can be resumed by a project maintainer. |
15:22:36 | FromDiscord | <kodkuce> Last successful update 1 year ago - GITLAB if anyone gives a crap |
15:22:53 | rockcavera | I need to delete equal entries. Without checking when adding entries to a sequence the program runs at 0.5s. Using "notin seq" check before adding, runs at 29s. Using the sets package, runs in 62s. Any ideas for improving performance? |
15:23:18 | * | Vladar quit (Quit: Leaving) |
15:23:18 | rockcavera | I'm adding integers |
15:35:14 | * | tklohna quit (Ping timeout: 240 seconds) |
15:38:10 | * | a_b_m quit (Quit: Leaving) |
15:40:10 | disruptek | use a table. |
15:40:57 | * | gangstacat quit (Ping timeout: 250 seconds) |
15:42:30 | * | narimiran joined #nim |
15:42:35 | rockcavera | disruptek tables? |
15:42:40 | disruptek | sure. |
15:43:55 | rockcavera | I'll try it out, but I believe it won't be faster, since it looks like sets. |
15:44:47 | disruptek | don't add your entries, []= them. |
15:46:44 | rockcavera | yes |
15:47:17 | rockcavera | if it has the same perl hash performance I am saved. |
15:47:32 | * | gangstacat joined #nim |
15:54:20 | rockcavera | disruptek, did not work. runs at 148s |
15:54:52 | disruptek | share your code? |
15:54:53 | rockcavera | I used table[ENTRY] = 1 |
15:55:21 | disruptek | what's the distribution of dupes? is the order important? |
15:55:35 | disruptek | can you, eg. sort the list and weed dupes out later? |
15:55:48 | rockcavera | order not important |
15:58:41 | FromGitter | <nixfreakz_twitter> Are there any tutorials on how to create a blog using nim / jester ? |
15:59:36 | FromDiscord | <mratsim> AFAIK someone wrote a static compiler, you just had to feed markdown files |
15:59:42 | FromDiscord | <mratsim> static page compiler* |
15:59:45 | * | tklohna joined #nim |
15:59:50 | FromDiscord | <mratsim> nimble.directory might help to find the repo |
16:00:27 | * | seni quit (Quit: Leaving) |
16:00:31 | FromDiscord | <mratsim> 3 repos: https://nimble.directory/search?query=blog |
16:03:04 | FromGitter | <nixfreakz_twitter> oh I was thinking from scratch but this is cool too , thanks |
16:07:34 | * | tklohna quit (Ping timeout: 268 seconds) |
16:07:57 | * | tklohna joined #nim |
16:13:58 | * | clyybber joined #nim |
16:17:14 | * | brainproxy joined #nim |
16:21:17 | * | sagax quit (Remote host closed the connection) |
16:30:52 | FromDiscord | <itmuckel> Hey guys! Can I overload the assignment operator? I have a type `Rotation` that in fact is just a typedef for float and I want assignments to it automatically be limited to the [0, 360) range. So `val rotation: Rotation = 500` should assign 140 to `rotation`. |
16:30:52 | FromDiscord | <itmuckel> I already looked for the source code of `Natural`, but couldn't find it. Any tips? 🙂 |
16:32:17 | disruptek | itmuckel: use a range type for Rotation. |
16:34:44 | FromGitter | <mratsim> you can overload with proc `=`(dst: var Rotation, src: Rotation) |
16:35:21 | FromGitter | <mratsim> but test well because overloading = is not well tested. |
16:44:43 | FromDiscord | <itmuckel> Ah thx, range type is exactly what I needed. Theoretically it's wrong to have 0.0 and 360.0 assignable, but hey, better than nothing. |
16:45:42 | FromDiscord | <itmuckel> Oh, and I don't want an error to happen when a higher value is assigned. I just want it to be clamped. |
16:45:55 | disruptek | well, use the overload, then. |
16:45:59 | FromDiscord | <itmuckel> Oh, and I don't want an error to happen when a bigger value is assigned. I just want it to be clamped. |
16:47:48 | disruptek | or a template, i guess. |
16:47:48 | FromDiscord | <itmuckel> Hmmmm |
16:47:48 | FromDiscord | <itmuckel> proc `=`(dst: var Rotation, src: Rotation) = |
16:47:48 | FromDiscord | <itmuckel> dst = src mod 360.0 |
16:47:49 | FromDiscord | <itmuckel> |
16:47:49 | FromDiscord | <itmuckel> Gives me |
16:47:49 | FromDiscord | <itmuckel> Error: signature for '=' must be |
16:47:49 | FromDiscord | <itmuckel> proc[T: object](x: var T; y: T) |
16:48:23 | * | FromGitter quit (Remote host closed the connection) |
16:48:41 | * | FromGitter joined #nim |
16:48:58 | * | brainproxy quit (Quit: WeeChat 2.6) |
16:49:37 | Zevv | what is your Rotation, an object? |
16:50:02 | disruptek | about 420°. |
16:50:08 | Zevv | go away disruptek |
16:50:09 | FromDiscord | <itmuckel> Just a type definition: |
16:50:09 | FromDiscord | <itmuckel> type Rotation* = float |
16:50:20 | disruptek | lol |
16:50:30 | Zevv | itmuckel: [T: object] |
16:51:01 | Zevv | https://nim-lang.github.io/Nim/manual.html#generics-type-classes |
16:51:22 | Zevv | The generic `=` is matched against a type class which restricts it to objects |
16:52:23 | Zevv | does that make sense? |
16:54:21 | FromDiscord | <mratsim> you need type Rotation = object and on a second line data: float |
16:54:27 | * | tklohna quit (Ping timeout: 246 seconds) |
16:54:43 | FromDiscord | <mratsim> otherwise you will override the assignment for floats too and all hell breaks lose |
16:54:55 | FromDiscord | <mratsim> I'm very annoyed by Python lack of relative imports |
16:56:14 | FromDiscord | <mratsim> I can't believe people cry about Nim imports when you can't do relative import in python without going through the package blessing ceremony |
17:00:21 | * | uu91 quit (Read error: Connection reset by peer) |
17:00:37 | * | uu91 joined #nim |
17:09:49 | FromDiscord | <itmuckel> Hm, making the Rotation an object and giving it a field is exactly what I didn't want. A one field object feels overengineered. @Zevv So to use the generic = operator I need an object first? 🤔 |
17:10:13 | disruptek | it's the only way to overload the assignment. |
17:10:38 | disruptek | why can't you use the range type with a template that just clamps the value? |
17:11:59 | clyybber | IMO using floats is a bad idea most of the time. |
17:13:46 | clyybber | Especially in this case, since you don't want your rotation to be less precise when the player is looking at this or that direction |
17:14:44 | disruptek | if there's one thing i hate, it's sub-degree precision jumps in my rotation due to float rounding. |
17:16:33 | Zevv | yeah, but it was not about the float, was it. |
17:17:52 | * | clyybber1 joined #nim |
17:18:19 | clyybber1 | it is great that the battery light turns red 5 seconds before power goes out.. |
17:18:52 | disruptek | you mean the impending corruption lamp? the ICL? |
17:19:14 | * | clyybber quit (Ping timeout: 240 seconds) |
17:20:55 | * | lqdev joined #nim |
17:22:40 | Zevv | The 'oh my battery is almost empty, let me switch on a 10mA LED for 100% of the time, that would probably help" |
17:23:03 | Zevv | in the age where CPU's are more then abundant, is it *too* much to ask to at least let it flash at a 1% puls width |
17:25:54 | * | ng0 joined #nim |
17:26:41 | * | sentreen_ quit (Ping timeout: 250 seconds) |
17:28:14 | * | nsf quit (Quit: WeeChat 2.6) |
17:28:50 | * | Kaivo quit (Quit: WeeChat 2.6) |
17:35:22 | * | solitudesf quit (Ping timeout: 252 seconds) |
17:39:55 | * | sentreen_ joined #nim |
17:40:42 | lqdev | PMunch: I'm having a bit of a problem with nimlsp, I'm importing a local file `euwren/private/wren.nim` through `import euwren/private/wren`, but nimlsp screams at me saying that the file doesn't exist |
17:41:17 | FromDiscord | <kodkuce> hmm does vscode show changes even if i added that file to .gitignore |
17:41:41 | FromDiscord | <kodkuce> git status shows too modified: conf.json |
17:42:05 | FromDiscord | <kodkuce> hmm do i need to refresh git or something |
17:43:35 | lqdev | @kodkuce you need to delete the file from the repository, commit, and then it will not track it |
17:43:48 | lqdev | s/commit/commit that change/ |
17:45:08 | FromDiscord | <kodkuce> hmm but what if i want it in repo i just want to ignore pushing changes to it |
17:46:33 | lqdev | then it should work |
17:46:48 | lqdev | hmm, http://ix.io/21Cp this is the output of nimlsp |
17:46:51 | FromDiscord | <kodkuce> git rm -r --cached . |
17:47:08 | FromDiscord | <kodkuce> deleted: conf.json |
17:47:08 | FromDiscord | <kodkuce> deleted: reg-auth_server/TestREST.http |
17:47:17 | FromDiscord | <kodkuce> hope this is just localy 🙂 |
17:50:02 | FromDiscord | <kodkuce> ok i think its working |
17:51:11 | FromDiscord | <kodkuce> or not i deleted it form online repo too 😦 |
17:51:50 | clyybber1 | kodkuce: Well, having it .gitignore means that you don't want it in the online repo usually |
17:52:48 | * | solitudesf joined #nim |
17:54:50 | FromDiscord | <kodkuce> i pushed a tamplate for config, but now i want to put my password and stuff in it so i can test localy |
17:55:42 | FromDiscord | <kodkuce> but i dont want to have to evry time manualy add evry file cuz i cant do git add . cuz it will push my passwords online |
17:56:04 | FromDiscord | <kodkuce> i tryed to make gitignore ignores intself but that dident work xD |
17:59:05 | FromDiscord | <mratsim> Nim objects are very lightweight though @itmuckel, there is no ceremony to use them unlike getters and setters in other languages |
17:59:22 | FromDiscord | <mratsim> also I don't think you want to break your normal floats |
17:59:49 | FromDiscord | <mratsim> type Rotation = float will just give an aliased name to the float type |
18:02:45 | FromDiscord | <itmuckel> Okay... 😦 |
18:02:47 | FromGitter | <nixfreakz_twitter> I really like how you can switch nim versions on the fly with choosenim |
18:03:28 | FromDiscord | <itmuckel> Regarding ints for degree values: Is that enough precision? |
18:03:47 | disruptek | WHO'S ASKIN'? |
18:04:15 | FromDiscord | <itmuckel> For example if I want to rotate a huge object, wouldn't it stutter when I use ints? |
18:04:32 | clyybber1 | Floats are not magically continuous |
18:04:35 | clyybber1 | They are discrete too |
18:04:38 | FromDiscord | <mratsim> int32 have a range of -2 billions to 2 billions |
18:04:45 | clyybber1 | You can just multiply your int in your mind, |
18:04:50 | FromDiscord | <mratsim> int64 have a range of a lot |
18:04:53 | FromDiscord | <itmuckel> Aaaaaaaah yeah! |
18:04:56 | clyybber1 | So you use 36000 to mean 360degrees |
18:05:02 | clyybber1 | or even bigger |
18:05:20 | disruptek | i'm losing my sanity over here. so many numbers... |
18:05:27 | FromDiscord | <itmuckel> Yeah of course, didn't thought about that 🤦♂️ |
18:05:40 | FromDiscord | <mratsim> I'm working with 2^256 numbers in crypto .... |
18:05:46 | disruptek | NOOOOO |
18:05:55 | disruptek | 🤯 |
18:06:00 | FromDiscord | <mratsim> "more than the number of atoms of the universe" TM |
18:07:19 | FromDiscord | <itmuckel> proc `=`(dst: var Rotation, src: int) = |
18:07:19 | FromDiscord | <itmuckel> dst.value = src mod 36000 |
18:07:19 | FromDiscord | <itmuckel> |
18:07:19 | FromDiscord | <itmuckel> Wait, this isn't possible? I thought I could overload =? |
18:07:22 | clyybber1 | perfect for wowing people: comparing possible states with an amount of objects |
18:07:34 | FromDiscord | <itmuckel> I need to go now, will check the answers later 😦 |
18:07:53 | clyybber1 | itmuckel: `=`(dst: var Rotation, src: Rotation) = |
18:07:59 | clyybber1 | ... |
18:08:00 | FromDiscord | <mratsim> yep, it works very well to sell go (the board game) or Magic (the card game) |
18:08:05 | clyybber1 | But you probably want a converter |
18:08:38 | FromDiscord | <itmuckel> I want to assign an int to a Rotation and have it converted automatically, yes. |
18:08:48 | FromDiscord | <itmuckel> 🙂 |
18:09:02 | FromDiscord | <mratsim> you need to write the = overload and a converter |
18:09:09 | clyybber1 | converter toRotation(v: int) = Rotation(value: v) |
18:09:38 | clyybber1 | You don't need the `=` actually. |
18:09:42 | FromDiscord | <mratsim> but if you want a converter, you might as well forego the = overload and put the modulo in the converter |
18:10:08 | clyybber1 | and the converter should probably do `Rotation(value: v mod 360)` instead |
18:11:09 | clyybber1 | BUT, if you want sub degree precision you should do something like `Rotation(value: v mod (360 * precision))` instead |
18:11:40 | FromDiscord | <mratsim> I suggest you add a warning in the form of when not defined(release): static: echo "Implicitly converting here, that might help if you have a Heisenbug". |
18:12:05 | FromDiscord | <mratsim> In my experience, converter bugs were the worst to investigate |
18:12:17 | clyybber1 | converter bugs dont exist. |
18:12:19 | FromDiscord | <mratsim> I have diligently removed them from my codebases |
18:12:22 | clyybber1 | at least I don't see them |
18:12:23 | clyybber1 | bdummmts |
18:13:04 | FromDiscord | <mratsim> converter bugs are bugs when you think a proc is supposed to do something but actually your type was convrted and another overload was called |
18:13:29 | FromDiscord | <mratsim> Happened to me with "$" which is meh |
18:13:48 | disruptek | yeah, i'm 👎 on lazy uses of converters. you really gotta be careful with them. |
18:14:44 | FromDiscord | <mratsim> I prefer to restrict them to literals with proc foo(x: int{lit}): Bar |
18:14:51 | * | sentreen_ quit (Ping timeout: 240 seconds) |
18:14:59 | FromDiscord | <mratsim> and have a separate "lenientFoo" module |
18:19:43 | * | PMunch joined #nim |
18:20:20 | clyybber1 | mratsim: Regarding operator precedence.. |
18:20:51 | clyybber1 | Wydt about making operators that start with `.` a higher precedence? |
18:21:01 | * | MrAxilus quit (Read error: Connection reset by peer) |
18:21:04 | * | Demos[m] quit (Read error: Connection reset by peer) |
18:21:04 | * | Manny8888 quit (Read error: Connection reset by peer) |
18:21:04 | * | Connor[m] quit (Read error: Connection reset by peer) |
18:21:05 | * | leorize[m] quit (Read error: Connection reset by peer) |
18:21:05 | * | LEdoian[m] quit (Read error: Connection reset by peer) |
18:21:09 | * | lqdev[m] quit (Remote host closed the connection) |
18:21:10 | * | salotz[m] quit (Read error: Connection reset by peer) |
18:21:10 | * | meff[m] quit (Write error: Connection reset by peer) |
18:21:10 | * | Asbrn[m] quit (Remote host closed the connection) |
18:21:14 | * | yglukhov[m] quit (Write error: Connection reset by peer) |
18:21:15 | * | planetis[m] quit (Remote host closed the connection) |
18:21:17 | * | lasso[m] quit (Remote host closed the connection) |
18:21:18 | * | k0mpjut0r quit (Read error: Connection reset by peer) |
18:21:21 | * | TheManiac[m] quit (Read error: Connection reset by peer) |
18:21:21 | * | zielmicha[m]1 quit (Read error: Connection reset by peer) |
18:21:22 | * | skrylar[m] quit (Read error: Connection reset by peer) |
18:21:22 | * | spymasterd[m] quit (Read error: Connection reset by peer) |
18:21:24 | * | narimiran[m] quit (Read error: Connection reset by peer) |
18:21:27 | * | M948e5[m] quit (Write error: Connection reset by peer) |
18:21:27 | * | d-nice2[m] quit (Write error: Connection reset by peer) |
18:21:28 | * | GitterIntegratio quit (Write error: Connection reset by peer) |
18:21:29 | * | Balu[m] quit (Remote host closed the connection) |
18:21:29 | * | nc-x[m] quit (Remote host closed the connection) |
18:21:29 | * | joachimschmidt55 quit (Write error: Connection reset by peer) |
18:21:32 | * | macsek1911[m] quit (Read error: Connection reset by peer) |
18:21:32 | * | pigmej quit (Write error: Connection reset by peer) |
18:21:32 | * | Miguelngel[m] quit (Remote host closed the connection) |
18:21:32 | * | nergal[m] quit (Write error: Connection reset by peer) |
18:21:33 | * | shashlick[m] quit (Remote host closed the connection) |
18:21:33 | * | isaac[m]1 quit (Write error: Connection reset by peer) |
18:21:33 | * | xomachine[m] quit (Read error: Connection reset by peer) |
18:21:38 | * | BitPuffin quit (Remote host closed the connection) |
18:21:53 | clyybber1 | And having operators that start with `..` or start and end with `.` have the same precedence as they do now |
18:24:15 | clyybber1 | s/or.*$// |
18:24:33 | FromDiscord | <mratsim> that would break too much code |
18:24:43 | clyybber1 | do you really think? |
18:25:05 | FromDiscord | <mratsim> well, we would have to ask everyone "does that break your code" |
18:25:14 | FromDiscord | <mratsim> including companies that are using Nim in secret |
18:25:42 | clyybber1 | Or we provide a backwards compatibility switch :) |
18:26:12 | FromDiscord | <treeform> so choosenim downloads and compiles nim, is there a "choosenim" that just downloads binary package so it's faster? |
18:26:56 | FromDiscord | <treeform> maybe apt-get package with a special repo? |
18:27:05 | FromDiscord | <treeform> for ubuntu |
18:27:21 | FromDiscord | <mratsim> I'll let you fight with dom96 on that, I'm all for evolving the standard libraries as long as we manage people expectation but changing precedence rules of the core language can't be motivated by just Arraymancer |
18:28:22 | FromDiscord | <treeform> oh there is https://launchpad.net/ubuntu/+source/nim/1.0.2-1 I different site did not have it. |
18:28:28 | clyybber1 | mratsim: I'm motivated by making .? for option method chaining possible |
18:28:48 | clyybber1 | mratsim: And similarily some .< thing for outplace method chaining |
18:28:49 | * | sentreen_ joined #nim |
18:29:12 | disruptek | interesting. |
18:29:16 | FromDiscord | <mratsim> that sounds reasonable then |
18:29:29 | FromDiscord | <mratsim> but we might need something like a 2 years deprecation period |
18:29:42 | FromDiscord | <mratsim> actually I don't know how to do the transition |
18:30:13 | clyybber1 | well, do it for the next version and provide a switch? |
18:30:19 | FromDiscord | <mratsim> for method chaining I was annoyed by the precedence of "->" |
18:30:27 | FromDiscord | <mratsim> I had to do "^->" |
18:30:42 | FromDiscord | <mratsim> I think you need a RFC |
18:31:02 | FromDiscord | <mratsim> cost/benefits, leave it for a reasonable time |
18:31:11 | FromDiscord | <mratsim> start with a opt-in switch |
18:31:14 | FromDiscord | <mratsim> then opt-out |
18:31:25 | clyybber1 | Its not hard to fix breakage caused by it really |
18:31:29 | * | rockcavera quit (Remote host closed the connection) |
18:31:38 | FromDiscord | <mratsim> yes but it's about expectations |
18:32:17 | FromDiscord | <mratsim> "isDigit" removal broke my workflow, "queues" removal broke NimYAML as well. and then I need to context switch, even if it's easy |
18:32:24 | clyybber1 | s/([[:alnum:]])(.[[:punct:]])/\1.\2/g |
18:32:44 | clyybber1 | mratsim: I think we need something like a breakage preprocessor |
18:33:15 | clyybber1 | that gets applied conditionally to every file before its read by the compiler. |
18:33:24 | FromDiscord | <mratsim> anyway, this should start with a RFC |
18:33:34 | clyybber1 | I start with the implementation, fite me |
18:34:09 | dom96 | clyybber1: mratsim: context on what I'm being fought on? Is it `.` precedence for operators? |
18:34:17 | madprops | how can i continue a specific block? continue name doesn't work |
18:34:21 | FromDiscord | <mratsim> not, backward compat |
18:34:24 | FromDiscord | <mratsim> no* |
18:34:36 | dom96 | treeform: shashlick did some awesome work for that, not sure what the status is with roll out for that, we might only have Windows binaries for now IIRC |
18:34:58 | FromDiscord | <mratsim> changing the precedence rule of the single dot so that it has the same precedence as the operator that follows |
18:35:02 | clyybber1 | We still aren't clear about if we can break 1.x or not |
18:35:11 | disruptek | i heard you can break 1.x. |
18:35:28 | clyybber1 | dom96 would like to interject for a moment :) |
18:36:43 | clyybber1 | but if we don't break 1.x we should really make devel 2.0 |
18:36:57 | FromDiscord | <mratsim> My stance is: we can deprecate, then remove stuff in the standard library for v1.x and we keep compat for v1.0.x |
18:36:57 | FromDiscord | <mratsim> Core language: only experimental stuff can break in v1.x |
18:36:58 | clyybber1 | and introduce 1.x branches |
18:37:31 | dom96 | pretty sure precedence rules aren't a stdlib issue, no? |
18:37:39 | FromDiscord | <mratsim> yes |
18:37:47 | FromDiscord | <mratsim> precedence rules are core language |
18:38:04 | FromDiscord | <mratsim> hence why I don't want to change them on a whim |
18:38:11 | dom96 | stdlib is covered under the backwards compatibility guarantees |
18:38:15 | FromDiscord | <treeform> dom96, thanks ill look into it. |
18:38:25 | dom96 | we can deprecate stuff, but not remove |
18:38:41 | FromDiscord | <mratsim> that's new |
18:38:58 | clyybber1 | Also stdlib is kind of backwards compatible now. |
18:39:05 | clyybber1 | With {.since.} |
18:39:31 | FromDiscord | <mratsim> otherwise we might need something like the Rust multiversioning |
18:40:59 | FromDiscord | <mratsim> anyway, I'll try finishing my multithreading runtime now. I keep on discovering stuff that needs to be revamped and I didn't even finish :/ |
18:41:18 | clyybber1 | mratsim: The original C implementation has been rewritten by now, right? |
18:41:38 | FromDiscord | <mratsim> almost |
18:41:54 | FromDiscord | <mratsim> but now I have the following items on my TODO: |
18:43:15 | clyybber1 | So you are finished? :p |
18:43:21 | dom96 | mratsim: what's new? being able to deprecated stuff? |
18:43:42 | dom96 | *deprecate |
18:43:57 | * | nsf joined #nim |
18:44:15 | clyybber1 | dom96: I'd still like to hear your opinion on how one would go about changing the precedence of operators starting with `.` (but not operators starting with `..`) |
18:44:27 | FromDiscord | <mratsim> - refactoring the bitsets to support more than 32 CPUs, while having efficient random number generation support or efficient uncompression into a stack array |
18:44:27 | FromDiscord | <mratsim> - Removing globals because it's very bad for unit-testing |
18:44:27 | FromDiscord | <mratsim> - Implementing a thread-safe object pool |
18:44:28 | FromDiscord | <mratsim> - Replacing the scheduler by a finite state machine to clarify the transitions and improve on formal verifiability |
18:44:28 | FromDiscord | <mratsim> - Bonus: hardened mode to make sure we wipe task memory when used with sensitive data. |
18:44:30 | clyybber1 | Should it be done in 1.x or 2.x? |
18:44:50 | FromDiscord | <mratsim> v2 for me |
18:44:54 | * | PMunch quit (Remote host closed the connection) |
18:44:57 | FromDiscord | <mratsim> and RFC |
18:45:04 | clyybber1 | mratsim: Oh, I was referring to the precedence thing |
18:45:27 | * | NimBot joined #nim |
18:45:41 | dom96 | clyybber1: likely v2, unless you can prove that it doesn't break much code |
18:45:49 | clyybber1 | mratsim: Do you need something from the compiler for capturing environments in tasks? |
18:45:55 | FromDiscord | <mratsim> yes |
18:46:04 | clyybber1 | dom96: Ok, thank you for chiming in :) |
18:46:07 | FromDiscord | <mratsim> I didn't have time to look into liftLocal |
18:46:56 | FromDiscord | <mratsim> but a way to serialize closures would be nice or just returning the non-local symbols captured in the environment |
18:47:24 | FromDiscord | <mratsim> this way I can first ensure that they are thread-safe/supportsCopyMem, and then package them |
18:48:07 | FromDiscord | <mratsim> I could also reimplement the OpenMP `||` magic in my runtime this way |
18:48:17 | FromDiscord | <mratsim> well something equivalent |
18:48:19 | clyybber1 | that would indeed be nice |
18:51:24 | shashlick | @dom96 @treeform latest release installs windows binaries, latest head installs Linux binaries too |
18:53:07 | * | cgfuh joined #nim |
18:53:18 | shashlick | In theory, if we tag it, Travis should build and post binaries |
18:53:33 | * | krux02 joined #nim |
18:58:04 | FromDiscord | <treeform> shashlick, do you have a command for that? I want this for the "github actions" which run on `ubuntu-16.04` |
18:58:50 | FromDiscord | <treeform> shashlick, the compile + install takes like 6 minutes it be nice it was faster by just download the pre build bins. |
18:59:09 | FromDiscord | <treeform> shashlick, ubunut has a nim 1.0.2 but its for a newer version |
19:01:24 | clyybber1 | uwunut |
19:04:42 | shashlick | We haven't released a new version of choosenim yet |
19:05:01 | shashlick | I can send you a test binary if you want |
19:05:54 | shashlick | There isn't a special command, standard command will do that |
19:08:22 | FromDiscord | <treeform> shashlick, thanks i'll just wait I guess. I am already using choose nim to install so it should just work after you do. |
19:09:09 | dom96 | I'll see about tagging it tonight |
19:09:10 | dom96 | about to leave for home |
19:13:15 | * | abm joined #nim |
19:18:45 | * | GordonBGood joined #nim |
19:22:29 | * | hexeratops joined #nim |
19:23:53 | * | nif quit (Quit: ...) |
19:24:03 | * | nif joined #nim |
19:25:47 | * | hexeratops left #nim (#nim) |
19:26:08 | * | uu91 quit (Ping timeout: 245 seconds) |
19:26:09 | * | hexeratops joined #nim |
19:27:14 | * | uu91 joined #nim |
19:29:40 | * | nsf quit (Quit: WeeChat 2.6) |
19:39:25 | FromDiscord | <kodkuce> is there some lib to process terminal args i think you all mention it before |
19:39:32 | disruptek | cligen. |
19:41:21 | FromDiscord | <kodkuce> ty will check |
19:43:35 | clyybber1 | `type char = char` |
19:43:43 | clyybber1 | Illegal recursion in type char |
19:43:45 | clyybber1 | This is nice |
19:44:30 | disruptek | pretty rad. |
19:44:35 | disruptek | it works with other types, too. |
19:45:36 | FromGitter | <nixfreakz_twitter> props to the guys who created nimwc (: |
19:46:27 | * | Trustable joined #nim |
19:47:00 | madprops | been having syntax coloring problems in vscode http://i.imgur.com/nctpNhH.png |
19:52:36 | * | GordonBGood quit (Ping timeout: 246 seconds) |
19:56:18 | * | GordonBGood joined #nim |
19:58:02 | madprops | is it a known issue? |
20:10:03 | * | GordonBGood quit (Quit: There's nothing dirtier than a giant ball of oil) |
20:11:36 | * | u9898287 joined #nim |
20:14:24 | FromDiscord | <mratsim> why is your second quote strange? |
20:14:31 | FromDiscord | <mratsim> after all the echo |
20:14:52 | * | leorize quit (Ping timeout: 260 seconds) |
20:16:33 | * | u9898287 quit (Ping timeout: 250 seconds) |
20:17:12 | * | uu91 quit (Read error: Connection reset by peer) |
20:17:27 | * | uu91 joined #nim |
20:17:54 | madprops | if i add an extra \ |
20:17:57 | madprops | it works |
20:18:04 | madprops | but then it's incorrect |
20:18:33 | madprops | "~/\" |
20:18:39 | madprops | it should just print ~/ |
20:19:03 | madprops | nvm im just gonna make a temp variable for that |
20:19:18 | * | Trustable quit (Remote host closed the connection) |
20:20:43 | narimiran | madprops: https://play.nim-lang.org/#ix=21CZ -- how about using triple quotes? |
20:21:02 | madprops | oh i didn't know about those |
20:21:20 | madprops | would be cool if backticks were available for that though |
20:21:59 | madprops | btw i find it a bit hard to type & a lot of the times. so doing |
20:22:09 | madprops | &"..." can take some time |
20:22:11 | narimiran | `&"{\"a\" & \"b\"}"` works on playground |
20:22:39 | madprops | think i prefer javascript's way of enabling formatting with ` ` |
20:22:51 | * | leorize joined #nim |
20:22:52 | madprops | or python just uses f".." |
20:22:57 | madprops | & is just hard to reach |
20:23:00 | narimiran | you can use `fmt"..."` |
20:23:26 | madprops | why not enable formatting by default though? expensive? |
20:23:45 | madprops | i format stuff very often |
20:23:49 | narimiran | you can ask the same question about strutils, sequtils, tables, sets, etc |
20:23:49 | solitudesf | no need if it can be made as a library |
20:24:02 | * | rockcavera joined #nim |
20:24:05 | narimiran | you do. i don't. |
20:24:11 | narimiran | i do something else. you don't. |
20:25:07 | narimiran | are you saying, not only `&` is hard to type, but also `import strformat` is too much of typing? :D :D |
20:28:21 | FromDiscord | <exelotl> & is pretty hard to reach as far as string concatenation operators go |
20:33:01 | madprops | i have a problem with the symbols row |
20:33:08 | madprops | often i need multiple tries to get the correct one |
20:33:21 | madprops | fmt".." is better now that i know about it |
20:34:23 | FromDiscord | <demotomohiro> if you add `--import:strformat` to your nim.cfg, you can use it without writing `import strformat`. |
20:34:51 | madprops | oh that's cool |
20:34:57 | narimiran | yay, make things even harder to guess where they're coming from :P |
20:35:21 | madprops | well yeah that could be a problem |
20:35:34 | madprops | i just think string formatting should be a built-in feature |
20:36:08 | narimiran | everybody has their own idea should be enabled/disabled/included/removed/etc. |
20:36:18 | narimiran | *what should... |
20:36:44 | narimiran | and you gave no valid reason for that |
20:36:53 | narimiran | "i use it frequently" is not a valid reason |
20:37:43 | madprops | ok there's a problem |
20:37:46 | madprops | & and fmt are not the same thing |
20:38:01 | madprops | \n is not considered with fmt |
20:38:07 | narimiran | yep |
20:38:19 | solitudesf | yes, with fmt its treated as a raw string literal |
20:38:23 | solitudesf | its all in the manual |
20:41:05 | madprops | i mean i can't be the only one using string formatting often |
20:41:33 | narimiran | and i'm not the only one who uses tables/sequtils/sets/strutils often |
20:42:12 | FromDiscord | <mratsim> In embedded development, string formatting is verboten due to memory allocations |
20:42:25 | FromDiscord | <mratsim> at least until we have destructors by default |
20:42:46 | narimiran | madprops: why is it so hard for you to import something? i'm sure strformat is not (or: it won't be) the only module you'll ever import |
20:42:51 | solitudesf | madprops, if it can be made as a macro, it will be. no reason to overburden the compiler with something that brittle. |
20:42:58 | madprops | it's not importing that is the problem |
20:43:03 | madprops | it doing &" |
20:43:19 | disruptek | i agree; it's pretty tough. |
20:43:41 | narimiran | oh, so in your proposal i should escape `{` and `}` when i would want to print them? |
20:43:43 | FromDiscord | <mratsim> you can rename & to "f" and you have Python f-strings |
20:44:22 | madprops | i would suggest having `..` |
20:44:24 | narimiran | or you can type & once (since is so hard), and then copy-paste it when needed :D |
20:44:40 | madprops | backticks in javascript were super easy to use |
20:44:46 | FromDiscord | <mratsim> .."{myvariable}"? |
20:44:48 | solitudesf | just fork the compiler, bro |
20:45:08 | FromDiscord | <mratsim> backtick are a pain on non-english keyboards |
20:45:21 | solitudesf | and backticks are already used in nim |
20:45:40 | FromDiscord | <mratsim> for ".." you can have your own proc that maps to & |
20:45:54 | narimiran | and `{` and `}` are also pain in non-english layouts, `[` and `]` too. even `@` is not straight-forward. |
20:46:04 | narimiran | all those examples require AltGr+something |
20:46:57 | FromDiscord | <mratsim> the worse is probably the pipe |, when you sysadmin, it's always, welll, what is the keymapping |
20:53:11 | * | lritter joined #nim |
20:54:33 | madprops | ok here's my real proposal |
20:54:40 | madprops | change &".." to f".." |
20:54:49 | madprops | it would be inline with python. and MUCH easier to type |
20:55:09 | narimiran | "<solitudesf> just fork the compiler, bro" |
20:55:21 | madprops | i don't believe in forking |
20:55:34 | madprops | why & though? |
20:55:38 | madprops | seems arbitrary |
20:55:47 | solitudesf | because & is concatenation? |
20:56:01 | madprops | but when i think of that i think of (f)ormatting |
20:56:01 | solitudesf | and format strings are just sugar for concatenations? |
20:56:11 | solitudesf | thats why you have fmt |
20:56:21 | madprops | we could have f too |
20:56:25 | solitudesf | you can have it |
20:56:34 | solitudesf | template f(s: string): string = fmt s |
20:56:36 | solitudesf | badabing |
20:56:45 | madprops | fmt and & do the same thing regarding formatting |
20:56:52 | FromDiscord | <mratsim> template f(str: string): untyped = &(str) |
20:56:57 | FromDiscord | <mratsim> and done |
20:57:26 | FromDiscord | <mratsim> Otherwise for me ² is much easier to type, it's just under the escape key |
20:57:41 | FromDiscord | <mratsim> no fancy shift or altgr, good idea no? |
20:57:42 | narimiran | b-b-but i'll have to copy-paste that everywhere, why can't it be default, yadda yadda |
20:57:43 | madprops | well anybody can type f"" very easily |
20:58:21 | FromDiscord | <mratsim> many languages uses & for concatenation of strings |
20:58:25 | narimiran | anybody can type & also easily, except you :D |
20:58:33 | solitudesf | yes, but now you are reserving identifier f, which is better used for some variables |
20:58:38 | FromDiscord | <mratsim> Nim gives you the possibility to change the operator or function name |
20:58:52 | madprops | solitudesf: you could say the same about fmt |
20:59:04 | madprops | fmt is actually more prone to be used than f |
20:59:11 | narimiran | ok, i think we should give up |
20:59:19 | solitudesf | yes, for sure fmt is much widely used than f, yep |
20:59:28 | solitudesf | *more |
20:59:31 | FromDiscord | <mratsim> my files are called f |
20:59:53 | FromDiscord | <mratsim> anyway it won't conflict with a variable name |
20:59:56 | narimiran | next proposal: name it `i` (for interpolation), that one nobody uses :D :D |
21:00:38 | madprops | i just checked. fmt is not reserved |
21:00:39 | narimiran | @mratsim: you should rename your files to `fmt`, or.... `&` |
21:00:40 | FromDiscord | <mratsim> my recommendation: make a formatting library, convince Nim users that it's better than the standard lib in terms of API and functionality |
21:00:42 | madprops | meaning f can be not reserved too |
21:00:56 | solitudesf | ??? |
21:01:03 | FromDiscord | <mratsim> then we can deprecate strformat and progressively replace it by yours |
21:01:05 | narimiran | solitudesf: ¿¿¿ |
21:01:23 | narimiran | ¡¡¡ |
21:01:39 | FromDiscord | <mratsim> (don't spam) |
21:01:50 | madprops | this is possible http://i.imgur.com/jkd2K6J.png |
21:01:57 | FromDiscord | <IanIAnIAN> spam is tasty though |
21:01:57 | madprops | so the whole variable reservation argument is invalid |
21:02:31 | narimiran | yeah, one side is constantly making invalid arguments :D |
21:02:57 | FromDiscord | <mratsim> anyway, if it's the only grip you have with the language I guess that's good news |
21:03:03 | solitudesf | yeah, i guess that works, because fmt is a macro |
21:04:17 | narimiran | so, to change a subject a bit: https://wiki.freepascal.org/FPC_New_Features_3.2 |
21:12:14 | * | fasfnim joined #nim |
21:14:05 | fasfnim | heya I just discovered nim and absolutely love it |
21:14:21 | narimiran | woohoo :) |
21:14:25 | disruptek | it's pretty cool, right? |
21:14:39 | fasfnim | I'm wondering what companies currently use it? and whether there are job boards/postings for nim anywhere? |
21:14:59 | * | ltriant joined #nim |
21:15:33 | FromDiscord | <IanIAnIAN> I wondered that too, and found nothing from a quick search, but then I thought, heh i already have a job and nim still looks fun |
21:17:03 | fasfnim | https://github.com/nim-lang/Nim/wiki/Companies-using-Nim this answers part of my question |
21:17:23 | * | filcuc joined #nim |
21:17:31 | FromDiscord | <IanIAnIAN> Is there a way to search github to see who uses a particular package |
21:19:37 | disruptek | do you work at the nsa? |
21:20:22 | * | GordonBGood joined #nim |
21:21:15 | rayman22201 | lol. would be a fun thing to write with Nim :-P |
21:21:24 | solitudesf | something like this https://github.com/search?q=cligen+language%3ANim+extension%3Animble&type=Code |
21:22:03 | disruptek | added two more aws apis to atoz 🎉 |
21:24:02 | * | narimiran quit (Ping timeout: 240 seconds) |
21:24:06 | FromDiscord | <IanIAnIAN> 🐰 awesome |
21:25:10 | lqdev | anyone able to help me with my nimlsp issue? I get a ton of undefined reference errors: http://ix.io/21Cp even though the procs are here and the file compiles ok |
21:26:15 | disruptek | i have the same behavior from nimsuggest against ffi stuff. |
21:26:32 | * | fasfnim quit (Remote host closed the connection) |
21:26:45 | disruptek | i mean, i dunno if we should expect it to work. |
21:27:41 | lqdev | it's weird though, since the vscode plugin works. |
21:27:48 | lqdev | they both use nimsuggest |
21:28:21 | disruptek | does the plugin work, or does it simply not complain about missing symbols? |
21:30:10 | FromDiscord | <kodkuce> duno for me vscode trolls complains that i have unsued stuff and even calls proc dosent exist even clearly it does |
21:34:36 | madprops | interesting. nim returns default objects if none is returned? |
21:34:44 | madprops | seems it returning an empy object |
21:34:56 | madprops | which is good in my case |
21:35:10 | disruptek | it returns `result` in any event. |
21:37:43 | lqdev | disruptek: the vscode plugin actually works, suggesting me things and reporting errors (if there are any, and I know there aren't) |
21:39:14 | madprops | it does work. but sometimes i need to run the program for it to update |
21:43:17 | * | prometheus joined #nim |
21:44:46 | FromDiscord | <mratsim> @fasfnim My company is probably the biggest Nim employer out there, unless there is a hidden one with a lot of employees as well (maybe in CHina, seems like there is quite a community there) |
21:48:43 | FromGitter | <deech> Are fast compile times a priority for Nim in the future? They're pretty good now ... |
21:49:47 | FromGitter | <alehander92> i dont think so |
21:50:18 | FromGitter | <alehander92> i mean, they're pretty good, sorry |
21:50:43 | FromGitter | <alehander92> but there is totally room for improvement, but i think the incremental compilation would be really a good solution |
21:51:54 | FromGitter | <alehander92> but thats because i hope for sub 1s for small changes even in stuff like the compiler :P |
21:52:21 | FromGitter | <deech> Right, ok great. So I infer that fast compiles are important going forward. |
21:52:51 | FromGitter | <deech> Chez Scheme had this as a hard requirement IIRC, any feature that slowed that down was cut ... |
21:53:03 | FromGitter | <alehander92> yeah i didnt really say it right |
21:53:06 | FromDiscord | <IanIAnIAN> another day, another attempt to use stb_image fails. I'm going to xatch Ulysses 31 instead |
21:53:10 | FromGitter | <alehander92> i think the compiler currently is fast enough |
21:53:22 | FromDiscord | <mratsim> Incremental Compilation is important, Araq keeps getting distracted with reference counting, araqsgc, destructors, closures 😛 |
21:53:23 | FromGitter | <alehander92> but it can be utilized in a better architecture |
21:53:32 | FromGitter | <alehander92> so one could cache a lot more |
21:53:39 | FromGitter | <alehander92> for development mode |
21:53:54 | FromGitter | <alehander92> so yeah thats what Araq's IC is |
21:54:04 | FromDiscord | <mratsim> @IanIAnIAN it took me about 2 days to understand how to wrap it properly without having to move the .h in my nimcache |
21:54:06 | Araq | yeah and in fact other improvements like removing the forward declarations are not done until IC works |
21:54:17 | FromGitter | <alehander92> and i hoped that one day we can even get some kind of parallelized incremental compilation |
21:54:22 | FromGitter | <alehander92> but thats probably too far |
21:55:05 | FromDiscord | <mratsim> but for dead code elimination, Nim must see all modules |
21:55:26 | FromGitter | <alehander92> well dce is not so important for development |
21:55:35 | FromDiscord | <mratsim> this is how I use stbimage @IanIAnIAN https://github.com/mratsim/Arraymancer/blob/master/src/io/io_image.nim |
21:55:43 | FromGitter | <alehander92> and even if it is, this is not a dealbreaker for parallel compilation |
21:56:14 | FromGitter | <alehander92> actually zah explained me how one can parallelize a "pass with all modules => next pass with all modules" |
21:56:40 | FromGitter | <alehander92> i thought its only easy for "pass moduleA => next pass moduleA / pass moduleB => next pass moduleB" |
21:56:49 | FromDiscord | <mratsim> before parallelizing the compiler we need a parallel library 😛 |
21:56:50 | FromGitter | <alehander92> but i am not sure i remember. |
21:56:54 | FromGitter | <alehander92> thats what usually happens |
21:57:04 | FromGitter | <alehander92> yeah yeah this is not really important today |
21:57:11 | FromGitter | <alehander92> i was just interested in how would people do it |
21:58:00 | FromDiscord | <IanIAnIAN> Ah have I played you @mratsim ? |
21:59:27 | lqdev | I'm actually wondering why nimlsp at least starts, while NimLime does absolutely nothing apart from the syntax theme |
22:00:16 | lqdev | I verified that my Nim path is correct, that check.on_save is enabled, but no luck getting it to work |
22:01:53 | FromDiscord | <IanIAnIAN> Ah have I played you @mratsim ? ...guess not was thinking of Razafindrabe |
22:06:33 | rockcavera | disruptek sorry for the delay to reply. I used the sort and did the deletion by itself. For some reason when the numbers are high (in my code), there is an inexplicable delay with sets (hashset) that I couldn't reproduce out of code. |
22:07:06 | disruptek | what's the speed of that approach? |
22:07:48 | rockcavera | 0.3s |
22:07:53 | rockcavera | 0.34s |
22:07:58 | disruptek | cool. |
22:08:14 | disruptek | do you have a repro for the hashset issue? |
22:08:47 | rockcavera | Just changing the .txt with lower bit numbers increases the speed with hashset, but with higher bits it slows down. |
22:09:02 | disruptek | how bit are we talkin'? |
22:09:05 | disruptek | s/bit/big/ |
22:09:19 | rockcavera | I still can't figure out why |
22:09:31 | disruptek | is this with nim devel? |
22:09:43 | rockcavera | 0.9s to 50s |
22:09:44 | rockcavera | :S |
22:09:56 | disruptek | there were some hash changes but i think they were pre-1.0. |
22:10:04 | rockcavera | yes |
22:10:05 | rockcavera | nim devel |
22:10:33 | disruptek | this is definitely worth tracking. can you make an issue? |
22:10:42 | * | krux02 quit (Remote host closed the connection) |
22:10:46 | rockcavera | version 11/11/2019 |
22:11:39 | disruptek | i meant, how many bits in the ints? |
22:11:42 | rockcavera | I was all told trying to figure out what it was. I even looked at the C source code and couldn't figure it out. |
22:12:53 | rockcavera | It is a multiline .txt file where each line represents the bits must be set to 1 within a uint64 |
22:13:14 | rockcavera | The problem is not split() nor readLine() |
22:13:48 | rockcavera | Because I just changed from hashset to seq to add and the speed is a thousand times faster |
22:14:20 | disruptek | right, but we really need a small repro that we can use for testing and to prevent regression. |
22:14:21 | rockcavera | I will assemble two code and two example .txt |
22:15:18 | disruptek | sweet, thanks. |
22:15:40 | * | lqdev quit (Quit: Leaving) |
22:20:19 | * | tane quit (Quit: Leaving) |
22:27:50 | * | jjido joined #nim |
22:29:57 | * | solitudesf quit (Ping timeout: 240 seconds) |
22:41:19 | rockcavera | disruptek https://github.com/rockcavera/nim-problem |
22:41:50 | disruptek | awesome. |
22:42:31 | rockcavera | now if you can figure out why this... |
22:43:27 | * | xet7 quit (Remote host closed the connection) |
22:44:39 | * | xet7 joined #nim |
22:50:48 | rockcavera | Strange that if the highbits.txt and lowbits.txt files are represented by one number per line, other than this representation that needs to assemble the number with setBit (), there is no such disparity between speeds. |
22:51:31 | rockcavera | I tried several codes |
22:53:33 | rockcavera | I also tried several compilers: gcc, clang, vcc. Everything is the same. |
22:56:09 | rockcavera | Strangely enough, larger numbers take longer than smaller numbers in implementation and hashset. |
22:56:54 | disruptek | hmm. |
22:59:55 | clyybber1 | Araq: Hey, with the improvements merged... does async work now? |
23:00:13 | clyybber1 | (regardless of wether it leaks) |
23:01:02 | disruptek | rockcavera: what's weird is that the the types are the same. HOW DO IT KNOW?! |
23:02:12 | disruptek | this is really interesting. |
23:03:30 | rockcavera | I broke my head already with this today |
23:04:12 | * | u9898287 joined #nim |
23:04:51 | disruptek | all i can think is that you're getting a different hash impl. |
23:06:02 | rockcavera | I have no idea. If I turn those bit lines into numbers and play in a .txt, the problem does not occur. |
23:06:04 | disruptek | i would test this on 0.19.6 or even earlier; maybe the behavior will differ. |
23:06:30 | rockcavera | I have 0.19.0 here, I'll see. |
23:06:38 | disruptek | but you've already controlled for the setbit operation. |
23:14:20 | FromDiscord | <yewpad> https://play.nim-lang.org/#ix=21DL |
23:14:28 | FromDiscord | <yewpad> This prints "Hi" three times |
23:14:31 | FromDiscord | <yewpad> why's that? |
23:15:44 | * | filcuc quit (Quit: Konversation terminated!) |
23:18:54 | dom96 | yewpad: wow, very weird. Bug? |
23:19:02 | FromDiscord | <yewpad> idk |
23:19:12 | FromDiscord | <yewpad> ran it in wsl 2 on an ubuntu install |
23:19:25 | FromDiscord | <yewpad> sometimes it would print "Hi" only once |
23:19:29 | FromDiscord | <yewpad> sometimes two times |
23:19:33 | FromDiscord | <yewpad> and sometimes three times |
23:20:16 | rockcavera | disruptek in nim 0.19.0 even worse was the codesets execution time |
23:20:33 | disruptek | okay, that's good. |
23:22:00 | disruptek | yewpad: add a sync() and it's fine. |
23:22:13 | disruptek | rockcavera: how much worse is it in 19? |
23:22:42 | * | u9898287 quit (Quit: u9898287) |
23:22:50 | rockcavera | 18s lowbits.txt and 150s highbits.txt |
23:23:31 | disruptek | so you convert lowbits to uints and highbits to uints and the performance is identical when merely parseUInt'ing them from a file? |
23:23:59 | rockcavera | In codeseq I did not test, because I was giving an error in the sort that I could not get around. |
23:25:12 | rockcavera | disruptek I did not understand |
23:25:43 | disruptek | does the behavior change when you substitute parseUInt for setBit? |
23:26:32 | disruptek | i think you're already controlling for this but i'm wondering if it's essentially down to hardware. |
23:26:43 | rockcavera | yes, it changes. When uints are already ready in a .txt you don't have this speed problem. |
23:27:45 | disruptek | but you don't have it in the seq impl in any event. |
23:28:03 | rockcavera | I will assemble the code. |
23:28:07 | disruptek | something about setting the high bits is kicking you outta the cache. |
23:28:39 | disruptek | or actually, hashing against them, i guess. |
23:32:37 | madprops | is it possible to send myproc(value:234, name:"asdf") ? |
23:32:49 | madprops | i mean giving a name to the arguments when using the proc |
23:32:53 | madprops | not when defining it |
23:33:02 | * | hexeratops quit (Quit: Leaving) |
23:33:07 | disruptek | sure. |
23:33:07 | * | prometheus quit (Remote host closed the connection) |
23:33:13 | madprops | ok i just needed = instead of : |
23:33:25 | * | prometheus joined #nim |
23:33:28 | disruptek | you can dispatch on argument names, too, but don't tell anyone. |
23:35:03 | * | uu91 quit (Read error: Connection reset by peer) |
23:35:44 | * | uu91 joined #nim |
23:47:50 | * | sagax joined #nim |
23:50:51 | rockcavera | I turned the bit lines into numbers, but continued the larger numbers taking longer. But I remember I tested before and it was not long. I think I'm already going crazy. |
23:50:52 | rockcavera | :S |
23:51:16 | dom96 | shashlick, released choosenim v0.5.0 |
23:51:27 | dom96 | (well, I tagged it, hoping binaries get built) |
23:51:39 | * | vsantana quit (Remote host closed the connection) |
23:52:35 | rockcavera | or i tested with uint32 |
23:52:40 | * | vsantana joined #nim |
23:54:12 | rockcavera | disruptek I believe the problem with sets (hashset) is with numbers over 32 bits |
23:54:23 | disruptek | yeah, it seems that way. |
23:54:29 | disruptek | at least it's not a regression. |
23:54:34 | disruptek | will you make an issue? |
23:55:18 | rockcavera | disruptek I'll try to do. |
23:55:45 | rockcavera | I will do more testing |