00:20:11 | * | q66 quit (Quit: Quit) |
00:22:17 | dom96 | Not a bad idea. |
00:29:22 | * | XAMPP-8 joined #nimrod |
00:37:35 | * | comex` is now known as comex |
01:54:35 | * | fowl joined #nimrod |
06:00:01 | * | fowl quit (Quit: Leaving) |
06:13:41 | * | shevy joined #nimrod |
06:14:38 | shevy | heya |
06:16:11 | shevy | I forgot again |
06:16:22 | shevy | how do I compile nimrod into a specific prefix? |
06:16:39 | shevy | I am looking at http://nimrod-code.org/download.html, not sure about the prefix |
06:16:58 | shevy | oh wait |
06:17:00 | shevy | found it |
06:17:03 | shevy | "There are also install.sh and deinstall.sh scripts for distributing the files over the UNIX hierarchy." |
06:17:42 | shevy | sh install.sh /Programs/Nimrod/0.9.0 |
06:17:44 | shevy | I think that has worked |
06:18:33 | shevy | yeah |
06:18:39 | shevy | the bin/nimrod seems to work fine |
06:46:28 | * | zahary joined #nimrod |
06:46:41 | * | zahary1 quit (Read error: Connection reset by peer) |
08:50:23 | * | zahary quit (Read error: Connection reset by peer) |
08:50:28 | * | zahary1 joined #nimrod |
08:56:32 | * | XAMPP-8 quit (Ping timeout: 272 seconds) |
09:14:24 | * | Araq_ joined #nimrod |
09:39:56 | * | Araq_ quit (Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]) |
09:53:25 | * | zahary1 quit (Read error: No route to host) |
09:53:34 | * | zahary joined #nimrod |
10:26:24 | dom96 | yay shevy |
10:26:32 | dom96 | Getting back into Nimrod i see :) |
10:36:07 | shevy | well |
10:36:14 | shevy | I am trying to start with bio-nimrod slowly |
10:36:47 | dom96 | great. Let us know if you need any help :) |
12:21:49 | * | fowl joined #nimrod |
13:49:35 | * | q66 joined #nimrod |
14:21:34 | dom96 | _ponce: I see you've been promoting Nimrod on reddit a bit, awesome :) |
14:26:29 | * | Araq_ joined #nimrod |
14:27:19 | * | Araq_ quit (Client Quit) |
14:32:02 | _ponce | dom96: I HATE that influx of false solutions like Go, vanilla C, C2 |
14:32:16 | dom96 | Same. |
14:32:19 | _ponce | only working for my own sanity |
14:32:57 | _ponce | moreover, languages which do not support the "STL" style, aka typeclasses, aka concepts... are imho worthless |
14:33:00 | dom96 | I seem to dislike all C-like languages, so even the syntax bothers me... |
14:33:44 | _ponce | and as a codec C++ programmer I'd like to see actual problems being solved :) not imaginary ones |
14:33:46 | dom96 | And all these languages like to copy C's syntax. |
14:33:57 | _ponce | don't forget the comma :) |
14:34:32 | dom96 | But yeah, syntax is hardly a problem. |
14:34:48 | dom96 | I just love Nimrod's syntax though :P |
14:34:52 | _ponce | C also has ugly integer promotion rules |
14:35:38 | _ponce | for me the main problem is not syntax but |
14:35:54 | _ponce | I've been hopping from Delphi to ocaml to D to C++ etc |
14:36:03 | _ponce | and I must rewrite everything each time |
14:36:24 | dom96 | hehe, just rewrite it once more in Nimrod ;) |
14:36:24 | _ponce | I'd like languages that let express very general algorithm and data structures separately |
14:36:51 | _ponce | it's even worse in a team, and there seems to be an offspring problem |
14:37:09 | _ponce | everyone using only the idioms she known or created |
14:37:57 | _ponce | so imho there is an ugly social aspect to non-reusable code (only one type of polymorphism), it lead to sofware inconsistency |
14:38:01 | dom96 | yes. But perhaps strict code style rules can help with that |
14:38:38 | _ponce | I don't know. People generally agree on syntax, formatting that don't matter much |
14:38:53 | _ponce | then tell nothing about how much abstractions you are allowed to add |
14:39:03 | _ponce | or the philosophy of a module or something |
14:40:04 | _ponce | so the main thing with Nimrod for me is 1. it support "typeclasses" 2. compile to many target, code would be immortal :) |
14:40:32 | dom96 | hrm, I wonder. What do you mean by "typeclasses"? |
14:41:05 | _ponce | I mean C++ concepts, D static if(isSomething!T), Scala traits |
14:41:16 | dom96 | You mean templates? |
14:41:25 | _ponce | yeah, using them like in STL |
14:41:41 | dom96 | ahh yeah. I was wondering if you meant like Haskell's type classes. |
14:41:50 | _ponce | "a type is an X if it provide operations Y and Z" |
14:41:58 | dom96 | Nimrod's templates/macros are IMO the best. |
14:41:58 | _ponce | no, probably not like Haskell |
14:42:21 | _ponce | then write algorithm based on the minimum amount of operations |
14:42:27 | dom96 | As with #2: I agree, portability is another reason I love Nimrod :D |
14:43:26 | dom96 | Have you written anything in Nimrod yet? |
14:43:57 | _ponce | only a <canvas> example, so I'm talking out of my ass right now |
14:44:07 | dom96 | ahh yes. I saw that. |
14:44:14 | dom96 | Very nice :) |
14:44:17 | _ponce | and I've compiled Aporia, that's about it :| |
14:44:56 | dom96 | 1. Make more things! 2. Blog about them! 3. Spam reddit! 4. ??? 5. Profit :P |
14:45:53 | _ponce | will do |
14:46:10 | _ponce | what's your background? |
14:46:20 | _ponce | (languages etc...) |
14:47:18 | dom96 | Started with VB.NET when I was quite young, then took up Python, moved to Haskell and then I found Nimrod. |
14:47:35 | _ponce | so you quitted haskell? |
14:47:36 | dom96 | (Also i'm working part time for a company which uses C#) |
14:47:41 | dom96 | yeah |
14:47:58 | dom96 | The functional purity drove me insane :P |
14:48:21 | _ponce | eh |
14:49:01 | dom96 | once I reached monads I decided it was not the language for me. |
14:49:34 | _ponce | I never understood monad (let alone what they would be useful for) yet I was taught by compiler implementers etc |
14:50:04 | _ponce | F# had very impressive exemple of a parallelizing monads, also very clever parsers |
14:50:13 | dom96 | yeah, I still don't quite understand them. |
14:51:08 | dom96 | what do you think of Aporia btw? |
14:51:19 | _ponce | tbh I won't use it |
14:51:25 | _ponce | I'm happy with Sublime Text |
14:51:36 | dom96 | blasphemy :O |
14:52:04 | _ponce | the most important single feature in ST is _multiple cursors_ |
14:52:24 | _ponce | it's way better than vim column-mode |
14:52:30 | dom96 | I was thinking about implementing a similar feature in Aporia |
14:52:33 | _ponce | if Aporia has it then I might switch :) |
14:52:50 | dom96 | Maybe it will happen for the next version :P |
14:53:38 | dom96 | Any other features you like in ST? |
14:54:01 | _ponce | default color scheme is good |
14:54:12 | _ponce | and that's about it |
14:54:16 | _ponce | it reasonably fast |
14:54:22 | _ponce | but unable to open large files |
14:55:18 | _ponce | multiple cursors shine best when writing library bindings |
14:55:22 | _ponce | lots of repetitive lines |
14:56:42 | _ponce | that said most of my programming life happen inside Visual Studio for the debugger |
14:57:27 | dom96 | ahh |
14:57:47 | _ponce | when I have to actually edit text, I switch to ST |
14:59:09 | _ponce | got to go, later+ |
15:00:12 | dom96 | see ya |
16:39:33 | * | XAMPP-8 joined #nimrod |
17:29:02 | * | zahary quit (Ping timeout: 252 seconds) |
17:33:17 | * | gradha joined #nimrod |
17:37:06 | * | zahary joined #nimrod |
17:51:05 | * | gradha quit (Quit: Leaving) |
17:51:19 | * | gradha joined #nimrod |
17:52:12 | dom96 | hey gradha, what's up? |
17:52:49 | gradha | yo yo yo, dom96! |
17:53:08 | gradha | having a bud, coding in nimrod |
17:53:19 | dom96 | cool cool |
17:53:30 | gradha | actually I'm eating chocolate, alcohol is bad for health |
17:53:47 | dom96 | hah! I'm eating chocolate too! |
17:54:20 | dom96 | And trying to code and watch Friends at the same time. |
17:54:36 | gradha | today I'm celebrating I'm awesome, so I picked some orange filled dark chocolate, I'll be trying to release epak officially through babel soon |
17:55:15 | gradha | need to test the compile pragma Araq suggested, maybe that will avoid a previous C lib install |
17:55:25 | dom96 | awesome |
17:56:27 | * | dom96 is going through his Aporia todo list |
17:57:03 | dom96 | Also plotting to spam reddit with lots of Nimrod blog posts |
17:58:07 | gradha | this reddit thing, I've never understood it, is there any manual on how it works? I only see meaningless random text lines and hyperlinks in tree willing to outgrow the width of my screen |
17:59:16 | dom96 | It's ok, stay away from it, or you will be unable to be productive for the next few years. |
18:00:08 | gradha | don't worry, I know how to waste time, just today I was thinking of benchmarking command line parsing libraries |
18:01:11 | dom96 | lol |
18:02:01 | gradha | but then it struck me, bash already introduces some glob expansion, so it wouldn't be fair across platforms |
18:02:11 | gradha | an then you realize: wait, who the hell CARES? |
18:05:35 | dom96 | I'm sure someone out there would care |
18:06:55 | gradha | so searching reddit for nimrod gives me a 3 yeard old link, with people saying Araq has bad taste for being case insensitive |
18:08:50 | dom96 | yeah, some people are silly... |
18:10:23 | gradha | hehe, at least some comments are funny, wrt lisp macros: "I heard you like programming so I put a language in your language so you can code while you code!" |
18:12:24 | gradha | so, isn't reddit like slashdot without the incendiary summary? |
18:12:36 | gradha | at least forces the people to follow links by not saying much about them |
18:15:39 | Araq | aporia should finally get that "render the AST as you feel like" feature |
18:16:09 | Araq | so these silly arguments about code formating finally stop |
18:16:12 | Araq | it's pathetic |
18:16:29 | gradha | oh, I thought you meant interactive helpers for macro development |
18:16:50 | gradha | like, typing something, then Aporia expanding what would the compiler spit out |
18:18:06 | dom96 | even if aporia gets that feature people will say they don't like languages which depend on IDEs. |
18:18:28 | dom96 | People always find something to complain about. |
18:18:42 | gradha | that's why we can't have nice things <insert funny lolcat here> |
18:18:47 | reactormonk | dom96, come on, if you can get the same functionality in vim and emacs |
18:18:53 | reactormonk | apropos... |
18:19:42 | Araq | *everybody* uses a kind of IDE |
18:19:50 | Araq | nobody codes in notepad |
18:19:58 | dom96 | That's true. |
18:20:37 | Araq | "right tool for the job" :P |
18:20:45 | Araq | that's what these people love to say :P |
18:21:08 | dom96 | http://www.reddit.com/r/programming/comments/16t9qf/go_a_nice_language_with_an_annoying_personality/c7z61zm |
18:21:08 | gradha | notepad does it's job very poorly, which is advertising you need word |
18:21:58 | dom96 | That would their new argument :\ |
18:22:01 | dom96 | *would be |
18:22:50 | * | shevy quit (Ping timeout: 255 seconds) |
18:24:15 | gradha | actually, does notepad still exist in recent windows incarnations? is it a tile in windows 8? |
18:24:38 | dom96 | It exists in Windows 8. Not sure if it's a tile though. |
18:26:09 | gradha | I imagine people confusing the "notepad tile" with the "twitter tile" and wondering why their mental farts are not being published on the internet |
18:26:46 | gradha | also, what's this question asking me to save my tweet? aren't they saved on the internet? Jeez... |
18:27:02 | * | zahary quit (Ping timeout: 252 seconds) |
18:29:15 | gradha | Araq: the compile pragma works only with single file C, right? that's why you suggested concatenating all C files |
18:29:32 | * | XAMPP-8 quit (Ping timeout: 252 seconds) |
18:30:39 | Araq | right, but nothing stops you from using multiple compile pragmas ;-) |
18:31:00 | Araq | I only concatenated them for convenience |
18:31:09 | Araq | no header files to distribute etc. |
18:31:47 | gradha | the libtcc.c example from compiler/tccgen.nim has an #include, so I guess they are relative to the C's source path |
18:32:55 | Araq | I'm thinking of pcre_all.c |
18:33:22 | reactormonk | Araq, btw, how do you solve coariance? |
18:34:06 | Araq | argh, evil question, I always mix them up |
18:34:35 | Araq | covariance and contravariance are evil, ok? |
18:34:51 | * | shevy joined #nimrod |
18:34:54 | reactormonk | covariance is when you have e.g. seq[T] and U which is a subtype of T, covariance implies that seq[U] is a subtype of seq[T] |
18:35:24 | Araq | neither is sound with value types anyway |
18:36:04 | reactormonk | I'm not that good at type theory - why are value types different? |
18:37:11 | Araq | say you have int16 <: int32, neither array[int16] <: array[int32] nor the other way round holds |
18:38:41 | Araq | it's not compatible "under the hood", the type conversion for arrays needs to copy all elements |
18:38:48 | Araq | so why do it implicitely? |
18:38:56 | reactormonk | for objecet types? |
18:39:04 | Araq | *implicitly |
18:39:25 | reactormonk | note, covariance is no type conversion, but rather for type checks |
18:40:22 | Araq | *shrug* 'distinct' doesn't create a subtype relation either |
18:40:52 | Araq | so it only affects 'ref object' with inheritance which I almost never use |
18:43:40 | Araq | this means nimrod is unlikely to support it very soon as I don't care :P |
18:45:38 | reactormonk | fine enough |
18:45:50 | Araq | C# only allows co-/contravariance in interfaces btw |
18:45:54 | * | ^libman quit (Quit: leaving) |
18:46:04 | Araq | s/in/for |
18:46:21 | Araq | you may want to read why that is ... ;-) |
18:46:30 | reactormonk | don't bother too much |
19:05:23 | Araq | gradha: the macro expansion feature for an IDE is a good idea too :-) |
19:08:57 | gradha | it would be a special "macro interactive" mode, where the code you write gets executed and you see the generated nimrod code, and from inside aporia you can jump to it like normal code or check its docstrings |
19:09:20 | gradha | it would be nice for newbies, because you can start with a normal macro wich does the equivalent of a noop |
19:09:49 | gradha | but this expands to the whole going-through-function-parameters and whatever the compiler is doing internally |
19:10:25 | gradha | so you can easily see what is the compiler generating and jump with aporia through code to see "what is this fourth parameter doing" |
19:10:43 | gradha | which you said didn't like very much, because the APi was semi-fixed |
19:10:53 | Araq | alternatively we could clean up the AST ... *cough* |
19:11:17 | Araq | the API was rushed and then never changed and now code depends on it :-) |
19:12:14 | Araq | like the rest of the world does it :P |
19:14:33 | gradha | I'm sure dom96 is taking notes to implement this super cool in-editor-in-macro-interactive-expansion-mode |
19:15:10 | dom96 | of course :D |
19:29:54 | * | gradha quit (Quit: Leaving) |
19:32:01 | reactormonk | Araq, deprecation? |
19:32:16 | Araq | yeah but later |
20:12:41 | * | zahary joined #nimrod |
20:58:08 | * | codeallergy joined #nimrod |
20:59:10 | Araq | hi codeallergy |
21:00:39 | dom96 | codeallergy: welcome to #nimrod! |
21:01:00 | codeallergy | hi! |
21:03:23 | * | gradha joined #nimrod |
21:03:54 | gradha | nice nick codeallergy |
21:05:55 | Araq | gradha: are you polling the logs? ;-) |
21:06:11 | gradha | no, just came from gym/shower |
21:06:34 | gradha | btw, made a hole in the floor, yay me |
21:08:31 | Araq | are you talking about some sexual thing here now? |
21:08:58 | Araq | sorry, couldn't resist ... :P |
21:09:05 | gradha | no, was removing weighs from the bar and forgot to lock it |
21:09:09 | dom96 | guys, we have guests. |
21:09:14 | dom96 | :P |
21:09:33 | gradha | when one was left it fell over to the other side and made a 1cm hole |
21:10:20 | gradha | I guess they make safety locks for something |
21:11:10 | Araq | sounds like a poor floor for a gym |
21:11:48 | gradha | it's the kind of cheap community room with a few machines and weights, real gyms can sustain more damage |
21:12:59 | gradha | apropos holes, https://github.com/Araq/Nimrod/pull/306 looked like a hole to me, want to discuss this? |
21:16:05 | Araq | I don't get it |
21:16:19 | gradha | the types seem wrong at the nimrod level |
21:16:27 | reactormonk | zahary, https://github.com/Araq/Nimrod/issues/309 |
21:16:42 | Araq | srand(unsigned seed) means unsigned int |
21:16:43 | dom96 | I see you took my advice :) |
21:18:28 | gradha | srand48 is suposed to accept a long |
21:18:52 | gradha | but nimrod defines it as cint |
21:19:13 | gradha | doing "echo high(clong)" on my machine shows 9223372036854775807, so it doesn't match? |
21:19:26 | gradha | echo high(cint) shows 2147483647 |
21:19:45 | gradha | my conclusion is srand() is wrong, or srand48() is wrong |
21:20:00 | gradha | a final third possibility I just reached is my knowledge of C types is wrong too, could be |
21:21:24 | Araq | oh I see |
21:21:43 | gradha | long story short: do I update srand48 to use clong? |
21:22:08 | Araq | sure why not if that's what the C standard says |
21:22:30 | Araq | can't see why you need srand48 though |
21:23:25 | gradha | I didn't even know it existed, just noticed it when I went in to add randomize(int), and nimrod's type system warned be about passing an int to srand48 |
21:23:29 | gradha | so you can blame nimrod |
21:27:44 | Araq | and I thought we already have a way to set the initial seed of the random number generator |
21:28:11 | gradha | yes, but you can't use that to seed the same value for unit testing |
21:28:26 | Araq | don't call 'randomize' at all then :P |
21:28:52 | gradha | then the numbers would be actually random... |
21:29:08 | Araq | they won't differ from run to run |
21:29:11 | Araq | then |
21:29:31 | Araq | but *shrug* |
21:29:34 | gradha | but I can't go back and repeat the tests without creating a new process, can I? |
21:30:09 | Araq | that's a good point :-) |
21:33:40 | gradha | hmm... I'll add a note about the random numbers not being cross-platform portable, you need the same implementation if you plan on doing random stuff on multiplayer games to reduce bandwidth |
21:34:44 | Araq | dunno a stdlib's 'rand' is overengineered for a game anyway I think |
21:35:03 | Araq | it often trades performance for better "randomness" |
21:35:15 | Araq | something which is questionable for a game |
21:35:15 | gradha | yes, game random generators seem to be less security inclined |
21:36:14 | Araq | implement a 'fastRand' in pure Nimrod that's cross-platform portable |
21:37:56 | * | codeallergy quit (Ping timeout: 260 seconds) |
21:41:00 | gradha | could try http://stackoverflow.com/a/1227137/172690 as a babel lib |
21:42:39 | Araq | looks good; make sure it's thread safe though |
21:43:11 | gradha | oh, threads, haven't reached that point in nimrod, are they good? |
21:43:11 | Araq | though thinking about it races may be even better for randomness ;-) |
21:43:38 | Araq | good enough for nimbuild and aporia at least |
21:43:42 | dom96 | gradha: Don't be silly, everything in Nimrod is good. |
21:43:50 | dom96 | :P |
21:44:07 | gradha | sure, they could be excellent, and after that, superduper, and... |
21:44:38 | gradha | it all depends on whether you are using the imperial or metric awesomeness system |
21:45:54 | gradha | are the aporia threads native to nimrod or does gtk use some sort of C level threads and perform callbacks on your code? |
21:46:18 | dom96 | aporia uses native nimrod threads. |
21:46:25 | dom96 | i.e. it doesn't use GTK's threads at all. |
21:46:59 | dom96 | Now to test first class iterators :O |
21:47:38 | * | XAMPP-8 joined #nimrod |
21:49:54 | gradha | oh, you need to compile with --threads:on? what does happen if you don't use that switch? coroutines? |
21:50:20 | Araq | if you don't use that switch you have no threads |
21:50:37 | Araq | the compiler complains about an unknown 'TThread' type then |
21:51:02 | gradha | but I compiled aporia without the switch, shouldn't it have failed compilation then? |
21:51:25 | dom96 | gradha: --threads:on is specified in aporia's nimrod.cfg file. |
21:51:32 | gradha | oh, clever |
21:51:40 | dom96 | indeed :D |
21:53:15 | Araq | http://xkcd.net/221/ |
21:53:46 | gradha | one of stackoverflow's answers did embed that gif |
21:54:11 | dom96 | hah, look at the alt text of that image |
21:54:23 | dom96 | "RFC 1149.5 specifies 4 as the standard IEEE-vetted random number." |
22:00:18 | dom96 | Araq: Is there like a 'next' function that I can use on iterators? |
22:01:24 | Araq | while not finished(iter): let x = iter(...) |
22:01:33 | Araq | to 'nest' it just invoke it |
22:01:36 | Araq | *next |
22:02:31 | dom96 | oh, I see what i'm doing wrong. |
22:03:54 | dom96 | why is the iterator not considered finished after it's invoked (when the iterator only has 1 yield)? |
22:04:45 | Araq | I think it is? |
22:05:09 | dom96 | https://gist.github.com/0badc2f5e4cd9f4bed48 |
22:05:54 | dom96 | after line 8 is uncommented it echos true |
22:06:17 | Araq | hrm I wonder why my tests didn't catch this ... |
22:06:50 | dom96 | no worries |
22:06:59 | dom96 | but fix it please :P |
22:07:14 | Araq | maybe I'll change the spec instead :P |
22:07:34 | Araq | there is usually a good reason for these things under the hood |
22:07:38 | dom96 | I don't think that's wise :P |
22:08:08 | Araq | what happens when you use a1 in a for loop? |
22:08:17 | Araq | does it yield 1 twice? |
22:09:02 | dom96 | no. |
22:09:06 | dom96 | once. |
22:09:10 | Araq | see? :P |
22:09:37 | reactormonk | Araq, could I go write a lib so I can write iterations functional like in ruby? |
22:09:47 | dom96 | am I suppose to use some special trick to determine whether the iterator is in fact finished? |
22:10:08 | reactormonk | I have to admit my knowledge of how to pass a piece of code in nimrod is a bit smalley |
22:10:34 | dom96 | Araq: btw if I invoke x() again, it yields 0 not 1. |
22:10:49 | Araq | after it's done it's undefined |
22:10:52 | gradha | reactormonk: how does the ruby code look like? recently I updated the docs of sequtils, it contains some basic functional procs on sequences |
22:11:27 | Araq | reactormonk: you can try but most 'items' iterators in system are not first class |
22:11:40 | reactormonk | Araq, now that sucks balls |
22:11:46 | dom96 | Araq: Please tell me how to use this as it is currently designed if you plan to keep it this way, because I have no idea. |
22:11:48 | Araq | so the way to go is to use templates |
22:12:00 | Araq | sequtils has some examples like gradha said |
22:12:20 | Araq | and btw it doesn't suck balls, it's cool if you care about performance :P |
22:12:30 | reactormonk | gradha, foo.keys.map { |attr| attr.to_s }.sort |
22:13:00 | reactormonk | although you could also write that as foo.keys.map(&:to_s).sort |
22:13:41 | reactormonk | Araq, touché |
22:14:11 | gradha | I've done pretty much that recently, you have to type more due to lack of special syntax like ruby has |
22:15:07 | reactormonk | I can live with that |
22:15:18 | Araq | it'll get better though |
22:16:21 | gradha | here's a line of code I'm using "var chunks = int_list.each do (x: int) -> string : key_value_table[$x].str" |
22:16:41 | gradha | that uses the each proc for mapping |
22:16:57 | gradha | then uses the do-notation to specify the anonymous proc to be invoked for each item |
22:16:59 | Araq | make a pull request please for 'map' please btw |
22:17:50 | Araq | it's misguided to try to use better names than map and fold |
22:18:26 | gradha | reactormonk: if you have the latest git checkout the sequtil docstrings provide some more examples with different notations |
22:19:15 | gradha | Araq: won't an each/map change trigger a lot of changes and break stuff? |
22:19:39 | Araq | yes that's why you don't simply rename it |
22:20:02 | Araq | but copy and paste and modify the name to be 'map' and deprecate the 'each' declarations |
22:20:12 | dom96 | You can also look at the nimbuild docs which are always up-to-date: http://build.nimrod-code.org/docs/sequtils.html |
22:21:22 | gradha | nice, maybe a link to github version could be added to http://nimrod-code.org/documentation.html |
22:23:34 | Araq | reactormonk: in general: just use a template to pass a body of code around |
22:23:57 | gradha | btw, any plans to deal with docstrings for procs defined for specific platforms? would it be possible to run the comment extractor for all possible branches and then mark what platform/define do they exist? |
22:26:14 | dom96 | Araq: so any ideas about that first class iterators issue? |
22:26:23 | Araq | dom96: looking into it |
22:26:28 | dom96 | thanks |
22:27:15 | Araq | dom96: can you work around that issue for now? |
22:28:04 | Araq | if you look at my "simple tasking" example you see that the iterator performs some action after its last 'yield' |
22:28:06 | dom96 | Sure. I can figure something out. Is this expected behaviour? |
22:28:31 | Araq | so only after 'echo "a1: D"' has been executed the iterator is finished |
22:28:55 | Araq | 'yield' is supposed to perform some task switching in the example |
22:29:21 | * | gradha quit (Quit: Leaving) |
22:29:25 | Araq | so if you only have 'yield 1' in the body control needs to come back once more for the iterator to be finished |
22:29:55 | Araq | so I'm not sure if it's a bug or a design issue |
22:30:30 | dom96 | hrm, I see. |
22:30:53 | dom96 | Well I think that as soon as the last yield in that iterator is executed the iterator should be finished. |
22:31:55 | dom96 | however then the problem is that if you have something else after the last yield, it will not be executed |
22:32:02 | Araq | yeah |
22:32:39 | dom96 | but in the current design 'finished' is simply misleading I think. |
22:34:14 | Araq | perhaps it's a simple codegen bug ... |
22:34:18 | dom96 | maybe the iterator should instead be considered to have "finished" when it 'returns'? |
22:34:37 | dom96 | if you know what I mean? |
22:34:58 | dom96 | i.e. when the last line of the iterator is executed. |
22:35:03 | Araq | but that's what it does now |
22:35:15 | dom96 | it doesn't with my example |
22:35:18 | Araq | 'yield 1' is not 'return 1' |
22:35:59 | dom96 | hrm, this may work. |
22:36:32 | dom96 | but perhaps the last 'yield' should be considered a 'return'? |
22:36:57 | Araq | I'm still not getting it 100% so just be patient please |
22:37:08 | Araq | it's been a while and I have a headache :P |
22:38:00 | dom96 | np |
22:55:56 | Araq | dom96: this works: |
22:56:05 | Araq | while true: |
22:56:06 | Araq | let y = x() |
22:56:08 | Araq | if x.finished: break |
22:56:10 | Araq | echo y |
22:56:27 | Araq | and that's what the 'for' loop does, so yeah there is a bug |
22:56:47 | Araq | the 0 is produced but not echo'd |
22:56:51 | dom96 | I see. |
22:56:57 | dom96 | So will you change this behaviour? |
22:57:09 | Araq | yes |
22:57:31 | Araq | might be easy to fix |
22:57:42 | dom96 | cool |
22:58:03 | Araq | but then it might also be impossible |
22:58:12 | dom96 | not cool :P |
22:58:38 | Araq | "the last yield is implicitly a return" |
22:58:50 | Araq | "except when it isn't" |
23:10:58 | Araq | dom96: looks impossible to fix, need to sleep over it |
23:11:48 | dom96 | awww too bad. |
23:12:05 | dom96 | but yeah, do sleep over it. |
23:12:40 | Araq | as I said "yield" means "return this value and continue back here" |
23:13:06 | Araq | so a body of "yield 1" continues with an empty statement |
23:13:20 | Araq | which is the 0 that you encounter |
23:13:31 | Araq | and only after that it's finished |
23:13:54 | Araq | you want the yield to mean "yield 1 and be done" which is "return" |
23:14:41 | dom96 | alright. I think I get it. |
23:14:54 | Araq | but then the 'for' loop transformation doesn't adhere to this :-/ |
23:15:10 | Araq | so hrm |
23:15:18 | dom96 | yes, that's true. It is quite misleading :| |
23:16:43 | Araq | on the other hand ... it transforms it into the 'while' loop I gave above |
23:16:54 | Araq | so perhaps good docs are all that's necessary |
23:17:30 | Araq | my original design didn't even support 'finished' really |
23:17:58 | Araq | iterators were supposed to run endlessly when not invoked from a for loop |
23:18:29 | Araq | I mean they would *always* produce the last value when done |
23:19:02 | dom96 | Well I think "finished" is currently wrong. |
23:20:04 | dom96 | I might as well use some value as the terminator. |
23:20:20 | Araq | yeah but that's not always avaliable |
23:20:31 | dom96 | yeah, exactly. |
23:20:35 | Araq | indeed that's what the implementation kind of does |
23:22:46 | dom96 | So yeah, I think it is better if this is fixed. Principle of least surprise and stuff :P |
23:23:38 | Araq | that's just a saying for "works like in ruby" :P |
23:23:49 | Araq | or perhaps "works like in JS" |
23:24:56 | dom96 | perhaps :P |
23:25:40 | Araq | btw ruby uses names like "upcase", "downcase" and "rescue" so POLS my ass |
23:26:10 | dom96 | and JS doesn't even get == right :P |
23:26:11 | Araq | not to mention that it gets scoping rules wrong |
23:26:26 | dom96 | or was that PHP, I can't remember now :P |
23:40:35 | reactormonk | can I use int as a long (at least in JS)? |
23:44:20 | Araq | I think so |
23:53:38 | reactormonk | and float as double? |
23:53:55 | Araq | sure |