You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(10) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(20) |
Oct
(5) |
Nov
(2) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(25) |
Feb
(6) |
Mar
(59) |
Apr
(9) |
May
(3) |
Jun
(13) |
Jul
(6) |
Aug
(16) |
Sep
(14) |
Oct
(12) |
Nov
(4) |
Dec
(10) |
2004 |
Jan
(16) |
Feb
(12) |
Mar
(53) |
Apr
(16) |
May
(43) |
Jun
(40) |
Jul
(48) |
Aug
(20) |
Sep
(23) |
Oct
(27) |
Nov
(33) |
Dec
(8) |
2005 |
Jan
(2) |
Feb
(20) |
Mar
(7) |
Apr
(9) |
May
(2) |
Jun
(6) |
Jul
(5) |
Aug
|
Sep
|
Oct
(3) |
Nov
(3) |
Dec
(6) |
2006 |
Jan
(6) |
Feb
(6) |
Mar
(1) |
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
(2) |
2009 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ken A. <kan...@bb...> - 2004-07-02 21:19:14
|
Geoffrey sent me an article on ANTLR, a Java/C++ parser generator. I normally avoid such tools because their manual doesn't fit in my head long enough between uses. Many common parsing problems are little more the lexing, such as tab delimited, fixed with fields, and i have good lexing technology in my head. The problem is i don't have a good parsing approach yet, and i've been waiting a long time. I'd like to use parser combinators but i've never worked on it enough to get a real example working. I have used Mitch Wand's LL1 generator to parse CORBA IDL. But ANTLR got me thinking... 1. What if we could show some examples of using ANTLR and JScheme to get quick little mini languages, or Scheme like languages with alternative syntax, as Tim has been talking about. 2. We could use ANTLR's lexer to generate a llexer and use JScheme to provide the little be more that you need than lexing to your data organized. 3. Use Jscheme lexer in the above item. We aught to be able to take a specification like: Here's a tab separated file. The first line describes the fields. The fields can be int, double, or String, you figure out which. Write me a Java bean that describes each row. Write me a reader that will read such a file and return a Vector of objects. k |
From: Ken A. <kan...@bb...> - 2004-07-02 20:43:44
|
This is Bruce Eckel's weblog: http://www.mindview.net/WebLog He's written books on C++ and Java and now he's writing Python, hates Java's checked exceptions, and likes dynamic typing! We should be able to make good use of his aguments. k |
From: Ken A. <kan...@bb...> - 2004-06-30 20:48:16
|
I've added a src/benchmark/fannkuch directory. This contains the fannkuch benchmark in several languages as well as a performance analysis i did a decade ago. Its a very C favorable benchmark but both Lisp and Java to pretty well at it too, so its a baseline to indicate raw Java power. Needless to say, JScheme does not do well on this benchmark, but it's already lead to some improvements in JScheme. The Bean shell guys have been worried about performance lately - people have stopped using bsh because of performance and other issues. So, i wrote a reflection microbenchmark that we can use to calibrate the JVM and also see how much overhead JScheme adds. |
From: Geoffrey K. <ge...@kn...> - 2004-06-29 15:24:46
|
I tried adding U to the URL to see the source, and was prompted for a password, which I don't have. Actually, I'm glad there's some kind rudimentary security starting to grow. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Jun 29, 2004, at 09:44, Ken Anderson wrote: > OK, i was able to add a page that lists the available jars: > > http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/kanderso/ > classpath.servlet |
From: Ken A. <kan...@bb...> - 2004-06-29 13:44:50
|
OK, i was able to add a page that lists the available jars: http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/kanderso/classpath.servlet You had a nice macro for doing forms, is that available? |
From: Ken A. <kan...@bb...> - 2004-06-28 21:42:05
|
At 05:25 PM 6/28/2004 -0400, Timothy John Hickey wrote: >Just stay in the practice directory and don't do anything >too crazy like redefine "define" ... my students have already done that >... Great! OK, and we'll keep the secret password to ourselves, too. |
From: Ken A. <kan...@bb...> - 2004-06-28 21:37:09
|
I think that both Tim and i measured that using generic functions is about a factor of 3 slower than invoking a JScheme Primitive. Rusty and i have been using java -server in our application and i just did some simple tests that the overhead is between 1.2 and 1.5 which is pretty acceptable. Generally, our application runs 30% faster with -server. So, maybe with -server a purely reflective JScheme woun'd be so bad. It looks like one issue is that Invoke methods have 2 boolean flags, maybe by partial evaluation we can improve the -client version. k |
From: Timothy J. H. <ti...@cs...> - 2004-06-28 21:25:19
|
On Jun 28, 2004, at 5:04 PM, Ken Anderson wrote: > Cool! if you could let us create pages we could all take the course! You certainly can create pages if you want. Just type in the URL of the page you wish was there and add a "U" or a period "." at the end. Adding a "U" at then only works for certain files (e..g htmlU, servletU, appletU, ) whereas adding a "." at the end lets you lift up anything (e.g. jpg, ...) The server will create the page for you if you know the password (which is "jscheme") For example, if you wanted to create a file date.servlet in a folder "kanderso" in the practice directory, you would just visit: http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/kanderso/ date.servletU This will let you create the folder and the file (or let you edit the file if the folder/file already exist). Any jscheme users that want to try should feel free to create their own directory (instead of kanderso) and play around a little. To create an images directory and upload a jpeg you would just visit the file http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/images/dew.jpg. where there is an extra "." at the end of the URL "dew.jpg." but your mail program will probably omit it! There isn't enough of the course online for you to actually take it, but please feel free to use the "U-method" to create some servlets and try it out. Just stay in the practice directory and don't do anything too crazy like redefine "define" ... my students have already done that ... Cheers, ---Tim--- > > k > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Ken A. <kan...@bb...> - 2004-06-28 21:04:30
|
Cool! if you could let us create pages we could all take the course! k |
From: Mitchell W. <wa...@cc...> - 2004-06-28 20:42:41
|
NU Programming Languages Seminar Wednesday, June 30, 2004 Room 366 West Village H (http://www.ccs.neu.edu/home/wand/directions.html) 1:30-3:00 Kanren: A declarative logic programming system Oleg Kiselyov, FNMOC Kanren is a declarative logic programming system with first-class relations embedded in a pure functional subset of Scheme. The system has true unions, fair scheduling, lexically-scoped logical variables, set-theoretical semantics, and high performance without cuts. The talk will present the main ideas of Kanren and focus on the proof of the mirror theorem, which may be stated (in pseudocode, not Kanren!) as: <pre> if (mirror nil) = nil (mirror (cons a d)) = (cons (mirror d) (mirror a)) then (mirror (mirror l)) = l </pre> Upcoming Events: No events scheduled. Want to volunteer? --Mitch _______________________________________________ pl-seminar mailing list pl-...@li... https://lists.ccs.neu.edu/bin/listinfo/pl-seminar |
From: Geoffrey K. <ge...@kn...> - 2004-06-26 21:36:58
|
On Jun 26, 2004, at 10:01, Timothy John Hickey wrote: > The students can view the file by adding a "V" to the suffix: > http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/demo1.servletV Now that is slick! Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk |
From: Timothy J. H. <tim...@ma...> - 2004-06-26 14:01:06
|
I thought the JScheme Users might be interested in seeing how I teach JScheme servlets in my Intro to Computers classes. I've prepared some example links you can click on to get a quick feel for how the novice web development environment works. These are links into the current Summer School class website, so if you want to play around writing some servlets please put them in the following folder: http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/ QUICK INTRO TO JSCHEME SERVLET ENVIRONMENT The idea is that the students write Scheme programs ending in .servlet and the server then evaluates these programs returning the result to the browser, e.g. http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/demo1.servlet returns the date/time/IP/OS and other info. The students can view the file by adding a "V" to the suffix: http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/demo1.servletV This allows students to look at other students code (just as they can look at other students HTML using the "View Source" menu item. When the students need to edit the file, they type a "." at the end of the name and are prompted for the password (in this case it is "jscheme") http://tat.cs.brandeis.edu:8090/sum04/cs2a/practice/demo1.servlet. which brings them to a page that allows them to view/edit/save the servlet code. Changes to the code result in the original code being stored in a backup directory. http://tat.cs.brandeis.edu:8090/sum04/backup/sum04/cs2a You can see the code for validating here http://tat.cs.brandeis.edu:8090/sum04/lib/schemevalidate.servletV and the code for editing here http://tat.cs.brandeis.edu:8090/sum04/lib/umethod/umethod.servletV This is clearly not a secure system so we run the server on an isolated network and don't store any sensitive data on it (e.g. no grades, credit cards, etc.) It could be made more secure, but that s a later project Notes on how to write JScheme servlets are here http://tat.cs.brandeis.edu:8090/cs2asum04/lectures/L6.html?printable=yes but are being revised this summer. The long term goal is to design a variant of Scheme, a curriculum, and an environment so that web programming can become a standard part of the undergraduate experience. Comments/suggestions welcome. ---Tim--- |
From: Ken A. <kan...@bb...> - 2004-06-25 01:56:29
|
Yes a snippets page would be good. I've started collecting the hacks i've sent out as email. I think they should be examples of real code we've needed to use. elf/ and using/ are mostly that. I use them every day. Developing JScheme idioms is important because it really sets JScheme programming apart from Java programming. I've been doing a lot of gui development, i don't have the idiom right yet, but its nice to know you can develop a Java gui without writing a class, or compiling anything, and can change the behavior on the fly. I couldn't tell how the new parameter in the servlet is being used!? At 08:33 PM 6/24/2004 -0400, Timothy John Hickey wrote: >Nice example! > >Maybe we should create a webpage of Jscheme snippets on the >jscheme.sourceforge.net site. >This one could be titled something like > > * generate a sort list of selected fields from tab-separated file of >records... And we should say where to get such data. Geoffrey had the same data i did because we are working on projects related to aviation. >Here's an example I wrote today. >Its a servlet that generates a webpage showing all of the symbols that >are defined > >If you call it with a "which" parameters, e.g. > show_bindings.servlet?new >it will filter out all of the primitives, all of the javadot, and all >those symbols defined in elf/basic.scm > >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >;;; show_bindings.servlet >(servlet (new) > (define js (jscheme.JScheme.)) > (define mod (.eval js '(use-module "elf/basic.scm"))) > > (define (getBindings env) (.rep$# env)) > (define jsenv (.INTERACTION_ENVIRONMENT$ (.evaluator$# js))) > > (define primitives > (getBindings jsenv)) > (define currentbindings > (getBindings (.INTERACTION_ENVIRONMENT$ >(jsint.Scheme.currentEvaluator)))) > > (define newbindings > (filter > (lambda(x) > (or (equal? which #null) > (and > (equal? #null (.get primitives x)) > (= -1 (.indexOf (.toString x) ".")) ))) > (map* (lambda(x) x) (.keys currentbindings)))) > > (define (show-bindings) > {<ol>[ > (map* > (lambda(x){<li>[x] </li>\n}) > (sort newbindings (comparator string<? .toString))) > ] > </ol>}) > >(show-bindings) >) >;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > >This is somewhat fragile code however since it uses the jsint package >and things may change >more rapidly in jsint than in jscheme (witness the disappearance of >jsint.Version.java!) > >---Tim--- > >On Jun 23, 2004, at 7:10 PM, Ken Anderson wrote: > >>I wrote this piece of code today and it struck me: >> >>(define (readCountryData) >> (sort >> (remove-duplicates >> (readingTabData >> (File. "../dafif/Dafift/AppC/appc_cc_icao.txt") >> (lambda (country country_name icao_rgn usage) >> (list country country_name)))) >> (comparator string<? car))) >> >>(define (readingTabData file f) >> (map* (lambda (r) (apply f (vector->list (.split r "\t")))) >> (BufferedReader. (FileReader. file)))) >> >>Now, this code can be improved in a lot of ways, but it did what i >>wanted - grind over a tab separated file, extract the fields i wanted, >>and sort the result. It also abstracted out readinging from a tab >>separated file so it can be resused. >> >>While you might argue that i should have produced an iterator to be >>Java compatible, to do it in Java, you'd need an interface with >>methods call and apply, and each of the 4 loops would require at least >>50% more lines of code. >> >> >> >>------------------------------------------------------- >>This SF.Net email sponsored by Black Hat Briefings & Training. >>Attend Black Hat Briefings & Training, Las Vegas July 24-29 - >>digital self defense, top technical experts, no vendor pitches, >>unmatched networking opportunities. Visit www.blackhat.com >>_______________________________________________ >>Jscheme-user mailing list >>Jsc...@li... >>https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Timothy J. H. <tim...@ma...> - 2004-06-25 00:34:18
|
Nice example! Maybe we should create a webpage of Jscheme snippets on the jscheme.sourceforge.net site. This one could be titled something like * generate a sort list of selected fields from tab-separated file of records... Here's an example I wrote today. Its a servlet that generates a webpage showing all of the symbols that are defined If you call it with a "which" parameters, e.g. show_bindings.servlet?new it will filter out all of the primitives, all of the javadot, and all those symbols defined in elf/basic.scm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; show_bindings.servlet (servlet (new) (define js (jscheme.JScheme.)) (define mod (.eval js '(use-module "elf/basic.scm"))) (define (getBindings env) (.rep$# env)) (define jsenv (.INTERACTION_ENVIRONMENT$ (.evaluator$# js))) (define primitives (getBindings jsenv)) (define currentbindings (getBindings (.INTERACTION_ENVIRONMENT$ (jsint.Scheme.currentEvaluator)))) (define newbindings (filter (lambda(x) (or (equal? which #null) (and (equal? #null (.get primitives x)) (= -1 (.indexOf (.toString x) ".")) ))) (map* (lambda(x) x) (.keys currentbindings)))) (define (show-bindings) {<ol>[ (map* (lambda(x){<li>[x] </li>\n}) (sort newbindings (comparator string<? .toString))) ] </ol>}) (show-bindings) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; This is somewhat fragile code however since it uses the jsint package and things may change more rapidly in jsint than in jscheme (witness the disappearance of jsint.Version.java!) ---Tim--- On Jun 23, 2004, at 7:10 PM, Ken Anderson wrote: > I wrote this piece of code today and it struck me: > > (define (readCountryData) > (sort > (remove-duplicates > (readingTabData > (File. "../dafif/Dafift/AppC/appc_cc_icao.txt") > (lambda (country country_name icao_rgn usage) > (list country country_name)))) > (comparator string<? car))) > > (define (readingTabData file f) > (map* (lambda (r) (apply f (vector->list (.split r "\t")))) > (BufferedReader. (FileReader. file)))) > > Now, this code can be improved in a lot of ways, but it did what i > wanted - grind over a tab separated file, extract the fields i wanted, > and sort the result. It also abstracted out readinging from a tab > separated file so it can be resused. > > While you might argue that i should have produced an iterator to be > Java compatible, to do it in Java, you'd need an interface with > methods call and apply, and each of the 4 loops would require at least > 50% more lines of code. > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Ken A. <kan...@bb...> - 2004-06-24 19:33:16
|
Nice. I have a JScheme map layer i could send you. k At 02:28 PM 6/24/2004 -0400, Geoffrey Knauth wrote: >Here's a way I start OpenMap using JScheme in Emacs. > >M-x openmap-jscheme > >(import "com.bbn.openmap.app.OpenMap") >(define om (OpenMap.)) >(define mh (.getMapHandler om)) > >; see everything the MapHandler is handling >(.getAll mh java.lang.Object.class) > >; get the mapbean so we can manipulate OpenMap >(define omb (.getAll mh com.bbn.openmap.BufferedLayerMapBean.class)) > >Geoffrey >-- >Geoffrey S. Knauth | http://knauth.org/gsk > >----- jscheme.el ----- > >(defvar jscheme-jar > "/Users/gknauth/test/jscheme/jscheme/lib/jscheme.jar") > >(defun jscheme (classpath) > "Start up *scheme* buffer with JScheme. >User can set CLASSPATH or leave it blank. >JScheme version used is value of `jscheme-jar'." > (interactive "sClasspath? ") > (let ((invocation (concat "java " > (if (> (length classpath) 0) (concat "-cp " classpath " ") "") > (if (> (length jscheme-jar) 0) (concat "-jar " jscheme-jar) "")))) > (run-scheme invocation))) > >(defun openmap-jscheme () > "Start up *scheme* buffer with OpenMap under JScheme control. >JScheme version used is value of `jscheme-jar'." > (interactive) > (let* ((memory-arg "-Xmx512m") > (openmap-dir "/Users/gknauth/test/openmap/openmap-4.6") > (classpath > (concat jscheme-jar > ":" openmap-dir "/classes/openmap" > ":" openmap-dir "/classes/omcorba_vb" > ":" openmap-dir "/lib/omcorba.jar" > ":" openmap-dir "/lib/omj3d.jar" > ":" openmap-dir "/lib/openmap.jar" > ":" openmap-dir > ":" openmap-dir "/share" > ":" "/Users/gknauth/test/geo/geo.jar")) > (openmap-args > (concat "-Dopenmap.configDir=" openmap-dir "/share" > " -Ddebug.showprogress")) > (invocation > (concat > "java " > (if (> (length memory-arg) 0) (concat memory-arg " ") "") > (if (> (length classpath) 0) (concat "-cp " classpath " ") "") > (if (> (length openmap-args) 0) (concat openmap-args " ") "") > "jscheme.REPL"))) > (run-scheme invocation))) > >(defun jscheme-echo () > "Do this in your *scheme* buffer to make sure your commands get echoed." > (interactive) > (setq comint-process-echoes nil)) > > > >------------------------------------------------------- >This SF.Net email sponsored by Black Hat Briefings & Training. >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Geoffrey K. <ge...@kn...> - 2004-06-24 18:28:45
|
Here's a way I start OpenMap using JScheme in Emacs. M-x openmap-jscheme (import "com.bbn.openmap.app.OpenMap") (define om (OpenMap.)) (define mh (.getMapHandler om)) ; see everything the MapHandler is handling (.getAll mh java.lang.Object.class) ; get the mapbean so we can manipulate OpenMap (define omb (.getAll mh com.bbn.openmap.BufferedLayerMapBean.class)) Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk ----- jscheme.el ----- (defvar jscheme-jar "/Users/gknauth/test/jscheme/jscheme/lib/jscheme.jar") (defun jscheme (classpath) "Start up *scheme* buffer with JScheme. User can set CLASSPATH or leave it blank. JScheme version used is value of `jscheme-jar'." (interactive "sClasspath? ") (let ((invocation (concat "java " (if (> (length classpath) 0) (concat "-cp " classpath " ") "") (if (> (length jscheme-jar) 0) (concat "-jar " jscheme-jar) "")))) (run-scheme invocation))) (defun openmap-jscheme () "Start up *scheme* buffer with OpenMap under JScheme control. JScheme version used is value of `jscheme-jar'." (interactive) (let* ((memory-arg "-Xmx512m") (openmap-dir "/Users/gknauth/test/openmap/openmap-4.6") (classpath (concat jscheme-jar ":" openmap-dir "/classes/openmap" ":" openmap-dir "/classes/omcorba_vb" ":" openmap-dir "/lib/omcorba.jar" ":" openmap-dir "/lib/omj3d.jar" ":" openmap-dir "/lib/openmap.jar" ":" openmap-dir ":" openmap-dir "/share" ":" "/Users/gknauth/test/geo/geo.jar")) (openmap-args (concat "-Dopenmap.configDir=" openmap-dir "/share" " -Ddebug.showprogress")) (invocation (concat "java " (if (> (length memory-arg) 0) (concat memory-arg " ") "") (if (> (length classpath) 0) (concat "-cp " classpath " ") "") (if (> (length openmap-args) 0) (concat openmap-args " ") "") "jscheme.REPL"))) (run-scheme invocation))) (defun jscheme-echo () "Do this in your *scheme* buffer to make sure your commands get echoed." (interactive) (setq comint-process-echoes nil)) |
From: Ken A. <kan...@bb...> - 2004-06-23 23:10:35
|
I wrote this piece of code today and it struck me: (define (readCountryData) (sort (remove-duplicates (readingTabData (File. "../dafif/Dafift/AppC/appc_cc_icao.txt") (lambda (country country_name icao_rgn usage) (list country country_name)))) (comparator string<? car))) (define (readingTabData file f) (map* (lambda (r) (apply f (vector->list (.split r "\t")))) (BufferedReader. (FileReader. file)))) Now, this code can be improved in a lot of ways, but it did what i wanted - grind over a tab separated file, extract the fields i wanted, and sort the result. It also abstracted out readinging from a tab separated file so it can be resused. While you might argue that i should have produced an iterator to be Java compatible, to do it in Java, you'd need an interface with methods call and apply, and each of the 4 loops would require at least 50% more lines of code. |
From: Ken A. <kan...@bb...> - 2004-06-23 22:35:45
|
I think the idea that JScheme is an alternative "skin" for java programs is an important one, and your idea of allowing alternative languages to provide java behavior by using JScheme as a back end is a good one. We could support multiple syntax by allowing a customizable #macro, or as Common Lisp did, allow a customizable (read) so you could change its read-table. After TCL/TK came out Stallman i believe criticized it for being a bad scripting language, because string hacking was everywhere, especially in the inner loop. He said something like "translate TCL into Scheme and win big". I believe the outcome was that the people who tried to translate TCL into Scheme had to make semantic changes to TCL for things to work out, much as PLT Scheme needs changes to Python for their analysis to be userful. I'm sure that the amount of effort provided from the Scheme side to the other language was substantial. Eventually, someone wrote a TCL "compiler" that ran at about as well as the Scheme implementation. Which just proves that bad ideas will continue to win as long as someone is willing to put more effort into them. While you can translate the code into Scheme, its harder to translate the error messages. Why am i getting a JScheme and Java backtracke when i'm talking to prolog? We can hide this to some extent, but to provide "good" language specific runtime error message may be hard. Of course, the JScheme attitude should be, that that doesn't make it worth trying! JScheme - you can get a lot more than you might expect from a little language. |
From: Timothy J. H. <ti...@cs...> - 2004-06-23 17:41:49
|
On Jun 23, 2004, at 12:24 PM, Geoffrey Knauth wrote: > Maybe you could have a Guile compatibility feature, so that users > migrating code from Guile to JScheme wouldn't have to worry about the > difference in syntax. In the long run, one syntax will probably win > out over the other, but it could be a very long time before it's clear > what users prefer. Sometimes I wonder about the feasibility/desirability of building multiple front ends to Scheme, Guile being one of them. In many ways Scheme syntax is one of the least interesting parts of the language. It wouldn't be too hard to build multiple readers for JScheme. For example, you could request a Python syntax REPL or you could load a Scheme file implemented with a Prolog style infix notation, or you could read in a file using a strict R5RS syntax, or a Guile syntax. These readers would provide Scheme with many different "skins" and might provide a way out of the syntax debates, especially if everything eventually is parsed into good old s-expressions. My understanding is that there have been many attempts to popularize LISP by providing alternate syntaxes, but it never seems to take. Nevertheless, it might be worth trying again since JScheme is one of the only LISP implementations that lives fully in the most popular language's runtime environment..... ---Tim--- P.S. I have an Prolog-style operator precedence parser implemented in Scheme ( opparse.scm available from http://interval.sourceforge.net/interval/scheme/giaeval/README.html ) which could easily be modified to provide an infix syntax for Scheme programs, e.g. (define (fib n) (if (< n 3) 1 (+ (fib (- n 1)) (fib (- n 2))))) could be expressed in an infix notation as fib(n) := if (n < 3) then 1 else fib(n-1) + fib(n-2) which parses to the s-expression (:= (fib n) (if (< n 3) (then 1 (else (+ (fib (- n 1)) (fib (- n 2))))))) which can then be translated to standard Scheme by appropriate redefinition of the operators (:= is the define macro, ....) Here the parsing works by defining :=, if, then, else, +, -, < to be binary operators with the appropriate precedence and associativity. This is a common trick in Prolog programming and in fact can be used to completely define the syntax of Prolog programs (and many other languages). > > If JScheme makes this overture to the Guile community, maybe Guile > will reciprocate. > > Done right, users should be able to pick the syntax they like with > minimum pain. > > Geoffrey > -- > Geoffrey S. Knauth | http://knauth.org/gsk > > On Jun 23, 2004, at 10:07, Ken Anderson wrote: > >> You're right, i didn't look closely enough at the example. >> >> I thought it was >> ;;; output page header >> (define (header title) >> #- >> <?xml version="1.0" encoding="utf-8"?> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >> >> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> >> <head> >> <title>#- title -#</title> >> </head> >> -#) >> ) >> (header "foobar") >> >> that is as you nested #-'s you go in and out of string/scheme mode. >> But i think it would be confusing to know which level you were at. >> >> I wouldn't add another quasi string type. I'd make it so people >> could add their own # macro characters. >> >> k >> At 09:29 AM 6/23/2004 -0400, Timothy John Hickey wrote: >> >>> On Jun 23, 2004, at 8:59 AM, Ken Anderson wrote: >>> >>>> http://www.unknownlamer.org/code/guile-web-manual.html >>>> >>>> Guile uses #- ... -# as their quasi string approach. Interesting. >>> >>> But their quasi-string doesn't allow escaping into Scheme in >>> the middle. It seems to be just for quoting long sections of text >>> (like Pythons triple quote """.....""") >>> They can get something similar to full quasi-strings though >>> using string- append, or flatten-and-string-append: >>> >>> (flatten-and-string-append >>> #- <html> >>> <head><title> -# title #- </title></head> >>> <body bgcolor="-# color #-"> >>> <h1>Cool, a -# color #- page</h1> >>> </body> >>> </html> -#) >>> >>> which is equivalent to our approach: >>> >>> #{<html> >>> <head><title> #[ title ]# </title></head> >>> <body bgcolor="#[ color ]#"> >>> <h1>Cool, a #[ color ]# page</h1> >>> </body> >>> </html> }# >>> >>> Our-variant on their approach (not escaping into Scheme) >>> would be >>> >>> (!{} >>> #-{<html> >>> <head><title>}-# title #{ </title></head> >>> <body bgcolor="}# color #{"> >>> <h1>Cool, a }# color #{ page</h1> >>> </body> >>> </html> }#) >>> >>> This makes it a little more clear locally what is a string >>> and what is Scheme and uses our built-in operator >>> !{} == flatten-and-string-append >>> >>> >>> Maybe we should add guile-style quasi-strings to JScheme. >>> It would be easy and the guile approach does have a certain elegance! >>> >>> --Tim--- >> >> >> >> ------------------------------------------------------- >> This SF.Net email sponsored by Black Hat Briefings & Training. >> Attend Black Hat Briefings & Training, Las Vegas July 24-29 - >> digital self defense, top technical experts, no vendor pitches, >> unmatched networking opportunities. Visit www.blackhat.com >> _______________________________________________ >> Jscheme-user mailing list >> Jsc...@li... >> https://lists.sourceforge.net/lists/listinfo/jscheme-user >> > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital > self defense, top technical experts, no vendor pitches, unmatched > networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Geoffrey K. <ge...@kn...> - 2004-06-23 16:24:25
|
Maybe you could have a Guile compatibility feature, so that users migrating code from Guile to JScheme wouldn't have to worry about the difference in syntax. In the long run, one syntax will probably win out over the other, but it could be a very long time before it's clear what users prefer. If JScheme makes this overture to the Guile community, maybe Guile will reciprocate. Done right, users should be able to pick the syntax they like with minimum pain. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Jun 23, 2004, at 10:07, Ken Anderson wrote: > You're right, i didn't look closely enough at the example. > > I thought it was > ;;; output page header > (define (header title) > #- > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> > <head> > <title>#- title -#</title> > </head> > -#) > ) > (header "foobar") > > that is as you nested #-'s you go in and out of string/scheme mode. > But i think it would be confusing to know which level you were at. > > I wouldn't add another quasi string type. I'd make it so people could > add their own # macro characters. > > k > At 09:29 AM 6/23/2004 -0400, Timothy John Hickey wrote: > >> On Jun 23, 2004, at 8:59 AM, Ken Anderson wrote: >> >>> http://www.unknownlamer.org/code/guile-web-manual.html >>> >>> Guile uses #- ... -# as their quasi string approach. Interesting. >> >> But their quasi-string doesn't allow escaping into Scheme in >> the middle. It seems to be just for quoting long sections of text >> (like Pythons triple quote """.....""") >> They can get something similar to full quasi-strings though >> using string- append, or flatten-and-string-append: >> >> (flatten-and-string-append >> #- <html> >> <head><title> -# title #- </title></head> >> <body bgcolor="-# color #-"> >> <h1>Cool, a -# color #- page</h1> >> </body> >> </html> -#) >> >> which is equivalent to our approach: >> >> #{<html> >> <head><title> #[ title ]# </title></head> >> <body bgcolor="#[ color ]#"> >> <h1>Cool, a #[ color ]# page</h1> >> </body> >> </html> }# >> >> Our-variant on their approach (not escaping into Scheme) >> would be >> >> (!{} >> #-{<html> >> <head><title>}-# title #{ </title></head> >> <body bgcolor="}# color #{"> >> <h1>Cool, a }# color #{ page</h1> >> </body> >> </html> }#) >> >> This makes it a little more clear locally what is a string >> and what is Scheme and uses our built-in operator >> !{} == flatten-and-string-append >> >> >> Maybe we should add guile-style quasi-strings to JScheme. >> It would be easy and the guile approach does have a certain elegance! >> >> --Tim--- > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user > |
From: Ken A. <kan...@bb...> - 2004-06-23 14:07:37
|
You're right, i didn't look closely enough at the example. I thought it was ;;; output page header (define (header title) #- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>#- title -#</title> </head> -#) ) (header "foobar") that is as you nested #-'s you go in and out of string/scheme mode. But i think it would be confusing to know which level you were at. I wouldn't add another quasi string type. I'd make it so people could add their own # macro characters. k At 09:29 AM 6/23/2004 -0400, Timothy John Hickey wrote: >On Jun 23, 2004, at 8:59 AM, Ken Anderson wrote: > >>http://www.unknownlamer.org/code/guile-web-manual.html >> >>Guile uses #- ... -# as their quasi string approach. Interesting. > >But their quasi-string doesn't allow escaping into Scheme in >the middle. It seems to be just for quoting long sections of text >(like Pythons triple quote """.....""") >They can get something similar to full quasi-strings though >using string- append, or flatten-and-string-append: > >(flatten-and-string-append > #- <html> > <head><title> -# title #- </title></head> > <body bgcolor="-# color #-"> > <h1>Cool, a -# color #- page</h1> > </body> > </html> -#) > >which is equivalent to our approach: > >#{<html> > <head><title> #[ title ]# </title></head> > <body bgcolor="#[ color ]#"> > <h1>Cool, a #[ color ]# page</h1> > </body> > </html> }# > >Our-variant on their approach (not escaping into Scheme) >would be > >(!{} > #-{<html> > <head><title>}-# title #{ </title></head> > <body bgcolor="}# color #{"> > <h1>Cool, a }# color #{ page</h1> > </body> > </html> }#) > >This makes it a little more clear locally what is a string >and what is Scheme and uses our built-in operator >!{} == flatten-and-string-append > > >Maybe we should add guile-style quasi-strings to JScheme. >It would be easy and the guile approach does have a certain elegance! > >--Tim--- |
From: Timothy J. H. <ti...@cs...> - 2004-06-23 13:29:10
|
On Jun 23, 2004, at 8:59 AM, Ken Anderson wrote: > http://www.unknownlamer.org/code/guile-web-manual.html > > Guile uses #- ... -# as their quasi string approach. Interesting. But their quasi-string doesn't allow escaping into Scheme in the middle. It seems to be just for quoting long sections of text (like Pythons triple quote """.....""") They can get something similar to full quasi-strings though using string- append, or flatten-and-string-append: (flatten-and-string-append #- <html> <head><title> -# title #- </title></head> <body bgcolor="-# color #-"> <h1>Cool, a -# color #- page</h1> </body> </html> -#) which is equivalent to our approach: #{<html> <head><title> #[ title ]# </title></head> <body bgcolor="#[ color ]#"> <h1>Cool, a #[ color ]# page</h1> </body> </html> }# Our-variant on their approach (not escaping into Scheme) would be (!{} #-{<html> <head><title>}-# title #{ </title></head> <body bgcolor="}# color #{"> <h1>Cool, a }# color #{ page</h1> </body> </html> }#) This makes it a little more clear locally what is a string and what is Scheme and uses our built-in operator !{} == flatten-and-string-append Maybe we should add guile-style quasi-strings to JScheme. It would be easy and the guile approach does have a certain elegance! --Tim--- |
From: Ken A. <kan...@bb...> - 2004-06-23 12:59:53
|
http://www.unknownlamer.org/code/guile-web-manual.html Guile uses #- ... -# as their quasi string approach. Interesting. |
From: Ken A. <kan...@bb...> - 2004-06-21 21:15:39
|
I thought i'd see what's its like to use Tims new #{}# syntax, by converting dclass/record.scm to use it rather than the capabilites of dclass/dclass.scm. This converts a simple record, struct, defstruct into a Java bean. So for example, after loading record2.scm into JScheme, the 7 LOC (show (macroexpand '(define-record plan.Word (fields (name String) (nSpam 0) (nHam 0) (probability -1.0) (deviance -1.0))))) produces the 51 LOC of Java below. (Not bad for about a 150 line macro). Tim, one problem i had was that the semantics of #{}# was not the same as {}. This forced me to use the procedure asaf (see the code) 7 times when i wouldn't have need it it using {}. I think we should make the semantics of #{}# the same as {}. k Here's the Java expansion: package plan; public class Word implements java.io.Serializable { private String name; private int nSpam = 0; private int nHam = 0; private double probability = -1.0; private double deviance = -1.0; public Word(String name, int nSpam, int nHam, double probability, double deviance) { this.name = name; this.nSpam = nSpam; this.nHam = nHam; this.probability = probability; this.deviance = deviance; } public Word(String name) { this.name = name; } public String getName() { return this.name; } public int getNSpam() { return this.nSpam; } public int getNHam() { return this.nHam; } public double getProbability() { return this.probability; } public double getDeviance() { return this.deviance; } public void setName(String value) { this.name = value; } public void setNSpam(int value) { this.nSpam = value; } public void setNHam(int value) { this.nHam = value; } public void setProbability(double value) { this.probability = value; } public void setDeviance(double value) { this.deviance = value; } public String toString() { return "(plan.Word. " + this.name+ " " + this.nSpam+ " " + this.nHam+ " " + this.probability+ " " + this.deviance + ")"; } } |
From: Ken A. <kan...@bb...> - 2004-06-21 15:44:30
|
Tim, Can you fix this so that #{}# works like {}? > #{#[(list 1 2 3)]#}# "(1 2 3)" > {[(list 1 2 3)]} "123" |