<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">hi all,<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">has anyone looked at porting LTTng to <a href="https://en.wikipedia.org/wiki/Go_%28programming_language%29">Go</a> (AKA <a href="https://golang.org/">Golang</a>)?<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Go is a language very similar to C, but it has intrinsic support for concurrency and better memory protection (at the expense of including garbage collection).  its from Google and is pretty hot these days for big data and "web scale" distributed systems.  the similarity to C is not surprising since two of the three authors were also involved in the development of UNIX in at AT&T in the 1970's: Rob Pike and Ken Thompson (Robert Griesemer is the third author).<br><br>Go is able to link with C object files, so implementing support for tracef(3) should not be very difficult. <br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br>but i want to have full support for user-defined tracepoint() events.  that looks to be much trickier since the LTTng tracepoint() functionality relies heavily on (some might say abuses) the C pre-processor, and Go does not have an equivalent of the C pre-processor.  however, i don't see an obvious reason why Go source files that contain tracepoints couldn't be run through the C pre-processor -- except that Go specific LTTng header files would be required.<br><br><a href="https://tour.golang.org/welcome/1">here is an example of "hello, world" in Go</a>.  (note the use of "import" rather then "#include").<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">i've spent more than a few hours looking at the C code generated by the C pre-processor trying to track down exactly why a tracepoint() definition is causing a compiler error, so i think i have an idea of just how hard it would be to development equivalent header files for Go + C pre-processor.  it may be the case that the Go "header files", once developed, would be compiler specific, i.e only work with <a href="https://golang.org/doc/install/gccgo">gccgo</a> (the gcc front-end for Go).<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">anyway, i'm wondering if anybody has attempted this and/or what your thoughts would be.<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">--craig<br></div></div>