阅读更多

8顶
0踩

编程语言

转载新闻 新编程语言:C--

2008-02-10 17:56 by 见习编辑 jejwe 评论(1) 有6952人浏览
官方网站:http://www.cminusminus.org
引用:

介绍:

C-- 语言是一个编译器的目标语言。该想法是一种一个高层次的语言编译器,转换程序
进入到C --语言,使得C--编译器产生本土代码。

 

1 Introduction
C-- is a compiler-target language. The idea is that a compiler for a high-level language translates programs
into into C--, leaving the C-- compiler to generate native code. C--’s major goals are these:
• C-- encapsulates compilation techniques that are well understood, but difficult to implement. Such
techniques include instruction selection, register allocation, instruction scheduling, and optimization
of imperative code with loops.
• C-- is a language, rather than a library (such as gcc’s RTL back end). As such, it has a concrete syntax
that can be read by people, and a semantics that is independent of any particular implementation.
• C-- is a portable assembly language. It is, by design, as low-level as possible while still concealing
details of the particular machine architecture.
• C-- is independent of both source programming language and target architecture. Its design accom-
modates a variety of source languages and leaves room for back-end optimization, all without upcalls
from the back end to the front end.
• C-- is efficient—or at least admits efficient implementation. So C-- provides almost as much flexibility
and performance (assuming a good C-- compiler) as a custom code generator.
A client of C-- is divided into two parts. The front-end compiler generates programs written in the C--
language, which the C-- compiler translates into efficient machine code. This code interoperates with the
front-end run-time system, which implements such services as garbage collection, exception dispatch, thread
scheduling, and so on. The front-end run-time system relies on mechanisms provided by the C-- run-time
system; they interact through the C-- run-time interface. This document describes the C-- language and
run-time interface. It is intended for authors who wish to write clients of the C-- system.
The C-- team has prepared some demonstration front ends that may help you learn to use C--.
• Paul Govereau’s tigerc compiler includes a compiler for Tiger (the language of Andrew Appel’s
compiler text) as well as a small run-time system with garbage collector. The tigerc compiler is
written in Objective Caml.
• Norman Ramsey’s lcc back end works with lcc to translate C into C--. It is written in C.
• Reuben Olinsky’s interpreter, which is packaged with the Quick C-- sources, includes sample run-time
clients for garbage collection and exception dispatch.
All this code is available through the C-- web site at http://www.cminusminus.org.
1.1 What C-- is not
C-- has some important non-goals:
• C-- is not an execution platform, such as the Java Virtual Machine or the .NET Common Language
Runtime. These virtual machines are extremely high-level compared to C--. Each provides a rich type
system, garbage collector, class loader, just-in-time compiler, byte-code verifier, exception-dispatch
mechanism, debugger, massive libraries, and much more besides. These may be good things, but
they clearly involve much more than encapsulating code-generation technology, and depending on your
language model, they may impose a significant penalty in both space and time.
6
• C-- is not “write-once, run-anywhere”. It conceals most architecture-specific details, such as the
number of registers, but it exposes some. In particular, C-- exposes the word size, byte order, and
alignment properties of the target architecture, for two reasons. First, to hide these details would
require introducing a great deal of complexity, inefficiency, or both—especially when the front-end
compiler needs to control the representation of its high-level data types. Second, these details are easy
to handle in a front-end compiler. Indeed, a compiler may benefit, because it can do address arithmetic
using integers instead of symbolic constants such as FloatSize and IntSize.



一个C--的例子:
<!---->
来自: ubuntu
8
0
评论 共 1 条 请登录后发表评论
1 楼 liyaxi 2010-08-05 13:39
真的需要新语言了吗?  
那些不变的才是永恒的, 高手是用铅笔写代码的! 自己脑子里去调试的!

发表评论

您还没有登录,请您登录后再发表评论

相关推荐

  • ruby 报表统计--生成柱状图和饼图

    生成统计报表用的柱状图和饼图,支持多语言,如日语,法语,英语,中文等。

  • Chartkick用一行Ruby代码创建漂亮的JavaScript图表

    Chartkick用一行Ruby代码创建漂亮的JavaScript图表

  • 21种常见大数据可视化图表

    为什么数据可视化如此重要?数据可视化能把枯燥的数据变得有趣起来,不用再成千上万的数据面前焦头烂额。这里小结了下21中常见的图表。附图有的是我从excel生成的,有的是比较懒直接百度找的。柱状图最常使用的图表之一用垂直或水平的柱子表示不同分类数据的数值大小虽然能展示数据的变化趋势,但这并非它的强项堆积柱状图适用于包含若干个小分类的分组数据的可视化用于比较同一分组内不同分类的数据,或者各组的总量无法比...

  • Chartkick:一行代码即可绘制出漂亮的图表

    Chartkick是一个图表绘制工具,特点是UI美观、使用简单,并且支持IE6在内的大多数浏览器。之所以说它使用简单,是因为只需要一行Ruby代码即可绘制出漂亮的图表! 比如你需要一个线状图: 1 :created_at).count %> 绘制一个饼状图: 1 "nam

  • 15款经典图表软件推荐 创建最漂亮的图表

    <br /><br />在这篇文章中,我将列出图表,图形和数据可视化的最佳软件,从创建基本的2D图表到产生复杂的数据集的数据可视化,这些PHP,Javascript、Flash的图表,对于任何一个严谨的开发者都是必须一览的。 <br /><br />1.Fusion Charts<br />FusionCharts v3帮助创建Web或企业应用的动画/交互的图表。企业级图表组件支持PCs, Macs, iPads, iPhones,以及大量其他的手机设备。<br /><br />2.Maani<br />b

  • mysql recyclebin_MySQL防误删插件Recycle-Bin简介

    1. Recycle_bin简介Recycle_bin是一款MySQL插件,可以在不修改任何MySQL代码的情况下,自动备份MySQL中被Drop的数据库/表,在出现人为误操作删表时,可以快速的进行恢复。实现灵感来源于Oracle flashback的功能,...

  • mysql复制的文件_mysql能不能通过直接拷贝mysql文件夹的方式

    MySQL复制使得一台MySQL数据库服务器的数据被拷贝到其他一台或者多台数据库服务器,前者通常被叫做Master,后者通常被叫做Slave。 MySQL复制示意图 复制的结果是集群(Cluster)中的所有数据库服务器得到的数据理论...

  • mysql 5.7 安装(收藏防迷路)

    1、下载下载文件为:mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar (解压版)2、卸载原来安装的mysql#检查#卸载 remove后为上面命令查询到的内容,全文件名3、解压文件到安装目录4、软连接#在/usr/local/目录下创建到/...

  • mysql 拷贝数据库_mysql 直接复制数据库怎么导入

    MySQL复制使得一台MySQL数据库服务器的数据被拷贝到其他一台或者多台数据库服务器,前者通常被叫做Master,后者通常被叫做Slave。 MySQL复制示意图 复制的结果是集群(Cluster)中的所有数据库服务器得到的数据理论...

  • 【Mysql】mysql命令常用语句

    文章目录 常用指令 改库表...事务 修改表名 表字段 Alter 索引 临时表 复制表 元数据 MYSQL序列 处理重复数据 SQL 注入 待完善 实践 导入导出 函数 coalesce返回第一个非null值 运算符 常用指令 改库表索引 参考文档 ...

  • 如何用Gruff生成图表

    Gruff 是使用ruby编写的Ruby图标库,可以创建包括直线图,柱状图,饼状图在内的多种图表. Github:[url]http://github.com/topfunky/gruff[/url] 安装: [code=&quot;Ruby&quot;]gem install gruff[/code] (1)直线图 [code=&quot;Ruby&quot;]#请注意,这个文件千万不能命名为gruff.rb...

  • 6款经典图表软件推荐

    6款经典图表软件推荐 图表解决方案数据可视化图表库  1.FusionCharts XT 伦理片 http://www.dotdy  .com/ FusionCharts XT是跨平台、跨浏览器的JavaScript/HTML图表组件。 FusionCharts支持 ASP、 ASP.NET、 PHP、 JSP、 ColdFusion、 Ruby on Rails、

  • Rails 图表解决方案汇总

    最近需要给 抢座 增加图表功能,于是对Rails的图表方案做了些调查,整理成这篇贴,希望对有同样需求的人有所帮助。 Google Chart Google Chart的优点是接口简单,容易上手,但是缺点也很明显,需要依赖Google的服务,在有些地方加载可能会存在速度问题,并且有被GFW的风险。 Google Chart的Rails插件很多,个人比较喜欢mattetti的goog

  • linux成功mysql数据直接拷贝_mysql数据库数据从一个linux系统移植到另一个linux系统的方法...

    背景问题介绍现在有一个linux系统的...主要是有三种方法 1、直接拷贝数据文件2、使用mysqldump来导入导出3、采用专用工具前两种方法是比较常见,因此在试用了第一种方法成功之后就采用了第一种方法环境A机器:cen...

  • MySQL数据库面试题(2020最新版)

    数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4...

  • mysql数据库备份与恢复

    物理备份恢复速度比较快,但占用空间比 较大,MySQL中可以用 xtrabackup 工具来进行物理备份 逻辑备份:对数据库对象利用工具进行导出工作,汇总入备份文件内。逻辑备份恢复速度慢,但占用空 间小,更灵活。MySQL 中...

  • MySQL 精选 60 道面试题(含答案)

    我们来看下Redo log的执行流程,假设执行的 SQL 如下: update T set a =1 where id =666 MySQL 客户端将请求语句 update T set a =1 where id =666,发往 MySQL Server 层。 MySQL Server 层接收到 SQL 请求后,对...

  • 检测MySQL的表的故障的方法

    在开始修复之前对表文件进行拷贝,以保证数据的安全。 开始修复数据库表。 如果修复失败,从数据库的备份或更新日志中恢复数据。 在使用myisamchk或isamchk检查或修复表之前,应该首先注意: 建立数据库备份和使用...

Global site tag (gtag.js) - Google Analytics