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

1BC16 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

22×5×571 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

2·5·599 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 offline   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

52×17×19 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
 
"name field"
Jun 2011
Thailand

241668 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

52×17×19 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

11111111002 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

32·1,319 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 offline   Reply With Quote
Old 2019-07-18, 22:50   #10
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

52·17·19 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

22·3·37 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 06:19.


Mon Sep 25 06:19:10 UTC 2023 up 12 days, 4:01, 0 users, load averages: 0.92, 1.22, 1.11

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, 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.

โ‰  ยฑ โˆ“ รท ร— ยท โˆ’ โˆš โ€ฐ โŠ— โŠ• โŠ– โŠ˜ โŠ™ โ‰ค โ‰ฅ โ‰ฆ โ‰ง โ‰จ โ‰ฉ โ‰บ โ‰ป โ‰ผ โ‰ฝ โŠ โА โŠ‘ โŠ’ ยฒ ยณ ยฐ
โˆ  โˆŸ ยฐ โ‰… ~ โ€– โŸ‚ โซ›
โ‰ก โ‰œ โ‰ˆ โˆ โˆž โ‰ช โ‰ซ โŒŠโŒ‹ โŒˆโŒ‰ โˆ˜ โˆ โˆ โˆ‘ โˆง โˆจ โˆฉ โˆช โจ€ โŠ• โŠ— ๐–• ๐–– ๐–— โŠฒ โŠณ
โˆ… โˆ– โˆ โ†ฆ โ†ฃ โˆฉ โˆช โІ โŠ‚ โŠ„ โŠŠ โЇ โŠƒ โŠ… โŠ‹ โŠ– โˆˆ โˆ‰ โˆ‹ โˆŒ โ„• โ„ค โ„š โ„ โ„‚ โ„ต โ„ถ โ„ท โ„ธ ๐“Ÿ
ยฌ โˆจ โˆง โŠ• โ†’ โ† โ‡’ โ‡ โ‡” โˆ€ โˆƒ โˆ„ โˆด โˆต โŠค โŠฅ โŠข โŠจ โซค โŠฃ โ€ฆ โ‹ฏ โ‹ฎ โ‹ฐ โ‹ฑ
โˆซ โˆฌ โˆญ โˆฎ โˆฏ โˆฐ โˆ‡ โˆ† ฮด โˆ‚ โ„ฑ โ„’ โ„“
๐›ข๐›ผ ๐›ฃ๐›ฝ ๐›ค๐›พ ๐›ฅ๐›ฟ ๐›ฆ๐œ€๐œ– ๐›ง๐œ ๐›จ๐œ‚ ๐›ฉ๐œƒ๐œ— ๐›ช๐œ„ ๐›ซ๐œ… ๐›ฌ๐œ† ๐›ญ๐œ‡ ๐›ฎ๐œˆ ๐›ฏ๐œ‰ ๐›ฐ๐œŠ ๐›ฑ๐œ‹ ๐›ฒ๐œŒ ๐›ด๐œŽ๐œ ๐›ต๐œ ๐›ถ๐œ ๐›ท๐œ™๐œ‘ ๐›ธ๐œ’ ๐›น๐œ“ ๐›บ๐œ”