<< 22-11-2017 >>

00:01:42*d10n-work quit (Quit: Connection closed for inactivity)
00:05:53Araqnitely: "nim doc" supports the same params as "nim", sometimes you need --define:ssl to make your code compile etc. the documentation generator has very few options on his own
00:09:07vivusdoes nims asynchttp work similar to goroutines?
00:09:53Araqfor some meaning of "similar", yes
00:12:20vivusso its multi-threaded concurrency?
00:15:01vivushow do I pass multiple procs in `server.serve(Port(8080), cb)` ?
00:17:01Araq--threads:on and then I don't know :-)
00:17:40vivusunless w.r.t server.serve I need to pass the handler only? server.serve(Port(8080), handler) ?
00:17:51Araqit's async concurrency though, you can spawn multiple threads to handle even more requests per second but I don't know the current state of that one
00:18:27Araqyou're rich long before its speed becomes a problem
00:18:46FromGitter<kayabaNerve> vivus: Use a single wrapper callback
00:19:07FromGitter<kayabaNerve> So a single callback that calls the other functions
00:20:06*libman joined #nim
00:20:45vivus@kayabaNerve so in essence the handler function will be the callback function
00:23:17*sz0 joined #nim
00:23:57*rbrt joined #nim
00:25:29vivus@kayabaNerve do you know where I might have gone wrong in this test sample: https://www.zerobin.net/?02763b79ee772eef#eqxpIC90wRFGUAhnNRjLLIN1pSBxkfHYEOpJt3qA/pY= ?
00:32:15vivushow do I make an async proc to return the message+header?
00:38:41*rbrt quit (Quit: Oíche mhaith)
00:47:32FromGitter<abijahm> @vivus you have to forward declare functions
00:47:42FromGitter<abijahm> *procedures
00:48:31FromGitter<abijahm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a14c95f232e79134db7a4d8]
00:48:53*rbrt joined #nim
00:49:45*kier quit (Remote host closed the connection)
00:50:57*kier joined #nim
00:51:48vivus@abijahm I did not know that forward declaring was even possible. My solution I was thinking about was to have async procs that return lists, with the list containing the msg and header as strings/etc.
00:54:13vivuswell that worked. I just moved the proc getjson() function above the handler
00:56:13FromGitter<abijahm> yes, a list of a items maybe a Tuple, (https://devdocs.io/nim/manual#types-tuples-and-object-types)
00:56:40FromGitter<abijahm> Tuples and objects (https://devdocs.io/nim/manual#types-tuples-and-object-types)
01:04:29*marenz quit (Ping timeout: 255 seconds)
01:05:00vivusis this not a valid async proc: https://www.zerobin.net/?11161ab7f25e8dc8#ShqWW6+0waUrZKWngoigRhs8rHIN3AlLsnDUYnZ7AcA= ?
01:08:47*arnetheduck joined #nim
01:22:46FromGitter<abijahm> no it is not async procedures return Futures```
01:23:14FromGitter<abijahm> it should be ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a14d182982ea2653fac5a87]
01:23:58vivus@abijahm so when you want to return something, you use the Future type?
01:25:30FromGitter<abijahm> yes for async procs
01:25:55vivusinteresting.
01:27:03*rbrt quit (Quit: Oíche mhaith)
01:28:37FromGitter<abijahm> it is like a Promise in javascript
01:28:53FromGitter<abijahm> i cant find its documentation though
01:33:16vivusits making a lot of sense now. thanks @abijahm
01:39:02FromGitter<abijahm> cool
01:42:05*vlad1777d quit (Ping timeout: 240 seconds)
01:42:33*couven92 quit (Quit: Client Disconnecting)
01:45:27*vivus quit (Quit: Leaving)
01:46:56*xkapastel joined #nim
01:49:11*dexterk_ quit (Ping timeout: 240 seconds)
01:57:24*MJCaley quit (Quit: MJCaley)
01:59:53*mr_yogurt joined #nim
02:10:16*endragor joined #nim
02:14:02*MJCaley joined #nim
02:14:57*endragor quit (Ping timeout: 248 seconds)
02:24:57FromGitter<Varriount> I never understood why Javascript needed another name for Futures.
02:44:51*endragor joined #nim
02:45:28mr_yogurtVarriount: how do i make your plugin not bring up an errors box whenever i save (or at least make it so it doesn't move my cursor to it)? (this might be a sublime thing but i've never used sublime before so i don't know)
02:48:38*endragor quit (Remote host closed the connection)
02:52:57*chemist69 quit (Ping timeout: 258 seconds)
03:06:29*chemist69 joined #nim
03:09:29*endragor joined #nim
03:14:50*MJCaley quit (Quit: MJCaley)
03:27:07*MJCaley joined #nim
03:28:54*dexterk joined #nim
03:32:04FromGitter<Varriount> mr_yogurt: Are you on Mac OSX?
03:32:50FromGitter<Varriount> You can change whether the "check on save" runs by modifying the user preferences files.
03:33:39FromGitter<Varriount> Look at the default settings for the NimLime package, then copy and modify the ones you want to change in the user settings.
03:36:28mr_yogurtVarriount: no, on windows
03:37:31FromGitter<Varriount> Ok. You will need to carry out the steps above. I can't recall where the list of packages and their respective settings are in the top menus
03:38:27mr_yogurtfound it
03:39:18FromGitter<Varriount> Personally, I like having my code checked on save. :3
03:40:09mr_yogurti do too but not if it means that it hijacks the cursor for no discernible reason
03:40:50FromGitter<Varriount> Hm, do you mean it's moving the cursor to the first error?
03:41:52*rbrt joined #nim
03:42:29mr_yogurtno
03:43:13FromGitter<Varriount> Where is it moving the cursor to?
03:43:16mr_yogurtwhen i save it brings up a box with a list of errors/warnings at the top of the screen and puts the cursor in there, because apparently i have so many errors i need to be able to search through them
03:43:39FromGitter<Varriount> You can press escape to exit that and return to the previous position
03:44:38mr_yogurtbut then i have to press escape
03:44:40mr_yogurtthat's annoying
03:46:34mr_yogurtwhy does it even bring it up that way anyway? can't there be a console at the bottom or something?
03:46:44FromGitter<Varriount> mr_yogurt: You can use these settings: https://gist.github.com/Varriount/13d9c9eae437b645c1aeafe7dfb0418a
03:47:00FromGitter<Varriount> mr_yogurt: That's the standard input list.
03:47:37FromGitter<Varriount> You can tinker with the settings to output errors to a console.
03:47:59FromGitter<Varriount> Although, the console API is very finicky, and output to the console isn't well testd.
03:49:24mr_yogurtso now i don't get my error list at all
03:49:43FromGitter<Varriount> Well, that's what you wanted?
03:49:56FromGitter<Varriount> I can't control the cursor being moved when the selection box comes up.
03:50:13mr_yogurtcan i make sublime not do that?
03:51:16FromGitter<Varriount> I don't know. It's never been a problem for me.
03:52:39FromGitter<Varriount> And it looks like output to the debug console is broken. Probably happened with the new release.
03:53:56FromGitter<Varriount> mr_yogurt: I'll look into fixing output to console sometime this week.
03:56:16FromGitter<Varriount> mr_yogurt: You're the first person to actually use it . Congratulations. :D
03:56:35FromGitter<Varriount> Or rather, use it over the selection menu
03:56:58mr_yogurthaven't used it yet :P
03:58:50FromGitter<Varriount> Details details.
03:59:26mr_yogurtit's supposed to be enable-able with "output.method": "console", right?
03:59:54*libman quit (Quit: Connection closed for inactivity)
04:00:32FromGitter<Varriount> Yes, however when I run it, I get an error message.
04:01:01mr_yogurtwhen i do it nothing happens
04:01:21FromGitter<Varriount> Press ctrl+"~"
04:01:30FromGitter<Varriount> Er, ctrl+"`"
04:02:20mr_yogurtstill just outputs to the selection box
04:03:27*sz0 quit (Quit: Connection closed for inactivity)
04:03:43FromGitter<Varriount> Hm, odd. ctrl+"`" should open up the debug console, with a stacktrace or something
04:04:35FromGitter<Varriount> To be honest, the NimLime plugin needs a serious refactor. It works for common cases, but tries to do a bit too much, and fails, for other cases.
04:04:57FromGitter<Varriount> Again, it doesn't help that a new version of ST was recently released.
04:05:30mr_yogurtit opens up a console, but the errors just go to the selection box
04:05:43*MJCaley quit (Quit: MJCaley)
04:07:31FromGitter<Varriount> Did you also disable the selection box?
04:07:50FromGitter<Varriount> Opening the console for output and opening the selection box aren't mutually exclusive
04:08:50*dddddd quit (Remote host closed the connection)
04:09:14*rbrt quit (Quit: Oíche mhaith)
04:09:31FromGitter<Varriount> Updated: https://gist.github.com/Varriount/13d9c9eae437b645c1aeafe7dfb0418a
04:10:20mr_yogurtok now it breaks
04:10:47*rbrt joined #nim
04:10:52FromGitter<Varriount> At least the error reporting code works. >_>
04:13:05mr_yogurtdoes writing your nim extension in (mostly) python make you feel dirty
04:15:12FromGitter<Varriount> A tad. However I also like Python, so it isn't so bad.
04:15:38FromGitter<Varriount> What frustrates me is that it's quite difficult to test a Sublime Text plugin.
04:16:05FromGitter<Varriount> I can't really write unit tests due to the GUI integration, and cross-platform support is a pain.
04:18:24mr_yogurtwhat bits need to be refactored? i'm probably more familiar with python than anything else so maybe i could have a go (although tbh probably won't be that helpful :/)
04:18:55FromGitter<Varriount> Settings is the biggest thing.
04:19:23FromGitter<Varriount> I tried to do something clever with caching settings, and it has serious bugs on Mac OSX.
04:19:43mr_yogurtwhat's wrong with the settings?
04:20:11FromGitter<Varriount> The settings themselves are fine, it's the fact that I try to cache them, rather than retrieving them from the editor often.
04:21:00FromGitter<Varriount> Things get odd when OSX restarts Sublime Text after shutdown or sleeping.
04:34:01FromGitter<Varriount> mr_yogurt: https://github.com/Varriount/NimLime/blob/master/nimlime_core/settings.py
04:34:34mr_yogurtyeah, found that. realized i probably should figure out the sublime API before trying to do anything
04:52:18*JappleAck joined #nim
04:54:19FromGitter<Varriount> mr_yogurt: The main thing that needs to be changed is removal of the reliance on callbacks.
04:54:42FromGitter<Varriount> The code is currently set up to store values from settings, and only update those values when the settings object is updated.
04:55:14FromGitter<Varriount> This works fine, when the settings object actually signals that it has been updated.
04:55:33FromGitter<Varriount> However it doesn't always do that.
04:55:43mr_yogurtwhy not just grab from the settings object each time?
05:00:16FromGitter<Varriount> That's what should be done.
05:00:45FromGitter<Varriount> I was trying to be efficient. :/
05:01:28FromGitter<Varriount> You know, the whole, "don't poll, use callbacks" thing.
05:01:39mr_yogurtbut you're not polling?
05:01:54mr_yogurt(getting from the settings object each time)
05:02:08FromGitter<Varriount> In a way, no.
05:02:31FromGitter<Varriount> It really depends on how expensive it is to retrieve a value from the settings object.
05:03:10FromGitter<Varriount> I imagine that each time you retrieve a value from the object, it has to create a python string object.
05:03:29mr_yogurtdid you profile first? :P
05:04:31FromGitter<Varriount> ... No.
05:04:56FromGitter<Varriount> Premature optimization is a bad habit of mine
05:06:35mr_yogurtwhen you say 'reliance on callbacks' do you mean 'reliance on sublimetext's callbacks' or 'reliance on an internal callback system'?
05:06:44*chemist69 quit (Ping timeout: 258 seconds)
05:07:31FromGitter<Varriount> Sublime Text
05:07:50FromGitter<Varriount> https://www.sublimetext.com/docs/3/api_reference.html#sublime.Settings
05:08:01FromGitter<Varriount> See "add_on_change"
05:09:14mr_yogurtso what is the problem? is the callback not always called?
05:11:34FromGitter<Varriount> Nope.
05:12:49FromGitter<Varriount> Things I want to change:
05:12:55FromGitter<Varriount> 1) Rework the settings system
05:13:00mr_yogurtgoddammit english. when you say 'nope' do you mean (1) the callback is not always called or (2) the callback is not not always called (it is always called)
05:13:38FromGitter<Varriount> The callback is not reliably called under all conditions.
05:14:10mr_yogurtso sublimetext is buggy?
05:14:21FromGitter<Varriount> More like I'm hitting edge cases.
05:14:30FromGitter<Varriount> Most people just poll the settings objects
05:17:12FromGitter<Varriount> mr_yogurt: How experience are you with Python generators?
05:17:41mr_yogurti've written a few. why?
05:18:49FromGitter<Varriount> This is my answer to callback torture in Sublime Text: https://github.com/Varriount/NimLime/blob/master/nimlime_core/utils/misc.py#L43
05:19:59*NimBot joined #nim
05:20:18*chemist69 joined #nim
05:21:44FromGitter<Varriount> mr_yogurt: It allows a generator to refer to itself when passing callbacks to sublime text api functions.
05:21:52FromGitter<Varriount> https://github.com/Varriount/NimLime/blob/master/nimlime_core/commands/nimble.py
05:23:50FromGitter<Varriount> Actually, this is probably a better explanation: https://forum.sublimetext.com/t/using-generators-for-fun-and-profit-utility-for-developers/14618
05:45:37mr_yogurtwhen you said 'experience with python generators' i didn't realize that by 'python generators' you meant 'black magic'
05:58:12mr_yogurti think to understand what this is good for i'd need to understand the sublime api
06:21:53*endragor quit (Remote host closed the connection)
06:23:50*Serenitor joined #nim
06:25:34*SenasOzys_ quit (Remote host closed the connection)
06:30:09*endragor joined #nim
06:32:56*nsf joined #nim
06:38:09FromGitter<Varriount> mr_yogurt: That generator stuff is unrelated to the sublime api
06:38:41mr_yogurtVarriount: weren't you using it to make working with sublime easier?
06:38:49FromGitter<Varriount> I mean, it's used with the api, but not tired to it
06:38:56FromGitter<Varriount> *not tied
06:39:17FromGitter<Varriount> I could use this with any system that is callback based.
06:40:19mr_yogurti think i understand what you're doing, i just don't understand why you'd want to do it
06:41:33FromGitter<Varriount> So, the sublime API functions take callbacks when the input isn't immediately available.
06:42:22FromGitter<Varriount> For example, if you want to get user input, you have to make a call like `sublime.get_user_input(message, callback)`
06:42:51FromGitter<Varriount> The callback is passed the input
06:43:47FromGitter<Varriount> Now, imagine how you have to structure your code if you have to ask 3 questions.
06:44:23mr_yogurtunrelated nim question: what might i be doing wrong that i get a warning 'generic method not attachable to object type is deprecated'? (have a method on a generic subclass of a nongeneric class)
06:45:01*rbrt quit (Quit: Oíche mhaith)
06:45:45mr_yogurtVarriount: i can see how your fancy thing would be useful there but i think i'd need examples of when you'd ask three questions in succession
06:46:50FromGitter<Varriount> Setting up project files.
06:47:31FromGitter<Varriount> Asking the user what package to install, and where
06:47:37mr_yogurtok
06:48:01FromGitter<Varriount> Is your method acting on an object, or a reference?
06:48:12FromGitter<Varriount> Can you show me the code?
06:48:40*rbrt joined #nim
06:50:34mr_yogurtgimme a sec, let me write an example
06:54:55mr_yogurtwhere should i paste?
06:55:33FromGitter<Varriount> gist.github.com is nice
06:56:17mr_yogurthttps://gist.github.com/mr-yogurt/80185c82adc231ab70963899ee9a9308
06:56:26mr_yogurti think i may misunderstand what var does
06:57:23mr_yogurtin function signatures
06:58:16FromGitter<Varriount> `var` allows you to modify the source value. It's usually the value on the stack.
06:58:28mr_yogurtis it like c++ pass by reference? (in which case reference types don't need it unless you want to change what the reference points at)
06:58:36FromGitter<Varriount> Yes
06:58:48mr_yogurtok, then i'll just take out the 'var' since the warning goes away when i do
06:59:42FromGitter<Varriount> Although please note that even without var, Nim does the "right" thing and passes most parameters via pointer or reference when generating code.
07:00:24mr_yogurtyeah i read something like that
07:14:12FromGitter<mratsim> Function parameters are not copied.
07:28:36*rbrt quit (Quit: Oíche mhaith)
08:04:42*lawgsy joined #nim
08:14:59*mr_yogurt quit (Ping timeout: 260 seconds)
08:20:53FromGitter<mratsim> Is there a way to request if a ref object is uniquely owned/referred to? Apparently getRefCount is not reliable
08:22:17*dexterk quit (Quit: Konversation terminated!)
08:25:07*Serenitor quit (Ping timeout: 260 seconds)
08:28:08*claudiuinberlin joined #nim
08:32:14*floppydh joined #nim
09:23:43*Serenitor joined #nim
09:36:42*xkapastel quit (Quit: Connection closed for inactivity)
09:48:31*skrylar joined #nim
09:57:02*jjido joined #nim
10:29:42cremWhat's the best way to import (at compile time) a large-ish (15MB) binary file as a string constant in nim? I need some data to be part of an executable. In Windows, resources would be better, but I want something cross-platform, so huge string literal seems to be the way.
10:35:54Araqcrem: slurp/staticRead?
10:36:15Araqstill a pretty bad idea to do it for a 15mb file
10:37:06Araqmratsim: I think you should use good old copy-on-write via refcounting that Nim's destructors/assignment operator enable you to do
10:37:07cremYeah, but in windows it's fine as resources are not actually loaded until you load them explicitly.
10:37:53Araqthey are not loaded anywhere until you use them, I think. virtual memory management is page based
10:39:02FromGitter<mratsim> @Araq yes I'm trying to do that actually but I thought it would be easier to hook into the GC refcounting. Except that it's not atomic so I have to keep my own counter.
10:39:12cremSeems like staticRead is what I need! Good, thanks.
10:39:29Araqmratsim: the GC doesn't refcount things on the stack
10:39:37Araqso it's useless for COW
10:39:48FromGitter<mratsim> Yes that's what I saw.
10:41:36skrylarThings like you trying to rewrite how everything works is one of the reasons i still just use my ghetto tensors :p
10:41:47skrylareven if they don't support all the acronyms :/
10:42:02*sendell joined #nim
10:42:37skrylari see we have some postgres adapters. i wonder if they are as good as my firebird one :x
10:43:29FromGitter<mratsim> Hehe, well learning about memory management is fun as well. I got sidetracked by atomic reference counting into hazard pointers >_>.
10:44:53skrylari just made a seq[float] and started shoving procs over it
10:45:30skrylarin gcc doing that will, with the right -f flags, give you avx optimized numberdoodles
10:45:59skrylari don't know if nim ones will.
10:46:36skrylarstarting to come back around to the idea neural nets are false gods and the old symbol machines were the right idea
10:46:54FromGitter<mratsim> My tensor codes are using AVX/FMA goodies if compiled with -march=native.
10:47:34skrylarsome of the really advanced AI papers are relying on more or less platonic forms of thought
10:47:48skrylarwhich is exactly what symbol machines did
10:47:52skrylarand used way less cpu
10:47:53FromGitter<mratsim> They certainly are overhyped, but currently they are the only thing that can deal with unstructured data at scale.
10:48:57FromGitter<mratsim> And I dream on doing a Starcraft 2 neural network based bot called "Overmind" :P (in Nim of course ;) )
10:49:08skrylari remember reading some neurolingustic programming stuff and it was talking about these ideas for the subconscious; one was things was like, how stereotypes get made
10:49:42skrylarits kind of interesting how the main weakness of SVMs is 'too many samples' but they work great otherwise. and then one thing brains do? delete excess samples
10:50:15*marenz joined #nim
10:50:53skrylarpeople's continued use of linear regression seems to further go with the idea that brains prefer a simpler solution with a higher E factor than complex and accurat eones
10:56:59skrylarthere is this old paper, i can probably get you the DOI number, but they just made an old fashoined symbol machine, its called O* (as in A*) and they did it in haskell (i have a partial, incomplete nim version) that just like, tests a bunch of stuff and applies occam's razor. it apparantly learns basic patterns for iq tests and learns math from examples. :3
10:57:51skrylar10.1007/978-3-319-09274-4_17
10:58:27skrylarnow to crawl back under my rock
11:00:34FromGitter<mratsim> linear/logistic regression are instant. Criteo for example is doing lots of ML research but they must manage ad auctions with at most a couple ms delay and they said in the past that it's better to have an approximate answer in a ms than a better answer in 100ms.
11:00:44*Sentreen quit (Ping timeout: 255 seconds)
11:07:11skrylarallegedly you can drive the parallela board with openmp
11:09:27*SenasOzys joined #nim
11:12:11*Arrrr joined #nim
11:12:11*Arrrr quit (Changing host)
11:12:11*Arrrr joined #nim
11:15:12*couven92 joined #nim
11:16:23*Sentreen joined #nim
11:19:51*Guest5 joined #nim
11:22:15*Guest5 quit (Remote host closed the connection)
11:26:49*Sentreen quit (Read error: Connection reset by peer)
11:41:55*Sentreen joined #nim
11:56:43*lawgsy left #nim (#nim)
12:04:50*elrood joined #nim
12:07:30*gangstacat joined #nim
12:07:44*Vladar joined #nim
12:16:07*jjido quit (Ping timeout: 260 seconds)
12:52:05*fvs joined #nim
12:53:20*fvs is now known as smitty`
12:53:45*smitty` is now known as fvs
12:57:02Arrrr!eval 1 .. 1 is Slice
12:57:03NimBotCompile failed: ???(???, 0) Error: expression 'false' is of type 'bool' and has to be discarded
12:57:09Arrrr!eval echo(1 .. 1 is Slice)
12:57:12NimBotfalse
12:57:15Arrrr!eval echo(1 .. 1 is int)
12:57:17NimBottrue
12:58:42ArrrrIs this correct?
12:59:46Arrrr!eval echo(range[1 .. 1] is range)
12:59:48NimBottrue
13:01:18*arnetheduck quit (Remote host closed the connection)
13:03:17sendell!eval for i in 0..3: echo i
13:03:19NimBot0↵1↵2↵3
13:04:00*sz0 joined #nim
13:14:25*chemist69 quit (Quit: WeeChat 1.9.1)
13:18:59*Jesin quit (Quit: Leaving)
13:24:41*gangstacat quit (Quit: Ĝis!)
13:28:10*chemist69 joined #nim
13:29:04*Sentreen quit (Quit: WeeChat 1.6)
13:29:56*Arrrr quit (Read error: Connection reset by peer)
13:30:26*Sentreen joined #nim
13:34:16*chemist69 quit (Quit: WeeChat 1.9.1)
13:34:50*chemist69 joined #nim
13:39:03*nsf quit (Quit: WeeChat 1.9.1)
13:47:51*endragor quit (Remote host closed the connection)
13:54:53*cspar quit (Ping timeout: 255 seconds)
14:01:54*endragor joined #nim
14:03:43*Serenitor quit (Ping timeout: 248 seconds)
14:06:01*endragor quit (Ping timeout: 240 seconds)
14:12:08*endragor joined #nim
14:28:25*nsf joined #nim
14:30:49*fredrik92 joined #nim
14:34:22*couven92 quit (Ping timeout: 260 seconds)
14:47:33*fredrik92 quit (Read error: Connection reset by peer)
14:47:47*dddddd joined #nim
14:57:17*Jesin joined #nim
14:59:28*acidx joined #nim
15:10:54*jjido joined #nim
15:46:45*xet7 quit (Ping timeout: 250 seconds)
15:58:52*xet7 joined #nim
16:02:18*miran joined #nim
16:02:56*d10n-work joined #nim
16:05:11*jsgrant quit (Ping timeout: 268 seconds)
16:10:03*floppydh quit (Quit: WeeChat 1.9.1)
16:15:51FromGitter<Varriount> @mratsim Your COW type looks really neat!
16:41:43*Trustable joined #nim
16:53:42FromGitter<alehander42> can we add a `leftAlign` to `strutils` ? this `spaces` hack in the docs is meh
17:03:47FromGitter<Varriount> Do we have a right align and center align?
17:04:54*vivus joined #nim
17:05:51FromGitter<alehander42> we have center and align
17:05:55FromGitter<alehander42> which acts as right align
17:06:08FromGitter<alehander42> and `text2 & spaces(max(0, width - text2.len))`
17:06:13FromGitter<alehander42> for left align
17:16:32*Trustable quit (Remote host closed the connection)
17:18:31FromGitter<data-man> @alehander42: https://github.com/nim-lang/Nim/blob/devel/lib/pure/strutils.nim#L1114
17:18:39*sendell quit (Remote host closed the connection)
17:25:07*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
17:33:59*xkapastel joined #nim
17:42:46*nsf quit (Quit: WeeChat 1.9.1)
17:54:48vivushas anybody worked with asyncmysql lib here?
17:57:27GitDisc<treeform> I did
17:57:55GitDisc<treeform> I submitted a but + test suit, and it was excepted.
17:58:05GitDisc<treeform> and fixed in 24 hours.
17:58:13GitDisc<treeform> bug*
17:58:34GitDisc<treeform> do you have a question about it vivus?
17:59:28vivus@treeform do you have some example code I can read/build on top of? I have my experimental REST API passing JSON data as GET, now I want to pass it from a DB
18:00:00*skrylar quit (Remote host closed the connection)
18:00:17GitDisc<treeform> Sorry not really. I have moved on from REST APIs to much better WebSocket based apis.
18:01:50FromGitter<nitely> Is there a way to generate docs for `export myproc`? It seems only docs for proc/iterators/etc with export marks are generated
18:01:53*rbrt joined #nim
18:02:54GitDisc<treeform> not sure, i don't use export ever.
18:03:36FromGitter<nitely> export seems useful when exposing an API that is modularized under the hood...
18:03:57vivus@treeform so you use websockets to create long-running processes for your apps?
18:04:07FromGitter<nitely> not sure if that's a valid use-case though
18:08:03GitDisc<treeform> vivus, yes
18:08:16FromGitter<Varriount> treeform: But websocket isn't widely available for other languages to use. :<
18:08:30vivus@treeform how many procs are you using for connect, execute ?
18:08:33GitDisc<treeform> nitely, I am not sure how to organize this stuff myself
18:09:08GitDisc<treeform> Varriount, if you are just talking to yourself its great. But yeah you want to provide public API I would agree REST is better.
18:09:27GitDisc<treeform> vivus, I don't get your question?
18:10:13vivus@treeform I am essentially trying to figure out how to make the asyncmysql procs `talk` to the asyncHTTPserver procs
18:10:52GitDisc<treeform> Does any one know if there is some thing like an `print` macro that when you type `print "hey", foo, bar` it outputs `hey foo:123 bar:"abc"` It uses names of vars passed to it.
18:11:22vivus@treeform like fstring in Python?
18:11:41GitDisc<treeform> vivus i had a bunch of issue trying to wrap my head around async, await, and Futures
18:11:59TheManiacThere’s a package that does something like that (fstring)
18:12:00vivus@treeform all the more reason to share your knowledge XD
18:12:03GitDisc<treeform> I think its some thing you just got to play around with yourself to get. I feel like I still don't get it it fully.
18:13:09GitDisc<treeform> TheManiac, I don't think this is possible in python and I don't think its fstring.
18:13:18GitDisc<treeform> This is like a LISP thing.
18:13:53GitDisc<treeform> `print a` should print out `a:2`
18:14:14GitDisc<treeform> basically if passing a literal string it prints it out, if passing a var it should print the far and the value
18:14:19vivusthat looks like dict notation.
18:14:34GitDisc<treeform> it could be = , that part does not matter
18:15:16vivusthat syntax isn't very good though, cause it'll be hard to figure out what is a var and what is part of the string
18:15:43GitDisc<treeform> this is mainly for debugging
18:15:59GitDisc<treeform> I write this all the time: `echo "tableFormat ", tableFormat`
18:16:01vivuswhere are you getting the items from? nims equivalent to a dict?
18:16:11GitDisc<treeform> i want to just write `print tableFormat`
18:16:30GitDisc<treeform> vivus, what items?
18:16:42vivusthe items you want to print/echo
18:17:04*rbrt quit (Quit: Oíche mhaith)
18:18:13*rbrt joined #nim
18:27:50*rbrt quit (Quit: Oíche mhaith)
18:30:10*SenasOzys quit (Ping timeout: 252 seconds)
18:30:56*couven92 joined #nim
18:39:21*jsgrant joined #nim
18:47:04FromGitter<brentp> @GitDisc, this is possible in python: https://github.com/zestyping/q I agree it would be nice to have in nim
18:47:31FromGitter<brentp> nice lightning talk on it here: https://www.youtube.com/watch?v=OL3De8BAhME#t=25m15s
18:49:46FromGitter<alehander42> @data-man thanks!
18:49:57FromGitter<alehander42> so why is alignLeft not on https://nim-lang.org/docs/strutils.html
18:50:05FromGitter<alehander42> isn't it updated automatically :O
18:53:15FromGitter<alehander42> also why uint isn't Ordinal "implementation reasons"?
18:53:23FromGitter<alehander42> that breaks for 0..<uintvalue
18:53:33FromGitter<alehander42> in the last devel
18:55:27FromGitter<Varriount> @alehander42 Well, for one, the compiler would have a trouble range checking it.
18:55:58FromGitter<Varriount> Also, the built-in set type would take a rather large amount of memory if it was storing a uint
19:00:34FromGitter<alehander42> ok, so can `pred` then be overloaded somehow, to return `int` for uint-s ? so e.g. for 0 it returns -1 and ⏎ `aUint..<bUint` isn't broken, because this operation makes sense for uint-s and the current error message would be abysmally confusing for any non-Nim people :D
19:06:13FromGitter<alehander42> or even a simpler solution, overload `..<` ⏎ ⏎ ```template `..<`*(a: untyped, b: uint): untyped = ⏎ a .. pred(b.int)``` [https://gitter.im/nim-lang/Nim?at=5a15caa5982ea2653fb19863]
19:07:05FromGitter<Varriount> Wait, what are you currently trying to do?
19:07:46FromGitter<alehander42> ```proc a(b: uint) = ⏎ for 0..<b: ⏎ # ⏎ ``` [https://gitter.im/nim-lang/Nim?at=5a15cb02cc1d527f6ba28cf7]
19:08:16FromGitter<Varriount> Didn't that used to work?
19:08:26FromGitter<alehander42> yep, but it doesn't seem to work for my on devel now
19:08:38FromGitter<alehander42> because `pred` is defined for Ordinal
19:08:42FromGitter<alehander42> and uint is not an Ordinal
19:08:52FromGitter<alehander42> (because there is not `pred` for 0 uint)
19:09:07FromGitter<Varriount> !eval for i in uint(0)..uint(3): echo i
19:09:09NimBot0↵1↵2↵3
19:10:01FromGitter<Varriount> !eval for i in uint(0)..uint(3-1): echo i
19:10:03NimBot0↵1↵2
19:10:21FromGitter<alehander42> bizarre
19:11:11FromGitter<Varriount> @alehander42 Wouldn't uint -> int have the possibility of data loss?
19:11:38FromGitter<alehander42> in the `system.nim` on devel I see ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Isn't the template always invoked first [https://gitter.im/nim-lang/Nim?at=5a15cbeaba39a53f1ad1db92]
19:12:20FromGitter<alehander42> ok let's say `.int64
19:12:38FromGitter<Varriount> uint will be 32 bits on 32 bit systems, 64 bits on 64 bit systems
19:14:28*nsf joined #nim
19:14:29FromGitter<alehander42> ok, in that case the iterator should work correctly
19:16:06FromGitter<alehander42> but why the template is expanded for `int, uint`, but it' not for `uint, int`
19:16:17FromGitter<alehander42> !eval for i in 0..<3.uint: echo i
19:16:19NimBot0↵1↵2
19:17:38FromGitter<Varriount> I don't know. @Araq probably does though.
19:18:47*sendell joined #nim
19:19:37FromGitter<alehander42> hm NimBot probably uses an older version, no big deal it's easy to add `.int` but I wondered if it's by desing
19:20:48*sendell quit (Remote host closed the connection)
19:24:37*sendell joined #nim
19:25:52FromGitter<mratsim> @Varriount Thanks, I’ve done further research in case I ever want to adventure (get lost) in concurrent thread-safe COW. Here is my compilation of info: https://github.com/mratsim/Arraymancer/issues/157#issuecomment-346448645. It covers Nim capabilities (including the undocumented(?) atomics.nim), atomics, potential perf issue of lock-free programming, hazard pointers, R/W locks, RCU, reference counting, software
19:25:52FromGitter... transactional memory. I guess I’ll keep my simple implementation for now … seems like you need 2 or 3 PhDs to get that right.
19:30:07FromGitter<Varriount> @mratsim Are you getting the performance benefits you wanted?
19:30:09FromGitter<mratsim> By the way @Araq, if I understood properly https://nim-lang.org/docs/manual.html#guards-and-locks, Nim guards and locks are only compile-time checks and runtime implementation is left to the programmer (mutex, atomics, …). It just makes sure at compile-time that all access are done through a “virtual” lock right? Meaning that we can first use “locks” without any runtime locking/impact.
19:31:15FromGitter<mratsim> Research done, now I have to get my hands dirty ;). I expect 6x-8x speed benefits with a “normal syntax"
19:31:28FromGitter<Varriount> @mratsim The pragmas are compile-time mechanisms. You can still use runtime locks though.
19:32:26FromGitter<mratsim> For now I won’t use runtime locks the logic is not multithreaded in Arraymancer. “Only” computations
19:34:39FromGitter<Varriount> @mratsim For example, the `lock` template in the manual uses runtime posix locks
19:36:14FromGitter<mratsim> @Varriount: Example of benefits, in the loop there https://github.com/mratsim/Arraymancer/blob/master/benchmarks/implementation/softmax_cross_entropy_bench.nim#L132, using unsafeSlice is 6x to 8x faster, than using classic slice syntax https://github.com/mratsim/Arraymancer/blob/master/benchmarks/implementation/softmax_cross_entropy_bench.nim#L145 all things else being equal. ⏎ ⏎ I expect to solve this gap with
19:36:14FromGitter... copy-on-write.
19:36:18*lurker joined #nim
19:39:45FromGitter<mratsim> Currently in Arraymancer you have classic value semantics and you can opt-in for ref semantics as most procs have an `unsafe` version that does not copy. The perf difference is too big.
19:44:04nivAraq: the PR you sent on websockets.nim doesn't merge cleanly.
19:44:10*niv whinges
19:44:46sendelli remember reading somewhere about a special seq[bool] implementation that packs everything neatly using shifting, don't remember where
19:45:02sendelldoes someone know about it?
19:47:16*cspar joined #nim
19:48:39*Vladar quit (Quit: Leaving)
19:56:16FromGitter<mratsim> It rings a bell, I think I bookmarked it like 2 weeks ago, but it was for enum iirc
19:58:40FromGitter<mratsim> Or you can use my own implementation for the Sieve of Erathostenes: https://github.com/mratsim/nim-projecteuler/blob/master/src/lib/bithacks.nim
19:58:55*JappleAck quit (Ping timeout: 248 seconds)
20:08:10*PMunch joined #nim
20:15:31*bluenote joined #nim
20:16:32bluenote@treeform: I saw your question earlier regarding debug printing variables and their values. I though it make sense to post a "self documenting" Q/A on SO for that: https://stackoverflow.com/q/47443206/1804173
20:18:01*endragor quit (Remote host closed the connection)
20:24:45sendellthx mratsim :)
20:26:17FromGitter<mratsim> That was literally my very first Nim code so Here be dragons.
20:28:00FromGitter<mratsim> I didn't know Jack about converter for example ` var zero: T = 0 #Needed because unsigned and signed 0 are different ...`
20:29:12sendellwhat would you be your solution for this today? :)
20:30:15federico3bluenote: printing the type as well would be nice
20:32:33sendellarent converters like c++ conversion constructors? (read about it but never used them so far)
20:34:53bluenote@federico3: Yes, wouldn't be diffcult, probably just another newCall("write", ...) which warps the node in name(type(n[i]))
20:38:25*vlad1777d joined #nim
20:44:10vivuswhat is GitDisc ?
20:49:53FromGitter<mratsim> @vivus discord bridge
20:49:56*PMunch quit (Remote host closed the connection)
20:50:21vivusnice. so Nim is on discord, gitter, irc and matrix :D
20:50:27*PMunch joined #nim
20:50:29FromGitter<mratsim> @sendell I would just use `0.T`
20:50:40FromGitter<mratsim> And twitch
20:50:49vivustwitch?
20:50:55vivushow? isn't that video streaming?
20:51:26FromGitter<mratsim> Yes it is, Araq and dom96 stream Nim programming from time to time
20:52:51*endragor joined #nim
20:53:24*miran quit (Ping timeout: 246 seconds)
20:58:16*PMunch_ joined #nim
20:59:01*PMunch quit (Ping timeout: 240 seconds)
21:01:53*jjido quit (Ping timeout: 248 seconds)
21:03:36*PMunch_ quit (Quit: Leaving)
21:07:04*mr_yogurt joined #nim
21:12:55*fredrik92 joined #nim
21:16:17*couven92 quit (Ping timeout: 248 seconds)
21:16:20*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
21:16:39*mr_yogurt quit (Ping timeout: 260 seconds)
21:20:58*rbrt joined #nim
21:34:39*rbrt quit (Quit: Oíche mhaith)
21:35:13*rbrt joined #nim
21:37:32*rbrt quit (Client Quit)
21:38:26*rbrt joined #nim
21:42:09*d10n-work quit (Quit: Connection closed for inactivity)
21:42:24*rbrt quit (Client Quit)
21:44:13*sendell quit (Remote host closed the connection)
21:45:06vivusdoes the following example code on the asyncmysql lib result in an error for anybody else: https://github.com/tulayang/asyncmysql ? `db.nim(8, 10) Error: type mismatch: got (Future[system.void]) but expected 'Future[db.Replies]'`
21:52:21GitDisc<treeform> http://250bpm.com/blog:112 I like the "Or Nim." comment
21:52:21*rbrt joined #nim
21:54:13vivus@treeform can you try running the code from the example above? does it not work for you also?
21:55:02GitDisc<treeform> Sorry can't try it right now.
21:55:24*rbrt quit (Client Quit)
21:55:32vivuscool np
21:56:21GitDisc<treeform> bluenote, WOW NICE! Thank you.
21:58:08Araq3000 issues closed!
21:59:57GitDisc<treeform> did you just close them all without looking?
22:00:00vivusAraq: GG
22:00:27Araqusually I fix the bugs before closing them
22:01:53GitDisc<treeform> So you fixed 3000 bugs wow that is so many!
22:02:30GitDisc<treeform> !eval 2 + 3 # is this bot new?
22:02:31NimBotCompile failed: in.nim(1, 3) Error: expression '5' is of type 'int literal(5)' and has to be discarded
22:02:55GitDisc<treeform> !eval discard 2 + 3
22:02:57NimBot<no output>
22:03:10FromGitter<mratsim> 3000 bugs is not that many given Nim breadth and age I think.
22:03:16GitDisc<treeform> !eval discard 1 * float(uint16(1))
22:03:17NimBotCompile failed: in.nim(1, 26) Error: internal error: getFloat
22:03:20FromGitter<mratsim> are not*
22:03:26vivusis that 3000 issues altogether?
22:03:29*sendell joined #nim
22:03:40Araqit's 3000 issues too many
22:03:41Araq:P
22:04:07FromGitter<mratsim> well you can also remove 4200 Nim users and … no bugs :P
22:04:51FromGitter<mratsim> I’ve raised 48 bugs by myself :P
22:07:02Calinouthere's a Discord server? :D
22:07:19Calinoucan I get an invite link? :)
22:09:29cremhttps://discord.gg/aKYyhS
22:09:36*fredrik92 is now known as couven92
22:11:13vivusso if anybody is willing to volunteer your mind and time to test-run that asyncmysql example above, please do and let me know
22:14:19FromGitter<xomachine> The RussianAICup organizersadded Nim to the list of supported languages! Yay! I have left the announcement on the forum (https://forum.nim-lang.org/t/3359)
22:15:18Araqxomachine: Nice. Now we only need to win it :-)
22:18:30FromGitter<xomachine> @Araq It would be a good way to earn some popularity =)
22:19:24vivusIn the long run, a comp like that isn't worth the time.
22:22:10*rbrt joined #nim
22:26:04*SenasOzys joined #nim
22:29:43FromGitter<xomachine> Anyway, more people see language -> more people become interested in it -> more people get involved in the community
22:31:30vivussounds like trickle-down economics
22:33:26FromGitter<mratsim> sounds like marketing 101 :P
22:38:45*couven92 quit (Quit: Client Disconnecting)
22:40:57*nsf quit (Quit: WeeChat 1.9.1)
22:46:14*Jesin quit (Quit: Leaving)
22:46:25vivusAraq: do you know what the error is here: https://www.zerobin.net/?ec7614024cc75856#xUOMTUdGnnO0WnUugXA0fQ7D/ME84f0RurTdatecvU0= ? I see the `newFuture[void]` to `newFuture[seq]` but that didn't work either
22:48:55Araqvivus, huh, the error message is pretty clear
22:51:17*lurker quit (Quit: Leaving)
22:51:41Araqyour inner proc should not be .async either
22:52:15Araqroughly speaking proc getData(oncomplete)
22:52:17Araqbecomes
22:52:35Araqproc getData(): Future[T]
22:52:47Araqand then you set the future's callback
22:53:09Araqbut 'asyncmysql' sounds like it should show you some decent examples of how it works
22:53:36vivusAraq: I ran the homepage example, so the example itself is giving the error
22:53:55Araqso report it to the author
22:54:00Araqthe example makes no sense
22:55:54vivusAraq: would using the regular mysql lib impact async between app/DB?
22:56:20FromGitter<Varriount> vivus: Where did you find that example? I don't see it on the home page.
22:56:50vivus@Varriount https://github.com/tulayang/asyncmysql#examples
22:58:21vivusalright, I shall switch over to asyncpg :P
23:00:08FromGitter<alehander42> I start finding random people using Nim in reddit comments on python data science articles , nice : D
23:02:06vivus@alehander42 do they mention how they're using Nim?
23:06:50FromGitter<alehander42> https://www.reddit.com/r/Python/comments/7eqieq/python_overtakes_r_becomes_the_leader_in_data/
23:07:05FromGitter<alehander42> the first one is "I'm currently looking at /r/nim, which is a pythonesque compiled language with static typing but strong type inference. ⏎ I like how it combines benefits of Py & Hs, but some design / syntax choices als that it evolved somehow ad-hoc. "
23:07:19FromGitter<alehander42> the next "I've also used Nim for some things at work, I really like it! It compiles fast, it practically feels like "compiled python" in terms of syntax and behaviour, the things it does differently were super easy to adapt to."
23:11:18*heinrich5991 quit (Ping timeout: 246 seconds)
23:13:59Araqno syntax choice was ad-hoc just because you don't understand it
23:17:21Araqnothing comes close to Python's adhoc rule anyway, "we use nouns for declarations and a three letter abbrev for 'define/definition'"
23:19:13*elrood quit (Quit: Leaving)
23:22:39*bluenote quit (Ping timeout: 260 seconds)
23:25:11*heinrich5991 joined #nim
23:29:20*sendell quit (Remote host closed the connection)
23:29:39FromGitter<Varriount> Araq: To be fair, Nim uses 'proc' for 'procedure'.
23:30:45Araqmy point is not the abbreviation, my point is "what the heck is a 'def'?"
23:31:45Araqthese are called methods or procedures or functions or ... but 'def'? why not 'decl'? and why is it not 'defclass'?
23:33:28AraqI don't mind 'def' but it's certainly "ad-hoc" and Python is full of ad-hoc syntax and rules too.
23:45:49nooniendefine? definition?
23:48:45FromGitter<mratsim> well go uses “fun” which is super weird at first
23:49:06FromGitter<mratsim> wonder if it’s some private joke at Google
23:49:18noonienfunc*
23:49:46FromGitter<mratsim> ah it’s Kotlin that uses fun then
23:49:58vivusafter a while, these things shouldn't matter, unless the syntax becomes syn-tax
23:50:28vivusthe closer to human-readable the better, that is what programming languages are meant for, IMO
23:51:49noonienwell, they're meant to enable a human to tell a computer what he/she wants it to do
23:52:59FromGitter<mratsim> @Araq I got spammed by "Warning: usage of a type with a destructor in a non destructible context. This will become a compile time error in the future. [Destructor]”. Will the new runtime have the same limitations?
23:54:27FromGitter<mratsim> (when I say spam, it’s like 3 screens of template generic instiation + error message)
23:55:11Araqmratsim: no, new runtime does it properly
23:55:23Araqin fact, you should use --newruntime already
23:55:52Araqmratsim: good old ML uses 'fun' too
23:58:31noonieni bet that was their idea to make programming more entertaining, probably got old fast