00:02:44 | * | nande quit (Read error: Connection reset by peer) |
00:06:10 | * | zahary quit (Read error: Connection reset by peer) |
00:06:29 | * | zahary joined #nimrod |
00:35:16 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:48:46 | * | darkf_ joined #nimrod |
00:50:21 | * | darkf quit (Ping timeout: 240 seconds) |
00:50:59 | * | darkf_ is now known as darkf |
01:12:28 | * | nande joined #nimrod |
02:09:57 | * | willwillson quit (Ping timeout: 240 seconds) |
02:15:45 | * | johnsoft joined #nimrod |
02:37:43 | * | saml_ joined #nimrod |
03:07:40 | * | q66 quit (Quit: Leaving) |
03:54:17 | * | nande quit (Remote host closed the connection) |
04:18:13 | * | darkfusion quit (Ping timeout: 272 seconds) |
04:33:39 | * | darkfusion joined #nimrod |
04:36:52 | * | shodan45 quit (Quit: Konversation terminated!) |
04:39:39 | flaviu | I think this comment is spot-on: http://www.reddit.com/r/programming/comments/2ed9ah/some_notes_on_d_for_the_win/#cjyddc7 , particularly the first part |
05:03:49 | * | flaviu quit (Ping timeout: 272 seconds) |
05:17:13 | * | gkoller joined #nimrod |
06:00:00 | * | saml_ quit (Quit: Leaving) |
06:04:36 | * | whfkvfszjibsaybx joined #nimrod |
06:05:11 | whfkvfszjibsaybx | Is Nimrod good for server based programming? |
06:06:53 | * | whfkvfszjibsaybx left #nimrod (#nimrod) |
06:10:32 | * | robsen joined #nimrod |
06:10:41 | * | robsen left #nimrod (#nimrod) |
06:26:21 | * | darkf_ joined #nimrod |
06:27:09 | * | darkf quit (Ping timeout: 240 seconds) |
06:38:55 | * | Ven joined #nimrod |
06:41:33 | * | darkf_ is now known as darkf |
06:49:23 | * | kunev quit (Ping timeout: 245 seconds) |
06:57:29 | * | ome joined #nimrod |
07:34:17 | * | skyfex quit (Quit: Computer has gone to sleep.) |
07:58:59 | * | io2 joined #nimrod |
08:04:32 | * | BlaXpirit joined #nimrod |
08:12:13 | Araq | hi BlaXpirit welcome |
08:12:24 | BlaXpirit | hello, Araq |
08:12:49 | BlaXpirit | i'm dabbling in all those new fancy languages |
08:12:59 | BlaXpirit | my journey may end on Nimrod |
08:15:53 | * | zahary quit (Ping timeout: 255 seconds) |
08:15:58 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:20:46 | * | Varriount|Mobile joined #nimrod |
08:22:05 | Varriount|Mobile | Araq: Just found a blog post about a bug in Rust's substring matching procedure, partially caused by *unsigned integers * |
08:22:09 | Varriount|Mobile | http://www.wabbo.org/blog/2014/22aug_on_bananas.html |
08:24:17 | Varriount|Mobile | Although, it's more of a wrapping error. |
08:27:25 | * | bogen quit (Ping timeout: 260 seconds) |
08:46:56 | Araq | Varriount|Mobile: well that's not news to me ;-) |
08:53:37 | Varriount|Mobile | Araq: Though I must still concede that there is a use for unsigned ints - they do make some sense when used to describe arbitrarily large numbers. Otherwise you're throwing out a large range of numbers |
08:55:59 | Araq | yes they do make sense, but you shouldn't embrace them. Or perhaps learn to never use the - operator when you do |
09:01:37 | Varriount|Mobile | Hm. Most of Nimrod's string operations would fail for strings whose size exceeds 1.18 Gigabytes (on 32 bit machines) |
09:04:01 | Araq | really? shouldn't that be 2 GB? |
09:04:25 | Varriount|Mobile | Although on 64 bit machines, strings would have to be larger than 73.79 Exabytes |
09:05:17 | * | filwit joined #nimrod |
09:05:36 | Araq | hi filwit |
09:05:41 | filwit | hey Araq |
09:05:52 | Araq | btw there is a pretty lively discussion on reddit about D vs nimrod |
09:06:11 | filwit | just responded to the guy you where talking too there |
09:06:22 | Araq | don't misinterpret this as begging for upvotes :P |
09:06:23 | Varriount|Mobile | Araq: Wait, my math might be off |
09:06:33 | Varriount|Mobile | Also, link please |
09:06:47 | Araq | http://www.reddit.com/r/programming/comments/2ed9ah/some_notes_on_d_for_the_win/ |
09:06:52 | filwit | Araq: nah, i only upvote people i agree with.. and I did that to your posts cause I agreed with them |
09:07:03 | Araq | I gotta go, see you later |
09:09:50 | Varriount|Mobile | Ok, assuming each character in a string is 8 bits... Maximum size is 2.147 Gigabytes |
09:10:30 | Varriount|Mobile | For platforms where Nimrod's int is 32 bits long |
09:11:06 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:11:15 | * | Ven joined #nimrod |
09:11:42 | Varriount|Mobile | For platforms where Nimrod's int is 64 bits, the maximum size is... 9.223 Exabytes |
09:12:34 | filwit | Varriount|Mobile: don't worry, by 2016 that will probably be the standard amount of memory sold in laptops... |
09:13:27 | Varriount|Mobile | So unless you're doing string processing on 32 bit processors/Nimrod programs compiled for 32 bit processors, you shouldn't worry |
09:16:06 | Varriount|Mobile | Something tells me that if your you're processing strings over 2GB, you'll have other concerns (like not getting enough memory from the OS) |
09:25:02 | Varriount|Mobile | filwit: What's your take on unsigned numbers? |
09:25:54 | filwit | Varriount|Mobile: not sure. never thought about before using Nimrod. I understand they can cause (casting) problems, but otherwise I like them when appropriate. |
09:28:26 | filwit | brb |
09:28:42 | * | Ven quit (Read error: Connection reset by peer) |
09:31:22 | * | Ven joined #nimrod |
09:44:23 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:46:45 | * | Ven joined #nimrod |
10:14:45 | * | Ven quit (Ping timeout: 240 seconds) |
10:27:45 | * | Matthias247 joined #nimrod |
10:44:35 | * | Ven joined #nimrod |
10:49:42 | * | Trustable joined #nimrod |
11:17:19 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
11:22:04 | * | delian66 joined #nimrod |
11:23:44 | * | delian66 quit (Client Quit) |
11:30:37 | BlaXpirit | reading the manual. I don't understand mixin/bind at all |
11:31:54 | filwit | BlaXpirit: bind is depreciated. mixin tells the compiler to pretend a function exists for a generic (even if the compiler can't find it). |
11:31:58 | * | delian66 joined #nimrod |
11:32:39 | BlaXpirit | uhhhhh |
11:33:24 | filwit | sorry, that didn't explain things well at all... |
11:36:09 | Araq | BlaXpirit: the language tries hard to implement "intuitive" symbol binding rules, so most often you neither need 'bind' nor 'mixin' |
11:37:11 | Araq | however, 'bind' enforces "lookup this symbol in the definition scope of the generic" |
11:37:35 | Araq | whereas 'mixin' does the opposite: "lookup this symbol in the instantiation scope of the generic" |
11:38:45 | BlaXpirit | ok, thank you. maybe i understand now |
11:39:14 | filwit | hmm... so is 'bind' not depreciated? I thought I remember you saying that before, but I should probably refrain from spreading potentially false info without knowing for sure.. |
11:39:58 | BlaXpirit | really confusing names for these |
11:40:05 | BlaXpirit | mixin is a completely different concept... |
11:40:56 | Araq | filwit: it is not deprecated, but very rarely necessary. There is lots of code out there which still uses it, but doesn't have to anymore. |
11:41:16 | filwit | Araq: okay, thanks |
11:41:34 | Araq | BlaXpirit: a fair point, but I couldn't think of a better name. I'm all ears if you have a good suggestion. |
11:41:50 | BlaXpirit | so wait... I can make a function that refers to an unexisting variable |
11:42:04 | BlaXpirit | and it will magically refer to whatever variable is in the scope where the function is used? |
11:42:28 | Araq | a *generic* function, yes |
11:43:13 | Araq | actually the variable has to be a toplevel variable but unfortunately the compiler doesn't check this properly |
11:43:35 | BlaXpirit | reeeally weird stuff |
11:44:02 | BlaXpirit | and this comes from someone who went through 3/4 of the manual xD |
11:44:48 | Araq | not really that weird. it's the way generics can invoke unkown 'hash' and '==' procs |
11:44:56 | Araq | *unknown |
11:45:22 | Araq | it should be obvious why that is required |
11:45:52 | * | jasondotstar joined #nimrod |
11:46:32 | Araq | hi jasondotstar welcome |
11:46:57 | BlaXpirit | OK, so this seems to be conflicting information |
11:46:58 | jasondotstar | Araq: thx |
11:47:20 | BlaXpirit | tutorial says "The template body does not open a new scope" |
11:47:31 | BlaXpirit | and then manual says they are hygienic |
11:48:53 | Araq | ok thanks for pointing it out, I'll fix the tutorial |
11:49:30 | BlaXpirit | having to add a block made more sense to me... cleanear |
11:49:33 | BlaXpirit | cleaner* |
11:49:52 | Araq | a block doesn't result in hygiene though |
11:49:58 | Araq | hence it had to be changed |
11:50:55 | * | Jesin quit (Quit: Leaving) |
11:51:48 | * | delian66 quit (Quit: leaving) |
11:52:01 | * | delian66 joined #nimrod |
11:53:32 | * | delian66 quit (Client Quit) |
11:53:43 | * | delian66 joined #nimrod |
11:56:48 | dom96 | hello |
11:59:59 | * | skyfex joined #nimrod |
12:00:04 | * | io2 joined #nimrod |
12:03:07 | * | jasondotstar quit (Quit: Leaving) |
12:03:29 | * | jasondotstar joined #nimrod |
12:04:31 | Araq | hi dom96 |
12:04:42 | dom96 | hi Araq |
12:10:35 | * | ARCADIVS joined #nimrod |
12:13:02 | * | jasondotstar quit (Quit: Leaving) |
12:13:24 | * | jasondotstar joined #nimrod |
12:13:41 | * | jasondotstar quit (Remote host closed the connection) |
12:14:55 | * | jasondotstar joined #nimrod |
12:17:22 | BlaXpirit | OK, so I see this https://github.com/fowlmouth/nimrod-sfml but how am I supposed to use it? |
12:19:02 | * | Varriount|Mobile quit (Ping timeout: 260 seconds) |
12:20:33 | dom96 | BlaXpirit: babel install sfml |
12:20:37 | dom96 | BlaXpirit: import sfml |
12:20:43 | BlaXpirit | "babel"? |
12:20:50 | BlaXpirit | but but that's |
12:20:54 | BlaXpirit | a different thing |
12:21:16 | dom96 | that's nimrod's package manager |
12:21:26 | BlaXpirit | "Open Babel converts chemical structures from one file format to another" |
12:21:26 | dom96 | it will download and install that package for you |
12:21:32 | dom96 | actually 'import csfml' |
12:21:37 | dom96 | https://github.com/nimrod-code/babel |
12:22:16 | BlaXpirit | but srsly, there is already an executable called "babel" |
12:23:06 | BlaXpirit | at least it doesn't insist on global install with sudo and stuff |
12:23:28 | dom96 | are you using this other babel? |
12:23:31 | BlaXpirit | no |
12:23:41 | BlaXpirit | just very unfortunate naming |
12:23:51 | dom96 | Yeah, maybe I will rename it. |
12:24:00 | dom96 | But for now you can just remove that other package |
12:24:10 | BlaXpirit | i don't think i can |
12:25:35 | dom96 | ok, then rename the nimrod babel to babelpkg or something |
12:25:50 | BlaXpirit | i don't need to |
12:26:10 | BlaXpirit | ~/.babel/bin/babel looks good enough :| |
12:27:11 | filwit | i always just add ~/.local/bin to my path, then setup my own aliases to things.. and i can babel 'nim-babel' |
12:27:25 | filwit | call* |
12:27:28 | BlaXpirit | i have this too |
12:28:18 | BlaXpirit | yay, it works |
12:28:21 | BlaXpirit | thank you |
12:28:48 | * | EXetoC joined #nimrod |
12:37:47 | * | delian66 quit (Quit: leaving) |
12:39:38 | * | delian66 joined #nimrod |
12:39:51 | * | delian66 quit (Client Quit) |
12:41:47 | * | delian66 joined #nimrod |
12:46:49 | * | q66 joined #nimrod |
12:50:46 | * | darkf quit (Quit: Leaving) |
12:54:00 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:59:26 | * | Ven joined #nimrod |
13:08:20 | BlaXpirit | so i was afraid there was gonna be some flaw that would prevent me from using Nimrod |
13:08:40 | BlaXpirit | standard library and documentation................................ |
13:09:08 | filwit | ... are being worked on. We know. |
13:09:51 | BlaXpirit | there is only 1 function for randomization, and it is in math module, and it doesn't work properly on Window |
13:09:53 | BlaXpirit | s |
13:11:07 | BlaXpirit | no, it doesn't work at all! |
13:11:13 | BlaXpirit | (on Windows) |
13:12:30 | BlaXpirit | ah, I finally understand |
13:12:41 | BlaXpirit | so on Windows only the float version doesn't work |
13:12:59 | BlaXpirit | but seriously... |
13:15:03 | dom96 | BlaXpirit: works for me. You need to call randomize at least once. |
13:15:23 | BlaXpirit | what about when not defined(windows): |
13:15:34 | BlaXpirit | and an according warning in documentation |
13:16:25 | filwit | BlaXpirit: try `randomize(); let x = random(10); echo x` and you should get a random number.. |
13:16:42 | BlaXpirit | but I can't try because I'm not on Windows |
13:16:57 | BlaXpirit | also, it's supposed to be random(10.0) |
13:17:01 | BlaXpirit | for it to not work |
13:18:37 | BlaXpirit | why not just use this http://stackoverflow.com/a/686373 |
13:18:46 | filwit | yeah wait... why isn't the float version of random supported on Windows? |
13:18:53 | filwit | that's odd.. |
13:19:05 | BlaXpirit | because it uses linux standard library |
13:19:31 | BlaXpirit | all the randomization C itself has is random integer from 0 to RAND_MAX (constant) |
13:20:20 | BlaXpirit | which is not the worst thing in the world and could be used as a fallback, although then the difference in behavior could be a source of problems |
13:20:21 | dom96 | https://github.com/Araq/Nimrod/blob/2525215610c55f97aded12658b5318eea752975f/lib/pure/math.nim#L210 |
13:20:27 | dom96 | I tested it, and it works. |
13:20:56 | BlaXpirit | oh so there is the fallback |
13:21:04 | BlaXpirit | and the different behavior on different systems like i said |
13:21:12 | BlaXpirit | whatever... |
13:21:22 | BlaXpirit | but still, documentation says it's not supported on windows |
13:21:57 | filwit | yes that might be wrong, or might only be in the stable docs, one sec |
13:22:00 | dom96 | Where in the documentation does it say that? |
13:22:04 | BlaXpirit | on main site |
13:22:05 | BlaXpirit | and 32767.... wow, no, that's actually not good enough |
13:22:30 | dom96 | http://build.nimrod-lang.org/docs/math.html#random,float |
13:22:32 | BlaXpirit | nimrod-lang.org/math.html#random,float |
13:22:34 | BlaXpirit | oh |
13:22:46 | BlaXpirit | okaaay |
13:24:11 | filwit | it's cause the docs from the link on the main site only go to release (0.9.4)... the new site will have links to both stable & dev docs, for those who use the devel branch |
13:27:06 | filwit | BlaXpirit: btw, is there a Windows alternative to the existing random(0.0) "fallback" that you would prefer? If so, you should report it as an issue, or better yet, fork and make a PR. |
13:29:31 | BlaXpirit | oh also... |
13:29:49 | BlaXpirit | i'm pretty sure the Windows version does not conform to what documentation says |
13:29:59 | BlaXpirit | 0..<max |
13:30:06 | BlaXpirit | but windows version actually has 0..<=max |
13:38:09 | BlaXpirit | blah... c++ has the best random library of all languages now |
13:39:17 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:47:58 | BlaXpirit | gaaah |
13:48:08 | BlaXpirit | random(int) implementation is also horrible |
13:48:30 | BlaXpirit | srsly, it's not even uniform |
13:48:32 | BlaXpirit | and |
13:49:07 | BlaXpirit | if u want a random number from 0 to a billion, u will actually get a random number from 0 to 32767 |
13:49:25 | BlaXpirit | and if u want a random number from 0 to 32768, 0 will be twice as likely as all the rest |
13:49:26 | BlaXpirit | etc |
13:49:43 | * | Ven joined #nimrod |
13:50:21 | BlaXpirit | i mean 32766 |
13:52:24 | BlaXpirit | at least on linux RAND_MAX is sensible, 2147483647, so what I said above will only happen on windows |
13:57:08 | BlaXpirit | may be a good idea to just rewrite some implementation to nimrod... |
13:57:20 | BlaXpirit | and get a decent random module |
13:57:33 | BlaXpirit | and then export just 2 functions to math for compatibility |
13:57:48 | BlaXpirit | seems like a good idea to me to copy Python's random library |
13:58:02 | BlaXpirit | but not sure how the licenses would work out |
13:58:17 | BlaXpirit | wouldn't copypaste any code directly, but still.. |
13:58:46 | BlaXpirit | and Python uses CryptGenRandom on Windows |
14:00:05 | BlaXpirit | ah, only for seeding and an alternative implementation |
14:07:47 | BlaXpirit | but at the core is this http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html |
14:09:57 | dom96 | There is already an issue for this: https://github.com/Araq/Nimrod/issues/1044 |
14:10:01 | * | flaviu joined #nimrod |
14:10:10 | BlaXpirit | that's the least of the problems |
14:10:30 | dom96 | BlaXpirit: Please consider improving the code! |
14:10:55 | BlaXpirit | well, as i said, rewriting python's library (including its C mersenne twister core) is what seems best to me |
14:11:00 | BlaXpirit | and i might even do that |
14:11:04 | BlaXpirit | but what about licenses? |
14:11:35 | dom96 | You will just be copying the algorithm not the code I think. |
14:11:38 | dom96 | So it's fine. |
14:11:59 | EXetoC | isn't the license very liberal? |
14:12:31 | BlaXpirit | it's even 2 different licenses |
14:13:22 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:13:31 | dom96 | You could always translate this pseudo code instead: https://en.wikipedia.org/wiki/Mersenne_twister#Pseudocode |
14:13:51 | EXetoC | but yeah, copying an algorithm is completely different |
14:13:55 | BlaXpirit | it's much less code than in the link i sent |
14:14:13 | BlaXpirit | that one contains everything ready, no thinking required |
14:15:00 | EXetoC | there's a SIMD-oriented MT generator apparently |
14:15:21 | BlaXpirit | but that's also a ton of code |
14:15:34 | BlaXpirit | i'm just orienting on what Python uses and what everyone is happy with |
14:15:52 | dom96 | I would keep it simple if I were you. The less code the better. |
14:21:58 | BlaXpirit | or is it reasonable to just include that C file into Nimrod? |
14:25:43 | BlaXpirit | oh, c2nim seems to work too |
14:25:48 | BlaXpirit | I just don't know what's best |
14:26:28 | dom96 | Native nimrod implementations are preferable. |
14:27:17 | BlaXpirit | see, Python uses this C library that linked to, but it's just the core |
14:27:33 | BlaXpirit | and i'm not gonna copy python's code at all |
14:27:42 | BlaXpirit | this C library, however, is crucial |
14:27:46 | EXetoC | yeah for speed reasons I'd imagine |
14:35:26 | dom96 | EXetoC: Please improve mongo so that it's ready for the next release. |
14:36:23 | EXetoC | I'll try. Just tell me if you think that there will be a release |
14:36:30 | EXetoC | oops |
14:36:43 | EXetoC | ... before that of the ETA on github |
14:39:03 | dom96 | Hard to say. We usually miss these deadlines though... |
14:39:38 | EXetoC | yeah. the motivation is coming back so it shouldn't be an issue either way |
14:39:45 | dom96 | good |
14:40:55 | * | BlaXpirit quit (Quit: Quit Konversation) |
14:41:21 | * | Jehan_ joined #nimrod |
14:43:27 | * | BlaXpirit joined #nimrod |
14:49:13 | BlaXpirit | uh what?? |
14:49:28 | EXetoC | ? |
14:49:57 | BlaXpirit | c2nim `mt[mti-1]` becomes `mt[mti + 1]` |
14:50:08 | BlaXpirit | really |
14:51:08 | dom96 | Are you using latest c2nim? |
14:51:15 | dom96 | This may have been fixed in this commit: https://github.com/nimrod-code/c2nim/commit/8ce638ae466af02fb349955b40a514677da8532a |
14:52:02 | BlaXpirit | 0.9.5 |
14:52:28 | BlaXpirit | but seriously, if after such a horrible problem you don't make a new release... this is disturbing |
14:53:34 | EXetoC | there are a gazillion different issues though |
14:53:49 | dom96 | yes, and how do you decide which deserve a new release and which don't? |
14:54:11 | dom96 | another problem is that releases take a long time. |
14:55:56 | EXetoC | and releases will be of more importance >= 1.0 |
14:58:22 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:58:37 | * | BlameStross left #nimrod (#nimrod) |
15:00:59 | dom96 | Araq: Do we have a test which checks if the stdlib compiles in tainted string mode? |
15:04:59 | * | EXetoC quit (Quit: WeeChat 1.0) |
15:07:40 | * | EXetoC joined #nimrod |
15:17:38 | * | ARCADIVS quit (Quit: WeeChat 0.4.3) |
15:23:25 | flaviu | dom96: Put out a dot release every so often for bugfixes? |
15:24:14 | flaviu | Fork on releases to a maintenance branch, which goes directly to dot releases, and then is also merged occasionally into devel so the bug fixes end up there too. |
15:24:52 | dom96 | We have barely enough resources to make the bug fixes. |
15:25:12 | flaviu | That doesn't make sense. Bug fixes are priority #1. |
15:25:42 | dom96 | So we should fix 300 issues that are on github before working on any new features? |
15:25:50 | flaviu | Yes |
15:26:32 | dom96 | That would make any programmer go insane. |
15:27:07 | flaviu | yeah, it would |
15:27:34 | BlaXpirit | c2nim is not usable :| |
15:27:59 | flaviu | BlaXpirit: Can you please be a bit more descriptive? |
15:28:06 | BlaXpirit | left an "^" as is |
15:28:22 | BlaXpirit | arr[i++] got translated to arr[inc(i)] |
15:28:39 | dom96 | You can't expect it to translate C 100% correctly. |
15:28:52 | flaviu | dom96: Those are trivial |
15:28:54 | flaviu | yes you can |
15:28:58 | dom96 | It's certainly usable though. |
15:29:49 | dom96 | flaviu: No, you can't. |
15:29:58 | dom96 | c2nim has been designed for generating wrappers |
15:30:00 | * | kunev joined #nimrod |
15:30:26 | flaviu | `^` and `++` are definitely reasonable |
15:30:49 | dom96 | I never said they weren't. |
15:39:24 | BlaXpirit | uh something works, yay |
15:40:56 | BlaXpirit | printf("%10.8f " hmm |
15:42:32 | BlaXpirit | oh, I don't need a replacement, I can just use the real one |
15:42:43 | BlaXpirit | but still is interesting how to format numbers |
15:44:19 | BlaXpirit | yaaay, even output matches |
15:44:34 | BlaXpirit | so the core is done |
15:48:23 | flaviu | BlaXpirit: Fixed the `^` thing, but I can't be arsed to write out the ASTs for `++` right now |
15:48:47 | BlaXpirit | ok, thank you |
16:06:25 | * | nande joined #nimrod |
16:11:27 | * | untitaker quit (Ping timeout: 245 seconds) |
16:17:10 | * | untitaker joined #nimrod |
16:20:04 | Varriount | BlaXpirit: If only we could directly translate entire C programs to idiomatic nimrod... |
16:20:16 | Varriount | Ah well, wrappers will do for now. |
16:23:13 | BlaXpirit | proc blah(self: ref TObj) var obj: TObj obj.blah() |
16:23:19 | BlaXpirit | what am I doing wrong here? |
16:23:58 | EXetoC | the fact that you aren't passing in a reference |
16:25:16 | BlaXpirit | yes, but manually making it a reference is not what i want |
16:25:21 | BlaXpirit | and I don't know how to, anyway |
16:25:33 | BlaXpirit | proc blah(self: var TObj) var obj: TObj obj.blah() |
16:25:36 | BlaXpirit | changed to var^ |
16:25:44 | BlaXpirit | is this how OOP is supposed to be done? |
16:25:44 | EXetoC | so remove 'ref' or replace with 'var' |
16:26:48 | BlaXpirit | so var is what c++ calls reference and ref is what c++ calls pointer |
16:26:50 | BlaXpirit | nice |
16:27:52 | Varriount | Sorta |
16:27:56 | EXetoC | "Traced references are declared with the ref keyword, untraced references are declared with the ptr keyword." |
16:28:38 | EXetoC | "Var parameters can be modified by the procedure and the changes are visible to the caller. The argument passed to a var parameter has to be an l-value. Var parameters are implemented as hidden pointers" |
16:29:05 | BlaXpirit | ^this is exactly what a reference in c++ does |
16:29:18 | Varriount | BlaXpirit: Except for the hidden pointers part. |
16:29:35 | BlaXpirit | nah, references in c++ are also pointers under the hood |
16:30:02 | BlaXpirit | unless "hidden" means something different than "under the hood" here |
16:31:08 | EXetoC | nope |
16:37:27 | Jehan_ | var is (roughly) equivalent to a C++ reference and ptr is (largely) equivalent to a C++ pointer (except for pointer arithmethic). ref doesn't have a C++ equivalent, because C++ doesn't have garbage collection. |
16:38:38 | BlaXpirit | yeah |
16:39:30 | BlaXpirit | thx for clarifying |
16:39:58 | EXetoC | now shut up and code :-) |
16:40:14 | EXetoC | j/k. chill bro |
17:17:13 | BlaXpirit | damn, this is some hardcore stuff... http://hg.python.org/cpython/file/d9607a71456e/Python/random.c#l17 |
17:17:30 | BlaXpirit | winapi as usual |
17:19:12 | Varriount | BlaXpirit: How so? |
17:19:19 | BlaXpirit | huh? |
17:19:36 | BlaXpirit | i'm trying to write such code in nirod |
17:20:23 | BlaXpirit | and, for example, i don't know how to make a variable of type "HCRYPTPROV" |
17:20:53 | Varriount | BlaXpirit: I've wrapped CryptGenRandom before, lemme see if I can pull something up |
17:21:09 | BlaXpirit | oh really, Varriount? what did you make with it? |
17:21:27 | Varriount | BlaXpirit: Nothing. :/ |
17:21:48 | Varriount | BlaXpirit: I intended to add it to winlean.nim, but I deleted the branch. |
17:22:39 | BlaXpirit | did you see what I wrote before? i'm trying to make a random library for nimrod, and it sure would be nice to have https://docs.python.org/dev/library/os.html#os.urandom |
17:22:48 | BlaXpirit | it would be used for seeding instead of time...... |
17:23:36 | Varriount | BlaXpirit: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx |
17:23:47 | BlaXpirit | ...aand? |
17:23:51 | Varriount | \http://msdn.microsoft.com/en-us/library/windows/desktop/aa379886(v=vs.85).aspx |
17:24:33 | BlaXpirit | wait, Varriount, so you don't even have the wrapper code anymore? |
17:24:47 | BlaXpirit | these links are not very helpful |
17:25:11 | Varriount | BlaXpirit: Those links define the crypto api windows uses. |
17:25:29 | BlaXpirit | i saw the links.... |
17:25:39 | Varriount | If I had to guess, HCRYPTPROV is likely a typedef to a handle |
17:25:47 | BlaXpirit | what i need is how to use them in nimrod as opposed to c |
17:26:04 | Varriount | Ah, here we go |
17:26:05 | Varriount | http://msdn.microsoft.com/en-us/library/windows/desktop/aa382471(v=vs.85).aspx |
17:26:20 | BlaXpirit | sure, it's a typedef or a macro, but we don't want to "unwrap" these |
17:26:33 | Varriount | Hm? |
17:26:38 | BlaXpirit | well |
17:26:46 | BlaXpirit | i can write uint |
17:26:50 | BlaXpirit | but that's not right |
17:26:58 | BlaXpirit | no guarantee that it will not change |
17:27:14 | BlaXpirit | or culong, whatever |
17:28:11 | BlaXpirit | nah, uint would actually be better |
17:28:13 | BlaXpirit | http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#ULONG_PTR |
17:28:30 | BlaXpirit | it's not right to get to the root of the macros |
17:28:36 | BlaXpirit | isn't there a way to use the type directly? |
17:28:54 | Varriount | BlaXpirit: Have you looked at winlean.nim and Windows.nim? |
17:28:59 | BlaXpirit | no |
17:30:37 | BlaXpirit | ok, Windows.nim makes my browser lag |
17:30:48 | BlaXpirit | well this is disappointing |
17:30:50 | Varriount | Try winlean.nim |
17:31:04 | BlaXpirit | i thought C stuff could be used more directly |
17:31:14 | Varriount | BlaXpirit: It can. That doesn't always mean that it should. |
17:32:47 | BlaXpirit | not really sure still |
17:32:54 | BlaXpirit | is PULONG what i'm looking for? |
17:32:58 | Varriount | Yes. |
17:33:47 | BlaXpirit | [:20:51] <Varriount> BlaXpirit: I've wrapped CryptGenRandom before, lemme see if I can pull something up |
17:34:16 | Varriount | Yes...? |
17:34:43 | BlaXpirit | so can you pull up some code, Varriount? |
17:34:52 | BlaXpirit | you said you've wrapped it |
17:35:27 | Varriount | <BlaXpirit> oh really, Varriount? what did you make with it? |
17:35:27 | Varriount | <Varriount> BlaXpirit: Nothing. :/ |
17:35:27 | Varriount | <Varriount> BlaXpirit: I intended to add it to winlean.nim, but I deleted the branch |
17:35:47 | BlaXpirit | [:24:31] <BlaXpirit> wait, Varriount, so you don't even have the wrapper code anymore? |
17:37:21 | flaviu | BlaXpirit: https://github.com/flaviut/furry-happiness |
17:37:41 | flaviu | Just some segments of PRNG code if have any use for it |
17:38:11 | BlaXpirit | naah, i already have a good pseudo random generator |
17:38:44 | BlaXpirit | now i want access to OS not-pseudo-random stuff |
17:39:37 | flaviu | Ok, fair enough. Technically, the randomness from the OS is pseudo-random |
17:39:43 | flaviu | Linux uses AES IIRC |
17:39:51 | BlaXpirit | uuuh i don't think so |
17:40:40 | BlaXpirit | >access to environmental noise |
17:40:52 | flaviu | Sure, it mixes that into the AES seed |
17:41:04 | BlaXpirit | well, that makes it not pseudo random, doesnt it |
17:41:18 | * | kunev quit (Ping timeout: 272 seconds) |
17:41:25 | dom96 | For linux all you need to do is use file IO to read /dev/urandom |
17:41:58 | BlaXpirit | yes |
17:41:58 | Varriount | BlaXpirit: https://gist.github.com/Varriount/4edcfd1d17af30645d30 |
17:42:18 | BlaXpirit | thank you, Varriount |
17:42:26 | flaviu | Varriount: You discovered the wonders of the reflog? :D |
17:42:28 | BlaXpirit | but do you recommend to change int64 to PULONG? |
17:42:50 | Varriount | BlaXpirit: Doesn't matter, as long as the size is 64 bits |
17:43:09 | BlaXpirit | but it's definitely not guaranteed to be |
17:43:24 | BlaXpirit | it's 32 on 32bit systems |
17:43:39 | Varriount | Then no, don't change it to PULONG |
17:43:49 | Varriount | This is an excellent resource: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx |
17:44:10 | BlaXpirit | ok |
17:44:44 | BlaXpirit | http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#ULONG_PTR |
17:44:57 | BlaXpirit | it's supposed to be uint, not int64 |
17:45:47 | Varriount | Ok, I was wrong. :/ |
17:45:58 | Varriount | I thought a long was always 64 bits. |
17:46:01 | BlaXpirit | so should i use uint then or what? |
17:46:43 | BlaXpirit | the thing is, PULONG and ULONG_PTR are different things |
17:47:35 | * | kunev joined #nimrod |
17:47:37 | Varriount | A PULONG is a pointer, so it will be 32 bits on 32 bit systems, and 64 bits on 64 bit systems |
17:48:11 | BlaXpirit | basically ptr whatever will do?? |
17:48:20 | BlaXpirit | i don't get it |
17:48:39 | BlaXpirit | in your code it's int64 but PULONG is a ptr |
17:48:47 | BlaXpirit | so will it work still? |
17:48:53 | Varriount | Yes, I made a mistake |
17:49:13 | BlaXpirit | i mean, are numbers interchangable with pointers? |
17:49:34 | BlaXpirit | at least as far as C interfacing is concerned |
17:49:36 | Varriount | Yes. |
17:49:45 | BlaXpirit | ok. thank you. |
17:49:52 | Araq | what? |
17:49:56 | Varriount | BlaXpirit: The C interface only concerns itself with the *size* of data types |
17:50:04 | Araq | well they kind of are |
17:50:23 | BlaXpirit | then ptr whatever will do |
17:50:27 | BlaXpirit | which PULONG is |
17:59:09 | * | filwit quit (Ping timeout: 240 seconds) |
18:03:08 | Araq | dom96: should ETimeout become TimeoutError? |
18:03:17 | Araq | or something else? is that an error? |
18:03:41 | dom96 | I think so. I can't think what else it could be. |
18:03:47 | dom96 | It's raised so it's an error. |
18:05:21 | * | noam quit (Read error: Connection reset by peer) |
18:05:26 | Araq | ok |
18:07:38 | EXetoC | what do you mean? won't we get rid of the 'E' prefix? |
18:07:53 | Araq | we are getting rid of the E prefix |
18:08:00 | Araq | we get the Error suffix instead |
18:08:30 | EXetoC | I misread |
18:08:35 | BlaXpirit | feels really creepy to do these things like writing 1 instead of PROV_RSA_FULL |
18:09:17 | Araq | const PROV_RSA_FULL = 1 ? |
18:10:01 | BlaXpirit | a bit better |
18:10:03 | Araq | var PROV_RSA_FULL {.importc, header: "<windows.h>".} # future proof ? |
18:10:21 | BlaXpirit | it's a #define |
18:10:23 | BlaXpirit | will it work? |
18:10:29 | Araq | yes. but they cannot change these constants anyway |
18:10:36 | BlaXpirit | oh, that's great |
18:10:39 | Araq | since that breaks binary compatibility |
18:15:39 | dom96 | Araq: Do we have a test to check if the stdlib compiles in tainted mode? |
18:16:05 | Araq | dom96: yes, the tester uses large parts of the relevant modules and is compiled with --taintMode:on |
18:16:21 | Araq | well I guess that's not the best way to test it |
18:16:39 | dom96 | yeah. We should test all modules. |
18:16:45 | Araq | but it's much better than nothing |
18:16:51 | dom96 | I think that is something worth fixing before the next release. |
18:17:00 | Araq | sure thing |
18:17:01 | dom96 | Gotta go. Bbl. |
18:17:28 | * | willwillson joined #nimrod |
18:23:43 | * | brson joined #nimrod |
18:23:50 | * | brson quit (Client Quit) |
18:27:55 | BlaXpirit | awwww, Varriount could not import: CryptAcquireContext | Error: execution of an external program failed |
18:29:31 | BlaXpirit | (oh, and yes, i'm trying this on Windows) |
18:33:59 | Araq | BlaXpirit: do you have the DLL? |
18:34:16 | BlaXpirit | Araq, uhh it's a Windows DLL |
18:35:33 | BlaXpirit | C:\Windows\SysWOW64\advapi32.dll |
18:36:00 | BlaXpirit | the code is basically this https://gist.github.com/Varriount/4edcfd1d17af30645d30 |
18:37:31 | BlaXpirit | oh and it's in C:\windows\system32 as well |
18:37:42 | * | gkoller joined #nimrod |
18:37:47 | BlaXpirit | so it's in PATH for sure |
18:39:13 | BlaXpirit | aha, so when I mess up the dll name, it says couldn't load library |
18:39:21 | BlaXpirit | so it's something wrong with the specification |
18:39:35 | BlaXpirit | or definition rather |
18:40:22 | * | Matthias247 joined #nimrod |
18:45:31 | Araq | BlaXpirit: most likely the calling convention then |
18:45:32 | Araq | which affects name mangling |
18:48:07 | BlaXpirit | i tried a few... |
18:56:23 | * | kunev quit (Ping timeout: 240 seconds) |
18:58:27 | Araq | maybe it's a 32 vs 64 bit issue? |
19:10:32 | BlaXpirit | how do I know |
19:10:42 | BlaXpirit | i made stuff as exactly as I could |
19:12:13 | BlaXpirit | besides, it's Varriount's code, it was supposed to work |
19:12:24 | BlaXpirit | and i tweaked in different ways too |
19:20:26 | * | filwit joined #nimrod |
19:32:44 | * | Ven joined #nimrod |
19:33:49 | * | nande quit (Read error: Connection reset by peer) |
19:42:13 | BlaXpirit | oh CryptGenRandom works tho |
19:42:24 | BlaXpirit | compiles, that is |
19:45:17 | Varriount | Hm? |
19:45:47 | Varriount | BlaXpirit: Ping |
19:45:56 | BlaXpirit | ping |
19:45:57 | BlaXpirit | what |
19:46:15 | Varriount | BlaXpirit: I made a mistake on the import name of CryptAcquireContext |
19:46:17 | BlaXpirit | if i remove CryptAcquireContext, it runs fine |
19:46:22 | * | wlhlm joined #nimrod |
19:46:35 | * | wlhlm left #nimrod ("Bye! ♥") |
19:46:40 | BlaXpirit | Varriount, ? |
19:47:58 | Varriount | BlaXpirit: The windows api has two versions of every function, a wide character version, and an ansi verison |
19:48:01 | Varriount | *version |
19:48:08 | Varriount | Gimme a second, I'm fixing the gist |
19:48:27 | BlaXpirit | thank you |
19:48:46 | BlaXpirit | but i even used LPCTSTR |
19:49:00 | BlaXpirit | do u mean it should be like some suffix to the actual name? |
19:49:46 | Varriount | BlaXpirit: Look at the Gist |
19:49:54 | Varriount | I just fixed it. I think |
19:50:48 | Varriount | On Windows, API procedures that take strings come in variants that accept 8-bit character strings, and 16-bit (I think) character strings |
19:51:01 | BlaXpirit | compiles. great |
19:51:04 | BlaXpirit | thx, Varriount |
19:51:10 | BlaXpirit | i'm away for now |
20:00:21 | BlaXpirit | i mean runs, not just compiles |
20:22:44 | * | flaviu quit (Remote host closed the connection) |
20:29:38 | * | Sht0 joined #nimrod |
20:35:12 | Araq | good night |
20:37:05 | * | brson joined #nimrod |
20:38:52 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
20:41:58 | * | io2 joined #nimrod |
20:43:55 | * | Ven quit (Read error: Connection reset by peer) |
20:44:26 | * | Ven joined #nimrod |
20:59:51 | * | BlameStross joined #nimrod |
21:02:11 | * | Jehan_ quit (Quit: Leaving) |
21:03:21 | dom96 | hi |
21:11:32 | * | gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:12:01 | BlaXpirit | i just don't know how to let a C function write something to a string |
21:12:08 | BlaXpirit | give it to pointer - but to what |
21:12:26 | BlaXpirit | arrays aren't just pointers to memory, casting doesn't really make sense |
21:12:42 | BlaXpirit | so i tried to find all the functions that belong to some array/sequence types |
21:13:01 | BlaXpirit | and even this seemingly simple thing is impossible with the current documentation |
21:13:09 | EXetoC | array.addr? |
21:13:16 | BlaXpirit | oh good, you know that |
21:13:21 | BlaXpirit | but how am i supposed to know it? |
21:13:34 | BlaXpirit | i looked through manual, tutorial, index |
21:13:36 | BlaXpirit | but didn't find |
21:13:53 | BlaXpirit | there simply is no thing "you can do this and that with arrays" |
21:14:17 | BlaXpirit | only a giant list of all functions, including freakin libraries like SDL |
21:14:46 | EXetoC | http://nimrod-lang.org/manual.html#the-addr-operator |
21:14:57 | EXetoC | well it's not a function so it wouldn't be located in the library reference |
21:15:24 | BlaXpirit | no, i've definitely used addr before |
21:15:33 | BlaXpirit | but arrays and strings save length information with them |
21:15:36 | BlaXpirit | so what about that? |
21:15:47 | BlaXpirit | what is an address to one supposed to mean |
21:15:51 | BlaXpirit | if it's a structure |
21:15:54 | EXetoC | it's not part of the array structure |
21:16:12 | BlaXpirit | ok, but i don't want a dynamic size array |
21:16:15 | EXetoC | it is contained in strings and sequences though |
21:17:03 | EXetoC | array being a statically sized array, and sequence being a dynamically sized structure (length + pointer) |
21:17:09 | BlaXpirit | i want to call a function that writes something to CString and return bytes from my function (thought seq[uchar] would be appropriate) |
21:17:33 | BlaXpirit | statically sized array is not an option for me |
21:17:34 | EXetoC | length/capacity/pointer? something like that |
21:17:41 | BlaXpirit | so what am i supposed to give to the function? |
21:17:57 | EXetoC | ok so sequence[0].addr? or str[0].addr? I think |
21:18:09 | BlaXpirit | well this is interesting |
21:18:21 | BlaXpirit | yeah, really promising. thanks |
21:19:32 | EXetoC | there's a nimrod-by-example website, but I don't think it covers taking the address yet |
21:19:32 | * | Trustable quit (Remote host closed the connection) |
21:19:46 | EXetoC | http://nimrod-by-example.github.io |
21:20:21 | BlaXpirit | seen that |
21:20:26 | BlaXpirit | whole |
21:20:32 | EXetoC | ok |
21:21:58 | BlaXpirit | and google never finds anything :| |
21:23:49 | * | Varriount is baaack |
21:23:56 | BlaXpirit | ok now I want INT_MAX |
21:24:03 | BlaXpirit | am I really gonna have to ask everything that I need here? |
21:24:05 | Varriount | high(int) |
21:24:13 | BlaXpirit | I keep trying and trying to search |
21:24:15 | BlaXpirit | but I just can't |
21:24:34 | BlaXpirit | thank you, Varriount |
21:24:37 | Varriount | BlaXpirit: Unfortunately, the Nimrod community is small. It's one of those vicious cycle things |
21:24:56 | Varriount | We're small because people don't want to join small communities |
21:25:00 | BlaXpirit | but it's not an excuse for documentation being unhelpful |
21:25:26 | BlaXpirit | like seriously, all i want is, for example, an index sorted by first function argument |
21:25:37 | Varriount | BlaXpirit: If you can think of a better way for documentation to be organized, by all means, suggest away. |
21:25:43 | BlaXpirit | just said one |
21:26:04 | Varriount | BlaXpirit: filwit is working on improving the look & feel of the documentation site. I don't know if he's doing search. |
21:26:12 | Varriount | BlaXpirit: What about generics? |
21:26:32 | BlaXpirit | well just another section for generics |
21:26:49 | Varriount | http://nimrod-lang.org/system.html#high,T |
21:26:51 | EXetoC | I often look through the reference of the system module http://nimrod-lang.org/system.html |
21:26:55 | EXetoC | right |
21:27:32 | BlaXpirit | i even skimmed through that system module |
21:27:47 | BlaXpirit | but skipped some stuff and forgot the rest |
21:27:51 | BlaXpirit | it's just too big |
21:31:32 | BlaXpirit | omg finally i was able to get a result from CryptGenRandom |
21:31:39 | Varriount | Araq: ^ Another reason we should split the system module into implicit sub-modules |
21:33:39 | BlaXpirit | beats me why the exception tree is in tutorial and not in manual |
21:33:59 | BlaXpirit | tutorial parts and manual are really just a 3-part tutorial |
21:34:08 | BlaXpirit | and never know where you may find this or that thing |
21:34:15 | BlaXpirit | the fact that you don't know HOW to find it doesn't help |
21:37:11 | Varriount | BlaXpirit: Can we see your code so far? |
21:37:48 | BlaXpirit | how should i even post it |
21:37:56 | Varriount | gist.github.com |
21:43:08 | BlaXpirit | https://gist.github.com/BlaXpirit/fa0fd3a025ecac03cf57 |
21:46:51 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:52:04 | BlaXpirit | hmm should I maybe use uint instead of int |
21:52:20 | BlaXpirit | for number of bytes |
21:52:55 | BlaXpirit | i'm aware of this avoidance of unsigned, but is it beneficial here? or just write >=0 check? :| |
21:53:46 | EXetoC | Natural* = range[0..high(int)] ? |
21:54:40 | BlaXpirit | uhh natural is 1.. |
21:54:42 | BlaXpirit | isnt it |
21:55:20 | BlaXpirit | no |
21:55:22 | BlaXpirit | but |
21:55:28 | EXetoC | Positive* = range[1..high(int)] |
21:55:42 | BlaXpirit | gah |
21:55:43 | dom96 | BlaXpirit: What's the problem? |
21:55:51 | BlaXpirit | no problem |
21:56:10 | BlaXpirit | i don't want negative numbers in my function argument |
21:56:28 | BlaXpirit | and i was asking what's best - uint, int, or (just suggested to me) Natural |
21:57:03 | BlaXpirit | and this Natural thing seems immediately... unnatural to me, because i was always taught that natural numbers start from 1 |
21:57:23 | BlaXpirit | wikipedia says it can be both |
21:57:45 | dom96 | indeed. |
21:57:59 | dom96 | Makes sense since we have a Positive range too. |
22:29:33 | * | reactormonk quit (Ping timeout: 240 seconds) |
22:37:08 | * | reactormonk joined #nimrod |
22:48:24 | * | brson_ joined #nimrod |
22:49:11 | * | brson_ quit (Client Quit) |
22:49:26 | * | brson_ joined #nimrod |
22:51:50 | * | brson quit (Ping timeout: 260 seconds) |
22:55:02 | * | Sht0 quit (Ping timeout: 250 seconds) |
23:07:50 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
23:11:17 | * | BlaXpirit quit (Ping timeout: 260 seconds) |
23:17:35 | * | ome quit (Quit: Connection closed for inactivity) |
23:21:57 | * | filwit quit (Ping timeout: 240 seconds) |
23:26:41 | * | EXetoC quit (Remote host closed the connection) |
23:29:30 | * | darkf joined #nimrod |
23:35:10 | * | cryzed joined #nimrod |
23:35:57 | dom96 | hello cryzed, welcome |
23:36:05 | cryzed | hello dom96! |
23:36:41 | cryzed | Just curious how this will evolve, I can't say I'm a huge programming language theorist but I saw a discussion on reddit and decided to idle for a bit |
23:37:25 | dom96 | awesome. |
23:38:13 | dom96 | The more people here the better, maybe some discussions will interest you in the future enough to join in :) |
23:38:28 | cryzed | Yes :) |
23:51:07 | * | filwit joined #nimrod |
23:56:15 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |