Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
15 crawler(s) on-line.
 119 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 Comi:  5 mins ago
 Gunnar:  8 mins ago
 amigakit:  25 mins ago
 vox:  51 mins ago
 zipper:  54 mins ago
 kolla:  1 hr 1 min ago
 OneTimer1:  1 hr 15 mins ago
 BigD:  1 hr 57 mins ago
 OlafS25:  1 hr 59 mins ago
 NutsAboutAmiga:  2 hrs 31 mins ago

/  Forum Index
   /  General Technology (No Console Threads)
      /  Computer Programming Languages
Register To Post

Goto page ( 1 | 2 | 3 | 4 | 5 | 6 Next Page )
PosterThread
Trekiej 
Computer Programming Languages
Posted on 20-Mar-2019 15:48:24
#1 ]
Cult Member
Joined: 17-Oct-2006
Posts: 890
From: Unknown

Hello, I am curios about the Pros and Cons of certain programming languages

These are the one on question.

Cobol:

Pascal:

Fortran:

_________________
John 3:16

 Status: Offline
Profile     Report this post  
Chain-Q 
Re: Computer Programming Languages
Posted on 20-Mar-2019 17:16:25
#2 ]
Cult Member
Joined: 31-Jan-2005
Posts: 824
From: Budapest, Hungary

@Trekiej
OK, did someone say Pascal? :)

Well, OK, you asked for it, so randomly, from the top of my head. :)

Pascal (Pros):
- it's a clean language, easy to learn, as it was originally designed for teaching
- strong typing. the language tries to protect you from shooting yourself in the foot, and encouraging good coding practices
- basic things like sizeof(), length() on arrays, etc always work as you expect it (unlike in say, C)
- safe and very advanced string handling
- compiles to native code (no GC/interpreters) with most modern compilers
- it has binary modules (units, in Pascal terminology) instead of textual headers, which among others helps compilation speeds. Pascal compilers are traditionally very fast. (There's now a proposal for C/C++ to do the same, it's there in Pascal since the mid-80s at least...)
- each unit has its own namespace. no polluting of the global namespace when adding identifiers
- no Makefiles. the compiler can build the dependency tree among the units automagically (and only recompile changed code)
- contrary to popular belief, it's not stuck in 1992, the language was steadily improved over the years, now it incorporates most modern paradigms, like advanced OOP, 64bit arithmetics (on any architecture) managed (reference counted) strings and arrays, generics, variant types, Unicode support, threading and other things.
- you can mix procedural and OOP style and use the best strategy to attack the problem at hand, no different behavior like C vs. C++.
- the language is very compatible with itself all the way back, no breaking of syntax between revisions like Python. there are various dialects, like ISO, Extended, Borland, Delphi, Mac Pascal, etc. with slight differences, but Free Pascal supports compiling any code written in any dialect into the same project
- both big implementations (Delphi, and Free Pascal/Lazarus) comes with a large set of libraries bundled, to solve various complex problems with a few lines of code (webserver/client, DB-accessibility, many other things)
- comes with a RAD IDE (on most platforms, sadly not Amiga-likes), for easy cross-platform UI development (Delphi or Lazarus)
- interfacing to and linking against C-written (or other languages following the C ABI) libraries is very easy and seamless, which means you can develop high-level logic in a safer language, and not give up the strength of existing code
- the default library is small and statically linked, your executable runs with minimal dependencies
- Free Pascal is massively multiplatform, and supports everything from 8 bit microcontrollers to 64bit ARM and PowerPC, from embedded systems, to large scale DB stuff, or even mobile platforms (Android/iOS), and of course niche or retro systems like Amiga-likes, Haiku or MS-DOS, and they are first class citizens

Amiga specific Pros:
- has (probably) the best Amiga cross-platform support among all compilers. use the same compiler to compile apps for all Amiga-like platforms (ok, VBCC can do the same, but C is a lot more low-level, and VBCC and its libraries come with less advanced language features)
- advanced concepts like native support for threading on Amiga are implemented
- all advanced language features are also available on Amiga-likes
- supports most Amiga .libraries out of box (apart from the stock OS, also MUI, RTG, AHI, etc.), no need to hunt for headers/packages on Aminet
- comes with a diverse set of packages, most are fully multiplatform
- fully supports cross-compiling to and from Amiga-like systems

Pascal (Cons):
- everyone thinks it's uncool, because they read it on the web somewhere
- everyone thinks it's uncool, because they've seen Turbo Pascal in High School for 20 minutes 20 years ago.
- everyone thinks it's uncool because array indices start from 1. (Which is not true. In Pascal, array indexes can be defined as ranges. You can have an array from 5 to 11, if you wanted it.)
- everyone thinks it's uncool because it differs from C syntax (The core Pascal syntax is mostly inherited from later Algol standards. It actually predates C itself.)
- the language standard got a bit messy over the years, compared what it used to be, but still better than C++, and you can switch off the features you don't like
- the compiled code is usually not as fast as it would be in C or C++, especially in tight loops, but still more than fast enough for most uses.

I could write more, but that would be more a discussion of advanced concepts, rather than just a list of bullet points...

_________________
MorphOS, classic Amiga, demoscene, and stuff
"When a bridge is not enough, build a Viaduct!"
"Strip the Amiga community of speculation and we can fit every forum on a 720k floppy" (by resle)

 Status: Offline
Profile     Report this post  
Xenic 
Re: Computer Programming Languages
Posted on 20-Mar-2019 17:58:12
#3 ]
Super Member
Joined: 2-Feb-2004
Posts: 1246
From: Pennsylvania, USA

@Trekiej

Modula2 is the succesor to Pascal and there is an OS4 native compiler at
OS4Depot.

_________________
X1000 with 2GB memory & OS4.1FE

 Status: Offline
Profile     Report this post  
billt 
Re: Computer Programming Languages
Posted on 20-Mar-2019 19:20:39
#4 ]
Elite Member
Joined: 24-Oct-2003
Posts: 3205
From: Maryland, USA

@Trekiej

Those three are all seen as rather old.

Fortran is still in far amount of use by math and science people. May not be as king of the hill with those people as it used to be, as Matlab is now very big there.

Cobol was popular and still in use in some banking areas. Can be a lucrative language to know if you want to be one of the few people not retiring/retired to take over those empty positions.

Pascal: I am not familiar, but my first classes in programming in college used Modula2, a related teaching language. I haven't used or seen Modula2 since those classes in school. As they are intended to be teaching languages, I am not sure how much use they get outside of academia, and as I am not a youth any longer, I am not sure if they are used in academia any longer either.

_________________
All glory to the Hypnotoad!

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: Computer Programming Languages
Posted on 20-Mar-2019 19:21:02
#5 ]
Elite Member
Joined: 9-Jun-2004
Posts: 12795
From: Norway

@Trekiej

https://www.quora.com/How-does-Fortran-compare-to-COBOL

_________________
http://lifeofliveforit.blogspot.no/
Facebook::LiveForIt Software for AmigaOS

 Status: Offline
Profile     Report this post  
bison 
Re: Computer Programming Languages
Posted on 20-Mar-2019 20:03:37
#6 ]
Elite Member
Joined: 18-Dec-2007
Posts: 2112
From: N-Space

@Trekiej

Pascal was the first language I learned, followed by Fortran, and then C. Compared to C the first two are like breathing out of one side of your nose.

_________________
"Unix is supposed to fix that." -- Jay Miner

 Status: Offline
Profile     Report this post  
hth313 
Re: Computer Programming Languages
Posted on 20-Mar-2019 21:03:49
#7 ]
Regular Member
Joined: 29-May-2018
Posts: 159
From: Delta, Canada

@Trekiej

Why those? If you are interested on "old languages but still being used", maybe you should add Lisp to that list.

I never tried Cobol, but Fortran around 1980 and Pascal a little bit around 1988. I guess if you use a modern variant it will be a better experience, but you can probably do better with something else, something more mainstream.

Fortran was (is?) old, very old. It was designed before people really knew what they were doing. In some way it felt like a mix between some high level assembler and an expression evaluator.

Pascal was popular for teaching, but early versions did not scale well for writing real programs. Which was a pity, because people actually tried to use it after being taught it. Well, C was a far better choice and probably still is in most aspects, even though I do not doubt that there are better implementations of Pascal today. As I said elsewhere, they are essentially the same thing.

I would suggest C, Python, Clojure (similar to Lisp and Scheme) or perhaps even Forth. If you want some more alternatives, perhaps Rust, Lua, Haskell and assembly language.

But it all boils down to what you want to do.

If you want to earn a living, go for Java or C. If you want to learn something, pick a Lisp like language or Forth. If you want to explore the galaxy and other dimensions, go for Haskell. But I warn you, once you understand Haskell, you may end up being very miserable and grumpy about the world you are forced to exist in.

 Status: Offline
Profile     Report this post  
Trekiej 
Re: Computer Programming Languages
Posted on 21-Mar-2019 1:39:13
#8 ]
Cult Member
Joined: 17-Oct-2006
Posts: 890
From: Unknown

Thanks, rotfl at some at some of the responses. I did check Quora earlier and can find a boat load of answers.

I heard that Fortran has some parallel-ism built-in.
Pascal, imo, should be a language many should use. Probably because of the name. Everyone siting around thinking about politics or sociology or some other neoplatonic subject.

Cobol was a language I was taught at University back in 2004. I am surprised it is not used more. It looks like a futuristic language, something from a scifi movie.

Can a processor read a programming language with its instruction decoder?

Basic, is man's other best friend. Like a puppy?

I guess I am thinking of how programming is way to look into Cosmos in a math and data kind of way.

It is nice to have a compiled language around for speed and compactness.
Also, an interpreted language is an experimenter's friend. Like the C64.

_________________
John 3:16

 Status: Offline
Profile     Report this post  
hth313 
Re: Computer Programming Languages
Posted on 21-Mar-2019 2:11:26
#9 ]
Regular Member
Joined: 29-May-2018
Posts: 159
From: Delta, Canada

Quote:

Trekiej wrote:
I guess I am thinking of how programming is way to look into Cosmos in a math and data kind of way.


Data structures, abstract math and Cosmos, it is the Haskell way. Be prepared that Cosmos is much larger than you might have imagined...

Quote:

It is nice to have a compiled language around for speed and compactness.
Also, an interpreted language is an experimenter's friend. Like the C64.


This is why languages such as Forth, Lisp (family) and Haskell are nice. They have an interactive mode where you can play with your program and data without having to build and link a binary. All of them can also compile down to various levels of performance, basically all the way to the metal if you want.

Again, Haskell is very nice here as it can give very good performance and can make good use of multi-core. You reduce complexity by basically getting rid of all side-effects that are not really need. If you look at random program language, most of them allow for mutability, writing a location in memory multiple times, which means you basically have to follow the execution in your head sometimes to see what it does. With no side-effects (in reality minimal amount of side-effects thanks to math theories), your program becomes a lot simpler and easier to read and understand. The "machine" behaves as if a memory location is only written once, it can never change. Under the hood, the optimizer when possible can turn this into mutable changes banging the same memory location when possible, but the semantic model (what you can observe) still behaves as if it is immutable. Basically, you can get the best of everything. It may take some efforts to tune its lazy behaviour some times, but it comes with very good memory and profiling tools for doing just that. However, it is not so well suited for low-level programming. What you trade for all the benefits is a very steep learning curve and some increased memory consumption while executing. You will probably also find that it not so easy to get a job after you get there...

 Status: Offline
Profile     Report this post  
Snorg 
Re: Computer Programming Languages
Posted on 21-Mar-2019 2:19:00
#10 ]
Regular Member
Joined: 1-Feb-2018
Posts: 117
From: Unknown

@Trekiej

Well, I'd like to share a little song with you.

It goes a little somethin' like this:

Mommas, don't let your babies grow up to be ... programmers.
Don't let em' hack on keyboards or drive those disks much,
Let em' be doctors and lawyers and such.

Mommas, don't let your babies grow up to be programmers,
They're always at home on the web with their phone,
With the coding language they love ...

Take it away ...

 Status: Offline
Profile     Report this post  
Trekiej 
Re: Computer Programming Languages
Posted on 21-Mar-2019 2:22:36
#11 ]
Cult Member
Joined: 17-Oct-2006
Posts: 890
From: Unknown

@Snorg

_________________
John 3:16

 Status: Offline
Profile     Report this post  
Trekiej 
Re: Computer Programming Languages
Posted on 21-Mar-2019 2:24:44
#12 ]
Cult Member
Joined: 17-Oct-2006
Posts: 890
From: Unknown

@hth313

C uses pointers to access memory directly instead copying one array to another.
That would be slow.

_________________
John 3:16

 Status: Offline
Profile     Report this post  
Chain-Q 
Re: Computer Programming Languages
Posted on 21-Mar-2019 11:37:19
#13 ]
Cult Member
Joined: 31-Jan-2005
Posts: 824
From: Budapest, Hungary

@hth313
Quote:
Pascal was popular for teaching, but early versions did not scale well for writing real programs. Which was a pity, because people actually tried to use it after being taught it.

Actually, I've seen a relatively recent interview from Niklaus Wirth, where he claims that despite even OS-es being written in Pascal in the 70s and 80s (Apple's Lisa OS and early Mac System being prime examples, but Windows also inherited some Pascal ABI things from early versions), he had minimal to no feedback from the industry, they just took it and ran with it, and he himself didn't care about the industry feedback either too much (at that point). But nevertheless, i find it ironic, that the C inventors are regarded as demi-gods by their community and the industry, while Niklaus Wirth is largely ignored, even if we know the shortcomings of C far too well at this point (for example, see this talk), but everyone just goes "well, such is life, it's broken but no way to fix it now." No, it doesn't have to be. That's the whole point. But whatever.

Quote:
Well, C was a far better choice and probably still is in most aspects

Citation needed. I use to say, anyone who wants a working application programming language and/or improve on C without going into C++ madness eventually will reinvent Pascal (or some related language to it).

_________________
MorphOS, classic Amiga, demoscene, and stuff
"When a bridge is not enough, build a Viaduct!"
"Strip the Amiga community of speculation and we can fit every forum on a 720k floppy" (by resle)

 Status: Offline
Profile     Report this post  
Lou 
Re: Computer Programming Languages
Posted on 21-Mar-2019 18:50:13
#14 ]
Elite Member
Joined: 2-Nov-2004
Posts: 4169
From: Rhode Island

VB.Net is the one language to rule them all!

Also the Roslyn compiler is open now:
https://github.com/dotnet/roslyn

So with a Wine or Mono port ... oh the dreams...

 Status: Offline
Profile     Report this post  
Samurai_Crow 
Re: Computer Programming Languages
Posted on 21-Mar-2019 20:02:04
#15 ]
Elite Member
Joined: 18-Jan-2003
Posts: 2320
From: Minnesota, USA

Object Pascal is more powerful than Pascal in the same way C++17 is more powerful than C89.

Re:VB.net
.NET was originally developed by a Delphi Pascal designer.

Re:parallel programming
Rust disallows most of the gotcha situations that emerge from parallel processing by using strict syntax. This should be the next C replacement.

 Status: Offline
Profile     Report this post  
golem 
Re: Computer Programming Languages
Posted on 21-Mar-2019 20:31:04
#16 ]
Member
Joined: 14-Feb-2004
Posts: 49
From: Nottingham, UK

I learnt Turbo Pascal as part of an Arts faculty introduction to programming at University. It was a good introduction to structured programming that you can't get from BASIC. I've only coded two big projects and one of those was originally in 68k and when I ported it to C it really twisted with my melon but I saw some of the beauty of C doing that project. CBM/Escom Amigas are better supported with C compilers than any Pascal or C++ ones.

Last edited by golem on 21-Mar-2019 at 08:41 PM.

_________________
1200 desktop Blizzard 1260 with 2Gb Jaz SCSI drive, 32Mb, OS3.9 BB2
1200 desktop Blizzard 1230, 32Mb, OS3.2
Trusty 1.3 A500 underneath the TV with SCART

 Status: Offline
Profile     Report this post  
NutsAboutAmiga 
Re: Computer Programming Languages
Posted on 21-Mar-2019 21:06:19
#17 ]
Elite Member
Joined: 9-Jun-2004
Posts: 12795
From: Norway

@hth313

Quote:
C uses pointers to access memory directly instead copying one array to another.
That would be slow.


While I get your point, there is another point to be made, arrays in C is not safe like other languages,

for example code snippet bellow is valid, and C will not check if n is above 999.


char data[1000];
For (n=0; n<2000;n++) data[n]=0;


so pointers and arrays are equally dangerous.

However, if upgrade to C++, you can possible get an exception from vector or list class, if you are outside of the array. On that's subject it likely that classes that throws exceptions is most likely slower then old school C code.

The question becomes is worth, the extra speed or is extra safety better for the stability of your program and operating system.

It kind way you pick a slower programming language instead of faster one, but also what it was designed to do, for example it coding a web page that use C backed is possible, but wherry hard task and time consuming and the end result is problem not worth it.

Pick a language that is designed be used as web server language.








Last edited by NutsAboutAmiga on 21-Mar-2019 at 09:08 PM.

_________________
http://lifeofliveforit.blogspot.no/
Facebook::LiveForIt Software for AmigaOS

 Status: Offline
Profile     Report this post  
bison 
Re: Computer Programming Languages
Posted on 21-Mar-2019 21:23:18
#18 ]
Elite Member
Joined: 18-Dec-2007
Posts: 2112
From: N-Space

@Trekiej

Well, since we have moved well beyond the original Fortran/Cobol/Pascal premise, I'll throw in my 2 cents: C and Python are the Dynamic Duo (Batman and Robin). Those two languages together span everything from low-level systems programming to one-off scripts.

_________________
"Unix is supposed to fix that." -- Jay Miner

 Status: Offline
Profile     Report this post  
hth313 
Re: Computer Programming Languages
Posted on 21-Mar-2019 22:48:31
#19 ]
Regular Member
Joined: 29-May-2018
Posts: 159
From: Delta, Canada

Quote:

Trekiej wrote:
@hth313

C uses pointers to access memory directly instead copying one array to another.
That would be slow.


Yes, thawing an array to mutate it and go back is expensive, which is why you normally avoid doing it that way.

Instead, an array can be used as an O(1) lookup table, which can be either bounds safe or unsafe (if you wish for minor speed bump at the risk of crashing instead of a controlled out-of-bounds exception).

If you want to modify something like an array you use a different data structure, like a mutating array, where you get side-effects into the type system. Then you get basically what you have in languages as C. Or you use something different like a HashMap, Map or IntMap, which allows for sparse keys. They do take things apart and put together. I tend to favour IntMap which gives surprisingly good performance and immutable Array when suitable for the data at hand. In some rare cases I use ordinary mutable arrays.

Taking things apart and such means that you have the opportunity to grab hold of an earlier copy of it, and you do not need to worry that someone can modify it. If modifications take place, it will be in new memory that reuse (share) parts with the old one in a safe way. The places that are not changed are just shared. Thus, no strange things can happen, you can easily keep multiple incarnations of it. If you don't, then the optimizer can recycle the memory quickly and at best even reuse cells.

As an example, this makes it trivial to undo changes to a complex data structure, just keep a reference to the each one of interest. This can be quite tricky in C/C++, as you probably implement it by reversing the changes.

 Status: Offline
Profile     Report this post  
Zylesea 
Re: Computer Programming Languages
Posted on 21-Mar-2019 23:14:58
#20 ]
Elite Member
Joined: 16-Mar-2004
Posts: 2263
From: Ostwestfalen, FRG

If we are in old and rather obscure languages let me throw in Prolog which I learned a bit some aeons ago in school. Was somehow cool.

Today I mainly use Hollywood - which is cool, too. Albeit a different kind of coolness.

Last edited by Zylesea on 22-Mar-2019 at 08:24 PM.

_________________
My programs: via.bckrs.de
MorphOS user since V0.4 (2001)

 Status: Offline
Profile     Report this post  
Goto page ( 1 | 2 | 3 | 4 | 5 | 6 Next Page )

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle