Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Clang with Microsoft CodeGen in VS 2015 Update 1 (msdn.com)
118 points by BudVVeezer on Dec 4, 2015 | hide | past | favorite | 37 comments


Well consider me surprised. I didn't see that coming.

At first though, when I read through I considered "this is exactly what Stallman didn't want to happen with GCC! Companies using the open-source parts to power their own proprietary tools".

And then I read at the end that they intend to submit most of the things they've done back to LLVM/Clang.

Microsoft is actually starting to act like one of the good guys.


>Microsoft is actually starting to act like one of the good guys.

Morality doesn't need to come into it - they have real incentives to push changes back to master even without restrictive licenses.


I can't find the link (though I'm sure it was on HN at the time...), but there was a talk by the Sony PS4 compiler people that touched on this a while ago. They ended up open sourcing as much PS4 stuff as they could, not because they wanted to as such, but because it was taking them too much time to do the merge each time they updated their copy.


http://llvm.org/devmtg/2013-11/slides/Robinson-PS4Toolchain....

It's the "Working with the LLVM Community" section.


You're right, Microsoft has pushed a lot of changes upstream to projects in the past for it's own selfish reasons. That doesn't mean said changes are bad, a lot of times they're fixing problems that they're tired of having to provide support for to end users.


A company at a disadvantage may find it in their own interest to act like good guys with respect to open source projects.

Fast-forward a few years: if people become dependent on the new tool and there's money to be made differentiating their tooling from others, their attitude may change.

The debate about licenses becomes more interesting once a contributor finds themselves in a position of power vs other contributors.

Or maybe they just get tired of having to vet their changes and designs with third parties. Getting code accepted upstream can be a lot of work.


If you look on Github (even Apache), there are Microsoft employees making contributions to open source projects under their own accounts or as part of the organization. Steps under Satya have made engagement with open source across the company generally much better, not just in field/evangelism roles. This is in addition to works like this and open sourcing of things like the CLR, etc.


Yeah, but you will notice none of those are GPL projects - and my point is OSS works as a business/support/development model even outside of "monetize on support model and force a level playing field with copyleft" (eg. RedHat) - for a large number of cases it makes sense/the incentives are right even with liberal licensing.


Not true. Microsoft commits to a number of GPLed software, not the least of which being libGIT2.


Yes this is true, I meant in the context of the stuff they are opensourcing with CoreCLR, Roslyn, LLILC, ASP.NET, TypeScript and stuff.


That is why there are multiple licenses. Companies/individuals contribute under what works for their job/role/interest.

Go back an look at history, many companies are evolving towards being more open.


Even for weird little side projects, it's always feels safer to me to get changes upstreamed than keep carrying around "special snowflake" vendored copies that diverge.


I think this means that the VS toolchain now has a modern C compiler front-end. The VS C++ compiler has seen good progress as of late, but the VS C compiler was seriously lagging, only supporting bits and pieces of C99(!).


yes, not having proper c99 has been a pain for a very long time right up to VS 2015


Cool. Now can we have Swift with Microsoft codegen?


why would you want to use swift? just curious.

you don't need a reason... but i've not seen much good about the language, just a bunch of apple hype and hand forcing. just like obj-c which the mainstream community realised the flaws of 30 years ago when it was new... and now we have to live with as a necessary evil for the same class of 'reasons'. XD


Visual Studio can develop for iOS now (yes, you read that right), and Swift is a more pleasant alternative to Objective C.

This is probably more of a, "I'd rather use Visual Studio with my Swift project" instead of "I'd rather use Swift with my Visual Studio project." It's a very nice IDE, and Xcode is not quite as nice.


I don't know if this is included in your "Xcode is not quite as nice statement", but I have personally never had VStidio crash on me. Whenever I use Xcode, it seems like every third day or so something disasterous happens.


there is still a lot of pain in using visual studio for iOS.

its obviously the way forward though... i'd still not use swift for it predominantly if i can use a tiny layer of obj-c/swift to interface to sensible code written in C++ that works for every other platform too.


Microsoft is trying to get iOS developers to port their apps to Windows Phone.

You can not make an iOS app with VS's Objective-c , and most likely it will be the same way when they add Swift support to VS.


Pattern matching and structural types!

In terms of modernity, I think Swift is between C# and F#. However, Swift is far more mainstream than F#.


These are the 2 features I can't wait for in C# 7. Pattern matching and structural typing along with discriminated unions are pretty awesome. Like, I want the current C# type system, but with those things with it to forget about a bunch of boilerplate and odd problems that can pop up otherwise.


I can't find the tweet, but someone said something like "what do I think of swift? Seeing all of iOS using a language which has features normally reserved for functional languages is wonderful."


neither are of great benefit imo. they certainly don't allow me to do anything new... just enable me to do things with less work.

this is not a bad thing, and certainly is a good thing, but on its own its a tiny benefit compared to writing code that works on all platforms, and which compiles to very efficient use of instructions (i have ample experience removing swift and obj-c code as an optimisation strategy sadly).


I think that's because there weren't many Swift users who weren't already on board with the Apple hype train, for obvious reasons. I don't do iOS dev personally, so it's never seemed worth my time to learn, but it seemed like a cool language.

(By the way, I have done iOS dev in the past, and Objective-C has grown a lot under Apple's recent guidance from where it was 20 years ago. Again, if there were a free-software runtime supporting modern Objective-C -- last I checked, GNUstep was a bit out-of-date -- I might have considered it as an option for development on non-Apple platforms.)


Because it's actually a well designed language that's productive and modern?

In my opinion the only thing missing is better reflection (will get better), concurrency a la Go (they're considering), and async/await. There are a couple unfinished bits but the compiler tells you "X feature not implemented YET"

What's wrong with it?


i strongly disagree with that sentiment. but there we go... i can certainly go into more detail if you would like, but the main thing for me is that it solves no problems that existing languages do not, and the generated code (i.e. instructions for the CPU) from using the abstractions provided are considerably worse for performance than if i abuse a language like C++ to achieve the same features.

this is damning of the quality of the compiler imo. now that its open source i might make some effort to help this... but it seems unlikely given the utter lack of motivation to use the language to begin with (a tiny thing layer of obj-c is all i need for now - i see no reason to change this - even in light of swift)

to me it seems like apple are solving a problem that doesn't exist because they choose to ignore established and well developed languages and tool chains.


Visual SwiftSharper. Why not?


Does this mean that if I can make a random project build with Clang it's easier to port to Windows? (POSIX bits excepted)


yes.

You dont have to worry about the fail VS syntax parser; clang will parse your code exactly the same as it does on other platforms.


I think MS has realized that desktop era is over and cloud era has taken over. They will be making much more money by renting out infrastructure than just licensing software. So they are trying hard to make sure that oepn source development tools and servers work well on Windows.

By allowing Clang comaptible code with VS, brining open source tools and servers will be much easier for developers which will help MS to retain more developer base for Windows.


Would custom clang plugins work?


Wowza, that would be cool! IIRC Apple's clang doesn't support plugins but that can be worked around (with some/much difficulty) using clang -emit-llvm, custom opt w/ your pass, and llc to lower to assembly/object file. Of course, versioning in this kind of scenario is "fun".


Cool. This might have come in handy about 6 years ago for a C++ OpenGL cross-platform project. (I haven't done a C/C++ project in a long time though ...)


why? i seem to have managed many such projects without such tools before and after 6 years ago... i'm not sure what benefit they would realistically have.


You managed C++ projects without a C++ compiler before? How in the world did you do that?


without /this/ c++ compiler. not all of them ¬_¬




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: