[jhc] Re: [Haskell-cafe] Opinion about JHC

John Meacham john at repetae.net
Fri Nov 13 23:10:17 EST 2009


Hi, I believe this bug has been fixed in the darcs version, at least, it
is in my testing. The fix will be in 0.7.3, or you can try the version
from the darcs repository directly. Thanks for the bug report!

        John

On Wed, Nov 11, 2009 at 01:36:05PM -0800, Philippos Apolinarius wrote:
> Hi, John.
> I
> am sending you this second email because the first one has a worng paste.  However, if I use the right input, I gent the same error. In fact, it gives exactly the same error for any input, right or wrong.  
> 
> {- file: tree.hs -}
> {- compile: jhc tree.hs -dc -o
>  jtree }
> import System (getArgs)
> 
> import System.IO
> 
> import IO
> 
>  
> data Op = AND | OR | NOT deriving (Show, Read)
> 
>    
> 
> data Tree= L Int | T Op [Tree] deriving (Show, Read) 
> 
>  
> main= do
> 
>   putStrLn "Give me a tree:"
> 
>   s <- getLine
>   let xx= read s
>   putStrLn (show (xx::Tree))
>     
> 
> Here is what happens when I try to run it:
> 
> philip at desktop:~/jhctut$ ./jtree
> Give me a tree:
> T AND [L 1, L 2]
> 
> jtree_code.c:2670: case fell off
> Aborted
> 
> It gives the same error for any input:
> 
> philip at desktop:~/jhctut$ ./jtestarbo
> Give me a tree:
> fdsfkldkl
> 
> jtestarbo_code.c:2670: case fell off
> Abortado
> 
> 
> It seems that the problem is in the Read class, since it works if I use the Show class only:
> 
> import System (getArgs)
> 
> import System.IO
> 
> import IO
> 
>  
> data Op = AND | OR | NOT deriving (Show, Read)
> 
>    
> 
> data Tree= L Int | T Op [Tree] deriving (Show, Read) 
> 
>  
> main= do
> 
>   putStrLn "Give me a tree:"
> 
>   s <-
>  getLine
>   let xx= T AND [L 1, L 2]
>   putStrLn (show (xx::Tree))
> 
> I hope you can fix it.
> 
> 
> 
> 
> 
> --- On Wed, 11/11/09, John Meacham <john at repetae.net> wrote:
> 
> From: John Meacham <john at repetae.net>
> Subject: Re: [Haskell-cafe] Opinion about JHC
> To: haskell-cafe at haskell.org
> Received: Wednesday, November 11, 2009, 1:37 AM
> 
> On Tue, Nov 10, 2009 at 07:41:54PM -0800, Philippos Apolinarius wrote:
> > I discovered a Haskell compiler that generates very small and fast
> > code. In fact, it beats Clean. It has the following properties:
> 
> Excellent. that was my goal ;)
> 
> > 1 --- One can cross-compile programs easily. For instance, here is how I generated code for Windows:
> > 
> > jhc --cross -mwin32 genetic.hs -o genetic
> 
> Yup. This was a major goal. compiling for iPhones and embedded arches is
> just as easy assuming you have a gcc toolchain set up. (at least with
> the hacked iPhone SDK.. I have never tried it with the official one)
> 
> > 
> > 2 -- It seems to be quite complete.
> > 
> > 3 -- However, it often compiles a file, but the program fails to run.
> > 
> > I have the following questions about it:
> > 
> > 1 -- How active is the team who is writing the JHC compiler?
> 
> Hi, I am the main contributor, but others are welcome and several have
> made signifigant contributions. Development tends to be spurty. A lot of
> work will get done in a short amount of time, this generally corresponds
> to when an external contributor gets involved and the back and forth
> helps stimulate patches on my part to complement theirs.
> 
> Although I have not been able to devote a lot of my time to jhc in the
> past, hopefully this will change in the not to distant future and I will
> be able to work on it full time. 
> 
> 
> > 2 -- Is it complete Haskell? The author claims that it is; it compiled
> > all programs that I wrote, but that does not mean much, because my
> > programs are quite simple.
> 
> It does Haskell 98 and several extensions, which is pretty much what GHC
> does. However, it does not implement the same set of extensions as GHC
> so this causes issues as a lot of people use GHC extensions extensively. 
> 
> I plan on supporting all of Haskell' of course, and the popular GHC
> extensions to help compatibility. Not all are implemented. 
> 
> > 3 -- Why the Haskell community almost never talks about JHC?
> 
> Part of it is that I am not very good at advocacy. I don't always
> post announcements on the main haskell lists figuring the interested
> parties are on the jhc list already. I do try to make jhc good, fast,
> and usable, I always hoped someone better at advocacy than me would join
> the project :) In truth, I think the spurty nature of development also
> affects this, the list will be quite for a long time with a flurry of
> development lasting a few weeks occasionally inspiring some discussion
> in the other groups.
> 
> In any case, I am glad you liked what you found! please join the mailing
> list for jhc if you are interested in its development or using it.
> 
>         John
> 
> 
> 
> -- 
> John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
> --
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 
> 
>       __________________________________________________________________
> Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the jhc mailing list