Larkin, Power BASIC cannot be THAT good:

On a sunny day (Mon, 25 May 2009 22:00:02 -0700) it happened John Larkin wrote in :

Exactly! And, a lot of small console programs, as you call them, or command line utilities as I call them in Linux, can in Linux be chained together to do anything you want. You would love Unix / Linux without X11.

GUI interfaces are a bit like supermarkets, you can be illiterate and point and grab anything, *IF* you know where it is. Command line is like handing the shopkeeper the shopping list. But it does require people to know how to read and write.

For people that do not, for them is 'Object Oriented Behaviour' (OOB) a necessity :-)

So now you see the link where OO comes from, from illiteracy.

Reply to
Jan Panteltje
Loading thread data ...

On a sunny day (Tue, 26 May 2009 08:05:05 +0200) it happened Frank Buss wrote in :

Well, if Nokia indeed bought it, and if they ever start using it, they will be dead. As it is bloatware.

Reply to
Jan Panteltje

Not at all. I'm comparing all the myrid basics over the years.

"True basic" was just another proprietary extension. It's silly name didn't mean that anybody else would ever follow suit.

Even microsoft has released at least 4 versions incompatible with each other.

Reply to
AZ Nomad

Interestingly, I got SSE2 code for the inner loop when compiling the C code below with gcc 4.3.2 and -O3 -march=core2. The C code was from John Devereux in the PowerBasic Rocks! thread, just changed a little to print out the time per addition. Oh yeah, doesn't seem to run any faster than "normal" code with addls and movls...

Here's the assembler output for the summing loops:

xorl %edx, %edx .p2align 4,,10 .p2align 3 .L2: xorl %eax, %eax .p2align 4,,10 .p2align 3 .L3: movdqa a(%eax), %xmm0 paddd s(%eax), %xmm0 movdqa %xmm0, s(%eax) addl $16, %eax cmpl $256000000, %eax jne .L3 incl %edx cmpl $10, %edx jne .L2

And the C code:

#include #include #define SIZE 64000000 int s[SIZE]; int a[SIZE]; int main(int argc, char **argv) { unsigned start_usecs, current_usecs, diff_usecs; struct timeval start_timeval, current_timeval; /* get start time */ gettimeofday(&start_timeval, NULL); int x,y; /* The Loop */ for(y=0;y

Reply to
Anssi Saari

On a sunny day (Tue, 26 May 2009 16:31:52 +0300) it happened Anssi Saari wrote in :

640000.0);

Actually the largest part of that original C code is from me :-) You can see that from the use of gettimeofday and the subtraction in us.

Reply to
Jan Panteltje

Anyone tried to unroll this loop a little?

