Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I believe they have now relaxed this opinion

Or is it that scientific computing is starting to realize that it can benefit from a systems programming language?

Scripting langages are great for exploratory work, but if you want to put to work into production, scripting starts to really show its limitations. There is a reason systems languages exist. There is good reason why they both exist. They are different tools for different jobs.



>Or is it that scientific computing is starting to realize that it can benefit from a systems programming language?

Can't be it, since a huge percentage of scientific computing is done with a scripting language.

A systems programming language is still good for the backend libraries of scientific computing - but Go has zero share of that.


A huge percentage of scientific computing is scripting in nature. It would be silly to use anything other than a scripting language.

But not all. Whether or not it is Go that gets the job, a systems language of some kind would be beneficial in those circumstances.


There are 2 conflicting goals: 1) Having a language in which it is easy to express and try out ideas and 2) Producing fast and safe programs.

A scripting language would seem to be good for the exploratory scientific research, because of that. Whereas when you need to create a performant library that can do heavy crunching with reproducible results on any platform you need the other. The questions is: Do you know what you want to implement, or is that still an open question?


No doubt it starts as an open question and slowly moves towards knowing.

Which isn't really much of a conflict. You can prove out your thoughts in a scripting language, and after the dust has settled you can move the workload to a systems language. Different jobs, different tools.

I guess if you're one of those weird religious types that insist there is only one true God (read: programming language) you might feel conflict, but nobody else cares.


> Different jobs, different tools

And possibly different programmers.

Say your a (non-computer-) scientist. It is not (typically) part of your job to learn Rust or Haskell.

You might want to learn Rust if you are so inclined but many scientists are not.


I'm sure there are exceptions, but generally speaking, do scientists ever really end up working on systems?

Anecdotally, I work with a lot of scientists and they only write scripts. When systems are needed, they hand it off to the development team. Anyone can fumble through scripting, but there is a lot more to think about when building systems, and that's probably not something most scientists want to put effort into – for the same reasons they probably don't want to learn Rust.

Realistically, learning Rust is the easiest part of becoming a systems programmer. But there is little incentive to learn any system language if your workload is always scripting in nature. You are going to, rightfully, reach for a scripting language.


>There are 2 conflicting goals: 1) Having a language in which it is easy to express and try out ideas and 2) Producing fast and safe programs.

Why are they "conflicting"?

Common Lisp could do both quite well.


Because different languages give different focus to different features. I'm not saying there can't be a language that supports multiple goals well, but it's a bit like" Jack of All Trades".


But Go lacks a good FFI story (see CGo discussions), so Go has no hope here.


What are you referring to?

The only active, related discussion I am aware of is about the high call overhead imposed by the gc compiler. Of course, other Go compilers have different calling conventions. tinygo, for example, can call C functions from Go about as fast as C can call C functions. So that isn't really a Go issue, just a specific compiler implementation issue. And as you know (it's in the link!), the Go team themselves maintain two different compilers and pride themselves on Go not being defined by one compiler. To equate gc and Go as being one and the same would be quite faulty.

So obviously you are not talking about that one. What else are people discussing?


>So obviously you are not talking about that one.

Obviously? Not of the above rings obvious to me.

A "specific compiler implementation issue" when said compiler is the compiler that 99% of Go users use, can just as well be called a Go issue.

Whether "the Go team themselves maintain two different compilers and pride themselves on Go not being defined by one compiler" is basically irrelevant in praxtice, since people using/interested in Go predominantly mean and use a specific compiler (unlike with C++ where they might use one of several available compilers equally likely).

>To equate gc and Go as being one and the same would be quite faulty.

No, it would be the most pragmatic thing to do. De jure and de facto and all that.


I appreciate your dedication to reminding us that your original comment was posted without any research or thought, but it remains that the Go project itself, along with other third-parties, provide different FFI solutions so that you can pick the one that best suits your circumstances. There is no one-size-fits-all solution.

99% of Go users don't need an FFI story at all. They can choose a compiler on different merits. If you have an FFI story to consider, then it is logical that you will need to evaluate your choices on different attributes and very well might find that the compiler 99% of users with different problems won't match your own. gc is not ideally suited to FFI. But Go offers compilers that are. This is not a Go problem. Go provides solutions. What you speak of is only a gc thing.

What story do you have for us next? That your neighbourhood restaurant, with a full menu, has no hope because the one dish you tried wasn't to your existing taste – not having it occur to you that other items on the menu might be exactly what you are looking for?


But 99% (probably 100%) of scientific computing users do need FFI, hence why there's no overlap. While there may be other compilers, my impression is most Go devs, and hence most Go libraries, assume you're using the standard golang compiler, and so FFI remains a problem for expanding the Go ecosystem to specific use-cases. I'm not suggesting Go has support scientific computing (in fact, it's likely better for everyone if it doesn't), but it's likely Go will continue to be a non-entity in scientific computing landscape, absent someone throwing loads of money at a specific use-case and effectively locking people in.

It's worth noting that other new languages (e.g. Rust) are being adopted, because they have an reasonable FFI story.


99% of scientific computing tasks are script in nature, so Go is not a good fit anyway. It is decidedly a systems langue, not a scripting language. Different tools for different jobs.

Yes, obviously you can write scripts in a systems language, and systems in a scripting language, but you will have a better time if you write systems in systems languages, and scripts in scripting languages. There is good reason why we make a distinction between the two.

The scientists are almost certainly using Python. If not Python, R or Julia. And that is in large part because these are scripting languages. It is true that amongst the 1% that are systems, Rust has found a place, but it too will never make any serious headway into the scripting realm. It is also a systems language. Different tools for different jobs.


>I appreciate your dedication to reminding us that your original comment was posted without any research or thought

