Domain: haskell.org
Stories and comments across the archive that link to haskell.org.
Comments · 393
-
Why can't code be more spec-like?
Unfortunately, there will always be a disconnect between specs and code. Programming languages have cruft and artifacts that will always force code != specs.
Here's an interesting paper called "Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity" about a programming language experiment. The Naval Surface Warfare Center had programmers implement a "geometric region server" (a component of the Navy's AEGIS system) in their language of choice. Program length and development time for each project are compared for the different languages. The surprise "winner" was an extemely concise program written (by the paper's author, of course) in the functional programming lanaguage Haskell. The other languages have so much cruft that eventually makes the code look nothing like the "human readable" spec.
Compare! ;-)
LANGUAGE, LINES OF CODE, LINES OF DOC, DEV TIME (HOURS)
Haskell #1, 85, 465, 10
Haskell #2, 156, 112, 8
My favorite quote from the paper:
"In conducting the independent design review at Intermetrics, there was a significant sense of disbelief. We quote from (CHJ93): "It is significant that Mr. Domanski, Mr. Banowetz, and Dr. Brosgol were all surprised and suspicious when we told them that the Haskell prototype P1 is a complete tested executable program. We provided them with a copy of P1 without explaining that it was a program, and based on preconceptions from their past experience, they had studied P1 under the assumption that it was a mixture of requirements specifications and top level design. They were convinced it was incomplete because it did not address issues such as data structure design and execution order." -
Bravo to the HOWTO authorA cool HOWTO. Clearly it could use some fleshing out, but that's more a "You're going in the right direction" rather than "You didn't do enough". Writing doc is one of those thankless tasks, but I'm glad someone is doing it.
Now if only there was an environment that provided something outside the Algol family. Oh wait, of course, I can use Forth. I RPN like not.
:-) A nice functional language (Haskell being my current fave) would be well-suited to the MindStorms system. Pure functional PLs handle data flow so cleanly, and the flow from sensors to actuators is exactly that. Six built-in primitives for the three sensors and the three actuators.A simple Braitenberg-style mouse:
main = union (connect sensor1 actuator2) (connect sensor2 actuator1)
Simple, clear, understandable. I like it. -
Templates/genericity/polymorphism and Haskell
Or for excellent parametric polymorphism, garbage collection, loads of useful API bindings, native compilation and lazy evaluation, try
Haskell. For the length example:
length [] = 0
length (x:xs) = 1 + length xs
More interesting examples use the lazy evaluation in Haskell to allow clean specification of algorithms without worry about trying to write the most efficient code. For instance if I wanted to sum the first ten numbers in the fibonacci sequence I might write:
fibonacci = (fib 0 1) where fib x y = x : fib y (x + y)
sum [] = 0
sum (x:xs) = x + sum xs
take 0 _ = []
take n (x:xs) = x : take (n-1) xs
sum_of_first_five = sum (take 10 fibonacci)
This program uses seemingly infinite recursion. However, thanks to lazy evaluation only the actual instructions that are required to evaluation the sum of the first five members will ever be run.
I'd recommend language hackers take a look at this elegant language. A Linux/Windows compiler is available as well as an interpreter for those who just want to tinker around with it. It even uses syntactic white space :-)
(Apologies to any Haskell hackers who spot mistakes in my code - it's been a while since I wrote any Haskell) -
Re:For good "template" support: try ML
Actually, If your interested in type system stuff you should really check out Haskell. Haskell is a lazy functional langauge (ML is strict), so things do not evaluate unless they are needed. This means no lisp/ML style cheating with side effects to do IO. Instead Haskell uses a type system construct called monads to allow for IO, variables, side effects, and OOP. Actually, monads are really the best resolution to the apperent conflict between object oriented and functional programming. the monads have evolved far enough to allow you to simulate an imperitive object oriented langauge within Haskell.
Anywho, Haskell's type system pretty much blows most langauge (including most functional langauges) out of thge water. The types for essentially every variable are derived from the contex where the variable is used, but there are still really nice systems for overloading / signatures / interfaces, type parameters, and type derivation.
It's possible that ML has caught up with Haskell's type features, but there are some interpreted varients of Haskell (maybe Gofer) which have crazy type parameterization by parameterizable type features (or something like that.. I forget). I think they have a type system for types (called kinds) to allow recursive type definitions or something insane like that.
Really, Haskell is one of the most fun langauges when you enjoy this sort of shit. I hear rummors you can use it for practical stuff too, but I wouldn't know anyhting about that. :) -
Re:A couple of reasons:Hello!
It was written, that functional languages seem to be significantly slower than e.g. C or other imperative languages.
That might be true. However, in a project here at work, we programmed a network line simulator (connect any number of BSD tun interfaces and/or Ethernet interfaces attached to with bpf, with routing and simulation of delay/loss characteristics).
As a test, we wrote a program in C, connecting two tun interfaces with no loss and no delay, and we configured the Haskell program to do the same. The performance loss was about 30%. And that, while the Haskell program is configurable and thus does things the C program did not do.
Compilation was with GHC, gcc 2.95.2 as backend compiler.
See Libraries and Tools for Haskell as a counterexample for the claim that there are virtually no tools. The only thing still missing is a CORBA binding. But that's not true for all "niche languages", e.g. Mercury, Erlang.
The struggles with non-imperative programming in first-term Haskell/Gofer/... courses is true - for those who have already experienced imperative programming and want to transfer that onto a FP language. Interestingly, people having had no programming experience at all had a less hard time!
Regards,
Hannah.
-
getting functional languages acceptedThe only way to get functional languages accepted is by a grassroots effort similar to those that have resulted in the popularity of perl and python. There is NO WAY that a commercial programming shop is going to go with obscure languages, much less obscure languages that go against the dominant programming paradigms, for good practical reasons that have been summarized elsewhere in this thread. So don't waste your time! Instead, look at tasks where functional or functional-friendly languages can serve useful purposes.
In my opinion, working with "pure" functional languages like Haskell which do not allow any form of imperative updating (and yes, I know about monads) is too difficult for most programmers at this point in time. Therefore, I advocate languages like Objective CAML and guile scheme which support imperative programming as well as functional programming. These languages have different niches:
-- Objective CAML is an extremely fast dialect of ML with full static type checking and an object system (and, AFAIK, the only statically-typed functional language that has any object system at all). Timing tests have shown that ocaml can compile to within 25% of hand-optimized C code for many computationally-intensive tasks. Thus, many tasks that would normally be done in C++ can be done in ocaml.
-- guile scheme is a dialect of scheme which is targeted at the python niche: a scripting/extension language. There is no good reason why scheme can't be a superb extension language.
Unfortunately, as of this moment it's not possible AFAIK to build an application using ocaml on the bottom and guile as an extension language, but hopefully this will happen in time. Regardless, the point is to use these languages for your own pet programming projects, get the source out there, spread the word, and let functional programming grow organically, instead of trying to force it down people's throats.
Mike
-
Re:This answers are obvious...
> Lots of Irritating Silly Parentheses and
...
Although some functional programming languages use a lot of parentheses, this is not true for all of them. Haskell for example hardly uses any parentheses and has about the cleanest syntax of any language I have seen.
While you may associate functional programming languages with recursive thinking, please do not associate them with Lots of Irritating Silly Parentheses as this is just plain false. -
Re:Why Functional MattersNobody says that you can catch all errors with a good type system, but my experience with writing (lots of) Haskell is that a good type system can catch a lot of errors - in particular also a large number of logical errors. Personally, I would say that Haskell catches at least half (probably much more) of the errors during compilation that would lead to a core dump in a C program.
This of course implies that you make good use of the type system and choose good type abstractions and annotate all top-level functions with type signatures.
Chilli
PS: Look at my Web page, I have written a lot of Haskell code and it works very well for me.
-
Re:Some practical issuesCheck out the Glasgow Haskell Compiler. It can generate C code and that's how it is bootstrapped on new platforms. A Java backend is just in the works. The RTS is statically linked and it just got a nice interface to call C code (and call Haskell from C). It generates good code and has a sophisticated profiler to help you speed up things if need be.
And of course it is open source (with CVS and all).
Chilli
-
quicksort in Haskell
Here is a quicksort in Haskell from http://www.haskell.org/aboutHaskell.html:
qsort []= []
qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x
where
elts_lt_x= [y | y <- xs, y < x]
elts_greq_x = [y | y <- xs, y >= x]
Functional languages work recursively, but they make your mind work inductively . If you can handle going from n to n+1, then you can handle any depth of recursion. -
give it a try!The reasons why functional languages are not more widely used are the same reasons why other "minority" languages aren't more widely used: lack of training and lack of vendor adoption. Also, the creators of functional programming languages make adoption hard by picking somewhat unusual syntactic features.
It's hard to explain in a paragraph or two why functional programming is so great. Suffice it to say that it allows for much more reuse than object-oriented programming, opens up whole new ways of abstracting out functionality, and prevents one of the most common sources of bugs--aliasing.
Not all functional programming languages are purely functional. In fact, many programmers program in such functional programming languages like they do in Perl or Python. That can be both bad and good. On the one hand, because functional programming languages are powerful even for procedural programming, they may never be encouraged to learn how to take advantage of functional features. On the other hand, it may be a good way of getting work done.
My recommendation for people wanting to use a statically typed, efficient functional programming language would be OCAML. It has a full object system, yet also offers a full set of functional programming primitives. SML/NJ is another excellent implementation supporting both procedural and functional programming, and very lightweight threads (as an alternative to objects; cf. the GUI system).
Scheme and CommonLisp are also great languages. As a procedural or OO programmer, you can think of them as Python with a different syntax and a much better compiler. MzScheme is an excellent Scheme system for learning, and Bigloo is a powerful Scheme compiler. You can find more information at schemers.org.
For heavy-duty programming, CommonLisp is still better than Scheme, IMO, but it's significantly more complex. You can find a bunch of implementations at cons.org. I recommend CMU CommonLisp highly. For experimentation, CLISP by Haible is a good small interpreter. There are also a few "scripting" implementations of CommonLisp around.
Haskell is absolutely amazing for distilling programs down to 1/10 or 1/100 their size. However, it really requires a very different way of approaching programming. I'm not sure whether to recommend starting programming with it or not, in particular if you come from other languages.
There are also some special-purpose functional programming languages for high-performance computing. Those languages give performance similar to Fortran or C on numerical problems and can actually be parallelized more easily.
Of course, whether any of these links help you depends on whether you can get started using a new language with a reference manual, user manual, short tutorial, and implementation. If not, there are lots of textbooks around. The Haskell site in particular also has lost of link for FP-related resources. Also search Fatbrain.
So, in summary: functional programming languages are definitely ready for many applications. If you want to get started, there are lots of resources available. Try to find a book that you like and experiment. MzScheme or OCAML are fairly traditional ways of getting started (you still get a lot of the features you are used to from procedural languages). I suspect that functional programming is going to be the "next big thing" in programming after OOP, and I also think it's a lot more useful than OOP and a lot more well-founded.
-
Re:Structural languages are not used because....
Haskell has CGI and animation libraries, as well as a system for writing music. There are foreign library interfaces and highly optimizing compilers, database interfaces and graph visualizers.
Libraries and Tools in Haskell
Haskell in Practice
Here are some books and papers about how to program in Haskell and functional languages in general.
I particularly recommend Hudak's book; Paul himself is a very clear teacher and lecturer, as is Zhong Shao, who does research in ML (Standard ML of NJ). I think SML is the only functional language around whose semantics are completely specified.
Follow these links and learn about Erlang (in massive production use at Ericsson), high level abstraction through functions defined via structural induction over datatypes, monads, layered functionality used to build parsers (via parser combinators), and a type theory for object-oriented programming. -
Re:Structural languages are not used because....
Haskell has CGI and animation libraries, as well as a system for writing music. There are foreign library interfaces and highly optimizing compilers, database interfaces and graph visualizers.
Libraries and Tools in Haskell
Haskell in Practice
Here are some books and papers about how to program in Haskell and functional languages in general.
I particularly recommend Hudak's book; Paul himself is a very clear teacher and lecturer, as is Zhong Shao, who does research in ML (Standard ML of NJ). I think SML is the only functional language around whose semantics are completely specified.
Follow these links and learn about Erlang (in massive production use at Ericsson), high level abstraction through functions defined via structural induction over datatypes, monads, layered functionality used to build parsers (via parser combinators), and a type theory for object-oriented programming. -
Re:Structural languages are not used because....
Haskell has CGI and animation libraries, as well as a system for writing music. There are foreign library interfaces and highly optimizing compilers, database interfaces and graph visualizers.
Libraries and Tools in Haskell
Haskell in Practice
Here are some books and papers about how to program in Haskell and functional languages in general.
I particularly recommend Hudak's book; Paul himself is a very clear teacher and lecturer, as is Zhong Shao, who does research in ML (Standard ML of NJ). I think SML is the only functional language around whose semantics are completely specified.
Follow these links and learn about Erlang (in massive production use at Ericsson), high level abstraction through functions defined via structural induction over datatypes, monads, layered functionality used to build parsers (via parser combinators), and a type theory for object-oriented programming. -
Re:C--, Anyone?
Simon Peyton Jones is one of the Big Names in functional programming languages, and played a big role in the development of haskell a very
cool language that I do recommend people check out.
Hearing that Microsoft is paying his bills and directing his research saddens me a great deal. Although I find it amusing that his paper on calling COM from Haskell and vice-versa is entitled "Calling hell from heaven, and heaven from hell."
Still, I imagine that if he weren't at MS the paper would be about CORBA or some other standard instead of COM, which would make it much more useful. Pity...
I'm also surprised that with guys like this on the payroll the best MS can come up with is a warmed-over Java with VB hooks. -
Re:C--, Anyone?I have to repeat this over and over: Don't confuse Microsoft with Microsoft Research. This is like confusing, say, US Government with NASA.
Simon Peyton Jones and other nice people from MS Research release a Haskell compiler called GHC. It is open-source, multiplatform (Wintel, Linux and many more), and uses GCC as a backend. Did the previous sentence surprise you? They designed C-- because C does not serve well as a backend for a functional language like Haskell.
Haskell is a cool language BTW.
-- -
Research is not dead !
Research is definitely not dead.
Just take _modern_ functional languages like Haskell or Clean as an example. It is amazing how easy things can be done with these (compared to C or whatever). A lot of research is done in this area. By using these new techniques I learned to improme the quality of my programs drastically.
YOU too should not be narrow-minded and have a look at it. Because we have to admit that most Linux-technologies were invented the 70s or 80s (apart from non very deep generalizations). This isn't bad, but we should keep on looking for new better things.
Interestingly, Microsoft does a lot of research in this promising area (look at http://research.microsoft.com/research/ ppt/). In this respect the comment we are talking about here seems to be true.
So don't let Mircosoft get intellectual world leadership too(buh!?!), do research yourself and don't insist on thing u are used to (without reasoning about it).
-
Re:Logo isn't dead; Methods for teaching Children."I'm still debating whether I'd rather use Pascal than Python, because it's strongly typed, but the quick turnaround for type-it, eval-it environments is nice for teaching."
Hmm, how about haskell and get the both of both worlds? Actually, for both the original post and your dilema it would suit nicely. It is THE strongly-typed, purely functional language, it has free (speech and beer) interpreters (like hugs) and compilers (like nhc98), and plenty of libraries (including graphics and OpenGL). Lastly, there are a number of places where it is taught as a first language or as a second language; it is very much worth checking out.
-
Re:Logo isn't dead; Methods for teaching Children."I'm still debating whether I'd rather use Pascal than Python, because it's strongly typed, but the quick turnaround for type-it, eval-it environments is nice for teaching."
Hmm, how about haskell and get the both of both worlds? Actually, for both the original post and your dilema it would suit nicely. It is THE strongly-typed, purely functional language, it has free (speech and beer) interpreters (like hugs) and compilers (like nhc98), and plenty of libraries (including graphics and OpenGL). Lastly, there are a number of places where it is taught as a first language or as a second language; it is very much worth checking out.
-
Re:My Programming Goal is to finis dostuff()
Perhaps he wants some music to go along with "it's" programming...
Perhaps he's just a frustrated luthier...
Perhaps he's working on dostuff() for the cello too... it would go well with Haskore...
Ah well.
(P.S.: Yes, the viola/voila mix-up also bugs me. It brings to mind the dirty little detective guy from Moonlighting - was it Stephen Rea?) -
Re:$200000 Contest
What dose Java have to do with this story? We all know Java sucks big harry donky balls.
Regarding the Python vs. Perl debate.. who cares? It's a personal style thing. Personally, If I'm fealing practical and want to write something today then I use Perl. If I'm fealing all theoretical and want to write something for the intelectual enjoyment of doing it the right way then I use Haskell.
Python's supposed advantages over Perl come from the bullshit side of CS langauge theory (object oriented paradim bullshit). There is god shit in CS langague theory, but it's functional and all based on crazy category theory and monads.. very fun math.. and very rigorous. If someone makes a nice functional langauge with all the features of Perl or Python then I'll use that, but I'm not selling out my effeciency of writing code in perl for a stupid object oriented language based on two bit unfounded and unresearched assumptions about the psychology of programmers. -
Music notation based on a programming language
Haskore is a really interesting music notation which is implemented in the functional langauge Haskell. The introduction to the tutorial dose a good job of describing it:
Haskore is a collection of Haskell modules designed for expressing musical structures in the high-level, declarative style of functional programming. In Haskore, musical objects consist of primitive notions such as notes and rests, operations to transform musical objects such as transpose and tempo-scaling, and operations to combine musical objects to form more complex ones, such as concurrent and sequential composition. From these simple roots, much richer musical ideas can easily be developed.
Haskore is a means for describing music---in particular Western Music---rather than sound. It is not a vehicle for synthesizing sound produced by musical instruments, for example, although it does capture the way certain (real or imagined) instruments permit control of dynamics and articulation.
Haskore also defines a notion of literal performance through which observationally equivalent musical objects can be determined. From this basis many useful properties can be proved, such as commutative, associative, and distributive properties of various operators. An algebra of music thus surfaces.
You would probable find that Haskore offers more ability to extend your musical ntation then AMPLE because flexable notation is one of the things functional langauges like Haskell are good at. -
Music notation based on a programming language
Haskore is a really interesting music notation which is implemented in the functional langauge Haskell. The introduction to the tutorial dose a good job of describing it:
Haskore is a collection of Haskell modules designed for expressing musical structures in the high-level, declarative style of functional programming. In Haskore, musical objects consist of primitive notions such as notes and rests, operations to transform musical objects such as transpose and tempo-scaling, and operations to combine musical objects to form more complex ones, such as concurrent and sequential composition. From these simple roots, much richer musical ideas can easily be developed.
Haskore is a means for describing music---in particular Western Music---rather than sound. It is not a vehicle for synthesizing sound produced by musical instruments, for example, although it does capture the way certain (real or imagined) instruments permit control of dynamics and articulation.
Haskore also defines a notion of literal performance through which observationally equivalent musical objects can be determined. From this basis many useful properties can be proved, such as commutative, associative, and distributive properties of various operators. An algebra of music thus surfaces.
You would probable find that Haskore offers more ability to extend your musical ntation then AMPLE because flexable notation is one of the things functional langauges like Haskell are good at. -
Music notation based on a programming language
Haskore is a really interesting music notation which is implemented in the functional langauge Haskell. The introduction to the tutorial dose a good job of describing it:
Haskore is a collection of Haskell modules designed for expressing musical structures in the high-level, declarative style of functional programming. In Haskore, musical objects consist of primitive notions such as notes and rests, operations to transform musical objects such as transpose and tempo-scaling, and operations to combine musical objects to form more complex ones, such as concurrent and sequential composition. From these simple roots, much richer musical ideas can easily be developed.
Haskore is a means for describing music---in particular Western Music---rather than sound. It is not a vehicle for synthesizing sound produced by musical instruments, for example, although it does capture the way certain (real or imagined) instruments permit control of dynamics and articulation.
Haskore also defines a notion of literal performance through which observationally equivalent musical objects can be determined. From this basis many useful properties can be proved, such as commutative, associative, and distributive properties of various operators. An algebra of music thus surfaces.
You would probable find that Haskore offers more ability to extend your musical ntation then AMPLE because flexable notation is one of the things functional langauges like Haskell are good at. -
Music notation based on a programming language
Haskore is a really interesting music notation which is implemented in the functional langauge Haskell. The introduction to the tutorial dose a good job of describing it:
Haskore is a collection of Haskell modules designed for expressing musical structures in the high-level, declarative style of functional programming. In Haskore, musical objects consist of primitive notions such as notes and rests, operations to transform musical objects such as transpose and tempo-scaling, and operations to combine musical objects to form more complex ones, such as concurrent and sequential composition. From these simple roots, much richer musical ideas can easily be developed.
Haskore is a means for describing music---in particular Western Music---rather than sound. It is not a vehicle for synthesizing sound produced by musical instruments, for example, although it does capture the way certain (real or imagined) instruments permit control of dynamics and articulation.
Haskore also defines a notion of literal performance through which observationally equivalent musical objects can be determined. From this basis many useful properties can be proved, such as commutative, associative, and distributive properties of various operators. An algebra of music thus surfaces.
You would probable find that Haskore offers more ability to extend your musical ntation then AMPLE because flexable notation is one of the things functional langauges like Haskell are good at. -
Re:TIMTOWTDI -vs- KISS
I can't quite decide what a first order object is... if someone has a good definition, I'd be curious to see it.
Here are the generally accepted definitions we use in programming language theory:
The term you want is "first-class object". A first-class object is one that can be passed to and returned from a function.
A "first-order object" is anything that is not a function. A first-order function is a function which can be passed or returns a first-order object. A second-order function is a function that can be passed or returns a first-order function. Thus, we say that a language is higher-order if functions of order n can be passed to or returned from functions of order n+1 for any n. A language is first-order if its functions are all first-order.
Of course, this presupposes that certain properties are satisfied. For example, you can pass to and return functions from functions in C, but C is not considered higher-order. When you return a nested function, you need to be able to retain the local bindings of variables from the enclosing scope, forming what is called a closure. You can't do this in C. The same is also true, incidentally, for Emacs LISP.
BTW, regarding Python features like significant whitespace (layout) and first-class tuples. Both of these are quite old concepts. I think Landin's language ISWIM, which dates back (correct me if I'm wrong) to the 60's had this. Among modern languages, Haskell also uses layout syntax. In fact, probably many of the best features of Python are features that grew to maturity in the functional language community. For example, Haskell also has first-class tuples and higher-order functions, and of course things like the map function are just part of your daily bread and butter. Incidentally, Haskell is also being used increasingly for Internet scripting and CGI, and it has the advantages over Python that it is strongly typed, lazy and much more efficient; yet there still exist interpreters, etc. for it.
-
Functional Scripting Langauges
I don't really trust the idea of an OO scripting langauge. Ok, well smalltalk could dose it when it tries, but not these procedural/OOP hybrid things like Python. It seems all the advnatages you get by OOP are nullified by the space constraints of scripting. Plus, they are not really inovative enough, i.e. part of making a langauge fun is making it weird in meaningful ways. I think the relevent quote is "A langauge which dose not teach you something about programming is not worth knowing."
Now, a monadic functional langauge like Haskell might make an interesting scripting langauge if you standardised all the tools (like regex) since it is so quick to write code in these things (monadic means you can do neet things like OOP and IO without really cheating the way lisp dose). I would really like to see someone perlify Haskell, i.e. say "we have enough syntatical purity for now, so lets be preatical and figure out how to make the langauge human without loosing too many of our cool functional short cuts." It's just really fucking cool (and very relevant to scripting) to be able to define a subtil algebraic datatype in like 2 or 3 lines. Plus, all the advantages of being able to extend things like regex on the fly (since they are actually in the langauge). The only real problem is that no one like Larry Wall has come allong to make a more fun & human version of the Haskell. Imagine all the weirdness of Haskell with all the weirdness of Perl.. that would be wonderful.. :) -
Perl does NOT have just one datatype
For example, in Perl (like most scripting languages) there is a single data type to represent everything from strings to characters to all sorts of numbers.
There are many reasons why Perl may or may not be a good first language, but this can't be one of them, since it just isn't true. TCL used to be the textbook example of a language that used the string as its representation for everything, but TCL isn't string only anymore, either.
Really, I don't know where people get this idea about Perl, which certainly isn't the most typeful language on the block, but is hardly short of interesting types. I suppose it comes from the fact that Perl does provide a lot of automagical operators and conversions (although the fact that conversions are involved should make it clear that Perl has more than one underlying type).
But one thing I'd like to point out in particular:
Java/C++/C/Fortran/Basic etc...have different data types (short, long, char, String etc...) for very good reasons.
Says somebody who clearly hasn't ever had to justify the difference between a short and long to a beginning (or non-)programmer. I would actually argue that the short/long difference is exactly the kind of "people working for the computer" stuff that doesn't belong anywhere near somebody's first exposure to programming.
If you want to teach the importance of types at the same time you teach programming, you would do better to use a language that has a more interesting and flexible type system; one obvious candidate would be Haskell, or it's interpreted cousin Hugs.
-
Re:I've been waiting all day for this to get posteOf course, none of the ideas are Sweeney's as he makes clear on the Unreal Technology page in his update called Engine R&D Notes posted on Nov 30, 1999, at 3:20 AM.
The closest thing to what is being described in terms of a non-experimental/non-academic language seems to me to be either Haskell or BETA. Haskell is free and available for Linux, Beta is also free and comes with an extensive development environment (called Mjølner) and it is also available for Linux (yay!). Both of these langauges are very interesting.
Most of the other systems that implement new ideas are experimental and not available AFAIK, but papers describing them are available.
Some good papers to look at are:
- Kim Bruce's Papers: pretty much everything he lists under research is related to this thread.
- Luca Cardelli's Papers: most of the stuff that relates is under Types and Semantics, but the other catagories have worthwhile stuff too.
- Phillip Wadler has so many fascinating papers on so many interesting topics that I'm just gonna link to his main page... what else can I do?
These are good starting points. For more places to look see my list of language bookmarks , especially under people & projects (or specific languages).
- Kim Bruce's Papers: pretty much everything he lists under research is related to this thread.
-
Re:Variables
I mean what programming language is complete without something as basic as variables?
Languages of the `(pure) functional' class do not have variables of any kind. They are still very complete and useful work can easily be performed with them. See for example HUGS although IIRC HUGS (and Haskell) is not a strict/pure functional language.
-
Re:preach it...
> Hey - you just described IE5. Hate to admit it but...all the components of IE are just generally available COM objects.
AND you can script those components with Perl. Or Python. Or Javascript, C++, Delphi, VB, or even freakin Haskell
Unix can only claim superior scriptability at the moment because it has a passable scripting language as its command shell (some better than others, ksh has better typing for example). But what it can't do is script individual components of a program in any language that has a native interface. Want to embed a browser component in emacs and remote-control it with elisp? Fat chance.
Yes, yes, this is all promised with gnome and bonobo and corba corba uber alles. But so far, like mozilla, it hasn't produced any deliverables. I'm not even impressed with the stability of mozilla under win32. -
Speaking of languages, here's the Haskell URL
Most of you have probably heard about Python, Perl, Java, and the other languages Havoc Pennington mentioned in his answer to the potentially flame-inducing "what's the best language" question. Here's the URL to the Haskell Home Page that has lots more info on the language and down-loadable implementations of Haskell compilers and interpreters.
It might not be the language for everybody, of course...
King Babar
-
Re:Breakthrough languages?
-
Functional Language... Functional CPU.. Forth CPUFunctional Language... Like Haskell ?
Forth CPU: Like F21 CPU
Functional CPU: Like NeoSilicone ?Maybe... this way to explore...
- More info about F21 CPU: http://www.dnai.com/~jfox/f21.html
- More info about haskell: http://www.haskell.org/
-
Information on HaskellThere is a nice online tutorial (the language definition is, of course, also online).and if you are capable of reading German, there is a second tutorial - and after you have got a hang of the basics, some of the academic papers papers may not seem as weird as before
;-)Haskell has some sophisticated (and of course free) compilers, but for learning the language and for small applications, the interpreter Hugs is IMHO more suitable.
Chilli
PS: Though Haskell is a super-cool language, unfortunately, it also does not magically solve the program of parallel programming - the programmer still has to devise algorithms that contain suitable parallelism (IMHO, this is not a problem of the programming language, but a fundamental restriction given todays - and probably also tomorrows - machine architectures).
-
Information on HaskellThere is a nice online tutorial (the language definition is, of course, also online).and if you are capable of reading German, there is a second tutorial - and after you have got a hang of the basics, some of the academic papers papers may not seem as weird as before
;-)Haskell has some sophisticated (and of course free) compilers, but for learning the language and for small applications, the interpreter Hugs is IMHO more suitable.
Chilli
PS: Though Haskell is a super-cool language, unfortunately, it also does not magically solve the program of parallel programming - the programmer still has to devise algorithms that contain suitable parallelism (IMHO, this is not a problem of the programming language, but a fundamental restriction given todays - and probably also tomorrows - machine architectures).
-
Information on HaskellThere is a nice online tutorial (the language definition is, of course, also online).and if you are capable of reading German, there is a second tutorial - and after you have got a hang of the basics, some of the academic papers papers may not seem as weird as before
;-)Haskell has some sophisticated (and of course free) compilers, but for learning the language and for small applications, the interpreter Hugs is IMHO more suitable.
Chilli
PS: Though Haskell is a super-cool language, unfortunately, it also does not magically solve the program of parallel programming - the programmer still has to devise algorithms that contain suitable parallelism (IMHO, this is not a problem of the programming language, but a fundamental restriction given todays - and probably also tomorrows - machine architectures).
-
Information on HaskellThere is a nice online tutorial (the language definition is, of course, also online).and if you are capable of reading German, there is a second tutorial - and after you have got a hang of the basics, some of the academic papers papers may not seem as weird as before
;-)Haskell has some sophisticated (and of course free) compilers, but for learning the language and for small applications, the interpreter Hugs is IMHO more suitable.
Chilli
PS: Though Haskell is a super-cool language, unfortunately, it also does not magically solve the program of parallel programming - the programmer still has to devise algorithms that contain suitable parallelism (IMHO, this is not a problem of the programming language, but a fundamental restriction given todays - and probably also tomorrows - machine architectures).
-
One Word: Haskell
I hate to break this to you but some purely functional programming languages can already do this. Haskell is a Lazy, Purely Functional programming language with strict typing. More information on Haskell can be found at www.haskell.org. The GHC compiler is capapable of executing Haskell programs in paraller with out any additional work on the programmers part. However, it is not very efficent right now.
From the c.l.functional FAQ: Functional programming is a style of programming that emphasizes the evaluation of expressions, rather than execution of commands. The expressions in these language are formed by using functions to combine basic values. A functional language is a language that supports and encourages programming in a functional style.
Progarmming in a purely functional language does require a very diffrent style of programming, however. -
Re:Language statisticsThe Haskell Homepage
Haskell is a lazy, pure functional language. It kicks ass.
I wish the people who ran the contest at least required that the entered programs be written in a functional style. 24 C entries in a supposedly functional programming contest? The winning group did use a pretty cool parallel dialect of C, but it was certainly not functional.
-
This is not bad, people...
Odds are that all this entails is making Perl's COM support and Unicode support better than it currently is. If they're really ambitious, maybe they'll add better support for Windows threading (process creation is expensive on Windows, but threads are cheap and easy, so the Unix fork() trick doesn't work so well).
If you want to see what the end result will probably look like, take a look at the Python Win32 extensions or the Active Haskell package for Haskell. These extensions let you do things like write COM servers, conveniently access the Win32 API, and so on from within your scripting language.
This will just add one more language to the toolkit of those who need to automate tasks on their WinXX boxes. It is an event of no particular metaphysical or political significance, so relax.
-
Interesting..
Larry has a very interesting take on language disign. I liked is postmodernism comments. Perl definitly feals more like english then other langauges, but maybe that's just because I'm addicted. I don't think, however, that we are at all ready for a ``universilly postmodern'' approach to computation or programming langauges as there is just too much which need to be rigorous. I think we will ultimatly need something more like the Lucky project for Haskell to do the parsing side anything. That is to say Larry's philosophy is importent even if we do need stronger theoretical building blocks then traditional imperitive programming provides.
Jeff
BTW> Lucky is a monadic parser. Monads are a very powerful way to resolve the contradictions between functional and object oriented programming philosophies. A monadic parser has all the elegance, flexibility, and raw power of a functional parser without the grammer constrains normaly imposd on a functional parser. -
Languages
If we're going to get worked up about languages, why aren't we worrying about Haskell, which doesn't seem to have a licensing scheme and in which Microsoft has taken an altogether too intense interest?
Encourage the Haskell folks to settle on a good license -- PAL, GPL, whatever they can stomach. ANYTHING but a Microsoft hegemony.
Rebol is just another offspring of the LISP family. Haskell is something different and interesting.
--