I think I understand you mean here. In ATS3, I plan to have an evaluator for evaluating compile-time constant expressions. This evaluator can evaluate an expression like tlist_append(constant1, constant2). Of course tlist_append needs to be defined at the sort level first.
On Mon, Apr 9, 2018 at 2:29 AM, Andrew Knapp <[email protected]> wrote: > My one example, serialization of nested records from a tlist of > @(string,t0ype), turned out to not need append. Anyhow, that's blocked for > now, since I don't think you can reflect a template-argument string literal > to the value level. > > But more generally, a convenient way to write functions between datasorts > would be a large step towards very powerful metaprogramming in ATS. > > With a few more features, ATS could have a very clean and conceptually > simple metaprogramming approach: templates are interpreters for datasorts. > Just like a value-level interpreter, it would be nice to separate > generation and evaluation stages. > > People wrote Boost Hana in C++ to do all kinds of computation on > type-level data structures, despite how painful C++ metaprogramming is. > > https://www.boost.org/doc/libs/1_61_0/libs/hana/doc/html/index.html > > ATS is not that far from being Boost.Hana on steroids. > > The typechecking is already there, and is SO. MUCH. BETTER. than the mess > you get when trying to write untyped purely functional programs in C++ > templates. > > For example, if you pass a bool to a template that expects a tlist, the > compiler tells you exactly what happened. > > -- > You received this message because you are subscribed to the Google Groups > "ats-lang-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/ats-lang-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/ats-lang-users/a6a26a70-7b0c-4465-8e0c-f20f2fdba6e0% > 40googlegroups.com > <https://groups.google.com/d/msgid/ats-lang-users/a6a26a70-7b0c-4465-8e0c-f20f2fdba6e0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLofDexGrp%3DTNE2oTjQeuw2Dyi1t0TA%3DtVLg%2B4rDAn3Rvg%40mail.gmail.com.
