« first day (855 days earlier)      last day (4315 days later) » 

04:00
If you want to compile your entire assembly AOT, then you have to ship all dependencies on .NET
So your exe could be ~10MB
user142019
I don't want .NET as a dependency lol.
Then don't use .NET
ngen.exe is the tool. builds native code ready to memmap/reloc like real native code. (plus other assembly stuff)
user142019
I mean, as a dependency for the generated executable.
user142019
Of course .NET is a dependency for the compiler itself.
user142019
04:01
(I'm writing a compiler.)
JIT != generating an executable
JIT is about emitting code in an already running process
user142019
I want to support JIT in a REPL.
ngen.exe will precompile dlls and exe
generating an executable is more complex (IMO)
I don't know how it's done
user142019
JIT is not terribly difficult.
04:02
You want to support JIT in C# of C# code? of assembly?
user142019
You generate a function in an executable buffer, cast the buffer to a function pointer and call it.
oh I see, someone mentioned JIT and threw me off (I interpreted it as Microsoft .NET JIT)
user142019
@Cicada no I want to compile Zoidlang code.
user142019
The compiler is being written in C#.
@Zoidberg Do you already have a working compiler to some kind of assembly?
user142019
04:03
I'm working on it.
user142019
I was playing with generating machine code and executing it at runtime.
Then compile down to MSIL. It'll be cake from then on.
user142019
If I use IL I can generate an executable that has no dependencies at all?
I'm working on native code generator too... I have it to the point where I have the basic blocks (branch trees etc) and stack frame and variables in IR. I'm almost ready to start register allocation (pet project)
Eh, no, but you can generate functions and get a function pointer to them
user142019
04:05
So use IL for the JIT. :P
If you want to generate an executable that has no dependencies you have to use an assembler
And feed it assembly
user142019
Eww generating text.
there are linker switches that can put the entry point directly into one of your C++ functions. you could have no dependencies
@Zoidberg What do you think GCC/MSVC does?
user142019
Clang doesn't.
04:07
Well they don't either, they have another representation, but originally, that's what happenned.
user142019
It's a data structure, not text.
That's what I said
But the overall flow is:
High level code -> compiler -> assembly -> assembler -> object code -> linker -> executable
you forgot instruction decoder -> dispatch -> execution -> retirement
user142019
What is object code? Just plain machine code?
Whatever linker takes
user142019
04:09
Oh. :P
You don't actually emit assembly since the compiler and assembler are the same tool, but that's what would happen if they were separate. As you said, they use an internal representation.
In LLVM it's IR bitcode
@Zoidberg It's machine code with "blank" entries for addresses of externals.
@Zoidberg .obj basically an executable that is not executable. eh
user142019
Ah well for version 0.0.1 I'll just emit assembly whatever.
04:10
Good start
user142019
Then I can use GCC to assemble and link that all with one command. :P
Don't do that
You don't want to depend on GCC
user142019
No I mean manually.
Use nasm and ld!
Everyone and their dog depends on GCC
user142019
04:11
Or maybe I'll start with JIT.
Meh
fasm > nasm
Just emit assembly
And get it working
Baby steps
If you're using LLVM then you should emit IR and be done with it
user142019
Assembly basically consists of instructions and labels right?
04:13
Yes. And data.
user142019
Yeah right.
Assembly basically consists of your program
Mostly. When you're lucky.
user142019
lol
@Zoidberg and patching in addresses and offsets and preparing relocations, yes (by the time it reaches the exe)
user142019
04:13
Time to think of a data structure.
1 min ago, by Cat Plus Plus
If you're using LLVM then you should emit IR and be done with it
^ yes
user142019
I'm not using LLVM.
Then start using LLVM
user142019
Piece of junk didn't link.
04:14
Get a linux rly
You're too bad at linking
user142019
@Cicada Meh Mono.
You can't expose a static library in a DLL by making an empty project and linking the static library in
Does not work that way (TM)
user142019
@CatPlusPlus no the DLL didn't even link with the static libraries.
there is a gcc option --whole-archive to make it just link every object file in the whole archive as if they were a string of .o files
user142019
04:15
I wanted to write the codegen part in C++/CLI.
@Zoidberg Linux has a working LLVM and IMO the compiler toolchains are much less blackbox than on Windows.
user142019
But the linker didn't approve.
@Zoidberg You were certainly doing something wrong
I trust the linker more than I trust you
user142019
Yes.
user142019
I was using MSVC.
04:15
@Cicada GCC is arcanebox
You can look inside but sure as hell won't know what's happening anyway
@CatPlusPlus Which says a lot about MSVC
@CatPlusPlus I wouldn't dare
@Zoidberg you realize you might need to repeat libraries right? in the link?
user142019
@doug65536 Wat.
MSVC doesn't do that
user142019
Why is Microsoft's linker so dumb.
04:17
@ScottW a very teensy thing
user142019
Anyway, I added ALL libraries to it.
@Zoidberg It's not dumb
It's about symbol dependencies
gcc links left to right. meaning, if it hits something that it needs and that thing is something it already went past, it won't link it. it needs to need it first, then for each object file, grab only what I need.
user142019
And when I included any header from LLVM I got linker errors.
04:17
In GCC you need to use linker options to make it figure it out by itself
user142019
I want it to link everything even things that are not used.
user142019
Everything must always be included.
It's ~slower~ but it doesn't really matter nowadays
"external not resolved"? or what
for example, a real circular dependency can be broken by repeating the libraries enough times
user142019
04:18
@Cicada Yes.
Meh. Can you send the files?
By the way did you compile LLVM yourself?
any unnecessary extra libraries will only slow down the link a tiny bit
user142019
@CatPlusPlus No. I let the compiler do it for me.
user142019
@doug65536 I'd rather have it link at all.
04:19
@doug65536 Yeah it doesn't make any difference whatsoever, especially for large C++ projects
"Reduced build times from 4h27 to 4h25!!!!"
Anyway some sleep would be good
I was gonna say the same but it's too late anyway
And I'm stuck watching gachimuchi videos
ogodwhy
@Zoidberg try -Wl,--whole-archive before all the problem libraries to force to pull in the entire archives. as a test
WIDEN(TIME); hehe
user142019
04:23
@doug65536 do I have to build LLVM again. T____________T
no, change your problem link command line
the one that won't link
@doug65536 That doesn't look like an MSVC flag to me
user142019
Which linker?
user142019
MSVC's or ld?
are you using msvc?
user142019
04:24
Yes. :(
sorry talking about gcc lol
@Zoidberg DUDE SEND ME YOUR FUCKING PROJECT
Hooo bossy
user142019
@Cicada okay okay wait. :P
It has been proven that 100% of people who don't know how to link die.
4
04:26
normally microsoft linker just works
is there a reason why we can't use inherited variables in a constructor initializer list?
What do you mean?
Let the base constructor do it?
You can call the base constructor manually.
the base is an interface
04:32
i.e. B(string s, int c): A(s), m_c(c) {}
^ This
There is no such thing as an interface in C++
a class with only pure virtual methods, happy?
@user1233963 post a snippet on ideone or pastebin
user142019
Interfaces have no variables.
mine do
04:33
Isn't that called an abstract class?
user142019
@user1233963 Then it's not an interface.
user142019
It's an abstract class.
@user1233963 An interface with variables is by definition not an interface.
user142019
inb4 user gets angry and plonked.
04:34
this wasn't the point anyway
Still not clear what you want to do.
try qualifying it. no idea what you're actually doing though.
@user1233963 Please kindly provide some example code so that we can help you better. It's not clear what your question is.
user142019
Write bad code.
@Rapptz I think he wants to initialize base member variables in a derived constructor
04:35
He can do what I said then
But his constructor is pure virtual :P
You can't have virtual constructors
constructors can't be virtual lol
i just don't want to add another constructor
3 mins ago, by user1233963
a class with only pure virtual methods, happy?
04:37
I think I already mentioned that I hate your C# brace-style. I remember you telling me to fuck off, but still. Your style is horrible.
user142019
lol
Now let's get that linking.
user142019
@Cicada I disagree.
user142019
Egyptian braces are beautiful.
@user1233963 You can manually do it in the constructor body.
04:39
ye i know
so..
i asked why we couldn't do it in the initializer list
In C++11 can you do something lke:
class A { private: int i; public A(int i) = default; }; ?
@Zoidberg I have nothing against them. But they go against C# style. Anyway.
@Zoidberg You need to get laid.
user142019
04:40
@Borgleader syntax errors everywhere.
user142019
@EtiennedeMartel I agree
@user1233963 because if the base class' member is const or a reference it has to know it upon construction and if you let a derived class change that it will bug out.
user142019
Also you cannot default a ctor that takes an int as argument which has no default value.
@Borgleader ‘A::A(int)’ cannot be defaulted
Ok that's what I wanted to know
user142019
04:42
In CoffeeScript you can do this and it will automatically assign this.i:
@Rapptz Thanks, good to know
user142019
class A:
    constructor: (@i) ->
Huh... seems like MSVC2012 doesnt even support that feature
ALRIGHT
@EtiennedeMartel Hey, quick question. Have you ever had something where if vertices are farther away from the camera, they drastically expand?
04:57
@ThePhD Nope, but may I suggest looking at your projection matrix?
@EtiennedeMartel That
That's what I'm doing, but it's generating the correct values for my inputs.
With a near plane of 1 and a far plane of 10000, it distorts grossly the minute teh model's vertices move away from the camera even by 20 units
Why can't we have objdump on windows
What's objdump do?
user142019
That would be called objdumb.
user142019
@ThePhD it shows information about object files.
user142019
05:00
Also I have objdump installed on Windows.
user142019
Through MSYS.
But will it work with Windows executables?
Er
VC++ object files*
user142019
Dunno I'll try.
@Zoidberg What kind of information?
Isnt that what *.pdb files are for?
user142019
05:02
@EtiennedeMartel A lot.
A quick Google reveals the existence of Dumpbin.
@Borgleader Yeah, but those are kinda proprietary.
@EtiennedeMartel You found ti way faster than I did. D:
@ThePhD Use VS newb :P
@__@
Z as up is terrible.
Whenever I debug my models, they end up being face down into the dirt.
When I'm looking at the Input Assembler, that is.
@Zoidberg You probably have a link order problem.
Is there something like nm on windows? D:
05:06
nm ... ?
What are all these utils @__@
user142019
@Cicada Oh. :L
user142019
@Cicada yes: MSYS.
Because you see, you have a fuckton of static libraries
Which must be provided in dependency order to the linker
And I doubt the alphabetical order is the dependency order
user142019
Oh fuck. xD
user142019
These are the dependencies:
user142019
05:09
user142019
:P
Is there an option to build LLVM as a single lib?
Or do you know on which sub-libs you depend on?
user142019
Well maybe I only need codegen.
So, what are you working on, Zoid?
user142019
A compiler.
05:14
For Zoidlang?
user142019
Yes.
Also, @EtiennedeMartel, a regular perspective projection shouldn't be making my model stretch when vertices get closer or farther away, should it?
@ThePhD Right.
Zoidlang?
I don't get it... I switched to using library functions explicitly to make sure my own calculations wouldn't be borking it up, but the thing still warps like crazy.
World, View, Projection, right?
float4 worldposition = mul(position, World);
float4 viewposition = mul(worldposition, View);
vout.position = mul(viewposition, Projection);
05:17
Maybe the problem is the matrices.
Well I get it to compile & link with other stuff than module.h btw
Maybe. Or maybe the inputs themselves...
I'm lazy to install nm/objdump
So, this song. Starts all smooth, then suddenly...
@Zoidberg inform me of this "zoidlang"
05:22
@CCInc My guess? He's never gonna finish it anyway.
However, I'm not sure finishing it is his goal.
As long as he ~learns stuff~.
perspective does cause distortion. depends on field of view and location of vertex
Also, my projection and view matrices look alright.
@ThePhD I think that's the goal.
@doug65536 Field fo View was tried at 45 and 60 degrees.
05:23
@ThePhD Maybe your world is getting fucked up along the line.
the closer the vertex is to the camera, the more magnified the vertex will be
It might jsut be the world, then.
Let's see...
I managed to get my 3D modelers to export everything with 0 native transforms, so jsut raw.
The only world I'm applying is a rotation around the Z axis (which is currently 'up' in this world).
The world matrix...
...
how close is the camera to the target in world units?
Fuckin' hell
Found teh problem.
Row-major matrix transformation is getting directed tot eh GPU instead of a column-major one
Transpose the motherfucker.
05:26
This is because I did special overloads for Matrix, but not for RMatrix<float>, which is the underlying type and the return type for multiplications of Matrices
@ThePhD opengl or dx?
So this:
shader->Parameters[ "World" ] = meshpart->World * World;
And this is why you should stick to DirectXMath for D3D, and glm for OGL.
Is bypassing all my hard work on the overloads.
No, it wasn't that
The multiplication is correct.
It's just calling the wrong function, and not transposing as a result of calling the wrong matrix function.
@EtiennedeMartel The same problem would happen if I was using glm and stuck a #pragma pack_matrix( row_major ) <-- the wrong function is being used to set matrices in general. glm or DirectXMath (XM*, which is what I was using to generate the matrices while doing my sanity checks) wouldn't have stopped me from not sending the right shit to the GPU. =[
Anyhoot, enough crying. YOU WILL WORK, ENGINE! AND YOU WILL LIKE IT.
Yes, but that doesn't matter. What matters is that I'm always right, even when I'm saying nonsense.
05:32
Mmm.
Can't argue with that logic. :O
Explicit template instantiations for template functions in a class must go outside the class, right?
I can't header-declare an explicit instantiation? It must go outside the class and be defined at teh same time?
@ThePhD I have absolutely no idea.
explicit instantiation is like real definitions, so it would go in cpp. but you would declare it in h. I think
Hey @Zoidberg
I try to declare it and it flips out on me.
I found the equivalent of objdump for windows
05:36
Though maybe I'm just declaring shit wrong.
@Cicada dumpbin?
Yes
In the VS tools
I just dumped all exports
it can modify stuff too I think, like forcing to enable large_address_aware. IIRC
And llvm::SmallVectorBase::grow_pod is indeed nowhere to be found
yeah, the old for /F "delims=" %a in ('dir *.lib/s/a/b') do dumpbin /whatever %a trick
05:38
@Zoidberg So yeah, no wonder VS can't find it: it doesn't exist
@doug65536 Actually I just > exports dumpbin /EXPORTS *.a
my thing walks an entire subtree and dumps every lib
dir is awful
use /b
I use ls thanks D:
And the fucker went to sleep
you were talking about dumpbin a second ago. what are you talking about
05:41
banana pie
... Hm.
So I can't do a partial template instantiation.
Or maybe...
... I don't fucking know, this shit is crazy.
you mean specialization or actually instantiation?
specialization
Sorry
oddly enough, the error - C2768 - complains about explicit instantiation.
can you post it? probably something simple
	template <typename T>
	void ShaderParameter::SetValue( const T& value ) {
		/* ... */
	}

	template <typename T>
	void ShaderParameter::SetValue<RMatrix4<T>> ( const RMatrix4<T>& value ) {
		/* ... */
	}
C2768 happens at the second one
05:44
second template thing should be template<>
... But RMatrix4<T> is a template itself.
oh weird...
Excuse me but
that's not partial specialization
Other than RMatrix<T> with T as float, do you use anything else? :)
05:45
Shh, I jsut fixed it.
@Cicada Uh. Maybe double, but that's a rare side-case.
I don't think you will
Hm.
Welp, all hail being explici- WAIT
no such thing as partially specialized method anyway right? only classes?
@doug65536 Yeah, I guess so?
05:46
I don't know the fucking rules. :D
@doug65536 sadly
In either case, just making a separate template function worked out in the end:
	template <typename T>
	void ShaderParameter::SetValue ( const RMatrix4<T>& value ) {
		/* ... */
	}
Oh god, the linebreaks
"partially specialized method" is called an overload lol
exactly
That actually correctly places my previous strict Matrix overload for all types of RMatrix<T>, and I don't have to be explicit.
So I get all the templatey goodness with all the properness of shaderization.
NOW to see if this actually solves the problem.
.... ....
BUAHAHAHA the model disappeared. xD
:( I made a button but it doesn't appear
useless button.
05:50
it is annoying though when some template magic you think up when learning it, won't work
@Rapptz THE CURE AGAINST ACNE
that "oh my god I hope this doesn't crash the compiler" feeling
Hello all
Hello.
user484068
Morning (yawn)
05:57
@Cicada You're up late.
Or rather early I guess.
I'm in a highly depressive state, haven't eaten since thursday, nor slept either.
So yeah.
Ah. Have you drank anything?
Way to go, girl.
Lots of water and a bottle of orange juice.
Hm.
Why are you depressed?

« first day (855 days earlier)      last day (4315 days later) »