Hacker News new | past | comments | ask | show | jobs | submit login
Microsoft Edge WebGL engine open-sourced (github.com/microsoftedge)
361 points by aroman on June 9, 2016 | hide | past | favorite | 97 comments

Well, that's interesting. The state of desktop OpenGL on Windows is pretty awful at the moment. The antiquated WGL APIs make it difficult to control when your application enters exclusive fullscreen mode, and as far as I know, it's impossible to control latency or get any kind of presentation feedback with them. You also can't make UWP apps that use WGL. Google's ANGLE, which is used to implement WebGL in Chrome and Firefox, is a lot better, and it lets you do fancy things like render OpenGL ES content to a D3D11 texture or to a DirectComposition surface. If Microsoft open-source Edge's WebGL engine (currently it seems like only the GLSL->HLSL translator is open-sourced,) it could become another modern way of using GLES on Windows.

Source: We rely on OpenGL to render video in mpv, and we are currently switching from using a WGL context by default to using ANGLE. Maybe this could be a third option?

Well, that would use a WebGL canvas and Edge's GLES renderer, not WGL and desktop GL. (WGL refers to Microsoft's equivalent of GLX and EGL here, not WebGL.)

So what is preventing you to use Microsoft's port of Angle?


Presumably nothing, if I was writing a UWP app. All I said was that WGL didn't work in UWP apps, not that there wasn't any alternatives.

It's actually pretty interesting that Microsoft maintain a fork of ANGLE for this purpose when they have their own GLES implementation in Edge. I guess (before now) it was easier for them to modify ANGLE than to open-source their own work.

Wow, 45 upvotes and no comments...

While I'm not entirely sure what the strategy is with this, I'm fairly surprised by the move. This is something that would have been unheard of from Microsoft even a decade ago. They've made a bunch of really huge strides in FLOSS, but they've all been centered around developer mindshare. I totally get open-sourcing your developer tooling, especially in consideration of their Azure ambitions, which isn't bad.

I really like VS Code, which has become my daily editor of choice, I keep meaning to try the integrated debugging, but haven't. The .Net core releases have me looking at C# again, in a fairly new light. The Linux Subsystem for Windows is impressive.

All of that said, this move still surprises me. I'm not sure if/how much it will benefit the larger developer community, but it is really nice to see a much more open MS. All I can say is that the next half decade will be particularly interesting in terms of software improvements as hardware has started to level off.

Having seen a tiny little slice of the requirements of open-sourcing code at a (different) Big Software company, I really hope people give MS and other companies their deserved props for stuff like this.

As a 3rd party it's very easy to think "oh they should just release the source for X and if they don't it's because they don't want to", but if X is big and it didn't start out public, it usually takes a pretty herculean effort to get it released, often meaning someone burnt a lot of capital (of whatever sort) to make it happen.

I believe it will pay dividends for Microsoft that they're being more encouraging of this kind of thing. There's a few reasons so many of the best developers work at Google (for example), and one of them is that Google opens a lot of stuff, and actively encourages open development. I, personally, wouldn't work anywhere where I couldn't contribute to Open Source communities at least part of my work day.

Microsoft knows how important developers are for a platform company, both inside and outside of the company (as evidenced by very good salaries, real offices, etc.). I just think it took them a few years to notice that one of the things good developers value is community. Now that they've figured it out, they've begun making changes. If you'd asked me 10-20 years ago, "Hey, would you ever consider working for Microsoft", I would have laughed. Today, I'd probably still say no, but I wouldn't laugh, and I'd probably even think about it for a minute or two.

> I wouldn't work anywhere where I couldn't contribute to Open Source communities

Okay, but note that that's not at all what my comment was about. Contributing new code to an open project isn't a hard problem, in any company I'm familiar with, but taking a large closed project that your company wholly owns, and getting it released as MIT is a different matter.

Even if the project was begun under the assumption it would be opened someday (as I imagine may have been the case here), momentum is against it and it tends not to happen unless someone is passionate about making sure it does.

This is so true. When I worked at Yahoo, there were a couple of people dedicated to helping people open source projects, and would help us make the right choices (eg, don't open source for the sake of it, etc).

>I, personally, wouldn't work anywhere where I couldn't contribute to Open Source communities at least part of my work day.

With respect I don't think that the gist of your post is solid, you seem to forget that Microsoft has no problem whatsoever to attract good developers. They could even afford to turn down someone as talented as the creator of Mono.

What developers - like other employees - look at is the corporate package, and - sometimes - the company's mission. This is why Oracle still has employees.

"This is why Oracle still has employees."

That's not a very high bar, is it? "Has employees"...well, so does Walmart. Does Oracle have the kind of engineering talent and passion that will see them through future decades as a market leader?

I believe we've seen a shift that won't revert. And, I believe Oracle has only a long slow decline ahead of them. Microsoft, on the other hand, may have averted that fate.

This is not to say that Open Source is magic (companies still have to ring the cash register), or that engineers are in charge of the ship now (though that, too, has been happening). I just think we live in a different world from the one where Microsoft and Oracle rose to dominant positions.

Would you want to work at Oracle? More importantly, would you prefer to work at Oracle over, say, Google or Github? Oracle has always been, and remains, anti-OSS. They sue over Java APIs, they close Solaris development after Sun had opened it, they piss off MySQL developers so much that they leave the company and fork MariaDB, they piss of Hudson developers leading to Jenkins fork, OpenOffice forked into Libre Office, etc. The best developers hate working with Oracle. The same was once true of Microsoft; at least it applied to many Microsoft products.

I think that means something. It's not a simple equation, but if I were betting on companies that will stand the test of time, I'd bet on the ones that have deep company loyalty (both inside and outside) and have passionate people who want to be involved in what the company is doing.

Eh. Oracle has a huge amount of engineering talent in certain areas (i.e. the database and SPARC). It would be pretty fun to work on the database I imagine. I would personally never be able to bring myself to work there, but maybe working on a decent team + good money could still attract talent.

The props in this case also go to the management, all the way to the top. As someone doing F/OSS at Microsoft, it has become immensely easier to do in the past couple of years - and this is largely due to a concerted push from the top to make it a part of the company culture, and get all players (from devs to lawyers) to understand that it's a good thing to be embraced, not something to be avoided.

When I joined back in 2009, I certainly didn't expect to end up shipping newly written code under GPL, of all things. And yet, here we are.

Can you talk a bit more about why it is expensive?

Relicensing oss is difficult because you might need consent from all contributors, but I imagine that is easy for in-house code.

You have to convince n-layers of management, who often don't even know what open-source software is and think that "if we give it away for free then our competitors can also use it."

You have to pass legal review, which can take months, possibly rewrite parts of the code that cannot be opened.

Fundamentally, big corps are inertia accumulators. Noone wants to change the status quo, and as a low-rank engineer you have to fight every step of your way.

but it is really nice to see a much more open MS

...which at the same time are collecting huge amounts of data ("telemetry") on and locking down their OS against users, as well as blatantly advertising to them within that OS. The openness is just a facade to entice people away from seeing that other side. IMHO they're basically saying "we're open-sourcing our IP because it's not worth much anymore --- monetising our users is worth much more, and they might trust us more if they think we're friendly and open."

Google and Facebook are other examples of companies doing a similar thing --- they contribute to and maintain lots of open-source projects, but that's not where their profit comes from.

From that perspective, I'd rather have the old MS back. Windows was sufficiently open to develop applications for (I've been programming in Win32 since the Win95 days), a little RE ala Russinovich went a long way towards "opening" the darker parts, and Microsoft wasn't hell-bent on tracking users and turning their PCs into advertising platform that MS controls.

Note that SQM telemetry is separate from any ad tracking. I think part of the problem is declining PC sales. I recommend that you read this: https://hal2020.com/2013/03/07/what-if-microsoft-had-done-wi...

> The openness is just a facade to entice people away from seeing that other side.

Excuse my language but I don't know a better or more direct way to say this but horseshit. You have no idea that's true. That's a pretty slanderous claim. I _hated_ the old Microsoft but I'd never let that hate distort my judgement the way it obviously has distorted yours.

> "we're open-sourcing our IP because it's not worth much anymore ---

Equally horseshit.

> Google and Facebook are other examples of companies doing a similar thing ---

Again, horseshit. My feeling is that devs have seen the success of Linux and come to the correct conclusion which is that open-source is pragmatically a better engineering practise than not.

> From that perspective, I'd rather have the old MS bac

Are you out of your mind? I can link to comments of people quipping about flying porcine objects and chilly days in hades when Microsoft started open-sourcing .Net. The new Microsoft was literally unimaginable even six years ago. I think it's incredible and Microsoft is to be encouraged. Guess what, they're not a monolithic malignant entity. They can be giving with one hand while taking with the other without there being a causal relationship.

You failed to address OPs arguments, dismissing them as 'horseshit' instead. The following statements are faact, not slander: Microsoft has made it well nigh impossible to disable telemetry in Windows 10. Microsoft has also resorted to pretty underhanded ways to trick people into upgrading to windows 10 (since when did dismissing a window mean the same as clicking on "OK"?)

Commoditizing your complement is not a new concept - open sourcing your complement is just a recent twist. Without passing judgement, I can safely say Google will not open source its search algorithms in the foreseeable future.

I used to work at Microsoft, so take this with a grain of salt, but the company really runs (or at least ran) like a bunch of smaller companies than it did like one giant corporation. There were people in leadership in some verticals that really detested the way other verticals ran. E.g. none of us in the web side of things would touch an architect that came from the Office team.

So it may be possible that the teams releasing OSS have relatively good motives while the people running Windows have relatively misguided ones. Different verticals have different-- possibly conflicting-- aims.

Personally, I think we can encourage the right behaviors and discourage the wrong ones. Use their OSS stuff, don't use their closed source/adware stuff. I don't think I'll be using Windows again (unless something drastic changes), but I do use VSCode, and I'd love to use Visual Studio again, if it ever arrives on Mac/Linux.

MS doesn't have such strong verticals anymore. The end of the consent decree, the "One Microsoft" initiative, and the massive reorg from a couple years ago all went a long way towards breaking down barriers internally.

Windows releases OSS projects as well, it's not only the dev div team that values open development.

> ...which at the same time are collecting huge amounts of data ("telemetry") on and locking down their OS against users

They've only begun catching up with Google and Apple in this regard, though.

What's your point? Does that make it okay or something?

I thought we could leave the "hurr durr, evil M$" stuff behind, considering that today, Microsoft is technically so far behind Google and Apple that it does not even come close to matching them in invasiveness.

<Insert obligatory Microsoft has changed comment?>

Except they haven't changed that much. Windows is now malware and they are bullying Android and Linux device makers with their patents, so they aren't really that different from the Microsoft that funded the SCO lawsuit.

Microsoft is a very large organisation, and many parts behave differently.

Did you know the president of the Apache Software Foundation is also an employee at Microsoft?

The README says the code is published without any build scripts "for reference only", so I expected this to be another "shared source" thing.

It turns out that the code is offered under the (very permissive) MIT license. Cool.

This is great to have as a reference - the GLSL parser looks like a very thorough implementation. Thanks!

We've recently produced a WebGL implementation on top of V8 (passing calls through to OpenGL ES) - we needed it for a specific use case where a bundling a complete browser wouldn't do. We're interested in open sourcing if it's helpful to others - I'm curious to know if anyone else has a use case for an embeddable WebGL implementation? (Ours was to run three.js on the GearVR)

What's more frustrating is that edge had been shipping for a while now with a broken implementation of WebGL.

The conformance tests have been available for years and yet they haven't bothered to pass them


This makes devs have write nasty workarounds if they want WebGL apps to work on Edge

Reminds me of their approach to javascript.

By the way, this is not the whole WebGL implementation, just the shader transpiler (GLSL to HLSL). Though it's good to see that their GLSL parser isn't totally insane. Somebody really ought to check it for compliance though; we really don't want to have yet another nonstandard shader compiler.

Hmmm, interesting choice to opensource just the WebGL engine without the rest of the browser's layout engine.

This is the second big browser component they've freed, after Chakra. I wonder if other Edge components are in the pipeline but waiting on technical and legal checklists to be completed.

JavaScript engines tend to be relatively standalone, and developed relatively separately. V8 and Chakra are both developed pretty separately to Chromium and Edge.

Embrace, extend, extinguish. I'm constantly surprised at how quickly people forget the lessons of the 90s...

