Coder Social home page Coder Social logo

strogo / cygo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kitech/cygo

0.0 0.0 0.0 1.99 MB

A toy programming language base on Golang and compile to C, no name yet

CMake 0.29% Go 59.34% Nim 3.92% Shell 0.36% Makefile 0.29% C 33.81% C++ 0.45% GDB 0.01% ANTLR 1.52% V 0.02%

cygo's Introduction

Compile Go to C, with a generic library contains Go core features, like goroutine,channel,GC.

That's will generate minimal binary. The farther plan is compile any Go package to C.

The pain of Go

  • Too large binary size
  • Not zero cost call with C
  • Builtin string/array/map no methods
  • Too verbosity error handling, not like the Go2 try error handling proposal

Features

Install

cd $GOPATH
git clone https://github.com/kitech/cygo
cd cygo/bysrc
go build -o cygo

Example

./cygo ./tpkgs/hello
cmake .
make

more examples/tests https://github.com/kitech/cygo/tree/master/bysrc/tpkgs/

Source code structure:

Supported important syntax

  • defer
  • closure
  • select

Todos

  • dynamic stack resize
  • correct and more safe point for GC
  • support more OS/platforms
  • so much to do

Supported original Go packages

  • unsafe
  • errors

资料

cygo's People

Contributors

kitech avatar pwaller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.