Jason Dagit | 1 Dec 2010 01:59

Re: Conditional compilation for different versions of GHC?



On Sat, Nov 27, 2010 at 9:59 AM, Jinjing Wang <nfjinjing <at> gmail.com> wrote:
Thanks Michael,

So the user should use `cabal install --flags -ghc7 package-name` to
install the package, if I'm not mistaken?

Will it work if the package is installed as a dependency? Will the
flag environment be passed down from the root package?

Is there a way to detect GHC version automatically?

I see that others have provided answers on here, but another way is to change the check from:

   if flag(ghc7)
       build-depends:   base                      >= 4.3      && < 5
       cpp-options:     -DGHC7
   else
       build-depends:   base                      >= 4        && < 4.3

to this:
   if impl(ghc >= 7)
       build-depends:   base                      >= 4.3      && < 5
       cpp-options:     -DGHC7
   else
       build-depends:   base                      >= 4        && < 4.3

I hope that helps,
Jason
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Jason | 1 Dec 2010 02:29
Picon
Favicon

Re: ANN: HaLVM 1.0: the Haskell Lightweight Virtual Machine

On Tue, Nov 30, 2010 at 02:16:07PM -0800, Adam Wick wrote:
> Galois, Inc. is pleased to announce the immediate release of the
> Haskell Lightweight Virtual Machine (or HaLVM), version 1.0. The
> HaLVM is a port of the GHC runtime system to the Xen hypervisor,
> allowing programmers to create Haskell programs that run directly on
> Xen's "bare metal." Internally, Galois has used this system in
> several projects with much success, and we hope y'all will have an
> equally great time with it.
>
> What might you do with a HaLVM? Pretty much anything you want. :)
> Explore designs for operating system decomposition, examine new
> notions of mobile computation with the HaLVM and Xen migration, or
> find interesting network services and lock them inside small, cheap,
> single-purpose VMs.

I had seen a paper which implemented something like this with OCaml. And what do you know? Here's a running, open-source, available-now version in Haskell. 

Congrats to Galois for open sourcing this. Now let the collaboration begin.

Would it be possible to run HaLVM on Amazon EC2?
-- 
Jason M. Knight
Ph.D. Electrical Engineering '13
Texas A&M University
Cell: 512-814-8101
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Sterling Clover | 1 Dec 2010 02:56
Picon

Re: GHC 7.0.1 developer challenges

On Tue, Nov 30, 2010 at 9:24 AM, Ryan Ingram <ryani.spam <at> gmail.com> wrote:
> On Mon, Nov 29, 2010 at 12:36 AM, Simon Peyton-Jones
> <simonpj <at> microsoft.com> wrote:
>> Do you have an alternative to suggest?  After all, the previous situation wasn't good either.
>
> I suggest that we should be able to specify RTS options at
> compile/link time, or as pragmas in the Main module.
>
>  -- ryan

What's feasible to write now, and almost better (but lacking
toolchain/library support) is writing two executables. The first takes
command line options, decides what to do based on them, and then
passes control to the second, with flags set only as appropriate.
Doing this cleanly is OS dependent, and tied to System.Process,
daemonizing-type techniques, and all that. Such a library, possibly
implemented as a nontrivial extension (or borrowing code from) the
excellent-looking hdaemonize package, would be very welcome!

Cheers,
Sterl.
Thomas Schilling | 1 Dec 2010 03:07
Gravatar

Re: Conditional compilation for different versions of GHC?

I think a nicer way to solve that issue is to use Cabal's MIN_VERSION macros.

 1. Add CPP to your extensions.  This will cause cabal to
auto-generate a file with MIN_VERSION_≤pkg> macros for each <pkg> in
build-depends.

 2. GHC 6.12.* comes with template-haskell 2.4, so to test for that use:

#ifdef MIN_VERSION_template_haskell(2,4,0)
  .. ghc-6.12.* code here.
#endif

This should make it more transparent to the user.

On 27 November 2010 16:59, Jinjing Wang <nfjinjing <at> gmail.com> wrote:
> Dear list,
>
> >From ghc 7.0.1 release notes:
>
>> The Language.Haskell.TH.Quote.QuasiQuoter type has two new fields: quoteType and quoteDec.
>
> Some of my code needs to be conditionally compiled to support both
> version 6 and 7, what is the recommended way to do it?
>
> ref:
>
> * http://new-www.haskell.org/ghc/docs/7.0.1/html/users_guide/release-7-0-1.html
>
> --
> jinjing
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

--

-- 
Push the envelope. Watch it bend.
Mitar | 1 Dec 2010 03:18
Picon

[ANNOUNCE] A general data-flow framework

Hi!

I have just published my library which provides a general data-flow framework:

http://hackage.haskell.org/package/Etage

Sadly it requires current GHC HEAD branch because of this:

http://hackage.haskell.org/trac/ghc/ticket/1769

Short description:

A general data-flow framework featuring nondeterminism, laziness and
neurological pseudo-terminology. It can be used for example for
data-flow computations or event propagation networks. It tries hard to
aide type checking and to allow proper initialization and cleanup so
that interfaces to input and output devices (data or events producers
or consumers) can be made (so that created models/systems/networks can
be used directly in real world applications, for example robots).

I am more than open to any suggestions and comments.

Mitar
Michael Snoyman | 1 Dec 2010 04:54
Favicon
Gravatar

Re: Conditional compilation for different versions of GHC?

On Wed, Dec 1, 2010 at 4:07 AM, Thomas Schilling
<nominolo <at> googlemail.com> wrote:
> I think a nicer way to solve that issue is to use Cabal's MIN_VERSION macros.
>
>  1. Add CPP to your extensions.  This will cause cabal to
> auto-generate a file with MIN_VERSION_≤pkg> macros for each <pkg> in
> build-depends.
>
>  2. GHC 6.12.* comes with template-haskell 2.4, so to test for that use:
>
> #ifdef MIN_VERSION_template_haskell(2,4,0)
>  .. ghc-6.12.* code here.
> #endif
>
> This should make it more transparent to the user.

This is obviously a personal preference issue, but I try to avoid the
Cabal macros since they don't let my code run outside the context of
Cabal. I often times like to have a test suite that I can just use
with runhaskell, and (unless you can tell me otherwise) I can't run it
anymore.

Also, I think

#if GHC7
...
#endif

is more transparent than a check on template-haskell.

Michael
Eugene Kirpichov | 1 Dec 2010 08:49
Picon
Gravatar

Most images broken on haskellwiki pages

Hello.

I looked at a couple pages of mine
http://www.haskell.org/haskellwiki/Splot ,
http://www.haskell.org/haskellwiki/Timeplot , and at a couple of
random pages http://haskell.org/haskellwiki/Special:Random - and looks
like the vast majority of images are not displaying.

What's wrong? Does it have to do with the wiki redesign? What should,
say, I personally do about my images regarding this?

--

-- 
Eugene Kirpichov
Senior Software Engineer,
Grid Dynamics http://www.griddynamics.com/
Yitzchak Gale | 1 Dec 2010 09:53

Re: Most images broken on haskellwiki pages

Eugene Kirpichov wrote:
> I looked at a couple pages of mine...
> and looks
> like the vast majority of images are not displaying.

This probably has to do with moving the wiki to the
new server during the past few days. I forwarded your
email to the admin team there for them to have a look.

Regards,
Yitz
Yitzchak Gale | 1 Dec 2010 11:05

Re: doesDirectoryExist is always returning False

On Sat, Nov 20, 2010 at 4:55 PM, Marcelo Sousa wrote:
> I'm having currently a problem with System.Directory in my mac os.
>   System Version: Mac OS X 10.6.5
>   Kernel Version: Darwin 10.5.0
> Prelude System.Directory> let dirTest = do {dir <- getCurrentDirectory;
> doesDirectoryExist dir}
> Prelude System.Directory> dirTest
> False

This did not happen on my Mac, but now it started
happening, right after I upgraded some packages.
I suspect the unix package. See:

http://hackage.haskell.org/trac/ghc/ticket/4812

Thanks,
Yitz
Neil Davies | 1 Dec 2010 11:19
Picon
Gravatar

Re: ANN: HaLVM 1.0: the Haskell Lightweight Virtual Machine

Yes, thanks for sharing....
...... 

Congrats to Galois for open sourcing this. Now let the collaboration begin.

Would it be possible to run HaLVM on Amazon EC2?

They do say that you can boot any image from an EBS volume  - if you start playing with this I would be interested to hear any (positive or negative) progress...

Jason M. Knight
Ph.D. Electrical Engineering '13
Texas A&M University
Cell: 512-814-8101
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane