LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2010, 03:38 PM   #46
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454

Quote:
Originally Posted by MTK358 View Post
...
You didn't tell me how to obtain the necessary files, preferably in Arch package format. If using a different distro would be much more practical, then maybe I'll be willing to do an Arch/(Some other more ASM programming freindly distro) dual boot.

First of all, every normal package format allows extraction of separate files from a package, so obtaining the necessary files is a matter of locating the package containing them and learning how to extract the files.

Secondly, you need to learn how to control the linker - as I said before.

The items to pay attention to are output format and the way/places library directory are looked for. You might pleasantly surprised just by patiently reading

Code:
ld --help | less
- there are a few relevant pieces in the output of the above command.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-13-2010, 03:44 PM   #47
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Sergei Steshenko View Post
Code:
ld --help | less
- there are a few relevant pieces in the output of the above command.
Code:
  -A ARCH, --architecture ARCH
                              Set architecture
Is this what you are talking about?
 
Old 04-13-2010, 03:53 PM   #48
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
ROTFLMAO...No it is not.
 
Old 04-13-2010, 03:58 PM   #49
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
Code:
  -A ARCH, --architecture ARCH
                              Set architecture
Is this what you are talking about?

This answer is very "you" - I've mentioned a number of items, but you address just one item.

You might also find useful verifying your assumptions in

Code:
man ld
.

Thanks for keeping me pleasantly amused.
 
Old 04-13-2010, 04:02 PM   #50
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Sergei Steshenko View Post
This answer is very "you" - I've mentioned a number of items, but you address just one item.
I looked throught it but that was the only thing I really understood.

You really need to drop your RTFM attitude and realize that there are such things as s.
 
Old 04-13-2010, 05:17 PM   #51
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by MTK358 View Post
I looked throught it but that was the only thing I really understood.

You really need to drop your RTFM attitude and realize that there are such things as s.
How many lines are in

Code:
ld --help
?

And how many of those lines have you read ?

Can you read texts in English ? Can you comprehend the texts in English you are reading ?

Can you analyze the text you reading by finding in them pieces you do and don't understand ?

I am telling absolutely for sure that using

Code:
ld --help | less
you can find info related to output format and to the way 'ld' looks for libraries.

Do you want me to prove beyond the reasonable doubt that the info is there and you simple didn't bother to make the necessary effort ?

The info is in plain English, no computer science or math, just plain English with entities you are already familiar with.
 
Old 04-13-2010, 07:20 PM   #52
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Hello All

I have been enjoying the informative part of this question and definitely value the input from all of, from
what I can tell, experienced C/C++ advocates here

May I ask that the conversation is kept on point, ie discussing the relevant differences / preferences between C & C++

I believe (and I may be wrong as I am definitely NOT at the same level as most replying) the current course of discussion
on asm and ld, whilst I understand are / can be used in conjunction with C/C++, is not really on topic. Maybe this
new discussion should be in its own thread?

If I am wrong about its relevance, I apologise

But please continue the discussion on this topic, because as I said above, it is very informative

Cheers
Grail
 
Old 04-13-2010, 07:33 PM   #53
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
I believe (and I may be wrong as I am definitely NOT at the same level as most replying) the current course of discussion
on asm and ld, whilst I understand are / can be used in conjunction with C/C++, is not really on topic.
I agree. It's just that MTK358 and Sergei have a bit of a problem with each other, and neither of them can seem to ignore the other...
 
Old 04-13-2010, 07:38 PM   #54
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by grail View Post
Maybe this
new discussion should be in its own thread?
I'm sorry about my part in hijacking your thread for the mixed ASM with C discussion, and I'll stop replying to that topic in this thread. I have what I think are constructive replies to that side track topic, but I'll need to wait until that discussion goes back to its own threads (it has at least one thread of its own already). Hopefully the other parties to the hijack will also take it out of this thread.

Meanwhile on the original topic, I also have some strong opinions on why C++ is better than any preprocessor you might invent to translate some other OO superset of C back into C. Also on the benefits of several other features of C++ that have been maligned in some of the posts above.

But I don't really think it is likely any of that will convince anyone. It is another of the many topics on which the typical participants in the discussion had immutable opinions before the discussion started.

Last edited by johnsfine; 04-13-2010 at 07:47 PM.
 
Old 04-13-2010, 07:51 PM   #55
icecubeflower
Member
 
Registered: Mar 2008
Location: USA
Distribution: Slackware 13.1
Posts: 313

Rep: Reputation: 34
lol
 
Old 04-13-2010, 07:55 PM   #56
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by johnsfine View Post

...
I also have some strong opinions on why C++ is better than any preprocessor you might invent to translate some other OO superset of C back into C. Also on the benefits of several other features of C++ that have been maligned in some of the posts above.
...
So, what are the benefits ? But if answering, please take into account that:
  1. CPP is a preprocessor by its name/definition;
  2. C++ template engine is a preprocessor whose output can't be easily seen (unlike the one of CPP).

Furthermore, C++ template engine a functional (opposed to proceudral) language/engine, while C++ is not. CPP is a procedural language too. So, there is no consistency in C++ as a whole WRT programming paradigms.
 
Old 04-13-2010, 07:56 PM   #57
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
MTK358 -

Quote:
No matter what I tried I could not get 32-bit ASM code to work on my 64-bit desktop.
Would you be so kind as to open a new thread? I'll try an example when I get to one of my 64-bit PCs later and let you know what I find.

PS:
Johnsfine - no: I haven't tried it on arch. I have zero first-hand experience with ArchLinux, and whether or not they support parallel 32- and 64-bit development and runtime environments like, say, SuSE or Ubuntu do.
 
Old 04-13-2010, 07:58 PM   #58
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I already have another thread for it.
 
Old 04-13-2010, 08:35 PM   #59
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Sergei Steshenko View Post
So, what are the benefits ?
First a comment on the defective communication from the compiler to the debugger when significant (especially templated) code is inlined:

That defect is not an inherent flaw in the C++ language itself. It is a practical flaw in C++ because it seems to be a flaw in every common implementation of C++. But it is a flaw that could be fixed with no change in the language definition.

I was especially surprised at the earlier comment contrasting that specific C++ flaw with the hypothetical benefits of a hypothetical preprocessor for a hypothetical OO superset of C. It's hard to present any concrete argument against such a hypothetical, but in general the quality of info the compiler can pass to the debugger is even worse in that kind of preprocessor design than it is in current C++.

Expressive languages tend to violate the clean hierarchical design that makes things easier for a compiler writer. That's OK, because the language design should focus on benefits for the programmer, not for the compiler writer. A true "preprocessor" design depends on cleaner boundaries between lexical and syntactic features and even more so between syntactic and semantic features. So a "preprocessor" for a language as powerful as C++ cannot be a preprocessor. It must be a full scale translator, translating from the source language to the target language. At that level, there is little advantage left to choosing C rather than machine language as the target language for your translator.

Quote:
Furthermore, C++ template engine a functional (opposed to proceudral) language/engine, while C++ is not. CPP is a procedural language too. So, there is no consistency in C++ as a whole WRT programming paradigms.
Above ASM there is no consistent procedural language. Useful high level languages are necessarily inconsistent across the functional/procedural boundary. Lisp is a nearly pure functional language, but still is partly procedural. C and C++ are nearer the most convenient midpoint of that spectrum. The consistency I think you're talking about would be counter productive.

In less abstract terms, the templating of C++ is an incredibly powerful feature. In complex projects it lets you accomplish things that just aren't practical in other languages. A lot of the specific rules of C++ templating have odd consequences that seem to have led the standards committee to layer on stupider rules to cover the flaws of earlier rules that were accepted before their consequences were thought through. So some hypothetical language much better than C++ would be possible. But so far as I know, that language doesn't exist and the software industry would have too much inertia to switch to it even if it did exist.

Meanwhile, I think a well chosen subset of C++ would be a better language than any other generally available for beginning to moderately skilled programmers to write easy programs. Then a much wider subset of C++ fills the role of the expert programming language for which there really is no plausible alternative.
 
1 members found this post helpful.
Old 04-13-2010, 08:41 PM   #60
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by johnsfine View Post
First a comment on the defective communication from the compiler to the debugger when significant (especially templated) code is inlined:

That defect is not an inherent flaw in the C++ language itself. It is a practical flaw in C++ because it seems to be a flaw in every common implementation of C++. But it is a flaw that could be fixed with no change in the language definition.

I was especially surprised at the earlier comment contrasting that specific C++ flaw with the hypothetical benefits of a hypothetical preprocessor for a hypothetical OO superset of C. It's hard to present any concrete argument against such a hypothetical, but in general the quality of info the compiler can pass to the debugger is even worse in that kind of preprocessor design than it is in current C++.

Expressive languages tend to violate the clean hierarchical design that makes things easier for a compiler writer. That's OK, because the language design should focus on benefits for the programmer, not for the compiler writer. A true "preprocessor" design depends on cleaner boundaries between lexical and syntactic features and even more so between syntactic and semantic features. So a "preprocessor" for a language as powerful as C++ cannot be a preprocessor. It must be a full scale translator, translating from the source language to the target language. At that level, there is little advantage left to choosing C rather than machine language as the target language for your translator.



Above ASM there is no consistent procedural language. Useful high level languages are necessarily inconsistent across the functional/procedural boundary. Lisp is a nearly pure functional language, but still is partly procedural. C and C++ are nearer the most convenient midpoint of that spectrum. The consistency I think you're talking about would be counter productive.

In less abstract terms, the templating of C++ is an incredibly powerful feature. In complex projects it lets you accomplish things that just aren't practical in other languages. A lot of the specific rules of C++ templating have odd consequences that seem to have led the standards committee to layer on stupider rules to cover the flaws of earlier rules that were accepted before their consequences were thought through. So some hypothetical language much better than C++ would be possible. But so far as I know, that language doesn't exist and the software industry would have too much inertia to switch to it even if it did exist.

Meanwhile, I think a well chosen subset of C++ would be a better language than any other generally available for beginning to moderately skilled programmers to write easy programs. Then a much wider subset of C++ fills the role of the expert programming language for which there really is no plausible alternative.
So, what is wrong if I choose a completely different template engine which generated a template-less C++ with clear indications (at lest in the form of comments) to the original source ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration