[PYTHON] Re: Explains n major programming languages

Re: Explains n major programming languages

Introduction

This article is meant to slash articles like "Explanation of n major programming languages". Click here for the target articles.

-Thorough explanation of 5 major programming languages! --Programming share -Rough explanation of 8 major programming languages --A long diary of shi3z -Thorough comparison of 6 popular program languages in 2015! Annual income, job offers, and learning difficulty that you are interested in | Toiroha

Thanks to @YSRKEN for helping me write. The writing is

https://github.com/yumetodo/re_describe_popular_programming_language/blob/master/article.md

I am doing it in

C language

http://cpg.hatenablog.com/entry/2016/06/30/193755
C is probably the oldest language in programming history and is the foundation of programming. ** (Editor's note: The text is currently deleted) **

I'll just post the following comment on this.

http://b.hatena.ne.jp/entry/292646265/comment/ockeghem
I understand. COBOL, FORTRAN, PL / I, LISP, ALGOL, etc. are prehistoric languages, right?


http://cpg.hatenablog.com/entry/2016/06/30/193755
The reason why it is necessary to create an OS in C language is that C language boasts the fastest processing speed among many programming languages.

When programming the OS, it is necessary to describe the processing directly related to the hardware. (Reference → Introduction to OS self-made with C ++) Therefore, initially, there is a one-to-one correspondence with machine language instructions [assembly language](https://ja.wikipedia.org/wiki/%E3%82%A2%E3%82%BB%E3%83%B3%E3% The OS was described by 83% 96% E3% 83% AA% E8% A8% 80% E8% AA% 9E). However, since the specifications of machine language differ depending on the CPU that runs it, it was extremely difficult to port it to other hardware. Therefore, you can write processing related to hardware and write more portable code [C language](https://ja.wikipedia.org/wiki/C%E8%A8%80%] E8% AA% 9E) was born. Therefore, the correct order is "OS-> C" ** instead of ** "C-> OS".

By the way, in terms of speed, machine language = assembler is the fastest in theory ... Actually, it will change ** as much as possible depending on the performance of the compiler and the framework used. (Reference → Graph showing how the speed of programming language and the speed of application are not related)


http://cpg.hatenablog.com/entry/2016/06/30/193755
When studying, there are a lot of C language study books in the library because of the old history, so there is no problem with learning materials.

Due to the large development population and the large number of undefined / processing system-dependent parts in the standard, it is not uncommon for C language to have errors written in the study book. For this reason, it is often recommended without a joke that ** "If you get lost, read the standard" **.


http://d.hatena.ne.jp/shi3z/20160701/1467330446
Well, it's better to write in C than Bonkura writes in assembly language, but it can be faster than C when experts write in assembly language. Not being able to write better code than a compiler is simply a lack of programmer ability.

Compilers these days are so good that they are often much faster than manually writing the assembly. In the first place, the principle of programming is ** "Do not optimize" **.

Current assembly use case | Bookworm https://cpplover.blogspot.jp/2013/04/blog-post.html
In conclusion, most packages do not require porting work for ARM. In the Ubuntu repository, only 6% of all packages use assemblies. Many packages that use assembly work as they are. This is because it is becoming possible to switch between a highly portable, high-quality code implementation and an assembly implementation for performance purposes. Also, most assembly uses are not very valuable. This is because even processes that do not have to be written in assembly are written in assembly.

C ++ Standards Commission Document 2015-04-pre-Lenexa Review: N4450-N4459 | Bookworm https://cpplover.blogspot.jp/2015/06/c-2015-04-pre-lenexa-n4450-n4459.html
To developers: Throw away the assembly. It can't be optimized that much, and it can only support the architecture that exists at the time of writing the code in the first place. If the compiler performance isn't what you expected, throw a bug report. Suggest to the standardization committee how to achieve synchronous and parallel execution. Get a tool like ThreadSanitizer and find conflicts in your code.

Beat the compiler | Bookworm https://cpplover.blogspot.jp/2015/03/blog-post_30.html
Python and other dynamically typed languages may be fast enough, but fast is always good. You might be able to gain speed in a low-level language like C, or you could go a little further by handwriting the assembly, but you should trust the compiler. But if you want to add a bunch of 12-bit numbers as fast as you can, well, this is the answer.


https://toiroha.jp/article/detail/32380
It's not an object-oriented language, so it feels a bit outdated compared to modern mainstream languages. (C ++ is an extension of object orientation to C language)

C ++ is not an extension of object-orientation ** to C language **, and C language can also be object-oriented. Speaking of C ++, of course, it can be object-oriented, but there are many other enhancements such as template. In addition, C language has also made ** unique developments ** in C language, and the coding style has become completely different, so it seems that ** backward compatibility with C ++ is a misunderstanding **.

C++

http://d.hatena.ne.jp/shi3z/20160701/1467330446
In most parts of C, C ++ is upward compatible with the C language.

As mentioned earlier, C ++ is ** absolutely not upward compatible with the C language.


http://d.hatena.ne.jp/shi3z/20160701/1467330446
For example, in C language, comments can only be used from / * to * /, but in C ++, // can be used.

Even in C language, // comments can be used from C99.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
§6.4.9 Comments
2 Except within a character constant, a string literal, or a comment, the characters // introduce a comment that includes all multibyte characters up to, but not including, the next new-line character. The contents of such a comment are examined only to identify multibyte characters and to find the terminating new-line character.

Java

http://cpg.hatenablog.com/entry/2016/06/30/193755
Java is the language you need to develop Android apps.

** Android NDK has started uploading. ** ** (* NDK = Native Development Kit is a kit for writing native code in C ++ etc.) Also, there was a lot of talk about Java on Android ** not official Java ** ... (Reference → The story of Java and fake Java.)

Nowadays, by Xamarin.Android, even C # is also Android. You can now develop apps.


http://cpg.hatenablog.com/entry/2016/06/30/193755
Boasts processing speed comparable to C language

Java was originally developed for a platform-independent and easy-to-use language. From Java Applet The development that started is wide-ranging, including clients, servers, personal computers, and embedded devices. C / C ++ or Java is mainly used for software development for Android OS, but the former app runs natively and the latter Dalvik Virtual Machine ( It runs on Android 4.4 or earlier) or ART Virtual Machine (https://ja.wikipedia.org/wiki/Android_Runtime) (Android 4.4 or later). Due to the nature of "running bytecode generated from source code on a virtual machine (VM)", the speed is ** relatively slow **.


https://toiroha.jp/article/detail/32380
Java tends to be mature and has tended to be left behind from modern mainstream languages. As a result, new features are rarely added.

Java 7Java 8 has appeared, so it's still ** There is room for evolution **.

JavaScript

http://cpg.hatenablog.com/entry/2016/06/30/193755
JavaScript is the language you need to create web pages.

It's used a lot, but it's not essential. If anything, it's a word that applies to HTML.


http://cpg.hatenablog.com/entry/2016/06/30/193755
For example, jQuery is a JavaScript plugin. In other words, you can easily use convenient functions written in JavaScript by using the simple grammar of jQuery.

What exactly is "jQuery grammar"? Sure, I often use unique notations, but they are all made by JavaScript, and in principle they should all be written in JavaScript. I can.


http://cpg.hatenablog.com/entry/2016/06/30/193755
The feature of JavaScript is that it is visually incorporated

What does "visual" mean?


http://d.hatena.ne.jp/shi3z/20160701/1467330446
JavaScript is a functional language strongly influenced by the LISP language, which is older than C.

Sure, there is a feature for Closures (http://qiita.com/takeharu/items/4975031faf6f7baf077a), but it's actually a prototype-based object-oriented language (http://qiita.com/takeharu/). Isn't it often used as items / 809114f943208aaf55b3)?


http://d.hatena.ne.jp/shi3z/20160701/1467330446
Server-side programming is also possible using V8 and nodeJS.

I don't think it can be done with V8.

Ruby

http://cpg.hatenablog.com/entry/2016/06/30/193755
A feature of Ruby is its freedom.

** Isn't there a part that makes me sick if I don't write in a little more detail (dark smile) **


http://d.hatena.ne.jp/shi3z/20160701/1467330446
Recently, it seems that JIT has been added and it has become a VM and it has become faster.

Was Ruby JIT at the experimental stage for Ruby 3.x? (Reference → Toward the future of Ruby 3.0-, three directions and Ruby philosophy shown by language designer Matsumoto)


http://d.hatena.ne.jp/shi3z/20160701/1467330446
A Dutchman named DHH

DHH ([David Heinemeier Hanson](https://ja.wikipedia.org/wiki/%E3%83%87%E3%82%A4%E3%83%B4%E3%82%A3%E3% 83% 83% E3% 83% 89% E3% 83% BB% E3% 83% 8F% E3% 82% A4% E3% 83% 8D% E3% 83% 9E% E3% 82% A4% E3% 83% A4% E3% 83% BC% E3% 83% BB% E3% 83% 8F% E3% 83% B3% E3% 82% BD% E3% 83% B3))) I think he is Danish.

PHP

http://d.hatena.ne.jp/shi3z/20160701/1467330446
PHP is integrated with Apache

Again, just put the following comment:

http://b.hatena.ne.jp/entry/292721861/comment/living
"PHP is integrated with Apache" I also use mod_php, but if you want performance, I think PHP-FPM (in short, FastCGI) is more common.

Python

http://cpg.hatenablog.com/entry/2016/06/30/193755
By incorporating a programming language into AI (artificial intelligence)

Isn't it possible to implement machine learning in a programming language?


http://cpg.hatenablog.com/entry/2016/06/30/193755
Python is the required language.

** Mainly C ++ is used ** as the language for writing libraries used for machine learning. The reason is that ** it requires a huge amount of calculation ** (especially for learning) **, so it is better to be fast **. In addition, various languages are available for code that uses machine learning. For example, waifu2x, which is famous for image processing by deep learning, is implemented not only in Python but also in various languages such as C ++, HSP, JavaScript, and Rust. I am.

However, Python has a rich library, so you can easily write numerical calculations (including machine learning) and image processing. Therefore, is it a good option to learn Python when you come into contact with machine learning?

Swift

http://cpg.hatenablog.com/entry/2016/06/30/193755
Swift is the language you need to develop iPhone apps developed by Apple.

** Xamarin.iOS has started uploading. ** **

Recommended Posts

Re: Explains n major programming languages
10 Most Popular Programming Languages in 2020
Features of programming languages [Memo]
The popularity of programming languages
Terminology for all programming languages