Smart Mobile Studio
  • News
  • Forums
  • Download
  • Store
  • Showcases
    • Featured demos
    • The Smart Contest 2013, Round 1 – Graphics
  • Documentation
    • Get the book
    • System requirements
    • Prerequisites
    • Getting started
      • Introduction
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • Themes and styles
    • Project types
      • Visual project
      • Game project
      • Console project
    • Layout manager
    • Networking
      • TW3HttpRequest
      • TW3JSONP
      • Loading files
  • About

Export features: zip and ftp

Posted on 12.02.2012 by Jon Lennart Posted in Developers log
Export to FTP

Export to FTP

While not in the original specs I decided we must have FTP publishing support in Smart Mobile Studio. In popular demand from people in the alpha group I also added zip support. This means that you can now export your project either locally or remotely, in either normal file format (backup) or as a compiled project.

This adds to the already built-in functionality to save your entire project as a single file (all external files can be included in the project file).

What is exported?

If you go for the “backup” export then Smart takes you entire project folder, source and resources, and copies it to the target. If you opt for a zip export then all the files are stored into a normal zip archive (native Delphi zip support of-course, no external libraries needed) and saved to the target location.

If you have selected FTP as your mode of export then the zip archive will be shipped off that way.

This will make it a lot easier to maintain X number of mobile applications from your developer machine no matter where you host the files.

It will be a fairly ad-hoc approach in v1.0 but we will add more to the foundation in later versions of Smart Mobile Studio. In the future you will be able to script and automate the IDE to do magical things 🙂

Upcoming features

What can Javascript do?

Posted on 10.02.2012 by Jon Lennart Posted in News and articles
Would you believe its 1k of source?

Would you believe its 1k of source?

A lot has changed since the average programmer had a stab at javascript. As a Delphi developer I played around with it roughly 10 years ago (when everyone was doing scrollers, pop-up windows and the “dark side” of javascript) but a couple of years ago I realized that browser technology had come of age. And thus Smart Mobile Studio was born.

To give people a taste of what modern javascript can do I want to share a link to the JS1K website, which holds a “yearly” competition for the best javascript demos (using the canvas tag). The rules are simple: stuff as much graphical bliss as you can into 1k of source-code. The best effect and technique get’s the price.

My favorite is without a doubt: http://js1k.com/2010-first/demo/171 but all the demos on the website are really spectacular. Especially considering the size of the sourcecode.

So head over to JS1k and have a look!

And who needs webGL when we have hardware acellerated 3d transformation in webkit? Check out Sprite3d (note: requires a webkit browser, like Safari or Chrome) which we aim to wrap for Smart Mobile Studio in v1.2. Here is Mario Cart written in javascript and HTML5.

javascript

Understanding smart

Posted on 08.02.2012 by Smart Mobile Studio Team Posted in News and articles
Compiler technology

Compiler technology

First, we are extremely grateful for all the positive feedback and questions regarding Smart Mobile Studio! We cannot underline enough how the enthusiasm really makes us work that much harder to deliver a knockout product that will serve the community for a long time. It is indeed clear that we have hit “bulls eye” and a serious gap in the modern programming model can now be filled. We are equally excited to that the emails stem from every corner of the software developing world, from the Delphi community, the C# community and believe it or not -the javascript community itself.

This is quite possibly the most significant Pascal
development to be watching right now, and brings
the wonderful Pascal language to the world of
Internet development! -Simon Stuart, Delphi developer via Google+

Since so many people have asked more or less the same questions, it would be a good idea to outline just what Smart is and what it does, so that people can appreciate even further the depth and broad application of what we are building and what we hope to achieve.

The compiler

Like all code generating systems, the Smart compiler knows only a handful of things. It knows how to handle units (source files), procedures, classes, enumerations, assignments and other important language features. But on it’s own the compiler have no “built in knowledge” of neither what a browser is or what a control looks like. A compiler and code generator is a very complex piece of software that is able to take your source-code, break it down and transform it into something else. Which is javascript in our case. But it could equally have been machine code or C#.

Beginners will discover a language that has withstood
the test of time with unparalleled elegance.

This is where Smart differs radically from a lot of the other products on offer, namely that its built from the ground up to be “real”. Where other HTML5 products out there have a fixed set of classes, and knowledge of what you are allowed to do is pre-determined by the vendor – Smart has more in common with a classical C++ or Object Pascal environments where you are in charge.

The VJL

Just like in Delphi

Just like in Delphi

As you should expect, all the components and classes that ship with Smart was actually coded in Smart itself. We also ship the source units for our RTL (called the visual javascript library, or VJL in short) so that people can examine, learn and also make changes if they want to.

The underlying [RTL] work must have been tremendous -Michael Thuma, Delphi developer via Google +

You could in fact replace the entire RTL with your own version if you so desired. And that is something that no other mobile development studio on sale today can match. They all come with a predefined set of classes, and in the majority of cases these are closed API’s. Meaning that you dont have access to the source.

Smart blows this to pieces just like Borland Delphi once did. While the list of classes you get for free out of the box is to large for this document, the most noteworthy are:

  • TW3Component and TW3CustomControl
  • Full implementation of HTML5’s canvas
  • CSS animation classes
  • Font and bitmap handling, both on-screen and off-screen
  • Buffer classes and buffer-view classes, painstakingly implemented from the WC3 standard
  • Form classes, TApplication and smooth scrolling when navigating between forms
  • Timers, style mapping and much much more

And of-course, with a real compiler you can create as many classes and components as you wish. And you don’t have to be a javascript guru to do so. All you need is some basic understanding of object pascal and you are set to go.

Boundless possibilities

Just like you can create anything under the sun with Delphi, C++ builder or C# due to the fact that these environments have a real compiler – you can create anything you like with Smart Mobile Studio. Smart both compiles to and can interface directly with javascript – which means that whatever javascript can do, Smart can do.

Cool! I created my first OP4JS control: a DHTMLX grid
-André Mussche, Delphi developer via Google +

Smart Mobile Studio, early Alpha

Smart Mobile Studio, early Alpha

It is by definition impossible to say what people will use Smart for. So far people have created games with it, connected to remote web-services, displayed database grids, added control bindings, created fantastic fractal explorers and much, much more. Just like Embarcadero ignited a firestorm of creativity on the Windows platform – our aim is carry that fire into the next frontier which just happens to be the browser.

So the question is not really if Smart Mobile Studio can support feature X. If you can sculpt it in either JavaScript or Object Pascal, then Smart can support it. We will provide you with the Visual Component Library and all the tools you need to create and interact with HTML5 and the latest web developments. We will also work hard to provide you with a standard set of components – but also give you the option to extend our technology with your own packages and components.

Nothing is impossible

Smart Mobile Studio is a vision and an idea. An idea brought to the table by Jon Lennart Aasenden, and embraced by the management at Optimale Systemer AS and a some key developers in the Delphi community. It was by many said to be impossible, if not heretical. When we presented the concept for the general public back in December 2010, it was met by applaud from the few and ridicule by the many. To make it a reality we have worked extremely hard, considering the technical difficulties involved.

Right before Christmas we shipped the first Alpha version, and some smart programmers of the Delphi community immediately created some stunning demos and thus proved the concept right.

And now, in February of 2012, the product has matures further, and we can proudly say that the vision has become a reality.

This tool should really get a place be in every Delphi developers toolbox.

 

Sincerely

The Smart Mobile Team

HTML5 javascript Pascal Smart Mobile Studio

Smart device orientation

Posted on 08.02.2012 by Jon Lennart Posted in News

Primoz Gabrijelcic has published some very exciting code for working with iOS device orientation and movement. These features will of-course be a part of our RTL code base on release – but for now you can check out Primoz great examples and familiarize yourself with the concepts.

You can find the device orientation demo here. Also make sure you checkout Primoz website for interesting articles, advanced code and knockout components!

Gematria, playing with numbers

Posted on 07.02.2012 by Jon Lennart Posted in Developers log
The platonic world view

The platonic world view

Ever seen those extremely annoying banner-ads that proclaim that you name has a magical meaning? Ever wonder how they manage to extract values from something as simple as a name? Well if you promise not to make another banner then i’ll share the secret (he said with a scary voice).

Ye old gematria

This is an old routine for calculating those sublime and mystical numbers of ancient lore. It was converted from ordinary Delphi without much problems. It only needed a minor adjustment on the array constants to work. This shows just how easy it can be to port over ordinary object pascal from other systems and get them running on your website or mobile device.

Note: In the charset constant below I have used ordinary, modern Latin characters. This will of-course go terribly wrong if you attempt to decode ancient Greek or Hebrew. You will need to manually replace the modern characters with the unicode versions of the old alphabets (this code out-dates unicode and widechar).

Enjoy the mystery 🙂

[sourcecode language=”delphi”]
type
TJLGematria = (gmCommon,gmHebrew,gmBeatus,gmSepSephos);

const
JL_GEMATRIA_HEBREW: Array [0..25] of Integer =
([0,2,100,4,0,80,3,5,10,10,20,30,40,50,0,
80,100,200,300,9,6,6,6,60,10,7]);

const
JL_GEMATRIA_COMMON: Array [0..25] of Integer =
([1,2,700,4,5,500,3,8,10,10,20,30,40,50,
70,80,600,100,200,300,400,6,800,60,10,7]);

const
JL_GEMATRIA_BEATUS: Array [0..25] of Integer =
([1,2,90,4,5,6,7,8,10,10,20,30,40,50,70,
80,100,200,300,400,6,6,6,60,10,7]);

const
JL_GEMATRIA_SEPSEPHOS: Array [0..25] of Integer =
([1,2,3,4,5,6,7,8,10,100,10,20,30,40,50,
3,70,80,200,300,400,6,80,60,10,800]);

Function JL_CharToGematria(Value:String;
Const Codex:TJLGematria):Integer;
const
Charset = ‘abcdefghijklmnopqrstuvwxyz’;
var
FIndex: Integer;
FTemp: String;
Begin
result:=0;
FTemp:=value;
FTemp:=lowercase(FTemp);
FIndex:=pos(FTemp,Charset);
If FIndex>0 then
Begin
dec(FIndex);
Case codex of
gmCommon: inc(result,JL_GEMATRIA_COMMON[FIndex]);
gmHebrew: inc(result,JL_GEMATRIA_HEBREW[FIndex]);
gmBeatus: inc(result,JL_GEMATRIA_BEATUS[FIndex]);
gmSepSephos: inc(result,JL_GEMATRIA_SEPSEPHOS[FIndex]);
end;
end;
end;

Function JL_StrToGematria(Value:String;
Const Codex:TJLGematria):Integer;
var
x: Integer;
Begin
result:=0;
value:=lowercase(trim(value));
If length(value)>0 then
for x:=1 to length(value) do
inc(result,JL_CharToGematria(Value[x],Codex));
end;
[/sourcecode]

The final battle begins, persians on the run

Posted on 06.02.2012 by Jon Lennart Posted in Developers log

For those that have been following Smart Mobile Studio from idea to realization, I am happy to announce that the final piece of the IDE is now under way. I am ofcourse talking about the visual designer -which is more than a brain teaser since it has to talk with Javascript in real-time. We have also added skin support to the next alpha release (and yes you can turn it off) and all the latest compiler switches. Smart linking is also working now, so your compiled apps will be as small and fast as possible.

Look and feel is now in the hands of the user

Look and feel is now in the hands of the user

Spartans

Bring it on

Bring it on

If you are new to Object Pascal you might be wondering about all the references to Greek myth and history that always seem to follow pascal coders. As you probably know Delphi was the capital of ancient Greece in its golden days, typically refered to as “the navel of the world” as this was where Apollo killed the serpent. Since the most famous and popular object pascal studio is called Delphi – then naturally object pascal coders the world over adopted this. And yes, we had the spartan helmet long before the movie “300” came out.

It is also a re-occuring phenomenon that if you challenge a pascal programmer, he will respond with a quote from 300 – especially if he hears the word “impossible”.

Impossible to compile to javascript you say? THIS IS SPARTA!

What can smart offer me?

Posted on 06.02.2012 by Jon Lennart Posted in News and articles

Smart Mobile Studio has a lot to offer modern developers. If you are looking for a way to maximize the potential of the HTML5 platform then Smart has a recipe unlike any other on the market. No matter what industry or field of expertise you focus on – Smart provides benefits that saves time. It makes technological and financial sense.

Beginners will discover a language that has withstood
the test of time with unparalleled elegance.

Advertising

You need an edge in what you do

You need an edge in what you do

The world of advertising and content production operates with high demands. The market is constantly changing and the tools of the trade you have relied on for years – might not even be there tomorrow. Some vendors have consciously banned technologies like Adobe Flash in favour of HTML5 – which means you better start looking for a new method. A method which enables you to deliver quality content, on time, according to your clients expectations. Customers are simply not interested in flash banners any more.

Smart Mobile Studio allows you to take your HTML5 code to the next level. We provide a rich set of visual components ready for use out of the box. No fiddling with styles to get that native look, no experimental hacks to get it working and no shortcuts. This means you can spend your time focusing on delivering rich content and lasting impressions straight away.

As a bonus all your web skills remains relevant as ever before. Smart can interact with other frameworks and you can easily add your own, native javascript code.

With Smart Mobile Studio you finally have a tool that can deliver HTML5 friendly advertising with no dependencies. No plugins, no custom browser extensions needed. What you get is cutting edge javascript which runs incredibly fast.

Entertainment and multimedia

With touch based devices like the iPad (or the rapidly expanding Android based market) almost everywhere these days, the future of tablet based gaming and multimedia is golden. But moving code from a classical programming environment to the web requires time, patience and money. Javascript is a fantastic language that commands great power and potential, but compared to C# or Object Pascal you will find yourself cutting corners.

Browser games are getting more and more advanced

Browser games are getting more and more advanced

Smart Mobile Studio means you don’t have to cut corners. You get all the missing pieces of a real programming language, like actual object inheritance, variants, var parameters and interfaces. This means that converting already existing code from Visual Studio, Flash or C# to HTML5 is radically faster.

Finally you can focus on getting your game or multimedia app out there. Need an off-screen bitmap? No problem. Need a high speed drawing surface? No problem.

With Smart, creating online games becomes far easier because all the boring stuff is already done. You have classes for drawing graphics, both on-screen and off-screen. You get classes for communicating with your web service and you get a native looking GUI skin out of the box. Altering the look of your GUI is just a matter of editing a CSS style-sheet.

Business software

No matter if you are focusing solely on the mobile market or want to create dynamic browser applications, Smart will help you get started straight away. As a modern developer with a background in C#, C++, object pascal or java – first contact with the alien landscape of javascript is often a culture shock. It has been said that going from Delphi or Visual Studio to javascript is almost like trading in your PC or Mac for a Commodore 64.

Javascript can now deliver serious applications

Javascript can now deliver serious applications

As a language javascript has no support for OOP in the true sense of the word, no virtual methods, no abstract methods, no interfaces and absolutely no var parameters. These restrictions alone makes it very difficult to create and maintain large scale applications in native javascript. When we add the fact that you must create, or buy, a GUI framework on top of this, the financial aspects involved in “going native” can hardly be justified.

Smart Mobile Studio removes 2/3 of the challenge straight away. You get a language which is very popular, has a massive code-base the world over, is easy to learn (especially if you have OOP background) and which supports modern concepts like interfaces, classes, inheritance and other “must have” features. So instead of spending months learning in-depth javascript, circumventing it’s pitfalls through trial and error, buying a ton of books and basically re-inventing the wheel — You can pick up Smart and deliver a killer app in no time.

Smart will take your object pascal code (the same flavour as made popular by Delphi and Free-pascal) and compile it into cutting edge javascript. The compiler even sculpts the missing language features, like interfaces and inheritance, in javascript itself. So the generated code have no dependencies. You don’t need a plugin or browser extension at all. It will run “as is” in any webkit based browser (Chrome, Safari, Safari Mobile and more).

Further reading

  • What is Smart Mobile Studio
  • Understanding Smart
  • Take advantage of classical programming
  • Tired of handcrafting your javascript apps?
  • Documentation and sourcecode examples
HTML5 javascript Pascal Smart Mobile Studio

iPhone accelerometer in Smart

Posted on 05.02.2012 by Jon Lennart Posted in News

Primoz Gabrijelcic have published a steady stream of examples since we released Smart Mobile Studio to the test group. This time he has coded a very nice app that demonstrates using the accelerometer and getting the orientation vectors of your iPhone or iPad.

You can find the acceleration demo here. Also make sure you checkout Primoz website for interesting articles, advanced code and knockout components

Ghost polygon, back to the 90s

Posted on 04.02.2012 by Jon Lennart Posted in Documentation
Spaceballs

Spaceballs

In this little tutorial we are going to take a trip back in time, back to the golden age of personal computing. A time when the ultimate computer was the Commodore Amiga and the latest kid on the block was wire-frame 3d graphics and polygon art. I am of course talking about the 1990’s and the glowing polygon effect.
Continue reading→

graphics tutorial

Working with javascript structures

Posted on 04.02.2012 by Jon Lennart Posted in Documentation 4 Comments

When interacting with ordinary javascript libraries or a remote webservice you natually have to go native with your datastructures. Under Smart this can be handled in a variety of ways but the two most common approaches are to either use a record or a variant.

Using records

Records in Smart work just like they do in other object pascal environments. And since Smart compiles to javascript rather than machine opcodes, a record will always compile to an ordinary javascript structure. I should note that javascript really doesnt distinguish between what we would call a record and objects. In javascript everything is an object.

So the following object pascal code:

[sourcecode language=”delphi”]
type TMyInfo = Record
miName: String;
miAge: Integer;
miGender: integer;
End;
[/sourcecode]

Results in the following predictable javascript code:

[sourcecode language=”javascript”]
{
miName: "",
miAge: 0,
miGender: 0
}
[/sourcecode]

This means that when you want to interact with native javascript libraries that expects a structure of values, you can use records to match it directly.

Variants

Using variants to achieve the same thing is perhaps easier, especially since you dont have to predefine the structure by hand. As of writing however it does require you to initialize the variant manually. We will probably add some RTL functions to simplify this very soon, but for now you can use this “one liner” ASM snippet:

[sourcecode language=”delphi”]
Procedure testvariant;
var
mData: variant;
Begin
asm @mData = {}; end; // Set variant to "empty JS object"
mData.miName:=’john doe’;
mData.miAge:=39;
mData.miGender:=1;
end;
[/sourcecode]

The resulting javascript structure will be exactly the same as that produced by the record. One difference to keep in mind though, is that the compiler will output the names “as is”. There is no way for Smart to map the content of a native object so make sure you get the names right.

Another article about Smart

Posted on 03.02.2012 by Jon Lennart Posted in News

Pascal Game Developer has a nice article about Smart Mobile Studio. Visit their website and have a look: http://www.pascalgamedevelopment.com/

Thinking ahead

Posted on 01.02.2012 by Jon Lennart Posted in Developers log 3 Comments

I have to come up with some names for the different technologies soon. Smart now have two terms for compiler and also two levels of RTL: the low level RTL that is a part of Eric’s compiler, and a high level RTL which is our “VCL” clone. Im thinking of naming our component library the VJL (visual javascript library), and instead of refering to the compiler infrastructure as “the compiler”, it is more fitting to call it “the build tool”.

One vs. many

As the test group knows, the build-tool takes your source-code, invoked the compiler and finally glues everything together into a final, solid HTML5 document. Since our system was originally designed for iOS development only, and since Smart components (including forms, which is our version of pages in a way) are purely javascript based – a fully operational “app” really only needs one HTML file.

In Alpha 2 i removed the injection of code directly into the document.body section and introduced “Application.Display.View” to the VJL. The reason for this was make the application regard “the screen” abstractly. So by altering what “display.view” points to – you can make your apps live inside any DIV you wish.

A couple of testers have reported back that it could be handy to separate the RTL from the program code. There are a number of scenarios where you might, for example, want to run multiple Smart apps on the same document. If you run a website and want to get rid of Flash for instance, it would be nice to code the new banner in Smart and also host a game or a cool menu written in Smart as well.

Having talked it over with Eric it became clear that this should be reasonable to achieve, but it will come at a price: namely that it defeats the latest compiler switch named “smart linking”. When you smart link your apps, only the code you have used is included in the final binary (in our case “binary” is javascript). It’s the same technique Delphi and C++ uses to make programs as small as possible.