Dude, it's 2016 - that was twenty years ago.

Microsoft still acts unethically today. NT still has backdoors, almost their entire stack is proprietary. Just because they have made some parts of what they do free software doesn't turn them into the technological equivalent of Jesus. Yes, I am happy that they are freeing some of the stuff they do, but it's clear that they're doing it as a marketing move not because they care about user freedom. So I don't see them ever making the whole stack free software.

They're not Jesus, but they are not Satan either. I've seen EEE called on every single good gesture Satya's Microsoft did, and it's getting old. Is Microsoft the savior of OSS? No. Is the company doing something nice by open sourcing components? Yes.

> NT still has backdoors

For someone speaking of ethics you really can't just leave this here without any support...

They seem exaggerated for "back doors", because it's possible to avoid them. Yes some defaults might be malicious but the bar for calling something a backdoor is higher than just malicious.

Have you seen the backdoors on Mac OS X, customized Android versions and every other commercial OSes out there?

> backdoors on Mac OS X

That's proprietary too, so sure. But why are you mentioning Apple in a thread about Windows? I never said Apple was good either...

> customized Android versions

Android is mostly proprietary as well. Replicant is as close as you can get to a free fork of Android.

> every other commercial OSes


Because many HNers like to bash Microsoft, while at the same time give a white pass the SV beloved companies, which happen to have similar practices.

Which backdoors on [current] Mac OS X versions are you referring to?

The ones that no one knows that exist or not, Microsoft isn't the only company selling closed source OSes.

Darwin doesn't count, because it isn't the full stack, nor can we be 100% sure that even that part of the code is shipped like that.

Done a lot of code-review of Linux lately?

If you bother to read the whole thread, my point is why HNers single out Microsoft, when the same cannot be proven for other companies as well.

Seriously old memes. At least we don't still have to deal with the cringe worthy "M$".

I still see it here and there, and it's great sign about author's bias. usually saves me from reading the rest of the comment.

if $ was a legal domain character slashdot would change to M$.org

Some things never change, it's in Microsoft's DNA. They are just luring people back in with their open source initiatives because they saw that their stack was becoming obsolete.

As soon as they're back on the horse, we'll see the same behavior we used to see from them. That's my opinion of course. Fool me once...

Unless they initiate extend step, it is just a Fool's cry. EEE works for open standards, I do not see them trying to fork WebGL/HTML.

Dude, I heard the One Floppy is buried in the oak forests behind the Celtic Bayou and can be used to resurrect the Old Ones, who shall bring about a new era of M$$$$$$$....

How does that apply to this, exactly?

This is a GLSL (open standard) to HLSL (microsoft standard) transpiler, open-sourced on the premise to make it "as reference for engineers who are creating web browsers and related applications".

One could see it as a move to make HLSL incorporated in to other web-browsers.

I don't necessarily agree with that, and I do think that MS today is very different from the MS of yore, but I can see how some people might be concerned.

As far as I'm aware, every browser on Windows already converts GLSL to HLSL. Angle does this for Chrome, Firefox, and others.

Does eee still work when you release your software under a free license?

Well I was late to respond to this party, as is obvious, but yes, it still applies. As a matter of fact, even more so.

We all understand ms is a proprietary software producing company, and many in the tech community have been veering away from them in increasing numbers. They have sought to regain this leaking market share by doing some open source initiatives, with the intended purpose of getting people locked in in other areas! This is exactly what we mean in the modern context when we say eee. Embrace (the pro open source community), extend (the oss into other platforms, pulling devs back into the proprietary platform), and extinguish (pull back the open source to reveal the proprietary base it's founded on).

Half the problem is people see open source and think it's automatically good. What we need is FOSS (free open source software) and people need to learn the difference and why the F in front of FOSS is so important.

HN is in the pockets of Microsoft. They could eat children and any post mentioning it would still be downvoted.

> HN is in the pockets of Microsoft.

Please don't post drive-by smears to Hacker News, including of HN itself.

If you or anyone has a genuine concern about this, I addressed a similar comment in great detail a few days ago: https://news.ycombinator.com/item?id=11844253.

I wonder when the entire browser is gonna get open-sourced.

Microsoft seems like a different company now.

Off topic, but I am a happy customer of Office 365. I use the web versions of Word and Excel on my Linux laptops when people send me Office files. Works fine. The one terabyte of cloud storage for each family member is nice also.

Hmm this is very interesting... I was looking for exactly this so I could try to hook up WebGL calls from canvas into HoloLens' 3D environment. Three.js holograms :)

call me impressed when i can launch a mirrored copy of my windows ssd from an usb stick without fuss. this is just peanuts.

Microsoft is amazing. Top notch work across the board. Not all of their initiatives are aligned with hacker ideology but they are hands down developer friendly. Ballmer always made that important to know. I personally have the utmost faith in them. Their development tools are unequaled.

Man, I worked there (so it's in my best interest for them to have a good reputation) and I don't find this remotely true.

The developer tools are nice, but I'd hardly say Microsoft's other work is "top notch across the board". I've had major problems with Windows, Xbox, Azure, and more...

You got to see how the sausage is made, so to speak. I'm still a fan of the end products that I've dealt with. They have a ton of products.

That must be a PR comment. I have never heard such overwhelmingly positive words about MS.

> they are hands down developer friendly

> Their development tools are unequaled

Have you ever done any cross-platform C++ programming? That might change your opinion a bit.

Because Visual Studio isn't on every platform yet? The answer to your question is yes, btw. I spend most of my time in Ubuntu and I've also been forced to get my own projects to compile on my MacBook. It sucks, if that's what you were getting at. At least make a point.

It's taken Visual Studio quite some time to get up to feature parity for things like C++11/14/17. A year or two ago was a super frustrating time to be writing modern C++ that supported Windows. Oh, I can't use that feature here. Oh, this networking API call is slightly different from every other platform. Oh, this same function exists but the Windows team changed the name to be camel case instead of using underscores.

And if you're working on a cross-platform project, it's probably using CMake or something similar. The development cycle of `cmake .. && make` is simple and easy. As far as I could tell, Windows builds were not as straightforward. It's been awhile so maybe they've improved it, but I would hardly call their developer tools "unequaled"

I just want to install Clang in a straightforward manner, call the above-mentioned `cmake .. && make`, and have an exe waiting for me. Is that possible now? It wasn't in the past which is why I'm highly suspicious of your "hands down developer friendly" comment. Windows always seems to be the platform that has to do things slightly different, and has offered the most friction when developing projects that run on OS X, Linux, and Windows.

EDIT: I would also like to add that most CI services offer at least G++ or Clang++. AppVeyor seems to support Windows builds with MSVC but isn't free. This is yet another hindrance to smooth cross-platform development.

I laugh when you bring up compatibility issues because man have I grappled with them, too. You won't hear me say they're on the bleeding edge of c++ standards. It's their IDE that compels me to speak on their behalf. I do get what you're driving at, though.

That's fair. I first used Visual Studio with C# and loved the debugger and code refactoring tools. And I use it occasionally when logging statements just aren't enough in C++.

So in that regard, yes their IDE is one of the best, but their platform sort of diminishes the developer-friendliness of the whole experience when developing on Windows.

I need to check out CLion again, haven't tried it since they released one of the first versions.

Visual Studio is the commercial compiler with the best support for things like C++11/14/17.

Have you ever used other ones? Some of them on the embedded space don't even support C++11!

Ever you ever tried cmake besides BSD, GNU/Linux, Windows?

There are lots of other platforms out there, have you evaluated the experience on those platforms against Windows?

Is it now? Then I need to try it again. Some of my claims are probably outdated at this point if VS has improved a lot. 1-2 years ago their C++11 support was behind G++ and Clang.

I'm speaking mostly from a gamedev perspective, I don't write embedded C++. Same story with CMake, only used it on platforms where someone would/could play a game.

Does Windows offer a superior development platform when doing embedded work compared to BSD/Linux/OS X?

I prefer to work in a general text editor alongside simple command line build tools, which probably explains my dislike of most Windows dev tools.

> VS has improved a lot. 1-2 years ago their C++11 support was behind G++ and Clang.

Except there are quite a few commercial compilers to choose from, not only those three.

> I'm speaking mostly from a gamedev perspective, I don't write embedded C++. Same story with CMake, only used it on platforms where someone would/could play a game.

Sony and Nintendo SDKs are Windows based.

> Does Windows offer a superior development platform when doing embedded work compared to BSD/Linux/OS X?

The majority of the embedded vendors SDKs are Windows based and they have their own compilers. Not everyone is doing gcc and clang forks.

VS/MSVC has improved a lot. There are details here: https://blogs.msdn.microsoft.com/vcblog/2016/06/07/compiler-... but the long and short of it is that we are working on achieving complete C++98/11/14 compliance by (hopefully) the end of this year. And we have a number of C++ draft standard features implemented already, in both the compiler and the libraries.

Additionally, we're shipping a number of versions of Clang in VS (targeting Windows, targeting Linux/IOT, targeting Android/iOS) and contributing to the community. We're looking seriously into CMake support and contributing back to the community. And the VS Code editor runs on Unix-based OS with IntelliSense, debugging, etc.

So yes, VS has improved a lot, but we still have work to do.

I'd love to chat with you if you have questions. My email is firstname.lastname@microsoft.com. My full name is on the blog that I linked to but I'm really not that hard to find online.

And I've got questions for you if you use Clang and have any interest in Windows. Send me mail and we can maybe set up time for a phone/Skype call.

You guys are doing awesome work on Visual C++, I keep playing around with it, although nowadays I spend my time between .NET and JVM stacks.

However, C++ is one of my favourite languages (minus C parts), that I still reach for private projects and when I need to step out of .NET and JVM.

Not sure if I am the one you want to talk to, as I do find Visual C++ has actually one of the best supports for C++98/11/14 among commercial C++ compilers.

I do spend most of my developer time on Windows actually.

RE `cmake .. && make`:

cmake .. && cmake --build . --config RelWithDebInfo works for me.

Thank you, I'll give that a try next time. Wasn't aware cmake could handle running the build system like that.

Also, install a copy of Ninja and try

cmake -G Ninja

It'll speed up your build by a lot in most cases.

I haven't done much real work on Windows in like 10 years (before which it was most of what I did) and I'd still kill for an IDE for C++ half as usable as even VS6 was on Linux.

Particularly when it comes to integrated debugging, what we have on other platforms pales in comparison imo.


I use it. It's not even close, even if it is the best yet.

I did, back in the day C compilers were still trying to catch up with C89 and C++98 ink was still in flow.

It is all wonders when your view of cross-platform C++ programming means only using only gcc or clang across BSD, GNU/Linux or Mac OS X.

However things aren't so rosy when cross-platform C++ programming means the official OS C and C++ SDK, with their own view of what POSIX APIs they are supposed to offer specially the ones that leave the implementations some freedom about undefined behaviors.

If they offer POSIX APIs at all.

We detached this subthread from https://news.ycombinator.com/item?id=11867379 and marked it off-topic.

The title is misleading, as the first words on github are: "This repo contains a select number of files". The title should say "Dump of some of the files". Considering the state of popularity if the Edge, maybe even "reference on what not to do"

That's a bit negative; it's the source for the WebGL implementation; rather than wait X amount of time till they can do the 'proper' release; the source is available to read, how can you be mad at that?

This is something Microsoft would never have done in the past, and I think we should applaud the efforts that are being made.

Lastly; they are doing this to improve interoperability; give them some credit for the effort.

never underestimate nerd hate towards microsoft. they could open source everything they have and give every person a free sex robot and people would still find something to be pissed at them about

just think about the fact that this sexrobot would show advertisements at climax, clench it's teeth when updating (at the worst possible time...) and generally chitchat about all of your kinks with the microsoft cloud.

worst sex partner of all times.

lol, look at those enterprise type comments -

  //  Function:   GetDefaultInitValue
  //  Synopsis:   Returns a string that contains the default HLSL value for
  //              the component of this type. Should not be called on sampler
  //              or void types, as there are no values to init with.

Actually this comment contains useful information such as validity domain (should not be called on samplers or void types) and justification for this domain (there are not values to init with).

Much better than the crap comments I see on a lot of projects such as "# does this even work ? lol"

better enterprise comments than no comments

Other than the superfluous "a string that contains", it's actually a pretty informative comment.

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