<< 30-10-2016 >>

01:56:26*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:14:59*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:18:53*chemist69 quit (Ping timeout: 260 seconds)
02:23:08*bjz joined #nim
02:32:05*chemist69 joined #nim
03:04:13*pie_ joined #nim
03:11:44*pie_ quit (Remote host closed the connection)
03:19:37*brechtm joined #nim
03:24:08*brechtm quit (Ping timeout: 244 seconds)
04:40:58*dddddd quit (Remote host closed the connection)
04:43:21*yglukhov joined #nim
04:47:40*yglukhov quit (Ping timeout: 250 seconds)
05:13:13*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:19:26*bjz joined #nim
05:41:17*vl409 joined #nim
05:42:31vl409dom,salewski:Hi, I'v been reading yesterday's irclog
05:43:06vl409I don't have the book, but I'd wrote something like:
05:44:15vl409Based on complexity of the algorithm, requirements on executable size and user-friendliness,
05:44:26vl409you can also run your algorithm to compute only first few values in compiletime, so that
05:44:33vl409user can be served them immediately after startup and compute the rest on demand in run-time.
05:44:41vl409static:
05:44:57vl409 const bootstraped_index = blabla(4096) # some meaningful example ???
05:45:10vl409# discaimer: I don't understand nim, I just hope this can be done. I could be wrong.
05:46:12vl409disclaimer2: And I'm also not native English speaker/writer...
05:46:27*vl409 quit (Quit: Leaving)
06:05:02*nsf joined #nim
06:21:32*chemist69 quit (Ping timeout: 250 seconds)
06:23:41*chemist69 joined #nim
06:45:25*yglukhov joined #nim
06:47:33*rtr_ joined #nim
06:50:12*yglukhov quit (Ping timeout: 260 seconds)
07:49:54FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5815a622482c168b22cebef8]
07:50:08*rtr__ joined #nim
07:52:42*rtr_ quit (Ping timeout: 250 seconds)
08:03:30*bug2000 quit (Remote host closed the connection)
08:31:41*yglukhov joined #nim
08:36:08*yglukhov quit (Ping timeout: 260 seconds)
08:43:14*gangstacat quit (Ping timeout: 250 seconds)
09:00:47*gokr joined #nim
09:03:55*Matthias247 joined #nim
09:12:36*nsf quit (Quit: WeeChat 1.6)
09:24:48*stisa joined #nim
09:36:02*djellemah quit (Quit: Leaving)
09:40:52*xet7 quit (Quit: Leaving)
09:42:23*yglukhov joined #nim
09:46:54*xet7 joined #nim
10:42:15*ARCADIVS quit (Quit: ARCADIVS)
10:46:44*gokr quit (Ping timeout: 250 seconds)
10:48:13*pafmaf joined #nim
11:02:14*Snircle joined #nim
11:08:20*nsf joined #nim
11:15:02*gangstacat joined #nim
11:17:19*Gonzih quit (Read error: Connection reset by peer)
12:06:04*Gonzih joined #nim
12:08:19*Matthias247 quit (Read error: Connection reset by peer)
12:10:21*xet7 quit (Ping timeout: 252 seconds)
12:12:40*stisa quit (Ping timeout: 268 seconds)
12:15:35*djellemah joined #nim
12:20:47*yglukhov quit (Remote host closed the connection)
12:40:13*MonsterAbyss joined #nim
13:21:16*yglukhov joined #nim
13:22:39*gokr joined #nim
13:23:16*stisa joined #nim
13:25:56*yglukhov quit (Ping timeout: 260 seconds)
13:36:01*pafmaf quit (Ping timeout: 260 seconds)
13:57:52chemist69Hi, I hope there is s.o. around at this sunday afternoon..
14:00:36dom96"s.o"?
14:02:09chemist69Is there a way to call the instance of an object directly (explained in this example: https://glot.io/snippets/ejukeg8vps)?
14:02:09chemist69The example is minimal and has not much to do with what I want to actually do.
14:02:32chemist69someone?
14:02:54chemist69though it was common abbr. ;)
14:03:00chemist69*thought
14:05:26rtr__How do I raise an exception in a method like this --> ```proc decode(e: seq[byte]):```
14:06:05rtr__Error: 'Only ref object can be raised'
14:12:33stisachemist69: `items` and `pairs` iterators are called implicitly, so maybe rename `count` to `items`? Also have a look at http://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-implict-items-pairs-invocations
14:16:00chemist69stisa: THAT WORKS!!! Very cool, thanks a lot!
14:20:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:37:03*nsf quit (Quit: WeeChat 1.6)
14:51:16*xet7 joined #nim
14:57:56*xet7 quit (Quit: Leaving)
15:05:06*irrequietus joined #nim
15:08:56*EastByte quit (Read error: Connection reset by peer)
15:10:00*EastByte joined #nim
15:10:58chemist69rtr__: use newException()?
15:11:30*stisa quit (Ping timeout: 268 seconds)
15:16:51*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
15:23:23*yglukhov joined #nim
15:28:12*yglukhov quit (Ping timeout: 260 seconds)
15:42:00*irrequietus quit (Ping timeout: 250 seconds)
15:45:07*pafmaf joined #nim
15:45:43*PMunch joined #nim
15:47:24*stisa joined #nim
16:06:03rtr__chemist69: Thanks
16:06:18rtr__How do I convert a string to seq[byte]
16:06:20rtr__?
16:07:46*xet7 joined #nim
16:11:02dom96Half off code for Nim in Action pBook in case anyone is interested: wm103016lt https://www.manning.com/books/nim-in-action?a_aid=niminaction&a_bid=78a27e81
16:26:44*stisa quit (Ping timeout: 268 seconds)
16:30:16*planhths joined #nim
16:31:07planhthsthere are no fraction packages for nim right?
16:31:57enthus1astdom96 shipping to germany is nearly the same as the book itself : )
16:33:07dom96enthus1ast: perhaps you would prefer to purchase from Amazon then? https://www.amazon.de/Nim-Action-Dominik-Picheta/dp/1617293431/ref=sr_1_1?ie=UTF8&qid=1477845165&sr=8-1&keywords=nim+in+action
16:33:13dom96No discount code for that though
16:33:58enthus1astno amazon... was just mentioning
16:40:17dom96planhths: http://nim-lang.org/docs/rationals.html
16:40:51planhthsthank you dom
17:06:38*gangstacat quit (Quit: Ĝis)
17:07:01*stisa joined #nim
17:08:18*gangstacat joined #nim
17:16:15*irrequietus joined #nim
17:16:48*Salewski joined #nim
17:18:57SalewskiDom, I still wonder how true this sentence from chapter 2 is: "In Nim every statement can be an expression."
17:19:50SalewskiI think in Ruby it is true. But in Nim, how can an assignment be an expression?
17:21:02SalewskiAt least "discard x = 0" does not work.
17:21:08*arnetheduck quit (Ping timeout: 260 seconds)
17:22:31SalewskiOr do we not call an assignment a statement in Nim. Indeed I am a bit confused now.
17:25:06SalewskiAraq: In The manual: "However, some expressions are statements." # That makes it not really more clear for me. It can be the other way round, some statements can be expressions too.
17:25:24*yglukhov joined #nim
17:26:26SalewskiSo I have currently no idea for an expression which is a statement. Can someone give example?
17:28:11dom96Salewski: echo((var x = 0; x))
17:28:20dom96that works
17:28:41SalewskiAh interesting, thanks.
17:29:38*yglukhov quit (Ping timeout: 245 seconds)
17:31:13*nsf joined #nim
17:38:47*libman joined #nim
17:49:38*vxn left #nim (#nim)
17:50:04*irrequietus quit (Ping timeout: 244 seconds)
17:55:34*irrequietus joined #nim
17:55:37*irrequietus quit (Changing host)
17:55:37*irrequietus joined #nim
18:13:41*qwertfisch quit (Ping timeout: 260 seconds)
18:16:58*aaasad joined #nim
18:18:08*qwertfisch joined #nim
18:20:31*yglukhov joined #nim
18:20:55rtr__Hi. How do I convert a `string` into `seq[byte]`?
18:21:20dom96rtr__: why do you want to do that?
18:21:52dom96You will need to iterate over the string and copy it into a sequency, converting each character into a `byte`.
18:21:56dom96*sequence
18:23:07rtr__dom96: Kind of make things easy while implementing mqtt protocol. Need to convert "MQTT" into seq[byte] and place it in variable header
18:23:31rtr__Ohh. Ok. Thanks
18:25:31dom96Why not just use `string`?
18:25:38dom96How does seq[byte] make it easier?
18:25:46planhthshow to write this ccode to nim: (double)0x7FFFFFFF ?
18:27:00Salewskifloat(0x7FFFFFFF) ?
18:27:09chemist69or 0x7FFFFFFF.toFloat
18:27:18planhthsthx
18:29:28rtr__dom96: A mqtt variable header contains other data as well which requires bit manipulation. Thought seq[byte] is way to go for returning encoded frames
18:29:50planhthsnot really working though...
18:30:40dom96rtr__: I see. In that case, sure, use `byte`.
18:32:07Salewskiecho float(0x7FFFFFFF) # 2147483647.0 # is that not what you desire?
18:33:55planhthsyes ehm no, I don't understand the code I am trying to port
18:33:59planhths...yet
18:42:44*Sentreen quit (Read error: Connection reset by peer)
18:43:19*Sentreen joined #nim
18:47:43planhthsI can't catch OverflowError ?
18:51:28SalewskiFor float, int or uint? I would guess for int try/except may work.
18:51:47planhthsI have: var ai: int64; var y: float = ...; ai = y.int64;
18:53:48SalewskiMy guess would be that an exeption is raised, but I never tried.
18:55:15*nsf quit (Quit: WeeChat 1.6)
18:55:24planhthsIt seems that y = 4.305870196488207 before the exception but this line > ai = y.int64 raises OverflowError. What's happening?
18:55:33planhthsI am confused
19:04:33Salewskivar ai: int32 = int32(1.0e300); echo ai # 0, no exeption
19:04:47SalewskiYes, confused too.
19:05:19*aaasad quit (Read error: Connection reset by peer)
19:06:07*aasad joined #nim
19:10:37*gangstacat quit (Ping timeout: 260 seconds)
19:15:33*gangstacat joined #nim
19:17:01*aasad quit (Read error: Connection reset by peer)
19:19:15dom96planhths: can you gist your code?
19:19:26planhthssure
19:22:00planhthshttps://gist.github.com/konqoro/15a49e7bc95675e0480feafd0435ce2f
19:24:13dom96interesting
19:24:19dom96Might be worth a bug report
19:28:30planhthsok will do
19:29:11Salewskivar b: int
19:29:16Salewskib = toInt(1.0e300)
19:29:24Salewskiecho b # -9223372036854775808 # but should raise exeption from manual
19:29:36SalewskiMay be indeed a bug
19:31:02rtr__what is the easiest way to convert uint16 to array of 2 bytes?
19:32:12SalewskiYou may try cast when you know what you do.
19:32:34*brechtm joined #nim
19:35:45rtr__Salewski: shift right it is then. Thanks :)
19:39:32SalewskiOf course cast copies only the bit pattern, you have to know and check what you really want as the result.
19:57:24rtr__Does nim have any official online compiler like rust?
19:58:16planhthsI think the problem is with the while loop condition...
20:01:40*brechtm quit (Remote host closed the connection)
20:04:11chemist69rtr__: I don't know about `official`, but you can use glot.io
20:09:07*beatmox quit (Remote host closed the connection)
20:09:20*beatmox joined #nim
20:09:26*beatmox quit (Remote host closed the connection)
20:09:40*beatmox joined #nim
20:09:52rtr__chemist69: Thanks
20:13:37jh32hi
20:14:41jh32is anyone using the linalg package?
20:15:29*brechtm joined #nim
20:16:19jh32i did an experimental rewrite of mnielson's deep learning example code in nim with linalg
20:16:59jh32it works but is rather slow compared to the python/numpy reference implementation
20:18:16*beatmox quit (Remote host closed the connection)
20:18:29*beatmox joined #nim
20:18:34*beatmox quit (Client Quit)
20:18:39*yglukhov quit (Remote host closed the connection)
20:19:36*beatmox joined #nim
20:19:44*beatmox quit (Client Quit)
20:20:15*beatmox joined #nim
20:21:59*beatmox quit (Client Quit)
20:22:29*beatmox joined #nim
20:22:41rtr__How do I return a sub sequence --> https://glot.io/snippets/ejuv0l49e0
20:22:44rtr__?
20:25:20*Matthias247 joined #nim
20:35:41*fredrik92 joined #nim
20:36:11*fredrik92 is now known as couven92
20:36:41*bjz joined #nim
20:37:05*subsetpark joined #nim
20:41:52*brechtm quit (Remote host closed the connection)
20:54:05*libman quit (Quit: Leaving.)
21:02:40*bjz_ joined #nim
21:03:16*bjz quit (Ping timeout: 260 seconds)
21:03:43*nsf joined #nim
21:05:15*nonlinear joined #nim
21:05:30*nonlinear left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
21:08:19Salewskirth, newSeq(1..10) in invalid. I think.
21:09:53*fredrik92 joined #nim
21:10:12*desophos quit (Ping timeout: 260 seconds)
21:10:42*couven92 quit (Disconnected by services)
21:10:43*fredrik92 is now known as couven92
21:11:28SalewskiYou may use @[1,2,3,4,5,6,7,8,9,10] for initial seq. Or see manual for other notations.
21:19:09*yglukhov joined #nim
21:21:12stisaan alternative is `lc[x | (x <- 1..10), int]` if you use http://nim-lang.org/docs/future.html
21:23:28*yglukhov quit (Ping timeout: 256 seconds)
21:23:51*Pommersche92 joined #nim
21:23:54*pie_ joined #nim
21:26:42*Pommersche92 left #nim (#nim)
21:35:52*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:49:35*irrequietus quit ()
21:55:05*pie_ left #nim ("Leaving")
21:57:26*Snircle joined #nim
21:58:23*Salewski left #nim (#nim)
22:02:09*bjz joined #nim
22:10:13*stisa quit (Quit: Leaving)
22:13:34*couven92 quit (Ping timeout: 244 seconds)
22:16:10*desophos joined #nim
22:17:43*bjz quit (Read error: Connection reset by peer)
22:24:24*Matthias247 quit (Read error: Connection reset by peer)
22:25:49*Trustable joined #nim
22:27:12*couven92 joined #nim
22:33:59*vlad1777d joined #nim
22:43:22vlad1777dHello to all. I can import module in parent directory - another subfolder so: import ../subfolder2/module2
22:44:09vlad1777dAre there another ways to make this (maybe with points only, or with slashes only, or with another symbols) ?
22:44:21*brechtm joined #nim
22:46:13*pafmaf quit (Ping timeout: 260 seconds)
22:53:25*xet7 quit (Quit: Leaving)
23:05:53*nsf quit (Quit: WeeChat 1.6)
23:08:54*cheatfate quit (Read error: Connection reset by peer)
23:09:00*cheatfate_ joined #nim
23:21:22*yglukhov joined #nim
23:23:01*mcc joined #nim
23:23:14mccHello, so
23:23:32mccI found a situation where x = x * y works but x *= y results in the error "for a 'var' type a variable needs to be passed, but 'x(actor.at)' is immutable"
23:23:35mccdo you think this is likely to be a compiler bug?
23:23:38mccalso hi
23:24:05*Trustable quit (Remote host closed the connection)
23:25:08*planhths quit (Quit: Konversation terminated!)
23:26:04*yglukhov quit (Ping timeout: 260 seconds)
23:31:34*couven92 quit (Ping timeout: 250 seconds)
23:34:49*perturbation joined #nim
23:37:45*fredrik92 joined #nim
23:38:06*fredrik92 is now known as couven92
23:38:10*brechtm quit (Remote host closed the connection)
23:38:30perturbationweird issue with setControlCHook (latest compiler from devel) https://gist.github.com/singularperturbation/3beddef7fca799dc7ea6107eb04f401c
23:41:10perturbationif using a closure, works (compiles) with capturing global variables but not local
23:41:26perturbationalthough, that may just be that it's able to write it as not a closure
23:42:27perturbationis this because a proc(){.closure.} cannot be used as a proc(){.noconv.} ? (so not really an error)?
23:44:47*vlad1777d quit (Quit: Leaving)
23:50:48*vlad1777d joined #nim