Python Front-end to GCC

M

Mark Janssen

What a mess of a discussion.

I see the big man stepping in to answer for his homies, but while his
explanation satisfies their question of "well why do these magic
values get used then, if what Mark says is true?", it doesn't address
the real confusion: What is the difference between "script" code
(like Javascript and visual) made for the screen (where such magic
values are utilized) and compiled source (made for the machine)? And
that is where John, while benevolent, hasn't done the homework of
computer science. Ask him.

Mark
 
M

Mark Janssen

I see the big man stepping in to answer for his homies

After re-reading the discussion, I wish to retract what I'm saying
here and apologize to John who seems like a decent guy.
, but while his
explanation satisfies their question of "well why do these magic
values get used then, if what Mark says is true?", it doesn't address
the real confusion: What is the difference between "script" code
(like Javascript and visual) made for the screen (where such magic
values are utilized) and compiled source (made for the machine)? And
that is where John, while benevolent, hasn't done the homework of
computer science. Ask him.

Otherwise, most of this, while sloppy, still stands.

Mark Janssen
Tacoma, Washington
 
R

rusi

Check out his Twitter feed. I quote "Can women do a little more than
suck the **** of the anti-Christ?" Enough said?

You told us recently, Mark, that you carry the load of Asperger, depression and fatigue (if I remember correctly). Also that when you said things you later regretted it was because the Asperger was out of control.

Would you not prefer a little kindness at your worst times rather than a peremptory show of the letter-of-the-law?

Now look at the other Mark. Does he not seem borderline crazy? Do we need to get him further down with unnecessary references to things outside of here?

[No pretenses to doing a great job myself. The excuse is that I dont know how to encourage the human being and discourage the delusions of grandeur]

Just a personal suggestion: When you are funny you are fun to have around.
When you start pulling the punches...
Dont we have enough stuttering slobbering semi-literate minus-IQ heavyweights around here? Do we need one more?

And BTW in the other thread, in case it was not clear, I found your posts -- starting with "Get a sex-manual" -- funny. The surrounding provocations were quite unbearable.
 
G

Grant Edwards

On 26/10/2013 22:25, Mark Janssen wrote:

Please give it a rest Mark, nobody is falling for your pseudo babel.

I think you do him a disservice. I'm pretty sure it's genuine,
bona-fide, 24K, dyed-in-the-wool, 99 and 44/100 pure babble.
 
A

Albert van der Horst

-=-=-=-=-=-
Global:

int arr[10];
int main()
{
int i;
for (i = 0; i < 10; i++) {
printf("arr[%d] = %d\n", i, arr);
}
printf("\n");
return 0;
}

As for a reference:
http://stackoverflow.com/questions/1831290/static-variable-initialization
and
http://stackoverflow.com/questions/3373108/why-are-static-variables-auto-initialized-to-zero,
both of which then reference the C++ standard.



Or even better:

#include<stdio.h>

int arr[] = {1,2,3,4,5,6,7,8};

int main()
{
int i;
for (i = 0; i < sizeof(arr)/sizeof(int); i++) {
printf("arr[%d] = %d\n", i, arr);
}
printf("\n");
return 0;
}

Output:
"
albert@cherry:/tmp$ a.out
arr[0] = 1
arr[1] = 2
arr[2] = 3
arr[3] = 4
arr[4] = 5
arr[5] = 6
arr[6] = 7
arr[7] = 8
"


This is the output of
objdump -x a.out (after stripping)

"
a.out: file format elf64-x86-64
a.out
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000400450

.....
Lots of segments.

23 .got.plt 00000030 0000000000600900 0000000000600900 00000900 2**3
CONTENTS, ALLOC, LOAD, DATA
24 .data 00000040 0000000000600940 0000000000600940 00000940 2**5
CONTENTS, ALLOC, LOAD, DATA
25 .bss 00000010 0000000000600980 0000000000600980 00000980 2**3
ALLOC
26 .comment 0000001c 0000000000000000 0000000000000000 00000980 2**0
CONTENTS, READONLY
SYMBOL TABLE:
no symbols
"

Look at .data It is CONTENTS LOAD DATA, i.e. it has content
in the executable binary and this is loaded as such into memory
at startup.

You can also ask to dump the content of the sections:

objdump -s a.out


a.out: file format elf64-x86-64

....

Contents of section .data:
600940 00000000 00000000 00000000 00000000 ................
600950 00000000 00000000 00000000 00000000 ................
600960 01000000 02000000 03000000 04000000 ................
600970 05000000 06000000 07000000 08000000 ................
Contents of section .comment:
0000 4743433a 20284465 6269616e 20342e34 GCC: (Debian 4.4
0010 2e352d38 2920342e 342e3500 .5-8) 4.4.5.


-=-=-=-=-=-
[Alternative: text/html]
-=-=-=-=-=-
 
S

sharath.cs.smp

Hey,



I've been working on GCCPY since roughly november 2009 at least in its

concept. It was announced as a Gsoc 2010 project and also a Gsoc 2011

project. I was mentored by Ian Taylor who has been an extremely big

influence on my software development carrer.



Gccpy is an Ahead of time implementation of Python ontop of GCC. So it

works as you would expect with a traditional compiler such as GCC to

compile C code. Or G++ to compile C++ etc.



Whats interesting and deserves a significant mention is my work is

heavily inspired by Paul Biggar's phd thesis on optimizing dynamic

languages and his work on PHC a ahead of time php compiler. I've had

so many ups and down in this project and i need to thank Andi Hellmund

for his contributions to the project.

http://paulbiggar.com/research/#phd-dissertation



The project has taken so many years as an in my spare time project to

get to this point. I for example its taken me so long simply to

understand a stabilise the core fundamentals for the compiler and how

it could all work.



The release can be found here. I will probably rename the tag to the

milestone (lucy) later on.

https://github.com/redbrain/gccpy/releases/tag/v0.1-24

(Lucy is our dog btw, German Shepard (6 years young) loves to lick

your face off :) )



Documentation can be found http://gcc.gnu.org/wiki/PythonFrontEnd.

(Although this is sparse partialy on purpose since i do not wan't

people thinking this is by any means ready to compile real python

applications)



I've found some good success with this project in compiling python

though its largely unknown to the world simply because i am nervous of

the compiler and more specifically the python compiler world.



But at least to me there is at least to me an un-answered question in

current compiler implementations. AOT vs Jit.



Is a jit implementation of a language (not just python) better than

traditional ahead of time compilation.



What i can say is ahead of time at least strips out the crap needed

for the users code to be run. As in people are forgetting the basics

of how a computer works in my opinion when it comes to making code run

faster. Simply need to reduce the number of instructions that need to

be executed in order to preform what needs to be done. Its not about

Jit and bla bla keyword llvm keyword instruction scheduling keyword

bla.



I could go into the arguments but i feel i should let the project

speak for itself its very immature so you really cant compare it to

anything like it but it does compile little bits and bobs fairly well

but there is much more work needed.



There is nothing at steak, its simply an idea provoked from a great

phd thesis and i want to see how it would work out. I don't get funded

of paid. I love working on compilers and languages but i don't have a

day job doing it so its my little pet to open source i believe its at

least worth some research.



I would really like to hear the feedback good and bad. I can't

describe how much work i've put into this and how much persistence

I've had to have in light of recent reddit threads talking about my

project.



I have so many people to thank to get to this point! Namely Ian

Taylor, Paul Biggar, Andi Hellmund, Cyril Roelandt Robert Bradshaw,

PyBelfast, and the Linux Outlaws community. I really couldn't have got

to this point in my life without the help of these people!



Thanks!



--Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top