<< 18-09-2017 >>

00:08:18*endragor joined #nim
00:13:27*endragor quit (Ping timeout: 260 seconds)
00:15:47*jsgrant joined #nim
00:20:09*nattefrost quit (Remote host closed the connection)
00:38:54FromGitter<mratsim> for some not having to worry about type is a feature
00:39:26FromGitter<mratsim> then you get Python division "bug" when using integers
00:41:11FromGitter<zacharycarter> hrm I need a hash set where I can have an mitems iterator or a sequence where I can delete by object, or something similar to that
00:41:22FromGitter<zacharycarter> trying to implement a graph for my dungeon generator
00:49:08*endragor joined #nim
00:51:44FromGitter<zacharycarter> @Varriount any idea?
00:53:04FromGitter<Varriount> @zacharycarter Is there a reason you can't use the tables module?
00:53:21*endragor quit (Ping timeout: 248 seconds)
00:53:29FromGitter<zacharycarter> hrm I guess a table could work
00:53:56FromGitter<zacharycarter> not sure what I'd store as the value in this case
01:00:58FromGitter<Varriount> Or do you mean you need a set?
01:01:13FromGitter<Varriount> There's a sets module
01:02:52FromGitter<zacharycarter> yeah but I need a set where I can also like pop the first element off or retrieve an element by index
01:03:50FromGitter<zacharycarter> I guess that's not a thing
01:06:27FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bf1c12210ac2692043a0e4]
01:06:57FromGitter<zacharycarter> https://play.nim-lang.org/?gist=7f1cf643e4be2608cf87b0afb0411e7e better yet
01:08:37FromGitter<zacharycarter> neighbors could be a seq for all I care
01:08:48FromGitter<zacharycarter> if I could remove objects from a seq by the object
01:08:58FromGitter<zacharycarter> instead of by index
01:09:41*Sembei joined #nim
01:12:12FromGitter<zacharycarter> I guess this works - https://play.nim-lang.org/?gist=5648836f3c80b2ec33ffaf05b88cb8de
01:16:35*endragor joined #nim
01:22:03FromGitter<edubart> @Varriount is the stable NimLime autocompletion supposed to work with the latest sublime text 3 (build 3144)?
01:23:02FromGitter<Varriount> @edubart I last tested it a long time ago, on a modified version of nimsuggest
01:23:52FromGitter<Varriount> It probably needs to be modified to work with the current nimsuggest
01:24:10FromGitter<edubart> you aren't maintaining it anymore? are your using something else to have nim autocompletion?
01:24:33FromGitter<Varriount> Yes, the built-in autocomplete
01:25:13FromGitter<Varriount> I would maintain, if I had the time.
01:25:41FromGitter<Varriount> As it is, I put out a request on the forum for someone else to help - the code isn't that complex
01:25:51FromGitter<Varriount> No one volunteered though
01:26:37*endragor quit (Read error: Connection reset by peer)
01:27:18*endragor joined #nim
01:27:28*Ven`` joined #nim
01:28:51*MyMind joined #nim
01:28:52*Sembei quit (Ping timeout: 240 seconds)
01:33:11FromGitter<Varriount> @edubart 'Fixing' Nimsuggest integration is not a quick fix.
01:34:08FromGitter<Varriount> Currently, the stdout and tcp protocols for NimLime only accept one 'command', then close the connection/quit. So you either face having to start a process rapidly as someone types, or make a TCP connection.
01:34:38FromGitter<Varriount> The only sane protocol it has is the epc protocol.
01:36:33*Ven`` quit (Ping timeout: 248 seconds)
01:38:00FromGitter<edubart> =(
01:39:32FromGitter<Varriount> Wait, that's slightly inaccurate.
01:40:06FromGitter<Varriount> stdin mode is for interactive use, and displays formatting that makes it hard to parse, tcp quits after one command
01:42:04FromGitter<edubart> Auto completion for Nim didn't work in Sublime Text, neither Visual Studio Code, neither Atom for me and all plugins in each editor claimed to have autocompletion
01:43:50*yglukhov joined #nim
01:47:29FromGitter<Varriount> @edubart I love Nim as a language, but there are many things in the codebase that annoy me. Nimsuggest is one of them.
01:47:52*yglukhov quit (Ping timeout: 240 seconds)
01:50:18FromGitter<Varriount> Documentation is another. My greatest fear for this project is that Araq gets hit by a bus. If that happens, there won't be anyone who understands the compiler code.
01:58:44FromGitter<Varriount> @zacharycarter Found a solution yet?
01:58:51*chemist69 quit (Ping timeout: 252 seconds)
02:00:29FromGitter<edubart> Indeed, I feel in a similar way, there are great things in the language, but every now and then you encounter something that annoys
02:01:40FromGitter<zacharycarter> I think so varriount
02:02:04*ipjk_ joined #nim
02:04:41*ipjk quit (Ping timeout: 240 seconds)
02:12:42*chemist69 joined #nim
02:17:48FromGitter<zacharycarter> @Varriount have you seen my spaceship maps?
02:33:42*relax joined #nim
02:34:39*shashlick quit (Ping timeout: 248 seconds)
02:44:02*pilne quit (Quit: Quitting!)
02:47:35*shashlick joined #nim
02:52:51*dddddd quit (Remote host closed the connection)
02:54:11FromGitter<Varriount> @zacharycarter Yes, they are quite interesting
03:00:03*Serenit0r joined #nim
03:03:21*Serenitor quit (Ping timeout: 240 seconds)
03:04:29*mahmudov joined #nim
03:06:21FromGitter<superfunc> @Varriount I'd be interested in maintaining nimlime
03:23:36*rauss joined #nim
03:31:59shashlickwhat happens if you return from a function that's executing a bunch of spawns before they are done?
03:32:39shashlickusing flowvars to track the return values that is
03:37:42FromGitter<zacharycarter> why doesn't this work? https://play.nim-lang.org/?gist=991e0d777a5e96d0628e90bb6e911e7e
04:06:09*Serenit0r quit (Quit: Leaving)
04:20:17FromGitter<superfunc> @zacharycarter might be this: https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax
04:20:23FromGitter<superfunc> @zacharycarter this works: https://play.nim-lang.org/?gist=0158db261ed1564357f0bbb732f04036
04:22:24nohusurohow do I pass a NULL to a c function that's expecting a const char *? The nim library specifies it as a cstring
04:31:01FromGitter<zacharycarter> thanks @superfunc
04:31:04FromGitter<zacharycarter> man concepts are weird
04:31:26FromGitter<zacharycarter> I think I understand them, then I try to change one thing about them and I blow them up entirely
04:43:34*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:45:11*Tanger joined #nim
04:46:00TangerHey guys! Does anybody have an idea on how to pass a null value through the FFI?
04:46:07Tangerie http://termbin.com/pc7d
04:50:07*relax quit (Ping timeout: 248 seconds)
04:52:30nohusurohah Tanger , I also asked this
05:00:33*shashlick quit (Ping timeout: 246 seconds)
05:19:14*Vladar joined #nim
05:25:57nohusurogot it working, forgot to call SSL_init method
05:50:33*solitudesf joined #nim
05:51:10*renarc joined #nim
05:57:37*BigEpsilon joined #nim
06:04:02*couven92 joined #nim
06:12:31*rauss quit (Quit: WeeChat 1.9)
06:14:06*PMunch joined #nim
06:23:16FromGitter<superfunc> nohusuro, was the answer to pass nil?
06:38:40*nsf joined #nim
06:49:47*gokr joined #nim
07:14:19nohusurosuperfunc, yeah, nil worked just fine, but I was previously getting an error even when doing that because I didn't SSL_init
07:14:49nohusuroturns out, that after all that work I did, the SSL stuff exported by nim doesn't verify the hostname in the subject alternate names anyway
07:15:02nohusuroso I'm gonna have to write a function for that
07:15:07*LargeEpsilon joined #nim
07:17:21*BigEpsilon quit (Ping timeout: 240 seconds)
07:22:25*skrylar joined #nim
07:23:05*claudiuinberlin joined #nim
07:24:30*madmalik joined #nim
07:29:41*yglukhov joined #nim
07:31:37*LargeEpsilon quit (Quit: Leaving)
07:37:34gokrDid some propaganda: https://www.quora.com/What-is-your-review-of-Nim-programming-language/answer/G%C3%B6ran-Krampe
07:37:36gokr:)
07:40:46*Arrrr joined #nim
07:40:46*Arrrr quit (Changing host)
07:40:46*Arrrr joined #nim
07:45:04FromGitter<Varriount> @superfunc Thanks. If you have any questions about the code, feel free to ask
07:46:09FromGitter<Varriount> The settings system and the send_self decorator are probably the most complex pieces.
07:47:32FromGitter<Varriount> However I believe send_self is documented. The settings system probably needs to be rewritten to be simpler, but it works for the most part.
07:50:50*Pisuke joined #nim
07:52:33*MyMind quit (Ping timeout: 248 seconds)
07:56:02*Pisuke quit (Ping timeout: 260 seconds)
08:01:46skrylarbloop.
08:14:24*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:14:39*nattefrost joined #nim
08:17:27*claudiuinberlin joined #nim
08:21:19*PMunch quit (Ping timeout: 248 seconds)
08:25:01*PMunch joined #nim
08:37:31*Pisuke joined #nim
08:37:35*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:39:02*claudiuinberlin joined #nim
08:42:29*Yardanico joined #nim
08:44:43FromGitter<superfunc> nohusuro, thanks, I was just curious since I haven't really interacted with the ffi stuff at all yet
08:45:37FromGitter<superfunc> @Varriount Cool, i'll give it a full read this upcoming weekend and ping you
08:49:17Yardanicogokr, upvoted
08:49:30Yardanicoquora is a nice website
08:49:33gokr:)
08:49:37Yardanicobut not always :)
08:49:42FromGitter<superfunc> Sometimes haha
08:50:08gokrTwo people actually requested an answer from me, you can evidently do that somehow.
08:50:44Yardanicoyeah, you can
08:50:59*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:51:20Yardanicoyou can request an answer from anyone, but it's completely optional (e.g. you're not forced to answer it)
08:51:50FromGitter<ghego> hey guys, I'm very new to nim and I have a question. I'm trying to use this program to extract text from wikipedia: https://github.com/rspeer/wiki2text and it's written in nim. The question I have is: what is the encoding that nim uses to save the text in output? I thought it was utf-8 but when I try to read the output with utf-8 encoding I get an error at some point. Any ideas?
08:52:16Yardanicostrings is just a sequence of bytes :)
08:52:46FromGitter<superfunc> There is a separate type for unicode, but the default string is just bytes
08:52:47Araqghego: are you on windows?
08:53:34YardanicoAraq, I think this code is written with only ascii in mind
08:53:44Yardanicoe.g. slices like text[pos .. <found] where "text" is just string
08:53:49*claudiuinberlin joined #nim
08:54:07Yardanicoor no
08:54:22Yardanicook, I'll try myself
08:54:35YardanicoI have a pretty fast internet on my VPS (~50-100 megabytes/sec)
08:56:47FromGitter<ephja> almost 4k stars on github
08:56:59Yardanicoohhh
08:57:05Yardanicowell actually
08:57:13Yardanicoyesterday it was 3984
08:57:16Yardanicotoday it's 3983 lol
08:57:35FromGitter<superfunc> im compiling my work project right now(c++) and its so depressing compared to my personal nim stuff. it takes 40 minutes to build on my machine :(
08:57:39FromGitter<ephja> oh no
08:58:07FromGitter<superfunc> It has all of the usual suspects, unnecessary includes, boost usage, and hella templates
08:59:07*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:59:21Yardanicoehh, wikipedia dumps are slow to download :( only 6 megabytes/sec
09:00:17FromGitter<ephja> man, that sucks
09:00:53Yardanicowell probably it's very costly for them to host these dumps
09:01:19FromGitter<superfunc> and nobody ever clicks on the link with the wikipedia guys face to give them money
09:01:26Yardanicooh wait, there's a mirror
09:02:10Yardanicoyay
09:02:17Yardanico130 mb/sec
09:02:21Yardanicolol
09:02:36Yardanicoah, no, I'm wrong :P
09:03:07FromGitter<ghego> @Araq no, I'm on linux (CentOS)
09:03:44*claudiuinberlin joined #nim
09:04:25FromGitter<ephja> @superfunc they should hire a hot chick and put her face there instead
09:04:43FromGitter<superfunc> I feel like I still wouldn't click
09:04:45FromGitter<ephja> @Varriount doesn't zah know the codebase well by now?
09:06:59Yardanicoalso, again, about backwards compat: https://github.com/rspeer/wiki2text was written using nim 0.11
09:07:06Yardanicoand it just works noqw
09:07:47FromGitter<superfunc> I left my first nim package, written against 11 or so, came back and rebuilt on 16 and it just worked, was cool
09:07:56Yardanicoghego, Araq : can confirm that wiki2text extracts unicode text just fine
09:07:59Yardanicotested on russian wiki
09:12:02FromGitter<ghego> @Yardanico did you test it on the whole en wikipedia dump? I thought so too, but when I load the output in python I get an error at some point
09:12:15Yardanicowhat error?
09:12:56FromGitter<ghego> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bf8e18bc4647297449e198]
09:13:33FromGitter<Yardanico> can you post the text which triggered this error?
09:13:46FromGitter<Yardanico> it can be that wiki has invalid unicode chars itself :P
09:14:42FromGitter<ephja> is the unicode support as bad in 2.7?
09:14:58Yardanicoalso, ghego, you may also want to just ignore unicode errors
09:15:00FromGitter<ghego> yes. I don't know yet which line generated itself because my script didn't catch the error (and since it's python it's very slow and the error occurred after 10 hours of running just fine :) ) I will modify the script to catch the exception and re-run
09:15:07YardanicoAFAIK python unicode allows that
09:15:10Yardanicojust ignore errors
09:15:59FromGitter<ghego> thank you all for the suggestions. I will post the line later if I catch it
09:16:20Yardanicowell I mean you can decode utf8 with ignoring errors in it
09:16:26Yardanicopython allows that
09:21:49Yardanicolol, https://github.com/alehander42/breeze
09:22:07*renarc quit (Ping timeout: 248 seconds)
09:22:16Yardanicomacro dsl to ease writing of macros :P
09:24:03FromGitter<ghego> @Yardanico yep, that's exactly what I'll do now
09:24:08FromGitter<ghego> th
09:24:09FromGitter<ghego> x
09:25:55AraqYardanico: awesome! I love breeze
09:26:02Yardanicoyeah
09:26:49YardanicoAraq, so we'll have easier-to-write macros in the future? :)
09:26:54Yardanicobased on karax or breeze?
09:27:31Araqkarax includes a DSL for DOM construction
09:27:45Araqbreeze does the same for NimNode construction
09:27:56Yardanicoand it's less than 100 loc !
09:30:01FromGitter<Grabli66> Hi. I dont understand. Is Nim object oriented language, or module oriented, or component oriented, or maybe functional language? I dont understand what to choose. :)
09:30:22Araqyeah but it does it wrong a bit :-) it needs to copy karax more, karax interacts well with Nim's control flow constructs
09:31:01YardanicoGrabli66: multi-paradigm
09:31:32Araqgrabli66: Nim is a meta programming based on an imperative/procedural core with some support for OO and FP added.
09:32:01Araqbut the focus is (and always was) proc+meta
09:33:57*renarc joined #nim
09:38:20*dddddd joined #nim
09:39:15gokrHa, insanity full circle: https://github.com/alehander42/miv
09:40:14gokrJust kidding of course, we use Electron for Evothings Studio, but... its still an insane thing.
09:40:15Yardanicohttps://github.com/PMunch/nim-electron
09:40:30Yardanicowell yeah
09:40:38Yardanicoit would make much more sense to use C++ side of electron with nim
09:41:13skrylarelectron because every app needs to be its own 200mb chrome install
09:41:40Yardanicotrue
09:41:56Yardanicobut open-source apps can benefit from electron in package managers
09:42:00gokrI am quite torn by the whole electron thing. Exactly. It's kinda weird that we invent this whole layer so that desktop apps can be written using web tech.
09:42:14FromGitter<superfunc> electron makes me sad
09:42:26Yardanicolol
09:42:35Yardanicoimagine developers will use web assembly in electron
09:42:41Yardanicoweird
09:42:46gokrIt is somehow the singularity of what has been going on since late 1990s.
09:43:27gokrThe browser eating up the OSes, turning into a cross platform OS itself.
09:43:55Araqthe problem is that desktop APIs suck and are mostly highly OS specific
09:44:32Araqplus haven't caught up with the layouting features of HTML/CSS
09:46:20euantorI wouldn't mind Electron if it didn't mean a whole Chrome instance per app - imagine if you could use HTML/CSS/JS but the rendering and stuff was done by the OS
09:46:22skrylari blame electron on the lack of choice in GUI frameworks
09:46:35skrylarand that gui frameworks tend to give you a handful of widgets and then abandon you when you need a custom one
09:46:48skrylari mean they're all deep heirarchy premade stuff, they're not compositional like Self/Morphic
09:47:22skrylarso you need a custom widget, as everyone does, have fun learning how to do all the font and layout crap yourself 'cause all the nice layout stuff your gui lib might have had doesn't have a generic version you can use for your own stuff
09:47:45skrylarelectron at least gives you the layout stuff from css/html when you need to do something weird
09:49:04gokryeah. WebOS (web tech in the OS itself) was a bit fun, but went the way of the Dodo. Now in TVs :) FirefoxOS cancelled. Are there any other OS attempt around that integrates web tech as main UI model?
09:50:18gokrThe "problem" of course with web tech - is that you will have basically zero streamlining. Your OS will end up feeling like a hodge podge I guess.
09:57:07federico3gokr: and it has been a mess since the very beginning
10:05:35PMunchYardanico, can you use Electron with only C++
10:08:41Araqany "protocol" experts around? I'm writing some websocket server and I would like "reply to client" vs "broadcast this message to all clients"
10:08:57FromGitter<ephja> trying to fix an overloading bug. this will be fun
10:11:58couven92Araq, I have experimented further with the debug info in VCC (https://github.com/nim-lang/Nim/pull/6397) and by using `/Z7` we get parallel compilation **WITH** full debug info
10:12:19*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:12:23Yardanico Araq oh, it seems this isn't the easiest task https://stackoverflow.com/questions/16280747/sending-message-to-a-specific-connected-users-using-websocket
10:13:49Yardanicocouven92, yay
10:14:01euantorWebSockets are a mess. I've looked at them in C# in the past and gave up
10:14:02Yardanicobut I'm afraid you would need to check if this works with older VCCs
10:16:52couven92Yardanico, this is a REALLY old feature that pre-dates PDB file generation, so this will work on older VCCs as well
10:20:41*claudiuinberlin joined #nim
10:27:35*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:27:48Araqeuantor: uh, can you elaborate?
10:28:27euantorThe C# libraries for desktop apps are extremely limited
10:28:52euantorI was also trying to send a message to a single client, but none of them at the time would let you do that - broadcast was the only option
10:29:03couven92euantor, WPF is pretty advanced though?
10:29:09euantorYeah, it is
10:29:30euantorThere's also SignalR that achieves similar things
10:30:08euantorBut I couldn't find any way to get that working in a desktop app rather than an ASP web site
10:30:14euantorOr no easy way at least
10:30:51*claudiuinberlin joined #nim
10:31:51euantorThe project I was working on was fairly unique though as it involved sending binary data from a web page (audio capture from JS) to a backend server to save the audio and transmit it to another machine over TCP. In the end I had a node.js server with a websocket server that received the audio then streamed it to my .net app
10:35:33*claudiuinberlin quit (Client Quit)
10:36:49*claudiuinberlin joined #nim
10:37:40*dyce[m] quit (Ping timeout: 240 seconds)
10:40:32*abeaumont quit (Ping timeout: 260 seconds)
10:40:54*dyce[m] joined #nim
10:40:57*abeaumont joined #nim
10:40:58*claudiuinberlin quit (Client Quit)
10:53:18federico3euantor: why websockets tho? You can stream binary data over HTTP
10:58:57euantorIt was the easiest way to do what I needed to do in the 2 days I had to get it working ;)
11:03:31FromGitter<Grabli66> What's the problem with websockets? It's pretty easy to use them. :)
11:07:05*nsf quit (Quit: WeeChat 1.9)
11:10:44FromGitter<Bennyelg> @Araq why Karax has almost no documentation?
11:10:53FromGitter<Bennyelg> Its under creation?
11:11:41Araqyeah
11:12:10FromGitter<Bennyelg> @Araq The only thing I can say now, is this: Its look very very promising
11:18:48YardanicoAraq, is there a way to make this work? https://gist.github.com/Yardanico/83cd162750bee375289dd25fbc3c1c99
11:19:06Yardanicoit works with a seq, but not with array
11:27:47AraqYardanico: it should
11:28:25YardanicoAraq, i've also tried to do it with an array
11:28:36Yardanico*template
11:31:26*Yardanico quit (Remote host closed the connection)
11:33:53*Yardanico joined #nim
11:34:03*Yardanico quit (Remote host closed the connection)
11:34:21*PMunch quit (Ping timeout: 240 seconds)
11:35:03*PMunch joined #nim
11:38:20*Snircle joined #nim
11:38:21*arnetheduck joined #nim
11:43:52*Arrrr1 joined #nim
11:43:52*Arrrr quit (Disconnected by services)
11:49:20*claudiuinberlin joined #nim
11:52:17*ShalokShalom_ joined #nim
11:54:13*nsf joined #nim
11:54:52*ShalokShalom quit (Ping timeout: 240 seconds)
11:54:54*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:01:50*claudiuinberlin joined #nim
12:03:47*claudiuinberlin quit (Client Quit)
12:07:35*claudiuinberlin joined #nim
12:12:03*nsf quit (Quit: WeeChat 1.9)
12:18:26*BitPuffin|osx joined #nim
12:31:22*Arrrr1 quit (Quit: Leaving.)
12:36:11*salewski joined #nim
12:37:16salewskiAraq, can you give us a hint for https://github.com/StefanSalewski/gintro/issues/15#issuecomment-330186450
12:37:24salewski(last post)
12:37:46*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:38:18salewskiI have the feeling that for a C library call that notation with = nil works.
12:38:51salewskiBut for a call of a Nim proc not.
12:39:03*relax joined #nim
12:39:31salewskiWould be very convenient when we can use one single proc to pass object or nil.
12:39:40Araqsalewski: I cannot follow you
12:40:01Araqbut (T | ptr T) is not a type that accepts 'nil'
12:40:06Araqit's an "OR" type
12:42:06*pwntus joined #nim
12:42:31*pwntus quit (Changing host)
12:42:31*pwntus joined #nim
12:42:34*claudiuinberlin joined #nim
12:46:11salewskiOK, then I have to provide that procs twice...
12:46:29salewskiproc iterNChildren*(self: TreeModel; iter: TreeIter): int = discard
12:46:31salewskiand
12:46:42*skrylar quit (Remote host closed the connection)
12:46:52salewskiproc iterNChildren*(self: TreeModel; iter: ptr TreeIter = nil): int = discard
12:50:05salewskiJust to be sure, there is no notation for the case that one parameter can be an object
12:50:25salewskion the stack passed by ref, or that it can be nil?
12:51:31FromGitter<zacharycarter> hrm I have a section of code when I move inside a parallel block it segfaults
12:51:46FromGitter<zacharycarter> when I run it sequentially it's fine
12:52:18salewskiThe use case is passing simple object to GTK, for example an color struct with 3 rgb color, or nil for default.
12:57:47FromGitter<zacharycarter> here's the code
12:58:28FromGitter<zacharycarter> https://play.nim-lang.org/?gist=4afe30d15186f66a123e03fd4edbdd29
12:58:34FromGitter<zacharycarter> it blows up in the first parallel block
12:59:43*ShalokShalom_ is now known as ShalokShalom
13:00:48Araqsalewski: no there is no such notion, I'm afraid
13:01:10Araqbut I'm thinking about adding 'Option' as a first class type to Nim and then we could support that too
13:04:00salewskiOK, thanks. I just tried to reread about the exact definition of | OR type, its not easy to find in manual...
13:04:09salewskiHave not yet found it.
13:05:36FromGitter<zacharycarter> finally got a stacktrace
13:05:45FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bfc4a87b7d98d30d0d0155]
13:06:30FromGitter<zacharycarter> anyone have any ideas?
13:11:39FromGitter<zacharycarter> I tried sticking a lock on stepSets thinking maybe two threads were trying to resize the sequence at the same time or something
13:11:42FromGitter<zacharycarter> but that didn't fix it :/
13:14:01*relax quit (Ping timeout: 255 seconds)
13:14:09*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:14:14*Yardanico joined #nim
13:15:23Araqsalewski: yeah, it needs to be documented, that feature grew into existance, it started as a system.nim specific extension for generics
13:15:25*renarc quit (Remote host closed the connection)
13:15:34Araqto make certain magics easier to handle
13:23:23Yardanicoso "int | string" would result in an implicit generic parameters?
13:23:40Araqyes
13:24:08Araqzacharycarter: crash aside ^spawn misses the point :-)
13:24:30Araqthat spawns and waits for the result to come back, no parallelization whatsoever
13:25:10FromGitter<zacharycarter> oh
13:25:36FromGitter<zacharycarter> hopefully my example is clear enough as to what I"m tryin gto do
13:25:53FromGitter<zacharycarter> i'd like to run the A* operations in parallel and collect their results
13:26:11FromGitter<Yardanico> spawn threads and wait for all results?
13:26:39FromGitter<zacharycarter> so just get rid of parallel then and use spawn?
13:28:48FromGitter<zacharycarter> if someone could provide me with a trivial example I'd be much appreciative
13:33:42*rauss joined #nim
13:36:34PMunchReleased the Game Jam game that I created with Nim by the way: https://pmunch.itch.io/hold-the-line
13:37:04FromGitter<Yardanico> probably this isn't the best way, but still: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bfcc001081499f1f476cad]
13:37:17dom96PMunch: needs a Mac OS X version :)
13:37:36PMunchI unfortunatuly don't have a Mac, so I can't build a version for it :(
13:37:38Yardanicoit's open-source IIRC
13:37:44YardanicoPMunch's game
13:37:55PMunchOr I could possibly build a version for it, but I wouldn't have any way to test if it actually worked
13:38:15Yardanicoyay, works for me
13:38:16PMunchOh yeah, the source is on GitHub, but it's missing a couple patches ATM.
13:38:25Yardanicoon antergos (basically arch linux)
13:38:46PMunchThe game? I built in on Manjaro, so no surprise that it works on Antergos :)
13:38:49FromGitter<zacharycarter> thanks Yardanico
13:39:12*salewski quit (Quit: WeeChat 1.9)
13:39:53YardanicoPMunch, so executable itself is just 750kb on linux?
13:40:00PMunchYup
13:40:18PMunchMost of the size is the uncompressed audio clips :P
13:41:00PMunchYardanico, on Linux you install SDL from your software manager, so no need to ship all the DLLs like on Windows.
13:41:06YardanicoPMunch, yeah, I know
13:41:40PMunchHmm, not even sure if that is compiled with -d:release when I think about it
13:41:45Yardanico:D
13:41:50FromGitter<zacharycarter> thank you Yardanico w/ your changes I came up with this and it works
13:42:05FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bfcd2d7b7d98d30d0d365b]
13:42:35FromGitter<Yardanico> well it may be not the best way :)
13:43:10YardanicoI've never wrote any reall app which uses threads/spawn in nim
13:43:12Yardanicoonly async
13:43:45FromGitter<zacharycarter> https://imgur.com/a/Pxb8B
13:43:57FromGitter<zacharycarter> well it seems fast and ships have hallways now so we're good :P
13:44:19*relax joined #nim
13:45:53*vivus joined #nim
13:50:32FromGitter<zacharycarter> parallel doesn't seem to make it any faster
13:50:37FromGitter<zacharycarter> I guess I'll just stick with spawn
13:51:02Yardanicoyeah, you don't need parallel for spawn
13:52:29*adam_ is now known as adam12
13:55:41FromGitter<zacharycarter> I'm going to end up generating lock and key puzzles for these dungeons
13:55:55FromGitter<ephja> speaking of default values for type class arguments, should this work? https://github.com/nim-lang/Nim/issues/1201
13:56:00FromGitter<zacharycarter> the spaceship ones anyway
13:56:14PMunchAre you creating a text based game in Nim zachary?
13:56:31FromGitter<zacharycarter> No this is just a library for various map generation algorithms
13:56:40PMunchAah
13:56:42FromGitter<zacharycarter> I'll eventually use zengine to render sprites for these maps
13:56:44FromGitter<ephja> maybe as long as there's no ambiguity. T|ptr T is ambiguous, right?
13:58:12FromGitter<ephja> regarding first class option types: T|void could be used instead in some cases, if only there was a 'void' singleton
14:06:01*endragor quit (Remote host closed the connection)
14:06:39FromGitter<ephja> ```code paste, see link``` ⏎ ⏎ won't this work anymore? maybe the macro should expect 'case' statements to be present then [https://gitter.im/nim-lang/Nim?at=59bfd2ef177fb9fe7ed6dcd6]
14:07:54*couven92 quit (Quit: Client disconnecting)
14:08:07*endragor joined #nim
14:11:49*shashlick joined #nim
14:12:21*endragor quit (Ping timeout: 240 seconds)
14:13:15*claudiuinberlin joined #nim
14:14:25*PMunch quit (Quit: Leaving)
14:15:30*nattefrost quit (Remote host closed the connection)
14:18:54*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:23:50*salewski joined #nim
14:25:07salewskithanks ephja for the term "type class arguments" and the link to the old issue.
14:26:25salewskiSo it is and old, known problem. I just tried a very strange construct to get the default nil pointer value:
14:26:35salewskiproc iterNChildren*(self: TreeModel; iter: TreeIter = cast[ptr TreeIter](nil)[]): int =
14:27:49salewskiI have some hope that it may indeed work. So I could avoid providing an additional overloaded proc with default nil pointer.
14:28:45Yardanicomaybe you can make a pragma which will do what you want? or they can't modify proc declaration?
14:30:11salewskiHave never make my own pragmas yet. Was not even aware that we can make pragmas.
14:30:40Yardanicooh wait
14:30:44Yardanicoit seems you actually can
14:30:44Yardanicohmm
14:31:50Yardanicolol
14:32:13Yardanicosalewski, https://gist.github.com/Yardanico/22bc1ae0c253db8a140171a33a8076a5
14:32:31Yardanicowell normally you would copy entire tree and iterate over all parameters, but it's just a quick example :)
14:33:22Yardanicobtw, why async doesn't do that?
14:33:32Yardanicochanging return type from T to Future[T] automatically
14:34:18Araqit does?
14:34:27YardanicoAraq, it doesn't
14:34:42Yardanicolib/pure/asyncmacro.nim(301, 10) Error: Expected return type of 'Future' got '
14:34:52Yardanicolib/pure/asyncmacro.nim(301, 10) Error: Expected return type of 'Future' got 'int'
14:35:04Yardanicohttps://gist.github.com/Yardanico/5b4eae59bc129065a13de312cf444929
14:35:45YardanicoI just didn't knew that you can modify proc definition with pragma
14:36:19Araqwell it's really simple: If we do something then it's because Nim is awesome and avoids boilerplate everywhere. If we don't then it's because we value readability and explicitness over clever code.
14:36:56YardanicoAraq, so it should be as it is now ?
14:38:08dom96yes
14:38:35Araqer ... I was kidding.
14:38:42Araqnot obvious?
14:38:55Yardanicowell developers would still see that this is an {.async.} proc
14:38:56*claudiuinberlin joined #nim
14:39:23*couven92 joined #nim
14:40:14dom96It's a nice hint for developers to see the real return type.
14:40:30Yardanicomaybe allow both ? :)
14:40:32dom96And I'm going to pull out the ultimate defense: other languages do it the same way.
14:40:38dom96Er no.
14:40:43dom96That's even more confusing.
14:41:12*salewski quit (Quit: WeeChat 1.9)
14:41:45couven92dom96, shouldn't we actually have #nim-nologs in the TOPIC here?
14:42:08shashlickwhy does Nim default to fastcall? When interop'ing with C, I end up having to use cdecl or stdcall or end up running into issues. I'm on Windows. https://stackoverflow.com/questions/5479362/why-is-fastcall-slower-than-stdcall
14:42:32dom96couven92: Nobody reads the topic anyway, but sure :)
14:42:45Yardanicoshashlick, because it can be faster ? :)
14:42:58Yardanicohttps://nim-lang.org/docs/manual.html#types-procedural-type
14:43:12shashlickYardanico: per the stackoverflow, that's not really true, though I'm very far from an expert on that
14:43:23couven92dom96, appearently **I** read the topic... :P
14:43:45*couven92 feels stupid for actually reading the topic of the channels he's joined in
14:44:10vivusdom96: hello mate
14:45:03FromGitter<ephja> Yardanico: I'm not an expert, but I know that it's definitely faster than slowcall
14:45:36Araqshashlick: because it's good style? we can switch to __vectorcall internally this way
14:45:49Araqand are not hold back by C's legacies
14:45:57Yardanicoephja yes, exactly ! :D
14:46:45Araqit won't be the last time C with its support for not giving prototypes will pick some mediocre default
14:46:45Yardanicohttps://msdn.microsoft.com/en-us/library/dn375768.aspx
14:46:47FromGitter<ephja> which icc uses when optimizing for AMD processors
14:52:01shashlickAraq: so are you saying that this way, when we interop with C, we have to be explicit?
14:52:18shashlickthat way, in the future if Nim changes, it won't break existing code
14:54:18*mahmudov quit (Remote host closed the connection)
14:54:42*Arrrr joined #nim
14:55:36Araqyes.
14:56:09*Jesin quit (Quit: Leaving)
14:56:12Araqwe like magic but interop with other languages is always explicit, see also the 'exportc' annotation
15:03:53*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:04:24shashlickmakes sense, I think it will help to put some documentation around this - it's the second time I've interop'd and struggled since I wasn't explicit. At least for us lesser folks :)
15:05:32*Jesin joined #nim
15:05:56YardanicoAraq, what are your thoughts about string interpolation in stdlib?
15:07:21AraqYardanico: I have an i18n module but it's for the JS backend
15:07:41Araqwe need to decide if string interpolation is related to i18n or not
15:08:56Yardanicowell I think we *should* have some string interpolation in stdlib
15:09:06Yardanicoeven a simple one :)
15:09:18YardanicoI found 3 different libraries in nim for string interpolation
15:09:35Yardanicostrfmt / richstring from boost / printf-like interpolation implemented in nim
15:09:52Yardanicomaybe there's more
15:11:15yglukhovAraq: how can interpolation be related to i18n?
15:12:00*tax joined #nim
15:12:52Araqyglukhov: how can't it? once you have an interpreted string, you can change it at runtime
15:13:57Araq"x+y is {x+y}" can be rewritten to "x+y is " & $(x+y) but then you can't i18n that
15:14:21Yardanicoso you want to have a library which contains both i18n and string interpolation? :)
15:14:36Araqif you rewrite it to "x+y is $1" % [$(x+y)] instead, i18n remains possible
15:14:55yglukhoverr, interpolation is just a handier printf/sprintf, which doesn't care about i18n except float formatting, no?
15:15:44yglukhovAraq: yep, and your second sample is no longer interpolation. just formatting.
15:16:01Araqwell surely you agree this requires some thoughts?
15:16:36yglukhovdo you think its possible to do anything about it?
15:16:51yglukhovdo you think its worth thinking? =)
15:17:26*Trustable joined #nim
15:18:44Yardanicoyglukhov, string interpolation is generally more readable and can be implemented so it doesn't affect runtime performance
15:18:47*xet7 quit (Ping timeout: 260 seconds)
15:18:58Yardanico(almost doesn't affect runtime performance)
15:19:02Araqsomebody needs to try karax's i18n module and give some feedback
15:19:13yglukhovYardanico: why are you telling me this? =)
15:19:37Araqif it's good enough, we can make it work with string interpolation
15:19:54Araqand then we know how string interpolation needs to work (maybe?)
15:21:17Araqhttps://craiggrummitt.com/2015/02/13/localization-playing-nicely-with-string-interpolation-in-swift/
15:21:43yglukhovAraq: there's one problem with that.
15:22:15yglukhovthe keys in the *.strings are the strings in the code
15:22:31yglukhovwhich is not as efficient as nim could get.
15:23:21yglukhove.g. in our project we're using different keys like $ALERT_BUTTON_OK
15:23:40yglukhovand such interpolation would not cover our case.
15:24:09yglukhovwhile we could go further and turn the keys to string array indexes at compile time.
15:24:23yglukhovso that there's even no need for hash tables.
15:24:39yglukhovand that nim could do, and shine in its compile time glory
15:24:41*gokr quit (Ping timeout: 240 seconds)
15:24:59Araqer ... wtf, where is my i18n.nim?
15:25:05Yardanico:D
15:25:14AraqI mean the real complete one.
15:25:28Yardanicoyou mean no one have implemented it yet?
15:25:45Yardanicohttps://github.com/search?q=i18n+language%3Anim
15:28:55Araqargh, spent a day writing this and its design was good, where is it...
15:29:20*gokr joined #nim
15:29:51YardanicoAraq, search it on your entire HDD ? :)
15:30:28FromGitter<jilee210> ===how to assign the file lines to this set without each line assignment?=== ⏎ ⏎ ===old_lines_set.incl(file1.lines)=== ⏎ ⏎ ===new_lines_set.incl(file2.lines)=== ... [https://gitter.im/nim-lang/Nim?at=59bfe694614889d475127b64]
15:32:22Yardanicohttps://nim-lang.org/docs/sets.html#union ?
15:32:28YardanicoReturns the union of the sets s1 and s2.
15:32:35AraqYardanico: likely it's on some other computer :P
15:32:45Yardanicoah sorry
15:32:48Yardaniconot union
15:32:53Yardanicoyou can use incl
15:33:03Yardanicoproc incl[A](s: var HashSet[A]; other: HashSet[A])
15:33:54FromGitter<jilee210> the loop section taking too long. is there a better way to assign a file.lines to a set. I got syntax errors.
15:34:26FromGitter<Yardanico> yourSet.incl(file.lines) ?
15:34:53FromGitter<Varriount> jilee210: I'm assuming you want to have a unique set of lines in a file?
15:35:19FromGitter<jilee210> yes
15:35:41FromGitter<Varriount> Hm
15:36:31FromGitter<Varriount> Do you have a test file I can work with?
15:36:32Yardanicodo you actually use https://nim-lang.org/docs/sets.html ?
15:36:46Yardanicojilee210
15:37:02Yardanicoif you're trying to use built-in set type - you can't store strings in it
15:37:14FromGitter<jilee210> if paramCount() != 2: ⏎ echo "mydiff file1 file2" ⏎ quit() ⏎ ⏎ let file1 = open(paramStr(1)) # cf. open: file ... [https://gitter.im/nim-lang/Nim?at=59bfe82ac101bc4e3ae097ad]
15:37:32FromGitter<Yardanico> can you please post it using ``` syntax?
15:37:58Yardanicowell doesn't matter
15:38:02AraqYardanico: found it ... :-)
15:38:06YardanicoAraq, yay!
15:38:17Araqyeah we got languages.nim and i18n.nim and they need to move to the stdlib
15:38:31FromGitter<Yardanico> @jilee210 you want to show different lines of two files ?
15:38:33FromGitter<jilee210> sorry I am having a hard time to understand docs, not very familiar with nim. I am trying to recreate mydiff.py to nim
15:38:36*yglukhov quit (Remote host closed the connection)
15:38:47FromGitter<Yardanico> can you link your mydiff.py ?
15:39:05Araqdiffing cannot use unordered sets, can it?
15:39:18*Sentreen quit (Ping timeout: 246 seconds)
15:39:37FromGitter<jilee210> old_lines = file1.read().split('\n') ⏎ new_lines = file2.read().split('\n') ⏎ file1.close() ⏎ file2.close() ⏎ ... [https://gitter.im/nim-lang/Nim?at=59bfe8b9c101bc4e3ae09a37]
15:39:51FromGitter<Yardanico> oh
15:39:56FromGitter<Yardanico> can you post it on gist?
15:40:04FromGitter<Yardanico> but yeah, this is easy to do in nim
15:40:32FromGitter<jilee210> sorry i am not familiar with gist yet
15:41:52FromGitter<jilee210> mydiff.py takes only 4-5 seconds to process 1.8 millon rows files while my version of nim takes 28 seconds. all due to the loop section.
15:42:15FromGitter<jilee210> in python, you simply old_lines_set = set(old_lines) ⏎ new_lines_set = set(new_lines)
15:42:46Yardanicoin nim you do almost the same
15:43:08*couven92 quit (Ping timeout: 240 seconds)
15:43:27FromGitter<jilee210> But this got errors:
15:43:34FromGitter<jilee210> ===old_lines_set.incl(file1.lines)=== ⏎ ⏎ ===new_lines_set.incl(file2.lines)===
15:43:57FromGitter<jilee210> is it because i did this?
15:44:04FromGitter<jilee210> let file1 = open(paramStr(1)) # cf. open: file ⏎ let file2 = open(paramStr(2))
15:44:05Yardanicoyes, there's no such thing "lines"
15:44:32*haha_ joined #nim
15:44:44FromGitter<jilee210> then how do you assign all lines to a set
15:44:59FromGitter<jilee210> 2 million lines fast
15:45:02FromGitter<Varriount> @jilee210 Please use the code syntax (`like this`) using bold notation is annoying.
15:45:28FromGitter<jilee210> ok i was cut/paste
15:45:39FromGitter<Varriount> It's likely because when you diff the sets, the strings are duplicated
15:46:02FromGitter<Varriount> Since in Python, strings are references, but in Nim, strings are values
15:46:42FromGitter<jilee210> so no way to speed up diffing two large files?
15:47:01FromGitter<jilee210> with sets I mean
15:47:13FromGitter<Yardanico> there is, please don't spam :)
15:47:59FromGitter<Yardanico> wait a bit
15:48:51FromGitter<jilee210> thanks for your inputs, I wish faster way to assign a file lines to a set quickly without looping/reading each line to add to a set
15:49:25FromGitter<Varriount> Anyone have a test file I can work with?
15:49:30FromGitter<Varriount> I have a sample program
15:49:35Yardanicoany file?
15:50:37FromGitter<jilee210> a:
15:51:01FromGitter<jilee210> a: new line ⏎ hello joe ⏎ hi dear
15:51:13FromGitter<jilee210> b:
15:51:18FromGitter<jilee210> hi dear ⏎ b: extra line ⏎ hello joe ⏎ b: new line [https://gitter.im/nim-lang/Nim?at=59bfeb751081499f1f483613]
15:51:20FromGitter<Varriount> I need a large file. Small ones will be fast anyway.
15:51:50FromGitter<jilee210> mydiff a b:
15:52:08FromGitter<jilee210> mydiff a b ⏎ ⏎ 1) a: new line ⏎ ⏎ 1) b: extra line ... [https://gitter.im/nim-lang/Nim?at=59bfeba8b59d55b8230fa2ff]
15:52:40*couven92 joined #nim
15:53:02*Sentreen joined #nim
15:53:03FromGitter<Yardanico> This can be rewritten to be much more readable, but it looks like your version in Python:
15:53:10FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bfebe67b7d98d30d0dfa20]
15:53:28*claudiuinberlin joined #nim
15:53:35FromGitter<Yardanico> also, splitLines would handle not only \n, but any newline character
15:54:00FromGitter<Varriount> @Yardanico You might get a speedup if you put the logic in a main() function, and use shallow()
15:54:06FromGitter<Yardanico> @Varriount yeah, I know
15:54:13FromGitter<Yardanico> this is just straight code port from python version
15:54:20FromGitter<Yardanico> and you need to compile your program with -d:release to make it faster (if you didn't do this before)
15:54:29FromGitter<Yardanico> nim c -d:release -r myprogra.nim a.txt b.txt
15:54:36FromGitter<Varriount> @jilee210 Also remember to use `-d:release` when compiling code that you will be benchmarking.
15:54:52FromGitter<zacharycarter> https://imgur.com/a/Hn3ti
15:55:03Yardanicowow
15:57:38*TjYoco joined #nim
15:58:13*Jesin quit (Quit: Leaving)
15:59:43FromGitter<jilee210> thanks for your nim version for me to learn. However, the speed is almost same 27 sec to compare 2 million lines of two files. python version is 5 sec or so.
15:59:54Yardanicoyou need to compile it using -d:release
15:59:57*Jesin joined #nim
16:00:09FromGitter<jilee210> I did
16:00:17Yardanicoare you sure ? :)
16:00:26*couven92 quit (Read error: Connection timed out)
16:00:39Yardanicothen please upload your two big files so we can benchmark it ourselves :)
16:00:45FromGitter<jilee210> yes:
16:00:52FromGitter<jilee210> nim c -d:release mydiff_chat.nim ⏎ Hint: used config file '/autofs/oracledba/jlee/Nim/nim-0.16.0/config/nim.cfg' [Conf] ⏎ Hint: system [Processing] ⏎ Hint: mydiff_chat [Processing] ⏎ Hint: os [Processing] ... [https://gitter.im/nim-lang/Nim?at=59bfedb47b7d98d30d0e049e]
16:00:55*couven92 joined #nim
16:01:43euantor`let old_lines = file1.readAll().splitLines()` - you are reading the whole file into memory, then splitting it by line
16:01:54Yardanicowell I just rewrote his python version
16:01:59euantorWould probably be faster with a `FileSTream` and reading a line at a time
16:02:08YardanicoI know that it can be easily optimized
16:03:39*Sentreen quit (Ping timeout: 252 seconds)
16:05:01*nitely joined #nim
16:06:05Yardanicojilee210: if you want to speed it up, don't write it in the same way :)
16:07:24FromGitter<jilee210> at least I learned how to assign all lines to a set using toSet and strutils
16:08:57*Pisuke quit (Ping timeout: 260 seconds)
16:09:49FromGitter<jilee210> thanks anyway. if you have your optimized version of mydiff.py, that's will be great. I was going to use this case to encourage co-workers to learn python and nim!
16:09:59euantorIs this any faster? https://www.irccloud.com/pastebin/IRzmbFaz/test.nim
16:10:42Yardanicojilee210: what is your main language?
16:10:49YardanicoI mean programming language
16:12:00euantorAnd that could probably be optimised to minimise the number of loops happening, you might be able to do it with 2 loops only
16:12:31FromGitter<jilee210> error compiling: mydiff_chat2.nim(14, 12) Error: undeclared identifier: 'fs'
16:13:30Yardanicorename first fs to file1
16:13:35Yardanicoand rename second fs to file2
16:13:38euantorOops, try this? https://www.irccloud.com/pastebin/tK8YFvEh/mydiff.nim
16:13:41FromGitter<jilee210> ok
16:14:36FromGitter<jilee210> mydiff_chat2.nim(33, 19) Error: undeclared identifier: 'old_lines_set'
16:15:13Yardanicorename it to old_lines
16:15:19Yardanicoand rename new_lines_set to new_lines
16:15:42FromGitter<jilee210> got it
16:16:09euantorAlso add `= ""` after `line: string`
16:16:23*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:16:23euantorhttps://www.irccloud.com/pastebin/Jyx5FrO4/mydiff.nim
16:16:26*Sentreen joined #nim
16:16:39euantorEasy to forget that string is nil by default
16:16:46*vlad1777d joined #nim
16:17:25FromGitter<jilee210> compifled OK but when I ran it, got this error:
16:17:30FromGitter<jilee210> SIGSEGV: Illegal storage access. (Attempt to read from nil?)
16:17:35euantorSee the above fix
16:20:13FromGitter<jilee210> seems like taking longer ...
16:21:40FromGitter<jilee210> perhaps python reference vs nim values ...
16:21:50FromGitter<jilee210> thanks anyway, learned a lot
16:22:30*claudiuinberlin joined #nim
16:23:06Yardanicowell you didn't give us your test files :(
16:23:09Yardanicoso we can't benchmark it
16:23:14*solitudesf quit (Remote host closed the connection)
16:24:04FromGitter<Bennyelg> @jilee210 Hey just entered, what you are trying to achive
16:31:03FromGitter<zacharycarter> minimaps hehe
16:31:20FromGitter<zacharycarter> https://imgur.com/a/0H3pv
16:31:33*nsf joined #nim
16:31:40FromGitter<zacharycarter> although things are slowing down considerably now with all these drawrectangle calls
16:32:29*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:32:53FromGitter<mratsim> Is importcpp working for you? My imported function doesn’t get launched at all
16:37:00*Ven`` joined #nim
16:40:32FromGitter<Bennyelg> Hey, when I create nim docs , how Do I terminate line when I explain what does to proc do
16:40:54FromGitter<Bennyelg> ---hello--- ⏎ ⏎ ---sup--- ⏎ ⏎ when I run nim doc the out put is : hello sup in same line [https://gitter.im/nim-lang/Nim?at=59bff716614889d47512e022]
16:42:52*Demos joined #nim
16:42:54FromGitter<mratsim> it’s restructured syntax
16:44:27FromGitter<zacharycarter> @mratsim are you trying to importcpp c++ code or js? I've only tried with js not c++
16:45:13FromGitter<Bennyelg> @mratsim so nothing to do? ⏎ And what is the best practice, where should I save the html doc file?
16:45:35Yardanicononono, you just do an empty line
16:45:38Yardanicoe.g.
16:45:43Yardanico## something
16:45:43Yardanico##
16:45:46Yardanico## new line
16:45:49FromGitter<Bennyelg> oh
16:46:21*yglukhov joined #nim
16:46:52Yardanicoit's RST syntax
16:47:23FromGitter<mratsim> @zacharycarter templated C++ function (that I’m writing myself)
16:47:50FromGitter<mratsim> a non-template import works, checking the rest …
16:48:00FromGitter<zacharycarter> gotcha
16:48:46FromGitter<mratsim> @Bennyelg save it in a gh-pages branch so that it’s published on your project.github.io
16:49:21*Sentreen quit (Ping timeout: 240 seconds)
16:49:30FromGitter<Bennyelg> so it just need to be present in the git repo for example in master branch among the rest of my files?
16:50:41*yglukhov quit (Ping timeout: 248 seconds)
16:51:01FromGitter<mratsim> it’s a different special branch for github, things pushed in that branch will be on a website
16:51:15FromGitter<mratsim> and html/js will be served by their server
16:51:47FromGitter<mratsim> you might want to use “git subtree” so that you have 1 master branch folder on your computer and one “gh-pages” folder/branch
16:51:55*yglukhov joined #nim
16:51:58FromGitter<mratsim> changing folder will automatically change your branch
16:52:13FromGitter<Bennyelg> I never did that, can you explain or give me some small tutorial ?
16:52:26FromGitter<mratsim> https://gist.github.com/cobyism/4730490 (I saw better tutos but I couldn’t find it again)
16:52:35FromGitter<Bennyelg> thanks
16:53:36FromGitter<mratsim> ah this one: https://dev.to/letsbsocial1/deploying-to-gh-pages-with-git-subtree
16:53:43FromGitter<mratsim> is a bit better in my opinion
16:53:46*EastByte quit (Ping timeout: 264 seconds)
16:54:30FromGitter<mratsim> or that, in a condensed presentation: https://github.com/PrismJS/prism/issues/231
16:57:21Yardanicomratsim: you can store gh-pages on master branch too :)
17:00:30*Demos quit (Read error: Connection reset by peer)
17:02:08*Ven`` quit (Ping timeout: 240 seconds)
17:02:34*Sentreen joined #nim
17:03:09*Ven`` joined #nim
17:04:24FromGitter<mratsim> A Nim tool to automate gh-pages would be nice :P
17:04:34FromGitter<mratsim> @zacharycarter small test case: https://gist.github.com/mratsim/afe5604ec96433fe7909079164207bd2
17:07:38FromGitter<mratsim> compiles but it seems like the template function is not called :/
17:08:41*relax quit (Ping timeout: 240 seconds)
17:09:29shashlickwhy do you need to do a crazy cast to get the value out off a FlowVarBase? val = cast[FlowVar[float]](responses[index]).`^`()
17:09:37Yardanicoehm?
17:09:51Yardanicojust ^responses[index]
17:09:54Yardanicolol
17:11:09*Demos joined #nim
17:11:44shashlickdoesn't compile since var responses = newSeq[FlowVarBase](5)
17:11:58shashlickand ^ expects FlowVar
17:12:08Yardanicoehm
17:12:11Yardanicowhy do you have FlowVarBase ?
17:12:21*Ven`` quit (Ping timeout: 240 seconds)
17:12:29Yardanicovar responses = newSeq[FlowVar[float]]()
17:12:41shashlickthat's the example in the docs under Spawn in the manual
17:12:55shashlickplus if I put in FlowVar for responses, that doesn't compile
17:14:26Yardanicothis code wouldn't compile
17:14:31Yardanicobecause tellServer isn't defined :P
17:14:52Yardanicopaste all your code please
17:14:54Yardanicoon gist
17:15:36FromGitter<mratsim> oh @zacharycarter you can’t select the cpp backend in play.nim-lang.org btw
17:21:03shashlickYardanico: https://gist.github.com/genotrance/397479572eed0dbb554d026d9d3d5286
17:21:05FromGitter<mratsim> mmm the C++ code generated is like this. Arguments got eaten? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c000817b7d98d30d0e7483]
17:21:20shodan45I built kotlin-native on a whim yesterday. I was surprised it worked. And surprised it took 2.9GB of space.
17:21:45shodan45guess I was spoiled by nim ;)
17:22:20Yardanicoshodan45,ah
17:22:24Yardanicooh sorry, wrong person
17:22:33Yardanicoshashlick, you forgot to import threadpool
17:22:57Yardanicoshodan45, well I can't help you without all code :(
17:23:12Yardanicomake a small example of something you want to make work
17:23:52*haha_ quit (Quit: haha_)
17:24:24shodan45Yardanico: wrong person, 2x :P
17:24:41shashlickYardanico: it's there at the top in my file, this is just a subset
17:25:33Yardanicoshashlick, well your code would work, change FlowVarBase to FlowVar[whatevertypeyouhave]
17:25:47shashlickI see, let me try
17:26:59shashlicktype mismatch: got (seq[FlowVar[system.float]])
17:26:59shashlickbut expected one of:
17:26:59shashlickproc awaitAny(flowVars: openArray[FlowVarBase]): int
17:28:36Yardanicoshashlick, would it be better for you to wait for all threads to be completed ?
17:29:04Yardanicowell I don't know why it doesn't work :P
17:29:31shashlickif I get a good value from one of the threads, I can return
17:29:39shashlicki don't care to wait for all
17:31:38*nitely quit (Quit: Page closed)
17:32:26*zama joined #nim
17:34:07*sz0 joined #nim
17:40:45FromGitter<mratsim> Oh I think I found out from the manual. It’s a completely different syntax from imports ⏎ ⏎ > mportcpp for procs ⏎ >Note that the importcpp variant for procs uses a somewhat cryptic pattern language for maximum flexibility: ⏎ >A hash # symbol is replaced by the first or next argument. ... [https://gitter.im/nim-lang/Nim?at=59c0051dc101bc4e3ae14b98]
17:41:42FromGitter<mratsim> Yes, `{.importcpp: "dummy_templated_print<'1>(@)”.}` instead of `{.importcpp: "dummy_templated_print<'1>”.}` works
17:45:35*TjYoco quit (Ping timeout: 248 seconds)
17:50:04*TjYoco joined #nim
17:52:56*Pisuke joined #nim
17:55:14shashlickYardanico: thanks for your help though!
17:55:28Yardanicoshashlick, well it seems it really doesn't work with specific flow vars
17:58:47Yardanicomratsim: for future - you may compile small code snippets with -d:release to have smaller C source code
17:59:01Yardanicoe.g. ti wouldn't contain nimln_ calls and other debugging features
18:00:31Yardanicoe.g. here https://github.com/nim-lang/Nim/issues/6399 if compiled with -d:release NimMainModule will only contain 4 calls to C++ code
18:00:34Yardanicoand no other calls at all
18:00:38*ketralnis left #nim ("Textual IRC Client: www.textualapp.com")
18:01:06FromGitter<mratsim> oh good idea
18:01:25Yardanicowell in this example it doesn't matter, just saying :)
18:01:34FromGitter<mratsim> it doesn’t make sense to compile with release while debugging though ;)
18:02:38Yardanicoalso I'm surprised that nim compiles for c++ by default if there's importcpp pragmas
18:02:46YardanicoI mean it's good
18:03:03FromGitter<mratsim> it’s not by default
18:03:15Yardanico?
18:03:32FromGitter<mratsim> I did nim cpp instead of nim c to compile this example
18:03:48Yardanicowell it works with "nim c foo"
18:03:50Yardanicofor me
18:03:54FromGitter<mratsim> oh
18:04:14FromGitter<mratsim> it doesn’t work on play.nim-lang.org, are you on master/devel?
18:04:26Yardanicodevel
18:04:38Yardanicobut AFAIK there weren't any changes about this
18:14:11*relax joined #nim
18:23:51*vlad1777d quit (Ping timeout: 240 seconds)
18:26:02*Yardanico quit (Remote host closed the connection)
18:29:45FromGitter<ino76> hi .. does anybody know some easy algorithm to show "speed" through languages? I tried `for` and add to variable hundred milion times but Nim vas so fast compared to other languages that I think it did some optimalizations and just print result (I hardcoded values). PS: btw did you try Crystal lang?? What do you guys think about it compared with Nim?
18:31:46*nsf quit (Quit: WeeChat 1.9)
18:36:05subsetparkhttps://github.com/ivankoster/nimbench - ino76: this is a good library to start with setting up well-defined benchmarks
18:42:38FromGitter<ino76> thank you
18:45:34FromGitter<Varriount> Yardanico: My dream for string interpolation would be a macro like Python's f-strings or javascripts string interpolation.
18:49:46*haha_ joined #nim
18:52:41*Vladar quit (Ping timeout: 240 seconds)
18:54:21FromGitter<Yardanico> @ino76 yeah, C compiler probably took away this loop and computed the sum of it
18:55:35*madmalik quit (Quit: Connection closed for inactivity)
18:57:07*xet7 joined #nim
19:04:37*Sentreen quit (Quit: WeeChat 1.6)
19:19:40*Trustable quit (Remote host closed the connection)
19:34:47*Sentreen joined #nim
19:40:56obadzanyone want to help me instantiate an ifreq?
19:41:11obadznot sure what the constructor syntax is for this C-union
19:42:05*Sentreen quit (Ping timeout: 240 seconds)
19:46:44*claudiuinberlin joined #nim
19:49:30*claudiuinberlin quit (Client Quit)
19:52:05*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
19:52:41*Snircle joined #nim
19:55:03*Sentreen joined #nim
20:10:06*Sentreen quit (Quit: WeeChat 1.6)
20:12:46*Sentreen joined #nim
20:14:59Demosis there a typeclass for key value containers of any type
20:16:09*ipjk_ quit (Read error: Connection reset by peer)
20:20:54FromGitter<ephja> @Varriount https://lyro.bitbucket.io/strfmt/#string-interpolation-interp
20:23:16*claudiuinberlin joined #nim
20:27:03*Nobabs27 joined #nim
20:27:12*vlad1777d joined #nim
20:29:33*yglukhov quit (Remote host closed the connection)
20:34:20obadzDemos: there are no typeclasses.
20:34:33FromGitter<mratsim> but you can create a concept
20:35:03FromGitter<mratsim> there is an example either in the forum, manual or directly in one of the concept tests folder iirc
20:35:13obadzor just embrace unstructured overloading :)
20:36:45FromGitter<mratsim> mmmh, actually that was a design question, who knows if you can do it: https://forum.nim-lang.org/t/2396/6
20:37:31DemosI would just use the type x = Table or OrderedTable thing
20:37:40Demosbut w/e I'll just pick a type for now
20:38:11Demosdoes nim still default to auto for params where you don't specify a type?
20:39:23*solitudesf joined #nim
20:40:02FromGitter<Varriount> Not anymore
20:40:39Demos:(
20:40:51*Sentreen quit (Ping timeout: 240 seconds)
20:42:27obadzDemos: you shouldn't have to pick a type
20:42:55DemosI don't have to, but this is an internal function and I'm lazy
20:43:25obadztoo lazy to put [A] after the function name?
20:44:48Demosyep
20:44:56FromGitter<mratsim> [A] ? I always use T
20:45:01DemosI mean I'll do that if I ever need to use another type
20:45:04Demosbut not now
20:45:50FromGitter<mratsim> I find having to add type a feature actually, I mean, it’s static typing. And it feeds nimsuggest
20:46:10FromGitter<Yardanico> you could make a pragma which will put "auto" in arguments without types :P
20:46:43FromGitter<mratsim> Lazyness can go a long way ;)
20:52:13AraqDemos: => from future creates proc (a, b: auto): auto = ...
20:52:30Araqand that's why we got rid of the "auto auto" feature
20:53:53*Sentreen joined #nim
20:53:56ehmryAraq: whats the difference between the current asyncdispatch and upcoming?
20:56:12ehmryor how soon will upcoming/asyncdispatch be asyncdispatch?
20:59:22*Demos quit (Quit: Demos)
20:59:35*solitudesf quit (Ping timeout: 240 seconds)
20:59:49*Demos joined #nim
21:00:58ehmryI think I may reimplement the dispatcher for genode
21:03:32*relax quit (Ping timeout: 260 seconds)
21:04:00*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:06:19*TjYoco quit (Quit: Leaving)
21:08:01dom96ehmry: why are you considering reimplementing it?
21:11:40ehmryits complicated, I want to support native asynchronous signaling that happens independently of file discriptors
21:12:59ehmryand perhaps someday use the native file-system interface rather than POSIX
21:14:38ehmryby reimplement I mean add a third variation to the windows and unix versions
21:22:21*Demos quit (Quit: Demos)
21:35:18*Arrrr quit (Read error: Connection reset by peer)
21:38:41*Pisuke quit (Ping timeout: 240 seconds)
21:49:30*Pisuke joined #nim
21:55:39*Nobabs27 quit (Quit: Leaving)
21:57:51*Pisuke quit (Ping timeout: 252 seconds)
22:07:13*Pisuke joined #nim
22:19:23FromGitter<zacharycarter> @mratsim as soon as cloudfront cache clears you should have c++ compilation option on the playground
22:22:13FromGitter<zacharycarter> and it should work heh
22:22:17FromGitter<zacharycarter> but until it clears it's borked
22:40:40*vivus quit (Quit: Leaving)
22:56:47*relax joined #nim
23:03:05*relax quit (Ping timeout: 240 seconds)
23:07:05*relax joined #nim
23:14:41*relax quit (Ping timeout: 248 seconds)
23:15:45*relax joined #nim
23:30:09*relax quit (Ping timeout: 248 seconds)
23:39:00*relax joined #nim
23:43:42*sz0 quit (Quit: Connection closed for inactivity)