Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Is Perl written in C?

Reply
Thread Tools

Is Perl written in C?

 
 
Man-wai Chang
Guest
Posts: n/a
 
      03-03-2012

Just curious...

--
@~@ You have the right to remain silence.
/ v \ Simplicity is Beauty! May the Force and farces be with you!
/( _ )\ (Fedora 15 i686) Linux 3.2.6
^ ^ 22:12:02 up 8 days 9:09 0 users load average: 0.01 0.03 0.05
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_...sub_addressesa
 
Reply With Quote
 
 
 
 
Man-wai Chang
Guest
Posts: n/a
 
      03-03-2012
> Why do you think a C++ group is the best place to ask about Perl and C?
> OK, as I have nothing better to do at the moment, I copy-pasted your


Apologize for this.

> question into google and now copy-pasting the result back: "Perl is
> implemented as a core interpreter, written in C, together with a large
> collection of modules, written in Perl and C."


Thanks.

--
@~@ You have the right to remain silence.
/ v \ Simplicity is Beauty! May the Force and farces be with you!
/( _ )\ (Fedora 15 i686) Linux 3.2.6
^ ^ 22:37:02 up 8 days 9:34 0 users load average: 0.07 0.08 0.05
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_...sub_addressesa
 
Reply With Quote
 
 
 
 
Man-wai Chang
Guest
Posts: n/a
 
      03-03-2012
> Why do you think a C++ group is the best place to ask about Perl and C?

I figured out maybe 2 good reasons:

1. resources
2. security

I think C is the basic building blocks for a lot of high-level languages
like Perl. Python? Ruby? PHP?

--
@~@ You have the right to remain silence.
/ v \ Simplicity is Beauty! May the Force and farces be with you!
/( _ )\ (Fedora 15 i686) Linux 3.2.6
^ ^ 22:37:02 up 8 days 9:34 0 users load average: 0.07 0.08 0.05
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_...sub_addressesa
 
Reply With Quote
 
BGB
Guest
Posts: n/a
 
      03-03-2012
On 3/3/2012 8:23 AM, Sam wrote:
> Man-wai Chang writes:
>
>>> Why do you think a C++ group is the best place to ask about Perl and C?

>>
>> I figured out maybe 2 good reasons:
>>
>> 1. resources
>> 2. security
>>
>> I think C is the basic building blocks for a lot of high-level
>> languages like Perl. Python? Ruby? PHP?

>
> There are only two kinds of languages:
>
> 1. C/C++
> 2. Languages that are themselves written in C/C++
>
> With one small exception being Apple, Inc.'s reality distortion field
> where lots of stuff gets coded using the Objective-C oddity.
>


well, except that Objective-C still has a C core...
so, C isn't really escaped.


but, yeah, it is fairly rare to find an HLL which isn't itself
implemented using C or C++.

even the JVM / JDK: despite Java being competition to C and C++, doesn't
mean the core of their VM isn't written using it.


my own scripting VM is written mostly in C, apart from the parts written
in assembler (typically not directly, as there is an in-program
assembler and a lot of procedural code generation going on using ASM...).

 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      03-03-2012
Le 03/03/12 16:23, Sam a écrit :
> Man-wai Chang writes:
>
>>> Why do you think a C++ group is the best place to ask about Perl and C?

>>
>> I figured out maybe 2 good reasons:
>>
>> 1. resources
>> 2. security
>>
>> I think C is the basic building blocks for a lot of high-level
>> languages like Perl. Python? Ruby? PHP?

>
> There are only two kinds of languages:
>
> 1. C/C++


You can eliminate the C++ here since C++ compilers are written in C...



(Look at the gcc sources for instance)

The lcc C compiler is also written in C.


> 2. Languages that are themselves written in C/C++
>


For instance C itself. Since ages the portable c compiler
(pcc) was written in C and was the first c compiler ever written.

> With one small exception being Apple, Inc.'s reality distortion field
> where lots of stuff gets coded using the Objective-C oddity.


the Objective C language is much better than C++

And now, let the flame war start here





 
Reply With Quote
 
BGB
Guest
Posts: n/a
 
      03-04-2012
On 3/3/2012 8:13 PM, William Ahern wrote:
> jacob navia<(E-Mail Removed)> wrote:
>> Le 03/03/12 16:23, Sam a écrit :
>>> Man-wai Chang writes:
>>>
>>>>> Why do you think a C++ group is the best place to ask about Perl and C?
>>>>
>>>> I figured out maybe 2 good reasons:
>>>>
>>>> 1. resources
>>>> 2. security
>>>>
>>>> I think C is the basic building blocks for a lot of high-level
>>>> languages like Perl. Python? Ruby? PHP?
>>>
>>> There are only two kinds of languages:
>>>
>>> 1. C/C++

>
>> You can eliminate the C++ here since C++ compilers are written in C...

>
>>

>
>> (Look at the gcc sources for instance)

>
>> The lcc C compiler is also written in C.

>
> clang/llvm is a C++ compiler written in C++. There's not a line of C as far
> as I can tell. Although, I haven't looked too hard because all the
> inheritance and casting makes my eyes bleed. For every line of code that
> builds or processes the AST there's 12 lines of C++ boilerplate. I'm
> undecided on whether it's preferable to the macro nightmare that is GCC.


yeah.

I looked briefly at LLVM before, and it looked sort of like someone was
all like "C++ isn't like Java enough, we sort of need to do it more like
Java, but more badly...".

I didn't really like it all that much, and didn't really agree with the
architecture (I more like more clearly defined components and stages),
so mostly have been doing my own VM and code-generation stuff (with a
much smaller codebase as well, granted I don't support nearly so many
targets or features, but whatever...).

my stuff (in these areas) is nearly all C though.
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      03-04-2012
Andy Champ <(E-Mail Removed)> wrote:
> I have personally worked on a Pascal compiler that was written in
> Pascal, and assemblers galore written in assembler. As C wasn't the
> first HLL there will be a number of languages written in something else.
> I'm pretty sure there are Ada compilers written in ADA.


I think it depends on the system too. For example on Linux (and many
unixes) there's probably not a single executable that doesn't depend on
(and use) libc.so. I wouldn't be surprised if an ADA executable compiled
with an ADA compiler wouldn't depend on libc.so on Linux.
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      03-04-2012
BGB <(E-Mail Removed)> wrote:
> I looked briefly at LLVM before, and it looked sort of like someone was
> all like "C++ isn't like Java enough, we sort of need to do it more like
> Java, but more badly...".


What's the point in using C++ if you will be writing in Java anyways?
 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      03-04-2012
William Ahern <william@wilbur.25thandclement.com> wrote:
> clang/llvm is a C++ compiler written in C++. There's not a line of C as far
> as I can tell.


I would be surprised if there wasn't a single line that's valid C.

Perhaps you meant something like "there's not a single source file that
would compile as C".
 
Reply With Quote
 
BGB
Guest
Posts: n/a
 
      03-04-2012
On 3/4/2012 2:56 AM, Juha Nieminen wrote:
> BGB<(E-Mail Removed)> wrote:
>> I looked briefly at LLVM before, and it looked sort of like someone was
>> all like "C++ isn't like Java enough, we sort of need to do it more like
>> Java, but more badly...".

>
> What's the point in using C++ if you will be writing in Java anyways?


I am not saying anyone was using Java, rather LLVM seemed to have been
written in a vaguely Java-like style, with one-class-per-file, large
numbers to includes to include each header file, ...

the contrast is to basically dump a bunch of class definitions into
shared headers, and maybe aggregate classes in source-files as well, ...

then, one breaks things up, like say when the files get longer than
1000-2000 lines and start getting unwieldy.


as well as probably doing the thing of making "compound headers", where
one includes a single header and gets all relevant headers for the
entire library, without having to include them individually (the
compound header includes all sub-headers).

the advantage to the above is that it only requires a single
include-line per source file (and helps keep everything more
consistent). a disadvantage though is that of typically longer build times.


going and looking back at the code though (quickly skimming some), I may
have been mistaken:
there are cases of multiple classes per file.

I had vaguely thought I also remembered a lack of include guards, but
checking again, the headers do seem to have them.


or such...
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generally, are the programs written by C++ slower than written by C10% ? KaiWen C++ 102 09-14-2011 11:12 PM
Can (nearly) any Perl program be written on a single line? usenet@DavidFilmer.com Perl Misc 18 10-31-2005 06:58 AM
new commands written in perl wana Perl Misc 17 09-28-2004 02:25 AM
Re: Can a usercontrol written in C# be used in Web Forms that is written in VB.Net? Steve C. Orr, MCSD ASP .Net 1 08-24-2003 12:06 AM
Configure win98 to work with a cgi written in perl iris Perl Misc 1 07-17-2003 12:17 PM



Advertisments