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:28 | jamesp | Hey! Is there any programming paradigm in nim that resembles manipulating a real time stream (building a circuit that gets stepped multiple times) |
01:15:00 | jamesp | So the goal is to have a procedure update(T t), and then update is the "source" |
01:15:10 | jamesp | And 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:31 | jamesp | g1(f(update)), g2(f(update)) |
01:15:55 | * | darkf joined #nim |
01:16:07 | * | nsf quit (Quit: WeeChat 1.4) |
01:16:17 | jamesp | where 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:01 | Araq | jamesp: nim has lambdas |
01:39:29 | jamesp | Yes, but I don't think lambdas alone solve this problem :(. I think I need another trick |
01:40:15 | jamesp | like 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:53 | jamesp | and 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:13 | gmpreussner | jamesp: you might want to look into 'flow based programming' or 'functional reactive programming' |
04:46:19 | gmpreussner | there are no frameworks yet afaik |
04:46:34 | jamesp | ah ok |
04:46:40 | gmpreussner | i'm currently working on an FRP framework, but it's still in the design stages :) |
04:46:44 | jamesp | and i have one other question |
04:46:49 | jamesp | much more basic haha |
04:47:04 | jamesp | I declared type instrument_seq[T] = distinct seq[T] |
04:47:22 | jamesp | let arr: instrument_seq[int] = @[2, 3, 6, 7].instrument_seq |
04:47:29 | jamesp | let underlying = arr.seq |
04:47:31 | jamesp | gives an error |
04:48:44 | gmpreussner | distinct types don |
04:48:54 | gmpreussner | ...dont inherit the procs by default |
04:49:02 | gmpreussner | you'll have to {.borrow.} them |
04:49:07 | gmpreussner | check the manual for details |
04:49:24 | jamesp | the procs? |
04:49:29 | jamesp | so like if it were a distinct int |
04:49:36 | jamesp | i can do instance.int right? |
04:49:47 | jamesp | how do you access the underlying value when it's a distinct sequence |
04:50:40 | gmpreussner | the assignment you have up there requires a converter, i think |
04:51:14 | jamesp | going from distinct sequence to sequence requires a converter? |
04:51:22 | jamesp | like arr is fine, underlying gives an error |
04:51:48 | gmpreussner | instrument_seq[T] is a whole new type. none of the methods of seq[T] will be available by default |
04:52:13 | jamesp | i don't want to use the methods |
04:52:14 | gmpreussner | or in other words, with distinct you cannot substitute the one type for the other |
04:52:22 | jamesp | i want to access the underlying sequence |
04:52:31 | jamesp | i'm trying to define my own method |
04:52:39 | jamesp | proc `[]`[T](arr: instrument_seq[T], i: idx): T = arr.seq[i.int] |
04:52:42 | gmpreussner | ah, then i misunderstood. you should be able to cast? |
04:52:43 | jamesp | doesn't work :( |
04:52:52 | jamesp | so for an int i don't have to cast |
04:52:56 | jamesp | i can just do dot |
04:53:01 | * | themagician_j joined #nim |
04:53:11 | jamesp | type kg = distinct double |
04:53:19 | jamesp | let x: kg = 5.5.kg |
04:53:23 | jamesp | let y = kg.double |
04:53:32 | jamesp | how do i do the equivalent with a distinct sequence |
04:54:05 | gmpreussner | oh |
04:54:14 | gmpreussner | maybe try arr.seq[int] |
04:54:27 | * | themagician quit (Ping timeout: 260 seconds) |
04:56:04 | jamesp | that 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:31 | gmpreussner | this works for me: |
05:18:46 | gmpreussner | type MySeq[T] = distinct seq[T] |
05:19:05 | gmpreussner | let s: MySeq[int] = MySeq(@[1,2,3]) |
05:19:17 | gmpreussner | let d = (seq[int])s |
05:19:19 | gmpreussner | echo d |
05:19:47 | gmpreussner | @jamesp |
05:19:49 | jamesp | ah |
05:19:50 | jamesp | this works |
05:20:00 | jamesp | why does the s.seq[int] not work |
05:20:10 | jamesp | but s.int would if s were a distinct int |
05:20:18 | gmpreussner | good question. i don't know |
05:20:31 | gmpreussner | Araq or dom96 might now |
05:22:00 | gmpreussner | this works too: |
05:22:08 | gmpreussner | let d = seq[int](s) |
05:22:22 | gmpreussner | which should be the same as s.seq[int], i think |
05:23:25 | gmpreussner | this works, too: |
05:23:34 | gmpreussner | type IntSeq = seq[int] |
05:23:40 | gmpreussner | let d = s.IntSeq |
05:23:54 | gmpreussner | could be a bug with generics |
05:24:05 | gmpreussner | or maybe some weird parser rule |
05:26:32 | jamesp | yeah sounds right |
05:27:39 | * | StarBrilliant joined #nim |
05:30:42 | * | space-wizard joined #nim |
05:37:10 | jamesp | gmpreussner: 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:37 | jamesp | (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:14 | gmpreussner | jamesp: not sure what you mean. are you looking for ranges, i.e. range[0..N] ? |
05:53:35 | jamesp | kind of. but range is only compile time right? |
05:53:43 | jamesp | is there anything like that where you can read N from stdin? |
05:54:25 | gmpreussner | so you want to store a range/interval then? |
05:54:39 | gmpreussner | types are compile time, yes |
05:55:25 | jamesp | mm so no way to get a type that is a strict subset of the integers at runtime? |
05:56:12 | jamesp | Say 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:23 | gmpreussner | im not sure what you mean. types are a compile time concept. |
05:56:28 | jamesp | ok |
05:56:52 | jamesp | haha nevermind my question is a little silly then |
05:57:03 | gmpreussner | you can generate nim code and compile that at runtime, i suppose |
05:57:12 | gmpreussner | or you could use nimscript |
05:57:50 | jamesp | mm nimscript might be what i'm thinking of |
05:58:02 | jamesp | is this to programmatically do things for compile time? |
05:58:40 | gmpreussner | so, there is one other thing you could do |
05:59:02 | gmpreussner | you could process the file in the compiler via macros |
05:59:05 | * | cnu- quit (Ping timeout: 268 seconds) |
05:59:20 | gmpreussner | and you could use the information gathered from the file to transform the syntax tree |
05:59:26 | jamesp | oh ok |
05:59:29 | gmpreussner | so you could generate nim code at compile time |
05:59:31 | gmpreussner | from the file |
05:59:37 | jamesp | so the macro generates the length of the array? |
05:59:43 | * | cnu- joined #nim |
05:59:43 | gmpreussner | this, of course, assumes that the file is available at compile time |
05:59:44 | jamesp | that's the only thing i want to generate really |
05:59:48 | jamesp | yeah it is |
06:00:02 | jamesp | so both macros and nimscript are good here? |
06:00:23 | gmpreussner | yes, you could generate array types with compiler generated item types and lengths |
06:00:40 | gmpreussner | macros is what you want |
06:00:43 | jamesp | ah ok |
06:00:52 | jamesp | so what is the primary purpose of nimscript? |
06:01:00 | gmpreussner | i 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:08 | gmpreussner | it's meant to compile and execute nim code at runtime |
06:01:09 | jamesp | oh ok |
06:01:14 | jamesp | got it |
06:01:27 | jamesp | oh this is like for a repl? |
06:01:49 | gmpreussner | yeah, and configuration files, and scripting, and stuff like that |
06:02:49 | jamesp | and macros are more for modifying the type system? |
06:03:19 | gmpreussner | macros can transform existing code and generate new code at compile time |
06:03:31 | jamesp | so like say we take this specific example |
06:03:32 | gmpreussner | they give you access to the syntax tree of your program |
06:03:37 | jamesp | i want to have range[0..N] |
06:03:41 | jamesp | and I want to generate N |
06:03:54 | jamesp | based on a numer in a file |
06:04:03 | jamesp | say it's called "length.txt" |
06:04:08 | jamesp | how would you do this? |
06:04:58 | gmpreussner | yeah, 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:18 | gmpreussner | there is an example in the documentation somewhere for processing files in a macro |
06:05:23 | gmpreussner | that would be a good start |
06:05:32 | * | Carlos joined #nim |
06:05:41 | jamesp | do you have a link? |
06:06:05 | gmpreussner | let me check |
06:06:29 | * | lokien quit (Ping timeout: 268 seconds) |
06:07:49 | * | space-wizard joined #nim |
06:08:30 | Carlos | Hey 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:52 | Carlos | Something like (choose all rows in Column 2 == "GENENAME") |
06:08:56 | * | space-wizard quit (Client Quit) |
06:09:24 | * | lokien joined #nim |
06:09:26 | gmpreussner | jamesp: http://nim-lang.org/docs/tut2.html#macros-building-your-first-macro |
06:09:38 | jamesp | awesome |
06:09:39 | jamesp | thanks :) |
06:09:45 | gmpreussner | there are also a couple related things on the forums |
06:09:58 | gmpreussner | forum search or Google might help :) |
06:10:48 | * | StarBrilliant quit (Ping timeout: 268 seconds) |
06:11:50 | jamesp | yeah i found something related but hadn't seen your link |
06:12:19 | jamesp | in a mainstream language there are like 50 answers for every question so it's really easy to find stuff |
06:12:24 | jamesp | here it's a little harder |
06:13:08 | * | StarBrilliant joined #nim |
06:13:56 | jamesp | thank you |
06:13:59 | jamesp | ttyl! |
06:14:16 | gmpreussner | you're welcome, cu |
06:14:26 | gmpreussner | Carlos: i don't know if such functions exist in the stdlib yet |
06:14:48 | * | francisl joined #nim |
06:14:49 | gmpreussner | maybe come back in a few hours and ask again. everyone's sleeping right now |
06:15:00 | Carlos | gmpreussner: I'm not sure either, I did do some extensive searching but couldn't find anything so came in here |
06:15:06 | Carlos | but 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:45 | federico3 | def-: 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:48 | Arrrr | Error: unhandled exception: 'C:\Documents' not in PATH. [NimbleError] |
17:32:54 | Arrrr | Is 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:26 | gmpreussner | looks 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:13 | dom96 | Arrrr: 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:39 | Carlos | Hey 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:21 | Carlos | I'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:37 | dorei | awk <3 |
18:58:22 | dom96 | hello Carlos! |
18:58:54 | Carlos | Hi dom96! And yes, awk is quite useful :P |
18:58:58 | dom96 | Carlos: 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:14 | Carlos | It's a tab delimited file with # columns and # rows |
18:59:34 | Carlos | Column 1 Column 2 Column 3 |
18:59:44 | Carlos | 1 genename 0.000 |
18:59:47 | Carlos | and so on |
19:00:11 | Carlos | So 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:22 | Carlos | sorry not names i meant rows |
19:00:59 | dom96 | Hrm. The best way to tackle this would be to use the parsecsv module http://nim-lang.org/docs/parsecsv.html |
19:01:13 | dom96 | you can pass a custom separator to the `open` proc |
19:01:29 | dom96 | so you could just pass '\t' and it should work |
19:04:28 | Carlos | Great! 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:10 | dom96 | Carlos: yep |
19:09:46 | Carlos | Appreciate it, was hoping that Nim could do this. I love the language. |
19:09:57 | dom96 | Carlos: just call readRow in a loop and check the CsvParser's 'row' field. |
19:10:08 | Carlos | Excellent! Thanks again |
19:10:16 | dom96 | np :) |
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:58 | cjbest | Can 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:16 | dom96 | cjbest: newb questions are more than welcome |
19:50:20 | dom96 | cjbest: what's your code? |
19:50:55 | cjbest | dom96 awesome! posted some more details here http://forum.nim-lang.org/t/2077 |
19:51:36 | cjbest | I'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:19 | cjbest | must 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:17 | cjbest | possible 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:50 | dom96 | cjbest: hrm, it looks to me like you are doing nothing wrong :) |
19:54:56 | dom96 | The example looks out of date. |
19:55:11 | cjbest | hmm, because language changes? |
19:55:42 | dom96 | I'm not sure |
19:56:21 | dom96 | looking into it now |
20:00:08 | dom96 | ahh, it is due to a language change. |
20:00:19 | dom96 | The first letter of an identifier is now case sensitive. |
20:00:42 | cjbest | ahhh |
20:00:43 | dom96 | It's defined as NoError in portaudio |
20:00:51 | dom96 | but noError is used in the example |
20:01:16 | cjbest | hey, that's simple enough I could probably make a pull request for it |
20:01:34 | dom96 | that would be awesome :) |
20:01:56 | * | sorakun joined #nim |
20:02:15 | cjbest | yup works. thanks! |
20:04:14 | * | Arrrr quit (Quit: WeeChat 1.4) |
20:06:55 | dom96 | Also 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:55 | cjbest | dom96: 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:48 | cjbest | is first letter capitalized for exported stuff a convention? |
20:20:04 | dom96 | cjbest: no, in fact procedure names shouldn't be capitalised. |
20:20:18 | dom96 | But changing all of them would be much more work |
20:20:22 | dom96 | thank you for creating that PR |
20:20:30 | dom96 | I've got the author on Skype so I will ping him :) |
20:21:22 | cjbest | haha 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:51 | samdoran | dom96: 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:37 | Sys | Hi 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:49 | dom96 | Sys: 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:51 | Sys | Sounds like i'm heading in the right direction then. Is it okay if we post code samples here for guidance? |
23:19:58 | dom96 | Sys: sure |
23:25:45 | Sys | var 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:03 | Sys | sorry formatting a little off |
23:26:09 | * | zepolen joined #nim |
23:26:19 | Sys | I get a error: missing final ' for character literal |
23:30:20 | dom96 | Sys: Please use a pastebin such as http://gist.github.com |
23:31:21 | dom96 | You must use " for string literals |
23:31:26 | dom96 | ' is for characters only |
23:32:58 | Sys | https://gist.github.com/c-guzman/416413e5cc52bc59b77b |
23:34:06 | Sys | Okay that fixed one part of the error; Updated the Ghist code |
23:35:54 | dom96 | https://gist.github.com/c-guzman/416413e5cc52bc59b77b#file-rosalind_counting_dna_nucleotides-nim-L11 |
23:36:03 | dom96 | '= +=' is wrong |
23:36:04 | Sys | Nim is my first language, so I apoligize if it's something incredidibly simple |
23:36:23 | Sys | Would it be A += 1? |
23:36:30 | dom96 | Sys: It's fine. Just out of curiosity, why did you choose to learn Nim first? |
23:36:33 | dom96 | yeah, that should work |
23:36:47 | dom96 | It's more idiomatic to do A.inc(1) though |
23:36:57 | dom96 | or rather A.inc() |
23:37:30 | Sys | I 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:59 | Sys | I see, that's helpful let me try it out |
23:39:47 | Sys | Great! That ended up working :D |
23:40:16 | dom96 | Sys: Interesting. But I'm still curious, what made you decide on Nim specifically over other programming languages? |
23:41:37 | Sys | Most 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:41 | Sys | I 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:50 | Sys | Nim due to its portability. |
23:44:13 | Sys | So at his suggestion, this is where I ended up |
23:44:28 | dom96 | Awesome! :) |
23:44:56 | dom96 | Unfortunately there aren't any beginner friendly tutorials for Nim |
23:45:03 | Sys | Question: If I would have placed " |
23:45:28 | Sys | Nevermind, it's easier if I just go ahead and try it :P |
23:46:08 | Sys | Ahh yes I see |
23:46:18 | Sys | So the if statement can't find "A", but it can find 'A' |
23:46:25 | dom96 | I 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:33 | Sys | Definitely |
23:46:38 | dom96 | https://manning.com/books/nim-in-action?a_aid=niminaction&a_bid=78a27e81 |
23:47:21 | dom96 | Yeah. Inside a single quote you can only have, well, a single character :) |
23:47:33 | dom96 | Its type is 'char' |
23:47:46 | dom96 | whereas inside a double quote you can have multiple characters |
23:47:51 | dom96 | and the type is then a 'string' |
23:49:40 | Sys | Makes 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:28 | dom96 | Sys: Great! Let me know what you think of it once you get a chance to read it :) |
23:51:16 | Sys | Will do! |
23:51:55 | * | yglukhov joined #nim |
23:52:03 | * | miko__ quit (Ping timeout: 248 seconds) |
23:52:46 | def- | Sys: made it a bit simpler: https://gist.github.com/def-/1c7210ff7858d2d20374 |
23:54:20 | Sys | Thank 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:00 | def- | right, then you should use formatting, for example strutils.format: http://nim-lang.org/docs/strutils.html#format,string,varargs[string,] |
23:55:06 | def- | or the excellent strfmt library |
23:55:35 | Sys | Ah perfect, i'll look into these, thank you! |
23:56:03 | * | yglukhov quit (Ping timeout: 246 seconds) |