Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Saturday, January 12, 2013

Java JMX MBean flaw


CERT says
Due to the number and severity of this and prior Java vulnerabilities, it is recommended that Java be disabled temporarily in web browsers
http://www.us-cert.gov/current/#us_cert_releases_oracle_java

http://www.kb.cert.org/vuls/id/625617

http://www.us-cert.gov/cas/techalerts/TA13-010A.html



Thursday, December 22, 2011

Mercury 11.07

The Mercury logic-programming language — which provides Java, Erlang and C# compilations — is now available as 11.07 from http://www.mercury.csse.unimelb.edu.au/download/release.html

No binary downloads are available so *nix requires a GNU C build and Windows requires Cygwin or MSYS.

Both x86-32 and x86-64 are supported.

Wednesday, July 21, 2010

Java Smalltalk

When I'm between contracts I can end up in some odd "HR" conversations called "technical interviews."

Young Java team leads generally know nothing of Smalltalk (but they've heard tell of it), so they cannot believe that someone outside the fold would understand the difference of
  if  ( x == y )  {}
from
  if ( o.equals( obj ) ) {}
And yet this is the very difference that makes Smalltalk's IdentityDictionary suitable on one occasion and a mere Dictionary on another.

But how to talk about that to a Java interviewer? Better not to mention it. A Smalltalk Set of integer keys is not a Java Set.

And as for generics and Collections, best not to mention how long Curl (of http://www.curl.com/ ) had typed collections ( a Smalltalk abomination) and an {Iterator-of t:Type} class.  Or that Curl abstract classes with multiple inheritance an interface framework make.

There once was a day when COBOL developers could opt to work in Smalltalk on some banking and financial systems.  But would one of today's few Smalltalk teams be any too happy to be joined by someone with years in C++? Hmmm.  And some wonder why so little gets done in Logtalk or other specialized languages while talk goes on of "dialects" and "language-oriented programming".  What can multiple-paradigm languages such as Oz be taken for in the monoculture of C# and J2EE shops?  And all the while the scripting hares nibble quietly on their Python deployment scripts hidden from CIO- and CTO-view in over-grown weed patches ... called "integration" and "minifying" and "monitoring".

Perhaps it all stems from the obsession with mowing and trimming the chemically-perfected green lawn.  What humble vegetable gardener grows only the green bean, or only spuds? 

Monoculture.  Best practiced in the dark.  Now where was that Erlang posting? Hares, rabbits, meerkats ... it must be the O'R libra colophony.

Tuesday, June 29, 2010

Visual Prolog 7.3

Prolog Development Center has just released version 7.3 of Visual Prolog.

VIP was once known as Borland Turbo Prolog and was one of my favorite tools alongside Borland C++ for OS/2.

PDC Prolog has its counterpart in the Mercury project: a typed Prolog.

So what is new in 7.3? Well, Visual Prolog is getting ready to go 64-bit.  That and more are detailed at the 7.3 page.

For a while I thought the Prolog would go behind the scenes at PDC as it did when Air Liquide acquired Prologia in France (the home of Prolog IV as CLP.)   Happily PDC now is back to showcasing at least AI and not just smart software applications.

But what will the fate of this Prolog prove to be?  In a decade or two, projects such as Oz and Mercury may be in other hands - but a small commercial venture?

In my experience the strength of Visual Prolog was not the IDE or the GUI-building tools but the debugging.  And that has been further strengthened in the 7.3 release.

There is a "personal version" available for download and extensive examples come with it.

Prolog is part of the Adobe world in the ILOG arena (an IBM acquisition) and in an age of multi-processor 64-bit hardware, Prolog should come into its own in the RDF processing needs of the semantic web (in which regard, see Logtalk and the XSB project as well as http://www.swi-prolog.org/ for alternatives to PDC.)

A typed-Prolog should present no problem to ActionScript Flex developers at home with a typed ECMAScript variant - and "declarative" MXML UI layout.

Other languages superbly suited to processing text: ObjectIcon, Icon 9.5, Rebol, Oz.

Other Prolog implementations of merit: Eclipse-housed AMZI! Prolog.

For OOP for almost any other Prolog than PDC, see http://www.logtalk.org/

When the ICON language was named, Ralph Griswold could not have suspected that computing would come to have an "iconic" interface.  Curl has suffered a similar fate due to haxx.se and cURL.  Sadly, XML has a "prolog" and not a "prologue" so without RDF, searching for news on Prolog and XML is vexing.  So far, Rebol fares best and Oz much better.  As for Mercury and Alice, what's in a name?

http://www.logiquewerks.com/index.html

Wednesday, November 18, 2009

Learning Curl: {value expr} and Curl as an expression-based language

One thing that I have noticed in C# and Java programmers learning Curl is that if they rely on one of the available books (and even to some extent if they use the on-line Curl resources) there is a puzzle about {value some-expression} code blocks.

Here is an example from a book on Curl:
{value 2fortnights + 1day}
This an example of a Curl expression in which quantities are added (note the optional use of the plural for the user-defined quantity.)

{curl 7.0 applet}
{let public constant fortnight:Type = {type-of 14days}}
time in seconds is {value 2fortnights + 1day}
 
In keeping with the Gentle Slope approach to reduce the steepness of the Curl learning-curve, the text
time in seconds is
appears in the browser as text.
We say that this bit of text is at the top-level.
What follows, however, is an expression within curly braces and what we want to display is the result of that addition of the two Time quantities. We could have written this expression using optional parentheses as
{value (2fortnights + 1day) }
The {value } macro has been used to return a value: that is all.
To show that this is so, consider this alternative:
{String (2fortnights + 1day) }
The default constructor for the String class also returns a value (an instance of a String.)
Here is another alternative using assignment to a variable named tos:

{let tos:Time = 2fortnights + 1day}
The Time value held in the variable is {String tos}

And finally a complete alternative applet:

{curl 7.0 applet}
{let public constant fortnight:Type = {type-of 14days}}
{let tos:Time = 2fortnights + 1day}

The time in seconds equals {value 2fortnights + 1day}

Time quantity in the variable is {String tos}

Number of days: {format "%.0f", (tos / 1day)}

which displays in the browser as follows:

The time in seconds equals 2.5056e+006s

Time quantity in the variable is 2.5056e+006s

Number of days: 29

A more compact version of the applet using explicit {br} line formatting rather than relying on Curl to display the extra new lines might have been:

{curl 7.0 applet}
{let public constant fortnight:Type = {type-of 14days}}
{let tos:Time = 2fortnights + 1day}
The time in seconds equals {value 2fortnights + 1day} {br}
Time quantity in the variable is {String tos} {br}
Number of days: {format "%.0f", (tos / 1day)}

And so we proceed to wend our way up the 'Gentle Slope' of Curl.

Sunday, May 24, 2009

The Squeak Smalltalk FOTB: Sophie embraces Java?

The Sophie project site reports that Sophie 2.0 will be in java in order to be browser based.
Was Strongtalk considered? To think what could have been accomplished if Curl, the language, had been an option! Next I suppose I will hear that Croquet or Cobalt has left Squeak for Scala. It must be a typo. The must have mean Gears and JavaScript V8.

You can get Sophie 1.0.4 here and learn about the Future-of-the-book here.

Over the years I have seen 2 expert systems running in PROLOG rewritten by teams looking to use their FoxBase or their java skills so this should not surprise me. After all, the book will no longer contain text or the text will not be in UNICODE strings so why use a text-focused language with graphics. Or were ICON, UNICON or REBOL deemed more obscure than Squeak? Here's my tip: prototype Sophie 3.0 in Curl using the any type with all preprocessing directives turned at the lowest levels. Then implement it in your most effective language based on your project's developer pool.

Perhaps what they were choosing was not the language but the VM, and in that case the JVM would not be a bad choice if the CINCOM Smalltalk VM was not available for the terms of their license. But by the time 2.0 is released, they could well have made a major contribution to Clean Slate Smalltalk, or Strongtalk, or Self, or Io. And in a project such as this, Scala with traits would look to be a natural given the prospects of major refactoring in the future of the project (traits are to refactoring as were classes to OOP components.) Ok. Not a word about Rebol. Well, maybe one word: a project such as this needs to have the types on the side of the values, not the slots. What has been termed "cash instead of personal checks". Chapter the last.

Tuesday, August 7, 2007

GRAILS and Groovy tip

If you try out groovy Grails on Windows as an open-source web application framework, I suggest you install it as a sub-directory of your Groovy directory.
You will want to knwo that your groovy is running fine: in my case I added
set CLASSPATH=I:\groovy-1.0\groovy-1.0.jar;%CLASSPATH%
to my groovy-1.0\bin\groovyConsole.bat I also have three ENV variables defined: GROOVY_HOME, GROOVY_JAR and GRAILS_HOME and both HOME var's are in my path with \bin appended to them.

With that done, you can go into the Grails bin and edit the
grails.bat
I think that there is no point avoiding at least this much:
set CLASSPATH=
because even with my own classpath tool it is just too much grief. Grails does not need your classpath but having one is a problem. The top of my grails.bat now reads
REM set groovy_home=I:\groovy-1.0
REM set GRAILS_HOME=%GROOVY_HOME%\grails-0.5.6
REM set path=%groovy_home%\bin;%grails_home%\bin;%PATH%
REM set GROOVY_JAR=groovy-1.0.jar
set classpath=
To test that things are running start in the grails\bin with
grails help
which should run error-free and list the grails commands. From there you should be OK following the Grails Quick Start steps. Until help comes up error-free, you have an issue.

One last tip: Grails will create your web app root directory in the directory you are in at the time you execute
grails create-app
which in my case is running
I:\groovy-1.0\grails-0.5.6\scripts\CreateApp.groovy
so you do not want to be in .\grails\bin on your command line. If you have not installed the Microsoft Power Toy Open Command Window which launches CMD.exe from any folder in the file explorer, you will want to do so ... whether you are using Grails or Rails without an IDE.

Tuesday, July 31, 2007

Windows and the Tea Shell

The Tea shell for the JVM has been available as version 3.2.2 for some months now.

There is no problem running the shell under Windows if you had Tea 3.1.0 up and running.

The first problem is that 3.2.2 includes no TEA.BAT in the tgz file. Just get the old 3.1.0, extract the bat file and update it to suit your install.

Tea must find a GNU jar for regexp and a Xerces jar for XML parsing. I reference them explicitly in a temp CLASSPATH in that BAT, e.g.,
set CLASSPATH=%TEA_BASE_DIR%;%TEA_BASE_DIR%\xerces-1.4.4.jar;%TEA_BASE_DIR%\gnu-regexp-1.0.8.jar;%CLASSPATH%

Tea is intended to bring multi-paradigm programming to the JVM. It is a java-based functional langauge with extensions for procedures and classes. This is another language intended to be component 'glue'. The selling point is that it is in java.

Other multi-paradigm languages either have their own compiler written in C or are using libraries implemented in C. Tea is java so one positive is that you get javadocs. The tea reference javadoc lists about 20 functions as the language core.

As a functional language Tea is intended to make the use of closures easy: functions are first-class objects as in JavaScript. In many respects the object system is like Smalltalk: members are private; methods are public. Code blocks in {} come with their contexts as closures. Every statement is at least a word which invokes a function. Lists are like Smalltalk collections: they can contain objects of mixed types. Unlike JavaScript, there is no literal notation for functions, but they can be loaded at will from jars or from raw source files using the source word.

Variables are not pre-typed, but they must first be declared with a define. The define word is over-loaded 3-fold: define a variable; declare a variable to have a value; define a variable to be a function as declared. The define word returns what it defines (it, too, is a function.) The set! function is used to re-assign a variable and anonymous functions can be had using the lambda function. Much like Smalltalk's collect: there is a map function to iteratively apply a function to a list. For lists of lists there is the function map-apply. Unassigned vars are returned with the value null. But note this sigil use:
define nativeParser $null

The syntax is very simple. Statements end at end-of-line. Comments start with octothorpe. You get variable values with a prefixed $ sigil. Other scripters will feel comfortable. The type tests use function? string? symbol? int? pair? which is extended to boolean tests as same? not-same? null? and not-null?. Lists use parentheses and, thankfully, no commas.

Lists are very much Scheme, as in
define testPair [cons "first" "last"]
where [car $testPair] gives "first and [cdr $testPair] give "last".
List are built from such pairs; the last pair in the list references a pair where both slots are null. With syntactic sugar our test list can be declared as
define testPair ( "first" "last" )

The Smalltalk procedural style is made possible by using the $ sigil.
For example, if you have a database connection in variable conn then
define sqlStmt [$conn statement]
returns a statement. The difference from Smalltalk can be seen when the query is created: there is no need for a colon, as in
define dataSet [$sqlStmt query "SELECT client_id FROM new_customers"]
but what is different is the use of [...] and not as a code-block { expression }. What is happening, of course, is a command substitution as in Tcl. The {} are used to defer evaluation as in a while loop.

The load function is rather like Jython: it gives access to java classes including Tea functions in those java jars.

But why would you use Tea? One possiblity is that you already know Scheme and Tcl or need a rapid way to work with closures in the JVM. But why not simply use JavaScript? One curiousity is that Tea is promoted as a language for rapid-prototyping, but in Lisbon it has been used for major banking and telco systems. But was it used only as glue code? Not at over a million lines according to Tea's own 'whitepaper'.

One observation: Tea is almost the opposite of Curl and Rebol. It is only now adding GUI and networking. But why add them if this is a scripting language for the JVM? It must be irresistable. Some people spoil their kids; some people spoil something else. And most of us seem to bloat if we are not kept on track ... and reminded that what we leave out can be as important as what we put in.

In Tea you get a hint of what the future holds if we shift away from 'C' and the OS to life with a VM.

Likely Tea will never have the momentum to break into North American markets unless it is embraced by a major player. It does have an advantage over Jython: there is no shifting Python beneath it. Then again, functional may becoming fashionable... even at Microsoft.

If you are a secret Schemer masquerading in Java or someone who can't thrive without a little Tcl, you may want to have some Tea... and lemon? Ah, right. They already added the syntactic sugar ...

PS There is another TEA which is the Tiny Encryption Algorithm and yet another Tea that is a strongly-typed templating language for managing servlets from the Disney TeaServlet project at what was once GO.COM Green tea. Black tea. Chá, anyone?