Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Don, Saturday, February 21, 2009, 1:55:19 AM, you wrote: This is extremely depressing to read after the good results and lessons of this thread. you misunderstand, it is not personal! We just want something to sarcasm on. Something specific. -- Best regards, Bulat

Re[2]: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Khudyakov, Saturday, February 21, 2009, 2:07:39 AM, you wrote: I have another question. Why shouldn't compiler realize that `sum [1..10^9]' is constant and thus evaluate it at compile time? since we expect that compilation will be done in reasonable amount of time. you cannot guarantee

Re[4]: [Haskell-cafe] speed: ghc vs gcc vs jhc

2009-02-20 Thread Bulat Ziganshin
Hello John, Saturday, February 21, 2009, 2:14:25 AM, you wrote: Heh. He probably meant something more like jhc is not a production compiler which is true for a lot of projects. For projects of substantial size or that require many extensions, jhc falls somewhat short. It is getting better

Re[6]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Peter, Saturday, February 21, 2009, 2:36:15 AM, you wrote: nothing should stop you from writing video games in Haskell since video codec isn't video game :))) but I've worked with people that wrote physics engines in C/C++, and they also had to hand optimize specifically for a certain

Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Sebastian, Saturday, February 21, 2009, 2:42:33 AM, you wrote: Bulat, please, you're missing the point. actually you are missing the point. i mirror Don's non-attacking style of comments on my person. are you mentioned those Don letter? sure - no Nobody is saying that the

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Achim, Saturday, February 21, 2009, 2:37:55 AM, you wrote: not having enough weight in the shootout. For now, you can just use TH to force things getting evaluated. (Try to do that in C) they have Templates axe too :) -- Best regards, Bulat

Re[2]: [Haskell-cafe] speed: ghc vs gcc vs jhc

2009-02-20 Thread Bulat Ziganshin
Hello John, Saturday, February 21, 2009, 2:49:25 AM, you wrote: what is substantial size? can jhc be used for video codec, i.e. probably no extensions - just raw computations, and thousands or tens of thousands LOCs? Perhaps. A bigger issue in practice is that the larger a program is, the

Re[2]: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Xiao-Yong, Saturday, February 21, 2009, 3:16:28 AM, you wrote: some C++ compilers can already do this (profile based optimization). Rumor says firefox needs profile based optimization to run faster. Or it is not a rumor at all. why it's rumor? PGO is natural optimization technique,

Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Bulat Ziganshin
Hello Isaac, Saturday, February 21, 2009, 3:28:31 AM, you wrote: When did you look - six months ago? a year ago? 3 years ago? ah, again this argument. two weeks ago Don said that ghc changed a lot in 2 years, now when we see that there is no difference, he says that those loop optimizer is

Re[2]: [Haskell-cafe] speed: ghc vs gcc vs jhc

2009-02-20 Thread Bulat Ziganshin
Hello John, Saturday, February 21, 2009, 3:42:24 AM, you wrote: this is true for *application* code, but for codec you may have lots of code that just compute, compute, compute Yes indeed. If there is code like this out there for haskell, I would love to add it as a test case for jhc.

[Haskell-cafe] Re[2]: Ready for testing: Unicode support for Handle I/O

2009-02-19 Thread Bulat Ziganshin
Hello Simon, Thursday, February 19, 2009, 3:21:03 PM, you wrote: Correct - I'm aware that there's a problem with filenames, but it hasn't been tackled yet. There probably isn't anything sensible that we can do without changing FilePath into an ADT. i think that FilePath=String is ok, we

[Haskell-cafe] Re[2]: Ready for testing: Unicode support for Handle I/O

2009-02-19 Thread Bulat Ziganshin
Hello Khudyakov, Thursday, February 19, 2009, 4:06:06 PM, you wrote: i think that FilePath=String is ok, we just need to use utf8 string encoding on unix/macs and utf-16 encoding with *W functions on Windows. i have implemented such support inside my own application, and would be happy to

Re: [Haskell-cafe] Uses of `fix' combinator

2009-02-19 Thread Bulat Ziganshin
Hello Khudyakov, Thursday, February 19, 2009, 5:00:03 PM, you wrote: I have two questions. How could this function be used? I'm unable to imagine any. Naive approach lead to nothing (no surprise): fix (1:) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

Re[2]: [Haskell-cafe] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-18 Thread Bulat Ziganshin
Hello Wolfgang, Wednesday, February 18, 2009, 12:17:16 PM, you wrote: Win32-based backend would make more sense as it is one less layer to deal with. But how? Same thing with Mac. A student of mine wrote a fully automatic binding generator for C++ libraries which also supports Qt extensions

Re: [Haskell-cafe] estimating the speed of operation

2009-02-18 Thread Bulat Ziganshin
Hello Belka, Wednesday, February 18, 2009, 1:15:32 PM, you wrote: sequence_ (replicate n (return $ md5 input_row)) $! -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing

Re[2]: [Haskell-cafe] question on types

2009-02-18 Thread Bulat Ziganshin
Hello Conor, Wednesday, February 18, 2009, 4:12:07 PM, you wrote: type-level integers that don't suck and then some... Start date will be October 2009 or so. hurray!!! -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

[Haskell-cafe] How to create an online poll

2009-02-18 Thread Bulat Ziganshin
Hello haskell-cafe, http://zohopolls.com/ -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Race condition possible?

2009-02-13 Thread Bulat Ziganshin
Hello Peter, Friday, February 13, 2009, 2:17:52 AM, you wrote: If so, how would it be possible to make sure that the operation of reading the current time and writing the pair to the MVar is an atomic operation, in the sense that no thread switch can happen between the two? Would this

Re[2]: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Bulat Ziganshin
Hello Jamie, Wednesday, February 11, 2009, 5:54:09 AM, you wrote: Seems like it is ok to write H.264 in Haskell and released via GPL license? anyway it's impossible due to slow code generated by ghc -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

Re[2]: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Bulat Ziganshin
Hello Don, Wednesday, February 11, 2009, 8:28:33 PM, you wrote: anyway it's impossible due to slow code generated by ghc Been a long time since you did high perf code -- we routinely now write code that previously was considered not feasible. which is still slower than C and need more time

[Haskell-cafe] Re[2]: [Haskell] Google Summer of Code

2009-02-11 Thread Bulat Ziganshin
Hello John, Wednesday, February 11, 2009, 8:54:35 PM, you wrote: I know you've talked about performance in the past, and I don't want to start a huge argument, but do you have recent data to back this up? IIRC you're using ghc 6.6, yes? i don't seen examples of high-performance code written

[Haskell-cafe] Re[4]: [Haskell] Google Summer of Code

2009-02-11 Thread Bulat Ziganshin
Hello John, Wednesday, February 11, 2009, 11:55:47 PM, you wrote: it's exactly example of tight loop. and let's compare HP code written for this task with analogous code written in C. i expect that haskell code is much more complex I think it's fair to point out that tight loops are nearly

Re[2]: [Haskell-cafe] Re: [Haskell] Google Summer of Code 2009

2009-02-11 Thread Bulat Ziganshin
Hello Don, Wednesday, February 11, 2009, 11:58:13 PM, you wrote: fast as possible, but i don't know anyone using haskell to write high-performance code. so you ask for non-existing specialists We're doing it at Galois regularly. Check out the blog. i scanned through

Re[2]: [Haskell-cafe] Re[4]: [Haskell] Google Summer of Code

2009-02-11 Thread Bulat Ziganshin
Hello Don, Thursday, February 12, 2009, 12:23:16 AM, you wrote: Check out what GHC is doing these days, and come back with an analysis of what still needs to be improved. We can't wait to hear! can you point me to any haskell code that is as fast as it's C equivalent? -- Best regards,

Re[2]: [Haskell-cafe] Re[4]: [Haskell] Google Summer of Code

2009-02-11 Thread Bulat Ziganshin
Hello Don, Thursday, February 12, 2009, 3:45:36 AM, you wrote: You should do your own benchmarking! well, when you say that ghc can generate code that is fast as gcc, i expect that you can supply some arguments. is the your only argument that ghc was improved in last years? :) -- Best

Re: [Haskell-cafe] Efficient string output

2009-02-09 Thread Bulat Ziganshin
Hello Ketil, Monday, February 9, 2009, 2:49:05 PM, you wrote: in B.concat [f1,pack \t,pack (show f2),...] inelegance were it only fast - but this ends up taking the better part of the execution time. i'm not a BS expert but it seems that you produce Strings using show

Re: [Haskell-cafe] threadDelay

2009-02-09 Thread Bulat Ziganshin
Hello Immanuel, Monday, February 9, 2009, 3:42:24 PM, you wrote: Am I correct in assuming this program should run 100 secs? real    0m0.104s may be, 100 msecs? :) -- | Suspends the current thread for a given number of microseconds -- (GHC only). -- Best regards, Bulat

Re: [Haskell-cafe] lazy evaluation is not complete

2009-02-09 Thread Bulat Ziganshin
Hello Peter, Monday, February 9, 2009, 5:10:22 PM, you wrote: If run with ghci, foo 5 does not terminate, i.e., Haskell does not look for all outermost redices in parallel. Why? For efficiency reasons? of course. if you will create new thread for every cpu instruction executed, you will

Re: [Haskell-cafe] Why does sleep not work?

2009-02-09 Thread Bulat Ziganshin
Hello John, Tuesday, February 10, 2009, 12:35:25 AM, you wrote: I am finding that using the sleep function doesn't sleep at all, whereas using threadDelay does: Anybody know what's happening? 1) this depends on your sleep definition 2) read threadDelay docs -- Best regards, Bulat

Re[2]: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-07 Thread Bulat Ziganshin
Hello Khudyakov, Saturday, February 7, 2009, 4:01:57 PM, you wrote: How do you plan to handle filenames? Currently FilePath is simply a string. i think that this patch does nothing to unicode filenames support -- Best regards, Bulat

Re[2]: [Haskell-cafe] The Haskell re-branding exercise

2009-02-07 Thread Bulat Ziganshin
Hello Don, Saturday, February 7, 2009, 8:20:23 PM, you wrote: We need a voting site set up. There was some progress prior to the end of the year. Updates welcome! i think that there are a lot of free voting/survey services available. the last one i went through was LimeSurvey available for

Re: [Haskell-cafe] (Off-topic) CUDA

2009-02-06 Thread Bulat Ziganshin
Hello Andrew, Thursday, February 5, 2009, 11:10:42 AM, you wrote: Does anybody know how to make this stuff actually work? nvidia has cuda site where you can download sdk. afair, dr dobbs journal has (online) series of arcticles which describes how to program it step-by-step (Also... Haskell

Re[2]: [Haskell-cafe] How to properly design a Haskell TK

2009-02-06 Thread Bulat Ziganshin
Hello Luke, Friday, February 6, 2009, 11:09:45 AM, you wrote: I've been thinking a bit, and come to the conclusion that we should just do it as others did it before: Start off with application-specific tk's, figure out what's cool and what's compatible and then put them into libraries.

Re[2]: [Haskell-cafe] (Off-topic) CUDA

2009-02-06 Thread Bulat Ziganshin
Hello Malcolm, Friday, February 6, 2009, 11:49:56 AM, you wrote: gpu is just set of simd-like instructions. so the reason why you will never see haskell on gpu is the same as why you will never see it implemented via simd instructions :D Because SIMD/GPU deals only with numbers, not

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-05 Thread Bulat Ziganshin
Hello Gregg, Thursday, February 5, 2009, 6:20:06 PM, you wrote: An optimizer can see that the result of the first getChar is discarded and replace the entire expression with one getChar without changing the formal semantics.  this is prohibited by using pseudo-value of type RealWorld which

[Haskell-cafe] pure crisis :)

2009-02-01 Thread Bulat Ziganshin
Hello haskell-cafe, pure functional denotation for crisis: (_|_) -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] ANN: filestore 0.1

2009-01-24 Thread Bulat Ziganshin
Hello Gwern, Sunday, January 25, 2009, 2:56:07 AM, you wrote: my usual complaint: it will be great to see all announces duplicated in main haskell list ANN filestore 0.1 We are pleased to announce the first release of a new library, filestore. What is it? filestore provides a uniform,

[Haskell-cafe] Elegant external sorting

2009-01-22 Thread Bulat Ziganshin
Hello haskell-cafe, SPJ asked us a few years ago about examples of simple and elegant haskell programs. i want to propose this external sorting program: it reads stdin in chunks of 5000 lines, writes sorted chunks into files and then merges files together: import Data.List import Control.Monad

Re[2]: [Haskell-cafe] Haskell mode for Emacs question

2009-01-22 Thread Bulat Ziganshin
Hello John, Thursday, January 22, 2009, 8:50:39 PM, you wrote: thanks, support of over-internet and intranet collaboration looks very promising these days (even if not saying about ability to highlight error place ;) btw, i was unable to download mp4 video from http://vimeo.com/1653402 (online

Re: [Haskell-cafe] Question about allocaArray and friends

2009-01-22 Thread Bulat Ziganshin
Hello Patrick, Friday, January 23, 2009, 1:22:21 AM, you wrote: In C, if you try to alloca too much memory, then the stack gets overwritten and bad things happen. Does GHC exhibit the same behavior with allocaArray and the like? Is there a way to find out how much is safe to allocate?

Re[2]: [Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-17 Thread Bulat Ziganshin
Hello Luke, Saturday, January 17, 2009, 3:16:06 PM, you wrote:   fmap id = id   fmap (f . g) = fmap f . fmap g  The first property is how we write preserving underlying structure, but this has a precise, well-defined meaning that we can say a given functor obeys or it does not (and if it

Re[2]: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-16 Thread Bulat Ziganshin
Hello david48, Friday, January 16, 2009, 4:16:51 PM, you wrote: Upon reading this thread, I asked myself : what's a monoid ? I had no idea. I read some posts, then google haskell monoid. it would be interesting to google C++ class or Lisp function and compare experience :) -- Best regards,

Re: [Haskell-cafe] What could be considered standard Haskell these days?

2009-01-16 Thread Bulat Ziganshin
Hello Mauricio, Friday, January 16, 2009, 5:00:58 PM, you wrote: So: if someone wants to learn the details of the language, what could be the subset of extensions one should learn and make regular use, and also include in code supposed to be used by others in the long term? probably

Re[2]: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-16 Thread Bulat Ziganshin
Hello Sigbjorn, Friday, January 16, 2009, 5:42:06 PM, you wrote: first question: are these packages (http, curl, curl-shell, webclient) windows-compatible? second - that is advantages of using http (or webclient) over curl? sorry if questions are stupid - i'm pretty ignorant here :) Thanks

Re[2]: [Haskell-cafe] Re: Haskell and C++ program

2009-01-15 Thread Bulat Ziganshin
Hello Eugene, Thursday, January 15, 2009, 3:27:59 PM, you wrote: but at least length.map show is eq to length :) Well, your program is not equivalent to the C++ version, since it doesn't bail on incorrect input. 2009/1/15 Apfelmus, Heinrich apfel...@quantentunnel.de: Jonathan Cast wrote:

Re[2]: [Haskell-cafe] Haskell and C++ program

2009-01-14 Thread Bulat Ziganshin
Hello Jonathan, Thursday, January 15, 2009, 1:41:23 AM, you wrote: reverseDouble = unlines . intro . map show . reverse . map (read :: String - Double) . takeWhile (/= end) . words using arrows, this may be reversed: reverseDouble =

Re[2]: [Haskell-cafe] Re: Monads aren't evil

2009-01-11 Thread Bulat Ziganshin
Hello Miguel, Sunday, January 11, 2009, 7:06:54 PM, you wrote: I believe it was Bulat Ziganshin who once proposed parsing x + y*z + t as x + (y * z) + t and x + y * z + t as (x + y) * (z + t) x+y * z+t should be here -- Best regards, Bulat

Re[2]: [Haskell-cafe] Looking for Haskellers on Windows

2009-01-10 Thread Bulat Ziganshin
on Windows. Günther Am 10.01.2009, 15:18 Uhr, schrieb Bulat Ziganshin bulat.zigans...@gmail.com: Hello Günther, Saturday, January 10, 2009, 5:03:18 PM, you wrote: there are lot of windows haskellers so you can just write your questions in haskell-cafe Hi all, I'm looking for Haskell

Re: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Bulat Ziganshin
Hello Mauricio, Friday, January 9, 2009, 4:01:18 PM, you wrote: computer has been turned on would do all I need. Or, maybe, how much has elapsed since the program started. i think you should look into system counters (if you on windows). for example, task managet in vista shows time since

Re[2]: [Haskell-cafe] Re: Computer time, independent of date

2009-01-09 Thread Bulat Ziganshin
-Rdtsc.html Regards, CS 2009/1/9 Bulat Ziganshin bulat.zigans...@gmail.com Hello Mauricio, Friday, January 9, 2009, 4:01:18 PM, you wrote: computer has been turned on would do all I need. Or, maybe, how much has elapsed since the program started. i think you should look

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 0.4.8

2009-01-08 Thread Bulat Ziganshin
Hello Max, Friday, January 9, 2009, 4:15:48 AM, you wrote: Otherwise, Notepad++ appears to have Unicode support. even notepad (on my vista box) supports utf-8, utf16be and utf16le :))) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

Re: [Haskell-cafe] Blitting one IOUArray into another

2009-01-07 Thread Bulat Ziganshin
Hello Denis, Wednesday, January 7, 2009, 6:56:36 PM, you wrote: memory allocated for i :))) each new copy of i needs one word. the situation was much worse with Int64, of course :) Hi all, I'm seeing a lot of unexpected memory allocation with some simple code that copies the contents of

Re: [Haskell-cafe] pattern matching on date type

2009-01-01 Thread Bulat Ziganshin
Hello Max.cs, Thursday, January 1, 2009, 11:36:24 AM, you wrote: seems that you come from dynamic languages :) Haskell has static typing meaning that your function can accept either Tree or a as arguments. so you should convert a to Tree explicitly, using Leaf thanks!  

Re: [Haskell-cafe] Cross compiling from Linux to windows?

2008-12-28 Thread Bulat Ziganshin
Hello Erik, Monday, December 29, 2008, 2:31:40 AM, you wrote: ghc doesn't support cross-compilation I've googled for this but haven't really found an answer yet. Is it possible to build (or better yet download) a GHC compiler that runs on Linux and generates windows binaries? I already use

Re: [Haskell-cafe] Timing difference

2008-12-25 Thread Bulat Ziganshin
Hello Aai, Thursday, December 25, 2008, 11:45:33 AM, you wrote: remarkable (that's to say: for me) difference in timing using lambda function in the one case and point free in the other. Timing was measured in GHCi. Compiled there's no difference! compiler optimizes program, replacing slower

Re[2]: [Haskell-cafe] Trouble with the ST monad

2008-12-22 Thread Bulat Ziganshin
Hello Andre, Monday, December 22, 2008, 4:44:34 AM, you wrote: Is there any difference between using freeze/thaw from Data.Array.MArray versus freezeSTArray/thawSTArray from GHC.Arr? portability, at least -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

Re[2]: [Haskell-cafe] Re: Threads with high CPU usage

2008-12-22 Thread Bulat Ziganshin
Hello Günther, Monday, December 22, 2008, 1:57:22 AM, you wrote: try -threaded, +RTS -N2, and forkOS simultaneously. it may work - i don't see reasons why other threads should be freezd why one does unsafe call nother solution is to compile library with unsafe call changed to safe. this change

Re[2]: [Haskell-cafe] Re: Threads with high CPU usage

2008-12-22 Thread Bulat Ziganshin
Hello John, Monday, December 22, 2008, 5:15:46 PM, you wrote: And in general we would not even bother with considering using unsafe for calls that are already expensive. It's only worth considering when the length of the call is always very short. the other way to look at it is to measure

Re[2]: [Haskell-cafe] Re: Threads with high CPU usage

2008-12-22 Thread Bulat Ziganshin
Hello Alistair, Monday, December 22, 2008, 7:28:03 PM, you wrote: safe). I also was not aware of unsafe calls blocking other threads. they don't to it directly. but without -threaded +RTS -N (or forkOS) there is only 1 OS thread that runs all haskell threads. unsafe call blocks it untill call

Re: [Haskell-cafe] concurrent haskell: thread priorities

2008-12-22 Thread Bulat Ziganshin
Hello Neal, Monday, December 22, 2008, 11:07:32 PM, you wrote: The threaded RT creates an OS thread for each CPU/core on the system and uses them to multiplex userland threads. These are context switched whenever they block/yield/gc and no priorities can be assigned. not exactly. amount of

Re[2]: [Haskell-cafe] Re: [Haskell] ANN: HLint 1.0

2008-12-20 Thread Bulat Ziganshin
Hello Martijn, Saturday, December 20, 2008, 4:38:10 PM, you wrote: Why not: (4 == length TAG ) (TAG `isPrefixOf` just_name pinfo) I assume the (==) referred to in the name of the fix is the one in the suggestion. Why doesn't the suggestion come with the check removed? I.e.: due to Turing

Re: [Haskell-cafe] Beginner's TH question

2008-12-20 Thread Bulat Ziganshin
Hello Jeff, Saturday, December 20, 2008, 6:59:42 PM, you wrote: my experience tells that you should insert whole language sentences, like $(add_fields [d| data T = T { myfield :: Field, ... } ] ) where original declaration passed as a parameter Two things... can I add fields to records

Re[2]: [Haskell-cafe] Coroutines

2008-12-18 Thread Bulat Ziganshin
Hello Miguel, Thursday, December 18, 2008, 1:42:21 PM, you wrote: ruby doesn't support coroutines, but only iterators (where control moved from caller to callee). usually control is on the caller side, and coroutines gives control to both (or many) sides coroutines are easily emulated in IO

Re[4]: [Haskell-cafe] Coroutines

2008-12-18 Thread Bulat Ziganshin
Hello Brandon, Thursday, December 18, 2008, 7:05:05 PM, you wrote: ruby doesn't support coroutines, but only iterators (where control moved from caller to callee). usually control is on the caller side, and coroutines gives control to both (or many) sides Right, and you don't normally do

Re: [Haskell-cafe] Re: Threads not running under GHC 6.10?

2008-12-17 Thread Bulat Ziganshin
Hello Simon, Wednesday, December 17, 2008, 4:05:48 PM, you wrote: I'm afraid the underlying problem is one that GHC has always had - that we can't preempt threads that aren't allocating. It's not easily fixable, we would have to inject dummy heap checks into every non-allocating loop, which

Re[2]: [Haskell-cafe] Memoization-question

2008-12-11 Thread Bulat Ziganshin
Hello Daniel, Thursday, December 11, 2008, 11:09:46 PM, you wrote: you is almost right. but ghc don't share results of function calls despite their type. it just assumes that value of any type may use a lot of memory even if this type is trivial :) example when automatic sharing is very bad

Re[2]: [Haskell-cafe] Memoization-question

2008-12-11 Thread Bulat Ziganshin
Hello Daniel, Thursday, December 11, 2008, 11:49:40 PM, you wrote: sorry fo r noise, it seems that i know ghc worse than you Am Donnerstag, 11. Dezember 2008 21:11 schrieb Bulat Ziganshin: Hello Daniel, Thursday, December 11, 2008, 11:09:46 PM, you wrote: you is almost right. but ghc

[Haskell-cafe] Translating RWH into other languages

2008-12-10 Thread Bulat Ziganshin
Hello Don, There is a team of people which want to translate RWH book into Russian. is it ok? can you help us by establishing subversion of RWH book on your site. if it will contain copy of the English book for the beginning and allow team members to further edit it - it will be great! -- Best

Re: [Haskell-cafe] Why does instance Ord Pat causes loop

2008-12-08 Thread Bulat Ziganshin
Hello Martin, Monday, December 8, 2008, 12:04:06 PM, you wrote: Now it took me about a week to realise, that 'instance Ord Pat' causes ghc to loop. naive Ord instance Ord Exp instance Ord Pat i think you just don't learned this part of Haskell. empty instance declarations like these

Re: [Haskell-cafe] Re: Gluing pipes

2008-12-05 Thread Bulat Ziganshin
Hello Stefan, Friday, December 5, 2008, 8:35:18 PM, you wrote: \ x y - f (g x) (h y) [...] f $. g ~ h ~ id I keep help wonder: other than a 5 chars, what is it we have gained? Haskell programmers would be paid more :D -- Best regards, Bulatmailto:[EMAIL

Re: [Haskell-cafe] handles and foreign C functions

2008-12-03 Thread Bulat Ziganshin
Hello Andrea, Wednesday, December 3, 2008, 5:09:21 PM, you wrote: How can I pass to printStuff a stdout FILE pointer? afair, stdout syntax used to import variables. it was discussed just a day or two ago :) -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re[2]: [Haskell-cafe] gmp license == no commercial/closed source haskell software ??

2008-12-03 Thread Bulat Ziganshin
Hello Don, Wednesday, December 3, 2008, 5:36:57 PM, you wrote: From my understanding, the gmp is GPL, GHC statically links it on windows. GMP is *LGPL*. Supporting this is trivial with a dynamically linked / DLL libgmp. the whole problem is that it links in statically, that reduces license

Re[2]: [Haskell-cafe] handles and foreign C functions

2008-12-03 Thread Bulat Ziganshin
Hello Andrea, Wednesday, December 3, 2008, 7:23:20 PM, you wrote: either some error in the code (i neevr used this feature) or stdout may be defile by a macro. can you try to define function for it: FILE *out() {return stdout;} On Wed, Dec 03, 2008 at 07:08:00PM +0300, Bulat Ziganshin wrote

Re[2]: [Haskell-cafe] import

2008-12-02 Thread Bulat Ziganshin
System.Stream.Class import System.Stream.Transformer import System.Stream.Instance import System.Stream.Utils specifically I am concerned about ByteString and underlying nodes .. ??? On Tue, Dec 2, 2008 at 3:45 AM, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Vasili, Tuesday

Re: [Haskell-cafe] import

2008-12-02 Thread Bulat Ziganshin
Hello Vasili, Tuesday, December 2, 2008, 11:48:40 AM, you wrote: I am a little uncertain about import semantics in a hierarchical package ... i.e. if I import the root of a package root do I get everything under the root's namespace, i.e. the namespace tree? no. you import just *module*,

Re[2]: [Haskell-cafe] GHC on Fedora 10 - getMBlock: mmap: Permission denied

2008-12-02 Thread Bulat Ziganshin
Hello Fraser, Tuesday, December 2, 2008, 6:34:19 PM, you wrote: search in GHC tracker: afair there was some SELinux-releated report Why didn't that occur to me?  I should get more sleep. Thanks for the tip.  Now I know that it definitely is SELinux, a system I understand not at all, I

Re[2]: [Haskell-cafe] ANN: Real World Haskell, now shipping

2008-11-29 Thread Bulat Ziganshin
Hello Jason, Saturday, November 29, 2008, 5:55:06 PM, you wrote: It seems to be an unwritten law that any package involving non-Haskell components doesn't work on Windoze. Well, I'll have a chance to verify this soon enough. Have you posted your errors somewhere? unfortunately, HsLua

Re[4]: [Haskell-cafe] ANN: Real World Haskell, now shipping

2008-11-29 Thread Bulat Ziganshin
Hello Duncan, Saturday, November 29, 2008, 7:49:52 PM, you wrote: It seems to be an unwritten law that any package involving non-Haskell components doesn't work on Windoze. unfortunately, HsLua already breaks the law :) How so? it has C code and works on windows -- Best regards,

Re[2]: [Haskell-cafe] Re: Go Haskell! - array libraries

2008-11-29 Thread Bulat Ziganshin
Hello Andrew, Saturday, November 29, 2008, 9:23:29 PM, you wrote: This goes beyond array libraries; do you have any idea how many binary packages there are? i wrote 3 :))) -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re[2]: [Haskell-cafe] Compilers

2008-11-29 Thread Bulat Ziganshin
Hello Daniel, Sunday, November 30, 2008, 1:41:03 AM, you wrote: Yes, that's very nice to be able to just type $ cabal update $ cabal install whatever and cabal automatically takes care of dependencies (unfortunately only Haskell i have to mention that there are no haskell compilers that

Re: [Haskell-cafe] Using Parsec with other monads

2008-11-28 Thread Bulat Ziganshin
Hello Roly, Saturday, November 29, 2008, 2:27:22 AM, you wrote: Now it seems I can't actually do that in a nice way because Parsec appears to be fixed to a simple State monad. afaik, version 3 is implemented as monad transformer -- Best regards, Bulat

Re[2]: [Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Bulat Ziganshin
Hello Daniel, Thursday, November 27, 2008, 4:43:08 PM, you wrote: Another possibility is using the Amazon EC2 functionality and rent a high-CPU instance (http://aws.amazon.com/ec2/#instance) for as long as these are virtual cores, which isn't appropriate for measuring performance on real 4/8

Re[2]: [Haskell-cafe] workarounds for Codec.Compression.Zlib errors in darcs

2008-11-26 Thread Bulat Ziganshin
Hello Duncan, Thursday, November 27, 2008, 1:28:21 AM, you wrote: checking mode rather than in a generating mode. It would use much of the same code as c2hs but it would read the C header files and the .hs file (via ghc api) and check that the FFI imports are using the right types. there is

Re[2]: [Haskell-cafe] Windows vs. Linux x64

2008-11-25 Thread Bulat Ziganshin
Hello Don, Tuesday, November 25, 2008, 1:59:02 AM, you wrote: Is Windows running in 32 bit? What gcc versions are you using on each system? there is no 64-bit ghc for windows yet, and i think that 64-bit windows runs 32-bit programs as fast as 32-bit windows this problem naturally splits into

Re: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread Bulat Ziganshin
Hello David, Tuesday, November 25, 2008, 4:45:28 PM, you wrote: However, I am getting very poor performance due to the GC copying 6G in each run. The only explanation that I can think of is that it is copying my giant array. each GC run? each program run? try to increase size of your array

Re[2]: [Haskell-cafe] Data.Array.Storable vs GC

2008-11-25 Thread Bulat Ziganshin
Hello David, Tuesday, November 25, 2008, 5:27:51 PM, you wrote: When I was researching how to do this, I was really hoping for something like static areas from the Lisp Machine operating system. You could allocate any normal object in an area of the heap where the GC would not bother with

Re[4]: [Haskell-cafe] Password hashing

2008-11-25 Thread Bulat Ziganshin
Hello Thomas, Tuesday, November 25, 2008, 6:39:27 PM, you wrote: Just to note, the comment about md5 is incorrect. I switched to SHA512 as you can see in the code. really? :) Right s - -- return . show . md5 . L.pack $ p ++ s typical salt usage is generation of new salt for every

Re[6]: [Haskell-cafe] Password hashing

2008-11-25 Thread Bulat Ziganshin
(show . ord) . take 1000 2008/11/25 Bulat Ziganshin [EMAIL PROTECTED]: Hello Thomas, Tuesday, November 25, 2008, 6:39:27 PM, you wrote: Just to note, the comment about md5 is incorrect. I switched to SHA512 as you can see in the code. really? :) Right s - -- return . show . md5

Re[2]: [Haskell-cafe] Interactive

2008-11-25 Thread Bulat Ziganshin
Hello Andrew, Tuesday, November 25, 2008, 9:43:11 PM, you wrote: OOP seems like such a natural fit for describing the behaviour of a network of independent objects. But Haskell seems to require you to make a new, modified copy of the entire game state at each frame, which sounds... highly

Re[2]: [Haskell-cafe] How to use Unicode strings?

2008-11-23 Thread Bulat Ziganshin
Hello Alexey, Sunday, November 23, 2008, 10:20:47 AM, you wrote: And this problem related not only to IO. It raises whenever strings cross border between haskell world and outside world. Opening files with unicode names, execing, etc. this completely depends on libraries, and ghc-bundled i/o

Re: [Haskell-cafe] UArray Word16 Word32 uses twice as much memory as it should?

2008-11-19 Thread Bulat Ziganshin
Hello Arne, Wednesday, November 19, 2008, 11:57:01 AM, you wrote: finding that it uses about twice as much memory as I had anticipated. it may be 1) GC problem (due to GC haskell programs occupies 2-3x more memory than actually used) 2) additional data (you not said how long each small array.

Re: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-18 Thread Bulat Ziganshin
Hello kenny, Tuesday, November 18, 2008, 1:37:36 PM, you wrote: The above number shows that my implementations of python style dictionary  are space/time in-efficient as compared to python. thanks, interesting code 1. why you think that your code should be faster? pythob implementation is

Re[2]: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-18 Thread Bulat Ziganshin
Hello kenny, Tuesday, November 18, 2008, 2:34:25 PM, you wrote: I am not hoping that my code should be faster, but at least not as slow as what it gets. Basically I am looking for an implementation which is close to the one in python. well, if haskell will allow to produce code not slower

Re[2]: [Haskell-cafe] implementing python-style dictionary in Haskell

2008-11-18 Thread Bulat Ziganshin
Hello Tillmann, Tuesday, November 18, 2008, 2:46:47 PM, you wrote: Why should a Haskell hash table need more memory then a Python hash table? I've heard that Data.HashTable is bad, so maybe writing a good one could be an option. about Data.HashTable: it uses one huge array to store all the

Re: [Haskell-cafe] Re: Type question in instance of a class

2008-11-17 Thread Bulat Ziganshin
Hello Maurí­cio, Monday, November 17, 2008, 9:38:06 PM, you wrote: (...) One way to code this would be to use functional dependencies: class MyClass r s | r - s where function :: r - s One additional problem is that I (believe I) need that my class takes just one type FDs with just

Re: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Bulat Ziganshin
Hello Maurí­cio, Monday, November 17, 2008, 12:32:11 AM, you wrote: class MyClass r where function :: r - s this tells that f may return value of any type requested at the call site, i.e. one can write main = do print (f (Mydata 1) :: String) print (f (Mydata 1) :: [Bool])

Re[2]: [Haskell-cafe] Type question in instance of a class

2008-11-16 Thread Bulat Ziganshin
Hello J., Monday, November 17, 2008, 12:56:02 AM, you wrote: class MyClass r where function :: r - s As Bulat said, your type signature is equivalent to: function :: forall r s. r - s only function :: forall s. r - s (r is fixed in class header) -- Best regards, Bulat

Re: [Haskell-cafe] Begginer question about alignment in Storable

2008-11-15 Thread Bulat Ziganshin
Hello Maurí­cio, Saturday, November 15, 2008, 11:29:23 PM, you wrote: struct { double w[2]; } Can I assume that its function 'alignment' should return the same as alignment (1::CDouble)? Or should it be 2 * alignment (1::CDouble)? secind - definitely not. first - probably yes --

Re[2]: [Haskell-cafe] Calling Haskell from other languages?

2008-11-11 Thread Bulat Ziganshin
Hello Colin, Tuesday, November 11, 2008, 8:09:09 PM, you wrote: If I want to call Haskell (and I do, perhaps) from another garbage-collected language (Eiffel, in particular) using C as the mutually understood language, am I not going to run into big problems? of course not. there will be two

Re: [Haskell-cafe] mapping unfreeze over an IntMap of IOUArrays

2008-11-11 Thread Bulat Ziganshin
Hello Chad, Tuesday, November 11, 2008, 10:23:09 PM, you wrote: using unsafeFreeze. I'm getting stuck here, since the IntMap library is not so monad-friendly. Data.Hashtable is -- Best regards, Bulatmailto:[EMAIL PROTECTED]

<    1   2   3   4   5   6   7   8   9   10   >