These are chat archives for learnclang/general

30th
Dec 2014
Marcus Ottosson
@mottosso
Dec 30 2014 08:23

Is there a specific reason to do that? I mean to take an address and downloads a file off the internet?

Good that you ask, actually I'm struggling to find what to make for a next project, because while I'm trying to keep it doable and simple, I'd also like it to be interesting and it's a tough balance.

I think that downloading a file might require us to use at least one additional library in C and it will also get us going with how to provide input to an executable.

I also think it's good to talk about the next direction, so we're ready to move on once finished. So if you or anyone have any other ideas, let us know here. :)

Marcus Ottosson
@mottosso
Dec 30 2014 08:33

@csaez don't know if you guys are following the handmadehero project

Hi @csaez! Looks like an interesting project, haven't heard of it before. Checking it out now, and adding it to here: https://github.com/learnclang/about/wiki/Resources

@davidmartinezanim I felt that VS requires a lot of setup before you do anything

Yeah, this has been my impression too. Some tutorials online even suggest you don't touch an IDE until you've got a firm grasp of coding without one, like this one: http://c.learncodethehardway.org/book/ex0.html

@ljkart I just saw your Story about Compiling, looks good! I added it to the Workflow section, feel free to update it however you like.
Marcus Ottosson
@mottosso
Dec 30 2014 09:51

The Handmade Hero videos seem amazing! My only gripe would be that it is using the Windows API, but I'm seeing a chapter on platform-independence, but haven't gotten far enough to see whether it actually means to run on OSX/Linux at all.

I love that he's doing all rendering without libraries (OpenGL/DirectX), I haven't even considered that to be possible to be honest.

Cesar Saez
@csaez
Dec 30 2014 10:56

@mottosso The Handmade Hero videos seem amazing! My only gripe would be that it is using the Windows API, but I'm seeing a chapter on platform-independence, but haven't gotten far enough to see whether it actually means to run on OSX/Linux at all.

There is a platform independent layer that will eventually be changed to run the game on other platforms, but the main focus is Windows >= XP (there're people working on unofficial ports to the various operating systems, check the resources section on handmadehero website).

yep... compose mode :P (thanks!)

Marcus Ottosson
@mottosso
Dec 30 2014 10:57
If you hit the "Compose Mode" to the right of the text-box, you can use newlines. :)
David Martinez
@davidmartinezanim
Dec 30 2014 10:58

@mottosso What about having a simple project in which inputs a couple of vectors and calculates the angle between them? or do some operation with them? No visual representation for the time being but purely based on text. This might be a good way to force ourselves to revisit some of our math theory... (just a thought)

This should be doable with the standard library.

I've just found this... http://www.lofibucket.com/articles/oscilloscope_quake.html - Now that's quite impressive, huh?
Marcus Ottosson
@mottosso
Dec 30 2014 11:04
That is pretty sweet!
Marcus Ottosson
@mottosso
Dec 30 2014 11:12

There is a platform independent layer that will eventually be changed to run the game on other platforms, but the main focus is Windows >= XP

Ah, I get it now. Did some more research and he mentions on the main website that it's built on Windows first and then expanded upon to run on other platforms. That's perfect.

@davidmartinezanim What about having a simple project in which inputs a couple of vectors and calculates the angle between them?

We could do that, but I personally think it's a little too academic and I'd rather keep projects as practical as possible. I'd would be okay jumping directly into producing a window and drawing into it. Especially now that we have access to the handmadeheroes.org tutorials.

What do you think?

David Martinez
@davidmartinezanim
Dec 30 2014 11:17
might do. I've never drawn on a window using C but as you say, it might be an idea for a project
Marcus Ottosson
@mottosso
Dec 30 2014 11:18
Neither have I, but I sure would like to. :) I was planning on waiting until we get to OpenGL or Qt, which would both depend on first getting into C++, but that guy does it all with C standard libraries and the Windows API.
This way we can get a sense of what Qt and OpenGL actually does for us.
David Martinez
@davidmartinezanim
Dec 30 2014 11:18
true
Cesar Saez
@csaez
Dec 30 2014 11:29
I like the downloader project, it would help to workout the dependencies (libcurl?) and to manage the build system (make + makefiles?).
I think we should cover at least pointers, structs and memory allocation first, jump to draw a buffer by ourselves seems too big a step.
Marcus Ottosson
@mottosso
Dec 30 2014 11:29
Makefiles is a good point, haven't thought about that yet.
As I understand it, there are a number of different build systems out there. Do you know which is the current trend today?
I found this to be a good introduction to Make, from a Python standpoint.
http://c.learncodethehardway.org/book/ex2.html
Cesar Saez
@csaez
Dec 30 2014 11:41
I would go with Make until the complexity of our projects require something like SCons or CMake (which is not a build system but a build system generator)
Marcus Ottosson
@mottosso
Dec 30 2014 11:41
Oh gosh
So many abstractions around C - pre-processors, build system and also a build system generator.
They all essentially inject a bunch of code right?
Cesar Saez
@csaez
Dec 30 2014 11:44
AFAIK the goal of build systems is not to recompile the entire thing but just the files changed from the previous version... it's tricky.
Cesar Saez
@csaez
Dec 30 2014 11:49
Build scripts can get quite sophisticated in large projects.
I don't think we need to go crazy with this, Make seems good enough for our purposes (KISS).
Marcus Ottosson
@mottosso
Dec 30 2014 11:51
Ah, at first I thought they were primarily focused on including libraries and setting environment variables for each build

I think we should cover at least pointers, structs and memory allocation first,

Agreed. Let's try and find a practical project which requires these things next.

Can you think of anything, @csaez?
David Martinez
@davidmartinezanim
Dec 30 2014 11:57
I gotta admit that half that conversation flew above my head. I did not get much
Marcus Ottosson
@mottosso
Dec 30 2014 11:57
Good that you say that
Cesar Saez
@csaez
Dec 30 2014 11:58

@mottosso Can you think of anything, @csaez?

Not off the top of my head, but I'll think of something.

Marcus Ottosson
@mottosso
Dec 30 2014 11:58
I only know from what I've read in tutorials, maybe @csaez can give us the run-down on why we can't just build from the terminal as we're already doing?
David Martinez
@davidmartinezanim
Dec 30 2014 12:00
I created myself a Python script that given some c files in a folder, was creating a subfolder called compiled and creating executables of those files with source code. I know... I'm cheating and that only works as long as I have 1 program per file. But it did came handy as I was going through the book.
Cesar Saez
@csaez
Dec 30 2014 12:14

Just to be clear: I'm not a "C/C++ guy" by any means.

Here is wikipedia's take on build automation: http://en.wikipedia.org/wiki/Build_automation

Advanced build automation offers remote agent processing for distributed builds and/or distributed processing. The term "distributed builds" means that the actual calls to the compiler and linkers can be served out to multiple locations for improving the speed of the build. This term is often confused with "distributed processing".

Distributed processing means that each step in a process or workflow can be sent to a different machine for execution. For example, a post step to the build may require the execution of multiple test scripts on multiple machines. Distributed processing can send the different test scripts to different machines. Distributed processing is not distributed builds. Distributed processing cannot take a make, ant or maven script, break it up and send it to different machines for compiling and linking.

The distributed build process must have the machine intelligence to understand the source code dependencies in order to send the different compile and link steps to different machines. A build automation tool must be able to manage these dependencies in order to perform distributed builds. Some build tools can discover these relationships programmatically (Rational ClearMake distributed, Electric Cloud ElectricAccelerator), while others depend on user-configured dependencies (Platform LSF lsmake)

Build automation that can sort out source code dependency relationships can also be configured to run the compile and link activities in a parallelized mode. This means that the compiler and linkers can be called in multi-threaded mode using a machine that is configured with more than one core.

Not all build automation tools can perform distributed builds. Most only provide distributed processing support. In addition, most products that do support distributed builds can only handle C or C++. Build automation products that support distributed processing are often based on make and many do not support Maven or Ant.

The deployment task may require configuration of external systems, including middleware. In cloud computing environments the deployment step may even involve creation of virtual servers to deploy build artifacts into.

Marcus Ottosson
@mottosso
Dec 30 2014 12:15
I vote to stick with the terminal until it becomes a problem, then we can look for ways to solve it.
David Martinez
@davidmartinezanim
Dec 30 2014 12:15
:+1:
Cesar Saez
@csaez
Dec 30 2014 12:19
Sounds good to me :+1:
David Martinez
@davidmartinezanim
Dec 30 2014 13:38
could anyone explain to me the difference between minGW and LLVM? Are both of them compilers?
Marcus Ottosson
@mottosso
Dec 30 2014 14:17
I saw a really interesting presentation about what makes Clang different from other compilers, here: https://www.youtube.com/watch?v=NURiiQatBXA
David Martinez
@davidmartinezanim
Dec 30 2014 15:45
@mottosso I'll take a look, thanks
Marcus Ottosson
@mottosso
Dec 30 2014 15:46
From a more course perspective, do you think it's correct to say that they each translate C into ones and zeroes, and that they both try to do it as effectively as possible?
The main benefit of Clang, besides it's apparent speed-up, seems to be its verbosity; that it tells you more about what is wrong. Apparently, that has been a problem in the past, assumingly with GCC and Visual Studio.
David Martinez
@davidmartinezanim
Dec 30 2014 17:03
that seems to be the case
still, the thing that I am unsure of is about both minGW and LLVM being compilers... should I have both installed? only one? chang is using LLVM as I understand it?
Marcus Ottosson
@mottosso
Dec 30 2014 17:05
I think LLVM is the compiler, whereas Clang is a.. front-end? :S Maybe as in, a command-line interface.
LLVM probably have a few dependencies, most of which are included in the MinGW installation.
But judging from the video above, I don't think it uses GCC.
This is where @instinct-vfx should jump in and enlighten us! :)
David Martinez
@davidmartinezanim
Dec 30 2014 17:07
that would be great