Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Chasiubao
Apr 2, 2010


Dred_furst posted:

One can hope for WPF, forget it for winforms. what's the point?
secondly, if someone provides clr bindings for their UI library, as long as the app is developed with it then sure why not.

Would people event want WPF skinned apps on Linux / OSX?

Adbot
ADBOT LOVES YOU

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy
All I really want is cross platform MVVM + XAML that's not Silverlight.

some kinda jackal
Feb 25, 2003

 
 

Bognar posted:

I wouldn't expect any .NET UI libraries from Microsoft to make their way to other platforms anytime soon.

Dang. I really wanted to develop for OSX but use C# without paying Xamarin any money.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Martytoof posted:

Dang. I really wanted to develop for OSX but use C# without paying Xamarin any money.

Xamarin.Mac is free, but unsupported. Our mobile stuff requires a subscription.

some kinda jackal
Feb 25, 2003

 
 

Drastic Actions posted:

Xamarin.Mac is free, but unsupported. Our mobile stuff requires a subscription.

Huh. I haven't checked it out in a month or two but for some reason I had a hard time finding what I needed to get this done on your site :(

I'll have to check again tomorrow, thanks!

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Martytoof posted:

Huh. I haven't checked it out in a month or two but for some reason I had a hard time finding what I needed to get this done on your site :(

I'll have to check again tomorrow, thanks!

Scratch that a little bit, it's MonoMac that's included in Xamarin Studio, and it is unsupported. But it is free. Mixed up my terms there :).

Just download Xamarin Studio on OSX and you should see it in the projects list.

some kinda jackal
Feb 25, 2003

 
 
Oh okay so Xamarin.Mac is still a paid product then, right? That's fair :)

I think this is what was confusing me.

ljw1004
Jan 18, 2005

rum

Bognar posted:

Are there VMs of this [VS2015 Preview] on Azure?

Apparently yes but I haven't tried it myself:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/06/04/visual-studio-14-ctp-now-available-in-the-virtual-machine-azure-gallery.aspx

Gul Banana
Nov 28, 2003

Chasiubao posted:

Would people event want WPF skinned apps on Linux / OSX?

I'd settle for a gui api that was cross-platform between windows 7 and windows 8 :)

Gul Banana
Nov 28, 2003

ljw1004 posted:

For VB/C#, here are complete lists of all new language features in C#6 and VB14.

Here in the VB/C#/.NET teams we're pretty excited! We'll writing more on the .NET blog, C# blog and VB blog, once we have time to write it in the coming weeks :)
very nice! nothing quite as exciting as record classes, but I'll be making immediate use of half this stuff. how on earth did you solve the memcpy problem to allow for parameterless value type constructors?

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost
Null propagation yesssssssss one more battle won in the war against null.

mortarr
Apr 28, 2005

frozen meat at high speed

Dr Monkeysee posted:

Null propagation yesssssssss one more battle won in the war against null.

True that. The nameof operator and string interpolation look pretty neat too.

Inverness
Feb 4, 2009

Fully configurable personal assistant.
Wouldn't WPF be easier and better to port than WinForms simply because it has its own rendering scheme with DirectX and isn't a native GUI wrapper? It's sort of like GTK in that respect, except not ugly.

The only reason I still use WinForms nowadays is because Mono supports it but not WPF. One project I've been working on lately is a JSON editor that generates a GUI from a JSON schema and is extensible with custom value editors for things like colors, images, or file selectors. I'd really love to do this in WPF but I'm not going to give up on it being cross platform.

Also, one thing I've been wanting to know is what exactly is .NET Core and how it relates to the existing framework and CLR. The .NET world already seems like it has too many different platforms and distributions with differences in libraries and functionality.

the littlest prince
Sep 23, 2006


This may not necessarily be a .Net question, but I'm working in C# so it's going here for now.

I got bored and decided to make a contest entry bot for slickdeals. It's working fine except the session isn't being persisted across calls, despite doing what's described here.

Full code here: http://pastebin.com/P9Rki02H

What stupid thing am I doing/not doing?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



fleshweasel posted:

I believe that's made possible by the LINQ to SQL library straight from Microsoft. Your code is being turned into a SQL script.

TSQL won't parse dates in the format month.day.year as far as I can tell and its regular expression support is both extremely limited and nonstandard, so I don't think it's possible that it's translated into pure SQL.

Don't much care though. It could be juicing an orphan every time I hit F5 and it's still be better than string manipulation in TSQL.

twodot
Aug 7, 2005

You are objectively correct that this person is dumb and has said dumb things

Inverness posted:

Also, one thing I've been wanting to know is what exactly is .NET Core and how it relates to the existing framework and CLR. The .NET world already seems like it has too many different platforms and distributions with differences in libraries and functionality.
.NET Core is CoreCLR, the build of CLR that runs on phone and the K runtime (edit: and Silverlight).

twodot fucked around with this message at 18:30 on Nov 13, 2014

ljw1004
Jan 18, 2005

rum

Gul Banana posted:

very nice! nothing quite as exciting as record classes, but I'll be making immediate use of half this stuff. how on earth did you solve the memcpy problem to allow for parameterless value type constructors?

Could you say precisely what you mean by "the memcpy problem" ?

At the IL level, IL is able to construct things by a call to initobj (gives back a zeroed-out block of memory), or an explicit call to the constructor, or a call to Activator.CreateInstance<T> which does the right thing and is needed for this kind of place:
code:
T f<T>() where T:new() {return new T();}
Function f(Of T As New)() As T : Return New T : End Function
So we just relaxed the restriction on the declaration side, and ensured that code only ever calls initobj in places where it knows for sure that it's a struct with no parameterless constructor. (Note that struct constructors are required, as always, to initialize all fields).

If you have an instance of a struct and assign it to another one, then yes it's just a straight memcpy, not expected to go via additional constructor calls.

When you declare an array of structs, that's expected to be the same as default(T), i.e. to bypass the constructor.

raminasi
Jan 25, 2005

a last drink with no ice
Here is a super obscure question: Can I use thread-local storage via __declspec in a static C library that's linked into a C++/CLI mixed-mode assembly? Implicit TLS didn't use to work in DLLs not present at process start, but I don't know if that restriction's still around, or how it related to C++/CLI.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Gul Banana posted:

very nice! nothing quite as exciting as record classes, but I'll be making immediate use of half this stuff. how on earth did you solve the memcpy problem to allow for parameterless value type constructors?

Is it sad that I'm excited for multi-line string literals in VB? Man maybe it's time to switch over.

ljw1004
Jan 18, 2005

rum

Scaramouche posted:

Is it sad that I'm excited for multi-line string literals in VB? Man maybe it's time to switch over.

It's okay to be excited :) I'm putting together an MSDN article about "top 14 features in VB 14" and lots of people asked me to mention them. Not sure which other things to mention. Refactorings. Analyzers. 50% faster compile times and solution-load-times. NameOf operator.

New in VB14: coding experience
  • Refactorings ("Quick Actions")[/b] including IntroduceLocal, Extractmethod, InlineTemporary, and a "diff" preview of the change
  • Inline Rename, both used directly, and also used by those refactorings
  • Faded redundant code
  • Organize imports
  • Colorized tooltips (for regions, outlining, quickinfo, parameter-help)
  • <see cref/> now has intellisense, colorization, tooltips …
  • When you add an override or implements clause, it will automatically add the necessary "Imports" statements rather than spitting out fully-qualified names.
  • No need to cursor off the line for error squiggles to show up

New in VB14: fundamentals
  • Analyzers+Refactorings (add through NuGet, VSIX; configure their ruleset)
  • Lightbulbs
  • Watch and immediate windows support lambdas + LINQ expressions
  • In Watch window when you expand a type it now has a subnode for private members (used to be hidden) and a subnode for shared members (used to be mixed up together)
  • Improvements to Edit and Continue
  • GoToDef shows metadata as source rather than in ObjectBrowser, and supports FindAllRefs and ViewCallHierarchy
  • References node now appears in SolutionExplorer
  • SharedProjects support added to VB; it works for all project types, not just Phone8.1 and Win8.1
  • 50% faster compile times, and faster solution-load time too
  • GoToDef, FindAllRefs, Rename all now work in cross-language solutions and in cross-target solutions (e.g. one project PCL, another project Desktop)
  • Error improvements: option to disable errors for closed files; 100 error limit is truly dead; BuildAll shows every single error; error-list shows the error code; errors no longer show fully-qualified typenames; error list now has hyperlinks
  • Tools>Options>TextEditor>VB>Advanced / CodeStyle have new options

New in VB14: language
  • The ?. operator inlines a check for null "a?.b"
  • Readonly autoprops "ReadOnly Property p As Integer = 15"
  • Multiline string literals
  • String interpolation $"hello {p.Name} you are {p.Height:0.00}m tall" (not yet in preview)
  • NameOf operator "NameOf(p)" (not yet in preview)
  • Comments after implicit line continuations
  • Smart name resolution
  • Structures allow Sub New()
  • Year-first date literals #2014/12/25#
  • ReadOnly interface props can be implemented by ReadWrite props
  • TypeOf <expr> IsNot <type>
  • "#Disable Warning BC4096" and "#Enable Warning BC4096"
  • Compiler now verifies xml doc-comments like cref and param
  • Partial Modules and Partial Interfaces now allowed
  • #Region now allowed to span method boundaries
  • Overrides implies Overloads
  • CObj is now allowed in attribute arguments
  • Can declare and consume ambiguous methods from unrelated interfaces

Gul Banana
Nov 28, 2003

ljw1004 posted:

Could you say precisely what you mean by "the memcpy problem" ?

as I understand it, the CLR will sometimes initialise or copy value types around bytewise no matter what a language compiler has to say about it - meaning that constructors cannot be guaranteed to run. normally with a reference type you're assured by the language semantics that it will be given its initial state by application defined code, but this same guarantee can't be made for value types.

I thought that was why you weren't allowed to write parameterless constructors for valueobject subtypes, and *were* allowed to assign Nothing or default(T) to them instead (which I assume uses initobj) - the parameteless constructor would have been a "trap" which looked like, but was not, the only way to init objects of the type.

quote:

So we just relaxed the restriction on the declaration side, and ensured that code only ever calls initobj in places where it knows for sure that it's a struct with no parameterless constructor. (Note that struct constructors are required, as always, to initialize all fields).

If you have an instance of a struct and assign it to another one, then yes it's just a straight memcpy, not expected to go via additional constructor calls.

When you declare an array of structs, that's expected to be the same as default(T), i.e. to bypass the constructor.

this sounds like a partial solution, where the language makes what restrictions it can - but fundamentally, there are still situations where your struct gets inited to 0 rather than its constructor being called, which is not the case with classes?

ljw1004
Jan 18, 2005

rum

Gul Banana posted:

this sounds like a partial solution, where the language makes what restrictions it can - but fundamentally, there are still situations where your struct gets inited to 0 rather than its constructor being called, which is not the case with classes?

We make the solid guarantee that whenever you write "new" then the ctor always gets called, no exception. (if you find an exception then that's a bug and please let us know!) If the compiler emits in IL a call to Activator.CreateInstance or to an actual constructor, then the CLR will never bypass the ctor even on a struct. So it really is under the control of the compiler.

(Yes there are still situations where the struct gets inited to 0 and the constructor is bypassed. The only such situation is when the compiler has emitted an INITOBJ instruction. So we guarantee never to emit INITOBJ in cases where the user wrote "new" and there is or might be a constructor.)

ljw1004 fucked around with this message at 06:37 on Nov 14, 2014

Gul Banana
Nov 28, 2003

is this interpretation correct?
code:
    Public Class StructFactory(Of T As Structure)
        Public Function CreateWithConstructor() As T
            Return New T ' call Activator::CreateInstance
        End Function

        Public Function CreateWithoutConstructor1() As T
            Dim ts(1) As T
            Return ts(0) ' initobj
        End Function

        Public Function CreateWithoutConstructor2() As T
            Return Nothing ' initobj
        End Function
    End Class
if so, will T As {Structure, New} now be allowed? that'd let us differentiate between the stronger- and weaker-construction-guaranteeing types.

Inverness
Feb 4, 2009

Fully configurable personal assistant.
The inclusion of parameterless constructors for structs is interesting. I liked that C# didn't let you write them before so you had to be prepared to deal with a struct that has been zero-initialized. I feel like there is going to be some people that are fooled into thinking a parameterless constructor is always called.

twodot posted:

.NET Core is CoreCLR, the build of CLR that runs on phone and the K runtime (edit: and Silverlight).
I'm not really familiar with the limitations of that compared to the normal CLR. Also, will the normal CLR continue to have a place in the world as a separate thing? Is .NET going to move to a model where you can build the CLR with the features you need?

I've looked through some of the reference source and the old CLR 2.0 code that is available and it seems married to things like COM and other platform-specific APIs.

Forgall
Oct 16, 2012

by Azathoth
Does anybody here have experience with Xamarin? How is it in terms of stability, performance and documentation? Is it actually a competitive technology?

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

Forgall posted:

Does anybody here have experience with Xamarin? How is it in terms of stability, performance and documentation? Is it actually a competitive technology?

I've been working with Xamarin + MvvmCross on a decent sized learning-based iPad application for the past 6 months or so. Ultimately, the tooling could be better, but the cross-compilation works exactly as expected.

Developing for iOS necessarily requires some kind of machine running OS X with Xcode. You can develop in Xamarin Studio on the a Mac, or you can set up a Mac with a build server and develop in Visual Studio with a plugin that manages remote compilation and remote debugging (what we did). This piece used to be really buggy and I'd have to reset it every day, sometimes more than that, but it has really improved in the last few months. Every now and then Apple will release an update to Xcode or Xamarin will release an update to the runtime and various things will break - though it's usually fixed within a day.

I haven't really seen any issues with performance. I'm not making 3D games or anything, but I am doing a lot of data manipulation through LINQ which theoretically will create a lot of garbage and cause GC pauses - but really I haven't seen any problems. AFAIK, Xamarin compiles directly to ARM for iOS with capability of calling to iOS APIs, and it compiles to IL for Android which is then JITted. Really, you should be getting as close to native performance as it gets.

The documentation is pretty good, though you can tell a great portion of it was written for iOS 6. I don't have much insight into the Android docs. So a lot of the documentation doesn't reflect the API updates from Apple, but also a lot of the basic stuff hasn't changed so you can still get a lot of useful information.

Overall I've been really happy with Xamarin and would recommend it to anyone looking to do cross platform in C#. Some people consider the price too high, but I would pay it 3 times over to write in C# instead of Objective-C. Now that Swift is out, maybe that's different, but potentially being able to cross compile to Android and reuse all of our business logic code should still be super useful.

Rooster Brooster
Mar 30, 2001

Maybe it doesn't really matter anymore.
So with all the announcements and updates, I'm a little fuzzy on one Xamarin item: can I now develop Android apps via Xamarin in Visual Studio without, you know, paying them money? Their licenses are pretty pricey for a hobby/indie developer.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Rooster Brooster posted:

So with all the announcements and updates, I'm a little fuzzy on one Xamarin item: can I now develop Android apps via Xamarin in Visual Studio without, you know, paying them money? Their licenses are pretty pricey for a hobby/indie developer.

Before the VS Community edition was released, you had to have VS Professional or up in order to use Xamarin, because it was an extension. Now you don't have to. And becaues the community edition is free, the Starter edition of Xamarin now works on VS. We also made changes to the starter edition so that you can have "bigger" apps, but realistically it's more so you can see how it works and get a feel for making something, rather than releasing a full blown app with it.

But yeah, basically, you still have to pay us. VS support only comes with the business license and up too :(.

Edit:

quote:

The documentation is pretty good, though you can tell a great portion of it was written for iOS 6. I don't have much insight into the Android docs. So a lot of the documentation doesn't reflect the API updates from Apple, but also a lot of the basic stuff hasn't changed so you can still get a lot of useful information.

There is an effort going on to update it, or at least provide newer samples as new releases come up.

Drastic Actions fucked around with this message at 16:53 on Nov 14, 2014

Forgall
Oct 16, 2012

by Azathoth

Bognar posted:

Developing for iOS necessarily requires some kind of machine running OS X with Xcode. You can develop in Xamarin Studio on the a Mac, or you can set up a Mac with a build server and develop in Visual Studio with a plugin that manages remote compilation and remote debugging (what we did). This piece used to be really buggy and I'd have to reset it every day, sometimes more than that, but it has really improved in the last few months. Every now and then Apple will release an update to Xcode or Xamarin will release an update to the runtime and various things will break - though it's usually fixed within a day.
My goal at the moment is to simply try it out and learn something. As far as I understand I can at least create a Xamarin.Forms project, build it for android or windows phone and see it in action. I guess I won't be able to use iOS-specific features without a Mac, but I'll have to live with that.

Drastic Actions posted:

And becaues the community edition is free, the Starter edition of Xamarin now works on VS.
[...]
VS support only comes with the business license and up too :(.
Those two statements seem to contradict each other.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Forgall posted:

My goal at the moment is to simply try it out and learn something. As far as I understand I can at least create a Xamarin.Forms project, build it for android or windows phone and see it in action. I guess I won't be able to use iOS-specific features without a Mac, but I'll have to live with that.

Those two statements seem to contradict each other.

Maybe he means "support" in the "we provide support if you have problems" sense.

twodot
Aug 7, 2005

You are objectively correct that this person is dumb and has said dumb things

Inverness posted:

I'm not really familiar with the limitations of that compared to the normal CLR. Also, will the normal CLR continue to have a place in the world as a separate thing?
Ordinary developers most likely wouldn't notice a difference between the two (edit: The framework is smaller, so they may notice missing APIs). Certain advanced features like gc modes, the security model, and appdomains are different. The difference has changed over time, so I wouldn't want to say anything definitive. The normal CLR (the thing you get on your desktop computer when you download .NET 4.5) is still its own thing and will continue to be supported and receive new features, the RyuJIT is an example.

quote:

Is .NET going to move to a model where you can build the CLR with the features you need?
Once we're open source, I suppose this would be in theory possible, but I doubt it would be actively supported.

twodot fucked around with this message at 19:37 on Nov 14, 2014

Inverness
Feb 4, 2009

Fully configurable personal assistant.

twodot posted:

Once we're open source, I suppose this would be in theory possible, but I doubt it would be actively supported.
What I'm really getting at here are the features that seem to be excluded from CoreCLR or .NET Core as its called now. When I look through the reference source I see flags for FEATURE_SERIALIZATION, FEATURE_REMOTING, FEATURE_CLICKONCE, and several others. I'm only familiar with your normal desktop development, so I'm wondering what determines which platforms/builds get what features and how that concerns .NET Core going forward.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Forgall posted:

Those two statements seem to contradict each other.

You can try out the VS extension with starter, but if you want to use it without those size restrictions, you have to pay, and when you do you have to use Business license or up.

twodot
Aug 7, 2005

You are objectively correct that this person is dumb and has said dumb things

Inverness posted:

What I'm really getting at here are the features that seem to be excluded from CoreCLR or .NET Core as its called now. When I look through the reference source I see flags for FEATURE_SERIALIZATION, FEATURE_REMOTING, FEATURE_CLICKONCE, and several others. I'm only familiar with your normal desktop development, so I'm wondering what determines which platforms/builds get what features and how that concerns .NET Core going forward.
I'm not certain I understand. There's an MSBuild file the looks to see whether we're building Desktop or CoreCLR and turns on various feature based on that (there's like ~100 of them). It's unclear to me whether any of that will be exposed, since it's not relevant. What gets turned on is subject to change, we've certainly grown CoreCLR capabilities in the past. Removing capabilities most likely won't happen as breaking changes are frowned on.

Forgall
Oct 16, 2012

by Azathoth

Drastic Actions posted:

You can try out the VS extension with starter, but if you want to use it without those size restrictions, you have to pay, and when you do you have to use Business license or up.
I suppose it's good enough for education purposes.

Inverness
Feb 4, 2009

Fully configurable personal assistant.

twodot posted:

I'm not certain I understand. There's an MSBuild file the looks to see whether we're building Desktop or CoreCLR and turns on various feature based on that (there's like ~100 of them). It's unclear to me whether any of that will be exposed, since it's not relevant. What gets turned on is subject to change, we've certainly grown CoreCLR capabilities in the past. Removing capabilities most likely won't happen as breaking changes are frowned on.
Let me try and explain better.

One of the benefits of .NET Core is that it has a lighter footprint due to modularity. You'll be able to choose which assemblies you want to deploy privately instead of relying on the full 200 MB or so framework.

My question was about how much this drive towards modular deployment would apply to the CLR itself since its designed to be able to chose what features it builds with and some of them are more platform-dependent than others. What if someone decides they want a feature level somewhere in between the Desktop and Core builds?

twodot
Aug 7, 2005

You are objectively correct that this person is dumb and has said dumb things

Inverness posted:

My question was about how much this drive towards modular deployment would apply to the CLR itself since its designed to be able to chose what features it builds with and some of them are more platform-dependent than others. What if someone decides they want a feature level somewhere in between the Desktop and Core builds?
This depends on how the open source stuff ends up working which to my knowledge hasn't been announced or even decided firmly. It's plausible that we give out the full source and disable the Desktop build, or just say that we don't want changes outside of Core, in that scenario it would be entirely possible to build something in between, with the warning that extra effort might be required to make such a configuration work. It's also plausible that the source is scrubbed and the source for Desktop only features doesn't even make it to the repository, then you'd be stuck building the feature yourself. Based on the messaging I suspect scrubbing is likely, but I don't actually know. In either scenario, it wouldn't be officially supported.

twodot fucked around with this message at 21:37 on Nov 14, 2014

Inverness
Feb 4, 2009

Fully configurable personal assistant.

twodot posted:

This depends on how the open source stuff ends up working which to my knowledge hasn't been announced or even decided firmly. It's plausible that we give out the full source and disable the Desktop build, or just say that we don't want changes outside of Core, in that scenario it would be entirely possible to build something in between, with the warning that extra effort might be required to make such a configuration work. It's also plausible that the source is scrubbed and the source for Desktop only features doesn't even make it to the repository, then you'd be stuck building the feature yourself. Based on the messaging I suspect scrubbing is likely, but I don't actually know. In either scenario, it wouldn't be officially supported.
Do you know why Microsoft isn't open-sourcing everything for Desktop too?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Inverness posted:

Do you know why Microsoft isn't open-sourcing everything for Desktop too?

If you mean Forms, I think that'd entail all of Windows from some of the stuff hackbunny has been saying in his YOSPOS thread.

Adbot
ADBOT LOVES YOU

Mr Shiny Pants
Nov 12, 2012

Munkeymon posted:

If you mean Forms, I think that'd entail all of Windows from some of the stuff hackbunny has been saying in his YOSPOS thread.

People would be better of just installing Windows :)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply