« first day (686 days earlier)      last day (4265 days later) » 

user784668
4:00 PM
libstdc++ y u return true and return false
 
@R.MartinhoFernandes Make c_str return struct that has implicit conversion to both const char16_t* and const wchar_t* on Windows.
 
c_str is from std::basic_string<char16_t> actually, which is the default container.
Wait, that's the answer.
using native_text = basic_text<utf16, std::basic_string<wchar_t>>;
 
Xeo
Do it like Boost.Filesystem's path with native_string etc ?
 
I don't want that on every specialization though.
Only two of them. (Or three? what passes as native encoding on Mac?)
 
you inherit from the container?
 
4:05 PM
@DeadMG No.
It's the sole member.
 
What does that mean? Where does native_text come from? I thought it were just one type.
 
@LucDanton It's the type to be used for native interop?
 
What is it you don't want on every specialization?
 
@LucDanton A native() member.
 
doesn't that strike you as a tad redundant?
"Hi, I'm UTF-16, and I use the UTF-16 string type."
 
4:08 PM
@DeadMG Erm, what if I want a deque?
utf8_text some_text_from_the_network = /*...*/;
native_text some_text { some_text_from_the_network };
::MessageBox(..., some_text.storage().c_str(), ...);
@LucDanton ^ Use case.
 
My application (CLI) needs a JSON configuration file. But I am too lazy to write another GUI Configuration widget. in QT. So is there any reusable Component ?
 
@LucDanton Basically, I think some_text_from_the_network.native() doesn't make sense, only some_text.native()
 
What if someone want an UTF-16 string (not text) from a native_text if you do decide to let it hold wchar_t units? Is there an appropriate member that you are in fact okay with having for every spec?
 
I call wrong tool, then :P
You can create a utf16_text from it and get the container from there, or fallback to utf16::decodeing it by hand.
 
@NeelBasu Hm?
 
4:12 PM
native_text exists to pass stuff to OS functions.
 
@EtiennedeMartel Hm ? means ?
 
Well then you have made your choices.
 
@NeelBasu I don't really understand your question.
 
It supports the common strategy of always converting stuff when you pass it to the OS functions.
 
me and my best friend :)
 
4:13 PM
@LucDanton native_text can be utf8 on another system.
The only portable way of getting an UTF-16 string out of it is to convert.
 
Well don't delude yourself that people will only use your code for portable stuff lol.
 
@TonyTheLion Your best friend being yourself before you changed your user name?
 
@EtiennedeMartel My cli app needs to get a config file to work. which is in JSON format. but its now going to be used by non technical users. and they cannot write JSON file in hand. So they asked me to develop a GUI to generate that file.
 
Oh, and hi everybody!
 
Some people might use it for just the one platform although that application may communicate with other encodings than the native one.
 
4:14 PM
@EtiennedeMartel But I am searching for some generic widget in QT that does that. so I'll not write. rather use it
 
@R.MartinhoFernandes IIRC, it's a Unichar, which is a typedef for unsigned short. So I'd guess it's UTF-16.
 
@LucDanton I guess you could also make a container that provides you that functionality and use that.
Unless I'm misunderstanding you.
 
@NeelBasu I've never heard of any user friendly generic JSON editing stuff.
 
@EtiennedeMartel Vim? :P
 
@R.MartinhoFernandes You call that user friendly?
 
4:16 PM
@EtiennedeMartel neither did I. Thats why I am asking
 
@EtiennedeMartel I'm biased :P
 
@NeelBasu In fact I'm not even sure it exists.
@CaptainGiraffe Are you trying to say that you're better than @TonyTheLion?
 
@R.MartinhoFernandes To clarify I was making sure that the converse functionality is available (native wchar_t -> char16_t). You were worried about native text making wchar_tavailable. Since the functionality is available (even though it takes a conversion) then that's fine by me.
 
@R.MartinhoFernandes non technical users cannot write JSON or XML or anything parsable whatever you give them. vim. wim, xim, yim, zim
 
4:17 PM
@LucDanton Ah, ok.
@NeelBasu I was joking, btw. :)
 
I also like that this avoids the kitchen sink approach that e.g. filesystem::path has chosen. Something like p.as_string<char16_t>()?
 
@EtiennedeMartel Um, maybe; or that I found a really funny picture on Google images.
 
@R.MartinhoFernandes I was joking too. but my joke was on the way not by the way
 
@LucDanton You mean the whole string(), wstring(), u16string(), u32wstring() /* WTF? */ mess?
 
Ya.
 
4:20 PM
@JerryCoffin indeed :) Well spotted :) :P
 
Striped, not spotted. Are you blind?
The spotted ones are leopards or cheetahs.
 
Or giraffes.
 
@R.MartinhoFernandes Don't you, forget about me. Don't don't don't you, forget about me. youtube.com/watch?v=ZhaHLoK3CF4
 
@R.MartinhoFernandes Hey, bloated interfaces are cool. Look at std::basic_string. Don't you love that shit?
 
@CaptainGiraffe Such an imminently forgettable song.
@EtiennedeMartel Does anybody even sort of like it? I'm pretty sure even the people who designed it don't -- and probably like it less all the time.
 
4:24 PM
@JerryCoffin I liked when they played it at the end of that Futurama episode.
 
@JerryCoffin Hey I liked the breakfast club when I was 15 you insensitive clod!
 
@EtiennedeMartel basic_text has pretty much ctors, range interface, and escape hatches (safe direct access to the underlying storage). Nothing else.
 
@EtiennedeMartel I'll have to take your word for it -- never watched Futurama enough to notice.
 
@R.MartinhoFernandes Needs more methods. NEEDS MORE METHODS.
 
@EtiennedeMartel Yes, there will be.
 
4:25 PM
@CaptainGiraffe Anybody young enough to have watched TBC when they were 15 deserves it. Oh, and thank you. I've been getting intensive insensitivity training ever since I got married. It's good to know my time hasn't been completely wasted.
 
@JerryCoffin Well, the episode is "The Luck of the Fryrish". It's pretty good.
 
user784668
@EtiennedeMartel Okay, stop methods.
 
I'm thinking of a variadic concatenate(...) free function, instead of that + thing.
I don't want to write expression trees (and I don't like + for concatenation).
 
@R.MartinhoFernandes I was just about to say, expression template.
 
@EtiennedeMartel I'll take your word for that.
 
4:27 PM
They're fun in C++11! I still need to unununbreak mine though. See? Fun!
 
I think I had my dosage of fun while I was chewing down on those 18k errors the other day.
 
A more serious suggestion would be to wait for a C++11-enabled Proto (currently under way).
 
@R.MartinhoFernandes 18k? Damn.
 
@JerryCoffin Sorry to hear that. Congrats on the whole wifeing thing though.
 
@CaptainGiraffe Unless I'm talking about something important like indenting style, you can't take most of what I say too seriously. Thanks though.
 
4:30 PM
@EtiennedeMartel Sometimes refactoring template code is painful. And Boost.Range is not helpful. I think I'll blame Boost.Range for everything that annoys me in this project.
 
@R.MartinhoFernandes "Static typing" kind of implies hard refatoring.
 
Never used Boost.Range, but I'd assume it's not as friendly as LINQ.
 
@JerryCoffin This is the internet after all. Also, K&R ftw!
 
@EtiennedeMartel Haha, nice joke.
 
Still, where's yield return when you need it, eh?
 
4:32 PM
@StackedCrooked Ever played with a language that has type inference?
 
@StackedCrooked I don't know. I'd think refactoring dynamically typed code is worse: you don't have a compiler to work as a checklist. But the most important bits are always test coverage.
 
@LucDanton No.
 
@EtiennedeMartel :(
 
@StackedCrooked I don't know, Ctrl+Shift+R does wonder with R#.
 
@StackedCrooked Refactoring is fun there. Although it won't help if you're not into static typing to begin with.
 
4:35 PM
I meant that "static" implies that things strongly depend on each other so that breakage of one thing may spread through the whole program.
 
Xeo
@EtiennedeMartel In the library that a the Boost.Asio guy wrote :P
 
I'm not implying that is a good or a bad thing.
 
@Xeo There's a lib for that?
 
@StackedCrooked Yes, that's a feature.
 
I read that it would be possible to do what yield return does with fibers and shit.
2
But that seemed awfully complicated for my noobish mind.
So I just said "fuck it" and had a beer instead.
 
4:36 PM
@StackedCrooked Breakage of one thing spreads through the whole program regardless of typing discipline.
 
Xeo
@EtiennedeMartel He abused the preprocessor and some switch / if statements
 
It's painful when the typing has to be explicit, that's a lot of verbosity. But when that's taken care of by the language I find myself thinking about what I'm doing and the types help me.
 
Oh my. This sounds like it's pain in a bucket, with a side order of horror.
 
@EtiennedeMartel Problem solving at its finest. Source: me.
 
Xeo
@EtiennedeMartel Doesn't seem that complicated, to be honest
 
4:37 PM
I won't use that kind of crap. FWIW, it's not yield return, only close, as it doesn't work with the whole language.
 
It's a joke on a blog. Which he lifted into an example in the library docs, but it's not in the library per se.
 
@R.MartinhoFernandes Indeed, it's hard without a GC to clean up behind you.
 
It's not super esoteric and unlikely to break because it's stackless coroutines, and thus not very much powerful. There is little to go wrong.
 
It's an old trick.
I've seen it in C before.
 
4:41 PM
@Xeo So it wasn't fibers and shit, but switch and if?
 
In C++ you get implicit *this, which I suppose gives you a little bit of syntactic goodness.
 
Xeo
@LucDanton May not be super powerful, but for what he uses it in Asio, it looks pretty good
 
Not being powerful is not an insult.
 
Xeo
He also does a great explanation here
 
4:46 PM
As I pointed out, it means there is little to go wrong: that's a feature.
 
Xeo
right-y
 
@R.MartinhoFernandes Good stuff. Simon has good insights here. Thanks.
 
Whatever, Boost.Asio needs a neater interface.
I'll write it sometime in the future, aka probably never.
 
I do think it's misleading to call that 'coroutines'. I don't really keep in mind the distinction between stackless coroutines and the usual kind (or one of the usual kinds).
 
I don't get why people get so excited about yield return.
 
Xeo
4:47 PM
Oh, there's a more up-to-date thing of it
 
@DeadMG Because without it, writing lazy iterators is painful.
 
@DeadMG Because you never used it.
 
Xeo
@DeadMG It makes generators and iterators that much easier :/
@LucDanton Well, they get a stack as soon as you put the coroutine in a function object, so...
 
user784668
Is there any way I can get both Foo(const Bar&) and Foo(Bar&&) without duplicating code and without making Foo accept anything else than Bar?
 
Xeo
@Fanael Just.. use U&&?
 
4:50 PM
@R.MartinhoFernandes Surely it's just a mutable lambda, really.
 
Xeo
Oh, wait, U is not a template parameter?
 
@Xeo There is still backwardness in that definition of variable is separate from point of use.
 
user784668
@Xeo No. Made it clearer.
 
@DeadMG Yeah, surely it's just a mutable lambda that is painful to write.
 
Xeo
template<class X, EnableIf<std::is_same<RemoveReference<X>, U>>...> T(X&&)
 
4:51 PM
@Fanael Foo(Bar) comes to mind.
 
Xeo
Or that.
 
user784668
@LucDanton Oh right.
 
Xeo
@R.MartinhoFernandes ?
 
Missing ... (or = something for crappy compilers Clang).
 
Xeo
4:53 PM
:s Thanks
 
RemoveReference is not going to cut it tbh.
 
Xeo
Hm, RemoveCV is missing, yeah
 
This is Barely functional!
 
Xeo
EnableIf<std::is_same<Strip<X>, U>>...
Or you have is_ca_same
 
4:55 PM
@Xeo lol
 
I mean, maybe I'm missing something here, but they seem to be exactly mutable lambdas.
 
Terminating condition.
 
Xeo
yield return doesn't return a function object, as far as I'm aware
 
@DeadMG Considering yield return generates a fucking state machine, I doubt it's that simple.
 
@DeadMG Sure, simple iterators are simple.
 
4:57 PM
@DeadMG It will stop being so simple once you do the yield in some nested loop ;)
 
Any non-trivial piece of code becomes a mess.
Looking at the output generated by the C# compiler in Reflector was nice.
 
Xeo
taking an example from Asio
 
@R.MartinhoFernandes Compiler as in javac?
 
@ManofOneWay Yes.
@LucDanton Hehe.
 
Xeo
void server::operator()(error_code ec){
  reenter(*this){
     for(;;){
       socket_.reset(new socket_type(...));
       yield acceptor_.accept(*socket_, *this);
       io_service.post(session(socket_));
     }
  }
}
 
5:00 PM
One of them is in state "Fix-available", which seems to indicate it will be fixed in the next update.
The other I can't seem to find the link.
 
@NikiC I did just that the other day.
public IEnumerable<Node> FlattenHierarchy()
{
    yield return this;
    foreach(var child in Children)
    {
        foreach(var sub in child.FlattenHierarchy())
            yield return sub;
    }
}
Looked like this.
 
So awesome. Now it's the puppy's turn! :P
 
Xeo
@EtiennedeMartel looks so nice...
 
Ell
Woah its doesn't make any sense
 
Xeo
@Ell Etienne's example?
 
Ell
5:03 PM
Any of Anythijg :L
I've been awake > 24 hours so int ired
 
well, I have to admit, a set of lambdas that would neatly deal with such a thing does not readily come to mind.
 
That's why it's easier to just ask the compiler to generate that.
And then I can focus on doing more productive things than wanking with lambdas.
 
hmmm, I wouldn't put it like that
just because lambdas that can neatly do that don't readily come to mind doesn't mean that they do not exist
although, arguably, it does equally prove your point
 
An hilarious attempt to hack WordPress with a pull request http://j.mp/PyecsP
@DeadMG I didn't say that. But they're still painful as heck to write.
I know how such lambdas could look, because I've looked at lots of the state machines generated by the C# compiler (when I was hacking on boo I used Reflector all the time). And they're not pretty.
 
having a mutable lambda doesn't really work once you get beyond one return point
 
5:13 PM
@DeadMG Yes, it does. The C# compiler does it all in a single method (MoveNext).
 
I meant if it wasn't automatically generated
 
Ah, yes, it's not practical.
 
that reminds me
I've run into a fairly critical problem with Wide.
 
The build failed?
 
namely, I'm a bit trapped between the C++ iterator model, and the iterator model you see in, say, Lua, or C#
specifically, in C++, you can do things like create new ranges from the begin and end of totally different ranges, and things like that
 
5:16 PM
And talking about generators an coroutines...
 
whereas in C# they tend to deal with ranges more as a "You go from A to B and that's it." kind of thing
 
... my coroutine implementation was just now merged for PHP 5.5 :P
Now I can laugh at you :P
 
@NikiC Normally, I'd congratulate you, but it's PHP, and being a contributor to the PHP codebase is like claiming to have contributed to the US health care system.
 
lol
@DeadMG Well, C++ iterators are a lot more general.
 
@R.MartinhoFernandes Yeah.
 
5:18 PM
A C# enumerator is just a sequence.
 
but I'm not sure if this genericity is actually needed, or if YAGNI applies here.
I mean, does anyone ever actually start creating new ranges from odds and ends of old ranges?
 
To be honest, I think the C# model covers most needs.
 
yep
I'm happy to have random-access, bidirectional, etc. and I'm also happy to have lvalue, rvalue, and such
but supporting new_range(old_range1.begin, old_range2.end) makes life a lot harder and more error prone.
 
Andrei's input ranges also follow that model, and then he adds more advanced ones on top up to random-access.
 
@R.MartinhoFernandes I followed a boost::range model, more or less.
but in Wide, it's a lot more feasible to replace reference, which can make some things quite a bit simpler.
 
5:22 PM
Well, my biggest gripe with Boost.Range is that writing iterators is annoying as heck, and in general writing a new boost range is writing an iterator.
 
right
which is why I decided that by ditching range(old_range1.begin, old_range2.end), I'd simplify things a bit.
although I'm not wholly sure in what direction to take it
I don't want to start introducing language support to my for loops to support ranges
 
Oh, and the fact that the size of my chained encoding/decoding iterators ends up being O(2^N).
 
could just go with something more Java-style
 
@DeadMG Erm, in my language there's only range-based for loops.
@DeadMG How so?
 
it.HasNext(), it.Advance(), and such.
 
5:25 PM
Having tasted both from the implementation side, I prefer MoveNext + Current as in .NET.
 
I hadn't looked much into their iterator implementation
I assumed they ripped it right from Java, like every other mistake Java ever made
 
The difference is that in Java, advancing gives you the next one.
@DeadMG They "fixed" it.
It's bool hasNext(); T next(); versus bool MoveNext(); T Current {get;}.
 
user784668
@R.MartinhoFernandes No wonder, .NET model is closer to C++ model.
 
@R.MartinhoFernandes Well, I was still thinking de-reference for "Current"
Advance would be ++/+.
I guess that the C++ model was born out of a desire to be compatible with native pointers
and if I used a .NET-style model, I'd have to wrap native pointer iteration for when such is demanded
but that's fine by me
 
Personally I wouldn't bother, since that's not intended as a common scenario, right?
 
5:30 PM
right
in fact, I'm distinctly thinking of moving native pointers to the interoperation section
 
0
Q: What to replace std::stringstream and boost::format with for std::u16string?

lamefunstd::iostream classes lack specialization for char16_t and char32_t and boost::format depends on streams. What to replace streams with for utf16 strings (preferably with localization support)?

Man, there's so much crap related to strings...
 
yep
when I finish le inventing Wide then it will be simple "Range of codepoints" stuff :P
 
ogonek::textstream :S
@DeadMG Ha, I'm already at that stage :P
 
lol
 
Got there yesterday.
 
5:36 PM
@R.MartinhoFernandes Don't bother with text, just use png's for all user interactions. Might look a bit off on the command line though. And maybe a tad tough to grep.
 
you know
 
Now I need to add actual functionality besides abstraction.
 
I just can't get over how shitty Clang is.
before, I had them on such a pedestal of awesome and helpful
 
and it's a very nasty surprise to find out the hard way that they're so suck
 
5:38 PM
I still haven't tried libclang's Haskell bindings, but the LLVM ones are the awesomest (awesomer than the original ones).
You mentioned it has a linker already?
What version was that? 3.2?
 
apparently, it's currently a separate side project
but I have a tiny eensy bit of hope that it actually functions
huh
someone else linked me to it and I can't find it anymore
here we go
 
Why are you bothering with clang and not LLVM directly, btw?
 
I am using both.
 
Reads standard Object Files (e.g. ELF, Mach-O, PE/COFF)
Writes standard Executable Files (e.g. ELF, Mach-O, PE)
Ah, cool.
 
I need LLVM to code generate my Wide code and I need clang to lex/preprocess/parse/analyze C++ code.
 
5:48 PM
Why the C++ code? You're already doing interop with C++?
 
yes, that's what it's for.
difficult to interop with C++ code written in header files if you don't have a C++ compiler to hand.
I need Clang to perform name lookup, overload resolution, name mangling, and such things
else I might be able to recognize C++ code, but it'd be difficult to actually do anything about it
after all, if I want to code generate calls to C++ code, I need to go from "It's a header file" to llvm::Function*, llvm::Value*, llvm::Type* and suchthings.
 
Yet another thing I'd like to see in a GUI framework: stop forcing me to have no-arg constructors.
 
Inowutumean
 
The worst is that it seems my teammates are now carrying that habit from the Android UI to everywhere.
No-arg ctors everywhere!
 
two-phase initialization is the root of many object-orientated evils.
in Wide I will write a warning for such things :P
 
5:57 PM
lolwut.
How do you recognize it?
 
well, you'd have to have a public method, and I'd probably just stick to ones called init, Init, Initialize and such
 
Just a general warning at the end of each compilation, methinks:
0 errors, 0 warnings.
Diagnostic: your code sucks donkey cock
6
 
lol
 
@sehe Haha.
It does sound like him. Somehow.
 

« first day (686 days earlier)      last day (4265 days later) »