为什么Ada没有垃圾收集器? [英] Why doesn't Ada have a garbage collector?

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

问题描述

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

但是考虑到Ada是一种通用编程语言,为什么它不是一个部分和可选的(只跟踪明确标记的内存对象)垃圾回收器,后来在语言和编译器实现方面的修订版中引入了它。



我根本想不到没有垃圾收集器的普通桌面应用程序。

解决方案

Ada设计时考虑到军事应用。其设计的重点之一是决定论。即一个人想要一个Ada程序,在任何环境下,每次在所有操作系统下始终如一地执行相同的方式......这种事情。



垃圾收集器转向一个应用程序分为两个,相互工作。 Java程序在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.

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

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.

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

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

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