Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.

2014-03-30 Thread Domingo Alvarez Duarte
For the people that checked out my repository at
https://github.com/mingodad/tinycc.git I'll try explain what my "virtual
io" is for.

I've tried on the past achieve something like etcl did, I mean a self
contained interpreter with the ability to mix c code.

I've tried to use libtcc but it depends on auxiliary files been installed
on a specific folder and nee be distributed along side the
interpreter/embedded application.

Then I started this "virtual io" and with a bin2c program that allow
incorporate the auxiliary files directly inside the library/interpreter.

To test the idea and achieve a self contained tcc that doesn't depend on
auxiliary files installed elsewhere I've created a small script that does
that "mk-it" on my distribution, to achieve a small self contained tcc it's
best to edit config.mak and change "CFLAGS=-Os" and run "./mk-it" the
result tcc is self contained and can be used from anywhere without any
auxiliary files/folder.

Cheers !


On Sat, Mar 29, 2014 at 7:13 PM, grischka  wrote:

> Domingo Alvarez Duarte wrote:
>
>> Hello all !
>>
>> I finished phase1 of code refactoring of tinycc to remove global
>> variables, not all global variables are removed yet but most of then are,
>> with that it can cross compile all platforms on my linux X86_64 and till
>> only on real test was done on linux.
>>
>> Here you can find the repository to test yourselves
>> https://github.com/mingodad/tinycc any comment/suggestion/patch are
>> welcome.
>>
>
> For the lazy typers and in order not to go to far past 80 cpl
> I'd suggest 's1' instead of 'tcc_state' all over the place.
>
> Not sure whether vtop (and all that) needs to become tccgen_vtop
> etc.
>
> Section stuff (text_section etc.) would more logically belong
> to tccelf rather than tccgen.  (I once wanted to move those,
> and add some interfaces such as elf_new()/elf_delete(), but ...)
>
> C99 declarations past statement or declaration of size_t in
> user code hurts other compilers.
>
> Your 'virtual io' should maybe go in a 'contrib' directory, and
> have some readme explanation. (otherwise it is useless for
> other people).  Though, struct fd is NOT nice.  There are
> probably much less intrusive ways, say with 3 simple #defines
> on top and instead slightly more intelligent custom functions
> that supports int fd's).
>
> If any possible avoid mixing the refactoring with other fixes
> or improvements, whatever those are.
>
> Btw. did you use some special tools (and if yes, which) or
> just find&replace?
>
> --- grischka
>
>
>  Thanks for your time, attention and great work !
>>
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.

2014-03-29 Thread Domingo Alvarez Duarte
Yes I used netbeans 8.0 it works very much like in java it parsers the
c/c++ code and allow us to point to a variable/function and
refactoring/rename it and it goes through all the code that was parsed and
make the changes. It's a lot better than pure search and replace.

Also in order to it work properly files that are not included on the
compilation/parsing (the one that are grayed on the project explorer)
should be right clicked and in properties check "Add to parse" this way
they will also be checked when refactoring variables/functions.

Also it is a lot easy to navigate through the code and it uses the
configure/makefile to build the project.

In summary it's a very good tool and I recommend using it, before I used
codeblocks/codelite but netbeans is superior for
navigation/refactoring/build/edit ...

As I said after this first phase several problems come to light, like api,
naming convnention, ..., I use those names to make it easy to see where
they come from before removing then from global scope.


Thanks for all your comments !


On Sat, Mar 29, 2014 at 7:13 PM, grischka  wrote:

> Domingo Alvarez Duarte wrote:
>
>> Hello all !
>>
>> I finished phase1 of code refactoring of tinycc to remove global
>> variables, not all global variables are removed yet but most of then are,
>> with that it can cross compile all platforms on my linux X86_64 and till
>> only on real test was done on linux.
>>
>> Here you can find the repository to test yourselves
>> https://github.com/mingodad/tinycc any comment/suggestion/patch are
>> welcome.
>>
>
> For the lazy typers and in order not to go to far past 80 cpl
> I'd suggest 's1' instead of 'tcc_state' all over the place.
>
> Not sure whether vtop (and all that) needs to become tccgen_vtop
> etc.
>
> Section stuff (text_section etc.) would more logically belong
> to tccelf rather than tccgen.  (I once wanted to move those,
> and add some interfaces such as elf_new()/elf_delete(), but ...)
>
> C99 declarations past statement or declaration of size_t in
> user code hurts other compilers.
>
> Your 'virtual io' should maybe go in a 'contrib' directory, and
> have some readme explanation. (otherwise it is useless for
> other people).  Though, struct fd is NOT nice.  There are
> probably much less intrusive ways, say with 3 simple #defines
> on top and instead slightly more intelligent custom functions
> that supports int fd's).
>
> If any possible avoid mixing the refactoring with other fixes
> or improvements, whatever those are.
>
> Btw. did you use some special tools (and if yes, which) or
> just find&replace?
>
> --- grischka
>
>
>  Thanks for your time, attention and great work !
>>
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.

2014-03-29 Thread grischka

Domingo Alvarez Duarte wrote:

Hello all !

I finished phase1 of code refactoring of tinycc to remove global 
variables, not all global variables are removed yet but most of then 
are, with that it can cross compile all platforms on my linux X86_64 and 
till only on real test was done on linux.


Here you can find the repository to test yourselves 
https://github.com/mingodad/tinycc any comment/suggestion/patch are welcome.


For the lazy typers and in order not to go to far past 80 cpl
I'd suggest 's1' instead of 'tcc_state' all over the place.

Not sure whether vtop (and all that) needs to become tccgen_vtop
etc.

Section stuff (text_section etc.) would more logically belong
to tccelf rather than tccgen.  (I once wanted to move those,
and add some interfaces such as elf_new()/elf_delete(), but ...)

C99 declarations past statement or declaration of size_t in
user code hurts other compilers.

Your 'virtual io' should maybe go in a 'contrib' directory, and
have some readme explanation. (otherwise it is useless for
other people).  Though, struct fd is NOT nice.  There are
probably much less intrusive ways, say with 3 simple #defines
on top and instead slightly more intelligent custom functions
that supports int fd's).

If any possible avoid mixing the refactoring with other fixes
or improvements, whatever those are.

Btw. did you use some special tools (and if yes, which) or
just find&replace?

--- grischka


Thanks for your time, attention and great work !



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Code refactoring to remove globals phase1 done.

2014-03-28 Thread Domingo Alvarez Duarte
Hello all !

I finished phase1 of code refactoring of tinycc to remove global variables,
not all global variables are removed yet but most of then are, with that it
can cross compile all platforms on my linux X86_64 and till only on real
test was done on linux.

Here you can find the repository to test yourselves
https://github.com/mingodad/tinycc any comment/suggestion/patch are welcome.

Thanks for your time, attention and great work !
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel