lambda, heap and stack

47 views
Skip to first unread message

Julian Rohrhuber

unread,
Sep 13, 2017, 5:17:56 AM9/13/17
to extemp...@googlegroups.com
Hi, one very basic question to which I could only find unclear answers on the net so far. I’m pretty sure you can help me.

My original understanding was that in order to implement fully first-class functions with lexical scope, you need to go beyond the simple stack memory architecture. The reason is that if you return a function from a function, this will be called outside the nesting structure of the stack. But it seems that somehow C++11 does create lambdas on the stack? How is it done in xtlang?

Best,
Julian

Andrew Sorensen

unread,
Sep 13, 2017, 7:31:13 PM9/13/17
to extemp...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Extempore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julian Rohrhuber

unread,
Sep 14, 2017, 11:36:18 AM9/14/17
to extemp...@googlegroups.com
Hey Andrew,

very good, I get it, up to a point. Your video explains the basics very well.

Once we ask for returning closures from closures, is it right that it is not exactly trivial anymore?

I read a little in Tofte and Talpin 1994, and Aiken et. al 1995, and it seems to be quite a bit of reasoning that must go on under the hood!

Cheers,
Julian
> To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Extempore" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com.

digego

unread,
Sep 21, 2017, 9:36:27 PM9/21/17
to Extempore
Hey Julian,

No, not trivial, at least from a 'human' reasoning perspective.  

Julian Rohrhuber

unread,
Sep 22, 2017, 5:36:06 AM9/22/17
to extemp...@googlegroups.com

> On 22.09.2017, at 03:36, digego <dig...@gmail.com> wrote:
>
> Hey Julian,
>
> No, not trivial, at least from a 'human' reasoning perspective.

So that means that in xtlang we do have a memory structure for this that goes beyond a simple stack?

Thanks!
Reply all
Reply to author
Forward
0 new messages