Live data from Hacker News

Microsoft introduces Universal Windows apps

wmpoweruser.com

91–100 of 187 posts

Re: Microsoft introduces Universal Windows apps

#91

Earlier quoted context omitted.

int main(){ puts("Hello World"); } > This doesn't work in Windows. Sure it does. Windows has console programs. Though I'd argue that your use of non-standard main is not something I'd do, but IIRC even that works on Windows, at least it did with older compilers, haven't done much windows C programming with the newer ones.

What you point out is an _abstraction_ that compilers include as part of their kits. You claim to be a low-level programmer who understands C. The truth is right in front of you. Decompile those programs, look at their symbol tables. Notice, every Win32 program starts at WinMain, called with the arguments that I listed above. Come back when you've done this simple exercise. Realize, WinMain is the _true_ starting poi…

The true starting point for PE executables is AddressOfEntryPoint in the PE header, with a few parameters pushed on the stack. WinMain is a compiler abstraction; it is not looked up by name.

You can't code in a high-level language like C without working with abstractions. Whether you look at the main() level or the WinMain() level, there will still be library initialization hooks running before your end-user code gets to run.

Re: Microsoft introduces Universal Windows apps

#92

Earlier quoted context omitted.

int main(){ puts("Hello World"); } > This doesn't work in Windows. Sure it does. Windows has console programs. Though I'd argue that your use of non-standard main is not something I'd do, but IIRC even that works on Windows, at least it did with older compilers, haven't done much windows C programming with the newer ones.

What you point out is an _abstraction_ that compilers include as part of their kits. You claim to be a low-level programmer who understands C. The truth is right in front of you. Decompile those programs, look at their symbol tables. Notice, every Win32 program starts at WinMain, called with the arguments that I listed above. Come back when you've done this simple exercise. Realize, WinMain is the _true_ starting poi…

Show me where in the ANSI standard it says this is illegal. Implementation details do not matter. The Microsoft C compiler will compile a ANSI C89-conforming program into a runnable executable on Windows. The rest is undefined.

And while we're on implementation details, please note that most UNIX platforms do not start at main either. Most platforms include some soft of crt0 that must be linked which contains the real entry point. The dynamic linker will also run code prior to main.

But the C standard only defines what the environment looks like when execution begins and makes no statement on what might run before or how the program got into memory in the first place.

Re: Microsoft introduces Universal Windows apps

#93
post #47

I'm still trying to figure out how/why this makes sense as a goal. Building an application that runs across multiple platforms in congruent spaces makes sense: iOS and Android and Windows Phone. When you move to running the same application across Laptop vs. Phone style platforms, even on modern hardware, you're looking at capabilities and resources that are radically different. I can see wanting to share certain com…

You could say the same for a 4.3 inch phone vs. a 10 inch 2.5k, and, soon, 12 inch 4k Android tablet. And if you want radically different capabilities, phones have SIMs that are assumed to be single-owner while most Android tablets are multi-user. Processors range from 800Mhz single-processor with mediocre bus performance, to quad-core 2.3 Ghz. There really isn't any interactive software you wouldn't run on a mobile…

What about things like Keyboard and Mouse vs. Touch? Network Quality (Persistent highspeed connection vs. intermittent limited quality)? Available storage space (You can consider most desktop machines (1/4 terrabyte or better) unlimited in comparison to mobile devices? Multiple Large displays (not on all I know) vs. single small display? There's alot more there than numeric computation abilities alone to take into consideration.

Re: Microsoft introduces Universal Windows apps

#94
post #72

They really need to go both ways with their cross platform offerings. I can use their technology to develop apps for other platforms, but I cannot use their technology to run those apps. That requires having the other platform. It would be nice if I could not only develop cross platform apps for iOS, Android, and Windows Phone, but I could also run them on their Windows Phone platform. I would buy a windows phone if…

Why would they want to help you provide content for Android?

Because I would do it using their tools, so it would also be content for Windows Phone.

Given the current state, why would I bother making content for windows phone? Why use C# if it's a second class citizen on the majority platforms? Why even learn it if the only thing it's good for anymore is Web API?

Windows could be the universal platform but instead they are still functioning like it's something they could monopolize. Those days are over.

Re: Microsoft introduces Universal Windows apps

#95
Some people here have mentioned this already but I am quite surprised with all the happiness and it's nice but... I have been writing apps on my Mac targetting asp.net, ios, android, wp8 and win8 with a lot of reuse and perfect frontends for two years. I love f#/c# and it works like a charm. Business wise it is nice that you have to pay only once but outside that what in god's name is so nice or special about this? I was hoping this would include a build system on Azure and a unified system using Xamarin all from VS. This is nothing at all. Wow I can target those 3 wp8 users from my win8 codebase app. Pfff. So it's just fanboys or almost nothing changes or I am missing some significant thing even though I am quite deep in this ecosystems for years now?

Re: Microsoft introduces Universal Windows apps

#96
post #91

Earlier quoted context omitted.

What you point out is an _abstraction_ that compilers include as part of their kits. You claim to be a low-level programmer who understands C. The truth is right in front of you. Decompile those programs, look at their symbol tables. Notice, every Win32 program starts at WinMain, called with the arguments that I listed above. Come back when you've done this simple exercise. Realize, WinMain is the _true_ starting poi…

The true starting point for PE executables is AddressOfEntryPoint in the PE header, with a few parameters pushed on the stack. WinMain is a compiler abstraction; it is not looked up by name. You can't code in a high-level language like C without working with abstractions. Whether you look at the main() level or the WinMain() level, there will still be library initialization hooks running before your end-user code get…

I'm gonna upvote your comment as you are one of the few people in YCombinator who seems to know what they're talking about. Good job catching that, and you're right. The PE Header contains the entry point. (And the MZ Header is potentially a 2nd entry point left in for DOS Compatibility purposes)

The rest of the people here talking as if C is some sort of ultra-portable magic language need to learn about the low level details that differ between OSes.

My primary point remains however, the easiest and most straightforward way to interface with Windows libraries is through C++ and C#. Even C itself is a high-level language built on top of abstractions built by compilers and linkers.

Re: Microsoft introduces Universal Windows apps

#97
post #61

Earlier quoted context omitted.

C# is a much higher-level language than C, with a much richer set of libraries that can be relied upon to be everywhere. That's why it matters.

C# is ..., with a much richer set of libraries... Citation please. AFAIK, there are significantly more C libraries than C# libraries.

Maybe OP means the C# standard library is richer... I'd believe that.

Re: Microsoft introduces Universal Windows apps

#98

Earlier quoted context omitted.

int main(){ puts("Hello World"); } > This doesn't work in Windows. Sure it does. Windows has console programs. Though I'd argue that your use of non-standard main is not something I'd do, but IIRC even that works on Windows, at least it did with older compilers, haven't done much windows C programming with the newer ones.

What you point out is an _abstraction_ that compilers include as part of their kits. You claim to be a low-level programmer who understands C. The truth is right in front of you. Decompile those programs, look at their symbol tables. Notice, every Win32 program starts at WinMain, called with the arguments that I listed above. Come back when you've done this simple exercise. Realize, WinMain is the _true_ starting poi…

> Realize, WinMain is the _true_ starting point of "C Programs" in Windows

Actually I do know that, but you simply said "int main() blah blah blah" doesn't "work" (to quote you there). If you're going to require me to be precise, maybe you should look in the mirror first.

Re: Microsoft introduces Universal Windows apps

#99

Earlier quoted context omitted.

int main(){ puts("Hello World"); } > This doesn't work in Windows. Sure it does. Windows has console programs. Though I'd argue that your use of non-standard main is not something I'd do, but IIRC even that works on Windows, at least it did with older compilers, haven't done much windows C programming with the newer ones.

What you point out is an _abstraction_ that compilers include as part of their kits. You claim to be a low-level programmer who understands C. The truth is right in front of you. Decompile those programs, look at their symbol tables. Notice, every Win32 program starts at WinMain, called with the arguments that I listed above. Come back when you've done this simple exercise. Realize, WinMain is the _true_ starting poi…

Asm output from a c program that prints hello world to the screen. You can figure out the other sections I'm sure.

No win main or other similar concepts here and built using vs2012.

Microsoft (R) COFF/PE Dumper Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved.

Dump of file consoleapplication6.exe

File Type: EXECUTABLE IMAGE

_main: 00401000: 68 48 20 40 00 push offset ??_C@_0M@KIBDPGDE@Hello?5world?$AA@ 00401005: FF 15 00 20 40 00 call dword ptr [__imp__puts] 0040100B: 83 C4 04 add esp,4 0040100E: 33 C0 xor eax,eax 00401010: C3 ret

  Summary

        1000 .rdata
        1000 .reloc
        1000 .rsrc
        1000 .text

Re: Microsoft introduces Universal Windows apps

#100

I think the most significant part of this announcement is how they are dogfooding, Office for 'metro' and for the windows phone are using this Universal targeting.

They've been dogfooding for decades, that's a very core part of the developer culture at MS. (You can say many bad things about them, but they really do dogfooding all the time.)
Post reply on HN