Skip to content

Commit

Permalink
scheme: init
Browse files Browse the repository at this point in the history
  • Loading branch information
ii8 committed Oct 29, 2023
1 parent 7abee36 commit e684839
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions Lang.gren.in
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def(Concurrency, concurrency,
Concurrency,
Features geared towards concurrency,
HardwareThreads, Hardware Threads, Synchronization primitives for using multi-threaded CPU capabilities directly,
CallCC, call/cc, Continuations,
Coroutines, Coroutines, «Functions can suspend execution, yield to a scheduler and resume later»,
Actors, Actors, Communicating actors or processes,
STM, STM, Software Transactional Memory,
Expand Down
11 changes: 11 additions & 0 deletions benchmark/helloworld/scheme/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine:latest

RUN apk --no-cache add gcc musl-dev
RUN apk --no-cache add chicken chicken-dev

COPY hello.scm hello.scm
RUN chicken hello.scm -explicit-use
RUN gcc -static -I/usr/include/chicken hello.c -O2 -fomit-frame-pointer -fno-strict-aliasing -o hello -lchicken
RUN strip hello
RUN ./hello
RUN stat -c '"scheme" -> %s' hello > result
2 changes: 2 additions & 0 deletions benchmark/helloworld/scheme/hello.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(import scheme)
(display "Hello, World!\n")
41 changes: 41 additions & 0 deletions lang/scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language = "scheme"
name = "Scheme"
homepage = Just "https://www.scheme.org/"
spec = Formal
status = Active

impl = Standalone
domain = [ GeneralPurpose, Extension ]
platform = [ Linux, Windows, MacOS ]

typing = Dynamic
safety = MemorySafe
mm = AutomaticMM
everything = AList

paradigms = [ Imperative, Functional ]
parallelism = [ ]
features = [ Closures, Macros, MutableState, Reflection, Introspection, Homoiconic ]
concurrency = [ CallCC ]
runtime = [ Stack, Interpreter, GarbageCollector, ErrorHandling, Abstraction, VirtualMachine ]

orthogonality = Impressive
example =
"""
(define (take-eol cs)
(let loop ((c (cs-take cs)))
(unless (eqv? c #\\newline)
(loop (cs-take cs)))))

(define (token-syntax cs)
(let ((c (cs-take cs)))
(call/cc (lambda (ret)
(if (and (eqv? c #\\-) (eqv? (cs-peek cs) #\\-))
(begin (take-eol cs)
(ret 'comment)))
(if (memv c punct-chars)
(string->symbol (string c))
(error (string-append
"unexpected character \\"" (string c)
"\\" at " (cs-pos cs))))))))
"""

0 comments on commit e684839

Please sign in to comment.