Jump to content

Which language and interpreter for this program?


Recommended Posts

Hi the experts!

I've programmed in C and C++ (and older ones) few decades ago, and now I consider writing just one small and dirty code, like 50 lines of recursive integer computations. What I need:

  • Accurate integers with bitlogic, on 64 bits better than 63, but running on 32b Xp and preferibly W2k, and at a good speed, similar to compiled. Apparently, Javascript limits to 50+ bits and Java to 63 bits or even less on 2k-Xp.
  • I don't need an object-oriented language, nor an IDE to develop the code. Text editor <-> Line compiler <-> Console would be OK. But free please.
  • The code is for me, by me only, no documentation planned, and it will run on the developing machine. No GUI for the application, single task, no Avx: things like printf().
  • I want to spend very little time on installing the interpreter or compiler and learn it and the language. You known, the source libraries, the parameters for W2k target, the runtime links... Javascript was a good surprise in that aspect.

So: which one do you recommend? Thanks!

Link to comment
Share on other sites

  • 1 month later...

Visual Studio 2015 Community Edition is what I use.  It's free though it most certainly isn't trivial to install (it's a multi-gigabyte package, you have to pick from a LOT of options, and the installer takes the better part of an hour even on a supercomputer).

I develop graphics applications where performance is critical and often have need for highly efficient code to sweep through pixels.  I am literally amazed at how well the optimizer in VS 2015 works...  We use the "Maximize Speed" optimization setting, and with some care in coding the sources it often reduces loops to all register-based machine code.  For example, note the generated code for the doubly-nested loops in this code snippet.  I thought this was impressive...

GreatOptimization.png

Don't get me wrong - I'm not at all for Microsoft's current direction toward cloud-integration and fondness for sending your information to their servers, but right now I'm getting good value out of VS 2015 (I'm running it on Win 8.1 and 7).  I have a secure network and I actually do see my firewall blocking telemetry back to Microsoft.  I don't know what your sensitivity to this is, so I'm mentioning it.

Oh, and I only recently learned that in order to have VS 2015 avoid automatically building telemetry into YOUR application, you have to actively include notelemetry.obj into the link.  You have to watch Microsoft like a hawk, but their development tools are actually pretty good.

-Noel

Link to comment
Share on other sites

  • 11 months later...

You could use REXX.  It is pretty good at big numbers.  You can even farm stuff out to even faster programs in line with rexx.

/* A 240-digit rexx calculator */
numeric digits 240
parse arg chalk
interpret 'cheese = ' chalk
say cheese
exit

cube: procedure; parse arg x
return x*x*x

factor: procedure; parse arg x
'factor' x
return x

This program is a rexx program that finds allows all internal commands, along with CUBE().  If you put factor(2000**3-1) in there, it will print the factors of the evaluated expression and continue calculating.  Note this uses an external command 'factor'.  I use the Shamus Software demonstration program here.

I've written rexx scripts to calculate very large numbers, up to ninety digits, and feed the result into factor.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...