Live data from Hacker News

Circle: C++ Automation Language

circle-lang.org

1–10 of 27 posts

Re: Circle: C++ Automation Language

#2
This project feels similar in spirit to Zig, which has robust compile time evaluation and reflection.

The cool part about Zig is that it uses this ability (via the `comptime` keyword) to power it’s generic system, and not vice versa (looking at you, Turing complete type systems)

https://ziglang.org/learn/overview/#generic-data-structures-...

Re: Circle: C++ Automation Language

#5

This seems useful for code generation. Cannot relate this to any previous problems I encountered using c++ Any other interesting use of this?

Seems that it could be used to solve an old-time classic: generate a mapping from an enum value to its string representation. Another use case that comes to my mind is maybe automating test case generation. Occasionally I was running into situations where I thought code generation could be useful, but not sure what could be a "killer app" equivalent for this feature.

Related topic: standardizing reflection in c++. https://youtu.be/ARxj3dfF_h0 https://en.cppreference.com/w/cpp/keyword/reflexpr

Re: Circle: C++ Automation Language

#6
post #4

Ah yes, we've come full "circle" and C++ has tacked on D's metaprogramming and CTFE abilities.

Which reveals the problem D has finding any relevant niche, as the community cannot decide into which direction to head into.

Java and C# also have acquired many capabilities that for 10 years were a plus from D over them.

Re: Circle: C++ Automation Language

#7
post #4

Ah yes, we've come full "circle" and C++ has tacked on D's metaprogramming and CTFE abilities.

This was an explicit design intent from early days of C++. I remember discussing Lisp's macro capabilities with Stroustrup back in the early 90s and him saying he had always wanted to have that in C++ and templating was the first step.

Shame it took so long to actually arrive.

Re: Circle: C++ Automation Language

#8

This seems useful for code generation. Cannot relate this to any previous problems I encountered using c++ Any other interesting use of this?

Imagine using this to build a balzingly fast serialization library that you’d use like protobufs. Or to explore lots of configurations of your code to search for the variant that runs fastest. Or to write a linear algebra library that doesn’t generate temporary values that are dynamically allocated.

Re: Circle: C++ Automation Language

#9
post #5

This seems useful for code generation. Cannot relate this to any previous problems I encountered using c++ Any other interesting use of this?

Seems that it could be used to solve an old-time classic: generate a mapping from an enum value to its string representation. Another use case that comes to my mind is maybe automating test case generation. Occasionally I was running into situations where I thought code generation could be useful, but not sure what could be a "killer app" equivalent for this feature. Related topic: standardizing reflection in c++. ht…

that would be great :-)

Re: Circle: C++ Automation Language

#10
post #2

This project feels similar in spirit to Zig, which has robust compile time evaluation and reflection. The cool part about Zig is that it uses this ability (via the `comptime` keyword) to power it’s generic system, and not vice versa (looking at you, Turing complete type systems) https://ziglang.org/learn/overview/#generic-data-structures-...

Technically comptime makes zig Turing complete (except that you have a finite number of branches available to consume during comptime).
Post reply on HN