So if we include the feature then it will disable the smart linking option. I am experimenting with this now, by dumping the entire RTL into a separate file. If it doesn’t produce any negative side effects (except a small speed penalty and some bloat) then I’ll include it as an option. Eric might slap me over the head for playing around with this – but it would (in my view) complete the parallel of “Delphi” for javascript.

Reusable libraries

One of my long term goals is to add a new project type to Smart for writing libraries. Which would be the javascript incarnation of DLL’s. Since we have our own IDE we could generate a class-map for the library – which you could then import later so the Smart IDE can keep track of what the libraries export. A bit like a Windows TLB file when working with COM objects.

We should be able to poll this off by isolating the compiled code in it’s own name-space. It would then have it’s own RTL and library – but due to the nature of Javascript, it should actually work 🙂 It would mean a little tweak to the RTL but we are constantly tweaking anyhow.

Why are libraries important? Components, that’s why. By pre-compiling and obfuscating your code – you could write and sell your own components. The other benefits are self evident I think.

Tired of handcrafting your Javascript apps?

Posted on 01.02.2012 by Jon Lennart Posted in News and articles

Before we started developing Smart Mobile Studio we did a survey of the alternatives for developing mobile apps. That’s actually where the initial idea and motivation came from. During this survey we must have tested at least 14 different “app” machines, languages and “rapid” development environments. We tested the serious players like C++, object pascal, C# and Java – to the outright scams which usually include the phrase “create your app in a day” (but the app you get is just a template with no real value what so ever).

The result of our survey was disappointing to say the least. At the time, using Free-pascal to work with iOS was a bit of a black art so while that was our initial choice – any substantial information regarding cross compilation was virtually non existent, so we decided to go for C# in developing our iOS apps. This involved learning a new language, a new platform and to some extent a whole new way of thinking.

But one thing we did notice was that Javascript had come a long way. While all the native systems were struggling to get aboard the iOS and Android bandwagon – javascript was all over the place. Doing things it’s not supposed to do in classical terms. Everything from silky smooth animations to action packed platform games.

This is a snapshot from a game written in BlitzBasic which demonstrates what modern Javascript can do. We are old fans of Mark Sibly at Optimale Systemer!

Javascript can now do amazing things

To make a long story short we continued working in C# and object pascal, but as the idea behind cross compilation and using javascript as a medium began to grow, we found ourselves seeking out like-minded people, putting our ideas to the test. Unlike the “app machines” however, we did it properly from the ground up.

So the question is not if javascript works. The question is how to use that power properly.

Working with ordinary web technologies

When we took the time to look at javascript with new eyes, three things became apparent. First, browsers are not just page readers anymore but rather fully fledged multimedia environments. Secondly, Javascript has grown and can make use of the browser in a whole new way. And last but not least: javascript’s lack of structure is both it’s strength and it’s downfall.

Take something simple like a visual component. When you dig into the complexities of this simple task it turns out it’s not that simple after all. As of writing there exist no single standard between the different javascript frameworks on the marked. It is also highly unlikely that it ever will – because it’s not financially beneficial for these companies to work together. They would lose their uniqueness if they did, not to mention the technical difficulties getting two javascript frameworks talking to each other. When you use a framework you stick to it, mixing two different systems could in theory work – but in real life it quickly becomes a mess.

Classic remake of capcom streetfighter using gameQuery JS framework

Classic remake of capcom streetfighter using gameQuery JS framework

Encapsulation and portability of source is also an issue, not in terms of browser compatibility – but in terms of programmers sharing solutions. There are several ways a javascript developer can create the same thing – and the lack of a common approach (which classical languages solve by syntax, classes and a common foundation like the VCL) makes it extremely time consuming.

After we created a small demo/game in Javascript, testing out ideas and playing around with the multimedia features, it became crystal clear that it simply takes to much time to hand-craft large projects in javascript. You can use one of the many ready-made frameworks out there, but the amount of source code you need to write for a large game or application is ridicules.

So what is the alternative?

HTML5The alternative is not to ignore javascript, but rather to use javascript as a medium. What we did with Smart Mobile Studio was to transform a disadvantage into an asset. Javascript is the proverbial “wax that takes many forms”. We projected the rigid and time proven structure of object pascal onto the “everything goes” landscape of javascript. The end result is that you can now use the power of object pascal, it’s encapsulation, it’s class hierarchy, it’s true object inheritance and (thanks to our super clever compiler guru Eric Grange) even fancy concepts like interfaces, closures and var parameters. So not only do you get the power of javascript – you also gain the wisdom and experience of more than 18 years of pascal evolution (not to mention the object pascal community which is a living genius factory).

With a few hundred lines of pascal code you can achieve what it would require thousands – if not tens of thousands lines of javascript to match. But the central strength of pascal is that of scope and size. A large object pascal code-base can be maintained due to the architecture of the language. The same project in “native” javascript terms would be nearly impossible to keep track of. The time and cost involved in developing and maintaining a 200.000 lines long javascript project cannot be justified when you can achieve the same with 20.000 lines of pascal. Object pascal was designed to handle large projects. Javascript was not.

So. Are you tired of spending days hand-crafting javascript that could be delivered in hours?

javascript Pascal Smart Mobile Studio

Taking advantage of classical programming

Posted on 31.01.2012 by Jon Lennart Posted in News and articles
10.000 lines of javascript can be hard to maintain

Javascript can be hard to maintain

Let’s face it, Javascript is both a powerful and flexible language, but developing and maintaining large scale projects in a dialect not really designed for it is frustrating. The reason javascript libraries like jQuery, jQTouch and Sencha have remained more or less unrivaled for years now – is first and foremost because of the monumental effort involved.

The key factor itself have to do with the actual language. Javascript is a fantastic language, but sadly it lacks many of the traditional programming concepts native to languages like C++ and object pascal. Concepts like classes, true object inheritance, interfaces and type casting – techniques and technology created exactly for the purpose of making large frameworks manageable and robust.

Changing the game

With Smart Mobile Studio however you can take full advantage of these classical concepts. This is because our product allows you to write ordinary, classical object pascal (made famous by Delphi, Free-pascal or other incarnations of the language) and it’s instantly converted into super charged javascript.

The compiler at the heart of Smart generates javascript in a way that implements all the aforementioned technologies. So even if javascript itself doesn’t support concepts like interfaces, it is crafted by the compiler in javascript itself. And if you are worrying about speed – you will find that even with all these powerful and classical technologies – Smart Mobile Studio can run with the best of them. To make it plain: Smart does for the browser what Delphi did for the Windows platform.

You also get an IDE (integrated development environment) specifically designed for Smart programming

Write pascal, compile to javascript

Write pascal, compile to javascript

Easy to use, easy to learn and very rewarding

If you haven’t used pascal before then don’t worry. It was designed to be taught in school to students of object oriented software development. Chances are you have already used it yourself or have heard about Delphi or Free-pascal from a co-worker. Object pascal is responsible for hundreds of thousands of applications in the Windows world – and it’s still knocking out killer apps today.

Easy to use doesn’t make it a lightweight in terms of features however. Object pascal is fast, dynamic, robust and can do pretty much everything C++ can do.

With Smart you can now take your knowledge of classical programming one step further – into the domain of super fast HTML5 web applications. You can also use third party products like Phonegap and compile your generated web app into a real, binary executable program – ready for app-store. In fact, only hours after Smart was released to it’s testers, demo projects made it’s way onto the Android marketplace (!)

So what would you rather maintain? 10.000 lines of javascript code or 1000 lines of pascal code to achieve the same thing? Object pascal is a proven, tested by time and established language designed to handle large scale projects. Javascript is not. The benefits of using a compiler that generates javascript are just to great to ignore.

HTML5 javascript Pascal Smart Mobile Studio

Smart Mobile Studio Alpha 4

Posted on 30.01.2012 by Smart Mobile Studio Team Posted in Announcements

Today the fourth alpha release of Smart Mobile Studio is being issued to testers around the world. While the cosmetic changes are modest there is a lot of new and exciting stuff in both the compiler and IDE. First, let’s go through some of the new features introduced in this build:

Changes to the IDE

  • Keyword proposal support
  • Image to source-code converter
  • Compiler message panel
  • More project options, especially compiler switches
  • Font name, size and color support in preferences
  • Background color support in preferences
  • Support for external .pas files
  • A new project storage format (XML)
  • Support for external .pas files in the libraries folder
  • No more compiling to a temp folder, all projects now creates a bin folder for it’s compiled output
  • The IDE no longer flushes the target folder, so you can safely add your own files without them being removed on compile
  • Infrastructure to support smart linking (not yet activated due to a bug in Delphi XE)
  • More keyboard shortcuts (better Delphi “feel” to the interface).

Changes to the compiler

  • Smart linking of units
  • Closure support
  • Variants are now fully fledged javascript objects, which minimizes the use of the ASM keyword
  • Plenty of speed updates and better performance
  • .. and much more! (DWS changelog)

Changes to the RTL

  • Fixed a bug in TW3TouchData consuming the wrong event buffer
  • More functions to work with images and off screen graphics
  • Fixed a minor bug in TW3HttpRequest

We finally have a open, web based forum up and running – so if you have any questions or want to share some code, navigate to http://smartmobilestudio.com/forums/ and join the community (!)

Keyword proposal

Having the IDE integrate with your source-code is no small thing, but it’s also that little extra that makes the code base come alive. A good keyword proposal engine is also instrumental in learning a new RTL (without having to constantly look at the source or study the class hierarchy).

Keyword proposal

Keyword proposal

As always is the case with alpha software you can expect some bell’s and whistles – but these will be ironed out as we move along towards our goal.

As of writing support for constants and properties are not yet in place but now that the foundation is in place – these will be in place by the next update.

Image to source-code converter

Since HTML5 applications allows you to embed images directly into your HTML documents (or as CSS properties) we decided to build a little tool to simplify this process. Simply point the wizard to the image-file you want to convert, click one button – and it will be converted to text (base64) and copied to your clipboard.

Image to source converter

Image to source converter

For an excellent example of how to use encoded images inside your Smart Mobile application, check out Primoz Gabrijelcic’s remake of the classic Delphi TSmiley example. The original TSmiley was an example put together by Delphi icon Nick Hodges many years ago, and has somehow stuck with the object pascal community in near mythic proportions.

Compiler message panel

Just like ordinary Delphi or Lazarus the compiler engine uses by Smart outputs hints, messages and warnings in response to your code. Being able to review and work with these messages is of-course a must – so we are happy to finally have a compiler message panel in place. Whenever you compile your project it will display messages and information about the compilation process – making it a snap to locate errors, remove unused variables or take better precautions whenever the compiler finds a weak spot.

Compiler message window

Compiler message window

More preferences options

SynEdit (the editor we use in our IDE) is a component that have seen many, many years of development as is regarded as a “classic” in object pascal circles. As such there are a lot of options you can adjust to personalize it. We want to expose as many as possible, and we will keep adding more and more options to our preferences window for each build. In this alpha release we have added better font support and more control over background and text colors.

Preferences is growing

Preferences is growing

 

 

Sincerely

The Smart Mobile Team

alpha release

Pages

  • About
  • Feature Matrix
  • Forums
  • News
  • Release History
  • Download
  • Showcases
    • The Smart Contest 2013, Round 1 – Graphics
  • Store
  • Documentation
    • Creating your own controls
    • Debugging, exceptions and error handling
    • Differences between Delphi and Smart
    • Get the book
    • Getting started
      • Introduction
      • Local storage, session storage and global storage
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • pmSmart Box Model
      • Themes and styles
    • Layout manager
    • Networking
      • Loading files
      • TW3HttpRequest
      • TW3JSONP
    • Prerequisites
    • Real data, talking to sqLite
    • System requirements
    • Project types
      • Visual project
      • Game project
      • Console project

Archives

  • December 2019
  • December 2018
  • November 2018
  • July 2018
  • June 2018
  • February 2018
  • September 2017
  • April 2017
  • November 2016
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • January 2016
  • October 2015
  • September 2015
  • July 2015
  • April 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • November 2011
  • October 2011
  • September 2011

Categories

  • Announcements (25)
  • Developers log (119)
  • Documentation (26)
  • News (104)
  • News and articles (16)

WordPress

  • Register
  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)
  • Prev
  • 1
  • …
  • 9
  • 10
  • 11
  • 12
  • 13
  • Next
© Optimale Systemer AS