Page 2 of 2

Re: A new programming language

Posted: Sat May 28, 2011 9:18 am
by turdus
berkus, combuster: you didn't get the whole point. Not surprised.

Re: A new programming language

Posted: Sat May 28, 2011 9:55 am
by bluemoon
turdus wrote:You miss the point. You cannot reproduce full function prototypes from an ELF, that's why you need two files: an so and a h. I don't like that.
First, .h file may contain more information than just function prototypes.
So unless you want to drop some features, to truly eliminate the need of two files while retain all features you would end up either:
  • * embed everything into the new object format
  • * just zip/pack the .obj with .h, like how mac handle application bundles
If you only want function prototypes, you can do this:

Code: Select all

$ cat abc.cpp 
int adder(int a, int b){
  return a+b;
}
$ objdump -t a.o
a.o:     file format elf32-i386-freebsd
SYMBOL TABLE:
00000000 l    df *ABS*	00000000 a.cpp
00000000 l    d  .text	00000000 
00000000 l    d  .data	00000000 
00000000 l    d  .bss	00000000 
00000000 l    d  .comment	00000000 
00000000 g     F .text	0000000b _Z5adderii
00000000         *UND*	00000000 __gxx_personality_v0
It should be possible to generate function prototypes from "_Z5adderii" on-the-fly.

Re: A new programming language

Posted: Sat May 28, 2011 10:06 am
by Combuster
turdus wrote:berkus, combuster: you didn't get the whole point. Not surprised.
I can, with a stock binutils and a yasm, read and modify configurations embedded into the binary. It will work on linux, bsd, and my OS alike, as well as any x86-based platform as the method requires absolutely no additional logic on the host side. It will work the same on any other non-x86 ELF-based platform, it only requires binutils and an added tool that does bin2obj functionality and adding some addresses.

That solves your problem as described. If it still isn't a valid answer, your problem description was inadequate and you need to provide additional arguments.

Re: A new programming language

Posted: Sat May 28, 2011 12:33 pm
by casnix
"file format for the sake of file format"

for me, reinventing the wheel is fun.....

Re: A new programming language

Posted: Mon May 30, 2011 1:54 am
by eddyb
berkus wrote:
casnix wrote:"file format for the sake of file format"

for me, reinventing the wheel is fun.....
It is certainly fun when you're 14. I also invented a few file formats at that time.
I have already 2 (perhaps more, but these I remember): one is .gear and the other one is .aze.
Just some text formats with a syntax of their own. This is to show that [a-f]yo kids like and will reinvent wheels, will over-think things in the most absurd ways, and will remain kids, with everything that implies (making fool of yourself, crying over stupid stuff etc.).
</rant>