« first day (2053 days earlier)      last day (2894 days later) » 

4:01 AM
 
@QPaysTaxes you yesterday told that (new_type) old_type_thing <----- this is expression used instead of static_cast , right?
:-(
no it doesn't
static_cast<int>(double x) something like this
yes
is it wrong?
 
double x is not a valid expression
 
oh
i remember i saw this somewhere on internet (maybe my eyes error)
:-|
but my compiler shows Undefined symbol: static_cast
 
@DeNiSkA then you are not using a C++ compiler
 
`*Error NONAME00.CPP 5:Undefined symbol 'static_cast'`
@LucDanton i know it is damn old :-(
 
4:12 AM
@JerryCoffin Apparently the FX8350 doesn't have those instruction sets (seem intel proprietary) but can process in the GB/s range according to the specs...
 
refer to the manual
 
@QPaysTaxes What specific 10 year-old compiler would this be? Every compiler I know from 10 years ago implemented static_cast.
 
`#include<iostream.h>
int main()
{
int x;
static_cast<double>(x);
}`
i used four spaces
#include<iostream.h>
int main()
{
int x;
static_cast<double>(x);
}
i think it's correct now, isn't it?
 
x isn't set to anything
 
@QPaysTaxes Globals are. Locals aren't.
 
4:19 AM
sort of, it doesn’t make it really better though
 
@QPaysTaxes Sort of. The current reasoning is that it's how it's always been, all the way back to the dawn of C.
 
the technical term is default initialized—a default initialized std::string is an empty string
 
@QPaysTaxes The original reasoning was almost certainly to maximize speed and minimize code size by eliminating executing code to initialize locals on entry to every function. Globals only get initialized once, and with most executable formats you can have the loader do the work.
 
initialization is a mix between syntax and semantics, it’s lovely
 
@QPaysTaxes Not hard to see at all. Look at 8.5/12, and it goes on for quite a while.
 
4:24 AM
@JerryCoffin plain as a day filled with fog banks ey?
 
@LucDanton May be hard to understand, but not hard to see at all.
 
What? Both are fine.
 
@QPaysTaxes ah, int x; is fine
7 mins ago, by Luc Danton
the technical term is default initialized—a default initialized std::string is an empty string
a default initialized local variable ends up with indeterminate value
that should clarify everything
sure but don’t 'wait what?' us then
it is not UB
I don’t think I do
we’ve been telling you it does work
 
@QPaysTaxes Defining them that way is fine. The problem arises if you try to read from the int without assigning some value to it.
 
One way to think about it is that somebody bothered to write a constructor for std::string() but one doesn't exist/ doesn't do anything for int.
 
4:31 AM
don’t I? int i; /* complicated code after which i ends up initialized */ is a common pattern
and it is in fact one of the raison d’etre of allowing indeterminate values (at least by C era standards)
 
Also in old fashioned c, you had to this. If I recall, all variables used had to be declared on the first line of the function, because they hated you.
 
@QPaysTaxes in more recent times std::tie has sort of perpetuated the old tradition of defining first, initializing after
 
@QPaysTaxes If you honestly have a reason to care, you can write up a tiny template to provide an initialized version of the type you care about, so you'd use something like initialized<int> x; and it would automatically be value-initialized.
 
@QPaysTaxes look, we’re aware of the pitfalls that variables with indeterminate values introduce. But presenting int x; as plain incorrect, rather than risky or dubious or questionable, is not helpful to a beginner.
 
4:49 AM
@Mikhail Not really the first line, but all local definitions had to precede everything that wasn't a definition (oh, and it was per-block, not per-function).
 
@JerryCoffin -fpedantic
 
- in maths means minus, but in programming, it means plus
 
@QPaysTaxes oh okay. you seemed upset and I didn’t want you to think that we were picking on you
 
-pedantic means being pedantic
 
pointless syntax bikeshed of the day: Ranges{...Rngs} foo<Rngs...> make_foo(); or Ranges{... Rngs} foo<Rngs...> make_foo();
@QPaysTaxes yeah, that’s the tricky part. feature X can result in an incorrect program, but feature X can also result in correct programs.
int x = INT_MAX; ++x; is also invalid, yet you won’t conclude that int x = INT_MAX; doesn’t work would you?
@QPaysTaxes I don’t believe I said anything of the sort
@QPaysTaxes good communication is a two-way street
in any case, what we pointed out is incorrect is the whole program, not the default init line
 
4:58 AM
Fuck the chat is being dominated by some bullshit meta-discussion.
 
Is spaces vs tabs really a thing for some people?
In reference to the latest silicon valley episode
- lead character freaks out on devs who use spaces over tabs - his argument is tabs are better for data compression.
ah
@QPaysTaxes that makes sense, standards adherence, though I've heard arguments that 'no one uses standards, so just do what everyone else does in our environment, X is our standard.'
I'm not saying its a good argument, just that I've heard it.
That makes sense.
 
Tabs also have the advantage of letting devs configure how they want to view the code since a lot of text editor let the tab width be user specified
Want tab width 4, 2, 3, etc... fine just configure your editor
@QPaysTaxes If it wasn't clear, I'm only referring to the leading spacing.
 
@JamesAdkison That makes sense
 
morning
 
Ah, yes.
I guess it doesn't matter since coding styles I've used don't bother with that kind of indentation.
And even when I see it done randomly it still worked with mostly tabs followed by some spaces.
Yeah, I got that vibe.
I don't want to mix and match. :)
I've just seen it done randomly in a baseline that used tabs.
That's awful and ridiculous.
 
5:16 AM
tabs don't work if you've a mixture
let's say the first line is indented with a tab, the second with 4 spaces, your editor is configured with tab=4
if you give it to the prof whose editor is configured tab=2, the two lines would seem not aligned
 
That's because you should use tabs for indentation and spaces for alignment
 
Oh yeah! The more people that get involved in this the more fun the outcome will be!
:)
 
What's "this"?
 
@Shoe Just the general discussion about tabs and spaces in code.
 
There's no discussion. You use one for one thing and the other in other cases. This "problem" was solved years ago
 
5:21 AM
I'm just waiting for someone to come along and say something very opinionated that others don't agree with and watch them dig in to their position.
 
Most of the regulars here had this discussion one too many times and are probably not going to engage in another one
Look in the transcript if you want
 
I'm not saying you're wrong just that it would be funny for someone to say. "NEVER USE SPACES IDIOTS!".
 
it happened and it was not funny
 
@Shoe I guess that's a valid point. I'm not usually in the forum.
 
With the transcript you'll have plenty of hours to dedicate to this discussion if you really want to dig there :)
In the end it's a matter of preference, but tabs are better
 
5:25 AM
Transcript?
That's something other than my scroll history?
Oh I see the link at the top...
 
:)
"tabs vs spaces is a banned topic" -- Thanks, I got a good laugh out of that.
@QPaysTaxes That can't be the only reason ... right?
I'll just assume that answer was given for succinctness. I'd hate to think companies out there would really do that. On the other hand, it may be helpful for avoiding the right companies.
Or trolling ...
 
@JamesAdkison true
@JamesAdkison btw, really like your while(!(succeed = try() ) ); avatar... That should be a t-shirt or something
 
@NonCreature0714 It is a t-shirt and I have one.
 
@JamesAdkison buying one right now
 
5:33 AM
@NonCreature0714 It's good to know it can be read ... I wasn't sure if the font was big enough.
 
lol I clicked on it because it looked like code and it piqued my curiosity.
 
@QPaysTaxes Ha! I'm pretty sure it's more about having it somewhat readable to a larger audience.
 
@QPaysTaxes it's about readability, while(!(succeed = try() ) ); ..reads as "while not succeed, try"
 
@NonCreature0714 I think I got mine from Think Geek.
 
5:52 AM
why are you writing while(false) ?
 
@QPaysTaxes Yes. It's called dead code elimination. Compilers have done it for years (though over time they've gotten smarter about detecting what code is actually dead).
 
@JamesAdkison Thanks!
 
6:23 AM
Do you guys want to listen to fake chanting
 
@QPaysTaxes while (!succeed) try(); ..how does function try change the flag succeed then?
 
man I should make more pieces
Yo I'll take a request for a piano composition what kind do you guys want it to be?
 
@VermillionAzure something with a nine-eight time signature
 
@Mikhail Why is it special, again?
I still don't understand the significance of how the second number affects the interpretation of the piece
So a 9/8 piece as a waltz let me see
Surprised it's not an etude
So you want it fluttery and happy-like?
Aw I like sad music
I'll do it anyways
 
@QPaysTaxes that's bad practice, and doesn't work if you invoke a function in a different scope
 
6:31 AM
@QPaysTaxes I'll do it more of in a nocturne style though
Alrighty I'll do it after work
@QPaysTaxes As in Chopin's nocturnes
@QPaysTaxes Here's an example of a nocturne I wrote: youtube.com/watch?v=xqsBtlwWirU
@QPaysTaxes Well, I'll make it happy somehow
Maybe one day I'll have the time and expertise to make Haven
It's a very old video game idea I came up with in high school
I have the general story and characters already written out
 
Ven
Hi
 
Turn-based strategy RPG like Fire Emblem set in VR around a mysterious AI found in the depths of a security company that's hiding something big
Well, the idea is that you play as a guy who is just hired by the Haven Corporation or something like that
The company gets majorly hacked and they steal this AI program and now you're part of the team to help track down the hackers
Well, I'm pretty sure that it's been done
 
I like the idea, but I suggest making it action-RPG rather than turn-based-RPG
 
I always envisioned it as a turn-based game or RTS
The deal is that you're summoning programs and viruses and manuvering them around the battle field
The deal about the setting is that computing has become a lot more powerful and dangerous because people can use their brains as interfaces and accelerators to computing
bingo
guesss whaaaat
No idea what that means
 
..the problem is that if you don't get it right people would be like nice story but the battle system is frustrating
 
6:42 AM
@QPaysTaxes Yeah, kind of I suppose
@Khaled.K I've thought about how it might be done
 
@VermillionAzure action-RPG is way easier than RPG battle system.. because you don't need a battle system at all
 
@Khaled.K It's a lot harder to program IMO and much more messy
No, it's RTS like Fire Emblem
The way it would work is that each unit has its own speed value or something and every piece gets a turn
So a fast unit might get 3 moves in the time of a regular unit would get 1
 
in game engines, you have triggers to use when the player is hurt, enemy is hurt, ..etc, you just do health--
 
I like tile-based strategy because it's easier to program and it's easier to design gameplay for that
 
@VermillionAzure because turn-based games are restricted, you have to make sure your whole system of formulas and numbers doesn't create loops or dead-ends somewhere.. that's one of the concerns
 
user1804599
7:19 AM
> Many politicians say that if Britain decides to leave next month, Dutch Europhobe activists could force referendums each time the bloc agrees new treaties or imposes changes on the country’s laws.
 
user1804599
That would be super rad.
 
user1804599
There should be such a referendum in every member state every N years, where N is small.
 
nwp
@QPaysTaxes if your design is broken enough yes
there is enable_shared_from_this, but I'm highly suspicious that if you consider that you are doing something bad
 
user1804599
@QPaysTaxes no
 
user1804599
unique_ptr should only be constructed by make_unique or from values returned by C APIs
 
user1804599
7:28 AM
I still have no idea what you are doing.
 
user1804599
:/
 
nwp
@QPaysTaxes you mean you are writing a compiler or interpreter?
@QPaysTaxes so what you do is write a program that converts your language to llvm IR and get code as optimized as C++ (llvm supports interpreters too)
I would not write a full interpreter by hand
 
Xeo
Whee, I'm awake. And on vacation. Time to be a useless piece of shit until tonight. \o/
7
 
nwp
a simple language that llvm cannot support doesn't seem likely
anyways, what does the interpreter need to do with these structs?
 
7:52 AM
LLVM is really an optimization engine, however weird that might sound.
You generate LLVM IR and it optimizes it.
 
user1804599
@QPaysTaxes LLVM is a library for optimizing code and turning it into machine code.
 
"transpile"
You compile it into IR.
 
user1804599
If you are implementing a high-level language you are probably better off just using V8 or Lua instead, unless you want to support parallelism.
 
"Transpile" is a word describing a whole lot more than just compilation, but this really is compilation.
 
user1804599
Because implementing a GC is difficult and stupid.
 
user1804599
7:56 AM
And without a GC you need to do what Rust does which is difficult.
 
user1804599
@QPaysTaxes The language design is irrelevant to the target language of the implementation.
 
user1804599
@QPaysTaxes yes
 
user1804599
You don't want to implement a GC.
 
user1804599
Implementing a GC is too difficult.
 
user1804599
No, you generate Lua code and run it.
 
user1804599
7:57 AM
Or you generate JS code and run it.
 
user1804599
I think V8 is in general more performant than Lua.
 
user1804599
No, that doesn't work.
 
user1804599
Because not all objects that are accessible are on the stack.
 
user1804599
Having only a stack isn't sufficient.
 

« first day (2053 days earlier)      last day (2894 days later) »