Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

scheme for scripting

Name: Anonymous 2012-08-18 17:35

I'm looking a Lisp based scripting language.

I'm looking for 2 thing primarily.

  - Not everything should be based on call-cc (I usually create big messes)
  - Should not depend on a big VM (Clojure I'm looking at you)

is possible [/spoiler]/prog/[/spoiler]

Name: Anonymous 2012-08-18 17:50

javascript

Name: Anonymous 2012-08-18 18:00

SBCL

Name: Anonymous 2012-08-18 18:15

Your own DSL.

Name: Anonymous 2012-08-18 21:08

I do most of my scripting with emacslisp

it's far more powerful than perl or any other language for text processing

you can use buffers as a data structure, and move by word, paragraph, page, line, or whatever. you can transpose, kill, and browse through the kill ring. wow!

Name: Anonymous 2012-08-18 21:33

NewLISP, ChickenScheme, SBCL.

Name: Anonymous 2012-08-18 22:23

>>2
Not LISP based.

Name: OPtimus 2012-08-18 22:35

>>6
don't all scheme base their primitives around call-cc? I want to avoid that as much as possible. I've been bitten by that more than being saved by it.

Name: Anonymous 2012-08-18 23:06

newlisp

Name: Anonymous 2012-08-18 23:12

Shen - http://www.shenlanguage.org/

       _,..-‐''"´ ̄ ̄ `ヽ、   ,..-ァ
    ,. '"´          />'´:::/_)
____,rイ、_ヽ____,.へ、____,.へ__/,イヽ;::::/!
オ、、::::::::::ヽ、r-、__>-r-‐、'":::::::i:::i;イゝ
  ヽ、ヽ::::::!::::i::::::i:::::i  |:::_!_:!::::ハイ::|
  〈Σ>イ::::::ハ__ハ:::|   レ'!,_`!::::,!-!、|
   i::::::::i:::::::i´,.!-ヽ!   ,.-‐!:/ / ,`ヽ、
   :|:::::::i:::::::!〈 l,_.リ      "〈__! / ./ iヽ
    !::::::i:::::::|〃     '_,   ハ、ゝ〈 r_//ヽ.
    !::::::ハ:::::!、    ー'´   ,.イ::/!ヽ二:ン   i
    レ'i:::ハ:::::|_r`>r--r<:// ̄`〈ヽ     |
     レ' ヽヽ/ 7イ、_!__ン i |   /      !
        〈  ';::r/ムヽ-ヽト、  r!     /
        !  〈__イ`ヽ二l:::::`"く-ゝ--‐'" ,. ''二 ヽ.
        |   ';::::i::::::::::::::::::::;>‐-、  //  `ヽヽ.
     ,、-‐‐|   ハ__:::___::::_;:イ 、  , ト,/ /二 ヽ.  ! :!
    / `ヽヽ!    |ー---=ニ! !    |::ハi  `! ! し'
    ! ´ `|    .|:::::::::::::::::i |    |//!  / /
    ヽ、  |     .ト、:::::::::://ト、_____,.|:::!|ヽ、(ノ
     L:ヽくヽ、_____,.イ、__,.//:「二二__7:::l::/
      `ヽ/ ヽ、____ノヽ、__/::7`''ー‐'"!-'"
       〈〈,r'`!_ノ__ノ  ̄ ̄'!、_______,ノ

Name: Anonymous 2012-08-18 23:28

>>10
it's shit right?

Name: Anonymous 2012-08-19 1:38

>>11
It's a Lisp with Haskell's type/category system, partial function evaluation, and has first-class support for sequence calculus, bayesian probability and logic programming, pattern matching, and packrat parsing.

Name: Anonymous 2012-08-19 1:40

>>12
so it's shit with a layer of crap right?

Name: Anonymous 2012-08-19 4:38

>>13
Sounds like you amirite?

Name: Anonymous 2012-08-19 4:49

Liskell = Lisp Syntax + Haskell Semantics

http://www.liskell.org/

Name: Anonymous 2012-08-19 5:24

>>10
Why did you ruin my Sexps?

Name: Anonymous 2012-08-19 5:31

>>1

call/cc is nice but you often have to wrap it to get a more reliable structure.


;; Lazy lists for scheme with generation via continuations


;; llist is a cons cell, with the car being the current
;; element and the cdr being a function that generates
;; the next llist cell.
(define (lcar llis) (car llis))
(define (lcdr llis) ((cdr llis)))

;; Construct a lazy list from a list of evaluated arguments
(define (llist . args)
  (if (null? args)
    '()
    (cons (car args)
          (lambda ()
            (apply llist (cdr args))))))

;; Lazy range
(define (lrange i j)
  (if (> i j)
    '()
    (cons i
          (lambda ()
            (lrange (+ i 1) j)))))


;; Lazy map
(define (lmap1 fn llis)
  (if (null? llis)
    '()
    (cons (fn (lcar llis))
          (lambda ()
            (lmap1 fn (lcdr llis))))))

;; Lazy for-each
(define (lfor-each fn llis)
  (if (null? llis)
    '()
    (begin (fn (lcar llis))
               (lfor-each fn (lcdr llis)))))

;; Lazy range using continuations
(define (crange i j)
  (call/cc (lambda (first-return-c)
    (letrec ((loop (lambda (i consumer)
                     (if (> i j)
                       (consumer '())
                       (loop (+ i 1) (call/cc (lambda (c)
                                                (consumer (cons i
                                                                (lambda ()
                                                                  (call/cc c)))))))))))
   (loop i first-return-c)))))


;; Give consumer a llist whose car contains value and whose cdr will
;; bring control back to the caller of yield and give it the consumer's
;; return continuation.
(define (yield consumer value)
   (call/cc (lambda (this-continuation)
              (consumer (cons value
                              (lambda ()
                                (call/cc this-continuation)))))))

;; Reimplementation of crange using the yield function.
(define (crange2 i j)
  (call/cc (lambda (first-consumer)
    (letrec ((loop (lambda (i consumer)
                     (if (> i j)
                       (consumer '())
                       (loop (+ i 1) (yield consumer i))))))
   (loop i first-consumer)))))


;; Push all elements of rev-lis onto lis in reverse order
(define (push-all rev-lis lis)
  (if (null? rev-lis)
    lis
    (push-all (cdr rev-lis)
              (cons (car rev-lis) lis))))

;; Returns an llist of versions of lis with element
;; inserted into each position in the lis list.
(define (linserted-in-each-spot element lis)
  (call/cc (lambda (first-consumer)
    (letrec ((loop (lambda (rev-lis lis consumer)
                     (if (null? lis)
                        (consumer (llist (reverse (cons element rev-lis))))
                        (loop (cons (car lis) rev-lis)
                              (cdr lis)
                              (yield consumer (push-all (cons element rev-lis) lis)))))))
     (loop '() lis first-consumer)))))

;; Appends a lazy list of lazy lists.
(define (lappend largs)
  (if (null? largs)
    '()
    (call/cc (lambda (first-consumer)
      (letrec ((loop (lambda (llis rest-largs consumer)
                       (cond ((not (null? llis))
                              (loop (lcdr llis)
                                    rest-largs
                                    (yield consumer (lcar llis))))
                             ((not (null? rest-largs))
                              (loop (lcar rest-largs)
                                    (lcdr rest-largs)
                                    consumer))
                             (else
                              (consumer '()))))))
       (loop '() largs first-consumer))))))

;; Returns a llist of all permutations of lis.
(define (permutations lis)
  (cond ((null? lis)
         '())
        ((null? (cdr lis))
         (llist lis))
        (else
         (lappend (lmap1 (lambda (cdr-permutation)
                           (linserted-in-each-spot (car lis) cdr-permutation))
                         (permutations (cdr lis)))))))

Name: Anonymous 2012-08-19 6:04

try pico, relatively straightforward to embed and no LISP syntax.

http://en.wikipedia.org/wiki/Pico_(programming_language)

Name: Anonymous 2012-08-19 8:23

>>18
no LISP syntax
Stopped reading there.

Name: Anonymous 2012-08-19 14:00

>>18
I prefer nano.

Name: Anonymous 2012-08-19 16:30

Tiny, scsh

Don't change these.
Name: Email:
Entire Thread Thread List