mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
Added header comment block.
This commit is contained in:
parent
18d28ba83f
commit
730434bb14
26 changed files with 206 additions and 73 deletions
14
cyclone.scm
14
cyclone.scm
|
@ -1,9 +1,11 @@
|
|||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module contains a front-end for the compiler itself.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains a front-end for the compiler itself.
|
||||
;;;;
|
||||
(import (scheme base)
|
||||
(scheme case-lambda)
|
||||
(scheme eval)
|
||||
|
|
2
gc.c
2
gc.c
|
@ -1,5 +1,7 @@
|
|||
/**
|
||||
* Cyclone Scheme
|
||||
* https://github.com/justinethier/cyclone
|
||||
*
|
||||
* Copyright (c) 2015-2016, Justin Ethier
|
||||
* All rights reserved.
|
||||
*
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2015, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module automatically generates the following files:
|
||||
;;
|
||||
;; - dispatch.c => Used by apply to call native C functions.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module automatically generates the following files:
|
||||
;;;;
|
||||
;;;; - dispatch.c => Used by apply to call native C functions.
|
||||
;;;;
|
||||
(import (scheme base)
|
||||
(scheme file)
|
||||
(scheme write))
|
||||
|
|
14
icyc.scm
14
icyc.scm
|
@ -1,9 +1,11 @@
|
|||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module contains a simple Read-Eval-Print Loop
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains a simple Read-Eval-Print Loop
|
||||
;;;;
|
||||
(import (scheme cyclone common)
|
||||
(scheme base)
|
||||
(scheme char)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/**
|
||||
* Cyclone Scheme
|
||||
* https://github.com/justinethier/cyclone
|
||||
*
|
||||
* Copyright (c) 2014-2016, Justin Ethier
|
||||
* All rights reserved.
|
||||
*
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the base library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme base)
|
||||
;; In the future, may include this here: (include "../srfi/9.scm")
|
||||
(export
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; A case-lambda implementation, based off the one from chibi scheme.
|
||||
;;;;
|
||||
(define-library (scheme case-lambda)
|
||||
(import (scheme base))
|
||||
(export
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the char library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme char)
|
||||
(export
|
||||
char-alphabetic?
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; A stub for the cxr library from r7rs.
|
||||
;;;; At least for now, the actual cxr functions are primitives in the runtime,
|
||||
;;;; so this library does not need to be imported to use them.
|
||||
;;;;
|
||||
(define-library (scheme cxr)
|
||||
(export caaaaar)
|
||||
(begin
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
;;
|
||||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module compiles scheme code to a Cheney-on-the-MTA C runtime.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module compiles scheme code to a Cheney-on-the-MTA C runtime.
|
||||
;;;;
|
||||
(define-library (scheme cyclone cgen)
|
||||
(import (scheme base)
|
||||
(scheme char)
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains definitions used by the compiler and interpreter.
|
||||
;;;;
|
||||
(define-library (scheme cyclone common)
|
||||
(export
|
||||
*Cyc-version-banner*
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
;;
|
||||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module implements r7rs libraries. In our compiler, these are used to
|
||||
;; encapsulate C modules.
|
||||
;;
|
||||
;; Initially, this a quicky-and-dirty (for now) implementation of r7rs libraries.
|
||||
;;
|
||||
;; TODO: go through functions and ensure consistent naming conventions.
|
||||
;; probably should also clean up some of the function names, this is
|
||||
;; not a very clean or nice API at the moment.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module implements r7rs libraries. In our compiler, these are used to
|
||||
;;;; encapsulate C modules.
|
||||
;;;;
|
||||
;;;; Initially, this a quicky-and-dirty (for now) implementation of r7rs libraries.
|
||||
;;;;
|
||||
;;;; TODO: go through functions and ensure consistent naming conventions.
|
||||
;;;; probably should also clean up some of the function names, this is
|
||||
;;;; not a very clean or nice API at the moment.
|
||||
;;;;
|
||||
(define-library (scheme cyclone libraries)
|
||||
(import (scheme base)
|
||||
(scheme read)
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains code to deal with macros.
|
||||
;;;;
|
||||
(define-library (scheme cyclone macros)
|
||||
(import (scheme base)
|
||||
(scheme write) ;; Debug only
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
;;
|
||||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module performs Scheme-to-Scheme transformations, and also contains
|
||||
;; various utility functions used by the compiler.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module performs Scheme-to-Scheme transformations, and also contains
|
||||
;;;; various utility functions used by the compiler.
|
||||
;;;;
|
||||
|
||||
(define-library (scheme cyclone transforms)
|
||||
(import (scheme base)
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
;;
|
||||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2015, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module contains various utility functions.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains various utility functions.
|
||||
;;;;
|
||||
(define-library (scheme cyclone util)
|
||||
(import (scheme base)
|
||||
(scheme char))
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; The Cyclone interpreter, based on the meta-circular evaluator from SICP 4.1:
|
||||
;; http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html#%_sec_4.1
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; The Cyclone interpreter, based on the meta-circular evaluator from SICP 4.1:
|
||||
;;;; http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-26.html#%_sec_4.1
|
||||
;;;;
|
||||
(define-library (scheme eval)
|
||||
(import
|
||||
(scheme cyclone util)
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the file library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme file)
|
||||
(export
|
||||
call-with-input-file
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the inexact library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme inexact)
|
||||
(export
|
||||
acos
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the lazy library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme lazy)
|
||||
(import (scheme base))
|
||||
(export
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the load library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme load)
|
||||
(export
|
||||
load)
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the process-context r7rs.
|
||||
;;;;
|
||||
(define-library (scheme process-context)
|
||||
(export
|
||||
command-line
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
;; Cyclone Scheme
|
||||
;; Copyright (c) 2014, Justin Ethier
|
||||
;; All rights reserved.
|
||||
;;
|
||||
;; This module contains the s-expression parser and supporting functions.
|
||||
;;
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the s-expression parser and supporting functions.
|
||||
;;;;
|
||||
(define-library (scheme read)
|
||||
(import (scheme base)
|
||||
(scheme char))
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the time library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme time)
|
||||
(export
|
||||
current-second
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module contains the write library from r7rs.
|
||||
;;;;
|
||||
(define-library (scheme write)
|
||||
(export
|
||||
display
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This module implements the multithreading API from SRFI 18.
|
||||
;;;;
|
||||
(define-library (srfi 18)
|
||||
(import (scheme base))
|
||||
(export
|
||||
|
|
12
srfi/9.sld
12
srfi/9.sld
|
@ -1,7 +1,11 @@
|
|||
;; TODO: this does not work yet, need (begin) to be able to inject
|
||||
;; define's in its outer scope
|
||||
;;
|
||||
;;; This is based on the implementation of SRFI 9 from chibi scheme
|
||||
;;;; Cyclone Scheme
|
||||
;;;; https://github.com/justinethier/cyclone
|
||||
;;;;
|
||||
;;;; Copyright (c) 2014-2016, Justin Ethier
|
||||
;;;; All rights reserved.
|
||||
;;;;
|
||||
;;;; This is based on the implementation of SRFI 9 from chibi scheme.
|
||||
;;;;
|
||||
(define-library (srfi 9)
|
||||
(export
|
||||
record?
|
||||
|
|
Loading…
Add table
Reference in a new issue