Simple Sorcerer
I need to specify a folder with object files so that I can just specify the .o files.
Simple Sorcerer
it would simplify the makefile a bit
Simple Sorcerer
I thought about it and realised it wouldn't simplify the makefile.
Nuur
Suka
...
What kind of compiler do I program with C++ for Windows?
...
I couldn't find a source related to about
Manav
...
msvc
No, how do I compiler program myself?
...
Manav
I'd suggest making a toy language first then making its compiler rather than trying to use C++
Manav
Go for a simpler grammar so you don't get bogged down by unnecessary details.
...
Manav
After that you can come and ask here for help regarding makimg a C++ compiler and we'll help you
Manav
My English is bad
It's not english that's the problem my friend. I understood what you meant to do the 2nd time.
...
...
Manav
Can you suggest a source?
Find a course online which creates a toy language. You'll find plenty of resources online. There are books on compiler architecture which will teach you exactly what you want to know.
Manav
the books that i know are quite old but it should still be usable:
1. https://www.amazon.co.uk/Advanced-Compiler-Design-Implementation-Muchnick/dp/1558603204
2. https://www.amazon.co.uk/Modern-Compiler-Implementation-Andrew-Appel/dp/052182060X
Manav
Maybe other members can suggest better ones
Manav
here's a light read to get you introduced to the concept, https://www.freecodecamp.org/news/the-programming-language-pipeline-91d3f449c919/ it's decent-ish _-_
Manav
found a course: https://www.edx.org/learn/computer-science/stanford-university-compilers
Manav
Uhh.. compiles to mips 🫠
Oh well
Simple Sorcerer
Oh, I don't know anything about compiler creation, but I have an idea that it must be made somehow on top of assembly language.
Simple Sorcerer
I am only superficially familiar with ELF and EXE, but I think if you know their architecture, you can already do something useful.
Antonio
guys I need help. Let me start by saying I'm new to programming. do you have any advice on where to learn, for example ieterative loops, which if I have 2 fors nested with a while I get lost following the logic.
Antonio
And where can I learn the basics skills, for example to choose the best iterative loop
Antonio
Simple Sorcerer
Stuff like that
For future reference, the simpler the code, the better it is. simple code = minimum errors.
Simple Sorcerer
Try using functions somehow. there is a while for every function
Simple Sorcerer
Stuff like that
It can also be useful to simply think about how to avoid or simplify cycles.
Manav
三体183号
I want to take the order,Do you have a boss
三体183号
My work is very boring.
三体183号
How to make money in your spare time?
Suka
三体183号
I have no creativity!
三体183号
I only know how to program
三体183号
For example?
三体183号
What do you do in your spare time?
三体183号
I'm Chinese.
Suka
and iam from indonesia
三体183号
It's really a happy and fulfilling life.
Antonio
Jose
Yeah but how do I think about simple solutions
Think about the 7+-2 rule:
The human brain at short span only can handle an average of 7 things.
If your code needs to store mentally 5 things, it's hard, but ok (don't think your coworker is Sheldon Cooper, think about a Ditto in front of a keyboard).
If your code needs to store mentally 7 things or more, your code needs to be modified as soon as possible.
Jose
Yeah but how do I think about simple solutions
A simple trick works for me is draw. Grab a pencil and start drawing boxes with simple responsabilities inside of them.
Do you need to open a file or do you need to store in RAM all your configuration file? The second one is not simpler than the first. In fact, the second one contains more than one responsability inside, for example.
(The GTA online bug root was like this, in short terms)
klimi
\Device\NUL
Mmap :3
VirtualAlloc gang
\Device\NUL
Or just use malloc
𝔖𝔞𝔯𝔬
Guys how does the compiler sees passing functions as template arguments
𝔖𝔞𝔯𝔬
I looked at stack overflow but I had some isssues in understanding this concept
𝔖𝔞𝔯𝔬
Will the compiler actualy optimize it? Or it would compile it as a simple function pointer passed in as argument
Antonio
Antonio
But I was searching for list of exercises that gradually taught me the loops
Antonio
𝔖𝔞𝔯𝔬
Jose
Manav
Manav
Manav
Look into main, how the two template functions are instantiated
Manav
Lemme generate a map file so you can see how the linker sees it.
𝔖𝔞𝔯𝔬
Manav
Manav
Mangled names on my computer
??$fun2@P6AXXZ@@YAXP6AXXZ@Z
??$fun@P6AXXZ@@YAXXZ
?my_function@@YAXXZ
Manav
The function signatures are:
void fun2<void (*)()>(void (*)());
void fun<void (*)()>();
void my_function();
Manav
You can take a look at the function signature, for fun2,
The argument passed is void (*)(), function pointer