Hacker News new | ask | show | jobs
by fsloth 3899 days ago
Would Go provide a viable alternative to C++ for numeric and computer graphics 'kind of stuff'? I have no problem with C++ but the better-than-python proclamations got me intrigued.
5 comments

Given that there's a GC and from what I understand(I'm no go expert) limited ways to specify memory layout I'd say no.
I am curious about the limitations around memory layout. Go provides a fair amount of control to the programmer. Fields appear in the order declared in a struct (although potentially padded), structs declared as values, not pointers, are located in memory with the declaring struct and we can have arrays and slices of non-pointer structs they will all be arranged contiguously in memory.

I am not a C/C++ programmer are there more powerful facilities provided in these languages?

Real question, not trying to start a flame war :)

D is a viable alternative for C++; you still get to enjoy near native performance and cleaner FFI compared to Go, without giving up the features of a modern programming language.
Yes. Its always good to read the D success stories.
Also, Nim would be a good fit for those domains. Macros and custom operators allow one to write dsl for numeric and scientific programming, and you have complete control over memory layout. There is a gc, but you can tune it very precisely
I would guess Julia (or D) today, perhaps Rust in the not so distant future. I'm not sure if Go will ever be a good fit if you need really high and/or deterministic performance?
Stick to python- Numba is a python compiler that compiles numerical code to Cuda and LLVM that is faster than Julia (single threaded and multi threaded).