00:00:15 | FromGitter | <rayman22201> The good thing going for Nim in your case is the excellent FFI with C/C++ and Javascript. A strong argument you can make is that you can make Nim talk to code that you have already written very easily, and that you don't need to rewrite all of the code that the company has invested in. You can gradually migrate. |
00:01:19 | FromGitter | <rayman22201> Rust has made a lot of inroads using that exact approach. |
00:02:15 | * | ftsf joined #nim |
00:25:47 | shashlick | I can think of two easy arguments going from Nim: one is - oh see how quickly I did this compared to C/C++ and the other one is: oh see how quickly this runs compared to python |
00:26:35 | shashlick | I cannot think of other quick foot in the door advantages but these two are compelling |
00:27:26 | * | darithorn quit (Quit: WeeChat 2.2) |
00:33:10 | FromGitter | <gogolxdong> Our company is sticking with Nim,by far we have built our backend in Nim,waiting a window to migrate frontend to Karax,which I have got it done by half I think. |
00:34:38 | FromGitter | <gogolxdong> avoided go,nodejs,python,PHP,etc. |
00:36:20 | FromGitter | <rayman22201> I like that you used the word "avoided". Very funny lol |
00:41:56 | FromGitter | <gogolxdong> because I am not good at English?lol |
00:43:14 | * | ftsf quit (Remote host closed the connection) |
00:43:35 | * | ftsf joined #nim |
00:43:55 | zachcarter | gogolxdong: I'm planning on / working on authoring an alternative to karax that uses html template strings instead of VDOM | DOM diffing |
00:44:17 | zachcarter | something like - https://github.com/WebReflection/hyperHTML | https://github.com/Polymer/lit-html |
00:44:19 | FromGitter | <rayman22201> No! It is good English! It's funny because it pokes fun at those other languages |
00:45:29 | zachcarter | rayman22201: we don't have much existing C/C++ code - but the fact that Nim could bind to react and basically do anything that we use Typescript | Flow for in our JS|NodeJS projects - means potentially reducing the amount of varying technology we're using in our solution |
00:45:49 | zachcarter | most of Carfax's code was written in Coldfusion before I arrive and then there was a lot of Java / Groovy development going on |
00:46:07 | zachcarter | which resulted in my disdain for Java and the JVM and made me seek out Nim |
00:46:37 | zachcarter | but convincing a bunch of people that know nothing other than JS | Java - that Nim offers a better way - isn't easy. |
00:47:06 | FromGitter | <rayman22201> Yeah.... the JVM is rough... I'm not a fan either, but it's so en-grained in corporate culture. |
00:47:27 | zachcarter | especially when the average membver of your audience has never written any C/C++ before or known anything else but the heat that accumlates from their laptop when running their application on the JVM |
00:47:42 | FromGitter | <gogolxdong> Aren't you working on WASM?IIRC. production see https://www.bafang.cloud |
00:47:49 | zachcarter | Yeah - but I'm trying to change that - we already were able to convince folks to start using Go |
00:48:21 | zachcarter | and Nim has inherent advantages over Go - so I think it will work out well - presuming the intial experiment is a success |
00:48:49 | zachcarter | gogolxdong: well - I ran into issues passing closures b/w Nim (c-target) and JS via emscripten and maintaing GC references |
00:49:02 | zachcarter | so this made event handling and removing event handlers virtually impossible |
00:50:05 | * | NimBot joined #nim |
00:50:06 | zachcarter | gogolxdong: is it okay if I share this website with my peers / managers? |
00:51:32 | FromGitter | <gogolxdong> sure, I can make a read only account for you to look through. |
00:52:23 | zachcarter | gogolxdong - if you have spare cycles - that would be awesome :) but please, if you're busy don't worry about it - I think just being able to say the backend to your site is written in Nim will be enough firepower for me |
00:59:18 | FromGitter | <gogolxdong> don't worry I can make it by myself. |
00:59:23 | zachcarter | :D |
01:00:11 | zachcarter | thank you! - I'm need to run out of my house for a few minutes to take care of an errand, but as soon as I am back and I've recieved the credentials - I will check out the site :D |
01:00:24 | zachcarter | It's so cool to see such a great looking site - and know that the backend is Nim powered :) |
01:00:42 | FromGitter | <gogolxdong> thanks |
01:06:08 | * | arecaceae quit (Remote host closed the connection) |
01:28:18 | * | arecaceae joined #nim |
01:39:56 | * | darithorn joined #nim |
01:57:38 | FromGitter | <timotheecour> @zachcarter @gogolxdong regarding WASM, do you have a link pointing to what you tried and issues you were having? also see https://github.com/nim-lang/Nim/pull/8738 ; I’m curious about wasm support in Nim, what works and what doesn’t today |
02:00:41 | * | vivus joined #nim |
02:01:47 | FromDiscord | <awr> that's a WIP i need to work on |
02:01:59 | vivus | anybody using geany? |
02:02:02 | zachcarter | timotheecour: so - I was using emscripten and JSBind - https://github.com/yglukhov/jsbind - to create an expriment where I was having karax target webassembly |
02:02:25 | zachcarter | I've done quite a bit w/ Nim and WASM - but it's all been via emscripten |
02:02:49 | FromDiscord | <awr> tbh I think emscripten support is important b/c aren't moving to the clang wasm backend in droves |
02:03:05 | FromDiscord | <awr> i don't think clang has anything like the EM_ASM intrinsics/macros |
02:03:37 | zachcarter | Can't you just override the nim module that provides that setting and add them yourself? |
02:03:51 | FromDiscord | <awr> i don't know if asm.js has a future (probably not) |
02:03:52 | zachcarter | There's a way to override / add to Nim modules in a project locally |
02:04:05 | zachcarter | who's still using asm.js anyway? |
02:04:28 | zachcarter | wasn't that just an experiment that lead to wasm? |
02:04:36 | FromDiscord | <awr> everything that was using it before and has since yet to move to wasm |
02:04:52 | FromDiscord | <awr> asm.js is supported by all the major browsers |
02:04:56 | FromDiscord | <awr> iirc |
02:05:12 | zachcarter | yes - but considering WASM is vastly improved over asm.js - I imagine it'd be to the benefit of users of said libraries to find a WASM replacement |
02:05:27 | FromDiscord | <awr> asm.js is less important i agree |
02:05:27 | zachcarter | I don't find much reason to support legacy targets that are bound to disappear |
02:05:56 | zachcarter | I think there is a compromise here - find some way to patch that config file and turn it into a nimble library that can be included in projects using emscripten to target asm |
02:06:22 | zachcarter | I've suggested this change long before you - and yuriy probably before me I magine |
02:06:34 | FromDiscord | <awr> i may get rid of it but that brings up the question of should we get rid of stuff like the CPU options for, say, the DEC alpha, m68k, ppc32 |
02:06:59 | zachcarter | well - I imagine as Nim matures, decisions like that will be easier to make |
02:07:14 | zachcarter | especially once there is enough time to develop analytics around Nim's usage |
02:07:18 | FromDiscord | <awr> and the atari and amiga compilation plats |
02:07:33 | zachcarter | which I imagine Araq / Nim haven't had much time for besides the survey and the analytics Dom bundled w/ choosenim |
02:07:57 | zachcarter | well - part of the appeal of Nim is being able to target a variety of different systems - pretty much any system |
02:08:07 | zachcarter | emscripten is a compiler - not a target |
02:08:12 | FromDiscord | <awr> by virtue of C yes |
02:08:49 | FromDiscord | <awr> yeah which is why i consider wasm32/64 a CPU |
02:08:51 | zachcarter | I'm not the one that needs convincing anyway - I undestand both sides of the argument, but I think there are reasonable alternatives. |
02:10:23 | zachcarter | I'd argue it's more of a chore to install emscripten and get the paths correct than it is to write a .cfg file for Nim to target emscripten |
02:10:31 | zachcarter | it's literally like 15 lines |
02:10:55 | FromDiscord | <awr> who exactly *is* hacking on m68k nowadays besides like...sega genesis homebrew games and obscure microcontroller platforms |
02:11:04 | FromGitter | <gogolxdong> @zachcarter [email protected]/readonly |
02:11:27 | zachcarter | here's how you can patch Nim modules - https://github.com/zacharycarter/zapp/blob/master/src/zapp.nims |
02:11:48 | zachcarter | and here's how you can cfg Nim to use wasm via emscripten fairly easily - https://github.com/zacharycarter/zapp/blob/master/nim.cfg |
02:11:56 | zachcarter | gogolxdong: thank you! |
02:12:45 | FromDiscord | <awr> i might take a look at that. i don't know if my local build of emscripten is just broken or what but the wasm generation is just not behaving |
02:14:30 | zachcarter | please do - and if you have questions, please ask me - there are a few community members (yuriy is the only one I can remember off the top of my head, but if you look up Nim wasm projects on github, it's easy to figure out) - that are familiar w/ wasm and emscripten |
02:14:34 | zachcarter | also - https://github.com/Feneric/nim-wasm-helpers |
02:14:59 | zachcarter | I haven't used that before, and I just found out about that (and this related blog post - https://www.spiria.com/en/blog/web-applications/webassembly-nim) - but they may be useful to you |
02:15:26 | FromDiscord | <awr> i'm more familiar with asmjs than i am with wasm but i've been poring over the docs |
02:16:00 | FromDiscord | <awr> lack of setjmp/longjmp()/zero cost exceptions in wasm is a little...hm |
02:16:16 | zachcarter | it's relatively simple to target via emscripten - I'm not sure what your endgame is with WASM, but if you look at this project - https://github.com/zacharycarter/zapp - it has a lot of WASM stuff going on in it |
02:16:57 | FromDiscord | <awr> i kinda want to make sure the standard library behaves in a reasonable manner with wasm |
02:17:41 | FromDiscord | <awr> to a large extent emscripten/clang already make that happen by giving the C interface a large degree of POSIX-ness |
02:17:46 | zachcarter | https://github.com/zacharycarter/zengine - I compiled that to WASM - the example you see in the topmost gif (via emscripten) |
02:18:33 | zachcarter | https://twitter.com/Hahaitsfunny/status/913526506139332613 |
02:19:23 | FromDiscord | <awr> cool stuff |
02:19:58 | zachcarter | thanks! |
02:20:10 | FromGitter | <gogolxdong> found some bugs when create user with RBAC ,fixed. |
02:20:14 | FromDiscord | <awr> i think wasm (i.e. wasm itself, not your project) needs some enhancements to better suit hosting a game engine |
02:20:23 | FromDiscord | <awr> [cough cough] SIMD types [cough cough] |
02:20:29 | zachcarter | that'd be nice |
02:21:31 | zachcarter | I'm finding git subtrees to be amazing |
02:21:40 | zachcarter | as far as git goes anyway - which it's not so amazing |
02:22:06 | FromGitter | <gogolxdong> Go will support WASM in next release. |
02:22:28 | zachcarter | it still won't have generics |
02:22:44 | zachcarter | and I really think Go is going to have the same problem Python 2|3 does |
02:22:49 | zachcarter | but we shall see |
02:23:14 | zachcarter | also - I bet that lunatic that won't get go of dep - is still going to be bitching about Go's package management |
02:24:30 | zachcarter | the only thing Go has going for it I think - is it's ecosystem and stdlib - both are very rich at this point |
02:24:47 | zachcarter | otherwise, I think there are better alternatives a.k.a. Nim |
02:24:59 | FromDiscord | <awr> go as a language is just reactionary IMO |
02:25:56 | zachcarter | well - I think there was a need for a more productive systems programming language that could be an alternative to all the C++ they were probably writing at Google |
02:25:59 | FromGitter | <gogolxdong> Agreed, Go is promoted significantly by Chinese community and developer , like what I did. |
02:26:21 | FromDiscord | <awr> "i hate writing code C++ it sucks so much therefore i'm going to make a language in the complete opposite direction of C++" |
02:26:22 | zachcarter | but - I don't think they hit the sweet spot of productivity vs friction - and I imagine a lot of that blame lies with Rob Pike and other language designers |
02:26:42 | FromGitter | <gogolxdong> I am trying to do the same in Nim. |
02:26:51 | zachcarter | go is not terse at all and isn't very DRY in certain regards - and the metaprogramming it does offer is extremely limited |
02:27:06 | zachcarter | often times when I'm writing go - I'm asking myself why I'm not just writing in C |
02:27:08 | FromDiscord | <awr> https://twitter.com/tpflug/status/1034754076523851776 |
02:27:11 | FromDiscord | <awr> highly relevant |
02:27:56 | zachcarter | yeah - that is a great comment / tweet |
02:28:16 | FromGitter | <gogolxdong> We can see where go ends. |
02:29:24 | FromDiscord | <awr> i think nim recognizes that a lot (not all) of C++'s high level goals are reasonable, but that C++ is the wrong implementation |
02:31:29 | FromGitter | <gogolxdong> but let folks choose, they are historic process. |
02:32:52 | zachcarter | awr: I agree - probably ditching a lot of the OOP features though |
02:33:00 | zachcarter | besides dynamic dispatch and single inheritance |
02:33:17 | zachcarter | but - I think that's a good thing - if people want these things they can extend the language to implement them |
02:33:28 | zachcarter | as has been done for interfaces and other OOP constructs |
02:33:54 | zachcarter | Lately at work - everyone thinks they're a functional programmer |
02:33:56 | FromDiscord | <awr> i think the OOP ditching stuff is reasonable for the most part. it's not that OOP is complete and utter sin but it's way too easy to get out of control |
02:34:10 | FromGitter | <gogolxdong> the only thing Nim need is more wathching, issues vanish and robustness boosts. |
02:34:11 | zachcarter | yet none of them have ever written a line of Scheme | Lisp | Haskell | Clojure |
02:34:16 | FromDiscord | <awr> languages with forced OOP constructs like java/C# |
02:34:17 | FromDiscord | <awr> ugh |
02:34:27 | zachcarter | I guess one guy has written some Haskell and Elm - but he is now trying to push functional typescript on everyone |
02:35:13 | zachcarter | gogolxdong: yes - but I think that will come in time w/ more community members and development on the language (which the partnership w/ status.im hopefully benefits) |
02:35:50 | zachcarter | the thing is - none of these peers understand why FP was the hotness for a while and why languages like Scheme / Lisp are barely used anymore |
02:36:22 | zachcarter | they just think they're being cool by spending 2x as long writing their code to not have any side effects |
02:36:35 | zachcarter | and they probably still aren't doing FP right |
02:36:48 | zachcarter | hell - most of them don't even know what a REPL is I imagine |
02:36:50 | FromGitter | <gogolxdong> You know a company named HuaWei in China? Every project it joins would be promoted to V1.0 very fast. |
02:36:51 | FromDiscord | <awr> i like to use FP constructs where it's convinient |
02:36:55 | zachcarter | I often have to fully explain the acronym |
02:37:22 | FromDiscord | <awr> mapIt()/applyIt() for instance might be quicker than a for loop |
02:37:41 | zachcarter | awr: I don't disagree - but people think that things like that are the essence of FP |
02:37:42 | FromDiscord | <awr> (not in terms of execution time, more like code-writing time) |
02:37:56 | zachcarter | when in reality they don't know what tail recursion is |
02:37:58 | zachcarter | or a monad |
02:38:00 | zachcarter | etc |
02:38:16 | zachcarter | and then they try to tell you why FP is so great and why imperative programmming is shit |
02:38:39 | zachcarter | actually - they probably don't know what imperative programming means - they will just bash Nim and then say they want to check out Rust for whatever asanine reason |
02:38:51 | FromDiscord | <awr> a healthy dose of FP can help but yeah there's a reason almost no one is doing haskell or lisp or w/e outside of universities |
02:39:23 | zachcarter | naughtydog is the only place I can think of - but I don't even know if they're using racket anymore or not |
02:39:32 | FromDiscord | <awr> they aren't |
02:39:35 | FromDiscord | <awr> well |
02:39:38 | FromDiscord | <awr> they use it for data |
02:39:53 | zachcarter | meh - I mean - you can write a GD game engine in forth if you want to |
02:39:55 | FromDiscord | <awr> they used to use GOAL for their engine stuff |
02:40:09 | FromDiscord | <awr> (their own systems programming lisp variant) |
02:40:15 | zachcarter | I don't care so much that they like FP - it's that they act like it's the holy grail, and they've never really used a functional language before |
02:40:26 | zachcarter | interesting |
02:40:39 | FromDiscord | <awr> i personally find programming in rust annoying but i really appreciate what people are doing in that sphere |
02:41:01 | zachcarter | also - any functional language that comes out (which is almost every week) - it gets shared because it's functional |
02:41:08 | FromDiscord | <awr> rust community is very cool |
02:41:11 | zachcarter | yeah - rust is great - but it's too much like coding in C++ for me |
02:41:29 | zachcarter | mmm I don't know - the whole riir thing go told quick - I think the community is a mixed bag |
02:41:44 | FromDiscord | <awr> RIIR? |
02:41:46 | zachcarter | but I do know some very nice and talented rustaceans |
02:41:49 | zachcarter | rewrite it in rust |
02:41:57 | FromDiscord | <awr> oh |
02:42:08 | zachcarter | which people would just randomly post over and over again in github repos as issues |
02:42:15 | zachcarter | why don't you rewrite this in rust? |
02:42:23 | zachcarter | it was memelike for a while |
02:42:31 | FromDiscord | <awr> i think i know what you're talking about |
02:43:15 | zachcarter | I think it suffers the same problem that any large community does - you're going to attract kids and sycophants who will annoy the fuq out of everyone in order to get attention |
02:43:53 | FromDiscord | <awr> "RIIR" as an acronym sounds like some obscure C++ feature you've never heard of but is making the waves for C++21 |
02:43:56 | zachcarter | it's like Godot - I don't like the engine to begin with and alot of the decisions the authors of the engine have made - but the community is intolerable |
02:44:04 | zachcarter | lol it might be |
02:44:44 | zachcarter | I love Nim's community - it's full of extremely intelligent talented people who love the language and want to see it and its contributors / users succeed |
02:45:04 | FromDiscord | <awr> godot is interesting i guess but i don't know too much about it except that it uses a python-not-python scripting language |
02:45:33 | zachcarter | and I love the language - it's the language I've learned the most from, as you can start from a very high level of understanding, but at the same time dive down into a very low level set of features that you wouldn't encounter / find useful in other higher level languages |
02:46:06 | zachcarter | and it's pluggable - you don't want the default GC? use boehm. you don't want a GC at all? don't use one! |
02:46:36 | zachcarter | and even if you want to deal with the default memory model and the thread-local heap - there is the shared heap to assuage that issue |
02:47:21 | FromDiscord | <awr> listennnnnn uh here microsoft your operating system i think you call it "windows" pretty cool stuff, but what if you rewrote it entirely in Nim |
02:47:31 | zachcarter | :P |
02:47:44 | zachcarter | actually - I was reading this earlier - it's extremely on point and interesting |
02:48:00 | FromDiscord | <awr> i wonder if Redox will go anywhere |
02:48:04 | zachcarter | https://cr.yp.to/bib/1995/wirth.pdf |
02:49:36 | FromDiscord | <awr> "What Andy giveth, Bill taketh away" |
02:49:47 | zachcarter | awr: regarding redox - I don't think so |
02:50:16 | zachcarter | :P |
02:51:25 | zachcarter | also - Nim drew some (not sure how much) inspiration from Oberon - so that pdf is also highly relevant :) |
02:56:27 | FromGitter | <gogolxdong> Have you read a science fiction named Three Body which won the Hugo Award in 2014? |
02:58:11 | FromGitter | <timotheecour> @zachcarter thanks for the links regarding wasm! will take a look later |
03:00:42 | FromGitter | <gogolxdong> There is a concept named dimensionality reduction strike(not guaranteed translation, it has English version), it draws an analogy between Nim and many other languages. |
03:01:35 | zachcarter | timotheecour: np! |
03:02:08 | zachcarter | gogolxdong: https://en.wikipedia.org/wiki/The_Three-Body_Problem_(novel) ? |
03:02:39 | FromGitter | <gogolxdong> yep. |
03:03:24 | zachcarter | I haven't - but I see there's an english translation - I will check it out :) thanks for the suggestion! |
03:03:35 | zachcarter | I love science-fiction |
03:04:42 | FromGitter | <gogolxdong> you're welcome. |
03:04:56 | FromDiscord | <awr> anyone who cares about {.reorder.} pragma - does this look like correct behavior: https://github.com/nim-lang/Nim/pull/8806#issuecomment-417139912 |
03:08:33 | FromGitter | <Quelklef> @awr I'm not "in" on the {.reorder.} pragma but that seems iffy |
03:09:10 | FromGitter | <Quelklef> Depends on whether "declared" means "syntactically declared" or "accessible"/"referrable to" |
03:10:15 | FromDiscord | <awr> i haven't looked into the reorder impl but from what i understand it reorders code wholesale, not just generating hidden forward decls |
03:11:01 | FromGitter | <Quelklef> yeah |
03:11:15 | FromGitter | <Quelklef> I'm just pointing out that there's no correct answer, depending on what `declared` means conceptually |
03:11:53 | FromDiscord | <awr> does macro expansion influence `declared()`? |
03:11:53 | FromGitter | <Quelklef> looks like an interesting pragma tho |
03:11:59 | FromGitter | <Quelklef> this language continues to surprise me |
03:12:24 | FromGitter | <Quelklef> @awr Depends on what you mean by "influence" |
03:12:38 | FromGitter | <Quelklef> Example? |
03:13:07 | zachcarter | I think hyperHTML is a good library (in terms of feature accomplishment - not necessarily code quality) - but it infuriates me to no end when JS developers do shit like this - |
03:13:19 | zachcarter | https://github.com/WebReflection/hyperHTML/blob/master/index.js#L1416-L1418 - WHYYYYYY? |
03:13:21 | FromDiscord | <awr> say a new top-level symbol is generated from a macro, then we check that symbol against `declared()` - what does it return, true or false |
03:13:51 | FromGitter | <Quelklef> In the case of e.g. ⏎ ⏎ ```declaresX() ⏎ echo(declared(x))``` [https://gitter.im/nim-lang/Nim?at=5b8760efcff55e56177ded6c] |
03:13:58 | FromGitter | <Quelklef> Im 99% sure it'll be declared |
03:14:01 | FromGitter | <Quelklef> but we can find out! |
03:14:26 | FromGitter | <Quelklef> !eval (template declaresX() = var x: int); declaresX(); echo(declared(x)) |
03:14:27 | NimBot | Compile failed: in.nim(1, 2) Error: expression expected, but found 'keyword template' |
03:14:31 | FromGitter | <Quelklef> sigh |
03:15:03 | FromDiscord | <awr> it may not work with a multi-liner, try inject pragma |
03:15:46 | zachcarter | it doesn't work |
03:15:47 | FromGitter | <Quelklef> I ended up with |
03:15:49 | FromGitter | <Quelklef> `````` |
03:16:04 | FromGitter | <Quelklef> And it outputs `true` |
03:17:33 | FromDiscord | <awr> yup hm |
03:17:36 | FromGitter | <Quelklef> IMO, having `declared(x)` be false in the github example would probably be much less useful than having it be true, so it should be considered a bug |
03:17:46 | FromDiscord | <awr> this may as well be a problem |
03:17:47 | FromDiscord | <awr> i agree |
03:17:52 | FromGitter | <rayman22201> @awr just to pipe in about obscure platforms, I hacked together Nim support for ppc32 AIX a while ago for work (old banking infrastructure), and it was super nice... I never got a chance to clean it up and push it though.... one of these days maybe.... |
03:18:07 | FromDiscord | <awr> lol that's awesome |
03:18:21 | FromDiscord | <awr> part of me wishes that PPC was still relevant |
03:18:56 | FromGitter | <rayman22201> It was fine... I hate AIX though... it's mostly POSIX, until it's not, and then you want to kill yourself lol |
03:19:18 | FromDiscord | <awr> there's a fork of unreal engine 4 running on ppc64le |
03:19:19 | FromDiscord | <awr> https://www.youtube.com/watch?v=05NNFJj3Mrw |
03:19:24 | FromGitter | <rayman22201> PPC has some interesting features as an architecture though. |
03:21:16 | FromGitter | <rayman22201> lol, the unreal thing is awesome |
03:36:28 | FromGitter | <gogolxdong> hi |
03:37:27 | FromGitter | <gogolxdong> testing connection |
03:37:28 | FromGitter | <gogolxdong> familiar with nginx upload reverse proxy configuration? |
03:38:22 | FromGitter | <gogolxdong> seems unstable. |
03:38:39 | FromGitter | <gogolxdong> familiar with nginx upload reverse proxy configuration? |
03:40:31 | * | skrylar joined #nim |
03:41:28 | * | skrylar quit (Client Quit) |
03:42:53 | * | skrylar joined #nim |
03:48:22 | * | endragor joined #nim |
03:55:08 | * | nsf joined #nim |
03:59:56 | * | dddddd quit (Read error: Connection reset by peer) |
04:10:42 | zachcarter | lol for once - I'm thankful for babel |
04:11:15 | zachcarter | it turned that one liner into - https://gist.github.com/zacharycarter/69857eb7d647efbdfc635ce7100295c3 |
04:12:15 | zachcarter | why the original authors decided it was a good idea to one-liner that expression is beyond me |
04:15:37 | zachcarter | err I guess it's a statement |
04:15:55 | zachcarter | I don't know - that entire line confuses me - I can't understand what it's doing until it's broken down into multiple lines - too many ternary operators |
04:20:11 | FromGitter | <dlutton> is there an easy way to parse form-data from a req-body? |
04:25:20 | zachcarter | dlutton: https://github.com/dom96/jester/blob/ecb12433e7fd4b7e3ad8a381925d4097ef0d40cb/jester/request.nim#L105 |
04:25:44 | zachcarter | https://github.com/dom96/jester/blob/master/jester/request.nim#L105 - is probably a better link |
04:25:57 | FromGitter | <dlutton> great thank you! |
04:26:52 | zachcarter | sure thing! |
04:28:21 | FromGitter | <dlutton> I take it I have to use the jester package |
04:28:29 | zachcarter | well - you have a few options |
04:29:08 | zachcarter | you can copy pasta that code into whatever you're working on - or you could potentially write a library for doing such - and then ask dom (the author of nimble) to incorporate it into nimble - so it could be reused |
04:29:18 | zachcarter | I don't know what you're working on / building |
04:30:34 | zachcarter | there's also - https://github.com/tulayang/httpform - but that looks very old so I'm not sure it will compile with whatever version of Nim you're using - if you want to use that you may have to fix newly introduced errors |
04:31:32 | zachcarter | often, I find doing things like this - https://github.com/search?l=&q=formdata+language%3ANim&type=Code - the easiest way to find what I'm looking to do when it comes to Nim code - generally someone's already done it or turned it into a library |
04:32:03 | zachcarter | you may need to fork / pr the library to make it work w/ the latest Nim - but that's to be somewhat expected w/ a maturing language |
04:32:24 | zachcarter | or you can just copy the code from Jester and put it into your project :) I think it's just a few procedures |
04:32:47 | FromGitter | <dlutton> okay great. I'm just learning/messing around with nim by building a slack bot, so I need to parse form-data. |
04:32:53 | FromGitter | <dlutton> yea I noticed it's a couple of procs |
04:33:12 | zachcarter | gotcha |
04:34:17 | zachcarter | btw - cool idea for learning / experimenting with Nim :) As much as I don't like slack (forced to use it at work) - I think that kind of application is great onramp for learning a new language |
04:34:36 | zachcarter | you can just play around with syntax / language features and build something very trivial yet potentially useful at the same time |
04:35:18 | zachcarter | and there's a ready to consume API at your fingertips |
04:36:20 | FromGitter | <dlutton> yep exactly. it's just going to be a simple bot for a espn fantasy football league I'm in to send scores based on the week # you give it. I always try to think of a useful small project to learn a new language. |
04:39:31 | zachcarter | nice! sounds fun! |
04:39:36 | zachcarter | perfect timing too :D |
04:39:53 | zachcarter | season starts in like 11 days or something? |
04:40:58 | zachcarter | if you have any other questions - please feel free to ping me / others - we love spreading Nim knowledge :) |
04:42:26 | FromGitter | <dlutton> I appreciate it |
04:45:35 | * | vivus quit (Remote host closed the connection) |
05:10:21 | zachcarter | dlutton: well - the reverse hope is that you enjoy using Nim, and continue to use it :) |
05:13:06 | FromGitter | <dlutton> @zacharycarter I plan on using it for a while and contributing once I gain more knowledge on the language. :) |
05:30:10 | * | darithorn quit (Quit: WeeChat 2.2) |
05:52:53 | zachcarter | awesome :D |
05:56:47 | * | gibril quit (Remote host closed the connection) |
06:01:20 | * | sz0 joined #nim |
06:33:58 | * | Lord_Nightmare quit (Ping timeout: 252 seconds) |
06:37:51 | * | skrylar quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
06:55:06 | * | Lord_Nightmare joined #nim |
07:21:52 | FromGitter | <tim-st> how can I free a string that I dont use anymore, so it doesnt need to be gc'ed? |
07:22:24 | FromGitter | <gogolxdong> I am concerned too. |
07:22:43 | FromGitter | <gogolxdong> good catch. |
07:25:34 | FromGitter | <tim-st> @ephja yes, you're right, the `stream_buffer_bound` is the "worst encoded size", I will try if it works with setLen, though it's a bit problematic that so much memory is reserved |
07:26:09 | leorize | tim-st: you can't free a string |
07:26:57 | FromGitter | <ephja> you could optionally pre-allocate or use a smaller value and hope for the best |
07:27:13 | FromGitter | <tim-st> leorize: thanks |
07:27:56 | FromGitter | <tim-st> @ephja I will add two procs, one for `var string`, I then use as few memory as possible, create a new string that copies to the real size and hope that the old big memory is freed quickly |
07:29:05 | FromGitter | <tim-st> I think because of this they have the "stream compression" that uses likely much less memory |
07:29:22 | FromGitter | <tim-st> but I'm ok with string for now :) |
07:34:30 | FromGitter | <tim-st> I assume setLen doesnt touch the internally memory and just sets the int size? |
07:34:49 | FromGitter | <tim-st> (if setLen is smaller than before) |
07:48:54 | FromGitter | <Araq> true |
07:55:41 | * | Vladar joined #nim |
08:01:15 | FromGitter | <tim-st> ok, then my idea from above is good I think, for example if I create result = newStringOfCap(1000); result.setLen(1); the returned string will always have the huge memory as long it's alive, and using my way it will only have the small memory, but one extra copy |
08:02:35 | FromGitter | <tim-st> another question: does nim free gc'ed typed in a local scope without gc when it's clear that they dont leave the scope? |
08:03:15 | FromGitter | <tim-st> gc'ed memory types I meant |
08:03:45 | * | flyx|znc joined #nim |
08:03:49 | * | gmpreussner joined #nim |
08:04:34 | * | gmpreussner_ quit (Ping timeout: 250 seconds) |
08:07:27 | FromGitter | <tim-st> ok, now I read I can use `alloc` and `dealloc` I think this is what I need for the temp string |
08:10:00 | FromGitter | <gogolxdong> I don't think you can alloc and dealloc string. |
08:10:29 | * | flyx quit (Ping timeout: 264 seconds) |
08:10:32 | FromGitter | <tim-st> but I can alloc and dealloc `UncheckedArray[char]` or not? |
08:10:33 | * | nif quit (Ping timeout: 268 seconds) |
08:11:33 | * | PMunch joined #nim |
08:12:19 | leorize | tim-st: you can |
08:12:29 | FromGitter | <tim-st> https://forum.nim-lang.org/t/3158 |
08:12:35 | leorize | but why would you want to manually free string? |
08:12:45 | FromGitter | <gogolxdong> it's the underlying structure of string, I think you can do that. |
08:13:20 | FromGitter | <tim-st> leorize: because it's a temp where I only use like 10% of the size, but as long it's used all the 100% is in memory |
08:13:45 | FromGitter | <tim-st> instead I want to copy the used 10% to a real string and delete the temp after that |
08:13:56 | * | nif joined #nim |
08:14:02 | leorize | then it should be collected when the temp gone out of scope |
08:14:54 | FromGitter | <tim-st> so the manual way wouldnt be faster? |
08:15:08 | FromGitter | <gogolxdong> what I need is avoiding string copy in stdlib, such as httpclient. since string is value type in Nim. |
08:17:04 | FromGitter | <tim-st> I tried zero copying with strings but the data was corrupted somehow... |
08:17:25 | FromGitter | <gogolxdong> response from cloud provider is large enough , it doubles or triples in memory at assignment. |
08:17:28 | leorize | for aliasing strings, use `ref string` |
08:18:17 | leorize | tim-st: no, but only benchmarks can prove it |
08:18:39 | FromGitter | <tim-st> leorize: ok, sounds good, then I leave it^^ |
08:21:28 | FromGitter | <gogolxdong> proivders like Azure and AWS, the response is insanely large, and we have to handle them concurrently to reduce processing time from 4 hours down to 4 mins. |
08:21:34 | FromGitter | <timotheecour> hi @Araq is https://github.com/nim-lang/Nim/pull/8682 ok now? |
08:22:19 | leorize | timotheecour: you don't have to ping Araq every now and then |
08:22:45 | leorize | it will appears on his github notification and mail, and he will review it when he have time |
08:24:01 | * | abm joined #nim |
08:24:46 | FromGitter | <gogolxdong> it runs out of 8GB memory for now in 2 mins. |
08:26:39 | FromGitter | <gogolxdong> take care of value type when you are working with high workload. |
08:28:13 | leorize | new runtime will introduce proper move schematic for seqs and strings :) |
08:30:00 | FromGitter | <gogolxdong> yes, he said Nim will move most strings though soon, though don't know how to use it now.\\ |
08:30:57 | leorize | https://github.com/nim-lang/Nim/issues/7041 |
08:31:01 | leorize | should be there by v1 :P |
08:33:22 | FromGitter | <gogolxdong> then the problem gone without having to anything. :) |
08:41:45 | * | cspar joined #nim |
08:56:24 | * | vqrs quit (Ping timeout: 252 seconds) |
08:58:42 | * | vqrs joined #nim |
09:11:33 | * | Vladar quit (Remote host closed the connection) |
09:12:09 | * | Vladar joined #nim |
09:27:00 | FromGitter | <tim-st> @ephja I got a high level wrapper for compression and decompression working for the types `seq[uint8]`, `seq[char]`, `string`, just one problem: while I get the worst length for the compression proc, I dont get the worst length for the decompression proc, currently I use uncompressed*1000 :\ |
09:27:33 | FromGitter | <tim-st> (worst theoretically length) |
09:34:01 | FromGitter | <tim-st> ok, the decompression proc requires a ptr to "allocator" to get this working, dont know how this works |
09:44:31 | FromGitter | <ephja> then that must mean that the default allocator allocates too much |
09:45:40 | FromGitter | <ephja> or are you using anything other than lzma_stream_buffer_decode? |
10:05:25 | FromGitter | <tim-st> no, but it's obvious that this doesnt work without an allocator, since the compressed length is in no relation to the uncompressed length. the allocator object type is defined in `lzma\private\base` as `allocator` and expects two procs |
10:06:36 | * | seni joined #nim |
10:06:37 | FromGitter | <tim-st> the `compress` does work without an allocator, but also here in allocator would be better to save memory |
10:16:56 | * | kapil___ joined #nim |
10:20:17 | * | endragor quit (Remote host closed the connection) |
10:35:50 | FromGitter | <timotheecour> How do I find a needle in a haystack (ie strstr) with UF8/unicode ? |
10:52:29 | * | nsf quit (Quit: WeeChat 2.2) |
10:54:09 | * | xet7 joined #nim |
10:55:04 | PMunch | timotheecour, find? |
10:56:51 | FromGitter | <timotheecour> Oh, right, i suppose no UTF8 decoding is needed for that, ok I’ll try that, thx! |
11:15:28 | * | cspar quit (Ping timeout: 245 seconds) |
11:21:59 | * | noonien joined #nim |
11:23:10 | * | krux02 joined #nim |
11:24:46 | * | SenasOzys quit (Ping timeout: 250 seconds) |
11:24:49 | * | cspar joined #nim |
11:29:19 | * | SenasOzys joined #nim |
11:35:21 | * | zachcarter quit (Ping timeout: 252 seconds) |
11:47:38 | * | endragor joined #nim |
11:52:14 | FromGitter | <xmonader> is there a public proc for `sendCommand` in redis package? |
11:52:19 | * | endragor quit (Ping timeout: 252 seconds) |
11:55:43 | * | PMunch quit (Quit: Leaving) |
11:57:49 | * | PMunch joined #nim |
12:04:13 | * | dddddd joined #nim |
12:08:33 | * | opi_ quit (Quit: ZNC - http://znc.in) |
12:09:17 | * | opi_ joined #nim |
12:30:51 | * | PMunch quit (Quit: Leaving) |
12:31:00 | * | PMunch joined #nim |
13:02:14 | PMunch | I asked about this yesterday but I don't think anyone answered. Should we try to get a Nim talk in at FOSDEM this year? |
13:02:19 | PMunch | Even just a lightning talk |
13:02:39 | PMunch | I remember we talked about doing it last year |
13:02:50 | FromGitter | <tim-st> can I add a number to a `addr` to get a new `addr`? I'm porting a c++ code it's done there |
13:06:02 | FromGitter | <tim-st> ok, solved this, just indexed the char at the incremented position and used this addr |
13:10:03 | FromGitter | <ephja> cast to an array ptr type or cast to int, increment and cast back |
13:11:37 | FromGitter | <mratsim> just use ptr UncheckedArray type |
13:18:30 | FromGitter | <Varriount> PMunch: Depends, does anyone have a talk prepared? |
13:22:43 | * | abm quit (Read error: Connection reset by peer) |
13:27:15 | FromGitter | <tim-st> @ephja I have it working, I ported this c++ code line by line: https://ptspts.blogspot.com/2011/11/how-to-simply-compress-c-string-with.html |
13:27:38 | FromGitter | <tim-st> will make some tests to see if all work, and then make a PR |
13:29:46 | * | Vladar quit (Remote host closed the connection) |
13:31:03 | FromGitter | <tim-st> I think `strutils` should support `"abc" * 1000` like python as a short form of repeat |
13:32:11 | PMunch | Varriount, well I could probably whip up a lightning talk by February :P |
13:32:40 | PMunch | For such a short talk though you really need to narrow down what you want to talk about though |
13:32:54 | PMunch | s/though$// |
13:32:57 | * | ftsf quit (Quit: Leaving) |
13:34:32 | PMunch | For anything longer I think they require us to create a full developer room |
13:34:42 | PMunch | Which probably isn't easy |
13:34:51 | PMunch | And requires a lot more content |
13:35:05 | FromGitter | <narimiran> @PMunch: yes, we should get nim talk at fosdem |
13:35:52 | FromGitter | <mratsim> Nim for scientific computing :P |
13:38:17 | PMunch | Try to get 5 back to back lighting talks about Nim for different things :P |
13:38:42 | FromGitter | <ephja> lol |
13:41:17 | FromGitter | <kaushalmodi> "Nim for CLI apps" |
13:47:58 | * | nsf joined #nim |
13:48:44 | federico3 | PMunch: you probably need a large enough crowd to get a devroom at FOSDEM |
13:49:26 | PMunch | Yeah, I don't think that's feasible for us |
13:49:32 | PMunch | Plus it would mean a lot of work |
13:49:42 | PMunch | But I definitely think we should try and get a lighting talk |
13:51:36 | * | Vladar joined #nim |
14:03:27 | FromGitter | <narimiran> @mratsim are we scientists yet? :) |
14:04:30 | FromGitter | <xmonader> @PMunch totally should do that! |
14:12:41 | FromGitter | <xmonader> Current problem ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b87fb594be56c5918b94ac2] |
14:13:43 | FromGitter | <xmonader> this endpoint playground.hub.grid.tf 9910 is publicly available if anyone wants to try |
14:16:07 | FromGitter | <mratsim> @miran check out nimtorch btw |
14:16:22 | FromGitter | <ephja> @tim-st great |
14:16:40 | FromGitter | <ephja> 1) is only used for addition, so maybe * should only be used for multiplication |
14:25:28 | FromGitter | <ephja> for those who aren't on gitter: 1) should be + |
14:25:58 | * | coft joined #nim |
14:26:29 | FromGitter | <narimiran> i haven't used torch, but that looks quite promising from what i can tell |
14:40:44 | * | norok2 quit (Remote host closed the connection) |
14:48:14 | * | norok2 joined #nim |
14:48:21 | * | norok2 quit (Client Quit) |
15:10:11 | * | Perkol joined #nim |
15:15:22 | * | tripleslash23 joined #nim |
15:16:12 | * | tripleslash23 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
15:23:20 | * | miran joined #nim |
15:24:18 | * | biberao14 joined #nim |
15:28:56 | * | nsf quit (Quit: WeeChat 2.2) |
15:30:16 | * | biberao14 quit (Ping timeout: 246 seconds) |
15:36:32 | * | coft quit (Quit: Page closed) |
15:39:45 | FromGitter | <kaushalmodi> Trying to understand why pairs iter doesn't work in json for me |
15:39:56 | FromGitter | <kaushalmodi> from the code in json.nim: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b880fccc2bd5d117af52f6c] |
15:40:19 | FromGitter | <kaushalmodi> the node type is `JsonNode` but the assertion is `node.kind == JObject` |
15:41:16 | FromGitter | <kaushalmodi> Here ( https://github.com/kaushalmodi/ntodo/blob/298530659596ed77e3f56fe40a67f70d82099a20/src/ntodopkg/projects.nim#L4-L27 ), jsonObj is a value returned by `parseJson` internally |
15:41:28 | FromGitter | <kaushalmodi> so it is of type `JsonNode`. |
15:41:39 | FromGitter | <kaushalmodi> So I am unable to use the `pairs` iter in that snippet |
15:48:57 | FromGitter | <kaushalmodi> Looks like we can add this to json.nim? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8811e8f5402f32aab31d29] |
15:49:30 | FromGitter | <kaushalmodi> It works.. though I cannot understand how both that and the original: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ co-exist [https://gitter.im/nim-lang/Nim?at=5b88120acff55e5617820c60] |
15:49:43 | * | Trustable joined #nim |
15:50:02 | FromGitter | <kaushalmodi> both have the same parameter type JsonNode.. what prevents the assertion failure in the JObject version? |
15:52:27 | * | Guest42469 joined #nim |
15:54:55 | FromGitter | <kaushalmodi> I have open https://github.com/nim-lang/Nim/issues/8818 regarding pairs iter for JArray if anyone is interested in commenting on that. |
15:54:58 | FromGitter | <mratsim> the kind can be a Jstring or a Jint |
15:55:01 | FromGitter | <kaushalmodi> s/open/opened |
15:56:10 | FromGitter | <mratsim> can you add `assert node.kind == JObject, &“Error kind was {node.kind}, expected a Object}”`? |
15:56:23 | FromGitter | <mratsim> Object* |
15:56:29 | FromGitter | <mratsim> JObject |
15:57:12 | * | Guest42469 quit (Remote host closed the connection) |
16:02:02 | FromGitter | <Vindaar> Isn't that `pairs` iterator going to be ambiguous with the current `pairs` iterator? They both accept `JsonNode` and the kind is only known at run time. I guess that's why there's only the `JObject` one |
16:02:45 | FromGitter | <kaushalmodi> @Vindaar exactly.. that's my confusion too: "both have the same parameter type JsonNode.. what prevents the assertion failure in the JObject version?" |
16:03:37 | FromGitter | <kaushalmodi> Shouldn't there be just one `pairs` for `JsonNode` and then have a case statement for JObject, JArray, etc in there? |
16:03:57 | FromGitter | <Vindaar> If I include your `pairs` and run it, for me it always uses the `JArray` one, which then does fail for `JObject` |
16:04:30 | FromGitter | <Vindaar> One could case on `JsonNode.kind`, but the issue is that you'd want a `tuple[string, JsonNode]` as return value in one case and `tuple[int, JsonNode]` in the other. But there's no return type overloading in Nim |
16:05:23 | FromGitter | <Vindaar> `int`s can be returned as `string` of course, but that's kinda hacky |
16:05:35 | FromGitter | <kaushalmodi> hmm |
16:06:03 | FromGitter | <kaushalmodi> May be JObject etc should have been types and not kinds |
16:06:28 | FromGitter | <kaushalmodi> So.. what's a good fix? |
16:06:29 | FromGitter | <mratsim> but those are known only at run time |
16:06:40 | FromGitter | <kaushalmodi> *nods head* |
16:07:21 | FromGitter | <mratsim> runtime types = variants/kinds or ref inherited objects |
16:10:24 | FromGitter | <Vindaar> Personally I'd probably just define my own iterator with a different name for this case. But one could also make use of that `enumerate` macro, no? |
16:10:40 | FromGitter | <kaushalmodi> @mratsim ⏎ ⏎ > but those are known only at run time ⏎ ⏎ But have a case statement in the pairs should still work right? [https://gitter.im/nim-lang/Nim?at=5b881700c2bd5d117af55f7a] |
16:11:29 | FromGitter | <kaushalmodi> no wait, sorry, because as @Vindaar pointed out, the return types would be different |
16:11:55 | FromGitter | <kaushalmodi> I haven't use enumerate macro.. how would I use it with a JArray case? |
16:13:28 | FromGitter | <Vindaar> I think Araq just posted it as a snippet somewhere once, using the experimental `forLoopStmt` |
16:15:10 | FromGitter | <Vindaar> Ah, it's in the manual nowadays (though not in v0.18.0 yet) |
16:15:47 | FromGitter | <Vindaar> from the manual: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b88183311227d711def576b] |
16:17:21 | FromGitter | <kaushalmodi> I get: "Error: attempting to call undeclared routine: 'items'" |
16:17:30 | * | cspar quit (Ping timeout: 252 seconds) |
16:17:31 | FromGitter | <Vindaar> yeah, me too :S |
16:18:13 | FromGitter | <kaushalmodi> and if I comment out that first loop: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8818c4d457a1406c84eb93] |
16:18:24 | FromGitter | <Vindaar> oh |
16:18:50 | FromGitter | <kaushalmodi> Araq: Any help with the above ^ ? |
16:22:11 | FromGitter | <mratsim> don’t forget to add {.experimental:”ForLoopMacros”.} |
16:22:25 | FromGitter | <Vindaar> ahh, that's the syntax! |
16:22:55 | FromGitter | <Vindaar> or not? |
16:22:58 | FromGitter | <mratsim> forLoopStmt is the syntax, but the pragma is ForLoopMacros |
16:23:06 | FromGitter | <kaushalmodi> @mratsim Where do I put that pragma? |
16:23:12 | FromGitter | <mratsim> anywhere in the file |
16:23:29 | FromGitter | <mratsim> or pass —experimental:ForLoopMacros in the compilation command line |
16:23:40 | FromGitter | <kaushalmodi> got it |
16:23:52 | FromGitter | <Vindaar> I remembered something like this (hence my "oh" above), but thought it was either just `{.experimental.}` or `{.forLoopMacros.}` :D |
16:23:53 | FromGitter | <kaushalmodi> copy/pasting doesn't help @Vindaar if you too did that :P |
16:24:03 | FromGitter | <Vindaar> yeah, I saw those nasty wrong " |
16:24:04 | FromGitter | <Vindaar> :D |
16:24:40 | * | savoir-faire14 joined #nim |
16:25:02 | FromGitter | <kaushalmodi> ok, so I just added `{.experimental:"ForLoopMacros".}` below `import macros` in @Vindaar 's original snippet.. and it works! |
16:25:06 | FromGitter | <kaushalmodi> now what :) |
16:25:31 | FromGitter | <kaushalmodi> I guess I can put in a JArray instead of that int array.. trying out .. |
16:27:33 | FromGitter | <kaushalmodi> interesting.. this gives "redefinition error" |
16:27:40 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b881afc60f9ee7aa4b3298a] |
16:27:44 | * | savoir-faire14 quit (Remote host closed the connection) |
16:27:48 | FromGitter | <Vindaar> ah, that's because of how the macro works |
16:27:54 | FromGitter | <kaushalmodi> wouldn't a2, b2 be locals? |
16:27:59 | FromGitter | <Vindaar> the `a2` and `b2` are actually defined variables |
16:28:21 | FromGitter | <mratsim> the enumerate macro doesn’t open a new scope |
16:28:22 | FromGitter | <Vindaar> the macro just rewrites the for loop by first declaring these vars and then incrementing the counter |
16:28:38 | FromGitter | <mratsim> it should create a block |
16:29:06 | FromGitter | <mratsim> tbh it’s just a copy-paste from the test suite ;) |
16:29:11 | FromGitter | <kaushalmodi> yes, it would be common to reused var names like `idx`, `val` etc in pairs |
16:29:34 | FromGitter | <kaushalmodi> we cannot keep on appending numbers to these to uniquify them |
16:30:35 | FromGitter | <mratsim> add the end just add ⏎ ⏎ ```result = quote do: block `result```` [https://gitter.im/nim-lang/Nim?at=5b881babe5b40332ab1e38b1] |
16:30:41 | FromGitter | <mratsim> at* |
16:31:58 | FromGitter | <Vindaar> need to write it like so ⏎ ⏎ ``` result = quote do: ⏎ block: `result```` [https://gitter.im/nim-lang/Nim?at=5b881bfee5b40332ab1e3afc] |
16:32:11 | FromGitter | <Vindaar> otherwise complains about indentation |
16:32:35 | Demos[m] | Are there any useres of —genDeps |
16:32:54 | Demos[m] | Is there any way to use genDeps and also actually compile the program |
16:33:36 | FromGitter | <kaushalmodi> Thanks @mratsim @Vindaar so this finally works! |
16:33:40 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b881c64e5b40332ab1e3d6e] |
16:34:12 | FromGitter | <kaushalmodi> @Vindaar @mratsim Do you want to send a PR to fix this? |
16:34:39 | FromGitter | <mratsim> feel free, I dealt too much with forloopMacros issues last week |
16:35:15 | FromGitter | <mratsim> well, more like “experimental” issues, because the forLoopMacros were working perfectly |
16:37:33 | FromGitter | <Vindaar> You can create the PR if you wish |
16:38:21 | FromGitter | <kaushalmodi> It won't be write morally.. I just copy/pasted what you guys suggested.. I don't understand that code |
16:40:26 | FromGitter | <Vindaar> I really don't mind (not like I did a whole lot more than copy pasting from the manual ;) ), but I can do it if it makes you feel better :) |
16:44:28 | * | cottongin18 joined #nim |
16:44:38 | FromGitter | <kaushalmodi> Yes please (because I still haven't got to learning macros) |
16:46:00 | * | Guest26133 joined #nim |
16:46:43 | * | cottongin18 quit (Remote host closed the connection) |
16:48:20 | * | Guest26133 quit (Remote host closed the connection) |
16:48:21 | * | sielicki joined #nim |
16:49:04 | * | sielicki quit (Remote host closed the connection) |
16:49:48 | * | cspar joined #nim |
16:51:34 | * | jjido joined #nim |
16:53:17 | * | Fridtjof16 joined #nim |
16:54:07 | * | Fridtjof16 quit (Remote host closed the connection) |
16:57:48 | * | Guest32616 joined #nim |
16:59:20 | * | raynold joined #nim |
16:59:48 | * | Guest32616 quit (Remote host closed the connection) |
17:03:18 | FromGitter | <Vindaar> all done: https://github.com/nim-lang/Nim/pull/8819/files |
17:07:34 | * | raynold quit (Ping timeout: 246 seconds) |
17:09:42 | * | Vladar quit (Remote host closed the connection) |
17:13:01 | FromGitter | <Araq> ah good catch, hmm |
17:18:00 | * | SenasOzys quit (Ping timeout: 252 seconds) |
17:22:45 | * | nuxdie_ quit (Quit: WeeChat 2.1) |
17:22:59 | * | nuxdie joined #nim |
17:24:45 | * | PMunch quit (Quit: Leaving) |
17:29:16 | * | SenasOzys joined #nim |
17:35:33 | * | Vladar joined #nim |
17:41:43 | * | jjido quit (Ping timeout: 245 seconds) |
17:50:34 | * | Trustable quit (Remote host closed the connection) |
17:59:59 | * | floppydh quit (Quit: WeeChat 2.2) |
18:07:51 | * | rockcavera quit (Remote host closed the connection) |
18:11:59 | * | seym0ur joined #nim |
18:12:33 | * | seym0ur left #nim ("+++++++++++++++++++++++++++++++++") |
18:16:06 | * | thomasross quit (Remote host closed the connection) |
18:16:32 | * | thomasross joined #nim |
18:17:21 | * | vegax87 quit (Changing host) |
18:17:21 | * | vegax87 joined #nim |
18:17:21 | * | vegax87 quit (Changing host) |
18:17:21 | * | vegax87 joined #nim |
18:34:01 | * | cspar quit (Ping timeout: 246 seconds) |
18:39:02 | * | rockcavera joined #nim |
18:41:38 | * | Vladar quit (Remote host closed the connection) |
18:42:07 | * | Vladar joined #nim |
18:46:00 | * | kapil___ quit (Quit: Connection closed for inactivity) |
18:51:49 | FromGitter | <kaushalmodi> Given few handful str vars, how would you make sure that only one of them in non-empty (not "") |
18:51:50 | FromGitter | <kaushalmodi> ? |
19:07:48 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b884084f86b741b05e6c500] |
19:07:51 | FromGitter | <kayabaNerve> @kaushalmodi |
19:13:37 | FromGitter | <Quelklef> `@[s1, s2, s3, s4].filter(s => s != "").len == 1` |
19:13:57 | FromGitter | <kayabaNerve> You could also verify the string is in the seq, yet the lengths are the same when you deduplicate |
19:22:50 | FromGitter | <mratsim> wow the manual takes so long to load on github |
19:23:52 | FromGitter | <timotheecour> what was this line supposed to do in older .travis.yml? ⏎ `- ( ! grep -F '..code-block' -l -r --include '*.html' --exclude contributing.html --exclude docgen.html --exclude tut2.html )` |
19:24:18 | FromGitter | <kaushalmodi> Awesome! Thank you @kayabaNerve and @Quelklef ! |
19:24:49 | FromGitter | <Quelklef> @kaushalmodi go for kayba's solution for speed and mine for terseness |
19:25:44 | * | nsf joined #nim |
19:25:53 | FromGitter | <mratsim> @Quelklef ig you use filterIt it should be as fast as Kayaba's |
19:25:58 | FromGitter | <mratsim> if* |
19:26:13 | FromGitter | <mratsim> ah no, you still need to allcoate the result seq |
19:27:14 | FromGitter | <Quelklef> and then do an attribute lookup |
19:27:22 | FromGitter | <Quelklef> and allocate the literal seq |
19:27:28 | FromGitter | <kayabaNerve> Deduplicate would be worse than Quelklefs. The for loop would be faster. Quelklef's looks the best/shows the most 'mastery'. |
19:27:58 | FromGitter | <kayabaNerve> I think deduplicate would be the same/slightly better actually. Anyways. Use the for loop or Quellie's |
19:35:18 | FromGitter | <Araq> @timotheecour detect illformed code-blocks that RST stupidly parses as commented out sections |
19:36:08 | FromGitter | <timotheecour> o i see, and then you’d use the return code of grep to error in case smthg found, ok |
19:38:41 | * | Perkol quit (Quit: Leaving) |
19:43:19 | * | Some_Person11 joined #nim |
19:43:48 | * | threeFifths joined #nim |
19:44:18 | FromGitter | <kaushalmodi> @Quelklef I just went for succintness for now https://github.com/kaushalmodi/ntodo/commit/461a92cc568d4960c5a68b60de674c993b7e67c3 Thanks! :) |
19:45:09 | * | Some_Person11 quit (Remote host closed the connection) |
19:45:36 | * | threeFifths quit (Remote host closed the connection) |
19:47:56 | * | rockcavera quit (Remote host closed the connection) |
19:48:14 | FromGitter | <Quelklef> yup! |
19:49:40 | FromGitter | <Araq> just as I feared |
19:49:56 | FromGitter | <Araq> with the nimsuggest tests travis is now timing out way more often :-/ |
19:59:15 | * | masterdonx joined #nim |
20:03:31 | FromGitter | <arnetheduck> `ccache`? |
20:12:50 | FromGitter | <mratsim> but you can only ccache the csources basically |
20:13:07 | FromGitter | <arnetheduck> no, all the generated c code as well |
20:13:45 | FromGitter | <arnetheduck> well, not all the generated c code, but lots |
20:21:57 | * | Trustable joined #nim |
20:23:41 | * | rockcavera joined #nim |
20:35:13 | * | Vladar quit (Remote host closed the connection) |
20:39:26 | * | smt joined #nim |
20:41:31 | * | jxy joined #nim |
20:42:22 | * | jxy quit (Client Quit) |
20:43:51 | * | seni quit (Quit: Leaving) |
20:50:27 | * | jxy joined #nim |
20:53:08 | * | jxy quit (Client Quit) |
20:53:42 | * | soahccc joined #nim |
20:54:39 | * | soahccc quit (Remote host closed the connection) |
20:55:34 | * | miran quit (Ping timeout: 240 seconds) |
20:55:48 | * | nsf quit (Quit: WeeChat 2.2) |
20:56:03 | * | jxy joined #nim |
20:58:53 | * | Trustable quit (Remote host closed the connection) |
21:06:04 | * | stoner1910 joined #nim |
21:08:39 | * | stoner1910 quit (Remote host closed the connection) |
21:10:17 | FromGitter | <bung87> does the nimsuggest just response and quite?or as a long running process? |
21:10:52 | FromGitter | <timotheecour> it can be used as a server |
21:12:59 | FromGitter | <bung87> I'm trying to add some patch support more feature https://github.com/bung87/vscode-nim but it always response and quite, runs on emacs epc mode |
21:14:43 | FromGitter | <bung87> add a nim version switch at status bar, works but may needs a long running process for ensure always can send query |
21:15:34 | * | Guest43987 joined #nim |
21:15:39 | FromGitter | <mratsim> the vscode-nim plugin from pragmagic is not using nimsuggest properly, it spawns a process for each nim file instead of reusing the same |
21:17:05 | FromGitter | <bung87> yeah I see that and ```Usage: ⏎ nimsuggest [options] projectfile.nim``` this makes me confusing .. if it as a server why need specify a nim file |
21:18:47 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/s695/Screen-Shot-2018-08-31-at-5.18.02-AM.png) |
21:20:11 | FromGitter | <bung87> but better than before now,I can easily switch nim version now as vscode-python does |
21:23:04 | * | Guest43987 quit (Ping timeout: 246 seconds) |
21:23:27 | FromGitter | <imdaveho> @shashlick your lib for snip, what's the reason you had to rewrite getch and why did you implement it that way? is that the official C implementation from conio? |
21:24:02 | FromGitter | <Araq> there is no `conio` in C's standard the last time I checked. |
21:24:33 | FromGitter | <imdaveho> right but looking around the internet, the implementations for getch differs from the way that shashlick implemented it in his library... |
21:24:44 | FromGitter | <Araq> @bung87 because nimsuggest needs to know the entry point. |
21:25:25 | FromGitter | <imdaveho> I might just try to make a similar implmentation that termbox-go does with nim natively and read from stdout |
21:26:01 | FromGitter | <imdaveho> but I want to know if there is some what to leverage existing work instead of going the route of doing something from scratch |
21:28:58 | FromGitter | <imdaveho> @araq is it on the roadmap to implement mouse detection using this method? https://stackoverflow.com/questions/51909557/mouse-events-in-terminal-emulator ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8861994be56c5918bbd3da] |
21:29:00 | FromGitter | <bung87> @Araq thanks! I checked on command line ,it is long running process. |
21:35:48 | * | submain joined #nim |
21:38:18 | * | submain quit (Remote host closed the connection) |
21:49:42 | * | vivus joined #nim |
21:50:22 | vivus | does anybody use autocomplete with your editor for nim? which editor? |
21:50:53 | * | Maven_ joined #nim |
21:51:50 | FromGitter | <Araq> VSCode |
21:52:02 | * | Maven_ quit (Remote host closed the connection) |
21:52:28 | FromGitter | <Araq> though I generally consider navigation ("goto definition") more useful than completions |
21:52:46 | FromGitter | <Araq> completions always race with my fast typing skills :-) |
22:00:35 | AlexMax | Hrm, is there nice way to take a ptr/len buffer from a wrapped C library and just stuff it into a seq or something? |
22:02:06 | AlexMax | I was hoping that maybe I could copymem it straight into addr myseq[0] or something |
22:02:27 | AlexMax | after ensuring the seq is the correct size, of course |
22:05:42 | * | avelardi22 joined #nim |
22:08:10 | * | avelardi22 quit (Remote host closed the connection) |
22:09:06 | FromGitter | <Araq> the seq owns its data, so not possible |
22:09:27 | FromGitter | <Araq> you can map it to an openArray though via `toOpenArray` (new in devel) |
22:09:45 | AlexMax | Yeah I saw that, but I'm on 0.18 |
22:10:24 | AlexMax | The seq would be of primitive type - floating point numbers. |
22:10:45 | AlexMax | and I would destroy the original buffer once copied. |
22:18:20 | FromGitter | <Araq> none of these things matter, a seq has its own idea of where to get memory |
22:21:35 | * | endragor joined #nim |
22:25:38 | shashlick | @imdaveho: it was a royal pain to get the actual key typed in a cross platform way |
22:25:47 | * | endragor quit (Ping timeout: 240 seconds) |
22:25:57 | krux02 | there is nothing wrong with a seq that is isitialized with a ptr length pair. Actually std::vector in c++ has a constructor for that |
22:26:05 | shashlick | I looked at all implementations and it's all a mess |
22:26:38 | shashlick | I wanted to avoid ncurses but I was still cursing |
22:27:22 | shashlick | Since I was working on a console editor, I needed actual key combo typed |
22:28:32 | krux02 | shashlick what kind of editor? |
22:28:35 | krux02 | text editor |
22:28:46 | krux02 | ? |
22:29:55 | FromGitter | <Araq> krux02: the std::vector copies the ptr's contents, iirc |
22:30:59 | krux02 | Araq: yes |
22:31:06 | krux02 | but that was what was asked for |
22:32:22 | FromGitter | <imdaveho> @shashlick yeah I see that, I also need the key combo, but also wanted mouse support... so the implementation of getch you made is not the same as the implementation in conio, rather written that way so it could get the key in an cross plat way? well for the time being, ill use your implementation... |
22:32:54 | vivus | @Araq ty |
22:37:46 | * | steven9 joined #nim |
22:40:17 | * | steven9 quit (Remote host closed the connection) |
22:48:10 | * | SenasOzys quit (Remote host closed the connection) |
22:48:41 | * | SenasOzys joined #nim |
23:05:51 | * | SenasOzys quit (Remote host closed the connection) |
23:07:43 | * | gangstacat quit (Quit: Ĝis!) |
23:09:29 | * | SenasOzys joined #nim |
23:11:50 | * | gangstacat joined #nim |
23:12:27 | * | gangstacat quit (Client Quit) |
23:12:41 | * | xet7 quit (Quit: Leaving) |
23:13:51 | * | gangstacat joined #nim |
23:17:08 | * | Jesin quit (Quit: Leaving) |
23:17:58 | shashlick | krux02: yep nim snippet editor https://github.com/genotrance/snip |
23:18:48 | shashlick | @imdaveho : it's not cross platform, conio on windows, custom C code in Linux |
23:19:22 | * | zachcarter joined #nim |
23:34:15 | krux02 | shashlick, are you writing snippet as a learning project? |
23:34:38 | krux02 | Because I don't think it is very useful for anyone. Not even for you. |
23:34:52 | krux02 | There are enough text editors out there, ever light weight text editors |
23:35:06 | krux02 | there is no need to write a custom text editor just for "snippets" whatever that is. |
23:35:14 | AlexMax | man, mutually recursive data structures are horrible |
23:36:20 | krux02 | AlexMax, you mean graphs? |
23:36:22 | vivus | is anybody using nim.vim ? |
23:36:53 | krux02 | sorry I am an emacs guy |
23:37:38 | krux02 | but don't assume the grass is green over here. |
23:37:49 | krux02 | nim-mode in emacs is poor quality |
23:38:04 | krux02 | I just don't have the competence in emacs yet to replace it. |
23:41:27 | AlexMax | krux02: I've got four types of objects |
23:41:42 | AlexMax | and the objects need to be accessible top down _and_ bottom up |
23:42:47 | AlexMax | https://paste.ee/p/us2ed |
23:43:13 | AlexMax | Right now I have pointers going one way, but I think I need pointers going both ways |
23:43:58 | AlexMax | And many of these relationships are one-to-many |
23:44:11 | * | rdococ18 joined #nim |
23:45:56 | * | rdococ18 quit (Remote host closed the connection) |
23:51:39 | * | Jesin joined #nim |
23:55:00 | shashlick | krux02: I'll encourage you to try it out, it's good for simple tests, works for me |
23:55:17 | shashlick | No reason to compete with established editors |