« first day (1814 days earlier)      last day (3134 days later) » 

7:00 PM
Oh. You want to write extensions in C++.
 
but to the first question, gtfo vampire
 
<3 Man, is like stackoverflow.com no longer a thing?
 
apparently the ASK QUESTION button is too subtle
 
user406009
@elyse Nah. That's not an issue since he controls the code for both the main app and the plugins.
 
-2
Q: Undefined symbols on makefile execution

Asutosh KatyalI have to files to compile: receiver_main.c and sender_main.c. That is my makefile: COMPILERFLAGS = -g -Wall -Wextra -Wno-sign-compare SERVEROBJECTS = sender_main.o CLIENTOBJECTS = receiver_main.o all : obj sender_main receiver_main #$@: name of rule's target: server, client, talker, or ...

 
7:03 PM
What the lounge does to vampires:
 
@puppy dont know how to phrase the question because I rather need help than an answer to a single question. would be closevoted anyway
 
Spicy things are too tasty
 
yes, but I don't care about that
 
@ThePhD is that generally a bad idea?
 
your lack of ability to suck blood from other sources in no way influences me to donate.
 
7:04 PM
Thanks for the help. You contributed a lot to the programming community. — Asutosh Katyal 13 hours ago
 
Writing anything in C++ is a bad idea so yes
 
Writing code in XCode is like using your finger as a pen and shit as ink on the bathroom wall. Gawd, I don't like this.
 
XCode is terrible, yes.
 
@ElimGarak what a delicious analogy
I need an addon of some sort to get rotten tomatoes ratings when i hover over something in netflix
 
user1804599
Writing Rust code is fun.
 
7:11 PM
Scala ≫ Rust
 
The relational model is the sexiest thing of CS
I swear, I would jerk off to it if I had any libido left
 
@AnalPhabet Unrelated question, does Scale still take forever to compile?
@ʎǝɹɟɟɟǝſ TMI
 
@Borgleader It's ridiculously complicated, lemme find the link
 
user1804599
if ($status eq "1\r\n") { undef }
elsif ($status eq "0\r\n") { Flowre::Sync::BadCredentials->throw }
else { Flowre::Sync::ProtocolError->throw(error => "bad authentication response") }
 
user1804599
not sure I like this
 
7:12 PM
But IIRC Scala compiles @ about 1000 lines/s, compared to Java's 10000
 
For a second there I thought of storing every kind of data from friends contacts, to appointments and debts and such into a SQL database.
 
Mainly implicits, and even more type-deduced implicits
316
A: Java compile speed vs Scala compile speed

Martin OderskyThere are two aspects to the (lack of) speed for the Scala compiler. Greater startup overhead Scalac itself consists of a LOT of classes which have to be loaded and jit-compiled Scalac has to search the classpath for all root packages and files. Depending on the size of your classpath this ca...

 
user1804599
Don't use Scala if you're interested in low compile times.
 
user1804599
Use Go.
 
Odersky (creator of Scala)'s answer
 
7:15 PM
Don't be a bunch of lil' bitches, write C++. :P
 
user1804599
@AnalPhabet Scala 2.12 won't generate as many classes anymore.
 
@ElimGarak You can't write Minceraft mods in C++, though
@elyse That's nice
 
user1804599
It'll generate classes for lambdas at runtime, like Java 8.
 
@AnalPhabet Precisely.
Why would you want to? :P Why would you Minecraft? :P
 
Because it's fun
@elyse neato
 
user1804599
7:18 PM
I should learn INTERCAL.
 
@AnalPhabet I see, I used it a while ago (2 years ago now i think) and it was annoyingly slow to compile. Hopefully it got faster since then.
 
does rust have templates?
 
user1804599
No.
 
No templates no fun
 
user1804599
It has parametric polymorphism and macros.
 
7:19 PM
Mac and cheese
 
user1804599
E.g. if you have a function fn f<T>(x: T) { ... }, then its body better type-check right away.
 
user1804599
Not half right away and the other half on every instantiation like in C++.
 
user1804599
You also can't query what T is (like in Haskell and Java).
 
I have this feeling that I have to put everything into a database.
How do I cure it?
 
user1804599
Unlike Java, this erasure of generics is safe, since Rust lacks downcasts.
 
7:22 PM
@ʎǝɹɟɟɟǝſ Put everything into a database
 
@elyse I failed to get the trait to compile, waiting a while before spamming the next question :)
 
user1804599
ask it
 
user1804599
I'm bored anyway.
 
@ElimGarak Worthless video
 
7:24 PM
 
Ahahah, puppy is in a good mood.
 
it's nothing more than a bunch of people laughing at other people for trivial missteps
pure clickbait crap
 
user1804599
@JohanLarsson is.gd/vHaTvW
 
user1804599
* returns T::Output, not T.
 
user1804599
And this one actually works: is.gd/tBP9Nq
 
7:27 PM
hm, that is not very nice
F# wins imo
 
user1804599
You can't pass x to * twice without cloning the first one.
 
user1804599
Otherwise it'll try to move, and you can't use moved-from values in Rust.
 
what, they can't swap values?
 
Ell
c function pointer syntax is so fucky :L
 
use a type alias
 
user1804599
7:30 PM
@Puppy swap works fine.
 
user1804599
but you cannot swap a value with itself
 
@elyse How long have you been using Rust?
 
user1804599
because that'd require creating two aliases to the same value of which at least one is mutable, which is VERBOTEN
 
user1804599
@JohanLarsson a day or two maybe
 
@elyse How do you swap without assigning to the moved-from value?
 
7:31 PM
@elyse prodigy
 
user1804599
You can assign to moved-from values.
 
user1804599
But you can't use them as in reading from them or stuff like that.
 
meh bad
 
user1804599
let mut a = "1".to_string();
drop(a);
a = "2".to_string();
 
user1804599
this works fine (drop moves-from).
 
user1804599
7:32 PM
@Puppy no, it's good. it'd be unsafe otherwise.
 
nothing unsafe about it
 
user1804599
wrong
 
user1804599
reading from a file handle after it was moved-from is bad
 
user1804599
or after it has been destroyed (i.e. closed)
 
user1804599
it's always a bug to do so
 
7:33 PM
right, but that's far from guaranteed to be true for every type.
 
user1804599
so better have the type system catch it
 
there's lots of cases where reading the values afterwards would be completely safe.
 
user1804599
Those would require cleanup after move-from.
 
user1804599
Which incurs additional cost even if you don't need it.
 
not true.
 
user1804599
7:34 PM
Destructor isn't called on moved-from values in Rust.
 
that... still doesn't require that the type is unsafe to read from.
 
user1804599
So e.g. a vector on move-from doesn't have to reset its capacity to 0.
 
user1804599
Moving in Rust is just bitwise copy.
 
well, it pretty much does.
and that's stupid
 
user1804599
You're can't define custom moving mechanisms.
 
user1804599
7:36 PM
It's a very nice model.
 
can't you do unsafe { }
 
user1804599
You should try Rust for a while.
 
permitting re-assignment basically requires that the vector knows that it does not have to clean up it's previous state when you assign to it.
 
user1804599
No, it doesn't.
 
uh huh
 
user1804599
7:36 PM
look
 
so if you assign to a vector, it just doesn't clean up the previous state and leaks it?
 
user1804599
lemme explain, just wait a sec
 
user1804599
// you write this:
let mut x = Vector::new();
x = Vector::new();
// compiler generates this:
let mut x = Vector::new();
drop(x); // destroy
x = Vector::new();
 
user1804599
i.e. destruction of the original is not done by what in C++ would be the move assignment operator
 
so re-assignment means always creating a new vector and destroying it?
 
