« first day (589 days earlier)      last day (4358 days later) » 

2:01 PM
JIT is more complicated, you have to scan which code paths happen more often and optimize based on that, decide whether something is worth compiling or simply interpet it as it comes in. I have written sort of a classic scripting language, threaded by design, to sit on top of my engine. Still haven't worked out all the quirks, but it's definitely fun.
Still doesn't have a name, it derives from the engine's name... Insomnia Language, Inoslang.
Insolang*
Much better than actually writing native code for game logic
 
How does calling C++ functions from scripting language (like Lua) work?
Do you have to write code to export them so the scripting language sees it?
 
VM sees a foreign function call and acts on it, duh.
Yes, you have to register callable functions with the VM.
 
@StackedCrooked I don't fuck compilers.
 
@RadekdaknokSlupik Compiled ahead of time with LLVM? Hope you don't mind having to suck on someone else's linker.
 
Mono can go around that with P/Invoke magic, AFAIR, but it usually goes like this:
 
2:05 PM
@RadekdaknokSlupik Relax. I'm not judging your or anything.
 
function with signature required by vm { }
vm.register("name", that function)
now you can call it from the other language
 
register is reserved word
 
Pseudocode.
 
You really have to nitpick on Cat++'s will to assist? :P
 
2:07 PM
In case you didn't notice by the first line.
 
I once had a really sweet VM for a statically typed but interpreted language
 
I know, that just popped into my head as I read it about 10 seconds before you posted your code
 
where you didn't have to write any glue code at all to expose a function
you could just be like, vm.expose("malloc", malloc) and it would be fine
plus it ran ridiculously fast because I'm skilled like that
 
DeadMG is the best programmer in the world, even though he has a problem with templates.
3
 
2:09 PM
You mean universe?
 
had a problem with templates though
obviously can't expose std::vector<T> for all T.
so I added a little thing on the expose, so you cold be like expose<T>().expose_vector()
then I ran into things like std::map where there's no way you could do that, so I started writing a system to instantiate templates written in that language at run-time
at which point I realized it was silly and I was just making C++ but better; which is how Wide was born
 
A tale of old.
 
a tale of how damn smart I am :P
damn, I hate how you can't delete things after a Planck time has passed
 
> A keyword shall be used as an identifier.
Stupid typos I make.
 
DeadMG can measure intervals less than a Planck time, capturing both momentum and position at the same time with relentless precision.
 
2:21 PM
The less keywords the better.
 
That's true.
Though I currently have 21 keywords. :P
 
When DeadMG writes a scripting language, C++ asks permission to be exposed to its libraries.
 
@RadekdaknokSlupik Only 21?
 
@DeadMG yup.
bool byte cast catch copy ctor dtor float int import move no pure resource return semi size_of throw try weak yes
 
42 is the minimum for Universal Harmony.
 
2:24 PM
lol
you have "no" as a keyword? :P
return no;
 
Yeah.
C++ has false, I have no.
 
Objective-C thing that irritated me the most, YES/NO :Đ
 
yeah, what's wrong with true/false?
 
I think that in Objective-C YES and NO are #defines to 1 and 0.
 
The meaning is the same, that's the point. :Đ
 
2:25 PM
@StackedCrooked (BOOL)1 and (BOOL)0 to be exact.
 
true/false are just all that is needed.
 
In clang 3.1 it changed to __objc_true and __objc_false IIRC, and BOOL is no longer int.
@DeadMG nothing. I just like yes/no more.
 
Wait, I'm still confused. How does the VM call registered functions?
 
@Pubby call address
 
@Pubby Which VM are we talking about?
 
2:27 PM
One written in C++
 
presumably, it keeps a function pointer or similar abstract function object, and then calls it
 
@Pubby vm have a pointer to function, or function<>, and it just call it
 
But how do you call something you don't have the type to?
 
You have a native call in your scripting language which coincides with the name of the native function. VM interprets your code and sees something that is not defined in your code.
 
@Pubby auto func_ptr = malloc; func_ptr(42);
 
2:28 PM
of course you have the type
you can't do jack shit without the type
 
And says hey, let's check if someone registered a function pointer with that name
 
@Pubby you need to have the type, and you have it.
 
@Pubby function should have known signature
 
But the scripting language is dynamic
You say foo(5, 3.0) in scripting language, how would you translate that to C++?
 
@Pubby But waah waah. Type or no cigar.
Lua uses a strange stack thing so the called function has to deal with the translation
in the Wide VM I wrote, you push 5 and 3.0 on to a stack and then the VM automatically cast pointers to them
 
2:29 PM
@Pubby and it calls function<void(vector<ValueT> args)>
 
@Abyx What?
 
