Small correction to « Petits poëmes en prose » of Baudelaire at http://www.aule-browser.com/books/baudelaire-ppp.curl ( Curl "Surge" RTE browser plugin 7 or 8 required ; see www.curl.com )
Showing posts with label Curl. Show all posts
Showing posts with label Curl. Show all posts
Monday, April 1, 2013
Baudelaire edits
Small correction to « Petits poëmes en prose » of Baudelaire at http://www.aule-browser.com/books/baudelaire-ppp.curl ( Curl "Surge" RTE browser plugin 7 or 8 required ; see www.curl.com )
Wednesday, July 11, 2012
Curl Knowte Pages
There is a Curl equivalent to http://www.aule-browser.com/knowtepages/index.html now available at http://www.aule-browser.com/knowtepages/index-curl.html.
The former is comprised of 4 HTML text areas and the latter is comprised of 4 Curl TextArea instances placed within PanedWindow instances.
What Curl offers is a variety persistence options without JavaScript.
Index.html above is safe to copy to your local machine as a simple source inspection will reveal. To the best of my knowledge, the text areas will re-size only in Firefox or Pale Moon or an equivalent. TextArea persistence during an HTML session may depend on your Firefox configuration (whether a closed tab can re-open with the text content intact.)
Below is an example with one area using RichText.
If your browser settings require a HTML wrapper for Curl, you might use this link.
A page with fully resizable widgets (vertical and horizontal) is here.
Friday, May 11, 2012
Kanji Recall
The "Henshall" kanji Curl applet at my kanji study pages now will remember where you were last in the set - at least as long as the Curl Surge RTE plugin is running ( a session cookie is being used.) You can even change browsers from, say, Firefox, to Chrome, and Curl remembers which Kanji you were on.
If you have a request for different behavior or a different kanji set, then forward your request to infoATaule-browser.com where the "AT" is our @ mail symbol.
Note: the applet requires the MIT Curl browser plugin from curl.com or curlap.com
Curl has a forum at communities.curl.com
If you have a request for different behavior or a different kanji set, then forward your request to infoATaule-browser.com where the "AT" is our @ mail symbol.
Note: the applet requires the MIT Curl browser plugin from curl.com or curlap.com
Curl has a forum at communities.curl.com
Friday, April 27, 2012
Study Kanjidic2's Henshall Kanji dictionary entries
I have an app up at http://kanji.aule-browser.com/ for reviewing/studying/learning the entries in the Kanjidic2 which are numberwed for Henshall's "Remembering the Kanji" book.
I will add a Heisig equivalent today or tomorrow depending on how this grippe progresses ...
Tuesday, January 3, 2012
wordlist Object Icon
The sourceforge.net wordlist page should be useful for anyone working in English on a lexicon with a text-oriented language such as Rebol 2, Red, Icon, UNICON, Converge or Object Icon.
I will be using a wordlist with Curl (the Curl web content language has a wrapper for zlib and has async loading so that a wordlist divided across zip files can be loaded astutely.)
I will be using a wordlist with Curl (the Curl web content language has a wrapper for zlib and has async loading so that a wordlist divided across zip files can be loaded astutely.)
Monday, November 28, 2011
Confucian Analects of Confucious in Curl
At phil.aule-browser.com/ancient/analects.html there is now a Curl-markup version of this text the understanding of which is crucial to assessing the political climate in China.
The above version includes Chinese Kanji for critical passages. Another version in Enlish only and with a Serif font can be found at phil.aule-browser.com/ancient/analects-en.html.
Both require the Curl RTE browser plugin from www.curl.com.
Both pages use the identical source SCURL file but each main Curl file provides a different definition of {c } which is a text format procedure whose expression wraps each piece of Chinese content. In one page it returns the content and for the other page it returns en empty {text } expression.
The table of contents in the left panel indexes the chapters of the 20 ‘books’.
The above version includes Chinese Kanji for critical passages. Another version in Enlish only and with a Serif font can be found at phil.aule-browser.com/ancient/analects-en.html.
Both require the Curl RTE browser plugin from www.curl.com.
Both pages use the identical source SCURL file but each main Curl file provides a different definition of {c } which is a text format procedure whose expression wraps each piece of Chinese content. In one page it returns the content and for the other page it returns en empty {text } expression.
The table of contents in the left panel indexes the chapters of the 20 ‘books’.
Friday, June 17, 2011
Curl Graphics: extensions packages
There are beautiful page changing options to be seen in the early edition of COM.CURL.EXT over on SourceForge.
These are extensions to the Curl web-content language from www.curl.com and rival anything else available for dynamic business applications on web or desktop.
It is hard to imagine a business having to choose from among ONLY Adobe Air, Microsoft Silverlight and the various Googlisms when the Curl option is now so strong visually (it was always very strong as a framework and in terms of security.)
Other extensions which are not at all eye-candy include spreadsheet-like "worksheet" objects which should interest many of the large corporations already using Curl internally (a third-party package has long been available in Japan.)
These are extensions to the Curl web-content language from www.curl.com and rival anything else available for dynamic business applications on web or desktop.
It is hard to imagine a business having to choose from among ONLY Adobe Air, Microsoft Silverlight and the various Googlisms when the Curl option is now so strong visually (it was always very strong as a framework and in terms of security.)
Other extensions which are not at all eye-candy include spreadsheet-like "worksheet" objects which should interest many of the large corporations already using Curl internally (a third-party package has long been available in Japan.)
Labels:
cloud,
Curl,
prototyping,
RAD,
RIA
Wednesday, December 15, 2010
Curl memoization and a PEG parsing pkg
A text search of the Curl 7.0 docs using the Curl Documentation Viewer finds two mentions of Memoizer-of but only one is an implementation note:
The other mention in the docs is suggestive and occurs as one of the notes to the docs on BucketHashTable-of of the package CURL.LANGUAGE.CONTAINERS
public final serializable BucketHashTable-of {inherits {Association-of tk, te}}
With regard to regexp, the Curl GUI packages already come with a RegexpValidator class for controls relying on use of CURL.LANGUAGE.REGEXP
Btw, great demos of the power of the Curl Documentation Viewer are the Regular Expressions doc pages with their 'live-code' examples for learning PCRE.
make-SocketInetAddress-from-addressMemoizer-of is documented as
{Memoizer-of domain:Type, range:Type} (class)This memoization class or its near equivalent would be crucial to getting PEG parsing into Curl as a package for a regexp alternative.
The other mention in the docs is suggestive and occurs as one of the notes to the docs on BucketHashTable-of of the package CURL.LANGUAGE.CONTAINERS
public final serializable BucketHashTable-of {inherits {Association-of tk, te}}
With regard to regexp, the Curl GUI packages already come with a RegexpValidator class for controls relying on use of CURL.LANGUAGE.REGEXP
Btw, great demos of the power of the Curl Documentation Viewer are the Regular Expressions doc pages with their 'live-code' examples for learning PCRE.
Labels:
Curl,
memoization,
Memoizer-of,
PEG parser,
regex,
regexp
Tuesday, December 14, 2010
Curl ValueControl
Here's a challenge for class hierarchies without Traits.
The Curl class ValueControl is noted as follows in the docs:
The class in question has the 2 abstract methods value-type and value-as-any but it also implements 2 methods: form-value and has-value?. In addition, it has a class procedure form-string. The default constructor for the class is noted as
It is documented as a getter but not as being abstract yet as intended to be overridden by subclasses.
Here is a snippet from those docs;
So why is the method not abstract? Well, because it returns a value of type any - but its subclass is parameterized for types of values. And here is one more thing that makes Curl fascinating: the leaf classes of these hierarchy branches are not themselves declared as parameterized for a type - and in the case of DateField, the value keyword parameter to the default constructor may be of a possibly-null type - a #DateTime type.
What this may show is that multi-inheritance with partially-abstract classes as mixins or otherwise can be very flexible:
The Curl class ValueControl is noted as follows in the docs:
ValueControl (class)
public abstract ValueControl {inherits Control}
Import from: CURL.GUI.STANDARD. Defined in package CURL.GUI.CONTROL-BASE.
Direct Known Subclasses: ValueControl-of
A superclass for any Control that has a value.
Description
All the Controls with values inherit from this class. It provides abstract accessors for the value, as an any, and an accessor for the expected Type of the value.
Overriding
Don't subclass this class. Subclass ValueControl-of instead.I added emphasis to the advice. My question is, how might such an intent be enforced in a class hierarchy? What would you call such a modifier or a macro used to create such a class?
The class in question has the 2 abstract methods value-type and value-as-any but it also implements 2 methods: form-value and has-value?. In addition, it has a class procedure form-string. The default constructor for the class is noted as
... : Rest arguments are passed up to Control, which passes them to Visual.The method form-value is documented as intended for use with controls embedded in HttpForm instances.
It is documented as a getter but not as being abstract yet as intended to be overridden by subclasses.
Here is a snippet from those docs;
The value returned by this getter must be one of the following:
• String
• array of String
• null
Notes
Each control overrides this method to return the value that needs to be sent when the HttpForm that contains this control is submitted.
So why is the method not abstract? Well, because it returns a value of type any - but its subclass is parameterized for types of values. And here is one more thing that makes Curl fascinating: the leaf classes of these hierarchy branches are not themselves declared as parameterized for a type - and in the case of DateField, the value keyword parameter to the default constructor may be of a possibly-null type - a #DateTime type.
What this may show is that multi-inheritance with partially-abstract classes as mixins or otherwise can be very flexible:
public abstract MultiUIValueControlFrame-of {inherits
MultiUIControlFrame,
{ValueControl-of tValue}}
value classes in Curl
The Curl language for the last two versions has allowed explicit declaration of value classes used to create objects which can be moved on the stack rather than referenced on the heap.
There is an important tip in the Curl docs that one should keep such an object smaller than 64 bits so that it can be referenced as a simple any variable with no further memory allocated, i.e., why keep an object off the heap and then have allocate for it just to use it ...
A usual class declaration in Curl begins as the macro
The docs list Keycode, Pixel, and Vector2d-of as long having been implemented as value classes.
The Curl Documentation Viewer allows you to choose an installed version when opening another viewer, so I hopped down from 7.0 to 5.0 to look at Pixel - it was reported as (class) and not (value class) but perhaps that kept things from getting murky. More often Curl docs state that a given feature is for internal use only.
There is an important tip in the Curl docs that one should keep such an object smaller than 64 bits so that it can be referenced as a simple any variable with no further memory allocated, i.e., why keep an object off the heap and then have allocate for it just to use it ...
A usual class declaration in Curl begins as the macro
{define-classand these non-reference classes begin as
{define-value-classwhich is in keeping with an accepted pattern as easy to recall. But there are some caveats and they are laid out clearly in the docs.
The docs list Keycode, Pixel, and Vector2d-of as long having been implemented as value classes.
The Curl Documentation Viewer allows you to choose an installed version when opening another viewer, so I hopped down from 7.0 to 5.0 to look at Pixel - it was reported as (class) and not (value class) but perhaps that kept things from getting murky. More often Curl docs state that a given feature is for internal use only.
Labels:
Curl,
inlining,
value class
Monday, December 13, 2010
Curl ain't JavaScript/ECMAScript
A question was posted over at developers.curl.com about creating a an off-screen 2D Drawable that exceeds a Curl sanity check on screen resolution.
A Curl developer should be able to bypass the current 'reasonable guess-timate' limit with the expression
There was a time when this was worrisome: we offered opportunities for staff with domain expertise to work in Smalltalk - but in the day of math coprocessor-on-the-board or not it was important to watch out for division. In other languages we tried not to offer examples using division when multiplication was mandated - but Smalltalk was an exception because it offered rationals.
In code such as the example which would execute once, this really is a non-issue. but all the same - this should have been
In Curl, the exponent approach to obtaining a multiplicative inverse is
The example becomes
In JavaScript, the developer has the Math object and any available packages ( Python recently replaced numpy.) But in Curl, the trig functions are addressed by the compiler.
Screen resolution itself poses a JavaScript and server issue because now the programmer is dependent on the browser supporting screen.width as a feature and likely a cookie. It is much less an issue in Curl. and that is before looking at CSS versus Curl styles.
Curl also offers this declaration in the docs:
Extensive work on Curl 2D dates back to a PhD done in 2001?
Curl 3D
[ to be continued ]
A Curl developer should be able to bypass the current 'reasonable guess-timate' limit with the expression
{Drawable.set-bypass-size-restriction? true}prior to using a
{Renderer2d.create-offscreen ... }The docs offer this practical test:
let display-context:DisplayContext =
{get-default-display-context}
let resolution:Resolution = 1 / display-context.pixel-size
There was a time when this was worrisome: we offered opportunities for staff with domain expertise to work in Smalltalk - but in the day of math coprocessor-on-the-board or not it was important to watch out for division. In other languages we tried not to offer examples using division when multiplication was mandated - but Smalltalk was an exception because it offered rationals.
In code such as the example which would execute once, this really is a non-issue. but all the same - this should have been
1 div display-context.pixel-sizeto return an integer value. Now for inverse or reciprocals.
In Curl, the exponent approach to obtaining a multiplicative inverse is
{pow n, -1}The Curl compiler package contains the trig functions but no inverse function ( the Quaternion package has an invert and there are other inverse functions.)
The example becomes
{let display-context:DisplayContext =But is this needed on current hardware? Or is the compiler addressing this?
{get-default-display-context}}
{let resolution:Resolution = {pow display-context.pixel-size, -1 }}
In JavaScript, the developer has the Math object and any available packages ( Python recently replaced numpy.) But in Curl, the trig functions are addressed by the compiler.
Screen resolution itself poses a JavaScript and server issue because now the programmer is dependent on the browser supporting screen.width as a feature and likely a cookie. It is much less an issue in Curl. and that is before looking at CSS versus Curl styles.
Curl also offers this declaration in the docs:
{Display.set-resolution-modeas well as
mode:ResolutionMode,
override-value:Resolution = 0dpi
}:void
public {Display.get-displays}:{Iterator-of Display}Moving on to Curl and 3D graphics - I see this for HTML5
Extensive work on Curl 2D dates back to a PhD done in 2001?
Curl 3D
[ to be continued ]
Sunday, December 12, 2010
Curl primitive never-returns
The docs for the Curl package CURL.LANGUAGE.CORE-TYPES cover a distinctive primitive: never-returns
There is an example by Chris Barber here.
The IDE docs example is in a Curl live-docs {example } macro for running/editing/saving doc code snippets and goes like this
Which somehow brings me round to JavaScript and new.
In Curl, the programmer is not required to use the {new } macro - and using it requires another comma in a declaration.
So why ever use {new MyObject, my_args} ?
It might be this: what MyObject is specifying for the macro is a type - and that type may be determined at runtime. This is not what you usually expect in a language that is "typed" - but this is a language which also has an any type.
So one step further: in Smalltalk the issue is to know who should implement new and basicNew and new:
But in Curl, new is also a method: it is a method of 3 classes in the package CURL.LANGUAGE.REFLECTION
Which somehow brings me to {let ...} {set ...} and {def ...} ... and {value ...}
I recently posted a Rebol tyro puzzler
p: 42 lst: [p ] what: first lst ; What is the value of :what ?
There is a great little bit in Icon about assignments which do not occur and assignments which reverse when an expression does not succeed. Like Rebol and Curl, Icon is expression-based. But what huge differences in the paradigms of these three unusual languages. Icon has the prefix dot for de-referencing and Rebol has the word reduce.
let and def are primitives of the Curl language; set, however, is a macro - as are {value ...} and {do ...}.
In some ways, the Curl docs articles on let and value are a great introduction to the language ( def came to Curl only recently.)
What I have found is that it is not all so very clear to neophytes just what is meant by "top-level" code.
Let's take the case of a Curl applet intended for a web browser. The content of the Curl applet is found in a document which will be one of 3 possible types. the default type need not be declared and is DefaultDocument.
Someone new to Curl places a {VBox } as declarative Curl in a pristine applet, runs it and nothing appears in the browser. Or is that so? This is why I always have my windowing environment on an OS flip my default window backgrounds to some pleasant shade of green: when a browser pane shows me that green background - even if just in some text entry field - I know that something is missing. The default Curl document background is white. My demo strategy is this: make things explicitly and declare things explicitly.
|tagged-comment#
[ to be continued ... ]
#tagged-comment|
There is an example by Chris Barber here.
The IDE docs example is in a Curl live-docs {example } macro for running/editing/saving doc code snippets and goes like this
{define-proc {not-odd-error i:int}:never-returnsIt is not at all the same as the language primitive named void.
{error {format "%s is not odd", i}}
}
{define-proc {assert-odd val:int}:int
{return
{if {bit-and val, 1} == 1 then
val
else
{not-odd-error val}
}
}
}
Which somehow brings me round to JavaScript and new.
In Curl, the programmer is not required to use the {new } macro - and using it requires another comma in a declaration.
So why ever use {new MyObject, my_args} ?
It might be this: what MyObject is specifying for the macro is a type - and that type may be determined at runtime. This is not what you usually expect in a language that is "typed" - but this is a language which also has an any type.
So one step further: in Smalltalk the issue is to know who should implement new and basicNew and new:
But in Curl, new is also a method: it is a method of 3 classes in the package CURL.LANGUAGE.REFLECTION
ConstructorHere is what the docs say about InstanceMaker:
Factory
InstanceMaker
public abstract sealed InstanceMaker {inherits ClassMember}Note that the {new } macro is from the package: CURL.LANGUAGE.COMPILER
Package: CURL.LANGUAGE.REFLECTION
Direct Known Subclasses: Factory, Constructor
The representation of a Constructor or Factory for objects of some class.
Notes
See ClassType.
Which somehow brings me to {let ...} {set ...} and {def ...} ... and {value ...}
I recently posted a Rebol tyro puzzler
p: 42 lst: [p ] what: first lst ; What is the value of :what ?
There is a great little bit in Icon about assignments which do not occur and assignments which reverse when an expression does not succeed. Like Rebol and Curl, Icon is expression-based. But what huge differences in the paradigms of these three unusual languages. Icon has the prefix dot for de-referencing and Rebol has the word reduce.
let and def are primitives of the Curl language; set, however, is a macro - as are {value ...} and {do ...}.
In some ways, the Curl docs articles on let and value are a great introduction to the language ( def came to Curl only recently.)
What I have found is that it is not all so very clear to neophytes just what is meant by "top-level" code.
Let's take the case of a Curl applet intended for a web browser. The content of the Curl applet is found in a document which will be one of 3 possible types. the default type need not be declared and is DefaultDocument.
Someone new to Curl places a {VBox } as declarative Curl in a pristine applet, runs it and nothing appears in the browser. Or is that so? This is why I always have my windowing environment on an OS flip my default window backgrounds to some pleasant shade of green: when a browser pane shows me that green background - even if just in some text entry field - I know that something is missing. The default Curl document background is white. My demo strategy is this: make things explicitly and declare things explicitly.
{curl 7.0 applet}|| end of applet comment =====================
{curl-file-attributes character-encoding = "utf8"}
{applet
name="top level demo",
notes="like rebol, add most any metadata tag - this one is called notes"}
{document-style DefaultDocument}
{set-document-properties background =
{Background.from-string "blue"}}
{title heading? = false, Demo}
{VBox
{text {value 65535 + 42}},
{paragraph btw, 6782865577 is prime},
{text So, what was the question?},
{new HBox, {paragraph this is just some text ...}}
}
|tagged-comment#
[ to be continued ... ]
#tagged-comment|
Labels:
Curl,
never-returns
notes for an open letter to Crockford on Curl
I am working on a response To Douglas Crockford's comment concerning the case for server-side JavaScript (beyond Yahoo and YUI3) for my blog at developers.curl.com
This is just a first pass: open letter to Crockford
0) mea culpa. Sorry about that. I do apologize. Crockford on Rebol. That was simple ignorance on my part: I thought "I knew my Crockford." I was wrong to think that I have paid close enough attention to your work. I was wrong not to research that. I have known for a few years that there was a Rebol link on the JSON page.
1) But. We should try not to misrepresent/understate/elide the salient facts in history of science - even an applied science. SUN and the fate of Self and Strongtalk is almost as wicked a tale as RCA and FM (see the story of super-heterodyne and the 9/11 broadcast mast.) The history is about the team that Sun provided Netscape, is it not? Or is it me who has substituted myth for history (the human bent) ?
a) from Self to Javascript
b) Google V8 inlining [ no puns: see inline-8 engines ]
Setting the facts straight: (i.e., setting me straight)
Dates: (timelines)
JavaScript and Java are 1995 releases
Strongtalk dates from 1993 and ideas put to work in 1994 but completed only in 1996 and for a company acquired by Sun in 1997. So that team did not work on getting LiveScript up to JavaScript as I was told one evening in L.A.
So much for hearsay; history is most often based on the available documents but tempered by documents unavailable or suspected to exist (when there are documents; see below: transparency vs dark-documents; recent case: Katyn)
BRB: Blog Readers Beware of 'web' documents: Frank and Stein Java's history interview at javaperformancetuning.com on April 1st 2003 by Jack Shirazi
See: Frank Yellin and James Gosling.
See: the Ralph Griswold papers at UMN (Icon and SNOBOL)
NTMR NoteToMyReaders: not be confused are Ralph, Bill and Dave Griswold as identity matters for more than just objects.
Self -
GC paper 1984
Self starts at Xerox PARC in 1986
the critical paper dates from 1987
first release in 1990
acquired by Sun in 1991 [inlining paper is Sun 1991 ?]
Java - work began in 1991
Q: who worked on second gen-JS and second-gen Java ?
Q: who from Sun worked on JS at Netscape with Brendan Eich ?
- prior to and in 1995
- 1995 and later
what were their roles and what were their contribution
Curl
- work began in 19__
SIGPLAN 1986
whitepaper 'the gentle slope' or 'The Curl Project' authors:
M. Hostetter, D. Kranz, C. Seed, C. Terman, S. Ward
Organization: MIT Laboratory for Computer Science
545 Technology Square, Cambr. MA
- free software movement at MIT
Q: is 1998 a correct release year ?
- Michael Dertouzos dies unexpectedly in Aug., 2001
a note and the Dertouzos Lecture Series at MIT
- PDF Morgan McGuire "The Curl Graphics2d Immediate Mode Rendering API" supervised by Steve Ward [thesis date May 17, 2000]
- decision to 'spin-off' from MIT in
- low point of dot.com crash: 2002
- the major Curl programmer's book: 2002
- decision to participate in open-source in
Scheme
Guy Steele and Oak/Java (James Gosling, Bill Joy, Guy Steele) [see Java and closures]
Steve Ward et al and Curl ?
Brendan Eich and Mocha/LiveScript/JavaScript
Python
Python and Java in the MIT CS curriculum
LISP & Curl
On T at paulgraham
2) Curl is swell - not so very swell as it has a big unknown and a few gotchas, too.
Let's take Pharo Smalltalk as a really 'swell' language (and yes, Pharo is both server-side and in the browser.)
Classic Smalltalk 80 got many things right, but tended for years to reject composition in favor of inheritance. Smalltalk implementor's pride was the Collection hierarchy with its list comprehensions exploiting blocks. Smalltalk's weakness was a lack of interfaces (implemented using inheritance as abstract classes relying on
>> subclassResponsibility
In hindsight, given the work of Ducasse (the 'Crockford' of Smalltalk) we can see that both the perceived strength and weakness were neither. This is what Traits bring to Smalltalk: insight and results.
The strength of Smalltalk can be seen in the ease with which both Traits and Seaside continuations could be introduced into a 'transparent' boot-strapped language [and SOUL and Backtalk and ...]
Truly Swell: Pharo moves onto Eliot Miranda's Cog VM from Teleplace.com
Now Curl
Curl uses Regex. In an expression-based language this is something of a travesty [not to use it or to offer it but to offer it only and solely.] I call it 'the manager says use Perl' fallacy. That fallacy applies to JavaScript: in my experience the manager says to use JavaScript in our custom site-specific intranet collaboration browser because we can tell the CIO or CTO that HR can always find us JavaScript programmers cheap. [ I heard for years how expensive Smalltalk developers were even after we had proven the value of offering Smalltalk training to non-CS employees with domain expertise in telecom]. Until Crockford (or without Flanagan) HR were hiring JS programmers who often had not learned their language. Python programmers argue for python in the browser and python on the server so that they will be able to think in only one language. This is folly. But python out-performs ruby so appears unstoppable. virtualenv is lauded although virtualenv offers something of a reductio ad absurdum for python-in-the-large.
The libraries: arguing for JavaScript without looking at the Curl package documentation in the live-Curl IDE help applications is less than responsible. Nothing in Prototype or Dojo comes close. [ so, in faireness, I must segue here to YUI3 ]. In comparison, Smalltalk packaging of libraries is a nightmare. And ObjectIcon has a long ways to go and Rebol3 is only getting there now [only now do we have a UNICODE Icon and Rebol - there Curl shone and JS now shines.]
Curl has not fostered the use of explicit constraint resolution or constraint handling Curl for open-source still sees key, essential-to-grok code libraries unavailable even though they are not compiler or runtime engine specific.
But. A Curl developer who learns Curl syntax has a much better chance of understanding the strength of the language if she also learns and uses the macro facilities with which her daily coding expressions are built.
So what is the history of Curl? There is no need to compare JavaScript for serious server-side to 'wild cowboy python' and its dynamic objects. Every flaw in the JavaScript of 1999 was not a flaw in the Curl of 1999. Curl is the foil.
It is true but trivial that Curl is not on the server-side (in public).
Rebol. It is just not relevant that Rebol is not in wide use. Monitoring the rebol-based altme.com 'rebol world' reveals where rebol is in use. Rebol2 has issues, but in practice, JS proves to tbe the problem child, not Rebol.
The truly great language that is only used on one important funded project: ICON. Ditto for Oz.
Ditto for Caml (almost)
Curl failed in not separating content from presentation. This has been addressed.
If Curl had been free the way in which ICON was free ... (see the history of SNOBOL.)
Economies of scale:
[ The MIT-trained Chief Technology Officer and Python: the case of the summer intern and the folly of dynamic objects in mission-critical code. A sad but true story.]
Why is there no lint ( Crlint ? ) for Curl ?
It could be just a grep for pragmas and directives.
It could be a grep for [ my const story ]
The missed 'killer app' was a Microsoft OneNote written in Curl or in ICON.
Rebol
p: 42 q: 65535 lst: [p q] what: first lst
GoogleTechTalk question: "What is the value of :what ??"
But ICON and Curl are also expression-based languages - is this an issue in both of them? See: Rebol and denotational logic.
And this is the issue of get words and set words being types in rebol.
But wait a minute: look at {define-syntax} in Curl - such as
{define-syntax public {first ?item:identifer in
?list:expression where ?cond:expression}
This is a conditional {first} macro declaration head suggested by Chris Barber at http://developers.curl.com
Another useful comparison of Curl as a web content language in 2010 and JavaScript 5: the Arguments object
And then there is the Curl documentation and the Curl IDE with the interactive debugger. Now those are swell.
At the Michael Miller et al JS5 talk just before the release of the spec, a Google manager cautions that the talk is public when a minify issue is raised. Why is minify not a Curl issue? Answer: the pcurl file format.
To experiment with Curl:
/opt/curl/surge/8/bin/curl --shell
NOTE: Scripting with Curl on the server:
running an xcurl script does not launch the Curl 'applet manager'.
A current Curl weakness: the web docs remain 6.0 when Curl is 7.0
The Curl strength: live code in the {example} macro and the documentation macros and 'text-procs'
Where to see good Curl code? http://code.google.com/p/zuzu-curl and various at sourceforge.net
A great strength of Curl: the packaging and the packaging macros.
BUT commonjs.org
Great strengths of JavaScript: JSLint, JSON, traits.js, node.js jQuery "use strict";
A weakness of JavaScript: the actual JSlint code. Compare how this would be packaged in Curl. This remains a weakness of ICON and even ObjectIcon and is only addressed in Rebol3.
And I like the Crockford .create for new and the Crockford 'in closure find your privacy'
The manager for Perl also said not to use JSON because HR can always find XML programmers.
Here is my private constant story. I cannot tell you the many,many global 200 organizations using this Curl codebase or a customized variant.
Suppose you ran grep on a src directory of source files for a modern language which provided encapsulation and a const declaration. Suppose that in that large codebase maintained by a large off-shore coding firm you could not find a file with either
private
const
So it is true that people will not learn their language; so it is true that a prototype can get shoveled-and-shoe-horned out into production.
Python has the author of straits.py and JavaScript has Crockford. Curl has Chris Barber, who really should be giving a Yahoo talk and a GoogleTechTalk.
Curl's release began with an unforeseeable tragedy for the CS dept at MIT - and an unforeseen economic crisis. But evolution teaches us about a small furry niche-only mouse-like creature which we call a mammal and of which the larger dinosaurs took no notice.
Evolution's good ideas can start with few numbers. Applied science should not be a popularity contest: not for bridges, not for Bose-Eintein condensates, not for creating, marking-up and transforming web content.
And like Pharo Smalltalk, Rebol, ICON, UNICON, ObjectIcon and Converge, Curl is evolving: a recent example is the access modifier named 'library' and 'library' as a languge primitive.
Q: has Steve Dekorte given a talk at Yahoo on his Io ? Would Ducasse come from Lille to show what his work in Berne has meant for Smalltalk ? Or Robert Parlett for ObjectIcon ?
What Curl has rejected: continuations, coroutines, SNOBOL/ICON text strategies ...
A useful antidote: the paper on the Oz resizeable clock. Also of note: the use of logic and constraints in Smalltalk: SOUL (Roel Wuyts), Backtalk and lisp.
Of note in Smalltalk beyond Traits: Cog VM and multi-core Squeak.
Question: should Curl be rejected over being based on an Object class?
Note: Object has 3 public methods
Question: should Curl be rejected for using multiple inheritance?
Note: some classes are declared as shared and implement secondary constructors
Note: MI is used in Curl for abstract classes which serve as Mixins due to the simple rule that a single abstract method renders a class abstract.
But: mixins ain't Traits.
Question: is Curl too-strongly typed for the server-side?
Question: should a server-side language be both distributed and offer co-routines?
Compare distributed Oz and ICON 9.5 as UNICON presses forward for concurrency changes.
Question: by the time JavaScript is as robust as Curl, will Curl still exist? Will it have been forced merely to take a new name?
CSail refs: Curl at MIT
with other items (PDF)
other refs: PDF at curl.com · the first book at Amazon
On Michael Dertouzos at wikipedia.org and his book.
Other perspectives: see David Kranz, Steve Ward (2010), Ternan
The old MIT page.
Curl today (Japan) and USA.
What the Strongtalk site has as a history page.
Strongtalk at code.google.com/p/strongtalk
Eliot Miranda post.
Optimizing dynamically-typed object-oriented languages with polymorphic inline caches [1991]
David Ungar Sun patents.
What I think I 'know' about this history was told to me by a German PhD Xerox PARC researcher but I did not take notes or check facts later - so I have only hear-say from a non-participant.
Out-of-date DMOZ page for Self [ see Avocado and Lively-Kernel ] and blog.
c2.com Self page. Io page. Pythonic Iconesque language: Converge.
See: inlining and Google V8: the history of a strategy cf: PDF and a Scientific Commons page. Many materials are Wiley, Springer or other for-pay resources.
Type Inference in Self (pdf).
Urs Hoelzle in papers at Gilad Bracha site.
Squeak Smalltalk bibliography.
Missing: a history of CSail Curl in terms of concepts, strategies, trade-offs, optimizations, performance, evolution, understandability, maintainability, limitations, regrets, bias, mistakes, economics [spin-off, acquisition, marketing]
Web Document David Kranz and Bert Halstead
note the history warning at its close
2001 Slashdot.com
Kranz is named as an inventor on many issued and pending patents on the Curl technology.
See: Deirdre Blake, Dr. Dobb's Journal Jul 01, 2008 'The Architect's Role'
David Kranz is Vice President of Engineering and CTO at Curl (www.curl.com). Previously, David was a principal research scientist at MIT where he was a leader in parallel computing technology. David holds a B.A. in Mathematics and Physics from Swarthmore College, and an M.S. and Ph.D. in Computer Science from Yale University
Curl and security: http://www.dcs.bbk.ac.uk/~geoff/ForresterSecuringRIA.pdf
see also: http://www.curl.com/riasecurity/
Question: Yahoo in corporate Asia, the subcontinent and Africa: why not Curl?
Curl in public-sphere computing: the challenge of transparency while respecting genuine needs for security and privacy.
Curl and the anti-document/dark-documents in eyes-only SSB browsing.
Constraints: Alan Borning, Prologia IV, Oz clock, Backtalk
This is just a first pass: open letter to Crockford
0) mea culpa. Sorry about that. I do apologize. Crockford on Rebol. That was simple ignorance on my part: I thought "I knew my Crockford." I was wrong to think that I have paid close enough attention to your work. I was wrong not to research that. I have known for a few years that there was a Rebol link on the JSON page.
1) But. We should try not to misrepresent/understate/elide the salient facts in history of science - even an applied science. SUN and the fate of Self and Strongtalk is almost as wicked a tale as RCA and FM (see the story of super-heterodyne and the 9/11 broadcast mast.) The history is about the team that Sun provided Netscape, is it not? Or is it me who has substituted myth for history (the human bent) ?
a) from Self to Javascript
b) Google V8 inlining [ no puns: see inline-8 engines ]
Setting the facts straight: (i.e., setting me straight)
Dates: (timelines)
JavaScript and Java are 1995 releases
Strongtalk dates from 1993 and ideas put to work in 1994 but completed only in 1996 and for a company acquired by Sun in 1997. So that team did not work on getting LiveScript up to JavaScript as I was told one evening in L.A.
So much for hearsay; history is most often based on the available documents but tempered by documents unavailable or suspected to exist (when there are documents; see below: transparency vs dark-documents; recent case: Katyn)
BRB: Blog Readers Beware of 'web' documents: Frank and Stein Java's history interview at javaperformancetuning.com on April 1st 2003 by Jack Shirazi
See: Frank Yellin and James Gosling.
See: the Ralph Griswold papers at UMN (Icon and SNOBOL)
NTMR NoteToMyReaders: not be confused are Ralph, Bill and Dave Griswold as identity matters for more than just objects.
Self -
GC paper 1984
Self starts at Xerox PARC in 1986
the critical paper dates from 1987
first release in 1990
acquired by Sun in 1991 [inlining paper is Sun 1991 ?]
Java - work began in 1991
Q: who worked on second gen-JS and second-gen Java ?
Q: who from Sun worked on JS at Netscape with Brendan Eich ?
- prior to and in 1995
- 1995 and later
what were their roles and what were their contribution
Curl
- work began in 19__
SIGPLAN 1986
David Kranz. ORBIT: An Optimizing Compiler for Scheme. Ph.D. dissertation, Yale University, February 1988. Research Report 632, Department of Computer Science.DARPA grant details:
whitepaper 'the gentle slope' or 'The Curl Project' authors:
M. Hostetter, D. Kranz, C. Seed, C. Terman, S. Ward
Organization: MIT Laboratory for Computer Science
545 Technology Square, Cambr. MA
The Curl project is supported by the Information Technology Office of the Defense Advanced Research Projects Agency as part of its Intelligent Collaboration and Visualization program.
- free software movement at MIT
Q: is 1998 a correct release year ?
- Michael Dertouzos dies unexpectedly in Aug., 2001
a note and the Dertouzos Lecture Series at MIT
- PDF Morgan McGuire "The Curl Graphics2d Immediate Mode Rendering API" supervised by Steve Ward [thesis date May 17, 2000]
- decision to 'spin-off' from MIT in
- low point of dot.com crash: 2002
- the major Curl programmer's book: 2002
- decision to participate in open-source in
Scheme
Guy Steele and Oak/Java (James Gosling, Bill Joy, Guy Steele) [see Java and closures]
Steve Ward et al and Curl ?
Brendan Eich and Mocha/LiveScript/JavaScript
Python
Python and Java in the MIT CS curriculum
LISP & Curl
On T at paulgraham
2) Curl is swell - not so very swell as it has a big unknown and a few gotchas, too.
Let's take Pharo Smalltalk as a really 'swell' language (and yes, Pharo is both server-side and in the browser.)
Classic Smalltalk 80 got many things right, but tended for years to reject composition in favor of inheritance. Smalltalk implementor's pride was the Collection hierarchy with its list comprehensions exploiting blocks. Smalltalk's weakness was a lack of interfaces (implemented using inheritance as abstract classes relying on
>> subclassResponsibility
In hindsight, given the work of Ducasse (the 'Crockford' of Smalltalk) we can see that both the perceived strength and weakness were neither. This is what Traits bring to Smalltalk: insight and results.
The strength of Smalltalk can be seen in the ease with which both Traits and Seaside continuations could be introduced into a 'transparent' boot-strapped language [and SOUL and Backtalk and ...]
Truly Swell: Pharo moves onto Eliot Miranda's Cog VM from Teleplace.com
Now Curl
Curl uses Regex. In an expression-based language this is something of a travesty [not to use it or to offer it but to offer it only and solely.] I call it 'the manager says use Perl' fallacy. That fallacy applies to JavaScript: in my experience the manager says to use JavaScript in our custom site-specific intranet collaboration browser because we can tell the CIO or CTO that HR can always find us JavaScript programmers cheap. [ I heard for years how expensive Smalltalk developers were even after we had proven the value of offering Smalltalk training to non-CS employees with domain expertise in telecom]. Until Crockford (or without Flanagan) HR were hiring JS programmers who often had not learned their language. Python programmers argue for python in the browser and python on the server so that they will be able to think in only one language. This is folly. But python out-performs ruby so appears unstoppable. virtualenv is lauded although virtualenv offers something of a reductio ad absurdum for python-in-the-large.
The libraries: arguing for JavaScript without looking at the Curl package documentation in the live-Curl IDE help applications is less than responsible. Nothing in Prototype or Dojo comes close. [ so, in faireness, I must segue here to YUI3 ]. In comparison, Smalltalk packaging of libraries is a nightmare. And ObjectIcon has a long ways to go and Rebol3 is only getting there now [only now do we have a UNICODE Icon and Rebol - there Curl shone and JS now shines.]
Curl has not fostered the use of explicit constraint resolution or constraint handling Curl for open-source still sees key, essential-to-grok code libraries unavailable even though they are not compiler or runtime engine specific.
But. A Curl developer who learns Curl syntax has a much better chance of understanding the strength of the language if she also learns and uses the macro facilities with which her daily coding expressions are built.
So what is the history of Curl? There is no need to compare JavaScript for serious server-side to 'wild cowboy python' and its dynamic objects. Every flaw in the JavaScript of 1999 was not a flaw in the Curl of 1999. Curl is the foil.
It is true but trivial that Curl is not on the server-side (in public).
Rebol. It is just not relevant that Rebol is not in wide use. Monitoring the rebol-based altme.com 'rebol world' reveals where rebol is in use. Rebol2 has issues, but in practice, JS proves to tbe the problem child, not Rebol.
The truly great language that is only used on one important funded project: ICON. Ditto for Oz.
Ditto for Caml (almost)
Programmer says: we had to learn Prolog in a 300 class.Where Curl was wrong in 1999. The Curl pay-for-use came about 10 years ahead of GoogleAppEngine and came at a bad economic juncture. Curl faled to protect its name ( cURL horror: if I type curl on my linux box I run cURL and not /opt/curl/surge/8/bin/curl
Programmer says: we didn't learn Smalltalk ... is that still used anywhere? It's kinda-like Prolog, but with objects, right?
Curl failed in not separating content from presentation. This has been addressed.
If Curl had been free the way in which ICON was free ... (see the history of SNOBOL.)
Economies of scale:
[ The MIT-trained Chief Technology Officer and Python: the case of the summer intern and the folly of dynamic objects in mission-critical code. A sad but true story.]
Why is there no lint ( Crlint ? ) for Curl ?
It could be just a grep for pragmas and directives.
It could be a grep for [ my const story ]
The missed 'killer app' was a Microsoft OneNote written in Curl or in ICON.
Rebol
p: 42 q: 65535 lst: [p q] what: first lst
GoogleTechTalk question: "What is the value of :what ??"
But ICON and Curl are also expression-based languages - is this an issue in both of them? See: Rebol and denotational logic.
And this is the issue of get words and set words being types in rebol.
But wait a minute: look at {define-syntax} in Curl - such as
{define-syntax public {first ?item:identifer in
?list:expression where ?cond:expression}
This is a conditional {first} macro declaration head suggested by Chris Barber at http://developers.curl.com
Another useful comparison of Curl as a web content language in 2010 and JavaScript 5: the Arguments object
And then there is the Curl documentation and the Curl IDE with the interactive debugger. Now those are swell.
At the Michael Miller et al JS5 talk just before the release of the spec, a Google manager cautions that the talk is public when a minify issue is raised. Why is minify not a Curl issue? Answer: the pcurl file format.
To experiment with Curl:
/opt/curl/surge/8/bin/curl --shell
NOTE: Scripting with Curl on the server:
running an xcurl script does not launch the Curl 'applet manager'.
A current Curl weakness: the web docs remain 6.0 when Curl is 7.0
The Curl strength: live code in the {example} macro and the documentation macros and 'text-procs'
Where to see good Curl code? http://code.google.com/p/zuzu-curl and various at sourceforge.net
A great strength of Curl: the packaging and the packaging macros.
BUT commonjs.org
Great strengths of JavaScript: JSLint, JSON, traits.js, node.js jQuery "use strict";
A weakness of JavaScript: the actual JSlint code. Compare how this would be packaged in Curl. This remains a weakness of ICON and even ObjectIcon and is only addressed in Rebol3.
And I like the Crockford .create for new and the Crockford 'in closure find your privacy'
The manager for Perl also said not to use JSON because HR can always find XML programmers.
Here is my private constant story. I cannot tell you the many,many global 200 organizations using this Curl codebase or a customized variant.
Suppose you ran grep on a src directory of source files for a modern language which provided encapsulation and a const declaration. Suppose that in that large codebase maintained by a large off-shore coding firm you could not find a file with either
private
const
So it is true that people will not learn their language; so it is true that a prototype can get shoveled-and-shoe-horned out into production.
Python has the author of straits.py and JavaScript has Crockford. Curl has Chris Barber, who really should be giving a Yahoo talk and a GoogleTechTalk.
Curl's release began with an unforeseeable tragedy for the CS dept at MIT - and an unforeseen economic crisis. But evolution teaches us about a small furry niche-only mouse-like creature which we call a mammal and of which the larger dinosaurs took no notice.
Evolution's good ideas can start with few numbers. Applied science should not be a popularity contest: not for bridges, not for Bose-Eintein condensates, not for creating, marking-up and transforming web content.
And like Pharo Smalltalk, Rebol, ICON, UNICON, ObjectIcon and Converge, Curl is evolving: a recent example is the access modifier named 'library' and 'library' as a languge primitive.
Q: has Steve Dekorte given a talk at Yahoo on his Io ? Would Ducasse come from Lille to show what his work in Berne has meant for Smalltalk ? Or Robert Parlett for ObjectIcon ?
What Curl has rejected: continuations, coroutines, SNOBOL/ICON text strategies ...
A useful antidote: the paper on the Oz resizeable clock. Also of note: the use of logic and constraints in Smalltalk: SOUL (Roel Wuyts), Backtalk and lisp.
Of note in Smalltalk beyond Traits: Cog VM and multi-core Squeak.
Question: should Curl be rejected over being based on an Object class?
Note: Object has 3 public methods
Question: should Curl be rejected for using multiple inheritance?
Note: some classes are declared as shared and implement secondary constructors
Note: MI is used in Curl for abstract classes which serve as Mixins due to the simple rule that a single abstract method renders a class abstract.
But: mixins ain't Traits.
Question: is Curl too-strongly typed for the server-side?
Question: should a server-side language be both distributed and offer co-routines?
Compare distributed Oz and ICON 9.5 as UNICON presses forward for concurrency changes.
Question: by the time JavaScript is as robust as Curl, will Curl still exist? Will it have been forced merely to take a new name?
CSail refs: Curl at MIT
with other items (PDF)
other refs: PDF at curl.com · the first book at Amazon
On Michael Dertouzos at wikipedia.org and his book.
Other perspectives: see David Kranz, Steve Ward (2010), Ternan
The old MIT page.
Curl today (Japan) and USA.
What the Strongtalk site has as a history page.
Strongtalk at code.google.com/p/strongtalk
Eliot Miranda post.
Optimizing dynamically-typed object-oriented languages with polymorphic inline caches [1991]
David Ungar Sun patents.
What I think I 'know' about this history was told to me by a German PhD Xerox PARC researcher but I did not take notes or check facts later - so I have only hear-say from a non-participant.
Out-of-date DMOZ page for Self [ see Avocado and Lively-Kernel ] and blog.
c2.com Self page. Io page. Pythonic Iconesque language: Converge.
See: inlining and Google V8: the history of a strategy cf: PDF and a Scientific Commons page. Many materials are Wiley, Springer or other for-pay resources.
Type Inference in Self (pdf).
Urs Hoelzle in papers at Gilad Bracha site.
Squeak Smalltalk bibliography.
Missing: a history of CSail Curl in terms of concepts, strategies, trade-offs, optimizations, performance, evolution, understandability, maintainability, limitations, regrets, bias, mistakes, economics [spin-off, acquisition, marketing]
Web Document David Kranz and Bert Halstead
note the history warning at its close
Kranz' diss is a Yale Computer Science Dept. tech report. I would say it is required reading for anyone interested in serious compiler technology for functional programming languages.see: Bert Halstead's parallel lisp
2001 Slashdot.com
Kranz is named as an inventor on many issued and pending patents on the Curl technology.
See: Deirdre Blake, Dr. Dobb's Journal Jul 01, 2008 'The Architect's Role'
David Kranz is Vice President of Engineering and CTO at Curl (www.curl.com). Previously, David was a principal research scientist at MIT where he was a leader in parallel computing technology. David holds a B.A. in Mathematics and Physics from Swarthmore College, and an M.S. and Ph.D. in Computer Science from Yale University
Curl and security: http://www.dcs.bbk.ac.uk/~geoff/ForresterSecuringRIA.pdf
see also: http://www.curl.com/riasecurity/
Question: Yahoo in corporate Asia, the subcontinent and Africa: why not Curl?
Curl in public-sphere computing: the challenge of transparency while respecting genuine needs for security and privacy.
Curl and the anti-document/dark-documents in eyes-only SSB browsing.
Constraints: Alan Borning, Prologia IV, Oz clock, Backtalk
Saturday, December 11, 2010
Zuzu Curl
One of the things that I like best in Chris Barber's open-source Zuzu code for Curl is the Dictionary-of class. My hope is that it will become part of curl9 (aka Curl 8.0)
Labels:
Chris Barber,
collections,
Curl,
Curl 8.0,
curl9,
zuzu
Friday, December 10, 2010
Curl pragma
Chris Barber's Zuzu Curl testing package is a sort of Curl goldmine.
Here is one snippet:
Here is a short exerpt:
One use that I think terrific is {pragma info|warning|error message}An example would be
But how to keep these out of code commits (let there be no TODO in thy code escrow....) ?
Here is one snippet:
{getter public inline {size}:intThere is very little documentation on pragmas in Curl other than the documentation page for pragma in the package CURL.LANGUAGE.PRAGMA
{pragma suppress SyntaxRequiresInteger}
{return {bit-count self.mask}}
{pragma unsuppress SyntaxRequiresInteger}
}
Here is a short exerpt:
This syntax allows the developer to specify directives in the source code to affect the behavior of advanced versions of the Curl IDE that support real-time error checking. Pragmas are ignored by the Curl RTE and have no effect on the runtime behavior of Curl programs.That snippet is followed by the caveat that pragmas are only processed by the Curl plugin for Eclipse
One use that I think terrific is {pragma info|warning|error message}An example would be
{pragma info FIX_THIS really klunky and hard to test}
But how to keep these out of code commits (let there be no TODO in thy code escrow....) ?
Labels:
Chris Barber,
Curl,
Eclipse,
IDE,
macro,
pragma,
type checking
hidden Curl
There are a few places where Curl code is documented as for internal use only*. This will surely not be the case in open source Curl projects.
There are also some examples of the use of hidden as an access modifier such as this docs entry:
The documented 'hidden' is that for the hidden-package accessors in PackageNamespace and the field hiidden? in AliasedNameRef (which is itself internal-use only.)What makes this interesting is that SequenceBox is itself visible.
*example from Curl docs:
seqnum-generator (field)
protected seqnum-generator:{proc-type {}:int}
Class: TableOptionItem
Package: CURL.GUI.BASE
... This item is unsupported and reserved for internal use.
There are also some examples of the use of hidden as an access modifier such as this docs entry:
GenericIterator (class)Another curious example is the parent of HVBox.
hidden abstract GenericIterator
Package: CURL.IO.STREAM
LengthBreadthBox (class)
hidden abstract sealed LengthBreadthBox {inherits SequenceBox}
Package: CURL.GUI.BASE
The documented 'hidden' is that for the hidden-package accessors in PackageNamespace and the field hiidden? in AliasedNameRef (which is itself internal-use only.)What makes this interesting is that SequenceBox is itself visible.
*example from Curl docs:
seqnum-generator (field)
protected seqnum-generator:{proc-type {}:int}
Class: TableOptionItem
Package: CURL.GUI.BASE
... This item is unsupported and reserved for internal use.
Labels:
access modifier,
Curl,
hidden,
package
Beautiful Curl
The Curl language can have a strange beauty: consider that when mixing positional and keyword arguments to a method or procedure that the positions of the former need only be in relative order and that duplicate keyword arguments are permitted.
With access to the Curl AST and the power of Curl macros - and the fact that the Arguments object is still part of Curl - a fascinating avenue opens for unusual programming paradigms.
Just consider the bug-bear of any Prolog which is the fact that the serial order of clauses and facts is critical and drives the need for cut. But just imagine the kind of quasi-forward-chaining that can be done by parsing Arguments based on relative positions: remember that the keyword arguments can be in any order and can be duplicated. Not only that, rest arguments can be given a type at compile time such as anonymous func {proc-type} (but in that case ... may not contain keyword arguments.)
My first experiments are simply
{clausal goal, 1, clause: procC, clause: procB, 2, clause: procA , asserted-working-mem}
where {clausal} is just
But {define-proc} is itself a Curl macro ... which makes implementing logic in Smalltalk look like really hard work in comparison ...
My convention above is (Goal, [guard-clauses],branch,[clauses],leaf,[clauses],WM)
Anonymous Curl functions close-over their context and are first-class, so I do not explicitly return a solution set. And of course I can pass in a logic procedure.
What is remarkable is to inspect rest arguments and lo-and-behold there are the multiple keyword arguments. The convention is that a Curl function cascades to take the last of the duplicate keyword arguments - but now we place our own macro in the body of our clausal proc and proceed to evaluate, parse, ...
Immediately someone says 'But look at the performance hit!' But if your problem is hard and your solution is elegant, performance will not be the issue - better an answer in 90 seconds or 42 minutes than in 90 centuries or more.
The next nay-sayer: 'But we have a C library that does this!' And the answer is that we needed a dynamic solution responsive to the user's hunches and advice. And we wanted a useful, debuggable trace, not a trace that now needs to be parsed and even then may not be useful. And we want it to be more readable than LISP.
My point is only this: I can get this richness out of the macro {define-proc} itself. And thankfully Curl 7.0 retained its Arguments class - unlike the fate proposed for Arguments in a harmonized ECMAScript5+ as it moves to its rest arguments convention. To quote as AS3 author
With access to the Curl AST and the power of Curl macros - and the fact that the Arguments object is still part of Curl - a fascinating avenue opens for unusual programming paradigms.
Just consider the bug-bear of any Prolog which is the fact that the serial order of clauses and facts is critical and drives the need for cut. But just imagine the kind of quasi-forward-chaining that can be done by parsing Arguments based on relative positions: remember that the keyword arguments can be in any order and can be duplicated. Not only that, rest arguments can be given a type at compile time such as anonymous func {proc-type} (but in that case ... may not contain keyword arguments.)
My first experiments are simply
{clausal goal, 1, clause: procC, clause: procB, 2, clause: procA , asserted-working-mem}
where {clausal} is just
{define-proc {goal:{proc-type}, branch:int, leaf:int, ...}(result:bool, depth:int, breadth:int)Notice that in my example the rest keyword arg clause: is preceding the positional leaf arg! There is order relied upon - but it is our order in our code-as-data.
But {define-proc} is itself a Curl macro ... which makes implementing logic in Smalltalk look like really hard work in comparison ...
My convention above is (Goal, [guard-clauses],branch,[clauses],leaf,[clauses],WM)
Anonymous Curl functions close-over their context and are first-class, so I do not explicitly return a solution set. And of course I can pass in a logic procedure.
What is remarkable is to inspect rest arguments and lo-and-behold there are the multiple keyword arguments. The convention is that a Curl function cascades to take the last of the duplicate keyword arguments - but now we place our own macro in the body of our clausal proc and proceed to evaluate, parse, ...
Immediately someone says 'But look at the performance hit!' But if your problem is hard and your solution is elegant, performance will not be the issue - better an answer in 90 seconds or 42 minutes than in 90 centuries or more.
The next nay-sayer: 'But we have a C library that does this!' And the answer is that we needed a dynamic solution responsive to the user's hunches and advice. And we wanted a useful, debuggable trace, not a trace that now needs to be parsed and even then may not be useful. And we want it to be more readable than LISP.
My point is only this: I can get this richness out of the macro {define-proc} itself. And thankfully Curl 7.0 retained its Arguments class - unlike the fate proposed for Arguments in a harmonized ECMAScript5+ as it moves to its rest arguments convention. To quote as AS3 author
The catch is to remember that the ...(rest) keyword can be defined only after explicit parameters because required parameters must come before optional onesNow where had we seen that before ...
Labels:
ActionScript3,
Arguments,
assert,
breadt,
clausal,
Curl,
depth,
ECMAScript5,
heuristic,
inference,
JavaScript5,
parameters,
partial order,
production,
REST,
rest args,
rest arguments,
solution,
working memory
node.js REPL
I do like the node.js REPL.
The classic test is to enter 3 > 2 > 1
But consider this
Curl is an expression-based language - can you name another in which 42 > x > 0 evaluates to a success?
But let's stick to curl for now: enter the string exit
Now that is a respectable result. Douglas Crockford, applied science is not a popularity contest.
Simulate loosing your bearings for a moment and enter exit()
Are you convinced that JavaScript variables should always use var? If so, enter
To change the value of answ, try
And an icurl.sh gets you your rlwrap xcurl --shell
And to exit the REPL
But when Crockford lays out the weaknesses of JavaScript prior to ECMAScript5 he neglects to mention Curl. Just as he neglects to mention Rebol or Io. But at a GoogleTechTalk? Were those talks intended to be misleading? Biased?
I do like JavaScript just as I do like Python (for my own needs.) But Python is wrong for applications which must be tamper-proofed on the server-side. Python dynamic objects in that regard are scary. JavaScript is worse. And Curl is (for now) absent on the server-side.
As for node.js, Curl has offered event loops in closures since forever. and for generators, see RolledRandom at curl.com
The classic test is to enter 3 > 2 > 1
But consider this
/opt/curl/surge/8/bin/curl --shellEntering 3 > 2 >1 gives a much better response.
Curl is an expression-based language - can you name another in which 42 > x > 0 evaluates to a success?
But let's stick to curl for now: enter the string exit
Now that is a respectable result. Douglas Crockford, applied science is not a popularity contest.
Simulate loosing your bearings for a moment and enter exit()
Are you convinced that JavaScript variables should always use var? If so, enter
let answ:int = 42Note the echo behavior is not annoyig. To see answ enter answ or {value answ}
To change the value of answ, try
{set answ=65565}So I such an
ln -s /opt/curl/surge/8/bin/curl xcurlsince the folks as curl.com failed to protect Curl from cURL.
And an icurl.sh gets you your rlwrap xcurl --shell
And to exit the REPL
{exit}When Crockford talks about the origin of JavaScript and the involvement of SUN, he leaves out a few details. His audience may not need to know about Self or Strongtalk.
But when Crockford lays out the weaknesses of JavaScript prior to ECMAScript5 he neglects to mention Curl. Just as he neglects to mention Rebol or Io. But at a GoogleTechTalk? Were those talks intended to be misleading? Biased?
I do like JavaScript just as I do like Python (for my own needs.) But Python is wrong for applications which must be tamper-proofed on the server-side. Python dynamic objects in that regard are scary. JavaScript is worse. And Curl is (for now) absent on the server-side.
As for node.js, Curl has offered event loops in closures since forever. and for generators, see RolledRandom at curl.com
Labels:
Crockford,
Curl,
Javascript,
node.js,
REPL,
server-side,
SSJS,
YUI
Thursday, December 2, 2010
Curl web content on a CherryPy web server
Here are two snippets from a Python CherryPy web server test run:
def index(self):
cherrypy.response.headers['Content-Type'] = 'text/vnd.curl'
return """{curl 7.0 applet}{br}{paragraph Test CherryPy}{br}"""
index.exposed = True
def home(self):
cherrypy.response.headers['Content-Type'] = 'text/vnd.curl'
return """{curl 7.0 applet}{br}{paragraph Curl Test for CherryPy}{br}"""
home.exposed = True
It is also possible to specify a path to static Curl files and an index to that directory - in which cases files could appear with .CURL extensions.
In the two cases above, the working URL's are
This test run was done using CherryPy 3.1.2 but it would only run on Python 2.6.6 as of today
The test daemon was launched from a local code folder using
Although I was setting a content-type globally for cherrypy.server I found that I still had to flip the MIME type in the individual 'page' methods as you see above in order to send a response with "text/vnd.curl".
Solution: tool decorator
def index(self):
cherrypy.response.headers['Content-Type'] = 'text/vnd.curl'
return """{curl 7.0 applet}{br}{paragraph Test CherryPy}{br}"""
index.exposed = True
def home(self):
cherrypy.response.headers['Content-Type'] = 'text/vnd.curl'
return """{curl 7.0 applet}{br}{paragraph Curl Test for CherryPy}{br}"""
home.exposed = True
It is also possible to specify a path to static Curl files and an index to that directory - in which cases files could appear with .CURL extensions.
In the two cases above, the working URL's are
http://localhost:18787/and the Curl content displays as intended in linux (Ubuntu maverick) FireFox.
http://localhost:18787/index
http://localhost:18787/home
This test run was done using CherryPy 3.1.2 but it would only run on Python 2.6.6 as of today
The test daemon was launched from a local code folder using
sudo python /usr/local/lib/python2.6/dist-packages/cherrypy/cherryd -c ./curl/site.confThat ./curl web app folder was modelled on the CherryPy3 scaffold folder in their python module distribution (which also includes a working ./tutorial for HTML content.)
Although I was setting a content-type globally for cherrypy.server I found that I still had to flip the MIME type in the individual 'page' methods as you see above in order to send a response with "text/vnd.curl".
Solution: tool decorator
@cherrypy.tools.response_headers([('Content-Type', 'text/vnd.curl')])
def curlHome(self): { // etcetc
//or
class Root:
@mimetype("text/vnd.curl")
def someView(self):
// using
def mimetype(type):
def decorate(func):
def wrapper(*args, **kwargs):
cherrypy.response.headers['Content-Type'] = type
return func(*args, **kwargs)
return wrapper
return decorate
// thanks to
http://stackoverflow.com/users/11549/ddaa
Subscribe to:
Posts (Atom)