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

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
#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
An IDE...

must consists of:
• source code editor
• build automation tools
• a debugger

can consists of:
• intelligent code completion
• a compiler, or an interpreter, or both
• version control system
• various tools to simplify the construction of a graphical user interface
• a class browser
• an object browser
• a class hierarchy diagram
• code can be continuously parsed while it is being edited, providing instant feedback when syntax errors are introduced. That can speed learning a new programming language and its associated libraries.

should not:
• take longer to learn than it takes to manually integrate individual tools
• fence in the developer's creativity.
ComputerScientist
Separate concerns.
#Nile
Guidelines
Each adjective must treat (deal with, handle) exactly one concern.

Do not fear the over-abundance of adjectives; most adjectives of two very similar classes might be the same, but the ones that are not draw the line between them and demonstrate how they are different and separate.
#JSON
Map keys are always strings.
Unification
#characters #ASCII
Whitespace
9 character tabulation
10 line feed*
11 line tabulation
12 form feed
13 carriage return*
32 space

*line endings

MS Windows files use CR+LF as line ending.