Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My thoughts while browsing the site:

- function-level type inference much like Rust

- no constness in the type-system (I like it)

- class are reference types, structs are values types, much like D and C#

- runtime dispacthed OO interfaces called "protocols". Blend the difference between runtime or compile-time polymorphism. Classes, structs and enums can implement a protocol. Available as first class runtime values, so the protocol dispatch will be slow like in Golang.

- enumerations are much like Ocaml ADT, can be parameterized by a tuple of values, value types, recursive definitions (nice)

- worrying focus on properties.

- strange closure syntax

- optional chaining, another anti-feature in my eyes

- normal arithmetic operator throws a trap on integer overflow (!). This must be incredibly slow.

- looks like Array is a fat slice to a reference-counted array

- operator overloading is in, supercharged with custom operators, custom precedence (!?)

- builtin tuples syntax

- break with C integer promotion, like Rust.

- no pointers

- convenience is a keyword!

- no exceptions (!)

- unsigned integers: check

- type inference is "bidirectional by expression or statement"

- classes have deterministic destructors, structs have no destructors

- It seems the only RAII source is through RC and classes.

- no single root class

Make your own opinion.



Trap on Overflow is not that expensive: http://www.sei.cmu.edu/reports/10tn008.pdf

I am thrilled they did this. Implicit Overflow is the stupidest shit I know that everyone takes for granted.

Also with CPU support it could be free, and adds negligible complexity to the silicon.


The part of that paper that says how expensive Trap on Overflow is:

> At the `-02` optimization level, our compiler prototype showed only a 5.58% slowdown when running the SPECINT2006 macro-benchmark. Although that percentage represents the worst-case performance for AIR integers (because no optimizations were performed), it is still low enough for typical applications to enable this feature in deployed systems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: