<< 24-08-2014 >>

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:39flaviuI 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:11whfkvfszjibsaybxIs 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:13Araqhi BlaXpirit welcome
08:12:24BlaXpirithello, Araq
08:12:49BlaXpiriti'm dabbling in all those new fancy languages
08:12:59BlaXpiritmy 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:05Varriount|MobileAraq: Just found a blog post about a bug in Rust's substring matching procedure, partially caused by *unsigned integers *
08:22:09Varriount|Mobilehttp://www.wabbo.org/blog/2014/22aug_on_bananas.html
08:24:17Varriount|MobileAlthough, it's more of a wrapping error.
08:27:25*bogen quit (Ping timeout: 260 seconds)
08:46:56AraqVarriount|Mobile: well that's not news to me ;-)
08:53:37Varriount|MobileAraq: 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:59Araqyes they do make sense, but you shouldn't embrace them. Or perhaps learn to never use the - operator when you do
09:01:37Varriount|MobileHm. Most of Nimrod's string operations would fail for strings whose size exceeds 1.18 Gigabytes (on 32 bit machines)
09:04:01Araqreally? shouldn't that be 2 GB?
09:04:25Varriount|MobileAlthough on 64 bit machines, strings would have to be larger than 73.79 Exabytes
09:05:17*filwit joined #nimrod
09:05:36Araqhi filwit
09:05:41filwithey Araq
09:05:52Araqbtw there is a pretty lively discussion on reddit about D vs nimrod
09:06:11filwitjust responded to the guy you where talking too there
09:06:22Araqdon't misinterpret this as begging for upvotes :P
09:06:23Varriount|MobileAraq: Wait, my math might be off
09:06:33Varriount|MobileAlso, link please
09:06:47Araqhttp://www.reddit.com/r/programming/comments/2ed9ah/some_notes_on_d_for_the_win/
09:06:52filwitAraq: nah, i only upvote people i agree with.. and I did that to your posts cause I agreed with them
09:07:03AraqI gotta go, see you later
09:09:50Varriount|MobileOk, assuming each character in a string is 8 bits... Maximum size is 2.147 Gigabytes
09:10:30Varriount|MobileFor 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:42Varriount|MobileFor platforms where Nimrod's int is 64 bits, the maximum size is... 9.223 Exabytes
09:12:34filwitVarriount|Mobile: don't worry, by 2016 that will probably be the standard amount of memory sold in laptops...
09:13:27Varriount|MobileSo unless you're doing string processing on 32 bit processors/Nimrod programs compiled for 32 bit processors, you shouldn't worry
09:16:06Varriount|MobileSomething 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:02Varriount|Mobilefilwit: What's your take on unsigned numbers?
09:25:54filwitVarriount|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:26filwitbrb
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:37BlaXpiritreading the manual. I don't understand mixin/bind at all
11:31:54filwitBlaXpirit: 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:39BlaXpirituhhhhh
11:33:24filwitsorry, that didn't explain things well at all...
11:36:09AraqBlaXpirit: the language tries hard to implement "intuitive" symbol binding rules, so most often you neither need 'bind' nor 'mixin'
11:37:11Araqhowever, 'bind' enforces "lookup this symbol in the definition scope of the generic"
11:37:35Araqwhereas 'mixin' does the opposite: "lookup this symbol in the instantiation scope of the generic"
11:38:45BlaXpiritok, thank you. maybe i understand now
11:39:14filwithmm... 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:58BlaXpiritreally confusing names for these
11:40:05BlaXpiritmixin is a completely different concept...
11:40:56Araqfilwit: 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:16filwitAraq: okay, thanks
11:41:34AraqBlaXpirit: a fair point, but I couldn't think of a better name. I'm all ears if you have a good suggestion.
11:41:50BlaXpiritso wait... I can make a function that refers to an unexisting variable
11:42:04BlaXpiritand it will magically refer to whatever variable is in the scope where the function is used?
11:42:28Araqa *generic* function, yes
11:43:13Araqactually the variable has to be a toplevel variable but unfortunately the compiler doesn't check this properly
11:43:35BlaXpiritreeeally weird stuff
11:44:02BlaXpiritand this comes from someone who went through 3/4 of the manual xD
11:44:48Araqnot really that weird. it's the way generics can invoke unkown 'hash' and '==' procs
11:44:56Araq*unknown
11:45:22Araqit should be obvious why that is required
11:45:52*jasondotstar joined #nimrod
11:46:32Araqhi jasondotstar welcome
11:46:57BlaXpiritOK, so this seems to be conflicting information
11:46:58jasondotstarAraq: thx
11:47:20BlaXpirittutorial says "The template body does not open a new scope"
11:47:31BlaXpiritand then manual says they are hygienic
11:48:53Araqok thanks for pointing it out, I'll fix the tutorial
11:49:30BlaXpirithaving to add a block made more sense to me... cleanear
11:49:33BlaXpiritcleaner*
11:49:52Araqa block doesn't result in hygiene though
11:49:58Araqhence 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:48dom96hello
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:31Araqhi dom96
12:04:42dom96hi 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:22BlaXpiritOK, 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:33dom96BlaXpirit: babel install sfml
12:20:37dom96BlaXpirit: import sfml
12:20:43BlaXpirit"babel"?
12:20:50BlaXpiritbut but that's
12:20:54BlaXpirita different thing
12:21:16dom96that's nimrod's package manager
12:21:26BlaXpirit"Open Babel converts chemical structures from one file format to another"
12:21:26dom96it will download and install that package for you
12:21:32dom96actually 'import csfml'
12:21:37dom96https://github.com/nimrod-code/babel
12:22:16BlaXpiritbut srsly, there is already an executable called "babel"
12:23:06BlaXpiritat least it doesn't insist on global install with sudo and stuff
12:23:28dom96are you using this other babel?
12:23:31BlaXpiritno
12:23:41BlaXpiritjust very unfortunate naming
12:23:51dom96Yeah, maybe I will rename it.
12:24:00dom96But for now you can just remove that other package
12:24:10BlaXpiriti don't think i can
12:25:35dom96ok, then rename the nimrod babel to babelpkg or something
12:25:50BlaXpiriti don't need to
12:26:10BlaXpirit~/.babel/bin/babel looks good enough :|
12:27:11filwiti always just add ~/.local/bin to my path, then setup my own aliases to things.. and i can babel 'nim-babel'
12:27:25filwitcall*
12:27:28BlaXpiriti have this too
12:28:18BlaXpirityay, it works
12:28:21BlaXpiritthank 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:20BlaXpiritso i was afraid there was gonna be some flaw that would prevent me from using Nimrod
13:08:40BlaXpiritstandard library and documentation................................
13:09:08filwit... are being worked on. We know.
13:09:51BlaXpiritthere is only 1 function for randomization, and it is in math module, and it doesn't work properly on Window
13:09:53BlaXpirits
13:11:07BlaXpirit no, it doesn't work at all!
13:11:13BlaXpirit(on Windows)
13:12:30BlaXpiritah, I finally understand
13:12:41BlaXpiritso on Windows only the float version doesn't work
13:12:59BlaXpiritbut seriously...
13:15:03dom96BlaXpirit: works for me. You need to call randomize at least once.
13:15:23BlaXpiritwhat about when not defined(windows):
13:15:34BlaXpiritand an according warning in documentation
13:16:25filwitBlaXpirit: try `randomize(); let x = random(10); echo x` and you should get a random number..
13:16:42BlaXpiritbut I can't try because I'm not on Windows
13:16:57BlaXpiritalso, it's supposed to be random(10.0)
13:17:01BlaXpiritfor it to not work
13:18:37BlaXpiritwhy not just use this http://stackoverflow.com/a/686373
13:18:46filwityeah wait... why isn't the float version of random supported on Windows?
13:18:53filwitthat's odd..
13:19:05BlaXpiritbecause it uses linux standard library
13:19:31BlaXpiritall the randomization C itself has is random integer from 0 to RAND_MAX (constant)
13:20:20BlaXpiritwhich 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:21dom96https://github.com/Araq/Nimrod/blob/2525215610c55f97aded12658b5318eea752975f/lib/pure/math.nim#L210
13:20:27dom96I tested it, and it works.
13:20:56BlaXpiritoh so there is the fallback
13:21:04BlaXpiritand the different behavior on different systems like i said
13:21:12BlaXpiritwhatever...
13:21:22BlaXpiritbut still, documentation says it's not supported on windows
13:21:57filwityes that might be wrong, or might only be in the stable docs, one sec
13:22:00dom96Where in the documentation does it say that?
13:22:04BlaXpiriton main site
13:22:05BlaXpiritand 32767.... wow, no, that's actually not good enough
13:22:30dom96http://build.nimrod-lang.org/docs/math.html#random,float
13:22:32BlaXpiritnimrod-lang.org/math.html#random,float
13:22:34BlaXpiritoh
13:22:46BlaXpiritokaaay
13:24:11filwitit'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:06filwitBlaXpirit: 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:31BlaXpiritoh also...
13:29:49BlaXpiriti'm pretty sure the Windows version does not conform to what documentation says
13:29:59BlaXpirit0..<max
13:30:06BlaXpiritbut windows version actually has 0..<=max
13:38:09BlaXpiritblah... 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:58BlaXpiritgaaah
13:48:08BlaXpiritrandom(int) implementation is also horrible
13:48:30BlaXpiritsrsly, it's not even uniform
13:48:32BlaXpiritand
13:49:07BlaXpiritif u want a random number from 0 to a billion, u will actually get a random number from 0 to 32767
13:49:25BlaXpiritand if u want a random number from 0 to 32768, 0 will be twice as likely as all the rest
13:49:26BlaXpiritetc
13:49:43*Ven joined #nimrod
13:50:21BlaXpiriti mean 32766
13:52:24BlaXpiritat least on linux RAND_MAX is sensible, 2147483647, so what I said above will only happen on windows
13:57:08BlaXpiritmay be a good idea to just rewrite some implementation to nimrod...
13:57:20BlaXpiritand get a decent random module
13:57:33BlaXpiritand then export just 2 functions to math for compatibility
13:57:48BlaXpiritseems like a good idea to me to copy Python's random library
13:58:02BlaXpiritbut not sure how the licenses would work out
13:58:17BlaXpiritwouldn't copypaste any code directly, but still..
13:58:46BlaXpiritand Python uses CryptGenRandom on Windows
14:00:05BlaXpiritah, only for seeding and an alternative implementation
14:07:47BlaXpiritbut at the core is this http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
14:09:57dom96There is already an issue for this: https://github.com/Araq/Nimrod/issues/1044
14:10:01*flaviu joined #nimrod
14:10:10BlaXpiritthat's the least of the problems
14:10:30dom96BlaXpirit: Please consider improving the code!
14:10:55BlaXpiritwell, as i said, rewriting python's library (including its C mersenne twister core) is what seems best to me
14:11:00BlaXpiritand i might even do that
14:11:04BlaXpiritbut what about licenses?
14:11:35dom96You will just be copying the algorithm not the code I think.
14:11:38dom96So it's fine.
14:11:59EXetoCisn't the license very liberal?
14:12:31BlaXpiritit's even 2 different licenses
14:13:22*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:13:31dom96You could always translate this pseudo code instead: https://en.wikipedia.org/wiki/Mersenne_twister#Pseudocode
14:13:51EXetoCbut yeah, copying an algorithm is completely different
14:13:55BlaXpiritit's much less code than in the link i sent
14:14:13BlaXpiritthat one contains everything ready, no thinking required
14:15:00EXetoCthere's a SIMD-oriented MT generator apparently
14:15:21BlaXpiritbut that's also a ton of code
14:15:34BlaXpiriti'm just orienting on what Python uses and what everyone is happy with
14:15:52dom96I would keep it simple if I were you. The less code the better.
14:21:58BlaXpiritor is it reasonable to just include that C file into Nimrod?
14:25:43BlaXpiritoh, c2nim seems to work too
14:25:48BlaXpiritI just don't know what's best
14:26:28dom96Native nimrod implementations are preferable.
14:27:17BlaXpiritsee, Python uses this C library that linked to, but it's just the core
14:27:33BlaXpiritand i'm not gonna copy python's code at all
14:27:42BlaXpiritthis C library, however, is crucial
14:27:46EXetoCyeah for speed reasons I'd imagine
14:35:26dom96EXetoC: Please improve mongo so that it's ready for the next release.
14:36:23EXetoCI'll try. Just tell me if you think that there will be a release
14:36:30EXetoCoops
14:36:43EXetoC... before that of the ETA on github
14:39:03dom96Hard to say. We usually miss these deadlines though...
14:39:38EXetoCyeah. the motivation is coming back so it shouldn't be an issue either way
14:39:45dom96good
14:40:55*BlaXpirit quit (Quit: Quit Konversation)
14:41:21*Jehan_ joined #nimrod
14:43:27*BlaXpirit joined #nimrod
14:49:13BlaXpirituh what??
14:49:28EXetoC?
14:49:57BlaXpiritc2nim `mt[mti-1]` becomes `mt[mti + 1]`
14:50:08BlaXpiritreally
14:51:08dom96Are you using latest c2nim?
14:51:15dom96This may have been fixed in this commit: https://github.com/nimrod-code/c2nim/commit/8ce638ae466af02fb349955b40a514677da8532a
14:52:02BlaXpirit0.9.5
14:52:28BlaXpiritbut seriously, if after such a horrible problem you don't make a new release... this is disturbing
14:53:34EXetoCthere are a gazillion different issues though
14:53:49dom96yes, and how do you decide which deserve a new release and which don't?
14:54:11dom96another problem is that releases take a long time.
14:55:56EXetoCand 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:59dom96Araq: 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:25flaviudom96: Put out a dot release every so often for bugfixes?
15:24:14flaviuFork 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:52dom96We have barely enough resources to make the bug fixes.
15:25:12flaviuThat doesn't make sense. Bug fixes are priority #1.
15:25:42dom96So we should fix 300 issues that are on github before working on any new features?
15:25:50flaviuYes
15:26:32dom96That would make any programmer go insane.
15:27:07flaviuyeah, it would
15:27:34BlaXpiritc2nim is not usable :|
15:27:59flaviuBlaXpirit: Can you please be a bit more descriptive?
15:28:06BlaXpiritleft an "^" as is
15:28:22BlaXpiritarr[i++] got translated to arr[inc(i)]
15:28:39dom96You can't expect it to translate C 100% correctly.
15:28:52flaviudom96: Those are trivial
15:28:54flaviuyes you can
15:28:58dom96It's certainly usable though.
15:29:49dom96flaviu: No, you can't.
15:29:58dom96c2nim has been designed for generating wrappers
15:30:00*kunev joined #nimrod
15:30:26flaviu`^` and `++` are definitely reasonable
15:30:49dom96I never said they weren't.
15:39:24BlaXpirituh something works, yay
15:40:56BlaXpiritprintf("%10.8f " hmm
15:42:32BlaXpiritoh, I don't need a replacement, I can just use the real one
15:42:43BlaXpiritbut still is interesting how to format numbers
15:44:19BlaXpirityaaay, even output matches
15:44:34BlaXpiritso the core is done
15:48:23flaviuBlaXpirit: Fixed the `^` thing, but I can't be arsed to write out the ASTs for `++` right now
15:48:47BlaXpiritok, 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:04VarriountBlaXpirit: If only we could directly translate entire C programs to idiomatic nimrod...
16:20:16VarriountAh well, wrappers will do for now.
16:23:13BlaXpiritproc blah(self: ref TObj) var obj: TObj obj.blah()
16:23:19BlaXpiritwhat am I doing wrong here?
16:23:58EXetoCthe fact that you aren't passing in a reference
16:25:16BlaXpirityes, but manually making it a reference is not what i want
16:25:21BlaXpiritand I don't know how to, anyway
16:25:33BlaXpiritproc blah(self: var TObj) var obj: TObj obj.blah()
16:25:36BlaXpiritchanged to var^
16:25:44BlaXpiritis this how OOP is supposed to be done?
16:25:44EXetoCso remove 'ref' or replace with 'var'
16:26:48BlaXpiritso var is what c++ calls reference and ref is what c++ calls pointer
16:26:50BlaXpiritnice
16:27:52VarriountSorta
16:27:56EXetoC"Traced references are declared with the ref keyword, untraced references are declared with the ptr keyword."
16:28:38EXetoC"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:05BlaXpirit^this is exactly what a reference in c++ does
16:29:18VarriountBlaXpirit: Except for the hidden pointers part.
16:29:35BlaXpiritnah, references in c++ are also pointers under the hood
16:30:02BlaXpiritunless "hidden" means something different than "under the hood" here
16:31:08EXetoCnope
16:37:27Jehan_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:38BlaXpirityeah
16:39:30BlaXpiritthx for clarifying
16:39:58EXetoCnow shut up and code :-)
16:40:14EXetoCj/k. chill bro
17:17:13BlaXpiritdamn, this is some hardcore stuff... http://hg.python.org/cpython/file/d9607a71456e/Python/random.c#l17
17:17:30BlaXpiritwinapi as usual
17:19:12VarriountBlaXpirit: How so?
17:19:19BlaXpirithuh?
17:19:36BlaXpiriti'm trying to write such code in nirod
17:20:23BlaXpiritand, for example, i don't know how to make a variable of type "HCRYPTPROV"
17:20:53VarriountBlaXpirit: I've wrapped CryptGenRandom before, lemme see if I can pull something up
17:21:09BlaXpiritoh really, Varriount? what did you make with it?
17:21:27VarriountBlaXpirit: Nothing. :/
17:21:48VarriountBlaXpirit: I intended to add it to winlean.nim, but I deleted the branch.
17:22:39BlaXpiritdid 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:48BlaXpiritit would be used for seeding instead of time......
17:23:36VarriountBlaXpirit: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379942(v=vs.85).aspx
17:23:47BlaXpirit...aand?
17:23:51Varriount\http://msdn.microsoft.com/en-us/library/windows/desktop/aa379886(v=vs.85).aspx
17:24:33BlaXpiritwait, Varriount, so you don't even have the wrapper code anymore?
17:24:47BlaXpiritthese links are not very helpful
17:25:11VarriountBlaXpirit: Those links define the crypto api windows uses.
17:25:29BlaXpiriti saw the links....
17:25:39VarriountIf I had to guess, HCRYPTPROV is likely a typedef to a handle
17:25:47BlaXpiritwhat i need is how to use them in nimrod as opposed to c
17:26:04VarriountAh, here we go
17:26:05Varriounthttp://msdn.microsoft.com/en-us/library/windows/desktop/aa382471(v=vs.85).aspx
17:26:20BlaXpiritsure, it's a typedef or a macro, but we don't want to "unwrap" these
17:26:33VarriountHm?
17:26:38BlaXpiritwell
17:26:46BlaXpiriti can write uint
17:26:50BlaXpiritbut that's not right
17:26:58BlaXpiritno guarantee that it will not change
17:27:14BlaXpiritor culong, whatever
17:28:11BlaXpiritnah, uint would actually be better
17:28:13BlaXpirithttp://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#ULONG_PTR
17:28:30BlaXpiritit's not right to get to the root of the macros
17:28:36BlaXpiritisn't there a way to use the type directly?
17:28:54VarriountBlaXpirit: Have you looked at winlean.nim and Windows.nim?
17:28:59BlaXpiritno
17:30:37BlaXpiritok, Windows.nim makes my browser lag
17:30:48BlaXpiritwell this is disappointing
17:30:50VarriountTry winlean.nim
17:31:04BlaXpiriti thought C stuff could be used more directly
17:31:14VarriountBlaXpirit: It can. That doesn't always mean that it should.
17:32:47BlaXpiritnot really sure still
17:32:54BlaXpiritis PULONG what i'm looking for?
17:32:58VarriountYes.
17:33:47BlaXpirit[:20:51] <Varriount> BlaXpirit: I've wrapped CryptGenRandom before, lemme see if I can pull something up
17:34:16VarriountYes...?
17:34:43BlaXpiritso can you pull up some code, Varriount?
17:34:52BlaXpirityou said you've wrapped it
17:35:27Varriount<BlaXpirit> oh really, Varriount? what did you make with it?
17:35:27Varriount<Varriount> BlaXpirit: Nothing. :/
17:35:27Varriount<Varriount> BlaXpirit: I intended to add it to winlean.nim, but I deleted the branch
17:35:47BlaXpirit[:24:31] <BlaXpirit> wait, Varriount, so you don't even have the wrapper code anymore?
17:37:21flaviuBlaXpirit: https://github.com/flaviut/furry-happiness
17:37:41flaviuJust some segments of PRNG code if have any use for it
17:38:11BlaXpiritnaah, i already have a good pseudo random generator
17:38:44BlaXpiritnow i want access to OS not-pseudo-random stuff
17:39:37flaviuOk, fair enough. Technically, the randomness from the OS is pseudo-random
17:39:43flaviuLinux uses AES IIRC
17:39:51BlaXpirituuuh i don't think so
17:40:40BlaXpirit>access to environmental noise
17:40:52flaviuSure, it mixes that into the AES seed
17:41:04BlaXpiritwell, that makes it not pseudo random, doesnt it
17:41:18*kunev quit (Ping timeout: 272 seconds)
17:41:25dom96For linux all you need to do is use file IO to read /dev/urandom
17:41:58BlaXpirityes
17:41:58VarriountBlaXpirit: https://gist.github.com/Varriount/4edcfd1d17af30645d30
17:42:18BlaXpiritthank you, Varriount
17:42:26flaviuVarriount: You discovered the wonders of the reflog? :D
17:42:28BlaXpiritbut do you recommend to change int64 to PULONG?
17:42:50VarriountBlaXpirit: Doesn't matter, as long as the size is 64 bits
17:43:09BlaXpiritbut it's definitely not guaranteed to be
17:43:24BlaXpiritit's 32 on 32bit systems
17:43:39VarriountThen no, don't change it to PULONG
17:43:49VarriountThis is an excellent resource: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
17:44:10BlaXpiritok
17:44:44BlaXpirithttp://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx#ULONG_PTR
17:44:57BlaXpiritit's supposed to be uint, not int64
17:45:47VarriountOk, I was wrong. :/
17:45:58VarriountI thought a long was always 64 bits.
17:46:01BlaXpiritso should i use uint then or what?
17:46:43BlaXpiritthe thing is, PULONG and ULONG_PTR are different things
17:47:35*kunev joined #nimrod
17:47:37VarriountA PULONG is a pointer, so it will be 32 bits on 32 bit systems, and 64 bits on 64 bit systems
17:48:11BlaXpiritbasically ptr whatever will do??
17:48:20BlaXpiriti don't get it
17:48:39BlaXpiritin your code it's int64 but PULONG is a ptr
17:48:47BlaXpiritso will it work still?
17:48:53VarriountYes, I made a mistake
17:49:13BlaXpiriti mean, are numbers interchangable with pointers?
17:49:34BlaXpiritat least as far as C interfacing is concerned
17:49:36VarriountYes.
17:49:45BlaXpiritok. thank you.
17:49:52Araqwhat?
17:49:56VarriountBlaXpirit: The C interface only concerns itself with the *size* of data types
17:50:04Araqwell they kind of are
17:50:23BlaXpiritthen ptr whatever will do
17:50:27BlaXpiritwhich PULONG is
17:59:09*filwit quit (Ping timeout: 240 seconds)
18:03:08Araqdom96: should ETimeout become TimeoutError?
18:03:17Araqor something else? is that an error?
18:03:41dom96I think so. I can't think what else it could be.
18:03:47dom96It's raised so it's an error.
18:05:21*noam quit (Read error: Connection reset by peer)
18:05:26Araqok
18:07:38EXetoCwhat do you mean? won't we get rid of the 'E' prefix?
18:07:53Araqwe are getting rid of the E prefix
18:08:00Araqwe get the Error suffix instead
18:08:30EXetoCI misread
18:08:35BlaXpiritfeels really creepy to do these things like writing 1 instead of PROV_RSA_FULL
18:09:17Araqconst PROV_RSA_FULL = 1 ?
18:10:01BlaXpirita bit better
18:10:03Araqvar PROV_RSA_FULL {.importc, header: "<windows.h>".} # future proof ?
18:10:21BlaXpiritit's a #define
18:10:23BlaXpiritwill it work?
18:10:29Araqyes. but they cannot change these constants anyway
18:10:36BlaXpiritoh, that's great
18:10:39Araqsince that breaks binary compatibility
18:15:39dom96Araq: Do we have a test to check if the stdlib compiles in tainted mode?
18:16:05Araqdom96: yes, the tester uses large parts of the relevant modules and is compiled with --taintMode:on
18:16:21Araqwell I guess that's not the best way to test it
18:16:39dom96yeah. We should test all modules.
18:16:45Araqbut it's much better than nothing
18:16:51dom96I think that is something worth fixing before the next release.
18:17:00Araqsure thing
18:17:01dom96Gotta go. Bbl.
18:17:28*willwillson joined #nimrod
18:23:43*brson joined #nimrod
18:23:50*brson quit (Client Quit)
18:27:55BlaXpiritawwww, Varriount could not import: CryptAcquireContext | Error: execution of an external program failed
18:29:31BlaXpirit(oh, and yes, i'm trying this on Windows)
18:33:59AraqBlaXpirit: do you have the DLL?
18:34:16BlaXpiritAraq, uhh it's a Windows DLL
18:35:33BlaXpiritC:\Windows\SysWOW64\advapi32.dll
18:36:00BlaXpiritthe code is basically this https://gist.github.com/Varriount/4edcfd1d17af30645d30
18:37:31BlaXpiritoh and it's in C:\windows\system32 as well
18:37:42*gkoller joined #nimrod
18:37:47BlaXpiritso it's in PATH for sure
18:39:13BlaXpiritaha, so when I mess up the dll name, it says couldn't load library
18:39:21BlaXpiritso it's something wrong with the specification
18:39:35BlaXpiritor definition rather
18:40:22*Matthias247 joined #nimrod
18:45:31AraqBlaXpirit: most likely the calling convention then
18:45:32Araqwhich affects name mangling
18:48:07BlaXpiriti tried a few...
18:56:23*kunev quit (Ping timeout: 240 seconds)
18:58:27Araqmaybe it's a 32 vs 64 bit issue?
19:10:32BlaXpirithow do I know
19:10:42BlaXpiriti made stuff as exactly as I could
19:12:13BlaXpiritbesides, it's Varriount's code, it was supposed to work
19:12:24BlaXpiritand 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:13BlaXpiritoh CryptGenRandom works tho
19:42:24BlaXpiritcompiles, that is
19:45:17VarriountHm?
19:45:47VarriountBlaXpirit: Ping
19:45:56BlaXpiritping
19:45:57BlaXpiritwhat
19:46:15VarriountBlaXpirit: I made a mistake on the import name of CryptAcquireContext
19:46:17BlaXpiritif i remove CryptAcquireContext, it runs fine
19:46:22*wlhlm joined #nimrod
19:46:35*wlhlm left #nimrod ("Bye! ♥")
19:46:40BlaXpiritVarriount, ?
19:47:58VarriountBlaXpirit: The windows api has two versions of every function, a wide character version, and an ansi verison
19:48:01Varriount*version
19:48:08VarriountGimme a second, I'm fixing the gist
19:48:27BlaXpiritthank you
19:48:46BlaXpiritbut i even used LPCTSTR
19:49:00BlaXpiritdo u mean it should be like some suffix to the actual name?
19:49:46VarriountBlaXpirit: Look at the Gist
19:49:54VarriountI just fixed it. I think
19:50:48VarriountOn Windows, API procedures that take strings come in variants that accept 8-bit character strings, and 16-bit (I think) character strings
19:51:01BlaXpiritcompiles. great
19:51:04BlaXpiritthx, Varriount
19:51:10BlaXpiriti'm away for now
20:00:21BlaXpiriti mean runs, not just compiles
20:22:44*flaviu quit (Remote host closed the connection)
20:29:38*Sht0 joined #nimrod
20:35:12Araqgood 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:21dom96hi
21:11:32*gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:12:01BlaXpiriti just don't know how to let a C function write something to a string
21:12:08BlaXpiritgive it to pointer - but to what
21:12:26BlaXpiritarrays aren't just pointers to memory, casting doesn't really make sense
21:12:42BlaXpiritso i tried to find all the functions that belong to some array/sequence types
21:13:01BlaXpiritand even this seemingly simple thing is impossible with the current documentation
21:13:09EXetoCarray.addr?
21:13:16BlaXpiritoh good, you know that
21:13:21BlaXpiritbut how am i supposed to know it?
21:13:34BlaXpiriti looked through manual, tutorial, index
21:13:36BlaXpiritbut didn't find
21:13:53BlaXpiritthere simply is no thing "you can do this and that with arrays"
21:14:17BlaXpiritonly a giant list of all functions, including freakin libraries like SDL
21:14:46EXetoChttp://nimrod-lang.org/manual.html#the-addr-operator
21:14:57EXetoCwell it's not a function so it wouldn't be located in the library reference
21:15:24BlaXpiritno, i've definitely used addr before
21:15:33BlaXpiritbut arrays and strings save length information with them
21:15:36BlaXpiritso what about that?
21:15:47BlaXpiritwhat is an address to one supposed to mean
21:15:51BlaXpiritif it's a structure
21:15:54EXetoCit's not part of the array structure
21:16:12BlaXpiritok, but i don't want a dynamic size array
21:16:15EXetoCit is contained in strings and sequences though
21:17:03EXetoCarray being a statically sized array, and sequence being a dynamically sized structure (length + pointer)
21:17:09BlaXpiriti want to call a function that writes something to CString and return bytes from my function (thought seq[uchar] would be appropriate)
21:17:33BlaXpiritstatically sized array is not an option for me
21:17:34EXetoClength/capacity/pointer? something like that
21:17:41BlaXpiritso what am i supposed to give to the function?
21:17:57EXetoCok so sequence[0].addr? or str[0].addr? I think
21:18:09BlaXpiritwell this is interesting
21:18:21BlaXpirityeah, really promising. thanks
21:19:32EXetoCthere'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:46EXetoChttp://nimrod-by-example.github.io
21:20:21BlaXpiritseen that
21:20:26BlaXpiritwhole
21:20:32EXetoCok
21:21:58BlaXpiritand google never finds anything :|
21:23:49*Varriount is baaack
21:23:56BlaXpiritok now I want INT_MAX
21:24:03BlaXpiritam I really gonna have to ask everything that I need here?
21:24:05Varriounthigh(int)
21:24:13BlaXpiritI keep trying and trying to search
21:24:15BlaXpiritbut I just can't
21:24:34BlaXpiritthank you, Varriount
21:24:37VarriountBlaXpirit: Unfortunately, the Nimrod community is small. It's one of those vicious cycle things
21:24:56VarriountWe're small because people don't want to join small communities
21:25:00BlaXpiritbut it's not an excuse for documentation being unhelpful
21:25:26BlaXpiritlike seriously, all i want is, for example, an index sorted by first function argument
21:25:37VarriountBlaXpirit: If you can think of a better way for documentation to be organized, by all means, suggest away.
21:25:43BlaXpiritjust said one
21:26:04VarriountBlaXpirit: filwit is working on improving the look & feel of the documentation site. I don't know if he's doing search.
21:26:12VarriountBlaXpirit: What about generics?
21:26:32BlaXpiritwell just another section for generics
21:26:49Varriounthttp://nimrod-lang.org/system.html#high,T
21:26:51EXetoCI often look through the reference of the system module http://nimrod-lang.org/system.html
21:26:55EXetoCright
21:27:32BlaXpiriti even skimmed through that system module
21:27:47BlaXpiritbut skipped some stuff and forgot the rest
21:27:51BlaXpiritit's just too big
21:31:32BlaXpiritomg finally i was able to get a result from CryptGenRandom
21:31:39VarriountAraq: ^ Another reason we should split the system module into implicit sub-modules
21:33:39BlaXpiritbeats me why the exception tree is in tutorial and not in manual
21:33:59BlaXpirittutorial parts and manual are really just a 3-part tutorial
21:34:08BlaXpiritand never know where you may find this or that thing
21:34:15BlaXpiritthe fact that you don't know HOW to find it doesn't help
21:37:11VarriountBlaXpirit: Can we see your code so far?
21:37:48BlaXpirithow should i even post it
21:37:56Varriountgist.github.com
21:43:08BlaXpirithttps://gist.github.com/BlaXpirit/fa0fd3a025ecac03cf57
21:46:51*Matthias247 quit (Read error: Connection reset by peer)
21:52:04BlaXpirithmm should I maybe use uint instead of int
21:52:20BlaXpiritfor number of bytes
21:52:55BlaXpiriti'm aware of this avoidance of unsigned, but is it beneficial here? or just write >=0 check? :|
21:53:46EXetoCNatural* = range[0..high(int)] ?
21:54:40BlaXpirituhh natural is 1..
21:54:42BlaXpiritisnt it
21:55:20BlaXpiritno
21:55:22BlaXpiritbut
21:55:28EXetoCPositive* = range[1..high(int)]
21:55:42BlaXpiritgah
21:55:43dom96BlaXpirit: What's the problem?
21:55:51BlaXpiritno problem
21:56:10BlaXpiriti don't want negative numbers in my function argument
21:56:28BlaXpiritand i was asking what's best - uint, int, or (just suggested to me) Natural
21:57:03BlaXpiritand this Natural thing seems immediately... unnatural to me, because i was always taught that natural numbers start from 1
21:57:23BlaXpiritwikipedia says it can be both
21:57:45dom96indeed.
21:57:59dom96Makes 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:57dom96hello cryzed, welcome
23:36:05cryzedhello dom96!
23:36:41cryzedJust 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:25dom96awesome.
23:38:13dom96The more people here the better, maybe some discussions will interest you in the future enough to join in :)
23:38:28cryzedYes :)
23:51:07*filwit joined #nimrod
23:56:15*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)