Skip to content
0:00 / 0:00

#ats#systemsprogramming#typesafety

"A (Not So Gentle) Introduction To Systems Programming In ATS" by Aditya Siram

Strange Loop Conference

88K subscribers • 110 videos on Hallway • Conference channel

YouTube
  • Recommended by 5 people: 4 on Hacker News and 1 on Lobsters.
  • A classic. People kept recommending it from 2017 to 2021.
  • Presented by Aditya Siram, Scala developer

Advanced. Deep dive for people who know the field.

25K views9 years ago5 recommendations

Programming languagesSystems programmingLanguage design and type systemsCompilers and interpretersPerformance and optimization

Aditya Siram introduces ATS, a systems programming language compiling to C that offers type-safe pointer arithmetic and formal verification.

The recent surge of interest in secure memory management has sparked a renaissance of type safe systems programming languages. ATS is a statically typed ML that compiles to C and offers what almost no other modern systems language including Rust has: type safe pointer arithmetic. It is unabashedly large and complex featuring a dazzling array of verification tools from advanced type system mechanisms like refinement types right up a full proof language. This talk will use these features to show off the language's incredible power and control with non-trivial examples C interop, concurrency, and GC free low latency servers. No ATS experience is expected but the talk will move fast. Basic experience with C and a type system like Haskell's will be helpful. Aditya Siram COMCAST I work as a Scala developer by day, but write Haskell, Shen, C, Rust and ATS by candlelight. My latest passion is languages like Rust and ATS that use sophisticated type systems that allow safe memory access and high level abstractions over unboxed data structures.

Why it's here

5 people recommend this

What people say. Recommended as an intriguing look at ATS, showcasing how formal verification and advanced type systems can improve on C and Rust.

brendanon Lobsters • Recommends

"A (Not So Gentle) Introduction To Systems Programming In ATS" by Aditya Siram

wahernon Hacker News • Recommends

On “Building on Rock, Not Sand”

> Without these, you simply can’t have a fast, > memory-safe language: either you surrender > speed, by boxing everything, or you surrender safety. Not only can you have speed and safety without Rust's rigid enforcement of exclusive ownership, you can do even better--even faster and with even stronger security guarantees: link to this video link

wahernon Hacker News • Recommends

On “Building on Rock, Not Sand”

How many buffer overflows were involved in the Equifax leak? The ultimate solution to the problem is formal verification. Rust solves this for buffer overflows, but nothing else. It's a one trick pony. Someone posted this interesting nugget on HN the other day: link to this video Aside from some of the awkward ergonomics, its mechanism for formal specification looks brilliant. And you get to keep C's bag-of-bytes object manipulation and pointer arithmetic (when you want it) without having to resort to unsafe{}. For projects where it's worth the effort to carefully declare precise typing semantics (because safety, performance, whatever), I want a wholistic solution. Otherwise my time and money is better…

snakyon Hacker News • Recommends

On “How did software get so reliable without proof? (1996) [pdf]”

If you are interesting in a programming language suitable for system level programming, and using proving techniques, maybe ATS would be of interest. link to this video link

Athason Hacker News • Recommends

On “Supporting Linux kernel development in Rust”

…you can in Rust. I'm not going to claim that ATS is overall better than Rust - it's not - but it's a far more powerful language than Rust for safe systems programming. It's just that most people are not willing or able to pay the very high price in ergonomics. I recommend watching this presentation for a good idea of what ATS programming is like: link to this video In short, it's about as user-friendly as an overheating nuclear reactor.…

rtfeldmanon Hacker News • Recommends

On “The ATS Programming Language”

Some entertaining talks introducing the language, by /u/deech: "A Tase Of ATS" at Compose Conf 2019: link "A (Not So Gentle) Introduction To Systems Programming In ATS" at Strange Loop 2017: link to this video

u/deechin r/haskell • Mentions

On “Is it possible to design a functional language without gc?”

ATS is an ML without a runtime and an optional GC via libgc. I spoke about it at Strange Loop a couple of years ago and more recently did a follow-up at Compose Conference.

u/Disjunction181in r/ProgrammingLanguages • Mentions

On “Are there purely functional languages without implicit allocations?”

ATS gives an unusual level of control to programmers, and allows one to manually manage closures. If you have not seen A (Not So Gentle) Introduction to \[...\ ATS](link to this video it is worth a watch. Note that linear types are not sufficient to avoid heap allocations. They essentially involve reference counting where all counts are either 0 or 1, which makes garbage collection easy. However, terms (e.g., closures) must also be *ordered* to enable stack allocation -- much more complex. Beware that linear types enable garbage collection in a somewhat degenerate way, e.g., a persistent list with a reference count of 8 becomes 8 clones with a reference count of 1 using linear types. Linear types…

u/AthasFutharkin r/ProgrammingLanguages • Mentions

On “ATS Programming”

I have not programmed in it myself, but I have read about it and watched the presentation A (Not So Gentle) Introduction To Systems Programming In ATS. ATS is a lot closer to C than Haskell or Idris, at least regarding the kind of programming it is meant for. You can see ATS as a language that allows you to safely do the things you'd normally do in unsafe C (or Rust), by letting you provide an actual proof that what you're doing is OK. I don't think anyone has ever said ATS is particularly pleasant to program in, but there are some crazy people like Vanessa McHale that actually write real programs in it. I still use her polyglot tool for source code listings. It's the only "real world…

u/theindigamerin r/haskell • Mentions

On “When Rust is safer than Haskell - FP Complete!”

1. ATS has (nearly?) all of the features you've mentioned and the type signatures do get pretty big (see link to this video at 28:09). 2. "How to track and denote multiple things" -- Maybe separation logic is what you're looking for? https://cacm.acm.org/magazines/2019/2/234356-separation-logic/fulltext

u/AthasFutharkin r/ProgrammingLanguages • Mentions

On “Is a language with all errors caught at compile time?”

I'm not sure there is one single trick people use to prove termination. The way it's usually done is that you have some parameter (e.g. a natural number) that you prove decreasing for every recursive call. Coq seems to have an entire battery of various termination checkers, with some discussion here. I saw the video A (Not So Gentle) Introduction To Systems Programming In ATS the other day, and it also talks about it in the context of a language that wants to avoid stack overflows.

u/Disjunction181in r/ProgrammingLanguages • Mentions

On “Formally-Verified Memory Safety in a systems language?”

Yes it's possible, and can be done with substructural, SMT, and dependently typed approaches, roughly in order of increasing power. Not to be dismissive, but this is a "canonical" idea, a lot of people have had this idea for themselves and thought about it. * C++ Dafny lets you use program logic and SMT to prove forms of memory safety like safe array indexing. There's probably some way to prove deallocations safe more generally, but not sure. * ATS is linearly and dependently typed and can let you write proofs to ensure deallocations are safe. There's a pretty well-known strangeloop talk on ATS here. * There's the low\* subset of F\* that is also dependently typed. Since memory safet…

u/jediknightin r/ProgrammingLanguages • Mentions

On “Any ongoing efforts to bring ML dialects to embedded programming?”

> but it seems well beyond my understanding It does **seems** that way and in order to be proficient in ATS I guess it takes a lot of patience. I would however advise a slow stroll through the "Introduction to Programming in ATS", it was a way better experience than it seemed it would be after seeing A (Not So Gentle) Introduction To Systems Programming In ATS. Even today I think that it would be great if someone would create a two language system where the high level is something as easy as Elm and the low level is something as powerful as ATS.

u/ehattiKonnain r/ProgrammingLanguages • Mentions

On “Are there any ML style languages with no runtime?”

You actually don't have to make use of proofs when writing ATS code - the language can totally be functional C if you want it to haha [video In this talk the speaker links to some external C functions and gradually makes them safe with proofs >So ATS can totally mimic C, bugs and all! You can port your C code to the highest fidelity, you can port it line by line if you want to. The type system goes to 11, but it can also go all the way down to C.

u/jediknightin r/ProgrammingLanguages • Mentions

On “Let's talk about interesting language features.”

You need to see A (Not So Gentle) Introduction To Systems Programming In ATS. :)

u/Disjunction181in r/ProgrammingLanguages • Mentions

On “Has anyone attempted to create a pair of programming languages? One high level and one low level?”

F\* and Low\* might be an example; languages for the formal verification of systems code may take this route since you need both the functional aspect for proofs and the systems aspect for implementation. From what I hear, ATS provides users the ability to be as high-level or low-level as you want, Rust may be similar depending on what abstractions you use (RC, higher-order functions, etc).