pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Wed May 23, 2018 7:40 pm

jahboater wrote:
Wed May 23, 2018 7:38 pm
pauliunas wrote:
Wed May 23, 2018 6:49 pm
but if you guys love comparing speeds so much,
Make it work, then make it fast ...
but judging by the amount of posts made on this thread and their content, measuring speed or arbitrary benchmark scripts is what y'all do all day long, isn't it? ;D

jahboater
Posts: 3271
Joined: Wed Feb 04, 2015 6:38 pm

Re: .NET Core - Raspbian or Win10IoT?

Wed May 23, 2018 7:45 pm

pauliunas wrote:
Wed May 23, 2018 7:40 pm
but judging by the amount of posts made on this thread and their content, measuring speed or arbitrary benchmark scripts is what y'all do all day long, isn't it? ;D
Well I am retired, so I can spend time tweaking my own code for extra speed. It can be fun.

But never at work. Especially never micro-optimization at work.

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Wed May 23, 2018 8:01 pm

pauliunas,
Nah they're not really slow :) I just probably messed up with optimization settings, because I don't know anything about them.
I know almost nothing about C# and friends but the only optimization setting I could find was "-optimize", which helped somewhat. I can't see much that can be done to optimize the actual source code
Anyway, just how likely would it be for you to waste your time digging around the spaghetti of Windows source code if it ever were released publicly?
Extremely unlikely. Same as it is that I go digging around in Linux code. I don't have the skill or time for it.
Just like any other big spaghetti software. If it works it works, there's no need to have the source code for that
My desire for open source systems is not about me personally digging around in millions of lines of spaghetti software. Although I have suggested bug fixes to open source projects on rare occasions.

Rather it is about not having my systems be dependent on a single corporation, in a foreign country, over which I have no control.

And, how do we know it works? Looks like it does. Who knows what is lurking in there?

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Wed May 23, 2018 8:11 pm

pauliunas,
but judging by the amount of posts made on this thread and their content, measuring speed or arbitrary benchmark scripts is what y'all do all day long, isn't it?
Looks that way doesn't it?

Believe it or not my days are filled with work and all the other thing life entails. Fiddling around here on the forum is what I do when other people might be watching TV or whatever it is normal people do :)

Anyway, this benchmarking thing started as response to this post here: viewtopic.php?f=34&t=206449#p1317074 Which was clearly misguided and cried out for some comment as to why.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Sun May 27, 2018 11:02 am

Heater wrote:
Wed May 23, 2018 8:01 pm
pauliunas,
Nah they're not really slow :) I just probably messed up with optimization settings, because I don't know anything about them.
I know almost nothing about C# and friends but the only optimization setting I could find was "-optimize", which helped somewhat. I can't see much that can be done to optimize the actual source code
Anyway, just how likely would it be for you to waste your time digging around the spaghetti of Windows source code if it ever were released publicly?
Extremely unlikely. Same as it is that I go digging around in Linux code. I don't have the skill or time for it.
Just like any other big spaghetti software. If it works it works, there's no need to have the source code for that
My desire for open source systems is not about me personally digging around in millions of lines of spaghetti software. Although I have suggested bug fixes to open source projects on rare occasions.

Rather it is about not having my systems be dependent on a single corporation, in a foreign country, over which I have no control.

And, how do we know it works? Looks like it does. Who knows what is lurking in there?
We do know that it works because it works. If it didn't work, you wouldn't be able to use it. That's how the world works, my friend ;)

And yeah, you're dependent on some people in a foreign country. But you can say the same about open source projects. You aren't gonna jump in and fix problems with Linux if they appear, you'll just let other people handle it. And you have absolutely no control over who does what with your Linux distribution either. So it's the same, except that corporations hire well trained specialists with high salaries (motivation), whereas open source projects are mostly maintained by volunteers working on their spare time (less motivation).

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Sun May 27, 2018 12:13 pm

pauliunas,
We do know that it works because it works. If it didn't work, you wouldn't be able to use it. That's how the world works, my friend
Clearly I should have been clearer on what I meant by "it works".

Yes it looks like it works. But we don't know what is in there. We have no way to tell under what circumstances it will not work. We have no idea what backdoors have been built into it. Should any of those things come to light, as they have done in Windows for decades, we have no way to fix them. My Windows 10 machine, and no doubt everyone else's, looks like it works. Until it decides to update at a critical moment. Or a driver update breaks it. Or it keeps turning telemetry things on after I have turned them off. Etc, etc.
And yeah, you're dependent on some people in a foreign country. But you can say the same about open source projects.
Perhaps. But if the owners of an Open Source project stop support, or develop it in way people don't like then if the project is important and widely used it may well get forked by others and development continued. Famous examples of this are: OpenOffice/Libre Office, MySql/MariaDB, various forks of whole Linux distributions so as to avoid using Systemd.

Meanwhile, there are Linux distributions from many places in the world to choose from.
You aren't gonna jump in and fix problems with Linux if they appear, you'll just let other people handle it.
Me personally, probably I won't have the skill or time to get seriously into fixing/modifying big complex projects. But I know people who do. Sometimes their developments get adopted by the upstream project.
And you have absolutely no control over who does what with your Linux distribution either.
Sure I do. I can switch to another distribution. There are so many to choose from. In the extreme I can build my own Linux system. I have done that three or four times before.
So it's the same...
No. As you see above, it's totally different.
...except that corporations hire well trained specialists with high salaries (motivation), whereas open source projects are mostly maintained by volunteers working on their spare time (less motivation).
Err, no.

A lot of Open Source projects are started/maintained/contributed to by corporations who pay software engineers good salaries to work on the Open Source code.

Examples:

A lot, probably most, of the work on the Linux kernel is done by paid professionals working for the likes of IBM, Google and a mass of smaller companies, including the Pi Foundation no doubt. Good grief even Microsoft contributes to the Linux kernel!

Clang/LLVM the C/C++ compiler built by Google and Apple among others.

I'm sure a lot of Python modules are created by paid engineers whose employers want to use Python.

MariaDB, maintained by a company.

Cockroach DB, built by a Cockroach Labs. A bunch of ex-google engineers.

Node.js, the V8 Javascript engine in there is built by Google, the node.js run time is backed by a company.

The Chrome and Firefox browsers, Google and Mozilla respectively.

And so on and so on. The idea that Open Source software is created by lone anmature nerds in their basements is largely a myth.

Finally, I refute the claim that Open Source developers have less motivation. Money might be a good motivator to work on a project, until someone offers you more to work on something else. But dedication to a cause, like creating an Open Source computing environment for the world, can be a bigger and longer motivation.

You really should look into how the Open Source world works before making incorrect assertions about it.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Sun May 27, 2018 12:19 pm

Heater wrote:
Sun May 27, 2018 12:13 pm
pauliunas,
We do know that it works because it works. If it didn't work, you wouldn't be able to use it. That's how the world works, my friend
Clearly I should have been clearer on what I meant by "it works".

Yes it looks like it works. But we don't know what is in there. We have no way to tell under what circumstances it will not work. We have no idea what backdoors have been built into it. Should any of those things come to light, as they have done in Windows for decades, we have no way to fix them. My Windows 10 machine, and no doubt everyone else's, looks like it works. Until it decides to update at a critical moment. Or a driver update breaks it. Or it keeps turning telemetry things on after I have turned them off. Etc, etc.
And yeah, you're dependent on some people in a foreign country. But you can say the same about open source projects.
Perhaps. But if the owners of an Open Source project stop support, or develop it in way people don't like then if the project is important and widely used it may well get forked by others and development continued. Famous examples of this are: OpenOffice/Libre Office, MySql/MariaDB, various forks of whole Linux distributions so as to avoid using Systemd.

Meanwhile, there are Linux distributions from many places in the world to choose from.
You aren't gonna jump in and fix problems with Linux if they appear, you'll just let other people handle it.
Me personally, probably I won't have the skill or time to get seriously into fixing/modifying big complex projects. But I know people who do. Sometimes their developments get adopted by the upstream project.
And you have absolutely no control over who does what with your Linux distribution either.
Sure I do. I can switch to another distribution. There are so many to choose from. In the extreme I can build my own Linux system. I have done that three or four times before.
So it's the same...
No. As you see above, it's totally different.
...except that corporations hire well trained specialists with high salaries (motivation), whereas open source projects are mostly maintained by volunteers working on their spare time (less motivation).
Err, no.

A lot of Open Source projects are started/maintained/contributed to by corporations who pay software engineers good salaries to work on the Open Source code.

Examples:

A lot, probably most, of the work on the Linux kernel is done by paid professionals working for the likes of IBM, Google and a mass of smaller companies, including the Pi Foundation no doubt. Good grief even Microsoft contributes to the Linux kernel!

Clang/LLVM the C/C++ compiler built by Google and Apple among others.

I'm sure a lot of Python modules are created by paid engineers whose employers want to use Python.

MariaDB, maintained by a company.

Cockroach DB, built by a Cockroach Labs. A bunch of ex-google engineers.

Node.js, the V8 Javascript engine in there is built by Google, the node.js run time is backed by a company.

The Chrome and Firefox browsers, Google and Mozilla respectively.

And so on and so on. The idea that Open Source software is created by lone anmature nerds in their basements is largely a myth.

Finally, I refute the claim that Open Source developers have less motivation. Money might be a good motivator to work on a project, until someone offers you more to work on something else. But dedication to a cause, like creating an Open Source computing environment for the world, can be a bigger and longer motivation.

You really should look into how the Open Source world works before making incorrect assertions about it.
well then IF windows does something you don't like, choose another OS. There are many to choose from. But it seems like you're just butthurt about them not showing you the code which you wouldn't be able to read anyway.

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Sun May 27, 2018 1:08 pm

pauliunas,
well then IF windows does something you don't like, choose another OS. There are many to choose from.
Obviously that is what I do.

But consider: If I invest a lot of time and effort into building a system based on Windows IoT it likely not so easy to swap my development over to some other OS should I find out that I need to. It would no doubt end up with a lot of dependencies on WinIoT and the Azure cloud.

Not to mention that before I start WinIoT already dictates that I need Windows 10 to even get the thing installed and start work.
But it seems like you're just butthurt about them not showing you the code which you wouldn't be able to read anyway.
I am not, as you most charmingly put it, "butthurt" about anything. I am more than happy with the Ocean of Open Source solutions available today. It's a great time in computing today.

I'm just pointing out that getting locked in to such a single supplier is perhaps not such a wise idea.

Now tell me, why are you so keen to promote, or at least defend, such lock in ?

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Sun May 27, 2018 1:27 pm

Heater wrote:
Sun May 27, 2018 1:08 pm
pauliunas,
well then IF windows does something you don't like, choose another OS. There are many to choose from.
Obviously that is what I do.

But consider: If I invest a lot of time and effort into building a system based on Windows IoT it likely not so easy to swap my development over to some other OS should I find out that I need to. It would no doubt end up with a lot of dependencies on WinIoT and the Azure cloud.

Not to mention that before I start WinIoT already dictates that I need Windows 10 to even get the thing installed and start work.
But it seems like you're just butthurt about them not showing you the code which you wouldn't be able to read anyway.
I am not, as you most charmingly put it, "butthurt" about anything. I am more than happy with the Ocean of Open Source solutions available today. It's a great time in computing today.

I'm just pointing out that getting locked in to such a single supplier is perhaps not such a wise idea.

Now tell me, why are you so keen to promote, or at least defend, such lock in ?
because it's so much better than linux :)

And because even if Windows was open source, that wouldn't make it easier from you to move from it to Linux.. you would still be "locked in" as you say. I was responding to your comment where you said "I'm not using this shit until it becomes open source"

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Sun May 27, 2018 1:49 pm

pauliunas,
because it's so much better than linux
Ah, I see, you are just trolling. OK. All good fun.

Just incase you are not trolling, my question was not about which OS is technically superior to what other OS. It was about your defending the lockin of a single supplier.
And because even if Windows was open source, that wouldn't make it easier from you to move from it to Linux.. you would still be "locked in" as you say
Perhaps likely I would be dependant on the WinIoT OS. But given a proper Open Source license (Note the capitalization there, it's important) users of such an OS would not be locked in to Microsoft. They would have the freedom to do what they like with it. That is a big difference.
I was responding to your comment where you said "I'm not using this shit until it becomes open source"
It's very bad form, and dishonest, to make up literal quotes and ascribe them to people who never said them. Please don't do that.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Thu May 31, 2018 5:22 pm

Heater wrote:
Sun May 27, 2018 1:49 pm
pauliunas,
because it's so much better than linux
Ah, I see, you are just trolling. OK. All good fun.

Just incase you are not trolling, my question was not about which OS is technically superior to what other OS. It was about your defending the lockin of a single supplier.
And because even if Windows was open source, that wouldn't make it easier from you to move from it to Linux.. you would still be "locked in" as you say
Perhaps likely I would be dependant on the WinIoT OS. But given a proper Open Source license (Note the capitalization there, it's important) users of such an OS would not be locked in to Microsoft. They would have the freedom to do what they like with it. That is a big difference.
I was responding to your comment where you said "I'm not using this shit until it becomes open source"
It's very bad form, and dishonest, to make up literal quotes and ascribe them to people who never said them. Please don't do that.
ehm... you're trolling, right?

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Thu May 31, 2018 6:15 pm

No. Why would you think so?

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Thu May 31, 2018 6:28 pm

Heater wrote:
Thu May 31, 2018 6:15 pm
No. Why would you think so?
totally random accusations and all that bullshit with capitalization.

jahboater
Posts: 3271
Joined: Wed Feb 04, 2015 6:38 pm

Re: .NET Core - Raspbian or Win10IoT?

Thu May 31, 2018 7:02 pm

:) Heater does not troll - unless perhaps the subject is Javascript :)
Look at the number of posts.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Thu May 31, 2018 7:11 pm

jahboater wrote:
Thu May 31, 2018 7:02 pm
:) Heater does not troll - unless perhaps the subject is Javascript :)
Look at the number of posts.
well he/she could be a very dedicated troll :mrgreen:

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Thu May 31, 2018 8:59 pm

pauliunas,
totally random accusations and all that bullshit with capitalization.
What?!

1) I almost never use capitalization in any post anywhere on the net except as is called for by good grammar. I challenge you to link us to any example of my using capitalization.

2) Of course none of my posts are "bullshit" as you so charmingly put it. They may well be wrong mind you. I'm always open to being corrected as to factual errors. My opinions, perhaps not so much. Again, I challenge you to link us to any example of my "bullshit".

3) I do not make random accusations. In fact I almost never accuse anybody of anything. Unless I'm sure of my facts, can back it up, and it is serious enough to bother with. Once again, I challenge you to link us to any example of my supposed random accusations.

4) jahboater. Yeah, I know, sorry, I go overboard about the Javascript thing. Somebody has to around here :)

5) Yes, I know. I have been trolled again. Or "baited" as we used to say in pre-net times. Ah well, such is the internet.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Fri Jun 01, 2018 4:46 am

Heater wrote:
Thu May 31, 2018 8:59 pm
pauliunas,
totally random accusations and all that bullshit with capitalization.
What?!

1) I almost never use capitalization in any post anywhere on the net except as is called for by good grammar. I challenge you to link us to any example of my using capitalization.

2) Of course none of my posts are "bullshit" as you so charmingly put it. They may well be wrong mind you. I'm always open to being corrected as to factual errors. My opinions, perhaps not so much. Again, I challenge you to link us to any example of my "bullshit".

3) I do not make random accusations. In fact I almost never accuse anybody of anything. Unless I'm sure of my facts, can back it up, and it is serious enough to bother with. Once again, I challenge you to link us to any example of my supposed random accusations.

4) jahboater. Yeah, I know, sorry, I go overboard about the Javascript thing. Somebody has to around here :)

5) Yes, I know. I have been trolled again. Or "baited" as we used to say in pre-net times. Ah well, such is the internet.
"Open Source license (Note the capitalization there, it's important)" - this would be ridiculous if it weren't cringy.

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Fri Jun 01, 2018 6:43 am

pauliunas,

Ah, OK, my apologies. When you said "bullshit with capitalization" I thought you meant that silly thing that people do on the net, writing in all uppercase to add emphasis, often known as "SHOUTING".

Why on earth would my use of "Open Source license" be bullshit, or ridiculous or cringy? Those words are capitalized for a reason. Do you know what that reason is?

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Fri Jun 01, 2018 6:45 am

Heater wrote:
Fri Jun 01, 2018 6:43 am
pauliunas,

Ah, OK, my apologies. When you said "bullshit with capitalization" I thought you meant that silly thing that people do on the net, writing in all uppercase to add emphasis, often known as "SHOUTING".

Why on earth would my use of "Open Source license" be bullshit, or ridiculous or cringy? Those words are capitalized for a reason. Do you know what that reason is?
yeah, cringy.

Heater
Posts: 10274
Joined: Tue Jul 17, 2012 3:02 pm

Re: .NET Core - Raspbian or Win10IoT?

Fri Jun 01, 2018 7:54 am

pauliunas,
yeah, cringy.
Please elaborate. I don't know what you mean.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11088
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: .NET Core - Raspbian or Win10IoT?

Fri Jun 01, 2018 9:30 am

Well it seems someone doesn't like open-source licensing. boo-hoo.

please keep it civic, if this thread goes off the rails I will wield the ban-hammer... :roll: :evil:

ejolson
Posts: 2168
Joined: Tue Mar 18, 2014 11:47 am

Re: .NET Core - Raspbian or Win10IoT?

Fri Jun 01, 2018 5:05 pm

mahjongg wrote:
Fri Jun 01, 2018 9:30 am
Well it seems someone doesn't like open-source licensing. boo-hoo.

please keep it civic, if this thread goes off the rails I will wield the ban-hammer... :roll: :evil:
I was just wondering whether to keep my civic or trade it in for an accord.

It does seem like we are far from the original topic:

1. Does C# on Windows IoT support the GPIO device?

2. How much faster is C# running on Windows IoT compared to Mono on Raspbian?

I think it would be nice to have some satisfying factual answers to these questions.

The proposed speed test based on generation of random numbers is interesting. Note that the random number generator is linear as is the mixing process used to generate the final answer. As a result, there likely exists a simple polynomial which directly jumps from the initial state of the random number generator directly to the final answer printed. Never mind that: It is unlikely that any compiler created within the next 20 years would automatically perform such an optimization.

A number of years ago Microsoft licensed Intel proprietary code generators to make Visual Studio more competitive with existing gcc and LLVM open source compliers. Recently, Microsoft added LLVM as a possible backend to Visual Studio. Soon afterwards Intel announced that they will cease working on proprietary compilers and instead directly integrate their compiler innovations with open source tools.

Based on conjecture, I would expect that C# on IoT supports GPIO and to be 30 percent to 2 times faster than C# on Mono.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Thu Jun 07, 2018 7:03 pm

ejolson wrote:
Fri Jun 01, 2018 5:05 pm
mahjongg wrote:
Fri Jun 01, 2018 9:30 am
Well it seems someone doesn't like open-source licensing. boo-hoo.

please keep it civic, if this thread goes off the rails I will wield the ban-hammer... :roll: :evil:
I was just wondering whether to keep my civic or trade it in for an accord.

It does seem like we are far from the original topic:

1. Does C# on Windows IoT support the GPIO device?

2. How much faster is C# running on Windows IoT compared to Mono on Raspbian?

I think it would be nice to have some satisfying factual answers to these questions.

The proposed speed test based on generation of random numbers is interesting. Note that the random number generator is linear as is the mixing process used to generate the final answer. As a result, there likely exists a simple polynomial which directly jumps from the initial state of the random number generator directly to the final answer printed. Never mind that: It is unlikely that any compiler created within the next 20 years would automatically perform such an optimization.

A number of years ago Microsoft licensed Intel proprietary code generators to make Visual Studio more competitive with existing gcc and LLVM open source compliers. Recently, Microsoft added LLVM as a possible backend to Visual Studio. Soon afterwards Intel announced that they will cease working on proprietary compilers and instead directly integrate their compiler innovations with open source tools.

Based on conjecture, I would expect that C# on IoT supports GPIO and to be 30 percent to 2 times faster than C# on Mono.
Thanks for the insight.
In my understanding, Microsoft's implementation should work better than a third party port (Mono). But Microsoft also has their own implementation for Linux, which is .NET Core. The same thing runs on Windows IoT. Since it's pretty much the same implementation, the speed should be identical, but then other things such as hardware drivers and background services come to play. I suppose Raspbian has much more background processes running, but on the other hand, Microsoft doesn't have a good track record when it comes to using ARM architecture so they probably have shitty drivers.
It would also be interesting to hear something about power consumption and heat, not only pure performance.
And I know it's impossible to compare them objectively, but I just wanted to have a discussion with someone who maybe has used both :) and posts like yours are also interesting to read.

pauliunas
Posts: 41
Joined: Mon Feb 26, 2018 7:43 am

Re: .NET Core - Raspbian or Win10IoT?

Thu Jun 07, 2018 7:06 pm

mahjongg wrote:
Fri Jun 01, 2018 9:30 am
Well it seems someone doesn't like open-source licensing. boo-hoo.

please keep it civic, if this thread goes off the rails I will wield the ban-hammer... :roll: :evil:
I don't have anything against open source lol... I just don't like when people talk about such things as if it was their almighty God or something :D

JustAGeek
Posts: 1
Joined: Thu Jun 21, 2018 8:21 am

Re: .NET Core - Raspbian or Win10IoT?

Thu Jun 21, 2018 9:21 am

I have absolutely no idea why I'm biting on this. I'll use it as an excuse to exercise my brain. So while I'll write as though I'm speaking to you, I'm really more interested in just writing down my thoughts. I also stopped reading all the comments when I realized that it would be a REALLY REALLY long read. So I'm about 1/4 down on the second page as it stands now.

I've been many things in life. I have been coding far more than long enough to actually have earned a living in COBOL before it was obsolete. I spent many long hours programming in languages where GOTO statements were the only real option. I've been a senior developer on one of the fastest web browsers ever made for years. I've been a programming language designer, an operating system developer, an old school demo coder and for a very large part a codec developer for one of the companies that more or less dominated the patent pool on a lot of H.26X standards.

I am also currently coding almost entirely in C# for many reasons... though not really the ones mentioned. And remember, I've spent much of my life counting cycles.

I am happy to see the discussion between C# and Javascript as these are two of my favorite playgrounds. I'm friends with some of the people in charge of C# at Microsoft as well as some of the performance oriented developers at Microsoft, Mozilla and Google. I've had lunch with at least one person from each of their Javascript teams in the past two months. My son is actually named for one of them.

I'm also glad that no one is debating firmware/kernel level languages like C and C++. I'm completely over those languages and have absolutely no possible reason to recommend either for anything since Rust came around... except maybe that C's ABI is very simplistic and can be trivial to implement.

You're both right and you're both wrong about very much of what you say. We have a Javascript fanatic and a C# fanatic. I know this isn't fair, but if you go back and read what you've both been writing from a 3rd person perspective, you might consider medication for that. It was getting a bit out of hand.

Let me start by saying, Javascript is faster. There's absolutely no doubt about this and there is no debating it. Using a simple counter program isn't testing language performance. You're comparing the AOT and caching of the engine. It's not realistic and it's not fair. It also doesn't do what real programs do. Real programs allocate and free memory... that's the key thing.

There are some cases where C# will rip the doors off of Javascript. In .NET Core 2.1, there is now support for Span<> and Map<> which are two of the best additions ever made to a modern language. I have a personal request into the .NET development team to add support for memory locking and alignment so that I would no longer have to drop to C++ to manage memory for codecs.

From a language perspective, Javascript is amazing and you should not ever use modern Javascript. Browsers don't like it and it's best to stick with something older. Javascript in version 6 and later is an incredible language. The introduction of classes has been a huge improvement. That said, Javascript as a language is pretty weak overall as a comparison.

Let's start by saying that Javascript was never really supposed to stick. Technically, it's one of the best and the worst languages ever made. The simple fact that something like 'strict' even exists is proof of this. You have basically two languages in one. One language is a shit box that says that pretty much anything you type will do something. The other one is a language where "best practices" are trying to be declared and enforced. But the language is basically a sandbox where pretty much anything goes. There are days where we were sitting there and while writing a test for Javascript we said "wouldn't it be nice to have a new construct to make this easier for this test". Of course that keyword had absolutely no value to the language as a whole, but we said "screw it, let's stick it in" and before you knew it, the standards group over at Ecma wanted to kill us because not only did it become part of the language as a defacto standard, but the bugs in our implementation did too. We spent all our days and nights trying to fight with the crappy parser rules we had to write because of Netscape's original implementation and later Microsoft's half baked alternative that we honestly almost couldn't even call it a programming language parser as opposed to a natural language parser.

C# is a special language because unlike most other languages (Java as a notable example), the developers of that language are willing to rip things out and simply release a new version. This is possible because if you're using .NET there's no particular reason you can't have 5 different versions of .NET on your machine. It means that where Javascript has the 'strict' concept, C# actually makes breaking changes that force massive refactoring of the class libraries and things improve greatly. This is why C# probably has the nicest lambda and async implementations of any language today.

There are endless reasons why each language is better than the other. I can site that C# looks like a language carefully engineered by language developers who eventually added such insane static code analysis to their compilers that it's difficult to write bad C# code anymore since the compiler will go absolutely crazy and generate pages of warnings over it. Javascript has had probably collectively close to a billion dollars invested purely in a competition of performance which has yielded a runtime environment that made at least 3 separate Javascript engines that generally produce code that is far faster and/or better than any C compiler out there today (when considering real world memory usage).

C# doesn't ever try for the nitty gritty little things like fancy auto-vectorization engines. Javascript doesn't target it, but it's present. C# calls cleanly into native code, Javascript makes this really a gruesome task. As I said, pages and pages and pages of comments can be written on this topic. But in the end, when comparing CapEx (the time it takes to write and maintain code) vs OpEx (the cost of running that code) the two languages even out.

A good point to make as well is that poorly written Javascript in just the right place can actually be seriously detrimental to the environment. For example, if you were to implement a Javascript library which was compiled on client side for a web interface. Let's think in terms of something like Angular. Then a large download and a high complexity would consume massive amounts of power worldwide if it were used on something like Google's home page. Simply minimizing the Javascript on Google's home page probably saves the world massive power costs just because it would reduce the computational complexity (think Big-O) of the lexical analysis of the received code.

The reason I use C# however has to do with class libraries. In the Javascript world, even the simple things depend on code which is provided by the community. If you were you look at the Linux kernel and the absolute trash heap of code that is, (BTW, I love Linux, the code is horrifying though) it's an example of how the community can absolutely ruin the underlying structure of something otherwise beautiful. The Linux kernel has millions of lines of wasteful duplicated code because the kernel base libraries are insufficient for the job. The Linux world constantly creates, recreates and the recreates again the simplest of functions. The worst part is that there's no real central authority building solid tools for Javascript as a base library. We depend on things like NPM which provide toolkits from just too many places at once.

I hate coding in Javascript because the NPM toolbox is an total nightmare. To be honest, I almost never use community contributed libraries from Nuget. Nearly every time I've ever done so, I've regretted it. Instead, I use packages provided by vendors or roll it myself. The one exception to this has been in SSH support where I've been too busy to sit down and start a proper modern implementation of it.

I absolutely love the Microsoft stranglehold on C#. They have a good team working together to make a good product. There are days where I want to offer pull requests to them, but then I realize, filing an issue is more effective.

Let's just say again, you're both right and both wrong. There's no value to choosing one language/platform vs. the other if you're proficient in one or the other already. Unless you're padding your CV/resume it's best to simply program in whatever you like the most. They both have incredible merits.

If you compared either language to C or C++, I'd be totally different. Consider for instance modern meltdown/spector related CPU bugs. All the C/C++ code out there had to be recompiled and systems had to have scheduled downtown and there were reboots and verification testing and then additional patches to fix performance on those patches, etc...

If the code were written in either Javascript or C#, a simple patch to the browser or to the CLR would have altered the way the code was compiled and put an end to those problems. Instead we all took performance hits when our firmwares were updated.

Then there's relocatable memory. I despise any code where memory is allocated by pointer rather than by reference. Referenced memory can be paged, compressed, relocated, etc... this means that the system MMU can have much shorter tables to traverse when performing memory reads and writes since it is possible to use unaligned memory as well as to defragment and garbage collect on idle cycles. The kernel could run a process that did nothing more than to decrease the complexity of the GDT and LDT while idle. That said, we can do that to a limited extent, but because of "C purists", defragmentation on application and kernel level is impossible.

Then there's performance. Using a tracing JIT (we don't do that anymore, but we do something similar) it is possible to compile out conditions for specific branches of execution during runtime that can adjust to provide maximum performance whether running on an Atmel processor or on a 28 core Xeon. And then there's NUMA. When working in a multi-socket server or HPC environment, code written in C has to be manually written to place code near memory. Labs spend hundreds of millions of dollars trying to build servers and storage systems to compensate for C, C++ and CUDA code which doesn't properly distribute active data sets to active computational nodes. Instead, the software just depends on massive local RAM and a ridiculously high performance fabric to distribute data as RDMA operations. If the code were written in Javascript and/or C#, code could be properly distributed to where the data is on the fly which would be much faster than moving the data. It would be little more than simply migrating the process from machine to machine... a few bytes in operation. Then there's core scheduling and cache coherency... all problems compiled languages have that JIT languages don't.

I'm heading to lunch now. Thanks for the opportunity to rant for a while.

Return to “Other programming languages”