Sign in to follow this  
ranakor

recommand a functional language with a GOOD IDE

Recommended Posts

ranakor    439
I want to learn a pure functional language before i get started learning F# however when i tried some haskell all i found was an interpreter and a command line compiler iirc . That may just sound lazy , but i don't want to put up with that and that's a no compromise , i'm used to vstudio / knowing errors on the fly before i even hit compile (C#) hit a single button and it builds/report errors/run so the whole hit save go to command line hit compile read potentatial errors and if there are none run separately way of doing is a NO GO. Now i'm not asking a vstudio like interface but are there any languages that come out of the box (or have a well supported, non awkward to setup) with an ide that at least lets you type code , does some basic syntax coloring (at least keyword in a color & my code in another) and simply have a big compile & run button i could click? I'm sure there are but i thought i'd just ask instead of trying to repertoriate all the functional languages and then checking out all of their IDEs. If you know of multiple the most (in that order) mainstream , pure functional , easy to learn language is best. Thanks for your help.

Share this post


Link to post
Share on other sites
Chu    154
Notepad++ (and I'm sure other editors) supports syntax highlighting for Haskell.

But I think what you're after is Visual Haskell - http://www.haskell.org/visualhaskell/ :)

Edit: Alternatively, although not quite what you're asking for, there's an IDE for Haskell on Windows called Hugs, it's just an interpreter (I believe?), but it's good for getting a comfortable feel for Haskell.

Share this post


Link to post
Share on other sites
INsanityDesign    138
Related to Haskell, you could use Leksah or have a look in the pretty good Wiki at http://www.haskell.org/haskellwiki/ (which gives away other IDEs like EclipseFP for overall functional programming). And for a GameDev example, there is a Quake Haskell named FRAG (http://code.haskell.org/frag/).

To the overall functional programming question:
Thats again a principle discussion with everyone having its favourite. Personally, I am no functional crack but I kind of dig F#. Still Haskell I had to learn and it has some good points and examples for GameDev especially.

So, maybe just try Haskell or go with F#. Or wait for others to comment and give more practical approaches as I am no FP programmer. ^^'

Share this post


Link to post
Share on other sites
Daerax    1207
In addition to the Visual Haskell link posted by Chu, you want the Visual Studio Shell.

Its a free full functioning shell of visual studio - just without any built in languages. however debugging, highlighting the full visual studio IDE is there. it allows you to use languages which have plugins for visual studio. Because the plugin is for visual studio 2005 and I do not know if there is a free shell for that you will have to manually install the plugin for 2008. I am sure the various instructions required are scattered online. It will be tedious though.

In the functional language spectrum I know of two that are maintained. F# which you know. And Nemerle which I prefer.

For Eclipse there is Scala. It been a while since I used it but I do not think intellisense is there and the IDE is not as good as visual studio. I think Clean has its own IDE but it does not have debugging - which to be honest is not really needed in languages like it - nor intellisense.

----

Im curious. Why the emphasis on pure? You can restrict your self to the pure subset of F# by not using the words mutable or ref in your code. It is interesting that you are trying to prepare yourself for F# with haskell, most people go the other way round :)

[Edited by - Daerax on August 18, 2008 7:41:10 AM]

Share this post


Link to post
Share on other sites
mich4elp    176
How about Scheme( http://en.wikipedia.org/wiki/Scheme_(programming_language) ) as the language and Dr. Scheme( http://www.drscheme.org/ ) ?

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by ranakor
I want to learn a pure functional language before i get started learning F# however when i tried some haskell all i found was an interpreter and a command line compiler iirc . That may just sound lazy , but i don't want to put up with that and that's a no compromise , i'm used to vstudio / knowing errors on the fly before i even hit compile (C#) hit a single button and it builds/report errors/run so the whole hit save go to command line hit compile read potentatial errors and if there are none run separately way of doing is a NO GO.
How did you manage to not find any Haskell IDEs?

Share this post


Link to post
Share on other sites
ranakor    439
Thanks for the suggestions:

Visual haskell sounds exactly like what i need and as a bonus i'll feel at home with the GUI.

The reason i'm going for pure functional before F# and not the other way around is that i'm not interested in a transition to functional but in F# itself , i want to try out other paradigms and F# allows me to do it in .net wich is my field. I could go straight for F# but then i'll use it like C# , learning some form of functional language first will force me to work functional and then let me do that too whenever i'll use F#.

sneftel: I'm NOT looking for a haskell ide , i'm looking for a (imagine i quoted myself here) , you're compressing my question in a very lossy way. I'm looking for ANY functional language ide that does syntax highlighting and has a compile button and want help selecting one. That's not yet something google can do. Your results give visual haskell as last result of 1st page , should i have downloaded all the others 1st & tried it? or refined my search? because googling for haskell ide compile syntax highlighting actually removes it from the 1st page. Also searching for "the best ide among all functional languages" isn't gonna provide a whole lot of results and that's what i want , i'm not gonna use the language for long it's just a learning platform for me so i want to have nice tools to toy around with so whenever i make a 1 liner change in a stupid 3 line file i don't have something cumbersome to do to even see if it compiles.

Share this post


Link to post
Share on other sites
Sneftel    1788
Ah, I see. The wordcount you spent defending your decision to use an IDE made me assume that you were implying that this seemed to rule out pure functional languages. Sorry for misinterpreting.

As for which one, I'm not entirely but mostly happy with the Haskell plugin for Eclipse. It's a great IDE overall, and it actually does do continuous compilation. It also has syntax highlighting. I thiiiink it has completion, but I'm not sure.

Share this post


Link to post
Share on other sites
Daerax    1207
Quote:
Original post by ranakor

The reason i'm going for pure functional before F# and not the other way around is that i'm not interested in a transition to functional but in F# itself , i want to try out other paradigms and F# allows me to do it in .net wich is my field. I could go straight for F# but then i'll use it like C# , learning some form of functional language first will force me to work functional and then let me do that too whenever i'll use F#.


Cool. I do that too :)

If you are interested in F# itself then why dont you simply restrict yourself to the functional subset? The imperative mechanisms in the language are clunky and non obvious enough that you will likely not even have to discipline yourself to remain pure. You will prefer it.

The thing is that learning haskell and going to F# you will still end up having to relearn Alot. Time you would have saved by learning the basic concepts of functional languages [which are independent of all functional languages] in your target language itself while also getting used to your target paradigm. That way you get used to the F# way of doing things - which is fairly different from the haskell way.

Share this post


Link to post
Share on other sites
ranakor    439
Hmmm how diferent would it be? Is it diferent in the logic or mostly syntactically? Also when you say i'd have to relearn a lot do you mean only to get to the F# way/logic or because of the .net framework? Because i'm already pretty proficient in C#/.net fx.

I guess i could try to restrict myself & use F# but the issue is i don't know what the functional way is or where functional/imperative blend & where they are clear cut so i risk using a merge of both at times & missing out on "that other way to do things". Note that i posted here because i respect the members's opinion in here but , and i should have specified it before , this is nor specially for games: this is to learn as another everyday useage programming language (i want to be future proof so F# came next on my list now that i'm done learning linq/wpf/wcf to a reasonable level)

edit: Note that i own "Expert F#" from Apress , haven't opened it yet (bought it with a large batch of books a few monthes back) . Did you read that book per chance? If so is it pure functional oriented? Because if so i guess F# while sticking to what the books teaches would do too ... Had forgotten i had that lol.

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by ranakor
Hmmm how diferent would it be? Is it diferent in the logic or mostly syntactically? Also when you say i'd have to relearn a lot do you mean only to get to the F# way/logic or because of the .net framework? Because i'm already pretty proficient in C#/.net fx.

Haskell is a pure functional language, whereas F# is not. Because F# is a mixed paradigm language, the framework and the documentation skip over certain areas of functional programming. For instance, monads are vaguely supported in F#, but not really used. This is fine for a mixed paradigm language, since <whine>monads are haaaaard</whine> and breaking out of them to do things the procedural way is easier. That means, however, that you don't get the beneficial mind expansion of learning how stateful and effectful programming really works in a functional paradigm.

Haskell wasn't the first functional programming language I learned, and I'm not sure if it would have been as easy for me to learn if I hadn't already grokked the basics of FP using ML and Scheme. I think, though, that it was far and away the most useful of the three to learn. Learning Scheme made me better at thinking about code vs. data, though it wasn't a particularly deep lesson. Learning ML made me appreciate functional programming, Learning Haskell made me a better programmer, full stop.

One more thing: F# is an experimental language. Think of it as a .NET version of ML, as well as a proving ground for half-baked cool-sounding theoretical programming language features. This is a good thing if your objective is to play around, but it's not so great if you're just learning FP and are unable to separate the Right Way from the Strange But Cool New Way. I don't think F# would make a good first functional language, though I think it'd make a great (and actually useful) second or third.

Share this post


Link to post
Share on other sites
Simian Man    1022
A good IDE is nice and all, but it is a good skill to be able to fall back on a text editor and command line tools. With most editors, and a little bit of configuration, you can run whatever command line tools you want from within the editor.

Since you are on Windows, the best text editor for you would probably be Notepad++. I haven't used it as I develop on Linux, but I have heard great things about it. Here is a description of how to use run external tools from within the editor.

With a good text editor and a bit of work, you can have an effective IDE that you can use for whatever languages you want. I use Kate to edit C++, Python, Verilog, Scheme, Ocaml, HTML and LaTeX and can compile/run/view all of them with a single keystroke.

Share this post


Link to post
Share on other sites
Daerax    1207
Quote:
Original post by ranakor
Hmmm how diferent would it be? Is it diferent in the logic or mostly syntactically? Also when you say i'd have to relearn a lot do you mean only to get to the F# way/logic or because of the .net framework? Because i'm already pretty proficient in C#/.net fx.

I guess i could try to restrict myself & use F# but the issue is i don't know what the functional way is or where functional/imperative blend & where they are clear cut so i risk using a merge of both at times & missing out on "that other way to do things". Note that i posted here because i respect the members's opinion in here but , and i should have specified it before , this is nor specially for games: this is to learn as another everyday useage programming language (i want to be future proof so F# came next on my list now that i'm done learning linq/wpf/wcf to a reasonable level)

edit: Note that i own "Expert F#" from Apress , haven't opened it yet (bought it with a large batch of books a few monthes back) . Did you read that book per chance? If so is it pure functional oriented? Because if so i guess F# while sticking to what the books teaches would do too ... Had forgotten i had that lol.


I have that book :). And the other one Foundations of F#. Yes you will learn functional programming from going through it. In F# if you do not use "<-", ":=", "ref", or "mutable" then you are almost certainly not doing imperative programming. F# also uses immutable collections. This is the other aspect that is different from say C#.

Like Sneftel said Haskell will introduce you to things like higher order polymorphism, a reliance on algebraic types and pattern matching for arranging code and monads since they are a core part of the language (although there is nothing inherently functional oriented about them nor is their real benefit to do with packaging effects and state, what you will learn from them is do with flow, control, composition and domain specialization within a monad - this aspect is introduced in a friendly manner in Expert F#). Although F# also is based around patterns, I have found that most of the things I know from Haskell only really apply in the core (e.g. functional programming and using composition to great effect). The way of thinking about how to organize code and the overlying concepts are different.

My suggestion would be Learn F# till you are comfortable. Expert F# really is an excellent book for that. Then Pick up Haskell to really learn everything at its purest (e.g. going to train with some shaolin monks) and when you want to make something useful (e.g. an environment with loads of libraries) then go back to F# :p. This is the fast track way. Learning haskell from scratch tends to be difficult because there are not many beginner friendly tutorials. Even Yet Another Haskell tutorial is dense for a complete beginner. I have not read this though.

Sneftel - F# is a stable language now in terms of features and is currently going official producterization. Monads are fully supported in F#. However things which require Type constructor polymorphism like Monad Transformers or even Monadic Combinators are not.

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by Daerax
Sneftel - F# is a stable language now in terms of features and is currently going official producterization.

Regardless, it still has plenty of half-baked features left over. "Official producterization" (?) sounds like they don't intend to do any further baking.
Quote:
Monads are fully supported in F#. However things which require Type constructor polymorphism like Monad Transformers or even Monadic Combinators are not.
Monads are supported, but that's a lot different than monads being the normal way of performing sequence-structured computation. Monad transformers are more a type system doohickey than an essential functional programming tool, so their absence isn't a big problem, but the status of monads in F# is indicative of its functional impurity. Which is not to say it's a bad language, of course.

Share this post


Link to post
Share on other sites
Daerax    1207
Quote:
Original post by Sneftel
Regardless, it still has plenty of half-baked features left over. "Official producterization" (?) sounds like they don't intend to do any further baking.
I have this habit of using suffixes inappropriately.

Quote:
Monads are supported, but that's a lot different than monads being the normal way of performing sequence-structured computation. Monad transformers are more a type system doohickey than an essential functional programming tool, so their absence isn't a big problem, but the status of monads in F# is indicative of its functional impurity. Which is not to say it's a bad language, of course.


F# is a multiparadigm language. Monadic programming is supported in the same sense that OOP is supported. Sequence structure computation is only a small part of what Monads are useful for, it is an unfortunate by product of having been introduced in a lazy pure language that this aspect gets so much press. Monad Transformers are not part of the type system, although they are only really possible in a richer type system than .NET provides. But you can achieve the same way in an untyped language (and even safely if the typing is done in a staged manner by presenting the library as a dsl when programming in a language which supports strong metaprogramming as I did). But they allow you to do better functional programming in that you can compose different monads and generalize your code better.

Finally monadic computation expressions/sequencing is a major part of the language. It is just done in such a straightforward manner that the user does not know they are using it, though they will recognize it if they were to learn see it in haskell.

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by Daerax
Sequence structure computation is only a small part of what Monads are useful for, it is an unfortunate by product of having been introduced in a lazy pure language that this aspect gets so much press.

It's unfortunate that IO is the only monad most people -- even Haskell programmers -- are familiar with. But sequenced computation is, well, pretty much the entire part of what monads are useful for. That's why one of the three main monad operators is the sequence operator. I probably should draw a more explicit distinction between sequenced computation and effectful computation, though.
Quote:
Monadic Transformers are not part of the type system, although they are only really possible in a richer type system than .NET provides. But you can achieve the same way in an untyped language (and even safely if the typing is done in a staged manner by writing the library in a dsl using a language which supports strong metaprogramming as I did). But they allow you to do better functional programming in that you can compose different monads and generalize your code better.
That's what I mean. The power of Haskell's type system is far beyond virtually any other programming language out there, and as a result it can do things like monad transformers (almost) without blinking. In fact, though they are useful, I have a suspicion that their primary initial draw was as a compelling demo of Haskell's typing power. Nevertheless, I think monad transformers, in their current form, still have a lot of growing up to do. Even in Haskell their syntax can be a little atrocious, and writing your own involves seeing error messages that no man should ever see. (Dear God, when I close my eyes I can still see the nested foralls!) From that perspective, transformers are actually nicer in dynamically typed languages, where you don't have to find your way around those dusty little corners. (Disclaimer: that's based on very limited experience with transformers in dynamically typed languages.)

Share this post


Link to post
Share on other sites
Daerax    1207
Quote:
Original post by Sneftel
It's unfortunate that IO is the only monad most people -- even Haskell programmers -- are familiar with. But sequenced computation is, well, pretty much the entire part of what monads are useful for. That's why one of the three main monad operators is the sequence operator. I probably should draw a more explicit distinction between sequenced computation and effectful computation, though.


The sequence operator is kind of a misnomer it is more a throw away this computation operator, you can write it in terms of the bind and return functions. some monads can be commutative and there sequencing does not matter. Also see my above edit. sequenced computations within monads are a major part of F#. There they are called computation and sequence expressions and are introduced in a friendlier manner.

Quote:
That's what I mean. The power of Haskell's type system is far beyond virtually any other programming language out there, and as a result it can do things like monad transformers (almost) without blinking. In fact, though they are useful, I have a suspicion that their primary initial draw was as a compelling demo of Haskell's typing power. Nevertheless, I think monad transformers, in their current form, still have a lot of growing up to do. Even in Haskell their syntax can be a little atrocious, and writing your own involves seeing error messages that no man should ever see. (Dear God, when I close my eyes I can still see the nested foralls!) From that perspective, transformers are actually nicer in dynamically typed languages, where you don't have to find your way around those dusty little corners. (Disclaimer: that's based on very limited experience with transformers in dynamically typed languages.)


But I only had to write the DSL once and now I can use it on all monads, within static type safety, as naturally as if it were built in.

Yeah haskell's type system is matched perhaps only by ML in a production language - if you consider modules from the perspective of type classes - and not as cleanly. But you are right sometimes a type system can be too helpful.

also i think you are right correct the compiler showcase - I think i read about it in one of wadler's papers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this