Archive for the ‘languages’ Category

Mono Now Has .NET 3.0 Support and 3.5 Features like LINQ and Expression Trees

Friday, July 25th, 2008

Great news!  Mono has made it to .NET 3.0 support and this includes some of the latest stuff like LINQ expressions.

I am pleased to announce that Mono C# compiler (gmcs) has now full C# 3.0 support. Most of the features has been available since Mono 1.2.6 release. However, with the upcoming Mono 2.0 release we will also support complex LINQ expressions and mainly expression trees which is fairly overlooked new feature with a lot of potential.

For anyone interested in compiling and running this LukeH’s slightly extreme LINQ example I have good news. It compiles on Mono and it runs as fast as on .NET.

Restlet RESTful Lightweight Kit for Java

Friday, June 20th, 2008

Finally rest for all that boilerplate in Java.  At each turn of lots of Java frameworks you are bombarded with layers.  I felt this long ago and see it in the developers eyes that work with Java.  Java can be easy, it can be RESTful and it will make you look sharp.

Lightweight REST framework for Java

Do you want to embrace the architecture of the Web and benefit from its simplicity and scalability? Leverage our innovative REST engine and start blending your Web Sites and Web Services into uniform Web Applications!

Java is making things more lightweight now with lots of emerging kits that compete with other web ready platforms like Python, Ruby, .NET, PHP etc. After this many years things get bloated and need to be simplified.  I think this will start winning people over in this direction.

The Common Baseplane Method to Caching — memcached

Tuesday, May 27th, 2008

If you have ever worked on a massively high trafficked website, you know that cache is very important to keeping the server count down and being a superhero to your database servers. Cache can be bad and overly optimized but when you hit a certain threshold, relational databases, databases that are dimension modelled for data warehouse, and even server resources get exhausted. At that point you have two options, buy more servers, or more likely, cache read data.

Each platform has their own way to do this, but there is a common baseplane way to do caching, yes even in .NET. That is with memcached. Memcached is a very common and useful tool that makes caching data and cache layers in an application something that can be the same on every platform. The benefit of using memcached is it is open, common and it has APIs for nearly every popular web development platform (and can be wired in easily to platforms that don’t have their own cache mechanism). Why write your caching layer specific to a certain platform when you can memcache?

If you write high performance web apps and don’t memcache, I feel bad for your server budget and your late nights when that ad buy hits or something popular on your site becomes all the rave.

Perl API

An object-oriented Perl module can be found on CPAN as Cache::Memcached or in Subversion (ChangeLog). (GPL/Artistic)

The Perl API takes advantage of the server’s opaque flag support and sets its “complex” flag whenever the object being stored or retrieved isn’t a plain scalar. In that case, the Storable module is used to freeze and thaw the value automatically going in and out of the memcached.

There is also Cache::Memcached::Fast—another Perl client written in C, largely compatible with the original Cache::Memcached. Available on CPAN at http://search.cpan.org/dist/Cache-Memcached-Fast/.

PHP API

There are tons of PHP libraries available, in different conditions. But it now seems there’s an official one:

Python API

The Python client we’d previously released was just a prototype, and we don’t have regular Python programmers on hand. The folks at Tummy.com have took over maintenance. See ftp://ftp.tummy.com/pub/python-memcached/ for the latest versions.

Ruby API

Java API

A Java API is maintained by Greg Whalin from Meetup.com. You can find that library here:

An improved Java API maintained by Dustin Sallings is also available. Aggressively optimised, ability to run async, supports binary protocol, etc. See site for details:

C# API

There are multiple C# APIs:

C API

Multiple C libraries for memcached exist:

  • apr_memcache by Paul Querna; Apache Software License version 2.0
  • libmemcached by Brian Aker; BSD license. This is a new library, under heavy development.
  • libmemcache by Sean Chittenden; BSD license. This is the original C library. It is no longer under active development. You should try libmemcached instead.

Postgres API

The pgmemcache project allows you to access memcache servers from Postgresql Stored Procedures and Triggers. More details and downloads are available at:

Chicken Scheme

Lua

MySQL API

The memcache_engine allows memcache to work as a storage engine to MySQL. This means that you can SELECT/UPDATE/INSERTE/DELETE from it as though it is a table in MySQL.

A set of MySQL UDFs (user defined functions) to work with memcached using libmemcached.

Protocol

To write a new client, check out the protocol docs. Be aware that the most important part of the client is the hashing across multiple servers, based on the key, or an optional caller-provided hashing value. Feel free to join the mailing list (or mail me directly) for help, inclusion in Subversion, and/or a link to your client from this site.

The best part, they support all good platforms and even Lua, and wisely they left out VB.NET, no worries, VB.NET’ers will never know. Only kidding…

Finally, memcached is distributed, most cache layers included with platforms listed above are in process and per machine.  If you are running your code on a webfarm memcached is the only way to go.

MVC Frameworks for PHP

Tuesday, May 27th, 2008

MVC is all the rave these days with excellent toolkits for all languages that help to define good structure for long term projects and maintenance. From Django (Python), to Rails (Ruby), Spring (Java), Maverick or Microsoft MVC (.NET/C#/Mono) and last but not least PHP MVC Frameworks.

PHP gets alot of heat mainly because it is critical mass and when that happens mediocrity comes in but since PHP5, PHP has really grown to be a great web development toolkit with many frameworks to choose from. But which one do you choose for your development? Do you want an MVC, or do you want to piece together an MVC from a template library, model framework and custom controller?

Well if you want to pick an MVC there are some great ones.

There is a site that has a decent ranking that is similar to my own likings in PHP frameworks that lists them like this:

1 Akelos (avg: 4.4)

2 PHPDevShell (avg: 4.3)

3 Symfony Project (avg: 4.3)

4 CodeIgniter (avg: 4.3)

5 Prado (avg: 4.1)

6 ZooP (avg: 4)

7 CakePHP (avg: 3.9)

8 Zend (avg: 3.4)

9 QPHP (avg: 3)

I have not used QPHP, Zoop, Prado or PHPDevShell but plan on doing reviews of all of them. I have a simple application that i will be building in the latest versions of each platform to help show highlights, pros, cons and the ins and outs of each.

Why? And why PHP? I have long been a developer of web sites and applications. Until around 2005 PHP was not accepted in enterprisey, but this is changing. Usually .NET, Java, Perl, Python and recently Ruby were the dictated choice of the clients or environments to code in. But with PHP5 now stable and PHP4 being retired, PHP is a insurgent platform that muscled its way into the web development world in a grassroots effort, from the bottom up. That takes work and the platform deserves a second look from people that have written it off.

PHP runs many large sites from Facebook, to Digg, to Yahoo and many other platforms even Microsoft is trying to buy. PHP might even be responsible for MySQLs meteoric rise to just recently being purchased by Sun. It is a platform that is being used to build platforms. It works on any platform, it is low-bar entry and high bar scalability and architecture if using a great framework or architecture (if custom or using an existing framework).

I am an engineer, developer, architect and interactive/game developer, I use the tools for the job no matter what is chosen. Any good developer can make a system work even with bad technology but today there isn’t alot of that going around. So many great platforms, languages and frameworks, why limit to a certain OS or platform. Open your horizons and stop specializing yourself out of special skills. Choose a tool that works on just about anything on the server side and doesn’t take over servers and take 3 times as long to develop. Try some PHP5 MVC frameworks today.

Is Your .NET Application/Assembly Mono Ready? Find Out With MoMa

Saturday, May 17th, 2008

Well Mono has finally reached 2.0. This is great news!  .NET skills now can span *nix, OSX, and Windows platforms.  But is your app or assembly capable of running on Mono?  Find out with MoMa.

Of course this is just a heuristic check and only finds out if your application on the surface has issues with running on a mono platform such as calls to p/invoke to windows apis or unsafe code that uses native calls but it is a great place to start.

The Mono Migration Analyzer (MoMA) tool helps you identify issues you may have when porting your .Net application to Mono. It helps pinpoint platform specific calls (P/Invoke) and areas that are not yet supported by the Mono project.

While MoMA can help show potential issues, there are many complex factors that cannot be covered by a simple tool. MoMA may fail to point out areas that will cause problems, and may point out areas which will not actually be an issue.

Use the results provided as a guide to get you started on porting your application, but remember the true test is actually running your application on Mono.

For a description of the errors that MoMA detects and how to deal with them, see MoMA - Issue Descriptions.

I have recently been really interested in making platforms and applications that aren’t limited by the OS they are contained in.  Thus mono is a very interesting platform now that it supports 2.0 fully and all the generic goodness to limit boxing/unboxing, common code between .net 2.0 apps (which are pretty much mainstream now) and developing for more of a standard that ensures your apps are portable.

Granted .NET 3.0 and 3.5 (pretty much the same version really with the addition of new frameworks such as WCF, LINQ which is very cool and functional as well as Silverlight) but most places deployed code is still .NET 2.0 and the poor souls working on very constricting .NET 1.0 and 1.1.

Also, recently Moonlight the Mono version of Silverlight has been released for alpha.

Baseplane Tool: Tenjin Templating Library (pyTenjin, jsTenjin, phpTenjin, rbTenjin, plTenjin)

Monday, April 7th, 2008

Tenjin is a great templating library that gets not only cross platform but baseplane ability to make templating very similiar (and FAST) across many languages. pyTenjin and phpTenjin is currently what I am using but there are executions for Ruby, Perl and Javascript.

Here is a list of the Tenjin Templating engines:

Changes
(Python) (Ruby) (PHP) (Perl) (JavaScript)
User’s Guide
(Python) (Ruby) (PHP) (Perl) (JavaScript)
FAQ
(Python) (Ruby) (PHP) (Perl) (JavaScript)
Examples
(Python) (Ruby) (PHP) (Perl) (JavaScript)
Presentation
2007 LL Spirit LightningTalk (full-version) (Japanese)

Here is what the template markup looks like:

This

<table>
<tbody>
<?py i = 0 ?>
<?py for item in [’<foo>’, ‘bar&bar’, ‘”baz”‘]: ?>
<?py     i += 1 ?>
<tr>
<td>#{item}</td>
<td>${item}</td>
</tr>
<?py #end ?>
<tbody>

</table>

Produces This

<table>
<tbody>
<tr>
<td><foo></td>
<td>&lt;foo&gt;</td>
</tr>
<tr>
<td>bar&bar</td>
<td>bar&amp;bar</td>
</tr>
<tr>
<td>“baz”</td>
<td>&quot;baz&quot;</td>
</tr>
<tbody>
</table>

Here are some speed results

MacOS X 10.4 Tiger, Intel CoreDuo 1.83GHz, Memory 2GB
Language Template Engine Test#1(sec) Test#2(sec)
Python(2.5.1) pyTenjin (0.6.1) 6.96 5.61
Cheetah (2.0) 20.36 19.82
Django (0.9.5) 71.33 59.80
Myghty (1.1) 107.88 19.30
Kid (0.9.6) 380.24 378.96
Genshi (0.4.4) 560.30 271.69
Mako (0.1.9) 17.78 13.49
Templetor (web.py 0.22) 428.19 61.53
Ruby(1.8.6) rbTenjin (0.6.0) 7.34 4.52
eruby (1.0.5) 12.29 11.53
ERB(def_method) (Ruby1.8.6) 36.73 5.85
PHP(5.2.0) phpTenjin (0.0.1) 5.39 3.64
Smarty (2.6.18) 10.84 10.21
Perl(5.8.8) plTenjin (0.0.1) 10.42 5.72
Template-Toolkit(XS) (2.18) 103.58 26.30
HTML::Template (2.9) 46.70 30.21
JS(spidermonkey) jsTenjin (0.0.1) 19.00 12.98
JS(Rhino, JDK5) jsTenjin (0.0.1) 24.29 19.15
Java(JDK5) Velocity (1.4) 22.80 11.41
Velocity (1.5) 20.01 8.42

JSON-RPC Implementations

Thursday, March 20th, 2008

JSON-RPC is the answer to the argument that XML RPC is too verbose and bloated and convoluted.  JSON is just about as simple as you can get in data formats and it is becoming a great baseplane standard and is a tool that spans many platforms.

“Does distributed computing have to be any harder than this? I don’t think so.”

Can it be even simpler ?

JSON-RPC is lightweight remote procedure call protocol similar to XML-RPC. It’s designed to be simple!

JavaScript

C

C#

Erlang

Java

Lisp

Lua

Perl

Php

Python

Ruby

Frameworks

MonoDevelop 1.0 Released

Tuesday, March 18th, 2008

mono-logo.pngMono is a great open source .NET implementation that has been looking to being a baseplane dream to .net development. They even have Moonlight which will eventually be caught up with Silverlight development.

However today mono gets a killer IDE in the MonoDevelop name.

[insertname]Develop projects are largely based on the SharpDevelop IDE that is one of my favorites with .net and is open source. If you are looking for a FAST IDE SharpDevelop is that. In the FAQ Miguel mentions that MonoDevelop is a port or branch of SharpDevelop which is great news for quality, speed and usability.

FlashDevelop is also another great kit based on this IDE framework. I am very pleased Mono is using the same standard for IDEs that mimic VS.NET only much more speedy and usable in SharpDevelop and FlashDevelop (both .net apps themselves and two of the only good winforms apps there ever were).

mmI highly recommend mono and MonoDevelop. These are tools that are baseplane languages and platforms that have all the benefits of .net development but for any platform and now for any platform as an IDE. One problem with FlashDevelop is that it is only for Windows machines but maybe MonoDevelop will influence and will allow it for other platforms as well and everyone will be able to use the best IDE there is for flash and flex development.

In the meantime if you are a .net developer and want to develop for multiple platforms not just Windows then Mono is your tool and MonoDevelop is your IDE.

The main features of MonoDevelop are:

  • Customizable workbench, including custom key bindings, custom layouts, and external tools.
  • Support for several languages, with C#, VB.NET and C/C++ support included, and Boo and Java (IKVM) support available as separate add-ins.
  • Support for code completion and type information tooltips.
  • Refactoring operations to simplify changes like renaming types and type members, encapsulating fields, overriding methods, or implementing interfaces.
  • Code navigation operations such as jumping to variable definitions and finding derived classes.
  • Easy to use GUI designer for GTK# applications, also supporting the creation and management of custom GTK# widget libraries.
  • Integrated source code version control, with support for Subversion.
  • Integrated unit testing based on NUnit.
  • Support for ASP.NET projects, allowing web projects can be built and tested on XSP.
  • Integrated database explorer and editor (beta).
  • Integration with Monodoc, to provide documentation about classes.
  • Support for makefiles, both generation and synchronization.
  • Support for Microsoft Visual Studio project formats.
  • Packaging system that allows generating tarballs, source code and binary packages.
  • Command line tools for building and managing projects.
  • Support for localization projects.
  • Extensible add-in architecture.

Is Python Becoming A Market Baseplane Language?

Thursday, March 13th, 2008

Sun has been on a rampage lately. They recently purchased MySQL (which has some questions with InnoDB) but they also are supporting Python and integrating it into the VM offerings with Jython.

So now we have Google (They employ Guido), Microsoft (IronPython) and Sun (Jython) all turning into Python-istas. Does this mean Python is destined for greatness in the near future? Well I recommend learning it. It is a great language and it has a high productivity rate. Time will tell if it has the ability to be in extremely large code bases. I think it is just a matter of the architecture and organization as with any project.

Jonathan Schwartz at Sun mentioned also taking the “J” out of “JVM” to just make a VM much like a .NET framework. So Microsoft copied Java with C# the JVM and added multiple languages. Then Sun comes back and added multiple byte code compiled languages. And then they both focus on dynamic engines to implement versions of Python, Microsoft doing this within their DLR.

Many times the larger market languages that end up running business or “enterprisey” are heavily influenced by companies, in addition to the other demands from consumers, which here is programmers. So when the big three are all banking on Python as a draw there is a definite market draw there and a tell on the future. But I think it is apparent that Python is becoming a standard market baseplane language.

It is great to be able to use other libraries from .net with IronPython and java libraries with Jython. It has found a way to integrate with the current infrastructure and the language has low bar entry but deep benefits. Python is snaking its way into the market.

Python is so non verbose…

import sys
import clr
from System.IO import Path, Directory, FileInfodir = Path.Combine(sys.prefix, 'DLLs')

if Directory.Exists(dir):
    sys.path.append(dir)
    files = Directory.GetFiles(dir)
    for file in files:
        if file.lower().endswith('.dll'):
            try:
                clr.AddReference(FileInfo(file).Name)
            except:
                pass

This sample is from IronPython showing adding dynamic references to all dlls loaded.

Check out this HTML/XHTML parser in pure Python.

from HTMLParser import HTMLParserclass MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print "Encountered the beginning of a %s tag" % tag
def handle_endtag(self, tag):
print "Encountered the end of a %s tag" % tag



baseplane - technology platforms is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

© 2006-2008 Ryan Christensen - template by drawk }}



Unless othewise specified the content in this site is licensed under a Creative Commons License
Your Ad Here Your Ad Here Your Ad Here Your Ad Here