Casting in ATS
bluishcoder.co.nz
bluishcoder.co.nz
Anybody has experienced with both languages? Could you give a quick comparison of the languages?
Lifetimes (typically referred to as "regions" in the literature) come most directly from Cyclone (which first applied Tofte & Talpin's work on regions for ML-ish languages to the systems space). Type-level ownership tracking goes back to ATS (or possibly one of its predecessors, not sure) as well.
What rust does well is package up a lot of this knowledge into something that's actually a usable tool. The ATS compiler spits out some of the worst error messages I've ever seen, and while Xi has done some really incredible groundbreaking stuff, he doesn't have the kind of design sense that it takes to make tools that developers can actually use. It's the little stuff, really -- error messages, tooling, documentation. Some of the instructional material reads like stream-of-conciousness, and clearly doesn't have a specific audience in mind:
http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/...
The biggest fundamental technical difference is dependent types. The Rust community has been flirting with some more limited forms of this; search for "const generics" to see what they're up to.
ATS's version of dependent types is of a different flavor than what's available in e.g. Idris/Agda/Coq, and not as powerful, but still able to do some really impressive things. There are still a lot of low-level tricks that folks regularly pull in C that can't be done in a type/memory-safe way in Rust, but can in ATS. This paper gives a neat example of converting an array to a linked list in-place, which I think is pretty mind-blowing:
http://www.ats-lang.org/MYDATA/SPPSV-padl05.pdf
It's also one of the better descriptons of what's special about ATS.
Case in point:
https://github.com/githwxi/ATS-Postiats/pull/35#issuecomment...
Seriously, "When the dust settles, we will think of better names ..."
Hongwei is a great researcher, but he hasn't displayed particularly good judgment wrt. software engineering, and no amount of external contributors can fix problems that come down to a maintainer who actively pushes bad practices. It was almost heartbreaking to walk away from ATS for me, but I came to the conclusion that I just wasn't going to be able to fix the things that needed fixing while Hongwei was making decisions like these.
At (IIRC) Hac Boston 2012, Edwin Brady gave a talk on what was at the time a very work-in-progress version of Idris. There were several points during the talk where he went to demo some basic feature in the repl, got some nasty error message, and went "oh right, I haven't implemented that yet." But even then, it felt more polished than ATS does now.
I'm still dabbling with Rust, but I have chosen to focus on Shen with type checking turned on. I think Shen will wind up with all I need for proving my code. I have tried Idris too, and I think it will capture a lot of the Haskell crowd, and when it evolves further, be a great alternative to ATS or Rust.
[1] shenlanguage.orgI'd like to improve the speed of the Wasp Shen port too, it's pretty slow compared to the other ports. Still useable though which is good. I used it in a couple of projects, using the FFI to call Wasp's concurrency routines and it worked well.
I left ATS with hopes it would become 'smoother' syntax-wise in the future. I started programming low-level with Basic, C and Asm, went high-level, and now I am back to bit-banging and low-level. I thought Zig and Wasp Lisp would make a tight set of tools for this purpose without being baited to high-end PLs again!