[Haskell-cafe] Any ideas how to go about doing a phd in threading?

2007-08-07 Thread Hugh Perkins
Hi,

Really interested in doing a phd on threading.  Any ideas how I'd go about
doing/applying for that?  Basically, threading seems to be the cutting-edge
right out (for a while) as processor frequencies top out, and multicores
increase.

I dont have any formal CS training, but I do have a degree in natsci from
Cambridge, quite a few years experience in industry, and anyone who knows me
can attest that I'm highly motivated; a string of opensource work shows that
I'm more interested in having fun than earning money, for a geek's
definition of having fun :-)

No particular preference for language, whatever it takes ;-)   The Haskell
group seems to have a high percentage of phds, and Haskell is a candidate
language for automatic thread management, so seems an appropriate group to
ask about this?

Here's my cv in case it's useful: http://manageddreams.com/CV_PERKINS.pdf
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Monad for Set?

2007-08-07 Thread Vitaliy Akimov

 If you also read the rest of that thread, you'll see that with a recent
 GHC HEAD, you should be able to avoid the need for the Teq witness.


http://www.cs.chalmers.se/~rjmh/Papers/restricted-datatypes.ps
here is solution which doesn't require GADT and HEAD, but it does
require changing of monad interface.
This trick is used in SYB3.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Sudoku Solver

2007-08-07 Thread Murray Gross



I am working on a parallel brute-force solver, which will be tested on 
25x25 puzzles (my current serial solver requires less than 1 second for 
the most difficult 9x9 puzzles I've been able to find; while I haven't 
tried it on 16x16 puzzles on one of the machines in the Brooklyn College 
Metis cluster, extrapolation from another machine indicates that 16x16 
puzzles will take 15-20 minutes; the 25x25 test case I have requires about 
a week on a cluster machine).


Unfortunately, we have a lot of preparatory work to do, so it will be a 
while before I have any results from a puzzle solver.


The parallel work will be done on our parallel version of release 5 
Haskell.


Murray Gross
Brooklyn College






On Tue, 7 Aug 2007, Donald Bruce Stewart wrote:


hughperkins:


   On 8/7/07, Donald Bruce Stewart [EMAIL PROTECTED]
   wrote:

 See also,
 [2]http://haskell.org/haskellwiki/Sudoku
 -- Don

   Just out of ... errr curiosity... which of those
   implementations is the fastest?



No idea. You could compile them all with -O2, run them on a set of
puzzles, and produce a table of results :-)

I'm a little surprised no one's tried a parallel solution yet, actually.
We've got an SMP runtime for a reason, people!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Sudoku Solver

2007-08-07 Thread Hugh Perkins
On 8/7/07, Murray Gross [EMAIL PROTECTED] wrote:

 I am working on a parallel brute-force solver, which will be tested on
 25x25 puzzles (my current serial solver requires less than 1 second for
 the most difficult 9x9 puzzles I've been able to find; while I haven't
 tried it on 16x16 puzzles on one of the machines in the Brooklyn College
 Metis cluster, extrapolation from another machine indicates that 16x16
 puzzles will take 15-20 minutes; the 25x25 test case I have requires about
 a week on a cluster machine).


Question: what do you mean by, for example 25x25?  Do you mean grids with a
total length of 25 on each side, eg:

21 13 4 19 18 17 22 1 6 24 10 11 8 14 12 2 16 23 7 15 25 20 3 5 9
1 16 6 5 10 14 25 2 8 15 23 7 24 21 13 20 3 17 11 9 19 4 18 22 12
3 2 17 9 11 4 18 7 5 12 16 19 25 20 6 22 13 21 24 10 15 14 8 23 1
23 20 25 12 15 11 16 13 19 3 5 9 1 17 22 14 4 18 8 6 7 2 10 21 24
7 14 8 24 22 23 20 9 21 10 4 2 18 15 3 19 12 1 25 5 6 17 16 11 13
18 5 16 11 4 25 23 6 13 1 21 12 10 24 8 15 20 14 3 22 17 9 2 19 7
17 10 22 8 23 15 7 21 20 4 3 6 2 1 19 25 9 5 12 18 11 13 24 16 14
12 19 13 2 6 3 10 14 24 17 7 20 9 11 4 23 1 8 16 21 22 5 25 15 18
15 9 14 20 3 12 8 19 16 5 22 25 17 23 18 11 24 13 2 7 21 6 1 4 10
25 7 1 21 24 2 9 22 11 18 15 5 14 13 16 10 6 19 4 17 23 8 12 3 20
2 17 23 3 19 8 6 12 10 20 14 18 16 25 24 9 21 15 1 4 13 22 11 7 5
13 24 15 1 20 19 21 23 4 7 6 17 5 2 11 16 18 22 10 3 9 12 14 8 25
9 22 12 16 21 1 13 17 18 25 19 8 15 4 7 5 14 2 20 11 24 3 23 10 6
8 6 7 10 14 16 5 3 22 11 12 23 21 9 20 17 25 24 13 19 4 18 15 1 2
11 18 5 4 25 24 2 15 9 14 13 22 3 10 1 8 23 7 6 12 20 16 19 17 21
16 15 19 13 12 10 3 4 17 6 20 21 23 18 25 24 7 9 14 8 1 11 5 2 22
14 21 18 22 9 7 11 16 23 2 8 1 6 12 5 3 19 20 15 13 10 24 17 25 4
6 8 11 7 2 5 1 24 25 9 17 14 13 16 15 18 10 4 22 23 12 19 21 20 3
5 4 20 25 1 13 15 8 12 22 11 24 19 3 10 6 17 16 21 2 18 7 9 14 23
24 3 10 23 17 18 19 20 14 21 9 4 22 7 2 1 11 12 5 25 8 15 13 6 16
10 12 9 6 5 22 14 18 7 13 25 16 11 8 21 4 15 3 17 1 2 23 20 24 19
19 25 24 18 16 20 17 5 2 8 1 10 4 6 23 12 22 11 9 14 3 21 7 13 15
22 23 3 17 7 6 12 25 15 19 2 13 20 5 14 21 8 10 18 24 16 1 4 9 11
4 11 2 15 8 21 24 10 1 16 18 3 7 19 9 13 5 6 23 20 14 25 22 12 17
20 1 21 14 13 9 4 11 3 23 24 15 12 22 17 7 2 25 19 16 5 10 6 18 8

... or do you mean grids where each subgrid is 25x25, and the entire grid is
625 x 625?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Weekly News: August 07, 2007

2007-08-07 Thread Donald Bruce Stewart
---
Haskell Weekly News
http://sequence.complete.org/hwn/20070807
Issue 64 - August 07, 2007
---

   Welcome to issue 64 of HWN, a weekly newsletter covering developments
   in the [1]Haskell community.

   This issue marks the second anniversary of the Haskell (not quite)
   Weekly News. Thanks to the Haskell community for support, content and
   for reading over the last two years!

   1. http://haskell.org/

Announcements

   OSCON Haskell Tutorial. Simon Peyton-Jones Appeared at the O'Reilly
   Open Source Convention (OSCON) in Portland, delivering a range of
   talks, including [2]A Taste of Haskell, [3]A Keynote on Functional
   Languages, [4]Nested Data Parallelism and [5]Transactional Memory for
   Concurrent Programming. Videos are available for most of these talks:
   [6]A Taste of Haskell: Part 1, [7]A Taste of Haskell: Part 2,
   [8]slides for A Taste of Haskell, [9]Transactional Memory for
   Concurrent Programming and [10]the NDP talk at the London Hugs
   meeting.

   2. http://conferences.oreillynet.com/cs/os2007/view/e_sess/14016
   3. http://conferences.oreillynet.com/cs/os2007/view/e_sess/14773
   4. http://conferences.oreillynet.com/cs/os2007/view/e_sess/14014
   5. http://conferences.oreillynet.com/cs/os2007/view/e_sess/14017
   6. http://blip.tv/file/324976
   7. http://www.blip.tv/file/325646/
   8. http://conferences.oreillynet.com/presentations/os2007/os_peytonjones.pdf
   9. http://www.blip.tv/file/317758/
  10. http://video.google.co.uk/videoplay?docid=370317485066035666

   hpodder 1.0. John Goerzen [11]announced version 1.0.0 of hpodder, the
   command-line podcatcher (podcast downloader) that just happens to be
   written in everyone's favorite language. You can get it [12]here.
   Version 1.0.0 sports a new mechanism for detecting and disabling feeds
   or episodes that repeatedly result in errors, updates to the Sqlite
   database schema, and several bugfixes.

  11. http://article.gmane.org/gmane.comp.lang.haskell.general/15452
  12. http://software.complete.org/hpodder

   encoding-0.1. Henning Günther [13]announced the release of 'encoding',
   a Haskell library to cope with many character encodings found on
   modern computers. At the moment it supports (much more is planned):
   ASCII, UTF-8, -16, -32, ISO 8859-* (alias latin-*), CP125* (windows
   codepages), KOI8-R, Bootstring (base for punycode)

  13. http://article.gmane.org/gmane.comp.lang.haskell.general/15481

   Dimensional 0.6: Statically checked physical dimensions. Björn
   Buckwalter [14]announced a library providing data types for performing
   arithmetic with physical quantities and units. Information about the
   physical dimensions of the quantities/units is embedded in their types
   and the validity of operations is verified by the type checker at
   compile time. The boxing and unboxing of numerical values as
   quantities is done by multiplication and division with units.

  14. http://article.gmane.org/gmane.comp.lang.haskell.cafe/26944

Hackage

   This week's new libraries in [15]the Hackage library database.

 * hgal-1.0.1. Jean Philippe Bernardy. [16]Computation automorphism
   group and canonical labeling of a graph

 * hpodder-1.0.3. John Goerzen. [17]Podcast Aggregator (downloader)

 * dlist-0.3.1. Don Stewart. [18]Differences lists: a list-like type
   supporting O(1) append

 * pointfree-1.0. Felix Martini. [19]Stand-alone command-line version
   of the point-less plugin for lambdabot

 * encoding-0.1. Henning Guenther. [20]A library for various
   character encodings

 * AppleScript-0.1.3. Wouter Swierstra. [21]Call AppleScript from Haskell

 * SDL-ttf-0.4.0. David Himmelstrup. [22]Binding to libSDL_ttf

 * Finance-Quote-Yahoo-0.2. Brad Clawsie. [23]Obtain quote data from
   finance.yahoo.com

 * xmobar-0.7. Andrea Rossato. [24]A Minimalistic Text Based Status Bar

  15. http://hackage.haskell.org/
  16. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hgal-1.0.1
  17. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hpodder-1.0.3
  18. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/dlist-0.3.1
  19. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/pointfree-1.0
  20. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/encoding-0.1
  21. 
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/AppleScript-0.1.3
  22. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/SDL-ttf-0.4.0
  23. 
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Finance-Quote-Yahoo-0.2
  24. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xmobar-0.7

Conference roundup

   OSCON. Simon Peyton-Jones gave a series of popular talks about Haskell
   and functional programming at OSCON, in Portland. Below are collected
   just some

Re: [Haskell-cafe] Sudoku Solver

2007-08-07 Thread Hugh Perkins
On 8/7/07, Hugh Perkins [EMAIL PROTECTED] wrote:

 Question: what do you mean by, for example 25x25?  Do you mean grids with
 a total length of 25 on each side, eg:


(because on my super-dooper 1.66GHz Celeron, generating 10 random 25x25
grids such as the one above takes about 1.01 seconds; solving an actual
puzzle should be faster because the solution space is more tightly
constrained?)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Type classes: Missing language feature?

2007-08-07 Thread DavidA
Hi, there's something I'm trying to do with type classes that seems to fit very 
naturally with my mental model of type classes, but doesn't seem to be 
supported by the language. I'm wondering whether I'm missing something, or 
whether there's some language extension that could help me or alternative way 
of achieving what I'm trying to achieve.

I'm trying to define multivariate polynomials, which are sums of monomials - 
for example x^2y + z^4. In algorithms on multivariate polynomials, one 
typically wants to support different monomial orders. For example, the lex 
order is dictionary order - xxy  xy  y  yyy - whereas the graded lex (glex) 
order also takes into account the degree of the monomials - y  xy  xxy  yyy.

Here's some code (based on http://sigfpe.blogspot.com/2007/07/ill-have-
buchburger-with-fries.html):

import Data.Map as M
import Data.List as L

newtype Monomial = Monomial (Map String Int) deriving (Eq)
x = Monomial $ singleton x 1
y = Monomial $ singleton y 1
instance Show Monomial where
show (Monomial a) = concatMap (\(v,i)- v ++ ^ ++ show i) $ toList a -- 
simplified for brevity
instance Num Monomial where
Monomial a * Monomial b = Monomial $ unionWith (+) a b

newtype Lex = Lex Monomial deriving (Eq)
newtype Glex = Glex Monomial deriving (Eq)

instance Ord Lex where
Lex (Monomial m) = Lex (Monomial m') = toList m = toList m'

instance Ord Glex where
Glex (Monomial m) = Glex (Monomial m') = (sum $ elems m, toList m) = (sum 
$ elems m', toList m')

Now, what I'd like to do is have Lex and Glex, and any further monomial 
orderings I define later, automatically derive Show and Num instances from 
Monomial (because it seems like boilerplate to have to define Show and Num 
instances by hand). Something like the following (not valid Haskell):

class OrdMonomial m where
fromRaw :: Monomial - m
toRaw :: m - Monomial

instance OrdMonomial Lex where
fromRaw m = Lex m
toRaw (Lex m) = m

instance OrdMonomial Glex where
fromRaw m = Glex m
toRaw (Glex m) = m

derive OrdMonomial m = Show m where
show m = show (toRaw m)

derive OrdMonomial m = Num m where
m * m' = fromRaw (toRaw m * toRaw m')

Is there a way to do what I'm trying to do? (Preferably without resorting to 
template Haskell, etc) - It seems like a natural thing to want to do.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Type classes: Missing language feature?

2007-08-07 Thread apfelmus
DavidA wrote:

 newtype Lex = Lex Monomial deriving (Eq)
 newtype Glex = Glex Monomial deriving (Eq)

 Now, what I'd like to do is have Lex and Glex, and any further monomial 
 orderings I define later, automatically derive Show and Num instances from 
 Monomial (because it seems like boilerplate to have to define Show and Num 
 instances by hand).

Good news: it's already implemented and called newtype deriving :)

http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#newtype-deriving

In short, you just write

 newtype Lex = Lex Monomial deriving (Eq, Show, Num)

I guess that the Show instance will add the constructor Lex , though.

Regards,
apfelmus

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type classes: Missing language feature?

2007-08-07 Thread Derek Elkins
On Tue, 2007-08-07 at 12:58 +, DavidA wrote:
 Hi, there's something I'm trying to do with type classes that seems to fit 
 very 
 naturally with my mental model of type classes, but doesn't seem to be 
 supported by the language. I'm wondering whether I'm missing something, or 
 whether there's some language extension that could help me or alternative way 
 of achieving what I'm trying to achieve.
 
 I'm trying to define multivariate polynomials, which are sums of monomials - 
 for example x^2y + z^4. In algorithms on multivariate polynomials, one 
 typically wants to support different monomial orders. For example, the lex 
 order is dictionary order - xxy  xy  y  yyy - whereas the graded lex 
 (glex) 
 order also takes into account the degree of the monomials - y  xy  xxy  
 yyy.
 
 Here's some code (based on http://sigfpe.blogspot.com/2007/07/ill-have-
 buchburger-with-fries.html):
 
 import Data.Map as M
 import Data.List as L
 
 newtype Monomial = Monomial (Map String Int) deriving (Eq)
 x = Monomial $ singleton x 1
 y = Monomial $ singleton y 1
 instance Show Monomial where
 show (Monomial a) = concatMap (\(v,i)- v ++ ^ ++ show i) $ toList a -- 
 simplified for brevity
 instance Num Monomial where
 Monomial a * Monomial b = Monomial $ unionWith (+) a b
 
 newtype Lex = Lex Monomial deriving (Eq)
 newtype Glex = Glex Monomial deriving (Eq)
 
 instance Ord Lex where
 Lex (Monomial m) = Lex (Monomial m') = toList m = toList m'
 
 instance Ord Glex where
 Glex (Monomial m) = Glex (Monomial m') = (sum $ elems m, toList m) = 
 (sum 
 $ elems m', toList m')
 
 Now, what I'd like to do is have Lex and Glex, and any further monomial 
 orderings I define later, automatically derive Show and Num instances from 
 Monomial (because it seems like boilerplate to have to define Show and Num 
 instances by hand). Something like the following (not valid Haskell):
 
 class OrdMonomial m where
 fromRaw :: Monomial - m
 toRaw :: m - Monomial
 
 instance OrdMonomial Lex where
 fromRaw m = Lex m
 toRaw (Lex m) = m
 
 instance OrdMonomial Glex where
 fromRaw m = Glex m
 toRaw (Glex m) = m
 
 derive OrdMonomial m = Show m where
 show m = show (toRaw m)
 
 derive OrdMonomial m = Num m where
 m * m' = fromRaw (toRaw m * toRaw m')
 
 Is there a way to do what I'm trying to do? (Preferably without resorting to 
 template Haskell, etc) - It seems like a natural thing to want to do.

I don't think there is a way to do exactly what you want.  However,
there's an alternative approach that you may want to look at.  Right now
you are using a technique called Wrapper types.  An alternative would be
to use phantom types and have the ordering be specified by the type
parameter.  So something like the following,

newtype Monomial ord = Monomial (Map String Int) deriving (Eq)

