Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-11 Thread Peter Verswyvelen
Yes I have. I actually bought the few only F# books available. It's a 
nice language, and an incredible amount of work. The Visual Studio 
plugin also works well.


But somehow I found Haskell cleaner... Its laziness is a better for me ;-)

But I might switch back to F# someday, and then learning Haskell will 
have helped a lot.


Hugh Perkins wrote:

Have you tried F#?  I mean, I havent ;-) but maybe it's an interesting
half-way house?  Presumably you can use all the standard .Net
libraries (maybe good enough for getting asp.net working etc?), and
you can still use FP constructs?

I understand F# is not pure (I think?), and doesnt have monads, but
hey, life's full of compromises ;-)


  


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


Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-10 Thread Hugh Perkins
On 10/3/07, Peter Verswyvelen [EMAIL PROTECTED] wrote:
 I needed to type at least 3 times the amount of code, much
 of which was boilerplate code, and the code is not elegant.

Reflection is your friend here.

Example.  Code before reflection:

MyConfig
{
   // some properties here

   public MyConfig()
{
   XmlDocument dom = XmlHelper.Loadxml(config.xml);
   somevalue1 = getIntValue( dom, value1);
   somevalue2 = getStringValue( dom, value2);
   // blah, blah, blah...
   }
}

With reflection:

MyConfig
{
   // some properties here

   public MyConfig()
{
   ReflectionHelper.LoadMe( this, config.xml );
   }
}

Just typed this in off the top of my head, so it might have errors in,
but you get the idea.

Of course, in this case you could just use Microsoft XmlSerializer,
but I quite like the flexibility of using my own serializer (it's not
that hard to write, just a hundred lines or so).

... but then, you can do something similar to display arbitrary
objects to html... or write to sql... or write to a proprietary
protocol... or ... many things!

I kindof know what you mean though.  Declaring variable types is
kindof a pain, and of course anything to do with lists is insanely
easier to write in Haskell (/Erlang).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-10 Thread Peter Verswyvelen
Thanks for the C# advise, but I was actually just comparing my C# code 
with similar Haskell code. Yes, I also like aspect oriented programming, 
dynamic code generation, and LINQ to avoid boilerplate code in C#, but 
this is a Haskell group, and I want to be curried ;-)


But, for my students I'm actually building a small website, webservice, 
database with some rich client applications, in C# 3.0... I would really 
love to do that in Haskell, but I haven't got a clue how to start. I 
would need a replacement for ASP.NET (e.g. generating HTML on the 
server, similar to the PHP stuff), LINQ (translating Haskell to SQL), 
webservice wrapper generators, webservice security, etc... Any hints on 
useful Haskell packages would be very welcome. LINQ takes its ideas from 
FP, so maybe Haskell already had something similar for decades? :)




Hugh Perkins wrote:

On 10/3/07, Peter Verswyvelen [EMAIL PROTECTED] wrote:
  

I needed to type at least 3 times the amount of code, much
of which was boilerplate code, and the code is not elegant.



Reflection is your friend here.

Example.  Code before reflection:

MyConfig
{
   // some properties here

   public MyConfig()
{
   XmlDocument dom = XmlHelper.Loadxml(config.xml);
   somevalue1 = getIntValue( dom, value1);
   somevalue2 = getStringValue( dom, value2);
   // blah, blah, blah...
   }
}

With reflection:

MyConfig
{
   // some properties here

   public MyConfig()
{
   ReflectionHelper.LoadMe( this, config.xml );
   }
}

Just typed this in off the top of my head, so it might have errors in,
but you get the idea.

Of course, in this case you could just use Microsoft XmlSerializer,
but I quite like the flexibility of using my own serializer (it's not
that hard to write, just a hundred lines or so).

... but then, you can do something similar to display arbitrary
objects to html... or write to sql... or write to a proprietary
protocol... or ... many things!

I kindof know what you mean though.  Declaring variable types is
kindof a pain, and of course anything to do with lists is insanely
easier to write in Haskell (/Erlang).


  


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


Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-10 Thread Hugh Perkins
Have you tried F#?  I mean, I havent ;-) but maybe it's an interesting
half-way house?  Presumably you can use all the standard .Net
libraries (maybe good enough for getting asp.net working etc?), and
you can still use FP constructs?

I understand F# is not pure (I think?), and doesnt have monads, but
hey, life's full of compromises ;-)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-10 Thread Justin Bailey
On 10/10/07, Peter Verswyvelen [EMAIL PROTECTED] wrote:



A noble goal and I wish you luck. I'd love to see if you get .NET working
with Haskell - I have tried to figure it out from that old build of Hugs and
never had any luck. Tantalizingly, the GHC source has some Dotnet stuff in
it but it doesn't seem to be in use anywhere (
http://darcs.haskell.org/libraries/base/GHC/Dotnet.hs).

Anyways, to answer your questions:

 * ASP.net - I think you want to look at HAps here - http://happs.org/
 * LINQ, etc. - I don't know but there are several database libraries
available on hackage (
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Database)
 * webServices - Unknown but I have been using HXT lately (a haskell XML
parser). It was a nightmare to figure out how to use it, but by reading the
thesis about building an RDF parser I was able to make some decent progress.
Maybe hackage has a webservice library?

If you make some progress please share!

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


Re: [Haskell-cafe] Hugs, dotnet, C#...

2007-10-08 Thread Neil Mitchell
Hi Peter,

There is a Dotnet tree in the Hugs source code files, which I believe
is what supports dotnet. As far as I am aware, it probably won't work.
A windows developer may be able to build it, but I've never tried.

You might also be interested to know that Yhc supports --dotnet to
generate a dotnet binary. I think it can FFI call the dotnet
framework, but I'm not sure.

IDE's are hard, and only Microsoft does them right - perhaps one day
if Haskell becomes popular enough we'll get something.

Thanks

Neil


On 10/3/07, Peter Verswyvelen [EMAIL PROTECTED] wrote:

  In the (Win)Hugs documentation, I found

  Only the ccall, stdcall and dotnet calling conventions are supported. All
 others are flagged as errors.

  However, I fail to find any more information on how to invoke dotnet
 methods. This might be really handy for me, as I'm very familiar with the
 dotnet framework.

  For example, yesterday I rewrote and extended a program that I wanted to
 develop in Haskell in just 3 hours using dotnet, while I spend weeks trying
 do this in Haskell. Of course, I'm a Haskell newbie and a dotnet expert, so
 this is not a fair comparison. However, I got a strange feeling, which I
 want to share with you :) First of all, it was a *horrible* experience to
 program C# again; I needed to type at least 3 times the amount of code, much
 of which was boilerplate code, and the code is not elegant. Haskell really
 changed my point of view on this; before I knew Haskell, I found C# (I'm
 talking C# 3.0 here) a really neat and nice language. On the other hand, the
 great Visual Studio IDE and Resharper addin made it at least 3 times faster
 to type, navigate, refactor, and debug the code... Somehow, I get things
 done really really really fast in C#, albeit in an ugly way. Once again, I
 just wish Haskell had such an IDE... And yes, I know of the existance of
 Visual Haskell, EclipseFP, Haskell Mode for Emacs (which I'm using), VIM,
 YI, but still, these do not compare with the experience I have when using
 Visual Studio/Resharper (or Eclipse or IntelliJ/IDEA for Java). But that
 might just be me of course...

  A slightly frustrated Peter ;-)

  BTW: I don't want to bring up the IDE discussion again, no really ;-)



 ___
 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


[Haskell-cafe] Hugs, dotnet, C#...

2007-10-03 Thread Peter Verswyvelen

In the (Win)Hugs documentation, I found

Only the ccall, stdcall and *dotnet *calling conventions are supported. 
All others are flagged as errors.


However, I fail to find any more information on how to invoke dotnet 
methods. This might be really handy for me, as I'm very familiar with 
the dotnet framework.


For example, yesterday I rewrote and extended a program that I wanted to 
develop in Haskell in just 3 hours using dotnet, while I spend weeks 
trying do this in Haskell. Of course, I'm a Haskell newbie and a dotnet 
expert, so this is not a fair comparison. However, I got a strange 
feeling, which I want to share with you :) First of all, it was a 
*horrible* experience to program C# again; I needed to type at least 3 
times the amount of code, much of which was boilerplate code, and the 
code is not elegant. Haskell really changed my point of view on this; 
before I knew Haskell, I found C# (I'm talking C# 3.0 here) a really 
neat and nice language. On the other hand, the great Visual Studio IDE 
and Resharper addin made it at least 3 times faster to type, navigate, 
refactor, and debug the code... Somehow, I get things done really really 
really fast in C#, albeit in an ugly way. Once again, I just wish 
Haskell had such an IDE... And yes, I know of the existance of Visual 
Haskell, EclipseFP, Haskell Mode for Emacs (which I'm using), VIM, YI, 
but still, these do not compare with the experience I have when using 
Visual Studio/Resharper (or Eclipse or IntelliJ/IDEA for Java). But that 
might just be me of course...


A slightly frustrated Peter ;-)

BTW: I don't want to bring up the IDE discussion again, no really ;-)


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