comp.lang.ada
 help / color / mirror / Atom feed
* Compile-time function execution.
@ 2017-06-05 23:49 Shark8
  2017-06-06 13:15 ` AdaMagica
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shark8 @ 2017-06-05 23:49 UTC (permalink / raw)


I recently came across this article describing a compile-time sort in D -- https://dlang.org/blog/2017/06/05/compile-time-sort-in-d/ -- and vaguely recall reading something on how Ada could have compile-time execution of functions too.

Does anyone have a similar example in Ada?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compile-time function execution.
  2017-06-05 23:49 Compile-time function execution Shark8
@ 2017-06-06 13:15 ` AdaMagica
  2017-06-15 21:38 ` Olivier Henley
  2017-06-18  0:49 ` Ivan Levashev
  2 siblings, 0 replies; 4+ messages in thread
From: AdaMagica @ 2017-06-06 13:15 UTC (permalink / raw)


There is a chapter 4.9 about static expressions in the RM, but the D examples are far beyond Ada's capabilities with the present rules.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compile-time function execution.
  2017-06-05 23:49 Compile-time function execution Shark8
  2017-06-06 13:15 ` AdaMagica
@ 2017-06-15 21:38 ` Olivier Henley
  2017-06-18  0:49 ` Ivan Levashev
  2 siblings, 0 replies; 4+ messages in thread
From: Olivier Henley @ 2017-06-15 21:38 UTC (permalink / raw)


On Monday, June 5, 2017 at 7:49:14 PM UTC-4, Shark8 wrote:
> I recently came across this article describing a compile-time sort in D -- https://dlang.org/blog/2017/06/05/compile-time-sort-in-d/ -- and vaguely recall reading something on how Ada could have compile-time execution of functions too.
> 
> Does anyone have a similar example in Ada?

Speaking of which: https://hookrace.net/blog/what-is-special-about-nim/

It covers short and sweet, CTFE, Template and Macros(analyze and manipulate the AST) in Nim. Great stuff.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compile-time function execution.
  2017-06-05 23:49 Compile-time function execution Shark8
  2017-06-06 13:15 ` AdaMagica
  2017-06-15 21:38 ` Olivier Henley
@ 2017-06-18  0:49 ` Ivan Levashev
  2 siblings, 0 replies; 4+ messages in thread
From: Ivan Levashev @ 2017-06-18  0:49 UTC (permalink / raw)


06.06.2017 6:49, Shark8 пишет:
> I recently came across this article describing a compile-time sort in
> D -- https://dlang.org/blog/2017/06/05/compile-time-sort-in-d/ -- and
> vaguely recall reading something on how Ada could have compile-time
> execution of functions too.
>
> Does anyone have a similar example in Ada?
>
What about mere (inspectable) source generation? QtAda has sample of 
integrating amoc into GPR.

That's the way to go, I believe, more often, than not.

Best Regards,
Ivan Levashev,
Barnaul

--
If you want to get to the top, you have to start at the bottom

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-18  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 23:49 Compile-time function execution Shark8
2017-06-06 13:15 ` AdaMagica
2017-06-15 21:38 ` Olivier Henley
2017-06-18  0:49 ` Ivan Levashev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox