Re: [Au dela du HS et Bruit et Digression] Brainfuck

2003-05-26 Par sujet Nicolas Évrard
* Patrick Percot  [00:30 27/05/03 CEST]: 

Yves Rutschle <[EMAIL PROTECTED]> writes:


On Mon, May 26, 2003 at 06:48:20PM +, François Boisson wrote:
> PS: Tu peux donner une présentation succinte de Brainfuck :-), le nom me
> plait

C'est le langage le plus petit du monde, au point que c'est
presque plus un assembleur pour machine virtuelle qu'un
langage...



Je crois qu'unlambda est encore plus spartiate. 



Mais le pire du pire est atteint par Malbolge :

http://www.mines.edu/students/b/bolmstea/malbolge/

Tellement incompréhensible qu'aucun programme n'a jamais été écrit avec.

Un petit bout du manuel :

  When the interpreter tries to execute a program, it first checks to
  see if the current instruction is a graphical ASCII character (33
  through 126).  If it is, it subtracts 33 from it, adds C to it, mods
  it by 94, then uses the result as an index into the following table
  of 94 characters:
  
  +b(29e*j1VMEKLyC})8&m#~W>qxdRp0wkrUo[D7,XTcA"lI

  [EMAIL PROTECTED]  
  It then checks it against the characters listed below, and performs

  an appropriate action.
  
  If the result is not one of the characters listed below, it is

  treated as a nop.  If the original character is not graphic ASCII,
  the program is immediately ended.
  
  When the interpreter parses the input file, it checks each non-

  whitespace character with the process above.  If any result is not
  one of the eight characters below, the file will be rejected.

  After the instruction is executed, 33 is subtracted from the
  instruction at C, and the result is used as an index in the table
  below.  The new character is then placed at C, and then C is
  incremented.

  5z]&gqtyfr$(we4{WP)H-Zn,[%\3dL+Q;>U!pJS72FhOA1C
  B6v^=I_0/8|jsb9m<.TVac`uY*MK'X~xDl}REokN:#?G"i@


--
Ne postez pas idiot !
Lisez la FAQ : http://savannah.nongnu.org/download/debfr-faq/html/


pgpSO1jvx4SPT.pgp
Description: PGP signature


Re: [Au dela du HS et Bruit et Digression] Brainfuck

2003-05-26 Par sujet Frédéric Bothamy
* Patrick Percot <[EMAIL PROTECTED]> [2003-05-27 00:30] :
> Yves Rutschle <[EMAIL PROTECTED]> writes:
> 
> > On Mon, May 26, 2003 at 06:48:20PM +, François Boisson wrote:
> > > PS: Tu peux donner une présentation succinte de Brainfuck :-), le nom me
> > > plait
> > 
> > C'est le langage le plus petit du monde, au point que c'est
> > presque plus un assembleur pour machine virtuelle qu'un
> > langage...
> > 
> 
> Je crois qu'unlambda est encore plus spartiate. 

Je peux participer aussi ?

Je propose le langage Whitespace (http://compsoc.dur.ac.uk/whitespace/)
et il y a même un paquet Debian ! (comment essayer de se racrocher au
sujet de la ML ... :-))

Fred

-- 
LA FAQ d-u-f ? http://savannah.nongnu.org/download/debfr-faq/html/



Re: [Au dela du HS et Bruit et Digression] Brainfuck

2003-05-26 Par sujet Patrick Percot
Yves Rutschle <[EMAIL PROTECTED]> writes:

> On Mon, May 26, 2003 at 06:48:20PM +, François Boisson wrote:
> > PS: Tu peux donner une présentation succinte de Brainfuck :-), le nom me
> > plait
> 
> C'est le langage le plus petit du monde, au point que c'est
> presque plus un assembleur pour machine virtuelle qu'un
> langage...
> 

Je crois qu'unlambda est encore plus spartiate. 

Quelques avis éclairés sur ce langage :

-It's disgusting - it's revolting - we love it.- CyberTabloid

-Unlambda,  the language  in  which every  program  is an  IOUCC.-
 Encyclopædia Internetica

-The worst thing to  befall us since Intercal.- Computer Languages
 Today

-The effect  of reading  an Unlambda program  is like  habing your
 brains smashed  out by a Lisp  sexp wrapped around  an ENIAC. You
 won't  find  anything  like  it  west  of  Alpha  Centauri.-  The
 Hitch-Hacker's Guide to Programming

À lire absolument, la page d'unlambda. 

http://www.eleves.ens.fr:8080/home/madore/programs/unlambda/


-- 
Groupe Morbihannais d'Utilisateurs de Logiciels Libres http://www.tuxbihan.org
Identifiant Jabber: [EMAIL PROTECTED]

Patrick Percot.



Re: [Au dela du HS et Bruit et Digression] Brainfuck

2003-05-26 Par sujet Yves Rutschle
On Mon, May 26, 2003 at 06:48:20PM +, François Boisson wrote:
> PS: Tu peux donner une présentation succinte de Brainfuck :-), le nom me
> plait

C'est le langage le plus petit du monde, au point que c'est
presque plus un assembleur pour machine virtuelle qu'un
langage...

Donc: Il y a un pointer, qui se déplace dans une mémoire
initialisée à 0. Le programme est consititué d'une suite
d'instructions parmi:

>   incrémente le pointeur  ( ++p )
<   décrémente le pointeur  ( --p )
+   incrémente le pointé( ++*p )
-   décrémente le pointé( --*p )
.   écrit le pointé à l'écran
,   saisit un nombre, l'écrit dans le pointé
[   Saute après le ] correspondant si le pointé est nul
]   Saute au [ correspondant

Un exemple qui écrit les premiers nombres de la suite de
Fibonacci:

+++
>+
><<[>[>>+>
+<<<-]>>>[<<<+>>>-]<[>++[-
<-[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]>[<<[>>>+<<<
-]>>[-]]<<]>>>[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]
>[<<+>>[-]]<<<]>[+
+++.[-]]++<[->-<]>
.[-]<<
<<[>>>+>+-][+-]<-[>>.>.<<<
[-]]<<[>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-]

Formidable!
(version commentée:
http://esoteric.sange.fi/brainfuck/bf-source/prog/fibonacci.txt)

Le langage a été prouvé "Turing-complete", donc on doit
pouvoir réécrire Linux avec... Le plus gros interêt bien sûr
est de résoudre les problèmes de logiques/math qui vont
avec: "Quelle est la plus petite chaine d'instructions pour
créer la constante 5? Et la constante 25?"

5 est facile: +
15: >+[<+>-](à vue de nez... je suis pas spécialiste)

Voilà voilà. "Brainfuck" dans google ne renvoie que des
liens sur ce langage, et pas d'insanités.

Si ça, c'est pas plus facile à apprendre qu'Ocaml... Bien
sûr, il est peut-être plus difficile de faire qqch avec ;)

/Y

-- 
Marbles should be kept together.