Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #74191 > unrolled thread

CAlive utility casks for arbitrary code injection as needed

Started by"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
First post2015-10-29 12:10 -0700
Last post2015-10-30 04:01 -0700
Articles 7 on this page of 67 — 12 participants

Back to article view | Back to comp.lang.c


Contents

  CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-29 12:10 -0700
    Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-29 20:05 +0000
    Re: CAlive utility casks for arbitrary code injection as needed Barry Schwarz <schwarzb@dqel.com> - 2015-10-29 14:36 -0700
      Re: CAlive utility casks for arbitrary code injection as needed asetofsymbols@gmail.com - 2015-10-29 14:55 -0700
      Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-29 15:46 -0700
        Re: CAlive utility casks for arbitrary code injection as needed Barry Schwarz <schwarzb@dqel.com> - 2015-10-29 18:17 -0700
    Re: CAlive utility casks for arbitrary code injection as needed Bartc <bc@freeuk.com> - 2015-10-29 21:48 +0000
      Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-29 16:00 -0700
        Re: CAlive utility casks for arbitrary code injection as needed Ian Collins <ian-news@hotmail.com> - 2015-10-30 14:25 +1300
          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-29 18:41 -0700
            Re: CAlive utility casks for arbitrary code injection as needed Philip Lantz <prl@canterey.us> - 2015-10-29 21:51 -0700
              Re: CAlive utility casks for arbitrary code injection as needed gazelle@shell.xmission.com (Kenny McCormack) - 2015-10-30 13:07 +0000
                Re: CAlive utility casks for arbitrary code injection as needed Philip Lantz <prl@canterey.us> - 2015-11-01 11:45 -0800
            Re: CAlive utility casks for arbitrary code injection as needed Ian Collins <ian-news@hotmail.com> - 2015-10-30 20:34 +1300
              Re: CAlive utility casks for arbitrary code injection as needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-30 02:09 -0700
                Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-10-30 11:12 +0100
                  Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-30 12:03 +0000
                    Re: CAlive utility casks for arbitrary code injection as needed gazelle@shell.xmission.com (Kenny McCormack) - 2015-10-30 13:16 +0000
                    Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-10-30 14:22 +0100
                      Re: CAlive utility casks for arbitrary code injection as needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-30 08:54 -0700
                        Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-30 16:12 +0000
                          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 09:32 -0700
                            Re: CAlive utility casks for arbitrary code injection as needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-30 09:57 -0700
                              Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 10:16 -0700
                              Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-30 18:33 +0000
                                Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-10-30 22:28 +0100
                                  Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-30 23:03 +0000
                                    Re: CAlive utility casks for arbitrary code injection as needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-31 01:35 -0700
                                      Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-31 11:39 +0000
                                        Re: CAlive utility casks for arbitrary code injection as needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-31 12:04 -0700
                                          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-31 17:56 -0700
                                            Re: CAlive utility casks for arbitrary code injection as needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-11-01 03:06 -0800
                        Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 09:28 -0700
              Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 04:24 -0700
                Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-10-30 13:04 +0100
                  Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 06:18 -0700
                    Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-10-30 16:23 +0100
                      Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 09:25 -0700
                      Re: CAlive utility casks for arbitrary code injection as needed gazelle@shell.xmission.com (Kenny McCormack) - 2015-10-30 16:47 +0000
                        Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 10:13 -0700
                          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 10:56 -0700
                        Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-10-31 17:04 +0100
                          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-31 09:48 -0700
                          Re: CAlive utility casks for arbitrary code injection as needed gazelle@shell.xmission.com (Kenny McCormack) - 2015-10-31 17:51 +0000
                            Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-11-01 00:10 +0100
                              Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-31 17:11 -0700
                                Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-11-01 15:24 +0100
                                  Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-01 06:37 -0800
                                    Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-11-01 21:21 +0100
                                      Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-01 16:39 -0800
                                        Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-11-02 02:02 +0100
                                          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-01 17:17 -0800
          Re: CAlive utility casks for arbitrary code injection as needed raltbos@xs4all.nl (Richard Bos) - 2015-11-02 14:24 +0000
          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-02 07:46 -0800
            Re: CAlive utility casks for arbitrary code injection as needed gazelle@shell.xmission.com (Kenny McCormack) - 2015-11-02 16:30 +0000
              Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-02 08:46 -0800
            Re: CAlive utility casks for arbitrary code injection as needed Les Cargill <lcargill99@comcast.com> - 2015-11-02 12:20 -0600
              Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-02 10:23 -0800
              Re: CAlive utility casks for arbitrary code injection as needed David Brown <david.brown@hesbynett.no> - 2015-11-02 20:17 +0100
        Re: CAlive utility casks for arbitrary code injection as needed Bartc <bc@freeuk.com> - 2015-10-30 01:32 +0000
          Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-29 18:59 -0700
            Re: CAlive utility casks for arbitrary code injection as needed Philip Lantz <prl@canterey.us> - 2015-10-29 21:55 -0700
              Re: CAlive utility casks for arbitrary code injection as needed gazelle@shell.xmission.com (Kenny McCormack) - 2015-10-30 13:10 +0000
                Re: CAlive utility casks for arbitrary code injection as needed Philip Lantz <prl@canterey.us> - 2015-11-01 11:45 -0800
            Re: CAlive utility casks for arbitrary code injection as needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-30 10:55 +0000
    Re: CAlive utility casks for arbitrary code injection as needed Philip Lantz <prl@canterey.us> - 2015-10-29 22:00 -0700
      Re: CAlive utility casks for arbitrary code injection as needed "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-30 04:01 -0700

Page 4 of 4 — ← Prev page 1 2 3 [4]


#74222

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2015-10-29 18:59 -0700
Message-ID<b53da9cc-8f8b-4db7-b49f-2a9db7c08fa4@googlegroups.com>
In reply to#74220
On Thursday, October 29, 2015 at 9:32:51 PM UTC-4, Bart wrote:
> On 29/10/2015 23:00, Rick C. Hodgin wrote:
> > On Thursday, October 29, 2015 at 5:48:26 PM UTC-4, Bart wrote:
> >> Does ~|....|~ denote a bit of code that is not immediately evaluated
> >> (maybe like QUOTE in Lisp)?
> >
> 
> > And, they can be dropped in at any point in code:
> >
> >      adhoc value(int x)
> >      {
> >          printf("%d\n", x);
> >      }
> >
> >      printf("%d\n", (|value|x||) some_function(&x) (|value|x||) );
> 
> gcc has an extension which allows you to write this:
> 
>        printf("%d\n", ({value(x); some_function(&x); value(x);}));
>
> The ({....}) syntax allows any set of statements wherever an expression 
> normally goes.
> 
> And standard C obviously allows this:
> 
>   printf("%d\n", (value(x), some_function(&x), value(x)));
>
> With both of these, the value passed to this printf (not the one in 
> value()), is the result of the second value(), although your example 
> doesn't have a return value.
>
> But with your version using 'casks', it is by no means clear what the 
> value of the sequence is either. Is it the result of calling 
> some_function() that is passed to printf(), and the (|value|x||) is 
> executed after?

It is left-to-right, and the return value of casks do not affect
any other results unless they are used as singletons, or in other
casks, even if they have return results.  In all cases where they
are injected into other code, unless they are the only parameter,
their return values are silently ignored.

> So the sequence is:
> 
>     call value(x)
>     call some_function(&x) and push that value for the printf
>     call value(x) again, before calling printf (and before any
>     subsequent arguments for printf)?
> 
> If so, then normal C can emulate that using:
> 
>     printf("%d\n", (value(x), temp=some_function(&x), value(x), temp));
>
> where at least it more obvious what is happening as all constructs are 
> standard.

Yup.  A developer could code that if s/he wanted to.

> Oh, and gcc also has local functions.

Not all C compilers support this.  And only gcc supports this, not g++.
CAlive has in its design support the basic class, and these features.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#74226

FromPhilip Lantz <prl@canterey.us>
Date2015-10-29 21:55 -0700
Message-ID<MPG.309c982aee5f8f8e59@news.eternal-september.org>
In reply to#74222
Rick C. Hodgin wrote:
> Bart wrote:
> > Oh, and gcc also has local functions.
> 
> Not all C compilers support this.  And only gcc supports this, not
> g++.

Standard C++ has local functions, called lambdas, which would be a good 
fit to implement some of the cask examples you've shown in this thread.

[toc] | [prev] | [next] | [standalone]


#74283

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2015-10-30 13:10 +0000
Message-ID<n0vq86$rj2$2@news.xmission.com>
In reply to#74226
In article <MPG.309c982aee5f8f8e59@news.eternal-september.org>,
Philip Lantz  <prl@canterey.us> wrote:
>Rick C. Hodgin wrote:
>> Bart wrote:
>> > Oh, and gcc also has local functions.
>> 
>> Not all C compilers support this.  And only gcc supports this, not
>> g++.
>
>Standard C++ has local functions, called lambdas, which would be a good 
>fit to implement some of the cask examples you've shown in this thread.

