系统编程语言和应用程序编程语言之间的区别

发布于 2024-10-05 23:33:03 字数 56 浏览 0 评论 0原文

系统编程语言应用程序编程语言之间有什么区别?

What are the differences between a systems programming language and Application programming language?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

別甾虛僞 2024-10-12 23:33:03

我认为应该考虑几个因素

  1. 在系统编程语言中,您必须能够达到低级的东西,接近真实的硬件世界。相反,在应用程序语言中,有一种用该语言设计的“虚拟世界”(希望更好、更容易交互),您只需要能够应对它即可。

  2. 在系统编程语言中,性能方面不应有任何让步。人们必须能够编写能够从硬件中榨取所有能量的代码。在应用程序编程语言中,这不是最大的问题,实际编写程序所需的时间起着更大的作用。

  3. 由于2,系统编程语言可以自由地假设程序员不会犯错误,因此不会有“运行时错误”防护。例如,从数组中建立索引将意味着世界末日,除非硬件免费提供这些检查(但在这种情况下,您可能会选择更便宜或更快的硬件)。这个想法是,如果你假设代码是正确的,那么就没有必要为检查不可能的事情而付出哪怕很小的代价。此外,系统编程语言不应该试图禁止程序员故意做一些她/他想做的事情……假设是她/他知道这是正确的事情。相反,在应用程序编程语言中,它被认为可以很好地帮助程序员检查代码,并尝试强制代码使用某些哲学模式。在应用程序编程语言中,可以牺牲诸如执行速度、键入时间和代码大小之类的东西来试图帮助程序员避免自杀。

  4. 由于 3,系统编程语言将更难通过实验来学习。从某种意义上说,它们是一种强大但危险的工具,人们应该仔细思考每一个语句,并且出于同样的原因,它们是调试更加困难的语言。相反,在应用程序编程语言中,尝试和查看方法可能是合理的(如果虚拟世界抽象没有泄漏太多),并且让错误进入并稍后删除它们被认为是一个可行的选择。

A few factors should in my opinon come into consideration

  1. 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.

  2. 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.

  3. 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.

  4. 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.

兔小萌 2024-10-12 23:33:03

与 IT 领域的许多事情一样,界限是模糊的。例如,C 最初是作为一种系统编程语言(并用于实现 Unix),但过去和现在也用于应用程序开发。

话虽如此,显然有些语言比其他语言更适合系统编程(例如,C/C++ 比 COBOL/FORTRAN 更适合系统编程)。同样,有些语言更适合应用程序开发而不是系统编程,例如。 VB.NET。

从上面的示例中脱颖而出的语言功能是 C/C++ 等系统编程语言的低级功能(例如指针、位操作运算符等)。当然,有一个老笑话说 C 是一种“海”级语言(位于汇编级和“高”级之间)。

警告:我是从操作系统开发人员/操作系统工具开发人员的角度来看待系统编程的。

我认为可以公平地说,尽管有使用 Java 开发操作系统的项目(尽管我相信大多数是本机编译的,而不是字节码和 JIT 编辑/解释的),但系统编程语言的目标是其目标平台的本机机器代码。因此,主要针对托管代码/解释代码的语言不太可能用于系统编程。

无论如何,这肯定足以激起一些支持和反对的评论:)

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.

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.

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).

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.

Anyway, that is surely enough to stir up some comments both in support and in opposition :)

喜爱皱眉﹌ 2024-10-12 23:33:03

这些都不是确切的概念,但本质上,系统编程语言适合编写操作系统(因此它们具有低级概念,如指针、与汇编程序的集成、与内存和寄存器组织相对应的数据类型),而应用程序编程语言更适合编写应用程序,因此它们通常使用更高级别的概念来表示计算(例如 OOP、闭包、内置复杂数据类型等)。

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).

长安忆 2024-10-12 23:33:03

一般来说,系统编程语言的级别低于应用程序编程语言。然而,语言本身与之无关……更多的是语言实现的细节。

例如,Pascal 最初是一种教学语言,严格来说是一种应用程序。然而,它后来演变为一种系统语言,并用于创建 MacOS 和 Windows 的早期版本。

C# 通常不是一种系统语言,因为它无法完成低级工作,尽管随着托管操作系统的出现,这条界限也变得模糊了。

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.

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.

梦中楼上月下 2024-10-12 23:33:03

我认为这里不再有最终答案。

perl 和 python 几乎每个 Linux 发行版都默认配备...两者都可以内联 C...都可以执行作业控制和其他“低级”任务...线程等

任何具有一组良好的系统调用绑定的语言/或 FFI 应该像 C 或 C++ 一样具有基本的系统感知能力。

我唯一认为是系统语言的语言是专门针对另一个平台(jvm、clr)并积极寻求阻止本机交互的语言

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.

any language with a good set of system call bindings and/or FFI should be as fundamentally system-aware as C or 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文