mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2019-07-17, 23:24   #1
bhelmes
 
bhelmes's Avatar
 
Mar 2016

7×41 Posts
Default suggested computer language for explaining some algorithms

A peaceful and pleasent night for you,


what kind of computer language would you suggest for a mathematical book about number theory in order to illustrate the algorithms ?


The programming language should be

a) easy to understand,
b) supported for a long time (20 years at least) and
c) usable for different operation systems


I used Mupad some years ago, but it is vanished.


Recommandations ?


Greetings from the polynomial rings

Bernhard

Last fiddled with by bhelmes on 2019-07-17 at 23:25
bhelmes is offline   Reply With Quote
Old 2019-07-17, 23:28   #2
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

221558 Posts
Default

Quote:
Originally Posted by bhelmes View Post
Recommandations ?
While I personally can't stand it (it uses indentation for code blocks), Python would probably be a good choice.
chalsall is offline   Reply With Quote
Old 2019-07-18, 00:36   #3
VBCurtis
 
VBCurtis's Avatar
 
"Curtis"
Feb 2005
Riverside, CA

4,483 Posts
Default

Perhaps psuedocode for illustration, but actual code isn't called for in a math text.

If you can't explain the algo in human language, your exposition needs work.
VBCurtis is online now   Reply With Quote
Old 2019-07-18, 01:40   #4
hansl
 
hansl's Avatar
 
Apr 2019

5×41 Posts
Default

PARI/GP is convenient for math and number theory related algorithms.
hansl is offline   Reply With Quote
Old 2019-07-18, 02:39   #5
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

22·32·131 Posts
Default

Just bouncing some ideas around here:
natural language, constructs like if then, else, until, while, for, and parentheses;
whichever language more readers of the book are likely to already know;
perhaps vary the language among a very small set according to which seems to best suit the specific situation;
something included at Rosetta Code;
something available at no additional cost or very low for your students if this is for teaching;
Wolfram (Mathematica) but very costly;
stay with what you know; MATLAB has an optional toolbox with MuPAD (and interfaces with various other languages) https://en.wikipedia.org/wiki/MATLAB.
MATLAB student cost doesn't look too bad.

Last fiddled with by kriesel on 2019-07-18 at 02:47
kriesel is offline   Reply With Quote
Old 2019-07-18, 05:48   #6
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

22·7·11·29 Posts
Default

Pascal.

No (big) difference from pseudocode, human-like, easy to explain any algorithm in it, easy to be re-written in any other language. In C, you can easy compile most of Pascal source code just #defining "begin" to "{", end to ";}", and a couple of other tricks.

Technically, if you have the logic diagram (with blocks) in front of you, or in your mind, writing Pascal programs from it is just a piece of pizza...

After learning Fortran and Basic in high school (for Fortran we used punched cards on a Felix C256 our highschool owned, and for Basic it was the early days of the intel 8080, etc and we had a M18 with centronix console - i.e. printing on paper, this was earlier than the displays and terminals era), we went to uni where they used to teach us Pascal (on Coral, - you MUST click this link! - and serial DAF2020/VT100 terminals in all the building, no listing papers and punch cards anymore), and it was such a revelation... (we studied C started from the second year at uni).

Last fiddled with by LaurV on 2019-07-18 at 05:48
LaurV is offline   Reply With Quote
Old 2019-07-18, 13:11   #7
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

22×32×131 Posts
Default

Quote:
Originally Posted by LaurV View Post
Pascal.
...
After learning Fortran and Basic in high school (for Fortran we used punched cards on a Felix C256 our highschool owned, and for Basic it was the early days of the intel 8080, etc and we had a M18 with centronix console - i.e. printing on paper, this was earlier than the displays and terminals era), we went to uni where they used to teach us Pascal (on Coral, - you MUST click this link! - and serial DAF2020/VT100 terminals in all the building, no listing papers and punch cards anymore), and it was such a revelation... (we studied C started from the second year at uni).
Pascal occurs to me as a language with a great past but not so much a future.
I first learned Fortran in the wait-for-a-keypunch-to-be-free days, then BASIC, various assemblers, c, Pascal, others. Pascal seemed a step up from Fortran toward natural language, and c a step in the other direction toward assembler. https://en.wikipedia.org/wiki/Pascal...mming_language)
kriesel is offline   Reply With Quote
Old 2019-07-18, 19:35   #8
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

2×5×41 Posts
Default

Current college students have virtually no experience with Pascal (which is a shame, since I've heard great things about it). One of my professors was a huge fan of PL/I, lamenting its loss to C.

I think you should probably use pseudocode when targeting a non-CS audience. If it needs to be an actual, modern language, Python and Ruby are readable, cross-platform languages you can use.
Happy5214 is offline   Reply With Quote
Old 2019-07-18, 20:27   #9
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

237228 Posts
Default

Quote:
Originally Posted by bhelmes View Post
what kind of computer language would you suggest for a mathematical book about number theory in order to illustrate the algorithms ?
If you need any specific programming language to explain your algorithms, you have failed to explain your algorithm properly. There are far too many language-specific irritations in any given language.

Almost any form of pseudo-code should be sufficient. That used by Knuth in TAOCP is a classic of clear and precise specification.
xilman is online now   Reply With Quote
Old 2019-07-18, 22:50   #10
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

111548 Posts
Default

Quote:
Originally Posted by xilman View Post
Almost any form of pseudo-code should be sufficient. That used by Knuth in TAOCP is a classic of clear and precise specification.
MIX?!


Nice avatar. But be careful of using it in real life. Around here, 4 could get you 0 to the chin.
kriesel is offline   Reply With Quote
Old 2019-07-19, 00:47   #11
bhelmes
 
bhelmes's Avatar
 
Mar 2016

7×41 Posts
Default

Quote:
Originally Posted by VBCurtis View Post
Perhaps psuedocode for illustration, but actual code isn't called for in a math text.

If you can't explain the algo in human language, your exposition needs work.

Perhaps my english knowledge is not perfect, and may be the chinese reader will not detect every thought, therefore a second explication could improve some knowledge transfair easier.

Last fiddled with by bhelmes on 2019-07-19 at 00:47
bhelmes is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
On the origin of language ... Dr Sardonicus Lounge 28 2018-10-10 19:52
Explaining gnfs to davar55 in words of one sound davar55 Factoring 18 2015-07-20 12:48
ignoring suggested value Vimpy Software 6 2006-09-12 21:00
ASUS A7N8X Deluxe and suggested RAM? 111393 Hardware 1 2004-01-26 12:29

All times are UTC. The time now is 18:04.

Fri Nov 27 18:04:16 UTC 2020 up 78 days, 15:15, 4 users, load averages: 1.89, 1.60, 1.35

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.