Live data from Hacker News

MSBuild is going cross-platform with .NET Core

blogs.msdn.com

111–120 of 139 posts

Re: MSBuild is going cross-platform with .NET Core

#111
post #89
post #76

Earlier quoted context omitted.

Nicer in what sense? I do like both, I'd take either of them over Java on any day, but whereas Kotlin is maybe better suited for functional style programming (immutability out of the box, data classes etc. - however .NET people always have F# for this stuff), it's hardly on the same level as C#. For instance Kotlin doesn't have reified generics (if I recall correctly they actually attempted it, but it's too hard to g…

>Kotlin's equivalent of LINQ doesn't use deferred evaluation. Wow, I'm pretty surprised at that. Any kind of list comprehension/functional sub-language over collections seems like it ought to be deferred/lazy from the ground up. I'm doubly surprised at that from JetBrains.

Unfortunately it is so, so I wouldn't recommend it for large collections, or wherever performance considerations come into equation.

Let's peek at Kotlin's sources (_Filtering.kt):

    public inline fun  Iterable.filter(predicate: (T) -> Boolean): List {
        // note how it's allocating a new ArrayList - 
        // Kotlin doesn't have a "new" keyword, but it's initializing it here
        return filterTo(ArrayList(), predicate)
    }
And it redirects to filterTo:

    public inline fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean): C {
        for (element in this) if (predicate(element)) destination.add(element)
        return destination
    }
With this approach, if you're chaining several of these operations, you will end up allocating quite a few arraylists, one by one.

Note that without something like yield-return in place, writing your own collection-transforming extension functions with lazy evaluation won't be so clean and easy either

Since it has 100% interop with Java, you could work around this problem by using something like Guava - Iterables and FluentIterable are based on iterators as they should.

They use static helper methods, all you need to do is to snap out some extension functions in Kotlin to serve as bindings to Guava. The only problem, especially on Android, is that Guava's notoriously big.

Kotlin is good, I'm not hating on it, but mature? Not yet. Nicer than C#? Best of luck, but not with this type of shortcomings

Re: MSBuild is going cross-platform with .NET Core

#112

Earlier quoted context omitted.

> Will hard-core Linux users who used Java migrate when it makes sense? Probably only for mobile/desktop app but less likely for back-end/webservice/infrastructure stuff. Take MSBuild. This is pretty much Ant. Sure, there's NuGet but Ant+Ivy or MSBuild+NuGet combo isn't anywhere close to Maven (despite the XML hate). Libraries, communities, tools, frameworks of .NET ecosystem is still behind Java. Unfortunately langu…

Can you/someone give a quick rundown of why maven is really so much better than everything else?

Maven love is far from universal:

http://kent.spillner.org/blog/work/2009/11/14/java-build-too...

Re: MSBuild is going cross-platform with .NET Core

#113
post #105

Earlier quoted context omitted.

And there's Cake for C# peeps - http://cakebuild.net

Oh, God, thank you! I've been hunting and hunting for something to replace CruiseControl. I had no idea this existed. Is there an easy way to turn this into a CI?

You mean get it working with a CI server? If so, yes it can from what I've read.

I think it works with AppVeyor and Team City: http://cakebuild.net/dsl/build-system

Note: I've never used Cake myself, but have seen it recommended alongside Fake.

Re: MSBuild is going cross-platform with .NET Core

#114

Earlier quoted context omitted.

Can you/someone give a quick rundown of why maven is really so much better than everything else?

Maven love is far from universal: http://kent.spillner.org/blog/work/2009/11/14/java-build-too...

Yeah and last time I used it at work (2012-2013) it didn't even support incremental builds. Even the company's best Java developers just accepted this as normal.

See https://cwiki.apache.org/confluence/display/MAVEN/Incrementa... for proof. That may have been implemented in the meantime but the fact is that maven had no support for incremental builds for at least 10 years (released in 2002). Amazing.

Re: MSBuild is going cross-platform with .NET Core

#115
post #89
post #76

Earlier quoted context omitted.

Nicer in what sense? I do like both, I'd take either of them over Java on any day, but whereas Kotlin is maybe better suited for functional style programming (immutability out of the box, data classes etc. - however .NET people always have F# for this stuff), it's hardly on the same level as C#. For instance Kotlin doesn't have reified generics (if I recall correctly they actually attempted it, but it's too hard to g…

>Kotlin's equivalent of LINQ doesn't use deferred evaluation. Wow, I'm pretty surprised at that. Any kind of list comprehension/functional sub-language over collections seems like it ought to be deferred/lazy from the ground up. I'm doubly surprised at that from JetBrains.

I don't know much (anything..) about Kotlin, but surely that is a library issue and not a language issue - which could be quite easily rectified?

Re: MSBuild is going cross-platform with .NET Core

#116
post #115
post #89

Earlier quoted context omitted.

>Kotlin's equivalent of LINQ doesn't use deferred evaluation. Wow, I'm pretty surprised at that. Any kind of list comprehension/functional sub-language over collections seems like it ought to be deferred/lazy from the ground up. I'm doubly surprised at that from JetBrains.

I don't know much (anything..) about Kotlin, but surely that is a library issue and not a language issue - which could be quite easily rectified?

Yes and no... This is part of their standard library, so from a practical point of view, it is a language issue.

Easily? Proper implementation isn't so trivial, look what it takes for Guava:

https://code.google.com/p/guava-libraries/source/browse/guav...

https://code.google.com/p/google-collections/source/browse/t...

https://code.google.com/p/guava-libraries/source/browse/guav...

Plus:

* new (lazy) extension functions would be getting in the way of standard ones, you would need a paralel naming convention (perhaps one borrowed from LINQ, where map = select, filter = where, fold = aggregate and so on) and developers would still confuse one with another.

* unless we agree on one canonical implementation, yours would be different than mine, easy to see how it could become a mess.

If there is a better approach which removes these obstacles, someone let me know

Re: MSBuild is going cross-platform with .NET Core

#117
post #10

I know MSBuild gets a lot of hate but this is still great news. The end goal of having a .Net project be compile-able on Windows, Linux and Mac is going to be awesome. I'm curious, when everything is finally done, what the adoption rates will be like. Will hard-core Linux users who used Java migrate when it makes sense? Will they avoid it because "M$"? All good stuff.

Anyone who does not like MS because of the $ cannot at the same time like Java.

It's not a question of $ or of liking MS, it is a question of trust. Microsoft can and will suddenly discontinue entire solutions like Silverlight. I know of a company that is in real trouble because they first rewrote their entire application in Silverlight and now have to do it again in HTML5...

Java on the desktop is almost dead due to the horrible JRE by Oracle. On the server and on Android it is alive and well, and the community is big enough to keep it going even if Oracle loses interest. It will also make its return to the desktop one day when someone figures out how to make it suck less, as the language and the available libraries are awesome.

Re: MSBuild is going cross-platform with .NET Core

#118
post #52

Earlier quoted context omitted.

I'm not sure Microsoft came too late to the party. Perhaps MSBuild is a bit crappy (I don't know, never used it), but I can imagine Roslyn becoming more useful now on other platforms since it's open sourced. It'll be great that one can be sure the runtime behaves the same on all platforms Roslyn will run on. And it'll also be nice if new runtime features will be available on every platform at (more or less) the same…

> "And who knows, maybe someone will build a decent MSBuild replacement. Or perhaps the Xamarin guys already have a nice alternative." You might want to check out FAKE, it essentially lets you write MSBuild configurations using F#: http://fsharp.github.io/FAKE/ This recent announcement means that a multi-platform FAKE in the near future looks like a good bet.

I used fake in anger. I wouldn't recommend using it compared to more mature alternatives for serious projects. It seemed strictly worse than using NANT & invoking msbuild. Yes, xml is horrible, but NANT is mature. Both tools don't understand file dependencies. From that perspective they are inferior to make.

Re: MSBuild is going cross-platform with .NET Core

#119

Earlier quoted context omitted.

> Will hard-core Linux users who used Java migrate when it makes sense? Probably only for mobile/desktop app but less likely for back-end/webservice/infrastructure stuff. Take MSBuild. This is pretty much Ant. Sure, there's NuGet but Ant+Ivy or MSBuild+NuGet combo isn't anywhere close to Maven (despite the XML hate). Libraries, communities, tools, frameworks of .NET ecosystem is still behind Java. Unfortunately langu…

Can you/someone give a quick rundown of why maven is really so much better than everything else?

It's the only build system I've ever seen that's truly declarative. You can't put random turing-complete computation in the middle of a maven project definition; you can only invoke well-defined plugins (if you want a custom build step, you package it up as a plugin - written in ordinary java, unit testable and all the rest of it).

The result is there are no "snowflake builds". One project tends to build exactly the same as any other; virtually every project uses the same source directories etc.. It makes it really easy to be productive straight away when switching projects. And the limited build steps mean the IDE integration can be very complete.

Re: MSBuild is going cross-platform with .NET Core

#120

I know MSBuild gets a lot of hate but this is still great news. The end goal of having a .Net project be compile-able on Windows, Linux and Mac is going to be awesome. I'm curious, when everything is finally done, what the adoption rates will be like. Will hard-core Linux users who used Java migrate when it makes sense? Will they avoid it because "M$"? All good stuff.

It's a whole different ecosystem - it's not like Scala where I can sling in one class on an existing Java codebase. .net isn't just its own VM, it's its own IDE, its own build tool, its own packaging model....

For little standalone pieces - the kind that people write in D or OCaml because they want to - I can see .net being used on linux. But I don't see anyone migrating an enterprise Java codebase - it's just too much effort for too little gain.

Post reply on HN