Archive

Archive for May, 2015

Meeting other Spartans in person, a great day in Oslo

May 26, 2015 4 comments

It’s not often I meet people who actually use Delphi on a daily basis these days, and out of those I meet – it’s very rare to meet people in person which masters object pascal completely. But today I had the good fortune of meeting up with Paul Thornton, which I have only talked to a couple of times before in connection with Oslo Delphi Club and on Delphi Developer (FB group).

Best lunch in town, the nighthawk diner

Best lunch in town, the nighthawk diner

As the name hints Paul is originally from the UK but now lives in Oslo with his lovely family. Paul is a highly skilled and successful entrepreneur, with a very exciting project in the pipeline, written (as expected) from the ground up in Delphi. Just the idea of having a full system, custom hardware included, not just a server or a simple client– but the whole shabam written in Delphi sounds like xmas and new-years eve to me, so I was intrigued to learn more about this. And Paul really gave me the grand tour with visits to his top-secret “lair” where he cooks up all manner of awesome solutions, which then plays out on custom designed hardware.

His project really struck a tone because when I was leaving my mind was already busy building a Raspberry PI based data caching module. Which is the closest thing I can get to “custom hardware” 🙂 I mean, programming in general is 90% theory; We spend days, weeks, months working primarily in the realm of metaphysics. Sculpting ideas, assessing cause and effect, building hierarchies and data relationships — and there are days when I think to myself “oh why didn’t I finish those 3 years studying electronics!” because writing software that interacts with real, physical hardware is so cool!

The Raspberry PI phenomenon (which is the best word I can come up with) has really done wonders. I have 100 ideas what to use them for, but as of writing I don’t have the hardware skill to start designing my own stuff. So the results so far are variations of servers, linux based games machines in cool boxes (like the node segadrive I put together, which is the coolest server EVER). To remedy this I have ordered a starter pack with diodes, pins, cables and enough parts to build my own dr.evil robot (joking) and right now I can’t wait getting started on it!

Also turned out my fellow Spartan likewise has a passion for retro gaming, so I got a quick lesson in Jamma boards and arcade cabinets, a topic which has been bugging me for ages (since so few seem to know exactly what you need to buy). And we also had a chat about the good old Amiga. The world is not that big after all and I guess most of us now in our 40’s started programming on 16 bit computers; And in northern Europe, UK and Scandinavia being the high-seat of Commodore outside the US, that meant the Amiga.

So very inspiring day and truly impressed!

Oslo Delphi Club

I think I’m going to follow-up on their meetings from now on. I have been asked to present Smart Mobile Studio earlier, but being swamped with work I was unable to accept — but this is something I’m going to prioritize. Not sure how many attendees there are at every given meeting, but  it’s always good to meet new people. And as a bonus: we never run out of stuff to talk about because it’s all Delphi!

And the club does get a lot of known Delphi guys visiting. Earliner this month they had Cary Jensen and Ray Konopka visiting, which I’m really sad I missed out on.

So if you live around Oslo or within driving range (takes me 90 minutes to get there on a good day) why not join me on their next meetup? I have no idea what date that would be, but if I’ll be speaking or presenting Smart Mobile Studio programming I’ll post an update here for those interested. But every meeting sounds pretty cool so if you, like me, are a bit tired of working solo on projects with Delphi — Oslo Delphi club can be a good place to meet other developers and exchange ideas.

Now that I think of it, thats a good venue for the Smart Mobile Workshop as well. Guess I’ll contact them about that tomorrow.

Use the train Luke

I’ve worked in Oslo earlier for 2-3 years, and you should think I would remember — but I managed to get stuck for 2 hours in rush traffic today. So rule of thumb is — if you plan on driving out of Oslo, you can pretty much forget that between 15:00 – 17:30. So if you plan to stick around in the city to around 16:00 — you might as well get a good book and wait it out.

In my Hydro days I had the good wits to wait until the 17:00 train, but this completely slipped my mind.

3.5 hours in a car makes me grumpy

3.5 hours in a car makes me grumpy

After 2 hours stuck in dead-slow traffic I saw the Ikea complex at slependen and decided to give up. That should speak volumes when a man enters Ikea of his own free will (!) And like always I went in to buy 2 things: A USB keyboard light and a reading lamp for my son. But I came out with — I dont know, a ton of stuff I didn’t even knew I was missing! So the kids are happy since they got some stuffed animals, paint, more paint, stickers, slippers and definitively more lamps than God ever intended a man to carry — and spoons. Oh yes, why shoot yourself in just one leg when you can cap ’em both with a single shot. My wallet though — not so happy. Funny how all those cheap items sum up.

So next time I’m visiting Oslo I think I’ll take the train because just blindly spending 3 1/2 hour inside a car, when the trip normally (before E18 got re-routed) takes 45 minutes, is more than my brain was built to handle. I’m pretty sure I flipped off an old lady around Drammen out of pure road-raging frustration.

Traveling by train though is just pure delight. On the train you can catch a sleep, drink some coffee, read a paper — or if you are like me, look like you are meditating but you are really coding on auto-pilot in the back of your mind 🙂

Ye old examples

I posted a small example yesterday of creating reference counted objects “on the fly” and just letting them die out after being called once or twice. And interestingly it’s created a bit of a response flow. I should have underlined better that it was only “an example” and not a technique I propose people use at every given situation. Also, loads of cool feedback on how to slim it down, make it faster and that sort of thing — so thanks for all the good comments.

If you look closer you’ll notice that the example does not come with a destructor in place. So if you use that code under the impression that it’s a copy & paste thing, be warned that it will leak memory like mad! And this is first of all due to a difference between Smart Mobile Studio and Delphi which, I must admit, I completely forgot.

Smart Mobile Studio code compiles to JavaScript, which means your code is subject to the V8 garbage collector. Which is a really cool piece of engineering I must say. So objects that goes out of scope, with no valid references being held at all – will simply (and safely) vanish into thin air. But under Delphi that’s quite a different story.

Under Delphi, TInterfacedObject reference-counting is not activated until you associate an interface with a live instance. In other words, TInterfacedObject is ultimately unsuitable for the technique I was demonstrating! The correct way, or “closest” way, to how Smart Mobile Studio does it — would be to use records, not objects. Ordinary, non pointer allocated records are managed by the Delphi memory manager and will, similar to JavaScript, be released immediately when there are no operations being performed on it.

Anyways, I’m to tired now to re-write the whole thing, so I’m just going to post a working version of the example code. Which is now abundantly over-engineered for it’s initial purpose. But at least it’s no longer leaking memory, and yes – this can be copy & pasted and used out of the box. Oh and I renamed the “Get” function to “Read()” instead.


  ISourceParameter = Interface
    ['{5FE0929E-20E3-440E-85FE-9553B5DF392E}']
      function    Empty:Boolean;
      function    AsString:String;
      function    AsInteger:Integer;
      function    AsBool:Boolean;
      function    AsFloat:Double;
  end;
  
  TSourceParameters = Class(TObject)
  private
    FLUT: TDictionary<string,string>;
  public
    type
    TSourceParameter = Class(TInterfacedObject,ISourceParameter)
    private
      FData:      String;
    public
      function    Empty:Boolean;
      function    AsString:String;
      function    AsInteger:Integer;
      function    AsBool:Boolean;
      function    AsFloat:Double;
      Constructor Create(Data:String);virtual;
    end;

    function    Read(Name:String):ISourceParameter;
    Constructor Create(CommandText:String);virtual;
    Destructor  Destroy;Override;
  end;

//#############################################################################
// TSourceParameters.TSourceParameter
//#############################################################################

Constructor TSourceParameters.TSourceParameter.Create(Data:String);
begin
  inherited Create;
  FData:=trim(Data);
end;      

function TSourceParameters.TSourceParameter.Empty:Boolean;
begin
  result:=length(FData)<1;
end;      

function TSourceParameters.TSourceParameter.AsString:String;
begin
  result:=FData;
end;

function TSourceParameters.TSourceParameter.AsInteger:Integer;
begin
  TryStrToInt(FData,Result);
end;

function TSourceParameters.TSourceParameter.AsBool:Boolean;
begin
  TryStrToBool(FData,Result);
end;

function TSourceParameters.TSourceParameter.AsFloat:Double;
begin
  TryStrToFloat(FData,Result);
end;

//#############################################################################
// TSourceParameters
//#############################################################################

Constructor TSourceParameters.Create(CommandText:String);
var
  mList:  TStringlist;
  x:      Integer;
  mId:    String;
begin
  inherited Create;
  FLUT:=TDictionary<string,string>.Create;
  
  commandText:=trim(commandText);
  if length(commandText)>0 then
  Begin
    (* Populate our lookup table *)
    mlist:=TStringList.Create;
    try
      mList.Delimiter:=';';
      mList.Text:=CommandText;
      for x:=0 to mList.Count-1 do
      begin
        mId:=lowercase(trim(mList.Names[x]));
        FLut.AddOrSetValue(mId, trim(mList.ValueFromIndex[x]) );
      end;
    finally
      mList.Free;
    end;
  end;
end;

Destructor TSourceParameters.Destroy;
begin
  FLut.Free;
  inherited;
end;    

function TSourceParameters.Read(Name:String):ISourceParameter;
var
  mData:  String;
begin
  name:=lowercase(trim(name));
  if length(name)>0 then
  FLut.TryGetValue(name,mData);
  result:=TSourceParameter.Create(mData) as ISourceParameter;
end;    

Lazy params, why not?

May 25, 2015 11 comments

Lazy management of child objects is something we normally dont tolerate in object pascal, and pupils caught writing code like this under my supervision would be promptly court marshaled and shot after a damn good thrashing. Ok maybe not thrashing, and probably not shooting either. Come to think of it, a faint tickle or determined gaze should do the trick.

Silly jokes aside, “Lazy management” is my take on creating objects which are explicitly designed to live for short periods of time. Typically just enough for you to extract some value, format something or just check a state. For values of a more permanent state – especially values you would check regularly, lazy management would be a waste.

Practical example

Sometimes its good to let the stack sort itself

Sometimes its good to let the stack sort itself

In my QTX research and development IDE, I have something called “file sources”. In short it’s a class system for completely abstracting you from the filesystem. Any filesystem to be exact. It’s very clever and it allows the entire IDE to be utterly agnostic regarding where files originate, because the closest you get to files are through reference identifiers.

Another side of this system is support for packages, namely zip based storage containers. The cool part is that the IDE doesnt distinguish between a folder on disk and files coming from inside a package. Why should it? It pertains completely to the global file repository, handling files through references and as such — the files can come from your cloud account (spoiler alert), an FTP account or anywhere else for all the IDE knows.

Naturally parameters to initialize a filesource cant be easily streamlined, so I have opted for a string based parameter function. The Open() method takes a semi-colon delimited name/value pair string, creates a TStringList to break the string down, then I stuff the name/value pairs into a dictionary for quick access later.

So initializing the parameter parser is super easy, like this:

FParams:=TSourceParameters.Create(‘name=testing;color=12;number=94.5;gone=true’);

Since the string is parsed and everything placed in a dictionary, it allows me to extract values quickly by name. But — I really dont want to clutter my code with datatype checks for each and every one! I want a clean interface, a bit like TCustomDataset’s TParams. But at the same time, I dont want to cache any value objects because the values will only exist for a short period of time.

I want access which is simple, like this:

caption:=FParams.Get(‘name’).AsString;

TInterfacedObject makes sense

I must admit, I rarely use TInterfacedObject out of the box. And when I do, I tend to disable the default reference counting because I may need interfaces – but I rarely need reference counting (happily the COM days are almost behind us). But in this particular case, the default behavior is excellent.

In the above one-liner snippet, the Get() method returns an object, but you may notice that I have no “free” statement involved. So at first glance you will probably think that the TSourceParameters object cache’s the objects in a TObjectList or something like that. Well I dont, we just create an object on the fly and forget about it.

So here goes:

type

  TSourceParameters = Class(TObject)
  private
    FLUT: TDictionary<string,string>;
  public
    type
    TSourceParameter = Class(TInterfacedObject)
    private
      FData:      String;
    public
      function    Empty:Boolean;
      function    AsString:String;
      function    AsInteger:Integer;
      function    AsBool:Boolean;
      function    AsFloat:Double;
      Constructor Create(Data:String);virtual;
    end;

    function    Get(Name:String):TSourceParameter;
    Constructor Create(CommandText:String);virtual;
  end;

//#############################################################################
// TSourceParameters.TSourceParameter
//#############################################################################

Constructor TSourceParameters.TSourceParameter.Create(Data:String);
begin
  inherited Create;
  FData:=trim(Data);
end;      

function TSourceParameters.TSourceParameter.Empty:Boolean;
begin
  result:=length(FData)<1;
end;      

function TSourceParameters.TSourceParameter.AsString:String;
begin
  result:=FData;
end;

function TSourceParameters.TSourceParameter.AsInteger:Integer;
begin
  TryStrToInt(FData,Result);
end;

function TSourceParameters.TSourceParameter.AsBool:Boolean;
begin
  TryStrToBool(FData,Result);
end;

function TSourceParameters.TSourceParameter.AsFloat:Double;
begin
  TryStrToFloat(FData,Result);
end;

//#############################################################################
// TSourceParameters
//#############################################################################

Constructor TSourceParameters.Create(CommandText:String);
var
  mList:  TStringlist;
  x:      Integer;
  mId:    String;
begin
  inherited Create;
  FLUT:=TDictionary<string,string>.Create;

  commandText:=trim(commandText);
  if length(commandText)>0 then
  Begin
    (* Populate our lookup table *)
    mlist:=TStringList.Create;
    try
      mList.Text:=StringReplace(CommandText,';',#13,[rfReplaceAll]);
      for x:=0 to mList.Count-1 do
      begin
        mId:=lowercase(trim(mList.Names[x]));
        FLut.AddOrSetValue(mId, trim(mList.ValueFromIndex[x]) );
      end;
    finally
      mList.Free;
    end;
  end;
end;

function TSourceParameters.Get(Name:String):TSourceParameter;
var
  mData:  String;
begin
  FLut.TryGetValue(name,mData);
  result:=TSourceParameter.Create(mData);
end;

Simple, easy to use, straight to the point. And we let Delphi deal with releasing any TSourceParameter instances.
So using this would be a case of:

procedure TForm1.Button1Click(Sender: TObject);
var
  FParams: TSourceParameters;
  mText:  String;
  mFloat: Double;
  mBool:  Boolean;
  mInt:   Integer;
begin
  FParams:=TSourceParameters.Create('name=testing;color=12;number=94.5;gone=true');
  try
    mtext:=FParams.Get('name').AsString;
    mInt:=FParams.Get('color').AsInteger;
    mFloat:=FParams.Get('number').AsFloat;
    mBool:=FParams.Get('gone').AsBool;
  finally
    FParams.Free;
  end;
end;

But again, using this technique is not suitable for objects you intend to read over-and-over. For that kind of data you are better off using a proper TObjectList.

Callbacks for Delphi, updated

May 25, 2015 2 comments

In-place callbacks. Not really something very popular in classical Delphi programming, but wildly efficient and handy! In fact, I use them so much in Smart Mobile Studio that I missed them in Delphi — and as such I decided to implement them.

Oh and this is the second version, with some minor alteration from a previous post I did a while back.

So, what is it?

Setup code to execute later the easy way

Setup code to execute later the easy way

Right. Ever found yourself adding a TTimer to your main form because you want something to happen just after the form is shown and everything is ready? Or perhaps when a user clicks something there should be a small delay and then another thing should happen? I know I have. Especially when I want to setup something without taking to much of the OnFormShow() event. But the full onslaught of TComponent seems like overkill for such a tiny function doesnt it?

Either way, under Smart Mobile Studio I have a function initially called W3_Callback to deals with this. It simply creates a time object and keeps track of a procedure reference, and since it’s a one-liner you can use it to delay code execution and essentially allow for a breath of fresh air between calls. The method(s) takes two parameters: the first is the amount of time you want to wait, and the second a procedure you want to execute. So after calling w3_callback it starts a timer, counts down to zero, and then calls the function you provided.

Well, this unit does the same thing as it’s Smart Mobile counterpart. And it does wonders with anonymous procedures, allowing you to setup code to be executed “just after this”.

Note: This is for WinAPI only. If you port it for OS X please let me know, as I’m sure there are equivalent functions. So it shouldn’t be hard to make it portable (have a peek at TTimer under FMX perhaps?).

unit qtx.utils.callback;

//#############################################################################
//
// Unit:      Windows callback mechanism
// Author:    Jon Lennart Aasenden
// Copyright: Jon Lennart Aasenden [LTD]
// Org. Id:   913494741
//            http://w2.brreg.no/enhet/sok/detalj.jsp?orgnr=913494741
//#############################################################################
//
//  Purpose:
//    This unit provides methods for blocking delay of program execution,
//    and also a non-blocking callback function for anonymous methods.
//
//  The TQTXCallback.Delay() method is blocking, meaning that it will halt
//  program execution for the duration of the MS parameter.
//
//  The TQTXCallback.Callback() method is NON-blocking, meaning that it will
//  create a winAPI time object that, when the duration of MS is expired,
//  will execute the inline anonymous function.
//
//  NOTE: There are two overloaded versions: One for anonymous methods,
//        and another for object methods (when used within a class).
//
//  Example:
//     TQTXCallback.callback(
//        procedure (
//          begin
//            showmessage('2 seconds have gone by');
//          end,
//     2000);
//
//
//     TQTXCallback.delay(nil,4000);
//     showmessage('4 seconds have gone by');
//
//
//#############################################################################

interface

uses  System.SysUtils, System.Classes,
      Winapi.Windows, System.Generics.Collections;

type
TQTXObjectProc = procedure of Object;

TQTXCallback = Class
public
  (* Anonymous method implementation *)
  class procedure Callback(const aCallback:TProc;const ms:Cardinal);overload;
  class procedure Callback(const aCallback:TQTXObjectProc;
        const ms:Cardinal);Overload;

  class function  CallbackEx(const aCallBack:TProc;
        const ms:Cardinal):THandle;
  class procedure AbortCallback(const aHandle:THandle);

  (* Object method implementation *)
  class procedure Delay(const aCallback:TProc;const ms:Cardinal);overload;
  class Procedure Delay(const aCallback:TQTXObjectProc;
        const ms:Cardinal);overload;
end;

implementation

uses Vcl.Forms;

var
_LUT: TDictionary<UINT,TProc>;

{ TQTXCallback }

class procedure TQTXCallback.Callback(const aCallback: TProc;
      const ms: Cardinal);
  procedure w3_invoke(hwnd: HWND; uMsg: UINT;
            idEvent: UINT_PTR;dwTime: DWORD);stdcall;
  var
    mProc:  TProc;
  begin
    KillTimer(0,idEvent);
    try
      if assigned(_LUT) then
      begin
        mproc:=_lut.Items[idEvent];
        _lut.Remove(idEvent);
        if assigned(mProc) then
        mproc;
      end;
    except
      on exception do;
    end;
  end;
begin
  if Assigned(_LUT) then
  _LUT.add(SetTimer(0,0,ms,@w3_invoke),aCallback);
end;

class function TQTXCallback.CallbackEx(const aCallBack: TProc;
  const ms: Cardinal): THandle;

  procedure w3_invoke(hwnd: HWND; uMsg: UINT;
            idEvent: UINT_PTR;dwTime: DWORD);stdcall;
  var
    mProc:  TProc;
  begin
    KillTimer(0,idEvent);
    try
      if assigned(_LUT) then
      begin
        mproc:=_lut.Items[idEvent];
        _lut.Remove(idEvent);
        if assigned(mProc) then
        mproc;
      end;
    except
      on exception do;
    end;
  end;

begin
  result:=0;
  if Assigned(_LUT) then
  Begin
    result:=SetTimer(0,0,ms,@w3_invoke);
    _LUT.Add(result,aCallback);
  end;
end;

class procedure TQTXCallback.AbortCallback(const aHandle: THandle);
begin
  if assigned(_LUT)
  and _LUT.ContainsKey(aHandle) then
  begin
    _lut.Remove(aHandle);
    KillTimer(0,aHandle);
  end;
end;

class procedure TQTXCallback.Callback(const aCallback: TQTXObjectProc;
  const ms: cardinal);
  procedure w3_invoke(hwnd: HWND; uMsg: UINT;
            idEvent: UINT_PTR;dwTime: DWORD);stdcall;
  var
    mProc:  TProc;
  begin
    KillTimer(0,idEvent);
    try
      if assigned(_LUT) then
      begin
        mproc:=_lut.Items[idEvent];
        _lut.Remove(idEvent);
        if assigned(mProc) then
        mproc;
      end;
    except
      on exception do;
    end;
  end;
begin
  if Assigned(_LUT) then
  _LUT.add(SetTimer(0,0,ms,@w3_invoke),aCallback);
end;

class procedure TQTXCallback.Delay(const aCallback: TProc;
      const ms: cardinal);
var
  mThen:  DWord;
begin
  if assigned(application)
  and not application.Terminated
  and (ms>0) then
  Begin
    try
      mThen:=getTickCount + ms;
      repeat
        Sleep(1);
        if assigned(application)
        and application.Terminated then
        break;
      until getTickCount>=mThen;
      if assigned(aCallback)
      and Assigned(Application)
      and not (application.Terminated) then
      aCallback;
    except
      on exception do;
    end;
  end;
end;

class procedure TQTXCallback.Delay(const aCallback: TQTXObjectProc;
      const ms:Cardinal);
var
  mThen:  DWord;
begin
  if assigned(application)
  and not application.Terminated
  and (ms>0) then
  Begin
    try
      mThen:=getTickCount + ms;
      repeat
        Sleep(1);
        if assigned(application)
        and application.Terminated then
        break;
      until getTickCount>=mThen;
      if assigned(aCallback)
      and Assigned(Application)
      and not (application.Terminated) then
      aCallback;
    except
      on exception do;
    end;
  end;
end;

initialization
_LUT:=TDictionary<UINT,TProc>.Create;

finalization
if Assigned(_LUT) then
FreeAndNil(_LUT);

end.

Why do some people hate Delphi so much?

May 22, 2015 30 comments

I have to admit that all the rubbish snag comments about Delphi is really annoying. Why does seemingly intelligent, clever and open-minded individuals hold some grudge or negative judgement regarding Delphi?

Where in God’s name does this come from? And who in their right mind, being grown men in their 30’s, 40’s and 50’s, would start acting like little children like this?

I see it almost everywhere. Even in my last job where we had two teams working with C# and Delphi, joining forces to produce a top quality product. Yet behind closed doors there existed a kind of silly superiority complex amongst the C# users which I found disrespectful, superficial and outright stupid.

What is really a shame here is that almost everyone I have met holding such a dumbfounded attitude, which keeps on thrashing Delphi and object pascal in general, is that they demonstrate absolutely no idea what they are talking about! Some have tried Delphi in past and found it to complex, some never liked it — and all of that is ok of-course. We can’t all be expected to like the same music, food, art or colors – so different programming languages are no exception. But when individual after individual turns out to be just mindless parrots repeating what other parrots are repeating – I just have to set the record straight.

First things first

The first argument to fall flat on its face against Delphi is the one regarding age. “Oh it’s just old crap” I hear people say, “it’s not modern enough”, or even more humiliating (for them), it’s not cutting edge like C++, C# or Java!

The latter argument makes me want to throw up. Literally. Because what these sad individuals fail to recognize, is that C is about three years older than Pascal. Pascal was designed to largely replace C, because C was never intended to be in its present state to begin with. Like JavaScript the syntax was never finished but a result of old habits, deadlines and a moving market. C is a language made as they went along, it’s not planned or thought out like Pascal, C# or Java.

Back in the sixties and seventies programming languages were very crude; each command was just replaced by a fixed block of machine code, with various macro mechanisms to set parameters. So in the first pass the compiler made checked the syntax, the second replaced your “c” code with a blocks of assembly code, the third generated an entry-table for each sub-routine and it’s initializer (hidden routines for allocating static memory) and the fourth pass emitted the now pure assembly code text-file to disk. At the end of this horrible process which could take hours, an assembler was invoked to turn each .asm text-file into machine code .a files. And the last step was the linker gluing each piece together into a working program.

As such “C as a language” was never really finished. C was just a toolkit engineers used when creating operative systems, rom images and software for mainframes. Whenever they needed a new command they just extended the language as they saw fit.

So it was never cleaned up properly; the syntax was never renamed to be more understandable, the curly brackets { }, which were only used to save precious bytes of memory were not replaced with begin or end keywords, and the externalized header files were left as they were. An echo from the past when computers had so little memory that it made sense to parse line-by-line on disk rather than wasting ram. And when I write disk, I mean tape.

To make the chaos complete take into account that there were around 8 different “C” dialects on the market. Just like there are myriads of Basic compilers which all have their own take on what Basic really means.

Education, universities and engineering

So, with the state of the C language in mayhem, competing dialects, compilers, calling conventions and so on — a group of people got together to create “a better C” language. I can imagine that trying to tell X number of companies to do as they say was met with little success. Once people have mastered a language they tend to stick with it, it’s always hard to introduce change, especially if you have nothing but an idea on the menu.

So what the pascal group did was to grab the features C had to offer, humanizing the syntax, polling the header back into the unit file (so no external .h file are needed), decide on registry calling convention as standard (hence we have “pascal” calling convention today, even in C# and Java) — and the result was Pascal.

The purpose of humanizing the language (e.g replacing { } with “begin” and “end” keywords) was for good reasons:

  • To improve readability of complex low-level code
  • To make it easier to teach at universities for students with no computing background
  • Take height for the fact that the human brain recognizes words made up of letters, faster than non alphabetical characters  (*1)
  • To better be able to assemble a curriculum fit for tutoring, which was problematic with C due to the large differences in dialect, competing standards and complexity of operators.

[*1]: Actually the brain sees entire words as symbols and are able to recognize and look-up it’s relevance and meaning almost instantaneously. Whereas non characters like “{” or “}” require the brain to include the characters before and after in order to deduce it’s context before looking it up. In short: The brain reads human words faster than glyphs.

The result of many years of hard work was Pascal, designed to be a better C without the limitations which haunts C to this very day. The results should speak for itself: for 30 years Pascal code has outperformed C in almost every aspect of programming. During the 80’s and 90’s Pascal was the language of choice for game and system developers, especially since Pascal has always supported inline-assembler.

Just like C, Pascal has been uses to create operative systems from scratch. Recognized by all for its simplicity, its rigid structure, it’s efficiency and most importantly: it’s productivity!

Let’s go back to the beginning

Before we look at object pascal today, let’s go back to the early days. Back when there were at least 8 different C compilers (not to mention a few open-source, free compilers available as well) and there really was no control or standard at all.

So, in 1978 Dennis Richie and Brian Kernighan published a book called “The C programming language”. A lot of kids these days seem to believe that this book marks the beginning of C, and that it sort of defines the language from beginning to end. Sadly that is not true, I wish it had been true, but it’s not.

When Dennis and Brian wrote that book the C language was in mayhem. There was no standard at all, nothing to say what was C and what was Basic or BCPL. There was no organization which owned C and with all those different compilers on the market, each of them different, each of them unable or unwilling to support the other — something had to be done.

Hence the book “The C programming language” was released as an attempt to clean up the mess. That meant creating a standard or subset which all C compilers should support – regardless of their peculiarities. As long as every compiler supported the proposed sub-set, they could call themselves “ISO C compatible” and years later “Ansi C compatible”. Sadly this process took many, many years and the ISO standard was not effective until 1982 or thereabouts.

Object Pascal = C++

Like mentioned above Pascal was a project to create a better C. What people don’t seem to get is that pascal is, underneath the syntax, almost identical to C. Most of the improvements were not binary but rather superficial, a more thought out and easy to read syntax, no need for external header files, support for inline assembler, the use of $ rather than 0x for hexadecimal — essentially superficial changes.

So when people thrash talk Pascal or Object Pascal, they can’t possibly know what they are doing. It is a fact that C++ builder and Delphi shares a common core. This is why you can take .obj files compiled with C++ builder and link them straight into a Delphi project. And you can likewise take a Delphi compiled unit and use that in a C++ builder project.

This should give you some sense of what object pascal is capable of. If you have respect for languages like C/C++ then you should also recognize that Delphi and freepascal is equally worthy of the same respect. The only thing separating the two languages are superficial, syntactical differences. Naturally each language has evolved since the 80’s and 90’s and Delphi have many features which C/C++ lacks (and visa versa). But inside the heart of Delphi beats the same engine which powers C++.

Back it up with facts or be silent

“You cant use delphi, thats just .. you cant”

Why? I hear people utter these statements, but I have yet to hear a good reason as to why? Why can I use Visual C++, C++ builder and even Visual Basic (!!!) to write applications but not Delphi? Since I have outlined that Delphi and C++ builder share the same core, under what pretext should Delphi be banned while C++ is allowed? And who in their right mind would allow Visual Basic, which is a language for children, yet ban the most widely used language in the western hemisphere for the past 30 years? Is there an insanity virus going around?

Let’s be honest: all of these statements are of-course rubbish. Java and C# fan-boys will always tell you that their language is the best, and they fight like cats and dogs between themselves too. So when Borland lost the economic fight against Microsoft, they all had a chance to kick Delphi and C++ builder while they were down for the count. But what company  would really stand a chance against Microsoft?

Microsoft is a company so spiteful and egocentric that it created C# when Sun Microsystems refused to give up control over Java. And just look at the damage C# has done to Java in just a couple of years!

Does that mean that Java is “crap”? Does it mean that C# should be allowed while Java should be banned? Or should we allow Visual Basic but refuse to accept Java? Because that’s the kind of insane thinking we are dealing with here.

Of-course A doesnt exclude the use of B. And had Microsoft really gone after Sun with the intent of destroying them, you know just as well as I do that Sun would be dead and buried — and Java along with it.

So before you start thrash-talking Delphi and Borland and Embarcadero, please do yourself the favor of actually knowing what you talk about. Because to people who know several languages, people who were developers 20 and 30 years ago, you sound like a complete moron. Especially when you say that Delphi is old, or Delphi is just “this” or “that” like a child lobbying for his favorite soccer team. At least have the wits to add why you believe Delphi is crap, and then investigate if that notion is fact or fiction.

Did Borland get their asses kicked by Microsoft? Yes they did. Just like Netscape did and thousands of other companies over the years.

Is Delphi dead? Absolutely not! It’s used by thousands of high-end companies on a daily basis all around the world. In fact since Borland sold it’s R&D department to Embarcadero the language has once again caught up with C++, and the user base is growing! It goes without saying that when Microsoft stole the lead developer and inventor of the product, and essentially left Borland to the volves that development stopped for a while. But that was years ago and its ancient history.

And just like C++ compiled Delphi has no dependencies. You don’t need to install a truckload of DLL files to execute your programs. They are native assembly code so they run much faster than Java and C# (roughly 30% faster than C# JIT code). So what makes more sense? Ignoring Delphi and keep using C# for high-priority servers? Or be smart and use Delphi to get that extra speed boost. 30% means a lot when dealing with millions of records per day, yet I see companies falling for the hype and picking C#, only to be haunted by more problems than I care to list.

And you also get to use freepascal absolutely free. You can compile your programs for Linux, Macintosh, Windows — you can target Nintendo, XBox and Playstation. You can target iPhone and Android devices — and even a few novel operating systems like QNX, Embedded DOS, AROS, MorphOS and Amiga OS (although dont hold your breath if you plan to make money on Amiga these days).

And then there is experience and coverage. It goes without saying that a language which spans back to the early days of C++ has gone through some vigorous tests and stood the test of time! Delphi as a product comes with a broad background and public library of code for almost everything under the sun. And the Delphi codebase is still growing!  Why should your company pay millions to hire people to re-invent the wheel in Java or C# when you can get an experienced Delphi developer to deliver faster solutions using code which has been running successfully for a decade?

Think about that for a while before you give in to weak-minded mantra of “mine is better than yours”, because odds are your language of preference can quickly find itself in a similar state a few years from now. Besides — a programming language represents a school of thought, and just look at the hundreds of thousands of software titles created using Delphi. Look at the millions of software problems Delphi has helped solve! To deny that is to quite frankly be thoughtless. Wisdom and knowledge is valid, no matter what language is used to express it.

Smart Mobile Studio Workshop

May 22, 2015 3 comments

I was recently presented with the notion of holding a Smart Mobile Studio workshop. Essentially offer my services to companies who want to get up to date with cloud and mobile development using Smart Mobile Studio.

Want to learn the secrets of Smart Mobile Studio? This is your ticket

Want to learn the secrets of Smart Mobile Studio? This is your ticket

Initially this idea seemed alien to me; I don’t have a problem speaking to a crowd or anything, but I must admit that I have little experience holding workshops. Luckily this notion coincides with my book writing, meaning that I have already started to structure a curriculum for learning Smart Pascal; moving from basic dialectic advantages to writing full speed database driven async cloud services.

I have concluded that my book will actually be a series of smaller books, each dealing in-depth with the topic. There is simply to many facets in Smart Pascal to cover it all in a single chapter. Things like cloud-service programming contains so much potential and so many intricate topics that it deserves to be a small book on its own.

But when it comes to the workshop, the idea has grown on me. Because another aspect of this great idea is to demonstrate just how much object pascal can offer a business (!). Smart Pascal is not just about mobile phones, it’s evolved to be much more – just as JavaScript has evolved to be much more as well.

Below I have written down some of the segments I intend to use in my workshop. It will be a tight schedule, starting at 09:00 and finishing off at around 16:30 (with 30 minutes lunch break at 11:30-12:00). At the end of the workshop tasks for each segment is handed out, you can pick the one you find most interesting. I have dedicated 2 hours for individual work. Each member is expected to bring a laptop with at least Windows XP installed. A copy of Smart Mobile Studio Enterprise is given to each attendant.

Creating your business around object pascal

In modern computing the choices are often bound to the limitations of your language. For instance PHP users tend to stick with Apache (but php runs fine on IIS, just saying), Java programmers use Tomcat or similar, JavaScript programmers use nodeJS or a derived version of this– and ASP.net users tend to go with IIS even thought it runs fine on Apache with mono.

But what about object pascal programmers? What are our options to match the performance, the elegance and the integration that other languages enjoy?

In this part of the workshop I will introduce you to DWScript HTTP server, which is a phenomenal piece of software designed specifically for object pascal based businesses. When it comes to speed and efficiency it’s right up there with the best of them, but it contains probably more exciting features than all of the aforementioned languages combined.

  • Full support for Object Pascal server-side
  • Full support for Object Pascal client side (using Smart Mobile Studio compiler)
  • Built-in support for all major databases
  • Easy authentication mechanism
  • Support for HTTPS through SSL library files (.dll’s)
  • CORS management
  • Plenty of internal functionality accessible through scripting

The result is a web infrastructure unlike any other, a modern http solution way beyond nodeJS in pure performance– giving you the power of “Ruby on Rails” with the simplicity of PHP in one kick-ass little package. So for businesses which have their own, physical server in-house, running DWScript HTTP server will be like a breath of fresh air.

In this section I will go through how you can write your back-end software for Smart Mobile Studio projects using the DWScript HTTP Server; We will also look at how object pascal makes HTML templates fun to make, how you can make use of the server even from native Delphi applications, it’s REST capabilities and more.

Cloud computing

Getting the big picture can be hard, especially with so much hype being sold on the concept of cloud. This is where I can help your team cut through the ocean of useless information and focus on solutions. Smart Mobile Studio introduces support for nodeJS programming, which is a cornerstone cloud technology. It is platform independent, hardware independent and extremely resource efficient.

Where DWScript HTTP server above represents a native object pascal server which requires a virtual-server host to run, nodeJS means that you can make use of inexpensive hosting solutions. NodeJS is the same on both Windows and Linux, which is also what the cloud is all about: hardware abstraction.

Smart Mobile Studio ships with a nodeJS project type. This project is fairly low-level, exposing the core node server API directly. To leverage this and make it more user-friendly (and feature rich), I have built a very powerful service layer on top of this low-level stack. This means you can now write high-speed, fully scalable services, much like a win32 service or a Linux daemon, that lives and runs completely in the cloud.

I will teach you how to design your services to be scalable, movable and CPU efficient. Scaling is extremely important, especially for businesses that conform to seasons. Businesses like sports-ticket services is a good example. During the high-season their processing requirements can shoot from 40000 to 1000000 over night.

Well with Smart Services that’s not a problem. Just clone X number of instances horizontally of the service and setup a round-robin dispatcher as the entry-point. Scaling your service to go from 100 tickets to handling payloads of 1000000 tickets is no longer a matter throwing more iron on the problem; these days you just select the number of clones you want and click apply.

Writing mobile applications

This is an area which Smart Mobile Studio excels, and in fact it was written to be an alternative to native solutions (mono, delphi, xcode and more). I can teach your team how to write code that behaves identical on all platforms (Android, iOS, Blackberry and Microsoft), and last but not least I will teach you how to tap into the hidden sides of Phonegap, like how to control bluetooth, pre-allocating your database, protecting your files and much, much more.

Focus of this segment is on application architecture, the Smart display organization, how best to initialize your database for data storage on the device – and last but not least, caching, memory and streams.

Note: Smart Mobile Studio recently introduced support for streams, raw memory allocation and intrinsic datatype conversion. This is unheard of in other solutions. Not even typescript have ventured that far into the secrets of JavaScript. I will guide you through the differences (for those coming from a Delphi or FPC background) in how memory is handled.

If you want to write JavaScript which runs lightning fast, which behaves like native code and which does stuff most JavaScript programmers only dream of — then this segment is for you.

Writing custom controls

Writing your own controls should be a fun and pleasant experience. Focus should be on what you want to achieve, not how you can force the RTL to behave in a predictable manner. If you have ever written advanced user-controls for ASP.net then you know exactly how little fun this can be.

I can guide you through the RTL step by step, explain the methods you need to override and why. I will go through the inheritance layers from TW3TagObject which creates an HTML element — all the way up to TW3CustomControl which represents a complete, blank user-control with supports for everything.

Working with JavaScript and TypeScript

With the basic understanding of what Smart Mobile Studio does and how the RTL interacts with the document object model, getting to grips with third-party libraries is suddenly fun.

In this final part of the work-shop we go through the basics, from writing raw JavaScript in ASM sections, to writing shadow classes to match externally defined JavaScript.

We will also have a look at typescript and I will teach you how to import typescript controls and convert them to Smart Pascal units. This way you get access to thousands of Typescript user-controls and libraries — all of them usable in your Smart Projects.

Hosting the workshop

If you want to bring your team up to speed with the above topics you can register to host my workshop. I require a 50% deposit prior to leaving Norway, to cover flight and housing accommodations. The rest is expected to be payed on the same day as the event takes place.

Once there I will travel to your company or selected location and hold the workshop. The workshop should be set to start at around 09:00 and end at 17:00. It is a full day workshop with two hours dedicated for programming where I am 100% available for questions, help and guidance. The rest of the day is a thorough and in-depth look at Smart Mobile Studio, the RTL, how applications work – followed by practical segments on each technology: using DWScript HTTP to host Smart applications, writing mobile applications, application architecture, Phonegap, working with databases and last but not least — nodeJS service programming).

Hire a Delphi superhero!

May 18, 2015 2 comments

This is your chance to hire a Delphi super-hero, namely me! That’s right, I’m presently in the market for a new full-time job!

Note: if you need people for a short project then I personally must decline, but I can forward your position at Delphi Developer (4.000 Delphi developers) and here on my website (average of 15.000 visitors per month)

I must underline the obvious, namely that I live in Norway with no intention of moving. However, I have a fully established office which has been used for three consecutive years. So I am used to working remotely, communicating through Skype, Messenger, Google Meetup’s and similar utilities. This has worked brilliantly so far. Full time employment over the internet is finally a reality.

For Norwegian companies I can offer 50% commuting (100% in Vestfold) from Oslo to Akershus in the north, to Sandefjord and Larvik in the south. The reason I can only offer 50% is because I have custody for two children every other week, which means I am unable to drive long distances in combination with school and similar factors.

You need an awesome Delphi developer? Then I'm you man!

Jon Lennart Aasenden, 41 years old senior software engineer using Delphi

My experience is too long to list here, but if you are in the market for a dedicated software engineer then you have come to the right place. Simply drop me a line on e-mail (address at the end of this post) and I will get back to you with a full resume ASAP.

In short: I have worked with Delphi for 15 years, I am the author of Smart Mobile Studio and wrote the VJL (run-time library, similar to VCL) from scratch. I have worked for some of the biggest companies in Norway. I have good papers, excellent reputation and is recognized for my skill, positive attitude and “yes we can” mentality.

Before my 15 years of Delphi I spent roughly the same amount of time programming games, multimedia and contributing to the demo scene. In my view, demo programming is one of the most rewarding intellectual exercises you can engage in. It teaches you how to think and prepares you for “real life solutions” as a professional.

In my career as a Delphi developer I have written several commercial products; ranging from a complete invoice and credit management application, games and multimedia products, serial management components for Delphi, backup clients and much, much more.

No matter what your company works with, as long as it’s Delphi I’m the right man for the job.

My kind of job

It goes without saying that I am looking for a purely Delphi centric position. Although I have worked with C++ and C# and have no problems navigating and adding to such a codebase — there can be no doubt that Delphi is the environment where I excel at my work.

I bring with me a solid insight into HTML5/JavaScript and am willing to teach and educate your existing staff in Smart Mobile Studio, which I am also the founder and inventor of; bringing your team up to speed with the next step in computing: namely distributed cloud computing. At which JavaScript and Object Pascal play central roles.

Torro Invoice

Torro Invoice

So if you are moving towards cloud computing or want to leverage the cloud for service oriented architectures using RPC or REST servers, I am the guy you want to talk to. Especially if you want to use object pascal and leverage nodeJS, JavaScript and the whole spectrum of mobile devices. In short, with me on your team you will have a huge advantage.

What you get is 15 years of Delphi experience; and before that, 15 years of software authoring, demo and game development on 16 bit machines.

Good qualities

I have included a small list of “ad-hoc” qualifications. The list below does not serve as anything other than indicators. I have been a professional programmer for many, many years and to list every single piece of technology is pointless. But hopefully the list is enough to give you an idea of my qualifications, depth and diversity.

  1. Write custom Delphi controls and UI widgets
  2. Create control packages and resource management for our projects
  3. Optimize procedures by hand by refactoring variables, parameters and datatypes.
  4. Write a database engine from scratch and also use existing engines such as Elevatedb, MSSQL, Oracle, Firebird, SQLite and MySQL
  5. Work with Windows API directly
  6. Work with freepascal and port code to Linux and Macintosh
  7. Write networking libraries, custom protocols and high-speed multithreaded servers
  8. Use classical frameworks like Indy, Internet Direct and other out of box solutions
  9. Write advanced parsers for source-code and any complex text-format
  10. Write a real-life compiler and IDE (www.smartmobilestudio.com and quartexpascal.wordpress.com)
  11. Create a graphics library from scratch, supporting different pixel formats
  12. Work with large files, performing complex operations on gigabytes and terabytes
  13. Write mobile and desktop applications using Smart Mobile Studio and FireMonkey
  14. Create your server environment, architect your RPC (remote procedure call) service infrastructure
  15. Implement custom services through nodeJS, Smart Mobile Studio, Delphi and FreePascal
  16. Use Remobjects product line: such as RemObjects SDK, Hydra and Data-abstract
  17. Link with C and C++ object files
  18. Use project management tools, scrum, SVN, github and package management
  19. Write, export and import DLL files; both written in and imported to Delphi
  20. Write solid architectures using moderns technologies: xsl schemas, stylesheet validation, rest, node services

.. and much, much more!

Note: While you may not have a need for all of these qualifications (or any one of them), the understanding which the listed topics demand that I master is of great value to you as an employer. The more knowledge and hands-on experience a programmer can offer, the better qualified he is to deal with real-life problems.

Tools of the trade

All programmers have a toolbox with frameworks, code collections or third party components they use. These are the products I always try to use in projects. I have a huge library of components I have bought over the years, and I have no problem getting to know whatever toolkit you prefer. Below is a short list of my favorite tools, things I always carry with me to work.

  • RemObjects SDK to isolate business logic in RPC servers, this allows us to use the same back-end for both desktop, mobile and html5 javascript.
  • RemObject Data Abstract
  • Remobjects Hydra
  • ElevateDB and DBIsam (DBIsam for Delphi 7-2010, ElevateDB for the rest)
  • Developer Express component suite
  • TMS Aurelius database framework
  • MyDac – MySQL data access components
  • MSDac – Microsoft SQL server data access components
  • Raize component suite
  • FreePascal and Lazarus for OS X and Linux services
  • Mono/C# when customers demands it (or Visual Studio)
  • Firemonkey when that is in demand
  • Smart Mobile Studio for mobile applications, cloud services [nodejs] and HTML5/Web

Tools and utilities

  • Beyond compare (compare versions of the same file)
  • Total commander (excellent search inside files in a directory, recursive)
  • DBGen – A program written by me for turning Interbase/firebird databases into classes. Essentially my twist on Aurelius from TMS, except here you generate fixed classes in XML Data Mapping style.

Note: For large projects which needs customization I tend to write tools and converters myself. The DBgen tool was created when I worked at a company which used Firebird. They had two people who hand wrote wrapper classes for nearly 100 tables (!) They had used almost two months and covered about half. I wrote the generator in two days and it generates perfect wrappers for all tables in less than 10 minutes.

Safety first

As a father of three I am only interested in stable, long-term employments. Quick projects (unless we are talking six figures) are of no interest, nor do I want to work for startup groups or kickstarters. I am quite frankly not in a position to take risks; children comes first.

many of my products are available for purchase online

Many of my products are available for purchase online

I am used to working from my own office. I was initially skeptical to that, but it has turned out to work brilliantly. I am always available (within working hours Norwegian time) on Skype, Google, Messenger and phone.

Languages work format

For the past year I have been working full time with C# under Microsoft Visual Studio. Before that I used Mono for about four months, which I must admit I prefer over Visual Studio, and wrote a few iPhone and iPad apps. So I am not a complete stranger to C# or other popular languages. But as I have underlined in my posts on countless occations – object pascal is a better language. It is truly sad that Borland was brought down all those years ago, because with them they dragged what must be one of the most profound and influential languages of our time.

That said, I have no scruples about mixing and matching languages. Be it Remobjects Oxygene, C#, C++ or Object Pascal. I also do some mocking in BlitzBasic which is without question the fastest (execution wise) of the bunch, but not really suitable for enterprise level applications.

The point here being that I am versatile, prepared to learn new things and not afraid to ask. It would be a miracle if a man could walk through life without learning something new, so it’s important to show respect and be remain humble. Different languages represents different approaches to problem solving, and that is an important aspect of what it means to be a programmer.

The only thing I ask is that I am properly informed regarding the language you expect me to deliver in – and that I receive the required training or courseware in due time. Do not expect super-hero status in C#, I am absolutely above average, but it cannot be compared to my efficiency and excellence using Delphi.

Contact

If you are interested in hiring me for your company, then don’t hesitate to contact me for a resume. You may e-mail me at lennart.aasenden AT gmail dot com.

Aros, a Linux alternative

May 16, 2015 2 comments

Lately I have written quite a lot about the old Amiga platform. The reason I am so excited about this is not because I’m reminiscing about my childhood, or because I’m trying to sell anything. Quite the opposite.

What I would like to present is a modern, working and extremely effective alternative to Linux. Because that’s what Aros and Morphos represents. I know this view may come as a surprise on people, even those active in the Amiga retro computing community. But it’s non-the-less true.

What is an operative system?

An operative system is a methodology. Windows represents one such method, and by using their method and doing what Microsoft wants you to – you achieve and can enjoy the features Microsoft delivers through Windows.

OS X is likewise a methodology, it is wildly different from Windows and offers an equally different user experience. Where Microsoft Windows focus more on being a workhorse for all things technical (which I personally think is better than OS X), Apple focus more on creativity, special effects and visual beauty over technical achievements.

One of many, many ports

One of many, many ports

Linux represents the third methodology. It’s both different from and equal to the two aforementioned systems. It is open, free and can be customized and tailored to the needs and wants of it’s users. The downside of this freedom is that compared to Windows and OS X, Linux is extremely hard to work with on a lower level. You really need to know your stuff once you move away from the desktop, and if you want to make distinct changes to the operative system – you must be prepared to master and excel at C/C++ programming.

What about Aros and Morphos

Now that we have put words on what an operative system represents and which alternatives are out there (there are more operative systems of course, but these 3 methodologies represents the most widely accepted) – it’s time to look at a completely different and very exciting alternative. Namely Aros.

Linux has an interesting story which in many ways resemble Aros’s own history. If we go back in time to before Linux existed, universities and science programs primarily used Unix. Unix is after all designed to deal with hundreds and thousands of users, to keep data separate and to provide safety and security for everyone with an account. So it’s perfect for college campuses, scientific organizations and businesses.

Emulation is excellent :)

Emulation is excellent 🙂

But one day a small group of people started to rebel against the proprietary nature of Unix. Back then Unix was overly expensive, so expensive that no ordinary person would afford to own it. So this small group of people got together and decided to write a complete operative system simply called GNU. This system was free, open for all and could be downloaded for no fee what so ever.

There was only one problem with GNU and that was that they didn’t have a kernel which was written from scratch, so people were using the Unix kernel quite illegally. But one day a guy from Finland called Linus Torvaldson came along and wrote exactly that missing piece. Voila, Gnu/Linux was born!

The Aros story is of course different, but there are some commonalities between the two. Aros dates back to the days when Commodore went bankrupt. It was unsure what would happen to the Amiga, would it end up at gateway computing? Would Escom buy it? Maybe Haage & Partner?

In the midst of all this a group of coders joined forces and decided enough was enough. Commodore went bankrupt after years of abhorrent business decisions, wasting and throwing away the potential of the Amiga platform, losing the lead they had over PC and Mac due to negligence and greed — so these guys just had it with Commodore all together. They decided to reverse engineer the operative system from scratch to ensure that no matter what these financial cowboys end up doing — at least Aros would be there as a safe-haven for serious users.

Years of development

Aros has been in development ever since commodore went bankrupt in 1996. It represents a monumental piece of engineering, writing a complete operative system from scratch using nothing but technical documentation and API user-manuals as their source. The group has solved all the tasks which Commodore and it’s troll representatives gave as excuses to why AmigaOS would not be ported to x86. They have solved the 64k memory problems deemed so hard to work with by Microsoft and and others, and last but not least – they have solved the missing kernel which haunted GNU before it became GNU/Linux.

And even if Aros made full use of the Linux kernel and driver database, it would still represent a profound achievement in computing. Raise your hand everyone who knows a programmer which refuses to give up – and continues working 19 years later (nineteen years, that’s just mind boggling).

The question is, what does Aros give you, the user?

The Amiga methodology

As clarified at the beginning of this article an operative system is essentially a methodology. It’s a way of thinking, a way of working and ultimately a way to approach technology and gain access to it’s benefits.

Aros has come a long way since 1996!

Aros has come a long way since 1996!

The reason Windows users find Linux so utterly difficult is because absolutely everything is different. Linux is based on a completely different mindset, and it forces it’s users to develop a specific mode of thought which in turn educates them about the system. The same can be said about Aros, except here everyone will find something familiar to them, because Microsoft, Apple and GNU have all copied and stolen parts of the Amiga when Commodore died (!). So what you are faced with here is the original, the real deal, the big kahuna and true whopper!

Aros and the Amiga is quite simply a fourth methodology; Different from Windows, different from Linux and different from OS X. The key architectural feature of Amiga OS is be user friendly, hardware friendly and resource friendly (Amiga OS will happily boot up in 4 or 8 megabytes of ram. The other systems require 1000 times more memory to run properly).

We have to remember that Amiga OS delivered a silky smooth multi-tasking, fully windowed desktop UI roughly a decade before Windows 1.0 was invented. And it delivered this on computers with between 512 kb to 4 megabytes of ram! Since the old 68k processors did not support MMU (memory mapping unit) the Amiga could not support swap-files or true multi-tasking. But technique for multitasking Amiga OS uses turned out to be damn effective! Even today it outperforms Windows, Linux and OS X.

But the real power of Amiga OS, which ultimately is the power of Aros — is hidden in the actual architecture itself. It’s buried in the software API, the way drivers attach and work, how music is dealt with and how graphics is allocated and dealt with. The power of the Amiga can be found in it’s REXX scripting, it’s global automation support and signal management.

Can you imagine what an operative system designed to work in 4 megabytes of ram can do on a PC with 8-16 gigabytes, ultra-fast graphics cards and 16-24 bit sound chips? Well it’s exciting stuff that’s for sure.

Aros and Linux

Aros is right now where Linux was 15 years ago. Back then “Linux” meant (more often than not) a debian based distro, or perhaps a slackware version. Those were the most popular and debian was the undisputed king of the hill. Most of our modern distros today are fork’s which at one point derived from these older implementations.

Aros and Morphos can in many ways be seen as debian and slackware. Aros is not a “game operative system”. It has nothing to do with the old games machine of the 80’s and 90’s. Amiga OS is a unique creation, written by four people at Amiga Inc, especially Carl Sassenrath which is the author of Intuition and Exec. These guys just wanted to write an OS from scratch — and with Amiga they got the chance. They didn’t set out to make a game operative system. Quite the opposite — Carl and his team put together a unique operative system which for a whole decade was ahead of the competition. This is unheard of in the IT industry as a whole even to this day. And the OS they wrote delivers a high-performing, graphically excellent operative system which turns on a dime.

Not exactly graphically impaired

Not exactly graphically impaired

We should be thankful that the Aros team made it their lives mission to re-engineer Amiga OS for the future — because without it, the methodology and mode of thought which Amiga OS represents would never have survived. It would be a blast from the past, a true gem buried in the sand and forgotten.

Thanks to the Aros team, modern programmers and computer users can see for themselves just how cpu, memory and space efficient the Amiga methodology and formula is. And with a bit of work, turning this operative system into a killer business provider should not be a problem.

What about drivers

I had a chat with a individual on the Amiga User forum over at Facebook about this very topic, and unsurprising he was against the idea. Actually I dont think he really thought it through. He just went into “automatic” mind mode and said “It will never work, it’s a waste of time”. At which point I have to ask “what is a waste of time?”.

NVida has an excellent API

NVida has an excellent API, and you get a mighty bang for your pennies!

Aros can be downloaded on a live CD and tested on any x86 PC. Naturally you can expect it to work on every configuration on the planet, but the majority of modern PC’s will work just fine. So what exactly is it that makes this so much worse than, say, Linux?

In order to ensure driver efficiency I would propose that Aros picks out a fixed and easily available hardware platform, I can suggest the following (and it’s thought through, so please think about it before you just criticize it).

  • NVida Graphics hardware
  • Easily available motherboard with:
    • On board sound hardware
    • On board TCP/IP socket
    • On board Wi-Fi hardware
  • Intel i5 – i9 processor

The list of drivers required for such a setup:

  • NVida graphics API driver
    • VESA fallback driver [8 .. 32 BPP]
    • OpenGL integration unit
  • USB hub driver
    • USB mouse driver
    • USB keyboard driver
  • Standard Sound API driver (ASIO compliant)
  • Standard IDE device driver
    • CD-ROM recognition
    • Harddisk recognition
  • Standard Sata harddisk driver

This is essentially the number of drivers you would need. And just like Apple you must ensure that all new Aros PC’s have this spec. The CPU type and speed may vary, the nVida graphics card may vary and disk sizes may vary between models. But as long as you stick to the motherboard type and graphics adapter — you essentially have a device driver collection which needs no major work for at least 8 years. It all depends on the hardware vendors and how long a motherboard remains on the market (typically 4-5 revisions with an equal number of models).

Where you will find most work for future support, or like Ubuntu – a full online driver database and hardware recognition service, is under the USB topic above. Keyboard and mouse represents the bare basics. Once you have the USB hub and ports operating, the fun work begins 🙂 And there is almost no limit to the amount of stuff you want to recognize. Personally I would opt for USB stick brands before anything else, but that’s not my department to decide on.

As you can see, it’s not that hard to work with this. The hard part is finding people who are willing to write a driver, spend some time debugging and testing and ultimately donate to the Aros desktop and operative system. But like I told my friend while we were debating, it’s not black magic. Amiga OS itself was written by four (4) guys. What’s important is that the key programmers know their stuff and are willing to donate some free time.

I for one cant wait to get started. I really hope the Aros team picks up on this — because there are tons of programmers out there who really want an alternative to Linux!

Just imagine what an Amiga based web-server would run for? It’s a system which delivers top-notch multi tasking in 512kb.. now give it 512 gigabytes of ram, a kick ass CPU and watch the sparks fly! It would outperform even Linux, that’s for damn sure.

Amiga programmer looking for work

May 15, 2015 11 comments

You may fear I have completely lost my marbles here, but I am actually underlining a very important point. Namely that Morphos and Aros represents two potential branches of what could be real-life, popular, fully functioning alternatives to Linux, Windows and OS X. In fact, if you go back 10 years in time Linux was dominated by debian clones. And from that root at least 15 different distros have their origin today.

So essentially, if the Aros and Morphos teams decide to go for it — they can in essence bring the Amiga OS formula back from the dead and turn it into the most popular, easy to use operative system in the world. There is absolutely no reason why that cant happen except if they waste their potential (in good commodore style?).

So is it room for another operative system? Because an operating system represents more than just a “desktop”. It’s essentially, like mentioned, a formula for dealing with hardware, controlling your system which boubles up to how you work and interact with your computer. Even a simple thing like driver architecture affects your everyday life; even if you dont know it.

Amiga OS, be it clones or the real-deal, is unique in this respect. And considering the amount of work involved in re-writing an OS from scratch (so hat off to the Aros and Morphos teams!) I see no reason why Amiga OS cant become a dead-serious alternative. Aros runs faster than both Linux and Windows on x86 hardware. It supports high-quality graphics and sound, and it has the potential just like windows to support an equal amount of hardware as well. Although porting drivers from Linux is probably the best way to go about things.

Paradoxically: If you ask why it takes so much time for Morphos, Aros and even Amiga OS 4 to see any updates (what is it now? 2 official updates in 15 years?) you always hear the same thing: “Sorry, we dont have enough programmers”.

Well I would like to offer my services as a programmer for Amiga; Aros or Morphos. I havent seen a “Amiga developer available for work” advert in 20 years, yet I see people asking for new stuff all the time — clearly something is missing between the two right?

Want software? No problem. Get FPC installed and give it here!

Want software? No problem. Get FPC installed and give it here!

My curriculum is long, but I master object pascal, 68k assembler, C, C# and a variety of other languages. I even know blitzbasic from the old days if that helps. I work full time as a developer for one of the largest software houses in Norway every day.

My favorite language and probably the most productive, fast and powerful (en-par with C/C++ and better) of all aforementioned is object pascal. I noticed that both Aros and Morphos have FPC support — which means I will be able to push my 15 years of professional experience with that language into whatever program you chose.

However, I do expect to be payed a normal salary, or at the very least a normal one-time fee. And this is probably where it all falls apart. But for the right project and if you allow me to use object pascal — i will deliver some kick ass ports to your Amiga based platform.

Some projects which will take me no more than a couple of days to knock out per piece: WinZip clone, WinRar (and Rar5 compression), PDF reader/writer, programming IDE based on SynEdit (and forked derivatives, this is one of the best coding editors around – supporting 15 different syntax highlighters, code suggestion, code completion and much, much more), JavaScript compiler (compile object pascal to high-speed, OOP JavaScript. Javascript is not OOP so we sculpt the VMT in code ourselves). Heck I can also make a lot more — the sky is the limit. What about a cool service layer and cloud distribution system? Hook every Amiga into the cloud? That would be fun! Imagine REXX scripting towards those pipes 🙂

Or what about a brand new programming language? I love working on compilers, parsers and IDE’s.

Others? Sound editors? Networking? — I have a collection of around 5.000 high-end re-usable programming components. All of them are pure object pascal, meaning that they can be dropped into any freepascal project and be used identically on Windows, OS X and .. well, Amiga. The only dependency is freepascal and the LCL (lazarus component library, a.k.a “run time library, like a C library for gadget.tools). Some adjustments must be made naturally since Intuition might not be up for some of the more complex stuff, like the office clone, the outlook mail components (yes they look and work like microsoft outlook, except they are written in object pascal and platform independent).

So — now you have no excuse to say there are no good programmers for Aros, Morphos or classic Amiga OS — because a damn good developer is asking for Amiga work right here. I have more than 15 years of professional programming behind me. Before that I was a kick-ass hacker, member of Alpha Flight and later Quartex — elite groups both of them. If you have a peek at “products” page (top menu) you will find some of my work, but far from all.

While I dont want to say that A is better than B, I do feel that Aros may have the upper hand over morphos – since x86 hardware is easier to get a hold of. But since I have 3-4 mac’s capable of running morphos and around six PC’s capable of running Aros, that’s not gonna be a problem.

What I need

  • A disk image with the OS pre-installed
  • FreePascal (and preferably Lazarus if available) installed on the Image
  • No bloody nag screen
  • Well written project description, with each form of the app clearly defined (normal software spec)
  • Reasonable timeframe for part time work

Note: For classic AmigaOS I would need help getting the damn thing to run. I presently have only an old A500 + CD32, I have a furious 2xdual core G5 PPC morphos machine, and a monster powerful Aros PC. But if you want to delegate heavy duty programming on OS 4, then you need to set me up with a suitable machine first.

Angular? Nothing new under the sun

May 14, 2015 3 comments

In a previous post I sort of slaughtered Angular.js and Bootstrap. Partly because these libraries represent “a prototypical solution to the lack of classes, inheritance and a VMT”. My point was simply that if you sat down to program Angular in Smart Pascal or Delphi, you would use ordinary inheritance to solve many of the more tricky subjects angular imposes on us.

And in so doing, no one would bat an eyelid – nor would it be hyped to the point where people believe they can cure cancer with it. It would just be another MVC framework, one among thousands. But since Google made it and spontaneously throws a few workshops around it – people go nuts and imagine that it’s just so much better than anything else out there.

Ladies and gentlemen, that is just sad, disappointing and intellectually disturbing. As a result I no longer believe our species will ever reach the stars, quite simply because the wast majority of our human population are indistinguishable from cattle.

Apple made MVC hot again, but it's an old re-hash from yonder days

Apple made MVC hot again, but it’s really a re-hash from ‘yonder days

Now the blogging I do here can only be one or the other: either a short post (like this one) or a long, more detailed post. It depends on how much time I have and how interesting the topic is. But it’s rare that I post a medium-sized article. I mention this because I have gotten feedback like “Oh you have completely misunderstood MVC” — which is simply not true. In fact I work with angular on a daily basis at work.

But that doesn’t mean I will publish a dissertation on the subject just to underline that I do have experience with MVC. Readers of my blog will know that I’m not a proud individual. If I have done wrong, said wrong or coded wrong I have no problem saying I’m sorry. It is after all impossible to go through life without making mistakes. So if I came across as just shooting things because “I don’t like them” mentality, that was not what I meant; What I meant is that I don’t like them because-of a wide range of valid reasons.

That’s why I cut the MVC criticism short because (quite frankly) I thought my issues would be common knowledge. Clearly they are not so I will try to bring more light to the subject in this post.

MVC is hardly new tech

MVC is not new. It’s bloody ancient and it tends to arise and appear towards the height of a platform’s popularity. So if nothing else it’s a clear indicator that right now JavaScript and HTML5 is at its height, and in the years to come we will see a steady decline in the way we use this technology. The timeframe coincides with the emergence of the next level in computing: namely the cloud and it’s potential.

So for those that believe MVC is something new and fresh – compared to Delphi which is termed old and useless, think again. First of all the oldest programming language still alive in the world is C, which is around six years older than pascal (just to kill that misconception if you suffer from it). MVC is not as old as that, but it’s pretty damn vintage! I remember doing MVC coding on the 16-bit Amiga computer some 25 years ago.

A huge selection of the OS can be automated through AREXX

A huge selection of the OS can be automated through AREXX

One of the lesser known aspects of Amiga OS today is the fact that it came with a built-in automation system called AREXX. It was absolutely brilliant. What programmers did was to define and register AREXX ports in their native applications. These ports worked a lot like socket’s do, in that you can send and receive messages on them. Once exported, which was done by calling the OS informing it about the functions you made publicly available, these functions could be automated and called from any AREXX script.

So what people did was to design the view using a MUI editor (magic user interface), write an application controller and essentially create existing OS level controllers and classes to create an application. Whenever you needed something special you would just import the functionality of a commercial program and use those functions to do your work.

  • Write application controller using AREXX
  • Design views using a MUI (magic user interface) designer
  • Create and maintain OS level objects and controllers
  • Maintain a persistent data model, similar to COM’s property-bag
Listing REXX exported controller ports under Amiga OS

Listing REXX exported controller ports under Amiga OS

Even seemingly new techniques like “MVB”, where you bind or link visual elements to a property in the model could be achieved. In fact on the Amiga you could create fully working, complex and advanced applications using nothing but AREXX scripting. So for those of you that believe the MVC pattern is new and fresh of the mint, sorry to burst your bubble but it’s most likely older than you.

Remember that myself and hundreds of thousands of others were using this more than a decade before Microsoft Windows was even conceived of. I remember bursting out in laughter when Apple introduced their “Automator” script system back in the day. Why? Because the Amiga has that 25 years ago! And it get’s better because in january (I think it was) Apple announced that OS X was now the pinnacle of operative systems, because now they supported REXX scripting (!)

You know what? For ages now people have blamed Microsoft for ripping off Apple’s ideas. But guess what, most of them didn’t come from Apple, but from a kick-ass 16 bit operative system and computer, 15 years ahead of the competition back in the early 80’s.

So Apple have (and there is no doubt here, they have even admitted it from time to time) robbed Commodore Amiga blind. And the fact that they are still lifting good ideas from a 30 year old operative system speaks volumes both about the Amiga and those out to duplicate its technology.

The bright side of MVC

We are all adults here and I take for granted that you have enough life experience to recognize that everything has dark side. It doesn’t matter what it is, there is always some side-effect or “potential for error” or risk assessment where an otherwise brilliant technology yields nothing but disaster. This is true for Delphi’s CCV (class, component, view) pattern, model view controller and dot net’s distributed assembly model. Take your pick, there is no universal technique which works everywhere without flaw, side-effect or zero potentiality for error.

Now the bright side of MVC is fairly easy to spot:

  • If architected with care, the same controller can be used on different views
  • Writing plugins or extending a MVC based framework can be fragmented
  • Under HTML/JS an application appears as a single document, but is in fact rendered by a route manager

If we have a look at these you will notice just like me, that the first one sort of comes naturally.  Right? I mean it’s not an “aha” moment you read here for the first time and just go “Oh my god I never thought about that before”.

The second point is likewise an immediate factoid that you locate if you spend 2-3 minutes thinking about how a 3 partite organized framework must look like. And the last point is cool but ultimately easy to achieve no matter what language, technique or pattern you subscribe to.

MVC applications quickly become a mess to work with

MVC applications quickly become a mess to work with, remember to be nazi at organizing

If I was to point out something positive about MVC, it would have to be the first point on the list, namely that if you carefully architect your controller – it can be used on multiple layout views. So a typical example of something “neat” is exactly that: when you have a website that supports both desktop and mobile devices.

The mobile layout will in the best of cases have the same elements but organized differently. Worst case scenario is when mobile and desktop views use different model fields, forcing your response controller to include logic which MVC was designed to avoid. But in general angular.js is brilliant at bringing this to the world of JavaScript, because it does make things easier for JavaScript developers.

Again, angular is just fantastic for programmers with no knowledge of true object-oriented programming. If all you know is JavaScript then odds are you wont be able to recognize “real” stuff. Your mind would simply exclude it as un-important because it’s alien to you.

Do a quick google on javascript 10kb demos and you will find hundreds of superb graphically demonstrations written in JavaScript. But I can tell you right now that nearly none of those demos are written by a programmer that only know and work with JavaScript. These are old coders like myself with a background in hacker groups, demo and intro programming – and they have been doing this for 30+ years.

The dark side of MVC

The downside of MVC, is that your views can (depending on the framework you use) have something like 30 to 100 controllers running at any given time. Apple is positively criminal when it comes to this. It’s common that a single form design, although a complex one, spawn’s as many as 100 controllers when pushed onto the display.

Why? Because a controller is not the same as “the form resize code”. Oh no, a controller can be anything from watching that you prefix text with a $ character, a routine which keeps track of an application state – to making sure a control horizontally stretch to match its neighbors. A controller is just a piece of code responsible for a single behavior; or better yet – a method which ensures a distinct type of behavior. It all depends on subject, object and toolkit.

Incidentally, this is why Java and C# programmers are so hopelessly dependent on garbage collection. Can you imagine working on a huge MVC iPad project where every single view has between 30 to 100 controllers? This means that every element has controllers taking care of scaling, rotation, movement, fading, projection, touch, routes and cross-view event delegation (phew!). And it’s recursive to you know, hosted user-controls are likewise MVC based! Not exactly an eco friendly, resource moderate technology is it? Not to mention the waste of CPU power just because of a damn coding practice.

Now apply that mess to a single threaded event based runtime engine and try catching an exception induced through an anonymous timer. That’s when the regret of chosing angular over object pascal hit’s you like a ton of bricks and you whole heartedly regret ditching a rock solid language and it’s super effective CCV pattern.

The human factor

By now you probably get that my problem with angular, jquery, bootstrap and it’s likes is not superficial. It’s not based on a whim or defined by something stupid like fanboy-ism. Quite the opposite. In my line of work you have to know several programming languages if you expect to survive. My favorite language is object pascal, everyone knows that, but all languages and techniques, patterns and practices have strength and weaknesses. And it’s your profession to pick the right tool for a job.

So for me personally as well as professionally, a programming language is just a vehicle for my experience. You can’t expect to use the same tool to fix every single problem. Although I must admit that Delphi and Smart Mobile Studio combined is akin to a proverbial swiss army sword.

Bigger the projects, wider the toolbox

Bigger the projects, wider the toolbox

So angular is fantastic if all you know is javascript. But if you come from a more classical background, like Delphi or C++ then angular will soon get on your nerves. Because after a little while you realize that most of the blubber posing as high-tech stocking fillers – exists primarily due to the lack of OOP. It represents the author’s means to overcome, bypass and make up for the fact that javascript is prototypical, not object oriented.

MVC delivers no true benefit over ordinary object pascal’s CCV (or C++ builder, or even C# for that matter). In Delphi everything angular represents (and jquery + bootstrap) would be solved far more elegantly using nothing but vanilla inheritance.

Take something simple, like using the same controller on two different views:

type

TMyView = Class(TCustomForm)
public
  procedure SomeControlOperation;virtual;abstract;
  procedure SomeOtherControlOperation;virtual;abstract;
end;

// Our mobile "view" takes care of the mobile displays
TMyViewMobile = Class(TMyView)
public
  //Layout and operations for mobile views
  procedure SomeControlOperation;override;
  procedure SomeOtherControlOperation;override;
end;

// Our desktop "view" takes care of larger displays
TMyViewDesktop = class(TMyView)
public
  //Layout and operations implemented for desktop displays
  procedure SomeControlOperation;override;
  procedure SomeOtherControlOperation;override;
end;

In the above example we isolate our API, which essentially act as our controller, as purely abstract methods in our ancestor class. We then derive and derive two separate variations, one for mobile and one for desktop. Each of these implement their kind of layout according to the rules we impose in our API (the public procedures).
Since this example only have two elements to support (desktop and mobile) it would be better to implement the desktop behavior directly in the root-ancestor (TMyView) and have TMyViewMobile override that for mobile devices. If nothing else than to keep our code tidy and neat.

Not a controller in sight, but easy to use, deploy and debug

Not a controller in sight, but easy to use, deploy and debug

What I have objected to about angular (et al) is this popular but certainly false notion that MVC produces better, faster, easier or cleaner results than the above. In fact the result would be exactly the same. I would also go so far as to say that using inheritance is cleaner and provides a human bonus: namely better organization. We don’t have to use X number of folders to organize views, controllers and model schemas – because they all make up 3 parts of a common whole. Why write 3 times as much code for absolutely no reason other than pretending to be cool?

So this popular notion that object pascal is old, ancient or past it’s expiration date (comparing to MVC) is simply not true. The entire misconception is based on ignorance and laziness, plain and simple. And how can I propose that? Because there is no technical benefit of choosing MVC over a traditional CCV object orientation. People chose the hyped re-hash because it’s easy, not because it’s technically excellent, faster, yields better results or any of those superlatives.

Just remember: with great simplicity emerges an even greater lack of diversity!

Aros, winner of most interesting OS

May 12, 2015 2 comments

Right. As most readers know by now – once a year I get this unstoppable desire to check out all things alternative in the realm of operative systems. I mean, it’s important to stay on top of our game as developers, and the only way to do that is to make an effort. In this case an effort to look at upcoming systems which may become our own sometime in the future.

And as always one of the criteria is (drumroll) that they should support Object Pascal.

The AROS operative system

Aros desktop, not exactly graphically impaired

Aros desktop, not exactly graphically impaired

Now this year’s winner of “most interesting and promising operative system” must be Aros. It’s a fantastic little OS with plenty of features, and almost as interesting as the operative system itself is it’s exciting and rich background. How do you know that users love their OS? When they decide to reverse engineer it from scratch after the owner goes belly-up, just to make sure it survives (!).

Yes, that was the case with Aros; It’s actually an old-timer in the group of “new operative systems” because Aros is short for “Amiga research operative system”. Yes you read right, Amiga, as in the 1983-2001 prodigy home computer. Odds are that you owned one of these machines in your teens or at least heard of it, and if that is the case then you most likely remember Amiga OS. This was a wonderful operative system lightyears ahead of it’s time. It actually was technically superior to Microsoft, IBM and all the other players back then with around 12 years. That it’s potential was never realized ultimately came down to some spectacularly bad business decisions at Commodore. Never let people who cant code run a computer company.

For my part I remember Amiga OS vividly. My best friend at the time owned an IBM PC and while he was stuck in DOS playing Larry Leasure suite, I was doing things he could only dream about under Amiga OS. I actually learned all my programming skills on the Amiga, so I was an above and beyond fan of the system throughout my teens and well into college.

It was only when Windows 95 came along with it’s fancy new driver system, fast graphics processor and soundblaster cards that the tables were turned. But for roughly 13 years (in Norway at least) the Commodore Amiga was the undisputed champion; both operative-system wise and game/multimedia wise. It was cheap, efficient and the #1 creativity machine. In fact Apple only recently implemented support for REXX which is a scripting system Amiga OS supported from 1990 and beyond (version 1.3 of the software). That speaks volumes about how far ahead Commodore was.

Ok, but what can Aros offer?

Classic Amiga OS version 4

Classic Amiga OS version 4

If you are expecting a boring, grey desktop and faithful reproduction of the early 90’s then no, that is not what Aros is about. Aros is reverse engineered from the Commodore Amiga OS formula; based on available API documentation. As such it’s designed to be compatible on API level, not binary compatible with ancient 16 bit software. In short this means that you can take an Amiga C source-code for instance and re-compile it to run under Aros. But Aros really represents something much more valuable than retro flirting: It represents an actual future for an OS which delivered multitasking a desktop environment 10 years before Windows 3.11 was invented.

The reason Amiga OS has survived all these years is because it’s underlying architecture is brilliant. The way drivers work, the layout of the file-system, how libraries are loaded, how memory is managed, how multi-tasking is solved — all of these things are dealt with in a way which makes for a fast, responsive and highly enjoyable user experience.

It’s not like Windows where evolution meant patch after patch after patch. Amiga OS was designed to avoid bloat. It was designed to deal with libraries and extensions gracefully and intelligently. It was designed to boot fast, respond fast and deliver maximum performance with ridicules sparse resources. Amiga OS boots happily into as little as 4 megabytes of RAM. Yes you read right, four megabytes (not gigabytes). And the speed is phenomenal, you wont believe it until you try it.

Aros is absurdly fast

Aros is absurdly fast

So, with Commodore long gone and the copyright holders showing no interest in doing anything with the Amiga brand, Aros is ultimately the last hope of a realization of this 30 year old dream. A dream of a small, compact, fast and “no bloat” operative system performing miracles from pennies and scraps of ram and CPU. And it works brilliantly. The formula which Carl Sassenracht (the authorof large parts of the OS) deviced all those years ago has proven to be the software equivilent of the ARM processor. ARM was likewise an “old timer” technology until recently. It was almost shelved and taken off the market, it was just by accident that they discovered that the ARM architecture could run just as efficient on low-voltage as it did on “ordinary” power. Had it not been for that economic feature, ARM RISC cpu’s would be a thing of the past.

The Amiga is just like that. An older formula and architecture of an operative system, but one which delivers so much computing power with absurdly few resources. Imagine what Aros can be with a few years of development behind it, and perhaps a couple of hundred programmers?

Have you ever wondered just how fast your PC really is? Imagine how fast Windows would be if it was hand-coded in object pascal and assembler. Not a single procedure wasted and no bloat what so ever. Well with Aros you will find out, or at least as close as you can get. Aros is written in C/C++ (like most operative systems), but the architecture and philosophy ensures that it remains small, efficient and lean. My Aros PC boots in around 3 seconds from powering it on until I can use the desktop. And this is on older hardware (my test machine was a 8 year old dual-core system with 4 gigabytes ram). The desktop is snappy and things like moving windows around, playing video — it’s so bloody fast you will hardly believe it.

To be honest, if Aros keeps this up it will turn into a money saver. Windows and Linux has gained weight over the years, both in complexity and media integration. Aros represents in many ways a clean start, a start with a vision which is now 30 years old. A dream of an OS so lightweight, elegant and easy to use that it makes computing fun again. An OS where efficiency matters and everyone tries to tweak the last drop of CPU out of their code. A system where code is regarded as a work of art.

What about software?

This is why I have given Aros a Mickey rating (both winner and loser), because software will always be a new operating system’s achilles heel. But it’s really not as bad as you think. It’s millions of miles beyond obscure systems like Risc OS (recently re-surfacing and enjoying a renaissance on the Raspberry PI). Why? Well, first of all the Aros authors have provided tools for porting from Linux free for all. Secondly, they have made a few extra libraries to facilitate porting to the platform — and third, because Aros can run 68k (Motorola 68000 CPU) based software!

Loads of juicy titles for Aros, but more is needed

Loads of juicy titles for Aros, but more is needed

That’s right, Aros is capable of running almost all classic 16 bit Amiga software through UAE integration. And believe you me, 20 years of coding makes for a rich and mighty collection of software titles. But yes, this large resovare of software is older. So if you are expecting Adobe dreamweaver, mono developer or Photoshop — that’s not going to happen any-time soon.

But if you can live with The Gimp, like millions of Linux users do — then you will find Aros well stocked in the graphics department.

Software development

And now for the biggie. Does Aros support object pascal? That is the mother of all questions isnt it, at least for us Delphi, SMS and FPC developers. There is no point using a platform we cant program for right?

Well I am pleased to say that Aros does support object pascal and there is a full port of freepascal for the platform (!)

Lazarus is still being ported, so it's not quite ready

Lazarus is still being ported, so it’s not quite ready

It must be underlined that Lazarus is still being ported (!), only FPC is ready out of the box, but lazarus will be excellent on this platform! Lazarus feels more at home with Linux due to it’s multi-window layout. Well, Aros is based on Amiga OS which means you can run applications in their own separate screen. And in such an environment Lazarus really comes into it’s own. It’s the undisputed king on Linux, making mono/C# look like a sad toy in comparison.

Using Aros as a real desktop

Before you sell your house and donate your mother to science, you should give Aros a proper test-drive. You dont want to wipe you Windows installation without really knowing what you get. I recommend installing Aros into a VMWare image first (or some other x86 free emulator from Sun) just to get to know it properly. Remember to create two partitions, one boot and one work (larger). This is more or less traditional for Amiga systems.

Is it ready to be the default desktop? Soon

Is it ready to be the default desktop? Soon

To get a hold of software you point your browser at Aminet, which is the #1 source of 68k and more modern software. There you will find classic stuff like PPaint, Deluxe Paint and ofcourse, freepascal. Exploring the Aros website is also a good idea.

Like all small communities (just like the Delphi community) there are forums you can become a member of. This is perhaps a good start so you have someone to ask and help you out. But Aros / Amiga OS is so much simpler than any OS you have tried to date, so once you “get it” you will be able to navigate most of it without help.

Entering a platform with a bang

The utter upside of any platform is that there will be a huge demand for software. In fact, the worst platforms to create software for is in many ways Windows and OS X, because there you will find hundreds of different alternatives doing the same thing.

On a new, fresh OS the competition will be weaker and you stand a good chance of making some cach once the user-base has brown beyond 10.000. I have no idea how big the Aros world is, but I do know there are at least 10.000 Amiga users in the world, be they retro-gamers or die-hard Amigans. The Amiga is actually a phenomenon. It’s 30 years since it was created this summer; and it went out of production around 1999 (Commodore filed for bankryptsy in 1994, but the license to produce and sell Amiga lingered on for many years). Yet still there is a living market for these machines. These are 30 year old computers running at 7 Mhz (not Ghz, but Mhz), yet people love them to death and still use them in their thousands!

It's an impressive feat, remember this is a user project!

It’s an impressive feat, remember this is a user project!

It should be mentioned that a CPU frequency comparison really means little for the Amiga. It has a set of custom chips dealing with memory copying, pixel moving and everything else. Also the motorola CPU is very different and can do a lot of stuff intel cant with few instructions.

The Amiga was ultiately beaten technically by the lack of single-datatype pixels (e.g: 1 byte for 8bit, 2 bytes for 15/16 bit, 3 bytes for 24 bits and 4 bytes for 32 bit graphics) like the PC have. The Amiga had something called inter-leaved graphics which means a single picture is divided into X layers at different places in memory. For a 32 color display you actually have to write to 5 different memory addresses to set a single pixel (!)

In short, the Amiga has to work 5 times as hard to deliver the same as a PC. Yet you will see these old Amiga computers knock out effects and demos which are en-par with modern PC demos. It really is a strange and mysterious social phenomenon, shrouded in mystery and lore — the platform just wont die! It’s almost ridicules how much beating this system takes, yet there it stands — a reminder of what could have been. An alternative reality which could have been ours where operating systems were light, fast and fun – as opposed to big, bloated and expensive.

Freepascal on Aros

One of the things I love about object pascal no matter the dialect, is that just like the Amiga – object pascal is a language which just wont go away. People have been predicting the downfall of object pascal for decades now, yet object pascal is still highly popular and very much in demand around the world. And just like the Aros team reversed engineered Amiga OS from scratch, so did the FPC and Lazarus team do with Delphi. They cloned a free, open-source version of a language and development platform they loved – to ensure that it would survive regardless of it’s legal owner’s whims.

Older freepascal running under AROS

Older freepascal running under AROS

The result today is that object pascal has a huge, staggering, overwhelming public domain library of source code. You will find units and libraries for just about every conceivable topic. From super-fast games to serious and excellent tools — object pascal have it all.

This means that with a bit of porting work, replacing OS calls where possible – or re-implementing stuff in pure object pascal, thousands of titles could be implemented with ease on the Aros platform. A person with skill and a bit of time on his/her hands can really make a nice bit of money here, by charging a small fee for each program and being honest and give support, the Aros platform would grow rapidly — and your income with it.

Final verdict

Hm. This is always the tricky part.

Aros is slowly becoming a complete desktop environment. I think it’s important to separate OS from desktop, because they are essentially two different things. The OS is what makes a desktop possible, what makes windowing possible, what makes everything possible. A desktop is the human interface into those features- typically provided through default programs and behavior.

Aros is, shortly said, a pretty faithful re-implementation of Amiga OS. But it has evolved away from the old Amiga look and feel (thankfully). But while the underlying OS is no doubt up for the challenge, the desktop experience and default software doesnt quite impress. At least not users who havent started an Amiga in 20 years, or people who have never used an Amiga at all.

Having said that Aros is “almost there”. It’s missing a few minor applications which will add the final touches, but most of all it’s missing that “killer application” to make it popular. For Microsoft it was Word that started it all, for Mac it was no doubt Photoshop, Logic and pro-tools (counting from when Steve Jobs came back up until now), followed by the “family package” which is iMovie, iTunes, iThis and iThat. You get fantastic apps with your mac and that draws customers in.

What Aros really needs is a fantastic software package which only exists on that platform. What exactly that should be I leave to you, the reader. As object pascal programmers and armed with the might and onslaught of our collective source-code repositories, I have no doubt what so ever that it can be object pascal that delivers this — but it will require hard work, dedication and a vision.

If Linux is not your thing — head over to The AROS website and have a look — and yes, it’s free (!)

The art of pissing people off

May 8, 2015 Leave a comment
To provoke is a part of self-examination, education and growth

To provoke is a part of self-examination, education and growth

Ok, I admit it. Part of writing a blog is to be informative, helpful and the whole good guy thing. But another just as important part is to challenge stereotyping, old ideas, new ideas and to basically be a profiled prick. And I admit it, I am exceptionally good at pissing people off — but at the same time I force people to re-evaluate their ideals, tendencies and patterns.

Over the past four years I have pretty much done it all. I have dizzed Delphi on numerous occasions, not because I mean every word of what I wrote (well, the XML mapper is dying for attention, that I meant) but because the only way to create life is to break apart the old, stagnant constructs that is holding an otherwise brilliant technology back.

And look at all we have achieved!

Hate me, love me, It really doesn’t matter. You can hardly say that the Delphi community would be the same without that hyper-active Norwegian who cuts straight to the chase, taking no prisoners and churns out a fair load of code month after month. I even taught Delphi for free in my local community for over 2 years just to make sure I had done everything I could to protect my job and skill-set.

I have been yelled at, thrash talked on forums I never even knew existed, a guy even tried to knock me down once in Oslo after a Delphi meetup (boy was he surprised, I did thaiboxing for 10 years and still remember a few tricks *smile*). I have gotten letters telling me in exquisite detail how utterly retarded I am, but also letters thanking me for helping, creating or solving problems they have struggled with.

I helped this kid in India who could not afford Delphi, so I gave him a copy of Smart Mobile Studio professional. I got a warm letter from his mother thanking me, because using SMS he had got enough object pascal skill to be accepted to the schools computer group. Meaning he would have access to Delphi 2 days a week. And if he works hard he can become a developer as an adult.

You cant put a price on letters like that, it makes you humble. And if everyone in the Delphi community cared enough about our language, our skill-set and the work we do – and help out more, we would have secured our jobs and technical skill for decades to come. I dont make a dime on what I do — I do it because I genuinely care about programming. Programming teaches you to think and to see the world. Cause and effect, potentialities, abstract constructs — the things that makes a mind sharp, insightful and inquisitive.

What better legacy to leave for the next generation of coders? Take responsibility for your profession, because no-one else will.

Paying the devils dues

So do I piss off people on purpose? No, of course not. No sane human being sits down intentionally and plans what to put in a blog. People that insane are usually patients or politicians. No, I tend to wing it as I see it. And I get a lot of things wrong too; Although I tend to get more right than wrongs. Especially when it comes to programming and movements / tendencies in the market.

Lately, especially with the whole freepascal/lazarus thing going on, I just wanted to put this out there. I’m not intentionally out to get anyone or to cause problems “just for the hell of it”. I actually never saw that one coming at all. Which is a shame because had I been prepared I would have served up some cool jokes. It would have been an awesome show. But alas, I was not prepared and hey– i’m only human (well, sort of).

So my stance on blogging goes a bit deeper than just churning out the same boring, superficial crap like everyone else. I dont know, perhaps something stuck with me from art class in my teens, where dialog, free press, the art of writing and human expression was still important.

In other words – If you are going to write, no matter what it is, you are obligated to challenge yourself and others. Conflict is by nature unavoidable because each mind is an island onto itself. It’s impossible to go through life without meeting, eventually, someone who just doesn’t like you. Without any valid cause at all. They just don’t like YOU. And I’m good with that because it goes both ways. It’s fantastic!

But to challenge ideas is important. It’s important because a living, breathing entity – be it a social structure, a metaphysical structure (programming for instance) or a mechanical structure, must be in movement at all times. If death have a property it is the lack of activity and movement. So a dead programming language is one that doesn’t change, that remains static – immutable and unchallenged from cradle to grave.

I kinda enjoy being the devil in the deck. People think the worst of the devil, but they don’t realize just how important his role is in the grand scheme of things. Without the devil there would be no fall from grace, no grace, no distinction, no value and  no peace; nothing to contrast happiness against – nor the notion of positive vs. negative.

Never take anything at face value

Never take anything at face value. Notice the balloon? *smile*

All communities, no matter if it’s programming, social groups and even families – needs a black sheep. A rouge which gives voice to things people would rather not talk about, forget or brush under the table. If there is an elephant in the room, trust the devil to point him out and question why people pretend they dont see it.

In modern society we tend to drug kids that do that, without understanding what a huge loss it is to society. We should be careful of throwing out the devil, because we might just throw out the best in us.

The devil is in the details

Shiva, unbound consciousness

Shiva, unbound consciousness

If all of that sounded a bit religious then relax, I’m not religious. I am a student of tantrika, which is a part of sanatana dharma (hindu esoteric tradition) and buddhism alike. My principal deity is Krishna; The thief, the rebel, the rouge, the best friend to arjun (the mind) who runs into battle to restore order. The maintainer of “that which is functional” in the universe. And my guardian deity is shiva.

Because when things get rough, its shiva the destroyer that swoops in and kicks-ass. And just like Krishna is a part of all human beings psyche, so is Shiva. Who do you think you are when anger takes you over?

And yes, these are psychological symbols which defines aspects of nature. And that includes human beings since we are after all products of nature.

Shiva is a very misunderstood archetype. He is called the destroyer, smears his body with ash from burned corpses, carries a trident — and hence people look at him as evil. But his role and function in nature is to challenge those who think they know it all, break apart structures that no longer serve humanity and ultimately make sure things “work”.

Without shiva, which is the root of the christian devil, there would be no creativity, no new inventions and all would be dull, dark and without life.

If that is to be my archetype in all of this, then so be it. I’m happy to play the devil of freepascal as they now call me; and my work will no doubt insult, scare, impress and help those that use them.

Speak of the devil

Just before we were about to release Smart Mobile Studio (alpha release) a few years back, an individual was so upset with me over that invention, that he actually called me and threatened me on the phone. That’s how protective people are about what they love and work with. That’s how dependent some people are on their habits, their knowledge and their self-image.

Kinda scary don’t you think? Bordering on mental if you ask me. And this is over programming. Not family, children, millions of dollars, your house or the death of a loved one — no, programming (!). Behind it all he was so scared that SMS would somehow kill Delphi as he knew it, that he would no doubt have physically attacked me if he could. People are strange when it comes to their world view. They will do almost anything to protect what they believe is “right” and fight with tooth and claw against “the wrong”.

Little did he know that my mission was not to destroy, but to strengthen object pascal and ensure that his knowledge and expertise would remain valuable and useful in the years to come.

And it has worked like a charm! In the UK kids are learning Smart Pascal thanks to the effort we made, both us on the SMS team and everyone who has helped make it a reality. So kids are growing up and will remember 50 years from now that they learned to program in Smart Mobile Studio. And that is valuable. That means something. And you cant create that without utterly smashing the ideas which no longer works or serve us poorly. And in doing so you will provoke people, like unwritten facts always do.

Devil or not, I am happy I’m not that shy, ego ridden critic that doesnt make a licking difference in his entire life. Death to me is to be stiff and motionless in your work and what you enjoy. To be so utterly boring that you never even speak up when gold is replaced with shit. And to blindly let 15 years of excellence and hard work just fade into oblivion. What did you do to help Delphi remain vibrant and relevant? People who criticize me should ask themselves that before they throw the first stone.

And if that makes me the devil of freepascal, the angry nerd of hades, the emir of forks (or whatever insane title they cook up this week) then I wear that title like a badge – with pride!

Because I did stuff they never dared to do; And brush shoulders with people they will only read about. So bite me.

“Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.”

Angular JS + BootStrap and why it’s all bull

May 6, 2015 10 comments
Hype is the number of the beast when it comes to development

Hype is the number of the beast when it comes to development

Web designers and web “architects” as they like to call themselves, are into bling. Their job is after all to help bussinesses sell whatever product they have; be it a perfectly valid product or a completely useless piece of droppings. But with a good designer at your disposal you can to some degree ensure your product will sell. At least at first. So when designers and bling-doctors set out to create their tools of the trade, it’s pretty much natural that they will make it look like the greatest thing since the discovery of the wheel. And people swallow it, hook line and sinker.

JQuery

Take JQuery for instance. It’s a simple little library to collection (query) information about the DOM (document object model). It allows you to set properties on collections rather than single items and it also have a handful of helper functions for effects, css and dealing with JSON and REST.

Eh.. no thanks!

Eh.. no thanks!

Yet when you read the documentation or hear people talk about it – it sounds so fantastic. You can cure cancer with JQuery, did you know that? It’s hype. It’s just spin and you should know that by now.

Angular.js

Angular is, seen from the JS developer’s viewpoint, a fantastic library. It allows you to define content in one place, controller code in another place and Angular gives you the tools to glue those two parts together. The controller is the part which has code, meaning that you access the controller to perform operations on the model (the data) – which is reflected in the view (the html). But wait just one minute! Havent we heard all that before? You have data separated from functions, functions separated from the display — yet they all come together to form a single entity? Yes. You have heard it all before. What I have just described is how a normal class works. The reason it’s divided into controller, model and view has nothing to do with better, next generation or any of that crap — it has to do with the fact that JavaScript doesnt have classes, or inheritance, or polymorphism or any of the fundamental features real programmers expect to find. So if you are a JS programmer Angular is fantastic, because it allows you to break down a presentation (read: component) into logical parts, deal with callbacks and display sequences in an orderly fashion and so on. But for a programmer coming from C++, Delphi or C# — Angular is a childish toy. There is no reason to break these elements apart, that’s why God invented VMT’s (virtual method tables).

Yeah yea, bla bla bla bla, hype

Yeah yea, bla bla bla bla, hype

I mean, have you heard some of these presentations on youtube about angular? Wow. It even get’s me going for a while there. The mental image they paint is that angular is going to solve everything! If you can just use angular, then your website will scale, dance, sing and even click it’s own likes. But when you start coding with angular you realize that it’s just a non-productive way of emulating OOP through objective thinking. It’s technical masturbation. You isolate your data in one place, your procedures in another place and your visual appearance a third place. This is exactly what OOP was created to solve. It may be a step forward for JavaScript, but compared to Delphi, Smart Mobile Studio, C++ or any “real” programming language with OOP — it’s a gigantic step backwards.

Components is MVC

MVC (model view controller) is a programming pattern, or style, which has become very popular lately. It was initially hyped by Apple to get people onboard their Objective C wagon for iOS and OS X development. Picked up by other languages, especially JS which is the mother of all bling, it has become almost the norm. Both in the world of nodeJS and DOM programming in general.

Oh but you can change things easier and use the same controller with different views, or have different controllers for the same view. So? Thats what inheritance is all about:

type

//baseclass for database read values
TBaseDBStorage = Class(TW3Object)
end;

//filtered database values, inherits from base
TFilteredDBStorage = Class(TBaseDBStorage)
end;

//basic display widget
TBaseDisplay = Class(TW3CustomControl)
private
  FData: TBaseDBStorage;
protected
  function getDBStorage:TBaseDBStorage;virtual;abstract;
End;

// display optimized for desktop
TDesktopDisplay = Class(TBaseDisplay)
protected
  function getDBStorage:TBaseDBStorage;override;
end;

// display optimized for mobile devices
TMobileDisplay = Class(TBaseDisplay)
protected
  function getDBStorage:TBaseDBStorage;override;
end;

I mean, the above OOP code allows you to fetch data from a server, and also specialize it as needed. We also roll out two display controls, one for mobile and one for desktop, and we give them different display and layout rules. This is faster and easier than writing two controllers, two data structure profiles, two html segments and two CSS rulesets. Same result, except the code above can be expanded indefinitely without messing up existing models.

So there!

So there!

What people fail to notice is that MVC is just plain old TCustomControl. An ordinary TCustomControl has data (fields), which is a model — methods and implementations which is the controller, and a view (surface, canvas or operative-system viewport). And just like under MVC the code is there to act on the data and control the visual output. What angular does is essentially to rip OOP apart under the assumption that this will make things better. But it doesnt make things better, it makes things worse (!)

Mutation events

Now if you’re a JS programmer feeling you have to defend angular, please relax. I know all about the data binding layer – because just like angular Smart Mobile supports mutation event handling as well. And we do it through proper OOP with full inheritance. Mutation events is just a fancy phrase for “tell me whenever anything changes in the DOM”. So a mutation listner can be created and set to listen to changes on either the whole DOM or a particular piece of the DOM (like your panel or a button for that matter). Whenever a property change, an attribute or a CSS style — you get a callback event with the change data. Using this system Google has made a neat system for binding data changes to visual tags. For instance, whenever you change the value of a variable – you can hook that variable up to a section and have it display the change “live”. You can also bind visual input, like from a textbox, to a variable, another field or whatnot. Sounds familiar?  Delphi Visual Live bindings anyone? Angular creates the illusion of being black magic; and to the JS punters and kids it probably is. But sadly the only spell it casts is one of blinding hype.

Bootstrap JS

Bootstrap has to be, with the exception of jQuery, the biggest disappointment of them all. And I dont write this just to be negative or anything like that. I am genuinely disappointed at how such a small library, containing nothing particular interesting at all, can get so popular so fast. Bootstrap.js is essentially a theme engine. That’s it. Yes you read right, a plain old vanilla theme engine, like we have had in Delphi and C++ for decades now. Bootstrap allows you to define simple constructs, like a panel. It will then automatically align and position your input controls and DIV’s according to a 12 point grid. Does this sound familiar? It should because every Delphi control has an align property, and TLayoutPanel has been shipping with Delphi since 2006. If you add some clever CSS styling on top of that — you essentially have bootstrap.js

Final verdict

In this post I have told you the truth about some very, very big and popular javascript libraries. They are popular and famous because for a JS developer, which doesnt have the luxury of OOP like we do – these libraries is heaven sent. But for everyone who has OOP, like Smart Mobile Studio, there is absolutely no benefit to using angular, bootstrap or jQuery at all. In fact the RTL was designed in such a way that there should not be any unknown tags in the DOM. Hence jQuery is useless because what exactly should you use it for? TW3CustomControl encapsulates the uber-hyped MVC of Angular, our web units outperforms and outweigh the angular toolbox by a factor of 10 — so again there is absolutely nothing angular provides which has any value to a seasoned and professional Smart Pascal programmer. He would make angular.js himself within days (!). Not because he is so clever, but because OOP and inheritance makes it possible. Modern OOP was designed to better help you deal with problem solving, spanning recursively through a well written and designed architecture. This is why OOP rules the world and procedural and objective programming is a thing of the past.

A better and far more powerful way

Over the next six months I will be presenting my web technology. This means that the tools you will get – through smart mobile studio – and the classes you will also get, will help you create web applications that knock the boots of all these 3 libraries. So far Smart Mobile Studio has only been for mobile application development. Well that is about to change (slowly) as we begin to add more and more support for full-on “page” designs. You can naturally create websites today, but webpages demonstrates a slighly different behavior – both in terms of scaling, scrolling and general navigation. You want to create awesome websites with little code? Sure you do! You want to use your Delphi skills to create fantastic HTML5 user-controls which no other language delivers? Sure you do! And you want to connect to databases, REST API’s and your own nodeJS based service layer? Hell yes you do! Well, let’s teach these JS kids how real programmers solve these things 😉

Why Amiga is cooler than .net and the perfect embedded environment

May 6, 2015 7 comments

I know, you probably think I’m just another fanboy trying to convince you to use a 30 year old, 16 bit operative-system. Or perhaps I’m just a lunatic with fond memories of my childhood gaming experiences.

No, I’m actually talking serious stuff here. Ok, here it goes:

Unless you have been living under a rock for the past 10 years, computing is heading full stream ahead into virtualization. Companies like VMWare have been doing this for well over a decade now, and before that there were thin-clients and multi-account Windows installations that was all the rage (or Linux, Or OS X for that matter).

Point is: companies are tired of getting boxed into a particular piece of hardware or processor.

MorphOS is an Amiga clone, but it's bound to outdated PPC hardware

MorphOS is an Amiga clone, but it’s bound to outdated PPC hardware

The solution is two-fold: You can go the way of VMWare and emulate a whole machine, from the bios to interrupts to USB triggers. An absolutely astounding piece of engineering if you ask me.

The other route is what Microsoft have been doing, namely to ensure that their programming tools are platform abstracted. The .net framework is more than just a framework or coding standard. It’s a virtual assembly language for a virtual processor which you implement in software. What happens is that the first time you run those bytecode assembly instructions, the JIT compiler assembles them into real, processor bound OP-Codes which run natively.

Have you heard anything like that before?

Amiga, really?

Now switch over to UAE and do a comparison: The UAE platform is, give or take it’s dependence on the host – a complete self-sustaining virtual hardware environment. It’s designed in much the same way as the .net HAL (hardware abstraction layer) is, and it has the benefit of running on a tiny kernel.

So while people may feel that Amiga-OS is long gone and dead, it’s actually now coming back as a perfect virtual environment. Why perfect? Because Windows 10 is still 800 megabytes (embedded preview) while AmigaOS 3.9 or 4.0 + linux kernel + bootstrap is less than 50 megabytes (!) And that’s the full OS with all bells and whistles.

A quick visit to AmiWeb to grab your assembler, your blitzbasic and your C++ compiler and you have a pretty awesome portable, virtual platform running on cheap x86 parts.

I sincerely hope there is a good coder out there that can revive Amithlon as an open-source system.

What the hell is Amithlon?

AmigaOS running on x86 without Windows or a dedicated host OS

AmigaOS running on x86 without Windows or a dedicated host OS

Amithlon is a tiny version of Linux which is designed to boot only one thing. In fact it’s just the bare bones of Linux, no applications, no X server or anything like that (just drivers, bash and rendering via the framebuffer). So it has just the ability to boot into a very small and compact setup. The boot-sequence does one thing and one thing only: boot into a custom-built Amiga Emulator. A JIT based environment which treats mc68k assembler as (drumroll) bytecodes (!)

Amithlon allowed you to install Amiga OS 3.9 on ordinary x86 PC hardware. So finally you could take advantage of cheap and powerful x86 parts and run AmigaOS at high speed using a custom JIT engine.

Where is Amithlon now?

For some insane reason Haage & Partner, which seem to have shipped this system a few years back, just shelved it. I don’t know why so many stupid decisions seem to haunt the Amiga, but this one really is the frosting on the cake. A fully working system which allowed Amiga to run fully abstracted on cheap x86 hardware! And they fu**** shelved it!

I would really like to see that system go open-source. Who has the code? Where did it go? It worked brilliantly yet H&P shut it down — why?

If you have the source, please please give me a PM and I’ll compile it, setup a SVN repository and GIT node and generally make it available to the masses.

QTX IDE for freepascal

May 5, 2015 Leave a comment

It’s been a hectic couple of weeks that’s for sure. I’ve been called the death of freepascal, a devil with anterior motives, a civil war monger and much, much more. It’s quite dramatic don’t you think? I mean “civil war” (insert dark voice here) and all that. We are talking about programming languages, not the borders of Bosnia. Yet drama these guys spin like spiders on drugs.

And killing the guy that raises the red flag, when did that become popular? So when I go “yo — there is something wrong here, be careful”, they just respond “Why did you say that, I don’t want to know there are bad things in the world!”. Guess I should be glad we’re not in the army together huh? That could get messy.:”Me: Guys there are mines here, go around, seven o’clock!” — “FPC/Lazarus: Everyone into the minefield and twirk like mad! That’s an order!”.

So the entertainment is priceless. Just wonderful to watch people allergic to the words “im sorry i thrash talked you, my bad, you were right to tell us” squirm around like vipers being cooked alive on a chinese barbeque .. pride can be an ugly thing.

Be very careful when using CodeTyphon, wait until it's clear of all GPL and copyright violations

Be very careful when using CodeTyphon, wait until it’s clear of all GPL and copyright violations. I wouldnt go near it personally.

Well, despite all the bad news, the slandering and negativity – I remain cheerful through it all. Why? Because rather than stealing code from others or trying to bypass laws and regulations, I put my time into writing the Quartex IDE from scratch without the help on anyone. And I did that exactly to avoid the awful mess PilotLogic and freepascal now find itself in.

It’s really simple:

  • If i need help, I ask politely
  • If i want to use a component which is free, I ask politely
  • If i want to use a full GPL piece of code, I still ask politely!
  • I dont remove author names, but instead put them in the About box to respect the authors, thanking them for their work
  • I try to solve things first myself before asking for help
  • I use standard packages like SynEdit and Jedi exactly to avoid GPL/copyright problems

Incidentally I was trying to stop problems from happening, but everyone needs someone to blame so if blaming me for pointing out copyright theft and GPL violations — whatever makes you happy I guess. I honestly don’t care any more what happens to these systems. I should not have wasted my time trying to help FPC/Lazarus and CodeTyphon. I guess there is a reason these groups have a bad reputation – sadly I have them the benefit of the doubt.

The best comment on the FPC forum must have been “Who has given you the right to prosecute pilotlogic!” — well, in that case: who has give you the right to make FPC better? Because protecting FPC was what I was doing. So who the hell made you king and decided that you could fix bugs? Do you think you’re better than anyone else?  Huh? — that’s the kind of insane thinking I’m faced with. It’s just unbelievable.

QTX for freepascal

That would be a no I think. Since people actually believe that I am a devil incarnate in all of this, it would only serve to make their insanity a self-fulfilling prophecy. And QTX will render Lazarus useless, so … dont think they would be to happu about that either. They would no doubt scream “I told you so, he was plotting this all along!”. Which is fun because I’m not that diabolical even on my best of days, I couldn’t because there is a limit to how much evil scheming I get done with 3 kids, homework, brownie baking and a full time day job as a C# programmer.

Freepascal is a great product, but the forum is full of characters which do more harm to the product then good.. All projects get's nutcase

Freepascal is a great product, but the forum is full of “characters” which do more harm to the product then good.. All projects get’s nutcase “groupies” but usually the leaders have the sense to get rid of them. This has sadly not been the case here

So, I guess the plans to support freepascal has to be canceled. Which is really a shame because I truly believe in FPC/Lazarus as a universal platform. QTX would sort of be the icing on the cake. And even if you don’t like it – it would still be good to have it, because the more alternative we have the better.

But nope, I will not be supporting freepascal or lazarus after all. If people want it they can ask of course, I might change my mind in a couple of years; but right now I wont go near that copyright mess with a 10 foot pole. Nor would I support people who verbally abuse supporters when trying to help them (months in advance btw). They can blame themselves. A user group that hostile serves little or no purpose what so ever.

Alternatives

But there are always solutions for those that look; in heaps and buckets. QTX is designed to be a transcending platform, meaning that it compiles to an intermediate format (LDEF) which in turn can be represented in other languages through a code-generator API. A bit like .net but on source level rather than binary.

This means that I will be focusing on vanilla C++, shipping QTX with the free GNU C++ compiler, which is the fastest most widely developed and used compiler in the world. And I do believe it has the widest support for hardware out there as well, so it’s not bad news at all.

So to sum up:

  • You write object pascal just like Delphi or FPC
  • The compiler compiles to LDEF
  • LDEF is compiled into C++
  • C++ is compiled to machine code using the free GNU C++ compiler
  • Voila, you have a free path on both Unix, Linux, Windows, OS X and pretty much every platform out there

What have you been doing lately?

That is a good question. I have been very busy with my day-job coding in C# so there has been limited time for personal projects. But last weekend I added a new cool feature to QTX, namely a second way of opening units by cursor.

QTX is still young, but packs a mean punch

QTX is still young, but packs a mean punch

You know that you can CTRL + Click on a unit-keyword and the IDE opens the file automatically for you right? Well, what if that unit is a part of a package? Wouldnt it be great if the IDE not just opened the file – but mapped the file to the treeview so you can see all the files? This is optionally of course, but it will save you a lot of time when writing packages yourself or porting packages from Delphi/FPC.

This is a humble change I agree, but sometimes making the ground-level functions rock solid is valuable. It’s exactly those functions that have been crashing Lazarus for ages. Lazarus is really only perfect on Linux, on Ubuntu for instance it’s just bloody brilliant and really hits the mark. But on OS X and Windows it’s often the small functions, those you take for granted that crash and burn.

So I’ll be spending a few extra months before alfa release just doing those functions really well. The advanced stuff can wait. I’m going for stable and rock solid over super-modern and unstable.

Angular + knockout + bootstrap = Smart Mobile

May 5, 2015 8 comments

I have been suuper busy lately with work so I havent been able to upload the latest “angular, knockout, bootstrap KILLER” library.

In essence it goes like this:

  • Bootstrap is good for UI’s
  • Angular i good for data binding
  • Knockout is the same, but with a few cool twists

Smart mobile studio absorbs them all through object orientation, which in turn renders them useless compared to our model 🙂

Stay tuned for more eh.. knockout code 😀

Oh this is going to be fun :)

Oh this is going to be fun 🙂

Pilotlogic and codetyphon in clear violation of copyright law

May 4, 2015 3 comments

The past couple of days has been pretty rough. A couple of individuals have been pestering this blog asking for ‘evidence’ regarding my earlier post on GPL violations by PilotLogic. Which is a bit ironic. They have the strength to type hate posts both here and over at the lazarus/freepascal forum, but lack the energy to read earlier posts about infringement of rights. The term trolling comes to mind.

Chain of events

Piracy is piracy

Piracy is piracy

Yesterday a member of the Delphi Developer Group (Facebook) brought forward the evidence I was pointing to all along. I did not want to implicate him or any others by name, but considering the slander, threats and more being posted against me – you leave me little choice in the matter.

Leading up to this was the following chain of events:

So on saturday I visited Pilotlogic’s forum where I found a rather colorful description of myself. I was a liar, a thief and a troll (eh, yeah, because I run around forcing people to read my blog *sigh*).

When I responded to this the Pilotlogic group posted my personal address, phone number and a link to a previous employer. This is just completely unacceptable and utterly out of line. It’s also illegal to do so without consent in Europe and I would guess it’s illegal in the US as well.

When I responded with evidence together with a friend, we were both kicked from the forum and banned. The original thread was likewise deleted.

A third person, an administrator for Delphi Developer visited the forum to ask exactly what was going on with their GPL situation. He received the same treatment.

The debate continued on the freepascal and lazarus forum, where I was once again threatened to be kicked and banned for telling the truth (!). Not only did I write about this breach in order to protect FPC/Lazarus from damages (and also because I find pilotlogic’s behavior rude and unacceptable), but I also did so to give pilotlogic a fair chance to fix the problem. The respond from the community however has been a clear case of killing the messenger.

Firemonkey/VGScene open source?

Firemonkey is based on a commercial product called VGScene (also DXScene) which Embarcadero bought. VGScene has never been an open-source product, yet we find that pilotlogic’s ORCA system is in reality a carbon copy of VGScene. They simply copied the damn thing, re-named the classes and branded it open-source (!) And they are now continuing to bundle this code and giving it away to their customers.

That is piracy, plain and simple.

I am not going to wade though all the code here, those that really want to have a look at this should head over to the freepascal/lazarus thread where you will find all the information. In short: orca and vgscene was put through a normal comparison test and there can be no doubt that ORCA IS VGSCENE. A product now owned by Embarcadero.

I think it speaks for itself

I think it speaks for itself

VGScene was never open-source, it is a commercial product all the way. So this is a clear violation of copyright law.

Their response? To kick and ban me and the guy which has written to pilotlogic countless times warning them about this. I mean — how bloody stupid can you get!

GPL violations

A total of 3 GPL violations were brought to light yesterday. The evidence was so clear that the Lazarus and FPC community is issuing a formal wiki-page urging pilotlogic to clean up their mess!

Final words

I would like to say to those that have slandered, thrash talked and outright lied to protect their own sorry asses and implicate me — from the bottom of my heart: go and fuck yourself. And I mean that deeply, and from the depths of my being. Preferably with a broom and some breakfluid.

You wanted evidence? Well I didn’t want to post evidence here since that would sort of make it a dead-end for pilotlogic wouldn’t it? Fucking morons. I posted the article because I wanted pilotlogic to clean up their act. But you guys just had to push it didnt you? But head over to lazarus and read the thread – there should be more than enough to fill your hunger for drama and blame there.

You guys should be ashamed of yourselves. Posting personal contact information about me, my home, where my kids live? Oh I really hope you come up here, I’ll give you beating of your life.

You guys have utterly disgraced yourself. You dont threaten a man by name in public. You should be thankful I dont report this to the police, because we have kept PDF signed snapshots of all the rubbish you have posted.

I take for granted that this is the last I hear of this case.

Windows stripped, revelations

May 2, 2015 1 comment

Lately I’ve gotten my hands on 4 super sexy HP thin clients. They are from 2006 so I got them cheap (almost give away price) but they work brilliantly. I decided to go with Windows XP embedded since that system is much easier to tailor and mold to my needs. I also updated two of them to Windows 7 embedded and DSLinux respectively.

How small is Windows, really?

When Windows 95 came out everyone was in shock: holy cow what a bloated OS! We were all used to 16 bit operating systems, like the Amiga where the operating system cam it at around 5 megabytes. This was because the kernel on the Amiga was on chip though. We were also used to Mac’s which operated on much the same principles, where the OS was a single floppy and parts of Mac OS was on chip as well.

Thin clients make excellent emulation machines. Here installing Amiga OS 1.3

Thin clients make excellent emulation machines. Here installing Amiga OS 1.3

Well today I had a small revelation. Having studied up on Terminal Server and thin clients, I found out that Windows embedded, no matter what version, is essentially the exact same software as the full desktop versions.

The only difference between Windows embedded and the all-round, commercial desktop edition – is that the embedded version has absolutely nothing extra. You use an image builder application to tailor the Windows image, and absolutely nothing else is added to the installation.

This means: no extra drivers or libraries, no extra images, no extra programs or protocols — all those myriad of files floating around you harddisk are gone.

Guess how big the core Windows system is? Take a wild guess? 44 megabytes!

As you add modules to this, like remote desktop support, networking standards and protocols, applications, hardware drivers, usb support (and so on) it slowly starts to grow. In the end my full Windows XP installation came in at a whopping 250 megabytes (roughly rounded)!

USB rescue stick

As you can probably imagine, a hacker like myself (in the good sense in the word) could not let this opportunity go unnoticed. So immediately I started constructing a rescue USB disk with the bare basics. How big did you say? Well the smallest USB stick i have is 8 gigabytes. I dont think you can get anything smaller these days? At least not in Norway.

Amiga UAE, installing OS 3.9

Amiga UAE, installing OS 3.9

Either way I partitioned the USB drive and gave the boot partition 1 gigabyte and then the work partition 7 gigabytes for applications and tools. I dont think i’ll be running out of space any time soon. It’s a rescue boot after all.

The really sexy thing about this is that it boots incredibly fast! Just plug in the USB stick, switch on the PC and BAM you’re in windows.

Now naturally there are restrictions. Like I mentioned the embedded version’s strength is it’s modularity. So creating a universal USB stick will be almost impossible without adding the standard Windows driver library. But you can pick a generic display driver with semi-high resolution, a vanilla sound driver, USB driver and CD-rom driver. And naturally you want to copy over english, american and norwegian keyboard layout files.

Well — hope you found this interesting! The reason I bought the thin-clients were initially to create emulation machines (turning it into a dedicated Amiga or Nintendo), and learning more about terminal server software. But right now I’m tempted to whip out Delphi and create my own television set-top-box 🙂