Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What are your opinions on .NET Core vs Python?

3,019 views
Skip to first unread message

Juan C.

unread,
Jan 29, 2017, 2:26:27 AM1/29/17
to
As you guys might know, .NET Core is up and running, promising a
"cross-platform, unified, fast, lightweight, modern and open source
experience" (source: .NET Core official site). What do you guys think about
it? Do you think it will be able to compete with and overcome Python in the
opensource medium?

Deborah Swanson

unread,
Jan 29, 2017, 4:11:34 AM1/29/17
to
Juan C. wrote, on Saturday, January 28, 2017 7:07 PM
I don't really know what .NET does these days, but looking at the list
of languages it supports:
https://en.wikipedia.org/wiki/List_of_CLI_languages#Current_Languages
I don't see any I'd likely want to use instead of Python, with the
possible exception of IronPython. A few people on this list have
mentioned it, but I don't really see any good reason to paste any
version of Python onto some other kind of system. Unless maybe you're
required to use that system for some other reason.

Most of the languages on this "List_of_CLI_languages" supported by .NET
have already been shown to my satisfaction to have been overtaken and
subsumed by Python. It's a good thing that .NET's framework has shed
some baggage, which was sorely needed, but what really matters is what
you can do with it. And given the choices of languages available in
.NET, in most cases I think you'd be better off working in straight
Python. You can't put lipstick on a pig. It will still be a pig, even if
you give it flashy sunglasses and put it on jetskis.

Gerald Britton

unread,
Jan 29, 2017, 7:52:08 AM1/29/17
to
>
> As you guys might know, .NET Core is up and running, promising a
> "cross-platform, unified, fast, lightweight, modern and open source
> experience" (source: .NET Core official site). What do you guys think about
> it? Do you think it will be able to compete with and overcome Python in the
> opensource medium?


It's an apples/oranges comparison.

.NET is a library that can be used from many languages, including Python.
(Not just IronPython, but also Python for .NET (pythonnet.sourceforge*.*net
*))*

Python is a language that can use many libraries, including .NET

The set of libraries that can be used from all the languages that can also
use .NET (out of the box, that is) is smaller.

Joseph L. Casale

unread,
Jan 29, 2017, 4:16:27 PM1/29/17
to
> .NET is a library that can be used from many languages, including Python.

No.

.NET Core (what the OP asked about which is not .NET) is a cross-platform
framework. Obviously Python and .NET differ in runtime semantics with
respect to the original source code, however they are now roughly equivalent
in that both specifications are cross platform.

I personally like .NET Core a great deal and as the framework matures and
it starts to present all of the .NET APIs, it will become a viable choice on non
Windows platforms.

jlc

Gregory Ewing

unread,
Jan 29, 2017, 5:00:27 PM1/29/17
to
Joseph L. Casale wrote:
>>.NET is a library that can be used from many languages, including Python.
>
> No.

Yes:

http://pythonnet.sourceforge.net/

"Python for .NET is a package that gives Python programmers nearly seamless
integration with the .NET Common Language Runtime (CLR) and provides a powerful
application scripting tool for .NET developers. Using this package you can
script .NET applications or build entire applications in Python, using .NET
services and components written in any language that targets the CLR (Managed
C++, C#, VB, JScript)."

--
Greg

Deborah Swanson

unread,
Jan 29, 2017, 5:09:39 PM1/29/17
to
Joseph L. Casale wrote, on January 29, 2017 1:14 PM
>
> > .NET is a library that can be used from many languages, including
> > Python.
>
> No.
>
> .NET Core (what the OP asked about which is not .NET) is a
> cross-platform framework. Obviously Python and .NET differ in
> runtime semantics with respect to the original source code,
> however they are now roughly equivalent in that both
> specifications are cross platform.
>
> I personally like .NET Core a great deal and as the framework
> matures and it starts to present all of the .NET APIs, it
> will become a viable choice on non Windows platforms.
>
> jlc

What .NET APIs are anticipated to be released that aren't on the
official CLI list now:
https://en.wikipedia.org/wiki/List_of_CLI_languages#Current_Languages,
and/or, are .NET supported languages expected to expand beyond the CLI
list?



Joseph L. Casale

unread,
Jan 30, 2017, 2:28:00 AM1/30/17
to
> What .NET APIs are anticipated to be released that aren't on the
> official CLI list now:
> https://en.wikipedia.org/wiki/List_of_CLI_languages#Current_Languages,
> and/or, are .NET supported languages expected to expand beyond the CLI
> list?

I think this (and the last point) misinterprets the semantics of the OPs post.

.NET Core is not .NET, it's a **multi-platform** framework for a language
syntax specification (c#). It's not an implementation of some API that you
cannleverage in another language specification.

Writing a ctype accessor for a Windows API does not equate to cpp code
that is now magically Python. It means no more than what it is, "a foreign
function library for Python" (https://docs.python.org/3/library/ctypes.html).

.Net Core is fundamentally different and much like Python in the way that
a compiler and runtime for a common language syntax specification has been
written for multiple platforms. So in general, the same Python script could
run on both platforms, and most certainly the same .NET Core source could
compile and run on its supported platforms.

So back to the question, .NET Core is a wip which where applicable will soon
present all the existing .NET APIs, excluding those which are Windows specific
and don't make sense to present on a non-Windows platform like Windows Forms.

jlc

denis.a...@gmail.com

unread,
Jan 30, 2017, 2:49:37 AM1/30/17
to
This is outdated location. pythonnet (python for .NET) is on GitHub since 2014.

https://github.com/pythonnet/pythonnet

We just released v2.2.2 with Python 3.6 support and transition to MIT license.

Download from PYPI using pip or from Anaconda using conda:

https://pypi.python.org/pypi/pythonnet/2.2.2
https://anaconda.org/pythonnet/pythonnet

Chris Angelico

unread,
Jan 30, 2017, 3:00:38 AM1/30/17
to
On Mon, Jan 30, 2017 at 6:25 PM, Joseph L. Casale
<jca...@activenetwerx.com> wrote:
> .Net Core is fundamentally different and much like Python in the way that
> a compiler and runtime for a common language syntax specification has been
> written for multiple platforms. So in general, the same Python script could
> run on both platforms, and most certainly the same .NET Core source could
> compile and run on its supported platforms.

What do you mean by "both platforms"? Python scripts already run on
three major operating systems (Win/Lin/Mac) and a good number of
less-popular OSes; a well-written Python script will run in four major
Pythons (CPython, PyPy, Jython, IronPython) and a number of others;
and all manner of CPU architectures and so on.

ChrisA

Joseph L. Casale

unread,
Jan 30, 2017, 10:05:43 AM1/30/17
to
> What do you mean by "both platforms"? Python scripts already run on
> three major operating systems (Win/Lin/Mac) and a good number of
> less-popular OSes; a well-written Python script will run in four major
> Pythons (CPython, PyPy, Jython, IronPython) and a number of others;
> and all manner of CPU architectures and so on.

I meant exactly what you did, in hindsight it was less than perfect wording
on my part...

Thanks,
jlc

Juan C.

unread,
Jan 30, 2017, 1:45:17 PM1/30/17
to
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. <juan0ch...@gmail.com> wrote:
>
> As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource medium?

Oh, I forgot to say, I was indeed talking about .NET Core in general,
the framework, but I also had C#/ASP .NET Core in mind. The real
comparison here would be C#/ASP .NET Core vs Python/Django,Flask. I
personally had to work with C# a few times, it's a great language, but
my main problem was that it was Windows only and most of my personal
programs run on Linux. Yes, we have Mono, but it really didn't feel
"right" to me, it seemed like a workaround, I wanted something really
"native".

Python still has my heart, but .NET Core tempts me. One great thing of
coding in C# would be no GIL.

Joseph L. Casale

unread,
Jan 30, 2017, 3:38:58 PM1/30/17
to
> Python still has my heart, but .NET Core tempts me. One great thing of
> coding in C# would be no GIL.

Seriously, check out the benchmarks at https://github.com/aspnet/benchmarks.

I think aside from the obvious, you'll find the Razor engine and the overall library
to be a pleasure to work with. The framework is truly a representation of what
a high quality, brilliantly engineered piece of software looks like.

Irmen de Jong

unread,
Jan 30, 2017, 4:13:06 PM1/30/17
to
On 30-1-2017 21:33, Joseph L. Casale wrote:
>> Python still has my heart, but .NET Core tempts me. One great thing of
>> coding in C# would be no GIL.
>
> Seriously, check out the benchmarks at https://github.com/aspnet/benchmarks.

Results vary quite a bit there.
For instance take the json serialization benchmark:
https://www.techempower.com/benchmarks/#section=data-r13&hw=ph&test=json
There's 6 python frameworks performing better than aspcore in this chart...


Irmen

Michael Torrie

unread,
Jan 30, 2017, 7:45:08 PM1/30/17
to
On 01/30/2017 11:44 AM, Juan C. wrote:
> On Sun, Jan 29, 2017 at 1:06 AM, Juan C. <juan0ch...@gmail.com> wrote:
>>
>> As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource medium?
>
> Oh, I forgot to say, I was indeed talking about .NET Core in general,
> the framework, but I also had C#/ASP .NET Core in mind. The real
> comparison here would be C#/ASP .NET Core vs Python/Django,Flask. I
> personally had to work with C# a few times, it's a great language, but
> my main problem was that it was Windows only and most of my personal
> programs run on Linux. Yes, we have Mono, but it really didn't feel
> "right" to me, it seemed like a workaround, I wanted something really
> "native".

C# under Mono is as native as C# on the DotNet runtime on Windows or
DotNet core on Linux. However now that DotNet Core is open source and
supported on Linux, Mono is likely to fade away since all of the Xamarin
developers work for MS now.

> Python still has my heart, but .NET Core tempts me. One great thing of
> coding in C# would be no GIL.

C# hardly seems any better than Java to me as far as a language goes.
Being forced into working with classes even when they are not
appropriate is jarring. Because everything is forced into a class, one
often ends up with very long classes in C#, spanning more than one file!
Makes the code much harder to follow from a human point of view. After
working in C# I very much appreciate Python's explicit self requirement
for accessing local instance variables.


Gerald Britton

unread,
Jan 30, 2017, 8:06:57 PM1/30/17
to
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. <juan0christian at gmail.com
<https://mail.python.org/mailman/listinfo/python-list>> wrote:
>
> >
> >* As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource medium?
> *

Oh, I forgot to say, I was indeed talking about .NET Core in general,
> the framework, but I also had C#/ASP .NET Core in mind. The real
> comparison here would be C#/ASP .NET Core vs Python/Django,Flask. I
> personally had to work with C# a few times, it's a great language, but
> my main problem was that it was Windows only and most of my personal
> programs run on Linux. Yes, we have Mono, but it really didn't feel
> "right" to me, it seemed like a workaround, I wanted something really
> "native".

Python still has my heart, but .NET Core tempts me. One great thing of
> coding in C# would be no GIL.

For what it's worth, IronPython, which is implemented in .NET, has no GIL
and doesn't need it since ir runs on the CLR. That means that, for some
things, IronPython can be more performant.

No word yet if the IronPython project intends to port to .NET core or
enable to run it on OS's other than Windows.

Also, it's worth noting that the PythonNet project has a branch working on
.NET core support


--
Gerald Britton, MCSE-DP, MVP
LinkedIn Profile: http://ca.linkedin.com/in/geraldbritton

Joseph L. Casale

unread,
Jan 30, 2017, 8:18:32 PM1/30/17
to
> C# hardly seems any better than Java to me as far as a language goes.

Which sounds pretty good to me, they are both high performance, mature
and rich languages.

> Being forced into working with classes even when they are not
> appropriate is jarring.

And 100% irrelevant, it doesn't prevent you from doing anything you
otherwise could without.

> Because everything is forced into a class, one
> often ends up with very long classes in C#, spanning more than one file!

Sorry, sounds like you need to learn SOLID, none of my classes
have ever taken this form.

> Makes the code much harder to follow from a human point of view. After
> working in C# I very much appreciate Python's explicit self requirement
> for accessing local instance variables.

So, prefix them with "this." and they will look the same?

Nathan Ernst

unread,
Jan 30, 2017, 8:52:20 PM1/30/17
to
I mostly agree with this

On Mon, Jan 30, 2017 at 7:18 PM, Joseph L. Casale <jca...@activenetwerx.com
> wrote:

> > C# hardly seems any better than Java to me as far as a language goes.
>
> Which sounds pretty good to me, they are both high performance, mature
> and rich languages.
>
> > Being forced into working with classes even when they are not
> > appropriate is jarring.
>
> And 100% irrelevant, it doesn't prevent you from doing anything you
> otherwise could without.
>
> > Because everything is forced into a class, one
> > often ends up with very long classes in C#, spanning more than one file!
>
> Sorry, sounds like you need to learn SOLID, none of my classes
> have ever taken this form.
>
There is no reason you cannot introduce a static class with pure static
members (i.e. the Math class in System). A static class effectively becomes
another namespace in C++ parlance. I'll admit the syntax is a bit odd, and
enforces you, at a minimum to use the outer name a as a qualifier, but it's
effectively the same effect.

>
> > Makes the code much harder to follow from a human point of view. After
> > working in C# I very much appreciate Python's explicit self requirement
> > for accessing local instance variables.
>
> So, prefix them with "this." and they will look the same?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
self vs this, and you might start a language holy war. Of course "self" is
the preferred to refer to an instance, just by python convention. Whether I
agree with or not, I've seen "this" used to refer to instances where it is
ambiguous in Python parlance between a "self" instance or a class instance
- those instances are a bit weird, but there are rare occasions you do want
to override class variables where this makes sense (they should be rare -
because it's generally very hard to follow).

Michael Torrie

unread,
Jan 30, 2017, 8:57:36 PM1/30/17
to
On 01/30/2017 06:18 PM, Joseph L. Casale wrote:
> Which sounds pretty good to me, they are both high performance, mature
> and rich languages.

Sure it's a matter of personal preference and need. I happen to find
the expressivity and flexibility of Python (warts and all) to be rather
liberating compared to Java. I find Java rather stifling particularly
because of the forced OOP structure.

Not really sure what you mean by "rich language." Java has a rich
runtime library and a rich ecosystem of utility libraries to draw on.
So does C#. And so does Python.

> Sorry, sounds like you need to learn SOLID, none of my classes
> have ever taken this form.

Never said they were my classes, or even my programs. What is this
"SOLID" thing?

In any case, partial classes seems like a misfeature of C# to me but
apparently they are used when making Windows Forms GUI-based apps.
Apparently VS autogenerates the class that backs the form, and then the
developer creates a partial class that extends that to flesh out the
logic and handle the events. I'm surprised you haven't encountered this.

>> Makes the code much harder to follow from a human point of view. After
>> working in C# I very much appreciate Python's explicit self requirement
>> for accessing local instance variables.
>
> So, prefix them with "this." and they will look the same?

Probably. But C# developers never do that (nor is it normal to do that
in C++ either). Not sure what your point is there. I was merely saying
that I now appreciate the logic of the Python explicit self.

Chris Angelico

unread,
Jan 30, 2017, 9:02:25 PM1/30/17
to
On Tue, Jan 31, 2017 at 12:57 PM, Michael Torrie <tor...@gmail.com> wrote:
>> Sorry, sounds like you need to learn SOLID, none of my classes
>> have ever taken this form.
>
> Never said they were my classes, or even my programs. What is this
> "SOLID" thing?

https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

Five well-respected principles that every class designer should be
aware of. You won't necessarily follow them all slavishly, but know
what the rules are and why you're breaking them.

ChrisA

Michael Torrie

unread,
Jan 30, 2017, 9:04:38 PM1/30/17
to
On 01/30/2017 06:52 PM, Nathan Ernst wrote:
> self vs this, and you might start a language holy war.

Actually no, you misread his point. He was speaking of C#, not Python.
In C#, the only word you can use is "this." He was saying that you can
use the explicit self paradigm in C#. Simply prefix each member variable
with "this."


Gregory Ewing

unread,
Jan 31, 2017, 12:26:59 AM1/31/17
to
Nathan Ernst wrote:
> There is no reason you cannot introduce a static class with pure static
> members (i.e. the Math class in System). A static class effectively becomes
> another namespace in C++ parlance. I'll admit the syntax is a bit odd, and
> enforces you, at a minimum to use the outer name a as a qualifier,

That's the thing I find most frustrating about both C# and Java,
the lack of anything like Python's "from ... import ...". You get
a choice of either effectively doing "import *" on the contents
of a whole class and polluting your namespace, or Fully.Qualifying.
Every.Little.Thing.

--
Greg

Gregory Ewing

unread,
Jan 31, 2017, 12:31:37 AM1/31/17
to
Michael Torrie wrote:
> He was saying that you can
> use the explicit self paradigm in C#. Simply prefix each member variable
> with "this."

One can do that in one's own code, but it doesn't help
you to read the code of someone else who hasn't done
that. Since it's not part of the C# culture, the vast
majority of other C# code you encounter won't be using
it.

--
Greg

Bob Martin

unread,
Jan 31, 2017, 2:31:00 AM1/31/17
to
Please include the identity of people you are quoting.

Michael Torrie

unread,
Jan 31, 2017, 11:18:37 AM1/31/17
to
Agreed, and that's what I said in response to his suggestion about doing
that.

Ian Kelly

unread,
Jan 31, 2017, 12:45:58 PM1/31/17
to
On Jan 30, 2017 11:32 PM, "Gregory Ewing" <greg....@canterbury.ac.nz>
wrote:
> That's the thing I find most frustrating about both C# and Java,
> the lack of anything like Python's "from ... import ...". You get
> a choice of either effectively doing "import *" on the contents
> of a whole class and polluting your namespace, or Fully.Qualifying.
> Every.Little.Thing.

I'm not sure about C#, but this is certainly not true in Java. Importing a
class adds exactly one name to your namespace, just as in Python, which is
the unqualified name of the class. Java also has "static import" which lets
you individually import specific static methods or fields from a class.

Ian Kelly

unread,
Jan 31, 2017, 12:55:55 PM1/31/17
to
On Jan 30, 2017 8:00 PM, "Michael Torrie" <tor...@gmail.com> wrote:
> In any case, partial classes seems like a misfeature of C# to me but
> apparently they are used when making Windows Forms GUI-based apps.
> Apparently VS autogenerates the class that backs the form, and then the
> developer creates a partial class that extends that to flesh out the
> logic and handle the events.

I'm not sure that partial classes were ever really meant as anything other
than a useful feature for code-generating IDEs. But if you think that's
weird, read up on C# extension methods, which are how users of your classes
can add their own methods to them. True, this is also possible in Python
but requires monkey-patching which is rightfully frowned upon.

Gregory Ewing

unread,
Jan 31, 2017, 5:02:26 PM1/31/17
to
Ian Kelly wrote:
> Java also has "static import" which lets
> you individually import specific static methods or fields from a class.

Yes, but it's nowhere near as convenient as Python's import.
To import individual names you have to qualify all of them with
the whole package name, and there is no way to give them
different names locally.

--
Greg
0 new messages