| 00:00:55 | * | Jesin joined #nimrod |
| 00:03:36 | * | saml_ joined #nimrod |
| 00:04:17 | * | Jesin quit (Client Quit) |
| 00:06:15 | * | brson quit (Quit: leaving) |
| 00:06:41 | * | Jesin joined #nimrod |
| 00:22:56 | * | jjap joined #nimrod |
| 00:24:59 | jjap | Hi guys/gals, I'm trying to figure out importing C functions. The manual isn't entirely clear (to me). Do I manually write the proc to resemble the C function (variables+return), then add the necessary importc/header pragmas? |
| 00:26:17 | jjap | If a C function excepts a struct, do I create a similar Object in nimrod, and make the Proc accept that Object where the C function would take the struct? |
| 00:28:22 | jjap | Instead of duplicating a C enum parameter, can I just declare/send an Int? Or must I make a nimrod enum? |
| 00:30:38 | EXetoC | you often want just importc |
| 00:30:50 | EXetoC | well, only the size must match (binary compatibility) |
| 00:32:22 | EXetoC | int? can't remember. you want cint for C's int though |
| 00:33:13 | EXetoC | c2nim can be used for generating wrappers (usually after some tweaking) |
| 00:33:22 | jjap | Hmm. For example: int clock_gettime(clockid_t clk_id, struct timespec *tp); |
| 00:33:37 | jjap | My guess was something like: proc clock_gettime(clk_id:int, ts: timespec):int {.importc: "clock_gettime", header: "<time.h>".} |
| 00:33:50 | jjap | timespec being an object I created to resemble the C struct |
| 00:35:19 | EXetoC | lib/posix/posix.nim:2273:proc clock_gettime*(a1: TClockId, a2: var Ttimespec): cint |
| 00:35:19 | jjap | Looking at it now, I see that ts:timespec should be var |
| 00:35:30 | EXetoC | TClockId is an int, so you just got one thing wrong I think |
| 00:35:48 | EXetoC | that module is present in the standard distribution |
| 00:35:51 | jjap | agg. This is in the posix module? |
| 00:36:05 | jjap | Heh |
| 00:36:32 | EXetoC | yes |
| 00:36:44 | jjap | Hmm Ttimespec.. was I right about the object/struct? I'll pull up the code now |
| 00:37:12 | EXetoC | yes |
| 00:37:51 | EXetoC | no |
| 00:38:21 | jjap | Ah. I see what you mean about "just importc" |
| 00:38:27 | jjap | no need to say it's function name again |
| 00:38:28 | EXetoC | the 'pure' pragma is necessary I think (it omits RTTI) |
| 00:40:00 | jjap | I'm looking at the definition now... interesting |
| 00:40:21 | jjap | RTTI? |
| 00:41:10 | EXetoC | runtime type information/identification |
| 00:41:20 | jjap | I'll study the code for this module. It's full of examples I can learn from. Thanks. |
| 00:41:42 | jjap | Any idea why the final? |
| 00:43:11 | EXetoC | it means that said object can't be inherited from |
| 00:45:24 | jjap | I see. Any idea why all these imported structs begin with T? Any important significance to this convention? |
| 00:48:19 | EXetoC | a side-effect of the case-insensitivity, but that's going to be modified slightly, so the prefix will go away |
| 00:48:55 | jjap | Thank you |
| 00:50:03 | jjap | I've been test driving nimrod as bash/C replacement. For Better maintainability and safety. That's the idea anyway. |
| 00:54:33 | * | askatasuna joined #nimrod |
| 01:09:52 | * | askatasuna quit (Ping timeout: 255 seconds) |
| 01:15:06 | * | q66 quit (Quit: Leaving) |
| 01:20:11 | * | MightyJoe is now known as cyraxjoe |
| 01:22:59 | jjap | I have some experience creating Mac OS X installers for programming languages (move files into place, create symlinks, option for keep/removing old version, etc). Any concerns/objects/whatever before I cook one up for 0.9.4? |
| 01:23:14 | jjap | */objections/ |
| 01:30:06 | * | EXetoC quit (Quit: WeeChat 1.0) |
| 02:13:37 | * | jjap quit (Ping timeout: 246 seconds) |
| 02:15:44 | * | OrionPK joined #nimrod |
| 02:51:13 | * | bjz quit (Ping timeout: 260 seconds) |
| 03:05:49 | * | askatasuna joined #nimrod |
| 03:32:51 | * | ws joined #nimrod |
| 03:45:57 | * | askatasuna quit (Ping timeout: 240 seconds) |
| 03:48:35 | * | Jesin quit (Quit: Leaving) |
| 03:49:00 | * | saml_ quit (Ping timeout: 260 seconds) |
| 04:08:42 | * | xenagi quit (Quit: Leaving) |
| 04:43:37 | * | kshlm joined #nimrod |
| 05:05:07 | * | ws quit (Ping timeout: 246 seconds) |
| 05:16:43 | * | jjap joined #nimrod |
| 05:19:47 | jjap | Would anyone know why " import posix; var sp = posix.Ttimespec(); discard posix.clock_gettime(0,sp) " would get the compiler complaining "undefined reference to `clock_gettime' ? |
| 05:20:23 | jjap | Reference: https://github.com/Araq/Nimrod/blob/3cdc32895258415871f4d183d65544d655ac38cb/lib/posix/posix.nim#L2273 |
| 05:20:56 | * | nande quit (Remote host closed the connection) |
| 05:21:28 | jjap | Er. Maybe I'm missing the C header on my machine? |
| 05:22:24 | jjap | No no. That can't be right. Hrm |
| 05:47:58 | * | gkoller joined #nimrod |
| 06:12:01 | * | Sht0 joined #nimrod |
| 06:38:55 | * | ome joined #nimrod |
| 06:39:04 | * | ome quit (Client Quit) |
| 06:59:33 | * | darkfusion quit (Ping timeout: 240 seconds) |
| 07:01:14 | * | darkfusion joined #nimrod |
| 07:15:48 | * | disconnected_ is now known as disconnected |
| 07:29:46 | * | BlaXpirit joined #nimrod |
| 07:53:22 | * | kunev joined #nimrod |
| 08:08:31 | * | jjap quit (Ping timeout: 246 seconds) |
| 08:13:49 | * | Boscop joined #nimrod |
| 08:18:28 | * | io2 joined #nimrod |
| 09:27:03 | * | lyro quit (Ping timeout: 272 seconds) |
| 09:27:22 | def- | in case jjap comes back or reads the logs: It's probably -lrt missing at linktime |
| 09:29:18 | * | lyro joined #nimrod |
| 10:01:15 | * | jasondotstar|afk quit (Quit: Leaving) |
| 10:12:38 | * | vegai_ is now known as vegai |
| 10:13:00 | * | zahary joined #nimrod |
| 10:15:20 | * | Matthias247 joined #nimrod |
| 10:17:23 | * | Ven joined #nimrod |
| 10:36:37 | * | EXetoC joined #nimrod |
| 11:07:00 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 11:22:49 | * | Ven joined #nimrod |
| 11:36:24 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
| 11:53:50 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 12:07:57 | * | gkoller quit (Ping timeout: 260 seconds) |
| 12:09:37 | * | gkoller joined #nimrod |
| 12:20:40 | BlaXpirit | is there a way for a function to accept any array, sequence, iterator as argument? |
| 12:30:02 | * | disconnected left #nimrod (#nimrod) |
| 12:50:14 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 12:58:46 | * | Araq_ joined #nimrod |
| 12:59:35 | Araq_ | BlaXpirit: yes, but until 'generic' works, you need to underspecify the contraint |
| 12:59:41 | * | gkoller joined #nimrod |
| 12:59:49 | Araq_ | proc foo[T](x: T) = |
| 12:59:59 | Araq_ | for a in x: echo a |
| 13:00:03 | BlaXpirit | :| ok |
| 13:00:17 | Araq_ | --> works for everything that has 'items' |
| 13:00:37 | BlaXpirit | thank you |
| 13:01:30 | BlaXpirit | I don't understand |
| 13:01:31 | Araq_ | personally I'm a fan of this sine the constraint only reimplements the body anyway |
| 13:01:35 | BlaXpirit | I import intsets |
| 13:01:59 | BlaXpirit | and it doesn't see anything the module exports |
| 13:02:06 | BlaXpirit | I can only do intsets.stuff() |
| 13:02:36 | * | kshlm quit (Quit: Konversation terminated!) |
| 13:03:06 | BlaXpirit | e.g. for el in intsets.items(s) works |
| 13:03:10 | BlaXpirit | but for el in s doesn't |
| 13:03:26 | Araq_ | yes, I'm aware |
| 13:03:48 | Araq_ | you can report it anyway |
| 13:03:50 | BlaXpirit | Araq_, and what does this mean? |
| 13:04:07 | BlaXpirit | is it only for intsets? what is the scope? |
| 13:04:43 | Araq_ | for el in items(s) # should work |
| 13:04:49 | BlaXpirit | s.contains_or_incl(x) doesn't work but intsets.contains_or_incl(s, x) works |
| 13:04:51 | Araq_ | for el in s # should work too, but doesn't |
| 13:05:16 | Araq_ | what version do you use? |
| 13:05:29 | BlaXpirit | Araq_, 0.9.5 |
| 13:06:02 | Araq_ | damn |
| 13:06:54 | BlaXpirit | ah, don't need to specify "intsets." |
| 13:06:59 | BlaXpirit | works without it |
| 13:07:01 | BlaXpirit | but still........ |
| 13:08:25 | Araq_ | well it's a big bug for sure |
| 13:08:53 | Araq_ | most annoying is that I fixed it, but apparently my tests are almost worthless |
| 13:09:52 | Araq_ | but in my defense, it's already marked as a showstopper bug ... |
| 13:14:41 | * | darkf quit (Quit: Leaving) |
| 13:18:50 | BlaXpirit | echo intset doesn't work too :( |
| 13:19:07 | BlaXpirit | but all that i've just mentioned does work in my 1-file script |
| 13:19:21 | BlaXpirit | just not in an imported module |
| 13:29:53 | * | bjz joined #nimrod |
| 13:30:45 | * | gkoller quit (Read error: Connection reset by peer) |
| 13:31:35 | * | gkoller joined #nimrod |
| 13:42:29 | BlaXpirit | why are slices so useless :( |
| 13:42:37 | BlaXpirit | no len, no indexing, no conversion to seq |
| 13:43:47 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 13:46:19 | BlaXpirit | I wonder why sequtils.to_seq is not @ |
| 13:55:27 | * | io2 joined #nimrod |
| 13:56:04 | EXetoC | the slice type? why index it? |
| 13:56:18 | Araq_ | I don't know what he means either |
| 13:56:52 | Araq_ | bbl |
| 13:56:54 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 31.0/20140716183446]) |
| 13:57:19 | EXetoC | the "length" can be retrieved using high and low |
| 13:58:06 | EXetoC | I assume you don't mean a slice operation, which gives you a seq |
| 13:58:30 | EXetoC | it once again becomes confusing because of the conflated terminology |
| 14:00:29 | BlaXpirit | basically, i would love to use a..b as openarray |
| 14:01:04 | BlaXpirit | not entirely sure what openarray is, anyway, because it is not explained in detail |
| 14:03:17 | BlaXpirit | i think openarray should support everything that has low, high and [] |
| 14:03:55 | BlaXpirit | or maybe that it should just be a generic thing and then openarray would not need to exist |
| 14:09:07 | BlaXpirit | and really, why aren't there shorter versions of sort? |
| 14:12:09 | EXetoC | a..b is just a slice (see the TSlice type) |
| 14:12:27 | BlaXpirit | uhh yes |
| 14:12:28 | EXetoC | and you have the iterator version |
| 14:12:34 | BlaXpirit | and i don't want it to be just a slice |
| 14:13:32 | BlaXpirit | Python's `range` is really needed |
| 14:14:15 | EXetoC | well you did mention toSeq |
| 14:14:42 | BlaXpirit | 1..100000000000 toSeq won't do |
| 14:15:52 | EXetoC | yeah that's not a lazy operation. I can't remember what the limitations were |
| 14:16:22 | BlaXpirit | https://docs.python.org/3/library/stdtypes.html#range this is good stuff and I need it all the time |
| 14:17:20 | BlaXpirit | it's not just an iterator, it's an object that you can do things with. it acts a lot like a list but stores only 3 numbers |
| 14:17:52 | BlaXpirit | and I can't think of a reason why slices can't be made like this |
| 14:19:15 | BlaXpirit | in python you can do `random_sample(range(10000000), 60)` |
| 14:19:38 | BlaXpirit | and the function random_sample doesn't need to know that what it receives isn't actually a list |
| 14:29:36 | EXetoC | so, slice + iterators then? but iterators can't really be used as objects yet I think |
| 14:30:15 | BlaXpirit | EXetoC, `range` is not an iterator, but it can give you an iterator |
| 14:30:29 | BlaXpirit | like Python's analog of `items` |
| 14:31:12 | BlaXpirit | a slice is already a lot like it |
| 14:31:31 | BlaXpirit | it's just an object that contains 2 numbers and can be iterated |
| 14:31:52 | BlaXpirit | and i would like it to get more functionality, make it more like python's `range` |
| 14:32:43 | BlaXpirit | make len(slice), slice[i] |
| 14:32:53 | BlaXpirit | cuz why not if it already has contains |
| 14:33:55 | EXetoC | I wonder why there's a .. iterator also. there could just be an items function for TSlice instead |
| 14:34:09 | BlaXpirit | .. iterator? |
| 14:34:25 | EXetoC | iterator `..` |
| 14:34:47 | EXetoC | and then you have proc `..`*[T](a, b: T): TSlice[T] |
| 14:34:51 | BlaXpirit | ok, now that is frickin weird |
| 14:35:14 | BlaXpirit | why isn't it items(TSlice) ??? |
| 14:35:19 | BlaXpirit | i was sure that it was |
| 14:36:34 | EXetoC | no. will discuss that also |
| 14:36:49 | BlaXpirit | i may as well just make myself a `range` and ignore slices' existence |
| 14:40:35 | EXetoC | it's used for slice operations too |
| 14:40:44 | EXetoC | when slicing a sequence for example |
| 14:41:22 | BlaXpirit | EXetoC, beats me why the slice doesn't have a "step" |
| 14:41:39 | BlaXpirit | all the languages i know that have such slicing, support a step |
| 14:41:53 | BlaXpirit | really cuts the usefulness |
| 14:43:27 | BlaXpirit | sure, maybe I just want Nimrod to be Python |
| 14:43:51 | BlaXpirit | but this stuff is just too good http://stackoverflow.com/a/509295 |
| 14:52:38 | EXetoC | do you need stepping for something other than iteration? |
| 14:52:54 | BlaXpirit | slicing! |
| 14:53:23 | BlaXpirit | [1,2,3,4,5][::2] == [1,3,5] and stuff (this is python code) |
| 14:54:05 | EXetoC | I don't know if performance has anything to do with this, though optimizations should help in some cases |
| 14:54:51 | BlaXpirit | so, what is openarray? |
| 14:55:06 | BlaXpirit | is it really just "hardcoded" for arrays and seqs? |
| 14:59:00 | BlaXpirit | using openarray doesn't seem feasible at all to me |
| 14:59:00 | EXetoC | it also makes it so that the index starts from zero http://nimrod-lang.org/manual.html#open-arrays |
| 14:59:09 | BlaXpirit | i understand |
| 14:59:11 | EXetoC | the lower index can be something other than 0 for arrays |
| 14:59:30 | BlaXpirit | but can't it just make the adaptation for any type that has len and [] ? |
| 14:59:44 | BlaXpirit | or low, high, [] |
| 14:59:50 | EXetoC | well, Araq did mention generics before, which are still broken |
| 15:00:08 | EXetoC | hence why he brought up unconstrained type parameters |
| 15:00:13 | BlaXpirit | ok so i have this |
| 15:00:15 | BlaXpirit | proc random_choice*[T](arr: openarray[T]): T |
| 15:00:20 | BlaXpirit | how do i change it to generic |
| 15:00:36 | BlaXpirit | I understand that the first step is proc random_choice*[T](arr: T): |
| 15:00:38 | BlaXpirit | but then what? |
| 15:13:03 | * | johnsoft quit (Ping timeout: 240 seconds) |
| 15:15:04 | EXetoC | no, as in user-defined typeclasses, but it seems reasonable to just use openarray, unless you want it to apply to non-random access containers too |
| 15:15:36 | BlaXpirit | > range |
| 15:17:17 | BlaXpirit | https://gist.github.com/BlaXpirit/09290912725ef623d430 |
| 15:18:28 | BlaXpirit | is it so unreasonable to want to support any container? |
| 15:19:14 | * | brson joined #nimrod |
| 15:22:08 | EXetoC | just assume that items(T) exists then |
| 15:22:58 | BlaXpirit | EXetoC, no, i don't use that in my function |
| 15:23:04 | BlaXpirit | i use len and [] |
| 15:23:23 | BlaXpirit | and what am i supposed to assume if i just accept openarray anyway |
| 15:23:46 | BlaXpirit | I sure would like to be able to assume |
| 15:24:13 | BlaXpirit | but you didn't tell me how; didn't answer my question from [:00:36] |
| 15:25:10 | EXetoC | not all containers support indexing though, but just use those functions then instead of items if you want |
| 15:25:29 | BlaXpirit | i don't understand |
| 15:26:28 | EXetoC | just use len and [] then |
| 15:26:47 | BlaXpirit | and that's what i'm doing |
| 15:26:58 | EXetoC | ok |
| 15:27:02 | BlaXpirit | but for some reason giving TRange to my function doesn't work |
| 15:27:23 | BlaXpirit | because it looks like this proc random_choice*[T](arr: openarray[T]): T |
| 15:28:26 | EXetoC | just use T then |
| 15:28:40 | EXetoC | and not openarray[T] |
| 15:28:41 | BlaXpirit | [:24:10] <BlaXpirit> but you didn't tell me how; didn't answer my question from [:00:36] |
| 15:29:11 | BlaXpirit | what is the return type supposed to be then? |
| 15:32:31 | EXetoC | does arr[0].type work? |
| 15:32:58 | BlaXpirit | I don't know |
| 15:33:03 | BlaXpirit | don't remember ever seeing such a thing |
| 15:33:05 | BlaXpirit | will try |
| 15:33:24 | EXetoC | I might've mentioned it yesterday |
| 15:33:50 | * | enquora joined #nimrod |
| 15:34:03 | EXetoC | doesn't seem to work |
| 15:34:53 | BlaXpirit | no, it definitely doesn't work |
| 15:35:29 | EXetoC | proc p[T](arr: T): expr = arr[0] |
| 15:35:56 | BlaXpirit | ..? |
| 15:36:27 | EXetoC | I don't think there's anything better |
| 15:36:43 | BlaXpirit | I don't understand how this is relevant to my problem |
| 15:37:13 | BlaXpirit | hmm actually, in this particular case it might just work |
| 15:37:22 | BlaXpirit | but not with my other function |
| 15:38:14 | BlaXpirit | which returns seq[T] |
| 15:38:24 | BlaXpirit | but i still would like it to accept anything that has [] and len |
| 15:39:42 | EXetoC | I don't know why you can't just extend my snippet, but I'm not sure what you mean so a test case would be nice |
| 15:40:49 | BlaXpirit | EXetoC, https://github.com/BlaXpirit/nimrod-random/blob/master/src/random.nim#L93 |
| 15:42:53 | EXetoC | not quite a test case, but maybe I can get it to work anyway |
| 15:43:20 | * | gkoller joined #nimrod |
| 15:45:19 | EXetoC | seq? |
| 15:45:30 | BlaXpirit | EXetoC, all that's needed is a function signature that would accept, for example, that TRange I showed earlier |
| 15:45:34 | BlaXpirit | EXetoC, yes, what about it? |
| 15:45:38 | * | kunev quit (Quit: leaving) |
| 15:45:39 | BlaXpirit | it's a different function now |
| 15:46:06 | BlaXpirit | [:37:11] - [:38:12] |
| 15:47:53 | EXetoC | instead of openarray[T] for the arr parameter? |
| 15:48:23 | BlaXpirit | what do you mean by this? |
| 15:49:17 | BlaXpirit | maybe it can even stay openarray, how do I know... what matters to me is that it accepts arbitrary containers and not just arrays |
| 15:49:32 | EXetoC | it can't |
| 15:49:40 | EXetoC | iterator random_sample*[T](self: var TRandomGenerator; arr: T, n: Natural): expr? |
| 15:49:48 | EXetoC | 'expr' might not work with iterators |
| 15:50:57 | BlaXpirit | oh i forgot that I decided against using seq |
| 15:51:01 | BlaXpirit | sorry I confused you |
| 15:51:26 | EXetoC | in which case you might have to provide an overload, in which case 'arr' for the current overload might have to remain openarray[T]. I don't know if conflicts can be resolved otherwise |
| 15:52:24 | BlaXpirit | this expr thing is a hack anyway |
| 15:52:40 | EXetoC | so maybe something like this the above doesn't work: "iterator random_sample*[T](self: TRandomGenerator; arr: openarray[T], n: Natural): T =" and "iterator random_sample*(self: TRandomGenerator; arr: TRange, n: Natural): int =" |
| 15:54:25 | BlaXpirit | no, no, I don't want *just* TRange |
| 15:54:40 | EXetoC | using expr is often very effortless, but is indeed hacky in many cases, so we'll just have to do with what we've got until user-defined typeclasses become usable |
| 15:54:59 | EXetoC | but these are two overloads |
| 15:55:16 | BlaXpirit | I don't want TRange at all, it was just an example |
| 15:55:29 | BlaXpirit | that any such class would be acceptable for the function |
| 15:56:00 | EXetoC | try the expr approach then and hope that it works |
| 15:56:23 | BlaXpirit | meh |
| 15:56:52 | BlaXpirit | if the language doesn't have such elegance in its standard library, then why should i care about it for my library |
| 15:59:18 | BlaXpirit | but in my opinion, openarray should either not exist or support custom classes |
| 15:59:41 | EXetoC | I don't know. it's up to you if you want to use Nimrod in its current state |
| 16:00:12 | BlaXpirit | i want to want to use it |
| 16:00:59 | BlaXpirit | cuz i could just shut up and use Python |
| 16:01:31 | BlaXpirit | but it really is way too slow. people saying that it shouldn't matter doesn't change the situation |
| 16:08:27 | BlaXpirit | anyway, about my library. i think it's ready. if someone evaluated it, that would be great. https://github.com/BlaXpirit/nimrod-random |
| 16:08:31 | EXetoC | yes, and I'm saying that the actual language supports these constructs, but the implementation currently does not, and mostly because of UDTC bugs in this case |
| 16:09:30 | EXetoC | python's speed in comparison to other language does indeed not matter in most cases, but I guess it does matter for you |
| 16:09:49 | * | BlaXpirit started making a game in it |
| 16:09:52 | EXetoC | though many people write slow parts in C if necessary |
| 16:12:04 | * | untitaker quit (Ping timeout: 240 seconds) |
| 16:17:50 | * | untitaker joined #nimrod |
| 16:45:43 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 16:48:24 | * | q66 joined #nimrod |
| 16:49:20 | * | gkoller joined #nimrod |
| 17:07:55 | * | Sht0 quit (Ping timeout: 255 seconds) |
| 17:37:23 | * | io2 quit (Ping timeout: 240 seconds) |
| 17:41:29 | * | gkoller_ joined #nimrod |
| 17:41:36 | Araq | BlaXpirit: yeah it is stupid that we don't support RandomAccess[T] yet. But on the other hand ... RandomAccess[T] is academic. In practice it's always an array or a seq anyway |
| 17:41:51 | BlaXpirit | no, Araq |
| 17:42:01 | Araq | no? |
| 17:42:03 | BlaXpirit | and i've provided a perfect example |
| 17:42:22 | BlaXpirit | see the "range" thing i've been talking about |
| 17:42:43 | BlaXpirit | not an array, not a seq, and yet a very useful thing |
| 17:43:09 | Araq | what is the "range" thing that you talked about? |
| 17:43:22 | BlaXpirit | dont u see message history, Araq? |
| 17:43:59 | BlaXpirit | https://docs.python.org/3/library/stdtypes.html#range https://gist.github.com/BlaXpirit/09290912725ef623d430 |
| 17:44:07 | Araq | "basically, i would love to use a..b as openarray" ? |
| 17:44:40 | Araq | ah so python-like range |
| 17:45:25 | BlaXpirit | yes, and in general I think Nimrod would be better off if it had slices like Python and ranges like Python |
| 17:45:50 | BlaXpirit | but that is not my main concern |
| 17:46:03 | BlaXpirit | indeed, the main thing I would like to see is support for general containers |
| 17:46:13 | Araq | we recently got zero-copy slices that can be passed to openarray fwiw |
| 17:46:24 | Araq | it's not even documented yet though |
| 17:46:31 | * | BlaXpirit rolls eyes |
| 17:47:04 | Araq | welcome to nimrod land. where nothing ever works. where essentially everything is missing. |
| 17:47:46 | Araq | but hey, many people can work with it, so yay ;-) |
| 17:48:03 | BlaXpirit | Araq, what about, say, those sparse int sets |
| 17:48:14 | BlaXpirit | i'm pretty sure functions that accept openarray can't work with them |
| 17:48:28 | BlaXpirit | what do u suggest doing - copying it into a seq? |
| 17:48:39 | BlaXpirit | well, this is not really a good example |
| 17:48:41 | Araq | yeah, but the question is: what does '[]' on an intset do? |
| 17:48:51 | BlaXpirit | yes, yes, hence "not really a good example" |
| 17:48:57 | BlaXpirit | but there can be other ... sparse things |
| 17:48:59 | BlaXpirit | just sparse array |
| 17:50:38 | Araq | did you try: proc foo[T](x: T): auto ? |
| 17:50:42 | BlaXpirit | no |
| 17:51:50 | * | Ven joined #nimrod |
| 17:52:38 | BlaXpirit | aaaand it works |
| 17:52:44 | BlaXpirit | now this is impressive |
| 17:52:50 | * | Johz joined #nimrod |
| 17:53:50 | BlaXpirit | echo range(1000000000).random_choice() |
| 17:53:52 | BlaXpirit | yup |
| 17:53:53 | BlaXpirit | yup |
| 17:53:58 | BlaXpirit | this is impressive |
| 17:54:03 | skyfex | Araq: I don't know if I've mentioned.. I've used threads and channels quite heavily in the last project. Works quite well :) |
| 17:54:26 | skyfex | I only missed two functions I wish were in the standard library.. |
| 17:54:52 | skyfex | One function to flush a channel (ignoring everything) |
| 17:56:37 | skyfex | Another to create a kind of T-junction.. take input from one or more channels and join them into one channel.. or a macro that processes several channels, and gives you a case-like statement for each chanenl |
| 17:56:48 | skyfex | I could try to contribute it |
| 17:57:39 | Araq | I'd rather see a new Chan that works with spawn, FlowVar and awaitAny |
| 17:58:41 | * | jhc76 joined #nimrod |
| 17:59:46 | BlaXpirit | okaaay so this ``echo to_seq(range(1000000000).random_sample(100))`` simply ends the program without any output |
| 18:04:10 | BlaXpirit | mostly because i'm a dummy |
| 18:05:00 | jhc76 | I never heard of nimrod until recently. What is a simple demo of a code that can show off some of its powers for sysadmin profession? trying to wrap my head around it so that I can weigh if I want to dive in deeper. |
| 18:05:21 | BlaXpirit | ah good stuff `` to_seq(range(1000000000).random_sample(5)) == @[890758599, 447430954, 452397207, 895844180, 674346587]`` |
| 18:05:40 | BlaXpirit | runs instantly btw |
| 18:06:50 | BlaXpirit | now all we need is to actually have `range` in nimrod :| |
| 18:08:17 | Araq | jhc76: dunno for sysadmins maybe koch.nim is a good start |
| 18:09:24 | jhc76 | Araq: thanks! I'll start there. |
| 18:09:58 | Araq | skyfex: I can tell you how it's supposed to work |
| 18:15:08 | * | EXetoC quit (Quit: WeeChat 1.0) |
| 18:15:12 | skyfex | Araq: Hmm, I think I read your articles on concurrency a long time ago, I'd forgotten about them.. how's the work on that going? |
| 18:16:07 | Araq | I implemented something else instead :P |
| 18:16:11 | Araq | something better |
| 18:26:14 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 18:26:35 | * | Ven joined #nimrod |
| 18:31:34 | * | gkoller_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 18:31:43 | * | io2 joined #nimrod |
| 18:32:02 | BlaXpirit | Araq, did you see this? https://github.com/BlaXpirit/nimrod-random Ideally, I would like this to be included with Nimrod, but, of course, someone has to evaluate it before I can even start to have such thoughts. |
| 18:33:11 | BlaXpirit | Because the current `random` functions in Nimrod can be problematic, I've said this before. The main concern is on Windows it will actually never generate a number above 32k, even if you want a random number from 0 to a billion |
| 18:33:58 | BlaXpirit | not to mention just 15 bits of resolution |
| 18:34:39 | BlaXpirit | 1 global instance of a generator and a compiler dependent implementation of it doesn't help |
| 18:36:24 | dom96 | A 'random' module would be nice. |
| 18:36:48 | BlaXpirit | dom96, could you look at it please? I don't see a better candidate :p |
| 18:37:38 | dom96 | 4 spaces need to be 2 spaces. |
| 18:38:18 | BlaXpirit | dom96, isn't nimrod supposed to be independent of such conventions? |
| 18:38:36 | BlaXpirit | of course, it's an easy change, but for me it's actually difficult to read code with so little indentation |
| 18:38:38 | dom96 | BlaXpirit: The code in the stdlib needs to be consistent. |
| 18:39:06 | BlaXpirit | let's not think particularly about stdlib just yet |
| 18:39:10 | dom96 | If it's your own package then I don't care. |
| 18:39:31 | BlaXpirit | next thing you'd say is probably camelCase or whatever it's called instead of underscores |
| 18:39:54 | BlaXpirit | btw, i've just started up windows virtual machine, and what I guessed would be the case from the code was just confirmed - random(1000000000) indeed gives numbers below 32k |
| 18:44:40 | * | Ven quit (Ping timeout: 255 seconds) |
| 18:45:25 | dom96 | Looks good to me. |
| 18:45:41 | BlaXpirit | dom96, really? not even nitpicks? |
| 18:46:43 | BlaXpirit | what about usage of `uint8`? was that the right choice? |
| 18:47:47 | BlaXpirit | and these aliases in the end - first of all, they don't look good to me (or maybe even inefficient - how I did it for the iterator seems bad to me) |
| 18:48:01 | BlaXpirit | and that comment at line 199 |
| 18:48:56 | * | Ven joined #nimrod |
| 18:49:07 | BlaXpirit | can't call these functions from outside the library if `mersenne_twister_inst` is not public |
| 18:49:08 | dom96 | Does line 198 not work or the code below it? |
| 18:49:34 | BlaXpirit | so basically code below it, yeah |
| 18:50:00 | dom96 | perhaps because you are inlining? |
| 18:50:13 | BlaXpirit | I did it without {.inline.} first |
| 18:50:25 | BlaXpirit | and {.closure.} just caused a different problem from what I remember |
| 18:51:01 | BlaXpirit | I can try to remove inline now again |
| 18:51:43 | dom96 | why would you make that a closure? |
| 18:51:51 | BlaXpirit | i dunno |
| 18:51:57 | BlaXpirit | so i removed inline and the star |
| 18:52:02 | BlaXpirit | (227, 4) Error: undeclared identifier: 'mersenne_twister_inst' |
| 18:52:30 | dom96 | ahh, that's a generic. |
| 18:52:52 | BlaXpirit | :| |
| 18:52:55 | BlaXpirit | bad surprise |
| 18:52:56 | dom96 | try writing 'mixin mersenne_twister_inst' |
| 18:53:13 | BlaXpirit | oooh right |
| 18:54:13 | BlaXpirit | uhh I'm not sure I'm writing it in the right place |
| 18:54:22 | dom96 | Do you really need those methods? |
| 18:54:43 | BlaXpirit | what do you mean? |
| 18:54:53 | BlaXpirit | these are what people are gonna use most of the time |
| 18:54:53 | dom96 | If you really want nitpicking then you shouldn't use inheritance. |
| 18:55:14 | BlaXpirit | dom96, i really don't see a better way |
| 18:55:18 | BlaXpirit | inheritance achieves a lot here |
| 18:56:48 | dom96 | I still haven't used methods once. |
| 18:56:59 | BlaXpirit | :| |
| 18:57:01 | dom96 | So i'm not sure what they achieve really. |
| 18:57:09 | BlaXpirit | just look |
| 18:57:25 | BlaXpirit | i made a whole new random number generator class with only 9 lines of code |
| 18:57:30 | dom96 | I would just overload the procs. |
| 18:57:42 | dom96 | on the different generator types |
| 18:57:53 | BlaXpirit | don't understand |
| 18:58:19 | BlaXpirit | write the same functions twice or what |
| 18:58:39 | dom96 | essentially s/method/proc/ |
| 18:58:48 | BlaXpirit | . . . . |
| 18:59:08 | BlaXpirit | i'll just disagree here |
| 18:59:17 | BlaXpirit | it's really extensible this way |
| 18:59:47 | Araq | we usually use proc vars for extensibility |
| 19:00:01 | BlaXpirit | i'm pretty sure one could write their own RNG very easily |
| 19:00:24 | Araq | yeah but we usually don't want that |
| 19:00:50 | BlaXpirit | !? |
| 19:03:53 | BlaXpirit | yeah, it works nicely https://gist.github.com/BlaXpirit/a6b5fec8785a59158716 |
| 19:04:18 | Araq | yes, and it's horrible |
| 19:05:14 | Araq | hint: ever looked at the infered effects? |
| 19:05:34 | BlaXpirit | (woops, that was a fluke. updated the code, now it's actually correct) |
| 19:05:35 | BlaXpirit | Araq, ? |
| 19:05:40 | Araq | that's how you can reason about this kind of code. you can't. |
| 19:06:48 | BlaXpirit | this is just so extremely strange to hear |
| 19:08:07 | Araq | why? because people with no idea about formal semantics wrote some wrong books about how to do programming? ;-) |
| 19:08:28 | BlaXpirit | you still haven't provided any good arguments |
| 19:08:53 | BlaXpirit | haven't said how it can be made differently |
| 19:09:50 | Araq | I told you proc vars are better |
| 19:10:23 | BlaXpirit | just "better", huh |
| 19:10:55 | BlaXpirit | well how about this - one class overrides only one of the methods and the other one overrides two |
| 19:11:16 | BlaXpirit | and one of the classes also defines extra procs |
| 19:11:32 | Araq | yes, yes and it's all downhill from there |
| 19:11:53 | Araq | do this with the rest of your codebase and Java is not far away |
| 19:12:09 | BlaXpirit | still just stabs and not real arguments |
| 19:12:24 | BlaXpirit | i'm not an OOP maniac by any means |
| 19:12:30 | BlaXpirit | but sometimes it just makes so much sense |
| 19:14:34 | BlaXpirit | I actually don't know how to do this with proc vars |
| 19:15:40 | * | EXetoC joined #nimrod |
| 19:16:18 | Araq | how is "not even the compiler can figure out what it does" not a real argument? |
| 19:16:30 | Matthias247 | polymorphism with a value object? Wasn't that the broken thing? |
| 19:16:59 | Araq | or make that "ok, ok, it can with global program analysis" |
| 19:17:41 | BlaXpirit | what are you even talking about? |
| 19:18:41 | * | EastByte joined #nimrod |
| 19:20:48 | Araq | I'm still explaining why we don't like 'method' |
| 19:24:24 | BlaXpirit | I really don't see any other way. |
| 19:24:35 | EXetoC | what's the short version? I just joined |
| 19:24:38 | BlaXpirit | And I really did try to think of one |
| 19:25:09 | BlaXpirit | short version was just posted |
| 19:25:20 | BlaXpirit | [:20:45] <Araq> ... we don't like 'method' |
| 19:25:35 | BlaXpirit | in regards to https://github.com/BlaXpirit/nimrod-random |
| 19:26:16 | EXetoC | doesn't go into why though |
| 19:26:28 | * | Trustable joined #nimrod |
| 19:26:52 | EXetoC | ok so the short version why it's disliked is because it is :p |
| 19:26:55 | BlaXpirit | EXetoC, there is no short version of "why" because there wasn't really a long one |
| 19:27:31 | EXetoC | so it's short in any case |
| 19:28:25 | * | jasondotstar joined #nimrod |
| 19:30:14 | * | Sht0 joined #nimrod |
| 19:32:56 | Araq | BlaXpirit: ok, how about this reason: it's slower than an ordinary proc call |
| 19:33:12 | BlaXpirit | Araq, that's nice |
| 19:33:13 | * | jhc76 quit (Remote host closed the connection) |
| 19:33:57 | BlaXpirit | in c++ nobody cares about, it's really just like 2 atomic operations |
| 19:34:19 | BlaXpirit | if the situation with performance is worse in Nimrod... well... too bad |
| 19:35:09 | BlaXpirit | and i don't think procvars don't have any overhea |
| 19:35:11 | BlaXpirit | d |
| 19:36:02 | Araq | they have less overhead, but still have overhead and in C++ people most certainly do care about it |
| 19:36:33 | Araq | especially for any architecture that is not x86 based |
| 19:38:15 | Matthias247 | I would guess that atomic ops are far more expensive than virtual calls. |
| 19:38:41 | BlaXpirit | the overhead from looking up a method is much less than from calling it |
| 19:39:48 | Araq | actually nimrod optimizes it to a static call if you never override it iirc, so it's faster than c++ |
| 19:39:58 | BlaXpirit | but wait a second |
| 19:40:01 | BlaXpirit | i never use any pointers |
| 19:40:05 | * | noam__ is now known as noam |
| 19:40:23 | BlaXpirit | so it's possible to just |
| 19:40:29 | Araq | BlaXpirit: well but you use 'var T' |
| 19:40:37 | BlaXpirit | yes, yes, i thought about it |
| 19:40:46 | BlaXpirit | but i mean in regard to methods and polymorphism |
| 19:41:19 | BlaXpirit | isn't it possible to make methods 0 overhead if it's not called from pointer? |
| 19:42:48 | Araq | yes it is but the compiler doesn't do that yet |
| 19:43:07 | Araq | but it should optimize it if you don't override it |
| 19:43:37 | BlaXpirit | so we come to compiler again |
| 19:44:01 | BlaXpirit | also, if anyone is familiar with c++, a function doesn't have to be virtual to let it be overridden |
| 19:44:21 | BlaXpirit | and I thought "method" was a full analog of "virtual" in c++ |
| 19:44:26 | BlaXpirit | apparently it's not |
| 19:46:05 | BlaXpirit | like, if I just replace "method" with "proc" in my code, the program crashes (not even doesn't compile) |
| 19:47:10 | BlaXpirit | ah no, it's doesn't crash. it's the assert |
| 19:47:57 | Araq | er ... you can assume I'm familiar with c++ .... |
| 19:48:26 | BlaXpirit | well then, "virtual" in c++ is only when you want pointer-based polymorphism |
| 19:48:52 | BlaXpirit | since I don't need this, i wouldn't have any virtual methods if I were to write this in c++ |
| 19:49:28 | BlaXpirit | Nimrod, on the other hand, required me to use "method" because otherwise it just doesn't work, even without pointers |
| 19:50:03 | Araq | not sure what you mean |
| 19:50:20 | BlaXpirit | what part is unclear? |
| 19:50:30 | Araq | to get dynamic dispatch in c++ you have to use virtual |
| 19:50:33 | BlaXpirit | yes |
| 19:50:41 | Araq | and in nimrod you have to use method |
| 19:50:46 | BlaXpirit | but dynamic dispatch is only for pointers and polymorphism |
| 19:51:03 | BlaXpirit | I don't need virtual dispatch here, and yet I'm forced to use "method" |
| 19:51:11 | Araq | how so? |
| 19:51:24 | BlaXpirit | "how so" in regard to what? |
| 19:51:59 | BlaXpirit | if I just replace "method" with "proc" it doesn't work - the function of base class is called, and the right one is just ignored |
| 19:52:42 | Araq | yes ... just like in c++? |
| 19:52:47 | BlaXpirit | no |
| 19:53:05 | BlaXpirit | in c++ i could just not use virtual at all and it would work |
| 19:53:16 | BlaXpirit | (until pointer to base class is involved) |
| 19:54:36 | Araq | I can't see how. can you make a gist? |
| 19:54:54 | BlaXpirit | of what |
| 19:55:09 | EXetoC | what's the difference? casting? |
| 19:55:18 | BlaXpirit | there is no casting involved |
| 19:55:45 | EXetoC | not in nimrod? |
| 19:55:51 | BlaXpirit | nowhere |
| 19:55:55 | BlaXpirit | we are not talking about casting |
| 19:56:40 | dom96 | Hah. Imagine if this gets accepted: http://www.freepatentsonline.com/y2014/0196008.html |
| 19:56:53 | BlaXpirit | cool story |
| 19:56:55 | EXetoC | there is if you want to call the right overload |
| 19:57:31 | EXetoC | whatever |
| 20:01:20 | BlaXpirit | https://gist.github.com/BlaXpirit/222ab964824f3541f72a |
| 20:01:22 | BlaXpirit | Araq, |
| 20:03:02 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
| 20:03:24 | EXetoC | um, Base in the C++ code isn't used |
| 20:03:34 | BlaXpirit | i'm an idiot |
| 20:04:08 | EXetoC | is that a self-portrait? |
| 20:04:09 | BlaXpirit | updated code, same thing |
| 20:05:44 | Araq | well? |
| 20:05:57 | EXetoC | but now TChild is never instantiated in the nimrod code |
| 20:06:22 | BlaXpirit | now i'm really an idiot |
| 20:06:55 | BlaXpirit | so then, why doesn't it work in my code? |
| 20:08:07 | BlaXpirit | ah but of course, because it's called by another method |
| 20:09:55 | BlaXpirit | so I really do need dynamic dispatch then |
| 20:10:00 | BlaXpirit | i'm sorry |
| 20:12:18 | Araq | no worries |
| 20:19:19 | Skrylar | meep |
| 20:20:44 | Skrylar | dom96: o_O are they trying to patent shit that erlang already did in the 90s? |
| 20:20:51 | dom96 | Skrylar: yep |
| 20:21:18 | Skrylar | meh. USPTO will accept it because they don't bother to check anything |
| 20:21:24 | dom96 | If it succeeds I am going to patent the if statement. |
| 20:21:26 | Skrylar | and thanks to obama its now first to file instead of first to invent |
| 20:21:33 | Skrylar | because that makes TOTAL sense |
| 20:21:47 | * | io2 joined #nimrod |
| 20:22:09 | Skrylar | "our courts are full of patent litigation, we need reform" "ok, i will fuck you with a larger dildo" ":/" |
| 20:22:17 | Skrylar | anyway |
| 20:22:38 | Skrylar | i would just eradicate patents wholesale if it were up to me; evidence does not show that they are statistically used for their stated purposes |
| 20:23:15 | Skrylar | and nature doesn't abide by them anyway |
| 20:28:40 | * | Mat3 joined #nimrod |
| 20:28:43 | Mat3 | hello |
| 20:35:15 | dom96 | hi Mat3 |
| 20:37:56 | Mat3 | hi dom96 |
| 20:38:31 | dom96 | Mat3: What's new? |
| 20:41:44 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
| 20:42:38 | Mat3 | I'm working on a port of these little C compiler |
| 20:45:44 | dom96 | awesome |
| 20:48:14 | Mat3 | how can I include an external C function in Nimrod ? |
| 20:49:06 | dom96 | http://build.nimrod-lang.org/docs/manual.html#importc-pragma ? |
| 20:49:59 | Mat3 | thanks |
| 20:50:45 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 20:51:35 | * | zahary quit (Quit: Leaving.) |
| 21:02:59 | * | UNIcodeX joined #nimrod |
| 21:04:03 | UNIcodeX | anyone in here who came from python? |
| 21:07:42 | * | Jesin joined #nimrod |
| 21:10:11 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 21:11:40 | dom96 | UNIcodeX: yes |
| 21:11:47 | dom96 | welcome :) |
| 21:11:48 | * | Johz quit (Ping timeout: 246 seconds) |
| 21:12:00 | BlaXpirit | yes |
| 21:12:02 | UNIcodeX | dom96, thanks |
| 21:12:20 | UNIcodeX | are there any materials that you found particularly helpful in your migration? |
| 21:12:45 | BlaXpirit | there are no materials, lol. get used to it |
| 21:12:48 | UNIcodeX | haha |
| 21:13:14 | UNIcodeX | i'm very used to having tons of libraries at my disposal with python, so i'm trying to get used to the newness. |
| 21:13:58 | UNIcodeX | alright. cool. well y'all answered my questions. |
| 21:14:03 | UNIcodeX | i'll just hang out i suppose. |
| 21:14:56 | dom96 | UNIcodeX: Best thing is to go through the tutorial, skim the manual, https://nimrod-by-example.github.io/, and to ask questions here. |
| 21:15:11 | Skrylar | i use the manual and library reference; though i'm used to learning to program from dirt. xD |
| 21:15:52 | Skrylar | time to offend dom96's sensibilities with another jpg http://i.imgur.com/W09Rd4u.jpg :P |
| 21:16:59 | BlaXpirit | my eyes |
| 21:17:08 | dom96 | disgusting |
| 21:17:23 | dom96 | #pngMasterRace |
| 21:17:37 | Skrylar | the png is also huge |
| 21:19:18 | Skrylar | anyway as i suspected; a tiny-swatch based GUI does indeed seem to be very easy to customize |
| 21:21:22 | * | Ven joined #nimrod |
| 21:33:01 | dom96 | Skrylar: What's this GUI thing for? |
| 21:33:13 | Skrylar | dom96: same project as two days ago when you asked =p |
| 21:33:33 | Skrylar | trying to stave off my lisp pangs long enough to get it written though :( |
| 21:33:53 | dom96 | lol, I can't even remember asking :P |
| 21:34:11 | Skrylar | also i feel like a tiny hero every time emacs lisp does something xD |
| 21:34:22 | Skrylar | had to move a proc so i went and added a nimrod-kill-proc |
| 21:34:45 | Skrylar | too many more of these commands and it will end up just being a structural editor >_< |
| 21:36:24 | Varriount | UNIcodeX: Nice to see another Pythonista! |
| 21:39:17 | UNIcodeX | Varriount: :-) i have to go at the moment, but maybe i'll catch y'all tomorrow. |
| 21:42:05 | Mat3 | (defun fun (x) (map x '(* x (sqrt (pot x))))) |
| 21:43:49 | Mat3 | ^a joke |
| 21:44:28 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 21:48:51 | BlaXpirit | uhh but that problem with random number generation remains. have we decided on anything? |
| 21:51:42 | Varriount | BlaXpirit: It might be worth it to put the discussion of random number generation in a forum topic/github issue - it makes it easier for those in other time zones to discuss. |
| 21:52:13 | Varriount | BlaXpirit: Also, whats the problem? |
| 21:52:22 | BlaXpirit | forum, eh? i haven't even noticed any forum |
| 21:52:34 | BlaXpirit | Varriount, i've mentioned a few of them |
| 21:52:35 | Varriount | forum.nimrod-lang.org |
| 21:52:37 | BlaXpirit | but the main one is |
| 21:52:58 | BlaXpirit | on Windows it will actually never generate a number above 32k, even if you want a random number from 0 to a billion |
| 21:53:15 | BlaXpirit | not to mention just 15 bits of resolution |
| 21:53:18 | Varriount | Why? |
| 21:53:35 | BlaXpirit | because rand() gives a number from 0 to 32k on windows |
| 21:53:45 | BlaXpirit | and the current implementation is rand() mod max -_- |
| 21:54:13 | BlaXpirit | also bad seeding |
| 21:54:58 | Varriount | Isn't that what you were working on? Seeding the PRNG with a value from native sources? |
| 21:55:25 | BlaXpirit | that's part of my new awesome library |
| 21:55:28 | BlaXpirit | havent u seen it? |
| 21:55:42 | Varriount | No. I've been in classes and work all day. |
| 21:55:50 | BlaXpirit | https://github.com/BlaXpirit/nimrod-random - it's the solution to everything |
| 21:56:09 | BlaXpirit | i'm looking for feedback and possibility to add it to Nimrod |
| 21:56:16 | Varriount | What PRNG algorithm does it use? |
| 21:56:27 | BlaXpirit | it's all there |
| 21:56:39 | BlaXpirit | http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html |
| 21:56:47 | BlaXpirit | same one that Python uses |
| 21:57:00 | BlaXpirit | (and it's largely a ripoff of Python's library, but whatever) |
| 21:58:25 | Varriount | BlaXpirit: It looks good (with a casual inspection) |
| 22:00:46 | Skrylar | oh! |
| 22:00:51 | Skrylar | mersenne twister has a caveat |
| 22:01:14 | Skrylar | you can predict every future output given the previous 4k outputs, which is why roguelikes stopped using it |
| 22:01:52 | Varriount | I seem to remember some discussion on having a generic 'random number generation' module, to which multiple backends could be attached. |
| 22:02:05 | BlaXpirit | Varriount, and that's exactly what this is! |
| 22:02:08 | Skrylar | Varriount: i have one of those |
| 22:02:40 | BlaXpirit | although it perhaps could accept input in different ways |
| 22:02:48 | BlaXpirit | and not just random byte thing |
| 22:03:03 | Skrylar | nah a random alg produces random bits or ints |
| 22:03:09 | Skrylar | anything else you want to do is independent of that |
| 22:03:16 | Skrylar | just remember to scale instead of modulo |
| 22:03:34 | BlaXpirit | you're saying obvious things |
| 22:03:51 | * | Skrylar dons the captain obvious shield and flies to the moon |
| 22:03:57 | BlaXpirit | maybe what i said wasn't clear, but you understood it wrong |
| 22:04:37 | BlaXpirit | my library allows you to make an RNG class if you just provide it with a "random byte" function |
| 22:04:58 | BlaXpirit | and optionally a "random 0<=n<1 float" function |
| 22:05:10 | BlaXpirit | so it doesn't have to make floats from those bytes |
| 22:06:36 | * | johnsoft joined #nimrod |
| 22:07:15 | BlaXpirit | Varriount, although maybe for a more comprehensive solution c++'s library could be inspected |
| 22:07:21 | BlaXpirit | but it's so big and complicated |
| 22:22:23 | * | NimBot_ joined #nimrod |
| 22:23:33 | * | delian66 quit (Ping timeout: 255 seconds) |
| 22:23:35 | jjap | Hi guys/gals. Question, the first: Anyone maintaining the homebrew formula for nimrod? |
| 22:23:53 | * | onionhammer quit (Ping timeout: 255 seconds) |
| 22:24:15 | * | onionhammer joined #nimrod |
| 22:24:22 | * | jez0990_ joined #nimrod |
| 22:25:04 | * | Trustable quit (Quit: Leaving) |
| 22:25:46 | * | seubert_ joined #nimrod |
| 22:28:47 | * | delian66 joined #nimrod |
| 22:29:35 | dom96 | hey jjap |
| 22:29:44 | dom96 | jjap: Not as far as I know. |
| 22:31:19 | * | enquora quit (Quit: enquora) |
| 22:31:50 | jjap | dom96: I see. Install process changed dramatically, and the formula is stuck at 0.9.2 |
| 22:38:41 | * | NimBot joined #nimrod |
| 22:38:41 | * | Araq quit (Ping timeout: 261 seconds) |
| 22:38:53 | * | Araq_bnc joined #nimrod |
| 22:39:06 | jjap | Is there any interest in having multiple versions of nimrod install? Like Having Python2.5, 2.7, 3.3 (etc) installed; all binaries symlinked as python-X.X; and latest (orwhatver) additionally symlinked as simply python ? |
| 22:39:18 | jjap | *of nimrod installed? |
| 22:42:19 | * | TylerE quit (Ping timeout: 240 seconds) |
| 22:42:37 | * | delian66 quit (*.net *.split) |
| 22:42:37 | * | NimBot_ quit (*.net *.split) |
| 22:42:37 | * | BlameStross1 quit (*.net *.split) |
| 22:42:38 | * | saml quit (*.net *.split) |
| 22:43:51 | * | OrionPK quit (Read error: Connection reset by peer) |
| 22:44:17 | * | TylerE joined #nimrod |
| 22:45:10 | * | saml joined #nimrod |
| 22:45:14 | * | dom96 quit (Ping timeout: 240 seconds) |
| 22:47:53 | * | dom96 joined #nimrod |
| 22:49:56 | * | reloc0 joined #nimrod |
| 22:55:07 | * | BlaXpirit quit (Quit: Quit Konversation) |
| 22:56:02 | * | TylerE quit (Changing host) |
| 22:56:02 | * | TylerE joined #nimrod |
| 22:56:34 | * | OrionPK joined #nimrod |
| 22:57:22 | * | Mat3 quit (Quit: Verlassend) |
| 23:00:40 | * | jjap quit (Ping timeout: 246 seconds) |
| 23:01:46 | * | saml_ joined #nimrod |
| 23:21:53 | * | darkf joined #nimrod |
| 23:22:03 | * | brson quit (Quit: leaving) |
| 23:22:12 | * | brson joined #nimrod |
| 23:55:32 | * | xenagi joined #nimrod |
| 23:57:07 | * | brson quit (Quit: leaving) |
| 23:57:37 | * | brson joined #nimrod |