for(x=0;x

Reply to
Nico Coesel

On a sunny day (Tue, 26 May 2009 15:41:36 GMT) it happened snipped-for-privacy@puntnl.niks (Nico Coesel) wrote in :

Very clever! It runs indeed faster hre, I tried a shorter version as I do not have that much RAM on the eeePC, and the old one takes 0.6787 seconds, the new one 0.6684 On the Duron 950 I get this (test13 is the old code, test3 your code): Time used is 1257384 us (1.2574 s). Ready grml: ~ # ./test13 memory needed=38 MB mem=0x8c7e940 b=0x8049940 Time used is 1235997 us (1.2360 s). Ready grml: ~ # ./test13 memory needed=38 MB mem=0x8c7e940 b=0x8049940 Time used is 1254768 us (1.2548 s). Ready grml: ~ # ./test3 memory needed=38 MB mem=0x8c7e960 b=0x8049960 Time used is 1153958 us (1.1540 s). Ready grml: ~ # ./test3 memory needed=38 MB mem=0x8c7e960 b=0x8049960 Time used is 1146680 us (1.1467 s). Ready grml: ~ # ./test3 memory needed=38 MB mem=0x8c7e960 b=0x8049960 Time used is 1117692 us (1.1177 s).

This is the code I uesed to test:

#include #include #include

//#define BIG_SIZE 64000000 #define BIG_SIZE 6400000

int32_t mem[BIG_SIZE]; int16_t b[BIG_SIZE];

int main(int argc, char **argv) { int i, j; struct timeval *start_timeval; struct timeval *current_timeval; unsigned long lstart_usecs, lcurrent_usecs, ldiff_usecs;

fprintf(stderr, "memory needed=%d MB\\n", ( (BIG_SIZE * sizeof(int32_t) ) + (BIG_SIZE * sizeof(int16_t) ) ) / 1000000 );

fprintf(stderr, "mem=%p\\n", mem); fprintf(stderr, "b=%p\\n", b);

start_timeval = malloc(sizeof(struct timeval) ); if(! start_timeval) { fprintf(stderr, "could not allocate space for start_timeval, aborting.\\n");

exit(1); }

current_timeval = malloc(sizeof(struct timeval) ); if(! current_timeval) { fprintf(stderr, "could not allocate space for current_timeval, aborting.\\n");

exit(1); }

/* get start time */ gettimeofday(start_timeval, NULL);

#define OLD_CODE #ifdef OLD_CODE for(j = 0; j < 10; j++) { for(i = 0; i < BIG_SIZE; i++) { mem[i] += b[i]; } } #else for(j = 0; j < 10; j++) { for(i = 0; i < BIG_SIZE; i += 4) { mem[i] = mem[i] + b[i]; mem[i + 1] = mem[i + 1] + b[i + 1]; mem[i + 2] = mem[i + 2] + b[i + 2]; mem[i + 3] = mem[i + 3] + b[i + 3]; } } #endif // ! OLD_CODE

/* get elapsed time */ gettimeofday(current_timeval, NULL);

/* calculate the difference */ lcurrent_usecs =\\ current_timeval -> tv_usec + (1000000 * current_timeval -> tv_sec);

lstart_usecs =\\ start_timeval -> tv_usec + (1000000 * start_timeval -> tv_sec);

ldiff_usecs = lcurrent_usecs - lstart_usecs;

fprintf(stderr, "Time used is %d us (%.4f s).\\n", ldiff_usecs, (float)ldiff_usecs / 1000000.0);

fprintf(stderr, "Ready\\n");

exit(0); }

Reply to
Jan Panteltje

True, although one problem with *NIX command line utilities is that there's no standardization in how control parameters are passed to them. Well, OK, a lot of the newer distributions have tried to "harmonize" this at least for the "core" utilities, but it's still a major PITA at times.

Microsoft's PowerShell got this right... instead of using standard text input and output, they just pass objects around (in a chain, if desired), and all the "options" parsing is just calling methods on a well-defined object.

It's like handing the shopkeeper the shopping list, but only after he's handed you his inventory list and reminded you that your shopping list has to precisely match the items on his inventory list or he'll just barf and typically not do anything at all for you.

I personally spend much of my time at a command line, but GUIs definitely have their place.

---Joel

Reply to
Joel Koltner

On a sunny day (Tue, 26 May 2009 09:15:23 -0700) it happened "Joel Koltner" wrote in :

Usually I write command line processing by using getopt(), some apps get so big you run out of letters in the alphabet for the command line flags. Then you would have to use the long options.

Now think when you have to repeat a command,. say a call to ffmpeg, its easy on the command line nice -n 19 mcamip -x -f 2 -t -a 10.0.0.151 -p 80 -u USERNAME -w PASSWORD -y

2>mcamip-log | \\ nice -n 19 ffmpeg -f yuv4mpegpipe -i - -f avi -vcodec h264 -r 2 -b 10 -g 300 -bf 2 -y camera4.avi \\ 1>/dev/zero 2>/dev/zero &

Just cursor up, and ENTER to repeat. Now if you have to tick boxes in some GUI... and enter filenames... again after exiting that program... And when doing this sort of thing that happens hundreds of times a day. I have used that sort of GUI programs in MS windows, many people write that sort of stuff. It will drive you mad...

OK, I was teasing the OOB guys a bit :-) But you know shopping malls,supermarkets, you walk in there with your basket, and fill it up with whatever you see on the shelves that you at that moment *think* you want, or, if the package is done nicely, attracts you to buy it, even if you did not need it, and it was not on your list. The shopkeeper knows this, it is called 'impulse buying', it makes him sell more. It loads you basket with *BLOAT*, same as with GUI. If I want the net status I can just type 'netstat' in my xterm (or console if you are X-less), no need to go through 12 pull down menus or traverse trees in a window manager / 'explorer', much faster to just type that word, if you know what you want. A good shopkeeper *will* find your stuff, he will remember you from your previous shopping visits, and even get specially requested stuff. I use the zsh shell, if I had a hundred commands typed in the recent past, all I have to do is type the first few characters of the one I typed ages ago, say ./xi and then use cursor up, zsh then proposes: grml: ~ # xine rio-grande_part1.ts grml: ~ # xine Astra2_C5.00h24.26-5-2009-126m.ts

zsh is a more powerful shell then bash, bash has some nice features too. I have a GUI (run X), but it is only to start very frequently used apps, and even those are often started from a script with the correct parameters when you click on the icon.

But I am not denying the use of GUI, it is nice in this newsreader NewsFleX that I wrote, but I do not change the layout of the buttons ... every so many month.

Reply to
Jan Panteltje

I do a lot of engineering programs with sorta-interactive console-mode interfaces. Imagine a screen with rows of single-letter commands like

T Temperature 42.3 C

A Radiating area 45 sq cm

etc, and some computed result at the bottom, like radiated heat in watts. To change the temperature, type T 55 and the computed result changes. That's a lot nicer to drive than a command-line thing, and a lot easier to program than a full Windows app.

This isn't fancy, but it works.

Some other things, like file crunchers, work best as command-line things, so long as they provide Help.

It's hard to embedd gui apps into batch files.

John

Reply to
John Larkin

Did you ever used one of Nokias development tools or even end user applications for transfering the address book to a mobile phone? Can't be more bloated :-)

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

On a sunny day (Tue, 26 May 2009 19:30:46 +0200) it happened Frank Buss wrote in :

Yes, sure I have that Nokia program in Xp. I also tried to install their development tool for Symbian.... well, did it need eclipse? Or some weird java stuff? Anyways it would not install in Linux, or rather I got fed up with it. Then I also tried the google phone thing, that needed also eclipse? Probably all OO stuff ;-) so anyways, but that Nokia program in Xp worked, even with bluetooth, unlike bluetooth with Nokia in Linux, but I have IR working with Nokia in Linux (and any other phone), but with limitations!. And setting all that up took a lot more tine then installing the Nokia program in Xp. that worked out of the box, bloated or not.

But Qt, there was an announcement today (in German):

formatting link
Does not seem very well done.

formatting link
LOL Now it is free, and still nobody wants it? hehe

Reply to
Jan Panteltje

All the GUI-based programs I write remember all the options that were ticked/file names entered/etc... those that don't are poor.

They're also smart enough to "notice" if, e.g., a file they've been pointed at has changed on disk and needs to be reloaded.

Yeah, there is something to this... your standard pointy-haired boss is going to be much more impressed with the way the GUI looks than the true performance of a software package.

I keep meaning to try that out... years ago I used csh, but when I got back into Linux a few years ago I just stuck with regular old bash.

---Joel

Reply to
Joel Koltner

On a sunny day (Tue, 26 May 2009 10:22:29 -0700) it happened John Larkin wrote in :

I have this, you can click on an icon and it will pop up: ftp://panteltje.com/pub/xhcs.gif It is the thermostat for the room temperature control, it also shows what I have to pay the electricity guys. You can set the thermostat with it. But the real program is called 'hcs' (from Home Control System) and runs in the background), has been running for >10 years now... You can control it by changing the setpoint in a file too (that is what xhcs does). There is a directory /root/.hcs that holds a lot of info on that control system. You can access that dir over the internet via ssh, or use xhcs with ssh -Y.... So I have both worlds. But the real program hcs is of course a command line program.

So there is no need to embed a GUI program in a batchfile, the GUI can run separately. But I do have some GUI programs that can also be run from a batch file without GUI, just with command line flags, xdipo is such a program, this is the GUI mode: ftp://panteltje.com/pub/xdipo2.jpg Or, as used here, from the show script, the command line mode:

RECORD_DIR=/mnt/hdd4/video TUNER_POSITIONER=/usr/local/bin/xdipo FILTER=/usr/local/bin/jpinfo TXT_DECODER=/usr/local/bin/jpvtx

Elsewhere in the script the player is defined: if ... player="mplayer $aspect -ao alsa:device=hw=1,0 -fs -cache 8192 -vop pp=0x20000 -" else .. player="nice -n -19 xine -D -gf stdin:/"

# the actual command: $TUNER_POSITIONER -c 1 -g "$angle" -f $freq -p $pol -s $sym -a "8192" -o | \\ $FILTER -p $prog | \\ $TXT_DECODER $tpid | \\ $player

So, all is possible... nice trick hey?

Reply to
Jan Panteltje

I use one of these quite often (besides the QuickBasic IDE ;-) ), COIL.EXE by Brian Beezley. Others here may've seen it. It's a quite accurate solenoid calculator.

Tim

Reply to
Tim Williams

It provides assignment as a function (well, several functions), not as a language feature.

The language itself defines the syntax for literal values (integers, strings, lists, ...), and the semantics of evaluation. Evaluating a list calls the function specified by the first element with the remaining elements as arguments; e.g. evaluating (+ 1 2 3) calls the + function with

1,2,3 as arguments, which will return 6. Evaluating (setq x 7) assigns 7 to x.

The language itself boils down to: everything except a list evaluates to itself, lists are evaluated as function calls. Everything else (arithmetic, assignment, function definition, conditionals, loops, ...) is implemented by predefined functions. There are no keywords and no infix notation.

Reply to
Nobody

Well, I use PC suite a lot. It runs OK, but the startup time is very long. Maybe there is some kind of virtual machine startup involved. After all, these are very simple apps.

Then again, I had a Linux PDA, Sharp Zaurus. The GUI uses QT/embedded as I recall and it wasn't particularly bloated.

Reply to
Anssi Saari

There are already S60 and Windows CE ports of Qt available.

Qt is not very heavy library. It is split into many modules and not all of them need to be loaded or even built. Especially for embedded platforms the library can be customized. Qt has been used already for years in mobile phones.

Just looking into the qt directory size does not tell that much. Full build includes XML parsers, html renderer (based on webkit), database connectors, scripting engines etc. And also debugging symbols for c++ libraries are huge when built with some compilers (gcc for example), but they can be stripped off.

--Kim

Reply to
Kim Enkovaara

On a sunny day (Wed, 27 May 2009 14:30:41 +0300) it happened Kim Enkovaara wrote in :

Well, time will tell. I did rm * -rf on the Qt dir on my PC, and everything still works :-) Not only that, the extra disk space of > 300 MB is already in use now for large wave files.

Reply to
Jan Panteltje

For shell scripting, I use python. All the power of a high level language but interpreted (albeit heavily optimized with saved compilation) and with modules to do just about anything quick and easy.

Reply to
AZ Nomad

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.