What is the ‘expression problem’?

Watch this lecture. The idea is that your program is a combination of a datatype and operations over it. The problem asks for an implementation that allows to add new cases of the type and new operations without the need for recompilation of the old modules and keeping static type safety(no casts or runtime type … Read more

What programming language is most like natural language? [closed]

There is a programming language called Inform that, in its most recent incarnation, Inform 7, looks a lot like natural language…in particular, written language. Inform is very specifically for creating text adventure games, but there is no inherent reason that the concepts couldn’t be extended into other realms. Here’s a small snippet of Inform 7 … Read more

What are the practical limitations of a non-turing complete language like Coq?

First, I assume you’ve already heard of the Church-Turing thesis, which states that anything we call “computation” is something that can be done with a Turing machine (or any of the many other equivalent models). So a Turing-complete language is one in which any computation can be expressed. Conversely, a Turing-incomplete language is one in … Read more

What is a ‘thunk’, as used in Scheme or in general?

It is really simple. When you have some computation, like adding 3 to 5, in your program, then creating a thunk of it means not to calculate it directly, but instead create a function with zero arguments that will calculate it when the actual value is needed. (let ((foo (+ 3 5))) ; the calculation … Read more

What is so special about Smalltalk? [closed]

Smalltalk was one of the earliest object-oriented (OO) languages (with others like Simula and Eiffel) and can be said to be extremely “pure” in an OO sense: Everything is an object and objects are only communicated with via the sending of messages No primitives (no ints, booleans etc) No control structures (no for, while, if … Read more

What does composability mean in context of functional programming?

Marcelo Cantos gave a pretty good explanation, but I think it can be made slightly more precise. A type of thing is composable when several instances can be combined in a certain way to produce the same type of thing. Control structure composability. Languages like C make a distinction between expressions, which can be composed … Read more

What is a good example to show to a non-programmer to explain what programming “looks like”? [closed]

BASIC 10 PRINT “Sara is the best” 20 GOTO 10 Update: when I was 12, my cousin (he was 14) brought Turbo Pascal 7.0 and installed it in my computer. He programmed a tic tac toe game from scratch (in BGI mode, for those who know). I watched/observed step by step how a program evolves … Read more

What does “expressive” mean when referring to programming languages?

‘Expressive’ means that it’s easy to write code that’s easy to understand, both for the compiler and for a human reader. Two factors that make for expressiveness: intuitively readable constructs lack of boilerplate code Compare this expressive Groovy, with the less expressive Java eqivalent: 3.times { println ‘Hip hip hooray’ } vs for(int i=0; i<3; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)