<< 22-07-2017 >>

00:05:47*flyhigh joined #nim
00:06:34FromGitter<cyberlis> ok i've made it
00:07:06FromGitter<cyberlis> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5972972a76a757f80834982e]
00:07:20FromGitter<cyberlis> it compiles and works
00:11:20*flyhigh quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
00:11:36FromGitter<cyberlis> but when i add a return type for function, it throws an error during compilation ⏎ `metaprogramming.nim(22, 9) Error: expression 'myFunc(45, 78, ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=597298374bcd78af56d39ed1]
00:12:37*Matthias247 quit (Read error: Connection reset by peer)
00:20:54*yingjun joined #nim
00:23:42PMunchhttps://github.com/PMunch/gtkgenui
00:25:12*yingjun quit (Ping timeout: 260 seconds)
00:30:57*couven92 quit (Ping timeout: 240 seconds)
00:48:37*PMunch quit (Quit: leaving)
00:57:01*deep-book-gk_ joined #nim
00:59:31*deep-book-gk_ left #nim (#nim)
01:05:17*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:39:40*chemist69 quit (Ping timeout: 255 seconds)
01:42:47*v17d quit (Quit: Leaving)
01:53:16*chemist69 joined #nim
02:10:00*yingjun joined #nim
02:16:03*dddddd quit (Remote host closed the connection)
02:16:33*yingjun quit (Ping timeout: 248 seconds)
03:30:17*endragor joined #nim
03:43:12*mahtob joined #nim
03:47:40mahtobhi
03:48:01mahtobi want to install jester
03:48:28mahtobnim has a command to get project-lib from github?
03:48:42mahtobor will i download it and put the under /usr/lib/nim/packages/
03:49:25*endragor quit (Remote host closed the connection)
03:51:08*endragor joined #nim
04:04:34gangstacatmahtob, nimble install jester@#head
04:05:09mahtobah ok +1
04:05:11mahtobwell
04:05:49mahtobhow can i compile this ex
04:05:50mahtobhttp://ix.io/yCX
04:06:29gangstacatnim c -r file.nim
04:07:52mahtobsorry
04:07:52mahtobhttp://ix.io/yCY
04:07:56mahtobthis ex
04:08:11mahtobError: This module only works on the JavaScript platform
04:08:17mahtobit errors this
04:14:12*yingjun joined #nim
04:18:35*yingjun quit (Ping timeout: 240 seconds)
04:25:06*endragor quit (Remote host closed the connection)
04:41:55*endragor joined #nim
04:53:49*Jesin quit (Quit: Leaving)
04:55:12*Jesin joined #nim
05:09:36*SusWombat joined #nim
05:09:46mahtobhttp://ix.io/yCY
05:10:01mahtobhow can we compile this?
05:15:59*jsgrant quit (Read error: Connection reset by peer)
05:19:22*jsgrant joined #nim
05:31:06FromGitter<ephja> mahtob: try 'nim js' instead
05:32:25*jsgrant quit (Remote host closed the connection)
05:33:22mahtobok ephja i tried it
05:33:30mahtobbut doesnt work with -r
05:33:34mahtobit builds
05:33:42mahtobbut cannot run
05:35:09mahtobhttps://ncry.pt/p/c3Dn#2ecwIr5nQZDp7iX9qkFM8fFv-eq-Vj3uvqQcJ3B1YWk
05:35:15mahtobhere is the result
05:37:50*user0 quit (Quit: user0)
05:38:40FromGitter<ephja> mahtob: https://nim-lang.org/docs/backends.html#backends-the-javascript-target
05:39:10FromGitter<ephja> I dunno if running with nodejs works with the DOM. if not then you might have to load it manually via a html file for example
05:39:51FromGitter<ephja> there should be a js file in the nimcache directory. you can output it elsewhere by doing 'nim js -o:<path> <nim_module>'
06:20:28*mahtob quit (Ping timeout: 255 seconds)
06:54:35*dankrad quit (Ping timeout: 240 seconds)
06:56:33*dankrad joined #nim
06:57:29*rauss quit (Quit: WeeChat 1.9)
07:05:35*Trioxin joined #nim
07:08:36*endragor quit (Remote host closed the connection)
07:15:14*yglukhov joined #nim
07:16:22*yingjun joined #nim
07:19:35*yglukhov quit (Ping timeout: 240 seconds)
07:21:37*yingjun quit (Ping timeout: 248 seconds)
07:23:18*v17d joined #nim
07:28:59*couven92 joined #nim
07:38:36*Trustable joined #nim
08:00:01FromGitter<mratsim> Fun programming quotes: https://henrikwarne.com/2016/04/17/more-good-programming-quotes/
08:01:12FromGitter<mratsim> “Give someone a program, you frustrate them for a day; teach them how to program, you frustrate them for a lifetime.” — David Leinweber ⏎ ⏎ “C is memory with syntactic sugar.” — Dennis Kubes ⏎ ⏎ “Any sufficiently advanced bug is indistinguishable from a feature” — R. Kulawiec ... [https://gitter.im/nim-lang/Nim?at=597306484bcd78af56d4db07]
08:01:56*Trioxin quit (Quit: Konversation terminated!)
08:05:39*ShalokShalom joined #nim
08:09:06*endragor joined #nim
08:12:29Araq"Dynamic typing: The belief that you can’t explain to a computer why your code works, but you can keep track of it all in your head."
08:13:35*endragor quit (Ping timeout: 240 seconds)
08:15:05Araq“Sufficiently advanced trolling is indistinguishable from thought leadership.”
08:15:25AraqLinus???
08:17:55FromGitter<ephja> I suspect that the dynamic paradigm is compared with old statically typed languages a lot
08:19:18FromGitter<ephja> well, some actually do have algebraic types and what not, don't they? but maybe they were not as popular
08:24:44*arnetheduck joined #nim
08:25:26*xet7 joined #nim
08:34:55cremIs there a way to tell nim to force me explicitly calling return or assigning to result? I often forgot return statement in python, and now with nim it's going to be the same. In python it fails somewhere later with "None" type where something else is expected, but I guess in nim it will be even harder to notice.
08:37:42cremHm, actually most of the time it happens in Python when I build some result in a function and then forget to return it. In nim I can build result directly in "result" variable.
08:39:40*endragor joined #nim
08:41:46*dankrad quit (Ping timeout: 255 seconds)
08:41:54Araqyup.
08:43:27*dankrad joined #nim
08:44:05*endragor quit (Ping timeout: 240 seconds)
08:55:16*v17d quit (Ping timeout: 255 seconds)
09:01:51cremDoes nim generate different code for different C compilers? Also why would one choose C++ instead of C as a target language?
09:02:31Araqyes, it takes advantage of C compiler specific features like __assume(false)
09:02:47AraqC++ produces way better exception handling code
09:03:33cremMakes sense, thanks.
09:20:56*arnetheduck quit (Ping timeout: 260 seconds)
09:28:37FromGitter<ephja> does setControlCHook not work when using async? 路
09:30:34*skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…)
09:39:49Araqshould work
09:48:58FromGitter<ephja> I dunno what is going on. it gets ignored, and then it crashes with no stack trace after "SIGINT: Interrupted by Ctrl-C.". I'm gonna have to reduce it
09:51:58FromGitter<mratsim> @crem: If your proc has the proper type signature, it will not compile if result is void or you have no return statement
09:52:17AraqI would spawn a thread listening to input, setting a flag for the worker thread
09:52:52AraqUnix's signals are unusable.
09:53:32AraqI mean ok, they fit Unix perfectly well since everything else is unusable too, but still.
09:54:26FromGitter<ephja> I'm on windows, and the callback doesn't seem to be invoked. A minimal example with a hook works
09:56:58FromGitter<ephja> "Simple workaround on Windows for the near-term. You need to build with --threads:on and --tlsEmulation:off for this to work."
09:58:59FromGitter<ephja> that did the trick
10:19:50*yingjun joined #nim
10:24:17*yingjun quit (Ping timeout: 260 seconds)
10:38:23*Trustable quit (Quit: Leaving)
11:06:20*v17d joined #nim
11:11:06*endragor joined #nim
11:12:42*v17d quit (Ping timeout: 260 seconds)
11:14:06*PMunch joined #nim
11:14:36PMunchHey Araq, any particular reason https://github.com/nim-lang/gtk2/pull/22 hasn't been merged yet?
11:15:40*endragor quit (Ping timeout: 255 seconds)
11:18:54*dddddd joined #nim
11:25:06*v17d joined #nim
11:25:43*Tiberium joined #nim
11:26:54*madmalik joined #nim
11:37:03*eldiz joined #nim
11:40:00*Arrrr joined #nim
11:40:06*mahtob joined #nim
11:55:00Araq guchar* = uint8 # sure about that one?
12:02:56*Snircle joined #nim
12:07:27*mahtob quit (Remote host closed the connection)
12:17:55*yuken left #nim ("Leaving")
12:21:17*Arrrr quit (Quit: Leaving.)
12:21:31PMunchAccording to this: https://developer.gnome.org/glib/stable/glib-Basic-Types.html#guchar a guchar is an unsigned char, which according to this: https://www.tutorialspoint.com/cprogramming/c_data_types.htm is a single byte unsigned (aka uint8).
12:28:17*dankrad quit (Ping timeout: 248 seconds)
12:30:19*dankrad joined #nim
12:32:26*PMunch_ joined #nim
12:33:44*PMunch quit (Ping timeout: 268 seconds)
12:38:25*smt joined #nim
12:40:19*kunev quit (Ping timeout: 255 seconds)
12:41:30*kunev joined #nim
12:41:31PMunch_Araq ^
12:45:01PMunch_Is there a way in Nim to hide a field in an object in the same module?
12:45:41PMunch_Like not adding a * in a module to be imported, but for types in the same file.
13:05:20*Tiberium quit (Remote host closed the connection)
13:06:02subsetparkYou don't trust yourself?
13:06:16PMunch_Haha, it's for a macro
13:06:49PMunch_I want to create a type, hide all it's fields, and then override the special .= operator to trigger events on field updates :P
13:07:46*Trustable joined #nim
13:08:06koppehAsyncSocket is a ref type.. so why can't I get its addr?
13:08:31PMunch_koppeh, because you made it with a let statement?
13:08:55koppehref is a pointer though, right?
13:11:31*Trustable quit (Client Quit)
13:16:41koppehOkay, so a little reasoning..
13:16:56koppehI want to get the hash of a ref so I can add it to a HashSet.
13:17:19koppehI tried `client.addr.hash` since pointer has a hash proc.
13:17:50*Trustable joined #nim
13:17:50koppehBut it errors with "expression has no address".
13:18:09koppehJust for the hell of it I tried `client[].addr.hash` ... which apparently works.
13:19:09cremDid you want the address of an object (value of a reference) or address of a reference?
13:20:34PMunch_koppeh cast[int](client).hash
13:21:05PMunch_As you say, client *is* a ref. What you are trying to do is get the address *to the ref*.
13:21:09koppehPMunch_: That feels dirty.
13:21:38koppehcrem: Unsure of the difference.
13:22:09*yingjun joined #nim
13:23:27koppehcrem: Oh you mean the pointer to where the .. pointer value is residing in memory?
13:23:56koppehSince I want to hash the location of the object, I want the former.
13:24:01koppeh(I guess?)
13:24:37*flyhigh joined #nim
13:26:27*yingjun quit (Ping timeout: 240 seconds)
13:27:24PMunch_Yeah, so use cast[int](client)..
13:27:39PMunch_That casts the reference to the client to an int which you can then use
13:28:57AraqPMunch_: but maybe gtk uses cuchar as chars moreso than bytes?
13:30:37PMunch_So you're thinking "unsigned char" instead?
13:39:47PMunch_Hmm .= gives the field as a string..
13:40:28PMunch_Araq, any idea on how to properly do this? I want to create an object and run different procedures silently on field updates.
13:41:24Araqdeclare the fields as field000 and generated accessors
13:41:30Araq*generate
13:42:22PMunch_Hmm, is it safe to take a type definition into a macro and rewrite that? There are no weird special cases that would mess it up?
13:43:27Araqwell mutate the type as an AST, not via getType() and you should be mostly fine
13:43:47PMunch_Oh yeah, that was what I was planning to
13:44:29PMunch_But how would I write the accessor? I'm looking at .= now but since it gets the field as a string it's not the best..
13:46:14PMunch_Aah, I can define `fieldname=` procedures
13:46:36Araqexactly
13:48:31*endragor joined #nim
13:50:03PMunch_Hmm, but then I have to parse the typedef stuff to make the proper procedures..
13:53:00*endragor quit (Ping timeout: 260 seconds)
13:54:53*Matthias247 joined #nim
13:59:17*Trustable quit (Remote host closed the connection)
14:00:28Araqit's not hard, search for nnkIdentDefs within the object declaration
14:00:57PMunch_http://ix.io/yD9 why doesn't this works?
14:01:26PMunch_Throws an error saying "Error: ':' or '=' expected, but found 'test'
14:01:37PMunch_But is that safe Araq?
14:02:42AraqNim is not homoiconic, 'x: T' has different AST representations
14:03:03AraqPMunch_: no idea what 'safe' means here
14:03:36PMunch_Aah, yeah I noticed that when I was writing the nigui genui macro. Have some places were I request the string representation of something just to then reparse it..
14:04:05PMunch_Safe, as in can I do that for every possible object type definition without it doing something weird
14:04:24PMunch_What if I declare a field to be a tuple for example? That's a completely different AST
14:05:04Araqwell you check it's an nnkObjectTy, obviously
14:06:51PMunch_This is why I wanted to just override the .= operator. Then I could simply take their code, wrap it in some hidden type, then create a type which had only one field with the hidden type, then just implement .= as "update the actual field in the hidden type and call x"
14:07:17Araqbut then my method is safe, yes, if you do the recursion right
14:08:34Araqwell I tell you to instead to "simply" take an object declaration, "just" to wrap the type properly and then "just" implement accessor generation
14:08:49dom96Araq: Hah, I knew you would say that (the Nimble issue I created recently)
14:09:16Araqand with a bit more work I could insert more "justs" and "simplies" and then my solution would win in simplicity too
14:09:24PMunch_-_-
14:09:25Araq:P
14:09:41Araqwant me to write the macro?
14:10:05FromGitter<ephja> when in doubt, write a macro
14:10:25Araqdom96: well that's what I did two days ago
14:11:03PMunch_My solution though wouldn't really need to parse the code passed in at all
14:11:07Araqbut yes, "test for feature" is as much work to implement as "test for version", it's a general rule. and it produces better results.
14:11:58Araqmy solution doesn't require parsing either because it's wrong to call an AST analysis "parsing"
14:12:04dom96Araq: yeah, I told federico3 the same thing heh. But he does have a point about semantic differences possibly being a problem in the future.
14:12:14Araqit was already parsed, it's an AST now.
14:12:54PMunch_Hmm, I think I'm over thinking this..
14:12:56dom96I don't suppose anyone else here is in Dublin and has a free Saturday? :)
14:13:07*rauss joined #nim
14:13:08Araqcome on, everything is a "possible problem in the future"
14:14:04dom96*shrug*
14:14:11dom96I don't want to waste time on this.
14:14:14dom96today at least :)
14:17:36*flyhigh quit (Quit: Konversation terminated!)
14:17:44*flyhigh joined #nim
14:18:41*Trustable joined #nim
14:27:44koppehMhh.. is there a way to import a module without having it take up a name?
14:28:24koppeh`import ./server; let server = newServer()` shows "redefinition of 'server'"
14:30:12*endragor joined #nim
14:30:14FromGitter<ephja> don't function local variables solve these errors?
14:30:54koppehAhh.. that's why that error went away in the other project.
14:31:02FromGitter<ephja> I always define an entry point proc for that reason and other reasons
14:31:23koppehHmm.. well I'll need it anyway so let's do that!
14:32:37FromGitter<ephja> dom96: did any recent async changes resolve some stack trace issues?
14:33:23koppehMhh.. does this main function have to be called in the global scope?
14:35:00*endragor quit (Ping timeout: 260 seconds)
14:35:16koppehYup.
14:36:08FromGitter<ephja> that makes the most sense
14:36:19AraqPMunch_: https://gist.github.com/Araq/46988d814ed3a142eac7c55f092eb2f6
14:36:37Araqthe only problem is that the compiler still doesn't understand type(MyObject.field)
14:36:55Araqbut I'm looking into it
14:38:44dom96ephja: i'm not sure, why?
14:39:09Araqoh well, I updated my gist, now it works
14:39:32Araqkoppeh: also possible, 'import server as serverModule'
14:40:17koppeh`import server as nil` would be nice.
14:40:22Araqanyway, it wasn't that hard. exercise for the reader: Make it work with export markers (field*: type)
14:40:29Araqhmmm
14:42:07koppehBasically the opposite of `from server import nil`, right?
14:44:57*Sentreen quit (Ping timeout: 240 seconds)
14:46:39Araqright
14:46:42FromGitter<ephja> dom96: certain parts of the trace were missing before I think
14:46:43AraqI like it
14:46:57*dankrad quit (Ping timeout: 248 seconds)
14:47:02dom96ephja: are they not anymore
14:47:08dom96?
14:48:03FromGitter<ephja> no issues AFAICT. I've implemented a simple chat client and server
14:50:09*v17d quit (Ping timeout: 248 seconds)
14:50:37FromGitter<ephja>
14:52:29FromGitter<ephja> channels + variants for thread communication
14:55:03Araqdom96: if you don't waste time on this, don't introduce versioning.
14:58:19*Sentreen joined #nim
15:01:03*endragor joined #nim
15:03:42*kunev quit (Ping timeout: 260 seconds)
15:05:39*endragor quit (Ping timeout: 255 seconds)
15:06:09*kunev joined #nim
15:06:17*v17d joined #nim
15:10:26*kunev quit (Ping timeout: 240 seconds)
15:10:49*endragor joined #nim
15:11:39*kunev joined #nim
15:15:21*Tiberium joined #nim
15:15:45*v17d quit (Ping timeout: 248 seconds)
15:22:47*endragor quit (Remote host closed the connection)
15:29:18*v17d joined #nim
15:41:04*Matthias247 quit (Read error: Connection reset by peer)
15:41:58*Tiberium quit (Remote host closed the connection)
15:42:12PMunch_Oh wow, you actually wrote it. Thanks :)
15:43:27*Tiberium joined #nim
15:51:39*Tiberium quit (Remote host closed the connection)
15:52:21AraqI had to prove it is not hard
15:52:56*Tiberium joined #nim
15:53:09PMunch_Haha, well done in that case :)
15:53:16PMunch_This seems to work nicely
15:53:28PMunch_Even handles multiple objects
15:58:32*Tiberium quit (Remote host closed the connection)
15:59:53*Tiberium joined #nim
16:00:52*rkjy joined #nim
16:01:35*PMunch_ quit (Quit: leaving)
16:15:11*Tiberium quit (Remote host closed the connection)
16:16:33*Tiberium joined #nim
16:18:04*v17d quit (Remote host closed the connection)
16:23:08*flyhigh quit (Ping timeout: 246 seconds)
16:23:16*flyhigh joined #nim
16:27:20*mahtob joined #nim
16:27:37mahtobi compiled https://github.com/dom96/snake
16:27:45mahtobbut when i run snake.js
16:27:55mahtobnimcache/snake.js:6824:0 ReferenceError: window is not defined
16:28:24dom96snake isn't a node app
16:28:28dom96It's for the browser
16:29:16mahtobhow can we run it
16:29:29dom96You need an html file
16:29:46mahtobhm
16:29:49dom96Just open this: https://github.com/dom96/snake/blob/master/public/index.html
16:29:51mahtoblike your present
16:30:01mahtobhttps://picheta.me/snake/
16:30:02dom96make sure the .js file is in the public directory
16:30:06mahtobhm ok
16:30:59mahtobthnks it worked :)
16:53:13*Ven joined #nim
16:53:37*Ven is now known as Guest13273
16:56:29*skrylar joined #nim
16:56:36skrylarbilly mays here with another fantastic... wait.
17:15:06*mahtob quit (Remote host closed the connection)
17:17:50*endragor joined #nim
17:24:45*yingjun joined #nim
17:25:58*jsgrant joined #nim
17:28:56*yingjun quit (Ping timeout: 240 seconds)
17:33:52*flyhigh quit (Quit: Konversation terminated!)
17:48:20*rkjy quit (Quit: ChatZilla 0.9.93 [Firefox 54.0/20170616104331])
18:04:56*v17d joined #nim
18:04:56*Matthias247 joined #nim
18:11:42*Tiberium quit (Remote host closed the connection)
18:12:20*planhths joined #nim
18:17:48FromGitter<Varriount> Araq: u
18:18:35*Jesin quit (Ping timeout: 240 seconds)
18:19:39Araqvarriount: well?
18:20:04*Jesin joined #nim
18:28:26*v17d quit (Read error: Connection reset by peer)
18:30:04*yglukhov joined #nim
18:31:11*Jesin quit (Quit: Leaving)
18:31:34*Jesin joined #nim
18:33:34*yglukhov quit (Remote host closed the connection)
18:36:34*yglukhov joined #nim
18:38:57*Guest13273 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:42:34*endragor quit (Remote host closed the connection)
18:48:54*yglukhov quit (Remote host closed the connection)
18:56:46*Ven joined #nim
18:57:10*Ven is now known as Guest6808
19:02:39*v17d joined #nim
19:04:14*Trioxin joined #nim
19:10:18*ShalokShalom_ joined #nim
19:10:25*ShalokShalom quit (Ping timeout: 255 seconds)
19:19:21*v17d quit (Remote host closed the connection)
19:20:48*chra94 joined #nim
19:21:22*chra94 left #nim ("Leaving")
19:26:48*yingjun joined #nim
19:26:54*chra94 joined #nim
19:27:32FromGitter<cyberlis> i can't figure out why this code does not compile ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ if i remove return type for the function, everything works great. But i need to return some value from function [https://gitter.im/nim-lang/Nim?at=5973a724bc46472974163248]
19:30:48*ShalokShalom_ quit (Ping timeout: 240 seconds)
19:31:05skrylarcyberlis: the "has to be discarded" message usually means you are returning a value from a function, yet the caller is not using it
19:31:13*yingjun quit (Ping timeout: 248 seconds)
19:31:29skrylarunless that value is going in to a variable you need to prepend 'discard' to the call site, ex. "discard getMonkeys()"
19:31:43FromGitter<cyberlis> i know that
19:31:50FromGitter<cyberlis> that's why i wrote
19:32:00FromGitter<cyberlis> ```var i = myFunc@(45, 78, hello="world", name="cyberlis", qwerty="xxxxx")```
19:32:08FromGitter<cyberlis> this is last line of code
19:32:40FromGitter<cyberlis> because it doesn't work as has to work, i asked this question
19:33:27*ShalokShalom joined #nim
19:33:33FromGitter<cyberlis> and of course i tried `discard`
19:33:35*chra94 quit (Ping timeout: 240 seconds)
19:34:13FromGitter<cyberlis> i think something wrong in my macro function. may be return value has to be something else
19:35:11skrylarthe paste looks jumbled up to me
19:35:21skrylarthere's a return 10 line where there is no function definition for instance
19:36:48*yglukhov joined #nim
19:36:58FromGitter<cyberlis> i will post pastebin
19:38:35FromGitter<cyberlis> https://glot.io/snippets/erz039dx31
19:38:46FromGitter<cyberlis> you can run it in the brrowser
19:41:42*ShalokShalom quit (Ping timeout: 268 seconds)
19:42:39*v17d joined #nim
19:59:31*v17d quit (Ping timeout: 255 seconds)
20:02:09planhthswhy don't you just ```myFunk(45, 78, {"hello":"world", "name":"cyberlis", "qwerty":"xxxxx"}.toTable)```
20:02:23planhthswrite this instead
20:02:32FromGitter<cyberlis> :)
20:02:54Araqcyberlis: the macro needs to return 'untyped' and then it works
20:03:04*Trioxin quit (Ping timeout: 260 seconds)
20:03:06planhthsoh you are trying to emulate kwards from python
20:03:13FromGitter<cyberlis> Yes
20:03:22FromGitter<cyberlis> THANK YOU
20:03:26FromGitter<cyberlis> it works
20:03:53Araqsorry about the inconvenience, known compiler issue ;-)
20:04:02planhthsis that thing possible?
20:04:11Araqplanhths: sure
20:04:11FromGitter<cyberlis> it works
20:05:31*v17d joined #nim
20:07:29*planhths quit (Quit: Konversation terminated!)
20:08:23FromGitter<cyberlis> to make this more awesome i wanna get function defenition, and get a defenition of the `kwargs` argument. To use right types for kwargs
20:11:31Araqhttps://glot.io/snippets/erz0zzko28
20:11:42Araqwould be more idiomatic IMO
20:12:26FromGitter<cyberlis> cool. Looks great
20:14:00FromGitter<cyberlis> but if table will be `Table[string, int]`
20:14:22FromGitter<cyberlis> how i can make it more universal.
20:14:51FromGitter<cyberlis> fist type of course `string`, but second type can by anything
20:17:13FromGitter<cyberlis> yes it is more idiomic, but it loses `kwargs` magic. You can use just `toToble` instead `kwargs`
20:17:22FromGitter<cyberlis> because it looks the same
20:17:58FromGitter<cyberlis> but with `funcName@(args)` it looks more beautiful, i think. But may be i'm wrong
20:18:09Araqkwargs(foo=4, bar=5) vs toTable({"foo": "4", "bar": "5"})
20:18:22FromGitter<cyberlis> oh, i see
20:19:24Araqtypes can never be "anything", types are about restricting things to sanity
20:20:02Araqyou can use Table[string, JsonNode] and in my macro instead of bindSym"$" use bindSym"%"
20:20:48FromGitter<cyberlis> hm, interesting. i will try it. Thank you very much
20:21:08Araqbut I would avoid it ;-)
20:21:35FromGitter<cyberlis> i want it for external REST API
20:22:19FromGitter<cyberlis> to feed any params to function as kwargs, then serialize them to json and send to server
20:22:56FromGitter<cyberlis> this can make my lib easier to use
20:24:26AraqI doubt kwargs gains you anything for that. instead you need a macro that generates the stubs
20:29:10FromGitter<cyberlis> and i wanted to use nims metaprogramming features. If you started using nim you have to try all awesome features it suggest
20:30:39Araqsure, no problem with that
20:31:10Araqbut as I said, you probably want a macro that generates the stubs, how do keyword args help you
20:32:38FromGitter<cyberlis> they can make code simplier. This api gets method name in url, and some json object
20:32:53FromGitter<cyberlis> i don't want to write function for each method call
20:33:10FromGitter<cyberlis> i decided to write some super general function
20:35:24FromGitter<cyberlis> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5973b70b4bcd78af56d72570]
20:35:57*skrylar quit (Quit: Leaving)
20:36:31FromGitter<cyberlis> in this case, i don't have to write all function wrappers myself. And user only need to know server api documentation
20:37:14*arnetheduck joined #nim
20:37:15FromGitter<cyberlis> I think you get the idea
20:38:18FromGitter<cyberlis> And this is very good task for training some nim metaprogramming skills
20:42:12FromGitter<cyberlis> sorry i've spent so much of your time :)
20:43:47Araqwhat? you mean the 5 minutes?
20:43:56Araqyou are welcome
20:44:04FromGitter<cyberlis> thank you )
20:44:29*chra94 joined #nim
20:56:00couven92Araq, while doing som FFI with Windows SDK, I was htinking about a macro module that automagically creates distinct types wth stringify and arithmatic operations for C define constant groups
20:59:33couven92Araq, like this: https://gist.github.com/couven92/7d33f6bafcb2d20fbad11b58d46ebd6d is that General Purpose enough that I should make a public nimble for that?
21:06:13Araqresult.add(infixBorrowOperatorProc(`distinct`, base, "!=", docString = "Inequality operator for $# values. $#" % [$`distinct`, eqNeqSuffix]))
21:06:21Araqdo not ever generate a != operator
21:06:29Araqit's unnecessary
21:06:46couven92okay...?
21:06:53couven92do explain :D
21:13:10Araqtemplate `!=`(x, y: untyped): untyped = not (x == y)
21:13:16couven92AH!
21:13:26couven92:) Okay, that makes sense!
21:13:27Araqit's in system.nim, works for everything
21:14:30couven92I was too bound to C# there... If you overload == C# prompts you to also overload !=
21:14:52couven92s/overload/override
21:14:57*ftsf_ quit (Ping timeout: 240 seconds)
21:15:21Araqsometimes Nim works better than C# :P
21:15:35*madmalik quit (Quit: Connection closed for inactivity)
21:15:54couven92Yeah, I've noticed!!!! :D (Which is high praise coming from a C# lover like me! ;))
21:16:52FromGitter<cyberlis> guys, do you know some NoSQL database for nim. to store json objects, and serverless. Like Mongo but Like sqlite
21:17:55couven92@cyberlis Uhm... Mongo IS NoSQL, right? And SQLite IS relational... make up your mind, what do you want?
21:18:05Araqas he said
21:18:13Araqserverless like sqlite
21:18:17Araqjson based like mongo
21:18:22FromGitter<cyberlis> yes
21:18:29couven92ah! okay :)
21:19:11couven92(no idea, I don't do serverless (yet) :P)
21:21:20Araqhttps://github.com/nodesocket/jsonlite
21:21:36Araqwritten in Bash apparently
21:23:32FromGitter<cyberlis> it is convinient. if i would give your app to your friend. he don't have to setup database server to run it
21:24:41Araqhttps://unqlite.org/
21:24:47Araqseems your best option
21:25:52FromGitter<cyberlis> thanks
21:28:19*yingjun joined #nim
21:32:52*chra94 quit (Remote host closed the connection)
21:33:22*yingjun quit (Ping timeout: 276 seconds)
21:43:13*Matthias247 quit (Read error: Connection reset by peer)
21:44:40*Trustable quit (Remote host closed the connection)
22:08:45*nsf joined #nim
22:10:25*mahtob joined #nim
22:14:19*v17d quit (Ping timeout: 276 seconds)
22:23:57*PMunch joined #nim
22:26:43*v17d joined #nim
22:35:47*Guest6808 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:43:12*yglukhov quit (Remote host closed the connection)
23:03:11*deep-book-gk_ joined #nim
23:03:30*deep-book-gk_ left #nim (#nim)
23:05:53*PMunch quit (Quit: leaving)
23:16:55*couven92 quit (Ping timeout: 268 seconds)
23:19:54*nsf quit (Quit: WeeChat 1.9)
23:25:11federico3very interesting
23:29:51*yingjun joined #nim
23:34:42*yingjun quit (Ping timeout: 260 seconds)
23:38:19*xet7 quit (Quit: Leaving)
23:43:39*yglukhov joined #nim