« first day (2176 days earlier)      last day (2776 days later) » 

Ven
4:00 PM
My mom also told me I was an error once, and I know she loves me :-).
 
Do I have NPM?
I don't think I do...
 
@BartekBanachewicz Oh yeah, passed
@Abyx No, I'm just taking the license because it's free at the moment
 
@Shoe but when would you need to drive a truck?
 
To take over my dad's job at the driving school
Or to move to a new apartment I guess
 
sob.
 
4:09 PM
Or if I ever have a wild fetish for driving a truck 9/10 hours a day
 
It still won't work.
Why am I so shit at OCaml.
 
It's free qualification v0v
 
My dad has a driving school
In order to teach people to drive you need all driving licences (or almost all)
 
@BartekBanachewicz that's brilliant
 
4:12 PM
So in order to take his job, I would need those driving licenses
 
> tfw no ocamlBetterErrors
> npm package managers assume you're on Linux
 
I personally hope to take his job by working on driverless cars, but you never know in life
 
Fuck most OS software developers up the ass ever.
 
Xeo
oi
 
oh well
my gf said that we could well go on a road trip to see the bike
egh fuck distances
@ThePhD because you're too stubborn to understand it works in a way different to what you already know
@Shoe meh, driver-ful cars will be there for our lifetimes at least
 
4:21 PM
Ugh.
My fold still doesn't work.
Sob.
 
don't worry, it only took me about two years to grok FP
 
Maybe it's because I can't read this type signature.
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
So I have...
let do_fold k v l = ( k, v ) :: l;;
Map.fold do_fold some_map my_list;;
Is that the wrong order, or what?
 
what's the error?
 
you can copy text from the terminal you know
 
4:30 PM
lazy because textual output in cmd is hard to copy
 
@ThePhD RMB->mark->circle around->enter
or use another terminal, cmd isn't the only one for windows; I recommend Console2 or mintty
can you do :t in OCaml? (live type introspection)
 
What is :t ?
Oh. Uh. I don't know?
 
do you have a shell?
I'm sorry, a lot of my knowledge is just haskell, I don't really know how it maps to OCaml
@ThePhD Check out this as well
typed holes are very helpful when you can't figure out how to solve a type error
 
@BartekBanachewicz I hope not
 
@Shoe I sure as hell do want to drive my motorcycle until then :F
@ThePhD it looks like do_fold was typed... not quite right
can you type it explicitely?
let do_fold : (StringMap.key -> a' -> b' -> b')
    do_fold k v l = ( k, v ) :: l;;
does this work in OCaml @Shoe? ^
 
user1804599
4:36 PM
No that's not how you do it
 
user1804599
You put the type in a module signature, and the value in a module structure.
 
oh uh
let b = (C foo : t) apparently works
 
@BartekBanachewicz Dunno, haven't done OCaml in a while
@BartekBanachewicz You'll be able to even when driverless-cars will be a thing... just on a racing track.
 
@ThePhD try let do_fold k v l = (( k, v ) :: l) : (StringMap.key -> a' -> b' -> b');;
 
user1804599
There is one other option, which is generally used for private functions: let do_fold (k : StringMap.key) (v : ...) ... : 'b = ...
 
Ven
4:37 PM
Yes ^
 
@ThePhD ^
 
Ven
@ThePhD what's wrong with it?
Do you know all the parts?
 
uh shit i should prolly head home
it's getting dark
 
Xeo
@caps currently watching it
 
4:40 PM
I have.
 
Xeo
ye
 
The bit around 18:30 where he's talking about the complaints that C programmers make about his benchmark is awesome.
 
@Xeo timestamp, yo?
 
@Xeo Same here. Haven't finished yet but I'm enjoying it.
 
Xeo
30mins, paused to do some other stuff right now
 
4:42 PM
There's no generic print in OCaml, is there?
 
very good talk, yes
 
user1804599
@ThePhD how would that work?
 
@rightfold It wouldn't because no overloading and no way to runtime-switch on types.
That doesn't make this any less crappy, though.
 
user1804599
Types are erased, luckily
 
It works, finally
I can fold it, sort it, flip it....
 
4:46 PM
gud jerb
 
user1804599
Yay :)
 
let do_fold k v l = ((v, k) :: l);;
Apparently, (v, k) :: l;; yields a value or w/e
 
Xeo
... the parens were the prohblem?
 
Yes.
Literally, the parents on the outside. Makes it into a function? Or something.
 
user1804599
@ThePhD absolutely
 
Xeo
4:48 PM
 
user1804599
I'm pretty sure there is a map to list function btw
 
Xeo
looks the same to me
 
user1804599
It is the same.
 
user1804599
You never have to parenthesise the thing between = and ;;
 
Xeo
Then I wonder what @ThePhD's problem was
 
4:49 PM
I don't know anymore.
 
user1804599
Btw @ThePhD, Map.S has a function bindings : 'a t -> (key * 'a) list.
 
Yeah, but I wanted it in reverse order ('a * key)
I was using bindings before, though.
 
user1804599
Compose with List.reverse.
 
user1804599
Oh, the tuple in reverse order.
 
user1804599
List.map swap
 
Ell
5:02 PM
oh hey @BartekBanachewicz
 
Ven
Yeah ocaml is really bad at functions
 
user1804599
guys look at my new OS
 
user1804599
 
Ven
Ew; not spacemacs :P
 
Hello all

Any help with this question will be appreciated http://stackoverflow.com/questions/39795860/pgm-binary-file-manipulation
 
user1804599
It uses new[], so the only help that can be given is stackoverflow.com/questions/388242/…
 
@caps Lounge Survival Guide; Chapter 1: if you are arguing you are losing. The End.
 
@rightfold Could you be more specific?
 
@hello I've helped already! have a -1
 
5:29 PM
uint8_t** image = new uint8_t*[rows];
hello darkness my old friend
 
@ScarletAmaranth Nice! A comment will be appreciated.
 
user1804599
Never use new[].
 
user1804599
It's an obsolete language feature. It exists solely for backwards compatibility with really old code.
 
And that's only half-trolling
 
@rightfold What the fuck dude!!!
3
 
user1804599
5:30 PM
Use std::vector.
 
@hello Yes. Not ever shall one use new[]
 
and you twats instead of linking to rules keep reiterating the same answer over and over :)
 
It makes sense to offer correction within the context of the question. I know vectors. Fuck
 
@hello Whom?
@ScarletAmaranth Both are equally valid noob-trolling methods.
 
@набиячлэвэли To whom it may concern.
 
5:35 PM
@hello Nihil ad rem. Whom shall we fuck?
 
@Borgleader
-48
Q: Why did they ban me from asking questions for asking a poor question when I copied a question exactly that was asked at least four other times?

glenn nallWhy did Stack Overflow ban me from asking questions for asking a "poor" question when I copied exactly the same question that was asked at least four other times on Stack Overflow? If it was a so poor question that it can get someone banned, I would think the other identical questions would have ...

7
 
lol
 
user1804599
XD
 
Phew!
 
This in syntax makes me sad.
I don't get how to use it. :x
 
5:43 PM
Use it not
 
I don't know how to inject EOF in the command line
Is it CTRL + D ?
Oh, CTRL + Z on windows systems
that's.... intuitive.
 
Or Ctrl+Z
or both (with bash)
or neither (it's sometimes borken)
 
This in syntax keeps my variable scoped to a single thing
I need to rewrite it...
Wat.
Man. These keywords.
They don't make sense.
(* Definitions can be chained with "let ... in" construct.
   This is roughly the same to assigning values to multiple
   variables before using them in expressions in imperative
   languages. *)
So... it disappears after use?
 
user1804599
5:49 PM
let x = y in z is an expression.
 
Right, and x doesn't exist after that expresison, right?
So let x = y in z doesn't really define anything, except... z ?
 
user1804599
Uh, well, x exists in z.
 
user1804599
There is nothing "after an expression".
 
user1804599
There are no statements.
 
let x = y in z;;
let a = x;; (* x does not exist in this scope * )
But, let a = z;; (* valid? * )
 
user1804599
5:51 PM
Those are one top-level expression and one top-level definition.
 
user1804599
Don't confuse let expressions with let definitions.
 
I guess that's why this code doesn't work...
Guess I'd better figure it out proper.
 
Some programs heavily rely on the likely()/unlikely() macros for static branch prediction. I once sneakily reversed their definitions, recompiled the program and ran a benchmark. The performance was unchanged.
 
Xeo
lol
 
Could it be that reversing all definitions actually becomes a no-op?
 
5:53 PM
@StackedCrooked I get the same feeling too.
 
So would randomly flipping individual cases likely/unlikely get me worser performance than flipping all of them?
 
But it's very hard to benchmark since the hardware will override the "static prediction" after the first time running the branch.
And it's almost impossible to benchmark something if you only run it once.
 
user1804599
@ThePhD just don't write top-level expressions.
 
user1804599
Pretend the feature doesn't exist.
 
And if the branch is only once once, it probably isn't performance critical.
 
5:55 PM
@StackedCrooked A random guess would be that they failed to benchmark. :P
 
AFAIK the likely and unlikely macros cause the compiler to put hot code together. (This implies the cold code is also kept together.) So flipping all of them doesn't affect the locality.
 
It's actually a builtin that the macro wraps. :P
 
@Griwes Sure. That's a given.
 
Did you try turning it off completely?
 
So my guess for a benchmark that actually shows the affect of likely/unlikely is a benchmark that has a million branches.
 
5:57 PM
@rightfold I can't chain functions for an eternity.
That gets messy and I can't read it well after a bit.
 
user1804599
What?
 
I want to have some top-level expressions that save some variables so I can use them later, rather than infinitely nesting expressions from start to finish.
 
user1804599
What does "chain functions" mean, and how does it relate to top-level expressions?
 
Also gdi I can't get this to woork.
 
@StackedCrooked That too. The main thing is that it affects the direction of the branch. When the processor has no branch history for a particular branch, it defaults to taken if it's a backwards branch and not-taken if it's a forward branch.
 
Xeo
5:58 PM
@ThePhD errr. you want bindings then, not expressions?
 
user1804599
let x = e;; is not an expression.
 
user1804599
You can define variables just fine.
 
likely/unlikely tells the compiler to generate the branch instruction in the direction that you hinted at.
 
Suppose a function that has 10 unlikely branches. However, the compiler did not know so it generated a stream of interleaving hot and cold blocks. At runtime the instruction pointer will make 10 little forward jumps on each invocation of the function. Between each jump there's a few instructions that do get executed. Will this cause instruction-cache problems? (Due to the program progressing faster through the instruction stream than the CPU anticipates?)
 
@ThePhD eh?
 
5:59 PM
"unbound value wordlist"
fffff
I need to tear apart this in expression.
 
can you show us some code that doesn't work
instead of asking us questions that we can't fully relate to?
 
@Mysticial good job
 
@StackedCrooked icache is the same as normal cache. I believe with the same cacheline sizes.
So if you're only using a part of each cacheilne, the total amount you can fit in the icache will be lower.
 
But what if the program fits in L1.
 
Then it probably wouldn't matter shit.
On top of the icache, there's also the uop cache which is several thousand instructions large.
 
6:02 PM
L1 access still costs 4 cycles AFAIK. So putting the hot code together would reduce the accesses?
 
That latency won't matter since it's all pipelined away.
 
@Griwes I don't feel like I grok things fully if I just keep showing the code. u.u;
 
@StackedCrooked Unless you need to flush the pipeline due to misprediction, or you can't pipeline because it's an indirect branch (call through function pointer).
 
6:03 PM
Hm, I suppose a branchful program is kinda like a linked list in that you can't look very far ahead.
 
Granted, I should just stop complaining so that becomes less of a problem.
 
@ThePhD Again. There's a certain entry level knowledge you need for being able to sanely solve problems. And some guidance as for idiomatic use of the language (or a paradigm).
It'll take you years to get that without actively talking with people about those problems. :/
It's not very productive.
 
@StackedCrooked Yeah. Branch prediction will help the processor do the necessary look-ahead to bring in instructions into the pipeline. For indirect branches, there's a branch target predictor to help resolve that. But if you're iterating over a list of polymorphic types with random real types and calling virtuals on all of them, you're fucked.
 
The processor can't predict where to jump next. And therefore you're fucked.
 
6:07 PM
Is it possible to assign to a top-level variable in OCaml from inside a let ... in construct?
 
@Mysticial It could speculatively jump to random memory addresses though.
Just like branch prediction :P
 
Xeo
@ThePhD why would you want to do that?
 
@StackedCrooked It does. But if the virtual call resolves to a different function each time, you're still fucked.
Target prediction is less effective since it's not a binary taken/not-taken.
 
@Xeo Because I can't take the 20 lines of code I wrote and nest them beneath the let .. in expression this code already has that defines a wordlist inside that local let ... in expression.
 
user1804599
@ThePhD No.
 
Xeo
6:09 PM
... erm. code?
 
Bwuh.
 
user1804599
@ThePhD Do you already understand the difference between let definitions and let expressions?
 
Sort of?
 
user1804599
A let expression is an expression. It can appear anywhere an expression can appear.
 
user1804599
A let definition associates the result of evaluating any expression with a name in the module.
 
Xeo
6:10 PM
let x = 1 + 1 in x + 1;; is the moral equivalent of 1 + 1 + 1;
 
user1804599
You use the latter to define top-level variables.
 
Xeo
(AFAIU OCaml)
 
Xeo
dot it please
 
Christ.
PLS
 
Xeo
6:11 PM
(dot at beginning)
 
user1804599
Oh, you want to reassign variables?
 
user1804599
You can't do that.
 
I just... I just want to expose wordlist so I can use it later.
 
user1804599
Instead of creating spaghetti code with mutable variables, functional programming forces you to be explicit and pass things around
 
You're trying to mutate the meaning of wordlist.
That's badware.
 
user1804599
6:12 PM
In OCaml you can cheat but I'm not gonna tell you how.
 
In FP you don't declare variables empty and then add values to them; you instead define the values immediately.
 
Yes, I know it's badware, I'm trying to figure out how to make it available 'cleanly', and then use the 20 lines of code below on it.
 
@rightfold delete this message
 
...and refresh the gist first
:D
I got rightfolded at realizing that the inner name is useless
 
6:16 PM
... Oh.
You moved the definition of wordlist to the outside
Derp. Why didn't I think of that...
 
Xeo
how long have you been awake at this point?
 
user1804599
let x = y in z is equivalent to (fun x -> z) y, which is how you would do it in C++ if you want to define a variable inside an expression.
 
@Xeo Uh. ... Very long.
 
Because you're not accustomed to this style of programming.
And things aren't obvious to you.
So you need guidance.
 
Xeo
@ThePhD sleep
 
6:17 PM
Robot hardly needs guidance when he tears through languages. :<
 
user1804599
                ___.
     ____   ____\_ |__
    / ___\_/ __ \| __ \
   / /_/  >  ___/| \_\ \
   \___  / \___  >___  /
  /_____/      \/    \/

==========================
 Functional Specification
==========================
 
user1804599
Rad document header.
 
user1804599
I like how it all lines up nicely.
 
I have 4 free audiobooks on Audible. Dunno what to get.
 
@ThePhD yeah but you're not robot :P
 
6:20 PM
@R.MartinhoFernandes Why not some Little Prince?
Can't have too many of those.
 
Xeo
@milleniumbug damn, couldn't screenshot that fast enough
 
@EtiennedeMartel I don't want that an audiobooks.
 
@Mysticial There's typically some degree of predictability, and there are techniques to take more advantage of it than a simple BTB will. e.g., meseec.ce.rit.edu/eecc722-fall2006/papers/branch-prediction/4/…. If memory serves, Intel did recently do some work on this (first time this part of things has been changed in a long time).
 
Fuck mobile chat
 
Sigh. Makefiles being distributed.
Using rm -f directly.
 
6:22 PM
@Xeo gee, and I was on mobile too
 
Xeo
@caps finished it now, good stuff
Ooh, and next batch of uploads just went up
 
@R.MartinhoFernandes I did see a popup book of The Little Prince recently and thought of you. The only part of this that's interesting is that it was at a brick and mortar Amazon book store (first I'd ever seen). When Amazon was new, they talked a lot about the "long tail" effect. With their brick and mortar store, they apparently went completely the opposite direction, with barely anything beyond the very most popular books.
 
user1804599
@ThePhD Use ocamlbuild, not Makefiles.
 
I guess it's a natural response to being part of the company they are, but at least initially I found it a bit surprising anyway.
@ThePhD The difficulty of learning a new language is (approximately) inversely proportional to the number of types of languages you already know.
 
user1804599
Ugh, children's ombudsman worries about Zwarte Piet, instead of actual problems like unnecessary circumcision, child marriage, and other forms of child abuse permitted by the state.
 
6:33 PM
@JerryCoffin Ah. Last time I heard, Intel only did a single entry history. So if you alternated between two addresses, you were still fucked.
Not that I've tried to benchmark it though. I generally don't do indirect branches where it matters.
 
@Mysticial 11/10
 
@Mysticial Yeah--I was once deeply disappointed. Had a class that did text searching, with separate implementations for case sensitive and case insensitive comparison, which was called indirectly. Highly predictable, but the Pentium (apparently) did no prediction at all for indirect branches, so even though it made the code look ugly, using an if instead of an indirect branch made it run ~8x faster.
 
-5
Q: What language is compatible with C++ but have better and more elegant syntax?

Artur WójcikI want to programming in more intersting language than C++, but using it's librarys: Qt, UE4 (engine), SFML and all others. Is D good choose? I thing that it is not becouse it is not as interesting and C++ is more modern now than when D was created. Maybe Haxe?

 
@milleniumbug That didn't last long...
 
user1804599
Whats wrong with C++ syntax? In the last few years it has become so much more streamlined. auto has been a godsend. — NathanOliver 2 mins ago
 
user1804599
6:47 PM
lol
 
Xeo
Meanwhile, templates continue to be fucking awkward
 
user1804599
More like badlates.
 
6:58 PM
@JerryCoffin Sounds like the it should've been the compiler making that decision for your. But we know pretty well that compilers are often shit.
 
7:09 PM
Hello everybody, as discussed earlier today here, I went ahead and edited the The Definitive C++ Book Guide and List to now include the “C++ Super FAQ”, the “C++ Core Guidelines” and cppreference.com under the “Reference Style - All Levels” section. Please let me hear your complaints.
 
Ok. My back hurts. There's a buzz in my left ear. I'm having trouble hearing people talk. I'm chronically bored.
I think that's it for now
 
user1804599
Write Rust.
 
@ThePhD more like I stay mostly silent through the initial phases of learning.
 
user1804599
Are you secretly learning ATS yet?
 
7:54 PM
@rightfold If this was my code, yeah I'd be using ocamlbuild qq
 
Ven
@5gon12eder C++ sucks
That's my complaint.
@milleniumbug idiots
Not that the question is good. But "HOW DARE YOU C++ DID ANYTHING WRONG" is retarded
 
I'm writing my first OCaml Parser
 
@Ven Well, there's also another popular C++ FAQ out there that takes that point of view but I don't agree…
 
Ven
@5gon12eder you mean the FQA? It's vastly outdated.
@ThePhD gl (:3)
My catfaces are happy cuddly ones only
 
are there transcriptions of CppCon videos?
 
8:06 PM
@Xeo Yeah, I agree. Pretty good on a lot of levels.
 
Xeo
@milleniumbug Wouldn't bet on it
 
@Ven yes and yes
 
@5gon12eder I <3 cppreference.com
 
Ven
@5gon12eder i really dislike C++ because it's been my dayjob for around a year now
 
Xeo
It's been my day job for 3.5 years
and I still like it
 
8:11 PM
it’s denial
 
what, infested with crocodiles?
 
Xeo
says the guy that spends 24/6 on his C++ library
(the other day is GW2)
 
I've been working in C++ professionally since 2012 and I still like it to an irrational level.
 
@JerryCoffin The close reason 'Primarily opinion based' is sometimes code for 'Weaponized stupid'.
 
@caps I second that :D
 
8:17 PM
@Xeo Wasn't your dayjob actionscript for a large chunk of that?
 
Xeo
@ThePhD Half a year of pure AS3. After that, AS3 frontend + C++ backend
 
@Xeo ActionScript?
 
Xeo
yes
 
ADG
hello people... int the first instruction fetch stage is PC=-4 or PC=0?
 
Nope, ASexual.
 
8:19 PM
the first instruction is bugger off
 
ADG
does it invlove some kind of logic to check if it is the first instruction to use PC=4 and later on change PC+=4 / PC=branchTarget
anyways Pc will be trigerred by negative clock edge...
 
I fell in love with c++ when the Watcom "optimizing compiler" came out.
Nowadays she's more like an abusive spouse.
Take en.cppreference.com/w/cpp/types/conjunction for instance, this is not one language anymore.
 
I had to reimplement this one in a project while waiting for C++17.
Meanwhile C is more and more trying to be C++ light.
 
user1804599
Use Rust.
 
std::conjunction and friends are awesome. Just not something you need every day. But when you do, they are very cool.
 
Xeo
8:35 PM
std::all_of at the template level
 
user1804599
Facebook suggests I like Willem Holleder, the biggest Dutch criminal alive, lol.
 
@rightfold lol, do you? :)
 
user1804599
No.
 
user1804599
I need a new project.
 
@rightfold Finish one of your unfinished ones.
 
user1804599
8:38 PM
No, they're boring.
 
Write a project idea generator.
 
@rightfold If I get the chance to abandon my teammates, will you be my new group project partner and let us use Haskell to make a compiler for an imperative GPU language?
2
 
lol
 
@5gon12eder I have implemented all kinds of precomputations but never needed either of the junctions stuff.
 
user1804599
@ThePhD Yes, fun!
 
8:39 PM
OCaml can't be that bad.
 
It's not that bad as I get used to it but it's still bad.
 
user1804599
OCaml is great.
 
@rightfold Make it your life goal to push better IO library into C++ standard library.
 
user1804599
Haha.
 
Haskell won't be much different I guess.
 
user1804599
8:40 PM
I still have that code somewhere I think.
 
lol bitbucket
 
user1804599
Yeah, Bitbucket sucks balls.
 
user1804599
But I don't particularly care about this project, since I no longer use C++ for anything ever.
 
user1804599
Somebody can adopt it if they want.
 
user1804599
 
user1804599
Nice.
 

« first day (2176 days earlier)      last day (2776 days later) »