From: [Jongware] on
Richard Bos wrote:
> dj3vande(a)csclub.uwaterloo.ca.invalid wrote:
>
>> Nick Keighley <nick_keighley_nospam(a)hotmail.com> wrote:
>>> On 13 Jan, 16:43, dj3va...(a)csclub.uwaterloo.ca.invalid wrote:
>>>> Unix people call this a "shell".
>>> I'm guessing you're trying to be funny/ironic. But in case you aren't,
>>> Unix has dozens of stranglely incompatible Command Line Interfaces
>>> that Unix people call "shells". None of them are word processors.
>> Right.
>> But all of them have the property that I can get a word processor by
>> typing the name of a word processor that's installed on the system.
>>
>> My point was that the "primitives" provided by a shell (the programs
>> installed on the system) give a pretty good approximation to
>> [Jongware]'s suggestion of "type 'word processor' and get a word
>> processor".
>
> That is an iffy comparison, because you need to install the word
> processor separately from the shell before you can call it. In other
> words, the programs you install are much more like third-party libraries
> in a programming language, not like the primitives. In this respect, a
> normal programming language like C is no different from a shell: from C,
> you can also call the function process_words() - or if you wish,
> system("wordprocessor");

It was a deliberate exaggeration, referring to the OP's idea: a compiler
sees someone struggling with an unsigned array of characters, save and
load routines, and display and edit stuff. On compiling, it simplifies
the entire program to "system("wordprocessor);"

Compilers can use clock cycle optimizations to speed up programs -- and
it optimizes *everything* -- where a human could eyeball it and speed up
an entire program by using a different algorithm for a single routine. I
can't see how counting clock cycles could do *that*!

Oh, apart from a genetic algorithm that simply tries out everything, or
a smarter compiler that *can* infer O(n) count from looking at code.

Perhaps it'll also understand "Tea -- Earl Grey, hot."

[Jw]
From: Josef Moellers on
karthikbalaguru wrote:

> My query is 'A tool that suggests
> optimized logic for a piece of
> code/module/function' . I am

Define "optimized"!

Optimized for speed, optimized for memory requirement, optimized to
handle extreme situations, optimized to handle easy situations?

You can try explaining "optimized" to a human being. Then try to eplain
that to a computer program.

Josef
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef M�llers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html
From: Nick on
karthikbalaguru <karthikbalaguru79(a)gmail.com> writes:

> On Jan 26, 3:51 pm, Josef Moellers <josef.moell...(a)ts.fujitsu.com>
> wrote:
>> karthikbalaguru wrote:
>> > My query is 'A tool that suggests
>> > optimized logic for a piece of
>> > code/module/function' . I am
>>
>> Define "optimized"!
>>
>> Optimized for speed, optimized for memory requirement, optimized to
>> handle extreme situations, optimized to handle easy situations?
>>
>
> Exactly !
> The tool should support
> for memory based optimization

Optimised for line width, apparently.
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
From: David Brown on
karthikbalaguru wrote:
> On Jan 26, 3:51 pm, Josef Moellers <josef.moell...(a)ts.fujitsu.com>
> wrote:
>> karthikbalaguru wrote:
>>> My query is 'A tool that suggests
>>> optimized logic for a piece of
>>> code/module/function' . I am
>> Define "optimized"!
>>
>> Optimized for speed, optimized for memory requirement, optimized to
>> handle extreme situations, optimized to handle easy situations?
>>
>
> Exactly !
> The tool should support
> for memory based optimization
> that greatly helps in memory/
> cost constraint systems,
> speed based optimization that
> greatly decides the performance
> in certain projects, perfect
> algorithm/logic required for a
> particular scenario, and other
> optimization techniques applicable.
> It should probably have an option
> that could decide the type of
> optimization required for the user
> for the particular module. May
> be there can be an option called
> 'general optimization' that would
> apply all optimization techniques
> to a certain level only in a
> balanced manner.
>
> If the user is particular about
> certain particular optimization,
> Once the type of optimization
> is got as input from the user,
> even the level of optimization can
> be got from the user by having
> some flags/options for defining
> different levels of optimization .
>
> It could also tell the bottlenecks
> in the code and that would greatly
> help in optimizing the right piece
> of code. Maybe a profiler should
> also be part of it. The tool can
> also display graphs that could
> give comparitive analysis of
> speed improvement vs memory
> usage vs various levels of various
> kinds of optimization techniques.
>
> It can also suggest the best
> possible number of threads
> required, message queues
> required for a particular
> logic and define that logic.
> It can remove off redundant
> threads, interrupts or timers
> etc and add if required for
> an efficient logic that it
> could suggest to the user.
>
> Maybe, it can also suggest
> various processors and the
> relative performance w.r.t
> memory, speed and cost
> for those .
> It could also suggest if
> we need to go in for a
> multicore and if so , it
> can suggest the number
> of cores and the kind of
> processor !
>
> Karthik Balaguru

Perhaps the tool should be able to read the users' mind too, so that it
can optimise the type of optimisation? Maybe also predict the future so
that it can optimise appropriately for the actual use of the code?

Have you actually bothered to read /anything/ that has been posted in
this thread? We've used your wishful thinking as inspiration for some
interesting discussions, but no one considers your mythical tool to be
at all realistic. And your response is "for my next wish, I'd like
three more wishes".
From: Richard Heathfield on
Walter Banks wrote:
>
> bigbrownbeastie wrote:
>
>> Modern compiler optomise for code speed or code size.
>>
>> Would not be long till you also see 'power use' optomisation or
>> something along these lines.
>
> The very first high level language that Byte Craft implemented
> was specifically designed to optimize for power consumption.

A friend of mine (and, as far as I can recall, the only genuine rocket
scientist I know personally) once recounted a (true) story where he had
to optimise his code for temperature. When people describe an impressive
program as "cool", he sometimes allows himself a wry smile.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within