views:

577

answers:

18

Like Smalltalk or Lisp?

EDIT

Where control structures are like:

     Java                 Python               
 if( condition ) {     if cond:           
     doSomething           doSomething     
 }                                         

Or

     Java                Python                  
 while( true )  {        while True:            
     print("Hello");        print "Hello"      
 }                                            

And operators

 Java, Python
 1 + 2  // + operator 
 2 * 5  // * op

In Smalltalk ( if I'm correct ) that would be:

condition ifTrue:[
   doSomething
]

True whileTrue:[
   "Hello" print 
]
1 + 2 // + is a method of 1 and the parameter is 2 like 1.add(2) 
2 * 5 // same thing
A: 

D (used in DTrace)?

Eimantas
+2  A: 

What about Logo or more specifically, Turtle Graphics? I'm sure we all remember that, PEN UP, PEN DOWN, FORWARD 10, etc.

SLC
I made my first ever real program in this (or something very similar) :)
Callum Rogers
IIRC, Logo is a dialect of LISP.
rmeador
@SLC: From your link, "Logo provides several common control structures". So I'd say that Logo does not meet the criteria of having no control structures.
Gabe
@Gabe It depends on the version though, the version most people use for turtle graphics simply executes a list of drawing instructions.
SLC
A: 

APT - (Automatic Programmed Tool) used extensively for programming NC machine tools. The language also has no IO capabilities.

Dave
+2  A: 

Forth may qualify, depending on exactly what you mean by "no control structures or operators". Forth may appear to have them, but really they are all just symbols, and the "control structures" and "operators" can be defined (or redefined) by the programmer.

Kristopher Johnson
+7  A: 

how come you've never heard of lisp before?

stereofrog
Depends on exactly what the OP wants. `(if exp1 exp2 exp3)` and `(+ exp1 exp2)` are certainly what I'd call control structures and operators (since in many cases, control structures and operators are just a different name for functions).Lambda calculus with church numerals may be as close to what the OP (may) wants.
Svend
I have, but I don't know if `+` in `(+ 1 2)` is a function or a language-builtin operator. I think as per Svend comment, they are regular functions, I've updated the question to what I mean ( In Smalltalk )
OscarRyz
@Oscar: In Common Lisp, there is a short list of special forms, which are basic things that you otherwise can't do in the language, like `if`. Everything else built of functions, either directly or by use of macros. However, I'd say that `if` is a control structure.
David Thornley
+1  A: 

How about FRACTRAN?

FRACTRAN is a Turing-complete esoteric programming language invented by the mathematician John Conway. A FRACTRAN program is an ordered list of positive fractions together with an initial positive integer input n. The program is run by updating the integer (n) as follows:

  1. for the first fraction f in the list for which nf is an integer, replace n by nf
  2. repeat this rule until no fraction in the list produces an integer when multiplied by n, then halt.

Of course there is an implicit control structure in rule 2.

KennyTM
+7  A: 

You mean without special syntax for achieving the same?

Lots of languages have control structures and operators that are "really" some form of message passing or functional call system that can be redefined. Most "pure" object languages and pure functional languages fit the bill. But they are all still going to have your "+" and some form of code block--including SmallTalk!--so your question is a little misleading.

Plynx
+1  A: 

I'll be first to mention brain** then.

Matt Ellen
-1: The [ and ] commands are conditional control structures.
trinithis
they are not structures they are commands. Otherwise the OP's example of small talk would be invalid.
Matt Ellen
A: 

XSLT (or XSL, some say) has control structures like if and for, but you should generally avoid them and deal with everything by writing rules with the correct level of specificity. So the control structures are there, but are implied by the default thing the translation engine does: apply potentially-recursive rules.

For and if (and some others) do exist, but in many many situations you can and should work around them.

Yar
A: 

So... you're looking for a super-simple language? How about Batch programming? If you have any version of Windows, then you have access to a Batch compiler. It's also more useful than you'd think, since you can carry out basic file functions (copy, rename, make directory, delete file, etc.)

http://www.csulb.edu/~murdock/dosindex.html

Example

  1. Open notepad and make a .Bat file on your Windows box.
  2. Open the .Bat file with notepad
  3. In the first line, type "echo off"
  4. In the second line, type "echo hello world"
  5. In the third line, type "pause"
  6. Save and run the file.

If you're looking for a way to learn some very basic programming, this is a good way to start. (Just be careful with the Delete and Format commands. Don't experiment with those.)

PowerUser
Why do you think that having no control structures and operators would make a language automatically simpler? Actually I think having not those standard syntactic structures, it makes a language a lot harder. So he is obviously not asking for a simple language.
poke
What about FOR, IF, GOTO, and CALL? Aren't those all control structures? And `<`, `>`, and `|` sure look like operators to me.
Gabe
This guy isn't asking for a beginning programming language.. Also, he has 4k rep. I do hope that people just learning their first language can't get rep that easily.
Earlz
@Earlz, Yes, I did see his 4k rep. He didn't explain why he needed it, but I inferred that he was trying to teach his young child how to program.
PowerUser
@Poke, if he was trying to teach his child the concept of programming and making the computer do something by typing commands, then a batch file would be a good way to go. No, you can't get very far with it, hence my statement that this would be a good place to Start.
PowerUser
@Gabe, yes those are control structures, but you don't NEED them to make a beginner's batch file. If he was teaching his kid how to program, then those structures can wait for a later day.
PowerUser
Yes, that's the same argument SLC used for turtle graphics. By that token, though, don't nearly all languages have this property?
Gabe
A: 

How about Whenever?

Programs consist of "to-do list" - a series of statements which are executed in random order. Each statement can contain a prerequisite, which if not fulfilled causes the statement to be deferred until some (random) later time.

David
+2  A: 

The SMITH programming language:

http://esolangs.org/wiki/SMITH

http://catseye.tc/projects/smith/

It has no jumps and is Turing complete. I've also made a Haskell interpreter for this bad boy a few years back.

trinithis
+4  A: 
  1. Assembler

  2. Befunge

Jeremy
+2  A: 

Prolog*

*I cannot be held accountable for any frustration and/or headaches caused by trying to get your head around this technology, nor am I liable for any damages caused by you due to aforementioned conditions including, but not limited to, broken keyboard, punched-in screen and/or head-shaped dents in your desk.

Manos Dilaverakis
+1 heheheh I was once near to a Prolog manual and I thought... mmmhhh maybe tomorrow.
OscarRyz
@Oscar just the wikipedia page scared me away.
Earlz
+1  A: 

In Tcl, there's no control structures; there's just commands and they can all be redefined. Every last one. There's also no operators. Well, except for in expressions, but that's really just an imported foreign syntax that isn't part of the language itself. (We can also import full C or Fortran or just about anything else.)

Donal Fellows
A: 

I'm not entirely clear on the concept, but I think PostScript meets the criteria, although it calls all of its functions operators (the way LISP calls all of its operators functions).

Gabe
+2  A: 
Norman Ramsey
A: 

Makefile syntax doesn't seem to have any operators or control structures. I'd say it's a programming language but it isn't Turing Complete (without extensions to the POSIX standard anyway)

Earlz