Archive for the ‘Software development’ Category

Curl 7.0 RIA platform released May 7, 2009

Sunday, May 10th, 2009

The latest Curl from Curl Inc. is now available as both Runtime and developer IDE or Eclipse plugin for Windows and Linux (both as rpm and as deb).

If you are a developer looking at the Curl platform you will not want to miss the example code ZIP files in the docs/default/examples directory. It is found under your install below /Surge/8/docs ( the “8″ because 7.0 is known internally as curl8, rather as you started your 2nd year on your 1st birthday.)

The most significant change for me as someone who has worked mostly in Curl 3.0 is the “library” access modifier which allows packages under the same project manifest to share code ( so we have private, protected, package, library and public.) I recently worked on a framework where this would have helped keep classes in separate packages which worked with each other across component layers. And this means we have the syntactic-sugar of “library-get” and “library-set” for ease in declaring accessors.

As most often in the past, Curl 7 installs so as to co-exist with Curl 3.x, 5.x or 6.x either as RTE or also with IDE’s. If you have seen a Curl installer in the Windows Control Panel you will know that it is very selective as to what you can uninstall or retain among your Curl versions.

I had been hoping to see an option to “disable selected breakpoints” on that Debug pane, but there are now large, obvious buttons with dropdowns on the IDE for flipping from one edit point back to another which is helpful when refactoring code across scurl source files.

The best kept IDE secret is that a right click on an edit pane tab gives you the option to “split” right or top ( the menu has an option which defaults to split to the bottom.)

With the TextMate knock-off for Windows and Linux, E, now going open-source for linux, I will want to try using E. But Curl also comes with an emacs site file and offers an Eclipse plugin for the Curl language.

Curl Inc. is now positioning Curl as more of an RIA enterprise platform than a web content language (Curl is usually presented as HTML + JavaScript + CSS) and now has more options for using JSON, JavaScript, Flash and Flex. There are a few Curl open-source packages now for XML as a data format, for SQLite and for UnitTests among others. I have not checked yet whether Curl embedded as an HTML Object now accepts Object parameters – the lack of which had been a pet peeve of mine … or whether there is now more complete documentation of the API for Curl sub-applets.

I am glad to be able to say that the Curl RIA demos at the Curl home page are not “toy” applications as can be seen with the dynamic “social network” applet for FaceBook or the impressive Timeline demo. In addition, there are code examples available elsewhere on the web for advanced Curl UI’s.

In a few days I may have a chance to look at writing Mixin classes in Curl and see what has become more comfortable with the “library” access modifier for code common across packages for code which is not public or protected (Curl allows multiple inheritance and constructors are of the “factory” pattern.)

With the renewed enterprise interest in Smalltalk, the re-emergence of the “Slate” project as “Clean Slate Smalltalk”, the fine Seaside web framework, traits from Squeak Smalltalk and the good work done on the Io beyond-Smalltalk language, it is nice to be able to say that the only web programming environment which I think can rival Curl is a multi-platform dialect of Smalltalk. Curl allows you to relax all typing and do your prototype and then get down to re-writing your application as an industrial-strength web or desktop app relying largely on static types. All that I miss in the Curl IDE is a Smalltalk-style refactoring browser …

In my many years working on mission critical applications first in both Curl and Smalltalk, Curl is as productive for experienced developers as Smalltalk and just as well-suited to evolutionary approaches to software development. Both promote: “See, Yes you can! Just like this …” And after that short turn-around demo or prototype, we can get the app right with UnitTests, an excellent debugger, live documentation and then get it fast with the profiler and the HTTP monitor. And have the option of using Curl itself as the data format. And now Curl stylesheets as well (Smalltalk Seaside is also not married to HTML.)

If you have not yet looked at Seaside for Smalltalk and you are doing web applications, you owe it to yourself to do so. It you are interested in the desktop or in site-specific browser applets, then Curl is a must-see, must-try. Then if you opt for Air or Silverlight or yet another framework, library or platform, you will make that choice knowing what you have passed up. Just as you may have thought you knew why you ignore PROLOG for business rules, you may just not know about Logtalk or the latest on constraints in distributed Oz. These are not just languages: Curl as much as Smalltalk, Erlang or Oz offers an approach to getting from a software vision to a maintainable product with manageable risks and a good chance of being within budget. But as much as Smalltalk or Rebol or UNICON you must be ready to set aside preconceived notions – and I think that it helps to embrace evolution as a fact: your prototype need not be a throw-away but you must have the discipline to move beyond exploratory and feasibility mode to the demands of industrial-strength components. Curl offers restrictions at the code package level which would offend most Smalltalkers. But it is worth it in my experience. Start modeling your web app in a declarative mode with no type restrictions. And then get beyond that.

Busy with Curl and RDF

Friday, November 7th, 2008

I am hoping to post a substantial note on the Curl language and RDF over at eclectic-pencil.
Tim Berners-Lee was involved in the original Curl language project and of course is now involved with RDF efforts for the Semantic Web such as the N3 language for expressing RDF triples.
Btw, I see that INRIA.fr has a SweetWiki powered by SmallWiki (now known as Pier)
Technorati Profile

On Improving Curl

Sunday, October 26th, 2008

Over at my Curlr blog I have added some suggestions for improving the quality of Curl code by enforcing some coding standards.

At the moment in a Curl file containing a class definition, class-side and instance-side expressions can occur willy-nilly.

Some developers have the idea that if a field is only referenced in one method, then declare that field where the method is declared. And declare class-side variables wherever you will.

As Curl still lacks a refactoring browser, this generous approach to coding-as-scripting can and does add to maintenance headaches.

I particularly like my own idea of {i-attributes } and {d-attributes } as those declared once -and-only-once as requiring to be initialized in a constructor or not.

These are not substantive changes such as adding co-expressions or generators as found in ICON and UNICON or becoming more truly multi-paradigm as is distributed OZ. What they address are some of the needs of PITL. In a large codebase, it is important to be able to grasp the intention at a glance so as to move on in confidence (no obvious issue there, so look elsewhere) when refactoring code without the craftsman’s tool.

What I have proposed is not a restriction, but rather only an option to be enforced as a tighter compiler-directive than stringent? is at present.

While never a big fan of UML, I have opted to suggest rational? = true for this meta-level view of Curl class code.

Sometime ago I suggested that a macro for SCURL file headers was overdue. I now have that suggestion:
{curl-class }

What this will mean is that when the header is found, that SCURL file may only contain one Curl class and only a Curl class (no stray globals, proc’s and other flotsam-and jetsam.)

Call it “Curl with class”. || humor

Curl Enterprise Framework: refactoring and sub-applets

Sunday, September 28th, 2008

At LogiqueWerks I have replaced the first Curl 6.0 revision of Paul Sheehans ‘Curl Enterprise Framework’ by a slightly re-factored version which uses only the documented sub-applet API’s of Curl 6.0

The original code accompanying the book ‘Enterprise Curl‘ relied on a package ‘IPC’ for inter-process communication which relied on largely undocumented Curl internals. One problem not solved in the port of the framework to Curl 6.0 was that of communication with such transient items as the ’splash screen’ when launched from HTML so as to avoid

Error: InvalidAppletException: Unsupported content-type 'application/octet-stream'

arising from the internal Curl call to Applet.load-next-aux

In the most recent refactoring, launching ‘enterprise-parent.curl‘ results in parent-child calls between that applet and the AppletData of enterprise.curl. However, launching ‘enterprise.curl’ from HTML proved more of a challenge. To allow a simple callback, the package ‘logon’ has now moved within the ‘VMS-MOTORS’ package as has the one ’splashscreen.scurl’ formerly located in a SERVICES package.

In the case of ‘enterprise-parent.curl‘, a parent-callback is used to launch the logon dialog once the splashscreen has run its course. In the case of embedding in ‘enterprise-curl.html‘, the child applet is controlled from a JavaScript function with a call to ‘applet_invoke‘.

The one drawback is that now the Help menu cannot call upon the same SplashScreenManager class to provide the ‘about’ dialog.

The framework is now reduced from 13 to 11 packages. The logon.scurl arguably belonged with the SplashScreenManager in the application code found in VMS-MOTORS where both now reside so as to avoid circular imports from the WINDOWS package.

While the splash screen for ‘VMS MOTORS’ may not be the best illustration of the sub-applet model in Curl, the upside is that there is now a working example which does not use imports from CURL.REMOTE or make explicit reference to ‘remote-connection’ and undocumented Curl such as
{import * from CURL.REMOTE}
{define-remote-class public abstract open ParentInterface
{define-remote-proxy-class ParentProxy}
{define-remote-yxorp-class ParentYxorp}
{remote-method public abstract open {mention-string str:String}:String}
}

But what is available by running ‘enterprise-parent.curl’ with a breakpoint at
set ad.applet-invoke-ready-callback
in the Logon method
{method public {startup-with ad:AppletData}:void
is a view of the underlying sub-applet API features of Curl 6.0 such as
the connection – a TunnelRemoteConnection
the proxy – a TunnelRemoteProxy
none of which are exposed in using only the published API found in the IDE documentation and illustrated in the IDE extended examples.

The LogiqueWerks page also has a link to the example ’shape.curl’ and the various JavaScript tips to be found in ’shape-parent.html’ for the use of AppletData.

The new EnterpriseFramework code now contains an example of a subclass of AppletHistory which might also be of interest.

Several cosmetic features of the example UI for ‘VMS MOTORS’ will see a re-work in the days and weeks to come as my work commitments permit.

Oz 1.4.0 released at mozart-oz.org

Sunday, August 10th, 2008

Oz 1.4.0 was released about a month ago at mozart-oz.org but there are as yet few changes evident at the web site.
For example, the documentation still discusses enabling Oz applets for Netscape … with no mention of any other browser.
The Oz team has been working on enhancing Oz as a language for distributed systems. Here is a quote from mozart-oz.org:

The Mozart system provides state-of-the-art support in two areas: open distributed computing and constraint-based inference. Mozart implements Oz, a concurrent object-oriented language with dataflow synchronization. Oz combines concurrent and distributed programming with logical constraint-based inference, making it a unique choice for developing multi-agent systems. Mozart is an ideal platform for both general-purpose distributed applications as well as for hard problems requiring sophisticated optimization and inferencing abilities.

Oz may be best-known through the MIT Press book by Peter van Roy, known on lambda-the-ultimate as CTM. You can find a list of related papers on Oz at http://www.ps.uni-sb.de/Papers/ among other work of his colleagues. If you have Joe Armstrong’s book on Erlang or remember any Prolog, you might like this book on Oz as a multiparadigm language.

The programming interface of Mozart remains Emacs. After installing Oz, the Oz menu on your Emacs toolbar will now include a Distribution Panel in addition to the debugger and profiler.

O’Reilly has a book coming on real-world Haskell: a book on real-world Oz is over-due.

The next major Oz event will be the (eventual) release of Oz 1.5.0 by which time we should have Rebol 3.0 and a new version of dataflow for Rebol from Liquid Steel tools.

Really cool Curl

Thursday, September 13th, 2007

I was pointing out JSForth to a developer on-line (Forth interpreter in JavaScript) which I thought was cool but then I see this in Curl: a folding coding window in a web page.

Here is the Curl 5.0 code for the applet:


{curl 5.0 applet}
{curl-file-attributes character-encoding = "windows-latin-1"}
{applet manifest = "manifest.mcurl"}

{include "./utils/guide-header.scurl"}
{include "./utils/support.scurl"}

   {x-example-ref
        title = "Folding Tree example",
        {url "./examples/RIA_with_Curl.curl"}
    }

What this does is create a labeled hotspot on my page: with one click an entire Curl client-side scripting environment opens. The running example is there; the code that is running is there; buttons to execute, save applet; revert changes; close popup – and the panel allows editing the script.

Clicking on ‘Execute’ causes a popup version of the script to run with your changes.

I had seen this cool way of working with code as part of the example macro

{example

}

What was new was the ‘expandable’ and ‘collapsible’.

I cannot imagine this being more concise in JavaFX or in Groovy. Here is the Curl procedure from the include file:


|| Copyright (C) 1998-2006, Sumisho Computer Systems Corp.
|| All Rights Reserved.
{define-proc {x-example-ref
                 title:String = {message Example},
                 href:Url, ...}:Visual
    let display:Graphic = {example-ref title = title, href, ...}
    {for-each-graphic
        {proc {g:Graphic}:void
            {type-switch g
             case g:TextEditPanel do
                || consume right click, so TreeControl ignores it
                {g.add-event-handler
                    {on e:PointerPress do
                        {if e.button == right-button then
                            {e.consume}}}}}},
        display}
    {return
        {text-width-display
            {expandable
                border-width = 2px,
                {bold {value title}},
                display}}}
}
|| *** calls the following ***
{define-proc public {example-ref
                        loc:Url,
                        title:#String = null,
                        base-url:Url = {get-base-url},
                        manifest:ComponentManifest =
                           {get-default-manifest},
                        package:OpenPackage =
                            {OpenPackage
                                CURL.IMPLICIT.APPLET,
                                CURL.IDE.DOCUMENTATION,
                                manifest = manifest},
                        ...
                    }:Graphic
    let result:any =
        {try
            {evaluate
                base-url = loc,
                package = package,
                {format "\{example title = %w,\n %s\}",
                    title,
                    {read-from loc}}}
         catch e:Exception do
            {paragraph
                Error in {bold {value loc}}:{br}
                {text color = "red", {value e}}}}
    {return {Frame result, ...}}
}

It is perfectly readable. When you see ‘…’ inside { } what you are seeing are rest arguments, or unnamed arguments for variable parameter procedure calls. And then again in the

{ return {Frame result, …} }

– these are not code elisions! The critical {example } macro is in the evaluate block. Dynamic language fans will note that the result is their preferred type: any.

And to learn to use this expand/collapse ‘live’ code environment/widget all I had to do was right-click on a folding code-editor page in the Curl Documentation Viewer which is itself Curl. I copied in the files to include for my applet and set a few imports in my ‘manifest.mcurl’ file. No CLASSPATH to look at, no question of which JARs are where. No JavaScript library required. As cool as Smalltalk, Strongtalk or the XOTcl IDE.

To see one in action, you will need the XML Document Model for Curl 5.0 from curl.com
Just install the RTE, then the IDE and then the XDM. Open your Documentation Viewer and search for ‘WSDK XML Document Model’ or just ‘build-xml

The proc identifies an anonymous procedure and we pass in what Groovy calls a ‘closure’ at on e:PointerPress do or what would likely be an inner class Listener in Java.

If you know something as cool using FLASH with ActionScript, post a snippet or a link to same.
Of course you could do this using AJAX with Prototype and Scriptaculous. But I got this page out in a matter of minutes. Oh yes, Sun says JavaFX is not about ‘throwing up pages’ …

Imagine that you are working on a problematic page. You drop in a gem like this and now you are displaying and experimenting with your code. Only Seaside for Smalltalk can rival this as far as I am aware but that requires some understanding of Smalltalk. I love Seaside, but I know of nothing that can beat this. Of course Rebol 3.0 is on the way …

As for snide remarks from Sun in their JavaFX promo, there are quick ways to throw up a web page… I like blocknote and there is the Meta/HyperCard Revolution product or even MS Word or FrontPage in a pinch…

The Curl IDE in the context of a web page versus Seaside ‘halos’

Sunday, August 12th, 2007

Over at blogspot I have a post on inspecting objects ‘live’ in web pages.
What I neglect to mention there is what is really nice if you are used to using Mercury Interactive and that is the fact that inspectors allow you to flip some properties of an object ‘live’ in your web page.

Suppose you have an inspector open on a widget which occurs more than once on your page. With one click on the inspector’s toolbar you get a color-picklist. You can flip the color of the inspected widget’s background or border ‘live’ on the web page in your browser. Ah … that ListBox!

Curl does not use <FORM> elements in web pages; instead, Curl uses the GUI widgets familiar to anyone who has been building Rich applications in Tk, Smalltalk, Swing or most any other GUI framework.

Once you Ctrl-Right-Click on a Curl control on a web page you will see why I now rank the Curl IDE up there with Seaside for Smalltalk or XOTclIDE (the extended OTcl IDE.)

In the Curl web framework a CONTROLLER represents a joystick-type device and a ‘control’ such as a TreeControl is a CONTROL. No “let’s all pretend this is MVC because that is the OOP TLA” mantra. But with anonymous procedures and macros. As I said, COOL. Maybe not REST, but COOL enough with SOAP or XMLHttpRequest. As those of us with teens have had occasion to say, ‘Give it a rest, will ya?…’

PS Comes with built-in profiling, test coverage for QTP and even HTTP monitoring. A web content language from MIT with lambda functions that does not even look like LISP. Not bad. Readable code for literate web programming. Nothing clever embedded in HTML comments.

|| COOL
|| web2.0
|| comments

and

|COOL-tag
|| web2.0
|| documentation
COOL-tag|

Not a kluge and most have not a clue. Oh yes, MIT. CLU. What was her name?

groovy Grails tips and cheatsheet

Tuesday, August 7th, 2007

Note: For IE7 or Firefox to open any of the links in this post in a tab rather than a new window, hold down a CTRL key when your click a link.
Over at eclectic-pencil.blogspot.com I have some notes on getting Grails up and running without having to chase through a FAQ and some mail-list threads. I may add a few pages here. At the moment I am completely absorbed with the RIFE web app framework, so that may get a few pages as well. RIFE continuations are a great introduction to the Seaside continuations framework for folks more at home with Java. RIFE is also a framework in more than name-only. And the author of the framework aims it at java developers with no promises of ‘RIA without programming’ and, well, less hype: they do stretch the 80-20 rule in claiming that “you get 90% of the features with 10% of the usual effort, thanks to its full stack.” RIFE continuations use pause(), rather like Ruby uses yield(), so that is another avenue to approach RIFE. The RIFE wiki has a page on using groovy with RIFE so life will be interesting. Here is a recent Artima piece on JRuby and RIFE. The article has a link worth visiting on Terracotta with RIFE.

Hyper ZK

Monday, August 6th, 2007

AJAX without JavaScript‘ is what you can expect managers to be talking about and ZK is something they may mention because at one time ZK marketing made that claim on their ‘Simply Rich’ homepage. Here are some useful quotes.

The first line of any ZK applet:

<noscript><p style="color:red">Sorry, JavaScript must be enabled.<br/>Change your browser options, then
<a href="">try again</a>.</p></noscript>

Here is a quote from the ZK site:

Browsers without JavaScript at all is another platform, also a challenge. We’d like to see if we can make them talk in ZK.

And this:

We are working with our partner to deliver an intuitive visual design tool that works with Eclipse IDE.

And if that is not enough, this gem:

To work with existent applications more efficiently, ZK components will be ready in the form of JSP tags. We also consider the possibility to provide them in JSF.

ZK is considered to be hot, but Mozilla + XUL is not. A rising tide does not lift all boats: some are sunk, have too must ballast or are otherwise already scuttled.

One ZK claim is that they have been able to use BeanShell to show what a good scripting language Java is. That should give you pause.

And they promise to offer scripting for Ruby (they may mean JRuby) and Groovy.

The only answer is to look at what the product offers (libraries? a framework? an RTE? a consistent API?) and requires (less web scripting, but more java programmers?) and then to look at genuine alternatives. The promise of a visual environment in Eclipse, so many years after the failure of visual environments to adequately address complex callbacks is taken up on my page … AJAX = AWAX.

It might seem that the choice between ZK and the GWT is obvious. I don’t think so, and I try to suggest why not. It is even claimed that they are complementary approaches. Perhaps in fairness ZK is more of a framework – but it is such a conflicting mix that after some initial enthusiam I am left completely lost as to its intent.

If nothing else it breaks any easy association of AJAX with RIA and that may confuse your manager. Then there is the claim that it allows building an RIA ‘without programming‘. I prefer the AJAX ‘without JavaScript’ claim.

The best outline of the ZK framework that I found was an image reproduced at Ajax Magazine.

As for hype there is ZK’s own claim to be “#1 Ajax project on SourceForge.net” and they report that they are finalists in the 2007 SourceForge community awards in 3 categories: “Best Tool and Utility for Developers,” “Best User Support” and “Best Technical Design”.

A little Lua Datalog

Saturday, July 21st, 2007

What a pleasure.
There is a little Lua Datalog implementation which has gone from version 1.2 to 1.3 so I scrambled to download it. I had just downloaded a newer version of ConceptBase so I was anxious to make a few notes.

And what a pleasure it was: unzip and then launch Cygwin, cd to the dir and one ./configure and one make followed by one make install and then 7 keystrokes to a Datalog shell prompt.

It is great when things build as intended and then actually run when launched.

Lua is widely recognized as a language for managing configuration and the match of Lua with Datalog could only be beat by Rebol or Oz alone. Rebol plus Datalog is that horse-of-a-different color of which you may have ‘erd.

So I have started a page on Datalog and minor SCM issues. I still don’t have my pages up at www.make-config.net so I will link in a few pages here.

If you have worked in JSON or JavaScript or Rebol you will find nothing very unusual in employing Datalog. So don’t shy away because you didn’t like Lisp or Prolog way-back-when. This stuff can be useful. It is supposed to be useful. Think of it as smart-tagging. We will not use any XML. Promise. But you can use it where it is useful. Try not to let it get in the way and use Yaml + reSt if it does.

PS. There is also Datalog available for education: DES. If you remember Turbo Prolog, it is alive and well as PDC Visual Prolog and has an External Database framework that may be of interest to you if Datalog does not meet your needs. PDC need not be daunting if you opt for EZY Prolog as your frontend.