Comments (2)
This project evolved from proof of concept Go to C translator.
The "compiler" related code is in the following directories
gotoc
Contains Go to C translator. It's one of the most horrible and convoluted code I've written in my life. Much worse than the code of my first big Go project from 2010: mymysql.
I was started without any solid knowledge of Go type system and AST. At this time there was no go/type package yet. It evolved rapidly to handle more and more corner cases and still don't handle all well. This is a transitional solution and I prepare to write a real front-end to GCC or LLVM.
egc
The egc (Emgo compiler) uses gotoc to ranslate Go sources to C and uses gcc, ar, ld to compile, archive, link them into packages or executables.
egroot/egc
Contains definitions of basic Go types.
That's all of the strict compiler related code.
There is egroot/src/internal package that is in the middle between compiler and the standard library. It implements basic and architecture dependent things that compiler wants like memcpy, memset, typeinfo, ...
All of the above things are subject to change when real compiler will be created because they are specific to Go to C translation.
There is egroot/runtime that contains things that are architecture and OS dependent. Currently it supports only noos OS. There is also not finished but partially working support for linux.
The code base contains also:
The standard library located in egroot and other packages, examples, etc. located in egpath.
About porting to other targets. I have surprisingly a lot of such proposals from people interested in Emgo and almost any question of using of the current code on supported architectures. It looks a bit like everyone who want to learn and use the real Go will start from porting it to new architecture/OS...
If you are interested in Emgo start to use it, ask concrete question about using it, write something about it and after that you will be more familiar with this project, you will know more its good and weak points and you can start to consider to port it to other targets.
You are absolutely right about the needs of the community. I started to collect things to publish as a wiki page.
I'm waiting for any experience from use of Emgo (these bad and good ones). The link to the article / blog post will be published on Emgo blog. I'm open to articles for the wiki page.
Please analyze the code and ask more questions about Emgo internals. This issue can be used to create the first article about Emgo internals.
from emgo.
See also issue #13
from emgo.
Related Issues (20)
- how could I port it to arm a53 HOT 2
- STM32 WiFi support HOT 2
- ESP8266 HOT 1
- Support for SVD files HOT 4
- how to use xgen HOT 3
- how to use bluetooth protocol stack HOT 4
- how can i use TCP stack? HOT 1
- wasm targets HOT 3
- Question: Whad do you thing about tinygo? HOT 1
- Nucleo l073rz possible ? HOT 1
- windows build linker line too long error
- adding dsi peripheral support HOT 2
- Is it possible to link in C libs, like the STM32F4xxx HAL drivers?
- is it possible to use this for stm32h743bit6 ? HOT 1
- Docs about differences between Emgo and Go? HOT 3
- Generating packages for stm32f030x8 HOT 5
- Does nrf5 ble support hid? HOT 3
- [Question] Steps to capture SWO HOT 2
- Goroutines: undefined reference to `internal$NewTask' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emgo.