user1804599
7:38 PM
// you write this:
let mut x = Vector::new();
foo(x); // by-value i.e. move
x = Vector::new();
// compiler generates this:
let mut x = Vector::new();
foo(x);
// no need to insert call to drop here, because the value is already being destroyed inside foo (because foo took it by value)
x = Vector::new();
 
so when you're assigning to an object you can never take advantage of the current state in any way?
 
user1804599
Indeed.
 
user1804599
In fact, you can't overload the assignment operator.
 
that is even worse than I expected.
 
user1804599
When would you want it?
 
user1804599
7:39 PM
I can't imagine any use case.
 
... when I want to do new and interesting shit on assignment?
 
user1804599
When do you want that?
 
well, for example, SBO often requires that you hold pointers to internal buffers.
if you can't overload assignment, you can't change the pointer when the address changes.
no assignment/constructor overloads -> no SBO.
 
What is a nice language that has templates?
 
user1804599
You can implement SBO differently.
 
user1804599
7:40 PM
Using a pointer tag or a Boolean.
 
@JohannesSchaub-litb well, I haven't checked. But I the compiler may optimize memset out if it knows the target is not used (hence SecureZeroMemory and the likes). Since there's no member in the union, the compiler might have a field day optimizing any memset that is limited to it's memory region
 
@JohanLarsson C++
 
tagging the pointer or the boolean in this case would require branching on that pointer/boolean value on every access.
 
@Borgleader I'm afraid of c++
C+phobia
 
and also, you'd have a tagged pointer value where the pointer's pretty fucking useless really in many cases.
not to mention what happens if you're doing someshit like LARGEADDRESSAWARE for 32bit where you don't have space in the pointer.
 
user1804599
7:43 PM
@JohanLarsson D
 
user1804599
Rust doesn't do SBO it seems.
 
@elyse Is it huge and nasty?
 
user1804599
No. It's nice.
 
IIRC
D did the same shit with postblit constructors and stuff
then backpedaled at ninja speed recently because as it turns out, it's terrible.
I don't know why people have such a hardon for memcpy.
3
 
Learn Rust Puppy, then you can have endless fights with rightfold and I can have prime lurking.
 
user1804599
7:46 PM
It's a very nice model.
 
user1804599
It's impossible in Rust to have a pointer to a member of the same struct.
 
user1804599
You cannot construct such a value because the lifetimes won't match up.
 
user1804599
hmm, wait
 
Huh, No Man's Sky on the Colbert show. As one of the comments puts it, if this game fails the amount to hate he’s going to get will make Peter Molyneux and Spore look like the best things to happen to gaming.
 
@sehetw on it's way back; server just took a OOM kernel panic..give me 5mins :)
support at its finest
 
user1804599
7:49 PM
yeah, can't move from it: is.gd/dlifo4
 
user1804599
s is borrowed through s.x by s.y
 
@Puppy ask elyse
 
user1804599
The only reasonable way to do SBO is:
 
user1804599
enum String {
    Small(usize, [u8; size_of::<Vec<u8>>() - size_of::<usize>()]),
    Large(Vec<u8>),
}
 
Ell
aw darn. just realisd the difference of a in relation to be is not the same as intersection with a negative comparator :S
 
user1804599
7:56 PM
Which I think is an acceptable trade-off given all the type and memory safety that Rust provides.
 
user1804599
If you really need SBO without one more branch in one particular part of you program, use C++ for that.
 
@JohannesSchaub-litb Interestingly gcc does emit operator== to compare the actual first byte, but after inlining decides it's always true: i.imgur.com/2hsUyXf.png
 
user1804599
(Rust enums are tagged unions)
 
<sup>Test</sup>
Well, shit.
 
user1804599
@ThePhD ™
 
user1804599
7:58 PM
easy
 
>:l
 
user1804599
>:|
 
@ThePhD Sup
 
that is not a generic superscript, that's a Unicode symbol
 
user1804599
thank you captain sherlock
 
8:02 PM
actually it's Admiral Sherlock now
 
I thought you were demoted to ensign. :P
 
Captain Deadlock
 
@JohannesSchaub-litb and here's clang++ doing the inlining too but arriving at a different verdict i.imgur.com/NGr7f3B.png; flags and versions show no difference
 
nope
 
@Borgleader Professor is making me flesh out my readme, but he's going to accept my rinky dinky particle emitter python project.
 
user1804599
8:04 PM
@JohanLarsson :D
 
I thought I was going to make a full-fledged game but he seems to be fascinated that I even got as far as I did, so.
 
user1804599
 
@ThePhD That's how Ubisoft management felt when the team gave them AC: Unity.
 
@ElimGarak Pfff.
 
. @mattgodbolt No worries I found it; Here's the catch /cc #loungecpp. Awesome that this runs out of the box http://t.co/rjy21gdhyI
 
8:06 PM
My technically illiterate friend just told me he wants to buy one of those new UPS displays.
 
Godbolt gcc-explorer is really nice /cc @StackedCrooked
@ElimGarak I reserved my avatar for this occasion
 
622 bytes later I have a BF transpiler in Python
Python is very nice
 
@elyse I think I will never understand languages as I have not suffered c/c++
 
user1804599
lol
 
@elyse Today, I implemented helper methods for parsing lists and parenthesized stuff. Now many complicated loops and whatnot turned into one-liners like this:
val parameters = parenthesized { commaSeparatedList0 { parameter() } }
 
user1804599
8:15 PM
Nice.
 
user1804599
:]
 
nice
 
lyon
 
user1804599
8:21 PM
COBOL is terrible so this needs a special function in the lexer.
 
what's a picture clause?
 
user1804599
It specifies the format of the data you want to store.
 
user1804599
E.g. if you have a data item 01 invoice-id PIC XX999999. then PIC XX999999 is the picture clause and XX999999 is the picture.
 
user1804599
XX999999 means two arbitrary characters followed by six digits.
 
user1804599
But you can also write it as X(2)9(6).
 
user1804599
8:25 PM
And you can put other things there that are or aren't tokens elsewhere.
 
user1804599
And no spaces are allowed I think.
 
user1804599
So the lexer needs to know that it's lexing a picture and not a normal token.
 
I think indeed MSVC interprets that int(expr) as a C-style cast, which ends up being a reinterpret_cast<> there. Sadly the OP only clarified his real question after accepting this one, it seems. — sehe 5 secs ago
@elyse so a bad mix of bitfield and structs. Geared to effectively stringly typing/builtin wire format
 
@sehe That is syntax for a C-style cast.
 
10
Q: How did Kotlin get its name?

Craig P. MotlinHow did the Kotlin language get its name? I'm particularly interested since Kotlin is something I might type by accident while writing my name.

lol
 
8:27 PM
@LucDanton Why does only MSVC accept it then (I had this idea myself but couldn't really explain why gcc/clang refused to compile the cast)
 
Would have to look into more details.
 
user1804599
@sehe 01 date PIC 99/99/99. :D
 
@LucDanton Well the sample is delightfully minimal (except for the literal) :)
 
user1804599
@fredoverflow lol
 
user1804599
@defau1t I think you mean a good sauce of inspiration. — elyse 7 secs ago
 
8:31 PM
@elyse +1
 
> I updated the readme and added the paper I read to figure out some of the particle properties
Topkek. I never once read that paper in the slightest.
But it's academia, and if you don't say you have some kind of source, than how can anyone know that what you did was valid?!?!?!
 
@AnalPhabet Oh fuck I lost Icicle 2.
 
inb4 derive a bunch of dumb equations
@Nooble For shame.
 
@sehe Okay, then what is the result type of %?
 
user1804599
8:34 PM
@fredoverflow nice :p
 
user1804599
<:]{%>
 
@Nooble huh?
 
@AnalPhabet Icicle 2.
The one that isn't on GitHub.
 
Oh, you mean you didn't push
topkek
 
yes :(
Oh wait I may have backed it up.
Yes I did!
 
Ell
8:38 PM
@fredoverflow heh
 
RIIIP Physics Homework :(
 
hm, what would you call a find that assumes the element exists in the range, and throws otherwise?
 
index_of.
 
hope?
 
That's what python calls it.
 
8:39 PM
@ThePhD Fuck indexes.
 
user1804599
-        $$buffer = substr($self->recv_buf, 0, $length);
-        substr($self->recv_buf, 0, $length) = '';
+        $$buffer = substr($self->recv_buf, 0, $length, '');
 
user1804599
Perl is fucking amazing.
 
user1804599
substr is my favourite funciton.
 
:26092205 No, bad!
 
user1804599
Best Function Forever
 
8:40 PM
Return an iterator.
 
don't need to if I can assume it's there - but I forgot that I actually do want an index :p
 
@melak47 fetch?
which is another way of saying get I suppose :v
 
find_its_there_keep_looking_i_promise
 
@melak47 single()
 
@JohanLarsson { return Borgleader; }
 
8:41 PM
Could also go with must_find.
 
@Borgleader :)
 
@JohanLarsson huh?
 
@elyse Someday you really should study SNOBOL 4. Virtually everything good about Perl was better in SNOBOL.
 
single as opposed to zero_or_more? :p
 
@melak47 that is what linq calls it
 
8:43 PM
I guess index_of works since I want indices anyway. and it's only for use in constexpr so it won't compile if the element doesn't exist
 
user1804599
> Goodbye Chickens And Cows! Scientists Have Developed A Single Animal Capable Of Producing Milk, Eggs, Meat, And Grain
 
it throws if there are zero or >1 matches
 
user1804599
ho lee fuk
 
Also I think first is a better name than find
 
user1804599
No, it's not.
 
Ell
8:44 PM
frist1!
 
user1804599
first suggests it would always return the very first element.
 
user1804599
find suggests it finds an element.
 
@elyse first_if :D
returns the first element if condition is met, otherwise...something else
 
first(predicate) is clear imo
 
Another 391 bytes later I have an optimizing BF transpiler
Python is great
 
8:48 PM
it climbs trees
 
@AnalPhabet lol
 
@LucDanton It's an expression (lazily evaluated); unless expression templates are turned off like I showed in the updated answer
Hmm. It has a conversion to safe-bool (_Bool in the source)
So. It might be that somehow that safe-bool isn't properly guarded in MSVC.
 
@Nooble what
 
user1804599
 
@sehe See? More details.
I’m not getting into this.
 
8:52 PM
@elyse topkek
 
The fact that rational people immediately realize #pissforequality is a joke, but feminists still fall for it shows how pathetic feminism is
 
#twitterusersaregenerallyidiots
 
user1804599
#strongindependentblacklefthandedwomenwhodontneednomanpissingforequality
 
@elyse can you make immutable types in rust?
or can anyone molest them with mut?
 
Ell
ah 2 hours to finish assignment
 
8:57 PM
@elyse .... Wut.
 
Yes. But you cannot make immutable types rust
 
user1804599
@JohanLarsson You cannot make a type such that values of it must always be immutable.
 
hmm, I don't love that
 
user1804599
@JohanLarsson Why not? It doesn't matter.
 
user1804599
Mutability in Rust isn't a problem as it is in many other languages.
 
user1804599
8:59 PM
You can't have spooky-action-at-a-distance problems, because if you have a &mut, then you cannot have any other reference to that value at the same time.
 
Say I have a point, then it is nice to know that it cannot be changed if i pass it somewhere
 

« first day (1814 days earlier)      last day (3134 days later) »