[Tinycc-devel] A few beginner questions

2011-12-09 Thread David Mertens
Hello everybody - My name is David and I'm an avid Perl programmer. I also do numerical computing, currently mostly with PDL. I have known about TCC for some time but I only recently learned about libtcc. I am *very* interested in creating a Perl module that tightly integrates with libtcc so that

Re: [Tinycc-devel] Use tcc to make embedded just-in-time compile/interpreter

2011-12-16 Thread David Mertens
Your quest is nearly complete already. Check out libtcc.h and the associated test file in the sources. :-) The only issues I have found with such a scheme is that I have to create a new tccstate every time I want to compile a new function. New functions compiled with an old state appear to clobber

Re: [Tinycc-devel] Use tcc to make embedded just-in-time compile/interpreter

2011-12-18 Thread David Mertens
One reason to use tcc over these others is that it's dead simple to hand C code to libtcc and get a function pointer back (with a few steps, of course). Couldn't find such a simple working example for any other system myself. On Dec 17, 2011 1:12 PM, "Basile Starynkevitch" wrote: > On Fri, 16 Dec

Re: [Tinycc-devel] C1X's _Generic keyword

2012-01-03 Thread David Mertens
Wait, there are *rumors* about tcc? :-D On Tue, Jan 3, 2012 at 10:22 AM, Somchai Smythe < buraphalinuxser...@gmail.com> wrote: > Hello, > > I for one would very much like to see tcc release something more > often. Since my campus blocks the .cz TLD, it is quit difficult for > me to use the repo

Re: [Tinycc-devel] Memory corruption bug in libtcc

2012-01-24 Thread David Mertens
On Tue, Jan 24, 2012 at 6:10 AM, grischka wrote: > Thomas Preud'homme wrote: > >> Le mardi 24 janvier 2012 01:11:08, Daniel Glöckner a écrit : >> >>> On Mon, Jan 23, 2012 at 11:30:54AM +0100, Thomas Preud'homme wrote: >>> Shouldn't the same fix (Cf attached file) be applied for x86-64?

Re: [Tinycc-devel] Help with tests... (osx build but please read anyway)

2012-02-09 Thread David Mertens
Milutin - This is great news! I've been thinking about playing with tcc but my aim is cross-platform and I wanted to have something that works on Macs. I couldn't even compile the current tcc on my 10.7, but I'll see if I can compile your work and start playing with this soon! :-D David 2012/2/

Re: [Tinycc-devel] Help with tests... (osx build but please read anyway)

2012-02-15 Thread David Mertens
Milutin - I had some trouble compiling your code on Lion. Here is what I did, starting from scratch: # Clone and get into the source directory: git clone git://repo.or.cz/tinycc.git cd tinycc # Check out the latest mob and create a named local branch: git checkout origin/mob git checkout -b mob #

Re: [Tinycc-devel] Help with tests... (osx build but please read anyway)

2012-02-15 Thread David Mertens
emember what i did about the rest... > > J.A. Garcia > > > On Wed, Feb 15, 2012 at 6:14 AM, David Mertens > wrote: > >> Milutin - >> >> I had some trouble compiling your code on Lion. Here is what I did, >> starting from scratch: >> >> # Clon

Re: [Tinycc-devel] tcc optional argument as in C++

2012-02-20 Thread David Mertens
I agree with Christian. However, if the need is great, why not write your own compiler that uses libtcc and handles that preprocessing for you? You could copy the current tcc.c and modify it in a handful of places and you'd have your own derived compiler. Note that I'm not suggesting that you fork

[Tinycc-devel] symtab_section

2012-03-21 Thread David Mertens
Hello all - I ran into and then solved a very weird error in which the symtab_section global variable is being set to some non-null value during the constructor phase of my compiler state, but is null when I actually try to add symbols! The reason is because the symbol addition occurred from a dif

Re: [Tinycc-devel] Few more OSX improvements

2012-03-23 Thread David Mertens
It works! It's compiling and running on my system now! Wonderful! I am delighted! To be clear: tcc -run source.c works. It does not compile to a file, but for my purposes, I don't care; I don't need it to compile to a file. Great work! 2012/3/6 Milutin Jovanović > > I have just commited few mo

[Tinycc-devel] Perl-TCC: Erroneous mixing of system include paths and normal include paths?

2012-03-28 Thread David Mertens
Hey all - I'm making wonderful progress putting libtcc and Perl together. You can check out the latest development here: https://github.com/run4flat/perl-TCC At the moment I find that any path that I add to the system include paths gets searched when I later #include "lib.h", so long as the heade

Re: [Tinycc-devel] Perl-TCC: Erroneous mixing of system include paths and normal include paths?

