Subject: RE: [hackers-il] How do you choose your programming language ?

From: "Tzahi Fadida" <[email-masked]>
Date: Mon, 28 Nov 2005 23:10:37 +0200

> -----Original Message-----
> From: [email-masked] 
> [mailto:[email-masked]] On Behalf Of Nadav Har'El
> Sent: Thursday, November 24, 2005 12:53 AM
> To: [email-masked]
> Subject: Re: [hackers-il] How do you choose your programming 
> language ?
> 
> On Wed, Nov 23, 2005, Tzahi Fadida wrote about "RE: 
> [hackers-il] How do you choose your programming language ?":
> > I am not sure you are correct. I believe that in latest 
> java there is a trick with
> > the classloader that you can allocate and free objects, 
> however I heard
> > that it can lead to memory leak (whats new).
> 
> Any language is Turing-complete, and if you realy try very 
> hard, you CAN
> allocate and free memory, perhaps by using class-loaders, or 
> perhaps by
> using JNI (i.e., C code). But doing this is extremely 
> complex, and goes
> against the entire design of the language. It's almost like 
> buying a plane,
> and then taking off its wings and trying to modify its engine 
> to be more
> fuel-efficient - why don't you buy a car instead?
> Nobody programs the way you describe in Java, except perhaps 
> as an excercise.
> If someone wants to write this way, they just switch to C or whatever.

I didn't claim to program like that. Just said its possible if so insistant.

> 
> > I also heard that there are alternative
> > GC and that there are calls that can expedite GC.
> 
> For the object creation patterns that are common in Java 
> (myriads of short-
> lived objects, Java's current GC ("hotspot") is extremely 
> efficient in speed,
> because allocations are extremely quick (no need to "search 
> the heap" for
> holes like in C, just increment the pointer), even in a multi-threaded
> program, and free doesn't take any time (the time of GC is 
> not proportional
> to the number of dead objects, but rather to the number of 
> living objects).
> 
> I wonder, though, if anybody attempted to do a 
> reference-counting GC for
> Java (do you know of such a thing?). It would have been much 
> slower than the
> current GC, but perhaps waste much less memory. For many applications,
> this could have been a win.
> 
> > Anyway, as I mentioned before there are native compilers 
> that makes all these
> > a mute discussion, e.g. GCJ. And, its FOSS.
> 
> I completely fail to understand this statement. Please enlighten me.
> Even if gcj compiles codes, it still has to use garbage 
> collection, because
> in Java all parameters are "passed by reference" (except for 
> primitive types
> like "int"), and anybody can save these references and use 
> them later, and
> stop using them much later. Except a few optimizations (like 
> immediately
> freeing an object which was never passed anywhere), I don't 
> see what you
> can do to improve memory waste by dead objects. And these 
> optimizations
> are not specific to a compiler, anyway.

At least in my weak understanding of the matter, when you don't use
JVM you don't need to allocate in advance the memory and thus
when it is free, it is freed back to the os. So it is not a memory hog
when used like that.

> 
> > Personally the most important reason I like JAVA is that 
> you can find the bugs quickly
> > and develop quickly using Jbuilder which is the best 
> (although you have to pay).
> 
> I use eclipse, which is probably the most convenient 
> development environment
> I've seen. I agree, it's much more fun to program in Java 
> than in C or C++.
> BUT, the sad truth is that often when you finish the project 
> and see how
> the result behaves, you wish you spent the time on writing 
> the project in
> a different language :(

I was working the last week on an experiment (hence why I didn't reply sooner),
and I am writing the experiment in C for the last few months. The experiment
uses the hd as a storage device for temporary data.

Another small and very simple experiment was done on parrallel, in fact I had no
knowledge of it till a month ago, using java and uses only main memory.

My C program took it with ease, while the java program got nowhere even when
we traded secrets. So I can understand your point indeed!

Another example are those design programs written in java lately, compared to
the fast rational rose. So this kind of program I wouldn't write in java.

However, forms to databases and tasks that require less efficiency are better written
in a more bug proof enviroment than C, which I understand you agree with me.

Another advantage with C is the compiler. While utilizing the compiler options I manage
to shave off a few secs from the run of the experiment, which I doubt I could have done using java.
But again, efficiency is not my point.

> 
> Ok, that has been the end of my gripes about Java for today. Sorry :-)
> 
> 
> -- 
> Nadav Har'El                        |   Thursday, Nov 24 
> 2005, 22 Heshvan 5766
> [email-masked]             
> |-----------------------------------------
> Phone +972-523-790466, ICQ 13349191 |Time is the best 
> teacher. Unfortunately
> http://nadav.harel.org.il           |it kills all its students.
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~--> 
> Get fast access to your favorite Yahoo! Groups. Make Yahoo! 
> your home page
> http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/saFolB/TM
> --------------------------------------------------------------
> ------~-> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
>

---

From: "Tzahi Fadida" <[email-masked]>
Date: Mon, 5 Dec 2005 20:21:27 +0200

Does any1 knows where I can get a hit counter.
Nothing fancy, I want to put it in my technion site.
I have perl support there if needed.

if it's a web service from some company, I prefer a free
and open source related one if possible.

10x.

Regards,
	Tzahi.
--
Tzahi Fadida
http://tzahi.blogsite.org | http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at http://members.lycos.co.uk/my2nis/spamwarning.html

---

From: "Tzahi Fadida" <[email-masked]>
Date: Mon, 5 Dec 2005 20:54:00 +0200

To any one interested pop2sms was updated and now resistant to sms storms.

http://tx.technion.ac.il/~tzahi/#pop2sms

Regards,
	Tzahi.

---

From: Shlomi Fish <[email-masked]>
Date: Mon, 5 Dec 2005 21:25:15 +0200

Hi Tzahi!

Please don't post new messages to the list by replying to existing messages. 
Instead write a new message to [email-masked] (optionally using 
an Address Book or a "New Message To" an address feature.

Regards,

	Shlomi Fish

On Monday 05 December 2005 20:21, Tzahi Fadida wrote:
> WARNING TO SPAMMERS:  see at
> http://members.lycos.co.uk/my2nis/spamwarning.html
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>

-- 

---------------------------------------------------------------------
Shlomi Fish      [email-masked]
Homepage:        http://www.shlomifish.org/

95% of the programmers consider 95% of the code they did not write, in the
bottom 5%.