« first day (1868 days earlier)      last day (3070 days later) » 

10:00 PM
bask in the glory of the amazing API
 
what kind of while loop is that
 
hmm
 
magic comma operator for code obfuscation
 
I don't know if a Window object is really the right way to go.
 
@Puppy it's been a while
 
10:03 PM
@Rapptz what milleniumbug said
 
I don't quite recall if the OS can terminate your windows for funsies
 
that's terrible
lol
 
@Puppy it's an idiotic lib aimed at noobs at unis
any more suggestions :D
 
rename it oglw::youre_so_bad?
 
hey that's nice
I might consider it
 
user1804599
10:05 PM
How do you decide when to do a GC cycle?
 
user1804599
Every N bytes allocated?
 
@Elyse look at CPU usage dropping
or when you start getting ooms
 
@Elyse When your heap pool is exhausted.
 
My cat's licking is telling me I made a bit of a mess :\
 
user1804599
@BartekBanachewicz I thought of scheduling a low-priority GC task after every N async I/O operation begins.
 
10:06 PM
@Puppy and oglw to ohgod :P
 
user1804599
@BartekBanachewicz Collection cycles themselves allocate memory, so OOM means all hope is lost.
 
so don't do that then
 
user1804599
Very difficult.
 
user1804599
I guess I'll just do a cycle after every N bytes allocated.
 
10:07 PM
@Puppy win.your_code_is_bad("and you should feel bad");
 
@Morwenn y u do dis to me
 
user1804599
@StackedCrooked you should implement a Coliru feature that it can load code from a gist.
 
user1804599
@Puppy I use non-overloaded operator new to allocate. :p
 
pretty terribru ;p
use compacting GC in a pool for best effect
 
user1804599
Hard to implement; won't do that right now.
 
user1804599
10:11 PM
Also have to figure out how to implement stop-the-world.
 
Once you go RAII, you never go ???
 
void*
 
@ElimGarak new
 
@ElimGarak anything
 
user1804599
@ElimGarak C++
 
user1804599
10:13 PM
I guess I can use a condition variable for stop-the-world.
 
user1804599
When the count reaches zero, the GC can do a GC cycle.
 
user1804599
And all mutators wait until that's done.
 
user1804599
14
Q: What mechanism JVM use to block threads during stop-the-world pause

MirianI heard this question on an interview and couldn't provide an answer. Later I searched thru the internet and still didn't find an answer. Can anybody tell me how JVM stops threads during stop-the-world pause when collecting garbage and how it run them again.

 
bloat
 
user1804599
@sehe ???
 
10:16 PM
The method to stop the world.
 
user1804599
No idea what you mean, as usual.
 
Getting ambiguous call between
`(..., Iterator &,const Iterator &,const Context &,Attribute &)`
`(..., Iterator &,const Iterator &,const Context &,ActualAttribute &)`
lol
 
chwalisz się czy żalisz, ziomek?
 
@BartekBanachewicz wrong window?
 
@milleniumbug well, seemed apt to the message above
 
user1804599
10:19 PM
How expensive is locking a mutex?
 
and I cba to translate idiomatically
 
@sehe I'm rewriting this soon. Gonna be streaming with no allocations. Static methods only. #full retard
 
@Elyse depends
@VillasV is the first param an lvalue? Did you mix const/non-const iterators?
 
user1804599
:(
 
@VillasV is that X3 or Qi?
 
user1804599
10:21 PM
Enrooting and derooting cause locks currently. I can avoid that without too much complexity, though.
 
no and no. X3
Both are `std::string::const_iterator`
 
@VillasV x3 doesn't care about lvalueness anymore. Show me the SSCCE?
 
@sehe Its kinda big, I'll trim down the non related parts (might as well find the error doing that)
 
local function a.x() end is forbidden in Lua right?
 
@VillasV or share it somehow feasible
@BartekBanachewicz are we the lua helpdesk experts now :)
 
10:23 PM
@sehe @Puppy is kinda good with it and you've played with it as well
 
pfft It that counts
 
@BartekBanachewicz As far as I know, but I basically never used local function, I always used local a = function
 
local function defs are a bit special IIRC anywya
 
I think you guys caught me with page three of the language tutorial in a browser tab (hidden) once
 
ISTR there's something really dodgy about local functions that's just not quite the same.
 
10:24 PM
@Puppy yeah well I'm trying to support sugar syntax
@Puppy yeah :/
I'd really love to take some real-world code and run it on my interpreter
at some point
 
> at some point
lol
 
well right now it's missing a lot right.
but it would be interesting to see how fast it is for example
 
my recommendation
port _.js
 
and how gigantic the memory overhead is
@Puppy I was more interested in existing Lua codebases
 
I wasn't recommending it for the lols ;p
 
10:26 PM
but e.g. I don't support IO at all now
 
Lua's existing stdlib is hardly gobsmacking in it's breadth
porting _ would be both informative and useful.
 
remember that the whole VM is pure with explicit state management
as in, you could backtrack when debugging like in Elm
 
yeah, Lua code can be impure as fuck so you probably can't really do that
 
the pure state management gives you a lot of interesting possibilities though
 
we're moving to it in my company with Redux and React
 
10:27 PM
I'd like to explore them more, even if that means lacking good io support
 
so we can backtrack-debug, hotload, and other such crazy shit our website
 
nice
yeah well it's my first interpreter project so I'm kinda noob at all that
 
@sehe said and done. Got the MWE, error disappears. I'll investigate a little bit more before deciding to post the big code to SO.
 
a lot of things are new
 
I would say
that whilst it's interesting to have a pure Lua interpreter that can do that shit
 
10:28 PM
@Borgleader 'cause I love ta tease ya bby
 
it would be not especially useful, IMO, if it could not support I/O.
 
@VillasV how to solve your problem by almost asking on SO
 
the Redux approach you may find informative in this case.
 
@Puppy I thought it might be helpful in some code analysis
I want to support console IO for sure
 
it's not really dissimilar to Haskell where I/O provides effectively just inputs to pure functions.
 
10:30 PM
as in, I'd like to make a console where backtracking would make printed text dissapear :)
 
then when backtrack-debugging you still have the input from the I/O to replay if you need to
 
@sehe not solved yet, though lol now I have to figure out why deleting stuff that I thought not related to this fixes the problem.
 
@Puppy exactly
that I can do pretty easily
 
@VillasV sure, that's solved, because you can just bisect until you find the breaker
 
but for say sockets...
i mean sure i can capture incoming data
but there are many interactions going on with sockets
 
10:31 PM
@sehe indeed a matter of time. Little time I hope
 
like timings for example
 
Ven
@milleniumbug ...like every single time?
 
well I guess you could time console input as well
 
you can mock the clock.
 
aw yiss.
 
10:31 PM
we do it in both C# and Typescript
 
sounds like a cool thing to do as well
 
we had a really fun issue in Typescript where our unit testing library mocked setTimeout and friends, but forgot to mock new Date().
 
rx is nice for mocking time
 
we used a throttling function that used both mechanisms to determine when to call the throttled function.
 
Ven
mock the clock? "Hey clock, you're stupid" "Well f- you too buddy, ain't no one got time for 'dat"
 
10:32 PM
so it got super confused
 
user1804599
You need a date factory.
 
so far I'm proud of the template codegen I did as well
turns out that Haskell isn't that bad at metaprogramming at all
 
@Elyse We have a date factory- it's called window.Date. We just don't have a unit testing library that will mock it out.
 
user1804599
Don't monkey patch.
 
no choice
 
10:34 PM
@Elyse why not?
 
user1804599
Pass window.Date as an argument.
 
it's an external library.
 
user1804599
@BartekBanachewicz It has unforseen consequences.
 
and frankly
 
10:34 PM
in the case of unit testing, I think that monkey patching is fine.
 
all of our code at work is based at monkeypatching
 
user1804599
For example, code that actually depends on the particular implementation will break.
 
it's one thing to monkey patch for your normal semantics
and another to monkey patch to just mock out the normal functionality for testing purposes.
 
user1804599
Don't treat tests as special users of your APIs.
 
hint: he said external library
 
user1804599
10:35 PM
Testability is not special. It's just one case of reusability.
 
it's pretty fucking difficult for the JS code to observe the browser native code implementation of Date.
 
I think you're wrong Elyse.
 
user1804599
Mock the external library.
 
user1804599
Stop farting.
 
10:36 PM
mock elyse
 
elyse is n00b
 
I could mock the external library but for the mock to have the necessary semantics would basically boil down to re-implementing it.
 
@Morwenn <3
 
user1804599
Oh, implementing stop-the-world is actually very easy.
 
@sehe Actually, now I'm confused. Throwing the exact same code on Coliru compiles and executes correctly. MSVC thing, maybe?
 
10:37 PM
not to mention that we probably want to know if there's a problem in the library code, since we depend on it in production.
 
user1804599
Just a mutex.
 
eh I wish Lua didn't have sugar for function definitions
 
user1804599
inb4 deadlock
 
oh wrong conversation thread.
@BartekBanachewicz Me too, it seems kinda pointless and unnecessarily confusing.
 
@VillasV oh yeah. likely. MSVC binds temps to mutable refs. Try with local variables if you don't already
 
10:38 PM
@BartekBanachewicz Me too, it seems kinda pointless and unnecessarily confusing.
 
Is the attribute a lvalue ref?
 
Deadlock = DeadMG ♥ Bolt Clock
 
I've no way to do fail testing right now
ouch.
maybe I could wing it by reusing the name for now
  1) Eval should properly scope locals
       uncaught exception: PatternMatchFail (Eval\Eval.hs:(141,1)-(182,22): Non-exhaustive patterns in function execStmt
right
oh shucks. fuck.
crap.
 
Wide has some fail testing but not a lot
 
10:43 PM
I need to move the closure to the monad because it's not readonly (duh)
last level of closure is writable by the current scope.
 
@sehe local variables for who? I won't be able to define the rule at local scope I guess
 
@VillasV why not (show it!)
I had a bit of trouble finding this out myself
But of course you can. You can even dynamically create rules inside a lambda. It's insane
 
Evening
 
hi jefery
 
BOOST_SPIRIT_DEFINE gives me error C2951: template declarations are only permitted at global, namespace, or class scope
 
10:47 PM
So much sushi in my stomach
 
smells like sushi
 
Now 5 days of "no fibers, fruits or vegetables allowed"
 
@VillasV Don't use it then. Please, show the code instead of throwing unnecessary blockers
 
user1804599
Ugh, try_lock throws instead of returning a Boolean.
 
Ok, this is the code that works on g++ but not on MSVC
http://coliru.stacked-crooked.com/a/27ac10411e2ff115
 
10:48 PM
@Elyse huh. Just use unique_lock with try_lock_t?
 
user1804599
This API is so horrible.
 
@sehe I thought BOOST_SPIRIT_DEFINE was a must :o
 
Perhaps only if I try to give it a name?
 
10:49 PM
@VillasV i dunno reviewing
sample input?
 
so length.ToString("abc") -> "abc" right?
 
user1804599
Oh wait, it does return a Boolean. Nice.
 
that or throw
 
@Elyse It returns an int.
 
same thing :)
 
10:51 PM
@sehe any phrase
 
user1804599
void gc::collect() {
    std::unique_lock<decltype(stop_the_world_mutex)> stop_the_world_lock(stop_the_world_mutex, std::defer_lock);
    if (!stop_the_world_lock.try_lock()) {
        return;
    }
    ...
}
 
user1804599
Not sure if this is a good idea.
 
Oh, wait, not that try_lock
 
@sehe The video is pointing at the stream website, I can't see what you're typing if that's what you meant to show
 
loungers talking about programming, I'm not surprised :P
 
10:53 PM
@VillasV good point
 
user1804599
Maybe I should use try_lock_for instead.
 
user1804599
Or something else altogether.
 
user1804599
Basically what I want is a shared mutex, except acquiring a shared lock will block if someone is waiting for a unique lock to be acquired.
 
user1804599
So unique lock acquisition has priority over shared lock acquisition.
 
@sehe and another one which is a namespace, lol
 
10:58 PM
so, a classic readers-writers problem
 
user1804599
Yes. The collector writes and the mutators read.
 
user1804599
But the mutator may trigger the collector.
 
user1804599
In that case it should release the shared lock, invoke the collector, and then acquire the shared lock again.
 
user1804599
But the real problem is: when the collector is waiting for the unique lock to become free, no mutator is allowed to acquire the shared lock.
 
user1804599
I have no idea how to implement that.
 
11:03 PM
@VillasV good job :)
Here's the two variants I riffed off (so you can copy/paste into MSVC) coliru.stacked-crooked.com/a/55e5527c7b1ae9b2 vs. coliru.stacked-crooked.com/a/1fb867285b0e02c5
 
Captain Giraffe -- not an available username.
 
user1804599
@milleniumbug Well, not quite.
 
user1804599
Actually, the mutators (shared lock) write, and the collector (unique lock) merely reads.
 
user1804599
No, wait, other way around, nevermind.
 
user1804599
The mutators read the GC state while the collector writes it.
 
11:06 PM
even if it was the other way, it wouldn't change the nature of the problem
 
@VillasV coliru.stacked-crooked.com/a/9e3bfd9777c52ce0 using istream iterators
 
user1804599
Unsynchronised concurrent writes to GC-managed data cause UB like in C++.
 
@sehe both compiled fine. Thanks very much. I thought that the define macro was required, even better that not then
 
user1804599
try_lock_for seems like a huge hack.
 
user1804599
@milleniumbug this should work: gist.github.com/rightfold/e23bc9ada79afdf2d5da
 
11:12 PM
yo
 
@jaggedSpire <3
 
user1804599
This way, lock_shared will block until the unique lock request is done.
 
@Morwenn <3
How've you been?
 
@jaggedSpire Beer.
 
@Morwenn TIL Beer is a state of being.
 
11:13 PM
@VillasV bonus chatter for non-adapt-struct: coliru.stacked-crooked.com/a/4ca55c3371cfd235
 
It's good to hear that you're beer. :P
 
@jaggedSpire I would post that webcomic about alcohol if I hadn't aleady done so.
 
@VillasV the define is only for separating declaration and definition. It uses some "trait" types to correlate the two.
 
@Morwenn but I don't know what you're talking about. :(
 
Search seems broken again, so... repost.
 
11:15 PM
@sehe thanks :) it was fun to watch that. nice scarf and vim skills
 
@VillasV :D
 
@Morwenn :D nice
 
user1804599
Lol, I have a deadlock.
 
what do you prefer deadlock or cockblock?
 
user1804599
It was a nasty one: I held a lock while creating a smart pointer that wants to acquire the lock in its constructor.
 
11:23 PM
you know
 
Use reentrant locks
 
one thing about haskell is that it's cool because even if you're drunk you can still code in it
 
user1804599
ballmer peak
 
Alcohol is evil
2
 
11:24 PM
oh @Cat you've unplonked me?
 
Also never learning
 
user1804599
Time to unit test my garbage collector.
 
please tell me that you did
You're a terrible asshole but you're one of very few assholes that understand how and why programming is shit and it's a lonely club
 
assholes unite <3 :)
 
@CatPlusPlus Alcohol is literally Hitler
 
@TonyTheLion <3
 
I don't think he unplonked me :(
 
@milleniumbug Nah, Hitler did nothing wrong was a soda.
 
@milleniumbug Vodka is distilled from pure nazis
 
11:26 PM
TIL Nazis are potatoes.
...mashed potatoes remain delicious.
 
someone tell him that I'll get over the fact he called me a ridiculous nerd if he unplonks me and gets over how bad I am
 
The real problem is that wine's too good
 
std::string* - the C force is stronng with that one — sehe 7 secs ago
 
@sehe oh god what
 
the best part is that he does it correctly one line below
 
11:28 PM
@jaggedSpire It's the nice waypoints on SO
You gets them for free when out of boost questions
 
@sehe I'm sorry to hear you're out of boost questions. :(
Especially since I'm half convinced you eat them for sustenance.
 
std::string* is not anywhere near my difficult stuff. I had a student say: this program isn't working. Should I write a new program?
Sometimes I cry a little in my own chamber.
 
awww <3
 
I used to rewrite code when it segfaulted
That was like 7 or 8 years ago
 
Standard libraries are fun
 
11:38 PM
I'm falling asleep.
 
@CaptainGiraffe The answer is yes! Job done
 
@Morwenn Go to bed
 
@Borgleader AHAHAHA
 
@sehe besides the helpful cleanup and tips with iterators, just taking out the BOOST_SPIRIT_DEFINE is enough to fix that problem.
 
@Mysticial How is Chicago?
 
11:39 PM
@VillasV :D
 
I'm not in Chicago atm.
 
@sehe The answer is "allow me to help you to understand how an executable is built"
 
I just had a pretty scary flight.
 
oh
what made it scary?
 
11:40 PM
I was looking out the window, and then a jet (737 or A320) zoomed directly above us. It was so close that I could see that the logo was blue/greenish.
 
oh wow
 
Then a few minutes later, I noticed that the plane suddenly started descending.
 
thank god for TCAS huh
 
I look out the window and there's this white gulf stream jet coming right at us. It passed above and behind us.
 
Fuck, that reminds me I need to check the students evaluation of me.
 
11:41 PM
I really wanted to ask the pilot if the TCAS went off, but I didn't see him on the way out.
 
sounds like it might have
 
Two close calls in one flight.
 
@sehe mean seems wrong
 
I'm no expert on planes, but the fact that the planes were close enough for me to identify roughly what they were at cruising altitude says something.
 
@milleniumbug I just copied the formula blindly (fixing the cast). Oh well
 
11:43 PM
@milleniumbug unless its an arithmetic progression
 
@Mysticial hooooly
 
ah, that's OP's fault
lol
let it be
 
Ven
Polnareff is so great. Thank god for french music.
 
user4842163
@Mysticial Hope you don't mind, but I ended up putting a bounty on this question asking for a "Mysticial-quality" answer. :-D stackoverflow.com/questions/33898371/…
 
11:47 PM
@StackedCrooked didn't know you're into Rihanna
 
I am.
Her voice demands my attention for some reason.
 
Her older stuff was pretty ok. I like Shut Up and Drive
 
I read she risks losing her voice with her current lifestyle.
That would be terrible.
 
@StackedCrooked that being?
 
user1804599
How are mutexes unit tested?
 
11:51 PM
However, that was two years ago..
 
mmm
I am a fan of Gaga's voice personally
 
user4842163
@Elyse The implementation or the use of one (ex: testing for race conditions?)
 
but she seems like a more reasonable girl
 
Hmm
 
@Ike Oh great, I've become a unit of quality now? :)
 
11:52 PM
@BartekBanachewicz lol, I am fan of two female singers: Rihanna and Gaga
 
3.14 Mysticials
@StackedCrooked :)
 
I haven't done shit in almost a year on SO.
 
user4842163
@Mysticial Yes -- at least as I see it. :-D I'm yearning to see more of those kinds of former benchmarks, assembly analyses, etc. That question seemed ripe for it.
 
@StackedCrooked FWIW I also like Anneke van Giersbergen
her notable performances include multiple Ayreon albums
 
Just saw Gaga's performance on Oscars 2015. She sang a medley of the Sound of Music. Julie Andrews herself seemed very impressed.
@BartekBanachewicz never heard of her
she takes stuff seriously
 
11:57 PM
@StackedCrooked yea
Anna Maria van Giersbergen, (Sint Michielsgestel, March 8, 1973), known artistically as Anneke van Giersbergen, is a Dutch singer, songwriter, guitarist and pianist who became known worldwide as the lead singer and songwriter for the Dutch progressive/alternative rock band, The Gathering, between 1995 and 2007. Currently she has a solo career. The project was originally called Agua de Annique, but later going by her own name. A frequent collaborator of Arjen Anthony Lucassen, she portrayed main characters in the albums Into the Electric Castle and 01011001 by his project Ayreon. In 2014 they created...
I saw her live twice so far, absolutely great.
 

« first day (1868 days earlier)      last day (3070 days later) »