What does C++ have to do with anything???

-- 
The problem in US politics today is that it is no longer a Right/Left
thing, or a Conservative/Liberal thing, or even a Republican/Democrat
thing, but rather an Insane/not-Insane thing.

(And no, there's no way you can spin this into any confusion about
who's who...)

[toc] | [prev] | [next] | [standalone]


#74576

FromPhilip Lantz <prl@canterey.us>
Date2015-11-01 11:45 -0800
Message-ID<MPG.309ea622dbb8e0e578@news.eternal-september.org>
In reply to#74283
Kenny McCormack wrote:
> 
> In article <MPG.309c982aee5f8f8e59@news.eternal-september.org>,
> Philip Lantz  <prl@canterey.us> wrote:
> >Rick C. Hodgin wrote:
> >> Bart wrote:
> >> > Oh, and gcc also has local functions.
> >> 
> >> Not all C compilers support this.  And only gcc supports this, not
> >> g++.
> >
> >Standard C++ has local functions, called lambdas, which would be a good 
> >fit to implement some of the cask examples you've shown in this thread.
> 
> What does C++ have to do with anything???

g++ is an implementation of C++.

[toc] | [prev] | [next] | [standalone]


#74265

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2015-10-30 10:55 +0000
Message-ID<87io5ofwxc.fsf@bsb.me.uk>
In reply to#74222
"Rick C. Hodgin" <rick.c.hodgin@gmail.com> writes:

> On Thursday, October 29, 2015 at 9:32:51 PM UTC-4, Bart wrote:
<snip>
>> The ({....}) syntax allows any set of statements wherever an expression 
>> normally goes.
<snip>
>> Oh, and gcc also has local functions.
>
> Not all C compilers support this.  And only gcc supports this, not g++.
> CAlive has in its design support the basic class, and these features.

That's an odd argument to use.  As I understand it, zero compilers
support CAlive and if there ever is one, it will target a far narrower
range of hardware then gcc does.  The argument for a new language must
always be from utility, not ubiquity.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#74227

FromPhilip Lantz <prl@canterey.us>
Date2015-10-29 22:00 -0700
Message-ID<MPG.309c9959999aa7765a@news.eternal-september.org>
In reply to#74191
Rick C. Hodgin wrote:
> 
> One issue I've always had with C is the need sometimes to initialize
> pass-thru values.  I thought this might be a nice way to visualize
> the use of a cask.
> [snip description and examples]

I'm curious about the name "cask". What is its derivation, or is it 
simply a made-up word? If the former, understanding the derivation might 
help me grok the capability. If it's the latter, I wonder if it wouldn't 
be better to use a word that doesn't sound and look so similar to the 
name of an existing C feature.

[toc] | [prev] | [next] | [standalone]


#74268

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2015-10-30 04:01 -0700
Message-ID<cd654941-ccff-4f0f-9fc9-1ba9bb167118@googlegroups.com>
In reply to#74227
On Friday, October 30, 2015 at 1:00:55 AM UTC-4, Philip Lantz wrote:
> Rick C. Hodgin wrote:
> > 
> > One issue I've always had with C is the need sometimes to initialize
> > pass-thru values.  I thought this might be a nice way to visualize
> > the use of a cask.
> > [snip description and examples]
> 
> I'm curious about the name "cask". What is its derivation, or is it 
> simply a made-up word? If the former, understanding the derivation might 
> help me grok the capability. If it's the latter, I wonder if it wouldn't 
> be better to use a word that doesn't sound and look so similar to the 
> name of an existing C feature.

Its name derived from the graphical appearance of the (|cask|) in my
early (mid-1990s) vision for this feature.  With the various pipe
sign characters, it looked like a cask turned over on its side:

    https://pbs.twimg.com/profile_images/613435389513216000/yAzTSy1o.jpg

There are four types of casks in all:

    (|reference|)    -- accesses something that exists
    [|definition|]   -- defines something permanent from the return value
    <|logic|>        -- used near logic to run code based on true/false
    ~|utility|~      -- arbitrary code injection

All casks are sealed quantities which exist as a cask placeholder in
the GUI editor.  They are only expanded when they need to be.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

Back to top | Article view | comp.lang.c


csiph-web