Skip to content
View rokath's full-sized avatar
🏠
Working and Learning
🏠
Working and Learning

Block or report rokath

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
rokath/README.md

Hi there 👋

Embedded Programming is my passion

  • Still sticking with C (liking function pointer arrays) in micro-controllers.

My favorite PC language is Go

Why?

  • Go is open source, sponsored, professionally developed and used by Google.
  • Go is a multi-purpose language.
  • Go is object oriented.
    • Go uses composition instead of inheritance - programs get cleaner this way.
  • In Go interfaces are implicit - they need no explicit declaration.
    • This allows clean and simple APIs in your code without unneeded dependencies.
  • Go is easy to learn, to use and gives quick programming success.
  • Go is a compiled language, therefore checks a lot before building the code.
    • You get most errors at compile-time and not at run-time as with scripting languages (like Python). The Go compiler itself is fast. It allows script like usage of Go as well.
    • The Go program execution is fast.
      • Could be about half speed of a well written C program - not relevant for normal use cases. To get an equivalent "well written C programm" takes much longer than getting the Go program for a specific task.
  • Go is a managed language making memory leaks impossible.
    • No explicit memory allocation and free.
  • Go supports slices, a very light array management struct.
  • Go has pointers but no pointer arithmetic, making code more reliable this way.
  • Go is designed to use multi-core machines and single-core ones and allows easy multi-threading and inter-process communication.
    • Concurrent programming using Go rotines and channels allow efficient program structures.
    • Parallel execution allows to use the full multicore power of modern systems easyly.
    • Concurrency is not Parallelism by Rob Pike
  • The auto-formatting as languge part is very comfortable.
    • This allows a bunch of helper tools.
  • A testing environment comes with the language. Fuzzying is supported.
    • Simply create my_test.go files inside your Go package and run go test ./... in the project root.
  • You get a stand-alone runnable without libraries dependencies.
    • No missing library anymore.
    • No install ... before running an executable.
  • Many platforms are supprted, also mobile development.
  • Go has an integrated documentation System.
    • Just add comments to your functions.
  • Easy Visibility control: Packages export UppercaseFunction and hide lowerCaseFunction.
  • Go can use C/C++-code and vice versa, but crossing the border takes time, so avoid that in loops.
  • Compatibility: Legacy Go code runs on new Go versions.
  • Go has generics now.

Disadvantages?

  • Not made for small microcontrollers.
  • Not well suited for fast hard real-time applications on sub-millisecond level because of the stop-the-world garbage collector.
    • BUT: The GC gets better and better with new Go versions AND avoiding that Go uses the heap heavily, avoids GC at all.

More Information

Some Details

Examples

Learning

What I use Go for?

  • The Trice tool is written in Go.
  • Test tools stimulating embedded devices under test.

Pinned Loading

  1. tcobs tcobs Public

    short messages compression with COBS framing using implicit run-length-encoding, optimized for data containing statistically a bit more 0 and FF bytes in a row, as data often carry 16, 32 or 64 bit…

    C 24 1

  2. trice trice Public

    🟢 super fast 🚀 and tiny 🐥 embedded device 𝘾 printf-like trace ✍ code, works also inside ⚡ interrupts ⚡ and real-time PC 💻 logging (trace ID visualization 👀)

    C 517 46

  3. cobs cobs Public

    COBS implementation in Go (Decoder) and C (Encoder & Decoder) with tests.

    Go 4