Questions tagged [c-minus-minus]

C-- is a C-like programming language designed to be generated by compilers, rather than human programmers.

C-- is a C-like programming language designed to be generated by compilers, rather than written by human programmers.

The idea is to allow a program written in another language to be compiled into C-- source code, which is then converted into machine code by an optimizing C-- compiler. The burden of optimization is shifted entirely on to the C-- backend, allowing compilers to focus exclusively on semantic translation.

8 questions
58
votes
1 answer

How does C-- compare to LLVM?

After learning a bit of how LLVM work I'm really excited about how portable low-level code can be generated and how modular this 'thing' is built. But I discovered today the existence of C-- that seems to share some concepts with LLVM. So I'm…
Alois Cochard
  • 9,812
  • 2
  • 29
  • 30
28
votes
4 answers

LLVM vs. C-- ; how can LLVM fundamentally not be better for Haskell than C--?

I've been excited about LLVM being low enough to model any system, and saw it as promising that Apple was adopting it; but then again Apple doesn't specifically support Haskell; And, some think that Haskell would be better off with C--: That…
dr.addn
  • 423
  • 4
  • 7
13
votes
2 answers

How to extend GHC's Thread State Object

I'd like to add two extra fields of type StgWord32 to the thread state object (TSO). Based on the information I found on the GHC-Wiki and from looking at the source code, I have extended the struct in /includes/rts/storage/TSO.h and changed the…
jev
  • 2,023
  • 1
  • 17
  • 26
7
votes
0 answers

cminusminus x86_64 compiler

I am working on a project which involves doing Program Analysis on Haskell. I thought that it will be good idea to implement Program Analysis on Cminusminus (C--) level. I know that, using ghc, Haskell is first compiled to core then to stg and then…
user7235699
  • 431
  • 2
  • 13
2
votes
3 answers

Flex/Bison: Multiple definition of 'said function'

Since my code is a bit too long, I thought it would be easier to post a github link if anyone is willing to help me and needs the code: https://github.com/Pigums/Cminus-Compiler In cygwin, I run these commands: bison -d step3.y flex step3.fl gcc…
timoleonn
  • 303
  • 1
  • 5
  • 12
0
votes
1 answer

Compiling C-- on Windows XP or Windows 7

How can I compile C-- code on Windows 7 or Windows XP? I want to compile some sample C-- code, but the only compiler available on the language's website is for Linux.
0
votes
0 answers

Send array to function in BACI (C--)

I want to send an array to a function then print all of the elements. I have an error. .LST file is: BACI System: C-- to PCODE Compiler, 16:59 27 Oct 2005 Source file: 1.cm Fri Nov 01 03:16:20 2019 line pc 1 0 2 0 3 …
Hadi
  • 85
  • 1
  • 7
-1
votes
2 answers

Bison/Yacc error: field has incomplete type

I'm trying to make a Cminus compiler and specifically trying to create an AST for it. In my step3.fl file %option noyywrap %{ /* Definitions and statements */ #include "step3.tab.h" //extern YYSTYPE yylval; YYSTYPE yylval; %} ID …
timoleonn
  • 303
  • 1
  • 5
  • 12