OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:53 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 1:27 pm 
Offline
Member
Member

Joined: Tue Nov 18, 2014 10:02 am
Posts: 50
Hi,

It is written in book Java How to Program ninth edition that instead of using the strings of numbers that computers could directly understand, programmers began using English-like abbreviations to represent elementary
operations:

1.5 Machine Languages, Assembly Languages and High-Level Languages

Programmers write instructions in various programming languages, some directly understandable by computers and others requiring intermediate translation steps. Hundreds of such languages are in use today. These may be divided into three general types:

1. Machine languages
2. Assembly languages
3. High-level languages

Any computer can directly understand only its own machine language, defined by its hardware design. Machine languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct computers to perform their most elementary operations one at a time. Machine languages are machine dependent (a particular machine language can be used on only one type of computer). Such languages are cumbersome for humans. For example, here’s a section of an early machine-language program that adds overtime pay to base pay and stores the result in gross pay:

+1300042774
+1400593419
+1200274027

Programming in machine language was simply too slow and tedious for most programmers. Instead of using the strings of numbers that computers could directly understand, programmers began using English-like abbreviations to represent elementary
operations. These abbreviations formed the basis of assembly languages. Translator programs called assemblers were developed to convert early assembly-language programs to machine language at computer speeds. The following section of an assembly-language program also adds overtime pay to base pay and stores the result in gross pay:

load basepay
add overpay
store grosspay

Although such code is clearer to humans, it’s incomprehensible to computers until translated to machine language. Computer usage increased rapidly with the advent of assembly languages, but programmers still had to use many instructions to accomplish even the simplest tasks. To speed the programming process, high-level languages were developed in which single statements could be written to accomplish substantial tasks. Translator programs called compilers convert high-level language programs into machine language. High-level languages allow you to write instructions that look almost like everyday English and contain commonly used mathematical notations. A payroll program written in a high-level language might contain a single statement such as

grossPay = basePay + overTimePay

Instead of using the high-level languages, programmers will start using other type of programming language?


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 4:13 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2010 4:53 pm
Posts: 1150
Location: Scotland
Programming languages will end up being increasingly high-level until they become identical to natural language. You will eventually be able to write all your programs in English, Portuguese, or any other natural language, although you will also be able to mix that with instructions of the kind used in today's programming languages whenever you think that's more efficient or clearer.

We aren't there yet though, so I'd recommend that you concentrate on learning to program in conventional, mainstream programming languages like C or C++. Have a go at using assembler too, but it is not necessary to use it for very much, and processors may begin to change so frequently that it will become completely impractical for humans to keep adapting to the new ones, so you should put most of your work into learning to use high-level languages which won't change so much. It's unlikely that there will be anything substantially better than today's high-level programming languages until natural language programming is available, so you can't go wrong by specialising in one or more of today's mainstream languages.

(Don't spend too many years choosing your tools. Writing programs and operating systems is much more interesting than the language you use to write them with.)

_________________
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 5:09 pm 
Offline
Member
Member

Joined: Tue Apr 03, 2018 2:44 pm
Posts: 36
trident wrote:
Instead of using the high-level languages, programmers will start using other type of programming language?


01010100 01101000 01100001 01110100 00100000 01100100 01100101 01110000 01100101 01101110 01100100 01110011 00101100 00100000 01101001 01110011 00100000 01110100 01101000 01101001 01110011 00100000 01100101 01100001 01110011 01101001 01100101 01110010 00100000 01110100 01101111 00100000 01110010 01100101 01100001 01100100 00111111 00001101 00001010 00001101 00001010

Or is this easier to read? Assembly-level languages still have their niche and will be with us for a long time. However there's many reasons why high-level languages exist, one of them being it is far more important for code to be easier to read than to write.

DavidCooper wrote:
Programming languages will end up being increasingly high-level until they become identical to natural language. You will eventually be able to write all your programs in English, Portuguese, or any other natural language


While its an interesting idea, I disagree on the outcome. I've seen this idea floating around for a long time, but it never leaves the academic domain of sample programs longer than a few dozen lines of code. Human languages are *hilariously* ambiguous - serving as a large portion of the humour of sitcoms. How often do you end up with a misunderstanding at work, which can end up wasting time until the misunderstanding is noticed and clarified? And that's when you're talking(/writing) with a human powered by incredibly powerful language and pattern matching hardware that's been evolving and improving for millennia, these events still happen. The occasional times when there's technical ambiguity in code are over small nuances in the syntax, I can't imagine the horrors it would be if we had to diagnose compiler error messages based on compiling an English program. The day I have to work with a James Joyce level of programmer is the day I start my new career on the farm.

_________________
Image is my operating system.

"...not because [it is] easy, but because [it is] hard; because that goal will serve to organize and measure the best of [my] energies and skills..."


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 5:48 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2010 4:53 pm
Posts: 1150
Location: Scotland
pat wrote:
Human languages are *hilariously* ambiguous - serving as a large portion of the humour of sitcoms. ... I can't imagine the horrors it would be if we had to diagnose compiler error messages based on compiling an English program.


An intelligent compiler will ask for clarification whenever there's an ambiguity and may suggest improved wordings to resolve the issue. Writing a program will end up being a conversation with an intelligent machine which anyone could handle even if they know nothing about programming - it will be a collaboration with an intelligent system which is in itself an expert programmer. The error messages will be comments and questions just like the ones you'd get if you were co-writing a program with a human programmer. ("When you say "print the result of that part", do you mean this part [a section of the code is highlighted], and do you want it printed to the screen or the printer?")

None of that will stop you putting in a line of C or any other programming language if you want to, but most of the work will simply be done in natural language, typically at a much higher level with the compiler working out how to carry out the tasks asked of it. The end user will also become a programmer, telling the machine how (s)he would prefer things to be done, and the machine will comply. That will rarely be done through anything other than natural language.

_________________
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 6:15 pm 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 223
Location: Adelaide, Australia
Personally I maintain that having a compiler which understands natural language is about as important as having a hammer that can read.
At the end of the day, it's highly speculative to say computers will ever be "smart" enough to process natural language in a meaningful way. Also, programming - i.e. writing code to be executed by a computer - is probably one of the easiest and fastest parts of learning to develop software. Learning the logical tools to process large problems and to fit their solutions into existing organizational contexts are far more difficult and important for the modern developer.


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 7:38 pm 
Offline
Member
Member

Joined: Tue Nov 18, 2014 10:02 am
Posts: 50
pat wrote:
trident wrote:
Instead of using the high-level languages, programmers will start using other type of programming language?


01010100 01101000 01100001 01110100 00100000 01100100 01100101 01110000 01100101 01101110 01100100 01110011 00101100 00100000 01101001 01110011 00100000 01110100 01101000 01101001 01110011 00100000 01100101 01100001 01110011 01101001 01100101 01110010 00100000 01110100 01101111 00100000 01110010 01100101 01100001 01100100 00111111 00001101 00001010 00001101 00001010

Or is this easier to read? Assembly-level languages still have their niche and will be with us for a long time. However there's many reasons why high-level languages exist, one of them being it is far more important for code to be easier to read than to write.



I am referring to types of programming languages of more higher-level.

The quantum computers are types of programming languages of more higher-level?


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 7:54 pm 
Offline
Member
Member

Joined: Tue Apr 03, 2018 2:44 pm
Posts: 36
trident wrote:
I am referring to types of programming languages of more higher-level.

The quantum computers are types of programming languages of more higher-level?


In that case, there's no higher-higher level languages. But there's a wide variety of types of high-level languages. Quantum computers aren't programming languages, they're voodoo weird machines that are more suited to solving certain types of problems, but aren't a general replacement/upgrade for current computers.

Aside: is there no strikethrough format support here?

_________________
Image is my operating system.

"...not because [it is] easy, but because [it is] hard; because that goal will serve to organize and measure the best of [my] energies and skills..."


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 8:38 pm 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 223
Location: Adelaide, Australia
trident wrote:
I am referring to types of programming languages of more higher-level.

The quantum computers are types of programming languages of more higher-level?

Quantum computers are computers which use quantum mechanics to perform probability analysis instead of gate logic using field effect transistors. There is no "higher" level than languages like Java and C# because one would need to design an entirely different paradigm for creating code.
Natural language compilers might one day be considered a "higher level" of language, but right now that is only speculation.


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Thu Nov 08, 2018 8:53 pm 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 898
The next level is called "Intentional Programming":

https://en.wikipedia.org/wiki/Intentional_programming

Intentional programming languages have been around for a long time, but they've never been very successful. Perhaps with advancements in AI (Machine Learning) we will get something good one day.

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Fri Nov 09, 2018 1:37 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


trident wrote:
Instead of using the high-level languages, programmers will start using other type of programming language?
We can't predict the future, but I don't think it will be either machine code or assembly. A more proper question to ask would be whether programmers will start using high-level languages that are not either procedural, functional or object-oriented (i.e. whether some less common programming paradigms will take off).

However, I've seen you create many threads that seem to be based on misunderstandings of fundamental knowledge about programming, software design and probably computers in general. I'd probably call you a troll, if you didn't mention that you are reading a book about programming (albeit not from an author I'd actually recommend, see note). I don't claim to know everything (there are lots of things I don't know that I should know), but it would maybe help you to explain to us what are your goals.

Is it knowledge that you usually need to do some programming projects? Learn some high-level programming languages (preferably start with C, then maybe go to C++ or python or Java if you like), learn data structures (arrays, records, stacks, queues and trees are things you should know really well) and algorithms (complexity analysis, searching algorithms and sorting algorithms). Learn the APIs of your target operating systems (POSIX should be portable enough for C and C++, python and Java have their own APIs). Follow best practices for your chosen languages and APIs. How operating systems work would also be useful when dealing with multiple threads/processes.

Is it knowledge of how computers work at the lowest level? Try to design some circuits in Logisim, then maybe a simple CPU with instructions to load/store from/to memory and perform some simple arithmetic operations. Then take a CPU architecture (preferably a RISC one, x86 is probably a bit complex but it also works) and write some simple assembly programs for it.

In any case however, please state your goals and mention what you already know. Then we may be able to suggest things to learn next and possibly what projects to do.

Note: I got the suggested book "C: How to Program" for my university C course. More than 1/3 of the book is about C++, while C99 and C11 are mostly omitted; their features are "additional features" and not something you will usually use. Arguments to main() are "other C topics" and not something you will usually use. It's also overly verbose. Probably also other bad things, I didn't look at it in depth. In the next semester I did a Java course, which suggested the book you got right there. I got another book instead.


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Fri Nov 09, 2018 7:38 pm 
Offline
Member
Member

Joined: Tue Nov 18, 2014 10:02 am
Posts: 50
glauxosdever wrote:
Hi,


trident wrote:
Instead of using the high-level languages, programmers will start using other type of programming language?
We can't predict the future, but I don't think it will be either machine code or assembly.


I said that I am referring to types of programming languages of more higher-level.

glauxosdever wrote:
I don't claim to know everything (there are lots of things I don't know that I should know), but it would maybe help you to explain to us what are your goals.



I posted this topic because I am curious.


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Sat Nov 10, 2018 5:15 pm 
Offline
Member
Member

Joined: Tue Nov 18, 2014 10:02 am
Posts: 50
@Schol-R-LEA, @Solar, @chase,

Please, answer this topic.


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Sun Nov 11, 2018 9:51 am 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


trident wrote:
@Schol-R-LEA, @Solar, @chase,

Please, answer this topic.
You should probably know this is quite irritating. Please don't do that. The next time you do that in a topic, I'll stop replying to that topic.

However, if you are curious, you should probably also have a reason to be curious. What is that reason?


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: Instead of using the high-level languages
PostPosted: Mon Nov 12, 2018 11:54 am 
Offline
Member
Member

Joined: Tue Nov 18, 2014 10:02 am
Posts: 50
glauxosdever wrote:
Hi,


trident wrote:
@Schol-R-LEA, @Solar, @chase,

Please, answer this topic.
You should probably know this is quite irritating. Please don't do that. The next time you do that in a topic, I'll stop replying to that topic.

However, if you are curious, you should probably also have a reason to be curious. What is that reason?


Regards,
glauxosdever


I probably will create the type of programming languages of more higher-level, in other words, I probably will create the human language level programming.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 40 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group