<< 31-10-2016 >>

00:15:39*aaasad joined #nim
00:23:14*yglukhov joined #nim
00:27:38*yglukhov quit (Ping timeout: 250 seconds)
00:27:43rtr__Hi. What's the easiest way to pop first element from a sequence?
00:29:03*couven92 quit (Quit: Disconnecting)
00:30:14cheatfate_rtr__, removing elements from sequence is not a good idea at all...
00:30:55rtr__Inefficient?
00:34:35cheatfate_yep
00:37:31rtr__Ok. Thanks
00:47:02*aaasad quit (Read error: Connection reset by peer)
00:48:19gokrrtr__: I would say it all depends on what you are trying to do. Does it have to be the first? Using "pop" to get the last one is AFAICT not bad.
00:50:29mccmaybe consider constructing a different kind of data structure.
00:52:13*rtr__ quit (Remote host closed the connection)
00:52:48*rtr_ joined #nim
00:54:55*rtr_ quit (Remote host closed the connection)
00:55:11*rtr_ joined #nim
00:55:23gokrrtr_: You can always use a queue - it uses a seq but has a read and a write position. Thus it handles removing the "first" element in a better way.
00:56:16rtr_gokr: Oh. I'll try that. Thanks :)
00:56:32gokrNo prob.
01:03:58*aasad joined #nim
01:30:47*PMunch quit (Quit: leaving)
01:45:47vlad1777dDo somebody knows how to open file with relative to .nim file or binary file path? (to define it relatively at compile time)
01:56:28mccif nim does not offer this, the individual operating systems offer mechanisms for this
02:03:47vlad1777dmcc, thank you. In python I made transformation of current module's path + relative path and made: file = open(sys.path[0] + '/../../somedirectory/file2.txt')
02:04:07vlad1777dmcc, could you suggest me a way to do this in Nim?
02:04:14mccvlad: yeah, you can do that because python explicitly offers such a thing.
02:04:25mccpython has an OS abstraction library.
02:04:49mccvlad: however, it would be slightly tricky for nim to offer this. this is because nim compiles to a c++ program.
02:05:17mccif you do not find the function listed in http://nim-lang.org/docs/lib.html , i would assume it does not exist.
02:05:32vlad1777dmcc, thank you
02:06:35mccyou could possibly set up your program to be executed indirectly through something like a shell or batch script, which sets the path before execution.
02:09:06vlad1777dmcc, thank you. I'll read about libraries where word "file" was reminded first, after I'll, maybe, try to bind Python and Nim.
02:09:29*gokr quit (Ping timeout: 268 seconds)
02:12:36*ofelas quit (Ping timeout: 260 seconds)
02:12:56vlad1777dmaybe something will be in os module, which will allow for program to know it's path in runtime
02:13:14*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:17:06*chemist69 quit (Ping timeout: 250 seconds)
02:22:46vlad1777dmcc, thank you. I found. From os I take getAppFilename(), than by it's other functions, I get real file address and open it.
02:23:18mccah, great. and getAppDir.
02:29:53vlad1777dthanks very much =)
02:30:00vlad1777dgood night
02:30:04*vlad1777d quit (Quit: Leaving)
02:30:19*chemist69 joined #nim
02:38:05*rtr_ quit (Quit: Leaving...)
03:16:46*dmi0 joined #nim
03:25:17*yglukhov joined #nim
03:29:54*yglukhov quit (Ping timeout: 250 seconds)
03:29:54*gangstacat quit (Ping timeout: 250 seconds)
03:51:40*ofelas joined #nim
03:53:14perturbationvlad1777d: look at the instantiationInfo proc (with fullPaths = true). It should return a tuple with the filename that you can use at compile time
04:14:18*dmi0 quit (Ping timeout: 256 seconds)
04:54:13*perturbation quit (Quit: Leaving)
05:26:58*yglukhov joined #nim
05:31:22*yglukhov quit (Ping timeout: 256 seconds)
06:16:53*bjz joined #nim
06:19:05*pafmaf joined #nim
06:33:29*bjz quit (Read error: Connection reset by peer)
06:38:49*nsf joined #nim
06:45:20*yglukhov joined #nim
06:47:02*bjz joined #nim
06:49:40*yglukhov quit (Ping timeout: 250 seconds)
06:58:07*GustavoLapasta joined #nim
07:11:09*pafmaf quit (Ping timeout: 260 seconds)
07:16:17*gokr joined #nim
07:24:41*bjz_ joined #nim
07:25:37*bjz quit (Ping timeout: 260 seconds)
07:32:38*GustavoLapasta quit (Quit: Leaving)
07:35:58FromGitter<gogolxdong> how to pull a PR?
07:38:21FromGitter<gogolxdong> I translated our java FFT into Nim, and I hope can merge into the complex module
07:39:56Araqfork Nim, push some commits
07:40:05Araquse the github website to create a PR
07:40:22Araqor some tool based on the github API
07:42:32FromGitter<gogolxdong> :)
08:21:41*xet7 joined #nim
08:26:20*aasad quit (Read error: Connection reset by peer)
08:26:21*vendethiel joined #nim
08:46:50FromGitter<gogolxdong> ''' ⏎ proc FFT*(dataSource:seq[float64]):seq[Complex]= ⏎ var N =len(dataSource) ⏎ result=newSeq[Complex](N) ⏎ for i in 0..N: ... [https://gitter.im/nim-lang/Nim?at=581704fa5a1cfa016e65e579]
08:47:46FromGitter<gogolxdong> ''' ⏎ proc FFT*(dataSource:seq[float64]):seq[Complex]= ⏎ var N =len(dataSource) ⏎ result=newSeq[Complex](N) ⏎ for i in 0..N: ... [https://gitter.im/nim-lang/Nim?at=5817053283a2008d22f01a8b]
08:49:36*yglukhov joined #nim
08:49:36*yglukhov quit (Read error: Connection reset by peer)
08:50:16*stisa joined #nim
08:53:44*gangstacat joined #nim
08:58:56*planhths joined #nim
09:02:33*yglukhov joined #nim
09:02:42*yglukhov quit (Remote host closed the connection)
09:02:56*yglukhov joined #nim
09:03:00*yglukhov quit (Remote host closed the connection)
09:03:55*yglukhov joined #nim
09:06:11*Andris_zbx joined #nim
09:07:24FromGitter<gogolxdong> is implict convertion possible when integer multiply float?
09:08:43*miere joined #nim
09:09:05*miere43 joined #nim
09:09:05*miere43 quit (Client Quit)
09:10:55*vlad1777d joined #nim
09:12:57flyxgogolxdong: is asking here faster than just testing it?
09:13:36flyxgogolxdong: but yes, integer implicitly converts to float in that case
09:15:48*Trustable joined #nim
09:25:26*stisa quit (Quit: Leaving)
09:27:39vlad1777dHello dear friends. In Python in loops I can use create variables and use them in non-nested level. I have no need to pass there variables.
09:28:14vlad1777dHow do I export\import variables from loops to non-nested level ?
09:28:18vlad1777dTell me please.
09:28:32flyxvlad1777d: you just declare them outside the loop
09:29:13vlad1777dflyx, can I change them inside the loop so, that they will be changed in non-nested level?
09:29:17flyxe.g. `var i = 0; for j in 1..10: i = j` and then use i afterwards
09:29:39vlad1777dThank you
09:29:59flyxsure. since Nim uses explicit variable declarations, a usage of a variable is always bound to the scope it was declared
09:30:57vlad1777dAs I understood, in nested levels I can see and change non-nested variables. But not vice versa.
09:33:21flyxif you declare a variable inside any block, it can be used until that block ends. so if you try to access that variable behind the block, you get a compile-time error because the variable doesn't exist there
09:34:03flyxthis is the same concept as with most other statically typed languages. I understand you come from Python, have you used any other languages?
09:35:00vlad1777dThank you very much =) I used only C on beginners level (made simple programs in university, made programs for brother, he received tasks at school)
09:35:12vlad1777dAnd Python on normal level.
09:35:37vlad1777dJavaScript at beginner-normal level =)
09:35:41AraqC has the same concept:
09:35:52Araq{ int x; } use(x) // error
09:36:18vlad1777dI know it very-very badly, it was many years ago when I wrote there simple programs, but thank you =)
09:39:33FromGitter<gogolxdong> `fft.nim(7, 30) Error: type mismatch: got (float, int)` ` 7 result[n].re+=cos(-2*PI*i*n/N))*dataSource[n]` How does this happen?
09:43:08flyxgogolxdong: there are two closing paretheses
09:43:40FromGitter<gogolxdong> typos
09:44:00FromGitter<gogolxdong> sorry, still there
09:45:07FromGitter<gogolxdong> origin `7 result[n].re+=cos(-2*PI*float(i*n/N))*dataSource[n]`
09:45:22*yglukhov_ joined #nim
09:46:31Araqonly int literals convert to flots, not int in general
09:48:01flyxAraq: that is not documented at http://nim-lang.org/docs/manual.html#type-relations-convertible-relation
09:48:36*yglukhov quit (Ping timeout: 260 seconds)
09:48:38*enthus1ast quit (Ping timeout: 256 seconds)
09:49:36*enthus1ast joined #nim
09:49:37*couven92 joined #nim
10:00:29*enthus1ast quit (Read error: Connection reset by peer)
10:00:48*enthus1ast joined #nim
10:04:47jh32hi
10:06:02jh32hah, i found out why https://github.com/jfhg/nimdeep was so slow.
10:06:39jh32linalg's DMatrix64 type is not a reference, so the matrices are copied around all the time
10:06:57jh32changing it to ref object makes it super fast
10:08:57*jh32 quit (Remote host closed the connection)
10:09:34*jh32 joined #nim
10:10:00*arnetheduck joined #nim
10:10:15jh32well, let's say fast
10:11:04Araqokay ... ?
10:14:31*fredrik92 joined #nim
10:14:42*couven92 quit (Disconnected by services)
10:14:48*fredrik92 is now known as couven92
10:24:33*yglukhov_ quit (Remote host closed the connection)
10:27:59*brechtm joined #nim
10:32:53*dmi0 joined #nim
10:34:58*Arrrr joined #nim
10:38:02*gangstacat quit (Ping timeout: 250 seconds)
10:38:15*brechtm quit (Remote host closed the connection)
10:41:04*yglukhov joined #nim
10:42:59*yglukhov quit (Remote host closed the connection)
10:45:09*yglukhov joined #nim
10:46:11*gangstacat joined #nim
10:55:37*PMunch joined #nim
11:02:15*Snircle joined #nim
11:15:47*desophos quit (Read error: Connection reset by peer)
11:18:01*couven92 quit (Ping timeout: 265 seconds)
11:21:52*enthus1ast quit (Ping timeout: 260 seconds)
11:22:35*enthus1ast joined #nim
11:24:15FromGitter<gogolxdong> the result of associating integers as `sin(-2*PI*float(i*n/N) )` is different from the one of splitting as `sin(-2*PI*i.float*n.float/N.float)`
11:26:43*enthus1ast quit (Ping timeout: 245 seconds)
11:30:17FromGitter<gogolxdong> when result accumulates the sum result real part and image part
11:34:02FromGitter<Araq> sounds like floating point fun
11:49:37*dddddd joined #nim
11:51:17FromGitter<gogolxdong> I remember you don't trust any thing come from floating poing
11:52:05FromGitter<gogolxdong> I remember you don't trust floating point
11:56:56FromGitter<gogolxdong> Is this common in C++ ,Go or some implement issues in Nim?
11:58:56def-gogolxdong: https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
12:08:54*yglukhov_ joined #nim
12:09:15flyxgogolxdong: well in your case, the difference is obvious, if you calculate (i*n/N) as int, you lose the remainder. if you calculate it as float, you don't
12:12:38*yglukhov quit (Ping timeout: 265 seconds)
12:16:41FromGitter<endragor> is it expected that comparing TableRef with ``nil`` segfaults in current devel? seems it calls `==` in tables module which doesn’t handle nils. previously it directly compared the reference with nil so it worked fine.
12:16:56vlad1777dHere is Slices paragraph: http://nim-lang.org/docs/tut1.html#advanced-types-enumerations is written: b[11..^2] = "useful"
12:17:42vlad1777dWhat does it mean? I read that if to count from end - you need to place minus sign ("-")
12:18:32vlad1777dMaybe it's a typo, or in Nim to count from the end of object we need to use sign "^"?
12:23:28FromGitter<gogolxdong> @flyx, that is the point,ty
12:24:29FromGitter<gogolxdong> but the splitting is not friendly as well.
12:25:48flyxendragor: `==` in tables module does handle nils: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/tables.nim#L440
12:26:35Araqvlad1777d: yes, ^ means "count from end" in Nim.
12:26:37flyxendragor: but yeah, there were some changes to `==` recently that may have caused this problem.
12:27:19flyxendragor: do you have a stacktrace?
12:27:20FromGitter<endragor> ah, it was `OrderedTableRef`, to be precise. it doesn’t handle nils, but comparing it with `nil` works fine in 0.15.2.
12:27:43FromGitter<endragor> but crashes on devel
12:28:11vlad1777dAraq, thank you, and can in Nim I use a[1..-3] as alias of a[1..^3], or it'll give error?
12:28:51flyxendragor: you're right, that's a bug and I am guilty. file an issue and mention me.
12:29:12Araqflyx: the other count table fix is also wrong iiirc
12:29:19FromGitter<gogolxdong> Is there a better way to write `sin(-2*PI*i.float*n.float/N.float)`
12:29:24*dmi0 quit (Ping timeout: 250 seconds)
12:29:28flyxAraq: I already suspected that
12:30:03*gokr quit (Ping timeout: 252 seconds)
12:30:51FromGitter<endragor> @flyx https://github.com/nim-lang/Nim/issues/4974
12:44:19*themagician joined #nim
13:07:35*dmi0 joined #nim
13:08:24*yglukhov_ quit (Remote host closed the connection)
13:09:11*yglukhov joined #nim
13:10:42lg_trying to use writeBytes, but got Error: type mismatch: got (File, array[0..4095, uint8], Natural) but expected one of: proc writeBytes[](f: File; a: openArray[int8 | uint8]; start, len: Natural): int
13:11:13lg_should not openArray[int8 | uint8] typematch my array[0..4095, uint8] ?
13:15:51*yglukhov quit (Remote host closed the connection)
13:16:51*yglukhov joined #nim
13:21:02*gokr joined #nim
13:32:02*aaasad joined #nim
13:34:01flyxcan someone please test this on nim 0.15.2 / devel: `static: echo @[1] == @[1]`
13:34:05flyxI am stuck on 0.14.2 here
13:34:27flyxgetting „VM is not allowed to 'cast'“
13:36:25*aaasad quit (Ping timeout: 252 seconds)
13:49:27FromGitter<qqtop> @flyx all ok on nim 0.15.2 dev. says true
13:50:10flyxqqtop: thanks. then I don't need to create an issue
13:50:43*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:54:14cheatfate_lg_, problem not in your array, but in `start` parameter
13:54:34lg_oh! additional param .. thanks!
14:02:31*Andris_zbx quit (Quit: Leaving)
14:06:49*gokr quit (Ping timeout: 244 seconds)
14:10:24*arnetheduck quit (Ping timeout: 260 seconds)
14:38:22*Jesin quit (Quit: Leaving)
14:41:09*Jesin joined #nim
14:42:39*pregressive joined #nim
14:55:12*pafmaf joined #nim
14:56:56*UNIcodeX quit (Ping timeout: 244 seconds)
15:14:45*enthus1ast joined #nim
15:15:15*enthus1ast_ joined #nim
15:18:13*nsf quit (Quit: WeeChat 1.6)
15:31:18*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:32:53*pafmaf quit (Read error: Connection reset by peer)
15:33:41*pafmaf joined #nim
15:42:56*libman joined #nim
15:46:08libmanhttps://github.com/WebAssembly/design/issues/668 just got closed.
15:46:20libmanOops, wrong channel.
15:50:08*enthus1ast_ quit (Ping timeout: 265 seconds)
15:52:10FromGitter<dom96> libman: That doesn't seem like a good reason to close an issue...
15:52:53libmanSorry, that link was meant for ##copyfree. Still philosophizing my Ivory Tower. :P
15:56:58*pafmaf quit (Ping timeout: 250 seconds)
16:05:17*qwertfisch is now known as zombiefisch
16:11:35*miere quit (Read error: Connection reset by peer)
16:30:19*adeohluwa joined #nim
16:35:40*nsf joined #nim
16:40:06*Arrrr quit (Quit: WeeChat 1.5)
16:41:59*yglukhov_ joined #nim
16:42:20*adeohluwa quit (Ping timeout: 265 seconds)
16:43:25Araqdom96: maybe some people don't like to misuse their issue tracker as a wish list.
16:45:04*yglukhov quit (Ping timeout: 250 seconds)
16:45:16*adeohluwa joined #nim
16:46:16*yglukhov_ quit (Ping timeout: 256 seconds)
16:46:51*yglukhov joined #nim
16:49:06*yglukhov quit (Read error: Connection reset by peer)
16:49:23*yglukhov joined #nim
16:53:41*yglukhov quit (Ping timeout: 252 seconds)
17:10:22*adeohluwa quit (Ping timeout: 265 seconds)
17:13:25*adeohluwa joined #nim
17:14:56*gokr joined #nim
17:30:39*adeohluwa quit (Remote host closed the connection)
17:34:41dom96Araq: Maybe those people also would prefer making their repo private? :P
17:40:50FromGitter<Almynic> i'm trying to install nim on ubuntu but i can't add nim to the path somehow
17:41:45Araqyou need to restart your terminal after messing with PATH
17:42:49Calinouor "source ~/.bashrc"
17:42:52Calinouthat works too
17:46:44*desophos joined #nim
17:57:50*brson joined #nim
18:10:35*yglukhov joined #nim
18:13:00*enthus1ast quit (Ping timeout: 260 seconds)
18:29:17*kulelu88 joined #nim
18:41:54*yglukhov quit (Remote host closed the connection)
18:48:52*pafmaf joined #nim
18:48:59*yglukhov joined #nim
18:54:28*yglukhov quit (Remote host closed the connection)
18:55:13*GustavoLapasta joined #nim
18:58:53*rusua joined #nim
18:59:50*yglukhov joined #nim
19:01:04*rusua quit (Client Quit)
19:10:10*bjz joined #nim
19:14:15*djellemah_ joined #nim
19:26:19*vendethiel- joined #nim
19:28:34*vendethiel quit (Ping timeout: 268 seconds)
19:38:12*yglukhov quit ()
19:40:15*yglukhov joined #nim
19:40:44*brson quit (Ping timeout: 260 seconds)
19:42:08*bjz_ joined #nim
19:42:45*bjz quit (Ping timeout: 268 seconds)
19:48:45*brson joined #nim
20:07:20*desophos quit (Ping timeout: 260 seconds)
20:13:19*yglukhov quit (Remote host closed the connection)
20:13:41*yglukhov joined #nim
20:14:33FromGitter<Almynic> i can't install nimble on ubuntu via nim c install_nimble.nims can someone help? This is the error i get lib/pure/collections/queues.nim(69, 25) Error: value of type 'bool' has to be discarded ⏎ stack trace: (most recent call last) ⏎ lib/system/nimscript.nim(206) ⏎ lib/system/nimscript.nim(206, 7) Error: unhandled exception: FAILED: nim c nimble [https://gitter.im/nim-lang/Nim?at=5817a62983a2008d22f3fadb]
20:15:08*GustavoLapasta quit (Quit: Leaving)
20:16:52FromGitter<Almynic> koch nimble doesn't work either
20:21:11Araqalmynic, PR for nimble is pending
20:23:03libmanhttps://www.quora.com/What-is-the-most-portable-programming-language/answer/Alex-Libman-2 :P
20:26:10Araqah new Nim cannot compile old Nim
20:26:14Araqhmm
20:26:21*pafmaf quit (Ping timeout: 260 seconds)
20:28:22libmanOverzealous advocacy - it's a dirty job, but somebody's gotta do it. ;)
20:29:09AraqError: invalid pragma: this: self
20:29:27Araqwe should regenerated c sources some day
20:29:33AraqI like to use new features some day
20:37:57*athie joined #nim
20:39:41*GustavoLapasta joined #nim
20:55:23ldleworkso webassembly preview isi out
20:55:32ldleworkwith a toolchain to compile c to wasm
21:00:59vlad1777dHello. Function proc trimZeros() from strutils module trims trailing zeros from a formatted floating point value (x). Modifies the passed value. Source: http://nim-lang.org/docs/strutils.html
21:01:47vlad1777dIs it the same as in Python's function the value, which will be modified, referenced as global, than was modified?
21:02:50vlad1777dAs I understood, the main in Nim - where variable was referenced, it can be changed from any nested level. Is it so?
21:04:37*dmi0 quit (Ping timeout: 260 seconds)
21:05:56*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:09:39Araqvlad1777d: nested level or not doesn't affect whether you can write to it
21:09:55Araqand Python has no equivalent of 'var string'
21:10:26vlad1777dAraq, thanks
21:12:55*gokr quit (Ping timeout: 252 seconds)
21:13:18*chemist69 quit (Ping timeout: 250 seconds)
21:13:39*vqrs quit (Ping timeout: 252 seconds)
21:17:25*chemist69 joined #nim
21:24:38*zombiefisch quit (Ping timeout: 264 seconds)
21:31:51*djellemah_ quit (Ping timeout: 265 seconds)
21:35:44*vqrs joined #nim
21:40:56*vqrs quit (Ping timeout: 256 seconds)
21:44:16vlad1777dIs "\n" alias to "\l"?
21:44:44dom96no
21:44:47dom96OS dependent
21:44:59vlad1777d(I read some stackoverflow, but did not understood for Nim because here are character and string literals)
21:45:01vlad1777dthanks
21:48:08*brson quit (Ping timeout: 250 seconds)
21:50:22*qwertfisch joined #nim
21:51:05*qwertfisch is now known as zombiefisch
21:52:48*pregressive quit (Remote host closed the connection)
21:53:20*pregressive joined #nim
21:58:25*pregressive quit (Ping timeout: 268 seconds)
21:59:20*desophos joined #nim
21:59:21*planhths quit (Quit: Konversation terminated!)
22:00:14*vqrs joined #nim
22:06:45*dddddd quit (Read error: Connection reset by peer)
22:07:42*dddddd joined #nim
22:09:33*dmi0 joined #nim
22:09:34Araqdoes git support branch name aliases?
22:14:53corecodemaybe with hacks
22:15:02corecodeHEAD is a ref that points to a ref
22:15:13corecodeso maybe branches can do the same? but only locally
22:24:06*bjz joined #nim
22:25:00Araqno hacks please.
22:29:33*enthus1ast joined #nim
22:30:52*GustavoLapasta quit (Quit: Leaving)
22:30:58reactormonkAraq, depends if you consider symlinking them hacks.
22:31:03vlad1777dCan somebody please suggest me a way to convert sequence to tuple? (and\or to\from other types)
22:31:35*brson joined #nim
22:31:37vlad1777dWhere to look?
22:33:03Araqwhy would you want to?
22:33:14Araqif you don't know the length, how can it be a tuple?
22:33:40vlad1777dreadFile returns sequence
22:33:49vlad1777dand I want it to be a tuple (named)
22:33:59vlad1777dI read settings from file
22:34:11vlad1777dsorry
22:34:15vlad1777dsplitLines
22:35:38*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:40:18*yglukhov quit (Remote host closed the connection)
22:41:19Araqread dom96's book for how to accomplish that
22:45:43vlad1777dthanks, but I cannot bye it, it's not in my country, I cannot pay to amazon. I'll find solution for this after time.
22:51:59*yglukhov joined #nim
22:53:28*nsf quit (Quit: WeeChat 1.6)
22:57:18*yglukhov quit (Ping timeout: 250 seconds)
23:09:37*Trustable quit (Remote host closed the connection)
23:17:32*themagician quit ()
23:20:53*chemist69 quit (Ping timeout: 260 seconds)
23:23:11*chemist69 joined #nim
23:28:50*bjz joined #nim
23:42:15*enthus1ast_ joined #nim
23:45:41*Matthias247 joined #nim
23:55:10*yglukhov joined #nim