2012-03-29 Thread David Mertens
On Thu, Mar 29, 2012 at 6:53 AM, Thomas Preud'homme wrote: > Le jeudi 29 mars 2012 01:17:58, David Mertens a écrit : > > Hey all - > > > > I'm making wonderful progress putting libtcc and Perl together. You can > > check out the latest development here: &

Re: [Tinycc-devel] symtab_section

2012-03-30 Thread David Mertens
sed > outside your dynamic library, then you are safe, even if both so's > statically link with tcc. > > Miki. > > > On 21 March 2012 10:53, David Mertens wrote: > >> Hello all - >> >> I ran into and then solved a very weird error in which the symtab_secti

Re: [Tinycc-devel] symtab_section

2012-03-30 Thread David Mertens
ate struct, and make appropriate updates, how would I push my commits? Is the mob branch open to any commits? Would I issue a pull request? Thanks! David Fri, Mar 30, 2012 at 3:08 PM, David Mertens wrote: > Milutin, all - > > Yes, you were absolutely correct. Once I recompiled tcc as a sh

Re: [Tinycc-devel] symtab_section

2012-04-18 Thread David Mertens
n the ccde > - get symbol addresses > > There is one thing you cannot do _before_ tcc_relocate: > - create another TCCState > > Also, tcc_relocate can be called only once for each state. > > --- grischka > > > David Mertens wrote: > >> Milutin, all - &

Re: [Tinycc-devel] env executable examples

2012-05-10 Thread David Mertens
Couldn't we just create the binary called tcc-run, so users could say #!/usr/bin/env tcc-run at the top of their files? On Thu, May 10, 2012 at 8:53 AM, Thomas Preud'homme wrote: > Le jeudi 10 mai 2012 15:50:00, Thomas Preud'homme a écrit : > > Greetings everybody, > > > > I've just realized th

Re: [Tinycc-devel] Github

2012-05-15 Thread David Mertens
On Tue, May 15, 2012 at 6:10 AM, Karl Skomski wrote: > > Apart from that: does github have kind of like mob branches by default? > Because, quite frankly, that's the only reason I contributed anything, > however small, back to tinycc. If it hadn't I still would have had fun for > a weekend fixin

Re: [Tinycc-devel] tcc_relocate() and tcc_relocate_ex()

2012-08-28 Thread David Mertens
Sean Conner pointed out: > ... snip ... > > Case 2: Lua (http://www.lua.org/) > > Just to recap Lua---it's a small scripting language intended to be > embedded in a larger application to give said application scripting > abilities. You can also load additional modules either written in Lua or >

Re: [Tinycc-devel] tcc_relocate() and tcc_relocate_ex()

2012-09-04 Thread David Mertens
1) I prefer the two-function interface, especially with the nicer names Sean suggested, but who cares, beggars can't be choosers. 2) This whole exchange took more effort than it should have taken. 3) Thanks! Now it works! (I presume; I've not yet tested it.) David On Mon, Sep 3, 2012 at 6:07 AM,

Re: [Tinycc-devel] Using tcc for C development on Android tablet

2012-09-21 Thread David Mertens
I believe ROOT can run c++ code in an interpreted mode. It's an open source project developed be CERN that gets a lot of use in the high-energy physics community. Whether it compiles and runs on ARM, and more importantly whether there is an Android app for it, is anyone's guess. Seems like either

Re: [Tinycc-devel] TCC and "smart" linking

2012-10-10 Thread David Mertens
Oleg, I think you missed Jared's point. There are many things one can try to target in a compiler. These include small compiler, fast compiler, produce compact executables, produce fast executables, and so on. GCC focuses on building fast executables. TCC's main goal is to quickly compile code. I

Re: [Tinycc-devel] TCC and "smart" linking

2012-10-10 Thread David Mertens
Agh, I forgot to mention something about my uses that is important: I don't compile to a file. I compile to machine code in memory. I hope that wasn't confusing. On Oct 10, 2012 8:54 AM, "David Mertens" wrote: > Oleg, > > I think you missed Jared's point. Th

Re: [Tinycc-devel] Compile programm with angelscript library

2013-06-12 Thread David Mertens
apokalipsis028 - How does TCC have anything to do with angelscript? Are you just asking how to compile a C program with TCC, and link against an arbitrary lib? David On Wed, Jun 12, 2013 at 6:27 AM, apokalipsis028 wrote: > Hello everyone! > Please tell me how to use angelscript.lib or angelscr

Re: [Tinycc-devel] argument length limt for scripts?

2013-06-13 Thread David Mertens
Don't you need something more like this? #!/bin/sh #if 0 exec /path/to/tcc ...your args here... #endif /* C code goes here */ On Thu, Jun 13, 2013 at 9:32 AM, Stephan Beal wrote: > > On Thu, Jun 13, 2013 at 4:22 PM, Stevie G. Messervey > wrote: > >> It looks like I am in for a kernel recompil

