RT GC [WAS Re: Bad programming considered harmless]

2001-02-05 Thread Shevek

On Mon, 5 Feb 2001, Paul Makepeace wrote:

> On Mon, Feb 05, 2001 at 10:42:08PM +, Shevek wrote:
> > I later prove that it is possible to do a hard real time reference
> > counting garbage collector,
> 
> I've heard of implementations of hard real time GCs but they're
> ultra-slow.  Can you prove one comparably as fast as a non-real
> time one is possible?  Constant factors are killers :-)
> 
> Paul

Oh yes :-) But allocation is N time for a block size N, and memory
overhead is one pointer per block. I implemented it for cons cells, it was
beautiful, but one pointer per cons is a lot. However, it was hard real
time.

S.

--
Shevek
I am the Borg.
sub AUTOLOAD { ($s=$AUTOLOAD)=~s/.*:://; eval qq{ *$AUTOLOAD=$s
?sub {$s*&{$s-1}} :sub {1}; }; goto &$AUTOLOAD; } print &{'4'}; 




Re: Bad programming considered harmless

2001-02-05 Thread Paul Makepeace

On Mon, Feb 05, 2001 at 10:42:08PM +, Shevek wrote:
> I later prove that it is possible to do a hard real time reference
> counting garbage collector,

I've heard of implementations of hard real time GCs but they're
ultra-slow.  Can you prove one comparably as fast as a non-real
time one is possible?  Constant factors are killers :-)

Paul



Re: Bad programming considered harmless

2001-02-05 Thread Shevek

On Mon, 5 Feb 2001, Mark Fowler wrote:

> As for the real time nature of garbage collectors, Shevek and I (and some
> others) wrote a paper together on this, so I could say a lot here.
> Especially about how Perl is much more real time as it can do better at
> allocating and deallocating the same bit of memory (as it instantly
> knows when memory is free, unlike mark and sweep) and is a lot less likely
> to cause page faults.  Of course, reference counting suffers from the
> dreaded deep free problem so if you don't program carefully you can very

I later prove that it is possible to do a hard real time reference
counting garbage collector, without the deep free problem, and without a
fallback mark and sweep. However, the other problems, including reference
cycles, still exist. Allocation time could be time proportional to the
requested region size, but that's fine as you can control allocation.

> very easily shoot yourself in the time constraint foot too.

Didn't we also manage mark and sweep in something approximating real time
with a high enough hard constant? I've been looking at a lot more systems
since then, region inference is interesting. You can free data which isn't
actually unreferenced. :-) Scary.

S.

--
Shevek
I am the Borg.
sub AUTOLOAD { ($s=$AUTOLOAD)=~s/.*:://; eval qq{ *$AUTOLOAD=$s
?sub {$s*&{$s-1}} :sub {1}; }; goto &$AUTOLOAD; } print &{'4'}; 




Re: Bad programming considered harmless

2001-02-05 Thread Mark Fowler

> > Look at what Sun says Java is not suitable for to get a short list. IIRC
> > they included stuff such as life support machinery in hospitals, air traffic
> > control, and nuclear reactors. Space Shuttle or manned-space-flight rocket
> 
> I think this is primarily because Java is not a real-time language (as
> in specifiable bounded time for each operation) on account of Java
> insisting on providing garbage collection which is almost impossible to
> do efficiently in real time.

This is primarily because the code that makes up Java hasn't ever been
proven (in a maths sense) to work.  GCC comes with the following
disclaimer too:

this program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

As for the real time nature of garbage collectors, Shevek and I (and some
others) wrote a paper together on this, so I could say a lot here.
Especially about how Perl is much more real time as it can do better at
allocating and deallocating the same bit of memory (as it instantly
knows when memory is free, unlike mark and sweep) and is a lot less likely
to cause page faults.  Of course, reference counting suffers from the
dreaded deep free problem so if you don't program carefully you can very
very easily shoot yourself in the time constraint foot too.

> > control logic probably should also be bug free.
> 
> 

That's an implementation problem.  Control logic problems are ones like
'The spacecraft doors shall not be able to be opened manually and shall
remain in computer control incase human error causes the inside to be
depressurised' and then not realising that in some situations you need to
be able to open them both (e.g. internal fire, meteor strike, HAL going
nuts)

Most problems are control logic problems.  The computer implementation 
ones make better reading though...

Later.

Mark.

P.S. Scary thought: During a transatlantic flight on average cosmic 
radiation flips at least one bit of the control systems memory.

-- 
print "\n",map{my$a="\n"if(length$_>6);' 'x(36-length($_)/2)."$_\n$a"} (
   Name  => 'Mark Fowler',Title => 'Technology Developer'  ,
   Firm  => 'Profero Ltd',Web   => 'http://www.profero.com/'   ,
   Email => '[EMAIL PROTECTED]',   Phone => '+44 (0) 20 7700 9960'  )









Re: Bad programming considered harmless

2001-02-04 Thread Paul Makepeace

On Fri, Feb 02, 2001 at 06:56:02PM +0100, Philip Newton wrote:
> Look at what Sun says Java is not suitable for to get a short list. IIRC
> they included stuff such as life support machinery in hospitals, air traffic
> control, and nuclear reactors. Space Shuttle or manned-space-flight rocket

I think this is primarily because Java is not a real-time language (as
in specifiable bounded time for each operation) on account of Java
insisting on providing garbage collection which is almost impossible to
do efficiently in real time.

> control logic probably should also be bug free.



Paul



Re: Bad programming considered harmless

2001-02-03 Thread Elaine -HFB- Ashton

Michael Stevens [[EMAIL PROTECTED]] quoth:
*>
*>"Corn syrup" still sounds like something that would taste of wheat. I
*>was talking to someone on a talker about this today, but they said they hadn't
*>found anything in the UK yet that included it, so I have no reference
*>whatsoever for what it is, apart from the fact I'm told it's sugary.

Corn Syrup, used in place of oil, will suffice as an oil substitute
*once*...meaning that once the engine is all nice and hot, it's fine while
the sugar carmelises...once the engine cools however, you have a very nice
worthless chunk of metal. :) 

*>(pedantry: There *are* applications where bad programming could kill. I
*>don't think any of us work in them, but I'm pretty sure they exist.)

Sure, but they probably aren't in the market for 'Perl for Dummies'
eitheror, if they are, Darwin is going to have a good day. :)

e.



Re: Bad programming considered harmless

2001-02-02 Thread Aaron Trevena


> There is nothing wrong with bad programming. Sure, don't pay for it, sure
> don't use it for anything important or anything that will affect other
> people's lives. But lots of people get satisfaction and reward from making
> bad programs, just like they get satisfaction from singing badly in the
> shower, doing some bad gardening on a Sunday, and putting up a set of wonky
> shelves. Let's have more people programming badly!

That is beautiful. I may have to put it somewhere on a page and let the
meme spread freely..
 
> Expertism is a dangerous trend. A little knowledge is _not_ a dangerous
> thing. The only dangerous thing is not knowing the _extent_ of your (little)
> knowledge.

Definately.

A.

-- 
http://termisoc.org/~betty"> Betty @ termisoc.org 
"As a youngster Fred fought sea battles on the village pond using a 
complex system of signals he devised that was later adopted by the Royal 
Navy. " (this email has nothing to do with any organisation except me)






Re: Bad programming considered harmless

2001-02-02 Thread James Powell

On Fri, Feb 02, 2001 at 06:56:02PM +0100, Philip Newton wrote:
> Michael Stevens wrote:
> > (pedantry: There *are* applications where bad programming 
> > could kill. I don't think any of us work in them, but I'm
> > pretty sure they exist.)
> 
> Look at what Sun says Java is not suitable for to get a short list. IIRC
> they included stuff such as life support machinery in hospitals, air traffic
> control, and nuclear reactors. Space Shuttle or manned-space-flight rocket
> control logic probably should also be bug free.

Perhaps this is why there isn't "Nuclear Reactor Control: Visual Quickstart
Guide".

A gap in the market?


jp



Re: Bad programming considered harmless

2001-02-02 Thread Philip Newton

