473,785 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

An idea.

Hi!
I use Python, and writing some extension modules I think which could
be written an
C compiler, useful only to compile extension modules (I not think an
GCC!!!!), so that the user not have to use GCC, Microsoft Visual C++,
or other.
It must have an common API to all platforms, even if obviously the
implementation is various.
Could be write in 100% Python pure.

It is a bad idea?
Jul 18 '05 #1
7 2078
Am Wed, 21 Jul 2004 03:59:37 -0700 schrieb winlinch:
Hi!
I use Python, and writing some extension modules I think which could
be written an
C compiler, useful only to compile extension modules (I not think an
GCC!!!!), so that the user not have to use GCC, Microsoft Visual C++,
or other.
It must have an common API to all platforms, even if obviously the
implementation is various.
Could be write in 100% Python pure.

It is a bad idea?


Hi,

I like the idea very much. A C compiler
written in python. Someone already started
this. There was a post in this newsgroup,
maybe one month ago.

Regards,
Thomas

--
Thomas Güttler, http://www.thomas-guettler.de/
Jul 18 '05 #2
"Thomas Guettler" <gu*****@thom as-guettler.de> wrote in message news:<pa******* *************** ******@thomas-guettler.de>...
Am Wed, 21 Jul 2004 03:59:37 -0700 schrieb winlinch:
Hi!
I use Python, and writing some extension modules I think which could
be written an
C compiler, useful only to compile extension modules (I not think an
GCC!!!!), so that the user not have to use GCC, Microsoft Visual C++,
or other.
It must have an common API to all platforms, even if obviously the
implementation is various.
Could be write in 100% Python pure.

It is a bad idea?


Hi,

I like the idea very much. A C compiler
written in python. Someone already started
this. There was a post in this newsgroup,
maybe one month ago.


The link to this compiler is here:

http://people.cs.uchicago.edu/~varmaa/mini_c/

Another good idea would be to write an improved C preprocessor that

* is more consistent with the C language. For example,
macro SQUARE(x) = x * x;
would be equivalent to
#define SQUARE(x) ((x) * (x))
* in addition to MACRO and MACRO(args), allows forms as complex as:
macro NEW T[arraysize] = calloc(arraysiz e, sizeof(T));
macro NEW T(...) = T ## _new(...);
macro ALLOCATOR typename(...) {init} =
T* T##_new(...) {
T* self = malloc(sizeof(T ));
init;
return self;
}
;
which would allow you to write code like
ALLOCATOR String(char *s) {
self->length = strlen(self);
self->data = NEW char[self->length + 1];
strcpy(self->data, s);
}
int foo() {
s = NEW String("Hello, world!");
// ...
}
* Has "typeof" as part of the preprocessor, so that code like
macro DESTRUCTOR T {cleanup} =
void T##_delete(T* self) {
cleanup;
free(self);
}
;
macro DELETE p = typeof(p)##_del ete(p);
will work.
Jul 18 '05 #3
da*****@yahoo.c om (Dan Bishop) wrote in message news:<ad******* *************** ****@posting.go ogle.com>...
"Thomas Guettler" <gu*****@thom as-guettler.de> wrote in message news:<pa******* *************** ******@thomas-guettler.de>...
Am Wed, 21 Jul 2004 03:59:37 -0700 schrieb winlinch:
Hi!
I use Python, and writing some extension modules I think which could
be written an
C compiler, useful only to compile extension modules (I not think an
GCC!!!!), so that the user not have to use GCC, Microsoft Visual C++,
or other.
It must have an common API to all platforms, even if obviously the
implementation is various.
Could be write in 100% Python pure.

It is a bad idea?


Hi,

I like the idea very much. A C compiler
written in python. Someone already started
this. There was a post in this newsgroup,
maybe one month ago.


The link to this compiler is here:

http://people.cs.uchicago.edu/~varmaa/mini_c/

Another good idea would be to write an improved C preprocessor that

* is more consistent with the C language. For example,
macro SQUARE(x) = x * x;
would be equivalent to
#define SQUARE(x) ((x) * (x))
* in addition to MACRO and MACRO(args), allows forms as complex as:
macro NEW T[arraysize] = calloc(arraysiz e, sizeof(T));
macro NEW T(...) = T ## _new(...);
macro ALLOCATOR typename(...) {init} =
T* T##_new(...) {
T* self = malloc(sizeof(T ));
init;
return self;
}
;
which would allow you to write code like
ALLOCATOR String(char *s) {
self->length = strlen(self);
self->data = NEW char[self->length + 1];
strcpy(self->data, s);
}
int foo() {
s = NEW String("Hello, world!");
// ...
}
* Has "typeof" as part of the preprocessor, so that code like
macro DESTRUCTOR T {cleanup} =
void T##_delete(T* self) {
cleanup;
free(self);
}
;
macro DELETE p = typeof(p)##_del ete(p);
will work.


I have seen http://people.cs.uchicago.edu/~varmaa/mini_c/ and I must
say that is good, even if I thought to a compiler written without
other modules instead of standard library's, already useful.
For me, the idea of an improvements of C preprocessor has the
disadvantage of having to learn additional syntax, when instead can be
a compiler in the standard library.

I attend answers, critics and ideas!!!!
Jul 18 '05 #4
wi*******@yahoo .it wrote:
Hi!
I use Python, and writing some extension modules I think which could
be written an
C compiler, useful only to compile extension modules (I not think an
GCC!!!!), so that the user not have to use GCC, Microsoft Visual C++,
or other.
It must have an common API to all platforms, even if obviously the
implementation is various.
Could be write in 100% Python pure.

It is a bad idea?


What's the point? What's wrong with GCC? It's fast, comprehensive, and
supported on all major platforms. Unless it solves a specific task, like
Pysco or SWIG, it's purpose will be merely academic.
Jul 18 '05 #5
"Chris S." <ch*****@NOSPAM udel.edu> wrote in message news:<cd******* ***@scrotar.nss .udel.edu>...
wi*******@yahoo .it wrote:
Hi!
I use Python, and writing some extension modules I think which could
be written an
C compiler, useful only to compile extension modules (I not think an
GCC!!!!), so that the user not have to use GCC, Microsoft Visual C++,
or other.
It must have an common API to all platforms, even if obviously the
implementation is various.
Could be write in 100% Python pure.

It is a bad idea?


What's the point? What's wrong with GCC? It's fast, comprehensive, and
supported on all major platforms. Unless it solves a specific task, like
Pysco or SWIG, it's purpose will be merely academic.


The idea was that one to create a Python platform, without to use
large compilers (I refer above all to MSVC++!!!!!!!), but a compiler
part of the standard library to quickly compile a module.
Jul 18 '05 #6
wi*******@yahoo .it wrote:
The idea was that one to create a Python platform, without to use
large compilers (I refer above all to MSVC++!!!!!!!), but a compiler
part of the standard library to quickly compile a module.


But if it was capable of compiling any C extension module, it would have
to be a full-fledged (large!) C compiler.
Jul 18 '05 #7
On Tue, 27 Jul 2004, Leif K-Brooks wrote:
But if it was capable of compiling any C extension module, it would have
to be a full-fledged (large!) C compiler.


Not if it eschews most/all optimizations, obscure GCC/MSVC extensions,
full-blown assembler/linker, etc. It's quite possible to make a small C
compiler (tinycc (http://www.tinycc.org/) comes to mind...).

Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2693
by: Daniel Chartier | last post by:
Hello. I work in the paper industry and we recently had someone (the original author) from within the company make a program for preventive maintenance. However, it had some bugs and we wanted to add stuff to it, bu tthe original author/programmer was leaving, so we called in a free agent programmer. The free agent spoke with the original programmer and myself for a day. He fixed afew bugs. For the other bugs and the many...
34
4771
by: SeeBelow | last post by:
I see the value of a class when two or more instances will be created, but Python programmers regularly use a class when there will only be one instance. What is the benefit of this? It has a disadvantage of a whole lot of "self." being required everywhere, making the code less readable. Also, since a strength of Python is rapid application development, it slows one down to have to put in all those self.'s. The code seems much cleaner...
4
1527
by: Luca | last post by:
Hello Everybody, I'm a 26 years old Italian "Florentine" Computer technician :) I'm writing you about an idea that I've got of a function that could be introduced in new web browsers (or even in other computer applications). I think nobody already had this idea but I'm not sure because I didn't look deep for it. I don't ask any copywrite for using it but please
1
11817
by: Lipei | last post by:
I have once try IntelliJ IDEA.And I can refactor easily,I can add try and catch just by a few clicks.It also can help me analazy the program's error.(e.g It warned me that I did't initialize the variable) So I wonder is there any tools like it for c++.Can it work together with VC??
4
1315
by: Jordan Marton | last post by:
Hi, I spent the entire weekend struggling to find a suitable tempalte solution for my site. Yes, user controls were good, but I needed one page that could control user controls on each adn every page of my site. Unfortuentaly, I was not able to find a solution to that, and have resorted to loading each control on each page individually. However, I was talking to a friend who also designs in .Net, and he came up with this idea, and I...
21
6056
by: petermichaux | last post by:
Hi, I've been asking questions about library design over the last week and would like to get feedback on my overall idea for a JavaScript GUI library. I need a nice GUI library so there is a good chance I will write this as I need new widgets. I haven't found anything like this and I'm surprised/disapointed this doesn't already exist. My library prototype works nicely. I think parts of these ideas are not commonly used for JavaScript...
12
1816
by: Paul H | last post by:
A little off topic this one because the database may not be written in Access. I am just looking for some advice.. I have an idea to help prevent a particular type of crime, a database will be involved in storing and analysing information. The idea is quite a simple one and once disclosed would be easy, with reasonable technical know-how, to set-up. Police forces all over the country could use my system, but I want to approach the...
28
2106
by: onkar | last post by:
This idea might be vey crazy. But I hope to get answers to this .. from comp.lang.c If a compiler is designed such that it automatically adds a free() matching every malloc() then is it not a garbage collection (in the first place , garbage will not be generated !! ) . Is it possible to have a compiler with such feature. Or if Its not a good idea (or may be this is an idiotic idea) please tell me why is it so ??
2
1430
by: pigeonrandle | last post by:
Hi, My application creates a project that is structured like a tree, so i want to use a treeview to display it to the user. Would it be a good idea to create the various parts of project as classes inherited from TreeNode and then just add them to the treeview (ie adding extra properties to the inherited classes to hold my data)? This would make outputting the project as an xml file very simple as i could just traverse the treeview and...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.