Lisp is for list processing. Is there a language for wood processing?

The name for Lisp comes from LIS t P processing. Linked lists are the basic data structure of Lisp languages, and Lisp source code itself consists of lists. As a result, Lisp programs can manipulate source code as a data structure (this is called homoconicity).

However, a list is by definition a consistent construction. This encourages us to solve problems using consistent language idioms (algorithms that process one thing at a time and accumulate results). For example, in Lisp, where cons cells are used to implement singly linked lists, the car operation returns the first element of the list, and cdr returns the rest of the list. My vision is a functional language for parallel execution, which breaks down problems into approximately equal subtasks, recursively solves them, and combines sub-problems.

Almost every programming language code is already parsed into trees; is there a homoiconic language like Lisp but with trees as the main data structure? btw, I would call it Treep, for TREE P processing.

Update: an interesting presentation (PDF) from 2009 by Guy Steele on parallel algorithms and data structures, Organization of functional code for parallel execution: or, foldland foldris considered slightly harmful .

+5
source share
8 answers

I do not see the change to be very deep. Lisp, of course, has no problem listing lists on other lists, so it can easily represent trees and algorithms on trees.

Conversely, each list can be considered as a tree of a certain shape (in different ways).

+6
source

Lisp ARE, Lisp - , .

(+ (* 1 3) (* 4 6))

- :

     +
    / \
   /   \
   *   *
  / \ / \
  1 3 4 6

.

(+ 1 2 3)

   +
  /|\
 / | \
1  2  3

, , Lisp - , .

+6

, Lisp cons. , cons-, - , .

cons - , , , ( ). , , ( , n-) . , B- , .

+1

OP, , langauges, parallelism.

DMS Software Reengineering Toolkit - . ( OP), . DMS , , langauge .

DMS parallelism , DMS, langauge, PARLANSE, LISP, .

PARLANSE "" , "" ( , , ). , () () ; , . , " ":

(|| a b c)

" , " (! |...). fork:

(!| step1 a
    step2 b
    step3 (>> step1 step2) c
    step4 (>> step2) d )

, c ( )) a b . PARLANSE , , ( ). parallelism , .

: PARLANSE , , . / .

, , - , . , fork node. " ", . (, , ). parallelism, DMS.

parallelism DSL, DMS, (AG).

AG - , BNF . AG DMS:

   sum = sum + product;
        <<Calculator>>:  sum[0].result = sum[1].result + product.result;

"" (sum [0]) ( [1]) (product.result). ; . DMS AG , .

AGs , , ; DMS , , . ; current-scope , , , .

DMS AG , , , PARLANSE node. AG , . , , root . , PARLANSE - , AG.

DMS AG PARLANSE. ++ 150K DMS AG (, , , ++), 700K SLOC PARLANSE. ( x86) - , , , .

+1

- XSLT. , , ( ) .

0

, , concurrency.

0

( ), , . , , , - :

  • homoiconicity: ( )
  • SmallTalk
  • lexer/parser .
  • ( LLVM)
0

"Lisp" - . , Lisp. , , Cobol " ".

, Lisp ", , . . " " .

ANSI Common Lisp "" " " .

Lisp : ( cdr cons) . : " ((((a . b) . c) . d) . nil) (a b c d) , cons, (anything . nil), (anything), (foo . (bar)) (foo bar).

" ", , , , , , : .. .

Most list-based data structures processed in typical Lisp programs, even if nested, are much deeper in the dimension cdrthan in the dimension car.

0
source

All Articles