返回资讯中心
外部精选
软件工程
#开发者实时流

Copper – A minimal low-level programming language with OOP and generics

Copper is a programming language that I use as a replacement to C. The main differences are:

Hacker News 最新bogdanoff_22026/10/30 · 18 天前2 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Copper is a programming language that I use as a replacement to C. The main differences are:

Minimalism is the most important feature, the language is intended to be simple so that someone with limited brain power such as me could fully understand it. The syntax is simple, almost everything is explicit and most constructs are common.

A simple example beyond the pointless "hello world".

class Point attr x: Int attr y: Int

def init(x: Int, y: Int) self.x = x self.y = y end

def translate(dx: Int, dy: Int) self.x += dx self.y += dy end end

func main: Int var pt: Point! pt.init(3, 5) pt.translate(1, 0) println("x = \a, y = \a", pt.x, pt.y) return 0 end

import "std"

More Information

A quick overview of the language

Documentation

Cheat sheet - if you're not interested but want to understand existing code

More examples

Browse standard library source code

Browse compiler source code

License

Copper is released under the BSD license.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →