curimit / SugarCpp

SugarCpp is a language which can compile to C++11.
135 stars 13 forks source link

Documentation on basic stuff #30

Open K4stor opened 10 years ago

K4stor commented 10 years ago

Hi

I wonder how to install the whole thing ? I mean I checked out the code and compiled it with mono, but I dont have the command line sugarCPP in my system.

Also I tried to do basic things, like call the constructor of the super class how does that work?

Furthermore I kinda expected this to compile :D

import "stdio.h"

[public]
class Point
  Point(x: int, y: int)
    @x = x
    @y = y

  x: int
  y: int

[public]
class AddablePoint : Point
  AddablePoint(x: int, y: int)
    @x = x
    @y = y

  AddablePoint add (p: Point)
    x += p.x
    y += p.y
    return AddablePoint(x,y)

int main()
  AddablePoint point1(2,4)
  AddablePoint point2(3,5)
  AddablePoint point3 = point1.add(point2)
  printf("Hello world!")
ppwwyyxx commented 10 years ago

After compilation, the command line executable shall be at src/SugarCpp.CommandLine/bin/Debug/SugarCpp.CommandLine.exe. You can start to play with it.

SugarCpp is far from complete, it still requires a bunch of features to work as a substitution to C++. Unfortunately its development has now been paused for our lack of time. But any suggestions or contribution is warmly welcome!

K4stor commented 10 years ago

OK, m8. Keep it up !! Its such a great project !