<< 01-05-2017 >>

00:00:08*bjz joined #nim
00:00:11*bjz quit (Client Quit)
00:10:24*chemist69 quit (Ping timeout: 240 seconds)
00:12:56*chemist69 joined #nim
00:35:32*Calinou joined #nim
00:40:12*Calinou quit (Ping timeout: 245 seconds)
00:56:20*Calinou joined #nim
01:01:12*cspar__ quit (Ping timeout: 268 seconds)
01:08:31*Calinou quit (Ping timeout: 240 seconds)
01:13:26*chemist69 quit (Ping timeout: 258 seconds)
01:23:55PMunchHmm, I really can't get concepts to work..
01:27:34*chemist69 joined #nim
01:28:41*Calinou joined #nim
01:31:13*cspar__ joined #nim
01:39:12*Calinou quit (Ping timeout: 260 seconds)
01:41:23*PMunch quit (Quit: leaving)
02:18:52*Calinou joined #nim
02:21:23*zachcarter quit (Quit: zachcarter)
04:07:42*peted quit (Quit: WeeChat 1.4)
04:08:23*peted joined #nim
04:41:41*BennyElg quit (Remote host closed the connection)
05:12:37*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:37:03*nsf joined #nim
06:10:47*tankfeeder joined #nim
06:15:04*eminhi joined #nim
06:15:31*eminhi left #nim (#nim)
06:17:33*rokups joined #nim
06:26:52*Vladar joined #nim
06:32:00*BennyElg joined #nim
06:32:44*BennyElg_ joined #nim
06:32:44*BennyElg quit (Read error: Connection reset by peer)
06:36:14*BennyElg_ quit (Read error: Connection reset by peer)
06:36:35*BennyElg joined #nim
06:46:22BennyElgGuys, Anyone knows why I getting Command Out of Sync after using con.exec("sql query here")
06:46:32BennyElgAny other query I try Is command out of sync
06:59:42BennyElgproc transferRows(sourceConnection: DbConn, targetConnection: DbConn, table: string) =
06:59:42BennyElg var query = SqlQuery("SELECT * FROM $#".format(table))
06:59:42BennyElg echo("SELECT * FROM $#".format(table))
06:59:44BennyElg for row in sourceConnection.fastRows(query):
06:59:46BennyElg discard
07:02:46*tankfeeder quit (Quit: Leaving)
07:06:46*dexterk joined #nim
07:08:01*Jesin quit (Ping timeout: 240 seconds)
07:15:40*chemist69 quit (Ping timeout: 255 seconds)
07:18:15*chemist69 joined #nim
07:19:39BennyElgI notice that If you execute exec command follow by rows / fastRows than you get command out of sync error
07:26:08FromGitter<stisa> Bennyelg Sounds like it tries to do something while the first exec is still running, try waiting with `tryExec` ?
07:32:53BennyElgNop, still out of sync
07:37:10BennyElgwhen I comment the exec command (which execute create table statement) than the rows/fastRows is ok
08:00:10*Jesin joined #nim
08:01:34AraqBennyElg: use a transaction for the table creation? no idea, sorry
08:01:49*nsf quit (Quit: WeeChat 1.7.1)
08:02:14*nsf joined #nim
08:06:23*Tiberium joined #nim
08:07:42BennyElgTried transaction but without any success :/
08:08:01BennyElgcan someone validate it so I can open bug if im correct
08:09:23*ofelas joined #nim
08:21:16*zachcarter joined #nim
08:29:24*Matthias247 joined #nim
08:35:39*nsf quit (Quit: WeeChat 1.7.1)
08:41:09*yglukhov joined #nim
08:44:12*nsf joined #nim
08:47:34*Ven joined #nim
08:47:58*Ven is now known as Guest85461
08:54:33*yglukhov quit (Remote host closed the connection)
09:01:39*yglukhov joined #nim
09:04:33*Sentreen quit (Ping timeout: 246 seconds)
09:07:28*ofelas quit (Ping timeout: 240 seconds)
09:13:01*Guest85461 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:14:14*ofelas joined #nim
09:18:20*Sentreen joined #nim
09:18:26*yglukhov quit (Remote host closed the connection)
09:21:27*chemist69 quit (Ping timeout: 245 seconds)
09:21:57*zachcarter quit (Quit: zachcarter)
09:22:05*Ven joined #nim
09:22:28*Ven is now known as Guest91537
09:23:31*Guest91537 quit (Client Quit)
09:24:05*chemist69 joined #nim
09:26:16*Ven_ joined #nim
09:29:39*yglukhov joined #nim
09:32:49*BennyElg quit (Remote host closed the connection)
09:39:04*yglukhov quit (Remote host closed the connection)
09:54:54*zachcarter joined #nim
09:56:58*Trustable joined #nim
10:16:12*Ven_ quit (Ping timeout: 260 seconds)
10:19:12*Ven joined #nim
10:19:35*Ven is now known as Guest98432
10:21:27*ofelas quit (Ping timeout: 245 seconds)
10:22:17*rokups quit (Quit: Connection closed for inactivity)
10:22:31*Arrrr joined #nim
10:22:31*Arrrr quit (Changing host)
10:22:31*Arrrr joined #nim
10:22:35*ofelas joined #nim
10:32:38*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:44:36zachcarterI need to start paying attention to the frag repo, people are actually creating issues :O
10:47:38*Trustable quit (Remote host closed the connection)
11:03:36*Snircle joined #nim
11:06:29*Guest98432 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:15:10*Ven_ joined #nim
11:26:30*bjz joined #nim
11:28:08TiberiumHow can I optimize my app memory usage? Currently it's ~20mb, and I think it must be lower :)
11:29:39ftsfuse less memory =)
11:31:48*Ven_ quit (Ping timeout: 260 seconds)
11:32:54Tiberiumwhy massif shows only 17kb?
11:34:27*Ven joined #nim
11:34:50*Ven is now known as Guest9182
11:35:25*TheLemonMan joined #nim
11:36:20FromGitter<Varriount> Massif?
11:36:43Tiberiumyes
11:36:45Tiberiumvalgrind
11:42:38zachcarterhttps://groups.google.com/forum/message/raw?msg=comp.lang.ada/E9bNCvDQ12k/1tezW24ZxdAJ
11:43:48Tiberiumlol, best way to do garbage collection :)
11:44:15zachcarterjust strap your program to a missle
11:44:33Tiberiumzachcarter, missiles don't have internet access :(
11:44:36zachcartertruth
11:44:42zachcarterwell I’m sure they do
11:44:44zachcarterfor guidance etc
11:44:49zachcartertalking to satellites
11:45:19zachcarterbut I”m guessing the traffic that is allowed is pretty restricted haha for obvious reasons
11:45:28zachcarteranyway totally off topic my bad
11:56:15*zachcarter quit (Quit: zachcarter)
11:56:50dom9620 mb isn't much
11:57:18Tiberiumdom96, ah, ok :)
11:58:57Tiberiumdom96, also, https://github.com/nim-lang/Nim/pull/5677 really fixed https://github.com/nim-lang/Nim/issues/5757
11:59:28dom96great
11:59:36dom96Hopefully we'll have 0.17.0 soon :)
12:00:00Tiberiumdom96, and also, I wanted to ask how can I represent object to use json "to" macro? from this json - http://api.fixer.io/latest?base=USD
12:00:11Tiberiume.g. how to represent rates
12:01:00dom96I wouldn't use the 'to' macro for that.
12:01:16Tiberiumdom96, yeah, I know it's very simple json
12:07:01*aedigix quit (Remote host closed the connection)
12:07:26*aedigix joined #nim
12:30:45*couven92 joined #nim
12:48:33*devted joined #nim
12:49:24*zachcarter joined #nim
13:26:07*chemist69 quit (Ping timeout: 240 seconds)
13:26:54*chemist69 joined #nim
13:37:49*Trustable joined #nim
13:37:53*DebugDude12 joined #nim
13:38:48DebugDude12My function takes `var: seq[foo] | seq[bar]`. What does `var[0].sizeof` return? The size of foo or bar?
13:43:11FromGitter<stisa> DebugDude12 I might be wrong, but it will be the size of the type you actually have in `var[0]` . It should be the same as having `var : T` with T a generic
13:44:29DebugDude12i hope so, but want to be certain :S
13:45:23*PMunch joined #nim
13:45:32ftsfit'll generate code paths for both types, each will return its own size
13:46:20DebugDude12ftsf: will the code paths blow up my exe size dramaticly?
13:46:45ftsfcheck it
13:46:51ftsfi highly suspect not
13:47:16TiberiumDebugDude12, even if it would make it 10kb bigger, you can always use upx and get 2x lower size :)
13:47:44DebugDude12and antivirus complains of the users :P
13:47:58DebugDude12but 10kb is bearable
13:48:05DebugDude12thanks all
13:48:23Tiberiumupx?
13:48:24Tiberiumantivirus?
13:48:26Tiberiumhmmm
13:48:31Tiberiumyou can check on virustotal
13:48:42Tiberiumupx is unpackable by antiviruses
13:48:54Tiberiumgood antiviruses shouldn't detect an app if it's just packed with upx
13:48:56DebugDude12Tiberium: i've read most scanners used to complain in the past, but not sure whats now
13:49:03TiberiumDebugDude12, try on https://www.virustotal.com/
13:49:14Tiberium50+ antiviruses
13:49:51DebugDude12Why aren't the functions `matrix3d` and `vector3d` prefixed with `init`? Afaik thats the convention for objects.
13:51:06ftsfbrevity probably
13:52:30ftsfbut basic2d/3d are pretty painful to use, the glm module is much nicer imo
13:53:12TiberiumWhat is this? https://nim-lang.org/docs/basic3d.html#-,float,Vector3d
13:53:23Tiberium"a126952: float; b126954: Vector3d)"
13:53:26Tiberiumwhat are those names?
13:53:37ftsfautogenerated i'm guessing
13:54:15DebugDude12Last question: `seq[foo] | seq[bar]` is distinct from `seq[foo|bar]`? (I assume so)
13:54:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:55:08ftsftry it?
13:55:54TheLemonManthe former 'locks' the parameter to the instantiated type
13:56:37*couven92 quit (Ping timeout: 255 seconds)
13:56:53*devted quit (Quit: Sleeping.)
13:59:34*DebugDude12 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
14:01:44*Vladar quit (Remote host closed the connection)
14:03:37*couven92 joined #nim
14:08:19PMunchhttp://ix.io/snh Is there a better way of doing it?
14:09:16*Vladar joined #nim
14:11:15*vlad1777d joined #nim
14:12:23PMunchI can't create a sequence of CanDance but casting CanDance to a Dancer works..
14:12:54*Gonzih quit (Quit: WeeChat 1.7.1)
14:13:04*Tiberium quit (Ping timeout: 240 seconds)
14:13:11*Gonzih joined #nim
14:14:58TheLemonManuh, that sounds quite unsound as not every CanDance is a Dancer
14:15:19*Tiberium joined #nim
14:15:28PMunchExactly
14:16:16PMunchSo I need a better way of doing it..
14:16:29PMunchCreating a sequence of concepts
14:17:48TheLemonManyou could just write functions operating on CanDance objects, no?
14:19:46PMunchThe thing is I want to take all objects that have a tick function associated with them.
14:20:18PMunchThe tick functions take their object and a float which represents the time since the last tick
14:21:27PMunchThen I want to create a ticker so I can do "var ticker = initTicker()", "ticker.add(tickable)", and "ticker.tick()" and have the ticker tick each the added objects
14:22:02PMunchBut I'm unable to create a sequence of CanDance (which was copied from an example when I was trying to get this working, would be Tickable for me)
14:22:18*devted joined #nim
14:23:12PMunchBut I'm off to eat dinner now. Be back later.
14:34:48*nsf quit (Quit: WeeChat 1.7.1)
14:41:23*DebugDude12 joined #nim
14:42:36DebugDude12My function takes `foo|bar` as argument. How do i match its type? I can't get it working with case/if statements.
14:46:22TiberiumDebugDude12, maybe you want overloading?
14:46:32Tiberiumor you can use "when" maybe
14:52:29FromGitter<Varriount> PMunch: You'll have to use methods then.
14:53:05FromGitter<Varriount> Heterogeneous sequences almost always require the use of a base type and inheritance.
15:05:44*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
15:06:17FromGitter<battila7> Hey! I've started the implementation of the RealWorld Nim app during the weekend and tried to collect some best practices and experiences
15:06:26FromGitter<battila7> https://medium.com/@bagossyattila/read-world-nim-adventures-5dc85ac7d9d6
15:07:08FromGitter<battila7> It'd be great if the community could review the implementation or argue about the best practices :smile:
15:11:04DebugDude12Are sequences copied when assigned to a variable? i would like to `foo(bar())`, where bar returns a seq, but foo wants a mutable ref
15:11:52*antizealot1337 joined #nim
15:13:40*antizealot1337 quit (Client Quit)
15:21:45AraqdebugDude12: foo|bar is an implicit generic, you cannot use it with case/if
15:31:15*nhywyll joined #nim
15:34:15*DebugDude12 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
15:44:35Tiberiumhmm, can I use queues to collect requests, send them at once, and then send results back to proc's where an item was added to queue?
15:46:08PMunchVarriount, what do you mean?
15:53:50PMunchIsn't it possible to have a sequence of references to objects matching a concept?
15:57:57PMunchAraq, why doesn't the sequence error show up until I try to use the Ticker type? http://ix.io/snJ
15:58:51Araqcause the compiler sometimes is overly lazy
15:59:03PMunchHaha okay
15:59:20Araqalso, again, I concept is not an interface.
15:59:24Araq*a concept
15:59:47PMunchYeah, I know. But isn't it a concept that an object has a tickable function?
16:00:40Araq Ticker = ref object
16:00:40Araq tickables: seq[ref Tickable]
16:00:50Araqwhat do you think this is?
16:01:21PMunchWell I was hoping to create an object with a sequence of objects that have a tick function so I could call ticker.tick
16:01:30PMunchAnd it would go through the list and tick all of them.
16:01:43*brson joined #nim
16:03:07Araqthat's not an answer.
16:03:11dom96battila7: thanks for writing this up, gonna read now.
16:03:44Araqif you know that a concept is just a nice generic constraint (and you claimed to know), what is 'Ticker'?
16:04:00PMunchWell Ticker is an object
16:04:25PMunchBut that's intended
16:06:03PMunchI want Ticker to be an object with a sequence of somethings that can be passed to a tick function, along with the last timestamp. When ticker.tick is called the tick procedure is called on all the objects with the time since the last tick.
16:16:45PMunchHmm, I also get "Error: invalid command line option: '--reportConceptFailures'" which is mentioned in the docs
16:17:16FromGitter<noformnocontent> general question, since Nim is compiling to JS and C(++) – is there a way to use it as React-Native replacement?
16:21:45*BennyElg joined #nim
16:25:24*brson quit (Ping timeout: 240 seconds)
16:30:45*Guest9182 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:31:42PMunchBut that's not possible Araq?
16:31:49FromGitter<stisa> @noformnocontent you want to use it as an abstraction for web and native ( sorry I'm not familiar with what react-native does )? I think the closest you can get right now is https://github.com/yglukhov/nimx , but it's OpenGL based
16:32:40BennyElgGuys
16:33:23*Ven joined #nim
16:33:47*Ven is now known as Guest61766
16:36:55*acidx_ joined #nim
16:37:11*kier_ joined #nim
16:39:12*shodan45_ joined #nim
16:40:01*m712 joined #nim
16:40:12*shodan45_ quit (Remote host closed the connection)
16:40:17FromGitter<battila7> @dom96 Great, I hope you'll like it
16:40:49*shodan45_ joined #nim
16:40:49*BennyElg quit (Read error: Connection reset by peer)
16:41:07*Trustable quit (*.net *.split)
16:41:07*aedigix quit (*.net *.split)
16:41:07*Amun_Ra quit (*.net *.split)
16:41:07*acidx quit (*.net *.split)
16:41:08*vopi181[m] quit (*.net *.split)
16:41:08*gangstacat quit (*.net *.split)
16:41:08*kier quit (*.net *.split)
16:41:08*hlt quit (*.net *.split)
16:41:08*shodan45 quit (*.net *.split)
16:41:13*BennyElg joined #nim
16:42:06*Trustable joined #nim
16:42:35*aedigix joined #nim
16:42:36*vopi181[m] joined #nim
16:44:20dom96battila7: I like a lot of the ideas so far. Although exported procedures almost always end up at the bottom of a module unfortunately, writing forward procs just to document the interface seems like it would get old quickly :)
16:44:51*gangstacat joined #nim
16:46:04*shodan45_ quit (Remote host closed the connection)
16:46:20*arnetheduck quit (Ping timeout: 260 seconds)
16:47:51*Amun_Ra joined #nim
16:51:22FromGitter<battila7> @dom96 Sure, it's not a great solution. The ultimate solution would be to eliminate the significance of declaration order.
16:51:43Tiberiumbattila7: as I heard, it would make compiler much more complex
16:53:22*chemist69 quit (Ping timeout: 258 seconds)
16:53:38FromGitter<battila7> @Tiberium Yes, and it'd slow down the compilation process for sure which is not acceptable. However I think it's ugly that the essence of a module is at its bottom.
16:54:13Tiberiumwell, I'm writing procs in such way that I need forward declarations rarely :)
16:54:28dom96battila7: You can have the same module names.
16:54:39dom96or should I say, two module with the same name.
16:54:42dom96*modules
16:55:10dom96In your example you can place a model.nimble file in the model directory
16:55:12Tiberiumyou've used nim 0.16.0, maybe it didn't worked because of that?
16:55:20dom96and a service.nimble file in the service directory
16:55:21dom96that should work
16:55:25dom96those files can be empty
16:56:46dom96"Importing handler from article/handler crashes the compiler." This is a bug, have you reported it?
16:56:50*brson joined #nim
16:57:07dom96Same for the error messages
16:57:34dom96Lack of third party packages is something you'll need to help out with :)
16:58:31*chemist69 joined #nim
16:58:32dom96Overall nice article though
17:00:27FromGitter<battila7> @dom96 Yup, I'll check if there's an isssue for the import crash, and open one if not.
17:00:42dom96thanks
17:01:31FromGitter<battila7> I could not get x/y and z/y work because "y" is not unique in the package.
17:08:18*acidx_ is now known as acidx
17:11:47Tiberiumdom96, also, is it possible to parse something like https://gist.github.com/TiberiumN/42b66bc473fb0008324526cdf5c6f010 via json macro?
17:12:30dom96Tiberium: Should be
17:12:44dom96You just need to define a couple of objects
17:13:10*shodan45 joined #nim
17:14:42*BennyElg quit (Remote host closed the connection)
17:14:52Tiberiumdom96, but in this json in data array there's two types of objects
17:16:34dom96they have some common fields
17:16:45dom96I guess you won't be able to get all of them until the JSON macro supports optional fields
17:17:01Tiberiumdom96, oh, it will support them?
17:17:14*yglukhov joined #nim
17:17:14dom96eventually, sure.
17:17:20Tiberiumwow, nice
17:17:53*dddddd joined #nim
17:29:03*vlad1777d quit (Remote host closed the connection)
17:32:42*yglukhov quit (Remote host closed the connection)
17:33:21*Guest61766 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:38:36*xet7 joined #nim
17:39:13*dexterk quit (Read error: Connection reset by peer)
17:39:49*dexterk joined #nim
17:41:39*nsf joined #nim
17:44:06*nhywyll quit (Quit: nhywyll)
17:46:32*brson quit (Ping timeout: 260 seconds)
17:46:49*brson joined #nim
17:47:05*brson quit (Client Quit)
17:49:16*BennyElg joined #nim
17:52:26*BennyElg quit (Remote host closed the connection)
17:55:53*Arrrr quit (Quit: Leaving.)
18:13:08*oprypin quit (Quit: Bye)
18:14:19*oprypin joined #nim
18:16:52*ofelas quit (Ping timeout: 260 seconds)
18:22:38*rauss joined #nim
18:22:50*BennyElg joined #nim
18:25:40*nhywyll joined #nim
18:25:57*BennyElg quit (Remote host closed the connection)
18:28:35*BennyElg joined #nim
18:28:49*BennyElg quit (Remote host closed the connection)
18:29:31*ofelas joined #nim
18:29:32*xet7 quit (Quit: Leaving)
18:35:53*xet7 joined #nim
18:49:08*nhywyll quit (Quit: nhywyll)
18:53:15*nhywyll joined #nim
19:02:42*chemist69 quit (Ping timeout: 245 seconds)
19:05:15*chemist69 joined #nim
19:12:21*BennyElg joined #nim
19:35:31*Sentreen quit (Ping timeout: 240 seconds)
19:38:32Tiberiumdom96, yay, I found python-like struct library for Nim :) https://github.com/OpenSystemsLab/struct.nim
19:48:28*Sentreen joined #nim
19:56:41*nhywyll quit (Quit: nhywyll)
19:56:58*Ven joined #nim
19:57:21*Ven is now known as Guest7768
20:02:29*Guest7768 is now known as Ven`
20:02:38*Ven` is now known as Ven``
20:06:03*Tiberium quit (Read error: Connection reset by peer)
20:18:12*Ven`` quit (Ping timeout: 260 seconds)
20:20:11*Ven_ joined #nim
20:31:33*brson joined #nim
20:34:56dom96Tiberium: cool
20:38:54FromGitter<jacksarick> Anyone have time to help with a small issue?
20:39:50PMunchjacksarick, just ask away
20:41:20FromGitter<jacksarick> I have three files. `A.nim` includes `B.nim` and `C.nim`. `B.nim` also includes `C.nim`. The nim compiler keeps complaining that I'm redefining the types in `C.nim`because it's an include of an included file.
20:45:05FromGitter<battila7> Using import instead of include?
20:46:14FromGitter<jacksarick> import doesn't import type definitions, unless I'm doing something wrong
20:46:44PMunchAre you exporting them with *?
20:46:57FromGitter<battila7> And their fields too?
20:47:11PMunchIf you want to access them yes
20:47:45FromGitter<battila7> Sure, but it's easy to export the type itself without its fields :smile:
20:50:37*rauss quit (Quit: WeeChat 1.7.1)
20:53:19demi-show code, that is the easiest way to tell what is wrong tbh
20:53:53FromGitter<jacksarick> I think I got it figured out, thanks. The export marker was the key peice
20:53:56FromGitter<jacksarick> *piece
21:08:43*chemist69 quit (Ping timeout: 276 seconds)
21:11:06*chemist69 joined #nim
21:12:53*Sentreen quit (Ping timeout: 240 seconds)
21:18:35*Ven_ quit (Ping timeout: 260 seconds)
21:23:50*zachcarter quit (Ping timeout: 260 seconds)
21:25:24*Sentreen joined #nim
21:29:51*xet7 quit (Ping timeout: 255 seconds)
21:35:12*PMunch quit (Quit: leaving)
21:42:00*couven92 quit (Ping timeout: 255 seconds)
21:42:49*xet7 joined #nim
21:44:23FromGitter<Varriount> zachcarter: How are things going?
21:44:58FromGitter<Varriount> zachcarter: I'm thinking of trying my hand at designing a simple game with Frag over the summer.
21:46:55*Vladar quit (Remote host closed the connection)
21:56:53*Trustable quit (Remote host closed the connection)
22:00:36*devted quit (Quit: Sleeping.)
22:01:51*nsf quit (Quit: WeeChat 1.7.1)
22:09:59*BennyElg quit (Remote host closed the connection)
22:22:18*Matthias247 quit (Read error: Connection reset by peer)
22:35:00*zachcarter joined #nim
22:48:34*sz0 joined #nim
23:12:07*couven92 joined #nim
23:16:07*chemist69 quit (Ping timeout: 276 seconds)
23:19:54*chemist69 joined #nim
23:30:32*Sembei joined #nim
23:48:59*rauss joined #nim