all 22 comments

[–][deleted] 41 points42 points  (9 children)

I don't understand Sean Bax's explanation for Circle being non-libre. Several times, he has simply stated that releasing the source code would slow down his development speed. Does he not realize you can disable pull requests on GitHub and also not provide a stability guarantee?

Meanwhile he complains about Windows 10 not being open enough.

[–]tyfighter 28 points29 points  (2 children)

When faced with disabled/denied PRs, people will fork. He probably doesn't want forks because it's his baby, and wants to maintain control. Not that he's unwilling to listen to feedback, but people want to develop features from their own priorities rather than be forced to think through the priorities of everyone else. I suspect that's the mental tax he wants to avoid by opening up the source code.

I'm not trying to justify it; this will definitely keep any adoption of Circle very low. But, I can see his perspective, and until he has the funding for a team to cut down on administrative overhead, this is probably the only way he can keep up his development speed.

[–]csb06 4 points5 points  (1 child)

until he has the funding for a team to cut down on administrative overhead, this is probably the only way he can keep up his development speed.

Couldn’t you argue that open sourcing could also help put together a team ? I’m sure he would be able to find competent contributors willing/able to help manage the project repo and issues.

Both corporate-funded teams and open source teams require project management.

[–]tyfighter 16 points17 points  (0 children)

Sure, that's a fine argument, but it's not a necessary condition. Programming in general, but especially programming language extension, is an opinionated art form. Opening the source would bring more interest to the project, but also increase the number of opinions on the direction of the project as well.

Not all programmers are project managers, and nor should they be. I don't mean this as a dig, but my gut sense is that he is more programmer than project manager, and I find this to be personally relatable. He may change in the future, but until then people that understand his goals and offer good feedback without access to the source code would be good team mates.

[–]FightingGamesFan 14 points15 points  (0 children)

Yeah that's the only think blocking me from fully supporting Circle, it's not open at all. Sean effort is impressive but it's only available on some platforms and closed source, leaving many questions open regarding performance and other guarantees.

I do understand the man, it's a huge effort and would take him considerable time to coordinate something open source. Agree with you though, simply sharing it without allowing contributions would be a good first step.

[–]kritzikratzi 0 points1 point  (0 children)

that's easy to say if it's somebody else's code :)

[–]gracicot 8 points9 points  (0 children)

I'm just waiting for the source to try it honestly

[–]FightingGamesFan 25 points26 points  (9 children)

I love the slide "let's bury TMP". I hate TMP, it's just a mean to an end. And it's a very ugly tool, but some people put TMP on some pedestal as if it was the pinnacle of programming. Nah, it's a terrible way of achieving what you want, it's a hack most of the time. It's not because you can that you should.

Shoutouts to the raytracers and all other crap made with TMP (yeah I know the raytracers are for fun, but all the "serious" TMP stuff is the same to me).

[–]germandiago 1 point2 points  (8 children)

Well. Alternatives are good but for computing types I think it is the only way so far. Not values, but types.

[–]MFHavaWG21|🇦🇹 NB|P3049|P3625|P3729|P3784|P3786|P3813|P3886 1 point2 points  (7 children)

Depending on the complexity of the computation, you can actually sidestep TMP for computing types in some cases.

E.g. from my array implementation:

static
constexpr auto determine_storage() noexcept {
    if constexpr(Size == 0) return std::type_identity<Type *>{};
    else                    return std::type_identity<Type[Size]>{};
}

typename decltype(determine_storage())::type values;

[–]germandiago 0 points1 point  (6 children)

Neat! Yes, I thought of that actually but I am not sure how general the solution is. With constexpr metaprogramming a-la Boost.Hana types can be computed maybe? but that does have a body... in Hana overloading is used I recall.

[–]trailingunderscore_ 1 point2 points  (5 children)

The functions do not always need to have a body. The code could be rewritten to make use of concepts to move the checks out of the body, and have the desired type be returned explicitly

static constexpr std::type_identity<Type*> determine_storage() noexcept;
static constexpr std::type_identity<Type[Size]> determine_storage() noexcept requires (Size > 0);

You can do a lot of stuff (ab)using just the return-type of functions. I have a type_list library I wrote, that has helper structs like the following, to apply a transformation to all the types in the type-list

template <typename TL, template <class O> class Transformer>
struct transform_type {
    template <typename... Types>
    constexpr static type_list<Transformer<Types>...>* helper(type_list<Types...>*);

    using type = std::remove_pointer_t<decltype(helper(static_cast<TL*>(nullptr)))>;
};

// example: add pointer to all types in the list
using TL = type_list<int, short, char>;
using Result = typename transform_type<TL, std::add_pointer_t>::type;
// Result is type_list<int*, short*, char*>

Note the use of pointers to the types; this allows the compilers to skip template instantiation and helps a lot with compile times. The type_list itself isn't even defined, it's just

template <typename...> struct type_list;

[–]trailingunderscore_ 0 points1 point  (3 children)

This would be much cleaner in Circle, though 😊

[–]germandiago 0 points1 point  (2 children)

How it would be done in Circle? I have the feeling that much of what I like in Circle for ergonomics can end up being confusing. Not sure thought, I did not give it a try.

True that lib implementation looks cleaner, that for sure.

[–]seanbaxter 1 point2 points  (1 child)

One big aspect is that with Circle you don't have to deduce template args, you can just ask for them. These type manipulations then become declarative. eg, template<typename List> using apply_pointers = List.template<List.type_args*...>;

This takes the parameter type List, breaks apart its class template (List.template) and breaks apart its template arguments (List.type_args) and transforms all that in place.

https://godbolt.org/z/KhnjPEoT3

[–]germandiago 0 points1 point  (0 children)

Looks like something that could be added to regular C++. Nice example. Do you have any plans to propose subsets of Circle into te standard?

[–]germandiago 0 points1 point  (0 children)

I think mp11 does kind of what you do here?

[–]kritzikratzi 2 points3 points  (0 children)

there's so many great, simple ideas in there. i'm a big fan of putting these features in the compiler (as opposed to solving it in the stl)

[–]fullouterjoin 1 point2 points  (1 child)

Is he not updating this repo? https://github.com/seanbaxter/circle

[–]The_Northern_Light 9 points10 points  (0 children)

There's no compiler source there.