« first day (1184 days earlier)      last day (3990 days later) » 

user1804599
00:00
Can’t copy std::atomic<T>? :(
should be able to
user1804599
Nope; deleted copy ctor. :v
strange.
8
A: Why are std::atomic objects not copyable?

Jonathan WakelyOn platforms without atomic instructions (or without atomic instructions for all integer sizes) the types might need to contain a mutex to provide atomicity. Mutexes are not generally copyable or movable. In order to keep a consistent interface for all specializations of std::atomic<T> across al...

user1804599
>>> from __future__ import barry_as_FLUFL
>>> 1 <> 2
True
>>> 1 != 2
  File "<stdin>", line 1
    1 != 2
       ^
SyntaxError: invalid syntax
user1804599
00:11
TIL.
Xeo
Xeo
lol
user1804599
@AndyProwl It’s always the other platforms that screw things up. :(
user1804599
IT WOULD WORK ON MY MACHINE
@rightfold Depends what's your T I guess
user1804599
00:14
std::size_t
user1804599
@thecoshman I hate horses.
user1804599
Oh wait.
Yeah, x86 should be fine with that
@rightfold watch this race, trust me :D
user1804599
I don’t trust pirates.
00:16
YouTube is TerriTube today. Arrrghhhh why won't it load
DAMNIT
@rightfold What don't you hate?
user1804599
Hmm.
user1804599
Now I have a multithreaded VM, I should do something to prevent the GC from reading objects that other threads are writing to. :v
user1804599
I think a shared mutex will do the job.
concurrent collectors are extremely complex
there's a reason why most use a stop-the-world approach.
user1804599
I’ll wait until all other threads terminate, and I’ll block spawning of new threads.
00:22
so instead of stopping the world briefly, you'll stop it indefinitely?
@thecoshman holy smoke
user1804599
@DeadMG Well, s/terminate/terminate or pause/.
you can't passively wait and just hope that the other threads will pause eventually.
user1804599
They are paused on I/O operations and on explicit and implicit yields.
you have to code into your VM a check if they need to pause for GC
00:24
@rightfold and if they dont...?
@rightfold Threads often have long lifetimes. (While tasks are usually short.)
E.g. a logging thread will live until the process terminates.
user1804599
Well, I guess I could have each thread check an atomic Boolean at the begin of each instruction.
user1804599
And if the Boolean is true then it pauses so the GC can do its job.
Atomic bool check before each instruction?
Reading an atomic requires cache flushes and stuff.
Unless it's relaxed.
user1804599
When else?
00:29
So that would be crazy expensive.
But what do you mean with "instruction"?
A task? Not CPU instruction I hope?
user1804599
My VM interprets instructions.
user1804599
Not CPU instructions.
Assuming an instruction is something very short, reading an atomic before each instruction will be very expensive.
user1804599
Higher-level stuff like Pop, PushSelf, Throw, Return, Alloc and SendMessage.
user406009
00:32
@rightfold Why not have one memory pool per thread? Use message passing instead of sharing memory.
user1804599
@StackedCrooked I could do the atomic check when the instruction pointer is divisible by a certain constant.
user1804599
Would still require a check before each instruction, but not an atomic one. :P
}
}
^ eeuw
:)
@Lalaland That can involve either language-level immutability, or language-level copyability and a potentially arbitrarily large performance cost. It's not a terrifically great solution.
user1804599
I don’t indent cases. vOv
00:36
@StackedCrooked is hunderd jaar lang.
hunderd?
user1804599
hondert
user1804599
hond
duust joar moat
00:38
hahah
oops, I suck at speling
in C#, Nov 22 '13 at 23:33, by drch
@DannyBeckett spelers gonna spel
[1/1] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe /LD ..\src\Window.cpp ..\src\WindowImpl.cpp ..\src\WindowImplWin32.cpp ..\src\WindowImplX11.cpp /nologo /EHsc /DNOMINMAX /D "_UNICODE" /D "UNICODE" /I ..\include\ /link /DLL /IMPLIB:..\\bin\\portal.lib /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\" Gdi32.Lib User32.lib /OUT:..\\bin\\portal.dll
Success! :D :D :D :D
user3010322
What is... that mess?
user1804599
Another option is to have a GC for each thread, and a central GC only for shared objects.
user1804599
Although that is terribly complex.
00:43
@ThePhD That "mess" is Ninja successfully generating a lib & dll from my code :D
user1804599
For now I’ll just go with the assumption that threads yield often.
user3010322
@Borgleader Code of... what?
user3010322
Hm.
user3010322
int i = 2, j = 6;
int& ri = i;
int& rj = j;
std::swap( ri, rj );
I want to make a Window system similar to SFML but that can support both DX & OGL on Windows.
user3010322
00:44
I wonder what happens.
user3010322
@Borgleader Why do you need X11Impl for windows, then?
user3010322
Or is that just a #define'd block of nothingness?
user3010322
Also, is it a runtime or a compile-time choice?
@ThePhD Oh I meant cross-platform OGL support and additionally DX support on Windows
user3010322
I see.
00:57
A move operation is applied when an rvalue reference is used as an initializer or as the right-hand side of an assignment.
Well done Bjarne
user1804599
Yay.
user3010322
Is there something particularly wrong with that quote?
user1804599
boost::shared_mutex and boost::shared_lock_guard work!
@ThePhD The word "reference" should not be there
user3010322
rvalues are references.
user3010322
00:59
If anything, it's just a redundancy.
user3010322
I dunno, they look like references to me.
what do you mean? For instance, a temporary is not necessarily a reference
Yet, it is an rvalue
user3010322
Nope.
Yep
If function foo returns int (like, int foo()), then evaluating foo() yields an rvalue, but not a reference. So rvalues are not references.
user1804599
01:01
if (vm->gc.aboutToCollect()) {
    vm->ioService.post([this] { resume(); });
    return;
}
boost::shared_lock_guard<decltype(vm->gc.mutex)> lock(vm->gc.mutex);
// interpret code
user1804599
This should do the job.
user1804599
Now my GC has two mutexes in it. :V
user3010322
cruel world
the "what's the point of the chat" guy is back :)
01:09
wat, temporaries are not references at all.
user3010322
But they are r-values.
user3010322
Apparently.
user3010322
moral-values
Temporaries are (p)rvalues, but that doesn't make them references.
user1804599
01:15
Whoops.
user1804599
Forgot to set aboutToCollect() back to false. :F
user3010322
@AndyProwl You know, technically this statement isn't wrong.
user3010322
What he said (at least that sentence) is exactly right for its scope.
user3010322
r-value references invoke move operations when used to initialize or in an assignment expression.
user3010322
That is technically a completely valid, correct statement.
user3010322
01:17
And probably closer to the right one, since temporaries can be treated as rvalues or lvalues, depending on where they get used.
@ThePhD No, the statement is wrong. A move operation is applied when an rvalue is used as an initializer, not an rvalue reference. "rvalue reference" is a type, not a category. Category matters, type doesn't.
@ScarletAmaranth he always comes last
user3010322
@AndyProwl If type doesn't matter, then the statement is still perfectly correct. :D
Moreover, if you do X&& rref = something(); X obj = rref;, the initializer is an rvalue reference, but it is also an lvalue (because it has a name), so that won't trigger a move at all.
@AndyProwl you can still cast it manually
01:21
@ScarletAmaranth My point is that Bjarne's statement is incorrect.
user3010322
Write him a letter.
user3010322
Or sue him.
what is it that he said exactly?
Moves are not triggered when the initializer is an rvalue reference, but when it is an rvalue.
@AndyProwl using rvalue-reference at the right-hand side of an assignment will not trigger the a move-assignment operator right?
01:22
25 mins ago, by Andy Prowl
> A move operation is applied when an rvalue reference is used as an initializer or as the right-hand side of an assignment.
user3010322
@StackedCrooked No, because it's named, and therefore an l-value.
user3010322
Which means it's not just an r-value anymore.
well yeah it's technically incorrect, it should be "an rvalue", you're right, but everyone makes mistakes
@ThePhD then why do disagree that Bjarne's statement is incorrect?
@ScarletAmaranth I know, but that's meant to be "a book that every C++ programmer should read"
I found the first bad mistake on page 11, and this is on page 51
Like, wtf why doesn't he have reviewers?
01:24
TBH I think it's very confusing and easy to occasionally trip over the wording
user3010322
Maybe they're not as nitpicky as you language lawyers.
user3010322
Who knows?
This is not about being language lawyers
user3010322
"a named r-value reference can't be moved unless wrapped in std::move or static casted to an r-value reference before being moved" <---- gets me excited about C++.
well, it's not as confusing actually, an rvalue reference is an lvalue referring to an rvalue, and if you feed an lvalue as an initializer, it won't move, simple
01:25
It's like the #1 rule of move semantics: value category determines whether move is triggered, not type.
user3010322
I do wish they had named is move_cast though
user3010322
And moved it into the general language.
user3010322
std::move, really? ._.
on the other hand, with the new C++11 style, you can just do foo(std::container) and it will automagically work
move cast? what for?
it's static_cast<T&&>()
user3010322
To replace std::move
user3010322
01:26
@ScarletAmaranth That's ugly as balls.
but there is already a cast that can do it, why have two casts for it
user3010322
move_cast( my_stuff ) // So pretty, no headers, much wow!
rval() would have been enough. Or rvalue_cast. Or as_rvalue. But what's the point of a move function that doesn't move, and isn't even guaranteed to trigger a move?
user3010322
@ScarletAmaranth Okay, who static_cast<T&&> their shit?
user1804599
01:27
Ugh. I need [this] (auto const& interpreter) { return interpreter.get() == this; } because fucking std::unique_ptr has no operator== overload to compare with regular pointers.
@ThePhD I do because std::move is not amp-restrict ^^
@AndyProwl bad idea
why do you want people to think in terms of implementation?
user3010322
I want it to be an instrinsic part of the compiler.
I want to move something, I don't want to "cast it to an rvalue"
@ScarletAmaranth It's not about implementation.
user3010322
Not a library component I need to include a header for.
01:28
@AndyProwl Judge not lest ye be judged
@AndyProwl sure it is, you want to move an object, your goal is not to cast it
user3010322
@ScarletAmaranth That's exactly what you have to do.
user1804599
std::equal<>(this) would be so much nicer. :(
@ScarletAmaranth It's about distinguishing value category from type, which is something a programmer must know. It's not an implementation detail the programmer can ignore.
user3010322
std::move( stuff ) is just a glorified static_cast<T&&>
01:28
@ThePhD but we shouldn't speak in terms of what we have to do to get X either, I want to just express my intent, MOVE this object please
@AndyProwl so let's stick that implementation detail into everyones face?
user3010322
move_cast, since move is "too at risk" for getting "in the way" of current code.
std::string const s = "Hello"; auto s2 = std::move(s). Not going to move.
user3010322
Because thats' all it is.
user3010322
std::move doesn't move anything.
user3010322
It just casts.
01:29
it facilitates moves
@ScarletAmaranth As I said, it's not an "implementation detail".
@AndyProwl you said it's not an implementation detail a programmer can ignore
user3010322
@ScarletAmaranth static_cast<T&&> facilitates moves too. But it's ugly.
user3010322
std::move does it, but not only is it ugly, it requires a header.
@ThePhD that's why std::move exists :P
meh, I can #include a header easily :P
01:30
@ScarletAmaranth Yes. It's not an implementation detail. And an implementation detail is something that (as a user) you can ignore. This is not something you can ignore, so that's not an implementation detail.
user3010322
move_cast. Same number of letters. Part of the language. No fucking headers needed.
if you are very concerned about including a header, then just static_cast<T&&>
user1804599
@ThePhD It has one more letter than std::move.
user3010322
@rightfold :: is 2 letters.
user1804599
No, it’s zero letters, noob.
user3010322
01:31
std - 3
:: - 2
move - 4
= 9
user3010322
@rightfold "glyphs"
user3010322
Whatever.
user1804599
Also, every sane compiler allows specifying which headers to always include from the command line.
@ThePhD rvalue_cast
user1804599
So you can just add <utility> to it.
01:31
@AndyProwl I am not saying you can ignore it, I am saying we should speak in terms of our intents... you can't ignore that the array is contiguous, should it say std::contiguous_storage instead of std::array ?
user3010322
@rightfold Until you go somewhere that's not a development environment you own, and then suddenly, you're back to #include <utility>
user1804599
@StackedCrooked &&_cast
(T&&) :P
user3010322
@StackedCrooked more letters than even static_cast.
user3010322
@StackedCrooked 10/10 best cast.
01:32
std::add_category<T&&>(expr)
user1804599
Then don’t whine and use #include <utility> like everybody knows and is used to or don’t use C++11.
Maybe this should be supported: (&&)
lol
x as &&
user3010322
@ScarletAmaranth 10/10 great syntax.
user1804599
@StackedCrooked Sections!
01:34
@ThePhD I actually really like the "as" casts, in spite of the fact it sometimes pushes types a bit to the right
@ScarletAmaranth That's a good point, yet the name doesn't really serve the purpose, because it won't trigger a move all the time. It's just not what it does.
@rightfold GitHub syntax highlighters aren't very good
@rightfold because one should never thread lightly
user3010322
Lol.
user3010322
01:35
These puns.
user1804599
Hmm.
user1804599
But I am implementing lightweight threads!
@StackedCrooked that's not a bad pun at all, here, have a star
@rightfold what is it that you're writing? why does it say vm o_O? :D
@AndyProwl well, it moves if possible, but somehow std::move_if_you_can() doesn't sound right :)
user1804599
An interpreter. Because it is a VM.
why would you be writing an interpreter :P
user1804599
01:38
Because it is fun.
user1804599
And I want to learn Boost.ASIO.
@ScarletAmaranth He started another project.
oops :P
user1804599
Can locking a mutex throw an exception?
Projects started / Projects finished would crash the program.
user1804599
lol
01:40
@rightfold I don't think so.
user1804599
Otherwise this would be dangerous. :P
user1804599
aboutToCollectFlag = true;
std::lock_guard<decltype(mutex)> lock(mutex);
aboutToCollectFlag = false;
@ScarletAmaranth It does sound more right than move to me, it is just very impractical :) And since every programmer is forced to know about value categories in order to understand move semantics (because that's what decides everything), I think having a name that does refer to a value category would be very appropriate.
user1804599
inb4 joke about the collecting of flags.
T&& move (or copy)(T&&);
;P
user1804599
01:42
user1804599
D:
the heck is the the second thing
@rightfold lock can throw.
@AndyProwl I am not sure if the committee even wants every C++ programmer to know the term category
user1804599
@AndyProwl Twitter client.
user1804599
01:43
@Rapptz Oh well; the caller is noexcept anyway. :)
@ScarletAmaranth Then how does one get to understand that X&& x = X(); X x2 = x; won't move x into x2? "But it's an rvalue reference!" - "Yes, but that's also an lvalue"...
@ScarletAmaranth Maybe not in the past. But I think the understanding if becoming more important.
Throws std::system_error when errors occur, including errors from the underlying operating system that would prevent lock from meeting its specifications. The mutex is not locked in the case of any exception being thrown.
@AndyProwl well, this is actually intuitive (for some definition of intuitive), you can refer to the thing as it has name, this means it's dangerous to move out of it
try_lock doesn't throw though
and returns true/false
01:45
I really love this.
@ScarletAmaranth "dangerous" is a subjective term. If you really want to understand how it works, you will have to start googling around until you have a precise enough intuition of what an lvalue and an rvalue are. Which in turn means you have to understand value categories.
(that was the case for me at least)
user1804599
The first Styx function I will implement will be sleep(seconds).
user1804599
And then sleep sort.
I would need to call sleep(enough) on myself
01:49
I still don't think it's as imperative, move ctors / assigns are present in standard stuff and sometimes generated by the compiler for you (and ofcourse you can define your own ones), then passing by value will work automagically... I think, to an extent, only people who write libraries need to have this knowledge (that is not to say it's useless for everyone else, by no means)
user1804599
It allows me to check out Boost.ASIO.
@Griwes obesity up, you just have to search harder ...
user1804599
this_thread::sleep_for(std::chrono::hours(8)). Good night :)
@rightfold my brain can't grasp this, ..aaarrgh!
@AndyProwl Good night!
user1804599
01:54
@AndyProwl that would be immensely expensive given I use a thread pool with a resuming mechanism.
user1804599
@StackedCrooked my brain can grasp the lack of whitespace right in front of that comma.
ok
Fixed.
HAPPY NOW?
@rightfold Thankfully my body doesn't run on such a VM
user1804599
@StackedCrooked JA :3
(or does it?)
user1804599
01:55
It probably does.
@AndyProwl You are not supposed to know that.
I'll suffer the consequences then.
user1804599
Your body turns energy into shit.
user1804599
Styx VM is like, multithreaded Node.js with implicit callbacks.
01:57
@StackedCrooked I shall end this day in ignorance. How sad.
Ignorance is bliss :)
True. And sad :)
user1804599
On a 16-core machine it will spawn 16 threads. :v
user1804599
02:03
@rightfold Cool!
I've seen it before though.
user1804599
It is time to implement functions and function calls.
user1804599
And integers.
@rightfold have we tried link loops?
a -> b and b -> a ?
user1804599
Yes.
user1804599
02:05
Me too, for I am not blind.
user3010322
Is it wise to have all forward declarations for something put in a single header, which you include everywhere you need it?
user1804599
No.
user1804599
Avoid forward declarations when possibru.
@ThePhD No.
Just write the forward declarations when you need them.
user3010322
Why that way instead of with the header?
user1804599
02:07
Let me guess.
user1804599
Your code is full of forward declarations because you have a shitload of cyclic dependencies.
user3010322
No, I use them to avoid including headers until I reach the .c++ file level (the TUs).
user1804599
Just include the headers.
user3010322
For example, const BigFatStruct& doesn't need the header to be used in the class' prototype / declaration.
user1804599
Include it anyway.
user3010322
02:09
Okay.
user1804599
#include-directives immediately make dependencies clear to the reader.
user3010322
Ugh.
user3010322
Not being able to downcast without a virtual function is painful.
user1804599
Stop casting.
user3010322
You should stop casting.
user1804599
02:12
I already did that.
I need some soup
@ThePhD It is sometimes done. But I'm not a fan of it.
@ThePhD What do you need that
@ThePhD I should learn to read.
But you can static cast.
02:30
I think the main question is...
do you have enough mana to cast so much, @ThePhD ?
the main question is how many hours until the next One Piece episode?
I think 5-6 at least.
what?
I always find it online at like 3AM Mondays
02:33
wtf
how come this early
It airs in Japan on Saturday mornings.
and why didn't you show me this website earlier :D?
omg you didn't know? :)
that's required knowledge
nope, more often than not though, I stream anime
Maybe because you shouldn't link to :files:
wait what, new log horizon?!
damn
yep
[HorribleSubs] ImoCho - Another Shitty Sister Manga Adaptation
yeah I saw that, lol
This seemed pretty good too.
I saw ep1.
It's very ecchi though.
02:38
sexually tinted scenes
ah god, no thanks ^^ that's what I found surprising in Code Geass, I was like, watching a random episode and out of nowhere: "You have nice rack, xyz."
I was like srsly what the fuck is happening
ImoCho is pretty wtf
But entertaining.
Xeo
Xeo
haha, I read the manga of that
only has 8 chapters yet, though
Xeo
Xeo
It's definitly weird though
02:41
the last (and the best) run of AGDQ starting soonish
(Chrono Trigger)
also I like the guys that will be running it as they also run final fantasy games
Did Washington and Colorado legalize recreational marijuana sales?
yes
That's really big news, how did I miss that.
Happened last year.
why does an email titled "FREE PILLS" even arrive into my spam folder?
02:54
@ScarletAmaranth it's an email directed to you
Google can't just decide to not deliver it to you. Unless they know 100% certain that it is spam or malicious.
shit's been spammed for over 2 years
quite annoying
03:15
@StackedCrooked well, they had better, not like people send "FREE PILLS" emails to friends :P
if (title.matches(/FREE PILLS/)) gtfo();
indeed
mmmm, is it customary to say something along the lines of: I don't want your silly job position -> "but good luck with finding suitable candidates" sort of nonsense?
@StackedCrooked It's more restricted in Washington, but definitely the case here in Colorado.
@Rapptz The vote happened last year. Didn't take effect until New Years though.
Yep
03:47
two baby magpies are practicing singing on the apple tree in the backyard - worst magpie songs I have ever heard ... but it is funny because both are singing at the same time until one chased off by a noisy miner bird

« first day (1184 days earlier)      last day (3990 days later) »