Michael Stevens wrote:
> (pedantry: There *are* applications where bad programming 
> could kill. I don't think any of us work in them, but I'm
> pretty sure they exist.)

Look at what Sun says Java is not suitable for to get a short list. IIRC
they included stuff such as life support machinery in hospitals, air traffic
control, and nuclear reactors. Space Shuttle or manned-space-flight rocket
control logic probably should also be bug free.

Cheers,
Philip



Re: Bad programming considered harmless

2001-02-02 Thread Michael Stevens

On Fri, Feb 02, 2001 at 11:33:24AM -0600, Elaine -HFB- Ashton wrote:
> Michael Stevens [[EMAIL PROTECTED]] quoth:
> *>My problem with some of the CGI stuff is that it sounds like the
> *>equivalent of a mechanic saying "well, when changing oil, it's not
> *>that important what you put in - any oily liquid will work"[1].
> You could try corn syrup...once. :)

"Corn syrup" still sounds like something that would taste of wheat. I
was talking to someone on a talker about this today, but they said they hadn't
found anything in the UK yet that included it, so I have no reference
whatsoever for what it is, apart from the fact I'm told it's sugary.

(apparently some countries put it in cola).

(pedantry: There *are* applications where bad programming could kill. I
don't think any of us work in them, but I'm pretty sure they exist.)

Michael



Re: Bad programming considered harmless

2001-02-02 Thread Elaine -HFB- Ashton

Michael Stevens [[EMAIL PROTECTED]] quoth:
*>
*>My problem with some of the CGI stuff is that it sounds like the
*>equivalent of a mechanic saying "well, when changing oil, it's not
*>that important what you put in - any oily liquid will work"[1].

You could try corn syrup...once. :)

e.



Re: Bad programming considered harmless

2001-02-02 Thread Elaine -HFB- Ashton

David Cantrell [[EMAIL PROTECTED]] quoth:
*>
*>Agreed.  However, if "Programming Perl for Dummies" tells you things that
*>are Just Plain Wrong - like there's no need for strict, -w or -T - then
*>the book does more harm than good.

If I had a nickel for every person who whinged on about how horrible these
books are I'd have enough money to buy a publisher.

TELL THE PUBLISHERS. Offer your editorial services, send them errata, get
them involved. Whinging does absolutely nothing, actually, worse than
nothing as it gets my panties in a bunch. Attack the source, not the
choir. If they are so dangerous to the Perling public campaign to get
bookstores to remove them from the shelves, publishers to fix them or get
a different author to correct/rewrite them.

And, put things in perspective, noone is going to die from programming
poorly. So, their box might get rooted, hacked, etc. Unless you are a big
bank or somesuch where you can afford skilled people, it's probably not
mission critical either. In other words, do what you can to inform the
publishers how to fix their books, launch a campaign to explicitly
educate the buying public on various Perl books, submit errata, be a tech
editor, etc. the world is not coming to an end, please remain calm.

Someone could also begin by turning an eye to our very own FAQ, the Perl
FAQ that hasn't been really given a good going over in about a year or
more yet has languished in the unsexy domain of documentation you can
bitch about and not help fix since Perl6 will make everything magically
delicious. 

The only thing more ignorant than ignorance is critical apathy.

*>Programming is not easy.  Authors who make people think it is easy should
*>be hurt.  A lot.  Because the ignoramus pseudo-programmers for which they
*>are responsible cause me a lot of trouble.

Boy, you're going to love the upcoming title 'Instant Perl Modules'. I
wrote the publisher to ask if water would be included with the book and
the slogan 'just add water' on the front cover. :)

e.



RE: Bad programming considered harmless

2001-02-02 Thread Jonathan Peterson


>
> Agreed.  However, if "Programming Perl for Dummies" tells you
> things that
> are Just Plain Wrong - like there's no need for strict, -w or
> -T - then
> the book does more harm than good.

Agreed. Bad teaching is inexcusable and leads only to harm.

> If they keep their bad programming to their own boxes, and their bad
> programming doesn't open their boxes up for script kiddies to
> mount DDoS
> attacks on me, then I don't have a problem with it.  Oh, and
> if they don't
> come whining and expecting me to fix their fuckups.

Yes and no. Personally, I get annoyed as the next person by having to fix
stupid mistakes. But, there is a general BOFH-like holier than thou attitude
that pervades the computer industry, which classifies lusers as dangerous
fools until they prove themselves worthy. This is a bad thing. Fools do not
need to be suffered gladly, but they need to be educated not beaten. See
also the mess that was (is?) p5p. Many people in our business justify
elitism by calling it meritocracy.





RE: Bad programming considered harmless

2001-02-02 Thread Jonathan Peterson

> You could argue that irregular shaped bolts is an effort to 
> save people
> from themselves.
> 

Yah. Like Java saves you from procedural programming :-)






Re: Bad programming considered harmless

2001-02-02 Thread Michael Stevens

On Fri, Feb 02, 2001 at 12:25:09PM -, Jonathan Peterson wrote:
> No, I disagree. This is like a mechanic saying "You really oughtn't to
> change your own oil, oil is very important, if you get it wrong you could
> really damage your engine, that sort of thing should be left to a qualified
> mechanic". It's complete crap. Changing the oil in car is not that hard.
> Until recently, most car owners would expect to do it themselves, along with
> changing spark plugs and various other tasks.

My problem with some of the CGI stuff is that it sounds like the
equivalent of a mechanic saying "well, when changing oil, it's not
that important what you put in - any oily liquid will work"[1].

You might happen to end up with a car that runs, but it's still not the
advice people should be giving out...

Michael

[1] I Am Not A Mechanic. if this is not actually a silly idea, imagine
I suggested something else that is.



Re: Bad programming considered harmless

2001-02-02 Thread David Cantrell

On Fri, Feb 02, 2001 at 12:47:39PM +, Struan Donald wrote:

> you have to teach them some theory of good programming, as at the end
> of the day it _will_ make their lives easier.

More importantly, it'll make *our* lives easier :-)

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david/

   Any technology distinguishable from magic is insufficiently advanced

** I read encrypted mail first, so encrypt if your message is important **

 PGP signature


Re: Bad programming considered harmless

2001-02-02 Thread Struan Donald

* at 02/02 12:25 - Jonathan Peterson said:
> >
> > > However, I don't question the plumber's competence, or
> > indeed pretend to
> > > anyone including myself that I can do a good job of it.
> > The same should
> > > apply to programming.  If I were to try my hand at
> > re-plumbing my kitchen,
> > > I know I'd make a god-awful mess, and I am intelligent enough to not
> > > attempt it.  The great unwashed should approach programming
> > the same way.
 

 
> Expertism is a dangerous trend. A little knowledge is _not_ a dangerous
> thing. The only dangerous thing is not knowing the _extent_ of your (little)
> knowledge.

and here is the flaw. it's teh knowing the extent of your knowledge
that's the hard part and the bit that the learn perl while you wait
for the kettle to boil type books don't seem (IMO) very good at
instilling. I'm all for trying to get more people to program perl or
any other language but at the same time i'd like it to be done in a
sensible way.

not only as having bad perl floating about there isn't a good thing,
also 'cause if you teach someone bad habits then if they continue they
are going to have to unlearn them all, or things will be harder than
they should be and they're more likely to get disgruntled.

we have enough problems with people looking at perl and thinking "mmm,
that looks hard, i'll learn python" without having them 'learn' perl
then discover half of what they learnt is bad perl. 

you have to teach them some theory of good programming, as at the end
of the day it _will_ make their lives easier.

struan



Re: Bad programming considered harmless

2001-02-02 Thread David Cantrell

On Fri, Feb 02, 2001 at 12:25:09PM -, Jonathan Peterson wrote:

> No, I disagree. This is like a mechanic saying "You really oughtn't to
> change your own oili ...

If the user doesn't know how to check their oil levels, what grade of oil
is needed and so on, then yes, they shouldn't be doing it themselves.
Any good mechanic probably would tell people not to do it themselves if
the user lacked that basic knowledge, cos they could really screw up their
car.  People who lack basic programming knowledge should be told not to
do anything dangerous either.

> Programming should be made accessible to the general public and the amateur.

Agreed.  And it is.

> The various "Programming Perl for Dummies" books are ultimately a GOOD
> THING, because for every crap free perl script on the web there is a good
> script that would never have been written if its author had not found it
> possible to get into programming.

Agreed.  However, if "Programming Perl for Dummies" tells you things that
are Just Plain Wrong - like there's no need for strict, -w or -T - then
the book does more harm than good.

> There is nothing wrong with bad programming. Sure, don't pay for it, sure
> don't use it for anything important or anything that will affect other
> people's lives.

If they keep their bad programming to their own boxes, and their bad
programming doesn't open their boxes up for script kiddies to mount DDoS
attacks on me, then I don't have a problem with it.  Oh, and if they don't
come whining and expecting me to fix their fuckups.

> But lots of people get satisfaction and reward from making
> bad programs, just like they get satisfaction from singing badly in the
> shower, doing some bad gardening on a Sunday, and putting up a set of wonky
> shelves. Let's have more people programming badly!
> 
> Expertism is a dangerous trend. A little knowledge is _not_ a dangerous
> thing. The only dangerous thing is not knowing the _extent_ of your (little)
> knowledge.

And there lies the problem.  Why do people who know enough to change their
oil still consult an expert for anything serious, whereas all it takes is
reading "Teach Yourself Programming In 10 Days" to make someone think they
know enough to go doing stuff they *really* shouldn't?

Programming is not easy.  Authors who make people think it is easy should
be hurt.  A lot.  Because the ignoramus pseudo-programmers for which they
are responsible cause me a lot of trouble.

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david/

   Any technology distinguishable from magic is insufficiently advanced

** I read encrypted mail first, so encrypt if your message is important **

 PGP signature


Re: Bad programming considered harmless

2001-02-02 Thread Simon Wistow

Jonathan Peterson wrote:

> There is nothing wrong with bad programming. 

There is however lots of thinsg wrong with teaching bad pregramming.

Whilst I agree with you to a certain extent about cars a less sinister
explanation is that cars *ARE* getting hideously compilcated with
variable valve timings and ECU chips. Whilst chaning your oil is not
hard or even changing the spark plugs there is a lot of potential to go
wrong. 

You could argue that irregular shaped bolts is an effort to save people
from themselves.



Bad programming considered harmless

2001-02-02 Thread Jonathan Peterson

>
> > However, I don't question the plumber's competence, or
> indeed pretend to
> > anyone including myself that I can do a good job of it.
> The same should
> > apply to programming.  If I were to try my hand at
> re-plumbing my kitchen,
> > I know I'd make a god-awful mess, and I am intelligent enough to not
> > attempt it.  The great unwashed should approach programming
> the same way.

No, I disagree. This is like a mechanic saying "You really oughtn't to
change your own oil, oil is very important, if you get it wrong you could
really damage your engine, that sort of thing should be left to a qualified
mechanic". It's complete crap. Changing the oil in car is not that hard.
Until recently, most car owners would expect to do it themselves, along with
changing spark plugs and various other tasks.

Now, car makers are falling over themselves to make it harder and harder for
these dangerous amateurs to fiddle with the engine. The introduction of
specialised components (such as bolts that require wrench sockets only
available to authorised repair shops), and the removal of the necessary
documentation from the general public, and various warranty clauses in
insurance and guarantee documentation all contribute to this. Sound
familiar?

Programming should be made accessible to the general public and the amateur.
The various "Programming Perl for Dummies" books are ultimately a GOOD
THING, because for every crap free perl script on the web there is a good
script that would never have been written if its author had not found it
possible to get into programming.

There is nothing wrong with bad programming. Sure, don't pay for it, sure
don't use it for anything important or anything that will affect other
people's lives. But lots of people get satisfaction and reward from making
bad programs, just like they get satisfaction from singing badly in the
shower, doing some bad gardening on a Sunday, and putting up a set of wonky
shelves. Let's have more people programming badly!

Expertism is a dangerous trend. A little knowledge is _not_ a dangerous
thing. The only dangerous thing is not knowing the _extent_ of your (little)
knowledge.

Here endeth the rant.