Welcome, Guest. Please login or register.

Author Topic: Language shopping  (Read 2385 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline mactoTopic starter

  • Full Member
  • ***
  • Join Date: Apr 2004
  • Posts: 111
    • Show only replies by macto
Language shopping
« on: May 04, 2004, 03:58:16 AM »
So I saw REXX and thought, hey I remember that.  Maybe I can do it for a quick calculation.  (I was an OS/2 user about 10 years ago.)  I quickly rediscovered that that though was brain dead, because REXX doesn't like floats.

So, can anyone suggest a language which is:
(a) at least as common as REXX outside of the Amiga world
(b) interpreted, because I don't want to sit around for a compile and link
(c) can handle floats at least as well as C (which isn't saying much)
(d) is relatively small and fast, because I hate bloated software :pissed:

Have A2000 with 8 MB RAM (reliable).
Have A2000 with 68030 and 25 MB RAM (unreliable).
 

Offline Zeela

  • Newbie
  • *
  • Join Date: Apr 2004
  • Posts: 12
    • Show only replies by Zeela
Re: Language shopping
« Reply #1 on: May 04, 2004, 08:07:23 AM »
BASIC? ;-)
My other computer is a Atari ST, Commodore 128 or 48K Spectrum
 

Offline mactoTopic starter

  • Full Member
  • ***
  • Join Date: Apr 2004
  • Posts: 111
    • Show only replies by macto
Re: Language shopping
« Reply #2 on: May 04, 2004, 03:02:14 PM »
But I would be the laughing stock of all my friends.
:smack: <-- I'd be the fellow on the right.  ;-)

If there are no other suggestions, BASIC it will be.
 

Offline minator

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 592
    • Show only replies by minator
    • http://www.blachford.info
Re: Language shopping
« Reply #3 on: May 04, 2004, 03:28:09 PM »
What about Python?
 

Offline mactoTopic starter

  • Full Member
  • ***
  • Join Date: Apr 2004
  • Posts: 111
    • Show only replies by macto
Re: Language shopping
« Reply #4 on: May 05, 2004, 04:44:27 PM »
I took a look at the Aminet and saw the tiny python packages.  I guess they stripped out the libraries.  If so, yippe!  (One of the things which bothers me about Python and Perl are the huge libraries which I would never use.)  I'll take a look at her, on my Amiga, shortly.  Thank-you.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Language shopping
« Reply #5 on: May 05, 2004, 07:37:04 PM »
Quote

macto wrote:
So I saw REXX and thought, hey I remember that.  Maybe I can do it for a quick calculation.  (I was an OS/2 user about 10 years ago.)  I quickly rediscovered that that though was brain dead, because REXX doesn't like floats.

So, can anyone suggest a language which is:
(a) at least as common as REXX outside of the Amiga world
(b) interpreted, because I don't want to sit around for a compile and link
(c) can handle floats at least as well as C (which isn't saying much)
(d) is relatively small and fast, because I hate bloated software :pissed:


Rexx doesn't handle floats? Are you sure?
The following rexx script worked fine for me

/* test */
f = 0.0;
do n=0 to 10
   say f
   f = f + 0.25
end

As far as I know it's typeless and there are rexx maths libraries that provide various trancendal functions all of which use floating point.

Failing all else, you could use javascript. It's pretty common, dynamically typed and works in most places
int p; // A
 

Offline BigBenAussie

  • Sr. Member
  • ****
  • Join Date: Feb 2004
  • Posts: 313
    • Show only replies by BigBenAussie
Re: Language shopping
« Reply #6 on: May 05, 2004, 09:33:21 PM »
@Karlos

How can you use javascript on an Amiga?

I mean outside of a browser, or is that what you are talking about?
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Language shopping
« Reply #7 on: May 06, 2004, 01:14:06 AM »
@BigBenAussie

Yes I meant writing a Javascript application that runs within a browser context. It's perfectly doable for anything that would otherwise be done with a language like Arexx (excluding the use of application ports, however).

You can write all sorts of useful calculation tools and stuff that simply run scripts in a browser window. All the input can be handled via forms and so on.

As long as you dont start using css and stuff, your application would thus run most places, amiga included.
int p; // A
 

Offline BigBenAussie

  • Sr. Member
  • ****
  • Join Date: Feb 2004
  • Posts: 313
    • Show only replies by BigBenAussie
Re: Language shopping
« Reply #8 on: May 06, 2004, 03:40:18 AM »
Only problem is you can't touch the filesystem from javascript. Unless of course you allow it to post to a webserver cgi script hosted on the machine, but how many people are going to do that.

I wish there was an IE like object like you have on windows which could capture the post event and do something useful. You could then issue system commands or database updates through javascript.
 

Offline mactoTopic starter

  • Full Member
  • ***
  • Join Date: Apr 2004
  • Posts: 111
    • Show only replies by macto
Re: Language shopping
« Reply #9 on: May 06, 2004, 04:10:25 AM »
REXX can handle floats, but it isn't terribly suited to numerical work.  It lacks mildly interesting mathematical functions, may that be trignometric or otherwise.  So I checked out rexxmathlib.

When I downloaded rexxmathlib, there were worrying comments about round-off error in the documentation.  To give you an idea of what this means, I tried solving a simplified version of this problem in DICE.  It was simplified so that I could find an exact solution and compare it to an iterative solution.  The difference between the two solutions was about 1%.  I would expect REXX to be greater.

The rexxmathlib documentation also suggested that floats were stored in 15.9 format.  While it wasn't a problem in this case, I often deal with problems which have very big or very small numbers.  For that, I need floats, and not some sort of fixed precision decimal (assuming I have the right name).

I tried DICE.  It was relatively small (can you tell that I have dealt with GCC too much :pissed: ), and I was impressed with the speed on my 68030, which is actually behaving well for the moment. :-D

But I'll try Python later because I think it has arbitrary precision arithmetic libraries.  Or was that Perl.  I forget.  At any rate, while DICE is fast I have found compilers on other platforms to be sluggish.  Why is beyond me.  So interpreted langages can be nice.