ComputerScientist
174 subscribers
14 photos
3 files
206 links
▜ The Inventor

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
"Pharo syntax fits on a single postcard."
Impromptu
- is an environment for live coding. It is built around #Scheme.

First appeared: 2005

Temporal recursion
Looping is performed by "temporal recursion", i.e. by having a function asynchronously schedule a future call to itself as its final action.

Though syntactically Scheme-like, it is semantically closer to #C, and is designed for real-time sound synthesis and other computationally heavy tasks. A programmer/performer can create and schedule code for future execution, as well as data events such as notes and graphics objects. It allows audio synthesis and video composition. It is compiled to machine language by #LLVM.
#toWatch

▶️ A Study in Keith

A live coding performance in Impromptu by Andrew Sorensen. The first two minutes (1:56) are silent, while the performer writes the program that will produce the introduction of the piece. From then on, he modifies the code on the fly to evolve the composition.
#Nile
The member operator (.)

Property get
"a.prop":
if a is an object
if local variable prop exists
=> a.prop;
else
=> call(a.type, 'get', prop, a)
else
type = ...
=> call(type, 'get', prop, a)


Method call
"a.meth(args)":
if a is an object
=> call(a.type, meth, a, args)
else
type = ...
=> call(type, meth, a, args)
Reformation versus mutation
• Reform (nurtural versus natural): to alter an instance
• Mutate (deep reformation) (mutable versus immutable): to alter the instance of the type of an instance, i.e. the seed

When a mutation method is applied to an object:
• Mutable: is changed and still occupies the same object address
• Immutable: is itself unchanged, rather returns a reconstructed version of itself where the mutation has taken place

What altering means for:
• Natural: cannot be altered, rather its type is altered
• Nurtural: the set of qualifications are modified

#Nile
Nature
What: what the Child PULLs from its Parent(s)
When: at the moment of conception

Nurture
What: what a Parent PUSHes to its Child(ren)
When: anytime
Soft inheritance
The idea that an organism can pass on characteristics that it has acquired during its lifetime to its offspring.

Hard inheritance
The idea that characteristics of an organism's offspring will not be affected by the actions that the parental organism performs during its lifetime.
Forwarded from ComputerScientist
Immutable objects
An immutable (unchangeable) object is an object whose state cannot be modified after it is created. This is in contrast to a mutable (changeable) object, which can be modified after it is created. Here is how and where they can be useful:

• thread safe
• more secure
• constants initialized both before and after the program is executed.
• when sharing the references of objects, it matters whether the state of an object can vary.
• if an object is known to be immutable, it can be copied simply by making a copy of a reference to it instead of copying the entire object.
#mathematics #Probability_theory
Bayes' theorem
It describes the probability of an event, based on prior knowledge of conditions that might be related to the event.
P(A, B) = P(B, A) * P(A) / P(B) where P(B) != 0

Conditional probability
P(X, Y) is the likelihood of event X occurring given that Y is true.

Marginal distribution
P(X) is the probabilities of observing X independently.
GUI 101
Generality encourages predictablity.
You are programmer material iff during problem solving your mind gravitates towards generalization. See inventor's paradox
“More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity.”
— William Wulf, leader of PQCC
Abstraction means if it works you don't need to know how it works.
Blocks
- are lexical structures that allow many statements to be treated as one. A language that allows blocks and nested blocks, is called block-structured. Blocks are fundamental to #structured programming.

As scopes
Depending on the language, certain distinguished blocks may be treated as lexical scopes; otherwise, identifiers assigned in outer blocks are visible inside inner blocks, unless shadowed.

Syntax
• Free-form
Whitespace only delimits tokens and has no other significance
begin ... end: #ALGOL, #Pascal
{ ... }: #C, #Perl, #JS, #Nile
( keyword ... ): #Lisp

• Off-side rule
Indentation groups blocks of code
e.g. #Python, #Haskell, #Cobra, #CoffeeScript

Limitations
In some languages blocks do not fully support all declarations; for instance many C-derived languages do not permit nested functions.
“Let us conceive, then, of an algebra in which the symbols x, y z etc. admit indifferently of the values 0 and 1, and of these values alone The laws, the axioms, and the processes, of such an Algebra will be identical in their whole extend with the laws, the axioms, and the processes of an Algebra of Logic. Difference of interpretation will alone divide them.
— George Boole
Imagine we had a computer that could design new computers (chips, systems, and software) faster than itself. Would such a computer lead to infinitely fast computers or even computers that were faster than anything humans could ever build? No. It might accelerate the rate of improvements for a while, but in the end there are limits to how big and fast computers can be. We would end up in the same place; we'd just get there a bit faster. There would be no singularity.
What if an AI needed to live inside another computer for 9 months before it was able to self-rewrite?
“He does not want to get involved unless it's absolutely necessary because he thinks people should learn to make their own decisions.”
— Christopher Reeve

Do not get involved unless it's absolutely necessary because AIs should learn to make their own decisions.
“If you have a major success you get decades of hard manual labor - meaning you have to work on the manual.”
#Bjarne_Stroustrup
Guidelines
Let no identifier ever be global