java 系统编程语言和应用程序编程语言之间的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4343014/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between Systems programming language and Application programming languages
提问by Srinivas Reddy Thatiparthy
What are the differences between a systems programming language
and Application programming language
?
asystems programming language
和之间有什么区别Application programming language
?
回答by 6502
A few factors should in my opinon come into consideration
我认为应该考虑几个因素
In a system programming language you must be able to reach low-level stuff, getting close to the real hardware world. In an application language instead there is a sort of "virtual world" (hopefully nicer and easier to interact with) that has been designed with the language and you only need to be able to cope with that.
In a system programming language there should be no concession in terms of performance. One must be able to write code that squeezes out all the juice from the hardware. This is not the biggest concern in an application programming language, where the time needed to actually write the program plays instead a greater role.
Because of 2 a system programming language is free to assume that the programmer makes no mistake and so there will be no "runtime error" guards. For example indexing out of an array is going to mean the end of the world unless the hardware gives those checks for free (but in that case you could probably choose less expensive or faster hardware instead). The idea is that if you assume that the code is correct there is no point in paying even a small price for checking the impossible. Also a system programming language shouldn't get into the way trying to forbid the programmer doing something s/he wants to do intentionally... the assumption is that s/he knows that is the right thing to do. In an application programming language instead it's considered good helping the programmer with checking code and also trying to force the code to use certain philosophical schemas. In application programming languages things like execution speed, typing time and code size can be sacrificed trying to help programmers avoiding shooting themselves.
Because of 3 a system programming language will be much harder to learn by experimentation. In a sense they're sort of powerful but dangerous tools that one should use carefully thinking to every single statement and for the same reason they're languages where debugging is much harder. In application programming languages instead the try-and-see approach may be reasonable (if the virtual world abstraction is not leaking too much) and letting errors in to remove them later is considered a viable option.
在系统编程语言中,你必须能够接触到底层的东西,接近真实的硬件世界。相反,在应用程序语言中,有一种用该语言设计的“虚拟世界”(希望更好,更容易交互),您只需要能够应对它。
在系统编程语言中,不应在性能方面做出让步。必须能够编写出从硬件中榨取所有汁液的代码。在应用程序编程语言中,这不是最大的问题,实际编写程序所需的时间在其中起着更大的作用。
由于 2 系统编程语言可以自由地假设程序员不会出错,因此不会有“运行时错误”保护。例如,索引数组将意味着世界末日,除非硬件免费提供这些检查(但在这种情况下,您可能会选择更便宜或更快的硬件)。这个想法是,如果你假设代码是正确的,那么即使付出很小的代价来检查不可能的事情也是没有意义的。此外,系统编程语言不应该试图禁止程序员故意做他/她想做的事情……假设他/他知道这是正确的做法。在应用程序编程语言中,它' 被认为有助于程序员检查代码并尝试强制代码使用某些哲学模式。在应用程序编程语言中,可以牺牲诸如执行速度、打字时间和代码大小之类的东西来帮助程序员避免射击自己。
由于 3 系统编程语言将更难通过实验学习。从某种意义上说,它们是一种强大但危险的工具,应该仔细考虑每一条语句,出于同样的原因,它们是调试难度更大的语言。相反,在应用程序编程语言中,试一试的方法可能是合理的(如果虚拟世界抽象没有泄漏太多),并且让错误在以后删除它们被认为是一个可行的选择。
回答by Peter G. McDonald
As with a great many things in IT, the line is blurry. For example, C started its life as a systems programming language (and was used to implement Unix), but was and is used for applications development too.
与 IT 中的许多事情一样,这条线是模糊的。例如,C 最初是作为一种系统编程语言(并用于实现 Unix),但过去和现在也用于应用程序开发。
Having said that, there are clearly some languages better suited to systems programming than others (eg. C/C++ are better suited than COBOL/FORTRAN for systems programming). Likewise there are languages that are better suited to applications development and not systems programming eg. VB.NET.
话虽如此,显然有些语言比其他语言更适合系统编程(例如,C/C++ 比 COBOL/FORTRAN 更适合系统编程)。同样,有些语言更适合应用程序开发而不是系统编程,例如。VB.NET。
The language features that stand out from the examples above, are the low level features of the systems programming languages like C/C++ (eg. pointers, bit manipulation operators, etc). There is of course the old joke that C is a "Sea" level language (sitting somewhere between the assembly level and the "high" level).
从上面的例子中脱颖而出的语言特性是系统编程语言的低级特性,如 C/C++(例如,指针、位操作运算符等)。当然有一个老笑话,C 是一种“海”级语言(介于汇编级和“高级”级之间)。
Warning: I'm coming at systems programming from the perspective of OS developer / OS tool developer.
警告:我是从操作系统开发人员/操作系统工具开发人员的角度来进行系统编程的。
I think it is fair to say, notwithstanding the projects to develop OSes with Java (though I believe mostly are native compiled, rather than to byte code and JIT'ed / interpreted), that systems programming languages target native machine code of their target platforms. So languages that primarily target managed code / interpreted code are less likely to be used for systems programming.
我认为可以公平地说,尽管有使用 Java 开发操作系统的项目(尽管我认为大多数是本机编译的,而不是字节码和 JIT 化/解释),但系统编程语言的目标是其目标平台的本机机器代码. 因此,主要针对托管代码/解释代码的语言不太可能用于系统编程。
Anyway, that is surely enough to stir up some comments both in support and in opposition :)
无论如何,这肯定足以激起一些支持和反对的评论:)
回答by J S
These are not exact concepts, but in essence, systems programming languages are suitable for writing operating systems (so they have low-level concepts such as pointers, integration with assembler, data types corresponding to memory and register organization), while the application programming languages are more suitable for writing applications, so they generally use higher-level concepts to represent the computation (such as OOP, closures, in-built complex datatypes and so on).
这些不是确切的概念,但本质上,系统编程语言适合编写操作系统(因此它们具有低级概念,例如指针、与汇编器的集成、与内存和寄存器组织相对应的数据类型),而应用程序编程语言更适合编写应用程序,因此它们通常使用更高级别的概念来表示计算(例如 OOP、闭包、内置复杂数据类型等)。
回答by Erik Funkenbusch
In general, a systems programming language is lower level than applications programming languages. However, the language itself has nothing to do with it.. it's more the particulars of the implementation of the language.
一般来说,系统编程语言的级别低于应用程序编程语言。然而,语言本身与它无关......更多的是语言实现的细节。
For example, Pascal started life as a teaching language, and was pretty much strictly applications.. however, it was evolved into a systems language and was used to create early versions of MacOS and Windows.
例如,Pascal 最初是作为一种教学语言而诞生的,并且严格来说是一种应用程序……然而,它已经演变成一种系统语言,并被用于创建早期版本的 MacOS 和 Windows。
C# is not, typically a systems language because it cannot do low-level work, although even that line is blurred as managed operating systems come into being.
C# 不是,通常是一种系统语言,因为它不能做低级工作,尽管随着托管操作系统的出现,即使这条线也变得模糊了。
回答by Brad Clawsie
i don't think there is a final answer here anymore.
我认为这里不再有最终答案。
perl and python come by default with almost every linux distro...both can inline C...both can do job control and other "low level" tasks...threading etc.
几乎每个 Linux 发行版都默认使用 perl 和 python ……两者都可以内联 C……两者都可以进行作业控制和其他“低级”任务……线程等。
any language with a good set of system call bindings and/or FFI should be as fundamentally system-aware as C or C++.
任何具有一套良好的系统调用绑定和/或 FFI 的语言都应该像 C 或 C++ 一样具有系统感知能力。
the only languages i would discount as being systems languages are those that specifically address another platform (jvm, clr) and actively seek to prevent native interaction
我认为作为系统语言的唯一语言是那些专门针对另一个平台(jvm、clr)并积极寻求防止本地交互的语言