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

ATS is far better than Rust and C.


I don't know, Rust has Mozilla behind it, and lots of active development and (for a new programming language) a pretty decent community.

ATS is hosted on SourceForge, and looks to be someone's research project. That's totally fine, and it may actually be _better_, but the real world often doesn't care about better.

If I was a betting man, I'd be putting chips down on Rust. (and I sort of am...)

That said, the more programming languages the merrier!


Rust may be more successful but at this time ATS is a better C replacement. Mainly because Rust is currently tied to a runtime and garbage collector. But also because ATS has better features for describing the API boundaries when calling into C and back (ie. FFI).

Rust will grow into these areas I'm sure because Mozilla will need them for Servo and safer programming.


Seems fair.


Care to motivate? I am curious, I don't know ATS


The positives about C:

It's high-level assembly language. Thus, it allows you to write code with a very small barrier between you and the machine instructions, but with enough of a barrier that you can reuse and organize your code logically. At the same time, it gives you most of the speed and raw bit manipulation of machine code.

The negatives about C:

You're almost as likely to introduce completely silent catastrophic memory corruption with every operation than you are to actually accomplish the task you're trying to do. Most of the things which would normally be bugs are also now major security breaches. C's structure also makes it extremely difficult to do static analysis, making it difficult to find bugs, security vulnerabilities, and make performance optimizations.

How ATS helps:

ATS addresses a lot of these issues by emitting efficient C code. However, at a higher level ATS combines C with an extremely strong type system (dependent typing) which allows you to do things like verify statically that there are no out-of-bound memory accesses through typing. It can do even stronger things like prove your code correct.


Here's an example of how ATS makes a C API safer, similar to the API in the K&R example (it deals with memory/string copying): http://www.bluishcoder.co.nz/2012/08/30/safer-handling-of-c-...

ATS provides all the low level hackery that C can do but allows more information to be encoded in types to ensure that is safe. It also provides high level features from functional programming languages like higher order functions, pattern matching, etc.




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

Search: