Author Topic: Can someone read Smalltalk?  (Read 8169 times)

0 Members and 2 Guests are viewing this topic.

Offline helius

  • Super Contributor
  • ***
  • Posts: 3677
  • Country: us
Re: Can someone read Smalltalk?
« Reply #25 on: March 30, 2017, 06:32:43 pm »
Smalltalk is a dynamic language and so static analysis has limited usefulness. The most dramatic example of this is the become: message, which makes any two objects change places: all references to one now point to the other and vice-versa. This kind of operation is a problem for attempting to prove what is going to happen, although it isn't the only problem; methods can also be added and removed at runtime.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20724
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Can someone read Smalltalk?
« Reply #26 on: March 30, 2017, 07:20:17 pm »
Smalltalk is a dynamic language and so static analysis has limited usefulness. The most dramatic example of this is the become: message, which makes any two objects change places: all references to one now point to the other and vice-versa. This kind of operation is a problem for attempting to prove what is going to happen, although it isn't the only problem; methods can also be added and removed at runtime.

That's all true and relevant, but the limitations of static analysis are much wider than that.

Essentially static analysis of unconstrained programs (e.g. any of the C family) is equivalent to the Halting Problem. And we all know tractable that isn't!

Static analysis can help solve a limited subset of problems in well-defined constrained circumstances.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3677
  • Country: us
Re: Can someone read Smalltalk?
« Reply #27 on: March 30, 2017, 08:00:51 pm »
It seems to work fairly well in languages with inferred, parametric types (the ML family)
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20724
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Can someone read Smalltalk?
« Reply #28 on: March 30, 2017, 09:54:14 pm »
It seems to work fairly well in languages with inferred, parametric types (the ML family)

Not having used *ML nor Haskell, I don't have a valid opinion.  My understanding is that they are specifically designed to enable optimization based on type inferences. I don't understand the constraints nor the consequences. Nonetheless, I presuming they support "objects" in a vaguely Smalltalk sense, I don't see how  they can avoid needing a good GC.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3677
  • Country: us
Re: Can someone read Smalltalk?
« Reply #29 on: March 30, 2017, 10:57:05 pm »
If you have a closed-world assumption (which is not possible in a dynamic language without a lot of careful work, c.f. Dylan's "sealing" operation), you can view the execution environment as a kind of DAG that changes at each program step. Whenever a subgraph gets isolated, it is garbage, and you can reclaim its storage at that point. This was called "compile-time garbage collection" in the Concurrent Clean literature. Basically you need to know the input and output types and the side effects of all the functions in the graph. This is also very similar to Henry Baker's "linear lisp" concept as described in his papers.
In practice, I don't know if this static approach is really an advantage. With a copying GC, you tend to have better cache locality, although the precise point in the computation when tracing happens is less predictable and can have a major impact.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf