Re: [Haskell-cafe] Knight Capital debacle and software correctness

2012-08-04 Thread Florian Weimer
* Vasili I. Galchin: I am going to make an assumption except for Jane Street Capital all/most Wall Street software is written in an imperative language. I expect that most of it is written in Excel, which doesn't really qualify as an imperative language. High-frequency trading is

Re: [Haskell-cafe] Best way to build a GHC backend?

2012-07-08 Thread Florian Weimer
* Niklas Larsson: http://www.haskell.org/haskellwiki/GHC/FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F It would make a lot of sense to give GHC a .NET or JVM back end, and it's a question that comes up regularly. The reason that we haven't done it here, at GHC HQ, is because it's a

Re: renamed GMP symbols in GHC

2012-01-05 Thread Florian Weimer
* Simon Marlow: One potential problem is that some Linux distributions really don't like it if you bundle modified versions of external libraries. However, I just don't see a way around this: GMP is inherently broken because it has global state, so if you want two use it from two clients in

Re: REQ: add a non-closing version of handleToFd

2011-10-06 Thread Florian Weimer
* Simon Marlow: There's another danger. A Handle has an associated finalizer that closes the file descriptor when the Handle is no longer needed by the program, so you can't make a handleToFd_noClose because the Handle might be closed anyway. Could you keep a reference to the Handle

Re: Records in Haskell

2011-10-02 Thread Florian Weimer
* Simon Peyton-Jones: Provoked the (very constructive) Yesod blog post on Limitations of Haskell, and the follow up discussion, I've started a wiki page to collect whatever ideas we have about the name spacing issue for record fields.

[Haskell-cafe] Toy implementation of the STG machine

2011-06-11 Thread Florian Weimer
I'm looking for a simple implementation of the STG machine to do some experiments, preferably implemented in something with memory safety. Performance is totally secondary. I'm also not interested in garbage collection details, but I do want to look at the contents of the various stacks.

Re: [Haskell-cafe] Toy implementation of the STG machine

2011-06-11 Thread Florian Weimer
* Thomas Schilling: Does Bernie Pope's http://www.haskell.org/haskellwiki/Ministg work for you? MiniSTG might do it, I will definitely look at it. The source repository is gone, but there's still a tarball on Hackage. I had hoped for something more interactive, though.

Re: RFC: migrating to git

2011-01-12 Thread Florian Weimer
* Simon Marlow: Thanks for this. I distilled your example into a shell script that uses git, and demonstrates that git gets the merge wrong: http://hpaste.org/42953/git_mismerge Still, git could get this merge right, it just doesn't (I know there are more complex cases that would be

Re: [Haskell-cafe] Type System vs Test Driven Development

2011-01-07 Thread Florian Weimer
* Jonathan Geddes: When I write Haskell code, I write functions (and monadic actions) that are either a) so trivial that writing any kind of unit/property test seems silly, or are b) composed of other trivial functions using equally-trivial combinators. You can write in this style in any

Re: [Haskell-cafe] Taking the TLS package for a spin ... and failing

2010-12-14 Thread Florian Weimer
* Mads Lindstrøm: I got it to work :) But there seems to be some bugs in the Haskell server certificate handling. It seems that TLS do not transfer the ST (state, as in California) parameter in the X509 subject field. It also seems that the Haskell server do not send the email-address. And

[Haskell-cafe] Avoiding the Y combinator for self-referencing types

2010-12-12 Thread Florian Weimer
Suppose I've got some named objects which reference other objects by name: data NodeS = NodeS {nameS :: String, refsS :: [String]} Through name resolution, the strings are translated to the actual nodes they denote: data Node = Node {name :: String, refs :: [Node]} resolve :: [NodeS] - Map

Re: [Haskell-cafe] Avoiding the Y combinator for self-referencing types

2010-12-12 Thread Florian Weimer
* Miguel Mitrofanov: Not sure if that's what you need: data NodeF f = Node {name :: String, refs :: [f (NodeF f)]} newtype Const a b = Const a newtype Id a = Id a type NodeS = NodeF (Const String) type Node = NodeF Id Thanks for the suggestion. Yes, the resulting syntax looks better,

Re: [Haskell-cafe] gtk2hs and hmake websites

2010-12-12 Thread Florian Weimer
* Joachim Breitner: I get regular error message from some Debian tools that check for new upstream versions that it cannot find http://haskell.org/hmake, and http://haskell.org/gtk2hs seems to be gone as well since the recent move of haskell.org. Is that temporary or will these projects have

Re: [Haskell-cafe] Re: Re: Bulletproof resource management

2010-11-28 Thread Florian Weimer
* Ben Franksen: The other library might provide something like IORef, and then it's impossible to uphold static guarantees. The way it is implemented for instance in the regions package, you can lift IO actions into the Region monad, as there are instance MonadCatchIO pr = MonadCatchIO

Re: [Haskell-cafe] In what language...?

2010-11-28 Thread Florian Weimer
* Gregory Collins: * Andrew Coppin: Hypothesis: The fact that the average Haskeller thinks that this kind of dense cryptic material is pretty garden-variety notation possibly explains why normal people think Haskell is scary. That's ridiculous. You're comparing apples to oranges: using

Re: [Haskell-cafe] In what language...?

2010-11-28 Thread Florian Weimer
* Andrew Coppin: On 26/10/2010 07:54 PM, Benedict Eastaugh wrote: On 26 October 2010 19:29, Andrew Coppinandrewcop...@btinternet.com wrote: I also don't know exactly what discrete mathematics actually covers. Discrete mathematics is concerned with mathematical structures which are discrete,

[Haskell-cafe] Return stack buffer vs Haskell compilers

2010-11-28 Thread Florian Weimer
Are there any Haskell compilers which use a calling convention which is friendly to return stack buffers found in many modern CPUs? Such a calling convention uses CALL/RET pairs for function calls. Tail calls are implemented with JMP and may require shuffling the stack, including the return

Re: [Haskell-cafe] Manatee Video.

2010-11-28 Thread Florian Weimer
* Andy Stewart: Many people ask What's Manatee? A video worth a thousand words : here is video (select 720p HD) http://www.youtube.com/watch?v=weS6zys3U8k Ahem: | This video contains content from UMG. It is not available in your | country. ___

[Haskell-cafe] Error handling with safer-file-handling

2010-11-15 Thread Florian Weimer
How am I supposed to write an exception handle for an invocation of System.IO.SaferFileHandles.openFile? Currently, I have got this: case req of Open path - do handle -openFile (asAbsPath path) ReadMode liftIO $ forcePut result Success run handle Follwing

Re: [Haskell-cafe] Bulletproof resource management

2010-10-15 Thread Florian Weimer
* Henning Thielemann: Some open/close pairs have corresponding 'with' functions, that are implemented using Exception.bracket. You can also use them within GHCi. I think using both manual resource deallocation and finalizers makes everything more complicated and more unreliable. It seems

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-09 Thread Florian Weimer
* Donn Cave: Quoth Florian Weimer f...@deneb.enyo.de, wikipedia: Managed code is a differentiation coined by Microsoft to identify computer program code that requires and will only execute under the management of a Common Language Runtime virtual machine (resulting in Bytecode

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Florian Weimer
* Vincent Hanquez: Native means the implementation is in haskell, and the library is not using another implementation (in another language) to do the work: either through FFI as a binding, or as a wrapper to an external program. I can see how this terminology makes sense, but it's the

Re: [Haskell-cafe] ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Florian Weimer
* Donn Cave: wikipedia: Managed code is a differentiation coined by Microsoft to identify computer program code that requires and will only execute under the management of a Common Language Runtime virtual machine (resulting in Bytecode). I like this term, I apply it by

[Haskell-cafe] Bulletproof resource management

2010-10-08 Thread Florian Weimer
At least in my experience, in order to get proper resource management for things like file or database handles, you need both a close operation and a finalizer registered with the garbage collector. The former is needed so that you can create resources faster than the garbage collector freeing

Re: [Haskell-cafe] Re: Bulletproof resource management

2010-10-08 Thread Florian Weimer
* Ben Franksen: You might be interested in Lightweight Monadic Regions http://okmij.org/ftp/Haskell/regions.html#light-weight which solve the problem (IMHO) in a much cleaner way, i.e. w/o explicit closing and also w/o using finalizers. Is this approach composeable in the sense that

Parallel build broken

2010-09-30 Thread Florian Weimer
http://hackage.haskell.org/trac/ghc/wiki/Building/Hacking says that parallel builds are supported, but this doesn't seem to be true anymore. This is a bit unfortunate because in theory, builds should parallelize quite well. ___ Glasgow-haskell-users

Re: Parallel build broken

2010-09-30 Thread Florian Weimer
* Ian Lynagh: On Thu, Sep 30, 2010 at 08:13:01PM +0200, Florian Weimer wrote: http://hackage.haskell.org/trac/ghc/wiki/Building/Hacking says that parallel builds are supported, but this doesn't seem to be true anymore. It's still true. If you're having problems, please file a ticket. Okay

Re: [Haskell-cafe] Re: String vs ByteString

2010-08-14 Thread Florian Weimer
* Bryan O'Sullivan: If you know it's text and not binary data you are working with, you should still use Data.Text. There are a few good reasons. 1. The API is more correct. For instance, if you use Text.toUpper on a string containing latin1 ß (eszett, sharp S), you'll get the

Re: -O vs. -O2

2010-05-09 Thread Florian Weimer
* Bulat Ziganshin: cloning gcc policy may be a good choice. -O2 is the best optimization that guaranteed to make program faster and -O3 is for speculative optimization (those that may be breaked by unusual code or made program slower). not sure about -O1, -O1 is supposed to yield somewhat

Re: [Haskell-cafe] Re: How many Haskell Engineer I/II/IIIs are there?

2010-02-14 Thread Florian Weimer
* Simon Marlow: In a sense the GC *is* deterministic: it guarantees to collect all the unreachable garbage. But I expect what you're referring to is the fact that the garbage remains around for a non-deterministic amount of time. To me that doesn't seem to be a problem: you could run the GC

Trying to build from the darcs repository

2010-01-24 Thread Florian Weimer
How much memory does GHC need to build on amd64 GNU/Linux? I'm trying to build from the darcs repository, and this command inplace/bin/ghc-stage1 -H32m -O -package-name terminfo-0.3.1.1 -hide-all-packages -i ilibraries/terminfo/. --ilibraries/terminfo/dist-install/build

Re: [Haskell-cafe] Lisp like symbols in haskell

2009-12-08 Thread Florian Weimer
* jean-christophe mincke: Has there already been attempts to introduce lisp like symbols in haskell? Do you mean something like Objective Caml's polymorphic variants? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: Unsafe hGetContents

2009-10-11 Thread Florian Weimer
* Simon Marlow: Oleg's example is quite close, don't you think? URL: http://www.haskell.org/pipermail/haskell/2009-March/021064.html Ah yes, if you have two lazy input streams both referring to the same underlying stream, that is enough to demonstrate a problem. As for whether Oleg's

Unsafe hGetContents

2009-09-16 Thread Florian Weimer
Are there any plans to get rid of hGetContents and the semi-closed handle state for Haskell Prime? (I call hGetContents unsafe because it adds side effects to pattern matching, stricly speaking invalidating most of the transformations which are expected to be valid in a pure language.)

Re: Unsafe hGetContents

2009-09-16 Thread Florian Weimer
* Don Stewart: fw: Are there any plans to get rid of hGetContents and the semi-closed handle state for Haskell Prime? (I call hGetContents unsafe because it adds side effects to pattern matching, stricly speaking invalidating most of the transformations which are expected to be valid in a

Re: [Haskell-cafe] Type family oddity

2008-10-05 Thread Florian Weimer
* Claus Reinke: -- erase_range :: (Sequence s) = RangeTrait s - IO (RangeTrait s) This can't work, as you can see after desugaring: -- erase_range :: (Sequence s,RangeTrait s~rs) = rs - IO rs There is nowhere to get 's' from, unless you start applying type families backwards, from results

[Haskell-cafe] Type family oddity

2008-10-04 Thread Florian Weimer
I can't figure out why the following code doesn't compile with the October 2n GHC 6.10 beta (-XTypeFamilies -XFlexibleContexts) when the type declaration is not commented out. module T where type family RangeTrait c class InputRange r where remaining :: r - Bool advance :: r - r class

[Haskell-cafe] Kind-agnostic type classes

2008-10-03 Thread Florian Weimer
I'm trying to encode a well-known, informally-specified type system in Haskell. What causes problems for me is that type classes force types to be of a specific kind. The system I'm targeting however assumes that its equivalent of type classes are kind-agnositic. For instance, I've got class

Re: [Haskell-cafe] Kind-agnostic type classes

2008-10-03 Thread Florian Weimer
* Derek Elkins: On Fri, 2008-10-03 at 12:22 +0200, Florian Weimer wrote: I'm trying to encode a well-known, informally-specified type system in Haskell. What causes problems for me is that type classes force types to be of a specific kind. The system I'm targeting however assumes that its

Re: [Haskell-cafe] Kind-agnostic type classes

2008-10-03 Thread Florian Weimer
* Luke Palmer: For instance, I've got class Assignable a where assign :: a - a - IO () class Swappable a where swap :: a - a - IO () class CopyConstructible a where copy :: a - IO a class (Assignable a, CopyConstructible a) = ContainerType a class (Swappable c, Assignable

Status of exception handling

2007-10-21 Thread Florian Weimer
What's the status of exception handling? A couple of years ago, I think it wasn't clear how to do that in the Haskell context. Are there any GHC extensions which provide means to retry on temporary errors, without passing too much status around? I've seen on the Wiki that backtraces are still

Re: [Haskell] ANNOUNCE: Harpy -- run-time code generation library

2007-05-19 Thread Florian Weimer
* Martin Grabmueller: For the future, we'd like to be able to support more architectures, but it's not very high on our priority list. Maybe interest of others could change that... LLVM as a target could be interesting as well, and would avoid the need to write tons of optimizers.

Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-25 Thread Florian Weimer
* John Meacham: Clean has also declined in these benchmarks but not that much as Haskell. According to John van Groningen Clean's binary-trees program in the previous shootout version used lazy data structure which resulted in lower memory usage and much faster execution. That was removed by

Re: Here-docs in Haskell source

2006-09-24 Thread Florian Weimer
* Ian Zimmerman: Here's a quick test: put the cursor in front of a triple-quoted string, then hit Control-Alt-F (forward-sexp). It should move just after the whole string. Does it? As long as there are no embedded double quotes in the string, it does. Version 4.78 mishandles the embedded

Re: Replacement for GMP: Update

2006-08-12 Thread Florian Weimer
* Peter Tanski: Quite right; my mistake: under the OpenSSL license a developer cannot mention features of the software in advertising materials, so the license grant of the GPL-OpenSSL program to the developer is void. The reason I mentioned users only was that in the particular problem we

Re: Replacement for GMP: Update

2006-08-11 Thread Florian Weimer
* Peter Tanski: On the other hand, the OpenSSL FAQ at http://www.openssl.org/support/ faq.html#LEGAL2 mentions that some GPL programs do not allow binary combination (static linking) or interoperation (dynamic linking) with OpenSSL. Honestly I have not seen any GPL licenses like this. The

Re: [Haskell-cafe] Baffled by Disk IO

2006-07-30 Thread Florian Weimer
* SevenThunders: OK it was stupid. Apparently GHC behaves differently according to what the name of the high level source file is. If I renamed test.hc to main.hc everything works the same as GHCi. I probably should actually read the manual some day. Some operating systems have a test

Re: [Haskell] Re: rawSystem unpredictable with signals

2006-07-09 Thread Florian Weimer
* John Goerzen: where childaction oldint oldquit oldset = do restoresignals oldint oldquit oldset executeFile program True args Nothing restoresignals oldint oldquit oldset = do installHandler sigINT oldint Nothing

Re: [Haskell] Takusen

2006-05-06 Thread Florian Weimer
* Joel Reymont: I cannot check out Takusen from haskell-libs on Source Forge, neither an empty password nor anonymous works. Has anyone seen this? Anonymous CVS at Sourceforge is not available at the moment AFAICT. See the countless bug reports at:

Re: jhc vs ghc and the surprising result involving ghc generatedassembly.

2005-11-02 Thread Florian Weimer
* Simon Marlow: gcc started generating this rubbish around version 3.4, if I recall correctly. I've tried disabling various optimisations, but can't seem to convince gcc not to generate the extra jump. You don't get this from the native code generator, BTW. But the comparison is present

Re: jhc vs ghc and the surprising result involving ghcgeneratedassembly.

2005-11-02 Thread Florian Weimer
* Simon Marlow: However, beginning with GCC 3.4, you can use: extern void bar(); void foo() { void (*p)(void) = bar; p(); } Interesting.. though I'm not sure I'm comfortable with relying on gcc's tail call optimisation to do the right thing. Aren't there side conditions that

Re: jhc vs ghc and the surprising result involving ghc generatedassembly.

2005-11-02 Thread Florian Weimer
Is it correct that you use indirect gotos across functions? Such gotos aren't supported by GCC and work only by accident. Even direct gotos aren't universally supported. Some info in Fergus Henderson's paper may be of interest http://felix.sourceforge.net/papers/mercury_to_c.ps This paper

Re: jhc vs ghc and the surprising result involving ghcgeneratedassembly.

2005-11-02 Thread Florian Weimer
* Lennart Augustsson: Simon Marlow wrote: Is it correct that you use indirect gotos across functions? Such gotos aren't supported by GCC and work only by accident. Yes, but cross-function gotos are always to the beginning of a function. Is that enough to ensure that the constant pool base

Re: jhc vs ghc and the surprising result involving ghc generated assembly.

2005-11-01 Thread Florian Weimer
* John Meacham: loop: if () goto loop; is not equivalent to a do-while loop, loop invarients cannot be hoisted out of the above for instance (except in some cases... it is all quite tricky and we want gcc to have as much freedom as possible). do-while loops are converted to this form by

Re: jhc vs ghc and the surprising result involving ghc generatedassembly.

2005-11-01 Thread Florian Weimer
* Simon Marlow: gcc started generating this rubbish around version 3.4, if I recall correctly. I've tried disabling various optimisations, but can't seem to convince gcc not to generate the extra jump. You don't get this from the native code generator, BTW. But the comparison is present in

Re: jhc vs ghc and the surprising result involving ghc generated assembly.

2005-11-01 Thread Florian Weimer
* On Tue, 2005-11-01 at 17:30 +0100, Florian Weimer wrote: use C control constructs rather than gotos. With GCC version 4, this will have no effect because the gimplifier converts everything to goto-style anyway. Felix generates C with gotos. The result is FASTER than native C using gcc

[Haskell-cafe] Bit fiddling

2005-05-17 Thread Florian Weimer
I'm toying a bit with Haskell and wondering what's the best way to implement bit fiddling. Most of my applications involve serializing and deserializing small blobs (IP packets, for instance), and after browsing the GHC library documentation, I'm not sure which appraoch I should use. That's why

Re: [Haskell-cafe] Bit fiddling

2005-05-17 Thread Florian Weimer
* robert dockins: If you want C compatibility, you need http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Array.Storable.html which is similar. You then use the withStorableArray to call out to your C functions. Looks exactly like what I need. I'll give it a try and come

[Haskell-cafe] Re: [darcs-users] fptools in darcs now available

2005-05-16 Thread Florian Weimer
* John Goerzen: Anyway, comments welcome. I intend to sync this up with the CVS sources every few days until either 1) the fptools people adopt darcs, or 2) it becomes apparent that it's not being useful for people. Would you please add tags regularly, so that the _darcs/inventory file does

[Haskell-cafe] Re: [darcs-users] fptools in darcs now available

2005-05-16 Thread Florian Weimer
* John Goerzen: Would you please add tags regularly, so that the _darcs/inventory file does not exceed some moderate size? It's currently at 4 MB, which seems to be a tad bit excessive to download, just to check that there are no new patches available. Yes, I can do that more regularly,