Re: [Tinycc-devel] argument length limt for scripts?

2013-06-13 Thread David Mertens
On Thu, Jun 13, 2013 at 11:56 AM, Stevie G. Messervey wrote: > > > -- > *From:* David Mertens > *To:* tinycc-devel@nongnu.org > *Sent:* Thursday, June 13, 2013 12:29 PM > > *Subject:* Re: [Tinycc-devel] argument length limt for scripts? >

Re: [Tinycc-devel] compile programm with angelscript library

2013-06-13 Thread David Mertens
Well, what have you tried? TCC is Just Another C Compiler, and linking against a static library is a pretty standard thing, so presumably you should be able to use the standard incantations for these things. I realize I'm being slightly antagonistic, but I don't actually know the answer. To answer

Re: [Tinycc-devel] When a DLL isn't a DLL.

2013-08-14 Thread David Mertens
Livespi - A while ago I started work on a Perl wrapper for libtcc so that Perl can have just-in-time compilation of C code that compiles faster than Inline::C. Your question caused me to dust off the work, which was in something of a limbo state, and finish the mechanism for exposing C functions t

[Tinycc-devel] Perl bindings for libtcc available on Linux and Windows. Mac help?

2013-08-14 Thread David Mertens
Hey everyone - Following up on an email I sent earlier today, I now (as of 30 minutes ago) have viable Perl bindings for libtcc for both Linux and Windows. The project is being developed under one of my Github repos. The collection of modules provides a system

Re: [Tinycc-devel] When a DLL isn't a DLL.

2013-08-15 Thread David Mertens
; ;-) ). It sounds like a definite alternative for me to > dll 's , but will have to run with strawberry perl on windows. I also do a > lot of work with Perl/Tk. > > > Sent from Samsung tablet > > David Mertens wrote: > > Livespi - > > A while ago I starte

Re: [Tinycc-devel] Perl bindings for libtcc available on Linux and Windows. Mac help?

2013-08-17 Thread David Mertens
Hello everyone - The Perl bindings have worked so far for Windows using MinGW and for Linux. I also managed to get libtcc to build under Mac! Actually, it seems that it always built fine under Mac, but it didn't have all of the symbols. My version of OS X is Lion and is 64 bit, as is evident by th

Re: [Tinycc-devel] Dynamic code generation

2013-08-18 Thread David Mertens
John - This is *very* interesting. One thing that I have been dreaming about is the ability to have some major module partially compile code once and then allow the "user" to plug in miscellaneous expressions and finish the compilation. It sounds like your patch might allow this sort of functional

[Tinycc-devel] Perl bindings for libtcc, and a distribution module

2013-08-21 Thread David Mertens
Hey everyone - The Perl bindings that I mentioned last week have been uploaded to CPAN. I have also written and uploaded the first version of Alien::TinyCC. In case you're not familiar with CPAN, it's like an App Store for Perl modules, except it was started in 1996, before having an App Store wa

Re: [Tinycc-devel] Perl bindings for libtcc, and a distribution module

2013-08-21 Thread David Mertens
On Wed, Aug 21, 2013 at 10:48 AM, Thomas Preud'homme wrote: > Le mercredi 21 août 2013 08:41:09 David Mertens a écrit : > > Hey everyone - > > > > > > > Another important aspect of interest for the tinycc community is that a > > number of people or compani

Re: [Tinycc-devel] Dynamic code generation

2013-08-21 Thread David Mertens
John - On Wed, Aug 21, 2013 at 12:24 PM, wrote: > Hi David. > > On Sun, Aug 18, 2013 at 09:22:04PM -0500, David Mertens wrote: > > John - > > > > This is *very* interesting. One thing that I have been dreaming about is > > the ability to have some major modul

Re: [Tinycc-devel] Include paths

2013-08-22 Thread David Mertens
Anton - I haven't dug into the source code for this, but I too have noticed that (1) I can move around a Windows compilation of tcc that was built using the build-tcc.bat file, but (2) I cannot move around a compilation built using ./configure. This has ramifications for the build recipe for Alien

[Tinycc-devel] First build reports back for Alien::TinyCC

2013-08-23 Thread David Mertens
Hello everyone - Useful build reports are coming in. Apparently the recipe is the main culprit at the moment, but I wanted to draw attention to a few things. BSD needs gmake for tcc's makefile OpenBSD -- http://www.cpantesters.org/cpan/report/bbabfece-0b9e-11e3-8a37-e2882d12fa71 Midnight

Re: [Tinycc-devel] First build reports back for Alien::TinyCC

2013-08-23 Thread David Mertens
id On Fri, Aug 23, 2013 at 4:38 PM, Thomas Preud'homme wrote: > Le vendredi 23 août 2013 14:54:57 David Mertens a écrit : > > Hello everyone - > > > > Useful build reports are coming in. Apparently the recipe is the main > > culprit at the moment, but I wanted t

Re: [Tinycc-devel] Successful Configure/Build, No Output

2013-08-24 Thread David Mertens
I have not encountered trouble on my Mac or Linux box with the configure script. Are *no* object files being produced at all? Does uname -m report i386, or one of x86_64 or amd64? I'm mostly thinking aloud, but I wonder if the build setup might get confused and assume you're building a cross-compi

[Tinycc-devel] Question on Stack Overflow about weird rounding with tcc

2013-08-27 Thread David Mertens
Hey everyone - I found this question from somebody use tcc v0.9.24: http://stackoverflow.com/questions/18417788/pow-cast-to-integer-unexpected-result The basic question is, "Why does tcc's compilation output (100, 99) whereas other compilers output (100, 100)?" #include #include int main(void)

Re: [Tinycc-devel] Successful Configure/Build, No Output

2013-08-28 Thread David Mertens
The more I think about this, the more I'm convinced it's a problem with your system's compiler. The code is right there: "gcc -o some-obj-file.o other-args", yet you don't get the .o file. I don't think tcc's makefile is doing anything behind the scenes to circumvent the system compiler's output.

[Tinycc-devel] Stack Overflow question about jmp

2013-08-29 Thread David Mertens
I've subscribed to the "tcc" filter on Stack Exchange. I highly suggest that others sign up. Questions seem to trickle in, such as this question about the jmp command: http://stackoverflow.com/questions/18517634/tiny-c-compiler-error-unknown-opcode-jmp If people find it useful, I can continue to

Re: [Tinycc-devel] Unable to link a binary on OS X

2013-12-16 Thread David Mertens
Kevin - This would be fantastic to have imho. When using tcc on Mac, I've just used it to run code immediately after compiling, but being able to compile executable binaries on Mac with tcc would be great! Post back when you hit blocking issues in case somebody here has insights. David On Mon,

Re: [Tinycc-devel] Teaching tcc a new language, like c++?

2013-12-16 Thread David Mertens
Kevin - This is likely to be a *very* hard project. Indeed it may be impossible without rewriting a substantial part of tcc. tcc's parser and lexer are written by hand, so you'd have to wrap your head around that. Furthermore, getting proper late-time binding to work would require some pretty soph

Re: [Tinycc-devel] TCC: Best way to release functions that has been compiled in memory?

2014-01-01 Thread David Mertens
Wuzhen (guessing by your latinized email address) - Probably the best way to free compiled, relocated, jit-ed machine code is to provide your own memory allocation for it. This lets you free the memory when you're done with it. If you call tcc_relocate(state, NULL), the return value will be the am

Re: [Tinycc-devel] Implement the dynamic scriptability with custom functions?

2014-01-02 Thread David Mertens
There are two reference implementations for Perl. One is written by Stephen Mueller is similar to Sean's lower-level Lua wrapper: https://metacpan.org/pod/XS::TCC and another, written by me, is a bit more complicated, but also a bit more flexible: https://metacpan.org/pod/C::TinyCompiler David

Re: [Tinycc-devel] State of the tcc project

2014-05-29 Thread David Mertens
Hey jiang, The simplest way to ensure that you don't push low-quality code is to work with your own repository, for example, on github. When you think you have something you would like to contribute, then email this list and ask for a review. Provide a link to your hosted repo and explain what you

Re: [Tinycc-devel] c extensions

2014-05-30 Thread David Mertens
Hey Mobi, Sorry for not responding to this sooner. I have two suggestions. First, if you have not already done so, I recommend reading this book about Object Oriented C . It will likely give you all of the technical background that you need to implement wh

Re: [Tinycc-devel] Why missing #includes don't cause warning/fail?

2014-05-31 Thread David Mertens
I have encountered this behavior before as well. I am pretty sure that the compiler is making a guess as to the form of the function based on how it's called. Then, it links to libc by default, so it is able to link against those functions without trouble. If you enable certain warnings (not sure w

Re: [Tinycc-devel] Request code review

2014-06-02 Thread David Mertens
Hey jiang, Which commits would you like reviewed? I presume that some of these are already merged into mob, so if you just give the date of when you started your latest work, that would be sufficient. For code review sorts of things, it's simplest if you work with feature branches. You can read a

Re: [Tinycc-devel] Request code review

2014-06-03 Thread David Mertens
Hey jiang, I think there's a broader issue at play here involving appropriate communication. I looked for some commentary about this on the internet but could not find it. I know I encountered it somewhere once, but I don't remember. I'll try to state it clearly. *Distributed version systems such

Re: [Tinycc-devel] add tcc uninitialized variable warning

2014-06-05 Thread David Mertens
Hello jiang, Under the assumption that you would like to improve your English skills, I'll try to revise what you wrote to what I think you meant. :-) Continuing with what others have said here, let me make sure I understand your question correctly. You would like to add uninitialized variable wa

Re: [Tinycc-devel] add tcc uninitialized variable warning

2014-06-05 Thread David Mertens
Bah, that sent when it wasn't suppose to... gimme a sec... On Thu, Jun 5, 2014 at 4:55 PM, David Mertens wrote: > Hello jiang, > > Under the assumption that you would like to improve your English skills, > I'll try to revise what you wrote to what I think you meant. :

Re: [Tinycc-devel] add tcc uninitialized variable warning

2014-06-05 Thread David Mertens
Hello jiang, Under the assumption that you would like to improve your English skills, I'll try to revise what you wrote to what I think you meant. My changes are in *bold*. :-) "Hello everyone! I want to add uninitialized variable warning*s to tcc*. *Do y*ou have any good ideas*?* *Please let me

Re: [Tinycc-devel] Request code review, and merge

2014-06-18 Thread David Mertens
Hello jiang, You're request for a code review is a bit premature. You suggested adding uninitialized variable warnings to tcc about a week ago, and managed to solicit some useful feedback. The general consensus seemed to be opposed to adding these warnings. Your next step in this whole process is

Re: [Tinycc-devel] State of the tcc project

2014-06-18 Thread David Mertens
And now lifenjoiner has jumped in, adding patches without discussion. Can we forcibly revert tcc's mob branch at http://repo.or.cz/ back to grishka's commit from 4-17 and cherry pick grishka's and Thomas' commits that were made thereafter? This will cause confusion for anybody who has pulled since

Re: [Tinycc-devel] State of the tcc project

2014-06-22 Thread David Mertens
repo.or.cz? David On Wed, Jun 18, 2014 at 2:31 PM, grischka wrote: > David Mertens wrote: > >> And now lifenjoiner has jumped in, adding patches without discussion. >> >> Can we forcibly revert tcc's mob branch at http://repo.or.cz/ back to >> grishka's com

Re: [Tinycc-devel] Request push

2014-06-22 Thread David Mertens
Hey jiang, For each of these three patches, please explain the following: 1) When run with the version of tcc without your patch, what behavior do you get? What does the C99 spec tell us we should get? 2) How does the proposed patch alter the behavior of tcc? Also, it appears you did not read th

[Tinycc-devel] Mob has been reverted

2014-06-24 Thread David Mertens
Hey everyone, I have pushed a reversion of the mob branch to http://repo.or.cz/ This process involved starting with grishka's commit on April 17, cherry-picking grishka's commit from May 8, and merging the previous state of "mob" (as of June 22) into this new line using the "our" strategy. The "o

Re: [Tinycc-devel] tcc grammar problems

2014-08-01 Thread David Mertens
Sia, That patch is not applied to mob. The whole point of this email thread is that we are discussing the contribution, and helping jiang produce a patch that includes a discussion, meaningful comments, and many small commits. I fail to see how this "direction" for tcc is a bad one. :-) David

[Tinycc-devel] FreeBSD compilation issues

2014-11-05 Thread David Mertens
Hey everyone, I've had a bug filed against the tcc built using my Perl Alien::TinyCC package . The poster claims that tcc cannot build viable executables on FreeBSD. I'm not a FreeBSD user and wouldn't know where to start, but I thought that tcc w

Re: [Tinycc-devel] [PATCH 4/4] tcc.[ch]: Adjust code style.

2014-11-26 Thread David Mertens
Commits that change style should, in my opinion, be completely combined into a single patch. I would prefer if this were merged with the first patch. As for the order of value checking, I do not think this is a good idea. These are classic Yoda Conditions

Re: [Tinycc-devel] [PATCH 2/4] .gitignore: Ignore generated files.

2014-11-26 Thread David Mertens
Looks fine to me. Any other comments? On Wed, Nov 26, 2014 at 3:04 AM, Lee Duhem wrote: > Hi, > > Add more patterns to `.gitignore` to ignore some common > generated files: a.out, *.exe, *.log, and TAGS. > > Sincerely, > lee > > ___ > Tinycc-devel mail

Re: [Tinycc-devel] [PATCH 3/4] Makefile: Add rules to create tags and TAGS.

2014-11-26 Thread David Mertens
I don't use ctags, but I'm sure that those who do would appreciate this. On Wed, Nov 26, 2014 at 3:06 AM, Lee Duhem wrote: > Hi, > > This patch adds rules to create and remove tags files. > > Sincerely, > lee > > ___ > Tinycc-devel mailing list > Tinyc

Re: [Tinycc-devel] [PATCH 1/4] configure: Adjust indentations.

2014-11-26 Thread David Mertens
I don't believe that tcc has a whitespace policy (though it appears that nearly all indentation is with spaces in the C sources, and every once in a while a git mixed tabs+spaces where the tabs look like they are supposed to be eight characters wide). As such, I would suggest minimizing the number

Re: [Tinycc-devel] [PATCH] .gitignore: Ignore Emacs temporary files

2014-12-18 Thread David Mertens
Add it. On Mon, Dec 15, 2014 at 3:40 AM, Lee Duhem wrote: > > Hi, > > This patch adds patterns to .gitignore to ignore Emacs temporary files. > > Sincerely, > lee > > ___ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/m

Re: [Tinycc-devel] [PATCH] libtcc.c (put_extern_sym2): Extend the scope of buf to match its use

2014-12-18 Thread David Mertens
Good catch. I'm not closely acquainted with this particular section of code, but your observation looks correct to me, and the fix looks right. On Mon, Dec 15, 2014 at 3:42 AM, Lee Duhem wrote: > > Hi, > > In `put_extern_sym2', after leaving the code block that `buf' is > defined, `buf' will not

Re: [Tinycc-devel] [PATCH] tcc.h (BufferedFile): Remove unnecessary static memory allocation

2014-12-18 Thread David Mertens
I agree with your interpretation, and fix. For reference, tcc_open_bf is defined in libtcc.c. The two applicable lines are: int buflen = initlen ? initlen : IO_BUF_SIZE; bf = tcc_malloc(sizeof(BufferedFile) + buflen); As presently defined, BufferedFile indicates that its last field is a string wi

Re: [Tinycc-devel] TCC's preprocessor for other use?

2015-01-08 Thread David Mertens
The Perl module Convert::Binary::C ( https://metacpan.org/pod/Convert::Binary::C) uses ucpp: https://code.google.com/p/ucpp/ On Wed, Jan 7, 2015 at 12:42 PM, KHMan wrote: > On 1/8/2015 1:05 AM, Kevin Ingwersen (Ingwie Phoenix) wrote: > >> I am working on a project that involves AngelScript, whic

Re: [Tinycc-devel] Are there any OS X users?

2015-01-09 Thread David Mertens
Hey John, Until about October my primary laptop was a Mac. I had been working with an old checkout of tcc. Back in June I made a commit that reverted a large collection of commits that most of the community deemed inappropriate, and at that time I believe that tcc didn't compile on Mac. I suggest

Re: [Tinycc-devel] README needs fixing?

2015-01-09 Thread David Mertens
I think your latter suggestion is best. After all, older Macs might still need to use gmake, right? David On Fri, Jan 9, 2015 at 6:00 AM, John Smith wrote: > Hi... > > In the README... I see this: > > " > Note: For OSX and FreeBSD, gmake should be used instead of make. > " > > So... I t

Re: [Tinycc-devel] TinyCC REPL

2015-05-13 Thread David Mertens
For what it's worth, I'm working on a fork of TCC that knows how to work with multiple symbol tables . Each line of the REPL would be an independent compilation unit. You would have to hack a little bit, but you could then copy the contents of each single-line sy

Re: [Tinycc-devel] TinyCC REPL

2015-05-13 Thread David Mertens
On Wed, May 13, 2015 at 10:20 AM, Sergey Korshunoff wrote: > Hi David! > > 2015-05-13 14:38 GMT+03:00, David Mertens : > > For what it's worth, I'm working on a fork of TCC that knows how to work > > with multiple symbol tables <https://github.com/run4flat/tin

Re: [Tinycc-devel] TinyCC REPL

2015-05-13 Thread David Mertens
On Wed, May 13, 2015 at 8:50 AM, Joey Payne wrote: > Hi David, > > I may be misunderstanding, but doesn't the current implementation already > have a master symbol table? I was just trying to hack that into giving me > what I want. Do you think it would be easier with your fork? > It does, but I

Re: [Tinycc-devel] TinyCC REPL

2015-05-13 Thread David Mertens
Hey Sergey, I pushed a small fix that includes the ULL suffix for all of those constants. Thanks for pointing that out. I'm so accustomed to working on a 32 bit machine that I hadn't realized I was on 64 bit these days. David On Wed, May 13, 2015 at 12:04 PM, Sergey Korshunoff wrote: > Hi Davi

Re: [Tinycc-devel] TinyCC REPL

2015-05-14 Thread David Mertens
Hello Sergey, On Wed, May 13, 2015 at 6:39 PM, Sergey Korshunoff wrote: > May be a fork of the current tcc with your patches is needed on the > repo.or.cz? > Just for a more public testing? > This fork will eventually see lots of testing via the CPAN Testers when I include it in a Perl module.

Re: [Tinycc-devel] TinyCC REPL

2015-05-14 Thread David Mertens
Hey Sergey, Thanks for this! I am impressed at your efforts! Unfortunately, I think this is a bit premature. I have more work to do on my exsymtab fork before I was going to bring it up for inclusion in tcc itself. (Indeed, I am not entirely sure that it is appropriate for inclusion in tcc.) Here

Re: [Tinycc-devel] TinyCC REPL

2015-05-15 Thread David Mertens
On Thu, May 14, 2015 at 10:39 PM, Jared Maddox wrote: > > Date: Thu, 14 May 2015 09:35:12 -0400 > > From: David Mertens > > To: tinycc-devel@nongnu.org > > Subject: Re: [Tinycc-devel] TinyCC REPL > > Message-ID: > > < > ca+4ieyuvehefrcjyhmnaeq2

Re: [Tinycc-devel] TinyCC REPL

2015-05-18 Thread David Mertens
Sergey, That's a good question. To add the SYM_EXTENDED flag, I took SYM_STRUCT, SYM_FIELD, and SYM_FIRST_ANOM and shifted them down by 1. So, SYM_STRUCT used to be 0x4000. As to whether or not a 32-bit integer can hold it, isn't that constant equivalent to 2^31? Unless I've miscalculated or l

Re: [Tinycc-devel] TinyCC REPL

2015-05-20 Thread David Mertens
Hey Sergey, Good point. I use the expressesion "v < SYM_EXTENDED" and "(v & ~SYM_EXTENDED) == v" interchangeably, as they *mean* the exact same thing for an unsigned integer. I got the idea because inequalities are used with SYM_FIRST_ANOM, so I assumed that inequalities would be safe. I'll fix mi

Re: [Tinycc-devel] OT? old discussion, support for OOP in C

2015-06-27 Thread David Mertens
I've read parts of this book and love it. He describes how to write object-orient C. As far as I would expect, you could read the book and use it as inspiration to write an independent implementation of his ideas without infringing upon his copyright. David On Sat, Jun 27, 2015 at 2:28 PM, Pierpa

Re: [Tinycc-devel] build perl5 with tcc?

2015-07-17 Thread David Mertens
Hey Chris! Nice to see you in the TCC mailing lists as well. :-) Here are a couple of thoughts on your ideas. First, compiling perl5 with tcc will not really give you any of the features of tcc. If it compiles (and it has a decent chance of doing that) It'll just produce a perl binary that runs s

[Tinycc-devel] Types, and references to other types

2015-07-27 Thread David Mertens
Hello everyone, I have been playing with symbol table copying and ran into some trouble with uninitialized pointers. I figured my troubles arose because I didn't fully understand the uses of Sym objects, so I thought I'd read through tcc-doc. While reading I came across references to the .t field

[Tinycc-devel] When does a CType's ref contain a valid pointer?

2015-07-27 Thread David Mertens
Hello everyone, While working on symbol table copying, I have run into trouble copying type.ref pointers that point to garbage. Suppose we have a type struct called "type_to_check". Then I thought the following check would ensure that the .ref field was valid: int btype = type_to_check->type.t &

Re: [Tinycc-devel] When does a CType's ref contain a valid pointer?

2015-07-27 Thread David Mertens
Hey Michael, You are right about my type, I meant to say "int btype = type_to_check.t & VT_BTYPE;" Thanks for the confirmation, I'll start digging around elsewhere in my code. David On Mon, Jul 27, 2015 at 11:52 AM, Michael Matz wrote: > Hi, > > On Mon, 27 J

Re: [Tinycc-devel] RE :Re: RE : [RFC] Moving source code to "src"

2015-07-28 Thread David Mertens
FYI, a good rule of thumb I've seen with other open source projects is that discussion threads should have at least 24 hours of open discussion before any major changes are made. I don't know if tcc has any agreed-upon policy along these lines, but it's not a bad approach. As for my take on the ma

Re: [Tinycc-devel] read32le/write32le

2015-11-18 Thread David Mertens
As I understand it, this patch changes certain bit copying lines. Those which cast their data as integer arrays are now cast as character arrays, and what used to be a single copy operation is now four copy operations. Presumably this would lead to behavior that is more robust and less likely to fa

Re: [Tinycc-devel] Compile .c file to .pyd

2015-11-18 Thread David Mertens
This is hard for me to test, as I work primarily on Linux, and I don't have Python on my Windows machine. Could you try to produce a smaller failing example? David On Tue, Nov 17, 2015 at 8:59 AM, Ahd Abd-Elrazek wrote: > Hi All, > > > I have python 3.4 and i want to compile .c file to .pyd fil

Re: [Tinycc-devel] read32le/write32le

2015-11-18 Thread David Mertens
Cool. I'm more of a tcc user than a compiler hacker, so your answers have made me happy. Looking over the patch, I would say that it *looks* fine, so if we get better behavior with no noticeable slowdowns, it's a good patch. I am far from an authority, though. Anybody else care to comment? David

Re: [Tinycc-devel] Removing the horrible CString hack

2015-11-21 Thread David Mertens
Hello Edmund, and everyone else following this, Here are my thoughts, not as a gate-keeper, but rather in the spirit of peer review. In my own tcc hacking, I have looked closely at the cstring handling in token streams and always found this sort of code troubling: nb_words = (sizeof(CString) +

Re: [Tinycc-devel] Development style

2016-04-18 Thread David Mertens
Hello Michael and Sergey, I have nuked that commit. I'm sorry for altering the history of a public git repository, but that commit was not appropriate, and it's better to fix it quickly now than to live with the consequences or a rash commit. exsymtab is a huge addition to tcc. It should not go i

Re: [Tinycc-devel] Development style

2016-04-18 Thread David Mertens
All, please note step 5 in the committing instructions: 5. Push your changes to here: *"git push ssh://m...@repo.or.cz/srv/git/tinycc.git mypatch:mob"* That is, push your work to a *topic branch*, not the main branch. From thence we can have a discussio

Re: [Tinycc-devel] Development style

2016-04-19 Thread David Mertens
Hello Sergey, This line of yours is symptomatic of a larger problem: On Mon, Apr 18, 2016 at 11:56 PM, Sergey Korshunoff wrote: > PS: all new optimizations will break the patch again and again. How > long I must perform > adoptation by myself? > You might pause and ask yourself why *I* have no

Re: [Tinycc-devel] tcc as compiler for tccboot

2016-04-20 Thread David Mertens
Hello Sergey, That's a good bit of sleuthing. A couple of questions immediately come to mind: - Why does gcc and pcc take 4 as their alignment? Why do we take 32? - Does this have any performance impact? - Is there a reason you are implementing this with #ifdef? Might we use a preproc

Re: [Tinycc-devel] tcc as compiler for tccboot

2016-04-21 Thread David Mertens
Hello Sergey, On Thu, Apr 21, 2016 at 12:44 AM, Sergey Korshunoff wrote: > > That's a good bit of sleuthing. A couple of questions immediately come > to mind: > >Why does gcc and pcc take 4 as their alignment? Why do we take 32? > I'm not a guru. But tcc behaviour cost me a day of the proble

Re: [Tinycc-devel] Development style

2016-04-22 Thread David Mertens
M, Michael Matz wrote: > Hello David, > > On Mon, 18 Apr 2016, David Mertens wrote: > > > I have nuked that commit. > > Thank you for that. (But you haven't yet committed the revert, right?) > > > For time management reasons, my recreational programming

Re: [Tinycc-devel] First kcachegrind output

2016-04-23 Thread David Mertens
@Sergey, If there is an argument to be made for including exsymtab, it would probably be based on these results. It is plausible to use symbol table caching and serializing/deserializing to avoid loading and parsing standard header files. This could potentially reduce compilation times. If you (we

Re: [Tinycc-devel] if (0 == 1) { some_code(); }

2016-04-24 Thread David Mertens
Hello Sergey, Skipping unneeded code, and not even compiling it, could make tcc a bit faster. However, as test 78 indicates, any implementation of tcc that skips blocks will need some logic to detect the presence of labels. For example, if gvtst detected a static value that would be false, it cou

Re: [Tinycc-devel] precompiled headers

2016-04-24 Thread David Mertens
pull requests to merge tcc's updates into my fork, if you have work on that.) David On Sun, Apr 24, 2016 at 4:13 AM, Sergey Korshunoff wrote: > Hi! > > David Mertens wrote: > > If there is an argument to be made for including exsymtab, it would > probably be based on these

Re: [Tinycc-devel] Compilation on Mac

2016-04-24 Thread David Mertens
assaf, Thank you! I am not a travis configuration guru, so this configuration file is very helpful! David On Tue, Apr 19, 2016 at 1:30 PM, Assaf Gordon wrote: > Hello Sergey, > > On 04/19/2016 10:21 AM, Sergey Korshunoff wrote: > >> Is there someone who can help to improve current tcc for Mac?

  1   2   >