A new programming language

Programming, for all ages and all languages.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: A new programming language

Post by turdus »

berkus, combuster: you didn't get the whole point. Not surprised.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: A new programming language

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: A new programming language

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
casnix
Member
Member
Posts: 67
Joined: Fri Jan 14, 2011 7:24 pm

Re: A new programming language

Post by casnix »

"file format for the sake of file format"

for me, reinventing the wheel is fun.....
You are a computer.
~ MCS ~
eddyb
Member
Member
Posts: 248
Joined: Fri Aug 01, 2008 7:52 am

Re: A new programming language

Post 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>
Post Reply