为什么Ada没有垃圾收集器? [英] Why has Ada no garbage collector?

查看:75
本文介绍了为什么Ada没有垃圾收集器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道GC在Ada开发时并不流行,对于嵌入式编程的主要用例,它仍然不是一个好选择。

I know GC wasn't popular in the days when Ada was developed and for the main use case of embedded programming it is still not a good choice.

但是考虑到Ada是一种通用编程语言,为什么在该语言的更高版本和编译器实现中引入了部分和可选(仅跟踪显式标记的内存对象)垃圾收集器。

But considering that Ada is a general purpose programming language why wasn't a partial and optional (traces only explicitly tagged memory objects) garbage collector introduced in later revisions of the language and the compiler implementations.

我简直无法再考虑没有垃圾收集器来开发普通的桌面应用程序了。

I simply can't think of developing a normal desktop application without a garbage collector anymore.

推荐答案

Ada在设计时考虑了军事应用。确定性是其设计中的最大重点之一。也就是说,有人希望Ada程序每次在任何环境下,在所有操作系统下都能始终如一地执行完全相同的方式……有点。

Ada was designed with military applications in mind. One of the big priorities in its design was determinism. i.e. one wanted an Ada program to consistently perform exactly the same way every time, in any environment, under all operating systems... that kinda thing.

一个垃圾收集器会转动一个应用程序一分为二,彼此竞争。当GC决定开始工作时,Java程序会随机间隔出现打ic,如果它太慢了,则有可能应用程序有时会用完堆,而不是其他应用。

A garbage collector turns one application into two, working against one another. Java programs develop hiccups at random intervals when the GC decides to go to work, and if it's too slow about it there's a chance that an application will run out of heap sometimes and not others.

简化:垃圾收集器将某些可变性引入了设计人员不希望的程序中。你弄得一团糟-你把它清理干净!相同的代码,每次都具有相同的行为。

Simplified: A garbage collector introduces some variability into a program that the designers didn't want. You make a mess - you clean it up! Same code, same behavior every time.

请注意,并不是说Ada取得了全球性的成功。

Not that Ada became a raging worldwide success, mind you.

这篇关于为什么Ada没有垃圾收集器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