How to use pointer chain?

Yes, this is a question I have been asking myself for a long time!

I do not yet have a good solution. I can outline some of my ideas in a
separate message.

The wall is code “dentry->d_sb->s_op->statfs”.
In ATS2, we should create own view and use takeout/addback pattern?

Doing it manually is simply too much work.

Basically, I think we need to implement some kind of meta-programming
support for
handling structs in C.On Mon, Mar 2, 2015 at 8:39 AM, Kiwamu Okabe kiw...@debian.or.jp wrote:

Hi all,

I have read “Preventing heartbleed bugs with safe programming languages”
entry
at BLUISH CODER.

Preventing heartbleed bugs with safe programming languages

It explains re-write C language implementation using ATS, little by little.
So great!

However, my code sometimes meet wall called as “pointer chain”.
The “pointer chain” example is following:

static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)
{
int retval;

    if (!dentry->d_sb->s_op->statfs)
            return -ENOSYS;

    memset(buf, 0, sizeof(*buf));
    retval = security_sb_statfs(dentry);
    if (retval)
            return retval;
    retval = dentry->d_sb->s_op->statfs(dentry, buf);

The wall is code “dentry->d_sb->s_op->statfs”.
In ATS2, we should create own view and use takeout/addback pattern?

Design patterns · githwxi/ATS-Postiats Wiki · GitHub

Or, is there more better solution?

Thank’s,

Kiwamu Okabe at METASEPI DESIGN


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 ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dmOt7CW-aQ%2BTBuby8i%3DRaD2mLqZhMLHx0i4%3DH-n6nwudA%40mail.gmail.com
.

Could we leverage something like operator dot overloading but for → to wrap all of the takeout/addback?> On Mar 2, 2015, at 8:53 AM, Hongwei Xi gmh...@gmail.com wrote:

Yes, this is a question I have been asking myself for a long time!

I do not yet have a good solution. I can outline some of my ideas in a separate message.

The wall is code “dentry->d_sb->s_op->statfs”.
In ATS2, we should create own view and use takeout/addback pattern?

Doing it manually is simply too much work.

Basically, I think we need to implement some kind of meta-programming support for
handling structs in C.

On Mon, Mar 2, 2015 at 8:39 AM, Kiwamu Okabe <kiw…@debian.or.jp mailto:kiw...@debian.or.jp> wrote:
Hi all,

I have read “Preventing heartbleed bugs with safe programming languages” entry
at BLUISH CODER.

Preventing heartbleed bugs with safe programming languages http://bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-safe-languages.html

It explains re-write C language implementation using ATS, little by little.
So great!

However, my code sometimes meet wall called as “pointer chain”.
The “pointer chain” example is following:

static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)
{
int retval;

    if (!dentry->d_sb->s_op->statfs)
            return -ENOSYS;

    memset(buf, 0, sizeof(*buf));
    retval = security_sb_statfs(dentry);
    if (retval)
            return retval;
    retval = dentry->d_sb->s_op->statfs(dentry, buf);

The wall is code “dentry->d_sb->s_op->statfs”.
In ATS2, we should create own view and use takeout/addback pattern?

Design patterns · githwxi/ATS-Postiats Wiki · GitHub https://github.com/githwxi/ATS-Postiats/wiki/Design-patterns#takeout-addback-pattern

Or, is there more better solution?

Thank’s,

Kiwamu Okabe at METASEPI DESIGN


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 ats-lang-user...@googlegroups.com mailto:ats-lang-users...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com mailto:ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dmOt7CW-aQ%2BTBuby8i%3DRaD2mLqZhMLHx0i4%3DH-n6nwudA%40mail.gmail.com https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dmOt7CW-aQ%2BTBuby8i%3DRaD2mLqZhMLHx0i4%3DH-n6nwudA%40mail.gmail.com.


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 ats-lang-user...@googlegroups.com mailto:ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com mailto:ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrbrkuN%3DEB8gRWCbQb28U%3DgU-cGisaOCS25k%2BGEn37gvQ%40mail.gmail.com https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrbrkuN%3DEB8gRWCbQb28U%3DgU-cGisaOCS25k%2BGEn37gvQ%40mail.gmail.com?utm_medium=email&utm_source=footer.

That helps. But I feel it is still too burdensome.On Monday, March 2, 2015 at 9:12:16 AM UTC-5, Shea Levy wrote:

Could we leverage something like operator dot overloading but for → to
wrap all of the takeout/addback?

On Mar 2, 2015, at 8:53 AM, Hongwei Xi <gmh...@gmail.com <javascript:>> wrote:

Yes, this is a question I have been asking myself for a long time!

I do not yet have a good solution. I can outline some of my ideas in a
separate message.

The wall is code “dentry->d_sb->s_op->statfs”.
In ATS2, we should create own view and use takeout/addback pattern?

Doing it manually is simply too much work.

Basically, I think we need to implement some kind of meta-programming
support for
handling structs in C.

On Mon, Mar 2, 2015 at 8:39 AM, Kiwamu Okabe <kiw…@debian.or.jp <javascript:>> wrote:

Hi all,

I have read “Preventing heartbleed bugs with safe programming languages”
entry
at BLUISH CODER.

Preventing heartbleed bugs with safe programming languages

It explains re-write C language implementation using ATS, little by
little.
So great!

However, my code sometimes meet wall called as “pointer chain”.
The “pointer chain” example is following:

static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)
{
int retval;

    if (!dentry->d_sb->s_op->statfs)
            return -ENOSYS;

    memset(buf, 0, sizeof(*buf));
    retval = security_sb_statfs(dentry);
    if (retval)
            return retval;
    retval = dentry->d_sb->s_op->statfs(dentry, buf);

The wall is code “dentry->d_sb->s_op->statfs”.
In ATS2, we should create own view and use takeout/addback pattern?

Design patterns · githwxi/ATS-Postiats Wiki · GitHub

Or, is there more better solution?

Thank’s,

Kiwamu Okabe at METASEPI DESIGN


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 ats-lang...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dmOt7CW-aQ%2BTBuby8i%3DRaD2mLqZhMLHx0i4%3DH-n6nwudA%40mail.gmail.com
.


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 ats-lang...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrbrkuN%3DEB8gRWCbQb28U%3DgU-cGisaOCS25k%2BGEn37gvQ%40mail.gmail.com
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrbrkuN%3DEB8gRWCbQb28U%3DgU-cGisaOCS25k%2BGEn37gvQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.