Slashdot Log In
F# - A New .Net language
Posted by
michael
on Sat Jun 08, 2002 07:23 AM
from the no-tuning-fork-needed dept.
from the no-tuning-fork-needed dept.
Goalie_Ca writes "Neonerds.net has learned of an implementation of the ML programming language for the .NET Framework. F# is essentially an implementation of the core of the OCaml programming language . F#/OCaml/ML is a mixed functional-imperative programming language which is excellent for medium-advanced programmers and for teaching. In addition, you can access hundreds of .NET libraries using F#, and the F# code you write can be accessed from C# and other .NET languages. See the
F# Homepage."
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
That's the power of .NET (Score:4, Insightful)
Although there are other languages that can run on JVM, the ease of getting inheritance and cooperation to this level is only possible in .NET.
Re:That's the power of .NET (Score:2)
Re:That's the power of .NET (Score:3, Interesting)
This is a tried and tested method, 50 years ago you went to the clothes store and bought some clothes, electrical store and bought some electricals, mechanical store and bought a washing machine, tool store and bought some tools.
Micro$oft is trying to construt a "Wal-Mart" that everybody goes to instead of all these disparate places. Not bad, appeals to beginners.
Right now a new developer says "I want to learn how to code" and you say, "Which platform? What type of program - textprocessing=Perl, compiler=Haskell, generalhighexecspeed=C++, generalhighdevelopmentspeed=Java, webdevelopment=PHP,J2EE,..." Micro$oft is trying to make it so that instead of all these disparate RPMs that confuse the heck out of newbie developers, you just use one IDE - Micro$oft's IDE, same as Wal-mart. The only difference (apart from the obvious) to a newbie will be that C++ has a compile button and Perl doesn't, his questions will become gradually more complicated after that. The weakness is that a bug in the CLR will affect all languages that use that functionality, you lose bug compartmentalisation and damage limitation.
Re:That's the power of .NET (Score:2)
Actually to be fair the last time I saw an NT4 box without SP6 was... about a couple of years ago so there's a lot of variance. If every popular app install e.g. latest Macromedia automatically overwrites the old buggy CLR with the latest one (like MFC libs).... Wow, that could be good, very few Java app installers automatically overwrite old JVMs.
I foresee in 2 years people on /. bithcin' about Macromedia FlashPlayer v7 requiring a DRM-compliant CLR. Then in 20 years developers will become so lazy with drag-n-drop coding that every app uses CLR, then Windows XP^2 will only allow CLR apps to run and they'll deprecate the entire Win32 API. L33t Fortran, C and assembler coders will be 90 years old so nobody will be able to use "dangerous" ByteArrays.
The power to lobotimize languages? (Score:5, Insightful)
This is what I really dislike about
I think you are really a troll, but in any case you bring to light a common ignorance about the whole
Parent
Re:The power to lobotimize languages? (Score:2)
Re:The power to lobotimize languages? (Score:3, Insightful)
Although there are other languages that can run on JVM, the ease of getting inheritance and cooperation to this level is only possible in
And if you had looked at the language description, you would have seen that F# lacks the following:
Therefore your claim, that somehow getting parts of a language to run on
Re:The power to lobotimize languages? (Score:2)
In truth, I'm not aware of any language features that are that much more easily implemented on the
I think the difference is that with
While the mutli-langauge drive seems great at first, like I was saying I find it very disturbing that the same thing could happen to languages that has happened to OS's - we could enter a long dark period where the only real "language" you could program in is
Re:The power to lobotimize languages? (Score:2)
To destroy languages is the power of .NET (Score:4, Interesting)
Only superficially all
Therefore, should
I have nothing against the virtual machine idea (C# + CLR) which is 100% like Java + the JVM. That is a good principle which has its uses (just asking why not go with Java, C# merely adds some syntactic sugar but brings no true improvements such as templates or multiple inheritance). But this plan/strategy of so mutating all existing languages in all alike
Parent
Re:To destroy languages is the power of .NET (Score:2)
F# is a language with type variables, type inference, and lexical closures. Those are real differences, not just syntax. I'd be overjoyed if, say, Java had support for them, but it doesn't.
(C# + CLR) which is 100% like Java + the JVM
No, C#/CLR are not "100% like" Java/JVM. C#/CLR is clearly based on Java/JVM, but Microsoft added a few features that make some difference. Among others, the CLR offers support for value types, pointer manipulation, and (experimentally) genericity. Those features do change the runtime significantly relative to the JVM (whether for better or for worse is a separate debate).
Re:To destroy languages is the power of .NET (Score:2)
You didn't mention an important one which is a big lack in JVM. That is: tail recursion. Does it have it?
Re:To destroy languages is the power of .NET (Score:2)
It i not up to the JVM to implement or lack proper tail-recursion-optimization, but up to the java compiler. I know that a (standard compliant) Scheme compiler has been written targeting java bytecode. The Scheme standard requires proper tail-recursion-optimization.
Compromise for interoperability is not destruction (Score:4, Insightful)
Agreed, this is true of any mechanism that allows interoperability. Java does not allow one to effectively utilize benefits of the target platform so that it is interoperable across operating systems. Many would claim that this is a good thing. SOAP and web services are making people similarly compromise to enable building distributed applications something that is accessible to the average developer. Again this is widely considered A Good Thing
Compromise for the sake of interoperability is something that is done all the time. The question typically is whether the amount of compromise is worth the benefits of interoperability.
Only superficially all
I'm not sure what you mean by structurally alike but I'll hazard a guess and assume that you meant they are semantically alike. So far I have used 4
However, the more I used the languages the more I realized that although some similarities existed the core of the languages from my past; JScript and C++ was still in their
Now there are certain compromises such as the fact that the CLR only supports single inheritance (which I believe some research language discussed a while ago on Slashdot found a workaround for) but in my opinion this is a small price to pay to be able to access my C++ objects from VB.NET or my C# objects from JScript.NET. I consider even better that there is one unified class library that I can count on across all the languages besides the language specific ones like the STL or the JScript function library.
Disclaimer: I work for Microsoft but the thoughts expressed in this post are my opinion and do not reflect the opinions, intentions, plans or strategies of my employer
Parent
Re:That's the power of .NET (Score:2)
Re:That's the power of .NET (Score:2)
The CLR assembly code is based on the intermediate code from the Microsoft C++ compiler that existed several years before Java was made public. The byte code format of the Java VM and CLR are completely different. Java is a virtual machine and CLR is an intemediate code format of an object oriented compiler.
C# is essentially a wrapper for the CLS API.
Which is what you would expect from a modern programming language, remove all unnecessary inconsistencies you can.
C# does have features that no other mainstream programming environment has had since the Lisp machine. All managed objects can be querried to examine the metadata, the programmer can define attributes of their own to be included in the metadata.
What this means is that you can write a new data structure foo and then call XMLSerialize (foo) without having to do any more code. If you want to serialize to a specific schema you decorate the data structure definition with attributes. There is also a tool that does this for you.
The really cool thing about .NET for language developers however is that you get access to all the tools of a high quality programming environment without a lot of work. You get the debugger, the class browser, access to the .NET libraries, and the language sensitive editing.
Re:That's the power of .NET (Score:2)
The CLR is clearly a knockoff of the JVM, but it is not a "cheap knockoff". With the CLR, Microsoft fixes problems that Sun has promised to address years ago but failed to do anything about. I, for one, am tired of listening to Sun's unfulfilled promises.
Microsoft has finished screwing customers, and is on to screwing programmers.
I have no doubt that if you become a Microsoft customer, you will get screwed. But the open C#/CLR implementations (Mono, P.NET) look a lot more promising than the open Java implementations (gcj, Kaffe), in terms of completeness and conformance to a published specification (ECMA C#). And the reason for that is that Sun did not want the competition and Sun did not want an open, well-defined specification, while the existence of Java forced Microsoft to be more open than they usually would be.
Re:That's the power of .NET (Score:2)
In fact, with alternative hardware platforms such as PPC and ARM diluting the hold of x86-based Linux, anyone now writing end-user Linux apps in something other than Java should pause to consider how accessible and maintainable their products will be.
I agree Java will certainly face a challenge from the Dotnet platform. F Sharp is a very clear warning signal to Sun, and it won't just be academics who want to move on from C++ and Simula 67.
Re:That's the power of .NET (Score:2)
I suggest you read a book like "Compiling for the
Re:That's the power of .NET (Score:2, Insightful)
And the JVM is a cheap knockoff of P-CODE [ic.ac.uk].
"The intermediate code produced by the Pascal-P compiler." And this was in 1976.
Full name of F# (Score:3, Funny)
Re:B# (Score:2)
Re:B# (Score:2)
Your second example was screwed up. You probably meant E# == F.
Although it is true that B# is the same note as C, that is, you strike the same key on a paino keyboard, there are sometimes good reasons to write the note as B# instead of as C-natural. Here is an example. In key of C#, what notes are in the scale? Simple: C#, D#, E#, F#, G#, A#, B#, C#. Key of 7 sharps.
You put 7 sharps on the staff to indicate the key. So when a C note is written it means C#. So how to you indicate a C-natural? It would be ugly to have to write a C note followed by a natural symbol everywhere you wanted a C note. But if you just put a B note, which is intuitive in this example, it means B#, since the B# was indicated in the key signature on the staff at the beginning of each line of music. Yes, you're striking the C-natural note (which is B#), but the music typesetter writes it as B#. Now re-read the above, but first:
s/B#/E#/
s/C natural/F natural/
Oh great, yet another language to learn! (Score:2, Interesting)
Re:Oh great, yet another language to learn! (Score:5, Insightful)
Think I'll stick to what I know, instead of trying to learn more and more...
Isn't this the perfect way to fall behind? I think the only way to actually stay on top of things and keep informed is to be willing to keep learning. If you stop learning you will quickly grow ignorant of what is going on in the world and everyone else will get ahead of you. I prefer to keep learning the therefore hope that I will never adopt your additude towards new things.
I have to say, to your defense, that .NET and everything that comes from it has a very good chance of being no more than a publicity stunt from MS. But since the people who made C# were quite competent before MS hired them (and may still be), I will have to look at it at some point, to evaluate it if nothing else. The same will be the case for F#. I will look at it and see it as a chance to learn something new and become a better and more wise programmer.
Parent
Re:Oh great, yet another language to learn! (Score:2)
Yes, by all means, read some of the pro-MS propa- err... articles on .NET and find out what people being paid by Microsoft are saying about it. You'll be just one step closer to enlightenment!
Mediocrity is bliss.
Re:Oh great, yet another language to learn! (Score:3, Insightful)
That's quite a generalisation. Bert Meyer likes .Net. So does Miguel, enough to implement a substantial portion of it. Are these guys being "paid by Microsoft" ? If C# is "a java ripoff", why doesn't Miguel use Java instead of C# ?
I haven't formed any strong opinions on .Net, because in my case, not being an expert is an
obstruction to forming strong opinions. Not so with a number of the resident slashmonkeys, apparently.
What is the point? (Score:2, Flamebait)
Re:What is the point? (Score:5, Insightful)
Teachers of real CS courses have been teaching functional programming since before Java was a blink in the eye of its creators. ML, Haskell, Scheme are such are far more popular in CS academia than they are in industry, and OCaml is arguably one of the most powerful functional (-based) languages around. Sorry, but I don't see your point.
Parent
Re:What is the point? (Score:2)
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>F#</title>
<meta name="Microsoft Theme" content="arcs2 000, default">
<meta name="Microsoft Border" content="tl, default">
... no wonder it doesn't render right in Mozilla. Of course, the ugly buttons gave it away...
Re:What is the point? (Score:2)
Yes you do.
I see a pattern... (Score:2)
win95, win98, win98se, winmx, win2k, winnt, wince, winme...
activeX, vbs, asp, j++...
and now c# and f#.
I foresee in the near future g# h# j# k# and n#.
(i# and l# are skipped to annoy IBM and Linux people)
Re:I see a pattern... (Score:2, Funny)
Well, musically speaking...
Yes, that is the standard sharp-notation. But this is Microsoft we're dealing with here, so I'm sure they'll embrace and extend to the rest of the alphabet as the previous poster suggested.
Why don't they use Smalltalk and stop F#$% around? (Score:2, Interesting)
Re:Why don't they use Smalltalk and stop F#$% arou (Score:5, Insightful)
I wouldn't mind it so much if someone would IMPROVE on Smalltalk, but why do we have to spend twenty years devising languages that are not quite as good as Smalltalk (in the name of efficiency, or compatibility, or ease of learning for people that have never learned more than one computer language...)
Smalltalk is the only language I've ever used that I felt truly extended my reach as a programmer and truly enabled me to do easily things that would have been difficult in other languages.
It is also the only language in which I have truly taken big, complicated, rich pieces of code that did ALMOST what I wanted and spent very small amounts of time subclassing them and making them do EXACTLY what I wanted--and without having to spend hours reverse-engineering and understanding what the original code was doing.
Parent
Re:Why don't they use Smalltalk and stop F#$% arou (Score:2)
Support for .NET generics (Score:2, Informative)
So it looks like there are releases of Microsoft's jitter that have full support for execution-time expansion of generics. I can't wait!
Remember April 1st? (Score:2)
I'm not anti-MS by any means but even I can notice that this F# have very limited appeal. Posting an article about it, is very suspicious.
good job on the generic implementation, but... (Score:3, Insightful)
Let's just hope that the specification and implementation strategy for .NET genericity will be open. While there doesn't seem to be anything terribly sophisticated or novel in it, Microsoft could conceivably have applied for a bunch of patents and may try to keep efforts like the Mono project from implementing this.
As for F# itself, it seems to be a closed-source distribution only, which makes it uninteresting except as a technology demonstration. Microsoft almost certainly has no intention of supporting it commercially, making it effectively an orphaned, single-platform, non-evolving system. Even if it were a commercial product, lack of an open source distribution would make the chances of its adoption nearly zero.
Pay more for a brand name of asprin (Score:2)
I'm not interested in it. In fact I'm less then zero interested in it, as the generic brand contains the same ingredients and cost a whole hell of a lot less.
For those stuck on words used. Microsoft is a brand name. GNU, FSF, GPL is the generic indicator, organization of establishing the generic and the licensing of the generic that insures it stays that way.
Re:Pay more for a brand name of asprin (Score:3, Interesting)
It's like the boy who cried wolf. At some point it just becomes more productive to simple ignore them and their distortion. While focusing on that which is without alot of crying wolf.
Remember that developer use of
Languages - an art form (Score:2, Informative)
They ask, "Why bother creating another language? There is quite a number of them out there. Any of them should be able to solve almost any problem out there."
Programming languages are an art form, and like any other art form, it deserves respect. Each programming language forces a programmer to think about a problem in a slightly different manner. Prolog forces a programmer to think in terms of goals to be achieved, and OO languages force a programmer to think in terms of self contained parts of the problem. Different programming languages make it easier to solve different types of problems. Haskell is a great language to represent infinite sequences due to its use of lazy evaluation.
Would you tell a musician to not experiment with sounds not created by traditional instruments because there are so many musical instruments out there for him/her to use, and that any musical piece can be performed with any of them? Musicians come up with new sounds all the time because those new sounds allow them to view music from another perspective
Wrong, they are tools, not pieces of art (Score:3, Insightful)
What the world needs is an interesting experiment (Score:4, Interesting)
I thought the whole point was that this wasn't a new language, but a .NET port of OCaml, which is an existing and well-regarded language whose blend of functional and OO/imperative style has been quite successful in the past.
Now, the interesting thing here will be the performance they get out of it, and how easy it is to take advantage of the .NET libraries. One of OCaml's major claims to fame is that, while being a pretty high-level language, its output code is often close to the efficiency of well-written C or C++. Another big claim to fame of functional langauges in general, and OCaml in particular, is that you can write very concisely. Given that the .NET framework is obviously geared towards OO languages that are isomorphic to VB.NET/C#, it will be interesting to see whether a language that works in a significantly different way can still hold its own in performance and usability terms.
The answers will be a pretty significant indicator of whether .NET really is a well-designed, multi-language framework, or whether it's just a commercial spin on a small number of language in an MS-dominated marketplace, with added corporate buzzwords. I think a lot of serious, open-minded programmers would like to know the answer to that one right now.
Parent
Re:C#, F#... (Score:2)
Take a look at a piano
Re:C#, F#... (Score:2)
More songtexts of them [geocities.com]
Re:MSFT public-relations apocalypse. (Score:3, Funny)
> Microsoft's marketing department. Or are
> they retarded enough to think it won't get
>expanded to "F#@%"?
You think that's bad? As a non-programmer I expanded "F#/OCaml/ML" to "f*ck em all"...
Re:MSFT public-relations apocalypse. (Score:2)
Or.... for the paranoid out there... perhaps with the federal prosecution being dropped and everything else, this is MS's statement directly to programmers:
"Programmers??? F#/OCaml/ML"
Re:Will there be.....? (Score:2)
Re:Another .net language (Score:3, Informative)
Its pretty much an entirely new language.