UMBC ebiquity research group Building intelligent systems in open, heterogeneous, dynamic, distributed environments
16 May 2008, 07:41:32 EDT  
Programming

Archive for the 'Programming' Category

Parsing Perl considered undecidable

January 28th, 2008, by Tim Finin, posted in Programming, CS

Jeffrey Kegler on perlmonks.org offers a proof that static parsing of Perl programs is undecidable in his post Perl Cannot Be Parsed: A Formal Proof. The approach is to show that parsing a tricky example (one short line of code!) can be reduced to solving the Halting problem. Here’s a piece of it.

Kennedy’s Lemma: If you can parse Perl, you can solve the Halting Problem.

To prove Kennedy’s Lemma, we assume that we can parse Perl. In particular this means we can take the following devilish snippet of code, concocted by Randal Schwartz, and determine the correct parse for it:

    whatever / 25 ; # / ; die “this dies!”;

Schwartz’s Snippet can parse two different ways: if whatever is nullary (that is, takes no arguments), the first statement is a division in void context, and the rest of the line is a comment. If whatever takes an argument, Schwartz’s Snippet parses as a call to the whatever function with the result of a match operator, then a call to the die() function.

See his post for the complete proof.

StopBadware campaign

January 27th, 2006, by Amit, posted in Policy, Security, Programming

A good read at http://stopbadware.org, it seems to be a MEGA campaign by Google, Levono and Sun Microsystems.

“Several academic institutions and major tech companies have teamed up to thwart ‘badware’, a phrase they have coined that encompasses spyware and adware. The new website, StopBadware.org, is promoted as a “Neighborhood Watch” campaign and seeks to provide reliable, objective information about downloadable applications in order to help consumers to make better choices about what they download on to their computers. We want to work with both experts and the broader internet community (.orgs and .edus) to define and understand the problem.”

Ruby and Lisp and the Web

December 4th, 2005, by Tim Finin, posted in Programming, Web, Semantic Web

I promised my programming languages class that we’d look at Ruby before the semester is over and now it’s time to deliver. I made this promise partly to force myself to learn more about Ruby and Rails. As it’s often the case, the instructor ends up learning much more than the students. Ruby sure looks interesting, fun and useful. We have a highly functional, semantic-web enabled site built with php and mysql, but the innards are complex and hard to understand. I’m sure that a rails implementation would be much simpler and easier to maintain and extend. I found a long and thoughtful blog post by Eric Kidd comparing Ruby and Lisp.

“Years ago, I looked at Ruby and decided to ignore it. Ruby wasn’t as popular as Python, and it wasn’t as powerful as LISP. So why should I bother?

Of course, we could turn those criteria around. What if Ruby were more popular than LISP, and more powerful than Python? Would that be enough to make Ruby interesting?

Before answering this question, we should decide what makes LISP so powerful. Paul Graham has written eloquently about LISP’s virtues. But, for the sake of argument, I’d like to boil them down to two things:

  1. LISP is a dense functional language.
  2. LISP has programmatic macros.

As it turns out, Ruby compares well as a functional language, and it fakes macros better than I’d thought.”

Ruby even has continuations, which, as Mikael Brockman shows in his entertaining post continuations on the web, simplify web programming.

Finally, if you want to check out Ruby for the first time, try why the luck stiff’s Interactive Ruby tutorial.

Follow-up on SemanticWorks 2006 (owl:imports)

November 16th, 2005, by Harry Chen, posted in Programming, Semantic Web

A while back I wrote a blog that reports my user experience with SemanticWorks 2006. In my blog, I claimed that the software doesn’t seem to support the use of owl:imports when editing an OWL ontology.

Today an anonymous person is kindly enough to inform me that I was wrong — see my blog’s comment section. I took this person’s advise and try the software again. This time I’m able to use owl:imports when editing an ontology.

The following shows I successfully defined an ontology that imports SOUPA Document ontology, and which in turn imports SOUPA Person and SOUPA Time ontologies:

Screenshot-1

The following shows the class view of all classes that are imported from different ontology documents:

Screenshot-2

The following shows the property view of all properties that are imported from different ontology documents:

Screenshot-3

Should you have other comments, drop me message.

Lisp in 500 lines of C

October 30th, 2005, by Tim Finin, posted in Programming, AI

Lisp500 is a 500-line implementation of an interpreter for an informally specified dialect of Lisp. Be forewarned that one reason it’s only 500 is that there are neither comments nor blank lines. It has a goodly number of Common Lisp features, though.

Want Microsoft Source code?

October 21st, 2005, by Anand, posted in Technology Impact, Technology Policy, Programming, GENERAL

Microsoft Shared Source Initiative

These new licenses represent a broad spectrum of approaches needed to facilitate an ever-growing, rich set of technologies for release.

The three licenses are:

• Microsoft Permissive License (Ms-PL) — The Ms-PL is the least restrictive of the Microsoft source code licenses. It allows you to view, modify, and redistribute the source code for either commercial or non-commercial purposes. Under the Ms-PL, you may change the source code and share it with others. You may also charge a licensing fee for your modified work if you wish. This license is most commonly used for developer tools, applications, and components.

• Microsoft Community License (Ms-CL) — The Ms-CL is a license that is best used for collaborative development projects. This type of license is commonly referred to as a reciprocal source code license and carries specific requirements if you choose to combine Ms-CL code with your own code. The Ms-CL allows for both non-commercial and commercial modification and redistribution of licensed software and carries a per-file reciprocal term.

• Microsoft Reference License (Ms-RL) — The Ms-RL is a reference-only license that allows licensees to view source code in order to gain a deeper understanding of the inner workings of a Microsoft technology. It does not allow for modification or redistribution. This license is used primarily for technologies such as development libraries.

Overcoming addiction to Lisp

June 16th, 2005, by Tim Finin, posted in Programming, AI

Spurpurl confesses on perlmonks.org (via Lemonodor):

Hello fellow monks, my name is spurperl and I’m a Lisp addict,

My story may sound familiar to many of you - it’s been years that I’m having a love-neglect relationship with Lisp and its brethen. Since I learned Lisp, I’m in awe for its elegancy, how right it feels, and how naturally it lends itself to the solution of tough problems.

But… I’m just failing to find practical applications for it in my work / hacking. Any time I think of writing something, I usually end up with Perl - a language I know much better, am quite productive with, that has tons of libraries and a terrific place to consult gurus (the monastery, of course).

Lately a decision blooms in my heart - to detach, once and for all. To overcome my addiction to this language. I learned it, coded in it, I understand it. I was enlightened with its spirit, but I want to move on. I want to write code in my precious Perl without feeling guilty for leaving Lisp behind.

One idea that sprang to my mind is to break the illusion. Namely, find Lisp code I found elegant, Lispy and beautiful, and rewrite it in Perl, with code having the same elegant traits.I feel I’m not the only one with these doubts, that many Perl hackers feel that “I like Lisp and always wanted to deepen my knowledge in it, but I just want to get my job done”.

The Little JavaScripter

February 13th, 2005, by Tim Finin, posted in Programming, Web

lambda headWow, Douglas Crockford’s The Little JavaScripter made me vow to take a more serious look at Javascript. Like most of my colleagues, I’ve thought of it as another weak, poorly designed and inelegant programming language. Crockford points out that

“JavaScript has much in common with Scheme. It is a dynamic language. It has a flexible datatype (arrays) that can easily simulate s-expressions. And most importantly, functions are lambdas. Because of this deep similarity, all of the functions in The Little Schemer can be written in JavaScript. The syntaxes of these two languages are very different, so some transformation rules are needed.

I have prepared a file containing primitive functions (cons, cdr, etc.), a pair of functions (p and s) for converting from s-expressions to text and back), and most of the functions in the book, expressed in JavaScript. Pay particular attention to The Applicative Order Y Combinator, one of the most strange and wonderful artifacts of Computer Science.”

Now, if I can only figure out how to use the Y operator on one of our web pages…

Java for RFID

January 18th, 2005, by Pavan, posted in Programming, Pervasive Computing

Sun Brings Java to RFID Tagging :Today at the National Retail Federation Convention, Sun Microsystems announced an entry-level RFID solution for retailers based on the company’s Java System. Sun also unveiled what it calls “Industry Solution Architectures” for more complex RFID management such as integration with back-end enterprise systems.

Radio frequency identification (RFID) tags are small transmitters placed on products, which are often used for tracking or inventory purposes. According to the company, Sun’s Java System RFID software “enables customers to process RFID tagged cases or pallets at the rate of approximately one to two seconds per unit and is designed to help customers meet retail mandates in approximately one week.”

Bots of mass destruction

January 17th, 2005, by Tim Finin, posted in Programming, Agents

While militaristic, this might be interesting as a basis for projects in a course on multiagent systems or Java.

Robocraft, developed for MIT’s 6.370 class, is a real-time strategy game. Two teams of robots roam the screen collecting resources and attacking each other with different kinds of weapons. However, in Robocraft each robot functions autonomously; under the hood it runs a Java virtual machine loaded up with its team’s player program. Robots in the game communicate by radio and must work together to accomplish their goals. The software and competition specifications are available for download.”

Learn LISP from a comic book!?!

December 6th, 2004, by Tim Finin, posted in Programming

“Ever wonder what makes LISP so powerful? Now you can find out for yourself- And you don’t even have to install anything on your computer to do it!”. So begins Conrad Barski’s tutorial Lisp comic, Casting SPELs in Lisp. “Anyone who has ever learned to program in LISP will tell you it is very different from any other programming language. It is different in lots of surprising ways- This comic book will let you find out how LISP’s unique design makes it so powerful!” The online comic book tutorial has small bits of LISP code throughout which, when collected and entered into a LISP interpreter implement a simple text adventure game. This sure beats learning LISP from JCM’s LISP 1.5 Programmer’s Manual

Mustang Java

November 18th, 2004, by Tim Finin, posted in Programming

Sun invites outside involvement with Java 6. Java 6 is expected sometime in the first half of 2006.

“The new version will be easier to manage, exposing information that outside management software can use to make control decisions, said Mark Reinhold, chief J2SE engineer. And it will be easier to find problems, with an “attach-on-demand” feature that can let debugging software graft onto software while it’s running instead of just before it’s launched. … Another item on the list is support for a basic set of Web services called WS-I, Hamilton said. That basic set, standardized through the Web Services Interoperability organization, had been scheduled for the Tiger release. … And Mustang [1] will have better integration with graphical user interfaces, including Microsoft’s upcoming Longhorn version of Windows, Reinhold said. “

[1] Mustang is the codename for java 1.6. Tiger was the
codename for for Java 1.5.

You are currently browsing the archives for the Programming category.

  Home | Archive | Login | Feed

Recent posts

  • Students: brand yourself with a blog
  • Social Data on the Web workshop at ISWC 2008
  • Petrini: Streaming Applications on the Cell BE Processor, 3pm 5/13 UMBC
  • Gossip-Based Outlier Detection for Mobile Ad Hoc Networks
  • Int. Conf. Semantic Web deadlines this week and next (ISWC 2008)

  • Ebiquity community

  • Fieldmarking data blog
  • Geospatial Semantic Web
  • Harry Chen thinks aloud
  • Planet social media research
  • Social media research blog
  • TrackForward by Kolari
  • UMBC GAIM

  • UMBC