<< 24-04-2017 >>

00:39:23*cspar quit (Ping timeout: 252 seconds)
00:41:44nchamberslibman: to be fair, nim macros are based on lisp
00:52:22ldleworkbased on lisp, or happen to be similar?
00:54:02nchambersI thought I remembered Araq telling me they were based on lisp's, but I could be mistaken
00:54:09nchambersI know he really really likes lisps though
01:05:13libmanYou could have told me they're based on the Bhagavad Gita and I'd believe it. Parts of Nim too far away from Python are all Sanskrit to me. ;)
01:08:34*cspar joined #nim
01:10:10libmanThe vast majority of books in AZ's "Lisp Programming" category are either about genuinely Lispy languages (Common Lisp, Scheme, Clojure(Script), Racket, etc) or general programming topics (including The Holy SICP).
01:15:14libmanOr Emacs of course. There I found a couple of Functional Python / Perl books in that AZ "Lisp Programming" category's Top 100, but that seems more fitting that "Nim In Action". We should invade the Python category instead.
01:17:44libmanThe "#1 New Release in Lisp Programming" right below the title could mislead some people - https://archive.is/1QI5p#selection-4926.0-4937.16
01:20:17libmanIf you scroll down, it also mentions the book being in "Ruby" and "Object-Oriented Software Design" categories. I'm not complaining, just wondering if that's an accident.
01:26:12ldleworkA post I made about my experience in VR this weekend, https://www.reddit.com/r/oculus/comments/67605m/i_had_a_very_social_vr_weekend/
01:30:45*deech` quit (Ping timeout: 240 seconds)
01:36:50*chemist69 quit (Ping timeout: 255 seconds)
01:40:05*cspar quit (Ping timeout: 240 seconds)
01:49:18*vlad1777d quit (Quit: Leaving)
01:51:07*chemist69 joined #nim
02:02:35*cspar joined #nim
02:07:54zachcarterI got pretty far with karax before needing ajax, and then I hit a wall
02:37:21*krux02 quit (Remote host closed the connection)
03:06:27*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:24:18*yglukhov joined #nim
03:28:53*yglukhov quit (Ping timeout: 255 seconds)
03:37:28*krux02_ quit (Remote host closed the connection)
03:51:32*zachcarter quit (Quit: zachcarter)
04:09:32*cspar quit (Ping timeout: 240 seconds)
04:22:07FromGitter<Varriount> zachcarter: What's the wall?
04:40:28*BennyElg quit (Remote host closed the connection)
04:40:31shashlickNim crashes if I use a channel without opening it, honest mistake but it just crashes without a stack trace
04:59:08*adeohluwa joined #nim
05:11:22*BennyElg joined #nim
05:30:04BennyElgguys httpclient and ssl
05:30:06BennyElgis it possible?
05:30:07*rauss quit (Quit: WeeChat 1.7)
05:40:15*xet7 joined #nim
05:44:58BennyElgI need to download files from google drive
06:03:53def-BennyElg: yeah, compile with -d:ssl
06:04:13BennyElgYea I did it it worked but Still struggle download files from google drive.
06:04:37BennyElgprobably an Auth failures I'll try to figure it out.
06:09:36*BennyElg quit (Remote host closed the connection)
06:10:11*BennyElg joined #nim
06:10:15*BennyElg quit (Read error: Connection reset by peer)
06:37:30*BennyElg joined #nim
06:46:43*nsf joined #nim
06:58:12*Vladar joined #nim
07:09:17BennyElghow do I connect google account from NIM
07:15:05*cspar joined #nim
07:24:16*rokups joined #nim
07:29:55FromGitter<Varriount> BennyElg: What do you mean?
07:30:22BennyElgI have a shared google drive folder , I need to download the files inside
07:32:08*gokr joined #nim
07:34:21*yglukhov joined #nim
07:37:44*delian66 joined #nim
07:39:03*adeohluwa quit (Quit: Connection closed for inactivity)
07:42:45*adeohluwa joined #nim
07:50:57FromGitter<Varriount> Are you able to make the files public?
07:51:20*bjz joined #nim
08:03:06BennyElgI cant do it public.
08:05:54BennyElgBut I suppose to login into my account which is authorized to download anything.
08:21:07*libman quit (Quit: Connection closed for inactivity)
08:23:14*Arrrr joined #nim
09:05:31FromGitter<TiberiumPY> Oh, it's not that easy
09:05:56FromGitter<TiberiumPY> There's no support for storing cookies in httpclient
09:11:32BennyElgYa I notice that
09:11:37BennyElgvery annoying
09:12:18chemist69Just plugged Nim here: https://www.linuxvoice.com/voice-of-the-masses-whats-your-favourite-programming-language/
09:12:27*vlad1777d joined #nim
09:12:43*BennyElg quit (Remote host closed the connection)
09:13:09*BennyElg joined #nim
09:17:32*BennyElg quit (Ping timeout: 240 seconds)
09:26:02*BennyElg joined #nim
09:48:48*couven92 joined #nim
10:00:17*sz0 joined #nim
10:10:24*couven92 quit (Quit: Client disconnecting)
10:31:16*zachcarter joined #nim
10:34:28zachcarterxmlhttprequest callbacks are a pain
10:34:49*Tiberium joined #nim
10:51:40zachcartercan’t figure out a good way to have nim functions invoked as callbacks to xmlhttprequests
10:53:56BennyElg:/
10:54:41zachcarterI’ve copied the code Araq has in ajax.nim in karak but it doesn’t seem to work correctly
10:56:15BennyElgI need some examples of ajax.nim to seek for information.
10:57:00zachcartersure
10:57:14zachcarterhttps://github.com/pragmagic/karax/blob/master/src/ajax.nim
10:58:35Araqzachcarter: well it's pretty much untested I'm afraid
10:58:42Araqwhat's wrong with it?
10:58:51zachcarterAraq: callbacks never get invoked
10:58:55zachcartercan’t be found
10:59:12zachcarterAraq: i had a busy weekend, I built a playground for nim and I started on a front end for it with karax
10:59:34Araqwow cool
10:59:37zachcarterdom helped me with the playground
11:02:16zachcartercurl -X POST http://162.243.192.65:80/compile -H 'content-type: application/json' -d '{"code": "echo \"hello world!\""}'
11:02:45*Snircle joined #nim
11:06:25zachcarteralso @Araq another issue with karax : I have trouble importing the modules when I use karax in another project via nimble
11:14:39Tiberiumhmm, I'm porting python gTTS module to Nim, and I wanted to ask - https://github.com/Boudewijn26/gTTS-token/blob/master/gtts_token/gtts_token.py#L61 do I really need to use regexps or it would be fine if I would use a couple of splits?
11:15:53zachcarterhttp://imgur.com/a/QZwbd
11:16:00zachcartermy results so far with karax and spectre css / ace editor
11:16:35zachcarterTiberium: I’d resort to regexs as a last measure, personal advice
11:16:45zachcarterit adds an extra dependency if you want to use the perl like regexes
11:16:45Tiberiumzachcarter, ok
11:16:54TiberiumI can easily do it with splits
11:16:56*krux02 joined #nim
11:17:02*krux02 quit (Disconnected by services)
11:17:02*krux02- joined #nim
11:17:05*krux02- is now known as krux02
11:17:20zachcarterthe regexes are super powerful, but I tried to use them with frag and then all of a sudden I needed extra dlls and windows and such
11:17:20Tiberiumso I would do "a = line.split(r"var a\x3d")[1].split(";")[0]" and "b = line.split(r"var b\x3d")[1].split(";")[0]"
11:17:21*krux02_ joined #nim
11:17:45zachcarterso I just used splits like you’re advocating for
11:17:57zachcartersince my situation was similar in that it could be handled easily with splits
11:18:11zachcarterand then I just ended up using parseconfig and re-wrote the thing that generates the file
11:18:27TiberiumI don't want to use regexps myself, because I don't know them and they needs to be ported for nim's re module
11:18:36Tiberium(from python regexps)
11:18:44zachcarterbtw don’t use re
11:18:45zachcarteruse nre
11:19:03*adeohluwa quit (Quit: Connection closed for inactivity)
11:19:20zachcarterporting the regexs should be relatively trivial, but if you don’t know regex heh that’s going to make things complicated :P I think you have the right approach here
11:20:31*arnetheduck joined #nim
11:23:33BennyElgvar nxr = ajax.newXMLHttpRequest()
11:23:33BennyElgvar x = ajax.open(nxr, "GET", "address")
11:23:35BennyElgwhat is wrong :
11:26:33zachcarterBennyElg nothing there
11:27:13zachcarterhttps://github.com/pragmagic/karax/blob/master/src/ajax.nim#L25
11:27:14zachcarterit’s that
11:28:48zachcartersorry BennyElg if I interrupted what you. I mistook what you were typing for Nim not JS :P
11:28:54zachcarterinterrupted you*
11:29:39BennyElgI'm trying to fetch the source code from some site and parse it ( In python I would you Machanize / requests and BeautifulSoup)
11:31:41TiberiumBennyElg, why are you using ajax? is it JS? or Nim?
11:32:01Tiberiumyou want to write code for JS backend?
11:32:07BennyElgsince i get an error when I try with the http client I get not supported js
11:32:46BennyElgThe site is not delivered properly its says I should enable the js
11:32:46TiberiumBennyElg, it would be the same
11:32:54BennyElg:\
11:32:56TiberiumBennyElg, because website depends on JS
11:33:08Tiberiumit means that you need to actually interpret this JS
11:33:16Tiberiummaybe there's selenium for nimlang, I don't know
11:34:05zachcarterTiberium: I’m using ajax in my karax project for the nim playground I built
11:34:16Tiberiumzachcarter, because you're doing JS backend?
11:34:21Tiberium*for
11:34:43zachcarterno I wrote a nim backend
11:35:10zachcarterhttps://github.com/zacharycarter/nim-playground
11:35:36Tiberiumzachcarter, I mean karax is using JS backend probably
11:35:42zachcarteroh yes exactly
11:37:15zachcarterI think I’m going to use https://github.com/tachyons-css/tachyons instead of spectre-css
11:40:52*krux02 quit (Remote host closed the connection)
11:40:59*krux02_ quit (Quit: Leaving)
11:42:07FromGitter<couven92> Araq: what about my `vccexe` PR (https://github.com/nim-lang/Nim/pull/5575)? You said it was hard to review, and I have followed your suggestions to simplify... But was there anything more you wanted me to do with it?
11:49:03FromGitter<dom96> zachcarter: tachyons looks a bit fragmented
11:49:19zachcarterhrm :/
11:49:26FromGitter<dom96> What's wrong with spectre?
11:49:54zachcarterI just kind of liked the compositional and post css aspects of tachyons
11:49:58FromGitter<dom96> also, you should add support for JSONP to your backend
11:50:08zachcarterokay I’ll figure out how to do that and do that today
11:50:24zachcarterI’m kind of stalled on the front end until the ajax stuff gets figured out
11:50:31zachcarterunless I want to write a bunch of JS which I don’t :P
11:50:32FromGitter<dom96> or you can just create your own AJAX requests
11:50:36FromGitter<dom96> it shouldn't be too hard
11:50:51zachcarterI am but the callbacks are the issue
11:51:10zachcarterI’m using emit to create them
11:51:16FromGitter<dom96> Just look at how it's done in JS and copy it
11:51:28zachcarterthats’ basically what I’ve done but the problem is scoping
11:51:45zachcarterdom96: here - https://github.com/pragmagic/karax/blob/master/src/ajax.nim#L25
11:52:09zachcartercontwrapper won’t be found
11:53:11FromGitter<dom96> Well I'm at work now so can't help much
11:53:24zachcarternp
11:53:57FromGitter<dom96> But i would wrap the JS procs instead using so much emit.
11:54:09zachcarterokay I’ll try that
11:54:27zachcarterthx for the pro tip
11:56:18FromGitter<stisa> Zachcarter, I wrote an ajax wrapper some time ago, maybe you can try using that?
11:56:29zachcarterjust found it stisa :P I’m on it :D
11:56:38zachcarterhoping I wont’ run into namespace collision but about to find out
11:57:38*couven92 joined #nim
11:58:03zachcarteryeah ns collisions hrm
11:58:58zachcarterI just deleted ajax.nim from karax for now :P
12:02:11ftsfo/
12:02:22ftsfhowdy zachcarter, dom96
12:02:38zachcartero/ ftsf
12:04:43ftsfyou're playing with nim -> js ?
12:05:34zachcarteryup! playing with karax
12:47:52*krux02 joined #nim
12:54:53zachcarterhttp://imgur.com/a/9mwCL
12:54:54zachcarterwork time
12:56:09Tiberiumzachcarter, a small suggestion: flush compiler log on every new compilation :)
12:56:22Tiberium( i mean on web page)
12:56:55TiberiumI mean to clear compiler log
12:57:52zachcarterTiberium: will do :) thank you
12:58:08*bjz quit (Ping timeout: 255 seconds)
12:58:24*bjz_ joined #nim
13:02:19*zachcarter quit (Quit: zachcarter)
13:02:26*antranigv quit (Ping timeout: 252 seconds)
13:02:55*antranigv joined #nim
13:04:15*PMunch joined #nim
13:09:49*antranigv quit (Ping timeout: 260 seconds)
13:15:18PMunchHmm, trying out karax and I have some issues
13:15:23PMunchI ran nimble install in karax root
13:15:30PMunchWhich seems to have worked fine
13:15:51PMunchBut when I try to run "nim js karax" it complains that it can't find vdom..
13:15:53*krux02 quit (Remote host closed the connection)
13:15:58couven92Araq, PMunch just informed me that people are having trouble with the windows release, because `vccexe` is not included in the release, and as I desribe in https://www.reddit.com/r/nim/comments/66jz7n/the_quest_for_vccexe/dgoiuto/ it is kinda annoying to build `vccexe` without the MinGW backend...
13:17:10couven92I'll modify the Windows instructions with more information on the only Windows/VCC-only scenario
13:20:43Tiberiumwow, github organization is so easy to setup
13:20:56Tiberiumyou only need a keyboard and mouse :D
13:21:00Tiberiumno console required
13:24:07*antranigv joined #nim
13:24:24PMunchWhat're you setting up an organization for?
13:30:58*PMunch quit (Quit: leaving)
13:32:10*PMunch joined #nim
13:38:08*vlad1777d quit (Ping timeout: 258 seconds)
13:41:53FromGitter<zacharycarter> B:
13:43:02*nsf quit (Quit: WeeChat 1.7)
13:45:14*antranigv quit (Ping timeout: 268 seconds)
13:46:11*zachcarter joined #nim
13:46:18FromGitter<zacharycarter> Oops
13:50:13FromGitter<edlich_twitter> Can someone tell me how to assign multiple values in an array slice? like myarr[2..4] = 42 if this is declared: myarr: array[0..20,int] ?! (I got type mismatch)
13:55:40Araqmyarr[2..4] = [42, 42, 42] you're better off with a macro for this
13:57:07flyxthere's also myarr[2..4] = repeat(42, 3)
13:57:23FromGitter<edlich_twitter> oh repeat is cool thanks!!
13:57:32flyxit's in sequtils
13:57:52flyxit's not the most efficient method though
13:58:14FromGitter<edlich_twitter> ok I check performance later ;-)
13:59:12*vlad1777d joined #nim
14:09:30PMunchHmm, repeat could be implemented as a macro
14:10:11flyxonly if the number of components is known at compile time
14:10:15PMunchI wrote a simple macro to generate a set of points that make up a circle with certain parameters to save doing it on runtime
14:10:20PMunchflyx, that's true
14:10:44PMunchIs there a way to define a macro with a procedure fallback?
14:11:12flyxI guess you can overload it, the macro with a int{lit} parameter, the proc with a normal int parameter
14:13:35flyxbut I tried that once and got a compiler error
14:20:30flyxPMunch: this works: https://gist.github.com/flyx/0c98d205c96c84279ce2ae4f20a8225f
14:23:51*Arrrr quit (Ping timeout: 260 seconds)
14:26:36PMunchHmm, that's only for literals though..
14:26:44PMunchWould it be possible to overload with static?
14:27:34PMunchie. have the macro be macro repeat(value: untyped, num: static[int]): untyped
14:27:54PMunchAnd the proc be: proc repeat(value: untyped, num: int): seq[T]
14:29:03FromGitter<Varriount> PMunch: might work
14:29:20flyxno, it always calls the proc
14:29:23flyxbut I don't know why
14:29:33PMunchHmm, that's strange
14:29:37flyxit works if the proc does not exist, but only for the first call (obviously)
14:30:11flyxAraq can probably shed some light on this, perhaps it's a bug
14:30:50*BennyElg quit (Remote host closed the connection)
14:31:15flyxI wonder why static is a special type and not just a constraint, like {static}
14:31:17*BennyElg joined #nim
14:32:19Araqyeah, it should have been a constraint
14:32:54Araqbut it also affects macro usage, in a macro a param: static[int] is an int, not a NimNode with kind == nnkIntLit ...
14:33:32AraqI'm not sure why untyped matches worse than 'T', it shouldn't
14:34:11Araqthat said, it's all a bit misguided code, use TR template/macro to optimize it away properly
14:34:56Araqoverloading is to enable compiletime polymorphism, not optimizations
14:35:41*BennyElg quit (Ping timeout: 260 seconds)
14:39:08PMunchSo a template that either calls the macro or the proc?
14:39:35flyxAraq: this still calls the proc both times: https://gist.github.com/flyx/0c98d205c96c84279ce2ae4f20a8225f
14:40:30PMunchWhat's that syntax flyx?
14:40:44flyxterm rewriting syntax, as Araq suggested
14:41:17PMunchOh
14:41:34flyxit works with int{lit} as expected
14:43:47Araqyeah, static T is still a piece of junk tbh
14:44:18Araqand its spec repeats lots of C++'s mistakes
14:44:34PMunchHmm, in the examples above. Is Nim able to see that a=3 on compile-time?
14:44:54PMunchAraq, so it should be rewritten?
14:45:02PMunchLike a constraint?
14:45:52AraqPMunch: var a = 3 is not a constant
14:46:49PMunchYeah I know, but I was wondering if Nim was able to see if it didn't actually change
14:46:55PMunchBut I guess that would be weird
14:47:08Araqit's not hard to detect this in an optimizer, but we don't
14:47:27Araqalso, this is not what I meant
14:49:46*McSoFake joined #nim
14:51:40flyxif static[T] would be merged into constraints, would the problems go away?
14:55:08zachcarterAraq: suggestion for karax
14:55:27zachcartermaybe remove the ajax source file and instead allow users to use : https://github.com/stisa/ajax
14:55:57Araqflyx: I added another comment what should be possible
14:56:01Araqbut isn't ...
14:58:21Araqzachcarter: but karax needs its own version so that it calls 'redraw' for you
14:58:38Araqlet's just fix my ajax.nim instead.
14:58:42zachcarterokay
14:59:08AraqI could rename the module to kajax though to avoid name clashes
14:59:30zachcarterprobably wouldn’t hurt
14:59:40Araqwe have path disambiguation for that but ok
14:59:40zachcarterI can add the required wrappers when I get home tonight
14:59:59zachcarterif you don’t get around to it first
15:00:29*couven92 quit (Quit: Client disconnecting)
15:01:09Araqseems easy to fix, ajax.setRequestHeader is wrong
15:01:33Araqoh no hmmm
15:01:58PMunchOh Araq, about Karax
15:02:21PMunchMy Nim 0.16.1 complains that it can't find vdom after I ran nimble install
15:02:53zachcarterPMunch: it looks like a fix just got commited for taht
15:02:55zachcarterthat*
15:02:57zachcarterI’d try reinstalling karax
15:03:04Araqyup
15:03:06PMunchOh okay
15:03:11PMunchI'll try that soon
15:03:16PMunchBut now I've got to go
15:03:16*PMunch quit (Quit: leaving)
15:04:01Araqcan we also divert more from the DOM? cause it makes no sense ... <input type="button"> wtf, that should be <button>
15:05:11flyxAraq: well, my question was rather since there are problems with static[T], would it make sense to implement it via constraints because that seems to do better with type checking. I imagine that this could lead to fewer code in the compiler.
15:06:04Araqflyx: yes, that would be really nice and there is no reason it wouldn't work
15:08:32*couven92 joined #nim
15:09:32Araqzachcarter: got some snippet for me to test ajax.nim?
15:09:59Araqcouven92: yeah, I know, release 0.17 will fix that and there are only ~3 bugs left before it should be ready
15:10:44couven92ok... I have written up a VCCEXE only installation instructions now
15:11:08flyxAraq: can you give me a pointer where static[T] is implemented? I'm interested in trying to implement it as pattern. I found the pattern matching in the compiler, the static[T] is harder to find
15:11:22couven92I have forked the website already, was planning on submitting a PR later today :)
15:12:13Araqflyx: it's tyStatic in the compiler, most of the lifting is done in sigmatch.nim and perhaps semtypes.nim
15:12:31flyxokay, I'll check it out
15:13:23Araqflyx: great, I can give you more specific instructions
15:13:59zachcarterAraq: I can write one
15:14:03zachcarterone sec
15:14:22*Arrrr joined #nim
15:14:26flyxAraq: one question is whether it is possible to keep the macro semantics (i.e. direct value instead of NimNode)
15:14:49Araqflyx: yeah, pretty sure that works out too
15:15:47flyxbut I want to have matching working before I try that
15:17:22Araqyeah that's simple, just make the matching ignore nkHiddenAddr and nkHiddenStdConv
15:17:34Araqthere should be logic for that already
15:17:56flyxsince I'm still at work, I will probably come later with questions
15:22:48*nsf joined #nim
15:23:30zachcarterAraq: https://gist.github.com/zacharycarter/3b5fb4df4b4bf795422eacdc079f358b
15:24:44*BennyElg joined #nim
15:41:27*krux02 joined #nim
15:42:15*Nopply quit (Read error: Connection reset by peer)
15:43:28*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:44:04Araqzachcarter: fixed.
15:44:10zachcartersweet!
15:44:34Araqthings work better without .emit ;-)
15:44:40*adeohluwa joined #nim
15:44:40zachcarterhaha yeah
15:45:39zachcarterdo you care if I add ajaxPost ?
15:48:39AraqI think PUT should have been POST
15:49:07couven92https://github.com/nim-lang/website/pull/28 PR with `vccexe` build instructions... (Until we ship with `vccexe`)...
15:49:13*antranigv joined #nim
15:49:56Araqzachcarter: fixed
15:50:02zachcarterthank you Araq
15:50:38Araqideally I would like to have send/recv and move away from this strange thing called HTTP
15:50:57zachcarterwould be sweet
15:51:18zachcarterI’m going to put up the front end to the service I wrote tonight, and get it working with JSONP
15:51:45zachcarterand whenever interest arises to expose it somewhere we can just set up DNS entries
15:51:55Araqbut abstractions don't work well with these web standards, IMHO
15:54:07*BennyElg quit (Ping timeout: 240 seconds)
16:12:34*BennyElg joined #nim
16:41:00demi-Araq: i have a stdlib question; would you consider accepting a PR on ospaths that would provide a method for normalizing a given path? I ran into a bug regarding this in nimble and when i was fixing it found that it implemented its own methods for normalizing a path (was surprised this wasn't part of a stdlib module)
16:48:57*devted joined #nim
16:55:06*brson joined #nim
17:17:13*yglukhov quit (Remote host closed the connection)
17:27:13Tiberiumwow, I had two nimble requirements (strfmt and colorize), and easily changed them to stdlib
17:27:35TiberiumI didn't really thought that "terminal" colors is so easy to use
17:48:11zachcarterAraq: I get the following error with the latest karax when using events -
17:48:34zachcarterError: ambiguous identifier: 'Event' --use dom.Event or dom.Event
17:48:40shashlicknim crashes if -d:release but works fine with -d:quick, no -d
17:48:56zachcartershashlick check for asserts
17:49:03*adeohluwa quit (Quit: Connection closed for inactivity)
17:49:03zachcarter-d:release removes them
17:51:38krux02Tiberium: hmm I am thinking to remove standard echo with strfmt, because I really like that package
17:52:07Tiberiumkrux02, I like it too, but I used strfmt's interp literally in 3 strings only
17:52:21TiberiumI mean only in three strings
17:53:44krux02ok then the dependency is really not necessary
17:54:06krux02I hope though that the best string library (strfmt at the moment) get's into standard nim before 1.0
17:54:20krux02the current string printing system really allocates a lot of stuff
17:54:41krux02doesn't matter that much for things that are actually printed, but it can be done better
17:55:02krux02but anyway it's not a priority and I have to go
17:55:13*krux02 quit (Remote host closed the connection)
17:55:21*yglukhov joined #nim
17:55:35*couven92 quit (Quit: Disconnecting)
17:59:55*yglukhov quit (Ping timeout: 268 seconds)
18:05:03*Trustable joined #nim
18:06:32*adeohluwa joined #nim
18:12:24shashlickfor some reason, -d:release doesn't let me open any audio devices using BASS.dll, whereas -d:quick or debug works just fine
18:13:48Tiberiumshashlick, maybe -d:release optimizes away some variables?
18:16:14shashlickTiberium: how would I find out?
18:16:50*Matthias247 joined #nim
18:17:02Tiberiumshashlick, ¯\_(ツ)_/¯ I don't really know the real reason, I'm not an experienced dev in Nim :)
18:18:04*PMunch joined #nim
18:21:37shashlicksame issue with having to use stdcall - have to use every proc within BASS with stdcall, else it crashes somewhere or the other
18:21:57dom96shashlick: I hope you know that you can {.push stdcall.}
18:22:06dom96instead of annotating every proc with {.stdcall.}
18:22:29dom96Remember that all assert calls are optimised away in -d:release
18:22:33shashlickwhere would I put that? just globally in the file
18:22:50dom96yeah
18:26:14shashlickneat, starting to love these pragmas
18:29:29Tiberiumdom96, really? you can do that? lol
18:29:38dom96yep
18:32:23PMunchHmm, with the newest version of Karax I don't get the missing vdom error. But now I have another issue
18:32:30PMunchcomponents.nim(58, 17) Error: index out of bound
18:33:32Tiberiumwhat? https://nim-lang.org/0.11.0/redis.html redis library was in stdlib?
18:45:04PMunchHmm, x is of len 1
18:45:18PMunchWhich is weird since it's supposed to be a rather long enum by the looks of it
18:49:00*TheLemonMan joined #nim
18:52:20dom96Tiberium: yep
18:52:27dom96before Nimble's time :)
18:58:40Tiberiumhow can I fix a problem in nimongo library: it tries to do max() with two uint32's
18:58:50Tiberiumhttps://github.com/SSPkrolik/nimongo/blob/master/nimongo/pbkdf2.nim#L140
19:02:37*rauss joined #nim
19:18:59Tiberiumanyone knows how to enable auto-completion in https://github.com/pragmagic/vscode-nim/ ?
19:21:13*Sembei joined #nim
19:21:44*vivus joined #nim
19:23:20*Pisuke quit (Ping timeout: 260 seconds)
19:24:10*cspar_ joined #nim
19:24:41*Ven joined #nim
19:25:05*Ven is now known as Guest50256
19:25:56*cspar quit (Ping timeout: 240 seconds)
19:26:58*Arrrr quit (Quit: Leaving.)
19:27:43*bjz joined #nim
19:29:04Tiberiumoh wait
19:29:07Tiberiumwhat the heck?
19:29:21*vendethiel joined #nim
19:29:24Tiberiummy "nimsuggest" is showing that it is a compiler, not an actual nimsuggest
19:37:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
19:42:44PMunchAh, never mind. Just updated my Nim to the latest devel version (from an older 0.16.1 devel version) and now it compiles.
19:45:03*Tiberium quit (Read error: Connection reset by peer)
19:45:21*Sentreen quit (Ping timeout: 258 seconds)
19:45:29*Tiberium joined #nim
19:45:42Tiberiumoh FINALLY
19:45:48TiberiumI GOT IT f*ckin working
19:46:06Tiberiumit seems that I had another system nim installed
19:47:32*Guest50256 quit (Ping timeout: 240 seconds)
19:50:31PMunchHaha, yeah that complicates things :P
19:51:01PMunchOne of the first things I do when stuff fails with strange errors is a "nim -v"
19:51:11zachcarterPMunch: you got karax working?
19:52:37TiberiumPMunch, you know, I programmed in Nim without basic auto-completion. So at least I've learned more :D
19:52:44Tiberiumbecause I had to memorize every name
19:52:53PMunchzachcarter, yeah got it working fine :)
19:52:57PMunchReally cool project
19:53:10PMunchTiberium, that's how I roll
19:53:17zachcarterPMunch: Are events working for you?
19:53:25PMunchEvents?
19:53:26zachcarterI’m getting errors when I try to set up an event handler
19:53:38zachcarterhere please try compiling this
19:53:44PMunchEverything seems to be working in both the mediaplayer and the todolist
19:53:51PMunchBut that's what I've tried :P
19:54:01zachcarterhttps://gist.github.com/zacharycarter/eeadf3d21267dcd56f4abc1bda9212a9
19:54:09zachcarterah I’m using it from another project
19:54:13zachcartererr in another project
19:54:16zachcarterand that code is failing to compile
19:55:24PMunchtest.nim(22, 15) Error: Error: ambiguous identifier: 'Event' --use dom.Event or dom.Event
19:55:25PMunchHmm
19:55:32zachcarteryeah that’s the error I get too
19:56:14PMunchReally strange error :P
19:56:20zachcarteragreed
19:56:27zachcartergoing to need help from Araq on this one prob
19:56:43PMunch Error: type mismatch: got (VNode, EventKind, proc (ev: Event, n: VNode){.noSideEffect, locks: <unknown>.} | proc (my: var JsonParser){.gcsafe, locks: <unknown>.})
19:56:43PMunchbut expected one of:
19:56:43PMunchproc addEventHandler(n: VNode; k: EventKind; action: EventHandler)
19:56:52PMunchGot that one when I actually changed to dom.Event
19:57:00zachcarteryeah
19:57:01FromGitter<stisa> zachcarter: karax exports dom.Event from its own dom.nim , you are reimporting dom from stdlib, so it gets two different dom.Event Use ``import dom except Event``
19:57:24*krux02 joined #nim
19:57:30PMunchThat compiles
19:57:31zachcarteryay stisa! thank you!
19:57:35*Sentreen joined #nim
20:04:46PMunchThis localstorage is also really cool
20:04:54PMunchNever really used localstorage for anything :P
20:05:44*Ven_ joined #nim
20:08:29PMunchHmm, would it be nicer for karax to create the barebones .html file on compiletime?
20:08:55PMunchThen you would only use the HTML DSL and Nim :)
20:09:02PMunchWell, plus CSS
20:10:39*gokr quit (Ping timeout: 268 seconds)
20:10:51PMunchHmm, and shouldn't the -d:release flag also minify the JS output?
20:11:26FromGitter<stisa> PMunch : That would be nice, I don't think the current js backend does minification though.
20:11:38Tiberiumwow, I found a bug in async macro
20:11:42PMunchDoesn't look like it
20:11:54PMunchBut it did really make it smaller
20:12:18*rokups quit (Quit: Connection closed for inactivity)
20:12:19FromGitter<stisa> Probably stripped some debug things
20:14:44*throwaway3859 joined #nim
20:14:57throwaway3859How do i convert an open array of floats to an array of float32s?
20:15:10PMunch59K --(-d:release)--> 39K --(minified)--> 21K
20:15:24Tiberiumstrange magic https://github.com/nim-lang/Nim/issues/5754
20:16:48PMunchHmm
20:17:17Tiberium(this is not bad for me, since it's just matter of brackets)
20:17:30Tiberiumbut as a good user, I reported it
20:18:08dom96Tiberium: thanks :)
20:18:30dom96Although I think I will slowly deprecate the 'try' transformation
20:19:05Tiberiumdom96, what do you mean? we will not able to use await's in try/except ?
20:19:13dom96indeed
20:19:34dom96or maybe only in very simple cases
20:19:40Tiberiumoh, is there another ways? because this would result in creating temporary variables
20:20:13Tiberiumor yield will work?
20:23:22dom96You will need to do something like this: var fut = doSomething(); if fut.failed: echo("Handle error here")
20:23:32dom96oh, and `yield fut` after the var defintion
20:23:58Tiberiumah, I'm already using this, I mean if I would need to use try: on some usual object (not future), and do some await call in except
20:24:03Tiberiumlike send error message to user
20:24:36Tiberiumor I can make ALL proc's as {.async.} ?
20:24:40Tiberiumif my app is async
20:26:38*Vladar quit (Quit: Leaving)
20:26:53dom96you shouldn't do that
20:34:25shashlickI just built Nim from sources on Windows - how do I keep this up to date? just git pull on \Nim and then rebuild koch followed by koch boot?
20:34:45Tiberiumshashlick, you don't need to rebuild koch
20:34:50Tiberiumonly nim itself
20:35:52shashlickdoes the installer you download from the website contain the git repo info so i can just download that and keep it up to date with git/koch?
20:36:25Tiberiumshashlick, installer for windows is deprecated
20:36:40shashlicksorry, I meant the ZIP
20:37:38Tiberiumshashlick, I think it doesn't, but you can always check yourself if there's ".git" folder
20:38:23throwaway3859Are sequencens always allocated continously, and what does seq.addr point to?
20:41:45shashlickTiberium: thanks
20:45:35krux02how does nim link libX11.so?
20:46:27shashlickthe dlls.zip doesn't include zlib?
20:46:31*Ven_ quit (Ping timeout: 260 seconds)
20:49:13*Ven joined #nim
20:49:36*Ven is now known as Guest31321
20:53:25*Tiberium quit (Remote host closed the connection)
20:54:12PMunchWarning: a [b] will be parsed as command syntax; spacing is deprecated
20:54:18PMunchWhat does this warning mean?
20:54:30PMunchI'm getting it all the time and it's a bit annoying..
20:54:31throwaway3859you are passing [b] to a
20:54:46throwaway3859as far as i understand
20:55:00PMunchdiscard staticExec ("
20:55:06PMunchHad an extra space in that
20:55:14PMunchstaticExec(" works fine
20:55:36throwaway3859I really love stuff like withFile <3
20:55:37PMunchSo it's a space after the function name but before the argument list that seems to cause it
20:55:50PMunchwithFile?
20:56:17throwaway3859a template
20:56:34PMunchAh right
20:58:09throwaway3859Why does it return the `typed` meta-type?
20:59:13*Guest31321 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:00:27*Trustable quit (Remote host closed the connection)
21:00:41*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
21:03:01*zachcarter quit (Ping timeout: 260 seconds)
21:08:37*krux02 quit (Ping timeout: 260 seconds)
21:09:23PMunchHmm Araq, would it be possible for the "Error: attempt to access a nil address" to name the variable that is nil?
21:18:21PMunchUhm, I just got this: lib/system.nim(2562, 7) Error: cannot generate VM code for asm " var len = "x
21:18:31PMunchThat doesn't look good..
21:22:59federico3dom96: any tip on how to write procs that can be used both in async and sync code, if it's possible?
21:23:51FromGitter<dom96> Yes, using the multisync macro. See how httpclient is implemented
21:24:16*krux02 joined #nim
21:28:42federico3dom96: thanks!
21:29:02*adeohluwa quit (Quit: Connection closed for inactivity)
21:29:14*rauss quit (Quit: WeeChat 1.7.1)
21:33:17PMunchHmm, can I use karax' buildHTML to make a HTML string?
21:33:38throwaway3859Is it a good idea to name functions after build-ins? I would like to say vertexBuffer.bind()
21:36:23shashlickupdate script for Nim - git pull origin master;
21:36:23shashlicknim c koch
21:36:23shashlick; koch boot -d:release
21:36:23shashlick; koch nimble;
21:36:24shashlickkoch tools
21:36:51shashlickanything i'm missing?
21:37:03shashlickdidn't expect that to come on separate lines, sorry
21:37:26FromGitter<TiberiumPY> koch tools -d:release
21:37:29FromGitter<TiberiumPY> Maybe
21:37:36FromGitter<TiberiumPY> And add nimsuggest too
21:37:56*McSoFake quit (Quit: leaving)
21:39:21PMunchthrowaway3859, well it depends
21:39:41PMunchI tend to name them after built-ins if they perform the same function for a new type
21:39:54throwaway3859i guess i go with bindBuffer() then
21:40:10throwaway3859but i really like that one can do `type` stuff
21:40:31PMunchYeah, that's a neat feature
21:41:19throwaway3859the neat part is that its zero cost at runtime
21:44:04*nsf quit (Quit: WeeChat 1.7)
21:47:34*nchambers left #nim ("Leaving")
21:50:59PMunchhttp://ix.io/rHQ
21:51:05PMunchLittle experiment
21:51:23PMunchTo remove the html file from the todoapp
21:51:29*throwaway3859 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
21:51:46PMunch(Changes at the bottom)
21:59:14FromGitter<stisa> Pmunch: doesn't writefile work in a static block?
21:59:26PMunchNot with the js target apparently
21:59:51PMunchhttps://github.com/nim-lang/Nim/issues/3124
21:59:54PMunchAccording to that
22:00:05PMunchDidn't actually try it :P
22:00:40shashlickTiberiumPY: looks like koch tools does nimsuggest as well
22:02:16*Sentreen quit (Ping timeout: 268 seconds)
22:03:30FromGitter<stisa> pmunch uh strange, but I don't know enough about how `static` works to guess why
22:03:53PMunchYeah, me neither. But that workaround works fine for this example
22:04:01PMunchAt least on Linux..
22:06:32*devted quit (Quit: Sleeping.)
22:08:59PMunchIs it possible to get the name of the output file during compile-time?
22:15:05*Matthias247 quit (Read error: Connection reset by peer)
22:15:26*Sentreen joined #nim
22:16:57*zachcarter joined #nim
22:34:23FromGitter<Varriount> PMunch: Not that I know of.
22:34:55FromGitter<ajusa100_twitter> does anyone here know nimx?
22:39:19*libman joined #nim
22:42:02*vivus quit (Quit: Leaving)
22:43:41*krux02 quit (Remote host closed the connection)
22:43:52*krux02 joined #nim
22:44:25*krux02 left #nim (#nim)
22:44:30FromGitter<Varriount> @ajusa100_twitter What's your question?
22:44:53FromGitter<ajusa100_twitter> I am trying to get input from a list of buttons, that are stored in a sequence
22:45:12FromGitter<ajusa100_twitter> however, there is no way for me to deduce from which button I am getting an input from
22:45:39FromGitter<ajusa100_twitter> I only started using it today, so I haven't read through all of the code, but I have looked through the tests
22:46:49FromGitter<Varriount> @ajusa100_twitter Why are you storing them in a sequence?
22:47:01FromGitter<Varriount> I mean, rather than each in a seperate variable.
22:47:11FromGitter<ajusa100_twitter> I have a dynamic list of buttons
22:47:19FromGitter<ajusa100_twitter> they are generated based on a webscraper
22:49:09FromGitter<Varriount> @ajusa100_twitter I haven't used NimX, how are button events generated? Do you attach a callback to the button, or are events sent down some sort of pipeline?
22:49:20FromGitter<ajusa100_twitter> you attach a callback
22:49:42FromGitter<ajusa100_twitter> ~~~ ⏎ movies[i].button.onAction do(): ⏎ ~~~
22:50:00FromGitter<Varriount> @ajusa100_twitter Are you able to tell me if the callback has the 'closure' calling convention?
22:50:26FromGitter<ajusa100_twitter> um, I don't know what that means. I hope that my code answers your question?
22:51:01FromGitter<Varriount> @ajusa100_twitter Closures are special functions that can capture variables from outer scope.
22:52:19FromGitter<Varriount> @ajusa100_twitter https://nim-lang.org/docs/manual.html#procedures-closures
22:52:26FromGitter<ajusa100_twitter> Ah okay
22:53:08FromGitter<Varriount> If what you are passing in is a closure (or a procedure being implicitly converted to a closure) then you'll probably want to use the closureScope macro (https://nim-lang.org/docs/system.html#closureScope)
22:53:38FromGitter<Varriount> If you can pass in a closure, you can create a new closure for each button (capture the name or something)
22:54:07FromGitter<ajusa100_twitter> When I tried putting in a var in the do, it gave me an error
22:54:47FromGitter<ajusa100_twitter> I see how a closure would help me
22:55:13FromGitter<Varriount> `do` is just a shortcut to pass in a procedure as a parameter.
22:55:23FromGitter<Varriount> I believe Ruby has something similar
22:59:50FromGitter<Varriount> @ajusa100_twitter Any luck?
23:03:05FromGitter<Varriount> @ajusa100_twitter According to https://nim-lang.org/docs/manual.html#types-procedural-type , the closure calling convention is the standard convention for unmarked procedural types.
23:03:44FromGitter<Varriount> Since https://github.com/yglukhov/nimx/blob/4eee9b0e5d237726041ec3b03ae3cf3fb7bf19c4/nimx/control.nim#L20 has no calling convention pragma, you are indeed submitting a closure.
23:04:14FromGitter<Varriount> So you can capture a variable that distinguishes the procedure.
23:06:26zachcarteranyone have any tips on enabling jsonp for jester?
23:09:55zachcarterhttps://github.com/PeterCxy/typeblog_misc/blob/6e963c4a3b84f1308400e2b90ce89f02807bfdcf/misc.nim
23:09:56zachcarterjust found that lol
23:09:58*Nobabs27 joined #nim
23:13:50FromGitter<ajusa100_twitter> @Varriount , sorry, I was eating dinner. I will read through these links and inform you if anything works. Thanks for the help!
23:18:48FromGitter<ajusa100_twitter> I dont really understand the syntax yet...
23:24:10*PMunch quit (Quit: leaving)
23:26:29FromGitter<Varriount> @ajusa100_twitter What are you confused on?
23:26:40*Sentreen quit (Quit: WeeChat 1.4)
23:26:45FromGitter<ajusa100_twitter> I understand the purpose of a closure
23:26:52FromGitter<ajusa100_twitter> But how do I actually use it in my code?
23:27:10FromGitter<ajusa100_twitter> Sorry if these are stupid questions, but I am pretty new to nim
23:27:44*Sentreen joined #nim
23:29:06FromGitter<Varriount> @ajusa100_twitter What other languages have you used?
23:29:19FromGitter<ajusa100_twitter> Some c, arduino, mostly js
23:29:31FromGitter<ajusa100_twitter> I am 16, so I don't have a ton of experience
23:30:02FromGitter<Varriount> So, are you familiar with scopes (global vs local, etc)?
23:30:04FromGitter<ajusa100_twitter> I wrote a web scraper in Nim, and now I am trying to give it a gui
23:30:05FromGitter<ajusa100_twitter> yes
23:30:11zachcarterdom96: you around?
23:30:58FromGitter<Varriount> @ajusa100_twitter Normally a function has access to two scopes - it's local scope, and the global scope.
23:31:15FromGitter<ajusa100_twitter> okay
23:31:48FromGitter<Varriount> A closure has access to three - global, the local scope of it's parent procedure, and it's own local scope
23:32:02FromGitter<ajusa100_twitter> I understand so far
23:33:09FromGitter<Varriount> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58fe8b3812d2409935955269]
23:34:30FromGitter<ajusa100_twitter> so inner is a closure
23:34:31FromGitter<Varriount> You can use this to pass data into a closure, even if it doesn't accept parameters.
23:35:47FromGitter<ajusa100_twitter> Let me restate part of my question ⏎ ~~~ ⏎ movies[i].button.onAction do(): ⏎ ⏎ ``` echo "clicked"``` ... [https://gitter.im/nim-lang/Nim?at=58fe8bd612d2409935955478]
23:36:13FromGitter<ajusa100_twitter> I want to be able to access movies[i].title for example within the do():
23:36:55FromGitter<ajusa100_twitter> movies is in the global scope
23:37:06*Nobabs25 joined #nim
23:38:24FromGitter<Varriount> Try something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58fe8c738bb56c2d11dc54ff]
23:38:35FromGitter<Varriount> That assumes that 'button' has a 'name' member.
23:39:04FromGitter<ajusa100_twitter> it has a title, but I can work with that
23:39:26FromGitter<Varriount> The 'do()' mechanism creates a procedure from the indented block.
23:39:46*Nobabs27 quit (Ping timeout: 260 seconds)
23:40:39FromGitter<ajusa100_twitter> What this will echo is the last movie
23:40:58FromGitter<ajusa100_twitter> every time, because that is the last button to be set
23:41:50FromGitter<Varriount> No, because a new closure is created for each loop. I think
23:42:04FromGitter<ajusa100_twitter> once the first element has been created, the do() proc is rebound to the new element
23:42:12*Nobabs227 joined #nim
23:42:13FromGitter<ajusa100_twitter> It does echo the last one each time
23:42:27FromGitter<ajusa100_twitter> ~~~
23:42:28FromGitter<Varriount> Hm. I must have used closureScope incorrectly
23:42:33FromGitter<ajusa100_twitter> ~~~ ⏎ for i,m in movies: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=58fe8d6d8bb56c2d11dc579c]
23:42:36FromGitter<ajusa100_twitter> that is my code
23:44:23*Nobabs25 quit (Ping timeout: 240 seconds)
23:44:35*Nobabs227 quit (Client Quit)
23:45:43*Sentreen quit (Quit: WeeChat 1.4)
23:47:29FromGitter<Varriount> Ah, that's because you're using `movies[i]`
23:47:50*bjz joined #nim
23:48:05FromGitter<Varriount> You need to create a variable in the closureScope
23:48:16FromGitter<Varriount> Look at https://nim-lang.org/docs/system.html#closureScope
23:48:53FromGitter<ajusa100_twitter> hey it works now!
23:49:07FromGitter<ajusa100_twitter> :D Thank you so much for the help!
23:50:38FromGitter<Varriount> Why are you doing that, by the way? Can't you just do `for m in movies`?
23:50:57FromGitter<ajusa100_twitter> yeah, I could do it that way
23:51:12FromGitter<ajusa100_twitter> I was doing that because I didn't know how closurescopes worked
23:51:36FromGitter<ajusa100_twitter> so I thought that I would have to use an iterator passed in to the proc to locate the movies
23:51:56FromGitter<Varriount> @ajusa100_twitter If you want a real mindflip, look at the source for closureScope: https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L3710
23:52:20FromGitter<Varriount> :D
23:52:22FromGitter<ajusa100_twitter> I feel really stupid now
23:52:35FromGitter<ajusa100_twitter> Looking at it, I can see it is the same as a closure in JS...
23:52:38FromGitter<Varriount> Nah, scopes for closures are tricky.
23:52:53FromGitter<ajusa100_twitter> Sure it is confusing, but I have ran across it before
23:53:02FromGitter<ajusa100_twitter> thanks!
23:53:51FromGitter<Varriount> Don't count on it. You'll do better if you learn things yourself.
23:54:11FromGitter<Varriount> I'm nearly done with all my classes, and while they are ok...
23:54:35FromGitter<Varriount> I've learned far more by exploring real-world applications on my own.
23:54:51FromGitter<ajusa100_twitter> Yeah, but I have like no time right now. I am in the US, and getting into a competitive college sucks the life out of you. I have stupid AP exams I really should be studying for, but these hobby projects are a lot more fun
23:55:07FromGitter<Varriount> AP Comp Sci?
23:55:12FromGitter<ajusa100_twitter> That too
23:55:36FromGitter<ajusa100_twitter> That is my easiest one by far, read through the book once and I only missed two on the multiple choice
23:55:50FromGitter<ajusa100_twitter> I am taking AP US History, which is death
23:56:03FromGitter<Varriount> Oh gosh, I've heard stories about that one.
23:56:12FromGitter<ajusa100_twitter> yeah. its bad lol
23:56:23FromGitter<Varriount> I never took APUSH myself.
23:56:36FromGitter<ajusa100_twitter> I am doing that and AP Calc BC, AP Stats, and AP Biology all in the same year
23:56:40FromGitter<ajusa100_twitter> I really regret taking APUSH
23:57:23FromGitter<Varriount> Hm. Well, take heart in the fact that you've probably cut out at least 3 classes.
23:57:34FromGitter<Varriount> from your college courses
23:57:58FromGitter<Varriount> I don't know if AP Bio and AP Stat will count for anything though. :/
23:58:14FromGitter<Varriount> Rising senior