instance Show (Monomial ord) where
show (Monomial a) = concatMap (\(v,i)- v ++ ^ ++ show i) $ toList a

instance Num (Monomial ord) where
Monomial a * Monomial b = Monomial $ unionWith (+) a b

data Lex -- this uses a minor extension which is not necessary
data GLex

instance Ord (Monomial Lex) where
Monomial m = Monomial m' = toList m = toList m'

instance Ord (Monomial GLex) where
Monomial m = Monomial m' 
   = (sum $ elems m, toList m) = (sum $ elems m', toList m')

You can add a trivial conversion function
convertOrdering :: Monomial a - Monomial b
convertOrdering (Monomial x) = Monomial x

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Type classes: Missing language feature?

2007-08-07 Thread Tillmann Rendel

DavidA wrote:
Now, what I'd like to do is have Lex and Glex, and any further monomial 
orderings I define later, automatically derive Show and Num instances from 
Monomial (because it seems like boilerplate to have to define Show and Num 
instances by hand). Something like the following (not valid Haskell):


class OrdMonomial m where
fromRaw :: Monomial - m
toRaw :: m - Monomial

instance OrdMonomial Lex where
fromRaw m = Lex m
toRaw (Lex m) = m

instance OrdMonomial Glex where
fromRaw m = Glex m
toRaw (Glex m) = m

derive OrdMonomial m = Show m where
show m = show (toRaw m)

derive OrdMonomial m = Num m where
m * m' = fromRaw (toRaw m * toRaw m')


Change derive to instance and enable some GHC extensions by passing

  -fglasgow-exts
  -fallow-overlapping-instances
  -fallow-undecidable-instances

to it (or use a GHC_OPTIONS pragma at the top of your source file) to 
make your code work with GHC. To go a step further, using functional 
dependencies, you can write a small framework:


  -- the class of wrapper types
  class Wrapper w a | w - a where
wrap :: a - w
unwrap :: w - a

  -- the class of types with derived show instances
  class Wrapper w = DeriveShow w

  -- actual deriving of show instances
  instance (Wrapper w a, Show a, DeriveShow w) = Show w where
show = show . unwrap

and use it for your situation:

  -- the inner type to be wrapped and it's instances
  newtype Monomial = Monomial (Map String Int) deriving (Eq)

  instance Show Monomial where
show (Monomial a) = ...

  -- some wrappers around this inner type
  newtype Lex = Lex Monomial deriving (Eq)
  newtype Glex = Glex Monomial deriving (Eq)

  instance Wrapper Lex Monomial where
wrap x = Lex x
unwrap (Lex x) = x

  instance Wrapper Glex Monomial where
wrap x = Glex x
unwrap (Glex x) = x

  -- specialised instances for the wrappers
  instance Ord Lex where
Lex (Monomial m) = Lex (Monomial m') = ...

  instance Ord Glex where
Glex (Monomial m) = Glex (Monomial m') = ...

  -- derived instances for the wrappers
  instance DeriveShow Lex
  instance DeriveShow Glex

But given newtype deriving, wich should work for you for everything 
except Show and Read, this may well be overkill.


  Tillmann
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Conal Elliott
On 8/5/07, Frank Buss [EMAIL PROTECTED] wrote:
 Nearly anything works without thinking too much about the types, but I
 don't like the use of fromInteger in the average and main functions. Is it
 possible that the integers are automaticly converted to floats?

I recommend using Float or Double instead of Int for your point
coordinates.  You'll eliminate  the need to convert to Float/Double.  More
importantly, your whole model will then be resolution independent,
supporting continuous scaling, sub-pixel translation, rotation, etc.  See
http://conal.net/Pan for examples  papers.

Cheers,  - Conal
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Frank Buss
Hi Conal,
 
I've tried some links, e.g. the pre-compiled components from
http://conal.net/Pan/Releases/2000-12-06/ or the interactive presentation
from http://conal.net/Pan/papers.htm , but file not found. Do you have the
files? Would be easier than trying to setup Haskell and Visual C++
environment for compiling it (looks like the sources link works). BTW: There
is Visual Studio Express, maybe you want to update your webpage, because
Microsoft gives it away for free, if it can be used with Pan.
 
How fast is your implementation? I've downloaded werkkzeug from
http://www.theprodukkt.com/werkkzeug1#25 . The user interface is a bit
unusual, but if you start the tutorial, it can display a texture example
with about 50 composed functions and 256x256 pixels with about 300 fps. I've
emailed the author and they didn't revealed much about the implementation,
but said it was C with some inline assembler. I assume to make it fast, a
good idea would be to cache some calculations, e.g. if you want a swirl
effect, for all destination image cache all source positions, for the
desired destination image size.

Regards,
 
Frank

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Jon Harrop
On Tuesday 07 August 2007 21:22:00 Frank Buss wrote:
 I assume to make it fast, a good idea would be to cache some calculations...

If you want to make it fast you should be using hardware acceleration.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?e
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Sudoku Solver

2007-08-07 Thread Murray Gross


Yes, by 25x25 puzzles I mean sudoku puzzles with 25 cells on each side, 
with the smaller squares being 5x5 (i.e., we need to construct rows with 
the numbers 1-25, and the smaller squares must each contain all of the 
numbers 1-25).


Murray Gross
Brooklyn College



On Tue, 7 Aug 2007, Hugh Perkins wrote:


On 8/7/07, Hugh Perkins [EMAIL PROTECTED] wrote:


Question: what do you mean by, for example 25x25?  Do you mean grids with
a total length of 25 on each side, eg:



(because on my super-dooper 1.66GHz Celeron, generating 10 random 25x25
grids such as the one above takes about 1.01 seconds; solving an actual
puzzle should be faster because the solution space is more tightly
constrained?)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Conal Elliott
I agree with Jon.  And hardware acceleration is in tension with the
generality of the extreme generality of formulating images as general
(computable) functions on space (and hence arbitrary non-linear
transformations, etc).

*Unless*, you abandon the traditional acceleration of a fixed set of 2D (or
3D) primitives and transformations and instead compile into graphics
processor code as in http://conal.net/Vertigo.

BTW, I'd love to find one or more enthusiastic collaborators to help create
and release open-source, cross-platform, and successors to Pan  Vertigo.
Anyone interested?

  - Conal

On 8/7/07, Jon Harrop [EMAIL PROTECTED] wrote:

 On Tuesday 07 August 2007 21:22:00 Frank Buss wrote:
  I assume to make it fast, a good idea would be to cache some
 calculations...

 If you want to make it fast you should be using hardware acceleration.

 --
 Dr Jon D Harrop, Flying Frog Consultancy Ltd.
 OCaml for Scientists
 http://www.ffconsultancy.com/products/ocaml_for_scientists/?e
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Conal Elliott
Hi Frank,

Pan has been bit-rotten for a while now.  Besides the unfortunate dependency
on Visual C++, it used a now long-obsolete GUI library.  That's one reason I
started working on Pajama (http://conal.net/Pajama).

There's no reason not to create modern, cross-platform successors to
Pan/Pajama and Vertigo.  Since I'm focusing on other projects (related to
Eros -- http://conal.net/papers/Eros), I'm waiting for collaborators.

Thanks for the VS Express tip.  If I wanted to stick with VS, that'd be the
way to go.

I hadn't heard about werkkzeug.  Looks pretty cool.  Thanks.

Regards,
  - Conal

On 8/7/07, Frank Buss [EMAIL PROTECTED] wrote:

 Hi Conal,

 I've tried some links, e.g. the pre-compiled components from
 http://conal.net/Pan/Releases/2000-12-06/ or the interactive presentation
 from http://conal.net/Pan/papers.htm , but file not found. Do you have the
 files? Would be easier than trying to setup Haskell and Visual C++
 environment for compiling it (looks like the sources link works). BTW:
 There
 is Visual Studio Express, maybe you want to update your webpage, because
 Microsoft gives it away for free, if it can be used with Pan.

 How fast is your implementation? I've downloaded werkkzeug from
 http://www.theprodukkt.com/werkkzeug1#25 . The user interface is a bit
 unusual, but if you start the tutorial, it can display a texture example
 with about 50 composed functions and 256x256 pixels with about 300 fps.
 I've
 emailed the author and they didn't revealed much about the implementation,
 but said it was C with some inline assembler. I assume to make it fast, a
 good idea would be to cache some calculations, e.g. if you want a swirl
 effect, for all destination image cache all source positions, for the
 desired destination image size.

 Regards,

 Frank

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] creating graphics the functional way

2007-08-07 Thread Hugh Perkins
On 8/8/07, Conal Elliott [EMAIL PROTECTED] wrote:

 *Unless*, you abandon the traditional acceleration of a fixed set of 2D
 (or 3D) primitives and transformations and instead compile into graphics
 processor code as in http://conal.net/Vertigo .


Wow, cool :-)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe