Language:
switch to room list switch to menu My folders
Go to page: First ... 55 56 57 58 [59] 60 61 62 63 ... Last
[#] Wed Aug 04 2010 21:40:59 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

memory model: value types, and reified generics. The importance of
reified generics can't be overstated; it really cuts down on runtime

erm... I do so enjoy reading up on all this stuff you throw our way, that's my new way of keeping up with my resume acronyms, but having read exactly 2 paragraphs on the subject I am now an authority, so let's debate for a minute exactly why C#'s way is better.
I mean from a design point of view, sure it's better that it's part of the entire system design and not just a language feature, but if I'm reading it right, java throws out all the generic type stuff (which is fine by me) and doesn't put it in the byte code and C# does.
So C# has to spend more time dealing with generic types at runtime.
How is this better? (you know me, it's all about performance)
I'm probably not getting the whole picture, but if all generic goofyness for a type simplifies to the same thing in java, and doesn't in C# doesn't that just make C# code more bloaty while functionally doing the same thing?
If the compiler has verified that everything is type safe, why waste runtime cpu dealing with it at all?

[#] Thu Aug 05 2010 02:39:04 EDT from dothebart @ Uncensored

Subject: Re:

[Reply] [ReplyQuoted] [Headers] [Print]

I remember the see-carpet pet-shop being 1/3rd loc of the java petshop.



[#] Thu Aug 05 2010 19:08:09 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Java generics can generalize over object types, only. They can't generalize over primitives (they handle that case by autoboxing primitives to objects) and they can't generalize over value types, because java doesn't have value types.

So in Java, you can never define a "struct foo" and an array of struct foo, and have that array be stored as a linear list of struct foos all inline, it has to be an array of pointers to object foo instead. My understanding is that C# can do that... and the collection classes can also do this in a generic fashion. The memory overhead can be a rather large constant multiplier. Collection traversal is also quite a bit slower..


So, C# can do this because it preserves the type information at runtime, which allows it to basically treat generic classes as templates if it decides that it's necessary.

[#] Thu Aug 05 2010 19:08:31 EDT from LoanShark @ Uncensored

Subject: Re:

[Reply] [ReplyQuoted] [Headers] [Print]

Aug 5 2010 2:39am from dothebart @uncnsrd
Subject: Re:
I remember the see-carpet pet-shop being 1/3rd loc of the java
petshop.


probably mostly because of properties vs setters/getters.

[#] Fri Aug 06 2010 11:18:41 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

So, C# can do this because it preserves the type information at
runtime, which allows it to basically treat generic classes as
templates if it decides that it's necessary.

C# can do that as a result of the fact that java doesn't have value types. Forget the generics for a second, I gather C# can also line up an array of whatever objects in memory, and java can't simply because java was not designed to allow for that. The generics just make doing that with random types possible, but the actual flaw (limitation whatever) is in the everything-is-an-object-except-for-the-primitive-types-hack design of java.

[#] Fri Aug 06 2010 16:14:51 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I think the primitive types should be objects, and the syntax should be simple enough that you can use objects like you can use primitives so that you won't need a separate hack for primitives just to make the language usable.

[#] Fri Aug 06 2010 16:15:15 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Heh, I suppose you could do that with operator overloading. :-)))

[#] Fri Aug 06 2010 16:38:09 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


That's the way Scala does it, on both counts.

[#] Sun Aug 08 2010 15:58:26 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Without having 2 paragraphs to read, is scala's syntax easy?
Oh, but it's a sloppy language right? not big on types?

[#] Mon Aug 09 2010 18:03:30 EDT from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


The syntax will probably take some getting used to. The fundamental idea is: (a) every construct should be as general as possible; (b) everything is an expression.

(a) requires some meditation and long explanation, but
(b) allows you to do things like this:


val myvariable =
if (something) then
1
else
2

or even:

val transformedList =
for (x <- someOtherList)
yield x.someProperty

It's not a sloppy language, it's a strong/static type system that closely resembles Java's, with a few differences. They have added a form of structural typing (aka duck typing) for classes that is statically checked at compile time. In other words, you can declare "this parameter accepts any object that defines fields named x and y", and this will be statically checked at compile time (not to be confused with Objective-C/Smalltalk like systems where all such checking is at runtime.)

Function types are also structural types (as opposed to nominal types as in C# with its delegate types.) Function types don't have names, they just declare a matching signature, and are statically type checked.

You might look at "val myvariable" above and think "that looks like a sloppy language." But behind the scenes, the compiler knows the type of "myvariable" at compile time, via type inference. (There are several situations where you must declare the type when the compiler can't figure it out on its own.)

The IDE has a mouse hover to indicate the type of a variable.

[#] Mon Aug 09 2010 21:16:18 EDT from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

You might look at "val myvariable" above and think "that looks like a

sloppy language." But behind the scenes, the compiler knows the type of

"myvariable" at compile time, via type inference. (There are several

That's fair. As long as that's what actually happening, and later in the function the compiler can bitch when you assign something of the wrong type to it. I'm not such a nazi that everything has to be spelled out, just that the Right Thing is going on in the Right Places.

[#] Thu Aug 26 2010 14:07:01 EDT from IGnatius T Foobar @ Uncensored

Subject: Re:

[Reply] [ReplyQuoted] [Headers] [Print]

Doesn't XP use NTFS? Does NTFS still maintain 8.3 filenames somewhere for some weird level of compatibility?

[#] Thu Aug 26 2010 15:43:16 EDT from Ford II @ Uncensored

Subject: Re:

[Reply] [ReplyQuoted] [Headers] [Print]

I thought that went out with 95/me.
I haven't seen a 8.3 compatible filename in years.

[#] Thu Aug 26 2010 15:58:34 EDT from Freakdog @ Dog Pound BBS II

Subject: Re:

[Reply] [ReplyQuoted] [Headers] [Print]

 

Thu Aug 26 2010 03:43:16 PM EDT from Ford II @ Uncensored Subject: Re:
I thought that went out with 95/me.
I haven't seen a 8.3 compatible filename in years.

You haven't used a program that doesn't understand long filenames, then.

I still see the occasional "FILENA~1.TXT" or some such.



[#] Thu Aug 26 2010 16:06:36 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

NTFS supports long and short filenames, yes.   XP can also use FAT-32 if it must.

Microsoft Installer file are fun because of this long/short filename nonsense.



[#] Thu Aug 26 2010 16:38:08 EDT from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


#fail


[#] Thu Aug 26 2010 17:12:39 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Hmm... something like:

failure|fail~1:failure|fail~1



[#] Thu Aug 26 2010 17:14:01 EDT from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

(In MSI land, the first half of the : represents the target path, while the last half is the source path.  The first half of the | is the long filename, with the second half as the short filename.  And another column represents the parent path name, or a property that fills in that value).



[#] Fri Aug 27 2010 12:18:44 EDT from Sig @ Uncensored

Subject: Re:

[Reply] [ReplyQuoted] [Headers] [Print]

You haven't used a program that doesn't understand long filenames,
then.

I still see the occasional "FILENA~1.TXT" or some such.

The program I use to submit pay for my soldiers on the drill weekend uses DOS filenames. Of course, it's a DOS program; it also asks me to insert a floppy disk for the backups.

Go to page: First ... 55 56 57 58 [59] 60 61 62 63 ... Last