githwxi/ATS-Xanadu

Features worth having

antoyo opened this issue · 4 comments

Hi.
I read there that targeting LLVM is the plan.
If that is the case, we would probably need the following features in order to replace inline C:

  • inline assembly (for doing stuff like syscalls).
  • attribute to specify the ABI of a function.
  • maybe something for alignment and packing of records.

I can't think of any other features worth having, but I'll add them to this post as I think of them.

Thanks.

+1 for inline assembly

A package manager like cargo for Rust: https://github.com/rust-lang/cargo

It should be helpful to have string concatenation similar to the C preprocessor. For example, it seems possible that ATS2 could support functions like:

extern fn
string0_concat
    (s1: string,
     s2: string):<fun0>
    string
extern fn
string1_concat {n1,n2:nat}
    (s1: string n1,
     s2: string n2):<fun0>
    string(n1 + n2)

However, it would need a special type for a string literal (a view type?). The goal would be to avoid the need for allocation, so you could concatenate something like $mylocation with a string literal. This idea should be beneficial when combined with templates that get evaluated at compile-time.

While on the topic of general Unicode support in strings (& comments)… Unicode identifiers & fixity operators support.

The old American Standard Code for Information Interchange (ASCII) is highly limiting when communicating in multiple languages or certain concepts that already have established Unicode symbols. I don’t mean dash greater than (->), I mean rightwards arrow () & conveniently there is U+2192 which is precisely what I mean. Nor do I think all identifier should be limited to the English language which tends to lop off accents in the Latin alphabet & the majority of the world uses languages that don’t use the Latin alphabet altogether--or even bicameral scripts.

Before compiler extensions from OCaml were removed, ocaml-m17n had some notable solutions to tackle some common issues.

Notable precedence: theorm proving: Agda, Lean; functional, ML-family: Haskell (with {-# LANGUAGE UnicodeSyntax #-}), PureScript; other languages: APL, Raku