Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Training tasks (Nikita Beloglazov) 2. Re: cmath Install troubles (Tom Murphy) 3. Re: Training tasks (umptious) 4. Re: cmath Install troubles (Brandon Allbery) 5. Re: cmath Install troubles (Tom Murphy) 6. Re: cmath Install troubles (Brandon Allbery) ---------------------------------------------------------------------- Message: 1 Date: Wed, 18 Apr 2012 23:08:32 +0300 From: Nikita Beloglazov <nik...@taste-o-code.com> Subject: Re: [Haskell-beginners] Training tasks To: Tom Murphy <amin...@gmail.com> Cc: beginners@haskell.org Message-ID: <cajdg_pvciq9dnbveyvyofqv9v6hphopezgg2og_-_om-yp4...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" > > On Wed, Apr 18, 2012 at 8:44 PM, Tom Murphy <amin...@gmail.com> wrote: > I think that the idea is less to have a teaching tool, and more > to have a way to "shop around" for languages, by seeing what each > language is very good at. > Yes, Tom is right. Idea is to show what each language good for, to excite about it. It may be hard to achieve by solving tasks but I want to try. When user solves task he is be able to see author's solution. This way he can learn other (may be more beautiful) way to solve the task. Nikita -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120418/ccbfcd7f/attachment-0001.htm> ------------------------------ Message: 2 Date: Wed, 18 Apr 2012 16:18:48 -0400 From: Tom Murphy <amin...@gmail.com> Subject: Re: [Haskell-beginners] cmath Install troubles To: Brandon Allbery <allber...@gmail.com> Cc: beginners <beginners@haskell.org> Message-ID: <CAO9Q0tVSuNz=+Rx=ss0VFu5z5kbpP=ytgvuxghnvda-5zlh...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 I've got some free time again so I'm returning to this problem. 2 important facts: - A test C program, using one of the "undefined" functions (isnan) compiles with GCC and runs - I went in by hand and temporarily replaced each version of math.h on my computer with a version that has the necessary functions defined. Cabal-install still failed with the same error. This makes it seem like cabal doesn't have access to _any_ math.h file, but if this were the case, wouldn't I get many more undefined-function errors than I do? Thanks for the help, Tom On 1/20/12, Brandon Allbery <allber...@gmail.com> wrote: > On Fri, Jan 20, 2012 at 15:26, Tom Murphy <amin...@gmail.com> wrote: > >> On 1/19/12, Brandon Allbery <allber...@gmail.com> wrote: >> > On Thu, Jan 19, 2012 at 16:37, Antoine Latter <aslat...@gmail.com> >> wrote: >> >> On Thu, Jan 19, 2012 at 3:24 PM, Tom Murphy <amin...@gmail.com> wrote: >> >> > Is it possible that I have a version of math.h which doesn't have >> >> > these definitions ("gamma," "finite," "isinf," etc.) in it? >> >> >> >> That's a good guess based on the error messages - or math.h isn't in >> >> whatever paths we're looking in. >> >> If math.h wasn't in the paths at all, wouldn't I get an error about >> _every_ function being undefined? >> > > The problem isn't math.h; these are link errors, so it's > /usr/lib/libm.dylib that is somehow wrong. I can't help with this too much > as I'm on Lion so it's a symlink to libSystem.dylib (and if that's messed > up, you don't even *boot* much less compile stuff). > > -- > brandon s allbery allber...@gmail.com > wandering unix systems administrator (available) (412) 475-9364 vm/sms > ------------------------------ Message: 3 Date: Wed, 18 Apr 2012 22:21:01 +0100 From: umptious <umpti...@gmail.com> Subject: Re: [Haskell-beginners] Training tasks To: beginners@haskell.org Message-ID: <cae20bntmqmgai3qbgv_6cj11zjk4qs-apheoesrtex_+58a...@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" On 18 April 2012 21:08, Nikita Beloglazov <nik...@taste-o-code.com> wrote: > On Wed, Apr 18, 2012 at 8:44 PM, Tom Murphy <amin...@gmail.com> wrote: >> I think that the idea is less to have a teaching tool, and more >> to have a way to "shop around" for languages, by seeing what each >> language is very good at. >> > > Yes, Tom is right. Idea is to show what each language good for, to excite > about it. > Yes, I get that. It's a bad idea. Showing atypical "promotional" cases for each language encourages faddishness and silver bullet cults; it's irresponsible and unprofessional. If you're shopping around for a language then nothing is worse than selected sweet spot cases. Unless they are a fair-ish benchmark for a language that excels in a clear area, like R, APL and Awk and you're looking for a glorified DSL. I'd say that its better to have the same tasks for each language if you're evaluating a general purpose tool. Obvious ones would be, from simple to complex: - Some of the unix command line utilities like wc (some of these might be single liners) - OXO, Caesar cipher (10 lines or so) - The Markov chain program from the Practice Of Programming - Life - A simple spheres only ray tracer like the one in Graham's Lisp book - A simple calculator program like the one in Hutton - The recursive 2D shape program I've mentioned in other posts today - A version of the classic Traveller/Elite trading system - a really nice little toy business rules system that can be code either minimally or to show off the funkier features of a language to get more flexibility and more interesting pricing rules. Minimal version would be a few tens of lines and the config file declaring items. If you want to see a language comparison done responsibly, look at Kernighan and Pike's "Practice Of Programming." -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120418/de103cda/attachment-0001.htm> ------------------------------ Message: 4 Date: Wed, 18 Apr 2012 18:38:17 -0400 From: Brandon Allbery <allber...@gmail.com> Subject: Re: [Haskell-beginners] cmath Install troubles To: Tom Murphy <amin...@gmail.com> Cc: beginners <beginners@haskell.org> Message-ID: <CAKFCL4UvZkicGjQk=dpxy9vkk-tm0twuznwpcez-dtcdhmg...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Wed, Apr 18, 2012 at 16:18, Tom Murphy <amin...@gmail.com> wrote: > 2 important facts: > - A test C program, using one of the "undefined" functions (isnan) > compiles with GCC and runs > - I went in by hand and temporarily replaced each version of math.h on > my computer with a version that has the necessary functions defined. > Cabal-install still failed with the same error. > > This makes it seem like cabal doesn't have access to _any_ math.h > file, but if this were the case, wouldn't I get many more > undefined-function errors than I do? > Unless you are using an older ghc with -fvia-C, <math.h> is not used or useful. The modern -fasm codegen doesn't know what to do with C-level declarations. If your <math.h> is using macros to define gamma as something else, you will need to find that something else or use a wrapper library. I note that OS X doesn't have a gamma(). There are lgamma() and tgamma() and variations thereon. (and no related macros in <math.h>, confirming that it is not related.) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120418/d8f7c83b/attachment-0001.htm> ------------------------------ Message: 5 Date: Wed, 18 Apr 2012 21:39:28 -0400 From: Tom Murphy <amin...@gmail.com> Subject: Re: [Haskell-beginners] cmath Install troubles To: Brandon Allbery <allber...@gmail.com> Cc: beginners <beginners@haskell.org> Message-ID: <cao9q0tvzalxce_jcmv7ckcpj8qci+ckzq9pdwtdexkap_mr...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On 4/18/12, Brandon Allbery <allber...@gmail.com> wrote: > On Wed, Apr 18, 2012 at 16:18, Tom Murphy <amin...@gmail.com> wrote: > >> 2 important facts: >> - A test C program, using one of the "undefined" functions (isnan) >> compiles with GCC and runs >> - I went in by hand and temporarily replaced each version of math.h on >> my computer with a version that has the necessary functions defined. >> Cabal-install still failed with the same error. >> >> This makes it seem like cabal doesn't have access to _any_ math.h >> file, but if this were the case, wouldn't I get many more >> undefined-function errors than I do? >> > > Unless you are using an older ghc with -fvia-C, [...] I have 7.0.4. [...] > <math.h> is not used or > useful. The modern -fasm codegen doesn't know what to do with C-level > declarations. If your <math.h> is using macros to define gamma as > something else, you will need to find that something else or use a wrapper > library. Hmm, that's true... I don't really understand how .hsc files are compiled, but isn't the "#include <math.h>" in cmath done in the very standard FFI style? > > I note that OS X doesn't have a gamma(). There are lgamma() and tgamma() > and variations thereon. (and no related macros in <math.h>, confirming > that it is not related.) > What do you mean by OS X not having them? On my system (10.6), gamma() is defined (at least in math.h (well, at least the ones in /usr/include/architecture/i386/ and /Developer/SDKs/MacOSX10.6.sdk/usr/include/architecture/i386/)) Thanks for your help. Tom ------------------------------ Message: 6 Date: Thu, 19 Apr 2012 01:31:11 -0400 From: Brandon Allbery <allber...@gmail.com> Subject: Re: [Haskell-beginners] cmath Install troubles To: Tom Murphy <amin...@gmail.com> Cc: beginners <beginners@haskell.org> Message-ID: <CAKFCL4UmXS8u3qPUiQ=ijwngpmgjwthhq9itjsxzrdnco0y...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Wed, Apr 18, 2012 at 21:39, Tom Murphy <amin...@gmail.com> wrote: > On 4/18/12, Brandon Allbery <allber...@gmail.com> wrote: > > On Wed, Apr 18, 2012 at 16:18, Tom Murphy <amin...@gmail.com> wrote: > >> This makes it seem like cabal doesn't have access to _any_ math.h > >> file, but if this were the case, wouldn't I get many more > >> undefined-function errors than I do? > > > > Unless you are using an older ghc with -fvia-C, > [...] > I have 7.0.4. > 7.0.4 has -fasm by default, but you can force -fvia-C still. With -fasm, the include files are not used afaik; since direct assembly code is created and not C code, a C include file is not useful. > Hmm, that's true... > I don't really understand how .hsc files are compiled, but isn't the > "#include <math.h>" in cmath done in the very standard FFI style? > If warnings are on, I think that elicits a "this is not used any more" warning with -fasm. > I note that OS X doesn't have a gamma(). There are lgamma() and tgamma() > > and variations thereon. (and no related macros in <math.h>, confirming > > that it is not related.) > > What do you mean by OS X not having them? On my system (10.6), gamma() > I'm on 10.7, and I have no gamma(). I just checked the 10.6 SDK includes; it has extern double gamma ( double ); /* Legacy API: please use C99 tgamma() instead. */ so apparently it was deprecated and is now removed. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120419/a5413006/attachment.htm> ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 46, Issue 32 *****************************************