summaryrefslogtreecommitdiff
path: root/pypers
diff options
context:
space:
mode:
authormichele.simionato <devnull@localhost>2009-05-21 07:03:46 +0000
committermichele.simionato <devnull@localhost>2009-05-21 07:03:46 +0000
commit118c7190ed604efa6d836d75d5d80c4d68691daa (patch)
treeb822929a326768c74cecc67baa48cd0a4caeb561 /pypers
parent44e47464eeaa102f6c7b1e4de9ed06222ae3bd2b (diff)
downloadmicheles-118c7190ed604efa6d836d75d5d80c4d68691daa.tar.gz
Nearly finished my Scheme talk
Diffstat (limited to 'pypers')
-rw-r--r--pypers/scheme/faccina.jpgbin0 -> 56334 bytes
-rw-r--r--pypers/scheme/joker.jpgbin0 -> 48744 bytes
-rw-r--r--pypers/scheme/mantid.jpgbin0 -> 21440 bytes
-rw-r--r--pypers/scheme/mule.jpgbin0 -> 19525 bytes
-rw-r--r--pypers/scheme/talk.txt100
5 files changed, 42 insertions, 58 deletions
diff --git a/pypers/scheme/faccina.jpg b/pypers/scheme/faccina.jpg
new file mode 100644
index 0000000..291e2fe
--- /dev/null
+++ b/pypers/scheme/faccina.jpg
Binary files differ
diff --git a/pypers/scheme/joker.jpg b/pypers/scheme/joker.jpg
new file mode 100644
index 0000000..47c3017
--- /dev/null
+++ b/pypers/scheme/joker.jpg
Binary files differ
diff --git a/pypers/scheme/mantid.jpg b/pypers/scheme/mantid.jpg
new file mode 100644
index 0000000..89beb01
--- /dev/null
+++ b/pypers/scheme/mantid.jpg
Binary files differ
diff --git a/pypers/scheme/mule.jpg b/pypers/scheme/mule.jpg
new file mode 100644
index 0000000..1c346b1
--- /dev/null
+++ b/pypers/scheme/mule.jpg
Binary files differ
diff --git a/pypers/scheme/talk.txt b/pypers/scheme/talk.txt
index 67c772e..779f330 100644
--- a/pypers/scheme/talk.txt
+++ b/pypers/scheme/talk.txt
@@ -48,7 +48,7 @@ A hobbyist Scheme programmer
- I use Python at work
- I started programming in Scheme 5+ years ago
-- I am writing "The Adventures of a Pythonista in Schemeland" on Artima
+- I am writing "The Adventures of a Pythonista in Schemeland" on Artima.com
- the blog posts will become a book
- I think my experience is relevant for new
R6RS programmers
@@ -56,7 +56,7 @@ A hobbyist Scheme programmer
What I have done in Scheme
--------------------------------------
-- written a module called sweet-macros as sugar over syntax-case
+- written a module called *sweet-macros* as sugar over syntax-case
.. class:: incremental
@@ -70,21 +70,15 @@ Disclaimer
------------------------------------------------
This is as a talk for **macro** writers who want to write
-portable R6RS code. It assumes:
+portable R6RS code. It assumes knowledge of (R5RS) Scheme
+and macros.
-.. class:: incremental
-
- - knowledge of (R5RS) Scheme
- - knowledge of Scheme macros
- - no knowledge of R6RS Scheme
- - no knowledge of the R6RS module system
-
-Part I: no macros or simple macros
+Part I: the easy part
----------------------------------------------------
.. code-block:: scheme
- $ cat my-lib.sls
+ $ cat my-lib.sls # in most R6RS implementations
#!r6rs
(library (my-lib)
(export a b)
@@ -93,7 +87,23 @@ Part I: no macros or simple macros
(define b 0)
(display "my-lib instantiated!\n")
)
+ ;; import it as (import (my-lib))
+ ;; be careful with the names!
+
+Nothing is simple
+------------------------------------------------
+*how to map libraries to the file system is not specified!*
+
+.. class:: incremental
+
+- in PLT ``(import (my-lib))`` does not look at ``my-lib.sls``;
+- it looks at ``my-lib/main.sls`` instead;
+- some implementations understand the ``main.sls`` convention, others not
+- there is not even an SRFI on the topic (but there will be)
+- open issues: multiple libraries in a single file and how to manage
+ multiple versions of the same library
+
Import syntax (I)
--------------------------------------
@@ -121,7 +131,7 @@ Import syntax (I)
Import syntax (II)
----------------------------------------
-There are other easy features
+Other easy features
.. class:: incremental
@@ -142,15 +152,11 @@ There are other easy features
Limitations
----------------------------------------
-- how to map libraries to the file system is not specified
+support for implementation-specific files (.IMPL.sls convention)
+is in its infancy
.. class:: incremental
-- support for implementation-specific files (.IMPL.sls convention)
- is in its infancy
-
-- support for importing a specific version is in fieri
-
- ``(export *)`` not available
+ you must list explicitly all the exported identifiers
@@ -201,7 +207,7 @@ Macro usage
I will show an issue with a second order syntax-rules macro
later on
-Why all the fuss?
+Where is the problem?
-------------------------------------------------
- the most common problem is when you have macro transformers
@@ -217,7 +223,7 @@ Why all the fuss?
.. class:: incremental
-- Why the identifier is not available to the macro?
+- the identifier is not available to the macro!?
Because of phase separation
-------------------------------
@@ -270,7 +276,7 @@ Old Scheme behavior
----------------------------------------------------
Phase separation is a "new" thing; for
-instance Guile 1.8 has not phase separation:
+instance Guile 1.8 has no phase separation:
.. code-block:: scheme
@@ -305,7 +311,7 @@ So everthing is settled, right?
Not really, there are a few R6RS surprises ...
-.. image:: joker_13.jpg
+.. image:: joker.jpg
:width: 300
The R6RS specification is loose
@@ -482,7 +488,9 @@ while porting my ``sweet-macros`` library:
- PLT (3)
- Larceny (1)
-*All fixed within hours!*
+.. class:: incremental
+
+ *All fixed within hours!*
Other difficulties I encountered
------------------------------------------
@@ -492,58 +500,34 @@ Other difficulties I encountered
- I am generating the helper modules required by PLT/Larceny
from the Ikarus/Ypsilon module
-While writing the APS libraries I have found many non-portable
+While writing the APS libraries I have found various non-portable
behaviours:
.. class:: incremental
-- in implementations based on psyntax and in Ypsilon a module
- is visited only if one of its macros is used
+- the number of times a library is instantiated is
+ totally implementation-dependent
More non-portable behavior
----------------------------------------------------
-.. class:: incremental
-
-- in implementations others than PLT, side-effects
- can leak through phases
-
-- the number of times a library is instantiated is
+- the number of times a library is visited is also
totally implementation-dependent
-- it also depends if you are using separate compilation
- or not.
-
-An example:
-
-.. code-block:: scheme
-
- $ cat two-phases.ss
- (import (for (my-lib) expand run))
-
-Different runs
---------------------------------------------
-
-::
-
- $ plt-r6rs two-phases.ss
- my-lib instantiated!
- my-lib instantiated!
+.. class:: incremental
- $ larceny -r6rs -program two-phases.ss
- my-lib instantiated!
+- in implementations based on psyntax and in Ypsilon a module
+ is visited only if one of its macros is used
- $ ypsilon --r6rs two-phases.ss
- my-lib instantiated!
+- in implementations others than PLT, side-effects
+ can leak through phases
- $ ikarus --r6rs-script two-phases.ss
+- all the details in my Adventures
References
------------------------------
-You can find all the details in my Adventures
-
- http://www.artima.com
- http://www.phyast.pitt.edu/~micheles/scheme/TheAdventuresofaPythonistainSchemeland.pdf
- http://www.phyast.pitt.edu/~micheles/scheme/sweet-macros.zip