« first day (1562 days earlier)      last day (3387 days later) » 

3:01 PM
So, if you listen carefully, you find that we totally agree. C arrays suck. And it's irrelevant. Because it's a solved problem.
 
oh nice, I didn't know they were working on C++/D interop
 
ah they're years behind Wide.
4
 
user1804599
lol
 
user1804599
WiDe
 
@sehe i still have to deal with it, but it seems that the only way I can do it is by dupplicating my code
 
3:05 PM
you don't have to deal with it, just make your users use std::array.
 
ican't
 
why not
 
cause it has to work for arrays too
 
why?
 
its a range-library, arrays offer begin/end/size
that is, they offer the same thing as vector/std::array/list..
im a user my self in testing code..
 
3:07 PM
you're still going on about that issue with what clients pass?
 
they don't really offer the same thing at all, because as you've observed, they don't have e.g. copy constructors.
 
it's been, what, two weeks now?
all this time you could have released something and gained feedback
 
@Puppy i don't require copy construction, it is just useful while testing
 
you're writing bad tests if they depend on a thing that you don't require.
 
so i was looking for a way to emulate it for all inputs, but can't be done i think
@Puppy might be, goes together with getting things done i guess
 
3:10 PM
writing bad tests doesn't get anything done, since you're not actually testing anything.
 
99% of the stuff i deal with in those tests offer it, is just arrays that don't
whatever
 
@FredOverflow "or the D" ahahaha
I bet it's the D
 
@gnzlbg so, if arrays offer that, what is the problem?
 
hmm
 
@gnzlbg so, use std::array when testing?!? Pfft. Your users will be no doubt smart enough to do the same /iffff/ they need it. And if they're not, they'll be happy to write the std::copy invocation (or gnzlblib::copy for the rangified version!)
 
3:19 PM
says in the video that you can't instantiate C++ templates on the D side.
well I'm glad that I don't have any serious competition coming from there.
 
@sehe i test arrays too, but C-arrays are subtle enough to guarantee their own testing for all the views/actions/algorithms.. most of the code is the same, but sometimes i want to test that I can modify the input correctly and copying allows me to do it without corrupting the input itself.
 
@gnzlbg make a 'clone' trait or helper that abstracts away the difference. Let me show you in a jiffie
 
@sehe yep that is what i was trying to do, but.. i can't return C-arrays from functions either, so i just splited away the tests that require mutation from those that do not, and some of them i reimplement them for C-arrays
 
@gnzlbg so make a trait that you can implement
 
maybe I should make a video about C++ interop from Wide and own him.
 
3:27 PM
I can detect C-Arrays with a trait, but a way to abstract the cloning for copyable things and arrays won't work with auto y = clone(thing);
I probably need:
T y;
clone(thing, y);
 
not gonna work.
what if the element type is not default-constructible?
 
@Puppy true :/
@Puppy anyhow better than nothing, i at least can reuse the tests with default constructible elements
 
@gnzlbg coliru.stacked-crooked.com/a/5a9fc973cd13def4 I've not done the boost::equal range comparison, because it's less interesting
@Puppy then it wouldn't work for std::array<T> or std::vector<T> either. THe point is, the guy wants to support T[N] where array<T,N> would be fine
 
@sehe Well, that's simply not possible, because it simply doesn't support the required functionality. And it not working for array or vector is another reason why it won't work.
 
@Puppy It is possible to write the library code to handle them both. Obviously, you cannot do such things as return by value (but: "don't do that then")
 
3:38 PM
@sehe Right, but the proposed solution won't give the correct behaviour either.
 
@Puppy what is the "proposed solution"? I have no idea what you refer to
 
probably the one he suggested right before I stated that it wouldn't work.
 
thanks, looks simpler than what i had:

template <class T, class U = std::remove_reference_t<T>,
REQUIRES_(!std::is_array<U>{})>
void clone(T&& from, T&& to) {
std::forward<T>(to) = std::forward<T>(from);
}

template <class T, class U = std::remove_reference_t<T>,
REQUIRES_(std::is_array<U>{})>
void clone(T&& from, T&& to) {
constexpr std::size_t s = std::extent<U>::value;
for (std::size_t i = 0; i != s; ++i) { to[i] = from[i]; }
}
 
Billhooks, West Sham scored against the run of play and natural law.
 
morning
don't forget Top Gear's on tonight
 
3:44 PM
@sehe thanks a lot !
 
Fuck tonight. I'll watch it on iPlayer tomorrow.
 
Or watch it tonight so we can "live Lounge" it together
I've been online for all of ten minutes and I'm already bored
 
user1804599
Never use C arrays no matter what.
 
Use C arrays when it makes sense to do so.
 
Anyone remember whenabouts Coliru lost all its archive last year? Struggling to find it in chat transcript
 
3:58 PM
It did?
 
user1804599
Cool, Perl 6 hashes aren't restricted to string keys.
 
Oh, now I understand why my answers don't receive the upvotes they deserve :P
 
@Jefffrey So... exclusively when implementing types in the standard library?
 
user1804599
> my Str %hash{Int};
> %hash{2} = "hi";
hi
> %hash{'foo'} = "hi";
Type check failed in binding key; expected 'Int' but got 'Str'
 
user1804599
3:59 PM
This is so awesome!
 
@Griwes Exclusively to piss off рытфолд.
 
lol
 
And of course pass them as templated references to functions.
 
I much prefer just passing std::array.
 
@рытфолд I would expect that in any sane language, yes. It's like the very bare bone support that any language/language-ecosystem should have.
 
4:02 PM
@gnzlbg cheers
 
Scalars, types, arrays, lists and maps/hashes.
 
user1804599
@Jefffrey Is Perl 6 a sane language?
 
You tell me.
Are you sane for using Perl 6? Only a psychologist can tell.
But the answer is no.
 
Is there a decent book on how to properly implement a programming language?
 
it would be nice if std::array had a constructor from T[N]... i'm pretty sure it can be made a no op
 
4:03 PM
I'd google but I trust you guys more than google
 
@Blob No.
IME all you can learn about implementing programming languages is how to lex and parse, and even then, only in simple situations.
everything else you just need to get cracking on yourself.
except code generation for which you can just download LLVM.
 
Nobody knows how to properly implement a programming language.
They are all just trying their best.
 
Scott Meyer - "Effective MakingALanguage" would be nice
 
fuck it can't find the evidence
@StackedCrooked BTW, how's funding for Coliru these days? All okay? Or do you need a donation drive?
 
i tried giving rust a try last week, it was surprisingly good in some things, and surprisingly bad in others
 
4:07 PM
Scott Meyer is not terrifically effective.
 
but it should get better till 1.0
 
Uh, decent book on "lex and parse" theory?
 
don't bother, they're easy as shit.
 
Don't write another language, pls.
 
languages are the most basic tools we use and they should be iterated on and refined as much as possible.
more languages is better.
 
4:07 PM
@Jefffrey Not a legit language. I want to make something simplistic so I understand how it works.
 
Yes, refined is the keyword there.
 
second tool, text editors
 
Nah, we've had Vim for a while.
Nothing can top that
unless we get a Vi iMproved iMproved
 
Should have really been Vii
 
user1804599
In Perl 6 you can refine types with predicates!
 
4:09 PM
@Jefffrey There's no good language yet. We have to keep trying.
 
@Blob This is massively dependent on the nature of the language in question.
different language implementations can work in drastically different ways.
 
@Blob You have to understand how they work to make something like them.
 
@Griwes Yes. We need to spread all the programmers's work in many small almost-identical language communities so that we can have even less of an ecosystem for each language.
 
Not the other way around :/
 
The problem right now is terrible ecosystem, not languages not being good enough.
 
4:12 PM
@Jefffrey Let me repeat it: there's no good language. Heck, there's aren't any decent languages either. Tooling doesn't matter when your language is crap.
 
Your definition of good is terrible. Get a new one.
 
There's no good definition of "good".
 
user1804599
Perl 6 and LasagnaScript are good.
 
Also all the languages are horrible.
No.
 
Haskell and C++ are example of decent languages.
Agda is the example of a good language. PHP is a bad language.
 
4:14 PM
that's relative.
 
Yes, I'm trying to reset Griwes's definition of "good".
 
C++ is a decent language only by merit of the rest being somehow even worse.
rather than because it's actually good.
 
Haskell might be decent. C++... is slightly less decent. Can't say about Agda, but I doubt there is any way it can be good.
 
@Puppy 100% agreed.
Rust is ok, but still needs lots of work :/
 
Rust might be worth looking at when they get metaprogramming.
 
4:18 PM
they have metaprogramming, i doubt it at first, but their macro system is pretty decent for a lot of stuff you might want to use metaprogramming for
 
user1804599
Agda is shit.
 
user1804599
No ecosystem, no dice.
 
@gnzlbg No, they don't have metaprogramming.
 
they might not have type-safe metaprogramming, or dependent typing, but they do have metaprogramming
 
Also next time you read the docs, try to look closer at who they are targetting. They are tagetting C programmers more than C++ programmers.
@gnzlbg Type-unsafe "metaprogramming" is hardly metaprogramming.
 
4:20 PM
i did not only read the docs, i actually wrote something with it
 
It's like calling C macros "metaprogramming".
It's just... wrong.
 
I can't find any music to fit my mood.
 
You are depressed.
 
Actually, with _Generic, C seems to have more metaprogramming than Rust (lol).
 
@Griwes it is way better than C macros, and more powerful
 
4:21 PM
Nope, even that has music for it.
 
@Griwes for the rest just use Traits if you need
 
@gnzlbg Typeclasses don't solve all problems, you know.
 
Traits + macros covers a lot of metaprogramming in a pretty nice way
 
Eh.
 
@Puppy Tale of Us essential mix
 
4:22 PM
You probably also don't think we need first-class types now, do you?
 
@Griwes i simulated template<int N> with traits + macros
in Rust
its doable, ugly but doable
 
I don't care about "doable".
 
then write an RFC if you care at all
but Rust does have metaprogramming
i would like to work on the AST directly, and type-safe meta programming, and dependent types, and flying cars
but their macro system has to be there anyways, and already is pretty useful
anyways, the language still needs a lot of work before 1.0
the compiler can't even infer Self within a Trait
 
what is it with people and trying to mutate the AST.
that's just dumb.
 
@Puppy from what you know about me that must fit pretty well then :P
 
4:26 PM
I care about expressiveness.
I want to write code that is as short as humanly possible.
 
@Puppy you can't really get much lower level than that, and you can use that to build higher level stuff... it just let you do absolutely everything
 
yeah! swapped over the SSD... just need to do a bit of cleanup, but it's more or less done :D
 
Damned areas without network connection. Shit like that should be outlawed along train routes.
 
now... what to do with that old drive... 160GB swap space?
 
@gnzlbg You can use it to build higher level stuff, but it would be a lot easier to just go direct to the higher level stuff.
 
4:28 PM
@gnzlbg Working on the AST directly means you no longer know what is going on by looking at the source code.
1 + 2 can suddenly mean apple + grape.
I am still not sure if going there is correct.
 
that's all right if your highlevel stuff allows everyone that might ever exist to do everything they might ever want to do
 
Hey guys, do you know any trick to catch memory writing from a malware process on windows?
Cause my current solution is create a kernel driver and hook every single process WriteMemory address to check if my process is the target. But this seems to causes fake positives on some antivirus.
 
which it naturally does.
 
I just want everything to be first class.
 
of course
 
4:29 PM
You don't really need much beyond that.
 
besides
 
(Specifically, first class types and typeclasses.)
 
mutating the AST is not more powerful than directly instructing the analyzer in what you want.
as the AST is nothing more than input to the analyzer anyway.
 
i would like to have SOA as AOS support
 
@Puppy Erm... yes it is.
 
4:30 PM
and that to be configurable to subtypes
and without it being bolted into the language
 
@Griwes No, it really isn't.
if the analyzer doesn't possess a function, you can't instruct it to perform that function by mutating the AST.
and if it does, you can instruct it to do that directly instead of through AST.
 
unless.. LISP
but @Puppy what i mean is I would like an intermediate AST, closer to the source code, that i can mutate with a low level interface, and that then gets feed back to the analzyer
 
just instruct the analyzer in what you want directly.
there's no reason to create instructions through a random intermediate form instead of just calling the function directly.
 
then you have to standardize the analyzer
 
you'd need a common interface, yes.
 
4:36 PM
in C++ i've wished lots of times that structs/classes would be isomorphic to some tuple/typelist thing
and that i could just use fusion on them
and that i could modify types in place as well as creating new types
 
modifying types in place is some dangerous shit.
 
yep
 
you need a pretty advanced analyzer to cope with that
 
creating new types from already existing types is ok
but modifying types in place is hard
but sometimes you want to do something like: make my type "serializable/SOA/..." and keep the same type name
 
you don't need in-place modification for that.
 
4:38 PM
unless you can rename a type, and then assign a new type to the old types name, you might also want to solve this by modifyng the type in place
 
@gnzlbg Care about expanding the acronyms?
 
and you don't need to rename it either
 
@Griwes SOA struct of arrays/AOS array os struct
 
you're assuming that the analyzer treats type names like some core property.
in Wide type names are irrelevant, more or less.
there's nothing special about looking up a name and finding a type there.
 
i think it would make more sense to make types immutable then
 
4:40 PM
@gnzlbg Eww. Types should just be immutable.
 
and that you can create types from new types
 
currently
 
but then you might have types around that are nowhere in your program
somehow
 
@gnzlbg Which is just fine.
a type is nothing more than an object in the compiler.. it doesn't need to be findable by any name in the lookup structure.
 
like i create a type T2 from T1, which are identical, but the method "do_something" from T2 does some stuff and then calls the method do_something from T1
 
4:41 PM
I am currently trying to invent an uniform syntax for defining new types and other variables. Since types are first-class, they should be createable in the same way, say, an integer.
 
@Griwes Wide has anonymous types, so you can do something like x := 1; or x := type { x := 1; };.
 
Is the first form equivalent to x := int{1}; (or rather, do you have any such syntax?)?
 
I do not possess that syntax.
but assuming you meant a constructor call
then yes, technically the int is copied into x (but in reality it's elided of course)
 
Yes.
 
and for the anonymous type, the representing object technically also has a trivial copy constructor.
 
And what I am trying to do is to find a syntax that'd let you write (in Wide-ish syntax) x := T { some-uniform-initializer-syntax }; that'd give you a type when T is type, a typeclass when T is typeclass, or a variable of type T if T is a type.
 
user1804599
lol awesome
 
I guess I really don't see the point in that.
 
(Well, the current plan is for type and typeclass to just be types, so the last part catches all the cases.)
@Puppy It reduces the number of gramatical and semantical constructs needed by the language.
At least in theory.
 
hmm
not really.
 
4:47 PM
Instead of multiple syntaxes, you have one single syntax.
 
right, but that can just make things worse, rather than better.
 
A real example of "uniform initialization" :P
 
user1804599
Syntices.
 
@рытфолд :D
 
for example, uniform initialization.
what you're really saying is that you're intepreting this thing in completely different ways depending on the context, and that's bad.
 
4:48 PM
@рытфолд syntii
 
@Puppy No, I always create an object.
And the type of that object is always T.
 
@Griwes Right, but the properties and meaning of that object is completely different.
 
(Also it reduces the number of keywords I need!)
 
I can't imagine any case in which this would be genuinely useful, and it would just be incredibly hard for both users and the compiler to actually know what is going on.
 
@Puppy Not really. Some of those objects have special properties, like "I am a type, you can use me to declare variables", but if a T{...} syntax was a first-class syntax, you could give a meaning to, say, 1{2}, and then creating a temporary of type T is just an overload of {} for type.
@Puppy I can understand why some users would be bound to be confused, but the compiler?
 
4:51 PM
well, here's a problem.
if you have that syntax, then now, constructing objects and calling functions no longer has a uniform syntax.
 
"Oh look, T{Args...} syntax. Let's look that's operator for T up and see what it returns."
That's not a problem. I do not want constructing objects and calling functions to have uniform syntax. :P
 
@Griwes It's not actually quite that simple. For example, what if T refers to a parameter? Or what happens if T is the return type of a function with inferred return type that you haven't finished inferring yet?
and what if this syntax is in the body of a polylambda?
 
@Puppy If it's a parameter, the parameter type gets a requirement "Implement {} for Args". If it's not inferred yet, I postpone it.
 
for some T, you could have to capture locals, but for some other T, that wouldn't be required.
 
@Puppy A polylambda is just a function template.
@Puppy I fail to see how that could happen.
 
4:53 PM
but it's not just a function template because the type of the polylambda and the properties of that object depend on what it captures.
for example, if you capture a unique_ptr, it's not copyable anymore.
so you have to resolve the captures to even define the polylambda type and know how to treat it.
 
Sure. All identifiers in all scopes must be resolved anyway. :P
 
which means you have to unambiguously identify all lambda captures, for all possible instantiations of the function body.
 
Captures don't depend on lambda's body.
 
but that's not going to be possible if the { ... } stuff doesn't have a well-defined semantic meaning until after T is known.
 
Erm, I mean, they kinda do
but not really on the parameter types.
 
4:55 PM
it does if the meaning of the expression depends on the parameter types.
 
@Puppy It has well defined semantics. It creates an object.
Or rather, it calls operator{}.
 
@Griwes Right, but the arguments may be captures.
but they may not be captures.
depends on what T is.
 
@Puppy Can you show some pseudocode example?
 
0
Q: what are c++ 11 type_trait and why were they created?

vickozaI understand that c++ 11 introduced type_trait. From my understanding type_trait are a way to bypass macros to produce better code more readable code with compile time opiminmizeation. What was the reason the standard introduce the so I can better understand how and when they should be used?

 
ok
imagine something like
x := T { ... }; lambda := () => U { T };
does the lambda capture x or not?
mm, I actually don't know if Wide's syntax can still express this ambiguity.
 
user1804599
 
I'm not even sure what the fuck the meaning of U { T } could possibly be if U is a type, which is another reason this is silly.
 
What does => U { T } mean?
 
I have no idea, but it has to be syntactically legal.
4
 
I guess it returns U{T}.
:D
 
and you can't know if it's semantically illegal or not.
 
4:59 PM
wat
 
I actually should have made lambda take U as an argument .
 
ugh
 
@Puppy You are just passing a type to another type's constructor. :P
 
whoa, idea, on each turn the party has a queue of actions that it can fill and each character can contribute with a number of actions, and they complement each other; e.g. character 1's water splash causes character 2's lightning bolt to do 2x damage
I'm sure another game must have done this
 

« first day (1562 days earlier)      last day (3387 days later) »