I, on the other hand, don't appreciate the ad hominem. What happened, have manners gone out of style?

Also, what exactly fault do you find with my original comment: that Go isn't really a player in scientific computing. Does your "research or though" suggest otherwise?

>99% of Go users don't need an FFI story at all. They can choose a compiler on different merits.

Users of X don't need Y is a self-fullfilling prophecy when X doesn't offer Y. Languages without Y don't tend to attract users who need Y.

We're also talking about users doing scientific computing here, where the vast majority does need an FFI story.

>gc is not ideally suited to FFI. But Go offers compilers that are. This is not a Go problem. Go provides solutions. What you speak of is only a gc thing.

And gc is 99% of what people understand and use as Go - not gccgo. Unless gc has a good support for certain features, scientific computing ain't gonna happen.

People aren't going to heavily invest in building scientific programming libs interop with Go, when those would just work fast enough in a different less used go compiler as opposed to the mainstream one.

>What story do you have for us next? That your neighbourhood restaurant, with a full menu, has no hope because the one dish you tried wasn't to your existing taste – not having it occur to you that other items on the menu might be exactly what you are looking for?

Yeah, because a different version of a compiler doesn't come with different maturity, different technical tradeoffs, different community using it, different support story, and so on, it's just like "picking another item from a menu".

If that's your understanding of the situation, I can see how your argument would make sense in your mind ("just change the compiler, it's easy").

Using another language as an example: If CPython didn't have a good interop story with scientific libraries, even if PyPy did, "Python" would have gone nowhere in that domain.

And people who can't understand this, would talk all day getting blue in the face about how "it's not a Python problem, it's a CPython problem", as if that would change anything.


> What happened, have manners gone out of style?

Manners are for engagement between people. Forum-going is a solitary activity. Maybe there is a human out there twisting nobs and pulling levers to make the software work, but if so, that's just an implementation detail hidden from the user. If that were replaced with software, I wouldn't notice, or care.

> what exactly fault do you find with my original comment: that Go isn't really a player in scientific computing.

The original contextual comment, not first comment ever written...

> People aren't going to heavily invest in building scientific programming libs interop with Go

They aren't going to invest anyway, as the vast majority of scientific computing tasks are script in nature. Go is decidedly not a scripting language. It isn't trying to be, and doesn't want to be. There were already a number of good languages in the scripting space before Go came along.

This is like lamenting that wrenches aren't winning the race in nail driving dominance. Who cares?


Except what does Go get for ditching the REPL?

It already has a substantial runtime (the usual pain of an REPL)


Not being able to create new code at runtime is a pretty huge freepass for the compiler to implement stuff a certain way.

You can bet the Go compiler and runtime leverage that assumption.


Even without optimizations?


Yes. There are long standing feature requests for (e.g.) the reflect package that simply don't get done because they'd break this assumption and/or force further indirection in hot paths to support "no code generation at runtime, ever".

Packages like Yaegi (that offers an interpreted Go REPL) have "know limitations, won't be addressed" also because of these assumptions.

https://github.com/golang/go/issues/4146

https://github.com/golang/go/issues/16522

https://github.com/traefik/yaegi?tab=readme-ov-file#limitati...


If they wanted an REPL having an interpreted Go compiler isn't unheard of in the space.

It isn't like a hypothetical C++ REPL would use unmodified LLM under the hood after all.


Then just use Yaegi, which I linked to above.

It has the limitations mentioned, which are necessary to make duck-typed interface calls reasonably efficient, if you assume no code generation at runtime, ever.

There's really no other way. If you don't know before hand all the interfaces that might exist, and/or all the types that might implement them, interface method calls would necessarily either need to be JIT generated, or a string based hash map lookup (runtime reflection, which exists, but is slow).

Go avoids both by knowing statically at compile time the list of all interface and the list of all types that can ever possibly implement them and building vtables for those.


What would it gain? REPLs make perfect sense for scripting problems, but when you would you ever use it for systems problems?


often when I am developing systems code or RPC client code, I sit in a REPL and make repeated ad-hoc calls to various functions, building up various bits of state (I started using python long before Jupyter). I find this much more intuitive than writing code, compiling it, executing it, going back to the editor, changing the code, re-running it with something that loads a bunch of data, just so I can answer a question about the runtime behavior of the system I'm working with.


There is certainly something to be said about being able to answer questions about another system by poking at it, but that is a scripting task. You would be better served by a scripting language. And, as it happens, most scripting languages come with REPLs. That is a solved problem that was solved long before Go was ever imagined.

Just because you are building a particular systems program does not mean everything you do has to be a systems problem. And, really, if you don't exactly know what you're building, it is probably too soon to consider any of it a systems problem.


You say systems problems like Go is for embedded work.

Half the things I have seen replaced Python scripts. Seeing what your internal state is after taking X action is exactly what REPLs are good at...


> You say systems problems like Go is for embedded work.

I'm not sure who is talking about embedded work. That didn't come from me. There is nothing in this thread about embedded. Did you accidentally press the wrong reply button?

I say that Go is for systems. Do you think Go is actually designed for scripting? If so, why?

> Half the things I have seen replaced Python scripts

Python is often used to build systems.

Python is a scripting language, yes, but that doesn't mean you can't build systems in it – just as you can build scripts in a systems language. But there are tradeoffs in crossing paths like that. Systems languages will be better for building systems, and scripting languages will be better for building scripts.

Perhaps the applications you speak of are actually systems and that is why developers saw reason to convert them into using a systems language?

> Seeing what your internal state is after taking X action is exactly what REPLs are good at...

Quite good. But that workload is not systems in nature, so why would you ever do that in a systems language? That is a scripting workload. Naturally you would use a scripting language. And, lucky for you, most scripting languages include REPLs out of the box!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: