C– for cross compiler

In late 1994, when I need to write a programming language it was a pain. You must start with flex, lex and so on, and the way will be very long.

Then I found GCC was able to compile in a pseudo-machine language, already optimized. Then a set of backend was able to emit mc68000, 80×86, power pc code…

I am glad to see now there is a “stripped down” version of the C language to simplify this hard work….
By the way, Fortran has been the first compiled language, appeared near 1957.

“A new perspective on programming-language infrastructure”

Welcome to C–

Suppose you are writing a compiler; how will you get quality machine code? You might write your own code generator—but that’s a lot of work. You might use somebody else’s: perhaps VPO, MLRISC, or the gcc back end. But each of these impressive systems has a rich, complex, and ill-documented interface, and furthermore, to use MLRISC you must write your front end in ML, to use gcc you must write it in C, and so on. You might generate C, if you can live without multiple results in registers, proper tail calls, computed gotos, accurate garbage collection, and efficient exceptions.

You would be much happier with one portable assembly language that could be generated by a front end and implemented by any of several code generators. Such a language should serve as the interface between high-level compilers and retargetable, optimizing code generators. Authors of front ends and authors of code generators could cooperate easily. C– is that language.

What distinguishes C–

The following aspects of C– distinguish it from other compiler infrastructures:

* Other infrastructures focus on adding new optimizations; C– focuses on supporting multiple front ends for multiple languages.

* C– has a machine-level type system, so you don’t have to shoehorn your favorite high-level language into a high-level data model that doesn’t fit.

* C– provides a run-time interface, so you can implement garbage collection and exception handling using the techniques that are best suited to your language.

The run-time interface is the most novel and most distinguishing feature of C–.

via C– Home.

Javascript and Smalltalk

There is a future for SmallTalk? I was a very strong fan of the SmallTalk language, but in the last five years I have seen more and more contraction of its usage in the IT field.

The OLPC project, which uses also Squeak Smalltalk and its done by the core team fo Squeak, is not going very well.

Anyway, Dan Ingalls, one of the father of Smalltalk, is working on a new project called Lively. It is a rewrite of Morphic in Javascript, especially target  for building a Squeak-like interface.

 The interesting part of this work is a paper outlining the limitation of javascript as programming language. I have tried in the past years to look for ajax and or web 2.0 javascript libraries, but I feel very difficult to develop with them.

From the Paper we underline these parts:

Loading multiple JavaScript applications into the same virtual machine is problematic.[…] For instance, if two programs
happen to use the same names for global variables or functions, the overlapping variables or functions of
the first program will be replaced with the corresponding features of the second program, resulting in
unexpected behavior in the subsequent execution of the first program. Since JavaScript will not typically
give any warning messages or errors in such situations, the resulting behavior can sometimes be a total
surprise; in many cases the errors resulting from such situations may not be discovered until much later.


Evolutionary development approach is a necessity. Due to the highly permissive, error-tolerant nature of
JavaScript, JavaScript programming requires an incremental, evolutionary software development
approach. Since errors are reported much later than usual, by the time an error is reported it is often
surprisingly difficult to pinpoint the original location of the error. Error detection is made harder by the
dynamic nature of JavaScript, for instance, by the possibility to change some of the system features on
the fly.


A lot of room is left in optimizing JavaScript performance. Current JavaScript virtual machines are
unnecessarily slow. Even though JavaScript is a significantly more dynamic language than, for instance,
the Java programming language, there is no fundamental reason for JavaScript VMs to run two orders of
magnitude slower than Java virtual machines.


Memory management capabilities of the current JavaScript VMs are poorly suited to large, long-running
applications. Current JavaScript virtual machines have simple, 1970's style garbage collectors

 The reason of these issue are simple:JavaScript was intially a language for web developers, small and easy to use, and very compact.
Absence of errors or warning is a nightmare, if you care of your digitating time.
And Javascript is slow because no one will write  long script with it.

A very compact and clean discussion can be found in http://javascript.crockford.com/javascript.html 

Fixing these problems is hard. Until the current  implementation will not provide a better way of error detection, writing javascript code will be a very long and time-consuming task.

And using a so old garbage collector, give a chance to a c/64 BasicV2 to beat your code:  you are awared, guys :)

Anyway, there is a good set of javascript libraries out of there (prototype and jquery, for instance but not only), so you should be quite happy 




Dynamic languages troubles

I have read http://www.manageability.org/blog/stuff/chandler-failure and I think it is very danger way of exposing concepts.

In the article pointed out, the quite dead Chandler project is compared to the multi-billion Eclipse project. And then a too easy analysis is done against dynamic languages, where Java is the absolute winner.

I will try to fix some of the things said there, and to add also my two cents here :)


First of all, I use Java a lot, but I am also a fan of dynamic languages. Every tool has its place in the world, and I will avoid some holy war here. 

Anyway, it is important to understand major differences between very distant projects.


First of all, Eclipse is a very huge project, developed by IBM and based from the beginning with a very strong hype on plugin modularization.

The effort pushed inside Eclipse is very huge and come also from the San Francisco Project. Other IDEs (like JBuilder and Together) stops fighting Eclipse years ago, and eventually failed even to sell their stuff.

 So there are no similar example to Eclipse in Python/Ruby/Perl world. Even in PHP is hard to find a so huge and well designed program. And the languge here is less important: a company big as IBM can also code in PL/I all its stuff, without so much pain :)

Second, PHP is very successful language, even if a bit too insecure, at the present time.

PHP Language has poor support for modules and so on, but project like Drupal, Joomla and other are full of plugins, quite easy to write.

RubyOnRails is falling down because nobody is understanding why PHP should be abandoned for Rails.

Java architectural model is very well written and Sun worked very hard to it. Java Hot Spot VM is derivered from the Self dynamic language,  and has inside technology difficult to develop in an open source project.

Surely Dynamic languages are strong when there is the one-man-band paradigm: sharing works in Smalltalk was  a bit complex in early days.

Put Perl, python and ruby have a strong modularization concepts, and so this issue is often solved.

I have tried Zope and I think it is weak because:

  • Zope is user is non-existent. Zope user is a super-skilled web master which wants a web CMS without writing so much code.
  • Zope product upgrade is a nightmare
  • A stuck Zope Product can destroy your work. So hosting Zope is a problem
  • A lot of Zope basic objects (like cache accelerators and so on) are poorly minded: they works only on RAM, and are not thinked well. Drupal 5 has more strong theory for this issue, and Drupal is poor PHP code.
  • Zope use a proprietary database, when a simple SQL database with a relational mapper can do the same thing…think twice before reinventing the wheel!
  • Every major Zope releases breaks a lot of the API. This is the most stupid thing you can do as open source developer.

Chandler failed because they tried a very difficult business: calendar software is a very difficult area to address. All operating system (including possibly C/64 :-) has now a huge set of Personal Information Manager software (PIM), and LDAP solves sharing issue for big companies

Even Ximian Evolution is near death.

And your bigger competitor is Microsoft Exchange and… yes… old Unix.

Dynamic lanuages has many lacks, and difficult refactoring is a problem but… remember frefactoring tools was INVENTED under SMALLTALK!

IT is a place where you must be careful… isn't it?