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

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
Computer Science is no more about computers than astronomy is about telescopes.
~ #EdsgerDijkstra
“Trees sprout up just about everywhere in computer science.”
#Donald_Knuth
#Programming_paradigms
#Structured
Structured versus non-structured

Non-structured programming
• Historically the earliest programming paradigm capable of creating #Turing_complete algorithms.
• Uses unstructured control flow construct of GoTo which can lead to "spaghetti code" that is potentially difficult to follow and maintain.

Structured programming
• Aims at improving the clarity, quality, and development time.
• Uses structured control flow constructs of choice and repetition, block structures, and subroutines.

Elements
• Control structures: following the structured program theorem, all programs are seen as composed of control structures of sequence, choice, iteration.
• Blocks: enable groups of statements to be treated as one statement.
• Subroutines: are callable units such as procedures, functions, methods, or subprograms are used to allow a sequence to be referred to by a single statement.
• Recursion: a subroutines is executed by repeatedly calling itself until termination conditions are met. While similar in practice to iterations, recursions may be more efficient.
#mathematics #geometry
Plane curve
Parametric equation:
(x, y) = (f(x), g(y))

Examples:
• Straight line
(x, y) = (x0+a*t, y0+b*t)
As a function: y = m*x + c

• Circle
(x, y) = (r*cos(t), r*sin(t))

• Parabola
(x, y) = (t, t^2)

• Ellipse
(x, y) = (a*cos(t), b*sin(t))


Tangent
The tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point.

The line through a pair of infinitely close points on the curve. — #Gottfried_Leibniz

A straight line is a tangent of a curve y = f(x) at x = c if the line passes through the point (c, f(c)) on the curve and has a slope of (derivative(f))(c).
#mathematics #calculus
Derivative
The derivative of a function of a real variable measures the sensitivity to change of the function value (output value) with respect to a change in its argument (input value).

The derivative of a function of a single variable at a chosen input value, when it exists, is the slope of the tangent line to the graph of the function at that point.

The process of computing a derivative is called differentiation. The reverse process is called antidifferentiation. The fundamental theorem of calculus states that antidifferentiation is the same as integration.

Differentiable function
- is a function whose derivative exists at each point in its domain. Its graph has a non-vertical tangent line at each point in its domain, is relatively smooth, and does not contain breaks, bends, or cusps (when a curve suddenly starts to move backwards).

If f is differentiable at x0, then f must also be continuous at x0. In particular, any differentiable function must also be continuous at every point in its domain. The converse does not hold.

Continuous function
- is a function for which sufficiently small changes in the input result in arbitrarily small changes in the output. Otherwise it is discontinuous.

Definition: f is continuous at c if limit(f(x), x approaches c) == f(c).

The function itself is said to be continuous if it is continuous at every point.
#mathematics #geometry
Arc
- is a closed segment of a differentiable curve. A common example in the plane, is a segment of a circle called a circular arc.

Every pair of distinct points on a circle determines two arcs.
#toRead

📚 Program Development by Stepwise Refinement
By #Niklaus_Wirth

http://sunnyday.mit.edu/16.355/wirth-refinement.html
#toRead

📚 If Smalltalk Is So Good Why Does Nobody Use It
#Smalltalk

http://wiki.c2.com/?IfSmalltalkIsSoGoodWhyDoesNobodyUseIt
#language #Haskell
Haskell

First appeared: 1990

Features:
• Purely #functional
• Statically and strongly typed (#Static_typing, #Strong_typing)
#Type_inferring
• Lazy (#Lazy_evaluation)
#pattern_matching
#list_comprehension
• Type classes and type polymorphism (#type_class)
• Concurrent (#concurrency)
• Monads

Monads
Monads are a general framework that can model different kinds of computation, including error handling, nondeterminism, parsing and software transactional memory. Monads are defined as ordinary datatypes, but Haskell provides some syntactic sugar for their use.

Glasgow Haskell Compiler
GHC or Glasgow Haskell Compiler is the most commonly-used Haskell compiler and the main implementation of Haskell. It is open source and provides a cross-platform environment for writing and testing. It supports numerous extensions, libraries, and optimisations that streamline the process of generating and executing code. GHC itself is written in Haskell (#Bootstrapping); but the runtime system which is essential to run programs is written in C and C--.

Front end: (lexer, parser and typechecker)
Preserves as much information about the source as possible until after type inference is complete, to provide clear error messages to users. After type checking, the code is desugared (#syntactic_sugar) into a typed, intermediate language known as "Core".

Simplifier or "middle end":
- is where most of the optimizations are performed as a series of source-to-source transformations in Core code.

Back end:
Transforms Core code into an internal representation of C--. The C-- code can then take one of three routes: it is either printed as C code for compilation with GCC, converted directly into native machine code, or converted to LLVM virtual machine code for compilation with LLVM. In all three cases, the resultant native code is finally linked against the GHC runtime system to produce an executable.

C--
C-- is a #C like programming language, designed to be generated by compilers for very high-level languages rather than written by human programmers. Unlike many other intermediate languages, its representation is plain #ASCII text, not bytecode or another binary format.

C-- is a "portable #assembly language", designed to ease the task of implementing a compiler which produces high quality #machine_code. This is done by having the compiler generate C-- code, delegating the harder work of low-level code generation and optimisation to a C-- compiler.

The C-- type system is deliberately designed to reflect constraints imposed by hardware rather than conventions imposed by higher-level languages. In C-- a value stored in a register or memory may have only one type: bit vector. However, bit vector is a polymorphic type and may come in several widths, e.g., bits8, bits32, or bits64. In addition to the bit-vector type C-- also provides a Boolean type bool, which can be computed by expressions and used for control flow but cannot be stored in a register or in memory. As in an assembly language, any higher type discipline, such as distinctions between signed, unsigned, float, and pointer, is imposed by the C-- operators or other syntactic constructs in the language.
“TBH I had a pretty solid syntax in mind from the beginning.
#Smalltalk was very much the only thing that inspired the syntax at first.

Then I just replaced the unsightly [] for code blocks with {}

And much much later added (\:arg expr)
#TheSemicolon, on syntax development of #Citron
“To improve your high level, improve your low level.”
#Xiawi
Nibble = 4 bits
Embedded system = domain specific computer
“You don't have to be responsible for the world that you're in.”
#John_von_Neumann
“The more ambitious plan may have more chances of success […] provided it is not based on a mere pretension but on some vision of the things beyond those immediately present.”
— Inventor's paradox, George Pólya, How to Solve It
#characters
Multiplication dot
·
Separate concerns.
“REAL DEVS start their indices at 0.”
#TheSemicolon
“It is by logic that we prove, but by intuition that we discover. To know how to criticize is good, to know how to create is better.”
#Henri_Poincaré
“Le savant doit ordonner”
#Henri_Poincaré
#GML
Placeholders
-1 self
-2 other
-3 all
-4 noone
-5 global
-6 ?
-7 local