Archive
Smart Mobile Studio Workshop
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.
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).
Aros, a Linux alternative
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.
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.
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.
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.
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?”.
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
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?
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
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.
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.
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
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.
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.
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.
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
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
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?
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.
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!
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 (!)
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.
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 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.
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 (!)
Angular JS + BootStrap and why it’s all bull
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.
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).
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.
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
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.
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?
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
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. 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 “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.
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
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 😀
Pilotlogic and codetyphon in clear violation of copyright law
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
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.
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
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.
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.
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 🙂
You must be logged in to post a comment.