4 ms·
> but as soon as you enter a physics-institution anywhere in the world, FORTRAN likely reigns supreme Not at CERN, but it used to be the case. It's C++ now. >
by atilaneves 7y ago
> but as soon as you enter a physics-institution anywhere in the world, FORTRAN likely reigns supreme
Not at CERN, but it used to be the case. It's C++ now.
> It turns out that FORTRAN is a very good match for the way physicists think about their work
I don't even know what this means and I have a PhD in Physics.
> You simply specify what fields you have and what pattern they are written in and the computer takes care of all the reading and writing for you
This is possible in any language with decent reflection.
> and layers upon layers of unnecessary complexity
None of the complexity in C++ is unnecessary. There were, as there are always, trade-offs.
> Go was created explicitly to replace C++, it turned out that the programmers who love C++
IMHO, this is regurgitated nonsense from Rob Pike. What I got from what he wrote on the subject is that he doesn't grok C++ at all. If he did, he wouldn't be surprised that C++ developers didn't flock to Go.
> efficient development of efficient programs
I'm not aware of Go programs that are particularly efficient. I'd also argue against "efficient development".
> there is an elegant practical solution in Go
Elegance is in the eye of the beholder. I don't think pretty much anything in Go is elegant nor possible to be because of the lack of generics. It forces people to write for loops, which is just... mind boggling to me. That alone makes me wonder what kind of Python devs are taking it up.
- majewsky 7y ago> I'm not aware of Go programs that are particularly efficient. Go occupies the same niche as Python, Ruby and JavaScript (server-side business logic). Compared to programs in those languages, Go programs are insanely efficient.
- atilaneves 7y ago> Go occupies the same niche as Python, Ruby and JavaScript (server-side business logic) Is this in a world in which Java and C# never happened?? > Compared to programs in those languages, Go programs are insanely efficient. In other news, compared to walking, bicycles are insanely fast. Also, let's pretend cars don't exist.
- majewsky 7y agoC# only happened in the Microsoft part of the universe for most of its life. Java has a bad reputation because its community appears to favor over-engineered opaque solutions (that whole ProxyAdapterFactorySingletons business). Go pushes a quite different style, favoring explicit bindings over dependency injection. Disclaimer: I write a lot of Go, but I don't have productive experience with C# or Java, except for a semester-long project at university where Spring Boot was mandated. I recall most students having trouble with its implicitness, i.e. they could not build a mental model for why certain changes had certain effects.
- lllr_finger 7y ago> efficient development I think the rationale for that is twofold: that as a static typed language that prefers stack allocation, you can get some very good performance without putting much effort into it, and that it's usually clear what the idiomatic way to accomplish something is. On the latter point, I appreciate golang's simplicity when I need to review other people's code or dig into third party libraries. For the record, I agree with most of what you're saying. I also don't find it elegant, and most developers I know are eager to work in a different language after spending any amount of time in golang. Its benefits come at the expense of expressiveness, and I never thought I'd be doing things like code gen to work around a lack of generics in 2019.
- atilaneves 7y ago> you can get some very good performance Compared to... ? > I appreciate golang's simplicity when I need to review other people's code or dig into third party libraries. See, I don't. Every for loop has to be inspected to see if it's one of the 99.9% cases where it's a map, reduce, or filter. For loops can't be chained. Error handling takes up over half of a function. An algorithm library can't be written because of the lack of generics. Switching to Python, I'd much rather read: [x for x in xs if x % 2 == 0] Than: res = [] for x in xs: if x %2 == 0: res.append(x) 3 lines of boilerplate to do 1 line of work. Pass. Then there's the fact that everything is mutable in Go, so I have to track every and all variables in case they change. All in all, for me, reviewing code written in it is harder, not easier.
- RodgerTheGreat 7y agoIn K, I'd much rather read (~2!)#x (Not (~) modulo 2 (2!) filter (#) of x.) Or perhaps more idiomatically, x@&~2!x (x indexed (@) where (&) not (~) modulo 2 (2!) of x.) Reading a python comprehension requires awkward skipping around, and composing them together is a mess. APL-style uniform precedence is something I wish more languages imitated. Still, anything's better than an endless sea of for loops.
- 7y ago
- TheRealKing 7y agointeresting, I am a physicist and I use (modern 2018 standard) Fortran on a daily basis, the reason being that it perfectly suits my research needs, in particular, for its concise vectorized array-based syntax. For example, to compute the statistical mean of a weighted sample of points, represented by the two vectors Weight and Point, I'd do, mean = sum(Weight*Point) / sum(Weight) where sum() is an intrinsic Fortran function. I am curious to know how this computation would be done in C++?