« first day (1146 days earlier)      last day (3817 days later) » 

8:00 AM
@Mysticial I could already use it for half the shift amounts
@Mysticial but the 25 and 20 are not byte
 
3
Q: C# vs. C++ performance -- why doesn't .NET perform the most basic optimizations (like dead code elimination)?

MehrdadI'm seriously doubting if the C# or .NET JIT compilers perform any useful optimizations, much less if they're actually competitive with the most basic ones in C++ compilers. Consider this extremely simple program, which I conveniently made to be valid in both C++ and C#: #if __cplusplus #else s...

^^ That's a good question.
 
@Mysticial do you have experience with creating "fat" windows binaries, with run-time support for AVX2, SSE4, etc
 
| Section2 = | Section3 = }} Triolein is a symmetrical triglyceride derived from glycerol and three units of the unsaturated fatty acid oleic acid. Most triglycerides are unsymmetrical, being derived from mixtures of fatty acids. Triolein represents 4-30% of olive oil. Triolein is also known as glyceryl trioleate and is one of the two components of Lorenzo's oil. References
 
@nightcracker I've never tried to do run-time dispatching within the same binary.
 
@Mysticial uh.. reflection?
C# has to support it.
 
8:04 AM
@Rapptz Are you gonna put that as a comment?
 
Sure.
 
Also C# does some dead code elimination
But not entire functions
 
@Mysticial If my encryption algorithm can indeed benefit from AVX2 (which is very likely as there are AVX2 implementations of ChaCha around which are very similar), then I would estimate it would be twice as fast, at 1.5 cycles/byte
 
OK - Myst - I took a shot at answering: stackoverflow.com/a/20394552/2963099
 
for reference, AES is 1.3 cycles/byte, WITH ON-DIE HARDWARE SUPPORT
 
8:06 AM
@nightcracker Yes but AES is provedly secure! How about your algorithm?
 
Oh jalf is here.
 
@user7236293 AES is not provedly secure, what makes you think that?
 
@nightcracker Let me rephrase: a lot of clever mathematicians believe in its strength and it has been designed to be difficult to break
 
@user7236293 pretty sure they're called cryptographers, not mathematicians ;)
 
It's the same thing really
A subset :)
 
8:07 AM
Nearly no encryption is provably secure. In most cases, security proofs aren't really proofs of security, only proofs of equivalence to something else that's generally believed to be secure (or difficult, etc.)
 
@user7236293 … who happen to be employed by the US government to monitor online traffic.
 
my algorithm has been designed to be difficult to break as well
however, what it lacks is scrutiny
so I'm putting it out there in a competition in january
 
@Potatoswatter you do know that there are cryptographers and mathematicians outside the NSA too, yes?
 
@Potatoswatter Um, weren't the AES inventors from Belgium?
@nightcracker yay! what competition? also what is your algo based on? is it something new? or more traditional?
 
user1804599
I want to play Minecraft.
 
@nightcracker not one of these smartass dom.ai.ns again
 
@user7236293 ask djb, not me
 
@user7236293 Yes.
 
The Advanced Encryption Standard (AES) is a specification for the encryption of electronic data established by the U.S. National Institute of Standards and Technology (NIST) in 2001. It is based on the Rijndael cipher developed by two Belgian cryptographers, Joan Daemen and Vincent Rijmen, who submitted a proposal to NIST during the AES selection process. Rijndael is a family of ciphers with different key and block sizes. For AES, NIST selected three members of the Rijndael family, each with a block size of 128 bits, but three different key lengths: 128, 192 and 256 bits. AES has been ad...
^ May have been invented in Belgium, but the seal of approval that it is secure was stamped in the US.
 
@user7236293 del.icio.us !
 
8:10 AM
@Potatoswatter which means it's not secure
@Rapptz fuck.this.sh.it
 
Delicious (formerly del.icio.us) is a social bookmarking web service for storing, sharing, and discovering web bookmarks. The site was founded by Joshua Schachter in 2003 and acquired by Yahoo in 2005. By the end of 2008, the service claimed more than 5.3 million users and 180 million unique bookmarked URLs. The site was sold to AVOS Systems on April 27, 2011 and relaunched in a "back to beta" state on September 27 that year. Site description Delicious uses a non-hierarchical classification system in which users can tag each of their bookmarks with freely chosen index terms (generating...
 
@Rapptz I know lol
 
does anyone even use this site anymore?
 
@user7236293 Not really.
 
@JerryCoffin i didnt actually mean it
 
user1804599
8:11 AM
I use the bookmarking feature that my web browser offers.
 
i still have faith in the mathematicians around the world :)
even from belgium
which says quite a lot
 
@Potatoswatter editted for clarity - and I would test, but I dont own C#
 
@Rapptz why did you remove your comment?
 
it felt wrong
 
@user7236293 my encryption algorithm doesn't do just encryption though
 
8:13 AM
@nightcracker is it also sentient
 
JBL
Good morning !
 
it's an authenticated encryption algorithm, meaning it also produces a checksum used to verify the plaintext
 
one of my teachers here basically asked me to make my program sentient (at least, aware of human emotions)
 
@user7236293 not yet
 
@JBL Bonjour !
 
8:14 AM
@user7236293 Cryptographers are definitely a subset. To be specific: cryptologists study cryptography in general. Cryptanalysts attempt to break ciphers, and cryptographers invent ciphers. The delineation is somewhat artificial though, since a decent cryptographer nearly has to be at least somewhat competent as a cryptanalyst (though the reverse isn't necessarily true).
 
@JerryCoffin hai jerry
 
@JerryCoffin meh, no such difference really exists
if you know how to break it, you know how to make it so that you can't break it
 
i know how to make a car then
and glass windows
 
if you know how to make it you better damn know how it can not be broken
 
JBL
@JerryCoffin And the NSA fucks everyone around.
I get the Crypto community yay !
 
8:16 AM
@Potatoswatter - I dont code C# for a reason - but I didn't want to start the C++/C# war - yes - its should wake up and see that it is just spinning it's wheels
 
@nightcracker Not necessarily. There have been some pretty decent cryptanalysts who did little or not cipher design.
 
@JerryCoffin such as?
 
user1804599
C++ > C#.
 
@rightfold error, can not compare type 'apples' with type 'oranges' - did you mean PHP?
 
JBL
Heh, a # is nothing more than two + interlaced.
 
8:19 AM
@GlennTeitelbaum Me neither. Really I think the answer is that optimizers for the C virtual machine shared by C++, but not C#, have gotten much more attention and .NET is probably missing some essentials.
 
@nightcracker Jim Gillogly
 
@rightfold weed
 
I did add this one last bit, "Note: It could also be as suggested that C# optimization could use some improvement"
 
@rightfold he says in a C++ chatroom
 
@GlennTeitelbaum do you have any knowledge that the C# JIT compiler does any kind of optimization while the code is running at all? Because afaik it doesn't, and looking at the behavior of the code in question, it looks like it doesn't
 
8:21 AM
C++ is the most performant language, except for asm, but i'm too old to bother with that
 
user1804599
The only disadvantage for C++ is that it has a weaker type system than C#.
 
I think you're conflating what "real" JIT compilers do, and what the C# "JIT" compiler does
@rightfold weaker, but more expressive
 
@rightfold what
@jalf r u even a real jit m8??
 
@jalf It is supposed to, from MS: C# flag /optimize also tells the common language runtime to optimize code at runtime.
 
@JerryCoffin didn't know him, had to look him up
 
8:24 AM
@user7236293 The C# type system protects you against UB, the C++ type system doesn't.
 
from what I've found he managed to puzzle out a CIA art thingy
 
@jalf oh in that sense, alright
 
scary, but: By default, optimizations are disabled. Specify /optimize+ to enable optimizations
 
user1804599
I didn’t mean that.
 
@GlennTeitelbaum afaik that simply means "optimize code when it is loaded/codegen'ed", and not "while it is running"
 
8:24 AM
@jalf UB means undefined behavior. All an individual platform needs to do to avoid UB is to specify what happens in every case. Then all that's left is bugs.
There's a difference between a multi-platform language spec and a platform spec.
 
user1804599
In C# you can do silly things like adding integers to strings, but in C++ you can do even sillier things like assigning integers to Booleans and then using those for pointer arithmetic.
 
@JerryCoffin got any modern cryptanalysts?
 
@Potatoswatter "Every case" is a lot of cases though. Why don't you solve the halting problem too, while you're at it? :p
 
Is a NullPointerException really more user-friendly than a hardware-generated unmapped memory exception?
 
Also, "specifying what happens in every case" is basically what the type system does in a "proper" strongly typed language
 
8:26 AM
@nightcracker Among many other things, yes.
 
@Potatoswatter What does that have to do with anything?
 
@jalf That is called 'before runtime' or 'at load time' so they could do JIT optimizations
 
A NullPointerException is well-defined. That's a pretty useful property
 
@rightfold I still hate the fact that you can assign an object as an element of string[] if you cast it to object[]
 
user1804599
@Potatoswatter less friendly than lack of null.
 
user1804599
8:27 AM
@user7236293 lolwut
 
@Potatoswatter yes, NullPointerException is camel cased
 
user1804599
Mutable arrays are covariant?
 
yes
 
user1804599
That sounds like a terrible idea.
 
8:27 AM
it's awful
 
@GlennTeitelbaum but do you have any evidence that they ever do? I was under the impression that they only ever did load-time optimizations. I could be wrong, but do you have any information indicating that it is the case?
 
Just heresay, that it is supposed to
 
@jalf Things that C++ specifies to be UB, platforms tend to define to do something such as program termination. UB is only undefined because to allow deference to a platform spec.
 
user1804599
csharp> var ss = new string[] { "Hello", "World" };
csharp> var os = ss as object[];
csharp> os[0] = new object();
System.ArrayTypeMismatchException: Source array type cannot be assigned to destination array type.
 
@GlennTeitelbaum by the way, where do you specify /optimize+?
 
user1804599
8:28 AM
lol. fail.
 
btw be funny if he didn't specify /optimize+ on the C#
 
@Potatoswatter I could not parse that sentence
 
@rightfold yeah. runtime error. UGLY
 
user1804599
Being able to cast it to IEnumerable<object> is fine but to object[] is just retarded.
 
8:29 AM
@GlennTeitelbaum Oh, that one. That has zero effect
Just toggles static optimizations
 
@rightfold i remember reading an explanation as to why it was possible, do you want me to search for it
 
(where it hardly does any optimizations in the first place)
 
user1804599
Also requires additional runtime cost that could otherwise be avoided.
 
I thought you were talking about a flag for the JIT specifically
 
@GlennTeitelbaum /o is the short version of that?
 
8:30 AM
@rightfold it just plain sucks
 
@jalf C++ says dereferencing nullptr is UB. The CPU which implements the C++ memory model says it's a memory exception. UB in terms of a language spec may yet be defined by some other part of the platform.
 
usually -o is output
 
user1804599
@Potatoswatter compiler is allowed to completely optimise out dereferences of null pointers.
 
.NET is a platform, not a language, so it can be specific and define more cases. That's all.
 
@Potatoswatter but much UB isn't.
 
user1804599
8:31 AM
@user7236293 I wonder if this also works in F#.
 
@rightfold It's allowed to optimize out an entire function if it would be guaranteed to do such a thing as a side effect. UB means anything can happen.
 
@Potatoswatter How is that relevant though? That doesn't change the fact that C# is type-safe and C++ isn't, because C# prevents you from violating the type system, and C++ doesn't
 
@rightfold i know it works in java but hey, java
 
user1804599
> open System;;
> let ss = [| "Hello"; "World" |];;
val ss : string [] = [|"Hello"; "World"|]
> let os = ss :> Object;;
val os : Object = [|"Hello"; "World"|]
 
user1804599
I already find this highly amusing.
 
8:32 AM
@nightcracker Yes, and?
 
@Rapptz yup
 
9
A: Why are C# arrays covariant and what benefits does it bring?

mquanderEric Lippert says: Unfortunately, this particular kind of covariance is broken. It was added to the CLR because Java requires it and the CLR designers wanted to be able to support Java-like languages. We then up and added it to C# because it was in the CLR. This decision was quite controversi...

 
user1804599
Oh wait, I think arrays are immutable in F#.
 
> java requires it
so the shitstains of java got carried onto the clr
nice
 
@JerryCoffin don't get me wrong - I'm not trying to downplay Jim, but his cryptanalysis was outside of Kerckhoff's principle
I doubt the systems he studied were secure if they're innards were public
 
8:33 AM
@nightcracker how do you pronounce that
 
user1804599
@user7236293 Sounds like somebody’s got a case of the Javas.
 
@user7236293 sec
 
@jalf If you try to violate the type system, C++ gives you UB and .NET gives you an exception. C++ implementations could prevent you at a performance cost, but there isn't a market demand because that's not what C++ users want it to do.
 
@JBL aaaand he's french
 
JBL
8:34 AM
And why would it matter ?
:/
 
@nightcracker You clearly have no idea of most of the systems he studied then. Do some looking through sci.crypt and you'll find that although that particular analysis may have been the most famous, it's not even close to everything he's done.
 
@JBL Carnaud compatriotes doivent être soutenus !
 
lol, im being downvoted because C# sucks :)
 
@GlennTeitelbaum how objective, glem :)
@JerryCoffin stop winning arguments, Jerry
 
8:37 AM
@JerryCoffin excuse me, I never heard of the guy so I tried to find what I could (google, scholar)
 
JBL
@user7236293 They're just like anybody on this site. Either they deserve upboats for good content, or downvotes if they post shit.
 
@JBL it was, once again, only for the pun, that you didn't notice
sigh
 
JBL
@user7236293 It was meh :/
 
i cant be amazing all the time
 
JBL
But oh well.
Let's get back to why C# sucks and why C++ is awesome.
 
8:39 AM
@user7236293 I hope you enjoyed my sexy voice =D
 
JBL
(Lol, I don't know C#).
 
@nightcracker I am masturbating to it right now
 
@jalf Your views seem to be diametrically opposed to Skeet :(
 
What is self
 
wut
 
8:43 AM
@ScottW this
 
@Potatoswatter I know that. I don't see how it matters to the point I was making, which was not about performance, and not about platforms vs languages, and not about anythnig other than "C#'s type system is stronger than C++'s type system"
 
@JBL Start with C++ allows nested classes to retain locality, a.b.c is not really a->b->c
 
@GlennTeitelbaum Well, if he says otherwise, then I bow to that. He's usually right on matters .NET :)
 
so go upvote me for pulling rank :) He seems to use /o+
 
8:46 AM
@GlennTeitelbaum Well, yes, so did I when I used C#. Why wouldn't you? :p
a few static optimizations are better than no static optimizations
 
@nightcracker No excusing needed. I didn't mean it as an attack or anything like that. The simple fact is that cryptanalysis tends to be fairly unknown, and rarely leads to much fame. You're likely to be better known from designing one cipher than demolishing a dozen.
 
Do you agree with my interpretaion of stackoverflow.com/questions/3226157/… ?
 
@ScottW show your code
just the function prototype
 
Every time you write Lua a new Intel GPU is released on the market
 
it seems that without /o+ the JIT part just runs without optimization
 
8:48 AM
@GlennTeitelbaum you are talking about this answer, right? I don't see where that diametrically opposes what I said
 
Don't write Lua
 
@CatPlusPlus why don't you like Lua
 
He's saying exactly what I did: "most of the work happens in the JIT compiler, which you have little control over. You have /o+ which controls static optimizations, and is better than nothing, and that's it"
 
@CatPlusPlus What's wrong with Lua?
 
@ScottW show your fucking penis prototype
 
8:49 AM
Morning
 
hi
 
JBL
hi
 
Its this part that seems to say that /o+ is the gatekeeper for JIT optimizing --- If you want to see the difference each bit of optimization makes, there's one approach which could prove interesting:
•Compile the same code with and without optimization
 
8:50 AM
Stop
 
hi
 
fail, nice try Cat
 
fuck
I'm late
 
JBL
Poor @Mysticial.
 
@ScottW :facescott:
 
8:50 AM
@GlennTeitelbaum JIT is not a compile-time setting
 
use Python
fuck Lua
 
If Jit is just going to do the optimization anyways - then it shouldn't have been said to use /o+
 
@ScottW just use SomeClass:someMethod
 
@jalf Not surprising, really. By doing the optimization in the JIT, they develop the code once, and it applies to everything, in every language, that produces code for .NET.
 
JIT and IL optimisation are two different, unrelated things
 
8:51 AM
@GlennTeitelbaum that says nothing about the JIT. Read it again. It says "compile with and without /o+` and check the differences". It does not say "run the code"
 
instead of SomeClass.someMethod(self)
 
Lua's fine.
I don't get why everyone is shitting on it.
 
Except for the part where it doesn't enforce function signatures
 
@Rapptz not everyone is. just the usual shitters!
 
I will shit on every language that gets even basic safety wrong
 
8:53 AM
@user7236293 Yeah that's true. I should learn to filter it out mentally.
 
@jalf but why do that if JIT is just going to do the same opts? the test and the flag are redundant then
 
Your fault for not having any quality standards and just gobbling up anything
 
I apologise for understanding how functions work.
If I see a function with 3 parameters then I'll pass 3. Why would I pass 2? I'm not retarded.
function arguments default to nil
and functions are variadic by default
 
JBL
@ScottW But hey, you can look cool and say "This is shit", like the cool kids.
 
Are you obtuse on purpose or really can't see a problem with mistakes going potentially unnoticed
 
8:54 AM
both are dumb but if you're not dumb then it's not a huge issue
 
@Rapptz why do you even bother
@ScottW i though he was attempting arguing with the hairy mammal. oh wait.
 
No wonder software is so shitty, if this is something that has to be explained
Jesus
 
@GlennTeitelbaum because every optimization made by the static compiler is an optimization that the JIT doesn't need to spend time on. The JIT is in a hurry, because the user is sitting there tapping his fingers, waiting for the program to load
 
JBL
Cat makes me fear the day I'll get a new job...
 
fine - I'll change my answer to - because C# sucks ass
 
8:56 AM
But you are right to a large extent, and that is why the /o+ flag has very very little effect. It doesn't do more than a bare minimum of optimizations because they'll be done later by the JIT
 
JBL
I think I'm fine working with just my own code.
 
/o+ is probably just some peephole opts on the IR
 
0
Q: New menu bar increases click distance to SO chat

rubenvbThe new top bar increases my click distance from 2 to 3 clicks to get into my favourite Lounge. Note that bookmarks aren't a solution because this will trigger inevitable procrastination which I do not want to suffer from all day long. A proposed solution is to either use the available space in ...

 
@rubenvb That's not a bug
 
@CatPlusPlus FTR I'm agreeing with you that I think it's dumb. I honestly do think it's retarded but it's not such a big issue that I automatically consider the language to be garbage.
 
JBL
8:57 AM
 
problem is that removing for (int i = 0; i < 1 << 30; i++) ; is a peephole opt
 
I didn't say it's THE problem
 
JBL
But I fully approve.
 
the only other issue I have with lua is that you can pass float indices to tables.
 
8:58 AM
@GlennTeitelbaum What problem, with what, why
Why are you so concerned about C# compiler duplicating some of the JIT functionality
Are you working on it
 
oh and the lack of contextual const.
 
@CatPlusPlus no you're absolutely right, it's a
how do you format tags in chat?
 
[tag:stuff]
 
8:59 AM
got it. Thanks
 
@GlennTeitelbaum This what
 

« first day (1146 days earlier)      last day (3817 days later) »