... or void(vector<ValueT> args, vector<ValueT>& rets)`
 
Interpret the statement, take the name of the function which is presumably native and then the arguments which have proper types and shove that into the function pointer and call it.
 
Untyped languages are very rare.
 
Get result, incorporate back into.
 
2:30 PM
You always have a type.
 
Untyped languages are a bad, bad idea.
 
Brainfuck!
 
(some?) Assembly is untyped
 
Assembly has typed opcodes.
 
High level languages, not assembly
Assembly is a specific fruit
 
2:31 PM
HTML!
 
HTML is stringly typed
 
@Pubby it's typed, there are bytes, words, dwords, etc
 
I still don't follow, how would you store the function pointers in the VM?
 
@Pubby func_ptr_type func_ptr;?
 
@Pubby auto function_ptr = &my_function;
 
2:32 PM
But it needs to store infinite number of type signatures
 
@Pubby Type erasure?
 
With void*?
 
Handlers usually have fixed signatures.
 
no
 
Or you can generate a thunk.
 
2:33 PM
@DeadMG I think he means that the signature isn't know at compile time.
 
It is known.
 
@Pubby why infinite? think of main function, it accepts multiple arguments
 
The signature of the C++ function is known
 
At compile-time?
 
2:34 PM
How would the class keep track of the types and be able to call them?
 
On C++ side you have: a boxed value type, a handler and a VM.
 
with type erasure
 
@DeadMG Elaborate?
 
Handler is boxed_value(vector<boxed_value>).
 
@Pubby When you register a function, you create a derived class which takes arguments off your stack and then calls with it
 
2:35 PM
VM has register(string, boxed_value(vector<boxed_value>)).
There's no infinite anything.
 
@CatPlusPlus No, boxed_value is for noobs, you can do better
 
@DeadMG But doesn't that run into UB stuff?
 
I'm describing a simplest case.
 
@Pubby Not as long as you validate your instructions at run-time.
 
But if you do that, wouldn't it be the same as void*?
 
2:36 PM
Coding defensively such things don't happen.
 
There's no magic involved in the process.
 
@Pubby Nah, because they're values, not pointers. The stack is a bunch of values.
you gain a void* to the top object, cast it and de-reference it as the first arg, say, and then the one underneath, cast, de-reference, etc
 
2 mins ago, by Pubby
@DeadMG But doesn't that run into UB stuff?
 
@Pubby Not as long as you don't make a mistake.
 
It's all deterministic control, everything can result in UB if you're... As DeadMG puts it... A noob. :Đ
 
2:38 PM
it's no more illegal than char buf[sizeof(int)]; new (buf) int(); int* p = (int*)buf;
which is absolutely legal, since there's an int there in that buffer
 
alignas(int) char buf[sizeof(int)], not?
 
Yeah, but the scripting language shouldn't be able to do shenanigans
I guess I don't understand how you can typecheck it
At least not beyond the basic C types
 
let me see if I have it
 
Native functions must be elaborated upon when being "registered" with the system. There are many ways to do it, but you must provide the VM with the information it needs to determine everything is a go.
The system being the VM.
 
wow, the code is like, 30 months old AND IT'S SO BAD
 
2:41 PM
If it's not a go, just notify the scripting language user that he's doin' it wrong.
 
also missing most of the logic
 
@RadekdaknokSlupik Why? :P
 
It's just bad for DeadMG standards, still godly
 
49 secs ago, by DeadMG
wow, the code is like, 30 months old AND IT'S SO BAD
 
2:42 PM
it's 30 months old
I had only just started
 
AND IT'S SO BAD
 
give me a break, I've come a long way in 30 months
also large chunks of it, the good stuff, is missing
 
The code is a bit like radioactive material, it falls apart with time. But it still sends out waves of EM radiation of DeadMG awesome into the Universe.
DeadMG's code must fall apart so it doesn't fall into the wrong hands.
 
actually, I probably erased it because that was like, the very first version of Wide and I have no need for it anymore
 
2:44 PM
So many opportunities for world domination.
 
plus I didn't use source control back then
lol I still have the project that lets you zoom around your code
 
Anyway, I don't really need a solution. If I ever write a scripting language it will likely be very specific to the project and so it doesn't need fancy generic type-checking
 
not that I ever put it to good use
@Pubby Eh. It's simpler to not have to write any boilerplate.
 
I would rather write 10 lines of boilerplate than 10,000 to remove it.
 
uh, if your instruction generator is correct, then it's actually practically nothing to remove it
 
2:47 PM
But those 10 lines of boilerplate are not a one time toll. They're a lifelong commitment.
 
not to mention that it ends up being a lot more than 10 lines, I assure you
the whole reason I implemented that system is because Lua takes the 10 lines approach, and not only is it a shitload more than 10 lines, it's repetitive as all hell
plus, variadic templates go a long way there
 
you always can add a layer which will wrap that boilerplate into generic template magic
 
To boldly go where no man has gone before.
 
@DomagojPandža Ironic you should say that, I was watching Have I Got News for You with William Shatner just now
 
I just fucking love Star Trek. Best decision I ever made, stay at home and watch Star Trek that faithful night when I was 7.
Probably wouldn't be here if I hadn't.
Never going to get over the fact I was born 500 years too early. :(
 
2:56 PM
Few things are more boring than waiting for the floor to dry.
 
One of them is waiting for code to compile. Although sometimes I provide moral support to the compiler to do the right thing.
 
I recall that building Scimitar for PS3 at Ubi Montreal took about 30 minutes. And during that time, the whole PC lagged like hell because XP manages IO like a drunkard.
 
Only 30 minutes?
 
it was kinda similar to that
 
3:00 PM
@CatPlusPlus Yeah, but 30 unproductive minutes.
 
I'd slack off anyway.
 
One of the best excuses for a game developer is "searching for inspiration in <amazing_title>"
 
lol
 
One of my inspiration quests was Mass Effect 2.
It took me 72 hours to finally gain the mighty inspiration. :Đ
 
3:08 PM
Lenses are cool.
 
Light lenses or Haskell lenses?
 
Speaking of inspiration. :Đ
 
Haskell lenses.
Well, functional lenses.
 
@DomagojPandža Is that another screen? For a moment I thought you were outside and that castle was real.
 
Just some fun with Skyrim :Đ
Left is Skyrim, middle is SO, right is VS :Đ
I just noticed I'm still running GTA IV from yesterday in the background xdd
 
3:13 PM
So today it's frictionless horses.
 
Magical horses.
 
0
A: Why am I still wasting time writing C++ code which is one-line in Java or C#?

DeadMGWhy doesn't Java still have lambdas? Or useful generics? Or non-shitty deterministic destruction support? Or operator overloads? Or value types? Or references to things on the stack? Why do you have to put everything in a class? That is backward. Sorry, but "lack of split function in C++ Standar...

you guys like my analogy?
 
A typical DeadMG answer.
Me gusta.
 
> There have been at least two C++ standards, 0x and 11- why hasn't this been sorted?
Lol.
 
I know, right
 
3:16 PM
May be worth to write that today's boost is tomorrow's standard library?
And that you can use boost::lexical_cast?
 
> To me this sounds like you're running into issues with an environment and a language that you're not overly familiar with and you seem to be blaming the language and the environment for not being exactly the same as a language that you're already familiar with.
 
Never mind, irrelevant.
 
That comment sums up what I think of this.
 
I'm sorry, I'm stuck at that "sorting out standards" thing.
What the hell.
Oh, he said sorted.
He couldn't mean sorted sorted, right?
 
Why am I still wasting time flying supersonic jets when I could be flying a wooden flying raft?
 
3:19 PM
@DeadMG std::stringstream strstr; strstr << s; can be std::istringstream strstr(s);. One line shorter! :P
 
That makes no sense.
Why am I ever reading this.
 
@RadekdaknokSlupik mehcakes
 
It's your fault, @DeadMG.
 
@CatPlusPlus std::sort(standards.begin(), standards.end()); obviously.
 
I didn't tell you to read the question :P
I just said to read my awesome analogy about the battleships
 
3:20 PM
Okay, now I get it.
 
I loved the battleships analogy. So much cake.
Moist.
 
Why are you on Programmers, anyway?
 
also, amazing nobody has downvoted me for calling Java's deterministic destruction support "shitty"
@CatPlusPlus On occassion, you get to bash Java like this.
like that time where I got to write all about how Java is really fucking slow
 
C++0X-2 might include XML parsing features? o_O
 
3:21 PM
0
Q: Turning off static type checking in c++ for a particular method call

Fred FinkleI'm using class templates. I have a method that checks to see if it's argument type is a fundamental type (like "int") or an instance of an object (using typeid). If it is an object I want to call a method on that instance. My problem is that the compiler complains because when the type variable ...

Lol.
 
Or C++1x/C++2x?
It would only count if it had a complete XSLT 2.0 implementation.
 
@Pubby Oh yeaaaaaaah. I can't wait!
 
It would be great if C++ switched to an XML based syntax
 
@CatPlusPlus Sure you can, but you can rape a unicorn with your fist for the same amount of fun.
 
3:24 PM
@Pubby flagged
 
@Pubby By "great" you mean "A whole bunch of C++ers would go on axe murdering sprees"?
 
@Pubby I'll pretend I didn't see this.
 
@Pubby Yeah, that way we could get all the Enterprise Java programmers to jump boats and come write shitty code in C++!
 
In C++2x main will be namespace main { struct main { static int main(int argc, char** argv) { } } }.
 
0
Q: What things (or in what cases) can make C++ slower than C ?

user1002288This is an interview question, the interview has been done. What things can make C++ slower than C ? The interviewer asked it very deep and always asked "anything else ? " whenever I said something. My ideas: C++ features not available in C may have some cost. For example, if we use ass...

I need a flamethrower.
 
3:26 PM
People actually discuss this in interviews?
 
<c++>
<function name="main" return-type="int">
  <statement>
    <binary-operation operator="&lt;&lt;">
      <left>
        <object name="cout" namespace="std" />
      </left>
      <right>
        <string string="Hello, world!" />
      </right>
    </binary-operation>
  </statement>
</function>
</c++>
@Pubby like that?^
 
Yes, that is much much better
 
That's uglier than PHP.
 
Although you're missing the namespace main and class main.
 
Job interviews are designed to be fucking stupid.
That's my opinion.
 
3:27 PM
Do you have a job right now?
 
@Pubby just write a tool that spits out the AST as an XML file.
 
@RadekdaknokSlupik clang (had?) has such a thing
 
Yes. Well, not right now, because of the uni stuff, but I'm going back in a month.
 
@DeadMG had, but it wasn't good and missed many things, so they removed it.
 
Thankfully no stupid interviews.
 
3:28 PM
It also had comments in the AST, but they removed it.
Imagine how fucking ginormous a complete AST of any normally-sized C++ TU would be in XML format.
 
You don't have to imagine, you just have to run GCC-XML on a hello world program.
1MB minimum.
 
owch
 
GCC does optimizations in the parser, so it would be even bigger using a parser that doesn't do that.
 
Include anything from Boost, 10MB.
Lenses are really cool.
 
if only I had ten of me, I could do some really good shit
 
3:31 PM
You'd all just bark yo mamma jokes at each other.
 
lol
nah, all I'd need to do is have one of me who ate something he shouldn't have done and he'd bite the others
 
I'm not sure the Earth could stand having 10 DeadMGs.
 
@CatPlusPlus My last potential employee was a recent graduate, I actually took the guy out for a drink and discussed what is required for the job, tried to gauge his current knowledge set and how he perceives software engineering in general. We discussed his resume and what he's done so far (code quality, solutions to given problems etc).
Have you had some bad experiences in the past?
 
Earth can't even stand having 1.
 
No, I'm just reading 'questions from interviews' on the Internet.
 
3:35 PM
That's why it puked him out onto the surface.
@CatPlusPlus My guess is that such companies are not worth working for.
No matter what the "public acclaim" is.
I personally could never work in a studio the size of a small village, where half into the new project, you have to go meet guys you've never seen before to broker some change/addition.
Ubisoft Toronto or something is, what, ~850 people?
What.
The.
Fuck?
 
Yeah. Small companies FTW.
2
 
@DomagojPandža Ubi Montreal has almost 3000.
 
Holy crap.
 
Largest game studio in the world, IIRC.
 
That's just pure overkill.
You could make a game better than anything Ubi Montreal will ever pop out with less than 50 people. It might take 4 years, but you'll have friends, people you know, fascinated and driving towards the same goal.
My home town has ~3000 people.
In over 20 years, haven't seen half of them.
How do you work in such an environment. I mean, 3000 people.
 
3:41 PM
Small towns, OTOH, suck.
 
And even then, they buy half of their code. License the crap out of everything they can.
 
Each team is self contained, actually. They have their own hiring process, their own budget, their own goals, etc.
 
One thing I love about BioWare is how they licensed Unreal Engine 3 and after Mass Effect 1, they called it the Mass Effect 2 engine.
They changed three lighting equations in a few shader files and suddenly - it's a new engine.
 
user784668
@DomagojPandža Don't forget they renamed one of the variables from i to j.
2
 
That's some intense refactoring right there. Performance optimizations and shit.
I love how they spewed crap about writing their own custom toolset for the dynamic dialogues and some guy from the middle of nowhere in his mum's basement
wrote the entire thing in a few days in UnrealScript
 
user784668
3:46 PM
@DomagojPandža Premature optimization!
 
and released it to everyone to use with UDK
But most of all, there's the tale of "choice".
Pick your explosion color, bitches. You've got... Choice.
 
@thb Oh haï.
 
thb
@EtiennedeMartel: Thanks for inviting me here. I am interested in why one would not wish to work for the employer who asks the prospect when C is faster than C++.
 
C is faster because you have to type ++ after C in C++, everyone knows that.
 
Unless it's a trick question designed to trap C programmers, I don't see why it's relevant.
 
3:57 PM
And also cats are better than dogs.
 
@DomagojPandža hey!
 
thb
(If anyone else is following the conversation, it refers to this: [stackoverflow.com/questions/10775087/…)
 
You don't want to work for someone who thinks that myths are true.
 

« first day (589 days earlier)      last day (4358 days later) »