Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: CO2 - proposal for a C like JIT compiler

  1. #1

    CO2 - proposal for a C like JIT compiler


    This mad idea surfaced yesterday: what if C could be embedded in thinBasic? Think of all the C source code out there that could be embedded directly into your project, compiled, assembled and bound to thinBasic variables on the fly?

    The initial idea is to develop a C with built-in Basic style strings and maths, but otherwise conforming to the regular C syntax.

    CO2 will be able to generate Assembly code with bindings to thinBasic variables and some of the FreeBasic runtime functions wherever they are needed.

    The CO2 output will be fed into the Asmosphere of course.

    Another option is to feed the GNU Gas assembler and ld linker for standalone programs.


  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: CO2 - proposal for a C like JIT compiler

    If there is one able to do this, this is you !
    If there will be interaction with script variables ... this will be amazing.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3

    Re: CO2 - proposal for a C like JIT compiler

    Sounds interesting.

  4. #4

    Re: CO2 - proposal for a C like JIT compiler

    Yes very interesting indeed!

    Roberto
    http://www.thinbasic.com

  5. #5

    Re: CO2 - proposal for a C like JIT compiler


    This is a friendly guide to C programming:

    http://www.space.unibe.ch/comp_doc/c_manual/C/cref.html

    As it shows, the language is minuscule, but the syntax can be complex and requires intricate parsing to get the context of each symbol.

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: CO2 - proposal for a C like JIT compiler

    Charles,

    sounds very interesting!
    As a FOR/NEXT booster it could be very interesting, although I must admit I prefer thinBASIC syntax over C.

    I do not ask you anything as I am having a solid Xmas with SSE instructions now, such a incredible power!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7

    Re: CO2 - proposal for a C like JIT compiler


    With the exception of C++, C seems to be one of the hardest languages to parse, but I am intrigued by the way it expresses complex ideas with so few symbols, and why it has come to dominate low level programming. The inner structure of C is mathematically very clean, though there are a few unfortunate botches which have discouraged many people from using it.

    One of the greatest flaws, (which Basic never suffered from), is to disregard strings as a fundamental data type.

    But the Pentium, with its multiple processors and parallelism, surpasses the ability of such languages to use its full potential, so assembly code makes a comeback, and new high level languages will eventually to accommodate this hardware at a more abstract level.

  8. #8

    Re: CO2 - proposal for a C like JIT compiler

    That would be like new Aurora!!!! ;D

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: CO2 - proposal for a C like JIT compiler

    One of the greatest flaws, (which Basic never suffered from), is to disregard strings as a fundamental data type.
    I cannot agree more, this ( and semicolons ) bothers me the most


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10

    Re: CO2 - proposal for a C like JIT compiler


    Just taking a look at the Aurora Forum ( I spy Jose online there!);

    All those semicolons are necessary because C is line insensitive; but I dont think I have seen
    much code where line insensitivity is exploited; It should be possible to make line breaks significant while supporting line continuity for parameters with commas after them; but to preserve compatibility we may have to tolerate them; - {at least they are easier to type than colons;};;;;;

Page 1 of 2 12 LastLast

Similar Threads

  1. Oxygen Compiler Compiler
    By Charles Pegge in forum Programs
    Replies: 11
    Last Post: 17-08-2010, 17:31

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •