915 points · by Errorcod3 · 11y ago · 237 comments
I see it as the future of pop-functional programming. For example look at the way it handles type inference w/ JSON parsing. Compare that to what you have to do to parse JSON in Scala. It's subtle, but a major usability win.
The only problem I have with Scala is that it has so many features that it tends to have a steeper learning curve than most languages. However, this is mitigated somewhat in that it lets one switch between object and functional depending on what's more convenient or performant, thus making it easier for programmers who are not highly skilled in functional programming to pick up.
I've done a bit of scala spark as well, and my initial thought was prototype in pyspark and then rewrite in scala if necessary. Just this week DataBricks announced they are working on changing some of the data structures behind RDDs to save on unnecessary java object creation hubbub https://databricks.com/blog/2015/04/28/project-tungsten-brin...
That and the SQL compiler thing seems pretty darn awesome. Spark has the nice benefit of being plug and play (w/ a joyful time of compiling and deploying) with legacy HDFS/Hadoop systems. That alone will keep it in toolboxes for a long time to come.
Unless Spark has changed dramatically in the year since I used it, that's not really how it works. You lazily construct an expression graph of RDD operators but the actual Scala code (the functional payload of e.g. flatMap) doesn't get analyzed. Are you talking specifically about Spark SQL's code generator?
>The cluster compute benchmarks on it are crazy good.
...and also carefully chosen to show off the niche cases where Spark shines. More commonly, you'll encounter crippling garbage collector stalls leading to mysterious and undebuggable job failures.
Spark has a very clean API but the implementation (at least for Spark versions 0.8-1.0) is still prototype quality.
The implication of this work I thought is that it could be further expanded to other languages and DSLs. However, Spark's SQL generator still being very JVM-dependent and this optimizer generating bytecode kind of makes it pretty specific to JVM-supporting languages only. This would probably leave out Haskell and Erlang / Elixir in the short term, which is probably where I'd expect to see a different perspective on the whole data analytics front. We have Datomic, sure, (and I guess Clojure is enough for a lot of folks) but it'd be nice to have something other than "we want to make Hadoop... BUT BETTER" as a lot of the motivations.
one could say they're... looking into it...
https://careers.microsoft.com/jobdetails.aspx?jid=170944&pp=...
"F* is a new higher order, effectful programming language (like ML) designed with program verification in mind. Its type system is based on a core that resembles System Fω (hence the name), but is extended with dependent types, refined monadic effects, refinement types, and higher kinds. Together, these features allow expressing precise and compact specifications for programs, including functional correctness properties. The F* type-checker aims to prove that programs meet their specifications using an automated theorem prover (usually Z3) behind the scenes to discharge proof obligations. Programs written in F* can be translated to OCaml, F#, or JavaScript for execution. "
It's open source too: https://github.com/FStarLang/FStar
make my func the p-func / I want my func uncut...
"tainted func"
I don't think there's really anything stopping OCaml from being more widely adopted, except for lack of attention from trend-setters.
Scala however has all kinds of super powered functional programming features that F# is missing, implicit parameters for type class constraints, ADTs, higher kinded types, etc.
case class Fruit(name: String, variants: Set[String])
val fruitJson =
Json.parse(
"""{
"name": "apple",
"variants": ["cox", "braeburn"]
}""")
val fruit = fruitJson.as[Fruit]
Doesn't seem to be too painful to me.I agree that F# is syntactically closer to ML (though Scala is closer to ML with its module system which F# gave up completely).
TBH, I think the JSON example might underrate things a bit anyway. Where type providers really start to feel impressive is when you get to tricks like being able to noodle around inside undocumented (or poorly documented) COM interfaces with the help of CodeSense, or getting red squigglies in your editor (and compile time errors) when there's a problem with an SQL query.
F# isn't all roses, of course. I really wish it had typeclasses, and discriminated unions are less powerful than Scala's case classes in some tangible ways. But from a purely pragmatic perspective, my (almost certainly biased) sense is that I can usually Get Things Done™ with less ceremony in F#, and type providers are a shining example of that pragmatism.
If there is one thing I learned using type providers it is that maintaining your own "description"–be it as sample data or a schema file–loses most benefits of using type providers in the first case.
On the other hand, want a type provider for X in Scala? Just write it.
Stuff is still moving around because Scala devs want to get the meta APIs right first, but if adapting things from time to time is not an issue, then go ahead.
(Edit) this is apparently working in the latest scala 2.11 But it killed my adoption of scala for real work early on. https://issues.scala-lang.org/browse/SI-7099
I never have seen a use-case where this would have been an issue. Sure, it "looks" unfortunate, but there is only so much you can do when running on a completely uncooperative runtime.
If devs need a typed representation of unlimited length, they provide a HList and move on.
Such a representation will replace the length-limited tuples in a future version of Scala.
For anyone else wondering that, go to https://github.com/dotnet/coreclr/blob/master/Documentation/....
2) ghuntley@freebsd-frankfurt:~/coreclr-master % cp bin/Product/FreeBSD.x64.Debug/corerun ~/coreclr-demo/runtime
3) ghuntley@freebsd-frankfurt:~/coreclr-master % cp bin/Product/FreeBSD.x64.Debug/libcoreclr*.so ~/coreclr-demo/runtime
4) ghuntley@freebsd-frankfurt:~/coreclr-master % cd ~/coreclr-demo/runtime
5) ghuntley@freebsd-frankfurt:~/coreclr-demo/runtime % ./corerun HelloWorld.exe freebsd
Hello, FreeBSD...
, ,
/( )`
\ \___ / |
/- _ `-/ '
(/\/ \ \ /\
/ / | ` \
O O ) / |
`-^--'`< '
(_.) _ ) /
`.___/` /
`-----' /
<----. __ / __ \
<----|====O)))==) \) /====
<----' `--' `.__,' \
| |
\ / /\
______( (_ / \______/
,' ,-----' |
`--{__________)
Press ENTER to exit ...
See also https://github.com/dotnet/corefxlab/commit/a39310b028ad830f8... - "HelloWorld: Pimp up the FreeBSD daemon to have colors. Basically pay full respects to the original console screen-saver."I can explain the entire problem with Silverlight using two dates:
- iPhone initial release: 29th of June 2007
- Silverlight initial release: 5th of September 2007
Now, we can argue if iOS killed Flash, but I think between iOS's lack of support and all of the security issues associated with Flash, it was set up to lose popular support (and then HTML5/HTML5 DRM filled in the gap, even if it took years ultimately).
Silverlight was a Flash competitor in a world that decided it didn't need Flash.
Microsoft will support .NetCore for at least 20 years. Without doubt.
On Windows for sure. Not on *nix though.
I do not think Windows will be a thing in 2025.
If you're going to bring a plastic knife to a watergun fight, at least point it in the right direction...
You know who didn't (and does not) support Silverlight? Developers!
We moved on from Silverlight well before Microsoft did. That's the important distinction when you talk about sunsetting technologies. Microsoft's track record here is FAR better than that of Google or Apple.
If you're not porting a .net application to MAC or Linux, I would avoid this for quite a while still. We don't know where this is going long term.
https://github.com/dotnet/corefx https://github.com/dotnet/coreclr
Silverlight was supposed to bring .NET to browsers on Mac and Linux. Someone1234's comment is IMHO correct and very astute - Silverlight wasn't all bad, but it solved the wrong problem.
On the other hand, this is all about bringing .Net to web servers on Mac and Linux. particularly Linux boxes and container in clouds. My experience may not be typical, but to me that's the right problem. The MS Azure team probably agrees.
They're still charging and threatening people for Android patents without really telling anybody what patents they hold over Android.
I think they realize they can make money via open source now and they might do this for future product. Threaten people via patents or some kind of trojan horse.
While it's great we have another programming language and platform option but their actions so far in the past and present isn't so great.
They also tried to make a Hadoop clone that failed miserably so now they team up with Hortonworks.
Perhaps that opening sourcing their VM they can have big data projects like Hadoop and such. Oracle have big sway over Java and JVM. Perhaps that's what Microsoft wants. People might forget about Oracle and JVM but I still remembered and it really sucks for Apache.
In general, I'm not taking this bet and I'll wait on it.
Also with my current skill set which is mainly open source, it is fine not dealing with Microsoft. Unless they have a better market share and momentum in some niche market like big data with Hadoop, spark or whatever I wouldn't even think about touching their open source stuff.
They had already announced the various parts of this, and the only link I see in here is a GitHub repo with links to other GitHub repos that we've already seen. Is there anything new in this announcement?
MIT license
It could mean we could start adopting it and then at some point down the road they could discontinue the open version and start making closed features/updates.
Don't get me wrong, I'm very pleased that this is the direction Microsoft is taking. I am just still very skeptical.
If I remember correctly, Microsoft is making a lot of money off of Android by licensing patents.
People who have an issue with the MIT License (on the patent issue) fall into one of two categories:
a) People who've put it in the same category with BSD in their heads at some point, associating with it the same shared caveat about patents, and
b) People who understand the distinction between the two but are unsatisfied with how terse it is (especially in contrast to e.g., Apache 2.0). This isn't helped by the fact that the MIT License doesn't actually use the word "patent", and the closest it gets to saying "irrevocable" is "without restriction"/"without limitation".
In any case, Microsoft also included a custom patent grant at the time they announced the CLR's availability on GitHub and its new, more agreeable license terms. (Unfortunately it doesn't include the word "irrevocable", either.)
I know this is sounds silly, but I wonder if it's a thing or not that when a software company publicly releases some valuable code open-source, then there is always someone thinking: "better fork this as quick as possible! you never know!" :)
There are quite a few products around which fit that type of scenario - where an older, free version is still circulating while the company now distributes a close source paid version.
See https://news.ycombinator.com/item?id=9431368 w/ Microsoft .NET CoreCLR is now running on FreeBSD 10.1 (amd64)
Should Microsoft provide a few common platform install methods?
dnvm install latest -r coreclr -uNot quite, but they're getting there. And supporting Homebrew, apparently.
As much as it pangs me to say it, I'm playing some great games on Linux now because the Unity people built it on Mono.
I'm glad that you were able to make it all work with the instructions[1] we provided. There are two major pieces that we're still working on, which you call out:
- Compiling managed source on OS X and Linux with Roslyn.
- Running DNU (NuGet) on .NET Core to restore packages.
Most everything else functionaly works. Once those are solved (and we are close to it), the experience will be great. In just a few commands, you'll be able to acquire .NET Core, restore packages and run your app, independent of which OS you are on.
For .NET developers, it is indeed historic. Community and corporate developers alike are quite excited and see a lot of new opportunities going forward. You might have noticed that the community is leading the OS X and FreeBSD .NET ports, with support from Microsoft. We added official FreeBSD CI[2] only a week ago, upon the request of the community.
[1] https://github.com/dotnet/coreclr/blob/master/Documentation/...
[2] https://github.com/dotnet/coreclr#build-status
edit: formatting
We (and me in particular) are going to continue investing in docs for this reason. Feel free to file an issue if there is anything else you want written/explained. We have operators waiting.
BTW: I highly recommend the "Introduction to the CLR" [2] doc. It has a great fundamental view of the product that I suspect many .NET developers would appreciate and will likely learn something from.
[1] https://github.com/dotnet/coreclr/blob/master/Documentation/...
[2] https://github.com/dotnet/coreclr/blob/master/Documentation/...
When I tried to use Lync on browser, I remember seeing something about .NET. Or is it silverlight?
https://github.com/aspnet/Home/tree/dev/samples/latest/Hello...
Follow instructions here: https://github.com/aspnet/home
This can also be done with mono, fastcgi, and nginx.
This is the same thing Microsoft did to IBM. Microsoft will do it to any "partner" they feel they can cannibalize. The Halloween Documents are not only relevant, but canon with this move.
[1]: http://wiki.unity3d.com/index.php/Running_Unity_on_Linux_thr...
[2]: http://blogs.unity3d.com/2012/11/22/linux-publishing-in-unit...
Seriously, they could have fair chance, C# was so much better, but today it's still quite better but java is proven and has more libs.
C# is centuries ahead of Java 8, and with even more to come faster. And I'm saying that as an old Java dev (for 8 years up until 2008 or so) who have only dabbled in C#.
But 1996-2005 SUN made Java the #1 name in the enterprise and education space back in the day.
Kotlin in particular has quite a lot of the things like people like in C# (no full equivalent to linq though), and some things that are only pencilled in tentatively for the version of C# after next, like full nullability in the type system. And you can convert Java files to Kotlin with a single keypress, and your entire project still compiles, so there's a migration path for Java devs to Kotlin whereas there isn't one from Java to C#, really.
So yes the Java language moves slowly. However Oracle/Sun have barely been trying with the Java language: the bulk of their efforts are going into things like upgrading the standard library, better virtual machines, better support for more types of languages, better performance etc. I think they've pretty much bitten the bullet on letting other companies run with language research and development (like JetBrains)
1. Sun sued Microsoft for trying to improve Java. And so Gates went out and hired the guy that designed Turbo Pascal and Delphi to head up C# development. Because of course java and it's libraries are completely unsuitable for desktop development.
2. Oracle bought Sun and suddenly every company that absolutely cannot tolerate being Larry Ellison's b.. started investing in in-house programing languages. All those big companies have spent oodles of money on making sure Larry can't drink their milkshake.
NAnyway as a sometime C#/.net code slopper I welcome Microsoft tossing their hat in ring. Seriously Linux and iOS seriously needs these tools.
You have two main pieces: the Common Language Runtime, which is the virtual machine (like the JVM) that executes the code. Then you have the library it comes with, which is fairly large compared to most languages.
edit: Added more context
What's terrible about the JVM/JRE?
Many people complain about the language Java (conservative language, programmer culture of complexity...), or the web browser plugin for the JVM (security vulnerabilities, bad startup performance...), but I've generally heard good things about the JVM itself.
The CLR supports user-defined value types whereas the JVM doesn't, it relies on a classical uniform data representation. Because value types are stack allocated, in C#, you will have less stress on the GC (because you can define stack-allocated value types), on the other hand, the JVM GC will be doing a lot more work. This is why you see "the JVM is heavily optimized" statements.
Another downside of the JVM is that it has no native support for tail call optimization, this is not that major, but it is a bit silly for functional languages running on the JVM (Clojure). The Scala compiler is intelligent enough to do this by itself, but there's no native support on the VM itself, unlike on the CLR.
Another point is that the CLR was designed as a true language-agnostic virtual machine, so developing new languages on it is easy. It is not hard to do that on the JVM, but more so than on the CLR.
.NET was good enough when it came out many years ago. It was just a closed one platform thing.
For Swift, compare it to C# (depends on personal preference)
For XCode, compare it to Visual Studio (IMO, VS is light years ahead)
For Mac Native, compare to the .NET runtime (IMO .NET is better but it's not as clear cut)
Up until now however it has only ran on Windows which was its biggest "downside" Vs. Java which runs on many platforms.
I don't think that's really historically accurate. Java and C# were pretty similar back in 2002. The .NET team was more willing to add complexity and occasionally make breaking changes, like generics in CLR 2.0.
So .Net had the advantage of coming years after Java had shown what it could be done (or not, see browser applets) from a technological and commercial point of view, AND quite a few years of development without worrying about backward compatibility.
I'm not saying Sun developers were not slow (they were), but they clearly had a much more "entrenched" position, with all that it entails.
There's a larger variety of JVMs designed for a broader range of hardware, the most interesting to me being Azul and their GC tech.
But the CLR gives you some different tactical options. Value types and unsafe code let you do things that are far more expensive or awkward on the JVM. Writing a significant amount of functionality that does no heap allocation is more feasible on the CLR than JVM. Native interop is an order of magnitude easier. The CLR is generally much faster to start up; Java terminal apps don't suit interactive use. The library linking story is much more pleasant too, with a single dynamically linked executable referencing GAC-installed assemblies, rather than stringing together enormously long class paths.
A reference to back your statement up would be great... (i couldn't find a good one quickly). Are you aware of the capabilities of the CLR's next generation RyuJIT? What you say is at odds with what I thought, but I'd love my perceptions to be corrected if they are indeed incorrect.
How would .NET compare to Apple's native environment?
I guess the whole point is to write cross-platform code, but is the .NET environment that much better than Swift/Xcode?
I mean, Java never really caught on with the Mac user base.
But a cross-platform CLR opens up some possibilities even for desktop or CLI apps. The wealth of the .NET ecosystem is compelling.
Well, probably it is better if you have (say) a company full of people who know how to write C# but have never used Swift. And the whole write once run anywhere thing is nice (sure, native apps "feel" better, but if there are no native apps I'd rather have a Java version than nothing).
You said it all. The whole point is cross platform development.
People use Swift to develop apps for Apple products. Before Dot.net was made open source, people only used it to develop for Microsoft platforms.
The fact Dot.net is now crossplatform makes it possible for GNU/Linux and Mac users to consider it for development.
Although there are some good bindings to cocoa to do so.
More importantly, this is huge, but as a Linux developer/user I still have no desire to use .NET on my platform. Maybe Mono has scarred my permanently.
Reasonable people can disagree, of course.
For code I am editing on MonoDevelop or on VS and then compiled and ran on Linux.
Excited to see that interesting tech like C#, F#, CLR, LINQ and friends is heading our way. If anything it'll give Java a run for its money and that's no bad thing.
It would've been great if the author knew what 'distribution' means in this context.
"Distribution" is hardly specific to Linux distributions in technical circles. I don't know how you got that impression. The term is synonymous with software bundle, e.g. "Erlang/OTP distribution".