News for hackers. Stuff that matters.
Re:Visual Studio for Mac Preview by johnhattan on Wednesday November 16, 2016 @11:01AM (#12968177)
FWIW, this is actually a rebranding of Xamarin Studio, so it only handles C# and F#. It's a bit puzzling, as VSCode seemed to be the tool that was going to take over all the Xamarin Studio features.
Re:Visual Studio for Mac Preview by wmccullough on Wednesday November 16, 2016 @11:31AM (#12968562)
If I had to really take a guess here, this is what I'd speculate.

This is only the first step for Visual Studio Mac. The next will be to begin bringing feature parity to the Mac version (My gut feeling is that VB.NET won't make the leap, but with Roslyn, maybe I'm wrong).

I feel this isn't stated enough. VSCode, albeit made by Microsoft, goes way beyond Microsoft's core interests. Given that you can now enable language support for around 470-ish languages, I don't think that their game here is to be a replacement for anything. I have an even crazier suspicion about what VSCode is really about.

So if you've lived with Visual Studio for years, you know that it's been COM based for a looonnnnggg time (since inception). I think VSCode serves two interests. The first interest is to bring non-Microsoft users in the fold with the hopes that they may go "This ain't so bad, maybe I'll give other stuff a try". I think the second is that they need a playground to figure out how to, excuse me here, "unfuck" the core architecture of Visual Studio. If they can write suitable replacements for core functionality, let them bake and mature for some time, then BOOM! they can replace the VS components.

Like I said, just a crazy opinion based on what I've seen so far.

Re:Visual Studio for Mac Preview by vonklaus on Wednesday November 16, 2016 @11:39AM (#12968656)
I agree, but would add that I think their core motivation is to drive developers to microsoft azure. I am sure they believe they would love mac users to buy more MS software but targeting non-ms devs this hard seems like they want to compete with AWS && google.

AWS UX is a dumpster fire. Azure was quite nice from what I can tell. I love VS code and am a mac user. I also strongly dislike AWS as it is extremely complex and annoying. If there was amazing tooling, I would consider switching from digital ocean to azure.

Re:Visual Studio for Mac Preview by wmccullough on Wednesday November 16, 2016 @12:12PM (#12969061)
I'm currently undergoing a very long evaluation of both products. I agree, the AWS UX is a dumpster fire. Even simple things seem to make no sense, and if I had to guess without checking I'd say they went through a hyper growth of their cloud.

I also agree that their long-play is Azure. You just wait, they'll put a major investment into IntelliJ or Eclipse to make it more Azure friendly too.

Re:Visual Studio for Mac Preview by DonHopkins on Wednesday November 16, 2016 @11:52AM (#12968830)
Mozilla underwent a process of "DeCOMification", because they went too far with XP/COM, and wanted to dial it way back.

https://bugzilla.mozilla.org/buglist.cgi?query_format=specif...

Re:Visual Studio for Mac Preview by mizzao on Wednesday November 16, 2016 @12:39PM (#12969323)
Can someone link to a synopsis describing what "COM" is? It's hard to search for. (e.g. microsoft com visual studio)
Re:Visual Studio for Mac Preview by ColinDabritz on Wednesday November 16, 2016 @12:50PM (#12969446)
COM is the Component Object Model: https://en.wikipedia.org/wiki/Component_Object_Model

This was how a lot of system and third party libraries provided large amounts of functionality in the windows ecosystem for quite some time. These are usually in the form of a DLL (Dynamic Link Library), libraries of COM components, packaged as a ".dll" file. This is related to the re-use and versioning issues known informally as "DLL hell". Most COM components are native C and C++ based, exposing a standardized COM interface for component reuse.

Dot net was a new ecosystem, but much of the Win32 related dot net API is wrappers over existing native COM components. There are also extensive dot net facilities for repackaging and working with existing COM libraries through a Com Interop layer. https://msdn.microsoft.com/en-us/library/ms173184.aspx

The COM system provided an approach to interoperability and reuse for a long time, but compared to our current generation of cross platform compatibility, the venerable COM system components are proving to be a significant legacy challenge for cross platform implementations.

Re:Visual Studio for Mac Preview by 72deluxe on Thursday November 17, 2016 @08:47AM (#12977347)
I don't think COM is going away either, despite the cross platform ideas. The entire Windows system is built on COM, and the new UWP apps are COM apps but they do not inherit directly from IUnknown - they inherit from a child of IUnknown (if only I could remember what the interface is called, sorry).
Re:Visual Studio for Mac Preview by pjmlp on Thursday November 17, 2016 @04:00PM (#12981505)
Why are you speaking in the past tense?

COM usage on Windows only increased after Windows Vista and is at the heart how UWP works and user space drivers.

Re:Visual Studio for Mac Preview by ColinDabritz on Thursday November 17, 2016 @04:25PM (#12981792)
Yes, good point. It was discussing in past test in the context of "DeCOMification" mainly. It would be interesting to have some insight into new component creation vs use of existing components.
Re:Visual Studio for Mac Preview by pjmlp on Thursday November 17, 2016 @11:52PM (#12984469)
Well it is just plain old COM, with a new base interface IIspectable that inherits from IUnknown and using .NET metadata instead of TLB files.

Using it from C++/CX is quite painless compared with the old ways, as it is quite similar to .NET, Delphi and C++ Builder ways of using COM.

For a little pain ATL style, you can use Windows Runtime Library.

Kenny Kerr and his team are pushing for C++/WinRT, a new C++ projection (language binding), based on pure Modern C++, with the goal to eventually replace C++/CX. Currently WIP, though.

For those that really like to suffer, the old way of using MIDL compiler with C is still possible for UWP applications.

From our projects, I would say most UWP developers use .NET for UWP controls and only resort to C++/CX if integration is C++ code is required.

Re:Visual Studio for Mac Preview by JohnBooty on Wednesday November 16, 2016 @12:46PM (#12969401)
Yeah, COM and .NET are notoriously tough to Google because of their similarity to TLDs!

I believe that .NET binaries, at least on Windows, are actually built atop COM but I'm not sure. Been a while since I've cared =)

COM = Component Object Model.

https://en.wikipedia.org/wiki/Component_Object_Model

Re:Visual Studio for Mac Preview by WorldMaker on Wednesday November 16, 2016 @01:49PM (#12970067)
.NET binaries can export COM components (just as C/C++ and other languages may), but are not COM components by themselves.

There is some confusion here because the part of the "export surface" design for .NET binaries/modules was originally designed to replace COM's "interface design language" (IDL) in a version of COM that was never quite finished. Coming back full circle the .NET "export surface" design was indeed recycled for the WinRT component model (the COM replacement of the WinRT/UWP stack) in its library metadata format (.winmd), which to .NET tools look like a .NET binary that is missing all of its (IL) code.

Long story short, .NET was not built on top of COM but parts of it were designed to backwards compatibly replace it/inter-operate with it. (...and then some of those same parts reused in COM's eventual actual replacement.)

Re:Visual Studio for Mac Preview by cobalt on Wednesday November 16, 2016 @12:46PM (#12969402)
com is a windows technology for IPC. https://en.wikipedia.org/wiki/Component_Object_Model
Re:Visual Studio for Mac Preview by ld00d on Wednesday November 16, 2016 @12:45PM (#12969389)
Re:Visual Studio for Mac Preview by OldSchoolJohnny on Wednesday November 16, 2016 @01:04PM (#12969599)
OMG I feel so old when I read your question. Component Object Model is what it stands for.
Re:Visual Studio for Mac Preview by DonHopkins on Thursday November 17, 2016 @02:42AM (#12975257)
Glad you asked! One of my favorite topics. ;)

COM is essentially a formal way of using C++ vtables [1] from C and other languages, so you can create and consume components in any language, and call back and forth between them. It's a way of expressing a rational subset of how C++ classes work and format in memory, in a way that can be implemented in other languages.

It was the outcome of the C / C++ / Visual Basic language wars at Microsoft.

The original 16 bit version of Visual Basic version 1 through 3 had a plug-in extension mechanism called VBX -- Visual Basic Extensions [2].

They were extremely popular and became a victim of their own success, after a whole industry grew up around them, and people started using them for all kinds of things they weren't intended for, and wanted to use them from other languages and frameworks like Borland. Microsoft had to do something about that to mitigate the success disaster of VBX, so they invented COM.

At the time, Microsoft was transitioning from Win16 to Win32, so they came up with the 32 bit COM definition, also known as OCX's, or OLE Controls, which they later called ActiveX, because COM was so hard to search for, and they wanted to take the spotlight away from Java with a new buzzword.

So they brewed up a bunch of ugly C macrology that enabled C programmers (or Visual Studio wizards) to define COM interfaces in header and implementation files that just happened to lay out memory in the exact same way as vtables of C++ pure virtual classes.

While C++ programs would use other ugly macros to declare actual honest-for-god C++ classes to implement COM interfaces.

And Visual Basic programmers would ... do whatever it was that Visual Basic programmers did.

COM's IUnknown::QueryInterface [4] method is essentially like C++'s dynamic_cast [5]. But it also adds some object aggregation features [6] that let you compose multiple sub-objects together by aggregation instead of using monolithic inheritance. You could implement "tear off interfaces" [7] that lazily create aggregated sub-objects on demand, useful for implementing callback interfaces.

MFC (Microsoft Foundation Classes) is a set of C++ wrappers around the lower level Win32 interfaces, plus a huge framework for implementing GUI widgets and dialogs on top of Win32, and for wrapping rube-goldbergesque OLE Automation interfaces around C++ classes. For some time MFC was the primary way of implementing COM interfaces in C++, but it was infamous for being horribly complex, with all its ugly macros, Hungarian notation, and bizarre programming conventions.

Later on Microsoft came out with the C++-only ActiveX Template Library (ATL) [8], which, although it was still necessarily quite ugly, was a more elegant and powerful way of implementing COM components in C++, didn't have the baggage of supporting C, and let you implement COM/OLE/ActiveX components without the hideous MFC framework. ATL was popular for implementing all kinds of Internet Explorer plug-ins.

OLE was actually a layer of COM interfaces and MIDL (Microsoft Interface Definition Language) on top of COM, which adds the IDispatch interface for dynamically querying and invoking methods and properties at runtime, and variant types [9]: tagged unions for representing polymorphic data (i.e. VB data types) and passing parameters to OLE IDispatch functions.

OLE was the glue necessary for integrating COM components into the Visual Basic runtime, so it directly supported Visual Basic data types, calling conventions and semantics like indexed properties.

OLE also provided an interface definition language (ILD) you could compile into binary type libraries, use to generate boilerplate C and C++ interfaces, and OLE also had COM interfaces and structures for providing those type libraries at runtime. It also had a lot of persistence, runtime reflection, and user-interface related stuff for plugging components and dialogs together in windows, providing property sheets, editing and configuring controls, etc.

MIDL supported defining components with "dual interfaces" [10]: both an OLE IDispatch interfaces taking variant type parameters, and also more efficient lower level COM interface taking primitive types. Runtimes like Visual Basic knew how to integrate dual interfaces and could bind to the more efficient underlying COM interfaces, instead of going through the slower generic dynamic IDispatch interfaces.

IDL also described the intricacies of DCOM [11] interfaces (for in-process and networked remote procedure calls), parameter marshalling [12], and all kinds of other bizarre stuff. DCOM is where COM went off the deep end.

At its core, COM was essentially a very simple and ingenious idea that elegantly solved some real world problems, but it eventually evolved into something extremely complex that attempted to solve many other unrelated problems, and which required a massive amount of tooling, and that depended on Microsoft's Visual Studio and Win32 environment.

Microsoft actually ported ActiveX to the Mac using ATL and Metrowerks Code Warrior, in order to implement Microsoft Internet Explorer for Mac [13] (which was actually the best web browser on the Mac at the time, by far). But not a lot of third parties (except for me and a few other crazy people) ever used ActiveX on the Mac.

However it did become quite fashionable for other organizations to create portable COM knock-offs to solve some (hopefully fewer) of the same problems, but which were incompatible with Microsoft's tooling and COM itself (which kind of missed the main points of COM, but hey).

For example, Macromedia came up with MOA (Macromedia Open Architecture) [13], their COM-like plug-in extension mechanism for Director and other products.

And Mozilla came up with XP/COM [14], for implementing components in Mozilla/Firefox/XULRunner/etc, enabling programmers to implement and consume XP/COM components in C++ or JavaScript. Of course it has its own IDL and tooling, and suffers from many of the same problems that COM did.

Mozilla didn't go nearly as far down the rabbit hole as Microsoft did, and later backtracked in their valiant "deCOMification" aka "deCOMtamination" and "outparamdelling" efforts [15].

At this point in history, I think it's best to skip the "component technology" middleman and integrate extensions directly into the JavaScript engine itself. Which brings us back to the sub-topic of VSCode!

[1] Virtual Method Table: https://en.wikipedia.org/wiki/Virtual_method_table

[2] VBX: https://en.wikipedia.org/wiki/Visual_Basic_Extension

[3] Variant Type: https://en.wikipedia.org/wiki/Variant_type

[4] IUnknown::QueryInterface: https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

[5] dynamic_cast: https://msdn.microsoft.com/en-us/library/windows/desktop/ff4...

[6] Aggregation: https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

[7] Tear Off Interface: http://www.codeguru.com/cpp/com-tech/atl/performance/article...

[8] ActiveX Template Library: http://www.drdobbs.com/windows/the-activex-template-library/...

[9] Variant Types: https://en.wikipedia.org/wiki/Variant_type

[11] Distributed COM: https://en.wikipedia.org/wiki/Distributed_Component_Object_M...

[12] Marshalling: https://en.wikipedia.org/wiki/Marshalling_(computer_science)

[13] Macromedia Open Architecture (MOA): https://www.adobe.com/support/xtras/info/moa.html

[14] XP/COM: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM

[15] deCOMtamination: https://wiki.mozilla.org/Gecko:DeCOMtamination http://taras.glek.net/blog/categories/decomtamination/ https://blog.mozilla.org/tglek/category/decomtamination/

Re:Visual Studio for Mac Preview by pjmlp on Thursday November 17, 2016 @04:03PM (#12981535)
> COM is essentially a formal way of using C++ vtables

No, it is actually quite actual, I guess you haven't looked into how Windows 8, 8.x, 10 and UWP applications work.

Great summary, though.

Re:Visual Studio for Mac Preview by DonHopkins on Thursday November 17, 2016 @05:37PM (#12982402)
Thanks! By essentially I did mean actually, or literally (in the literal sense (in the literal sense (in the literal sense ...))). ;) http://www.thesaurus.com/browse/essentially
Re:Visual Studio for Mac Preview by pjmlp on Thursday November 17, 2016 @11:43PM (#12984421)
I guess I misunderstood "formal" as "a former".
Re:Visual Studio for Mac Preview by 72deluxe on Thursday November 17, 2016 @08:49AM (#12977363)
Really really great summary.
Re:Visual Studio for Mac Preview by jaas on Thursday November 17, 2016 @12:37AM (#12974662)
We had a better word for it at Mozilla: deCOMtamination
Re:Visual Studio for Mac Preview by dethswatch on Wednesday November 16, 2016 @02:48PM (#12970754)
>"unfuck" the core architecture of Visual Studio.

This is likely the reason we don't have a 64bit Studio too- just too much of a pain. Their arguments re speed and memory usage have been going on for years while I've gone from 2gb to 256gb and similar speed increases.

Those arguments are becoming irrelevant and headed for laughable.

Re:Visual Studio for Mac Preview by wmccullough on Wednesday November 16, 2016 @03:00PM (#12970905)
I agree. Even if they decided to keep everything as x86, just rebuilding the COM pieces would boost performance.
Re:Visual Studio for Mac Preview by dethswatch on Wednesday November 16, 2016 @04:23PM (#12971686)
Articles I've read says the Win and App divisions are still in love with COM and when Sinofsky got his way, we got 'Windows Store Apps' where everything ran under COM instead of everything running under .NET.

Enter Win8 debacle and Sinofsky wisely decided he'd do other things.

Re:Visual Studio for Mac Preview by int_19h on Thursday November 17, 2016 @03:16AM (#12975462)
WinRT is the name of the thing, and while it's derived from COM (you still have IUnknown, for example), it fixes a lot of the latter's problems and fills missing gaps. For example, it has class inheritance (implemented as composition), a much simpler event pattern, drastically simplifies the whole apartment mess etc.
Re:Visual Studio for Mac Preview by sreenadh on Thursday November 17, 2016 @05:11AM (#12976081)
Being a long time vs & MS user myself, your suspicion is genuine. I too suspect the same.

I have been burnt too many times by MS. So now, the only ms products I use is skype & ms office.

Re:Visual Studio for Mac Preview by bbatha on Wednesday November 16, 2016 @12:33PM (#12969277)
I think long term microsoft is planning on putting VSCode on Azure so you never have to leave your browser or the Azure bubble to write your apps.
Re:Visual Studio for Mac Preview by khellang on Wednesday November 16, 2016 @01:16PM (#12969718)
Fun Fact: VS Code started life in Azure as Project Monaco. It was later pulled into an Electron app and released as VS Code :)
Re:Visual Studio for Mac Preview by erikbye on Wednesday November 16, 2016 @01:25PM (#12969814)
That is Visual Studio Monaco, which is also the editor in VS Code.
Re:Visual Studio for Mac Preview by jsingleton on Wednesday November 16, 2016 @12:11PM (#12969049)
Xamarin Studio didn't support .NET Core, so previously you had to use the CLI tools and an editor like VS Code. You could run ASP.NET MVC in XS (version 5, Core is effectively version 6) but this ran on Mono.

Visual Studio for Mac (aka XS vNext) does now support ASP.NET Core so there is less need for VS Code. The re-brand makes sense (it's not just for Xamarin now). However, Code runs on more platforms (Linux, ARM etc.) and is also used in the browser as part of Azure.

I wrote a better summary of the differences here: https://unop.uk/getting-started-with-c-sharp-and-cross-platf.... It's the last in a four part blog series about .NET on Mac.

Re:Visual Studio for Mac Preview by keehun on Wednesday November 16, 2016 @01:33PM (#12969896)
In fact, the installer even states "Install Xamarin" in the About dialog:

https://i.imgur.com/skl8Tqx.png

Re:Visual Studio for Mac Preview by rpeden on Wednesday November 16, 2016 @11:27AM (#12968505)
XS/MonoDevelop worked with Visual Basic last time I tried it, so perhaps VS for Mac will as well?
Re:Visual Studio for Mac Preview by brudgers on Wednesday November 16, 2016 @08:31PM (#12973401)
My intuition is that VScode and Visual Studio are likely to remain significantly different products for the foreseeable future. VScode is an Electron app. Visual Studio is more a 'native' app with deeper integration into the host operating system.

Xamarin Studio was built to provide a Visual Studio like experience regarding platform integration and to align with the architecture of Visual Studio. VScode does not appear to have those as the primary goals. It was already available for OSX.

To me, this is further evidence that Microsoft's acquisition of Xamarin was in hopes of accelerating cross platform product development along a roadmap that tends to be more open source friendly. It may turn out that Xamarin Studio provides the core platform for Visual Studio at some time in the future or at least that the code bases merge to a greater degree over time.

Re:Visual Studio for Mac Preview by tracker1 on Wednesday November 16, 2016 @11:40AM (#12968671)
Yeah, it is a little confusing on that front... I've been really happy with VS Code, as it's always run very fast/well (at least on SSD).
Re:Visual Studio for Mac Preview by erikbye on Wednesday November 16, 2016 @01:29PM (#12969857)
I would be surprised if a text editor was not performant, but then again, most new software is terrible, so, maybe the surprise now comes when something performs.
Re:Visual Studio for Mac Preview by AsyncAwait on Wednesday November 16, 2016 @02:01PM (#12970205)
It's because it uses Electron (HTML/CSS/JS) that the OP mentioned it, I'd imagine.
Re:Visual Studio for Mac Preview by melling on Wednesday November 16, 2016 @11:33AM (#12968591)
Jedi Mind Trick. This is the tool you're looking for.

It's amazing how the rebranding changes attitudes.