<< 28-02-2016 >>

00:01:27*space-wizard joined #nim
00:01:51*zxtx joined #nim
00:05:20*ldlework joined #nim
00:05:44*emery quit (Ping timeout: 268 seconds)
00:08:09*sorakun joined #nim
00:10:21*emery joined #nim
00:12:31*jaco60 quit (Ping timeout: 268 seconds)
00:14:59*francisl quit (Quit: francisl)
00:19:11*jaco60 joined #nim
00:20:32*StarBrilliant quit (Ping timeout: 268 seconds)
00:22:27*Jesin joined #nim
00:24:35*StarBrilliant joined #nim
00:27:33*fold4 quit (Ping timeout: 244 seconds)
00:28:11*kier joined #nim
00:28:11*[CBR]Unspoken joined #nim
00:28:11*vegansk joined #nim
00:28:11*asdf joined #nim
00:31:35*low-profile joined #nim
00:31:59*ekarlso- joined #nim
00:42:02*irrequietus_ quit ()
00:49:23*LeNsTR quit (Changing host)
00:49:23*LeNsTR joined #nim
01:00:41*cncl joined #nim
01:04:54*darkf joined #nim
01:06:22*jaco60 quit (Ping timeout: 260 seconds)
01:13:41*alexsystemf quit (Quit: Connection closed for inactivity)
01:13:48*jamesp joined #nim
01:14:28jamespHey! Is there any programming paradigm in nim that resembles manipulating a real time stream (building a circuit that gets stepped multiple times)
01:15:00jamespSo the goal is to have a procedure update(T t), and then update is the "source"
01:15:10jamespAnd then I'd like to be able to describe outputs like so:
01:15:21*darkf quit (Read error: Connection reset by peer)
01:15:31jamespg1(f(update)), g2(f(update))
01:15:55*darkf joined #nim
01:16:07*nsf quit (Quit: WeeChat 1.4)
01:16:17jamespwhere g_i's are lambdas and f is a filter. And what it'll do is: update(T t): if f(t): g1(t); g2(t)
01:26:23*darkf quit (Read error: Connection reset by peer)
01:26:49*darkf joined #nim
01:27:39*LeNsTR is now known as lenstr
01:37:10*darkf quit (Read error: Connection reset by peer)
01:37:45*darkf joined #nim
01:37:46*jamesp quit (Quit: Page closed)
01:38:07*jamesp joined #nim
01:39:01Araqjamesp: nim has lambdas
01:39:29jamespYes, but I don't think lambdas alone solve this problem :(. I think I need another trick
01:40:15jamesplike if I write g2(f(update)) and g1(f(update)) I need to have a way to make sure the compiler knows to only call f once each time update is called
01:40:53jamespand only call g2, g1 if f is true!
01:47:12*francisl joined #nim
01:48:11*darkf quit (Read error: Connection reset by peer)
01:49:19*darkf joined #nim
01:59:45*sorakun quit (Ping timeout: 276 seconds)
02:06:46*mtj_ quit (Ping timeout: 244 seconds)
02:07:53*mtj_ joined #nim
02:13:59*arnetheduck joined #nim
02:35:37*Varriount quit (Disconnected by services)
02:35:37*Varriount_ joined #nim
02:36:06*fold4 joined #nim
02:44:07*darkf_ joined #nim
02:45:25*M-max1 quit (Remote host closed the connection)
02:45:32*vendethiel joined #nim
02:46:46*francisl quit (Ping timeout: 252 seconds)
02:46:56*cncl quit (Ping timeout: 255 seconds)
02:47:19*darkf quit (Ping timeout: 252 seconds)
02:50:24*darkf_ quit (Ping timeout: 268 seconds)
02:50:40*darkf joined #nim
02:52:38*cncl joined #nim
02:54:42*Varriount joined #nim
02:57:36*Kingsquee quit (Ping timeout: 276 seconds)
02:57:45*Varriount quit (Disconnected by services)
02:57:45*Varriount__ joined #nim
02:58:24*Varriount_ quit (Ping timeout: 268 seconds)
02:58:39*brson quit (Quit: leaving)
03:01:05*M-max joined #nim
03:08:39*vendethiel quit (Ping timeout: 276 seconds)
03:09:30*emery quit (Ping timeout: 268 seconds)
03:09:53*kier quit (*.net *.split)
03:09:53*[CBR]Unspoken quit (*.net *.split)
03:09:53*vegansk quit (*.net *.split)
03:09:53*asdf quit (*.net *.split)
03:17:24*fold4 quit (Ping timeout: 256 seconds)
03:19:00*fold4 joined #nim
03:33:48*mrkishi quit (Ping timeout: 342 seconds)
03:36:43*emery joined #nim
03:40:31*mrkishi joined #nim
03:43:59*Varriount joined #nim
03:44:27*lompik quit (Ping timeout: 260 seconds)
03:47:00*Varriount__ quit (Ping timeout: 276 seconds)
03:52:03*StarBrilliant quit (Ping timeout: 268 seconds)
03:53:06*bjz joined #nim
03:55:25*StarBrilliant joined #nim
03:56:22*Xe quit (Ping timeout: 268 seconds)
03:57:14*Xe joined #nim
04:03:04*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:13:24*EastByte_ quit (Ping timeout: 260 seconds)
04:13:59*Xe quit (Ping timeout: 260 seconds)
04:14:00*[BNC]lokien quit (Ping timeout: 260 seconds)
04:15:00*EastByte_ joined #nim
04:15:17*space-wizard joined #nim
04:16:49*Xe joined #nim
04:17:22*lokien joined #nim
04:17:44*Xe quit (Excess Flood)
04:19:51*Xe joined #nim
04:23:04*Xe quit (Excess Flood)
04:25:07*Xe joined #nim
04:27:48*Xe quit (Excess Flood)
04:29:46*Xe joined #nim
04:30:17*StarBrilliant quit (Ping timeout: 268 seconds)
04:31:02*StarBrilliant joined #nim
04:31:59*Xe quit (Excess Flood)
04:32:43*Xe joined #nim
04:35:40*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:46:13gmpreussnerjamesp: you might want to look into 'flow based programming' or 'functional reactive programming'
04:46:19gmpreussnerthere are no frameworks yet afaik
04:46:34jamespah ok
04:46:40gmpreussneri'm currently working on an FRP framework, but it's still in the design stages :)
04:46:44jamespand i have one other question
04:46:49jamespmuch more basic haha
04:47:04jamespI declared type instrument_seq[T] = distinct seq[T]
04:47:22jamesplet arr: instrument_seq[int] = @[2, 3, 6, 7].instrument_seq
04:47:29jamesplet underlying = arr.seq
04:47:31jamespgives an error
04:48:44gmpreussnerdistinct types don
04:48:54gmpreussner...dont inherit the procs by default
04:49:02gmpreussneryou'll have to {.borrow.} them
04:49:07gmpreussnercheck the manual for details
04:49:24jamespthe procs?
04:49:29jamespso like if it were a distinct int
04:49:36jamespi can do instance.int right?
04:49:47jamesphow do you access the underlying value when it's a distinct sequence
04:50:40gmpreussnerthe assignment you have up there requires a converter, i think
04:51:14jamespgoing from distinct sequence to sequence requires a converter?
04:51:22jamesplike arr is fine, underlying gives an error
04:51:48gmpreussnerinstrument_seq[T] is a whole new type. none of the methods of seq[T] will be available by default
04:52:13jamespi don't want to use the methods
04:52:14gmpreussneror in other words, with distinct you cannot substitute the one type for the other
04:52:22jamespi want to access the underlying sequence
04:52:31jamespi'm trying to define my own method
04:52:39jamespproc `[]`[T](arr: instrument_seq[T], i: idx): T = arr.seq[i.int]
04:52:42gmpreussnerah, then i misunderstood. you should be able to cast?
04:52:43jamespdoesn't work :(
04:52:52jamespso for an int i don't have to cast
04:52:56jamespi can just do dot
04:53:01*themagician_j joined #nim
04:53:11jamesptype kg = distinct double
04:53:19jamesplet x: kg = 5.5.kg
04:53:23jamesplet y = kg.double
04:53:32jamesphow do i do the equivalent with a distinct sequence
04:54:05gmpreussneroh
04:54:14gmpreussnermaybe try arr.seq[int]
04:54:27*themagician quit (Ping timeout: 260 seconds)
04:56:04jamespthat doesn't work either
05:12:50*StarBrilliant quit (Ping timeout: 268 seconds)
05:15:55*space-wizard joined #nim
05:16:16*space-wizard quit (Client Quit)
05:18:31gmpreussnerthis works for me:
05:18:46gmpreussnertype MySeq[T] = distinct seq[T]
05:19:05gmpreussnerlet s: MySeq[int] = MySeq(@[1,2,3])
05:19:17gmpreussnerlet d = (seq[int])s
05:19:19gmpreussnerecho d
05:19:47gmpreussner@jamesp
05:19:49jamespah
05:19:50jamespthis works
05:20:00jamespwhy does the s.seq[int] not work
05:20:10jamespbut s.int would if s were a distinct int
05:20:18gmpreussnergood question. i don't know
05:20:31gmpreussnerAraq or dom96 might now
05:22:00gmpreussnerthis works too:
05:22:08gmpreussnerlet d = seq[int](s)
05:22:22gmpreussnerwhich should be the same as s.seq[int], i think
05:23:25gmpreussnerthis works, too:
05:23:34gmpreussnertype IntSeq = seq[int]
05:23:40gmpreussnerlet d = s.IntSeq
05:23:54gmpreussnercould be a bug with generics
05:24:05gmpreussneror maybe some weird parser rule
05:26:32jamespyeah sounds right
05:27:39*StarBrilliant joined #nim
05:30:42*space-wizard joined #nim
05:37:10jamespgmpreussner: If I wanted to have a type that was just the number 0..N how would I do that? So far I just see the ability to do this for 0..5 or something. Not a variable N
05:37:37jamesp(i'm trying to write a silly little sequence, index distinct types
05:38:44*cnu- quit (Ping timeout: 268 seconds)
05:39:22*cnu- joined #nim
05:41:49*StarBrilliant quit (Ping timeout: 268 seconds)
05:43:05*StarBrilliant joined #nim
05:47:41*jck quit (Quit: No Ping reply in 180 seconds.)
05:48:57*jck joined #nim
05:51:00*zepolen quit (Remote host closed the connection)
05:53:14gmpreussnerjamesp: not sure what you mean. are you looking for ranges, i.e. range[0..N] ?
05:53:35jamespkind of. but range is only compile time right?
05:53:43jamespis there anything like that where you can read N from stdin?
05:54:25gmpreussnerso you want to store a range/interval then?
05:54:39gmpreussnertypes are compile time, yes
05:55:25jamespmm so no way to get a type that is a strict subset of the integers at runtime?
05:56:12jamespSay you want to have an array of a set of objects that you'll determine from a file (and that won't change during runtime) is the standard technique to generate nim code with some python code?
05:56:23gmpreussnerim not sure what you mean. types are a compile time concept.
05:56:28jamespok
05:56:52jamesphaha nevermind my question is a little silly then
05:57:03gmpreussneryou can generate nim code and compile that at runtime, i suppose
05:57:12gmpreussneror you could use nimscript
05:57:50jamespmm nimscript might be what i'm thinking of
05:58:02jamespis this to programmatically do things for compile time?
05:58:40gmpreussnerso, there is one other thing you could do
05:59:02gmpreussneryou could process the file in the compiler via macros
05:59:05*cnu- quit (Ping timeout: 268 seconds)
05:59:20gmpreussnerand you could use the information gathered from the file to transform the syntax tree
05:59:26jamespoh ok
05:59:29gmpreussnerso you could generate nim code at compile time
05:59:31gmpreussnerfrom the file
05:59:37jamespso the macro generates the length of the array?
05:59:43*cnu- joined #nim
05:59:43gmpreussnerthis, of course, assumes that the file is available at compile time
05:59:44jamespthat's the only thing i want to generate really
05:59:48jamespyeah it is
06:00:02jamespso both macros and nimscript are good here?
06:00:23gmpreussneryes, you could generate array types with compiler generated item types and lengths
06:00:40gmpreussnermacros is what you want
06:00:43jamespah ok
06:00:52jamespso what is the primary purpose of nimscript?
06:01:00gmpreussneri havent worked with nimscript yet, but i don't think they're a compile time thing
06:01:05*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:01:08gmpreussnerit's meant to compile and execute nim code at runtime
06:01:09jamespoh ok
06:01:14jamespgot it
06:01:27jamespoh this is like for a repl?
06:01:49gmpreussneryeah, and configuration files, and scripting, and stuff like that
06:02:49jamespand macros are more for modifying the type system?
06:03:19gmpreussnermacros can transform existing code and generate new code at compile time
06:03:31jamespso like say we take this specific example
06:03:32gmpreussnerthey give you access to the syntax tree of your program
06:03:37jamespi want to have range[0..N]
06:03:41jamespand I want to generate N
06:03:54jamespbased on a numer in a file
06:04:03jamespsay it's called "length.txt"
06:04:08jamesphow would you do this?
06:04:58gmpreussneryeah, sorry, this is getting quite involved. you really need to learn macros and look at the existing examples. it's not straightforward, but it's also not rocket science. in a couple days you can work your way in.
06:05:18gmpreussnerthere is an example in the documentation somewhere for processing files in a macro
06:05:23gmpreussnerthat would be a good start
06:05:32*Carlos joined #nim
06:05:41jamespdo you have a link?
06:06:05gmpreussnerlet me check
06:06:29*lokien quit (Ping timeout: 268 seconds)
06:07:49*space-wizard joined #nim
06:08:30CarlosHey guys, I have a really quick question. I am very new to programming, most of what I do is done in R. It involves a lot of text file processing that is mostly done with Awk, but some of it (such as subsetting) it easier to do in R (think subset function in R). I was wondering if it's possible to read in files with Nim (I know there is a readFile command) and then for instance subset rows/lines based on specific criteria
06:08:52CarlosSomething like (choose all rows in Column 2 == "GENENAME")
06:08:56*space-wizard quit (Client Quit)
06:09:24*lokien joined #nim
06:09:26gmpreussnerjamesp: http://nim-lang.org/docs/tut2.html#macros-building-your-first-macro
06:09:38jamespawesome
06:09:39jamespthanks :)
06:09:45gmpreussnerthere are also a couple related things on the forums
06:09:58gmpreussnerforum search or Google might help :)
06:10:48*StarBrilliant quit (Ping timeout: 268 seconds)
06:11:50jamespyeah i found something related but hadn't seen your link
06:12:19jamespin a mainstream language there are like 50 answers for every question so it's really easy to find stuff
06:12:24jamesphere it's a little harder
06:13:08*StarBrilliant joined #nim
06:13:56jamespthank you
06:13:59jamespttyl!
06:14:16gmpreussneryou're welcome, cu
06:14:26gmpreussnerCarlos: i don't know if such functions exist in the stdlib yet
06:14:48*francisl joined #nim
06:14:49gmpreussnermaybe come back in a few hours and ask again. everyone's sleeping right now
06:15:00Carlosgmpreussner: I'm not sure either, I did do some extensive searching but couldn't find anything so came in here
06:15:06Carlosbut i'll do that, thanks ^_^
06:24:02*jamesp quit (Quit: Page closed)
06:37:00*space-wizard joined #nim
06:51:16*zepolen joined #nim
06:56:48*zepolen quit (Ping timeout: 276 seconds)
07:09:23*StarBrilliant quit (Ping timeout: 268 seconds)
07:11:44*StarBrilliant joined #nim
07:18:45*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:24:50*Carlos quit (Quit: Page closed)
07:33:26*cnu- quit (Ping timeout: 268 seconds)
07:34:02*cnu- joined #nim
07:34:35*francisl quit (Quit: francisl)
07:38:44*Xe quit (Ping timeout: 260 seconds)
07:44:15*Xe joined #nim
07:59:46*Varriount quit (Read error: Connection reset by peer)
08:01:52*nsf joined #nim
08:06:07*nkr quit (Ping timeout: 268 seconds)
08:07:41*nkr joined #nim
08:17:13*nkr quit (Ping timeout: 268 seconds)
08:20:11*nkr joined #nim
08:27:42*Xe quit (Ping timeout: 268 seconds)
08:28:49*Xe joined #nim
08:52:56*zepolen joined #nim
08:57:55*zepolen quit (Ping timeout: 268 seconds)
09:08:24*StarBrilliant quit (Ping timeout: 268 seconds)
09:11:31*StarBrilliant joined #nim
09:15:20*jaco60 joined #nim
09:30:58*jeffc joined #nim
09:33:41*pandada8 quit (Ping timeout: 244 seconds)
09:33:41*jeffc_ quit (Ping timeout: 244 seconds)
09:45:44*irrequietus joined #nim
09:46:54*pandada8 joined #nim
09:47:21*irrequietus quit (Remote host closed the connection)
09:52:54*irrequietus joined #nim
09:55:00*irrequietus quit (Remote host closed the connection)
09:55:49*irrequietus joined #nim
09:56:59*irrequietus quit (Remote host closed the connection)
09:58:21*StarBrilliant quit (Ping timeout: 268 seconds)
10:05:02*StarBrilliant joined #nim
10:06:44*irrequietus joined #nim
10:41:40*pafmaf joined #nim
10:49:33*lokien quit (Ping timeout: 268 seconds)
10:51:23*lokien joined #nim
10:54:45*zepolen joined #nim
10:55:38*jaco60 quit (Read error: Network is unreachable)
10:59:37*zepolen quit (Ping timeout: 260 seconds)
11:01:09*jaco60 joined #nim
11:40:04*yglukhov joined #nim
11:43:25*Ven joined #nim
11:44:32*yglukhov quit (Ping timeout: 260 seconds)
11:49:17*irrequietus quit ()
11:50:49*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:51:12*nkr quit (Ping timeout: 268 seconds)
11:53:41*nkr joined #nim
11:55:32*StarBrilliant quit (Ping timeout: 268 seconds)
11:58:13*StarBrilliant joined #nim
12:00:49*Matthias247 joined #nim
12:01:07*Guest1727 quit (Quit: Lost terminal)
12:02:53*yglukhov joined #nim
12:05:45*toaoMgeorge quit (Quit: Bye)
12:06:22*Ven joined #nim
12:06:53*Ven quit (Read error: Connection reset by peer)
12:07:02*pafmaf quit (Quit: This computer has gone to sleep)
12:15:07*wuehlmaus joined #nim
12:21:05*dorei joined #nim
12:24:31*kier joined #nim
12:29:46*Kingsquee joined #nim
12:53:16*gsingh93 quit (Ping timeout: 264 seconds)
12:53:52*GaveUp quit (Ping timeout: 264 seconds)
12:53:52*_stowa quit (Ping timeout: 264 seconds)
12:53:53*joebo quit (Ping timeout: 264 seconds)
12:53:54*federico3 quit (Ping timeout: 264 seconds)
12:53:54*zaquest quit (Ping timeout: 264 seconds)
12:54:28*Guest29888 quit (Ping timeout: 264 seconds)
12:54:28*ludocode quit (Ping timeout: 264 seconds)
12:54:29*apotheon quit (Ping timeout: 264 seconds)
12:54:29*RushPL quit (Ping timeout: 264 seconds)
12:54:29*OmIkRoNiXz quit (Ping timeout: 264 seconds)
12:54:30*silven_ quit (Ping timeout: 264 seconds)
12:54:31*Roin quit (Ping timeout: 264 seconds)
12:54:31*bbl_ quit (Ping timeout: 264 seconds)
12:54:32*SianaGearz quit (Ping timeout: 264 seconds)
12:54:32*Senketsu quit (Ping timeout: 264 seconds)
12:54:32*heinrich5991 quit (Ping timeout: 264 seconds)
12:54:33*sarlalian quit (Ping timeout: 264 seconds)
12:55:17*silven joined #nim
12:55:44*ludocode joined #nim
12:55:46*apotheon joined #nim
12:56:18*zepolen joined #nim
12:56:58*miko__ joined #nim
12:57:47*_stowa joined #nim
12:57:58*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
12:58:22*RushPL joined #nim
12:58:49*Kingsquee joined #nim
12:59:05*OmIkRoNiXz joined #nim
13:01:26*GaveUp joined #nim
13:01:30*zepolen quit (Ping timeout: 268 seconds)
13:01:40*miko__ quit (Ping timeout: 252 seconds)
13:02:00*miko__ joined #nim
13:02:54*exebook quit (Ping timeout: 244 seconds)
13:02:57*Vivek joined #nim
13:03:07*heinrich5991 joined #nim
13:03:20*Vivek is now known as Guest95751
13:04:00*yglukhov quit (Remote host closed the connection)
13:05:17*gsingh93 joined #nim
13:06:38*bbl_ joined #nim
13:07:09*joebo joined #nim
13:07:15*Roin joined #nim
13:08:17*apotheon quit (Ping timeout: 268 seconds)
13:08:38*Senketsu joined #nim
13:08:49*zaquest joined #nim
13:09:11*apotheon joined #nim
13:09:16*sarlalian joined #nim
13:11:59*nkr quit (Ping timeout: 268 seconds)
13:11:59*lokien quit (Ping timeout: 268 seconds)
13:12:21*federico3 joined #nim
13:12:28*jck quit (Remote host closed the connection)
13:12:36*StarBrilliant quit (Ping timeout: 268 seconds)
13:12:47*yglukhov joined #nim
13:13:51*cnu- quit (Ping timeout: 268 seconds)
13:14:27*jaco60 quit (Ping timeout: 268 seconds)
13:15:05*jck joined #nim
13:15:47*SianaGearz joined #nim
13:16:58*jaco60 joined #nim
13:17:12*nkr joined #nim
13:17:14*mahasamoot_ joined #nim
13:17:17*mahasamoot quit (Ping timeout: 260 seconds)
13:18:22*cnu- joined #nim
13:18:25*StarBrilliant joined #nim
13:21:08*mahasamoot joined #nim
13:22:09*lompik joined #nim
13:23:24*lokien joined #nim
13:23:33*mahasamoot_ quit (Ping timeout: 276 seconds)
13:25:49*mahasamoot_ joined #nim
13:27:19*zepolen joined #nim
13:27:47*mahasamoot quit (Ping timeout: 260 seconds)
13:27:51*mahasamoot__ joined #nim
13:29:19*sora joined #nim
13:30:07*mahasamoot_ quit (Ping timeout: 260 seconds)
13:36:45federico3def-: did you try the patch for https://github.com/nim-lang/Nim/issues/3823 against the released tarball? it's still failing
13:46:04*cheatfate_ joined #nim
13:47:45*lokien quit (Ping timeout: 268 seconds)
13:48:18*cheatfate quit (Ping timeout: 252 seconds)
13:50:24*lokien joined #nim
13:52:05*darkf quit (Quit: Leaving)
13:58:54*yglukhov quit (Remote host closed the connection)
14:07:06*arnetheduck quit (Ping timeout: 276 seconds)
14:25:27*Ven joined #nim
14:33:36*zepolen quit (Remote host closed the connection)
14:35:57*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
14:40:30*zepolen joined #nim
14:48:09*irrequietus joined #nim
14:51:34*DecoPerson quit (Ping timeout: 260 seconds)
14:52:08*DecoPerson joined #nim
14:52:09*Xe quit (Ping timeout: 260 seconds)
14:52:09*zepolen quit (Remote host closed the connection)
14:52:28*Senketsu quit (Ping timeout: 244 seconds)
14:52:28*_stowa quit (Ping timeout: 244 seconds)
14:52:59*RushPL quit (Ping timeout: 244 seconds)
14:53:29*lyro quit (Ping timeout: 244 seconds)
14:55:02*def- quit (Ping timeout: 244 seconds)
14:55:43*def- joined #nim
14:56:42*RushPL joined #nim
14:57:20*Xe joined #nim
14:59:25*yglukhov joined #nim
14:59:42*Xe quit (Excess Flood)
15:00:19*Xe joined #nim
15:01:58*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:04:02*yglukhov quit (Ping timeout: 260 seconds)
15:05:00*Senketsu joined #nim
15:06:02*lyro joined #nim
15:19:14*vendethiel joined #nim
15:24:04*_stowa joined #nim
15:25:24*Xe quit (Ping timeout: 260 seconds)
15:28:51*zepolen joined #nim
15:31:50*Xe joined #nim
15:34:09*zepolen quit (Ping timeout: 246 seconds)
15:47:54*boopsiesisaway is now known as boopsies
15:51:09*[CBR]Unspoken joined #nim
15:51:09*vegansk joined #nim
15:51:09*asdf joined #nim
15:56:08*Trustable joined #nim
15:57:49*Sterling joined #nim
15:58:12*Sterling is now known as Guest67149
15:58:26*Guest67149 quit (Client Quit)
16:05:47*zepolen joined #nim
16:06:59*zepolen quit (Remote host closed the connection)
16:23:48*rhinzler joined #nim
16:27:25*nsf quit (Quit: WeeChat 1.4)
16:30:33*lompik quit (Ping timeout: 268 seconds)
16:34:46*rhinzler quit (Ping timeout: 252 seconds)
16:41:52*nsf joined #nim
16:47:36*PMunch joined #nim
16:47:56*space-wizard joined #nim
16:53:22*space-wizard quit (Ping timeout: 268 seconds)
16:56:01*space-wizard joined #nim
16:56:14*lompik joined #nim
17:00:54*yglukhov joined #nim
17:02:04*francisl joined #nim
17:06:30*yglukhov quit (Ping timeout: 276 seconds)
17:07:15*PMunch quit (Ping timeout: 246 seconds)
17:07:38*zepolen joined #nim
17:12:44*zepolen quit (Ping timeout: 260 seconds)
17:13:15*GangstaCat quit (Quit: Leaving)
17:21:09*GangstaCat joined #nim
17:30:33*Jesin quit (Quit: Leaving)
17:31:35*Arrrr joined #nim
17:31:48ArrrrError: unhandled exception: 'C:\Documents' not in PATH. [NimbleError]
17:32:54ArrrrIs this expected?
17:33:08*francisl quit (Ping timeout: 244 seconds)
17:33:29*francisl_ joined #nim
17:38:04*sora quit (Remote host closed the connection)
17:43:39*vendethiel quit (Ping timeout: 260 seconds)
17:43:41*vendethiel- joined #nim
17:46:45*Arrrrr joined #nim
17:48:18*yglukhov joined #nim
17:50:04*Arrrr quit (Ping timeout: 260 seconds)
17:52:23*Arrrrr quit (Quit: WeeChat 1.2)
17:52:50*Arrrr joined #nim
17:53:12*yglukhov quit (Ping timeout: 260 seconds)
18:01:45*vendethiel- quit (Ping timeout: 276 seconds)
18:10:58*francisl_ quit (Quit: francisl_)
18:12:26gmpreussnerlooks like unquoted path string
18:13:30*sorakun joined #nim
18:20:21*Arrrr quit (Quit: WeeChat 1.2)
18:20:39*Arrrr joined #nim
18:21:43*Arrrr quit (Client Quit)
18:21:59*Arrrr joined #nim
18:26:37*sorakun quit (Remote host closed the connection)
18:27:56*themagician_j quit ()
18:30:37*vendethiel joined #nim
18:35:13dom96Arrrr: please report it on Github
18:46:48*themagician joined #nim
18:53:45*vendethiel quit (Ping timeout: 276 seconds)
18:54:26*Carlos joined #nim
18:56:39CarlosHey everyone! I have a question. I am rather new to Nim, and my work involves a lot of text file processing. I normally accomplish this in R, and I was wondering if Nim was capable of reading in a text file, and then parsing it for specific data. (Think subset function in R, something like if Column 2 in TEXTFILE == "GENENAME" then print out all rows that are TRUE).
18:57:21CarlosI'm aware AWK does this, but i'd like to be able to incorporate it into Nim scripts incase my collaborators are not Awk intuitive.
18:57:23*Trustable quit (Remote host closed the connection)
18:57:32*mnemonikk_ is now known as mnemonikk
18:57:33*mnemonikk quit (Changing host)
18:57:33*mnemonikk joined #nim
18:57:37doreiawk <3
18:58:22dom96hello Carlos!
18:58:54CarlosHi dom96! And yes, awk is quite useful :P
18:58:58dom96Carlos: I'm sadly not familiar with R so I'm not entirely sure what you mean. What's the format of the file that you are reading?
18:59:14CarlosIt's a tab delimited file with # columns and # rows
18:59:34CarlosColumn 1 Column 2 Column 3
18:59:44Carlos1 genename 0.000
18:59:47Carlosand so on
19:00:11CarlosSo i'm interested in knowing if Nim can identify all the rows that have a specific genename in column 2 and then write out only those names to a file
19:00:22Carlossorry not names i meant rows
19:00:59dom96Hrm. The best way to tackle this would be to use the parsecsv module http://nim-lang.org/docs/parsecsv.html
19:01:13dom96you can pass a custom separator to the `open` proc
19:01:29dom96so you could just pass '\t' and it should work
19:04:28CarlosGreat! This answers the question about reading in the text file. If I was interested in keeping only rows that contained a specific string from Column 2 ... would this be done using an If statement?
19:09:07*zepolen joined #nim
19:09:10dom96Carlos: yep
19:09:46CarlosAppreciate it, was hoping that Nim could do this. I love the language.
19:09:57dom96Carlos: just call readRow in a loop and check the CsvParser's 'row' field.
19:10:08CarlosExcellent! Thanks again
19:10:16dom96np :)
19:14:35*zepolen quit (Ping timeout: 268 seconds)
19:17:58*Arrrr quit (Quit: WeeChat 1.2)
19:22:55*Arrrr joined #nim
19:23:26*cjbest joined #nim
19:25:41*francisl joined #nim
19:27:58cjbestCan I ask newb questions in here, or is that discouraged? Trying to compile the example from nim-portaudio, getting stuck on undeclared identifier: '<anything from portaudio.*>
19:28:01*vendethiel joined #nim
19:28:22*Arrrr quit (Changing host)
19:28:22*Arrrr joined #nim
19:35:06*yglukhov joined #nim
19:43:14*Carlos quit (Ping timeout: 252 seconds)
19:48:03*yglukhov quit (Remote host closed the connection)
19:48:56*yglukhov joined #nim
19:49:17*vendethiel quit (Ping timeout: 260 seconds)
19:50:16dom96cjbest: newb questions are more than welcome
19:50:20dom96cjbest: what's your code?
19:50:55cjbestdom96 awesome! posted some more details here http://forum.nim-lang.org/t/2077
19:51:36cjbestI'm trying to compile the portaudio example code from https://bitbucket.org/BitPuffin/nim-portaudio/src/761fb0007245e5c3de576e69d4885442c5bf3d49/examples/saw_out.nim?at=default&fileviewer=file-view-default
19:52:19cjbestmust be missing something something simple. perhaps should read more the book and come back :)
19:53:22*yglukhov quit (Ping timeout: 260 seconds)
19:54:12*pandada8 quit (Ping timeout: 244 seconds)
19:54:17cjbestpossible the example is incorrect/out of date, but thought it more likely I'm doing something wrong
19:54:29*pandada8 joined #nim
19:54:50dom96cjbest: hrm, it looks to me like you are doing nothing wrong :)
19:54:56dom96The example looks out of date.
19:55:11cjbesthmm, because language changes?
19:55:42dom96I'm not sure
19:56:21dom96looking into it now
20:00:08dom96ahh, it is due to a language change.
20:00:19dom96The first letter of an identifier is now case sensitive.
20:00:42cjbestahhh
20:00:43dom96It's defined as NoError in portaudio
20:00:51dom96but noError is used in the example
20:01:16cjbesthey, that's simple enough I could probably make a pull request for it
20:01:34dom96that would be awesome :)
20:01:56*sorakun joined #nim
20:02:15cjbestyup works. thanks!
20:04:14*Arrrr quit (Quit: WeeChat 1.4)
20:06:55dom96Also added an issue so that we can get nicer issues for this in the future (hopefully) https://github.com/nim-lang/Nim/issues/3911
20:10:35*zepolen joined #nim
20:15:19*zepolen quit (Ping timeout: 260 seconds)
20:16:21*vendethiel joined #nim
20:18:55cjbestdom96: sweet deal. Thanks for your help. Might have bashed my head for a while on my own. Think I figured out how to do a BitBucket pull request too https://bitbucket.org/BitPuffin/nim-portaudio/pull-requests/5/fix-case-in-example/diff
20:19:48cjbestis first letter capitalized for exported stuff a convention?
20:20:04dom96cjbest: no, in fact procedure names shouldn't be capitalised.
20:20:18dom96But changing all of them would be much more work
20:20:22dom96thank you for creating that PR
20:20:30dom96I've got the author on Skype so I will ping him :)
20:21:22cjbesthaha cool. If he wants it the other way, and it's just a bunch of annoying typing, I can do that too :)
20:31:15*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:31:41*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:35:44*cjbest joined #nim
20:35:57*cjbest quit (Client Quit)
20:38:05*vendethiel quit (Ping timeout: 250 seconds)
20:47:01*vendethiel joined #nim
20:48:45*zepolen joined #nim
20:50:01*Jesin joined #nim
21:00:03*francisl quit (Quit: francisl)
21:00:20*kulelu88 joined #nim
21:00:20*kulelu88 quit (Changing host)
21:00:20*kulelu88 joined #nim
21:01:30*irrequietus quit ()
21:01:45*pafmaf joined #nim
21:06:49*pregressive joined #nim
21:09:41*apotheon quit (Ping timeout: 248 seconds)
21:09:42*GangstaCat quit (Ping timeout: 248 seconds)
21:10:05*GangstaCat joined #nim
21:14:57*apotheon joined #nim
21:15:50*Araq quit (Ping timeout: 244 seconds)
21:16:44*sorakun quit (Remote host closed the connection)
21:17:54*Amrykid quit (Ping timeout: 244 seconds)
21:20:06*Araq joined #nim
21:23:36*Amrykid joined #nim
21:24:50*space-wizard joined #nim
21:27:50*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:29:18*samdoran joined #nim
21:31:51samdorandom96: thanks for the help on Thursday! I couldn't manage to stay connected to irc for any period of time, but saw the messages later in the logs
21:50:23*yglukhov joined #nim
21:50:46*Guest48054 is now known as \u
21:50:54*\u quit (Changing host)
21:50:54*\u joined #nim
21:55:17*yglukhov quit (Ping timeout: 260 seconds)
21:58:12*zepolen quit (Read error: Connection reset by peer)
22:20:41*dorei quit ()
22:32:02*PMunch joined #nim
22:45:29*vendethiel quit (Ping timeout: 268 seconds)
22:58:49*zepolen joined #nim
23:00:32*boopsies is now known as boopsiesisaway
23:03:33*zepolen quit (Ping timeout: 246 seconds)
23:05:46*pregressive quit (Remote host closed the connection)
23:10:05*brson joined #nim
23:13:25*Sys joined #nim
23:15:37SysHi everyone. I'm not looking for an answer here, but I was hoping someone could guide me on how to start solving this problem? http://rosalind.info/problems/dna/ (it's not for homework)
23:17:29*pafmaf quit (Quit: This computer has gone to sleep)
23:17:49dom96Sys: define 4 integers, iterate over each character in string, check what the character is and depending on it increment one of the 4 integers.
23:18:51SysSounds like i'm heading in the right direction then. Is it okay if we post code samples here for guidance?
23:19:58dom96Sys: sure
23:25:45Sysvar data: string = 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC' var A, C, G, T: int = 0 for letter in data: if letter == "A": A = += 1 elif letter == "C": C = += 1 elif letter == "G": G = += 1 elif letter == "T": T = += 1 echo $A echo $C echo $G echo $T
23:26:03Syssorry formatting a little off
23:26:09*zepolen joined #nim
23:26:19SysI get a error: missing final ' for character literal
23:30:20dom96Sys: Please use a pastebin such as http://gist.github.com
23:31:21dom96You must use " for string literals
23:31:26dom96' is for characters only
23:32:58Syshttps://gist.github.com/c-guzman/416413e5cc52bc59b77b
23:34:06SysOkay that fixed one part of the error; Updated the Ghist code
23:35:54dom96https://gist.github.com/c-guzman/416413e5cc52bc59b77b#file-rosalind_counting_dna_nucleotides-nim-L11
23:36:03dom96'= +=' is wrong
23:36:04SysNim is my first language, so I apoligize if it's something incredidibly simple
23:36:23SysWould it be A += 1?
23:36:30dom96Sys: It's fine. Just out of curiosity, why did you choose to learn Nim first?
23:36:33dom96yeah, that should work
23:36:47dom96It's more idiomatic to do A.inc(1) though
23:36:57dom96or rather A.inc()
23:37:30SysI am entering a bioinformatics field where most of my research has shown that it's incredibly difficult to reproduce results. I think Nim is an incredible way to make the reproducibility of my code easier.
23:37:59SysI see, that's helpful let me try it out
23:39:47SysGreat! That ended up working :D
23:40:16dom96Sys: Interesting. But I'm still curious, what made you decide on Nim specifically over other programming languages?
23:41:37SysMost of the advice i've been given is that Python would be the way to go. I met up with one of my potential advisors and he suggested that I learn Nim. Having no programming background was apparently to my advantage since I could learn syntax and rules easily since I didn't have any bad habits.
23:43:41SysI suppose I don't really have a 'reason' at least not a technical one that makes sense. The advisor is pretty well known in bioinformatics, and he believes that Nim / Julia are probably the languages of the future.
23:43:50SysNim due to its portability.
23:44:13SysSo at his suggestion, this is where I ended up
23:44:28dom96Awesome! :)
23:44:56dom96Unfortunately there aren't any beginner friendly tutorials for Nim
23:45:03SysQuestion: If I would have placed "
23:45:28SysNevermind, it's easier if I just go ahead and try it :P
23:46:08SysAhh yes I see
23:46:18SysSo the if statement can't find "A", but it can find 'A'
23:46:25dom96I am writing a book about Nim aimed at people with some programming experience already, but you may still be interested in reading it.
23:46:33SysDefinitely
23:46:38dom96https://manning.com/books/nim-in-action?a_aid=niminaction&a_bid=78a27e81
23:47:21dom96Yeah. Inside a single quote you can only have, well, a single character :)
23:47:33dom96Its type is 'char'
23:47:46dom96whereas inside a double quote you can have multiple characters
23:47:51dom96and the type is then a 'string'
23:49:40SysMakes sense, i'm gonna go ahead and give your book a shot. I've never been much of a learner by reading, but with the language being quite new, need all the help I can get :)
23:50:28dom96Sys: Great! Let me know what you think of it once you get a chance to read it :)
23:51:16SysWill do!
23:51:55*yglukhov joined #nim
23:52:03*miko__ quit (Ping timeout: 248 seconds)
23:52:46def-Sys: made it a bit simpler: https://gist.github.com/def-/1c7210ff7858d2d20374
23:54:20SysThank you very much, a quick question. For the echo procedure, are those " " mandatory to insert empty spaces between each number? For instance if I had something like 15 letters instead of 4, that'd get rather tedious
23:55:00def-right, then you should use formatting, for example strutils.format: http://nim-lang.org/docs/strutils.html#format,string,varargs[string,]
23:55:06def-or the excellent strfmt library
23:55:35SysAh perfect, i'll look into these, thank you!
23:56:03*yglukhov quit (Ping timeout: 246 seconds)