当前位置:网站首页>2021-2-26 compilation of programming language knowledge points
2021-2-26 compilation of programming language knowledge points
2022-06-11 01:47:00 【Captain xiaoyifeng】
The following is a patchwork and personal understanding , Give yourself more notes , Continuous entropy reduction 
Java
java By the first James Gosling To write , Name it Oak( Oaks common in Silicon Valley )
1995 year ,java Officially born in Sun(Stanford University Network) company ( After being oracle Acquisition )
1996 year 1 month 23 Japan ,Sun Released JDK1.0
java The purpose of the birth is that it can be easily transplanted to consumer electronic devices ( For example, microwave oven 、 Remote control, etc ).
The original c、c++ And other languages in different cpu Finish the task on , Different compilers are required , therefore Sun The company hopes to develop a portable 、 Platform independent language , You can use this language to generate various programs that run in different environments CPU The code above . Their efforts eventually led to Java Appearance .
With the advent of the World Wide Web ,Java Pushed to the forefront of computer language design , because Web Portable programs are also required .
Java Characteristics :
1.java The style is similar to C++, In a sense ,java yes C++ A variation of
2.java Abandoned C、C++ The pointer in is easy to cause errors and difficult to understand , structure , And memory management
3.java Provides a rich class library , It is very convenient to develop programs
4.java It's a completely object-oriented language , Support Inherit , heavy load , Polymorphism and other object-oriented features ;C++ It is a mixed language of object-oriented and process oriented , C It's a pure process oriented language
5.java It's a strong type of language , Than C/C++ The inspection should be strict ,java Case sensitive
6.java Provides an automatic garbage collection mechanism gc, Effectively avoided C、C++ Memory leak problem
7.java Illegal access to memory is prohibited , because java No pointer , Memory application and release
8. Cross platform ,java The source code is compiled into a structure neutral intermediate format , This format is machine independent , As long as there is JVM(java virtual machine ) On the computer , Can run such machine independent intermediate files ,.class ,java A compilation , Run anywhere
9. For different operating systems , It will be different java virtual machine , It's up to you java Portability of
10、 java Multithreading support , Simple understanding , If it's a single core CPU, Then it will pass Time slice rotation The way , Multithreaded execution program ( Concurrent programming ?), If it's multi-core CPU, Then it can be understood as , Two or more threads are running at the same time
java How to realize cross platform
1. We wrote Java Source code , After compiling, it will generate a kind of .class file , It's called a bytecode file
2.Java virtual machine JVM It is responsible for translating bytecode file into machine code under specific platform and then running . in other words , Just install the corresponding... On different platforms JVM, You can run the bytecode file , Run what we wrote Java Program .
Java Cross platform does not mean that other languages cannot cross , As long as they have compilers for different environments . Mainly Java Is a compile file level cross platform ,c/c++ And so on are source code level cross platform . That is to say Java yes “ A compilation , Run anywhere ”,c/c++ yes “ Write once , Compile everywhere ”
JavaScript
JavaScript Is currently the web Development is indispensable Scripting language , It's a kind of Front-end language .js You don't need to compile to run , Running on the client , It needs to be parsed and executed by browser JavaScript Code .
Born in 1995 year , The development company is Netscape, The main purpose at that time was to verify whether the data in the form was legal , For their browser interaction .
JavaScript It should have been called Livescript, But on the eve of the release , Trying to catch up with the super hot java Free ride , Temporarily change the name to JavaScript.( in other words js Follow java yes The relationship between Lei Feng and Lei Feng pagoda , I was just trying to use java The fame of )
notice Netscape, I wonder if you remember that period of history ,Navigator and IE War , Finally, Netscape lost to Microsoft's bundling marketing .
js The composition of
(1) The core (ECMAScript): This part is mainly about js Basic syntax .
(2)BOM:Brower Object Model( Browser object model ), It is mainly to obtain browser information or operate browser , for example : Browser forward and backward 、 Browser pop-up prompt box 、 Browser address bar input URL jump and other operations .
(3)DOM:Document Object Model( Document object model ), For the time being, the document here is understood as html,html Load into the browser's memory , have access to js Of DOM Technology for in memory html The nodes are modified , What the user sees from the browser is js Dynamically modified page .( Additions and deletions )
js Characteristics
Interactivity ( What it can do is the dynamic interaction of information )
Security ( Direct access to the local hard disk is not allowed )
Cross-platform sex ( As long as it can be parsed js All browsers of can execute , It's not about the platform )
Reference link :https://blog.csdn.net/sswqzx/article/details/82796026
JavaScript and CSS、HTML
CSS Determine the appearance of the web page ,HTML Determine the content of the web page ,JavaScript Determines the interaction of web pages
That is, web pages can be divided into three levels , namely : The structure layer (HTML)、 The presentation layer (CSS)、 Behavior layer (JavaScript).
Node.js
The name looks like JavaScript A library , But it's not , It's a JavaScript Operating environment .
Node.js yes 2009 By the great God Ryan Dahl Developed .Ryan My job is to use C++ Write server , Later he summed up an experience , A high-performance server should meet the following requirements “ Event driven , Non blocking I/O” Model .C++ It is troublesome to develop , therefore Ryan Just looking for a more advanced language , For rapid development .
It can be said that two things have contributed to Nodejs The birth of . First and foremost ,Ryan Find out JS The language itself is event driven and non blocking I/O Of , It is a perfect match for his train of thought . Second point ,Chrome Of JS engine , That is to say V8 The engine is open source , And the performance is excellent . therefore Ryan Based on V8 Developed Node.js , Be careful Node.js The name sounds like JS library , It's not ,Node.js yes C++ Developed .
Little knowledge points : Blocking I/O
Our programs all have read and write. Blocking I/O In the program , When you call read when , If no data is received , Then the thread or process will be suspended , Until the data .
So Node.js It's not Ku , It's a running environment , Or a JS Language interpreter .
Node.js The initial orientation is to ascend Ryan Your daily work efficiency , It is used to write server code , But what I didn't think of later was Node.js It shines brightly in the front-end field .
Say a few words first Node.js On the server side .Node.js The birth of is a big surprise to people , Traditionally Web developer , Front end with JS Write , But you have to write server-side code in another language , similar Ruby/Java/PHP etc. . however Node.js After appearance ,JS I ate it all back and forth . If you go online to search Node.js Information , A lot of them use Node.js To write server code .
source :https://zhuanlan.zhihu.com/p/47822968
Node.js Advantages and disadvantages
advantage
Single thread : stay Java、PHP perhaps .net Etc. in the server-side language , A new thread will be created for each client connection , And each thread costs about 2MB Memory , In theory, a 8GB The maximum number of users that a memory server can connect to at the same time is 4000 about . Must let Web Applications support more users , You need to increase the number of servers , and Web Of course, the hardware cost of the application goes up .Node.js Do not create a new thread for each client connection , And just one thread . When there are users connected , To trigger an internal event , Through non blocking I/O、 Event driven mechanism , Give Way Node.js The program is also parallel macroscopically . Use Node.js, One 8GB Memory servers , Can handle more than at the same time 4 Million user connections . in addition , The benefits of single threading , And the operating system doesn't have thread creation at all 、 Time cost of destruction .
Non blocking I/O: because CPU The efficiency is much higher than I/O The execution efficiency of the equipment , If you allow CPU To wait I/O Implementation , It will be a great waste of time , Reduce performance , For example, when accessing databases or reading files , In the traditional single thread processing mechanism , After executing the code to access the database or file , The whole thread will pause ( Blocking I/O), Wait for the database or file system to return results before executing the following code .I/O It blocks the execution of the code and greatly reduces the execution efficiency of the program . because Node.js Non blocking type is used in I/O Mechanism , So after executing the code that accesses the database or file , Will immediately switch to other code execution , Put the processing code of the returned result into the callback function , Thus, the execution efficiency of the program is improved . When a I/O At the end of execution , The execution will be notified in the form of an event I/O Thread of operation , The thread performs the callback function for this event . To handle asynchrony I/O, Threads must have event loops , Constantly check whether there is any unhandled event , To deal with in turn . In blocking mode , A thread can only handle one task , To increase throughput, you have to go through multiple threads . Not in blocking mode , A thread is always performing computation operations , Of this thread CPU Core utilization is always 100%. therefore , This is a particularly Philosophical Solution : With more people , But many people are idle ; It's better to die alone , Work in the dead .
Event driven : stay Node in , The client requests to establish a connection , Submit data and so on , Will trigger the corresponding event . stay Node in , In a moment , Only one event callback function can be executed , But in the middle of executing an event callback function , You can turn to other things , Then return the callback function that continues to execute the original event , This processing mechanism , be called “ Event ring ” Mechanism .Node.js The bottom is C++(V8 It's also C++ Written ), In the underlying code , Nearly half of it is used for event queues 、 The construction of callback function queue .
shortcoming
Not suitable for CPU Intensive application ;CPU Intensive application Node.js The main challenges are : because JavaScript Single thread reason , If there is a long running calculation ( Like the big cycle ), Will lead to CPU Time slice cannot be released , Make subsequent I/O Unable to initiate ;
( Solution : Decompose large operation tasks into multiple small tasks , Enable the operation to be released in time , Don't block I/O Call initiation )
Single core only CPU, Underutilization CPU
Low reliability , Once a part of the code crashes , The whole system crashed
Scope of application : When an application needs to handle a large number of concurrent I/O, And before sending a response to the client , When there is no need for very complex processing inside the application ,Node.js Very suitable .Node.js It is also very suitable for web socket coordination , Develop long connected real-time interactive applications . such as : User form collection 、 Examination system 、 The chat room 、 Live video 、 Provide JSON Of API( For the front desk Angular Use ).
https://www.cnblogs.com/zyrblog/p/7545868.html
PHP
PHP It's old school Web Back end development language
PHP It was originally by ludoff in 1995 Developed in
PHP It can be compiled into functions connected to many databases .PHP And MySQL It's a great combination , If you add Apache The server , It is quite perfect .
PHP Dynamically modify the output HTML Show content
Superficial understanding PHP The function is similar to displaying the content after pressing the next page , Or, for example, the web page should show the dynamic time , You also need to use PHP
Python
Powerful language , Needless to say , Almighty God of war ( There seems to be a vacancy in the game )
Python The founder of : Guido van Rossum
selected Python( Python means ) As the name of the programming language , It's because he's a man called Monty Python Fans of comedy groups .
Lots of tutorials , The library is also very rich , In short, it is full of vitality .
function
WEB Development
python comparison php\ruby Of Modular design , It is very convenient for function expansion ; Over the years, a large number of excellent web Development framework , And it's iterative ; Such as the current excellent django、flask, All inherited python Simple 、 Clear style , High development efficiency 、 Easy maintenance , Good integration with automatic operation and maintenance ,python It has become the de facto standard in the field of automatic operation and maintenance platform ; Many large websites are Python Development ,Youtube, Dropbox, douban .
Artificial intelligence
Artificial intelligence developed based on big data analysis and deep learning is essentially inseparable python Support for , At present, the world's excellent artificial intelligence learning frameworks such as Google Of TensorFlow 、FaceBook Of PyTorch And the neural network library of the open source community Karas And so on python Realized , Even Microsoft's CNTK( Cognitive toolkit ) I fully support Python, And Microsoft's Vscode Have put Python Support as a first level language .
The system operational
Python It is very close to the operating system and management , Currently all linux All the distributions have python, And for linux There are a large number of modules available for the relevant management functions in , For example, the current mainstream automated configuration management tools :SaltStack Ansible( At present, it is RedHat Of ). At present, in almost all Internet companies , The standard configuration of automatic operation and maintenance is python+Django/flask, in addition , It is already a de facto standard in virtualization management openstack Namely python Realized , therefore Python It is a necessary skill for all operation and maintenance personnel .
Finance
Quantitative trading , Financial analysis , In the field of financial engineering ,Python Not only in use , And most used , And its importance is increasing year by year . reason : As Dynamic language Of Python, Clear and simple language structure , Rich library , Mature and stable , Scientific calculation and statistical analysis are very powerful , Production efficiency is much higher than c,c++,java, Especially good at strategy back testing
big data
Python Relative to others Interpretive language Its biggest feature is its huge and active scientific computing ecology , In data analysis 、 Interaction 、 There are quite perfect and excellent libraries for visualization (python Data analysis stack :Numpy Pandas Scipy Matplotlip Ipython), And also formed its own unique scientific computing oriented Python Distribution version Anaconda, And it has been rapidly evolving and improving in recent years , Traditional data analysis languages such as R MATLAB SAS Stata Formed a very strong alternative .
graphics GUI
PyQT, WxPython,TkInter
Python advantage
Easy to learn
Especially suitable for beginners Python, Not only is it easy to get started , And in the future , You can write very complex programs .
High development efficiency
Python There is a very powerful third-party library , Basically, you want to do anything with a computer ,Python There are corresponding modules in the official library to support , After direct download and call , Develop again on the basis of basic database , Greatly reduce development cycle , Avoid making wheels repeatedly .
High-level language
When you use Python When programming in language , You don't have to think about the underlying details of how to manage the memory your program uses
Portability
Because of its open source nature ,Python Has been ported to many platforms ( It has been modified to work On different platforms ). If you are careful not to use system dependent features , So all you have Python The program can run on almost all system platforms in the market without modification
Extensibility
If you need a piece of your critical code to run faster or if you want some algorithms to be closed , You can use some of your programs C or C++ To write , And then in your Python They are used in programs .
Embeddable sex
You can take Python Embedded in you C/C++ Program , To provide scripting to your program users .
shortcoming
Slow speed
Python Operating speed of C Language is really slow , Follow JAVA It's slower than that , So it's also a lot of so-called big bulls disdain to use it Python The main reason is , But in fact, the slow running speed referred to here is not directly perceived by users in most cases , Only with the help of testing tools , For example, you use C It's time to run a program 0.01s, use Python yes 0.1s, such C Direct language ratio Python fast 10 times , It's very exaggerated , But you can't feel it directly with the naked eye , Because the smallest unit of time a normal person can perceive is 0.15-0.4s about , ha-ha . In most cases Python It can meet your requirements for program speed , Unless you want to write a search engine with high speed requirements, etc , In this case , Of course, I suggest you use C To achieve the .
Code cannot be encrypted
because Python It's an explanatory language , Its source code is stored in the form of name text , But I don't think it's a disadvantage , If your project requires that the source code be encrypted , You shouldn't have used it in the first place Python Come and go .
Multithreading problem
This is a Python One of the most criticized shortcomings ,GIL Global interpreter lock (Global Interpreter Lock), It is a tool used by computer programming language interpreter to synchronize threads , Make only one thread execute at any time ,Python The thread of is the native thread of the operating system . stay Linux Up for pthread, stay Windows Up for Win thread, The execution of a thread is fully scheduled by the operating system . One python There is a main thread in the interpreter process , And the execution threads of multiple user programs . Even in multicore CPU On the platform , because GIL The existence of , Therefore, multithreading parallel execution is prohibited .
Python Interpreter
CPython
When we are from Python Download and install the official website Python 2.7 after , We've got an official version of the interpreter :CPython. This interpreter uses C Language development , So called CPython. Run on the command line python That is to start. CPython Interpreter .
CPython Is the most widely used Python Interpreter . All the code for the tutorial is also in CPython perform .
IPython
IPython Is based on CPython An interactive interpreter on top , in other words ,IPython It's just a little bit more interactive , But to perform Python Code functions and CPython It's exactly the same . For example, many domestic browsers have different appearance , But the kernel actually calls IE.
CPython use >>> As a prompt , and IPython use In [ Serial number ]: As a prompt .
PyPy
PyPy Is another Python Interpreter , Its goal is speed of execution .PyPy use JIT technology , Yes Python Dynamic compilation of code ( Notice it's not an explanation ), So it can be significantly improved Python Code execution speed .
most Python Code can be found in PyPy Run under , however PyPy and CPython Some are different , This leads to the same Python Code execution under two interpreters may have different results . If your code is to be put in PyPy perform , We need to understand PyPy and CPython The difference between .
Jython
Jython Is running on the Java On the platform Python Interpreter , You can directly Python Code compiled into Java Bytecode execution .
IronPython
IronPython and Jython similar , It's just IronPython It's running at Microsoft .Net On the platform Python Interpreter , You can directly Python Code compiled into .Net Bytecode .
Link to the original text :https://blog.csdn.net/Python99889/article/details/105045171
边栏推荐
- 小鱼儿的处理
- 负数+0+正数
- ROS参数服务器
- Leetcode 1605 find valid matrix given row and Column Sums
- kubernetes 二进制安装(v1.20.15)(七)加塞一个工作节点
- 【ROS】ROSmsg cakin_ Make compilation error
- 【BSP视频教程】BSP视频教程第17期:单片机bootloader专题,启动,跳转配置和调试下载的各种用法(2022-06-10)
- Hooks' design philosophy
- 2022.6.6-----leetcode. seven hundred and thirty-two
- Be careful, these hidden "bugs" of "array" to "collection"“
猜你喜欢

2021-2-14 gephi学习笔记

神经网络极简史,神经网络知识点整理
![[leetcode] merge K ascending linked lists](/img/ff/054b7c14ce678fbdf45af780261b8c.jpg)
[leetcode] merge K ascending linked lists

SAS主成分分析(求相关阵,特征值,单位特征向量,主成分表达式,贡献率和累计贡献率以及进行数据解释)

2.1 ros+px4 simulation - Fixed Point flight control
![[leetcode] delete duplicate Element II in the sorting linked list](/img/24/0f8e4a2d15732997c8eb8973669bf7.jpg)
[leetcode] delete duplicate Element II in the sorting linked list

1.3 introduction to ROS UAV

Yunna PDA wireless fixed assets inventory management system

Sealem finance builds Web3 decentralized financial platform infrastructure

PX4装机教程(六)垂起固定翼(倾转)
随机推荐
Tencent cloud database tdsql- a big guy talks about the past, present and future of basic software
C语言 深度探究具有不定参数的函数
LeetCode 1029 Two City Scheduling (dp)
[recommended by Zhihu knowledge master] castle in UAV - focusing on the application of UAV in different technical fields
CSRF attack
2021-07-18 ROS笔记-基础和通讯
关于概率统计中的排列组合
[ongoing update...] 2021 National Electronic Design Competition for college students (III) interpretation of the anonymous four axis space developer flight control system design
kubernetes 二进制安装(v1.20.15)(七)加塞一个工作节点
Brief description of custom annotations
Record the packaging of the googlechrome browser plug-in
[interpretation of the paper] sort out the papers on the vision based autonomous landing platform of UAV
从解读 BDC 自动生成的代码谈起,讲解 SAPGUI 的程序组成部分试读版
SAS discriminant analysis (Bayes criterion and proc discrim process)
LeetCode 1609 Even Odd Tree (bfs)
[leetcode] reverse linked list II
1.5、PX4载具选择
Daily problem essay | 21.11.29: use resttemplate to call external put request, and prompt '400 bad request'
SAS判别分析(Bayes准则和proc discrim过程)
2021-2-26编程语言知识点整理