Welcome, Guest. Please login or register.

Author Topic: GCC 4.x or Clang for 68k  (Read 6337 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AJCopland

Re: GCC 4.x or Clang for 68k
« on: May 14, 2014, 05:05:47 PM »
Quote from: matthey;764435
I'm surprised the game industry doesn't use regular C with a library of functions, macros and assembler optimizations, at least for non-x86_64 games.


Why would we? Look everyone likes to go on about C being the fastest but that comes with the caveat that you can write fast code. C++ comes with the caveat that it's fast if you can write fast code.

If you want a good argument against C it's the Heartbleed bug, a bug that exists almost solely because of someone writing something in C for which there is no good argument to use the language.

Getting a modern C++ compiler available for the Amiga would be very useful. LLVM/CLang or GCC doesn't matter, get the compiler, optimise and bug fix it's output afterwards.

Andy <-- currently developing Unreal Engine 4, which uses quite a bit of C++ and would be  nightmare to imagine in C
Be Positive towards the Amiga community!
 

Offline AJCopland

Re: GCC 4.x or Clang for 68k
« Reply #1 on: May 15, 2014, 10:26:30 AM »
@pspxhill & matthey
You misunderstand, my fault as I wasn't very clear. I made the Heartbleed reference as an argument against using `C` not as a positive for using `C++` - I'd prefer to use another higher level language, maybe C# or Java, but better yet something more suited to the problem domain that is without pointers entirely.

I don't think you should use either (C/C++) for security related code and its horrific to think about all of the libraries like OpenSSL that are implemented using C.

If I had no choice but to use C or C++ then I'd pick C++ since I can at least hope to catch some of the blindingly obvious issues and deliberately avoid using raw pointers which cause most of these kinds of bugs.

The issues that people are spouting about C vs C++ here are weird, it's like stepping back to the 1990s when I started coding in C - they're outdated. You don't need to know all of C++ to use it, you use the bits you need, learn something new now and then. The same as you do with C, if I want to get as low-level as C with C++ then I do, if I don't then I don't. Nothing more too it.

I think the Amiga needs a modern version of GCC / LLVM / CLang just to disspell these myths! :)

So how do we go about doing that productively? Even if GCC 4.8 spews poor integer code for 68k now, that doesn't mean we have to leave it that way.
Be Positive towards the Amiga community!
 

Offline AJCopland

Re: GCC 4.x or Clang for 68k
« Reply #2 on: May 15, 2014, 04:46:36 PM »
I personally hate Java too. C# is I think what Java wanted to be, you know how often you have good idea and try it out but it's not right, in fact it's usually an damned ugly unworkable mess... that's Java. Then some time later you try again based on what you learnt from your first attempt and this time it's really good, not perfect but much better than before... that's C# :)

People go to C/C++/Obj-C or whatever then decide how to whatever it is that they had in mind. What we should be doing is deciding what our priorities are, security vs speed, and then picking the correct language for the task.

If it's speed then you still need to ask what the right language is. For Games it's probably C/C++, but for numerical analysis Fortran is probably faster. I dislike Fortran too but it might be the correct tool for the job at hand.

C/C++ are hard to write well, and even when you do you get a lot of unintentional bugs even from experienced coders. I see them every single day even from some of the worlds best developers. They're languages that are simply too error prone for a lot of tasks - a lot of that is due to pointers.

Trouble is once someone knows C they think that's it, it's the ultimate hammer, it can do anything. No one ever stops to think if they "should" be using it for everything.
Be Positive towards the Amiga community!