Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a22428dddb61994c

Jump to content

// Workers AI · dad joke modeIs Linotte a type of bird? Does it have a fowl temper?

From Wikipedia, the free encyclopedia
Linotte
Paradigmobject-oriented (prototype-based), structured, and imperative
First appeared22 October 2005
Stable release
3.12 Edit this on Wikidata / 31 January 2022; 4 years ago (31 January 2022)
LicenseGNU GPL
Websitelangagelinotte.free.fr

Linotte is an interpreted 4th generation programming language. Linotte's syntax is in French.

Linotte is intentionally simple, as the language's goal is to allow French-speaking people and especially children with little experience in computer science to easily learn programming,[1] with the slogan (in French) "you know how to read a book, so you can write a computer program"[2].

Vocabulary

[edit]

Linotte uses a non-technical vocabulary derived from common French use. Its terms are closer to those used in film or literature, with a program being a book, a variable being an actor, and the screen a canvas. Instead of executing a book, it is read.

The function body starts at French: début, lit.'start'. Keywords that in other languages might be named things "print" or "log" in Linotte are named things like affiche, 'display':

Similarly, a program can demande, or ask, to prompt the user to enter a value.

A book in linotte

[edit]

A book is the backbone of a program written in Linotte, and is represented by a file with the extension « .liv ». The first funciton in a book is the first one read in the book.

Actors and roles

[edit]

To give a certain value a tag or name, one creates an instance of the value in memory, called an actor. Each actor is an object consisting of a value, a name and a role (a type).

The roles in Linotte are:

  • nombre, 'number'
  • texte, 'string'
  • drapeau, 'flag' (boolean)
  • casier, 'array'
  • espèce, 'class'.

Actions

[edit]

An action in Linotte constitutes a verb and one or ore actors. Here are some examples:

demande acteur

acteur vaut 5 * 5

affiche acteur

Example codes

[edit]
 BonjourLeMonde:
   début
     affiche "Bonjour le monde!"

Programming paradigms Linotte supports

[edit]

This paradigm was the first to be implemented and is quick and easy to understand.

spaghetti :
 début
   affiche "I am here."
   va vers second
second :
  début
   affiche "Now I am here!"

Here is an example of the fib function using parameters:


 Fibonacci : 
  a est un nombre
  début
   questionne a sur "Enter a number:" 
   affiche fib(a)
 
 nombre fibo : 	
  * n est un nombre 	
  début
   si n est < 2, retourne n 		
   retourne fib(n-1) + fib(n-2)

French: espèces, lit.'classes' are a relatively complex but powerful type. Here is an example:

espèces
 foot est un nombre
 color est un texte
 meal est un texte
 espèce animal contient foot, color, meal
 
main:
 cat est un animal, foot vaut 4, color vaut "black", meal vaut "mouse"
 début
  affiche meal de chat

Events are attached to graphical components when building a HCI:

globale      
 form est un formulaire, titre vaut "The text box", largeur vaut 400, hauteur vaut 260         
 box est une boite, x vaut 30, y vaut 30, largeur vaut 200, hauteur vaut 100         
 b1 est un bouton, texte vaut "Display text in the table", x vaut 30, y vaut 150         
 l1 est une étiquette, texte vaut "", x vaut 30, y vaut 200         		 

principale :
 début
  ajoute box & b1 & l1 dans form		         
  Fais réagir b1 à "clic souris" pour afficher valeur 		
  tant que 1 != 2, lis 			
   temporise	 		
  ferme  

afficher valeur :
 *b est un bouton 	
 début
  affiche texte de boite 		
  reviens
traitements asynchrone :
 début
  appelle traitement 		
  affiche "Wait 3 seconds" 		
  attends 3 secondes 		
  affiche "End of 3 seconds" 		

traitement :
 début
  attends 1 seconde 		
  affiche "I do not want to wait!" 		
  reviens  

Dynamic web pages development

[edit]

From version 1.2.2 onwards, the concept of weblivre was introduced. It mixes in the same file HTML and Linotte. The latter is integrated into the HTML in a similar style as PHP or Java.

<%action est un ''texte'' %>
<%n est un ''nombre'' %>
<%duration est un ''nombre'' %>
<html>
<head><title>Suite de Syracuse en ligne</title></head>
<body>
<h1>Suite de Syracuse :</h1>
<% 
   demande action 
   si action == "resultat", lis 
      demande n 
      tant que n > 1, lis
		duration vaut duration + 1
		si (n mod 2) == 0, n vaut n / 2
		sinon, n vaut n * 3 + 1
	  ferme		
%>
    The duration of the flight is <%affiche duration%>
    <form action="syracuse.wliv" method="post">
	  <input type="submit" value="Recommencer" />
    </form>	
<% 
   ferme 
   sinon, lis 
%> 
    <form action="syracuse.wliv" method="post">
	  <input type="hidden" name="action" value="resultat" />
	  ''nombre'' de départ : <input type="texte" name="n"  />
	  <input type="submit" value="Calculer la durée" />
    </form>
<% 
   ferme 
%>
</body>
</html>

The Linotte interpreter

[edit]

Linotte is an interpreted language. For now there only exists one available interpreter, free to use. The interpreter is developed in Java with its source code licensed GNU-GPL. There likewise exists versions on Windows, Ubuntu Linux, Fedora Linux, Arch Linux and Framakey USB sticks.

Webonotte

[edit]

The Webonotte is a HTTP server integrated at l'Atelier Linotte based on Jetty. It produces dynamic web pages programmed in Linotte language.

References

[edit]
  1. Éducation nationale (in French), .
  2. "Linotte, algorithms and programming for everyone! (fr)".