Non RESTful Go elements

Hello,

I am enamored that “Go” sets forward a semi-deterministic system, and seems to embrace the concept of “REST” or in the past “Applicative languages.”

The essential idea is that all information required to create a result is passed on input, and no matter at what time results are meant to be identical.

However, there are functions in “Go” that, if used by a ‘deterministic’ function, can cause input to a function to not result in deterministic output. That is, for identical input, the result of a function is determined by “Go” usages and library functions.

I am trying to categorize these elements in “Go.”

The following are items I have noticed:

Globals
Time
Random number generation, though I do not understand random’s scope
Information from files (much the same as global memory)
Maps, that have randomized order
Local environmental values, such as MAC Address, operating system values, etc.

Naturally, any results from external applications that do not return identical output on identical input.

The concept of “Go” as I read it is to move more to a “RESTful” interface, in which output is based on input only, though naturally there are practical limitations. I would like to categorize functions and capabilities of the language that can yield non-deterministic output of functions on the same input, in order to understand a restricted or augmented “Go” that is fully “RESTful”.

Go has no way to express pureness of a function, neither does assume REST that pureness is involved.

In rest you GET /product/1 today and another time tomorrow, the price changed. So time has been a factor.

Therefore I do not really understand the question.

1 Like

Let’s try this another way.

I want to determine that within “Go” that can cause a different return value based on input data. I’ve identified some.

I’m seeking others. The (older) appropriate terminology is an “Applicative” language, in which the contents of a request contain all information necessary to a subordinate process, along with the software, determines, deterministically, the output. “Go” has many such functions. I’ve identified some that do not behave that way. I’m seeking to identify others.

Certainly, many functions and libraries in “Go” have deterministic outputs from the input. I’m looking for those that do not, in a big sweep of the system. Primarily, things that are unexpected, such as the way MAPs add randomness to the key.

Go has no way to express pureness of a function

Define what you mean by “pureness.”

Pure as in same input, same output, referential transparency and all this stuff that you usually associate to pureness in CS.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.