Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
C as an intermediate target
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
edcdave  
View profile  
 More options Mar 31 2010, 6:12 pm
From: edcdave <edcd...@gmail.com>
Date: Wed, 31 Mar 2010 15:12:14 -0700 (PDT)
Local: Wed, Mar 31 2010 6:12 pm
Subject: C as an intermediate target
A couple of observations:

1) I noticed that hello.zu is generating a 726-line hello.c (under
Windows XP). gcc compiles that file and produces an executable of
118,764 bytes. Is this a permanent attribute of zimbu or do you have
expectations that refinements will reduce these sizes?

2) In the early days of C++, there were no native compilers and all we
had was cfront. I recall the frustration of interpreting compiler
warnings and errors. I'm concerned that zimbu might prove to be
similarly challenging. Your language design goal of easy-to-read code
is one I endorse 100%. But I have doubts about how a programming
environment (IDE) can cope with the mapping between zimbu and C
sources.

Please don't consider this as criticism. If you have addressed these
earlier, could you point me where to look?

Thanks,
Dave


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bram Moolenaar  
View profile  
 More options Apr 1 2010, 5:26 am
From: Bram Moolenaar <B...@Moolenaar.net>
Date: Thu, 01 Apr 2010 11:26:54 +0200
Local: Thurs, Apr 1 2010 5:26 am
Subject: Re: C as an intermediate target

Dave wrote:
> A couple of observations:

> 1) I noticed that hello.zu is generating a 726-line hello.c (under
> Windows XP). gcc compiles that file and produces an executable of
> 118,764 bytes. Is this a permanent attribute of zimbu or do you have
> expectations that refinements will reduce these sizes?

This can be improved.  Over time the dependencies have become too
complicated.  E.g., I now include Zalloc() always.

Some of the lines are not code, e.g. typedefs.  Those don't really
count and are not worth omitting when not needed.

We need are more sophisticated dependency mechanism.  A manually build
graph should work well now.  Eventually it would be done automatically,
but that's complicated.

One thing that I haven't done yet is including the IO module only
partially.  Currently if any IO method is used the whole module gets
included, and it has grown quite a bit.  Not sure how to do this in a
nice way.  It will help a lot, also the tables with code positions will
be a lot smaller.

> 2) In the early days of C++, there were no native compilers and all we
> had was cfront. I recall the frustration of interpreting compiler
> warnings and errors. I'm concerned that zimbu might prove to be
> similarly challenging. Your language design goal of easy-to-read code
> is one I endorse 100%. But I have doubts about how a programming
> environment (IDE) can cope with the mapping between zimbu and C
> sources.

The error messages only give positions in C code when there is a problem
in the compiler.  The normal error messages are very accurate.

For debugging it will be tricky.  It's possible to add positions for the
Zimbu code in the C code, like the C preprocessor does.

I'm considering making the possibilty to include C code for low-level
operations a feature.  It's impossible to get the efficiency of C
without the drawbacks of pointers and manual memory control.  Using a
little C code where it matters can be a solution.  Unfortunately this
does mean the conversion to C can't be omitted.

--
ARTHUR: If you do not open these doors, we will take this castle by force ...
   [A bucket of slops land on ARTHUR.  He tries to retain his dignity.]
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- B...@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xan  
View profile  
 More options Apr 11 2012, 6:56 am
From: Xan <xancor...@gmail.com>
Date: Wed, 11 Apr 2012 03:56:57 -0700 (PDT)
Local: Wed, Apr 11 2012 6:56 am
Subject: Re: C as an intermediate target

On Apr 1 2010, 11:26 am, Bram Moolenaar <B...@Moolenaar.net> wrote:

Perhaps Golang directed graph compilation technice could help you. You
could implementing an inspiration version of that. In my opinion,
perhaps it's included more than it's needed. In  helloworld example
more bytes added.

I'm not expert, but surely it could be reduced.

Another question: why you use C as intermediate language and not C++.
I think pass Zimbu to C++ were more easyly ought to O-O features of C+
+, isn't?

Thanks,
Xan.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bram Moolenaar  
View profile  
 More options Apr 11 2012, 2:24 pm
From: Bram Moolenaar <B...@Moolenaar.net>
Date: Wed, 11 Apr 2012 20:24:09 +0200
Local: Wed, Apr 11 2012 2:24 pm
Subject: Re: C as an intermediate target

Sure, the idea is simple.  Implementing it will be a bit of work though.
Also, the dependency graph needs to be made for generated C and JS code
separately.

> Another question: why you use C as intermediate language and not C++.
> I think pass Zimbu to C++ were more easyly ought to O-O features of C+
> +, isn't?

C++ is a very complicated language and not available everywhere.  E.g.
for embedded systems often only C is available.  Therefore I prefer the
compiler itself to be converted to C, so that it can be run nearly
everywhere.

It would be possible to write a C++ backend.  I am currently working on
separating the generation code out from Generate.zu.  Since Zimbu
already supports producing Javascript, which supports classes, C++ would
be a mix of the C and Javascript backends.

--
DEAD PERSON:  I'm getting better!
CUSTOMER:     No, you're not -- you'll be stone dead in a moment.
MORTICIAN:    Oh, I can't take him like that -- it's against regulations.
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- B...@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »