<< 28-06-2014 >>

00:00:01Araqbut as I said, I was fed up with string munging
00:00:24Araqand hey, how hard can it be to write a register based VM from scratch? ;-)
00:01:22VarriountAraq: Your just saying this because the VM you built in less than a year isn't perfect.
00:01:47Varriount*You're
00:01:53Araqdom96: we can cache both the .exe generation and the AST->.exe->AST step
00:03:47dom96Araq: It's an interesting idea. Does any other compiler handle CTFE this way?
00:03:56Araqno.
00:04:23dom96Any ideas why?
00:04:59Araqit requires other stuff that others never came up with
00:05:00Jehan_dom96: Mostly because CTFE is a fairly new idea and has previously been explored primarily on JIT systems.
00:05:27Araqit also requires a different compiler infrastructure
00:05:48flaviuIsn't there some possibility to make a dependency graph and merge things that don't depend on each other into the same executable?
00:05:49Jehan_Araq: Not really all that different.
00:06:11Jehan_As I said, I had toyed with the idea of simply encapsulating meta-stuff in its own modules.
00:06:45VarriountCTFE =Compile Time Function Evaluation?
00:06:56Jehan_At that point, they're basically compiler libraries that are either dynamically loaded (or you compile a new compiler where that's not possible).
00:07:16Jehan_Which is not horribly different from a compiler with plugins.
00:07:55Jehan_Varriount: yeah.
00:08:40VarriountIs this how Rust does macros?
00:08:48AraqJehan_: depending on how you do it the AST->.exe->AST caching requires a whole new infrastructure
00:09:24Araqif you don't do this, it's easier
00:09:40Jehan_Araq: What I'm talking about doesn't have to do most of it.
00:11:05Jehan_When you import a metamodule, you compile and link it against the compiler. Caching = check dependencies and only compile/link if the metamodule or its dependencies have changed.
00:11:30Araqyeah
00:12:03Jehan_Nimrod has a harder time because macros etc. aren't separated into their own modules.
00:12:44Araqnot that much harder really
00:13:07AraqI abandoned the DLL generation idea because shared objects suck on Unix
00:13:46Araqall sorts of path issues and good luck debugging these
00:14:34Jehan_dlopen() with an absolute path shouldn't be a problem?
00:14:37AraqVarriount: I think Rust does it via DLLs, yes
00:14:51Jehan_Which is all you need when you're doing it from the compiler?
00:15:19AraqJehan_: I don't remember the problems tbh
00:15:53flaviuIf rust emits LLVM IR, shouldn't it just use the LLVM virtual machine?
00:15:58Jehan_Araq: *nod* Not that I'm surprised that there are problems, and dlopen() has plenty of architecture-specific corner cases, too.
00:16:30Jehan_flaviu: In principle, LLVM also has a JIT option.
00:16:40Jehan_Though that can be dog slow for large amounts of code.
00:20:05flaviuIs there a way to get passthrough on case statements?
00:21:45Jehan_flaviu: Use a template (immediate if necessary) for common code.
00:22:24flaviuI'm not really sure how that applies here. I want to do a C-style switch
00:23:39Jehan_flaviu: Yes. Put the code for the fall-through case in a template, then use the template both at the end of the previous case and for the fall-through case.
00:24:06Jehan_The template can be local to the function.
00:24:19flaviuhttps://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp#296
00:24:29*joelmo quit (Quit: Connection closed for inactivity)
00:24:31flaviunot really going to work here
00:24:38NimBotAraq/Nimrod devel 33eeb66 enurlyx [+0 ±1 -0]: Add support for structs/unions defined in structs/unions
00:24:38NimBotAraq/Nimrod devel 3648680 enurlyx [+1 ±0 -0]: Added test for anonymous structs and unions
00:24:38NimBotAraq/Nimrod devel 788cfb3 enurlyx [+0 ±1 -0]: Removed time and added a hash based on filename, line and column for creating a unique struct id
00:24:38NimBotAraq/Nimrod devel bd3f6b5 enurlyx [+1 ±1 -0]: Sorting enumerations and generation of consts for enumfields with the same value + test
00:24:38NimBot2 more commits.
00:25:08Jehan_Ah, I see.
00:25:55Jehan_Okay, Duff's Device is a special case (no pun intended).
00:26:57flaviuIts also a special case, so it can't be rolled easaly
00:28:22Jehan_Technically, compilers can still combine common code if you replicate it in each branch, but you may be hitting a threshold here where they give up.
00:30:13Araqyou can easily use a for loop though
00:31:13dom96I can't set the result of 'bindSym' to a variable?
00:31:21dom96Is this intentional?
00:31:34Araqyes
00:31:58AraqI've recently explained why
00:33:16dom96Surely this should work: https://gist.github.com/dom96/e9625a08b913fdd72b09
00:34:22Araqno
00:34:47Araqoh wait
00:34:58Araqyes
00:35:01dom96lol
00:48:26superfunc_we may be passing the balmer peak Araq :p
00:49:09Araqja du vielleicht
00:49:25*vendethiel quit (Ping timeout: 252 seconds)
00:49:35flaviu"yes you may"?
00:50:16AraqI'm not sure your english translation captures the tone
00:52:47dom96getAst doesn't seem to be working
00:52:48flaviu"yes, you maybe"?
00:53:16dom96oh, I need the ()
00:54:27*TylerE joined #nimrod
00:55:15NimBotdom96/jester new-async da14102 Dominik Picheta [+0 ±2 -0]: Compiles and runs. Halt/redirect etc don't work.
00:55:15NimBotdom96/jester new-async c76a086 Dominik Picheta [+1 ±2 -0]: Wrote a 'routes' macro.
00:55:15NimBotdom96/jester new-async 9daf899 Dominik Picheta [+0 ±2 -0]: Cleanup. Pass, redirect and cond work.
00:55:31Jehan_flaviu: Hmm, both clang and gcc seem to be dealing with a template chain fine.
00:55:56flaviuI meant that the code would still be ugly
00:56:30dom96So, Jester + await pretty much works.
00:59:12Jehan_flaviu: https://gist.github.com/rbehrends/31a6e7f5fe8d7caa4c42
00:59:37Jehan_Not pretty, but not horrible, either.
00:59:47Jehan_I'm more concerned that the optimizer may still barf on it.
01:00:12*superfunc_ quit (Ping timeout: 245 seconds)
01:02:47*Trustable quit (Remote host closed the connection)
01:09:03dom96'night
01:17:18*brson quit (Quit: leaving)
01:37:03*Demos__ joined #nimrod
01:39:56*Demos_ quit (Ping timeout: 240 seconds)
01:49:29*Demos joined #nimrod
01:49:32*Demos quit (Read error: Connection reset by peer)
01:51:16*sdw joined #nimrod
01:58:45*Jehan_ quit (Quit: Leaving)
02:09:39*q66 quit (Quit: Leaving)
02:34:01*johnsoft quit (Ping timeout: 248 seconds)
02:41:36blamestrossthe lack of math.random for windows hurts
02:44:11*johnsoft joined #nimrod
02:55:13def-Hm, I'm also trying BigInts; mainly interested in performance, which seems to be in the same ballpark as GMP (+ and * so far): https://github.com/def-/bigints
03:15:26*saml_ quit (Quit: Leaving)
03:29:13blamestrossdef-: I have not even tried to benchmark mine yet
03:29:30blamestrossright now I am on r-shift and it is being a pain
03:30:21blamestrosshttps://github.com/blamestross/nimrod-BigInt/blob/master/bigints.nim
03:31:49blamestrosslooks like we are taking the same seq[uint32] approach
03:33:06flaviublamestross: I'm curious where shr is causing you trouble. It seems straightforward, but I assume the devil is in the details
03:33:40blamestrossmostly me starting to burn out. I'm taking a break to work on other stuff. My issue is that I don't know what the problem is.
03:35:00blamestrossshr works for 0-200ish then starts garbageing up above 200. I think I have a divison or off by one error that I am missing
03:35:25*Nimrod joined #nimrod
03:36:05flaviublamestross: Can you push your latest revision? I'm getting nowhere on what I'm doing too, I'd like to take a look at it
03:36:14blamestrosssure
03:36:40blamestrossbranching off main because this code is having issues
03:38:46blamestrosshttps://github.com/blamestross/nimrod-BigInt/blob/WIP/bigints.nim
03:41:15blamestrossjust pushed a test that shows the issue
03:42:25blamestross(0x123546 shl 400) shr 396 = 0x0000000000035460
03:42:59blamestrosswhen I expect 0x1235460
03:43:44blamestrossbased on that, it looks like I might have missed a case in the carry
03:44:37blamestrossI'm just gonna type out my logic in a Turing TeddyBear fashion
03:45:09blamestrossshr takes in a bigint and an integer number of positions to shift.
03:45:36*ARCADIVS joined #nimrod
03:45:58blamestrossthe chunk size for data stored in the bigint is 32-bits
03:46:33blamestrosswe can "shift" in multiples of 32 by deleting the lower-order chunks
03:47:02blamestrossit divides the given integer by 32 to find out how many chunks it should discard
03:47:55blamestrossit then uses a slice to discard those chunks as they are at the "bottom" the the sequence of chunks (As far as I can tell seq is a stack in disguise)
03:48:30blamestrossIf I managed to delete all the chunks, re-add one with the value of zero
03:48:35flaviublamestross: Sorry to interrupt your thoughts, but try adding https://gist.github.com/flaviut/5b0bbf74bdc685da2e3c to your gitignore
03:48:49flaviuIt should take care of every binary
03:49:01blamestrossflaviu: I think I already did but after the files had been added.
03:49:30flaviuyes, but adding each binary is too much hassle
03:50:13blamestrossflaviu: done.
03:50:53blamestrossnow I've taken care of all the multiples of 32, I need to deal with the remainder (literally i mod 32)
03:51:26blamestrossI make a new variable called j to hold that value because I hate other programmers.
03:51:43blamestrossnow the difficult part is the carry
03:52:30blamestrossand I think I might have found my issue, but I'll keep going
03:53:42*askatasuna quit (Quit: WeeChat 0.4.3)
03:53:53blamestrossfor each "digit" of the bigint (woo base 2^32) I need to find the value of that digit shifted, add the value of the carry from the last digit and calculate the carry for the next digit.
03:54:27blamestrossand I thinks lines 171 to 175 are all just wrong
03:55:45flaviuShouldn't you just need 1 carry variable?
03:56:22blamestrossyeah, it is zero for the first one and thrown away for the last
03:56:52blamestrossI just need to incorperate it before I calculate and over-write it with the new one
04:00:51blamestrosswhat I am currently trying to figure out is this:
04:01:14blamestrosswhen the carry is calculated, it is stored in the bottom bits of the int64
04:01:48*xenagi quit (Read error: Connection reset by peer)
04:01:49blamestrossI need to re-introduce the carry into the next digit at the top-bits of the digit. How much should I shift the carry up
04:01:58blamestross?
04:03:50flaviublamestross: The same amount as down
04:04:27flaviuBecause then the bottom bits get cut off, but the data is in the initial position again
04:11:23blamestrossI just did some git-rettconning
04:11:38blamestrossthis almost works
04:11:46flaviuThats alright, I'll send regular patches if needed
04:11:58blamestrossthe current test indicates an off by one error
04:15:32flaviuerr, what I said was completly backwards about shifting
04:15:41flaviuits actually the exact reverse
04:16:46blamestross(32 - i) ??? that was my first intution
04:17:09blamestrosswell, (32-j) in this code
04:19:54blamestrossflaviu: pushed an updated test file to demonstrate current issue
04:21:00flaviublamestross: I'm actually seeing if I can implement it myself from scratch right now
04:27:50blamestrossI think I just fixed this issue
04:27:57blamestrossI am testing to check
04:28:25blamestrossI was doing an extra shr before adding val to the results list that I forgot about.
04:31:09blamestrossflaviu: thanks!
04:31:46blamestrossnow I can start on division
04:32:04flaviuI'm not aware I actually did anything, but no problem
04:32:27flaviuI think I can get right shift to be extremely elegant, so I'll still work on that
04:33:11blamestrossflaviu: surviving the task of being a Turing's TedyBear is worth of thanks.
04:33:16*EXetoC quit (Quit: WeeChat 0.4.3)
04:34:06blamestrossflaviu: My goal is allways to get it working as soon as possible, so I oftern er away from elegant, But I would love pull-requests or patches
04:34:51flaviuI should probably stop wasting time on that, but I can't resist :(
04:35:09blamestrossI've lost 2 days to bigint already 0.o
04:35:38blamestrossBut I like nimrod, and it was certainly a good way to learn.
04:35:56NimrodI like you too blamestross
04:36:21blamestrosshave a challenge if you need one! I am dreading writing a base10 string -> bigint interpreter.
04:36:53blamestrossany base2^x power is trivial, but base 10 is nasty in dealing with the edges of the 32-bit chunks
04:36:58flaviuSeems easy, if you don't care about performance :P
04:37:10flaviuLet the multiply and add deal with it
04:37:13blamestrossflaviu: exactly. but we do.
04:40:24blamestrossdef-: i stole your testing code and am benchmarking. Either my computer is faster or my code is faster
04:40:31blamestrossI'll bet on computer
04:41:26blamestrossI don't have GMP to compare against locally
04:43:44blamestrossnope, nevermind I was reading the compile time. I started the first (5s on yours) test a minute ago. Still running. Am still idiot
04:44:24flaviublamestross: Ok, I got it
04:44:40flaviuMy shr looks pretty good :)
04:45:04flaviuhttps://gist.github.com/flaviut/25ca831b43e438ba8bb1
04:47:32blamestrossworks
04:47:36blamestrosspatch accepted
04:48:35blamestrossI still need to figure out how it works
04:49:06flaviuFirst I shift over integers as much as possible, and then I go through each integer.
04:49:19blamestrossI know, but I am just learnign nimrod
04:49:39blamestrosslittleShifts = (i mod 32).uint32 <-- does the mod and converts the result to uint32?
04:50:01flaviuYes, I'm working around some weird limitations in the library methods
04:51:18flaviuSince the unsigned types require two `(a, b: T)`, I can't shift a uint32 over by a int literal since nimrod doesn't really like unsigned implicit conversions
04:52:32blamestrossI like how you get around what I was solving by using 64bit ints
04:54:02blamestrossAnd on thank node I am crashing. division in the morning.
04:54:12blamestross*that note
04:54:44flaviuSame here, I need to go to bed soon
05:14:09*flaviu quit (Ping timeout: 252 seconds)
05:14:58*Demos__ quit (Read error: Connection reset by peer)
05:54:01*xtagon quit (Ping timeout: 248 seconds)
06:45:31*nande quit (Read error: Connection reset by peer)
06:55:36*btiffin quit (Ping timeout: 264 seconds)
07:07:59*btiffin joined #nimrod
08:05:59*Matthias247 joined #nimrod
08:55:19*kunev joined #nimrod
09:00:35*vendethiel joined #nimrod
09:09:47*btiffin quit (Ping timeout: 245 seconds)
09:17:53*Trustable joined #nimrod
09:22:51*btiffin joined #nimrod
09:23:31*io2 joined #nimrod
09:37:08dom96good morning
09:44:04*ARCADIVS quit (Quit: WeeChat 0.4.3)
09:51:39*joelmo joined #nimrod
10:27:46*q66 joined #nimrod
10:43:24Araqhey dom96
10:43:38Araqnew_spawn ready to be merged into devel?
10:43:39dom96hi Araq
10:43:49dom96not yet
10:43:57Araqbah. found a bug?
10:44:17dom96no, but I haven't tested it well enough
10:44:22Araqah good
10:53:27Araqbrb
11:14:25Araqback
11:16:14NimBotAraq/Nimrod devel 9ea0d0c Dominik Picheta [+0 ±1 -0]: Futures with an error but no callback no longer raise.... 5 more lines
11:17:21Araqdom96: I'm making c2nim a babel package and give it its own repo
11:17:28dom96Araq: cool
11:18:14Araqbut Babel really needs a "generate boilderplate" feature :P
11:18:20Araq*boilerplate
11:18:44dom96Contributions are always welcome :P
11:20:04Araqhmmm Araq/c2nim or nimrod-code/c2nim ?
11:20:48dom96Speaking of boilerplate: https://gist.github.com/dom96/8fa50211681be4dca749
11:21:23Araq*shrug* that's only a macro away
11:21:45dom96somebody has to write the macro too you know
11:23:18dom96Araq: nimrod-code
11:25:50Araqfowl will have it once he reads this
11:28:20*BitPuffin joined #nimrod
11:30:20Skrylarugh
11:30:25Skrylarwhy does readBytes use signed 8bit ints
11:30:34Skrylarits a byte, not an int
11:30:39Araqlegacy
11:30:46Araquse the cstring version
11:30:51Araqthat's better anyway
11:30:53Skrylarthat sounds worse
11:31:04Araqwell make a PR
11:31:11AraqI don't think anybody really uses it
11:31:20Araqso let's change it
11:31:39Araqpeople here are generally happier with breaking stuff than I am ... so there.
11:35:27dom96Araq: So I have these types of stack traces: https://gist.github.com/dom96/ad57255861fcb5834b10
11:35:33dom96and they suck
11:35:44dom96Would you be able to provide me with a way to change that?
11:36:34dom96In `cb` I have access to the iterator, so if I could say myIter.whatLineAreYouOn and then add that to the current stack trace or something
11:36:50dom96or rather replace the 'asyncdispatch.nim(790) cb' with it
11:38:21Araqhmm isn't this just the "line info off for iterators" bug?
11:38:41dom96well
11:38:45dom96there is that too in there
11:39:05dom96but after you fix that the cb/callback= stuff will remain in the stack trace
11:39:31Araqwell but that's correct, isn't it?
11:39:43Araqit simply not relevant to you, right?
11:39:47dom96yeah
11:40:12Araqok this requires some new builtin then
11:40:30dom96cool, so you think it's a good idea?
11:40:37Araqwell in fact
11:40:50Araqyou can already turn off stack traces for single prcos
11:40:55Araq*procs
11:41:00Skrylarhrmm
11:41:10Skrylarseems like there should be a warning if a method never returns or sets result
11:41:23dom96Araq: how?
11:41:39Araq{.push stackTrace: off.}
11:42:46dom96Araq: ok. It would still be nice to be able to replace it with something more informational.
11:43:09dom96so that it gives you an idea of where in the iterator it is
11:43:20Araqwell as I said
11:43:31AraqI think there some bug report about it already
11:52:34Araqhmm damn
11:52:58Araqif c2nim's docs are moved the docgen needs to learn where to find it
11:54:49Araqoh well, everybody will have it in $nirmrod/../c2nim anyway, right?
12:08:19*flaviu joined #nimrod
12:08:27NimBotAraq/Nimrod devel f830aed Dominik Picheta [+0 ±2 -0]: AsyncHttpServer now supports POST.
12:08:50Araq:O
12:08:59dom96:D
12:09:01Araqcongrats, dom96
12:10:07NimBotdom96/jester new-async 3126711 Dominik Picheta [+0 ±2 -0]: Attachment, halt, and more are now operational.
12:10:07NimBotdom96/jester new-async c4909a3 Dominik Picheta [+0 ±2 -0]: POST support.
12:10:32dom96it be ready
12:11:17Araqbtw I might add a switch to change scoping semantics for closure captures
12:11:45Araqthis should give async more speed but it's also risky
12:12:13Araqmaybe I should make the analysis smarter instead ...
12:12:17*q66 quit (Quit: Leaving)
12:13:43Araqwell benchmarking will tell us
12:14:10dom96indeed
12:14:21dom96Well, I need to go see you later
12:14:30Araqwait a sec
12:14:39Araqhow do I do a pull request? :-)
12:14:53*Araq doesn't *request* pulls
12:14:53dom96lol
12:15:04dom96where do you wanna do a pull request?
12:15:12dom96you basically fork it
12:15:16Araqadd some babel package
12:15:18dom96push to a new branch
12:15:37dom96oh, well then https://github.com/nimrod-code/packages/edit/master/packages.json
12:15:52dom96although that may commit the changes immediately
12:16:11Araqno let me do it like the others need to do it
12:16:15dom96lol
12:16:18dom96fork it then
12:16:21dom96clone the fork
12:16:27Araqok
12:16:43dom96make changes locally
12:16:44dom96commit
12:16:46dom96push
12:17:01dom96and then github should show you
12:17:15dom96"This branch is ahead of blah blah by 1 commit, do you want to PR?"
12:17:26dom96or you can go here https://github.com/nimrod-code/packages/pulls
12:17:35dom96and click "New Pull Request
12:18:12dom96see ya
12:24:15*untitaker quit (Ping timeout: 252 seconds)
12:24:21*flaviu quit (Quit: Leaving.)
12:24:31*flaviu joined #nimrod
12:27:00flaviublamestross: Oh, I see what you were confused by. `foo(bar)` is equivalent to `bar.foo`
12:30:06*untitaker joined #nimrod
12:30:25*saml_ joined #nimrod
12:58:06*darkf quit (Quit: Leaving)
12:59:40flaviuError: type mismatch: got (uint64, uint64) but expected one of: system.+=(x: var T, y: T)
12:59:45flaviubut the lhs is a var
13:12:14*Boscop_ quit (Read error: Connection reset by peer)
13:12:29*Boscop_ joined #nimrod
13:23:34Araqflaviu: T's constraint doesn't match but the compiler is evil and doesn't tell you
13:23:52Araqthere is a PR for this to work
13:26:48*Boscop_ is now known as Boscop
13:27:45def-flaviu: https://github.com/Araq/Nimrod/pull/1312
13:28:19flaviuok, thanks
13:32:20Araqwhat's the directory layout for Babel packages again? do we have any?
13:39:04*johnsoft quit (Ping timeout: 248 seconds)
13:40:19*nande joined #nimrod
13:40:28*nande quit (Read error: Connection reset by peer)
13:47:31flaviuuint32(accm and 0xFFFF_FFFF'u32) != accm and 0xFFFF_FFFF'u32
13:47:46flaviudoesn't converting to uint32 just cut off the extra bits?
13:49:06Araqyou should convert accm to uint32 and not the result
13:49:25Araquint32 and uint32 produces an uint32
13:51:01flaviuI think that should be equivalent to just `uint32(accm)`
13:51:30Araqdepends on accm's type, but in general, no
13:51:55Araqint64 and uint32 produces int64 iirc
13:52:39Araqin general the rules try to prevent as much information as possible
13:52:50Araqand narrowing is always bad for that
13:53:16flaviuaccm is a uint64, so I'd expect uint32(uint64) to just cut off the bits, or maybe I don't understand what you're saying
13:53:48*vendethiel quit (Ping timeout: 240 seconds)
13:54:23Araquint64 and uint32 produces uint64, what else?
13:54:41Araqshould 'and' be different than 'or' and '+' ?
13:55:32flaviuMy goal is to cut off the top bits and put a uint64 in a uint32. `accm and 0xFFFF_FFFF'u64 != uint32(accm)`
13:55:51flaviuwhich is a bit unexpected
13:57:03Araqwhy are they unequal?
13:57:24Araqboth get promoted to 'int'?
13:58:36Araqoh well I don't really care. I hate this integer type zoo bullshit
13:59:19Araqand especially the implicit conversions that everybody else loves so much
13:59:59Araqthey create much more problems than they solve
14:00:16Araq*many
14:00:43flaviuI'm trying to simplify the problem as much as possible, but `invalid type: 'proc (range -1..0(uint64), range -1..0(uint64)): bool{.noSideEffect.}'`
14:06:04flaviuNo, that works fine once I get around the weird range thing. Seems the problem is somewhere else
14:11:28*t0ryzal joined #nimrod
14:18:13Araqhi t0ryzal welcome
14:20:13t0ryzalhello
14:32:14*vendethiel joined #nimrod
14:38:48*kunev quit (Ping timeout: 240 seconds)
14:46:37*saml_ quit (Quit: Leaving)
14:49:11*t0ryzal quit (Quit: Leaving)
14:52:47blamestrossMorning
14:55:17flaviuhi blamestross, I think I see what you were confused about in my code. `foo(bar)` is equivalent to `bar.foo`
14:56:25blamestrossflaviu: I saw in the code. Thanks. I'm at the point with nimrod where I can write code that does a job, but I still don't know half the ways to make it elegant or pretty.
15:08:59*EXetoC joined #nimrod
15:13:45flyxcan I annotate a subrange type to an int literal
15:13:53flyxto tell the compiler „this int is of that subrange type“?
15:14:50flyxotherwise, this won't compile: https://gist.github.com/flyx/1ade6064ae3872434ca9
15:15:48def-flyx: i noticed this too, and wish it would work. when you write t.id = 2 directly it works
15:17:06EXetoC2.TId?
15:17:27EXetoCI think allowing (2, "Foo") is on the horizon. I've discussed that before
15:17:53flyxEXetoC: right, 2.TId works, thanks!
15:25:22EXetoCok so it was indeed reported some time ago https://github.com/Araq/Nimrod/issues/500
15:28:49EXetoCI've been avoiding that for that reason, because it complicates things
15:34:29EXetoCbut you can get pretty much the intended behavior by defining converters I think
15:37:46*johnsoft joined #nimrod
16:21:58*superfunc joined #nimrod
16:41:52*kunev joined #nimrod
16:50:58*Demos joined #nimrod
17:15:20*superfunc quit (Quit: leaving)
17:15:34*superfunc joined #nimrod
17:15:49superfuncI wonder if I could get away with secretly teaching nimrod next semester
17:16:09superfuncMaybe I could give away extra credit for it
17:17:31flyxsuperfunc: teaching in which context?
17:18:13Nimrodsuperfunc: teaching me what?
17:18:44superfunclol, I have to teach an intro Java course next semester, I was just joking about going rogue and teaching a language I dont hate
17:19:01flyxoh well, the Java intro courses
17:19:46flyx“and here we concatenate 10 objects just for outputting text. do not ask why, that won't be taught this semester”
17:19:58superfuncseriously though lol
17:20:03superfuncIts so bad.
17:20:09Demosthank the norse gods they fixed java's IO functions
17:20:30superfuncJust wondering, has anyone messed with Scala?
17:20:40Nimrodflyx: maybe you could teach me java.
17:22:44flyxNimrod: it's fairly easy. install IntelliJ, open a file, write 3 random characters, press ctrl+space (cmd+space on OSX), enter, repeat
17:23:31flyxMost Java code is written by autocompletion functions of IDEs. only a small portion is written by developers.
17:24:09*Jehan_ joined #nimrod
17:24:45*sdw left #nimrod (#nimrod)
17:36:26Demosit does seem like a bit of a victory that somewhat inexperienced developers can produce functioning software in java and that the IDEs are so good
17:36:59Demosand hey, people seem to love c#, which is pretty much exactly like java
17:43:35Jehan_In the same way that apples are pretty much exactly like oranges? :)
17:46:14Demoseagh maybe it is just becaiuse I learned j# first then transitioned to c#
17:46:22Demosj# was actually just like java
17:48:22DemosQuestion: Before java was there another language that had expansive standard libraries that shipped with the compiler and tools?
17:48:57Trixar_zaNot even Java did that
17:49:35Jehan_Python, minus the compiler part.
17:50:07Jehan_In fact, "batteries included" has always been one of Python's major selling points.
17:50:15flyxC# is actually a bit different because it learned from Java's mistakes
17:50:36Jehan_But more seriously, while both C# and Java are OO languages with a JIT implementation, they have some pretty fundamental differences, too.
17:51:22Jehan_flyx: Well, arguably, the problem was that Java pretty much ignored all existing programming language research.
17:51:31Jehan_So it wasn't too hard to improve upon that.
17:52:01flyxthe major drawback of C# is the missing cross-platform compatibility. because while Mono exists and is usable, you have to be extra careful if you want to write code that runs on Mono *and* .NET
17:52:26Jehan_flyx: Yeah, that's an unfortunate vendor limitation.
17:53:24Jehan_Speaking of which, I'd kill for Windows 9 having a POSIX compatibility layer.
17:53:54superfuncJehan_: I thought windows was partially compliant
17:54:02Demoswell windows 7's POSIX latyer was pretty bad
17:54:06Trixar_zaExcept, batteries included seems to be going down the crapper
17:54:24Jehan_superfunc: Well, there was a semi-working thing, but you only got that with the pro version.
17:54:48Jehan_Trixar_za: Hmm, really? My concern is more that the Python distribution is getting too big.
17:54:59DemosI don't think all that much actually worked under SUA
17:55:18Trixar_zaAlmost all libraries require you to install them globally or through pip since it requires other non-standard libraries that have their own non-standard requirements.
17:55:29Trixar_zaWhy do you think I'm writing my own irc library now?
17:55:35Trixar_zaThat crap just pissed me off
17:55:40Jehan_Trixar_za: Hmm, I'm talking about what you get out of the box without extra packages.
17:56:39Jehan_That pip/easy_install have their warts is well known.
17:56:46DemosI really want something like NuGet (or chocolatey) to let me install libraries without using VS
17:57:37Trixar_zaJehan_, my biggest problem is that I want to make my programs copy and run. Requiring libraries that needs pip to install defeats that point
17:58:37Jehan_Trixar_za: Yeah. But is there any language these days that doesn't do that via a package manager?
17:58:57Trixar_zaAlso the non-standard required libraries those libraries have themselves is unforgivable. It makes including the one library requires you to include several other files as well to get 'standard' support.
17:59:01superfuncI thought nuget worked through powershell
17:59:06Demoswell, c++
17:59:18Demosit does, but the library bits only really work in visual studio
17:59:33Demosafaik it scorunges around vs project files to set up linkage options and the like
17:59:58Jehan_Trixar_za: I'm not a big fan of deeply nested dependency graphs myself. :(
17:59:59Demoslets static link all the things
18:00:47Jehan_superfunc: NuGet is a .exe at the most basic level? I know because I've run it on OS X/Linux before?
18:01:26Trixar_zaJehan_: I assume most users only have the most basic understanding of the language and their system's package manager. So something like pygtk or pyside is acceptable, but not so much an obscure library with several nested dependencies. Especially for a simple throw away script :P
18:01:43Jehan_Trixar_za: Heh. :)
18:01:53Jehan_I have to say that I'm a fan of scons for that reason.
18:02:02Jehan_I.e., it doesn't require anything else to run.
18:02:24Jehan_Plus, I don't have to deal with the stupid Makefile syntax. :)
18:02:32Trixar_zaActually that's what attracted me to Nimrod - it's pretty much self-contained
18:03:26Jehan_Trixar_za: Same here.
18:03:40Jehan_It's actually something I *need* for some things.
18:08:32Jehan_Umm, Rust 0.10 has changed _again_ how they're dealing with pointers?
18:11:23dom96back
18:17:59dom96Anybody bored and wanna write a macro?
18:18:11dom96If so, write one which gets rid of the boilerplate here: https://gist.github.com/dom96/8fa50211681be4dca749
18:19:38flaviudom96: Well, if that's all the boilerplate you need, I'd say you're doing pretty good
18:20:25dom96flaviu: I know it's minor, but minor things add up.
18:21:46flaviuthink about readability too. Is it easier to see what a macro does, or just to copypaste a bit? Especially since this is just in a single place
18:24:35dom96That's why the macro should be designed so that it's readable.
18:26:48*johnsoft quit (Ping timeout: 264 seconds)
18:28:02flaviuWell, it seems I can't shift an unsigned value by a negative amount
18:28:40flaviuSince `shl(T, T): T`, so typemismatch on `shl(uint32, int): uint32`
18:29:44flyxis there a nice syntax for „iterate through this but skip the first element“?
18:29:50Jehan_Shifting by a negative value is undefined anyway.
18:30:38flaviuI thought nimrod avoids undefined behavior?
18:32:56Jehan_flaviu: Not in this case, apparently.
18:33:56flaviuI guess I'll have to do `sizeof(T)`, if that works with generics
18:35:13Jehan_flaviu: what are you trying to do?
18:35:45flaviuWrite a generic rot{l,r}
18:39:02Jehan_sizeof should work for that.
18:39:13flaviuYep, seems to work
18:39:46flaviuNot the most beautiful code, but it works
18:42:06Jehan_Use [T:TInteger] as the constraint?
18:42:19flaviuYes, I am
18:43:18flaviu`return (i shl T(distance)) or (i shr T((sizeof(T)*8)-distance))` vs `return (i shl distance) or (i shr -distance)`(ideally)
18:43:37flaviuStill clear and readable, but more cluttered
18:43:58Araqaccording to news.txt we're going to release tomorrow...
18:44:09Jehan_I think shl and shr need to be properly overloaded.
18:44:38Jehan_There's no reason why the shift offset needs to be the same type as the shifted value.
18:45:01flaviu^
18:45:19Araqthere was a reason to do it this way, but I can't remember
18:45:28AraqI think it was about consistency
18:46:06Jehan_Generally, you want to use shifts with unsigned values, but normal integers for the offset.
18:46:31Araqno. why?
18:47:08dom96Araq: fuck really?
18:48:01flaviuThe whole purpose of unsigned is to be thought of as a string of bits. Why would you want to use signed integers for shifting?
18:48:24Jehan_Araq: Because shr for signed integers is not defined.
18:48:28flaviuThere are weird issues, such as what to do with the sign bit.
18:49:40Jehan_Or, to be precise, implementation-defined.
18:50:05Jehan_More importantly, you rarely want the arithmetic right shift that compilers do for signed ints by default.
18:50:16Jehan_most compilers*
18:50:49flaviuAre there even real uses for arithmetic right shift?
18:51:16Jehan_Only a couple of years I wrote code to work around the Cray C Compiler not doing it right.
18:51:42Jehan_flaviu: Yes, but rare.
18:52:47Jehan_Example: Many interpreters encode ints by having the lowest bit set to distinguish them from pointers.
18:53:03Jehan_You shift them right one bit to convert them to proper integers.
18:55:35Jehan_Personally, I'd have all bit operations for unsigneds in system.nim. That (unlike arithmetic) is what unsigneds are for.
18:57:41flaviuI once asked about VLAs in nimrod, but I think everyone was asleep. Are they on the roadmap/does someone have a library for them?
18:58:52flaviuI guess my best chance of getting them is to integrate unchecked arrays with the GC, which would work about the same
18:59:43Jehan_flaviu: You can {.importc: "alloca", header: "<alloca.h>".}
19:00:04Jehan_That said, there's little point in using VLAs.
19:00:26Jehan_You don't want to allocate arbitrarily sized arrays on the stack, so you may just as well allocate a fixed size one that's large enough.
19:00:47*superfunc quit (Quit: leaving)
19:02:52AraqJehan_: shr/shl do pretend the numbers are unsigned even for signed
19:03:05Araqthis avoids the undefined behaviour
19:03:09Jehan_Araq: I hadn't realized that.
19:03:28Araqdom96: yes.
19:03:44Araqand yes I'll move the unsigned ops into system.nim
19:03:59Araqimport unsigned will be an empty import then
19:04:45Jehan_Araq: Hmm, I'm not sure whether that's a good idea for the arithmetic operators.
19:05:05AraqJehan_: too many people complained
19:05:13Jehan_Araq: Heh. :)
19:06:38Jehan_Well, the thing is that in C/C++, people keep shooting themselves in the foot by using unsigneds wrong.
19:07:37*Varriount|Mobile joined #nimrod
19:07:55Jehan_My rule has always been: ints for arithmetic, unsigneds for bitops (or where I specifically need the mod 2^n behavior).
19:08:17AraqI defined bitops to use unsigned semantics
19:08:22Jehan_Well, not always, I'm pretty sure I got it wrong in the 1980s, too. :)
19:08:34Araqand so the rule is: use ints.
19:08:53Araqwell that was the idea
19:09:01Araqit's not that simple in practice
19:09:12Jehan_Araq: Yeah, but bitops are often combined with multiplication mod 2^n, which is only defined for unsigned.
19:12:12Araqlol: http://xkcd.com/619/
19:13:13Jehan_Heh. :)
19:13:42Jehan_It would be nice to have a third OS for Desktop work, yeah.
19:16:15*Mathnerd626 joined #nimrod
19:17:04Araqhi Mathnerd626 welcome
19:27:27NimBotAraq/Nimrod devel cbcf01f Reimer Behrends [+0 ±3 -0]: Rename sequtils.distnct to sequtils.deduplicate.
19:27:27NimBotAraq/Nimrod devel 3310688 Andreas Rumpf [+0 ±3 -0]: Merge pull request #1318 from rbehrends/rename-distnct... 2 more lines
19:28:07*crippa joined #nimrod
19:28:17Araqhi crippa welcome
19:29:12AraqJehan_: maybe reactormonk is right and it should instead be a babel package? we need more packages
19:29:24Jehan_Araq: I have no preference.
19:29:37Araqhow often is this stuff useful?
19:29:48Jehan_I find the functionality useful for testing primarily.
19:29:56Araqhas python it in its stdlib?
19:30:04Jehan_I'd have to check.
19:30:08flaviuAraq: Yes
19:30:43Araqok then, it sux to have deps simply for testing stuff
19:31:06Araqand english sux too btw for having so many long latin words
19:31:16Jehan_Yes, it's in itertools.
19:31:31Jehan_It's not _only_ useful for testing. :)
19:31:55flaviuI think that nimrod needs its own itertools
19:32:02Jehan_That's just what I find it most useful for.
19:32:37Araqwhen I need a permutation generator, I usually write my own
19:32:53flaviusequtils, strutils, algorthm, are mostly wannabe itertools
19:33:16Araqit's always a useful exercise and I end up tweaking it to produce not *every* permutation
19:33:42Jehan_flaviu: One could argue that Python has itertools because it lacks decent inline closures. :)
19:34:12Jehan_Araq: As I said, I have no preference.
19:34:46Jehan_Which reminds me that I need to write up an issue for the iteration bug.
19:34:50flaviuNimrod has inline closures?
19:35:38Jehan_flaviu: Modulo differences in definition, yes?
19:35:44*johnsoft joined #nimrod
19:36:16Jehan_By inline closure I mean a closure that's part of an expression/statement rather than a separate definition.
19:36:46Jehan_Python has `def` and `lambda`. `def` isn't inline in that sense and `lambda` is limited in what it can do.
19:36:48flaviuAnyway, I think that the itertools is still useful, and closure iterators feel like an elegant way to do things
19:39:25flaviuShould I make the hash function so it returns the same thing on all endians? It seems that even ARM is little endian
19:40:53Araqflaviu: dunno, seems useful
19:42:06Jehan_At least we don't seem to have architectures anymore that just randomize the byte order.
19:42:42flaviulol, which architectures did that?
19:42:48Varriount|Mobileflaviu: I agree with you on the fact that nimrod needs an itertools module
19:43:07*Trustable quit (Ping timeout: 245 seconds)
19:43:27Jehan_PDP-11.
19:43:39Jehan_Technically, ARM can also do it when writing unaligned data.
19:46:55Araqhmmm itertools sometimes uses an 'i' prefix
19:47:37flaviuJehan_: It seems that you have to explicitly ask for it each time you want it, so it doesn't look like a problem
19:47:48AraqI wonder how many people complained endlessly about that, comparing to hungarian notation
19:48:18Jehan_Heh.
19:48:30shevywhat's wrong with hungarian notation
19:49:20flaviushevy: Looks ugly
19:49:23flaviu:P
19:49:26shevyprogrammers are lazy when it comes to typing, save for the tireless java programmers
19:49:33shevyC++ templates look ugly too
19:49:40Araqbrb
19:49:46flaviuI dunno, I think its justified in this case, it isn't really convention
19:49:52Jehan_Araq: Tell you what, I'll put the combinatorics module in a Babel package. It can still go in the stdlib at some later point if there's sufficient interest.
19:50:00shevythe convention of laziness? :)
19:50:05shevylike the linux FHS
19:50:17flaviuthe windows API guys love their hungarian notation and uppercase type names
19:50:51flaviuINT_PTR WINAPI DialogBox( _In_opt_  HINSTANCE hInstance, _In_      LPCTSTR lpTemplate, _In_opt_  HWND hWndParent, _In_opt_  DLGPROC lpDialogFunc );
19:51:08shevyis that hungarian
19:51:13flaviuBeautiful :')
19:51:36flaviushevy: Yes, `hInstance`, `lpTemplate`, `hWndParent`, `lpDialogFunc`
19:51:40shevythen it seems as if there must be more than one hungarian notation about
19:52:36shevythe FHS mandates that you must have a directory called /var/lock/ :) http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES
19:53:04Jehan_Araq: Especially given that I probably should rename some of the functions for consistency with itertools, anyway. :)
19:53:06shevy /var/opt is also great - it stores variable data from /opt
19:54:10shevynotice the slight inconsistency: /opt is mandatory according to http://www.pathname.com/fhs/pub/fhs-2.3.html#OPTADDONAPPLICATIONSOFTWAREPACKAGES but there is no mandatory /var/usr/ or /var/usr/local
19:54:13shevyI <3 the FHS :)
19:54:30shevythe older ones even had a mandatory /usr/X11R6 directory
19:54:46shevynowadays it is only optional, but the reasoning for it was so funny
19:54:58shevybasically "because everyone was using it, so let's call it a standard thusly"
19:56:25*Trustable joined #nimrod
19:57:05*kunev quit (Quit: leaving)
19:58:18flaviuThis C code is weird
19:58:25flaviuhttps://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp#108
19:58:57*Puffin joined #nimrod
19:59:11flaviuHey, lets use a really convoluted method of iterating through each element that involves even weirder pointer arithmatic!
20:02:04*BitPuffin quit (Ping timeout: 260 seconds)
20:17:42AraqJehan_: ok, so make it a babel package
20:17:57Araqfine with me
20:18:20AraqVarriount, Varriount|Mobile can we release tomorrow?
20:18:23Jehan_Well, that's why I was asking originally -- there's always a risk of polluting the standard library. :)
20:19:05Araqthe stdlib is bloated, I'm also moving c2nim and pas2nim to its own repos
20:19:33Araqand I want to extract idetools and the docgen into its own .exes
20:23:47*crippa quit (Ping timeout: 264 seconds)
20:25:25dom96This is weird
20:25:49dom96Jester is slightly faster than standalone asynchttpserver
20:45:55*Puffin is now known as BitPuffin
20:47:23*wan joined #nimrod
20:50:32*silven quit (Ping timeout: 248 seconds)
20:57:41Araqmaybe you measure it wrong
21:07:54flaviuThe VM is doing pretty good; I can use the repl without crashes :D
21:08:46dom96Araq: Not sure how I can be measuring it wrong but oh well
21:09:12Araqdom96: did you go the 'dispatch' route for jester?
21:10:07*betawaffle joined #nimrod
21:10:11dom96Araq: yes
21:10:19Araqyay
21:10:31Araqthis means I like Jester now :-)
21:10:42Araqeven though it beats the shit out of the compiler
21:10:54dom96might be easier on the compiler now
21:10:55dom96maybe
21:11:02dom96Although now there are two levels of macros :D
21:11:26Araqwell before we had *4* levels of closures
21:13:03dom96yeah, you're right. I need to up the ante.
21:13:17dom968 levels of closures + 5 levels of macros it is
21:14:07Araqwell I think fowl still holds the "beat the shit out of the compiler when it comes to macros" record
21:14:31dom96bah really
21:14:50Araqwell his code scares me
21:15:37Araqbut unittest.nim also scares me
21:17:58Demosunittest.nim is nightmarefuel
21:20:30Demosis there a JSON parser around that makes use of the `.` overloading feature?
21:21:00AraqI don't think so but it should be easy to implement '.' on top
21:21:04Jehan_I have learned to minimize my use of macros the hard way. :)
21:21:20Jehan_Essentially I am using Nimrod as a Pascal dialect with a Pythonesque syntax and GC. :)
21:22:48AraqI'm still trying to unify macros and generics
21:23:28flaviuAraq: I have an idea on how to get rid of all VM bugs: Add an undocumented feature that makes macros that are too complicated not compile, like PLEASE in INTERCAL :P
21:23:59*q66 joined #nimrod
21:24:47Araqflaviu: something like "cannot map this code to the VM" might even be workable
21:25:05Demosthat makes CTFE much less appealing though
21:25:06Demos:D
21:25:25AraqDemos: well that's what we currently have, but with crashes instead
21:26:14flaviuExcept that crashes are actually somewhat useful in debugging
21:27:20flaviuAlthough easy debugging might be counterproductive, it makes things easier to fix and people less likely to report bugs
21:28:26dom96hrm, well it seems I was wrong
21:30:47Araqwooohooo
21:30:52Araqwatch out
21:31:01Araqmy first pull request ever
21:32:25*Fr4n quit (Ping timeout: 252 seconds)
21:33:07Demoswelcome to the project araq :D
21:36:36*Fr4n joined #nimrod
21:37:26fowlAraq, why does bad AST cause mysterious errors
21:37:49fowlsee #1309
21:37:57Araqfowl: I dunno it's a mystery
21:42:21flaviuYay, finally got MurmurHash3 to work!
21:44:22Araqflaviu: is that as good as SHA-1?
21:44:43flaviuIt isn't cryptographic, so no, but it is extremely fast
21:44:55AraqI want to base the future of the nimrod compiler on some hash function
21:44:57dom96flaviu: So what is it useful for?
21:45:04flaviudom96: Hashtables
21:45:12flaviuBloom filters, general purpose hashing
21:45:45Araqok, so ... do we have an SHA-1 implementation in Nimrod?
21:46:09Araqdom96: merge my PR!
21:46:18flaviuAraq: In babel, https://github.com/onionhammer/sha1/blob/master/sha1.nim
21:47:16AraqOrionPK: is your sha1 good enough for the compiler itself?
21:47:44*xenagi joined #nimrod
21:48:45dom96Araq: lol what? https://github.com/nimrod-code/c2nim/blob/master/c2nim.babel
21:48:55dom96So let me get this straight.
21:49:01dom96c2nim is a binary package right?
21:49:26dom96Not only did you not add 'bin = "c2nim"' but you also decided to skip the installation of c2nim.exe?
21:49:55*Fr4n quit (Ping timeout: 240 seconds)
21:50:27dom96That's funny. But I shouldn't laugh since it's your first PR and all.
21:50:28dom96Sorry :P
21:50:33*Fr4n joined #nimrod
21:50:37dom96Anyway, add that please and remove the skipfile
21:50:41flaviuMurmurhash3 is ~1byte/cycle; sha1 is ~ 0.087bytes/cycle according to https://code.google.com/p/smhasher/wiki/MurmurHash3_x86_32 and http://www.cryptopp.com/benchmarks.html
21:50:52Jehan_dom96: Feature request: It would be nice to be able to do a test install from a directory without committing first.
21:50:55dom96I suggest also adding a dependency on the Nimrod compiler.
21:51:02flaviuSHA-1 is actually faster than I thought
21:51:04dom96Jehan_: You can do that.
21:51:11Jehan_dom96: How?
21:51:19dom96Jehan_: just execute 'babel install' from the directory where your package resides in
21:51:24Araqdom96: ok, I misunderstood what SkipFiles means ...
21:51:44Jehan_Okay, that was kinda too obvious for me to try. :)
21:52:17dom96Araq: You may wanna use this next time :P https://github.com/nimrod-code/babel/blob/master/developers.markdown#optional
21:52:46*Varriount|Mobile quit (Remote host closed the connection)
21:53:27Araqppfff I didn't come this far by *reading* things
21:54:09*Nimrod_ joined #nimrod
21:54:56flaviuSkein Hash is maybe twice as fast as sha-1 and actually secure
21:56:29flaviuBLAKE is a couple of cycles per byte slower than Skein, and about as good
21:56:35dom96What about Keccak?
21:56:43dom96The 'Winner' according to Wikipedia? :P
21:57:18Jehan_dom96: Depends on what you want to do with it?
21:57:21*Nimrod quit (Ping timeout: 252 seconds)
21:57:59flaviudom96: Doesn't look that fast, about equal to speed to sha-1
21:59:13dom96I wonder what the NIST hash function competition judges the hash functions on.
21:59:23Jehan_If you're talking about cryptography, it's not all about cycles.
21:59:38flaviuJehan_: Not real crypto, just hash tables
21:59:59Jehan_flaviu: Yeah, but then you don't need cryptographic strength. :)
22:00:20flaviuBeing slightly broken won't cause anything worse than a tiny bit slower performance
22:00:25Jehan_Also, don't forget to test how they fare for short blocks. :)
22:00:28flaviuJehan_: Ask Araq
22:14:09AraqI plan to use it for hashing ASTs and type graphs
22:14:38AraqI will declare two ASTs as equal when their hashes are equal
22:14:48Araqso ... it needs to be strong enough
22:16:03Jehan_SHA-1 should work for that.
22:16:24Jehan_This is, after all, the exact same criterion that git uses.
22:21:23*Nimrod_ quit (Ping timeout: 264 seconds)
22:22:11OrionPKAraq idk, I ported it from C afaik
22:22:21OrionPKAraq why?
22:23:13*Nimrod joined #nimrod
22:38:31*lorxu joined #nimrod
22:39:58dom96hi lorxu
22:40:05lorxuHi
22:40:52lorxuI'm new in nimrod
22:41:26OrionPKhi lorxu
22:42:30lorxuHi
22:44:07*Jehan_ quit (Quit: Leaving)
22:56:09flaviuAraq: I guess SHA-1 might work better, but SHA-3 is stronger and more recent. MurmurHash3 also has 128-bit mode, and is strong against unintentional collision, although someone malicious could get collisions fairly easily.
23:00:20flaviuAlso keep in mind that each node in the AST increases the collision resistance by 1/2^32 for a 32 bit hash
23:07:57flaviuOn the other hand, SHA-1 might be the better choice beside all other factors (some weakness, a bit slow), because its actually been implemented in nimrod, which I assume is a pretty big factor in the decision
23:15:15fowl Rename sequtils.distnct to sequtils.deduplicate. #1318
23:15:16fowlhuh
23:18:49*darkf joined #nimrod
23:20:16NimBotdom96/jester new-async 2b17319 Dominik Picheta [+0 ±1 -0]: Fix incorrect Content-Length.
23:27:58*io2 quit ()
23:29:45*Fr4n quit (Quit: Leaving)
23:34:03Araqflaviu: what do you mean it *increases* the resistance?
23:39:33*Trustable quit (Quit: Leaving)
23:40:58*Matthias247 quit (Read error: Connection reset by peer)
23:44:03flaviuWhen you have one node, there is about 1/2^32 chance of collision. When you have two node, the ideal chance of collision (without anyone being malicious) is the chance of the first node having a collision times the chance of the second node having a collision is 1/2^2^32
23:44:32flaviuUnless you're only doing testing the top hash, in which case that doesn't happen
23:44:40flaviuI don't know how you're doing things
23:48:22Araqwell there are only 4 billion different bit combinations for a 32bit hash
23:48:38Araqthe number of potential ASTs is enormous
23:49:05Araqso collisions seem to be likely
23:49:40Araqand I don't know what it means "to add 1 node to increase the resistance"
23:51:18flaviuAraq: Sorry, I was misunderstanding how you want to do this, but what I mean is also checking the the childrens' hashes for equality
23:51:21*asterite joined #nimrod
23:52:33flaviuYou do want a long hash, and since SHA-1 is implemented, and there isn't a reason for someone to spend lots of money to attack the compiler, that would most likely be the best solution
23:52:42*Edelwin left #nimrod ("not here")
23:53:17flaviuI guess that most the time won't be spent calculating the hash, so you don't need a super-fast hash
23:53:37Araqhi asterite, how's crystal?
23:54:20Araqflaviu: I am not sure. could turn out to be expensive. I plan to use it a lot
23:54:29*joelmo quit (Quit: Connection closed for inactivity)
23:54:58flaviuYou can benchmark later too, and replacing the hash should be pretty easy if it turns out not to work
23:55:34Araqi bet it's meaningless anyway. the AST traversal takes more time than the actual hash function
23:55:52*asterite quit (Ping timeout: 260 seconds)
23:55:54*asterite1 joined #nimrod
23:58:15*xenagi|2 joined #nimrod
23:58:42Araqhi lorxu welcome
23:59:20*Mathnerd626 quit (Read error: Connection reset by peer)